@lovrabet/rabetbase-cli 2.3.16-beta.7 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (435) hide show
  1. package/README.md +4 -10
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/fetch-model-list.js +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/auth/auth-server-ui.js +1 -1
  6. package/lib/auth/auth-server.js +1 -1
  7. package/lib/auth/constant.js +1 -1
  8. package/lib/auth/get-cookie.js +1 -1
  9. package/lib/auth/get-session-user.js +1 -1
  10. package/lib/auth/is-session-valid.js +1 -1
  11. package/lib/auth/login-success-html.js +1 -1
  12. package/lib/auth/logout.js +1 -1
  13. package/lib/cli-flags.js +1 -1
  14. package/lib/cli.js +1 -1
  15. package/lib/commands/api/generate.js +1 -1
  16. package/lib/commands/api/index.js +1 -1
  17. package/lib/commands/api/list.js +1 -1
  18. package/lib/commands/api/pull.js +1 -1
  19. package/lib/commands/api/shared.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/members-list.js +1 -1
  23. package/lib/commands/app/remote-directory.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app-config/delete.js +1 -1
  26. package/lib/commands/app-config/get.js +1 -1
  27. package/lib/commands/app-config/index.js +1 -1
  28. package/lib/commands/app-config/list.js +1 -1
  29. package/lib/commands/app-config/set.js +1 -1
  30. package/lib/commands/app-config/shared.js +1 -1
  31. package/lib/commands/auth/index.js +1 -1
  32. package/lib/commands/bff/create.js +1 -1
  33. package/lib/commands/bff/delete.js +1 -1
  34. package/lib/commands/bff/detail.js +1 -1
  35. package/lib/commands/bff/index.js +1 -1
  36. package/lib/commands/bff/list.js +1 -1
  37. package/lib/commands/bff/pull.js +1 -1
  38. package/lib/commands/bff/push.js +1 -1
  39. package/lib/commands/bff/status.js +1 -1
  40. package/lib/commands/cli-skill/index.js +1 -1
  41. package/lib/commands/cli-update.js +1 -1
  42. package/lib/commands/codegen/index.js +1 -1
  43. package/lib/commands/codegen/sdk.js +1 -1
  44. package/lib/commands/codegen/sql.js +1 -1
  45. package/lib/commands/common/app-registry.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/async-task.js +1 -1
  48. package/lib/commands/common/dry-run.js +1 -1
  49. package/lib/commands/common/flags.js +1 -1
  50. package/lib/commands/common/local-file.js +1 -1
  51. package/lib/commands/common/validate.js +1 -1
  52. package/lib/commands/config/get.js +1 -1
  53. package/lib/commands/config/index.js +1 -1
  54. package/lib/commands/config/list.js +1 -1
  55. package/lib/commands/config/set.js +1 -1
  56. package/lib/commands/config/shared.js +1 -1
  57. package/lib/commands/data/filter.js +1 -1
  58. package/lib/commands/data/getOne.js +1 -1
  59. package/lib/commands/data/index.js +1 -1
  60. package/lib/commands/data/shared.js +1 -1
  61. package/lib/commands/dataset/business-group-update.js +1 -1
  62. package/lib/commands/dataset/capability.js +1 -1
  63. package/lib/commands/dataset/delete.js +1 -1
  64. package/lib/commands/dataset/detail.js +1 -1
  65. package/lib/commands/dataset/extend-update.js +1 -1
  66. package/lib/commands/dataset/field-update.js +1 -1
  67. package/lib/commands/dataset/generate.js +1 -1
  68. package/lib/commands/dataset/index.js +1 -1
  69. package/lib/commands/dataset/list.js +1 -1
  70. package/lib/commands/dataset/operations.js +1 -1
  71. package/lib/commands/dataset/relation-audit.js +1 -1
  72. package/lib/commands/dataset/relation-create.js +1 -1
  73. package/lib/commands/dataset/relation-delete.js +1 -1
  74. package/lib/commands/dataset/relation-shared.js +1 -1
  75. package/lib/commands/dataset/relation-update.js +1 -1
  76. package/lib/commands/dataset/relations.js +1 -1
  77. package/lib/commands/dataset/rename.js +1 -1
  78. package/lib/commands/dataset/restore.js +1 -1
  79. package/lib/commands/db/analysis-batching.js +1 -1
  80. package/lib/commands/db/analyze-batch-plan.js +1 -1
  81. package/lib/commands/db/analyze-cancel.js +1 -1
  82. package/lib/commands/db/analyze-start.js +1 -1
  83. package/lib/commands/db/analyze-status.js +1 -1
  84. package/lib/commands/db/create.js +1 -1
  85. package/lib/commands/db/delete.js +1 -1
  86. package/lib/commands/db/detail.js +1 -1
  87. package/lib/commands/db/diff.js +1 -1
  88. package/lib/commands/db/index.js +1 -1
  89. package/lib/commands/db/list.js +1 -1
  90. package/lib/commands/db/shared.js +1 -1
  91. package/lib/commands/db/tables.js +1 -1
  92. package/lib/commands/db/test.js +1 -1
  93. package/lib/commands/db/update.js +1 -1
  94. package/lib/commands/doctor.js +1 -1
  95. package/lib/commands/file/index.js +1 -1
  96. package/lib/commands/init/index.js +1 -1
  97. package/lib/commands/issue/index.js +1 -1
  98. package/lib/commands/issue/nudge.js +1 -1
  99. package/lib/commands/issue/report.js +1 -1
  100. package/lib/commands/issue/shared.js +1 -1
  101. package/lib/commands/kb/create.js +1 -1
  102. package/lib/commands/kb/delete.js +1 -1
  103. package/lib/commands/kb/detail.js +1 -1
  104. package/lib/commands/kb/index.js +1 -1
  105. package/lib/commands/kb/list.js +1 -1
  106. package/lib/commands/kb/shared.js +1 -1
  107. package/lib/commands/kb/update.js +1 -1
  108. package/lib/commands/logs/index.js +1 -1
  109. package/lib/commands/menu/asset-update.js +1 -1
  110. package/lib/commands/menu/delete.js +1 -1
  111. package/lib/commands/menu/external-link-create.js +1 -1
  112. package/lib/commands/menu/external-link-update.js +1 -1
  113. package/lib/commands/menu/group-create.js +1 -1
  114. package/lib/commands/menu/group-update.js +1 -1
  115. package/lib/commands/menu/index.js +1 -1
  116. package/lib/commands/menu/list.js +1 -1
  117. package/lib/commands/menu/move.js +1 -1
  118. package/lib/commands/menu/regroup-start.js +1 -1
  119. package/lib/commands/menu/rename.js +1 -1
  120. package/lib/commands/menu/shared/compare-table.js +1 -1
  121. package/lib/commands/menu/shared/delete-plan.js +1 -1
  122. package/lib/commands/menu/shared/facts.js +1 -1
  123. package/lib/commands/menu/shared/index.js +1 -1
  124. package/lib/commands/menu/shared/inquirer.js +1 -1
  125. package/lib/commands/menu/shared/local-pages.js +1 -1
  126. package/lib/commands/menu/shared/logic.js +1 -1
  127. package/lib/commands/menu/shared/mutations.js +1 -1
  128. package/lib/commands/menu/shared/service.js +1 -1
  129. package/lib/commands/menu/shared/sync-core.js +1 -1
  130. package/lib/commands/menu/shared/update-core.js +1 -1
  131. package/lib/commands/menu/shared/valid-url.js +1 -1
  132. package/lib/commands/menu/sync.js +1 -1
  133. package/lib/commands/notification/config-list.js +1 -1
  134. package/lib/commands/notification/index.js +1 -1
  135. package/lib/commands/ocr/index.js +1 -1
  136. package/lib/commands/page/generate-start.js +1 -1
  137. package/lib/commands/page/generate-status.js +1 -1
  138. package/lib/commands/page/index.js +1 -1
  139. package/lib/commands/page/pull.js +1 -1
  140. package/lib/commands/page/push.js +1 -1
  141. package/lib/commands/page/react/create.d.ts +2 -0
  142. package/lib/commands/page/react/create.js +1 -0
  143. package/lib/commands/page/react/detail.d.ts +2 -0
  144. package/lib/commands/page/react/detail.js +1 -0
  145. package/lib/commands/page/react/list.d.ts +2 -0
  146. package/lib/commands/page/react/list.js +1 -0
  147. package/lib/commands/page/react/publish.d.ts +2 -0
  148. package/lib/commands/page/react/publish.js +1 -0
  149. package/lib/commands/page/react/shared.d.ts +78 -0
  150. package/lib/commands/page/react/shared.js +1 -0
  151. package/lib/commands/page/react/syntax.d.ts +18 -0
  152. package/lib/commands/page/react/syntax.js +1 -0
  153. package/lib/commands/page/react/template.d.ts +8 -0
  154. package/lib/commands/page/react/template.js +1 -0
  155. package/lib/commands/page/react/update.d.ts +2 -0
  156. package/lib/commands/page/react/update.js +1 -0
  157. package/lib/commands/page/relation-audit.js +1 -1
  158. package/lib/commands/page/restore.js +1 -1
  159. package/lib/commands/page/shared.d.ts +1 -0
  160. package/lib/commands/page/shared.js +1 -1
  161. package/lib/commands/page/standard-page-status.js +1 -1
  162. package/lib/commands/page/sync.js +1 -1
  163. package/lib/commands/permit/index.js +1 -1
  164. package/lib/commands/permit/page-get.js +1 -1
  165. package/lib/commands/permit/page-set.js +1 -1
  166. package/lib/commands/permit/role-apis-set.js +1 -1
  167. package/lib/commands/permit/role-menus-set.js +1 -1
  168. package/lib/commands/permit/role-menus.js +1 -1
  169. package/lib/commands/permit/shared.js +1 -1
  170. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  171. package/lib/commands/project/create/format-elapsed.js +1 -1
  172. package/lib/commands/project/create/main.js +1 -1
  173. package/lib/commands/project/create/non-interactive.js +1 -1
  174. package/lib/commands/project/create/project-template-path.js +1 -1
  175. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  176. package/lib/commands/project/create/use-format-code.js +1 -1
  177. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  178. package/lib/commands/project/index.js +1 -1
  179. package/lib/commands/project/upgrade.js +1 -1
  180. package/lib/commands/registry.js +1 -1
  181. package/lib/commands/role/create.js +1 -1
  182. package/lib/commands/role/delete.js +1 -1
  183. package/lib/commands/role/detail.js +1 -1
  184. package/lib/commands/role/index.js +1 -1
  185. package/lib/commands/role/list.js +1 -1
  186. package/lib/commands/role/shared.js +1 -1
  187. package/lib/commands/role/update.js +1 -1
  188. package/lib/commands/role/user-add.js +1 -1
  189. package/lib/commands/role/user-remove.js +1 -1
  190. package/lib/commands/role/user-resolve.js +1 -1
  191. package/lib/commands/run/index.js +1 -1
  192. package/lib/commands/schema.js +1 -1
  193. package/lib/commands/sql/create.js +1 -1
  194. package/lib/commands/sql/delete.js +1 -1
  195. package/lib/commands/sql/detail.js +1 -1
  196. package/lib/commands/sql/exec.js +1 -1
  197. package/lib/commands/sql/index.js +1 -1
  198. package/lib/commands/sql/list.js +1 -1
  199. package/lib/commands/sql/pull.js +1 -1
  200. package/lib/commands/sql/push.js +1 -1
  201. package/lib/commands/sql/shared.js +1 -1
  202. package/lib/commands/sql/status.js +1 -1
  203. package/lib/commands/sql/validate.js +1 -1
  204. package/lib/commands/task/index.js +1 -1
  205. package/lib/commands/task/status.js +1 -1
  206. package/lib/commands/tenant/index.js +1 -1
  207. package/lib/commands/tenant/members-list.js +1 -1
  208. package/lib/commands/tenant/shared.js +1 -1
  209. package/lib/commands/user-account/dingding-sandbox-bind.d.ts +2 -0
  210. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -0
  211. package/lib/commands/user-account/index.d.ts +2 -0
  212. package/lib/commands/user-account/index.js +1 -0
  213. package/lib/commands/workspace/add.js +1 -1
  214. package/lib/commands/workspace/index.js +1 -1
  215. package/lib/commands/workspace/remove.js +1 -1
  216. package/lib/config/schema.js +1 -1
  217. package/lib/constant/cdn.js +1 -1
  218. package/lib/constant/cli.js +1 -1
  219. package/lib/constant/defaults.js +1 -1
  220. package/lib/constant/domain.js +1 -1
  221. package/lib/constant/env.js +1 -1
  222. package/lib/constant/output.js +1 -1
  223. package/lib/constant/paths.js +1 -1
  224. package/lib/constant/risk.js +1 -1
  225. package/lib/context/app-resolver.js +1 -1
  226. package/lib/context/auth-resolver.js +1 -1
  227. package/lib/context/config-loader.js +1 -1
  228. package/lib/context.js +1 -1
  229. package/lib/core/alias-resolver.js +1 -1
  230. package/lib/core/api-client.d.ts +117 -0
  231. package/lib/core/api-client.js +1 -1
  232. package/lib/core/bff/config.js +1 -1
  233. package/lib/core/bff/file-system.js +1 -1
  234. package/lib/core/bff/hash.js +1 -1
  235. package/lib/core/bff/lock.js +1 -1
  236. package/lib/core/bff/utils.js +1 -1
  237. package/lib/core/db-resolver.js +1 -1
  238. package/lib/core/page/file-system.js +1 -1
  239. package/lib/core/page/hash.js +1 -1
  240. package/lib/core/page/lock.js +1 -1
  241. package/lib/core/sql-index-auditor.js +1 -1
  242. package/lib/core/sql-sync/config.js +1 -1
  243. package/lib/core/sql-sync/file-system.js +1 -1
  244. package/lib/core/sql-sync/hash.js +1 -1
  245. package/lib/core/sql-sync/lock.js +1 -1
  246. package/lib/core/sql-sync/utils.js +1 -1
  247. package/lib/core/sql-validator.js +1 -1
  248. package/lib/errors.js +1 -1
  249. package/lib/framework/build-all-flags.js +1 -1
  250. package/lib/framework/error-output.js +1 -1
  251. package/lib/framework/explicit-yes.js +1 -1
  252. package/lib/framework/flags.js +1 -1
  253. package/lib/framework/help.js +1 -1
  254. package/lib/framework/index.js +1 -1
  255. package/lib/framework/output.js +1 -1
  256. package/lib/framework/response.js +1 -1
  257. package/lib/framework/runner-alias.js +1 -1
  258. package/lib/framework/runner.js +1 -1
  259. package/lib/framework/schema-export.js +1 -1
  260. package/lib/framework/types.js +1 -1
  261. package/lib/generated/build-info.d.ts +4 -4
  262. package/lib/generated/build-info.js +1 -1
  263. package/lib/help.js +1 -1
  264. package/lib/postinstall.d.ts +3 -0
  265. package/lib/postinstall.js +1 -0
  266. package/lib/runtime/confirmation.js +1 -1
  267. package/lib/runtime/event.js +1 -1
  268. package/lib/runtime/index.js +1 -1
  269. package/lib/runtime/queue.js +1 -1
  270. package/lib/runtime/resolve.js +1 -1
  271. package/lib/skills/builtin-skill.d.ts +37 -0
  272. package/lib/skills/builtin-skill.js +1 -0
  273. package/lib/skills/main.js +1 -1
  274. package/lib/skills/npx-skills-add.d.ts +4 -2
  275. package/lib/skills/npx-skills-add.js +1 -1
  276. package/lib/skills/skill-presence.js +1 -1
  277. package/lib/telemetry/cli-command-trace.js +1 -1
  278. package/lib/telemetry/cli-help-trace.js +1 -1
  279. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  280. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  281. package/lib/telemetry/send-cli-trace-log.js +1 -1
  282. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  283. package/lib/utils/ai_config.js +1 -1
  284. package/lib/utils/apply-jq-filter.js +1 -1
  285. package/lib/utils/cdn-config.js +1 -1
  286. package/lib/utils/check-sdk-version.js +1 -1
  287. package/lib/utils/cli-version-check.js +1 -1
  288. package/lib/utils/cli-version-policy.js +1 -1
  289. package/lib/utils/config.js +1 -1
  290. package/lib/utils/copy-directory.js +1 -1
  291. package/lib/utils/entity-with-id.js +1 -1
  292. package/lib/utils/file-utils.js +1 -1
  293. package/lib/utils/guides-cdn.js +1 -1
  294. package/lib/utils/http-client.js +1 -1
  295. package/lib/utils/is-non-interactive.js +1 -1
  296. package/lib/utils/logger.js +1 -1
  297. package/lib/utils/params.js +1 -1
  298. package/lib/utils/platform.js +1 -1
  299. package/lib/utils/rules-cdn.js +1 -1
  300. package/lib/utils/sleep.js +1 -1
  301. package/lib/utils/template-replacer.js +1 -1
  302. package/lib/utils/update-notice.js +1 -1
  303. package/lib/utils/version.js +1 -1
  304. package/lib/utils/with-active-cookie.js +1 -1
  305. package/lib/utils/write-cli-side-channel.js +1 -1
  306. package/package.json +9 -3
  307. package/scripts/postinstall.mjs +24 -0
  308. package/skills/rabetbase/SKILL.md +493 -0
  309. package/skills/rabetbase/guides/backend-function.md +835 -0
  310. package/skills/rabetbase/guides/best-practices.md +137 -0
  311. package/skills/rabetbase/guides/bff-creation-workflow.md +148 -0
  312. package/skills/rabetbase/guides/conflict-detection.md +119 -0
  313. package/skills/rabetbase/guides/data-api-guidelines.md +414 -0
  314. package/skills/rabetbase/guides/database-connection-workflow.md +169 -0
  315. package/skills/rabetbase/guides/frontend-development.md +179 -0
  316. package/skills/rabetbase/guides/legacy-application-blueprint-workflow.md +495 -0
  317. package/skills/rabetbase/guides/menu-anomaly-manual-cleanup.md +137 -0
  318. package/skills/rabetbase/guides/page-development-workflow.md +187 -0
  319. package/skills/rabetbase/guides/react-custom-page-workflow.md +184 -0
  320. package/skills/rabetbase/guides/role-permit-workflow.md +127 -0
  321. package/skills/rabetbase/guides/sql-creation-workflow.md +173 -0
  322. package/skills/rabetbase/guides/sql-mybatis.md +126 -0
  323. package/skills/rabetbase/guides/troubleshooting.md +67 -0
  324. package/skills/rabetbase/guides/typescript-sdk.md +227 -0
  325. package/skills/rabetbase/knowledge/page-schema/LrSmartCreate.md +367 -0
  326. package/skills/rabetbase/knowledge/page-schema/LrSmartDetail.md +153 -0
  327. package/skills/rabetbase/knowledge/page-schema/LrSmartEcharts.md +291 -0
  328. package/skills/rabetbase/knowledge/page-schema/LrSmartFilter.md +478 -0
  329. package/skills/rabetbase/knowledge/page-schema/LrSmartJsx.md +119 -0
  330. package/skills/rabetbase/knowledge/page-schema/LrSmartStatistic.md +223 -0
  331. package/skills/rabetbase/knowledge/page-schema/LrSmartTable.md +632 -0
  332. package/skills/rabetbase/knowledge/page-schema/YtPage.md +172 -0
  333. package/skills/rabetbase/knowledge/page-schema/dataset-relations.md +126 -0
  334. package/skills/rabetbase/knowledge/page-schema/external-resources-usage.md +232 -0
  335. package/skills/rabetbase/knowledge/page-schema/field-components.md +312 -0
  336. package/skills/rabetbase/knowledge/page-schema/syntax-reference.md +278 -0
  337. package/skills/rabetbase/knowledge/react-page/components.md +225 -0
  338. package/skills/rabetbase/knowledge/react-page/generation-standards.md +385 -0
  339. package/skills/rabetbase/references/rabetbase-api-list.md +58 -0
  340. package/skills/rabetbase/references/rabetbase-api-pull.md +82 -0
  341. package/skills/rabetbase/references/rabetbase-app-config.md +95 -0
  342. package/skills/rabetbase/references/rabetbase-app-list.md +79 -0
  343. package/skills/rabetbase/references/rabetbase-app-members-list.md +64 -0
  344. package/skills/rabetbase/references/rabetbase-auth-login.md +53 -0
  345. package/skills/rabetbase/references/rabetbase-auth-logout.md +29 -0
  346. package/skills/rabetbase/references/rabetbase-bff-create.md +59 -0
  347. package/skills/rabetbase/references/rabetbase-bff-delete.md +42 -0
  348. package/skills/rabetbase/references/rabetbase-bff-detail.md +38 -0
  349. package/skills/rabetbase/references/rabetbase-bff-list.md +61 -0
  350. package/skills/rabetbase/references/rabetbase-bff-pull.md +42 -0
  351. package/skills/rabetbase/references/rabetbase-bff-push.md +65 -0
  352. package/skills/rabetbase/references/rabetbase-bff-save.md +63 -0
  353. package/skills/rabetbase/references/rabetbase-bff-status.md +37 -0
  354. package/skills/rabetbase/references/rabetbase-cli-skill-install.md +42 -0
  355. package/skills/rabetbase/references/rabetbase-codegen-sdk.md +35 -0
  356. package/skills/rabetbase/references/rabetbase-codegen-sql.md +33 -0
  357. package/skills/rabetbase/references/rabetbase-config.md +296 -0
  358. package/skills/rabetbase/references/rabetbase-dataset-business-group-update.md +84 -0
  359. package/skills/rabetbase/references/rabetbase-dataset-delete.md +54 -0
  360. package/skills/rabetbase/references/rabetbase-dataset-detail.md +106 -0
  361. package/skills/rabetbase/references/rabetbase-dataset-extend-update.md +70 -0
  362. package/skills/rabetbase/references/rabetbase-dataset-field-update.md +117 -0
  363. package/skills/rabetbase/references/rabetbase-dataset-generate.md +206 -0
  364. package/skills/rabetbase/references/rabetbase-dataset-list.md +42 -0
  365. package/skills/rabetbase/references/rabetbase-dataset-operations.md +34 -0
  366. package/skills/rabetbase/references/rabetbase-dataset-relation-audit.md +63 -0
  367. package/skills/rabetbase/references/rabetbase-dataset-relation-mutations.md +141 -0
  368. package/skills/rabetbase/references/rabetbase-dataset-relations.md +71 -0
  369. package/skills/rabetbase/references/rabetbase-dataset-rename.md +107 -0
  370. package/skills/rabetbase/references/rabetbase-dataset-restore.md +54 -0
  371. package/skills/rabetbase/references/rabetbase-db-analyze.md +135 -0
  372. package/skills/rabetbase/references/rabetbase-db-create.md +54 -0
  373. package/skills/rabetbase/references/rabetbase-db-delete.md +26 -0
  374. package/skills/rabetbase/references/rabetbase-db-detail.md +27 -0
  375. package/skills/rabetbase/references/rabetbase-db-diff.md +57 -0
  376. package/skills/rabetbase/references/rabetbase-db-list.md +37 -0
  377. package/skills/rabetbase/references/rabetbase-db-tables.md +25 -0
  378. package/skills/rabetbase/references/rabetbase-db-test.md +29 -0
  379. package/skills/rabetbase/references/rabetbase-db-update.md +29 -0
  380. package/skills/rabetbase/references/rabetbase-doctor.md +62 -0
  381. package/skills/rabetbase/references/rabetbase-file.md +35 -0
  382. package/skills/rabetbase/references/rabetbase-init.md +70 -0
  383. package/skills/rabetbase/references/rabetbase-issue-report.md +132 -0
  384. package/skills/rabetbase/references/rabetbase-kb.md +62 -0
  385. package/skills/rabetbase/references/rabetbase-menu-asset-update.md +135 -0
  386. package/skills/rabetbase/references/rabetbase-menu-delete.md +54 -0
  387. package/skills/rabetbase/references/rabetbase-menu-external-link-create.md +63 -0
  388. package/skills/rabetbase/references/rabetbase-menu-external-link-update.md +74 -0
  389. package/skills/rabetbase/references/rabetbase-menu-group-create.md +33 -0
  390. package/skills/rabetbase/references/rabetbase-menu-group-update.md +38 -0
  391. package/skills/rabetbase/references/rabetbase-menu-list.md +144 -0
  392. package/skills/rabetbase/references/rabetbase-menu-move.md +54 -0
  393. package/skills/rabetbase/references/rabetbase-menu-regroup-start.md +45 -0
  394. package/skills/rabetbase/references/rabetbase-menu-rename.md +48 -0
  395. package/skills/rabetbase/references/rabetbase-menu-sync.md +60 -0
  396. package/skills/rabetbase/references/rabetbase-notification-config-list.md +80 -0
  397. package/skills/rabetbase/references/rabetbase-ocr.md +86 -0
  398. package/skills/rabetbase/references/rabetbase-page-generate-start.md +32 -0
  399. package/skills/rabetbase/references/rabetbase-page-generate-status.md +32 -0
  400. package/skills/rabetbase/references/rabetbase-page-pull.md +47 -0
  401. package/skills/rabetbase/references/rabetbase-page-push.md +45 -0
  402. package/skills/rabetbase/references/rabetbase-page-react-create.md +29 -0
  403. package/skills/rabetbase/references/rabetbase-page-react-detail.md +26 -0
  404. package/skills/rabetbase/references/rabetbase-page-react-list.md +23 -0
  405. package/skills/rabetbase/references/rabetbase-page-react-publish.md +23 -0
  406. package/skills/rabetbase/references/rabetbase-page-react-update.md +24 -0
  407. package/skills/rabetbase/references/rabetbase-page-relation-binding.md +72 -0
  408. package/skills/rabetbase/references/rabetbase-page-restore.md +45 -0
  409. package/skills/rabetbase/references/rabetbase-page-sync.md +36 -0
  410. package/skills/rabetbase/references/rabetbase-permit-page-set.md +69 -0
  411. package/skills/rabetbase/references/rabetbase-permit-role-apis-set.md +53 -0
  412. package/skills/rabetbase/references/rabetbase-permit-role-menus-set.md +57 -0
  413. package/skills/rabetbase/references/rabetbase-project-create.md +46 -0
  414. package/skills/rabetbase/references/rabetbase-project-upgrade.md +57 -0
  415. package/skills/rabetbase/references/rabetbase-role-list.md +68 -0
  416. package/skills/rabetbase/references/rabetbase-role-user-add.md +54 -0
  417. package/skills/rabetbase/references/rabetbase-role-user-resolve.md +27 -0
  418. package/skills/rabetbase/references/rabetbase-run.md +53 -0
  419. package/skills/rabetbase/references/rabetbase-schema.md +22 -0
  420. package/skills/rabetbase/references/rabetbase-sql-create.md +41 -0
  421. package/skills/rabetbase/references/rabetbase-sql-delete.md +37 -0
  422. package/skills/rabetbase/references/rabetbase-sql-detail.md +32 -0
  423. package/skills/rabetbase/references/rabetbase-sql-exec.md +34 -0
  424. package/skills/rabetbase/references/rabetbase-sql-list.md +54 -0
  425. package/skills/rabetbase/references/rabetbase-sql-pull.md +54 -0
  426. package/skills/rabetbase/references/rabetbase-sql-push.md +46 -0
  427. package/skills/rabetbase/references/rabetbase-sql-status.md +39 -0
  428. package/skills/rabetbase/references/rabetbase-sql-validate.md +73 -0
  429. package/skills/rabetbase/references/rabetbase-standard-page-status.md +31 -0
  430. package/skills/rabetbase/references/rabetbase-task-status.md +40 -0
  431. package/skills/rabetbase/references/rabetbase-tenant-members-list.md +69 -0
  432. package/skills/rabetbase/references/rabetbase-update.md +56 -0
  433. package/skills/rabetbase/references/rabetbase-user-account.md +45 -0
  434. package/skills/rabetbase/references/rabetbase-workspace.md +60 -0
  435. package/skills/rabetbase.manifest.json +137 -0
@@ -1 +1 @@
1
- const a164_0x532571=a164_0x99a4;(function(_0xfdfef3,_0x18a945){const _0x361445=a164_0x99a4,_0x3bd8fb=_0xfdfef3();while(!![]){try{const _0x36bb2d=-parseInt(_0x361445(0x1b6))/0x1+-parseInt(_0x361445(0x1b8))/0x2*(parseInt(_0x361445(0x1c9))/0x3)+parseInt(_0x361445(0x1b7))/0x4*(parseInt(_0x361445(0x1b9))/0x5)+-parseInt(_0x361445(0x1be))/0x6+-parseInt(_0x361445(0x1bb))/0x7+-parseInt(_0x361445(0x1ba))/0x8*(-parseInt(_0x361445(0x1bd))/0x9)+parseInt(_0x361445(0x1c1))/0xa;if(_0x36bb2d===_0x18a945)break;else _0x3bd8fb['push'](_0x3bd8fb['shift']());}catch(_0x5d1ded){_0x3bd8fb['push'](_0x3bd8fb['shift']());}}}(a164_0x3754,0x36f33));function a164_0x99a4(_0x166cf0,_0xfd9991){_0x166cf0=_0x166cf0-0x1b5;const _0x375447=a164_0x3754();let _0x99a466=_0x375447[_0x166cf0];return _0x99a466;}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=a164_0x532571(0x1c3);export const roleDelete={'service':a164_0x532571(0x1b5),'command':a164_0x532571(0x1c8),'description':'Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','risk':a164_0x532571(0x1c2),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x24ea1f){const _0x2b09db=a164_0x532571,_0x24c6a7=_0x24ea1f[_0x2b09db(0x1c4)]('id'),_0x1126d0=await getRoleById(_0x24ea1f[_0x2b09db(0x1c7)],_0x24c6a7);return assertCustomRole(_0x1126d0,_0x2b09db(0x1c8)),asDryRunResult({'operation':_0x2b09db(0x1c8),'selector':{'appCode':_0x24ea1f[_0x2b09db(0x1c7)],'roleId':_0x24c6a7,'roleName':_0x1126d0[_0x2b09db(0x1bf)]},'before':projectRole(_0x1126d0),'after':null,'dryRun':!![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':_0x1126d0[_0x2b09db(0x1c5)]>0x0?[_0x2b09db(0x1c0)+_0x1126d0['userCount']+'\x20member(s);\x20they\x20will\x20lose\x20this\x20group.']:[]},{'method':_0x2b09db(0x1bc),'url':DELETE_PATH});},async 'execute'(_0x4f14c9){const _0x135fb2=a164_0x532571,_0x42106e=_0x4f14c9['num']('id'),_0x3f87a9=await getRoleById(_0x4f14c9[_0x135fb2(0x1c7)],_0x42106e);return assertCustomRole(_0x3f87a9,_0x135fb2(0x1c8)),await deleteAppRole(_0x42106e),{'ok':!![],'data':{'operation':'delete','selector':{'appCode':_0x4f14c9['appCode'],'roleId':_0x42106e,'roleName':_0x3f87a9[_0x135fb2(0x1bf)]},'before':projectRole(_0x3f87a9),'after':null,'dryRun':![],'backend':{'method':_0x135fb2(0x1bc),'path':DELETE_PATH},'warnings':[]},'message':_0x135fb2(0x1c6)+_0x3f87a9['roleName']+_0x135fb2(0x1ca)+_0x42106e+')'};}};function a164_0x3754(){const _0x574a4f=['/smartapi/permit/role/delete','num','userCount','Deleted\x20role\x20','appCode','delete','6rQmrkt','\x20(id=','role','270215FHUIQq','808nxsXVb','391610QEgWOF','1955uuSrdG','2468584DxuJqX','3008152DKZdMU','POST','9SddIGj','662754qboHug','roleName','Role\x20still\x20has\x20','10395400klQFPW','high-risk-write'];a164_0x3754=function(){return _0x574a4f;};return a164_0x3754();}
1
+ const a172_0x39bd4a=a172_0x1f67;(function(_0x2cf9a4,_0x18245a){const _0x1e5b22=a172_0x1f67,_0x1dfd24=_0x2cf9a4();while(!![]){try{const _0x84df06=-parseInt(_0x1e5b22(0x8d))/0x1*(parseInt(_0x1e5b22(0x96))/0x2)+parseInt(_0x1e5b22(0x8a))/0x3+parseInt(_0x1e5b22(0x92))/0x4*(-parseInt(_0x1e5b22(0x91))/0x5)+parseInt(_0x1e5b22(0x8f))/0x6+-parseInt(_0x1e5b22(0x9c))/0x7+-parseInt(_0x1e5b22(0x9a))/0x8*(-parseInt(_0x1e5b22(0x8c))/0x9)+parseInt(_0x1e5b22(0x93))/0xa;if(_0x84df06===_0x18245a)break;else _0x1dfd24['push'](_0x1dfd24['shift']());}catch(_0x394eb5){_0x1dfd24['push'](_0x1dfd24['shift']());}}}(a172_0x4963,0xa0b30));function a172_0x4963(){const _0x2b49c7=['Deleted\x20role\x20','1282422jPgdFd','POST','117piNSqc','2lxLIWB','Role\x20still\x20has\x20','697806ljgmei','num','850yEVFRz','27500bxfjAB','10250710HcJINj','/smartapi/permit/role/delete','delete','743326gpmfhW','appCode','\x20(id=','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','631272kwiRTr','roleName','170541tnMsOO'];a172_0x4963=function(){return _0x2b49c7;};return a172_0x4963();}import{deleteAppRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a172_0x1f67(_0x42a96a,_0x19b244){_0x42a96a=_0x42a96a-0x89;const _0x496337=a172_0x4963();let _0x1f67e9=_0x496337[_0x42a96a];return _0x1f67e9;}import{assertCustomRole,getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';const DELETE_PATH=a172_0x39bd4a(0x94);export const roleDelete={'service':'role','command':a172_0x39bd4a(0x95),'description':'Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','risk':'high-risk-write','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0xfb27cc){const _0x167822=a172_0x39bd4a,_0x4145ee=_0xfb27cc['num']('id'),_0x108f8a=await getRoleById(_0xfb27cc['appCode'],_0x4145ee);return assertCustomRole(_0x108f8a,_0x167822(0x95)),asDryRunResult({'operation':'delete','selector':{'appCode':_0xfb27cc['appCode'],'roleId':_0x4145ee,'roleName':_0x108f8a['roleName']},'before':projectRole(_0x108f8a),'after':null,'dryRun':!![],'backend':{'method':_0x167822(0x8b),'path':DELETE_PATH},'warnings':_0x108f8a['userCount']>0x0?[_0x167822(0x8e)+_0x108f8a['userCount']+_0x167822(0x99)]:[]},{'method':_0x167822(0x8b),'url':DELETE_PATH});},async 'execute'(_0x1b2079){const _0x188c4b=a172_0x39bd4a,_0x38fb6f=_0x1b2079[_0x188c4b(0x90)]('id'),_0x3ed2b0=await getRoleById(_0x1b2079['appCode'],_0x38fb6f);return assertCustomRole(_0x3ed2b0,_0x188c4b(0x95)),await deleteAppRole(_0x38fb6f),{'ok':!![],'data':{'operation':_0x188c4b(0x95),'selector':{'appCode':_0x1b2079[_0x188c4b(0x97)],'roleId':_0x38fb6f,'roleName':_0x3ed2b0[_0x188c4b(0x9b)]},'before':projectRole(_0x3ed2b0),'after':null,'dryRun':![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':[]},'message':_0x188c4b(0x89)+_0x3ed2b0['roleName']+_0x188c4b(0x98)+_0x38fb6f+')'};}};
@@ -1 +1 @@
1
- function a165_0x5868(){const _0x2ff7fd=['330280LdUaUz','Role\x20','398648mskHxp','4455038sKONFw','roleName','825750cSfIDG','6xZltJR','role','13399210IZSdtt','detail','108umILXF','roleType','10180mEGUxu','Show\x20a\x20single\x20role\x27s\x20detail','1661665pTYtAd','151IYtbcn','read'];a165_0x5868=function(){return _0x2ff7fd;};return a165_0x5868();}const a165_0x5c5906=a165_0xfda5;(function(_0x25b21c,_0x487d55){const _0x2b052a=a165_0xfda5,_0x935133=_0x25b21c();while(!![]){try{const _0x4159e9=-parseInt(_0x2b052a(0x10f))/0x1*(-parseInt(_0x2b052a(0x11d))/0x2)+-parseInt(_0x2b052a(0x116))/0x3+-parseInt(_0x2b052a(0x111))/0x4+-parseInt(_0x2b052a(0x10e))/0x5*(-parseInt(_0x2b052a(0x117))/0x6)+parseInt(_0x2b052a(0x114))/0x7+parseInt(_0x2b052a(0x113))/0x8*(parseInt(_0x2b052a(0x11b))/0x9)+-parseInt(_0x2b052a(0x119))/0xa;if(_0x4159e9===_0x487d55)break;else _0x935133['push'](_0x935133['shift']());}catch(_0x552a34){_0x935133['push'](_0x935133['shift']());}}}(a165_0x5868,0x9ba94));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a165_0xfda5(_0x4cdfb3,_0x322889){_0x4cdfb3=_0x4cdfb3-0x10e;const _0x5868b0=a165_0x5868();let _0xfda57a=_0x5868b0[_0x4cdfb3];return _0xfda57a;}import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a165_0x5c5906(0x118),'command':a165_0x5c5906(0x11a),'description':a165_0x5c5906(0x11e),'risk':a165_0x5c5906(0x110),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0xeb0b6b){const _0x44c2cb=a165_0x5c5906,_0x5b36b9=_0xeb0b6b['num']('id'),_0x4e43e0=await getRoleById(_0xeb0b6b['appCode'],_0x5b36b9);return{'ok':!![],'data':{'role':projectRole(_0x4e43e0)},'message':_0x44c2cb(0x112)+_0x4e43e0[_0x44c2cb(0x115)]+'\x20('+_0x4e43e0[_0x44c2cb(0x11c)]+')'};}};
1
+ const a173_0x598cef=a173_0x42bc;(function(_0x1bb2ad,_0x264f26){const _0x17faff=a173_0x42bc,_0x568471=_0x1bb2ad();while(!![]){try{const _0x1959fc=parseInt(_0x17faff(0x15e))/0x1+-parseInt(_0x17faff(0x169))/0x2+-parseInt(_0x17faff(0x163))/0x3*(parseInt(_0x17faff(0x166))/0x4)+-parseInt(_0x17faff(0x165))/0x5*(parseInt(_0x17faff(0x16a))/0x6)+parseInt(_0x17faff(0x15f))/0x7*(parseInt(_0x17faff(0x162))/0x8)+parseInt(_0x17faff(0x16b))/0x9+parseInt(_0x17faff(0x168))/0xa;if(_0x1959fc===_0x264f26)break;else _0x568471['push'](_0x568471['shift']());}catch(_0x5d693c){_0x568471['push'](_0x568471['shift']());}}}(a173_0x1ef2,0xb2bca));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a173_0x42bc(_0x28d1ed,_0x30b302){_0x28d1ed=_0x28d1ed-0x15e;const _0x1ef22f=a173_0x1ef2();let _0x42bc72=_0x1ef22f[_0x28d1ed];return _0x42bc72;}function a173_0x1ef2(){const _0x5a8a81=['934080JSUnEG','520912jjCFVJ','num','role','24pQzWeS','60REIRJn','appCode','5tbdEQE','171224FhEaTk','Role\x20','7269910kHzNDI','2166464mSvuSF','3212952lCdkzB','11903679yVXTnS'];a173_0x1ef2=function(){return _0x5a8a81;};return a173_0x1ef2();}import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a173_0x598cef(0x161),'command':'detail','description':'Show\x20a\x20single\x20role\x27s\x20detail','risk':'read','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x5f0da6){const _0x157e1f=a173_0x598cef,_0x540613=_0x5f0da6[_0x157e1f(0x160)]('id'),_0x85a9e=await getRoleById(_0x5f0da6[_0x157e1f(0x164)],_0x540613);return{'ok':!![],'data':{'role':projectRole(_0x85a9e)},'message':_0x157e1f(0x167)+_0x85a9e['roleName']+'\x20('+_0x85a9e['roleType']+')'};}};
@@ -1 +1 @@
1
- (function(_0x59e2ba,_0x15ae21){const _0x432376=a166_0x58de,_0x26c4d2=_0x59e2ba();while(!![]){try{const _0x1f6724=-parseInt(_0x432376(0x75))/0x1+-parseInt(_0x432376(0x74))/0x2+parseInt(_0x432376(0x79))/0x3*(-parseInt(_0x432376(0x76))/0x4)+-parseInt(_0x432376(0x72))/0x5+-parseInt(_0x432376(0x7a))/0x6+-parseInt(_0x432376(0x78))/0x7*(parseInt(_0x432376(0x77))/0x8)+parseInt(_0x432376(0x73))/0x9;if(_0x1f6724===_0x15ae21)break;else _0x26c4d2['push'](_0x26c4d2['shift']());}catch(_0x150ab3){_0x26c4d2['push'](_0x26c4d2['shift']());}}}(a166_0xc9bd,0xe6c43));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';function a166_0xc9bd(){const _0x25aa77=['120AgbdWb','692965hJsgeL','3DUNCmT','372168IxosvY','6901465goyfin','60159834NBSclE','2174222PHfPna','1446666AEtZSO','1112736PCLLsG'];a166_0xc9bd=function(){return _0x25aa77;};return a166_0xc9bd();}function a166_0x58de(_0x347393,_0x2fabfe){_0x347393=_0x347393-0x72;const _0xc9bddf=a166_0xc9bd();let _0x58de87=_0xc9bddf[_0x347393];return _0x58de87;}import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
1
+ (function(_0x43797c,_0x1070de){const _0x33e37a=a174_0x5b5c,_0x399e2e=_0x43797c();while(!![]){try{const _0x50fd64=-parseInt(_0x33e37a(0x15d))/0x1*(parseInt(_0x33e37a(0x15c))/0x2)+-parseInt(_0x33e37a(0x158))/0x3*(-parseInt(_0x33e37a(0x15e))/0x4)+parseInt(_0x33e37a(0x163))/0x5+parseInt(_0x33e37a(0x159))/0x6+-parseInt(_0x33e37a(0x161))/0x7*(-parseInt(_0x33e37a(0x15f))/0x8)+-parseInt(_0x33e37a(0x15a))/0x9*(-parseInt(_0x33e37a(0x160))/0xa)+-parseInt(_0x33e37a(0x162))/0xb*(parseInt(_0x33e37a(0x15b))/0xc);if(_0x50fd64===_0x1070de)break;else _0x399e2e['push'](_0x399e2e['shift']());}catch(_0x398893){_0x399e2e['push'](_0x399e2e['shift']());}}}(a174_0x46d9,0xc9a02));import{roleList}from'../../commands/role/list.js';function a174_0x5b5c(_0x3b5f55,_0x22c678){_0x3b5f55=_0x3b5f55-0x158;const _0x46d9b2=a174_0x46d9();let _0x5b5c32=_0x46d9b2[_0x3b5f55];return _0x5b5c32;}import{roleDetail}from'../../commands/role/detail.js';import{roleCreate}from'../../commands/role/create.js';function a174_0x46d9(){const _0x54adb4=['744WBXbNS','3543090PCitNa','89551xrLRav','26792513YjIXyN','2403035PQdJfT','11346vTHRDi','8990154dPnlYu','9lMrTEq','12pbvRoJ','229766uyAvFg','11OhGrTA','1060Iwcisx'];a174_0x46d9=function(){return _0x54adb4;};return a174_0x46d9();}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 a167_0x4252ef=a167_0x31af;(function(_0x412667,_0xbeec24){const _0x776b02=a167_0x31af,_0x26999e=_0x412667();while(!![]){try{const _0x4db53f=parseInt(_0x776b02(0xfe))/0x1*(-parseInt(_0x776b02(0x105))/0x2)+parseInt(_0x776b02(0xf6))/0x3*(-parseInt(_0x776b02(0x111))/0x4)+-parseInt(_0x776b02(0x102))/0x5*(parseInt(_0x776b02(0xfc))/0x6)+-parseInt(_0x776b02(0x103))/0x7*(parseInt(_0x776b02(0x117))/0x8)+parseInt(_0x776b02(0x106))/0x9*(parseInt(_0x776b02(0xf8))/0xa)+parseInt(_0x776b02(0xf9))/0xb+parseInt(_0x776b02(0x107))/0xc;if(_0x4db53f===_0xbeec24)break;else _0x26999e['push'](_0x26999e['shift']());}catch(_0x4801f1){_0x26999e['push'](_0x26999e['shift']());}}}(a167_0x4192,0x4039b));function a167_0x4192(){const _0x40580c=['ADMIN','type','CUSTOM','Use\x20one\x20of:\x20','str','3HFYmrw','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','10qrhUEl','3233153trLhie','read','list','7074FlVYZK','trim','3796yBqzJz','toUpperCase','pagesize','validation','1200uYXKyo','35819fcYCyr','number','82JCcjcg','3012777UrGATg','9144108TTUScY','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','\x20role(s)','map','Found\x20','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','Page\x20index\x20(1-based)','DEV','page','Page\x20size\x20(1-100)','1507540zpDmFP','string','length','filter','num','includes','488PqAwGR','Filter\x20by\x20role\x20type'];a167_0x4192=function(){return _0x40580c;};return a167_0x4192();}import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';function a167_0x31af(_0x3ce872,_0x2c7a85){_0x3ce872=_0x3ce872-0xf3;const _0x4192e7=a167_0x4192();let _0x31af5a=_0x4192e7[_0x3ce872];return _0x31af5a;}const ROLE_TYPES=[a167_0x4252ef(0x119),a167_0x4252ef(0x10e),'USER',a167_0x4252ef(0xf3)];export const roleList={'service':'role','command':a167_0x4252ef(0xfb),'description':a167_0x4252ef(0x10c),'risk':a167_0x4252ef(0xfa),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a167_0x4252ef(0x11a),'type':a167_0x4252ef(0x112),'required':![],'description':a167_0x4252ef(0x118),'enum':ROLE_TYPES},{'name':a167_0x4252ef(0x10f),'type':a167_0x4252ef(0x104),'description':a167_0x4252ef(0x10d),'default':0x1},{'name':a167_0x4252ef(0x100),'type':'number','description':a167_0x4252ef(0x110),'default':0x64}],async 'validate'(_0x246f13){const _0x26fa99=a167_0x4252ef,_0x2e754b=_0x246f13['str'](_0x26fa99(0x11a))[_0x26fa99(0xfd)]();if(_0x2e754b&&!ROLE_TYPES[_0x26fa99(0x116)](_0x2e754b[_0x26fa99(0xff)]()))throw CliErrors[_0x26fa99(0x101)]('Invalid\x20--type\x20\x22'+_0x2e754b+'\x22.',_0x26fa99(0xf4)+ROLE_TYPES['join'](',\x20')+'.');const _0x22aad7=_0x246f13[_0x26fa99(0x115)](_0x26fa99(0x10f),0x1),_0x5d5df2=_0x246f13[_0x26fa99(0x115)]('pagesize',0x64);if(_0x22aad7<0x1)throw CliErrors[_0x26fa99(0x101)](_0x26fa99(0xf7));if(_0x5d5df2<0x1||_0x5d5df2>0x64)throw CliErrors[_0x26fa99(0x101)](_0x26fa99(0x108));},async 'execute'(_0x839e8a){const _0x2b9a57=a167_0x4252ef,_0x215e16=_0x839e8a[_0x2b9a57(0x115)](_0x2b9a57(0x10f),0x1)||0x1,_0x5020e6=_0x839e8a['num'](_0x2b9a57(0x100),0x64)||0x64,_0x5b0e4b=_0x839e8a[_0x2b9a57(0xf5)](_0x2b9a57(0x11a))['trim']()[_0x2b9a57(0xff)](),{items:_0x2d7c52,paging:_0x25e8b4}=await listAppRoles(_0x839e8a['appCode'],{'currentPage':_0x215e16,'pageSize':_0x5020e6}),_0x5a7322=_0x5b0e4b?_0x2d7c52[_0x2b9a57(0x114)](_0x3f5ffb=>_0x3f5ffb['roleType']===_0x5b0e4b):_0x2d7c52,_0x162aac=_0x5a7322[_0x2b9a57(0x10a)](projectRole);return{'ok':!![],'data':{'roles':_0x162aac,'paging':_0x25e8b4},'message':_0x2b9a57(0x10b)+_0x162aac[_0x2b9a57(0x113)]+_0x2b9a57(0x109)};}};
1
+ const a175_0x3ff9ef=a175_0x4db4;(function(_0x85e720,_0x219f80){const _0x216333=a175_0x4db4,_0x1d5bdb=_0x85e720();while(!![]){try{const _0x5bbfe4=-parseInt(_0x216333(0x170))/0x1*(-parseInt(_0x216333(0x16d))/0x2)+-parseInt(_0x216333(0x18b))/0x3*(-parseInt(_0x216333(0x179))/0x4)+parseInt(_0x216333(0x188))/0x5*(-parseInt(_0x216333(0x178))/0x6)+parseInt(_0x216333(0x168))/0x7+parseInt(_0x216333(0x181))/0x8+parseInt(_0x216333(0x16e))/0x9*(parseInt(_0x216333(0x177))/0xa)+parseInt(_0x216333(0x183))/0xb*(-parseInt(_0x216333(0x17b))/0xc);if(_0x5bbfe4===_0x219f80)break;else _0x1d5bdb['push'](_0x1d5bdb['shift']());}catch(_0x5073df){_0x1d5bdb['push'](_0x1d5bdb['shift']());}}}(a175_0x1ff9,0xd3013));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';function a175_0x4db4(_0x98fe5e,_0xbb917f){_0x98fe5e=_0x98fe5e-0x164;const _0x1ff98f=a175_0x1ff9();let _0x4db4e8=_0x1ff98f[_0x98fe5e];return _0x4db4e8;}const ROLE_TYPES=['ADMIN',a175_0x3ff9ef(0x187),'USER','CUSTOM'];export const roleList={'service':a175_0x3ff9ef(0x18a),'command':a175_0x3ff9ef(0x18c),'description':a175_0x3ff9ef(0x17c),'risk':a175_0x3ff9ef(0x186),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a175_0x3ff9ef(0x16c),'type':a175_0x3ff9ef(0x173),'required':![],'description':a175_0x3ff9ef(0x174),'enum':ROLE_TYPES},{'name':a175_0x3ff9ef(0x169),'type':a175_0x3ff9ef(0x17d),'description':a175_0x3ff9ef(0x17e),'default':0x1},{'name':a175_0x3ff9ef(0x165),'type':a175_0x3ff9ef(0x17d),'description':a175_0x3ff9ef(0x167),'default':0x64}],async 'validate'(_0x159af0){const _0x13b27e=a175_0x3ff9ef,_0x5348c7=_0x159af0[_0x13b27e(0x16a)]('type')[_0x13b27e(0x175)]();if(_0x5348c7&&!ROLE_TYPES['includes'](_0x5348c7[_0x13b27e(0x166)]()))throw CliErrors[_0x13b27e(0x16b)](_0x13b27e(0x17a)+_0x5348c7+'\x22.',_0x13b27e(0x164)+ROLE_TYPES[_0x13b27e(0x182)](',\x20')+'.');const _0xb8d513=_0x159af0['num'](_0x13b27e(0x169),0x1),_0x407f8c=_0x159af0[_0x13b27e(0x189)](_0x13b27e(0x165),0x64);if(_0xb8d513<0x1)throw CliErrors[_0x13b27e(0x16b)](_0x13b27e(0x171));if(_0x407f8c<0x1||_0x407f8c>0x64)throw CliErrors[_0x13b27e(0x16b)](_0x13b27e(0x185));},async 'execute'(_0x388dbc){const _0x1cf73a=a175_0x3ff9ef,_0x8939ba=_0x388dbc[_0x1cf73a(0x189)]('page',0x1)||0x1,_0xbcd89e=_0x388dbc['num']('pagesize',0x64)||0x64,_0x14406a=_0x388dbc['str']('type')[_0x1cf73a(0x175)]()[_0x1cf73a(0x166)](),{items:_0x3a4657,paging:_0x45f4ad}=await listAppRoles(_0x388dbc[_0x1cf73a(0x176)],{'currentPage':_0x8939ba,'pageSize':_0xbcd89e}),_0x359ab2=_0x14406a?_0x3a4657[_0x1cf73a(0x180)](_0x5ddcc7=>_0x5ddcc7[_0x1cf73a(0x16f)]===_0x14406a):_0x3a4657,_0x39a5b9=_0x359ab2[_0x1cf73a(0x172)](projectRole);return{'ok':!![],'data':{'roles':_0x39a5b9,'paging':_0x45f4ad},'message':_0x1cf73a(0x17f)+_0x39a5b9[_0x1cf73a(0x184)]+'\x20role(s)'};}};function a175_0x1ff9(){const _0x2843a9=['12535407VDHzia','roleType','6SwftzC','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','map','string','Filter\x20by\x20role\x20type','trim','appCode','10IHuKPg','12RfWVdq','140zfzejW','Invalid\x20--type\x20\x22','3155148AkxTJO','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','number','Page\x20index\x20(1-based)','Found\x20','filter','9606128NEVeoG','join','77siYsOp','length','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','read','DEV','3170705vVEJhG','num','role','39VuAbXW','list','Use\x20one\x20of:\x20','pagesize','toUpperCase','Page\x20size\x20(1-100)','1518678vseGdy','page','str','validation','type','387354dwdjhM'];a175_0x1ff9=function(){return _0x2843a9;};return a175_0x1ff9();}
@@ -1 +1 @@
1
- const a168_0x196cad=a168_0x3308;(function(_0xdfc8c8,_0xa3ed10){const _0x6b0c42=a168_0x3308,_0x1a1e37=_0xdfc8c8();while(!![]){try{const _0x9ffef7=parseInt(_0x6b0c42(0x9b))/0x1*(parseInt(_0x6b0c42(0xb2))/0x2)+-parseInt(_0x6b0c42(0x96))/0x3*(parseInt(_0x6b0c42(0xb8))/0x4)+parseInt(_0x6b0c42(0xaa))/0x5*(-parseInt(_0x6b0c42(0x91))/0x6)+parseInt(_0x6b0c42(0x8a))/0x7*(parseInt(_0x6b0c42(0x98))/0x8)+-parseInt(_0x6b0c42(0xd1))/0x9+-parseInt(_0x6b0c42(0xcb))/0xa+-parseInt(_0x6b0c42(0xd5))/0xb*(-parseInt(_0x6b0c42(0x8b))/0xc);if(_0x9ffef7===_0xa3ed10)break;else _0x1a1e37['push'](_0x1a1e37['shift']());}catch(_0x55cb58){_0x1a1e37['push'](_0x1a1e37['shift']());}}}(a168_0x3640,0x70f49));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';function a168_0x3308(_0x1dfc94,_0x4d92df){_0x1dfc94=_0x1dfc94-0x89;const _0x3640ff=a168_0x3640();let _0x3308b3=_0x3640ff[_0x1dfc94];return _0x3308b3;}import{CliErrors}from'../../errors.js';function a168_0x3640(){const _0x35b359=['POST','1045mPgxVa','User\x20','includes','Missing\x20user\x20reference.','find','587447kKJHlk','166884GCweSO','\x22\x20is\x20ambiguous\x20(ids:\x20','findIndex','role','flagMissing','dryRun','12JmzrrS',';\x20no\x20change.','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','Multiple\x20tenant\x20members\x20match\x20\x22','expectUserCount','3TXpzot','userId','16ZnCdVm','join','ADMIN','65hLslwv','USER','expect-user-count','roleType','\x20is\x20already\x20a\x20member\x20of\x20role\x20','push','username','tenant_code','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','\x20not\x20found\x20in\x20app\x20','/smartapi/permit/user-role/update-user-list','userList','Disambiguate\x20with\x20--role\x20<id>.','\x20not\x20found\x20in\x20the\x20user-role\x20list.','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','1853315DsHhob','remark','validation','roleName','appCode','filter','DEV','string','16474bVaimH','length','name','Disambiguate\x20with\x20--user\x20<id>.','Optional\x20role\x20remark/description','test','2479684cxMuXw','permitCount','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','\x20built-in\x20role\x20','Missing\x20role\x20reference.','Role\x20name\x20\x22','\x20is\x20not\x20a\x20member\x20of\x20role\x20','userCount','map','user','Role\x20id\x20(from\x20`role\x20list`)','authRequired','Pass\x20--role\x20<id|name>.','nickname','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','Pass\x20--user\x20<id|name>.','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','Role\x20id\x20','594170Ayzali','splice','trim','\x22:\x20','\x22\x20not\x20found\x20in\x20app\x20','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','1269747eCDrGG','toLowerCase','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.'];a168_0x3640=function(){return _0x35b359;};return a168_0x3640();}export const ROLE_ID_FLAG={'name':'id','type':'number','required':!![],'description':a168_0x196cad(0xc2)};export const ROLE_REF_FLAG={'name':a168_0x196cad(0x8e),'type':a168_0x196cad(0xb1),'required':!![],'description':a168_0x196cad(0xba)};export const USER_REF_FLAG={'name':a168_0x196cad(0xc1),'type':'string','required':!![],'description':a168_0x196cad(0x93)};export const NAME_FLAG={'name':a168_0x196cad(0xb4),'type':a168_0x196cad(0xb1),'required':!![],'description':'Role\x20name'};export const USER_NAME_FLAG={'name':a168_0x196cad(0xb4),'type':'string','required':!![],'description':a168_0x196cad(0xd0)};export const REMARK_FLAG={'name':a168_0x196cad(0xab),'type':a168_0x196cad(0xb1),'required':![],'description':a168_0x196cad(0xb6)};export const EXPECT_USER_COUNT_FLAG={'name':'expect-user-count','type':'number','required':![],'description':a168_0x196cad(0xa3)};export const BUILTIN_ROLE_TYPES=[a168_0x196cad(0x9a),'DEV',a168_0x196cad(0x9c)];export function isBuiltinRole(_0x5b006c){const _0x23f377=a168_0x196cad;return BUILTIN_ROLE_TYPES[_0x23f377(0xd7)](_0x5b006c);}export function assertCustomRole(_0x23e4e5,_0x523a76){const _0x261ddc=a168_0x196cad;if(_0x23e4e5['roleType']!=='CUSTOM')throw CliErrors[_0x261ddc(0xac)]('Cannot\x20'+_0x523a76+_0x261ddc(0xbb)+_0x23e4e5[_0x261ddc(0xad)]+'\x20('+_0x23e4e5[_0x261ddc(0x9e)]+').',_0x261ddc(0xa9));}export function assertPermConfigurable(_0x4c449d){const _0x2b4950=a168_0x196cad;if(_0x4c449d[_0x2b4950(0x9e)]===_0x2b4950(0xb0)||_0x4c449d[_0x2b4950(0x9e)]===_0x2b4950(0x9a))throw CliErrors[_0x2b4950(0xac)](_0x2b4950(0xc7)+_0x4c449d['roleName']+'\x20('+_0x4c449d[_0x2b4950(0x9e)]+').','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.');}export function projectRole(_0x40a834){const _0x11b594=a168_0x196cad;return{'id':_0x40a834['id'],'roleName':_0x40a834[_0x11b594(0xad)],'roleType':_0x40a834[_0x11b594(0x9e)],'remark':_0x40a834[_0x11b594(0xab)],'userCount':_0x40a834[_0x11b594(0xbf)],'permitCount':_0x40a834[_0x11b594(0xb9)],'builtin':isBuiltinRole(_0x40a834[_0x11b594(0x9e)])};}export async function resolveRoleRef(_0x3d0bf9,_0x48478e){const _0x43e8e6=a168_0x196cad,_0x4515d5=_0x48478e[_0x43e8e6(0xcd)]();if(!_0x4515d5)throw CliErrors[_0x43e8e6(0xac)](_0x43e8e6(0xbc),_0x43e8e6(0xc4));if(/^\d+$/[_0x43e8e6(0xb7)](_0x4515d5))return getRoleById(_0x3d0bf9,Number(_0x4515d5));const _0xbbc6bd=await listAllAppRoles(_0x3d0bf9),_0x17f3a7=_0xbbc6bd[_0x43e8e6(0xaf)](_0x297145=>_0x297145['roleName']===_0x4515d5);if(_0x17f3a7[_0x43e8e6(0xb3)]===0x0)throw CliErrors[_0x43e8e6(0xac)](_0x43e8e6(0xbd)+_0x4515d5+_0x43e8e6(0xcf)+_0x3d0bf9+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.');if(_0x17f3a7['length']>0x1){const _0x34f2a5=_0x17f3a7['map'](_0xf66bb0=>_0xf66bb0['id'])['join'](',\x20');throw CliErrors['validation'](_0x43e8e6(0xbd)+_0x4515d5+_0x43e8e6(0x8c)+_0x34f2a5+').',_0x43e8e6(0xa7));}return _0x17f3a7[0x0];}export async function getRoleById(_0x3c6b24,_0x9c5dcd){const _0x2e75ed=a168_0x196cad,_0x33a46d=await getAppRole(_0x9c5dcd);if(!_0x33a46d)throw CliErrors[_0x2e75ed(0xac)](_0x2e75ed(0xca)+_0x9c5dcd+_0x2e75ed(0xa4)+_0x3c6b24+'.',_0x2e75ed(0xd3));return _0x33a46d;}async function listAllAppRoles(_0x29d6a1){const _0x52c714=a168_0x196cad,_0x11917f=0x64,_0x4e5db4=[];for(let _0x2f2df3=0x1;;_0x2f2df3+=0x1){const {items:_0x562efa,paging:_0x121a91}=await listAppRoles(_0x29d6a1,{'currentPage':_0x2f2df3,'pageSize':_0x11917f});_0x4e5db4[_0x52c714(0xa0)](..._0x562efa);if(_0x562efa[_0x52c714(0xb3)]<_0x11917f||_0x121a91&&_0x4e5db4[_0x52c714(0xb3)]>=_0x121a91['totalCount'])return _0x4e5db4;}}export async function resolveTenantCode(){const _0x5d5546=a168_0x196cad,_0x28994a=await getSessionUserInfo(),_0x226a15=_0x28994a?.['user']?.['tenant']?.[_0x5d5546(0xa2)];if(!_0x226a15)throw CliErrors[_0x5d5546(0xc3)](_0x5d5546(0xc9));return _0x226a15;}function matchMember(_0x1f96e0,_0x15444b){const _0x39747d=a168_0x196cad,_0x8e7b24=_0x15444b[_0x39747d(0xcd)]()[_0x39747d(0xd2)]();return(_0x1f96e0[_0x39747d(0xc5)]??'')[_0x39747d(0xd2)]()===_0x8e7b24||(_0x1f96e0['username']??'')[_0x39747d(0xd2)]()===_0x8e7b24;}export async function resolveUserRef(_0x5683af){const _0x165db2=a168_0x196cad,_0x401246=_0x5683af[_0x165db2(0xcd)]();if(!_0x401246)throw CliErrors['validation'](_0x165db2(0xd8),_0x165db2(0xc8));const _0x4e3607=await resolveTenantCode(),_0x3bfc52=await getTenantMembers(_0x4e3607);if(/^\d+$/['test'](_0x401246)){const _0x5565b4=Number(_0x401246),_0xc3060b=_0x3bfc52[_0x165db2(0x89)](_0x2672ce=>_0x2672ce[_0x165db2(0x97)]===_0x5565b4);return{'userId':_0x5565b4,'username':_0xc3060b?.['username']??String(_0x5565b4),'nickname':_0xc3060b?.[_0x165db2(0xc5)],'matchedBy':'id'};}const _0x540a58=_0x3bfc52['filter'](_0x376818=>matchMember(_0x376818,_0x401246));if(_0x540a58[_0x165db2(0xb3)]===0x0)throw CliErrors[_0x165db2(0xac)]('No\x20tenant\x20member\x20matches\x20\x22'+_0x401246+'\x22.','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.');if(_0x540a58['length']>0x1){const _0x52e696=_0x540a58[_0x165db2(0xc0)](_0x417414=>(_0x417414['nickname']??_0x417414[_0x165db2(0xa1)]??'?')+'('+_0x417414[_0x165db2(0x97)]+')')[_0x165db2(0x99)](',\x20');throw CliErrors[_0x165db2(0xac)](_0x165db2(0x94)+_0x401246+_0x165db2(0xce)+_0x52e696+'.',_0x165db2(0xb5));}const _0x5e9b0e=_0x540a58[0x0];return{'userId':_0x5e9b0e[_0x165db2(0x97)],'username':_0x5e9b0e[_0x165db2(0xa1)]??String(_0x5e9b0e['userId']),'nickname':_0x5e9b0e[_0x165db2(0xc5)],'matchedBy':_0x165db2(0xb4)};}export const UPDATE_USER_LIST_PATH=a168_0x196cad(0xa5);function userIdsOf(_0x59bb62){return(_0x59bb62?.['userList']??[])['map'](_0x403803=>_0x403803['userId']);}export function computeRoleUserMutation(_0x5ba2f7){const _0x16984a=a168_0x196cad,{operation:_0x2c4d7f,appCode:_0x3f9539,roleUsers:_0x39f172,targetRoleId:_0x51619b,user:_0x267e0a}=_0x5ba2f7,_0x147064=_0x39f172[_0x16984a(0x89)](_0x39b3c9=>_0x39b3c9['id']===_0x51619b);if(!_0x147064)throw CliErrors[_0x16984a(0xac)](_0x16984a(0xca)+_0x51619b+_0x16984a(0xa8),_0x16984a(0xd3));const _0x118a84=userIdsOf(_0x147064),_0x12eb8d=[];if(_0x5ba2f7[_0x16984a(0x95)]!==undefined&&_0x5ba2f7['expectUserCount']!==_0x118a84[_0x16984a(0xb3)])throw CliErrors['validation']('Anti-drift\x20check\x20failed:\x20expected\x20'+_0x5ba2f7[_0x16984a(0x95)]+'\x20member(s)\x20but\x20role\x20has\x20'+_0x118a84[_0x16984a(0xb3)]+'.',_0x16984a(0xc6));const _0x2c0a8f=_0x118a84[_0x16984a(0xd7)](_0x267e0a[_0x16984a(0x97)]);let _0x1a63dc=![];const _0x3a7947=[..._0x147064[_0x16984a(0xa6)]];if(_0x2c4d7f==='user-add')_0x2c0a8f?_0x12eb8d['push']('User\x20'+_0x267e0a['userId']+_0x16984a(0x9f)+_0x147064[_0x16984a(0xad)]+_0x16984a(0x92)):(_0x3a7947[_0x16984a(0xa0)]({'userId':_0x267e0a[_0x16984a(0x97)],'username':_0x267e0a[_0x16984a(0xa1)],..._0x267e0a[_0x16984a(0xc5)]?{'nickname':_0x267e0a[_0x16984a(0xc5)]}:{}}),_0x1a63dc=!![]);else{if(!_0x2c0a8f)_0x12eb8d[_0x16984a(0xa0)](_0x16984a(0xd6)+_0x267e0a[_0x16984a(0x97)]+_0x16984a(0xbe)+_0x147064['roleName']+_0x16984a(0x92));else{const _0x36819c=_0x3a7947[_0x16984a(0x8d)](_0x3eb80b=>_0x3eb80b[_0x16984a(0x97)]===_0x267e0a[_0x16984a(0x97)]);if(_0x36819c>=0x0)_0x3a7947[_0x16984a(0xcc)](_0x36819c,0x1);_0x1a63dc=!![];}}const _0x25102a=_0x39f172[_0x16984a(0xc0)](_0x4cda65=>_0x4cda65['id']===_0x51619b?{..._0x4cda65,'userList':_0x3a7947}:_0x4cda65),_0x21a04f=_0x3a7947[_0x16984a(0xc0)](_0x36e1df=>_0x36e1df[_0x16984a(0x97)]),_0x1854ee={'operation':_0x2c4d7f,'selector':{'appCode':_0x3f9539,'roleId':_0x51619b,'roleName':_0x147064[_0x16984a(0xad)],'userId':_0x267e0a['userId']},'before':{'userIds':_0x118a84},'after':{'userIds':_0x21a04f},'dryRun':_0x5ba2f7[_0x16984a(0x90)],'backend':{'method':_0x16984a(0xd4),'path':UPDATE_USER_LIST_PATH},'warnings':_0x12eb8d};return{'roleList':_0x25102a,'mutation':_0x1854ee,'changed':_0x1a63dc};}export async function loadRoleUsers(_0x239877){return listRoleUsers(_0x239877);}export function readRoleRef(_0x55c2ec){const _0x451c1d=a168_0x196cad,_0x5f57a4=_0x55c2ec['str'](_0x451c1d(0x8e))[_0x451c1d(0xcd)]();if(!_0x5f57a4)throw CliErrors[_0x451c1d(0x8f)](_0x451c1d(0x8e),_0x451c1d(0xc4));return _0x5f57a4;}export async function prepareUserMutation(_0x261ceb,_0x34218f,_0x58be6c){const _0x10a06f=a168_0x196cad,_0x50c0ab=readRoleRef(_0x261ceb),_0xdb4cc8=_0x261ceb['str']('user')['trim']();if(!_0xdb4cc8)throw CliErrors['flagMissing'](_0x10a06f(0xc1),'Pass\x20--user\x20<id|name>.');const _0x4c3ff0=_0x261ceb['flag'](_0x10a06f(0x9d)),_0x482e11=_0x4c3ff0===undefined||_0x4c3ff0===null?undefined:Number(_0x4c3ff0),_0x436621=await resolveRoleRef(_0x261ceb[_0x10a06f(0xae)],_0x50c0ab),_0x3cb2e8=await resolveUserRef(_0xdb4cc8),_0x9274a8=await loadRoleUsers(_0x261ceb['appCode']);return computeRoleUserMutation({'operation':_0x34218f,'appCode':_0x261ceb['appCode'],'roleUsers':_0x9274a8,'targetRoleId':_0x436621['id'],'user':{'userId':_0x3cb2e8[_0x10a06f(0x97)],'username':_0x3cb2e8[_0x10a06f(0xa1)],'nickname':_0x3cb2e8['nickname']},'dryRun':_0x58be6c,..._0x482e11!==undefined?{'expectUserCount':_0x482e11}:{}});}
1
+ const a176_0x4b236c=a176_0x5a2f;(function(_0x33be22,_0x13c3b0){const _0x490442=a176_0x5a2f,_0x22ad9f=_0x33be22();while(!![]){try{const _0x45a44a=parseInt(_0x490442(0xb0))/0x1*(parseInt(_0x490442(0x83))/0x2)+-parseInt(_0x490442(0x9a))/0x3*(parseInt(_0x490442(0x99))/0x4)+parseInt(_0x490442(0x82))/0x5*(-parseInt(_0x490442(0x73))/0x6)+-parseInt(_0x490442(0xa0))/0x7*(parseInt(_0x490442(0x74))/0x8)+parseInt(_0x490442(0xa3))/0x9+parseInt(_0x490442(0x6c))/0xa*(-parseInt(_0x490442(0x6a))/0xb)+-parseInt(_0x490442(0x79))/0xc*(-parseInt(_0x490442(0xa6))/0xd);if(_0x45a44a===_0x13c3b0)break;else _0x22ad9f['push'](_0x22ad9f['shift']());}catch(_0x4a7791){_0x22ad9f['push'](_0x22ad9f['shift']());}}}(a176_0x2030,0x9e958));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';function a176_0x2030(){const _0x39065f=['Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','CUSTOM','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','\x20not\x20found\x20in\x20the\x20user-role\x20list.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','splice','dryRun','string','DEV','Missing\x20user\x20reference.','Pass\x20--role\x20<id|name>.','tenant_code','8896217tkhaZL','\x20member(s)\x20but\x20role\x20has\x20','10vPmyus','number','test','user','Pass\x20--user\x20<id|name>.','\x22\x20is\x20ambiguous\x20(ids:\x20','USER','29730LsgaKn','40zILpjn','No\x20tenant\x20member\x20matches\x20\x22','\x20is\x20not\x20a\x20member\x20of\x20role\x20','Role\x20id\x20(from\x20`role\x20list`)','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','36xxDTMw','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','\x20built-in\x20role\x20','find','tenant','map','Role\x20id\x20','\x22\x20not\x20found\x20in\x20app\x20','285ujwgTY','10GjflFI','Missing\x20role\x20reference.','roleName','flagMissing','trim','str','username','role','permitCount','length','Disambiguate\x20with\x20--role\x20<id>.','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','expect-user-count','validation','POST','toLowerCase','filter','ADMIN','push','userList','includes','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','4504ZjlQSV','2811ddTomL','userId','Role\x20name\x20\x22','totalCount','remark','\x20is\x20already\x20a\x20member\x20of\x20role\x20','1539797eikTsI','Disambiguate\x20with\x20--user\x20<id>.','appCode','272007fuaYgc','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','User\x20','16538691PiUQHN','name','user-add','join',';\x20no\x20change.','Multiple\x20tenant\x20members\x20match\x20\x22','userCount','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','expectUserCount','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','9763espYoZ','flag','roleType','nickname'];a176_0x2030=function(){return _0x39065f;};return a176_0x2030();}import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':'number','required':!![],'description':a176_0x4b236c(0x77)};export const ROLE_REF_FLAG={'name':a176_0x4b236c(0x8a),'type':a176_0x4b236c(0xbb),'required':!![],'description':a176_0x4b236c(0xb6)};export const USER_REF_FLAG={'name':a176_0x4b236c(0x6f),'type':a176_0x4b236c(0xbb),'required':!![],'description':a176_0x4b236c(0xa4)};export const NAME_FLAG={'name':a176_0x4b236c(0xa7),'type':a176_0x4b236c(0xbb),'required':!![],'description':'Role\x20name'};export const USER_NAME_FLAG={'name':a176_0x4b236c(0xa7),'type':'string','required':!![],'description':'Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId'};export const REMARK_FLAG={'name':a176_0x4b236c(0x9e),'type':a176_0x4b236c(0xbb),'required':![],'description':'Optional\x20role\x20remark/description'};export const EXPECT_USER_COUNT_FLAG={'name':'expect-user-count','type':a176_0x4b236c(0x6d),'required':![],'description':a176_0x4b236c(0xaf)};export const BUILTIN_ROLE_TYPES=[a176_0x4b236c(0x94),a176_0x4b236c(0xbc),a176_0x4b236c(0x72)];export function isBuiltinRole(_0x1829ed){const _0x4d2ca6=a176_0x4b236c;return BUILTIN_ROLE_TYPES[_0x4d2ca6(0x97)](_0x1829ed);}export function assertCustomRole(_0x5d89f8,_0x35c458){const _0x22c92c=a176_0x4b236c;if(_0x5d89f8['roleType']!==_0x22c92c(0xb5))throw CliErrors[_0x22c92c(0x90)]('Cannot\x20'+_0x35c458+_0x22c92c(0x7c)+_0x5d89f8[_0x22c92c(0x85)]+'\x20('+_0x5d89f8[_0x22c92c(0xb2)]+').',_0x22c92c(0x78));}export function assertPermConfigurable(_0x3f51c3){const _0x4c9ef0=a176_0x4b236c;if(_0x3f51c3[_0x4c9ef0(0xb2)]==='DEV'||_0x3f51c3['roleType']===_0x4c9ef0(0x94))throw CliErrors[_0x4c9ef0(0x90)](_0x4c9ef0(0xb4)+_0x3f51c3[_0x4c9ef0(0x85)]+'\x20('+_0x3f51c3[_0x4c9ef0(0xb2)]+').',_0x4c9ef0(0x8e));}export function projectRole(_0x29a43d){const _0x4ed004=a176_0x4b236c;return{'id':_0x29a43d['id'],'roleName':_0x29a43d[_0x4ed004(0x85)],'roleType':_0x29a43d[_0x4ed004(0xb2)],'remark':_0x29a43d[_0x4ed004(0x9e)],'userCount':_0x29a43d[_0x4ed004(0xac)],'permitCount':_0x29a43d[_0x4ed004(0x8b)],'builtin':isBuiltinRole(_0x29a43d['roleType'])};}export async function resolveRoleRef(_0x432256,_0x2dd482){const _0x20a696=a176_0x4b236c,_0x10587e=_0x2dd482[_0x20a696(0x87)]();if(!_0x10587e)throw CliErrors[_0x20a696(0x90)](_0x20a696(0x84),_0x20a696(0x68));if(/^\d+$/['test'](_0x10587e))return getRoleById(_0x432256,Number(_0x10587e));const _0x475084=await listAllAppRoles(_0x432256),_0x547a36=_0x475084[_0x20a696(0x93)](_0x36d29a=>_0x36d29a['roleName']===_0x10587e);if(_0x547a36[_0x20a696(0x8c)]===0x0)throw CliErrors[_0x20a696(0x90)]('Role\x20name\x20\x22'+_0x10587e+_0x20a696(0x81)+_0x432256+'.',_0x20a696(0xb8));if(_0x547a36[_0x20a696(0x8c)]>0x1){const _0x3a2a73=_0x547a36[_0x20a696(0x7f)](_0x14ee14=>_0x14ee14['id'])[_0x20a696(0xa9)](',\x20');throw CliErrors['validation'](_0x20a696(0x9c)+_0x10587e+_0x20a696(0x71)+_0x3a2a73+').',_0x20a696(0x8d));}return _0x547a36[0x0];}export async function getRoleById(_0x3683e7,_0x9cfe9){const _0x543f4e=a176_0x4b236c,_0x28665d=await getAppRole(_0x9cfe9);if(!_0x28665d)throw CliErrors[_0x543f4e(0x90)](_0x543f4e(0x80)+_0x9cfe9+'\x20not\x20found\x20in\x20app\x20'+_0x3683e7+'.',_0x543f4e(0xad));return _0x28665d;}async function listAllAppRoles(_0x25022c){const _0x1a5406=a176_0x4b236c,_0x4f71e2=0x64,_0x1b9a7e=[];for(let _0x25ad86=0x1;;_0x25ad86+=0x1){const {items:_0x4b515c,paging:_0x2061cd}=await listAppRoles(_0x25022c,{'currentPage':_0x25ad86,'pageSize':_0x4f71e2});_0x1b9a7e[_0x1a5406(0x95)](..._0x4b515c);if(_0x4b515c['length']<_0x4f71e2||_0x2061cd&&_0x1b9a7e[_0x1a5406(0x8c)]>=_0x2061cd[_0x1a5406(0x9d)])return _0x1b9a7e;}}export async function resolveTenantCode(){const _0x4886e9=a176_0x4b236c,_0x229a72=await getSessionUserInfo(),_0x4d8491=_0x229a72?.['user']?.[_0x4886e9(0x7e)]?.[_0x4886e9(0x69)];if(!_0x4d8491)throw CliErrors['authRequired'](_0x4886e9(0x7b));return _0x4d8491;}function matchMember(_0x4880fb,_0x2c372a){const _0x3db67c=a176_0x4b236c,_0x4bc077=_0x2c372a[_0x3db67c(0x87)]()['toLowerCase']();return(_0x4880fb['nickname']??'')[_0x3db67c(0x92)]()===_0x4bc077||(_0x4880fb['username']??'')[_0x3db67c(0x92)]()===_0x4bc077;}export async function resolveUserRef(_0x31e51f){const _0x1ccd4a=a176_0x4b236c,_0x42548a=_0x31e51f[_0x1ccd4a(0x87)]();if(!_0x42548a)throw CliErrors[_0x1ccd4a(0x90)](_0x1ccd4a(0xbd),_0x1ccd4a(0x70));const _0x4c8745=await resolveTenantCode(),_0x2b9fd2=await getTenantMembers(_0x4c8745);if(/^\d+$/[_0x1ccd4a(0x6e)](_0x42548a)){const _0x3dc3df=Number(_0x42548a),_0xf77033=_0x2b9fd2[_0x1ccd4a(0x7d)](_0x35154f=>_0x35154f['userId']===_0x3dc3df);return{'userId':_0x3dc3df,'username':_0xf77033?.[_0x1ccd4a(0x89)]??String(_0x3dc3df),'nickname':_0xf77033?.[_0x1ccd4a(0xb3)],'matchedBy':'id'};}const _0x371e19=_0x2b9fd2[_0x1ccd4a(0x93)](_0x560e8d=>matchMember(_0x560e8d,_0x42548a));if(_0x371e19[_0x1ccd4a(0x8c)]===0x0)throw CliErrors[_0x1ccd4a(0x90)](_0x1ccd4a(0x75)+_0x42548a+'\x22.',_0x1ccd4a(0x98));if(_0x371e19[_0x1ccd4a(0x8c)]>0x1){const _0x6a01d1=_0x371e19['map'](_0x2972f2=>(_0x2972f2[_0x1ccd4a(0xb3)]??_0x2972f2[_0x1ccd4a(0x89)]??'?')+'('+_0x2972f2['userId']+')')[_0x1ccd4a(0xa9)](',\x20');throw CliErrors[_0x1ccd4a(0x90)](_0x1ccd4a(0xab)+_0x42548a+'\x22:\x20'+_0x6a01d1+'.',_0x1ccd4a(0xa1));}const _0x3d1f04=_0x371e19[0x0];return{'userId':_0x3d1f04[_0x1ccd4a(0x9b)],'username':_0x3d1f04[_0x1ccd4a(0x89)]??String(_0x3d1f04['userId']),'nickname':_0x3d1f04['nickname'],'matchedBy':_0x1ccd4a(0xa7)};}export const UPDATE_USER_LIST_PATH='/smartapi/permit/user-role/update-user-list';function a176_0x5a2f(_0x388dc1,_0x10c79f){_0x388dc1=_0x388dc1-0x68;const _0x20300d=a176_0x2030();let _0x5a2f59=_0x20300d[_0x388dc1];return _0x5a2f59;}function userIdsOf(_0x1c6615){const _0x5b63bf=a176_0x4b236c;return(_0x1c6615?.[_0x5b63bf(0x96)]??[])[_0x5b63bf(0x7f)](_0x2a2aa0=>_0x2a2aa0[_0x5b63bf(0x9b)]);}export function computeRoleUserMutation(_0x7e6069){const _0x546bf2=a176_0x4b236c,{operation:_0x3494ce,appCode:_0x152a2f,roleUsers:_0x463567,targetRoleId:_0x545dc0,user:_0x4dbb8b}=_0x7e6069,_0x48a8bb=_0x463567[_0x546bf2(0x7d)](_0xbbbe9b=>_0xbbbe9b['id']===_0x545dc0);if(!_0x48a8bb)throw CliErrors[_0x546bf2(0x90)]('Role\x20id\x20'+_0x545dc0+_0x546bf2(0xb7),_0x546bf2(0xad));const _0xe648ed=userIdsOf(_0x48a8bb),_0x2d68c0=[];if(_0x7e6069['expectUserCount']!==undefined&&_0x7e6069[_0x546bf2(0xae)]!==_0xe648ed['length'])throw CliErrors[_0x546bf2(0x90)]('Anti-drift\x20check\x20failed:\x20expected\x20'+_0x7e6069[_0x546bf2(0xae)]+_0x546bf2(0x6b)+_0xe648ed[_0x546bf2(0x8c)]+'.',_0x546bf2(0x7a));const _0x58405e=_0xe648ed[_0x546bf2(0x97)](_0x4dbb8b[_0x546bf2(0x9b)]);let _0x2cf895=![];const _0xc96144=[..._0x48a8bb['userList']];if(_0x3494ce===_0x546bf2(0xa8))_0x58405e?_0x2d68c0[_0x546bf2(0x95)](_0x546bf2(0xa5)+_0x4dbb8b[_0x546bf2(0x9b)]+_0x546bf2(0x9f)+_0x48a8bb[_0x546bf2(0x85)]+_0x546bf2(0xaa)):(_0xc96144[_0x546bf2(0x95)]({'userId':_0x4dbb8b[_0x546bf2(0x9b)],'username':_0x4dbb8b['username'],..._0x4dbb8b[_0x546bf2(0xb3)]?{'nickname':_0x4dbb8b[_0x546bf2(0xb3)]}:{}}),_0x2cf895=!![]);else{if(!_0x58405e)_0x2d68c0['push'](_0x546bf2(0xa5)+_0x4dbb8b['userId']+_0x546bf2(0x76)+_0x48a8bb['roleName']+_0x546bf2(0xaa));else{const _0x35d120=_0xc96144['findIndex'](_0x288d49=>_0x288d49[_0x546bf2(0x9b)]===_0x4dbb8b[_0x546bf2(0x9b)]);if(_0x35d120>=0x0)_0xc96144[_0x546bf2(0xb9)](_0x35d120,0x1);_0x2cf895=!![];}}const _0x2b250b=_0x463567[_0x546bf2(0x7f)](_0x4c822d=>_0x4c822d['id']===_0x545dc0?{..._0x4c822d,'userList':_0xc96144}:_0x4c822d),_0x3c3522=_0xc96144['map'](_0x358e7c=>_0x358e7c[_0x546bf2(0x9b)]),_0x5dea9d={'operation':_0x3494ce,'selector':{'appCode':_0x152a2f,'roleId':_0x545dc0,'roleName':_0x48a8bb[_0x546bf2(0x85)],'userId':_0x4dbb8b[_0x546bf2(0x9b)]},'before':{'userIds':_0xe648ed},'after':{'userIds':_0x3c3522},'dryRun':_0x7e6069[_0x546bf2(0xba)],'backend':{'method':_0x546bf2(0x91),'path':UPDATE_USER_LIST_PATH},'warnings':_0x2d68c0};return{'roleList':_0x2b250b,'mutation':_0x5dea9d,'changed':_0x2cf895};}export async function loadRoleUsers(_0x14e107){return listRoleUsers(_0x14e107);}export function readRoleRef(_0xde2903){const _0xc3e7ff=a176_0x4b236c,_0x24f879=_0xde2903[_0xc3e7ff(0x88)](_0xc3e7ff(0x8a))['trim']();if(!_0x24f879)throw CliErrors[_0xc3e7ff(0x86)](_0xc3e7ff(0x8a),_0xc3e7ff(0x68));return _0x24f879;}export async function prepareUserMutation(_0x2fb625,_0x753c50,_0x29b740){const _0x52f5a8=a176_0x4b236c,_0x325559=readRoleRef(_0x2fb625),_0x1040aa=_0x2fb625[_0x52f5a8(0x88)](_0x52f5a8(0x6f))[_0x52f5a8(0x87)]();if(!_0x1040aa)throw CliErrors[_0x52f5a8(0x86)]('user','Pass\x20--user\x20<id|name>.');const _0x23084f=_0x2fb625[_0x52f5a8(0xb1)](_0x52f5a8(0x8f)),_0x2380cd=_0x23084f===undefined||_0x23084f===null?undefined:Number(_0x23084f),_0x164fe6=await resolveRoleRef(_0x2fb625[_0x52f5a8(0xa2)],_0x325559),_0xc4058c=await resolveUserRef(_0x1040aa),_0x455563=await loadRoleUsers(_0x2fb625[_0x52f5a8(0xa2)]);return computeRoleUserMutation({'operation':_0x753c50,'appCode':_0x2fb625[_0x52f5a8(0xa2)],'roleUsers':_0x455563,'targetRoleId':_0x164fe6['id'],'user':{'userId':_0xc4058c[_0x52f5a8(0x9b)],'username':_0xc4058c['username'],'nickname':_0xc4058c[_0x52f5a8(0xb3)]},'dryRun':_0x29b740,..._0x2380cd!==undefined?{'expectUserCount':_0x2380cd}:{}});}
@@ -1 +1 @@
1
- const a169_0x3f4b9e=a169_0x2715;(function(_0x8d42bf,_0x57fe1c){const _0x4ba4b0=a169_0x2715,_0x2e6712=_0x8d42bf();while(!![]){try{const _0x46f2de=-parseInt(_0x4ba4b0(0xad))/0x1*(parseInt(_0x4ba4b0(0xbf))/0x2)+-parseInt(_0x4ba4b0(0xc2))/0x3+parseInt(_0x4ba4b0(0xb9))/0x4+-parseInt(_0x4ba4b0(0xc0))/0x5*(parseInt(_0x4ba4b0(0xb7))/0x6)+-parseInt(_0x4ba4b0(0xb8))/0x7+-parseInt(_0x4ba4b0(0xc1))/0x8*(parseInt(_0x4ba4b0(0xc3))/0x9)+parseInt(_0x4ba4b0(0xba))/0xa;if(_0x46f2de===_0x57fe1c)break;else _0x2e6712['push'](_0x2e6712['shift']());}catch(_0x1d38ce){_0x2e6712['push'](_0x2e6712['shift']());}}}(a169_0x3e07,0x4544a));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 a169_0x2715(_0x19348f,_0xa48146){_0x19348f=_0x19348f-0xa8;const _0x3e0753=a169_0x3e07();let _0x27151d=_0x3e0753[_0x19348f];return _0x27151d;}const UPDATE_PATH=a169_0x3f4b9e(0xbd);function readPatch(_0x18cd44){const _0x20adf9=a169_0x3f4b9e,_0x4b1d6a=_0x18cd44['flag'](_0x20adf9(0xb1)),_0x1269e3=_0x18cd44['flag']('remark'),_0x5eeb5b={};if(_0x4b1d6a!==undefined&&_0x4b1d6a!==null){const _0x51641e=String(_0x4b1d6a)[_0x20adf9(0xac)]();if(!_0x51641e)throw CliErrors[_0x20adf9(0xae)](_0x20adf9(0xbe));if(_0x51641e['length']>0x40)throw CliErrors['validation']('Role\x20name\x20cannot\x20exceed\x2064\x20characters.');_0x5eeb5b[_0x20adf9(0xb6)]=_0x51641e;}_0x1269e3!==undefined&&_0x1269e3!==null&&(_0x5eeb5b[_0x20adf9(0xaa)]=String(_0x1269e3));if(_0x5eeb5b[_0x20adf9(0xb6)]===undefined&&_0x5eeb5b[_0x20adf9(0xaa)]===undefined)throw CliErrors[_0x20adf9(0xae)](_0x20adf9(0xaf),_0x20adf9(0xb2));return _0x5eeb5b;}function a169_0x3e07(){const _0x5afa27=['5274tFdfRe','935arBYzw','951600McovpG','649452AWRqAX','18WeAdcJ','string','Updated\x20role\x20','remark','POST','trim','88EFEVSF','validation','Nothing\x20to\x20update.','\x20(id=','name','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','num','update','roleName','15402Ngabzc','2790830MmyJNd','92160KTASoA','18258410FEjgzZ','write','appCode','/smartapi/permit/role/update','--name\x20cannot\x20be\x20empty.'];a169_0x3e07=function(){return _0x5afa27;};return a169_0x3e07();}export const roleUpdate={'service':'role','command':a169_0x3f4b9e(0xb5),'description':a169_0x3f4b9e(0xb3),'risk':a169_0x3f4b9e(0xbb),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a169_0x3f4b9e(0xb1),'type':a169_0x3f4b9e(0xa8),'required':![],'description':'New\x20role\x20name'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x39ac56){readPatch(_0x39ac56);},async 'dryRun'(_0xbec861){const _0x1905d4=a169_0x3f4b9e,_0x3e29e8=_0xbec861['num']('id'),_0xb4607d=readPatch(_0xbec861),_0x370c66=await getRoleById(_0xbec861['appCode'],_0x3e29e8);return assertCustomRole(_0x370c66,'update'),asDryRunResult({'operation':_0x1905d4(0xb5),'selector':{'appCode':_0xbec861['appCode'],'roleId':_0x3e29e8,'roleName':_0x370c66[_0x1905d4(0xb6)]},'before':projectRole(_0x370c66),'after':projectRole({..._0x370c66,..._0xb4607d['roleName']!==undefined?{'roleName':_0xb4607d[_0x1905d4(0xb6)]}:{},..._0xb4607d[_0x1905d4(0xaa)]!==undefined?{'remark':_0xb4607d[_0x1905d4(0xaa)]}:{}}),'dryRun':!![],'backend':{'method':_0x1905d4(0xab),'path':UPDATE_PATH},'warnings':[]},{'method':_0x1905d4(0xab),'url':UPDATE_PATH});},async 'execute'(_0x3c2712){const _0x150d45=a169_0x3f4b9e,_0x321732=_0x3c2712[_0x150d45(0xb4)]('id'),_0x120e3a=readPatch(_0x3c2712),_0x257b79=await getRoleById(_0x3c2712['appCode'],_0x321732);assertCustomRole(_0x257b79,_0x150d45(0xb5)),await updateAppRole({'id':_0x321732,'appCode':_0x3c2712[_0x150d45(0xbc)],..._0x120e3a[_0x150d45(0xb6)]!==undefined?{'roleName':_0x120e3a['roleName']}:{},..._0x120e3a[_0x150d45(0xaa)]!==undefined?{'remark':_0x120e3a[_0x150d45(0xaa)]}:{}});const _0x5ed75f=await getRoleById(_0x3c2712[_0x150d45(0xbc)],_0x321732);return{'ok':!![],'data':{'operation':_0x150d45(0xb5),'selector':{'appCode':_0x3c2712['appCode'],'roleId':_0x321732,'roleName':_0x5ed75f[_0x150d45(0xb6)]},'before':projectRole(_0x257b79),'after':projectRole(_0x5ed75f),'dryRun':![],'backend':{'method':_0x150d45(0xab),'path':UPDATE_PATH},'warnings':[]},'message':_0x150d45(0xa9)+_0x5ed75f['roleName']+_0x150d45(0xb0)+_0x321732+')'};}};
1
+ const a177_0x49bda3=a177_0x25e9;(function(_0x4e3e69,_0x5e0d41){const _0x40ade9=a177_0x25e9,_0x480261=_0x4e3e69();while(!![]){try{const _0x550520=parseInt(_0x40ade9(0x12e))/0x1+parseInt(_0x40ade9(0x131))/0x2*(-parseInt(_0x40ade9(0x128))/0x3)+parseInt(_0x40ade9(0x122))/0x4+-parseInt(_0x40ade9(0x11d))/0x5+parseInt(_0x40ade9(0x120))/0x6*(-parseInt(_0x40ade9(0x11a))/0x7)+-parseInt(_0x40ade9(0x12a))/0x8+parseInt(_0x40ade9(0x118))/0x9;if(_0x550520===_0x5e0d41)break;else _0x480261['push'](_0x480261['shift']());}catch(_0x47a990){_0x480261['push'](_0x480261['shift']());}}}(a177_0xfd17,0xa4d9a));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a177_0xfd17(){const _0x306c19=['2641cWAFna','update','write','237496WMoPIy','--name\x20cannot\x20be\x20empty.','32132412GlBtxu','validation','1813NCvvLd','\x20(id=','New\x20role\x20name','5965625ZiTmNv','trim','name','8988chJvhb','Updated\x20role\x20','3993508XSnXLH','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','roleName','Nothing\x20to\x20update.','num','string','27oClsfu','remark','9969768QmtlwH','POST','/smartapi/permit/role/update','appCode'];a177_0xfd17=function(){return _0x306c19;};return a177_0xfd17();}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 a177_0x25e9(_0x13a215,_0x3ccb18){_0x13a215=_0x13a215-0x117;const _0xfd1761=a177_0xfd17();let _0x25e972=_0xfd1761[_0x13a215];return _0x25e972;}const UPDATE_PATH=a177_0x49bda3(0x12c);function readPatch(_0x24bf85){const _0x4abca3=a177_0x49bda3,_0xe4696=_0x24bf85['flag'](_0x4abca3(0x11f)),_0x2cd912=_0x24bf85['flag'](_0x4abca3(0x129)),_0x556608={};if(_0xe4696!==undefined&&_0xe4696!==null){const _0x29be92=String(_0xe4696)[_0x4abca3(0x11e)]();if(!_0x29be92)throw CliErrors[_0x4abca3(0x119)](_0x4abca3(0x117));if(_0x29be92['length']>0x40)throw CliErrors[_0x4abca3(0x119)]('Role\x20name\x20cannot\x20exceed\x2064\x20characters.');_0x556608[_0x4abca3(0x124)]=_0x29be92;}_0x2cd912!==undefined&&_0x2cd912!==null&&(_0x556608['remark']=String(_0x2cd912));if(_0x556608['roleName']===undefined&&_0x556608[_0x4abca3(0x129)]===undefined)throw CliErrors[_0x4abca3(0x119)](_0x4abca3(0x125),'Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.');return _0x556608;}export const roleUpdate={'service':'role','command':'update','description':a177_0x49bda3(0x123),'risk':a177_0x49bda3(0x130),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a177_0x49bda3(0x11f),'type':a177_0x49bda3(0x127),'required':![],'description':a177_0x49bda3(0x11c)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x10df2e){readPatch(_0x10df2e);},async 'dryRun'(_0x24a267){const _0x580315=a177_0x49bda3,_0x532bfc=_0x24a267[_0x580315(0x126)]('id'),_0x3b1b28=readPatch(_0x24a267),_0x59c773=await getRoleById(_0x24a267[_0x580315(0x12d)],_0x532bfc);return assertCustomRole(_0x59c773,'update'),asDryRunResult({'operation':_0x580315(0x12f),'selector':{'appCode':_0x24a267[_0x580315(0x12d)],'roleId':_0x532bfc,'roleName':_0x59c773[_0x580315(0x124)]},'before':projectRole(_0x59c773),'after':projectRole({..._0x59c773,..._0x3b1b28['roleName']!==undefined?{'roleName':_0x3b1b28[_0x580315(0x124)]}:{},..._0x3b1b28['remark']!==undefined?{'remark':_0x3b1b28[_0x580315(0x129)]}:{}}),'dryRun':!![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},{'method':_0x580315(0x12b),'url':UPDATE_PATH});},async 'execute'(_0x3d3975){const _0x28e7cf=a177_0x49bda3,_0x8665f5=_0x3d3975['num']('id'),_0x22fde8=readPatch(_0x3d3975),_0x80a935=await getRoleById(_0x3d3975[_0x28e7cf(0x12d)],_0x8665f5);assertCustomRole(_0x80a935,_0x28e7cf(0x12f)),await updateAppRole({'id':_0x8665f5,'appCode':_0x3d3975['appCode'],..._0x22fde8[_0x28e7cf(0x124)]!==undefined?{'roleName':_0x22fde8[_0x28e7cf(0x124)]}:{},..._0x22fde8[_0x28e7cf(0x129)]!==undefined?{'remark':_0x22fde8[_0x28e7cf(0x129)]}:{}});const _0x5b19ee=await getRoleById(_0x3d3975[_0x28e7cf(0x12d)],_0x8665f5);return{'ok':!![],'data':{'operation':_0x28e7cf(0x12f),'selector':{'appCode':_0x3d3975[_0x28e7cf(0x12d)],'roleId':_0x8665f5,'roleName':_0x5b19ee[_0x28e7cf(0x124)]},'before':projectRole(_0x80a935),'after':projectRole(_0x5b19ee),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':_0x28e7cf(0x121)+_0x5b19ee['roleName']+_0x28e7cf(0x11b)+_0x8665f5+')'};}};
@@ -1 +1 @@
1
- function a170_0xe5d3(_0x4d6fa7,_0x53d8b7){_0x4d6fa7=_0x4d6fa7-0x158;const _0x379d24=a170_0x379d();let _0xe5d3bc=_0x379d24[_0x4d6fa7];return _0xe5d3bc;}const a170_0x1bb0e3=a170_0xe5d3;(function(_0x148df0,_0x1c4279){const _0x1389f4=a170_0xe5d3,_0x1ee8a5=_0x148df0();while(!![]){try{const _0x18e2de=parseInt(_0x1389f4(0x160))/0x1+-parseInt(_0x1389f4(0x16b))/0x2*(-parseInt(_0x1389f4(0x16c))/0x3)+-parseInt(_0x1389f4(0x167))/0x4+-parseInt(_0x1389f4(0x168))/0x5*(-parseInt(_0x1389f4(0x169))/0x6)+-parseInt(_0x1389f4(0x15f))/0x7+-parseInt(_0x1389f4(0x15b))/0x8+-parseInt(_0x1389f4(0x159))/0x9;if(_0x18e2de===_0x1c4279)break;else _0x1ee8a5['push'](_0x1ee8a5['shift']());}catch(_0x1cc606){_0x1ee8a5['push'](_0x1ee8a5['shift']());}}}(a170_0x379d,0x445b8));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a170_0x379d(){const _0x534ab9=['roleName','selector','appCode','303768sMAZBc','15tdwlCL','691098DdTBDb','user-add','12fhEhMN','118770GAZpum','role','53091lJLzge','No\x20change:\x20user\x20','677400GwksUG','POST','Added\x20user\x20','high-risk-write','1556968HpCrZC','85843Hsgplt','Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','\x20already\x20in\x20role\x20','userId'];a170_0x379d=function(){return _0x534ab9;};return a170_0x379d();}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':a170_0x1bb0e3(0x158),'command':a170_0x1bb0e3(0x16a),'description':a170_0x1bb0e3(0x161),'risk':a170_0x1bb0e3(0x15e),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x4cf27b){const _0x53d6cb=a170_0x1bb0e3,{mutation:_0xc91a05}=await prepareUserMutation(_0x4cf27b,_0x53d6cb(0x16a),!![]);return asDryRunResult(_0xc91a05,{'method':_0x53d6cb(0x15c),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x226d33){const _0x59191f=a170_0x1bb0e3,{roleList:_0x289f70,mutation:_0x5a266e,changed:_0x438465}=await prepareUserMutation(_0x226d33,'user-add',![]);return _0x438465&&await updateRoleUsers(_0x226d33[_0x59191f(0x166)],_0x289f70),{'ok':!![],'data':_0x5a266e,'message':_0x438465?_0x59191f(0x15d)+_0x5a266e[_0x59191f(0x165)][_0x59191f(0x163)]+'\x20to\x20role\x20'+_0x5a266e['selector'][_0x59191f(0x164)]:_0x59191f(0x15a)+_0x5a266e[_0x59191f(0x165)][_0x59191f(0x163)]+_0x59191f(0x162)+_0x5a266e[_0x59191f(0x165)]['roleName']};}};
1
+ function a178_0x34a6(){const _0x557fcf=['role','Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','69pWowOb','selector','1271795fTFCYu','POST','10841MZmhDu','roleName','266cBrVZa','appCode','12268Dhdzvq','483892MbSdqB','userId','1320yNJyeJ','high-risk-write','10980glryij','\x20already\x20in\x20role\x20','\x20to\x20role\x20','4854KgeiVD','78536KRbkqe'];a178_0x34a6=function(){return _0x557fcf;};return a178_0x34a6();}const a178_0x29c82f=a178_0x5a54;(function(_0x4ffcc8,_0x37e1e7){const _0x34610b=a178_0x5a54,_0x2b75c4=_0x4ffcc8();while(!![]){try{const _0x5cbe60=parseInt(_0x34610b(0x106))/0x1+parseInt(_0x34610b(0xf7))/0x2+-parseInt(_0x34610b(0x102))/0x3*(parseInt(_0x34610b(0xf6))/0x4)+-parseInt(_0x34610b(0x104))/0x5+parseInt(_0x34610b(0xfe))/0x6*(parseInt(_0x34610b(0x108))/0x7)+parseInt(_0x34610b(0xff))/0x8+-parseInt(_0x34610b(0xfb))/0x9*(-parseInt(_0x34610b(0xf9))/0xa);if(_0x5cbe60===_0x37e1e7)break;else _0x2b75c4['push'](_0x2b75c4['shift']());}catch(_0x20ea05){_0x2b75c4['push'](_0x2b75c4['shift']());}}}(a178_0x34a6,0x1f9ce));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';function a178_0x5a54(_0xc35355,_0x48048c){_0xc35355=_0xc35355-0xf6;const _0x34a6c8=a178_0x34a6();let _0x5a5486=_0x34a6c8[_0xc35355];return _0x5a5486;}export const roleUserAdd={'service':a178_0x29c82f(0x100),'command':'user-add','description':a178_0x29c82f(0x101),'risk':a178_0x29c82f(0xfa),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x13e18f){const _0xd6282b=a178_0x29c82f,{mutation:_0x47ef5b}=await prepareUserMutation(_0x13e18f,'user-add',!![]);return asDryRunResult(_0x47ef5b,{'method':_0xd6282b(0x105),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x487b4f){const _0x246894=a178_0x29c82f,{roleList:_0xecb1fc,mutation:_0x42142f,changed:_0xa078}=await prepareUserMutation(_0x487b4f,'user-add',![]);return _0xa078&&await updateRoleUsers(_0x487b4f[_0x246894(0x109)],_0xecb1fc),{'ok':!![],'data':_0x42142f,'message':_0xa078?'Added\x20user\x20'+_0x42142f[_0x246894(0x103)][_0x246894(0xf8)]+_0x246894(0xfd)+_0x42142f['selector'][_0x246894(0x107)]:'No\x20change:\x20user\x20'+_0x42142f[_0x246894(0x103)]['userId']+_0x246894(0xfc)+_0x42142f['selector']['roleName']};}};
@@ -1 +1 @@
1
- const a171_0x439366=a171_0x36a1;(function(_0x194556,_0x1f19a9){const _0x4c0278=a171_0x36a1,_0x48629b=_0x194556();while(!![]){try{const _0x23d5f1=parseInt(_0x4c0278(0xdc))/0x1+-parseInt(_0x4c0278(0xd8))/0x2+parseInt(_0x4c0278(0xcd))/0x3+-parseInt(_0x4c0278(0xdb))/0x4*(parseInt(_0x4c0278(0xcf))/0x5)+-parseInt(_0x4c0278(0xd7))/0x6*(-parseInt(_0x4c0278(0xd1))/0x7)+-parseInt(_0x4c0278(0xd5))/0x8+parseInt(_0x4c0278(0xd9))/0x9;if(_0x23d5f1===_0x1f19a9)break;else _0x48629b['push'](_0x48629b['shift']());}catch(_0x7c4fa5){_0x48629b['push'](_0x48629b['shift']());}}}(a171_0x54a5,0xc0938));function a171_0x54a5(){const _0x54c8fc=['high-risk-write','3423720uqVwWU','No\x20change:\x20user\x20','63805bleTiO','roleName','7wXDEnX','appCode','selector','user-remove','9028312pPDbhq','userId','5053242yrcObU','2844hIbzfj','1957833XXtWtD','\x20not\x20in\x20role\x20','476cGrREn','1236328kOEFID'];a171_0x54a5=function(){return _0x54c8fc;};return a171_0x54a5();}function a171_0x36a1(_0x5d6c8f,_0x191bd4){_0x5d6c8f=_0x5d6c8f-0xcc;const _0x54a536=a171_0x54a5();let _0x36a15f=_0x54a536[_0x5d6c8f];return _0x36a15f;}import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,prepareUserMutation,ROLE_REF_FLAG,UPDATE_USER_LIST_PATH,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':'role','command':a171_0x439366(0xd4),'description':'Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a171_0x439366(0xcc),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x3c4aa8){const _0x4107ee=a171_0x439366,{mutation:_0x17e65a}=await prepareUserMutation(_0x3c4aa8,_0x4107ee(0xd4),!![]);return asDryRunResult(_0x17e65a,{'method':'POST','url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x12874c){const _0x2a8c2f=a171_0x439366,{roleList:_0x1da6dd,mutation:_0x47cfde,changed:_0x654b81}=await prepareUserMutation(_0x12874c,_0x2a8c2f(0xd4),![]);return _0x654b81&&await updateRoleUsers(_0x12874c[_0x2a8c2f(0xd2)],_0x1da6dd),{'ok':!![],'data':_0x47cfde,'message':_0x654b81?'Removed\x20user\x20'+_0x47cfde['selector'][_0x2a8c2f(0xd6)]+'\x20from\x20role\x20'+_0x47cfde[_0x2a8c2f(0xd3)][_0x2a8c2f(0xd0)]:_0x2a8c2f(0xce)+_0x47cfde[_0x2a8c2f(0xd3)][_0x2a8c2f(0xd6)]+_0x2a8c2f(0xda)+_0x47cfde[_0x2a8c2f(0xd3)]['roleName']};}};
1
+ const a179_0x4d1899=a179_0x5e7b;(function(_0x1daf8a,_0x2ec13c){const _0x98e30c=a179_0x5e7b,_0x1a0552=_0x1daf8a();while(!![]){try{const _0x1e9bc0=-parseInt(_0x98e30c(0x18f))/0x1+-parseInt(_0x98e30c(0x18d))/0x2+parseInt(_0x98e30c(0x198))/0x3+parseInt(_0x98e30c(0x191))/0x4+parseInt(_0x98e30c(0x19b))/0x5*(-parseInt(_0x98e30c(0x195))/0x6)+parseInt(_0x98e30c(0x19d))/0x7*(parseInt(_0x98e30c(0x18e))/0x8)+parseInt(_0x98e30c(0x197))/0x9*(-parseInt(_0x98e30c(0x196))/0xa);if(_0x1e9bc0===_0x2ec13c)break;else _0x1a0552['push'](_0x1a0552['shift']());}catch(_0x5ca6b1){_0x1a0552['push'](_0x1a0552['shift']());}}}(a179_0x2aca,0x72fad));function a179_0x2aca(){const _0x4b56df=['91570obSqnO','279OfgSQs','2606439uqTSPM','POST','role','2983455WewrGQ','\x20not\x20in\x20role\x20','124726bsTYWb','selector','userId','\x20from\x20role\x20','1347980KwwMFz','352jzGykc','279379BZhjML','high-risk-write','2608316obZWUj','roleName','appCode','user-remove','6mxlJZF'];a179_0x2aca=function(){return _0x4b56df;};return a179_0x2aca();}import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a179_0x5e7b(_0x3027ae,_0x2d494a){_0x3027ae=_0x3027ae-0x18a;const _0x2aca28=a179_0x2aca();let _0x5e7b20=_0x2aca28[_0x3027ae];return _0x5e7b20;}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':a179_0x4d1899(0x19a),'command':a179_0x4d1899(0x194),'description':'Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','risk':a179_0x4d1899(0x190),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x12ae7d){const _0x3dffdf=a179_0x4d1899,{mutation:_0x1c0b11}=await prepareUserMutation(_0x12ae7d,_0x3dffdf(0x194),!![]);return asDryRunResult(_0x1c0b11,{'method':_0x3dffdf(0x199),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x2a96d6){const _0x26b83c=a179_0x4d1899,{roleList:_0x1cce08,mutation:_0x38e0c1,changed:_0x18d267}=await prepareUserMutation(_0x2a96d6,'user-remove',![]);return _0x18d267&&await updateRoleUsers(_0x2a96d6[_0x26b83c(0x193)],_0x1cce08),{'ok':!![],'data':_0x38e0c1,'message':_0x18d267?'Removed\x20user\x20'+_0x38e0c1['selector']['userId']+_0x26b83c(0x18c)+_0x38e0c1[_0x26b83c(0x18a)][_0x26b83c(0x192)]:'No\x20change:\x20user\x20'+_0x38e0c1[_0x26b83c(0x18a)][_0x26b83c(0x18b)]+_0x26b83c(0x19c)+_0x38e0c1['selector'][_0x26b83c(0x192)]};}};
@@ -1 +1 @@
1
- const a172_0x1d333e=a172_0x1e4b;(function(_0x505880,_0x56bf44){const _0x173868=a172_0x1e4b,_0x1936a6=_0x505880();while(!![]){try{const _0x5ba8df=parseInt(_0x173868(0x1fe))/0x1*(-parseInt(_0x173868(0x205))/0x2)+-parseInt(_0x173868(0x209))/0x3*(-parseInt(_0x173868(0x1fa))/0x4)+-parseInt(_0x173868(0x20b))/0x5*(-parseInt(_0x173868(0x203))/0x6)+parseInt(_0x173868(0x1f4))/0x7*(parseInt(_0x173868(0x1ff))/0x8)+parseInt(_0x173868(0x208))/0x9+parseInt(_0x173868(0x1fd))/0xa+-parseInt(_0x173868(0x200))/0xb*(parseInt(_0x173868(0x1f6))/0xc);if(_0x5ba8df===_0x56bf44)break;else _0x1936a6['push'](_0x1936a6['shift']());}catch(_0x5cd6e3){_0x1936a6['push'](_0x1936a6['shift']());}}}(a172_0x24ee,0xb349c));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a172_0x1e4b(_0x18d1ef,_0x2b79a0){_0x18d1ef=_0x18d1ef-0x1f3;const _0x24ee42=a172_0x24ee();let _0x1e4bd5=_0x24ee42[_0x18d1ef];return _0x1e4bd5;}import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';function a172_0x24ee(){const _0x7737bd=['20UrjgBe','33896xHKsUt','55dDeNfH','trim','role','552FaiEId','userId','2398beXJhg','name','Resolved\x20\x22','3301191XOjXsf','2352mHFYyR','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','16925ukJGTg','username','1603zPKyJd','nickname','4865268AYqaSJ','read','flagMissing','matchedBy','5376SSxWOp','user-resolve','str','833510zYXqZf'];a172_0x24ee=function(){return _0x7737bd;};return a172_0x24ee();}export const roleUserResolve={'service':a172_0x1d333e(0x202),'command':a172_0x1d333e(0x1fb),'description':a172_0x1d333e(0x20a),'risk':a172_0x1d333e(0x1f7),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x44b76a){const _0x240d05=a172_0x1d333e;if(!_0x44b76a['str']('name')[_0x240d05(0x201)]())throw CliErrors[_0x240d05(0x1f8)](_0x240d05(0x206),'Pass\x20--name\x20<nickname|username>.');},async 'execute'(_0xa3f747){const _0x530a99=a172_0x1d333e,_0x528e56=_0xa3f747[_0x530a99(0x1fc)](_0x530a99(0x206))[_0x530a99(0x201)](),_0x2ee22c=await resolveUserRef(_0x528e56);return{'ok':!![],'data':{'user':{'userId':_0x2ee22c[_0x530a99(0x204)],'username':_0x2ee22c[_0x530a99(0x1f3)],'nickname':_0x2ee22c[_0x530a99(0x1f5)],'matchedBy':_0x2ee22c[_0x530a99(0x1f9)]}},'message':_0x530a99(0x207)+_0x528e56+'\x22\x20→\x20userId\x20'+_0x2ee22c[_0x530a99(0x204)]};}};
1
+ const a180_0x300498=a180_0x4409;(function(_0x55c928,_0x353b98){const _0x1f2c92=a180_0x4409,_0x179ab9=_0x55c928();while(!![]){try{const _0x51700a=-parseInt(_0x1f2c92(0x16b))/0x1*(-parseInt(_0x1f2c92(0x169))/0x2)+parseInt(_0x1f2c92(0x161))/0x3*(-parseInt(_0x1f2c92(0x15e))/0x4)+parseInt(_0x1f2c92(0x166))/0x5+parseInt(_0x1f2c92(0x15b))/0x6*(-parseInt(_0x1f2c92(0x15d))/0x7)+parseInt(_0x1f2c92(0x16c))/0x8*(parseInt(_0x1f2c92(0x170))/0x9)+-parseInt(_0x1f2c92(0x16e))/0xa*(-parseInt(_0x1f2c92(0x15f))/0xb)+-parseInt(_0x1f2c92(0x168))/0xc;if(_0x51700a===_0x353b98)break;else _0x179ab9['push'](_0x179ab9['shift']());}catch(_0x2d867f){_0x179ab9['push'](_0x179ab9['shift']());}}}(a180_0x4e23,0xbb8a8));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';function a180_0x4409(_0x513045,_0x5e608e){_0x513045=_0x513045-0x15a;const _0x4e23e7=a180_0x4e23();let _0x4409e7=_0x4e23e7[_0x513045];return _0x4409e7;}export const roleUserResolve={'service':a180_0x300498(0x167),'command':a180_0x300498(0x15a),'description':a180_0x300498(0x171),'risk':'read','flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0xf58b){const _0x370e9f=a180_0x300498;if(!_0xf58b[_0x370e9f(0x164)]('name')[_0x370e9f(0x163)]())throw CliErrors[_0x370e9f(0x165)]('name',_0x370e9f(0x16d));},async 'execute'(_0x40f7fd){const _0x57472d=a180_0x300498,_0x59c4a6=_0x40f7fd[_0x57472d(0x164)](_0x57472d(0x15c))[_0x57472d(0x163)](),_0x29a11a=await resolveUserRef(_0x59c4a6);return{'ok':!![],'data':{'user':{'userId':_0x29a11a[_0x57472d(0x172)],'username':_0x29a11a[_0x57472d(0x162)],'nickname':_0x29a11a[_0x57472d(0x16f)],'matchedBy':_0x29a11a[_0x57472d(0x160)]}},'message':_0x57472d(0x16a)+_0x59c4a6+'\x22\x20→\x20userId\x20'+_0x29a11a[_0x57472d(0x172)]};}};function a180_0x4e23(){const _0x28de90=['str','flagMissing','4416965sjPEBR','role','8272764hQCwMe','2YkxbBK','Resolved\x20\x22','1044243wOPdOz','2254240UDFrwk','Pass\x20--name\x20<nickname|username>.','128130xTxzCN','nickname','9ixXtbV','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','userId','user-resolve','198QwwMzd','name','95137waNAMD','36GYUHoS','11xjmRGx','matchedBy','105387anYlUC','username','trim'];a180_0x4e23=function(){return _0x28de90;};return a180_0x4e23();}
@@ -1 +1 @@
1
- const a173_0x57774a=a173_0x1a79;(function(_0x314e44,_0x492f86){const _0x1fabc8=a173_0x1a79,_0x519645=_0x314e44();while(!![]){try{const _0x572286=parseInt(_0x1fabc8(0xef))/0x1*(-parseInt(_0x1fabc8(0xd7))/0x2)+parseInt(_0x1fabc8(0xf0))/0x3*(-parseInt(_0x1fabc8(0xf8))/0x4)+-parseInt(_0x1fabc8(0x109))/0x5+parseInt(_0x1fabc8(0xd5))/0x6+parseInt(_0x1fabc8(0xea))/0x7+parseInt(_0x1fabc8(0x102))/0x8+parseInt(_0x1fabc8(0x10e))/0x9;if(_0x572286===_0x492f86)break;else _0x519645['push'](_0x519645['shift']());}catch(_0x166dcc){_0x519645['push'](_0x519645['shift']());}}}(a173_0x3ed9,0x593b0));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a173_0x57774a(0xdf),a173_0x57774a(0xe4)]);function readPackageScripts(_0x3c582d){const _0x3b371f=a173_0x57774a,_0x1c8b4b=resolve(_0x3c582d,_0x3b371f(0xd6));if(!existsSync(_0x1c8b4b))return null;try{const _0x1bc8b4=JSON['parse'](readFileSync(_0x1c8b4b,_0x3b371f(0xf5)));return _0x1bc8b4[_0x3b371f(0x10d)]??{};}catch{return null;}}function detectPackageManager(_0x41c67f){const _0x35105f=a173_0x57774a;if(existsSync(resolve(_0x41c67f,_0x35105f(0xfd)))||existsSync(resolve(_0x41c67f,_0x35105f(0xd9))))return _0x35105f(0xf9);if(existsSync(resolve(_0x41c67f,_0x35105f(0xec))))return'pnpm';if(existsSync(resolve(_0x41c67f,_0x35105f(0x10a))))return _0x35105f(0xed);return _0x35105f(0x100);}async function versionCheck(_0x22203e){const _0x119f0f=a173_0x57774a,_0x432598=await checkCliVersion();(_0x432598[_0x119f0f(0xfc)]||_0x432598[_0x119f0f(0x101)])&&(printCliUpgradeWarning(_0x432598),assertCliVersionSupported(_0x432598));const _0x46ea2f=await checkSdkVersion(_0x22203e);if(_0x46ea2f[_0x119f0f(0xfc)])printSdkUpgradeWarning(_0x46ea2f);}function spawnScript(_0x3cd178,_0x302d6a,_0x205d14,_0x4526ca){return new Promise((_0x356aeb,_0x37c2b1)=>{const _0x1efde4=a173_0x1a79,_0x3eacae=[_0x1efde4(0xf4),_0x302d6a,..._0x205d14],_0x81c824=spawn(_0x3cd178,_0x3eacae,{'cwd':_0x4526ca,'stdio':_0x1efde4(0x104),'shell':!![],'env':{...process.env,'PATH':''+join(_0x4526ca,_0x1efde4(0xdc),'.bin')+delimiter+process.env.PATH}});_0x81c824['on'](_0x1efde4(0xf6),_0x40306f=>{const _0x295bda=_0x1efde4;if(_0x40306f===0x0||_0x40306f===null)_0x356aeb();else _0x37c2b1(new Error(_0x3cd178+_0x295bda(0xe9)+_0x302d6a+'\x20exited\x20with\x20code\x20'+_0x40306f));}),_0x81c824['on'](_0x1efde4(0xff),_0x37c2b1);});}function spawnViteBuildWatch(_0x45ceab){return new Promise((_0x8bb0fa,_0xbcd9fb)=>{const _0x7676cc=a173_0x1a79,_0x28a936=spawn('vite',['build',_0x7676cc(0xe5)],{'cwd':_0x45ceab,'stdio':_0x7676cc(0x104),'shell':!![],'env':{...process.env,'PATH':''+join(_0x45ceab,'node_modules',_0x7676cc(0xe8))+delimiter+process.env.PATH}});_0x28a936['on'](_0x7676cc(0xf6),_0x68b182=>{const _0xf0073e=_0x7676cc;if(_0x68b182===0x0||_0x68b182===null)_0x8bb0fa();else _0xbcd9fb(new Error(_0xf0073e(0xfb)+_0x68b182));}),_0x28a936['on'](_0x7676cc(0xff),_0xbcd9fb);});}function spawnVitePreview(_0x36086b){return new Promise((_0x186089,_0x578bf8)=>{const _0x5a2eb7=a173_0x1a79,_0x1342a5=spawn(_0x5a2eb7(0xe6),[_0x5a2eb7(0x105)],{'cwd':_0x36086b,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x36086b,'node_modules',_0x5a2eb7(0xe8))+delimiter+process.env.PATH}});_0x1342a5['on'](_0x5a2eb7(0xf6),_0x59b1b8=>{const _0x4bf5bd=_0x5a2eb7;if(_0x59b1b8===0x0||_0x59b1b8===null)_0x186089();else _0x578bf8(new Error(_0x4bf5bd(0xfe)+_0x59b1b8));}),_0x1342a5['on'](_0x5a2eb7(0xff),_0x578bf8);});}const runFlags=[{'name':a173_0x57774a(0xe7),'type':a173_0x57774a(0xf3),'description':'Enable\x20watch\x20mode\x20for\x20preview','default':![]}];function a173_0x3ed9(){const _0x467794=['log','bun.lock','args','Available:\x20','node_modules','\x20run\x20preview','No\x20scripts\x20defined\x20in\x20package.json.','start','Run\x20a\x20package.json\x20script','Script\x20name\x20defined\x20in\x20package.json','all','\x20run\x20preview\x20--watch','dev','--watch','vite','watch','.bin','\x20run\x20','873068qrPRKD','\x20\x20\x20\x20','pnpm-lock.yaml','yarn','slice','1NcaCsj','12OTUEZE','has','script','boolean','run','utf-8','close','\x20run\x20start','70584PcMwWq','bun','high-risk-write','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','needsUpgrade','bun.lockb','vite\x20preview\x20exited\x20with\x20code\x20','error','npm','belowMinimum','2821328HXJyPi','validation','inherit','preview','join','cwd','\x0a\x20\x20Usage:\x20','1395315xvSyqA','yarn.lock','keys','No\x20package.json\x20found\x20in\x20current\x20directory.','scripts','1269729qpDauy','push','\x20run\x20<script>\x0a','2331222lRmNoC','package.json','583746WQdvGw'];a173_0x3ed9=function(){return _0x467794;};return a173_0x3ed9();}function a173_0x1a79(_0x2f3112,_0x4caddf){_0x2f3112=_0x2f3112-0xd4;const _0x3ed9bb=a173_0x3ed9();let _0x1a79ae=_0x3ed9bb[_0x2f3112];return _0x1a79ae;}export const runDefinition={'service':a173_0x57774a(0xf4),'command':'run','description':a173_0x57774a(0xe0),'risk':a173_0x57774a(0xfa),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a173_0x57774a(0xf2),'description':a173_0x57774a(0xe1),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x1e8549=a173_0x57774a,_0x217d09=[];return _0x217d09[_0x1e8549(0x10f)]('\x20\x20EXAMPLES'),_0x217d09[_0x1e8549(0x10f)](_0x1e8549(0xeb)+CLI_BIN_NAME+_0x1e8549(0xf7)),_0x217d09[_0x1e8549(0x10f)](_0x1e8549(0xeb)+CLI_BIN_NAME+'\x20run\x20build'),_0x217d09['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x1e8549(0xdd)),_0x217d09[_0x1e8549(0x10f)](_0x1e8549(0xeb)+CLI_BIN_NAME+_0x1e8549(0xe3)),_0x217d09['join']('\x0a');},async 'execute'(_0x540b3d){const _0x4eaa60=a173_0x57774a,_0x1a1c05=process[_0x4eaa60(0x107)](),_0x3500b7=_0x540b3d[_0x4eaa60(0xda)][0x0],_0x508362=_0x540b3d[_0x4eaa60(0xda)][_0x4eaa60(0xee)](0x1),_0x2deb5e=readPackageScripts(_0x1a1c05);if(!_0x2deb5e)throw CliErrors['validation'](_0x4eaa60(0x10c));if(!_0x3500b7){const _0x56371c=Object['keys'](_0x2deb5e);if(_0x56371c['length']===0x0)console[_0x4eaa60(0xd8)](_0x4eaa60(0xde));else{console[_0x4eaa60(0xd8)]('\x0a\x20\x20Available\x20scripts:\x0a');for(const _0x513cf7 of _0x56371c){console[_0x4eaa60(0xd8)](_0x4eaa60(0xeb)+_0x513cf7);}console[_0x4eaa60(0xd8)](_0x4eaa60(0x108)+CLI_BIN_NAME+_0x4eaa60(0xd4));}return{'ok':!![]};}if(!_0x2deb5e[_0x3500b7])throw CliErrors[_0x4eaa60(0x103)]('Script\x20\x22'+_0x3500b7+'\x22\x20not\x20found\x20in\x20package.json.',_0x4eaa60(0xdb)+(Object[_0x4eaa60(0x10b)](_0x2deb5e)[_0x4eaa60(0x106)](',\x20')||'(none)'));const _0x55dfa7=detectPackageManager(_0x1a1c05);VERSION_CHECK_SCRIPTS[_0x4eaa60(0xf1)](_0x3500b7)&&await versionCheck(_0x1a1c05);if(_0x3500b7==='preview'&&_0x540b3d['bool']('watch'))return await Promise[_0x4eaa60(0xe2)]([spawnViteBuildWatch(_0x1a1c05),spawnVitePreview(_0x1a1c05)]),{'ok':!![]};return await spawnScript(_0x55dfa7,_0x3500b7,_0x508362,_0x1a1c05),{'ok':!![]};}};
1
+ const a181_0x450389=a181_0x2afc;(function(_0x174e6c,_0x30264b){const _0x167568=a181_0x2afc,_0x47785=_0x174e6c();while(!![]){try{const _0x175586=-parseInt(_0x167568(0x1e0))/0x1*(-parseInt(_0x167568(0x218))/0x2)+parseInt(_0x167568(0x1dc))/0x3*(-parseInt(_0x167568(0x1f5))/0x4)+parseInt(_0x167568(0x1fb))/0x5*(parseInt(_0x167568(0x216))/0x6)+parseInt(_0x167568(0x1f9))/0x7*(parseInt(_0x167568(0x1ed))/0x8)+parseInt(_0x167568(0x1df))/0x9*(-parseInt(_0x167568(0x20a))/0xa)+-parseInt(_0x167568(0x206))/0xb*(parseInt(_0x167568(0x204))/0xc)+parseInt(_0x167568(0x1fa))/0xd;if(_0x175586===_0x30264b)break;else _0x47785['push'](_0x47785['shift']());}catch(_0x476f4e){_0x47785['push'](_0x47785['shift']());}}}(a181_0x47ce,0x2bd60));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';function a181_0x47ce(){const _0x3220bf=['21ysgPIS','\x20run\x20start','scripts','9eTVBlb','2oIYRxM','Enable\x20watch\x20mode\x20for\x20preview','.bin','\x20exited\x20with\x20code\x20','push','length','Run\x20a\x20package.json\x20script','needsUpgrade','No\x20package.json\x20found\x20in\x20current\x20directory.','--watch','pnpm-lock.yaml','error','start','8CWachf','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','slice','Available:\x20','bun.lockb','inherit','npm','script','18188LvjBja','\x0a\x20\x20Available\x20scripts:\x0a','log','\x0a\x20\x20Usage:\x20','881741EMRIfd','948883PsnsQQ','5CSTGtr','\x20run\x20build','cwd','\x20run\x20preview','validation','args','close','keys','bun','611400Prumzk','package.json','22YKSCic','bool','high-risk-write','\x20run\x20','1100490uQryyS','bun.lock','yarn.lock','parse','watch','preview','belowMinimum','node_modules','yarn','\x20run\x20preview\x20--watch','dev','vite','138588TXRHCs','build','201278qkWVFx','run','No\x20scripts\x20defined\x20in\x20package.json.','(none)','\x20\x20\x20\x20','\x20run\x20<script>\x0a','Script\x20\x22','has','\x20\x20EXAMPLES','\x22\x20not\x20found\x20in\x20package.json.'];a181_0x47ce=function(){return _0x3220bf;};return a181_0x47ce();}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([a181_0x450389(0x1ec),a181_0x450389(0x214)]);function readPackageScripts(_0x20a830){const _0x5d3838=a181_0x450389,_0x3261c4=resolve(_0x20a830,_0x5d3838(0x205));if(!existsSync(_0x3261c4))return null;try{const _0x441b02=JSON[_0x5d3838(0x20d)](readFileSync(_0x3261c4,'utf-8'));return _0x441b02[_0x5d3838(0x1de)]??{};}catch{return null;}}function detectPackageManager(_0x2fa501){const _0x75a39a=a181_0x450389;if(existsSync(resolve(_0x2fa501,_0x75a39a(0x1f1)))||existsSync(resolve(_0x2fa501,_0x75a39a(0x20b))))return _0x75a39a(0x203);if(existsSync(resolve(_0x2fa501,_0x75a39a(0x1ea))))return'pnpm';if(existsSync(resolve(_0x2fa501,_0x75a39a(0x20c))))return _0x75a39a(0x212);return _0x75a39a(0x1f3);}async function versionCheck(_0x32d1f7){const _0x9313d9=a181_0x450389,_0x4174f3=await checkCliVersion();(_0x4174f3[_0x9313d9(0x1e7)]||_0x4174f3[_0x9313d9(0x210)])&&(printCliUpgradeWarning(_0x4174f3),assertCliVersionSupported(_0x4174f3));const _0x1be704=await checkSdkVersion(_0x32d1f7);if(_0x1be704[_0x9313d9(0x1e7)])printSdkUpgradeWarning(_0x1be704);}function spawnScript(_0x46bdd9,_0x59ece5,_0x45a509,_0x2d690b){return new Promise((_0x55df6e,_0x46bca6)=>{const _0x37e92c=a181_0x2afc,_0x4f0164=[_0x37e92c(0x219),_0x59ece5,..._0x45a509],_0x12a0bb=spawn(_0x46bdd9,_0x4f0164,{'cwd':_0x2d690b,'stdio':_0x37e92c(0x1f2),'shell':!![],'env':{...process.env,'PATH':''+join(_0x2d690b,_0x37e92c(0x211),_0x37e92c(0x1e2))+delimiter+process.env.PATH}});_0x12a0bb['on'](_0x37e92c(0x201),_0x4e7215=>{const _0x19cf70=_0x37e92c;if(_0x4e7215===0x0||_0x4e7215===null)_0x55df6e();else _0x46bca6(new Error(_0x46bdd9+_0x19cf70(0x209)+_0x59ece5+_0x19cf70(0x1e3)+_0x4e7215));}),_0x12a0bb['on'](_0x37e92c(0x1eb),_0x46bca6);});}function a181_0x2afc(_0x344c96,_0x4206b1){_0x344c96=_0x344c96-0x1d5;const _0x47ce91=a181_0x47ce();let _0x2afc19=_0x47ce91[_0x344c96];return _0x2afc19;}function spawnViteBuildWatch(_0x229c83){return new Promise((_0x2cdcb9,_0x3e2450)=>{const _0x1ef4d1=a181_0x2afc,_0x1058d2=spawn(_0x1ef4d1(0x215),[_0x1ef4d1(0x217),_0x1ef4d1(0x1e9)],{'cwd':_0x229c83,'stdio':_0x1ef4d1(0x1f2),'shell':!![],'env':{...process.env,'PATH':''+join(_0x229c83,_0x1ef4d1(0x211),_0x1ef4d1(0x1e2))+delimiter+process.env.PATH}});_0x1058d2['on'](_0x1ef4d1(0x201),_0x2d2634=>{const _0x558e19=_0x1ef4d1;if(_0x2d2634===0x0||_0x2d2634===null)_0x2cdcb9();else _0x3e2450(new Error(_0x558e19(0x1ee)+_0x2d2634));}),_0x1058d2['on'](_0x1ef4d1(0x1eb),_0x3e2450);});}function spawnVitePreview(_0x1269cc){return new Promise((_0x944bdb,_0x2a020b)=>{const _0x5ae9a0=a181_0x2afc,_0x5e511a=spawn(_0x5ae9a0(0x215),[_0x5ae9a0(0x20f)],{'cwd':_0x1269cc,'stdio':_0x5ae9a0(0x1f2),'shell':!![],'env':{...process.env,'PATH':''+join(_0x1269cc,'node_modules','.bin')+delimiter+process.env.PATH}});_0x5e511a['on'](_0x5ae9a0(0x201),_0x4358ae=>{if(_0x4358ae===0x0||_0x4358ae===null)_0x944bdb();else _0x2a020b(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x4358ae));}),_0x5e511a['on'](_0x5ae9a0(0x1eb),_0x2a020b);});}const runFlags=[{'name':'watch','type':'boolean','description':a181_0x450389(0x1e1),'default':![]}];export const runDefinition={'service':a181_0x450389(0x219),'command':a181_0x450389(0x219),'description':a181_0x450389(0x1e6),'risk':a181_0x450389(0x208),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a181_0x450389(0x1f4),'description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x576e61=a181_0x450389,_0x3c58cb=[];return _0x3c58cb[_0x576e61(0x1e4)](_0x576e61(0x1da)),_0x3c58cb['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x576e61(0x1dd)),_0x3c58cb[_0x576e61(0x1e4)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x576e61(0x1fc)),_0x3c58cb['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x576e61(0x1fe)),_0x3c58cb['push'](_0x576e61(0x1d6)+CLI_BIN_NAME+_0x576e61(0x213)),_0x3c58cb['join']('\x0a');},async 'execute'(_0x1d320d){const _0x45426d=a181_0x450389,_0x1a6955=process[_0x45426d(0x1fd)](),_0x113e0b=_0x1d320d[_0x45426d(0x200)][0x0],_0x3b36a5=_0x1d320d['args'][_0x45426d(0x1ef)](0x1),_0x223b97=readPackageScripts(_0x1a6955);if(!_0x223b97)throw CliErrors['validation'](_0x45426d(0x1e8));if(!_0x113e0b){const _0x343cf0=Object[_0x45426d(0x202)](_0x223b97);if(_0x343cf0[_0x45426d(0x1e5)]===0x0)console[_0x45426d(0x1f7)](_0x45426d(0x21a));else{console['log'](_0x45426d(0x1f6));for(const _0x2b7fa8 of _0x343cf0){console[_0x45426d(0x1f7)](_0x45426d(0x1d6)+_0x2b7fa8);}console['log'](_0x45426d(0x1f8)+CLI_BIN_NAME+_0x45426d(0x1d7));}return{'ok':!![]};}if(!_0x223b97[_0x113e0b])throw CliErrors[_0x45426d(0x1ff)](_0x45426d(0x1d8)+_0x113e0b+_0x45426d(0x1db),_0x45426d(0x1f0)+(Object[_0x45426d(0x202)](_0x223b97)['join'](',\x20')||_0x45426d(0x1d5)));const _0x59186b=detectPackageManager(_0x1a6955);VERSION_CHECK_SCRIPTS[_0x45426d(0x1d9)](_0x113e0b)&&await versionCheck(_0x1a6955);if(_0x113e0b===_0x45426d(0x20f)&&_0x1d320d[_0x45426d(0x207)](_0x45426d(0x20e)))return await Promise['all']([spawnViteBuildWatch(_0x1a6955),spawnVitePreview(_0x1a6955)]),{'ok':!![]};return await spawnScript(_0x59186b,_0x113e0b,_0x3b36a5,_0x1a6955),{'ok':!![]};}};
@@ -1 +1 @@
1
- const a174_0xfa4b6d=a174_0x667c;function a174_0x667c(_0x147842,_0x41cd15){_0x147842=_0x147842-0x1e9;const _0x3a5325=a174_0x3a53();let _0x667c0a=_0x3a5325[_0x147842];return _0x667c0a;}(function(_0x1c501a,_0x3ef8e){const _0x62a93c=a174_0x667c,_0x448007=_0x1c501a();while(!![]){try{const _0x297d07=parseInt(_0x62a93c(0x1ef))/0x1*(parseInt(_0x62a93c(0x1e9))/0x2)+-parseInt(_0x62a93c(0x1f4))/0x3*(-parseInt(_0x62a93c(0x1f7))/0x4)+parseInt(_0x62a93c(0x1f1))/0x5*(parseInt(_0x62a93c(0x1ea))/0x6)+-parseInt(_0x62a93c(0x1f5))/0x7*(-parseInt(_0x62a93c(0x1f8))/0x8)+-parseInt(_0x62a93c(0x1ec))/0x9*(parseInt(_0x62a93c(0x1f0))/0xa)+parseInt(_0x62a93c(0x1ee))/0xb+-parseInt(_0x62a93c(0x1ed))/0xc;if(_0x297d07===_0x3ef8e)break;else _0x448007['push'](_0x448007['shift']());}catch(_0x561ea3){_0x448007['push'](_0x448007['shift']());}}}(a174_0x3a53,0x5d72f));import{buildSchemaPayload}from'../framework/schema-export.js';function a174_0x3a53(){const _0x3dd335=['18297PowMpd','17949264CCwZvj','2185282uOssXs','5765fwwsrl','460rNwbnU','15FiYDPh','export','Export\x20machine-readable\x20command\x20schema\x20(JSON)','23943SrUdwF','135793lpncoA','json','268xclwyN','80CoAZcO','162QHMvNo','1155426aRKTMb','read'];a174_0x3a53=function(){return _0x3dd335;};return a174_0x3a53();}async function execute(_0x34bc51){const _0x9a67c=await buildSchemaPayload();return{'ok':!![],'data':_0x9a67c};}export const schemaDefinition={'service':'schema','command':a174_0xfa4b6d(0x1f2),'description':a174_0xfa4b6d(0x1f3),'risk':a174_0xfa4b6d(0x1eb),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a174_0xfa4b6d(0x1f6),'flags':[],'execute':execute};
1
+ const a182_0x30b673=a182_0x874e;(function(_0x41b24c,_0xcf8e2){const _0x277019=a182_0x874e,_0x9f644c=_0x41b24c();while(!![]){try{const _0xa4dfc2=parseInt(_0x277019(0xb3))/0x1+parseInt(_0x277019(0xb0))/0x2*(-parseInt(_0x277019(0xb4))/0x3)+parseInt(_0x277019(0xba))/0x4*(-parseInt(_0x277019(0xb5))/0x5)+parseInt(_0x277019(0xb1))/0x6*(-parseInt(_0x277019(0xbe))/0x7)+-parseInt(_0x277019(0xb7))/0x8*(-parseInt(_0x277019(0xbb))/0x9)+-parseInt(_0x277019(0xb6))/0xa+parseInt(_0x277019(0xbc))/0xb*(parseInt(_0x277019(0xb9))/0xc);if(_0xa4dfc2===_0xcf8e2)break;else _0x9f644c['push'](_0x9f644c['shift']());}catch(_0x4fe5e7){_0x9f644c['push'](_0x9f644c['shift']());}}}(a182_0x267a,0xa5763));import{buildSchemaPayload}from'../framework/schema-export.js';function a182_0x874e(_0x44248f,_0x26c132){_0x44248f=_0x44248f-0xb0;const _0x267ac=a182_0x267a();let _0x874ed3=_0x267ac[_0x44248f];return _0x874ed3;}function a182_0x267a(){const _0xada335=['9136323UbggfE','187TyRAdx','export','5503344ICRaWd','148oOiyVw','6ihDSvk','json','510551Fonspe','16311jDFMBx','21305wGFtzp','12303130bzincm','8KZRnUF','read','1385568iDGHru','368JOZLSD'];a182_0x267a=function(){return _0xada335;};return a182_0x267a();}async function execute(_0x6d42c7){const _0x2701d4=await buildSchemaPayload();return{'ok':!![],'data':_0x2701d4};}export const schemaDefinition={'service':'schema','command':a182_0x30b673(0xbd),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a182_0x30b673(0xb8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a182_0x30b673(0xb2),'flags':[],'execute':execute};
@@ -1 +1 @@
1
- const a175_0xb66e67=a175_0x48a0;(function(_0x5e5e79,_0x18d8ed){const _0x33d748=a175_0x48a0,_0x41e80b=_0x5e5e79();while(!![]){try{const _0x369f28=parseInt(_0x33d748(0x16c))/0x1*(parseInt(_0x33d748(0x193))/0x2)+-parseInt(_0x33d748(0x164))/0x3*(parseInt(_0x33d748(0x165))/0x4)+-parseInt(_0x33d748(0x18e))/0x5+-parseInt(_0x33d748(0x15e))/0x6*(parseInt(_0x33d748(0x18b))/0x7)+-parseInt(_0x33d748(0x162))/0x8*(parseInt(_0x33d748(0x160))/0x9)+parseInt(_0x33d748(0x16b))/0xa+parseInt(_0x33d748(0x16f))/0xb;if(_0x369f28===_0x18d8ed)break;else _0x41e80b['push'](_0x41e80b['shift']());}catch(_0x121be7){_0x41e80b['push'](_0x41e80b['shift']());}}}(a175_0x1612,0xa297d));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';function a175_0x48a0(_0x1e070e,_0xf25d78){_0x1e070e=_0x1e070e-0x15c;const _0x1612cb=a175_0x1612();let _0x48a0dd=_0x1612cb[_0x1e070e];return _0x48a0dd;}function a175_0x1612(){const _0x1f7109=['toISOString','join','nonInteractive','mode','length','utf8','sqlRoot','create','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','catch','sql','7wUWOCY','str','Created\x20SQL\x20query\x20','646655nteKCu','Local\x20SQL\x20file\x20mode','sqlCode','mybatisXml','map','47486aNauwO','Invalid\x20database\x20selection\x20payload:\x20','\x20\x20SELECT\x201\x20AS\x20id','<server-generated-sqlCode>','POST','write','validation','isFinite','File\x20already\x20exists:\x20','7087422RjVawU','trim','782775oRPZRy','dbId\x20必须为正整数','72pMoRkD','sqlName','9zBqJHA','1509964NOrhsf','string','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','sqlRootDir','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','stringify','1802920IVxcNp','2bzJEwV','dbId','/smartapi/custom/saveUserCustomSql','40304209LrCibj','lockFilePath','lastSync','number','flag','✎\x20手动输入\x20dbId','appCode','请选择目标数据库:','flagMissing','parse','name','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','sqls','__manual__','dbName','普通\x20SQL(sql)','db-id'];a175_0x1612=function(){return _0x1f7109;};return a175_0x1612();}import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x431bc7){const _0x5eef6d=a175_0x48a0;if(_0x431bc7===_0x5eef6d(0x191))return[_0x5eef6d(0x17a),_0x5eef6d(0x195),'</select>',''][_0x5eef6d(0x181)]('\x0a');return['SELECT\x201\x20AS\x20id;',''][_0x5eef6d(0x181)]('\x0a');}export const sqlCreate={'service':a175_0xb66e67(0x18a),'command':a175_0xb66e67(0x187),'description':'Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','risk':a175_0xb66e67(0x198),'flags':[{'name':'name','type':'string','description':'SQL\x20query\x20display\x20name'},{'name':a175_0xb66e67(0x17f),'type':'number','description':'Target\x20database\x20ID'},{'name':a175_0xb66e67(0x183),'type':a175_0xb66e67(0x166),'enum':[a175_0xb66e67(0x18a),a175_0xb66e67(0x191)],'description':a175_0xb66e67(0x18f)}],async 'validate'(_0xdc612c){const _0x2469c3=a175_0xb66e67;if(!_0xdc612c[_0x2469c3(0x182)])return;if(!_0xdc612c['str'](_0x2469c3(0x179))[_0x2469c3(0x15f)]())throw CliErrors[_0x2469c3(0x177)](_0x2469c3(0x179),_0x2469c3(0x169));const _0x13f405=resolveProvidedDbId(_0xdc612c);if(typeof _0x13f405!==_0x2469c3(0x172)||!Number['isFinite'](_0x13f405)||_0x13f405<=0x0)throw CliErrors[_0x2469c3(0x177)](_0x2469c3(0x17f),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');if(!_0xdc612c[_0x2469c3(0x18c)](_0x2469c3(0x183))[_0x2469c3(0x15f)]())throw CliErrors[_0x2469c3(0x177)](_0x2469c3(0x183),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0x3449e2){const _0x17febe=a175_0xb66e67,_0x3ca356=loadSqlProjectConfig(_0x3449e2[_0x17febe(0x175)]),{sqlName:_0x424540,dbId:_0x4b0768,dbName:_0x152d8f,mode:_0x53127a}=await resolveSqlNewInputs(_0x3449e2),_0x5a75df=buildSqlRelativePath(_0x17febe(0x196),_0x424540,_0x152d8f,_0x53127a,_0x4b0768),_0x5a5482=_0x3ca356[_0x17febe(0x168)]+'/'+_0x5a75df;return{'method':_0x17febe(0x197),'url':_0x17febe(0x16e),'body':{'appCode':_0x3449e2['appCode'],'sqlName':_0x424540,'dbId':_0x4b0768,'mode':_0x53127a,'localPath':_0x5a5482},'description':'Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20'+_0x3ca356['sqlRootDir']};},async 'execute'(_0x5cd63d){const _0x4a967c=a175_0xb66e67,_0x41df1b=loadSqlProjectConfig(_0x5cd63d[_0x4a967c(0x175)]),{sqlName:_0x4ad074,dbId:_0x130074,dbName:_0x13f597,mode:_0x2c22e6}=await resolveSqlNewInputs(_0x5cd63d),_0x665772=generateSqlTemplate(_0x2c22e6),_0xe9d25a=await createSqlQuery({'appCode':_0x5cd63d[_0x4a967c(0x175)],'sqlName':_0x4ad074,'dbId':_0x130074,'sqlContent':_0x665772}),_0x303b58=ensureRemoteSqlContent(_0xe9d25a),_0x325d88=_0x13f597||await getDbName(_0x5cd63d[_0x4a967c(0x175)],_0x130074)[_0x4a967c(0x189)](()=>undefined),_0x44be12=buildSqlRelativePath(_0xe9d25a[_0x4a967c(0x190)],_0xe9d25a[_0x4a967c(0x163)],_0x325d88,_0x2c22e6,_0x130074),_0x158aab=_0x41df1b[_0x4a967c(0x168)]+'/'+_0x44be12,_0x16f46b=buildLocalSqlFileContent({'sqlCode':_0xe9d25a[_0x4a967c(0x190)],'sqlName':_0xe9d25a[_0x4a967c(0x163)],'dbId':_0xe9d25a[_0x4a967c(0x16d)]},_0x303b58,{'dbName':_0x325d88,'mode':_0x2c22e6,'syncedAt':new Date()[_0x4a967c(0x180)](),'description':_0xe9d25a['description']});if(await fileExists(_0x158aab))throw CliErrors[_0x4a967c(0x199)](_0x4a967c(0x15d)+_0x158aab);await ensureParentDirectory(_0x158aab),await writeFile(_0x158aab,_0x16f46b,_0x4a967c(0x185));const _0x2dfaa1=await readSqlLockFile(_0x41df1b[_0x4a967c(0x170)]),{lockData:_0x4184a5,appLock:_0x39ab38}=ensureSqlLockScope(_0x2dfaa1??createEmptySqlLock(),_0x41df1b[_0x4a967c(0x175)],_0x41df1b[_0x4a967c(0x186)],'new');return _0x39ab38[_0x4a967c(0x17b)][_0xe9d25a[_0x4a967c(0x190)]]={...buildSqlLockEntry(_0xe9d25a,_0x303b58,computeSqlContentHash(_0x16f46b),{'dbName':_0x325d88}),'path':_0x44be12,'mode':_0x2c22e6},_0x39ab38[_0x4a967c(0x171)]=new Date()[_0x4a967c(0x180)](),await writeSqlLockFile(_0x41df1b[_0x4a967c(0x170)],_0x4184a5),{'ok':!![],'data':{'id':_0xe9d25a['id'],'sqlCode':_0xe9d25a[_0x4a967c(0x190)],'sqlName':_0xe9d25a['sqlName'],'dbId':_0xe9d25a['dbId'],'path':_0x158aab,'mode':_0x2c22e6},'message':_0x4a967c(0x18d)+_0xe9d25a[_0x4a967c(0x190)]};}};async function resolveSqlNewInputs(_0x34baee){const _0x424b10=await resolveSqlNameInput(_0x34baee),{dbId:_0x3e0c64,dbName:_0x64536c}=await resolveDbSelection(_0x34baee),_0x6530d9=await resolveSqlModeInput(_0x34baee);return{'sqlName':_0x424b10,'dbId':_0x3e0c64,'dbName':_0x64536c,'mode':_0x6530d9};}async function resolveSqlNameInput(_0x422eba){const _0x2f0175=a175_0xb66e67,_0x588457=_0x422eba[_0x2f0175(0x18c)](_0x2f0175(0x179))[_0x2f0175(0x15f)]();if(_0x588457)return _0x588457;if(_0x422eba[_0x2f0175(0x182)])throw CliErrors['flagMissing']('name',_0x2f0175(0x169));return(await input({'message':'请输入\x20SQL\x20名称:','validate':_0x1d0459=>_0x1d0459[_0x2f0175(0x15f)]()?!![]:'SQL\x20名称不能为空'}))[_0x2f0175(0x15f)]();}async function resolveDbSelection(_0x3ac194){const _0x4de031=a175_0xb66e67,_0x5e8c26=resolveProvidedDbId(_0x3ac194);if(typeof _0x5e8c26===_0x4de031(0x172)&&Number[_0x4de031(0x15c)](_0x5e8c26)&&_0x5e8c26>0x0)return{'dbId':_0x5e8c26,'dbName':await getDbName(_0x3ac194['appCode'],_0x5e8c26)[_0x4de031(0x189)](()=>undefined)};if(_0x3ac194['nonInteractive'])throw CliErrors[_0x4de031(0x177)](_0x4de031(0x17f),_0x4de031(0x167));const _0x508dd3=await listDatabases(_0x3ac194[_0x4de031(0x175)])[_0x4de031(0x189)](()=>[]);if(_0x508dd3[_0x4de031(0x184)]===0x1)return{'dbId':_0x508dd3[0x0][_0x4de031(0x16d)],'dbName':_0x508dd3[0x0][_0x4de031(0x17d)]};if(_0x508dd3[_0x4de031(0x184)]>0x1){const _0x40325c=await select({'message':_0x4de031(0x176),'choices':[..._0x508dd3[_0x4de031(0x192)](_0x155037=>({'name':_0x155037[_0x4de031(0x17d)]+'\x20('+_0x155037['dbId']+')','value':serializeDbSelection(_0x155037)})),{'name':_0x4de031(0x174),'value':_0x4de031(0x17c)}]});if(_0x40325c!==_0x4de031(0x17c))return deserializeDbSelection(_0x40325c);}const _0x4b822e=await input({'message':'请输入目标数据库\x20dbId:','validate':_0x1513df=>{const _0x456ab9=_0x4de031,_0x456f54=_0x1513df[_0x456ab9(0x15f)]();if(!_0x456f54)return'dbId\x20不能为空';const _0x1fab30=Number(_0x456f54);if(!Number['isInteger'](_0x1fab30)||_0x1fab30<=0x0)return _0x456ab9(0x161);return!![];}});return{'dbId':Number(_0x4b822e[_0x4de031(0x15f)]())};}async function resolveSqlModeInput(_0x271a23){const _0x1ec1ab=a175_0xb66e67,_0x291262=_0x271a23['str'](_0x1ec1ab(0x183))[_0x1ec1ab(0x15f)]();if(_0x291262==='sql'||_0x291262===_0x1ec1ab(0x191))return _0x291262;if(_0x271a23[_0x1ec1ab(0x182)])throw CliErrors[_0x1ec1ab(0x177)]('mode',_0x1ec1ab(0x188));return await select({'message':'请选择本地\x20SQL\x20模式:','choices':[{'name':_0x1ec1ab(0x17e),'value':'sql','description':'适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句'},{'name':'MyBatis\x20XML(mybatisXml)','value':'mybatisXml','description':'适合带动态标签的\x20MyBatis\x20XML\x20SQL'}]});}function serializeDbSelection(_0x3689fc){const _0x563e24=a175_0xb66e67;return JSON[_0x563e24(0x16a)]({'dbId':_0x3689fc['dbId'],'dbName':_0x3689fc[_0x563e24(0x17d)]});}function deserializeDbSelection(_0x10ba5d){const _0xdb626e=a175_0xb66e67;try{const _0x4a48f3=JSON[_0xdb626e(0x178)](_0x10ba5d);if(typeof _0x4a48f3['dbId']===_0xdb626e(0x172)&&Number[_0xdb626e(0x15c)](_0x4a48f3[_0xdb626e(0x16d)]))return{'dbId':_0x4a48f3['dbId'],'dbName':_0x4a48f3[_0xdb626e(0x17d)]};}catch{}throw CliErrors['validation'](_0xdb626e(0x194)+_0x10ba5d);}function resolveProvidedDbId(_0x39932b){const _0x478d2b=a175_0xb66e67,_0x266cba=_0x39932b[_0x478d2b(0x173)](_0x478d2b(0x17f));if(typeof _0x266cba===_0x478d2b(0x172)&&Number[_0x478d2b(0x15c)](_0x266cba))return _0x266cba;return undefined;}
1
+ const a183_0x367620=a183_0xc3d5;(function(_0xb9f59b,_0xee2c0d){const _0x57e2a6=a183_0xc3d5,_0x5b609c=_0xb9f59b();while(!![]){try{const _0x1e109b=-parseInt(_0x57e2a6(0x88))/0x1*(-parseInt(_0x57e2a6(0x87))/0x2)+-parseInt(_0x57e2a6(0x7a))/0x3*(-parseInt(_0x57e2a6(0x90))/0x4)+-parseInt(_0x57e2a6(0x74))/0x5*(-parseInt(_0x57e2a6(0x6c))/0x6)+-parseInt(_0x57e2a6(0x6e))/0x7*(parseInt(_0x57e2a6(0x68))/0x8)+-parseInt(_0x57e2a6(0x89))/0x9*(parseInt(_0x57e2a6(0xa7))/0xa)+-parseInt(_0x57e2a6(0x80))/0xb+-parseInt(_0x57e2a6(0xa6))/0xc*(parseInt(_0x57e2a6(0x76))/0xd);if(_0x1e109b===_0xee2c0d)break;else _0x5b609c['push'](_0x5b609c['shift']());}catch(_0x42382e){_0x5b609c['push'](_0x5b609c['shift']());}}}(a183_0x19ca,0x5ad34));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a183_0x19ca(){const _0x2baf13=['dbName','create','SQL\x20query\x20display\x20name','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','isFinite','12GQnmIj','530JESplr','db-id','dbId','string','dbId\x20必须为正整数','1240uApxxn','nonInteractive','MyBatis\x20XML(mybatisXml)','number','18gYYFcY','Created\x20SQL\x20query\x20','22645PdniES','toISOString','sqlRoot','lockFilePath','trim','mode','1127125cPqiiq','new','1671995TJNMhr','str','SQL\x20名称不能为空','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','540411PXZLUW','sqls','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','\x20\x20SELECT\x201\x20AS\x20id','__manual__','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','3368849JKzJXQ','name','length','Invalid\x20database\x20selection\x20payload:\x20','flag','map','Target\x20database\x20ID','32974BuegTh','23Kmcrxb','18243LQKxgo','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','mybatisXml','appCode','stringify','join','sqlRootDir','8FIrfGx','description','适合带动态标签的\x20MyBatis\x20XML\x20SQL','</select>','sqlCode','sql','sqlName','✎\x20手动输入\x20dbId','/smartapi/custom/saveUserCustomSql','isInteger','flagMissing','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','Local\x20SQL\x20file\x20mode','parse','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','catch','lastSync'];a183_0x19ca=function(){return _0x2baf13;};return a183_0x19ca();}import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function a183_0xc3d5(_0x5d0985,_0x222c03){_0x5d0985=_0x5d0985-0x68;const _0x19ca32=a183_0x19ca();let _0xc3d545=_0x19ca32[_0x5d0985];return _0xc3d545;}function generateSqlTemplate(_0x471da6){const _0x43f7b9=a183_0xc3d5;if(_0x471da6===_0x43f7b9(0x8b))return[_0x43f7b9(0x79),_0x43f7b9(0x7d),_0x43f7b9(0x93),''][_0x43f7b9(0x8e)]('\x0a');return['SELECT\x201\x20AS\x20id;','']['join']('\x0a');}export const sqlCreate={'service':'sql','command':a183_0x367620(0xa2),'description':a183_0x367620(0x9e),'risk':'write','flags':[{'name':a183_0x367620(0x81),'type':a183_0x367620(0xaa),'description':a183_0x367620(0xa3)},{'name':'db-id','type':a183_0x367620(0x6b),'description':a183_0x367620(0x86)},{'name':a183_0x367620(0x73),'type':'string','enum':[a183_0x367620(0x95),'mybatisXml'],'description':a183_0x367620(0x9c)}],async 'validate'(_0x2a0a7e){const _0x5c0f3e=a183_0x367620;if(!_0x2a0a7e[_0x5c0f3e(0x69)])return;if(!_0x2a0a7e[_0x5c0f3e(0x77)](_0x5c0f3e(0x81))['trim']())throw CliErrors['flagMissing'](_0x5c0f3e(0x81),_0x5c0f3e(0x7f));const _0x397738=resolveProvidedDbId(_0x2a0a7e);if(typeof _0x397738!=='number'||!Number['isFinite'](_0x397738)||_0x397738<=0x0)throw CliErrors[_0x5c0f3e(0x9a)](_0x5c0f3e(0xa8),_0x5c0f3e(0x9b));if(!_0x2a0a7e[_0x5c0f3e(0x77)]('mode')[_0x5c0f3e(0x72)]())throw CliErrors['flagMissing'](_0x5c0f3e(0x73),_0x5c0f3e(0x7c));},async 'dryRun'(_0x595d82){const _0x4a0df5=a183_0x367620,_0x1271df=loadSqlProjectConfig(_0x595d82[_0x4a0df5(0x8c)]),{sqlName:_0x1091b9,dbId:_0x1767db,dbName:_0x240574,mode:_0x4adfff}=await resolveSqlNewInputs(_0x595d82),_0x13f627=buildSqlRelativePath('<server-generated-sqlCode>',_0x1091b9,_0x240574,_0x4adfff,_0x1767db),_0x3f678a=_0x1271df[_0x4a0df5(0x8f)]+'/'+_0x13f627;return{'method':'POST','url':_0x4a0df5(0x98),'body':{'appCode':_0x595d82[_0x4a0df5(0x8c)],'sqlName':_0x1091b9,'dbId':_0x1767db,'mode':_0x4adfff,'localPath':_0x3f678a},'description':_0x4a0df5(0xa4)+_0x1271df[_0x4a0df5(0x8f)]};},async 'execute'(_0x20c62b){const _0x30df47=a183_0x367620,_0x153785=loadSqlProjectConfig(_0x20c62b[_0x30df47(0x8c)]),{sqlName:_0x31f6dd,dbId:_0x55e727,dbName:_0x56726d,mode:_0x2cd004}=await resolveSqlNewInputs(_0x20c62b),_0x4e51c9=generateSqlTemplate(_0x2cd004),_0x281c36=await createSqlQuery({'appCode':_0x20c62b['appCode'],'sqlName':_0x31f6dd,'dbId':_0x55e727,'sqlContent':_0x4e51c9}),_0x4ffa33=ensureRemoteSqlContent(_0x281c36),_0x1fe5f6=_0x56726d||await getDbName(_0x20c62b[_0x30df47(0x8c)],_0x55e727)[_0x30df47(0x9f)](()=>undefined),_0x44f9b4=buildSqlRelativePath(_0x281c36[_0x30df47(0x94)],_0x281c36[_0x30df47(0x96)],_0x1fe5f6,_0x2cd004,_0x55e727),_0x149350=_0x153785[_0x30df47(0x8f)]+'/'+_0x44f9b4,_0x157fb1=buildLocalSqlFileContent({'sqlCode':_0x281c36[_0x30df47(0x94)],'sqlName':_0x281c36['sqlName'],'dbId':_0x281c36[_0x30df47(0xa9)]},_0x4ffa33,{'dbName':_0x1fe5f6,'mode':_0x2cd004,'syncedAt':new Date()['toISOString'](),'description':_0x281c36[_0x30df47(0x91)]});if(await fileExists(_0x149350))throw CliErrors['validation']('File\x20already\x20exists:\x20'+_0x149350);await ensureParentDirectory(_0x149350),await writeFile(_0x149350,_0x157fb1,'utf8');const _0x216e6c=await readSqlLockFile(_0x153785[_0x30df47(0x71)]),{lockData:_0x20d731,appLock:_0x392612}=ensureSqlLockScope(_0x216e6c??createEmptySqlLock(),_0x153785[_0x30df47(0x8c)],_0x153785[_0x30df47(0x70)],_0x30df47(0x75));return _0x392612[_0x30df47(0x7b)][_0x281c36[_0x30df47(0x94)]]={...buildSqlLockEntry(_0x281c36,_0x4ffa33,computeSqlContentHash(_0x157fb1),{'dbName':_0x1fe5f6}),'path':_0x44f9b4,'mode':_0x2cd004},_0x392612[_0x30df47(0xa0)]=new Date()[_0x30df47(0x6f)](),await writeSqlLockFile(_0x153785[_0x30df47(0x71)],_0x20d731),{'ok':!![],'data':{'id':_0x281c36['id'],'sqlCode':_0x281c36[_0x30df47(0x94)],'sqlName':_0x281c36[_0x30df47(0x96)],'dbId':_0x281c36[_0x30df47(0xa9)],'path':_0x149350,'mode':_0x2cd004},'message':_0x30df47(0x6d)+_0x281c36['sqlCode']};}};async function resolveSqlNewInputs(_0xf7cc71){const _0x2d3369=await resolveSqlNameInput(_0xf7cc71),{dbId:_0x4228bb,dbName:_0x12f86b}=await resolveDbSelection(_0xf7cc71),_0x18341d=await resolveSqlModeInput(_0xf7cc71);return{'sqlName':_0x2d3369,'dbId':_0x4228bb,'dbName':_0x12f86b,'mode':_0x18341d};}async function resolveSqlNameInput(_0x590cfe){const _0x7b3953=a183_0x367620,_0x3fc230=_0x590cfe[_0x7b3953(0x77)]('name')['trim']();if(_0x3fc230)return _0x3fc230;if(_0x590cfe[_0x7b3953(0x69)])throw CliErrors[_0x7b3953(0x9a)](_0x7b3953(0x81),_0x7b3953(0x7f));return(await input({'message':'请输入\x20SQL\x20名称:','validate':_0x43fdbe=>_0x43fdbe[_0x7b3953(0x72)]()?!![]:_0x7b3953(0x78)}))[_0x7b3953(0x72)]();}async function resolveDbSelection(_0x2646ab){const _0x1c418c=a183_0x367620,_0x4f0757=resolveProvidedDbId(_0x2646ab);if(typeof _0x4f0757===_0x1c418c(0x6b)&&Number[_0x1c418c(0xa5)](_0x4f0757)&&_0x4f0757>0x0)return{'dbId':_0x4f0757,'dbName':await getDbName(_0x2646ab[_0x1c418c(0x8c)],_0x4f0757)['catch'](()=>undefined)};if(_0x2646ab['nonInteractive'])throw CliErrors[_0x1c418c(0x9a)](_0x1c418c(0xa8),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x407167=await listDatabases(_0x2646ab['appCode'])[_0x1c418c(0x9f)](()=>[]);if(_0x407167[_0x1c418c(0x82)]===0x1)return{'dbId':_0x407167[0x0]['dbId'],'dbName':_0x407167[0x0]['dbName']};if(_0x407167[_0x1c418c(0x82)]>0x1){const _0x20f2fc=await select({'message':'请选择目标数据库:','choices':[..._0x407167[_0x1c418c(0x85)](_0x272dff=>({'name':_0x272dff['dbName']+'\x20('+_0x272dff['dbId']+')','value':serializeDbSelection(_0x272dff)})),{'name':_0x1c418c(0x97),'value':'__manual__'}]});if(_0x20f2fc!==_0x1c418c(0x7e))return deserializeDbSelection(_0x20f2fc);}const _0x58d56c=await input({'message':'请输入目标数据库\x20dbId:','validate':_0x5ba932=>{const _0x4b4601=_0x1c418c,_0x22afda=_0x5ba932[_0x4b4601(0x72)]();if(!_0x22afda)return'dbId\x20不能为空';const _0x5b5572=Number(_0x22afda);if(!Number[_0x4b4601(0x99)](_0x5b5572)||_0x5b5572<=0x0)return _0x4b4601(0xab);return!![];}});return{'dbId':Number(_0x58d56c['trim']())};}async function resolveSqlModeInput(_0x1f74ba){const _0x24bc72=a183_0x367620,_0xecaf71=_0x1f74ba[_0x24bc72(0x77)](_0x24bc72(0x73))['trim']();if(_0xecaf71===_0x24bc72(0x95)||_0xecaf71===_0x24bc72(0x8b))return _0xecaf71;if(_0x1f74ba[_0x24bc72(0x69)])throw CliErrors[_0x24bc72(0x9a)](_0x24bc72(0x73),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');return await select({'message':'请选择本地\x20SQL\x20模式:','choices':[{'name':'普通\x20SQL(sql)','value':_0x24bc72(0x95),'description':_0x24bc72(0x8a)},{'name':_0x24bc72(0x6a),'value':_0x24bc72(0x8b),'description':_0x24bc72(0x92)}]});}function serializeDbSelection(_0x4dc60b){const _0x1b1214=a183_0x367620;return JSON[_0x1b1214(0x8d)]({'dbId':_0x4dc60b['dbId'],'dbName':_0x4dc60b[_0x1b1214(0xa1)]});}function deserializeDbSelection(_0x34534b){const _0x1aa7f5=a183_0x367620;try{const _0x34c3fb=JSON[_0x1aa7f5(0x9d)](_0x34534b);if(typeof _0x34c3fb['dbId']===_0x1aa7f5(0x6b)&&Number[_0x1aa7f5(0xa5)](_0x34c3fb[_0x1aa7f5(0xa9)]))return{'dbId':_0x34c3fb[_0x1aa7f5(0xa9)],'dbName':_0x34c3fb[_0x1aa7f5(0xa1)]};}catch{}throw CliErrors['validation'](_0x1aa7f5(0x83)+_0x34534b);}function resolveProvidedDbId(_0x87877){const _0x3056c0=a183_0x367620,_0x23e83d=_0x87877[_0x3056c0(0x84)](_0x3056c0(0xa8));if(typeof _0x23e83d==='number'&&Number[_0x3056c0(0xa5)](_0x23e83d))return _0x23e83d;return undefined;}
@@ -1 +1 @@
1
- function a176_0x5369(){const _0x137231=['SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','150185iOinRi','projectRoot','lastSync','remoteId','19896560vtTwgc','317723kcBbAo','high-risk-write','appCode','trashedTo','fromEntries','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','validation','2505688KXIRtm','str','sqlRoot','Would\x20delete\x20SQL\x20','sqlRootDir','sqlcode','68ofRwTj','9SkbVyA','\x20(local\x20file\x20moved\x20to\x20trash)','sqls','POST','lockFilePath','delete','length','1030252NqXZDu','34809NlvcWH','72CzBgrt','toISOString','replace','3820450RAPjVR'];a176_0x5369=function(){return _0x137231;};return a176_0x5369();}const a176_0x3db9ff=a176_0x571b;(function(_0x48cf86,_0x3449c4){const _0x57eff2=a176_0x571b,_0x2adcbd=_0x48cf86();while(!![]){try{const _0x4da9f4=parseInt(_0x57eff2(0xb2))/0x1+-parseInt(_0x57eff2(0xc4))/0x2*(-parseInt(_0x57eff2(0xcd))/0x3)+parseInt(_0x57eff2(0xcc))/0x4+parseInt(_0x57eff2(0xd1))/0x5+-parseInt(_0x57eff2(0xce))/0x6*(-parseInt(_0x57eff2(0xb7))/0x7)+parseInt(_0x57eff2(0xbe))/0x8*(parseInt(_0x57eff2(0xc5))/0x9)+-parseInt(_0x57eff2(0xb6))/0xa;if(_0x4da9f4===_0x3449c4)break;else _0x2adcbd['push'](_0x2adcbd['shift']());}catch(_0x8633ec){_0x2adcbd['push'](_0x2adcbd['shift']());}}}(a176_0x5369,0x6a183));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 a176_0x571b(_0x3f4a7e,_0xaf41be){_0x3f4a7e=_0x3f4a7e-0xb2;const _0x53698c=a176_0x5369();let _0x571b1f=_0x53698c[_0x3f4a7e];return _0x571b1f;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':'sql','command':a176_0x3db9ff(0xca),'description':'Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','risk':a176_0x3db9ff(0xb8),'flags':[SQLCODE_FLAG],async 'validate'(_0x5bcdcc){const _0x6fe745=a176_0x3db9ff,_0x2b7c9e=loadSqlProjectConfig(_0x5bcdcc[_0x6fe745(0xb9)]),_0x304fdb=await readSqlLockFile(_0x2b7c9e['lockFilePath']);if(!_0x304fdb)throw CliErrors[_0x6fe745(0xbd)](_0x6fe745(0xd2));},async 'dryRun'(_0x3dabbf){const _0x4a0d16=a176_0x3db9ff,_0x1fa05d=loadSqlProjectConfig(_0x3dabbf[_0x4a0d16(0xb9)]),_0x1743a4=await readSqlLockFile(_0x1fa05d[_0x4a0d16(0xc9)]);if(!_0x1743a4)throw CliErrors[_0x4a0d16(0xbd)](_0x4a0d16(0xd2));const {appLock:_0x7f9f7d}=ensureSqlLockScope(_0x1743a4,_0x3dabbf['appCode'],_0x1fa05d[_0x4a0d16(0xc0)],_0x4a0d16(0xca)),_0x3722a7=_0x3dabbf[_0x4a0d16(0xbf)](_0x4a0d16(0xc3)),_0x4f6ad2=_0x7f9f7d[_0x4a0d16(0xc7)][_0x3722a7];if(!_0x4f6ad2)throw CliErrors[_0x4a0d16(0xbd)](_0x4a0d16(0xbc)+_0x3722a7+'\x22.');return{'method':_0x4a0d16(0xc8),'url':'/smartapi/custom/deleteUserCustomSql','body':{'sqlCode':_0x3722a7,'id':_0x4f6ad2[_0x4a0d16(0xb5)],'localPath':resolveLocalSqlFilePath(_0x1fa05d,_0x3722a7,_0x4f6ad2)},'description':_0x4a0d16(0xc1)+_0x3722a7+'\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20'+_0x1fa05d['trashDir']};},async 'execute'(_0x5ef8bc){const _0x5913d8=a176_0x3db9ff,_0x4c695a=loadSqlProjectConfig(_0x5ef8bc[_0x5913d8(0xb9)]),_0x2c7d09=await readSqlLockFile(_0x4c695a['lockFilePath']);if(!_0x2c7d09)throw CliErrors[_0x5913d8(0xbd)]('SQL\x20lock\x20file\x20not\x20found.');const {lockData:_0x26275a,appLock:_0x18dc33}=ensureSqlLockScope(_0x2c7d09,_0x5ef8bc[_0x5913d8(0xb9)],_0x4c695a[_0x5913d8(0xc0)],_0x5913d8(0xca)),_0x18c448=_0x5ef8bc[_0x5913d8(0xbf)](_0x5913d8(0xc3)),_0x282d2b=_0x18dc33['sqls'][_0x18c448];if(!_0x282d2b)throw CliErrors[_0x5913d8(0xbd)](_0x5913d8(0xbc)+_0x18c448+'\x22.');await deleteSqlQuery({'id':_0x282d2b[_0x5913d8(0xb5)],'sqlCode':_0x18c448}),_0x18dc33[_0x5913d8(0xc7)]=Object[_0x5913d8(0xbb)](Object['entries'](_0x18dc33[_0x5913d8(0xc7)])['filter'](([_0x35e2d0])=>_0x35e2d0!==_0x18c448)),_0x18dc33[_0x5913d8(0xb4)]=new Date()[_0x5913d8(0xcf)](),await writeSqlLockFile(_0x4c695a['lockFilePath'],_0x26275a);const _0x14fbe5=resolveLocalSqlFilePath(_0x4c695a,_0x18c448,_0x282d2b);let _0xac7cb;await fileExists(_0x14fbe5)&&(_0xac7cb=await moveToTrash(_0x4c695a[_0x5913d8(0xb3)],_0x4c695a['trashDir'],_0x14fbe5),await cleanupEmptyDirectories(dirname(_0x14fbe5),_0x4c695a[_0x5913d8(0xc2)]));const _0x370f08={'deleted':_0x18c448,'remoteId':_0x282d2b['remoteId']};if(_0xac7cb)_0x370f08[_0x5913d8(0xba)]=_0xac7cb;return{'ok':!![],'data':_0x370f08,'message':'Deleted\x20'+_0x18c448+(_0xac7cb?_0x5913d8(0xc6):'')};}};async function moveToTrash(_0x313ced,_0x5b3acc,_0x5d9bdb){const _0x3580f0=a176_0x3db9ff,_0x316311=new Date()[_0x3580f0(0xcf)]()[_0x3580f0(0xd0)](/[:.]/g,'-'),_0x379da6=relative(_0x313ced,_0x5d9bdb),_0x9ae428=join(_0x5b3acc,_0x316311,_0x379da6);return await mkdir(dirname(_0x9ae428),{'recursive':!![]}),await rename(_0x5d9bdb,_0x9ae428),_0x9ae428;}async function cleanupEmptyDirectories(_0xe061a,_0x52b7ac){const _0x1faf0d=a176_0x3db9ff;let _0x4f2aa9=resolve(_0xe061a);const _0x521413=resolve(_0x52b7ac);while(_0x4f2aa9['startsWith'](''+_0x521413+sep)||_0x4f2aa9===_0x521413){if(_0x4f2aa9===_0x521413)return;try{const _0x53f54b=await readdir(_0x4f2aa9);if(_0x53f54b[_0x1faf0d(0xcb)]>0x0)return;await rmdir(_0x4f2aa9);}catch{return;}_0x4f2aa9=dirname(_0x4f2aa9);}}
1
+ const a184_0x49416c=a184_0x482f;function a184_0x482f(_0x325213,_0x5921f4){_0x325213=_0x325213-0x10d;const _0x1d8e84=a184_0x1d8e();let _0x482f38=_0x1d8e84[_0x325213];return _0x482f38;}(function(_0x413aa7,_0x443147){const _0x25b33d=a184_0x482f,_0x43a3be=_0x413aa7();while(!![]){try{const _0x111c62=parseInt(_0x25b33d(0x125))/0x1+-parseInt(_0x25b33d(0x121))/0x2+parseInt(_0x25b33d(0x123))/0x3+parseInt(_0x25b33d(0x11f))/0x4*(-parseInt(_0x25b33d(0x11e))/0x5)+-parseInt(_0x25b33d(0x12f))/0x6+parseInt(_0x25b33d(0x117))/0x7*(parseInt(_0x25b33d(0x12e))/0x8)+-parseInt(_0x25b33d(0x11a))/0x9*(-parseInt(_0x25b33d(0x118))/0xa);if(_0x111c62===_0x443147)break;else _0x43a3be['push'](_0x43a3be['shift']());}catch(_0x130f04){_0x43a3be['push'](_0x43a3be['shift']());}}}(a184_0x1d8e,0x63520));function a184_0x1d8e(){const _0x24228f=['sql','sqls','9394wWPrrh','730QOYIEt','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','7767NFTHPF','Would\x20delete\x20SQL\x20','trashDir','POST','20rRTxcj','711512BacQbF','high-risk-write','942214pMtedw','appCode','1658775yqqSEK','sqlRootDir','783734feTUso','startsWith','/smartapi/custom/deleteUserCustomSql','length','\x20(local\x20file\x20moved\x20to\x20trash)','projectRoot','replace','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','filter','2008MzKhTf','882390gVFwku','Deleted\x20','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','validation','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','remoteId','fromEntries','toISOString','str','delete','lockFilePath','sqlRoot'];a184_0x1d8e=function(){return _0x24228f;};return a184_0x1d8e();}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';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a184_0x49416c(0x115),'command':a184_0x49416c(0x112),'description':a184_0x49416c(0x131),'risk':a184_0x49416c(0x120),'flags':[SQLCODE_FLAG],async 'validate'(_0xa83003){const _0x41f3a9=a184_0x49416c,_0x5fa4da=loadSqlProjectConfig(_0xa83003[_0x41f3a9(0x122)]),_0x48a1b8=await readSqlLockFile(_0x5fa4da[_0x41f3a9(0x113)]);if(!_0x48a1b8)throw CliErrors[_0x41f3a9(0x132)](_0x41f3a9(0x119));},async 'dryRun'(_0x2cdd30){const _0x5ea5d7=a184_0x49416c,_0x2e8512=loadSqlProjectConfig(_0x2cdd30['appCode']),_0x17495d=await readSqlLockFile(_0x2e8512[_0x5ea5d7(0x113)]);if(!_0x17495d)throw CliErrors['validation'](_0x5ea5d7(0x119));const {appLock:_0x5ac7c1}=ensureSqlLockScope(_0x17495d,_0x2cdd30[_0x5ea5d7(0x122)],_0x2e8512[_0x5ea5d7(0x114)],'delete'),_0x17b5a1=_0x2cdd30[_0x5ea5d7(0x111)]('sqlcode'),_0x2ee678=_0x5ac7c1['sqls'][_0x17b5a1];if(!_0x2ee678)throw CliErrors[_0x5ea5d7(0x132)](_0x5ea5d7(0x10d)+_0x17b5a1+'\x22.');return{'method':_0x5ea5d7(0x11d),'url':_0x5ea5d7(0x127),'body':{'sqlCode':_0x17b5a1,'id':_0x2ee678[_0x5ea5d7(0x10e)],'localPath':resolveLocalSqlFilePath(_0x2e8512,_0x17b5a1,_0x2ee678)},'description':_0x5ea5d7(0x11b)+_0x17b5a1+_0x5ea5d7(0x12c)+_0x2e8512[_0x5ea5d7(0x11c)]};},async 'execute'(_0x32781a){const _0x47b531=a184_0x49416c,_0x3fe747=loadSqlProjectConfig(_0x32781a['appCode']),_0x5f5205=await readSqlLockFile(_0x3fe747[_0x47b531(0x113)]);if(!_0x5f5205)throw CliErrors[_0x47b531(0x132)]('SQL\x20lock\x20file\x20not\x20found.');const {lockData:_0x343402,appLock:_0x41a16c}=ensureSqlLockScope(_0x5f5205,_0x32781a[_0x47b531(0x122)],_0x3fe747[_0x47b531(0x114)],_0x47b531(0x112)),_0x4850bf=_0x32781a[_0x47b531(0x111)]('sqlcode'),_0x3c66da=_0x41a16c[_0x47b531(0x116)][_0x4850bf];if(!_0x3c66da)throw CliErrors[_0x47b531(0x132)]('No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22'+_0x4850bf+'\x22.');await deleteSqlQuery({'id':_0x3c66da[_0x47b531(0x10e)],'sqlCode':_0x4850bf}),_0x41a16c[_0x47b531(0x116)]=Object[_0x47b531(0x10f)](Object['entries'](_0x41a16c[_0x47b531(0x116)])[_0x47b531(0x12d)](([_0x5e6ff1])=>_0x5e6ff1!==_0x4850bf)),_0x41a16c['lastSync']=new Date()['toISOString'](),await writeSqlLockFile(_0x3fe747['lockFilePath'],_0x343402);const _0x42cec2=resolveLocalSqlFilePath(_0x3fe747,_0x4850bf,_0x3c66da);let _0x42cc45;await fileExists(_0x42cec2)&&(_0x42cc45=await moveToTrash(_0x3fe747[_0x47b531(0x12a)],_0x3fe747['trashDir'],_0x42cec2),await cleanupEmptyDirectories(dirname(_0x42cec2),_0x3fe747[_0x47b531(0x124)]));const _0x998eee={'deleted':_0x4850bf,'remoteId':_0x3c66da[_0x47b531(0x10e)]};if(_0x42cc45)_0x998eee['trashedTo']=_0x42cc45;return{'ok':!![],'data':_0x998eee,'message':_0x47b531(0x130)+_0x4850bf+(_0x42cc45?_0x47b531(0x129):'')};}};async function moveToTrash(_0x6ecd1,_0x27a063,_0x25d917){const _0x21fec5=a184_0x49416c,_0xa919ea=new Date()[_0x21fec5(0x110)]()[_0x21fec5(0x12b)](/[:.]/g,'-'),_0x1876ce=relative(_0x6ecd1,_0x25d917),_0x4e6b65=join(_0x27a063,_0xa919ea,_0x1876ce);return await mkdir(dirname(_0x4e6b65),{'recursive':!![]}),await rename(_0x25d917,_0x4e6b65),_0x4e6b65;}async function cleanupEmptyDirectories(_0x86e62f,_0x4ce7c9){const _0x10e6f6=a184_0x49416c;let _0x4006f8=resolve(_0x86e62f);const _0xf57f84=resolve(_0x4ce7c9);while(_0x4006f8[_0x10e6f6(0x126)](''+_0xf57f84+sep)||_0x4006f8===_0xf57f84){if(_0x4006f8===_0xf57f84)return;try{const _0x55faec=await readdir(_0x4006f8);if(_0x55faec[_0x10e6f6(0x128)]>0x0)return;await rmdir(_0x4006f8);}catch{return;}_0x4006f8=dirname(_0x4006f8);}}
@@ -1 +1 @@
1
- const a177_0x56388b=a177_0x5380;(function(_0x1a8f82,_0x2bbde1){const _0x3e82c9=a177_0x5380,_0x2b4036=_0x1a8f82();while(!![]){try{const _0x19683e=parseInt(_0x3e82c9(0xff))/0x1+-parseInt(_0x3e82c9(0x10c))/0x2*(-parseInt(_0x3e82c9(0x108))/0x3)+parseInt(_0x3e82c9(0x100))/0x4+-parseInt(_0x3e82c9(0xfd))/0x5+-parseInt(_0x3e82c9(0x10e))/0x6*(-parseInt(_0x3e82c9(0x106))/0x7)+parseInt(_0x3e82c9(0x109))/0x8*(-parseInt(_0x3e82c9(0x10b))/0x9)+-parseInt(_0x3e82c9(0x105))/0xa;if(_0x19683e===_0x2bbde1)break;else _0x2b4036['push'](_0x2b4036['shift']());}catch(_0x465100){_0x2b4036['push'](_0x2b4036['shift']());}}}(a177_0x5877,0x2c08b));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a177_0x5877(){const _0xffd6e1=['sql','3882mQZYJA','appCode','276645wxuGSa','verbose','51806WwTuKO','375420YilQnS','sqlContent','dbId','boolean','str','1539360ldZRKJ','2317QjqgIj','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','3EJeHAA','8FEPbRl','bool','1897065fdHeag','481190fOqGPK'];a177_0x5877=function(){return _0xffd6e1;};return a177_0x5877();}function a177_0x5380(_0x3810e8,_0x1a3d9d){_0x3810e8=_0x3810e8-0xfc;const _0x58771f=a177_0x5877();let _0x5380d7=_0x58771f[_0x3810e8];return _0x5380d7;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a177_0x56388b(0x10d),'command':'detail','description':a177_0x56388b(0x107),'risk':'read','flags':[SQLCODE_FLAG,{'name':'verbose','type':a177_0x56388b(0x103),'description':'Return\x20full\x20raw\x20SQL\x20query\x20object'}],async 'execute'(_0x189b84){const _0x1ae829=a177_0x56388b,_0x2ca118=await getSqlQueryInfo(_0x189b84[_0x1ae829(0xfc)],_0x189b84[_0x1ae829(0x104)]('sqlcode')),_0x397b51=_0x189b84[_0x1ae829(0x10a)](_0x1ae829(0xfe));if(_0x397b51)return{'ok':!![],'data':_0x2ca118};const _0x3c760f=_0x2ca118[_0x1ae829(0x102)]?await getDbName(_0x189b84['appCode'],_0x2ca118['dbId']):undefined;return{'ok':!![],'data':{'sqlCode':_0x2ca118['sqlCode'],'sqlName':_0x2ca118['sqlName'],'db':_0x3c760f?_0x3c760f+'\x20('+_0x2ca118[_0x1ae829(0x102)]+')':_0x2ca118[_0x1ae829(0x102)]??'','description':_0x2ca118['description']??'','sqlContent':_0x2ca118[_0x1ae829(0x101)]??''}};}};
1
+ function a185_0x81ce(_0x36ea21,_0x19c9e4){_0x36ea21=_0x36ea21-0x1e9;const _0xaf6c1a=a185_0xaf6c();let _0x81ce50=_0xaf6c1a[_0x36ea21];return _0x81ce50;}const a185_0x127dc3=a185_0x81ce;function a185_0xaf6c(){const _0x4774f0=['sql','description','sqlcode','Return\x20full\x20raw\x20SQL\x20query\x20object','verbose','read','397547bsjWje','bool','sqlContent','dbId','boolean','898310apyqbW','appCode','1527642rhqhDb','1763376Efrthh','sqlName','182272bMpZex','442197GzUAVz','sqlCode','2074296WTYrsc','2IokkSD'];a185_0xaf6c=function(){return _0x4774f0;};return a185_0xaf6c();}(function(_0x428bd0,_0x15f5e7){const _0x146ad=a185_0x81ce,_0xbddb3b=_0x428bd0();while(!![]){try{const _0x3a845a=-parseInt(_0x146ad(0x1ea))/0x1*(-parseInt(_0x146ad(0x1f8))/0x2)+parseInt(_0x146ad(0x1f5))/0x3+parseInt(_0x146ad(0x1f4))/0x4+-parseInt(_0x146ad(0x1ef))/0x5+-parseInt(_0x146ad(0x1f1))/0x6+parseInt(_0x146ad(0x1f7))/0x7+-parseInt(_0x146ad(0x1f2))/0x8;if(_0x3a845a===_0x15f5e7)break;else _0xbddb3b['push'](_0xbddb3b['shift']());}catch(_0x4ccfa2){_0xbddb3b['push'](_0xbddb3b['shift']());}}}(a185_0xaf6c,0x38ad7));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a185_0x127dc3(0x1f9),'command':'detail','description':'Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','risk':a185_0x127dc3(0x1e9),'flags':[SQLCODE_FLAG,{'name':a185_0x127dc3(0x1fd),'type':a185_0x127dc3(0x1ee),'description':a185_0x127dc3(0x1fc)}],async 'execute'(_0x1b0bd2){const _0x441ad3=a185_0x127dc3,_0xc2a6bc=await getSqlQueryInfo(_0x1b0bd2[_0x441ad3(0x1f0)],_0x1b0bd2['str'](_0x441ad3(0x1fb))),_0x3f478b=_0x1b0bd2[_0x441ad3(0x1eb)](_0x441ad3(0x1fd));if(_0x3f478b)return{'ok':!![],'data':_0xc2a6bc};const _0x209320=_0xc2a6bc['dbId']?await getDbName(_0x1b0bd2[_0x441ad3(0x1f0)],_0xc2a6bc[_0x441ad3(0x1ed)]):undefined;return{'ok':!![],'data':{'sqlCode':_0xc2a6bc[_0x441ad3(0x1f6)],'sqlName':_0xc2a6bc[_0x441ad3(0x1f3)],'db':_0x209320?_0x209320+'\x20('+_0xc2a6bc[_0x441ad3(0x1ed)]+')':_0xc2a6bc['dbId']??'','description':_0xc2a6bc[_0x441ad3(0x1fa)]??'','sqlContent':_0xc2a6bc[_0x441ad3(0x1ec)]??''}};}};
@@ -1 +1 @@
1
- function a178_0x2cff(_0x52dca4,_0x5df4dc){_0x52dca4=_0x52dca4-0x74;const _0x74cd1e=a178_0x74cd();let _0x2cfff5=_0x74cd1e[_0x52dca4];return _0x2cfff5;}function a178_0x74cd(){const _0x1d737d=['Returned\x20','execResult','exec','execSuccess','params','\x20row(s)\x20in\x20','383797ELRduq','890WAWmnB','now','5667966KQEyjr','execError','string','5124570qOGIGu','9468jDFmap','length','read','1949757aVIpqW','149387hPNpMU','983008GvQzGC','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','str','318PqUSxi','SQL\x20execution\x20failed','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','16BWsBuV'];a178_0x74cd=function(){return _0x1d737d;};return a178_0x74cd();}const a178_0x5c1a9e=a178_0x2cff;(function(_0x2f0bb8,_0x1169c7){const _0x29a39d=a178_0x2cff,_0x9770f1=_0x2f0bb8();while(!![]){try{const _0xc5983c=parseInt(_0x29a39d(0x80))/0x1+-parseInt(_0x29a39d(0x8c))/0x2+-parseInt(_0x29a39d(0x8a))/0x3+-parseInt(_0x29a39d(0x87))/0x4*(parseInt(_0x29a39d(0x81))/0x5)+-parseInt(_0x29a39d(0x76))/0x6*(-parseInt(_0x29a39d(0x8b))/0x7)+parseInt(_0x29a39d(0x79))/0x8*(parseInt(_0x29a39d(0x83))/0x9)+-parseInt(_0x29a39d(0x86))/0xa;if(_0xc5983c===_0x1169c7)break;else _0x9770f1['push'](_0x9770f1['shift']());}catch(_0x335df5){_0x9770f1['push'](_0x9770f1['shift']());}}}(a178_0x74cd,0xaab4c));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':'sql','command':a178_0x5c1a9e(0x7c),'description':a178_0x5c1a9e(0x74),'risk':a178_0x5c1a9e(0x89),'flags':[SQLCODE_FLAG,{'name':a178_0x5c1a9e(0x7e),'type':a178_0x5c1a9e(0x85),'description':a178_0x5c1a9e(0x78)}],async 'execute'(_0x9945d1){const _0x2c1f31=a178_0x5c1a9e,_0x1fee6f=parseJsonParams(_0x9945d1[_0x2c1f31(0x75)]('params')),_0xd1324f=Date['now'](),_0x2edefa=await executeSql(_0x9945d1['appCode'],_0x9945d1[_0x2c1f31(0x75)]('sqlcode'),_0x1fee6f),_0x29cba5=Date[_0x2c1f31(0x82)]()-_0xd1324f,_0x37932f=_0x2edefa?.[_0x2c1f31(0x7b)]??_0x2edefa,_0x2370fb=_0x2edefa?.[_0x2c1f31(0x7d)]??!![];if(!_0x2370fb)return{'ok':![],'data':{'error':_0x2edefa?.[_0x2c1f31(0x84)]||_0x2c1f31(0x77),'elapsed':_0x29cba5},'message':_0x2c1f31(0x77)};const _0x38cfdc=Array['isArray'](_0x37932f)?_0x37932f:[];return{'ok':!![],'data':{'rows':_0x38cfdc,'rowCount':_0x38cfdc[_0x2c1f31(0x88)],'elapsed':_0x29cba5},'message':_0x2c1f31(0x7a)+_0x38cfdc[_0x2c1f31(0x88)]+_0x2c1f31(0x7f)+_0x29cba5+'ms'};}};
1
+ const a186_0x44c0bd=a186_0xa632;(function(_0x44a337,_0xdab671){const _0x1951fa=a186_0xa632,_0x38f94a=_0x44a337();while(!![]){try{const _0x33ae46=parseInt(_0x1951fa(0x1bd))/0x1+-parseInt(_0x1951fa(0x1cc))/0x2+-parseInt(_0x1951fa(0x1c6))/0x3+parseInt(_0x1951fa(0x1d5))/0x4*(parseInt(_0x1951fa(0x1bf))/0x5)+parseInt(_0x1951fa(0x1cd))/0x6+parseInt(_0x1951fa(0x1c7))/0x7*(parseInt(_0x1951fa(0x1d2))/0x8)+-parseInt(_0x1951fa(0x1d4))/0x9*(parseInt(_0x1951fa(0x1ca))/0xa);if(_0x33ae46===_0xdab671)break;else _0x38f94a['push'](_0x38f94a['shift']());}catch(_0x59c3f5){_0x38f94a['push'](_0x38f94a['shift']());}}}(a186_0x1688,0x5eac9));import{executeSql}from'../../core/api-client.js';function a186_0xa632(_0x2ef079,_0x2b78e2){_0x2ef079=_0x2ef079-0x1bc;const _0x16886a=a186_0x1688();let _0xa63231=_0x16886a[_0x2ef079];return _0xa63231;}function a186_0x1688(){const _0x121af8=['2956645RweeAC','params','string','execError','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','isArray','appCode','864045NkYkuP','399NHSISr','\x20row(s)\x20in\x20','length','9674720GhfUjD','now','1295254JVVeFF','3966210NGesax','Returned\x20','execSuccess','sqlcode','sql','66872UftRZp','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','9aeYDGd','4JTjnzQ','execResult','562072GXpiTh','SQL\x20execution\x20failed'];a186_0x1688=function(){return _0x121af8;};return a186_0x1688();}import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a186_0x44c0bd(0x1d1),'command':'exec','description':a186_0x44c0bd(0x1c3),'risk':'read','flags':[SQLCODE_FLAG,{'name':a186_0x44c0bd(0x1c0),'type':a186_0x44c0bd(0x1c1),'description':a186_0x44c0bd(0x1d3)}],async 'execute'(_0xd6720d){const _0x3b0261=a186_0x44c0bd,_0x803028=parseJsonParams(_0xd6720d['str']('params')),_0xa50c0e=Date[_0x3b0261(0x1cb)](),_0x142b6f=await executeSql(_0xd6720d[_0x3b0261(0x1c5)],_0xd6720d['str'](_0x3b0261(0x1d0)),_0x803028),_0x2cf774=Date[_0x3b0261(0x1cb)]()-_0xa50c0e,_0x57c7e1=_0x142b6f?.[_0x3b0261(0x1bc)]??_0x142b6f,_0x1bd0a0=_0x142b6f?.[_0x3b0261(0x1cf)]??!![];if(!_0x1bd0a0)return{'ok':![],'data':{'error':_0x142b6f?.[_0x3b0261(0x1c2)]||_0x3b0261(0x1be),'elapsed':_0x2cf774},'message':_0x3b0261(0x1be)};const _0x5405ac=Array[_0x3b0261(0x1c4)](_0x57c7e1)?_0x57c7e1:[];return{'ok':!![],'data':{'rows':_0x5405ac,'rowCount':_0x5405ac[_0x3b0261(0x1c9)],'elapsed':_0x2cf774},'message':_0x3b0261(0x1ce)+_0x5405ac['length']+_0x3b0261(0x1c8)+_0x2cf774+'ms'};}};
@@ -1 +1 @@
1
- (function(_0x33c6e6,_0x1b32e4){const _0x4f43df=a179_0x3aaf,_0x1e6257=_0x33c6e6();while(!![]){try{const _0x2461bd=-parseInt(_0x4f43df(0x190))/0x1*(-parseInt(_0x4f43df(0x18c))/0x2)+parseInt(_0x4f43df(0x18a))/0x3+-parseInt(_0x4f43df(0x18e))/0x4+-parseInt(_0x4f43df(0x189))/0x5+-parseInt(_0x4f43df(0x18d))/0x6*(-parseInt(_0x4f43df(0x191))/0x7)+parseInt(_0x4f43df(0x18f))/0x8*(-parseInt(_0x4f43df(0x192))/0x9)+parseInt(_0x4f43df(0x18b))/0xa;if(_0x2461bd===_0x1b32e4)break;else _0x1e6257['push'](_0x1e6257['shift']());}catch(_0x25e982){_0x1e6257['push'](_0x1e6257['shift']());}}}(a179_0x4bdf,0x796aa));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';function a179_0x4bdf(){const _0x2dee00=['2507328gNQqjr','8zOUSSJ','43789EebTAa','77PVSpSZ','981702bPJfZD','1622455qxYBgs','1015092YoFdQv','4682590HZvBEf','2BxUdYJ','385806DuwuDl'];a179_0x4bdf=function(){return _0x2dee00;};return a179_0x4bdf();}import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';function a179_0x3aaf(_0x2af6e5,_0x17ae75){_0x2af6e5=_0x2af6e5-0x189;const _0x4bdf6b=a179_0x4bdf();let _0x3aafcc=_0x4bdf6b[_0x2af6e5];return _0x3aafcc;}import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
1
+ (function(_0x360f90,_0x4cf579){const _0x59e7b5=a187_0x2638,_0x483564=_0x360f90();while(!![]){try{const _0xcdb63=-parseInt(_0x59e7b5(0x1a3))/0x1+-parseInt(_0x59e7b5(0x1a8))/0x2*(parseInt(_0x59e7b5(0x1aa))/0x3)+parseInt(_0x59e7b5(0x1a9))/0x4*(-parseInt(_0x59e7b5(0x1a5))/0x5)+parseInt(_0x59e7b5(0x1a7))/0x6+parseInt(_0x59e7b5(0x1a6))/0x7+-parseInt(_0x59e7b5(0x1a4))/0x8+parseInt(_0x59e7b5(0x1a2))/0x9;if(_0xcdb63===_0x4cf579)break;else _0x483564['push'](_0x483564['shift']());}catch(_0x36643f){_0x483564['push'](_0x483564['shift']());}}}(a187_0x42a9,0x82c76));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';function a187_0x42a9(){const _0x51bb5b=['90796EXdWsW','2400789haOPWJ','12395943jjAFOQ','121042VUcKsX','5886080BMrrlb','145AyhjLn','3602550ShmDZx','5754174oXhiqS','2vWzmKO'];a187_0x42a9=function(){return _0x51bb5b;};return a187_0x42a9();}import{sqlValidate}from'../../commands/sql/validate.js';import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';function a187_0x2638(_0x3e665b,_0x4f63e9){_0x3e665b=_0x3e665b-0x1a2;const _0x42a9db=a187_0x42a9();let _0x2638e6=_0x42a9db[_0x3e665b];return _0x2638e6;}import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
@@ -1 +1 @@
1
- const a180_0x58971a=a180_0x47e5;(function(_0xbec79d,_0x4ee988){const _0x301537=a180_0x47e5,_0x7ef4d9=_0xbec79d();while(!![]){try{const _0x453b73=parseInt(_0x301537(0x1e3))/0x1+parseInt(_0x301537(0x1cc))/0x2+parseInt(_0x301537(0x1d7))/0x3*(-parseInt(_0x301537(0x1ca))/0x4)+parseInt(_0x301537(0x1e6))/0x5*(parseInt(_0x301537(0x1eb))/0x6)+parseInt(_0x301537(0x1d1))/0x7*(parseInt(_0x301537(0x1e0))/0x8)+-parseInt(_0x301537(0x1d2))/0x9*(parseInt(_0x301537(0x1cd))/0xa)+-parseInt(_0x301537(0x1dd))/0xb*(parseInt(_0x301537(0x1cb))/0xc);if(_0x453b73===_0x4ee988)break;else _0x7ef4d9['push'](_0x7ef4d9['shift']());}catch(_0x18b00e){_0x7ef4d9['push'](_0x7ef4d9['shift']());}}}(a180_0x2bc8,0x9596d));import{listSqlQueries}from'../../core/api-client.js';function a180_0x47e5(_0x57cac1,_0x16b4c1){_0x57cac1=_0x57cac1-0x1c8;const _0x2bc8f2=a180_0x2bc8();let _0x47e5da=_0x2bc8f2[_0x57cac1];return _0x47e5da;}function a180_0x2bc8(){const _0x3a0c5d=['verbose','309617NUDivS','description','sqlcode','9408392pSodkl','name','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','57447tldhYk','page','\x20SQL\x20queries\x20(total:\x20','2498570wIAshu','Page\x20size','read','paging','Filter\x20by\x20SQL\x20name','6ibjRdB','pagesize','No\x20custom\x20SQL\x20queries\x20found.','totalCount','appCode','number','List\x20custom\x20SQL\x20queries','116DowaDL','144pcNqzq','497334uAOyWH','1668190IRkStn','length','sqlName','Page\x20number','7ARRMXN','9BBHEnq','list','sqlCode','all','dbId','89439ynTkgp','num','map','str','tableData'];a180_0x2bc8=function(){return _0x3a0c5d;};return a180_0x2bc8();}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':'sql','command':a180_0x58971a(0x1d3),'description':a180_0x58971a(0x1c9),'risk':a180_0x58971a(0x1e8),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a180_0x58971a(0x1e1),'type':'string','description':a180_0x58971a(0x1ea)},{'name':a180_0x58971a(0x1e4),'type':'number','description':a180_0x58971a(0x1d0),'default':0x1},{'name':a180_0x58971a(0x1ec),'type':a180_0x58971a(0x1c8),'description':a180_0x58971a(0x1e7)},{'name':a180_0x58971a(0x1dc),'type':'boolean','description':a180_0x58971a(0x1e2)}],async 'execute'(_0x1c1fa5){const _0x2231cf=a180_0x58971a,_0xc5db84=await listSqlQueries(_0x1c1fa5[_0x2231cf(0x1ef)],{'sqlCode':_0x1c1fa5[_0x2231cf(0x1da)](_0x2231cf(0x1df))||undefined,'sqlName':_0x1c1fa5[_0x2231cf(0x1da)](_0x2231cf(0x1e1))||undefined,'currentPage':_0x1c1fa5['num']('page'),'pageSize':_0x1c1fa5[_0x2231cf(0x1d8)](_0x2231cf(0x1ec),0x32)}),_0x4f56a1=_0x1c1fa5['bool'](_0x2231cf(0x1dc)),_0x2c91fe=_0xc5db84[_0x2231cf(0x1db)]??[],_0x1e5e7e=_0xc5db84[_0x2231cf(0x1e9)]?.[_0x2231cf(0x1ee)]??_0x2c91fe['length'];let _0x43ff6e;return _0x4f56a1?_0x43ff6e=_0x2c91fe:_0x43ff6e=await Promise[_0x2231cf(0x1d5)](_0x2c91fe[_0x2231cf(0x1d9)](async _0x1c4fe8=>{const _0x444766=_0x2231cf;let _0x302348;try{_0x302348=_0x1c4fe8['dbId']?await getDbName(_0x1c1fa5[_0x444766(0x1ef)],_0x1c4fe8['dbId']):undefined;}catch{}return{'sqlCode':_0x1c4fe8[_0x444766(0x1d4)],'sqlName':_0x1c4fe8[_0x444766(0x1cf)],'description':_0x1c4fe8[_0x444766(0x1de)]??'','db':_0x302348?_0x302348+'\x20('+_0x1c4fe8['dbId']+')':_0x1c4fe8[_0x444766(0x1d6)]??''};})),{'ok':!![],'data':_0x43ff6e,'message':_0x2c91fe[_0x2231cf(0x1ce)]===0x0?_0x2231cf(0x1ed):'Found\x20'+_0x2c91fe[_0x2231cf(0x1ce)]+_0x2231cf(0x1e5)+_0x1e5e7e+').'};}};
1
+ const a188_0x43ccf7=a188_0x4b00;function a188_0x20b3(){const _0x1cdcf3=['bool','5370ihikQL','pagesize','Filter\x20by\x20SQL\x20name','description','appCode','num','all','string','4988232kAhsVn','list','totalCount','129018eVhrdP','tableData','37345vOGehs','91LezKEX','paging','dbId','map','268kvzKTp','page','32uMYKCN','read','sqlName','Page\x20size','88jYsohr','7204rtCwth','number','11AIaDHK','sqlCode','No\x20custom\x20SQL\x20queries\x20found.','Page\x20number','name','length','145782jhnRAZ','\x20SQL\x20queries\x20(total:\x20','Found\x20','str','sqlcode','970740cKcrqZ'];a188_0x20b3=function(){return _0x1cdcf3;};return a188_0x20b3();}(function(_0x2efbdf,_0x566eab){const _0x5b4431=a188_0x4b00,_0x48dea7=_0x2efbdf();while(!![]){try{const _0x3c63c1=-parseInt(_0x5b4431(0xf3))/0x1*(parseInt(_0x5b4431(0xee))/0x2)+-parseInt(_0x5b4431(0x102))/0x3*(parseInt(_0x5b4431(0xec))/0x4)+parseInt(_0x5b4431(0xe7))/0x5+parseInt(_0x5b4431(0xe5))/0x6*(parseInt(_0x5b4431(0xe8))/0x7)+parseInt(_0x5b4431(0xf2))/0x8*(-parseInt(_0x5b4431(0xfb))/0x9)+-parseInt(_0x5b4431(0x100))/0xa*(parseInt(_0x5b4431(0xf5))/0xb)+parseInt(_0x5b4431(0xe2))/0xc;if(_0x3c63c1===_0x566eab)break;else _0x48dea7['push'](_0x48dea7['shift']());}catch(_0x2c12b0){_0x48dea7['push'](_0x48dea7['shift']());}}}(a188_0x20b3,0x2eef8));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a188_0x4b00(_0x523e60,_0x53d5ec){_0x523e60=_0x523e60-0xe2;const _0x20b3f4=a188_0x20b3();let _0x4b00a8=_0x20b3f4[_0x523e60];return _0x4b00a8;}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':'sql','command':a188_0x43ccf7(0xe3),'description':'List\x20custom\x20SQL\x20queries','risk':a188_0x43ccf7(0xef),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a188_0x43ccf7(0xf9),'type':a188_0x43ccf7(0x109),'description':a188_0x43ccf7(0x104)},{'name':a188_0x43ccf7(0xed),'type':a188_0x43ccf7(0xf4),'description':a188_0x43ccf7(0xf8),'default':0x1},{'name':'pagesize','type':a188_0x43ccf7(0xf4),'description':a188_0x43ccf7(0xf1)},{'name':'verbose','type':'boolean','description':'Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content'}],async 'execute'(_0x33adea){const _0x502452=a188_0x43ccf7,_0x47ea49=await listSqlQueries(_0x33adea['appCode'],{'sqlCode':_0x33adea['str'](_0x502452(0xff))||undefined,'sqlName':_0x33adea[_0x502452(0xfe)]('name')||undefined,'currentPage':_0x33adea[_0x502452(0x107)](_0x502452(0xed)),'pageSize':_0x33adea[_0x502452(0x107)](_0x502452(0x103),0x32)}),_0x5b03fa=_0x33adea[_0x502452(0x101)]('verbose'),_0xc49023=_0x47ea49[_0x502452(0xe6)]??[],_0x22bd5c=_0x47ea49[_0x502452(0xe9)]?.[_0x502452(0xe4)]??_0xc49023['length'];let _0x526e80;return _0x5b03fa?_0x526e80=_0xc49023:_0x526e80=await Promise[_0x502452(0x108)](_0xc49023[_0x502452(0xeb)](async _0x3e7448=>{const _0x585a7c=_0x502452;let _0x2037bd;try{_0x2037bd=_0x3e7448[_0x585a7c(0xea)]?await getDbName(_0x33adea[_0x585a7c(0x106)],_0x3e7448['dbId']):undefined;}catch{}return{'sqlCode':_0x3e7448[_0x585a7c(0xf6)],'sqlName':_0x3e7448[_0x585a7c(0xf0)],'description':_0x3e7448[_0x585a7c(0x105)]??'','db':_0x2037bd?_0x2037bd+'\x20('+_0x3e7448['dbId']+')':_0x3e7448[_0x585a7c(0xea)]??''};})),{'ok':!![],'data':_0x526e80,'message':_0xc49023[_0x502452(0xfa)]===0x0?_0x502452(0xf7):_0x502452(0xfd)+_0xc49023[_0x502452(0xfa)]+_0x502452(0xfc)+_0x22bd5c+').'};}};