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

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 -0
  115. package/lib/commands/notification/index.js +1 -0
  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 a141_0x2e329a=a141_0xfa8d;(function(_0x567a9d,_0x4275ad){const _0x3de6e9=a141_0xfa8d,_0x478143=_0x567a9d();while(!![]){try{const _0x267db8=parseInt(_0x3de6e9(0x17d))/0x1*(parseInt(_0x3de6e9(0x19c))/0x2)+parseInt(_0x3de6e9(0x1a3))/0x3+parseInt(_0x3de6e9(0x1a0))/0x4+parseInt(_0x3de6e9(0x196))/0x5*(-parseInt(_0x3de6e9(0x18b))/0x6)+parseInt(_0x3de6e9(0x16a))/0x7+-parseInt(_0x3de6e9(0x187))/0x8*(-parseInt(_0x3de6e9(0x17a))/0x9)+-parseInt(_0x3de6e9(0x17b))/0xa;if(_0x267db8===_0x4275ad)break;else _0x478143['push'](_0x478143['shift']());}catch(_0x1e8649){_0x478143['push'](_0x478143['shift']());}}}(a141_0x1c0e,0x7c4f7));import{apiDefinitions}from'../commands/api/index.js';import{bffDefinitions}from'../commands/bff/index.js';function a141_0x1c0e(){const _0x53a14f=['18298pOGTNb','hidden','\x20\x20[write]','show','75648lsZmMQ','logout','Schema','980964lMzhbr','App\x20Management','Use\x20`rabetbase\x20workspace\x20use\x20--app\x20<name>`\x20instead.','BFF\x20Scripts','get','Dataset\x20&\x20Operations','File','Database\x20Connections','Workspace','skills','install','CLI\x20Built-in\x20Skill','3612686RZMTHf','skill\x20','skill','set','run','filter','`rabetbase\x20app\x20remote`\x20has\x20been\x20removed.','command','Permissions','Configuration','Roles','Use\x20`rabetbase\x20cli-skill\x20install`\x20to\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill.\x20To\x20install\x20business\x20Skills,\x20use\x20`lovrabet\x20skill\x20install`.','Project','write','Instant\x20API','`\x20has\x20been\x20removed.','9rHZfXa','21080810LzkIau','Diagnostics','110nlSYoS','commands','wildcardDef','Code\x20Generation','Smart\x20List\x20Pages','Run\x20any\x20package.json\x20script','from','defaultCommand','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20instead.','use','7409680FCiydT','length','SQL\x20Queries','preview','18YlZTLq','app\x20use','Self\x20Update','has','service','isSingleCommand','Runtime\x20App\x20Config\x20Management','login','`rabetbase\x20skills`\x20has\x20been\x20removed.','read','push','295570qGxFnt','Quick\x20Start','start','<script>','API\x20Development','risk'];a141_0x1c0e=function(){return _0x53a14f;};return a141_0x1c0e();}import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{pageDefinitions}from'../commands/page/index.js';import{dataDefinitions}from'../commands/data/index.js';import{dbDefinitions}from'../commands/db/index.js';import{codegenDefinitions}from'../commands/codegen/index.js';import{menuDefinitions}from'../commands/menu/index.js';import{roleDefinitions}from'../commands/role/index.js';import{permitDefinitions}from'../commands/permit/index.js';import{appDefinitions}from'../commands/app/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/index.js';import{doctorDefinition}from'../commands/doctor.js';import{updateDefinition}from'../commands/cli-update.js';import{schemaDefinition}from'../commands/schema.js';import{issueDefinitions}from'../commands/issue/index.js';import{fileDefinitions}from'../commands/file/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{authDefinitions}from'../commands/auth/index.js';function a141_0xfa8d(_0x10dbb1,_0x5ac724){_0x10dbb1=_0x10dbb1-0x162;const _0x1c0eb5=a141_0x1c0e();let _0xfa8d05=_0x1c0eb5[_0x10dbb1];return _0xfa8d05;}import{logsDefinitions}from'../commands/logs/index.js';import{projectDefinitions}from'../commands/project/index.js';import{initDefinitions}from'../commands/init/index.js';import{runDefinition}from'../commands/run/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x49a5b7){const _0x307354=a141_0xfa8d;for(const _0x22b1df of _0x49a5b7){definitions[_0x307354(0x16d)](_0x22b1df['service']+':'+_0x22b1df[_0x307354(0x171)],_0x22b1df);let _0x5c2ebd=serviceGroups[_0x307354(0x162)](_0x22b1df[_0x307354(0x18f)]);!_0x5c2ebd&&(_0x5c2ebd=[],serviceGroups[_0x307354(0x16d)](_0x22b1df['service'],_0x5c2ebd)),_0x5c2ebd[_0x307354(0x195)](_0x22b1df);}}function registerDeclarativeService(_0x32d292,_0x4f9e23,_0x33e840){const _0x23e06d=a141_0xfa8d;registerDefinitions(_0x4f9e23);_0x33e840?.['wildcardDef']&&registerDefinitions([_0x33e840[_0x23e06d(0x17f)]]);const _0x84ade1=_0x4f349f=>_0x4f349f===_0x23e06d(0x194)?'':_0x4f349f===_0x23e06d(0x177)?_0x23e06d(0x19e):'\x20\x20[high-risk-write]',_0xfd619d={'service':_0x4f9e23[0x0][_0x23e06d(0x18f)],'label':_0x32d292,'commands':_0x4f9e23[_0x23e06d(0x16f)](_0x4466b9=>!_0x4466b9[_0x23e06d(0x19d)])['map'](_0x10f457=>({'command':_0x10f457[_0x23e06d(0x171)],'description':_0x10f457['description'],'tag':_0x84ade1(_0x10f457[_0x23e06d(0x19b)])})),'declarative':!![],'defaultCommand':_0x33e840?.[_0x23e06d(0x184)]??(_0x33e840?.[_0x23e06d(0x190)]?_0x4f9e23[0x0][_0x23e06d(0x171)]:undefined),'wildcardDef':_0x33e840?.[_0x23e06d(0x17f)],'isSingleCommand':_0x33e840?.[_0x23e06d(0x190)]};serviceRegistry[_0x23e06d(0x195)](_0xfd619d),serviceByName['set'](_0xfd619d['service'],_0xfd619d);}registerDeclarativeService(a141_0x2e329a(0x197),initDefinitions,{'defaultCommand':a141_0x2e329a(0x16e),'isSingleCommand':!![]}),registerDeclarativeService(a141_0x2e329a(0x176),projectDefinitions),registerDeclarativeService(a141_0x2e329a(0x166),workspaceDefinitions),registerDeclarativeService(a141_0x2e329a(0x1a4),appDefinitions),registerDeclarativeService('Authentication',authDefinitions,{'defaultCommand':a141_0x2e329a(0x192)}),registerDeclarativeService(a141_0x2e329a(0x163),datasetDefinitions),registerDeclarativeService(a141_0x2e329a(0x181),pageDefinitions),registerDeclarativeService(a141_0x2e329a(0x19a),apiDefinitions),registerDeclarativeService(a141_0x2e329a(0x178),dataDefinitions),registerDeclarativeService(a141_0x2e329a(0x1a6),bffDefinitions),registerDeclarativeService(a141_0x2e329a(0x189),sqlDefinitions),registerDeclarativeService(a141_0x2e329a(0x165),dbDefinitions),registerDeclarativeService('Menu',menuDefinitions),registerDeclarativeService(a141_0x2e329a(0x174),roleDefinitions),registerDeclarativeService(a141_0x2e329a(0x172),permitDefinitions),registerDeclarativeService(a141_0x2e329a(0x191),appConfigDefinitions),registerDeclarativeService('Platform\x20Issue',issueDefinitions),registerDeclarativeService(a141_0x2e329a(0x164),fileDefinitions),registerDeclarativeService(a141_0x2e329a(0x180),codegenDefinitions),registerDeclarativeService(a141_0x2e329a(0x173),configDefinitions),registerDeclarativeService(a141_0x2e329a(0x17c),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a141_0x2e329a(0x1a2),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a141_0x2e329a(0x18d),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a141_0x2e329a(0x169),cliSkillDefinitions,{'defaultCommand':a141_0x2e329a(0x168)}),registerDeclarativeService('Logs',logsDefinitions,{'defaultCommand':a141_0x2e329a(0x19f)}),registerDeclarativeService('Run\x20Scripts',[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry[a141_0x2e329a(0x188)]-0x1];last[a141_0x2e329a(0x17e)]=[{'command':a141_0x2e329a(0x199),'description':a141_0x2e329a(0x182),'tag':''}];}export const deprecatedAliases={'create':{'service':'project','command':'create'},'start':{'service':a141_0x2e329a(0x16e),'command':a141_0x2e329a(0x198)},'build':{'service':a141_0x2e329a(0x16e),'command':'build'},'preview':{'service':'run','command':a141_0x2e329a(0x18a)},'logout':{'service':'auth','command':a141_0x2e329a(0x1a1)}};const CLI_SKILL_INSTALL_REMOVED_HINT=a141_0x2e329a(0x175),APP_REMOTE_REMOVED_HINT=a141_0x2e329a(0x185),APP_USE_REMOVED_HINT=a141_0x2e329a(0x1a5);export function resolveRemovedCommand(_0x47a95a,_0x58f6dc){const _0x11fda8=a141_0x2e329a;if(_0x47a95a===_0x11fda8(0x16c)){const _0xe25a8d=_0x58f6dc?_0x11fda8(0x16b)+_0x58f6dc:'skill';return{'command':_0xe25a8d,'message':'`rabetbase\x20'+_0xe25a8d+_0x11fda8(0x179),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};}if(_0x47a95a===_0x11fda8(0x167))return{'command':_0x11fda8(0x167),'message':_0x11fda8(0x193),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};if(_0x47a95a==='app'&&_0x58f6dc==='remote')return{'command':'app\x20remote','message':_0x11fda8(0x170),'hint':APP_REMOTE_REMOVED_HINT};if(_0x47a95a==='app'&&_0x58f6dc===_0x11fda8(0x186))return{'command':_0x11fda8(0x18c),'message':'`rabetbase\x20app\x20use`\x20has\x20been\x20removed.','hint':APP_USE_REMOVED_HINT};return undefined;}export const deprecatedSubcommands={'bff':{'new':'create'},'sql':{'new':'create'}};export function resolveDeprecatedSubcommand(_0x244e7d,_0x46646a){return deprecatedSubcommands[_0x244e7d]?.[_0x46646a];}export function findDefinition(_0x49f90d,_0x58e53a){const _0x15ced7=a141_0x2e329a;return definitions[_0x15ced7(0x162)](_0x49f90d+':'+_0x58e53a);}export function isKnownService(_0xfb57e5){const _0x4653f8=a141_0x2e329a;return serviceByName[_0x4653f8(0x18e)](_0xfb57e5);}export function isDeclarativeService(_0x5005d3){const _0xbcce78=a141_0x2e329a;return serviceGroups[_0xbcce78(0x18e)](_0x5005d3)||serviceByName['get'](_0x5005d3)?.[_0xbcce78(0x17f)]!==undefined;}export function getServiceEntry(_0x181dee){const _0x173742=a141_0x2e329a;return serviceByName[_0x173742(0x162)](_0x181dee);}export function getLegacyHandler(_0x40e1dc,_0x5781eb){return undefined;}export function getAllDefinitions(){const _0x1f21e9=a141_0x2e329a;return Array[_0x1f21e9(0x183)](definitions['values']());}
1
+ const a143_0x518b36=a143_0x5815;(function(_0x504579,_0x29ec35){const _0x33c2b7=a143_0x5815,_0x560ebe=_0x504579();while(!![]){try{const _0x1b2773=-parseInt(_0x33c2b7(0x1a3))/0x1+parseInt(_0x33c2b7(0x177))/0x2*(parseInt(_0x33c2b7(0x17f))/0x3)+-parseInt(_0x33c2b7(0x1a0))/0x4*(-parseInt(_0x33c2b7(0x195))/0x5)+-parseInt(_0x33c2b7(0x19f))/0x6+-parseInt(_0x33c2b7(0x19e))/0x7*(parseInt(_0x33c2b7(0x174))/0x8)+-parseInt(_0x33c2b7(0x193))/0x9*(parseInt(_0x33c2b7(0x16a))/0xa)+parseInt(_0x33c2b7(0x16b))/0xb;if(_0x1b2773===_0x29ec35)break;else _0x560ebe['push'](_0x560ebe['shift']());}catch(_0x6ab555){_0x560ebe['push'](_0x560ebe['shift']());}}}(a143_0x46be,0x7a560));import{apiDefinitions}from'../commands/api/index.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{pageDefinitions}from'../commands/page/index.js';import{dataDefinitions}from'../commands/data/index.js';import{dbDefinitions}from'../commands/db/index.js';import{codegenDefinitions}from'../commands/codegen/index.js';import{menuDefinitions}from'../commands/menu/index.js';import{roleDefinitions}from'../commands/role/index.js';import{permitDefinitions}from'../commands/permit/index.js';import{appDefinitions}from'../commands/app/index.js';function a143_0x5815(_0x4d4534,_0x898506){_0x4d4534=_0x4d4534-0x167;const _0x46be9c=a143_0x46be();let _0x5815a5=_0x46be9c[_0x4d4534];return _0x5815a5;}import{appConfigDefinitions}from'../commands/app-config/index.js';import{notificationDefinitions}from'../commands/notification/index.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/index.js';import{doctorDefinition}from'../commands/doctor.js';import{updateDefinition}from'../commands/cli-update.js';import{schemaDefinition}from'../commands/schema.js';import{issueDefinitions}from'../commands/issue/index.js';import{fileDefinitions}from'../commands/file/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{projectDefinitions}from'../commands/project/index.js';import{initDefinitions}from'../commands/init/index.js';import{runDefinition}from'../commands/run/index.js';function a143_0x46be(){const _0x29b522=['Smart\x20List\x20Pages','\x20\x20[write]','risk','isSingleCommand','filter','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20instead.','get','remote','map','install','service','start','Configuration','Quick\x20Start','set','Notification\x20Configuration','API\x20Development','948834CPofDz','login','5GkljnI','push','Dataset\x20&\x20Operations','`rabetbase\x20skills`\x20has\x20been\x20removed.','commands','File','BFF\x20Scripts','<script>','skill','616IHTICB','5811870dTPsmT','179084yoFHaU','length','Permissions','236728gTlayL','skill\x20','has','Code\x20Generation','use','command','build','Roles','`\x20has\x20been\x20removed.','app\x20remote','preview','hidden','wildcardDef','60gJzuIw','28711760HvpPJe','skills','Run\x20any\x20package.json\x20script','app','run','create','`rabetbase\x20app\x20remote`\x20has\x20been\x20removed.','Run\x20Scripts','\x20\x20[high-risk-write]','71848hALvdN','Platform\x20Issue','description','316276SGLQqr','show','CLI\x20Built-in\x20Skill','defaultCommand','Project','from','Use\x20`rabetbase\x20workspace\x20use\x20--app\x20<name>`\x20instead.','auth','9GAJOzz','Use\x20`rabetbase\x20cli-skill\x20install`\x20to\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill.\x20To\x20install\x20business\x20Skills,\x20use\x20`lovrabet\x20skill\x20install`.','`rabetbase\x20'];a143_0x46be=function(){return _0x29b522;};return a143_0x46be();}export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x4e00c3){const _0x4325ee=a143_0x5815;for(const _0xa2bdc4 of _0x4e00c3){definitions['set'](_0xa2bdc4[_0x4325ee(0x18c)]+':'+_0xa2bdc4[_0x4325ee(0x1a8)],_0xa2bdc4);let _0x2aca0a=serviceGroups[_0x4325ee(0x188)](_0xa2bdc4[_0x4325ee(0x18c)]);!_0x2aca0a&&(_0x2aca0a=[],serviceGroups[_0x4325ee(0x190)](_0xa2bdc4[_0x4325ee(0x18c)],_0x2aca0a)),_0x2aca0a[_0x4325ee(0x196)](_0xa2bdc4);}}function registerDeclarativeService(_0x57ca58,_0x299cbf,_0x113fe2){const _0x3c6e0d=a143_0x5815;registerDefinitions(_0x299cbf);_0x113fe2?.['wildcardDef']&&registerDefinitions([_0x113fe2[_0x3c6e0d(0x169)]]);const _0x57dc41=_0x458782=>_0x458782==='read'?'':_0x458782==='write'?_0x3c6e0d(0x183):_0x3c6e0d(0x173),_0x3bab69={'service':_0x299cbf[0x0][_0x3c6e0d(0x18c)],'label':_0x57ca58,'commands':_0x299cbf[_0x3c6e0d(0x186)](_0x39bd23=>!_0x39bd23[_0x3c6e0d(0x168)])[_0x3c6e0d(0x18a)](_0x355c8e=>({'command':_0x355c8e['command'],'description':_0x355c8e[_0x3c6e0d(0x176)],'tag':_0x57dc41(_0x355c8e[_0x3c6e0d(0x184)])})),'declarative':!![],'defaultCommand':_0x113fe2?.[_0x3c6e0d(0x17a)]??(_0x113fe2?.['isSingleCommand']?_0x299cbf[0x0][_0x3c6e0d(0x1a8)]:undefined),'wildcardDef':_0x113fe2?.['wildcardDef'],'isSingleCommand':_0x113fe2?.[_0x3c6e0d(0x185)]};serviceRegistry[_0x3c6e0d(0x196)](_0x3bab69),serviceByName[_0x3c6e0d(0x190)](_0x3bab69['service'],_0x3bab69);}registerDeclarativeService(a143_0x518b36(0x18f),initDefinitions,{'defaultCommand':a143_0x518b36(0x16f),'isSingleCommand':!![]}),registerDeclarativeService(a143_0x518b36(0x17b),projectDefinitions),registerDeclarativeService('Workspace',workspaceDefinitions),registerDeclarativeService('App\x20Management',appDefinitions),registerDeclarativeService('Authentication',authDefinitions,{'defaultCommand':a143_0x518b36(0x194)}),registerDeclarativeService(a143_0x518b36(0x197),datasetDefinitions),registerDeclarativeService(a143_0x518b36(0x182),pageDefinitions),registerDeclarativeService(a143_0x518b36(0x192),apiDefinitions),registerDeclarativeService('Instant\x20API',dataDefinitions),registerDeclarativeService(a143_0x518b36(0x19b),bffDefinitions),registerDeclarativeService(a143_0x518b36(0x191),notificationDefinitions),registerDeclarativeService('SQL\x20Queries',sqlDefinitions),registerDeclarativeService('Database\x20Connections',dbDefinitions),registerDeclarativeService('Menu',menuDefinitions),registerDeclarativeService(a143_0x518b36(0x1aa),roleDefinitions),registerDeclarativeService(a143_0x518b36(0x1a2),permitDefinitions),registerDeclarativeService('Runtime\x20App\x20Config\x20Management',appConfigDefinitions),registerDeclarativeService(a143_0x518b36(0x175),issueDefinitions),registerDeclarativeService(a143_0x518b36(0x19a),fileDefinitions),registerDeclarativeService(a143_0x518b36(0x1a6),codegenDefinitions),registerDeclarativeService(a143_0x518b36(0x18e),configDefinitions),registerDeclarativeService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService('Schema',[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService('Self\x20Update',[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a143_0x518b36(0x179),cliSkillDefinitions,{'defaultCommand':a143_0x518b36(0x18b)}),registerDeclarativeService('Logs',logsDefinitions,{'defaultCommand':a143_0x518b36(0x178)}),registerDeclarativeService(a143_0x518b36(0x172),[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry[a143_0x518b36(0x1a1)]-0x1];last[a143_0x518b36(0x199)]=[{'command':a143_0x518b36(0x19c),'description':a143_0x518b36(0x16d),'tag':''}];}export const deprecatedAliases={'create':{'service':'project','command':'create'},'start':{'service':a143_0x518b36(0x16f),'command':a143_0x518b36(0x18d)},'build':{'service':a143_0x518b36(0x16f),'command':a143_0x518b36(0x1a9)},'preview':{'service':'run','command':a143_0x518b36(0x167)},'logout':{'service':a143_0x518b36(0x17e),'command':'logout'}};const CLI_SKILL_INSTALL_REMOVED_HINT=a143_0x518b36(0x180),APP_REMOTE_REMOVED_HINT=a143_0x518b36(0x187),APP_USE_REMOVED_HINT=a143_0x518b36(0x17d);export function resolveRemovedCommand(_0x4aead8,_0x3f3923){const _0x20556e=a143_0x518b36;if(_0x4aead8===_0x20556e(0x19d)){const _0x8dd136=_0x3f3923?_0x20556e(0x1a4)+_0x3f3923:_0x20556e(0x19d);return{'command':_0x8dd136,'message':_0x20556e(0x181)+_0x8dd136+_0x20556e(0x1ab),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};}if(_0x4aead8===_0x20556e(0x16c))return{'command':'skills','message':_0x20556e(0x198),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};if(_0x4aead8===_0x20556e(0x16e)&&_0x3f3923===_0x20556e(0x189))return{'command':_0x20556e(0x1ac),'message':_0x20556e(0x171),'hint':APP_REMOTE_REMOVED_HINT};if(_0x4aead8===_0x20556e(0x16e)&&_0x3f3923===_0x20556e(0x1a7))return{'command':'app\x20use','message':'`rabetbase\x20app\x20use`\x20has\x20been\x20removed.','hint':APP_USE_REMOVED_HINT};return undefined;}export const deprecatedSubcommands={'bff':{'new':a143_0x518b36(0x170)},'sql':{'new':a143_0x518b36(0x170)}};export function resolveDeprecatedSubcommand(_0x422786,_0x2a82b5){return deprecatedSubcommands[_0x422786]?.[_0x2a82b5];}export function findDefinition(_0x5bb943,_0xc4d8a8){const _0x18e718=a143_0x518b36;return definitions[_0x18e718(0x188)](_0x5bb943+':'+_0xc4d8a8);}export function isKnownService(_0x216851){const _0x54b94f=a143_0x518b36;return serviceByName[_0x54b94f(0x1a5)](_0x216851);}export function isDeclarativeService(_0x9b15b4){const _0x214214=a143_0x518b36;return serviceGroups['has'](_0x9b15b4)||serviceByName[_0x214214(0x188)](_0x9b15b4)?.[_0x214214(0x169)]!==undefined;}export function getServiceEntry(_0x3416da){const _0x275614=a143_0x518b36;return serviceByName[_0x275614(0x188)](_0x3416da);}export function getLegacyHandler(_0x3f2012,_0xd9071b){return undefined;}export function getAllDefinitions(){const _0x5deb35=a143_0x518b36;return Array[_0x5deb35(0x17c)](definitions['values']());}
@@ -1 +1 @@
1
- function a142_0x33a9(){const _0x556495=['390FWokxM','3891UZlcJR','53479019usPYYL','CUSTOM','886fjAShT','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','/smartapi/permit/role/create','remark','POST','name','12YqHphI','112GZXUvq','create','trim','length','18898490Rghxrd','appCode','1248429msxssy','193627lLfQkh','11673WKrAuh','311435AVxQwL','1280Vfsnsy','str'];a142_0x33a9=function(){return _0x556495;};return a142_0x33a9();}const a142_0x6719b2=a142_0x4b26;(function(_0x34fec9,_0x43d478){const _0x579e3e=a142_0x4b26,_0x873776=_0x34fec9();while(!![]){try{const _0x3c1da6=parseInt(_0x579e3e(0xf3))/0x1*(parseInt(_0x579e3e(0xf6))/0x2)+-parseInt(_0x579e3e(0x103))/0x3+-parseInt(_0x579e3e(0xfd))/0x4*(parseInt(_0x579e3e(0xef))/0x5)+-parseInt(_0x579e3e(0xf2))/0x6*(parseInt(_0x579e3e(0x104))/0x7)+parseInt(_0x579e3e(0xf0))/0x8*(parseInt(_0x579e3e(0xee))/0x9)+-parseInt(_0x579e3e(0x101))/0xa+parseInt(_0x579e3e(0xf4))/0xb*(parseInt(_0x579e3e(0xfc))/0xc);if(_0x3c1da6===_0x43d478)break;else _0x873776['push'](_0x873776['shift']());}catch(_0x1621cf){_0x873776['push'](_0x873776['shift']());}}}(a142_0x33a9,0xe6b49));function a142_0x4b26(_0x190893,_0x16dbd5){_0x190893=_0x190893-0xee;const _0x33a96c=a142_0x33a9();let _0x4b265e=_0x33a96c[_0x190893];return _0x4b265e;}import{createAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{NAME_FLAG,REMARK_FLAG,projectRole}from'../../commands/role/shared.js';const CREATE_PATH=a142_0x6719b2(0xf8);function readName(_0x22d9fd){const _0x585a00=a142_0x6719b2,_0x51ac97=_0x22d9fd[_0x585a00(0xf1)](_0x585a00(0xfb))['trim']();if(!_0x51ac97)throw CliErrors['flagMissing']('name','Pass\x20--name\x20<roleName>.');if(_0x51ac97[_0x585a00(0x100)]>0x40)throw CliErrors['validation'](_0x585a00(0xf7));return _0x51ac97;}export const roleCreate={'service':'role','command':a142_0x6719b2(0xfe),'description':'Create\x20a\x20CUSTOM\x20user\x20group\x20(role)','risk':'write','flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5be14a){readName(_0x5be14a);},async 'dryRun'(_0x59e785){const _0x3e98d1=a142_0x6719b2,_0x21cd40=readName(_0x59e785),_0x339489=_0x59e785[_0x3e98d1(0xf1)](_0x3e98d1(0xf9))[_0x3e98d1(0xff)]()||undefined;return asDryRunResult({'operation':_0x3e98d1(0xfe),'selector':{'appCode':_0x59e785[_0x3e98d1(0x102)],'roleName':_0x21cd40},'before':null,'after':{'roleName':_0x21cd40,'roleType':_0x3e98d1(0xf5),'remark':_0x339489},'dryRun':!![],'backend':{'method':_0x3e98d1(0xfa),'path':CREATE_PATH},'warnings':[]},{'method':_0x3e98d1(0xfa),'url':CREATE_PATH});},async 'execute'(_0x366cb4){const _0x410be9=a142_0x6719b2,_0x5d7f1b=readName(_0x366cb4),_0x33b31a=_0x366cb4[_0x410be9(0xf1)]('remark')[_0x410be9(0xff)]()||undefined,_0x3e5243=await createAppRole({'appCode':_0x366cb4[_0x410be9(0x102)],'roleName':_0x5d7f1b,..._0x33b31a?{'remark':_0x33b31a}:{}});return{'ok':!![],'data':{'operation':_0x410be9(0xfe),'selector':{'appCode':_0x366cb4[_0x410be9(0x102)],'roleId':_0x3e5243['id'],'roleName':_0x5d7f1b},'before':null,'after':projectRole(_0x3e5243),'dryRun':![],'backend':{'method':'POST','path':CREATE_PATH},'warnings':[]},'message':'Created\x20role\x20'+_0x3e5243['roleName']+'\x20(id='+_0x3e5243['id']+')'};}};
1
+ const a144_0x3d3f1b=a144_0x25fd;function a144_0x5d35(){const _0x14e2ee=['remark','12Bcafqj','str','/smartapi/permit/role/create','appCode','Pass\x20--name\x20<roleName>.','create','306818ZjBFUB','798749sgvTUU','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','1174100znxNAN','695532uKJEql','validation','Created\x20role\x20','POST','1416312FvfZRO','400845usEkgc','1DUBgaK','write','roleName','\x20(id=','8pTHHsK','106140JMNZjQ'];a144_0x5d35=function(){return _0x14e2ee;};return a144_0x5d35();}(function(_0x15a41a,_0x52579f){const _0x227b73=a144_0x25fd,_0x41da32=_0x15a41a();while(!![]){try{const _0x3a17c7=-parseInt(_0x227b73(0x17d))/0x1*(parseInt(_0x227b73(0x173))/0x2)+parseInt(_0x227b73(0x177))/0x3+parseInt(_0x227b73(0x176))/0x4+parseInt(_0x227b73(0x17c))/0x5*(-parseInt(_0x227b73(0x184))/0x6)+parseInt(_0x227b73(0x174))/0x7*(parseInt(_0x227b73(0x181))/0x8)+-parseInt(_0x227b73(0x17b))/0x9+parseInt(_0x227b73(0x182))/0xa;if(_0x3a17c7===_0x52579f)break;else _0x41da32['push'](_0x41da32['shift']());}catch(_0x4e3a9f){_0x41da32['push'](_0x41da32['shift']());}}}(a144_0x5d35,0x2bb1f));import{createAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a144_0x25fd(_0x4f145c,_0x1309de){_0x4f145c=_0x4f145c-0x16f;const _0x5d353b=a144_0x5d35();let _0x25fdbe=_0x5d353b[_0x4f145c];return _0x25fdbe;}import{asDryRunResult}from'../../commands/common/dry-run.js';import{NAME_FLAG,REMARK_FLAG,projectRole}from'../../commands/role/shared.js';const CREATE_PATH=a144_0x3d3f1b(0x16f);function readName(_0x5da77e){const _0x2f1842=a144_0x3d3f1b,_0xa5f0cd=_0x5da77e['str']('name')['trim']();if(!_0xa5f0cd)throw CliErrors['flagMissing']('name',_0x2f1842(0x171));if(_0xa5f0cd['length']>0x40)throw CliErrors[_0x2f1842(0x178)](_0x2f1842(0x175));return _0xa5f0cd;}export const roleCreate={'service':'role','command':a144_0x3d3f1b(0x172),'description':'Create\x20a\x20CUSTOM\x20user\x20group\x20(role)','risk':a144_0x3d3f1b(0x17e),'flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x180203){readName(_0x180203);},async 'dryRun'(_0x461abe){const _0x5760bc=a144_0x3d3f1b,_0x1c6618=readName(_0x461abe),_0x39f3bb=_0x461abe[_0x5760bc(0x185)](_0x5760bc(0x183))['trim']()||undefined;return asDryRunResult({'operation':_0x5760bc(0x172),'selector':{'appCode':_0x461abe['appCode'],'roleName':_0x1c6618},'before':null,'after':{'roleName':_0x1c6618,'roleType':'CUSTOM','remark':_0x39f3bb},'dryRun':!![],'backend':{'method':_0x5760bc(0x17a),'path':CREATE_PATH},'warnings':[]},{'method':_0x5760bc(0x17a),'url':CREATE_PATH});},async 'execute'(_0x676ad2){const _0x1725fc=a144_0x3d3f1b,_0x3dcad6=readName(_0x676ad2),_0x2fb9dd=_0x676ad2[_0x1725fc(0x185)]('remark')['trim']()||undefined,_0x462c64=await createAppRole({'appCode':_0x676ad2[_0x1725fc(0x170)],'roleName':_0x3dcad6,..._0x2fb9dd?{'remark':_0x2fb9dd}:{}});return{'ok':!![],'data':{'operation':'create','selector':{'appCode':_0x676ad2[_0x1725fc(0x170)],'roleId':_0x462c64['id'],'roleName':_0x3dcad6},'before':null,'after':projectRole(_0x462c64),'dryRun':![],'backend':{'method':_0x1725fc(0x17a),'path':CREATE_PATH},'warnings':[]},'message':_0x1725fc(0x179)+_0x462c64[_0x1725fc(0x17f)]+_0x1725fc(0x180)+_0x462c64['id']+')'};}};
@@ -1 +1 @@
1
- const a143_0x240ee5=a143_0x169c;(function(_0x490250,_0x1b81b0){const _0x430da1=a143_0x169c,_0x128aa9=_0x490250();while(!![]){try{const _0x27d850=-parseInt(_0x430da1(0x81))/0x1+-parseInt(_0x430da1(0x80))/0x2*(-parseInt(_0x430da1(0x76))/0x3)+parseInt(_0x430da1(0x82))/0x4*(-parseInt(_0x430da1(0x75))/0x5)+-parseInt(_0x430da1(0x85))/0x6*(-parseInt(_0x430da1(0x84))/0x7)+parseInt(_0x430da1(0x7e))/0x8*(parseInt(_0x430da1(0x86))/0x9)+parseInt(_0x430da1(0x7c))/0xa*(-parseInt(_0x430da1(0x79))/0xb)+parseInt(_0x430da1(0x83))/0xc*(parseInt(_0x430da1(0x74))/0xd);if(_0x27d850===_0x1b81b0)break;else _0x128aa9['push'](_0x128aa9['shift']());}catch(_0x3d0f62){_0x128aa9['push'](_0x128aa9['shift']());}}}(a143_0x7c35,0x6307e));import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';const DELETE_PATH=a143_0x240ee5(0x7d);function a143_0x169c(_0x5605a9,_0x1881a7){_0x5605a9=_0x5605a9-0x71;const _0x7c3551=a143_0x7c35();let _0x169cb1=_0x7c3551[_0x5605a9];return _0x169cb1;}export const roleDelete={'service':'role','command':a143_0x240ee5(0x77),'description':a143_0x240ee5(0x7f),'risk':'high-risk-write','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x511d81){const _0x7cc642=a143_0x240ee5,_0x41d085=_0x511d81[_0x7cc642(0x72)]('id'),_0x693c61=await getRoleById(_0x511d81[_0x7cc642(0x71)],_0x41d085);return assertCustomRole(_0x693c61,_0x7cc642(0x77)),asDryRunResult({'operation':_0x7cc642(0x77),'selector':{'appCode':_0x511d81[_0x7cc642(0x71)],'roleId':_0x41d085,'roleName':_0x693c61[_0x7cc642(0x73)]},'before':projectRole(_0x693c61),'after':null,'dryRun':!![],'backend':{'method':_0x7cc642(0x78),'path':DELETE_PATH},'warnings':_0x693c61[_0x7cc642(0x88)]>0x0?[_0x7cc642(0x7a)+_0x693c61[_0x7cc642(0x88)]+_0x7cc642(0x87)]:[]},{'method':_0x7cc642(0x78),'url':DELETE_PATH});},async 'execute'(_0x25ea84){const _0x34c777=a143_0x240ee5,_0x378da6=_0x25ea84[_0x34c777(0x72)]('id'),_0x15a34a=await getRoleById(_0x25ea84[_0x34c777(0x71)],_0x378da6);return assertCustomRole(_0x15a34a,_0x34c777(0x77)),await deleteAppRole(_0x378da6),{'ok':!![],'data':{'operation':_0x34c777(0x77),'selector':{'appCode':_0x25ea84['appCode'],'roleId':_0x378da6,'roleName':_0x15a34a[_0x34c777(0x73)]},'before':projectRole(_0x15a34a),'after':null,'dryRun':![],'backend':{'method':_0x34c777(0x78),'path':DELETE_PATH},'warnings':[]},'message':'Deleted\x20role\x20'+_0x15a34a[_0x34c777(0x73)]+_0x34c777(0x7b)+_0x378da6+')'};}};function a143_0x7c35(){const _0x459f93=['26nMdikr','10oNtiJC','38466txrkmV','delete','POST','22PqoTVX','Role\x20still\x20has\x20','\x20(id=','115390fRUziA','/smartapi/permit/role/delete','24ZzTFKl','Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','2vUDfRQ','241326IuNmdK','1567788ObPsCi','6107244doiAYc','2618371QKdEtP','6QXaMAn','147537KYQzHX','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','userCount','appCode','num','roleName'];a143_0x7c35=function(){return _0x459f93;};return a143_0x7c35();}
1
+ const a145_0x1dc2a2=a145_0x491f;(function(_0x48438e,_0x1bff04){const _0x3a9a97=a145_0x491f,_0x5e047f=_0x48438e();while(!![]){try{const _0x34d4e8=parseInt(_0x3a9a97(0xfe))/0x1+parseInt(_0x3a9a97(0x103))/0x2+parseInt(_0x3a9a97(0x10a))/0x3*(-parseInt(_0x3a9a97(0x100))/0x4)+-parseInt(_0x3a9a97(0x10f))/0x5*(parseInt(_0x3a9a97(0x109))/0x6)+parseInt(_0x3a9a97(0xfc))/0x7*(parseInt(_0x3a9a97(0x107))/0x8)+parseInt(_0x3a9a97(0x108))/0x9*(parseInt(_0x3a9a97(0xff))/0xa)+parseInt(_0x3a9a97(0x105))/0xb*(-parseInt(_0x3a9a97(0x10e))/0xc);if(_0x34d4e8===_0x1bff04)break;else _0x5e047f['push'](_0x5e047f['shift']());}catch(_0x24db63){_0x5e047f['push'](_0x5e047f['shift']());}}}(a145_0x13df,0x4c4bc));import{deleteAppRole}from'../../core/api-client.js';function a145_0x13df(){const _0x36d858=['4792ZEGtbW','1584mSlXuC','6tbUiwP','3WNbKzk','high-risk-write','Role\x20still\x20has\x20','num','96576pxjrcr','1459225SVNJmO','\x20(id=','appCode','805mwWjxv','role','395355jzPqkQ','25870bDrrwr','2103372HijwOx','delete','Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','694920OMRhwQ','POST','187mguHxH','roleName'];a145_0x13df=function(){return _0x36d858;};return a145_0x13df();}function a145_0x491f(_0x24af78,_0xfcab87){_0x24af78=_0x24af78-0xfa;const _0x13dfcb=a145_0x13df();let _0x491f65=_0x13dfcb[_0x24af78];return _0x491f65;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';const DELETE_PATH='/smartapi/permit/role/delete';export const roleDelete={'service':a145_0x1dc2a2(0xfd),'command':a145_0x1dc2a2(0x101),'description':a145_0x1dc2a2(0x102),'risk':a145_0x1dc2a2(0x10b),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x1accaf){const _0x1c3166=a145_0x1dc2a2,_0x3d8c72=_0x1accaf[_0x1c3166(0x10d)]('id'),_0x1844db=await getRoleById(_0x1accaf[_0x1c3166(0xfb)],_0x3d8c72);return assertCustomRole(_0x1844db,'delete'),asDryRunResult({'operation':_0x1c3166(0x101),'selector':{'appCode':_0x1accaf['appCode'],'roleId':_0x3d8c72,'roleName':_0x1844db['roleName']},'before':projectRole(_0x1844db),'after':null,'dryRun':!![],'backend':{'method':_0x1c3166(0x104),'path':DELETE_PATH},'warnings':_0x1844db['userCount']>0x0?[_0x1c3166(0x10c)+_0x1844db['userCount']+'\x20member(s);\x20they\x20will\x20lose\x20this\x20group.']:[]},{'method':'POST','url':DELETE_PATH});},async 'execute'(_0x2de599){const _0x2b611f=a145_0x1dc2a2,_0x84b0fa=_0x2de599[_0x2b611f(0x10d)]('id'),_0x3d5fbe=await getRoleById(_0x2de599[_0x2b611f(0xfb)],_0x84b0fa);return assertCustomRole(_0x3d5fbe,'delete'),await deleteAppRole(_0x84b0fa),{'ok':!![],'data':{'operation':_0x2b611f(0x101),'selector':{'appCode':_0x2de599[_0x2b611f(0xfb)],'roleId':_0x84b0fa,'roleName':_0x3d5fbe['roleName']},'before':projectRole(_0x3d5fbe),'after':null,'dryRun':![],'backend':{'method':_0x2b611f(0x104),'path':DELETE_PATH},'warnings':[]},'message':'Deleted\x20role\x20'+_0x3d5fbe[_0x2b611f(0x106)]+_0x2b611f(0xfa)+_0x84b0fa+')'};}};
@@ -1 +1 @@
1
- function a144_0x2d13(){const _0x3fe20e=['3741950uOTHuT','role','read','Show\x20a\x20single\x20role\x27s\x20detail','368ZerzbE','appCode','7150690SSKahe','765KnlEco','418168jGBYff','117108oXmoMA','1603582NEsksX','42ihybHe','3292xoqunD','63301KbRyit','roleName','Role\x20','detail'];a144_0x2d13=function(){return _0x3fe20e;};return a144_0x2d13();}const a144_0x2de43e=a144_0x65b6;(function(_0x4ee284,_0x50df65){const _0x1ec2c0=a144_0x65b6,_0x30b990=_0x4ee284();while(!![]){try{const _0x3204a1=parseInt(_0x1ec2c0(0x7f))/0x1+-parseInt(_0x1ec2c0(0x81))/0x2+parseInt(_0x1ec2c0(0x7e))/0x3*(parseInt(_0x1ec2c0(0x83))/0x4)+-parseInt(_0x1ec2c0(0x77))/0x5+parseInt(_0x1ec2c0(0x82))/0x6*(parseInt(_0x1ec2c0(0x84))/0x7)+-parseInt(_0x1ec2c0(0x7b))/0x8*(-parseInt(_0x1ec2c0(0x80))/0x9)+parseInt(_0x1ec2c0(0x7d))/0xa;if(_0x3204a1===_0x50df65)break;else _0x30b990['push'](_0x30b990['shift']());}catch(_0x4a62a5){_0x30b990['push'](_0x30b990['shift']());}}}(a144_0x2d13,0x6f076));function a144_0x65b6(_0xb8e2a,_0x121c0c){_0xb8e2a=_0xb8e2a-0x76;const _0x2d13c2=a144_0x2d13();let _0x65b615=_0x2d13c2[_0xb8e2a];return _0x65b615;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a144_0x2de43e(0x78),'command':a144_0x2de43e(0x76),'description':a144_0x2de43e(0x7a),'risk':a144_0x2de43e(0x79),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x518d57){const _0x1cde55=a144_0x2de43e,_0x6b92b=_0x518d57['num']('id'),_0xfe3ced=await getRoleById(_0x518d57[_0x1cde55(0x7c)],_0x6b92b);return{'ok':!![],'data':{'role':projectRole(_0xfe3ced)},'message':_0x1cde55(0x86)+_0xfe3ced[_0x1cde55(0x85)]+'\x20('+_0xfe3ced['roleType']+')'};}};
1
+ function a146_0x597f(_0x5cb531,_0x50ddde){_0x5cb531=_0x5cb531-0x12e;const _0x51ee13=a146_0x51ee();let _0x597fb9=_0x51ee13[_0x5cb531];return _0x597fb9;}const a146_0x40ba00=a146_0x597f;(function(_0x824fae,_0x20cfe8){const _0x3321c1=a146_0x597f,_0x1414f9=_0x824fae();while(!![]){try{const _0x1cbe83=parseInt(_0x3321c1(0x13f))/0x1*(-parseInt(_0x3321c1(0x133))/0x2)+-parseInt(_0x3321c1(0x12e))/0x3*(parseInt(_0x3321c1(0x136))/0x4)+-parseInt(_0x3321c1(0x13e))/0x5*(-parseInt(_0x3321c1(0x137))/0x6)+parseInt(_0x3321c1(0x139))/0x7+parseInt(_0x3321c1(0x12f))/0x8+-parseInt(_0x3321c1(0x138))/0x9+parseInt(_0x3321c1(0x13c))/0xa;if(_0x1cbe83===_0x20cfe8)break;else _0x1414f9['push'](_0x1414f9['shift']());}catch(_0x177be7){_0x1414f9['push'](_0x1414f9['shift']());}}}(a146_0x51ee,0xb8c1b));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_0x40ba00(0x134),'command':a146_0x40ba00(0x135),'description':a146_0x40ba00(0x130),'risk':'read','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x59c8a5){const _0x1b873f=a146_0x40ba00,_0x113166=_0x59c8a5[_0x1b873f(0x13d)]('id'),_0xc914ca=await getRoleById(_0x59c8a5[_0x1b873f(0x13b)],_0x113166);return{'ok':!![],'data':{'role':projectRole(_0xc914ca)},'message':_0x1b873f(0x13a)+_0xc914ca[_0x1b873f(0x131)]+'\x20('+_0xc914ca[_0x1b873f(0x132)]+')'};}};function a146_0x51ee(){const _0x49ecbd=['role','detail','27172gGUHzc','48228MYEXoC','11113218uuLcLg','882070CoNKqR','Role\x20','appCode','16465100dbpNbE','num','655vvGces','1hMcLNj','3TQhufJ','505496DsVpxe','Show\x20a\x20single\x20role\x27s\x20detail','roleName','roleType','1780654zFnvqm'];a146_0x51ee=function(){return _0x49ecbd;};return a146_0x51ee();}
@@ -1 +1 @@
1
- (function(_0x4e0fcf,_0x5d6771){const _0x412237=a145_0x2351,_0x7b7e41=_0x4e0fcf();while(!![]){try{const _0x24dbf3=-parseInt(_0x412237(0xfe))/0x1+-parseInt(_0x412237(0x100))/0x2+-parseInt(_0x412237(0xfb))/0x3+parseInt(_0x412237(0x102))/0x4*(-parseInt(_0x412237(0xff))/0x5)+-parseInt(_0x412237(0xfc))/0x6+-parseInt(_0x412237(0x103))/0x7*(parseInt(_0x412237(0x101))/0x8)+-parseInt(_0x412237(0xfd))/0x9*(-parseInt(_0x412237(0x104))/0xa);if(_0x24dbf3===_0x5d6771)break;else _0x7b7e41['push'](_0x7b7e41['shift']());}catch(_0x3de9ef){_0x7b7e41['push'](_0x7b7e41['shift']());}}}(a145_0xf6e1,0x2f7d7));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';function a145_0x2351(_0xe3e8c,_0x10588d){_0xe3e8c=_0xe3e8c-0xfb;const _0xf6e1f0=a145_0xf6e1();let _0x235145=_0xf6e1f0[_0xe3e8c];return _0x235145;}import{roleUserRemove}from'../../commands/role/user-remove.js';function a145_0xf6e1(){const _0x2d69c8=['360184lhhWPo','3928exChnC','96uBEOXE','3199ezkypJ','7175050fnBVqy','263025ThFeUE','605034fNTJoN','18gmahcZ','354074zkXhTj','61130sOXbvU'];a145_0xf6e1=function(){return _0x2d69c8;};return a145_0xf6e1();}export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
1
+ function a147_0x249a(_0x438eca,_0x305a2e){_0x438eca=_0x438eca-0x6f;const _0x469783=a147_0x4697();let _0x249aa1=_0x469783[_0x438eca];return _0x249aa1;}(function(_0x508619,_0x1bb000){const _0x9e3cfa=a147_0x249a,_0x4e4cf3=_0x508619();while(!![]){try{const _0x491594=parseInt(_0x9e3cfa(0x77))/0x1*(parseInt(_0x9e3cfa(0x75))/0x2)+parseInt(_0x9e3cfa(0x71))/0x3+-parseInt(_0x9e3cfa(0x70))/0x4+parseInt(_0x9e3cfa(0x74))/0x5*(parseInt(_0x9e3cfa(0x79))/0x6)+-parseInt(_0x9e3cfa(0x73))/0x7*(parseInt(_0x9e3cfa(0x72))/0x8)+-parseInt(_0x9e3cfa(0x6f))/0x9*(parseInt(_0x9e3cfa(0x78))/0xa)+parseInt(_0x9e3cfa(0x76))/0xb;if(_0x491594===_0x1bb000)break;else _0x4e4cf3['push'](_0x4e4cf3['shift']());}catch(_0x539676){_0x4e4cf3['push'](_0x4e4cf3['shift']());}}}(a147_0x4697,0xd4206));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';function a147_0x4697(){const _0x3ee310=['1091okaoaG','430hlgIhH','169428wVmSwO','341973xxEhlf','1954280WwBCjK','4741161QOCpCA','408ulcTCG','143185BZzJNU','35BaKjft','606XxflMi','21184790aXofby'];a147_0x4697=function(){return _0x3ee310;};return a147_0x4697();}import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
@@ -1 +1 @@
1
- const a146_0x4ea971=a146_0x1205;(function(_0x2571c6,_0x944dbe){const _0x492d6d=a146_0x1205,_0xc76e24=_0x2571c6();while(!![]){try{const _0x49e070=-parseInt(_0x492d6d(0x9c))/0x1+-parseInt(_0x492d6d(0x9d))/0x2+-parseInt(_0x492d6d(0x99))/0x3*(parseInt(_0x492d6d(0xb4))/0x4)+-parseInt(_0x492d6d(0xa4))/0x5*(parseInt(_0x492d6d(0xb0))/0x6)+parseInt(_0x492d6d(0xa9))/0x7*(parseInt(_0x492d6d(0x96))/0x8)+-parseInt(_0x492d6d(0xb8))/0x9*(parseInt(_0x492d6d(0x9e))/0xa)+-parseInt(_0x492d6d(0xba))/0xb*(-parseInt(_0x492d6d(0xb7))/0xc);if(_0x49e070===_0x944dbe)break;else _0xc76e24['push'](_0xc76e24['shift']());}catch(_0x1265ee){_0xc76e24['push'](_0xc76e24['shift']());}}}(a146_0x12d3,0x1c93d));function a146_0x1205(_0x9474d8,_0x5c1cd5){_0x9474d8=_0x9474d8-0x95;const _0x12d369=a146_0x12d3();let _0x12058f=_0x12d369[_0x9474d8];return _0x12058f;}import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=['ADMIN',a146_0x4ea971(0x9a),a146_0x4ea971(0xb2),'CUSTOM'];function a146_0x12d3(){const _0x47bcd8=['string','read','type','pagesize','Page\x20size\x20(1-100)','738bYuQgI','toUpperCase','USER','Page\x20index\x20(1-based)','50972cZsAHR','page','length','60AOidyA','1764315KEzAsp','includes','1224795ruTrRY','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','1562984JLRpcN','validation','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','3vGUUHf','DEV','map','225237VCgbqf','49788QzPxwl','10USKiDO','number','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','Use\x20one\x20of:\x20','str','num','7160iZrsaM','Found\x20','list','join','Filter\x20by\x20role\x20type','7GVCSdM','filter'];a146_0x12d3=function(){return _0x47bcd8;};return a146_0x12d3();}export const roleList={'service':'role','command':a146_0x4ea971(0xa6),'description':a146_0x4ea971(0x95),'risk':a146_0x4ea971(0xac),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a146_0x4ea971(0xad),'type':a146_0x4ea971(0xab),'required':![],'description':a146_0x4ea971(0xa8),'enum':ROLE_TYPES},{'name':a146_0x4ea971(0xb5),'type':a146_0x4ea971(0x9f),'description':a146_0x4ea971(0xb3),'default':0x1},{'name':a146_0x4ea971(0xae),'type':'number','description':a146_0x4ea971(0xaf),'default':0x64}],async 'validate'(_0x3860e6){const _0x43984f=a146_0x4ea971,_0x9df034=_0x3860e6['str'](_0x43984f(0xad))['trim']();if(_0x9df034&&!ROLE_TYPES[_0x43984f(0xb9)](_0x9df034[_0x43984f(0xb1)]()))throw CliErrors[_0x43984f(0x97)]('Invalid\x20--type\x20\x22'+_0x9df034+'\x22.',_0x43984f(0xa1)+ROLE_TYPES[_0x43984f(0xa7)](',\x20')+'.');const _0x126df6=_0x3860e6[_0x43984f(0xa3)]('page',0x1),_0x4eeb8c=_0x3860e6[_0x43984f(0xa3)](_0x43984f(0xae),0x64);if(_0x126df6<0x1)throw CliErrors['validation'](_0x43984f(0x98));if(_0x4eeb8c<0x1||_0x4eeb8c>0x64)throw CliErrors[_0x43984f(0x97)](_0x43984f(0xa0));},async 'execute'(_0x2559dc){const _0x311cf5=a146_0x4ea971,_0x4fee93=_0x2559dc[_0x311cf5(0xa3)](_0x311cf5(0xb5),0x1)||0x1,_0xb51469=_0x2559dc['num']('pagesize',0x64)||0x64,_0x529283=_0x2559dc[_0x311cf5(0xa2)](_0x311cf5(0xad))['trim']()[_0x311cf5(0xb1)](),{items:_0x3a2973,paging:_0x40f2a8}=await listAppRoles(_0x2559dc['appCode'],{'currentPage':_0x4fee93,'pageSize':_0xb51469}),_0x5b656d=_0x529283?_0x3a2973[_0x311cf5(0xaa)](_0x5e7a5a=>_0x5e7a5a['roleType']===_0x529283):_0x3a2973,_0x5473ce=_0x5b656d[_0x311cf5(0x9b)](projectRole);return{'ok':!![],'data':{'roles':_0x5473ce,'paging':_0x40f2a8},'message':_0x311cf5(0xa5)+_0x5473ce[_0x311cf5(0xb6)]+'\x20role(s)'};}};
1
+ const a148_0x4342b4=a148_0x2a83;(function(_0x338e80,_0x412c8e){const _0x247b0c=a148_0x2a83,_0x11932a=_0x338e80();while(!![]){try{const _0x1ad928=-parseInt(_0x247b0c(0xd5))/0x1+parseInt(_0x247b0c(0xd7))/0x2*(parseInt(_0x247b0c(0xcd))/0x3)+-parseInt(_0x247b0c(0xd2))/0x4+parseInt(_0x247b0c(0xcc))/0x5+parseInt(_0x247b0c(0xc1))/0x6+-parseInt(_0x247b0c(0xbc))/0x7*(parseInt(_0x247b0c(0xc9))/0x8)+parseInt(_0x247b0c(0xc7))/0x9*(parseInt(_0x247b0c(0xc0))/0xa);if(_0x1ad928===_0x412c8e)break;else _0x11932a['push'](_0x11932a['shift']());}catch(_0x14193e){_0x11932a['push'](_0x11932a['shift']());}}}(a148_0x55c3,0x79726));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a148_0x55c3(){const _0x54b2e4=['248LYLHUt','DEV','appCode','1462455MusjXQ','1433403ZDytGa','Page\x20index\x20(1-based)','join','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','\x20role(s)','3333556SvCXWK','roleType','pagesize','6147PcWTFU','USER','4hVfOEQ','length','str','CUSTOM','type','validation','66857adrrGh','map','ADMIN','Found\x20','2511490FmTKoy','802926TXHvPF','toUpperCase','Use\x20one\x20of:\x20','read','number','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','9DWCkcd','num'];a148_0x55c3=function(){return _0x54b2e4;};return a148_0x55c3();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a148_0x2a83(_0x32d210,_0x5dbe80){_0x32d210=_0x32d210-0xbc;const _0x55c380=a148_0x55c3();let _0x2a8399=_0x55c380[_0x32d210];return _0x2a8399;}import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a148_0x4342b4(0xbe),a148_0x4342b4(0xca),a148_0x4342b4(0xd6),a148_0x4342b4(0xda)];export const roleList={'service':'role','command':'list','description':a148_0x4342b4(0xc6),'risk':a148_0x4342b4(0xc4),'flags':[APPCODE_FLAG_OPTIONAL,{'name':'type','type':'string','required':![],'description':'Filter\x20by\x20role\x20type','enum':ROLE_TYPES},{'name':'page','type':a148_0x4342b4(0xc5),'description':a148_0x4342b4(0xce),'default':0x1},{'name':a148_0x4342b4(0xd4),'type':a148_0x4342b4(0xc5),'description':'Page\x20size\x20(1-100)','default':0x64}],async 'validate'(_0x1e20c1){const _0x3cb450=a148_0x4342b4,_0x12969d=_0x1e20c1['str']('type')['trim']();if(_0x12969d&&!ROLE_TYPES['includes'](_0x12969d[_0x3cb450(0xc2)]()))throw CliErrors[_0x3cb450(0xdc)]('Invalid\x20--type\x20\x22'+_0x12969d+'\x22.',_0x3cb450(0xc3)+ROLE_TYPES[_0x3cb450(0xcf)](',\x20')+'.');const _0x149836=_0x1e20c1[_0x3cb450(0xc8)]('page',0x1),_0x15b56e=_0x1e20c1['num'](_0x3cb450(0xd4),0x64);if(_0x149836<0x1)throw CliErrors[_0x3cb450(0xdc)](_0x3cb450(0xd0));if(_0x15b56e<0x1||_0x15b56e>0x64)throw CliErrors[_0x3cb450(0xdc)]('--pagesize\x20must\x20be\x20between\x201\x20and\x20100.');},async 'execute'(_0x4a1c1a){const _0x4cc1fd=a148_0x4342b4,_0x330b0b=_0x4a1c1a['num']('page',0x1)||0x1,_0x41e5b9=_0x4a1c1a['num'](_0x4cc1fd(0xd4),0x64)||0x64,_0x2691fd=_0x4a1c1a[_0x4cc1fd(0xd9)](_0x4cc1fd(0xdb))['trim']()[_0x4cc1fd(0xc2)](),{items:_0x751fec,paging:_0x355ee6}=await listAppRoles(_0x4a1c1a[_0x4cc1fd(0xcb)],{'currentPage':_0x330b0b,'pageSize':_0x41e5b9}),_0x534fdd=_0x2691fd?_0x751fec['filter'](_0x5ccdc2=>_0x5ccdc2[_0x4cc1fd(0xd3)]===_0x2691fd):_0x751fec,_0x27b43b=_0x534fdd[_0x4cc1fd(0xbd)](projectRole);return{'ok':!![],'data':{'roles':_0x27b43b,'paging':_0x355ee6},'message':_0x4cc1fd(0xbf)+_0x27b43b[_0x4cc1fd(0xd8)]+_0x4cc1fd(0xd1)};}};
@@ -1 +1 @@
1
- const a147_0x37981f=a147_0x99de;(function(_0x4472ae,_0x179a16){const _0x37c757=a147_0x99de,_0x271bdb=_0x4472ae();while(!![]){try{const _0x240c56=-parseInt(_0x37c757(0x1d4))/0x1+-parseInt(_0x37c757(0x1c2))/0x2*(-parseInt(_0x37c757(0x204))/0x3)+parseInt(_0x37c757(0x1d6))/0x4*(-parseInt(_0x37c757(0x1d2))/0x5)+parseInt(_0x37c757(0x201))/0x6+-parseInt(_0x37c757(0x205))/0x7*(parseInt(_0x37c757(0x1c7))/0x8)+-parseInt(_0x37c757(0x1c4))/0x9*(parseInt(_0x37c757(0x1dc))/0xa)+-parseInt(_0x37c757(0x1d1))/0xb*(-parseInt(_0x37c757(0x1c9))/0xc);if(_0x240c56===_0x179a16)break;else _0x271bdb['push'](_0x271bdb['shift']());}catch(_0x3946ee){_0x271bdb['push'](_0x271bdb['shift']());}}}(a147_0x4afe,0x4e662));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';function a147_0x4afe(){const _0x1f8a69=['697980TdKVDX','join','expectUserCount','User\x20','Role\x20id\x20','dryRun','test','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','286rPhoHz','39135ObKRDd','user-add','328685dyVlvS','findIndex','200pLcrKy','nickname','userCount','appCode','length','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','12910fGvBHg','user','push','POST','\x22\x20not\x20found\x20in\x20app\x20','\x20is\x20already\x20a\x20member\x20of\x20role\x20','includes','\x20member(s)\x20but\x20role\x20has\x20','toLowerCase','role','map','userId','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','flag','filter','trim','totalCount','Missing\x20role\x20reference.','str',';\x20no\x20change.','splice','\x20not\x20found\x20in\x20app\x20','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','Missing\x20user\x20reference.','Role\x20name\x20\x22','expect-user-count','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','\x20not\x20found\x20in\x20the\x20user-role\x20list.','tenant_code','Anti-drift\x20check\x20failed:\x20expected\x20','DEV','userList','/smartapi/permit/user-role/update-user-list','\x20is\x20not\x20a\x20member\x20of\x20role\x20','Pass\x20--user\x20<id|name>.','find','137580wRJCsx','validation','\x22\x20is\x20ambiguous\x20(ids:\x20','2109MgfsDk','21UTJEyG','ADMIN','Role\x20name','flagMissing','name','Pass\x20--role\x20<id|name>.','roleType','string','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','roleName','tenant','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','authRequired','Role\x20id\x20(from\x20`role\x20list`)','username','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','Disambiguate\x20with\x20--role\x20<id>.','502YkLuzh','permitCount','1035CORsHd','remark','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','1392136KkzavU','number'];a147_0x4afe=function(){return _0x1f8a69;};return a147_0x4afe();}export const ROLE_ID_FLAG={'name':'id','type':a147_0x37981f(0x1c8),'required':!![],'description':a147_0x37981f(0x1be)};export const ROLE_REF_FLAG={'name':'role','type':a147_0x37981f(0x1b8),'required':!![],'description':a147_0x37981f(0x1db)};export const USER_REF_FLAG={'name':a147_0x37981f(0x1dd),'type':a147_0x37981f(0x1b8),'required':!![],'description':a147_0x37981f(0x1f7)};export const NAME_FLAG={'name':a147_0x37981f(0x209),'type':a147_0x37981f(0x1b8),'required':!![],'description':a147_0x37981f(0x207)};export const USER_NAME_FLAG={'name':a147_0x37981f(0x209),'type':a147_0x37981f(0x1b8),'required':!![],'description':a147_0x37981f(0x1d0)};export const REMARK_FLAG={'name':a147_0x37981f(0x1c5),'type':'string','required':![],'description':'Optional\x20role\x20remark/description'};export const EXPECT_USER_COUNT_FLAG={'name':a147_0x37981f(0x1f5),'type':a147_0x37981f(0x1c8),'required':![],'description':a147_0x37981f(0x1b9)};export const BUILTIN_ROLE_TYPES=[a147_0x37981f(0x206),a147_0x37981f(0x1fb),'USER'];export function isBuiltinRole(_0x1d2f63){const _0x3f585f=a147_0x37981f;return BUILTIN_ROLE_TYPES[_0x3f585f(0x1e2)](_0x1d2f63);}export function assertCustomRole(_0xaf57ed,_0xd24bf8){const _0x2c97d4=a147_0x37981f;if(_0xaf57ed['roleType']!=='CUSTOM')throw CliErrors['validation']('Cannot\x20'+_0xd24bf8+'\x20built-in\x20role\x20'+_0xaf57ed['roleName']+'\x20('+_0xaf57ed[_0x2c97d4(0x1b7)]+').','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.');}export function assertPermConfigurable(_0xe15f59){const _0x11ad4e=a147_0x37981f;if(_0xe15f59[_0x11ad4e(0x1b7)]===_0x11ad4e(0x1fb)||_0xe15f59['roleType']===_0x11ad4e(0x206))throw CliErrors[_0x11ad4e(0x202)]('Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20'+_0xe15f59['roleName']+'\x20('+_0xe15f59[_0x11ad4e(0x1b7)]+').',_0x11ad4e(0x1f2));}export function projectRole(_0x218efb){const _0x2e8acc=a147_0x37981f;return{'id':_0x218efb['id'],'roleName':_0x218efb[_0x2e8acc(0x1ba)],'roleType':_0x218efb[_0x2e8acc(0x1b7)],'remark':_0x218efb['remark'],'userCount':_0x218efb[_0x2e8acc(0x1d8)],'permitCount':_0x218efb[_0x2e8acc(0x1c3)],'builtin':isBuiltinRole(_0x218efb[_0x2e8acc(0x1b7)])};}export async function resolveRoleRef(_0xca6d62,_0x4fbfe2){const _0x4173b7=a147_0x37981f,_0x57d187=_0x4fbfe2[_0x4173b7(0x1eb)]();if(!_0x57d187)throw CliErrors[_0x4173b7(0x202)](_0x4173b7(0x1ed),_0x4173b7(0x1b6));if(/^\d+$/[_0x4173b7(0x1cf)](_0x57d187))return getRoleById(_0xca6d62,Number(_0x57d187));const _0x323692=await listAllAppRoles(_0xca6d62),_0x49d5cc=_0x323692[_0x4173b7(0x1ea)](_0x462573=>_0x462573[_0x4173b7(0x1ba)]===_0x57d187);if(_0x49d5cc[_0x4173b7(0x1da)]===0x0)throw CliErrors[_0x4173b7(0x202)]('Role\x20name\x20\x22'+_0x57d187+_0x4173b7(0x1e0)+_0xca6d62+'.',_0x4173b7(0x1c0));if(_0x49d5cc[_0x4173b7(0x1da)]>0x1){const _0x390a03=_0x49d5cc[_0x4173b7(0x1e6)](_0x1c936f=>_0x1c936f['id'])[_0x4173b7(0x1ca)](',\x20');throw CliErrors[_0x4173b7(0x202)](_0x4173b7(0x1f4)+_0x57d187+_0x4173b7(0x203)+_0x390a03+').',_0x4173b7(0x1c1));}return _0x49d5cc[0x0];}export async function getRoleById(_0x36f113,_0x2da52d){const _0x57d505=a147_0x37981f,_0x5cc8fc=await getAppRole(_0x2da52d);if(!_0x5cc8fc)throw CliErrors[_0x57d505(0x202)](_0x57d505(0x1cd)+_0x2da52d+_0x57d505(0x1f1)+_0x36f113+'.',_0x57d505(0x1c6));return _0x5cc8fc;}async function listAllAppRoles(_0x240a3d){const _0x5bc8b6=a147_0x37981f,_0x186f0d=0x64,_0x5d8a9f=[];for(let _0x142ee2=0x1;;_0x142ee2+=0x1){const {items:_0x26d469,paging:_0x54b6fe}=await listAppRoles(_0x240a3d,{'currentPage':_0x142ee2,'pageSize':_0x186f0d});_0x5d8a9f[_0x5bc8b6(0x1de)](..._0x26d469);if(_0x26d469[_0x5bc8b6(0x1da)]<_0x186f0d||_0x54b6fe&&_0x5d8a9f[_0x5bc8b6(0x1da)]>=_0x54b6fe[_0x5bc8b6(0x1ec)])return _0x5d8a9f;}}export async function resolveTenantCode(){const _0x1a1df8=a147_0x37981f,_0x1fda9a=await getSessionUserInfo(),_0x233662=_0x1fda9a?.['user']?.[_0x1a1df8(0x1bb)]?.[_0x1a1df8(0x1f9)];if(!_0x233662)throw CliErrors[_0x1a1df8(0x1bd)](_0x1a1df8(0x1e8));return _0x233662;}function matchMember(_0x339c60,_0x2fa31c){const _0x2fa8a6=a147_0x37981f,_0x50ac26=_0x2fa31c[_0x2fa8a6(0x1eb)]()['toLowerCase']();return(_0x339c60[_0x2fa8a6(0x1d7)]??'')[_0x2fa8a6(0x1e4)]()===_0x50ac26||(_0x339c60[_0x2fa8a6(0x1bf)]??'')[_0x2fa8a6(0x1e4)]()===_0x50ac26;}export async function resolveUserRef(_0x4ca9cb){const _0x1d6a05=a147_0x37981f,_0x2469dc=_0x4ca9cb['trim']();if(!_0x2469dc)throw CliErrors['validation'](_0x1d6a05(0x1f3),_0x1d6a05(0x1ff));const _0x2ad914=await resolveTenantCode(),_0x5bf105=await getTenantMembers(_0x2ad914);if(/^\d+$/[_0x1d6a05(0x1cf)](_0x2469dc)){const _0x4e2746=Number(_0x2469dc),_0x34c2c3=_0x5bf105['find'](_0x1c06e7=>_0x1c06e7[_0x1d6a05(0x1e7)]===_0x4e2746);return{'userId':_0x4e2746,'username':_0x34c2c3?.[_0x1d6a05(0x1bf)]??String(_0x4e2746),'nickname':_0x34c2c3?.['nickname'],'matchedBy':'id'};}const _0x33590e=_0x5bf105['filter'](_0xa33bee=>matchMember(_0xa33bee,_0x2469dc));if(_0x33590e[_0x1d6a05(0x1da)]===0x0)throw CliErrors[_0x1d6a05(0x202)]('No\x20tenant\x20member\x20matches\x20\x22'+_0x2469dc+'\x22.',_0x1d6a05(0x1bc));if(_0x33590e[_0x1d6a05(0x1da)]>0x1){const _0x17e4da=_0x33590e[_0x1d6a05(0x1e6)](_0x126acb=>(_0x126acb[_0x1d6a05(0x1d7)]??_0x126acb['username']??'?')+'('+_0x126acb[_0x1d6a05(0x1e7)]+')')['join'](',\x20');throw CliErrors['validation']('Multiple\x20tenant\x20members\x20match\x20\x22'+_0x2469dc+'\x22:\x20'+_0x17e4da+'.','Disambiguate\x20with\x20--user\x20<id>.');}const _0x213957=_0x33590e[0x0];return{'userId':_0x213957[_0x1d6a05(0x1e7)],'username':_0x213957[_0x1d6a05(0x1bf)]??String(_0x213957[_0x1d6a05(0x1e7)]),'nickname':_0x213957[_0x1d6a05(0x1d7)],'matchedBy':_0x1d6a05(0x209)};}export const UPDATE_USER_LIST_PATH=a147_0x37981f(0x1fd);function userIdsOf(_0xabb1f0){const _0x4049b7=a147_0x37981f;return(_0xabb1f0?.[_0x4049b7(0x1fc)]??[])[_0x4049b7(0x1e6)](_0x13faf2=>_0x13faf2['userId']);}export function computeRoleUserMutation(_0x337e58){const _0x17fb0a=a147_0x37981f,{operation:_0x165e0b,appCode:_0x3c6a99,roleUsers:_0x1dc9f6,targetRoleId:_0x58bea8,user:_0x4dec45}=_0x337e58,_0x1c217c=_0x1dc9f6[_0x17fb0a(0x200)](_0x10ced8=>_0x10ced8['id']===_0x58bea8);if(!_0x1c217c)throw CliErrors['validation'](_0x17fb0a(0x1cd)+_0x58bea8+_0x17fb0a(0x1f8),_0x17fb0a(0x1c6));const _0x100f69=userIdsOf(_0x1c217c),_0x2d41c8=[];if(_0x337e58[_0x17fb0a(0x1cb)]!==undefined&&_0x337e58[_0x17fb0a(0x1cb)]!==_0x100f69[_0x17fb0a(0x1da)])throw CliErrors[_0x17fb0a(0x202)](_0x17fb0a(0x1fa)+_0x337e58[_0x17fb0a(0x1cb)]+_0x17fb0a(0x1e3)+_0x100f69[_0x17fb0a(0x1da)]+'.',_0x17fb0a(0x1f6));const _0x2025c5=_0x100f69[_0x17fb0a(0x1e2)](_0x4dec45['userId']);let _0x36e334=![];const _0xda7980=[..._0x1c217c[_0x17fb0a(0x1fc)]];if(_0x165e0b===_0x17fb0a(0x1d3))_0x2025c5?_0x2d41c8['push']('User\x20'+_0x4dec45['userId']+_0x17fb0a(0x1e1)+_0x1c217c[_0x17fb0a(0x1ba)]+_0x17fb0a(0x1ef)):(_0xda7980[_0x17fb0a(0x1de)]({'userId':_0x4dec45['userId'],'username':_0x4dec45[_0x17fb0a(0x1bf)],..._0x4dec45['nickname']?{'nickname':_0x4dec45[_0x17fb0a(0x1d7)]}:{}}),_0x36e334=!![]);else{if(!_0x2025c5)_0x2d41c8[_0x17fb0a(0x1de)](_0x17fb0a(0x1cc)+_0x4dec45['userId']+_0x17fb0a(0x1fe)+_0x1c217c[_0x17fb0a(0x1ba)]+_0x17fb0a(0x1ef));else{const _0x19f8e9=_0xda7980[_0x17fb0a(0x1d5)](_0x48eb64=>_0x48eb64['userId']===_0x4dec45[_0x17fb0a(0x1e7)]);if(_0x19f8e9>=0x0)_0xda7980[_0x17fb0a(0x1f0)](_0x19f8e9,0x1);_0x36e334=!![];}}const _0x4c438f=_0x1dc9f6[_0x17fb0a(0x1e6)](_0x258db0=>_0x258db0['id']===_0x58bea8?{..._0x258db0,'userList':_0xda7980}:_0x258db0),_0x208aa6=_0xda7980[_0x17fb0a(0x1e6)](_0xccbff5=>_0xccbff5[_0x17fb0a(0x1e7)]),_0x119694={'operation':_0x165e0b,'selector':{'appCode':_0x3c6a99,'roleId':_0x58bea8,'roleName':_0x1c217c[_0x17fb0a(0x1ba)],'userId':_0x4dec45[_0x17fb0a(0x1e7)]},'before':{'userIds':_0x100f69},'after':{'userIds':_0x208aa6},'dryRun':_0x337e58[_0x17fb0a(0x1ce)],'backend':{'method':_0x17fb0a(0x1df),'path':UPDATE_USER_LIST_PATH},'warnings':_0x2d41c8};return{'roleList':_0x4c438f,'mutation':_0x119694,'changed':_0x36e334};}export async function loadRoleUsers(_0x1e38a3){return listRoleUsers(_0x1e38a3);}function a147_0x99de(_0x2374f8,_0x1ec8e4){_0x2374f8=_0x2374f8-0x1b6;const _0x4afe95=a147_0x4afe();let _0x99de87=_0x4afe95[_0x2374f8];return _0x99de87;}export function readRoleRef(_0x562d61){const _0x106d9a=a147_0x37981f,_0x100596=_0x562d61[_0x106d9a(0x1ee)](_0x106d9a(0x1e5))['trim']();if(!_0x100596)throw CliErrors[_0x106d9a(0x208)](_0x106d9a(0x1e5),_0x106d9a(0x1b6));return _0x100596;}export async function prepareUserMutation(_0x55e64e,_0x2577a3,_0x2c24dd){const _0x24599f=a147_0x37981f,_0x3c7fff=readRoleRef(_0x55e64e),_0x5b161f=_0x55e64e[_0x24599f(0x1ee)](_0x24599f(0x1dd))[_0x24599f(0x1eb)]();if(!_0x5b161f)throw CliErrors['flagMissing']('user',_0x24599f(0x1ff));const _0x4750b0=_0x55e64e[_0x24599f(0x1e9)]('expect-user-count'),_0xf99800=_0x4750b0===undefined||_0x4750b0===null?undefined:Number(_0x4750b0),_0x98574b=await resolveRoleRef(_0x55e64e[_0x24599f(0x1d9)],_0x3c7fff),_0x38e9a5=await resolveUserRef(_0x5b161f),_0x1c4cc9=await loadRoleUsers(_0x55e64e['appCode']);return computeRoleUserMutation({'operation':_0x2577a3,'appCode':_0x55e64e[_0x24599f(0x1d9)],'roleUsers':_0x1c4cc9,'targetRoleId':_0x98574b['id'],'user':{'userId':_0x38e9a5[_0x24599f(0x1e7)],'username':_0x38e9a5[_0x24599f(0x1bf)],'nickname':_0x38e9a5[_0x24599f(0x1d7)]},'dryRun':_0x2c24dd,..._0xf99800!==undefined?{'expectUserCount':_0xf99800}:{}});}
1
+ const a149_0x197ef4=a149_0xee27;(function(_0x409f33,_0x22f810){const _0xb6dc13=a149_0xee27,_0x5ece21=_0x409f33();while(!![]){try{const _0x23a250=-parseInt(_0xb6dc13(0x1f7))/0x1+-parseInt(_0xb6dc13(0x1f9))/0x2*(parseInt(_0xb6dc13(0x1b8))/0x3)+-parseInt(_0xb6dc13(0x1cb))/0x4+parseInt(_0xb6dc13(0x1d9))/0x5*(-parseInt(_0xb6dc13(0x1bc))/0x6)+parseInt(_0xb6dc13(0x1b6))/0x7*(-parseInt(_0xb6dc13(0x1f2))/0x8)+-parseInt(_0xb6dc13(0x1dc))/0x9*(parseInt(_0xb6dc13(0x1e0))/0xa)+-parseInt(_0xb6dc13(0x1ba))/0xb*(-parseInt(_0xb6dc13(0x1df))/0xc);if(_0x23a250===_0x22f810)break;else _0x5ece21['push'](_0x5ece21['shift']());}catch(_0x24f5be){_0x5ece21['push'](_0x5ece21['shift']());}}}(a149_0x2f63,0x46cba));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':'number','required':!![],'description':a149_0x197ef4(0x1f6)};export const ROLE_REF_FLAG={'name':'role','type':a149_0x197ef4(0x1ad),'required':!![],'description':a149_0x197ef4(0x1fc)};export const USER_REF_FLAG={'name':a149_0x197ef4(0x1f8),'type':'string','required':!![],'description':a149_0x197ef4(0x1d0)};export const NAME_FLAG={'name':a149_0x197ef4(0x1f3),'type':'string','required':!![],'description':a149_0x197ef4(0x1e6)};export const USER_NAME_FLAG={'name':a149_0x197ef4(0x1f3),'type':a149_0x197ef4(0x1ad),'required':!![],'description':a149_0x197ef4(0x1d6)};export const REMARK_FLAG={'name':'remark','type':a149_0x197ef4(0x1ad),'required':![],'description':'Optional\x20role\x20remark/description'};export const EXPECT_USER_COUNT_FLAG={'name':a149_0x197ef4(0x1c0),'type':a149_0x197ef4(0x1e5),'required':![],'description':a149_0x197ef4(0x1e8)};export const BUILTIN_ROLE_TYPES=[a149_0x197ef4(0x1e2),a149_0x197ef4(0x1ce),a149_0x197ef4(0x1c5)];export function isBuiltinRole(_0x5570bd){const _0x5d069a=a149_0x197ef4;return BUILTIN_ROLE_TYPES[_0x5d069a(0x1e3)](_0x5570bd);}export function assertCustomRole(_0x2a87cd,_0x248596){const _0xcbf4f4=a149_0x197ef4;if(_0x2a87cd[_0xcbf4f4(0x1c3)]!=='CUSTOM')throw CliErrors[_0xcbf4f4(0x1fb)](_0xcbf4f4(0x1c6)+_0x248596+_0xcbf4f4(0x1f1)+_0x2a87cd['roleName']+'\x20('+_0x2a87cd['roleType']+').',_0xcbf4f4(0x1f0));}export function assertPermConfigurable(_0x2ebb02){const _0xb8ba79=a149_0x197ef4;if(_0x2ebb02[_0xb8ba79(0x1c3)]==='DEV'||_0x2ebb02['roleType']===_0xb8ba79(0x1e2))throw CliErrors[_0xb8ba79(0x1fb)](_0xb8ba79(0x1cc)+_0x2ebb02[_0xb8ba79(0x1bd)]+'\x20('+_0x2ebb02[_0xb8ba79(0x1c3)]+').',_0xb8ba79(0x1b5));}export function projectRole(_0x5226a2){const _0x31dcd1=a149_0x197ef4;return{'id':_0x5226a2['id'],'roleName':_0x5226a2[_0x31dcd1(0x1bd)],'roleType':_0x5226a2[_0x31dcd1(0x1c3)],'remark':_0x5226a2[_0x31dcd1(0x1af)],'userCount':_0x5226a2[_0x31dcd1(0x1d7)],'permitCount':_0x5226a2[_0x31dcd1(0x1db)],'builtin':isBuiltinRole(_0x5226a2['roleType'])};}export async function resolveRoleRef(_0x1ba8f2,_0x57645e){const _0x51d9da=a149_0x197ef4,_0x8d12ee=_0x57645e['trim']();if(!_0x8d12ee)throw CliErrors[_0x51d9da(0x1fb)](_0x51d9da(0x1be),_0x51d9da(0x1b7));if(/^\d+$/[_0x51d9da(0x1c4)](_0x8d12ee))return getRoleById(_0x1ba8f2,Number(_0x8d12ee));const _0x1d122c=await listAllAppRoles(_0x1ba8f2),_0x5bd3f3=_0x1d122c[_0x51d9da(0x1c9)](_0x2593af=>_0x2593af[_0x51d9da(0x1bd)]===_0x8d12ee);if(_0x5bd3f3[_0x51d9da(0x1d1)]===0x0)throw CliErrors[_0x51d9da(0x1fb)]('Role\x20name\x20\x22'+_0x8d12ee+_0x51d9da(0x1fd)+_0x1ba8f2+'.',_0x51d9da(0x1d2));if(_0x5bd3f3['length']>0x1){const _0x113698=_0x5bd3f3[_0x51d9da(0x1da)](_0x2931c4=>_0x2931c4['id'])[_0x51d9da(0x1cf)](',\x20');throw CliErrors['validation'](_0x51d9da(0x1eb)+_0x8d12ee+_0x51d9da(0x1e9)+_0x113698+').','Disambiguate\x20with\x20--role\x20<id>.');}return _0x5bd3f3[0x0];}export async function getRoleById(_0x4a1c79,_0x1bed2e){const _0x32e111=a149_0x197ef4,_0x407a75=await getAppRole(_0x1bed2e);if(!_0x407a75)throw CliErrors[_0x32e111(0x1fb)](_0x32e111(0x1b9)+_0x1bed2e+'\x20not\x20found\x20in\x20app\x20'+_0x4a1c79+'.',_0x32e111(0x1ef));return _0x407a75;}function a149_0x2f63(){const _0xfd644a=['\x20built-in\x20role\x20','14984ewKYod','name','push','totalCount','Role\x20id\x20(from\x20`role\x20list`)','134974HwklPC','user','1342cMPbCl','splice','validation','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','\x22\x20not\x20found\x20in\x20app\x20','Multiple\x20tenant\x20members\x20match\x20\x22','string','authRequired','remark','expectUserCount','nickname','Anti-drift\x20check\x20failed:\x20expected\x20','userId','username','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','1169ReQsaS','Pass\x20--role\x20<id|name>.','2547gerrnl','Role\x20id\x20','11tuBCgo','trim','177318bRsGfP','roleName','Missing\x20role\x20reference.','dryRun','expect-user-count',';\x20no\x20change.','User\x20','roleType','test','USER','Cannot\x20','No\x20tenant\x20member\x20matches\x20\x22','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','filter','\x20is\x20already\x20a\x20member\x20of\x20role\x20','581520kSkKiF','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','flag','DEV','join','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','length','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','flagMissing','toLowerCase','tenant_code','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','userCount','findIndex','65mBKxiO','map','permitCount','153hNZKEm','Missing\x20user\x20reference.','userList','24612456FTlwMY','125910bAQZmd','str','ADMIN','includes','find','number','Role\x20name','role','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','\x22\x20is\x20ambiguous\x20(ids:\x20','appCode','Role\x20name\x20\x22','user-add','POST','tenant','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.'];a149_0x2f63=function(){return _0xfd644a;};return a149_0x2f63();}async function listAllAppRoles(_0x3f0372){const _0x18e8a0=a149_0x197ef4,_0x29cc16=0x64,_0x333c67=[];for(let _0x1707b4=0x1;;_0x1707b4+=0x1){const {items:_0x49a8ab,paging:_0x3ff7c7}=await listAppRoles(_0x3f0372,{'currentPage':_0x1707b4,'pageSize':_0x29cc16});_0x333c67[_0x18e8a0(0x1f4)](..._0x49a8ab);if(_0x49a8ab[_0x18e8a0(0x1d1)]<_0x29cc16||_0x3ff7c7&&_0x333c67[_0x18e8a0(0x1d1)]>=_0x3ff7c7[_0x18e8a0(0x1f5)])return _0x333c67;}}export async function resolveTenantCode(){const _0x4270a3=a149_0x197ef4,_0x54a7d8=await getSessionUserInfo(),_0x12cd1f=_0x54a7d8?.[_0x4270a3(0x1f8)]?.[_0x4270a3(0x1ee)]?.[_0x4270a3(0x1d5)];if(!_0x12cd1f)throw CliErrors[_0x4270a3(0x1ae)]('Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.');return _0x12cd1f;}function matchMember(_0xc86426,_0x32e46d){const _0x250495=a149_0x197ef4,_0x2957ea=_0x32e46d['trim']()[_0x250495(0x1d4)]();return(_0xc86426[_0x250495(0x1b1)]??'')['toLowerCase']()===_0x2957ea||(_0xc86426[_0x250495(0x1b4)]??'')[_0x250495(0x1d4)]()===_0x2957ea;}export async function resolveUserRef(_0x22057b){const _0x5f7f59=a149_0x197ef4,_0x9cd09d=_0x22057b[_0x5f7f59(0x1bb)]();if(!_0x9cd09d)throw CliErrors[_0x5f7f59(0x1fb)](_0x5f7f59(0x1dd),'Pass\x20--user\x20<id|name>.');const _0x461bad=await resolveTenantCode(),_0x5eea2f=await getTenantMembers(_0x461bad);if(/^\d+$/[_0x5f7f59(0x1c4)](_0x9cd09d)){const _0x2bdf81=Number(_0x9cd09d),_0x3eb2f6=_0x5eea2f[_0x5f7f59(0x1e4)](_0x3a2d71=>_0x3a2d71[_0x5f7f59(0x1b3)]===_0x2bdf81);return{'userId':_0x2bdf81,'username':_0x3eb2f6?.[_0x5f7f59(0x1b4)]??String(_0x2bdf81),'nickname':_0x3eb2f6?.['nickname'],'matchedBy':'id'};}const _0x195f10=_0x5eea2f[_0x5f7f59(0x1c9)](_0xed4bae=>matchMember(_0xed4bae,_0x9cd09d));if(_0x195f10[_0x5f7f59(0x1d1)]===0x0)throw CliErrors['validation'](_0x5f7f59(0x1c7)+_0x9cd09d+'\x22.','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.');if(_0x195f10['length']>0x1){const _0x251da7=_0x195f10['map'](_0x38f669=>(_0x38f669[_0x5f7f59(0x1b1)]??_0x38f669[_0x5f7f59(0x1b4)]??'?')+'('+_0x38f669['userId']+')')[_0x5f7f59(0x1cf)](',\x20');throw CliErrors[_0x5f7f59(0x1fb)](_0x5f7f59(0x1ac)+_0x9cd09d+'\x22:\x20'+_0x251da7+'.','Disambiguate\x20with\x20--user\x20<id>.');}const _0x43618f=_0x195f10[0x0];return{'userId':_0x43618f['userId'],'username':_0x43618f[_0x5f7f59(0x1b4)]??String(_0x43618f[_0x5f7f59(0x1b3)]),'nickname':_0x43618f['nickname'],'matchedBy':_0x5f7f59(0x1f3)};}export const UPDATE_USER_LIST_PATH='/smartapi/permit/user-role/update-user-list';function a149_0xee27(_0x188ba8,_0x34d830){_0x188ba8=_0x188ba8-0x1ac;const _0x2f6381=a149_0x2f63();let _0xee27df=_0x2f6381[_0x188ba8];return _0xee27df;}function userIdsOf(_0x2e0f0c){const _0x41b4ff=a149_0x197ef4;return(_0x2e0f0c?.['userList']??[])['map'](_0x2125f8=>_0x2125f8[_0x41b4ff(0x1b3)]);}export function computeRoleUserMutation(_0x22c80c){const _0x36b414=a149_0x197ef4,{operation:_0x557935,appCode:_0x13e08f,roleUsers:_0x5aed82,targetRoleId:_0x3278f7,user:_0x7c4973}=_0x22c80c,_0x28084d=_0x5aed82[_0x36b414(0x1e4)](_0x27ca65=>_0x27ca65['id']===_0x3278f7);if(!_0x28084d)throw CliErrors['validation']('Role\x20id\x20'+_0x3278f7+'\x20not\x20found\x20in\x20the\x20user-role\x20list.',_0x36b414(0x1ef));const _0x3bd11d=userIdsOf(_0x28084d),_0x1dc079=[];if(_0x22c80c[_0x36b414(0x1b0)]!==undefined&&_0x22c80c['expectUserCount']!==_0x3bd11d[_0x36b414(0x1d1)])throw CliErrors['validation'](_0x36b414(0x1b2)+_0x22c80c[_0x36b414(0x1b0)]+'\x20member(s)\x20but\x20role\x20has\x20'+_0x3bd11d[_0x36b414(0x1d1)]+'.',_0x36b414(0x1c8));const _0x20c441=_0x3bd11d[_0x36b414(0x1e3)](_0x7c4973['userId']);let _0x27b403=![];const _0x31cec5=[..._0x28084d[_0x36b414(0x1de)]];if(_0x557935===_0x36b414(0x1ec))_0x20c441?_0x1dc079[_0x36b414(0x1f4)](_0x36b414(0x1c2)+_0x7c4973[_0x36b414(0x1b3)]+_0x36b414(0x1ca)+_0x28084d[_0x36b414(0x1bd)]+';\x20no\x20change.'):(_0x31cec5[_0x36b414(0x1f4)]({'userId':_0x7c4973[_0x36b414(0x1b3)],'username':_0x7c4973['username'],..._0x7c4973[_0x36b414(0x1b1)]?{'nickname':_0x7c4973[_0x36b414(0x1b1)]}:{}}),_0x27b403=!![]);else{if(!_0x20c441)_0x1dc079['push'](_0x36b414(0x1c2)+_0x7c4973[_0x36b414(0x1b3)]+'\x20is\x20not\x20a\x20member\x20of\x20role\x20'+_0x28084d[_0x36b414(0x1bd)]+_0x36b414(0x1c1));else{const _0x1c80e7=_0x31cec5[_0x36b414(0x1d8)](_0x482686=>_0x482686[_0x36b414(0x1b3)]===_0x7c4973[_0x36b414(0x1b3)]);if(_0x1c80e7>=0x0)_0x31cec5[_0x36b414(0x1fa)](_0x1c80e7,0x1);_0x27b403=!![];}}const _0x5c567c=_0x5aed82['map'](_0x128517=>_0x128517['id']===_0x3278f7?{..._0x128517,'userList':_0x31cec5}:_0x128517),_0x60ae07=_0x31cec5[_0x36b414(0x1da)](_0x5749b2=>_0x5749b2['userId']),_0x167514={'operation':_0x557935,'selector':{'appCode':_0x13e08f,'roleId':_0x3278f7,'roleName':_0x28084d[_0x36b414(0x1bd)],'userId':_0x7c4973[_0x36b414(0x1b3)]},'before':{'userIds':_0x3bd11d},'after':{'userIds':_0x60ae07},'dryRun':_0x22c80c[_0x36b414(0x1bf)],'backend':{'method':_0x36b414(0x1ed),'path':UPDATE_USER_LIST_PATH},'warnings':_0x1dc079};return{'roleList':_0x5c567c,'mutation':_0x167514,'changed':_0x27b403};}export async function loadRoleUsers(_0xcf0e2c){return listRoleUsers(_0xcf0e2c);}export function readRoleRef(_0x5a827a){const _0x1a517c=a149_0x197ef4,_0x3af3aa=_0x5a827a[_0x1a517c(0x1e1)](_0x1a517c(0x1e7))['trim']();if(!_0x3af3aa)throw CliErrors[_0x1a517c(0x1d3)](_0x1a517c(0x1e7),_0x1a517c(0x1b7));return _0x3af3aa;}export async function prepareUserMutation(_0x4d9362,_0x5c386d,_0x4a46c9){const _0x14e394=a149_0x197ef4,_0x25e651=readRoleRef(_0x4d9362),_0x381b81=_0x4d9362[_0x14e394(0x1e1)](_0x14e394(0x1f8))[_0x14e394(0x1bb)]();if(!_0x381b81)throw CliErrors[_0x14e394(0x1d3)](_0x14e394(0x1f8),'Pass\x20--user\x20<id|name>.');const _0x1e8204=_0x4d9362[_0x14e394(0x1cd)](_0x14e394(0x1c0)),_0x579dd6=_0x1e8204===undefined||_0x1e8204===null?undefined:Number(_0x1e8204),_0x50ebe7=await resolveRoleRef(_0x4d9362[_0x14e394(0x1ea)],_0x25e651),_0x36ab20=await resolveUserRef(_0x381b81),_0x3de58f=await loadRoleUsers(_0x4d9362['appCode']);return computeRoleUserMutation({'operation':_0x5c386d,'appCode':_0x4d9362[_0x14e394(0x1ea)],'roleUsers':_0x3de58f,'targetRoleId':_0x50ebe7['id'],'user':{'userId':_0x36ab20[_0x14e394(0x1b3)],'username':_0x36ab20[_0x14e394(0x1b4)],'nickname':_0x36ab20[_0x14e394(0x1b1)]},'dryRun':_0x4a46c9,..._0x579dd6!==undefined?{'expectUserCount':_0x579dd6}:{}});}
@@ -1 +1 @@
1
- const a148_0x4d0ebb=a148_0x568a;(function(_0x276d52,_0x46238c){const _0x35c46f=a148_0x568a,_0x439003=_0x276d52();while(!![]){try{const _0x3940ec=parseInt(_0x35c46f(0x1a9))/0x1*(-parseInt(_0x35c46f(0x1a3))/0x2)+-parseInt(_0x35c46f(0x1a5))/0x3+parseInt(_0x35c46f(0x19a))/0x4*(-parseInt(_0x35c46f(0x197))/0x5)+-parseInt(_0x35c46f(0x1aa))/0x6*(parseInt(_0x35c46f(0x1a1))/0x7)+parseInt(_0x35c46f(0x19c))/0x8+-parseInt(_0x35c46f(0x192))/0x9*(-parseInt(_0x35c46f(0x193))/0xa)+-parseInt(_0x35c46f(0x19f))/0xb*(-parseInt(_0x35c46f(0x191))/0xc);if(_0x3940ec===_0x46238c)break;else _0x439003['push'](_0x439003['shift']());}catch(_0x387b7f){_0x439003['push'](_0x439003['shift']());}}}(a148_0x5d37,0x94653));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a148_0x5d37(){const _0x2a9feb=['roleName','num','129869FPxhMJ','642JQAFNx','flag','write','/smartapi/permit/role/update','Nothing\x20to\x20update.','appCode','length','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','8796LSgONg','36hWJawL','1704520yNwjSx','string','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','trim','15VewDcf','Updated\x20role\x20','update','1512316zsMeME','POST','5543328TocDoR','\x20(id=','validation','45727bXdvxZ','New\x20role\x20name','53809SXClnX','name','10tBjlyZ','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','3623661bYgrUX','remark'];a148_0x5d37=function(){return _0x2a9feb;};return a148_0x5d37();}function a148_0x568a(_0x37d4a3,_0x4f3cc){_0x37d4a3=_0x37d4a3-0x18a;const _0x5d3705=a148_0x5d37();let _0x568a95=_0x5d3705[_0x37d4a3];return _0x568a95;}const UPDATE_PATH=a148_0x4d0ebb(0x18c);function readPatch(_0x2d0f66){const _0x86fa4e=a148_0x4d0ebb,_0x22a355=_0x2d0f66[_0x86fa4e(0x18a)](_0x86fa4e(0x1a2)),_0x56d339=_0x2d0f66['flag'](_0x86fa4e(0x1a6)),_0x1f9b3d={};if(_0x22a355!==undefined&&_0x22a355!==null){const _0x4924d1=String(_0x22a355)[_0x86fa4e(0x196)]();if(!_0x4924d1)throw CliErrors['validation']('--name\x20cannot\x20be\x20empty.');if(_0x4924d1[_0x86fa4e(0x18f)]>0x40)throw CliErrors[_0x86fa4e(0x19e)](_0x86fa4e(0x195));_0x1f9b3d[_0x86fa4e(0x1a7)]=_0x4924d1;}_0x56d339!==undefined&&_0x56d339!==null&&(_0x1f9b3d[_0x86fa4e(0x1a6)]=String(_0x56d339));if(_0x1f9b3d['roleName']===undefined&&_0x1f9b3d['remark']===undefined)throw CliErrors[_0x86fa4e(0x19e)](_0x86fa4e(0x18d),_0x86fa4e(0x1a4));return _0x1f9b3d;}export const roleUpdate={'service':'role','command':a148_0x4d0ebb(0x199),'description':a148_0x4d0ebb(0x190),'risk':a148_0x4d0ebb(0x18b),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a148_0x4d0ebb(0x1a2),'type':a148_0x4d0ebb(0x194),'required':![],'description':a148_0x4d0ebb(0x1a0)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x53d9a2){readPatch(_0x53d9a2);},async 'dryRun'(_0x42f24e){const _0x2a70ba=a148_0x4d0ebb,_0x4dc0b4=_0x42f24e[_0x2a70ba(0x1a8)]('id'),_0x101758=readPatch(_0x42f24e),_0x1d7b31=await getRoleById(_0x42f24e[_0x2a70ba(0x18e)],_0x4dc0b4);return assertCustomRole(_0x1d7b31,_0x2a70ba(0x199)),asDryRunResult({'operation':_0x2a70ba(0x199),'selector':{'appCode':_0x42f24e[_0x2a70ba(0x18e)],'roleId':_0x4dc0b4,'roleName':_0x1d7b31[_0x2a70ba(0x1a7)]},'before':projectRole(_0x1d7b31),'after':projectRole({..._0x1d7b31,..._0x101758[_0x2a70ba(0x1a7)]!==undefined?{'roleName':_0x101758[_0x2a70ba(0x1a7)]}:{},..._0x101758[_0x2a70ba(0x1a6)]!==undefined?{'remark':_0x101758[_0x2a70ba(0x1a6)]}:{}}),'dryRun':!![],'backend':{'method':_0x2a70ba(0x19b),'path':UPDATE_PATH},'warnings':[]},{'method':_0x2a70ba(0x19b),'url':UPDATE_PATH});},async 'execute'(_0x2a0b85){const _0x2e4efe=a148_0x4d0ebb,_0x3c0a10=_0x2a0b85[_0x2e4efe(0x1a8)]('id'),_0x3cd6b1=readPatch(_0x2a0b85),_0x2e31fd=await getRoleById(_0x2a0b85['appCode'],_0x3c0a10);assertCustomRole(_0x2e31fd,_0x2e4efe(0x199)),await updateAppRole({'id':_0x3c0a10,'appCode':_0x2a0b85[_0x2e4efe(0x18e)],..._0x3cd6b1['roleName']!==undefined?{'roleName':_0x3cd6b1[_0x2e4efe(0x1a7)]}:{},..._0x3cd6b1[_0x2e4efe(0x1a6)]!==undefined?{'remark':_0x3cd6b1['remark']}:{}});const _0x3625fb=await getRoleById(_0x2a0b85[_0x2e4efe(0x18e)],_0x3c0a10);return{'ok':!![],'data':{'operation':_0x2e4efe(0x199),'selector':{'appCode':_0x2a0b85[_0x2e4efe(0x18e)],'roleId':_0x3c0a10,'roleName':_0x3625fb[_0x2e4efe(0x1a7)]},'before':projectRole(_0x2e31fd),'after':projectRole(_0x3625fb),'dryRun':![],'backend':{'method':_0x2e4efe(0x19b),'path':UPDATE_PATH},'warnings':[]},'message':_0x2e4efe(0x198)+_0x3625fb[_0x2e4efe(0x1a7)]+_0x2e4efe(0x19d)+_0x3c0a10+')'};}};
1
+ function a150_0x4d7a(){const _0x4cac35=['699LyRxXb','New\x20role\x20name','Updated\x20role\x20','8294077yseymb','4XeKwID','write','roleName','2573870JwsTZi','flag','name','POST','/smartapi/permit/role/update','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','trim','string','3616830esCRxb','appCode','role','num','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','36NBvydx','3403182syjFSr','update','4850JQvIFO','remark','--name\x20cannot\x20be\x20empty.','207740FEYcYs','validation','10zALKWm','529752NQGSfv','Nothing\x20to\x20update.','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','\x20(id='];a150_0x4d7a=function(){return _0x4cac35;};return a150_0x4d7a();}const a150_0x4f906b=a150_0x5d0c;(function(_0x1382de,_0xfa4a63){const _0x1c25ae=a150_0x5d0c,_0x25514c=_0x1382de();while(!![]){try{const _0x2fb3db=-parseInt(_0x1c25ae(0xbd))/0x1+-parseInt(_0x1c25ae(0xba))/0x2*(parseInt(_0x1c25ae(0xc4))/0x3)+-parseInt(_0x1c25ae(0xc8))/0x4*(parseInt(_0x1c25ae(0xcb))/0x5)+parseInt(_0x1c25ae(0xb8))/0x6+parseInt(_0x1c25ae(0xb2))/0x7+parseInt(_0x1c25ae(0xc0))/0x8*(-parseInt(_0x1c25ae(0xb7))/0x9)+-parseInt(_0x1c25ae(0xbf))/0xa*(-parseInt(_0x1c25ae(0xc7))/0xb);if(_0x2fb3db===_0xfa4a63)break;else _0x25514c['push'](_0x25514c['shift']());}catch(_0x14078e){_0x25514c['push'](_0x25514c['shift']());}}}(a150_0x4d7a,0x45b27));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_0x5d0c(_0x59c531,_0x1aa6dd){_0x59c531=_0x59c531-0xad;const _0x4d7af1=a150_0x4d7a();let _0x5d0cca=_0x4d7af1[_0x59c531];return _0x5d0cca;}const UPDATE_PATH=a150_0x4f906b(0xae);function readPatch(_0x23b58e){const _0x6a5c3b=a150_0x4f906b,_0x42238c=_0x23b58e['flag'](_0x6a5c3b(0xcd)),_0x39d4b1=_0x23b58e[_0x6a5c3b(0xcc)]('remark'),_0x661e28={};if(_0x42238c!==undefined&&_0x42238c!==null){const _0x28eed0=String(_0x42238c)[_0x6a5c3b(0xb0)]();if(!_0x28eed0)throw CliErrors[_0x6a5c3b(0xbe)](_0x6a5c3b(0xbc));if(_0x28eed0['length']>0x40)throw CliErrors[_0x6a5c3b(0xbe)](_0x6a5c3b(0xc2));_0x661e28[_0x6a5c3b(0xca)]=_0x28eed0;}_0x39d4b1!==undefined&&_0x39d4b1!==null&&(_0x661e28[_0x6a5c3b(0xbb)]=String(_0x39d4b1));if(_0x661e28[_0x6a5c3b(0xca)]===undefined&&_0x661e28['remark']===undefined)throw CliErrors['validation'](_0x6a5c3b(0xc1),_0x6a5c3b(0xb6));return _0x661e28;}export const roleUpdate={'service':a150_0x4f906b(0xb4),'command':a150_0x4f906b(0xb9),'description':a150_0x4f906b(0xaf),'risk':a150_0x4f906b(0xc9),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a150_0x4f906b(0xcd),'type':a150_0x4f906b(0xb1),'required':![],'description':a150_0x4f906b(0xc5)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5dd8e6){readPatch(_0x5dd8e6);},async 'dryRun'(_0x4bf050){const _0x5a67f4=a150_0x4f906b,_0x4ceb05=_0x4bf050['num']('id'),_0x112931=readPatch(_0x4bf050),_0x19e8d9=await getRoleById(_0x4bf050[_0x5a67f4(0xb3)],_0x4ceb05);return assertCustomRole(_0x19e8d9,_0x5a67f4(0xb9)),asDryRunResult({'operation':'update','selector':{'appCode':_0x4bf050[_0x5a67f4(0xb3)],'roleId':_0x4ceb05,'roleName':_0x19e8d9['roleName']},'before':projectRole(_0x19e8d9),'after':projectRole({..._0x19e8d9,..._0x112931[_0x5a67f4(0xca)]!==undefined?{'roleName':_0x112931[_0x5a67f4(0xca)]}:{},..._0x112931[_0x5a67f4(0xbb)]!==undefined?{'remark':_0x112931['remark']}:{}}),'dryRun':!![],'backend':{'method':_0x5a67f4(0xad),'path':UPDATE_PATH},'warnings':[]},{'method':_0x5a67f4(0xad),'url':UPDATE_PATH});},async 'execute'(_0x3f9062){const _0x1dd208=a150_0x4f906b,_0x4b79b1=_0x3f9062[_0x1dd208(0xb5)]('id'),_0x2f869d=readPatch(_0x3f9062),_0x2314a8=await getRoleById(_0x3f9062[_0x1dd208(0xb3)],_0x4b79b1);assertCustomRole(_0x2314a8,_0x1dd208(0xb9)),await updateAppRole({'id':_0x4b79b1,'appCode':_0x3f9062[_0x1dd208(0xb3)],..._0x2f869d[_0x1dd208(0xca)]!==undefined?{'roleName':_0x2f869d[_0x1dd208(0xca)]}:{},..._0x2f869d['remark']!==undefined?{'remark':_0x2f869d[_0x1dd208(0xbb)]}:{}});const _0x50fa13=await getRoleById(_0x3f9062[_0x1dd208(0xb3)],_0x4b79b1);return{'ok':!![],'data':{'operation':_0x1dd208(0xb9),'selector':{'appCode':_0x3f9062[_0x1dd208(0xb3)],'roleId':_0x4b79b1,'roleName':_0x50fa13[_0x1dd208(0xca)]},'before':projectRole(_0x2314a8),'after':projectRole(_0x50fa13),'dryRun':![],'backend':{'method':_0x1dd208(0xad),'path':UPDATE_PATH},'warnings':[]},'message':_0x1dd208(0xc6)+_0x50fa13[_0x1dd208(0xca)]+_0x1dd208(0xc3)+_0x4b79b1+')'};}};
@@ -1 +1 @@
1
- function a149_0x2ee0(_0x4b528c,_0x4fe181){_0x4b528c=_0x4b528c-0x8f;const _0x5d8471=a149_0x5d84();let _0x2ee0ae=_0x5d8471[_0x4b528c];return _0x2ee0ae;}const a149_0x5891c4=a149_0x2ee0;(function(_0x3d55ff,_0x36fc83){const _0x398e19=a149_0x2ee0,_0x235cc4=_0x3d55ff();while(!![]){try{const _0x2c76fa=parseInt(_0x398e19(0x94))/0x1+-parseInt(_0x398e19(0x9a))/0x2*(-parseInt(_0x398e19(0x91))/0x3)+-parseInt(_0x398e19(0x8f))/0x4*(-parseInt(_0x398e19(0xa1))/0x5)+-parseInt(_0x398e19(0x90))/0x6+parseInt(_0x398e19(0x9d))/0x7+-parseInt(_0x398e19(0x99))/0x8+parseInt(_0x398e19(0xa0))/0x9*(-parseInt(_0x398e19(0x9c))/0xa);if(_0x2c76fa===_0x36fc83)break;else _0x235cc4['push'](_0x235cc4['shift']());}catch(_0x5bbb68){_0x235cc4['push'](_0x235cc4['shift']());}}}(a149_0x5d84,0xcb509));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a149_0x5d84(){const _0x4db90a=['selector','7870gpsMLY','1814218TkZndK','user-add','high-risk-write','13581uCHorj','588825BaHJil','52evBQxm','2673636qHtcvq','3HfiKmr','\x20to\x20role\x20','No\x20change:\x20user\x20','1422896lpYhfD','POST','roleName','userId','role','13280896ryJmoA','1826126noKdXT'];a149_0x5d84=function(){return _0x4db90a;};return a149_0x5d84();}import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':a149_0x5891c4(0x98),'command':a149_0x5891c4(0x9e),'description':'Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a149_0x5891c4(0x9f),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x2975a8){const _0x3e997f=a149_0x5891c4,{mutation:_0x2f8f91}=await prepareUserMutation(_0x2975a8,_0x3e997f(0x9e),!![]);return asDryRunResult(_0x2f8f91,{'method':_0x3e997f(0x95),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x3fc886){const _0x9b2e7=a149_0x5891c4,{roleList:_0x5241db,mutation:_0x59f17c,changed:_0x35249e}=await prepareUserMutation(_0x3fc886,_0x9b2e7(0x9e),![]);return _0x35249e&&await updateRoleUsers(_0x3fc886['appCode'],_0x5241db),{'ok':!![],'data':_0x59f17c,'message':_0x35249e?'Added\x20user\x20'+_0x59f17c[_0x9b2e7(0x9b)][_0x9b2e7(0x97)]+_0x9b2e7(0x92)+_0x59f17c[_0x9b2e7(0x9b)][_0x9b2e7(0x96)]:_0x9b2e7(0x93)+_0x59f17c[_0x9b2e7(0x9b)][_0x9b2e7(0x97)]+'\x20already\x20in\x20role\x20'+_0x59f17c['selector'][_0x9b2e7(0x96)]};}};
1
+ const a151_0x415e40=a151_0x2218;(function(_0x4e891b,_0x1b31f8){const _0x29037c=a151_0x2218,_0x17facf=_0x4e891b();while(!![]){try{const _0x47387c=-parseInt(_0x29037c(0x1bd))/0x1*(parseInt(_0x29037c(0x1be))/0x2)+-parseInt(_0x29037c(0x1af))/0x3*(parseInt(_0x29037c(0x1b9))/0x4)+-parseInt(_0x29037c(0x1ae))/0x5+-parseInt(_0x29037c(0x1b0))/0x6*(parseInt(_0x29037c(0x1b2))/0x7)+parseInt(_0x29037c(0x1c2))/0x8*(parseInt(_0x29037c(0x1b8))/0x9)+parseInt(_0x29037c(0x1b5))/0xa+parseInt(_0x29037c(0x1ba))/0xb;if(_0x47387c===_0x1b31f8)break;else _0x17facf['push'](_0x17facf['shift']());}catch(_0xf2279){_0x17facf['push'](_0x17facf['shift']());}}}(a151_0x4afc,0x2a49c));import{updateRoleUsers}from'../../core/api-client.js';function a151_0x2218(_0x3a5b4b,_0x4ced91){_0x3a5b4b=_0x3a5b4b-0x1ae;const _0x4afc60=a151_0x4afc();let _0x221801=_0x4afc60[_0x3a5b4b];return _0x221801;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a151_0x4afc(){const _0x5da291=['No\x20change:\x20user\x20','8GjVxLH','appCode','POST','user-add','642550LWKBdy','411PCczTB','141366TqZHhY','high-risk-write','7FCmCDo','\x20to\x20role\x20','role','3185590pQUbNI','\x20already\x20in\x20role\x20','roleName','229059yUGZtM','412dHGNQf','3735886UFdBcV','selector','Added\x20user\x20','9059hapJGA','76tilwSp','userId','Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes'];a151_0x4afc=function(){return _0x5da291;};return a151_0x4afc();}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_0x415e40(0x1b4),'command':a151_0x415e40(0x1c5),'description':a151_0x415e40(0x1c0),'risk':a151_0x415e40(0x1b1),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x3c1297){const _0x17b931=a151_0x415e40,{mutation:_0x3bc57a}=await prepareUserMutation(_0x3c1297,_0x17b931(0x1c5),!![]);return asDryRunResult(_0x3bc57a,{'method':_0x17b931(0x1c4),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x435faf){const _0x1c7694=a151_0x415e40,{roleList:_0x57f18c,mutation:_0x1bc6d8,changed:_0x315688}=await prepareUserMutation(_0x435faf,_0x1c7694(0x1c5),![]);return _0x315688&&await updateRoleUsers(_0x435faf[_0x1c7694(0x1c3)],_0x57f18c),{'ok':!![],'data':_0x1bc6d8,'message':_0x315688?_0x1c7694(0x1bc)+_0x1bc6d8['selector'][_0x1c7694(0x1bf)]+_0x1c7694(0x1b3)+_0x1bc6d8['selector'][_0x1c7694(0x1b7)]:_0x1c7694(0x1c1)+_0x1bc6d8[_0x1c7694(0x1bb)][_0x1c7694(0x1bf)]+_0x1c7694(0x1b6)+_0x1bc6d8['selector']['roleName']};}};
@@ -1 +1 @@
1
- const a150_0x574f44=a150_0x5e99;function a150_0x5e99(_0x540daa,_0x14b3ca){_0x540daa=_0x540daa-0xd4;const _0x47f78e=a150_0x47f7();let _0x5e9933=_0x47f78e[_0x540daa];return _0x5e9933;}(function(_0x177810,_0x541e72){const _0x5aedf0=a150_0x5e99,_0x53b922=_0x177810();while(!![]){try{const _0x1fbeba=parseInt(_0x5aedf0(0xe6))/0x1*(-parseInt(_0x5aedf0(0xdf))/0x2)+parseInt(_0x5aedf0(0xda))/0x3*(-parseInt(_0x5aedf0(0xe8))/0x4)+parseInt(_0x5aedf0(0xe2))/0x5*(parseInt(_0x5aedf0(0xe1))/0x6)+parseInt(_0x5aedf0(0xde))/0x7*(-parseInt(_0x5aedf0(0xe3))/0x8)+-parseInt(_0x5aedf0(0xd6))/0x9*(parseInt(_0x5aedf0(0xd8))/0xa)+parseInt(_0x5aedf0(0xe9))/0xb+parseInt(_0x5aedf0(0xdb))/0xc*(parseInt(_0x5aedf0(0xd7))/0xd);if(_0x1fbeba===_0x541e72)break;else _0x53b922['push'](_0x53b922['shift']());}catch(_0x16064b){_0x53b922['push'](_0x53b922['shift']());}}}(a150_0x47f7,0xe0182));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a150_0x47f7(){const _0x3e6150=['481630ZTFZYf','\x20not\x20in\x20role\x20','78150FTtnYe','475MaHdwm','9080fPVPYE','\x20from\x20role\x20','userId','6CVTDDP','user-remove','1331396SMmqsI','4738283RLdCNw','Removed\x20user\x20','No\x20change:\x20user\x20','appCode','selector','POST','21969RAXlGn','64127557mARqAT','6710MuIucm','high-risk-write','12eMbAhQ','12emyhmY','roleName','role','7826qwDnmD'];a150_0x47f7=function(){return _0x3e6150;};return a150_0x47f7();}import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':a150_0x574f44(0xdd),'command':a150_0x574f44(0xe7),'description':'Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a150_0x574f44(0xd9),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0xc27be){const _0x443436=a150_0x574f44,{mutation:_0xdee089}=await prepareUserMutation(_0xc27be,'user-remove',!![]);return asDryRunResult(_0xdee089,{'method':_0x443436(0xd5),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x1ad9a1){const _0x18f74c=a150_0x574f44,{roleList:_0x4c8aed,mutation:_0x313389,changed:_0x464843}=await prepareUserMutation(_0x1ad9a1,_0x18f74c(0xe7),![]);return _0x464843&&await updateRoleUsers(_0x1ad9a1[_0x18f74c(0xec)],_0x4c8aed),{'ok':!![],'data':_0x313389,'message':_0x464843?_0x18f74c(0xea)+_0x313389['selector'][_0x18f74c(0xe5)]+_0x18f74c(0xe4)+_0x313389['selector'][_0x18f74c(0xdc)]:_0x18f74c(0xeb)+_0x313389[_0x18f74c(0xd4)][_0x18f74c(0xe5)]+_0x18f74c(0xe0)+_0x313389['selector'][_0x18f74c(0xdc)]};}};
1
+ const a152_0x17d05f=a152_0x2c3a;(function(_0x34b380,_0x1e0f14){const _0x457594=a152_0x2c3a,_0x46103b=_0x34b380();while(!![]){try{const _0x1326d2=-parseInt(_0x457594(0x188))/0x1+parseInt(_0x457594(0x189))/0x2*(-parseInt(_0x457594(0x18e))/0x3)+parseInt(_0x457594(0x17c))/0x4*(parseInt(_0x457594(0x180))/0x5)+-parseInt(_0x457594(0x17f))/0x6+parseInt(_0x457594(0x18a))/0x7*(-parseInt(_0x457594(0x18c))/0x8)+parseInt(_0x457594(0x186))/0x9+parseInt(_0x457594(0x17b))/0xa*(parseInt(_0x457594(0x183))/0xb);if(_0x1326d2===_0x1e0f14)break;else _0x46103b['push'](_0x46103b['shift']());}catch(_0x5f042c){_0x46103b['push'](_0x46103b['shift']());}}}(a152_0x4b02,0x67fcb));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a152_0x2c3a(_0x28dd4c,_0x1103e5){_0x28dd4c=_0x28dd4c-0x178;const _0x4b020c=a152_0x4b02();let _0x2c3a92=_0x4b020c[_0x28dd4c];return _0x2c3a92;}function a152_0x4b02(){const _0x478a60=['696464oRPutX','user-remove','3AKVtDt','No\x20change:\x20user\x20','selector','appCode','17927390QvtKvU','8gPeKdO','role','Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','2132814RDzLne','748730NYoMjz','\x20from\x20role\x20','high-risk-write','11dDZGgm','Removed\x20user\x20','POST','3931128zIJenj','roleName','699238JpiAyC','877958jIkHQC','49cQkuAx','userId'];a152_0x4b02=function(){return _0x478a60;};return a152_0x4b02();}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_0x17d05f(0x17d),'command':a152_0x17d05f(0x18d),'description':a152_0x17d05f(0x17e),'risk':a152_0x17d05f(0x182),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x4a3e66){const _0x5d9765=a152_0x17d05f,{mutation:_0x273ca3}=await prepareUserMutation(_0x4a3e66,_0x5d9765(0x18d),!![]);return asDryRunResult(_0x273ca3,{'method':_0x5d9765(0x185),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x4fd6cd){const _0x456bdd=a152_0x17d05f,{roleList:_0x5cf698,mutation:_0x3a2ee7,changed:_0x579628}=await prepareUserMutation(_0x4fd6cd,_0x456bdd(0x18d),![]);return _0x579628&&await updateRoleUsers(_0x4fd6cd[_0x456bdd(0x17a)],_0x5cf698),{'ok':!![],'data':_0x3a2ee7,'message':_0x579628?_0x456bdd(0x184)+_0x3a2ee7['selector'][_0x456bdd(0x18b)]+_0x456bdd(0x181)+_0x3a2ee7[_0x456bdd(0x179)][_0x456bdd(0x187)]:_0x456bdd(0x178)+_0x3a2ee7['selector'][_0x456bdd(0x18b)]+'\x20not\x20in\x20role\x20'+_0x3a2ee7['selector'][_0x456bdd(0x187)]};}};
@@ -1 +1 @@
1
- const a151_0x384cca=a151_0x5429;(function(_0x725c77,_0x2f4333){const _0x44d3fa=a151_0x5429,_0x2d81f3=_0x725c77();while(!![]){try{const _0x3db02e=-parseInt(_0x44d3fa(0xdd))/0x1*(-parseInt(_0x44d3fa(0xcc))/0x2)+parseInt(_0x44d3fa(0xd8))/0x3+-parseInt(_0x44d3fa(0xd1))/0x4+parseInt(_0x44d3fa(0xd3))/0x5*(parseInt(_0x44d3fa(0xd2))/0x6)+parseInt(_0x44d3fa(0xda))/0x7*(parseInt(_0x44d3fa(0xe0))/0x8)+parseInt(_0x44d3fa(0xdc))/0x9+parseInt(_0x44d3fa(0xcd))/0xa*(-parseInt(_0x44d3fa(0xde))/0xb);if(_0x3db02e===_0x2f4333)break;else _0x2d81f3['push'](_0x2d81f3['shift']());}catch(_0x572d10){_0x2d81f3['push'](_0x2d81f3['shift']());}}}(a151_0x13dc,0x9ac14));import{CliErrors}from'../../errors.js';function a151_0x5429(_0xa1da59,_0x29f603){_0xa1da59=_0xa1da59-0xca;const _0x13dc34=a151_0x13dc();let _0x54295a=_0x13dc34[_0xa1da59];return _0x54295a;}function a151_0x13dc(){const _0x22a470=['530yRSDYV','Resolved\x20\x22','Pass\x20--name\x20<nickname|username>.','userId','3491696quyhfi','58020fANRrw','545YxkIHz','username','user-resolve','matchedBy','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','2484162YjFehN','flagMissing','133gStcjS','str','5865165lNROPL','2077WizMZG','414722QnIyji','trim','46888NEaGct','nickname','name','\x22\x20→\x20userId\x20','828GcURdn'];a151_0x13dc=function(){return _0x22a470;};return a151_0x13dc();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':'role','command':a151_0x384cca(0xd5),'description':a151_0x384cca(0xd7),'risk':'read','flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x25b6b2){const _0x5c4453=a151_0x384cca;if(!_0x25b6b2['str'](_0x5c4453(0xca))[_0x5c4453(0xdf)]())throw CliErrors[_0x5c4453(0xd9)](_0x5c4453(0xca),_0x5c4453(0xcf));},async 'execute'(_0x597c6e){const _0x2b7d82=a151_0x384cca,_0x3b9a11=_0x597c6e[_0x2b7d82(0xdb)](_0x2b7d82(0xca))['trim'](),_0x237296=await resolveUserRef(_0x3b9a11);return{'ok':!![],'data':{'user':{'userId':_0x237296['userId'],'username':_0x237296[_0x2b7d82(0xd4)],'nickname':_0x237296[_0x2b7d82(0xe1)],'matchedBy':_0x237296[_0x2b7d82(0xd6)]}},'message':_0x2b7d82(0xce)+_0x3b9a11+_0x2b7d82(0xcb)+_0x237296[_0x2b7d82(0xd0)]};}};
1
+ function a153_0x2c4e(_0x503f91,_0x2df27f){_0x503f91=_0x503f91-0x1eb;const _0x163985=a153_0x1639();let _0x2c4ec2=_0x163985[_0x503f91];return _0x2c4ec2;}const a153_0x1d44ba=a153_0x2c4e;(function(_0x22f4cc,_0x381302){const _0x6afc7d=a153_0x2c4e,_0x14d505=_0x22f4cc();while(!![]){try{const _0x12e27e=parseInt(_0x6afc7d(0x1fa))/0x1*(parseInt(_0x6afc7d(0x1eb))/0x2)+parseInt(_0x6afc7d(0x1ec))/0x3*(-parseInt(_0x6afc7d(0x1fb))/0x4)+-parseInt(_0x6afc7d(0x1ed))/0x5+-parseInt(_0x6afc7d(0x1fc))/0x6+-parseInt(_0x6afc7d(0x1f1))/0x7+parseInt(_0x6afc7d(0x1fe))/0x8+parseInt(_0x6afc7d(0x1f8))/0x9;if(_0x12e27e===_0x381302)break;else _0x14d505['push'](_0x14d505['shift']());}catch(_0x5f33a6){_0x14d505['push'](_0x14d505['shift']());}}}(a153_0x1639,0x7bf15));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a153_0x1639(){const _0x102c55=['Pass\x20--name\x20<nickname|username>.','name','role','nickname','4686147fIZztw','userId','31244CntvKV','16260lSNezW','1824954IRTBoR','matchedBy','1206128PeEbVD','46NUeIOU','9lVMEII','1789730ykJqZq','str','trim','\x22\x20→\x20userId\x20','1456644BHCPvM','username','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)'];a153_0x1639=function(){return _0x102c55;};return a153_0x1639();}import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a153_0x1d44ba(0x1f6),'command':'user-resolve','description':a153_0x1d44ba(0x1f3),'risk':'read','flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4c2da1){const _0x296408=a153_0x1d44ba;if(!_0x4c2da1[_0x296408(0x1ee)](_0x296408(0x1f5))['trim']())throw CliErrors['flagMissing'](_0x296408(0x1f5),_0x296408(0x1f4));},async 'execute'(_0x210b50){const _0x56aeef=a153_0x1d44ba,_0x15add1=_0x210b50['str'](_0x56aeef(0x1f5))[_0x56aeef(0x1ef)](),_0x241b96=await resolveUserRef(_0x15add1);return{'ok':!![],'data':{'user':{'userId':_0x241b96[_0x56aeef(0x1f9)],'username':_0x241b96[_0x56aeef(0x1f2)],'nickname':_0x241b96[_0x56aeef(0x1f7)],'matchedBy':_0x241b96[_0x56aeef(0x1fd)]}},'message':'Resolved\x20\x22'+_0x15add1+_0x56aeef(0x1f0)+_0x241b96['userId']};}};
@@ -1 +1 @@
1
- const a152_0x2db26=a152_0x14c0;(function(_0x30b1ac,_0x76b632){const _0x3d9f59=a152_0x14c0,_0x216f32=_0x30b1ac();while(!![]){try{const _0xfbc11f=-parseInt(_0x3d9f59(0x126))/0x1*(-parseInt(_0x3d9f59(0x131))/0x2)+parseInt(_0x3d9f59(0x10f))/0x3*(parseInt(_0x3d9f59(0x13a))/0x4)+-parseInt(_0x3d9f59(0x115))/0x5+parseInt(_0x3d9f59(0x10b))/0x6*(parseInt(_0x3d9f59(0x109))/0x7)+-parseInt(_0x3d9f59(0x13f))/0x8+parseInt(_0x3d9f59(0x124))/0x9+-parseInt(_0x3d9f59(0x125))/0xa*(parseInt(_0x3d9f59(0x121))/0xb);if(_0xfbc11f===_0x76b632)break;else _0x216f32['push'](_0x216f32['shift']());}catch(_0x2f82da){_0x216f32['push'](_0x216f32['shift']());}}}(a152_0x4828,0xf2953));import{readFileSync,existsSync}from'node:fs';function a152_0x14c0(_0x18e6be,_0x35c094){_0x18e6be=_0x18e6be-0x107;const _0x482853=a152_0x4828();let _0x14c0e5=_0x482853[_0x18e6be];return _0x14c0e5;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a152_0x2db26(0x13d),a152_0x2db26(0x114)]);function readPackageScripts(_0x1871da){const _0x1af047=a152_0x2db26,_0x2251ba=resolve(_0x1871da,'package.json');if(!existsSync(_0x2251ba))return null;try{const _0x2ac03a=JSON[_0x1af047(0x12a)](readFileSync(_0x2251ba,_0x1af047(0x117)));return _0x2ac03a['scripts']??{};}catch{return null;}}function detectPackageManager(_0x22f697){const _0x3f5fd7=a152_0x2db26;if(existsSync(resolve(_0x22f697,_0x3f5fd7(0x108)))||existsSync(resolve(_0x22f697,_0x3f5fd7(0x144))))return _0x3f5fd7(0x11b);if(existsSync(resolve(_0x22f697,_0x3f5fd7(0x133))))return _0x3f5fd7(0x143);if(existsSync(resolve(_0x22f697,'yarn.lock')))return _0x3f5fd7(0x11d);return _0x3f5fd7(0x13e);}async function versionCheck(_0x240821){const _0x3724b9=a152_0x2db26,_0xc5c60d=await checkCliVersion();(_0xc5c60d[_0x3724b9(0x137)]||_0xc5c60d[_0x3724b9(0x142)])&&(printCliUpgradeWarning(_0xc5c60d),assertCliVersionSupported(_0xc5c60d));const _0x4b6228=await checkSdkVersion(_0x240821);if(_0x4b6228['needsUpgrade'])printSdkUpgradeWarning(_0x4b6228);}function a152_0x4828(){const _0x37e394=['21mfLYju','script','length','(none)','keys','dev','5193230sEcCDQ','\x20run\x20preview','utf-8','error','bool','close','bun','log','yarn','No\x20scripts\x20defined\x20in\x20package.json.','has','Available:\x20','11Ofyxyl','\x20run\x20build','\x0a\x20\x20Usage:\x20','14174406nJDxPd','5132230seknEt','1187197RANClL','run','read','preview','parse','.bin','No\x20package.json\x20found\x20in\x20current\x20directory.','slice','Script\x20\x22','vite','build','2dQIUwz','args','pnpm-lock.yaml','watch','Script\x20name\x20defined\x20in\x20package.json','boolean','needsUpgrade','Run\x20a\x20package.json\x20script','\x20run\x20<script>\x0a','154524XKSpPs','all','\x20exited\x20with\x20code\x20','start','npm','12768960MdVpcC','\x20run\x20start','\x20run\x20','belowMinimum','pnpm','bun.lock','\x20run\x20preview\x20--watch','\x20\x20\x20\x20','node_modules','join','inherit','validation','push','\x0a\x20\x20Available\x20scripts:\x0a','--watch','bun.lockb','168770dptoBm','cwd','276xjScYN','vite\x20preview\x20exited\x20with\x20code\x20','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','Enable\x20watch\x20mode\x20for\x20preview'];a152_0x4828=function(){return _0x37e394;};return a152_0x4828();}function spawnScript(_0x22ebaa,_0x349f18,_0x5daf12,_0x5f97fa){return new Promise((_0x48208d,_0x3a0102)=>{const _0xfdb8bb=a152_0x14c0,_0x3cd759=[_0xfdb8bb(0x127),_0x349f18,..._0x5daf12],_0x2360d3=spawn(_0x22ebaa,_0x3cd759,{'cwd':_0x5f97fa,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x5f97fa,_0xfdb8bb(0x147),_0xfdb8bb(0x12b))+delimiter+process.env.PATH}});_0x2360d3['on'](_0xfdb8bb(0x11a),_0x1dffeb=>{const _0x1f6bee=_0xfdb8bb;if(_0x1dffeb===0x0||_0x1dffeb===null)_0x48208d();else _0x3a0102(new Error(_0x22ebaa+_0x1f6bee(0x141)+_0x349f18+_0x1f6bee(0x13c)+_0x1dffeb));}),_0x2360d3['on']('error',_0x3a0102);});}function spawnViteBuildWatch(_0xb57963){return new Promise((_0x2166a0,_0x38846c)=>{const _0x5d00ad=a152_0x14c0,_0x2ba976=spawn(_0x5d00ad(0x12f),[_0x5d00ad(0x130),_0x5d00ad(0x107)],{'cwd':_0xb57963,'stdio':_0x5d00ad(0x149),'shell':!![],'env':{...process.env,'PATH':''+join(_0xb57963,_0x5d00ad(0x147),_0x5d00ad(0x12b))+delimiter+process.env.PATH}});_0x2ba976['on']('close',_0x55cb9f=>{const _0x510573=_0x5d00ad;if(_0x55cb9f===0x0||_0x55cb9f===null)_0x2166a0();else _0x38846c(new Error(_0x510573(0x10d)+_0x55cb9f));}),_0x2ba976['on'](_0x5d00ad(0x118),_0x38846c);});}function spawnVitePreview(_0x24aedb){return new Promise((_0x590867,_0x11c939)=>{const _0x49fbfc=a152_0x14c0,_0x4b7916=spawn('vite',[_0x49fbfc(0x129)],{'cwd':_0x24aedb,'stdio':_0x49fbfc(0x149),'shell':!![],'env':{...process.env,'PATH':''+join(_0x24aedb,_0x49fbfc(0x147),_0x49fbfc(0x12b))+delimiter+process.env.PATH}});_0x4b7916['on'](_0x49fbfc(0x11a),_0x3fa229=>{const _0x1b2c44=_0x49fbfc;if(_0x3fa229===0x0||_0x3fa229===null)_0x590867();else _0x11c939(new Error(_0x1b2c44(0x10c)+_0x3fa229));}),_0x4b7916['on'](_0x49fbfc(0x118),_0x11c939);});}const runFlags=[{'name':a152_0x2db26(0x134),'type':a152_0x2db26(0x136),'description':a152_0x2db26(0x10e),'default':![]}];export const runDefinition={'service':'run','command':'run','description':a152_0x2db26(0x138),'risk':a152_0x2db26(0x128),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a152_0x2db26(0x110),'description':a152_0x2db26(0x135),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x4999f6=a152_0x2db26,_0x5a8d13=[];return _0x5a8d13[_0x4999f6(0x14b)]('\x20\x20EXAMPLES'),_0x5a8d13[_0x4999f6(0x14b)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x4999f6(0x140)),_0x5a8d13['push'](_0x4999f6(0x146)+CLI_BIN_NAME+_0x4999f6(0x122)),_0x5a8d13[_0x4999f6(0x14b)](_0x4999f6(0x146)+CLI_BIN_NAME+_0x4999f6(0x116)),_0x5a8d13[_0x4999f6(0x14b)](_0x4999f6(0x146)+CLI_BIN_NAME+_0x4999f6(0x145)),_0x5a8d13[_0x4999f6(0x148)]('\x0a');},async 'execute'(_0x11c3eb){const _0x4abbd8=a152_0x2db26,_0x4e7167=process[_0x4abbd8(0x10a)](),_0x3b2633=_0x11c3eb[_0x4abbd8(0x132)][0x0],_0x1d2fe5=_0x11c3eb['args'][_0x4abbd8(0x12d)](0x1),_0x26b0c8=readPackageScripts(_0x4e7167);if(!_0x26b0c8)throw CliErrors[_0x4abbd8(0x14a)](_0x4abbd8(0x12c));if(!_0x3b2633){const _0x32546e=Object[_0x4abbd8(0x113)](_0x26b0c8);if(_0x32546e[_0x4abbd8(0x111)]===0x0)console[_0x4abbd8(0x11c)](_0x4abbd8(0x11e));else{console[_0x4abbd8(0x11c)](_0x4abbd8(0x14c));for(const _0x4fbcf8 of _0x32546e){console[_0x4abbd8(0x11c)](_0x4abbd8(0x146)+_0x4fbcf8);}console['log'](_0x4abbd8(0x123)+CLI_BIN_NAME+_0x4abbd8(0x139));}return{'ok':!![]};}if(!_0x26b0c8[_0x3b2633])throw CliErrors['validation'](_0x4abbd8(0x12e)+_0x3b2633+'\x22\x20not\x20found\x20in\x20package.json.',_0x4abbd8(0x120)+(Object[_0x4abbd8(0x113)](_0x26b0c8)[_0x4abbd8(0x148)](',\x20')||_0x4abbd8(0x112)));const _0x5e39ae=detectPackageManager(_0x4e7167);VERSION_CHECK_SCRIPTS[_0x4abbd8(0x11f)](_0x3b2633)&&await versionCheck(_0x4e7167);if(_0x3b2633===_0x4abbd8(0x129)&&_0x11c3eb[_0x4abbd8(0x119)]('watch'))return await Promise[_0x4abbd8(0x13b)]([spawnViteBuildWatch(_0x4e7167),spawnVitePreview(_0x4e7167)]),{'ok':!![]};return await spawnScript(_0x5e39ae,_0x3b2633,_0x1d2fe5,_0x4e7167),{'ok':!![]};}};
1
+ const a154_0x2ffd3c=a154_0x30bf;(function(_0x4287e0,_0x324652){const _0x4d1986=a154_0x30bf,_0x3298ff=_0x4287e0();while(!![]){try{const _0x4747bf=-parseInt(_0x4d1986(0x1e3))/0x1*(-parseInt(_0x4d1986(0x1dc))/0x2)+parseInt(_0x4d1986(0x1e9))/0x3*(-parseInt(_0x4d1986(0x1c0))/0x4)+parseInt(_0x4d1986(0x1e8))/0x5+-parseInt(_0x4d1986(0x1cc))/0x6*(-parseInt(_0x4d1986(0x1bc))/0x7)+parseInt(_0x4d1986(0x1f3))/0x8+-parseInt(_0x4d1986(0x1de))/0x9+parseInt(_0x4d1986(0x1f0))/0xa*(parseInt(_0x4d1986(0x1d8))/0xb);if(_0x4747bf===_0x324652)break;else _0x3298ff['push'](_0x3298ff['shift']());}catch(_0x5a973d){_0x3298ff['push'](_0x3298ff['shift']());}}}(a154_0x5f2b,0xdcb49));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';function a154_0x5f2b(){const _0x4d7562=['keys','--watch','11090iTZjiZ','(none)','Script\x20name\x20defined\x20in\x20package.json','3237592eKgrpA','push','bun.lock','\x20exited\x20with\x20code\x20','No\x20scripts\x20defined\x20in\x20package.json.','validation','511hPYcMU','build','belowMinimum','dev','340AdRGHA','node_modules','\x0a\x20\x20Usage:\x20','bun','pnpm','npm','.bin','Script\x20\x22','bool','yarn.lock','cwd','join','118518dbWoKU','log','preview','parse','error','close','args','start','pnpm-lock.yaml','No\x20package.json\x20found\x20in\x20current\x20directory.','has','vite','2123fLHMGn','read','all','\x20run\x20build','4QOTsaE','inherit','15598512RXFppc','watch','\x0a\x20\x20Available\x20scripts:\x0a','needsUpgrade','utf-8','217351gdcGzb','\x20run\x20start','Enable\x20watch\x20mode\x20for\x20preview','boolean','\x20\x20EXAMPLES','6508825SEKTrB','40941OYLhOK','script','package.json','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','\x20\x20\x20\x20'];a154_0x5f2b=function(){return _0x4d7562;};return a154_0x5f2b();}import{CliErrors}from'../../errors.js';function a154_0x30bf(_0x1cc443,_0x408fc0){_0x1cc443=_0x1cc443-0x1bb;const _0x5f2b18=a154_0x5f2b();let _0x30bf31=_0x5f2b18[_0x1cc443];return _0x30bf31;}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_0x2ffd3c(0x1d3),a154_0x2ffd3c(0x1bf)]);function readPackageScripts(_0x52afb2){const _0x1cc9e1=a154_0x2ffd3c,_0x181aef=resolve(_0x52afb2,_0x1cc9e1(0x1eb));if(!existsSync(_0x181aef))return null;try{const _0x4a8fb2=JSON[_0x1cc9e1(0x1cf)](readFileSync(_0x181aef,_0x1cc9e1(0x1e2)));return _0x4a8fb2['scripts']??{};}catch{return null;}}function detectPackageManager(_0x49bbbc){const _0x3fca49=a154_0x2ffd3c;if(existsSync(resolve(_0x49bbbc,'bun.lockb'))||existsSync(resolve(_0x49bbbc,_0x3fca49(0x1f5))))return _0x3fca49(0x1c3);if(existsSync(resolve(_0x49bbbc,_0x3fca49(0x1d4))))return _0x3fca49(0x1c4);if(existsSync(resolve(_0x49bbbc,_0x3fca49(0x1c9))))return'yarn';return _0x3fca49(0x1c5);}async function versionCheck(_0x4e64af){const _0x52bb46=a154_0x2ffd3c,_0x2884e9=await checkCliVersion();(_0x2884e9['needsUpgrade']||_0x2884e9[_0x52bb46(0x1be)])&&(printCliUpgradeWarning(_0x2884e9),assertCliVersionSupported(_0x2884e9));const _0x28ec80=await checkSdkVersion(_0x4e64af);if(_0x28ec80[_0x52bb46(0x1e1)])printSdkUpgradeWarning(_0x28ec80);}function spawnScript(_0x23ff58,_0x51acf3,_0x461780,_0xe32980){return new Promise((_0x492fd2,_0x38c659)=>{const _0x273fe8=a154_0x30bf,_0x3289e1=['run',_0x51acf3,..._0x461780],_0x5922a9=spawn(_0x23ff58,_0x3289e1,{'cwd':_0xe32980,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0xe32980,'node_modules',_0x273fe8(0x1c6))+delimiter+process.env.PATH}});_0x5922a9['on']('close',_0x4f6293=>{const _0x38a4ae=_0x273fe8;if(_0x4f6293===0x0||_0x4f6293===null)_0x492fd2();else _0x38c659(new Error(_0x23ff58+'\x20run\x20'+_0x51acf3+_0x38a4ae(0x1f6)+_0x4f6293));}),_0x5922a9['on'](_0x273fe8(0x1d0),_0x38c659);});}function spawnViteBuildWatch(_0x3285e4){return new Promise((_0x14abd2,_0x4dbf2b)=>{const _0xe09d98=a154_0x30bf,_0xdcf300=spawn(_0xe09d98(0x1d7),[_0xe09d98(0x1bd),_0xe09d98(0x1ef)],{'cwd':_0x3285e4,'stdio':_0xe09d98(0x1dd),'shell':!![],'env':{...process.env,'PATH':''+join(_0x3285e4,'node_modules',_0xe09d98(0x1c6))+delimiter+process.env.PATH}});_0xdcf300['on']('close',_0x4105fd=>{const _0x53d24c=_0xe09d98;if(_0x4105fd===0x0||_0x4105fd===null)_0x14abd2();else _0x4dbf2b(new Error(_0x53d24c(0x1ec)+_0x4105fd));}),_0xdcf300['on'](_0xe09d98(0x1d0),_0x4dbf2b);});}function spawnVitePreview(_0x47c9dd){return new Promise((_0xfea3d9,_0xc448bd)=>{const _0x894ca0=a154_0x30bf,_0x509f85=spawn(_0x894ca0(0x1d7),[_0x894ca0(0x1ce)],{'cwd':_0x47c9dd,'stdio':_0x894ca0(0x1dd),'shell':!![],'env':{...process.env,'PATH':''+join(_0x47c9dd,_0x894ca0(0x1c1),_0x894ca0(0x1c6))+delimiter+process.env.PATH}});_0x509f85['on'](_0x894ca0(0x1d1),_0x415d41=>{if(_0x415d41===0x0||_0x415d41===null)_0xfea3d9();else _0xc448bd(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x415d41));}),_0x509f85['on'](_0x894ca0(0x1d0),_0xc448bd);});}const runFlags=[{'name':'watch','type':a154_0x2ffd3c(0x1e6),'description':a154_0x2ffd3c(0x1e5),'default':![]}];export const runDefinition={'service':'run','command':'run','description':'Run\x20a\x20package.json\x20script','risk':a154_0x2ffd3c(0x1d9),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a154_0x2ffd3c(0x1ea),'description':a154_0x2ffd3c(0x1f2),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x4faf9d=a154_0x2ffd3c,_0x1c923d=[];return _0x1c923d[_0x4faf9d(0x1f4)](_0x4faf9d(0x1e7)),_0x1c923d[_0x4faf9d(0x1f4)](_0x4faf9d(0x1ed)+CLI_BIN_NAME+_0x4faf9d(0x1e4)),_0x1c923d[_0x4faf9d(0x1f4)](_0x4faf9d(0x1ed)+CLI_BIN_NAME+_0x4faf9d(0x1db)),_0x1c923d[_0x4faf9d(0x1f4)](_0x4faf9d(0x1ed)+CLI_BIN_NAME+'\x20run\x20preview'),_0x1c923d[_0x4faf9d(0x1f4)](_0x4faf9d(0x1ed)+CLI_BIN_NAME+'\x20run\x20preview\x20--watch'),_0x1c923d[_0x4faf9d(0x1cb)]('\x0a');},async 'execute'(_0x222955){const _0x29e27f=a154_0x2ffd3c,_0x430152=process[_0x29e27f(0x1ca)](),_0x449b13=_0x222955[_0x29e27f(0x1d2)][0x0],_0x1e854e=_0x222955[_0x29e27f(0x1d2)]['slice'](0x1),_0x23af05=readPackageScripts(_0x430152);if(!_0x23af05)throw CliErrors[_0x29e27f(0x1bb)](_0x29e27f(0x1d5));if(!_0x449b13){const _0xc5b119=Object[_0x29e27f(0x1ee)](_0x23af05);if(_0xc5b119['length']===0x0)console[_0x29e27f(0x1cd)](_0x29e27f(0x1f7));else{console[_0x29e27f(0x1cd)](_0x29e27f(0x1e0));for(const _0x1f35a5 of _0xc5b119){console[_0x29e27f(0x1cd)](_0x29e27f(0x1ed)+_0x1f35a5);}console['log'](_0x29e27f(0x1c2)+CLI_BIN_NAME+'\x20run\x20<script>\x0a');}return{'ok':!![]};}if(!_0x23af05[_0x449b13])throw CliErrors['validation'](_0x29e27f(0x1c7)+_0x449b13+'\x22\x20not\x20found\x20in\x20package.json.','Available:\x20'+(Object[_0x29e27f(0x1ee)](_0x23af05)[_0x29e27f(0x1cb)](',\x20')||_0x29e27f(0x1f1)));const _0x439dae=detectPackageManager(_0x430152);VERSION_CHECK_SCRIPTS[_0x29e27f(0x1d6)](_0x449b13)&&await versionCheck(_0x430152);if(_0x449b13==='preview'&&_0x222955[_0x29e27f(0x1c8)](_0x29e27f(0x1df)))return await Promise[_0x29e27f(0x1da)]([spawnViteBuildWatch(_0x430152),spawnVitePreview(_0x430152)]),{'ok':!![]};return await spawnScript(_0x439dae,_0x449b13,_0x1e854e,_0x430152),{'ok':!![]};}};
@@ -1 +1 @@
1
- const a153_0x439f15=a153_0x3cbb;(function(_0x1069e4,_0x27ac12){const _0x3dd3e0=a153_0x3cbb,_0x392804=_0x1069e4();while(!![]){try{const _0x422295=-parseInt(_0x3dd3e0(0xe8))/0x1*(-parseInt(_0x3dd3e0(0xe7))/0x2)+-parseInt(_0x3dd3e0(0xe1))/0x3*(parseInt(_0x3dd3e0(0xe6))/0x4)+parseInt(_0x3dd3e0(0xdb))/0x5+parseInt(_0x3dd3e0(0xe4))/0x6+-parseInt(_0x3dd3e0(0xdd))/0x7*(parseInt(_0x3dd3e0(0xde))/0x8)+parseInt(_0x3dd3e0(0xe0))/0x9+-parseInt(_0x3dd3e0(0xdf))/0xa;if(_0x422295===_0x27ac12)break;else _0x392804['push'](_0x392804['shift']());}catch(_0x26ab4c){_0x392804['push'](_0x392804['shift']());}}}(a153_0xc033,0x2add4));import{buildSchemaPayload}from'../framework/schema-export.js';function a153_0x3cbb(_0x235582,_0x1391f0){_0x235582=_0x235582-0xdb;const _0xc0333f=a153_0xc033();let _0x3cbba9=_0xc0333f[_0x235582];return _0x3cbba9;}async function execute(_0x2238a6){const _0x189278=await buildSchemaPayload();return{'ok':!![],'data':_0x189278};}function a153_0xc033(){const _0x2f92b3=['read','1766352qhcwCx','schema','12ZNAsHp','2FXGhjM','246784tjBFuE','1445795BeXEkS','Export\x20machine-readable\x20command\x20schema\x20(JSON)','402843OCGhcU','24gJoBoH','5679730yENIxw','1447902tDoYfq','75021BpArlR','json'];a153_0xc033=function(){return _0x2f92b3;};return a153_0xc033();}export const schemaDefinition={'service':a153_0x439f15(0xe5),'command':'export','description':a153_0x439f15(0xdc),'risk':a153_0x439f15(0xe3),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a153_0x439f15(0xe2),'flags':[],'execute':execute};
1
+ const a155_0x733e23=a155_0xa8f8;(function(_0x1fd064,_0x295893){const _0x35028c=a155_0xa8f8,_0x1f5a7b=_0x1fd064();while(!![]){try{const _0x1a1c11=-parseInt(_0x35028c(0xc4))/0x1+parseInt(_0x35028c(0xc9))/0x2*(parseInt(_0x35028c(0xc8))/0x3)+-parseInt(_0x35028c(0xc6))/0x4*(-parseInt(_0x35028c(0xc1))/0x5)+parseInt(_0x35028c(0xbd))/0x6+parseInt(_0x35028c(0xc3))/0x7*(-parseInt(_0x35028c(0xbf))/0x8)+-parseInt(_0x35028c(0xc2))/0x9+parseInt(_0x35028c(0xc0))/0xa*(parseInt(_0x35028c(0xca))/0xb);if(_0x1a1c11===_0x295893)break;else _0x1f5a7b['push'](_0x1f5a7b['shift']());}catch(_0xbef6f9){_0x1f5a7b['push'](_0x1f5a7b['shift']());}}}(a155_0x11a2,0xb7e37));function a155_0xa8f8(_0x32639a,_0x386c90){_0x32639a=_0x32639a-0xbc;const _0x11a28d=a155_0x11a2();let _0xa8f8d4=_0x11a28d[_0x32639a];return _0xa8f8d4;}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x561167){const _0x43edcb=await buildSchemaPayload();return{'ok':!![],'data':_0x43edcb};}export const schemaDefinition={'service':a155_0x733e23(0xc5),'command':'export','description':a155_0x733e23(0xc7),'risk':a155_0x733e23(0xbe),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a155_0x733e23(0xbc),'flags':[],'execute':execute};function a155_0x11a2(){const _0x32508d=['json','182004HObPhp','read','121256DGefKi','40guuaAz','5IvhFqX','7251786gCMkJT','490bPVPnA','344713dPCMTE','schema','2059952Yjtmmk','Export\x20machine-readable\x20command\x20schema\x20(JSON)','3173970znmIbR','2qpwwLU','3743718zeSEpr'];a155_0x11a2=function(){return _0x32508d;};return a155_0x11a2();}
@@ -1 +1 @@
1
- const a154_0x157fd8=a154_0x5587;(function(_0x588dd0,_0x329d63){const _0x20a8a4=a154_0x5587,_0x2927f8=_0x588dd0();while(!![]){try{const _0x298708=-parseInt(_0x20a8a4(0x11b))/0x1+parseInt(_0x20a8a4(0x102))/0x2*(-parseInt(_0x20a8a4(0xf8))/0x3)+parseInt(_0x20a8a4(0x111))/0x4+parseInt(_0x20a8a4(0xff))/0x5+parseInt(_0x20a8a4(0x10a))/0x6*(-parseInt(_0x20a8a4(0xf6))/0x7)+-parseInt(_0x20a8a4(0xfe))/0x8+parseInt(_0x20a8a4(0x119))/0x9;if(_0x298708===_0x329d63)break;else _0x2927f8['push'](_0x2927f8['shift']());}catch(_0x57e2b2){_0x2927f8['push'](_0x2927f8['shift']());}}}(a154_0x18dd,0xaf58a));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';function a154_0x5587(_0x470e8e,_0x151cbf){_0x470e8e=_0x470e8e-0xf2;const _0x18dda6=a154_0x18dd();let _0x55873d=_0x18dda6[_0x470e8e];return _0x55873d;}import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';function a154_0x18dd(){const _0x215a85=['mode','Invalid\x20database\x20selection\x20payload:\x20','sqlName','description','trim','SQL\x20query\x20display\x20name','12800529JRTvZc','普通\x20SQL(sql)','166614OIVPxy','dbId','high-risk-write','isFinite','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','flagMissing','dbName','sqlCode','请选择本地\x20SQL\x20模式:','length','catch','sqlRoot','map','/smartapi/custom/saveUserCustomSql','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','mybatisXml','Local\x20SQL\x20file\x20mode','sql','lastSync','validation','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','__manual__','dbId\x20必须为正整数','File\x20already\x20exists:\x20','请输入\x20SQL\x20名称:','请选择目标数据库:','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','<server-generated-sqlCode>','POST','nonInteractive','Created\x20SQL\x20query\x20','SQL\x20名称不能为空','6293UqnkUf','utf8','3Lfnphj','SELECT\x201\x20AS\x20id;','dbId\x20不能为空','lockFilePath','MyBatis\x20XML(mybatisXml)','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','7993072LBsTdQ','2479680brWdyJ','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','适合带动态标签的\x20MyBatis\x20XML\x20SQL','232802yDmVkZ','number','str','db-id','string','new','sqlRootDir','✎\x20手动输入\x20dbId','2316Lzorzf','join','sqls','toISOString','name','isInteger','appCode','1716656mWdxbl','</select>'];a154_0x18dd=function(){return _0x215a85;};return a154_0x18dd();}import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x3b47b7){const _0x56bc8e=a154_0x5587;if(_0x3b47b7===_0x56bc8e(0x12a))return[_0x56bc8e(0x129),'\x20\x20SELECT\x201\x20AS\x20id',_0x56bc8e(0x112),''][_0x56bc8e(0x10b)]('\x0a');return[_0x56bc8e(0xf9),''][_0x56bc8e(0x10b)]('\x0a');}export const sqlCreate={'service':a154_0x157fd8(0x12c),'command':'create','description':'Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','risk':a154_0x157fd8(0x11d),'flags':[{'name':a154_0x157fd8(0x10e),'type':a154_0x157fd8(0x106),'description':a154_0x157fd8(0x118)},{'name':'db-id','type':'number','description':'Target\x20database\x20ID'},{'name':'mode','type':'string','enum':['sql','mybatisXml'],'description':a154_0x157fd8(0x12b)}],async 'validate'(_0x2d04bd){const _0x2b10d8=a154_0x157fd8;if(!_0x2d04bd[_0x2b10d8(0xf3)])return;if(!_0x2d04bd[_0x2b10d8(0x104)](_0x2b10d8(0x10e))[_0x2b10d8(0x117)]())throw CliErrors[_0x2b10d8(0x120)](_0x2b10d8(0x10e),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x3a079e=resolveProvidedDbId(_0x2d04bd);if(typeof _0x3a079e!=='number'||!Number[_0x2b10d8(0x11e)](_0x3a079e)||_0x3a079e<=0x0)throw CliErrors['flagMissing'](_0x2b10d8(0x105),_0x2b10d8(0x135));if(!_0x2d04bd['str'](_0x2b10d8(0x113))[_0x2b10d8(0x117)]())throw CliErrors[_0x2b10d8(0x120)]('mode',_0x2b10d8(0x12f));},async 'dryRun'(_0x5a7cad){const _0x3b6220=a154_0x157fd8,_0x137ed5=loadSqlProjectConfig(_0x5a7cad[_0x3b6220(0x110)]),{sqlName:_0x5c3bed,dbId:_0x59d3aa,dbName:_0x2c319f,mode:_0x40b509}=await resolveSqlNewInputs(_0x5a7cad),_0x2f061e=buildSqlRelativePath(_0x3b6220(0x136),_0x5c3bed,_0x2c319f,_0x40b509,_0x59d3aa),_0x5223cd=_0x137ed5[_0x3b6220(0x108)]+'/'+_0x2f061e;return{'method':_0x3b6220(0xf2),'url':_0x3b6220(0x128),'body':{'appCode':_0x5a7cad[_0x3b6220(0x110)],'sqlName':_0x5c3bed,'dbId':_0x59d3aa,'mode':_0x40b509,'localPath':_0x5223cd},'description':_0x3b6220(0x11f)+_0x137ed5[_0x3b6220(0x108)]};},async 'execute'(_0x19e64c){const _0x313ee3=a154_0x157fd8,_0xf5370=loadSqlProjectConfig(_0x19e64c['appCode']),{sqlName:_0x13dabd,dbId:_0x4fd21b,dbName:_0x4dd741,mode:_0x5d044c}=await resolveSqlNewInputs(_0x19e64c),_0x978e14=generateSqlTemplate(_0x5d044c),_0xdf8345=await createSqlQuery({'appCode':_0x19e64c[_0x313ee3(0x110)],'sqlName':_0x13dabd,'dbId':_0x4fd21b,'sqlContent':_0x978e14}),_0x20221a=ensureRemoteSqlContent(_0xdf8345),_0x2d6996=_0x4dd741||await getDbName(_0x19e64c[_0x313ee3(0x110)],_0x4fd21b)[_0x313ee3(0x125)](()=>undefined),_0x21c158=buildSqlRelativePath(_0xdf8345['sqlCode'],_0xdf8345[_0x313ee3(0x115)],_0x2d6996,_0x5d044c,_0x4fd21b),_0x32b715=_0xf5370[_0x313ee3(0x108)]+'/'+_0x21c158,_0x48ad3a=buildLocalSqlFileContent({'sqlCode':_0xdf8345['sqlCode'],'sqlName':_0xdf8345[_0x313ee3(0x115)],'dbId':_0xdf8345['dbId']},_0x20221a,{'dbName':_0x2d6996,'mode':_0x5d044c,'syncedAt':new Date()[_0x313ee3(0x10d)](),'description':_0xdf8345[_0x313ee3(0x116)]});if(await fileExists(_0x32b715))throw CliErrors[_0x313ee3(0x12e)](_0x313ee3(0x132)+_0x32b715);await ensureParentDirectory(_0x32b715),await writeFile(_0x32b715,_0x48ad3a,_0x313ee3(0xf7));const _0x13a539=await readSqlLockFile(_0xf5370[_0x313ee3(0xfb)]),{lockData:_0xd4c6a2,appLock:_0x58fd82}=ensureSqlLockScope(_0x13a539??createEmptySqlLock(),_0xf5370[_0x313ee3(0x110)],_0xf5370[_0x313ee3(0x126)],_0x313ee3(0x107));return _0x58fd82[_0x313ee3(0x10c)][_0xdf8345[_0x313ee3(0x122)]]={...buildSqlLockEntry(_0xdf8345,_0x20221a,computeSqlContentHash(_0x48ad3a),{'dbName':_0x2d6996}),'path':_0x21c158,'mode':_0x5d044c},_0x58fd82[_0x313ee3(0x12d)]=new Date()[_0x313ee3(0x10d)](),await writeSqlLockFile(_0xf5370[_0x313ee3(0xfb)],_0xd4c6a2),{'ok':!![],'data':{'id':_0xdf8345['id'],'sqlCode':_0xdf8345['sqlCode'],'sqlName':_0xdf8345[_0x313ee3(0x115)],'dbId':_0xdf8345[_0x313ee3(0x11c)],'path':_0x32b715,'mode':_0x5d044c},'message':_0x313ee3(0xf4)+_0xdf8345[_0x313ee3(0x122)]};}};async function resolveSqlNewInputs(_0x5c8be3){const _0x523254=await resolveSqlNameInput(_0x5c8be3),{dbId:_0x11fe8c,dbName:_0x2a0130}=await resolveDbSelection(_0x5c8be3),_0x398c70=await resolveSqlModeInput(_0x5c8be3);return{'sqlName':_0x523254,'dbId':_0x11fe8c,'dbName':_0x2a0130,'mode':_0x398c70};}async function resolveSqlNameInput(_0x325837){const _0x5c6ee9=a154_0x157fd8,_0x19c06f=_0x325837['str']('name')['trim']();if(_0x19c06f)return _0x19c06f;if(_0x325837[_0x5c6ee9(0xf3)])throw CliErrors[_0x5c6ee9(0x120)]('name',_0x5c6ee9(0x100));return(await input({'message':_0x5c6ee9(0x133),'validate':_0x28bf2d=>_0x28bf2d['trim']()?!![]:_0x5c6ee9(0xf5)}))['trim']();}async function resolveDbSelection(_0x3e636c){const _0x1e6244=a154_0x157fd8,_0x2c47f1=resolveProvidedDbId(_0x3e636c);if(typeof _0x2c47f1==='number'&&Number[_0x1e6244(0x11e)](_0x2c47f1)&&_0x2c47f1>0x0)return{'dbId':_0x2c47f1,'dbName':await getDbName(_0x3e636c[_0x1e6244(0x110)],_0x2c47f1)[_0x1e6244(0x125)](()=>undefined)};if(_0x3e636c['nonInteractive'])throw CliErrors[_0x1e6244(0x120)]('db-id','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x12658a=await listDatabases(_0x3e636c[_0x1e6244(0x110)])[_0x1e6244(0x125)](()=>[]);if(_0x12658a[_0x1e6244(0x124)]===0x1)return{'dbId':_0x12658a[0x0]['dbId'],'dbName':_0x12658a[0x0][_0x1e6244(0x121)]};if(_0x12658a[_0x1e6244(0x124)]>0x1){const _0x4a0a2a=await select({'message':_0x1e6244(0x134),'choices':[..._0x12658a[_0x1e6244(0x127)](_0x2bc70d=>({'name':_0x2bc70d[_0x1e6244(0x121)]+'\x20('+_0x2bc70d['dbId']+')','value':serializeDbSelection(_0x2bc70d)})),{'name':_0x1e6244(0x109),'value':_0x1e6244(0x130)}]});if(_0x4a0a2a!==_0x1e6244(0x130))return deserializeDbSelection(_0x4a0a2a);}const _0x2e6331=await input({'message':'请输入目标数据库\x20dbId:','validate':_0x2dffa6=>{const _0x235958=_0x1e6244,_0x312f12=_0x2dffa6['trim']();if(!_0x312f12)return _0x235958(0xfa);const _0x2d4191=Number(_0x312f12);if(!Number[_0x235958(0x10f)](_0x2d4191)||_0x2d4191<=0x0)return _0x235958(0x131);return!![];}});return{'dbId':Number(_0x2e6331['trim']())};}async function resolveSqlModeInput(_0x1f5b1b){const _0x48cdf7=a154_0x157fd8,_0x3cae12=_0x1f5b1b['str'](_0x48cdf7(0x113))[_0x48cdf7(0x117)]();if(_0x3cae12===_0x48cdf7(0x12c)||_0x3cae12===_0x48cdf7(0x12a))return _0x3cae12;if(_0x1f5b1b[_0x48cdf7(0xf3)])throw CliErrors[_0x48cdf7(0x120)](_0x48cdf7(0x113),_0x48cdf7(0x12f));return await select({'message':_0x48cdf7(0x123),'choices':[{'name':_0x48cdf7(0x11a),'value':'sql','description':_0x48cdf7(0xfd)},{'name':_0x48cdf7(0xfc),'value':_0x48cdf7(0x12a),'description':_0x48cdf7(0x101)}]});}function serializeDbSelection(_0x4fbbab){const _0x4cb7da=a154_0x157fd8;return JSON['stringify']({'dbId':_0x4fbbab[_0x4cb7da(0x11c)],'dbName':_0x4fbbab[_0x4cb7da(0x121)]});}function deserializeDbSelection(_0xb704f4){const _0x19d23f=a154_0x157fd8;try{const _0x46a84e=JSON['parse'](_0xb704f4);if(typeof _0x46a84e[_0x19d23f(0x11c)]===_0x19d23f(0x103)&&Number['isFinite'](_0x46a84e[_0x19d23f(0x11c)]))return{'dbId':_0x46a84e['dbId'],'dbName':_0x46a84e[_0x19d23f(0x121)]};}catch{}throw CliErrors[_0x19d23f(0x12e)](_0x19d23f(0x114)+_0xb704f4);}function resolveProvidedDbId(_0x373a4d){const _0x3cfd0f=a154_0x157fd8,_0x1584f8=_0x373a4d['flag']('db-id');if(typeof _0x1584f8===_0x3cfd0f(0x103)&&Number['isFinite'](_0x1584f8))return _0x1584f8;return undefined;}
1
+ const a156_0x3c2d4a=a156_0x1875;(function(_0x4be883,_0x1823c0){const _0x88879a=a156_0x1875,_0x224299=_0x4be883();while(!![]){try{const _0x274381=-parseInt(_0x88879a(0x17e))/0x1*(-parseInt(_0x88879a(0x16e))/0x2)+-parseInt(_0x88879a(0x155))/0x3*(parseInt(_0x88879a(0x14c))/0x4)+-parseInt(_0x88879a(0x143))/0x5*(parseInt(_0x88879a(0x17d))/0x6)+parseInt(_0x88879a(0x15b))/0x7+parseInt(_0x88879a(0x160))/0x8*(-parseInt(_0x88879a(0x17c))/0x9)+-parseInt(_0x88879a(0x144))/0xa*(-parseInt(_0x88879a(0x164))/0xb)+parseInt(_0x88879a(0x17f))/0xc;if(_0x274381===_0x1823c0)break;else _0x224299['push'](_0x224299['shift']());}catch(_0x5af59a){_0x224299['push'](_0x224299['shift']());}}}(a156_0x2d04,0x4f226));import{writeFile}from'node:fs/promises';function a156_0x1875(_0x2ffc8a,_0x516035){_0x2ffc8a=_0x2ffc8a-0x142;const _0x2d0454=a156_0x2d04();let _0x187571=_0x2d0454[_0x2ffc8a];return _0x187571;}import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';function a156_0x2d04(){const _0x2d38cf=['File\x20already\x20exists:\x20','catch','sqlRoot','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','dbId','适合带动态标签的\x20MyBatis\x20XML\x20SQL','2417428zNWWnY','trim','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','__manual__','mybatisXml','toISOString','name','dbId\x20必须为正整数','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','3yrvhKn','length','SELECT\x201\x20AS\x20id;','lastSync','validation','str','704886iGOhkA','sqlRootDir','sqls','sqlName','SQL\x20query\x20display\x20name','1036240JbngHM','string','请输入\x20SQL\x20名称:','description','467885IFFEkw','db-id','isFinite','POST','sqlCode','create','Created\x20SQL\x20query\x20','isInteger','parse','</select>','4274zgFzqe','请输入目标数据库\x20dbId:','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','flag','Invalid\x20database\x20selection\x20payload:\x20','/smartapi/custom/saveUserCustomSql','Local\x20SQL\x20file\x20mode','\x20\x20SELECT\x201\x20AS\x20id','flagMissing','dbId\x20不能为空','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','sql','lockFilePath','dbName','36RJUxRl','1434BUvnjI','207dUVVKz','11643912QdWadd','mode','number','nonInteractive','appCode','✎\x20手动输入\x20dbId','new','MyBatis\x20XML(mybatisXml)','join','12965IXRJwP','130oMSUWs','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20'];a156_0x2d04=function(){return _0x2d38cf;};return a156_0x2d04();}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(_0x5630cb){const _0x5821b3=a156_0x1875;if(_0x5630cb==='mybatisXml')return['<select\x20id=\x22query\x22\x20resultType=\x22map\x22>',_0x5821b3(0x175),_0x5821b3(0x16d),''][_0x5821b3(0x142)]('\x0a');return[_0x5821b3(0x157),''][_0x5821b3(0x142)]('\x0a');}export const sqlCreate={'service':a156_0x3c2d4a(0x179),'command':a156_0x3c2d4a(0x169),'description':a156_0x3c2d4a(0x149),'risk':'high-risk-write','flags':[{'name':a156_0x3c2d4a(0x152),'type':a156_0x3c2d4a(0x161),'description':a156_0x3c2d4a(0x15f)},{'name':a156_0x3c2d4a(0x165),'type':a156_0x3c2d4a(0x181),'description':'Target\x20database\x20ID'},{'name':a156_0x3c2d4a(0x180),'type':'string','enum':[a156_0x3c2d4a(0x179),a156_0x3c2d4a(0x150)],'description':a156_0x3c2d4a(0x174)}],async 'validate'(_0x20a107){const _0x384a4d=a156_0x3c2d4a;if(!_0x20a107[_0x384a4d(0x182)])return;if(!_0x20a107[_0x384a4d(0x15a)]('name')[_0x384a4d(0x14d)]())throw CliErrors[_0x384a4d(0x176)](_0x384a4d(0x152),_0x384a4d(0x178));const _0x7c5b15=resolveProvidedDbId(_0x20a107);if(typeof _0x7c5b15!==_0x384a4d(0x181)||!Number[_0x384a4d(0x166)](_0x7c5b15)||_0x7c5b15<=0x0)throw CliErrors[_0x384a4d(0x176)](_0x384a4d(0x165),_0x384a4d(0x14e));if(!_0x20a107['str'](_0x384a4d(0x180))[_0x384a4d(0x14d)]())throw CliErrors[_0x384a4d(0x176)](_0x384a4d(0x180),_0x384a4d(0x154));},async 'dryRun'(_0x119abf){const _0x90d9db=a156_0x3c2d4a,_0x51cd62=loadSqlProjectConfig(_0x119abf['appCode']),{sqlName:_0x488041,dbId:_0x5d76d7,dbName:_0x30348f,mode:_0x391db8}=await resolveSqlNewInputs(_0x119abf),_0x315705=buildSqlRelativePath('<server-generated-sqlCode>',_0x488041,_0x30348f,_0x391db8,_0x5d76d7),_0x56e362=_0x51cd62[_0x90d9db(0x15c)]+'/'+_0x315705;return{'method':_0x90d9db(0x167),'url':_0x90d9db(0x173),'body':{'appCode':_0x119abf[_0x90d9db(0x183)],'sqlName':_0x488041,'dbId':_0x5d76d7,'mode':_0x391db8,'localPath':_0x56e362},'description':_0x90d9db(0x145)+_0x51cd62[_0x90d9db(0x15c)]};},async 'execute'(_0x2b7ba2){const _0xb165b0=a156_0x3c2d4a,_0x2d9d8d=loadSqlProjectConfig(_0x2b7ba2['appCode']),{sqlName:_0x4b4de4,dbId:_0x2a8a28,dbName:_0x72cf5d,mode:_0x347924}=await resolveSqlNewInputs(_0x2b7ba2),_0x13c0d5=generateSqlTemplate(_0x347924),_0x1b50a7=await createSqlQuery({'appCode':_0x2b7ba2[_0xb165b0(0x183)],'sqlName':_0x4b4de4,'dbId':_0x2a8a28,'sqlContent':_0x13c0d5}),_0x24f26d=ensureRemoteSqlContent(_0x1b50a7),_0xbba319=_0x72cf5d||await getDbName(_0x2b7ba2[_0xb165b0(0x183)],_0x2a8a28)[_0xb165b0(0x147)](()=>undefined),_0x4d2b2a=buildSqlRelativePath(_0x1b50a7['sqlCode'],_0x1b50a7[_0xb165b0(0x15e)],_0xbba319,_0x347924,_0x2a8a28),_0x150577=_0x2d9d8d[_0xb165b0(0x15c)]+'/'+_0x4d2b2a,_0x3e5c65=buildLocalSqlFileContent({'sqlCode':_0x1b50a7['sqlCode'],'sqlName':_0x1b50a7['sqlName'],'dbId':_0x1b50a7[_0xb165b0(0x14a)]},_0x24f26d,{'dbName':_0xbba319,'mode':_0x347924,'syncedAt':new Date()[_0xb165b0(0x151)](),'description':_0x1b50a7[_0xb165b0(0x163)]});if(await fileExists(_0x150577))throw CliErrors[_0xb165b0(0x159)](_0xb165b0(0x146)+_0x150577);await ensureParentDirectory(_0x150577),await writeFile(_0x150577,_0x3e5c65,'utf8');const _0x87df43=await readSqlLockFile(_0x2d9d8d[_0xb165b0(0x17a)]),{lockData:_0x1aacc5,appLock:_0x4d4ce7}=ensureSqlLockScope(_0x87df43??createEmptySqlLock(),_0x2d9d8d[_0xb165b0(0x183)],_0x2d9d8d[_0xb165b0(0x148)],_0xb165b0(0x185));return _0x4d4ce7[_0xb165b0(0x15d)][_0x1b50a7[_0xb165b0(0x168)]]={...buildSqlLockEntry(_0x1b50a7,_0x24f26d,computeSqlContentHash(_0x3e5c65),{'dbName':_0xbba319}),'path':_0x4d2b2a,'mode':_0x347924},_0x4d4ce7[_0xb165b0(0x158)]=new Date()[_0xb165b0(0x151)](),await writeSqlLockFile(_0x2d9d8d[_0xb165b0(0x17a)],_0x1aacc5),{'ok':!![],'data':{'id':_0x1b50a7['id'],'sqlCode':_0x1b50a7[_0xb165b0(0x168)],'sqlName':_0x1b50a7['sqlName'],'dbId':_0x1b50a7[_0xb165b0(0x14a)],'path':_0x150577,'mode':_0x347924},'message':_0xb165b0(0x16a)+_0x1b50a7[_0xb165b0(0x168)]};}};async function resolveSqlNewInputs(_0x30c1ce){const _0x1ca5f0=await resolveSqlNameInput(_0x30c1ce),{dbId:_0x1f1607,dbName:_0x1f6196}=await resolveDbSelection(_0x30c1ce),_0x1343a2=await resolveSqlModeInput(_0x30c1ce);return{'sqlName':_0x1ca5f0,'dbId':_0x1f1607,'dbName':_0x1f6196,'mode':_0x1343a2};}async function resolveSqlNameInput(_0x40f8e9){const _0x2fb45a=a156_0x3c2d4a,_0x11bcb7=_0x40f8e9['str'](_0x2fb45a(0x152))[_0x2fb45a(0x14d)]();if(_0x11bcb7)return _0x11bcb7;if(_0x40f8e9[_0x2fb45a(0x182)])throw CliErrors[_0x2fb45a(0x176)](_0x2fb45a(0x152),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');return(await input({'message':_0x2fb45a(0x162),'validate':_0xf7ca42=>_0xf7ca42[_0x2fb45a(0x14d)]()?!![]:'SQL\x20名称不能为空'}))[_0x2fb45a(0x14d)]();}async function resolveDbSelection(_0x4d72ee){const _0x16313f=a156_0x3c2d4a,_0x33bbde=resolveProvidedDbId(_0x4d72ee);if(typeof _0x33bbde==='number'&&Number['isFinite'](_0x33bbde)&&_0x33bbde>0x0)return{'dbId':_0x33bbde,'dbName':await getDbName(_0x4d72ee[_0x16313f(0x183)],_0x33bbde)[_0x16313f(0x147)](()=>undefined)};if(_0x4d72ee['nonInteractive'])throw CliErrors[_0x16313f(0x176)](_0x16313f(0x165),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x16c444=await listDatabases(_0x4d72ee['appCode'])[_0x16313f(0x147)](()=>[]);if(_0x16c444[_0x16313f(0x156)]===0x1)return{'dbId':_0x16c444[0x0][_0x16313f(0x14a)],'dbName':_0x16c444[0x0]['dbName']};if(_0x16c444[_0x16313f(0x156)]>0x1){const _0x437a73=await select({'message':'请选择目标数据库:','choices':[..._0x16c444['map'](_0x3f20e5=>({'name':_0x3f20e5['dbName']+'\x20('+_0x3f20e5[_0x16313f(0x14a)]+')','value':serializeDbSelection(_0x3f20e5)})),{'name':_0x16313f(0x184),'value':_0x16313f(0x14f)}]});if(_0x437a73!=='__manual__')return deserializeDbSelection(_0x437a73);}const _0x3e22dc=await input({'message':_0x16313f(0x16f),'validate':_0x5595a8=>{const _0x1b0d9f=_0x16313f,_0x27b0a5=_0x5595a8[_0x1b0d9f(0x14d)]();if(!_0x27b0a5)return _0x1b0d9f(0x177);const _0x50498a=Number(_0x27b0a5);if(!Number[_0x1b0d9f(0x16b)](_0x50498a)||_0x50498a<=0x0)return _0x1b0d9f(0x153);return!![];}});return{'dbId':Number(_0x3e22dc[_0x16313f(0x14d)]())};}async function resolveSqlModeInput(_0x37133a){const _0x5bdd01=a156_0x3c2d4a,_0x480e9b=_0x37133a[_0x5bdd01(0x15a)](_0x5bdd01(0x180))['trim']();if(_0x480e9b===_0x5bdd01(0x179)||_0x480e9b===_0x5bdd01(0x150))return _0x480e9b;if(_0x37133a[_0x5bdd01(0x182)])throw CliErrors[_0x5bdd01(0x176)](_0x5bdd01(0x180),_0x5bdd01(0x154));return await select({'message':'请选择本地\x20SQL\x20模式:','choices':[{'name':'普通\x20SQL(sql)','value':'sql','description':_0x5bdd01(0x170)},{'name':_0x5bdd01(0x186),'value':'mybatisXml','description':_0x5bdd01(0x14b)}]});}function serializeDbSelection(_0x1228d0){const _0x5bf4fc=a156_0x3c2d4a;return JSON['stringify']({'dbId':_0x1228d0['dbId'],'dbName':_0x1228d0[_0x5bf4fc(0x17b)]});}function deserializeDbSelection(_0x46aa78){const _0x42813a=a156_0x3c2d4a;try{const _0x4be699=JSON[_0x42813a(0x16c)](_0x46aa78);if(typeof _0x4be699['dbId']==='number'&&Number[_0x42813a(0x166)](_0x4be699[_0x42813a(0x14a)]))return{'dbId':_0x4be699['dbId'],'dbName':_0x4be699[_0x42813a(0x17b)]};}catch{}throw CliErrors[_0x42813a(0x159)](_0x42813a(0x172)+_0x46aa78);}function resolveProvidedDbId(_0x297894){const _0x3d3fee=a156_0x3c2d4a,_0x3c5e5c=_0x297894[_0x3d3fee(0x171)](_0x3d3fee(0x165));if(typeof _0x3c5e5c===_0x3d3fee(0x181)&&Number[_0x3d3fee(0x166)](_0x3c5e5c))return _0x3c5e5c;return undefined;}
@@ -1 +1 @@
1
- const a155_0x5ab722=a155_0x4f42;(function(_0x59943c,_0x53d6a6){const _0x5c9e10=a155_0x4f42,_0x5ea636=_0x59943c();while(!![]){try{const _0x3bef4d=-parseInt(_0x5c9e10(0x19a))/0x1+-parseInt(_0x5c9e10(0x1b0))/0x2*(-parseInt(_0x5c9e10(0x1b8))/0x3)+parseInt(_0x5c9e10(0x19f))/0x4*(-parseInt(_0x5c9e10(0x1a3))/0x5)+parseInt(_0x5c9e10(0x1aa))/0x6*(parseInt(_0x5c9e10(0x196))/0x7)+parseInt(_0x5c9e10(0x1af))/0x8+parseInt(_0x5c9e10(0x1a0))/0x9+-parseInt(_0x5c9e10(0x192))/0xa;if(_0x3bef4d===_0x53d6a6)break;else _0x5ea636['push'](_0x5ea636['shift']());}catch(_0xf0e6b5){_0x5ea636['push'](_0x5ea636['shift']());}}}(a155_0x5142,0xe9e54));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';function a155_0x5142(){const _0x46858d=['8sUvySv','9394542HmWEut','SQL\x20lock\x20file\x20not\x20found.','sqlRoot','2423605MdwRwt','filter','trashDir','/smartapi/custom/deleteUserCustomSql','validation','str','trashedTo','508764lZSGju','replace','projectRoot','entries','sqlcode','12814288OfFIIv','12tttQPU','startsWith','delete','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','\x20(local\x20file\x20moved\x20to\x20trash)','appCode','sqls','Would\x20delete\x20SQL\x20','303699IAaMqd','high-risk-write','5336450PDzaGx','fromEntries','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','POST','84QmIdmJ','Deleted\x20','remoteId','length','1809427quGmjS','lockFilePath','toISOString','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20'];a155_0x5142=function(){return _0x46858d;};return a155_0x5142();}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';function a155_0x4f42(_0x3c00df,_0x4107bb){_0x3c00df=_0x3c00df-0x191;const _0x514254=a155_0x5142();let _0x4f423b=_0x514254[_0x3c00df];return _0x4f423b;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':'sql','command':'delete','description':a155_0x5ab722(0x1b3),'risk':a155_0x5ab722(0x191),'flags':[SQLCODE_FLAG],async 'validate'(_0x284df7){const _0x42732e=a155_0x5ab722,_0x22021e=loadSqlProjectConfig(_0x284df7[_0x42732e(0x1b5)]),_0x102cf5=await readSqlLockFile(_0x22021e[_0x42732e(0x19b)]);if(!_0x102cf5)throw CliErrors[_0x42732e(0x1a7)](_0x42732e(0x194));},async 'dryRun'(_0x2b925a){const _0x52dbe5=a155_0x5ab722,_0x3d24b6=loadSqlProjectConfig(_0x2b925a[_0x52dbe5(0x1b5)]),_0x3d968b=await readSqlLockFile(_0x3d24b6['lockFilePath']);if(!_0x3d968b)throw CliErrors[_0x52dbe5(0x1a7)](_0x52dbe5(0x194));const {appLock:_0x364f84}=ensureSqlLockScope(_0x3d968b,_0x2b925a[_0x52dbe5(0x1b5)],_0x3d24b6[_0x52dbe5(0x1a2)],_0x52dbe5(0x1b2)),_0x30b808=_0x2b925a[_0x52dbe5(0x1a8)](_0x52dbe5(0x1ae)),_0xf278bd=_0x364f84[_0x52dbe5(0x1b6)][_0x30b808];if(!_0xf278bd)throw CliErrors[_0x52dbe5(0x1a7)](_0x52dbe5(0x19d)+_0x30b808+'\x22.');return{'method':_0x52dbe5(0x195),'url':_0x52dbe5(0x1a6),'body':{'sqlCode':_0x30b808,'id':_0xf278bd[_0x52dbe5(0x198)],'localPath':resolveLocalSqlFilePath(_0x3d24b6,_0x30b808,_0xf278bd)},'description':_0x52dbe5(0x1b7)+_0x30b808+_0x52dbe5(0x19e)+_0x3d24b6[_0x52dbe5(0x1a5)]};},async 'execute'(_0x5388ae){const _0x16b597=a155_0x5ab722,_0x5a53e7=loadSqlProjectConfig(_0x5388ae['appCode']),_0x243cf3=await readSqlLockFile(_0x5a53e7['lockFilePath']);if(!_0x243cf3)throw CliErrors[_0x16b597(0x1a7)](_0x16b597(0x1a1));const {lockData:_0x36b54d,appLock:_0x36c3bd}=ensureSqlLockScope(_0x243cf3,_0x5388ae['appCode'],_0x5a53e7[_0x16b597(0x1a2)],_0x16b597(0x1b2)),_0xe059c9=_0x5388ae['str']('sqlcode'),_0x741ec0=_0x36c3bd[_0x16b597(0x1b6)][_0xe059c9];if(!_0x741ec0)throw CliErrors['validation'](_0x16b597(0x19d)+_0xe059c9+'\x22.');await deleteSqlQuery({'id':_0x741ec0[_0x16b597(0x198)],'sqlCode':_0xe059c9}),_0x36c3bd[_0x16b597(0x1b6)]=Object[_0x16b597(0x193)](Object[_0x16b597(0x1ad)](_0x36c3bd['sqls'])[_0x16b597(0x1a4)](([_0x4293ac])=>_0x4293ac!==_0xe059c9)),_0x36c3bd['lastSync']=new Date()[_0x16b597(0x19c)](),await writeSqlLockFile(_0x5a53e7[_0x16b597(0x19b)],_0x36b54d);const _0x570823=resolveLocalSqlFilePath(_0x5a53e7,_0xe059c9,_0x741ec0);let _0x36f91c;await fileExists(_0x570823)&&(_0x36f91c=await moveToTrash(_0x5a53e7[_0x16b597(0x1ac)],_0x5a53e7[_0x16b597(0x1a5)],_0x570823),await cleanupEmptyDirectories(dirname(_0x570823),_0x5a53e7['sqlRootDir']));const _0x2e2fff={'deleted':_0xe059c9,'remoteId':_0x741ec0['remoteId']};if(_0x36f91c)_0x2e2fff[_0x16b597(0x1a9)]=_0x36f91c;return{'ok':!![],'data':_0x2e2fff,'message':_0x16b597(0x197)+_0xe059c9+(_0x36f91c?_0x16b597(0x1b4):'')};}};async function moveToTrash(_0x31f384,_0x42abfb,_0x24b68b){const _0x4656ae=a155_0x5ab722,_0x4c818a=new Date()[_0x4656ae(0x19c)]()[_0x4656ae(0x1ab)](/[:.]/g,'-'),_0x4d195d=relative(_0x31f384,_0x24b68b),_0x4bb0d=join(_0x42abfb,_0x4c818a,_0x4d195d);return await mkdir(dirname(_0x4bb0d),{'recursive':!![]}),await rename(_0x24b68b,_0x4bb0d),_0x4bb0d;}async function cleanupEmptyDirectories(_0x1f8630,_0x3a3d6c){const _0xeafa8a=a155_0x5ab722;let _0x49ce47=resolve(_0x1f8630);const _0x467212=resolve(_0x3a3d6c);while(_0x49ce47[_0xeafa8a(0x1b1)](''+_0x467212+sep)||_0x49ce47===_0x467212){if(_0x49ce47===_0x467212)return;try{const _0x7e0c9a=await readdir(_0x49ce47);if(_0x7e0c9a[_0xeafa8a(0x199)]>0x0)return;await rmdir(_0x49ce47);}catch{return;}_0x49ce47=dirname(_0x49ce47);}}
1
+ function a157_0x3275(){const _0x2690ff=['lastSync','trashedTo','1750BCDCEp','SQL\x20lock\x20file\x20not\x20found.','\x20(local\x20file\x20moved\x20to\x20trash)','sqlRootDir','entries','str','appCode','2183076FnVfRH','3800440gTJKYg','lockFilePath','346088iTfDDO','validation','projectRoot','high-risk-write','Would\x20delete\x20SQL\x20','sqlcode','delete','1604660POzInG','sqls','299244jyVLed','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','toISOString','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','2185215JpzvxL','3927kcCRkE','startsWith','/smartapi/custom/deleteUserCustomSql','remoteId','filter','sqlRoot','POST','length','trashDir','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22'];a157_0x3275=function(){return _0x2690ff;};return a157_0x3275();}const a157_0x43fd44=a157_0x5bfc;(function(_0x24b9fd,_0x139662){const _0x5830a5=a157_0x5bfc,_0x417c4b=_0x24b9fd();while(!![]){try{const _0x48a786=parseInt(_0x5830a5(0x1c8))/0x1+-parseInt(_0x5830a5(0x1b5))/0x2*(-parseInt(_0x5830a5(0x1a9))/0x3)+-parseInt(_0x5830a5(0x1c6))/0x4+-parseInt(_0x5830a5(0x1a8))/0x5+-parseInt(_0x5830a5(0x1bc))/0x6+parseInt(_0x5830a5(0x1bd))/0x7+-parseInt(_0x5830a5(0x1bf))/0x8;if(_0x48a786===_0x139662)break;else _0x417c4b['push'](_0x417c4b['shift']());}catch(_0x4e0118){_0x417c4b['push'](_0x417c4b['shift']());}}}(a157_0x3275,0xb5350));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_0x5bfc(_0x1635c7,_0x3e04ef){_0x1635c7=_0x1635c7-0x1a7;const _0x327573=a157_0x3275();let _0x5bfc16=_0x327573[_0x1635c7];return _0x5bfc16;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':'sql','command':a157_0x43fd44(0x1c5),'description':'Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','risk':a157_0x43fd44(0x1c2),'flags':[SQLCODE_FLAG],async 'validate'(_0x56c001){const _0x5a20ce=a157_0x43fd44,_0x5f26ae=loadSqlProjectConfig(_0x56c001[_0x5a20ce(0x1bb)]),_0x3d7ca0=await readSqlLockFile(_0x5f26ae[_0x5a20ce(0x1be)]);if(!_0x3d7ca0)throw CliErrors[_0x5a20ce(0x1c0)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');},async 'dryRun'(_0x43d089){const _0x59d932=a157_0x43fd44,_0x3d858f=loadSqlProjectConfig(_0x43d089[_0x59d932(0x1bb)]),_0x4a544a=await readSqlLockFile(_0x3d858f[_0x59d932(0x1be)]);if(!_0x4a544a)throw CliErrors[_0x59d932(0x1c0)](_0x59d932(0x1c9));const {appLock:_0x3b529f}=ensureSqlLockScope(_0x4a544a,_0x43d089[_0x59d932(0x1bb)],_0x3d858f[_0x59d932(0x1ae)],'delete'),_0x268e45=_0x43d089[_0x59d932(0x1ba)](_0x59d932(0x1c4)),_0x5353e5=_0x3b529f[_0x59d932(0x1c7)][_0x268e45];if(!_0x5353e5)throw CliErrors['validation'](_0x59d932(0x1b2)+_0x268e45+'\x22.');return{'method':_0x59d932(0x1af),'url':_0x59d932(0x1ab),'body':{'sqlCode':_0x268e45,'id':_0x5353e5[_0x59d932(0x1ac)],'localPath':resolveLocalSqlFilePath(_0x3d858f,_0x268e45,_0x5353e5)},'description':_0x59d932(0x1c3)+_0x268e45+_0x59d932(0x1a7)+_0x3d858f[_0x59d932(0x1b1)]};},async 'execute'(_0x508e48){const _0x44244b=a157_0x43fd44,_0x14d5eb=loadSqlProjectConfig(_0x508e48[_0x44244b(0x1bb)]),_0x5947c2=await readSqlLockFile(_0x14d5eb[_0x44244b(0x1be)]);if(!_0x5947c2)throw CliErrors[_0x44244b(0x1c0)](_0x44244b(0x1b6));const {lockData:_0x3740cb,appLock:_0x4213b0}=ensureSqlLockScope(_0x5947c2,_0x508e48[_0x44244b(0x1bb)],_0x14d5eb['sqlRoot'],_0x44244b(0x1c5)),_0x54f53d=_0x508e48['str']('sqlcode'),_0x59dd92=_0x4213b0[_0x44244b(0x1c7)][_0x54f53d];if(!_0x59dd92)throw CliErrors[_0x44244b(0x1c0)](_0x44244b(0x1b2)+_0x54f53d+'\x22.');await deleteSqlQuery({'id':_0x59dd92[_0x44244b(0x1ac)],'sqlCode':_0x54f53d}),_0x4213b0[_0x44244b(0x1c7)]=Object['fromEntries'](Object[_0x44244b(0x1b9)](_0x4213b0[_0x44244b(0x1c7)])[_0x44244b(0x1ad)](([_0x407263])=>_0x407263!==_0x54f53d)),_0x4213b0[_0x44244b(0x1b3)]=new Date()[_0x44244b(0x1ca)](),await writeSqlLockFile(_0x14d5eb['lockFilePath'],_0x3740cb);const _0x15d1f1=resolveLocalSqlFilePath(_0x14d5eb,_0x54f53d,_0x59dd92);let _0x16f8c6;await fileExists(_0x15d1f1)&&(_0x16f8c6=await moveToTrash(_0x14d5eb[_0x44244b(0x1c1)],_0x14d5eb['trashDir'],_0x15d1f1),await cleanupEmptyDirectories(dirname(_0x15d1f1),_0x14d5eb[_0x44244b(0x1b8)]));const _0x11724d={'deleted':_0x54f53d,'remoteId':_0x59dd92[_0x44244b(0x1ac)]};if(_0x16f8c6)_0x11724d[_0x44244b(0x1b4)]=_0x16f8c6;return{'ok':!![],'data':_0x11724d,'message':'Deleted\x20'+_0x54f53d+(_0x16f8c6?_0x44244b(0x1b7):'')};}};async function moveToTrash(_0x2cec99,_0x39d862,_0x8256c4){const _0x544e88=new Date()['toISOString']()['replace'](/[:.]/g,'-'),_0x1aab6c=relative(_0x2cec99,_0x8256c4),_0x2ea9eb=join(_0x39d862,_0x544e88,_0x1aab6c);return await mkdir(dirname(_0x2ea9eb),{'recursive':!![]}),await rename(_0x8256c4,_0x2ea9eb),_0x2ea9eb;}async function cleanupEmptyDirectories(_0x2f66dd,_0x5ef668){const _0x53e783=a157_0x43fd44;let _0x43d2b1=resolve(_0x2f66dd);const _0x5810bc=resolve(_0x5ef668);while(_0x43d2b1[_0x53e783(0x1aa)](''+_0x5810bc+sep)||_0x43d2b1===_0x5810bc){if(_0x43d2b1===_0x5810bc)return;try{const _0x17b6ac=await readdir(_0x43d2b1);if(_0x17b6ac[_0x53e783(0x1b0)]>0x0)return;await rmdir(_0x43d2b1);}catch{return;}_0x43d2b1=dirname(_0x43d2b1);}}