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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (264) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/add.js +1 -1
  20. package/lib/commands/app/index.js +1 -1
  21. package/lib/commands/app/list.js +1 -1
  22. package/lib/commands/app/remote-directory.js +1 -1
  23. package/lib/commands/app/remove.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app-config/delete.js +1 -1
  26. package/lib/commands/app-config/get.js +1 -1
  27. package/lib/commands/app-config/index.js +1 -1
  28. package/lib/commands/app-config/list.js +1 -1
  29. package/lib/commands/app-config/set.js +1 -1
  30. package/lib/commands/app-config/shared.js +1 -1
  31. package/lib/commands/auth/index.js +1 -1
  32. package/lib/commands/bff/create.js +1 -1
  33. package/lib/commands/bff/delete.js +1 -1
  34. package/lib/commands/bff/detail.js +1 -1
  35. package/lib/commands/bff/index.js +1 -1
  36. package/lib/commands/bff/list.js +1 -1
  37. package/lib/commands/bff/pull.js +1 -1
  38. package/lib/commands/bff/push.js +1 -1
  39. package/lib/commands/bff/status.js +1 -1
  40. package/lib/commands/cli-skill/index.js +1 -1
  41. package/lib/commands/cli-update.js +1 -1
  42. package/lib/commands/codegen/index.js +1 -1
  43. package/lib/commands/codegen/sdk.js +1 -1
  44. package/lib/commands/codegen/sql.js +1 -1
  45. package/lib/commands/common/app-registry.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/async-task.js +1 -1
  48. package/lib/commands/common/dry-run.js +1 -1
  49. package/lib/commands/common/flags.js +1 -1
  50. package/lib/commands/common/local-file.js +1 -1
  51. package/lib/commands/common/validate.js +1 -1
  52. package/lib/commands/config/get.js +1 -1
  53. package/lib/commands/config/index.js +1 -1
  54. package/lib/commands/config/list.js +1 -1
  55. package/lib/commands/config/set.js +1 -1
  56. package/lib/commands/config/shared.js +1 -1
  57. package/lib/commands/data/filter.js +1 -1
  58. package/lib/commands/data/getOne.js +1 -1
  59. package/lib/commands/data/index.js +1 -1
  60. package/lib/commands/data/shared.js +1 -1
  61. package/lib/commands/dataset/business-group-update.js +1 -1
  62. package/lib/commands/dataset/capability.js +1 -1
  63. package/lib/commands/dataset/delete.js +1 -1
  64. package/lib/commands/dataset/detail.js +1 -1
  65. package/lib/commands/dataset/extend-update.js +1 -1
  66. package/lib/commands/dataset/field-update.js +1 -1
  67. package/lib/commands/dataset/generate.js +1 -1
  68. package/lib/commands/dataset/index.js +1 -1
  69. package/lib/commands/dataset/list.js +1 -1
  70. package/lib/commands/dataset/operations.js +1 -1
  71. package/lib/commands/dataset/relation-audit.js +1 -1
  72. package/lib/commands/dataset/relation-create.js +1 -1
  73. package/lib/commands/dataset/relation-delete.js +1 -1
  74. package/lib/commands/dataset/relation-shared.js +1 -1
  75. package/lib/commands/dataset/relation-update.js +1 -1
  76. package/lib/commands/dataset/relations.js +1 -1
  77. package/lib/commands/dataset/rename.js +1 -1
  78. package/lib/commands/dataset/restore.js +1 -1
  79. package/lib/commands/db/analysis-batching.js +1 -1
  80. package/lib/commands/db/analyze-batch-plan.js +1 -1
  81. package/lib/commands/db/analyze-cancel.js +1 -1
  82. package/lib/commands/db/analyze-start.js +1 -1
  83. package/lib/commands/db/analyze-status.js +1 -1
  84. package/lib/commands/db/create.js +1 -1
  85. package/lib/commands/db/delete.js +1 -1
  86. package/lib/commands/db/detail.js +1 -1
  87. package/lib/commands/db/diff.js +1 -1
  88. package/lib/commands/db/index.js +1 -1
  89. package/lib/commands/db/list.js +1 -1
  90. package/lib/commands/db/shared.js +1 -1
  91. package/lib/commands/db/tables.js +1 -1
  92. package/lib/commands/db/test.js +1 -1
  93. package/lib/commands/db/update.js +1 -1
  94. package/lib/commands/doctor.js +1 -1
  95. package/lib/commands/file/index.js +1 -1
  96. package/lib/commands/init/index.js +1 -1
  97. package/lib/commands/issue/index.js +1 -1
  98. package/lib/commands/issue/nudge.js +1 -1
  99. package/lib/commands/issue/report.js +1 -1
  100. package/lib/commands/issue/shared.js +1 -1
  101. package/lib/commands/logs/index.js +1 -1
  102. package/lib/commands/menu/asset-update.js +1 -1
  103. package/lib/commands/menu/delete.js +1 -1
  104. package/lib/commands/menu/external-link-create.js +1 -1
  105. package/lib/commands/menu/external-link-update.js +1 -1
  106. package/lib/commands/menu/group-create.js +1 -1
  107. package/lib/commands/menu/group-update.js +1 -1
  108. package/lib/commands/menu/index.js +1 -1
  109. package/lib/commands/menu/list.js +1 -1
  110. package/lib/commands/menu/move.js +1 -1
  111. package/lib/commands/menu/regroup-start.js +1 -1
  112. package/lib/commands/menu/rename.js +1 -0
  113. package/lib/commands/menu/shared/compare-table.js +1 -1
  114. package/lib/commands/menu/shared/delete-plan.js +1 -1
  115. package/lib/commands/menu/shared/facts.js +1 -1
  116. package/lib/commands/menu/shared/index.js +1 -1
  117. package/lib/commands/menu/shared/inquirer.js +1 -1
  118. package/lib/commands/menu/shared/local-pages.js +1 -1
  119. package/lib/commands/menu/shared/logic.js +1 -1
  120. package/lib/commands/menu/shared/mutations.js +1 -1
  121. package/lib/commands/menu/shared/service.js +1 -1
  122. package/lib/commands/menu/shared/sync-core.js +1 -1
  123. package/lib/commands/menu/shared/update-core.js +1 -1
  124. package/lib/commands/menu/shared/valid-url.js +1 -1
  125. package/lib/commands/menu/sync.js +1 -1
  126. package/lib/commands/notification/config-list.js +1 -1
  127. package/lib/commands/notification/index.js +1 -1
  128. package/lib/commands/ocr/index.js +1 -1
  129. package/lib/commands/page/generate-start.js +1 -1
  130. package/lib/commands/page/generate-status.js +1 -1
  131. package/lib/commands/page/index.js +1 -1
  132. package/lib/commands/page/pull.js +1 -1
  133. package/lib/commands/page/push.js +1 -1
  134. package/lib/commands/page/relation-audit.js +1 -1
  135. package/lib/commands/page/restore.js +1 -1
  136. package/lib/commands/page/shared.js +1 -1
  137. package/lib/commands/page/standard-page-status.js +1 -1
  138. package/lib/commands/page/sync.js +1 -1
  139. package/lib/commands/permit/index.js +1 -1
  140. package/lib/commands/permit/page-get.js +1 -1
  141. package/lib/commands/permit/page-set.js +1 -1
  142. package/lib/commands/permit/role-apis-set.js +1 -1
  143. package/lib/commands/permit/role-menus-set.js +1 -1
  144. package/lib/commands/permit/role-menus.js +1 -1
  145. package/lib/commands/permit/shared.js +1 -1
  146. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  147. package/lib/commands/project/create/format-elapsed.js +1 -1
  148. package/lib/commands/project/create/main.js +1 -1
  149. package/lib/commands/project/create/non-interactive.js +1 -1
  150. package/lib/commands/project/create/project-template-path.js +1 -1
  151. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  152. package/lib/commands/project/create/use-format-code.js +1 -1
  153. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  154. package/lib/commands/project/index.js +1 -1
  155. package/lib/commands/project/init.js +1 -1
  156. package/lib/commands/project/upgrade.js +1 -1
  157. package/lib/commands/registry.js +1 -1
  158. package/lib/commands/role/create.js +1 -1
  159. package/lib/commands/role/delete.js +1 -1
  160. package/lib/commands/role/detail.js +1 -1
  161. package/lib/commands/role/index.js +1 -1
  162. package/lib/commands/role/list.js +1 -1
  163. package/lib/commands/role/shared.js +1 -1
  164. package/lib/commands/role/update.js +1 -1
  165. package/lib/commands/role/user-add.js +1 -1
  166. package/lib/commands/role/user-remove.js +1 -1
  167. package/lib/commands/role/user-resolve.js +1 -1
  168. package/lib/commands/run/index.js +1 -1
  169. package/lib/commands/schema.js +1 -1
  170. package/lib/commands/sql/create.js +1 -1
  171. package/lib/commands/sql/delete.js +1 -1
  172. package/lib/commands/sql/detail.js +1 -1
  173. package/lib/commands/sql/exec.js +1 -1
  174. package/lib/commands/sql/index.js +1 -1
  175. package/lib/commands/sql/list.js +1 -1
  176. package/lib/commands/sql/pull.js +1 -1
  177. package/lib/commands/sql/push.js +1 -1
  178. package/lib/commands/sql/save.js +1 -1
  179. package/lib/commands/sql/shared.js +1 -1
  180. package/lib/commands/sql/status.js +1 -1
  181. package/lib/commands/sql/validate.js +1 -1
  182. package/lib/commands/task/index.js +1 -1
  183. package/lib/commands/task/status.js +1 -1
  184. package/lib/commands/workspace/add.js +1 -1
  185. package/lib/commands/workspace/index.js +1 -1
  186. package/lib/commands/workspace/remove.js +1 -1
  187. package/lib/config/schema.js +1 -1
  188. package/lib/constant/cdn.js +1 -1
  189. package/lib/constant/cli.js +1 -1
  190. package/lib/constant/defaults.js +1 -1
  191. package/lib/constant/domain.js +1 -1
  192. package/lib/constant/env.js +1 -1
  193. package/lib/constant/output.js +1 -1
  194. package/lib/constant/paths.js +1 -1
  195. package/lib/constant/risk.js +1 -1
  196. package/lib/context/app-resolver.js +1 -1
  197. package/lib/context/auth-resolver.js +1 -1
  198. package/lib/context/config-loader.js +1 -1
  199. package/lib/context.js +1 -1
  200. package/lib/core/alias-resolver.js +1 -1
  201. package/lib/core/api-client.js +1 -1
  202. package/lib/core/bff/config.js +1 -1
  203. package/lib/core/bff/file-system.js +1 -1
  204. package/lib/core/bff/hash.js +1 -1
  205. package/lib/core/bff/lock.js +1 -1
  206. package/lib/core/bff/utils.js +1 -1
  207. package/lib/core/db-resolver.js +1 -1
  208. package/lib/core/page/file-system.js +1 -1
  209. package/lib/core/page/hash.js +1 -1
  210. package/lib/core/page/lock.js +1 -1
  211. package/lib/core/sql-index-auditor.js +1 -1
  212. package/lib/core/sql-sync/config.js +1 -1
  213. package/lib/core/sql-sync/file-system.js +1 -1
  214. package/lib/core/sql-sync/hash.js +1 -1
  215. package/lib/core/sql-sync/lock.js +1 -1
  216. package/lib/core/sql-sync/utils.js +1 -1
  217. package/lib/core/sql-validator.js +1 -1
  218. package/lib/errors.js +1 -1
  219. package/lib/framework/build-all-flags.js +1 -1
  220. package/lib/framework/error-output.js +1 -1
  221. package/lib/framework/explicit-yes.js +1 -1
  222. package/lib/framework/flags.js +1 -1
  223. package/lib/framework/help.js +1 -1
  224. package/lib/framework/index.js +1 -1
  225. package/lib/framework/output.js +1 -1
  226. package/lib/framework/response.js +1 -1
  227. package/lib/framework/runner-alias.js +1 -1
  228. package/lib/framework/runner.js +1 -1
  229. package/lib/framework/schema-export.js +1 -1
  230. package/lib/framework/types.js +1 -1
  231. package/lib/generated/build-info.js +1 -1
  232. package/lib/help.js +1 -1
  233. package/lib/skills/main.js +1 -1
  234. package/lib/skills/npx-skills-add.js +1 -1
  235. package/lib/telemetry/cli-command-trace.js +1 -1
  236. package/lib/telemetry/cli-help-trace.js +1 -1
  237. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  238. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  239. package/lib/telemetry/send-cli-trace-log.js +1 -1
  240. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  241. package/lib/utils/ai_config.js +1 -1
  242. package/lib/utils/apply-jq-filter.js +1 -1
  243. package/lib/utils/cdn-config.js +1 -1
  244. package/lib/utils/check-sdk-version.js +1 -1
  245. package/lib/utils/cli-version-check.js +1 -1
  246. package/lib/utils/cli-version-policy.js +1 -1
  247. package/lib/utils/config.js +1 -1
  248. package/lib/utils/copy-directory.js +1 -1
  249. package/lib/utils/entity-with-id.js +1 -1
  250. package/lib/utils/file-utils.js +1 -1
  251. package/lib/utils/guides-cdn.js +1 -1
  252. package/lib/utils/http-client.js +1 -1
  253. package/lib/utils/is-non-interactive.js +1 -1
  254. package/lib/utils/logger.js +1 -1
  255. package/lib/utils/params.js +1 -1
  256. package/lib/utils/platform.js +1 -1
  257. package/lib/utils/rules-cdn.js +1 -1
  258. package/lib/utils/sleep.js +1 -1
  259. package/lib/utils/template-replacer.js +1 -1
  260. package/lib/utils/update-notice.js +1 -1
  261. package/lib/utils/version.js +1 -1
  262. package/lib/utils/with-active-cookie.js +1 -1
  263. package/lib/utils/write-cli-side-channel.js +1 -1
  264. package/package.json +1 -1
@@ -1 +1 @@
1
- const a156_0x2034a2=a156_0x5247;(function(_0x516a94,_0x5a9e68){const _0x41016a=a156_0x5247,_0x36c5cd=_0x516a94();while(!![]){try{const _0x1d94ae=parseInt(_0x41016a(0xa5))/0x1+parseInt(_0x41016a(0xc4))/0x2+parseInt(_0x41016a(0xb0))/0x3+parseInt(_0x41016a(0x8e))/0x4+parseInt(_0x41016a(0x94))/0x5*(-parseInt(_0x41016a(0xc1))/0x6)+parseInt(_0x41016a(0x8f))/0x7*(parseInt(_0x41016a(0xc9))/0x8)+-parseInt(_0x41016a(0xc5))/0x9;if(_0x1d94ae===_0x5a9e68)break;else _0x36c5cd['push'](_0x36c5cd['shift']());}catch(_0x1bc3a7){_0x36c5cd['push'](_0x36c5cd['shift']());}}}(a156_0x1b4d,0x233f5));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{taskDefinitions}from'../commands/task/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';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{ocrDefinitions}from'../commands/ocr/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';function a156_0x5247(_0xae212f,_0x2beb66){_0xae212f=_0xae212f-0x82;const _0x1b4d6d=a156_0x1b4d();let _0x524760=_0x1b4d6d[_0xae212f];return _0x524760;}function a156_0x1b4d(){const _0x1a2295=['isSingleCommand','`rabetbase\x20app\x20use`\x20has\x20been\x20removed.','skills','<script>','length','start','run','auth','build','`rabetbase\x20app\x20remote`\x20has\x20been\x20removed.','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20instead.','logout','`rabetbase\x20skills`\x20has\x20been\x20removed.','30moxZrw','preview','remote','10096zbaHhE','3452976BlVeeK','Quick\x20Start','app\x20use','Use\x20`rabetbase\x20workspace\x20use\x20--app\x20<name>`\x20instead.','2848wmBHEo','Database\x20Connections','filter','wildcardDef','Permissions','BFF\x20Scripts','install','defaultCommand','skill\x20','Smart\x20List\x20Pages','Authentication','Logs','Runtime\x20App\x20Config\x20Management','46992BADqoL','5649RUkErg','Dataset\x20&\x20Operations','App\x20Management','`rabetbase\x20','use','27590hvXXUV','Run\x20any\x20package.json\x20script','app','create','Use\x20`rabetbase\x20cli-skill\x20install`\x20to\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill.\x20To\x20install\x20business\x20Skills,\x20use\x20`lovrabet\x20skill\x20install`.','API\x20Development','push','Instant\x20API','asset-update','SQL\x20Queries','from','\x20\x20[high-risk-write]','Workspace','Menu','service','Schema','commands','51351QHJTRY','Platform\x20Issue','`\x20has\x20been\x20removed.','get','set','Async\x20Tasks','Configuration','CLI\x20Built-in\x20Skill','show','Run\x20Scripts','OCR','600564kSzuYe','command','skill','Diagnostics'];a156_0x1b4d=function(){return _0x1a2295;};return a156_0x1b4d();}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(_0x438211){const _0x4e3352=a156_0x5247;for(const _0x2e3043 of _0x438211){definitions[_0x4e3352(0xa9)](_0x2e3043[_0x4e3352(0xa2)]+':'+_0x2e3043[_0x4e3352(0xb1)],_0x2e3043);let _0x4a5671=serviceGroups['get'](_0x2e3043[_0x4e3352(0xa2)]);!_0x4a5671&&(_0x4a5671=[],serviceGroups['set'](_0x2e3043[_0x4e3352(0xa2)],_0x4a5671)),_0x4a5671[_0x4e3352(0x9a)](_0x2e3043);}}function registerDeclarativeService(_0x4ed9ce,_0x4bf011,_0x43708e){const _0x2f923b=a156_0x5247;registerDefinitions(_0x4bf011);_0x43708e?.[_0x2f923b(0x84)]&&registerDefinitions([_0x43708e[_0x2f923b(0x84)]]);const _0x55f2e1=_0x38deb4=>_0x38deb4==='read'?'':_0x38deb4==='write'?'\x20\x20[write]':_0x2f923b(0x9f),_0x4d4242={'service':_0x4bf011[0x0]['service'],'label':_0x4ed9ce,'commands':_0x4bf011[_0x2f923b(0x83)](_0x214664=>!_0x214664['hidden'])['map'](_0x119e47=>({'command':_0x119e47[_0x2f923b(0xb1)],'description':_0x119e47['description'],'tag':_0x55f2e1(_0x119e47['risk'])})),'declarative':!![],'defaultCommand':_0x43708e?.[_0x2f923b(0x88)]??(_0x43708e?.[_0x2f923b(0xb4)]?_0x4bf011[0x0][_0x2f923b(0xb1)]:undefined),'wildcardDef':_0x43708e?.[_0x2f923b(0x84)],'isSingleCommand':_0x43708e?.[_0x2f923b(0xb4)]};serviceRegistry[_0x2f923b(0x9a)](_0x4d4242),serviceByName[_0x2f923b(0xa9)](_0x4d4242['service'],_0x4d4242);}registerDeclarativeService(a156_0x2034a2(0xc6),initDefinitions,{'defaultCommand':a156_0x2034a2(0xba),'isSingleCommand':!![]}),registerDeclarativeService('Project',projectDefinitions),registerDeclarativeService(a156_0x2034a2(0xa0),workspaceDefinitions),registerDeclarativeService(a156_0x2034a2(0x91),appDefinitions),registerDeclarativeService(a156_0x2034a2(0x8b),authDefinitions,{'defaultCommand':'login'}),registerDeclarativeService(a156_0x2034a2(0x90),datasetDefinitions),registerDeclarativeService(a156_0x2034a2(0x8a),pageDefinitions),registerDeclarativeService(a156_0x2034a2(0x99),apiDefinitions),registerDeclarativeService(a156_0x2034a2(0x9b),dataDefinitions),registerDeclarativeService(a156_0x2034a2(0x86),bffDefinitions),registerDeclarativeService('Notification\x20Configuration',notificationDefinitions),registerDeclarativeService(a156_0x2034a2(0x9d),sqlDefinitions),registerDeclarativeService(a156_0x2034a2(0x82),dbDefinitions),registerDeclarativeService(a156_0x2034a2(0xa1),menuDefinitions),registerDeclarativeService(a156_0x2034a2(0xaa),taskDefinitions),registerDeclarativeService('Roles',roleDefinitions),registerDeclarativeService(a156_0x2034a2(0x85),permitDefinitions),registerDeclarativeService(a156_0x2034a2(0x8d),appConfigDefinitions),registerDeclarativeService(a156_0x2034a2(0xa6),issueDefinitions),registerDeclarativeService('File',fileDefinitions),registerDeclarativeService(a156_0x2034a2(0xaf),ocrDefinitions),registerDeclarativeService('Code\x20Generation',codegenDefinitions),registerDeclarativeService(a156_0x2034a2(0xab),configDefinitions),registerDeclarativeService(a156_0x2034a2(0xb3),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a156_0x2034a2(0xa3),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService('Self\x20Update',[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a156_0x2034a2(0xac),cliSkillDefinitions,{'defaultCommand':a156_0x2034a2(0x87)}),registerDeclarativeService(a156_0x2034a2(0x8c),logsDefinitions,{'defaultCommand':a156_0x2034a2(0xad)}),registerDeclarativeService(a156_0x2034a2(0xae),[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry[a156_0x2034a2(0xb8)]-0x1];last[a156_0x2034a2(0xa4)]=[{'command':a156_0x2034a2(0xb7),'description':a156_0x2034a2(0x95),'tag':''}];}export const deprecatedAliases={'create':{'service':'project','command':a156_0x2034a2(0x97)},'start':{'service':'run','command':a156_0x2034a2(0xb9)},'build':{'service':'run','command':a156_0x2034a2(0xbc)},'preview':{'service':a156_0x2034a2(0xba),'command':a156_0x2034a2(0xc2)},'logout':{'service':a156_0x2034a2(0xbb),'command':a156_0x2034a2(0xbf)}};const CLI_SKILL_INSTALL_REMOVED_HINT=a156_0x2034a2(0x98),APP_REMOTE_REMOVED_HINT=a156_0x2034a2(0xbe),APP_USE_REMOVED_HINT=a156_0x2034a2(0xc8);export function resolveRemovedCommand(_0x23d0d7,_0x3fb864){const _0x188175=a156_0x2034a2;if(_0x23d0d7===_0x188175(0xb2)){const _0x5e521b=_0x3fb864?_0x188175(0x89)+_0x3fb864:_0x188175(0xb2);return{'command':_0x5e521b,'message':_0x188175(0x92)+_0x5e521b+_0x188175(0xa7),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};}if(_0x23d0d7===_0x188175(0xb6))return{'command':_0x188175(0xb6),'message':_0x188175(0xc0),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};if(_0x23d0d7===_0x188175(0x96)&&_0x3fb864===_0x188175(0xc3))return{'command':'app\x20remote','message':_0x188175(0xbd),'hint':APP_REMOTE_REMOVED_HINT};if(_0x23d0d7===_0x188175(0x96)&&_0x3fb864===_0x188175(0x93))return{'command':_0x188175(0xc7),'message':_0x188175(0xb5),'hint':APP_USE_REMOVED_HINT};return undefined;}export const deprecatedSubcommands={'bff':{'new':a156_0x2034a2(0x97)},'sql':{'new':a156_0x2034a2(0x97)},'menu':{'update':a156_0x2034a2(0x9c)}};export function resolveDeprecatedSubcommand(_0x1db72d,_0x3de62d){return deprecatedSubcommands[_0x1db72d]?.[_0x3de62d];}export function findDefinition(_0x2d705d,_0x32de2e){const _0x194e7f=a156_0x2034a2;return definitions[_0x194e7f(0xa8)](_0x2d705d+':'+_0x32de2e);}export function isKnownService(_0x3551ef){return serviceByName['has'](_0x3551ef);}export function isDeclarativeService(_0x157954){const _0x5c0e7f=a156_0x2034a2;return serviceGroups['has'](_0x157954)||serviceByName['get'](_0x157954)?.[_0x5c0e7f(0x84)]!==undefined;}export function getServiceEntry(_0x508d79){const _0x16a4f8=a156_0x2034a2;return serviceByName[_0x16a4f8(0xa8)](_0x508d79);}export function getLegacyHandler(_0x35ba9f,_0x1add06){return undefined;}export function getAllDefinitions(){const _0x34cc64=a156_0x2034a2;return Array[_0x34cc64(0x9e)](definitions['values']());}
1
+ const a157_0x5ee886=a157_0x4ab7;(function(_0x5e898d,_0x4c2f3a){const _0xa1c69=a157_0x4ab7,_0xbabab9=_0x5e898d();while(!![]){try{const _0x4902f6=-parseInt(_0xa1c69(0x186))/0x1*(-parseInt(_0xa1c69(0x18f))/0x2)+-parseInt(_0xa1c69(0x1a1))/0x3+parseInt(_0xa1c69(0x1a9))/0x4+-parseInt(_0xa1c69(0x1a3))/0x5*(-parseInt(_0xa1c69(0x171))/0x6)+parseInt(_0xa1c69(0x183))/0x7+parseInt(_0xa1c69(0x180))/0x8*(-parseInt(_0xa1c69(0x170))/0x9)+parseInt(_0xa1c69(0x16d))/0xa*(-parseInt(_0xa1c69(0x169))/0xb);if(_0x4902f6===_0x4c2f3a)break;else _0xbabab9['push'](_0xbabab9['shift']());}catch(_0x219ab0){_0xbabab9['push'](_0xbabab9['shift']());}}}(a157_0x36ab,0x2198f));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{taskDefinitions}from'../commands/task/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';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{ocrDefinitions}from'../commands/ocr/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 a157_0x4ab7(_0x2f7c9a,_0x5c1d98){_0x2f7c9a=_0x2f7c9a-0x169;const _0x36abd2=a157_0x36ab();let _0x4ab7f4=_0x36abd2[_0x2f7c9a];return _0x4ab7f4;}import{projectDefinitions}from'../commands/project/index.js';import{initDefinitions}from'../commands/init/index.js';import{runDefinition}from'../commands/run/index.js';export const serviceRegistry=[];function a157_0x36ab(){const _0x49be38=['write','create','skill','app','347850XhQFqP','Use\x20`rabetbase\x20cli-skill\x20install`\x20to\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill.\x20To\x20install\x20business\x20Skills,\x20use\x20`lovrabet\x20skill\x20install`.','288590AvFvJB','\x20\x20[write]','Logs','start','`\x20has\x20been\x20removed.','CLI\x20Built-in\x20Skill','947984MyFmqN','Run\x20any\x20package.json\x20script','values','command','`rabetbase\x20app\x20use`\x20has\x20been\x20removed.','File','Schema','asset-update','Use\x20`rabetbase\x20workspace\x20use\x20--app\x20<name>`\x20instead.','<script>','572fmPupJ','service','run','Platform\x20Issue','51370wectDj','hidden','isSingleCommand','4104URXSzh','6FlVWlS','Workspace','logout','from','Quick\x20Start','set','`rabetbase\x20','`rabetbase\x20skills`\x20has\x20been\x20removed.','project','wildcardDef','`rabetbase\x20app\x20remote`\x20has\x20been\x20removed.','push','Configuration','Roles','has','128ZSyznf','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20instead.','Database\x20Connections','1516627ckEveW','remote','Smart\x20List\x20Pages','2JhhvOu','app\x20use','API\x20Development','Diagnostics','read','App\x20Management','build','Code\x20Generation','Runtime\x20App\x20Config\x20Management','16610IRsRuo','login','map','defaultCommand','Notification\x20Configuration','preview','BFF\x20Scripts','Dataset\x20&\x20Operations','SQL\x20Queries','skill\x20','get','Async\x20Tasks','filter','commands'];a157_0x36ab=function(){return _0x49be38;};return a157_0x36ab();}const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x596c65){const _0x115b5d=a157_0x4ab7;for(const _0x3f7564 of _0x596c65){definitions[_0x115b5d(0x176)](_0x3f7564[_0x115b5d(0x16a)]+':'+_0x3f7564[_0x115b5d(0x1ac)],_0x3f7564);let _0x599422=serviceGroups[_0x115b5d(0x199)](_0x3f7564[_0x115b5d(0x16a)]);!_0x599422&&(_0x599422=[],serviceGroups[_0x115b5d(0x176)](_0x3f7564[_0x115b5d(0x16a)],_0x599422)),_0x599422[_0x115b5d(0x17c)](_0x3f7564);}}function registerDeclarativeService(_0x3fe49e,_0xbac111,_0x334ce8){const _0x2f7cfe=a157_0x4ab7;registerDefinitions(_0xbac111);_0x334ce8?.[_0x2f7cfe(0x17a)]&&registerDefinitions([_0x334ce8['wildcardDef']]);const _0xfdf60=_0x4250dd=>_0x4250dd===_0x2f7cfe(0x18a)?'':_0x4250dd===_0x2f7cfe(0x19d)?_0x2f7cfe(0x1a4):'\x20\x20[high-risk-write]',_0x1a6af8={'service':_0xbac111[0x0]['service'],'label':_0x3fe49e,'commands':_0xbac111[_0x2f7cfe(0x19b)](_0x390abc=>!_0x390abc[_0x2f7cfe(0x16e)])[_0x2f7cfe(0x191)](_0xb102da=>({'command':_0xb102da[_0x2f7cfe(0x1ac)],'description':_0xb102da['description'],'tag':_0xfdf60(_0xb102da['risk'])})),'declarative':!![],'defaultCommand':_0x334ce8?.[_0x2f7cfe(0x192)]??(_0x334ce8?.[_0x2f7cfe(0x16f)]?_0xbac111[0x0][_0x2f7cfe(0x1ac)]:undefined),'wildcardDef':_0x334ce8?.['wildcardDef'],'isSingleCommand':_0x334ce8?.[_0x2f7cfe(0x16f)]};serviceRegistry[_0x2f7cfe(0x17c)](_0x1a6af8),serviceByName['set'](_0x1a6af8['service'],_0x1a6af8);}registerDeclarativeService(a157_0x5ee886(0x175),initDefinitions,{'defaultCommand':'run','isSingleCommand':!![]}),registerDeclarativeService('Project',projectDefinitions),registerDeclarativeService(a157_0x5ee886(0x172),workspaceDefinitions),registerDeclarativeService(a157_0x5ee886(0x18b),appDefinitions),registerDeclarativeService('Authentication',authDefinitions,{'defaultCommand':a157_0x5ee886(0x190)}),registerDeclarativeService(a157_0x5ee886(0x196),datasetDefinitions),registerDeclarativeService(a157_0x5ee886(0x185),pageDefinitions),registerDeclarativeService(a157_0x5ee886(0x188),apiDefinitions),registerDeclarativeService('Instant\x20API',dataDefinitions),registerDeclarativeService(a157_0x5ee886(0x195),bffDefinitions),registerDeclarativeService(a157_0x5ee886(0x193),notificationDefinitions),registerDeclarativeService(a157_0x5ee886(0x197),sqlDefinitions),registerDeclarativeService(a157_0x5ee886(0x182),dbDefinitions),registerDeclarativeService('Menu',menuDefinitions),registerDeclarativeService(a157_0x5ee886(0x19a),taskDefinitions),registerDeclarativeService(a157_0x5ee886(0x17e),roleDefinitions),registerDeclarativeService('Permissions',permitDefinitions),registerDeclarativeService(a157_0x5ee886(0x18e),appConfigDefinitions),registerDeclarativeService(a157_0x5ee886(0x16c),issueDefinitions),registerDeclarativeService(a157_0x5ee886(0x1ae),fileDefinitions),registerDeclarativeService('OCR',ocrDefinitions),registerDeclarativeService(a157_0x5ee886(0x18d),codegenDefinitions),registerDeclarativeService(a157_0x5ee886(0x17d),configDefinitions),registerDeclarativeService(a157_0x5ee886(0x189),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a157_0x5ee886(0x1af),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService('Self\x20Update',[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a157_0x5ee886(0x1a8),cliSkillDefinitions,{'defaultCommand':'install'}),registerDeclarativeService(a157_0x5ee886(0x1a5),logsDefinitions,{'defaultCommand':'show'}),registerDeclarativeService('Run\x20Scripts',[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry['length']-0x1];last[a157_0x5ee886(0x19c)]=[{'command':a157_0x5ee886(0x1b2),'description':a157_0x5ee886(0x1aa),'tag':''}];}export const deprecatedAliases={'create':{'service':a157_0x5ee886(0x179),'command':a157_0x5ee886(0x19e)},'start':{'service':a157_0x5ee886(0x16b),'command':a157_0x5ee886(0x1a6)},'build':{'service':a157_0x5ee886(0x16b),'command':a157_0x5ee886(0x18c)},'preview':{'service':a157_0x5ee886(0x16b),'command':a157_0x5ee886(0x194)},'logout':{'service':'auth','command':a157_0x5ee886(0x173)}};const CLI_SKILL_INSTALL_REMOVED_HINT=a157_0x5ee886(0x1a2),APP_REMOTE_REMOVED_HINT=a157_0x5ee886(0x181),APP_USE_REMOVED_HINT=a157_0x5ee886(0x1b1);export function resolveRemovedCommand(_0x5cbc42,_0x1bc857){const _0x2a2d43=a157_0x5ee886;if(_0x5cbc42==='skill'){const _0x5a8414=_0x1bc857?_0x2a2d43(0x198)+_0x1bc857:_0x2a2d43(0x19f);return{'command':_0x5a8414,'message':_0x2a2d43(0x177)+_0x5a8414+_0x2a2d43(0x1a7),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};}if(_0x5cbc42==='skills')return{'command':'skills','message':_0x2a2d43(0x178),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};if(_0x5cbc42===_0x2a2d43(0x1a0)&&_0x1bc857===_0x2a2d43(0x184))return{'command':'app\x20remote','message':_0x2a2d43(0x17b),'hint':APP_REMOTE_REMOVED_HINT};if(_0x5cbc42==='app'&&_0x1bc857==='use')return{'command':_0x2a2d43(0x187),'message':_0x2a2d43(0x1ad),'hint':APP_USE_REMOVED_HINT};return undefined;}export const deprecatedSubcommands={'bff':{'new':'create'},'sql':{'new':a157_0x5ee886(0x19e)},'menu':{'update':a157_0x5ee886(0x1b0)}};export function resolveDeprecatedSubcommand(_0x3fc075,_0x435805){return deprecatedSubcommands[_0x3fc075]?.[_0x435805];}export function findDefinition(_0x2e06f8,_0x17317a){const _0x531481=a157_0x5ee886;return definitions[_0x531481(0x199)](_0x2e06f8+':'+_0x17317a);}export function isKnownService(_0x3f47b2){const _0x37f4fa=a157_0x5ee886;return serviceByName[_0x37f4fa(0x17f)](_0x3f47b2);}export function isDeclarativeService(_0x1f677d){const _0x4b3b79=a157_0x5ee886;return serviceGroups[_0x4b3b79(0x17f)](_0x1f677d)||serviceByName[_0x4b3b79(0x199)](_0x1f677d)?.[_0x4b3b79(0x17a)]!==undefined;}export function getServiceEntry(_0x3f1284){const _0x531208=a157_0x5ee886;return serviceByName[_0x531208(0x199)](_0x3f1284);}export function getLegacyHandler(_0x137bc3,_0x39373b){return undefined;}export function getAllDefinitions(){const _0x515756=a157_0x5ee886;return Array[_0x515756(0x174)](definitions[_0x515756(0x1ab)]());}
@@ -1 +1 @@
1
- const a157_0x22ade1=a157_0x54f6;(function(_0x29bdb2,_0x5e32ca){const _0x78d820=a157_0x54f6,_0x5eb554=_0x29bdb2();while(!![]){try{const _0x307a5f=parseInt(_0x78d820(0x146))/0x1*(-parseInt(_0x78d820(0x153))/0x2)+-parseInt(_0x78d820(0x145))/0x3*(parseInt(_0x78d820(0x14e))/0x4)+parseInt(_0x78d820(0x156))/0x5*(parseInt(_0x78d820(0x15b))/0x6)+-parseInt(_0x78d820(0x147))/0x7*(parseInt(_0x78d820(0x150))/0x8)+-parseInt(_0x78d820(0x14f))/0x9+-parseInt(_0x78d820(0x151))/0xa+parseInt(_0x78d820(0x14d))/0xb;if(_0x307a5f===_0x5e32ca)break;else _0x5eb554['push'](_0x5eb554['shift']());}catch(_0x1671bd){_0x5eb554['push'](_0x5eb554['shift']());}}}(a157_0x3f32,0xdc943));import{createAppRole}from'../../core/api-client.js';function a157_0x54f6(_0x4e8c82,_0x11931a){_0x4e8c82=_0x4e8c82-0x144;const _0x3f32f8=a157_0x3f32();let _0x54f645=_0x3f32f8[_0x4e8c82];return _0x54f645;}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';function a157_0x3f32(){const _0x38a4f9=['validation','Create\x20a\x20CUSTOM\x20user\x20group\x20(role)','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','length','141sSYHPY','33583sJNRZT','7vRsatZ','create','flagMissing','\x20(id=','write','name','73672852opJhnt','122316XhndZx','13953402XJCdGR','1625704LHUuhR','17262260KtGYpb','Created\x20role\x20','62LBAlxz','appCode','POST','410155iEImmm','role','remark','roleName','str','12eNUXDX'];a157_0x3f32=function(){return _0x38a4f9;};return a157_0x3f32();}const CREATE_PATH='/smartapi/permit/role/create';function readName(_0x1740ee){const _0x3df5c7=a157_0x54f6,_0x5a4cc9=_0x1740ee[_0x3df5c7(0x15a)](_0x3df5c7(0x14c))['trim']();if(!_0x5a4cc9)throw CliErrors[_0x3df5c7(0x149)](_0x3df5c7(0x14c),'Pass\x20--name\x20<roleName>.');if(_0x5a4cc9[_0x3df5c7(0x144)]>0x40)throw CliErrors[_0x3df5c7(0x15c)](_0x3df5c7(0x15e));return _0x5a4cc9;}export const roleCreate={'service':a157_0x22ade1(0x157),'command':a157_0x22ade1(0x148),'description':a157_0x22ade1(0x15d),'risk':a157_0x22ade1(0x14b),'flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x7250fa){readName(_0x7250fa);},async 'dryRun'(_0x2086d7){const _0x595bc5=a157_0x22ade1,_0x3d417e=readName(_0x2086d7),_0x521da6=_0x2086d7[_0x595bc5(0x15a)](_0x595bc5(0x158))['trim']()||undefined;return asDryRunResult({'operation':_0x595bc5(0x148),'selector':{'appCode':_0x2086d7[_0x595bc5(0x154)],'roleName':_0x3d417e},'before':null,'after':{'roleName':_0x3d417e,'roleType':'CUSTOM','remark':_0x521da6},'dryRun':!![],'backend':{'method':_0x595bc5(0x155),'path':CREATE_PATH},'warnings':[]},{'method':'POST','url':CREATE_PATH});},async 'execute'(_0x439a2c){const _0x5a564c=a157_0x22ade1,_0x5f1d93=readName(_0x439a2c),_0x53d4bd=_0x439a2c['str'](_0x5a564c(0x158))['trim']()||undefined,_0x10db10=await createAppRole({'appCode':_0x439a2c['appCode'],'roleName':_0x5f1d93,..._0x53d4bd?{'remark':_0x53d4bd}:{}});return{'ok':!![],'data':{'operation':_0x5a564c(0x148),'selector':{'appCode':_0x439a2c['appCode'],'roleId':_0x10db10['id'],'roleName':_0x5f1d93},'before':null,'after':projectRole(_0x10db10),'dryRun':![],'backend':{'method':_0x5a564c(0x155),'path':CREATE_PATH},'warnings':[]},'message':_0x5a564c(0x152)+_0x10db10[_0x5a564c(0x159)]+_0x5a564c(0x14a)+_0x10db10['id']+')'};}};
1
+ const a158_0x1a0060=a158_0x2585;(function(_0x18063f,_0x35312c){const _0xb800=a158_0x2585,_0x1008a6=_0x18063f();while(!![]){try{const _0x595de0=-parseInt(_0xb800(0x1c9))/0x1*(-parseInt(_0xb800(0x1c7))/0x2)+-parseInt(_0xb800(0x1c3))/0x3*(parseInt(_0xb800(0x1cb))/0x4)+-parseInt(_0xb800(0x1d5))/0x5*(parseInt(_0xb800(0x1cf))/0x6)+-parseInt(_0xb800(0x1cc))/0x7+-parseInt(_0xb800(0x1d7))/0x8+parseInt(_0xb800(0x1d2))/0x9+parseInt(_0xb800(0x1d8))/0xa*(parseInt(_0xb800(0x1d4))/0xb);if(_0x595de0===_0x35312c)break;else _0x1008a6['push'](_0x1008a6['shift']());}catch(_0x2f2a46){_0x1008a6['push'](_0x1008a6['shift']());}}}(a158_0x17af,0x19b0e));function a158_0x17af(){const _0x80fc4=['5VMylUU','appCode','514040ktVynj','90wOAahh','\x20(id=','Create\x20a\x20CUSTOM\x20user\x20group\x20(role)','remark','str','89319wXHJAn','Pass\x20--name\x20<roleName>.','CUSTOM','create','4OqWRCw','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','98851ZSKeSJ','validation','4rBQACu','1187774vVkwzo','name','POST','733920oVaMBm','roleName','trim','702234bfPSqu','/smartapi/permit/role/create','263428EPgFeX'];a158_0x17af=function(){return _0x80fc4;};return a158_0x17af();}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';function a158_0x2585(_0x44465d,_0x4eed23){_0x44465d=_0x44465d-0x1c2;const _0x17afe3=a158_0x17af();let _0x258556=_0x17afe3[_0x44465d];return _0x258556;}const CREATE_PATH=a158_0x1a0060(0x1d3);function readName(_0x420172){const _0x479041=a158_0x1a0060,_0x5dab08=_0x420172[_0x479041(0x1c2)](_0x479041(0x1cd))['trim']();if(!_0x5dab08)throw CliErrors['flagMissing'](_0x479041(0x1cd),_0x479041(0x1c4));if(_0x5dab08['length']>0x40)throw CliErrors[_0x479041(0x1ca)](_0x479041(0x1c8));return _0x5dab08;}export const roleCreate={'service':'role','command':'create','description':a158_0x1a0060(0x1da),'risk':'write','flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5c5036){readName(_0x5c5036);},async 'dryRun'(_0x5c7e85){const _0x31d069=a158_0x1a0060,_0x19a701=readName(_0x5c7e85),_0x4634cc=_0x5c7e85[_0x31d069(0x1c2)]('remark')[_0x31d069(0x1d1)]()||undefined;return asDryRunResult({'operation':'create','selector':{'appCode':_0x5c7e85['appCode'],'roleName':_0x19a701},'before':null,'after':{'roleName':_0x19a701,'roleType':_0x31d069(0x1c5),'remark':_0x4634cc},'dryRun':!![],'backend':{'method':_0x31d069(0x1ce),'path':CREATE_PATH},'warnings':[]},{'method':_0x31d069(0x1ce),'url':CREATE_PATH});},async 'execute'(_0x357c54){const _0x42cb96=a158_0x1a0060,_0x2d10c6=readName(_0x357c54),_0x4b7776=_0x357c54[_0x42cb96(0x1c2)](_0x42cb96(0x1db))[_0x42cb96(0x1d1)]()||undefined,_0x84d45b=await createAppRole({'appCode':_0x357c54[_0x42cb96(0x1d6)],'roleName':_0x2d10c6,..._0x4b7776?{'remark':_0x4b7776}:{}});return{'ok':!![],'data':{'operation':_0x42cb96(0x1c6),'selector':{'appCode':_0x357c54[_0x42cb96(0x1d6)],'roleId':_0x84d45b['id'],'roleName':_0x2d10c6},'before':null,'after':projectRole(_0x84d45b),'dryRun':![],'backend':{'method':_0x42cb96(0x1ce),'path':CREATE_PATH},'warnings':[]},'message':'Created\x20role\x20'+_0x84d45b[_0x42cb96(0x1d0)]+_0x42cb96(0x1d9)+_0x84d45b['id']+')'};}};
@@ -1 +1 @@
1
- const a158_0x5d67ba=a158_0x3dec;function a158_0x3dec(_0x3c9f3c,_0x4860d7){_0x3c9f3c=_0x3c9f3c-0x175;const _0xd34937=a158_0xd349();let _0x3decde=_0xd34937[_0x3c9f3c];return _0x3decde;}(function(_0x3dbdd5,_0x4bd01f){const _0x3cd91f=a158_0x3dec,_0x45d9d7=_0x3dbdd5();while(!![]){try{const _0x4ea665=-parseInt(_0x3cd91f(0x17c))/0x1+-parseInt(_0x3cd91f(0x187))/0x2+-parseInt(_0x3cd91f(0x17e))/0x3+parseInt(_0x3cd91f(0x17a))/0x4+parseInt(_0x3cd91f(0x181))/0x5*(-parseInt(_0x3cd91f(0x17d))/0x6)+parseInt(_0x3cd91f(0x177))/0x7+parseInt(_0x3cd91f(0x18a))/0x8*(parseInt(_0x3cd91f(0x185))/0x9);if(_0x4ea665===_0x4bd01f)break;else _0x45d9d7['push'](_0x45d9d7['shift']());}catch(_0x115d6b){_0x45d9d7['push'](_0x45d9d7['shift']());}}}(a158_0xd349,0x6bb32));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=a158_0x5d67ba(0x175);function a158_0xd349(){const _0x4bf986=['high-risk-write','Role\x20still\x20has\x20','1145wocXfa','delete','Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','role','45ocbnKs','num','605788juYKzD','Deleted\x20role\x20','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','1588824CnEuDN','\x20(id=','/smartapi/permit/role/delete','userCount','3280697AomZfX','roleName','POST','1703840SEIcQm','appCode','607349qtdbHJ','726SxwcPO','1525668IdPdvv'];a158_0xd349=function(){return _0x4bf986;};return a158_0xd349();}export const roleDelete={'service':a158_0x5d67ba(0x184),'command':a158_0x5d67ba(0x182),'description':a158_0x5d67ba(0x183),'risk':a158_0x5d67ba(0x17f),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x4c4799){const _0x42202b=a158_0x5d67ba,_0xb6b74e=_0x4c4799[_0x42202b(0x186)]('id'),_0x461bbe=await getRoleById(_0x4c4799[_0x42202b(0x17b)],_0xb6b74e);return assertCustomRole(_0x461bbe,_0x42202b(0x182)),asDryRunResult({'operation':_0x42202b(0x182),'selector':{'appCode':_0x4c4799[_0x42202b(0x17b)],'roleId':_0xb6b74e,'roleName':_0x461bbe['roleName']},'before':projectRole(_0x461bbe),'after':null,'dryRun':!![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':_0x461bbe[_0x42202b(0x176)]>0x0?[_0x42202b(0x180)+_0x461bbe['userCount']+_0x42202b(0x189)]:[]},{'method':_0x42202b(0x179),'url':DELETE_PATH});},async 'execute'(_0x11b920){const _0x5f4e00=a158_0x5d67ba,_0x1cf70e=_0x11b920['num']('id'),_0x47427b=await getRoleById(_0x11b920[_0x5f4e00(0x17b)],_0x1cf70e);return assertCustomRole(_0x47427b,'delete'),await deleteAppRole(_0x1cf70e),{'ok':!![],'data':{'operation':_0x5f4e00(0x182),'selector':{'appCode':_0x11b920['appCode'],'roleId':_0x1cf70e,'roleName':_0x47427b[_0x5f4e00(0x178)]},'before':projectRole(_0x47427b),'after':null,'dryRun':![],'backend':{'method':_0x5f4e00(0x179),'path':DELETE_PATH},'warnings':[]},'message':_0x5f4e00(0x188)+_0x47427b[_0x5f4e00(0x178)]+_0x5f4e00(0x18b)+_0x1cf70e+')'};}};
1
+ function a159_0x4c72(_0x392f22,_0xa5b611){_0x392f22=_0x392f22-0x16f;const _0x4e7226=a159_0x4e72();let _0x4c726f=_0x4e7226[_0x392f22];return _0x4c726f;}const a159_0x18d938=a159_0x4c72;(function(_0x45e7bc,_0x41066d){const _0x4e38ae=a159_0x4c72,_0x3d5102=_0x45e7bc();while(!![]){try{const _0x400575=-parseInt(_0x4e38ae(0x181))/0x1+-parseInt(_0x4e38ae(0x17b))/0x2*(parseInt(_0x4e38ae(0x16f))/0x3)+parseInt(_0x4e38ae(0x170))/0x4+parseInt(_0x4e38ae(0x17e))/0x5*(-parseInt(_0x4e38ae(0x183))/0x6)+parseInt(_0x4e38ae(0x179))/0x7+parseInt(_0x4e38ae(0x171))/0x8+-parseInt(_0x4e38ae(0x173))/0x9;if(_0x400575===_0x41066d)break;else _0x3d5102['push'](_0x3d5102['shift']());}catch(_0x599244){_0x3d5102['push'](_0x3d5102['shift']());}}}(a159_0x4e72,0x5283a));function a159_0x4e72(){const _0x9f3f92=['role','Deleted\x20role\x20','172069eBrLjI','roleName','6588OHUYeU','10761yWdWBq','2294452QUrbra','3599592gXjuqy','num','1071459cIXwZK','Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','POST','userCount','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','high-risk-write','2283589nKfokA','appCode','370KVAVUd','delete','Role\x20still\x20has\x20','260SULBfV'];a159_0x4e72=function(){return _0x9f3f92;};return a159_0x4e72();}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='/smartapi/permit/role/delete';export const roleDelete={'service':a159_0x18d938(0x17f),'command':a159_0x18d938(0x17c),'description':a159_0x18d938(0x174),'risk':a159_0x18d938(0x178),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x125ce3){const _0x59b5ec=a159_0x18d938,_0x6d2cba=_0x125ce3[_0x59b5ec(0x172)]('id'),_0x3561b9=await getRoleById(_0x125ce3[_0x59b5ec(0x17a)],_0x6d2cba);return assertCustomRole(_0x3561b9,'delete'),asDryRunResult({'operation':'delete','selector':{'appCode':_0x125ce3[_0x59b5ec(0x17a)],'roleId':_0x6d2cba,'roleName':_0x3561b9['roleName']},'before':projectRole(_0x3561b9),'after':null,'dryRun':!![],'backend':{'method':_0x59b5ec(0x175),'path':DELETE_PATH},'warnings':_0x3561b9[_0x59b5ec(0x176)]>0x0?[_0x59b5ec(0x17d)+_0x3561b9[_0x59b5ec(0x176)]+_0x59b5ec(0x177)]:[]},{'method':_0x59b5ec(0x175),'url':DELETE_PATH});},async 'execute'(_0x31902a){const _0x1d06e5=a159_0x18d938,_0x1c4fd3=_0x31902a[_0x1d06e5(0x172)]('id'),_0x4825d3=await getRoleById(_0x31902a[_0x1d06e5(0x17a)],_0x1c4fd3);return assertCustomRole(_0x4825d3,_0x1d06e5(0x17c)),await deleteAppRole(_0x1c4fd3),{'ok':!![],'data':{'operation':_0x1d06e5(0x17c),'selector':{'appCode':_0x31902a[_0x1d06e5(0x17a)],'roleId':_0x1c4fd3,'roleName':_0x4825d3[_0x1d06e5(0x182)]},'before':projectRole(_0x4825d3),'after':null,'dryRun':![],'backend':{'method':_0x1d06e5(0x175),'path':DELETE_PATH},'warnings':[]},'message':_0x1d06e5(0x180)+_0x4825d3[_0x1d06e5(0x182)]+'\x20(id='+_0x1c4fd3+')'};}};
@@ -1 +1 @@
1
- const a159_0x3fa8d2=a159_0x5e81;function a159_0x25d4(){const _0x1a3db0=['188485bbgrTH','1290270nazguH','roleType','14360288iMEqmG','45qqZDEc','1477214RHAUpZ','num','258ZTmdhk','role','Role\x20','61468XCnAMS','detail','423MtUTCA','3652460KoknCp','9425654qUFhuh','appCode'];a159_0x25d4=function(){return _0x1a3db0;};return a159_0x25d4();}(function(_0x36a9e2,_0x1ff596){const _0x3904df=a159_0x5e81,_0x15872a=_0x36a9e2();while(!![]){try{const _0x46928c=-parseInt(_0x3904df(0x16d))/0x1+-parseInt(_0x3904df(0x175))/0x2+parseInt(_0x3904df(0x16c))/0x3*(parseInt(_0x3904df(0x172))/0x4)+-parseInt(_0x3904df(0x168))/0x5*(parseInt(_0x3904df(0x16f))/0x6)+parseInt(_0x3904df(0x176))/0x7+-parseInt(_0x3904df(0x16b))/0x8+-parseInt(_0x3904df(0x174))/0x9*(-parseInt(_0x3904df(0x169))/0xa);if(_0x46928c===_0x1ff596)break;else _0x15872a['push'](_0x15872a['shift']());}catch(_0x21cb8d){_0x15872a['push'](_0x15872a['shift']());}}}(a159_0x25d4,0xe10f5));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a159_0x5e81(_0x24b9fe,_0x701e7){_0x24b9fe=_0x24b9fe-0x167;const _0x25d440=a159_0x25d4();let _0x5e8126=_0x25d440[_0x24b9fe];return _0x5e8126;}import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a159_0x3fa8d2(0x170),'command':a159_0x3fa8d2(0x173),'description':'Show\x20a\x20single\x20role\x27s\x20detail','risk':'read','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0xa1a803){const _0x149ef3=a159_0x3fa8d2,_0xcb6b6e=_0xa1a803[_0x149ef3(0x16e)]('id'),_0x1c0f41=await getRoleById(_0xa1a803[_0x149ef3(0x167)],_0xcb6b6e);return{'ok':!![],'data':{'role':projectRole(_0x1c0f41)},'message':_0x149ef3(0x171)+_0x1c0f41['roleName']+'\x20('+_0x1c0f41[_0x149ef3(0x16a)]+')'};}};
1
+ const a160_0x92f65=a160_0x4e17;(function(_0xc6bf5f,_0x4b426a){const _0x1abbdb=a160_0x4e17,_0x217535=_0xc6bf5f();while(!![]){try{const _0x1d6484=parseInt(_0x1abbdb(0xf7))/0x1+parseInt(_0x1abbdb(0xff))/0x2*(-parseInt(_0x1abbdb(0x103))/0x3)+parseInt(_0x1abbdb(0x106))/0x4+parseInt(_0x1abbdb(0x101))/0x5+-parseInt(_0x1abbdb(0x102))/0x6*(parseInt(_0x1abbdb(0x107))/0x7)+-parseInt(_0x1abbdb(0x105))/0x8*(parseInt(_0x1abbdb(0xfa))/0x9)+-parseInt(_0x1abbdb(0xfd))/0xa*(-parseInt(_0x1abbdb(0xfb))/0xb);if(_0x1d6484===_0x4b426a)break;else _0x217535['push'](_0x217535['shift']());}catch(_0x3f1fdc){_0x217535['push'](_0x217535['shift']());}}}(a160_0x4789,0x2d3fd));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a160_0x4789(){const _0x500da9=['Show\x20a\x20single\x20role\x27s\x20detail','read','45oPEuNL','2497GayfBG','num','10370QjSRGu','role','23858uZzDma','Role\x20','1569020qXVqny','84gOXhTQ','78iJNUPo','appCode','511064joNtRP','45876QJaDQD','19488RTTwac','293214xRlcfB'];a160_0x4789=function(){return _0x500da9;};return a160_0x4789();}function a160_0x4e17(_0x2e1d52,_0x2dc61b){_0x2e1d52=_0x2e1d52-0xf7;const _0x478919=a160_0x4789();let _0x4e1796=_0x478919[_0x2e1d52];return _0x4e1796;}import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a160_0x92f65(0xfe),'command':'detail','description':a160_0x92f65(0xf8),'risk':a160_0x92f65(0xf9),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x1e7ea3){const _0x2ebce2=a160_0x92f65,_0x334e0b=_0x1e7ea3[_0x2ebce2(0xfc)]('id'),_0x4a82d0=await getRoleById(_0x1e7ea3[_0x2ebce2(0x104)],_0x334e0b);return{'ok':!![],'data':{'role':projectRole(_0x4a82d0)},'message':_0x2ebce2(0x100)+_0x4a82d0['roleName']+'\x20('+_0x4a82d0['roleType']+')'};}};
@@ -1 +1 @@
1
- (function(_0x243fa5,_0x5b67ed){const _0x121d73=a160_0x1d83,_0x50b4e2=_0x243fa5();while(!![]){try{const _0x571a9d=parseInt(_0x121d73(0xce))/0x1+-parseInt(_0x121d73(0xd2))/0x2+parseInt(_0x121d73(0xd7))/0x3*(-parseInt(_0x121d73(0xd3))/0x4)+-parseInt(_0x121d73(0xd1))/0x5*(-parseInt(_0x121d73(0xd5))/0x6)+parseInt(_0x121d73(0xd4))/0x7+-parseInt(_0x121d73(0xd0))/0x8*(parseInt(_0x121d73(0xd8))/0x9)+parseInt(_0x121d73(0xd6))/0xa*(parseInt(_0x121d73(0xcf))/0xb);if(_0x571a9d===_0x5b67ed)break;else _0x50b4e2['push'](_0x50b4e2['shift']());}catch(_0x503c19){_0x50b4e2['push'](_0x50b4e2['shift']());}}}(a160_0x2dd0,0x56691));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';function a160_0x1d83(_0x2dd210,_0x372f89){_0x2dd210=_0x2dd210-0xce;const _0x2dd0a6=a160_0x2dd0();let _0x1d83b4=_0x2dd0a6[_0x2dd210];return _0x1d83b4;}import{roleCreate}from'../../commands/role/create.js';function a160_0x2dd0(){const _0x3412e3=['12INgmJV','54zKBoov','390950FTbkxS','11499312nSWTIU','168944BuVFlo','330AwaSwp','1192450osnOdw','632976FMWjIu','1328712blZgaV','7608vyoXoM','10UwLRXK'];a160_0x2dd0=function(){return _0x3412e3;};return a160_0x2dd0();}import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
1
+ function a161_0x4782(){const _0x4925d5=['4304oAnKqF','6jDypvs','1596394UVbYPz','7820673YJqkXh','4193439oQTukH','1dLcSfR','4912615xkDJXm','25446840qHhKZQ','30690zeYdrj','6882096egEUJM'];a161_0x4782=function(){return _0x4925d5;};return a161_0x4782();}(function(_0x115b75,_0x105823){const _0x2eec11=a161_0xa7e5,_0x2ce1d8=_0x115b75();while(!![]){try{const _0x3948cc=parseInt(_0x2eec11(0xc0))/0x1*(-parseInt(_0x2eec11(0xbd))/0x2)+parseInt(_0x2eec11(0xbf))/0x3+parseInt(_0x2eec11(0xc4))/0x4+-parseInt(_0x2eec11(0xc1))/0x5+-parseInt(_0x2eec11(0xc6))/0x6*(parseInt(_0x2eec11(0xbe))/0x7)+-parseInt(_0x2eec11(0xc5))/0x8*(parseInt(_0x2eec11(0xc3))/0x9)+parseInt(_0x2eec11(0xc2))/0xa;if(_0x3948cc===_0x105823)break;else _0x2ce1d8['push'](_0x2ce1d8['shift']());}catch(_0x475340){_0x2ce1d8['push'](_0x2ce1d8['shift']());}}}(a161_0x4782,0xe32b2));import{roleList}from'../../commands/role/list.js';function a161_0xa7e5(_0x5562c3,_0x3c9cd4){_0x5562c3=_0x5562c3-0xbd;const _0x47824a=a161_0x4782();let _0xa7e5b5=_0x47824a[_0x5562c3];return _0xa7e5b5;}import{roleDetail}from'../../commands/role/detail.js';import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
@@ -1 +1 @@
1
- const a161_0x154547=a161_0x27c7;(function(_0x2402f8,_0x224459){const _0x32616b=a161_0x27c7,_0x38c81d=_0x2402f8();while(!![]){try{const _0x47255d=parseInt(_0x32616b(0x1ba))/0x1*(-parseInt(_0x32616b(0x1a3))/0x2)+-parseInt(_0x32616b(0x1a8))/0x3*(-parseInt(_0x32616b(0x1b2))/0x4)+parseInt(_0x32616b(0x19b))/0x5*(parseInt(_0x32616b(0x1b6))/0x6)+parseInt(_0x32616b(0x1b7))/0x7*(parseInt(_0x32616b(0x1b1))/0x8)+parseInt(_0x32616b(0x1a5))/0x9+-parseInt(_0x32616b(0x195))/0xa*(parseInt(_0x32616b(0x1b3))/0xb)+-parseInt(_0x32616b(0x1b9))/0xc;if(_0x47255d===_0x224459)break;else _0x38c81d['push'](_0x38c81d['shift']());}catch(_0x4ca605){_0x38c81d['push'](_0x38c81d['shift']());}}}(a161_0x699a,0x69061));function a161_0x27c7(_0x51dc3a,_0x51a6da){_0x51dc3a=_0x51dc3a-0x193;const _0x699a8a=a161_0x699a();let _0x27c725=_0x699a8a[_0x51dc3a];return _0x27c725;}import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a161_0x699a(){const _0x4633ec=['731624lPqJCu','10571DUMFqW','length','Use\x20one\x20of:\x20','53856rXrmKW','84sEMoiC','DEV','4249716ZhEMEb','1aiuckv','validation','toUpperCase','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','read','3310ERUhGZ','CUSTOM','map','roleType','Page\x20size\x20(1-100)','page','205WbgnwR','Invalid\x20--type\x20\x22','number','filter','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','type','str','trim','1203862WiYvsF','string','4908312fEnQVG','includes','num','3FwuaZk','Page\x20index\x20(1-based)','\x20role(s)','appCode','pagesize','list','Found\x20','Filter\x20by\x20role\x20type','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','405368QcFOpu'];a161_0x699a=function(){return _0x4633ec;};return a161_0x699a();}import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=['ADMIN',a161_0x154547(0x1b8),'USER',a161_0x154547(0x196)];export const roleList={'service':'role','command':a161_0x154547(0x1ad),'description':a161_0x154547(0x1b0),'risk':a161_0x154547(0x194),'flags':[APPCODE_FLAG_OPTIONAL,{'name':'type','type':a161_0x154547(0x1a4),'required':![],'description':a161_0x154547(0x1af),'enum':ROLE_TYPES},{'name':a161_0x154547(0x19a),'type':'number','description':a161_0x154547(0x1a9),'default':0x1},{'name':a161_0x154547(0x1ac),'type':a161_0x154547(0x19d),'description':a161_0x154547(0x199),'default':0x64}],async 'validate'(_0x111ba8){const _0x51e3f2=a161_0x154547,_0x5197b2=_0x111ba8[_0x51e3f2(0x1a1)](_0x51e3f2(0x1a0))[_0x51e3f2(0x1a2)]();if(_0x5197b2&&!ROLE_TYPES[_0x51e3f2(0x1a6)](_0x5197b2['toUpperCase']()))throw CliErrors['validation'](_0x51e3f2(0x19c)+_0x5197b2+'\x22.',_0x51e3f2(0x1b5)+ROLE_TYPES['join'](',\x20')+'.');const _0x4f19d8=_0x111ba8['num']('page',0x1),_0x2bcf5f=_0x111ba8[_0x51e3f2(0x1a7)](_0x51e3f2(0x1ac),0x64);if(_0x4f19d8<0x1)throw CliErrors['validation'](_0x51e3f2(0x193));if(_0x2bcf5f<0x1||_0x2bcf5f>0x64)throw CliErrors[_0x51e3f2(0x1bb)](_0x51e3f2(0x19f));},async 'execute'(_0x524412){const _0x526383=a161_0x154547,_0x44ccaa=_0x524412['num'](_0x526383(0x19a),0x1)||0x1,_0x7c0926=_0x524412[_0x526383(0x1a7)]('pagesize',0x64)||0x64,_0x1d5e8e=_0x524412[_0x526383(0x1a1)](_0x526383(0x1a0))['trim']()[_0x526383(0x1bc)](),{items:_0x39bf38,paging:_0x273b11}=await listAppRoles(_0x524412[_0x526383(0x1ab)],{'currentPage':_0x44ccaa,'pageSize':_0x7c0926}),_0x28b2be=_0x1d5e8e?_0x39bf38[_0x526383(0x19e)](_0x3b47a6=>_0x3b47a6[_0x526383(0x198)]===_0x1d5e8e):_0x39bf38,_0xf02d38=_0x28b2be[_0x526383(0x197)](projectRole);return{'ok':!![],'data':{'roles':_0xf02d38,'paging':_0x273b11},'message':_0x526383(0x1ae)+_0xf02d38[_0x526383(0x1b4)]+_0x526383(0x1aa)};}};
1
+ function a162_0x42e3(){const _0x34dd95=['Filter\x20by\x20role\x20type','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','toUpperCase','num','903336qZhKjl','2529933wJNIoP','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','trim','str','1430478tnVKpF','CUSTOM','join','11322PEtdiM','validation','appCode','type','Invalid\x20--type\x20\x22','88964qgUVpN','string','page','read','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','7SELwIb','Use\x20one\x20of:\x20','ADMIN','Page\x20size\x20(1-100)','includes','1722216nbGBmP','Found\x20','role','736mchjfA','pagesize','roleType','USER','51710SfKNdn','number','\x20role(s)','filter'];a162_0x42e3=function(){return _0x34dd95;};return a162_0x42e3();}const a162_0x33b8b9=a162_0x4a5e;(function(_0x210607,_0x3e76a9){const _0x1af246=a162_0x4a5e,_0xb833b5=_0x210607();while(!![]){try{const _0x67976f=parseInt(_0x1af246(0x1e2))/0x1*(parseInt(_0x1af246(0x1dd))/0x2)+parseInt(_0x1af246(0x1d5))/0x3+parseInt(_0x1af246(0x1d0))/0x4+parseInt(_0x1af246(0x1c8))/0x5+-parseInt(_0x1af246(0x1c1))/0x6+-parseInt(_0x1af246(0x1d1))/0x7+parseInt(_0x1af246(0x1c4))/0x8*(parseInt(_0x1af246(0x1d8))/0x9);if(_0x67976f===_0x3e76a9)break;else _0xb833b5['push'](_0xb833b5['shift']());}catch(_0x33c47a){_0xb833b5['push'](_0xb833b5['shift']());}}}(a162_0x42e3,0x78089));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 a162_0x4a5e(_0x2fda1c,_0x245bd6){_0x2fda1c=_0x2fda1c-0x1be;const _0x42e38a=a162_0x42e3();let _0x4a5e6f=_0x42e38a[_0x2fda1c];return _0x4a5e6f;}const ROLE_TYPES=[a162_0x33b8b9(0x1be),'DEV',a162_0x33b8b9(0x1c7),a162_0x33b8b9(0x1d6)];export const roleList={'service':a162_0x33b8b9(0x1c3),'command':'list','description':a162_0x33b8b9(0x1e1),'risk':a162_0x33b8b9(0x1e0),'flags':[APPCODE_FLAG_OPTIONAL,{'name':'type','type':a162_0x33b8b9(0x1de),'required':![],'description':a162_0x33b8b9(0x1cc),'enum':ROLE_TYPES},{'name':a162_0x33b8b9(0x1df),'type':a162_0x33b8b9(0x1c9),'description':'Page\x20index\x20(1-based)','default':0x1},{'name':a162_0x33b8b9(0x1c5),'type':a162_0x33b8b9(0x1c9),'description':a162_0x33b8b9(0x1bf),'default':0x64}],async 'validate'(_0x42babb){const _0x30e456=a162_0x33b8b9,_0x4fcacc=_0x42babb['str'](_0x30e456(0x1db))[_0x30e456(0x1d3)]();if(_0x4fcacc&&!ROLE_TYPES[_0x30e456(0x1c0)](_0x4fcacc[_0x30e456(0x1ce)]()))throw CliErrors['validation'](_0x30e456(0x1dc)+_0x4fcacc+'\x22.',_0x30e456(0x1e3)+ROLE_TYPES[_0x30e456(0x1d7)](',\x20')+'.');const _0x35ff30=_0x42babb[_0x30e456(0x1cf)](_0x30e456(0x1df),0x1),_0xfc4623=_0x42babb[_0x30e456(0x1cf)](_0x30e456(0x1c5),0x64);if(_0x35ff30<0x1)throw CliErrors[_0x30e456(0x1d9)](_0x30e456(0x1cd));if(_0xfc4623<0x1||_0xfc4623>0x64)throw CliErrors[_0x30e456(0x1d9)](_0x30e456(0x1d2));},async 'execute'(_0xe55a6d){const _0x175c43=a162_0x33b8b9,_0x188fda=_0xe55a6d['num']('page',0x1)||0x1,_0x3f1715=_0xe55a6d[_0x175c43(0x1cf)](_0x175c43(0x1c5),0x64)||0x64,_0x37d71a=_0xe55a6d[_0x175c43(0x1d4)](_0x175c43(0x1db))[_0x175c43(0x1d3)]()[_0x175c43(0x1ce)](),{items:_0x4c61b3,paging:_0x5dfc65}=await listAppRoles(_0xe55a6d[_0x175c43(0x1da)],{'currentPage':_0x188fda,'pageSize':_0x3f1715}),_0x4c7e61=_0x37d71a?_0x4c61b3[_0x175c43(0x1cb)](_0x5c1ba3=>_0x5c1ba3[_0x175c43(0x1c6)]===_0x37d71a):_0x4c61b3,_0x3e85e9=_0x4c7e61['map'](projectRole);return{'ok':!![],'data':{'roles':_0x3e85e9,'paging':_0x5dfc65},'message':_0x175c43(0x1c2)+_0x3e85e9['length']+_0x175c43(0x1ca)};}};
@@ -1 +1 @@
1
- const a162_0x2d3361=a162_0x1bb7;(function(_0x20f0f0,_0x34db6b){const _0x503fe5=a162_0x1bb7,_0x6b5dd=_0x20f0f0();while(!![]){try{const _0x2730bb=-parseInt(_0x503fe5(0x20f))/0x1*(-parseInt(_0x503fe5(0x1e0))/0x2)+-parseInt(_0x503fe5(0x1dc))/0x3*(parseInt(_0x503fe5(0x210))/0x4)+-parseInt(_0x503fe5(0x1ea))/0x5*(parseInt(_0x503fe5(0x207))/0x6)+-parseInt(_0x503fe5(0x21d))/0x7+parseInt(_0x503fe5(0x1d4))/0x8+-parseInt(_0x503fe5(0x214))/0x9*(-parseInt(_0x503fe5(0x1e7))/0xa)+parseInt(_0x503fe5(0x20e))/0xb*(-parseInt(_0x503fe5(0x21a))/0xc);if(_0x2730bb===_0x34db6b)break;else _0x6b5dd['push'](_0x6b5dd['shift']());}catch(_0x31f10c){_0x6b5dd['push'](_0x6b5dd['shift']());}}}(a162_0x4c6c,0xc5ef3));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':a162_0x2d3361(0x1d0),'required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':a162_0x2d3361(0x1f1),'type':a162_0x2d3361(0x217),'required':!![],'description':'Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)'};export const USER_REF_FLAG={'name':a162_0x2d3361(0x212),'type':'string','required':!![],'description':'User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId'};export const NAME_FLAG={'name':a162_0x2d3361(0x1ee),'type':a162_0x2d3361(0x217),'required':!![],'description':a162_0x2d3361(0x1fd)};export const USER_NAME_FLAG={'name':'name','type':'string','required':!![],'description':a162_0x2d3361(0x1f4)};export const REMARK_FLAG={'name':'remark','type':a162_0x2d3361(0x217),'required':![],'description':a162_0x2d3361(0x1f3)};export const EXPECT_USER_COUNT_FLAG={'name':'expect-user-count','type':a162_0x2d3361(0x1d0),'required':![],'description':a162_0x2d3361(0x213)};export const BUILTIN_ROLE_TYPES=[a162_0x2d3361(0x1de),a162_0x2d3361(0x21b),a162_0x2d3361(0x208)];export function isBuiltinRole(_0x1355cb){const _0x54db58=a162_0x2d3361;return BUILTIN_ROLE_TYPES[_0x54db58(0x201)](_0x1355cb);}export function assertCustomRole(_0x1e744b,_0x1bc5e4){const _0x47fde3=a162_0x2d3361;if(_0x1e744b[_0x47fde3(0x1fc)]!=='CUSTOM')throw CliErrors[_0x47fde3(0x20d)](_0x47fde3(0x215)+_0x1bc5e4+_0x47fde3(0x1ec)+_0x1e744b[_0x47fde3(0x20c)]+'\x20('+_0x1e744b[_0x47fde3(0x1fc)]+').','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.');}export function assertPermConfigurable(_0x3ff4a8){const _0x9457d7=a162_0x2d3361;if(_0x3ff4a8[_0x9457d7(0x1fc)]===_0x9457d7(0x21b)||_0x3ff4a8[_0x9457d7(0x1fc)]==='ADMIN')throw CliErrors[_0x9457d7(0x20d)](_0x9457d7(0x204)+_0x3ff4a8[_0x9457d7(0x20c)]+'\x20('+_0x3ff4a8['roleType']+').',_0x9457d7(0x1fa));}export function projectRole(_0x12b994){const _0x116b00=a162_0x2d3361;return{'id':_0x12b994['id'],'roleName':_0x12b994['roleName'],'roleType':_0x12b994[_0x116b00(0x1fc)],'remark':_0x12b994[_0x116b00(0x20b)],'userCount':_0x12b994[_0x116b00(0x1f7)],'permitCount':_0x12b994['permitCount'],'builtin':isBuiltinRole(_0x12b994[_0x116b00(0x1fc)])};}export async function resolveRoleRef(_0x2f3ed1,_0xebc015){const _0x1965a4=a162_0x2d3361,_0x4ac8c5=_0xebc015[_0x1965a4(0x21c)]();if(!_0x4ac8c5)throw CliErrors[_0x1965a4(0x20d)](_0x1965a4(0x1f5),_0x1965a4(0x1e9));if(/^\d+$/[_0x1965a4(0x1e8)](_0x4ac8c5))return getRoleById(_0x2f3ed1,Number(_0x4ac8c5));const _0x255fe5=await listAllAppRoles(_0x2f3ed1),_0x4a652a=_0x255fe5['filter'](_0x46197e=>_0x46197e[_0x1965a4(0x20c)]===_0x4ac8c5);if(_0x4a652a[_0x1965a4(0x1d8)]===0x0)throw CliErrors[_0x1965a4(0x20d)]('Role\x20name\x20\x22'+_0x4ac8c5+_0x1965a4(0x1d9)+_0x2f3ed1+'.',_0x1965a4(0x209));if(_0x4a652a['length']>0x1){const _0x4e5fea=_0x4a652a[_0x1965a4(0x1d5)](_0x9ed8df=>_0x9ed8df['id'])[_0x1965a4(0x1e4)](',\x20');throw CliErrors['validation']('Role\x20name\x20\x22'+_0x4ac8c5+_0x1965a4(0x1e3)+_0x4e5fea+').',_0x1965a4(0x1d2));}return _0x4a652a[0x0];}export async function getRoleById(_0x3ebfc3,_0x94e102){const _0x19dc95=a162_0x2d3361,_0x154f2c=await getAppRole(_0x94e102);if(!_0x154f2c)throw CliErrors[_0x19dc95(0x20d)](_0x19dc95(0x1fe)+_0x94e102+_0x19dc95(0x1f9)+_0x3ebfc3+'.',_0x19dc95(0x1e1));return _0x154f2c;}function a162_0x4c6c(){const _0x14169b=['Disambiguate\x20with\x20--role\x20<id>.','Anti-drift\x20check\x20failed:\x20expected\x20','3569784AwZwSs','map','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','User\x20','length','\x22\x20not\x20found\x20in\x20app\x20','Missing\x20user\x20reference.','/smartapi/permit/user-role/update-user-list','102108MBQKcE','expectUserCount','ADMIN','No\x20tenant\x20member\x20matches\x20\x22','26NulxmC','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','flag','\x22\x20is\x20ambiguous\x20(ids:\x20','join','tenant','\x20is\x20already\x20a\x20member\x20of\x20role\x20','1330plRGfN','test','Pass\x20--role\x20<id|name>.','1645doxWLc','push','\x20built-in\x20role\x20','dryRun','name','Disambiguate\x20with\x20--user\x20<id>.','totalCount','role','nickname','Optional\x20role\x20remark/description','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','Missing\x20role\x20reference.','userId','userCount','username','\x20not\x20found\x20in\x20app\x20','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','splice','roleType','Role\x20name','Role\x20id\x20','filter','flagMissing','includes',';\x20no\x20change.','toLowerCase','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','userList','\x20not\x20found\x20in\x20the\x20user-role\x20list.','13890wtICOS','USER','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','Multiple\x20tenant\x20members\x20match\x20\x22','remark','roleName','validation','5208478jwQRFo','111305mnqmPU','40sUwRgA','find','user','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','43101PeeiZj','Cannot\x20','appCode','string','expect-user-count','str','12LcNocN','DEV','trim','1007251kDVDSY','number','\x20is\x20not\x20a\x20member\x20of\x20role\x20'];a162_0x4c6c=function(){return _0x14169b;};return a162_0x4c6c();}async function listAllAppRoles(_0x11db98){const _0x227448=a162_0x2d3361,_0x318693=0x64,_0x2ae3dd=[];for(let _0x363802=0x1;;_0x363802+=0x1){const {items:_0x220a51,paging:_0x96f82}=await listAppRoles(_0x11db98,{'currentPage':_0x363802,'pageSize':_0x318693});_0x2ae3dd[_0x227448(0x1eb)](..._0x220a51);if(_0x220a51[_0x227448(0x1d8)]<_0x318693||_0x96f82&&_0x2ae3dd[_0x227448(0x1d8)]>=_0x96f82[_0x227448(0x1f0)])return _0x2ae3dd;}}export async function resolveTenantCode(){const _0x301986=a162_0x2d3361,_0x1c1c53=await getSessionUserInfo(),_0x433fb1=_0x1c1c53?.[_0x301986(0x212)]?.[_0x301986(0x1e5)]?.['tenant_code'];if(!_0x433fb1)throw CliErrors['authRequired']('Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.');return _0x433fb1;}function matchMember(_0x46f661,_0x391113){const _0x29467a=a162_0x2d3361,_0x593b63=_0x391113['trim']()['toLowerCase']();return(_0x46f661['nickname']??'')[_0x29467a(0x203)]()===_0x593b63||(_0x46f661[_0x29467a(0x1f8)]??'')[_0x29467a(0x203)]()===_0x593b63;}export async function resolveUserRef(_0x509595){const _0x4575cb=a162_0x2d3361,_0x3965e7=_0x509595[_0x4575cb(0x21c)]();if(!_0x3965e7)throw CliErrors['validation'](_0x4575cb(0x1da),'Pass\x20--user\x20<id|name>.');const _0x382d4c=await resolveTenantCode(),_0x40a9b6=await getTenantMembers(_0x382d4c);if(/^\d+$/['test'](_0x3965e7)){const _0x267097=Number(_0x3965e7),_0x5ad2fe=_0x40a9b6[_0x4575cb(0x211)](_0x34f8ff=>_0x34f8ff[_0x4575cb(0x1f6)]===_0x267097);return{'userId':_0x267097,'username':_0x5ad2fe?.[_0x4575cb(0x1f8)]??String(_0x267097),'nickname':_0x5ad2fe?.['nickname'],'matchedBy':'id'};}const _0x2acfd7=_0x40a9b6[_0x4575cb(0x1ff)](_0x2779a7=>matchMember(_0x2779a7,_0x3965e7));if(_0x2acfd7[_0x4575cb(0x1d8)]===0x0)throw CliErrors[_0x4575cb(0x20d)](_0x4575cb(0x1df)+_0x3965e7+'\x22.','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.');if(_0x2acfd7['length']>0x1){const _0x6385e9=_0x2acfd7['map'](_0x195d12=>(_0x195d12[_0x4575cb(0x1f2)]??_0x195d12[_0x4575cb(0x1f8)]??'?')+'('+_0x195d12['userId']+')')[_0x4575cb(0x1e4)](',\x20');throw CliErrors[_0x4575cb(0x20d)](_0x4575cb(0x20a)+_0x3965e7+'\x22:\x20'+_0x6385e9+'.',_0x4575cb(0x1ef));}const _0x4e8cc7=_0x2acfd7[0x0];return{'userId':_0x4e8cc7[_0x4575cb(0x1f6)],'username':_0x4e8cc7[_0x4575cb(0x1f8)]??String(_0x4e8cc7['userId']),'nickname':_0x4e8cc7['nickname'],'matchedBy':_0x4575cb(0x1ee)};}export const UPDATE_USER_LIST_PATH=a162_0x2d3361(0x1db);function userIdsOf(_0x2e569e){const _0x4be973=a162_0x2d3361;return(_0x2e569e?.[_0x4be973(0x205)]??[])[_0x4be973(0x1d5)](_0x4c8f98=>_0x4c8f98[_0x4be973(0x1f6)]);}export function computeRoleUserMutation(_0x43e2af){const _0x448196=a162_0x2d3361,{operation:_0x47a521,appCode:_0x2f8a48,roleUsers:_0x4804a9,targetRoleId:_0x4358af,user:_0x32631c}=_0x43e2af,_0x7645fe=_0x4804a9[_0x448196(0x211)](_0x23d0dd=>_0x23d0dd['id']===_0x4358af);if(!_0x7645fe)throw CliErrors[_0x448196(0x20d)](_0x448196(0x1fe)+_0x4358af+_0x448196(0x206),_0x448196(0x1e1));const _0x340fbe=userIdsOf(_0x7645fe),_0x4e8181=[];if(_0x43e2af[_0x448196(0x1dd)]!==undefined&&_0x43e2af[_0x448196(0x1dd)]!==_0x340fbe[_0x448196(0x1d8)])throw CliErrors[_0x448196(0x20d)](_0x448196(0x1d3)+_0x43e2af[_0x448196(0x1dd)]+'\x20member(s)\x20but\x20role\x20has\x20'+_0x340fbe[_0x448196(0x1d8)]+'.',_0x448196(0x1d6));const _0x2114c9=_0x340fbe[_0x448196(0x201)](_0x32631c[_0x448196(0x1f6)]);let _0x4ce1ad=![];const _0x4cd62d=[..._0x7645fe[_0x448196(0x205)]];if(_0x47a521==='user-add')_0x2114c9?_0x4e8181[_0x448196(0x1eb)](_0x448196(0x1d7)+_0x32631c[_0x448196(0x1f6)]+_0x448196(0x1e6)+_0x7645fe[_0x448196(0x20c)]+';\x20no\x20change.'):(_0x4cd62d[_0x448196(0x1eb)]({'userId':_0x32631c[_0x448196(0x1f6)],'username':_0x32631c[_0x448196(0x1f8)],..._0x32631c[_0x448196(0x1f2)]?{'nickname':_0x32631c['nickname']}:{}}),_0x4ce1ad=!![]);else{if(!_0x2114c9)_0x4e8181[_0x448196(0x1eb)]('User\x20'+_0x32631c[_0x448196(0x1f6)]+_0x448196(0x1d1)+_0x7645fe[_0x448196(0x20c)]+_0x448196(0x202));else{const _0x3c1f34=_0x4cd62d['findIndex'](_0x33f45d=>_0x33f45d['userId']===_0x32631c[_0x448196(0x1f6)]);if(_0x3c1f34>=0x0)_0x4cd62d[_0x448196(0x1fb)](_0x3c1f34,0x1);_0x4ce1ad=!![];}}const _0x519a3c=_0x4804a9['map'](_0x5935de=>_0x5935de['id']===_0x4358af?{..._0x5935de,'userList':_0x4cd62d}:_0x5935de),_0x49deba=_0x4cd62d[_0x448196(0x1d5)](_0x4f228d=>_0x4f228d[_0x448196(0x1f6)]),_0x71884f={'operation':_0x47a521,'selector':{'appCode':_0x2f8a48,'roleId':_0x4358af,'roleName':_0x7645fe[_0x448196(0x20c)],'userId':_0x32631c[_0x448196(0x1f6)]},'before':{'userIds':_0x340fbe},'after':{'userIds':_0x49deba},'dryRun':_0x43e2af[_0x448196(0x1ed)],'backend':{'method':'POST','path':UPDATE_USER_LIST_PATH},'warnings':_0x4e8181};return{'roleList':_0x519a3c,'mutation':_0x71884f,'changed':_0x4ce1ad};}function a162_0x1bb7(_0x2f901c,_0x4625a3){_0x2f901c=_0x2f901c-0x1d0;const _0x4c6c78=a162_0x4c6c();let _0x1bb7b9=_0x4c6c78[_0x2f901c];return _0x1bb7b9;}export async function loadRoleUsers(_0x22ba6b){return listRoleUsers(_0x22ba6b);}export function readRoleRef(_0x15d841){const _0x4e442e=a162_0x2d3361,_0x12942c=_0x15d841[_0x4e442e(0x219)](_0x4e442e(0x1f1))[_0x4e442e(0x21c)]();if(!_0x12942c)throw CliErrors[_0x4e442e(0x200)]('role',_0x4e442e(0x1e9));return _0x12942c;}export async function prepareUserMutation(_0x59d05d,_0x3d4067,_0x415a05){const _0x4e51cc=a162_0x2d3361,_0x542e1c=readRoleRef(_0x59d05d),_0x37b875=_0x59d05d[_0x4e51cc(0x219)]('user')[_0x4e51cc(0x21c)]();if(!_0x37b875)throw CliErrors[_0x4e51cc(0x200)]('user','Pass\x20--user\x20<id|name>.');const _0x3d21af=_0x59d05d[_0x4e51cc(0x1e2)](_0x4e51cc(0x218)),_0x4be5ec=_0x3d21af===undefined||_0x3d21af===null?undefined:Number(_0x3d21af),_0x49d0ad=await resolveRoleRef(_0x59d05d[_0x4e51cc(0x216)],_0x542e1c),_0x5c3725=await resolveUserRef(_0x37b875),_0xd3626a=await loadRoleUsers(_0x59d05d[_0x4e51cc(0x216)]);return computeRoleUserMutation({'operation':_0x3d4067,'appCode':_0x59d05d[_0x4e51cc(0x216)],'roleUsers':_0xd3626a,'targetRoleId':_0x49d0ad['id'],'user':{'userId':_0x5c3725[_0x4e51cc(0x1f6)],'username':_0x5c3725[_0x4e51cc(0x1f8)],'nickname':_0x5c3725[_0x4e51cc(0x1f2)]},'dryRun':_0x415a05,..._0x4be5ec!==undefined?{'expectUserCount':_0x4be5ec}:{}});}
1
+ const a163_0x1e85f6=a163_0x2e91;(function(_0x3331ca,_0x39890f){const _0x4acd37=a163_0x2e91,_0x54a6ec=_0x3331ca();while(!![]){try{const _0x53c78c=-parseInt(_0x4acd37(0x1bf))/0x1*(parseInt(_0x4acd37(0x1ac))/0x2)+parseInt(_0x4acd37(0x1df))/0x3*(parseInt(_0x4acd37(0x1a7))/0x4)+parseInt(_0x4acd37(0x1c8))/0x5+-parseInt(_0x4acd37(0x1c9))/0x6+-parseInt(_0x4acd37(0x1b3))/0x7*(-parseInt(_0x4acd37(0x1ab))/0x8)+parseInt(_0x4acd37(0x1b5))/0x9*(-parseInt(_0x4acd37(0x1e1))/0xa)+parseInt(_0x4acd37(0x1ce))/0xb;if(_0x53c78c===_0x39890f)break;else _0x54a6ec['push'](_0x54a6ec['shift']());}catch(_0x5cde90){_0x54a6ec['push'](_0x54a6ec['shift']());}}}(a163_0x4cf9,0x36f28));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':a163_0x1e85f6(0x1b6),'required':!![],'description':a163_0x1e85f6(0x1a6)};export const ROLE_REF_FLAG={'name':a163_0x1e85f6(0x1bb),'type':'string','required':!![],'description':a163_0x1e85f6(0x1c1)};export const USER_REF_FLAG={'name':a163_0x1e85f6(0x1e7),'type':a163_0x1e85f6(0x1ec),'required':!![],'description':a163_0x1e85f6(0x1c6)};export const NAME_FLAG={'name':a163_0x1e85f6(0x1d6),'type':'string','required':!![],'description':a163_0x1e85f6(0x1e2)};export const USER_NAME_FLAG={'name':a163_0x1e85f6(0x1d6),'type':a163_0x1e85f6(0x1ec),'required':!![],'description':a163_0x1e85f6(0x1e3)};export const REMARK_FLAG={'name':a163_0x1e85f6(0x1d2),'type':a163_0x1e85f6(0x1ec),'required':![],'description':a163_0x1e85f6(0x1de)};export const EXPECT_USER_COUNT_FLAG={'name':'expect-user-count','type':a163_0x1e85f6(0x1b6),'required':![],'description':a163_0x1e85f6(0x1d5)};export const BUILTIN_ROLE_TYPES=[a163_0x1e85f6(0x1d0),'DEV',a163_0x1e85f6(0x1bd)];export function isBuiltinRole(_0x2a7588){return BUILTIN_ROLE_TYPES['includes'](_0x2a7588);}export function assertCustomRole(_0x5091a9,_0x1cf613){const _0x2b7d71=a163_0x1e85f6;if(_0x5091a9[_0x2b7d71(0x1dd)]!=='CUSTOM')throw CliErrors[_0x2b7d71(0x1ad)](_0x2b7d71(0x1b2)+_0x1cf613+_0x2b7d71(0x1c4)+_0x5091a9['roleName']+'\x20('+_0x5091a9[_0x2b7d71(0x1dd)]+').',_0x2b7d71(0x1e9));}export function assertPermConfigurable(_0x18630d){const _0x37e4ed=a163_0x1e85f6;if(_0x18630d['roleType']===_0x37e4ed(0x1a9)||_0x18630d[_0x37e4ed(0x1dd)]===_0x37e4ed(0x1d0))throw CliErrors[_0x37e4ed(0x1ad)](_0x37e4ed(0x1c5)+_0x18630d[_0x37e4ed(0x1d8)]+'\x20('+_0x18630d[_0x37e4ed(0x1dd)]+').',_0x37e4ed(0x1ef));}function a163_0x2e91(_0x541f8e,_0x367b13){_0x541f8e=_0x541f8e-0x1a2;const _0x4cf957=a163_0x4cf9();let _0x2e91ef=_0x4cf957[_0x541f8e];return _0x2e91ef;}export function projectRole(_0x31b746){const _0x1372af=a163_0x1e85f6;return{'id':_0x31b746['id'],'roleName':_0x31b746[_0x1372af(0x1d8)],'roleType':_0x31b746['roleType'],'remark':_0x31b746[_0x1372af(0x1d2)],'userCount':_0x31b746[_0x1372af(0x1cc)],'permitCount':_0x31b746['permitCount'],'builtin':isBuiltinRole(_0x31b746[_0x1372af(0x1dd)])};}export async function resolveRoleRef(_0x164bba,_0x5a3ad9){const _0xb059a3=a163_0x1e85f6,_0x5dd022=_0x5a3ad9['trim']();if(!_0x5dd022)throw CliErrors[_0xb059a3(0x1ad)](_0xb059a3(0x1b1),_0xb059a3(0x1e8));if(/^\d+$/['test'](_0x5dd022))return getRoleById(_0x164bba,Number(_0x5dd022));const _0x57f33e=await listAllAppRoles(_0x164bba),_0xab6ddf=_0x57f33e[_0xb059a3(0x1a4)](_0x359df8=>_0x359df8[_0xb059a3(0x1d8)]===_0x5dd022);if(_0xab6ddf['length']===0x0)throw CliErrors['validation'](_0xb059a3(0x1e0)+_0x5dd022+_0xb059a3(0x1c3)+_0x164bba+'.',_0xb059a3(0x1e4));if(_0xab6ddf[_0xb059a3(0x1ea)]>0x1){const _0x25fe4c=_0xab6ddf[_0xb059a3(0x1ae)](_0x5161c8=>_0x5161c8['id'])[_0xb059a3(0x1f1)](',\x20');throw CliErrors[_0xb059a3(0x1ad)](_0xb059a3(0x1e0)+_0x5dd022+_0xb059a3(0x1f3)+_0x25fe4c+').','Disambiguate\x20with\x20--role\x20<id>.');}return _0xab6ddf[0x0];}function a163_0x4cf9(){const _0xfcd2bb=['Role\x20name\x20\x22','1370skRzfJ','Role\x20name','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','userList','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','user','Pass\x20--role\x20<id|name>.','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','length','test','string','expect-user-count','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','flagMissing','join','tenant','\x22\x20is\x20ambiguous\x20(ids:\x20',';\x20no\x20change.','\x20member(s)\x20but\x20role\x20has\x20','filter','User\x20','Role\x20id\x20(from\x20`role\x20list`)','164380crmJGh','No\x20tenant\x20member\x20matches\x20\x22','DEV','findIndex','3165672OPDTsn','24CswWFn','validation','map','username','Anti-drift\x20check\x20failed:\x20expected\x20','Missing\x20role\x20reference.','Cannot\x20','7qIDsJs','splice','24408hedLOP','number','appCode','\x22:\x20','user-add','tenant_code','role','\x20is\x20not\x20a\x20member\x20of\x20role\x20','USER','Role\x20id\x20','27532ogmICi','nickname','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','\x20not\x20found\x20in\x20the\x20user-role\x20list.','\x22\x20not\x20found\x20in\x20app\x20','\x20built-in\x20role\x20','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','find','828650ZkdFxJ','2172522KriKdu','totalCount','Disambiguate\x20with\x20--user\x20<id>.','userCount','toLowerCase','7551995vxMDyt','POST','ADMIN','trim','remark','dryRun','Pass\x20--user\x20<id|name>.','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','name','push','roleName','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','expectUserCount','userId','/smartapi/permit/user-role/update-user-list','roleType','Optional\x20role\x20remark/description','3RLxFzE'];a163_0x4cf9=function(){return _0xfcd2bb;};return a163_0x4cf9();}export async function getRoleById(_0x1bb931,_0x4c0030){const _0x104921=a163_0x1e85f6,_0x20c6a3=await getAppRole(_0x4c0030);if(!_0x20c6a3)throw CliErrors[_0x104921(0x1ad)](_0x104921(0x1be)+_0x4c0030+'\x20not\x20found\x20in\x20app\x20'+_0x1bb931+'.',_0x104921(0x1e6));return _0x20c6a3;}async function listAllAppRoles(_0x532b46){const _0x540290=a163_0x1e85f6,_0x1029d4=0x64,_0x40a9c0=[];for(let _0x2de772=0x1;;_0x2de772+=0x1){const {items:_0x5cf627,paging:_0x4809ff}=await listAppRoles(_0x532b46,{'currentPage':_0x2de772,'pageSize':_0x1029d4});_0x40a9c0[_0x540290(0x1d7)](..._0x5cf627);if(_0x5cf627[_0x540290(0x1ea)]<_0x1029d4||_0x4809ff&&_0x40a9c0[_0x540290(0x1ea)]>=_0x4809ff[_0x540290(0x1ca)])return _0x40a9c0;}}export async function resolveTenantCode(){const _0x58ca6c=a163_0x1e85f6,_0x48cf97=await getSessionUserInfo(),_0x4bf237=_0x48cf97?.[_0x58ca6c(0x1e7)]?.[_0x58ca6c(0x1f2)]?.[_0x58ca6c(0x1ba)];if(!_0x4bf237)throw CliErrors['authRequired'](_0x58ca6c(0x1ee));return _0x4bf237;}function matchMember(_0x4c26ab,_0xd9416b){const _0x3f5684=a163_0x1e85f6,_0x1083e2=_0xd9416b[_0x3f5684(0x1d1)]()[_0x3f5684(0x1cd)]();return(_0x4c26ab[_0x3f5684(0x1c0)]??'')[_0x3f5684(0x1cd)]()===_0x1083e2||(_0x4c26ab[_0x3f5684(0x1af)]??'')[_0x3f5684(0x1cd)]()===_0x1083e2;}export async function resolveUserRef(_0x4a5105){const _0x4e0567=a163_0x1e85f6,_0x235526=_0x4a5105[_0x4e0567(0x1d1)]();if(!_0x235526)throw CliErrors[_0x4e0567(0x1ad)]('Missing\x20user\x20reference.','Pass\x20--user\x20<id|name>.');const _0x2e4f30=await resolveTenantCode(),_0x2e3a09=await getTenantMembers(_0x2e4f30);if(/^\d+$/[_0x4e0567(0x1eb)](_0x235526)){const _0x22941e=Number(_0x235526),_0x5ca887=_0x2e3a09[_0x4e0567(0x1c7)](_0x49e423=>_0x49e423[_0x4e0567(0x1db)]===_0x22941e);return{'userId':_0x22941e,'username':_0x5ca887?.[_0x4e0567(0x1af)]??String(_0x22941e),'nickname':_0x5ca887?.[_0x4e0567(0x1c0)],'matchedBy':'id'};}const _0x2a15d0=_0x2e3a09[_0x4e0567(0x1a4)](_0x215147=>matchMember(_0x215147,_0x235526));if(_0x2a15d0['length']===0x0)throw CliErrors[_0x4e0567(0x1ad)](_0x4e0567(0x1a8)+_0x235526+'\x22.',_0x4e0567(0x1d9));if(_0x2a15d0[_0x4e0567(0x1ea)]>0x1){const _0x112640=_0x2a15d0[_0x4e0567(0x1ae)](_0x38660c=>(_0x38660c[_0x4e0567(0x1c0)]??_0x38660c[_0x4e0567(0x1af)]??'?')+'('+_0x38660c[_0x4e0567(0x1db)]+')')[_0x4e0567(0x1f1)](',\x20');throw CliErrors[_0x4e0567(0x1ad)]('Multiple\x20tenant\x20members\x20match\x20\x22'+_0x235526+_0x4e0567(0x1b8)+_0x112640+'.',_0x4e0567(0x1cb));}const _0x492194=_0x2a15d0[0x0];return{'userId':_0x492194[_0x4e0567(0x1db)],'username':_0x492194[_0x4e0567(0x1af)]??String(_0x492194[_0x4e0567(0x1db)]),'nickname':_0x492194[_0x4e0567(0x1c0)],'matchedBy':_0x4e0567(0x1d6)};}export const UPDATE_USER_LIST_PATH=a163_0x1e85f6(0x1dc);function userIdsOf(_0x5f031e){const _0x84b353=a163_0x1e85f6;return(_0x5f031e?.['userList']??[])[_0x84b353(0x1ae)](_0x4ae0db=>_0x4ae0db[_0x84b353(0x1db)]);}export function computeRoleUserMutation(_0x58d90a){const _0x5cb532=a163_0x1e85f6,{operation:_0x39cb51,appCode:_0x772edb,roleUsers:_0x21fcb7,targetRoleId:_0x1fb1c5,user:_0x281d08}=_0x58d90a,_0x4c1e19=_0x21fcb7[_0x5cb532(0x1c7)](_0x410d03=>_0x410d03['id']===_0x1fb1c5);if(!_0x4c1e19)throw CliErrors[_0x5cb532(0x1ad)](_0x5cb532(0x1be)+_0x1fb1c5+_0x5cb532(0x1c2),_0x5cb532(0x1e6));const _0x55baf2=userIdsOf(_0x4c1e19),_0x4f1a50=[];if(_0x58d90a[_0x5cb532(0x1da)]!==undefined&&_0x58d90a['expectUserCount']!==_0x55baf2[_0x5cb532(0x1ea)])throw CliErrors[_0x5cb532(0x1ad)](_0x5cb532(0x1b0)+_0x58d90a[_0x5cb532(0x1da)]+_0x5cb532(0x1a3)+_0x55baf2[_0x5cb532(0x1ea)]+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x4e6b8b=_0x55baf2['includes'](_0x281d08[_0x5cb532(0x1db)]);let _0x236bb2=![];const _0x7e64d4=[..._0x4c1e19[_0x5cb532(0x1e5)]];if(_0x39cb51===_0x5cb532(0x1b9))_0x4e6b8b?_0x4f1a50['push'](_0x5cb532(0x1a5)+_0x281d08[_0x5cb532(0x1db)]+'\x20is\x20already\x20a\x20member\x20of\x20role\x20'+_0x4c1e19[_0x5cb532(0x1d8)]+_0x5cb532(0x1a2)):(_0x7e64d4['push']({'userId':_0x281d08[_0x5cb532(0x1db)],'username':_0x281d08[_0x5cb532(0x1af)],..._0x281d08[_0x5cb532(0x1c0)]?{'nickname':_0x281d08['nickname']}:{}}),_0x236bb2=!![]);else{if(!_0x4e6b8b)_0x4f1a50[_0x5cb532(0x1d7)](_0x5cb532(0x1a5)+_0x281d08['userId']+_0x5cb532(0x1bc)+_0x4c1e19['roleName']+_0x5cb532(0x1a2));else{const _0x2cfe20=_0x7e64d4[_0x5cb532(0x1aa)](_0x3a51cd=>_0x3a51cd[_0x5cb532(0x1db)]===_0x281d08[_0x5cb532(0x1db)]);if(_0x2cfe20>=0x0)_0x7e64d4[_0x5cb532(0x1b4)](_0x2cfe20,0x1);_0x236bb2=!![];}}const _0x16e54f=_0x21fcb7[_0x5cb532(0x1ae)](_0x307873=>_0x307873['id']===_0x1fb1c5?{..._0x307873,'userList':_0x7e64d4}:_0x307873),_0x291c2f=_0x7e64d4[_0x5cb532(0x1ae)](_0x2ac23f=>_0x2ac23f[_0x5cb532(0x1db)]),_0x587f34={'operation':_0x39cb51,'selector':{'appCode':_0x772edb,'roleId':_0x1fb1c5,'roleName':_0x4c1e19[_0x5cb532(0x1d8)],'userId':_0x281d08[_0x5cb532(0x1db)]},'before':{'userIds':_0x55baf2},'after':{'userIds':_0x291c2f},'dryRun':_0x58d90a[_0x5cb532(0x1d3)],'backend':{'method':_0x5cb532(0x1cf),'path':UPDATE_USER_LIST_PATH},'warnings':_0x4f1a50};return{'roleList':_0x16e54f,'mutation':_0x587f34,'changed':_0x236bb2};}export async function loadRoleUsers(_0x1634a8){return listRoleUsers(_0x1634a8);}export function readRoleRef(_0xcda261){const _0x114b46=a163_0x1e85f6,_0x26b852=_0xcda261['str'](_0x114b46(0x1bb))[_0x114b46(0x1d1)]();if(!_0x26b852)throw CliErrors[_0x114b46(0x1f0)](_0x114b46(0x1bb),_0x114b46(0x1e8));return _0x26b852;}export async function prepareUserMutation(_0x22af13,_0x5368c7,_0x1b6a99){const _0x257979=a163_0x1e85f6,_0x123aaa=readRoleRef(_0x22af13),_0x5ef62f=_0x22af13['str'](_0x257979(0x1e7))[_0x257979(0x1d1)]();if(!_0x5ef62f)throw CliErrors[_0x257979(0x1f0)](_0x257979(0x1e7),_0x257979(0x1d4));const _0x3999ba=_0x22af13['flag'](_0x257979(0x1ed)),_0x29827b=_0x3999ba===undefined||_0x3999ba===null?undefined:Number(_0x3999ba),_0x117517=await resolveRoleRef(_0x22af13[_0x257979(0x1b7)],_0x123aaa),_0x3c4d0b=await resolveUserRef(_0x5ef62f),_0x6e215f=await loadRoleUsers(_0x22af13['appCode']);return computeRoleUserMutation({'operation':_0x5368c7,'appCode':_0x22af13[_0x257979(0x1b7)],'roleUsers':_0x6e215f,'targetRoleId':_0x117517['id'],'user':{'userId':_0x3c4d0b[_0x257979(0x1db)],'username':_0x3c4d0b[_0x257979(0x1af)],'nickname':_0x3c4d0b[_0x257979(0x1c0)]},'dryRun':_0x1b6a99,..._0x29827b!==undefined?{'expectUserCount':_0x29827b}:{}});}
@@ -1 +1 @@
1
- const a163_0x891cdb=a163_0x98c7;(function(_0x2a0641,_0x36a970){const _0x5bc487=a163_0x98c7,_0x335aba=_0x2a0641();while(!![]){try{const _0x181696=-parseInt(_0x5bc487(0x103))/0x1*(parseInt(_0x5bc487(0x10d))/0x2)+parseInt(_0x5bc487(0x108))/0x3+-parseInt(_0x5bc487(0xf9))/0x4*(-parseInt(_0x5bc487(0xfb))/0x5)+parseInt(_0x5bc487(0x106))/0x6+-parseInt(_0x5bc487(0x104))/0x7+-parseInt(_0x5bc487(0x10b))/0x8+parseInt(_0x5bc487(0xfc))/0x9;if(_0x181696===_0x36a970)break;else _0x335aba['push'](_0x335aba['shift']());}catch(_0x1879d8){_0x335aba['push'](_0x335aba['shift']());}}}(a163_0x2f46,0x529ec));import{updateAppRole}from'../../core/api-client.js';function a163_0x98c7(_0x3b519a,_0x540d0f){_0x3b519a=_0x3b519a-0xf9;const _0x2f4640=a163_0x2f46();let _0x98c730=_0x2f4640[_0x3b519a];return _0x98c730;}function a163_0x2f46(){const _0x4a4645=['remark','1935216CwxwWM','trim','955608jaabts','num','flag','3262392kiYGcb','Updated\x20role\x20','2AUftyo','roleName','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','POST','update','488iWJMBK','/smartapi/permit/role/update','2620zsmtKm','6315876wbDaYD','Nothing\x20to\x20update.','validation','appCode','length','\x20(id=','New\x20role\x20name','29955Jblaes','4414186eFBazx'];a163_0x2f46=function(){return _0x4a4645;};return a163_0x2f46();}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=a163_0x891cdb(0xfa);function readPatch(_0x2672d4){const _0xf64c24=a163_0x891cdb,_0x89c49=_0x2672d4['flag']('name'),_0x199db3=_0x2672d4[_0xf64c24(0x10a)](_0xf64c24(0x105)),_0x5c312c={};if(_0x89c49!==undefined&&_0x89c49!==null){const _0x7d283d=String(_0x89c49)[_0xf64c24(0x107)]();if(!_0x7d283d)throw CliErrors[_0xf64c24(0xfe)]('--name\x20cannot\x20be\x20empty.');if(_0x7d283d[_0xf64c24(0x100)]>0x40)throw CliErrors[_0xf64c24(0xfe)](_0xf64c24(0x10f));_0x5c312c[_0xf64c24(0x10e)]=_0x7d283d;}_0x199db3!==undefined&&_0x199db3!==null&&(_0x5c312c[_0xf64c24(0x105)]=String(_0x199db3));if(_0x5c312c[_0xf64c24(0x10e)]===undefined&&_0x5c312c[_0xf64c24(0x105)]===undefined)throw CliErrors[_0xf64c24(0xfe)](_0xf64c24(0xfd),'Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.');return _0x5c312c;}export const roleUpdate={'service':'role','command':a163_0x891cdb(0x111),'description':'Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','risk':'write','flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':'name','type':'string','required':![],'description':a163_0x891cdb(0x102)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x38ff12){readPatch(_0x38ff12);},async 'dryRun'(_0x34e1c6){const _0x4297b0=a163_0x891cdb,_0x39f9c6=_0x34e1c6['num']('id'),_0x23304e=readPatch(_0x34e1c6),_0x1047d4=await getRoleById(_0x34e1c6[_0x4297b0(0xff)],_0x39f9c6);return assertCustomRole(_0x1047d4,_0x4297b0(0x111)),asDryRunResult({'operation':_0x4297b0(0x111),'selector':{'appCode':_0x34e1c6[_0x4297b0(0xff)],'roleId':_0x39f9c6,'roleName':_0x1047d4[_0x4297b0(0x10e)]},'before':projectRole(_0x1047d4),'after':projectRole({..._0x1047d4,..._0x23304e[_0x4297b0(0x10e)]!==undefined?{'roleName':_0x23304e[_0x4297b0(0x10e)]}:{},..._0x23304e[_0x4297b0(0x105)]!==undefined?{'remark':_0x23304e[_0x4297b0(0x105)]}:{}}),'dryRun':!![],'backend':{'method':_0x4297b0(0x110),'path':UPDATE_PATH},'warnings':[]},{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x1ae7c0){const _0x1e35f0=a163_0x891cdb,_0x1ef509=_0x1ae7c0[_0x1e35f0(0x109)]('id'),_0x2efff6=readPatch(_0x1ae7c0),_0x5537f3=await getRoleById(_0x1ae7c0['appCode'],_0x1ef509);assertCustomRole(_0x5537f3,_0x1e35f0(0x111)),await updateAppRole({'id':_0x1ef509,'appCode':_0x1ae7c0['appCode'],..._0x2efff6['roleName']!==undefined?{'roleName':_0x2efff6[_0x1e35f0(0x10e)]}:{},..._0x2efff6['remark']!==undefined?{'remark':_0x2efff6[_0x1e35f0(0x105)]}:{}});const _0x35c80f=await getRoleById(_0x1ae7c0[_0x1e35f0(0xff)],_0x1ef509);return{'ok':!![],'data':{'operation':'update','selector':{'appCode':_0x1ae7c0['appCode'],'roleId':_0x1ef509,'roleName':_0x35c80f['roleName']},'before':projectRole(_0x5537f3),'after':projectRole(_0x35c80f),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':_0x1e35f0(0x10c)+_0x35c80f[_0x1e35f0(0x10e)]+_0x1e35f0(0x101)+_0x1ef509+')'};}};
1
+ const a164_0x3927a2=a164_0x51c1;(function(_0x2a65d7,_0x2c4e44){const _0x208a20=a164_0x51c1,_0x4b5a2f=_0x2a65d7();while(!![]){try{const _0x5498f1=-parseInt(_0x208a20(0x152))/0x1+parseInt(_0x208a20(0x138))/0x2*(parseInt(_0x208a20(0x149))/0x3)+-parseInt(_0x208a20(0x139))/0x4+parseInt(_0x208a20(0x13c))/0x5*(parseInt(_0x208a20(0x14d))/0x6)+parseInt(_0x208a20(0x151))/0x7*(-parseInt(_0x208a20(0x14c))/0x8)+parseInt(_0x208a20(0x13d))/0x9*(parseInt(_0x208a20(0x13a))/0xa)+-parseInt(_0x208a20(0x14a))/0xb*(parseInt(_0x208a20(0x13e))/0xc);if(_0x5498f1===_0x2c4e44)break;else _0x4b5a2f['push'](_0x4b5a2f['shift']());}catch(_0x51b764){_0x4b5a2f['push'](_0x4b5a2f['shift']());}}}(a164_0xc6f8,0xdb825));function a164_0x51c1(_0x323732,_0x29760f){_0x323732=_0x323732-0x135;const _0xc6f898=a164_0xc6f8();let _0x51c155=_0xc6f898[_0x323732];return _0x51c155;}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';function a164_0xc6f8(){const _0x2aac8f=['role','name','68754ZkIdlS','419468wRNafD','16030pFZCdX','\x20(id=','7855hkXBZC','4680tdrPuo','2460hYytAV','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','POST','roleName','remark','/smartapi/permit/role/update','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','length','write','flag','trim','75AdGBeA','21615ydCsVX','appCode','20248UrLHnC','3642Aljpxg','string','num','Nothing\x20to\x20update.','1876HhocpB','561473mFfHzp','update','Updated\x20role\x20','Role\x20name\x20cannot\x20exceed\x2064\x20characters.'];a164_0xc6f8=function(){return _0x2aac8f;};return a164_0xc6f8();}const UPDATE_PATH=a164_0x3927a2(0x143);function readPatch(_0x160619){const _0x52bc20=a164_0x3927a2,_0x304965=_0x160619[_0x52bc20(0x147)](_0x52bc20(0x137)),_0xd617f6=_0x160619[_0x52bc20(0x147)](_0x52bc20(0x142)),_0x80377d={};if(_0x304965!==undefined&&_0x304965!==null){const _0xeb4bc6=String(_0x304965)[_0x52bc20(0x148)]();if(!_0xeb4bc6)throw CliErrors['validation']('--name\x20cannot\x20be\x20empty.');if(_0xeb4bc6[_0x52bc20(0x145)]>0x40)throw CliErrors['validation'](_0x52bc20(0x135));_0x80377d['roleName']=_0xeb4bc6;}_0xd617f6!==undefined&&_0xd617f6!==null&&(_0x80377d['remark']=String(_0xd617f6));if(_0x80377d[_0x52bc20(0x141)]===undefined&&_0x80377d[_0x52bc20(0x142)]===undefined)throw CliErrors['validation'](_0x52bc20(0x150),_0x52bc20(0x144));return _0x80377d;}export const roleUpdate={'service':a164_0x3927a2(0x136),'command':a164_0x3927a2(0x153),'description':a164_0x3927a2(0x13f),'risk':a164_0x3927a2(0x146),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':'name','type':a164_0x3927a2(0x14e),'required':![],'description':'New\x20role\x20name'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x472fa4){readPatch(_0x472fa4);},async 'dryRun'(_0x12ae18){const _0x17d9ae=a164_0x3927a2,_0x193dfd=_0x12ae18[_0x17d9ae(0x14f)]('id'),_0x4b364f=readPatch(_0x12ae18),_0x3ef8e2=await getRoleById(_0x12ae18[_0x17d9ae(0x14b)],_0x193dfd);return assertCustomRole(_0x3ef8e2,_0x17d9ae(0x153)),asDryRunResult({'operation':_0x17d9ae(0x153),'selector':{'appCode':_0x12ae18['appCode'],'roleId':_0x193dfd,'roleName':_0x3ef8e2[_0x17d9ae(0x141)]},'before':projectRole(_0x3ef8e2),'after':projectRole({..._0x3ef8e2,..._0x4b364f['roleName']!==undefined?{'roleName':_0x4b364f['roleName']}:{},..._0x4b364f[_0x17d9ae(0x142)]!==undefined?{'remark':_0x4b364f[_0x17d9ae(0x142)]}:{}}),'dryRun':!![],'backend':{'method':_0x17d9ae(0x140),'path':UPDATE_PATH},'warnings':[]},{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x331a1e){const _0x1409c7=a164_0x3927a2,_0x389cb8=_0x331a1e[_0x1409c7(0x14f)]('id'),_0xc705ef=readPatch(_0x331a1e),_0x49341d=await getRoleById(_0x331a1e['appCode'],_0x389cb8);assertCustomRole(_0x49341d,_0x1409c7(0x153)),await updateAppRole({'id':_0x389cb8,'appCode':_0x331a1e['appCode'],..._0xc705ef[_0x1409c7(0x141)]!==undefined?{'roleName':_0xc705ef[_0x1409c7(0x141)]}:{},..._0xc705ef[_0x1409c7(0x142)]!==undefined?{'remark':_0xc705ef[_0x1409c7(0x142)]}:{}});const _0x2819a1=await getRoleById(_0x331a1e[_0x1409c7(0x14b)],_0x389cb8);return{'ok':!![],'data':{'operation':_0x1409c7(0x153),'selector':{'appCode':_0x331a1e[_0x1409c7(0x14b)],'roleId':_0x389cb8,'roleName':_0x2819a1[_0x1409c7(0x141)]},'before':projectRole(_0x49341d),'after':projectRole(_0x2819a1),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':_0x1409c7(0x154)+_0x2819a1[_0x1409c7(0x141)]+_0x1409c7(0x13b)+_0x389cb8+')'};}};
@@ -1 +1 @@
1
- const a164_0x276909=a164_0x1550;(function(_0x121025,_0x365db5){const _0x1b66d3=a164_0x1550,_0x1be8d5=_0x121025();while(!![]){try{const _0x32c98f=-parseInt(_0x1b66d3(0x1a3))/0x1*(parseInt(_0x1b66d3(0x1a9))/0x2)+-parseInt(_0x1b66d3(0x195))/0x3+-parseInt(_0x1b66d3(0x197))/0x4*(-parseInt(_0x1b66d3(0x1a2))/0x5)+-parseInt(_0x1b66d3(0x1a0))/0x6*(-parseInt(_0x1b66d3(0x1a8))/0x7)+parseInt(_0x1b66d3(0x19d))/0x8*(parseInt(_0x1b66d3(0x19b))/0x9)+parseInt(_0x1b66d3(0x196))/0xa*(-parseInt(_0x1b66d3(0x19c))/0xb)+parseInt(_0x1b66d3(0x19f))/0xc;if(_0x32c98f===_0x365db5)break;else _0x1be8d5['push'](_0x1be8d5['shift']());}catch(_0x522f1c){_0x1be8d5['push'](_0x1be8d5['shift']());}}}(a164_0x3c32,0x65702));function a164_0x3c32(){const _0x1e608b=['roleName','user-add','Added\x20user\x20','27SxgFVW','2973157ifHomm','1202192EkGkCW','No\x20change:\x20user\x20','7022832ECrESy','39042WVqTsp','\x20to\x20role\x20','2825045RuSoUR','89jBJMxq','userId','selector','high-risk-write','appCode','7KnLFYy','11590hkPtmt','role','407265MBsKEc','20OPquQG','4lwFdHk'];a164_0x3c32=function(){return _0x1e608b;};return a164_0x3c32();}import{updateRoleUsers}from'../../core/api-client.js';function a164_0x1550(_0x5dcff9,_0x3ec6b0){_0x5dcff9=_0x5dcff9-0x195;const _0x3c32f5=a164_0x3c32();let _0x155080=_0x3c32f5[_0x5dcff9];return _0x155080;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':a164_0x276909(0x1aa),'command':a164_0x276909(0x199),'description':'Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a164_0x276909(0x1a6),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x544c67){const _0x55e544=a164_0x276909,{mutation:_0x5e1bb6}=await prepareUserMutation(_0x544c67,_0x55e544(0x199),!![]);return asDryRunResult(_0x5e1bb6,{'method':'POST','url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x2780bd){const _0x4ebed8=a164_0x276909,{roleList:_0x103435,mutation:_0x4ad47d,changed:_0x296ace}=await prepareUserMutation(_0x2780bd,'user-add',![]);return _0x296ace&&await updateRoleUsers(_0x2780bd[_0x4ebed8(0x1a7)],_0x103435),{'ok':!![],'data':_0x4ad47d,'message':_0x296ace?_0x4ebed8(0x19a)+_0x4ad47d['selector']['userId']+_0x4ebed8(0x1a1)+_0x4ad47d[_0x4ebed8(0x1a5)][_0x4ebed8(0x198)]:_0x4ebed8(0x19e)+_0x4ad47d['selector'][_0x4ebed8(0x1a4)]+'\x20already\x20in\x20role\x20'+_0x4ad47d[_0x4ebed8(0x1a5)][_0x4ebed8(0x198)]};}};
1
+ const a165_0x9645dc=a165_0x34c1;(function(_0x102c85,_0x1fe180){const _0x56c3af=a165_0x34c1,_0x24740b=_0x102c85();while(!![]){try{const _0x4b315b=parseInt(_0x56c3af(0xf5))/0x1*(-parseInt(_0x56c3af(0xf3))/0x2)+parseInt(_0x56c3af(0xef))/0x3*(-parseInt(_0x56c3af(0xfc))/0x4)+parseInt(_0x56c3af(0xf6))/0x5+-parseInt(_0x56c3af(0xf8))/0x6+-parseInt(_0x56c3af(0xf1))/0x7*(-parseInt(_0x56c3af(0xf2))/0x8)+parseInt(_0x56c3af(0xff))/0x9+-parseInt(_0x56c3af(0xed))/0xa*(-parseInt(_0x56c3af(0xf4))/0xb);if(_0x4b315b===_0x1fe180)break;else _0x24740b['push'](_0x24740b['shift']());}catch(_0x39dd30){_0x24740b['push'](_0x24740b['shift']());}}}(a165_0x5b46,0x9a2cc));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a165_0x34c1(_0x352f83,_0x520b02){_0x352f83=_0x352f83-0xed;const _0x5b4688=a165_0x5b46();let _0x34c188=_0x5b4688[_0x352f83];return _0x34c188;}function a165_0x5b46(){const _0x7a5ea3=['POST','64362xbnWpe','user-add','4099501kYTaah','8kkEUKV','1286avjDBI','1606RWhODL','302fHqCmJ','4763980ANsDTx','\x20to\x20role\x20','6405048smeJPA','No\x20change:\x20user\x20','high-risk-write','roleName','8cChYCs','\x20already\x20in\x20role\x20','Added\x20user\x20','3172941ezCfsI','userId','selector','3090mZBCoL'];a165_0x5b46=function(){return _0x7a5ea3;};return a165_0x5b46();}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':'user-add','description':'Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a165_0x9645dc(0xfa),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x598ad1){const _0x57601c=a165_0x9645dc,{mutation:_0x191548}=await prepareUserMutation(_0x598ad1,'user-add',!![]);return asDryRunResult(_0x191548,{'method':_0x57601c(0xee),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x790f1f){const _0x25d58a=a165_0x9645dc,{roleList:_0x1db3ce,mutation:_0x18eb14,changed:_0xbc6cef}=await prepareUserMutation(_0x790f1f,_0x25d58a(0xf0),![]);return _0xbc6cef&&await updateRoleUsers(_0x790f1f['appCode'],_0x1db3ce),{'ok':!![],'data':_0x18eb14,'message':_0xbc6cef?_0x25d58a(0xfe)+_0x18eb14[_0x25d58a(0x101)]['userId']+_0x25d58a(0xf7)+_0x18eb14[_0x25d58a(0x101)][_0x25d58a(0xfb)]:_0x25d58a(0xf9)+_0x18eb14[_0x25d58a(0x101)][_0x25d58a(0x100)]+_0x25d58a(0xfd)+_0x18eb14[_0x25d58a(0x101)][_0x25d58a(0xfb)]};}};
@@ -1 +1 @@
1
- const a165_0x2afa89=a165_0xd413;function a165_0xd413(_0x2acda6,_0x476743){_0x2acda6=_0x2acda6-0x122;const _0xa6a292=a165_0xa6a2();let _0xd41373=_0xa6a292[_0x2acda6];return _0xd41373;}(function(_0x32d0aa,_0x371d4a){const _0x963c1a=a165_0xd413,_0x1c9336=_0x32d0aa();while(!![]){try{const _0x50604e=parseInt(_0x963c1a(0x135))/0x1*(parseInt(_0x963c1a(0x126))/0x2)+parseInt(_0x963c1a(0x125))/0x3+parseInt(_0x963c1a(0x134))/0x4*(-parseInt(_0x963c1a(0x124))/0x5)+parseInt(_0x963c1a(0x12b))/0x6+parseInt(_0x963c1a(0x128))/0x7+-parseInt(_0x963c1a(0x127))/0x8*(parseInt(_0x963c1a(0x129))/0x9)+-parseInt(_0x963c1a(0x123))/0xa;if(_0x50604e===_0x371d4a)break;else _0x1c9336['push'](_0x1c9336['shift']());}catch(_0x348f91){_0x1c9336['push'](_0x1c9336['shift']());}}}(a165_0xa6a2,0xa49e7));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 a165_0xa6a2(){const _0xf887db=['5099166NBCmav','\x20not\x20in\x20role\x20','appCode','role','high-risk-write','roleName','selector','No\x20change:\x20user\x20','\x20from\x20role\x20','660132OKHhpS','2dWZhcq','user-remove','userId','14634640yOgjJy','35ngVXkq','2863824JdrFXW','631324WKAItM','24Gwqkmm','8853726dFOpWj','1222911OsBirx','POST'];a165_0xa6a2=function(){return _0xf887db;};return a165_0xa6a2();}export const roleUserRemove={'service':a165_0x2afa89(0x12e),'command':'user-remove','description':'Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a165_0x2afa89(0x12f),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x42c3a8){const _0x2888b8=a165_0x2afa89,{mutation:_0x32af7a}=await prepareUserMutation(_0x42c3a8,_0x2888b8(0x136),!![]);return asDryRunResult(_0x32af7a,{'method':_0x2888b8(0x12a),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x3e1b10){const _0x5c8afe=a165_0x2afa89,{roleList:_0x5bfe75,mutation:_0x4f403d,changed:_0x2beb9a}=await prepareUserMutation(_0x3e1b10,_0x5c8afe(0x136),![]);return _0x2beb9a&&await updateRoleUsers(_0x3e1b10[_0x5c8afe(0x12d)],_0x5bfe75),{'ok':!![],'data':_0x4f403d,'message':_0x2beb9a?'Removed\x20user\x20'+_0x4f403d[_0x5c8afe(0x131)]['userId']+_0x5c8afe(0x133)+_0x4f403d[_0x5c8afe(0x131)][_0x5c8afe(0x130)]:_0x5c8afe(0x132)+_0x4f403d[_0x5c8afe(0x131)][_0x5c8afe(0x122)]+_0x5c8afe(0x12c)+_0x4f403d[_0x5c8afe(0x131)]['roleName']};}};
1
+ const a166_0x1e345a=a166_0x2253;(function(_0x67d96a,_0x41ef73){const _0x1f7b3a=a166_0x2253,_0x309419=_0x67d96a();while(!![]){try{const _0x5e0da2=-parseInt(_0x1f7b3a(0x193))/0x1+-parseInt(_0x1f7b3a(0x192))/0x2+-parseInt(_0x1f7b3a(0x197))/0x3+parseInt(_0x1f7b3a(0x19b))/0x4+-parseInt(_0x1f7b3a(0x194))/0x5*(parseInt(_0x1f7b3a(0x18f))/0x6)+-parseInt(_0x1f7b3a(0x191))/0x7*(-parseInt(_0x1f7b3a(0x18e))/0x8)+parseInt(_0x1f7b3a(0x195))/0x9*(parseInt(_0x1f7b3a(0x196))/0xa);if(_0x5e0da2===_0x41ef73)break;else _0x309419['push'](_0x309419['shift']());}catch(_0x36c97d){_0x309419['push'](_0x309419['shift']());}}}(a166_0x100f,0xcef48));function a166_0x100f(){const _0x5d1b10=['role','77dCoHbW','2858112EFdcJM','814507Liddhj','340QvjhCS','567wyMXqf','489870BttVbT','2075499woEeND','high-risk-write','POST','No\x20change:\x20user\x20','1674804wHXALz','user-remove','roleName','Removed\x20user\x20','selector','userId','\x20not\x20in\x20role\x20','892912FtbtAt','83784LrCxJv'];a166_0x100f=function(){return _0x5d1b10;};return a166_0x100f();}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 a166_0x2253(_0x2641f4,_0x4390b0){_0x2641f4=_0x2641f4-0x18c;const _0x100f9e=a166_0x100f();let _0x22530b=_0x100f9e[_0x2641f4];return _0x22530b;}export const roleUserRemove={'service':a166_0x1e345a(0x190),'command':a166_0x1e345a(0x19c),'description':'Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a166_0x1e345a(0x198),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x2f6bca){const _0x3fc006=a166_0x1e345a,{mutation:_0x4cb6e5}=await prepareUserMutation(_0x2f6bca,_0x3fc006(0x19c),!![]);return asDryRunResult(_0x4cb6e5,{'method':_0x3fc006(0x199),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x498fac){const _0x55e03a=a166_0x1e345a,{roleList:_0x3b1a7c,mutation:_0x16d991,changed:_0x4c3ba5}=await prepareUserMutation(_0x498fac,_0x55e03a(0x19c),![]);return _0x4c3ba5&&await updateRoleUsers(_0x498fac['appCode'],_0x3b1a7c),{'ok':!![],'data':_0x16d991,'message':_0x4c3ba5?_0x55e03a(0x19e)+_0x16d991['selector'][_0x55e03a(0x18c)]+'\x20from\x20role\x20'+_0x16d991['selector'][_0x55e03a(0x19d)]:_0x55e03a(0x19a)+_0x16d991[_0x55e03a(0x19f)][_0x55e03a(0x18c)]+_0x55e03a(0x18d)+_0x16d991['selector'][_0x55e03a(0x19d)]};}};
@@ -1 +1 @@
1
- const a166_0x230ce9=a166_0x59a0;(function(_0x217347,_0x4f1ed3){const _0x3f61c5=a166_0x59a0,_0xf153d8=_0x217347();while(!![]){try{const _0x11d491=-parseInt(_0x3f61c5(0x1ea))/0x1+parseInt(_0x3f61c5(0x1ef))/0x2*(-parseInt(_0x3f61c5(0x1f6))/0x3)+-parseInt(_0x3f61c5(0x1f7))/0x4+parseInt(_0x3f61c5(0x1fb))/0x5+-parseInt(_0x3f61c5(0x1f5))/0x6+parseInt(_0x3f61c5(0x1eb))/0x7+parseInt(_0x3f61c5(0x1ee))/0x8*(parseInt(_0x3f61c5(0x1ed))/0x9);if(_0x11d491===_0x4f1ed3)break;else _0xf153d8['push'](_0xf153d8['shift']());}catch(_0x40a085){_0xf153d8['push'](_0xf153d8['shift']());}}}(a166_0x140e,0xbf461));import{CliErrors}from'../../errors.js';function a166_0x59a0(_0x1aaa9b,_0x10656a){_0x1aaa9b=_0x1aaa9b-0x1e7;const _0x140eb8=a166_0x140e();let _0x59a01f=_0x140eb8[_0x1aaa9b];return _0x59a01f;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';function a166_0x140e(){const _0x373897=['Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','role','read','user-resolve','5691078wcXJDy','669JdReGa','1383420YiAtAc','str','matchedBy','flagMissing','1155890ccjbGV','nickname','userId','trim','\x22\x20→\x20userId\x20','1536739SJUJCK','5029367kJISxW','name','459CPNKrG','550600zncBsa','7580zvXvSj','Pass\x20--name\x20<nickname|username>.'];a166_0x140e=function(){return _0x373897;};return a166_0x140e();}export const roleUserResolve={'service':a166_0x230ce9(0x1f2),'command':a166_0x230ce9(0x1f4),'description':a166_0x230ce9(0x1f1),'risk':a166_0x230ce9(0x1f3),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x299cad){const _0x5eac2d=a166_0x230ce9;if(!_0x299cad[_0x5eac2d(0x1f8)](_0x5eac2d(0x1ec))[_0x5eac2d(0x1e8)]())throw CliErrors[_0x5eac2d(0x1fa)](_0x5eac2d(0x1ec),_0x5eac2d(0x1f0));},async 'execute'(_0x3653bb){const _0x1b3cb6=a166_0x230ce9,_0x521cf5=_0x3653bb[_0x1b3cb6(0x1f8)]('name')[_0x1b3cb6(0x1e8)](),_0x30dd09=await resolveUserRef(_0x521cf5);return{'ok':!![],'data':{'user':{'userId':_0x30dd09[_0x1b3cb6(0x1e7)],'username':_0x30dd09['username'],'nickname':_0x30dd09[_0x1b3cb6(0x1fc)],'matchedBy':_0x30dd09[_0x1b3cb6(0x1f9)]}},'message':'Resolved\x20\x22'+_0x521cf5+_0x1b3cb6(0x1e9)+_0x30dd09[_0x1b3cb6(0x1e7)]};}};
1
+ const a167_0x54db22=a167_0x5f2d;(function(_0x137644,_0x56a9fc){const _0x4d41a1=a167_0x5f2d,_0x2388cb=_0x137644();while(!![]){try{const _0x4af374=parseInt(_0x4d41a1(0x10d))/0x1*(parseInt(_0x4d41a1(0x110))/0x2)+parseInt(_0x4d41a1(0x10e))/0x3*(-parseInt(_0x4d41a1(0x106))/0x4)+-parseInt(_0x4d41a1(0x112))/0x5*(-parseInt(_0x4d41a1(0x108))/0x6)+-parseInt(_0x4d41a1(0x10b))/0x7+parseInt(_0x4d41a1(0x10f))/0x8+-parseInt(_0x4d41a1(0x10a))/0x9+-parseInt(_0x4d41a1(0x114))/0xa*(parseInt(_0x4d41a1(0x111))/0xb);if(_0x4af374===_0x56a9fc)break;else _0x2388cb['push'](_0x2388cb['shift']());}catch(_0x53106e){_0x2388cb['push'](_0x2388cb['shift']());}}}(a167_0x2b2c,0x83f37));function a167_0x2b2c(){const _0x11ef94=['matchedBy','username','name','role','trim','Pass\x20--name\x20<nickname|username>.','user-resolve','28uBCLGs','Resolved\x20\x22','12ZhBfdo','str','7086600ylMEHm','709884EJUyCP','nickname','9651xbNsCF','22887IwKEwL','4538440PhSMQY','74lggytM','88uwnPvG','1420555RdYBWg','userId','12410okCWmY','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)'];a167_0x2b2c=function(){return _0x11ef94;};return a167_0x2b2c();}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a167_0x5f2d(_0x59a823,_0x39d7bc){_0x59a823=_0x59a823-0x102;const _0x2b2c23=a167_0x2b2c();let _0x5f2dda=_0x2b2c23[_0x59a823];return _0x5f2dda;}import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a167_0x54db22(0x102),'command':a167_0x54db22(0x105),'description':a167_0x54db22(0x115),'risk':'read','flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5bb5fe){const _0x3c1d31=a167_0x54db22;if(!_0x5bb5fe['str']('name')[_0x3c1d31(0x103)]())throw CliErrors['flagMissing']('name',_0x3c1d31(0x104));},async 'execute'(_0x2a0b9d){const _0x2e0273=a167_0x54db22,_0x1693be=_0x2a0b9d[_0x2e0273(0x109)](_0x2e0273(0x118))[_0x2e0273(0x103)](),_0x36fb7b=await resolveUserRef(_0x1693be);return{'ok':!![],'data':{'user':{'userId':_0x36fb7b[_0x2e0273(0x113)],'username':_0x36fb7b[_0x2e0273(0x117)],'nickname':_0x36fb7b[_0x2e0273(0x10c)],'matchedBy':_0x36fb7b[_0x2e0273(0x116)]}},'message':_0x2e0273(0x107)+_0x1693be+'\x22\x20→\x20userId\x20'+_0x36fb7b[_0x2e0273(0x113)]};}};
@@ -1 +1 @@
1
- const a167_0x459264=a167_0x219b;(function(_0x48de78,_0x498dc2){const _0x834bcd=a167_0x219b,_0x5df562=_0x48de78();while(!![]){try{const _0x3a07e5=-parseInt(_0x834bcd(0x1c9))/0x1*(parseInt(_0x834bcd(0x1cd))/0x2)+parseInt(_0x834bcd(0x1a4))/0x3*(-parseInt(_0x834bcd(0x1d1))/0x4)+-parseInt(_0x834bcd(0x19c))/0x5+parseInt(_0x834bcd(0x19b))/0x6+-parseInt(_0x834bcd(0x1b5))/0x7*(-parseInt(_0x834bcd(0x19e))/0x8)+parseInt(_0x834bcd(0x1b6))/0x9*(-parseInt(_0x834bcd(0x1cf))/0xa)+parseInt(_0x834bcd(0x1c0))/0xb*(parseInt(_0x834bcd(0x1cb))/0xc);if(_0x3a07e5===_0x498dc2)break;else _0x5df562['push'](_0x5df562['shift']());}catch(_0x440d77){_0x5df562['push'](_0x5df562['shift']());}}}(a167_0x1158,0xef7cf));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([a167_0x459264(0x1b2),a167_0x459264(0x1ae)]);function a167_0x219b(_0x57c132,_0x2d9bee){_0x57c132=_0x57c132-0x198;const _0x1158ca=a167_0x1158();let _0x219b19=_0x1158ca[_0x57c132];return _0x219b19;}function readPackageScripts(_0x13a981){const _0x256b49=a167_0x459264,_0x65119c=resolve(_0x13a981,'package.json');if(!existsSync(_0x65119c))return null;try{const _0x2d0bf3=JSON[_0x256b49(0x1b3)](readFileSync(_0x65119c,_0x256b49(0x1c2)));return _0x2d0bf3[_0x256b49(0x1c1)]??{};}catch{return null;}}function detectPackageManager(_0x5f1e0b){const _0x9e6021=a167_0x459264;if(existsSync(resolve(_0x5f1e0b,_0x9e6021(0x1c5)))||existsSync(resolve(_0x5f1e0b,_0x9e6021(0x1b7))))return _0x9e6021(0x1ab);if(existsSync(resolve(_0x5f1e0b,_0x9e6021(0x1d4))))return _0x9e6021(0x1d8);if(existsSync(resolve(_0x5f1e0b,'yarn.lock')))return _0x9e6021(0x1c7);return _0x9e6021(0x1bf);}async function versionCheck(_0x3196fa){const _0x4d7f78=a167_0x459264,_0x1c2d84=await checkCliVersion();(_0x1c2d84[_0x4d7f78(0x198)]||_0x1c2d84[_0x4d7f78(0x1d7)])&&(printCliUpgradeWarning(_0x1c2d84),assertCliVersionSupported(_0x1c2d84));const _0x223f5a=await checkSdkVersion(_0x3196fa);if(_0x223f5a[_0x4d7f78(0x198)])printSdkUpgradeWarning(_0x223f5a);}function spawnScript(_0x25e7a8,_0x4da135,_0x848067,_0x5644ad){return new Promise((_0x13589e,_0x1824df)=>{const _0x2337ff=a167_0x219b,_0x35150f=['run',_0x4da135,..._0x848067],_0x205d4e=spawn(_0x25e7a8,_0x35150f,{'cwd':_0x5644ad,'stdio':_0x2337ff(0x1af),'shell':!![],'env':{...process.env,'PATH':''+join(_0x5644ad,'node_modules','.bin')+delimiter+process.env.PATH}});_0x205d4e['on'](_0x2337ff(0x19a),_0xd54227=>{const _0x1c3034=_0x2337ff;if(_0xd54227===0x0||_0xd54227===null)_0x13589e();else _0x1824df(new Error(_0x25e7a8+'\x20run\x20'+_0x4da135+_0x1c3034(0x1c4)+_0xd54227));}),_0x205d4e['on'](_0x2337ff(0x1ce),_0x1824df);});}function spawnViteBuildWatch(_0x350d5a){return new Promise((_0x19015c,_0x17f1f2)=>{const _0x3aacd2=a167_0x219b,_0x28f22b=spawn(_0x3aacd2(0x1a2),['build',_0x3aacd2(0x1bd)],{'cwd':_0x350d5a,'stdio':_0x3aacd2(0x1af),'shell':!![],'env':{...process.env,'PATH':''+join(_0x350d5a,_0x3aacd2(0x1bc),_0x3aacd2(0x19d))+delimiter+process.env.PATH}});_0x28f22b['on'](_0x3aacd2(0x19a),_0x1ae42c=>{if(_0x1ae42c===0x0||_0x1ae42c===null)_0x19015c();else _0x17f1f2(new Error('vite\x20build\x20--watch\x20exited\x20with\x20code\x20'+_0x1ae42c));}),_0x28f22b['on']('error',_0x17f1f2);});}function spawnVitePreview(_0x46602c){return new Promise((_0x38d66b,_0x51da75)=>{const _0x65bd76=a167_0x219b,_0x519577=spawn(_0x65bd76(0x1a2),[_0x65bd76(0x1a8)],{'cwd':_0x46602c,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x46602c,_0x65bd76(0x1bc),'.bin')+delimiter+process.env.PATH}});_0x519577['on'](_0x65bd76(0x19a),_0x2412e0=>{const _0x2f5ee9=_0x65bd76;if(_0x2412e0===0x0||_0x2412e0===null)_0x38d66b();else _0x51da75(new Error(_0x2f5ee9(0x1ba)+_0x2412e0));}),_0x519577['on'](_0x65bd76(0x1ce),_0x51da75);});}const runFlags=[{'name':a167_0x459264(0x19f),'type':a167_0x459264(0x1bb),'description':a167_0x459264(0x1b4),'default':![]}];function a167_0x1158(){const _0x2d24f4=['yarn','\x20\x20\x20\x20','1KchPhK','Run\x20a\x20package.json\x20script','13251696xIsaIf','all','2488764IJWjKc','error','5040iofquK','has','32aZkAUL','\x20run\x20start','\x0a\x20\x20Available\x20scripts:\x0a','pnpm-lock.yaml','slice','run','belowMinimum','pnpm','needsUpgrade','bool','close','1387740EtPPZk','2891270rzGBJB','.bin','2878808ozktnu','watch','(none)','args','vite','Script\x20\x22','147306XafFQl','push','\x0a\x20\x20Usage:\x20','join','preview','\x20run\x20<script>\x0a','\x22\x20not\x20found\x20in\x20package.json.','bun','\x20\x20EXAMPLES','No\x20scripts\x20defined\x20in\x20package.json.','dev','inherit','\x20run\x20build','validation','start','parse','Enable\x20watch\x20mode\x20for\x20preview','21OaqmcT','5769YtWuwi','bun.lock','log','length','vite\x20preview\x20exited\x20with\x20code\x20','boolean','node_modules','--watch','Available:\x20','npm','22VhczFS','scripts','utf-8','\x20run\x20preview','\x20exited\x20with\x20code\x20','bun.lockb','keys'];a167_0x1158=function(){return _0x2d24f4;};return a167_0x1158();}export const runDefinition={'service':a167_0x459264(0x1d6),'command':a167_0x459264(0x1d6),'description':a167_0x459264(0x1ca),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'script','description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x4ea36d=a167_0x459264,_0x466bd0=[];return _0x466bd0[_0x4ea36d(0x1a5)](_0x4ea36d(0x1ac)),_0x466bd0[_0x4ea36d(0x1a5)](_0x4ea36d(0x1c8)+CLI_BIN_NAME+_0x4ea36d(0x1d2)),_0x466bd0['push'](_0x4ea36d(0x1c8)+CLI_BIN_NAME+_0x4ea36d(0x1b0)),_0x466bd0[_0x4ea36d(0x1a5)](_0x4ea36d(0x1c8)+CLI_BIN_NAME+_0x4ea36d(0x1c3)),_0x466bd0['push'](_0x4ea36d(0x1c8)+CLI_BIN_NAME+'\x20run\x20preview\x20--watch'),_0x466bd0[_0x4ea36d(0x1a7)]('\x0a');},async 'execute'(_0xf3e3c8){const _0xb5315=a167_0x459264,_0x282a58=process['cwd'](),_0x3fcf8e=_0xf3e3c8['args'][0x0],_0xca1eda=_0xf3e3c8[_0xb5315(0x1a1)][_0xb5315(0x1d5)](0x1),_0x2fca12=readPackageScripts(_0x282a58);if(!_0x2fca12)throw CliErrors[_0xb5315(0x1b1)]('No\x20package.json\x20found\x20in\x20current\x20directory.');if(!_0x3fcf8e){const _0x150e50=Object[_0xb5315(0x1c6)](_0x2fca12);if(_0x150e50[_0xb5315(0x1b9)]===0x0)console[_0xb5315(0x1b8)](_0xb5315(0x1ad));else{console[_0xb5315(0x1b8)](_0xb5315(0x1d3));for(const _0x5395f8 of _0x150e50){console['log'](_0xb5315(0x1c8)+_0x5395f8);}console[_0xb5315(0x1b8)](_0xb5315(0x1a6)+CLI_BIN_NAME+_0xb5315(0x1a9));}return{'ok':!![]};}if(!_0x2fca12[_0x3fcf8e])throw CliErrors[_0xb5315(0x1b1)](_0xb5315(0x1a3)+_0x3fcf8e+_0xb5315(0x1aa),_0xb5315(0x1be)+(Object[_0xb5315(0x1c6)](_0x2fca12)[_0xb5315(0x1a7)](',\x20')||_0xb5315(0x1a0)));const _0x88feba=detectPackageManager(_0x282a58);VERSION_CHECK_SCRIPTS[_0xb5315(0x1d0)](_0x3fcf8e)&&await versionCheck(_0x282a58);if(_0x3fcf8e==='preview'&&_0xf3e3c8[_0xb5315(0x199)](_0xb5315(0x19f)))return await Promise[_0xb5315(0x1cc)]([spawnViteBuildWatch(_0x282a58),spawnVitePreview(_0x282a58)]),{'ok':!![]};return await spawnScript(_0x88feba,_0x3fcf8e,_0xca1eda,_0x282a58),{'ok':!![]};}};
1
+ const a168_0x6b8239=a168_0x2f00;(function(_0x166126,_0xb046c1){const _0x2fd445=a168_0x2f00,_0x2780f0=_0x166126();while(!![]){try{const _0x43e157=parseInt(_0x2fd445(0x179))/0x1*(parseInt(_0x2fd445(0x164))/0x2)+parseInt(_0x2fd445(0x177))/0x3+parseInt(_0x2fd445(0x160))/0x4+parseInt(_0x2fd445(0x187))/0x5+-parseInt(_0x2fd445(0x154))/0x6+parseInt(_0x2fd445(0x180))/0x7*(-parseInt(_0x2fd445(0x166))/0x8)+-parseInt(_0x2fd445(0x182))/0x9*(parseInt(_0x2fd445(0x16c))/0xa);if(_0x43e157===_0xb046c1)break;else _0x2780f0['push'](_0x2780f0['shift']());}catch(_0x482e2f){_0x2780f0['push'](_0x2780f0['shift']());}}}(a168_0x578e,0x43975));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';function a168_0x2f00(_0x4ea734,_0x26b37e){_0x4ea734=_0x4ea734-0x150;const _0x578ef8=a168_0x578e();let _0x2f0017=_0x578ef8[_0x4ea734];return _0x2f0017;}import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set(['start',a168_0x6b8239(0x17f)]);function readPackageScripts(_0x273de9){const _0x3b4781=a168_0x6b8239,_0x354397=resolve(_0x273de9,'package.json');if(!existsSync(_0x354397))return null;try{const _0x307905=JSON[_0x3b4781(0x17e)](readFileSync(_0x354397,'utf-8'));return _0x307905['scripts']??{};}catch{return null;}}function detectPackageManager(_0x4871b5){const _0x3da2dc=a168_0x6b8239;if(existsSync(resolve(_0x4871b5,_0x3da2dc(0x184)))||existsSync(resolve(_0x4871b5,_0x3da2dc(0x167))))return _0x3da2dc(0x157);if(existsSync(resolve(_0x4871b5,'pnpm-lock.yaml')))return _0x3da2dc(0x16f);if(existsSync(resolve(_0x4871b5,_0x3da2dc(0x176))))return'yarn';return'npm';}async function versionCheck(_0x48f090){const _0x349bf6=a168_0x6b8239,_0x2e9f41=await checkCliVersion();(_0x2e9f41[_0x349bf6(0x15e)]||_0x2e9f41['belowMinimum'])&&(printCliUpgradeWarning(_0x2e9f41),assertCliVersionSupported(_0x2e9f41));const _0x1ad35a=await checkSdkVersion(_0x48f090);if(_0x1ad35a[_0x349bf6(0x15e)])printSdkUpgradeWarning(_0x1ad35a);}function spawnScript(_0x2f052f,_0x32d177,_0x4d6a51,_0x2e12f1){return new Promise((_0x2cd0e5,_0x13d259)=>{const _0x221032=a168_0x2f00,_0x4c22fe=[_0x221032(0x181),_0x32d177,..._0x4d6a51],_0x16a770=spawn(_0x2f052f,_0x4c22fe,{'cwd':_0x2e12f1,'stdio':_0x221032(0x175),'shell':!![],'env':{...process.env,'PATH':''+join(_0x2e12f1,'node_modules',_0x221032(0x15a))+delimiter+process.env.PATH}});_0x16a770['on'](_0x221032(0x162),_0x2142a1=>{const _0x4547f1=_0x221032;if(_0x2142a1===0x0||_0x2142a1===null)_0x2cd0e5();else _0x13d259(new Error(_0x2f052f+'\x20run\x20'+_0x32d177+_0x4547f1(0x17c)+_0x2142a1));}),_0x16a770['on'](_0x221032(0x174),_0x13d259);});}function a168_0x578e(){const _0x348ee9=['parse','dev','112hReVGs','run','21969FMgQxH','read','bun.lockb','No\x20scripts\x20defined\x20in\x20package.json.','\x20\x20EXAMPLES','1766145cJaaIq','script','\x20run\x20start','push','preview','node_modules','779496mNVkJt','\x20\x20\x20\x20','args','bun','join','Script\x20\x22','.bin','Available:\x20','slice','boolean','needsUpgrade','vite','1761536iRvtqr','all','close','\x20run\x20build','26Vkklbk','bool','233072YDEUBb','bun.lock','watch','\x0a\x20\x20Usage:\x20','length','Script\x20name\x20defined\x20in\x20package.json','1800rFhmsk','--watch','validation','pnpm','No\x20package.json\x20found\x20in\x20current\x20directory.','Run\x20a\x20package.json\x20script','keys','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','error','inherit','yarn.lock','52317SGLCGV','cwd','38557shHGFj','vite\x20preview\x20exited\x20with\x20code\x20','\x20run\x20preview','\x20exited\x20with\x20code\x20','log'];a168_0x578e=function(){return _0x348ee9;};return a168_0x578e();}function spawnViteBuildWatch(_0x1fe210){return new Promise((_0x2d7e12,_0x16d257)=>{const _0x355135=a168_0x2f00,_0x466bbf=spawn(_0x355135(0x15f),['build',_0x355135(0x16d)],{'cwd':_0x1fe210,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x1fe210,'node_modules',_0x355135(0x15a))+delimiter+process.env.PATH}});_0x466bbf['on']('close',_0x29a3eb=>{const _0x589956=_0x355135;if(_0x29a3eb===0x0||_0x29a3eb===null)_0x2d7e12();else _0x16d257(new Error(_0x589956(0x173)+_0x29a3eb));}),_0x466bbf['on'](_0x355135(0x174),_0x16d257);});}function spawnVitePreview(_0x5848e9){return new Promise((_0x25744d,_0xb8b280)=>{const _0x2dbefc=a168_0x2f00,_0x2b6c7d=spawn(_0x2dbefc(0x15f),[_0x2dbefc(0x152)],{'cwd':_0x5848e9,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x5848e9,_0x2dbefc(0x153),_0x2dbefc(0x15a))+delimiter+process.env.PATH}});_0x2b6c7d['on'](_0x2dbefc(0x162),_0x1354bf=>{const _0x57b4d6=_0x2dbefc;if(_0x1354bf===0x0||_0x1354bf===null)_0x25744d();else _0xb8b280(new Error(_0x57b4d6(0x17a)+_0x1354bf));}),_0x2b6c7d['on'](_0x2dbefc(0x174),_0xb8b280);});}const runFlags=[{'name':a168_0x6b8239(0x168),'type':a168_0x6b8239(0x15d),'description':'Enable\x20watch\x20mode\x20for\x20preview','default':![]}];export const runDefinition={'service':a168_0x6b8239(0x181),'command':a168_0x6b8239(0x181),'description':a168_0x6b8239(0x171),'risk':a168_0x6b8239(0x183),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a168_0x6b8239(0x188),'description':a168_0x6b8239(0x16b),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x596922=a168_0x6b8239,_0x31fd62=[];return _0x31fd62[_0x596922(0x151)](_0x596922(0x186)),_0x31fd62[_0x596922(0x151)](_0x596922(0x155)+CLI_BIN_NAME+_0x596922(0x150)),_0x31fd62['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x596922(0x163)),_0x31fd62[_0x596922(0x151)](_0x596922(0x155)+CLI_BIN_NAME+_0x596922(0x17b)),_0x31fd62[_0x596922(0x151)](_0x596922(0x155)+CLI_BIN_NAME+'\x20run\x20preview\x20--watch'),_0x31fd62[_0x596922(0x158)]('\x0a');},async 'execute'(_0x33a5a6){const _0x33396=a168_0x6b8239,_0x24ce95=process[_0x33396(0x178)](),_0x2aaf4e=_0x33a5a6[_0x33396(0x156)][0x0],_0x998b74=_0x33a5a6[_0x33396(0x156)][_0x33396(0x15c)](0x1),_0x127fb0=readPackageScripts(_0x24ce95);if(!_0x127fb0)throw CliErrors[_0x33396(0x16e)](_0x33396(0x170));if(!_0x2aaf4e){const _0x3dbff4=Object[_0x33396(0x172)](_0x127fb0);if(_0x3dbff4[_0x33396(0x16a)]===0x0)console['log'](_0x33396(0x185));else{console[_0x33396(0x17d)]('\x0a\x20\x20Available\x20scripts:\x0a');for(const _0xc6d59 of _0x3dbff4){console[_0x33396(0x17d)]('\x20\x20\x20\x20'+_0xc6d59);}console[_0x33396(0x17d)](_0x33396(0x169)+CLI_BIN_NAME+'\x20run\x20<script>\x0a');}return{'ok':!![]};}if(!_0x127fb0[_0x2aaf4e])throw CliErrors[_0x33396(0x16e)](_0x33396(0x159)+_0x2aaf4e+'\x22\x20not\x20found\x20in\x20package.json.',_0x33396(0x15b)+(Object[_0x33396(0x172)](_0x127fb0)['join'](',\x20')||'(none)'));const _0x2a891d=detectPackageManager(_0x24ce95);VERSION_CHECK_SCRIPTS['has'](_0x2aaf4e)&&await versionCheck(_0x24ce95);if(_0x2aaf4e===_0x33396(0x152)&&_0x33a5a6[_0x33396(0x165)](_0x33396(0x168)))return await Promise[_0x33396(0x161)]([spawnViteBuildWatch(_0x24ce95),spawnVitePreview(_0x24ce95)]),{'ok':!![]};return await spawnScript(_0x2a891d,_0x2aaf4e,_0x998b74,_0x24ce95),{'ok':!![]};}};
@@ -1 +1 @@
1
- const a168_0x101941=a168_0x3b4b;function a168_0x17ef(){const _0x30e32e=['json','217HEwVrq','166808AevuFf','1487090JFrpGF','423863LfZzdS','58236Dzxnle','318mvpjlf','312OIGfZr','120104RCYJNx','148689NFLKcM','read','3YqqZgf','21eMqQNe','14345WqkWnt'];a168_0x17ef=function(){return _0x30e32e;};return a168_0x17ef();}(function(_0x95887,_0x15a93c){const _0x4cdb0=a168_0x3b4b,_0x557680=_0x95887();while(!![]){try{const _0x2eb5aa=-parseInt(_0x4cdb0(0x135))/0x1*(-parseInt(_0x4cdb0(0x13d))/0x2)+parseInt(_0x4cdb0(0x136))/0x3*(parseInt(_0x4cdb0(0x140))/0x4)+-parseInt(_0x4cdb0(0x137))/0x5*(parseInt(_0x4cdb0(0x13e))/0x6)+parseInt(_0x4cdb0(0x139))/0x7*(-parseInt(_0x4cdb0(0x13a))/0x8)+-parseInt(_0x4cdb0(0x141))/0x9+-parseInt(_0x4cdb0(0x13b))/0xa+parseInt(_0x4cdb0(0x13c))/0xb*(parseInt(_0x4cdb0(0x13f))/0xc);if(_0x2eb5aa===_0x15a93c)break;else _0x557680['push'](_0x557680['shift']());}catch(_0x68c77){_0x557680['push'](_0x557680['shift']());}}}(a168_0x17ef,0x51f6e));import{buildSchemaPayload}from'../framework/schema-export.js';function a168_0x3b4b(_0x1053b6,_0xa55858){_0x1053b6=_0x1053b6-0x134;const _0x17efc4=a168_0x17ef();let _0x3b4b05=_0x17efc4[_0x1053b6];return _0x3b4b05;}async function execute(_0x3ad78b){const _0x34f8c1=await buildSchemaPayload();return{'ok':!![],'data':_0x34f8c1};}export const schemaDefinition={'service':'schema','command':'export','description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a168_0x101941(0x134),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a168_0x101941(0x138),'flags':[],'execute':execute};
1
+ const a169_0x589942=a169_0x43bf;(function(_0x382882,_0xf6ca83){const _0x1fb58a=a169_0x43bf,_0x4ec9c2=_0x382882();while(!![]){try{const _0x2508e3=-parseInt(_0x1fb58a(0x113))/0x1+parseInt(_0x1fb58a(0x114))/0x2*(-parseInt(_0x1fb58a(0x10e))/0x3)+-parseInt(_0x1fb58a(0x10f))/0x4+-parseInt(_0x1fb58a(0x111))/0x5+-parseInt(_0x1fb58a(0x10d))/0x6+parseInt(_0x1fb58a(0x10a))/0x7*(parseInt(_0x1fb58a(0x112))/0x8)+parseInt(_0x1fb58a(0x10b))/0x9;if(_0x2508e3===_0xf6ca83)break;else _0x4ec9c2['push'](_0x4ec9c2['shift']());}catch(_0x19f06c){_0x4ec9c2['push'](_0x4ec9c2['shift']());}}}(a169_0x4643,0x1df36));import{buildSchemaPayload}from'../framework/schema-export.js';function a169_0x43bf(_0x44e27d,_0x47eb03){_0x44e27d=_0x44e27d-0x10a;const _0x464378=a169_0x4643();let _0x43bf23=_0x464378[_0x44e27d];return _0x43bf23;}async function execute(_0x4b6086){const _0x5bc040=await buildSchemaPayload();return{'ok':!![],'data':_0x5bc040};}export const schemaDefinition={'service':a169_0x589942(0x115),'command':a169_0x589942(0x10c),'description':a169_0x589942(0x116),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a169_0x589942(0x110),'flags':[],'execute':execute};function a169_0x4643(){const _0x496303=['schema','Export\x20machine-readable\x20command\x20schema\x20(JSON)','682087AyAtIQ','5091462qFXpIg','export','999390bkhMJJ','24UzZYQu','492696BQxFDk','json','1065560EEGfqQ','8IgdLdH','16638xFSZuZ','5248GgEotP'];a169_0x4643=function(){return _0x496303;};return a169_0x4643();}
@@ -1 +1 @@
1
- const a169_0x40ca45=a169_0x3348;(function(_0x5ee109,_0x491947){const _0x407563=a169_0x3348,_0x807a22=_0x5ee109();while(!![]){try{const _0x5ed3d7=parseInt(_0x407563(0x211))/0x1+-parseInt(_0x407563(0x1e8))/0x2+-parseInt(_0x407563(0x1e6))/0x3+-parseInt(_0x407563(0x201))/0x4+-parseInt(_0x407563(0x1f0))/0x5*(-parseInt(_0x407563(0x203))/0x6)+-parseInt(_0x407563(0x1e1))/0x7+parseInt(_0x407563(0x213))/0x8;if(_0x5ed3d7===_0x491947)break;else _0x807a22['push'](_0x807a22['shift']());}catch(_0x13002e){_0x807a22['push'](_0x807a22['shift']());}}}(a169_0x159d,0x3a58e));function a169_0x3348(_0x53ff58,_0x54e1cc){_0x53ff58=_0x53ff58-0x1d4;const _0x159d23=a169_0x159d();let _0x334877=_0x159d23[_0x53ff58];return _0x334877;}import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';function a169_0x159d(){const _0x49badc=['Target\x20database\x20ID','sqlRoot','292088YpEZFW','SQL\x20名称不能为空','3515352ZEjWIF','lockFilePath','flag','flagMissing','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','MyBatis\x20XML(mybatisXml)','Created\x20SQL\x20query\x20','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','\x20\x20SELECT\x201\x20AS\x20id','✎\x20手动输入\x20dbId','lastSync','请输入\x20SQL\x20名称:','trim','name','368228woRYSb','mybatisXml','请选择目标数据库:','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','str','358875qRkgtu','__manual__','651114EyWfoV','</select>','number','validation','nonInteractive','join','length','SELECT\x201\x20AS\x20id;','70ebTGOZ','string','description','普通\x20SQL(sql)','toISOString','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','high-risk-write','dbName','catch','sql','appCode','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','适合带动态标签的\x20MyBatis\x20XML\x20SQL','map','sqlRootDir','dbId','dbId\x20必须为正整数','1580860DZLZVD','sqlCode','171636GMjZTo','Invalid\x20database\x20selection\x20payload:\x20','db-id','dbId\x20不能为空','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','POST','sqlName','isFinite','parse','stringify','SQL\x20query\x20display\x20name','mode'];a169_0x159d=function(){return _0x49badc;};return a169_0x159d();}import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x479acd){const _0x670549=a169_0x3348;if(_0x479acd==='mybatisXml')return[_0x670549(0x1fb),_0x670549(0x1db),_0x670549(0x1e9),'']['join']('\x0a');return[_0x670549(0x1ef),''][_0x670549(0x1ed)]('\x0a');}export const sqlCreate={'service':a169_0x40ca45(0x1f9),'command':'create','description':a169_0x40ca45(0x207),'risk':a169_0x40ca45(0x1f6),'flags':[{'name':'name','type':a169_0x40ca45(0x1f1),'description':a169_0x40ca45(0x20d)},{'name':a169_0x40ca45(0x205),'type':a169_0x40ca45(0x1ea),'description':a169_0x40ca45(0x20f)},{'name':a169_0x40ca45(0x20e),'type':'string','enum':[a169_0x40ca45(0x1f9),a169_0x40ca45(0x1e2)],'description':'Local\x20SQL\x20file\x20mode'}],async 'validate'(_0xe5dff4){const _0xb3df9d=a169_0x40ca45;if(!_0xe5dff4[_0xb3df9d(0x1ec)])return;if(!_0xe5dff4['str'](_0xb3df9d(0x1e0))[_0xb3df9d(0x1df)]())throw CliErrors['flagMissing'](_0xb3df9d(0x1e0),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x139e93=resolveProvidedDbId(_0xe5dff4);if(typeof _0x139e93!==_0xb3df9d(0x1ea)||!Number['isFinite'](_0x139e93)||_0x139e93<=0x0)throw CliErrors['flagMissing'](_0xb3df9d(0x205),_0xb3df9d(0x1d7));if(!_0xe5dff4[_0xb3df9d(0x1e5)](_0xb3df9d(0x20e))['trim']())throw CliErrors['flagMissing'](_0xb3df9d(0x20e),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0x56f36d){const _0x4cacbb=a169_0x40ca45,_0x76f30=loadSqlProjectConfig(_0x56f36d[_0x4cacbb(0x1fa)]),{sqlName:_0x46b7d5,dbId:_0x2f948f,dbName:_0x24709e,mode:_0x3a8953}=await resolveSqlNewInputs(_0x56f36d),_0x397eb2=buildSqlRelativePath('<server-generated-sqlCode>',_0x46b7d5,_0x24709e,_0x3a8953,_0x2f948f),_0x16bf57=_0x76f30[_0x4cacbb(0x1fe)]+'/'+_0x397eb2;return{'method':_0x4cacbb(0x208),'url':'/smartapi/custom/saveUserCustomSql','body':{'appCode':_0x56f36d[_0x4cacbb(0x1fa)],'sqlName':_0x46b7d5,'dbId':_0x2f948f,'mode':_0x3a8953,'localPath':_0x16bf57},'description':_0x4cacbb(0x1e4)+_0x76f30[_0x4cacbb(0x1fe)]};},async 'execute'(_0x10a09f){const _0x11b180=a169_0x40ca45,_0x3a10a8=loadSqlProjectConfig(_0x10a09f[_0x11b180(0x1fa)]),{sqlName:_0x5d9841,dbId:_0x3ed964,dbName:_0x429a59,mode:_0x12fc2a}=await resolveSqlNewInputs(_0x10a09f),_0x83e2c1=generateSqlTemplate(_0x12fc2a),_0x2c2a0d=await createSqlQuery({'appCode':_0x10a09f[_0x11b180(0x1fa)],'sqlName':_0x5d9841,'dbId':_0x3ed964,'sqlContent':_0x83e2c1}),_0x1ee6d9=ensureRemoteSqlContent(_0x2c2a0d),_0x4bd28b=_0x429a59||await getDbName(_0x10a09f[_0x11b180(0x1fa)],_0x3ed964)[_0x11b180(0x1f8)](()=>undefined),_0x54d25d=buildSqlRelativePath(_0x2c2a0d['sqlCode'],_0x2c2a0d[_0x11b180(0x209)],_0x4bd28b,_0x12fc2a,_0x3ed964),_0xdfdeee=_0x3a10a8[_0x11b180(0x1fe)]+'/'+_0x54d25d,_0x4db0a9=buildLocalSqlFileContent({'sqlCode':_0x2c2a0d[_0x11b180(0x202)],'sqlName':_0x2c2a0d['sqlName'],'dbId':_0x2c2a0d[_0x11b180(0x1ff)]},_0x1ee6d9,{'dbName':_0x4bd28b,'mode':_0x12fc2a,'syncedAt':new Date()[_0x11b180(0x1f4)](),'description':_0x2c2a0d[_0x11b180(0x1f2)]});if(await fileExists(_0xdfdeee))throw CliErrors[_0x11b180(0x1eb)]('File\x20already\x20exists:\x20'+_0xdfdeee);await ensureParentDirectory(_0xdfdeee),await writeFile(_0xdfdeee,_0x4db0a9,'utf8');const _0x103d74=await readSqlLockFile(_0x3a10a8[_0x11b180(0x1d4)]),{lockData:_0x2a26b4,appLock:_0xa4a76d}=ensureSqlLockScope(_0x103d74??createEmptySqlLock(),_0x3a10a8['appCode'],_0x3a10a8[_0x11b180(0x210)],'new');return _0xa4a76d['sqls'][_0x2c2a0d[_0x11b180(0x202)]]={...buildSqlLockEntry(_0x2c2a0d,_0x1ee6d9,computeSqlContentHash(_0x4db0a9),{'dbName':_0x4bd28b}),'path':_0x54d25d,'mode':_0x12fc2a},_0xa4a76d[_0x11b180(0x1dd)]=new Date()[_0x11b180(0x1f4)](),await writeSqlLockFile(_0x3a10a8[_0x11b180(0x1d4)],_0x2a26b4),{'ok':!![],'data':{'id':_0x2c2a0d['id'],'sqlCode':_0x2c2a0d[_0x11b180(0x202)],'sqlName':_0x2c2a0d['sqlName'],'dbId':_0x2c2a0d[_0x11b180(0x1ff)],'path':_0xdfdeee,'mode':_0x12fc2a},'message':_0x11b180(0x1d9)+_0x2c2a0d[_0x11b180(0x202)]};}};async function resolveSqlNewInputs(_0x504328){const _0xec538d=await resolveSqlNameInput(_0x504328),{dbId:_0x14951c,dbName:_0x4e6abf}=await resolveDbSelection(_0x504328),_0x51b212=await resolveSqlModeInput(_0x504328);return{'sqlName':_0xec538d,'dbId':_0x14951c,'dbName':_0x4e6abf,'mode':_0x51b212};}async function resolveSqlNameInput(_0x431405){const _0x1ec035=a169_0x40ca45,_0x2f226a=_0x431405[_0x1ec035(0x1e5)]('name')[_0x1ec035(0x1df)]();if(_0x2f226a)return _0x2f226a;if(_0x431405[_0x1ec035(0x1ec)])throw CliErrors[_0x1ec035(0x1d6)](_0x1ec035(0x1e0),_0x1ec035(0x1da));return(await input({'message':_0x1ec035(0x1de),'validate':_0x4532e7=>_0x4532e7[_0x1ec035(0x1df)]()?!![]:_0x1ec035(0x212)}))['trim']();}async function resolveDbSelection(_0x5170c5){const _0x5c658f=a169_0x40ca45,_0x29d713=resolveProvidedDbId(_0x5170c5);if(typeof _0x29d713===_0x5c658f(0x1ea)&&Number['isFinite'](_0x29d713)&&_0x29d713>0x0)return{'dbId':_0x29d713,'dbName':await getDbName(_0x5170c5[_0x5c658f(0x1fa)],_0x29d713)['catch'](()=>undefined)};if(_0x5170c5[_0x5c658f(0x1ec)])throw CliErrors[_0x5c658f(0x1d6)](_0x5c658f(0x205),_0x5c658f(0x1d7));const _0x11acbb=await listDatabases(_0x5170c5[_0x5c658f(0x1fa)])['catch'](()=>[]);if(_0x11acbb['length']===0x1)return{'dbId':_0x11acbb[0x0][_0x5c658f(0x1ff)],'dbName':_0x11acbb[0x0][_0x5c658f(0x1f7)]};if(_0x11acbb[_0x5c658f(0x1ee)]>0x1){const _0x40dc91=await select({'message':_0x5c658f(0x1e3),'choices':[..._0x11acbb[_0x5c658f(0x1fd)](_0x2aef7e=>({'name':_0x2aef7e[_0x5c658f(0x1f7)]+'\x20('+_0x2aef7e['dbId']+')','value':serializeDbSelection(_0x2aef7e)})),{'name':_0x5c658f(0x1dc),'value':_0x5c658f(0x1e7)}]});if(_0x40dc91!==_0x5c658f(0x1e7))return deserializeDbSelection(_0x40dc91);}const _0x557e77=await input({'message':'请输入目标数据库\x20dbId:','validate':_0x472e58=>{const _0x6d8308=_0x5c658f,_0x32f2bf=_0x472e58[_0x6d8308(0x1df)]();if(!_0x32f2bf)return _0x6d8308(0x206);const _0x15c31c=Number(_0x32f2bf);if(!Number['isInteger'](_0x15c31c)||_0x15c31c<=0x0)return _0x6d8308(0x200);return!![];}});return{'dbId':Number(_0x557e77[_0x5c658f(0x1df)]())};}async function resolveSqlModeInput(_0x1fe3f1){const _0x232e40=a169_0x40ca45,_0x2bfc01=_0x1fe3f1[_0x232e40(0x1e5)]('mode')[_0x232e40(0x1df)]();if(_0x2bfc01===_0x232e40(0x1f9)||_0x2bfc01==='mybatisXml')return _0x2bfc01;if(_0x1fe3f1[_0x232e40(0x1ec)])throw CliErrors['flagMissing'](_0x232e40(0x20e),_0x232e40(0x1f5));return await select({'message':'请选择本地\x20SQL\x20模式:','choices':[{'name':_0x232e40(0x1f3),'value':_0x232e40(0x1f9),'description':'适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句'},{'name':_0x232e40(0x1d8),'value':_0x232e40(0x1e2),'description':_0x232e40(0x1fc)}]});}function serializeDbSelection(_0x388a85){const _0x1fffea=a169_0x40ca45;return JSON[_0x1fffea(0x20c)]({'dbId':_0x388a85[_0x1fffea(0x1ff)],'dbName':_0x388a85[_0x1fffea(0x1f7)]});}function deserializeDbSelection(_0x170a3d){const _0x4cceec=a169_0x40ca45;try{const _0x9b1e0f=JSON[_0x4cceec(0x20b)](_0x170a3d);if(typeof _0x9b1e0f[_0x4cceec(0x1ff)]===_0x4cceec(0x1ea)&&Number[_0x4cceec(0x20a)](_0x9b1e0f[_0x4cceec(0x1ff)]))return{'dbId':_0x9b1e0f[_0x4cceec(0x1ff)],'dbName':_0x9b1e0f['dbName']};}catch{}throw CliErrors[_0x4cceec(0x1eb)](_0x4cceec(0x204)+_0x170a3d);}function resolveProvidedDbId(_0x30cd9a){const _0x4d10fe=a169_0x40ca45,_0x4c703a=_0x30cd9a[_0x4d10fe(0x1d5)](_0x4d10fe(0x205));if(typeof _0x4c703a===_0x4d10fe(0x1ea)&&Number[_0x4d10fe(0x20a)](_0x4c703a))return _0x4c703a;return undefined;}
1
+ const a170_0x5d6a56=a170_0x27a3;(function(_0x4af347,_0x3160cf){const _0x4e26f7=a170_0x27a3,_0x3a0885=_0x4af347();while(!![]){try{const _0x463c51=-parseInt(_0x4e26f7(0x1a5))/0x1*(parseInt(_0x4e26f7(0x1a7))/0x2)+parseInt(_0x4e26f7(0x1ba))/0x3*(-parseInt(_0x4e26f7(0x1a4))/0x4)+-parseInt(_0x4e26f7(0x1ab))/0x5*(-parseInt(_0x4e26f7(0x19a))/0x6)+parseInt(_0x4e26f7(0x19d))/0x7+-parseInt(_0x4e26f7(0x1bf))/0x8+parseInt(_0x4e26f7(0x19f))/0x9+parseInt(_0x4e26f7(0x1b6))/0xa*(parseInt(_0x4e26f7(0x1b4))/0xb);if(_0x463c51===_0x3160cf)break;else _0x3a0885['push'](_0x3a0885['shift']());}catch(_0x20738b){_0x3a0885['push'](_0x3a0885['shift']());}}}(a170_0x3dea,0xe7774));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';function a170_0x3dea(){const _0x291113=['126271IQqRYx','dbId\x20必须为正整数','16FFfMLT','sql','isInteger','POST','5wMzOnt','lastSync','Target\x20database\x20ID','name','join','string','trim','length','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','3239731NPESKN','db-id','100CzllfX','适合带动态标签的\x20MyBatis\x20XML\x20SQL','description','map','432354eiYvzf','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','stringify','sqlRootDir','isFinite','13702048sUjtlD','SELECT\x201\x20AS\x20id;','__manual__','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','utf8','catch','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','mybatisXml','create','sqls','Invalid\x20database\x20selection\x20payload:\x20','dbId\x20不能为空','请选择目标数据库:','high-risk-write','Created\x20SQL\x20query\x20','File\x20already\x20exists:\x20','sqlName','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','/smartapi/custom/saveUserCustomSql','<server-generated-sqlCode>','请输入目标数据库\x20dbId:','dbName','dbId','mode','请输入\x20SQL\x20名称:','flag','new','nonInteractive','appCode','validation','sqlRoot','toISOString','sqlCode','普通\x20SQL(sql)','2194926SEUDCU','SQL\x20query\x20display\x20name','SQL\x20名称不能为空','2433242CXunIr','str','2705463iDYKDH','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','flagMissing','number','MyBatis\x20XML(mybatisXml)','8AIuTqL'];a170_0x3dea=function(){return _0x291113;};return a170_0x3dea();}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x32fccc){const _0x4c5e0a=a170_0x27a3;if(_0x32fccc===_0x4c5e0a(0x1c7))return[_0x4c5e0a(0x189),'\x20\x20SELECT\x201\x20AS\x20id','</select>',''][_0x4c5e0a(0x1af)]('\x0a');return[_0x4c5e0a(0x1c0),''][_0x4c5e0a(0x1af)]('\x0a');}export const sqlCreate={'service':a170_0x5d6a56(0x1a8),'command':a170_0x5d6a56(0x1c8),'description':a170_0x5d6a56(0x1a0),'risk':a170_0x5d6a56(0x185),'flags':[{'name':a170_0x5d6a56(0x1ae),'type':a170_0x5d6a56(0x1b0),'description':a170_0x5d6a56(0x19b)},{'name':'db-id','type':a170_0x5d6a56(0x1a2),'description':a170_0x5d6a56(0x1ad)},{'name':a170_0x5d6a56(0x18f),'type':a170_0x5d6a56(0x1b0),'enum':[a170_0x5d6a56(0x1a8),'mybatisXml'],'description':'Local\x20SQL\x20file\x20mode'}],async 'validate'(_0x4ea50a){const _0x1f34f6=a170_0x5d6a56;if(!_0x4ea50a['nonInteractive'])return;if(!_0x4ea50a['str'](_0x1f34f6(0x1ae))[_0x1f34f6(0x1b1)]())throw CliErrors['flagMissing'](_0x1f34f6(0x1ae),_0x1f34f6(0x1b3));const _0x1514c9=resolveProvidedDbId(_0x4ea50a);if(typeof _0x1514c9!=='number'||!Number[_0x1f34f6(0x1be)](_0x1514c9)||_0x1514c9<=0x0)throw CliErrors[_0x1f34f6(0x1a1)]('db-id',_0x1f34f6(0x1bb));if(!_0x4ea50a['str']('mode')[_0x1f34f6(0x1b1)]())throw CliErrors[_0x1f34f6(0x1a1)](_0x1f34f6(0x18f),_0x1f34f6(0x1c6));},async 'dryRun'(_0x2b8794){const _0x19d9d9=a170_0x5d6a56,_0x2ac67b=loadSqlProjectConfig(_0x2b8794[_0x19d9d9(0x194)]),{sqlName:_0xa3a9ce,dbId:_0x5122e5,dbName:_0x59f184,mode:_0x2f3b84}=await resolveSqlNewInputs(_0x2b8794),_0x119517=buildSqlRelativePath(_0x19d9d9(0x18b),_0xa3a9ce,_0x59f184,_0x2f3b84,_0x5122e5),_0x1eb419=_0x2ac67b['sqlRootDir']+'/'+_0x119517;return{'method':_0x19d9d9(0x1aa),'url':_0x19d9d9(0x18a),'body':{'appCode':_0x2b8794[_0x19d9d9(0x194)],'sqlName':_0xa3a9ce,'dbId':_0x5122e5,'mode':_0x2f3b84,'localPath':_0x1eb419},'description':_0x19d9d9(0x1c5)+_0x2ac67b[_0x19d9d9(0x1bd)]};},async 'execute'(_0x4688a9){const _0x5adcb1=a170_0x5d6a56,_0x14e4b0=loadSqlProjectConfig(_0x4688a9['appCode']),{sqlName:_0x5329ba,dbId:_0x53562c,dbName:_0x5ef57f,mode:_0x27f148}=await resolveSqlNewInputs(_0x4688a9),_0x863f98=generateSqlTemplate(_0x27f148),_0xfb3fb7=await createSqlQuery({'appCode':_0x4688a9[_0x5adcb1(0x194)],'sqlName':_0x5329ba,'dbId':_0x53562c,'sqlContent':_0x863f98}),_0x405d0c=ensureRemoteSqlContent(_0xfb3fb7),_0x4c4843=_0x5ef57f||await getDbName(_0x4688a9[_0x5adcb1(0x194)],_0x53562c)['catch'](()=>undefined),_0x25f4b2=buildSqlRelativePath(_0xfb3fb7[_0x5adcb1(0x198)],_0xfb3fb7[_0x5adcb1(0x188)],_0x4c4843,_0x27f148,_0x53562c),_0x19d320=_0x14e4b0[_0x5adcb1(0x1bd)]+'/'+_0x25f4b2,_0x3482b3=buildLocalSqlFileContent({'sqlCode':_0xfb3fb7[_0x5adcb1(0x198)],'sqlName':_0xfb3fb7['sqlName'],'dbId':_0xfb3fb7[_0x5adcb1(0x18e)]},_0x405d0c,{'dbName':_0x4c4843,'mode':_0x27f148,'syncedAt':new Date()[_0x5adcb1(0x197)](),'description':_0xfb3fb7[_0x5adcb1(0x1b8)]});if(await fileExists(_0x19d320))throw CliErrors[_0x5adcb1(0x195)](_0x5adcb1(0x187)+_0x19d320);await ensureParentDirectory(_0x19d320),await writeFile(_0x19d320,_0x3482b3,_0x5adcb1(0x1c3));const _0x1e4536=await readSqlLockFile(_0x14e4b0['lockFilePath']),{lockData:_0xeee8f5,appLock:_0x46988e}=ensureSqlLockScope(_0x1e4536??createEmptySqlLock(),_0x14e4b0[_0x5adcb1(0x194)],_0x14e4b0[_0x5adcb1(0x196)],_0x5adcb1(0x192));return _0x46988e[_0x5adcb1(0x181)][_0xfb3fb7[_0x5adcb1(0x198)]]={...buildSqlLockEntry(_0xfb3fb7,_0x405d0c,computeSqlContentHash(_0x3482b3),{'dbName':_0x4c4843}),'path':_0x25f4b2,'mode':_0x27f148},_0x46988e[_0x5adcb1(0x1ac)]=new Date()[_0x5adcb1(0x197)](),await writeSqlLockFile(_0x14e4b0['lockFilePath'],_0xeee8f5),{'ok':!![],'data':{'id':_0xfb3fb7['id'],'sqlCode':_0xfb3fb7[_0x5adcb1(0x198)],'sqlName':_0xfb3fb7[_0x5adcb1(0x188)],'dbId':_0xfb3fb7[_0x5adcb1(0x18e)],'path':_0x19d320,'mode':_0x27f148},'message':_0x5adcb1(0x186)+_0xfb3fb7[_0x5adcb1(0x198)]};}};function a170_0x27a3(_0x46b5ad,_0x3d36a2){_0x46b5ad=_0x46b5ad-0x181;const _0x3dea3c=a170_0x3dea();let _0x27a381=_0x3dea3c[_0x46b5ad];return _0x27a381;}async function resolveSqlNewInputs(_0x14c9e4){const _0x34cf2e=await resolveSqlNameInput(_0x14c9e4),{dbId:_0xeac400,dbName:_0x1d92b3}=await resolveDbSelection(_0x14c9e4),_0x259fdc=await resolveSqlModeInput(_0x14c9e4);return{'sqlName':_0x34cf2e,'dbId':_0xeac400,'dbName':_0x1d92b3,'mode':_0x259fdc};}async function resolveSqlNameInput(_0x4815dd){const _0x81e4ff=a170_0x5d6a56,_0x78fc53=_0x4815dd[_0x81e4ff(0x19e)]('name')[_0x81e4ff(0x1b1)]();if(_0x78fc53)return _0x78fc53;if(_0x4815dd[_0x81e4ff(0x193)])throw CliErrors[_0x81e4ff(0x1a1)]('name',_0x81e4ff(0x1b3));return(await input({'message':_0x81e4ff(0x190),'validate':_0x160ffb=>_0x160ffb['trim']()?!![]:_0x81e4ff(0x19c)}))['trim']();}async function resolveDbSelection(_0x1be62c){const _0x3ded1b=a170_0x5d6a56,_0x4f8646=resolveProvidedDbId(_0x1be62c);if(typeof _0x4f8646==='number'&&Number['isFinite'](_0x4f8646)&&_0x4f8646>0x0)return{'dbId':_0x4f8646,'dbName':await getDbName(_0x1be62c[_0x3ded1b(0x194)],_0x4f8646)[_0x3ded1b(0x1c4)](()=>undefined)};if(_0x1be62c[_0x3ded1b(0x193)])throw CliErrors[_0x3ded1b(0x1a1)]('db-id',_0x3ded1b(0x1bb));const _0x3c6428=await listDatabases(_0x1be62c[_0x3ded1b(0x194)])[_0x3ded1b(0x1c4)](()=>[]);if(_0x3c6428[_0x3ded1b(0x1b2)]===0x1)return{'dbId':_0x3c6428[0x0][_0x3ded1b(0x18e)],'dbName':_0x3c6428[0x0][_0x3ded1b(0x18d)]};if(_0x3c6428[_0x3ded1b(0x1b2)]>0x1){const _0x5e2c32=await select({'message':_0x3ded1b(0x184),'choices':[..._0x3c6428[_0x3ded1b(0x1b9)](_0xc8496c=>({'name':_0xc8496c[_0x3ded1b(0x18d)]+'\x20('+_0xc8496c[_0x3ded1b(0x18e)]+')','value':serializeDbSelection(_0xc8496c)})),{'name':'✎\x20手动输入\x20dbId','value':_0x3ded1b(0x1c1)}]});if(_0x5e2c32!==_0x3ded1b(0x1c1))return deserializeDbSelection(_0x5e2c32);}const _0x32b2e7=await input({'message':_0x3ded1b(0x18c),'validate':_0x1fc008=>{const _0x49a0ec=_0x3ded1b,_0x36fcd2=_0x1fc008[_0x49a0ec(0x1b1)]();if(!_0x36fcd2)return _0x49a0ec(0x183);const _0x2a4161=Number(_0x36fcd2);if(!Number[_0x49a0ec(0x1a9)](_0x2a4161)||_0x2a4161<=0x0)return _0x49a0ec(0x1a6);return!![];}});return{'dbId':Number(_0x32b2e7['trim']())};}async function resolveSqlModeInput(_0x23791a){const _0x136495=a170_0x5d6a56,_0x58eaf4=_0x23791a[_0x136495(0x19e)]('mode')[_0x136495(0x1b1)]();if(_0x58eaf4==='sql'||_0x58eaf4===_0x136495(0x1c7))return _0x58eaf4;if(_0x23791a[_0x136495(0x193)])throw CliErrors[_0x136495(0x1a1)](_0x136495(0x18f),_0x136495(0x1c6));return await select({'message':'请选择本地\x20SQL\x20模式:','choices':[{'name':_0x136495(0x199),'value':_0x136495(0x1a8),'description':_0x136495(0x1c2)},{'name':_0x136495(0x1a3),'value':_0x136495(0x1c7),'description':_0x136495(0x1b7)}]});}function serializeDbSelection(_0x55474a){const _0x467437=a170_0x5d6a56;return JSON[_0x467437(0x1bc)]({'dbId':_0x55474a['dbId'],'dbName':_0x55474a[_0x467437(0x18d)]});}function deserializeDbSelection(_0x387f18){const _0x5da544=a170_0x5d6a56;try{const _0x276229=JSON['parse'](_0x387f18);if(typeof _0x276229['dbId']===_0x5da544(0x1a2)&&Number['isFinite'](_0x276229[_0x5da544(0x18e)]))return{'dbId':_0x276229[_0x5da544(0x18e)],'dbName':_0x276229[_0x5da544(0x18d)]};}catch{}throw CliErrors[_0x5da544(0x195)](_0x5da544(0x182)+_0x387f18);}function resolveProvidedDbId(_0x49dfb8){const _0x89f3c8=a170_0x5d6a56,_0x53b4a3=_0x49dfb8[_0x89f3c8(0x191)](_0x89f3c8(0x1b5));if(typeof _0x53b4a3==='number'&&Number[_0x89f3c8(0x1be)](_0x53b4a3))return _0x53b4a3;return undefined;}
@@ -1 +1 @@
1
- const a170_0x3b9ced=a170_0x1b72;function a170_0x3bc5(){const _0xc6a8bd=['sqlRoot','length','trashDir','trashedTo','\x20(local\x20file\x20moved\x20to\x20trash)','sqlRootDir','508392UzeVtz','remoteId','lastSync','/smartapi/custom/deleteUserCustomSql','POST','45052sYkilP','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','sql','str','appCode','2862880NQvomR','validation','fromEntries','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','Would\x20delete\x20SQL\x20','2303992txiCxu','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','sqls','lockFilePath','sqlcode','SQL\x20lock\x20file\x20not\x20found.','6341808zWStiM','toISOString','filter','delete','674270ZfEdwG','254356IMJzmq','high-risk-write','776rTyGDR'];a170_0x3bc5=function(){return _0xc6a8bd;};return a170_0x3bc5();}(function(_0x5c1a37,_0x346902){const _0x367417=a170_0x1b72,_0x189d63=_0x5c1a37();while(!![]){try{const _0x15e4a9=parseInt(_0x367417(0x87))/0x1+-parseInt(_0x367417(0x86))/0x2+parseInt(_0x367417(0x90))/0x3+-parseInt(_0x367417(0x7b))/0x4+-parseInt(_0x367417(0x76))/0x5+parseInt(_0x367417(0x82))/0x6+-parseInt(_0x367417(0x95))/0x7*(-parseInt(_0x367417(0x89))/0x8);if(_0x15e4a9===_0x346902)break;else _0x189d63['push'](_0x189d63['shift']());}catch(_0x88014d){_0x189d63['push'](_0x189d63['shift']());}}}(a170_0x3bc5,0x9736b));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';function a170_0x1b72(_0xd1aca,_0x558a9b){_0xd1aca=_0xd1aca-0x73;const _0x3bc589=a170_0x3bc5();let _0x1b72a0=_0x3bc589[_0xd1aca];return _0x1b72a0;}import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a170_0x3b9ced(0x73),'command':a170_0x3b9ced(0x85),'description':a170_0x3b9ced(0x7d),'risk':a170_0x3b9ced(0x88),'flags':[SQLCODE_FLAG],async 'validate'(_0x311389){const _0x403a69=a170_0x3b9ced,_0x105af4=loadSqlProjectConfig(_0x311389['appCode']),_0x2a97ab=await readSqlLockFile(_0x105af4[_0x403a69(0x7f)]);if(!_0x2a97ab)throw CliErrors[_0x403a69(0x77)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');},async 'dryRun'(_0x2a58a6){const _0x707a29=a170_0x3b9ced,_0x5a999f=loadSqlProjectConfig(_0x2a58a6[_0x707a29(0x75)]),_0x248a84=await readSqlLockFile(_0x5a999f[_0x707a29(0x7f)]);if(!_0x248a84)throw CliErrors[_0x707a29(0x77)](_0x707a29(0x79));const {appLock:_0x14f04f}=ensureSqlLockScope(_0x248a84,_0x2a58a6[_0x707a29(0x75)],_0x5a999f[_0x707a29(0x8a)],_0x707a29(0x85)),_0x77b0d2=_0x2a58a6[_0x707a29(0x74)](_0x707a29(0x80)),_0x1c9a0e=_0x14f04f['sqls'][_0x77b0d2];if(!_0x1c9a0e)throw CliErrors['validation'](_0x707a29(0x7c)+_0x77b0d2+'\x22.');return{'method':_0x707a29(0x94),'url':_0x707a29(0x93),'body':{'sqlCode':_0x77b0d2,'id':_0x1c9a0e[_0x707a29(0x91)],'localPath':resolveLocalSqlFilePath(_0x5a999f,_0x77b0d2,_0x1c9a0e)},'description':_0x707a29(0x7a)+_0x77b0d2+_0x707a29(0x96)+_0x5a999f[_0x707a29(0x8c)]};},async 'execute'(_0x19e225){const _0xf3b582=a170_0x3b9ced,_0x4491df=loadSqlProjectConfig(_0x19e225[_0xf3b582(0x75)]),_0x45d6d3=await readSqlLockFile(_0x4491df[_0xf3b582(0x7f)]);if(!_0x45d6d3)throw CliErrors['validation'](_0xf3b582(0x81));const {lockData:_0x56dcce,appLock:_0x2f3c89}=ensureSqlLockScope(_0x45d6d3,_0x19e225[_0xf3b582(0x75)],_0x4491df[_0xf3b582(0x8a)],'delete'),_0x48e78a=_0x19e225[_0xf3b582(0x74)](_0xf3b582(0x80)),_0x132882=_0x2f3c89[_0xf3b582(0x7e)][_0x48e78a];if(!_0x132882)throw CliErrors[_0xf3b582(0x77)](_0xf3b582(0x7c)+_0x48e78a+'\x22.');await deleteSqlQuery({'id':_0x132882[_0xf3b582(0x91)],'sqlCode':_0x48e78a}),_0x2f3c89[_0xf3b582(0x7e)]=Object[_0xf3b582(0x78)](Object['entries'](_0x2f3c89[_0xf3b582(0x7e)])[_0xf3b582(0x84)](([_0x4a4020])=>_0x4a4020!==_0x48e78a)),_0x2f3c89[_0xf3b582(0x92)]=new Date()[_0xf3b582(0x83)](),await writeSqlLockFile(_0x4491df['lockFilePath'],_0x56dcce);const _0xdbb5a0=resolveLocalSqlFilePath(_0x4491df,_0x48e78a,_0x132882);let _0x93377d;await fileExists(_0xdbb5a0)&&(_0x93377d=await moveToTrash(_0x4491df['projectRoot'],_0x4491df[_0xf3b582(0x8c)],_0xdbb5a0),await cleanupEmptyDirectories(dirname(_0xdbb5a0),_0x4491df[_0xf3b582(0x8f)]));const _0x56cd86={'deleted':_0x48e78a,'remoteId':_0x132882[_0xf3b582(0x91)]};if(_0x93377d)_0x56cd86[_0xf3b582(0x8d)]=_0x93377d;return{'ok':!![],'data':_0x56cd86,'message':'Deleted\x20'+_0x48e78a+(_0x93377d?_0xf3b582(0x8e):'')};}};async function moveToTrash(_0x3f6bbd,_0x503ed3,_0x2aa34f){const _0x4ecaf4=a170_0x3b9ced,_0x1ef5ab=new Date()[_0x4ecaf4(0x83)]()['replace'](/[:.]/g,'-'),_0x18975a=relative(_0x3f6bbd,_0x2aa34f),_0x544d=join(_0x503ed3,_0x1ef5ab,_0x18975a);return await mkdir(dirname(_0x544d),{'recursive':!![]}),await rename(_0x2aa34f,_0x544d),_0x544d;}async function cleanupEmptyDirectories(_0x41f5f0,_0x593249){const _0x41c428=a170_0x3b9ced;let _0x2f9d19=resolve(_0x41f5f0);const _0x1d95eb=resolve(_0x593249);while(_0x2f9d19['startsWith'](''+_0x1d95eb+sep)||_0x2f9d19===_0x1d95eb){if(_0x2f9d19===_0x1d95eb)return;try{const _0x4a9382=await readdir(_0x2f9d19);if(_0x4a9382[_0x41c428(0x8b)]>0x0)return;await rmdir(_0x2f9d19);}catch{return;}_0x2f9d19=dirname(_0x2f9d19);}}
1
+ const a171_0x2d4f34=a171_0x4cab;(function(_0x1d1d9c,_0x25ad0a){const _0xbfd4fa=a171_0x4cab,_0x38e70e=_0x1d1d9c();while(!![]){try{const _0x16e9fc=parseInt(_0xbfd4fa(0x1ee))/0x1+parseInt(_0xbfd4fa(0x1e7))/0x2*(-parseInt(_0xbfd4fa(0x205))/0x3)+parseInt(_0xbfd4fa(0x1f2))/0x4+-parseInt(_0xbfd4fa(0x1eb))/0x5*(parseInt(_0xbfd4fa(0x1e6))/0x6)+-parseInt(_0xbfd4fa(0x201))/0x7*(parseInt(_0xbfd4fa(0x200))/0x8)+parseInt(_0xbfd4fa(0x1e5))/0x9+parseInt(_0xbfd4fa(0x1f8))/0xa*(parseInt(_0xbfd4fa(0x1ea))/0xb);if(_0x16e9fc===_0x25ad0a)break;else _0x38e70e['push'](_0x38e70e['shift']());}catch(_0x436589){_0x38e70e['push'](_0x38e70e['shift']());}}}(a171_0x4a45,0x2ea27));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';function a171_0x4cab(_0x91a938,_0x3b62f8){_0x91a938=_0x91a938-0x1df;const _0x4a4564=a171_0x4a45();let _0x4cab24=_0x4a4564[_0x91a938];return _0x4cab24;}import{CliErrors}from'../../errors.js';function a171_0x4a45(){const _0x556f2c=['SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','Deleted\x20','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','481323NzrWnl','trashedTo','appCode','\x20(local\x20file\x20moved\x20to\x20trash)','fromEntries','sqlcode','high-risk-write','remoteId','1195875TxaOio','1095162zaQJfx','4tuYZLo','length','delete','66EfqebW','10sKzkwP','lockFilePath','POST','255331GfxiEb','sqlRoot','entries','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','994888nySGxI','replace','SQL\x20lock\x20file\x20not\x20found.','validation','startsWith','toISOString','773560cCJqkH','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','sqlRootDir','str','lastSync','sqls','projectRoot','trashDir','8MCWJcy','1568791CzKooM'];a171_0x4a45=function(){return _0x556f2c;};return a171_0x4a45();}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':'sql','command':a171_0x2d4f34(0x1e9),'description':a171_0x2d4f34(0x204),'risk':a171_0x2d4f34(0x1e3),'flags':[SQLCODE_FLAG],async 'validate'(_0x3f7605){const _0x2a4868=a171_0x2d4f34,_0x51bdb2=loadSqlProjectConfig(_0x3f7605[_0x2a4868(0x1df)]),_0x37900a=await readSqlLockFile(_0x51bdb2['lockFilePath']);if(!_0x37900a)throw CliErrors[_0x2a4868(0x1f5)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');},async 'dryRun'(_0x2878e0){const _0x53dddf=a171_0x2d4f34,_0x96af6f=loadSqlProjectConfig(_0x2878e0['appCode']),_0x452bf0=await readSqlLockFile(_0x96af6f[_0x53dddf(0x1ec)]);if(!_0x452bf0)throw CliErrors[_0x53dddf(0x1f5)](_0x53dddf(0x202));const {appLock:_0xe0e268}=ensureSqlLockScope(_0x452bf0,_0x2878e0[_0x53dddf(0x1df)],_0x96af6f['sqlRoot'],_0x53dddf(0x1e9)),_0x1b137a=_0x2878e0[_0x53dddf(0x1fb)](_0x53dddf(0x1e2)),_0xa289e4=_0xe0e268[_0x53dddf(0x1fd)][_0x1b137a];if(!_0xa289e4)throw CliErrors[_0x53dddf(0x1f5)](_0x53dddf(0x1f9)+_0x1b137a+'\x22.');return{'method':_0x53dddf(0x1ed),'url':'/smartapi/custom/deleteUserCustomSql','body':{'sqlCode':_0x1b137a,'id':_0xa289e4[_0x53dddf(0x1e4)],'localPath':resolveLocalSqlFilePath(_0x96af6f,_0x1b137a,_0xa289e4)},'description':'Would\x20delete\x20SQL\x20'+_0x1b137a+_0x53dddf(0x1f1)+_0x96af6f[_0x53dddf(0x1ff)]};},async 'execute'(_0x39a072){const _0x5856dd=a171_0x2d4f34,_0xc180f3=loadSqlProjectConfig(_0x39a072['appCode']),_0x12bba7=await readSqlLockFile(_0xc180f3[_0x5856dd(0x1ec)]);if(!_0x12bba7)throw CliErrors[_0x5856dd(0x1f5)](_0x5856dd(0x1f4));const {lockData:_0x25d8e1,appLock:_0xeef71c}=ensureSqlLockScope(_0x12bba7,_0x39a072['appCode'],_0xc180f3[_0x5856dd(0x1ef)],_0x5856dd(0x1e9)),_0x432168=_0x39a072[_0x5856dd(0x1fb)](_0x5856dd(0x1e2)),_0x23308a=_0xeef71c[_0x5856dd(0x1fd)][_0x432168];if(!_0x23308a)throw CliErrors[_0x5856dd(0x1f5)](_0x5856dd(0x1f9)+_0x432168+'\x22.');await deleteSqlQuery({'id':_0x23308a[_0x5856dd(0x1e4)],'sqlCode':_0x432168}),_0xeef71c[_0x5856dd(0x1fd)]=Object[_0x5856dd(0x1e1)](Object[_0x5856dd(0x1f0)](_0xeef71c[_0x5856dd(0x1fd)])['filter'](([_0x1c9125])=>_0x1c9125!==_0x432168)),_0xeef71c[_0x5856dd(0x1fc)]=new Date()[_0x5856dd(0x1f7)](),await writeSqlLockFile(_0xc180f3[_0x5856dd(0x1ec)],_0x25d8e1);const _0x2fb2b8=resolveLocalSqlFilePath(_0xc180f3,_0x432168,_0x23308a);let _0x414bcd;await fileExists(_0x2fb2b8)&&(_0x414bcd=await moveToTrash(_0xc180f3[_0x5856dd(0x1fe)],_0xc180f3[_0x5856dd(0x1ff)],_0x2fb2b8),await cleanupEmptyDirectories(dirname(_0x2fb2b8),_0xc180f3[_0x5856dd(0x1fa)]));const _0x19d539={'deleted':_0x432168,'remoteId':_0x23308a[_0x5856dd(0x1e4)]};if(_0x414bcd)_0x19d539[_0x5856dd(0x206)]=_0x414bcd;return{'ok':!![],'data':_0x19d539,'message':_0x5856dd(0x203)+_0x432168+(_0x414bcd?_0x5856dd(0x1e0):'')};}};async function moveToTrash(_0x1b6498,_0x10eede,_0x583d06){const _0x4cf258=a171_0x2d4f34,_0x59aeb8=new Date()[_0x4cf258(0x1f7)]()[_0x4cf258(0x1f3)](/[:.]/g,'-'),_0x115e6f=relative(_0x1b6498,_0x583d06),_0x1553c9=join(_0x10eede,_0x59aeb8,_0x115e6f);return await mkdir(dirname(_0x1553c9),{'recursive':!![]}),await rename(_0x583d06,_0x1553c9),_0x1553c9;}async function cleanupEmptyDirectories(_0x56382c,_0x161d94){const _0x7ec99=a171_0x2d4f34;let _0x59224f=resolve(_0x56382c);const _0x3d59e9=resolve(_0x161d94);while(_0x59224f[_0x7ec99(0x1f6)](''+_0x3d59e9+sep)||_0x59224f===_0x3d59e9){if(_0x59224f===_0x3d59e9)return;try{const _0x298611=await readdir(_0x59224f);if(_0x298611[_0x7ec99(0x1e8)]>0x0)return;await rmdir(_0x59224f);}catch{return;}_0x59224f=dirname(_0x59224f);}}
@@ -1 +1 @@
1
- const a171_0x30be1a=a171_0x31e1;function a171_0xb4cf(){const _0x3e0fed=['sql','detail','3557961gnZFTr','15940prfcRh','read','verbose','appCode','boolean','272qSrWzl','sqlContent','sqlName','1481064RuuaDe','7oJZmMg','description','dbId','1891302ZcXULl','269262ioPgPo','bool','sqlcode','1092724eEWsuK','Return\x20full\x20raw\x20SQL\x20query\x20object','4390529wzSMrz','10eCaSYa','8KOpYsT'];a171_0xb4cf=function(){return _0x3e0fed;};return a171_0xb4cf();}(function(_0x29319a,_0x4e5682){const _0xf86ab9=a171_0x31e1,_0x485f53=_0x29319a();while(!![]){try{const _0x123769=-parseInt(_0xf86ab9(0xb3))/0x1+parseInt(_0xf86ab9(0xb6))/0x2+-parseInt(_0xf86ab9(0xae))/0x3+-parseInt(_0xf86ab9(0xab))/0x4*(-parseInt(_0xf86ab9(0xbe))/0x5)+parseInt(_0xf86ab9(0xb2))/0x6*(parseInt(_0xf86ab9(0xaf))/0x7)+-parseInt(_0xf86ab9(0xba))/0x8*(parseInt(_0xf86ab9(0xbd))/0x9)+parseInt(_0xf86ab9(0xb9))/0xa*(parseInt(_0xf86ab9(0xb8))/0xb);if(_0x123769===_0x4e5682)break;else _0x485f53['push'](_0x485f53['shift']());}catch(_0x1ae7cc){_0x485f53['push'](_0x485f53['shift']());}}}(a171_0xb4cf,0x4def7));function a171_0x31e1(_0x4d80ae,_0x592c9d){_0x4d80ae=_0x4d80ae-0xab;const _0xb4cf0b=a171_0xb4cf();let _0x31e152=_0xb4cf0b[_0x4d80ae];return _0x31e152;}import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a171_0x30be1a(0xbb),'command':a171_0x30be1a(0xbc),'description':'Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','risk':a171_0x30be1a(0xbf),'flags':[SQLCODE_FLAG,{'name':a171_0x30be1a(0xc0),'type':a171_0x30be1a(0xc2),'description':a171_0x30be1a(0xb7)}],async 'execute'(_0x12e2bd){const _0x3b7967=a171_0x30be1a,_0x26d718=await getSqlQueryInfo(_0x12e2bd[_0x3b7967(0xc1)],_0x12e2bd['str'](_0x3b7967(0xb5))),_0x98cc5=_0x12e2bd[_0x3b7967(0xb4)](_0x3b7967(0xc0));if(_0x98cc5)return{'ok':!![],'data':_0x26d718};const _0x566d9a=_0x26d718[_0x3b7967(0xb1)]?await getDbName(_0x12e2bd[_0x3b7967(0xc1)],_0x26d718[_0x3b7967(0xb1)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x26d718['sqlCode'],'sqlName':_0x26d718[_0x3b7967(0xad)],'db':_0x566d9a?_0x566d9a+'\x20('+_0x26d718[_0x3b7967(0xb1)]+')':_0x26d718[_0x3b7967(0xb1)]??'','description':_0x26d718[_0x3b7967(0xb0)]??'','sqlContent':_0x26d718[_0x3b7967(0xac)]??''}};}};
1
+ const a172_0xa3d0f0=a172_0x1232;(function(_0x137b60,_0x3b9586){const _0xf2c6=a172_0x1232,_0x4e9cfd=_0x137b60();while(!![]){try{const _0x2619b0=parseInt(_0xf2c6(0x143))/0x1*(-parseInt(_0xf2c6(0x13b))/0x2)+-parseInt(_0xf2c6(0x147))/0x3*(-parseInt(_0xf2c6(0x139))/0x4)+-parseInt(_0xf2c6(0x138))/0x5*(-parseInt(_0xf2c6(0x13a))/0x6)+-parseInt(_0xf2c6(0x14a))/0x7*(-parseInt(_0xf2c6(0x133))/0x8)+parseInt(_0xf2c6(0x148))/0x9+parseInt(_0xf2c6(0x141))/0xa*(parseInt(_0xf2c6(0x134))/0xb)+-parseInt(_0xf2c6(0x136))/0xc;if(_0x2619b0===_0x3b9586)break;else _0x4e9cfd['push'](_0x4e9cfd['shift']());}catch(_0x95a84d){_0x4e9cfd['push'](_0x4e9cfd['shift']());}}}(a172_0x1108,0xc2306));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a172_0x1232(_0x99dc98,_0x1ebcc3){_0x99dc98=_0x99dc98-0x132;const _0x1108a7=a172_0x1108();let _0x1232fb=_0x1108a7[_0x99dc98];return _0x1232fb;}function a172_0x1108(){const _0xa7cc3c=['sqlcode','read','Return\x20full\x20raw\x20SQL\x20query\x20object','3FUoFaE','13231602TNrVlK','sql','5789BBHEDM','sqlCode','str','appCode','2536XuBRKM','44SETIHi','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','21715404BCtrTp','bool','1137155MlAIbK','2900396tFMbzE','18PWQYJG','14DlBQfd','dbId','sqlContent','verbose','sqlName','boolean','2301920JFVHyO','detail','207926AWYBJZ'];a172_0x1108=function(){return _0xa7cc3c;};return a172_0x1108();}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a172_0xa3d0f0(0x149),'command':a172_0xa3d0f0(0x142),'description':a172_0xa3d0f0(0x135),'risk':a172_0xa3d0f0(0x145),'flags':[SQLCODE_FLAG,{'name':a172_0xa3d0f0(0x13e),'type':a172_0xa3d0f0(0x140),'description':a172_0xa3d0f0(0x146)}],async 'execute'(_0x5c9b2a){const _0x2d6311=a172_0xa3d0f0,_0x3c95b8=await getSqlQueryInfo(_0x5c9b2a[_0x2d6311(0x132)],_0x5c9b2a[_0x2d6311(0x14c)](_0x2d6311(0x144))),_0x18ece0=_0x5c9b2a[_0x2d6311(0x137)](_0x2d6311(0x13e));if(_0x18ece0)return{'ok':!![],'data':_0x3c95b8};const _0x2edb7c=_0x3c95b8['dbId']?await getDbName(_0x5c9b2a[_0x2d6311(0x132)],_0x3c95b8[_0x2d6311(0x13c)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x3c95b8[_0x2d6311(0x14b)],'sqlName':_0x3c95b8[_0x2d6311(0x13f)],'db':_0x2edb7c?_0x2edb7c+'\x20('+_0x3c95b8[_0x2d6311(0x13c)]+')':_0x3c95b8['dbId']??'','description':_0x3c95b8['description']??'','sqlContent':_0x3c95b8[_0x2d6311(0x13d)]??''}};}};