@lovrabet/rabetbase-cli 2.3.8-beta.1 → 2.3.8

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 (245) 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 -1
  79. package/lib/commands/db/analyze-batch-plan.js +1 -1
  80. package/lib/commands/db/analyze-cancel.js +1 -1
  81. package/lib/commands/db/analyze-start.js +1 -1
  82. package/lib/commands/db/analyze-status.js +1 -1
  83. package/lib/commands/db/create.js +1 -1
  84. package/lib/commands/db/delete.js +1 -1
  85. package/lib/commands/db/detail.js +1 -1
  86. package/lib/commands/db/diff.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/notification/config-list.js +1 -1
  115. package/lib/commands/notification/index.js +1 -1
  116. package/lib/commands/page/generate-start.js +1 -1
  117. package/lib/commands/page/generate-status.js +1 -1
  118. package/lib/commands/page/index.js +1 -1
  119. package/lib/commands/page/pull.js +1 -1
  120. package/lib/commands/page/push.js +1 -1
  121. package/lib/commands/page/relation-audit.js +1 -1
  122. package/lib/commands/page/shared.js +1 -1
  123. package/lib/commands/page/standard-page-status.js +1 -1
  124. package/lib/commands/page/sync.js +1 -1
  125. package/lib/commands/permit/index.js +1 -1
  126. package/lib/commands/permit/page-get.js +1 -1
  127. package/lib/commands/permit/page-set.js +1 -1
  128. package/lib/commands/permit/role-apis-set.js +1 -1
  129. package/lib/commands/permit/role-menus-set.js +1 -1
  130. package/lib/commands/permit/role-menus.js +1 -1
  131. package/lib/commands/permit/shared.js +1 -1
  132. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  133. package/lib/commands/project/create/format-elapsed.js +1 -1
  134. package/lib/commands/project/create/main.js +1 -1
  135. package/lib/commands/project/create/non-interactive.js +1 -1
  136. package/lib/commands/project/create/project-template-path.js +1 -1
  137. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  138. package/lib/commands/project/create/use-format-code.js +1 -1
  139. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  140. package/lib/commands/project/index.js +1 -1
  141. package/lib/commands/project/init.js +1 -1
  142. package/lib/commands/project/upgrade.js +1 -1
  143. package/lib/commands/registry.js +1 -1
  144. package/lib/commands/role/create.js +1 -1
  145. package/lib/commands/role/delete.js +1 -1
  146. package/lib/commands/role/detail.js +1 -1
  147. package/lib/commands/role/index.js +1 -1
  148. package/lib/commands/role/list.js +1 -1
  149. package/lib/commands/role/shared.js +1 -1
  150. package/lib/commands/role/update.js +1 -1
  151. package/lib/commands/role/user-add.js +1 -1
  152. package/lib/commands/role/user-remove.js +1 -1
  153. package/lib/commands/role/user-resolve.js +1 -1
  154. package/lib/commands/run/index.js +1 -1
  155. package/lib/commands/schema.js +1 -1
  156. package/lib/commands/sql/create.js +1 -1
  157. package/lib/commands/sql/delete.js +1 -1
  158. package/lib/commands/sql/detail.js +1 -1
  159. package/lib/commands/sql/exec.js +1 -1
  160. package/lib/commands/sql/index.js +1 -1
  161. package/lib/commands/sql/list.js +1 -1
  162. package/lib/commands/sql/pull.js +1 -1
  163. package/lib/commands/sql/push.js +1 -1
  164. package/lib/commands/sql/save.js +1 -1
  165. package/lib/commands/sql/shared.js +1 -1
  166. package/lib/commands/sql/status.js +1 -1
  167. package/lib/commands/sql/validate.js +1 -1
  168. package/lib/commands/workspace/add.js +1 -1
  169. package/lib/commands/workspace/index.js +1 -1
  170. package/lib/commands/workspace/remove.js +1 -1
  171. package/lib/config/schema.js +1 -1
  172. package/lib/constant/cdn.js +1 -1
  173. package/lib/constant/cli.js +1 -1
  174. package/lib/constant/defaults.js +1 -1
  175. package/lib/constant/domain.js +1 -1
  176. package/lib/constant/env.js +1 -1
  177. package/lib/constant/output.js +1 -1
  178. package/lib/constant/paths.js +1 -1
  179. package/lib/constant/risk.js +1 -1
  180. package/lib/context/app-resolver.js +1 -1
  181. package/lib/context/auth-resolver.js +1 -1
  182. package/lib/context/config-loader.js +1 -1
  183. package/lib/context.js +1 -1
  184. package/lib/core/alias-resolver.js +1 -1
  185. package/lib/core/api-client.js +1 -1
  186. package/lib/core/bff/config.js +1 -1
  187. package/lib/core/bff/file-system.js +1 -1
  188. package/lib/core/bff/hash.js +1 -1
  189. package/lib/core/bff/lock.js +1 -1
  190. package/lib/core/bff/utils.js +1 -1
  191. package/lib/core/db-resolver.js +1 -1
  192. package/lib/core/page/file-system.js +1 -1
  193. package/lib/core/page/hash.js +1 -1
  194. package/lib/core/page/lock.js +1 -1
  195. package/lib/core/sql-sync/config.js +1 -1
  196. package/lib/core/sql-sync/file-system.js +1 -1
  197. package/lib/core/sql-sync/hash.js +1 -1
  198. package/lib/core/sql-sync/lock.js +1 -1
  199. package/lib/core/sql-sync/utils.js +1 -1
  200. package/lib/core/sql-validator.js +1 -1
  201. package/lib/errors.js +1 -1
  202. package/lib/framework/build-all-flags.js +1 -1
  203. package/lib/framework/flags.js +1 -1
  204. package/lib/framework/help.js +1 -1
  205. package/lib/framework/index.js +1 -1
  206. package/lib/framework/output.js +1 -1
  207. package/lib/framework/response.js +1 -1
  208. package/lib/framework/runner-alias.js +1 -1
  209. package/lib/framework/runner.js +1 -1
  210. package/lib/framework/schema-export.js +1 -1
  211. package/lib/framework/types.js +1 -1
  212. package/lib/generated/build-info.js +1 -1
  213. package/lib/help.js +1 -1
  214. package/lib/skills/main.js +1 -1
  215. package/lib/skills/npx-skills-add.js +1 -1
  216. package/lib/telemetry/cli-command-trace.js +1 -1
  217. package/lib/telemetry/cli-help-trace.js +1 -1
  218. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  219. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  220. package/lib/telemetry/send-cli-trace-log.js +1 -1
  221. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  222. package/lib/utils/ai_config.js +1 -1
  223. package/lib/utils/apply-jq-filter.js +1 -1
  224. package/lib/utils/cdn-config.js +1 -1
  225. package/lib/utils/check-sdk-version.js +1 -1
  226. package/lib/utils/cli-version-check.js +1 -1
  227. package/lib/utils/cli-version-policy.js +1 -1
  228. package/lib/utils/config.js +1 -1
  229. package/lib/utils/copy-directory.js +1 -1
  230. package/lib/utils/entity-with-id.js +1 -1
  231. package/lib/utils/file-utils.js +1 -1
  232. package/lib/utils/guides-cdn.js +1 -1
  233. package/lib/utils/http-client.js +1 -1
  234. package/lib/utils/is-non-interactive.js +1 -1
  235. package/lib/utils/logger.js +1 -1
  236. package/lib/utils/params.js +1 -1
  237. package/lib/utils/platform.js +1 -1
  238. package/lib/utils/rules-cdn.js +1 -1
  239. package/lib/utils/sleep.js +1 -1
  240. package/lib/utils/template-replacer.js +1 -1
  241. package/lib/utils/update-notice.js +1 -1
  242. package/lib/utils/version.js +1 -1
  243. package/lib/utils/with-active-cookie.js +1 -1
  244. package/lib/utils/write-cli-side-channel.js +1 -1
  245. package/package.json +1 -1
@@ -1 +1 @@
1
- const a143_0x47f9d1=a143_0x53e0;(function(_0xd1d2d9,_0x4bf82){const _0x13f361=a143_0x53e0,_0x4bc8f8=_0xd1d2d9();while(!![]){try{const _0x5a636b=parseInt(_0x13f361(0x1bd))/0x1+-parseInt(_0x13f361(0x1ac))/0x2+-parseInt(_0x13f361(0x190))/0x3+-parseInt(_0x13f361(0x1b0))/0x4*(parseInt(_0x13f361(0x19d))/0x5)+parseInt(_0x13f361(0x191))/0x6*(parseInt(_0x13f361(0x17d))/0x7)+parseInt(_0x13f361(0x1ab))/0x8+parseInt(_0x13f361(0x1a5))/0x9;if(_0x5a636b===_0x4bf82)break;else _0x4bc8f8['push'](_0x4bc8f8['shift']());}catch(_0x346fd9){_0x4bc8f8['push'](_0x4bc8f8['shift']());}}}(a143_0x5eeb,0xa3fe6));import{apiDefinitions}from'../commands/api/index.js';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';function a143_0x5eeb(){const _0x509a09=['auth','Notification\x20Configuration','hidden','set','description','app','`rabetbase\x20skills`\x20has\x20been\x20removed.','4013808oLSCft','1230276CRPmwI','create','risk','app\x20use','\x20\x20[write]','Instant\x20API','build','Platform\x20Issue','Configuration','isSingleCommand','Workspace','command','383010jlgrnh','install','File','Roles','API\x20Development','remote','service','skill\x20','12336309vCorTr','has','run','Smart\x20List\x20Pages','Runtime\x20App\x20Config\x20Management','defaultCommand','2470872QBuYLQ','377664qtyspU','values','Use\x20`rabetbase\x20cli-skill\x20install`\x20to\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill.\x20To\x20install\x20business\x20Skills,\x20use\x20`lovrabet\x20skill\x20install`.','skill','36uxiflW','Authentication','SQL\x20Queries','map','use','`rabetbase\x20app\x20remote`\x20has\x20been\x20removed.','skills','\x20\x20[high-risk-write]','Project','from','read','start','commands','1003298PnBZpv','login','get','App\x20Management','7lodAWv','Database\x20Connections','show','Logs','`\x20has\x20been\x20removed.','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20instead.','Run\x20Scripts','wildcardDef','Use\x20`rabetbase\x20workspace\x20use\x20--app\x20<name>`\x20instead.','`rabetbase\x20app\x20use`\x20has\x20been\x20removed.','preview','push'];a143_0x5eeb=function(){return _0x509a09;};return a143_0x5eeb();}import{appConfigDefinitions}from'../commands/app-config/index.js';import{notificationDefinitions}from'../commands/notification/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(_0x585066){const _0x1f779a=a143_0x53e0;for(const _0x271961 of _0x585066){definitions[_0x1f779a(0x18c)](_0x271961['service']+':'+_0x271961[_0x1f779a(0x19c)],_0x271961);let _0x8a9ef3=serviceGroups[_0x1f779a(0x1bf)](_0x271961[_0x1f779a(0x1a3)]);!_0x8a9ef3&&(_0x8a9ef3=[],serviceGroups['set'](_0x271961[_0x1f779a(0x1a3)],_0x8a9ef3)),_0x8a9ef3['push'](_0x271961);}}function registerDeclarativeService(_0x40cd70,_0x1b2cf9,_0x9ed369){const _0x11faab=a143_0x53e0;registerDefinitions(_0x1b2cf9);_0x9ed369?.['wildcardDef']&&registerDefinitions([_0x9ed369[_0x11faab(0x184)]]);const _0x366eea=_0x404bfd=>_0x404bfd===_0x11faab(0x1ba)?'':_0x404bfd==='write'?_0x11faab(0x195):_0x11faab(0x1b7),_0x2fef5c={'service':_0x1b2cf9[0x0][_0x11faab(0x1a3)],'label':_0x40cd70,'commands':_0x1b2cf9['filter'](_0x1e8031=>!_0x1e8031[_0x11faab(0x18b)])[_0x11faab(0x1b3)](_0x19bb8d=>({'command':_0x19bb8d[_0x11faab(0x19c)],'description':_0x19bb8d[_0x11faab(0x18d)],'tag':_0x366eea(_0x19bb8d[_0x11faab(0x193)])})),'declarative':!![],'defaultCommand':_0x9ed369?.[_0x11faab(0x1aa)]??(_0x9ed369?.['isSingleCommand']?_0x1b2cf9[0x0][_0x11faab(0x19c)]:undefined),'wildcardDef':_0x9ed369?.[_0x11faab(0x184)],'isSingleCommand':_0x9ed369?.[_0x11faab(0x19a)]};serviceRegistry[_0x11faab(0x188)](_0x2fef5c),serviceByName[_0x11faab(0x18c)](_0x2fef5c['service'],_0x2fef5c);}registerDeclarativeService('Quick\x20Start',initDefinitions,{'defaultCommand':'run','isSingleCommand':!![]}),registerDeclarativeService(a143_0x47f9d1(0x1b8),projectDefinitions),registerDeclarativeService(a143_0x47f9d1(0x19b),workspaceDefinitions),registerDeclarativeService(a143_0x47f9d1(0x17c),appDefinitions),registerDeclarativeService(a143_0x47f9d1(0x1b1),authDefinitions,{'defaultCommand':a143_0x47f9d1(0x1be)}),registerDeclarativeService('Dataset\x20&\x20Operations',datasetDefinitions),registerDeclarativeService(a143_0x47f9d1(0x1a8),pageDefinitions),registerDeclarativeService(a143_0x47f9d1(0x1a1),apiDefinitions),registerDeclarativeService(a143_0x47f9d1(0x196),dataDefinitions),registerDeclarativeService('BFF\x20Scripts',bffDefinitions),registerDeclarativeService(a143_0x47f9d1(0x18a),notificationDefinitions),registerDeclarativeService(a143_0x47f9d1(0x1b2),sqlDefinitions),registerDeclarativeService(a143_0x47f9d1(0x17e),dbDefinitions),registerDeclarativeService('Menu',menuDefinitions),registerDeclarativeService(a143_0x47f9d1(0x1a0),roleDefinitions),registerDeclarativeService('Permissions',permitDefinitions),registerDeclarativeService(a143_0x47f9d1(0x1a9),appConfigDefinitions),registerDeclarativeService(a143_0x47f9d1(0x198),issueDefinitions),registerDeclarativeService(a143_0x47f9d1(0x19f),fileDefinitions),registerDeclarativeService('Code\x20Generation',codegenDefinitions),registerDeclarativeService(a143_0x47f9d1(0x199),configDefinitions),registerDeclarativeService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService('Schema',[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService('Self\x20Update',[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService('CLI\x20Built-in\x20Skill',cliSkillDefinitions,{'defaultCommand':a143_0x47f9d1(0x19e)}),registerDeclarativeService(a143_0x47f9d1(0x180),logsDefinitions,{'defaultCommand':a143_0x47f9d1(0x17f)}),registerDeclarativeService(a143_0x47f9d1(0x183),[runDefinition],{'wildcardDef':runDefinition});function a143_0x53e0(_0x2887e4,_0x13d79d){_0x2887e4=_0x2887e4-0x17c;const _0x5eeb92=a143_0x5eeb();let _0x53e0c2=_0x5eeb92[_0x2887e4];return _0x53e0c2;}{const last=serviceRegistry[serviceRegistry['length']-0x1];last[a143_0x47f9d1(0x1bc)]=[{'command':'<script>','description':'Run\x20any\x20package.json\x20script','tag':''}];}export const deprecatedAliases={'create':{'service':'project','command':a143_0x47f9d1(0x192)},'start':{'service':a143_0x47f9d1(0x1a7),'command':a143_0x47f9d1(0x1bb)},'build':{'service':a143_0x47f9d1(0x1a7),'command':a143_0x47f9d1(0x197)},'preview':{'service':a143_0x47f9d1(0x1a7),'command':a143_0x47f9d1(0x187)},'logout':{'service':a143_0x47f9d1(0x189),'command':'logout'}};const CLI_SKILL_INSTALL_REMOVED_HINT=a143_0x47f9d1(0x1ae),APP_REMOTE_REMOVED_HINT=a143_0x47f9d1(0x182),APP_USE_REMOVED_HINT=a143_0x47f9d1(0x185);export function resolveRemovedCommand(_0x3b794b,_0xc405ae){const _0x4d4253=a143_0x47f9d1;if(_0x3b794b===_0x4d4253(0x1af)){const _0x272acd=_0xc405ae?_0x4d4253(0x1a4)+_0xc405ae:'skill';return{'command':_0x272acd,'message':'`rabetbase\x20'+_0x272acd+_0x4d4253(0x181),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};}if(_0x3b794b===_0x4d4253(0x1b6))return{'command':'skills','message':_0x4d4253(0x18f),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};if(_0x3b794b==='app'&&_0xc405ae===_0x4d4253(0x1a2))return{'command':'app\x20remote','message':_0x4d4253(0x1b5),'hint':APP_REMOTE_REMOVED_HINT};if(_0x3b794b===_0x4d4253(0x18e)&&_0xc405ae===_0x4d4253(0x1b4))return{'command':_0x4d4253(0x194),'message':_0x4d4253(0x186),'hint':APP_USE_REMOVED_HINT};return undefined;}export const deprecatedSubcommands={'bff':{'new':a143_0x47f9d1(0x192)},'sql':{'new':a143_0x47f9d1(0x192)}};export function resolveDeprecatedSubcommand(_0xa048a8,_0x104c55){return deprecatedSubcommands[_0xa048a8]?.[_0x104c55];}export function findDefinition(_0x3c6780,_0x2bbc3c){const _0x442b7a=a143_0x47f9d1;return definitions[_0x442b7a(0x1bf)](_0x3c6780+':'+_0x2bbc3c);}export function isKnownService(_0x3e29af){const _0x2c2eb3=a143_0x47f9d1;return serviceByName[_0x2c2eb3(0x1a6)](_0x3e29af);}export function isDeclarativeService(_0x332da1){const _0x16ee10=a143_0x47f9d1;return serviceGroups[_0x16ee10(0x1a6)](_0x332da1)||serviceByName[_0x16ee10(0x1bf)](_0x332da1)?.[_0x16ee10(0x184)]!==undefined;}export function getServiceEntry(_0x42c525){const _0x304875=a143_0x47f9d1;return serviceByName[_0x304875(0x1bf)](_0x42c525);}export function getLegacyHandler(_0x3e4328,_0x56a14c){return undefined;}export function getAllDefinitions(){const _0x1e5b3a=a143_0x47f9d1;return Array[_0x1e5b3a(0x1b9)](definitions[_0x1e5b3a(0x1ad)]());}
1
+ const a143_0x34b905=a143_0x1cbc;(function(_0x45ec5c,_0x41ce5c){const _0x3dbcbf=a143_0x1cbc,_0x24bf44=_0x45ec5c();while(!![]){try{const _0x156ddd=-parseInt(_0x3dbcbf(0x6b))/0x1*(-parseInt(_0x3dbcbf(0x79))/0x2)+-parseInt(_0x3dbcbf(0x85))/0x3*(-parseInt(_0x3dbcbf(0x99))/0x4)+-parseInt(_0x3dbcbf(0xb3))/0x5*(-parseInt(_0x3dbcbf(0xb4))/0x6)+-parseInt(_0x3dbcbf(0x7e))/0x7*(parseInt(_0x3dbcbf(0x78))/0x8)+parseInt(_0x3dbcbf(0x8f))/0x9+-parseInt(_0x3dbcbf(0x73))/0xa*(-parseInt(_0x3dbcbf(0x7b))/0xb)+-parseInt(_0x3dbcbf(0x70))/0xc;if(_0x156ddd===_0x41ce5c)break;else _0x24bf44['push'](_0x24bf44['shift']());}catch(_0x52108a){_0x24bf44['push'](_0x24bf44['shift']());}}}(a143_0x4bdd,0xce43e));import{apiDefinitions}from'../commands/api/index.js';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{notificationDefinitions}from'../commands/notification/index.js';import{workspaceDefinitions}from'../commands/workspace/index.js';function a143_0x4bdd(){const _0x484d27=['Self\x20Update','Notification\x20Configuration','CLI\x20Built-in\x20Skill','risk','write','5635998XWHRYF','`rabetbase\x20','wildcardDef','App\x20Management','Run\x20any\x20package.json\x20script','set','Platform\x20Issue','Schema','Workspace','`rabetbase\x20skills`\x20has\x20been\x20removed.','819176lILaje','Run\x20Scripts','service','install','Authentication','\x20\x20[high-risk-write]','use','`rabetbase\x20app\x20remote`\x20has\x20been\x20removed.','skill','command','remote','Roles','`\x20has\x20been\x20removed.','project','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20instead.','from','start','read','app\x20use','preview','Quick\x20Start','show','Diagnostics','get','skills','Code\x20Generation','6141160LcGrUw','6BaEzHI','170914eIMFGf','defaultCommand','auth','Permissions','hidden','27782880mzjxYv','has','login','11184850pvPHZk','BFF\x20Scripts','isSingleCommand','build','app','155656pAdrtR','4uRJtHH','Runtime\x20App\x20Config\x20Management','11IugtCD','run','app\x20remote','203HpTQPl','filter','\x20\x20[write]','create','Configuration','logout','SQL\x20Queries','6HvmLmj','File','Dataset\x20&\x20Operations','Smart\x20List\x20Pages','push'];a143_0x4bdd=function(){return _0x484d27;};return a143_0x4bdd();}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';function a143_0x1cbc(_0x9526d,_0x56535f){_0x9526d=_0x9526d-0x6b;const _0x4bdd39=a143_0x4bdd();let _0x1cbc8a=_0x4bdd39[_0x9526d];return _0x1cbc8a;}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(_0x27b4b8){const _0x2cedc0=a143_0x1cbc;for(const _0x36ad95 of _0x27b4b8){definitions[_0x2cedc0(0x94)](_0x36ad95[_0x2cedc0(0x9b)]+':'+_0x36ad95[_0x2cedc0(0xa2)],_0x36ad95);let _0x3135be=serviceGroups[_0x2cedc0(0xb0)](_0x36ad95[_0x2cedc0(0x9b)]);!_0x3135be&&(_0x3135be=[],serviceGroups['set'](_0x36ad95['service'],_0x3135be)),_0x3135be[_0x2cedc0(0x89)](_0x36ad95);}}function registerDeclarativeService(_0x48d0ee,_0x20fdd0,_0x1c4f02){const _0x1e4dba=a143_0x1cbc;registerDefinitions(_0x20fdd0);_0x1c4f02?.[_0x1e4dba(0x91)]&&registerDefinitions([_0x1c4f02[_0x1e4dba(0x91)]]);const _0x2b8b8c=_0x2068d1=>_0x2068d1===_0x1e4dba(0xaa)?'':_0x2068d1===_0x1e4dba(0x8e)?_0x1e4dba(0x80):_0x1e4dba(0x9e),_0x3c8cc3={'service':_0x20fdd0[0x0][_0x1e4dba(0x9b)],'label':_0x48d0ee,'commands':_0x20fdd0[_0x1e4dba(0x7f)](_0x43eba6=>!_0x43eba6[_0x1e4dba(0x6f)])['map'](_0x4b1cbe=>({'command':_0x4b1cbe[_0x1e4dba(0xa2)],'description':_0x4b1cbe['description'],'tag':_0x2b8b8c(_0x4b1cbe[_0x1e4dba(0x8d)])})),'declarative':!![],'defaultCommand':_0x1c4f02?.[_0x1e4dba(0x6c)]??(_0x1c4f02?.[_0x1e4dba(0x75)]?_0x20fdd0[0x0][_0x1e4dba(0xa2)]:undefined),'wildcardDef':_0x1c4f02?.[_0x1e4dba(0x91)],'isSingleCommand':_0x1c4f02?.['isSingleCommand']};serviceRegistry[_0x1e4dba(0x89)](_0x3c8cc3),serviceByName[_0x1e4dba(0x94)](_0x3c8cc3['service'],_0x3c8cc3);}registerDeclarativeService(a143_0x34b905(0xad),initDefinitions,{'defaultCommand':a143_0x34b905(0x7c),'isSingleCommand':!![]}),registerDeclarativeService('Project',projectDefinitions),registerDeclarativeService(a143_0x34b905(0x97),workspaceDefinitions),registerDeclarativeService(a143_0x34b905(0x92),appDefinitions),registerDeclarativeService(a143_0x34b905(0x9d),authDefinitions,{'defaultCommand':a143_0x34b905(0x72)}),registerDeclarativeService(a143_0x34b905(0x87),datasetDefinitions),registerDeclarativeService(a143_0x34b905(0x88),pageDefinitions),registerDeclarativeService('API\x20Development',apiDefinitions),registerDeclarativeService('Instant\x20API',dataDefinitions),registerDeclarativeService(a143_0x34b905(0x74),bffDefinitions),registerDeclarativeService(a143_0x34b905(0x8b),notificationDefinitions),registerDeclarativeService(a143_0x34b905(0x84),sqlDefinitions),registerDeclarativeService('Database\x20Connections',dbDefinitions),registerDeclarativeService('Menu',menuDefinitions),registerDeclarativeService(a143_0x34b905(0xa4),roleDefinitions),registerDeclarativeService(a143_0x34b905(0x6e),permitDefinitions),registerDeclarativeService(a143_0x34b905(0x7a),appConfigDefinitions),registerDeclarativeService(a143_0x34b905(0x95),issueDefinitions),registerDeclarativeService(a143_0x34b905(0x86),fileDefinitions),registerDeclarativeService(a143_0x34b905(0xb2),codegenDefinitions),registerDeclarativeService(a143_0x34b905(0x82),configDefinitions),registerDeclarativeService(a143_0x34b905(0xaf),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a143_0x34b905(0x96),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a143_0x34b905(0x8a),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a143_0x34b905(0x8c),cliSkillDefinitions,{'defaultCommand':a143_0x34b905(0x9c)}),registerDeclarativeService('Logs',logsDefinitions,{'defaultCommand':a143_0x34b905(0xae)}),registerDeclarativeService(a143_0x34b905(0x9a),[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry['length']-0x1];last['commands']=[{'command':'<script>','description':a143_0x34b905(0x93),'tag':''}];}export const deprecatedAliases={'create':{'service':a143_0x34b905(0xa6),'command':a143_0x34b905(0x81)},'start':{'service':a143_0x34b905(0x7c),'command':a143_0x34b905(0xa9)},'build':{'service':a143_0x34b905(0x7c),'command':a143_0x34b905(0x76)},'preview':{'service':a143_0x34b905(0x7c),'command':a143_0x34b905(0xac)},'logout':{'service':a143_0x34b905(0x6d),'command':a143_0x34b905(0x83)}};const CLI_SKILL_INSTALL_REMOVED_HINT='Use\x20`rabetbase\x20cli-skill\x20install`\x20to\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill.\x20To\x20install\x20business\x20Skills,\x20use\x20`lovrabet\x20skill\x20install`.',APP_REMOTE_REMOVED_HINT=a143_0x34b905(0xa7),APP_USE_REMOVED_HINT='Use\x20`rabetbase\x20workspace\x20use\x20--app\x20<name>`\x20instead.';export function resolveRemovedCommand(_0x3e4f87,_0xb80bcf){const _0x10b21d=a143_0x34b905;if(_0x3e4f87===_0x10b21d(0xa1)){const _0x30d09e=_0xb80bcf?'skill\x20'+_0xb80bcf:_0x10b21d(0xa1);return{'command':_0x30d09e,'message':_0x10b21d(0x90)+_0x30d09e+_0x10b21d(0xa5),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};}if(_0x3e4f87===_0x10b21d(0xb1))return{'command':_0x10b21d(0xb1),'message':_0x10b21d(0x98),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};if(_0x3e4f87===_0x10b21d(0x77)&&_0xb80bcf===_0x10b21d(0xa3))return{'command':_0x10b21d(0x7d),'message':_0x10b21d(0xa0),'hint':APP_REMOTE_REMOVED_HINT};if(_0x3e4f87===_0x10b21d(0x77)&&_0xb80bcf===_0x10b21d(0x9f))return{'command':_0x10b21d(0xab),'message':'`rabetbase\x20app\x20use`\x20has\x20been\x20removed.','hint':APP_USE_REMOVED_HINT};return undefined;}export const deprecatedSubcommands={'bff':{'new':a143_0x34b905(0x81)},'sql':{'new':a143_0x34b905(0x81)}};export function resolveDeprecatedSubcommand(_0x38edb1,_0x5ab224){return deprecatedSubcommands[_0x38edb1]?.[_0x5ab224];}export function findDefinition(_0x9075ec,_0x42a297){const _0x245fed=a143_0x34b905;return definitions[_0x245fed(0xb0)](_0x9075ec+':'+_0x42a297);}export function isKnownService(_0x30a42d){const _0x305804=a143_0x34b905;return serviceByName[_0x305804(0x71)](_0x30a42d);}export function isDeclarativeService(_0x42ab80){const _0x5f1856=a143_0x34b905;return serviceGroups[_0x5f1856(0x71)](_0x42ab80)||serviceByName[_0x5f1856(0xb0)](_0x42ab80)?.[_0x5f1856(0x91)]!==undefined;}export function getServiceEntry(_0x541fdb){return serviceByName['get'](_0x541fdb);}export function getLegacyHandler(_0x152189,_0x1a8a14){return undefined;}export function getAllDefinitions(){const _0x2afb87=a143_0x34b905;return Array[_0x2afb87(0xa8)](definitions['values']());}
@@ -1 +1 @@
1
- function a144_0x314b(){const _0x2452ca=['2853446vGhbub','Created\x20role\x20','378IARUZk','remark','4EamoWy','flagMissing','str','create','133LKeaEo','Pass\x20--name\x20<roleName>.','44PGMenb','3664510WhijVT','length','POST','appCode','\x20(id=','CUSTOM','97590lbMWxM','role','trim','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','140865SjouEc','roleName','name','write','349736dUxvrz','7476210YrnSeE','1924983nFTBmj'];a144_0x314b=function(){return _0x2452ca;};return a144_0x314b();}const a144_0x549b80=a144_0x1147;(function(_0x231962,_0x487875){const _0x398c5d=a144_0x1147,_0x5eb6ec=_0x231962();while(!![]){try{const _0x512e0e=parseInt(_0x398c5d(0x11e))/0x1+-parseInt(_0x398c5d(0x129))/0x2+parseInt(_0x398c5d(0x128))/0x3*(parseInt(_0x398c5d(0x12d))/0x4)+-parseInt(_0x398c5d(0x122))/0x5*(-parseInt(_0x398c5d(0x12b))/0x6)+-parseInt(_0x398c5d(0x115))/0x7*(parseInt(_0x398c5d(0x126))/0x8)+-parseInt(_0x398c5d(0x127))/0x9+-parseInt(_0x398c5d(0x118))/0xa*(-parseInt(_0x398c5d(0x117))/0xb);if(_0x512e0e===_0x487875)break;else _0x5eb6ec['push'](_0x5eb6ec['shift']());}catch(_0x50be51){_0x5eb6ec['push'](_0x5eb6ec['shift']());}}}(a144_0x314b,0xd9c0e));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';import{NAME_FLAG,REMARK_FLAG,projectRole}from'../../commands/role/shared.js';const CREATE_PATH='/smartapi/permit/role/create';function readName(_0x567465){const _0x4ff8d8=a144_0x1147,_0x559fee=_0x567465[_0x4ff8d8(0x113)](_0x4ff8d8(0x124))[_0x4ff8d8(0x120)]();if(!_0x559fee)throw CliErrors[_0x4ff8d8(0x112)](_0x4ff8d8(0x124),_0x4ff8d8(0x116));if(_0x559fee[_0x4ff8d8(0x119)]>0x40)throw CliErrors['validation'](_0x4ff8d8(0x121));return _0x559fee;}function a144_0x1147(_0x17751b,_0xf4d4dc){_0x17751b=_0x17751b-0x112;const _0x314b7f=a144_0x314b();let _0x1147d=_0x314b7f[_0x17751b];return _0x1147d;}export const roleCreate={'service':a144_0x549b80(0x11f),'command':a144_0x549b80(0x114),'description':'Create\x20a\x20CUSTOM\x20user\x20group\x20(role)','risk':a144_0x549b80(0x125),'flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0xdb1e71){readName(_0xdb1e71);},async 'dryRun'(_0x25cc4c){const _0x54cb57=a144_0x549b80,_0x17d4e3=readName(_0x25cc4c),_0x5cb536=_0x25cc4c[_0x54cb57(0x113)]('remark')['trim']()||undefined;return asDryRunResult({'operation':_0x54cb57(0x114),'selector':{'appCode':_0x25cc4c[_0x54cb57(0x11b)],'roleName':_0x17d4e3},'before':null,'after':{'roleName':_0x17d4e3,'roleType':_0x54cb57(0x11d),'remark':_0x5cb536},'dryRun':!![],'backend':{'method':_0x54cb57(0x11a),'path':CREATE_PATH},'warnings':[]},{'method':_0x54cb57(0x11a),'url':CREATE_PATH});},async 'execute'(_0x2faf72){const _0x509035=a144_0x549b80,_0x40befd=readName(_0x2faf72),_0x396e61=_0x2faf72['str'](_0x509035(0x12c))['trim']()||undefined,_0x48d069=await createAppRole({'appCode':_0x2faf72[_0x509035(0x11b)],'roleName':_0x40befd,..._0x396e61?{'remark':_0x396e61}:{}});return{'ok':!![],'data':{'operation':'create','selector':{'appCode':_0x2faf72['appCode'],'roleId':_0x48d069['id'],'roleName':_0x40befd},'before':null,'after':projectRole(_0x48d069),'dryRun':![],'backend':{'method':_0x509035(0x11a),'path':CREATE_PATH},'warnings':[]},'message':_0x509035(0x12a)+_0x48d069[_0x509035(0x123)]+_0x509035(0x11c)+_0x48d069['id']+')'};}};
1
+ function a144_0x5f9b(){const _0x1608c4=['36819ITCoIo','POST','1340102bnYwUX','30zNhQvT','1704364HkxZbi','CUSTOM','3WdBLOL','flagMissing','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','remark','trim','length','5636835dUaUBk','353881tCnCPZ','12PKvUtd','str','7VNjHhO','roleName','appCode','2166544JlnFDC','name','/smartapi/permit/role/create','create','1572430CqGhra','Created\x20role\x20','role','Create\x20a\x20CUSTOM\x20user\x20group\x20(role)'];a144_0x5f9b=function(){return _0x1608c4;};return a144_0x5f9b();}const a144_0x4a4d51=a144_0x3e37;(function(_0x389dde,_0x3efaac){const _0x73fdea=a144_0x3e37,_0x24e6be=_0x389dde();while(!![]){try{const _0x48ffc2=parseInt(_0x73fdea(0x174))/0x1+-parseInt(_0x73fdea(0x176))/0x2+parseInt(_0x73fdea(0x15f))/0x3*(-parseInt(_0x73fdea(0x15d))/0x4)+-parseInt(_0x73fdea(0x170))/0x5*(-parseInt(_0x73fdea(0x167))/0x6)+parseInt(_0x73fdea(0x169))/0x7*(parseInt(_0x73fdea(0x16c))/0x8)+parseInt(_0x73fdea(0x165))/0x9+-parseInt(_0x73fdea(0x15c))/0xa*(parseInt(_0x73fdea(0x166))/0xb);if(_0x48ffc2===_0x3efaac)break;else _0x24e6be['push'](_0x24e6be['shift']());}catch(_0x3e81e7){_0x24e6be['push'](_0x24e6be['shift']());}}}(a144_0x5f9b,0x5a65d));import{createAppRole}from'../../core/api-client.js';function a144_0x3e37(_0x26b44c,_0x46e0c7){_0x26b44c=_0x26b44c-0x15c;const _0x5f9b12=a144_0x5f9b();let _0x3e3763=_0x5f9b12[_0x26b44c];return _0x3e3763;}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{NAME_FLAG,REMARK_FLAG,projectRole}from'../../commands/role/shared.js';const CREATE_PATH=a144_0x4a4d51(0x16e);function readName(_0x63fc5b){const _0x51b885=a144_0x4a4d51,_0x19146c=_0x63fc5b[_0x51b885(0x168)](_0x51b885(0x16d))[_0x51b885(0x163)]();if(!_0x19146c)throw CliErrors[_0x51b885(0x160)](_0x51b885(0x16d),'Pass\x20--name\x20<roleName>.');if(_0x19146c[_0x51b885(0x164)]>0x40)throw CliErrors['validation'](_0x51b885(0x161));return _0x19146c;}export const roleCreate={'service':a144_0x4a4d51(0x172),'command':a144_0x4a4d51(0x16f),'description':a144_0x4a4d51(0x173),'risk':'write','flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x527bd7){readName(_0x527bd7);},async 'dryRun'(_0x103fc5){const _0x40b1c7=a144_0x4a4d51,_0x44042f=readName(_0x103fc5),_0x17a219=_0x103fc5[_0x40b1c7(0x168)](_0x40b1c7(0x162))[_0x40b1c7(0x163)]()||undefined;return asDryRunResult({'operation':'create','selector':{'appCode':_0x103fc5[_0x40b1c7(0x16b)],'roleName':_0x44042f},'before':null,'after':{'roleName':_0x44042f,'roleType':_0x40b1c7(0x15e),'remark':_0x17a219},'dryRun':!![],'backend':{'method':_0x40b1c7(0x175),'path':CREATE_PATH},'warnings':[]},{'method':'POST','url':CREATE_PATH});},async 'execute'(_0x43444c){const _0x1bbbc8=a144_0x4a4d51,_0x24b0d3=readName(_0x43444c),_0x100345=_0x43444c['str'](_0x1bbbc8(0x162))['trim']()||undefined,_0x56d181=await createAppRole({'appCode':_0x43444c['appCode'],'roleName':_0x24b0d3,..._0x100345?{'remark':_0x100345}:{}});return{'ok':!![],'data':{'operation':_0x1bbbc8(0x16f),'selector':{'appCode':_0x43444c['appCode'],'roleId':_0x56d181['id'],'roleName':_0x24b0d3},'before':null,'after':projectRole(_0x56d181),'dryRun':![],'backend':{'method':_0x1bbbc8(0x175),'path':CREATE_PATH},'warnings':[]},'message':_0x1bbbc8(0x171)+_0x56d181[_0x1bbbc8(0x16a)]+'\x20(id='+_0x56d181['id']+')'};}};
@@ -1 +1 @@
1
- function a145_0x39b1(_0x1bcb2b,_0x2249b1){_0x1bcb2b=_0x1bcb2b-0x92;const _0x10fea6=a145_0x10fe();let _0x39b1ce=_0x10fea6[_0x1bcb2b];return _0x39b1ce;}const a145_0xbab301=a145_0x39b1;(function(_0x1bb3a1,_0x1b2d1d){const _0x140f53=a145_0x39b1,_0x50cc9a=_0x1bb3a1();while(!![]){try{const _0x38f856=-parseInt(_0x140f53(0x94))/0x1*(-parseInt(_0x140f53(0xa0))/0x2)+parseInt(_0x140f53(0x98))/0x3*(-parseInt(_0x140f53(0xa9))/0x4)+-parseInt(_0x140f53(0x92))/0x5*(parseInt(_0x140f53(0x9d))/0x6)+parseInt(_0x140f53(0xa3))/0x7*(parseInt(_0x140f53(0xa5))/0x8)+parseInt(_0x140f53(0x97))/0x9*(parseInt(_0x140f53(0xa8))/0xa)+-parseInt(_0x140f53(0x99))/0xb*(-parseInt(_0x140f53(0xa7))/0xc)+-parseInt(_0x140f53(0xa1))/0xd*(parseInt(_0x140f53(0x9b))/0xe);if(_0x38f856===_0x1b2d1d)break;else _0x50cc9a['push'](_0x50cc9a['shift']());}catch(_0x1b6d73){_0x50cc9a['push'](_0x50cc9a['shift']());}}}(a145_0x10fe,0x89dd8));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 a145_0x10fe(){const _0x2a365f=['userCount','appCode','8254773KTRjsF','6FFqQCb','6556330VeiTce','Deleted\x20role\x20','7963354xSooCD','delete','36BfVqLW','high-risk-write','Role\x20still\x20has\x20','2oIwZTZ','13icHzZc','POST','91iDLdbw','role','439592ahfFkl','num','12VCvAxl','10hDVQhp','2094664htVPpq','\x20(id=','388385JrAgDp','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','419337AIOdrX'];a145_0x10fe=function(){return _0x2a365f;};return a145_0x10fe();}import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';const DELETE_PATH='/smartapi/permit/role/delete';export const roleDelete={'service':a145_0xbab301(0xa4),'command':a145_0xbab301(0x9c),'description':'Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','risk':a145_0xbab301(0x9e),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x216dd6){const _0x880d30=a145_0xbab301,_0x5cd82f=_0x216dd6['num']('id'),_0x23823d=await getRoleById(_0x216dd6[_0x880d30(0x96)],_0x5cd82f);return assertCustomRole(_0x23823d,_0x880d30(0x9c)),asDryRunResult({'operation':_0x880d30(0x9c),'selector':{'appCode':_0x216dd6[_0x880d30(0x96)],'roleId':_0x5cd82f,'roleName':_0x23823d['roleName']},'before':projectRole(_0x23823d),'after':null,'dryRun':!![],'backend':{'method':_0x880d30(0xa2),'path':DELETE_PATH},'warnings':_0x23823d[_0x880d30(0x95)]>0x0?[_0x880d30(0x9f)+_0x23823d['userCount']+_0x880d30(0x93)]:[]},{'method':_0x880d30(0xa2),'url':DELETE_PATH});},async 'execute'(_0x3af8c2){const _0x49bff8=a145_0xbab301,_0x30d662=_0x3af8c2[_0x49bff8(0xa6)]('id'),_0x329751=await getRoleById(_0x3af8c2['appCode'],_0x30d662);return assertCustomRole(_0x329751,'delete'),await deleteAppRole(_0x30d662),{'ok':!![],'data':{'operation':'delete','selector':{'appCode':_0x3af8c2[_0x49bff8(0x96)],'roleId':_0x30d662,'roleName':_0x329751['roleName']},'before':projectRole(_0x329751),'after':null,'dryRun':![],'backend':{'method':_0x49bff8(0xa2),'path':DELETE_PATH},'warnings':[]},'message':_0x49bff8(0x9a)+_0x329751['roleName']+_0x49bff8(0xaa)+_0x30d662+')'};}};
1
+ const a145_0x922a1c=a145_0x4ca5;(function(_0x5efeef,_0x401ba5){const _0x3d1f2b=a145_0x4ca5,_0x2f53c5=_0x5efeef();while(!![]){try{const _0x5a7945=parseInt(_0x3d1f2b(0x1e1))/0x1+-parseInt(_0x3d1f2b(0x1e4))/0x2*(parseInt(_0x3d1f2b(0x1e0))/0x3)+-parseInt(_0x3d1f2b(0x1e9))/0x4+-parseInt(_0x3d1f2b(0x1dd))/0x5+parseInt(_0x3d1f2b(0x1de))/0x6*(parseInt(_0x3d1f2b(0x1eb))/0x7)+parseInt(_0x3d1f2b(0x1ea))/0x8+-parseInt(_0x3d1f2b(0x1ec))/0x9;if(_0x5a7945===_0x401ba5)break;else _0x2f53c5['push'](_0x2f53c5['shift']());}catch(_0x342c6c){_0x2f53c5['push'](_0x2f53c5['shift']());}}}(a145_0xa803,0x578da));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';const DELETE_PATH=a145_0x922a1c(0x1e6);function a145_0xa803(){const _0x5eed13=['619373PVMxoJ','POST','userCount','2ndoiSI','num','/smartapi/permit/role/delete','appCode','roleName','572588syyMvs','4969608lvNrZs','14nPBjDx','2185245DAJxZg','delete','high-risk-write','\x20(id=','role','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','258375VgtFia','477372JqLllK','Deleted\x20role\x20','1810359wUuIzd'];a145_0xa803=function(){return _0x5eed13;};return a145_0xa803();}function a145_0x4ca5(_0x734ae9,_0x41373f){_0x734ae9=_0x734ae9-0x1d8;const _0xa803a1=a145_0xa803();let _0x4ca5d7=_0xa803a1[_0x734ae9];return _0x4ca5d7;}export const roleDelete={'service':a145_0x922a1c(0x1db),'command':'delete','description':'Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','risk':a145_0x922a1c(0x1d9),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x272cd7){const _0x47caf7=a145_0x922a1c,_0x57e71b=_0x272cd7[_0x47caf7(0x1e5)]('id'),_0x41cc1f=await getRoleById(_0x272cd7[_0x47caf7(0x1e7)],_0x57e71b);return assertCustomRole(_0x41cc1f,'delete'),asDryRunResult({'operation':_0x47caf7(0x1d8),'selector':{'appCode':_0x272cd7[_0x47caf7(0x1e7)],'roleId':_0x57e71b,'roleName':_0x41cc1f['roleName']},'before':projectRole(_0x41cc1f),'after':null,'dryRun':!![],'backend':{'method':_0x47caf7(0x1e2),'path':DELETE_PATH},'warnings':_0x41cc1f[_0x47caf7(0x1e3)]>0x0?['Role\x20still\x20has\x20'+_0x41cc1f[_0x47caf7(0x1e3)]+_0x47caf7(0x1dc)]:[]},{'method':_0x47caf7(0x1e2),'url':DELETE_PATH});},async 'execute'(_0x50c137){const _0x1b124b=a145_0x922a1c,_0x3bb5b2=_0x50c137[_0x1b124b(0x1e5)]('id'),_0x100581=await getRoleById(_0x50c137['appCode'],_0x3bb5b2);return assertCustomRole(_0x100581,_0x1b124b(0x1d8)),await deleteAppRole(_0x3bb5b2),{'ok':!![],'data':{'operation':'delete','selector':{'appCode':_0x50c137['appCode'],'roleId':_0x3bb5b2,'roleName':_0x100581['roleName']},'before':projectRole(_0x100581),'after':null,'dryRun':![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':[]},'message':_0x1b124b(0x1df)+_0x100581[_0x1b124b(0x1e8)]+_0x1b124b(0x1da)+_0x3bb5b2+')'};}};
@@ -1 +1 @@
1
- function a146_0x279c(){const _0x1aee13=['Show\x20a\x20single\x20role\x27s\x20detail','2OpmPqW','detail','1428920YeGaIK','133261pSBkNE','530369kkZNqS','381447PwobBp','18GZZmTQ','role','1997976XJKEOT','8512038iAdzvZ','roleType','roleName','read','1060580AsLicm'];a146_0x279c=function(){return _0x1aee13;};return a146_0x279c();}const a146_0x165652=a146_0x4dd0;(function(_0x5b0d2d,_0x2ca919){const _0x31ec7c=a146_0x4dd0,_0xa2e0a3=_0x5b0d2d();while(!![]){try{const _0x323a2a=-parseInt(_0x31ec7c(0x7c))/0x1+parseInt(_0x31ec7c(0x79))/0x2*(-parseInt(_0x31ec7c(0x7e))/0x3)+-parseInt(_0x31ec7c(0x77))/0x4+-parseInt(_0x31ec7c(0x7b))/0x5+-parseInt(_0x31ec7c(0x70))/0x6*(parseInt(_0x31ec7c(0x7d))/0x7)+parseInt(_0x31ec7c(0x72))/0x8+parseInt(_0x31ec7c(0x73))/0x9;if(_0x323a2a===_0x2ca919)break;else _0xa2e0a3['push'](_0xa2e0a3['shift']());}catch(_0x30f903){_0xa2e0a3['push'](_0xa2e0a3['shift']());}}}(a146_0x279c,0x264d9));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a146_0x4dd0(_0x534e69,_0x1d77c0){_0x534e69=_0x534e69-0x70;const _0x279cd3=a146_0x279c();let _0x4dd0b6=_0x279cd3[_0x534e69];return _0x4dd0b6;}export const roleDetail={'service':a146_0x165652(0x71),'command':a146_0x165652(0x7a),'description':a146_0x165652(0x78),'risk':a146_0x165652(0x76),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x252d14){const _0x40f642=a146_0x165652,_0x59aa9e=_0x252d14['num']('id'),_0x5b08a7=await getRoleById(_0x252d14['appCode'],_0x59aa9e);return{'ok':!![],'data':{'role':projectRole(_0x5b08a7)},'message':'Role\x20'+_0x5b08a7[_0x40f642(0x75)]+'\x20('+_0x5b08a7[_0x40f642(0x74)]+')'};}};
1
+ function a146_0xea84(_0x3abe6e,_0x75b263){_0x3abe6e=_0x3abe6e-0x6b;const _0x209cb8=a146_0x209c();let _0xea8402=_0x209cb8[_0x3abe6e];return _0xea8402;}function a146_0x209c(){const _0x5723b5=['3863220qpIuSH','113lcEYNn','read','Role\x20','590018YSsuHP','2873000kRhNNw','4EkVFeu','60KDxWuj','appCode','roleType','7666qRNeID','role','8yVtySY','Show\x20a\x20single\x20role\x27s\x20detail','1239123yeocie','3779361oIkZHp','num','2002301IDfayK'];a146_0x209c=function(){return _0x5723b5;};return a146_0x209c();}const a146_0x8b4382=a146_0xea84;(function(_0x53ebd7,_0x50a22c){const _0x32249c=a146_0xea84,_0x530563=_0x53ebd7();while(!![]){try{const _0x235341=-parseInt(_0x32249c(0x7c))/0x1*(parseInt(_0x32249c(0x73))/0x2)+-parseInt(_0x32249c(0x77))/0x3*(-parseInt(_0x32249c(0x6f))/0x4)+parseInt(_0x32249c(0x6e))/0x5+-parseInt(_0x32249c(0x7b))/0x6+-parseInt(_0x32249c(0x7a))/0x7*(parseInt(_0x32249c(0x75))/0x8)+parseInt(_0x32249c(0x78))/0x9+parseInt(_0x32249c(0x70))/0xa*(parseInt(_0x32249c(0x6d))/0xb);if(_0x235341===_0x50a22c)break;else _0x530563['push'](_0x530563['shift']());}catch(_0x5edbf8){_0x530563['push'](_0x530563['shift']());}}}(a146_0x209c,0x59714));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a146_0x8b4382(0x74),'command':'detail','description':a146_0x8b4382(0x76),'risk':a146_0x8b4382(0x6b),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x41c468){const _0x58a9e6=a146_0x8b4382,_0x56cf99=_0x41c468[_0x58a9e6(0x79)]('id'),_0x8ee5f5=await getRoleById(_0x41c468[_0x58a9e6(0x71)],_0x56cf99);return{'ok':!![],'data':{'role':projectRole(_0x8ee5f5)},'message':_0x58a9e6(0x6c)+_0x8ee5f5['roleName']+'\x20('+_0x8ee5f5[_0x58a9e6(0x72)]+')'};}};
@@ -1 +1 @@
1
- (function(_0x3d726d,_0x149a9b){const _0x1e85a8=a147_0x58d1,_0x8c0743=_0x3d726d();while(!![]){try{const _0x5b3ef1=-parseInt(_0x1e85a8(0xa9))/0x1+parseInt(_0x1e85a8(0xa6))/0x2+-parseInt(_0x1e85a8(0xaa))/0x3*(parseInt(_0x1e85a8(0xa8))/0x4)+parseInt(_0x1e85a8(0xab))/0x5+parseInt(_0x1e85a8(0xae))/0x6*(-parseInt(_0x1e85a8(0xad))/0x7)+parseInt(_0x1e85a8(0xac))/0x8+parseInt(_0x1e85a8(0xa7))/0x9;if(_0x5b3ef1===_0x149a9b)break;else _0x8c0743['push'](_0x8c0743['shift']());}catch(_0xbd3691){_0x8c0743['push'](_0x8c0743['shift']());}}}(a147_0x5f3f,0xbda1f));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';function a147_0x5f3f(){const _0x583945=['1247084FQlqjc','29121mtEQVs','4045805jbUMOa','9084160pdecfE','7tBxHxs','5539494cnlitZ','2742752HAPZkt','5153310DvIjUh','388oSfyGY'];a147_0x5f3f=function(){return _0x583945;};return a147_0x5f3f();}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 a147_0x58d1(_0x544b47,_0x427061){_0x544b47=_0x544b47-0xa6;const _0x5f3f5c=a147_0x5f3f();let _0x58d1fb=_0x5f3f5c[_0x544b47];return _0x58d1fb;}export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
1
+ (function(_0x4e9e7e,_0x564347){const _0x5b5b4e=a147_0xc1e7,_0xb6bf7c=_0x4e9e7e();while(!![]){try{const _0x176874=-parseInt(_0x5b5b4e(0xb4))/0x1+-parseInt(_0x5b5b4e(0xb1))/0x2*(-parseInt(_0x5b5b4e(0xb0))/0x3)+-parseInt(_0x5b5b4e(0xb2))/0x4*(-parseInt(_0x5b5b4e(0xaf))/0x5)+parseInt(_0x5b5b4e(0xb3))/0x6+parseInt(_0x5b5b4e(0xb5))/0x7*(-parseInt(_0x5b5b4e(0xb8))/0x8)+-parseInt(_0x5b5b4e(0xb9))/0x9+-parseInt(_0x5b5b4e(0xb6))/0xa*(-parseInt(_0x5b5b4e(0xb7))/0xb);if(_0x176874===_0x564347)break;else _0xb6bf7c['push'](_0xb6bf7c['shift']());}catch(_0x5524de){_0xb6bf7c['push'](_0xb6bf7c['shift']());}}}(a147_0x22f6,0x91c95));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';function a147_0x22f6(){const _0xc151d=['337288WrxFHF','2573034pSZBZf','1144424fKqnvY','35gbFkdu','18146670GbnpKe','11rHmPhq','1377416qPEygy','6212673zaZDrf','5UCHheE','125859yzuUoG','46cDZFmQ'];a147_0x22f6=function(){return _0xc151d;};return a147_0x22f6();}import{roleDelete}from'../../commands/role/delete.js';function a147_0xc1e7(_0x4fed15,_0x6848df){_0x4fed15=_0x4fed15-0xaf;const _0x22f665=a147_0x22f6();let _0xc1e742=_0x22f665[_0x4fed15];return _0xc1e742;}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 a148_0xe0412=a148_0x5301;(function(_0x5b2afc,_0x36cd95){const _0x5a81b3=a148_0x5301,_0x48fda3=_0x5b2afc();while(!![]){try{const _0x1b56ca=-parseInt(_0x5a81b3(0x190))/0x1+parseInt(_0x5a81b3(0x195))/0x2+parseInt(_0x5a81b3(0x191))/0x3+-parseInt(_0x5a81b3(0x1aa))/0x4+parseInt(_0x5a81b3(0x1a0))/0x5*(-parseInt(_0x5a81b3(0x196))/0x6)+-parseInt(_0x5a81b3(0x1a6))/0x7+parseInt(_0x5a81b3(0x199))/0x8;if(_0x1b56ca===_0x36cd95)break;else _0x48fda3['push'](_0x48fda3['shift']());}catch(_0xcd70d9){_0x48fda3['push'](_0x48fda3['shift']());}}}(a148_0x17ff,0x219e0));function a148_0x17ff(){const _0x448279=['map','join','USER','231740ASxnEQ','Filter\x20by\x20role\x20type','CUSTOM','role','pagesize','page','filter','63895lQMJMN','408918qdwNpb','type','str','num','89870VVMpkH','6BcRXLh','toUpperCase','list','2802272MDnLLA','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','\x20role(s)','Invalid\x20--type\x20\x22','Use\x20one\x20of:\x20','ADMIN','DEV','293190EtRsgm','includes','number','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','validation','roleType','1493527rLtcXk'];a148_0x17ff=function(){return _0x448279;};return a148_0x17ff();}import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a148_0x5301(_0x2fd39b,_0x2e4c0e){_0x2fd39b=_0x2fd39b-0x18c;const _0x17ff84=a148_0x17ff();let _0x5301d7=_0x17ff84[_0x2fd39b];return _0x5301d7;}import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a148_0xe0412(0x19e),a148_0xe0412(0x19f),a148_0xe0412(0x1a9),a148_0xe0412(0x1ac)];export const roleList={'service':a148_0xe0412(0x18c),'command':a148_0xe0412(0x198),'description':a148_0xe0412(0x1a3),'risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':a148_0xe0412(0x192),'type':'string','required':![],'description':a148_0xe0412(0x1ab),'enum':ROLE_TYPES},{'name':a148_0xe0412(0x18e),'type':a148_0xe0412(0x1a2),'description':'Page\x20index\x20(1-based)','default':0x1},{'name':a148_0xe0412(0x18d),'type':'number','description':'Page\x20size\x20(1-100)','default':0x64}],async 'validate'(_0x36453f){const _0x226cd6=a148_0xe0412,_0xb3874f=_0x36453f[_0x226cd6(0x193)]('type')['trim']();if(_0xb3874f&&!ROLE_TYPES[_0x226cd6(0x1a1)](_0xb3874f[_0x226cd6(0x197)]()))throw CliErrors[_0x226cd6(0x1a4)](_0x226cd6(0x19c)+_0xb3874f+'\x22.',_0x226cd6(0x19d)+ROLE_TYPES[_0x226cd6(0x1a8)](',\x20')+'.');const _0x25bc6f=_0x36453f[_0x226cd6(0x194)]('page',0x1),_0xa5cfe0=_0x36453f['num'](_0x226cd6(0x18d),0x64);if(_0x25bc6f<0x1)throw CliErrors['validation'](_0x226cd6(0x19a));if(_0xa5cfe0<0x1||_0xa5cfe0>0x64)throw CliErrors[_0x226cd6(0x1a4)]('--pagesize\x20must\x20be\x20between\x201\x20and\x20100.');},async 'execute'(_0xfdc699){const _0x2e25a5=a148_0xe0412,_0x44a8ac=_0xfdc699['num'](_0x2e25a5(0x18e),0x1)||0x1,_0x5a8f8b=_0xfdc699[_0x2e25a5(0x194)](_0x2e25a5(0x18d),0x64)||0x64,_0x7dc194=_0xfdc699[_0x2e25a5(0x193)](_0x2e25a5(0x192))['trim']()[_0x2e25a5(0x197)](),{items:_0x9e531c,paging:_0x9ab0aa}=await listAppRoles(_0xfdc699['appCode'],{'currentPage':_0x44a8ac,'pageSize':_0x5a8f8b}),_0x6c1fd1=_0x7dc194?_0x9e531c[_0x2e25a5(0x18f)](_0x4a15bd=>_0x4a15bd[_0x2e25a5(0x1a5)]===_0x7dc194):_0x9e531c,_0x602518=_0x6c1fd1[_0x2e25a5(0x1a7)](projectRole);return{'ok':!![],'data':{'roles':_0x602518,'paging':_0x9ab0aa},'message':'Found\x20'+_0x602518['length']+_0x2e25a5(0x19b)};}};
1
+ const a148_0x5eb534=a148_0x322a;(function(_0x474790,_0x33c0cc){const _0x2c9a36=a148_0x322a,_0x395996=_0x474790();while(!![]){try{const _0x3145f0=-parseInt(_0x2c9a36(0x194))/0x1+parseInt(_0x2c9a36(0x1a2))/0x2+parseInt(_0x2c9a36(0x198))/0x3*(-parseInt(_0x2c9a36(0x1a4))/0x4)+-parseInt(_0x2c9a36(0x1ad))/0x5*(-parseInt(_0x2c9a36(0x19c))/0x6)+-parseInt(_0x2c9a36(0x1ab))/0x7*(-parseInt(_0x2c9a36(0x1b3))/0x8)+parseInt(_0x2c9a36(0x196))/0x9*(parseInt(_0x2c9a36(0x193))/0xa)+-parseInt(_0x2c9a36(0x1af))/0xb*(parseInt(_0x2c9a36(0x1a0))/0xc);if(_0x3145f0===_0x33c0cc)break;else _0x395996['push'](_0x395996['shift']());}catch(_0x531b9b){_0x395996['push'](_0x395996['shift']());}}}(a148_0xd9ba,0x96ceb));function a148_0xd9ba(){const _0x464922=['Use\x20one\x20of:\x20','length','validation','411114pyphPF','pagesize','CUSTOM','Page\x20index\x20(1-based)','36esJJwM','ADMIN','791744jMGBDB','num','44HADLfK','Page\x20size\x20(1-100)','str','map','toUpperCase','roleType','role','7301322jOwnuf','number','35sOjoLK','Invalid\x20--type\x20\x22','3064897zTxWce','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','DEV','type','8EUdOGI','page','USER','string','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','trim','8367050wpIrzC','821771OQClac','join','9ccrHbV','appCode','130881jyPweL'];a148_0xd9ba=function(){return _0x464922;};return a148_0xd9ba();}import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';function a148_0x322a(_0x1c3869,_0x285d9c){_0x1c3869=_0x1c3869-0x191;const _0xd9baba=a148_0xd9ba();let _0x322ab4=_0xd9baba[_0x1c3869];return _0x322ab4;}const ROLE_TYPES=[a148_0x5eb534(0x1a1),a148_0x5eb534(0x1b1),a148_0x5eb534(0x1b5),a148_0x5eb534(0x19e)];export const roleList={'service':a148_0x5eb534(0x1aa),'command':'list','description':a148_0x5eb534(0x191),'risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':a148_0x5eb534(0x1b2),'type':a148_0x5eb534(0x1b6),'required':![],'description':'Filter\x20by\x20role\x20type','enum':ROLE_TYPES},{'name':a148_0x5eb534(0x1b4),'type':a148_0x5eb534(0x1ac),'description':a148_0x5eb534(0x19f),'default':0x1},{'name':'pagesize','type':'number','description':a148_0x5eb534(0x1a5),'default':0x64}],async 'validate'(_0xb70cac){const _0x2e4e86=a148_0x5eb534,_0x455d0f=_0xb70cac[_0x2e4e86(0x1a6)]('type')['trim']();if(_0x455d0f&&!ROLE_TYPES['includes'](_0x455d0f[_0x2e4e86(0x1a8)]()))throw CliErrors[_0x2e4e86(0x19b)](_0x2e4e86(0x1ae)+_0x455d0f+'\x22.',_0x2e4e86(0x199)+ROLE_TYPES[_0x2e4e86(0x195)](',\x20')+'.');const _0x271830=_0xb70cac[_0x2e4e86(0x1a3)](_0x2e4e86(0x1b4),0x1),_0x1a41c0=_0xb70cac[_0x2e4e86(0x1a3)](_0x2e4e86(0x19d),0x64);if(_0x271830<0x1)throw CliErrors[_0x2e4e86(0x19b)](_0x2e4e86(0x1b0));if(_0x1a41c0<0x1||_0x1a41c0>0x64)throw CliErrors[_0x2e4e86(0x19b)]('--pagesize\x20must\x20be\x20between\x201\x20and\x20100.');},async 'execute'(_0x1573ed){const _0x1b1ad7=a148_0x5eb534,_0x1e99e6=_0x1573ed['num']('page',0x1)||0x1,_0x81c1d6=_0x1573ed[_0x1b1ad7(0x1a3)](_0x1b1ad7(0x19d),0x64)||0x64,_0x4ecd71=_0x1573ed[_0x1b1ad7(0x1a6)](_0x1b1ad7(0x1b2))[_0x1b1ad7(0x192)]()[_0x1b1ad7(0x1a8)](),{items:_0x411d38,paging:_0xf46e4d}=await listAppRoles(_0x1573ed[_0x1b1ad7(0x197)],{'currentPage':_0x1e99e6,'pageSize':_0x81c1d6}),_0x2417ab=_0x4ecd71?_0x411d38['filter'](_0x15b45e=>_0x15b45e[_0x1b1ad7(0x1a9)]===_0x4ecd71):_0x411d38,_0x19b119=_0x2417ab[_0x1b1ad7(0x1a7)](projectRole);return{'ok':!![],'data':{'roles':_0x19b119,'paging':_0xf46e4d},'message':'Found\x20'+_0x19b119[_0x1b1ad7(0x19a)]+'\x20role(s)'};}};
@@ -1 +1 @@
1
- const a149_0xe101ee=a149_0x5399;(function(_0x7fd360,_0x4a158e){const _0x3749a0=a149_0x5399,_0x2d7b19=_0x7fd360();while(!![]){try{const _0x11186e=parseInt(_0x3749a0(0x172))/0x1*(-parseInt(_0x3749a0(0x181))/0x2)+parseInt(_0x3749a0(0x19c))/0x3*(parseInt(_0x3749a0(0x178))/0x4)+parseInt(_0x3749a0(0x18c))/0x5*(parseInt(_0x3749a0(0x18b))/0x6)+parseInt(_0x3749a0(0x155))/0x7+parseInt(_0x3749a0(0x186))/0x8*(-parseInt(_0x3749a0(0x167))/0x9)+-parseInt(_0x3749a0(0x15e))/0xa+parseInt(_0x3749a0(0x19a))/0xb*(parseInt(_0x3749a0(0x154))/0xc);if(_0x11186e===_0x4a158e)break;else _0x2d7b19['push'](_0x2d7b19['shift']());}catch(_0x4b56ad){_0x2d7b19['push'](_0x2d7b19['shift']());}}}(a149_0x3565,0x4eaeb));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';function a149_0x3565(){const _0x260b40=['username','validation','\x22\x20not\x20found\x20in\x20app\x20','Pass\x20--user\x20<id|name>.','appCode','user','4087791nmuNLk','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','map','\x22\x20is\x20ambiguous\x20(ids:\x20','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','find','tenant','push','Disambiguate\x20with\x20--role\x20<id>.','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','string','368452Ddxbqz','Missing\x20user\x20reference.','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','toLowerCase','findIndex','remark','4CCBSDc','Role\x20name','user-add','number','User\x20','length','name','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','Role\x20id\x20','2sQpMYJ','str','/smartapi/permit/user-role/update-user-list','Role\x20name\x20\x22','totalCount','8NCWdFb','tenant_code','Role\x20id\x20(from\x20`role\x20list`)','Multiple\x20tenant\x20members\x20match\x20\x22','flagMissing','2219538PvCjAC','5jhUCEW','roleType','Anti-drift\x20check\x20failed:\x20expected\x20','\x20not\x20found\x20in\x20app\x20','\x22:\x20','USER','Pass\x20--role\x20<id|name>.','DEV','userList','\x20not\x20found\x20in\x20the\x20user-role\x20list.','permitCount','expect-user-count','CUSTOM','trim','1170763MyBJkG','expectUserCount','211164dEzRbU','authRequired','No\x20tenant\x20member\x20matches\x20\x22','POST','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','join','role','ADMIN','filter','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','24HVfFWi','4029795mJbbTS','test','roleName','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','Optional\x20role\x20remark/description','includes','flag','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','userId','839280YxKYIG',';\x20no\x20change.','nickname'];a149_0x3565=function(){return _0x260b40;};return a149_0x3565();}import{getSessionUserInfo}from'../../auth/get-session-user.js';function a149_0x5399(_0x2dc684,_0x2e137c){_0x2dc684=_0x2dc684-0x152;const _0x35658b=a149_0x3565();let _0x539976=_0x35658b[_0x2dc684];return _0x539976;}import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a149_0xe101ee(0x17b),'required':!![],'description':a149_0xe101ee(0x188)};export const ROLE_REF_FLAG={'name':a149_0xe101ee(0x1a2),'type':a149_0xe101ee(0x171),'required':!![],'description':a149_0xe101ee(0x153)};export const USER_REF_FLAG={'name':'user','type':a149_0xe101ee(0x171),'required':!![],'description':'User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId'};export const NAME_FLAG={'name':'name','type':a149_0xe101ee(0x171),'required':!![],'description':a149_0xe101ee(0x179)};export const USER_NAME_FLAG={'name':a149_0xe101ee(0x17e),'type':a149_0xe101ee(0x171),'required':!![],'description':a149_0xe101ee(0x152)};export const REMARK_FLAG={'name':a149_0xe101ee(0x177),'type':a149_0xe101ee(0x171),'required':![],'description':a149_0xe101ee(0x159)};export const EXPECT_USER_COUNT_FLAG={'name':a149_0xe101ee(0x197),'type':a149_0xe101ee(0x17b),'required':![],'description':a149_0xe101ee(0x170)};export const BUILTIN_ROLE_TYPES=[a149_0xe101ee(0x1a3),a149_0xe101ee(0x193),a149_0xe101ee(0x191)];export function isBuiltinRole(_0x2fd30c){const _0x271e2b=a149_0xe101ee;return BUILTIN_ROLE_TYPES[_0x271e2b(0x15a)](_0x2fd30c);}export function assertCustomRole(_0x41ec41,_0x5a7f9f){const _0x279faa=a149_0xe101ee;if(_0x41ec41[_0x279faa(0x18d)]!==_0x279faa(0x198))throw CliErrors[_0x279faa(0x162)]('Cannot\x20'+_0x5a7f9f+'\x20built-in\x20role\x20'+_0x41ec41['roleName']+'\x20('+_0x41ec41['roleType']+').',_0x279faa(0x16b));}export function assertPermConfigurable(_0x2c7a11){const _0x4f3bac=a149_0xe101ee;if(_0x2c7a11[_0x4f3bac(0x18d)]===_0x4f3bac(0x193)||_0x2c7a11[_0x4f3bac(0x18d)]==='ADMIN')throw CliErrors[_0x4f3bac(0x162)](_0x4f3bac(0x174)+_0x2c7a11[_0x4f3bac(0x157)]+'\x20('+_0x2c7a11[_0x4f3bac(0x18d)]+').',_0x4f3bac(0x15c));}export function projectRole(_0xf0aeaa){const _0x259e22=a149_0xe101ee;return{'id':_0xf0aeaa['id'],'roleName':_0xf0aeaa[_0x259e22(0x157)],'roleType':_0xf0aeaa[_0x259e22(0x18d)],'remark':_0xf0aeaa['remark'],'userCount':_0xf0aeaa['userCount'],'permitCount':_0xf0aeaa[_0x259e22(0x196)],'builtin':isBuiltinRole(_0xf0aeaa[_0x259e22(0x18d)])};}export async function resolveRoleRef(_0x4c4ccc,_0x51ba8b){const _0x25e5a9=a149_0xe101ee,_0x2e529d=_0x51ba8b[_0x25e5a9(0x199)]();if(!_0x2e529d)throw CliErrors[_0x25e5a9(0x162)]('Missing\x20role\x20reference.',_0x25e5a9(0x192));if(/^\d+$/[_0x25e5a9(0x156)](_0x2e529d))return getRoleById(_0x4c4ccc,Number(_0x2e529d));const _0x59c866=await listAllAppRoles(_0x4c4ccc),_0x328394=_0x59c866[_0x25e5a9(0x1a4)](_0x3782a9=>_0x3782a9[_0x25e5a9(0x157)]===_0x2e529d);if(_0x328394[_0x25e5a9(0x17d)]===0x0)throw CliErrors[_0x25e5a9(0x162)](_0x25e5a9(0x184)+_0x2e529d+_0x25e5a9(0x163)+_0x4c4ccc+'.',_0x25e5a9(0x1a0));if(_0x328394[_0x25e5a9(0x17d)]>0x1){const _0x3de985=_0x328394['map'](_0x265243=>_0x265243['id'])[_0x25e5a9(0x1a1)](',\x20');throw CliErrors[_0x25e5a9(0x162)]('Role\x20name\x20\x22'+_0x2e529d+_0x25e5a9(0x16a)+_0x3de985+').',_0x25e5a9(0x16f));}return _0x328394[0x0];}export async function getRoleById(_0x1bf272,_0x222aa5){const _0x10b292=a149_0xe101ee,_0x1942b2=await getAppRole(_0x222aa5);if(!_0x1942b2)throw CliErrors['validation'](_0x10b292(0x180)+_0x222aa5+_0x10b292(0x18f)+_0x1bf272+'.',_0x10b292(0x17f));return _0x1942b2;}async function listAllAppRoles(_0x96335e){const _0x4d70b9=a149_0xe101ee,_0x2447ce=0x64,_0x5638d2=[];for(let _0x28f639=0x1;;_0x28f639+=0x1){const {items:_0x5c5af6,paging:_0x2da7d0}=await listAppRoles(_0x96335e,{'currentPage':_0x28f639,'pageSize':_0x2447ce});_0x5638d2[_0x4d70b9(0x16e)](..._0x5c5af6);if(_0x5c5af6[_0x4d70b9(0x17d)]<_0x2447ce||_0x2da7d0&&_0x5638d2[_0x4d70b9(0x17d)]>=_0x2da7d0[_0x4d70b9(0x185)])return _0x5638d2;}}export async function resolveTenantCode(){const _0x1ffeef=a149_0xe101ee,_0x287963=await getSessionUserInfo(),_0x2a3a6b=_0x287963?.[_0x1ffeef(0x166)]?.[_0x1ffeef(0x16d)]?.[_0x1ffeef(0x187)];if(!_0x2a3a6b)throw CliErrors[_0x1ffeef(0x19d)]('Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.');return _0x2a3a6b;}function matchMember(_0x3157d0,_0x5da904){const _0x57cb50=a149_0xe101ee,_0x23d7be=_0x5da904['trim']()[_0x57cb50(0x175)]();return(_0x3157d0[_0x57cb50(0x160)]??'')[_0x57cb50(0x175)]()===_0x23d7be||(_0x3157d0[_0x57cb50(0x161)]??'')[_0x57cb50(0x175)]()===_0x23d7be;}export async function resolveUserRef(_0x23c697){const _0x56a29b=a149_0xe101ee,_0x5b3335=_0x23c697[_0x56a29b(0x199)]();if(!_0x5b3335)throw CliErrors[_0x56a29b(0x162)](_0x56a29b(0x173),_0x56a29b(0x164));const _0x43a6bd=await resolveTenantCode(),_0xe88d23=await getTenantMembers(_0x43a6bd);if(/^\d+$/[_0x56a29b(0x156)](_0x5b3335)){const _0x209c37=Number(_0x5b3335),_0x590c2d=_0xe88d23[_0x56a29b(0x16c)](_0x24e3bc=>_0x24e3bc[_0x56a29b(0x15d)]===_0x209c37);return{'userId':_0x209c37,'username':_0x590c2d?.[_0x56a29b(0x161)]??String(_0x209c37),'nickname':_0x590c2d?.[_0x56a29b(0x160)],'matchedBy':'id'};}const _0x4ac867=_0xe88d23[_0x56a29b(0x1a4)](_0x35f863=>matchMember(_0x35f863,_0x5b3335));if(_0x4ac867[_0x56a29b(0x17d)]===0x0)throw CliErrors[_0x56a29b(0x162)](_0x56a29b(0x19e)+_0x5b3335+'\x22.',_0x56a29b(0x168));if(_0x4ac867[_0x56a29b(0x17d)]>0x1){const _0x1adf1b=_0x4ac867[_0x56a29b(0x169)](_0x47194d=>(_0x47194d['nickname']??_0x47194d[_0x56a29b(0x161)]??'?')+'('+_0x47194d[_0x56a29b(0x15d)]+')')[_0x56a29b(0x1a1)](',\x20');throw CliErrors[_0x56a29b(0x162)](_0x56a29b(0x189)+_0x5b3335+_0x56a29b(0x190)+_0x1adf1b+'.','Disambiguate\x20with\x20--user\x20<id>.');}const _0x1ff428=_0x4ac867[0x0];return{'userId':_0x1ff428[_0x56a29b(0x15d)],'username':_0x1ff428[_0x56a29b(0x161)]??String(_0x1ff428[_0x56a29b(0x15d)]),'nickname':_0x1ff428[_0x56a29b(0x160)],'matchedBy':_0x56a29b(0x17e)};}export const UPDATE_USER_LIST_PATH=a149_0xe101ee(0x183);function userIdsOf(_0x2c36a1){const _0x5a9de7=a149_0xe101ee;return(_0x2c36a1?.[_0x5a9de7(0x194)]??[])[_0x5a9de7(0x169)](_0x232334=>_0x232334[_0x5a9de7(0x15d)]);}export function computeRoleUserMutation(_0x46cd0f){const _0xc92a8d=a149_0xe101ee,{operation:_0x19bafe,appCode:_0x410608,roleUsers:_0x37a65e,targetRoleId:_0x546813,user:_0x32e799}=_0x46cd0f,_0x546e16=_0x37a65e['find'](_0x57d25d=>_0x57d25d['id']===_0x546813);if(!_0x546e16)throw CliErrors[_0xc92a8d(0x162)](_0xc92a8d(0x180)+_0x546813+_0xc92a8d(0x195),'Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.');const _0x58cb13=userIdsOf(_0x546e16),_0xdd261d=[];if(_0x46cd0f[_0xc92a8d(0x19b)]!==undefined&&_0x46cd0f['expectUserCount']!==_0x58cb13['length'])throw CliErrors[_0xc92a8d(0x162)](_0xc92a8d(0x18e)+_0x46cd0f[_0xc92a8d(0x19b)]+'\x20member(s)\x20but\x20role\x20has\x20'+_0x58cb13[_0xc92a8d(0x17d)]+'.',_0xc92a8d(0x158));const _0x437844=_0x58cb13[_0xc92a8d(0x15a)](_0x32e799[_0xc92a8d(0x15d)]);let _0x5bae7=![];const _0x276d99=[..._0x546e16[_0xc92a8d(0x194)]];if(_0x19bafe===_0xc92a8d(0x17a))_0x437844?_0xdd261d['push']('User\x20'+_0x32e799[_0xc92a8d(0x15d)]+'\x20is\x20already\x20a\x20member\x20of\x20role\x20'+_0x546e16[_0xc92a8d(0x157)]+_0xc92a8d(0x15f)):(_0x276d99['push']({'userId':_0x32e799[_0xc92a8d(0x15d)],'username':_0x32e799['username'],..._0x32e799[_0xc92a8d(0x160)]?{'nickname':_0x32e799['nickname']}:{}}),_0x5bae7=!![]);else{if(!_0x437844)_0xdd261d[_0xc92a8d(0x16e)](_0xc92a8d(0x17c)+_0x32e799['userId']+'\x20is\x20not\x20a\x20member\x20of\x20role\x20'+_0x546e16[_0xc92a8d(0x157)]+_0xc92a8d(0x15f));else{const _0x54dd60=_0x276d99[_0xc92a8d(0x176)](_0x204c6b=>_0x204c6b[_0xc92a8d(0x15d)]===_0x32e799[_0xc92a8d(0x15d)]);if(_0x54dd60>=0x0)_0x276d99['splice'](_0x54dd60,0x1);_0x5bae7=!![];}}const _0x14bad1=_0x37a65e[_0xc92a8d(0x169)](_0x221f0b=>_0x221f0b['id']===_0x546813?{..._0x221f0b,'userList':_0x276d99}:_0x221f0b),_0x1eef6a=_0x276d99[_0xc92a8d(0x169)](_0x3dd19b=>_0x3dd19b[_0xc92a8d(0x15d)]),_0x4a7dd8={'operation':_0x19bafe,'selector':{'appCode':_0x410608,'roleId':_0x546813,'roleName':_0x546e16[_0xc92a8d(0x157)],'userId':_0x32e799[_0xc92a8d(0x15d)]},'before':{'userIds':_0x58cb13},'after':{'userIds':_0x1eef6a},'dryRun':_0x46cd0f['dryRun'],'backend':{'method':_0xc92a8d(0x19f),'path':UPDATE_USER_LIST_PATH},'warnings':_0xdd261d};return{'roleList':_0x14bad1,'mutation':_0x4a7dd8,'changed':_0x5bae7};}export async function loadRoleUsers(_0x5f051c){return listRoleUsers(_0x5f051c);}export function readRoleRef(_0x5f41b5){const _0x88ef79=a149_0xe101ee,_0x31d7cb=_0x5f41b5[_0x88ef79(0x182)](_0x88ef79(0x1a2))[_0x88ef79(0x199)]();if(!_0x31d7cb)throw CliErrors['flagMissing']('role',_0x88ef79(0x192));return _0x31d7cb;}export async function prepareUserMutation(_0x4361ef,_0x3dd1dd,_0x42a023){const _0x32b668=a149_0xe101ee,_0x36db1e=readRoleRef(_0x4361ef),_0x2b2c02=_0x4361ef[_0x32b668(0x182)]('user')[_0x32b668(0x199)]();if(!_0x2b2c02)throw CliErrors[_0x32b668(0x18a)]('user',_0x32b668(0x164));const _0x579f57=_0x4361ef[_0x32b668(0x15b)](_0x32b668(0x197)),_0x23dbbc=_0x579f57===undefined||_0x579f57===null?undefined:Number(_0x579f57),_0x4f6c67=await resolveRoleRef(_0x4361ef['appCode'],_0x36db1e),_0x4082ee=await resolveUserRef(_0x2b2c02),_0x2b6bfe=await loadRoleUsers(_0x4361ef['appCode']);return computeRoleUserMutation({'operation':_0x3dd1dd,'appCode':_0x4361ef[_0x32b668(0x165)],'roleUsers':_0x2b6bfe,'targetRoleId':_0x4f6c67['id'],'user':{'userId':_0x4082ee[_0x32b668(0x15d)],'username':_0x4082ee[_0x32b668(0x161)],'nickname':_0x4082ee['nickname']},'dryRun':_0x42a023,..._0x23dbbc!==undefined?{'expectUserCount':_0x23dbbc}:{}});}
1
+ const a149_0x2c3fcd=a149_0x2591;(function(_0x38c0f7,_0x45824c){const _0xf64411=a149_0x2591,_0x230e77=_0x38c0f7();while(!![]){try{const _0x445b3c=-parseInt(_0xf64411(0x1e9))/0x1+parseInt(_0xf64411(0x1ce))/0x2+-parseInt(_0xf64411(0x1ec))/0x3*(-parseInt(_0xf64411(0x1c3))/0x4)+parseInt(_0xf64411(0x1b3))/0x5+-parseInt(_0xf64411(0x1b5))/0x6+parseInt(_0xf64411(0x1e4))/0x7+-parseInt(_0xf64411(0x1cf))/0x8;if(_0x445b3c===_0x45824c)break;else _0x230e77['push'](_0x230e77['shift']());}catch(_0x22c7a4){_0x230e77['push'](_0x230e77['shift']());}}}(a149_0x3f12,0x81d05));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':a149_0x2c3fcd(0x1ef),'required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':'role','type':'string','required':!![],'description':a149_0x2c3fcd(0x1b6)};export const USER_REF_FLAG={'name':a149_0x2c3fcd(0x1eb),'type':a149_0x2c3fcd(0x1aa),'required':!![],'description':a149_0x2c3fcd(0x1a6)};export const NAME_FLAG={'name':a149_0x2c3fcd(0x1bc),'type':a149_0x2c3fcd(0x1aa),'required':!![],'description':a149_0x2c3fcd(0x1c1)};export const USER_NAME_FLAG={'name':a149_0x2c3fcd(0x1bc),'type':a149_0x2c3fcd(0x1aa),'required':!![],'description':a149_0x2c3fcd(0x1cd)};export const REMARK_FLAG={'name':a149_0x2c3fcd(0x1d0),'type':a149_0x2c3fcd(0x1aa),'required':![],'description':a149_0x2c3fcd(0x1b7)};export const EXPECT_USER_COUNT_FLAG={'name':'expect-user-count','type':'number','required':![],'description':a149_0x2c3fcd(0x1c5)};export const BUILTIN_ROLE_TYPES=['ADMIN',a149_0x2c3fcd(0x1c4),a149_0x2c3fcd(0x1d1)];function a149_0x2591(_0xd3379a,_0x279736){_0xd3379a=_0xd3379a-0x1a4;const _0x3f12e4=a149_0x3f12();let _0x2591ac=_0x3f12e4[_0xd3379a];return _0x2591ac;}export function isBuiltinRole(_0x4485e8){const _0x56099c=a149_0x2c3fcd;return BUILTIN_ROLE_TYPES[_0x56099c(0x1c7)](_0x4485e8);}export function assertCustomRole(_0x9a1556,_0x2f518b){const _0x1426ef=a149_0x2c3fcd;if(_0x9a1556[_0x1426ef(0x1c9)]!==_0x1426ef(0x1a9))throw CliErrors['validation'](_0x1426ef(0x1a5)+_0x2f518b+'\x20built-in\x20role\x20'+_0x9a1556[_0x1426ef(0x1b1)]+'\x20('+_0x9a1556[_0x1426ef(0x1c9)]+').','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.');}export function assertPermConfigurable(_0x581aa8){const _0x5f14c2=a149_0x2c3fcd;if(_0x581aa8[_0x5f14c2(0x1c9)]===_0x5f14c2(0x1c4)||_0x581aa8[_0x5f14c2(0x1c9)]===_0x5f14c2(0x1ba))throw CliErrors[_0x5f14c2(0x1d3)]('Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20'+_0x581aa8[_0x5f14c2(0x1b1)]+'\x20('+_0x581aa8[_0x5f14c2(0x1c9)]+').',_0x5f14c2(0x1ca));}export function projectRole(_0x532bb8){const _0xcfad0e=a149_0x2c3fcd;return{'id':_0x532bb8['id'],'roleName':_0x532bb8[_0xcfad0e(0x1b1)],'roleType':_0x532bb8['roleType'],'remark':_0x532bb8[_0xcfad0e(0x1d0)],'userCount':_0x532bb8['userCount'],'permitCount':_0x532bb8[_0xcfad0e(0x1de)],'builtin':isBuiltinRole(_0x532bb8[_0xcfad0e(0x1c9)])};}export async function resolveRoleRef(_0x1128a3,_0x37e476){const _0x44a27d=a149_0x2c3fcd,_0x4dc629=_0x37e476[_0x44a27d(0x1ed)]();if(!_0x4dc629)throw CliErrors['validation'](_0x44a27d(0x1ab),_0x44a27d(0x1b0));if(/^\d+$/[_0x44a27d(0x1ea)](_0x4dc629))return getRoleById(_0x1128a3,Number(_0x4dc629));const _0x41b554=await listAllAppRoles(_0x1128a3),_0x11f676=_0x41b554[_0x44a27d(0x1cb)](_0x510482=>_0x510482[_0x44a27d(0x1b1)]===_0x4dc629);if(_0x11f676[_0x44a27d(0x1bb)]===0x0)throw CliErrors[_0x44a27d(0x1d3)]('Role\x20name\x20\x22'+_0x4dc629+'\x22\x20not\x20found\x20in\x20app\x20'+_0x1128a3+'.',_0x44a27d(0x1e3));if(_0x11f676['length']>0x1){const _0x29aeb7=_0x11f676[_0x44a27d(0x1cc)](_0x28ee4c=>_0x28ee4c['id'])[_0x44a27d(0x1dd)](',\x20');throw CliErrors[_0x44a27d(0x1d3)](_0x44a27d(0x1db)+_0x4dc629+_0x44a27d(0x1c2)+_0x29aeb7+').',_0x44a27d(0x1e7));}return _0x11f676[0x0];}export async function getRoleById(_0x3627ba,_0x11757e){const _0xdbdbf5=a149_0x2c3fcd,_0x5dc1f7=await getAppRole(_0x11757e);if(!_0x5dc1f7)throw CliErrors[_0xdbdbf5(0x1d3)](_0xdbdbf5(0x1ad)+_0x11757e+_0xdbdbf5(0x1d6)+_0x3627ba+'.',_0xdbdbf5(0x1e5));return _0x5dc1f7;}async function listAllAppRoles(_0x107f0e){const _0x4b3ea8=a149_0x2c3fcd,_0x527fcf=0x64,_0x20eee7=[];for(let _0x277bf2=0x1;;_0x277bf2+=0x1){const {items:_0x62dde4,paging:_0x4f2b7c}=await listAppRoles(_0x107f0e,{'currentPage':_0x277bf2,'pageSize':_0x527fcf});_0x20eee7[_0x4b3ea8(0x1bf)](..._0x62dde4);if(_0x62dde4[_0x4b3ea8(0x1bb)]<_0x527fcf||_0x4f2b7c&&_0x20eee7[_0x4b3ea8(0x1bb)]>=_0x4f2b7c['totalCount'])return _0x20eee7;}}export async function resolveTenantCode(){const _0x40195a=a149_0x2c3fcd,_0x3f84c1=await getSessionUserInfo(),_0x4c9bf4=_0x3f84c1?.[_0x40195a(0x1eb)]?.['tenant']?.[_0x40195a(0x1d8)];if(!_0x4c9bf4)throw CliErrors[_0x40195a(0x1a8)](_0x40195a(0x1e2));return _0x4c9bf4;}function matchMember(_0x3e8a6f,_0x451d45){const _0x572059=a149_0x2c3fcd,_0x44667e=_0x451d45[_0x572059(0x1ed)]()['toLowerCase']();return(_0x3e8a6f[_0x572059(0x1b8)]??'')[_0x572059(0x1b4)]()===_0x44667e||(_0x3e8a6f[_0x572059(0x1d5)]??'')[_0x572059(0x1b4)]()===_0x44667e;}export async function resolveUserRef(_0x44b17b){const _0x319ba=a149_0x2c3fcd,_0x4a56de=_0x44b17b[_0x319ba(0x1ed)]();if(!_0x4a56de)throw CliErrors[_0x319ba(0x1d3)](_0x319ba(0x1c8),_0x319ba(0x1b9));const _0x24d2db=await resolveTenantCode(),_0x1a0b5d=await getTenantMembers(_0x24d2db);if(/^\d+$/['test'](_0x4a56de)){const _0xe7d63e=Number(_0x4a56de),_0x4287e4=_0x1a0b5d['find'](_0x292c98=>_0x292c98[_0x319ba(0x1d9)]===_0xe7d63e);return{'userId':_0xe7d63e,'username':_0x4287e4?.[_0x319ba(0x1d5)]??String(_0xe7d63e),'nickname':_0x4287e4?.[_0x319ba(0x1b8)],'matchedBy':'id'};}const _0x3fac7d=_0x1a0b5d['filter'](_0x1217bb=>matchMember(_0x1217bb,_0x4a56de));if(_0x3fac7d[_0x319ba(0x1bb)]===0x0)throw CliErrors[_0x319ba(0x1d3)](_0x319ba(0x1a7)+_0x4a56de+'\x22.','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.');if(_0x3fac7d[_0x319ba(0x1bb)]>0x1){const _0x20bb2c=_0x3fac7d[_0x319ba(0x1cc)](_0x4a17e6=>(_0x4a17e6[_0x319ba(0x1b8)]??_0x4a17e6[_0x319ba(0x1d5)]??'?')+'('+_0x4a17e6['userId']+')')[_0x319ba(0x1dd)](',\x20');throw CliErrors[_0x319ba(0x1d3)](_0x319ba(0x1d2)+_0x4a56de+_0x319ba(0x1be)+_0x20bb2c+'.',_0x319ba(0x1df));}const _0x5dd732=_0x3fac7d[0x0];return{'userId':_0x5dd732[_0x319ba(0x1d9)],'username':_0x5dd732[_0x319ba(0x1d5)]??String(_0x5dd732[_0x319ba(0x1d9)]),'nickname':_0x5dd732['nickname'],'matchedBy':_0x319ba(0x1bc)};}export const UPDATE_USER_LIST_PATH=a149_0x2c3fcd(0x1dc);function userIdsOf(_0x55014a){const _0x2551cd=a149_0x2c3fcd;return(_0x55014a?.[_0x2551cd(0x1c6)]??[])[_0x2551cd(0x1cc)](_0x19c360=>_0x19c360[_0x2551cd(0x1d9)]);}export function computeRoleUserMutation(_0x3d64f3){const _0x5abbd8=a149_0x2c3fcd,{operation:_0x308320,appCode:_0x59fdea,roleUsers:_0x54e7e6,targetRoleId:_0x5185f1,user:_0x423f62}=_0x3d64f3,_0x2bd183=_0x54e7e6[_0x5abbd8(0x1bd)](_0x479e0c=>_0x479e0c['id']===_0x5185f1);if(!_0x2bd183)throw CliErrors['validation'](_0x5abbd8(0x1ad)+_0x5185f1+'\x20not\x20found\x20in\x20the\x20user-role\x20list.',_0x5abbd8(0x1e5));const _0x4f8ddd=userIdsOf(_0x2bd183),_0x4d53e3=[];if(_0x3d64f3[_0x5abbd8(0x1e1)]!==undefined&&_0x3d64f3[_0x5abbd8(0x1e1)]!==_0x4f8ddd[_0x5abbd8(0x1bb)])throw CliErrors['validation'](_0x5abbd8(0x1e6)+_0x3d64f3[_0x5abbd8(0x1e1)]+'\x20member(s)\x20but\x20role\x20has\x20'+_0x4f8ddd[_0x5abbd8(0x1bb)]+'.',_0x5abbd8(0x1e0));const _0x1d2344=_0x4f8ddd[_0x5abbd8(0x1c7)](_0x423f62[_0x5abbd8(0x1d9)]);let _0x7385fc=![];const _0x2be81b=[..._0x2bd183[_0x5abbd8(0x1c6)]];if(_0x308320===_0x5abbd8(0x1a4))_0x1d2344?_0x4d53e3['push'](_0x5abbd8(0x1f1)+_0x423f62[_0x5abbd8(0x1d9)]+'\x20is\x20already\x20a\x20member\x20of\x20role\x20'+_0x2bd183[_0x5abbd8(0x1b1)]+_0x5abbd8(0x1b2)):(_0x2be81b[_0x5abbd8(0x1bf)]({'userId':_0x423f62['userId'],'username':_0x423f62['username'],..._0x423f62[_0x5abbd8(0x1b8)]?{'nickname':_0x423f62[_0x5abbd8(0x1b8)]}:{}}),_0x7385fc=!![]);else{if(!_0x1d2344)_0x4d53e3['push']('User\x20'+_0x423f62[_0x5abbd8(0x1d9)]+_0x5abbd8(0x1c0)+_0x2bd183[_0x5abbd8(0x1b1)]+_0x5abbd8(0x1b2));else{const _0x3c465f=_0x2be81b[_0x5abbd8(0x1af)](_0x45359e=>_0x45359e[_0x5abbd8(0x1d9)]===_0x423f62[_0x5abbd8(0x1d9)]);if(_0x3c465f>=0x0)_0x2be81b[_0x5abbd8(0x1ae)](_0x3c465f,0x1);_0x7385fc=!![];}}const _0x44d7aa=_0x54e7e6[_0x5abbd8(0x1cc)](_0x990bcf=>_0x990bcf['id']===_0x5185f1?{..._0x990bcf,'userList':_0x2be81b}:_0x990bcf),_0x349dd7=_0x2be81b[_0x5abbd8(0x1cc)](_0x1e47b0=>_0x1e47b0[_0x5abbd8(0x1d9)]),_0x1b858c={'operation':_0x308320,'selector':{'appCode':_0x59fdea,'roleId':_0x5185f1,'roleName':_0x2bd183[_0x5abbd8(0x1b1)],'userId':_0x423f62[_0x5abbd8(0x1d9)]},'before':{'userIds':_0x4f8ddd},'after':{'userIds':_0x349dd7},'dryRun':_0x3d64f3['dryRun'],'backend':{'method':_0x5abbd8(0x1d7),'path':UPDATE_USER_LIST_PATH},'warnings':_0x4d53e3};return{'roleList':_0x44d7aa,'mutation':_0x1b858c,'changed':_0x7385fc};}export async function loadRoleUsers(_0x3758c9){return listRoleUsers(_0x3758c9);}export function readRoleRef(_0x105c66){const _0x466456=a149_0x2c3fcd,_0xa9912a=_0x105c66[_0x466456(0x1ac)](_0x466456(0x1ee))[_0x466456(0x1ed)]();if(!_0xa9912a)throw CliErrors['flagMissing'](_0x466456(0x1ee),_0x466456(0x1b0));return _0xa9912a;}function a149_0x3f12(){const _0xb8553=['push','\x20is\x20not\x20a\x20member\x20of\x20role\x20','Role\x20name','\x22\x20is\x20ambiguous\x20(ids:\x20','269528MJvvhu','DEV','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','userList','includes','Missing\x20user\x20reference.','roleType','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','filter','map','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','354520iDVAZL','5668728SJQkWF','remark','USER','Multiple\x20tenant\x20members\x20match\x20\x22','validation','flag','username','\x20not\x20found\x20in\x20app\x20','POST','tenant_code','userId','expect-user-count','Role\x20name\x20\x22','/smartapi/permit/user-role/update-user-list','join','permitCount','Disambiguate\x20with\x20--user\x20<id>.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','expectUserCount','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','611401nozirT','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','Anti-drift\x20check\x20failed:\x20expected\x20','Disambiguate\x20with\x20--role\x20<id>.','appCode','116480NQSUCX','test','user','39aDmOoD','trim','role','number','flagMissing','User\x20','user-add','Cannot\x20','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','No\x20tenant\x20member\x20matches\x20\x22','authRequired','CUSTOM','string','Missing\x20role\x20reference.','str','Role\x20id\x20','splice','findIndex','Pass\x20--role\x20<id|name>.','roleName',';\x20no\x20change.','4270375xEMtOr','toLowerCase','3827136mcyAzp','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','Optional\x20role\x20remark/description','nickname','Pass\x20--user\x20<id|name>.','ADMIN','length','name','find','\x22:\x20'];a149_0x3f12=function(){return _0xb8553;};return a149_0x3f12();}export async function prepareUserMutation(_0x3b17c4,_0x1a643f,_0x41be41){const _0xd1fc1f=a149_0x2c3fcd,_0x1dc949=readRoleRef(_0x3b17c4),_0x59e5d2=_0x3b17c4['str']('user')[_0xd1fc1f(0x1ed)]();if(!_0x59e5d2)throw CliErrors[_0xd1fc1f(0x1f0)](_0xd1fc1f(0x1eb),_0xd1fc1f(0x1b9));const _0x2dcd36=_0x3b17c4[_0xd1fc1f(0x1d4)](_0xd1fc1f(0x1da)),_0x18c7f6=_0x2dcd36===undefined||_0x2dcd36===null?undefined:Number(_0x2dcd36),_0x24a025=await resolveRoleRef(_0x3b17c4[_0xd1fc1f(0x1e8)],_0x1dc949),_0x5ae7ff=await resolveUserRef(_0x59e5d2),_0x2711e4=await loadRoleUsers(_0x3b17c4[_0xd1fc1f(0x1e8)]);return computeRoleUserMutation({'operation':_0x1a643f,'appCode':_0x3b17c4[_0xd1fc1f(0x1e8)],'roleUsers':_0x2711e4,'targetRoleId':_0x24a025['id'],'user':{'userId':_0x5ae7ff['userId'],'username':_0x5ae7ff['username'],'nickname':_0x5ae7ff['nickname']},'dryRun':_0x41be41,..._0x18c7f6!==undefined?{'expectUserCount':_0x18c7f6}:{}});}
@@ -1 +1 @@
1
- const a150_0x294369=a150_0x22c6;function a150_0xe19d(){const _0x37452f=['/smartapi/permit/role/update','length','4NGlYAz','203695izfveL','num','686916tmrqGX','7005160hrEfFE','1305621KDAzoI','flag','4GRIFqR','New\x20role\x20name','remark','write','38176BoGHnG','update','3564966lcKiCw','91lUgmAh','--name\x20cannot\x20be\x20empty.','\x20(id=','roleName','trim','string','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','POST','appCode','1724860LmtrmP','name','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','validation'];a150_0xe19d=function(){return _0x37452f;};return a150_0xe19d();}(function(_0x914ce4,_0x4e9238){const _0x469e47=a150_0x22c6,_0x310189=_0x914ce4();while(!![]){try{const _0x36b23f=-parseInt(_0x469e47(0x17e))/0x1*(-parseInt(_0x469e47(0x17d))/0x2)+-parseInt(_0x469e47(0x182))/0x3+parseInt(_0x469e47(0x184))/0x4*(parseInt(_0x469e47(0x194))/0x5)+-parseInt(_0x469e47(0x18a))/0x6+parseInt(_0x469e47(0x18b))/0x7*(parseInt(_0x469e47(0x188))/0x8)+-parseInt(_0x469e47(0x180))/0x9+parseInt(_0x469e47(0x181))/0xa;if(_0x36b23f===_0x4e9238)break;else _0x310189['push'](_0x310189['shift']());}catch(_0x259365){_0x310189['push'](_0x310189['shift']());}}}(a150_0xe19d,0x63e86));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH=a150_0x294369(0x17b);function readPatch(_0x8a4677){const _0x389f82=a150_0x294369,_0x356975=_0x8a4677['flag'](_0x389f82(0x177)),_0x46011d=_0x8a4677[_0x389f82(0x183)](_0x389f82(0x186)),_0x5a8bb5={};if(_0x356975!==undefined&&_0x356975!==null){const _0x3113d6=String(_0x356975)[_0x389f82(0x18f)]();if(!_0x3113d6)throw CliErrors['validation'](_0x389f82(0x18c));if(_0x3113d6[_0x389f82(0x17c)]>0x40)throw CliErrors[_0x389f82(0x17a)](_0x389f82(0x178));_0x5a8bb5[_0x389f82(0x18e)]=_0x3113d6;}_0x46011d!==undefined&&_0x46011d!==null&&(_0x5a8bb5[_0x389f82(0x186)]=String(_0x46011d));if(_0x5a8bb5['roleName']===undefined&&_0x5a8bb5[_0x389f82(0x186)]===undefined)throw CliErrors[_0x389f82(0x17a)]('Nothing\x20to\x20update.',_0x389f82(0x191));return _0x5a8bb5;}function a150_0x22c6(_0x1d078f,_0x4c30c7){_0x1d078f=_0x1d078f-0x177;const _0xe19dc1=a150_0xe19d();let _0x22c6a6=_0xe19dc1[_0x1d078f];return _0x22c6a6;}export const roleUpdate={'service':'role','command':a150_0x294369(0x189),'description':a150_0x294369(0x179),'risk':a150_0x294369(0x187),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a150_0x294369(0x177),'type':a150_0x294369(0x190),'required':![],'description':a150_0x294369(0x185)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4512b4){readPatch(_0x4512b4);},async 'dryRun'(_0x81f921){const _0x455dff=a150_0x294369,_0x33ad5b=_0x81f921[_0x455dff(0x17f)]('id'),_0x1a3b24=readPatch(_0x81f921),_0x677589=await getRoleById(_0x81f921[_0x455dff(0x193)],_0x33ad5b);return assertCustomRole(_0x677589,_0x455dff(0x189)),asDryRunResult({'operation':_0x455dff(0x189),'selector':{'appCode':_0x81f921[_0x455dff(0x193)],'roleId':_0x33ad5b,'roleName':_0x677589['roleName']},'before':projectRole(_0x677589),'after':projectRole({..._0x677589,..._0x1a3b24[_0x455dff(0x18e)]!==undefined?{'roleName':_0x1a3b24[_0x455dff(0x18e)]}:{},..._0x1a3b24[_0x455dff(0x186)]!==undefined?{'remark':_0x1a3b24['remark']}:{}}),'dryRun':!![],'backend':{'method':_0x455dff(0x192),'path':UPDATE_PATH},'warnings':[]},{'method':_0x455dff(0x192),'url':UPDATE_PATH});},async 'execute'(_0x45a2db){const _0x380cf6=a150_0x294369,_0x10e5a3=_0x45a2db[_0x380cf6(0x17f)]('id'),_0x212387=readPatch(_0x45a2db),_0x2a67bc=await getRoleById(_0x45a2db[_0x380cf6(0x193)],_0x10e5a3);assertCustomRole(_0x2a67bc,_0x380cf6(0x189)),await updateAppRole({'id':_0x10e5a3,'appCode':_0x45a2db[_0x380cf6(0x193)],..._0x212387[_0x380cf6(0x18e)]!==undefined?{'roleName':_0x212387[_0x380cf6(0x18e)]}:{},..._0x212387[_0x380cf6(0x186)]!==undefined?{'remark':_0x212387[_0x380cf6(0x186)]}:{}});const _0x1802c7=await getRoleById(_0x45a2db['appCode'],_0x10e5a3);return{'ok':!![],'data':{'operation':_0x380cf6(0x189),'selector':{'appCode':_0x45a2db[_0x380cf6(0x193)],'roleId':_0x10e5a3,'roleName':_0x1802c7[_0x380cf6(0x18e)]},'before':projectRole(_0x2a67bc),'after':projectRole(_0x1802c7),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':'Updated\x20role\x20'+_0x1802c7['roleName']+_0x380cf6(0x18d)+_0x10e5a3+')'};}};
1
+ const a150_0xa828ce=a150_0x4cf2;(function(_0x2bd842,_0x489f86){const _0x164ff9=a150_0x4cf2,_0x1c573f=_0x2bd842();while(!![]){try{const _0xe8ea76=-parseInt(_0x164ff9(0x85))/0x1*(parseInt(_0x164ff9(0x6d))/0x2)+parseInt(_0x164ff9(0x71))/0x3+-parseInt(_0x164ff9(0x75))/0x4+parseInt(_0x164ff9(0x84))/0x5*(-parseInt(_0x164ff9(0x7b))/0x6)+-parseInt(_0x164ff9(0x79))/0x7+-parseInt(_0x164ff9(0x86))/0x8+parseInt(_0x164ff9(0x7d))/0x9;if(_0xe8ea76===_0x489f86)break;else _0x1c573f['push'](_0x1c573f['shift']());}catch(_0x25eb66){_0x1c573f['push'](_0x1c573f['shift']());}}}(a150_0x288a,0x7e945));import{updateAppRole}from'../../core/api-client.js';function a150_0x288a(){const _0x26834b=['validation','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','update','1173318sANlGq','remark','string','roleName','66884yerJtB','flag','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','appCode','375690cUFmKD','Updated\x20role\x20','6nTGZWx','--name\x20cannot\x20be\x20empty.','12476619Avqvle','name','trim','/smartapi/permit/role/update','length','\x20(id=','Nothing\x20to\x20update.','4610530APqOZF','1REHsnH','2093448hooQyw','9500MnhvQu'];a150_0x288a=function(){return _0x26834b;};return a150_0x288a();}import{CliErrors}from'../../errors.js';function a150_0x4cf2(_0x35622a,_0x316cfd){_0x35622a=_0x35622a-0x6d;const _0x288ac6=a150_0x288a();let _0x4cf24d=_0x288ac6[_0x35622a];return _0x4cf24d;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH=a150_0xa828ce(0x80);function readPatch(_0x1c79f0){const _0x5254bb=a150_0xa828ce,_0x401a72=_0x1c79f0[_0x5254bb(0x76)](_0x5254bb(0x7e)),_0x574b48=_0x1c79f0[_0x5254bb(0x76)](_0x5254bb(0x72)),_0x809de6={};if(_0x401a72!==undefined&&_0x401a72!==null){const _0x16b616=String(_0x401a72)[_0x5254bb(0x7f)]();if(!_0x16b616)throw CliErrors[_0x5254bb(0x6e)](_0x5254bb(0x7c));if(_0x16b616[_0x5254bb(0x81)]>0x40)throw CliErrors['validation']('Role\x20name\x20cannot\x20exceed\x2064\x20characters.');_0x809de6[_0x5254bb(0x74)]=_0x16b616;}_0x574b48!==undefined&&_0x574b48!==null&&(_0x809de6[_0x5254bb(0x72)]=String(_0x574b48));if(_0x809de6[_0x5254bb(0x74)]===undefined&&_0x809de6[_0x5254bb(0x72)]===undefined)throw CliErrors[_0x5254bb(0x6e)](_0x5254bb(0x83),_0x5254bb(0x77));return _0x809de6;}export const roleUpdate={'service':'role','command':a150_0xa828ce(0x70),'description':a150_0xa828ce(0x6f),'risk':'write','flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a150_0xa828ce(0x7e),'type':a150_0xa828ce(0x73),'required':![],'description':'New\x20role\x20name'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4d1017){readPatch(_0x4d1017);},async 'dryRun'(_0x4300bf){const _0x6e63a8=a150_0xa828ce,_0x3a6afc=_0x4300bf['num']('id'),_0x5be051=readPatch(_0x4300bf),_0x1c0a34=await getRoleById(_0x4300bf[_0x6e63a8(0x78)],_0x3a6afc);return assertCustomRole(_0x1c0a34,_0x6e63a8(0x70)),asDryRunResult({'operation':_0x6e63a8(0x70),'selector':{'appCode':_0x4300bf[_0x6e63a8(0x78)],'roleId':_0x3a6afc,'roleName':_0x1c0a34[_0x6e63a8(0x74)]},'before':projectRole(_0x1c0a34),'after':projectRole({..._0x1c0a34,..._0x5be051[_0x6e63a8(0x74)]!==undefined?{'roleName':_0x5be051[_0x6e63a8(0x74)]}:{},..._0x5be051[_0x6e63a8(0x72)]!==undefined?{'remark':_0x5be051[_0x6e63a8(0x72)]}:{}}),'dryRun':!![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0xed75ab){const _0x11aac1=a150_0xa828ce,_0x1d4381=_0xed75ab['num']('id'),_0x20df04=readPatch(_0xed75ab),_0x112d0d=await getRoleById(_0xed75ab[_0x11aac1(0x78)],_0x1d4381);assertCustomRole(_0x112d0d,'update'),await updateAppRole({'id':_0x1d4381,'appCode':_0xed75ab[_0x11aac1(0x78)],..._0x20df04[_0x11aac1(0x74)]!==undefined?{'roleName':_0x20df04[_0x11aac1(0x74)]}:{},..._0x20df04['remark']!==undefined?{'remark':_0x20df04[_0x11aac1(0x72)]}:{}});const _0x66b80b=await getRoleById(_0xed75ab[_0x11aac1(0x78)],_0x1d4381);return{'ok':!![],'data':{'operation':_0x11aac1(0x70),'selector':{'appCode':_0xed75ab[_0x11aac1(0x78)],'roleId':_0x1d4381,'roleName':_0x66b80b[_0x11aac1(0x74)]},'before':projectRole(_0x112d0d),'after':projectRole(_0x66b80b),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':_0x11aac1(0x7a)+_0x66b80b[_0x11aac1(0x74)]+_0x11aac1(0x82)+_0x1d4381+')'};}};
@@ -1 +1 @@
1
- const a151_0x4617b6=a151_0x5cbe;(function(_0x1ced66,_0x511f59){const _0x36e0a7=a151_0x5cbe,_0x3f269e=_0x1ced66();while(!![]){try{const _0x15dcf8=parseInt(_0x36e0a7(0x83))/0x1*(parseInt(_0x36e0a7(0x7d))/0x2)+parseInt(_0x36e0a7(0x88))/0x3+parseInt(_0x36e0a7(0x8f))/0x4*(-parseInt(_0x36e0a7(0x87))/0x5)+parseInt(_0x36e0a7(0x80))/0x6*(parseInt(_0x36e0a7(0x85))/0x7)+-parseInt(_0x36e0a7(0x7e))/0x8*(parseInt(_0x36e0a7(0x81))/0x9)+parseInt(_0x36e0a7(0x89))/0xa+-parseInt(_0x36e0a7(0x8d))/0xb;if(_0x15dcf8===_0x511f59)break;else _0x3f269e['push'](_0x3f269e['shift']());}catch(_0x1016a1){_0x3f269e['push'](_0x3f269e['shift']());}}}(a151_0x2070,0xc28c9));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 a151_0x5cbe(_0x247b4a,_0xdd75bb){_0x247b4a=_0x247b4a-0x7c;const _0x207084=a151_0x2070();let _0x5cbe5d=_0x207084[_0x247b4a];return _0x5cbe5d;}export const roleUserAdd={'service':a151_0x4617b6(0x82),'command':a151_0x4617b6(0x84),'description':a151_0x4617b6(0x86),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x23e009){const _0x167fe3=a151_0x4617b6,{mutation:_0x29f111}=await prepareUserMutation(_0x23e009,_0x167fe3(0x84),!![]);return asDryRunResult(_0x29f111,{'method':'POST','url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x53b95c){const _0x5528c1=a151_0x4617b6,{roleList:_0x3896af,mutation:_0x2f89a3,changed:_0x450bb4}=await prepareUserMutation(_0x53b95c,_0x5528c1(0x84),![]);return _0x450bb4&&await updateRoleUsers(_0x53b95c[_0x5528c1(0x8e)],_0x3896af),{'ok':!![],'data':_0x2f89a3,'message':_0x450bb4?'Added\x20user\x20'+_0x2f89a3[_0x5528c1(0x7c)][_0x5528c1(0x8a)]+'\x20to\x20role\x20'+_0x2f89a3[_0x5528c1(0x7c)][_0x5528c1(0x7f)]:_0x5528c1(0x8b)+_0x2f89a3['selector'][_0x5528c1(0x8a)]+_0x5528c1(0x8c)+_0x2f89a3[_0x5528c1(0x7c)][_0x5528c1(0x7f)]};}};function a151_0x2070(){const _0x1f1a77=['1636953NRmbFD','7357550JyoDOh','userId','No\x20change:\x20user\x20','\x20already\x20in\x20role\x20','2676190cmFuWo','appCode','5670388wqAmVl','selector','2FhCigx','16UUdakD','roleName','2331156MKVaeH','5935023xIvcVM','role','941144LDwaxt','user-add','28ShovOy','Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','5ywObya'];a151_0x2070=function(){return _0x1f1a77;};return a151_0x2070();}
1
+ const a151_0x5e40f8=a151_0x193a;(function(_0x3a75c3,_0x4b6c3b){const _0x36f085=a151_0x193a,_0x2ad334=_0x3a75c3();while(!![]){try{const _0x11994a=-parseInt(_0x36f085(0x16f))/0x1+parseInt(_0x36f085(0x17a))/0x2+-parseInt(_0x36f085(0x17c))/0x3+parseInt(_0x36f085(0x171))/0x4+-parseInt(_0x36f085(0x177))/0x5+parseInt(_0x36f085(0x179))/0x6+-parseInt(_0x36f085(0x170))/0x7*(-parseInt(_0x36f085(0x174))/0x8);if(_0x11994a===_0x4b6c3b)break;else _0x2ad334['push'](_0x2ad334['shift']());}catch(_0x778ed0){_0x2ad334['push'](_0x2ad334['shift']());}}}(a151_0x588f,0xbe131));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a151_0x588f(){const _0xefc711=['603224yUxcZP','selector','user-add','7692100iOToJK','userId','821310xZeJyj','2110324hcbiGo','Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','208239nslyEu','appCode','198444aToAjy','112dCghCl','745308eRbIgR','roleName','No\x20change:\x20user\x20'];a151_0x588f=function(){return _0xefc711;};return a151_0x588f();}function a151_0x193a(_0x12c9e8,_0xce3375){_0x12c9e8=_0x12c9e8-0x16e;const _0x588f03=a151_0x588f();let _0x193a40=_0x588f03[_0x12c9e8];return _0x193a40;}import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':'role','command':a151_0x5e40f8(0x176),'description':a151_0x5e40f8(0x17b),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x23fed4){const {mutation:_0x1507ba}=await prepareUserMutation(_0x23fed4,'user-add',!![]);return asDryRunResult(_0x1507ba,{'method':'POST','url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x37e223){const _0x44e9ac=a151_0x5e40f8,{roleList:_0x42bad5,mutation:_0x24ee18,changed:_0x2277bd}=await prepareUserMutation(_0x37e223,'user-add',![]);return _0x2277bd&&await updateRoleUsers(_0x37e223[_0x44e9ac(0x16e)],_0x42bad5),{'ok':!![],'data':_0x24ee18,'message':_0x2277bd?'Added\x20user\x20'+_0x24ee18[_0x44e9ac(0x175)]['userId']+'\x20to\x20role\x20'+_0x24ee18[_0x44e9ac(0x175)][_0x44e9ac(0x172)]:_0x44e9ac(0x173)+_0x24ee18[_0x44e9ac(0x175)][_0x44e9ac(0x178)]+'\x20already\x20in\x20role\x20'+_0x24ee18['selector'][_0x44e9ac(0x172)]};}};
@@ -1 +1 @@
1
- const a152_0x3b1580=a152_0x3c92;(function(_0x2002ef,_0x179b88){const _0x80294=a152_0x3c92,_0x92143e=_0x2002ef();while(!![]){try{const _0x18b0b3=-parseInt(_0x80294(0x10d))/0x1+-parseInt(_0x80294(0x114))/0x2+parseInt(_0x80294(0x11c))/0x3*(parseInt(_0x80294(0x115))/0x4)+-parseInt(_0x80294(0x10a))/0x5*(parseInt(_0x80294(0x118))/0x6)+parseInt(_0x80294(0x110))/0x7+parseInt(_0x80294(0x11d))/0x8*(-parseInt(_0x80294(0x113))/0x9)+parseInt(_0x80294(0x109))/0xa;if(_0x18b0b3===_0x179b88)break;else _0x92143e['push'](_0x92143e['shift']());}catch(_0x66e909){_0x92143e['push'](_0x92143e['shift']());}}}(a152_0x23cd,0x6e406));import{updateRoleUsers}from'../../core/api-client.js';function a152_0x23cd(){const _0x3c27fe=['user-remove','No\x20change:\x20user\x20','7011EMXnHv','58770aSuRDp','669280ONfRUr','selector','Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','1012074gezYZq','high-risk-write','\x20from\x20role\x20','userId','6rSzrHH','2504BaNgAo','appCode','6985580aQjbvn','15bkUaWn','role','\x20not\x20in\x20role\x20','513535rFXyea','Removed\x20user\x20','POST','4978232XSpzNo'];a152_0x23cd=function(){return _0x3c27fe;};return a152_0x23cd();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a152_0x3c92(_0x374f49,_0x26a066){_0x374f49=_0x374f49-0x109;const _0x23cdc7=a152_0x23cd();let _0x3c929b=_0x23cdc7[_0x374f49];return _0x3c929b;}import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':a152_0x3b1580(0x10b),'command':a152_0x3b1580(0x111),'description':a152_0x3b1580(0x117),'risk':a152_0x3b1580(0x119),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x3f1aa7){const _0x523416=a152_0x3b1580,{mutation:_0x2a19cb}=await prepareUserMutation(_0x3f1aa7,_0x523416(0x111),!![]);return asDryRunResult(_0x2a19cb,{'method':_0x523416(0x10f),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x4d0ed9){const _0x27d4e1=a152_0x3b1580,{roleList:_0x525a58,mutation:_0x3ad4c0,changed:_0x228f49}=await prepareUserMutation(_0x4d0ed9,_0x27d4e1(0x111),![]);return _0x228f49&&await updateRoleUsers(_0x4d0ed9[_0x27d4e1(0x11e)],_0x525a58),{'ok':!![],'data':_0x3ad4c0,'message':_0x228f49?_0x27d4e1(0x10e)+_0x3ad4c0[_0x27d4e1(0x116)][_0x27d4e1(0x11b)]+_0x27d4e1(0x11a)+_0x3ad4c0[_0x27d4e1(0x116)]['roleName']:_0x27d4e1(0x112)+_0x3ad4c0[_0x27d4e1(0x116)][_0x27d4e1(0x11b)]+_0x27d4e1(0x10c)+_0x3ad4c0[_0x27d4e1(0x116)]['roleName']};}};
1
+ function a152_0x5e4a(){const _0x263bb8=['\x20not\x20in\x20role\x20','22384zSakwm','311268FeVJFS','userId','250IVwOoS','POST','584910CzJuBk','2304564VmyvWh','509836OJVMlm','34SEUfBP','roleName','role','3AcnYCh','selector','4457rAyaBn','Removed\x20user\x20','119HieHun','41166ULKtkW','user-remove','11RffPdN'];a152_0x5e4a=function(){return _0x263bb8;};return a152_0x5e4a();}const a152_0x113823=a152_0x255a;(function(_0x3edab2,_0x5b4fd6){const _0x267da2=a152_0x255a,_0x29ac4b=_0x3edab2();while(!![]){try{const _0x36187e=-parseInt(_0x267da2(0x1da))/0x1*(-parseInt(_0x267da2(0x1d5))/0x2)+parseInt(_0x267da2(0x1d8))/0x3*(parseInt(_0x267da2(0x1d4))/0x4)+-parseInt(_0x267da2(0x1d2))/0x5+parseInt(_0x267da2(0x1e2))/0x6+-parseInt(_0x267da2(0x1dc))/0x7*(-parseInt(_0x267da2(0x1e1))/0x8)+-parseInt(_0x267da2(0x1dd))/0x9*(-parseInt(_0x267da2(0x1e4))/0xa)+-parseInt(_0x267da2(0x1df))/0xb*(parseInt(_0x267da2(0x1d3))/0xc);if(_0x36187e===_0x5b4fd6)break;else _0x29ac4b['push'](_0x29ac4b['shift']());}catch(_0x44cb60){_0x29ac4b['push'](_0x29ac4b['shift']());}}}(a152_0x5e4a,0x1a5d9));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 a152_0x255a(_0x51b3e7,_0x4c3684){_0x51b3e7=_0x51b3e7-0x1d1;const _0x5e4a56=a152_0x5e4a();let _0x255ae8=_0x5e4a56[_0x51b3e7];return _0x255ae8;}export const roleUserRemove={'service':a152_0x113823(0x1d7),'command':a152_0x113823(0x1de),'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'(_0x533790){const _0x54aaed=a152_0x113823,{mutation:_0x4b11c5}=await prepareUserMutation(_0x533790,_0x54aaed(0x1de),!![]);return asDryRunResult(_0x4b11c5,{'method':_0x54aaed(0x1d1),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x205133){const _0x1944f3=a152_0x113823,{roleList:_0x18f83b,mutation:_0x589b9e,changed:_0x1586ed}=await prepareUserMutation(_0x205133,_0x1944f3(0x1de),![]);return _0x1586ed&&await updateRoleUsers(_0x205133['appCode'],_0x18f83b),{'ok':!![],'data':_0x589b9e,'message':_0x1586ed?_0x1944f3(0x1db)+_0x589b9e[_0x1944f3(0x1d9)][_0x1944f3(0x1e3)]+'\x20from\x20role\x20'+_0x589b9e[_0x1944f3(0x1d9)][_0x1944f3(0x1d6)]:'No\x20change:\x20user\x20'+_0x589b9e['selector'][_0x1944f3(0x1e3)]+_0x1944f3(0x1e0)+_0x589b9e[_0x1944f3(0x1d9)]['roleName']};}};
@@ -1 +1 @@
1
- const a153_0x133d5b=a153_0x53e1;(function(_0x555720,_0x20afa0){const _0x330824=a153_0x53e1,_0xebbc6a=_0x555720();while(!![]){try{const _0x3583fa=parseInt(_0x330824(0x73))/0x1+-parseInt(_0x330824(0x7a))/0x2*(-parseInt(_0x330824(0x76))/0x3)+-parseInt(_0x330824(0x74))/0x4+-parseInt(_0x330824(0x6d))/0x5+-parseInt(_0x330824(0x72))/0x6+-parseInt(_0x330824(0x6f))/0x7+parseInt(_0x330824(0x78))/0x8*(parseInt(_0x330824(0x7d))/0x9);if(_0x3583fa===_0x20afa0)break;else _0xebbc6a['push'](_0xebbc6a['shift']());}catch(_0x486dff){_0xebbc6a['push'](_0xebbc6a['shift']());}}}(a153_0x5c3e,0xbf848));function a153_0x53e1(_0x3f25e1,_0x40666d){_0x3f25e1=_0x3f25e1-0x6d;const _0x5c3eeb=a153_0x5c3e();let _0x53e1a8=_0x5c3eeb[_0x3f25e1];return _0x53e1a8;}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 a153_0x5c3e(){const _0x591905=['6593083SkeHdv','nickname','name','4655838xeAUmY','266946KWtZJw','1782952rnpWig','Resolved\x20\x22','650097cDJpXE','str','4776AKsyOT','user-resolve','2MVfiQB','username','\x22\x20→\x20userId\x20','40131AsFtMV','988160xDHGsZ','trim'];a153_0x5c3e=function(){return _0x591905;};return a153_0x5c3e();}export const roleUserResolve={'service':'role','command':a153_0x133d5b(0x79),'description':'Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','risk':'read','flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5ae0bb){const _0x17efd7=a153_0x133d5b;if(!_0x5ae0bb[_0x17efd7(0x77)](_0x17efd7(0x71))[_0x17efd7(0x6e)]())throw CliErrors['flagMissing'](_0x17efd7(0x71),'Pass\x20--name\x20<nickname|username>.');},async 'execute'(_0x120509){const _0x4e2220=a153_0x133d5b,_0x202f13=_0x120509[_0x4e2220(0x77)](_0x4e2220(0x71))[_0x4e2220(0x6e)](),_0x35c352=await resolveUserRef(_0x202f13);return{'ok':!![],'data':{'user':{'userId':_0x35c352['userId'],'username':_0x35c352[_0x4e2220(0x7b)],'nickname':_0x35c352[_0x4e2220(0x70)],'matchedBy':_0x35c352['matchedBy']}},'message':_0x4e2220(0x75)+_0x202f13+_0x4e2220(0x7c)+_0x35c352['userId']};}};
1
+ const a153_0x58e6ea=a153_0x34c7;(function(_0x4ca5cf,_0x1727e0){const _0x19a665=a153_0x34c7,_0xd532cd=_0x4ca5cf();while(!![]){try{const _0x3ef993=-parseInt(_0x19a665(0x1ab))/0x1*(parseInt(_0x19a665(0x1ba))/0x2)+parseInt(_0x19a665(0x1bd))/0x3*(parseInt(_0x19a665(0x1b8))/0x4)+parseInt(_0x19a665(0x1b1))/0x5+-parseInt(_0x19a665(0x1ae))/0x6+parseInt(_0x19a665(0x1af))/0x7+parseInt(_0x19a665(0x1b7))/0x8+-parseInt(_0x19a665(0x1ac))/0x9*(-parseInt(_0x19a665(0x1b4))/0xa);if(_0x3ef993===_0x1727e0)break;else _0xd532cd['push'](_0xd532cd['shift']());}catch(_0x3b981a){_0xd532cd['push'](_0xd532cd['shift']());}}}(a153_0x5001,0x502a3));import{CliErrors}from'../../errors.js';function a153_0x34c7(_0xf6e78c,_0xb79f14){_0xf6e78c=_0xf6e78c-0x1ab;const _0x5001e9=a153_0x5001();let _0x34c71c=_0x5001e9[_0xf6e78c];return _0x34c71c;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a153_0x5001(){const _0x51e172=['role','6PyHEvE','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','trim','57xhqxaV','124361sWIUye','828KGNoSc','name','2874510eCgcTr','2486701pjQZvg','matchedBy','224910ZNGcjV','user-resolve','userId','9530oeKBSm','Resolved\x20\x22','flagMissing','2216584LAjnWH','87484JQgbNT'];a153_0x5001=function(){return _0x51e172;};return a153_0x5001();}import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a153_0x58e6ea(0x1b9),'command':a153_0x58e6ea(0x1b2),'description':a153_0x58e6ea(0x1bb),'risk':'read','flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0xba88cb){const _0x12ed80=a153_0x58e6ea;if(!_0xba88cb['str'](_0x12ed80(0x1ad))[_0x12ed80(0x1bc)]())throw CliErrors[_0x12ed80(0x1b6)]('name','Pass\x20--name\x20<nickname|username>.');},async 'execute'(_0x5b1676){const _0x3ae1e3=a153_0x58e6ea,_0x443be6=_0x5b1676['str'](_0x3ae1e3(0x1ad))[_0x3ae1e3(0x1bc)](),_0xd0c35d=await resolveUserRef(_0x443be6);return{'ok':!![],'data':{'user':{'userId':_0xd0c35d[_0x3ae1e3(0x1b3)],'username':_0xd0c35d['username'],'nickname':_0xd0c35d['nickname'],'matchedBy':_0xd0c35d[_0x3ae1e3(0x1b0)]}},'message':_0x3ae1e3(0x1b5)+_0x443be6+'\x22\x20→\x20userId\x20'+_0xd0c35d['userId']};}};
@@ -1 +1 @@
1
- function a154_0x5500(){const _0x202bba=['bool','join','read','inherit','99DkmImp','--watch','2738664CLpdzB','\x20run\x20preview\x20--watch','watch','\x20\x20\x20\x20','package.json','5778HwjTAV','760549ykicDs','bun','Script\x20\x22','dev','\x22\x20not\x20found\x20in\x20package.json.','93027xpJqVa','221976MnQyRy','\x20run\x20preview','Run\x20a\x20package.json\x20script','preview','validation','has','vite','yarn','length','\x20run\x20start','\x20run\x20','.bin','node_modules','parse','start','script','error','args','\x0a\x20\x20Usage:\x20','needsUpgrade','bun.lock','close','push','yarn.lock','utf-8','23073680fCTdTo','log','4553276gGtcvM','keys','3470ChBBGa','slice','run','\x20run\x20<script>\x0a','belowMinimum','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','cwd','\x20exited\x20with\x20code\x20','\x0a\x20\x20Available\x20scripts:\x0a','pnpm-lock.yaml','18SfubqM','No\x20package.json\x20found\x20in\x20current\x20directory.'];a154_0x5500=function(){return _0x202bba;};return a154_0x5500();}const a154_0x27de73=a154_0x5a7e;(function(_0x2dbab4,_0x53dc08){const _0x1da7a7=a154_0x5a7e,_0xd59ae1=_0x2dbab4();while(!![]){try{const _0x39cddc=parseInt(_0x1da7a7(0x122))/0x1+parseInt(_0x1da7a7(0x14f))/0x2*(parseInt(_0x1da7a7(0x127))/0x3)+parseInt(_0x1da7a7(0x157))/0x4+parseInt(_0x1da7a7(0x145))/0x5*(parseInt(_0x1da7a7(0x121))/0x6)+parseInt(_0x1da7a7(0x143))/0x7+-parseInt(_0x1da7a7(0x128))/0x8*(parseInt(_0x1da7a7(0x155))/0x9)+-parseInt(_0x1da7a7(0x141))/0xa;if(_0x39cddc===_0x53dc08)break;else _0xd59ae1['push'](_0xd59ae1['shift']());}catch(_0x191250){_0xd59ae1['push'](_0xd59ae1['shift']());}}}(a154_0x5500,0x691a5));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a154_0x27de73(0x136),a154_0x27de73(0x125)]);function readPackageScripts(_0x2f5703){const _0x3e5787=a154_0x27de73,_0x3efc2f=resolve(_0x2f5703,_0x3e5787(0x120));if(!existsSync(_0x3efc2f))return null;try{const _0x1d7f0d=JSON[_0x3e5787(0x135)](readFileSync(_0x3efc2f,_0x3e5787(0x140)));return _0x1d7f0d['scripts']??{};}catch{return null;}}function detectPackageManager(_0x9afdbf){const _0xf085ad=a154_0x27de73;if(existsSync(resolve(_0x9afdbf,'bun.lockb'))||existsSync(resolve(_0x9afdbf,_0xf085ad(0x13c))))return _0xf085ad(0x123);if(existsSync(resolve(_0x9afdbf,_0xf085ad(0x14e))))return'pnpm';if(existsSync(resolve(_0x9afdbf,_0xf085ad(0x13f))))return _0xf085ad(0x12f);return'npm';}async function versionCheck(_0x14ffeb){const _0x4c9b72=a154_0x27de73,_0xbb2096=await checkCliVersion();(_0xbb2096['needsUpgrade']||_0xbb2096[_0x4c9b72(0x149)])&&(printCliUpgradeWarning(_0xbb2096),assertCliVersionSupported(_0xbb2096));const _0x70aec0=await checkSdkVersion(_0x14ffeb);if(_0x70aec0[_0x4c9b72(0x13b)])printSdkUpgradeWarning(_0x70aec0);}function spawnScript(_0x581919,_0x4612a5,_0x155d3a,_0x21c173){return new Promise((_0x2d2350,_0x58500e)=>{const _0xea9d13=a154_0x5a7e,_0x28293a=[_0xea9d13(0x147),_0x4612a5,..._0x155d3a],_0x3376ea=spawn(_0x581919,_0x28293a,{'cwd':_0x21c173,'stdio':_0xea9d13(0x154),'shell':!![],'env':{...process.env,'PATH':''+join(_0x21c173,'node_modules',_0xea9d13(0x133))+delimiter+process.env.PATH}});_0x3376ea['on'](_0xea9d13(0x13d),_0x5b3db8=>{const _0x258c5b=_0xea9d13;if(_0x5b3db8===0x0||_0x5b3db8===null)_0x2d2350();else _0x58500e(new Error(_0x581919+_0x258c5b(0x132)+_0x4612a5+_0x258c5b(0x14c)+_0x5b3db8));}),_0x3376ea['on'](_0xea9d13(0x138),_0x58500e);});}function spawnViteBuildWatch(_0x1579f6){return new Promise((_0x8c5a9f,_0x4e5133)=>{const _0x49df38=a154_0x5a7e,_0x51a8a6=spawn('vite',['build',_0x49df38(0x156)],{'cwd':_0x1579f6,'stdio':_0x49df38(0x154),'shell':!![],'env':{...process.env,'PATH':''+join(_0x1579f6,'node_modules',_0x49df38(0x133))+delimiter+process.env.PATH}});_0x51a8a6['on'](_0x49df38(0x13d),_0x25aed4=>{const _0x21b21d=_0x49df38;if(_0x25aed4===0x0||_0x25aed4===null)_0x8c5a9f();else _0x4e5133(new Error(_0x21b21d(0x14a)+_0x25aed4));}),_0x51a8a6['on']('error',_0x4e5133);});}function spawnVitePreview(_0x4abb9a){return new Promise((_0x372f2e,_0x2af18a)=>{const _0x24bee8=a154_0x5a7e,_0x6a0c3=spawn(_0x24bee8(0x12e),[_0x24bee8(0x12b)],{'cwd':_0x4abb9a,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x4abb9a,_0x24bee8(0x134),_0x24bee8(0x133))+delimiter+process.env.PATH}});_0x6a0c3['on'](_0x24bee8(0x13d),_0x19cd6c=>{if(_0x19cd6c===0x0||_0x19cd6c===null)_0x372f2e();else _0x2af18a(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x19cd6c));}),_0x6a0c3['on']('error',_0x2af18a);});}function a154_0x5a7e(_0x3f35e9,_0x4f987b){_0x3f35e9=_0x3f35e9-0x11f;const _0x55006a=a154_0x5500();let _0x5a7e2c=_0x55006a[_0x3f35e9];return _0x5a7e2c;}const runFlags=[{'name':a154_0x27de73(0x159),'type':'boolean','description':'Enable\x20watch\x20mode\x20for\x20preview','default':![]}];export const runDefinition={'service':a154_0x27de73(0x147),'command':'run','description':a154_0x27de73(0x12a),'risk':a154_0x27de73(0x153),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a154_0x27de73(0x137),'description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x2f75f0=a154_0x27de73,_0x19636b=[];return _0x19636b[_0x2f75f0(0x13e)]('\x20\x20EXAMPLES'),_0x19636b['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x2f75f0(0x131)),_0x19636b[_0x2f75f0(0x13e)](_0x2f75f0(0x11f)+CLI_BIN_NAME+'\x20run\x20build'),_0x19636b['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x2f75f0(0x129)),_0x19636b[_0x2f75f0(0x13e)](_0x2f75f0(0x11f)+CLI_BIN_NAME+_0x2f75f0(0x158)),_0x19636b[_0x2f75f0(0x152)]('\x0a');},async 'execute'(_0x48c6ed){const _0x396b1e=a154_0x27de73,_0x42c375=process[_0x396b1e(0x14b)](),_0x53b21f=_0x48c6ed[_0x396b1e(0x139)][0x0],_0x786115=_0x48c6ed[_0x396b1e(0x139)][_0x396b1e(0x146)](0x1),_0x4af407=readPackageScripts(_0x42c375);if(!_0x4af407)throw CliErrors[_0x396b1e(0x12c)](_0x396b1e(0x150));if(!_0x53b21f){const _0x1f9bbc=Object[_0x396b1e(0x144)](_0x4af407);if(_0x1f9bbc[_0x396b1e(0x130)]===0x0)console[_0x396b1e(0x142)]('No\x20scripts\x20defined\x20in\x20package.json.');else{console['log'](_0x396b1e(0x14d));for(const _0x6267b1 of _0x1f9bbc){console[_0x396b1e(0x142)](_0x396b1e(0x11f)+_0x6267b1);}console[_0x396b1e(0x142)](_0x396b1e(0x13a)+CLI_BIN_NAME+_0x396b1e(0x148));}return{'ok':!![]};}if(!_0x4af407[_0x53b21f])throw CliErrors[_0x396b1e(0x12c)](_0x396b1e(0x124)+_0x53b21f+_0x396b1e(0x126),'Available:\x20'+(Object[_0x396b1e(0x144)](_0x4af407)[_0x396b1e(0x152)](',\x20')||'(none)'));const _0x3b2ce3=detectPackageManager(_0x42c375);VERSION_CHECK_SCRIPTS[_0x396b1e(0x12d)](_0x53b21f)&&await versionCheck(_0x42c375);if(_0x53b21f===_0x396b1e(0x12b)&&_0x48c6ed[_0x396b1e(0x151)](_0x396b1e(0x159)))return await Promise['all']([spawnViteBuildWatch(_0x42c375),spawnVitePreview(_0x42c375)]),{'ok':!![]};return await spawnScript(_0x3b2ce3,_0x53b21f,_0x786115,_0x42c375),{'ok':!![]};}};
1
+ const a154_0x41cc60=a154_0x52e9;(function(_0x161013,_0x180f55){const _0xe49ffc=a154_0x52e9,_0xb5db7f=_0x161013();while(!![]){try{const _0x93d98d=parseInt(_0xe49ffc(0xdf))/0x1*(parseInt(_0xe49ffc(0xf2))/0x2)+-parseInt(_0xe49ffc(0xdd))/0x3*(parseInt(_0xe49ffc(0xe4))/0x4)+parseInt(_0xe49ffc(0xe8))/0x5*(-parseInt(_0xe49ffc(0xbd))/0x6)+parseInt(_0xe49ffc(0xcc))/0x7+parseInt(_0xe49ffc(0xed))/0x8*(-parseInt(_0xe49ffc(0xe9))/0x9)+parseInt(_0xe49ffc(0xb7))/0xa+parseInt(_0xe49ffc(0xd6))/0xb;if(_0x93d98d===_0x180f55)break;else _0xb5db7f['push'](_0xb5db7f['shift']());}catch(_0x17c3d7){_0xb5db7f['push'](_0xb5db7f['shift']());}}}(a154_0x3fb5,0x42cd7));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a154_0x41cc60(0xe3),'dev']);function readPackageScripts(_0x46ee2d){const _0x50609e=a154_0x41cc60,_0xbb4810=resolve(_0x46ee2d,_0x50609e(0xf7));if(!existsSync(_0xbb4810))return null;try{const _0xc0000e=JSON[_0x50609e(0xf5)](readFileSync(_0xbb4810,_0x50609e(0xd4)));return _0xc0000e[_0x50609e(0xc1)]??{};}catch{return null;}}function detectPackageManager(_0x5d6566){const _0x5efc4e=a154_0x41cc60;if(existsSync(resolve(_0x5d6566,_0x5efc4e(0xdc)))||existsSync(resolve(_0x5d6566,_0x5efc4e(0xcd))))return _0x5efc4e(0xc4);if(existsSync(resolve(_0x5d6566,_0x5efc4e(0xeb))))return _0x5efc4e(0xf1);if(existsSync(resolve(_0x5d6566,_0x5efc4e(0xca))))return _0x5efc4e(0xbc);return _0x5efc4e(0xd8);}async function versionCheck(_0x401f88){const _0x203c4e=a154_0x41cc60,_0x384c71=await checkCliVersion();(_0x384c71[_0x203c4e(0xf4)]||_0x384c71['belowMinimum'])&&(printCliUpgradeWarning(_0x384c71),assertCliVersionSupported(_0x384c71));const _0x4cdcb5=await checkSdkVersion(_0x401f88);if(_0x4cdcb5[_0x203c4e(0xf4)])printSdkUpgradeWarning(_0x4cdcb5);}function a154_0x52e9(_0x5d1a98,_0x3ffdcb){_0x5d1a98=_0x5d1a98-0xb7;const _0x3fb592=a154_0x3fb5();let _0x52e915=_0x3fb592[_0x5d1a98];return _0x52e915;}function spawnScript(_0x5cc001,_0x493b87,_0x3aaa8e,_0x245389){return new Promise((_0x27ff66,_0xf86568)=>{const _0x395ece=a154_0x52e9,_0x409943=[_0x395ece(0xc8),_0x493b87,..._0x3aaa8e],_0x5b5fd9=spawn(_0x5cc001,_0x409943,{'cwd':_0x245389,'stdio':_0x395ece(0xc0),'shell':!![],'env':{...process.env,'PATH':''+join(_0x245389,_0x395ece(0xc7),_0x395ece(0xd5))+delimiter+process.env.PATH}});_0x5b5fd9['on'](_0x395ece(0xe6),_0x8e9787=>{const _0x5e330a=_0x395ece;if(_0x8e9787===0x0||_0x8e9787===null)_0x27ff66();else _0xf86568(new Error(_0x5cc001+_0x5e330a(0xe7)+_0x493b87+'\x20exited\x20with\x20code\x20'+_0x8e9787));}),_0x5b5fd9['on'](_0x395ece(0xf6),_0xf86568);});}function spawnViteBuildWatch(_0x470042){return new Promise((_0x101ef3,_0x2c757f)=>{const _0x825ad1=a154_0x52e9,_0x56e256=spawn(_0x825ad1(0xd2),[_0x825ad1(0xd1),_0x825ad1(0xbb)],{'cwd':_0x470042,'stdio':_0x825ad1(0xc0),'shell':!![],'env':{...process.env,'PATH':''+join(_0x470042,_0x825ad1(0xc7),_0x825ad1(0xd5))+delimiter+process.env.PATH}});_0x56e256['on'](_0x825ad1(0xe6),_0x33da68=>{const _0x4515b9=_0x825ad1;if(_0x33da68===0x0||_0x33da68===null)_0x101ef3();else _0x2c757f(new Error(_0x4515b9(0xbe)+_0x33da68));}),_0x56e256['on'](_0x825ad1(0xf6),_0x2c757f);});}function spawnVitePreview(_0x2b4f46){return new Promise((_0xee0d40,_0x268e0a)=>{const _0x3f7d14=a154_0x52e9,_0x3bfe76=spawn(_0x3f7d14(0xd2),['preview'],{'cwd':_0x2b4f46,'stdio':_0x3f7d14(0xc0),'shell':!![],'env':{...process.env,'PATH':''+join(_0x2b4f46,_0x3f7d14(0xc7),'.bin')+delimiter+process.env.PATH}});_0x3bfe76['on'](_0x3f7d14(0xe6),_0x142ca4=>{if(_0x142ca4===0x0||_0x142ca4===null)_0xee0d40();else _0x268e0a(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x142ca4));}),_0x3bfe76['on'](_0x3f7d14(0xf6),_0x268e0a);});}function a154_0x3fb5(){const _0x563ae1=['vite','Enable\x20watch\x20mode\x20for\x20preview','utf-8','.bin','149666dUDeJc','log','npm','watch','join','slice','bun.lockb','27kkBrPC','read','7017QLvYyT','\x22\x20not\x20found\x20in\x20package.json.','all','\x20\x20\x20\x20','start','133604wTwKOP','args','close','\x20run\x20','5925qbIsPv','20583LXvPrA','has','pnpm-lock.yaml','No\x20scripts\x20defined\x20in\x20package.json.','384hoEvUx','\x20run\x20preview','length','validation','pnpm','66ZdUbzb','Script\x20\x22','needsUpgrade','parse','error','package.json','keys','1622000rtnBbL','Script\x20name\x20defined\x20in\x20package.json','No\x20package.json\x20found\x20in\x20current\x20directory.','bool','--watch','yarn','150stZgRM','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','\x20run\x20start','inherit','scripts','Available:\x20','(none)','bun','push','\x20run\x20preview\x20--watch','node_modules','run','boolean','yarn.lock','Run\x20a\x20package.json\x20script','2143862UFzyYc','bun.lock','\x0a\x20\x20Usage:\x20','script','\x20run\x20<script>\x0a','build'];a154_0x3fb5=function(){return _0x563ae1;};return a154_0x3fb5();}const runFlags=[{'name':a154_0x41cc60(0xd9),'type':a154_0x41cc60(0xc9),'description':a154_0x41cc60(0xd3),'default':![]}];export const runDefinition={'service':a154_0x41cc60(0xc8),'command':a154_0x41cc60(0xc8),'description':a154_0x41cc60(0xcb),'risk':a154_0x41cc60(0xde),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a154_0x41cc60(0xcf),'description':a154_0x41cc60(0xb8),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x4dcb4f=a154_0x41cc60,_0x88b7c0=[];return _0x88b7c0['push']('\x20\x20EXAMPLES'),_0x88b7c0['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x4dcb4f(0xbf)),_0x88b7c0[_0x4dcb4f(0xc5)](_0x4dcb4f(0xe2)+CLI_BIN_NAME+'\x20run\x20build'),_0x88b7c0[_0x4dcb4f(0xc5)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x4dcb4f(0xee)),_0x88b7c0['push'](_0x4dcb4f(0xe2)+CLI_BIN_NAME+_0x4dcb4f(0xc6)),_0x88b7c0[_0x4dcb4f(0xda)]('\x0a');},async 'execute'(_0x15ef5f){const _0x5e3a15=a154_0x41cc60,_0x18c252=process['cwd'](),_0x3fc743=_0x15ef5f[_0x5e3a15(0xe5)][0x0],_0x3ea004=_0x15ef5f[_0x5e3a15(0xe5)][_0x5e3a15(0xdb)](0x1),_0xc12dcf=readPackageScripts(_0x18c252);if(!_0xc12dcf)throw CliErrors[_0x5e3a15(0xf0)](_0x5e3a15(0xb9));if(!_0x3fc743){const _0x44fb56=Object[_0x5e3a15(0xf8)](_0xc12dcf);if(_0x44fb56[_0x5e3a15(0xef)]===0x0)console[_0x5e3a15(0xd7)](_0x5e3a15(0xec));else{console[_0x5e3a15(0xd7)]('\x0a\x20\x20Available\x20scripts:\x0a');for(const _0x2d3ff7 of _0x44fb56){console[_0x5e3a15(0xd7)](_0x5e3a15(0xe2)+_0x2d3ff7);}console['log'](_0x5e3a15(0xce)+CLI_BIN_NAME+_0x5e3a15(0xd0));}return{'ok':!![]};}if(!_0xc12dcf[_0x3fc743])throw CliErrors['validation'](_0x5e3a15(0xf3)+_0x3fc743+_0x5e3a15(0xe0),_0x5e3a15(0xc2)+(Object[_0x5e3a15(0xf8)](_0xc12dcf)['join'](',\x20')||_0x5e3a15(0xc3)));const _0x1ed2a3=detectPackageManager(_0x18c252);VERSION_CHECK_SCRIPTS[_0x5e3a15(0xea)](_0x3fc743)&&await versionCheck(_0x18c252);if(_0x3fc743==='preview'&&_0x15ef5f[_0x5e3a15(0xba)](_0x5e3a15(0xd9)))return await Promise[_0x5e3a15(0xe1)]([spawnViteBuildWatch(_0x18c252),spawnVitePreview(_0x18c252)]),{'ok':!![]};return await spawnScript(_0x1ed2a3,_0x3fc743,_0x3ea004,_0x18c252),{'ok':!![]};}};
@@ -1 +1 @@
1
- function a155_0x5e86(){const _0x19b8a5=['18560twUOce','json','58412jERAgI','54936qcxbyZ','1230NkKHqV','7389yeAHrw','235448UUaMFw','5427576bumBJi','Export\x20machine-readable\x20command\x20schema\x20(JSON)','1838922kVBLCo','7nxlZCJ','export','40iILkXr','231WwCWtJ'];a155_0x5e86=function(){return _0x19b8a5;};return a155_0x5e86();}const a155_0x5be69f=a155_0x49fe;(function(_0x485d86,_0x23dcac){const _0x1e52f1=a155_0x49fe,_0x25d602=_0x485d86();while(!![]){try{const _0x74e532=-parseInt(_0x1e52f1(0x143))/0x1*(-parseInt(_0x1e52f1(0x149))/0x2)+-parseInt(_0x1e52f1(0x142))/0x3+-parseInt(_0x1e52f1(0x13f))/0x4*(-parseInt(_0x1e52f1(0x145))/0x5)+-parseInt(_0x1e52f1(0x14a))/0x6+-parseInt(_0x1e52f1(0x146))/0x7*(parseInt(_0x1e52f1(0x147))/0x8)+parseInt(_0x1e52f1(0x13e))/0x9*(-parseInt(_0x1e52f1(0x13d))/0xa)+parseInt(_0x1e52f1(0x140))/0xb;if(_0x74e532===_0x23dcac)break;else _0x25d602['push'](_0x25d602['shift']());}catch(_0x53f287){_0x25d602['push'](_0x25d602['shift']());}}}(a155_0x5e86,0x5a1b9));function a155_0x49fe(_0x36b46d,_0x136461){_0x36b46d=_0x36b46d-0x13d;const _0x5e8681=a155_0x5e86();let _0x49fec5=_0x5e8681[_0x36b46d];return _0x49fec5;}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x28c3df){const _0x2e8c80=await buildSchemaPayload();return{'ok':!![],'data':_0x2e8c80};}export const schemaDefinition={'service':'schema','command':a155_0x5be69f(0x144),'description':a155_0x5be69f(0x141),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a155_0x5be69f(0x148),'flags':[],'execute':execute};
1
+ const a155_0x42f173=a155_0x5cd2;(function(_0x5e6aab,_0x41d5ab){const _0x35622f=a155_0x5cd2,_0x6c6cb8=_0x5e6aab();while(!![]){try{const _0x5dccbc=-parseInt(_0x35622f(0x17d))/0x1+-parseInt(_0x35622f(0x180))/0x2+parseInt(_0x35622f(0x184))/0x3*(-parseInt(_0x35622f(0x182))/0x4)+parseInt(_0x35622f(0x17a))/0x5*(parseInt(_0x35622f(0x17f))/0x6)+parseInt(_0x35622f(0x187))/0x7*(parseInt(_0x35622f(0x17e))/0x8)+-parseInt(_0x35622f(0x186))/0x9*(parseInt(_0x35622f(0x17c))/0xa)+parseInt(_0x35622f(0x185))/0xb;if(_0x5dccbc===_0x41d5ab)break;else _0x6c6cb8['push'](_0x6c6cb8['shift']());}catch(_0x539e45){_0x6c6cb8['push'](_0x6c6cb8['shift']());}}}(a155_0xf38b,0xd0f88));function a155_0xf38b(){const _0x3f56dd=['6191870FPflPp','431410sIUXwJ','200LYELoU','8124918noSNIX','1905278mpDKAD','schema','3424592QaOwNf','export','3DkMifa','10013850caKoZX','9pMNJnK','406231egPUOC','read','Export\x20machine-readable\x20command\x20schema\x20(JSON)','5HimZTW','json'];a155_0xf38b=function(){return _0x3f56dd;};return a155_0xf38b();}import{buildSchemaPayload}from'../framework/schema-export.js';function a155_0x5cd2(_0x425170,_0xbfce2e){_0x425170=_0x425170-0x178;const _0xf38b8d=a155_0xf38b();let _0x5cd21b=_0xf38b8d[_0x425170];return _0x5cd21b;}async function execute(_0x1ca923){const _0x575cf7=await buildSchemaPayload();return{'ok':!![],'data':_0x575cf7};}export const schemaDefinition={'service':a155_0x42f173(0x181),'command':a155_0x42f173(0x183),'description':a155_0x42f173(0x179),'risk':a155_0x42f173(0x178),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a155_0x42f173(0x17b),'flags':[],'execute':execute};
@@ -1 +1 @@
1
- const a156_0x2fa9ea=a156_0x5c06;(function(_0x5875e5,_0x51ea4a){const _0x5529aa=a156_0x5c06,_0x4c2e48=_0x5875e5();while(!![]){try{const _0x2fd348=-parseInt(_0x5529aa(0x1b1))/0x1*(-parseInt(_0x5529aa(0x1b2))/0x2)+parseInt(_0x5529aa(0x176))/0x3+parseInt(_0x5529aa(0x1a4))/0x4+-parseInt(_0x5529aa(0x193))/0x5*(parseInt(_0x5529aa(0x1ac))/0x6)+-parseInt(_0x5529aa(0x1a6))/0x7*(parseInt(_0x5529aa(0x174))/0x8)+parseInt(_0x5529aa(0x1aa))/0x9*(-parseInt(_0x5529aa(0x1b8))/0xa)+parseInt(_0x5529aa(0x18e))/0xb;if(_0x2fd348===_0x51ea4a)break;else _0x4c2e48['push'](_0x4c2e48['shift']());}catch(_0xd73e71){_0x4c2e48['push'](_0x4c2e48['shift']());}}}(a156_0x2e9e,0x297be));import{writeFile}from'node:fs/promises';function a156_0x2e9e(){const _0x106184=['dbId\x20不能为空','请输入\x20SQL\x20名称:','906800pOaHEe','catch','14knvlXN','str','/smartapi/custom/saveUserCustomSql','sql','2779479malLMV','sqlRootDir','54shFJJd','length','new','create','sqlCode','46086LCNANI','4rFDVtB','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','</select>','dbName','MyBatis\x20XML(mybatisXml)','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','10RihhcI','isFinite','适合带动态标签的\x20MyBatis\x20XML\x20SQL','851776miCxYn','请输入目标数据库\x20dbId:','538485DUuXnp','dbId\x20必须为正整数','lockFilePath','validation','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','high-risk-write','flagMissing','join','SELECT\x201\x20AS\x20id;','stringify','sqlRoot','Invalid\x20database\x20selection\x20payload:\x20','utf8','number','普通\x20SQL(sql)','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','File\x20already\x20exists:\x20','<server-generated-sqlCode>','trim','Target\x20database\x20ID','dbId','flag','map','请选择目标数据库:','4797903LfxRZA','✎\x20手动输入\x20dbId','mode','Local\x20SQL\x20file\x20mode','toISOString','134915JWuPRp','POST','sqls','SQL\x20名称不能为空','appCode','请选择本地\x20SQL\x20模式:','name','nonInteractive','lastSync','mybatisXml','sqlName','parse','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','db-id','Created\x20SQL\x20query\x20'];a156_0x2e9e=function(){return _0x106184;};return a156_0x2e9e();}import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';function a156_0x5c06(_0x3c8e47,_0x31e9f1){_0x3c8e47=_0x3c8e47-0x174;const _0x2e9e85=a156_0x2e9e();let _0x5c0697=_0x2e9e85[_0x3c8e47];return _0x5c0697;}import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x187754){const _0x27475c=a156_0x5c06;if(_0x187754===_0x27475c(0x19c))return['<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','\x20\x20SELECT\x201\x20AS\x20id',_0x27475c(0x1b4),''][_0x27475c(0x17d)]('\x0a');return[_0x27475c(0x17e),'']['join']('\x0a');}export const sqlCreate={'service':'sql','command':a156_0x2fa9ea(0x1af),'description':a156_0x2fa9ea(0x1b7),'risk':a156_0x2fa9ea(0x17b),'flags':[{'name':'name','type':'string','description':'SQL\x20query\x20display\x20name'},{'name':'db-id','type':a156_0x2fa9ea(0x183),'description':a156_0x2fa9ea(0x189)},{'name':a156_0x2fa9ea(0x190),'type':'string','enum':['sql',a156_0x2fa9ea(0x19c)],'description':a156_0x2fa9ea(0x191)}],async 'validate'(_0x36ad7c){const _0x3cb0e9=a156_0x2fa9ea;if(!_0x36ad7c[_0x3cb0e9(0x19a)])return;if(!_0x36ad7c[_0x3cb0e9(0x1a7)](_0x3cb0e9(0x199))[_0x3cb0e9(0x188)]())throw CliErrors[_0x3cb0e9(0x17c)](_0x3cb0e9(0x199),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x4af261=resolveProvidedDbId(_0x36ad7c);if(typeof _0x4af261!==_0x3cb0e9(0x183)||!Number['isFinite'](_0x4af261)||_0x4af261<=0x0)throw CliErrors[_0x3cb0e9(0x17c)](_0x3cb0e9(0x1a0),_0x3cb0e9(0x1b3));if(!_0x36ad7c['str'](_0x3cb0e9(0x190))[_0x3cb0e9(0x188)]())throw CliErrors[_0x3cb0e9(0x17c)](_0x3cb0e9(0x190),_0x3cb0e9(0x19f));},async 'dryRun'(_0x2451fb){const _0x1e179c=a156_0x2fa9ea,_0x856806=loadSqlProjectConfig(_0x2451fb[_0x1e179c(0x197)]),{sqlName:_0x3b3acf,dbId:_0x4451ec,dbName:_0x1b5eb3,mode:_0x5c6c69}=await resolveSqlNewInputs(_0x2451fb),_0x4d16dd=buildSqlRelativePath(_0x1e179c(0x187),_0x3b3acf,_0x1b5eb3,_0x5c6c69,_0x4451ec),_0x135a6d=_0x856806[_0x1e179c(0x1ab)]+'/'+_0x4d16dd;return{'method':_0x1e179c(0x194),'url':_0x1e179c(0x1a8),'body':{'appCode':_0x2451fb['appCode'],'sqlName':_0x3b3acf,'dbId':_0x4451ec,'mode':_0x5c6c69,'localPath':_0x135a6d},'description':_0x1e179c(0x185)+_0x856806[_0x1e179c(0x1ab)]};},async 'execute'(_0x139731){const _0x45390a=a156_0x2fa9ea,_0x2dd39d=loadSqlProjectConfig(_0x139731[_0x45390a(0x197)]),{sqlName:_0x3e0cea,dbId:_0x17ca28,dbName:_0x3cd7be,mode:_0x5762a9}=await resolveSqlNewInputs(_0x139731),_0x510830=generateSqlTemplate(_0x5762a9),_0x41a359=await createSqlQuery({'appCode':_0x139731[_0x45390a(0x197)],'sqlName':_0x3e0cea,'dbId':_0x17ca28,'sqlContent':_0x510830}),_0x3a9bdb=ensureRemoteSqlContent(_0x41a359),_0x498204=_0x3cd7be||await getDbName(_0x139731['appCode'],_0x17ca28)[_0x45390a(0x1a5)](()=>undefined),_0x1adb33=buildSqlRelativePath(_0x41a359[_0x45390a(0x1b0)],_0x41a359[_0x45390a(0x19d)],_0x498204,_0x5762a9,_0x17ca28),_0x40e212=_0x2dd39d['sqlRootDir']+'/'+_0x1adb33,_0x431ecb=buildLocalSqlFileContent({'sqlCode':_0x41a359[_0x45390a(0x1b0)],'sqlName':_0x41a359['sqlName'],'dbId':_0x41a359[_0x45390a(0x18a)]},_0x3a9bdb,{'dbName':_0x498204,'mode':_0x5762a9,'syncedAt':new Date()[_0x45390a(0x192)](),'description':_0x41a359['description']});if(await fileExists(_0x40e212))throw CliErrors['validation'](_0x45390a(0x186)+_0x40e212);await ensureParentDirectory(_0x40e212),await writeFile(_0x40e212,_0x431ecb,_0x45390a(0x182));const _0x13bc0a=await readSqlLockFile(_0x2dd39d[_0x45390a(0x178)]),{lockData:_0x23d4d7,appLock:_0x2fce17}=ensureSqlLockScope(_0x13bc0a??createEmptySqlLock(),_0x2dd39d[_0x45390a(0x197)],_0x2dd39d[_0x45390a(0x180)],_0x45390a(0x1ae));return _0x2fce17[_0x45390a(0x195)][_0x41a359[_0x45390a(0x1b0)]]={...buildSqlLockEntry(_0x41a359,_0x3a9bdb,computeSqlContentHash(_0x431ecb),{'dbName':_0x498204}),'path':_0x1adb33,'mode':_0x5762a9},_0x2fce17[_0x45390a(0x19b)]=new Date()[_0x45390a(0x192)](),await writeSqlLockFile(_0x2dd39d[_0x45390a(0x178)],_0x23d4d7),{'ok':!![],'data':{'id':_0x41a359['id'],'sqlCode':_0x41a359[_0x45390a(0x1b0)],'sqlName':_0x41a359[_0x45390a(0x19d)],'dbId':_0x41a359[_0x45390a(0x18a)],'path':_0x40e212,'mode':_0x5762a9},'message':_0x45390a(0x1a1)+_0x41a359['sqlCode']};}};async function resolveSqlNewInputs(_0x541748){const _0x9b24fa=await resolveSqlNameInput(_0x541748),{dbId:_0x2910f4,dbName:_0x139af7}=await resolveDbSelection(_0x541748),_0x43b4b0=await resolveSqlModeInput(_0x541748);return{'sqlName':_0x9b24fa,'dbId':_0x2910f4,'dbName':_0x139af7,'mode':_0x43b4b0};}async function resolveSqlNameInput(_0x1d7321){const _0x4935e4=a156_0x2fa9ea,_0xf61138=_0x1d7321['str'](_0x4935e4(0x199))[_0x4935e4(0x188)]();if(_0xf61138)return _0xf61138;if(_0x1d7321[_0x4935e4(0x19a)])throw CliErrors['flagMissing']('name',_0x4935e4(0x17a));return(await input({'message':_0x4935e4(0x1a3),'validate':_0x59126f=>_0x59126f[_0x4935e4(0x188)]()?!![]:_0x4935e4(0x196)}))['trim']();}async function resolveDbSelection(_0x524b6){const _0x2c0dc6=a156_0x2fa9ea,_0x35e335=resolveProvidedDbId(_0x524b6);if(typeof _0x35e335===_0x2c0dc6(0x183)&&Number[_0x2c0dc6(0x1b9)](_0x35e335)&&_0x35e335>0x0)return{'dbId':_0x35e335,'dbName':await getDbName(_0x524b6[_0x2c0dc6(0x197)],_0x35e335)[_0x2c0dc6(0x1a5)](()=>undefined)};if(_0x524b6['nonInteractive'])throw CliErrors[_0x2c0dc6(0x17c)]('db-id','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x290178=await listDatabases(_0x524b6[_0x2c0dc6(0x197)])[_0x2c0dc6(0x1a5)](()=>[]);if(_0x290178[_0x2c0dc6(0x1ad)]===0x1)return{'dbId':_0x290178[0x0][_0x2c0dc6(0x18a)],'dbName':_0x290178[0x0]['dbName']};if(_0x290178[_0x2c0dc6(0x1ad)]>0x1){const _0xc63af9=await select({'message':_0x2c0dc6(0x18d),'choices':[..._0x290178[_0x2c0dc6(0x18c)](_0x364678=>({'name':_0x364678['dbName']+'\x20('+_0x364678[_0x2c0dc6(0x18a)]+')','value':serializeDbSelection(_0x364678)})),{'name':_0x2c0dc6(0x18f),'value':'__manual__'}]});if(_0xc63af9!=='__manual__')return deserializeDbSelection(_0xc63af9);}const _0x5ece0e=await input({'message':_0x2c0dc6(0x175),'validate':_0x147c60=>{const _0x52def4=_0x2c0dc6,_0x28487c=_0x147c60[_0x52def4(0x188)]();if(!_0x28487c)return _0x52def4(0x1a2);const _0x1381d4=Number(_0x28487c);if(!Number['isInteger'](_0x1381d4)||_0x1381d4<=0x0)return _0x52def4(0x177);return!![];}});return{'dbId':Number(_0x5ece0e[_0x2c0dc6(0x188)]())};}async function resolveSqlModeInput(_0x411c3f){const _0x457a64=a156_0x2fa9ea,_0x1730f0=_0x411c3f['str'](_0x457a64(0x190))[_0x457a64(0x188)]();if(_0x1730f0==='sql'||_0x1730f0===_0x457a64(0x19c))return _0x1730f0;if(_0x411c3f[_0x457a64(0x19a)])throw CliErrors['flagMissing'](_0x457a64(0x190),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');return await select({'message':_0x457a64(0x198),'choices':[{'name':_0x457a64(0x184),'value':_0x457a64(0x1a9),'description':'适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句'},{'name':_0x457a64(0x1b6),'value':_0x457a64(0x19c),'description':_0x457a64(0x1ba)}]});}function serializeDbSelection(_0x3a9656){const _0xd28e46=a156_0x2fa9ea;return JSON[_0xd28e46(0x17f)]({'dbId':_0x3a9656[_0xd28e46(0x18a)],'dbName':_0x3a9656[_0xd28e46(0x1b5)]});}function deserializeDbSelection(_0x27c3c1){const _0x537052=a156_0x2fa9ea;try{const _0x29c598=JSON[_0x537052(0x19e)](_0x27c3c1);if(typeof _0x29c598[_0x537052(0x18a)]===_0x537052(0x183)&&Number[_0x537052(0x1b9)](_0x29c598['dbId']))return{'dbId':_0x29c598[_0x537052(0x18a)],'dbName':_0x29c598['dbName']};}catch{}throw CliErrors[_0x537052(0x179)](_0x537052(0x181)+_0x27c3c1);}function resolveProvidedDbId(_0x2f144f){const _0xa9a687=a156_0x2fa9ea,_0x427be9=_0x2f144f[_0xa9a687(0x18b)]('db-id');if(typeof _0x427be9==='number'&&Number[_0xa9a687(0x1b9)](_0x427be9))return _0x427be9;return undefined;}
1
+ const a156_0x126934=a156_0xb299;(function(_0x265eb0,_0xe11e9b){const _0xf47180=a156_0xb299,_0x25eccb=_0x265eb0();while(!![]){try{const _0x378c51=-parseInt(_0xf47180(0x210))/0x1+-parseInt(_0xf47180(0x1fc))/0x2*(-parseInt(_0xf47180(0x1e1))/0x3)+parseInt(_0xf47180(0x1e9))/0x4*(parseInt(_0xf47180(0x20f))/0x5)+parseInt(_0xf47180(0x1e7))/0x6+-parseInt(_0xf47180(0x203))/0x7+-parseInt(_0xf47180(0x1eb))/0x8*(-parseInt(_0xf47180(0x21e))/0x9)+-parseInt(_0xf47180(0x1f7))/0xa*(-parseInt(_0xf47180(0x1ec))/0xb);if(_0x378c51===_0xe11e9b)break;else _0x25eccb['push'](_0x25eccb['shift']());}catch(_0x2be3ec){_0x25eccb['push'](_0x25eccb['shift']());}}}(a156_0xa852,0xea145));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';function a156_0xb299(_0x2ccf74,_0x41b4de){_0x2ccf74=_0x2ccf74-0x1df;const _0xa8522a=a156_0xa852();let _0xb2991=_0xa8522a[_0x2ccf74];return _0xb2991;}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 a156_0xa852(){const _0x151b6a=['utf8','✎\x20手动输入\x20dbId','3860088jqFvpg','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','24036eCNTJL','validation','155704LDNbYr','516527pHOjVE','number','sqlRootDir','SQL\x20query\x20display\x20name','name','dbId\x20不能为空','join','<server-generated-sqlCode>','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','dbName','sqlCode','150wLehNG','Target\x20database\x20ID','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','Local\x20SQL\x20file\x20mode','POST','2BXuUVr','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','普通\x20SQL(sql)','db-id','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','stringify','sqlRoot','5743038YbhxON','sqls','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','__manual__','SQL\x20名称不能为空','MyBatis\x20XML(mybatisXml)','Created\x20SQL\x20query\x20','lastSync','flag','appCode','sql','dbId\x20必须为正整数','1025kQrtFs','1606565WQqryv','lockFilePath','请选择目标数据库:','trim','请输入\x20SQL\x20名称:','high-risk-write','dbId','create','SELECT\x201\x20AS\x20id;','new','isInteger','mode','mybatisXml','parse','9NcwOpk','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','isFinite','description','catch','nonInteractive','string','length','sqlName','2360331JPpMqt','str','map','flagMissing'];a156_0xa852=function(){return _0x151b6a;};return a156_0xa852();}function generateSqlTemplate(_0x487975){const _0x380888=a156_0xb299;if(_0x487975===_0x380888(0x21c))return[_0x380888(0x205),'\x20\x20SELECT\x201\x20AS\x20id','</select>',''][_0x380888(0x1f2)]('\x0a');return[_0x380888(0x218),''][_0x380888(0x1f2)]('\x0a');}export const sqlCreate={'service':a156_0x126934(0x20d),'command':a156_0x126934(0x217),'description':a156_0x126934(0x1e8),'risk':a156_0x126934(0x215),'flags':[{'name':a156_0x126934(0x1f0),'type':a156_0x126934(0x224),'description':a156_0x126934(0x1ef)},{'name':a156_0x126934(0x1ff),'type':a156_0x126934(0x1ed),'description':a156_0x126934(0x1f8)},{'name':a156_0x126934(0x21b),'type':a156_0x126934(0x224),'enum':['sql',a156_0x126934(0x21c)],'description':a156_0x126934(0x1fa)}],async 'validate'(_0xe86012){const _0x49e3bd=a156_0x126934;if(!_0xe86012[_0x49e3bd(0x223)])return;if(!_0xe86012['str'](_0x49e3bd(0x1f0))['trim']())throw CliErrors[_0x49e3bd(0x1e4)](_0x49e3bd(0x1f0),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x1aa3e1=resolveProvidedDbId(_0xe86012);if(typeof _0x1aa3e1!==_0x49e3bd(0x1ed)||!Number[_0x49e3bd(0x220)](_0x1aa3e1)||_0x1aa3e1<=0x0)throw CliErrors[_0x49e3bd(0x1e4)](_0x49e3bd(0x1ff),_0x49e3bd(0x1fd));if(!_0xe86012['str'](_0x49e3bd(0x21b))[_0x49e3bd(0x213)]())throw CliErrors[_0x49e3bd(0x1e4)](_0x49e3bd(0x21b),_0x49e3bd(0x1f9));},async 'dryRun'(_0x2223ed){const _0x4de32a=a156_0x126934,_0x450d33=loadSqlProjectConfig(_0x2223ed[_0x4de32a(0x20c)]),{sqlName:_0x3f7029,dbId:_0x329031,dbName:_0x4c6074,mode:_0x4598bf}=await resolveSqlNewInputs(_0x2223ed),_0x4461e1=buildSqlRelativePath(_0x4de32a(0x1f3),_0x3f7029,_0x4c6074,_0x4598bf,_0x329031),_0x48370a=_0x450d33[_0x4de32a(0x1ee)]+'/'+_0x4461e1;return{'method':_0x4de32a(0x1fb),'url':'/smartapi/custom/saveUserCustomSql','body':{'appCode':_0x2223ed[_0x4de32a(0x20c)],'sqlName':_0x3f7029,'dbId':_0x329031,'mode':_0x4598bf,'localPath':_0x48370a},'description':_0x4de32a(0x21f)+_0x450d33['sqlRootDir']};},async 'execute'(_0x2a363d){const _0x399b65=a156_0x126934,_0x4e8fc1=loadSqlProjectConfig(_0x2a363d[_0x399b65(0x20c)]),{sqlName:_0x26f7b8,dbId:_0xbad78,dbName:_0x3a86d1,mode:_0x597344}=await resolveSqlNewInputs(_0x2a363d),_0x11b50e=generateSqlTemplate(_0x597344),_0xbe28d3=await createSqlQuery({'appCode':_0x2a363d['appCode'],'sqlName':_0x26f7b8,'dbId':_0xbad78,'sqlContent':_0x11b50e}),_0x3d3a94=ensureRemoteSqlContent(_0xbe28d3),_0x2a5005=_0x3a86d1||await getDbName(_0x2a363d[_0x399b65(0x20c)],_0xbad78)[_0x399b65(0x222)](()=>undefined),_0x28133d=buildSqlRelativePath(_0xbe28d3[_0x399b65(0x1f6)],_0xbe28d3['sqlName'],_0x2a5005,_0x597344,_0xbad78),_0x709b8d=_0x4e8fc1['sqlRootDir']+'/'+_0x28133d,_0x2d36d9=buildLocalSqlFileContent({'sqlCode':_0xbe28d3[_0x399b65(0x1f6)],'sqlName':_0xbe28d3[_0x399b65(0x1e0)],'dbId':_0xbe28d3['dbId']},_0x3d3a94,{'dbName':_0x2a5005,'mode':_0x597344,'syncedAt':new Date()['toISOString'](),'description':_0xbe28d3[_0x399b65(0x221)]});if(await fileExists(_0x709b8d))throw CliErrors['validation']('File\x20already\x20exists:\x20'+_0x709b8d);await ensureParentDirectory(_0x709b8d),await writeFile(_0x709b8d,_0x2d36d9,_0x399b65(0x1e5));const _0x4c96ef=await readSqlLockFile(_0x4e8fc1['lockFilePath']),{lockData:_0x3f2790,appLock:_0x533925}=ensureSqlLockScope(_0x4c96ef??createEmptySqlLock(),_0x4e8fc1[_0x399b65(0x20c)],_0x4e8fc1[_0x399b65(0x202)],_0x399b65(0x219));return _0x533925[_0x399b65(0x204)][_0xbe28d3[_0x399b65(0x1f6)]]={...buildSqlLockEntry(_0xbe28d3,_0x3d3a94,computeSqlContentHash(_0x2d36d9),{'dbName':_0x2a5005}),'path':_0x28133d,'mode':_0x597344},_0x533925[_0x399b65(0x20a)]=new Date()['toISOString'](),await writeSqlLockFile(_0x4e8fc1[_0x399b65(0x211)],_0x3f2790),{'ok':!![],'data':{'id':_0xbe28d3['id'],'sqlCode':_0xbe28d3[_0x399b65(0x1f6)],'sqlName':_0xbe28d3[_0x399b65(0x1e0)],'dbId':_0xbe28d3[_0x399b65(0x216)],'path':_0x709b8d,'mode':_0x597344},'message':_0x399b65(0x209)+_0xbe28d3[_0x399b65(0x1f6)]};}};async function resolveSqlNewInputs(_0x52efdc){const _0xb4f495=await resolveSqlNameInput(_0x52efdc),{dbId:_0x382c9c,dbName:_0x5805b7}=await resolveDbSelection(_0x52efdc),_0x1b926e=await resolveSqlModeInput(_0x52efdc);return{'sqlName':_0xb4f495,'dbId':_0x382c9c,'dbName':_0x5805b7,'mode':_0x1b926e};}async function resolveSqlNameInput(_0x38cafc){const _0x128abf=a156_0x126934,_0x3f264c=_0x38cafc['str'](_0x128abf(0x1f0))[_0x128abf(0x213)]();if(_0x3f264c)return _0x3f264c;if(_0x38cafc[_0x128abf(0x223)])throw CliErrors['flagMissing']('name',_0x128abf(0x1f4));return(await input({'message':_0x128abf(0x214),'validate':_0x4aeea6=>_0x4aeea6[_0x128abf(0x213)]()?!![]:_0x128abf(0x207)}))[_0x128abf(0x213)]();}async function resolveDbSelection(_0x25bb1e){const _0x1a35c5=a156_0x126934,_0xc6f185=resolveProvidedDbId(_0x25bb1e);if(typeof _0xc6f185==='number'&&Number[_0x1a35c5(0x220)](_0xc6f185)&&_0xc6f185>0x0)return{'dbId':_0xc6f185,'dbName':await getDbName(_0x25bb1e['appCode'],_0xc6f185)['catch'](()=>undefined)};if(_0x25bb1e[_0x1a35c5(0x223)])throw CliErrors['flagMissing'](_0x1a35c5(0x1ff),_0x1a35c5(0x1fd));const _0x27b6bc=await listDatabases(_0x25bb1e['appCode'])[_0x1a35c5(0x222)](()=>[]);if(_0x27b6bc[_0x1a35c5(0x1df)]===0x1)return{'dbId':_0x27b6bc[0x0][_0x1a35c5(0x216)],'dbName':_0x27b6bc[0x0][_0x1a35c5(0x1f5)]};if(_0x27b6bc[_0x1a35c5(0x1df)]>0x1){const _0xf33337=await select({'message':_0x1a35c5(0x212),'choices':[..._0x27b6bc[_0x1a35c5(0x1e3)](_0x1476f1=>({'name':_0x1476f1['dbName']+'\x20('+_0x1476f1[_0x1a35c5(0x216)]+')','value':serializeDbSelection(_0x1476f1)})),{'name':_0x1a35c5(0x1e6),'value':_0x1a35c5(0x206)}]});if(_0xf33337!==_0x1a35c5(0x206))return deserializeDbSelection(_0xf33337);}const _0xbfb197=await input({'message':'请输入目标数据库\x20dbId:','validate':_0x54ddbe=>{const _0x4b037c=_0x1a35c5,_0x36e95c=_0x54ddbe[_0x4b037c(0x213)]();if(!_0x36e95c)return _0x4b037c(0x1f1);const _0x32b88f=Number(_0x36e95c);if(!Number[_0x4b037c(0x21a)](_0x32b88f)||_0x32b88f<=0x0)return _0x4b037c(0x20e);return!![];}});return{'dbId':Number(_0xbfb197['trim']())};}async function resolveSqlModeInput(_0x23194d){const _0x3fdbe3=a156_0x126934,_0x2f146a=_0x23194d[_0x3fdbe3(0x1e2)]('mode')[_0x3fdbe3(0x213)]();if(_0x2f146a===_0x3fdbe3(0x20d)||_0x2f146a===_0x3fdbe3(0x21c))return _0x2f146a;if(_0x23194d[_0x3fdbe3(0x223)])throw CliErrors[_0x3fdbe3(0x1e4)](_0x3fdbe3(0x21b),_0x3fdbe3(0x1f9));return await select({'message':'请选择本地\x20SQL\x20模式:','choices':[{'name':_0x3fdbe3(0x1fe),'value':_0x3fdbe3(0x20d),'description':_0x3fdbe3(0x200)},{'name':_0x3fdbe3(0x208),'value':_0x3fdbe3(0x21c),'description':'适合带动态标签的\x20MyBatis\x20XML\x20SQL'}]});}function serializeDbSelection(_0x271ce5){const _0x3fe400=a156_0x126934;return JSON[_0x3fe400(0x201)]({'dbId':_0x271ce5[_0x3fe400(0x216)],'dbName':_0x271ce5[_0x3fe400(0x1f5)]});}function deserializeDbSelection(_0x52b772){const _0x3e11d8=a156_0x126934;try{const _0x20043f=JSON[_0x3e11d8(0x21d)](_0x52b772);if(typeof _0x20043f[_0x3e11d8(0x216)]===_0x3e11d8(0x1ed)&&Number[_0x3e11d8(0x220)](_0x20043f['dbId']))return{'dbId':_0x20043f[_0x3e11d8(0x216)],'dbName':_0x20043f[_0x3e11d8(0x1f5)]};}catch{}throw CliErrors[_0x3e11d8(0x1ea)]('Invalid\x20database\x20selection\x20payload:\x20'+_0x52b772);}function resolveProvidedDbId(_0xecc950){const _0x1aad52=a156_0x126934,_0x345def=_0xecc950[_0x1aad52(0x20b)](_0x1aad52(0x1ff));if(typeof _0x345def===_0x1aad52(0x1ed)&&Number[_0x1aad52(0x220)](_0x345def))return _0x345def;return undefined;}
@@ -1 +1 @@
1
- const a157_0x596359=a157_0x2bed;(function(_0x5cef47,_0x275e0f){const _0x77754=a157_0x2bed,_0x4603b3=_0x5cef47();while(!![]){try{const _0xdf9201=-parseInt(_0x77754(0x7d))/0x1*(-parseInt(_0x77754(0x88))/0x2)+-parseInt(_0x77754(0x83))/0x3+-parseInt(_0x77754(0x89))/0x4*(parseInt(_0x77754(0x93))/0x5)+parseInt(_0x77754(0x85))/0x6*(parseInt(_0x77754(0x95))/0x7)+parseInt(_0x77754(0x79))/0x8+parseInt(_0x77754(0x97))/0x9*(-parseInt(_0x77754(0x8e))/0xa)+-parseInt(_0x77754(0x7f))/0xb*(-parseInt(_0x77754(0x7c))/0xc);if(_0xdf9201===_0x275e0f)break;else _0x4603b3['push'](_0x4603b3['shift']());}catch(_0x11d5a5){_0x4603b3['push'](_0x4603b3['shift']());}}}(a157_0x24b7,0x8832a));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':a157_0x596359(0x9d),'command':a157_0x596359(0x91),'description':'Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','risk':a157_0x596359(0x94),'flags':[SQLCODE_FLAG],async 'validate'(_0x241e08){const _0x5b9806=a157_0x596359,_0x400f98=loadSqlProjectConfig(_0x241e08[_0x5b9806(0x80)]),_0x17c0f8=await readSqlLockFile(_0x400f98['lockFilePath']);if(!_0x17c0f8)throw CliErrors[_0x5b9806(0x9b)](_0x5b9806(0x81));},async 'dryRun'(_0x3a951e){const _0x3b898b=a157_0x596359,_0x26fc93=loadSqlProjectConfig(_0x3a951e['appCode']),_0x57f46b=await readSqlLockFile(_0x26fc93[_0x3b898b(0x8d)]);if(!_0x57f46b)throw CliErrors[_0x3b898b(0x9b)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');const {appLock:_0x353957}=ensureSqlLockScope(_0x57f46b,_0x3a951e[_0x3b898b(0x80)],_0x26fc93[_0x3b898b(0x8a)],_0x3b898b(0x91)),_0x2fcb86=_0x3a951e[_0x3b898b(0x8f)](_0x3b898b(0x84)),_0x8b70af=_0x353957[_0x3b898b(0x96)][_0x2fcb86];if(!_0x8b70af)throw CliErrors['validation'](_0x3b898b(0xa1)+_0x2fcb86+'\x22.');return{'method':'POST','url':_0x3b898b(0x9c),'body':{'sqlCode':_0x2fcb86,'id':_0x8b70af['remoteId'],'localPath':resolveLocalSqlFilePath(_0x26fc93,_0x2fcb86,_0x8b70af)},'description':_0x3b898b(0x7e)+_0x2fcb86+_0x3b898b(0x9e)+_0x26fc93[_0x3b898b(0x9f)]};},async 'execute'(_0x2f52cb){const _0x2fc9ab=a157_0x596359,_0x1989c2=loadSqlProjectConfig(_0x2f52cb['appCode']),_0x270cbd=await readSqlLockFile(_0x1989c2['lockFilePath']);if(!_0x270cbd)throw CliErrors['validation'](_0x2fc9ab(0x99));const {lockData:_0x164117,appLock:_0x440303}=ensureSqlLockScope(_0x270cbd,_0x2f52cb[_0x2fc9ab(0x80)],_0x1989c2[_0x2fc9ab(0x8a)],_0x2fc9ab(0x91)),_0x5ef481=_0x2f52cb[_0x2fc9ab(0x8f)](_0x2fc9ab(0x84)),_0x1ab288=_0x440303[_0x2fc9ab(0x96)][_0x5ef481];if(!_0x1ab288)throw CliErrors['validation'](_0x2fc9ab(0xa1)+_0x5ef481+'\x22.');await deleteSqlQuery({'id':_0x1ab288[_0x2fc9ab(0xa2)],'sqlCode':_0x5ef481}),_0x440303[_0x2fc9ab(0x96)]=Object[_0x2fc9ab(0x87)](Object[_0x2fc9ab(0x92)](_0x440303['sqls'])[_0x2fc9ab(0x7a)](([_0x30369d])=>_0x30369d!==_0x5ef481)),_0x440303['lastSync']=new Date()[_0x2fc9ab(0x82)](),await writeSqlLockFile(_0x1989c2[_0x2fc9ab(0x8d)],_0x164117);const _0x54a060=resolveLocalSqlFilePath(_0x1989c2,_0x5ef481,_0x1ab288);let _0x1433fb;await fileExists(_0x54a060)&&(_0x1433fb=await moveToTrash(_0x1989c2[_0x2fc9ab(0x8c)],_0x1989c2[_0x2fc9ab(0x9f)],_0x54a060),await cleanupEmptyDirectories(dirname(_0x54a060),_0x1989c2[_0x2fc9ab(0x9a)]));const _0x4c179c={'deleted':_0x5ef481,'remoteId':_0x1ab288['remoteId']};if(_0x1433fb)_0x4c179c[_0x2fc9ab(0x90)]=_0x1433fb;return{'ok':!![],'data':_0x4c179c,'message':_0x2fc9ab(0x98)+_0x5ef481+(_0x1433fb?_0x2fc9ab(0xa0):'')};}};async function moveToTrash(_0x1c96ee,_0x9b0936,_0x2f32b8){const _0x4196f5=a157_0x596359,_0x58417e=new Date()[_0x4196f5(0x82)]()[_0x4196f5(0x86)](/[:.]/g,'-'),_0x30aaab=relative(_0x1c96ee,_0x2f32b8),_0x3700cd=join(_0x9b0936,_0x58417e,_0x30aaab);return await mkdir(dirname(_0x3700cd),{'recursive':!![]}),await rename(_0x2f32b8,_0x3700cd),_0x3700cd;}function a157_0x2bed(_0x512ee6,_0x14a76e){_0x512ee6=_0x512ee6-0x79;const _0x24b756=a157_0x24b7();let _0x2bedd5=_0x24b756[_0x512ee6];return _0x2bedd5;}function a157_0x24b7(){const _0x4c5ffc=['delete','entries','5GhTuSI','high-risk-write','253162RuFayM','sqls','309924fxeMBc','Deleted\x20','SQL\x20lock\x20file\x20not\x20found.','sqlRootDir','validation','/smartapi/custom/deleteUserCustomSql','sql','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','trashDir','\x20(local\x20file\x20moved\x20to\x20trash)','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','remoteId','4843736zEeWYe','filter','length','204RALryO','4YqLrNB','Would\x20delete\x20SQL\x20','992618HNCoHR','appCode','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','toISOString','2294379XJRLQn','sqlcode','18NMWtOj','replace','fromEntries','214494RUMQZQ','1698272avitBZ','sqlRoot','startsWith','projectRoot','lockFilePath','270fMnDXH','str','trashedTo'];a157_0x24b7=function(){return _0x4c5ffc;};return a157_0x24b7();}async function cleanupEmptyDirectories(_0x5d9cd4,_0x122e3a){const _0x1be53=a157_0x596359;let _0x498018=resolve(_0x5d9cd4);const _0x2b3c3b=resolve(_0x122e3a);while(_0x498018[_0x1be53(0x8b)](''+_0x2b3c3b+sep)||_0x498018===_0x2b3c3b){if(_0x498018===_0x2b3c3b)return;try{const _0x2eed47=await readdir(_0x498018);if(_0x2eed47[_0x1be53(0x7b)]>0x0)return;await rmdir(_0x498018);}catch{return;}_0x498018=dirname(_0x498018);}}
1
+ const a157_0x10c2ba=a157_0x20d3;function a157_0x20d3(_0x814ee2,_0x35f7f8){_0x814ee2=_0x814ee2-0x118;const _0x544bfd=a157_0x544b();let _0x20d308=_0x544bfd[_0x814ee2];return _0x20d308;}(function(_0x381a56,_0x30d5e2){const _0x107fb7=a157_0x20d3,_0x94d8ef=_0x381a56();while(!![]){try{const _0x342990=-parseInt(_0x107fb7(0x123))/0x1*(-parseInt(_0x107fb7(0x138))/0x2)+-parseInt(_0x107fb7(0x11a))/0x3+parseInt(_0x107fb7(0x13a))/0x4+-parseInt(_0x107fb7(0x137))/0x5+-parseInt(_0x107fb7(0x11f))/0x6*(parseInt(_0x107fb7(0x136))/0x7)+parseInt(_0x107fb7(0x139))/0x8+-parseInt(_0x107fb7(0x133))/0x9*(parseInt(_0x107fb7(0x135))/0xa);if(_0x342990===_0x30d5e2)break;else _0x94d8ef['push'](_0x94d8ef['shift']());}catch(_0x4e0b6f){_0x94d8ef['push'](_0x94d8ef['shift']());}}}(a157_0x544b,0xbbf80));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';function a157_0x544b(){const _0x4f09c9=['sqlcode','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','sqls','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','projectRoot','/smartapi/custom/deleteUserCustomSql','delete','trashedTo','validation','toISOString','appCode','2367NTknSI','Would\x20delete\x20SQL\x20','12370SVZzLa','105XExKwF','2496205FnOsoI','302506hCruAZ','8151592ReOakA','3993572Smrbjq','remoteId','POST','SQL\x20lock\x20file\x20not\x20found.','996240vrEkpQ','sql','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','lockFilePath','entries','338814cvfOJW','fromEntries','lastSync','sqlRoot','5ogNgMy','replace','startsWith','str'];a157_0x544b=function(){return _0x4f09c9;};return a157_0x544b();}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':a157_0x10c2ba(0x11b),'command':'delete','description':a157_0x10c2ba(0x128),'risk':'high-risk-write','flags':[SQLCODE_FLAG],async 'validate'(_0x187146){const _0x5c9c29=a157_0x10c2ba,_0x3fbfc0=loadSqlProjectConfig(_0x187146[_0x5c9c29(0x132)]),_0x39dfce=await readSqlLockFile(_0x3fbfc0[_0x5c9c29(0x11d)]);if(!_0x39dfce)throw CliErrors[_0x5c9c29(0x130)](_0x5c9c29(0x129));},async 'dryRun'(_0x481645){const _0x314e19=a157_0x10c2ba,_0x5da991=loadSqlProjectConfig(_0x481645['appCode']),_0x575c00=await readSqlLockFile(_0x5da991[_0x314e19(0x11d)]);if(!_0x575c00)throw CliErrors[_0x314e19(0x130)](_0x314e19(0x129));const {appLock:_0x304d3c}=ensureSqlLockScope(_0x575c00,_0x481645[_0x314e19(0x132)],_0x5da991[_0x314e19(0x122)],_0x314e19(0x12e)),_0x42afab=_0x481645[_0x314e19(0x126)](_0x314e19(0x127)),_0x24be2a=_0x304d3c['sqls'][_0x42afab];if(!_0x24be2a)throw CliErrors[_0x314e19(0x130)](_0x314e19(0x12b)+_0x42afab+'\x22.');return{'method':_0x314e19(0x118),'url':_0x314e19(0x12d),'body':{'sqlCode':_0x42afab,'id':_0x24be2a[_0x314e19(0x13b)],'localPath':resolveLocalSqlFilePath(_0x5da991,_0x42afab,_0x24be2a)},'description':_0x314e19(0x134)+_0x42afab+_0x314e19(0x11c)+_0x5da991['trashDir']};},async 'execute'(_0x5d423f){const _0x37d633=a157_0x10c2ba,_0x8b3d5d=loadSqlProjectConfig(_0x5d423f[_0x37d633(0x132)]),_0x49412e=await readSqlLockFile(_0x8b3d5d['lockFilePath']);if(!_0x49412e)throw CliErrors[_0x37d633(0x130)](_0x37d633(0x119));const {lockData:_0x2f043e,appLock:_0x95d098}=ensureSqlLockScope(_0x49412e,_0x5d423f['appCode'],_0x8b3d5d[_0x37d633(0x122)],_0x37d633(0x12e)),_0x84bf93=_0x5d423f[_0x37d633(0x126)](_0x37d633(0x127)),_0x3662d9=_0x95d098[_0x37d633(0x12a)][_0x84bf93];if(!_0x3662d9)throw CliErrors[_0x37d633(0x130)](_0x37d633(0x12b)+_0x84bf93+'\x22.');await deleteSqlQuery({'id':_0x3662d9[_0x37d633(0x13b)],'sqlCode':_0x84bf93}),_0x95d098[_0x37d633(0x12a)]=Object[_0x37d633(0x120)](Object[_0x37d633(0x11e)](_0x95d098[_0x37d633(0x12a)])['filter'](([_0x449909])=>_0x449909!==_0x84bf93)),_0x95d098[_0x37d633(0x121)]=new Date()[_0x37d633(0x131)](),await writeSqlLockFile(_0x8b3d5d[_0x37d633(0x11d)],_0x2f043e);const _0x38dc36=resolveLocalSqlFilePath(_0x8b3d5d,_0x84bf93,_0x3662d9);let _0x207b24;await fileExists(_0x38dc36)&&(_0x207b24=await moveToTrash(_0x8b3d5d[_0x37d633(0x12c)],_0x8b3d5d['trashDir'],_0x38dc36),await cleanupEmptyDirectories(dirname(_0x38dc36),_0x8b3d5d['sqlRootDir']));const _0x41e0fc={'deleted':_0x84bf93,'remoteId':_0x3662d9[_0x37d633(0x13b)]};if(_0x207b24)_0x41e0fc[_0x37d633(0x12f)]=_0x207b24;return{'ok':!![],'data':_0x41e0fc,'message':'Deleted\x20'+_0x84bf93+(_0x207b24?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};async function moveToTrash(_0x37f44b,_0x38ea88,_0x25cf7c){const _0x370eca=a157_0x10c2ba,_0x574c12=new Date()[_0x370eca(0x131)]()[_0x370eca(0x124)](/[:.]/g,'-'),_0x412ef7=relative(_0x37f44b,_0x25cf7c),_0x52e9f5=join(_0x38ea88,_0x574c12,_0x412ef7);return await mkdir(dirname(_0x52e9f5),{'recursive':!![]}),await rename(_0x25cf7c,_0x52e9f5),_0x52e9f5;}async function cleanupEmptyDirectories(_0x2fb3fe,_0x5ecbf2){const _0x3c5703=a157_0x10c2ba;let _0x4bb58c=resolve(_0x2fb3fe);const _0x503377=resolve(_0x5ecbf2);while(_0x4bb58c[_0x3c5703(0x125)](''+_0x503377+sep)||_0x4bb58c===_0x503377){if(_0x4bb58c===_0x503377)return;try{const _0x53f580=await readdir(_0x4bb58c);if(_0x53f580['length']>0x0)return;await rmdir(_0x4bb58c);}catch{return;}_0x4bb58c=dirname(_0x4bb58c);}}