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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/add.js +1 -1
  20. package/lib/commands/app/index.js +1 -1
  21. package/lib/commands/app/list.js +1 -1
  22. package/lib/commands/app/remote-directory.js +1 -1
  23. package/lib/commands/app/remove.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app-config/delete.js +1 -1
  26. package/lib/commands/app-config/get.js +1 -1
  27. package/lib/commands/app-config/index.js +1 -1
  28. package/lib/commands/app-config/list.js +1 -1
  29. package/lib/commands/app-config/set.js +1 -1
  30. package/lib/commands/app-config/shared.js +1 -1
  31. package/lib/commands/auth/index.js +1 -1
  32. package/lib/commands/bff/create.js +1 -1
  33. package/lib/commands/bff/delete.js +1 -1
  34. package/lib/commands/bff/detail.js +1 -1
  35. package/lib/commands/bff/index.js +1 -1
  36. package/lib/commands/bff/list.js +1 -1
  37. package/lib/commands/bff/pull.js +1 -1
  38. package/lib/commands/bff/push.js +1 -1
  39. package/lib/commands/bff/status.js +1 -1
  40. package/lib/commands/cli-skill/index.js +1 -1
  41. package/lib/commands/cli-update.js +1 -1
  42. package/lib/commands/codegen/index.js +1 -1
  43. package/lib/commands/codegen/sdk.js +1 -1
  44. package/lib/commands/codegen/sql.js +1 -1
  45. package/lib/commands/common/app-registry.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/dry-run.js +1 -1
  48. package/lib/commands/common/flags.js +1 -1
  49. package/lib/commands/common/local-file.js +1 -1
  50. package/lib/commands/common/validate.js +1 -1
  51. package/lib/commands/config/get.js +1 -1
  52. package/lib/commands/config/index.js +1 -1
  53. package/lib/commands/config/list.js +1 -1
  54. package/lib/commands/config/set.js +1 -1
  55. package/lib/commands/config/shared.js +1 -1
  56. package/lib/commands/data/filter.js +1 -1
  57. package/lib/commands/data/getOne.js +1 -1
  58. package/lib/commands/data/index.js +1 -1
  59. package/lib/commands/data/shared.js +1 -1
  60. package/lib/commands/dataset/business-group-update.js +1 -1
  61. package/lib/commands/dataset/capability.js +1 -1
  62. package/lib/commands/dataset/delete.js +1 -1
  63. package/lib/commands/dataset/detail.js +1 -1
  64. package/lib/commands/dataset/extend-update.js +1 -1
  65. package/lib/commands/dataset/field-update.js +1 -1
  66. package/lib/commands/dataset/generate.js +1 -1
  67. package/lib/commands/dataset/index.js +1 -1
  68. package/lib/commands/dataset/list.js +1 -1
  69. package/lib/commands/dataset/operations.js +1 -1
  70. package/lib/commands/dataset/relation-audit.js +1 -1
  71. package/lib/commands/dataset/relation-create.js +1 -1
  72. package/lib/commands/dataset/relation-delete.js +1 -1
  73. package/lib/commands/dataset/relation-shared.js +1 -1
  74. package/lib/commands/dataset/relation-update.js +1 -1
  75. package/lib/commands/dataset/relations.js +1 -1
  76. package/lib/commands/dataset/rename.js +1 -1
  77. package/lib/commands/dataset/restore.js +1 -1
  78. package/lib/commands/db/analysis-batching.js +1 -0
  79. package/lib/commands/db/analyze-batch-plan.js +1 -0
  80. package/lib/commands/db/analyze-cancel.js +1 -1
  81. package/lib/commands/db/analyze-start.js +1 -1
  82. package/lib/commands/db/analyze-status.js +1 -1
  83. package/lib/commands/db/create.js +1 -1
  84. package/lib/commands/db/delete.js +1 -1
  85. package/lib/commands/db/detail.js +1 -1
  86. package/lib/commands/db/diff.js +1 -1
  87. package/lib/commands/db/index.js +1 -1
  88. package/lib/commands/db/list.js +1 -1
  89. package/lib/commands/db/shared.js +1 -1
  90. package/lib/commands/db/tables.js +1 -1
  91. package/lib/commands/db/test.js +1 -1
  92. package/lib/commands/db/update.js +1 -1
  93. package/lib/commands/doctor.js +1 -1
  94. package/lib/commands/file/index.js +1 -1
  95. package/lib/commands/init/index.js +1 -1
  96. package/lib/commands/issue/index.js +1 -1
  97. package/lib/commands/issue/nudge.js +1 -1
  98. package/lib/commands/issue/report.js +1 -1
  99. package/lib/commands/issue/shared.js +1 -1
  100. package/lib/commands/logs/index.js +1 -1
  101. package/lib/commands/menu/index.js +1 -1
  102. package/lib/commands/menu/list.js +1 -1
  103. package/lib/commands/menu/shared/compare-table.js +1 -1
  104. package/lib/commands/menu/shared/index.js +1 -1
  105. package/lib/commands/menu/shared/inquirer.js +1 -1
  106. package/lib/commands/menu/shared/local-pages.js +1 -1
  107. package/lib/commands/menu/shared/logic.js +1 -1
  108. package/lib/commands/menu/shared/service.js +1 -1
  109. package/lib/commands/menu/shared/sync-core.js +1 -1
  110. package/lib/commands/menu/shared/update-core.js +1 -1
  111. package/lib/commands/menu/shared/valid-url.js +1 -1
  112. package/lib/commands/menu/sync.js +1 -1
  113. package/lib/commands/menu/update.js +1 -1
  114. package/lib/commands/page/generate-start.js +1 -1
  115. package/lib/commands/page/generate-status.js +1 -1
  116. package/lib/commands/page/index.js +1 -1
  117. package/lib/commands/page/pull.js +1 -1
  118. package/lib/commands/page/push.js +1 -1
  119. package/lib/commands/page/relation-audit.js +1 -1
  120. package/lib/commands/page/shared.js +1 -1
  121. package/lib/commands/page/standard-page-status.js +1 -1
  122. package/lib/commands/page/sync.js +1 -1
  123. package/lib/commands/permit/index.js +1 -1
  124. package/lib/commands/permit/page-get.js +1 -1
  125. package/lib/commands/permit/page-set.js +1 -1
  126. package/lib/commands/permit/role-apis-set.js +1 -1
  127. package/lib/commands/permit/role-menus-set.js +1 -1
  128. package/lib/commands/permit/role-menus.js +1 -1
  129. package/lib/commands/permit/shared.js +1 -1
  130. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  131. package/lib/commands/project/create/format-elapsed.js +1 -1
  132. package/lib/commands/project/create/main.js +1 -1
  133. package/lib/commands/project/create/non-interactive.js +1 -1
  134. package/lib/commands/project/create/project-template-path.js +1 -1
  135. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  136. package/lib/commands/project/create/use-format-code.js +1 -1
  137. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  138. package/lib/commands/project/index.js +1 -1
  139. package/lib/commands/project/init.js +1 -1
  140. package/lib/commands/project/upgrade.js +1 -1
  141. package/lib/commands/registry.js +1 -1
  142. package/lib/commands/role/create.js +1 -1
  143. package/lib/commands/role/delete.js +1 -1
  144. package/lib/commands/role/detail.js +1 -1
  145. package/lib/commands/role/index.js +1 -1
  146. package/lib/commands/role/list.js +1 -1
  147. package/lib/commands/role/shared.js +1 -1
  148. package/lib/commands/role/update.js +1 -1
  149. package/lib/commands/role/user-add.js +1 -1
  150. package/lib/commands/role/user-remove.js +1 -1
  151. package/lib/commands/role/user-resolve.js +1 -1
  152. package/lib/commands/run/index.js +1 -1
  153. package/lib/commands/schema.js +1 -1
  154. package/lib/commands/sql/create.js +1 -1
  155. package/lib/commands/sql/delete.js +1 -1
  156. package/lib/commands/sql/detail.js +1 -1
  157. package/lib/commands/sql/exec.js +1 -1
  158. package/lib/commands/sql/index.js +1 -1
  159. package/lib/commands/sql/list.js +1 -1
  160. package/lib/commands/sql/pull.js +1 -1
  161. package/lib/commands/sql/push.js +1 -1
  162. package/lib/commands/sql/save.js +1 -1
  163. package/lib/commands/sql/shared.js +1 -1
  164. package/lib/commands/sql/status.js +1 -1
  165. package/lib/commands/sql/validate.js +1 -1
  166. package/lib/commands/workspace/add.js +1 -1
  167. package/lib/commands/workspace/index.js +1 -1
  168. package/lib/commands/workspace/remove.js +1 -1
  169. package/lib/config/schema.js +1 -1
  170. package/lib/constant/cdn.js +1 -1
  171. package/lib/constant/cli.js +1 -1
  172. package/lib/constant/defaults.js +1 -1
  173. package/lib/constant/domain.js +1 -1
  174. package/lib/constant/env.js +1 -1
  175. package/lib/constant/output.js +1 -1
  176. package/lib/constant/paths.js +1 -1
  177. package/lib/constant/risk.js +1 -1
  178. package/lib/context/app-resolver.js +1 -1
  179. package/lib/context/auth-resolver.js +1 -1
  180. package/lib/context/config-loader.js +1 -1
  181. package/lib/context.js +1 -1
  182. package/lib/core/alias-resolver.js +1 -1
  183. package/lib/core/api-client.js +1 -1
  184. package/lib/core/bff/config.js +1 -1
  185. package/lib/core/bff/file-system.js +1 -1
  186. package/lib/core/bff/hash.js +1 -1
  187. package/lib/core/bff/lock.js +1 -1
  188. package/lib/core/bff/utils.js +1 -1
  189. package/lib/core/db-resolver.js +1 -1
  190. package/lib/core/page/file-system.js +1 -1
  191. package/lib/core/page/hash.js +1 -1
  192. package/lib/core/page/lock.js +1 -1
  193. package/lib/core/sql-sync/config.js +1 -1
  194. package/lib/core/sql-sync/file-system.js +1 -1
  195. package/lib/core/sql-sync/hash.js +1 -1
  196. package/lib/core/sql-sync/lock.js +1 -1
  197. package/lib/core/sql-sync/utils.js +1 -1
  198. package/lib/core/sql-validator.js +1 -1
  199. package/lib/errors.js +1 -1
  200. package/lib/framework/build-all-flags.js +1 -1
  201. package/lib/framework/flags.js +1 -1
  202. package/lib/framework/help.js +1 -1
  203. package/lib/framework/index.js +1 -1
  204. package/lib/framework/output.js +1 -1
  205. package/lib/framework/response.js +1 -1
  206. package/lib/framework/runner-alias.js +1 -1
  207. package/lib/framework/runner.js +1 -1
  208. package/lib/framework/schema-export.js +1 -1
  209. package/lib/framework/types.js +1 -1
  210. package/lib/generated/build-info.js +1 -1
  211. package/lib/help.js +1 -1
  212. package/lib/skills/main.js +1 -1
  213. package/lib/skills/npx-skills-add.js +1 -1
  214. package/lib/telemetry/cli-command-trace.js +1 -1
  215. package/lib/telemetry/cli-help-trace.js +1 -1
  216. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  217. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  218. package/lib/telemetry/send-cli-trace-log.js +1 -1
  219. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  220. package/lib/utils/ai_config.js +1 -1
  221. package/lib/utils/apply-jq-filter.js +1 -1
  222. package/lib/utils/cdn-config.js +1 -1
  223. package/lib/utils/check-sdk-version.js +1 -1
  224. package/lib/utils/cli-version-check.js +1 -1
  225. package/lib/utils/cli-version-policy.js +1 -1
  226. package/lib/utils/config.js +1 -1
  227. package/lib/utils/copy-directory.js +1 -1
  228. package/lib/utils/entity-with-id.js +1 -1
  229. package/lib/utils/file-utils.js +1 -1
  230. package/lib/utils/guides-cdn.js +1 -1
  231. package/lib/utils/http-client.js +1 -1
  232. package/lib/utils/is-non-interactive.js +1 -1
  233. package/lib/utils/logger.js +1 -1
  234. package/lib/utils/params.js +1 -1
  235. package/lib/utils/platform.js +1 -1
  236. package/lib/utils/rules-cdn.js +1 -1
  237. package/lib/utils/sleep.js +1 -1
  238. package/lib/utils/template-replacer.js +1 -1
  239. package/lib/utils/update-notice.js +1 -1
  240. package/lib/utils/version.js +1 -1
  241. package/lib/utils/with-active-cookie.js +1 -1
  242. package/lib/utils/write-cli-side-channel.js +1 -1
  243. package/package.json +1 -1
@@ -1 +1 @@
1
- const a139_0x408446=a139_0x2f5e;(function(_0xa72788,_0x1fb856){const _0x1b8318=a139_0x2f5e,_0x4db640=_0xa72788();while(!![]){try{const _0x18d650=-parseInt(_0x1b8318(0x209))/0x1+parseInt(_0x1b8318(0x201))/0x2+parseInt(_0x1b8318(0x1f4))/0x3*(-parseInt(_0x1b8318(0x20f))/0x4)+parseInt(_0x1b8318(0x1f2))/0x5*(parseInt(_0x1b8318(0x1db))/0x6)+-parseInt(_0x1b8318(0x1f0))/0x7*(parseInt(_0x1b8318(0x1de))/0x8)+parseInt(_0x1b8318(0x200))/0x9+-parseInt(_0x1b8318(0x20c))/0xa*(parseInt(_0x1b8318(0x1d2))/0xb);if(_0x18d650===_0x1fb856)break;else _0x4db640['push'](_0x4db640['shift']());}catch(_0x280435){_0x4db640['push'](_0x4db640['shift']());}}}(a139_0x3c19,0x9d5d1));import{apiDefinitions}from'../commands/api/index.js';function a139_0x2f5e(_0x49e80d,_0x225588){_0x49e80d=_0x49e80d-0x1c8;const _0x3c1954=a139_0x3c19();let _0x2f5e10=_0x3c1954[_0x49e80d];return _0x2f5e10;}import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{pageDefinitions}from'../commands/page/index.js';import{dataDefinitions}from'../commands/data/index.js';import{dbDefinitions}from'../commands/db/index.js';import{codegenDefinitions}from'../commands/codegen/index.js';import{menuDefinitions}from'../commands/menu/index.js';import{roleDefinitions}from'../commands/role/index.js';import{permitDefinitions}from'../commands/permit/index.js';import{appDefinitions}from'../commands/app/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/index.js';import{doctorDefinition}from'../commands/doctor.js';import{updateDefinition}from'../commands/cli-update.js';import{schemaDefinition}from'../commands/schema.js';import{issueDefinitions}from'../commands/issue/index.js';import{fileDefinitions}from'../commands/file/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{projectDefinitions}from'../commands/project/index.js';import{initDefinitions}from'../commands/init/index.js';import{runDefinition}from'../commands/run/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x5e0541){const _0x1c94e4=a139_0x2f5e;for(const _0x5661b3 of _0x5e0541){definitions[_0x1c94e4(0x1e3)](_0x5661b3['service']+':'+_0x5661b3['command'],_0x5661b3);let _0x32dfc9=serviceGroups[_0x1c94e4(0x1dc)](_0x5661b3[_0x1c94e4(0x1e1)]);!_0x32dfc9&&(_0x32dfc9=[],serviceGroups[_0x1c94e4(0x1e3)](_0x5661b3['service'],_0x32dfc9)),_0x32dfc9[_0x1c94e4(0x1d0)](_0x5661b3);}}function registerDeclarativeService(_0x4e7b94,_0x28f99b,_0x2ba740){const _0x13295d=a139_0x2f5e;registerDefinitions(_0x28f99b);_0x2ba740?.[_0x13295d(0x1f5)]&&registerDefinitions([_0x2ba740[_0x13295d(0x1f5)]]);const _0x41f137=_0x5f50f5=>_0x5f50f5===_0x13295d(0x1f1)?'':_0x5f50f5===_0x13295d(0x1fb)?_0x13295d(0x20e):'\x20\x20[high-risk-write]',_0x3e0eb7={'service':_0x28f99b[0x0][_0x13295d(0x1e1)],'label':_0x4e7b94,'commands':_0x28f99b['filter'](_0x23934b=>!_0x23934b[_0x13295d(0x1e5)])[_0x13295d(0x1e0)](_0x2b8bc7=>({'command':_0x2b8bc7[_0x13295d(0x1e6)],'description':_0x2b8bc7[_0x13295d(0x1d5)],'tag':_0x41f137(_0x2b8bc7['risk'])})),'declarative':!![],'defaultCommand':_0x2ba740?.['defaultCommand']??(_0x2ba740?.[_0x13295d(0x1ed)]?_0x28f99b[0x0][_0x13295d(0x1e6)]:undefined),'wildcardDef':_0x2ba740?.[_0x13295d(0x1f5)],'isSingleCommand':_0x2ba740?.['isSingleCommand']};serviceRegistry[_0x13295d(0x1d0)](_0x3e0eb7),serviceByName['set'](_0x3e0eb7[_0x13295d(0x1e1)],_0x3e0eb7);}registerDeclarativeService(a139_0x408446(0x1c9),initDefinitions,{'defaultCommand':a139_0x408446(0x1d6),'isSingleCommand':!![]}),registerDeclarativeService(a139_0x408446(0x1df),projectDefinitions),registerDeclarativeService('Workspace',workspaceDefinitions),registerDeclarativeService('App\x20Management',appDefinitions),registerDeclarativeService('Authentication',authDefinitions,{'defaultCommand':a139_0x408446(0x1fe)}),registerDeclarativeService(a139_0x408446(0x1d4),datasetDefinitions),registerDeclarativeService(a139_0x408446(0x1ea),pageDefinitions),registerDeclarativeService(a139_0x408446(0x1c8),apiDefinitions),registerDeclarativeService(a139_0x408446(0x208),dataDefinitions),registerDeclarativeService(a139_0x408446(0x1e7),bffDefinitions),registerDeclarativeService(a139_0x408446(0x1f9),sqlDefinitions),registerDeclarativeService(a139_0x408446(0x1d7),dbDefinitions),registerDeclarativeService(a139_0x408446(0x1cb),menuDefinitions),registerDeclarativeService(a139_0x408446(0x204),roleDefinitions),registerDeclarativeService('Permissions',permitDefinitions),registerDeclarativeService(a139_0x408446(0x1e2),appConfigDefinitions),registerDeclarativeService(a139_0x408446(0x1f7),issueDefinitions),registerDeclarativeService(a139_0x408446(0x1ec),fileDefinitions),registerDeclarativeService(a139_0x408446(0x1e8),codegenDefinitions),registerDeclarativeService(a139_0x408446(0x206),configDefinitions),registerDeclarativeService(a139_0x408446(0x1f8),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a139_0x408446(0x1cf),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a139_0x408446(0x1ca),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService('CLI\x20Built-in\x20Skill',cliSkillDefinitions,{'defaultCommand':'install'}),registerDeclarativeService(a139_0x408446(0x1da),logsDefinitions,{'defaultCommand':a139_0x408446(0x1f6)}),registerDeclarativeService(a139_0x408446(0x1ee),[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry[a139_0x408446(0x1d3)]-0x1];last[a139_0x408446(0x1d9)]=[{'command':a139_0x408446(0x1fa),'description':'Run\x20any\x20package.json\x20script','tag':''}];}export const deprecatedAliases={'create':{'service':a139_0x408446(0x1dd),'command':a139_0x408446(0x20b)},'start':{'service':a139_0x408446(0x1d6),'command':a139_0x408446(0x1ef)},'build':{'service':a139_0x408446(0x1d6),'command':a139_0x408446(0x1fc)},'preview':{'service':a139_0x408446(0x1d6),'command':a139_0x408446(0x205)},'logout':{'service':a139_0x408446(0x1cd),'command':a139_0x408446(0x1e9)}};const CLI_SKILL_INSTALL_REMOVED_HINT=a139_0x408446(0x1eb),APP_REMOTE_REMOVED_HINT='Use\x20`rabetbase\x20app\x20list\x20--remote`\x20instead.',APP_USE_REMOVED_HINT='Use\x20`rabetbase\x20workspace\x20use\x20--app\x20<name>`\x20instead.';export function resolveRemovedCommand(_0x29f293,_0x19dbf1){const _0x25eaa2=a139_0x408446;if(_0x29f293==='skill'){const _0x3f15de=_0x19dbf1?_0x25eaa2(0x202)+_0x19dbf1:_0x25eaa2(0x1e4);return{'command':_0x3f15de,'message':'`rabetbase\x20'+_0x3f15de+_0x25eaa2(0x203),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};}if(_0x29f293==='skills')return{'command':_0x25eaa2(0x1cc),'message':_0x25eaa2(0x1ce),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};if(_0x29f293==='app'&&_0x19dbf1===_0x25eaa2(0x1d8))return{'command':_0x25eaa2(0x207),'message':_0x25eaa2(0x1fd),'hint':APP_REMOTE_REMOVED_HINT};if(_0x29f293===_0x25eaa2(0x20a)&&_0x19dbf1==='use')return{'command':'app\x20use','message':_0x25eaa2(0x1ff),'hint':APP_USE_REMOVED_HINT};return undefined;}export const deprecatedSubcommands={'bff':{'new':a139_0x408446(0x20b)},'sql':{'new':a139_0x408446(0x20b)}};export function resolveDeprecatedSubcommand(_0x4896e7,_0x1ddbe0){return deprecatedSubcommands[_0x4896e7]?.[_0x1ddbe0];}function a139_0x3c19(){const _0x71d8df=['API\x20Development','Quick\x20Start','Self\x20Update','Menu','skills','auth','`rabetbase\x20skills`\x20has\x20been\x20removed.','Schema','push','has','275yPtdTv','length','Dataset\x20&\x20Operations','description','run','Database\x20Connections','remote','commands','Logs','6idzPPy','get','project','176uSGWsd','Project','map','service','Runtime\x20App\x20Config\x20Management','set','skill','hidden','command','BFF\x20Scripts','Code\x20Generation','logout','Smart\x20List\x20Pages','Use\x20`rabetbase\x20cli-skill\x20install`\x20to\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill.\x20To\x20install\x20business\x20Skills,\x20use\x20`lovrabet\x20skill\x20install`.','File','isSingleCommand','Run\x20Scripts','start','301896lOpWsB','read','4435190UKvFOP','from','21lnSXVc','wildcardDef','show','Platform\x20Issue','Diagnostics','SQL\x20Queries','<script>','write','build','`rabetbase\x20app\x20remote`\x20has\x20been\x20removed.','login','`rabetbase\x20app\x20use`\x20has\x20been\x20removed.','7052724ivQqlP','1963866eqKmWh','skill\x20','`\x20has\x20been\x20removed.','Roles','preview','Configuration','app\x20remote','Instant\x20API','428377qBJjeT','app','create','59270TfkPTF','values','\x20\x20[write]','275816mWZfuH'];a139_0x3c19=function(){return _0x71d8df;};return a139_0x3c19();}export function findDefinition(_0x36e8e5,_0x16b7dd){const _0x402e68=a139_0x408446;return definitions[_0x402e68(0x1dc)](_0x36e8e5+':'+_0x16b7dd);}export function isKnownService(_0x51e2ef){const _0xa0899c=a139_0x408446;return serviceByName[_0xa0899c(0x1d1)](_0x51e2ef);}export function isDeclarativeService(_0x4a4897){const _0x116112=a139_0x408446;return serviceGroups[_0x116112(0x1d1)](_0x4a4897)||serviceByName[_0x116112(0x1dc)](_0x4a4897)?.['wildcardDef']!==undefined;}export function getServiceEntry(_0x52543a){const _0x5d1a7b=a139_0x408446;return serviceByName[_0x5d1a7b(0x1dc)](_0x52543a);}export function getLegacyHandler(_0x562a6a,_0x542834){return undefined;}export function getAllDefinitions(){const _0x1b9953=a139_0x408446;return Array[_0x1b9953(0x1f3)](definitions[_0x1b9953(0x20d)]());}
1
+ const a141_0x12e26d=a141_0x380d;(function(_0x198c38,_0x306512){const _0x3cae25=a141_0x380d,_0x30874a=_0x198c38();while(!![]){try{const _0x4775c7=-parseInt(_0x3cae25(0x11f))/0x1*(-parseInt(_0x3cae25(0x121))/0x2)+parseInt(_0x3cae25(0x141))/0x3*(-parseInt(_0x3cae25(0x12a))/0x4)+-parseInt(_0x3cae25(0x133))/0x5+parseInt(_0x3cae25(0x13d))/0x6+-parseInt(_0x3cae25(0x12b))/0x7+-parseInt(_0x3cae25(0x103))/0x8*(parseInt(_0x3cae25(0x10b))/0x9)+-parseInt(_0x3cae25(0x13b))/0xa*(-parseInt(_0x3cae25(0x102))/0xb);if(_0x4775c7===_0x306512)break;else _0x30874a['push'](_0x30874a['shift']());}catch(_0xec14cc){_0x30874a['push'](_0x30874a['shift']());}}}(a141_0x2d2b,0xbe355));import{apiDefinitions}from'../commands/api/index.js';import{bffDefinitions}from'../commands/bff/index.js';function a141_0x2d2b(){const _0xc6213e=['Logs','build','get','skill','set','531306eWllgf','app','4XuLYMb','use','auth','Authentication','Schema','Dataset\x20&\x20Operations','app\x20use','filter','SQL\x20Queries','2168IqCjNv','4092312mhLVap','\x20\x20[write]','read','hidden','remote','`rabetbase\x20skills`\x20has\x20been\x20removed.','app\x20remote','Project','5822085wkbwpx','commands','CLI\x20Built-in\x20Skill','install','from','wildcardDef','Platform\x20Issue','`rabetbase\x20app\x20use`\x20has\x20been\x20removed.','11750lNrYIS','Self\x20Update','3969402jEeErQ','push','has','`rabetbase\x20app\x20remote`\x20has\x20been\x20removed.','3783BawZXp','Quick\x20Start','BFF\x20Scripts','write','\x20\x20[high-risk-write]','26037nSiaFq','11656ozdKTC','run','File','Permissions','isSingleCommand','Use\x20`rabetbase\x20cli-skill\x20install`\x20to\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill.\x20To\x20install\x20business\x20Skills,\x20use\x20`lovrabet\x20skill\x20install`.','App\x20Management','Workspace','7992mSSCSK','command','`rabetbase\x20','create','start','Configuration','skill\x20','project','Use\x20`rabetbase\x20workspace\x20use\x20--app\x20<name>`\x20instead.','defaultCommand','skills','Database\x20Connections','service','<script>','risk'];a141_0x2d2b=function(){return _0xc6213e;};return a141_0x2d2b();}import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{pageDefinitions}from'../commands/page/index.js';import{dataDefinitions}from'../commands/data/index.js';import{dbDefinitions}from'../commands/db/index.js';function a141_0x380d(_0x26d3ad,_0x144b1f){_0x26d3ad=_0x26d3ad-0xff;const _0x2d2b4a=a141_0x2d2b();let _0x380d66=_0x2d2b4a[_0x26d3ad];return _0x380d66;}import{codegenDefinitions}from'../commands/codegen/index.js';import{menuDefinitions}from'../commands/menu/index.js';import{roleDefinitions}from'../commands/role/index.js';import{permitDefinitions}from'../commands/permit/index.js';import{appDefinitions}from'../commands/app/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/index.js';import{doctorDefinition}from'../commands/doctor.js';import{updateDefinition}from'../commands/cli-update.js';import{schemaDefinition}from'../commands/schema.js';import{issueDefinitions}from'../commands/issue/index.js';import{fileDefinitions}from'../commands/file/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{projectDefinitions}from'../commands/project/index.js';import{initDefinitions}from'../commands/init/index.js';import{runDefinition}from'../commands/run/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x3747cd){const _0x2cbdaa=a141_0x380d;for(const _0x27e940 of _0x3747cd){definitions[_0x2cbdaa(0x11e)](_0x27e940[_0x2cbdaa(0x117)]+':'+_0x27e940[_0x2cbdaa(0x10c)],_0x27e940);let _0x3bdf07=serviceGroups[_0x2cbdaa(0x11c)](_0x27e940['service']);!_0x3bdf07&&(_0x3bdf07=[],serviceGroups[_0x2cbdaa(0x11e)](_0x27e940[_0x2cbdaa(0x117)],_0x3bdf07)),_0x3bdf07['push'](_0x27e940);}}function registerDeclarativeService(_0x498290,_0xeec1e7,_0x51ec71){const _0x18cb97=a141_0x380d;registerDefinitions(_0xeec1e7);_0x51ec71?.['wildcardDef']&&registerDefinitions([_0x51ec71[_0x18cb97(0x138)]]);const _0x5a1e72=_0x4b7b56=>_0x4b7b56===_0x18cb97(0x12d)?'':_0x4b7b56===_0x18cb97(0x100)?_0x18cb97(0x12c):_0x18cb97(0x101),_0x16a303={'service':_0xeec1e7[0x0][_0x18cb97(0x117)],'label':_0x498290,'commands':_0xeec1e7[_0x18cb97(0x128)](_0x213cd0=>!_0x213cd0[_0x18cb97(0x12e)])['map'](_0x2c6c73=>({'command':_0x2c6c73[_0x18cb97(0x10c)],'description':_0x2c6c73['description'],'tag':_0x5a1e72(_0x2c6c73[_0x18cb97(0x119)])})),'declarative':!![],'defaultCommand':_0x51ec71?.[_0x18cb97(0x114)]??(_0x51ec71?.[_0x18cb97(0x107)]?_0xeec1e7[0x0]['command']:undefined),'wildcardDef':_0x51ec71?.[_0x18cb97(0x138)],'isSingleCommand':_0x51ec71?.[_0x18cb97(0x107)]};serviceRegistry[_0x18cb97(0x13e)](_0x16a303),serviceByName[_0x18cb97(0x11e)](_0x16a303['service'],_0x16a303);}registerDeclarativeService(a141_0x12e26d(0x142),initDefinitions,{'defaultCommand':a141_0x12e26d(0x104),'isSingleCommand':!![]}),registerDeclarativeService(a141_0x12e26d(0x132),projectDefinitions),registerDeclarativeService(a141_0x12e26d(0x10a),workspaceDefinitions),registerDeclarativeService(a141_0x12e26d(0x109),appDefinitions),registerDeclarativeService(a141_0x12e26d(0x124),authDefinitions,{'defaultCommand':'login'}),registerDeclarativeService(a141_0x12e26d(0x126),datasetDefinitions),registerDeclarativeService('Smart\x20List\x20Pages',pageDefinitions),registerDeclarativeService('API\x20Development',apiDefinitions),registerDeclarativeService('Instant\x20API',dataDefinitions),registerDeclarativeService(a141_0x12e26d(0xff),bffDefinitions),registerDeclarativeService(a141_0x12e26d(0x129),sqlDefinitions),registerDeclarativeService(a141_0x12e26d(0x116),dbDefinitions),registerDeclarativeService('Menu',menuDefinitions),registerDeclarativeService('Roles',roleDefinitions),registerDeclarativeService(a141_0x12e26d(0x106),permitDefinitions),registerDeclarativeService('Runtime\x20App\x20Config\x20Management',appConfigDefinitions),registerDeclarativeService(a141_0x12e26d(0x139),issueDefinitions),registerDeclarativeService(a141_0x12e26d(0x105),fileDefinitions),registerDeclarativeService('Code\x20Generation',codegenDefinitions),registerDeclarativeService(a141_0x12e26d(0x110),configDefinitions),registerDeclarativeService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a141_0x12e26d(0x125),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a141_0x12e26d(0x13c),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a141_0x12e26d(0x135),cliSkillDefinitions,{'defaultCommand':a141_0x12e26d(0x136)}),registerDeclarativeService(a141_0x12e26d(0x11a),logsDefinitions,{'defaultCommand':'show'}),registerDeclarativeService('Run\x20Scripts',[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry['length']-0x1];last[a141_0x12e26d(0x134)]=[{'command':a141_0x12e26d(0x118),'description':'Run\x20any\x20package.json\x20script','tag':''}];}export const deprecatedAliases={'create':{'service':a141_0x12e26d(0x112),'command':a141_0x12e26d(0x10e)},'start':{'service':a141_0x12e26d(0x104),'command':a141_0x12e26d(0x10f)},'build':{'service':a141_0x12e26d(0x104),'command':a141_0x12e26d(0x11b)},'preview':{'service':a141_0x12e26d(0x104),'command':'preview'},'logout':{'service':a141_0x12e26d(0x123),'command':'logout'}};const CLI_SKILL_INSTALL_REMOVED_HINT=a141_0x12e26d(0x108),APP_REMOTE_REMOVED_HINT='Use\x20`rabetbase\x20app\x20list\x20--remote`\x20instead.',APP_USE_REMOVED_HINT=a141_0x12e26d(0x113);export function resolveRemovedCommand(_0x4a265e,_0x225b49){const _0x233c7f=a141_0x12e26d;if(_0x4a265e==='skill'){const _0x1440ce=_0x225b49?_0x233c7f(0x111)+_0x225b49:_0x233c7f(0x11d);return{'command':_0x1440ce,'message':_0x233c7f(0x10d)+_0x1440ce+'`\x20has\x20been\x20removed.','hint':CLI_SKILL_INSTALL_REMOVED_HINT};}if(_0x4a265e===_0x233c7f(0x115))return{'command':_0x233c7f(0x115),'message':_0x233c7f(0x130),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};if(_0x4a265e==='app'&&_0x225b49===_0x233c7f(0x12f))return{'command':_0x233c7f(0x131),'message':_0x233c7f(0x140),'hint':APP_REMOTE_REMOVED_HINT};if(_0x4a265e===_0x233c7f(0x120)&&_0x225b49===_0x233c7f(0x122))return{'command':_0x233c7f(0x127),'message':_0x233c7f(0x13a),'hint':APP_USE_REMOVED_HINT};return undefined;}export const deprecatedSubcommands={'bff':{'new':'create'},'sql':{'new':'create'}};export function resolveDeprecatedSubcommand(_0x2a85f7,_0x1b6d00){return deprecatedSubcommands[_0x2a85f7]?.[_0x1b6d00];}export function findDefinition(_0x17aa74,_0x197fd2){const _0x294387=a141_0x12e26d;return definitions[_0x294387(0x11c)](_0x17aa74+':'+_0x197fd2);}export function isKnownService(_0x1160ed){const _0x31db85=a141_0x12e26d;return serviceByName[_0x31db85(0x13f)](_0x1160ed);}export function isDeclarativeService(_0x84d3be){const _0x6859c2=a141_0x12e26d;return serviceGroups['has'](_0x84d3be)||serviceByName['get'](_0x84d3be)?.[_0x6859c2(0x138)]!==undefined;}export function getServiceEntry(_0x2b9d46){const _0x404842=a141_0x12e26d;return serviceByName[_0x404842(0x11c)](_0x2b9d46);}export function getLegacyHandler(_0x207626,_0x2f472b){return undefined;}export function getAllDefinitions(){const _0xeec789=a141_0x12e26d;return Array[_0xeec789(0x137)](definitions['values']());}
@@ -1 +1 @@
1
- function a140_0x5541(_0x3f5ee5,_0x11fd3c){_0x3f5ee5=_0x3f5ee5-0x140;const _0x4df730=a140_0x4df7();let _0x55417f=_0x4df730[_0x3f5ee5];return _0x55417f;}const a140_0x4b0b7f=a140_0x5541;(function(_0x1e84d1,_0x4aad09){const _0x498d51=a140_0x5541,_0x4bc4f4=_0x1e84d1();while(!![]){try{const _0xc1588f=-parseInt(_0x498d51(0x154))/0x1*(parseInt(_0x498d51(0x140))/0x2)+-parseInt(_0x498d51(0x14f))/0x3+parseInt(_0x498d51(0x141))/0x4+-parseInt(_0x498d51(0x155))/0x5+parseInt(_0x498d51(0x142))/0x6*(-parseInt(_0x498d51(0x150))/0x7)+-parseInt(_0x498d51(0x158))/0x8+parseInt(_0x498d51(0x157))/0x9*(parseInt(_0x498d51(0x159))/0xa);if(_0xc1588f===_0x4aad09)break;else _0x4bc4f4['push'](_0x4bc4f4['shift']());}catch(_0x5973ae){_0x4bc4f4['push'](_0x4bc4f4['shift']());}}}(a140_0x4df7,0x9c358));import{createAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a140_0x4df7(){const _0xd2c80f=['roleName','validation','CUSTOM','/smartapi/permit/role/create','create','length','Pass\x20--name\x20<roleName>.','2579049CHVMEg','9149OXmPxe','role','remark','flagMissing','1msVxgA','1892350LcRXIk','trim','2412OAnIqW','8209664hfOgNj','147910TVCWKA','Create\x20a\x20CUSTOM\x20user\x20group\x20(role)','1083682FVmoAp','2617700TKZmvF','5382gtaQYr','name','str','\x20(id=','POST','appCode'];a140_0x4df7=function(){return _0xd2c80f;};return a140_0x4df7();}import{NAME_FLAG,REMARK_FLAG,projectRole}from'../../commands/role/shared.js';const CREATE_PATH=a140_0x4b0b7f(0x14b);function readName(_0xcde91d){const _0x125f69=a140_0x4b0b7f,_0x3fd06e=_0xcde91d['str'](_0x125f69(0x143))[_0x125f69(0x156)]();if(!_0x3fd06e)throw CliErrors[_0x125f69(0x153)](_0x125f69(0x143),_0x125f69(0x14e));if(_0x3fd06e[_0x125f69(0x14d)]>0x40)throw CliErrors[_0x125f69(0x149)]('Role\x20name\x20cannot\x20exceed\x2064\x20characters.');return _0x3fd06e;}export const roleCreate={'service':a140_0x4b0b7f(0x151),'command':a140_0x4b0b7f(0x14c),'description':a140_0x4b0b7f(0x15a),'risk':'write','flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x155e8c){readName(_0x155e8c);},async 'dryRun'(_0x1d2726){const _0x3b8ada=a140_0x4b0b7f,_0x2dd99c=readName(_0x1d2726),_0x59286e=_0x1d2726[_0x3b8ada(0x144)](_0x3b8ada(0x152))[_0x3b8ada(0x156)]()||undefined;return asDryRunResult({'operation':_0x3b8ada(0x14c),'selector':{'appCode':_0x1d2726['appCode'],'roleName':_0x2dd99c},'before':null,'after':{'roleName':_0x2dd99c,'roleType':_0x3b8ada(0x14a),'remark':_0x59286e},'dryRun':!![],'backend':{'method':_0x3b8ada(0x146),'path':CREATE_PATH},'warnings':[]},{'method':_0x3b8ada(0x146),'url':CREATE_PATH});},async 'execute'(_0x179c18){const _0x480222=a140_0x4b0b7f,_0x3cbb26=readName(_0x179c18),_0x58db62=_0x179c18['str'](_0x480222(0x152))[_0x480222(0x156)]()||undefined,_0x27773f=await createAppRole({'appCode':_0x179c18[_0x480222(0x147)],'roleName':_0x3cbb26,..._0x58db62?{'remark':_0x58db62}:{}});return{'ok':!![],'data':{'operation':_0x480222(0x14c),'selector':{'appCode':_0x179c18[_0x480222(0x147)],'roleId':_0x27773f['id'],'roleName':_0x3cbb26},'before':null,'after':projectRole(_0x27773f),'dryRun':![],'backend':{'method':_0x480222(0x146),'path':CREATE_PATH},'warnings':[]},'message':'Created\x20role\x20'+_0x27773f[_0x480222(0x148)]+_0x480222(0x145)+_0x27773f['id']+')'};}};
1
+ const a142_0xf58b62=a142_0x2444;function a142_0x2444(_0x5f103e,_0x106346){_0x5f103e=_0x5f103e-0xe5;const _0x4a6228=a142_0x4a62();let _0x2444c8=_0x4a6228[_0x5f103e];return _0x2444c8;}(function(_0x167e8b,_0x8f0036){const _0x37cc79=a142_0x2444,_0x3d5cd2=_0x167e8b();while(!![]){try{const _0x56c6cd=parseInt(_0x37cc79(0xea))/0x1*(parseInt(_0x37cc79(0xe8))/0x2)+-parseInt(_0x37cc79(0xed))/0x3+parseInt(_0x37cc79(0xe6))/0x4+parseInt(_0x37cc79(0xeb))/0x5*(-parseInt(_0x37cc79(0xfe))/0x6)+parseInt(_0x37cc79(0xfd))/0x7+-parseInt(_0x37cc79(0xfc))/0x8*(parseInt(_0x37cc79(0xee))/0x9)+-parseInt(_0x37cc79(0xef))/0xa*(-parseInt(_0x37cc79(0xe5))/0xb);if(_0x56c6cd===_0x8f0036)break;else _0x3d5cd2['push'](_0x3d5cd2['shift']());}catch(_0x26253e){_0x3d5cd2['push'](_0x3d5cd2['shift']());}}}(a142_0x4a62,0xedc77));import{createAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a142_0x4a62(){const _0x2d577e=['flagMissing','11jgCMRN','178080ApVJbV','trim','2HNqfGC','create','443203iaNvnG','7455jyRSCX','str','3384561ulYgZo','198vlTXbQ','35572130YqRDqU','validation','POST','Pass\x20--name\x20<roleName>.','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','Create\x20a\x20CUSTOM\x20user\x20group\x20(role)','CUSTOM','remark','write','roleName','appCode','length','name','516064SYGIjR','3045581gOMXDs','3858Iutjqc','/smartapi/permit/role/create'];a142_0x4a62=function(){return _0x2d577e;};return a142_0x4a62();}import{asDryRunResult}from'../../commands/common/dry-run.js';import{NAME_FLAG,REMARK_FLAG,projectRole}from'../../commands/role/shared.js';const CREATE_PATH=a142_0xf58b62(0xff);function readName(_0x37a321){const _0x35b9a2=a142_0xf58b62,_0x103a1d=_0x37a321[_0x35b9a2(0xec)](_0x35b9a2(0xfb))[_0x35b9a2(0xe7)]();if(!_0x103a1d)throw CliErrors[_0x35b9a2(0x100)](_0x35b9a2(0xfb),_0x35b9a2(0xf2));if(_0x103a1d[_0x35b9a2(0xfa)]>0x40)throw CliErrors[_0x35b9a2(0xf0)](_0x35b9a2(0xf3));return _0x103a1d;}export const roleCreate={'service':'role','command':a142_0xf58b62(0xe9),'description':a142_0xf58b62(0xf4),'risk':a142_0xf58b62(0xf7),'flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x54a6d8){readName(_0x54a6d8);},async 'dryRun'(_0x1085ce){const _0x5e1604=a142_0xf58b62,_0x33f959=readName(_0x1085ce),_0x4a20b6=_0x1085ce[_0x5e1604(0xec)](_0x5e1604(0xf6))[_0x5e1604(0xe7)]()||undefined;return asDryRunResult({'operation':_0x5e1604(0xe9),'selector':{'appCode':_0x1085ce[_0x5e1604(0xf9)],'roleName':_0x33f959},'before':null,'after':{'roleName':_0x33f959,'roleType':_0x5e1604(0xf5),'remark':_0x4a20b6},'dryRun':!![],'backend':{'method':_0x5e1604(0xf1),'path':CREATE_PATH},'warnings':[]},{'method':_0x5e1604(0xf1),'url':CREATE_PATH});},async 'execute'(_0x2c51a0){const _0x818f5=a142_0xf58b62,_0x11e36b=readName(_0x2c51a0),_0x459285=_0x2c51a0['str'](_0x818f5(0xf6))[_0x818f5(0xe7)]()||undefined,_0x377bdd=await createAppRole({'appCode':_0x2c51a0[_0x818f5(0xf9)],'roleName':_0x11e36b,..._0x459285?{'remark':_0x459285}:{}});return{'ok':!![],'data':{'operation':_0x818f5(0xe9),'selector':{'appCode':_0x2c51a0[_0x818f5(0xf9)],'roleId':_0x377bdd['id'],'roleName':_0x11e36b},'before':null,'after':projectRole(_0x377bdd),'dryRun':![],'backend':{'method':'POST','path':CREATE_PATH},'warnings':[]},'message':'Created\x20role\x20'+_0x377bdd[_0x818f5(0xf8)]+'\x20(id='+_0x377bdd['id']+')'};}};
@@ -1 +1 @@
1
- const a141_0x457426=a141_0x10cb;(function(_0x29ecf7,_0x1bfe21){const _0x222cdf=a141_0x10cb,_0x319ef1=_0x29ecf7();while(!![]){try{const _0x480bee=parseInt(_0x222cdf(0xd3))/0x1+parseInt(_0x222cdf(0xd7))/0x2*(parseInt(_0x222cdf(0xd8))/0x3)+-parseInt(_0x222cdf(0xd4))/0x4+-parseInt(_0x222cdf(0xcd))/0x5+parseInt(_0x222cdf(0xdb))/0x6*(-parseInt(_0x222cdf(0xcf))/0x7)+-parseInt(_0x222cdf(0xdd))/0x8*(parseInt(_0x222cdf(0xd1))/0x9)+parseInt(_0x222cdf(0xda))/0xa*(parseInt(_0x222cdf(0xd6))/0xb);if(_0x480bee===_0x1bfe21)break;else _0x319ef1['push'](_0x319ef1['shift']());}catch(_0x5088db){_0x319ef1['push'](_0x319ef1['shift']());}}}(a141_0x5279,0x816e4));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a141_0x10cb(_0x16803c,_0x56780d){_0x16803c=_0x16803c-0xcd;const _0x5279d6=a141_0x5279();let _0x10cbd0=_0x5279d6[_0x16803c];return _0x10cbd0;}import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a141_0x5279(){const _0x2e5943=['/smartapi/permit/role/delete','39881LRCffG','1241544srrOxa','Deleted\x20role\x20','406538kTWAUK','1026738LstcCG','3uhAINH','appCode','260WGXNSB','2075652EBqpNW','roleName','7160ZxYPHq','POST','userCount','Role\x20still\x20has\x20','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','1137210ZQwLXq','delete','7ekFBMv','num','1008hHOIiF'];a141_0x5279=function(){return _0x2e5943;};return a141_0x5279();}const DELETE_PATH=a141_0x457426(0xd2);export const roleDelete={'service':'role','command':a141_0x457426(0xce),'description':'Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','risk':'high-risk-write','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x4edf96){const _0x22a921=a141_0x457426,_0x294de=_0x4edf96[_0x22a921(0xd0)]('id'),_0x2e8c60=await getRoleById(_0x4edf96[_0x22a921(0xd9)],_0x294de);return assertCustomRole(_0x2e8c60,_0x22a921(0xce)),asDryRunResult({'operation':'delete','selector':{'appCode':_0x4edf96[_0x22a921(0xd9)],'roleId':_0x294de,'roleName':_0x2e8c60['roleName']},'before':projectRole(_0x2e8c60),'after':null,'dryRun':!![],'backend':{'method':_0x22a921(0xde),'path':DELETE_PATH},'warnings':_0x2e8c60[_0x22a921(0xdf)]>0x0?[_0x22a921(0xe0)+_0x2e8c60[_0x22a921(0xdf)]+_0x22a921(0xe1)]:[]},{'method':'POST','url':DELETE_PATH});},async 'execute'(_0x1ab792){const _0x4aa418=a141_0x457426,_0x464fc5=_0x1ab792[_0x4aa418(0xd0)]('id'),_0x5aec35=await getRoleById(_0x1ab792['appCode'],_0x464fc5);return assertCustomRole(_0x5aec35,_0x4aa418(0xce)),await deleteAppRole(_0x464fc5),{'ok':!![],'data':{'operation':_0x4aa418(0xce),'selector':{'appCode':_0x1ab792[_0x4aa418(0xd9)],'roleId':_0x464fc5,'roleName':_0x5aec35['roleName']},'before':projectRole(_0x5aec35),'after':null,'dryRun':![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':[]},'message':_0x4aa418(0xd5)+_0x5aec35[_0x4aa418(0xdc)]+'\x20(id='+_0x464fc5+')'};}};
1
+ const a143_0x257eb4=a143_0x45d2;(function(_0x4574f8,_0x2c5e2a){const _0x59e5de=a143_0x45d2,_0x478e44=_0x4574f8();while(!![]){try{const _0x41cbc9=-parseInt(_0x59e5de(0x99))/0x1+parseInt(_0x59e5de(0x95))/0x2*(-parseInt(_0x59e5de(0x94))/0x3)+-parseInt(_0x59e5de(0x9b))/0x4+-parseInt(_0x59e5de(0x8b))/0x5*(-parseInt(_0x59e5de(0xa0))/0x6)+-parseInt(_0x59e5de(0x96))/0x7+parseInt(_0x59e5de(0x90))/0x8*(parseInt(_0x59e5de(0x8a))/0x9)+parseInt(_0x59e5de(0x9c))/0xa*(parseInt(_0x59e5de(0x9e))/0xb);if(_0x41cbc9===_0x2c5e2a)break;else _0x478e44['push'](_0x478e44['shift']());}catch(_0x2cbc58){_0x478e44['push'](_0x478e44['shift']());}}}(a143_0x3d2a,0xbe041));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a143_0x45d2(_0x47c259,_0x5d0fbd){_0x47c259=_0x47c259-0x8a;const _0x3d2a0b=a143_0x3d2a();let _0x45d26e=_0x3d2a0b[_0x47c259];return _0x45d26e;}function a143_0x3d2a(){const _0x12c480=['593884NiMhyd','639345YfshhU','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','POST','1451633QXeOFr','num','5399284rMUCID','25957270gtDsqf','roleName','11ugXCZq','/smartapi/permit/role/delete','7573902omReIi','72999bVkvMf','5gdPyBI','high-risk-write','delete','Role\x20still\x20has\x20','Deleted\x20role\x20','1280gKeEjG','appCode','role','userCount','15BwwiTc'];a143_0x3d2a=function(){return _0x12c480;};return a143_0x3d2a();}const DELETE_PATH=a143_0x257eb4(0x9f);export const roleDelete={'service':a143_0x257eb4(0x92),'command':'delete','description':'Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','risk':a143_0x257eb4(0x8c),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x5c0e0a){const _0x333731=a143_0x257eb4,_0x4733c0=_0x5c0e0a[_0x333731(0x9a)]('id'),_0x36acff=await getRoleById(_0x5c0e0a['appCode'],_0x4733c0);return assertCustomRole(_0x36acff,_0x333731(0x8d)),asDryRunResult({'operation':_0x333731(0x8d),'selector':{'appCode':_0x5c0e0a[_0x333731(0x91)],'roleId':_0x4733c0,'roleName':_0x36acff[_0x333731(0x9d)]},'before':projectRole(_0x36acff),'after':null,'dryRun':!![],'backend':{'method':_0x333731(0x98),'path':DELETE_PATH},'warnings':_0x36acff[_0x333731(0x93)]>0x0?[_0x333731(0x8e)+_0x36acff[_0x333731(0x93)]+_0x333731(0x97)]:[]},{'method':_0x333731(0x98),'url':DELETE_PATH});},async 'execute'(_0x43c030){const _0x55d23a=a143_0x257eb4,_0x476fec=_0x43c030[_0x55d23a(0x9a)]('id'),_0x180abc=await getRoleById(_0x43c030[_0x55d23a(0x91)],_0x476fec);return assertCustomRole(_0x180abc,_0x55d23a(0x8d)),await deleteAppRole(_0x476fec),{'ok':!![],'data':{'operation':'delete','selector':{'appCode':_0x43c030['appCode'],'roleId':_0x476fec,'roleName':_0x180abc[_0x55d23a(0x9d)]},'before':projectRole(_0x180abc),'after':null,'dryRun':![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':[]},'message':_0x55d23a(0x8f)+_0x180abc[_0x55d23a(0x9d)]+'\x20(id='+_0x476fec+')'};}};
@@ -1 +1 @@
1
- const a142_0x44f620=a142_0x5d15;(function(_0x177559,_0x3a7cae){const _0x4b34cd=a142_0x5d15,_0x25620e=_0x177559();while(!![]){try{const _0x11e3a4=parseInt(_0x4b34cd(0x15a))/0x1+-parseInt(_0x4b34cd(0x15b))/0x2*(-parseInt(_0x4b34cd(0x155))/0x3)+parseInt(_0x4b34cd(0x152))/0x4*(-parseInt(_0x4b34cd(0x15e))/0x5)+-parseInt(_0x4b34cd(0x15d))/0x6+parseInt(_0x4b34cd(0x150))/0x7+-parseInt(_0x4b34cd(0x154))/0x8+-parseInt(_0x4b34cd(0x159))/0x9*(-parseInt(_0x4b34cd(0x157))/0xa);if(_0x11e3a4===_0x3a7cae)break;else _0x25620e['push'](_0x25620e['shift']());}catch(_0x25f2de){_0x25620e['push'](_0x25620e['shift']());}}}(a142_0x2a3d,0xa5b94));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a142_0x5d15(_0x114e47,_0xf3338b){_0x114e47=_0x114e47-0x14f;const _0x2a3de4=a142_0x2a3d();let _0x5d159f=_0x2a3de4[_0x114e47];return _0x5d159f;}function a142_0x2a3d(){const _0x148f00=['4432141bghTQk','roleType','4RDkHCo','num','4547816hYooaX','182883XUanCw','roleName','24101740xSCZTI','read','9AzFLWW','692713DarCOL','2zWbYwQ','detail','7182114MVSWHg','6763555ovjnzF','Role\x20'];a142_0x2a3d=function(){return _0x148f00;};return a142_0x2a3d();}export const roleDetail={'service':'role','command':a142_0x44f620(0x15c),'description':'Show\x20a\x20single\x20role\x27s\x20detail','risk':a142_0x44f620(0x158),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x118ac9){const _0x2649cd=a142_0x44f620,_0x2df979=_0x118ac9[_0x2649cd(0x153)]('id'),_0x2bcfe3=await getRoleById(_0x118ac9['appCode'],_0x2df979);return{'ok':!![],'data':{'role':projectRole(_0x2bcfe3)},'message':_0x2649cd(0x14f)+_0x2bcfe3[_0x2649cd(0x156)]+'\x20('+_0x2bcfe3[_0x2649cd(0x151)]+')'};}};
1
+ const a144_0x184d21=a144_0x442e;(function(_0xd815b0,_0x30d5bd){const _0x18f1a4=a144_0x442e,_0x426c92=_0xd815b0();while(!![]){try{const _0x3b6023=-parseInt(_0x18f1a4(0x188))/0x1+parseInt(_0x18f1a4(0x184))/0x2+-parseInt(_0x18f1a4(0x18e))/0x3*(-parseInt(_0x18f1a4(0x187))/0x4)+parseInt(_0x18f1a4(0x18f))/0x5+parseInt(_0x18f1a4(0x18a))/0x6*(-parseInt(_0x18f1a4(0x18d))/0x7)+-parseInt(_0x18f1a4(0x185))/0x8*(-parseInt(_0x18f1a4(0x191))/0x9)+-parseInt(_0x18f1a4(0x18b))/0xa;if(_0x3b6023===_0x30d5bd)break;else _0x426c92['push'](_0x426c92['shift']());}catch(_0x432fb1){_0x426c92['push'](_0x426c92['shift']());}}}(a144_0x3aab,0xac4c2));function a144_0x442e(_0x23ae7a,_0x4cdf48){_0x23ae7a=_0x23ae7a-0x183;const _0x3aabfd=a144_0x3aab();let _0x442e62=_0x3aabfd[_0x23ae7a];return _0x442e62;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a144_0x184d21(0x18c),'command':a144_0x184d21(0x186),'description':'Show\x20a\x20single\x20role\x27s\x20detail','risk':a144_0x184d21(0x189),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0xdecf9d){const _0xdc41e4=a144_0x184d21,_0x19b0a9=_0xdecf9d['num']('id'),_0x1e4505=await getRoleById(_0xdecf9d['appCode'],_0x19b0a9);return{'ok':!![],'data':{'role':projectRole(_0x1e4505)},'message':_0xdc41e4(0x183)+_0x1e4505[_0xdc41e4(0x190)]+'\x20('+_0x1e4505['roleType']+')'};}};function a144_0x3aab(){const _0x3663fb=['Role\x20','1148110JjlAeX','26952LOdEPj','detail','434904vNHeic','688317LrItYX','read','6alnNNE','5288330xAvItM','role','2350103TEkNja','6pVcpfG','5246730JFIIie','roleName','1116zTMqiN'];a144_0x3aab=function(){return _0x3663fb;};return a144_0x3aab();}
@@ -1 +1 @@
1
- (function(_0x20b137,_0x16fc78){const _0x540548=a143_0x2df9,_0x33a2f=_0x20b137();while(!![]){try{const _0x40e291=parseInt(_0x540548(0x133))/0x1+parseInt(_0x540548(0x139))/0x2+-parseInt(_0x540548(0x130))/0x3*(parseInt(_0x540548(0x13a))/0x4)+-parseInt(_0x540548(0x136))/0x5*(parseInt(_0x540548(0x132))/0x6)+-parseInt(_0x540548(0x131))/0x7*(parseInt(_0x540548(0x138))/0x8)+-parseInt(_0x540548(0x13b))/0x9*(-parseInt(_0x540548(0x134))/0xa)+parseInt(_0x540548(0x137))/0xb*(-parseInt(_0x540548(0x135))/0xc);if(_0x40e291===_0x16fc78)break;else _0x33a2f['push'](_0x33a2f['shift']());}catch(_0x5aa744){_0x33a2f['push'](_0x33a2f['shift']());}}}(a143_0x4766,0xdbc9c));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';function a143_0x4766(){const _0x5c631d=['576bAbRVX','31077bZAGnB','7LyxTSv','25242ChEWrD','589262IcejtD','143270JxBxQG','6698892GKbFpp','575MmuVFE','11JmQLjj','357688ouVVWH','3095592smbAaM','412FTCSDG'];a143_0x4766=function(){return _0x5c631d;};return a143_0x4766();}import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';function a143_0x2df9(_0x21bdf5,_0x5e95b3){_0x21bdf5=_0x21bdf5-0x130;const _0x4766fc=a143_0x4766();let _0x2df97e=_0x4766fc[_0x21bdf5];return _0x2df97e;}export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
1
+ (function(_0x3ae07c,_0x25d400){const _0xa83f75=a145_0x585d,_0x587e9b=_0x3ae07c();while(!![]){try{const _0x52adc7=-parseInt(_0xa83f75(0x1af))/0x1+-parseInt(_0xa83f75(0x1b1))/0x2+-parseInt(_0xa83f75(0x1b5))/0x3+-parseInt(_0xa83f75(0x1b6))/0x4+parseInt(_0xa83f75(0x1b2))/0x5*(-parseInt(_0xa83f75(0x1b7))/0x6)+-parseInt(_0xa83f75(0x1b0))/0x7*(-parseInt(_0xa83f75(0x1b4))/0x8)+parseInt(_0xa83f75(0x1b3))/0x9;if(_0x52adc7===_0x25d400)break;else _0x587e9b['push'](_0x587e9b['shift']());}catch(_0x3eac6d){_0x587e9b['push'](_0x587e9b['shift']());}}}(a145_0x9ec0,0xf2a94));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';function a145_0x585d(_0x2e7073,_0x49737d){_0x2e7073=_0x2e7073-0x1af;const _0x9ec0af=a145_0x9ec0();let _0x585dc3=_0x9ec0af[_0x2e7073];return _0x585dc3;}import{roleCreate}from'../../commands/role/create.js';function a145_0x9ec0(){const _0x37c67d=['42weZOQO','1693752tuqlnj','723335nxcNIt','35001441LYvPLW','2312976VpPIjw','405264eRpABf','5919484iltfGH','30tBCpog','1444671oqtQTx'];a145_0x9ec0=function(){return _0x37c67d;};return a145_0x9ec0();}import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
@@ -1 +1 @@
1
- const a144_0x45e292=a144_0x30ec;function a144_0x30ec(_0x88fd67,_0x35134a){_0x88fd67=_0x88fd67-0x11f;const _0x2a7d84=a144_0x2a7d();let _0x30ec9c=_0x2a7d84[_0x88fd67];return _0x30ec9c;}(function(_0xfea005,_0x410d3e){const _0x1e3c38=a144_0x30ec,_0x1c31f1=_0xfea005();while(!![]){try{const _0x34ba12=parseInt(_0x1e3c38(0x121))/0x1+parseInt(_0x1e3c38(0x130))/0x2+-parseInt(_0x1e3c38(0x123))/0x3*(parseInt(_0x1e3c38(0x139))/0x4)+parseInt(_0x1e3c38(0x136))/0x5+-parseInt(_0x1e3c38(0x13b))/0x6+parseInt(_0x1e3c38(0x12f))/0x7*(parseInt(_0x1e3c38(0x127))/0x8)+parseInt(_0x1e3c38(0x138))/0x9*(-parseInt(_0x1e3c38(0x143))/0xa);if(_0x34ba12===_0x410d3e)break;else _0x1c31f1['push'](_0x1c31f1['shift']());}catch(_0x29f9f2){_0x1c31f1['push'](_0x1c31f1['shift']());}}}(a144_0x2a7d,0x258ae));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a144_0x2a7d(){const _0xe886d3=['Page\x20size\x20(1-100)','page','type','includes','10YLJTbN','Invalid\x20--type\x20\x22','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','number','list','135328ofQJSN','USER','3rdHSAU','ADMIN','pagesize','validation','80oJvMWl','string','length','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','join','\x20role(s)','read','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','211512kAshUZ','592884JXpDRt','DEV','num','toUpperCase','roleType','trim','1425250IZpNot','str','4418937qhWjpv','962068fxfmTy','filter','802176DNvbUR','Use\x20one\x20of:\x20','Filter\x20by\x20role\x20type','Page\x20index\x20(1-based)'];a144_0x2a7d=function(){return _0xe886d3;};return a144_0x2a7d();}import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a144_0x45e292(0x124),a144_0x45e292(0x131),a144_0x45e292(0x122),'CUSTOM'];export const roleList={'service':'role','command':a144_0x45e292(0x120),'description':a144_0x45e292(0x145),'risk':a144_0x45e292(0x12d),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a144_0x45e292(0x141),'type':a144_0x45e292(0x128),'required':![],'description':a144_0x45e292(0x13d),'enum':ROLE_TYPES},{'name':a144_0x45e292(0x140),'type':a144_0x45e292(0x11f),'description':a144_0x45e292(0x13e),'default':0x1},{'name':a144_0x45e292(0x125),'type':a144_0x45e292(0x11f),'description':a144_0x45e292(0x13f),'default':0x64}],async 'validate'(_0x9df23){const _0x2dc7de=a144_0x45e292,_0x48df71=_0x9df23[_0x2dc7de(0x137)]('type')[_0x2dc7de(0x135)]();if(_0x48df71&&!ROLE_TYPES[_0x2dc7de(0x142)](_0x48df71['toUpperCase']()))throw CliErrors[_0x2dc7de(0x126)](_0x2dc7de(0x144)+_0x48df71+'\x22.',_0x2dc7de(0x13c)+ROLE_TYPES[_0x2dc7de(0x12b)](',\x20')+'.');const _0x41a8cf=_0x9df23['num'](_0x2dc7de(0x140),0x1),_0x39b1f4=_0x9df23[_0x2dc7de(0x132)](_0x2dc7de(0x125),0x64);if(_0x41a8cf<0x1)throw CliErrors['validation'](_0x2dc7de(0x12e));if(_0x39b1f4<0x1||_0x39b1f4>0x64)throw CliErrors['validation'](_0x2dc7de(0x12a));},async 'execute'(_0x480ee3){const _0x47cbcb=a144_0x45e292,_0x3a1bfc=_0x480ee3['num'](_0x47cbcb(0x140),0x1)||0x1,_0x57c34c=_0x480ee3[_0x47cbcb(0x132)](_0x47cbcb(0x125),0x64)||0x64,_0x1d3664=_0x480ee3['str'](_0x47cbcb(0x141))[_0x47cbcb(0x135)]()[_0x47cbcb(0x133)](),{items:_0x272ba5,paging:_0x6fe783}=await listAppRoles(_0x480ee3['appCode'],{'currentPage':_0x3a1bfc,'pageSize':_0x57c34c}),_0x14a6e2=_0x1d3664?_0x272ba5[_0x47cbcb(0x13a)](_0x3193f1=>_0x3193f1[_0x47cbcb(0x134)]===_0x1d3664):_0x272ba5,_0xea2cc2=_0x14a6e2['map'](projectRole);return{'ok':!![],'data':{'roles':_0xea2cc2,'paging':_0x6fe783},'message':'Found\x20'+_0xea2cc2[_0x47cbcb(0x129)]+_0x47cbcb(0x12c)};}};
1
+ const a146_0x334da7=a146_0x1629;function a146_0x4d88(){const _0x20efa9=['length','9108yThHjK','str','filter','string','1deIgBH','ADMIN','DEV','num','roleType','Use\x20one\x20of:\x20','819216RBDEnA','4741868nWsNcj','page','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','list','validation','Found\x20','number','trim','24OddCjl','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','Page\x20size\x20(1-100)','USER','includes','type','Filter\x20by\x20role\x20type','6rFiltb','CUSTOM','2297652diQtLw','\x20role(s)','Page\x20index\x20(1-based)','7410Pfhdbo','6981464GnRHLH','99Fnyzkc','5HwVLaE','393746GFjtYm','toUpperCase','appCode','Invalid\x20--type\x20\x22','12019384hJrYAi','pagesize'];a146_0x4d88=function(){return _0x20efa9;};return a146_0x4d88();}function a146_0x1629(_0x2ab815,_0x2d681a){_0x2ab815=_0x2ab815-0x116;const _0x4d887a=a146_0x4d88();let _0x162956=_0x4d887a[_0x2ab815];return _0x162956;}(function(_0xff88b1,_0x5435fc){const _0x354fab=a146_0x1629,_0x5c6c90=_0xff88b1();while(!![]){try{const _0x471d68=parseInt(_0x354fab(0x137))/0x1*(-parseInt(_0x354fab(0x12c))/0x2)+parseInt(_0x354fab(0x125))/0x3+parseInt(_0x354fab(0x13e))/0x4*(parseInt(_0x354fab(0x12b))/0x5)+-parseInt(_0x354fab(0x123))/0x6*(parseInt(_0x354fab(0x129))/0x7)+-parseInt(_0x354fab(0x13d))/0x8*(parseInt(_0x354fab(0x12a))/0x9)+parseInt(_0x354fab(0x128))/0xa*(-parseInt(_0x354fab(0x133))/0xb)+-parseInt(_0x354fab(0x11c))/0xc*(-parseInt(_0x354fab(0x130))/0xd);if(_0x471d68===_0x5435fc)break;else _0x5c6c90['push'](_0x5c6c90['shift']());}catch(_0x1696a5){_0x5c6c90['push'](_0x5c6c90['shift']());}}}(a146_0x4d88,0xd37f4));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a146_0x334da7(0x138),a146_0x334da7(0x139),a146_0x334da7(0x11f),a146_0x334da7(0x124)];export const roleList={'service':'role','command':a146_0x334da7(0x117),'description':a146_0x334da7(0x116),'risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':a146_0x334da7(0x121),'type':a146_0x334da7(0x136),'required':![],'description':a146_0x334da7(0x122),'enum':ROLE_TYPES},{'name':a146_0x334da7(0x13f),'type':a146_0x334da7(0x11a),'description':a146_0x334da7(0x127),'default':0x1},{'name':a146_0x334da7(0x131),'type':'number','description':a146_0x334da7(0x11e),'default':0x64}],async 'validate'(_0x586d51){const _0x29b997=a146_0x334da7,_0x493451=_0x586d51[_0x29b997(0x134)]('type')['trim']();if(_0x493451&&!ROLE_TYPES[_0x29b997(0x120)](_0x493451[_0x29b997(0x12d)]()))throw CliErrors['validation'](_0x29b997(0x12f)+_0x493451+'\x22.',_0x29b997(0x13c)+ROLE_TYPES['join'](',\x20')+'.');const _0xa273f0=_0x586d51[_0x29b997(0x13a)](_0x29b997(0x13f),0x1),_0x376365=_0x586d51[_0x29b997(0x13a)](_0x29b997(0x131),0x64);if(_0xa273f0<0x1)throw CliErrors[_0x29b997(0x118)](_0x29b997(0x11d));if(_0x376365<0x1||_0x376365>0x64)throw CliErrors['validation']('--pagesize\x20must\x20be\x20between\x201\x20and\x20100.');},async 'execute'(_0x4a717e){const _0x4ab4f9=a146_0x334da7,_0x373ab1=_0x4a717e[_0x4ab4f9(0x13a)](_0x4ab4f9(0x13f),0x1)||0x1,_0x2ccabc=_0x4a717e[_0x4ab4f9(0x13a)]('pagesize',0x64)||0x64,_0x2f9bed=_0x4a717e[_0x4ab4f9(0x134)](_0x4ab4f9(0x121))[_0x4ab4f9(0x11b)]()[_0x4ab4f9(0x12d)](),{items:_0xfac244,paging:_0x301197}=await listAppRoles(_0x4a717e[_0x4ab4f9(0x12e)],{'currentPage':_0x373ab1,'pageSize':_0x2ccabc}),_0x36e192=_0x2f9bed?_0xfac244[_0x4ab4f9(0x135)](_0x165b92=>_0x165b92[_0x4ab4f9(0x13b)]===_0x2f9bed):_0xfac244,_0x5042d7=_0x36e192['map'](projectRole);return{'ok':!![],'data':{'roles':_0x5042d7,'paging':_0x301197},'message':_0x4ab4f9(0x119)+_0x5042d7[_0x4ab4f9(0x132)]+_0x4ab4f9(0x126)};}};
@@ -1 +1 @@
1
- const a145_0x5b0cc8=a145_0x5077;(function(_0x4ec0b0,_0x15c280){const _0x3b90f7=a145_0x5077,_0x187b6b=_0x4ec0b0();while(!![]){try{const _0xc977d=-parseInt(_0x3b90f7(0x19d))/0x1+-parseInt(_0x3b90f7(0x1bc))/0x2*(parseInt(_0x3b90f7(0x1b5))/0x3)+-parseInt(_0x3b90f7(0x1c4))/0x4+-parseInt(_0x3b90f7(0x19c))/0x5*(-parseInt(_0x3b90f7(0x1bd))/0x6)+parseInt(_0x3b90f7(0x1b7))/0x7+-parseInt(_0x3b90f7(0x1b8))/0x8+parseInt(_0x3b90f7(0x1d2))/0x9;if(_0xc977d===_0x15c280)break;else _0x187b6b['push'](_0x187b6b['shift']());}catch(_0x5d58bd){_0x187b6b['push'](_0x187b6b['shift']());}}}(a145_0x1230,0x33098));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':a145_0x5b0cc8(0x1aa),'required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':a145_0x5b0cc8(0x195),'type':a145_0x5b0cc8(0x1cb),'required':!![],'description':a145_0x5b0cc8(0x1d7)};export const USER_REF_FLAG={'name':'user','type':a145_0x5b0cc8(0x1cb),'required':!![],'description':a145_0x5b0cc8(0x199)};function a145_0x1230(){const _0x304f0e=['string','name','\x20not\x20found\x20in\x20the\x20user-role\x20list.','Disambiguate\x20with\x20--role\x20<id>.','\x20not\x20found\x20in\x20app\x20','flagMissing','nickname','10323936SCZQlW','Pass\x20--user\x20<id|name>.','user-add','userCount','includes','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','filter','str','Role\x20id\x20',';\x20no\x20change.','expectUserCount','remark','\x20built-in\x20role\x20','role','Multiple\x20tenant\x20members\x20match\x20\x22','flag','Pass\x20--role\x20<id|name>.','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','userId','toLowerCase','138965LEzvar','127624PJetjD','test','findIndex','splice','length','appCode','Role\x20name','Missing\x20user\x20reference.','POST','roleType','Anti-drift\x20check\x20failed:\x20expected\x20','user','/smartapi/permit/user-role/update-user-list','number','join','totalCount','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','User\x20','validation','CUSTOM','permitCount','\x20is\x20not\x20a\x20member\x20of\x20role\x20','54YsQnva','\x22:\x20','21595LvvXmT','3337152HzFNWT','No\x20tenant\x20member\x20matches\x20\x22','username','push','32690sTjNeo','36naKaUD','tenant','userList','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','Missing\x20role\x20reference.','roleName','map','1075684PAKUMx','expect-user-count','find','ADMIN','DEV','dryRun','trim'];a145_0x1230=function(){return _0x304f0e;};return a145_0x1230();}export const NAME_FLAG={'name':a145_0x5b0cc8(0x1cc),'type':a145_0x5b0cc8(0x1cb),'required':!![],'description':a145_0x5b0cc8(0x1a3)};export const USER_NAME_FLAG={'name':'name','type':a145_0x5b0cc8(0x1cb),'required':!![],'description':a145_0x5b0cc8(0x1ad)};export const REMARK_FLAG={'name':a145_0x5b0cc8(0x193),'type':'string','required':![],'description':'Optional\x20role\x20remark/description'};export const EXPECT_USER_COUNT_FLAG={'name':a145_0x5b0cc8(0x1c5),'type':a145_0x5b0cc8(0x1aa),'required':![],'description':'Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs'};export const BUILTIN_ROLE_TYPES=['ADMIN',a145_0x5b0cc8(0x1c8),'USER'];export function isBuiltinRole(_0x4ce9e7){const _0x5df071=a145_0x5b0cc8;return BUILTIN_ROLE_TYPES[_0x5df071(0x1d6)](_0x4ce9e7);}export function assertCustomRole(_0x253e06,_0x50fe01){const _0x169dc0=a145_0x5b0cc8;if(_0x253e06[_0x169dc0(0x1a6)]!==_0x169dc0(0x1b2))throw CliErrors[_0x169dc0(0x1b1)]('Cannot\x20'+_0x50fe01+_0x169dc0(0x194)+_0x253e06[_0x169dc0(0x1c2)]+'\x20('+_0x253e06[_0x169dc0(0x1a6)]+').',_0x169dc0(0x1ae));}export function assertPermConfigurable(_0x1d9f03){const _0x835a84=a145_0x5b0cc8;if(_0x1d9f03[_0x835a84(0x1a6)]==='DEV'||_0x1d9f03[_0x835a84(0x1a6)]===_0x835a84(0x1c7))throw CliErrors[_0x835a84(0x1b1)]('Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20'+_0x1d9f03[_0x835a84(0x1c2)]+'\x20('+_0x1d9f03[_0x835a84(0x1a6)]+').','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.');}export function projectRole(_0x52b4c6){const _0x4b514e=a145_0x5b0cc8;return{'id':_0x52b4c6['id'],'roleName':_0x52b4c6[_0x4b514e(0x1c2)],'roleType':_0x52b4c6[_0x4b514e(0x1a6)],'remark':_0x52b4c6[_0x4b514e(0x193)],'userCount':_0x52b4c6[_0x4b514e(0x1d5)],'permitCount':_0x52b4c6[_0x4b514e(0x1b3)],'builtin':isBuiltinRole(_0x52b4c6[_0x4b514e(0x1a6)])};}export async function resolveRoleRef(_0x421343,_0x320b6f){const _0x4f3dc2=a145_0x5b0cc8,_0x5c6bf2=_0x320b6f['trim']();if(!_0x5c6bf2)throw CliErrors[_0x4f3dc2(0x1b1)](_0x4f3dc2(0x1c1),_0x4f3dc2(0x198));if(/^\d+$/[_0x4f3dc2(0x19e)](_0x5c6bf2))return getRoleById(_0x421343,Number(_0x5c6bf2));const _0x55ed0b=await listAllAppRoles(_0x421343),_0x4caf72=_0x55ed0b[_0x4f3dc2(0x18e)](_0x1bff60=>_0x1bff60[_0x4f3dc2(0x1c2)]===_0x5c6bf2);if(_0x4caf72[_0x4f3dc2(0x1a1)]===0x0)throw CliErrors['validation']('Role\x20name\x20\x22'+_0x5c6bf2+'\x22\x20not\x20found\x20in\x20app\x20'+_0x421343+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.');if(_0x4caf72['length']>0x1){const _0x48791b=_0x4caf72[_0x4f3dc2(0x1c3)](_0x17265e=>_0x17265e['id'])[_0x4f3dc2(0x1ab)](',\x20');throw CliErrors[_0x4f3dc2(0x1b1)]('Role\x20name\x20\x22'+_0x5c6bf2+'\x22\x20is\x20ambiguous\x20(ids:\x20'+_0x48791b+').',_0x4f3dc2(0x1ce));}return _0x4caf72[0x0];}export async function getRoleById(_0x15a1a3,_0x42cca9){const _0xc67f6a=a145_0x5b0cc8,_0x4ff817=await getAppRole(_0x42cca9);if(!_0x4ff817)throw CliErrors['validation'](_0xc67f6a(0x190)+_0x42cca9+_0xc67f6a(0x1cf)+_0x15a1a3+'.',_0xc67f6a(0x1af));return _0x4ff817;}async function listAllAppRoles(_0x2dae3c){const _0x5afcd2=a145_0x5b0cc8,_0x23c540=0x64,_0x4fd008=[];for(let _0x2e9993=0x1;;_0x2e9993+=0x1){const {items:_0x4718c0,paging:_0x16c5f0}=await listAppRoles(_0x2dae3c,{'currentPage':_0x2e9993,'pageSize':_0x23c540});_0x4fd008[_0x5afcd2(0x1bb)](..._0x4718c0);if(_0x4718c0[_0x5afcd2(0x1a1)]<_0x23c540||_0x16c5f0&&_0x4fd008[_0x5afcd2(0x1a1)]>=_0x16c5f0[_0x5afcd2(0x1ac)])return _0x4fd008;}}export async function resolveTenantCode(){const _0x20d344=a145_0x5b0cc8,_0x47aae3=await getSessionUserInfo(),_0x399b1a=_0x47aae3?.[_0x20d344(0x1a8)]?.[_0x20d344(0x1be)]?.['tenant_code'];if(!_0x399b1a)throw CliErrors['authRequired']('Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.');return _0x399b1a;}function matchMember(_0x433a47,_0x37050b){const _0x52b575=a145_0x5b0cc8,_0x87215b=_0x37050b[_0x52b575(0x1ca)]()[_0x52b575(0x19b)]();return(_0x433a47[_0x52b575(0x1d1)]??'')[_0x52b575(0x19b)]()===_0x87215b||(_0x433a47[_0x52b575(0x1ba)]??'')[_0x52b575(0x19b)]()===_0x87215b;}export async function resolveUserRef(_0x46a4c0){const _0x43af47=a145_0x5b0cc8,_0x11c325=_0x46a4c0[_0x43af47(0x1ca)]();if(!_0x11c325)throw CliErrors[_0x43af47(0x1b1)](_0x43af47(0x1a4),'Pass\x20--user\x20<id|name>.');const _0xa19ee4=await resolveTenantCode(),_0x54de3f=await getTenantMembers(_0xa19ee4);if(/^\d+$/['test'](_0x11c325)){const _0x226cb6=Number(_0x11c325),_0x5a19a1=_0x54de3f[_0x43af47(0x1c6)](_0x10fc4b=>_0x10fc4b[_0x43af47(0x19a)]===_0x226cb6);return{'userId':_0x226cb6,'username':_0x5a19a1?.[_0x43af47(0x1ba)]??String(_0x226cb6),'nickname':_0x5a19a1?.[_0x43af47(0x1d1)],'matchedBy':'id'};}const _0x2a0747=_0x54de3f['filter'](_0x595067=>matchMember(_0x595067,_0x11c325));if(_0x2a0747[_0x43af47(0x1a1)]===0x0)throw CliErrors[_0x43af47(0x1b1)](_0x43af47(0x1b9)+_0x11c325+'\x22.',_0x43af47(0x1c0));if(_0x2a0747[_0x43af47(0x1a1)]>0x1){const _0x4cc8a1=_0x2a0747[_0x43af47(0x1c3)](_0x3a83fa=>(_0x3a83fa[_0x43af47(0x1d1)]??_0x3a83fa[_0x43af47(0x1ba)]??'?')+'('+_0x3a83fa[_0x43af47(0x19a)]+')')[_0x43af47(0x1ab)](',\x20');throw CliErrors[_0x43af47(0x1b1)](_0x43af47(0x196)+_0x11c325+_0x43af47(0x1b6)+_0x4cc8a1+'.','Disambiguate\x20with\x20--user\x20<id>.');}const _0x4cb822=_0x2a0747[0x0];return{'userId':_0x4cb822['userId'],'username':_0x4cb822[_0x43af47(0x1ba)]??String(_0x4cb822[_0x43af47(0x19a)]),'nickname':_0x4cb822[_0x43af47(0x1d1)],'matchedBy':_0x43af47(0x1cc)};}export const UPDATE_USER_LIST_PATH=a145_0x5b0cc8(0x1a9);function userIdsOf(_0x38d545){const _0x360fae=a145_0x5b0cc8;return(_0x38d545?.[_0x360fae(0x1bf)]??[])['map'](_0x5e1430=>_0x5e1430[_0x360fae(0x19a)]);}function a145_0x5077(_0x4732f2,_0x3fa785){_0x4732f2=_0x4732f2-0x18e;const _0x1230f0=a145_0x1230();let _0x5077bf=_0x1230f0[_0x4732f2];return _0x5077bf;}export function computeRoleUserMutation(_0x2e9358){const _0x9a028e=a145_0x5b0cc8,{operation:_0x4fcc86,appCode:_0x3ea095,roleUsers:_0x391232,targetRoleId:_0x6867ba,user:_0x5af6d9}=_0x2e9358,_0x1fad28=_0x391232[_0x9a028e(0x1c6)](_0x23c562=>_0x23c562['id']===_0x6867ba);if(!_0x1fad28)throw CliErrors[_0x9a028e(0x1b1)](_0x9a028e(0x190)+_0x6867ba+_0x9a028e(0x1cd),'Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.');const _0x164019=userIdsOf(_0x1fad28),_0x1abd62=[];if(_0x2e9358['expectUserCount']!==undefined&&_0x2e9358[_0x9a028e(0x192)]!==_0x164019[_0x9a028e(0x1a1)])throw CliErrors[_0x9a028e(0x1b1)](_0x9a028e(0x1a7)+_0x2e9358[_0x9a028e(0x192)]+'\x20member(s)\x20but\x20role\x20has\x20'+_0x164019['length']+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x334584=_0x164019['includes'](_0x5af6d9[_0x9a028e(0x19a)]);let _0x5a77bf=![];const _0x5078a3=[..._0x1fad28['userList']];if(_0x4fcc86===_0x9a028e(0x1d4))_0x334584?_0x1abd62[_0x9a028e(0x1bb)](_0x9a028e(0x1b0)+_0x5af6d9[_0x9a028e(0x19a)]+'\x20is\x20already\x20a\x20member\x20of\x20role\x20'+_0x1fad28['roleName']+';\x20no\x20change.'):(_0x5078a3[_0x9a028e(0x1bb)]({'userId':_0x5af6d9[_0x9a028e(0x19a)],'username':_0x5af6d9[_0x9a028e(0x1ba)],..._0x5af6d9['nickname']?{'nickname':_0x5af6d9[_0x9a028e(0x1d1)]}:{}}),_0x5a77bf=!![]);else{if(!_0x334584)_0x1abd62[_0x9a028e(0x1bb)]('User\x20'+_0x5af6d9[_0x9a028e(0x19a)]+_0x9a028e(0x1b4)+_0x1fad28[_0x9a028e(0x1c2)]+_0x9a028e(0x191));else{const _0x4ac2fc=_0x5078a3[_0x9a028e(0x19f)](_0x523e63=>_0x523e63['userId']===_0x5af6d9[_0x9a028e(0x19a)]);if(_0x4ac2fc>=0x0)_0x5078a3[_0x9a028e(0x1a0)](_0x4ac2fc,0x1);_0x5a77bf=!![];}}const _0x54683f=_0x391232[_0x9a028e(0x1c3)](_0x54c799=>_0x54c799['id']===_0x6867ba?{..._0x54c799,'userList':_0x5078a3}:_0x54c799),_0x266cb5=_0x5078a3[_0x9a028e(0x1c3)](_0x803b4e=>_0x803b4e[_0x9a028e(0x19a)]),_0x3ab11f={'operation':_0x4fcc86,'selector':{'appCode':_0x3ea095,'roleId':_0x6867ba,'roleName':_0x1fad28[_0x9a028e(0x1c2)],'userId':_0x5af6d9['userId']},'before':{'userIds':_0x164019},'after':{'userIds':_0x266cb5},'dryRun':_0x2e9358[_0x9a028e(0x1c9)],'backend':{'method':_0x9a028e(0x1a5),'path':UPDATE_USER_LIST_PATH},'warnings':_0x1abd62};return{'roleList':_0x54683f,'mutation':_0x3ab11f,'changed':_0x5a77bf};}export async function loadRoleUsers(_0x6a4b87){return listRoleUsers(_0x6a4b87);}export function readRoleRef(_0x12ce1a){const _0x17a459=a145_0x5b0cc8,_0x58dcc4=_0x12ce1a['str']('role')[_0x17a459(0x1ca)]();if(!_0x58dcc4)throw CliErrors[_0x17a459(0x1d0)](_0x17a459(0x195),_0x17a459(0x198));return _0x58dcc4;}export async function prepareUserMutation(_0x40783f,_0x27ca88,_0xfdb42c){const _0x1d8e26=a145_0x5b0cc8,_0x3c3e6f=readRoleRef(_0x40783f),_0x144adb=_0x40783f[_0x1d8e26(0x18f)]('user')['trim']();if(!_0x144adb)throw CliErrors[_0x1d8e26(0x1d0)](_0x1d8e26(0x1a8),_0x1d8e26(0x1d3));const _0x20c6d7=_0x40783f[_0x1d8e26(0x197)]('expect-user-count'),_0x262fa7=_0x20c6d7===undefined||_0x20c6d7===null?undefined:Number(_0x20c6d7),_0x559365=await resolveRoleRef(_0x40783f['appCode'],_0x3c3e6f),_0x13b275=await resolveUserRef(_0x144adb),_0x5e10e5=await loadRoleUsers(_0x40783f[_0x1d8e26(0x1a2)]);return computeRoleUserMutation({'operation':_0x27ca88,'appCode':_0x40783f[_0x1d8e26(0x1a2)],'roleUsers':_0x5e10e5,'targetRoleId':_0x559365['id'],'user':{'userId':_0x13b275[_0x1d8e26(0x19a)],'username':_0x13b275['username'],'nickname':_0x13b275[_0x1d8e26(0x1d1)]},'dryRun':_0xfdb42c,..._0x262fa7!==undefined?{'expectUserCount':_0x262fa7}:{}});}
1
+ const a147_0x3dfbef=a147_0x2231;(function(_0x5e229d,_0x30cfbb){const _0xdf0420=a147_0x2231,_0x3f2e64=_0x5e229d();while(!![]){try{const _0x243605=parseInt(_0xdf0420(0x21d))/0x1+parseInt(_0xdf0420(0x225))/0x2*(parseInt(_0xdf0420(0x204))/0x3)+parseInt(_0xdf0420(0x222))/0x4*(parseInt(_0xdf0420(0x20a))/0x5)+-parseInt(_0xdf0420(0x21e))/0x6+-parseInt(_0xdf0420(0x1f8))/0x7+-parseInt(_0xdf0420(0x1fa))/0x8+parseInt(_0xdf0420(0x216))/0x9;if(_0x243605===_0x30cfbb)break;else _0x3f2e64['push'](_0x3f2e64['shift']());}catch(_0x2bacf3){_0x3f2e64['push'](_0x3f2e64['shift']());}}}(a147_0x2e0b,0x51782));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a147_0x3dfbef(0x1fb),'required':!![],'description':a147_0x3dfbef(0x211)};export const ROLE_REF_FLAG={'name':a147_0x3dfbef(0x1fc),'type':a147_0x3dfbef(0x202),'required':!![],'description':'Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)'};export const USER_REF_FLAG={'name':a147_0x3dfbef(0x1de),'type':a147_0x3dfbef(0x202),'required':!![],'description':a147_0x3dfbef(0x1f3)};export const NAME_FLAG={'name':a147_0x3dfbef(0x210),'type':'string','required':!![],'description':a147_0x3dfbef(0x229)};export const USER_NAME_FLAG={'name':a147_0x3dfbef(0x210),'type':'string','required':!![],'description':a147_0x3dfbef(0x207)};function a147_0x2231(_0x17a248,_0x520abc){_0x17a248=_0x17a248-0x1de;const _0x2e0b76=a147_0x2e0b();let _0x223185=_0x2e0b76[_0x17a248];return _0x223185;}export const REMARK_FLAG={'name':'remark','type':a147_0x3dfbef(0x202),'required':![],'description':a147_0x3dfbef(0x21c)};export const EXPECT_USER_COUNT_FLAG={'name':a147_0x3dfbef(0x217),'type':a147_0x3dfbef(0x1fb),'required':![],'description':a147_0x3dfbef(0x1e3)};export const BUILTIN_ROLE_TYPES=[a147_0x3dfbef(0x201),a147_0x3dfbef(0x20d),a147_0x3dfbef(0x1e1)];export function isBuiltinRole(_0x21d3b9){const _0x53e0df=a147_0x3dfbef;return BUILTIN_ROLE_TYPES[_0x53e0df(0x21a)](_0x21d3b9);}export function assertCustomRole(_0x368988,_0x3e3bd9){const _0x2400e6=a147_0x3dfbef;if(_0x368988[_0x2400e6(0x1fd)]!==_0x2400e6(0x1ec))throw CliErrors['validation'](_0x2400e6(0x226)+_0x3e3bd9+_0x2400e6(0x1e6)+_0x368988[_0x2400e6(0x20f)]+'\x20('+_0x368988['roleType']+').',_0x2400e6(0x212));}export function assertPermConfigurable(_0x4ad6f8){const _0x6833d7=a147_0x3dfbef;if(_0x4ad6f8[_0x6833d7(0x1fd)]==='DEV'||_0x4ad6f8['roleType']===_0x6833d7(0x201))throw CliErrors[_0x6833d7(0x1ee)]('Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20'+_0x4ad6f8['roleName']+'\x20('+_0x4ad6f8['roleType']+').',_0x6833d7(0x1ea));}export function projectRole(_0x4ec584){const _0x5e246f=a147_0x3dfbef;return{'id':_0x4ec584['id'],'roleName':_0x4ec584[_0x5e246f(0x20f)],'roleType':_0x4ec584[_0x5e246f(0x1fd)],'remark':_0x4ec584[_0x5e246f(0x20b)],'userCount':_0x4ec584['userCount'],'permitCount':_0x4ec584[_0x5e246f(0x1df)],'builtin':isBuiltinRole(_0x4ec584[_0x5e246f(0x1fd)])};}export async function resolveRoleRef(_0x494bb0,_0x1cdaf4){const _0x553669=a147_0x3dfbef,_0x485cb8=_0x1cdaf4[_0x553669(0x215)]();if(!_0x485cb8)throw CliErrors[_0x553669(0x1ee)](_0x553669(0x1e8),_0x553669(0x220));if(/^\d+$/[_0x553669(0x223)](_0x485cb8))return getRoleById(_0x494bb0,Number(_0x485cb8));const _0x316b88=await listAllAppRoles(_0x494bb0),_0x4477e9=_0x316b88['filter'](_0x1abc02=>_0x1abc02['roleName']===_0x485cb8);if(_0x4477e9[_0x553669(0x21f)]===0x0)throw CliErrors[_0x553669(0x1ee)]('Role\x20name\x20\x22'+_0x485cb8+_0x553669(0x1e7)+_0x494bb0+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.');if(_0x4477e9[_0x553669(0x21f)]>0x1){const _0x23b8f6=_0x4477e9[_0x553669(0x1ef)](_0x539e7a=>_0x539e7a['id'])['join'](',\x20');throw CliErrors['validation']('Role\x20name\x20\x22'+_0x485cb8+_0x553669(0x214)+_0x23b8f6+').',_0x553669(0x227));}return _0x4477e9[0x0];}function a147_0x2e0b(){const _0x14bdc5=['authRequired','push','\x20built-in\x20role\x20','\x22\x20not\x20found\x20in\x20app\x20','Missing\x20role\x20reference.','Anti-drift\x20check\x20failed:\x20expected\x20','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','flag','CUSTOM','Pass\x20--user\x20<id|name>.','validation','map','totalCount','\x20is\x20not\x20a\x20member\x20of\x20role\x20','username','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','filter','findIndex','dryRun','flagMissing','2604609jKdyHC','toLowerCase','4800912bMeuiy','number','role','roleType','userList','\x20is\x20already\x20a\x20member\x20of\x20role\x20','find','ADMIN','string','nickname','39idIrFD','POST',';\x20no\x20change.','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','Disambiguate\x20with\x20--user\x20<id>.','appCode','800050kNQJgp','remark','\x20member(s)\x20but\x20role\x20has\x20','DEV','Role\x20id\x20','roleName','name','Role\x20id\x20(from\x20`role\x20list`)','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','join','\x22\x20is\x20ambiguous\x20(ids:\x20','trim','5693589XkDUVs','expect-user-count','expectUserCount','tenant_code','includes','\x20not\x20found\x20in\x20app\x20','Optional\x20role\x20remark/description','661419hBelcv','1802988fnPSUo','length','Pass\x20--role\x20<id|name>.','str','4HsXAKh','test','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','23438jFoJqG','Cannot\x20','Disambiguate\x20with\x20--role\x20<id>.','No\x20tenant\x20member\x20matches\x20\x22','Role\x20name','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','userId','user','permitCount','Multiple\x20tenant\x20members\x20match\x20\x22','USER','\x20not\x20found\x20in\x20the\x20user-role\x20list.','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs'];a147_0x2e0b=function(){return _0x14bdc5;};return a147_0x2e0b();}export async function getRoleById(_0x463ec9,_0x326628){const _0x5e4731=a147_0x3dfbef,_0x51d14f=await getAppRole(_0x326628);if(!_0x51d14f)throw CliErrors['validation'](_0x5e4731(0x20e)+_0x326628+_0x5e4731(0x21b)+_0x463ec9+'.',_0x5e4731(0x224));return _0x51d14f;}async function listAllAppRoles(_0x57cc42){const _0x506078=a147_0x3dfbef,_0x4ef83d=0x64,_0x121877=[];for(let _0x5c1952=0x1;;_0x5c1952+=0x1){const {items:_0x45bb10,paging:_0x301976}=await listAppRoles(_0x57cc42,{'currentPage':_0x5c1952,'pageSize':_0x4ef83d});_0x121877[_0x506078(0x1e5)](..._0x45bb10);if(_0x45bb10[_0x506078(0x21f)]<_0x4ef83d||_0x301976&&_0x121877['length']>=_0x301976[_0x506078(0x1f0)])return _0x121877;}}export async function resolveTenantCode(){const _0x5abf1c=a147_0x3dfbef,_0x40b23d=await getSessionUserInfo(),_0x58816e=_0x40b23d?.['user']?.['tenant']?.[_0x5abf1c(0x219)];if(!_0x58816e)throw CliErrors[_0x5abf1c(0x1e4)](_0x5abf1c(0x22b));return _0x58816e;}function matchMember(_0x994389,_0x101cff){const _0x40dfcc=a147_0x3dfbef,_0x56af7a=_0x101cff[_0x40dfcc(0x215)]()[_0x40dfcc(0x1f9)]();return(_0x994389[_0x40dfcc(0x203)]??'')[_0x40dfcc(0x1f9)]()===_0x56af7a||(_0x994389[_0x40dfcc(0x1f2)]??'')['toLowerCase']()===_0x56af7a;}export async function resolveUserRef(_0x2da609){const _0x4e246b=a147_0x3dfbef,_0x364554=_0x2da609[_0x4e246b(0x215)]();if(!_0x364554)throw CliErrors['validation']('Missing\x20user\x20reference.','Pass\x20--user\x20<id|name>.');const _0x155b21=await resolveTenantCode(),_0x1f35ba=await getTenantMembers(_0x155b21);if(/^\d+$/[_0x4e246b(0x223)](_0x364554)){const _0x4df940=Number(_0x364554),_0x4815b4=_0x1f35ba[_0x4e246b(0x200)](_0x37be3e=>_0x37be3e['userId']===_0x4df940);return{'userId':_0x4df940,'username':_0x4815b4?.[_0x4e246b(0x1f2)]??String(_0x4df940),'nickname':_0x4815b4?.[_0x4e246b(0x203)],'matchedBy':'id'};}const _0x54171e=_0x1f35ba[_0x4e246b(0x1f4)](_0x2aba05=>matchMember(_0x2aba05,_0x364554));if(_0x54171e[_0x4e246b(0x21f)]===0x0)throw CliErrors[_0x4e246b(0x1ee)](_0x4e246b(0x228)+_0x364554+'\x22.',_0x4e246b(0x22a));if(_0x54171e[_0x4e246b(0x21f)]>0x1){const _0x3612d4=_0x54171e[_0x4e246b(0x1ef)](_0x14eabc=>(_0x14eabc['nickname']??_0x14eabc[_0x4e246b(0x1f2)]??'?')+'('+_0x14eabc[_0x4e246b(0x22c)]+')')[_0x4e246b(0x213)](',\x20');throw CliErrors[_0x4e246b(0x1ee)](_0x4e246b(0x1e0)+_0x364554+'\x22:\x20'+_0x3612d4+'.',_0x4e246b(0x208));}const _0x4db788=_0x54171e[0x0];return{'userId':_0x4db788[_0x4e246b(0x22c)],'username':_0x4db788['username']??String(_0x4db788[_0x4e246b(0x22c)]),'nickname':_0x4db788['nickname'],'matchedBy':_0x4e246b(0x210)};}export const UPDATE_USER_LIST_PATH='/smartapi/permit/user-role/update-user-list';function userIdsOf(_0x17ddd0){const _0x4381a0=a147_0x3dfbef;return(_0x17ddd0?.[_0x4381a0(0x1fe)]??[])[_0x4381a0(0x1ef)](_0x1fe409=>_0x1fe409[_0x4381a0(0x22c)]);}export function computeRoleUserMutation(_0x7363ab){const _0x238233=a147_0x3dfbef,{operation:_0x3ca898,appCode:_0x3c216a,roleUsers:_0x34ab44,targetRoleId:_0x49f436,user:_0x5dee96}=_0x7363ab,_0x1f3d34=_0x34ab44[_0x238233(0x200)](_0x14af23=>_0x14af23['id']===_0x49f436);if(!_0x1f3d34)throw CliErrors[_0x238233(0x1ee)](_0x238233(0x20e)+_0x49f436+_0x238233(0x1e2),_0x238233(0x224));const _0xfedc34=userIdsOf(_0x1f3d34),_0x488421=[];if(_0x7363ab[_0x238233(0x218)]!==undefined&&_0x7363ab[_0x238233(0x218)]!==_0xfedc34[_0x238233(0x21f)])throw CliErrors[_0x238233(0x1ee)](_0x238233(0x1e9)+_0x7363ab[_0x238233(0x218)]+_0x238233(0x20c)+_0xfedc34[_0x238233(0x21f)]+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x728cfa=_0xfedc34[_0x238233(0x21a)](_0x5dee96[_0x238233(0x22c)]);let _0x52c56a=![];const _0x3b310c=[..._0x1f3d34[_0x238233(0x1fe)]];if(_0x3ca898==='user-add')_0x728cfa?_0x488421[_0x238233(0x1e5)]('User\x20'+_0x5dee96[_0x238233(0x22c)]+_0x238233(0x1ff)+_0x1f3d34['roleName']+_0x238233(0x206)):(_0x3b310c[_0x238233(0x1e5)]({'userId':_0x5dee96[_0x238233(0x22c)],'username':_0x5dee96[_0x238233(0x1f2)],..._0x5dee96['nickname']?{'nickname':_0x5dee96[_0x238233(0x203)]}:{}}),_0x52c56a=!![]);else{if(!_0x728cfa)_0x488421[_0x238233(0x1e5)]('User\x20'+_0x5dee96['userId']+_0x238233(0x1f1)+_0x1f3d34[_0x238233(0x20f)]+';\x20no\x20change.');else{const _0x4742a1=_0x3b310c[_0x238233(0x1f5)](_0x570dca=>_0x570dca[_0x238233(0x22c)]===_0x5dee96[_0x238233(0x22c)]);if(_0x4742a1>=0x0)_0x3b310c['splice'](_0x4742a1,0x1);_0x52c56a=!![];}}const _0x25328b=_0x34ab44[_0x238233(0x1ef)](_0x5c415b=>_0x5c415b['id']===_0x49f436?{..._0x5c415b,'userList':_0x3b310c}:_0x5c415b),_0x4dc636=_0x3b310c['map'](_0x4240a9=>_0x4240a9[_0x238233(0x22c)]),_0x439f89={'operation':_0x3ca898,'selector':{'appCode':_0x3c216a,'roleId':_0x49f436,'roleName':_0x1f3d34[_0x238233(0x20f)],'userId':_0x5dee96[_0x238233(0x22c)]},'before':{'userIds':_0xfedc34},'after':{'userIds':_0x4dc636},'dryRun':_0x7363ab[_0x238233(0x1f6)],'backend':{'method':_0x238233(0x205),'path':UPDATE_USER_LIST_PATH},'warnings':_0x488421};return{'roleList':_0x25328b,'mutation':_0x439f89,'changed':_0x52c56a};}export async function loadRoleUsers(_0x2e6a4d){return listRoleUsers(_0x2e6a4d);}export function readRoleRef(_0x19c67c){const _0x91d6d1=a147_0x3dfbef,_0x67328d=_0x19c67c[_0x91d6d1(0x221)](_0x91d6d1(0x1fc))['trim']();if(!_0x67328d)throw CliErrors[_0x91d6d1(0x1f7)](_0x91d6d1(0x1fc),_0x91d6d1(0x220));return _0x67328d;}export async function prepareUserMutation(_0x2a5cda,_0x4a2fc8,_0x18a656){const _0x4c2b40=a147_0x3dfbef,_0x5eb463=readRoleRef(_0x2a5cda),_0x19136f=_0x2a5cda[_0x4c2b40(0x221)](_0x4c2b40(0x1de))[_0x4c2b40(0x215)]();if(!_0x19136f)throw CliErrors['flagMissing']('user',_0x4c2b40(0x1ed));const _0x442753=_0x2a5cda[_0x4c2b40(0x1eb)](_0x4c2b40(0x217)),_0x1a8d40=_0x442753===undefined||_0x442753===null?undefined:Number(_0x442753),_0x3a49e4=await resolveRoleRef(_0x2a5cda[_0x4c2b40(0x209)],_0x5eb463),_0x50ecb4=await resolveUserRef(_0x19136f),_0x13e367=await loadRoleUsers(_0x2a5cda[_0x4c2b40(0x209)]);return computeRoleUserMutation({'operation':_0x4a2fc8,'appCode':_0x2a5cda['appCode'],'roleUsers':_0x13e367,'targetRoleId':_0x3a49e4['id'],'user':{'userId':_0x50ecb4[_0x4c2b40(0x22c)],'username':_0x50ecb4[_0x4c2b40(0x1f2)],'nickname':_0x50ecb4[_0x4c2b40(0x203)]},'dryRun':_0x18a656,..._0x1a8d40!==undefined?{'expectUserCount':_0x1a8d40}:{}});}
@@ -1 +1 @@
1
- const a146_0x5baf7f=a146_0x1c6e;(function(_0x2b53f8,_0x392529){const _0x2dd72c=a146_0x1c6e,_0x34e048=_0x2b53f8();while(!![]){try{const _0x20adb4=-parseInt(_0x2dd72c(0xf1))/0x1*(-parseInt(_0x2dd72c(0xf2))/0x2)+-parseInt(_0x2dd72c(0xea))/0x3*(-parseInt(_0x2dd72c(0xd7))/0x4)+parseInt(_0x2dd72c(0xeb))/0x5*(parseInt(_0x2dd72c(0xdf))/0x6)+-parseInt(_0x2dd72c(0xf3))/0x7+-parseInt(_0x2dd72c(0xda))/0x8*(parseInt(_0x2dd72c(0xd9))/0x9)+parseInt(_0x2dd72c(0xf5))/0xa+-parseInt(_0x2dd72c(0xdc))/0xb*(parseInt(_0x2dd72c(0xdb))/0xc);if(_0x20adb4===_0x392529)break;else _0x34e048['push'](_0x34e048['shift']());}catch(_0x455389){_0x34e048['push'](_0x34e048['shift']());}}}(a146_0x505f,0xd94ce));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a146_0x505f(){const _0x5d6e07=['17116250OMRjyM','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','string','write','2971960mQSDdA','/smartapi/permit/role/update','31338WLSHLl','3088NCAZXe','77712fIeetv','1859bjBmLC','trim','remark','256428CduozR','POST','flag','name','roleName','appCode','validation','num','role','\x20(id=','--name\x20cannot\x20be\x20empty.','3fnwugH','25KkczBW','Updated\x20role\x20','length','New\x20role\x20name','Nothing\x20to\x20update.','update','64811HJKzZJ','38WwMXXM','3998092EpOZgS','Role\x20name\x20cannot\x20exceed\x2064\x20characters.'];a146_0x505f=function(){return _0x5d6e07;};return a146_0x505f();}import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH=a146_0x5baf7f(0xd8);function readPatch(_0x34b0c9){const _0x537097=a146_0x5baf7f,_0x394ad9=_0x34b0c9['flag'](_0x537097(0xe2)),_0xcdacc5=_0x34b0c9[_0x537097(0xe1)](_0x537097(0xde)),_0x11d549={};if(_0x394ad9!==undefined&&_0x394ad9!==null){const _0x2338fd=String(_0x394ad9)[_0x537097(0xdd)]();if(!_0x2338fd)throw CliErrors[_0x537097(0xe5)](_0x537097(0xe9));if(_0x2338fd[_0x537097(0xed)]>0x40)throw CliErrors[_0x537097(0xe5)](_0x537097(0xf4));_0x11d549['roleName']=_0x2338fd;}_0xcdacc5!==undefined&&_0xcdacc5!==null&&(_0x11d549['remark']=String(_0xcdacc5));if(_0x11d549[_0x537097(0xe3)]===undefined&&_0x11d549['remark']===undefined)throw CliErrors[_0x537097(0xe5)](_0x537097(0xef),'Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.');return _0x11d549;}function a146_0x1c6e(_0x16659a,_0x577600){_0x16659a=_0x16659a-0xd5;const _0x505f36=a146_0x505f();let _0x1c6e96=_0x505f36[_0x16659a];return _0x1c6e96;}export const roleUpdate={'service':a146_0x5baf7f(0xe7),'command':a146_0x5baf7f(0xf0),'description':a146_0x5baf7f(0xf6),'risk':a146_0x5baf7f(0xd6),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a146_0x5baf7f(0xe2),'type':a146_0x5baf7f(0xd5),'required':![],'description':a146_0x5baf7f(0xee)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1c7e96){readPatch(_0x1c7e96);},async 'dryRun'(_0x3169c7){const _0x5d51fa=a146_0x5baf7f,_0x3ce66a=_0x3169c7[_0x5d51fa(0xe6)]('id'),_0x53f9b7=readPatch(_0x3169c7),_0x542cc3=await getRoleById(_0x3169c7[_0x5d51fa(0xe4)],_0x3ce66a);return assertCustomRole(_0x542cc3,_0x5d51fa(0xf0)),asDryRunResult({'operation':_0x5d51fa(0xf0),'selector':{'appCode':_0x3169c7['appCode'],'roleId':_0x3ce66a,'roleName':_0x542cc3[_0x5d51fa(0xe3)]},'before':projectRole(_0x542cc3),'after':projectRole({..._0x542cc3,..._0x53f9b7[_0x5d51fa(0xe3)]!==undefined?{'roleName':_0x53f9b7[_0x5d51fa(0xe3)]}:{},..._0x53f9b7[_0x5d51fa(0xde)]!==undefined?{'remark':_0x53f9b7['remark']}:{}}),'dryRun':!![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x382884){const _0x3b3545=a146_0x5baf7f,_0x1b6fcc=_0x382884[_0x3b3545(0xe6)]('id'),_0x3a3c64=readPatch(_0x382884),_0x67cc91=await getRoleById(_0x382884[_0x3b3545(0xe4)],_0x1b6fcc);assertCustomRole(_0x67cc91,_0x3b3545(0xf0)),await updateAppRole({'id':_0x1b6fcc,'appCode':_0x382884[_0x3b3545(0xe4)],..._0x3a3c64[_0x3b3545(0xe3)]!==undefined?{'roleName':_0x3a3c64[_0x3b3545(0xe3)]}:{},..._0x3a3c64[_0x3b3545(0xde)]!==undefined?{'remark':_0x3a3c64[_0x3b3545(0xde)]}:{}});const _0x410407=await getRoleById(_0x382884[_0x3b3545(0xe4)],_0x1b6fcc);return{'ok':!![],'data':{'operation':_0x3b3545(0xf0),'selector':{'appCode':_0x382884[_0x3b3545(0xe4)],'roleId':_0x1b6fcc,'roleName':_0x410407['roleName']},'before':projectRole(_0x67cc91),'after':projectRole(_0x410407),'dryRun':![],'backend':{'method':_0x3b3545(0xe0),'path':UPDATE_PATH},'warnings':[]},'message':_0x3b3545(0xec)+_0x410407[_0x3b3545(0xe3)]+_0x3b3545(0xe8)+_0x1b6fcc+')'};}};
1
+ const a148_0x3fef77=a148_0x5bdf;(function(_0x3cbae4,_0xf9226f){const _0x97c751=a148_0x5bdf,_0x286c94=_0x3cbae4();while(!![]){try{const _0x2c527c=-parseInt(_0x97c751(0x147))/0x1+-parseInt(_0x97c751(0x135))/0x2*(parseInt(_0x97c751(0x134))/0x3)+parseInt(_0x97c751(0x12e))/0x4*(-parseInt(_0x97c751(0x12d))/0x5)+parseInt(_0x97c751(0x13b))/0x6+-parseInt(_0x97c751(0x146))/0x7*(-parseInt(_0x97c751(0x137))/0x8)+parseInt(_0x97c751(0x12c))/0x9*(parseInt(_0x97c751(0x148))/0xa)+parseInt(_0x97c751(0x141))/0xb*(parseInt(_0x97c751(0x133))/0xc);if(_0x2c527c===_0xf9226f)break;else _0x286c94['push'](_0x286c94['shift']());}catch(_0x4732cb){_0x286c94['push'](_0x286c94['shift']());}}}(a148_0x5211,0x6b56d));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a148_0x5bdf(_0x37a87b,_0x5d09e9){_0x37a87b=_0x37a87b-0x12c;const _0x521188=a148_0x5211();let _0x5bdf88=_0x521188[_0x37a87b];return _0x5bdf88;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a148_0x5211(){const _0x119a2e=['601726sYwyQj','2295860HteAdy','string','18oPrnyb','433130uAFzRc','24obTpcA','num','Nothing\x20to\x20update.','roleName','update','7728564fqVYfT','1599159iIoBIi','2FfhRJz','remark','6445936FqRnxn','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','New\x20role\x20name','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','1111410jKUddz','POST','trim','write','role','name','11bnUNBX','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','flag','appCode','Updated\x20role\x20','7ysmZYE'];a148_0x5211=function(){return _0x119a2e;};return a148_0x5211();}import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH='/smartapi/permit/role/update';function readPatch(_0x2b307c){const _0x22ee7a=a148_0x5bdf,_0x14ce54=_0x2b307c['flag'](_0x22ee7a(0x140)),_0x34d113=_0x2b307c[_0x22ee7a(0x143)](_0x22ee7a(0x136)),_0x59d91e={};if(_0x14ce54!==undefined&&_0x14ce54!==null){const _0xc35bac=String(_0x14ce54)[_0x22ee7a(0x13d)]();if(!_0xc35bac)throw CliErrors['validation']('--name\x20cannot\x20be\x20empty.');if(_0xc35bac['length']>0x40)throw CliErrors['validation'](_0x22ee7a(0x142));_0x59d91e['roleName']=_0xc35bac;}_0x34d113!==undefined&&_0x34d113!==null&&(_0x59d91e[_0x22ee7a(0x136)]=String(_0x34d113));if(_0x59d91e[_0x22ee7a(0x131)]===undefined&&_0x59d91e['remark']===undefined)throw CliErrors['validation'](_0x22ee7a(0x130),_0x22ee7a(0x138));return _0x59d91e;}export const roleUpdate={'service':a148_0x3fef77(0x13f),'command':a148_0x3fef77(0x132),'description':a148_0x3fef77(0x13a),'risk':a148_0x3fef77(0x13e),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a148_0x3fef77(0x140),'type':a148_0x3fef77(0x149),'required':![],'description':a148_0x3fef77(0x139)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1233cf){readPatch(_0x1233cf);},async 'dryRun'(_0xd78191){const _0x5b9b4a=a148_0x3fef77,_0x39bc7e=_0xd78191['num']('id'),_0x9ef130=readPatch(_0xd78191),_0x5f44a9=await getRoleById(_0xd78191[_0x5b9b4a(0x144)],_0x39bc7e);return assertCustomRole(_0x5f44a9,_0x5b9b4a(0x132)),asDryRunResult({'operation':_0x5b9b4a(0x132),'selector':{'appCode':_0xd78191[_0x5b9b4a(0x144)],'roleId':_0x39bc7e,'roleName':_0x5f44a9[_0x5b9b4a(0x131)]},'before':projectRole(_0x5f44a9),'after':projectRole({..._0x5f44a9,..._0x9ef130[_0x5b9b4a(0x131)]!==undefined?{'roleName':_0x9ef130[_0x5b9b4a(0x131)]}:{},..._0x9ef130[_0x5b9b4a(0x136)]!==undefined?{'remark':_0x9ef130[_0x5b9b4a(0x136)]}:{}}),'dryRun':!![],'backend':{'method':_0x5b9b4a(0x13c),'path':UPDATE_PATH},'warnings':[]},{'method':_0x5b9b4a(0x13c),'url':UPDATE_PATH});},async 'execute'(_0x112227){const _0x5bf4c3=a148_0x3fef77,_0x5a164a=_0x112227[_0x5bf4c3(0x12f)]('id'),_0x4ceb58=readPatch(_0x112227),_0x4e9c5d=await getRoleById(_0x112227[_0x5bf4c3(0x144)],_0x5a164a);assertCustomRole(_0x4e9c5d,_0x5bf4c3(0x132)),await updateAppRole({'id':_0x5a164a,'appCode':_0x112227[_0x5bf4c3(0x144)],..._0x4ceb58['roleName']!==undefined?{'roleName':_0x4ceb58[_0x5bf4c3(0x131)]}:{},..._0x4ceb58[_0x5bf4c3(0x136)]!==undefined?{'remark':_0x4ceb58[_0x5bf4c3(0x136)]}:{}});const _0x35dbdc=await getRoleById(_0x112227[_0x5bf4c3(0x144)],_0x5a164a);return{'ok':!![],'data':{'operation':_0x5bf4c3(0x132),'selector':{'appCode':_0x112227[_0x5bf4c3(0x144)],'roleId':_0x5a164a,'roleName':_0x35dbdc[_0x5bf4c3(0x131)]},'before':projectRole(_0x4e9c5d),'after':projectRole(_0x35dbdc),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':_0x5bf4c3(0x145)+_0x35dbdc[_0x5bf4c3(0x131)]+'\x20(id='+_0x5a164a+')'};}};
@@ -1 +1 @@
1
- const a147_0x9684ff=a147_0x3179;(function(_0x9520b3,_0x57c67c){const _0x699912=a147_0x3179,_0x958073=_0x9520b3();while(!![]){try{const _0x3646b6=-parseInt(_0x699912(0x1a4))/0x1+-parseInt(_0x699912(0x1a3))/0x2*(-parseInt(_0x699912(0x1a5))/0x3)+parseInt(_0x699912(0x198))/0x4+parseInt(_0x699912(0x1a1))/0x5+parseInt(_0x699912(0x1aa))/0x6*(parseInt(_0x699912(0x1ac))/0x7)+parseInt(_0x699912(0x19c))/0x8+-parseInt(_0x699912(0x19e))/0x9*(parseInt(_0x699912(0x19b))/0xa);if(_0x3646b6===_0x57c67c)break;else _0x958073['push'](_0x958073['shift']());}catch(_0x2e72e7){_0x958073['push'](_0x958073['shift']());}}}(a147_0x1e88,0x3d62c));import{updateRoleUsers}from'../../core/api-client.js';function a147_0x3179(_0x17602f,_0x416890){_0x17602f=_0x17602f-0x197;const _0x1e88f1=a147_0x1e88();let _0x317928=_0x1e88f1[_0x17602f];return _0x317928;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a147_0x1e88(){const _0x38edf9=['userId','354912GGkxEJ','high-risk-write','28ZbZmDj','roleName','332492ccCjKT','\x20to\x20role\x20','\x20already\x20in\x20role\x20','10tuTvIL','3830480pAEiMN','appCode','3687489vqAEwP','role','No\x20change:\x20user\x20','388725QdrzkC','POST','2OIHYRN','225572VsovHq','31329JGHcgJ','selector','user-add','Added\x20user\x20'];a147_0x1e88=function(){return _0x38edf9;};return a147_0x1e88();}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':a147_0x9684ff(0x19f),'command':a147_0x9684ff(0x1a7),'description':'Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a147_0x9684ff(0x1ab),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x2c82b7){const _0x166531=a147_0x9684ff,{mutation:_0x41ba5b}=await prepareUserMutation(_0x2c82b7,_0x166531(0x1a7),!![]);return asDryRunResult(_0x41ba5b,{'method':_0x166531(0x1a2),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x562b33){const _0x3f35ab=a147_0x9684ff,{roleList:_0x41ffdc,mutation:_0x1799f3,changed:_0x3c8672}=await prepareUserMutation(_0x562b33,_0x3f35ab(0x1a7),![]);return _0x3c8672&&await updateRoleUsers(_0x562b33[_0x3f35ab(0x19d)],_0x41ffdc),{'ok':!![],'data':_0x1799f3,'message':_0x3c8672?_0x3f35ab(0x1a8)+_0x1799f3[_0x3f35ab(0x1a6)]['userId']+_0x3f35ab(0x199)+_0x1799f3[_0x3f35ab(0x1a6)]['roleName']:_0x3f35ab(0x1a0)+_0x1799f3[_0x3f35ab(0x1a6)][_0x3f35ab(0x1a9)]+_0x3f35ab(0x19a)+_0x1799f3[_0x3f35ab(0x1a6)][_0x3f35ab(0x197)]};}};
1
+ function a149_0x13bd(){const _0x37db5c=['selector','roleName','\x20already\x20in\x20role\x20','1xAyNHI','4073268NkpGcp','12498050qMcXCV','high-risk-write','user-add','6UGBVLl','22RkwKWR','userId','6619464BAQIJH','192734yeYCic','2673360XWnXwB','appCode','8501248zzWLFn','\x20to\x20role\x20','3086015gkZwgV','role','16UJDEOF'];a149_0x13bd=function(){return _0x37db5c;};return a149_0x13bd();}const a149_0x541265=a149_0x250a;(function(_0x1324b6,_0x59f326){const _0x34750e=a149_0x250a,_0x3e573c=_0x1324b6();while(!![]){try{const _0x67ac50=parseInt(_0x34750e(0x119))/0x1*(-parseInt(_0x34750e(0x122))/0x2)+-parseInt(_0x34750e(0x11a))/0x3+parseInt(_0x34750e(0x123))/0x4+parseInt(_0x34750e(0x127))/0x5*(-parseInt(_0x34750e(0x11e))/0x6)+parseInt(_0x34750e(0x125))/0x7+parseInt(_0x34750e(0x115))/0x8*(-parseInt(_0x34750e(0x121))/0x9)+parseInt(_0x34750e(0x11b))/0xa*(parseInt(_0x34750e(0x11f))/0xb);if(_0x67ac50===_0x59f326)break;else _0x3e573c['push'](_0x3e573c['shift']());}catch(_0x464619){_0x3e573c['push'](_0x3e573c['shift']());}}}(a149_0x13bd,0xcd1a0));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';function a149_0x250a(_0x3b7fdd,_0x1038f2){_0x3b7fdd=_0x3b7fdd-0x114;const _0x13bd4f=a149_0x13bd();let _0x250a57=_0x13bd4f[_0x3b7fdd];return _0x250a57;}export const roleUserAdd={'service':a149_0x541265(0x114),'command':a149_0x541265(0x11d),'description':'Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a149_0x541265(0x11c),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x16a311){const {mutation:_0x402f56}=await prepareUserMutation(_0x16a311,'user-add',!![]);return asDryRunResult(_0x402f56,{'method':'POST','url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x525a52){const _0x25eaaf=a149_0x541265,{roleList:_0x378ac2,mutation:_0x29dd21,changed:_0x135c3a}=await prepareUserMutation(_0x525a52,_0x25eaaf(0x11d),![]);return _0x135c3a&&await updateRoleUsers(_0x525a52[_0x25eaaf(0x124)],_0x378ac2),{'ok':!![],'data':_0x29dd21,'message':_0x135c3a?'Added\x20user\x20'+_0x29dd21['selector'][_0x25eaaf(0x120)]+_0x25eaaf(0x126)+_0x29dd21[_0x25eaaf(0x116)][_0x25eaaf(0x117)]:'No\x20change:\x20user\x20'+_0x29dd21['selector'][_0x25eaaf(0x120)]+_0x25eaaf(0x118)+_0x29dd21[_0x25eaaf(0x116)][_0x25eaaf(0x117)]};}};
@@ -1 +1 @@
1
- const a148_0x5e7d75=a148_0x3da3;(function(_0xe85dfe,_0x3281ee){const _0x594e46=a148_0x3da3,_0x1c3c26=_0xe85dfe();while(!![]){try{const _0x407e21=parseInt(_0x594e46(0xeb))/0x1+-parseInt(_0x594e46(0xea))/0x2*(parseInt(_0x594e46(0xec))/0x3)+-parseInt(_0x594e46(0xf6))/0x4*(-parseInt(_0x594e46(0xf7))/0x5)+parseInt(_0x594e46(0xee))/0x6+parseInt(_0x594e46(0xfb))/0x7+parseInt(_0x594e46(0xf3))/0x8+-parseInt(_0x594e46(0xf5))/0x9;if(_0x407e21===_0x3281ee)break;else _0x1c3c26['push'](_0x1c3c26['shift']());}catch(_0x526323){_0x1c3c26['push'](_0x1c3c26['shift']());}}}(a148_0x3c0f,0x4c251));function a148_0x3c0f(){const _0xb18fa2=['high-risk-write','12270kOQmEy','342922voAztT','141NbfGKu','\x20from\x20role\x20','520602CbpFbv','\x20not\x20in\x20role\x20','POST','Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','appCode','3654264eZsRPO','No\x20change:\x20user\x20','8569908ypMmoX','112KXvpLV','42095EqDjrd','user-remove','userId','selector','3011694ItLiLR','role'];a148_0x3c0f=function(){return _0xb18fa2;};return a148_0x3c0f();}import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';function a148_0x3da3(_0x2fa38b,_0x50ab19){_0x2fa38b=_0x2fa38b-0xe9;const _0x3c0fe5=a148_0x3c0f();let _0x3da347=_0x3c0fe5[_0x2fa38b];return _0x3da347;}export const roleUserRemove={'service':a148_0x5e7d75(0xfc),'command':a148_0x5e7d75(0xf8),'description':a148_0x5e7d75(0xf1),'risk':a148_0x5e7d75(0xe9),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x7549a5){const _0x31e775=a148_0x5e7d75,{mutation:_0x5a4960}=await prepareUserMutation(_0x7549a5,_0x31e775(0xf8),!![]);return asDryRunResult(_0x5a4960,{'method':_0x31e775(0xf0),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x5c6161){const _0x2c6091=a148_0x5e7d75,{roleList:_0x151878,mutation:_0x3b16fa,changed:_0x175917}=await prepareUserMutation(_0x5c6161,_0x2c6091(0xf8),![]);return _0x175917&&await updateRoleUsers(_0x5c6161[_0x2c6091(0xf2)],_0x151878),{'ok':!![],'data':_0x3b16fa,'message':_0x175917?'Removed\x20user\x20'+_0x3b16fa[_0x2c6091(0xfa)][_0x2c6091(0xf9)]+_0x2c6091(0xed)+_0x3b16fa[_0x2c6091(0xfa)]['roleName']:_0x2c6091(0xf4)+_0x3b16fa['selector'][_0x2c6091(0xf9)]+_0x2c6091(0xef)+_0x3b16fa[_0x2c6091(0xfa)]['roleName']};}};
1
+ function a150_0x590c(){const _0x39a371=['user-remove','1074QHrfHh','574029TMvCtG','4595CCdnlJ','No\x20change:\x20user\x20','6047PIfdzm','158cgFziw','7084665DZOFwh','2690334dMjRSf','appCode','role','\x20not\x20in\x20role\x20','selector','56MIGBLQ','roleName','4591680qHMPPj','userId','3515890wmjYpJ','11EKevDE'];a150_0x590c=function(){return _0x39a371;};return a150_0x590c();}const a150_0x7ab26d=a150_0x1bfd;(function(_0x100a04,_0x1e654e){const _0x5bbe8f=a150_0x1bfd,_0x12b94b=_0x100a04();while(!![]){try{const _0x3492cf=-parseInt(_0x5bbe8f(0x1f8))/0x1*(-parseInt(_0x5bbe8f(0x1f9))/0x2)+-parseInt(_0x5bbe8f(0x1fb))/0x3+parseInt(_0x5bbe8f(0x1ef))/0x4+parseInt(_0x5bbe8f(0x1f6))/0x5*(parseInt(_0x5bbe8f(0x1f4))/0x6)+-parseInt(_0x5bbe8f(0x1fa))/0x7+parseInt(_0x5bbe8f(0x1ed))/0x8*(parseInt(_0x5bbe8f(0x1f5))/0x9)+parseInt(_0x5bbe8f(0x1f1))/0xa*(parseInt(_0x5bbe8f(0x1f2))/0xb);if(_0x3492cf===_0x1e654e)break;else _0x12b94b['push'](_0x12b94b['shift']());}catch(_0x25430d){_0x12b94b['push'](_0x12b94b['shift']());}}}(a150_0x590c,0xa5d95));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';function a150_0x1bfd(_0x2767ff,_0x3999d8){_0x2767ff=_0x2767ff-0x1ec;const _0x590cbc=a150_0x590c();let _0x1bfd7c=_0x590cbc[_0x2767ff];return _0x1bfd7c;}export const roleUserRemove={'service':a150_0x7ab26d(0x1fd),'command':a150_0x7ab26d(0x1f3),'description':'Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x2eac59){const _0x54baae=a150_0x7ab26d,{mutation:_0x563074}=await prepareUserMutation(_0x2eac59,_0x54baae(0x1f3),!![]);return asDryRunResult(_0x563074,{'method':'POST','url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x14fe75){const _0x4d8963=a150_0x7ab26d,{roleList:_0x627bc9,mutation:_0x38c946,changed:_0xefc5c1}=await prepareUserMutation(_0x14fe75,_0x4d8963(0x1f3),![]);return _0xefc5c1&&await updateRoleUsers(_0x14fe75[_0x4d8963(0x1fc)],_0x627bc9),{'ok':!![],'data':_0x38c946,'message':_0xefc5c1?'Removed\x20user\x20'+_0x38c946[_0x4d8963(0x1ec)][_0x4d8963(0x1f0)]+'\x20from\x20role\x20'+_0x38c946[_0x4d8963(0x1ec)][_0x4d8963(0x1ee)]:_0x4d8963(0x1f7)+_0x38c946['selector'][_0x4d8963(0x1f0)]+_0x4d8963(0x1fe)+_0x38c946['selector'][_0x4d8963(0x1ee)]};}};
@@ -1 +1 @@
1
- function a149_0x18de(){const _0x1eaa3c=['6WSeupz','Pass\x20--name\x20<nickname|username>.','63nQLarq','9TLmSUA','userId','str','98087iyqlJX','13kutvGs','user-resolve','23442nQyEtZ','52DkyFEx','flagMissing','role','\x22\x20→\x20userId\x20','26165EsawXz','107356yduEnJ','matchedBy','trim','370XlOMga','269936kLlvWp','2496872JfIgpL','read','nickname','434424MHJpYP','name'];a149_0x18de=function(){return _0x1eaa3c;};return a149_0x18de();}const a149_0x4a052b=a149_0x383c;(function(_0x5edadf,_0x3bd6d9){const _0x110fa5=a149_0x383c,_0x241e8a=_0x5edadf();while(!![]){try{const _0x50c71d=-parseInt(_0x110fa5(0x85))/0x1+-parseInt(_0x110fa5(0x81))/0x2*(parseInt(_0x110fa5(0x8b))/0x3)+-parseInt(_0x110fa5(0x7c))/0x4*(parseInt(_0x110fa5(0x80))/0x5)+parseInt(_0x110fa5(0x7b))/0x6*(parseInt(_0x110fa5(0x74))/0x7)+-parseInt(_0x110fa5(0x86))/0x8*(-parseInt(_0x110fa5(0x75))/0x9)+parseInt(_0x110fa5(0x84))/0xa*(parseInt(_0x110fa5(0x78))/0xb)+parseInt(_0x110fa5(0x89))/0xc*(-parseInt(_0x110fa5(0x79))/0xd);if(_0x50c71d===_0x3bd6d9)break;else _0x241e8a['push'](_0x241e8a['shift']());}catch(_0x36d718){_0x241e8a['push'](_0x241e8a['shift']());}}}(a149_0x18de,0x2fc5e));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a149_0x383c(_0x3d9670,_0x5e9e59){_0x3d9670=_0x3d9670-0x73;const _0x18deb2=a149_0x18de();let _0x383cae=_0x18deb2[_0x3d9670];return _0x383cae;}import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a149_0x4a052b(0x7e),'command':a149_0x4a052b(0x7a),'description':'Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','risk':a149_0x4a052b(0x87),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x36a604){const _0x46fce7=a149_0x4a052b;if(!_0x36a604[_0x46fce7(0x77)](_0x46fce7(0x8a))[_0x46fce7(0x83)]())throw CliErrors[_0x46fce7(0x7d)]('name',_0x46fce7(0x73));},async 'execute'(_0x5846c0){const _0x3efdce=a149_0x4a052b,_0x4e3c35=_0x5846c0[_0x3efdce(0x77)](_0x3efdce(0x8a))[_0x3efdce(0x83)](),_0x23b05d=await resolveUserRef(_0x4e3c35);return{'ok':!![],'data':{'user':{'userId':_0x23b05d[_0x3efdce(0x76)],'username':_0x23b05d['username'],'nickname':_0x23b05d[_0x3efdce(0x88)],'matchedBy':_0x23b05d[_0x3efdce(0x82)]}},'message':'Resolved\x20\x22'+_0x4e3c35+_0x3efdce(0x7f)+_0x23b05d['userId']};}};
1
+ function a151_0x1ae9(){const _0x330cc6=['str','\x22\x20→\x20userId\x20','40LUBxcZ','userId','name','374373jJVjwL','12EwweFq','3fYyrHQ','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','407391sXpxPJ','matchedBy','108482VYjeHL','71145MpegjN','Resolved\x20\x22','username','trim','read','300mNnEpM','1046344rjEGKV','flagMissing','nickname','6kSYzWV','303639oPHAEu','48466uIfIUB'];a151_0x1ae9=function(){return _0x330cc6;};return a151_0x1ae9();}const a151_0x4e9d06=a151_0x2bb5;(function(_0x388ffc,_0x14a69c){const _0x5191ce=a151_0x2bb5,_0x1729c1=_0x388ffc();while(!![]){try{const _0x1e2fa7=-parseInt(_0x5191ce(0x15d))/0x1*(parseInt(_0x5191ce(0x155))/0x2)+parseInt(_0x5191ce(0x15f))/0x3+parseInt(_0x5191ce(0x15c))/0x4*(parseInt(_0x5191ce(0x162))/0x5)+-parseInt(_0x5191ce(0x153))/0x6*(parseInt(_0x5191ce(0x154))/0x7)+parseInt(_0x5191ce(0x150))/0x8+parseInt(_0x5191ce(0x15b))/0x9*(parseInt(_0x5191ce(0x158))/0xa)+-parseInt(_0x5191ce(0x161))/0xb*(parseInt(_0x5191ce(0x14f))/0xc);if(_0x1e2fa7===_0x14a69c)break;else _0x1729c1['push'](_0x1729c1['shift']());}catch(_0x5e1206){_0x1729c1['push'](_0x1729c1['shift']());}}}(a151_0x1ae9,0x1b98f));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';function a151_0x2bb5(_0x288593,_0x1a4fb1){_0x288593=_0x288593-0x14d;const _0x1ae9ce=a151_0x1ae9();let _0x2bb56d=_0x1ae9ce[_0x288593];return _0x2bb56d;}export const roleUserResolve={'service':'role','command':'user-resolve','description':a151_0x4e9d06(0x15e),'risk':a151_0x4e9d06(0x14e),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5e6f9){const _0x138018=a151_0x4e9d06;if(!_0x5e6f9[_0x138018(0x156)](_0x138018(0x15a))[_0x138018(0x14d)]())throw CliErrors[_0x138018(0x151)]('name','Pass\x20--name\x20<nickname|username>.');},async 'execute'(_0x2e11cd){const _0x1a9f1a=a151_0x4e9d06,_0x34f390=_0x2e11cd['str']('name')[_0x1a9f1a(0x14d)](),_0x29b9aa=await resolveUserRef(_0x34f390);return{'ok':!![],'data':{'user':{'userId':_0x29b9aa[_0x1a9f1a(0x159)],'username':_0x29b9aa[_0x1a9f1a(0x164)],'nickname':_0x29b9aa[_0x1a9f1a(0x152)],'matchedBy':_0x29b9aa[_0x1a9f1a(0x160)]}},'message':_0x1a9f1a(0x163)+_0x34f390+_0x1a9f1a(0x157)+_0x29b9aa[_0x1a9f1a(0x159)]};}};
@@ -1 +1 @@
1
- const a150_0x2001f7=a150_0x2ee5;(function(_0x1981b1,_0x28103b){const _0x2a11a5=a150_0x2ee5,_0x4fd8b2=_0x1981b1();while(!![]){try{const _0x3ce552=-parseInt(_0x2a11a5(0x10e))/0x1+-parseInt(_0x2a11a5(0x121))/0x2*(parseInt(_0x2a11a5(0x107))/0x3)+-parseInt(_0x2a11a5(0x10d))/0x4*(-parseInt(_0x2a11a5(0x139))/0x5)+parseInt(_0x2a11a5(0x10b))/0x6+parseInt(_0x2a11a5(0x120))/0x7+parseInt(_0x2a11a5(0x11e))/0x8+-parseInt(_0x2a11a5(0x11d))/0x9;if(_0x3ce552===_0x28103b)break;else _0x4fd8b2['push'](_0x4fd8b2['shift']());}catch(_0x2b4ede){_0x4fd8b2['push'](_0x4fd8b2['shift']());}}}(a150_0x4097,0x4a6b4));import{readFileSync,existsSync}from'node:fs';function a150_0x4097(){const _0x38c2eb=['\x0a\x20\x20Usage:\x20','join','inherit','(none)','needsUpgrade','vite','log','Enable\x20watch\x20mode\x20for\x20preview','preview','1579707LRVZdL','1717904Zhhupo','cwd','1885562edFPPv','1700TwRYhI','boolean','bun.lockb','close','vite\x20preview\x20exited\x20with\x20code\x20','Script\x20name\x20defined\x20in\x20package.json','parse','bool','scripts','package.json','\x20\x20\x20\x20','length','Available:\x20','push','node_modules','all','dev','has','script','\x0a\x20\x20Available\x20scripts:\x0a','error','\x20run\x20preview\x20--watch','\x22\x20not\x20found\x20in\x20package.json.','\x20run\x20start','15395xtaIuW','\x20exited\x20with\x20code\x20','pnpm-lock.yaml','.bin','\x20run\x20preview','Run\x20a\x20package.json\x20script','validation','--watch','start','1893rPEvCu','build','keys','bun.lock','3423540pLrVqm','run','348YkCbYN','305874FIRSCv','args','yarn','watch','\x20run\x20<script>\x0a','No\x20package.json\x20found\x20in\x20current\x20directory.'];a150_0x4097=function(){return _0x38c2eb;};return a150_0x4097();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a150_0x2001f7(0x106),a150_0x2001f7(0x131)]);function readPackageScripts(_0x3962c9){const _0x3e6d30=a150_0x2001f7,_0x6c0e9=resolve(_0x3962c9,_0x3e6d30(0x12a));if(!existsSync(_0x6c0e9))return null;try{const _0x52a9db=JSON[_0x3e6d30(0x127)](readFileSync(_0x6c0e9,'utf-8'));return _0x52a9db[_0x3e6d30(0x129)]??{};}catch{return null;}}function a150_0x2ee5(_0x3954a1,_0x1cff37){_0x3954a1=_0x3954a1-0xff;const _0x4097c8=a150_0x4097();let _0x2ee50d=_0x4097c8[_0x3954a1];return _0x2ee50d;}function detectPackageManager(_0x5d727d){const _0x36fe63=a150_0x2001f7;if(existsSync(resolve(_0x5d727d,_0x36fe63(0x123)))||existsSync(resolve(_0x5d727d,_0x36fe63(0x10a))))return'bun';if(existsSync(resolve(_0x5d727d,_0x36fe63(0x100))))return'pnpm';if(existsSync(resolve(_0x5d727d,'yarn.lock')))return _0x36fe63(0x110);return'npm';}async function versionCheck(_0xe4a096){const _0x19b898=a150_0x2001f7,_0x24b174=await checkCliVersion();(_0x24b174['needsUpgrade']||_0x24b174['belowMinimum'])&&(printCliUpgradeWarning(_0x24b174),assertCliVersionSupported(_0x24b174));const _0x559bfd=await checkSdkVersion(_0xe4a096);if(_0x559bfd[_0x19b898(0x118)])printSdkUpgradeWarning(_0x559bfd);}function spawnScript(_0x57de41,_0x20c1dd,_0x501a33,_0x2f71e4){return new Promise((_0x5aaa25,_0x5caadb)=>{const _0x196762=a150_0x2ee5,_0x3c9d4c=[_0x196762(0x10c),_0x20c1dd,..._0x501a33],_0x50be3c=spawn(_0x57de41,_0x3c9d4c,{'cwd':_0x2f71e4,'stdio':_0x196762(0x116),'shell':!![],'env':{...process.env,'PATH':''+join(_0x2f71e4,_0x196762(0x12f),_0x196762(0x101))+delimiter+process.env.PATH}});_0x50be3c['on']('close',_0x13bf96=>{const _0x2a6b38=_0x196762;if(_0x13bf96===0x0||_0x13bf96===null)_0x5aaa25();else _0x5caadb(new Error(_0x57de41+'\x20run\x20'+_0x20c1dd+_0x2a6b38(0xff)+_0x13bf96));}),_0x50be3c['on'](_0x196762(0x135),_0x5caadb);});}function spawnViteBuildWatch(_0x7429bc){return new Promise((_0xb7cd40,_0x26b289)=>{const _0x23564a=a150_0x2ee5,_0x511117=spawn(_0x23564a(0x119),[_0x23564a(0x108),_0x23564a(0x105)],{'cwd':_0x7429bc,'stdio':_0x23564a(0x116),'shell':!![],'env':{...process.env,'PATH':''+join(_0x7429bc,_0x23564a(0x12f),_0x23564a(0x101))+delimiter+process.env.PATH}});_0x511117['on'](_0x23564a(0x124),_0x160598=>{if(_0x160598===0x0||_0x160598===null)_0xb7cd40();else _0x26b289(new Error('vite\x20build\x20--watch\x20exited\x20with\x20code\x20'+_0x160598));}),_0x511117['on'](_0x23564a(0x135),_0x26b289);});}function spawnVitePreview(_0x3256f3){return new Promise((_0xcf1b01,_0x4460c1)=>{const _0x5cd302=a150_0x2ee5,_0x140aa1=spawn('vite',['preview'],{'cwd':_0x3256f3,'stdio':_0x5cd302(0x116),'shell':!![],'env':{...process.env,'PATH':''+join(_0x3256f3,_0x5cd302(0x12f),_0x5cd302(0x101))+delimiter+process.env.PATH}});_0x140aa1['on'](_0x5cd302(0x124),_0x3b8242=>{const _0x2dbe1f=_0x5cd302;if(_0x3b8242===0x0||_0x3b8242===null)_0xcf1b01();else _0x4460c1(new Error(_0x2dbe1f(0x125)+_0x3b8242));}),_0x140aa1['on'](_0x5cd302(0x135),_0x4460c1);});}const runFlags=[{'name':a150_0x2001f7(0x111),'type':a150_0x2001f7(0x122),'description':a150_0x2001f7(0x11b),'default':![]}];export const runDefinition={'service':a150_0x2001f7(0x10c),'command':a150_0x2001f7(0x10c),'description':a150_0x2001f7(0x103),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a150_0x2001f7(0x133),'description':a150_0x2001f7(0x126),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x3e03c2=a150_0x2001f7,_0x45f421=[];return _0x45f421['push']('\x20\x20EXAMPLES'),_0x45f421[_0x3e03c2(0x12e)](_0x3e03c2(0x12b)+CLI_BIN_NAME+_0x3e03c2(0x138)),_0x45f421[_0x3e03c2(0x12e)](_0x3e03c2(0x12b)+CLI_BIN_NAME+'\x20run\x20build'),_0x45f421[_0x3e03c2(0x12e)](_0x3e03c2(0x12b)+CLI_BIN_NAME+_0x3e03c2(0x102)),_0x45f421[_0x3e03c2(0x12e)](_0x3e03c2(0x12b)+CLI_BIN_NAME+_0x3e03c2(0x136)),_0x45f421[_0x3e03c2(0x115)]('\x0a');},async 'execute'(_0x54bb4f){const _0x4a86d6=a150_0x2001f7,_0x5cd036=process[_0x4a86d6(0x11f)](),_0x3b4156=_0x54bb4f[_0x4a86d6(0x10f)][0x0],_0xb65597=_0x54bb4f[_0x4a86d6(0x10f)]['slice'](0x1),_0x4fef94=readPackageScripts(_0x5cd036);if(!_0x4fef94)throw CliErrors[_0x4a86d6(0x104)](_0x4a86d6(0x113));if(!_0x3b4156){const _0x41f86e=Object[_0x4a86d6(0x109)](_0x4fef94);if(_0x41f86e[_0x4a86d6(0x12c)]===0x0)console[_0x4a86d6(0x11a)]('No\x20scripts\x20defined\x20in\x20package.json.');else{console[_0x4a86d6(0x11a)](_0x4a86d6(0x134));for(const _0x25a6d9 of _0x41f86e){console[_0x4a86d6(0x11a)](_0x4a86d6(0x12b)+_0x25a6d9);}console[_0x4a86d6(0x11a)](_0x4a86d6(0x114)+CLI_BIN_NAME+_0x4a86d6(0x112));}return{'ok':!![]};}if(!_0x4fef94[_0x3b4156])throw CliErrors['validation']('Script\x20\x22'+_0x3b4156+_0x4a86d6(0x137),_0x4a86d6(0x12d)+(Object[_0x4a86d6(0x109)](_0x4fef94)[_0x4a86d6(0x115)](',\x20')||_0x4a86d6(0x117)));const _0x328497=detectPackageManager(_0x5cd036);VERSION_CHECK_SCRIPTS[_0x4a86d6(0x132)](_0x3b4156)&&await versionCheck(_0x5cd036);if(_0x3b4156===_0x4a86d6(0x11c)&&_0x54bb4f[_0x4a86d6(0x128)]('watch'))return await Promise[_0x4a86d6(0x130)]([spawnViteBuildWatch(_0x5cd036),spawnVitePreview(_0x5cd036)]),{'ok':!![]};return await spawnScript(_0x328497,_0x3b4156,_0xb65597,_0x5cd036),{'ok':!![]};}};
1
+ const a152_0x4754c8=a152_0x3432;(function(_0x488634,_0x2c1632){const _0x49ca2f=a152_0x3432,_0x11e30b=_0x488634();while(!![]){try{const _0x34df7d=parseInt(_0x49ca2f(0xd1))/0x1*(parseInt(_0x49ca2f(0xd6))/0x2)+parseInt(_0x49ca2f(0xd9))/0x3*(-parseInt(_0x49ca2f(0xd3))/0x4)+-parseInt(_0x49ca2f(0xad))/0x5*(-parseInt(_0x49ca2f(0xe2))/0x6)+parseInt(_0x49ca2f(0xb0))/0x7*(parseInt(_0x49ca2f(0xc0))/0x8)+parseInt(_0x49ca2f(0xc6))/0x9*(-parseInt(_0x49ca2f(0xcd))/0xa)+-parseInt(_0x49ca2f(0xe3))/0xb+-parseInt(_0x49ca2f(0xb4))/0xc;if(_0x34df7d===_0x2c1632)break;else _0x11e30b['push'](_0x11e30b['shift']());}catch(_0x864e7f){_0x11e30b['push'](_0x11e30b['shift']());}}}(a152_0x4e66,0xbf2a1));import{readFileSync,existsSync}from'node:fs';function a152_0x4e66(){const _0x148c1b=['5wnFfjL','vite\x20preview\x20exited\x20with\x20code\x20','No\x20package.json\x20found\x20in\x20current\x20directory.','7agLTjZ','\x0a\x20\x20Usage:\x20','\x20run\x20build','npm','5872488AQjlJB','(none)','vite','pnpm-lock.yaml','bool','script','watch','parse','start','preview','log','yarn','5379416oFdnLt','\x20run\x20preview','node_modules','validation','\x20run\x20start','bun.lockb','4266dPRuKK','build','close','No\x20scripts\x20defined\x20in\x20package.json.','\x20run\x20<script>\x0a','\x20\x20EXAMPLES','keys','5140DtxxMW','Script\x20\x22','\x20\x20\x20\x20','error','1320623ozaVLl','run','1108532WrfErO','args','pnpm','2wAzXIm','\x20exited\x20with\x20code\x20','scripts','3ukmlob','\x0a\x20\x20Available\x20scripts:\x0a','inherit','read','\x22\x20not\x20found\x20in\x20package.json.','bun.lock','.bin','push','Available:\x20','6342588OqkbMI','13826956zLqbaw','all','join','belowMinimum','\x20run\x20','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','boolean'];a152_0x4e66=function(){return _0x148c1b;};return a152_0x4e66();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a152_0x4754c8(0xbc),'dev']);function readPackageScripts(_0x8fc21c){const _0x454dbd=a152_0x4754c8,_0x4befc1=resolve(_0x8fc21c,'package.json');if(!existsSync(_0x4befc1))return null;try{const _0x3c39c4=JSON[_0x454dbd(0xbb)](readFileSync(_0x4befc1,'utf-8'));return _0x3c39c4[_0x454dbd(0xd8)]??{};}catch{return null;}}function detectPackageManager(_0x225084){const _0x5675f6=a152_0x4754c8;if(existsSync(resolve(_0x225084,_0x5675f6(0xc5)))||existsSync(resolve(_0x225084,_0x5675f6(0xde))))return'bun';if(existsSync(resolve(_0x225084,_0x5675f6(0xb7))))return _0x5675f6(0xd5);if(existsSync(resolve(_0x225084,'yarn.lock')))return _0x5675f6(0xbf);return _0x5675f6(0xb3);}async function versionCheck(_0x33b90b){const _0x389edd=a152_0x4754c8,_0x3d3072=await checkCliVersion();(_0x3d3072['needsUpgrade']||_0x3d3072[_0x389edd(0xe6)])&&(printCliUpgradeWarning(_0x3d3072),assertCliVersionSupported(_0x3d3072));const _0x3f7786=await checkSdkVersion(_0x33b90b);if(_0x3f7786['needsUpgrade'])printSdkUpgradeWarning(_0x3f7786);}function a152_0x3432(_0x32c1ea,_0x196532){_0x32c1ea=_0x32c1ea-0xac;const _0x4e6672=a152_0x4e66();let _0x3432c3=_0x4e6672[_0x32c1ea];return _0x3432c3;}function spawnScript(_0x46c6ad,_0x4167f1,_0x36086c,_0x28cb63){return new Promise((_0xbade05,_0x30a883)=>{const _0x372080=a152_0x3432,_0x2c9701=[_0x372080(0xd2),_0x4167f1,..._0x36086c],_0x2074aa=spawn(_0x46c6ad,_0x2c9701,{'cwd':_0x28cb63,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x28cb63,_0x372080(0xc2),_0x372080(0xdf))+delimiter+process.env.PATH}});_0x2074aa['on']('close',_0x235a83=>{const _0x516a7f=_0x372080;if(_0x235a83===0x0||_0x235a83===null)_0xbade05();else _0x30a883(new Error(_0x46c6ad+_0x516a7f(0xe7)+_0x4167f1+_0x516a7f(0xd7)+_0x235a83));}),_0x2074aa['on']('error',_0x30a883);});}function spawnViteBuildWatch(_0xdfa2e6){return new Promise((_0x5e57a5,_0x2f2266)=>{const _0x3bfa83=a152_0x3432,_0x49d2ed=spawn('vite',[_0x3bfa83(0xc7),'--watch'],{'cwd':_0xdfa2e6,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0xdfa2e6,_0x3bfa83(0xc2),_0x3bfa83(0xdf))+delimiter+process.env.PATH}});_0x49d2ed['on'](_0x3bfa83(0xc8),_0x1e7ba2=>{const _0x38a1fe=_0x3bfa83;if(_0x1e7ba2===0x0||_0x1e7ba2===null)_0x5e57a5();else _0x2f2266(new Error(_0x38a1fe(0xe8)+_0x1e7ba2));}),_0x49d2ed['on'](_0x3bfa83(0xd0),_0x2f2266);});}function spawnVitePreview(_0x1ecb1e){return new Promise((_0xdf1b2f,_0x4b5c12)=>{const _0x4949db=a152_0x3432,_0x36bc38=spawn(_0x4949db(0xb6),['preview'],{'cwd':_0x1ecb1e,'stdio':_0x4949db(0xdb),'shell':!![],'env':{...process.env,'PATH':''+join(_0x1ecb1e,_0x4949db(0xc2),_0x4949db(0xdf))+delimiter+process.env.PATH}});_0x36bc38['on'](_0x4949db(0xc8),_0x154cfd=>{const _0x335263=_0x4949db;if(_0x154cfd===0x0||_0x154cfd===null)_0xdf1b2f();else _0x4b5c12(new Error(_0x335263(0xae)+_0x154cfd));}),_0x36bc38['on'](_0x4949db(0xd0),_0x4b5c12);});}const runFlags=[{'name':a152_0x4754c8(0xba),'type':a152_0x4754c8(0xac),'description':'Enable\x20watch\x20mode\x20for\x20preview','default':![]}];export const runDefinition={'service':a152_0x4754c8(0xd2),'command':a152_0x4754c8(0xd2),'description':'Run\x20a\x20package.json\x20script','risk':a152_0x4754c8(0xdc),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a152_0x4754c8(0xb9),'description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x2ce408=a152_0x4754c8,_0x254d6d=[];return _0x254d6d[_0x2ce408(0xe0)](_0x2ce408(0xcb)),_0x254d6d[_0x2ce408(0xe0)](_0x2ce408(0xcf)+CLI_BIN_NAME+_0x2ce408(0xc4)),_0x254d6d[_0x2ce408(0xe0)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x2ce408(0xb2)),_0x254d6d['push'](_0x2ce408(0xcf)+CLI_BIN_NAME+_0x2ce408(0xc1)),_0x254d6d[_0x2ce408(0xe0)](_0x2ce408(0xcf)+CLI_BIN_NAME+'\x20run\x20preview\x20--watch'),_0x254d6d[_0x2ce408(0xe5)]('\x0a');},async 'execute'(_0xa1b0a6){const _0x200c4b=a152_0x4754c8,_0x4aa515=process['cwd'](),_0x59711f=_0xa1b0a6[_0x200c4b(0xd4)][0x0],_0x5f0ff7=_0xa1b0a6['args']['slice'](0x1),_0x5d5d2f=readPackageScripts(_0x4aa515);if(!_0x5d5d2f)throw CliErrors[_0x200c4b(0xc3)](_0x200c4b(0xaf));if(!_0x59711f){const _0x5b0166=Object[_0x200c4b(0xcc)](_0x5d5d2f);if(_0x5b0166['length']===0x0)console[_0x200c4b(0xbe)](_0x200c4b(0xc9));else{console[_0x200c4b(0xbe)](_0x200c4b(0xda));for(const _0x581f44 of _0x5b0166){console[_0x200c4b(0xbe)](_0x200c4b(0xcf)+_0x581f44);}console[_0x200c4b(0xbe)](_0x200c4b(0xb1)+CLI_BIN_NAME+_0x200c4b(0xca));}return{'ok':!![]};}if(!_0x5d5d2f[_0x59711f])throw CliErrors['validation'](_0x200c4b(0xce)+_0x59711f+_0x200c4b(0xdd),_0x200c4b(0xe1)+(Object['keys'](_0x5d5d2f)[_0x200c4b(0xe5)](',\x20')||_0x200c4b(0xb5)));const _0x33a0bb=detectPackageManager(_0x4aa515);VERSION_CHECK_SCRIPTS['has'](_0x59711f)&&await versionCheck(_0x4aa515);if(_0x59711f===_0x200c4b(0xbd)&&_0xa1b0a6[_0x200c4b(0xb8)](_0x200c4b(0xba)))return await Promise[_0x200c4b(0xe4)]([spawnViteBuildWatch(_0x4aa515),spawnVitePreview(_0x4aa515)]),{'ok':!![]};return await spawnScript(_0x33a0bb,_0x59711f,_0x5f0ff7,_0x4aa515),{'ok':!![]};}};
@@ -1 +1 @@
1
- const a151_0x53c91f=a151_0x551e;(function(_0x1f0e26,_0x35fd20){const _0x5e17b0=a151_0x551e,_0x22c581=_0x1f0e26();while(!![]){try{const _0xe8200f=parseInt(_0x5e17b0(0x16f))/0x1+parseInt(_0x5e17b0(0x173))/0x2+-parseInt(_0x5e17b0(0x16d))/0x3+-parseInt(_0x5e17b0(0x16a))/0x4+parseInt(_0x5e17b0(0x167))/0x5*(parseInt(_0x5e17b0(0x168))/0x6)+parseInt(_0x5e17b0(0x172))/0x7*(parseInt(_0x5e17b0(0x169))/0x8)+parseInt(_0x5e17b0(0x16c))/0x9;if(_0xe8200f===_0x35fd20)break;else _0x22c581['push'](_0x22c581['shift']());}catch(_0x41bb58){_0x22c581['push'](_0x22c581['shift']());}}}(a151_0x2a0a,0xcdbec));function a151_0x2a0a(){const _0x5243b7=['2702226csxZtU','json','29287aXZBdM','schema','read','100702bJbZVa','757654tNMVjR','699065eBZLeA','36baIEhV','168nuYWlV','5592112XrLsAG','export','14331636Uyrdvd'];a151_0x2a0a=function(){return _0x5243b7;};return a151_0x2a0a();}import{buildSchemaPayload}from'../framework/schema-export.js';function a151_0x551e(_0x536821,_0x3dce7f){_0x536821=_0x536821-0x167;const _0x2a0aac=a151_0x2a0a();let _0x551ea1=_0x2a0aac[_0x536821];return _0x551ea1;}async function execute(_0x22ab7b){const _0x504b06=await buildSchemaPayload();return{'ok':!![],'data':_0x504b06};}export const schemaDefinition={'service':a151_0x53c91f(0x170),'command':a151_0x53c91f(0x16b),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a151_0x53c91f(0x171),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a151_0x53c91f(0x16e),'flags':[],'execute':execute};
1
+ const a153_0x318e99=a153_0x3b62;(function(_0x57b0fb,_0xe53a61){const _0xfe0421=a153_0x3b62,_0x18dd51=_0x57b0fb();while(!![]){try{const _0x7cc052=-parseInt(_0xfe0421(0xe0))/0x1+-parseInt(_0xfe0421(0xe1))/0x2+-parseInt(_0xfe0421(0xe2))/0x3*(-parseInt(_0xfe0421(0xde))/0x4)+parseInt(_0xfe0421(0xdc))/0x5+parseInt(_0xfe0421(0xe5))/0x6+-parseInt(_0xfe0421(0xe6))/0x7*(-parseInt(_0xfe0421(0xe3))/0x8)+parseInt(_0xfe0421(0xe7))/0x9;if(_0x7cc052===_0xe53a61)break;else _0x18dd51['push'](_0x18dd51['shift']());}catch(_0x255a5a){_0x18dd51['push'](_0x18dd51['shift']());}}}(a153_0x3d89,0x29455));import{buildSchemaPayload}from'../framework/schema-export.js';function a153_0x3b62(_0x3846d7,_0x9acfdd){_0x3846d7=_0x3846d7-0xdc;const _0x3d8958=a153_0x3d89();let _0x3b62b5=_0x3d8958[_0x3846d7];return _0x3b62b5;}async function execute(_0x636472){const _0x416a94=await buildSchemaPayload();return{'ok':!![],'data':_0x416a94};}export const schemaDefinition={'service':a153_0x318e99(0xdd),'command':'export','description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a153_0x318e99(0xe4),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a153_0x318e99(0xdf),'flags':[],'execute':execute};function a153_0x3d89(){const _0x4c6164=['8gbqDxf','read','454290RTjvZH','579089kwurEJ','1071972oCEVEV','471040wLVwbS','schema','291012MDYUzq','json','125922HUrTeB','590100BgMMxu','9IRhIKr'];a153_0x3d89=function(){return _0x4c6164;};return a153_0x3d89();}
@@ -1 +1 @@
1
- const a152_0x34191c=a152_0x1c9a;(function(_0xd26d1e,_0x2a299c){const _0x132356=a152_0x1c9a,_0x393014=_0xd26d1e();while(!![]){try{const _0x1effc1=-parseInt(_0x132356(0x10f))/0x1*(parseInt(_0x132356(0xe7))/0x2)+-parseInt(_0x132356(0x113))/0x3+-parseInt(_0x132356(0xf5))/0x4*(-parseInt(_0x132356(0x108))/0x5)+-parseInt(_0x132356(0xe5))/0x6+parseInt(_0x132356(0xf6))/0x7+-parseInt(_0x132356(0x111))/0x8*(parseInt(_0x132356(0x127))/0x9)+parseInt(_0x132356(0x10c))/0xa;if(_0x1effc1===_0x2a299c)break;else _0x393014['push'](_0x393014['shift']());}catch(_0x2890d8){_0x393014['push'](_0x393014['shift']());}}}(a152_0x49f6,0xea48f));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';function a152_0x1c9a(_0x1b7214,_0xe7f202){_0x1b7214=_0x1b7214-0xe3;const _0x49f694=a152_0x49f6();let _0x1c9a6f=_0x49f694[_0x1b7214];return _0x1c9a6f;}import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';function a152_0x49f6(){const _0x2ed4ec=['sqls','适合带动态标签的\x20MyBatis\x20XML\x20SQL','28TfwUgT','name','427104joheAF','description','3233454aeiNGw','join','POST','MyBatis\x20XML(mybatisXml)','validation','number','SQL\x20名称不能为空','请选择目标数据库:','isFinite','Target\x20database\x20ID','</select>','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','mode','isInteger','sqlName','\x20\x20SELECT\x201\x20AS\x20id','请选择本地\x20SQL\x20模式:','File\x20already\x20exists:\x20','string','请输入\x20SQL\x20名称:','162XFajVd','SQL\x20query\x20display\x20name','db-id','2568312SAEfoG','catch','13778rOGzJy','Invalid\x20database\x20selection\x20payload:\x20','请输入目标数据库\x20dbId:','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','length','sql','SELECT\x201\x20AS\x20id;','__manual__','flagMissing','sqlCode','lastSync','utf8','appCode','dbName','1303556RXvMZf','235739szSsOT','high-risk-write','sqlRoot','toISOString','dbId','flag','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','普通\x20SQL(sql)','sqlRootDir','stringify','nonInteractive','mybatisXml','✎\x20手动输入\x20dbId','/smartapi/custom/saveUserCustomSql','create','dbId\x20必须为正整数','str','map','15VLiZKe','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','new','trim','26080330Iqikbc'];a152_0x49f6=function(){return _0x2ed4ec;};return a152_0x49f6();}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(_0x1265e2){const _0x1871b0=a152_0x1c9a;if(_0x1265e2==='mybatisXml')return['<select\x20id=\x22query\x22\x20resultType=\x22map\x22>',_0x1871b0(0x122),_0x1871b0(0x11d),'']['join']('\x0a');return[_0x1871b0(0xed),''][_0x1871b0(0x114)]('\x0a');}export const sqlCreate={'service':a152_0x34191c(0xec),'command':a152_0x34191c(0x104),'description':'Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','risk':a152_0x34191c(0xf7),'flags':[{'name':a152_0x34191c(0x110),'type':'string','description':a152_0x34191c(0xe3)},{'name':'db-id','type':a152_0x34191c(0x118),'description':a152_0x34191c(0x11c)},{'name':'mode','type':a152_0x34191c(0x125),'enum':['sql',a152_0x34191c(0x101)],'description':'Local\x20SQL\x20file\x20mode'}],async 'validate'(_0x22c360){const _0x3e8a6c=a152_0x34191c;if(!_0x22c360[_0x3e8a6c(0x100)])return;if(!_0x22c360[_0x3e8a6c(0x106)](_0x3e8a6c(0x110))[_0x3e8a6c(0x10b)]())throw CliErrors[_0x3e8a6c(0xef)](_0x3e8a6c(0x110),_0x3e8a6c(0xfc));const _0x19200b=resolveProvidedDbId(_0x22c360);if(typeof _0x19200b!=='number'||!Number[_0x3e8a6c(0x11b)](_0x19200b)||_0x19200b<=0x0)throw CliErrors[_0x3e8a6c(0xef)](_0x3e8a6c(0xe4),_0x3e8a6c(0xea));if(!_0x22c360[_0x3e8a6c(0x106)](_0x3e8a6c(0x11f))[_0x3e8a6c(0x10b)]())throw CliErrors[_0x3e8a6c(0xef)](_0x3e8a6c(0x11f),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0x5d428a){const _0x196289=a152_0x34191c,_0x4924ad=loadSqlProjectConfig(_0x5d428a['appCode']),{sqlName:_0x3fa51d,dbId:_0x6e224b,dbName:_0x34cc32,mode:_0x215e6b}=await resolveSqlNewInputs(_0x5d428a),_0x229d43=buildSqlRelativePath('<server-generated-sqlCode>',_0x3fa51d,_0x34cc32,_0x215e6b,_0x6e224b),_0x55c0b8=_0x4924ad[_0x196289(0xfe)]+'/'+_0x229d43;return{'method':_0x196289(0x115),'url':_0x196289(0x103),'body':{'appCode':_0x5d428a['appCode'],'sqlName':_0x3fa51d,'dbId':_0x6e224b,'mode':_0x215e6b,'localPath':_0x55c0b8},'description':_0x196289(0x109)+_0x4924ad['sqlRootDir']};},async 'execute'(_0x290d58){const _0x1845ac=a152_0x34191c,_0x48cf21=loadSqlProjectConfig(_0x290d58['appCode']),{sqlName:_0x16f06e,dbId:_0x54f8ac,dbName:_0x422387,mode:_0x4a8248}=await resolveSqlNewInputs(_0x290d58),_0x468d87=generateSqlTemplate(_0x4a8248),_0xd47c97=await createSqlQuery({'appCode':_0x290d58[_0x1845ac(0xf3)],'sqlName':_0x16f06e,'dbId':_0x54f8ac,'sqlContent':_0x468d87}),_0xc35ff0=ensureRemoteSqlContent(_0xd47c97),_0x29a5cd=_0x422387||await getDbName(_0x290d58['appCode'],_0x54f8ac)[_0x1845ac(0xe6)](()=>undefined),_0x3b7472=buildSqlRelativePath(_0xd47c97['sqlCode'],_0xd47c97[_0x1845ac(0x121)],_0x29a5cd,_0x4a8248,_0x54f8ac),_0x5a0b08=_0x48cf21[_0x1845ac(0xfe)]+'/'+_0x3b7472,_0x3cabf4=buildLocalSqlFileContent({'sqlCode':_0xd47c97[_0x1845ac(0xf0)],'sqlName':_0xd47c97[_0x1845ac(0x121)],'dbId':_0xd47c97[_0x1845ac(0xfa)]},_0xc35ff0,{'dbName':_0x29a5cd,'mode':_0x4a8248,'syncedAt':new Date()[_0x1845ac(0xf9)](),'description':_0xd47c97[_0x1845ac(0x112)]});if(await fileExists(_0x5a0b08))throw CliErrors[_0x1845ac(0x117)](_0x1845ac(0x124)+_0x5a0b08);await ensureParentDirectory(_0x5a0b08),await writeFile(_0x5a0b08,_0x3cabf4,_0x1845ac(0xf2));const _0x571fac=await readSqlLockFile(_0x48cf21['lockFilePath']),{lockData:_0x436f9b,appLock:_0x40a57f}=ensureSqlLockScope(_0x571fac??createEmptySqlLock(),_0x48cf21[_0x1845ac(0xf3)],_0x48cf21[_0x1845ac(0xf8)],_0x1845ac(0x10a));return _0x40a57f[_0x1845ac(0x10d)][_0xd47c97[_0x1845ac(0xf0)]]={...buildSqlLockEntry(_0xd47c97,_0xc35ff0,computeSqlContentHash(_0x3cabf4),{'dbName':_0x29a5cd}),'path':_0x3b7472,'mode':_0x4a8248},_0x40a57f[_0x1845ac(0xf1)]=new Date()[_0x1845ac(0xf9)](),await writeSqlLockFile(_0x48cf21['lockFilePath'],_0x436f9b),{'ok':!![],'data':{'id':_0xd47c97['id'],'sqlCode':_0xd47c97[_0x1845ac(0xf0)],'sqlName':_0xd47c97[_0x1845ac(0x121)],'dbId':_0xd47c97[_0x1845ac(0xfa)],'path':_0x5a0b08,'mode':_0x4a8248},'message':'Created\x20SQL\x20query\x20'+_0xd47c97[_0x1845ac(0xf0)]};}};async function resolveSqlNewInputs(_0x3c89d4){const _0x42196a=await resolveSqlNameInput(_0x3c89d4),{dbId:_0x2516e0,dbName:_0x247f86}=await resolveDbSelection(_0x3c89d4),_0x3efc90=await resolveSqlModeInput(_0x3c89d4);return{'sqlName':_0x42196a,'dbId':_0x2516e0,'dbName':_0x247f86,'mode':_0x3efc90};}async function resolveSqlNameInput(_0x33b961){const _0x2580e5=a152_0x34191c,_0x1ee938=_0x33b961[_0x2580e5(0x106)](_0x2580e5(0x110))[_0x2580e5(0x10b)]();if(_0x1ee938)return _0x1ee938;if(_0x33b961[_0x2580e5(0x100)])throw CliErrors[_0x2580e5(0xef)]('name',_0x2580e5(0xfc));return(await input({'message':_0x2580e5(0x126),'validate':_0x2c7872=>_0x2c7872[_0x2580e5(0x10b)]()?!![]:_0x2580e5(0x119)}))[_0x2580e5(0x10b)]();}async function resolveDbSelection(_0x48e459){const _0x3bc509=a152_0x34191c,_0x24cda6=resolveProvidedDbId(_0x48e459);if(typeof _0x24cda6==='number'&&Number['isFinite'](_0x24cda6)&&_0x24cda6>0x0)return{'dbId':_0x24cda6,'dbName':await getDbName(_0x48e459[_0x3bc509(0xf3)],_0x24cda6)['catch'](()=>undefined)};if(_0x48e459['nonInteractive'])throw CliErrors[_0x3bc509(0xef)](_0x3bc509(0xe4),_0x3bc509(0xea));const _0x14eaa6=await listDatabases(_0x48e459['appCode'])['catch'](()=>[]);if(_0x14eaa6[_0x3bc509(0xeb)]===0x1)return{'dbId':_0x14eaa6[0x0][_0x3bc509(0xfa)],'dbName':_0x14eaa6[0x0][_0x3bc509(0xf4)]};if(_0x14eaa6[_0x3bc509(0xeb)]>0x1){const _0x86c6b5=await select({'message':_0x3bc509(0x11a),'choices':[..._0x14eaa6[_0x3bc509(0x107)](_0x32f6c6=>({'name':_0x32f6c6['dbName']+'\x20('+_0x32f6c6[_0x3bc509(0xfa)]+')','value':serializeDbSelection(_0x32f6c6)})),{'name':_0x3bc509(0x102),'value':_0x3bc509(0xee)}]});if(_0x86c6b5!==_0x3bc509(0xee))return deserializeDbSelection(_0x86c6b5);}const _0x10bff7=await input({'message':_0x3bc509(0xe9),'validate':_0x1a3c8f=>{const _0x330c39=_0x3bc509,_0x6b6d71=_0x1a3c8f[_0x330c39(0x10b)]();if(!_0x6b6d71)return'dbId\x20不能为空';const _0xf3409d=Number(_0x6b6d71);if(!Number[_0x330c39(0x120)](_0xf3409d)||_0xf3409d<=0x0)return _0x330c39(0x105);return!![];}});return{'dbId':Number(_0x10bff7['trim']())};}async function resolveSqlModeInput(_0x4bb57e){const _0x33e00f=a152_0x34191c,_0x1399a3=_0x4bb57e[_0x33e00f(0x106)]('mode')[_0x33e00f(0x10b)]();if(_0x1399a3===_0x33e00f(0xec)||_0x1399a3===_0x33e00f(0x101))return _0x1399a3;if(_0x4bb57e[_0x33e00f(0x100)])throw CliErrors[_0x33e00f(0xef)](_0x33e00f(0x11f),_0x33e00f(0x11e));return await select({'message':_0x33e00f(0x123),'choices':[{'name':_0x33e00f(0xfd),'value':_0x33e00f(0xec),'description':'适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句'},{'name':_0x33e00f(0x116),'value':_0x33e00f(0x101),'description':_0x33e00f(0x10e)}]});}function serializeDbSelection(_0x40b964){const _0x4186aa=a152_0x34191c;return JSON[_0x4186aa(0xff)]({'dbId':_0x40b964[_0x4186aa(0xfa)],'dbName':_0x40b964['dbName']});}function deserializeDbSelection(_0x172879){const _0x4c42b6=a152_0x34191c;try{const _0x24ca2c=JSON['parse'](_0x172879);if(typeof _0x24ca2c[_0x4c42b6(0xfa)]===_0x4c42b6(0x118)&&Number[_0x4c42b6(0x11b)](_0x24ca2c[_0x4c42b6(0xfa)]))return{'dbId':_0x24ca2c[_0x4c42b6(0xfa)],'dbName':_0x24ca2c['dbName']};}catch{}throw CliErrors[_0x4c42b6(0x117)](_0x4c42b6(0xe8)+_0x172879);}function resolveProvidedDbId(_0x4e33b9){const _0x4beb13=a152_0x34191c,_0x314485=_0x4e33b9[_0x4beb13(0xfb)](_0x4beb13(0xe4));if(typeof _0x314485===_0x4beb13(0x118)&&Number[_0x4beb13(0x11b)](_0x314485))return _0x314485;return undefined;}
1
+ const a154_0x48826e=a154_0x426d;(function(_0x25271c,_0x42e9c1){const _0x2ba92c=a154_0x426d,_0x3004ff=_0x25271c();while(!![]){try{const _0x1faf7f=-parseInt(_0x2ba92c(0x1ac))/0x1+-parseInt(_0x2ba92c(0x16e))/0x2*(parseInt(_0x2ba92c(0x1a3))/0x3)+parseInt(_0x2ba92c(0x184))/0x4+-parseInt(_0x2ba92c(0x18f))/0x5*(parseInt(_0x2ba92c(0x16f))/0x6)+-parseInt(_0x2ba92c(0x178))/0x7*(parseInt(_0x2ba92c(0x19f))/0x8)+parseInt(_0x2ba92c(0x187))/0x9+parseInt(_0x2ba92c(0x189))/0xa;if(_0x1faf7f===_0x42e9c1)break;else _0x3004ff['push'](_0x3004ff['shift']());}catch(_0x1f3cdd){_0x3004ff['push'](_0x3004ff['shift']());}}}(a154_0x16d7,0x1c360));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';function a154_0x426d(_0x36bbee,_0x2b7a5a){_0x36bbee=_0x36bbee-0x16d;const _0x16d79e=a154_0x16d7();let _0x426d2b=_0x16d79e[_0x36bbee];return _0x426d2b;}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x3590f5){const _0x3de08a=a154_0x426d;if(_0x3590f5==='mybatisXml')return['<select\x20id=\x22query\x22\x20resultType=\x22map\x22>',_0x3de08a(0x1a9),'</select>',''][_0x3de08a(0x17d)]('\x0a');return[_0x3de08a(0x1a7),''][_0x3de08a(0x17d)]('\x0a');}export const sqlCreate={'service':a154_0x48826e(0x1ad),'command':a154_0x48826e(0x1a4),'description':a154_0x48826e(0x1a0),'risk':'high-risk-write','flags':[{'name':a154_0x48826e(0x17b),'type':a154_0x48826e(0x1a8),'description':a154_0x48826e(0x177)},{'name':a154_0x48826e(0x171),'type':'number','description':a154_0x48826e(0x1aa)},{'name':'mode','type':'string','enum':['sql','mybatisXml'],'description':'Local\x20SQL\x20file\x20mode'}],async 'validate'(_0x30923c){const _0x4c9a3a=a154_0x48826e;if(!_0x30923c[_0x4c9a3a(0x18c)])return;if(!_0x30923c[_0x4c9a3a(0x190)]('name')[_0x4c9a3a(0x17f)]())throw CliErrors['flagMissing'](_0x4c9a3a(0x17b),_0x4c9a3a(0x17c));const _0x53f12d=resolveProvidedDbId(_0x30923c);if(typeof _0x53f12d!==_0x4c9a3a(0x19c)||!Number[_0x4c9a3a(0x195)](_0x53f12d)||_0x53f12d<=0x0)throw CliErrors[_0x4c9a3a(0x196)](_0x4c9a3a(0x171),_0x4c9a3a(0x191));if(!_0x30923c[_0x4c9a3a(0x190)](_0x4c9a3a(0x192))[_0x4c9a3a(0x17f)]())throw CliErrors[_0x4c9a3a(0x196)](_0x4c9a3a(0x192),_0x4c9a3a(0x183));},async 'dryRun'(_0x3e12bb){const _0x1948f2=a154_0x48826e,_0x3ba0b4=loadSqlProjectConfig(_0x3e12bb['appCode']),{sqlName:_0x284cab,dbId:_0x3cf03d,dbName:_0x1cf78c,mode:_0x324f03}=await resolveSqlNewInputs(_0x3e12bb),_0x25e3c9=buildSqlRelativePath(_0x1948f2(0x194),_0x284cab,_0x1cf78c,_0x324f03,_0x3cf03d),_0x257236=_0x3ba0b4[_0x1948f2(0x19d)]+'/'+_0x25e3c9;return{'method':'POST','url':'/smartapi/custom/saveUserCustomSql','body':{'appCode':_0x3e12bb[_0x1948f2(0x174)],'sqlName':_0x284cab,'dbId':_0x3cf03d,'mode':_0x324f03,'localPath':_0x257236},'description':_0x1948f2(0x186)+_0x3ba0b4[_0x1948f2(0x19d)]};},async 'execute'(_0x4a6f5c){const _0x57a324=a154_0x48826e,_0x334aa9=loadSqlProjectConfig(_0x4a6f5c[_0x57a324(0x174)]),{sqlName:_0x1119bd,dbId:_0x2d6bbb,dbName:_0x13b253,mode:_0x304272}=await resolveSqlNewInputs(_0x4a6f5c),_0x37cc84=generateSqlTemplate(_0x304272),_0x59d33f=await createSqlQuery({'appCode':_0x4a6f5c[_0x57a324(0x174)],'sqlName':_0x1119bd,'dbId':_0x2d6bbb,'sqlContent':_0x37cc84}),_0x30541a=ensureRemoteSqlContent(_0x59d33f),_0x80d6f9=_0x13b253||await getDbName(_0x4a6f5c['appCode'],_0x2d6bbb)[_0x57a324(0x1a2)](()=>undefined),_0x2fa8e3=buildSqlRelativePath(_0x59d33f[_0x57a324(0x19a)],_0x59d33f[_0x57a324(0x1a6)],_0x80d6f9,_0x304272,_0x2d6bbb),_0x1107be=_0x334aa9[_0x57a324(0x19d)]+'/'+_0x2fa8e3,_0x22ba3a=buildLocalSqlFileContent({'sqlCode':_0x59d33f[_0x57a324(0x19a)],'sqlName':_0x59d33f[_0x57a324(0x1a6)],'dbId':_0x59d33f[_0x57a324(0x185)]},_0x30541a,{'dbName':_0x80d6f9,'mode':_0x304272,'syncedAt':new Date()['toISOString'](),'description':_0x59d33f[_0x57a324(0x198)]});if(await fileExists(_0x1107be))throw CliErrors[_0x57a324(0x19b)](_0x57a324(0x182)+_0x1107be);await ensureParentDirectory(_0x1107be),await writeFile(_0x1107be,_0x22ba3a,_0x57a324(0x179));const _0x510200=await readSqlLockFile(_0x334aa9['lockFilePath']),{lockData:_0x56b6fe,appLock:_0x1a7f39}=ensureSqlLockScope(_0x510200??createEmptySqlLock(),_0x334aa9[_0x57a324(0x174)],_0x334aa9['sqlRoot'],_0x57a324(0x18b));return _0x1a7f39[_0x57a324(0x199)][_0x59d33f[_0x57a324(0x19a)]]={...buildSqlLockEntry(_0x59d33f,_0x30541a,computeSqlContentHash(_0x22ba3a),{'dbName':_0x80d6f9}),'path':_0x2fa8e3,'mode':_0x304272},_0x1a7f39[_0x57a324(0x193)]=new Date()[_0x57a324(0x1a1)](),await writeSqlLockFile(_0x334aa9[_0x57a324(0x181)],_0x56b6fe),{'ok':!![],'data':{'id':_0x59d33f['id'],'sqlCode':_0x59d33f['sqlCode'],'sqlName':_0x59d33f[_0x57a324(0x1a6)],'dbId':_0x59d33f[_0x57a324(0x185)],'path':_0x1107be,'mode':_0x304272},'message':'Created\x20SQL\x20query\x20'+_0x59d33f[_0x57a324(0x19a)]};}};async function resolveSqlNewInputs(_0xff77fe){const _0x37fbb2=await resolveSqlNameInput(_0xff77fe),{dbId:_0x51e888,dbName:_0x48387b}=await resolveDbSelection(_0xff77fe),_0x39267d=await resolveSqlModeInput(_0xff77fe);return{'sqlName':_0x37fbb2,'dbId':_0x51e888,'dbName':_0x48387b,'mode':_0x39267d};}function a154_0x16d7(){const _0x2cb065=['stringify','appCode','length','flag','SQL\x20query\x20display\x20name','14zHObaG','utf8','isInteger','name','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','join','__manual__','trim','dbId\x20不能为空','lockFilePath','File\x20already\x20exists:\x20','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','214264arZtKE','dbId','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','519687cUPtDD','parse','5809440XzzyNF','dbId\x20必须为正整数','new','nonInteractive','普通\x20SQL(sql)','请选择本地\x20SQL\x20模式:','22735hqryTb','str','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','mode','lastSync','<server-generated-sqlCode>','isFinite','flagMissing','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','description','sqls','sqlCode','validation','number','sqlRootDir','SQL\x20名称不能为空','783856FJIjJI','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','toISOString','catch','663603yvfitF','create','Invalid\x20database\x20selection\x20payload:\x20','sqlName','SELECT\x201\x20AS\x20id;','string','\x20\x20SELECT\x201\x20AS\x20id','Target\x20database\x20ID','请选择目标数据库:','45861IppeNK','sql','MyBatis\x20XML(mybatisXml)','2xxvCrA','150oueKuc','mybatisXml','db-id','dbName'];a154_0x16d7=function(){return _0x2cb065;};return a154_0x16d7();}async function resolveSqlNameInput(_0x10aad1){const _0x556403=a154_0x48826e,_0x273fc4=_0x10aad1[_0x556403(0x190)](_0x556403(0x17b))['trim']();if(_0x273fc4)return _0x273fc4;if(_0x10aad1['nonInteractive'])throw CliErrors['flagMissing']('name',_0x556403(0x17c));return(await input({'message':'请输入\x20SQL\x20名称:','validate':_0x3d2bc5=>_0x3d2bc5['trim']()?!![]:_0x556403(0x19e)}))[_0x556403(0x17f)]();}async function resolveDbSelection(_0xd8b5a8){const _0x347eb8=a154_0x48826e,_0x53b962=resolveProvidedDbId(_0xd8b5a8);if(typeof _0x53b962==='number'&&Number[_0x347eb8(0x195)](_0x53b962)&&_0x53b962>0x0)return{'dbId':_0x53b962,'dbName':await getDbName(_0xd8b5a8[_0x347eb8(0x174)],_0x53b962)[_0x347eb8(0x1a2)](()=>undefined)};if(_0xd8b5a8[_0x347eb8(0x18c)])throw CliErrors[_0x347eb8(0x196)](_0x347eb8(0x171),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x34329e=await listDatabases(_0xd8b5a8[_0x347eb8(0x174)])[_0x347eb8(0x1a2)](()=>[]);if(_0x34329e[_0x347eb8(0x175)]===0x1)return{'dbId':_0x34329e[0x0]['dbId'],'dbName':_0x34329e[0x0][_0x347eb8(0x172)]};if(_0x34329e[_0x347eb8(0x175)]>0x1){const _0x48e863=await select({'message':_0x347eb8(0x1ab),'choices':[..._0x34329e['map'](_0x3fa1a0=>({'name':_0x3fa1a0[_0x347eb8(0x172)]+'\x20('+_0x3fa1a0[_0x347eb8(0x185)]+')','value':serializeDbSelection(_0x3fa1a0)})),{'name':'✎\x20手动输入\x20dbId','value':'__manual__'}]});if(_0x48e863!==_0x347eb8(0x17e))return deserializeDbSelection(_0x48e863);}const _0x323279=await input({'message':'请输入目标数据库\x20dbId:','validate':_0x125209=>{const _0x2aedf3=_0x347eb8,_0x347bef=_0x125209['trim']();if(!_0x347bef)return _0x2aedf3(0x180);const _0x8816f9=Number(_0x347bef);if(!Number[_0x2aedf3(0x17a)](_0x8816f9)||_0x8816f9<=0x0)return _0x2aedf3(0x18a);return!![];}});return{'dbId':Number(_0x323279[_0x347eb8(0x17f)]())};}async function resolveSqlModeInput(_0x39e985){const _0x2cf719=a154_0x48826e,_0x2713fd=_0x39e985[_0x2cf719(0x190)](_0x2cf719(0x192))[_0x2cf719(0x17f)]();if(_0x2713fd===_0x2cf719(0x1ad)||_0x2713fd==='mybatisXml')return _0x2713fd;if(_0x39e985[_0x2cf719(0x18c)])throw CliErrors[_0x2cf719(0x196)](_0x2cf719(0x192),_0x2cf719(0x183));return await select({'message':_0x2cf719(0x18e),'choices':[{'name':_0x2cf719(0x18d),'value':_0x2cf719(0x1ad),'description':_0x2cf719(0x197)},{'name':_0x2cf719(0x16d),'value':_0x2cf719(0x170),'description':'适合带动态标签的\x20MyBatis\x20XML\x20SQL'}]});}function serializeDbSelection(_0x47be0c){const _0x24b432=a154_0x48826e;return JSON[_0x24b432(0x173)]({'dbId':_0x47be0c['dbId'],'dbName':_0x47be0c['dbName']});}function deserializeDbSelection(_0x4c3a1d){const _0x1b0cee=a154_0x48826e;try{const _0x25e151=JSON[_0x1b0cee(0x188)](_0x4c3a1d);if(typeof _0x25e151[_0x1b0cee(0x185)]===_0x1b0cee(0x19c)&&Number['isFinite'](_0x25e151[_0x1b0cee(0x185)]))return{'dbId':_0x25e151[_0x1b0cee(0x185)],'dbName':_0x25e151['dbName']};}catch{}throw CliErrors[_0x1b0cee(0x19b)](_0x1b0cee(0x1a5)+_0x4c3a1d);}function resolveProvidedDbId(_0x2ea61e){const _0xb4f694=a154_0x48826e,_0x364c99=_0x2ea61e[_0xb4f694(0x176)](_0xb4f694(0x171));if(typeof _0x364c99===_0xb4f694(0x19c)&&Number['isFinite'](_0x364c99))return _0x364c99;return undefined;}
@@ -1 +1 @@
1
- function a153_0x7f70(){const _0x13f485=['trashedTo','projectRoot','SQL\x20lock\x20file\x20not\x20found.','appCode','POST','6965490okMPNX','sqlRootDir','delete','\x20(local\x20file\x20moved\x20to\x20trash)','validation','lockFilePath','trashDir','sqls','Deleted\x20','sqlcode','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','5298460DIlmfm','9HEYaCV','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','72JNBovQ','sqlRoot','lastSync','replace','fromEntries','remoteId','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','2645370UWsPSU','Would\x20delete\x20SQL\x20','length','toISOString','str','1003778oUlIZi','973686BuTjBt','1990377PsiefP','5180658YsPajP','filter'];a153_0x7f70=function(){return _0x13f485;};return a153_0x7f70();}const a153_0x4f5b78=a153_0x4798;(function(_0x52b148,_0x46fe83){const _0x660ae0=a153_0x4798,_0x3f9036=_0x52b148();while(!![]){try{const _0x5c5795=-parseInt(_0x660ae0(0x11f))/0x1+-parseInt(_0x660ae0(0x11e))/0x2*(-parseInt(_0x660ae0(0x110))/0x3)+parseInt(_0x660ae0(0x134))/0x4+parseInt(_0x660ae0(0x119))/0x5+parseInt(_0x660ae0(0x128))/0x6+-parseInt(_0x660ae0(0x121))/0x7+-parseInt(_0x660ae0(0x112))/0x8*(parseInt(_0x660ae0(0x120))/0x9);if(_0x5c5795===_0x46fe83)break;else _0x3f9036['push'](_0x3f9036['shift']());}catch(_0x2b804c){_0x3f9036['push'](_0x3f9036['shift']());}}}(a153_0x7f70,0xc73f2));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':'sql','command':a153_0x4f5b78(0x12a),'description':a153_0x4f5b78(0x118),'risk':'high-risk-write','flags':[SQLCODE_FLAG],async 'validate'(_0x52fdc4){const _0x3e25ff=a153_0x4f5b78,_0x5c0d91=loadSqlProjectConfig(_0x52fdc4[_0x3e25ff(0x126)]),_0x5043a=await readSqlLockFile(_0x5c0d91['lockFilePath']);if(!_0x5043a)throw CliErrors[_0x3e25ff(0x12c)](_0x3e25ff(0x132));},async 'dryRun'(_0x312b04){const _0x2ec200=a153_0x4f5b78,_0x3eab94=loadSqlProjectConfig(_0x312b04[_0x2ec200(0x126)]),_0x30bebb=await readSqlLockFile(_0x3eab94[_0x2ec200(0x12d)]);if(!_0x30bebb)throw CliErrors['validation'](_0x2ec200(0x132));const {appLock:_0x159ab5}=ensureSqlLockScope(_0x30bebb,_0x312b04[_0x2ec200(0x126)],_0x3eab94[_0x2ec200(0x113)],_0x2ec200(0x12a)),_0x39c1e7=_0x312b04[_0x2ec200(0x11d)](_0x2ec200(0x131)),_0x3fe166=_0x159ab5[_0x2ec200(0x12f)][_0x39c1e7];if(!_0x3fe166)throw CliErrors[_0x2ec200(0x12c)](_0x2ec200(0x133)+_0x39c1e7+'\x22.');return{'method':_0x2ec200(0x127),'url':'/smartapi/custom/deleteUserCustomSql','body':{'sqlCode':_0x39c1e7,'id':_0x3fe166[_0x2ec200(0x117)],'localPath':resolveLocalSqlFilePath(_0x3eab94,_0x39c1e7,_0x3fe166)},'description':_0x2ec200(0x11a)+_0x39c1e7+_0x2ec200(0x111)+_0x3eab94[_0x2ec200(0x12e)]};},async 'execute'(_0x365748){const _0x3991e6=a153_0x4f5b78,_0x24918e=loadSqlProjectConfig(_0x365748[_0x3991e6(0x126)]),_0x3268e3=await readSqlLockFile(_0x24918e['lockFilePath']);if(!_0x3268e3)throw CliErrors[_0x3991e6(0x12c)](_0x3991e6(0x125));const {lockData:_0x29d8ce,appLock:_0x4324f0}=ensureSqlLockScope(_0x3268e3,_0x365748[_0x3991e6(0x126)],_0x24918e['sqlRoot'],_0x3991e6(0x12a)),_0x2f2dca=_0x365748[_0x3991e6(0x11d)](_0x3991e6(0x131)),_0x299da7=_0x4324f0[_0x3991e6(0x12f)][_0x2f2dca];if(!_0x299da7)throw CliErrors[_0x3991e6(0x12c)](_0x3991e6(0x133)+_0x2f2dca+'\x22.');await deleteSqlQuery({'id':_0x299da7[_0x3991e6(0x117)],'sqlCode':_0x2f2dca}),_0x4324f0[_0x3991e6(0x12f)]=Object[_0x3991e6(0x116)](Object['entries'](_0x4324f0[_0x3991e6(0x12f)])[_0x3991e6(0x122)](([_0x4c4c26])=>_0x4c4c26!==_0x2f2dca)),_0x4324f0[_0x3991e6(0x114)]=new Date()[_0x3991e6(0x11c)](),await writeSqlLockFile(_0x24918e[_0x3991e6(0x12d)],_0x29d8ce);const _0x2b88d0=resolveLocalSqlFilePath(_0x24918e,_0x2f2dca,_0x299da7);let _0x5c946a;await fileExists(_0x2b88d0)&&(_0x5c946a=await moveToTrash(_0x24918e[_0x3991e6(0x124)],_0x24918e[_0x3991e6(0x12e)],_0x2b88d0),await cleanupEmptyDirectories(dirname(_0x2b88d0),_0x24918e[_0x3991e6(0x129)]));const _0x4b2cf6={'deleted':_0x2f2dca,'remoteId':_0x299da7['remoteId']};if(_0x5c946a)_0x4b2cf6[_0x3991e6(0x123)]=_0x5c946a;return{'ok':!![],'data':_0x4b2cf6,'message':_0x3991e6(0x130)+_0x2f2dca+(_0x5c946a?_0x3991e6(0x12b):'')};}};function a153_0x4798(_0x18b8b1,_0x4b8259){_0x18b8b1=_0x18b8b1-0x110;const _0x7f703a=a153_0x7f70();let _0x4798fa=_0x7f703a[_0x18b8b1];return _0x4798fa;}async function moveToTrash(_0x542dfd,_0x321a56,_0x184c2){const _0x490207=a153_0x4f5b78,_0x2a057f=new Date()[_0x490207(0x11c)]()[_0x490207(0x115)](/[:.]/g,'-'),_0x2729ea=relative(_0x542dfd,_0x184c2),_0x296cf1=join(_0x321a56,_0x2a057f,_0x2729ea);return await mkdir(dirname(_0x296cf1),{'recursive':!![]}),await rename(_0x184c2,_0x296cf1),_0x296cf1;}async function cleanupEmptyDirectories(_0xdeb603,_0x538875){const _0x9441d8=a153_0x4f5b78;let _0x49f072=resolve(_0xdeb603);const _0x269ae6=resolve(_0x538875);while(_0x49f072['startsWith'](''+_0x269ae6+sep)||_0x49f072===_0x269ae6){if(_0x49f072===_0x269ae6)return;try{const _0x206d6c=await readdir(_0x49f072);if(_0x206d6c[_0x9441d8(0x11b)]>0x0)return;await rmdir(_0x49f072);}catch{return;}_0x49f072=dirname(_0x49f072);}}
1
+ const a155_0x3b6913=a155_0x24e8;(function(_0x15589a,_0x1899ba){const _0x3f4ef6=a155_0x24e8,_0x3dfe8f=_0x15589a();while(!![]){try{const _0x3fe606=parseInt(_0x3f4ef6(0x125))/0x1*(-parseInt(_0x3f4ef6(0x11b))/0x2)+parseInt(_0x3f4ef6(0x10e))/0x3+-parseInt(_0x3f4ef6(0x11f))/0x4*(-parseInt(_0x3f4ef6(0x108))/0x5)+-parseInt(_0x3f4ef6(0x107))/0x6+-parseInt(_0x3f4ef6(0x10a))/0x7*(-parseInt(_0x3f4ef6(0x124))/0x8)+-parseInt(_0x3f4ef6(0x111))/0x9+-parseInt(_0x3f4ef6(0x11a))/0xa*(-parseInt(_0x3f4ef6(0x103))/0xb);if(_0x3fe606===_0x1899ba)break;else _0x3dfe8f['push'](_0x3dfe8f['shift']());}catch(_0xffc7d7){_0x3dfe8f['push'](_0x3dfe8f['shift']());}}}(a155_0x2056,0xeb130));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';function a155_0x2056(){const _0x4ec8a1=['toISOString','str','148056QGupUj','sqlRoot','sql','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','validation','79896NJUmfg','539950tdeofo','1838001XwonAd','projectRoot','high-risk-write','length','6810648hJnjol','10gjWwmq','sqlcode','427OYEWsO','trashDir','delete','replace','3867213ToyQxA','lastSync','startsWith','3840003OSVELV','appCode','trashedTo','lockFilePath','sqls','remoteId','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','POST','/smartapi/custom/deleteUserCustomSql','130FAEFgg','6TKNIYp','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22'];a155_0x2056=function(){return _0x4ec8a1;};return a155_0x2056();}import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';function a155_0x24e8(_0x168053,_0x54781f){_0x168053=_0x168053-0x103;const _0x205602=a155_0x2056();let _0x24e8d5=_0x205602[_0x168053];return _0x24e8d5;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a155_0x3b6913(0x121),'command':a155_0x3b6913(0x10c),'description':a155_0x3b6913(0x117),'risk':a155_0x3b6913(0x105),'flags':[SQLCODE_FLAG],async 'validate'(_0x232843){const _0x96122d=a155_0x3b6913,_0x55ddb9=loadSqlProjectConfig(_0x232843['appCode']),_0x16cf36=await readSqlLockFile(_0x55ddb9[_0x96122d(0x114)]);if(!_0x16cf36)throw CliErrors[_0x96122d(0x123)](_0x96122d(0x122));},async 'dryRun'(_0x2066aa){const _0x2a8d65=a155_0x3b6913,_0x1b55a3=loadSqlProjectConfig(_0x2066aa[_0x2a8d65(0x112)]),_0x490490=await readSqlLockFile(_0x1b55a3[_0x2a8d65(0x114)]);if(!_0x490490)throw CliErrors['validation'](_0x2a8d65(0x122));const {appLock:_0x1b6226}=ensureSqlLockScope(_0x490490,_0x2066aa[_0x2a8d65(0x112)],_0x1b55a3[_0x2a8d65(0x120)],_0x2a8d65(0x10c)),_0x261bd5=_0x2066aa[_0x2a8d65(0x11e)](_0x2a8d65(0x109)),_0x2eed13=_0x1b6226['sqls'][_0x261bd5];if(!_0x2eed13)throw CliErrors[_0x2a8d65(0x123)](_0x2a8d65(0x11c)+_0x261bd5+'\x22.');return{'method':_0x2a8d65(0x118),'url':_0x2a8d65(0x119),'body':{'sqlCode':_0x261bd5,'id':_0x2eed13[_0x2a8d65(0x116)],'localPath':resolveLocalSqlFilePath(_0x1b55a3,_0x261bd5,_0x2eed13)},'description':'Would\x20delete\x20SQL\x20'+_0x261bd5+'\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20'+_0x1b55a3[_0x2a8d65(0x10b)]};},async 'execute'(_0x36e494){const _0x1e7094=a155_0x3b6913,_0x46c163=loadSqlProjectConfig(_0x36e494[_0x1e7094(0x112)]),_0x5188fc=await readSqlLockFile(_0x46c163[_0x1e7094(0x114)]);if(!_0x5188fc)throw CliErrors[_0x1e7094(0x123)]('SQL\x20lock\x20file\x20not\x20found.');const {lockData:_0x4ac785,appLock:_0x1008d0}=ensureSqlLockScope(_0x5188fc,_0x36e494[_0x1e7094(0x112)],_0x46c163[_0x1e7094(0x120)],_0x1e7094(0x10c)),_0x12f6e4=_0x36e494['str'](_0x1e7094(0x109)),_0x340537=_0x1008d0[_0x1e7094(0x115)][_0x12f6e4];if(!_0x340537)throw CliErrors['validation'](_0x1e7094(0x11c)+_0x12f6e4+'\x22.');await deleteSqlQuery({'id':_0x340537[_0x1e7094(0x116)],'sqlCode':_0x12f6e4}),_0x1008d0['sqls']=Object['fromEntries'](Object['entries'](_0x1008d0['sqls'])['filter'](([_0x48ea0c])=>_0x48ea0c!==_0x12f6e4)),_0x1008d0[_0x1e7094(0x10f)]=new Date()[_0x1e7094(0x11d)](),await writeSqlLockFile(_0x46c163[_0x1e7094(0x114)],_0x4ac785);const _0x5f098e=resolveLocalSqlFilePath(_0x46c163,_0x12f6e4,_0x340537);let _0x900115;await fileExists(_0x5f098e)&&(_0x900115=await moveToTrash(_0x46c163[_0x1e7094(0x104)],_0x46c163[_0x1e7094(0x10b)],_0x5f098e),await cleanupEmptyDirectories(dirname(_0x5f098e),_0x46c163['sqlRootDir']));const _0x230379={'deleted':_0x12f6e4,'remoteId':_0x340537['remoteId']};if(_0x900115)_0x230379[_0x1e7094(0x113)]=_0x900115;return{'ok':!![],'data':_0x230379,'message':'Deleted\x20'+_0x12f6e4+(_0x900115?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};async function moveToTrash(_0x1c4899,_0x2e5ac1,_0x4d2409){const _0x2894ad=a155_0x3b6913,_0x584404=new Date()[_0x2894ad(0x11d)]()[_0x2894ad(0x10d)](/[:.]/g,'-'),_0x5c3737=relative(_0x1c4899,_0x4d2409),_0x5820c4=join(_0x2e5ac1,_0x584404,_0x5c3737);return await mkdir(dirname(_0x5820c4),{'recursive':!![]}),await rename(_0x4d2409,_0x5820c4),_0x5820c4;}async function cleanupEmptyDirectories(_0x443a32,_0x5b48ae){const _0x188724=a155_0x3b6913;let _0x162945=resolve(_0x443a32);const _0xd621bc=resolve(_0x5b48ae);while(_0x162945[_0x188724(0x110)](''+_0xd621bc+sep)||_0x162945===_0xd621bc){if(_0x162945===_0xd621bc)return;try{const _0x4e19ae=await readdir(_0x162945);if(_0x4e19ae[_0x188724(0x106)]>0x0)return;await rmdir(_0x162945);}catch{return;}_0x162945=dirname(_0x162945);}}