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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/add.js +1 -1
  20. package/lib/commands/app/index.js +1 -1
  21. package/lib/commands/app/list.js +1 -1
  22. package/lib/commands/app/remote-directory.js +1 -1
  23. package/lib/commands/app/remove.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app-config/delete.js +1 -1
  26. package/lib/commands/app-config/get.js +1 -1
  27. package/lib/commands/app-config/index.js +1 -1
  28. package/lib/commands/app-config/list.js +1 -1
  29. package/lib/commands/app-config/set.js +1 -1
  30. package/lib/commands/app-config/shared.js +1 -1
  31. package/lib/commands/auth/index.js +1 -1
  32. package/lib/commands/bff/create.js +1 -1
  33. package/lib/commands/bff/delete.js +1 -1
  34. package/lib/commands/bff/detail.js +1 -1
  35. package/lib/commands/bff/index.js +1 -1
  36. package/lib/commands/bff/list.js +1 -1
  37. package/lib/commands/bff/pull.js +1 -1
  38. package/lib/commands/bff/push.js +1 -1
  39. package/lib/commands/bff/status.js +1 -1
  40. package/lib/commands/cli-skill/index.js +1 -1
  41. package/lib/commands/cli-update.js +1 -1
  42. package/lib/commands/codegen/index.js +1 -1
  43. package/lib/commands/codegen/sdk.js +1 -1
  44. package/lib/commands/codegen/sql.js +1 -1
  45. package/lib/commands/common/app-registry.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/dry-run.js +1 -1
  48. package/lib/commands/common/flags.js +1 -1
  49. package/lib/commands/common/local-file.js +1 -1
  50. package/lib/commands/common/validate.js +1 -1
  51. package/lib/commands/config/get.js +1 -1
  52. package/lib/commands/config/index.js +1 -1
  53. package/lib/commands/config/list.js +1 -1
  54. package/lib/commands/config/set.js +1 -1
  55. package/lib/commands/config/shared.js +1 -1
  56. package/lib/commands/data/filter.js +1 -1
  57. package/lib/commands/data/getOne.js +1 -1
  58. package/lib/commands/data/index.js +1 -1
  59. package/lib/commands/data/shared.js +1 -1
  60. package/lib/commands/dataset/business-group-update.js +1 -1
  61. package/lib/commands/dataset/capability.js +1 -1
  62. package/lib/commands/dataset/delete.js +1 -1
  63. package/lib/commands/dataset/detail.js +1 -1
  64. package/lib/commands/dataset/extend-update.js +1 -1
  65. package/lib/commands/dataset/field-update.js +1 -1
  66. package/lib/commands/dataset/generate.js +1 -1
  67. package/lib/commands/dataset/index.js +1 -1
  68. package/lib/commands/dataset/list.js +1 -1
  69. package/lib/commands/dataset/operations.js +1 -1
  70. package/lib/commands/dataset/relation-audit.js +1 -1
  71. package/lib/commands/dataset/relation-create.js +1 -1
  72. package/lib/commands/dataset/relation-delete.js +1 -1
  73. package/lib/commands/dataset/relation-shared.js +1 -1
  74. package/lib/commands/dataset/relation-update.js +1 -1
  75. package/lib/commands/dataset/relations.js +1 -1
  76. package/lib/commands/dataset/rename.js +1 -1
  77. package/lib/commands/dataset/restore.js +1 -1
  78. package/lib/commands/db/analysis-batching.js +1 -1
  79. package/lib/commands/db/analyze-batch-plan.js +1 -1
  80. package/lib/commands/db/analyze-cancel.js +1 -1
  81. package/lib/commands/db/analyze-start.js +1 -1
  82. package/lib/commands/db/analyze-status.js +1 -1
  83. package/lib/commands/db/create.js +1 -1
  84. package/lib/commands/db/delete.js +1 -1
  85. package/lib/commands/db/detail.js +1 -1
  86. package/lib/commands/db/diff.js +1 -1
  87. package/lib/commands/db/index.js +1 -1
  88. package/lib/commands/db/list.js +1 -1
  89. package/lib/commands/db/shared.js +1 -1
  90. package/lib/commands/db/tables.js +1 -1
  91. package/lib/commands/db/test.js +1 -1
  92. package/lib/commands/db/update.js +1 -1
  93. package/lib/commands/doctor.js +1 -1
  94. package/lib/commands/file/index.js +1 -1
  95. package/lib/commands/init/index.js +1 -1
  96. package/lib/commands/issue/index.js +1 -1
  97. package/lib/commands/issue/nudge.js +1 -1
  98. package/lib/commands/issue/report.js +1 -1
  99. package/lib/commands/issue/shared.js +1 -1
  100. package/lib/commands/logs/index.js +1 -1
  101. package/lib/commands/menu/index.js +1 -1
  102. package/lib/commands/menu/list.js +1 -1
  103. package/lib/commands/menu/shared/compare-table.js +1 -1
  104. package/lib/commands/menu/shared/index.js +1 -1
  105. package/lib/commands/menu/shared/inquirer.js +1 -1
  106. package/lib/commands/menu/shared/local-pages.js +1 -1
  107. package/lib/commands/menu/shared/logic.js +1 -1
  108. package/lib/commands/menu/shared/service.js +1 -1
  109. package/lib/commands/menu/shared/sync-core.js +1 -1
  110. package/lib/commands/menu/shared/update-core.js +1 -1
  111. package/lib/commands/menu/shared/valid-url.js +1 -1
  112. package/lib/commands/menu/sync.js +1 -1
  113. package/lib/commands/menu/update.js +1 -1
  114. package/lib/commands/page/generate-start.js +1 -1
  115. package/lib/commands/page/generate-status.js +1 -1
  116. package/lib/commands/page/index.js +1 -1
  117. package/lib/commands/page/pull.js +1 -1
  118. package/lib/commands/page/push.js +1 -1
  119. package/lib/commands/page/relation-audit.js +1 -1
  120. package/lib/commands/page/shared.js +1 -1
  121. package/lib/commands/page/standard-page-status.js +1 -1
  122. package/lib/commands/page/sync.js +1 -1
  123. package/lib/commands/permit/index.js +1 -1
  124. package/lib/commands/permit/page-get.js +1 -1
  125. package/lib/commands/permit/page-set.js +1 -1
  126. package/lib/commands/permit/role-apis-set.js +1 -1
  127. package/lib/commands/permit/role-menus-set.js +1 -1
  128. package/lib/commands/permit/role-menus.js +1 -1
  129. package/lib/commands/permit/shared.js +1 -1
  130. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  131. package/lib/commands/project/create/format-elapsed.js +1 -1
  132. package/lib/commands/project/create/main.js +1 -1
  133. package/lib/commands/project/create/non-interactive.js +1 -1
  134. package/lib/commands/project/create/project-template-path.js +1 -1
  135. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  136. package/lib/commands/project/create/use-format-code.js +1 -1
  137. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  138. package/lib/commands/project/index.js +1 -1
  139. package/lib/commands/project/init.js +1 -1
  140. package/lib/commands/project/upgrade.js +1 -1
  141. package/lib/commands/registry.js +1 -1
  142. package/lib/commands/role/create.js +1 -1
  143. package/lib/commands/role/delete.js +1 -1
  144. package/lib/commands/role/detail.js +1 -1
  145. package/lib/commands/role/index.js +1 -1
  146. package/lib/commands/role/list.js +1 -1
  147. package/lib/commands/role/shared.js +1 -1
  148. package/lib/commands/role/update.js +1 -1
  149. package/lib/commands/role/user-add.js +1 -1
  150. package/lib/commands/role/user-remove.js +1 -1
  151. package/lib/commands/role/user-resolve.js +1 -1
  152. package/lib/commands/run/index.js +1 -1
  153. package/lib/commands/schema.js +1 -1
  154. package/lib/commands/sql/create.js +1 -1
  155. package/lib/commands/sql/delete.js +1 -1
  156. package/lib/commands/sql/detail.js +1 -1
  157. package/lib/commands/sql/exec.js +1 -1
  158. package/lib/commands/sql/index.js +1 -1
  159. package/lib/commands/sql/list.js +1 -1
  160. package/lib/commands/sql/pull.js +1 -1
  161. package/lib/commands/sql/push.js +1 -1
  162. package/lib/commands/sql/save.js +1 -1
  163. package/lib/commands/sql/shared.js +1 -1
  164. package/lib/commands/sql/status.js +1 -1
  165. package/lib/commands/sql/validate.js +1 -1
  166. package/lib/commands/workspace/add.js +1 -1
  167. package/lib/commands/workspace/index.js +1 -1
  168. package/lib/commands/workspace/remove.js +1 -1
  169. package/lib/config/schema.js +1 -1
  170. package/lib/constant/cdn.js +1 -1
  171. package/lib/constant/cli.js +1 -1
  172. package/lib/constant/defaults.js +1 -1
  173. package/lib/constant/domain.js +1 -1
  174. package/lib/constant/env.js +1 -1
  175. package/lib/constant/output.js +1 -1
  176. package/lib/constant/paths.js +1 -1
  177. package/lib/constant/risk.js +1 -1
  178. package/lib/context/app-resolver.js +1 -1
  179. package/lib/context/auth-resolver.js +1 -1
  180. package/lib/context/config-loader.js +1 -1
  181. package/lib/context.js +1 -1
  182. package/lib/core/alias-resolver.js +1 -1
  183. package/lib/core/api-client.js +1 -1
  184. package/lib/core/bff/config.js +1 -1
  185. package/lib/core/bff/file-system.js +1 -1
  186. package/lib/core/bff/hash.js +1 -1
  187. package/lib/core/bff/lock.js +1 -1
  188. package/lib/core/bff/utils.js +1 -1
  189. package/lib/core/db-resolver.js +1 -1
  190. package/lib/core/page/file-system.js +1 -1
  191. package/lib/core/page/hash.js +1 -1
  192. package/lib/core/page/lock.js +1 -1
  193. package/lib/core/sql-sync/config.js +1 -1
  194. package/lib/core/sql-sync/file-system.js +1 -1
  195. package/lib/core/sql-sync/hash.js +1 -1
  196. package/lib/core/sql-sync/lock.js +1 -1
  197. package/lib/core/sql-sync/utils.js +1 -1
  198. package/lib/core/sql-validator.js +1 -1
  199. package/lib/errors.js +1 -1
  200. package/lib/framework/build-all-flags.js +1 -1
  201. package/lib/framework/flags.js +1 -1
  202. package/lib/framework/help.js +1 -1
  203. package/lib/framework/index.js +1 -1
  204. package/lib/framework/output.js +1 -1
  205. package/lib/framework/response.js +1 -1
  206. package/lib/framework/runner-alias.js +1 -1
  207. package/lib/framework/runner.js +1 -1
  208. package/lib/framework/schema-export.js +1 -1
  209. package/lib/framework/types.js +1 -1
  210. package/lib/generated/build-info.js +1 -1
  211. package/lib/help.js +1 -1
  212. package/lib/skills/main.js +1 -1
  213. package/lib/skills/npx-skills-add.js +1 -1
  214. package/lib/telemetry/cli-command-trace.js +1 -1
  215. package/lib/telemetry/cli-help-trace.js +1 -1
  216. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  217. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  218. package/lib/telemetry/send-cli-trace-log.js +1 -1
  219. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  220. package/lib/utils/ai_config.js +1 -1
  221. package/lib/utils/apply-jq-filter.js +1 -1
  222. package/lib/utils/cdn-config.js +1 -1
  223. package/lib/utils/check-sdk-version.js +1 -1
  224. package/lib/utils/cli-version-check.js +1 -1
  225. package/lib/utils/cli-version-policy.js +1 -1
  226. package/lib/utils/config.js +1 -1
  227. package/lib/utils/copy-directory.js +1 -1
  228. package/lib/utils/entity-with-id.js +1 -1
  229. package/lib/utils/file-utils.js +1 -1
  230. package/lib/utils/guides-cdn.js +1 -1
  231. package/lib/utils/http-client.js +1 -1
  232. package/lib/utils/is-non-interactive.js +1 -1
  233. package/lib/utils/logger.js +1 -1
  234. package/lib/utils/params.js +1 -1
  235. package/lib/utils/platform.js +1 -1
  236. package/lib/utils/rules-cdn.js +1 -1
  237. package/lib/utils/sleep.js +1 -1
  238. package/lib/utils/template-replacer.js +1 -1
  239. package/lib/utils/update-notice.js +1 -1
  240. package/lib/utils/version.js +1 -1
  241. package/lib/utils/with-active-cookie.js +1 -1
  242. package/lib/utils/write-cli-side-channel.js +1 -1
  243. package/package.json +1 -1
@@ -1 +1 @@
1
- const a141_0x12e26d=a141_0x380d;(function(_0x198c38,_0x306512){const _0x3cae25=a141_0x380d,_0x30874a=_0x198c38();while(!![]){try{const _0x4775c7=-parseInt(_0x3cae25(0x11f))/0x1*(-parseInt(_0x3cae25(0x121))/0x2)+parseInt(_0x3cae25(0x141))/0x3*(-parseInt(_0x3cae25(0x12a))/0x4)+-parseInt(_0x3cae25(0x133))/0x5+parseInt(_0x3cae25(0x13d))/0x6+-parseInt(_0x3cae25(0x12b))/0x7+-parseInt(_0x3cae25(0x103))/0x8*(parseInt(_0x3cae25(0x10b))/0x9)+-parseInt(_0x3cae25(0x13b))/0xa*(-parseInt(_0x3cae25(0x102))/0xb);if(_0x4775c7===_0x306512)break;else _0x30874a['push'](_0x30874a['shift']());}catch(_0xec14cc){_0x30874a['push'](_0x30874a['shift']());}}}(a141_0x2d2b,0xbe355));import{apiDefinitions}from'../commands/api/index.js';import{bffDefinitions}from'../commands/bff/index.js';function a141_0x2d2b(){const _0xc6213e=['Logs','build','get','skill','set','531306eWllgf','app','4XuLYMb','use','auth','Authentication','Schema','Dataset\x20&\x20Operations','app\x20use','filter','SQL\x20Queries','2168IqCjNv','4092312mhLVap','\x20\x20[write]','read','hidden','remote','`rabetbase\x20skills`\x20has\x20been\x20removed.','app\x20remote','Project','5822085wkbwpx','commands','CLI\x20Built-in\x20Skill','install','from','wildcardDef','Platform\x20Issue','`rabetbase\x20app\x20use`\x20has\x20been\x20removed.','11750lNrYIS','Self\x20Update','3969402jEeErQ','push','has','`rabetbase\x20app\x20remote`\x20has\x20been\x20removed.','3783BawZXp','Quick\x20Start','BFF\x20Scripts','write','\x20\x20[high-risk-write]','26037nSiaFq','11656ozdKTC','run','File','Permissions','isSingleCommand','Use\x20`rabetbase\x20cli-skill\x20install`\x20to\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill.\x20To\x20install\x20business\x20Skills,\x20use\x20`lovrabet\x20skill\x20install`.','App\x20Management','Workspace','7992mSSCSK','command','`rabetbase\x20','create','start','Configuration','skill\x20','project','Use\x20`rabetbase\x20workspace\x20use\x20--app\x20<name>`\x20instead.','defaultCommand','skills','Database\x20Connections','service','<script>','risk'];a141_0x2d2b=function(){return _0xc6213e;};return a141_0x2d2b();}import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{pageDefinitions}from'../commands/page/index.js';import{dataDefinitions}from'../commands/data/index.js';import{dbDefinitions}from'../commands/db/index.js';function a141_0x380d(_0x26d3ad,_0x144b1f){_0x26d3ad=_0x26d3ad-0xff;const _0x2d2b4a=a141_0x2d2b();let _0x380d66=_0x2d2b4a[_0x26d3ad];return _0x380d66;}import{codegenDefinitions}from'../commands/codegen/index.js';import{menuDefinitions}from'../commands/menu/index.js';import{roleDefinitions}from'../commands/role/index.js';import{permitDefinitions}from'../commands/permit/index.js';import{appDefinitions}from'../commands/app/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/index.js';import{doctorDefinition}from'../commands/doctor.js';import{updateDefinition}from'../commands/cli-update.js';import{schemaDefinition}from'../commands/schema.js';import{issueDefinitions}from'../commands/issue/index.js';import{fileDefinitions}from'../commands/file/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{projectDefinitions}from'../commands/project/index.js';import{initDefinitions}from'../commands/init/index.js';import{runDefinition}from'../commands/run/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x3747cd){const _0x2cbdaa=a141_0x380d;for(const _0x27e940 of _0x3747cd){definitions[_0x2cbdaa(0x11e)](_0x27e940[_0x2cbdaa(0x117)]+':'+_0x27e940[_0x2cbdaa(0x10c)],_0x27e940);let _0x3bdf07=serviceGroups[_0x2cbdaa(0x11c)](_0x27e940['service']);!_0x3bdf07&&(_0x3bdf07=[],serviceGroups[_0x2cbdaa(0x11e)](_0x27e940[_0x2cbdaa(0x117)],_0x3bdf07)),_0x3bdf07['push'](_0x27e940);}}function registerDeclarativeService(_0x498290,_0xeec1e7,_0x51ec71){const _0x18cb97=a141_0x380d;registerDefinitions(_0xeec1e7);_0x51ec71?.['wildcardDef']&&registerDefinitions([_0x51ec71[_0x18cb97(0x138)]]);const _0x5a1e72=_0x4b7b56=>_0x4b7b56===_0x18cb97(0x12d)?'':_0x4b7b56===_0x18cb97(0x100)?_0x18cb97(0x12c):_0x18cb97(0x101),_0x16a303={'service':_0xeec1e7[0x0][_0x18cb97(0x117)],'label':_0x498290,'commands':_0xeec1e7[_0x18cb97(0x128)](_0x213cd0=>!_0x213cd0[_0x18cb97(0x12e)])['map'](_0x2c6c73=>({'command':_0x2c6c73[_0x18cb97(0x10c)],'description':_0x2c6c73['description'],'tag':_0x5a1e72(_0x2c6c73[_0x18cb97(0x119)])})),'declarative':!![],'defaultCommand':_0x51ec71?.[_0x18cb97(0x114)]??(_0x51ec71?.[_0x18cb97(0x107)]?_0xeec1e7[0x0]['command']:undefined),'wildcardDef':_0x51ec71?.[_0x18cb97(0x138)],'isSingleCommand':_0x51ec71?.[_0x18cb97(0x107)]};serviceRegistry[_0x18cb97(0x13e)](_0x16a303),serviceByName[_0x18cb97(0x11e)](_0x16a303['service'],_0x16a303);}registerDeclarativeService(a141_0x12e26d(0x142),initDefinitions,{'defaultCommand':a141_0x12e26d(0x104),'isSingleCommand':!![]}),registerDeclarativeService(a141_0x12e26d(0x132),projectDefinitions),registerDeclarativeService(a141_0x12e26d(0x10a),workspaceDefinitions),registerDeclarativeService(a141_0x12e26d(0x109),appDefinitions),registerDeclarativeService(a141_0x12e26d(0x124),authDefinitions,{'defaultCommand':'login'}),registerDeclarativeService(a141_0x12e26d(0x126),datasetDefinitions),registerDeclarativeService('Smart\x20List\x20Pages',pageDefinitions),registerDeclarativeService('API\x20Development',apiDefinitions),registerDeclarativeService('Instant\x20API',dataDefinitions),registerDeclarativeService(a141_0x12e26d(0xff),bffDefinitions),registerDeclarativeService(a141_0x12e26d(0x129),sqlDefinitions),registerDeclarativeService(a141_0x12e26d(0x116),dbDefinitions),registerDeclarativeService('Menu',menuDefinitions),registerDeclarativeService('Roles',roleDefinitions),registerDeclarativeService(a141_0x12e26d(0x106),permitDefinitions),registerDeclarativeService('Runtime\x20App\x20Config\x20Management',appConfigDefinitions),registerDeclarativeService(a141_0x12e26d(0x139),issueDefinitions),registerDeclarativeService(a141_0x12e26d(0x105),fileDefinitions),registerDeclarativeService('Code\x20Generation',codegenDefinitions),registerDeclarativeService(a141_0x12e26d(0x110),configDefinitions),registerDeclarativeService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a141_0x12e26d(0x125),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a141_0x12e26d(0x13c),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a141_0x12e26d(0x135),cliSkillDefinitions,{'defaultCommand':a141_0x12e26d(0x136)}),registerDeclarativeService(a141_0x12e26d(0x11a),logsDefinitions,{'defaultCommand':'show'}),registerDeclarativeService('Run\x20Scripts',[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry['length']-0x1];last[a141_0x12e26d(0x134)]=[{'command':a141_0x12e26d(0x118),'description':'Run\x20any\x20package.json\x20script','tag':''}];}export const deprecatedAliases={'create':{'service':a141_0x12e26d(0x112),'command':a141_0x12e26d(0x10e)},'start':{'service':a141_0x12e26d(0x104),'command':a141_0x12e26d(0x10f)},'build':{'service':a141_0x12e26d(0x104),'command':a141_0x12e26d(0x11b)},'preview':{'service':a141_0x12e26d(0x104),'command':'preview'},'logout':{'service':a141_0x12e26d(0x123),'command':'logout'}};const CLI_SKILL_INSTALL_REMOVED_HINT=a141_0x12e26d(0x108),APP_REMOTE_REMOVED_HINT='Use\x20`rabetbase\x20app\x20list\x20--remote`\x20instead.',APP_USE_REMOVED_HINT=a141_0x12e26d(0x113);export function resolveRemovedCommand(_0x4a265e,_0x225b49){const _0x233c7f=a141_0x12e26d;if(_0x4a265e==='skill'){const _0x1440ce=_0x225b49?_0x233c7f(0x111)+_0x225b49:_0x233c7f(0x11d);return{'command':_0x1440ce,'message':_0x233c7f(0x10d)+_0x1440ce+'`\x20has\x20been\x20removed.','hint':CLI_SKILL_INSTALL_REMOVED_HINT};}if(_0x4a265e===_0x233c7f(0x115))return{'command':_0x233c7f(0x115),'message':_0x233c7f(0x130),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};if(_0x4a265e==='app'&&_0x225b49===_0x233c7f(0x12f))return{'command':_0x233c7f(0x131),'message':_0x233c7f(0x140),'hint':APP_REMOTE_REMOVED_HINT};if(_0x4a265e===_0x233c7f(0x120)&&_0x225b49===_0x233c7f(0x122))return{'command':_0x233c7f(0x127),'message':_0x233c7f(0x13a),'hint':APP_USE_REMOVED_HINT};return undefined;}export const deprecatedSubcommands={'bff':{'new':'create'},'sql':{'new':'create'}};export function resolveDeprecatedSubcommand(_0x2a85f7,_0x1b6d00){return deprecatedSubcommands[_0x2a85f7]?.[_0x1b6d00];}export function findDefinition(_0x17aa74,_0x197fd2){const _0x294387=a141_0x12e26d;return definitions[_0x294387(0x11c)](_0x17aa74+':'+_0x197fd2);}export function isKnownService(_0x1160ed){const _0x31db85=a141_0x12e26d;return serviceByName[_0x31db85(0x13f)](_0x1160ed);}export function isDeclarativeService(_0x84d3be){const _0x6859c2=a141_0x12e26d;return serviceGroups['has'](_0x84d3be)||serviceByName['get'](_0x84d3be)?.[_0x6859c2(0x138)]!==undefined;}export function getServiceEntry(_0x2b9d46){const _0x404842=a141_0x12e26d;return serviceByName[_0x404842(0x11c)](_0x2b9d46);}export function getLegacyHandler(_0x207626,_0x2f472b){return undefined;}export function getAllDefinitions(){const _0xeec789=a141_0x12e26d;return Array[_0xeec789(0x137)](definitions['values']());}
1
+ const a141_0x2e329a=a141_0xfa8d;(function(_0x567a9d,_0x4275ad){const _0x3de6e9=a141_0xfa8d,_0x478143=_0x567a9d();while(!![]){try{const _0x267db8=parseInt(_0x3de6e9(0x17d))/0x1*(parseInt(_0x3de6e9(0x19c))/0x2)+parseInt(_0x3de6e9(0x1a3))/0x3+parseInt(_0x3de6e9(0x1a0))/0x4+parseInt(_0x3de6e9(0x196))/0x5*(-parseInt(_0x3de6e9(0x18b))/0x6)+parseInt(_0x3de6e9(0x16a))/0x7+-parseInt(_0x3de6e9(0x187))/0x8*(-parseInt(_0x3de6e9(0x17a))/0x9)+-parseInt(_0x3de6e9(0x17b))/0xa;if(_0x267db8===_0x4275ad)break;else _0x478143['push'](_0x478143['shift']());}catch(_0x1e8649){_0x478143['push'](_0x478143['shift']());}}}(a141_0x1c0e,0x7c4f7));import{apiDefinitions}from'../commands/api/index.js';import{bffDefinitions}from'../commands/bff/index.js';function a141_0x1c0e(){const _0x53a14f=['18298pOGTNb','hidden','\x20\x20[write]','show','75648lsZmMQ','logout','Schema','980964lMzhbr','App\x20Management','Use\x20`rabetbase\x20workspace\x20use\x20--app\x20<name>`\x20instead.','BFF\x20Scripts','get','Dataset\x20&\x20Operations','File','Database\x20Connections','Workspace','skills','install','CLI\x20Built-in\x20Skill','3612686RZMTHf','skill\x20','skill','set','run','filter','`rabetbase\x20app\x20remote`\x20has\x20been\x20removed.','command','Permissions','Configuration','Roles','Use\x20`rabetbase\x20cli-skill\x20install`\x20to\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill.\x20To\x20install\x20business\x20Skills,\x20use\x20`lovrabet\x20skill\x20install`.','Project','write','Instant\x20API','`\x20has\x20been\x20removed.','9rHZfXa','21080810LzkIau','Diagnostics','110nlSYoS','commands','wildcardDef','Code\x20Generation','Smart\x20List\x20Pages','Run\x20any\x20package.json\x20script','from','defaultCommand','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20instead.','use','7409680FCiydT','length','SQL\x20Queries','preview','18YlZTLq','app\x20use','Self\x20Update','has','service','isSingleCommand','Runtime\x20App\x20Config\x20Management','login','`rabetbase\x20skills`\x20has\x20been\x20removed.','read','push','295570qGxFnt','Quick\x20Start','start','<script>','API\x20Development','risk'];a141_0x1c0e=function(){return _0x53a14f;};return a141_0x1c0e();}import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{pageDefinitions}from'../commands/page/index.js';import{dataDefinitions}from'../commands/data/index.js';import{dbDefinitions}from'../commands/db/index.js';import{codegenDefinitions}from'../commands/codegen/index.js';import{menuDefinitions}from'../commands/menu/index.js';import{roleDefinitions}from'../commands/role/index.js';import{permitDefinitions}from'../commands/permit/index.js';import{appDefinitions}from'../commands/app/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/index.js';import{doctorDefinition}from'../commands/doctor.js';import{updateDefinition}from'../commands/cli-update.js';import{schemaDefinition}from'../commands/schema.js';import{issueDefinitions}from'../commands/issue/index.js';import{fileDefinitions}from'../commands/file/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{authDefinitions}from'../commands/auth/index.js';function a141_0xfa8d(_0x10dbb1,_0x5ac724){_0x10dbb1=_0x10dbb1-0x162;const _0x1c0eb5=a141_0x1c0e();let _0xfa8d05=_0x1c0eb5[_0x10dbb1];return _0xfa8d05;}import{logsDefinitions}from'../commands/logs/index.js';import{projectDefinitions}from'../commands/project/index.js';import{initDefinitions}from'../commands/init/index.js';import{runDefinition}from'../commands/run/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x49a5b7){const _0x307354=a141_0xfa8d;for(const _0x22b1df of _0x49a5b7){definitions[_0x307354(0x16d)](_0x22b1df['service']+':'+_0x22b1df[_0x307354(0x171)],_0x22b1df);let _0x5c2ebd=serviceGroups[_0x307354(0x162)](_0x22b1df[_0x307354(0x18f)]);!_0x5c2ebd&&(_0x5c2ebd=[],serviceGroups[_0x307354(0x16d)](_0x22b1df['service'],_0x5c2ebd)),_0x5c2ebd[_0x307354(0x195)](_0x22b1df);}}function registerDeclarativeService(_0x32d292,_0x4f9e23,_0x33e840){const _0x23e06d=a141_0xfa8d;registerDefinitions(_0x4f9e23);_0x33e840?.['wildcardDef']&&registerDefinitions([_0x33e840[_0x23e06d(0x17f)]]);const _0x84ade1=_0x4f349f=>_0x4f349f===_0x23e06d(0x194)?'':_0x4f349f===_0x23e06d(0x177)?_0x23e06d(0x19e):'\x20\x20[high-risk-write]',_0xfd619d={'service':_0x4f9e23[0x0][_0x23e06d(0x18f)],'label':_0x32d292,'commands':_0x4f9e23[_0x23e06d(0x16f)](_0x4466b9=>!_0x4466b9[_0x23e06d(0x19d)])['map'](_0x10f457=>({'command':_0x10f457[_0x23e06d(0x171)],'description':_0x10f457['description'],'tag':_0x84ade1(_0x10f457[_0x23e06d(0x19b)])})),'declarative':!![],'defaultCommand':_0x33e840?.[_0x23e06d(0x184)]??(_0x33e840?.[_0x23e06d(0x190)]?_0x4f9e23[0x0][_0x23e06d(0x171)]:undefined),'wildcardDef':_0x33e840?.[_0x23e06d(0x17f)],'isSingleCommand':_0x33e840?.[_0x23e06d(0x190)]};serviceRegistry[_0x23e06d(0x195)](_0xfd619d),serviceByName['set'](_0xfd619d['service'],_0xfd619d);}registerDeclarativeService(a141_0x2e329a(0x197),initDefinitions,{'defaultCommand':a141_0x2e329a(0x16e),'isSingleCommand':!![]}),registerDeclarativeService(a141_0x2e329a(0x176),projectDefinitions),registerDeclarativeService(a141_0x2e329a(0x166),workspaceDefinitions),registerDeclarativeService(a141_0x2e329a(0x1a4),appDefinitions),registerDeclarativeService('Authentication',authDefinitions,{'defaultCommand':a141_0x2e329a(0x192)}),registerDeclarativeService(a141_0x2e329a(0x163),datasetDefinitions),registerDeclarativeService(a141_0x2e329a(0x181),pageDefinitions),registerDeclarativeService(a141_0x2e329a(0x19a),apiDefinitions),registerDeclarativeService(a141_0x2e329a(0x178),dataDefinitions),registerDeclarativeService(a141_0x2e329a(0x1a6),bffDefinitions),registerDeclarativeService(a141_0x2e329a(0x189),sqlDefinitions),registerDeclarativeService(a141_0x2e329a(0x165),dbDefinitions),registerDeclarativeService('Menu',menuDefinitions),registerDeclarativeService(a141_0x2e329a(0x174),roleDefinitions),registerDeclarativeService(a141_0x2e329a(0x172),permitDefinitions),registerDeclarativeService(a141_0x2e329a(0x191),appConfigDefinitions),registerDeclarativeService('Platform\x20Issue',issueDefinitions),registerDeclarativeService(a141_0x2e329a(0x164),fileDefinitions),registerDeclarativeService(a141_0x2e329a(0x180),codegenDefinitions),registerDeclarativeService(a141_0x2e329a(0x173),configDefinitions),registerDeclarativeService(a141_0x2e329a(0x17c),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a141_0x2e329a(0x1a2),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a141_0x2e329a(0x18d),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a141_0x2e329a(0x169),cliSkillDefinitions,{'defaultCommand':a141_0x2e329a(0x168)}),registerDeclarativeService('Logs',logsDefinitions,{'defaultCommand':a141_0x2e329a(0x19f)}),registerDeclarativeService('Run\x20Scripts',[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry[a141_0x2e329a(0x188)]-0x1];last[a141_0x2e329a(0x17e)]=[{'command':a141_0x2e329a(0x199),'description':a141_0x2e329a(0x182),'tag':''}];}export const deprecatedAliases={'create':{'service':'project','command':'create'},'start':{'service':a141_0x2e329a(0x16e),'command':a141_0x2e329a(0x198)},'build':{'service':a141_0x2e329a(0x16e),'command':'build'},'preview':{'service':'run','command':a141_0x2e329a(0x18a)},'logout':{'service':'auth','command':a141_0x2e329a(0x1a1)}};const CLI_SKILL_INSTALL_REMOVED_HINT=a141_0x2e329a(0x175),APP_REMOTE_REMOVED_HINT=a141_0x2e329a(0x185),APP_USE_REMOVED_HINT=a141_0x2e329a(0x1a5);export function resolveRemovedCommand(_0x47a95a,_0x58f6dc){const _0x11fda8=a141_0x2e329a;if(_0x47a95a===_0x11fda8(0x16c)){const _0xe25a8d=_0x58f6dc?_0x11fda8(0x16b)+_0x58f6dc:'skill';return{'command':_0xe25a8d,'message':'`rabetbase\x20'+_0xe25a8d+_0x11fda8(0x179),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};}if(_0x47a95a===_0x11fda8(0x167))return{'command':_0x11fda8(0x167),'message':_0x11fda8(0x193),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};if(_0x47a95a==='app'&&_0x58f6dc==='remote')return{'command':'app\x20remote','message':_0x11fda8(0x170),'hint':APP_REMOTE_REMOVED_HINT};if(_0x47a95a==='app'&&_0x58f6dc===_0x11fda8(0x186))return{'command':_0x11fda8(0x18c),'message':'`rabetbase\x20app\x20use`\x20has\x20been\x20removed.','hint':APP_USE_REMOVED_HINT};return undefined;}export const deprecatedSubcommands={'bff':{'new':'create'},'sql':{'new':'create'}};export function resolveDeprecatedSubcommand(_0x244e7d,_0x46646a){return deprecatedSubcommands[_0x244e7d]?.[_0x46646a];}export function findDefinition(_0x49f90d,_0x58e53a){const _0x15ced7=a141_0x2e329a;return definitions[_0x15ced7(0x162)](_0x49f90d+':'+_0x58e53a);}export function isKnownService(_0xfb57e5){const _0x4653f8=a141_0x2e329a;return serviceByName[_0x4653f8(0x18e)](_0xfb57e5);}export function isDeclarativeService(_0x5005d3){const _0xbcce78=a141_0x2e329a;return serviceGroups[_0xbcce78(0x18e)](_0x5005d3)||serviceByName['get'](_0x5005d3)?.[_0xbcce78(0x17f)]!==undefined;}export function getServiceEntry(_0x181dee){const _0x173742=a141_0x2e329a;return serviceByName[_0x173742(0x162)](_0x181dee);}export function getLegacyHandler(_0x40e1dc,_0x5781eb){return undefined;}export function getAllDefinitions(){const _0x1f21e9=a141_0x2e329a;return Array[_0x1f21e9(0x183)](definitions['values']());}
@@ -1 +1 @@
1
- const a142_0xf58b62=a142_0x2444;function a142_0x2444(_0x5f103e,_0x106346){_0x5f103e=_0x5f103e-0xe5;const _0x4a6228=a142_0x4a62();let _0x2444c8=_0x4a6228[_0x5f103e];return _0x2444c8;}(function(_0x167e8b,_0x8f0036){const _0x37cc79=a142_0x2444,_0x3d5cd2=_0x167e8b();while(!![]){try{const _0x56c6cd=parseInt(_0x37cc79(0xea))/0x1*(parseInt(_0x37cc79(0xe8))/0x2)+-parseInt(_0x37cc79(0xed))/0x3+parseInt(_0x37cc79(0xe6))/0x4+parseInt(_0x37cc79(0xeb))/0x5*(-parseInt(_0x37cc79(0xfe))/0x6)+parseInt(_0x37cc79(0xfd))/0x7+-parseInt(_0x37cc79(0xfc))/0x8*(parseInt(_0x37cc79(0xee))/0x9)+-parseInt(_0x37cc79(0xef))/0xa*(-parseInt(_0x37cc79(0xe5))/0xb);if(_0x56c6cd===_0x8f0036)break;else _0x3d5cd2['push'](_0x3d5cd2['shift']());}catch(_0x26253e){_0x3d5cd2['push'](_0x3d5cd2['shift']());}}}(a142_0x4a62,0xedc77));import{createAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a142_0x4a62(){const _0x2d577e=['flagMissing','11jgCMRN','178080ApVJbV','trim','2HNqfGC','create','443203iaNvnG','7455jyRSCX','str','3384561ulYgZo','198vlTXbQ','35572130YqRDqU','validation','POST','Pass\x20--name\x20<roleName>.','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','Create\x20a\x20CUSTOM\x20user\x20group\x20(role)','CUSTOM','remark','write','roleName','appCode','length','name','516064SYGIjR','3045581gOMXDs','3858Iutjqc','/smartapi/permit/role/create'];a142_0x4a62=function(){return _0x2d577e;};return a142_0x4a62();}import{asDryRunResult}from'../../commands/common/dry-run.js';import{NAME_FLAG,REMARK_FLAG,projectRole}from'../../commands/role/shared.js';const CREATE_PATH=a142_0xf58b62(0xff);function readName(_0x37a321){const _0x35b9a2=a142_0xf58b62,_0x103a1d=_0x37a321[_0x35b9a2(0xec)](_0x35b9a2(0xfb))[_0x35b9a2(0xe7)]();if(!_0x103a1d)throw CliErrors[_0x35b9a2(0x100)](_0x35b9a2(0xfb),_0x35b9a2(0xf2));if(_0x103a1d[_0x35b9a2(0xfa)]>0x40)throw CliErrors[_0x35b9a2(0xf0)](_0x35b9a2(0xf3));return _0x103a1d;}export const roleCreate={'service':'role','command':a142_0xf58b62(0xe9),'description':a142_0xf58b62(0xf4),'risk':a142_0xf58b62(0xf7),'flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x54a6d8){readName(_0x54a6d8);},async 'dryRun'(_0x1085ce){const _0x5e1604=a142_0xf58b62,_0x33f959=readName(_0x1085ce),_0x4a20b6=_0x1085ce[_0x5e1604(0xec)](_0x5e1604(0xf6))[_0x5e1604(0xe7)]()||undefined;return asDryRunResult({'operation':_0x5e1604(0xe9),'selector':{'appCode':_0x1085ce[_0x5e1604(0xf9)],'roleName':_0x33f959},'before':null,'after':{'roleName':_0x33f959,'roleType':_0x5e1604(0xf5),'remark':_0x4a20b6},'dryRun':!![],'backend':{'method':_0x5e1604(0xf1),'path':CREATE_PATH},'warnings':[]},{'method':_0x5e1604(0xf1),'url':CREATE_PATH});},async 'execute'(_0x2c51a0){const _0x818f5=a142_0xf58b62,_0x11e36b=readName(_0x2c51a0),_0x459285=_0x2c51a0['str'](_0x818f5(0xf6))[_0x818f5(0xe7)]()||undefined,_0x377bdd=await createAppRole({'appCode':_0x2c51a0[_0x818f5(0xf9)],'roleName':_0x11e36b,..._0x459285?{'remark':_0x459285}:{}});return{'ok':!![],'data':{'operation':_0x818f5(0xe9),'selector':{'appCode':_0x2c51a0[_0x818f5(0xf9)],'roleId':_0x377bdd['id'],'roleName':_0x11e36b},'before':null,'after':projectRole(_0x377bdd),'dryRun':![],'backend':{'method':'POST','path':CREATE_PATH},'warnings':[]},'message':'Created\x20role\x20'+_0x377bdd[_0x818f5(0xf8)]+'\x20(id='+_0x377bdd['id']+')'};}};
1
+ function a142_0x33a9(){const _0x556495=['390FWokxM','3891UZlcJR','53479019usPYYL','CUSTOM','886fjAShT','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','/smartapi/permit/role/create','remark','POST','name','12YqHphI','112GZXUvq','create','trim','length','18898490Rghxrd','appCode','1248429msxssy','193627lLfQkh','11673WKrAuh','311435AVxQwL','1280Vfsnsy','str'];a142_0x33a9=function(){return _0x556495;};return a142_0x33a9();}const a142_0x6719b2=a142_0x4b26;(function(_0x34fec9,_0x43d478){const _0x579e3e=a142_0x4b26,_0x873776=_0x34fec9();while(!![]){try{const _0x3c1da6=parseInt(_0x579e3e(0xf3))/0x1*(parseInt(_0x579e3e(0xf6))/0x2)+-parseInt(_0x579e3e(0x103))/0x3+-parseInt(_0x579e3e(0xfd))/0x4*(parseInt(_0x579e3e(0xef))/0x5)+-parseInt(_0x579e3e(0xf2))/0x6*(parseInt(_0x579e3e(0x104))/0x7)+parseInt(_0x579e3e(0xf0))/0x8*(parseInt(_0x579e3e(0xee))/0x9)+-parseInt(_0x579e3e(0x101))/0xa+parseInt(_0x579e3e(0xf4))/0xb*(parseInt(_0x579e3e(0xfc))/0xc);if(_0x3c1da6===_0x43d478)break;else _0x873776['push'](_0x873776['shift']());}catch(_0x1621cf){_0x873776['push'](_0x873776['shift']());}}}(a142_0x33a9,0xe6b49));function a142_0x4b26(_0x190893,_0x16dbd5){_0x190893=_0x190893-0xee;const _0x33a96c=a142_0x33a9();let _0x4b265e=_0x33a96c[_0x190893];return _0x4b265e;}import{createAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{NAME_FLAG,REMARK_FLAG,projectRole}from'../../commands/role/shared.js';const CREATE_PATH=a142_0x6719b2(0xf8);function readName(_0x22d9fd){const _0x585a00=a142_0x6719b2,_0x51ac97=_0x22d9fd[_0x585a00(0xf1)](_0x585a00(0xfb))['trim']();if(!_0x51ac97)throw CliErrors['flagMissing']('name','Pass\x20--name\x20<roleName>.');if(_0x51ac97[_0x585a00(0x100)]>0x40)throw CliErrors['validation'](_0x585a00(0xf7));return _0x51ac97;}export const roleCreate={'service':'role','command':a142_0x6719b2(0xfe),'description':'Create\x20a\x20CUSTOM\x20user\x20group\x20(role)','risk':'write','flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5be14a){readName(_0x5be14a);},async 'dryRun'(_0x59e785){const _0x3e98d1=a142_0x6719b2,_0x21cd40=readName(_0x59e785),_0x339489=_0x59e785[_0x3e98d1(0xf1)](_0x3e98d1(0xf9))[_0x3e98d1(0xff)]()||undefined;return asDryRunResult({'operation':_0x3e98d1(0xfe),'selector':{'appCode':_0x59e785[_0x3e98d1(0x102)],'roleName':_0x21cd40},'before':null,'after':{'roleName':_0x21cd40,'roleType':_0x3e98d1(0xf5),'remark':_0x339489},'dryRun':!![],'backend':{'method':_0x3e98d1(0xfa),'path':CREATE_PATH},'warnings':[]},{'method':_0x3e98d1(0xfa),'url':CREATE_PATH});},async 'execute'(_0x366cb4){const _0x410be9=a142_0x6719b2,_0x5d7f1b=readName(_0x366cb4),_0x33b31a=_0x366cb4[_0x410be9(0xf1)]('remark')[_0x410be9(0xff)]()||undefined,_0x3e5243=await createAppRole({'appCode':_0x366cb4[_0x410be9(0x102)],'roleName':_0x5d7f1b,..._0x33b31a?{'remark':_0x33b31a}:{}});return{'ok':!![],'data':{'operation':_0x410be9(0xfe),'selector':{'appCode':_0x366cb4[_0x410be9(0x102)],'roleId':_0x3e5243['id'],'roleName':_0x5d7f1b},'before':null,'after':projectRole(_0x3e5243),'dryRun':![],'backend':{'method':'POST','path':CREATE_PATH},'warnings':[]},'message':'Created\x20role\x20'+_0x3e5243['roleName']+'\x20(id='+_0x3e5243['id']+')'};}};
@@ -1 +1 @@
1
- const a143_0x257eb4=a143_0x45d2;(function(_0x4574f8,_0x2c5e2a){const _0x59e5de=a143_0x45d2,_0x478e44=_0x4574f8();while(!![]){try{const _0x41cbc9=-parseInt(_0x59e5de(0x99))/0x1+parseInt(_0x59e5de(0x95))/0x2*(-parseInt(_0x59e5de(0x94))/0x3)+-parseInt(_0x59e5de(0x9b))/0x4+-parseInt(_0x59e5de(0x8b))/0x5*(-parseInt(_0x59e5de(0xa0))/0x6)+-parseInt(_0x59e5de(0x96))/0x7+parseInt(_0x59e5de(0x90))/0x8*(parseInt(_0x59e5de(0x8a))/0x9)+parseInt(_0x59e5de(0x9c))/0xa*(parseInt(_0x59e5de(0x9e))/0xb);if(_0x41cbc9===_0x2c5e2a)break;else _0x478e44['push'](_0x478e44['shift']());}catch(_0x2cbc58){_0x478e44['push'](_0x478e44['shift']());}}}(a143_0x3d2a,0xbe041));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a143_0x45d2(_0x47c259,_0x5d0fbd){_0x47c259=_0x47c259-0x8a;const _0x3d2a0b=a143_0x3d2a();let _0x45d26e=_0x3d2a0b[_0x47c259];return _0x45d26e;}function a143_0x3d2a(){const _0x12c480=['593884NiMhyd','639345YfshhU','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','POST','1451633QXeOFr','num','5399284rMUCID','25957270gtDsqf','roleName','11ugXCZq','/smartapi/permit/role/delete','7573902omReIi','72999bVkvMf','5gdPyBI','high-risk-write','delete','Role\x20still\x20has\x20','Deleted\x20role\x20','1280gKeEjG','appCode','role','userCount','15BwwiTc'];a143_0x3d2a=function(){return _0x12c480;};return a143_0x3d2a();}const DELETE_PATH=a143_0x257eb4(0x9f);export const roleDelete={'service':a143_0x257eb4(0x92),'command':'delete','description':'Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','risk':a143_0x257eb4(0x8c),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x5c0e0a){const _0x333731=a143_0x257eb4,_0x4733c0=_0x5c0e0a[_0x333731(0x9a)]('id'),_0x36acff=await getRoleById(_0x5c0e0a['appCode'],_0x4733c0);return assertCustomRole(_0x36acff,_0x333731(0x8d)),asDryRunResult({'operation':_0x333731(0x8d),'selector':{'appCode':_0x5c0e0a[_0x333731(0x91)],'roleId':_0x4733c0,'roleName':_0x36acff[_0x333731(0x9d)]},'before':projectRole(_0x36acff),'after':null,'dryRun':!![],'backend':{'method':_0x333731(0x98),'path':DELETE_PATH},'warnings':_0x36acff[_0x333731(0x93)]>0x0?[_0x333731(0x8e)+_0x36acff[_0x333731(0x93)]+_0x333731(0x97)]:[]},{'method':_0x333731(0x98),'url':DELETE_PATH});},async 'execute'(_0x43c030){const _0x55d23a=a143_0x257eb4,_0x476fec=_0x43c030[_0x55d23a(0x9a)]('id'),_0x180abc=await getRoleById(_0x43c030[_0x55d23a(0x91)],_0x476fec);return assertCustomRole(_0x180abc,_0x55d23a(0x8d)),await deleteAppRole(_0x476fec),{'ok':!![],'data':{'operation':'delete','selector':{'appCode':_0x43c030['appCode'],'roleId':_0x476fec,'roleName':_0x180abc[_0x55d23a(0x9d)]},'before':projectRole(_0x180abc),'after':null,'dryRun':![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':[]},'message':_0x55d23a(0x8f)+_0x180abc[_0x55d23a(0x9d)]+'\x20(id='+_0x476fec+')'};}};
1
+ const a143_0x240ee5=a143_0x169c;(function(_0x490250,_0x1b81b0){const _0x430da1=a143_0x169c,_0x128aa9=_0x490250();while(!![]){try{const _0x27d850=-parseInt(_0x430da1(0x81))/0x1+-parseInt(_0x430da1(0x80))/0x2*(-parseInt(_0x430da1(0x76))/0x3)+parseInt(_0x430da1(0x82))/0x4*(-parseInt(_0x430da1(0x75))/0x5)+-parseInt(_0x430da1(0x85))/0x6*(-parseInt(_0x430da1(0x84))/0x7)+parseInt(_0x430da1(0x7e))/0x8*(parseInt(_0x430da1(0x86))/0x9)+parseInt(_0x430da1(0x7c))/0xa*(-parseInt(_0x430da1(0x79))/0xb)+parseInt(_0x430da1(0x83))/0xc*(parseInt(_0x430da1(0x74))/0xd);if(_0x27d850===_0x1b81b0)break;else _0x128aa9['push'](_0x128aa9['shift']());}catch(_0x3d0f62){_0x128aa9['push'](_0x128aa9['shift']());}}}(a143_0x7c35,0x6307e));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=a143_0x240ee5(0x7d);function a143_0x169c(_0x5605a9,_0x1881a7){_0x5605a9=_0x5605a9-0x71;const _0x7c3551=a143_0x7c35();let _0x169cb1=_0x7c3551[_0x5605a9];return _0x169cb1;}export const roleDelete={'service':'role','command':a143_0x240ee5(0x77),'description':a143_0x240ee5(0x7f),'risk':'high-risk-write','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x511d81){const _0x7cc642=a143_0x240ee5,_0x41d085=_0x511d81[_0x7cc642(0x72)]('id'),_0x693c61=await getRoleById(_0x511d81[_0x7cc642(0x71)],_0x41d085);return assertCustomRole(_0x693c61,_0x7cc642(0x77)),asDryRunResult({'operation':_0x7cc642(0x77),'selector':{'appCode':_0x511d81[_0x7cc642(0x71)],'roleId':_0x41d085,'roleName':_0x693c61[_0x7cc642(0x73)]},'before':projectRole(_0x693c61),'after':null,'dryRun':!![],'backend':{'method':_0x7cc642(0x78),'path':DELETE_PATH},'warnings':_0x693c61[_0x7cc642(0x88)]>0x0?[_0x7cc642(0x7a)+_0x693c61[_0x7cc642(0x88)]+_0x7cc642(0x87)]:[]},{'method':_0x7cc642(0x78),'url':DELETE_PATH});},async 'execute'(_0x25ea84){const _0x34c777=a143_0x240ee5,_0x378da6=_0x25ea84[_0x34c777(0x72)]('id'),_0x15a34a=await getRoleById(_0x25ea84[_0x34c777(0x71)],_0x378da6);return assertCustomRole(_0x15a34a,_0x34c777(0x77)),await deleteAppRole(_0x378da6),{'ok':!![],'data':{'operation':_0x34c777(0x77),'selector':{'appCode':_0x25ea84['appCode'],'roleId':_0x378da6,'roleName':_0x15a34a[_0x34c777(0x73)]},'before':projectRole(_0x15a34a),'after':null,'dryRun':![],'backend':{'method':_0x34c777(0x78),'path':DELETE_PATH},'warnings':[]},'message':'Deleted\x20role\x20'+_0x15a34a[_0x34c777(0x73)]+_0x34c777(0x7b)+_0x378da6+')'};}};function a143_0x7c35(){const _0x459f93=['26nMdikr','10oNtiJC','38466txrkmV','delete','POST','22PqoTVX','Role\x20still\x20has\x20','\x20(id=','115390fRUziA','/smartapi/permit/role/delete','24ZzTFKl','Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','2vUDfRQ','241326IuNmdK','1567788ObPsCi','6107244doiAYc','2618371QKdEtP','6QXaMAn','147537KYQzHX','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','userCount','appCode','num','roleName'];a143_0x7c35=function(){return _0x459f93;};return a143_0x7c35();}
@@ -1 +1 @@
1
- const a144_0x184d21=a144_0x442e;(function(_0xd815b0,_0x30d5bd){const _0x18f1a4=a144_0x442e,_0x426c92=_0xd815b0();while(!![]){try{const _0x3b6023=-parseInt(_0x18f1a4(0x188))/0x1+parseInt(_0x18f1a4(0x184))/0x2+-parseInt(_0x18f1a4(0x18e))/0x3*(-parseInt(_0x18f1a4(0x187))/0x4)+parseInt(_0x18f1a4(0x18f))/0x5+parseInt(_0x18f1a4(0x18a))/0x6*(-parseInt(_0x18f1a4(0x18d))/0x7)+-parseInt(_0x18f1a4(0x185))/0x8*(-parseInt(_0x18f1a4(0x191))/0x9)+-parseInt(_0x18f1a4(0x18b))/0xa;if(_0x3b6023===_0x30d5bd)break;else _0x426c92['push'](_0x426c92['shift']());}catch(_0x432fb1){_0x426c92['push'](_0x426c92['shift']());}}}(a144_0x3aab,0xac4c2));function a144_0x442e(_0x23ae7a,_0x4cdf48){_0x23ae7a=_0x23ae7a-0x183;const _0x3aabfd=a144_0x3aab();let _0x442e62=_0x3aabfd[_0x23ae7a];return _0x442e62;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a144_0x184d21(0x18c),'command':a144_0x184d21(0x186),'description':'Show\x20a\x20single\x20role\x27s\x20detail','risk':a144_0x184d21(0x189),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0xdecf9d){const _0xdc41e4=a144_0x184d21,_0x19b0a9=_0xdecf9d['num']('id'),_0x1e4505=await getRoleById(_0xdecf9d['appCode'],_0x19b0a9);return{'ok':!![],'data':{'role':projectRole(_0x1e4505)},'message':_0xdc41e4(0x183)+_0x1e4505[_0xdc41e4(0x190)]+'\x20('+_0x1e4505['roleType']+')'};}};function a144_0x3aab(){const _0x3663fb=['Role\x20','1148110JjlAeX','26952LOdEPj','detail','434904vNHeic','688317LrItYX','read','6alnNNE','5288330xAvItM','role','2350103TEkNja','6pVcpfG','5246730JFIIie','roleName','1116zTMqiN'];a144_0x3aab=function(){return _0x3663fb;};return a144_0x3aab();}
1
+ function a144_0x2d13(){const _0x3fe20e=['3741950uOTHuT','role','read','Show\x20a\x20single\x20role\x27s\x20detail','368ZerzbE','appCode','7150690SSKahe','765KnlEco','418168jGBYff','117108oXmoMA','1603582NEsksX','42ihybHe','3292xoqunD','63301KbRyit','roleName','Role\x20','detail'];a144_0x2d13=function(){return _0x3fe20e;};return a144_0x2d13();}const a144_0x2de43e=a144_0x65b6;(function(_0x4ee284,_0x50df65){const _0x1ec2c0=a144_0x65b6,_0x30b990=_0x4ee284();while(!![]){try{const _0x3204a1=parseInt(_0x1ec2c0(0x7f))/0x1+-parseInt(_0x1ec2c0(0x81))/0x2+parseInt(_0x1ec2c0(0x7e))/0x3*(parseInt(_0x1ec2c0(0x83))/0x4)+-parseInt(_0x1ec2c0(0x77))/0x5+parseInt(_0x1ec2c0(0x82))/0x6*(parseInt(_0x1ec2c0(0x84))/0x7)+-parseInt(_0x1ec2c0(0x7b))/0x8*(-parseInt(_0x1ec2c0(0x80))/0x9)+parseInt(_0x1ec2c0(0x7d))/0xa;if(_0x3204a1===_0x50df65)break;else _0x30b990['push'](_0x30b990['shift']());}catch(_0x4a62a5){_0x30b990['push'](_0x30b990['shift']());}}}(a144_0x2d13,0x6f076));function a144_0x65b6(_0xb8e2a,_0x121c0c){_0xb8e2a=_0xb8e2a-0x76;const _0x2d13c2=a144_0x2d13();let _0x65b615=_0x2d13c2[_0xb8e2a];return _0x65b615;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a144_0x2de43e(0x78),'command':a144_0x2de43e(0x76),'description':a144_0x2de43e(0x7a),'risk':a144_0x2de43e(0x79),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x518d57){const _0x1cde55=a144_0x2de43e,_0x6b92b=_0x518d57['num']('id'),_0xfe3ced=await getRoleById(_0x518d57[_0x1cde55(0x7c)],_0x6b92b);return{'ok':!![],'data':{'role':projectRole(_0xfe3ced)},'message':_0x1cde55(0x86)+_0xfe3ced[_0x1cde55(0x85)]+'\x20('+_0xfe3ced['roleType']+')'};}};
@@ -1 +1 @@
1
- (function(_0x3ae07c,_0x25d400){const _0xa83f75=a145_0x585d,_0x587e9b=_0x3ae07c();while(!![]){try{const _0x52adc7=-parseInt(_0xa83f75(0x1af))/0x1+-parseInt(_0xa83f75(0x1b1))/0x2+-parseInt(_0xa83f75(0x1b5))/0x3+-parseInt(_0xa83f75(0x1b6))/0x4+parseInt(_0xa83f75(0x1b2))/0x5*(-parseInt(_0xa83f75(0x1b7))/0x6)+-parseInt(_0xa83f75(0x1b0))/0x7*(-parseInt(_0xa83f75(0x1b4))/0x8)+parseInt(_0xa83f75(0x1b3))/0x9;if(_0x52adc7===_0x25d400)break;else _0x587e9b['push'](_0x587e9b['shift']());}catch(_0x3eac6d){_0x587e9b['push'](_0x587e9b['shift']());}}}(a145_0x9ec0,0xf2a94));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';function a145_0x585d(_0x2e7073,_0x49737d){_0x2e7073=_0x2e7073-0x1af;const _0x9ec0af=a145_0x9ec0();let _0x585dc3=_0x9ec0af[_0x2e7073];return _0x585dc3;}import{roleCreate}from'../../commands/role/create.js';function a145_0x9ec0(){const _0x37c67d=['42weZOQO','1693752tuqlnj','723335nxcNIt','35001441LYvPLW','2312976VpPIjw','405264eRpABf','5919484iltfGH','30tBCpog','1444671oqtQTx'];a145_0x9ec0=function(){return _0x37c67d;};return a145_0x9ec0();}import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
1
+ (function(_0x4e0fcf,_0x5d6771){const _0x412237=a145_0x2351,_0x7b7e41=_0x4e0fcf();while(!![]){try{const _0x24dbf3=-parseInt(_0x412237(0xfe))/0x1+-parseInt(_0x412237(0x100))/0x2+-parseInt(_0x412237(0xfb))/0x3+parseInt(_0x412237(0x102))/0x4*(-parseInt(_0x412237(0xff))/0x5)+-parseInt(_0x412237(0xfc))/0x6+-parseInt(_0x412237(0x103))/0x7*(parseInt(_0x412237(0x101))/0x8)+-parseInt(_0x412237(0xfd))/0x9*(-parseInt(_0x412237(0x104))/0xa);if(_0x24dbf3===_0x5d6771)break;else _0x7b7e41['push'](_0x7b7e41['shift']());}catch(_0x3de9ef){_0x7b7e41['push'](_0x7b7e41['shift']());}}}(a145_0xf6e1,0x2f7d7));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';function a145_0x2351(_0xe3e8c,_0x10588d){_0xe3e8c=_0xe3e8c-0xfb;const _0xf6e1f0=a145_0xf6e1();let _0x235145=_0xf6e1f0[_0xe3e8c];return _0x235145;}import{roleUserRemove}from'../../commands/role/user-remove.js';function a145_0xf6e1(){const _0x2d69c8=['360184lhhWPo','3928exChnC','96uBEOXE','3199ezkypJ','7175050fnBVqy','263025ThFeUE','605034fNTJoN','18gmahcZ','354074zkXhTj','61130sOXbvU'];a145_0xf6e1=function(){return _0x2d69c8;};return a145_0xf6e1();}export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
@@ -1 +1 @@
1
- const a146_0x334da7=a146_0x1629;function a146_0x4d88(){const _0x20efa9=['length','9108yThHjK','str','filter','string','1deIgBH','ADMIN','DEV','num','roleType','Use\x20one\x20of:\x20','819216RBDEnA','4741868nWsNcj','page','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','list','validation','Found\x20','number','trim','24OddCjl','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','Page\x20size\x20(1-100)','USER','includes','type','Filter\x20by\x20role\x20type','6rFiltb','CUSTOM','2297652diQtLw','\x20role(s)','Page\x20index\x20(1-based)','7410Pfhdbo','6981464GnRHLH','99Fnyzkc','5HwVLaE','393746GFjtYm','toUpperCase','appCode','Invalid\x20--type\x20\x22','12019384hJrYAi','pagesize'];a146_0x4d88=function(){return _0x20efa9;};return a146_0x4d88();}function a146_0x1629(_0x2ab815,_0x2d681a){_0x2ab815=_0x2ab815-0x116;const _0x4d887a=a146_0x4d88();let _0x162956=_0x4d887a[_0x2ab815];return _0x162956;}(function(_0xff88b1,_0x5435fc){const _0x354fab=a146_0x1629,_0x5c6c90=_0xff88b1();while(!![]){try{const _0x471d68=parseInt(_0x354fab(0x137))/0x1*(-parseInt(_0x354fab(0x12c))/0x2)+parseInt(_0x354fab(0x125))/0x3+parseInt(_0x354fab(0x13e))/0x4*(parseInt(_0x354fab(0x12b))/0x5)+-parseInt(_0x354fab(0x123))/0x6*(parseInt(_0x354fab(0x129))/0x7)+-parseInt(_0x354fab(0x13d))/0x8*(parseInt(_0x354fab(0x12a))/0x9)+parseInt(_0x354fab(0x128))/0xa*(-parseInt(_0x354fab(0x133))/0xb)+-parseInt(_0x354fab(0x11c))/0xc*(-parseInt(_0x354fab(0x130))/0xd);if(_0x471d68===_0x5435fc)break;else _0x5c6c90['push'](_0x5c6c90['shift']());}catch(_0x1696a5){_0x5c6c90['push'](_0x5c6c90['shift']());}}}(a146_0x4d88,0xd37f4));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a146_0x334da7(0x138),a146_0x334da7(0x139),a146_0x334da7(0x11f),a146_0x334da7(0x124)];export const roleList={'service':'role','command':a146_0x334da7(0x117),'description':a146_0x334da7(0x116),'risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':a146_0x334da7(0x121),'type':a146_0x334da7(0x136),'required':![],'description':a146_0x334da7(0x122),'enum':ROLE_TYPES},{'name':a146_0x334da7(0x13f),'type':a146_0x334da7(0x11a),'description':a146_0x334da7(0x127),'default':0x1},{'name':a146_0x334da7(0x131),'type':'number','description':a146_0x334da7(0x11e),'default':0x64}],async 'validate'(_0x586d51){const _0x29b997=a146_0x334da7,_0x493451=_0x586d51[_0x29b997(0x134)]('type')['trim']();if(_0x493451&&!ROLE_TYPES[_0x29b997(0x120)](_0x493451[_0x29b997(0x12d)]()))throw CliErrors['validation'](_0x29b997(0x12f)+_0x493451+'\x22.',_0x29b997(0x13c)+ROLE_TYPES['join'](',\x20')+'.');const _0xa273f0=_0x586d51[_0x29b997(0x13a)](_0x29b997(0x13f),0x1),_0x376365=_0x586d51[_0x29b997(0x13a)](_0x29b997(0x131),0x64);if(_0xa273f0<0x1)throw CliErrors[_0x29b997(0x118)](_0x29b997(0x11d));if(_0x376365<0x1||_0x376365>0x64)throw CliErrors['validation']('--pagesize\x20must\x20be\x20between\x201\x20and\x20100.');},async 'execute'(_0x4a717e){const _0x4ab4f9=a146_0x334da7,_0x373ab1=_0x4a717e[_0x4ab4f9(0x13a)](_0x4ab4f9(0x13f),0x1)||0x1,_0x2ccabc=_0x4a717e[_0x4ab4f9(0x13a)]('pagesize',0x64)||0x64,_0x2f9bed=_0x4a717e[_0x4ab4f9(0x134)](_0x4ab4f9(0x121))[_0x4ab4f9(0x11b)]()[_0x4ab4f9(0x12d)](),{items:_0xfac244,paging:_0x301197}=await listAppRoles(_0x4a717e[_0x4ab4f9(0x12e)],{'currentPage':_0x373ab1,'pageSize':_0x2ccabc}),_0x36e192=_0x2f9bed?_0xfac244[_0x4ab4f9(0x135)](_0x165b92=>_0x165b92[_0x4ab4f9(0x13b)]===_0x2f9bed):_0xfac244,_0x5042d7=_0x36e192['map'](projectRole);return{'ok':!![],'data':{'roles':_0x5042d7,'paging':_0x301197},'message':_0x4ab4f9(0x119)+_0x5042d7[_0x4ab4f9(0x132)]+_0x4ab4f9(0x126)};}};
1
+ const a146_0x4ea971=a146_0x1205;(function(_0x2571c6,_0x944dbe){const _0x492d6d=a146_0x1205,_0xc76e24=_0x2571c6();while(!![]){try{const _0x49e070=-parseInt(_0x492d6d(0x9c))/0x1+-parseInt(_0x492d6d(0x9d))/0x2+-parseInt(_0x492d6d(0x99))/0x3*(parseInt(_0x492d6d(0xb4))/0x4)+-parseInt(_0x492d6d(0xa4))/0x5*(parseInt(_0x492d6d(0xb0))/0x6)+parseInt(_0x492d6d(0xa9))/0x7*(parseInt(_0x492d6d(0x96))/0x8)+-parseInt(_0x492d6d(0xb8))/0x9*(parseInt(_0x492d6d(0x9e))/0xa)+-parseInt(_0x492d6d(0xba))/0xb*(-parseInt(_0x492d6d(0xb7))/0xc);if(_0x49e070===_0x944dbe)break;else _0xc76e24['push'](_0xc76e24['shift']());}catch(_0x1265ee){_0xc76e24['push'](_0xc76e24['shift']());}}}(a146_0x12d3,0x1c93d));function a146_0x1205(_0x9474d8,_0x5c1cd5){_0x9474d8=_0x9474d8-0x95;const _0x12d369=a146_0x12d3();let _0x12058f=_0x12d369[_0x9474d8];return _0x12058f;}import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=['ADMIN',a146_0x4ea971(0x9a),a146_0x4ea971(0xb2),'CUSTOM'];function a146_0x12d3(){const _0x47bcd8=['string','read','type','pagesize','Page\x20size\x20(1-100)','738bYuQgI','toUpperCase','USER','Page\x20index\x20(1-based)','50972cZsAHR','page','length','60AOidyA','1764315KEzAsp','includes','1224795ruTrRY','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','1562984JLRpcN','validation','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','3vGUUHf','DEV','map','225237VCgbqf','49788QzPxwl','10USKiDO','number','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','Use\x20one\x20of:\x20','str','num','7160iZrsaM','Found\x20','list','join','Filter\x20by\x20role\x20type','7GVCSdM','filter'];a146_0x12d3=function(){return _0x47bcd8;};return a146_0x12d3();}export const roleList={'service':'role','command':a146_0x4ea971(0xa6),'description':a146_0x4ea971(0x95),'risk':a146_0x4ea971(0xac),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a146_0x4ea971(0xad),'type':a146_0x4ea971(0xab),'required':![],'description':a146_0x4ea971(0xa8),'enum':ROLE_TYPES},{'name':a146_0x4ea971(0xb5),'type':a146_0x4ea971(0x9f),'description':a146_0x4ea971(0xb3),'default':0x1},{'name':a146_0x4ea971(0xae),'type':'number','description':a146_0x4ea971(0xaf),'default':0x64}],async 'validate'(_0x3860e6){const _0x43984f=a146_0x4ea971,_0x9df034=_0x3860e6['str'](_0x43984f(0xad))['trim']();if(_0x9df034&&!ROLE_TYPES[_0x43984f(0xb9)](_0x9df034[_0x43984f(0xb1)]()))throw CliErrors[_0x43984f(0x97)]('Invalid\x20--type\x20\x22'+_0x9df034+'\x22.',_0x43984f(0xa1)+ROLE_TYPES[_0x43984f(0xa7)](',\x20')+'.');const _0x126df6=_0x3860e6[_0x43984f(0xa3)]('page',0x1),_0x4eeb8c=_0x3860e6[_0x43984f(0xa3)](_0x43984f(0xae),0x64);if(_0x126df6<0x1)throw CliErrors['validation'](_0x43984f(0x98));if(_0x4eeb8c<0x1||_0x4eeb8c>0x64)throw CliErrors[_0x43984f(0x97)](_0x43984f(0xa0));},async 'execute'(_0x2559dc){const _0x311cf5=a146_0x4ea971,_0x4fee93=_0x2559dc[_0x311cf5(0xa3)](_0x311cf5(0xb5),0x1)||0x1,_0xb51469=_0x2559dc['num']('pagesize',0x64)||0x64,_0x529283=_0x2559dc[_0x311cf5(0xa2)](_0x311cf5(0xad))['trim']()[_0x311cf5(0xb1)](),{items:_0x3a2973,paging:_0x40f2a8}=await listAppRoles(_0x2559dc['appCode'],{'currentPage':_0x4fee93,'pageSize':_0xb51469}),_0x5b656d=_0x529283?_0x3a2973[_0x311cf5(0xaa)](_0x5e7a5a=>_0x5e7a5a['roleType']===_0x529283):_0x3a2973,_0x5473ce=_0x5b656d[_0x311cf5(0x9b)](projectRole);return{'ok':!![],'data':{'roles':_0x5473ce,'paging':_0x40f2a8},'message':_0x311cf5(0xa5)+_0x5473ce[_0x311cf5(0xb6)]+'\x20role(s)'};}};
@@ -1 +1 @@
1
- const a147_0x3dfbef=a147_0x2231;(function(_0x5e229d,_0x30cfbb){const _0xdf0420=a147_0x2231,_0x3f2e64=_0x5e229d();while(!![]){try{const _0x243605=parseInt(_0xdf0420(0x21d))/0x1+parseInt(_0xdf0420(0x225))/0x2*(parseInt(_0xdf0420(0x204))/0x3)+parseInt(_0xdf0420(0x222))/0x4*(parseInt(_0xdf0420(0x20a))/0x5)+-parseInt(_0xdf0420(0x21e))/0x6+-parseInt(_0xdf0420(0x1f8))/0x7+-parseInt(_0xdf0420(0x1fa))/0x8+parseInt(_0xdf0420(0x216))/0x9;if(_0x243605===_0x30cfbb)break;else _0x3f2e64['push'](_0x3f2e64['shift']());}catch(_0x2bacf3){_0x3f2e64['push'](_0x3f2e64['shift']());}}}(a147_0x2e0b,0x51782));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a147_0x3dfbef(0x1fb),'required':!![],'description':a147_0x3dfbef(0x211)};export const ROLE_REF_FLAG={'name':a147_0x3dfbef(0x1fc),'type':a147_0x3dfbef(0x202),'required':!![],'description':'Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)'};export const USER_REF_FLAG={'name':a147_0x3dfbef(0x1de),'type':a147_0x3dfbef(0x202),'required':!![],'description':a147_0x3dfbef(0x1f3)};export const NAME_FLAG={'name':a147_0x3dfbef(0x210),'type':'string','required':!![],'description':a147_0x3dfbef(0x229)};export const USER_NAME_FLAG={'name':a147_0x3dfbef(0x210),'type':'string','required':!![],'description':a147_0x3dfbef(0x207)};function a147_0x2231(_0x17a248,_0x520abc){_0x17a248=_0x17a248-0x1de;const _0x2e0b76=a147_0x2e0b();let _0x223185=_0x2e0b76[_0x17a248];return _0x223185;}export const REMARK_FLAG={'name':'remark','type':a147_0x3dfbef(0x202),'required':![],'description':a147_0x3dfbef(0x21c)};export const EXPECT_USER_COUNT_FLAG={'name':a147_0x3dfbef(0x217),'type':a147_0x3dfbef(0x1fb),'required':![],'description':a147_0x3dfbef(0x1e3)};export const BUILTIN_ROLE_TYPES=[a147_0x3dfbef(0x201),a147_0x3dfbef(0x20d),a147_0x3dfbef(0x1e1)];export function isBuiltinRole(_0x21d3b9){const _0x53e0df=a147_0x3dfbef;return BUILTIN_ROLE_TYPES[_0x53e0df(0x21a)](_0x21d3b9);}export function assertCustomRole(_0x368988,_0x3e3bd9){const _0x2400e6=a147_0x3dfbef;if(_0x368988[_0x2400e6(0x1fd)]!==_0x2400e6(0x1ec))throw CliErrors['validation'](_0x2400e6(0x226)+_0x3e3bd9+_0x2400e6(0x1e6)+_0x368988[_0x2400e6(0x20f)]+'\x20('+_0x368988['roleType']+').',_0x2400e6(0x212));}export function assertPermConfigurable(_0x4ad6f8){const _0x6833d7=a147_0x3dfbef;if(_0x4ad6f8[_0x6833d7(0x1fd)]==='DEV'||_0x4ad6f8['roleType']===_0x6833d7(0x201))throw CliErrors[_0x6833d7(0x1ee)]('Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20'+_0x4ad6f8['roleName']+'\x20('+_0x4ad6f8['roleType']+').',_0x6833d7(0x1ea));}export function projectRole(_0x4ec584){const _0x5e246f=a147_0x3dfbef;return{'id':_0x4ec584['id'],'roleName':_0x4ec584[_0x5e246f(0x20f)],'roleType':_0x4ec584[_0x5e246f(0x1fd)],'remark':_0x4ec584[_0x5e246f(0x20b)],'userCount':_0x4ec584['userCount'],'permitCount':_0x4ec584[_0x5e246f(0x1df)],'builtin':isBuiltinRole(_0x4ec584[_0x5e246f(0x1fd)])};}export async function resolveRoleRef(_0x494bb0,_0x1cdaf4){const _0x553669=a147_0x3dfbef,_0x485cb8=_0x1cdaf4[_0x553669(0x215)]();if(!_0x485cb8)throw CliErrors[_0x553669(0x1ee)](_0x553669(0x1e8),_0x553669(0x220));if(/^\d+$/[_0x553669(0x223)](_0x485cb8))return getRoleById(_0x494bb0,Number(_0x485cb8));const _0x316b88=await listAllAppRoles(_0x494bb0),_0x4477e9=_0x316b88['filter'](_0x1abc02=>_0x1abc02['roleName']===_0x485cb8);if(_0x4477e9[_0x553669(0x21f)]===0x0)throw CliErrors[_0x553669(0x1ee)]('Role\x20name\x20\x22'+_0x485cb8+_0x553669(0x1e7)+_0x494bb0+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.');if(_0x4477e9[_0x553669(0x21f)]>0x1){const _0x23b8f6=_0x4477e9[_0x553669(0x1ef)](_0x539e7a=>_0x539e7a['id'])['join'](',\x20');throw CliErrors['validation']('Role\x20name\x20\x22'+_0x485cb8+_0x553669(0x214)+_0x23b8f6+').',_0x553669(0x227));}return _0x4477e9[0x0];}function a147_0x2e0b(){const _0x14bdc5=['authRequired','push','\x20built-in\x20role\x20','\x22\x20not\x20found\x20in\x20app\x20','Missing\x20role\x20reference.','Anti-drift\x20check\x20failed:\x20expected\x20','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','flag','CUSTOM','Pass\x20--user\x20<id|name>.','validation','map','totalCount','\x20is\x20not\x20a\x20member\x20of\x20role\x20','username','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','filter','findIndex','dryRun','flagMissing','2604609jKdyHC','toLowerCase','4800912bMeuiy','number','role','roleType','userList','\x20is\x20already\x20a\x20member\x20of\x20role\x20','find','ADMIN','string','nickname','39idIrFD','POST',';\x20no\x20change.','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','Disambiguate\x20with\x20--user\x20<id>.','appCode','800050kNQJgp','remark','\x20member(s)\x20but\x20role\x20has\x20','DEV','Role\x20id\x20','roleName','name','Role\x20id\x20(from\x20`role\x20list`)','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','join','\x22\x20is\x20ambiguous\x20(ids:\x20','trim','5693589XkDUVs','expect-user-count','expectUserCount','tenant_code','includes','\x20not\x20found\x20in\x20app\x20','Optional\x20role\x20remark/description','661419hBelcv','1802988fnPSUo','length','Pass\x20--role\x20<id|name>.','str','4HsXAKh','test','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','23438jFoJqG','Cannot\x20','Disambiguate\x20with\x20--role\x20<id>.','No\x20tenant\x20member\x20matches\x20\x22','Role\x20name','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','userId','user','permitCount','Multiple\x20tenant\x20members\x20match\x20\x22','USER','\x20not\x20found\x20in\x20the\x20user-role\x20list.','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs'];a147_0x2e0b=function(){return _0x14bdc5;};return a147_0x2e0b();}export async function getRoleById(_0x463ec9,_0x326628){const _0x5e4731=a147_0x3dfbef,_0x51d14f=await getAppRole(_0x326628);if(!_0x51d14f)throw CliErrors['validation'](_0x5e4731(0x20e)+_0x326628+_0x5e4731(0x21b)+_0x463ec9+'.',_0x5e4731(0x224));return _0x51d14f;}async function listAllAppRoles(_0x57cc42){const _0x506078=a147_0x3dfbef,_0x4ef83d=0x64,_0x121877=[];for(let _0x5c1952=0x1;;_0x5c1952+=0x1){const {items:_0x45bb10,paging:_0x301976}=await listAppRoles(_0x57cc42,{'currentPage':_0x5c1952,'pageSize':_0x4ef83d});_0x121877[_0x506078(0x1e5)](..._0x45bb10);if(_0x45bb10[_0x506078(0x21f)]<_0x4ef83d||_0x301976&&_0x121877['length']>=_0x301976[_0x506078(0x1f0)])return _0x121877;}}export async function resolveTenantCode(){const _0x5abf1c=a147_0x3dfbef,_0x40b23d=await getSessionUserInfo(),_0x58816e=_0x40b23d?.['user']?.['tenant']?.[_0x5abf1c(0x219)];if(!_0x58816e)throw CliErrors[_0x5abf1c(0x1e4)](_0x5abf1c(0x22b));return _0x58816e;}function matchMember(_0x994389,_0x101cff){const _0x40dfcc=a147_0x3dfbef,_0x56af7a=_0x101cff[_0x40dfcc(0x215)]()[_0x40dfcc(0x1f9)]();return(_0x994389[_0x40dfcc(0x203)]??'')[_0x40dfcc(0x1f9)]()===_0x56af7a||(_0x994389[_0x40dfcc(0x1f2)]??'')['toLowerCase']()===_0x56af7a;}export async function resolveUserRef(_0x2da609){const _0x4e246b=a147_0x3dfbef,_0x364554=_0x2da609[_0x4e246b(0x215)]();if(!_0x364554)throw CliErrors['validation']('Missing\x20user\x20reference.','Pass\x20--user\x20<id|name>.');const _0x155b21=await resolveTenantCode(),_0x1f35ba=await getTenantMembers(_0x155b21);if(/^\d+$/[_0x4e246b(0x223)](_0x364554)){const _0x4df940=Number(_0x364554),_0x4815b4=_0x1f35ba[_0x4e246b(0x200)](_0x37be3e=>_0x37be3e['userId']===_0x4df940);return{'userId':_0x4df940,'username':_0x4815b4?.[_0x4e246b(0x1f2)]??String(_0x4df940),'nickname':_0x4815b4?.[_0x4e246b(0x203)],'matchedBy':'id'};}const _0x54171e=_0x1f35ba[_0x4e246b(0x1f4)](_0x2aba05=>matchMember(_0x2aba05,_0x364554));if(_0x54171e[_0x4e246b(0x21f)]===0x0)throw CliErrors[_0x4e246b(0x1ee)](_0x4e246b(0x228)+_0x364554+'\x22.',_0x4e246b(0x22a));if(_0x54171e[_0x4e246b(0x21f)]>0x1){const _0x3612d4=_0x54171e[_0x4e246b(0x1ef)](_0x14eabc=>(_0x14eabc['nickname']??_0x14eabc[_0x4e246b(0x1f2)]??'?')+'('+_0x14eabc[_0x4e246b(0x22c)]+')')[_0x4e246b(0x213)](',\x20');throw CliErrors[_0x4e246b(0x1ee)](_0x4e246b(0x1e0)+_0x364554+'\x22:\x20'+_0x3612d4+'.',_0x4e246b(0x208));}const _0x4db788=_0x54171e[0x0];return{'userId':_0x4db788[_0x4e246b(0x22c)],'username':_0x4db788['username']??String(_0x4db788[_0x4e246b(0x22c)]),'nickname':_0x4db788['nickname'],'matchedBy':_0x4e246b(0x210)};}export const UPDATE_USER_LIST_PATH='/smartapi/permit/user-role/update-user-list';function userIdsOf(_0x17ddd0){const _0x4381a0=a147_0x3dfbef;return(_0x17ddd0?.[_0x4381a0(0x1fe)]??[])[_0x4381a0(0x1ef)](_0x1fe409=>_0x1fe409[_0x4381a0(0x22c)]);}export function computeRoleUserMutation(_0x7363ab){const _0x238233=a147_0x3dfbef,{operation:_0x3ca898,appCode:_0x3c216a,roleUsers:_0x34ab44,targetRoleId:_0x49f436,user:_0x5dee96}=_0x7363ab,_0x1f3d34=_0x34ab44[_0x238233(0x200)](_0x14af23=>_0x14af23['id']===_0x49f436);if(!_0x1f3d34)throw CliErrors[_0x238233(0x1ee)](_0x238233(0x20e)+_0x49f436+_0x238233(0x1e2),_0x238233(0x224));const _0xfedc34=userIdsOf(_0x1f3d34),_0x488421=[];if(_0x7363ab[_0x238233(0x218)]!==undefined&&_0x7363ab[_0x238233(0x218)]!==_0xfedc34[_0x238233(0x21f)])throw CliErrors[_0x238233(0x1ee)](_0x238233(0x1e9)+_0x7363ab[_0x238233(0x218)]+_0x238233(0x20c)+_0xfedc34[_0x238233(0x21f)]+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x728cfa=_0xfedc34[_0x238233(0x21a)](_0x5dee96[_0x238233(0x22c)]);let _0x52c56a=![];const _0x3b310c=[..._0x1f3d34[_0x238233(0x1fe)]];if(_0x3ca898==='user-add')_0x728cfa?_0x488421[_0x238233(0x1e5)]('User\x20'+_0x5dee96[_0x238233(0x22c)]+_0x238233(0x1ff)+_0x1f3d34['roleName']+_0x238233(0x206)):(_0x3b310c[_0x238233(0x1e5)]({'userId':_0x5dee96[_0x238233(0x22c)],'username':_0x5dee96[_0x238233(0x1f2)],..._0x5dee96['nickname']?{'nickname':_0x5dee96[_0x238233(0x203)]}:{}}),_0x52c56a=!![]);else{if(!_0x728cfa)_0x488421[_0x238233(0x1e5)]('User\x20'+_0x5dee96['userId']+_0x238233(0x1f1)+_0x1f3d34[_0x238233(0x20f)]+';\x20no\x20change.');else{const _0x4742a1=_0x3b310c[_0x238233(0x1f5)](_0x570dca=>_0x570dca[_0x238233(0x22c)]===_0x5dee96[_0x238233(0x22c)]);if(_0x4742a1>=0x0)_0x3b310c['splice'](_0x4742a1,0x1);_0x52c56a=!![];}}const _0x25328b=_0x34ab44[_0x238233(0x1ef)](_0x5c415b=>_0x5c415b['id']===_0x49f436?{..._0x5c415b,'userList':_0x3b310c}:_0x5c415b),_0x4dc636=_0x3b310c['map'](_0x4240a9=>_0x4240a9[_0x238233(0x22c)]),_0x439f89={'operation':_0x3ca898,'selector':{'appCode':_0x3c216a,'roleId':_0x49f436,'roleName':_0x1f3d34[_0x238233(0x20f)],'userId':_0x5dee96[_0x238233(0x22c)]},'before':{'userIds':_0xfedc34},'after':{'userIds':_0x4dc636},'dryRun':_0x7363ab[_0x238233(0x1f6)],'backend':{'method':_0x238233(0x205),'path':UPDATE_USER_LIST_PATH},'warnings':_0x488421};return{'roleList':_0x25328b,'mutation':_0x439f89,'changed':_0x52c56a};}export async function loadRoleUsers(_0x2e6a4d){return listRoleUsers(_0x2e6a4d);}export function readRoleRef(_0x19c67c){const _0x91d6d1=a147_0x3dfbef,_0x67328d=_0x19c67c[_0x91d6d1(0x221)](_0x91d6d1(0x1fc))['trim']();if(!_0x67328d)throw CliErrors[_0x91d6d1(0x1f7)](_0x91d6d1(0x1fc),_0x91d6d1(0x220));return _0x67328d;}export async function prepareUserMutation(_0x2a5cda,_0x4a2fc8,_0x18a656){const _0x4c2b40=a147_0x3dfbef,_0x5eb463=readRoleRef(_0x2a5cda),_0x19136f=_0x2a5cda[_0x4c2b40(0x221)](_0x4c2b40(0x1de))[_0x4c2b40(0x215)]();if(!_0x19136f)throw CliErrors['flagMissing']('user',_0x4c2b40(0x1ed));const _0x442753=_0x2a5cda[_0x4c2b40(0x1eb)](_0x4c2b40(0x217)),_0x1a8d40=_0x442753===undefined||_0x442753===null?undefined:Number(_0x442753),_0x3a49e4=await resolveRoleRef(_0x2a5cda[_0x4c2b40(0x209)],_0x5eb463),_0x50ecb4=await resolveUserRef(_0x19136f),_0x13e367=await loadRoleUsers(_0x2a5cda[_0x4c2b40(0x209)]);return computeRoleUserMutation({'operation':_0x4a2fc8,'appCode':_0x2a5cda['appCode'],'roleUsers':_0x13e367,'targetRoleId':_0x3a49e4['id'],'user':{'userId':_0x50ecb4[_0x4c2b40(0x22c)],'username':_0x50ecb4[_0x4c2b40(0x1f2)],'nickname':_0x50ecb4[_0x4c2b40(0x203)]},'dryRun':_0x18a656,..._0x1a8d40!==undefined?{'expectUserCount':_0x1a8d40}:{}});}
1
+ const a147_0x37981f=a147_0x99de;(function(_0x4472ae,_0x179a16){const _0x37c757=a147_0x99de,_0x271bdb=_0x4472ae();while(!![]){try{const _0x240c56=-parseInt(_0x37c757(0x1d4))/0x1+-parseInt(_0x37c757(0x1c2))/0x2*(-parseInt(_0x37c757(0x204))/0x3)+parseInt(_0x37c757(0x1d6))/0x4*(-parseInt(_0x37c757(0x1d2))/0x5)+parseInt(_0x37c757(0x201))/0x6+-parseInt(_0x37c757(0x205))/0x7*(parseInt(_0x37c757(0x1c7))/0x8)+-parseInt(_0x37c757(0x1c4))/0x9*(parseInt(_0x37c757(0x1dc))/0xa)+-parseInt(_0x37c757(0x1d1))/0xb*(-parseInt(_0x37c757(0x1c9))/0xc);if(_0x240c56===_0x179a16)break;else _0x271bdb['push'](_0x271bdb['shift']());}catch(_0x3946ee){_0x271bdb['push'](_0x271bdb['shift']());}}}(a147_0x4afe,0x4e662));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';function a147_0x4afe(){const _0x1f8a69=['697980TdKVDX','join','expectUserCount','User\x20','Role\x20id\x20','dryRun','test','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','286rPhoHz','39135ObKRDd','user-add','328685dyVlvS','findIndex','200pLcrKy','nickname','userCount','appCode','length','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','12910fGvBHg','user','push','POST','\x22\x20not\x20found\x20in\x20app\x20','\x20is\x20already\x20a\x20member\x20of\x20role\x20','includes','\x20member(s)\x20but\x20role\x20has\x20','toLowerCase','role','map','userId','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','flag','filter','trim','totalCount','Missing\x20role\x20reference.','str',';\x20no\x20change.','splice','\x20not\x20found\x20in\x20app\x20','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','Missing\x20user\x20reference.','Role\x20name\x20\x22','expect-user-count','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','\x20not\x20found\x20in\x20the\x20user-role\x20list.','tenant_code','Anti-drift\x20check\x20failed:\x20expected\x20','DEV','userList','/smartapi/permit/user-role/update-user-list','\x20is\x20not\x20a\x20member\x20of\x20role\x20','Pass\x20--user\x20<id|name>.','find','137580wRJCsx','validation','\x22\x20is\x20ambiguous\x20(ids:\x20','2109MgfsDk','21UTJEyG','ADMIN','Role\x20name','flagMissing','name','Pass\x20--role\x20<id|name>.','roleType','string','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','roleName','tenant','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','authRequired','Role\x20id\x20(from\x20`role\x20list`)','username','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','Disambiguate\x20with\x20--role\x20<id>.','502YkLuzh','permitCount','1035CORsHd','remark','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','1392136KkzavU','number'];a147_0x4afe=function(){return _0x1f8a69;};return a147_0x4afe();}export const ROLE_ID_FLAG={'name':'id','type':a147_0x37981f(0x1c8),'required':!![],'description':a147_0x37981f(0x1be)};export const ROLE_REF_FLAG={'name':'role','type':a147_0x37981f(0x1b8),'required':!![],'description':a147_0x37981f(0x1db)};export const USER_REF_FLAG={'name':a147_0x37981f(0x1dd),'type':a147_0x37981f(0x1b8),'required':!![],'description':a147_0x37981f(0x1f7)};export const NAME_FLAG={'name':a147_0x37981f(0x209),'type':a147_0x37981f(0x1b8),'required':!![],'description':a147_0x37981f(0x207)};export const USER_NAME_FLAG={'name':a147_0x37981f(0x209),'type':a147_0x37981f(0x1b8),'required':!![],'description':a147_0x37981f(0x1d0)};export const REMARK_FLAG={'name':a147_0x37981f(0x1c5),'type':'string','required':![],'description':'Optional\x20role\x20remark/description'};export const EXPECT_USER_COUNT_FLAG={'name':a147_0x37981f(0x1f5),'type':a147_0x37981f(0x1c8),'required':![],'description':a147_0x37981f(0x1b9)};export const BUILTIN_ROLE_TYPES=[a147_0x37981f(0x206),a147_0x37981f(0x1fb),'USER'];export function isBuiltinRole(_0x1d2f63){const _0x3f585f=a147_0x37981f;return BUILTIN_ROLE_TYPES[_0x3f585f(0x1e2)](_0x1d2f63);}export function assertCustomRole(_0xaf57ed,_0xd24bf8){const _0x2c97d4=a147_0x37981f;if(_0xaf57ed['roleType']!=='CUSTOM')throw CliErrors['validation']('Cannot\x20'+_0xd24bf8+'\x20built-in\x20role\x20'+_0xaf57ed['roleName']+'\x20('+_0xaf57ed[_0x2c97d4(0x1b7)]+').','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.');}export function assertPermConfigurable(_0xe15f59){const _0x11ad4e=a147_0x37981f;if(_0xe15f59[_0x11ad4e(0x1b7)]===_0x11ad4e(0x1fb)||_0xe15f59['roleType']===_0x11ad4e(0x206))throw CliErrors[_0x11ad4e(0x202)]('Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20'+_0xe15f59['roleName']+'\x20('+_0xe15f59[_0x11ad4e(0x1b7)]+').',_0x11ad4e(0x1f2));}export function projectRole(_0x218efb){const _0x2e8acc=a147_0x37981f;return{'id':_0x218efb['id'],'roleName':_0x218efb[_0x2e8acc(0x1ba)],'roleType':_0x218efb[_0x2e8acc(0x1b7)],'remark':_0x218efb['remark'],'userCount':_0x218efb[_0x2e8acc(0x1d8)],'permitCount':_0x218efb[_0x2e8acc(0x1c3)],'builtin':isBuiltinRole(_0x218efb[_0x2e8acc(0x1b7)])};}export async function resolveRoleRef(_0xca6d62,_0x4fbfe2){const _0x4173b7=a147_0x37981f,_0x57d187=_0x4fbfe2[_0x4173b7(0x1eb)]();if(!_0x57d187)throw CliErrors[_0x4173b7(0x202)](_0x4173b7(0x1ed),_0x4173b7(0x1b6));if(/^\d+$/[_0x4173b7(0x1cf)](_0x57d187))return getRoleById(_0xca6d62,Number(_0x57d187));const _0x323692=await listAllAppRoles(_0xca6d62),_0x49d5cc=_0x323692[_0x4173b7(0x1ea)](_0x462573=>_0x462573[_0x4173b7(0x1ba)]===_0x57d187);if(_0x49d5cc[_0x4173b7(0x1da)]===0x0)throw CliErrors[_0x4173b7(0x202)]('Role\x20name\x20\x22'+_0x57d187+_0x4173b7(0x1e0)+_0xca6d62+'.',_0x4173b7(0x1c0));if(_0x49d5cc[_0x4173b7(0x1da)]>0x1){const _0x390a03=_0x49d5cc[_0x4173b7(0x1e6)](_0x1c936f=>_0x1c936f['id'])[_0x4173b7(0x1ca)](',\x20');throw CliErrors[_0x4173b7(0x202)](_0x4173b7(0x1f4)+_0x57d187+_0x4173b7(0x203)+_0x390a03+').',_0x4173b7(0x1c1));}return _0x49d5cc[0x0];}export async function getRoleById(_0x36f113,_0x2da52d){const _0x57d505=a147_0x37981f,_0x5cc8fc=await getAppRole(_0x2da52d);if(!_0x5cc8fc)throw CliErrors[_0x57d505(0x202)](_0x57d505(0x1cd)+_0x2da52d+_0x57d505(0x1f1)+_0x36f113+'.',_0x57d505(0x1c6));return _0x5cc8fc;}async function listAllAppRoles(_0x240a3d){const _0x5bc8b6=a147_0x37981f,_0x186f0d=0x64,_0x5d8a9f=[];for(let _0x142ee2=0x1;;_0x142ee2+=0x1){const {items:_0x26d469,paging:_0x54b6fe}=await listAppRoles(_0x240a3d,{'currentPage':_0x142ee2,'pageSize':_0x186f0d});_0x5d8a9f[_0x5bc8b6(0x1de)](..._0x26d469);if(_0x26d469[_0x5bc8b6(0x1da)]<_0x186f0d||_0x54b6fe&&_0x5d8a9f[_0x5bc8b6(0x1da)]>=_0x54b6fe[_0x5bc8b6(0x1ec)])return _0x5d8a9f;}}export async function resolveTenantCode(){const _0x1a1df8=a147_0x37981f,_0x1fda9a=await getSessionUserInfo(),_0x233662=_0x1fda9a?.['user']?.[_0x1a1df8(0x1bb)]?.[_0x1a1df8(0x1f9)];if(!_0x233662)throw CliErrors[_0x1a1df8(0x1bd)](_0x1a1df8(0x1e8));return _0x233662;}function matchMember(_0x339c60,_0x2fa31c){const _0x2fa8a6=a147_0x37981f,_0x50ac26=_0x2fa31c[_0x2fa8a6(0x1eb)]()['toLowerCase']();return(_0x339c60[_0x2fa8a6(0x1d7)]??'')[_0x2fa8a6(0x1e4)]()===_0x50ac26||(_0x339c60[_0x2fa8a6(0x1bf)]??'')[_0x2fa8a6(0x1e4)]()===_0x50ac26;}export async function resolveUserRef(_0x4ca9cb){const _0x1d6a05=a147_0x37981f,_0x2469dc=_0x4ca9cb['trim']();if(!_0x2469dc)throw CliErrors['validation'](_0x1d6a05(0x1f3),_0x1d6a05(0x1ff));const _0x2ad914=await resolveTenantCode(),_0x5bf105=await getTenantMembers(_0x2ad914);if(/^\d+$/[_0x1d6a05(0x1cf)](_0x2469dc)){const _0x4e2746=Number(_0x2469dc),_0x34c2c3=_0x5bf105['find'](_0x1c06e7=>_0x1c06e7[_0x1d6a05(0x1e7)]===_0x4e2746);return{'userId':_0x4e2746,'username':_0x34c2c3?.[_0x1d6a05(0x1bf)]??String(_0x4e2746),'nickname':_0x34c2c3?.['nickname'],'matchedBy':'id'};}const _0x33590e=_0x5bf105['filter'](_0xa33bee=>matchMember(_0xa33bee,_0x2469dc));if(_0x33590e[_0x1d6a05(0x1da)]===0x0)throw CliErrors[_0x1d6a05(0x202)]('No\x20tenant\x20member\x20matches\x20\x22'+_0x2469dc+'\x22.',_0x1d6a05(0x1bc));if(_0x33590e[_0x1d6a05(0x1da)]>0x1){const _0x17e4da=_0x33590e[_0x1d6a05(0x1e6)](_0x126acb=>(_0x126acb[_0x1d6a05(0x1d7)]??_0x126acb['username']??'?')+'('+_0x126acb[_0x1d6a05(0x1e7)]+')')['join'](',\x20');throw CliErrors['validation']('Multiple\x20tenant\x20members\x20match\x20\x22'+_0x2469dc+'\x22:\x20'+_0x17e4da+'.','Disambiguate\x20with\x20--user\x20<id>.');}const _0x213957=_0x33590e[0x0];return{'userId':_0x213957[_0x1d6a05(0x1e7)],'username':_0x213957[_0x1d6a05(0x1bf)]??String(_0x213957[_0x1d6a05(0x1e7)]),'nickname':_0x213957[_0x1d6a05(0x1d7)],'matchedBy':_0x1d6a05(0x209)};}export const UPDATE_USER_LIST_PATH=a147_0x37981f(0x1fd);function userIdsOf(_0xabb1f0){const _0x4049b7=a147_0x37981f;return(_0xabb1f0?.[_0x4049b7(0x1fc)]??[])[_0x4049b7(0x1e6)](_0x13faf2=>_0x13faf2['userId']);}export function computeRoleUserMutation(_0x337e58){const _0x17fb0a=a147_0x37981f,{operation:_0x165e0b,appCode:_0x3c6a99,roleUsers:_0x1dc9f6,targetRoleId:_0x58bea8,user:_0x4dec45}=_0x337e58,_0x1c217c=_0x1dc9f6[_0x17fb0a(0x200)](_0x10ced8=>_0x10ced8['id']===_0x58bea8);if(!_0x1c217c)throw CliErrors['validation'](_0x17fb0a(0x1cd)+_0x58bea8+_0x17fb0a(0x1f8),_0x17fb0a(0x1c6));const _0x100f69=userIdsOf(_0x1c217c),_0x2d41c8=[];if(_0x337e58[_0x17fb0a(0x1cb)]!==undefined&&_0x337e58[_0x17fb0a(0x1cb)]!==_0x100f69[_0x17fb0a(0x1da)])throw CliErrors[_0x17fb0a(0x202)](_0x17fb0a(0x1fa)+_0x337e58[_0x17fb0a(0x1cb)]+_0x17fb0a(0x1e3)+_0x100f69[_0x17fb0a(0x1da)]+'.',_0x17fb0a(0x1f6));const _0x2025c5=_0x100f69[_0x17fb0a(0x1e2)](_0x4dec45['userId']);let _0x36e334=![];const _0xda7980=[..._0x1c217c[_0x17fb0a(0x1fc)]];if(_0x165e0b===_0x17fb0a(0x1d3))_0x2025c5?_0x2d41c8['push']('User\x20'+_0x4dec45['userId']+_0x17fb0a(0x1e1)+_0x1c217c[_0x17fb0a(0x1ba)]+_0x17fb0a(0x1ef)):(_0xda7980[_0x17fb0a(0x1de)]({'userId':_0x4dec45['userId'],'username':_0x4dec45[_0x17fb0a(0x1bf)],..._0x4dec45['nickname']?{'nickname':_0x4dec45[_0x17fb0a(0x1d7)]}:{}}),_0x36e334=!![]);else{if(!_0x2025c5)_0x2d41c8[_0x17fb0a(0x1de)](_0x17fb0a(0x1cc)+_0x4dec45['userId']+_0x17fb0a(0x1fe)+_0x1c217c[_0x17fb0a(0x1ba)]+_0x17fb0a(0x1ef));else{const _0x19f8e9=_0xda7980[_0x17fb0a(0x1d5)](_0x48eb64=>_0x48eb64['userId']===_0x4dec45[_0x17fb0a(0x1e7)]);if(_0x19f8e9>=0x0)_0xda7980[_0x17fb0a(0x1f0)](_0x19f8e9,0x1);_0x36e334=!![];}}const _0x4c438f=_0x1dc9f6[_0x17fb0a(0x1e6)](_0x258db0=>_0x258db0['id']===_0x58bea8?{..._0x258db0,'userList':_0xda7980}:_0x258db0),_0x208aa6=_0xda7980[_0x17fb0a(0x1e6)](_0xccbff5=>_0xccbff5[_0x17fb0a(0x1e7)]),_0x119694={'operation':_0x165e0b,'selector':{'appCode':_0x3c6a99,'roleId':_0x58bea8,'roleName':_0x1c217c[_0x17fb0a(0x1ba)],'userId':_0x4dec45[_0x17fb0a(0x1e7)]},'before':{'userIds':_0x100f69},'after':{'userIds':_0x208aa6},'dryRun':_0x337e58[_0x17fb0a(0x1ce)],'backend':{'method':_0x17fb0a(0x1df),'path':UPDATE_USER_LIST_PATH},'warnings':_0x2d41c8};return{'roleList':_0x4c438f,'mutation':_0x119694,'changed':_0x36e334};}export async function loadRoleUsers(_0x1e38a3){return listRoleUsers(_0x1e38a3);}function a147_0x99de(_0x2374f8,_0x1ec8e4){_0x2374f8=_0x2374f8-0x1b6;const _0x4afe95=a147_0x4afe();let _0x99de87=_0x4afe95[_0x2374f8];return _0x99de87;}export function readRoleRef(_0x562d61){const _0x106d9a=a147_0x37981f,_0x100596=_0x562d61[_0x106d9a(0x1ee)](_0x106d9a(0x1e5))['trim']();if(!_0x100596)throw CliErrors[_0x106d9a(0x208)](_0x106d9a(0x1e5),_0x106d9a(0x1b6));return _0x100596;}export async function prepareUserMutation(_0x55e64e,_0x2577a3,_0x2c24dd){const _0x24599f=a147_0x37981f,_0x3c7fff=readRoleRef(_0x55e64e),_0x5b161f=_0x55e64e[_0x24599f(0x1ee)](_0x24599f(0x1dd))[_0x24599f(0x1eb)]();if(!_0x5b161f)throw CliErrors['flagMissing']('user',_0x24599f(0x1ff));const _0x4750b0=_0x55e64e[_0x24599f(0x1e9)]('expect-user-count'),_0xf99800=_0x4750b0===undefined||_0x4750b0===null?undefined:Number(_0x4750b0),_0x98574b=await resolveRoleRef(_0x55e64e[_0x24599f(0x1d9)],_0x3c7fff),_0x38e9a5=await resolveUserRef(_0x5b161f),_0x1c4cc9=await loadRoleUsers(_0x55e64e['appCode']);return computeRoleUserMutation({'operation':_0x2577a3,'appCode':_0x55e64e[_0x24599f(0x1d9)],'roleUsers':_0x1c4cc9,'targetRoleId':_0x98574b['id'],'user':{'userId':_0x38e9a5[_0x24599f(0x1e7)],'username':_0x38e9a5[_0x24599f(0x1bf)],'nickname':_0x38e9a5[_0x24599f(0x1d7)]},'dryRun':_0x2c24dd,..._0xf99800!==undefined?{'expectUserCount':_0xf99800}:{}});}
@@ -1 +1 @@
1
- const a148_0x3fef77=a148_0x5bdf;(function(_0x3cbae4,_0xf9226f){const _0x97c751=a148_0x5bdf,_0x286c94=_0x3cbae4();while(!![]){try{const _0x2c527c=-parseInt(_0x97c751(0x147))/0x1+-parseInt(_0x97c751(0x135))/0x2*(parseInt(_0x97c751(0x134))/0x3)+parseInt(_0x97c751(0x12e))/0x4*(-parseInt(_0x97c751(0x12d))/0x5)+parseInt(_0x97c751(0x13b))/0x6+-parseInt(_0x97c751(0x146))/0x7*(-parseInt(_0x97c751(0x137))/0x8)+parseInt(_0x97c751(0x12c))/0x9*(parseInt(_0x97c751(0x148))/0xa)+parseInt(_0x97c751(0x141))/0xb*(parseInt(_0x97c751(0x133))/0xc);if(_0x2c527c===_0xf9226f)break;else _0x286c94['push'](_0x286c94['shift']());}catch(_0x4732cb){_0x286c94['push'](_0x286c94['shift']());}}}(a148_0x5211,0x6b56d));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a148_0x5bdf(_0x37a87b,_0x5d09e9){_0x37a87b=_0x37a87b-0x12c;const _0x521188=a148_0x5211();let _0x5bdf88=_0x521188[_0x37a87b];return _0x5bdf88;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a148_0x5211(){const _0x119a2e=['601726sYwyQj','2295860HteAdy','string','18oPrnyb','433130uAFzRc','24obTpcA','num','Nothing\x20to\x20update.','roleName','update','7728564fqVYfT','1599159iIoBIi','2FfhRJz','remark','6445936FqRnxn','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','New\x20role\x20name','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','1111410jKUddz','POST','trim','write','role','name','11bnUNBX','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','flag','appCode','Updated\x20role\x20','7ysmZYE'];a148_0x5211=function(){return _0x119a2e;};return a148_0x5211();}import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH='/smartapi/permit/role/update';function readPatch(_0x2b307c){const _0x22ee7a=a148_0x5bdf,_0x14ce54=_0x2b307c['flag'](_0x22ee7a(0x140)),_0x34d113=_0x2b307c[_0x22ee7a(0x143)](_0x22ee7a(0x136)),_0x59d91e={};if(_0x14ce54!==undefined&&_0x14ce54!==null){const _0xc35bac=String(_0x14ce54)[_0x22ee7a(0x13d)]();if(!_0xc35bac)throw CliErrors['validation']('--name\x20cannot\x20be\x20empty.');if(_0xc35bac['length']>0x40)throw CliErrors['validation'](_0x22ee7a(0x142));_0x59d91e['roleName']=_0xc35bac;}_0x34d113!==undefined&&_0x34d113!==null&&(_0x59d91e[_0x22ee7a(0x136)]=String(_0x34d113));if(_0x59d91e[_0x22ee7a(0x131)]===undefined&&_0x59d91e['remark']===undefined)throw CliErrors['validation'](_0x22ee7a(0x130),_0x22ee7a(0x138));return _0x59d91e;}export const roleUpdate={'service':a148_0x3fef77(0x13f),'command':a148_0x3fef77(0x132),'description':a148_0x3fef77(0x13a),'risk':a148_0x3fef77(0x13e),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a148_0x3fef77(0x140),'type':a148_0x3fef77(0x149),'required':![],'description':a148_0x3fef77(0x139)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1233cf){readPatch(_0x1233cf);},async 'dryRun'(_0xd78191){const _0x5b9b4a=a148_0x3fef77,_0x39bc7e=_0xd78191['num']('id'),_0x9ef130=readPatch(_0xd78191),_0x5f44a9=await getRoleById(_0xd78191[_0x5b9b4a(0x144)],_0x39bc7e);return assertCustomRole(_0x5f44a9,_0x5b9b4a(0x132)),asDryRunResult({'operation':_0x5b9b4a(0x132),'selector':{'appCode':_0xd78191[_0x5b9b4a(0x144)],'roleId':_0x39bc7e,'roleName':_0x5f44a9[_0x5b9b4a(0x131)]},'before':projectRole(_0x5f44a9),'after':projectRole({..._0x5f44a9,..._0x9ef130[_0x5b9b4a(0x131)]!==undefined?{'roleName':_0x9ef130[_0x5b9b4a(0x131)]}:{},..._0x9ef130[_0x5b9b4a(0x136)]!==undefined?{'remark':_0x9ef130[_0x5b9b4a(0x136)]}:{}}),'dryRun':!![],'backend':{'method':_0x5b9b4a(0x13c),'path':UPDATE_PATH},'warnings':[]},{'method':_0x5b9b4a(0x13c),'url':UPDATE_PATH});},async 'execute'(_0x112227){const _0x5bf4c3=a148_0x3fef77,_0x5a164a=_0x112227[_0x5bf4c3(0x12f)]('id'),_0x4ceb58=readPatch(_0x112227),_0x4e9c5d=await getRoleById(_0x112227[_0x5bf4c3(0x144)],_0x5a164a);assertCustomRole(_0x4e9c5d,_0x5bf4c3(0x132)),await updateAppRole({'id':_0x5a164a,'appCode':_0x112227[_0x5bf4c3(0x144)],..._0x4ceb58['roleName']!==undefined?{'roleName':_0x4ceb58[_0x5bf4c3(0x131)]}:{},..._0x4ceb58[_0x5bf4c3(0x136)]!==undefined?{'remark':_0x4ceb58[_0x5bf4c3(0x136)]}:{}});const _0x35dbdc=await getRoleById(_0x112227[_0x5bf4c3(0x144)],_0x5a164a);return{'ok':!![],'data':{'operation':_0x5bf4c3(0x132),'selector':{'appCode':_0x112227[_0x5bf4c3(0x144)],'roleId':_0x5a164a,'roleName':_0x35dbdc[_0x5bf4c3(0x131)]},'before':projectRole(_0x4e9c5d),'after':projectRole(_0x35dbdc),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':_0x5bf4c3(0x145)+_0x35dbdc[_0x5bf4c3(0x131)]+'\x20(id='+_0x5a164a+')'};}};
1
+ const a148_0x4d0ebb=a148_0x568a;(function(_0x276d52,_0x46238c){const _0x35c46f=a148_0x568a,_0x439003=_0x276d52();while(!![]){try{const _0x3940ec=parseInt(_0x35c46f(0x1a9))/0x1*(-parseInt(_0x35c46f(0x1a3))/0x2)+-parseInt(_0x35c46f(0x1a5))/0x3+parseInt(_0x35c46f(0x19a))/0x4*(-parseInt(_0x35c46f(0x197))/0x5)+-parseInt(_0x35c46f(0x1aa))/0x6*(parseInt(_0x35c46f(0x1a1))/0x7)+parseInt(_0x35c46f(0x19c))/0x8+-parseInt(_0x35c46f(0x192))/0x9*(-parseInt(_0x35c46f(0x193))/0xa)+-parseInt(_0x35c46f(0x19f))/0xb*(-parseInt(_0x35c46f(0x191))/0xc);if(_0x3940ec===_0x46238c)break;else _0x439003['push'](_0x439003['shift']());}catch(_0x387b7f){_0x439003['push'](_0x439003['shift']());}}}(a148_0x5d37,0x94653));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 a148_0x5d37(){const _0x2a9feb=['roleName','num','129869FPxhMJ','642JQAFNx','flag','write','/smartapi/permit/role/update','Nothing\x20to\x20update.','appCode','length','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','8796LSgONg','36hWJawL','1704520yNwjSx','string','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','trim','15VewDcf','Updated\x20role\x20','update','1512316zsMeME','POST','5543328TocDoR','\x20(id=','validation','45727bXdvxZ','New\x20role\x20name','53809SXClnX','name','10tBjlyZ','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','3623661bYgrUX','remark'];a148_0x5d37=function(){return _0x2a9feb;};return a148_0x5d37();}function a148_0x568a(_0x37d4a3,_0x4f3cc){_0x37d4a3=_0x37d4a3-0x18a;const _0x5d3705=a148_0x5d37();let _0x568a95=_0x5d3705[_0x37d4a3];return _0x568a95;}const UPDATE_PATH=a148_0x4d0ebb(0x18c);function readPatch(_0x2d0f66){const _0x86fa4e=a148_0x4d0ebb,_0x22a355=_0x2d0f66[_0x86fa4e(0x18a)](_0x86fa4e(0x1a2)),_0x56d339=_0x2d0f66['flag'](_0x86fa4e(0x1a6)),_0x1f9b3d={};if(_0x22a355!==undefined&&_0x22a355!==null){const _0x4924d1=String(_0x22a355)[_0x86fa4e(0x196)]();if(!_0x4924d1)throw CliErrors['validation']('--name\x20cannot\x20be\x20empty.');if(_0x4924d1[_0x86fa4e(0x18f)]>0x40)throw CliErrors[_0x86fa4e(0x19e)](_0x86fa4e(0x195));_0x1f9b3d[_0x86fa4e(0x1a7)]=_0x4924d1;}_0x56d339!==undefined&&_0x56d339!==null&&(_0x1f9b3d[_0x86fa4e(0x1a6)]=String(_0x56d339));if(_0x1f9b3d['roleName']===undefined&&_0x1f9b3d['remark']===undefined)throw CliErrors[_0x86fa4e(0x19e)](_0x86fa4e(0x18d),_0x86fa4e(0x1a4));return _0x1f9b3d;}export const roleUpdate={'service':'role','command':a148_0x4d0ebb(0x199),'description':a148_0x4d0ebb(0x190),'risk':a148_0x4d0ebb(0x18b),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a148_0x4d0ebb(0x1a2),'type':a148_0x4d0ebb(0x194),'required':![],'description':a148_0x4d0ebb(0x1a0)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x53d9a2){readPatch(_0x53d9a2);},async 'dryRun'(_0x42f24e){const _0x2a70ba=a148_0x4d0ebb,_0x4dc0b4=_0x42f24e[_0x2a70ba(0x1a8)]('id'),_0x101758=readPatch(_0x42f24e),_0x1d7b31=await getRoleById(_0x42f24e[_0x2a70ba(0x18e)],_0x4dc0b4);return assertCustomRole(_0x1d7b31,_0x2a70ba(0x199)),asDryRunResult({'operation':_0x2a70ba(0x199),'selector':{'appCode':_0x42f24e[_0x2a70ba(0x18e)],'roleId':_0x4dc0b4,'roleName':_0x1d7b31[_0x2a70ba(0x1a7)]},'before':projectRole(_0x1d7b31),'after':projectRole({..._0x1d7b31,..._0x101758[_0x2a70ba(0x1a7)]!==undefined?{'roleName':_0x101758[_0x2a70ba(0x1a7)]}:{},..._0x101758[_0x2a70ba(0x1a6)]!==undefined?{'remark':_0x101758[_0x2a70ba(0x1a6)]}:{}}),'dryRun':!![],'backend':{'method':_0x2a70ba(0x19b),'path':UPDATE_PATH},'warnings':[]},{'method':_0x2a70ba(0x19b),'url':UPDATE_PATH});},async 'execute'(_0x2a0b85){const _0x2e4efe=a148_0x4d0ebb,_0x3c0a10=_0x2a0b85[_0x2e4efe(0x1a8)]('id'),_0x3cd6b1=readPatch(_0x2a0b85),_0x2e31fd=await getRoleById(_0x2a0b85['appCode'],_0x3c0a10);assertCustomRole(_0x2e31fd,_0x2e4efe(0x199)),await updateAppRole({'id':_0x3c0a10,'appCode':_0x2a0b85[_0x2e4efe(0x18e)],..._0x3cd6b1['roleName']!==undefined?{'roleName':_0x3cd6b1[_0x2e4efe(0x1a7)]}:{},..._0x3cd6b1[_0x2e4efe(0x1a6)]!==undefined?{'remark':_0x3cd6b1['remark']}:{}});const _0x3625fb=await getRoleById(_0x2a0b85[_0x2e4efe(0x18e)],_0x3c0a10);return{'ok':!![],'data':{'operation':_0x2e4efe(0x199),'selector':{'appCode':_0x2a0b85[_0x2e4efe(0x18e)],'roleId':_0x3c0a10,'roleName':_0x3625fb[_0x2e4efe(0x1a7)]},'before':projectRole(_0x2e31fd),'after':projectRole(_0x3625fb),'dryRun':![],'backend':{'method':_0x2e4efe(0x19b),'path':UPDATE_PATH},'warnings':[]},'message':_0x2e4efe(0x198)+_0x3625fb[_0x2e4efe(0x1a7)]+_0x2e4efe(0x19d)+_0x3c0a10+')'};}};
@@ -1 +1 @@
1
- function a149_0x13bd(){const _0x37db5c=['selector','roleName','\x20already\x20in\x20role\x20','1xAyNHI','4073268NkpGcp','12498050qMcXCV','high-risk-write','user-add','6UGBVLl','22RkwKWR','userId','6619464BAQIJH','192734yeYCic','2673360XWnXwB','appCode','8501248zzWLFn','\x20to\x20role\x20','3086015gkZwgV','role','16UJDEOF'];a149_0x13bd=function(){return _0x37db5c;};return a149_0x13bd();}const a149_0x541265=a149_0x250a;(function(_0x1324b6,_0x59f326){const _0x34750e=a149_0x250a,_0x3e573c=_0x1324b6();while(!![]){try{const _0x67ac50=parseInt(_0x34750e(0x119))/0x1*(-parseInt(_0x34750e(0x122))/0x2)+-parseInt(_0x34750e(0x11a))/0x3+parseInt(_0x34750e(0x123))/0x4+parseInt(_0x34750e(0x127))/0x5*(-parseInt(_0x34750e(0x11e))/0x6)+parseInt(_0x34750e(0x125))/0x7+parseInt(_0x34750e(0x115))/0x8*(-parseInt(_0x34750e(0x121))/0x9)+parseInt(_0x34750e(0x11b))/0xa*(parseInt(_0x34750e(0x11f))/0xb);if(_0x67ac50===_0x59f326)break;else _0x3e573c['push'](_0x3e573c['shift']());}catch(_0x464619){_0x3e573c['push'](_0x3e573c['shift']());}}}(a149_0x13bd,0xcd1a0));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';function a149_0x250a(_0x3b7fdd,_0x1038f2){_0x3b7fdd=_0x3b7fdd-0x114;const _0x13bd4f=a149_0x13bd();let _0x250a57=_0x13bd4f[_0x3b7fdd];return _0x250a57;}export const roleUserAdd={'service':a149_0x541265(0x114),'command':a149_0x541265(0x11d),'description':'Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a149_0x541265(0x11c),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x16a311){const {mutation:_0x402f56}=await prepareUserMutation(_0x16a311,'user-add',!![]);return asDryRunResult(_0x402f56,{'method':'POST','url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x525a52){const _0x25eaaf=a149_0x541265,{roleList:_0x378ac2,mutation:_0x29dd21,changed:_0x135c3a}=await prepareUserMutation(_0x525a52,_0x25eaaf(0x11d),![]);return _0x135c3a&&await updateRoleUsers(_0x525a52[_0x25eaaf(0x124)],_0x378ac2),{'ok':!![],'data':_0x29dd21,'message':_0x135c3a?'Added\x20user\x20'+_0x29dd21['selector'][_0x25eaaf(0x120)]+_0x25eaaf(0x126)+_0x29dd21[_0x25eaaf(0x116)][_0x25eaaf(0x117)]:'No\x20change:\x20user\x20'+_0x29dd21['selector'][_0x25eaaf(0x120)]+_0x25eaaf(0x118)+_0x29dd21[_0x25eaaf(0x116)][_0x25eaaf(0x117)]};}};
1
+ function a149_0x2ee0(_0x4b528c,_0x4fe181){_0x4b528c=_0x4b528c-0x8f;const _0x5d8471=a149_0x5d84();let _0x2ee0ae=_0x5d8471[_0x4b528c];return _0x2ee0ae;}const a149_0x5891c4=a149_0x2ee0;(function(_0x3d55ff,_0x36fc83){const _0x398e19=a149_0x2ee0,_0x235cc4=_0x3d55ff();while(!![]){try{const _0x2c76fa=parseInt(_0x398e19(0x94))/0x1+-parseInt(_0x398e19(0x9a))/0x2*(-parseInt(_0x398e19(0x91))/0x3)+-parseInt(_0x398e19(0x8f))/0x4*(-parseInt(_0x398e19(0xa1))/0x5)+-parseInt(_0x398e19(0x90))/0x6+parseInt(_0x398e19(0x9d))/0x7+-parseInt(_0x398e19(0x99))/0x8+parseInt(_0x398e19(0xa0))/0x9*(-parseInt(_0x398e19(0x9c))/0xa);if(_0x2c76fa===_0x36fc83)break;else _0x235cc4['push'](_0x235cc4['shift']());}catch(_0x5bbb68){_0x235cc4['push'](_0x235cc4['shift']());}}}(a149_0x5d84,0xcb509));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a149_0x5d84(){const _0x4db90a=['selector','7870gpsMLY','1814218TkZndK','user-add','high-risk-write','13581uCHorj','588825BaHJil','52evBQxm','2673636qHtcvq','3HfiKmr','\x20to\x20role\x20','No\x20change:\x20user\x20','1422896lpYhfD','POST','roleName','userId','role','13280896ryJmoA','1826126noKdXT'];a149_0x5d84=function(){return _0x4db90a;};return a149_0x5d84();}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':a149_0x5891c4(0x98),'command':a149_0x5891c4(0x9e),'description':'Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a149_0x5891c4(0x9f),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x2975a8){const _0x3e997f=a149_0x5891c4,{mutation:_0x2f8f91}=await prepareUserMutation(_0x2975a8,_0x3e997f(0x9e),!![]);return asDryRunResult(_0x2f8f91,{'method':_0x3e997f(0x95),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x3fc886){const _0x9b2e7=a149_0x5891c4,{roleList:_0x5241db,mutation:_0x59f17c,changed:_0x35249e}=await prepareUserMutation(_0x3fc886,_0x9b2e7(0x9e),![]);return _0x35249e&&await updateRoleUsers(_0x3fc886['appCode'],_0x5241db),{'ok':!![],'data':_0x59f17c,'message':_0x35249e?'Added\x20user\x20'+_0x59f17c[_0x9b2e7(0x9b)][_0x9b2e7(0x97)]+_0x9b2e7(0x92)+_0x59f17c[_0x9b2e7(0x9b)][_0x9b2e7(0x96)]:_0x9b2e7(0x93)+_0x59f17c[_0x9b2e7(0x9b)][_0x9b2e7(0x97)]+'\x20already\x20in\x20role\x20'+_0x59f17c['selector'][_0x9b2e7(0x96)]};}};
@@ -1 +1 @@
1
- function a150_0x590c(){const _0x39a371=['user-remove','1074QHrfHh','574029TMvCtG','4595CCdnlJ','No\x20change:\x20user\x20','6047PIfdzm','158cgFziw','7084665DZOFwh','2690334dMjRSf','appCode','role','\x20not\x20in\x20role\x20','selector','56MIGBLQ','roleName','4591680qHMPPj','userId','3515890wmjYpJ','11EKevDE'];a150_0x590c=function(){return _0x39a371;};return a150_0x590c();}const a150_0x7ab26d=a150_0x1bfd;(function(_0x100a04,_0x1e654e){const _0x5bbe8f=a150_0x1bfd,_0x12b94b=_0x100a04();while(!![]){try{const _0x3492cf=-parseInt(_0x5bbe8f(0x1f8))/0x1*(-parseInt(_0x5bbe8f(0x1f9))/0x2)+-parseInt(_0x5bbe8f(0x1fb))/0x3+parseInt(_0x5bbe8f(0x1ef))/0x4+parseInt(_0x5bbe8f(0x1f6))/0x5*(parseInt(_0x5bbe8f(0x1f4))/0x6)+-parseInt(_0x5bbe8f(0x1fa))/0x7+parseInt(_0x5bbe8f(0x1ed))/0x8*(parseInt(_0x5bbe8f(0x1f5))/0x9)+parseInt(_0x5bbe8f(0x1f1))/0xa*(parseInt(_0x5bbe8f(0x1f2))/0xb);if(_0x3492cf===_0x1e654e)break;else _0x12b94b['push'](_0x12b94b['shift']());}catch(_0x25430d){_0x12b94b['push'](_0x12b94b['shift']());}}}(a150_0x590c,0xa5d95));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';function a150_0x1bfd(_0x2767ff,_0x3999d8){_0x2767ff=_0x2767ff-0x1ec;const _0x590cbc=a150_0x590c();let _0x1bfd7c=_0x590cbc[_0x2767ff];return _0x1bfd7c;}export const roleUserRemove={'service':a150_0x7ab26d(0x1fd),'command':a150_0x7ab26d(0x1f3),'description':'Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x2eac59){const _0x54baae=a150_0x7ab26d,{mutation:_0x563074}=await prepareUserMutation(_0x2eac59,_0x54baae(0x1f3),!![]);return asDryRunResult(_0x563074,{'method':'POST','url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x14fe75){const _0x4d8963=a150_0x7ab26d,{roleList:_0x627bc9,mutation:_0x38c946,changed:_0xefc5c1}=await prepareUserMutation(_0x14fe75,_0x4d8963(0x1f3),![]);return _0xefc5c1&&await updateRoleUsers(_0x14fe75[_0x4d8963(0x1fc)],_0x627bc9),{'ok':!![],'data':_0x38c946,'message':_0xefc5c1?'Removed\x20user\x20'+_0x38c946[_0x4d8963(0x1ec)][_0x4d8963(0x1f0)]+'\x20from\x20role\x20'+_0x38c946[_0x4d8963(0x1ec)][_0x4d8963(0x1ee)]:_0x4d8963(0x1f7)+_0x38c946['selector'][_0x4d8963(0x1f0)]+_0x4d8963(0x1fe)+_0x38c946['selector'][_0x4d8963(0x1ee)]};}};
1
+ const a150_0x574f44=a150_0x5e99;function a150_0x5e99(_0x540daa,_0x14b3ca){_0x540daa=_0x540daa-0xd4;const _0x47f78e=a150_0x47f7();let _0x5e9933=_0x47f78e[_0x540daa];return _0x5e9933;}(function(_0x177810,_0x541e72){const _0x5aedf0=a150_0x5e99,_0x53b922=_0x177810();while(!![]){try{const _0x1fbeba=parseInt(_0x5aedf0(0xe6))/0x1*(-parseInt(_0x5aedf0(0xdf))/0x2)+parseInt(_0x5aedf0(0xda))/0x3*(-parseInt(_0x5aedf0(0xe8))/0x4)+parseInt(_0x5aedf0(0xe2))/0x5*(parseInt(_0x5aedf0(0xe1))/0x6)+parseInt(_0x5aedf0(0xde))/0x7*(-parseInt(_0x5aedf0(0xe3))/0x8)+-parseInt(_0x5aedf0(0xd6))/0x9*(parseInt(_0x5aedf0(0xd8))/0xa)+parseInt(_0x5aedf0(0xe9))/0xb+parseInt(_0x5aedf0(0xdb))/0xc*(parseInt(_0x5aedf0(0xd7))/0xd);if(_0x1fbeba===_0x541e72)break;else _0x53b922['push'](_0x53b922['shift']());}catch(_0x16064b){_0x53b922['push'](_0x53b922['shift']());}}}(a150_0x47f7,0xe0182));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a150_0x47f7(){const _0x3e6150=['481630ZTFZYf','\x20not\x20in\x20role\x20','78150FTtnYe','475MaHdwm','9080fPVPYE','\x20from\x20role\x20','userId','6CVTDDP','user-remove','1331396SMmqsI','4738283RLdCNw','Removed\x20user\x20','No\x20change:\x20user\x20','appCode','selector','POST','21969RAXlGn','64127557mARqAT','6710MuIucm','high-risk-write','12eMbAhQ','12emyhmY','roleName','role','7826qwDnmD'];a150_0x47f7=function(){return _0x3e6150;};return a150_0x47f7();}import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':a150_0x574f44(0xdd),'command':a150_0x574f44(0xe7),'description':'Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a150_0x574f44(0xd9),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0xc27be){const _0x443436=a150_0x574f44,{mutation:_0xdee089}=await prepareUserMutation(_0xc27be,'user-remove',!![]);return asDryRunResult(_0xdee089,{'method':_0x443436(0xd5),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x1ad9a1){const _0x18f74c=a150_0x574f44,{roleList:_0x4c8aed,mutation:_0x313389,changed:_0x464843}=await prepareUserMutation(_0x1ad9a1,_0x18f74c(0xe7),![]);return _0x464843&&await updateRoleUsers(_0x1ad9a1[_0x18f74c(0xec)],_0x4c8aed),{'ok':!![],'data':_0x313389,'message':_0x464843?_0x18f74c(0xea)+_0x313389['selector'][_0x18f74c(0xe5)]+_0x18f74c(0xe4)+_0x313389['selector'][_0x18f74c(0xdc)]:_0x18f74c(0xeb)+_0x313389[_0x18f74c(0xd4)][_0x18f74c(0xe5)]+_0x18f74c(0xe0)+_0x313389['selector'][_0x18f74c(0xdc)]};}};
@@ -1 +1 @@
1
- function a151_0x1ae9(){const _0x330cc6=['str','\x22\x20→\x20userId\x20','40LUBxcZ','userId','name','374373jJVjwL','12EwweFq','3fYyrHQ','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','407391sXpxPJ','matchedBy','108482VYjeHL','71145MpegjN','Resolved\x20\x22','username','trim','read','300mNnEpM','1046344rjEGKV','flagMissing','nickname','6kSYzWV','303639oPHAEu','48466uIfIUB'];a151_0x1ae9=function(){return _0x330cc6;};return a151_0x1ae9();}const a151_0x4e9d06=a151_0x2bb5;(function(_0x388ffc,_0x14a69c){const _0x5191ce=a151_0x2bb5,_0x1729c1=_0x388ffc();while(!![]){try{const _0x1e2fa7=-parseInt(_0x5191ce(0x15d))/0x1*(parseInt(_0x5191ce(0x155))/0x2)+parseInt(_0x5191ce(0x15f))/0x3+parseInt(_0x5191ce(0x15c))/0x4*(parseInt(_0x5191ce(0x162))/0x5)+-parseInt(_0x5191ce(0x153))/0x6*(parseInt(_0x5191ce(0x154))/0x7)+parseInt(_0x5191ce(0x150))/0x8+parseInt(_0x5191ce(0x15b))/0x9*(parseInt(_0x5191ce(0x158))/0xa)+-parseInt(_0x5191ce(0x161))/0xb*(parseInt(_0x5191ce(0x14f))/0xc);if(_0x1e2fa7===_0x14a69c)break;else _0x1729c1['push'](_0x1729c1['shift']());}catch(_0x5e1206){_0x1729c1['push'](_0x1729c1['shift']());}}}(a151_0x1ae9,0x1b98f));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';function a151_0x2bb5(_0x288593,_0x1a4fb1){_0x288593=_0x288593-0x14d;const _0x1ae9ce=a151_0x1ae9();let _0x2bb56d=_0x1ae9ce[_0x288593];return _0x2bb56d;}export const roleUserResolve={'service':'role','command':'user-resolve','description':a151_0x4e9d06(0x15e),'risk':a151_0x4e9d06(0x14e),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5e6f9){const _0x138018=a151_0x4e9d06;if(!_0x5e6f9[_0x138018(0x156)](_0x138018(0x15a))[_0x138018(0x14d)]())throw CliErrors[_0x138018(0x151)]('name','Pass\x20--name\x20<nickname|username>.');},async 'execute'(_0x2e11cd){const _0x1a9f1a=a151_0x4e9d06,_0x34f390=_0x2e11cd['str']('name')[_0x1a9f1a(0x14d)](),_0x29b9aa=await resolveUserRef(_0x34f390);return{'ok':!![],'data':{'user':{'userId':_0x29b9aa[_0x1a9f1a(0x159)],'username':_0x29b9aa[_0x1a9f1a(0x164)],'nickname':_0x29b9aa[_0x1a9f1a(0x152)],'matchedBy':_0x29b9aa[_0x1a9f1a(0x160)]}},'message':_0x1a9f1a(0x163)+_0x34f390+_0x1a9f1a(0x157)+_0x29b9aa[_0x1a9f1a(0x159)]};}};
1
+ const a151_0x384cca=a151_0x5429;(function(_0x725c77,_0x2f4333){const _0x44d3fa=a151_0x5429,_0x2d81f3=_0x725c77();while(!![]){try{const _0x3db02e=-parseInt(_0x44d3fa(0xdd))/0x1*(-parseInt(_0x44d3fa(0xcc))/0x2)+parseInt(_0x44d3fa(0xd8))/0x3+-parseInt(_0x44d3fa(0xd1))/0x4+parseInt(_0x44d3fa(0xd3))/0x5*(parseInt(_0x44d3fa(0xd2))/0x6)+parseInt(_0x44d3fa(0xda))/0x7*(parseInt(_0x44d3fa(0xe0))/0x8)+parseInt(_0x44d3fa(0xdc))/0x9+parseInt(_0x44d3fa(0xcd))/0xa*(-parseInt(_0x44d3fa(0xde))/0xb);if(_0x3db02e===_0x2f4333)break;else _0x2d81f3['push'](_0x2d81f3['shift']());}catch(_0x572d10){_0x2d81f3['push'](_0x2d81f3['shift']());}}}(a151_0x13dc,0x9ac14));import{CliErrors}from'../../errors.js';function a151_0x5429(_0xa1da59,_0x29f603){_0xa1da59=_0xa1da59-0xca;const _0x13dc34=a151_0x13dc();let _0x54295a=_0x13dc34[_0xa1da59];return _0x54295a;}function a151_0x13dc(){const _0x22a470=['530yRSDYV','Resolved\x20\x22','Pass\x20--name\x20<nickname|username>.','userId','3491696quyhfi','58020fANRrw','545YxkIHz','username','user-resolve','matchedBy','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','2484162YjFehN','flagMissing','133gStcjS','str','5865165lNROPL','2077WizMZG','414722QnIyji','trim','46888NEaGct','nickname','name','\x22\x20→\x20userId\x20','828GcURdn'];a151_0x13dc=function(){return _0x22a470;};return a151_0x13dc();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':'role','command':a151_0x384cca(0xd5),'description':a151_0x384cca(0xd7),'risk':'read','flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x25b6b2){const _0x5c4453=a151_0x384cca;if(!_0x25b6b2['str'](_0x5c4453(0xca))[_0x5c4453(0xdf)]())throw CliErrors[_0x5c4453(0xd9)](_0x5c4453(0xca),_0x5c4453(0xcf));},async 'execute'(_0x597c6e){const _0x2b7d82=a151_0x384cca,_0x3b9a11=_0x597c6e[_0x2b7d82(0xdb)](_0x2b7d82(0xca))['trim'](),_0x237296=await resolveUserRef(_0x3b9a11);return{'ok':!![],'data':{'user':{'userId':_0x237296['userId'],'username':_0x237296[_0x2b7d82(0xd4)],'nickname':_0x237296[_0x2b7d82(0xe1)],'matchedBy':_0x237296[_0x2b7d82(0xd6)]}},'message':_0x2b7d82(0xce)+_0x3b9a11+_0x2b7d82(0xcb)+_0x237296[_0x2b7d82(0xd0)]};}};
@@ -1 +1 @@
1
- const a152_0x4754c8=a152_0x3432;(function(_0x488634,_0x2c1632){const _0x49ca2f=a152_0x3432,_0x11e30b=_0x488634();while(!![]){try{const _0x34df7d=parseInt(_0x49ca2f(0xd1))/0x1*(parseInt(_0x49ca2f(0xd6))/0x2)+parseInt(_0x49ca2f(0xd9))/0x3*(-parseInt(_0x49ca2f(0xd3))/0x4)+-parseInt(_0x49ca2f(0xad))/0x5*(-parseInt(_0x49ca2f(0xe2))/0x6)+parseInt(_0x49ca2f(0xb0))/0x7*(parseInt(_0x49ca2f(0xc0))/0x8)+parseInt(_0x49ca2f(0xc6))/0x9*(-parseInt(_0x49ca2f(0xcd))/0xa)+-parseInt(_0x49ca2f(0xe3))/0xb+-parseInt(_0x49ca2f(0xb4))/0xc;if(_0x34df7d===_0x2c1632)break;else _0x11e30b['push'](_0x11e30b['shift']());}catch(_0x864e7f){_0x11e30b['push'](_0x11e30b['shift']());}}}(a152_0x4e66,0xbf2a1));import{readFileSync,existsSync}from'node:fs';function a152_0x4e66(){const _0x148c1b=['5wnFfjL','vite\x20preview\x20exited\x20with\x20code\x20','No\x20package.json\x20found\x20in\x20current\x20directory.','7agLTjZ','\x0a\x20\x20Usage:\x20','\x20run\x20build','npm','5872488AQjlJB','(none)','vite','pnpm-lock.yaml','bool','script','watch','parse','start','preview','log','yarn','5379416oFdnLt','\x20run\x20preview','node_modules','validation','\x20run\x20start','bun.lockb','4266dPRuKK','build','close','No\x20scripts\x20defined\x20in\x20package.json.','\x20run\x20<script>\x0a','\x20\x20EXAMPLES','keys','5140DtxxMW','Script\x20\x22','\x20\x20\x20\x20','error','1320623ozaVLl','run','1108532WrfErO','args','pnpm','2wAzXIm','\x20exited\x20with\x20code\x20','scripts','3ukmlob','\x0a\x20\x20Available\x20scripts:\x0a','inherit','read','\x22\x20not\x20found\x20in\x20package.json.','bun.lock','.bin','push','Available:\x20','6342588OqkbMI','13826956zLqbaw','all','join','belowMinimum','\x20run\x20','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','boolean'];a152_0x4e66=function(){return _0x148c1b;};return a152_0x4e66();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a152_0x4754c8(0xbc),'dev']);function readPackageScripts(_0x8fc21c){const _0x454dbd=a152_0x4754c8,_0x4befc1=resolve(_0x8fc21c,'package.json');if(!existsSync(_0x4befc1))return null;try{const _0x3c39c4=JSON[_0x454dbd(0xbb)](readFileSync(_0x4befc1,'utf-8'));return _0x3c39c4[_0x454dbd(0xd8)]??{};}catch{return null;}}function detectPackageManager(_0x225084){const _0x5675f6=a152_0x4754c8;if(existsSync(resolve(_0x225084,_0x5675f6(0xc5)))||existsSync(resolve(_0x225084,_0x5675f6(0xde))))return'bun';if(existsSync(resolve(_0x225084,_0x5675f6(0xb7))))return _0x5675f6(0xd5);if(existsSync(resolve(_0x225084,'yarn.lock')))return _0x5675f6(0xbf);return _0x5675f6(0xb3);}async function versionCheck(_0x33b90b){const _0x389edd=a152_0x4754c8,_0x3d3072=await checkCliVersion();(_0x3d3072['needsUpgrade']||_0x3d3072[_0x389edd(0xe6)])&&(printCliUpgradeWarning(_0x3d3072),assertCliVersionSupported(_0x3d3072));const _0x3f7786=await checkSdkVersion(_0x33b90b);if(_0x3f7786['needsUpgrade'])printSdkUpgradeWarning(_0x3f7786);}function a152_0x3432(_0x32c1ea,_0x196532){_0x32c1ea=_0x32c1ea-0xac;const _0x4e6672=a152_0x4e66();let _0x3432c3=_0x4e6672[_0x32c1ea];return _0x3432c3;}function spawnScript(_0x46c6ad,_0x4167f1,_0x36086c,_0x28cb63){return new Promise((_0xbade05,_0x30a883)=>{const _0x372080=a152_0x3432,_0x2c9701=[_0x372080(0xd2),_0x4167f1,..._0x36086c],_0x2074aa=spawn(_0x46c6ad,_0x2c9701,{'cwd':_0x28cb63,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x28cb63,_0x372080(0xc2),_0x372080(0xdf))+delimiter+process.env.PATH}});_0x2074aa['on']('close',_0x235a83=>{const _0x516a7f=_0x372080;if(_0x235a83===0x0||_0x235a83===null)_0xbade05();else _0x30a883(new Error(_0x46c6ad+_0x516a7f(0xe7)+_0x4167f1+_0x516a7f(0xd7)+_0x235a83));}),_0x2074aa['on']('error',_0x30a883);});}function spawnViteBuildWatch(_0xdfa2e6){return new Promise((_0x5e57a5,_0x2f2266)=>{const _0x3bfa83=a152_0x3432,_0x49d2ed=spawn('vite',[_0x3bfa83(0xc7),'--watch'],{'cwd':_0xdfa2e6,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0xdfa2e6,_0x3bfa83(0xc2),_0x3bfa83(0xdf))+delimiter+process.env.PATH}});_0x49d2ed['on'](_0x3bfa83(0xc8),_0x1e7ba2=>{const _0x38a1fe=_0x3bfa83;if(_0x1e7ba2===0x0||_0x1e7ba2===null)_0x5e57a5();else _0x2f2266(new Error(_0x38a1fe(0xe8)+_0x1e7ba2));}),_0x49d2ed['on'](_0x3bfa83(0xd0),_0x2f2266);});}function spawnVitePreview(_0x1ecb1e){return new Promise((_0xdf1b2f,_0x4b5c12)=>{const _0x4949db=a152_0x3432,_0x36bc38=spawn(_0x4949db(0xb6),['preview'],{'cwd':_0x1ecb1e,'stdio':_0x4949db(0xdb),'shell':!![],'env':{...process.env,'PATH':''+join(_0x1ecb1e,_0x4949db(0xc2),_0x4949db(0xdf))+delimiter+process.env.PATH}});_0x36bc38['on'](_0x4949db(0xc8),_0x154cfd=>{const _0x335263=_0x4949db;if(_0x154cfd===0x0||_0x154cfd===null)_0xdf1b2f();else _0x4b5c12(new Error(_0x335263(0xae)+_0x154cfd));}),_0x36bc38['on'](_0x4949db(0xd0),_0x4b5c12);});}const runFlags=[{'name':a152_0x4754c8(0xba),'type':a152_0x4754c8(0xac),'description':'Enable\x20watch\x20mode\x20for\x20preview','default':![]}];export const runDefinition={'service':a152_0x4754c8(0xd2),'command':a152_0x4754c8(0xd2),'description':'Run\x20a\x20package.json\x20script','risk':a152_0x4754c8(0xdc),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a152_0x4754c8(0xb9),'description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x2ce408=a152_0x4754c8,_0x254d6d=[];return _0x254d6d[_0x2ce408(0xe0)](_0x2ce408(0xcb)),_0x254d6d[_0x2ce408(0xe0)](_0x2ce408(0xcf)+CLI_BIN_NAME+_0x2ce408(0xc4)),_0x254d6d[_0x2ce408(0xe0)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x2ce408(0xb2)),_0x254d6d['push'](_0x2ce408(0xcf)+CLI_BIN_NAME+_0x2ce408(0xc1)),_0x254d6d[_0x2ce408(0xe0)](_0x2ce408(0xcf)+CLI_BIN_NAME+'\x20run\x20preview\x20--watch'),_0x254d6d[_0x2ce408(0xe5)]('\x0a');},async 'execute'(_0xa1b0a6){const _0x200c4b=a152_0x4754c8,_0x4aa515=process['cwd'](),_0x59711f=_0xa1b0a6[_0x200c4b(0xd4)][0x0],_0x5f0ff7=_0xa1b0a6['args']['slice'](0x1),_0x5d5d2f=readPackageScripts(_0x4aa515);if(!_0x5d5d2f)throw CliErrors[_0x200c4b(0xc3)](_0x200c4b(0xaf));if(!_0x59711f){const _0x5b0166=Object[_0x200c4b(0xcc)](_0x5d5d2f);if(_0x5b0166['length']===0x0)console[_0x200c4b(0xbe)](_0x200c4b(0xc9));else{console[_0x200c4b(0xbe)](_0x200c4b(0xda));for(const _0x581f44 of _0x5b0166){console[_0x200c4b(0xbe)](_0x200c4b(0xcf)+_0x581f44);}console[_0x200c4b(0xbe)](_0x200c4b(0xb1)+CLI_BIN_NAME+_0x200c4b(0xca));}return{'ok':!![]};}if(!_0x5d5d2f[_0x59711f])throw CliErrors['validation'](_0x200c4b(0xce)+_0x59711f+_0x200c4b(0xdd),_0x200c4b(0xe1)+(Object['keys'](_0x5d5d2f)[_0x200c4b(0xe5)](',\x20')||_0x200c4b(0xb5)));const _0x33a0bb=detectPackageManager(_0x4aa515);VERSION_CHECK_SCRIPTS['has'](_0x59711f)&&await versionCheck(_0x4aa515);if(_0x59711f===_0x200c4b(0xbd)&&_0xa1b0a6[_0x200c4b(0xb8)](_0x200c4b(0xba)))return await Promise[_0x200c4b(0xe4)]([spawnViteBuildWatch(_0x4aa515),spawnVitePreview(_0x4aa515)]),{'ok':!![]};return await spawnScript(_0x33a0bb,_0x59711f,_0x5f0ff7,_0x4aa515),{'ok':!![]};}};
1
+ const a152_0x2db26=a152_0x14c0;(function(_0x30b1ac,_0x76b632){const _0x3d9f59=a152_0x14c0,_0x216f32=_0x30b1ac();while(!![]){try{const _0xfbc11f=-parseInt(_0x3d9f59(0x126))/0x1*(-parseInt(_0x3d9f59(0x131))/0x2)+parseInt(_0x3d9f59(0x10f))/0x3*(parseInt(_0x3d9f59(0x13a))/0x4)+-parseInt(_0x3d9f59(0x115))/0x5+parseInt(_0x3d9f59(0x10b))/0x6*(parseInt(_0x3d9f59(0x109))/0x7)+-parseInt(_0x3d9f59(0x13f))/0x8+parseInt(_0x3d9f59(0x124))/0x9+-parseInt(_0x3d9f59(0x125))/0xa*(parseInt(_0x3d9f59(0x121))/0xb);if(_0xfbc11f===_0x76b632)break;else _0x216f32['push'](_0x216f32['shift']());}catch(_0x2f82da){_0x216f32['push'](_0x216f32['shift']());}}}(a152_0x4828,0xf2953));import{readFileSync,existsSync}from'node:fs';function a152_0x14c0(_0x18e6be,_0x35c094){_0x18e6be=_0x18e6be-0x107;const _0x482853=a152_0x4828();let _0x14c0e5=_0x482853[_0x18e6be];return _0x14c0e5;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a152_0x2db26(0x13d),a152_0x2db26(0x114)]);function readPackageScripts(_0x1871da){const _0x1af047=a152_0x2db26,_0x2251ba=resolve(_0x1871da,'package.json');if(!existsSync(_0x2251ba))return null;try{const _0x2ac03a=JSON[_0x1af047(0x12a)](readFileSync(_0x2251ba,_0x1af047(0x117)));return _0x2ac03a['scripts']??{};}catch{return null;}}function detectPackageManager(_0x22f697){const _0x3f5fd7=a152_0x2db26;if(existsSync(resolve(_0x22f697,_0x3f5fd7(0x108)))||existsSync(resolve(_0x22f697,_0x3f5fd7(0x144))))return _0x3f5fd7(0x11b);if(existsSync(resolve(_0x22f697,_0x3f5fd7(0x133))))return _0x3f5fd7(0x143);if(existsSync(resolve(_0x22f697,'yarn.lock')))return _0x3f5fd7(0x11d);return _0x3f5fd7(0x13e);}async function versionCheck(_0x240821){const _0x3724b9=a152_0x2db26,_0xc5c60d=await checkCliVersion();(_0xc5c60d[_0x3724b9(0x137)]||_0xc5c60d[_0x3724b9(0x142)])&&(printCliUpgradeWarning(_0xc5c60d),assertCliVersionSupported(_0xc5c60d));const _0x4b6228=await checkSdkVersion(_0x240821);if(_0x4b6228['needsUpgrade'])printSdkUpgradeWarning(_0x4b6228);}function a152_0x4828(){const _0x37e394=['21mfLYju','script','length','(none)','keys','dev','5193230sEcCDQ','\x20run\x20preview','utf-8','error','bool','close','bun','log','yarn','No\x20scripts\x20defined\x20in\x20package.json.','has','Available:\x20','11Ofyxyl','\x20run\x20build','\x0a\x20\x20Usage:\x20','14174406nJDxPd','5132230seknEt','1187197RANClL','run','read','preview','parse','.bin','No\x20package.json\x20found\x20in\x20current\x20directory.','slice','Script\x20\x22','vite','build','2dQIUwz','args','pnpm-lock.yaml','watch','Script\x20name\x20defined\x20in\x20package.json','boolean','needsUpgrade','Run\x20a\x20package.json\x20script','\x20run\x20<script>\x0a','154524XKSpPs','all','\x20exited\x20with\x20code\x20','start','npm','12768960MdVpcC','\x20run\x20start','\x20run\x20','belowMinimum','pnpm','bun.lock','\x20run\x20preview\x20--watch','\x20\x20\x20\x20','node_modules','join','inherit','validation','push','\x0a\x20\x20Available\x20scripts:\x0a','--watch','bun.lockb','168770dptoBm','cwd','276xjScYN','vite\x20preview\x20exited\x20with\x20code\x20','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','Enable\x20watch\x20mode\x20for\x20preview'];a152_0x4828=function(){return _0x37e394;};return a152_0x4828();}function spawnScript(_0x22ebaa,_0x349f18,_0x5daf12,_0x5f97fa){return new Promise((_0x48208d,_0x3a0102)=>{const _0xfdb8bb=a152_0x14c0,_0x3cd759=[_0xfdb8bb(0x127),_0x349f18,..._0x5daf12],_0x2360d3=spawn(_0x22ebaa,_0x3cd759,{'cwd':_0x5f97fa,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x5f97fa,_0xfdb8bb(0x147),_0xfdb8bb(0x12b))+delimiter+process.env.PATH}});_0x2360d3['on'](_0xfdb8bb(0x11a),_0x1dffeb=>{const _0x1f6bee=_0xfdb8bb;if(_0x1dffeb===0x0||_0x1dffeb===null)_0x48208d();else _0x3a0102(new Error(_0x22ebaa+_0x1f6bee(0x141)+_0x349f18+_0x1f6bee(0x13c)+_0x1dffeb));}),_0x2360d3['on']('error',_0x3a0102);});}function spawnViteBuildWatch(_0xb57963){return new Promise((_0x2166a0,_0x38846c)=>{const _0x5d00ad=a152_0x14c0,_0x2ba976=spawn(_0x5d00ad(0x12f),[_0x5d00ad(0x130),_0x5d00ad(0x107)],{'cwd':_0xb57963,'stdio':_0x5d00ad(0x149),'shell':!![],'env':{...process.env,'PATH':''+join(_0xb57963,_0x5d00ad(0x147),_0x5d00ad(0x12b))+delimiter+process.env.PATH}});_0x2ba976['on']('close',_0x55cb9f=>{const _0x510573=_0x5d00ad;if(_0x55cb9f===0x0||_0x55cb9f===null)_0x2166a0();else _0x38846c(new Error(_0x510573(0x10d)+_0x55cb9f));}),_0x2ba976['on'](_0x5d00ad(0x118),_0x38846c);});}function spawnVitePreview(_0x24aedb){return new Promise((_0x590867,_0x11c939)=>{const _0x49fbfc=a152_0x14c0,_0x4b7916=spawn('vite',[_0x49fbfc(0x129)],{'cwd':_0x24aedb,'stdio':_0x49fbfc(0x149),'shell':!![],'env':{...process.env,'PATH':''+join(_0x24aedb,_0x49fbfc(0x147),_0x49fbfc(0x12b))+delimiter+process.env.PATH}});_0x4b7916['on'](_0x49fbfc(0x11a),_0x3fa229=>{const _0x1b2c44=_0x49fbfc;if(_0x3fa229===0x0||_0x3fa229===null)_0x590867();else _0x11c939(new Error(_0x1b2c44(0x10c)+_0x3fa229));}),_0x4b7916['on'](_0x49fbfc(0x118),_0x11c939);});}const runFlags=[{'name':a152_0x2db26(0x134),'type':a152_0x2db26(0x136),'description':a152_0x2db26(0x10e),'default':![]}];export const runDefinition={'service':'run','command':'run','description':a152_0x2db26(0x138),'risk':a152_0x2db26(0x128),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a152_0x2db26(0x110),'description':a152_0x2db26(0x135),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x4999f6=a152_0x2db26,_0x5a8d13=[];return _0x5a8d13[_0x4999f6(0x14b)]('\x20\x20EXAMPLES'),_0x5a8d13[_0x4999f6(0x14b)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x4999f6(0x140)),_0x5a8d13['push'](_0x4999f6(0x146)+CLI_BIN_NAME+_0x4999f6(0x122)),_0x5a8d13[_0x4999f6(0x14b)](_0x4999f6(0x146)+CLI_BIN_NAME+_0x4999f6(0x116)),_0x5a8d13[_0x4999f6(0x14b)](_0x4999f6(0x146)+CLI_BIN_NAME+_0x4999f6(0x145)),_0x5a8d13[_0x4999f6(0x148)]('\x0a');},async 'execute'(_0x11c3eb){const _0x4abbd8=a152_0x2db26,_0x4e7167=process[_0x4abbd8(0x10a)](),_0x3b2633=_0x11c3eb[_0x4abbd8(0x132)][0x0],_0x1d2fe5=_0x11c3eb['args'][_0x4abbd8(0x12d)](0x1),_0x26b0c8=readPackageScripts(_0x4e7167);if(!_0x26b0c8)throw CliErrors[_0x4abbd8(0x14a)](_0x4abbd8(0x12c));if(!_0x3b2633){const _0x32546e=Object[_0x4abbd8(0x113)](_0x26b0c8);if(_0x32546e[_0x4abbd8(0x111)]===0x0)console[_0x4abbd8(0x11c)](_0x4abbd8(0x11e));else{console[_0x4abbd8(0x11c)](_0x4abbd8(0x14c));for(const _0x4fbcf8 of _0x32546e){console[_0x4abbd8(0x11c)](_0x4abbd8(0x146)+_0x4fbcf8);}console['log'](_0x4abbd8(0x123)+CLI_BIN_NAME+_0x4abbd8(0x139));}return{'ok':!![]};}if(!_0x26b0c8[_0x3b2633])throw CliErrors['validation'](_0x4abbd8(0x12e)+_0x3b2633+'\x22\x20not\x20found\x20in\x20package.json.',_0x4abbd8(0x120)+(Object[_0x4abbd8(0x113)](_0x26b0c8)[_0x4abbd8(0x148)](',\x20')||_0x4abbd8(0x112)));const _0x5e39ae=detectPackageManager(_0x4e7167);VERSION_CHECK_SCRIPTS[_0x4abbd8(0x11f)](_0x3b2633)&&await versionCheck(_0x4e7167);if(_0x3b2633===_0x4abbd8(0x129)&&_0x11c3eb[_0x4abbd8(0x119)]('watch'))return await Promise[_0x4abbd8(0x13b)]([spawnViteBuildWatch(_0x4e7167),spawnVitePreview(_0x4e7167)]),{'ok':!![]};return await spawnScript(_0x5e39ae,_0x3b2633,_0x1d2fe5,_0x4e7167),{'ok':!![]};}};
@@ -1 +1 @@
1
- const a153_0x318e99=a153_0x3b62;(function(_0x57b0fb,_0xe53a61){const _0xfe0421=a153_0x3b62,_0x18dd51=_0x57b0fb();while(!![]){try{const _0x7cc052=-parseInt(_0xfe0421(0xe0))/0x1+-parseInt(_0xfe0421(0xe1))/0x2+-parseInt(_0xfe0421(0xe2))/0x3*(-parseInt(_0xfe0421(0xde))/0x4)+parseInt(_0xfe0421(0xdc))/0x5+parseInt(_0xfe0421(0xe5))/0x6+-parseInt(_0xfe0421(0xe6))/0x7*(-parseInt(_0xfe0421(0xe3))/0x8)+parseInt(_0xfe0421(0xe7))/0x9;if(_0x7cc052===_0xe53a61)break;else _0x18dd51['push'](_0x18dd51['shift']());}catch(_0x255a5a){_0x18dd51['push'](_0x18dd51['shift']());}}}(a153_0x3d89,0x29455));import{buildSchemaPayload}from'../framework/schema-export.js';function a153_0x3b62(_0x3846d7,_0x9acfdd){_0x3846d7=_0x3846d7-0xdc;const _0x3d8958=a153_0x3d89();let _0x3b62b5=_0x3d8958[_0x3846d7];return _0x3b62b5;}async function execute(_0x636472){const _0x416a94=await buildSchemaPayload();return{'ok':!![],'data':_0x416a94};}export const schemaDefinition={'service':a153_0x318e99(0xdd),'command':'export','description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a153_0x318e99(0xe4),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a153_0x318e99(0xdf),'flags':[],'execute':execute};function a153_0x3d89(){const _0x4c6164=['8gbqDxf','read','454290RTjvZH','579089kwurEJ','1071972oCEVEV','471040wLVwbS','schema','291012MDYUzq','json','125922HUrTeB','590100BgMMxu','9IRhIKr'];a153_0x3d89=function(){return _0x4c6164;};return a153_0x3d89();}
1
+ const a153_0x439f15=a153_0x3cbb;(function(_0x1069e4,_0x27ac12){const _0x3dd3e0=a153_0x3cbb,_0x392804=_0x1069e4();while(!![]){try{const _0x422295=-parseInt(_0x3dd3e0(0xe8))/0x1*(-parseInt(_0x3dd3e0(0xe7))/0x2)+-parseInt(_0x3dd3e0(0xe1))/0x3*(parseInt(_0x3dd3e0(0xe6))/0x4)+parseInt(_0x3dd3e0(0xdb))/0x5+parseInt(_0x3dd3e0(0xe4))/0x6+-parseInt(_0x3dd3e0(0xdd))/0x7*(parseInt(_0x3dd3e0(0xde))/0x8)+parseInt(_0x3dd3e0(0xe0))/0x9+-parseInt(_0x3dd3e0(0xdf))/0xa;if(_0x422295===_0x27ac12)break;else _0x392804['push'](_0x392804['shift']());}catch(_0x26ab4c){_0x392804['push'](_0x392804['shift']());}}}(a153_0xc033,0x2add4));import{buildSchemaPayload}from'../framework/schema-export.js';function a153_0x3cbb(_0x235582,_0x1391f0){_0x235582=_0x235582-0xdb;const _0xc0333f=a153_0xc033();let _0x3cbba9=_0xc0333f[_0x235582];return _0x3cbba9;}async function execute(_0x2238a6){const _0x189278=await buildSchemaPayload();return{'ok':!![],'data':_0x189278};}function a153_0xc033(){const _0x2f92b3=['read','1766352qhcwCx','schema','12ZNAsHp','2FXGhjM','246784tjBFuE','1445795BeXEkS','Export\x20machine-readable\x20command\x20schema\x20(JSON)','402843OCGhcU','24gJoBoH','5679730yENIxw','1447902tDoYfq','75021BpArlR','json'];a153_0xc033=function(){return _0x2f92b3;};return a153_0xc033();}export const schemaDefinition={'service':a153_0x439f15(0xe5),'command':'export','description':a153_0x439f15(0xdc),'risk':a153_0x439f15(0xe3),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a153_0x439f15(0xe2),'flags':[],'execute':execute};
@@ -1 +1 @@
1
- const a154_0x48826e=a154_0x426d;(function(_0x25271c,_0x42e9c1){const _0x2ba92c=a154_0x426d,_0x3004ff=_0x25271c();while(!![]){try{const _0x1faf7f=-parseInt(_0x2ba92c(0x1ac))/0x1+-parseInt(_0x2ba92c(0x16e))/0x2*(parseInt(_0x2ba92c(0x1a3))/0x3)+parseInt(_0x2ba92c(0x184))/0x4+-parseInt(_0x2ba92c(0x18f))/0x5*(parseInt(_0x2ba92c(0x16f))/0x6)+-parseInt(_0x2ba92c(0x178))/0x7*(parseInt(_0x2ba92c(0x19f))/0x8)+parseInt(_0x2ba92c(0x187))/0x9+parseInt(_0x2ba92c(0x189))/0xa;if(_0x1faf7f===_0x42e9c1)break;else _0x3004ff['push'](_0x3004ff['shift']());}catch(_0x1f3cdd){_0x3004ff['push'](_0x3004ff['shift']());}}}(a154_0x16d7,0x1c360));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';function a154_0x426d(_0x36bbee,_0x2b7a5a){_0x36bbee=_0x36bbee-0x16d;const _0x16d79e=a154_0x16d7();let _0x426d2b=_0x16d79e[_0x36bbee];return _0x426d2b;}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x3590f5){const _0x3de08a=a154_0x426d;if(_0x3590f5==='mybatisXml')return['<select\x20id=\x22query\x22\x20resultType=\x22map\x22>',_0x3de08a(0x1a9),'</select>',''][_0x3de08a(0x17d)]('\x0a');return[_0x3de08a(0x1a7),''][_0x3de08a(0x17d)]('\x0a');}export const sqlCreate={'service':a154_0x48826e(0x1ad),'command':a154_0x48826e(0x1a4),'description':a154_0x48826e(0x1a0),'risk':'high-risk-write','flags':[{'name':a154_0x48826e(0x17b),'type':a154_0x48826e(0x1a8),'description':a154_0x48826e(0x177)},{'name':a154_0x48826e(0x171),'type':'number','description':a154_0x48826e(0x1aa)},{'name':'mode','type':'string','enum':['sql','mybatisXml'],'description':'Local\x20SQL\x20file\x20mode'}],async 'validate'(_0x30923c){const _0x4c9a3a=a154_0x48826e;if(!_0x30923c[_0x4c9a3a(0x18c)])return;if(!_0x30923c[_0x4c9a3a(0x190)]('name')[_0x4c9a3a(0x17f)]())throw CliErrors['flagMissing'](_0x4c9a3a(0x17b),_0x4c9a3a(0x17c));const _0x53f12d=resolveProvidedDbId(_0x30923c);if(typeof _0x53f12d!==_0x4c9a3a(0x19c)||!Number[_0x4c9a3a(0x195)](_0x53f12d)||_0x53f12d<=0x0)throw CliErrors[_0x4c9a3a(0x196)](_0x4c9a3a(0x171),_0x4c9a3a(0x191));if(!_0x30923c[_0x4c9a3a(0x190)](_0x4c9a3a(0x192))[_0x4c9a3a(0x17f)]())throw CliErrors[_0x4c9a3a(0x196)](_0x4c9a3a(0x192),_0x4c9a3a(0x183));},async 'dryRun'(_0x3e12bb){const _0x1948f2=a154_0x48826e,_0x3ba0b4=loadSqlProjectConfig(_0x3e12bb['appCode']),{sqlName:_0x284cab,dbId:_0x3cf03d,dbName:_0x1cf78c,mode:_0x324f03}=await resolveSqlNewInputs(_0x3e12bb),_0x25e3c9=buildSqlRelativePath(_0x1948f2(0x194),_0x284cab,_0x1cf78c,_0x324f03,_0x3cf03d),_0x257236=_0x3ba0b4[_0x1948f2(0x19d)]+'/'+_0x25e3c9;return{'method':'POST','url':'/smartapi/custom/saveUserCustomSql','body':{'appCode':_0x3e12bb[_0x1948f2(0x174)],'sqlName':_0x284cab,'dbId':_0x3cf03d,'mode':_0x324f03,'localPath':_0x257236},'description':_0x1948f2(0x186)+_0x3ba0b4[_0x1948f2(0x19d)]};},async 'execute'(_0x4a6f5c){const _0x57a324=a154_0x48826e,_0x334aa9=loadSqlProjectConfig(_0x4a6f5c[_0x57a324(0x174)]),{sqlName:_0x1119bd,dbId:_0x2d6bbb,dbName:_0x13b253,mode:_0x304272}=await resolveSqlNewInputs(_0x4a6f5c),_0x37cc84=generateSqlTemplate(_0x304272),_0x59d33f=await createSqlQuery({'appCode':_0x4a6f5c[_0x57a324(0x174)],'sqlName':_0x1119bd,'dbId':_0x2d6bbb,'sqlContent':_0x37cc84}),_0x30541a=ensureRemoteSqlContent(_0x59d33f),_0x80d6f9=_0x13b253||await getDbName(_0x4a6f5c['appCode'],_0x2d6bbb)[_0x57a324(0x1a2)](()=>undefined),_0x2fa8e3=buildSqlRelativePath(_0x59d33f[_0x57a324(0x19a)],_0x59d33f[_0x57a324(0x1a6)],_0x80d6f9,_0x304272,_0x2d6bbb),_0x1107be=_0x334aa9[_0x57a324(0x19d)]+'/'+_0x2fa8e3,_0x22ba3a=buildLocalSqlFileContent({'sqlCode':_0x59d33f[_0x57a324(0x19a)],'sqlName':_0x59d33f[_0x57a324(0x1a6)],'dbId':_0x59d33f[_0x57a324(0x185)]},_0x30541a,{'dbName':_0x80d6f9,'mode':_0x304272,'syncedAt':new Date()['toISOString'](),'description':_0x59d33f[_0x57a324(0x198)]});if(await fileExists(_0x1107be))throw CliErrors[_0x57a324(0x19b)](_0x57a324(0x182)+_0x1107be);await ensureParentDirectory(_0x1107be),await writeFile(_0x1107be,_0x22ba3a,_0x57a324(0x179));const _0x510200=await readSqlLockFile(_0x334aa9['lockFilePath']),{lockData:_0x56b6fe,appLock:_0x1a7f39}=ensureSqlLockScope(_0x510200??createEmptySqlLock(),_0x334aa9[_0x57a324(0x174)],_0x334aa9['sqlRoot'],_0x57a324(0x18b));return _0x1a7f39[_0x57a324(0x199)][_0x59d33f[_0x57a324(0x19a)]]={...buildSqlLockEntry(_0x59d33f,_0x30541a,computeSqlContentHash(_0x22ba3a),{'dbName':_0x80d6f9}),'path':_0x2fa8e3,'mode':_0x304272},_0x1a7f39[_0x57a324(0x193)]=new Date()[_0x57a324(0x1a1)](),await writeSqlLockFile(_0x334aa9[_0x57a324(0x181)],_0x56b6fe),{'ok':!![],'data':{'id':_0x59d33f['id'],'sqlCode':_0x59d33f['sqlCode'],'sqlName':_0x59d33f[_0x57a324(0x1a6)],'dbId':_0x59d33f[_0x57a324(0x185)],'path':_0x1107be,'mode':_0x304272},'message':'Created\x20SQL\x20query\x20'+_0x59d33f[_0x57a324(0x19a)]};}};async function resolveSqlNewInputs(_0xff77fe){const _0x37fbb2=await resolveSqlNameInput(_0xff77fe),{dbId:_0x51e888,dbName:_0x48387b}=await resolveDbSelection(_0xff77fe),_0x39267d=await resolveSqlModeInput(_0xff77fe);return{'sqlName':_0x37fbb2,'dbId':_0x51e888,'dbName':_0x48387b,'mode':_0x39267d};}function a154_0x16d7(){const _0x2cb065=['stringify','appCode','length','flag','SQL\x20query\x20display\x20name','14zHObaG','utf8','isInteger','name','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','join','__manual__','trim','dbId\x20不能为空','lockFilePath','File\x20already\x20exists:\x20','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','214264arZtKE','dbId','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','519687cUPtDD','parse','5809440XzzyNF','dbId\x20必须为正整数','new','nonInteractive','普通\x20SQL(sql)','请选择本地\x20SQL\x20模式:','22735hqryTb','str','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','mode','lastSync','<server-generated-sqlCode>','isFinite','flagMissing','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','description','sqls','sqlCode','validation','number','sqlRootDir','SQL\x20名称不能为空','783856FJIjJI','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','toISOString','catch','663603yvfitF','create','Invalid\x20database\x20selection\x20payload:\x20','sqlName','SELECT\x201\x20AS\x20id;','string','\x20\x20SELECT\x201\x20AS\x20id','Target\x20database\x20ID','请选择目标数据库:','45861IppeNK','sql','MyBatis\x20XML(mybatisXml)','2xxvCrA','150oueKuc','mybatisXml','db-id','dbName'];a154_0x16d7=function(){return _0x2cb065;};return a154_0x16d7();}async function resolveSqlNameInput(_0x10aad1){const _0x556403=a154_0x48826e,_0x273fc4=_0x10aad1[_0x556403(0x190)](_0x556403(0x17b))['trim']();if(_0x273fc4)return _0x273fc4;if(_0x10aad1['nonInteractive'])throw CliErrors['flagMissing']('name',_0x556403(0x17c));return(await input({'message':'请输入\x20SQL\x20名称:','validate':_0x3d2bc5=>_0x3d2bc5['trim']()?!![]:_0x556403(0x19e)}))[_0x556403(0x17f)]();}async function resolveDbSelection(_0xd8b5a8){const _0x347eb8=a154_0x48826e,_0x53b962=resolveProvidedDbId(_0xd8b5a8);if(typeof _0x53b962==='number'&&Number[_0x347eb8(0x195)](_0x53b962)&&_0x53b962>0x0)return{'dbId':_0x53b962,'dbName':await getDbName(_0xd8b5a8[_0x347eb8(0x174)],_0x53b962)[_0x347eb8(0x1a2)](()=>undefined)};if(_0xd8b5a8[_0x347eb8(0x18c)])throw CliErrors[_0x347eb8(0x196)](_0x347eb8(0x171),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x34329e=await listDatabases(_0xd8b5a8[_0x347eb8(0x174)])[_0x347eb8(0x1a2)](()=>[]);if(_0x34329e[_0x347eb8(0x175)]===0x1)return{'dbId':_0x34329e[0x0]['dbId'],'dbName':_0x34329e[0x0][_0x347eb8(0x172)]};if(_0x34329e[_0x347eb8(0x175)]>0x1){const _0x48e863=await select({'message':_0x347eb8(0x1ab),'choices':[..._0x34329e['map'](_0x3fa1a0=>({'name':_0x3fa1a0[_0x347eb8(0x172)]+'\x20('+_0x3fa1a0[_0x347eb8(0x185)]+')','value':serializeDbSelection(_0x3fa1a0)})),{'name':'✎\x20手动输入\x20dbId','value':'__manual__'}]});if(_0x48e863!==_0x347eb8(0x17e))return deserializeDbSelection(_0x48e863);}const _0x323279=await input({'message':'请输入目标数据库\x20dbId:','validate':_0x125209=>{const _0x2aedf3=_0x347eb8,_0x347bef=_0x125209['trim']();if(!_0x347bef)return _0x2aedf3(0x180);const _0x8816f9=Number(_0x347bef);if(!Number[_0x2aedf3(0x17a)](_0x8816f9)||_0x8816f9<=0x0)return _0x2aedf3(0x18a);return!![];}});return{'dbId':Number(_0x323279[_0x347eb8(0x17f)]())};}async function resolveSqlModeInput(_0x39e985){const _0x2cf719=a154_0x48826e,_0x2713fd=_0x39e985[_0x2cf719(0x190)](_0x2cf719(0x192))[_0x2cf719(0x17f)]();if(_0x2713fd===_0x2cf719(0x1ad)||_0x2713fd==='mybatisXml')return _0x2713fd;if(_0x39e985[_0x2cf719(0x18c)])throw CliErrors[_0x2cf719(0x196)](_0x2cf719(0x192),_0x2cf719(0x183));return await select({'message':_0x2cf719(0x18e),'choices':[{'name':_0x2cf719(0x18d),'value':_0x2cf719(0x1ad),'description':_0x2cf719(0x197)},{'name':_0x2cf719(0x16d),'value':_0x2cf719(0x170),'description':'适合带动态标签的\x20MyBatis\x20XML\x20SQL'}]});}function serializeDbSelection(_0x47be0c){const _0x24b432=a154_0x48826e;return JSON[_0x24b432(0x173)]({'dbId':_0x47be0c['dbId'],'dbName':_0x47be0c['dbName']});}function deserializeDbSelection(_0x4c3a1d){const _0x1b0cee=a154_0x48826e;try{const _0x25e151=JSON[_0x1b0cee(0x188)](_0x4c3a1d);if(typeof _0x25e151[_0x1b0cee(0x185)]===_0x1b0cee(0x19c)&&Number['isFinite'](_0x25e151[_0x1b0cee(0x185)]))return{'dbId':_0x25e151[_0x1b0cee(0x185)],'dbName':_0x25e151['dbName']};}catch{}throw CliErrors[_0x1b0cee(0x19b)](_0x1b0cee(0x1a5)+_0x4c3a1d);}function resolveProvidedDbId(_0x2ea61e){const _0xb4f694=a154_0x48826e,_0x364c99=_0x2ea61e[_0xb4f694(0x176)](_0xb4f694(0x171));if(typeof _0x364c99===_0xb4f694(0x19c)&&Number['isFinite'](_0x364c99))return _0x364c99;return undefined;}
1
+ const a154_0x157fd8=a154_0x5587;(function(_0x588dd0,_0x329d63){const _0x20a8a4=a154_0x5587,_0x2927f8=_0x588dd0();while(!![]){try{const _0x298708=-parseInt(_0x20a8a4(0x11b))/0x1+parseInt(_0x20a8a4(0x102))/0x2*(-parseInt(_0x20a8a4(0xf8))/0x3)+parseInt(_0x20a8a4(0x111))/0x4+parseInt(_0x20a8a4(0xff))/0x5+parseInt(_0x20a8a4(0x10a))/0x6*(-parseInt(_0x20a8a4(0xf6))/0x7)+-parseInt(_0x20a8a4(0xfe))/0x8+parseInt(_0x20a8a4(0x119))/0x9;if(_0x298708===_0x329d63)break;else _0x2927f8['push'](_0x2927f8['shift']());}catch(_0x57e2b2){_0x2927f8['push'](_0x2927f8['shift']());}}}(a154_0x18dd,0xaf58a));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';function a154_0x5587(_0x470e8e,_0x151cbf){_0x470e8e=_0x470e8e-0xf2;const _0x18dda6=a154_0x18dd();let _0x55873d=_0x18dda6[_0x470e8e];return _0x55873d;}import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';function a154_0x18dd(){const _0x215a85=['mode','Invalid\x20database\x20selection\x20payload:\x20','sqlName','description','trim','SQL\x20query\x20display\x20name','12800529JRTvZc','普通\x20SQL(sql)','166614OIVPxy','dbId','high-risk-write','isFinite','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','flagMissing','dbName','sqlCode','请选择本地\x20SQL\x20模式:','length','catch','sqlRoot','map','/smartapi/custom/saveUserCustomSql','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','mybatisXml','Local\x20SQL\x20file\x20mode','sql','lastSync','validation','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','__manual__','dbId\x20必须为正整数','File\x20already\x20exists:\x20','请输入\x20SQL\x20名称:','请选择目标数据库:','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','<server-generated-sqlCode>','POST','nonInteractive','Created\x20SQL\x20query\x20','SQL\x20名称不能为空','6293UqnkUf','utf8','3Lfnphj','SELECT\x201\x20AS\x20id;','dbId\x20不能为空','lockFilePath','MyBatis\x20XML(mybatisXml)','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','7993072LBsTdQ','2479680brWdyJ','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','适合带动态标签的\x20MyBatis\x20XML\x20SQL','232802yDmVkZ','number','str','db-id','string','new','sqlRootDir','✎\x20手动输入\x20dbId','2316Lzorzf','join','sqls','toISOString','name','isInteger','appCode','1716656mWdxbl','</select>'];a154_0x18dd=function(){return _0x215a85;};return a154_0x18dd();}import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x3b47b7){const _0x56bc8e=a154_0x5587;if(_0x3b47b7===_0x56bc8e(0x12a))return[_0x56bc8e(0x129),'\x20\x20SELECT\x201\x20AS\x20id',_0x56bc8e(0x112),''][_0x56bc8e(0x10b)]('\x0a');return[_0x56bc8e(0xf9),''][_0x56bc8e(0x10b)]('\x0a');}export const sqlCreate={'service':a154_0x157fd8(0x12c),'command':'create','description':'Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','risk':a154_0x157fd8(0x11d),'flags':[{'name':a154_0x157fd8(0x10e),'type':a154_0x157fd8(0x106),'description':a154_0x157fd8(0x118)},{'name':'db-id','type':'number','description':'Target\x20database\x20ID'},{'name':'mode','type':'string','enum':['sql','mybatisXml'],'description':a154_0x157fd8(0x12b)}],async 'validate'(_0x2d04bd){const _0x2b10d8=a154_0x157fd8;if(!_0x2d04bd[_0x2b10d8(0xf3)])return;if(!_0x2d04bd[_0x2b10d8(0x104)](_0x2b10d8(0x10e))[_0x2b10d8(0x117)]())throw CliErrors[_0x2b10d8(0x120)](_0x2b10d8(0x10e),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x3a079e=resolveProvidedDbId(_0x2d04bd);if(typeof _0x3a079e!=='number'||!Number[_0x2b10d8(0x11e)](_0x3a079e)||_0x3a079e<=0x0)throw CliErrors['flagMissing'](_0x2b10d8(0x105),_0x2b10d8(0x135));if(!_0x2d04bd['str'](_0x2b10d8(0x113))[_0x2b10d8(0x117)]())throw CliErrors[_0x2b10d8(0x120)]('mode',_0x2b10d8(0x12f));},async 'dryRun'(_0x5a7cad){const _0x3b6220=a154_0x157fd8,_0x137ed5=loadSqlProjectConfig(_0x5a7cad[_0x3b6220(0x110)]),{sqlName:_0x5c3bed,dbId:_0x59d3aa,dbName:_0x2c319f,mode:_0x40b509}=await resolveSqlNewInputs(_0x5a7cad),_0x2f061e=buildSqlRelativePath(_0x3b6220(0x136),_0x5c3bed,_0x2c319f,_0x40b509,_0x59d3aa),_0x5223cd=_0x137ed5[_0x3b6220(0x108)]+'/'+_0x2f061e;return{'method':_0x3b6220(0xf2),'url':_0x3b6220(0x128),'body':{'appCode':_0x5a7cad[_0x3b6220(0x110)],'sqlName':_0x5c3bed,'dbId':_0x59d3aa,'mode':_0x40b509,'localPath':_0x5223cd},'description':_0x3b6220(0x11f)+_0x137ed5[_0x3b6220(0x108)]};},async 'execute'(_0x19e64c){const _0x313ee3=a154_0x157fd8,_0xf5370=loadSqlProjectConfig(_0x19e64c['appCode']),{sqlName:_0x13dabd,dbId:_0x4fd21b,dbName:_0x4dd741,mode:_0x5d044c}=await resolveSqlNewInputs(_0x19e64c),_0x978e14=generateSqlTemplate(_0x5d044c),_0xdf8345=await createSqlQuery({'appCode':_0x19e64c[_0x313ee3(0x110)],'sqlName':_0x13dabd,'dbId':_0x4fd21b,'sqlContent':_0x978e14}),_0x20221a=ensureRemoteSqlContent(_0xdf8345),_0x2d6996=_0x4dd741||await getDbName(_0x19e64c[_0x313ee3(0x110)],_0x4fd21b)[_0x313ee3(0x125)](()=>undefined),_0x21c158=buildSqlRelativePath(_0xdf8345['sqlCode'],_0xdf8345[_0x313ee3(0x115)],_0x2d6996,_0x5d044c,_0x4fd21b),_0x32b715=_0xf5370[_0x313ee3(0x108)]+'/'+_0x21c158,_0x48ad3a=buildLocalSqlFileContent({'sqlCode':_0xdf8345['sqlCode'],'sqlName':_0xdf8345[_0x313ee3(0x115)],'dbId':_0xdf8345['dbId']},_0x20221a,{'dbName':_0x2d6996,'mode':_0x5d044c,'syncedAt':new Date()[_0x313ee3(0x10d)](),'description':_0xdf8345[_0x313ee3(0x116)]});if(await fileExists(_0x32b715))throw CliErrors[_0x313ee3(0x12e)](_0x313ee3(0x132)+_0x32b715);await ensureParentDirectory(_0x32b715),await writeFile(_0x32b715,_0x48ad3a,_0x313ee3(0xf7));const _0x13a539=await readSqlLockFile(_0xf5370[_0x313ee3(0xfb)]),{lockData:_0xd4c6a2,appLock:_0x58fd82}=ensureSqlLockScope(_0x13a539??createEmptySqlLock(),_0xf5370[_0x313ee3(0x110)],_0xf5370[_0x313ee3(0x126)],_0x313ee3(0x107));return _0x58fd82[_0x313ee3(0x10c)][_0xdf8345[_0x313ee3(0x122)]]={...buildSqlLockEntry(_0xdf8345,_0x20221a,computeSqlContentHash(_0x48ad3a),{'dbName':_0x2d6996}),'path':_0x21c158,'mode':_0x5d044c},_0x58fd82[_0x313ee3(0x12d)]=new Date()[_0x313ee3(0x10d)](),await writeSqlLockFile(_0xf5370[_0x313ee3(0xfb)],_0xd4c6a2),{'ok':!![],'data':{'id':_0xdf8345['id'],'sqlCode':_0xdf8345['sqlCode'],'sqlName':_0xdf8345[_0x313ee3(0x115)],'dbId':_0xdf8345[_0x313ee3(0x11c)],'path':_0x32b715,'mode':_0x5d044c},'message':_0x313ee3(0xf4)+_0xdf8345[_0x313ee3(0x122)]};}};async function resolveSqlNewInputs(_0x5c8be3){const _0x523254=await resolveSqlNameInput(_0x5c8be3),{dbId:_0x11fe8c,dbName:_0x2a0130}=await resolveDbSelection(_0x5c8be3),_0x398c70=await resolveSqlModeInput(_0x5c8be3);return{'sqlName':_0x523254,'dbId':_0x11fe8c,'dbName':_0x2a0130,'mode':_0x398c70};}async function resolveSqlNameInput(_0x325837){const _0x5c6ee9=a154_0x157fd8,_0x19c06f=_0x325837['str']('name')['trim']();if(_0x19c06f)return _0x19c06f;if(_0x325837[_0x5c6ee9(0xf3)])throw CliErrors[_0x5c6ee9(0x120)]('name',_0x5c6ee9(0x100));return(await input({'message':_0x5c6ee9(0x133),'validate':_0x28bf2d=>_0x28bf2d['trim']()?!![]:_0x5c6ee9(0xf5)}))['trim']();}async function resolveDbSelection(_0x3e636c){const _0x1e6244=a154_0x157fd8,_0x2c47f1=resolveProvidedDbId(_0x3e636c);if(typeof _0x2c47f1==='number'&&Number[_0x1e6244(0x11e)](_0x2c47f1)&&_0x2c47f1>0x0)return{'dbId':_0x2c47f1,'dbName':await getDbName(_0x3e636c[_0x1e6244(0x110)],_0x2c47f1)[_0x1e6244(0x125)](()=>undefined)};if(_0x3e636c['nonInteractive'])throw CliErrors[_0x1e6244(0x120)]('db-id','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x12658a=await listDatabases(_0x3e636c[_0x1e6244(0x110)])[_0x1e6244(0x125)](()=>[]);if(_0x12658a[_0x1e6244(0x124)]===0x1)return{'dbId':_0x12658a[0x0]['dbId'],'dbName':_0x12658a[0x0][_0x1e6244(0x121)]};if(_0x12658a[_0x1e6244(0x124)]>0x1){const _0x4a0a2a=await select({'message':_0x1e6244(0x134),'choices':[..._0x12658a[_0x1e6244(0x127)](_0x2bc70d=>({'name':_0x2bc70d[_0x1e6244(0x121)]+'\x20('+_0x2bc70d['dbId']+')','value':serializeDbSelection(_0x2bc70d)})),{'name':_0x1e6244(0x109),'value':_0x1e6244(0x130)}]});if(_0x4a0a2a!==_0x1e6244(0x130))return deserializeDbSelection(_0x4a0a2a);}const _0x2e6331=await input({'message':'请输入目标数据库\x20dbId:','validate':_0x2dffa6=>{const _0x235958=_0x1e6244,_0x312f12=_0x2dffa6['trim']();if(!_0x312f12)return _0x235958(0xfa);const _0x2d4191=Number(_0x312f12);if(!Number[_0x235958(0x10f)](_0x2d4191)||_0x2d4191<=0x0)return _0x235958(0x131);return!![];}});return{'dbId':Number(_0x2e6331['trim']())};}async function resolveSqlModeInput(_0x1f5b1b){const _0x48cdf7=a154_0x157fd8,_0x3cae12=_0x1f5b1b['str'](_0x48cdf7(0x113))[_0x48cdf7(0x117)]();if(_0x3cae12===_0x48cdf7(0x12c)||_0x3cae12===_0x48cdf7(0x12a))return _0x3cae12;if(_0x1f5b1b[_0x48cdf7(0xf3)])throw CliErrors[_0x48cdf7(0x120)](_0x48cdf7(0x113),_0x48cdf7(0x12f));return await select({'message':_0x48cdf7(0x123),'choices':[{'name':_0x48cdf7(0x11a),'value':'sql','description':_0x48cdf7(0xfd)},{'name':_0x48cdf7(0xfc),'value':_0x48cdf7(0x12a),'description':_0x48cdf7(0x101)}]});}function serializeDbSelection(_0x4fbbab){const _0x4cb7da=a154_0x157fd8;return JSON['stringify']({'dbId':_0x4fbbab[_0x4cb7da(0x11c)],'dbName':_0x4fbbab[_0x4cb7da(0x121)]});}function deserializeDbSelection(_0xb704f4){const _0x19d23f=a154_0x157fd8;try{const _0x46a84e=JSON['parse'](_0xb704f4);if(typeof _0x46a84e[_0x19d23f(0x11c)]===_0x19d23f(0x103)&&Number['isFinite'](_0x46a84e[_0x19d23f(0x11c)]))return{'dbId':_0x46a84e['dbId'],'dbName':_0x46a84e[_0x19d23f(0x121)]};}catch{}throw CliErrors[_0x19d23f(0x12e)](_0x19d23f(0x114)+_0xb704f4);}function resolveProvidedDbId(_0x373a4d){const _0x3cfd0f=a154_0x157fd8,_0x1584f8=_0x373a4d['flag']('db-id');if(typeof _0x1584f8===_0x3cfd0f(0x103)&&Number['isFinite'](_0x1584f8))return _0x1584f8;return undefined;}
@@ -1 +1 @@
1
- const a155_0x3b6913=a155_0x24e8;(function(_0x15589a,_0x1899ba){const _0x3f4ef6=a155_0x24e8,_0x3dfe8f=_0x15589a();while(!![]){try{const _0x3fe606=parseInt(_0x3f4ef6(0x125))/0x1*(-parseInt(_0x3f4ef6(0x11b))/0x2)+parseInt(_0x3f4ef6(0x10e))/0x3+-parseInt(_0x3f4ef6(0x11f))/0x4*(-parseInt(_0x3f4ef6(0x108))/0x5)+-parseInt(_0x3f4ef6(0x107))/0x6+-parseInt(_0x3f4ef6(0x10a))/0x7*(-parseInt(_0x3f4ef6(0x124))/0x8)+-parseInt(_0x3f4ef6(0x111))/0x9+-parseInt(_0x3f4ef6(0x11a))/0xa*(-parseInt(_0x3f4ef6(0x103))/0xb);if(_0x3fe606===_0x1899ba)break;else _0x3dfe8f['push'](_0x3dfe8f['shift']());}catch(_0xffc7d7){_0x3dfe8f['push'](_0x3dfe8f['shift']());}}}(a155_0x2056,0xeb130));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';function a155_0x2056(){const _0x4ec8a1=['toISOString','str','148056QGupUj','sqlRoot','sql','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','validation','79896NJUmfg','539950tdeofo','1838001XwonAd','projectRoot','high-risk-write','length','6810648hJnjol','10gjWwmq','sqlcode','427OYEWsO','trashDir','delete','replace','3867213ToyQxA','lastSync','startsWith','3840003OSVELV','appCode','trashedTo','lockFilePath','sqls','remoteId','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','POST','/smartapi/custom/deleteUserCustomSql','130FAEFgg','6TKNIYp','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22'];a155_0x2056=function(){return _0x4ec8a1;};return a155_0x2056();}import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';function a155_0x24e8(_0x168053,_0x54781f){_0x168053=_0x168053-0x103;const _0x205602=a155_0x2056();let _0x24e8d5=_0x205602[_0x168053];return _0x24e8d5;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a155_0x3b6913(0x121),'command':a155_0x3b6913(0x10c),'description':a155_0x3b6913(0x117),'risk':a155_0x3b6913(0x105),'flags':[SQLCODE_FLAG],async 'validate'(_0x232843){const _0x96122d=a155_0x3b6913,_0x55ddb9=loadSqlProjectConfig(_0x232843['appCode']),_0x16cf36=await readSqlLockFile(_0x55ddb9[_0x96122d(0x114)]);if(!_0x16cf36)throw CliErrors[_0x96122d(0x123)](_0x96122d(0x122));},async 'dryRun'(_0x2066aa){const _0x2a8d65=a155_0x3b6913,_0x1b55a3=loadSqlProjectConfig(_0x2066aa[_0x2a8d65(0x112)]),_0x490490=await readSqlLockFile(_0x1b55a3[_0x2a8d65(0x114)]);if(!_0x490490)throw CliErrors['validation'](_0x2a8d65(0x122));const {appLock:_0x1b6226}=ensureSqlLockScope(_0x490490,_0x2066aa[_0x2a8d65(0x112)],_0x1b55a3[_0x2a8d65(0x120)],_0x2a8d65(0x10c)),_0x261bd5=_0x2066aa[_0x2a8d65(0x11e)](_0x2a8d65(0x109)),_0x2eed13=_0x1b6226['sqls'][_0x261bd5];if(!_0x2eed13)throw CliErrors[_0x2a8d65(0x123)](_0x2a8d65(0x11c)+_0x261bd5+'\x22.');return{'method':_0x2a8d65(0x118),'url':_0x2a8d65(0x119),'body':{'sqlCode':_0x261bd5,'id':_0x2eed13[_0x2a8d65(0x116)],'localPath':resolveLocalSqlFilePath(_0x1b55a3,_0x261bd5,_0x2eed13)},'description':'Would\x20delete\x20SQL\x20'+_0x261bd5+'\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20'+_0x1b55a3[_0x2a8d65(0x10b)]};},async 'execute'(_0x36e494){const _0x1e7094=a155_0x3b6913,_0x46c163=loadSqlProjectConfig(_0x36e494[_0x1e7094(0x112)]),_0x5188fc=await readSqlLockFile(_0x46c163[_0x1e7094(0x114)]);if(!_0x5188fc)throw CliErrors[_0x1e7094(0x123)]('SQL\x20lock\x20file\x20not\x20found.');const {lockData:_0x4ac785,appLock:_0x1008d0}=ensureSqlLockScope(_0x5188fc,_0x36e494[_0x1e7094(0x112)],_0x46c163[_0x1e7094(0x120)],_0x1e7094(0x10c)),_0x12f6e4=_0x36e494['str'](_0x1e7094(0x109)),_0x340537=_0x1008d0[_0x1e7094(0x115)][_0x12f6e4];if(!_0x340537)throw CliErrors['validation'](_0x1e7094(0x11c)+_0x12f6e4+'\x22.');await deleteSqlQuery({'id':_0x340537[_0x1e7094(0x116)],'sqlCode':_0x12f6e4}),_0x1008d0['sqls']=Object['fromEntries'](Object['entries'](_0x1008d0['sqls'])['filter'](([_0x48ea0c])=>_0x48ea0c!==_0x12f6e4)),_0x1008d0[_0x1e7094(0x10f)]=new Date()[_0x1e7094(0x11d)](),await writeSqlLockFile(_0x46c163[_0x1e7094(0x114)],_0x4ac785);const _0x5f098e=resolveLocalSqlFilePath(_0x46c163,_0x12f6e4,_0x340537);let _0x900115;await fileExists(_0x5f098e)&&(_0x900115=await moveToTrash(_0x46c163[_0x1e7094(0x104)],_0x46c163[_0x1e7094(0x10b)],_0x5f098e),await cleanupEmptyDirectories(dirname(_0x5f098e),_0x46c163['sqlRootDir']));const _0x230379={'deleted':_0x12f6e4,'remoteId':_0x340537['remoteId']};if(_0x900115)_0x230379[_0x1e7094(0x113)]=_0x900115;return{'ok':!![],'data':_0x230379,'message':'Deleted\x20'+_0x12f6e4+(_0x900115?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};async function moveToTrash(_0x1c4899,_0x2e5ac1,_0x4d2409){const _0x2894ad=a155_0x3b6913,_0x584404=new Date()[_0x2894ad(0x11d)]()[_0x2894ad(0x10d)](/[:.]/g,'-'),_0x5c3737=relative(_0x1c4899,_0x4d2409),_0x5820c4=join(_0x2e5ac1,_0x584404,_0x5c3737);return await mkdir(dirname(_0x5820c4),{'recursive':!![]}),await rename(_0x4d2409,_0x5820c4),_0x5820c4;}async function cleanupEmptyDirectories(_0x443a32,_0x5b48ae){const _0x188724=a155_0x3b6913;let _0x162945=resolve(_0x443a32);const _0xd621bc=resolve(_0x5b48ae);while(_0x162945[_0x188724(0x110)](''+_0xd621bc+sep)||_0x162945===_0xd621bc){if(_0x162945===_0xd621bc)return;try{const _0x4e19ae=await readdir(_0x162945);if(_0x4e19ae[_0x188724(0x106)]>0x0)return;await rmdir(_0x162945);}catch{return;}_0x162945=dirname(_0x162945);}}
1
+ const a155_0x5ab722=a155_0x4f42;(function(_0x59943c,_0x53d6a6){const _0x5c9e10=a155_0x4f42,_0x5ea636=_0x59943c();while(!![]){try{const _0x3bef4d=-parseInt(_0x5c9e10(0x19a))/0x1+-parseInt(_0x5c9e10(0x1b0))/0x2*(-parseInt(_0x5c9e10(0x1b8))/0x3)+parseInt(_0x5c9e10(0x19f))/0x4*(-parseInt(_0x5c9e10(0x1a3))/0x5)+parseInt(_0x5c9e10(0x1aa))/0x6*(parseInt(_0x5c9e10(0x196))/0x7)+parseInt(_0x5c9e10(0x1af))/0x8+parseInt(_0x5c9e10(0x1a0))/0x9+-parseInt(_0x5c9e10(0x192))/0xa;if(_0x3bef4d===_0x53d6a6)break;else _0x5ea636['push'](_0x5ea636['shift']());}catch(_0xf0e6b5){_0x5ea636['push'](_0x5ea636['shift']());}}}(a155_0x5142,0xe9e54));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';function a155_0x5142(){const _0x46858d=['8sUvySv','9394542HmWEut','SQL\x20lock\x20file\x20not\x20found.','sqlRoot','2423605MdwRwt','filter','trashDir','/smartapi/custom/deleteUserCustomSql','validation','str','trashedTo','508764lZSGju','replace','projectRoot','entries','sqlcode','12814288OfFIIv','12tttQPU','startsWith','delete','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','\x20(local\x20file\x20moved\x20to\x20trash)','appCode','sqls','Would\x20delete\x20SQL\x20','303699IAaMqd','high-risk-write','5336450PDzaGx','fromEntries','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','POST','84QmIdmJ','Deleted\x20','remoteId','length','1809427quGmjS','lockFilePath','toISOString','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20'];a155_0x5142=function(){return _0x46858d;};return a155_0x5142();}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';function a155_0x4f42(_0x3c00df,_0x4107bb){_0x3c00df=_0x3c00df-0x191;const _0x514254=a155_0x5142();let _0x4f423b=_0x514254[_0x3c00df];return _0x4f423b;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':'sql','command':'delete','description':a155_0x5ab722(0x1b3),'risk':a155_0x5ab722(0x191),'flags':[SQLCODE_FLAG],async 'validate'(_0x284df7){const _0x42732e=a155_0x5ab722,_0x22021e=loadSqlProjectConfig(_0x284df7[_0x42732e(0x1b5)]),_0x102cf5=await readSqlLockFile(_0x22021e[_0x42732e(0x19b)]);if(!_0x102cf5)throw CliErrors[_0x42732e(0x1a7)](_0x42732e(0x194));},async 'dryRun'(_0x2b925a){const _0x52dbe5=a155_0x5ab722,_0x3d24b6=loadSqlProjectConfig(_0x2b925a[_0x52dbe5(0x1b5)]),_0x3d968b=await readSqlLockFile(_0x3d24b6['lockFilePath']);if(!_0x3d968b)throw CliErrors[_0x52dbe5(0x1a7)](_0x52dbe5(0x194));const {appLock:_0x364f84}=ensureSqlLockScope(_0x3d968b,_0x2b925a[_0x52dbe5(0x1b5)],_0x3d24b6[_0x52dbe5(0x1a2)],_0x52dbe5(0x1b2)),_0x30b808=_0x2b925a[_0x52dbe5(0x1a8)](_0x52dbe5(0x1ae)),_0xf278bd=_0x364f84[_0x52dbe5(0x1b6)][_0x30b808];if(!_0xf278bd)throw CliErrors[_0x52dbe5(0x1a7)](_0x52dbe5(0x19d)+_0x30b808+'\x22.');return{'method':_0x52dbe5(0x195),'url':_0x52dbe5(0x1a6),'body':{'sqlCode':_0x30b808,'id':_0xf278bd[_0x52dbe5(0x198)],'localPath':resolveLocalSqlFilePath(_0x3d24b6,_0x30b808,_0xf278bd)},'description':_0x52dbe5(0x1b7)+_0x30b808+_0x52dbe5(0x19e)+_0x3d24b6[_0x52dbe5(0x1a5)]};},async 'execute'(_0x5388ae){const _0x16b597=a155_0x5ab722,_0x5a53e7=loadSqlProjectConfig(_0x5388ae['appCode']),_0x243cf3=await readSqlLockFile(_0x5a53e7['lockFilePath']);if(!_0x243cf3)throw CliErrors[_0x16b597(0x1a7)](_0x16b597(0x1a1));const {lockData:_0x36b54d,appLock:_0x36c3bd}=ensureSqlLockScope(_0x243cf3,_0x5388ae['appCode'],_0x5a53e7[_0x16b597(0x1a2)],_0x16b597(0x1b2)),_0xe059c9=_0x5388ae['str']('sqlcode'),_0x741ec0=_0x36c3bd[_0x16b597(0x1b6)][_0xe059c9];if(!_0x741ec0)throw CliErrors['validation'](_0x16b597(0x19d)+_0xe059c9+'\x22.');await deleteSqlQuery({'id':_0x741ec0[_0x16b597(0x198)],'sqlCode':_0xe059c9}),_0x36c3bd[_0x16b597(0x1b6)]=Object[_0x16b597(0x193)](Object[_0x16b597(0x1ad)](_0x36c3bd['sqls'])[_0x16b597(0x1a4)](([_0x4293ac])=>_0x4293ac!==_0xe059c9)),_0x36c3bd['lastSync']=new Date()[_0x16b597(0x19c)](),await writeSqlLockFile(_0x5a53e7[_0x16b597(0x19b)],_0x36b54d);const _0x570823=resolveLocalSqlFilePath(_0x5a53e7,_0xe059c9,_0x741ec0);let _0x36f91c;await fileExists(_0x570823)&&(_0x36f91c=await moveToTrash(_0x5a53e7[_0x16b597(0x1ac)],_0x5a53e7[_0x16b597(0x1a5)],_0x570823),await cleanupEmptyDirectories(dirname(_0x570823),_0x5a53e7['sqlRootDir']));const _0x2e2fff={'deleted':_0xe059c9,'remoteId':_0x741ec0['remoteId']};if(_0x36f91c)_0x2e2fff[_0x16b597(0x1a9)]=_0x36f91c;return{'ok':!![],'data':_0x2e2fff,'message':_0x16b597(0x197)+_0xe059c9+(_0x36f91c?_0x16b597(0x1b4):'')};}};async function moveToTrash(_0x31f384,_0x42abfb,_0x24b68b){const _0x4656ae=a155_0x5ab722,_0x4c818a=new Date()[_0x4656ae(0x19c)]()[_0x4656ae(0x1ab)](/[:.]/g,'-'),_0x4d195d=relative(_0x31f384,_0x24b68b),_0x4bb0d=join(_0x42abfb,_0x4c818a,_0x4d195d);return await mkdir(dirname(_0x4bb0d),{'recursive':!![]}),await rename(_0x24b68b,_0x4bb0d),_0x4bb0d;}async function cleanupEmptyDirectories(_0x1f8630,_0x3a3d6c){const _0xeafa8a=a155_0x5ab722;let _0x49ce47=resolve(_0x1f8630);const _0x467212=resolve(_0x3a3d6c);while(_0x49ce47[_0xeafa8a(0x1b1)](''+_0x467212+sep)||_0x49ce47===_0x467212){if(_0x49ce47===_0x467212)return;try{const _0x7e0c9a=await readdir(_0x49ce47);if(_0x7e0c9a[_0xeafa8a(0x199)]>0x0)return;await rmdir(_0x49ce47);}catch{return;}_0x49ce47=dirname(_0x49ce47);}}