@lovrabet/rabetbase-cli 2.3.8 → 2.3.9-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (245) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/add.js +1 -1
  20. package/lib/commands/app/index.js +1 -1
  21. package/lib/commands/app/list.js +1 -1
  22. package/lib/commands/app/remote-directory.js +1 -1
  23. package/lib/commands/app/remove.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app-config/delete.js +1 -1
  26. package/lib/commands/app-config/get.js +1 -1
  27. package/lib/commands/app-config/index.js +1 -1
  28. package/lib/commands/app-config/list.js +1 -1
  29. package/lib/commands/app-config/set.js +1 -1
  30. package/lib/commands/app-config/shared.js +1 -1
  31. package/lib/commands/auth/index.js +1 -1
  32. package/lib/commands/bff/create.js +1 -1
  33. package/lib/commands/bff/delete.js +1 -1
  34. package/lib/commands/bff/detail.js +1 -1
  35. package/lib/commands/bff/index.js +1 -1
  36. package/lib/commands/bff/list.js +1 -1
  37. package/lib/commands/bff/pull.js +1 -1
  38. package/lib/commands/bff/push.js +1 -1
  39. package/lib/commands/bff/status.js +1 -1
  40. package/lib/commands/cli-skill/index.js +1 -1
  41. package/lib/commands/cli-update.js +1 -1
  42. package/lib/commands/codegen/index.js +1 -1
  43. package/lib/commands/codegen/sdk.js +1 -1
  44. package/lib/commands/codegen/sql.js +1 -1
  45. package/lib/commands/common/app-registry.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/dry-run.js +1 -1
  48. package/lib/commands/common/flags.js +1 -1
  49. package/lib/commands/common/local-file.js +1 -1
  50. package/lib/commands/common/validate.js +1 -1
  51. package/lib/commands/config/get.js +1 -1
  52. package/lib/commands/config/index.js +1 -1
  53. package/lib/commands/config/list.js +1 -1
  54. package/lib/commands/config/set.js +1 -1
  55. package/lib/commands/config/shared.js +1 -1
  56. package/lib/commands/data/filter.js +1 -1
  57. package/lib/commands/data/getOne.js +1 -1
  58. package/lib/commands/data/index.js +1 -1
  59. package/lib/commands/data/shared.js +1 -1
  60. package/lib/commands/dataset/business-group-update.js +1 -1
  61. package/lib/commands/dataset/capability.js +1 -1
  62. package/lib/commands/dataset/delete.js +1 -1
  63. package/lib/commands/dataset/detail.js +1 -1
  64. package/lib/commands/dataset/extend-update.js +1 -1
  65. package/lib/commands/dataset/field-update.js +1 -1
  66. package/lib/commands/dataset/generate.js +1 -1
  67. package/lib/commands/dataset/index.js +1 -1
  68. package/lib/commands/dataset/list.js +1 -1
  69. package/lib/commands/dataset/operations.js +1 -1
  70. package/lib/commands/dataset/relation-audit.js +1 -1
  71. package/lib/commands/dataset/relation-create.js +1 -1
  72. package/lib/commands/dataset/relation-delete.js +1 -1
  73. package/lib/commands/dataset/relation-shared.js +1 -1
  74. package/lib/commands/dataset/relation-update.js +1 -1
  75. package/lib/commands/dataset/relations.js +1 -1
  76. package/lib/commands/dataset/rename.js +1 -1
  77. package/lib/commands/dataset/restore.js +1 -1
  78. package/lib/commands/db/analysis-batching.js +1 -1
  79. package/lib/commands/db/analyze-batch-plan.js +1 -1
  80. package/lib/commands/db/analyze-cancel.js +1 -1
  81. package/lib/commands/db/analyze-start.js +1 -1
  82. package/lib/commands/db/analyze-status.js +1 -1
  83. package/lib/commands/db/create.js +1 -1
  84. package/lib/commands/db/delete.js +1 -1
  85. package/lib/commands/db/detail.js +1 -1
  86. package/lib/commands/db/diff.js +1 -1
  87. package/lib/commands/db/index.js +1 -1
  88. package/lib/commands/db/list.js +1 -1
  89. package/lib/commands/db/shared.js +1 -1
  90. package/lib/commands/db/tables.js +1 -1
  91. package/lib/commands/db/test.js +1 -1
  92. package/lib/commands/db/update.js +1 -1
  93. package/lib/commands/doctor.js +1 -1
  94. package/lib/commands/file/index.js +1 -1
  95. package/lib/commands/init/index.js +1 -1
  96. package/lib/commands/issue/index.js +1 -1
  97. package/lib/commands/issue/nudge.js +1 -1
  98. package/lib/commands/issue/report.js +1 -1
  99. package/lib/commands/issue/shared.js +1 -1
  100. package/lib/commands/logs/index.js +1 -1
  101. package/lib/commands/menu/index.js +1 -1
  102. package/lib/commands/menu/list.js +1 -1
  103. package/lib/commands/menu/shared/compare-table.js +1 -1
  104. package/lib/commands/menu/shared/index.js +1 -1
  105. package/lib/commands/menu/shared/inquirer.js +1 -1
  106. package/lib/commands/menu/shared/local-pages.js +1 -1
  107. package/lib/commands/menu/shared/logic.js +1 -1
  108. package/lib/commands/menu/shared/service.js +1 -1
  109. package/lib/commands/menu/shared/sync-core.js +1 -1
  110. package/lib/commands/menu/shared/update-core.js +1 -1
  111. package/lib/commands/menu/shared/valid-url.js +1 -1
  112. package/lib/commands/menu/sync.js +1 -1
  113. package/lib/commands/menu/update.js +1 -1
  114. package/lib/commands/notification/config-list.js +1 -1
  115. package/lib/commands/notification/index.js +1 -1
  116. package/lib/commands/page/generate-start.js +1 -1
  117. package/lib/commands/page/generate-status.js +1 -1
  118. package/lib/commands/page/index.js +1 -1
  119. package/lib/commands/page/pull.js +1 -1
  120. package/lib/commands/page/push.js +1 -1
  121. package/lib/commands/page/relation-audit.js +1 -1
  122. package/lib/commands/page/shared.js +1 -1
  123. package/lib/commands/page/standard-page-status.js +1 -1
  124. package/lib/commands/page/sync.js +1 -1
  125. package/lib/commands/permit/index.js +1 -1
  126. package/lib/commands/permit/page-get.js +1 -1
  127. package/lib/commands/permit/page-set.js +1 -1
  128. package/lib/commands/permit/role-apis-set.js +1 -1
  129. package/lib/commands/permit/role-menus-set.js +1 -1
  130. package/lib/commands/permit/role-menus.js +1 -1
  131. package/lib/commands/permit/shared.js +1 -1
  132. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  133. package/lib/commands/project/create/format-elapsed.js +1 -1
  134. package/lib/commands/project/create/main.js +1 -1
  135. package/lib/commands/project/create/non-interactive.js +1 -1
  136. package/lib/commands/project/create/project-template-path.js +1 -1
  137. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  138. package/lib/commands/project/create/use-format-code.js +1 -1
  139. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  140. package/lib/commands/project/index.js +1 -1
  141. package/lib/commands/project/init.js +1 -1
  142. package/lib/commands/project/upgrade.js +1 -1
  143. package/lib/commands/registry.js +1 -1
  144. package/lib/commands/role/create.js +1 -1
  145. package/lib/commands/role/delete.js +1 -1
  146. package/lib/commands/role/detail.js +1 -1
  147. package/lib/commands/role/index.js +1 -1
  148. package/lib/commands/role/list.js +1 -1
  149. package/lib/commands/role/shared.js +1 -1
  150. package/lib/commands/role/update.js +1 -1
  151. package/lib/commands/role/user-add.js +1 -1
  152. package/lib/commands/role/user-remove.js +1 -1
  153. package/lib/commands/role/user-resolve.js +1 -1
  154. package/lib/commands/run/index.js +1 -1
  155. package/lib/commands/schema.js +1 -1
  156. package/lib/commands/sql/create.js +1 -1
  157. package/lib/commands/sql/delete.js +1 -1
  158. package/lib/commands/sql/detail.js +1 -1
  159. package/lib/commands/sql/exec.js +1 -1
  160. package/lib/commands/sql/index.js +1 -1
  161. package/lib/commands/sql/list.js +1 -1
  162. package/lib/commands/sql/pull.js +1 -1
  163. package/lib/commands/sql/push.js +1 -1
  164. package/lib/commands/sql/save.js +1 -1
  165. package/lib/commands/sql/shared.js +1 -1
  166. package/lib/commands/sql/status.js +1 -1
  167. package/lib/commands/sql/validate.js +1 -1
  168. package/lib/commands/workspace/add.js +1 -1
  169. package/lib/commands/workspace/index.js +1 -1
  170. package/lib/commands/workspace/remove.js +1 -1
  171. package/lib/config/schema.js +1 -1
  172. package/lib/constant/cdn.js +1 -1
  173. package/lib/constant/cli.js +1 -1
  174. package/lib/constant/defaults.js +1 -1
  175. package/lib/constant/domain.js +1 -1
  176. package/lib/constant/env.js +1 -1
  177. package/lib/constant/output.js +1 -1
  178. package/lib/constant/paths.js +1 -1
  179. package/lib/constant/risk.js +1 -1
  180. package/lib/context/app-resolver.js +1 -1
  181. package/lib/context/auth-resolver.js +1 -1
  182. package/lib/context/config-loader.js +1 -1
  183. package/lib/context.js +1 -1
  184. package/lib/core/alias-resolver.js +1 -1
  185. package/lib/core/api-client.js +1 -1
  186. package/lib/core/bff/config.js +1 -1
  187. package/lib/core/bff/file-system.js +1 -1
  188. package/lib/core/bff/hash.js +1 -1
  189. package/lib/core/bff/lock.js +1 -1
  190. package/lib/core/bff/utils.js +1 -1
  191. package/lib/core/db-resolver.js +1 -1
  192. package/lib/core/page/file-system.js +1 -1
  193. package/lib/core/page/hash.js +1 -1
  194. package/lib/core/page/lock.js +1 -1
  195. package/lib/core/sql-sync/config.js +1 -1
  196. package/lib/core/sql-sync/file-system.js +1 -1
  197. package/lib/core/sql-sync/hash.js +1 -1
  198. package/lib/core/sql-sync/lock.js +1 -1
  199. package/lib/core/sql-sync/utils.js +1 -1
  200. package/lib/core/sql-validator.js +1 -1
  201. package/lib/errors.js +1 -1
  202. package/lib/framework/build-all-flags.js +1 -1
  203. package/lib/framework/flags.js +1 -1
  204. package/lib/framework/help.js +1 -1
  205. package/lib/framework/index.js +1 -1
  206. package/lib/framework/output.js +1 -1
  207. package/lib/framework/response.js +1 -1
  208. package/lib/framework/runner-alias.js +1 -1
  209. package/lib/framework/runner.js +1 -1
  210. package/lib/framework/schema-export.js +1 -1
  211. package/lib/framework/types.js +1 -1
  212. package/lib/generated/build-info.js +1 -1
  213. package/lib/help.js +1 -1
  214. package/lib/skills/main.js +1 -1
  215. package/lib/skills/npx-skills-add.js +1 -1
  216. package/lib/telemetry/cli-command-trace.js +1 -1
  217. package/lib/telemetry/cli-help-trace.js +1 -1
  218. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  219. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  220. package/lib/telemetry/send-cli-trace-log.js +1 -1
  221. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  222. package/lib/utils/ai_config.js +1 -1
  223. package/lib/utils/apply-jq-filter.js +1 -1
  224. package/lib/utils/cdn-config.js +1 -1
  225. package/lib/utils/check-sdk-version.js +1 -1
  226. package/lib/utils/cli-version-check.js +1 -1
  227. package/lib/utils/cli-version-policy.js +1 -1
  228. package/lib/utils/config.js +1 -1
  229. package/lib/utils/copy-directory.js +1 -1
  230. package/lib/utils/entity-with-id.js +1 -1
  231. package/lib/utils/file-utils.js +1 -1
  232. package/lib/utils/guides-cdn.js +1 -1
  233. package/lib/utils/http-client.js +1 -1
  234. package/lib/utils/is-non-interactive.js +1 -1
  235. package/lib/utils/logger.js +1 -1
  236. package/lib/utils/params.js +1 -1
  237. package/lib/utils/platform.js +1 -1
  238. package/lib/utils/rules-cdn.js +1 -1
  239. package/lib/utils/sleep.js +1 -1
  240. package/lib/utils/template-replacer.js +1 -1
  241. package/lib/utils/update-notice.js +1 -1
  242. package/lib/utils/version.js +1 -1
  243. package/lib/utils/with-active-cookie.js +1 -1
  244. package/lib/utils/write-cli-side-channel.js +1 -1
  245. package/package.json +1 -1
@@ -1 +1 @@
1
- const a143_0x34b905=a143_0x1cbc;(function(_0x45ec5c,_0x41ce5c){const _0x3dbcbf=a143_0x1cbc,_0x24bf44=_0x45ec5c();while(!![]){try{const _0x156ddd=-parseInt(_0x3dbcbf(0x6b))/0x1*(-parseInt(_0x3dbcbf(0x79))/0x2)+-parseInt(_0x3dbcbf(0x85))/0x3*(-parseInt(_0x3dbcbf(0x99))/0x4)+-parseInt(_0x3dbcbf(0xb3))/0x5*(-parseInt(_0x3dbcbf(0xb4))/0x6)+-parseInt(_0x3dbcbf(0x7e))/0x7*(parseInt(_0x3dbcbf(0x78))/0x8)+parseInt(_0x3dbcbf(0x8f))/0x9+-parseInt(_0x3dbcbf(0x73))/0xa*(-parseInt(_0x3dbcbf(0x7b))/0xb)+-parseInt(_0x3dbcbf(0x70))/0xc;if(_0x156ddd===_0x41ce5c)break;else _0x24bf44['push'](_0x24bf44['shift']());}catch(_0x52108a){_0x24bf44['push'](_0x24bf44['shift']());}}}(a143_0x4bdd,0xce43e));import{apiDefinitions}from'../commands/api/index.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{pageDefinitions}from'../commands/page/index.js';import{dataDefinitions}from'../commands/data/index.js';import{dbDefinitions}from'../commands/db/index.js';import{codegenDefinitions}from'../commands/codegen/index.js';import{menuDefinitions}from'../commands/menu/index.js';import{roleDefinitions}from'../commands/role/index.js';import{permitDefinitions}from'../commands/permit/index.js';import{appDefinitions}from'../commands/app/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{notificationDefinitions}from'../commands/notification/index.js';import{workspaceDefinitions}from'../commands/workspace/index.js';function a143_0x4bdd(){const _0x484d27=['Self\x20Update','Notification\x20Configuration','CLI\x20Built-in\x20Skill','risk','write','5635998XWHRYF','`rabetbase\x20','wildcardDef','App\x20Management','Run\x20any\x20package.json\x20script','set','Platform\x20Issue','Schema','Workspace','`rabetbase\x20skills`\x20has\x20been\x20removed.','819176lILaje','Run\x20Scripts','service','install','Authentication','\x20\x20[high-risk-write]','use','`rabetbase\x20app\x20remote`\x20has\x20been\x20removed.','skill','command','remote','Roles','`\x20has\x20been\x20removed.','project','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20instead.','from','start','read','app\x20use','preview','Quick\x20Start','show','Diagnostics','get','skills','Code\x20Generation','6141160LcGrUw','6BaEzHI','170914eIMFGf','defaultCommand','auth','Permissions','hidden','27782880mzjxYv','has','login','11184850pvPHZk','BFF\x20Scripts','isSingleCommand','build','app','155656pAdrtR','4uRJtHH','Runtime\x20App\x20Config\x20Management','11IugtCD','run','app\x20remote','203HpTQPl','filter','\x20\x20[write]','create','Configuration','logout','SQL\x20Queries','6HvmLmj','File','Dataset\x20&\x20Operations','Smart\x20List\x20Pages','push'];a143_0x4bdd=function(){return _0x484d27;};return a143_0x4bdd();}import{configDefinitions}from'../commands/config/index.js';import{doctorDefinition}from'../commands/doctor.js';import{updateDefinition}from'../commands/cli-update.js';import{schemaDefinition}from'../commands/schema.js';import{issueDefinitions}from'../commands/issue/index.js';import{fileDefinitions}from'../commands/file/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';function a143_0x1cbc(_0x9526d,_0x56535f){_0x9526d=_0x9526d-0x6b;const _0x4bdd39=a143_0x4bdd();let _0x1cbc8a=_0x4bdd39[_0x9526d];return _0x1cbc8a;}import{projectDefinitions}from'../commands/project/index.js';import{initDefinitions}from'../commands/init/index.js';import{runDefinition}from'../commands/run/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x27b4b8){const _0x2cedc0=a143_0x1cbc;for(const _0x36ad95 of _0x27b4b8){definitions[_0x2cedc0(0x94)](_0x36ad95[_0x2cedc0(0x9b)]+':'+_0x36ad95[_0x2cedc0(0xa2)],_0x36ad95);let _0x3135be=serviceGroups[_0x2cedc0(0xb0)](_0x36ad95[_0x2cedc0(0x9b)]);!_0x3135be&&(_0x3135be=[],serviceGroups['set'](_0x36ad95['service'],_0x3135be)),_0x3135be[_0x2cedc0(0x89)](_0x36ad95);}}function registerDeclarativeService(_0x48d0ee,_0x20fdd0,_0x1c4f02){const _0x1e4dba=a143_0x1cbc;registerDefinitions(_0x20fdd0);_0x1c4f02?.[_0x1e4dba(0x91)]&&registerDefinitions([_0x1c4f02[_0x1e4dba(0x91)]]);const _0x2b8b8c=_0x2068d1=>_0x2068d1===_0x1e4dba(0xaa)?'':_0x2068d1===_0x1e4dba(0x8e)?_0x1e4dba(0x80):_0x1e4dba(0x9e),_0x3c8cc3={'service':_0x20fdd0[0x0][_0x1e4dba(0x9b)],'label':_0x48d0ee,'commands':_0x20fdd0[_0x1e4dba(0x7f)](_0x43eba6=>!_0x43eba6[_0x1e4dba(0x6f)])['map'](_0x4b1cbe=>({'command':_0x4b1cbe[_0x1e4dba(0xa2)],'description':_0x4b1cbe['description'],'tag':_0x2b8b8c(_0x4b1cbe[_0x1e4dba(0x8d)])})),'declarative':!![],'defaultCommand':_0x1c4f02?.[_0x1e4dba(0x6c)]??(_0x1c4f02?.[_0x1e4dba(0x75)]?_0x20fdd0[0x0][_0x1e4dba(0xa2)]:undefined),'wildcardDef':_0x1c4f02?.[_0x1e4dba(0x91)],'isSingleCommand':_0x1c4f02?.['isSingleCommand']};serviceRegistry[_0x1e4dba(0x89)](_0x3c8cc3),serviceByName[_0x1e4dba(0x94)](_0x3c8cc3['service'],_0x3c8cc3);}registerDeclarativeService(a143_0x34b905(0xad),initDefinitions,{'defaultCommand':a143_0x34b905(0x7c),'isSingleCommand':!![]}),registerDeclarativeService('Project',projectDefinitions),registerDeclarativeService(a143_0x34b905(0x97),workspaceDefinitions),registerDeclarativeService(a143_0x34b905(0x92),appDefinitions),registerDeclarativeService(a143_0x34b905(0x9d),authDefinitions,{'defaultCommand':a143_0x34b905(0x72)}),registerDeclarativeService(a143_0x34b905(0x87),datasetDefinitions),registerDeclarativeService(a143_0x34b905(0x88),pageDefinitions),registerDeclarativeService('API\x20Development',apiDefinitions),registerDeclarativeService('Instant\x20API',dataDefinitions),registerDeclarativeService(a143_0x34b905(0x74),bffDefinitions),registerDeclarativeService(a143_0x34b905(0x8b),notificationDefinitions),registerDeclarativeService(a143_0x34b905(0x84),sqlDefinitions),registerDeclarativeService('Database\x20Connections',dbDefinitions),registerDeclarativeService('Menu',menuDefinitions),registerDeclarativeService(a143_0x34b905(0xa4),roleDefinitions),registerDeclarativeService(a143_0x34b905(0x6e),permitDefinitions),registerDeclarativeService(a143_0x34b905(0x7a),appConfigDefinitions),registerDeclarativeService(a143_0x34b905(0x95),issueDefinitions),registerDeclarativeService(a143_0x34b905(0x86),fileDefinitions),registerDeclarativeService(a143_0x34b905(0xb2),codegenDefinitions),registerDeclarativeService(a143_0x34b905(0x82),configDefinitions),registerDeclarativeService(a143_0x34b905(0xaf),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a143_0x34b905(0x96),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a143_0x34b905(0x8a),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a143_0x34b905(0x8c),cliSkillDefinitions,{'defaultCommand':a143_0x34b905(0x9c)}),registerDeclarativeService('Logs',logsDefinitions,{'defaultCommand':a143_0x34b905(0xae)}),registerDeclarativeService(a143_0x34b905(0x9a),[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry['length']-0x1];last['commands']=[{'command':'<script>','description':a143_0x34b905(0x93),'tag':''}];}export const deprecatedAliases={'create':{'service':a143_0x34b905(0xa6),'command':a143_0x34b905(0x81)},'start':{'service':a143_0x34b905(0x7c),'command':a143_0x34b905(0xa9)},'build':{'service':a143_0x34b905(0x7c),'command':a143_0x34b905(0x76)},'preview':{'service':a143_0x34b905(0x7c),'command':a143_0x34b905(0xac)},'logout':{'service':a143_0x34b905(0x6d),'command':a143_0x34b905(0x83)}};const CLI_SKILL_INSTALL_REMOVED_HINT='Use\x20`rabetbase\x20cli-skill\x20install`\x20to\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill.\x20To\x20install\x20business\x20Skills,\x20use\x20`lovrabet\x20skill\x20install`.',APP_REMOTE_REMOVED_HINT=a143_0x34b905(0xa7),APP_USE_REMOVED_HINT='Use\x20`rabetbase\x20workspace\x20use\x20--app\x20<name>`\x20instead.';export function resolveRemovedCommand(_0x3e4f87,_0xb80bcf){const _0x10b21d=a143_0x34b905;if(_0x3e4f87===_0x10b21d(0xa1)){const _0x30d09e=_0xb80bcf?'skill\x20'+_0xb80bcf:_0x10b21d(0xa1);return{'command':_0x30d09e,'message':_0x10b21d(0x90)+_0x30d09e+_0x10b21d(0xa5),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};}if(_0x3e4f87===_0x10b21d(0xb1))return{'command':_0x10b21d(0xb1),'message':_0x10b21d(0x98),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};if(_0x3e4f87===_0x10b21d(0x77)&&_0xb80bcf===_0x10b21d(0xa3))return{'command':_0x10b21d(0x7d),'message':_0x10b21d(0xa0),'hint':APP_REMOTE_REMOVED_HINT};if(_0x3e4f87===_0x10b21d(0x77)&&_0xb80bcf===_0x10b21d(0x9f))return{'command':_0x10b21d(0xab),'message':'`rabetbase\x20app\x20use`\x20has\x20been\x20removed.','hint':APP_USE_REMOVED_HINT};return undefined;}export const deprecatedSubcommands={'bff':{'new':a143_0x34b905(0x81)},'sql':{'new':a143_0x34b905(0x81)}};export function resolveDeprecatedSubcommand(_0x38edb1,_0x5ab224){return deprecatedSubcommands[_0x38edb1]?.[_0x5ab224];}export function findDefinition(_0x9075ec,_0x42a297){const _0x245fed=a143_0x34b905;return definitions[_0x245fed(0xb0)](_0x9075ec+':'+_0x42a297);}export function isKnownService(_0x30a42d){const _0x305804=a143_0x34b905;return serviceByName[_0x305804(0x71)](_0x30a42d);}export function isDeclarativeService(_0x42ab80){const _0x5f1856=a143_0x34b905;return serviceGroups[_0x5f1856(0x71)](_0x42ab80)||serviceByName[_0x5f1856(0xb0)](_0x42ab80)?.[_0x5f1856(0x91)]!==undefined;}export function getServiceEntry(_0x541fdb){return serviceByName['get'](_0x541fdb);}export function getLegacyHandler(_0x152189,_0x1a8a14){return undefined;}export function getAllDefinitions(){const _0x2afb87=a143_0x34b905;return Array[_0x2afb87(0xa8)](definitions['values']());}
1
+ const a143_0x3b6e74=a143_0x89b1;(function(_0x4eb566,_0x3935ef){const _0x5d9abc=a143_0x89b1,_0x4c86c5=_0x4eb566();while(!![]){try{const _0x1c9df1=parseInt(_0x5d9abc(0xb5))/0x1+-parseInt(_0x5d9abc(0xab))/0x2*(parseInt(_0x5d9abc(0xb8))/0x3)+-parseInt(_0x5d9abc(0xd3))/0x4+parseInt(_0x5d9abc(0xc3))/0x5*(parseInt(_0x5d9abc(0x9b))/0x6)+-parseInt(_0x5d9abc(0xaf))/0x7*(parseInt(_0x5d9abc(0xa0))/0x8)+parseInt(_0x5d9abc(0xc0))/0x9*(parseInt(_0x5d9abc(0x96))/0xa)+parseInt(_0x5d9abc(0xb4))/0xb;if(_0x1c9df1===_0x3935ef)break;else _0x4c86c5['push'](_0x4c86c5['shift']());}catch(_0x139318){_0x4c86c5['push'](_0x4c86c5['shift']());}}}(a143_0x2a8c,0x9a7fd));import{apiDefinitions}from'../commands/api/index.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';function a143_0x89b1(_0x1d723d,_0x275695){_0x1d723d=_0x1d723d-0x91;const _0x2a8c2e=a143_0x2a8c();let _0x89b1fc=_0x2a8c2e[_0x1d723d];return _0x89b1fc;}import{pageDefinitions}from'../commands/page/index.js';import{dataDefinitions}from'../commands/data/index.js';import{dbDefinitions}from'../commands/db/index.js';import{codegenDefinitions}from'../commands/codegen/index.js';import{menuDefinitions}from'../commands/menu/index.js';import{roleDefinitions}from'../commands/role/index.js';import{permitDefinitions}from'../commands/permit/index.js';import{appDefinitions}from'../commands/app/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{notificationDefinitions}from'../commands/notification/index.js';import{workspaceDefinitions}from'../commands/workspace/index.js';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();function a143_0x2a8c(){const _0x405217=['Menu','Roles','get','1190120zybxXz','`rabetbase\x20app\x20use`\x20has\x20been\x20removed.','Diagnostics','Dataset\x20&\x20Operations','CLI\x20Built-in\x20Skill','96306nDhVPh','Run\x20Scripts','auth','read','App\x20Management','1992UrNfiZ','remote','wildcardDef','hidden','values','start','skill','\x20\x20[high-risk-write]','project','filter','set','291464EPMgFz','Smart\x20List\x20Pages','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20instead.','preview','917QTSJms','service','<script>','build','Code\x20Generation','12029611uvrzyU','477352YkVvFA','Configuration','run','15wBjuoy','write','Permissions','Runtime\x20App\x20Config\x20Management','`rabetbase\x20app\x20remote`\x20has\x20been\x20removed.','map','Platform\x20Issue','login','27OQugMb','app\x20use','has','145hXFNLd','Self\x20Update','risk','commands','\x20\x20[write]','skills','app','Schema','API\x20Development','description','skill\x20','Run\x20any\x20package.json\x20script','command','Workspace','`rabetbase\x20skills`\x20has\x20been\x20removed.','Instant\x20API','3997440EzvZgQ','Project','length','isSingleCommand','Use\x20`rabetbase\x20workspace\x20use\x20--app\x20<name>`\x20instead.','create'];a143_0x2a8c=function(){return _0x405217;};return a143_0x2a8c();}export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x50d747){const _0x41ff7e=a143_0x89b1;for(const _0x5ca7e2 of _0x50d747){definitions['set'](_0x5ca7e2['service']+':'+_0x5ca7e2[_0x41ff7e(0xcf)],_0x5ca7e2);let _0x4436d9=serviceGroups['get'](_0x5ca7e2[_0x41ff7e(0xb0)]);!_0x4436d9&&(_0x4436d9=[],serviceGroups[_0x41ff7e(0xaa)](_0x5ca7e2[_0x41ff7e(0xb0)],_0x4436d9)),_0x4436d9['push'](_0x5ca7e2);}}function registerDeclarativeService(_0x3817a2,_0x32f665,_0x1d0a4b){const _0x16fc9c=a143_0x89b1;registerDefinitions(_0x32f665);_0x1d0a4b?.[_0x16fc9c(0xa2)]&&registerDefinitions([_0x1d0a4b[_0x16fc9c(0xa2)]]);const _0x7907cc=_0x3ec791=>_0x3ec791===_0x16fc9c(0x9e)?'':_0x3ec791===_0x16fc9c(0xb9)?_0x16fc9c(0xc7):_0x16fc9c(0xa7),_0x4a3913={'service':_0x32f665[0x0][_0x16fc9c(0xb0)],'label':_0x3817a2,'commands':_0x32f665[_0x16fc9c(0xa9)](_0x54ac7d=>!_0x54ac7d[_0x16fc9c(0xa3)])[_0x16fc9c(0xbd)](_0x4cc11d=>({'command':_0x4cc11d[_0x16fc9c(0xcf)],'description':_0x4cc11d[_0x16fc9c(0xcc)],'tag':_0x7907cc(_0x4cc11d[_0x16fc9c(0xc5)])})),'declarative':!![],'defaultCommand':_0x1d0a4b?.['defaultCommand']??(_0x1d0a4b?.[_0x16fc9c(0xd6)]?_0x32f665[0x0][_0x16fc9c(0xcf)]:undefined),'wildcardDef':_0x1d0a4b?.[_0x16fc9c(0xa2)],'isSingleCommand':_0x1d0a4b?.[_0x16fc9c(0xd6)]};serviceRegistry['push'](_0x4a3913),serviceByName[_0x16fc9c(0xaa)](_0x4a3913[_0x16fc9c(0xb0)],_0x4a3913);}registerDeclarativeService('Quick\x20Start',initDefinitions,{'defaultCommand':'run','isSingleCommand':!![]}),registerDeclarativeService(a143_0x3b6e74(0xd4),projectDefinitions),registerDeclarativeService(a143_0x3b6e74(0xd0),workspaceDefinitions),registerDeclarativeService(a143_0x3b6e74(0x9f),appDefinitions),registerDeclarativeService('Authentication',authDefinitions,{'defaultCommand':a143_0x3b6e74(0xbf)}),registerDeclarativeService(a143_0x3b6e74(0x99),datasetDefinitions),registerDeclarativeService(a143_0x3b6e74(0xac),pageDefinitions),registerDeclarativeService(a143_0x3b6e74(0xcb),apiDefinitions),registerDeclarativeService(a143_0x3b6e74(0xd2),dataDefinitions),registerDeclarativeService('BFF\x20Scripts',bffDefinitions),registerDeclarativeService('Notification\x20Configuration',notificationDefinitions),registerDeclarativeService('SQL\x20Queries',sqlDefinitions),registerDeclarativeService('Database\x20Connections',dbDefinitions),registerDeclarativeService(a143_0x3b6e74(0x93),menuDefinitions),registerDeclarativeService(a143_0x3b6e74(0x94),roleDefinitions),registerDeclarativeService(a143_0x3b6e74(0xba),permitDefinitions),registerDeclarativeService(a143_0x3b6e74(0xbb),appConfigDefinitions),registerDeclarativeService(a143_0x3b6e74(0xbe),issueDefinitions),registerDeclarativeService('File',fileDefinitions),registerDeclarativeService(a143_0x3b6e74(0xb3),codegenDefinitions),registerDeclarativeService(a143_0x3b6e74(0xb6),configDefinitions),registerDeclarativeService(a143_0x3b6e74(0x98),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a143_0x3b6e74(0xca),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a143_0x3b6e74(0xc4),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a143_0x3b6e74(0x9a),cliSkillDefinitions,{'defaultCommand':'install'}),registerDeclarativeService('Logs',logsDefinitions,{'defaultCommand':'show'}),registerDeclarativeService(a143_0x3b6e74(0x9c),[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry[a143_0x3b6e74(0xd5)]-0x1];last[a143_0x3b6e74(0xc6)]=[{'command':a143_0x3b6e74(0xb1),'description':a143_0x3b6e74(0xce),'tag':''}];}export const deprecatedAliases={'create':{'service':a143_0x3b6e74(0xa8),'command':a143_0x3b6e74(0x92)},'start':{'service':'run','command':a143_0x3b6e74(0xa5)},'build':{'service':a143_0x3b6e74(0xb7),'command':a143_0x3b6e74(0xb2)},'preview':{'service':a143_0x3b6e74(0xb7),'command':a143_0x3b6e74(0xae)},'logout':{'service':a143_0x3b6e74(0x9d),'command':'logout'}};const CLI_SKILL_INSTALL_REMOVED_HINT='Use\x20`rabetbase\x20cli-skill\x20install`\x20to\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill.\x20To\x20install\x20business\x20Skills,\x20use\x20`lovrabet\x20skill\x20install`.',APP_REMOTE_REMOVED_HINT=a143_0x3b6e74(0xad),APP_USE_REMOVED_HINT=a143_0x3b6e74(0x91);export function resolveRemovedCommand(_0x427417,_0x43c410){const _0x48b34a=a143_0x3b6e74;if(_0x427417===_0x48b34a(0xa6)){const _0x4bcefe=_0x43c410?_0x48b34a(0xcd)+_0x43c410:_0x48b34a(0xa6);return{'command':_0x4bcefe,'message':'`rabetbase\x20'+_0x4bcefe+'`\x20has\x20been\x20removed.','hint':CLI_SKILL_INSTALL_REMOVED_HINT};}if(_0x427417===_0x48b34a(0xc8))return{'command':_0x48b34a(0xc8),'message':_0x48b34a(0xd1),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};if(_0x427417==='app'&&_0x43c410===_0x48b34a(0xa1))return{'command':'app\x20remote','message':_0x48b34a(0xbc),'hint':APP_REMOTE_REMOVED_HINT};if(_0x427417===_0x48b34a(0xc9)&&_0x43c410==='use')return{'command':_0x48b34a(0xc1),'message':_0x48b34a(0x97),'hint':APP_USE_REMOVED_HINT};return undefined;}export const deprecatedSubcommands={'bff':{'new':a143_0x3b6e74(0x92)},'sql':{'new':a143_0x3b6e74(0x92)}};export function resolveDeprecatedSubcommand(_0x25cac1,_0x43151f){return deprecatedSubcommands[_0x25cac1]?.[_0x43151f];}export function findDefinition(_0x508f6d,_0x3bb658){return definitions['get'](_0x508f6d+':'+_0x3bb658);}export function isKnownService(_0x40528c){const _0x16f794=a143_0x3b6e74;return serviceByName[_0x16f794(0xc2)](_0x40528c);}export function isDeclarativeService(_0x554653){const _0x60399=a143_0x3b6e74;return serviceGroups[_0x60399(0xc2)](_0x554653)||serviceByName[_0x60399(0x95)](_0x554653)?.[_0x60399(0xa2)]!==undefined;}export function getServiceEntry(_0x45312a){const _0x21619d=a143_0x3b6e74;return serviceByName[_0x21619d(0x95)](_0x45312a);}export function getLegacyHandler(_0x289d81,_0x53071c){return undefined;}export function getAllDefinitions(){const _0x2ed28d=a143_0x3b6e74;return Array['from'](definitions[_0x2ed28d(0xa4)]());}
@@ -1 +1 @@
1
- function a144_0x5f9b(){const _0x1608c4=['36819ITCoIo','POST','1340102bnYwUX','30zNhQvT','1704364HkxZbi','CUSTOM','3WdBLOL','flagMissing','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','remark','trim','length','5636835dUaUBk','353881tCnCPZ','12PKvUtd','str','7VNjHhO','roleName','appCode','2166544JlnFDC','name','/smartapi/permit/role/create','create','1572430CqGhra','Created\x20role\x20','role','Create\x20a\x20CUSTOM\x20user\x20group\x20(role)'];a144_0x5f9b=function(){return _0x1608c4;};return a144_0x5f9b();}const a144_0x4a4d51=a144_0x3e37;(function(_0x389dde,_0x3efaac){const _0x73fdea=a144_0x3e37,_0x24e6be=_0x389dde();while(!![]){try{const _0x48ffc2=parseInt(_0x73fdea(0x174))/0x1+-parseInt(_0x73fdea(0x176))/0x2+parseInt(_0x73fdea(0x15f))/0x3*(-parseInt(_0x73fdea(0x15d))/0x4)+-parseInt(_0x73fdea(0x170))/0x5*(-parseInt(_0x73fdea(0x167))/0x6)+parseInt(_0x73fdea(0x169))/0x7*(parseInt(_0x73fdea(0x16c))/0x8)+parseInt(_0x73fdea(0x165))/0x9+-parseInt(_0x73fdea(0x15c))/0xa*(parseInt(_0x73fdea(0x166))/0xb);if(_0x48ffc2===_0x3efaac)break;else _0x24e6be['push'](_0x24e6be['shift']());}catch(_0x3e81e7){_0x24e6be['push'](_0x24e6be['shift']());}}}(a144_0x5f9b,0x5a65d));import{createAppRole}from'../../core/api-client.js';function a144_0x3e37(_0x26b44c,_0x46e0c7){_0x26b44c=_0x26b44c-0x15c;const _0x5f9b12=a144_0x5f9b();let _0x3e3763=_0x5f9b12[_0x26b44c];return _0x3e3763;}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{NAME_FLAG,REMARK_FLAG,projectRole}from'../../commands/role/shared.js';const CREATE_PATH=a144_0x4a4d51(0x16e);function readName(_0x63fc5b){const _0x51b885=a144_0x4a4d51,_0x19146c=_0x63fc5b[_0x51b885(0x168)](_0x51b885(0x16d))[_0x51b885(0x163)]();if(!_0x19146c)throw CliErrors[_0x51b885(0x160)](_0x51b885(0x16d),'Pass\x20--name\x20<roleName>.');if(_0x19146c[_0x51b885(0x164)]>0x40)throw CliErrors['validation'](_0x51b885(0x161));return _0x19146c;}export const roleCreate={'service':a144_0x4a4d51(0x172),'command':a144_0x4a4d51(0x16f),'description':a144_0x4a4d51(0x173),'risk':'write','flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x527bd7){readName(_0x527bd7);},async 'dryRun'(_0x103fc5){const _0x40b1c7=a144_0x4a4d51,_0x44042f=readName(_0x103fc5),_0x17a219=_0x103fc5[_0x40b1c7(0x168)](_0x40b1c7(0x162))[_0x40b1c7(0x163)]()||undefined;return asDryRunResult({'operation':'create','selector':{'appCode':_0x103fc5[_0x40b1c7(0x16b)],'roleName':_0x44042f},'before':null,'after':{'roleName':_0x44042f,'roleType':_0x40b1c7(0x15e),'remark':_0x17a219},'dryRun':!![],'backend':{'method':_0x40b1c7(0x175),'path':CREATE_PATH},'warnings':[]},{'method':'POST','url':CREATE_PATH});},async 'execute'(_0x43444c){const _0x1bbbc8=a144_0x4a4d51,_0x24b0d3=readName(_0x43444c),_0x100345=_0x43444c['str'](_0x1bbbc8(0x162))['trim']()||undefined,_0x56d181=await createAppRole({'appCode':_0x43444c['appCode'],'roleName':_0x24b0d3,..._0x100345?{'remark':_0x100345}:{}});return{'ok':!![],'data':{'operation':_0x1bbbc8(0x16f),'selector':{'appCode':_0x43444c['appCode'],'roleId':_0x56d181['id'],'roleName':_0x24b0d3},'before':null,'after':projectRole(_0x56d181),'dryRun':![],'backend':{'method':_0x1bbbc8(0x175),'path':CREATE_PATH},'warnings':[]},'message':_0x1bbbc8(0x171)+_0x56d181[_0x1bbbc8(0x16a)]+'\x20(id='+_0x56d181['id']+')'};}};
1
+ const a144_0x49c68e=a144_0x4e63;function a144_0x4e63(_0x471f69,_0x7b65b){_0x471f69=_0x471f69-0x1ae;const _0x443880=a144_0x4438();let _0x4e6357=_0x443880[_0x471f69];return _0x4e6357;}(function(_0x32230a,_0x46f06d){const _0xcf6159=a144_0x4e63,_0x438e93=_0x32230a();while(!![]){try{const _0x28e862=parseInt(_0xcf6159(0x1c5))/0x1*(parseInt(_0xcf6159(0x1c2))/0x2)+parseInt(_0xcf6159(0x1b8))/0x3*(parseInt(_0xcf6159(0x1c3))/0x4)+-parseInt(_0xcf6159(0x1ca))/0x5+-parseInt(_0xcf6159(0x1b5))/0x6*(-parseInt(_0xcf6159(0x1af))/0x7)+parseInt(_0xcf6159(0x1b7))/0x8*(-parseInt(_0xcf6159(0x1c4))/0x9)+-parseInt(_0xcf6159(0x1c1))/0xa+-parseInt(_0xcf6159(0x1bb))/0xb*(-parseInt(_0xcf6159(0x1c0))/0xc);if(_0x28e862===_0x46f06d)break;else _0x438e93['push'](_0x438e93['shift']());}catch(_0xa686d0){_0x438e93['push'](_0x438e93['shift']());}}}(a144_0x4438,0x6378b));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=a144_0x49c68e(0x1b9);function readName(_0x1056d6){const _0x35c8bb=a144_0x49c68e,_0x421cfd=_0x1056d6[_0x35c8bb(0x1c7)](_0x35c8bb(0x1b0))[_0x35c8bb(0x1bf)]();if(!_0x421cfd)throw CliErrors[_0x35c8bb(0x1b3)](_0x35c8bb(0x1b0),_0x35c8bb(0x1c9));if(_0x421cfd['length']>0x40)throw CliErrors[_0x35c8bb(0x1ae)](_0x35c8bb(0x1be));return _0x421cfd;}function a144_0x4438(){const _0x2d6433=['2017770uERqFr','CUSTOM','Create\x20a\x20CUSTOM\x20user\x20group\x20(role)','validation','1448153UBbzvV','name','appCode','roleName','flagMissing','Created\x20role\x20','6KTKTgS','POST','975048fxXkaZ','138UekOXM','/smartapi/permit/role/create','\x20(id=','646184YohNIn','remark','create','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','trim','132xijoQv','6538980pFmjog','156TBltuR','21820VvvFqV','18pWNfyf','7752IuAKym','role','str','write','Pass\x20--name\x20<roleName>.'];a144_0x4438=function(){return _0x2d6433;};return a144_0x4438();}export const roleCreate={'service':a144_0x49c68e(0x1c6),'command':a144_0x49c68e(0x1bd),'description':a144_0x49c68e(0x1cc),'risk':a144_0x49c68e(0x1c8),'flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x54e55b){readName(_0x54e55b);},async 'dryRun'(_0x188135){const _0x29f99f=a144_0x49c68e,_0xb43faa=readName(_0x188135),_0x42ecbb=_0x188135[_0x29f99f(0x1c7)](_0x29f99f(0x1bc))[_0x29f99f(0x1bf)]()||undefined;return asDryRunResult({'operation':_0x29f99f(0x1bd),'selector':{'appCode':_0x188135[_0x29f99f(0x1b1)],'roleName':_0xb43faa},'before':null,'after':{'roleName':_0xb43faa,'roleType':_0x29f99f(0x1cb),'remark':_0x42ecbb},'dryRun':!![],'backend':{'method':'POST','path':CREATE_PATH},'warnings':[]},{'method':_0x29f99f(0x1b6),'url':CREATE_PATH});},async 'execute'(_0x3c9e08){const _0x1d2087=a144_0x49c68e,_0x3d01b3=readName(_0x3c9e08),_0x26ee2c=_0x3c9e08['str']('remark')[_0x1d2087(0x1bf)]()||undefined,_0x212247=await createAppRole({'appCode':_0x3c9e08[_0x1d2087(0x1b1)],'roleName':_0x3d01b3,..._0x26ee2c?{'remark':_0x26ee2c}:{}});return{'ok':!![],'data':{'operation':_0x1d2087(0x1bd),'selector':{'appCode':_0x3c9e08[_0x1d2087(0x1b1)],'roleId':_0x212247['id'],'roleName':_0x3d01b3},'before':null,'after':projectRole(_0x212247),'dryRun':![],'backend':{'method':_0x1d2087(0x1b6),'path':CREATE_PATH},'warnings':[]},'message':_0x1d2087(0x1b4)+_0x212247[_0x1d2087(0x1b2)]+_0x1d2087(0x1ba)+_0x212247['id']+')'};}};
@@ -1 +1 @@
1
- const a145_0x922a1c=a145_0x4ca5;(function(_0x5efeef,_0x401ba5){const _0x3d1f2b=a145_0x4ca5,_0x2f53c5=_0x5efeef();while(!![]){try{const _0x5a7945=parseInt(_0x3d1f2b(0x1e1))/0x1+-parseInt(_0x3d1f2b(0x1e4))/0x2*(parseInt(_0x3d1f2b(0x1e0))/0x3)+-parseInt(_0x3d1f2b(0x1e9))/0x4+-parseInt(_0x3d1f2b(0x1dd))/0x5+parseInt(_0x3d1f2b(0x1de))/0x6*(parseInt(_0x3d1f2b(0x1eb))/0x7)+parseInt(_0x3d1f2b(0x1ea))/0x8+-parseInt(_0x3d1f2b(0x1ec))/0x9;if(_0x5a7945===_0x401ba5)break;else _0x2f53c5['push'](_0x2f53c5['shift']());}catch(_0x342c6c){_0x2f53c5['push'](_0x2f53c5['shift']());}}}(a145_0xa803,0x578da));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';const DELETE_PATH=a145_0x922a1c(0x1e6);function a145_0xa803(){const _0x5eed13=['619373PVMxoJ','POST','userCount','2ndoiSI','num','/smartapi/permit/role/delete','appCode','roleName','572588syyMvs','4969608lvNrZs','14nPBjDx','2185245DAJxZg','delete','high-risk-write','\x20(id=','role','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','258375VgtFia','477372JqLllK','Deleted\x20role\x20','1810359wUuIzd'];a145_0xa803=function(){return _0x5eed13;};return a145_0xa803();}function a145_0x4ca5(_0x734ae9,_0x41373f){_0x734ae9=_0x734ae9-0x1d8;const _0xa803a1=a145_0xa803();let _0x4ca5d7=_0xa803a1[_0x734ae9];return _0x4ca5d7;}export const roleDelete={'service':a145_0x922a1c(0x1db),'command':'delete','description':'Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','risk':a145_0x922a1c(0x1d9),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x272cd7){const _0x47caf7=a145_0x922a1c,_0x57e71b=_0x272cd7[_0x47caf7(0x1e5)]('id'),_0x41cc1f=await getRoleById(_0x272cd7[_0x47caf7(0x1e7)],_0x57e71b);return assertCustomRole(_0x41cc1f,'delete'),asDryRunResult({'operation':_0x47caf7(0x1d8),'selector':{'appCode':_0x272cd7[_0x47caf7(0x1e7)],'roleId':_0x57e71b,'roleName':_0x41cc1f['roleName']},'before':projectRole(_0x41cc1f),'after':null,'dryRun':!![],'backend':{'method':_0x47caf7(0x1e2),'path':DELETE_PATH},'warnings':_0x41cc1f[_0x47caf7(0x1e3)]>0x0?['Role\x20still\x20has\x20'+_0x41cc1f[_0x47caf7(0x1e3)]+_0x47caf7(0x1dc)]:[]},{'method':_0x47caf7(0x1e2),'url':DELETE_PATH});},async 'execute'(_0x50c137){const _0x1b124b=a145_0x922a1c,_0x3bb5b2=_0x50c137[_0x1b124b(0x1e5)]('id'),_0x100581=await getRoleById(_0x50c137['appCode'],_0x3bb5b2);return assertCustomRole(_0x100581,_0x1b124b(0x1d8)),await deleteAppRole(_0x3bb5b2),{'ok':!![],'data':{'operation':'delete','selector':{'appCode':_0x50c137['appCode'],'roleId':_0x3bb5b2,'roleName':_0x100581['roleName']},'before':projectRole(_0x100581),'after':null,'dryRun':![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':[]},'message':_0x1b124b(0x1df)+_0x100581[_0x1b124b(0x1e8)]+_0x1b124b(0x1da)+_0x3bb5b2+')'};}};
1
+ function a145_0x525e(_0x33e120,_0x48ee3c){_0x33e120=_0x33e120-0x1a1;const _0x523f37=a145_0x523f();let _0x525ef6=_0x523f37[_0x33e120];return _0x525ef6;}const a145_0x30bd18=a145_0x525e;(function(_0x410289,_0x3f4bf5){const _0x56cb30=a145_0x525e,_0x2c5daf=_0x410289();while(!![]){try{const _0x513499=parseInt(_0x56cb30(0x1a4))/0x1+-parseInt(_0x56cb30(0x1b6))/0x2+-parseInt(_0x56cb30(0x1b5))/0x3*(parseInt(_0x56cb30(0x1a5))/0x4)+parseInt(_0x56cb30(0x1af))/0x5*(-parseInt(_0x56cb30(0x1aa))/0x6)+-parseInt(_0x56cb30(0x1a7))/0x7*(-parseInt(_0x56cb30(0x1b4))/0x8)+parseInt(_0x56cb30(0x1ae))/0x9+parseInt(_0x56cb30(0x1b1))/0xa;if(_0x513499===_0x3f4bf5)break;else _0x2c5daf['push'](_0x2c5daf['shift']());}catch(_0x5c4d2d){_0x2c5daf['push'](_0x2c5daf['shift']());}}}(a145_0x523f,0x729fc));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';const DELETE_PATH=a145_0x30bd18(0x1ac);export const roleDelete={'service':a145_0x30bd18(0x1a2),'command':a145_0x30bd18(0x1a8),'description':a145_0x30bd18(0x1b0),'risk':a145_0x30bd18(0x1a6),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x59c14c){const _0x2c41fe=a145_0x30bd18,_0x56ba41=_0x59c14c[_0x2c41fe(0x1a1)]('id'),_0x2e8de0=await getRoleById(_0x59c14c[_0x2c41fe(0x1b3)],_0x56ba41);return assertCustomRole(_0x2e8de0,'delete'),asDryRunResult({'operation':_0x2c41fe(0x1a8),'selector':{'appCode':_0x59c14c['appCode'],'roleId':_0x56ba41,'roleName':_0x2e8de0['roleName']},'before':projectRole(_0x2e8de0),'after':null,'dryRun':!![],'backend':{'method':_0x2c41fe(0x1ad),'path':DELETE_PATH},'warnings':_0x2e8de0['userCount']>0x0?['Role\x20still\x20has\x20'+_0x2e8de0['userCount']+_0x2c41fe(0x1b2)]:[]},{'method':'POST','url':DELETE_PATH});},async 'execute'(_0x4e0bce){const _0x349fcc=a145_0x30bd18,_0x3c9d2d=_0x4e0bce[_0x349fcc(0x1a1)]('id'),_0x3a14af=await getRoleById(_0x4e0bce[_0x349fcc(0x1b3)],_0x3c9d2d);return assertCustomRole(_0x3a14af,_0x349fcc(0x1a8)),await deleteAppRole(_0x3c9d2d),{'ok':!![],'data':{'operation':_0x349fcc(0x1a8),'selector':{'appCode':_0x4e0bce[_0x349fcc(0x1b3)],'roleId':_0x3c9d2d,'roleName':_0x3a14af[_0x349fcc(0x1a9)]},'before':projectRole(_0x3a14af),'after':null,'dryRun':![],'backend':{'method':_0x349fcc(0x1ad),'path':DELETE_PATH},'warnings':[]},'message':_0x349fcc(0x1ab)+_0x3a14af['roleName']+_0x349fcc(0x1a3)+_0x3c9d2d+')'};}};function a145_0x523f(){const _0x412635=['147770XSPwGQ','Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','2314760gChxGM','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','appCode','515048MkCrEy','21606IaPuOI','606700MVklCb','num','role','\x20(id=','645789UdAVFE','512mvmuJm','high-risk-write','21IFMswN','delete','roleName','42znnWyX','Deleted\x20role\x20','/smartapi/permit/role/delete','POST','7480584qtaNFm'];a145_0x523f=function(){return _0x412635;};return a145_0x523f();}
@@ -1 +1 @@
1
- function a146_0xea84(_0x3abe6e,_0x75b263){_0x3abe6e=_0x3abe6e-0x6b;const _0x209cb8=a146_0x209c();let _0xea8402=_0x209cb8[_0x3abe6e];return _0xea8402;}function a146_0x209c(){const _0x5723b5=['3863220qpIuSH','113lcEYNn','read','Role\x20','590018YSsuHP','2873000kRhNNw','4EkVFeu','60KDxWuj','appCode','roleType','7666qRNeID','role','8yVtySY','Show\x20a\x20single\x20role\x27s\x20detail','1239123yeocie','3779361oIkZHp','num','2002301IDfayK'];a146_0x209c=function(){return _0x5723b5;};return a146_0x209c();}const a146_0x8b4382=a146_0xea84;(function(_0x53ebd7,_0x50a22c){const _0x32249c=a146_0xea84,_0x530563=_0x53ebd7();while(!![]){try{const _0x235341=-parseInt(_0x32249c(0x7c))/0x1*(parseInt(_0x32249c(0x73))/0x2)+-parseInt(_0x32249c(0x77))/0x3*(-parseInt(_0x32249c(0x6f))/0x4)+parseInt(_0x32249c(0x6e))/0x5+-parseInt(_0x32249c(0x7b))/0x6+-parseInt(_0x32249c(0x7a))/0x7*(parseInt(_0x32249c(0x75))/0x8)+parseInt(_0x32249c(0x78))/0x9+parseInt(_0x32249c(0x70))/0xa*(parseInt(_0x32249c(0x6d))/0xb);if(_0x235341===_0x50a22c)break;else _0x530563['push'](_0x530563['shift']());}catch(_0x5edbf8){_0x530563['push'](_0x530563['shift']());}}}(a146_0x209c,0x59714));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a146_0x8b4382(0x74),'command':'detail','description':a146_0x8b4382(0x76),'risk':a146_0x8b4382(0x6b),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x41c468){const _0x58a9e6=a146_0x8b4382,_0x56cf99=_0x41c468[_0x58a9e6(0x79)]('id'),_0x8ee5f5=await getRoleById(_0x41c468[_0x58a9e6(0x71)],_0x56cf99);return{'ok':!![],'data':{'role':projectRole(_0x8ee5f5)},'message':_0x58a9e6(0x6c)+_0x8ee5f5['roleName']+'\x20('+_0x8ee5f5[_0x58a9e6(0x72)]+')'};}};
1
+ const a146_0x1d0166=a146_0xb643;function a146_0xccad(){const _0x12eb24=['roleType','7rIkdtv','586455tQVQWz','6EsuHxx','1803568YXlooc','Show\x20a\x20single\x20role\x27s\x20detail','6490930TbsbSJ','794836WfdCJA','1304296xZWADK','role','9zPxsza','4174fnmIMS','num','detail','909750qIGCCP'];a146_0xccad=function(){return _0x12eb24;};return a146_0xccad();}(function(_0x4ac759,_0x20e8cf){const _0x5437f1=a146_0xb643,_0x1a6e67=_0x4ac759();while(!![]){try{const _0x330576=-parseInt(_0x5437f1(0xe4))/0x1*(parseInt(_0x5437f1(0xee))/0x2)+parseInt(_0x5437f1(0xe2))/0x3+parseInt(_0x5437f1(0xeb))/0x4+parseInt(_0x5437f1(0xe5))/0x5+parseInt(_0x5437f1(0xe6))/0x6*(-parseInt(_0x5437f1(0xea))/0x7)+parseInt(_0x5437f1(0xe7))/0x8+parseInt(_0x5437f1(0xed))/0x9*(-parseInt(_0x5437f1(0xe9))/0xa);if(_0x330576===_0x20e8cf)break;else _0x1a6e67['push'](_0x1a6e67['shift']());}catch(_0xf37502){_0x1a6e67['push'](_0x1a6e67['shift']());}}}(a146_0xccad,0x2f8fb));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a146_0xb643(_0x53498d,_0x3d902d){_0x53498d=_0x53498d-0xe2;const _0xccad0=a146_0xccad();let _0xb64364=_0xccad0[_0x53498d];return _0xb64364;}import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a146_0x1d0166(0xec),'command':a146_0x1d0166(0xf0),'description':a146_0x1d0166(0xe8),'risk':'read','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x150b5a){const _0x311175=a146_0x1d0166,_0xfe21f3=_0x150b5a[_0x311175(0xef)]('id'),_0xbb4ddf=await getRoleById(_0x150b5a['appCode'],_0xfe21f3);return{'ok':!![],'data':{'role':projectRole(_0xbb4ddf)},'message':'Role\x20'+_0xbb4ddf['roleName']+'\x20('+_0xbb4ddf[_0x311175(0xe3)]+')'};}};
@@ -1 +1 @@
1
- (function(_0x4e9e7e,_0x564347){const _0x5b5b4e=a147_0xc1e7,_0xb6bf7c=_0x4e9e7e();while(!![]){try{const _0x176874=-parseInt(_0x5b5b4e(0xb4))/0x1+-parseInt(_0x5b5b4e(0xb1))/0x2*(-parseInt(_0x5b5b4e(0xb0))/0x3)+-parseInt(_0x5b5b4e(0xb2))/0x4*(-parseInt(_0x5b5b4e(0xaf))/0x5)+parseInt(_0x5b5b4e(0xb3))/0x6+parseInt(_0x5b5b4e(0xb5))/0x7*(-parseInt(_0x5b5b4e(0xb8))/0x8)+-parseInt(_0x5b5b4e(0xb9))/0x9+-parseInt(_0x5b5b4e(0xb6))/0xa*(-parseInt(_0x5b5b4e(0xb7))/0xb);if(_0x176874===_0x564347)break;else _0xb6bf7c['push'](_0xb6bf7c['shift']());}catch(_0x5524de){_0xb6bf7c['push'](_0xb6bf7c['shift']());}}}(a147_0x22f6,0x91c95));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';function a147_0x22f6(){const _0xc151d=['337288WrxFHF','2573034pSZBZf','1144424fKqnvY','35gbFkdu','18146670GbnpKe','11rHmPhq','1377416qPEygy','6212673zaZDrf','5UCHheE','125859yzuUoG','46cDZFmQ'];a147_0x22f6=function(){return _0xc151d;};return a147_0x22f6();}import{roleDelete}from'../../commands/role/delete.js';function a147_0xc1e7(_0x4fed15,_0x6848df){_0x4fed15=_0x4fed15-0xaf;const _0x22f665=a147_0x22f6();let _0xc1e742=_0x22f665[_0x4fed15];return _0xc1e742;}import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
1
+ (function(_0x1d30e5,_0x113293){const _0x237b31=a147_0x4f78,_0x28ce54=_0x1d30e5();while(!![]){try{const _0x7c395d=parseInt(_0x237b31(0x92))/0x1*(-parseInt(_0x237b31(0x90))/0x2)+-parseInt(_0x237b31(0x8f))/0x3*(-parseInt(_0x237b31(0x93))/0x4)+parseInt(_0x237b31(0x8d))/0x5+parseInt(_0x237b31(0x8e))/0x6+parseInt(_0x237b31(0x96))/0x7*(-parseInt(_0x237b31(0x8b))/0x8)+-parseInt(_0x237b31(0x8c))/0x9*(-parseInt(_0x237b31(0x94))/0xa)+parseInt(_0x237b31(0x95))/0xb*(-parseInt(_0x237b31(0x91))/0xc);if(_0x7c395d===_0x113293)break;else _0x28ce54['push'](_0x28ce54['shift']());}catch(_0x2bfcbd){_0x28ce54['push'](_0x28ce54['shift']());}}}(a147_0x273c,0xccc79));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';function a147_0x4f78(_0x63a097,_0xfff0c9){_0x63a097=_0x63a097-0x8b;const _0x273cdc=a147_0x273c();let _0x4f787c=_0x273cdc[_0x63a097];return _0x4f787c;}import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';function a147_0x273c(){const _0x4935b3=['36864dOveCU','39RwHGsZ','4078ekDoAH','12576IUkEDm','510eeQlxR','435308mSChWs','585990CKfCOx','15686OQaXdy','7isbFbS','767656vryoTy','81YKiAfF','7603930zuvpbN'];a147_0x273c=function(){return _0x4935b3;};return a147_0x273c();}import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
@@ -1 +1 @@
1
- const a148_0x5eb534=a148_0x322a;(function(_0x474790,_0x33c0cc){const _0x2c9a36=a148_0x322a,_0x395996=_0x474790();while(!![]){try{const _0x3145f0=-parseInt(_0x2c9a36(0x194))/0x1+parseInt(_0x2c9a36(0x1a2))/0x2+parseInt(_0x2c9a36(0x198))/0x3*(-parseInt(_0x2c9a36(0x1a4))/0x4)+-parseInt(_0x2c9a36(0x1ad))/0x5*(-parseInt(_0x2c9a36(0x19c))/0x6)+-parseInt(_0x2c9a36(0x1ab))/0x7*(-parseInt(_0x2c9a36(0x1b3))/0x8)+parseInt(_0x2c9a36(0x196))/0x9*(parseInt(_0x2c9a36(0x193))/0xa)+-parseInt(_0x2c9a36(0x1af))/0xb*(parseInt(_0x2c9a36(0x1a0))/0xc);if(_0x3145f0===_0x33c0cc)break;else _0x395996['push'](_0x395996['shift']());}catch(_0x531b9b){_0x395996['push'](_0x395996['shift']());}}}(a148_0xd9ba,0x96ceb));function a148_0xd9ba(){const _0x464922=['Use\x20one\x20of:\x20','length','validation','411114pyphPF','pagesize','CUSTOM','Page\x20index\x20(1-based)','36esJJwM','ADMIN','791744jMGBDB','num','44HADLfK','Page\x20size\x20(1-100)','str','map','toUpperCase','roleType','role','7301322jOwnuf','number','35sOjoLK','Invalid\x20--type\x20\x22','3064897zTxWce','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','DEV','type','8EUdOGI','page','USER','string','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','trim','8367050wpIrzC','821771OQClac','join','9ccrHbV','appCode','130881jyPweL'];a148_0xd9ba=function(){return _0x464922;};return a148_0xd9ba();}import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';function a148_0x322a(_0x1c3869,_0x285d9c){_0x1c3869=_0x1c3869-0x191;const _0xd9baba=a148_0xd9ba();let _0x322ab4=_0xd9baba[_0x1c3869];return _0x322ab4;}const ROLE_TYPES=[a148_0x5eb534(0x1a1),a148_0x5eb534(0x1b1),a148_0x5eb534(0x1b5),a148_0x5eb534(0x19e)];export const roleList={'service':a148_0x5eb534(0x1aa),'command':'list','description':a148_0x5eb534(0x191),'risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':a148_0x5eb534(0x1b2),'type':a148_0x5eb534(0x1b6),'required':![],'description':'Filter\x20by\x20role\x20type','enum':ROLE_TYPES},{'name':a148_0x5eb534(0x1b4),'type':a148_0x5eb534(0x1ac),'description':a148_0x5eb534(0x19f),'default':0x1},{'name':'pagesize','type':'number','description':a148_0x5eb534(0x1a5),'default':0x64}],async 'validate'(_0xb70cac){const _0x2e4e86=a148_0x5eb534,_0x455d0f=_0xb70cac[_0x2e4e86(0x1a6)]('type')['trim']();if(_0x455d0f&&!ROLE_TYPES['includes'](_0x455d0f[_0x2e4e86(0x1a8)]()))throw CliErrors[_0x2e4e86(0x19b)](_0x2e4e86(0x1ae)+_0x455d0f+'\x22.',_0x2e4e86(0x199)+ROLE_TYPES[_0x2e4e86(0x195)](',\x20')+'.');const _0x271830=_0xb70cac[_0x2e4e86(0x1a3)](_0x2e4e86(0x1b4),0x1),_0x1a41c0=_0xb70cac[_0x2e4e86(0x1a3)](_0x2e4e86(0x19d),0x64);if(_0x271830<0x1)throw CliErrors[_0x2e4e86(0x19b)](_0x2e4e86(0x1b0));if(_0x1a41c0<0x1||_0x1a41c0>0x64)throw CliErrors[_0x2e4e86(0x19b)]('--pagesize\x20must\x20be\x20between\x201\x20and\x20100.');},async 'execute'(_0x1573ed){const _0x1b1ad7=a148_0x5eb534,_0x1e99e6=_0x1573ed['num']('page',0x1)||0x1,_0x81c1d6=_0x1573ed[_0x1b1ad7(0x1a3)](_0x1b1ad7(0x19d),0x64)||0x64,_0x4ecd71=_0x1573ed[_0x1b1ad7(0x1a6)](_0x1b1ad7(0x1b2))[_0x1b1ad7(0x192)]()[_0x1b1ad7(0x1a8)](),{items:_0x411d38,paging:_0xf46e4d}=await listAppRoles(_0x1573ed[_0x1b1ad7(0x197)],{'currentPage':_0x1e99e6,'pageSize':_0x81c1d6}),_0x2417ab=_0x4ecd71?_0x411d38['filter'](_0x15b45e=>_0x15b45e[_0x1b1ad7(0x1a9)]===_0x4ecd71):_0x411d38,_0x19b119=_0x2417ab[_0x1b1ad7(0x1a7)](projectRole);return{'ok':!![],'data':{'roles':_0x19b119,'paging':_0xf46e4d},'message':'Found\x20'+_0x19b119[_0x1b1ad7(0x19a)]+'\x20role(s)'};}};
1
+ const a148_0x3df825=a148_0x3069;(function(_0x4adbf6,_0x591fb3){const _0x2df8b8=a148_0x3069,_0x2de89a=_0x4adbf6();while(!![]){try{const _0x16f0dd=-parseInt(_0x2df8b8(0x160))/0x1+parseInt(_0x2df8b8(0x152))/0x2+parseInt(_0x2df8b8(0x156))/0x3+parseInt(_0x2df8b8(0x16d))/0x4*(parseInt(_0x2df8b8(0x164))/0x5)+-parseInt(_0x2df8b8(0x161))/0x6+parseInt(_0x2df8b8(0x163))/0x7+parseInt(_0x2df8b8(0x162))/0x8;if(_0x16f0dd===_0x591fb3)break;else _0x2de89a['push'](_0x2de89a['shift']());}catch(_0x3aa6f5){_0x2de89a['push'](_0x2de89a['shift']());}}}(a148_0x2e36,0x6cd44));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=[a148_0x3df825(0x159),a148_0x3df825(0x15f),a148_0x3df825(0x167),'CUSTOM'];function a148_0x2e36(){const _0x4a3fd6=['ADMIN','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','roleType','num','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','filter','DEV','42735LaXCoa','4342926uxjwLC','1659152ljNicq','215033BWuMZJ','2311945dTDLbf','str','Use\x20one\x20of:\x20','USER','type','join','page','role','number','4sJMJWb','Filter\x20by\x20role\x20type','toUpperCase','Invalid\x20--type\x20\x22','\x20role(s)','includes','Page\x20size\x20(1-100)','871412GIPkxH','validation','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','pagesize','228336KFoHOc','trim','Found\x20'];a148_0x2e36=function(){return _0x4a3fd6;};return a148_0x2e36();}function a148_0x3069(_0x187505,_0x1df30d){_0x187505=_0x187505-0x14d;const _0x2e36fb=a148_0x2e36();let _0x30695e=_0x2e36fb[_0x187505];return _0x30695e;}export const roleList={'service':a148_0x3df825(0x16b),'command':'list','description':a148_0x3df825(0x15d),'risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':a148_0x3df825(0x168),'type':'string','required':![],'description':a148_0x3df825(0x16e),'enum':ROLE_TYPES},{'name':a148_0x3df825(0x16a),'type':a148_0x3df825(0x16c),'description':'Page\x20index\x20(1-based)','default':0x1},{'name':a148_0x3df825(0x155),'type':a148_0x3df825(0x16c),'description':a148_0x3df825(0x151),'default':0x64}],async 'validate'(_0xff9e22){const _0x338864=a148_0x3df825,_0x1647e9=_0xff9e22[_0x338864(0x165)](_0x338864(0x168))[_0x338864(0x157)]();if(_0x1647e9&&!ROLE_TYPES[_0x338864(0x150)](_0x1647e9[_0x338864(0x14d)]()))throw CliErrors['validation'](_0x338864(0x14e)+_0x1647e9+'\x22.',_0x338864(0x166)+ROLE_TYPES[_0x338864(0x169)](',\x20')+'.');const _0xa2dc48=_0xff9e22[_0x338864(0x15c)]('page',0x1),_0x5dced0=_0xff9e22['num'](_0x338864(0x155),0x64);if(_0xa2dc48<0x1)throw CliErrors[_0x338864(0x153)](_0x338864(0x15a));if(_0x5dced0<0x1||_0x5dced0>0x64)throw CliErrors['validation'](_0x338864(0x154));},async 'execute'(_0x59e42a){const _0x392262=a148_0x3df825,_0x383fe8=_0x59e42a[_0x392262(0x15c)](_0x392262(0x16a),0x1)||0x1,_0x28995e=_0x59e42a[_0x392262(0x15c)](_0x392262(0x155),0x64)||0x64,_0x247c0a=_0x59e42a[_0x392262(0x165)](_0x392262(0x168))[_0x392262(0x157)]()[_0x392262(0x14d)](),{items:_0x3cba88,paging:_0x3175e2}=await listAppRoles(_0x59e42a['appCode'],{'currentPage':_0x383fe8,'pageSize':_0x28995e}),_0x3b28e9=_0x247c0a?_0x3cba88[_0x392262(0x15e)](_0x5cc5c7=>_0x5cc5c7[_0x392262(0x15b)]===_0x247c0a):_0x3cba88,_0x36d0f6=_0x3b28e9['map'](projectRole);return{'ok':!![],'data':{'roles':_0x36d0f6,'paging':_0x3175e2},'message':_0x392262(0x158)+_0x36d0f6['length']+_0x392262(0x14f)};}};
@@ -1 +1 @@
1
- const a149_0x2c3fcd=a149_0x2591;(function(_0x38c0f7,_0x45824c){const _0xf64411=a149_0x2591,_0x230e77=_0x38c0f7();while(!![]){try{const _0x445b3c=-parseInt(_0xf64411(0x1e9))/0x1+parseInt(_0xf64411(0x1ce))/0x2+-parseInt(_0xf64411(0x1ec))/0x3*(-parseInt(_0xf64411(0x1c3))/0x4)+parseInt(_0xf64411(0x1b3))/0x5+-parseInt(_0xf64411(0x1b5))/0x6+parseInt(_0xf64411(0x1e4))/0x7+-parseInt(_0xf64411(0x1cf))/0x8;if(_0x445b3c===_0x45824c)break;else _0x230e77['push'](_0x230e77['shift']());}catch(_0x22c7a4){_0x230e77['push'](_0x230e77['shift']());}}}(a149_0x3f12,0x81d05));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a149_0x2c3fcd(0x1ef),'required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':'role','type':'string','required':!![],'description':a149_0x2c3fcd(0x1b6)};export const USER_REF_FLAG={'name':a149_0x2c3fcd(0x1eb),'type':a149_0x2c3fcd(0x1aa),'required':!![],'description':a149_0x2c3fcd(0x1a6)};export const NAME_FLAG={'name':a149_0x2c3fcd(0x1bc),'type':a149_0x2c3fcd(0x1aa),'required':!![],'description':a149_0x2c3fcd(0x1c1)};export const USER_NAME_FLAG={'name':a149_0x2c3fcd(0x1bc),'type':a149_0x2c3fcd(0x1aa),'required':!![],'description':a149_0x2c3fcd(0x1cd)};export const REMARK_FLAG={'name':a149_0x2c3fcd(0x1d0),'type':a149_0x2c3fcd(0x1aa),'required':![],'description':a149_0x2c3fcd(0x1b7)};export const EXPECT_USER_COUNT_FLAG={'name':'expect-user-count','type':'number','required':![],'description':a149_0x2c3fcd(0x1c5)};export const BUILTIN_ROLE_TYPES=['ADMIN',a149_0x2c3fcd(0x1c4),a149_0x2c3fcd(0x1d1)];function a149_0x2591(_0xd3379a,_0x279736){_0xd3379a=_0xd3379a-0x1a4;const _0x3f12e4=a149_0x3f12();let _0x2591ac=_0x3f12e4[_0xd3379a];return _0x2591ac;}export function isBuiltinRole(_0x4485e8){const _0x56099c=a149_0x2c3fcd;return BUILTIN_ROLE_TYPES[_0x56099c(0x1c7)](_0x4485e8);}export function assertCustomRole(_0x9a1556,_0x2f518b){const _0x1426ef=a149_0x2c3fcd;if(_0x9a1556[_0x1426ef(0x1c9)]!==_0x1426ef(0x1a9))throw CliErrors['validation'](_0x1426ef(0x1a5)+_0x2f518b+'\x20built-in\x20role\x20'+_0x9a1556[_0x1426ef(0x1b1)]+'\x20('+_0x9a1556[_0x1426ef(0x1c9)]+').','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.');}export function assertPermConfigurable(_0x581aa8){const _0x5f14c2=a149_0x2c3fcd;if(_0x581aa8[_0x5f14c2(0x1c9)]===_0x5f14c2(0x1c4)||_0x581aa8[_0x5f14c2(0x1c9)]===_0x5f14c2(0x1ba))throw CliErrors[_0x5f14c2(0x1d3)]('Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20'+_0x581aa8[_0x5f14c2(0x1b1)]+'\x20('+_0x581aa8[_0x5f14c2(0x1c9)]+').',_0x5f14c2(0x1ca));}export function projectRole(_0x532bb8){const _0xcfad0e=a149_0x2c3fcd;return{'id':_0x532bb8['id'],'roleName':_0x532bb8[_0xcfad0e(0x1b1)],'roleType':_0x532bb8['roleType'],'remark':_0x532bb8[_0xcfad0e(0x1d0)],'userCount':_0x532bb8['userCount'],'permitCount':_0x532bb8[_0xcfad0e(0x1de)],'builtin':isBuiltinRole(_0x532bb8[_0xcfad0e(0x1c9)])};}export async function resolveRoleRef(_0x1128a3,_0x37e476){const _0x44a27d=a149_0x2c3fcd,_0x4dc629=_0x37e476[_0x44a27d(0x1ed)]();if(!_0x4dc629)throw CliErrors['validation'](_0x44a27d(0x1ab),_0x44a27d(0x1b0));if(/^\d+$/[_0x44a27d(0x1ea)](_0x4dc629))return getRoleById(_0x1128a3,Number(_0x4dc629));const _0x41b554=await listAllAppRoles(_0x1128a3),_0x11f676=_0x41b554[_0x44a27d(0x1cb)](_0x510482=>_0x510482[_0x44a27d(0x1b1)]===_0x4dc629);if(_0x11f676[_0x44a27d(0x1bb)]===0x0)throw CliErrors[_0x44a27d(0x1d3)]('Role\x20name\x20\x22'+_0x4dc629+'\x22\x20not\x20found\x20in\x20app\x20'+_0x1128a3+'.',_0x44a27d(0x1e3));if(_0x11f676['length']>0x1){const _0x29aeb7=_0x11f676[_0x44a27d(0x1cc)](_0x28ee4c=>_0x28ee4c['id'])[_0x44a27d(0x1dd)](',\x20');throw CliErrors[_0x44a27d(0x1d3)](_0x44a27d(0x1db)+_0x4dc629+_0x44a27d(0x1c2)+_0x29aeb7+').',_0x44a27d(0x1e7));}return _0x11f676[0x0];}export async function getRoleById(_0x3627ba,_0x11757e){const _0xdbdbf5=a149_0x2c3fcd,_0x5dc1f7=await getAppRole(_0x11757e);if(!_0x5dc1f7)throw CliErrors[_0xdbdbf5(0x1d3)](_0xdbdbf5(0x1ad)+_0x11757e+_0xdbdbf5(0x1d6)+_0x3627ba+'.',_0xdbdbf5(0x1e5));return _0x5dc1f7;}async function listAllAppRoles(_0x107f0e){const _0x4b3ea8=a149_0x2c3fcd,_0x527fcf=0x64,_0x20eee7=[];for(let _0x277bf2=0x1;;_0x277bf2+=0x1){const {items:_0x62dde4,paging:_0x4f2b7c}=await listAppRoles(_0x107f0e,{'currentPage':_0x277bf2,'pageSize':_0x527fcf});_0x20eee7[_0x4b3ea8(0x1bf)](..._0x62dde4);if(_0x62dde4[_0x4b3ea8(0x1bb)]<_0x527fcf||_0x4f2b7c&&_0x20eee7[_0x4b3ea8(0x1bb)]>=_0x4f2b7c['totalCount'])return _0x20eee7;}}export async function resolveTenantCode(){const _0x40195a=a149_0x2c3fcd,_0x3f84c1=await getSessionUserInfo(),_0x4c9bf4=_0x3f84c1?.[_0x40195a(0x1eb)]?.['tenant']?.[_0x40195a(0x1d8)];if(!_0x4c9bf4)throw CliErrors[_0x40195a(0x1a8)](_0x40195a(0x1e2));return _0x4c9bf4;}function matchMember(_0x3e8a6f,_0x451d45){const _0x572059=a149_0x2c3fcd,_0x44667e=_0x451d45[_0x572059(0x1ed)]()['toLowerCase']();return(_0x3e8a6f[_0x572059(0x1b8)]??'')[_0x572059(0x1b4)]()===_0x44667e||(_0x3e8a6f[_0x572059(0x1d5)]??'')[_0x572059(0x1b4)]()===_0x44667e;}export async function resolveUserRef(_0x44b17b){const _0x319ba=a149_0x2c3fcd,_0x4a56de=_0x44b17b[_0x319ba(0x1ed)]();if(!_0x4a56de)throw CliErrors[_0x319ba(0x1d3)](_0x319ba(0x1c8),_0x319ba(0x1b9));const _0x24d2db=await resolveTenantCode(),_0x1a0b5d=await getTenantMembers(_0x24d2db);if(/^\d+$/['test'](_0x4a56de)){const _0xe7d63e=Number(_0x4a56de),_0x4287e4=_0x1a0b5d['find'](_0x292c98=>_0x292c98[_0x319ba(0x1d9)]===_0xe7d63e);return{'userId':_0xe7d63e,'username':_0x4287e4?.[_0x319ba(0x1d5)]??String(_0xe7d63e),'nickname':_0x4287e4?.[_0x319ba(0x1b8)],'matchedBy':'id'};}const _0x3fac7d=_0x1a0b5d['filter'](_0x1217bb=>matchMember(_0x1217bb,_0x4a56de));if(_0x3fac7d[_0x319ba(0x1bb)]===0x0)throw CliErrors[_0x319ba(0x1d3)](_0x319ba(0x1a7)+_0x4a56de+'\x22.','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.');if(_0x3fac7d[_0x319ba(0x1bb)]>0x1){const _0x20bb2c=_0x3fac7d[_0x319ba(0x1cc)](_0x4a17e6=>(_0x4a17e6[_0x319ba(0x1b8)]??_0x4a17e6[_0x319ba(0x1d5)]??'?')+'('+_0x4a17e6['userId']+')')[_0x319ba(0x1dd)](',\x20');throw CliErrors[_0x319ba(0x1d3)](_0x319ba(0x1d2)+_0x4a56de+_0x319ba(0x1be)+_0x20bb2c+'.',_0x319ba(0x1df));}const _0x5dd732=_0x3fac7d[0x0];return{'userId':_0x5dd732[_0x319ba(0x1d9)],'username':_0x5dd732[_0x319ba(0x1d5)]??String(_0x5dd732[_0x319ba(0x1d9)]),'nickname':_0x5dd732['nickname'],'matchedBy':_0x319ba(0x1bc)};}export const UPDATE_USER_LIST_PATH=a149_0x2c3fcd(0x1dc);function userIdsOf(_0x55014a){const _0x2551cd=a149_0x2c3fcd;return(_0x55014a?.[_0x2551cd(0x1c6)]??[])[_0x2551cd(0x1cc)](_0x19c360=>_0x19c360[_0x2551cd(0x1d9)]);}export function computeRoleUserMutation(_0x3d64f3){const _0x5abbd8=a149_0x2c3fcd,{operation:_0x308320,appCode:_0x59fdea,roleUsers:_0x54e7e6,targetRoleId:_0x5185f1,user:_0x423f62}=_0x3d64f3,_0x2bd183=_0x54e7e6[_0x5abbd8(0x1bd)](_0x479e0c=>_0x479e0c['id']===_0x5185f1);if(!_0x2bd183)throw CliErrors['validation'](_0x5abbd8(0x1ad)+_0x5185f1+'\x20not\x20found\x20in\x20the\x20user-role\x20list.',_0x5abbd8(0x1e5));const _0x4f8ddd=userIdsOf(_0x2bd183),_0x4d53e3=[];if(_0x3d64f3[_0x5abbd8(0x1e1)]!==undefined&&_0x3d64f3[_0x5abbd8(0x1e1)]!==_0x4f8ddd[_0x5abbd8(0x1bb)])throw CliErrors['validation'](_0x5abbd8(0x1e6)+_0x3d64f3[_0x5abbd8(0x1e1)]+'\x20member(s)\x20but\x20role\x20has\x20'+_0x4f8ddd[_0x5abbd8(0x1bb)]+'.',_0x5abbd8(0x1e0));const _0x1d2344=_0x4f8ddd[_0x5abbd8(0x1c7)](_0x423f62[_0x5abbd8(0x1d9)]);let _0x7385fc=![];const _0x2be81b=[..._0x2bd183[_0x5abbd8(0x1c6)]];if(_0x308320===_0x5abbd8(0x1a4))_0x1d2344?_0x4d53e3['push'](_0x5abbd8(0x1f1)+_0x423f62[_0x5abbd8(0x1d9)]+'\x20is\x20already\x20a\x20member\x20of\x20role\x20'+_0x2bd183[_0x5abbd8(0x1b1)]+_0x5abbd8(0x1b2)):(_0x2be81b[_0x5abbd8(0x1bf)]({'userId':_0x423f62['userId'],'username':_0x423f62['username'],..._0x423f62[_0x5abbd8(0x1b8)]?{'nickname':_0x423f62[_0x5abbd8(0x1b8)]}:{}}),_0x7385fc=!![]);else{if(!_0x1d2344)_0x4d53e3['push']('User\x20'+_0x423f62[_0x5abbd8(0x1d9)]+_0x5abbd8(0x1c0)+_0x2bd183[_0x5abbd8(0x1b1)]+_0x5abbd8(0x1b2));else{const _0x3c465f=_0x2be81b[_0x5abbd8(0x1af)](_0x45359e=>_0x45359e[_0x5abbd8(0x1d9)]===_0x423f62[_0x5abbd8(0x1d9)]);if(_0x3c465f>=0x0)_0x2be81b[_0x5abbd8(0x1ae)](_0x3c465f,0x1);_0x7385fc=!![];}}const _0x44d7aa=_0x54e7e6[_0x5abbd8(0x1cc)](_0x990bcf=>_0x990bcf['id']===_0x5185f1?{..._0x990bcf,'userList':_0x2be81b}:_0x990bcf),_0x349dd7=_0x2be81b[_0x5abbd8(0x1cc)](_0x1e47b0=>_0x1e47b0[_0x5abbd8(0x1d9)]),_0x1b858c={'operation':_0x308320,'selector':{'appCode':_0x59fdea,'roleId':_0x5185f1,'roleName':_0x2bd183[_0x5abbd8(0x1b1)],'userId':_0x423f62[_0x5abbd8(0x1d9)]},'before':{'userIds':_0x4f8ddd},'after':{'userIds':_0x349dd7},'dryRun':_0x3d64f3['dryRun'],'backend':{'method':_0x5abbd8(0x1d7),'path':UPDATE_USER_LIST_PATH},'warnings':_0x4d53e3};return{'roleList':_0x44d7aa,'mutation':_0x1b858c,'changed':_0x7385fc};}export async function loadRoleUsers(_0x3758c9){return listRoleUsers(_0x3758c9);}export function readRoleRef(_0x105c66){const _0x466456=a149_0x2c3fcd,_0xa9912a=_0x105c66[_0x466456(0x1ac)](_0x466456(0x1ee))[_0x466456(0x1ed)]();if(!_0xa9912a)throw CliErrors['flagMissing'](_0x466456(0x1ee),_0x466456(0x1b0));return _0xa9912a;}function a149_0x3f12(){const _0xb8553=['push','\x20is\x20not\x20a\x20member\x20of\x20role\x20','Role\x20name','\x22\x20is\x20ambiguous\x20(ids:\x20','269528MJvvhu','DEV','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','userList','includes','Missing\x20user\x20reference.','roleType','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','filter','map','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','354520iDVAZL','5668728SJQkWF','remark','USER','Multiple\x20tenant\x20members\x20match\x20\x22','validation','flag','username','\x20not\x20found\x20in\x20app\x20','POST','tenant_code','userId','expect-user-count','Role\x20name\x20\x22','/smartapi/permit/user-role/update-user-list','join','permitCount','Disambiguate\x20with\x20--user\x20<id>.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','expectUserCount','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','611401nozirT','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','Anti-drift\x20check\x20failed:\x20expected\x20','Disambiguate\x20with\x20--role\x20<id>.','appCode','116480NQSUCX','test','user','39aDmOoD','trim','role','number','flagMissing','User\x20','user-add','Cannot\x20','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','No\x20tenant\x20member\x20matches\x20\x22','authRequired','CUSTOM','string','Missing\x20role\x20reference.','str','Role\x20id\x20','splice','findIndex','Pass\x20--role\x20<id|name>.','roleName',';\x20no\x20change.','4270375xEMtOr','toLowerCase','3827136mcyAzp','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','Optional\x20role\x20remark/description','nickname','Pass\x20--user\x20<id|name>.','ADMIN','length','name','find','\x22:\x20'];a149_0x3f12=function(){return _0xb8553;};return a149_0x3f12();}export async function prepareUserMutation(_0x3b17c4,_0x1a643f,_0x41be41){const _0xd1fc1f=a149_0x2c3fcd,_0x1dc949=readRoleRef(_0x3b17c4),_0x59e5d2=_0x3b17c4['str']('user')[_0xd1fc1f(0x1ed)]();if(!_0x59e5d2)throw CliErrors[_0xd1fc1f(0x1f0)](_0xd1fc1f(0x1eb),_0xd1fc1f(0x1b9));const _0x2dcd36=_0x3b17c4[_0xd1fc1f(0x1d4)](_0xd1fc1f(0x1da)),_0x18c7f6=_0x2dcd36===undefined||_0x2dcd36===null?undefined:Number(_0x2dcd36),_0x24a025=await resolveRoleRef(_0x3b17c4[_0xd1fc1f(0x1e8)],_0x1dc949),_0x5ae7ff=await resolveUserRef(_0x59e5d2),_0x2711e4=await loadRoleUsers(_0x3b17c4[_0xd1fc1f(0x1e8)]);return computeRoleUserMutation({'operation':_0x1a643f,'appCode':_0x3b17c4[_0xd1fc1f(0x1e8)],'roleUsers':_0x2711e4,'targetRoleId':_0x24a025['id'],'user':{'userId':_0x5ae7ff['userId'],'username':_0x5ae7ff['username'],'nickname':_0x5ae7ff['nickname']},'dryRun':_0x41be41,..._0x18c7f6!==undefined?{'expectUserCount':_0x18c7f6}:{}});}
1
+ const a149_0x56823e=a149_0x5cb9;(function(_0x32ac1f,_0xdfd960){const _0x3ebbf6=a149_0x5cb9,_0x9b8e12=_0x32ac1f();while(!![]){try{const _0x1d31a3=parseInt(_0x3ebbf6(0xbb))/0x1+parseInt(_0x3ebbf6(0x87))/0x2+-parseInt(_0x3ebbf6(0xc2))/0x3*(-parseInt(_0x3ebbf6(0xbe))/0x4)+-parseInt(_0x3ebbf6(0x83))/0x5+parseInt(_0x3ebbf6(0x8c))/0x6*(parseInt(_0x3ebbf6(0x9a))/0x7)+parseInt(_0x3ebbf6(0xb0))/0x8+-parseInt(_0x3ebbf6(0xa4))/0x9*(parseInt(_0x3ebbf6(0xa3))/0xa);if(_0x1d31a3===_0xdfd960)break;else _0x9b8e12['push'](_0x9b8e12['shift']());}catch(_0x5ead9e){_0x9b8e12['push'](_0x9b8e12['shift']());}}}(a149_0x43b7,0x32f6f));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';function a149_0x43b7(){const _0x3db659=['role','ADMIN','No\x20tenant\x20member\x20matches\x20\x22','flagMissing','nickname','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','userList','Optional\x20role\x20remark/description','2038168DkJaXy','filter','Multiple\x20tenant\x20members\x20match\x20\x22','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','tenant','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20',';\x20no\x20change.','Cannot\x20','tenant_code','roleName','Role\x20name\x20\x22','405680ohasVj','\x20member(s)\x20but\x20role\x20has\x20','length','292156GStKhi','trim','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','Missing\x20user\x20reference.','3Scoaab','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','totalCount','\x22\x20not\x20found\x20in\x20app\x20','Pass\x20--role\x20<id|name>.','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','expectUserCount','map','\x20is\x20already\x20a\x20member\x20of\x20role\x20','Pass\x20--user\x20<id|name>.','dryRun','str','validation','User\x20','userId','appCode','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','toLowerCase','Disambiguate\x20with\x20--role\x20<id>.','857310mHLvxg','find','username','number','233692NHSCaX','string','Missing\x20role\x20reference.','Role\x20name','remark','18744RAoYHI','roleType','Anti-drift\x20check\x20failed:\x20expected\x20','DEV','CUSTOM','\x20is\x20not\x20a\x20member\x20of\x20role\x20','splice','Disambiguate\x20with\x20--user\x20<id>.','permitCount','user','includes','push','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','expect-user-count','91BtOUjD','test','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','join','name','user-add','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','\x20not\x20found\x20in\x20app\x20','findIndex','12930sTUIta','3555yMEDdn','Role\x20id\x20','flag','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.'];a149_0x43b7=function(){return _0x3db659;};return a149_0x43b7();}import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a149_0x56823e(0x86),'required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':a149_0x56823e(0xa8),'type':a149_0x56823e(0x88),'required':!![],'description':a149_0x56823e(0xc4)};export const USER_REF_FLAG={'name':a149_0x56823e(0x95),'type':a149_0x56823e(0x88),'required':!![],'description':a149_0x56823e(0xc8)};export const NAME_FLAG={'name':a149_0x56823e(0x9e),'type':a149_0x56823e(0x88),'required':!![],'description':a149_0x56823e(0x8a)};export const USER_NAME_FLAG={'name':'name','type':a149_0x56823e(0x88),'required':!![],'description':a149_0x56823e(0xa0)};function a149_0x5cb9(_0x5899be,_0x3682bb){_0x5899be=_0x5899be-0x76;const _0x43b77d=a149_0x43b7();let _0x5cb92e=_0x43b77d[_0x5899be];return _0x5cb92e;}export const REMARK_FLAG={'name':a149_0x56823e(0x8b),'type':'string','required':![],'description':a149_0x56823e(0xaf)};export const EXPECT_USER_COUNT_FLAG={'name':a149_0x56823e(0x99),'type':a149_0x56823e(0x86),'required':![],'description':a149_0x56823e(0x9c)};export const BUILTIN_ROLE_TYPES=[a149_0x56823e(0xa9),a149_0x56823e(0x8f),'USER'];export function isBuiltinRole(_0x914228){const _0x106040=a149_0x56823e;return BUILTIN_ROLE_TYPES[_0x106040(0x96)](_0x914228);}export function assertCustomRole(_0x5d1f48,_0x2aba0e){const _0x4681c3=a149_0x56823e;if(_0x5d1f48[_0x4681c3(0x8d)]!==_0x4681c3(0x90))throw CliErrors[_0x4681c3(0x7c)](_0x4681c3(0xb7)+_0x2aba0e+'\x20built-in\x20role\x20'+_0x5d1f48[_0x4681c3(0xb9)]+'\x20('+_0x5d1f48[_0x4681c3(0x8d)]+').',_0x4681c3(0xb3));}export function assertPermConfigurable(_0x454337){const _0x50f89a=a149_0x56823e;if(_0x454337[_0x50f89a(0x8d)]==='DEV'||_0x454337['roleType']===_0x50f89a(0xa9))throw CliErrors[_0x50f89a(0x7c)](_0x50f89a(0xb5)+_0x454337[_0x50f89a(0xb9)]+'\x20('+_0x454337['roleType']+').',_0x50f89a(0x80));}export function projectRole(_0x58c4f5){const _0x8d67aa=a149_0x56823e;return{'id':_0x58c4f5['id'],'roleName':_0x58c4f5[_0x8d67aa(0xb9)],'roleType':_0x58c4f5[_0x8d67aa(0x8d)],'remark':_0x58c4f5[_0x8d67aa(0x8b)],'userCount':_0x58c4f5['userCount'],'permitCount':_0x58c4f5[_0x8d67aa(0x94)],'builtin':isBuiltinRole(_0x58c4f5['roleType'])};}export async function resolveRoleRef(_0x50c435,_0x29b4ab){const _0x1b2be5=a149_0x56823e,_0x5d75b0=_0x29b4ab['trim']();if(!_0x5d75b0)throw CliErrors['validation'](_0x1b2be5(0x89),_0x1b2be5(0xc7));if(/^\d+$/[_0x1b2be5(0x9b)](_0x5d75b0))return getRoleById(_0x50c435,Number(_0x5d75b0));const _0x7fc139=await listAllAppRoles(_0x50c435),_0x204c9d=_0x7fc139[_0x1b2be5(0xb1)](_0x3c9c12=>_0x3c9c12['roleName']===_0x5d75b0);if(_0x204c9d['length']===0x0)throw CliErrors[_0x1b2be5(0x7c)](_0x1b2be5(0xba)+_0x5d75b0+_0x1b2be5(0xc6)+_0x50c435+'.',_0x1b2be5(0xc0));if(_0x204c9d[_0x1b2be5(0xbd)]>0x1){const _0x3dd51d=_0x204c9d[_0x1b2be5(0x77)](_0x52f090=>_0x52f090['id'])[_0x1b2be5(0x9d)](',\x20');throw CliErrors[_0x1b2be5(0x7c)]('Role\x20name\x20\x22'+_0x5d75b0+'\x22\x20is\x20ambiguous\x20(ids:\x20'+_0x3dd51d+').',_0x1b2be5(0x82));}return _0x204c9d[0x0];}export async function getRoleById(_0x2ce308,_0xa2fc15){const _0x377ace=a149_0x56823e,_0x4f4be2=await getAppRole(_0xa2fc15);if(!_0x4f4be2)throw CliErrors[_0x377ace(0x7c)]('Role\x20id\x20'+_0xa2fc15+_0x377ace(0xa1)+_0x2ce308+'.',_0x377ace(0xc3));return _0x4f4be2;}async function listAllAppRoles(_0x371ba4){const _0x446953=a149_0x56823e,_0xb2fcb2=0x64,_0x5a9bd9=[];for(let _0x15dee6=0x1;;_0x15dee6+=0x1){const {items:_0x1c57da,paging:_0x38708c}=await listAppRoles(_0x371ba4,{'currentPage':_0x15dee6,'pageSize':_0xb2fcb2});_0x5a9bd9[_0x446953(0x97)](..._0x1c57da);if(_0x1c57da['length']<_0xb2fcb2||_0x38708c&&_0x5a9bd9[_0x446953(0xbd)]>=_0x38708c[_0x446953(0xc5)])return _0x5a9bd9;}}export async function resolveTenantCode(){const _0x1ff7e6=a149_0x56823e,_0x2bc483=await getSessionUserInfo(),_0x2f3d64=_0x2bc483?.[_0x1ff7e6(0x95)]?.[_0x1ff7e6(0xb4)]?.[_0x1ff7e6(0xb8)];if(!_0x2f3d64)throw CliErrors['authRequired'](_0x1ff7e6(0xad));return _0x2f3d64;}function matchMember(_0x522478,_0x25ee4e){const _0x5d90fd=a149_0x56823e,_0x51d4aa=_0x25ee4e[_0x5d90fd(0xbf)]()[_0x5d90fd(0x81)]();return(_0x522478[_0x5d90fd(0xac)]??'')[_0x5d90fd(0x81)]()===_0x51d4aa||(_0x522478['username']??'')['toLowerCase']()===_0x51d4aa;}export async function resolveUserRef(_0x72acea){const _0x567835=a149_0x56823e,_0x370d88=_0x72acea['trim']();if(!_0x370d88)throw CliErrors['validation'](_0x567835(0xc1),_0x567835(0x79));const _0x3a6a47=await resolveTenantCode(),_0x158cf7=await getTenantMembers(_0x3a6a47);if(/^\d+$/[_0x567835(0x9b)](_0x370d88)){const _0xa24d91=Number(_0x370d88),_0x3e6551=_0x158cf7[_0x567835(0x84)](_0x58a000=>_0x58a000[_0x567835(0x7e)]===_0xa24d91);return{'userId':_0xa24d91,'username':_0x3e6551?.[_0x567835(0x85)]??String(_0xa24d91),'nickname':_0x3e6551?.[_0x567835(0xac)],'matchedBy':'id'};}const _0x46c178=_0x158cf7[_0x567835(0xb1)](_0x233b05=>matchMember(_0x233b05,_0x370d88));if(_0x46c178[_0x567835(0xbd)]===0x0)throw CliErrors[_0x567835(0x7c)](_0x567835(0xaa)+_0x370d88+'\x22.',_0x567835(0x98));if(_0x46c178[_0x567835(0xbd)]>0x1){const _0x3e63f3=_0x46c178['map'](_0xeca1f5=>(_0xeca1f5[_0x567835(0xac)]??_0xeca1f5[_0x567835(0x85)]??'?')+'('+_0xeca1f5['userId']+')')[_0x567835(0x9d)](',\x20');throw CliErrors[_0x567835(0x7c)](_0x567835(0xb2)+_0x370d88+'\x22:\x20'+_0x3e63f3+'.',_0x567835(0x93));}const _0x525553=_0x46c178[0x0];return{'userId':_0x525553[_0x567835(0x7e)],'username':_0x525553[_0x567835(0x85)]??String(_0x525553[_0x567835(0x7e)]),'nickname':_0x525553['nickname'],'matchedBy':'name'};}export const UPDATE_USER_LIST_PATH='/smartapi/permit/user-role/update-user-list';function userIdsOf(_0x1b2ad6){const _0x29f3d3=a149_0x56823e;return(_0x1b2ad6?.[_0x29f3d3(0xae)]??[])[_0x29f3d3(0x77)](_0x3930f1=>_0x3930f1[_0x29f3d3(0x7e)]);}export function computeRoleUserMutation(_0x3c5c0c){const _0x4586c5=a149_0x56823e,{operation:_0x15fa89,appCode:_0x1bbf0a,roleUsers:_0x2b9f7c,targetRoleId:_0x21a8ed,user:_0x480f00}=_0x3c5c0c,_0x2b1f59=_0x2b9f7c['find'](_0x48970a=>_0x48970a['id']===_0x21a8ed);if(!_0x2b1f59)throw CliErrors[_0x4586c5(0x7c)](_0x4586c5(0xa5)+_0x21a8ed+'\x20not\x20found\x20in\x20the\x20user-role\x20list.',_0x4586c5(0xc3));const _0x1a993d=userIdsOf(_0x2b1f59),_0x43d09e=[];if(_0x3c5c0c[_0x4586c5(0x76)]!==undefined&&_0x3c5c0c['expectUserCount']!==_0x1a993d[_0x4586c5(0xbd)])throw CliErrors[_0x4586c5(0x7c)](_0x4586c5(0x8e)+_0x3c5c0c['expectUserCount']+_0x4586c5(0xbc)+_0x1a993d['length']+'.',_0x4586c5(0xa7));const _0x5a02ce=_0x1a993d[_0x4586c5(0x96)](_0x480f00[_0x4586c5(0x7e)]);let _0x7912ed=![];const _0x36214d=[..._0x2b1f59[_0x4586c5(0xae)]];if(_0x15fa89===_0x4586c5(0x9f))_0x5a02ce?_0x43d09e[_0x4586c5(0x97)](_0x4586c5(0x7d)+_0x480f00[_0x4586c5(0x7e)]+_0x4586c5(0x78)+_0x2b1f59[_0x4586c5(0xb9)]+';\x20no\x20change.'):(_0x36214d[_0x4586c5(0x97)]({'userId':_0x480f00[_0x4586c5(0x7e)],'username':_0x480f00[_0x4586c5(0x85)],..._0x480f00[_0x4586c5(0xac)]?{'nickname':_0x480f00[_0x4586c5(0xac)]}:{}}),_0x7912ed=!![]);else{if(!_0x5a02ce)_0x43d09e[_0x4586c5(0x97)](_0x4586c5(0x7d)+_0x480f00[_0x4586c5(0x7e)]+_0x4586c5(0x91)+_0x2b1f59[_0x4586c5(0xb9)]+_0x4586c5(0xb6));else{const _0x4fe55b=_0x36214d[_0x4586c5(0xa2)](_0x27cb05=>_0x27cb05['userId']===_0x480f00[_0x4586c5(0x7e)]);if(_0x4fe55b>=0x0)_0x36214d[_0x4586c5(0x92)](_0x4fe55b,0x1);_0x7912ed=!![];}}const _0x2793bd=_0x2b9f7c[_0x4586c5(0x77)](_0x19fac0=>_0x19fac0['id']===_0x21a8ed?{..._0x19fac0,'userList':_0x36214d}:_0x19fac0),_0x633a8c=_0x36214d[_0x4586c5(0x77)](_0x1c72e8=>_0x1c72e8[_0x4586c5(0x7e)]),_0x492648={'operation':_0x15fa89,'selector':{'appCode':_0x1bbf0a,'roleId':_0x21a8ed,'roleName':_0x2b1f59['roleName'],'userId':_0x480f00[_0x4586c5(0x7e)]},'before':{'userIds':_0x1a993d},'after':{'userIds':_0x633a8c},'dryRun':_0x3c5c0c[_0x4586c5(0x7a)],'backend':{'method':'POST','path':UPDATE_USER_LIST_PATH},'warnings':_0x43d09e};return{'roleList':_0x2793bd,'mutation':_0x492648,'changed':_0x7912ed};}export async function loadRoleUsers(_0x1916ff){return listRoleUsers(_0x1916ff);}export function readRoleRef(_0x553a3c){const _0x54dbdc=a149_0x56823e,_0x5a3b35=_0x553a3c[_0x54dbdc(0x7b)](_0x54dbdc(0xa8))[_0x54dbdc(0xbf)]();if(!_0x5a3b35)throw CliErrors[_0x54dbdc(0xab)](_0x54dbdc(0xa8),_0x54dbdc(0xc7));return _0x5a3b35;}export async function prepareUserMutation(_0x290216,_0x33241c,_0x4f6624){const _0x5f2677=a149_0x56823e,_0x59b876=readRoleRef(_0x290216),_0x52d6d3=_0x290216[_0x5f2677(0x7b)](_0x5f2677(0x95))[_0x5f2677(0xbf)]();if(!_0x52d6d3)throw CliErrors[_0x5f2677(0xab)](_0x5f2677(0x95),_0x5f2677(0x79));const _0x567118=_0x290216[_0x5f2677(0xa6)]('expect-user-count'),_0x27216b=_0x567118===undefined||_0x567118===null?undefined:Number(_0x567118),_0x1233af=await resolveRoleRef(_0x290216[_0x5f2677(0x7f)],_0x59b876),_0x4f60db=await resolveUserRef(_0x52d6d3),_0x1f36c7=await loadRoleUsers(_0x290216[_0x5f2677(0x7f)]);return computeRoleUserMutation({'operation':_0x33241c,'appCode':_0x290216[_0x5f2677(0x7f)],'roleUsers':_0x1f36c7,'targetRoleId':_0x1233af['id'],'user':{'userId':_0x4f60db[_0x5f2677(0x7e)],'username':_0x4f60db[_0x5f2677(0x85)],'nickname':_0x4f60db[_0x5f2677(0xac)]},'dryRun':_0x4f6624,..._0x27216b!==undefined?{'expectUserCount':_0x27216b}:{}});}
@@ -1 +1 @@
1
- const a150_0xa828ce=a150_0x4cf2;(function(_0x2bd842,_0x489f86){const _0x164ff9=a150_0x4cf2,_0x1c573f=_0x2bd842();while(!![]){try{const _0xe8ea76=-parseInt(_0x164ff9(0x85))/0x1*(parseInt(_0x164ff9(0x6d))/0x2)+parseInt(_0x164ff9(0x71))/0x3+-parseInt(_0x164ff9(0x75))/0x4+parseInt(_0x164ff9(0x84))/0x5*(-parseInt(_0x164ff9(0x7b))/0x6)+-parseInt(_0x164ff9(0x79))/0x7+-parseInt(_0x164ff9(0x86))/0x8+parseInt(_0x164ff9(0x7d))/0x9;if(_0xe8ea76===_0x489f86)break;else _0x1c573f['push'](_0x1c573f['shift']());}catch(_0x25eb66){_0x1c573f['push'](_0x1c573f['shift']());}}}(a150_0x288a,0x7e945));import{updateAppRole}from'../../core/api-client.js';function a150_0x288a(){const _0x26834b=['validation','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','update','1173318sANlGq','remark','string','roleName','66884yerJtB','flag','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','appCode','375690cUFmKD','Updated\x20role\x20','6nTGZWx','--name\x20cannot\x20be\x20empty.','12476619Avqvle','name','trim','/smartapi/permit/role/update','length','\x20(id=','Nothing\x20to\x20update.','4610530APqOZF','1REHsnH','2093448hooQyw','9500MnhvQu'];a150_0x288a=function(){return _0x26834b;};return a150_0x288a();}import{CliErrors}from'../../errors.js';function a150_0x4cf2(_0x35622a,_0x316cfd){_0x35622a=_0x35622a-0x6d;const _0x288ac6=a150_0x288a();let _0x4cf24d=_0x288ac6[_0x35622a];return _0x4cf24d;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH=a150_0xa828ce(0x80);function readPatch(_0x1c79f0){const _0x5254bb=a150_0xa828ce,_0x401a72=_0x1c79f0[_0x5254bb(0x76)](_0x5254bb(0x7e)),_0x574b48=_0x1c79f0[_0x5254bb(0x76)](_0x5254bb(0x72)),_0x809de6={};if(_0x401a72!==undefined&&_0x401a72!==null){const _0x16b616=String(_0x401a72)[_0x5254bb(0x7f)]();if(!_0x16b616)throw CliErrors[_0x5254bb(0x6e)](_0x5254bb(0x7c));if(_0x16b616[_0x5254bb(0x81)]>0x40)throw CliErrors['validation']('Role\x20name\x20cannot\x20exceed\x2064\x20characters.');_0x809de6[_0x5254bb(0x74)]=_0x16b616;}_0x574b48!==undefined&&_0x574b48!==null&&(_0x809de6[_0x5254bb(0x72)]=String(_0x574b48));if(_0x809de6[_0x5254bb(0x74)]===undefined&&_0x809de6[_0x5254bb(0x72)]===undefined)throw CliErrors[_0x5254bb(0x6e)](_0x5254bb(0x83),_0x5254bb(0x77));return _0x809de6;}export const roleUpdate={'service':'role','command':a150_0xa828ce(0x70),'description':a150_0xa828ce(0x6f),'risk':'write','flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a150_0xa828ce(0x7e),'type':a150_0xa828ce(0x73),'required':![],'description':'New\x20role\x20name'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4d1017){readPatch(_0x4d1017);},async 'dryRun'(_0x4300bf){const _0x6e63a8=a150_0xa828ce,_0x3a6afc=_0x4300bf['num']('id'),_0x5be051=readPatch(_0x4300bf),_0x1c0a34=await getRoleById(_0x4300bf[_0x6e63a8(0x78)],_0x3a6afc);return assertCustomRole(_0x1c0a34,_0x6e63a8(0x70)),asDryRunResult({'operation':_0x6e63a8(0x70),'selector':{'appCode':_0x4300bf[_0x6e63a8(0x78)],'roleId':_0x3a6afc,'roleName':_0x1c0a34[_0x6e63a8(0x74)]},'before':projectRole(_0x1c0a34),'after':projectRole({..._0x1c0a34,..._0x5be051[_0x6e63a8(0x74)]!==undefined?{'roleName':_0x5be051[_0x6e63a8(0x74)]}:{},..._0x5be051[_0x6e63a8(0x72)]!==undefined?{'remark':_0x5be051[_0x6e63a8(0x72)]}:{}}),'dryRun':!![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0xed75ab){const _0x11aac1=a150_0xa828ce,_0x1d4381=_0xed75ab['num']('id'),_0x20df04=readPatch(_0xed75ab),_0x112d0d=await getRoleById(_0xed75ab[_0x11aac1(0x78)],_0x1d4381);assertCustomRole(_0x112d0d,'update'),await updateAppRole({'id':_0x1d4381,'appCode':_0xed75ab[_0x11aac1(0x78)],..._0x20df04[_0x11aac1(0x74)]!==undefined?{'roleName':_0x20df04[_0x11aac1(0x74)]}:{},..._0x20df04['remark']!==undefined?{'remark':_0x20df04[_0x11aac1(0x72)]}:{}});const _0x66b80b=await getRoleById(_0xed75ab[_0x11aac1(0x78)],_0x1d4381);return{'ok':!![],'data':{'operation':_0x11aac1(0x70),'selector':{'appCode':_0xed75ab[_0x11aac1(0x78)],'roleId':_0x1d4381,'roleName':_0x66b80b[_0x11aac1(0x74)]},'before':projectRole(_0x112d0d),'after':projectRole(_0x66b80b),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':_0x11aac1(0x7a)+_0x66b80b[_0x11aac1(0x74)]+_0x11aac1(0x82)+_0x1d4381+')'};}};
1
+ function a150_0x1d31(){const _0x3f279e=['123fVDkbt','1842KIQLKn','validation','POST','roleName','name','New\x20role\x20name','--name\x20cannot\x20be\x20empty.','flag','num','trim','580032nssQWz','1900XlHDbr','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','63821WNUcys','remark','length','update','466000KbwYEA','756518sIfLAs','6712bzowjl','70Jqufho','role','appCode','Nothing\x20to\x20update.','4urXGOR','165583KQLqOr','write','string'];a150_0x1d31=function(){return _0x3f279e;};return a150_0x1d31();}const a150_0xb326a3=a150_0x191b;(function(_0x491ab9,_0x172a7e){const _0x50886e=a150_0x191b,_0x3b1f59=_0x491ab9();while(!![]){try{const _0x2c54be=-parseInt(_0x50886e(0x1e9))/0x1*(parseInt(_0x50886e(0x1f4))/0x2)+parseInt(_0x50886e(0x1f8))/0x3*(parseInt(_0x50886e(0x1ef))/0x4)+-parseInt(_0x50886e(0x1e7))/0x5*(-parseInt(_0x50886e(0x1f9))/0x6)+-parseInt(_0x50886e(0x1ee))/0x7+parseInt(_0x50886e(0x1ed))/0x8+parseInt(_0x50886e(0x1e6))/0x9+parseInt(_0x50886e(0x1f0))/0xa*(parseInt(_0x50886e(0x1f5))/0xb);if(_0x2c54be===_0x172a7e)break;else _0x3b1f59['push'](_0x3b1f59['shift']());}catch(_0x371b50){_0x3b1f59['push'](_0x3b1f59['shift']());}}}(a150_0x1d31,0x2b693));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 a150_0x191b(_0x401b8f,_0x193e6f){_0x401b8f=_0x401b8f-0x1df;const _0x1d31b1=a150_0x1d31();let _0x191b13=_0x1d31b1[_0x401b8f];return _0x191b13;}const UPDATE_PATH='/smartapi/permit/role/update';function readPatch(_0x1bc6f7){const _0x5b4e18=a150_0x191b,_0x323aa2=_0x1bc6f7[_0x5b4e18(0x1e3)](_0x5b4e18(0x1e0)),_0x391307=_0x1bc6f7[_0x5b4e18(0x1e3)]('remark'),_0x29e2e1={};if(_0x323aa2!==undefined&&_0x323aa2!==null){const _0x5aed4d=String(_0x323aa2)[_0x5b4e18(0x1e5)]();if(!_0x5aed4d)throw CliErrors[_0x5b4e18(0x1fa)](_0x5b4e18(0x1e2));if(_0x5aed4d[_0x5b4e18(0x1eb)]>0x40)throw CliErrors['validation']('Role\x20name\x20cannot\x20exceed\x2064\x20characters.');_0x29e2e1[_0x5b4e18(0x1df)]=_0x5aed4d;}_0x391307!==undefined&&_0x391307!==null&&(_0x29e2e1[_0x5b4e18(0x1ea)]=String(_0x391307));if(_0x29e2e1[_0x5b4e18(0x1df)]===undefined&&_0x29e2e1['remark']===undefined)throw CliErrors[_0x5b4e18(0x1fa)](_0x5b4e18(0x1f3),_0x5b4e18(0x1e8));return _0x29e2e1;}export const roleUpdate={'service':a150_0xb326a3(0x1f1),'command':a150_0xb326a3(0x1ec),'description':'Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','risk':a150_0xb326a3(0x1f6),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a150_0xb326a3(0x1e0),'type':a150_0xb326a3(0x1f7),'required':![],'description':a150_0xb326a3(0x1e1)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x456434){readPatch(_0x456434);},async 'dryRun'(_0x368d9d){const _0x2ca7f0=a150_0xb326a3,_0x160e06=_0x368d9d[_0x2ca7f0(0x1e4)]('id'),_0x1a7967=readPatch(_0x368d9d),_0x5e3e9c=await getRoleById(_0x368d9d[_0x2ca7f0(0x1f2)],_0x160e06);return assertCustomRole(_0x5e3e9c,'update'),asDryRunResult({'operation':_0x2ca7f0(0x1ec),'selector':{'appCode':_0x368d9d[_0x2ca7f0(0x1f2)],'roleId':_0x160e06,'roleName':_0x5e3e9c['roleName']},'before':projectRole(_0x5e3e9c),'after':projectRole({..._0x5e3e9c,..._0x1a7967[_0x2ca7f0(0x1df)]!==undefined?{'roleName':_0x1a7967[_0x2ca7f0(0x1df)]}:{},..._0x1a7967['remark']!==undefined?{'remark':_0x1a7967['remark']}:{}}),'dryRun':!![],'backend':{'method':_0x2ca7f0(0x1fb),'path':UPDATE_PATH},'warnings':[]},{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x54fa71){const _0x3d86d3=a150_0xb326a3,_0x1f5b2f=_0x54fa71[_0x3d86d3(0x1e4)]('id'),_0x53e486=readPatch(_0x54fa71),_0x2b9f39=await getRoleById(_0x54fa71['appCode'],_0x1f5b2f);assertCustomRole(_0x2b9f39,'update'),await updateAppRole({'id':_0x1f5b2f,'appCode':_0x54fa71[_0x3d86d3(0x1f2)],..._0x53e486[_0x3d86d3(0x1df)]!==undefined?{'roleName':_0x53e486['roleName']}:{},..._0x53e486[_0x3d86d3(0x1ea)]!==undefined?{'remark':_0x53e486[_0x3d86d3(0x1ea)]}:{}});const _0x28aa2a=await getRoleById(_0x54fa71[_0x3d86d3(0x1f2)],_0x1f5b2f);return{'ok':!![],'data':{'operation':_0x3d86d3(0x1ec),'selector':{'appCode':_0x54fa71[_0x3d86d3(0x1f2)],'roleId':_0x1f5b2f,'roleName':_0x28aa2a[_0x3d86d3(0x1df)]},'before':projectRole(_0x2b9f39),'after':projectRole(_0x28aa2a),'dryRun':![],'backend':{'method':_0x3d86d3(0x1fb),'path':UPDATE_PATH},'warnings':[]},'message':'Updated\x20role\x20'+_0x28aa2a[_0x3d86d3(0x1df)]+'\x20(id='+_0x1f5b2f+')'};}};
@@ -1 +1 @@
1
- const a151_0x5e40f8=a151_0x193a;(function(_0x3a75c3,_0x4b6c3b){const _0x36f085=a151_0x193a,_0x2ad334=_0x3a75c3();while(!![]){try{const _0x11994a=-parseInt(_0x36f085(0x16f))/0x1+parseInt(_0x36f085(0x17a))/0x2+-parseInt(_0x36f085(0x17c))/0x3+parseInt(_0x36f085(0x171))/0x4+-parseInt(_0x36f085(0x177))/0x5+parseInt(_0x36f085(0x179))/0x6+-parseInt(_0x36f085(0x170))/0x7*(-parseInt(_0x36f085(0x174))/0x8);if(_0x11994a===_0x4b6c3b)break;else _0x2ad334['push'](_0x2ad334['shift']());}catch(_0x778ed0){_0x2ad334['push'](_0x2ad334['shift']());}}}(a151_0x588f,0xbe131));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a151_0x588f(){const _0xefc711=['603224yUxcZP','selector','user-add','7692100iOToJK','userId','821310xZeJyj','2110324hcbiGo','Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','208239nslyEu','appCode','198444aToAjy','112dCghCl','745308eRbIgR','roleName','No\x20change:\x20user\x20'];a151_0x588f=function(){return _0xefc711;};return a151_0x588f();}function a151_0x193a(_0x12c9e8,_0xce3375){_0x12c9e8=_0x12c9e8-0x16e;const _0x588f03=a151_0x588f();let _0x193a40=_0x588f03[_0x12c9e8];return _0x193a40;}import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':'role','command':a151_0x5e40f8(0x176),'description':a151_0x5e40f8(0x17b),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x23fed4){const {mutation:_0x1507ba}=await prepareUserMutation(_0x23fed4,'user-add',!![]);return asDryRunResult(_0x1507ba,{'method':'POST','url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x37e223){const _0x44e9ac=a151_0x5e40f8,{roleList:_0x42bad5,mutation:_0x24ee18,changed:_0x2277bd}=await prepareUserMutation(_0x37e223,'user-add',![]);return _0x2277bd&&await updateRoleUsers(_0x37e223[_0x44e9ac(0x16e)],_0x42bad5),{'ok':!![],'data':_0x24ee18,'message':_0x2277bd?'Added\x20user\x20'+_0x24ee18[_0x44e9ac(0x175)]['userId']+'\x20to\x20role\x20'+_0x24ee18[_0x44e9ac(0x175)][_0x44e9ac(0x172)]:_0x44e9ac(0x173)+_0x24ee18[_0x44e9ac(0x175)][_0x44e9ac(0x178)]+'\x20already\x20in\x20role\x20'+_0x24ee18['selector'][_0x44e9ac(0x172)]};}};
1
+ const a151_0x4b093e=a151_0x50ec;(function(_0x3353b7,_0x719949){const _0x3a2b07=a151_0x50ec,_0x26e8e5=_0x3353b7();while(!![]){try{const _0x189e37=-parseInt(_0x3a2b07(0x1f9))/0x1+parseInt(_0x3a2b07(0x1fd))/0x2+-parseInt(_0x3a2b07(0x1fb))/0x3+parseInt(_0x3a2b07(0x1f8))/0x4+parseInt(_0x3a2b07(0x1ff))/0x5+-parseInt(_0x3a2b07(0x1f7))/0x6*(parseInt(_0x3a2b07(0x201))/0x7)+parseInt(_0x3a2b07(0x202))/0x8;if(_0x189e37===_0x719949)break;else _0x26e8e5['push'](_0x26e8e5['shift']());}catch(_0x3c4792){_0x26e8e5['push'](_0x26e8e5['shift']());}}}(a151_0x3004,0xf3daa));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a151_0x50ec(_0xb7ec54,_0x16f342){_0xb7ec54=_0xb7ec54-0x1f4;const _0x300445=a151_0x3004();let _0x50ec38=_0x300445[_0xb7ec54];return _0x50ec38;}function a151_0x3004(){const _0x221096=['No\x20change:\x20user\x20','Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','user-add','appCode','324wfHSQG','6700412kGWLuF','1291271jfjwGp','userId','4306515SavtXL','Added\x20user\x20','17252WKvdaz','selector','1828915zvZGko','high-risk-write','219933fcvDJr','26981728dflKri','\x20already\x20in\x20role\x20','roleName'];a151_0x3004=function(){return _0x221096;};return a151_0x3004();}import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':'role','command':a151_0x4b093e(0x1f5),'description':a151_0x4b093e(0x1f4),'risk':a151_0x4b093e(0x200),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x34c313){const _0xcf4f67=a151_0x4b093e,{mutation:_0x57a10d}=await prepareUserMutation(_0x34c313,_0xcf4f67(0x1f5),!![]);return asDryRunResult(_0x57a10d,{'method':'POST','url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x255917){const _0x9643ef=a151_0x4b093e,{roleList:_0x4114c5,mutation:_0x10711d,changed:_0x39fff6}=await prepareUserMutation(_0x255917,'user-add',![]);return _0x39fff6&&await updateRoleUsers(_0x255917[_0x9643ef(0x1f6)],_0x4114c5),{'ok':!![],'data':_0x10711d,'message':_0x39fff6?_0x9643ef(0x1fc)+_0x10711d['selector'][_0x9643ef(0x1fa)]+'\x20to\x20role\x20'+_0x10711d['selector'][_0x9643ef(0x204)]:_0x9643ef(0x205)+_0x10711d[_0x9643ef(0x1fe)][_0x9643ef(0x1fa)]+_0x9643ef(0x203)+_0x10711d[_0x9643ef(0x1fe)]['roleName']};}};
@@ -1 +1 @@
1
- function a152_0x5e4a(){const _0x263bb8=['\x20not\x20in\x20role\x20','22384zSakwm','311268FeVJFS','userId','250IVwOoS','POST','584910CzJuBk','2304564VmyvWh','509836OJVMlm','34SEUfBP','roleName','role','3AcnYCh','selector','4457rAyaBn','Removed\x20user\x20','119HieHun','41166ULKtkW','user-remove','11RffPdN'];a152_0x5e4a=function(){return _0x263bb8;};return a152_0x5e4a();}const a152_0x113823=a152_0x255a;(function(_0x3edab2,_0x5b4fd6){const _0x267da2=a152_0x255a,_0x29ac4b=_0x3edab2();while(!![]){try{const _0x36187e=-parseInt(_0x267da2(0x1da))/0x1*(-parseInt(_0x267da2(0x1d5))/0x2)+parseInt(_0x267da2(0x1d8))/0x3*(parseInt(_0x267da2(0x1d4))/0x4)+-parseInt(_0x267da2(0x1d2))/0x5+parseInt(_0x267da2(0x1e2))/0x6+-parseInt(_0x267da2(0x1dc))/0x7*(-parseInt(_0x267da2(0x1e1))/0x8)+-parseInt(_0x267da2(0x1dd))/0x9*(-parseInt(_0x267da2(0x1e4))/0xa)+-parseInt(_0x267da2(0x1df))/0xb*(parseInt(_0x267da2(0x1d3))/0xc);if(_0x36187e===_0x5b4fd6)break;else _0x29ac4b['push'](_0x29ac4b['shift']());}catch(_0x44cb60){_0x29ac4b['push'](_0x29ac4b['shift']());}}}(a152_0x5e4a,0x1a5d9));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';function a152_0x255a(_0x51b3e7,_0x4c3684){_0x51b3e7=_0x51b3e7-0x1d1;const _0x5e4a56=a152_0x5e4a();let _0x255ae8=_0x5e4a56[_0x51b3e7];return _0x255ae8;}export const roleUserRemove={'service':a152_0x113823(0x1d7),'command':a152_0x113823(0x1de),'description':'Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x533790){const _0x54aaed=a152_0x113823,{mutation:_0x4b11c5}=await prepareUserMutation(_0x533790,_0x54aaed(0x1de),!![]);return asDryRunResult(_0x4b11c5,{'method':_0x54aaed(0x1d1),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x205133){const _0x1944f3=a152_0x113823,{roleList:_0x18f83b,mutation:_0x589b9e,changed:_0x1586ed}=await prepareUserMutation(_0x205133,_0x1944f3(0x1de),![]);return _0x1586ed&&await updateRoleUsers(_0x205133['appCode'],_0x18f83b),{'ok':!![],'data':_0x589b9e,'message':_0x1586ed?_0x1944f3(0x1db)+_0x589b9e[_0x1944f3(0x1d9)][_0x1944f3(0x1e3)]+'\x20from\x20role\x20'+_0x589b9e[_0x1944f3(0x1d9)][_0x1944f3(0x1d6)]:'No\x20change:\x20user\x20'+_0x589b9e['selector'][_0x1944f3(0x1e3)]+_0x1944f3(0x1e0)+_0x589b9e[_0x1944f3(0x1d9)]['roleName']};}};
1
+ const a152_0x4b5247=a152_0xdb35;(function(_0x4a3bed,_0xce1f8c){const _0xd2620c=a152_0xdb35,_0x9ae517=_0x4a3bed();while(!![]){try{const _0x32de95=-parseInt(_0xd2620c(0x183))/0x1+parseInt(_0xd2620c(0x18b))/0x2+parseInt(_0xd2620c(0x182))/0x3+-parseInt(_0xd2620c(0x189))/0x4*(parseInt(_0xd2620c(0x18c))/0x5)+-parseInt(_0xd2620c(0x187))/0x6*(parseInt(_0xd2620c(0x17c))/0x7)+parseInt(_0xd2620c(0x185))/0x8*(parseInt(_0xd2620c(0x188))/0x9)+parseInt(_0xd2620c(0x180))/0xa;if(_0x32de95===_0xce1f8c)break;else _0x9ae517['push'](_0x9ae517['shift']());}catch(_0x4fc1b9){_0x9ae517['push'](_0x9ae517['shift']());}}}(a152_0x364e,0x522e7));import{updateRoleUsers}from'../../core/api-client.js';function a152_0x364e(){const _0x1c19ff=['1119354PjNlRB','35DxRinu','user-remove','selector','high-risk-write','18452qmSPga','POST','No\x20change:\x20user\x20','role','4833370KTsTKV','userId','268563oRxBxK','489469VyXohU','roleName','512VSNsml','\x20not\x20in\x20role\x20','636HCynIp','31113KAJiyG','141876JJYvOa','Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes'];a152_0x364e=function(){return _0x1c19ff;};return a152_0x364e();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';function a152_0xdb35(_0x44fee4,_0xcbf06b){_0x44fee4=_0x44fee4-0x17b;const _0x364e45=a152_0x364e();let _0xdb350d=_0x364e45[_0x44fee4];return _0xdb350d;}export const roleUserRemove={'service':a152_0x4b5247(0x17f),'command':'user-remove','description':a152_0x4b5247(0x18a),'risk':a152_0x4b5247(0x17b),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0xc63b60){const _0x338d9e=a152_0x4b5247,{mutation:_0x5e2445}=await prepareUserMutation(_0xc63b60,_0x338d9e(0x18d),!![]);return asDryRunResult(_0x5e2445,{'method':_0x338d9e(0x17d),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x4fec6c){const _0x651b3=a152_0x4b5247,{roleList:_0x3b3311,mutation:_0x397afe,changed:_0x26a80d}=await prepareUserMutation(_0x4fec6c,_0x651b3(0x18d),![]);return _0x26a80d&&await updateRoleUsers(_0x4fec6c['appCode'],_0x3b3311),{'ok':!![],'data':_0x397afe,'message':_0x26a80d?'Removed\x20user\x20'+_0x397afe['selector'][_0x651b3(0x181)]+'\x20from\x20role\x20'+_0x397afe[_0x651b3(0x18e)]['roleName']:_0x651b3(0x17e)+_0x397afe[_0x651b3(0x18e)][_0x651b3(0x181)]+_0x651b3(0x186)+_0x397afe[_0x651b3(0x18e)][_0x651b3(0x184)]};}};
@@ -1 +1 @@
1
- const a153_0x58e6ea=a153_0x34c7;(function(_0x4ca5cf,_0x1727e0){const _0x19a665=a153_0x34c7,_0xd532cd=_0x4ca5cf();while(!![]){try{const _0x3ef993=-parseInt(_0x19a665(0x1ab))/0x1*(parseInt(_0x19a665(0x1ba))/0x2)+parseInt(_0x19a665(0x1bd))/0x3*(parseInt(_0x19a665(0x1b8))/0x4)+parseInt(_0x19a665(0x1b1))/0x5+-parseInt(_0x19a665(0x1ae))/0x6+parseInt(_0x19a665(0x1af))/0x7+parseInt(_0x19a665(0x1b7))/0x8+-parseInt(_0x19a665(0x1ac))/0x9*(-parseInt(_0x19a665(0x1b4))/0xa);if(_0x3ef993===_0x1727e0)break;else _0xd532cd['push'](_0xd532cd['shift']());}catch(_0x3b981a){_0xd532cd['push'](_0xd532cd['shift']());}}}(a153_0x5001,0x502a3));import{CliErrors}from'../../errors.js';function a153_0x34c7(_0xf6e78c,_0xb79f14){_0xf6e78c=_0xf6e78c-0x1ab;const _0x5001e9=a153_0x5001();let _0x34c71c=_0x5001e9[_0xf6e78c];return _0x34c71c;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a153_0x5001(){const _0x51e172=['role','6PyHEvE','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','trim','57xhqxaV','124361sWIUye','828KGNoSc','name','2874510eCgcTr','2486701pjQZvg','matchedBy','224910ZNGcjV','user-resolve','userId','9530oeKBSm','Resolved\x20\x22','flagMissing','2216584LAjnWH','87484JQgbNT'];a153_0x5001=function(){return _0x51e172;};return a153_0x5001();}import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a153_0x58e6ea(0x1b9),'command':a153_0x58e6ea(0x1b2),'description':a153_0x58e6ea(0x1bb),'risk':'read','flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0xba88cb){const _0x12ed80=a153_0x58e6ea;if(!_0xba88cb['str'](_0x12ed80(0x1ad))[_0x12ed80(0x1bc)]())throw CliErrors[_0x12ed80(0x1b6)]('name','Pass\x20--name\x20<nickname|username>.');},async 'execute'(_0x5b1676){const _0x3ae1e3=a153_0x58e6ea,_0x443be6=_0x5b1676['str'](_0x3ae1e3(0x1ad))[_0x3ae1e3(0x1bc)](),_0xd0c35d=await resolveUserRef(_0x443be6);return{'ok':!![],'data':{'user':{'userId':_0xd0c35d[_0x3ae1e3(0x1b3)],'username':_0xd0c35d['username'],'nickname':_0xd0c35d['nickname'],'matchedBy':_0xd0c35d[_0x3ae1e3(0x1b0)]}},'message':_0x3ae1e3(0x1b5)+_0x443be6+'\x22\x20→\x20userId\x20'+_0xd0c35d['userId']};}};
1
+ const a153_0x21f146=a153_0x45ac;(function(_0x332701,_0x49754d){const _0x352349=a153_0x45ac,_0x5c553b=_0x332701();while(!![]){try{const _0x2e89f1=parseInt(_0x352349(0x1cd))/0x1+-parseInt(_0x352349(0x1c9))/0x2*(parseInt(_0x352349(0x1d2))/0x3)+parseInt(_0x352349(0x1d9))/0x4+-parseInt(_0x352349(0x1cf))/0x5*(-parseInt(_0x352349(0x1d1))/0x6)+parseInt(_0x352349(0x1da))/0x7+parseInt(_0x352349(0x1d0))/0x8*(-parseInt(_0x352349(0x1c7))/0x9)+parseInt(_0x352349(0x1d7))/0xa;if(_0x2e89f1===_0x49754d)break;else _0x5c553b['push'](_0x5c553b['shift']());}catch(_0x49edd3){_0x5c553b['push'](_0x5c553b['shift']());}}}(a153_0x3685,0x35094));function a153_0x3685(){const _0x4ce23e=['192437ZBpQHl','str','\x22\x20→\x20userId\x20','183798MtsZMo','nickname','11724ZGcZCW','flagMissing','user-resolve','role','256295OxGzRz','username','30gBYzka','56uPdqri','2238ruliPU','186ZkUANF','userId','name','trim','matchedBy','3746700oGlxVD','read','251760dxOQwz'];a153_0x3685=function(){return _0x4ce23e;};return a153_0x3685();}import{CliErrors}from'../../errors.js';function a153_0x45ac(_0x22d595,_0x2ddb4a){_0x22d595=_0x22d595-0x1c7;const _0x36850c=a153_0x3685();let _0x45ac1e=_0x36850c[_0x22d595];return _0x45ac1e;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a153_0x21f146(0x1cc),'command':a153_0x21f146(0x1cb),'description':'Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','risk':a153_0x21f146(0x1d8),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x34654f){const _0x813ac7=a153_0x21f146;if(!_0x34654f[_0x813ac7(0x1db)](_0x813ac7(0x1d4))[_0x813ac7(0x1d5)]())throw CliErrors[_0x813ac7(0x1ca)](_0x813ac7(0x1d4),'Pass\x20--name\x20<nickname|username>.');},async 'execute'(_0x19a4da){const _0x4e2e01=a153_0x21f146,_0x4c0aa6=_0x19a4da[_0x4e2e01(0x1db)](_0x4e2e01(0x1d4))[_0x4e2e01(0x1d5)](),_0x50882f=await resolveUserRef(_0x4c0aa6);return{'ok':!![],'data':{'user':{'userId':_0x50882f[_0x4e2e01(0x1d3)],'username':_0x50882f[_0x4e2e01(0x1ce)],'nickname':_0x50882f[_0x4e2e01(0x1c8)],'matchedBy':_0x50882f[_0x4e2e01(0x1d6)]}},'message':'Resolved\x20\x22'+_0x4c0aa6+_0x4e2e01(0x1dc)+_0x50882f[_0x4e2e01(0x1d3)]};}};
@@ -1 +1 @@
1
- const a154_0x41cc60=a154_0x52e9;(function(_0x161013,_0x180f55){const _0xe49ffc=a154_0x52e9,_0xb5db7f=_0x161013();while(!![]){try{const _0x93d98d=parseInt(_0xe49ffc(0xdf))/0x1*(parseInt(_0xe49ffc(0xf2))/0x2)+-parseInt(_0xe49ffc(0xdd))/0x3*(parseInt(_0xe49ffc(0xe4))/0x4)+parseInt(_0xe49ffc(0xe8))/0x5*(-parseInt(_0xe49ffc(0xbd))/0x6)+parseInt(_0xe49ffc(0xcc))/0x7+parseInt(_0xe49ffc(0xed))/0x8*(-parseInt(_0xe49ffc(0xe9))/0x9)+parseInt(_0xe49ffc(0xb7))/0xa+parseInt(_0xe49ffc(0xd6))/0xb;if(_0x93d98d===_0x180f55)break;else _0xb5db7f['push'](_0xb5db7f['shift']());}catch(_0x17c3d7){_0xb5db7f['push'](_0xb5db7f['shift']());}}}(a154_0x3fb5,0x42cd7));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a154_0x41cc60(0xe3),'dev']);function readPackageScripts(_0x46ee2d){const _0x50609e=a154_0x41cc60,_0xbb4810=resolve(_0x46ee2d,_0x50609e(0xf7));if(!existsSync(_0xbb4810))return null;try{const _0xc0000e=JSON[_0x50609e(0xf5)](readFileSync(_0xbb4810,_0x50609e(0xd4)));return _0xc0000e[_0x50609e(0xc1)]??{};}catch{return null;}}function detectPackageManager(_0x5d6566){const _0x5efc4e=a154_0x41cc60;if(existsSync(resolve(_0x5d6566,_0x5efc4e(0xdc)))||existsSync(resolve(_0x5d6566,_0x5efc4e(0xcd))))return _0x5efc4e(0xc4);if(existsSync(resolve(_0x5d6566,_0x5efc4e(0xeb))))return _0x5efc4e(0xf1);if(existsSync(resolve(_0x5d6566,_0x5efc4e(0xca))))return _0x5efc4e(0xbc);return _0x5efc4e(0xd8);}async function versionCheck(_0x401f88){const _0x203c4e=a154_0x41cc60,_0x384c71=await checkCliVersion();(_0x384c71[_0x203c4e(0xf4)]||_0x384c71['belowMinimum'])&&(printCliUpgradeWarning(_0x384c71),assertCliVersionSupported(_0x384c71));const _0x4cdcb5=await checkSdkVersion(_0x401f88);if(_0x4cdcb5[_0x203c4e(0xf4)])printSdkUpgradeWarning(_0x4cdcb5);}function a154_0x52e9(_0x5d1a98,_0x3ffdcb){_0x5d1a98=_0x5d1a98-0xb7;const _0x3fb592=a154_0x3fb5();let _0x52e915=_0x3fb592[_0x5d1a98];return _0x52e915;}function spawnScript(_0x5cc001,_0x493b87,_0x3aaa8e,_0x245389){return new Promise((_0x27ff66,_0xf86568)=>{const _0x395ece=a154_0x52e9,_0x409943=[_0x395ece(0xc8),_0x493b87,..._0x3aaa8e],_0x5b5fd9=spawn(_0x5cc001,_0x409943,{'cwd':_0x245389,'stdio':_0x395ece(0xc0),'shell':!![],'env':{...process.env,'PATH':''+join(_0x245389,_0x395ece(0xc7),_0x395ece(0xd5))+delimiter+process.env.PATH}});_0x5b5fd9['on'](_0x395ece(0xe6),_0x8e9787=>{const _0x5e330a=_0x395ece;if(_0x8e9787===0x0||_0x8e9787===null)_0x27ff66();else _0xf86568(new Error(_0x5cc001+_0x5e330a(0xe7)+_0x493b87+'\x20exited\x20with\x20code\x20'+_0x8e9787));}),_0x5b5fd9['on'](_0x395ece(0xf6),_0xf86568);});}function spawnViteBuildWatch(_0x470042){return new Promise((_0x101ef3,_0x2c757f)=>{const _0x825ad1=a154_0x52e9,_0x56e256=spawn(_0x825ad1(0xd2),[_0x825ad1(0xd1),_0x825ad1(0xbb)],{'cwd':_0x470042,'stdio':_0x825ad1(0xc0),'shell':!![],'env':{...process.env,'PATH':''+join(_0x470042,_0x825ad1(0xc7),_0x825ad1(0xd5))+delimiter+process.env.PATH}});_0x56e256['on'](_0x825ad1(0xe6),_0x33da68=>{const _0x4515b9=_0x825ad1;if(_0x33da68===0x0||_0x33da68===null)_0x101ef3();else _0x2c757f(new Error(_0x4515b9(0xbe)+_0x33da68));}),_0x56e256['on'](_0x825ad1(0xf6),_0x2c757f);});}function spawnVitePreview(_0x2b4f46){return new Promise((_0xee0d40,_0x268e0a)=>{const _0x3f7d14=a154_0x52e9,_0x3bfe76=spawn(_0x3f7d14(0xd2),['preview'],{'cwd':_0x2b4f46,'stdio':_0x3f7d14(0xc0),'shell':!![],'env':{...process.env,'PATH':''+join(_0x2b4f46,_0x3f7d14(0xc7),'.bin')+delimiter+process.env.PATH}});_0x3bfe76['on'](_0x3f7d14(0xe6),_0x142ca4=>{if(_0x142ca4===0x0||_0x142ca4===null)_0xee0d40();else _0x268e0a(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x142ca4));}),_0x3bfe76['on'](_0x3f7d14(0xf6),_0x268e0a);});}function a154_0x3fb5(){const _0x563ae1=['vite','Enable\x20watch\x20mode\x20for\x20preview','utf-8','.bin','149666dUDeJc','log','npm','watch','join','slice','bun.lockb','27kkBrPC','read','7017QLvYyT','\x22\x20not\x20found\x20in\x20package.json.','all','\x20\x20\x20\x20','start','133604wTwKOP','args','close','\x20run\x20','5925qbIsPv','20583LXvPrA','has','pnpm-lock.yaml','No\x20scripts\x20defined\x20in\x20package.json.','384hoEvUx','\x20run\x20preview','length','validation','pnpm','66ZdUbzb','Script\x20\x22','needsUpgrade','parse','error','package.json','keys','1622000rtnBbL','Script\x20name\x20defined\x20in\x20package.json','No\x20package.json\x20found\x20in\x20current\x20directory.','bool','--watch','yarn','150stZgRM','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','\x20run\x20start','inherit','scripts','Available:\x20','(none)','bun','push','\x20run\x20preview\x20--watch','node_modules','run','boolean','yarn.lock','Run\x20a\x20package.json\x20script','2143862UFzyYc','bun.lock','\x0a\x20\x20Usage:\x20','script','\x20run\x20<script>\x0a','build'];a154_0x3fb5=function(){return _0x563ae1;};return a154_0x3fb5();}const runFlags=[{'name':a154_0x41cc60(0xd9),'type':a154_0x41cc60(0xc9),'description':a154_0x41cc60(0xd3),'default':![]}];export const runDefinition={'service':a154_0x41cc60(0xc8),'command':a154_0x41cc60(0xc8),'description':a154_0x41cc60(0xcb),'risk':a154_0x41cc60(0xde),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a154_0x41cc60(0xcf),'description':a154_0x41cc60(0xb8),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x4dcb4f=a154_0x41cc60,_0x88b7c0=[];return _0x88b7c0['push']('\x20\x20EXAMPLES'),_0x88b7c0['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x4dcb4f(0xbf)),_0x88b7c0[_0x4dcb4f(0xc5)](_0x4dcb4f(0xe2)+CLI_BIN_NAME+'\x20run\x20build'),_0x88b7c0[_0x4dcb4f(0xc5)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x4dcb4f(0xee)),_0x88b7c0['push'](_0x4dcb4f(0xe2)+CLI_BIN_NAME+_0x4dcb4f(0xc6)),_0x88b7c0[_0x4dcb4f(0xda)]('\x0a');},async 'execute'(_0x15ef5f){const _0x5e3a15=a154_0x41cc60,_0x18c252=process['cwd'](),_0x3fc743=_0x15ef5f[_0x5e3a15(0xe5)][0x0],_0x3ea004=_0x15ef5f[_0x5e3a15(0xe5)][_0x5e3a15(0xdb)](0x1),_0xc12dcf=readPackageScripts(_0x18c252);if(!_0xc12dcf)throw CliErrors[_0x5e3a15(0xf0)](_0x5e3a15(0xb9));if(!_0x3fc743){const _0x44fb56=Object[_0x5e3a15(0xf8)](_0xc12dcf);if(_0x44fb56[_0x5e3a15(0xef)]===0x0)console[_0x5e3a15(0xd7)](_0x5e3a15(0xec));else{console[_0x5e3a15(0xd7)]('\x0a\x20\x20Available\x20scripts:\x0a');for(const _0x2d3ff7 of _0x44fb56){console[_0x5e3a15(0xd7)](_0x5e3a15(0xe2)+_0x2d3ff7);}console['log'](_0x5e3a15(0xce)+CLI_BIN_NAME+_0x5e3a15(0xd0));}return{'ok':!![]};}if(!_0xc12dcf[_0x3fc743])throw CliErrors['validation'](_0x5e3a15(0xf3)+_0x3fc743+_0x5e3a15(0xe0),_0x5e3a15(0xc2)+(Object[_0x5e3a15(0xf8)](_0xc12dcf)['join'](',\x20')||_0x5e3a15(0xc3)));const _0x1ed2a3=detectPackageManager(_0x18c252);VERSION_CHECK_SCRIPTS[_0x5e3a15(0xea)](_0x3fc743)&&await versionCheck(_0x18c252);if(_0x3fc743==='preview'&&_0x15ef5f[_0x5e3a15(0xba)](_0x5e3a15(0xd9)))return await Promise[_0x5e3a15(0xe1)]([spawnViteBuildWatch(_0x18c252),spawnVitePreview(_0x18c252)]),{'ok':!![]};return await spawnScript(_0x1ed2a3,_0x3fc743,_0x3ea004,_0x18c252),{'ok':!![]};}};
1
+ const a154_0x49f937=a154_0x38b7;(function(_0x486d4b,_0x5e494a){const _0x3df7c5=a154_0x38b7,_0x5616b2=_0x486d4b();while(!![]){try{const _0x1be22f=-parseInt(_0x3df7c5(0x1aa))/0x1*(parseInt(_0x3df7c5(0x1b1))/0x2)+parseInt(_0x3df7c5(0x1d3))/0x3+-parseInt(_0x3df7c5(0x1d2))/0x4*(-parseInt(_0x3df7c5(0x1b5))/0x5)+-parseInt(_0x3df7c5(0x1b2))/0x6*(parseInt(_0x3df7c5(0x1d8))/0x7)+parseInt(_0x3df7c5(0x1b8))/0x8+-parseInt(_0x3df7c5(0x1c7))/0x9+-parseInt(_0x3df7c5(0x1bc))/0xa;if(_0x1be22f===_0x5e494a)break;else _0x5616b2['push'](_0x5616b2['shift']());}catch(_0x1c39d1){_0x5616b2['push'](_0x5616b2['shift']());}}}(a154_0x15a1,0x27bdd));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a154_0x49f937(0x1c6),a154_0x49f937(0x1b3)]);function readPackageScripts(_0x68a261){const _0x515200=a154_0x49f937,_0x4d5d06=resolve(_0x68a261,_0x515200(0x1e5));if(!existsSync(_0x4d5d06))return null;try{const _0x2a2f6f=JSON[_0x515200(0x1e0)](readFileSync(_0x4d5d06,_0x515200(0x1be)));return _0x2a2f6f[_0x515200(0x1bd)]??{};}catch{return null;}}function detectPackageManager(_0x4f8367){const _0x3fc8fd=a154_0x49f937;if(existsSync(resolve(_0x4f8367,'bun.lockb'))||existsSync(resolve(_0x4f8367,_0x3fc8fd(0x1e1))))return _0x3fc8fd(0x1d4);if(existsSync(resolve(_0x4f8367,_0x3fc8fd(0x1b6))))return _0x3fc8fd(0x1df);if(existsSync(resolve(_0x4f8367,'yarn.lock')))return _0x3fc8fd(0x1d7);return'npm';}async function versionCheck(_0x4762d1){const _0x30e29a=a154_0x49f937,_0x25981a=await checkCliVersion();(_0x25981a[_0x30e29a(0x1bb)]||_0x25981a['belowMinimum'])&&(printCliUpgradeWarning(_0x25981a),assertCliVersionSupported(_0x25981a));const _0x325729=await checkSdkVersion(_0x4762d1);if(_0x325729[_0x30e29a(0x1bb)])printSdkUpgradeWarning(_0x325729);}function spawnScript(_0x3970d0,_0x4bac04,_0x340dab,_0x56d501){return new Promise((_0xd63fd5,_0x41198f)=>{const _0x351cb2=a154_0x38b7,_0x384213=['run',_0x4bac04,..._0x340dab],_0x47a569=spawn(_0x3970d0,_0x384213,{'cwd':_0x56d501,'stdio':_0x351cb2(0x1e4),'shell':!![],'env':{...process.env,'PATH':''+join(_0x56d501,'node_modules',_0x351cb2(0x1d9))+delimiter+process.env.PATH}});_0x47a569['on'](_0x351cb2(0x1c5),_0xb25e1b=>{const _0x46edce=_0x351cb2;if(_0xb25e1b===0x0||_0xb25e1b===null)_0xd63fd5();else _0x41198f(new Error(_0x3970d0+'\x20run\x20'+_0x4bac04+_0x46edce(0x1ac)+_0xb25e1b));}),_0x47a569['on'](_0x351cb2(0x1a8),_0x41198f);});}function spawnViteBuildWatch(_0x17cc4d){return new Promise((_0x57bf6f,_0x226861)=>{const _0x522244=a154_0x38b7,_0x288b0d=spawn(_0x522244(0x1c9),['build',_0x522244(0x1d0)],{'cwd':_0x17cc4d,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x17cc4d,_0x522244(0x1d6),_0x522244(0x1d9))+delimiter+process.env.PATH}});_0x288b0d['on'](_0x522244(0x1c5),_0xb4d8c9=>{const _0x36a83d=_0x522244;if(_0xb4d8c9===0x0||_0xb4d8c9===null)_0x57bf6f();else _0x226861(new Error(_0x36a83d(0x1c1)+_0xb4d8c9));}),_0x288b0d['on'](_0x522244(0x1a8),_0x226861);});}function a154_0x38b7(_0x45e648,_0x364af9){_0x45e648=_0x45e648-0x1a8;const _0x15a183=a154_0x15a1();let _0x38b7ab=_0x15a183[_0x45e648];return _0x38b7ab;}function spawnVitePreview(_0x1479c8){return new Promise((_0x392b83,_0x5255b2)=>{const _0x141c74=a154_0x38b7,_0x20068b=spawn('vite',['preview'],{'cwd':_0x1479c8,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x1479c8,_0x141c74(0x1d6),_0x141c74(0x1d9))+delimiter+process.env.PATH}});_0x20068b['on'](_0x141c74(0x1c5),_0x4ad1d6=>{const _0x1239f5=_0x141c74;if(_0x4ad1d6===0x0||_0x4ad1d6===null)_0x392b83();else _0x5255b2(new Error(_0x1239f5(0x1af)+_0x4ad1d6));}),_0x20068b['on'](_0x141c74(0x1a8),_0x5255b2);});}function a154_0x15a1(){const _0x19837a=['bun','args','node_modules','yarn','954814WWyWbV','.bin','bool','cwd','push','Available:\x20','\x20\x20\x20\x20','pnpm','parse','bun.lock','all','run','inherit','package.json','error','script','29EnWSce','slice','\x20exited\x20with\x20code\x20','Script\x20\x22','\x0a\x20\x20Available\x20scripts:\x0a','vite\x20preview\x20exited\x20with\x20code\x20','\x20run\x20preview\x20--watch','2798DZEmyO','12GIGydd','dev','join','5LaZjrt','pnpm-lock.yaml','Script\x20name\x20defined\x20in\x20package.json','2404760CALrzn','\x20\x20EXAMPLES','\x22\x20not\x20found\x20in\x20package.json.','needsUpgrade','2382980eIMpem','scripts','utf-8','No\x20package.json\x20found\x20in\x20current\x20directory.','preview','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','\x20run\x20preview','watch','\x20run\x20build','close','start','325431hVHCAP','length','vite','log','validation','Enable\x20watch\x20mode\x20for\x20preview','No\x20scripts\x20defined\x20in\x20package.json.','(none)','boolean','--watch','\x20run\x20<script>\x0a','1006268mNDYxv','595353jslENO'];a154_0x15a1=function(){return _0x19837a;};return a154_0x15a1();}const runFlags=[{'name':a154_0x49f937(0x1c3),'type':a154_0x49f937(0x1cf),'description':a154_0x49f937(0x1cc),'default':![]}];export const runDefinition={'service':a154_0x49f937(0x1e3),'command':a154_0x49f937(0x1e3),'description':'Run\x20a\x20package.json\x20script','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a154_0x49f937(0x1a9),'description':a154_0x49f937(0x1b7),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x3bbf20=a154_0x49f937,_0x38c052=[];return _0x38c052[_0x3bbf20(0x1dc)](_0x3bbf20(0x1b9)),_0x38c052['push'](_0x3bbf20(0x1de)+CLI_BIN_NAME+'\x20run\x20start'),_0x38c052['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x3bbf20(0x1c4)),_0x38c052[_0x3bbf20(0x1dc)](_0x3bbf20(0x1de)+CLI_BIN_NAME+_0x3bbf20(0x1c2)),_0x38c052[_0x3bbf20(0x1dc)](_0x3bbf20(0x1de)+CLI_BIN_NAME+_0x3bbf20(0x1b0)),_0x38c052[_0x3bbf20(0x1b4)]('\x0a');},async 'execute'(_0x16ffec){const _0x7a2b63=a154_0x49f937,_0x293bc6=process[_0x7a2b63(0x1db)](),_0x17dca9=_0x16ffec[_0x7a2b63(0x1d5)][0x0],_0x45f592=_0x16ffec[_0x7a2b63(0x1d5)][_0x7a2b63(0x1ab)](0x1),_0x19d234=readPackageScripts(_0x293bc6);if(!_0x19d234)throw CliErrors[_0x7a2b63(0x1cb)](_0x7a2b63(0x1bf));if(!_0x17dca9){const _0x5e2c23=Object['keys'](_0x19d234);if(_0x5e2c23[_0x7a2b63(0x1c8)]===0x0)console[_0x7a2b63(0x1ca)](_0x7a2b63(0x1cd));else{console['log'](_0x7a2b63(0x1ae));for(const _0x549c19 of _0x5e2c23){console[_0x7a2b63(0x1ca)](_0x7a2b63(0x1de)+_0x549c19);}console[_0x7a2b63(0x1ca)]('\x0a\x20\x20Usage:\x20'+CLI_BIN_NAME+_0x7a2b63(0x1d1));}return{'ok':!![]};}if(!_0x19d234[_0x17dca9])throw CliErrors[_0x7a2b63(0x1cb)](_0x7a2b63(0x1ad)+_0x17dca9+_0x7a2b63(0x1ba),_0x7a2b63(0x1dd)+(Object['keys'](_0x19d234)['join'](',\x20')||_0x7a2b63(0x1ce)));const _0x57467a=detectPackageManager(_0x293bc6);VERSION_CHECK_SCRIPTS['has'](_0x17dca9)&&await versionCheck(_0x293bc6);if(_0x17dca9===_0x7a2b63(0x1c0)&&_0x16ffec[_0x7a2b63(0x1da)](_0x7a2b63(0x1c3)))return await Promise[_0x7a2b63(0x1e2)]([spawnViteBuildWatch(_0x293bc6),spawnVitePreview(_0x293bc6)]),{'ok':!![]};return await spawnScript(_0x57467a,_0x17dca9,_0x45f592,_0x293bc6),{'ok':!![]};}};
@@ -1 +1 @@
1
- const a155_0x42f173=a155_0x5cd2;(function(_0x5e6aab,_0x41d5ab){const _0x35622f=a155_0x5cd2,_0x6c6cb8=_0x5e6aab();while(!![]){try{const _0x5dccbc=-parseInt(_0x35622f(0x17d))/0x1+-parseInt(_0x35622f(0x180))/0x2+parseInt(_0x35622f(0x184))/0x3*(-parseInt(_0x35622f(0x182))/0x4)+parseInt(_0x35622f(0x17a))/0x5*(parseInt(_0x35622f(0x17f))/0x6)+parseInt(_0x35622f(0x187))/0x7*(parseInt(_0x35622f(0x17e))/0x8)+-parseInt(_0x35622f(0x186))/0x9*(parseInt(_0x35622f(0x17c))/0xa)+parseInt(_0x35622f(0x185))/0xb;if(_0x5dccbc===_0x41d5ab)break;else _0x6c6cb8['push'](_0x6c6cb8['shift']());}catch(_0x539e45){_0x6c6cb8['push'](_0x6c6cb8['shift']());}}}(a155_0xf38b,0xd0f88));function a155_0xf38b(){const _0x3f56dd=['6191870FPflPp','431410sIUXwJ','200LYELoU','8124918noSNIX','1905278mpDKAD','schema','3424592QaOwNf','export','3DkMifa','10013850caKoZX','9pMNJnK','406231egPUOC','read','Export\x20machine-readable\x20command\x20schema\x20(JSON)','5HimZTW','json'];a155_0xf38b=function(){return _0x3f56dd;};return a155_0xf38b();}import{buildSchemaPayload}from'../framework/schema-export.js';function a155_0x5cd2(_0x425170,_0xbfce2e){_0x425170=_0x425170-0x178;const _0xf38b8d=a155_0xf38b();let _0x5cd21b=_0xf38b8d[_0x425170];return _0x5cd21b;}async function execute(_0x1ca923){const _0x575cf7=await buildSchemaPayload();return{'ok':!![],'data':_0x575cf7};}export const schemaDefinition={'service':a155_0x42f173(0x181),'command':a155_0x42f173(0x183),'description':a155_0x42f173(0x179),'risk':a155_0x42f173(0x178),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a155_0x42f173(0x17b),'flags':[],'execute':execute};
1
+ const a155_0x5c7721=a155_0x5b0a;(function(_0x4d326a,_0x542608){const _0x59c1a3=a155_0x5b0a,_0x4ea0cd=_0x4d326a();while(!![]){try{const _0x1d42f5=parseInt(_0x59c1a3(0x8a))/0x1+parseInt(_0x59c1a3(0x8f))/0x2+parseInt(_0x59c1a3(0x8b))/0x3+-parseInt(_0x59c1a3(0x8c))/0x4+-parseInt(_0x59c1a3(0x95))/0x5+parseInt(_0x59c1a3(0x92))/0x6*(-parseInt(_0x59c1a3(0x8d))/0x7)+-parseInt(_0x59c1a3(0x94))/0x8*(parseInt(_0x59c1a3(0x90))/0x9);if(_0x1d42f5===_0x542608)break;else _0x4ea0cd['push'](_0x4ea0cd['shift']());}catch(_0x463b75){_0x4ea0cd['push'](_0x4ea0cd['shift']());}}}(a155_0xfb6d,0xa2007));import{buildSchemaPayload}from'../framework/schema-export.js';function a155_0x5b0a(_0x29a19d,_0x5bb990){_0x29a19d=_0x29a19d-0x8a;const _0xfb6dc9=a155_0xfb6d();let _0x5b0aea=_0xfb6dc9[_0x29a19d];return _0x5b0aea;}function a155_0xfb6d(){const _0x27f35a=['1224267UlmYpb','3264165GcORpA','1887340PdKXou','66710qPOReN','export','2557320qUPMhu','18pvRQCH','schema','24KWdjqj','read','5471448pDVTZg','5248030pbaQlZ','json'];a155_0xfb6d=function(){return _0x27f35a;};return a155_0xfb6d();}async function execute(_0x42bd33){const _0x291894=await buildSchemaPayload();return{'ok':!![],'data':_0x291894};}export const schemaDefinition={'service':a155_0x5c7721(0x91),'command':a155_0x5c7721(0x8e),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a155_0x5c7721(0x93),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a155_0x5c7721(0x96),'flags':[],'execute':execute};
@@ -1 +1 @@
1
- const a156_0x126934=a156_0xb299;(function(_0x265eb0,_0xe11e9b){const _0xf47180=a156_0xb299,_0x25eccb=_0x265eb0();while(!![]){try{const _0x378c51=-parseInt(_0xf47180(0x210))/0x1+-parseInt(_0xf47180(0x1fc))/0x2*(-parseInt(_0xf47180(0x1e1))/0x3)+parseInt(_0xf47180(0x1e9))/0x4*(parseInt(_0xf47180(0x20f))/0x5)+parseInt(_0xf47180(0x1e7))/0x6+-parseInt(_0xf47180(0x203))/0x7+-parseInt(_0xf47180(0x1eb))/0x8*(-parseInt(_0xf47180(0x21e))/0x9)+-parseInt(_0xf47180(0x1f7))/0xa*(-parseInt(_0xf47180(0x1ec))/0xb);if(_0x378c51===_0xe11e9b)break;else _0x25eccb['push'](_0x25eccb['shift']());}catch(_0x2be3ec){_0x25eccb['push'](_0x25eccb['shift']());}}}(a156_0xa852,0xea145));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';function a156_0xb299(_0x2ccf74,_0x41b4de){_0x2ccf74=_0x2ccf74-0x1df;const _0xa8522a=a156_0xa852();let _0xb2991=_0xa8522a[_0x2ccf74];return _0xb2991;}import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function a156_0xa852(){const _0x151b6a=['utf8','✎\x20手动输入\x20dbId','3860088jqFvpg','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','24036eCNTJL','validation','155704LDNbYr','516527pHOjVE','number','sqlRootDir','SQL\x20query\x20display\x20name','name','dbId\x20不能为空','join','<server-generated-sqlCode>','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','dbName','sqlCode','150wLehNG','Target\x20database\x20ID','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','Local\x20SQL\x20file\x20mode','POST','2BXuUVr','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','普通\x20SQL(sql)','db-id','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','stringify','sqlRoot','5743038YbhxON','sqls','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','__manual__','SQL\x20名称不能为空','MyBatis\x20XML(mybatisXml)','Created\x20SQL\x20query\x20','lastSync','flag','appCode','sql','dbId\x20必须为正整数','1025kQrtFs','1606565WQqryv','lockFilePath','请选择目标数据库:','trim','请输入\x20SQL\x20名称:','high-risk-write','dbId','create','SELECT\x201\x20AS\x20id;','new','isInteger','mode','mybatisXml','parse','9NcwOpk','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','isFinite','description','catch','nonInteractive','string','length','sqlName','2360331JPpMqt','str','map','flagMissing'];a156_0xa852=function(){return _0x151b6a;};return a156_0xa852();}function generateSqlTemplate(_0x487975){const _0x380888=a156_0xb299;if(_0x487975===_0x380888(0x21c))return[_0x380888(0x205),'\x20\x20SELECT\x201\x20AS\x20id','</select>',''][_0x380888(0x1f2)]('\x0a');return[_0x380888(0x218),''][_0x380888(0x1f2)]('\x0a');}export const sqlCreate={'service':a156_0x126934(0x20d),'command':a156_0x126934(0x217),'description':a156_0x126934(0x1e8),'risk':a156_0x126934(0x215),'flags':[{'name':a156_0x126934(0x1f0),'type':a156_0x126934(0x224),'description':a156_0x126934(0x1ef)},{'name':a156_0x126934(0x1ff),'type':a156_0x126934(0x1ed),'description':a156_0x126934(0x1f8)},{'name':a156_0x126934(0x21b),'type':a156_0x126934(0x224),'enum':['sql',a156_0x126934(0x21c)],'description':a156_0x126934(0x1fa)}],async 'validate'(_0xe86012){const _0x49e3bd=a156_0x126934;if(!_0xe86012[_0x49e3bd(0x223)])return;if(!_0xe86012['str'](_0x49e3bd(0x1f0))['trim']())throw CliErrors[_0x49e3bd(0x1e4)](_0x49e3bd(0x1f0),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x1aa3e1=resolveProvidedDbId(_0xe86012);if(typeof _0x1aa3e1!==_0x49e3bd(0x1ed)||!Number[_0x49e3bd(0x220)](_0x1aa3e1)||_0x1aa3e1<=0x0)throw CliErrors[_0x49e3bd(0x1e4)](_0x49e3bd(0x1ff),_0x49e3bd(0x1fd));if(!_0xe86012['str'](_0x49e3bd(0x21b))[_0x49e3bd(0x213)]())throw CliErrors[_0x49e3bd(0x1e4)](_0x49e3bd(0x21b),_0x49e3bd(0x1f9));},async 'dryRun'(_0x2223ed){const _0x4de32a=a156_0x126934,_0x450d33=loadSqlProjectConfig(_0x2223ed[_0x4de32a(0x20c)]),{sqlName:_0x3f7029,dbId:_0x329031,dbName:_0x4c6074,mode:_0x4598bf}=await resolveSqlNewInputs(_0x2223ed),_0x4461e1=buildSqlRelativePath(_0x4de32a(0x1f3),_0x3f7029,_0x4c6074,_0x4598bf,_0x329031),_0x48370a=_0x450d33[_0x4de32a(0x1ee)]+'/'+_0x4461e1;return{'method':_0x4de32a(0x1fb),'url':'/smartapi/custom/saveUserCustomSql','body':{'appCode':_0x2223ed[_0x4de32a(0x20c)],'sqlName':_0x3f7029,'dbId':_0x329031,'mode':_0x4598bf,'localPath':_0x48370a},'description':_0x4de32a(0x21f)+_0x450d33['sqlRootDir']};},async 'execute'(_0x2a363d){const _0x399b65=a156_0x126934,_0x4e8fc1=loadSqlProjectConfig(_0x2a363d[_0x399b65(0x20c)]),{sqlName:_0x26f7b8,dbId:_0xbad78,dbName:_0x3a86d1,mode:_0x597344}=await resolveSqlNewInputs(_0x2a363d),_0x11b50e=generateSqlTemplate(_0x597344),_0xbe28d3=await createSqlQuery({'appCode':_0x2a363d['appCode'],'sqlName':_0x26f7b8,'dbId':_0xbad78,'sqlContent':_0x11b50e}),_0x3d3a94=ensureRemoteSqlContent(_0xbe28d3),_0x2a5005=_0x3a86d1||await getDbName(_0x2a363d[_0x399b65(0x20c)],_0xbad78)[_0x399b65(0x222)](()=>undefined),_0x28133d=buildSqlRelativePath(_0xbe28d3[_0x399b65(0x1f6)],_0xbe28d3['sqlName'],_0x2a5005,_0x597344,_0xbad78),_0x709b8d=_0x4e8fc1['sqlRootDir']+'/'+_0x28133d,_0x2d36d9=buildLocalSqlFileContent({'sqlCode':_0xbe28d3[_0x399b65(0x1f6)],'sqlName':_0xbe28d3[_0x399b65(0x1e0)],'dbId':_0xbe28d3['dbId']},_0x3d3a94,{'dbName':_0x2a5005,'mode':_0x597344,'syncedAt':new Date()['toISOString'](),'description':_0xbe28d3[_0x399b65(0x221)]});if(await fileExists(_0x709b8d))throw CliErrors['validation']('File\x20already\x20exists:\x20'+_0x709b8d);await ensureParentDirectory(_0x709b8d),await writeFile(_0x709b8d,_0x2d36d9,_0x399b65(0x1e5));const _0x4c96ef=await readSqlLockFile(_0x4e8fc1['lockFilePath']),{lockData:_0x3f2790,appLock:_0x533925}=ensureSqlLockScope(_0x4c96ef??createEmptySqlLock(),_0x4e8fc1[_0x399b65(0x20c)],_0x4e8fc1[_0x399b65(0x202)],_0x399b65(0x219));return _0x533925[_0x399b65(0x204)][_0xbe28d3[_0x399b65(0x1f6)]]={...buildSqlLockEntry(_0xbe28d3,_0x3d3a94,computeSqlContentHash(_0x2d36d9),{'dbName':_0x2a5005}),'path':_0x28133d,'mode':_0x597344},_0x533925[_0x399b65(0x20a)]=new Date()['toISOString'](),await writeSqlLockFile(_0x4e8fc1[_0x399b65(0x211)],_0x3f2790),{'ok':!![],'data':{'id':_0xbe28d3['id'],'sqlCode':_0xbe28d3[_0x399b65(0x1f6)],'sqlName':_0xbe28d3[_0x399b65(0x1e0)],'dbId':_0xbe28d3[_0x399b65(0x216)],'path':_0x709b8d,'mode':_0x597344},'message':_0x399b65(0x209)+_0xbe28d3[_0x399b65(0x1f6)]};}};async function resolveSqlNewInputs(_0x52efdc){const _0xb4f495=await resolveSqlNameInput(_0x52efdc),{dbId:_0x382c9c,dbName:_0x5805b7}=await resolveDbSelection(_0x52efdc),_0x1b926e=await resolveSqlModeInput(_0x52efdc);return{'sqlName':_0xb4f495,'dbId':_0x382c9c,'dbName':_0x5805b7,'mode':_0x1b926e};}async function resolveSqlNameInput(_0x38cafc){const _0x128abf=a156_0x126934,_0x3f264c=_0x38cafc['str'](_0x128abf(0x1f0))[_0x128abf(0x213)]();if(_0x3f264c)return _0x3f264c;if(_0x38cafc[_0x128abf(0x223)])throw CliErrors['flagMissing']('name',_0x128abf(0x1f4));return(await input({'message':_0x128abf(0x214),'validate':_0x4aeea6=>_0x4aeea6[_0x128abf(0x213)]()?!![]:_0x128abf(0x207)}))[_0x128abf(0x213)]();}async function resolveDbSelection(_0x25bb1e){const _0x1a35c5=a156_0x126934,_0xc6f185=resolveProvidedDbId(_0x25bb1e);if(typeof _0xc6f185==='number'&&Number[_0x1a35c5(0x220)](_0xc6f185)&&_0xc6f185>0x0)return{'dbId':_0xc6f185,'dbName':await getDbName(_0x25bb1e['appCode'],_0xc6f185)['catch'](()=>undefined)};if(_0x25bb1e[_0x1a35c5(0x223)])throw CliErrors['flagMissing'](_0x1a35c5(0x1ff),_0x1a35c5(0x1fd));const _0x27b6bc=await listDatabases(_0x25bb1e['appCode'])[_0x1a35c5(0x222)](()=>[]);if(_0x27b6bc[_0x1a35c5(0x1df)]===0x1)return{'dbId':_0x27b6bc[0x0][_0x1a35c5(0x216)],'dbName':_0x27b6bc[0x0][_0x1a35c5(0x1f5)]};if(_0x27b6bc[_0x1a35c5(0x1df)]>0x1){const _0xf33337=await select({'message':_0x1a35c5(0x212),'choices':[..._0x27b6bc[_0x1a35c5(0x1e3)](_0x1476f1=>({'name':_0x1476f1['dbName']+'\x20('+_0x1476f1[_0x1a35c5(0x216)]+')','value':serializeDbSelection(_0x1476f1)})),{'name':_0x1a35c5(0x1e6),'value':_0x1a35c5(0x206)}]});if(_0xf33337!==_0x1a35c5(0x206))return deserializeDbSelection(_0xf33337);}const _0xbfb197=await input({'message':'请输入目标数据库\x20dbId:','validate':_0x54ddbe=>{const _0x4b037c=_0x1a35c5,_0x36e95c=_0x54ddbe[_0x4b037c(0x213)]();if(!_0x36e95c)return _0x4b037c(0x1f1);const _0x32b88f=Number(_0x36e95c);if(!Number[_0x4b037c(0x21a)](_0x32b88f)||_0x32b88f<=0x0)return _0x4b037c(0x20e);return!![];}});return{'dbId':Number(_0xbfb197['trim']())};}async function resolveSqlModeInput(_0x23194d){const _0x3fdbe3=a156_0x126934,_0x2f146a=_0x23194d[_0x3fdbe3(0x1e2)]('mode')[_0x3fdbe3(0x213)]();if(_0x2f146a===_0x3fdbe3(0x20d)||_0x2f146a===_0x3fdbe3(0x21c))return _0x2f146a;if(_0x23194d[_0x3fdbe3(0x223)])throw CliErrors[_0x3fdbe3(0x1e4)](_0x3fdbe3(0x21b),_0x3fdbe3(0x1f9));return await select({'message':'请选择本地\x20SQL\x20模式:','choices':[{'name':_0x3fdbe3(0x1fe),'value':_0x3fdbe3(0x20d),'description':_0x3fdbe3(0x200)},{'name':_0x3fdbe3(0x208),'value':_0x3fdbe3(0x21c),'description':'适合带动态标签的\x20MyBatis\x20XML\x20SQL'}]});}function serializeDbSelection(_0x271ce5){const _0x3fe400=a156_0x126934;return JSON[_0x3fe400(0x201)]({'dbId':_0x271ce5[_0x3fe400(0x216)],'dbName':_0x271ce5[_0x3fe400(0x1f5)]});}function deserializeDbSelection(_0x52b772){const _0x3e11d8=a156_0x126934;try{const _0x20043f=JSON[_0x3e11d8(0x21d)](_0x52b772);if(typeof _0x20043f[_0x3e11d8(0x216)]===_0x3e11d8(0x1ed)&&Number[_0x3e11d8(0x220)](_0x20043f['dbId']))return{'dbId':_0x20043f[_0x3e11d8(0x216)],'dbName':_0x20043f[_0x3e11d8(0x1f5)]};}catch{}throw CliErrors[_0x3e11d8(0x1ea)]('Invalid\x20database\x20selection\x20payload:\x20'+_0x52b772);}function resolveProvidedDbId(_0xecc950){const _0x1aad52=a156_0x126934,_0x345def=_0xecc950[_0x1aad52(0x20b)](_0x1aad52(0x1ff));if(typeof _0x345def===_0x1aad52(0x1ed)&&Number[_0x1aad52(0x220)](_0x345def))return _0x345def;return undefined;}
1
+ const a156_0x50e9e7=a156_0x42dd;(function(_0x142527,_0x4b75f1){const _0x3fd3ec=a156_0x42dd,_0x3f4cf4=_0x142527();while(!![]){try{const _0x5f3961=-parseInt(_0x3fd3ec(0x120))/0x1*(-parseInt(_0x3fd3ec(0x12a))/0x2)+-parseInt(_0x3fd3ec(0x145))/0x3*(parseInt(_0x3fd3ec(0x11b))/0x4)+-parseInt(_0x3fd3ec(0x11c))/0x5+-parseInt(_0x3fd3ec(0x146))/0x6+parseInt(_0x3fd3ec(0x114))/0x7*(-parseInt(_0x3fd3ec(0x117))/0x8)+parseInt(_0x3fd3ec(0x149))/0x9*(parseInt(_0x3fd3ec(0x108))/0xa)+parseInt(_0x3fd3ec(0x133))/0xb;if(_0x5f3961===_0x4b75f1)break;else _0x3f4cf4['push'](_0x3f4cf4['shift']());}catch(_0x3364d3){_0x3f4cf4['push'](_0x3f4cf4['shift']());}}}(a156_0x38f0,0xdf558));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';function a156_0x38f0(){const _0x96559b=['2AfXQNu','Local\x20SQL\x20file\x20mode','string','请输入目标数据库\x20dbId:','sql','dbId','flag','Created\x20SQL\x20query\x20','name','flagMissing','495346jVhHxB','dbId\x20必须为正整数','普通\x20SQL(sql)','mybatisXml','create','isInteger','map','✎\x20手动输入\x20dbId','isFinite','41112478fNZvqs','POST','请输入\x20SQL\x20名称:','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','请选择本地\x20SQL\x20模式:','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','/smartapi/custom/saveUserCustomSql','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','stringify','sqlCode','lockFilePath','<server-generated-sqlCode>','str','__manual__','length','catch','high-risk-write','db-id','148233jPHuPD','5039610GwSRbX','number','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','664695wRKirY','SELECT\x201\x20AS\x20id;','20bXNAIm','validation','toISOString','Invalid\x20database\x20selection\x20payload:\x20','utf8','parse','nonInteractive','sqls','trim','mode','\x20\x20SELECT\x201\x20AS\x20id','appCode','2261FXBxNo','Target\x20database\x20ID','dbName','25768AdsyyP','sqlName','join','dbId\x20不能为空','12rHqccH','7186135zDIFEG','SQL\x20query\x20display\x20name','new','sqlRootDir'];a156_0x38f0=function(){return _0x96559b;};return a156_0x38f0();}import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x271e4e){const _0x593dd2=a156_0x42dd;if(_0x271e4e===_0x593dd2(0x12d))return['<select\x20id=\x22query\x22\x20resultType=\x22map\x22>',_0x593dd2(0x112),'</select>',''][_0x593dd2(0x119)]('\x0a');return[_0x593dd2(0x14a),''][_0x593dd2(0x119)]('\x0a');}function a156_0x42dd(_0x341641,_0x4b2f71){_0x341641=_0x341641-0x108;const _0x38f07c=a156_0x38f0();let _0x42dd95=_0x38f07c[_0x341641];return _0x42dd95;}export const sqlCreate={'service':a156_0x50e9e7(0x124),'command':a156_0x50e9e7(0x12e),'description':a156_0x50e9e7(0x148),'risk':a156_0x50e9e7(0x143),'flags':[{'name':a156_0x50e9e7(0x128),'type':'string','description':a156_0x50e9e7(0x11d)},{'name':a156_0x50e9e7(0x144),'type':a156_0x50e9e7(0x147),'description':a156_0x50e9e7(0x115)},{'name':'mode','type':a156_0x50e9e7(0x122),'enum':['sql','mybatisXml'],'description':a156_0x50e9e7(0x121)}],async 'validate'(_0x1286bf){const _0x363557=a156_0x50e9e7;if(!_0x1286bf[_0x363557(0x10e)])return;if(!_0x1286bf[_0x363557(0x13f)](_0x363557(0x128))[_0x363557(0x110)]())throw CliErrors[_0x363557(0x129)](_0x363557(0x128),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0xb0cd54=resolveProvidedDbId(_0x1286bf);if(typeof _0xb0cd54!==_0x363557(0x147)||!Number[_0x363557(0x132)](_0xb0cd54)||_0xb0cd54<=0x0)throw CliErrors[_0x363557(0x129)](_0x363557(0x144),_0x363557(0x138));if(!_0x1286bf[_0x363557(0x13f)](_0x363557(0x111))[_0x363557(0x110)]())throw CliErrors[_0x363557(0x129)]('mode','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0x53fd27){const _0x597f00=a156_0x50e9e7,_0x518407=loadSqlProjectConfig(_0x53fd27[_0x597f00(0x113)]),{sqlName:_0x28923b,dbId:_0x2ad01d,dbName:_0x1139ef,mode:_0x2b43a4}=await resolveSqlNewInputs(_0x53fd27),_0x46b088=buildSqlRelativePath(_0x597f00(0x13e),_0x28923b,_0x1139ef,_0x2b43a4,_0x2ad01d),_0x1e76c3=_0x518407['sqlRootDir']+'/'+_0x46b088;return{'method':_0x597f00(0x134),'url':_0x597f00(0x139),'body':{'appCode':_0x53fd27['appCode'],'sqlName':_0x28923b,'dbId':_0x2ad01d,'mode':_0x2b43a4,'localPath':_0x1e76c3},'description':'Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20'+_0x518407[_0x597f00(0x11f)]};},async 'execute'(_0x20711a){const _0x4dc13f=a156_0x50e9e7,_0x39b038=loadSqlProjectConfig(_0x20711a[_0x4dc13f(0x113)]),{sqlName:_0x32331b,dbId:_0x461a46,dbName:_0x1a7010,mode:_0x53274b}=await resolveSqlNewInputs(_0x20711a),_0x1f6924=generateSqlTemplate(_0x53274b),_0x273d13=await createSqlQuery({'appCode':_0x20711a[_0x4dc13f(0x113)],'sqlName':_0x32331b,'dbId':_0x461a46,'sqlContent':_0x1f6924}),_0x507f4f=ensureRemoteSqlContent(_0x273d13),_0x13765e=_0x1a7010||await getDbName(_0x20711a[_0x4dc13f(0x113)],_0x461a46)['catch'](()=>undefined),_0x3cb21d=buildSqlRelativePath(_0x273d13[_0x4dc13f(0x13c)],_0x273d13[_0x4dc13f(0x118)],_0x13765e,_0x53274b,_0x461a46),_0x3dc2a9=_0x39b038[_0x4dc13f(0x11f)]+'/'+_0x3cb21d,_0x45719d=buildLocalSqlFileContent({'sqlCode':_0x273d13[_0x4dc13f(0x13c)],'sqlName':_0x273d13[_0x4dc13f(0x118)],'dbId':_0x273d13[_0x4dc13f(0x125)]},_0x507f4f,{'dbName':_0x13765e,'mode':_0x53274b,'syncedAt':new Date()[_0x4dc13f(0x10a)](),'description':_0x273d13['description']});if(await fileExists(_0x3dc2a9))throw CliErrors[_0x4dc13f(0x109)]('File\x20already\x20exists:\x20'+_0x3dc2a9);await ensureParentDirectory(_0x3dc2a9),await writeFile(_0x3dc2a9,_0x45719d,_0x4dc13f(0x10c));const _0x562d9c=await readSqlLockFile(_0x39b038['lockFilePath']),{lockData:_0x1bc38b,appLock:_0x5d483a}=ensureSqlLockScope(_0x562d9c??createEmptySqlLock(),_0x39b038[_0x4dc13f(0x113)],_0x39b038['sqlRoot'],_0x4dc13f(0x11e));return _0x5d483a[_0x4dc13f(0x10f)][_0x273d13[_0x4dc13f(0x13c)]]={...buildSqlLockEntry(_0x273d13,_0x507f4f,computeSqlContentHash(_0x45719d),{'dbName':_0x13765e}),'path':_0x3cb21d,'mode':_0x53274b},_0x5d483a['lastSync']=new Date()[_0x4dc13f(0x10a)](),await writeSqlLockFile(_0x39b038[_0x4dc13f(0x13d)],_0x1bc38b),{'ok':!![],'data':{'id':_0x273d13['id'],'sqlCode':_0x273d13[_0x4dc13f(0x13c)],'sqlName':_0x273d13[_0x4dc13f(0x118)],'dbId':_0x273d13['dbId'],'path':_0x3dc2a9,'mode':_0x53274b},'message':_0x4dc13f(0x127)+_0x273d13[_0x4dc13f(0x13c)]};}};async function resolveSqlNewInputs(_0x12cc4d){const _0x48063d=await resolveSqlNameInput(_0x12cc4d),{dbId:_0x10631d,dbName:_0x2f6748}=await resolveDbSelection(_0x12cc4d),_0x608336=await resolveSqlModeInput(_0x12cc4d);return{'sqlName':_0x48063d,'dbId':_0x10631d,'dbName':_0x2f6748,'mode':_0x608336};}async function resolveSqlNameInput(_0x436dd9){const _0x41e461=a156_0x50e9e7,_0x764e1e=_0x436dd9[_0x41e461(0x13f)](_0x41e461(0x128))[_0x41e461(0x110)]();if(_0x764e1e)return _0x764e1e;if(_0x436dd9['nonInteractive'])throw CliErrors['flagMissing'](_0x41e461(0x128),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');return(await input({'message':_0x41e461(0x135),'validate':_0x51108a=>_0x51108a[_0x41e461(0x110)]()?!![]:'SQL\x20名称不能为空'}))['trim']();}async function resolveDbSelection(_0x92dd20){const _0xae0806=a156_0x50e9e7,_0x1f5d74=resolveProvidedDbId(_0x92dd20);if(typeof _0x1f5d74===_0xae0806(0x147)&&Number[_0xae0806(0x132)](_0x1f5d74)&&_0x1f5d74>0x0)return{'dbId':_0x1f5d74,'dbName':await getDbName(_0x92dd20[_0xae0806(0x113)],_0x1f5d74)[_0xae0806(0x142)](()=>undefined)};if(_0x92dd20[_0xae0806(0x10e)])throw CliErrors[_0xae0806(0x129)]('db-id',_0xae0806(0x138));const _0x1d3b1c=await listDatabases(_0x92dd20['appCode'])['catch'](()=>[]);if(_0x1d3b1c['length']===0x1)return{'dbId':_0x1d3b1c[0x0][_0xae0806(0x125)],'dbName':_0x1d3b1c[0x0]['dbName']};if(_0x1d3b1c[_0xae0806(0x141)]>0x1){const _0x58a634=await select({'message':'请选择目标数据库:','choices':[..._0x1d3b1c[_0xae0806(0x130)](_0x6837d2=>({'name':_0x6837d2[_0xae0806(0x116)]+'\x20('+_0x6837d2[_0xae0806(0x125)]+')','value':serializeDbSelection(_0x6837d2)})),{'name':_0xae0806(0x131),'value':'__manual__'}]});if(_0x58a634!==_0xae0806(0x140))return deserializeDbSelection(_0x58a634);}const _0x29e453=await input({'message':_0xae0806(0x123),'validate':_0x4f750a=>{const _0x3ff48d=_0xae0806,_0x616320=_0x4f750a[_0x3ff48d(0x110)]();if(!_0x616320)return _0x3ff48d(0x11a);const _0x4645d0=Number(_0x616320);if(!Number[_0x3ff48d(0x12f)](_0x4645d0)||_0x4645d0<=0x0)return _0x3ff48d(0x12b);return!![];}});return{'dbId':Number(_0x29e453[_0xae0806(0x110)]())};}async function resolveSqlModeInput(_0x32a7d7){const _0xd912f9=a156_0x50e9e7,_0x588c27=_0x32a7d7['str'](_0xd912f9(0x111))[_0xd912f9(0x110)]();if(_0x588c27==='sql'||_0x588c27===_0xd912f9(0x12d))return _0x588c27;if(_0x32a7d7[_0xd912f9(0x10e)])throw CliErrors[_0xd912f9(0x129)]('mode',_0xd912f9(0x13a));return await select({'message':_0xd912f9(0x137),'choices':[{'name':_0xd912f9(0x12c),'value':_0xd912f9(0x124),'description':_0xd912f9(0x136)},{'name':'MyBatis\x20XML(mybatisXml)','value':_0xd912f9(0x12d),'description':'适合带动态标签的\x20MyBatis\x20XML\x20SQL'}]});}function serializeDbSelection(_0x13c395){const _0x24e148=a156_0x50e9e7;return JSON[_0x24e148(0x13b)]({'dbId':_0x13c395['dbId'],'dbName':_0x13c395[_0x24e148(0x116)]});}function deserializeDbSelection(_0x548fb6){const _0x172485=a156_0x50e9e7;try{const _0x44fa51=JSON[_0x172485(0x10d)](_0x548fb6);if(typeof _0x44fa51['dbId']===_0x172485(0x147)&&Number[_0x172485(0x132)](_0x44fa51['dbId']))return{'dbId':_0x44fa51[_0x172485(0x125)],'dbName':_0x44fa51['dbName']};}catch{}throw CliErrors[_0x172485(0x109)](_0x172485(0x10b)+_0x548fb6);}function resolveProvidedDbId(_0x3ec298){const _0x34e2f3=a156_0x50e9e7,_0x3f6767=_0x3ec298[_0x34e2f3(0x126)](_0x34e2f3(0x144));if(typeof _0x3f6767===_0x34e2f3(0x147)&&Number[_0x34e2f3(0x132)](_0x3f6767))return _0x3f6767;return undefined;}
@@ -1 +1 @@
1
- const a157_0x10c2ba=a157_0x20d3;function a157_0x20d3(_0x814ee2,_0x35f7f8){_0x814ee2=_0x814ee2-0x118;const _0x544bfd=a157_0x544b();let _0x20d308=_0x544bfd[_0x814ee2];return _0x20d308;}(function(_0x381a56,_0x30d5e2){const _0x107fb7=a157_0x20d3,_0x94d8ef=_0x381a56();while(!![]){try{const _0x342990=-parseInt(_0x107fb7(0x123))/0x1*(-parseInt(_0x107fb7(0x138))/0x2)+-parseInt(_0x107fb7(0x11a))/0x3+parseInt(_0x107fb7(0x13a))/0x4+-parseInt(_0x107fb7(0x137))/0x5+-parseInt(_0x107fb7(0x11f))/0x6*(parseInt(_0x107fb7(0x136))/0x7)+parseInt(_0x107fb7(0x139))/0x8+-parseInt(_0x107fb7(0x133))/0x9*(parseInt(_0x107fb7(0x135))/0xa);if(_0x342990===_0x30d5e2)break;else _0x94d8ef['push'](_0x94d8ef['shift']());}catch(_0x4e0b6f){_0x94d8ef['push'](_0x94d8ef['shift']());}}}(a157_0x544b,0xbbf80));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';function a157_0x544b(){const _0x4f09c9=['sqlcode','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','sqls','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','projectRoot','/smartapi/custom/deleteUserCustomSql','delete','trashedTo','validation','toISOString','appCode','2367NTknSI','Would\x20delete\x20SQL\x20','12370SVZzLa','105XExKwF','2496205FnOsoI','302506hCruAZ','8151592ReOakA','3993572Smrbjq','remoteId','POST','SQL\x20lock\x20file\x20not\x20found.','996240vrEkpQ','sql','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','lockFilePath','entries','338814cvfOJW','fromEntries','lastSync','sqlRoot','5ogNgMy','replace','startsWith','str'];a157_0x544b=function(){return _0x4f09c9;};return a157_0x544b();}import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a157_0x10c2ba(0x11b),'command':'delete','description':a157_0x10c2ba(0x128),'risk':'high-risk-write','flags':[SQLCODE_FLAG],async 'validate'(_0x187146){const _0x5c9c29=a157_0x10c2ba,_0x3fbfc0=loadSqlProjectConfig(_0x187146[_0x5c9c29(0x132)]),_0x39dfce=await readSqlLockFile(_0x3fbfc0[_0x5c9c29(0x11d)]);if(!_0x39dfce)throw CliErrors[_0x5c9c29(0x130)](_0x5c9c29(0x129));},async 'dryRun'(_0x481645){const _0x314e19=a157_0x10c2ba,_0x5da991=loadSqlProjectConfig(_0x481645['appCode']),_0x575c00=await readSqlLockFile(_0x5da991[_0x314e19(0x11d)]);if(!_0x575c00)throw CliErrors[_0x314e19(0x130)](_0x314e19(0x129));const {appLock:_0x304d3c}=ensureSqlLockScope(_0x575c00,_0x481645[_0x314e19(0x132)],_0x5da991[_0x314e19(0x122)],_0x314e19(0x12e)),_0x42afab=_0x481645[_0x314e19(0x126)](_0x314e19(0x127)),_0x24be2a=_0x304d3c['sqls'][_0x42afab];if(!_0x24be2a)throw CliErrors[_0x314e19(0x130)](_0x314e19(0x12b)+_0x42afab+'\x22.');return{'method':_0x314e19(0x118),'url':_0x314e19(0x12d),'body':{'sqlCode':_0x42afab,'id':_0x24be2a[_0x314e19(0x13b)],'localPath':resolveLocalSqlFilePath(_0x5da991,_0x42afab,_0x24be2a)},'description':_0x314e19(0x134)+_0x42afab+_0x314e19(0x11c)+_0x5da991['trashDir']};},async 'execute'(_0x5d423f){const _0x37d633=a157_0x10c2ba,_0x8b3d5d=loadSqlProjectConfig(_0x5d423f[_0x37d633(0x132)]),_0x49412e=await readSqlLockFile(_0x8b3d5d['lockFilePath']);if(!_0x49412e)throw CliErrors[_0x37d633(0x130)](_0x37d633(0x119));const {lockData:_0x2f043e,appLock:_0x95d098}=ensureSqlLockScope(_0x49412e,_0x5d423f['appCode'],_0x8b3d5d[_0x37d633(0x122)],_0x37d633(0x12e)),_0x84bf93=_0x5d423f[_0x37d633(0x126)](_0x37d633(0x127)),_0x3662d9=_0x95d098[_0x37d633(0x12a)][_0x84bf93];if(!_0x3662d9)throw CliErrors[_0x37d633(0x130)](_0x37d633(0x12b)+_0x84bf93+'\x22.');await deleteSqlQuery({'id':_0x3662d9[_0x37d633(0x13b)],'sqlCode':_0x84bf93}),_0x95d098[_0x37d633(0x12a)]=Object[_0x37d633(0x120)](Object[_0x37d633(0x11e)](_0x95d098[_0x37d633(0x12a)])['filter'](([_0x449909])=>_0x449909!==_0x84bf93)),_0x95d098[_0x37d633(0x121)]=new Date()[_0x37d633(0x131)](),await writeSqlLockFile(_0x8b3d5d[_0x37d633(0x11d)],_0x2f043e);const _0x38dc36=resolveLocalSqlFilePath(_0x8b3d5d,_0x84bf93,_0x3662d9);let _0x207b24;await fileExists(_0x38dc36)&&(_0x207b24=await moveToTrash(_0x8b3d5d[_0x37d633(0x12c)],_0x8b3d5d['trashDir'],_0x38dc36),await cleanupEmptyDirectories(dirname(_0x38dc36),_0x8b3d5d['sqlRootDir']));const _0x41e0fc={'deleted':_0x84bf93,'remoteId':_0x3662d9[_0x37d633(0x13b)]};if(_0x207b24)_0x41e0fc[_0x37d633(0x12f)]=_0x207b24;return{'ok':!![],'data':_0x41e0fc,'message':'Deleted\x20'+_0x84bf93+(_0x207b24?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};async function moveToTrash(_0x37f44b,_0x38ea88,_0x25cf7c){const _0x370eca=a157_0x10c2ba,_0x574c12=new Date()[_0x370eca(0x131)]()[_0x370eca(0x124)](/[:.]/g,'-'),_0x412ef7=relative(_0x37f44b,_0x25cf7c),_0x52e9f5=join(_0x38ea88,_0x574c12,_0x412ef7);return await mkdir(dirname(_0x52e9f5),{'recursive':!![]}),await rename(_0x25cf7c,_0x52e9f5),_0x52e9f5;}async function cleanupEmptyDirectories(_0x2fb3fe,_0x5ecbf2){const _0x3c5703=a157_0x10c2ba;let _0x4bb58c=resolve(_0x2fb3fe);const _0x503377=resolve(_0x5ecbf2);while(_0x4bb58c[_0x3c5703(0x125)](''+_0x503377+sep)||_0x4bb58c===_0x503377){if(_0x4bb58c===_0x503377)return;try{const _0x53f580=await readdir(_0x4bb58c);if(_0x53f580['length']>0x0)return;await rmdir(_0x4bb58c);}catch{return;}_0x4bb58c=dirname(_0x4bb58c);}}
1
+ function a157_0x1fa9(){const _0x3808c2=['3197552IdhVdL','trashedTo','str','replace','entries','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','POST','sqlcode','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','/smartapi/custom/deleteUserCustomSql','length','sqlRootDir','validation','high-risk-write','Deleted\x20','appCode','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','lockFilePath','10323131LqRlUM','trashDir','5275OzfOoQ','1757267OdSfMA','sqlRoot','sql','1190829RkvQGO','remoteId','2918876XIHoWh','projectRoot','SQL\x20lock\x20file\x20not\x20found.','3468XgpQqj','sqls','delete','189GWFieQ','7123344iTxmuH'];a157_0x1fa9=function(){return _0x3808c2;};return a157_0x1fa9();}const a157_0x46a1bf=a157_0x42c2;(function(_0x58c9ce,_0x14e916){const _0x42c543=a157_0x42c2,_0x2206ac=_0x58c9ce();while(!![]){try{const _0x41a70e=-parseInt(_0x42c543(0x1e7))/0x1+-parseInt(_0x42c543(0x1ec))/0x2+-parseInt(_0x42c543(0x1ea))/0x3+-parseInt(_0x42c543(0x1f3))/0x4+parseInt(_0x42c543(0x1e6))/0x5*(-parseInt(_0x42c543(0x1ef))/0x6)+-parseInt(_0x42c543(0x1e4))/0x7+parseInt(_0x42c543(0x1f4))/0x8*(parseInt(_0x42c543(0x1f2))/0x9);if(_0x41a70e===_0x14e916)break;else _0x2206ac['push'](_0x2206ac['shift']());}catch(_0x3e235a){_0x2206ac['push'](_0x2206ac['shift']());}}}(a157_0x1fa9,0xdf487));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';function a157_0x42c2(_0x51d5ac,_0x47ee1c){_0x51d5ac=_0x51d5ac-0x1d9;const _0x1fa927=a157_0x1fa9();let _0x42c2a5=_0x1fa927[_0x51d5ac];return _0x42c2a5;}import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a157_0x46a1bf(0x1e9),'command':a157_0x46a1bf(0x1f1),'description':a157_0x46a1bf(0x1f9),'risk':a157_0x46a1bf(0x1df),'flags':[SQLCODE_FLAG],async 'validate'(_0x2598a0){const _0x1d3609=a157_0x46a1bf,_0x274460=loadSqlProjectConfig(_0x2598a0['appCode']),_0xae9b2f=await readSqlLockFile(_0x274460['lockFilePath']);if(!_0xae9b2f)throw CliErrors[_0x1d3609(0x1de)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');},async 'dryRun'(_0x3966e5){const _0x3ae789=a157_0x46a1bf,_0x5b1824=loadSqlProjectConfig(_0x3966e5[_0x3ae789(0x1e1)]),_0x5d4b48=await readSqlLockFile(_0x5b1824[_0x3ae789(0x1e3)]);if(!_0x5d4b48)throw CliErrors[_0x3ae789(0x1de)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');const {appLock:_0x392951}=ensureSqlLockScope(_0x5d4b48,_0x3966e5[_0x3ae789(0x1e1)],_0x5b1824['sqlRoot'],_0x3ae789(0x1f1)),_0x278b6d=_0x3966e5['str'](_0x3ae789(0x1d9)),_0x1b57d9=_0x392951[_0x3ae789(0x1f0)][_0x278b6d];if(!_0x1b57d9)throw CliErrors[_0x3ae789(0x1de)](_0x3ae789(0x1da)+_0x278b6d+'\x22.');return{'method':_0x3ae789(0x1fa),'url':_0x3ae789(0x1db),'body':{'sqlCode':_0x278b6d,'id':_0x1b57d9[_0x3ae789(0x1eb)],'localPath':resolveLocalSqlFilePath(_0x5b1824,_0x278b6d,_0x1b57d9)},'description':'Would\x20delete\x20SQL\x20'+_0x278b6d+_0x3ae789(0x1e2)+_0x5b1824[_0x3ae789(0x1e5)]};},async 'execute'(_0x2a3352){const _0x382a36=a157_0x46a1bf,_0x557e1d=loadSqlProjectConfig(_0x2a3352['appCode']),_0x536b98=await readSqlLockFile(_0x557e1d[_0x382a36(0x1e3)]);if(!_0x536b98)throw CliErrors[_0x382a36(0x1de)](_0x382a36(0x1ee));const {lockData:_0x54eaba,appLock:_0x5ec5e2}=ensureSqlLockScope(_0x536b98,_0x2a3352[_0x382a36(0x1e1)],_0x557e1d[_0x382a36(0x1e8)],_0x382a36(0x1f1)),_0x137efa=_0x2a3352[_0x382a36(0x1f6)]('sqlcode'),_0x31deca=_0x5ec5e2[_0x382a36(0x1f0)][_0x137efa];if(!_0x31deca)throw CliErrors[_0x382a36(0x1de)](_0x382a36(0x1da)+_0x137efa+'\x22.');await deleteSqlQuery({'id':_0x31deca[_0x382a36(0x1eb)],'sqlCode':_0x137efa}),_0x5ec5e2['sqls']=Object['fromEntries'](Object[_0x382a36(0x1f8)](_0x5ec5e2[_0x382a36(0x1f0)])['filter'](([_0x2e758c])=>_0x2e758c!==_0x137efa)),_0x5ec5e2['lastSync']=new Date()['toISOString'](),await writeSqlLockFile(_0x557e1d['lockFilePath'],_0x54eaba);const _0x2ebf25=resolveLocalSqlFilePath(_0x557e1d,_0x137efa,_0x31deca);let _0x40ef47;await fileExists(_0x2ebf25)&&(_0x40ef47=await moveToTrash(_0x557e1d[_0x382a36(0x1ed)],_0x557e1d[_0x382a36(0x1e5)],_0x2ebf25),await cleanupEmptyDirectories(dirname(_0x2ebf25),_0x557e1d[_0x382a36(0x1dd)]));const _0x30c07a={'deleted':_0x137efa,'remoteId':_0x31deca['remoteId']};if(_0x40ef47)_0x30c07a[_0x382a36(0x1f5)]=_0x40ef47;return{'ok':!![],'data':_0x30c07a,'message':_0x382a36(0x1e0)+_0x137efa+(_0x40ef47?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};async function moveToTrash(_0x5d81c0,_0x125b1f,_0x1d9bee){const _0x41cb33=a157_0x46a1bf,_0x5f4de3=new Date()['toISOString']()[_0x41cb33(0x1f7)](/[:.]/g,'-'),_0x2bdb14=relative(_0x5d81c0,_0x1d9bee),_0x40e96f=join(_0x125b1f,_0x5f4de3,_0x2bdb14);return await mkdir(dirname(_0x40e96f),{'recursive':!![]}),await rename(_0x1d9bee,_0x40e96f),_0x40e96f;}async function cleanupEmptyDirectories(_0x5401e9,_0x5cd805){const _0x4bedfa=a157_0x46a1bf;let _0x3df264=resolve(_0x5401e9);const _0x222628=resolve(_0x5cd805);while(_0x3df264['startsWith'](''+_0x222628+sep)||_0x3df264===_0x222628){if(_0x3df264===_0x222628)return;try{const _0x4da142=await readdir(_0x3df264);if(_0x4da142[_0x4bedfa(0x1dc)]>0x0)return;await rmdir(_0x3df264);}catch{return;}_0x3df264=dirname(_0x3df264);}}