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

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_0x174fd3=a143_0x4cd2;(function(_0x5d81d0,_0x4a19cf){const _0xc42574=a143_0x4cd2,_0x803223=_0x5d81d0();while(!![]){try{const _0x14a9ff=parseInt(_0xc42574(0x223))/0x1+parseInt(_0xc42574(0x1e6))/0x2+parseInt(_0xc42574(0x202))/0x3*(parseInt(_0xc42574(0x20f))/0x4)+-parseInt(_0xc42574(0x21c))/0x5+parseInt(_0xc42574(0x208))/0x6+-parseInt(_0xc42574(0x21f))/0x7*(-parseInt(_0xc42574(0x1e9))/0x8)+-parseInt(_0xc42574(0x1fd))/0x9*(parseInt(_0xc42574(0x215))/0xa);if(_0x14a9ff===_0x4a19cf)break;else _0x803223['push'](_0x803223['shift']());}catch(_0x20b609){_0x803223['push'](_0x803223['shift']());}}}(a143_0x1a4f,0xe4f60));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_0x1a4f(){const _0x31ec6a=['push','Platform\x20Issue','map','\x20\x20[write]','project','create','command','`rabetbase\x20app\x20use`\x20has\x20been\x20removed.','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20instead.','isSingleCommand','start','Diagnostics','18fpQIZp','Run\x20any\x20package.json\x20script','has','Permissions','logout','3fYzBGj','Run\x20Scripts','install','auth','filter','commands','6119838RfnOvO','hidden','Runtime\x20App\x20Config\x20Management','API\x20Development','values','Quick\x20Start','Smart\x20List\x20Pages','2433844IFBxFj','description','SQL\x20Queries','length','File','Schema','12973450ZDXoDU','risk','set','skill','app','from','Self\x20Update','2661530VMYohW','show','build','518FBqMMS','Notification\x20Configuration','Project','skill\x20','366579HYhtsD','Use\x20`rabetbase\x20cli-skill\x20install`\x20to\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill.\x20To\x20install\x20business\x20Skills,\x20use\x20`lovrabet\x20skill\x20install`.','Instant\x20API','Database\x20Connections','CLI\x20Built-in\x20Skill','`rabetbase\x20','App\x20Management','service','1931010UVZAPo','Use\x20`rabetbase\x20workspace\x20use\x20--app\x20<name>`\x20instead.','write','119384bVImSV','BFF\x20Scripts','get','app\x20use','run','`rabetbase\x20skills`\x20has\x20been\x20removed.','Configuration','wildcardDef'];a143_0x1a4f=function(){return _0x31ec6a;};return a143_0x1a4f();}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';function a143_0x4cd2(_0xc7c01,_0x5edea2){_0xc7c01=_0xc7c01-0x1e5;const _0x1a4f32=a143_0x1a4f();let _0x4cd237=_0x1a4f32[_0xc7c01];return _0x4cd237;}import{issueDefinitions}from'../commands/issue/index.js';import{fileDefinitions}from'../commands/file/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{projectDefinitions}from'../commands/project/index.js';import{initDefinitions}from'../commands/init/index.js';import{runDefinition}from'../commands/run/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0xc3815){const _0x3021f9=a143_0x4cd2;for(const _0x5f3e26 of _0xc3815){definitions[_0x3021f9(0x217)](_0x5f3e26[_0x3021f9(0x1e5)]+':'+_0x5f3e26[_0x3021f9(0x1f7)],_0x5f3e26);let _0xa08907=serviceGroups['get'](_0x5f3e26[_0x3021f9(0x1e5)]);!_0xa08907&&(_0xa08907=[],serviceGroups[_0x3021f9(0x217)](_0x5f3e26['service'],_0xa08907)),_0xa08907[_0x3021f9(0x1f1)](_0x5f3e26);}}function registerDeclarativeService(_0x3c6b0f,_0xb12bd8,_0x5bfbcd){const _0x380627=a143_0x4cd2;registerDefinitions(_0xb12bd8);_0x5bfbcd?.['wildcardDef']&&registerDefinitions([_0x5bfbcd[_0x380627(0x1f0)]]);const _0x21fca5=_0x77e701=>_0x77e701==='read'?'':_0x77e701===_0x380627(0x1e8)?_0x380627(0x1f4):'\x20\x20[high-risk-write]',_0x326a46={'service':_0xb12bd8[0x0][_0x380627(0x1e5)],'label':_0x3c6b0f,'commands':_0xb12bd8[_0x380627(0x206)](_0x27635e=>!_0x27635e[_0x380627(0x209)])[_0x380627(0x1f3)](_0x1a9124=>({'command':_0x1a9124[_0x380627(0x1f7)],'description':_0x1a9124[_0x380627(0x210)],'tag':_0x21fca5(_0x1a9124[_0x380627(0x216)])})),'declarative':!![],'defaultCommand':_0x5bfbcd?.['defaultCommand']??(_0x5bfbcd?.[_0x380627(0x1fa)]?_0xb12bd8[0x0][_0x380627(0x1f7)]:undefined),'wildcardDef':_0x5bfbcd?.[_0x380627(0x1f0)],'isSingleCommand':_0x5bfbcd?.[_0x380627(0x1fa)]};serviceRegistry['push'](_0x326a46),serviceByName[_0x380627(0x217)](_0x326a46[_0x380627(0x1e5)],_0x326a46);}registerDeclarativeService(a143_0x174fd3(0x20d),initDefinitions,{'defaultCommand':'run','isSingleCommand':!![]}),registerDeclarativeService(a143_0x174fd3(0x221),projectDefinitions),registerDeclarativeService('Workspace',workspaceDefinitions),registerDeclarativeService(a143_0x174fd3(0x229),appDefinitions),registerDeclarativeService('Authentication',authDefinitions,{'defaultCommand':'login'}),registerDeclarativeService('Dataset\x20&\x20Operations',datasetDefinitions),registerDeclarativeService(a143_0x174fd3(0x20e),pageDefinitions),registerDeclarativeService(a143_0x174fd3(0x20b),apiDefinitions),registerDeclarativeService(a143_0x174fd3(0x225),dataDefinitions),registerDeclarativeService(a143_0x174fd3(0x1ea),bffDefinitions),registerDeclarativeService(a143_0x174fd3(0x220),notificationDefinitions),registerDeclarativeService(a143_0x174fd3(0x211),sqlDefinitions),registerDeclarativeService(a143_0x174fd3(0x226),dbDefinitions),registerDeclarativeService('Menu',menuDefinitions),registerDeclarativeService('Roles',roleDefinitions),registerDeclarativeService(a143_0x174fd3(0x200),permitDefinitions),registerDeclarativeService(a143_0x174fd3(0x20a),appConfigDefinitions),registerDeclarativeService(a143_0x174fd3(0x1f2),issueDefinitions),registerDeclarativeService(a143_0x174fd3(0x213),fileDefinitions),registerDeclarativeService('Code\x20Generation',codegenDefinitions),registerDeclarativeService(a143_0x174fd3(0x1ef),configDefinitions),registerDeclarativeService(a143_0x174fd3(0x1fc),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a143_0x174fd3(0x214),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a143_0x174fd3(0x21b),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a143_0x174fd3(0x227),cliSkillDefinitions,{'defaultCommand':a143_0x174fd3(0x204)}),registerDeclarativeService('Logs',logsDefinitions,{'defaultCommand':a143_0x174fd3(0x21d)}),registerDeclarativeService(a143_0x174fd3(0x203),[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry[a143_0x174fd3(0x212)]-0x1];last[a143_0x174fd3(0x207)]=[{'command':'<script>','description':a143_0x174fd3(0x1fe),'tag':''}];}export const deprecatedAliases={'create':{'service':a143_0x174fd3(0x1f5),'command':a143_0x174fd3(0x1f6)},'start':{'service':a143_0x174fd3(0x1ed),'command':a143_0x174fd3(0x1fb)},'build':{'service':'run','command':a143_0x174fd3(0x21e)},'preview':{'service':a143_0x174fd3(0x1ed),'command':'preview'},'logout':{'service':a143_0x174fd3(0x205),'command':a143_0x174fd3(0x201)}};const CLI_SKILL_INSTALL_REMOVED_HINT=a143_0x174fd3(0x224),APP_REMOTE_REMOVED_HINT=a143_0x174fd3(0x1f9),APP_USE_REMOVED_HINT=a143_0x174fd3(0x1e7);export function resolveRemovedCommand(_0x57ba45,_0xea6033){const _0xe362df=a143_0x174fd3;if(_0x57ba45==='skill'){const _0xcf7525=_0xea6033?_0xe362df(0x222)+_0xea6033:_0xe362df(0x218);return{'command':_0xcf7525,'message':_0xe362df(0x228)+_0xcf7525+'`\x20has\x20been\x20removed.','hint':CLI_SKILL_INSTALL_REMOVED_HINT};}if(_0x57ba45==='skills')return{'command':'skills','message':_0xe362df(0x1ee),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};if(_0x57ba45===_0xe362df(0x219)&&_0xea6033==='remote')return{'command':'app\x20remote','message':'`rabetbase\x20app\x20remote`\x20has\x20been\x20removed.','hint':APP_REMOTE_REMOVED_HINT};if(_0x57ba45===_0xe362df(0x219)&&_0xea6033==='use')return{'command':_0xe362df(0x1ec),'message':_0xe362df(0x1f8),'hint':APP_USE_REMOVED_HINT};return undefined;}export const deprecatedSubcommands={'bff':{'new':a143_0x174fd3(0x1f6)},'sql':{'new':a143_0x174fd3(0x1f6)}};export function resolveDeprecatedSubcommand(_0x81fb85,_0x1d2404){return deprecatedSubcommands[_0x81fb85]?.[_0x1d2404];}export function findDefinition(_0x2ec0cb,_0x199b63){const _0x3ef894=a143_0x174fd3;return definitions[_0x3ef894(0x1eb)](_0x2ec0cb+':'+_0x199b63);}export function isKnownService(_0xa133a8){return serviceByName['has'](_0xa133a8);}export function isDeclarativeService(_0x406017){const _0x3e3d08=a143_0x174fd3;return serviceGroups[_0x3e3d08(0x1ff)](_0x406017)||serviceByName[_0x3e3d08(0x1eb)](_0x406017)?.[_0x3e3d08(0x1f0)]!==undefined;}export function getServiceEntry(_0x218747){const _0x41fce0=a143_0x174fd3;return serviceByName[_0x41fce0(0x1eb)](_0x218747);}export function getLegacyHandler(_0x11048a,_0x430a78){return undefined;}export function getAllDefinitions(){const _0x3a2117=a143_0x174fd3;return Array[_0x3a2117(0x21a)](definitions[_0x3a2117(0x20c)]());}
@@ -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_0x3b3200=a144_0x213c;(function(_0x4ab585,_0x1a224c){const _0x3fbadd=a144_0x213c,_0xca4222=_0x4ab585();while(!![]){try{const _0x4836f6=parseInt(_0x3fbadd(0xf5))/0x1+-parseInt(_0x3fbadd(0xdb))/0x2*(-parseInt(_0x3fbadd(0xec))/0x3)+-parseInt(_0x3fbadd(0xeb))/0x4+parseInt(_0x3fbadd(0xe5))/0x5*(-parseInt(_0x3fbadd(0xf2))/0x6)+-parseInt(_0x3fbadd(0xf3))/0x7+-parseInt(_0x3fbadd(0xe7))/0x8+-parseInt(_0x3fbadd(0xf1))/0x9*(-parseInt(_0x3fbadd(0xe0))/0xa);if(_0x4836f6===_0x1a224c)break;else _0xca4222['push'](_0xca4222['shift']());}catch(_0x3027ec){_0xca4222['push'](_0xca4222['shift']());}}}(a144_0x3ec1,0x26691));import{createAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a144_0x213c(_0x5a7b6b,_0xa06e3a){_0x5a7b6b=_0x5a7b6b-0xdb;const _0x3ec1b8=a144_0x3ec1();let _0x213c43=_0x3ec1b8[_0x5a7b6b];return _0x213c43;}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_0x3b3200(0xe9);function readName(_0xeff015){const _0x1a88df=a144_0x3b3200,_0x2389b8=_0xeff015[_0x1a88df(0xe3)]('name')[_0x1a88df(0xdd)]();if(!_0x2389b8)throw CliErrors[_0x1a88df(0xe8)]('name',_0x1a88df(0xe2));if(_0x2389b8[_0x1a88df(0xe4)]>0x40)throw CliErrors[_0x1a88df(0xe1)](_0x1a88df(0xea));return _0x2389b8;}export const roleCreate={'service':a144_0x3b3200(0xf0),'command':a144_0x3b3200(0xf4),'description':'Create\x20a\x20CUSTOM\x20user\x20group\x20(role)','risk':a144_0x3b3200(0xde),'flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3b33db){readName(_0x3b33db);},async 'dryRun'(_0x4fc2d4){const _0x1cb707=a144_0x3b3200,_0x3b1db7=readName(_0x4fc2d4),_0x2268c9=_0x4fc2d4['str']('remark')[_0x1cb707(0xdd)]()||undefined;return asDryRunResult({'operation':_0x1cb707(0xf4),'selector':{'appCode':_0x4fc2d4['appCode'],'roleName':_0x3b1db7},'before':null,'after':{'roleName':_0x3b1db7,'roleType':_0x1cb707(0xdf),'remark':_0x2268c9},'dryRun':!![],'backend':{'method':_0x1cb707(0xdc),'path':CREATE_PATH},'warnings':[]},{'method':'POST','url':CREATE_PATH});},async 'execute'(_0x36ac87){const _0x156e62=a144_0x3b3200,_0x5c4b8b=readName(_0x36ac87),_0x51e692=_0x36ac87['str'](_0x156e62(0xef))[_0x156e62(0xdd)]()||undefined,_0x819828=await createAppRole({'appCode':_0x36ac87[_0x156e62(0xed)],'roleName':_0x5c4b8b,..._0x51e692?{'remark':_0x51e692}:{}});return{'ok':!![],'data':{'operation':_0x156e62(0xf4),'selector':{'appCode':_0x36ac87[_0x156e62(0xed)],'roleId':_0x819828['id'],'roleName':_0x5c4b8b},'before':null,'after':projectRole(_0x819828),'dryRun':![],'backend':{'method':_0x156e62(0xdc),'path':CREATE_PATH},'warnings':[]},'message':_0x156e62(0xe6)+_0x819828['roleName']+_0x156e62(0xee)+_0x819828['id']+')'};}};function a144_0x3ec1(){const _0x3aac91=['5xkkIWr','Created\x20role\x20','57328jFLmuH','flagMissing','/smartapi/permit/role/create','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','723132DSTmJx','292683BDoTZn','appCode','\x20(id=','remark','role','207xJGFin','1112358tVwAMz','1374114dyCDSy','create','312449HvPCWS','2JxVDjP','POST','trim','write','CUSTOM','137810WZfZfo','validation','Pass\x20--name\x20<roleName>.','str','length'];a144_0x3ec1=function(){return _0x3aac91;};return a144_0x3ec1();}
@@ -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
+ const a145_0x337467=a145_0x7620;(function(_0x5e7ddc,_0x92ec47){const _0x4b35aa=a145_0x7620,_0x4efeae=_0x5e7ddc();while(!![]){try{const _0x467112=-parseInt(_0x4b35aa(0x1a3))/0x1*(-parseInt(_0x4b35aa(0x19f))/0x2)+-parseInt(_0x4b35aa(0x1a5))/0x3*(parseInt(_0x4b35aa(0x192))/0x4)+-parseInt(_0x4b35aa(0x18e))/0x5*(parseInt(_0x4b35aa(0x193))/0x6)+parseInt(_0x4b35aa(0x1a1))/0x7*(-parseInt(_0x4b35aa(0x190))/0x8)+-parseInt(_0x4b35aa(0x198))/0x9*(parseInt(_0x4b35aa(0x18f))/0xa)+parseInt(_0x4b35aa(0x19e))/0xb*(parseInt(_0x4b35aa(0x19a))/0xc)+parseInt(_0x4b35aa(0x191))/0xd;if(_0x467112===_0x92ec47)break;else _0x4efeae['push'](_0x4efeae['shift']());}catch(_0x40ece4){_0x4efeae['push'](_0x4efeae['shift']());}}}(a145_0x277b,0xcf876));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a145_0x7620(_0x4ade20,_0x366ad6){_0x4ade20=_0x4ade20-0x18e;const _0x277ba4=a145_0x277b();let _0x762070=_0x277ba4[_0x4ade20];return _0x762070;}import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a145_0x277b(){const _0x5dd1ed=['72rzaNor','\x20(id=','delete','num','2695044QpbSeP','749402xvOOKT','high-risk-write','331072YJAoXL','role','1diUvGs','userCount','649527aFshDO','Role\x20still\x20has\x20','roleName','682135HUkuzG','10Tgqlzc','16iIJuKS','31835323eENIDQ','16VGXLBQ','42bXLCsM','Deleted\x20role\x20','Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','appCode','POST','13751469pyJBAG','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.'];a145_0x277b=function(){return _0x5dd1ed;};return a145_0x277b();}const DELETE_PATH='/smartapi/permit/role/delete';export const roleDelete={'service':a145_0x337467(0x1a2),'command':a145_0x337467(0x19c),'description':a145_0x337467(0x195),'risk':a145_0x337467(0x1a0),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x1e2bec){const _0x200d86=a145_0x337467,_0x1d49fe=_0x1e2bec[_0x200d86(0x19d)]('id'),_0x10a5e2=await getRoleById(_0x1e2bec['appCode'],_0x1d49fe);return assertCustomRole(_0x10a5e2,_0x200d86(0x19c)),asDryRunResult({'operation':_0x200d86(0x19c),'selector':{'appCode':_0x1e2bec[_0x200d86(0x196)],'roleId':_0x1d49fe,'roleName':_0x10a5e2[_0x200d86(0x1a7)]},'before':projectRole(_0x10a5e2),'after':null,'dryRun':!![],'backend':{'method':_0x200d86(0x197),'path':DELETE_PATH},'warnings':_0x10a5e2[_0x200d86(0x1a4)]>0x0?[_0x200d86(0x1a6)+_0x10a5e2[_0x200d86(0x1a4)]+_0x200d86(0x199)]:[]},{'method':_0x200d86(0x197),'url':DELETE_PATH});},async 'execute'(_0x2f2cf2){const _0x5bed6d=a145_0x337467,_0x11ff25=_0x2f2cf2[_0x5bed6d(0x19d)]('id'),_0x389d64=await getRoleById(_0x2f2cf2[_0x5bed6d(0x196)],_0x11ff25);return assertCustomRole(_0x389d64,_0x5bed6d(0x19c)),await deleteAppRole(_0x11ff25),{'ok':!![],'data':{'operation':_0x5bed6d(0x19c),'selector':{'appCode':_0x2f2cf2[_0x5bed6d(0x196)],'roleId':_0x11ff25,'roleName':_0x389d64[_0x5bed6d(0x1a7)]},'before':projectRole(_0x389d64),'after':null,'dryRun':![],'backend':{'method':_0x5bed6d(0x197),'path':DELETE_PATH},'warnings':[]},'message':_0x5bed6d(0x194)+_0x389d64[_0x5bed6d(0x1a7)]+_0x5bed6d(0x19b)+_0x11ff25+')'};}};
@@ -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
+ function a146_0x374a(_0x2c4cbf,_0x467ad5){_0x2c4cbf=_0x2c4cbf-0x176;const _0x8147f=a146_0x8147();let _0x374af9=_0x8147f[_0x2c4cbf];return _0x374af9;}function a146_0x8147(){const _0x359d34=['4467526nJHnDP','2494404HFPuyJ','1073670XJHEzw','appCode','2453166BwAilS','27767dIxcgS','Role\x20','Show\x20a\x20single\x20role\x27s\x20detail','num','647800ohPzdw','roleName','role','1478132FRyIEy'];a146_0x8147=function(){return _0x359d34;};return a146_0x8147();}const a146_0x20cdac=a146_0x374a;(function(_0x1f56bd,_0x104191){const _0x5e6bc7=a146_0x374a,_0x3afc71=_0x1f56bd();while(!![]){try{const _0x4933e5=-parseInt(_0x5e6bc7(0x17c))/0x1+parseInt(_0x5e6bc7(0x176))/0x2+-parseInt(_0x5e6bc7(0x178))/0x3+parseInt(_0x5e6bc7(0x180))/0x4+parseInt(_0x5e6bc7(0x179))/0x5+-parseInt(_0x5e6bc7(0x17b))/0x6+parseInt(_0x5e6bc7(0x177))/0x7;if(_0x4933e5===_0x104191)break;else _0x3afc71['push'](_0x3afc71['shift']());}catch(_0x5bcb3b){_0x3afc71['push'](_0x3afc71['shift']());}}}(a146_0x8147,0x769f0));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_0x20cdac(0x182),'command':'detail','description':a146_0x20cdac(0x17e),'risk':'read','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x37eb31){const _0x49d10a=a146_0x20cdac,_0x20ce53=_0x37eb31[_0x49d10a(0x17f)]('id'),_0x4a525b=await getRoleById(_0x37eb31[_0x49d10a(0x17a)],_0x20ce53);return{'ok':!![],'data':{'role':projectRole(_0x4a525b)},'message':_0x49d10a(0x17d)+_0x4a525b[_0x49d10a(0x181)]+'\x20('+_0x4a525b['roleType']+')'};}};
@@ -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(_0x35cf57,_0x5f3caf){const _0x2384c2=a147_0x3dd0,_0x5e97f2=_0x35cf57();while(!![]){try{const _0x32db08=-parseInt(_0x2384c2(0x1e8))/0x1*(-parseInt(_0x2384c2(0x1e6))/0x2)+-parseInt(_0x2384c2(0x1ee))/0x3*(-parseInt(_0x2384c2(0x1e5))/0x4)+-parseInt(_0x2384c2(0x1e3))/0x5+parseInt(_0x2384c2(0x1e4))/0x6*(-parseInt(_0x2384c2(0x1e9))/0x7)+parseInt(_0x2384c2(0x1eb))/0x8*(-parseInt(_0x2384c2(0x1ed))/0x9)+-parseInt(_0x2384c2(0x1ec))/0xa*(parseInt(_0x2384c2(0x1e7))/0xb)+parseInt(_0x2384c2(0x1ea))/0xc;if(_0x32db08===_0x5f3caf)break;else _0x5e97f2['push'](_0x5e97f2['shift']());}catch(_0x3ca082){_0x5e97f2['push'](_0x5e97f2['shift']());}}}(a147_0x230c,0xece8b));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_0x3dd0(_0xbf0054,_0x2afa44){_0xbf0054=_0xbf0054-0x1e3;const _0x230cff=a147_0x230c();let _0x3dd0bd=_0x230cff[_0xbf0054];return _0x3dd0bd;}import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';function a147_0x230c(){const _0x2827e0=['15YKXIFD','6533895WuSzex','6mPXlQt','293644VWHKCj','2EJmqmD','464233zYsDIZ','346948waOzRZ','7214907OZvObS','72638244QWRwzH','4273064hOjtCj','440Rwwbpb','27ETHPCQ'];a147_0x230c=function(){return _0x2827e0;};return a147_0x230c();}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_0xe92b73=a148_0x1957;(function(_0xf1e4e6,_0x5c3ccd){const _0x3d10d4=a148_0x1957,_0x1f2baf=_0xf1e4e6();while(!![]){try{const _0x332a24=parseInt(_0x3d10d4(0x152))/0x1+-parseInt(_0x3d10d4(0x14e))/0x2+parseInt(_0x3d10d4(0x13f))/0x3*(parseInt(_0x3d10d4(0x148))/0x4)+-parseInt(_0x3d10d4(0x150))/0x5+-parseInt(_0x3d10d4(0x153))/0x6+parseInt(_0x3d10d4(0x13e))/0x7*(-parseInt(_0x3d10d4(0x158))/0x8)+parseInt(_0x3d10d4(0x145))/0x9;if(_0x332a24===_0x5c3ccd)break;else _0x1f2baf['push'](_0x1f2baf['shift']());}catch(_0x2d62ad){_0x1f2baf['push'](_0x1f2baf['shift']());}}}(a148_0x11f3,0x5ea11));function a148_0x1957(_0x287040,_0x3d786c){_0x287040=_0x287040-0x13d;const _0x11f371=a148_0x11f3();let _0x1957be=_0x11f371[_0x287040];return _0x1957be;}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_0xe92b73(0x155),'DEV',a148_0xe92b73(0x154),a148_0xe92b73(0x143)];function a148_0x11f3(){const _0x1418ab=['validation','\x20role(s)','read','roleType','length','1222716WioKFv','num','1746255RCSLyi','map','346962cDHBIt','2739600aOQFWT','USER','ADMIN','page','string','33680ZtFEHl','pagesize','filter','str','Page\x20index\x20(1-based)','Use\x20one\x20of:\x20','280GSNapc','9SeaNaD','type','role','number','CUSTOM','toUpperCase','13669065VzIgFH','join','trim','143284NfWrdw'];a148_0x11f3=function(){return _0x1418ab;};return a148_0x11f3();}export const roleList={'service':a148_0xe92b73(0x141),'command':'list','description':'List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','risk':a148_0xe92b73(0x14b),'flags':[APPCODE_FLAG_OPTIONAL,{'name':'type','type':a148_0xe92b73(0x157),'required':![],'description':'Filter\x20by\x20role\x20type','enum':ROLE_TYPES},{'name':a148_0xe92b73(0x156),'type':a148_0xe92b73(0x142),'description':a148_0xe92b73(0x15c),'default':0x1},{'name':a148_0xe92b73(0x159),'type':a148_0xe92b73(0x142),'description':'Page\x20size\x20(1-100)','default':0x64}],async 'validate'(_0x482f56){const _0x28027a=a148_0xe92b73,_0x11d963=_0x482f56[_0x28027a(0x15b)](_0x28027a(0x140))[_0x28027a(0x147)]();if(_0x11d963&&!ROLE_TYPES['includes'](_0x11d963[_0x28027a(0x144)]()))throw CliErrors[_0x28027a(0x149)]('Invalid\x20--type\x20\x22'+_0x11d963+'\x22.',_0x28027a(0x13d)+ROLE_TYPES[_0x28027a(0x146)](',\x20')+'.');const _0x59382c=_0x482f56['num']('page',0x1),_0x378e74=_0x482f56['num']('pagesize',0x64);if(_0x59382c<0x1)throw CliErrors['validation']('--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.');if(_0x378e74<0x1||_0x378e74>0x64)throw CliErrors[_0x28027a(0x149)]('--pagesize\x20must\x20be\x20between\x201\x20and\x20100.');},async 'execute'(_0x51d239){const _0x49586e=a148_0xe92b73,_0x1c3290=_0x51d239[_0x49586e(0x14f)](_0x49586e(0x156),0x1)||0x1,_0x4530b7=_0x51d239[_0x49586e(0x14f)](_0x49586e(0x159),0x64)||0x64,_0x1268c7=_0x51d239[_0x49586e(0x15b)](_0x49586e(0x140))[_0x49586e(0x147)]()[_0x49586e(0x144)](),{items:_0xcf109,paging:_0x11cb55}=await listAppRoles(_0x51d239['appCode'],{'currentPage':_0x1c3290,'pageSize':_0x4530b7}),_0x429b0a=_0x1268c7?_0xcf109[_0x49586e(0x15a)](_0x228a25=>_0x228a25[_0x49586e(0x14c)]===_0x1268c7):_0xcf109,_0x2a6741=_0x429b0a[_0x49586e(0x151)](projectRole);return{'ok':!![],'data':{'roles':_0x2a6741,'paging':_0x11cb55},'message':'Found\x20'+_0x2a6741[_0x49586e(0x14d)]+_0x49586e(0x14a)};}};
@@ -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_0x5a6c1e=a149_0x131e;(function(_0x2e8a33,_0x4e7f60){const _0x36a212=a149_0x131e,_0x4f0653=_0x2e8a33();while(!![]){try{const _0x1221b=-parseInt(_0x36a212(0x13f))/0x1+parseInt(_0x36a212(0x16a))/0x2*(parseInt(_0x36a212(0x141))/0x3)+-parseInt(_0x36a212(0x15a))/0x4+-parseInt(_0x36a212(0x131))/0x5*(parseInt(_0x36a212(0x158))/0x6)+parseInt(_0x36a212(0x164))/0x7+-parseInt(_0x36a212(0x16b))/0x8+parseInt(_0x36a212(0x12a))/0x9;if(_0x1221b===_0x4e7f60)break;else _0x4f0653['push'](_0x4f0653['shift']());}catch(_0x48fdab){_0x4f0653['push'](_0x4f0653['shift']());}}}(a149_0x2c84,0xc68c1));function a149_0x131e(_0x4814cd,_0x16502f){_0x4814cd=_0x4814cd-0x121;const _0x2c84a5=a149_0x2c84();let _0x131ed3=_0x2c84a5[_0x4814cd];return _0x131ed3;}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_0x5a6c1e(0x148),'required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':'role','type':a149_0x5a6c1e(0x12d),'required':!![],'description':a149_0x5a6c1e(0x15f)};export const USER_REF_FLAG={'name':a149_0x5a6c1e(0x15e),'type':'string','required':!![],'description':a149_0x5a6c1e(0x143)};export const NAME_FLAG={'name':a149_0x5a6c1e(0x159),'type':a149_0x5a6c1e(0x12d),'required':!![],'description':'Role\x20name'};export const USER_NAME_FLAG={'name':a149_0x5a6c1e(0x159),'type':a149_0x5a6c1e(0x12d),'required':!![],'description':a149_0x5a6c1e(0x125)};export const REMARK_FLAG={'name':a149_0x5a6c1e(0x13a),'type':a149_0x5a6c1e(0x12d),'required':![],'description':'Optional\x20role\x20remark/description'};export const EXPECT_USER_COUNT_FLAG={'name':a149_0x5a6c1e(0x14d),'type':'number','required':![],'description':a149_0x5a6c1e(0x137)};export const BUILTIN_ROLE_TYPES=[a149_0x5a6c1e(0x168),a149_0x5a6c1e(0x153),'USER'];export function isBuiltinRole(_0x2ad77d){const _0x240acf=a149_0x5a6c1e;return BUILTIN_ROLE_TYPES[_0x240acf(0x14e)](_0x2ad77d);}export function assertCustomRole(_0x5de589,_0x345be6){const _0x5c313c=a149_0x5a6c1e;if(_0x5de589[_0x5c313c(0x157)]!==_0x5c313c(0x165))throw CliErrors[_0x5c313c(0x135)](_0x5c313c(0x169)+_0x345be6+_0x5c313c(0x14a)+_0x5de589['roleName']+'\x20('+_0x5de589[_0x5c313c(0x157)]+').',_0x5c313c(0x13c));}export function assertPermConfigurable(_0x38eda9){const _0x6b341b=a149_0x5a6c1e;if(_0x38eda9[_0x6b341b(0x157)]===_0x6b341b(0x153)||_0x38eda9[_0x6b341b(0x157)]===_0x6b341b(0x168))throw CliErrors['validation'](_0x6b341b(0x161)+_0x38eda9[_0x6b341b(0x130)]+'\x20('+_0x38eda9[_0x6b341b(0x157)]+').',_0x6b341b(0x145));}export function projectRole(_0x5c5a9b){const _0x56c964=a149_0x5a6c1e;return{'id':_0x5c5a9b['id'],'roleName':_0x5c5a9b[_0x56c964(0x130)],'roleType':_0x5c5a9b[_0x56c964(0x157)],'remark':_0x5c5a9b[_0x56c964(0x13a)],'userCount':_0x5c5a9b[_0x56c964(0x147)],'permitCount':_0x5c5a9b[_0x56c964(0x14b)],'builtin':isBuiltinRole(_0x5c5a9b[_0x56c964(0x157)])};}export async function resolveRoleRef(_0x2ec2f2,_0x5151cf){const _0x2deaca=a149_0x5a6c1e,_0x199cbd=_0x5151cf[_0x2deaca(0x133)]();if(!_0x199cbd)throw CliErrors[_0x2deaca(0x135)](_0x2deaca(0x152),_0x2deaca(0x15d));if(/^\d+$/[_0x2deaca(0x138)](_0x199cbd))return getRoleById(_0x2ec2f2,Number(_0x199cbd));const _0x4bcd42=await listAllAppRoles(_0x2ec2f2),_0x2fe921=_0x4bcd42[_0x2deaca(0x14f)](_0x5efdf7=>_0x5efdf7[_0x2deaca(0x130)]===_0x199cbd);if(_0x2fe921['length']===0x0)throw CliErrors[_0x2deaca(0x135)](_0x2deaca(0x151)+_0x199cbd+'\x22\x20not\x20found\x20in\x20app\x20'+_0x2ec2f2+'.',_0x2deaca(0x15c));if(_0x2fe921[_0x2deaca(0x122)]>0x1){const _0xcf4128=_0x2fe921[_0x2deaca(0x12e)](_0x251987=>_0x251987['id'])[_0x2deaca(0x139)](',\x20');throw CliErrors[_0x2deaca(0x135)](_0x2deaca(0x151)+_0x199cbd+'\x22\x20is\x20ambiguous\x20(ids:\x20'+_0xcf4128+').',_0x2deaca(0x136));}return _0x2fe921[0x0];}export async function getRoleById(_0x2a218e,_0x308cd7){const _0x435fd7=a149_0x5a6c1e,_0x1b07ca=await getAppRole(_0x308cd7);if(!_0x1b07ca)throw CliErrors[_0x435fd7(0x135)]('Role\x20id\x20'+_0x308cd7+'\x20not\x20found\x20in\x20app\x20'+_0x2a218e+'.',_0x435fd7(0x123));return _0x1b07ca;}async function listAllAppRoles(_0x5f4db4){const _0x3ac46e=a149_0x5a6c1e,_0xfa9a2a=0x64,_0x34b80d=[];for(let _0x2cf69c=0x1;;_0x2cf69c+=0x1){const {items:_0x3b2ede,paging:_0x3b725f}=await listAppRoles(_0x5f4db4,{'currentPage':_0x2cf69c,'pageSize':_0xfa9a2a});_0x34b80d[_0x3ac46e(0x13b)](..._0x3b2ede);if(_0x3b2ede['length']<_0xfa9a2a||_0x3b725f&&_0x34b80d['length']>=_0x3b725f['totalCount'])return _0x34b80d;}}export async function resolveTenantCode(){const _0x32dcb3=a149_0x5a6c1e,_0xe46e8a=await getSessionUserInfo(),_0x2ecb00=_0xe46e8a?.['user']?.[_0x32dcb3(0x121)]?.['tenant_code'];if(!_0x2ecb00)throw CliErrors[_0x32dcb3(0x12b)]('Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.');return _0x2ecb00;}function matchMember(_0x314902,_0x4b86ac){const _0x612c75=a149_0x5a6c1e,_0x3b36f0=_0x4b86ac[_0x612c75(0x133)]()[_0x612c75(0x124)]();return(_0x314902[_0x612c75(0x144)]??'')[_0x612c75(0x124)]()===_0x3b36f0||(_0x314902['username']??'')[_0x612c75(0x124)]()===_0x3b36f0;}export async function resolveUserRef(_0x4c2430){const _0x5a5f53=a149_0x5a6c1e,_0x8e0994=_0x4c2430[_0x5a5f53(0x133)]();if(!_0x8e0994)throw CliErrors[_0x5a5f53(0x135)](_0x5a5f53(0x13e),'Pass\x20--user\x20<id|name>.');const _0x349845=await resolveTenantCode(),_0xe0d24e=await getTenantMembers(_0x349845);if(/^\d+$/[_0x5a5f53(0x138)](_0x8e0994)){const _0xff6d15=Number(_0x8e0994),_0x48eaf7=_0xe0d24e['find'](_0x2b511b=>_0x2b511b[_0x5a5f53(0x142)]===_0xff6d15);return{'userId':_0xff6d15,'username':_0x48eaf7?.[_0x5a5f53(0x126)]??String(_0xff6d15),'nickname':_0x48eaf7?.['nickname'],'matchedBy':'id'};}const _0x43de33=_0xe0d24e[_0x5a5f53(0x14f)](_0x216779=>matchMember(_0x216779,_0x8e0994));if(_0x43de33[_0x5a5f53(0x122)]===0x0)throw CliErrors[_0x5a5f53(0x135)](_0x5a5f53(0x146)+_0x8e0994+'\x22.',_0x5a5f53(0x128));if(_0x43de33['length']>0x1){const _0x2091ef=_0x43de33[_0x5a5f53(0x12e)](_0x4f3346=>(_0x4f3346[_0x5a5f53(0x144)]??_0x4f3346[_0x5a5f53(0x126)]??'?')+'('+_0x4f3346['userId']+')')[_0x5a5f53(0x139)](',\x20');throw CliErrors['validation']('Multiple\x20tenant\x20members\x20match\x20\x22'+_0x8e0994+_0x5a5f53(0x149)+_0x2091ef+'.',_0x5a5f53(0x134));}const _0x301eff=_0x43de33[0x0];return{'userId':_0x301eff[_0x5a5f53(0x142)],'username':_0x301eff[_0x5a5f53(0x126)]??String(_0x301eff[_0x5a5f53(0x142)]),'nickname':_0x301eff[_0x5a5f53(0x144)],'matchedBy':'name'};}function a149_0x2c84(){const _0x16ff96=['Cannot\x20','854UfRZCI','9616968LtAZjE','tenant','length','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','toLowerCase','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','username','\x20is\x20already\x20a\x20member\x20of\x20role\x20','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','/smartapi/permit/user-role/update-user-list','23849361yMQVWk','authRequired','dryRun','string','map','User\x20','roleName','21785NSFsEQ',';\x20no\x20change.','trim','Disambiguate\x20with\x20--user\x20<id>.','validation','Disambiguate\x20with\x20--role\x20<id>.','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','test','join','remark','push','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','Role\x20id\x20','Missing\x20user\x20reference.','594303iCvEYV','user-add','7089zBtJWO','userId','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','nickname','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','No\x20tenant\x20member\x20matches\x20\x22','userCount','number','\x22:\x20','\x20built-in\x20role\x20','permitCount','role','expect-user-count','includes','filter','appCode','Role\x20name\x20\x22','Missing\x20role\x20reference.','DEV','userList','Pass\x20--user\x20<id|name>.','\x20is\x20not\x20a\x20member\x20of\x20role\x20','roleType','2010WyeNQj','name','1884948qHjppA','\x20member(s)\x20but\x20role\x20has\x20','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','Pass\x20--role\x20<id|name>.','user','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','expectUserCount','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','\x20not\x20found\x20in\x20the\x20user-role\x20list.','flag','6171025GVCrtL','CUSTOM','find','flagMissing','ADMIN'];a149_0x2c84=function(){return _0x16ff96;};return a149_0x2c84();}export const UPDATE_USER_LIST_PATH=a149_0x5a6c1e(0x129);function userIdsOf(_0x206887){const _0x548001=a149_0x5a6c1e;return(_0x206887?.['userList']??[])[_0x548001(0x12e)](_0x26cdae=>_0x26cdae['userId']);}export function computeRoleUserMutation(_0x52546b){const _0x480737=a149_0x5a6c1e,{operation:_0x3a0768,appCode:_0x29d367,roleUsers:_0x4a3fac,targetRoleId:_0x1d8205,user:_0x4f6b2}=_0x52546b,_0x393c7d=_0x4a3fac[_0x480737(0x166)](_0x5f574c=>_0x5f574c['id']===_0x1d8205);if(!_0x393c7d)throw CliErrors[_0x480737(0x135)](_0x480737(0x13d)+_0x1d8205+_0x480737(0x162),_0x480737(0x123));const _0x3ce6ee=userIdsOf(_0x393c7d),_0x115151=[];if(_0x52546b[_0x480737(0x160)]!==undefined&&_0x52546b[_0x480737(0x160)]!==_0x3ce6ee[_0x480737(0x122)])throw CliErrors['validation']('Anti-drift\x20check\x20failed:\x20expected\x20'+_0x52546b[_0x480737(0x160)]+_0x480737(0x15b)+_0x3ce6ee['length']+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x405644=_0x3ce6ee[_0x480737(0x14e)](_0x4f6b2['userId']);let _0x2ee8c0=![];const _0x4619ed=[..._0x393c7d[_0x480737(0x154)]];if(_0x3a0768===_0x480737(0x140))_0x405644?_0x115151[_0x480737(0x13b)](_0x480737(0x12f)+_0x4f6b2['userId']+_0x480737(0x127)+_0x393c7d[_0x480737(0x130)]+';\x20no\x20change.'):(_0x4619ed[_0x480737(0x13b)]({'userId':_0x4f6b2[_0x480737(0x142)],'username':_0x4f6b2[_0x480737(0x126)],..._0x4f6b2[_0x480737(0x144)]?{'nickname':_0x4f6b2[_0x480737(0x144)]}:{}}),_0x2ee8c0=!![]);else{if(!_0x405644)_0x115151['push'](_0x480737(0x12f)+_0x4f6b2[_0x480737(0x142)]+_0x480737(0x156)+_0x393c7d['roleName']+_0x480737(0x132));else{const _0x2bd0dc=_0x4619ed['findIndex'](_0x338730=>_0x338730[_0x480737(0x142)]===_0x4f6b2[_0x480737(0x142)]);if(_0x2bd0dc>=0x0)_0x4619ed['splice'](_0x2bd0dc,0x1);_0x2ee8c0=!![];}}const _0x50de39=_0x4a3fac[_0x480737(0x12e)](_0x524fbc=>_0x524fbc['id']===_0x1d8205?{..._0x524fbc,'userList':_0x4619ed}:_0x524fbc),_0x1f758c=_0x4619ed[_0x480737(0x12e)](_0x2cd578=>_0x2cd578[_0x480737(0x142)]),_0x31c3b5={'operation':_0x3a0768,'selector':{'appCode':_0x29d367,'roleId':_0x1d8205,'roleName':_0x393c7d['roleName'],'userId':_0x4f6b2['userId']},'before':{'userIds':_0x3ce6ee},'after':{'userIds':_0x1f758c},'dryRun':_0x52546b[_0x480737(0x12c)],'backend':{'method':'POST','path':UPDATE_USER_LIST_PATH},'warnings':_0x115151};return{'roleList':_0x50de39,'mutation':_0x31c3b5,'changed':_0x2ee8c0};}export async function loadRoleUsers(_0x37a90e){return listRoleUsers(_0x37a90e);}export function readRoleRef(_0x5a8d9b){const _0x5429c8=a149_0x5a6c1e,_0x5ebe17=_0x5a8d9b['str'](_0x5429c8(0x14c))[_0x5429c8(0x133)]();if(!_0x5ebe17)throw CliErrors['flagMissing']('role',_0x5429c8(0x15d));return _0x5ebe17;}export async function prepareUserMutation(_0x330d9a,_0x3dd15d,_0x4fd703){const _0x40b2ba=a149_0x5a6c1e,_0x27a9c1=readRoleRef(_0x330d9a),_0x3164ac=_0x330d9a['str'](_0x40b2ba(0x15e))[_0x40b2ba(0x133)]();if(!_0x3164ac)throw CliErrors[_0x40b2ba(0x167)]('user',_0x40b2ba(0x155));const _0x48eb3d=_0x330d9a[_0x40b2ba(0x163)](_0x40b2ba(0x14d)),_0x1bb300=_0x48eb3d===undefined||_0x48eb3d===null?undefined:Number(_0x48eb3d),_0x10ef93=await resolveRoleRef(_0x330d9a['appCode'],_0x27a9c1),_0x3b6194=await resolveUserRef(_0x3164ac),_0x5557fb=await loadRoleUsers(_0x330d9a[_0x40b2ba(0x150)]);return computeRoleUserMutation({'operation':_0x3dd15d,'appCode':_0x330d9a['appCode'],'roleUsers':_0x5557fb,'targetRoleId':_0x10ef93['id'],'user':{'userId':_0x3b6194[_0x40b2ba(0x142)],'username':_0x3b6194[_0x40b2ba(0x126)],'nickname':_0x3b6194['nickname']},'dryRun':_0x4fd703,..._0x1bb300!==undefined?{'expectUserCount':_0x1bb300}:{}});}
@@ -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
+ const a150_0x1dcec4=a150_0x2ebe;(function(_0xa157ab,_0x16b1c3){const _0x40877d=a150_0x2ebe,_0x171162=_0xa157ab();while(!![]){try{const _0x580667=-parseInt(_0x40877d(0x11a))/0x1*(-parseInt(_0x40877d(0x11c))/0x2)+parseInt(_0x40877d(0x115))/0x3+-parseInt(_0x40877d(0x10f))/0x4+parseInt(_0x40877d(0x11d))/0x5+-parseInt(_0x40877d(0x107))/0x6+parseInt(_0x40877d(0x108))/0x7*(-parseInt(_0x40877d(0x10e))/0x8)+-parseInt(_0x40877d(0x10a))/0x9*(-parseInt(_0x40877d(0x113))/0xa);if(_0x580667===_0x16b1c3)break;else _0x171162['push'](_0x171162['shift']());}catch(_0x469542){_0x171162['push'](_0x171162['shift']());}}}(a150_0x1af0,0x22191));function a150_0x2ebe(_0xd6f431,_0x8ccb41){_0xd6f431=_0xd6f431-0x105;const _0x1af080=a150_0x1af0();let _0x2ebe72=_0x1af080[_0xd6f431];return _0x2ebe72;}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_0x1af0(){const _0x231134=['name','5321870DavAJK','num','162549gtUzxi','validation','length','roleName','POST','18412RjSPth','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','6KNHajg','420925IaBQaH','update','New\x20role\x20name','337026uDWlmS','159642gURffL','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','9EVQQuQ','remark','role','appCode','88bvddPd','1116356fxQQgt','flag','--name\x20cannot\x20be\x20empty.'];a150_0x1af0=function(){return _0x231134;};return a150_0x1af0();}const UPDATE_PATH='/smartapi/permit/role/update';function readPatch(_0x4e7e2b){const _0x22c62c=a150_0x2ebe,_0x2fc913=_0x4e7e2b[_0x22c62c(0x110)](_0x22c62c(0x112)),_0xa85bd=_0x4e7e2b[_0x22c62c(0x110)](_0x22c62c(0x10b)),_0x2f1c8f={};if(_0x2fc913!==undefined&&_0x2fc913!==null){const _0x284ad5=String(_0x2fc913)['trim']();if(!_0x284ad5)throw CliErrors[_0x22c62c(0x116)](_0x22c62c(0x111));if(_0x284ad5[_0x22c62c(0x117)]>0x40)throw CliErrors[_0x22c62c(0x116)]('Role\x20name\x20cannot\x20exceed\x2064\x20characters.');_0x2f1c8f['roleName']=_0x284ad5;}_0xa85bd!==undefined&&_0xa85bd!==null&&(_0x2f1c8f['remark']=String(_0xa85bd));if(_0x2f1c8f[_0x22c62c(0x118)]===undefined&&_0x2f1c8f[_0x22c62c(0x10b)]===undefined)throw CliErrors[_0x22c62c(0x116)]('Nothing\x20to\x20update.',_0x22c62c(0x11b));return _0x2f1c8f;}export const roleUpdate={'service':a150_0x1dcec4(0x10c),'command':a150_0x1dcec4(0x105),'description':a150_0x1dcec4(0x109),'risk':'write','flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a150_0x1dcec4(0x112),'type':'string','required':![],'description':a150_0x1dcec4(0x106)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x40558a){readPatch(_0x40558a);},async 'dryRun'(_0x3f70c3){const _0x4b723f=a150_0x1dcec4,_0x1059c2=_0x3f70c3[_0x4b723f(0x114)]('id'),_0x32b19b=readPatch(_0x3f70c3),_0x374f0b=await getRoleById(_0x3f70c3['appCode'],_0x1059c2);return assertCustomRole(_0x374f0b,_0x4b723f(0x105)),asDryRunResult({'operation':_0x4b723f(0x105),'selector':{'appCode':_0x3f70c3['appCode'],'roleId':_0x1059c2,'roleName':_0x374f0b[_0x4b723f(0x118)]},'before':projectRole(_0x374f0b),'after':projectRole({..._0x374f0b,..._0x32b19b[_0x4b723f(0x118)]!==undefined?{'roleName':_0x32b19b[_0x4b723f(0x118)]}:{},..._0x32b19b['remark']!==undefined?{'remark':_0x32b19b[_0x4b723f(0x10b)]}:{}}),'dryRun':!![],'backend':{'method':_0x4b723f(0x119),'path':UPDATE_PATH},'warnings':[]},{'method':_0x4b723f(0x119),'url':UPDATE_PATH});},async 'execute'(_0x55740f){const _0x59ef12=a150_0x1dcec4,_0x3fdd2d=_0x55740f[_0x59ef12(0x114)]('id'),_0x133257=readPatch(_0x55740f),_0x45dafc=await getRoleById(_0x55740f[_0x59ef12(0x10d)],_0x3fdd2d);assertCustomRole(_0x45dafc,_0x59ef12(0x105)),await updateAppRole({'id':_0x3fdd2d,'appCode':_0x55740f[_0x59ef12(0x10d)],..._0x133257[_0x59ef12(0x118)]!==undefined?{'roleName':_0x133257[_0x59ef12(0x118)]}:{},..._0x133257[_0x59ef12(0x10b)]!==undefined?{'remark':_0x133257[_0x59ef12(0x10b)]}:{}});const _0x3e3d20=await getRoleById(_0x55740f[_0x59ef12(0x10d)],_0x3fdd2d);return{'ok':!![],'data':{'operation':'update','selector':{'appCode':_0x55740f[_0x59ef12(0x10d)],'roleId':_0x3fdd2d,'roleName':_0x3e3d20[_0x59ef12(0x118)]},'before':projectRole(_0x45dafc),'after':projectRole(_0x3e3d20),'dryRun':![],'backend':{'method':_0x59ef12(0x119),'path':UPDATE_PATH},'warnings':[]},'message':'Updated\x20role\x20'+_0x3e3d20['roleName']+'\x20(id='+_0x3fdd2d+')'};}};
@@ -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
+ function a151_0xa545(_0x121e99,_0x1cd079){_0x121e99=_0x121e99-0x13d;const _0x306ff5=a151_0x306f();let _0xa545ee=_0x306ff5[_0x121e99];return _0xa545ee;}const a151_0x4679cb=a151_0xa545;(function(_0x18cb37,_0x395a83){const _0x284d77=a151_0xa545,_0x18dd39=_0x18cb37();while(!![]){try{const _0xa3ebf=parseInt(_0x284d77(0x144))/0x1+parseInt(_0x284d77(0x146))/0x2*(-parseInt(_0x284d77(0x149))/0x3)+parseInt(_0x284d77(0x142))/0x4*(parseInt(_0x284d77(0x148))/0x5)+-parseInt(_0x284d77(0x13f))/0x6+-parseInt(_0x284d77(0x151))/0x7+-parseInt(_0x284d77(0x14a))/0x8+parseInt(_0x284d77(0x140))/0x9;if(_0xa3ebf===_0x395a83)break;else _0x18dd39['push'](_0x18dd39['shift']());}catch(_0x307887){_0x18dd39['push'](_0x18dd39['shift']());}}}(a151_0x306f,0xb2f4e));import{updateRoleUsers}from'../../core/api-client.js';function a151_0x306f(){const _0x8de3c4=['high-risk-write','appCode','Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','6458739StEcSp','roleName','userId','5626494xBGYvk','26252667vaMFiU','role','5389900kLzsgw','No\x20change:\x20user\x20','70089ymDWNw','user-add','51202uHnKyb','POST','5IHMArF','75pojubT','8808560clLZxo','\x20to\x20role\x20','\x20already\x20in\x20role\x20','selector'];a151_0x306f=function(){return _0x8de3c4;};return a151_0x306f();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':a151_0x4679cb(0x141),'command':a151_0x4679cb(0x145),'description':a151_0x4679cb(0x150),'risk':a151_0x4679cb(0x14e),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x128f35){const _0x226f88=a151_0x4679cb,{mutation:_0x31004c}=await prepareUserMutation(_0x128f35,_0x226f88(0x145),!![]);return asDryRunResult(_0x31004c,{'method':_0x226f88(0x147),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x3d7f54){const _0x3ebadb=a151_0x4679cb,{roleList:_0x3062e9,mutation:_0x225f0f,changed:_0x5d9685}=await prepareUserMutation(_0x3d7f54,_0x3ebadb(0x145),![]);return _0x5d9685&&await updateRoleUsers(_0x3d7f54[_0x3ebadb(0x14f)],_0x3062e9),{'ok':!![],'data':_0x225f0f,'message':_0x5d9685?'Added\x20user\x20'+_0x225f0f['selector'][_0x3ebadb(0x13e)]+_0x3ebadb(0x14b)+_0x225f0f[_0x3ebadb(0x14d)][_0x3ebadb(0x13d)]:_0x3ebadb(0x143)+_0x225f0f['selector'][_0x3ebadb(0x13e)]+_0x3ebadb(0x14c)+_0x225f0f['selector'][_0x3ebadb(0x13d)]};}};
@@ -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_0x4bb4e3=a152_0x574d;(function(_0x2d4fe9,_0x32de1c){const _0x461f64=a152_0x574d,_0x4a0f69=_0x2d4fe9();while(!![]){try{const _0x49229e=-parseInt(_0x461f64(0xe4))/0x1+parseInt(_0x461f64(0xe8))/0x2*(-parseInt(_0x461f64(0xe5))/0x3)+parseInt(_0x461f64(0xdb))/0x4+-parseInt(_0x461f64(0xd7))/0x5+-parseInt(_0x461f64(0xdd))/0x6*(parseInt(_0x461f64(0xd4))/0x7)+-parseInt(_0x461f64(0xe3))/0x8*(parseInt(_0x461f64(0xd3))/0x9)+parseInt(_0x461f64(0xd5))/0xa;if(_0x49229e===_0x32de1c)break;else _0x4a0f69['push'](_0x4a0f69['shift']());}catch(_0x228ef2){_0x4a0f69['push'](_0x4a0f69['shift']());}}}(a152_0x6080,0x8e850));import{updateRoleUsers}from'../../core/api-client.js';function a152_0x574d(_0x2db8d3,_0x274f18){_0x2db8d3=_0x2db8d3-0xd2;const _0x6080b3=a152_0x6080();let _0x574d76=_0x6080b3[_0x2db8d3];return _0x574d76;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a152_0x6080(){const _0x25473c=['user-remove','userId','344pyzPUi','6483nYCKUY','184125vabojx','\x20from\x20role\x20','Removed\x20user\x20','20YAUBio','\x20not\x20in\x20role\x20','174591UerXzQ','2513MXVKjg','27067380xCXoeZ','roleName','3762695iuCHIN','role','Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','selector','1853656sTDaWo','high-risk-write','6342bmMVZH','appCode','No\x20change:\x20user\x20','POST'];a152_0x6080=function(){return _0x25473c;};return a152_0x6080();}import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':a152_0x4bb4e3(0xd8),'command':a152_0x4bb4e3(0xe1),'description':a152_0x4bb4e3(0xd9),'risk':a152_0x4bb4e3(0xdc),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x3f1ace){const _0x503816=a152_0x4bb4e3,{mutation:_0x3478ab}=await prepareUserMutation(_0x3f1ace,_0x503816(0xe1),!![]);return asDryRunResult(_0x3478ab,{'method':_0x503816(0xe0),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x119efa){const _0x421022=a152_0x4bb4e3,{roleList:_0x3a6503,mutation:_0x38dcd5,changed:_0x188e21}=await prepareUserMutation(_0x119efa,'user-remove',![]);return _0x188e21&&await updateRoleUsers(_0x119efa[_0x421022(0xde)],_0x3a6503),{'ok':!![],'data':_0x38dcd5,'message':_0x188e21?_0x421022(0xe7)+_0x38dcd5[_0x421022(0xda)][_0x421022(0xe2)]+_0x421022(0xe6)+_0x38dcd5[_0x421022(0xda)][_0x421022(0xd6)]:_0x421022(0xdf)+_0x38dcd5[_0x421022(0xda)][_0x421022(0xe2)]+_0x421022(0xd2)+_0x38dcd5[_0x421022(0xda)][_0x421022(0xd6)]};}};
@@ -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_0x2e2e54=a153_0x3aa3;(function(_0x2dba23,_0x243ce5){const _0x38a781=a153_0x3aa3,_0x596136=_0x2dba23();while(!![]){try{const _0x41c7c1=-parseInt(_0x38a781(0x19e))/0x1*(-parseInt(_0x38a781(0x1a6))/0x2)+-parseInt(_0x38a781(0x1a4))/0x3*(-parseInt(_0x38a781(0x1a9))/0x4)+parseInt(_0x38a781(0x1ac))/0x5*(-parseInt(_0x38a781(0x1a5))/0x6)+parseInt(_0x38a781(0x1a3))/0x7+parseInt(_0x38a781(0x1a8))/0x8+parseInt(_0x38a781(0x1a7))/0x9*(-parseInt(_0x38a781(0x19f))/0xa)+-parseInt(_0x38a781(0x19c))/0xb*(parseInt(_0x38a781(0x1ab))/0xc);if(_0x41c7c1===_0x243ce5)break;else _0x596136['push'](_0x596136['shift']());}catch(_0x34ba97){_0x596136['push'](_0x596136['shift']());}}}(a153_0x19df,0x2cbb3));function a153_0x19df(){const _0x373082=['877024vMkmdJ','41660KGLVQg','trim','132mfNThX','10YFXsDx','nickname','flagMissing','str','matchedBy','userId','447601EujhmK','name','22905saOjHP','20RYPCwj','read','\x22\x20→\x20userId\x20','user-resolve','2303602pIeakc','81RPnzNX','849222TECTCa','18vkbgkk','54765ERiVvi'];a153_0x19df=function(){return _0x373082;};return a153_0x19df();}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';function a153_0x3aa3(_0x2db541,_0x3be0b2){_0x2db541=_0x2db541-0x19b;const _0x19df20=a153_0x19df();let _0x3aa359=_0x19df20[_0x2db541];return _0x3aa359;}export const roleUserResolve={'service':'role','command':a153_0x2e2e54(0x1a2),'description':'Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','risk':a153_0x2e2e54(0x1a0),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2f4062){const _0x34cc49=a153_0x2e2e54;if(!_0x2f4062[_0x34cc49(0x1af)](_0x34cc49(0x19d))[_0x34cc49(0x1aa)]())throw CliErrors[_0x34cc49(0x1ae)]('name','Pass\x20--name\x20<nickname|username>.');},async 'execute'(_0x51dfc2){const _0x1e5e51=a153_0x2e2e54,_0x190086=_0x51dfc2[_0x1e5e51(0x1af)](_0x1e5e51(0x19d))['trim'](),_0xcdbc80=await resolveUserRef(_0x190086);return{'ok':!![],'data':{'user':{'userId':_0xcdbc80[_0x1e5e51(0x19b)],'username':_0xcdbc80['username'],'nickname':_0xcdbc80[_0x1e5e51(0x1ad)],'matchedBy':_0xcdbc80[_0x1e5e51(0x1b0)]}},'message':'Resolved\x20\x22'+_0x190086+_0x1e5e51(0x1a1)+_0xcdbc80[_0x1e5e51(0x19b)]};}};
@@ -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
+ function a154_0x1229(_0xd3979d,_0x3d4157){_0xd3979d=_0xd3979d-0x199;const _0x4d77d8=a154_0x4d77();let _0x122946=_0x4d77d8[_0xd3979d];return _0x122946;}const a154_0x4b7466=a154_0x1229;function a154_0x4d77(){const _0x3483f9=['\x20run\x20build','yarn','\x20\x20\x20\x20','Enable\x20watch\x20mode\x20for\x20preview','script','error','49706UYwXcD','1454052IvlYmZ','Available:\x20','preview','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','vite','slice','run','Run\x20a\x20package.json\x20script','.bin','push','876508TyrxPi','length','\x20\x20EXAMPLES','No\x20scripts\x20defined\x20in\x20package.json.','\x20run\x20preview','3818880qKCblz','inherit','node_modules','\x20run\x20start','4219173MhaOKi','(none)','pnpm-lock.yaml','yarn.lock','keys','bool','args','scripts','bun','has','validation','pnpm','\x20run\x20<script>\x0a','parse','belowMinimum','--watch','needsUpgrade','\x0a\x20\x20Available\x20scripts:\x0a','start','log','Script\x20name\x20defined\x20in\x20package.json','1625140GDIcRO','close','join','watch','build','1272708GjUYEs','1UszGer','cwd','utf-8','dev','\x20run\x20preview\x20--watch'];a154_0x4d77=function(){return _0x3483f9;};return a154_0x4d77();}(function(_0x4cc0fb,_0x15635f){const _0x4784e1=a154_0x1229,_0x2cf35f=_0x4cc0fb();while(!![]){try{const _0x3bf447=parseInt(_0x4784e1(0x1cc))/0x1*(parseInt(_0x4784e1(0x19d))/0x2)+-parseInt(_0x4784e1(0x19e))/0x3+parseInt(_0x4784e1(0x1a8))/0x4+-parseInt(_0x4784e1(0x1c6))/0x5+-parseInt(_0x4784e1(0x1cb))/0x6+parseInt(_0x4784e1(0x1b1))/0x7+parseInt(_0x4784e1(0x1ad))/0x8;if(_0x3bf447===_0x15635f)break;else _0x2cf35f['push'](_0x2cf35f['shift']());}catch(_0x1bd4cf){_0x2cf35f['push'](_0x2cf35f['shift']());}}}(a154_0x4d77,0x49ca9));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_0x4b7466(0x1c3),a154_0x4b7466(0x1cf)]);function readPackageScripts(_0x299728){const _0x3e156f=a154_0x4b7466,_0x57df52=resolve(_0x299728,'package.json');if(!existsSync(_0x57df52))return null;try{const _0xebe6a2=JSON[_0x3e156f(0x1be)](readFileSync(_0x57df52,_0x3e156f(0x1ce)));return _0xebe6a2[_0x3e156f(0x1b8)]??{};}catch{return null;}}function detectPackageManager(_0x90cae6){const _0x4eb78a=a154_0x4b7466;if(existsSync(resolve(_0x90cae6,'bun.lockb'))||existsSync(resolve(_0x90cae6,'bun.lock')))return _0x4eb78a(0x1b9);if(existsSync(resolve(_0x90cae6,_0x4eb78a(0x1b3))))return _0x4eb78a(0x1bc);if(existsSync(resolve(_0x90cae6,_0x4eb78a(0x1b4))))return _0x4eb78a(0x1d2);return'npm';}async function versionCheck(_0xd602c3){const _0x4e321c=a154_0x4b7466,_0x5f07ca=await checkCliVersion();(_0x5f07ca['needsUpgrade']||_0x5f07ca[_0x4e321c(0x1bf)])&&(printCliUpgradeWarning(_0x5f07ca),assertCliVersionSupported(_0x5f07ca));const _0xdd5c7c=await checkSdkVersion(_0xd602c3);if(_0xdd5c7c[_0x4e321c(0x1c1)])printSdkUpgradeWarning(_0xdd5c7c);}function spawnScript(_0xb023e5,_0x3d3e31,_0x4b9722,_0x467941){return new Promise((_0x1c4697,_0x578ccd)=>{const _0x1a0730=a154_0x1229,_0x47531e=[_0x1a0730(0x1a4),_0x3d3e31,..._0x4b9722],_0x180da3=spawn(_0xb023e5,_0x47531e,{'cwd':_0x467941,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x467941,_0x1a0730(0x1af),_0x1a0730(0x1a6))+delimiter+process.env.PATH}});_0x180da3['on'](_0x1a0730(0x1c7),_0x1a7a7e=>{if(_0x1a7a7e===0x0||_0x1a7a7e===null)_0x1c4697();else _0x578ccd(new Error(_0xb023e5+'\x20run\x20'+_0x3d3e31+'\x20exited\x20with\x20code\x20'+_0x1a7a7e));}),_0x180da3['on'](_0x1a0730(0x19c),_0x578ccd);});}function spawnViteBuildWatch(_0x4817aa){return new Promise((_0x8f28dc,_0x34f12b)=>{const _0x390098=a154_0x1229,_0x2d8a71=spawn('vite',[_0x390098(0x1ca),_0x390098(0x1c0)],{'cwd':_0x4817aa,'stdio':_0x390098(0x1ae),'shell':!![],'env':{...process.env,'PATH':''+join(_0x4817aa,_0x390098(0x1af),_0x390098(0x1a6))+delimiter+process.env.PATH}});_0x2d8a71['on'](_0x390098(0x1c7),_0x38408d=>{const _0x49566f=_0x390098;if(_0x38408d===0x0||_0x38408d===null)_0x8f28dc();else _0x34f12b(new Error(_0x49566f(0x1a1)+_0x38408d));}),_0x2d8a71['on'](_0x390098(0x19c),_0x34f12b);});}function spawnVitePreview(_0x3c616a){return new Promise((_0x3a2160,_0x524247)=>{const _0xa785a2=a154_0x1229,_0x4a1da8=spawn(_0xa785a2(0x1a2),['preview'],{'cwd':_0x3c616a,'stdio':_0xa785a2(0x1ae),'shell':!![],'env':{...process.env,'PATH':''+join(_0x3c616a,_0xa785a2(0x1af),_0xa785a2(0x1a6))+delimiter+process.env.PATH}});_0x4a1da8['on'](_0xa785a2(0x1c7),_0x2674e4=>{if(_0x2674e4===0x0||_0x2674e4===null)_0x3a2160();else _0x524247(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x2674e4));}),_0x4a1da8['on'](_0xa785a2(0x19c),_0x524247);});}const runFlags=[{'name':a154_0x4b7466(0x1c9),'type':'boolean','description':a154_0x4b7466(0x19a),'default':![]}];export const runDefinition={'service':'run','command':a154_0x4b7466(0x1a4),'description':a154_0x4b7466(0x1a5),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a154_0x4b7466(0x19b),'description':a154_0x4b7466(0x1c5),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0xd92a25=a154_0x4b7466,_0x4ab72d=[];return _0x4ab72d[_0xd92a25(0x1a7)](_0xd92a25(0x1aa)),_0x4ab72d[_0xd92a25(0x1a7)](_0xd92a25(0x199)+CLI_BIN_NAME+_0xd92a25(0x1b0)),_0x4ab72d[_0xd92a25(0x1a7)](_0xd92a25(0x199)+CLI_BIN_NAME+_0xd92a25(0x1d1)),_0x4ab72d['push'](_0xd92a25(0x199)+CLI_BIN_NAME+_0xd92a25(0x1ac)),_0x4ab72d[_0xd92a25(0x1a7)](_0xd92a25(0x199)+CLI_BIN_NAME+_0xd92a25(0x1d0)),_0x4ab72d[_0xd92a25(0x1c8)]('\x0a');},async 'execute'(_0x50b4de){const _0x19f11e=a154_0x4b7466,_0x4271b8=process[_0x19f11e(0x1cd)](),_0x39fe1f=_0x50b4de[_0x19f11e(0x1b7)][0x0],_0x303053=_0x50b4de[_0x19f11e(0x1b7)][_0x19f11e(0x1a3)](0x1),_0x1ddb49=readPackageScripts(_0x4271b8);if(!_0x1ddb49)throw CliErrors[_0x19f11e(0x1bb)]('No\x20package.json\x20found\x20in\x20current\x20directory.');if(!_0x39fe1f){const _0x19bffd=Object[_0x19f11e(0x1b5)](_0x1ddb49);if(_0x19bffd[_0x19f11e(0x1a9)]===0x0)console[_0x19f11e(0x1c4)](_0x19f11e(0x1ab));else{console[_0x19f11e(0x1c4)](_0x19f11e(0x1c2));for(const _0x3684ac of _0x19bffd){console['log'](_0x19f11e(0x199)+_0x3684ac);}console[_0x19f11e(0x1c4)]('\x0a\x20\x20Usage:\x20'+CLI_BIN_NAME+_0x19f11e(0x1bd));}return{'ok':!![]};}if(!_0x1ddb49[_0x39fe1f])throw CliErrors[_0x19f11e(0x1bb)]('Script\x20\x22'+_0x39fe1f+'\x22\x20not\x20found\x20in\x20package.json.',_0x19f11e(0x19f)+(Object[_0x19f11e(0x1b5)](_0x1ddb49)[_0x19f11e(0x1c8)](',\x20')||_0x19f11e(0x1b2)));const _0x631bfa=detectPackageManager(_0x4271b8);VERSION_CHECK_SCRIPTS[_0x19f11e(0x1ba)](_0x39fe1f)&&await versionCheck(_0x4271b8);if(_0x39fe1f===_0x19f11e(0x1a0)&&_0x50b4de[_0x19f11e(0x1b6)](_0x19f11e(0x1c9)))return await Promise['all']([spawnViteBuildWatch(_0x4271b8),spawnVitePreview(_0x4271b8)]),{'ok':!![]};return await spawnScript(_0x631bfa,_0x39fe1f,_0x303053,_0x4271b8),{'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
+ function a155_0x1749(_0x1e9cb5,_0x1b7cc5){_0x1e9cb5=_0x1e9cb5-0x1f1;const _0xfbbd1e=a155_0xfbbd();let _0x174972=_0xfbbd1e[_0x1e9cb5];return _0x174972;}const a155_0x23de89=a155_0x1749;(function(_0x5c438d,_0x5df46d){const _0x4cae28=a155_0x1749,_0x1652df=_0x5c438d();while(!![]){try{const _0x5a772a=parseInt(_0x4cae28(0x1f7))/0x1+parseInt(_0x4cae28(0x1f8))/0x2*(-parseInt(_0x4cae28(0x1fd))/0x3)+parseInt(_0x4cae28(0x1f6))/0x4*(parseInt(_0x4cae28(0x1f4))/0x5)+-parseInt(_0x4cae28(0x1f5))/0x6*(parseInt(_0x4cae28(0x1fb))/0x7)+-parseInt(_0x4cae28(0x1f3))/0x8+parseInt(_0x4cae28(0x1fe))/0x9*(-parseInt(_0x4cae28(0x1fc))/0xa)+-parseInt(_0x4cae28(0x1f1))/0xb*(-parseInt(_0x4cae28(0x1ff))/0xc);if(_0x5a772a===_0x5df46d)break;else _0x1652df['push'](_0x1652df['shift']());}catch(_0x241141){_0x1652df['push'](_0x1652df['shift']());}}}(a155_0xfbbd,0xb2594));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x1d8527){const _0xd085f8=await buildSchemaPayload();return{'ok':!![],'data':_0xd085f8};}function a155_0xfbbd(){const _0x294536=['488607MZiFTe','4922gPYGGE','json','read','5437502spQuvE','506350ZxCcCv','708KVVHLV','189HZMLYp','876fktwYJ','438559ksrmQE','export','6121256bxMchl','115ESsjGQ','6xguRFx','90008ijBcPo'];a155_0xfbbd=function(){return _0x294536;};return a155_0xfbbd();}export const schemaDefinition={'service':'schema','command':a155_0x23de89(0x1f2),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a155_0x23de89(0x1fa),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a155_0x23de89(0x1f9),'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_0x24621f=a156_0x35ba;(function(_0x5c6927,_0x30e62f){const _0x563acb=a156_0x35ba,_0x45c80b=_0x5c6927();while(!![]){try{const _0x1c5f34=-parseInt(_0x563acb(0x1e3))/0x1+parseInt(_0x563acb(0x200))/0x2+-parseInt(_0x563acb(0x1de))/0x3+-parseInt(_0x563acb(0x1da))/0x4*(-parseInt(_0x563acb(0x215))/0x5)+parseInt(_0x563acb(0x212))/0x6*(parseInt(_0x563acb(0x217))/0x7)+-parseInt(_0x563acb(0x1e2))/0x8+-parseInt(_0x563acb(0x1e7))/0x9;if(_0x1c5f34===_0x30e62f)break;else _0x45c80b['push'](_0x45c80b['shift']());}catch(_0x330011){_0x45c80b['push'](_0x45c80b['shift']());}}}(a156_0x26a8,0x74176));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';function a156_0x35ba(_0x302833,_0xeee552){_0x302833=_0x302833-0x1d9;const _0x26a8e2=a156_0x26a8();let _0x35ba78=_0x26a8e2[_0x302833];return _0x35ba78;}import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a156_0x26a8(){const _0x1ef84a=['/smartapi/custom/saveUserCustomSql','str','nonInteractive','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','description','catch','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','Created\x20SQL\x20query\x20','dbName','请选择本地\x20SQL\x20模式:','string','sqlRootDir','请输入目标数据库\x20dbId:','new','sqlRoot','普通\x20SQL(sql)','1821596ESkSAu','<server-generated-sqlCode>','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','join','map','trim','high-risk-write','mybatisXml','请选择目标数据库:','appCode','utf8','flagMissing','__manual__','isFinite','number','Local\x20SQL\x20file\x20mode','SQL\x20名称不能为空','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','1758UQvzRv','lockFilePath','toISOString','3351585cUgizJ','dbId\x20不能为空','17234igAGtU','sqlName','sqlCode','mode','name','validation','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','length','db-id','4UfIDiQ','lastSync','SELECT\x201\x20AS\x20id;','parse','2627826aAjiXn','stringify','Target\x20database\x20ID','适合带动态标签的\x20MyBatis\x20XML\x20SQL','2988616ghxUnE','13867PPJGsg','isInteger','SQL\x20query\x20display\x20name','sql','5072265iGTzXK','请输入\x20SQL\x20名称:','dbId','\x20\x20SELECT\x201\x20AS\x20id','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','create','sqls','Invalid\x20database\x20selection\x20payload:\x20'];a156_0x26a8=function(){return _0x1ef84a;};return a156_0x26a8();}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(_0x2dd3e5){const _0x355af6=a156_0x35ba;if(_0x2dd3e5===_0x355af6(0x207))return[_0x355af6(0x1f5),_0x355af6(0x1ea),'</select>',''][_0x355af6(0x203)]('\x0a');return[_0x355af6(0x1dc),''][_0x355af6(0x203)]('\x0a');}export const sqlCreate={'service':a156_0x24621f(0x1e6),'command':a156_0x24621f(0x1ec),'description':a156_0x24621f(0x21d),'risk':a156_0x24621f(0x206),'flags':[{'name':a156_0x24621f(0x21b),'type':a156_0x24621f(0x1fa),'description':a156_0x24621f(0x1e5)},{'name':a156_0x24621f(0x1d9),'type':a156_0x24621f(0x20e),'description':a156_0x24621f(0x1e0)},{'name':'mode','type':a156_0x24621f(0x1fa),'enum':[a156_0x24621f(0x1e6),a156_0x24621f(0x207)],'description':a156_0x24621f(0x20f)}],async 'validate'(_0x56c7f7){const _0x21e946=a156_0x24621f;if(!_0x56c7f7[_0x21e946(0x1f1)])return;if(!_0x56c7f7['str'](_0x21e946(0x21b))[_0x21e946(0x205)]())throw CliErrors[_0x21e946(0x20b)]('name',_0x21e946(0x1f2));const _0x511ec2=resolveProvidedDbId(_0x56c7f7);if(typeof _0x511ec2!==_0x21e946(0x20e)||!Number['isFinite'](_0x511ec2)||_0x511ec2<=0x0)throw CliErrors[_0x21e946(0x20b)]('db-id','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');if(!_0x56c7f7[_0x21e946(0x1f0)](_0x21e946(0x21a))[_0x21e946(0x205)]())throw CliErrors[_0x21e946(0x20b)](_0x21e946(0x21a),_0x21e946(0x1f6));},async 'dryRun'(_0x18e450){const _0x4ad4cd=a156_0x24621f,_0x58fb5e=loadSqlProjectConfig(_0x18e450[_0x4ad4cd(0x209)]),{sqlName:_0x39ff68,dbId:_0x21f981,dbName:_0x2b2780,mode:_0x396afd}=await resolveSqlNewInputs(_0x18e450),_0x354bdd=buildSqlRelativePath(_0x4ad4cd(0x201),_0x39ff68,_0x2b2780,_0x396afd,_0x21f981),_0x114b2c=_0x58fb5e[_0x4ad4cd(0x1fb)]+'/'+_0x354bdd;return{'method':'POST','url':_0x4ad4cd(0x1ef),'body':{'appCode':_0x18e450['appCode'],'sqlName':_0x39ff68,'dbId':_0x21f981,'mode':_0x396afd,'localPath':_0x114b2c},'description':_0x4ad4cd(0x211)+_0x58fb5e['sqlRootDir']};},async 'execute'(_0x2a56e8){const _0xda2c4e=a156_0x24621f,_0x1464c9=loadSqlProjectConfig(_0x2a56e8[_0xda2c4e(0x209)]),{sqlName:_0x49ec99,dbId:_0x16db32,dbName:_0x3e4318,mode:_0x40ebda}=await resolveSqlNewInputs(_0x2a56e8),_0x5538cc=generateSqlTemplate(_0x40ebda),_0x36cc8a=await createSqlQuery({'appCode':_0x2a56e8[_0xda2c4e(0x209)],'sqlName':_0x49ec99,'dbId':_0x16db32,'sqlContent':_0x5538cc}),_0x44a873=ensureRemoteSqlContent(_0x36cc8a),_0x152d24=_0x3e4318||await getDbName(_0x2a56e8[_0xda2c4e(0x209)],_0x16db32)['catch'](()=>undefined),_0x619027=buildSqlRelativePath(_0x36cc8a['sqlCode'],_0x36cc8a[_0xda2c4e(0x218)],_0x152d24,_0x40ebda,_0x16db32),_0x2a5990=_0x1464c9['sqlRootDir']+'/'+_0x619027,_0x4be863=buildLocalSqlFileContent({'sqlCode':_0x36cc8a[_0xda2c4e(0x219)],'sqlName':_0x36cc8a[_0xda2c4e(0x218)],'dbId':_0x36cc8a[_0xda2c4e(0x1e9)]},_0x44a873,{'dbName':_0x152d24,'mode':_0x40ebda,'syncedAt':new Date()[_0xda2c4e(0x214)](),'description':_0x36cc8a[_0xda2c4e(0x1f3)]});if(await fileExists(_0x2a5990))throw CliErrors['validation']('File\x20already\x20exists:\x20'+_0x2a5990);await ensureParentDirectory(_0x2a5990),await writeFile(_0x2a5990,_0x4be863,_0xda2c4e(0x20a));const _0x1c0bf3=await readSqlLockFile(_0x1464c9[_0xda2c4e(0x213)]),{lockData:_0x57ca6c,appLock:_0xb15417}=ensureSqlLockScope(_0x1c0bf3??createEmptySqlLock(),_0x1464c9[_0xda2c4e(0x209)],_0x1464c9[_0xda2c4e(0x1fe)],_0xda2c4e(0x1fd));return _0xb15417[_0xda2c4e(0x1ed)][_0x36cc8a[_0xda2c4e(0x219)]]={...buildSqlLockEntry(_0x36cc8a,_0x44a873,computeSqlContentHash(_0x4be863),{'dbName':_0x152d24}),'path':_0x619027,'mode':_0x40ebda},_0xb15417[_0xda2c4e(0x1db)]=new Date()[_0xda2c4e(0x214)](),await writeSqlLockFile(_0x1464c9[_0xda2c4e(0x213)],_0x57ca6c),{'ok':!![],'data':{'id':_0x36cc8a['id'],'sqlCode':_0x36cc8a[_0xda2c4e(0x219)],'sqlName':_0x36cc8a[_0xda2c4e(0x218)],'dbId':_0x36cc8a['dbId'],'path':_0x2a5990,'mode':_0x40ebda},'message':_0xda2c4e(0x1f7)+_0x36cc8a[_0xda2c4e(0x219)]};}};async function resolveSqlNewInputs(_0x32e4db){const _0x57820c=await resolveSqlNameInput(_0x32e4db),{dbId:_0x1bad68,dbName:_0x3f9d7b}=await resolveDbSelection(_0x32e4db),_0x26ab58=await resolveSqlModeInput(_0x32e4db);return{'sqlName':_0x57820c,'dbId':_0x1bad68,'dbName':_0x3f9d7b,'mode':_0x26ab58};}async function resolveSqlNameInput(_0x3ef164){const _0x201ea0=a156_0x24621f,_0x4317f9=_0x3ef164[_0x201ea0(0x1f0)](_0x201ea0(0x21b))[_0x201ea0(0x205)]();if(_0x4317f9)return _0x4317f9;if(_0x3ef164[_0x201ea0(0x1f1)])throw CliErrors[_0x201ea0(0x20b)](_0x201ea0(0x21b),_0x201ea0(0x1f2));return(await input({'message':_0x201ea0(0x1e8),'validate':_0xb76408=>_0xb76408[_0x201ea0(0x205)]()?!![]:_0x201ea0(0x210)}))[_0x201ea0(0x205)]();}async function resolveDbSelection(_0x3c029e){const _0x39775b=a156_0x24621f,_0x20252b=resolveProvidedDbId(_0x3c029e);if(typeof _0x20252b==='number'&&Number[_0x39775b(0x20d)](_0x20252b)&&_0x20252b>0x0)return{'dbId':_0x20252b,'dbName':await getDbName(_0x3c029e[_0x39775b(0x209)],_0x20252b)[_0x39775b(0x1f4)](()=>undefined)};if(_0x3c029e['nonInteractive'])throw CliErrors['flagMissing']('db-id',_0x39775b(0x202));const _0x493daf=await listDatabases(_0x3c029e[_0x39775b(0x209)])[_0x39775b(0x1f4)](()=>[]);if(_0x493daf[_0x39775b(0x21e)]===0x1)return{'dbId':_0x493daf[0x0][_0x39775b(0x1e9)],'dbName':_0x493daf[0x0][_0x39775b(0x1f8)]};if(_0x493daf[_0x39775b(0x21e)]>0x1){const _0x516c34=await select({'message':_0x39775b(0x208),'choices':[..._0x493daf[_0x39775b(0x204)](_0x688b0c=>({'name':_0x688b0c['dbName']+'\x20('+_0x688b0c['dbId']+')','value':serializeDbSelection(_0x688b0c)})),{'name':'✎\x20手动输入\x20dbId','value':_0x39775b(0x20c)}]});if(_0x516c34!=='__manual__')return deserializeDbSelection(_0x516c34);}const _0x57b9cc=await input({'message':_0x39775b(0x1fc),'validate':_0x473014=>{const _0x4e7177=_0x39775b,_0x45f2a7=_0x473014['trim']();if(!_0x45f2a7)return _0x4e7177(0x216);const _0x193669=Number(_0x45f2a7);if(!Number[_0x4e7177(0x1e4)](_0x193669)||_0x193669<=0x0)return'dbId\x20必须为正整数';return!![];}});return{'dbId':Number(_0x57b9cc[_0x39775b(0x205)]())};}async function resolveSqlModeInput(_0xa38843){const _0x47e412=a156_0x24621f,_0x53ae9c=_0xa38843['str'](_0x47e412(0x21a))[_0x47e412(0x205)]();if(_0x53ae9c==='sql'||_0x53ae9c===_0x47e412(0x207))return _0x53ae9c;if(_0xa38843['nonInteractive'])throw CliErrors[_0x47e412(0x20b)](_0x47e412(0x21a),_0x47e412(0x1f6));return await select({'message':_0x47e412(0x1f9),'choices':[{'name':_0x47e412(0x1ff),'value':_0x47e412(0x1e6),'description':_0x47e412(0x1eb)},{'name':'MyBatis\x20XML(mybatisXml)','value':_0x47e412(0x207),'description':_0x47e412(0x1e1)}]});}function serializeDbSelection(_0x108b61){const _0x19c72b=a156_0x24621f;return JSON[_0x19c72b(0x1df)]({'dbId':_0x108b61[_0x19c72b(0x1e9)],'dbName':_0x108b61['dbName']});}function deserializeDbSelection(_0x13ca0c){const _0x58ec3b=a156_0x24621f;try{const _0x27451b=JSON[_0x58ec3b(0x1dd)](_0x13ca0c);if(typeof _0x27451b['dbId']===_0x58ec3b(0x20e)&&Number[_0x58ec3b(0x20d)](_0x27451b[_0x58ec3b(0x1e9)]))return{'dbId':_0x27451b[_0x58ec3b(0x1e9)],'dbName':_0x27451b[_0x58ec3b(0x1f8)]};}catch{}throw CliErrors[_0x58ec3b(0x21c)](_0x58ec3b(0x1ee)+_0x13ca0c);}function resolveProvidedDbId(_0x6f74a3){const _0x277168=a156_0x24621f,_0x21f0e2=_0x6f74a3['flag'](_0x277168(0x1d9));if(typeof _0x21f0e2===_0x277168(0x20e)&&Number[_0x277168(0x20d)](_0x21f0e2))return _0x21f0e2;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
+ const a157_0x2698b5=a157_0xb92d;(function(_0x6e764b,_0x4da0c1){const _0x1817e6=a157_0xb92d,_0x28aeec=_0x6e764b();while(!![]){try{const _0x12b92b=-parseInt(_0x1817e6(0x17c))/0x1*(parseInt(_0x1817e6(0x177))/0x2)+-parseInt(_0x1817e6(0x178))/0x3*(parseInt(_0x1817e6(0x17f))/0x4)+parseInt(_0x1817e6(0x18f))/0x5*(-parseInt(_0x1817e6(0x182))/0x6)+-parseInt(_0x1817e6(0x16b))/0x7+-parseInt(_0x1817e6(0x190))/0x8*(parseInt(_0x1817e6(0x171))/0x9)+-parseInt(_0x1817e6(0x18e))/0xa*(-parseInt(_0x1817e6(0x17b))/0xb)+parseInt(_0x1817e6(0x176))/0xc;if(_0x12b92b===_0x4da0c1)break;else _0x28aeec['push'](_0x28aeec['shift']());}catch(_0x11b0b4){_0x28aeec['push'](_0x28aeec['shift']());}}}(a157_0x5f40,0x3e00b));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';function a157_0xb92d(_0x3c4eed,_0x1aefb8){_0x3c4eed=_0x3c4eed-0x16b;const _0x5f4005=a157_0x5f40();let _0xb92d66=_0x5f4005[_0x3c4eed];return _0xb92d66;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a157_0x2698b5(0x174),'command':a157_0x2698b5(0x186),'description':a157_0x2698b5(0x16d),'risk':a157_0x2698b5(0x18a),'flags':[SQLCODE_FLAG],async 'validate'(_0x1c43f8){const _0x2adb79=a157_0x2698b5,_0x1ef106=loadSqlProjectConfig(_0x1c43f8['appCode']),_0x25a512=await readSqlLockFile(_0x1ef106[_0x2adb79(0x175)]);if(!_0x25a512)throw CliErrors['validation'](_0x2adb79(0x16c));},async 'dryRun'(_0x15533f){const _0x4f6c5d=a157_0x2698b5,_0x4cfd50=loadSqlProjectConfig(_0x15533f[_0x4f6c5d(0x185)]),_0x1bdf8e=await readSqlLockFile(_0x4cfd50[_0x4f6c5d(0x175)]);if(!_0x1bdf8e)throw CliErrors[_0x4f6c5d(0x191)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');const {appLock:_0x41a923}=ensureSqlLockScope(_0x1bdf8e,_0x15533f[_0x4f6c5d(0x185)],_0x4cfd50[_0x4f6c5d(0x173)],_0x4f6c5d(0x186)),_0x268ae8=_0x15533f[_0x4f6c5d(0x18b)](_0x4f6c5d(0x188)),_0x5863c9=_0x41a923['sqls'][_0x268ae8];if(!_0x5863c9)throw CliErrors[_0x4f6c5d(0x191)]('No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22'+_0x268ae8+'\x22.');return{'method':'POST','url':_0x4f6c5d(0x170),'body':{'sqlCode':_0x268ae8,'id':_0x5863c9[_0x4f6c5d(0x16e)],'localPath':resolveLocalSqlFilePath(_0x4cfd50,_0x268ae8,_0x5863c9)},'description':_0x4f6c5d(0x181)+_0x268ae8+_0x4f6c5d(0x16f)+_0x4cfd50[_0x4f6c5d(0x189)]};},async 'execute'(_0xe0c965){const _0x300e38=a157_0x2698b5,_0x479d67=loadSqlProjectConfig(_0xe0c965['appCode']),_0x216d69=await readSqlLockFile(_0x479d67[_0x300e38(0x175)]);if(!_0x216d69)throw CliErrors['validation'](_0x300e38(0x172));const {lockData:_0x52bd8d,appLock:_0x220c85}=ensureSqlLockScope(_0x216d69,_0xe0c965[_0x300e38(0x185)],_0x479d67[_0x300e38(0x173)],_0x300e38(0x186)),_0x4ea95f=_0xe0c965['str'](_0x300e38(0x188)),_0x5d4e1a=_0x220c85[_0x300e38(0x180)][_0x4ea95f];if(!_0x5d4e1a)throw CliErrors[_0x300e38(0x191)](_0x300e38(0x179)+_0x4ea95f+'\x22.');await deleteSqlQuery({'id':_0x5d4e1a[_0x300e38(0x16e)],'sqlCode':_0x4ea95f}),_0x220c85['sqls']=Object['fromEntries'](Object[_0x300e38(0x17e)](_0x220c85[_0x300e38(0x180)])[_0x300e38(0x18d)](([_0x23c4f0])=>_0x23c4f0!==_0x4ea95f)),_0x220c85[_0x300e38(0x17a)]=new Date()[_0x300e38(0x18c)](),await writeSqlLockFile(_0x479d67['lockFilePath'],_0x52bd8d);const _0x3bf9a3=resolveLocalSqlFilePath(_0x479d67,_0x4ea95f,_0x5d4e1a);let _0x333ee6;await fileExists(_0x3bf9a3)&&(_0x333ee6=await moveToTrash(_0x479d67[_0x300e38(0x184)],_0x479d67[_0x300e38(0x189)],_0x3bf9a3),await cleanupEmptyDirectories(dirname(_0x3bf9a3),_0x479d67['sqlRootDir']));const _0x3e6e70={'deleted':_0x4ea95f,'remoteId':_0x5d4e1a[_0x300e38(0x16e)]};if(_0x333ee6)_0x3e6e70[_0x300e38(0x183)]=_0x333ee6;return{'ok':!![],'data':_0x3e6e70,'message':'Deleted\x20'+_0x4ea95f+(_0x333ee6?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};async function moveToTrash(_0x467c3c,_0x5ca455,_0x122b72){const _0x1c9943=new Date()['toISOString']()['replace'](/[:.]/g,'-'),_0x8fa3c6=relative(_0x467c3c,_0x122b72),_0x22e44d=join(_0x5ca455,_0x1c9943,_0x8fa3c6);return await mkdir(dirname(_0x22e44d),{'recursive':!![]}),await rename(_0x122b72,_0x22e44d),_0x22e44d;}function a157_0x5f40(){const _0x39b99e=['11UsuxJY','131419oHxZUL','length','entries','3644GTxGQE','sqls','Would\x20delete\x20SQL\x20','6WBadia','trashedTo','projectRoot','appCode','delete','startsWith','sqlcode','trashDir','high-risk-write','str','toISOString','filter','3167870PtTdQt','1922585ejbiSg','712jWIEdn','validation','2662324dqYnob','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','remoteId','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','/smartapi/custom/deleteUserCustomSql','29844xmyYcS','SQL\x20lock\x20file\x20not\x20found.','sqlRoot','sql','lockFilePath','16970172bzHYoa','6pVfwuV','75jVHGuR','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','lastSync'];a157_0x5f40=function(){return _0x39b99e;};return a157_0x5f40();}async function cleanupEmptyDirectories(_0x261b50,_0x171f41){const _0x3b6157=a157_0x2698b5;let _0xcfe7ed=resolve(_0x261b50);const _0x30b6bb=resolve(_0x171f41);while(_0xcfe7ed[_0x3b6157(0x187)](''+_0x30b6bb+sep)||_0xcfe7ed===_0x30b6bb){if(_0xcfe7ed===_0x30b6bb)return;try{const _0x1d3374=await readdir(_0xcfe7ed);if(_0x1d3374[_0x3b6157(0x17d)]>0x0)return;await rmdir(_0xcfe7ed);}catch{return;}_0xcfe7ed=dirname(_0xcfe7ed);}}