@lovrabet/rabetbase-cli 2.3.16-beta.6 → 2.4.1-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (436) 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.d.ts +1 -1
  229. package/lib/context.js +1 -1
  230. package/lib/core/alias-resolver.js +1 -1
  231. package/lib/core/api-client.d.ts +117 -0
  232. package/lib/core/api-client.js +1 -1
  233. package/lib/core/bff/config.js +1 -1
  234. package/lib/core/bff/file-system.js +1 -1
  235. package/lib/core/bff/hash.js +1 -1
  236. package/lib/core/bff/lock.js +1 -1
  237. package/lib/core/bff/utils.js +1 -1
  238. package/lib/core/db-resolver.js +1 -1
  239. package/lib/core/page/file-system.js +1 -1
  240. package/lib/core/page/hash.js +1 -1
  241. package/lib/core/page/lock.js +1 -1
  242. package/lib/core/sql-index-auditor.js +1 -1
  243. package/lib/core/sql-sync/config.js +1 -1
  244. package/lib/core/sql-sync/file-system.js +1 -1
  245. package/lib/core/sql-sync/hash.js +1 -1
  246. package/lib/core/sql-sync/lock.js +1 -1
  247. package/lib/core/sql-sync/utils.js +1 -1
  248. package/lib/core/sql-validator.js +1 -1
  249. package/lib/errors.js +1 -1
  250. package/lib/framework/build-all-flags.js +1 -1
  251. package/lib/framework/error-output.js +1 -1
  252. package/lib/framework/explicit-yes.js +1 -1
  253. package/lib/framework/flags.js +1 -1
  254. package/lib/framework/help.js +1 -1
  255. package/lib/framework/index.js +1 -1
  256. package/lib/framework/output.js +1 -1
  257. package/lib/framework/response.js +1 -1
  258. package/lib/framework/runner-alias.js +1 -1
  259. package/lib/framework/runner.js +1 -1
  260. package/lib/framework/schema-export.js +1 -1
  261. package/lib/framework/types.js +1 -1
  262. package/lib/generated/build-info.d.ts +4 -4
  263. package/lib/generated/build-info.js +1 -1
  264. package/lib/help.js +1 -1
  265. package/lib/postinstall.d.ts +3 -0
  266. package/lib/postinstall.js +1 -0
  267. package/lib/runtime/confirmation.js +1 -1
  268. package/lib/runtime/event.js +1 -1
  269. package/lib/runtime/index.js +1 -1
  270. package/lib/runtime/queue.js +1 -1
  271. package/lib/runtime/resolve.js +1 -1
  272. package/lib/skills/builtin-skill.d.ts +37 -0
  273. package/lib/skills/builtin-skill.js +1 -0
  274. package/lib/skills/main.js +1 -1
  275. package/lib/skills/npx-skills-add.d.ts +4 -2
  276. package/lib/skills/npx-skills-add.js +1 -1
  277. package/lib/skills/skill-presence.js +1 -1
  278. package/lib/telemetry/cli-command-trace.js +1 -1
  279. package/lib/telemetry/cli-help-trace.js +1 -1
  280. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  281. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  282. package/lib/telemetry/send-cli-trace-log.js +1 -1
  283. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  284. package/lib/utils/ai_config.js +1 -1
  285. package/lib/utils/apply-jq-filter.js +1 -1
  286. package/lib/utils/cdn-config.js +1 -1
  287. package/lib/utils/check-sdk-version.js +1 -1
  288. package/lib/utils/cli-version-check.js +1 -1
  289. package/lib/utils/cli-version-policy.js +1 -1
  290. package/lib/utils/config.js +1 -1
  291. package/lib/utils/copy-directory.js +1 -1
  292. package/lib/utils/entity-with-id.js +1 -1
  293. package/lib/utils/file-utils.js +1 -1
  294. package/lib/utils/guides-cdn.js +1 -1
  295. package/lib/utils/http-client.js +1 -1
  296. package/lib/utils/is-non-interactive.js +1 -1
  297. package/lib/utils/logger.js +1 -1
  298. package/lib/utils/params.js +1 -1
  299. package/lib/utils/platform.js +1 -1
  300. package/lib/utils/rules-cdn.js +1 -1
  301. package/lib/utils/sleep.js +1 -1
  302. package/lib/utils/template-replacer.js +1 -1
  303. package/lib/utils/update-notice.js +1 -1
  304. package/lib/utils/version.js +1 -1
  305. package/lib/utils/with-active-cookie.js +1 -1
  306. package/lib/utils/write-cli-side-channel.js +1 -1
  307. package/package.json +9 -3
  308. package/scripts/postinstall.mjs +24 -0
  309. package/skills/rabetbase/SKILL.md +493 -0
  310. package/skills/rabetbase/guides/backend-function.md +835 -0
  311. package/skills/rabetbase/guides/best-practices.md +137 -0
  312. package/skills/rabetbase/guides/bff-creation-workflow.md +148 -0
  313. package/skills/rabetbase/guides/conflict-detection.md +119 -0
  314. package/skills/rabetbase/guides/data-api-guidelines.md +414 -0
  315. package/skills/rabetbase/guides/database-connection-workflow.md +169 -0
  316. package/skills/rabetbase/guides/frontend-development.md +179 -0
  317. package/skills/rabetbase/guides/legacy-application-blueprint-workflow.md +495 -0
  318. package/skills/rabetbase/guides/menu-anomaly-manual-cleanup.md +137 -0
  319. package/skills/rabetbase/guides/page-development-workflow.md +187 -0
  320. package/skills/rabetbase/guides/react-custom-page-workflow.md +184 -0
  321. package/skills/rabetbase/guides/role-permit-workflow.md +127 -0
  322. package/skills/rabetbase/guides/sql-creation-workflow.md +173 -0
  323. package/skills/rabetbase/guides/sql-mybatis.md +126 -0
  324. package/skills/rabetbase/guides/troubleshooting.md +67 -0
  325. package/skills/rabetbase/guides/typescript-sdk.md +227 -0
  326. package/skills/rabetbase/knowledge/page-schema/LrSmartCreate.md +367 -0
  327. package/skills/rabetbase/knowledge/page-schema/LrSmartDetail.md +153 -0
  328. package/skills/rabetbase/knowledge/page-schema/LrSmartEcharts.md +291 -0
  329. package/skills/rabetbase/knowledge/page-schema/LrSmartFilter.md +478 -0
  330. package/skills/rabetbase/knowledge/page-schema/LrSmartJsx.md +119 -0
  331. package/skills/rabetbase/knowledge/page-schema/LrSmartStatistic.md +223 -0
  332. package/skills/rabetbase/knowledge/page-schema/LrSmartTable.md +632 -0
  333. package/skills/rabetbase/knowledge/page-schema/YtPage.md +172 -0
  334. package/skills/rabetbase/knowledge/page-schema/dataset-relations.md +126 -0
  335. package/skills/rabetbase/knowledge/page-schema/external-resources-usage.md +232 -0
  336. package/skills/rabetbase/knowledge/page-schema/field-components.md +312 -0
  337. package/skills/rabetbase/knowledge/page-schema/syntax-reference.md +278 -0
  338. package/skills/rabetbase/knowledge/react-page/components.md +225 -0
  339. package/skills/rabetbase/knowledge/react-page/generation-standards.md +385 -0
  340. package/skills/rabetbase/references/rabetbase-api-list.md +58 -0
  341. package/skills/rabetbase/references/rabetbase-api-pull.md +82 -0
  342. package/skills/rabetbase/references/rabetbase-app-config.md +95 -0
  343. package/skills/rabetbase/references/rabetbase-app-list.md +79 -0
  344. package/skills/rabetbase/references/rabetbase-app-members-list.md +64 -0
  345. package/skills/rabetbase/references/rabetbase-auth-login.md +53 -0
  346. package/skills/rabetbase/references/rabetbase-auth-logout.md +29 -0
  347. package/skills/rabetbase/references/rabetbase-bff-create.md +59 -0
  348. package/skills/rabetbase/references/rabetbase-bff-delete.md +42 -0
  349. package/skills/rabetbase/references/rabetbase-bff-detail.md +38 -0
  350. package/skills/rabetbase/references/rabetbase-bff-list.md +61 -0
  351. package/skills/rabetbase/references/rabetbase-bff-pull.md +42 -0
  352. package/skills/rabetbase/references/rabetbase-bff-push.md +65 -0
  353. package/skills/rabetbase/references/rabetbase-bff-save.md +63 -0
  354. package/skills/rabetbase/references/rabetbase-bff-status.md +37 -0
  355. package/skills/rabetbase/references/rabetbase-cli-skill-install.md +42 -0
  356. package/skills/rabetbase/references/rabetbase-codegen-sdk.md +35 -0
  357. package/skills/rabetbase/references/rabetbase-codegen-sql.md +33 -0
  358. package/skills/rabetbase/references/rabetbase-config.md +296 -0
  359. package/skills/rabetbase/references/rabetbase-dataset-business-group-update.md +84 -0
  360. package/skills/rabetbase/references/rabetbase-dataset-delete.md +54 -0
  361. package/skills/rabetbase/references/rabetbase-dataset-detail.md +106 -0
  362. package/skills/rabetbase/references/rabetbase-dataset-extend-update.md +70 -0
  363. package/skills/rabetbase/references/rabetbase-dataset-field-update.md +117 -0
  364. package/skills/rabetbase/references/rabetbase-dataset-generate.md +206 -0
  365. package/skills/rabetbase/references/rabetbase-dataset-list.md +42 -0
  366. package/skills/rabetbase/references/rabetbase-dataset-operations.md +34 -0
  367. package/skills/rabetbase/references/rabetbase-dataset-relation-audit.md +63 -0
  368. package/skills/rabetbase/references/rabetbase-dataset-relation-mutations.md +141 -0
  369. package/skills/rabetbase/references/rabetbase-dataset-relations.md +71 -0
  370. package/skills/rabetbase/references/rabetbase-dataset-rename.md +107 -0
  371. package/skills/rabetbase/references/rabetbase-dataset-restore.md +54 -0
  372. package/skills/rabetbase/references/rabetbase-db-analyze.md +135 -0
  373. package/skills/rabetbase/references/rabetbase-db-create.md +54 -0
  374. package/skills/rabetbase/references/rabetbase-db-delete.md +26 -0
  375. package/skills/rabetbase/references/rabetbase-db-detail.md +27 -0
  376. package/skills/rabetbase/references/rabetbase-db-diff.md +57 -0
  377. package/skills/rabetbase/references/rabetbase-db-list.md +37 -0
  378. package/skills/rabetbase/references/rabetbase-db-tables.md +25 -0
  379. package/skills/rabetbase/references/rabetbase-db-test.md +29 -0
  380. package/skills/rabetbase/references/rabetbase-db-update.md +29 -0
  381. package/skills/rabetbase/references/rabetbase-doctor.md +62 -0
  382. package/skills/rabetbase/references/rabetbase-file.md +35 -0
  383. package/skills/rabetbase/references/rabetbase-init.md +70 -0
  384. package/skills/rabetbase/references/rabetbase-issue-report.md +132 -0
  385. package/skills/rabetbase/references/rabetbase-kb.md +62 -0
  386. package/skills/rabetbase/references/rabetbase-menu-asset-update.md +135 -0
  387. package/skills/rabetbase/references/rabetbase-menu-delete.md +54 -0
  388. package/skills/rabetbase/references/rabetbase-menu-external-link-create.md +63 -0
  389. package/skills/rabetbase/references/rabetbase-menu-external-link-update.md +74 -0
  390. package/skills/rabetbase/references/rabetbase-menu-group-create.md +33 -0
  391. package/skills/rabetbase/references/rabetbase-menu-group-update.md +38 -0
  392. package/skills/rabetbase/references/rabetbase-menu-list.md +144 -0
  393. package/skills/rabetbase/references/rabetbase-menu-move.md +54 -0
  394. package/skills/rabetbase/references/rabetbase-menu-regroup-start.md +45 -0
  395. package/skills/rabetbase/references/rabetbase-menu-rename.md +48 -0
  396. package/skills/rabetbase/references/rabetbase-menu-sync.md +60 -0
  397. package/skills/rabetbase/references/rabetbase-notification-config-list.md +80 -0
  398. package/skills/rabetbase/references/rabetbase-ocr.md +86 -0
  399. package/skills/rabetbase/references/rabetbase-page-generate-start.md +32 -0
  400. package/skills/rabetbase/references/rabetbase-page-generate-status.md +32 -0
  401. package/skills/rabetbase/references/rabetbase-page-pull.md +47 -0
  402. package/skills/rabetbase/references/rabetbase-page-push.md +45 -0
  403. package/skills/rabetbase/references/rabetbase-page-react-create.md +29 -0
  404. package/skills/rabetbase/references/rabetbase-page-react-detail.md +26 -0
  405. package/skills/rabetbase/references/rabetbase-page-react-list.md +23 -0
  406. package/skills/rabetbase/references/rabetbase-page-react-publish.md +23 -0
  407. package/skills/rabetbase/references/rabetbase-page-react-update.md +24 -0
  408. package/skills/rabetbase/references/rabetbase-page-relation-binding.md +72 -0
  409. package/skills/rabetbase/references/rabetbase-page-restore.md +45 -0
  410. package/skills/rabetbase/references/rabetbase-page-sync.md +36 -0
  411. package/skills/rabetbase/references/rabetbase-permit-page-set.md +69 -0
  412. package/skills/rabetbase/references/rabetbase-permit-role-apis-set.md +53 -0
  413. package/skills/rabetbase/references/rabetbase-permit-role-menus-set.md +57 -0
  414. package/skills/rabetbase/references/rabetbase-project-create.md +46 -0
  415. package/skills/rabetbase/references/rabetbase-project-upgrade.md +57 -0
  416. package/skills/rabetbase/references/rabetbase-role-list.md +68 -0
  417. package/skills/rabetbase/references/rabetbase-role-user-add.md +54 -0
  418. package/skills/rabetbase/references/rabetbase-role-user-resolve.md +27 -0
  419. package/skills/rabetbase/references/rabetbase-run.md +53 -0
  420. package/skills/rabetbase/references/rabetbase-schema.md +22 -0
  421. package/skills/rabetbase/references/rabetbase-sql-create.md +41 -0
  422. package/skills/rabetbase/references/rabetbase-sql-delete.md +37 -0
  423. package/skills/rabetbase/references/rabetbase-sql-detail.md +32 -0
  424. package/skills/rabetbase/references/rabetbase-sql-exec.md +34 -0
  425. package/skills/rabetbase/references/rabetbase-sql-list.md +54 -0
  426. package/skills/rabetbase/references/rabetbase-sql-pull.md +54 -0
  427. package/skills/rabetbase/references/rabetbase-sql-push.md +46 -0
  428. package/skills/rabetbase/references/rabetbase-sql-status.md +39 -0
  429. package/skills/rabetbase/references/rabetbase-sql-validate.md +73 -0
  430. package/skills/rabetbase/references/rabetbase-standard-page-status.md +31 -0
  431. package/skills/rabetbase/references/rabetbase-task-status.md +40 -0
  432. package/skills/rabetbase/references/rabetbase-tenant-members-list.md +69 -0
  433. package/skills/rabetbase/references/rabetbase-update.md +56 -0
  434. package/skills/rabetbase/references/rabetbase-user-account.md +45 -0
  435. package/skills/rabetbase/references/rabetbase-workspace.md +60 -0
  436. package/skills/rabetbase.manifest.json +137 -0
@@ -1 +1 @@
1
- const a163_0x7bdea0=a163_0x40e0;(function(_0xb176b9,_0x5e686e){const _0x4ff845=a163_0x40e0,_0x2370e6=_0xb176b9();while(!![]){try{const _0x21e9af=-parseInt(_0x4ff845(0x106))/0x1+-parseInt(_0x4ff845(0x117))/0x2*(parseInt(_0x4ff845(0x107))/0x3)+parseInt(_0x4ff845(0x116))/0x4*(parseInt(_0x4ff845(0xff))/0x5)+-parseInt(_0x4ff845(0x108))/0x6+parseInt(_0x4ff845(0x109))/0x7*(parseInt(_0x4ff845(0x105))/0x8)+parseInt(_0x4ff845(0x111))/0x9+parseInt(_0x4ff845(0x10c))/0xa;if(_0x21e9af===_0x5e686e)break;else _0x2370e6['push'](_0x2370e6['shift']());}catch(_0x5285bd){_0x2370e6['push'](_0x2370e6['shift']());}}}(a163_0xf64f,0xa10c3));import{createAppRole}from'../../core/api-client.js';function a163_0x40e0(_0x2e859d,_0x667be2){_0x2e859d=_0x2e859d-0xfe;const _0xf64fec=a163_0xf64f();let _0x40e0bc=_0xf64fec[_0x2e859d];return _0x40e0bc;}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{NAME_FLAG,REMARK_FLAG,projectRole}from'../../commands/role/shared.js';const CREATE_PATH=a163_0x7bdea0(0x101);function a163_0xf64f(){const _0x1d9503=['role','Created\x20role\x20','8465Nrytob','flagMissing','/smartapi/permit/role/create','create','str','remark','21416wgHQDc','452419wAoRaN','435PQBDjR','6474930gVBhqs','1127YpIuYa','validation','appCode','14214070mkcNXP','length','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','\x20(id=','trim','554931fdzbrK','write','name','Pass\x20--name\x20<roleName>.','CUSTOM','1796GMftjG','6662DJXIZC','POST'];a163_0xf64f=function(){return _0x1d9503;};return a163_0xf64f();}function readName(_0x47da2e){const _0x9078d0=a163_0x7bdea0,_0x54077a=_0x47da2e[_0x9078d0(0x103)](_0x9078d0(0x113))['trim']();if(!_0x54077a)throw CliErrors[_0x9078d0(0x100)](_0x9078d0(0x113),_0x9078d0(0x114));if(_0x54077a[_0x9078d0(0x10d)]>0x40)throw CliErrors[_0x9078d0(0x10a)](_0x9078d0(0x10e));return _0x54077a;}export const roleCreate={'service':a163_0x7bdea0(0x119),'command':'create','description':'Create\x20a\x20CUSTOM\x20user\x20group\x20(role)','risk':a163_0x7bdea0(0x112),'flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1c1f7a){readName(_0x1c1f7a);},async 'dryRun'(_0x17629d){const _0x4ad3b8=a163_0x7bdea0,_0x57bfdb=readName(_0x17629d),_0x190258=_0x17629d[_0x4ad3b8(0x103)]('remark')[_0x4ad3b8(0x110)]()||undefined;return asDryRunResult({'operation':'create','selector':{'appCode':_0x17629d[_0x4ad3b8(0x10b)],'roleName':_0x57bfdb},'before':null,'after':{'roleName':_0x57bfdb,'roleType':_0x4ad3b8(0x115),'remark':_0x190258},'dryRun':!![],'backend':{'method':_0x4ad3b8(0x118),'path':CREATE_PATH},'warnings':[]},{'method':_0x4ad3b8(0x118),'url':CREATE_PATH});},async 'execute'(_0x3f55b5){const _0x5a1933=a163_0x7bdea0,_0x3c86df=readName(_0x3f55b5),_0x5b0c6a=_0x3f55b5['str'](_0x5a1933(0x104))['trim']()||undefined,_0x196cb8=await createAppRole({'appCode':_0x3f55b5['appCode'],'roleName':_0x3c86df,..._0x5b0c6a?{'remark':_0x5b0c6a}:{}});return{'ok':!![],'data':{'operation':_0x5a1933(0x102),'selector':{'appCode':_0x3f55b5['appCode'],'roleId':_0x196cb8['id'],'roleName':_0x3c86df},'before':null,'after':projectRole(_0x196cb8),'dryRun':![],'backend':{'method':_0x5a1933(0x118),'path':CREATE_PATH},'warnings':[]},'message':_0x5a1933(0xfe)+_0x196cb8['roleName']+_0x5a1933(0x10f)+_0x196cb8['id']+')'};}};
1
+ const a171_0x39f46e=a171_0x3c28;(function(_0x542474,_0x3a1c50){const _0x325a60=a171_0x3c28,_0x359a92=_0x542474();while(!![]){try{const _0x5871b8=-parseInt(_0x325a60(0x149))/0x1+-parseInt(_0x325a60(0x154))/0x2+-parseInt(_0x325a60(0x147))/0x3+-parseInt(_0x325a60(0x14a))/0x4+parseInt(_0x325a60(0x157))/0x5+parseInt(_0x325a60(0x14c))/0x6+-parseInt(_0x325a60(0x153))/0x7*(-parseInt(_0x325a60(0x14f))/0x8);if(_0x5871b8===_0x3a1c50)break;else _0x359a92['push'](_0x359a92['shift']());}catch(_0x31082f){_0x359a92['push'](_0x359a92['shift']());}}}(a171_0x2e5f,0x542b4));import{createAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a171_0x3c28(_0x37177b,_0x3678e7){_0x37177b=_0x37177b-0x147;const _0x2e5f0f=a171_0x2e5f();let _0x3c2808=_0x2e5f0f[_0x37177b];return _0x3c2808;}import{asDryRunResult}from'../../commands/common/dry-run.js';import{NAME_FLAG,REMARK_FLAG,projectRole}from'../../commands/role/shared.js';function a171_0x2e5f(){const _0x121370=['Create\x20a\x20CUSTOM\x20user\x20group\x20(role)','3372780grIHPy','create','remark','128laGnqo','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','POST','appCode','728336VXpBct','1136966YkVxaG','length','trim','761750ipNTCg','/smartapi/permit/role/create','role','name','Pass\x20--name\x20<roleName>.','1513248jGPAha','str','532698knoXhf','1715580mQqnHd'];a171_0x2e5f=function(){return _0x121370;};return a171_0x2e5f();}const CREATE_PATH=a171_0x39f46e(0x158);function readName(_0x2e2946){const _0x3539c4=a171_0x39f46e,_0x78e46d=_0x2e2946[_0x3539c4(0x148)](_0x3539c4(0x15a))['trim']();if(!_0x78e46d)throw CliErrors['flagMissing'](_0x3539c4(0x15a),_0x3539c4(0x15b));if(_0x78e46d[_0x3539c4(0x155)]>0x40)throw CliErrors['validation'](_0x3539c4(0x150));return _0x78e46d;}export const roleCreate={'service':a171_0x39f46e(0x159),'command':a171_0x39f46e(0x14d),'description':a171_0x39f46e(0x14b),'risk':'write','flags':[NAME_FLAG,REMARK_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5e849e){readName(_0x5e849e);},async 'dryRun'(_0x50e612){const _0x3631f0=a171_0x39f46e,_0x31a58b=readName(_0x50e612),_0x203390=_0x50e612[_0x3631f0(0x148)](_0x3631f0(0x14e))[_0x3631f0(0x156)]()||undefined;return asDryRunResult({'operation':_0x3631f0(0x14d),'selector':{'appCode':_0x50e612[_0x3631f0(0x152)],'roleName':_0x31a58b},'before':null,'after':{'roleName':_0x31a58b,'roleType':'CUSTOM','remark':_0x203390},'dryRun':!![],'backend':{'method':'POST','path':CREATE_PATH},'warnings':[]},{'method':'POST','url':CREATE_PATH});},async 'execute'(_0x3df2f5){const _0x43d8a4=a171_0x39f46e,_0x14dd58=readName(_0x3df2f5),_0x2b2d7d=_0x3df2f5[_0x43d8a4(0x148)](_0x43d8a4(0x14e))[_0x43d8a4(0x156)]()||undefined,_0x2a3d6d=await createAppRole({'appCode':_0x3df2f5[_0x43d8a4(0x152)],'roleName':_0x14dd58,..._0x2b2d7d?{'remark':_0x2b2d7d}:{}});return{'ok':!![],'data':{'operation':_0x43d8a4(0x14d),'selector':{'appCode':_0x3df2f5[_0x43d8a4(0x152)],'roleId':_0x2a3d6d['id'],'roleName':_0x14dd58},'before':null,'after':projectRole(_0x2a3d6d),'dryRun':![],'backend':{'method':_0x43d8a4(0x151),'path':CREATE_PATH},'warnings':[]},'message':'Created\x20role\x20'+_0x2a3d6d['roleName']+'\x20(id='+_0x2a3d6d['id']+')'};}};
@@ -1 +1 @@
1
- const a164_0x393b92=a164_0x2577;function a164_0x2577(_0x453ff9,_0x5c4db0){_0x453ff9=_0x453ff9-0x1e2;const _0x214547=a164_0x2145();let _0x25779b=_0x214547[_0x453ff9];return _0x25779b;}(function(_0x30ff5a,_0x48c83f){const _0x248476=a164_0x2577,_0x1b3306=_0x30ff5a();while(!![]){try{const _0x3f695e=parseInt(_0x248476(0x1e9))/0x1*(-parseInt(_0x248476(0x1ea))/0x2)+-parseInt(_0x248476(0x1f2))/0x3*(parseInt(_0x248476(0x1f7))/0x4)+parseInt(_0x248476(0x1e4))/0x5+-parseInt(_0x248476(0x1f6))/0x6+-parseInt(_0x248476(0x1ed))/0x7+parseInt(_0x248476(0x1e2))/0x8*(-parseInt(_0x248476(0x1e5))/0x9)+parseInt(_0x248476(0x1ef))/0xa*(parseInt(_0x248476(0x1ec))/0xb);if(_0x3f695e===_0x48c83f)break;else _0x1b3306['push'](_0x1b3306['shift']());}catch(_0xf558f4){_0x1b3306['push'](_0x1b3306['shift']());}}}(a164_0x2145,0xb8f8a));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_0x393b92(0x1ee);export const roleDelete={'service':a164_0x393b92(0x1f1),'command':a164_0x393b92(0x1e3),'description':a164_0x393b92(0x1e6),'risk':a164_0x393b92(0x1f4),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x3ac3d1){const _0x1366ee=a164_0x393b92,_0x530fc8=_0x3ac3d1[_0x1366ee(0x1f3)]('id'),_0x3f7ebc=await getRoleById(_0x3ac3d1['appCode'],_0x530fc8);return assertCustomRole(_0x3f7ebc,_0x1366ee(0x1e3)),asDryRunResult({'operation':_0x1366ee(0x1e3),'selector':{'appCode':_0x3ac3d1['appCode'],'roleId':_0x530fc8,'roleName':_0x3f7ebc['roleName']},'before':projectRole(_0x3f7ebc),'after':null,'dryRun':!![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':_0x3f7ebc['userCount']>0x0?[_0x1366ee(0x1f8)+_0x3f7ebc[_0x1366ee(0x1f0)]+_0x1366ee(0x1e7)]:[]},{'method':_0x1366ee(0x1eb),'url':DELETE_PATH});},async 'execute'(_0x3e3803){const _0x3218cf=a164_0x393b92,_0x45c2c7=_0x3e3803['num']('id'),_0x3904c0=await getRoleById(_0x3e3803[_0x3218cf(0x1e8)],_0x45c2c7);return assertCustomRole(_0x3904c0,'delete'),await deleteAppRole(_0x45c2c7),{'ok':!![],'data':{'operation':_0x3218cf(0x1e3),'selector':{'appCode':_0x3e3803[_0x3218cf(0x1e8)],'roleId':_0x45c2c7,'roleName':_0x3904c0[_0x3218cf(0x1f5)]},'before':projectRole(_0x3904c0),'after':null,'dryRun':![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':[]},'message':'Deleted\x20role\x20'+_0x3904c0['roleName']+'\x20(id='+_0x45c2c7+')'};}};function a164_0x2145(){const _0x335b58=['Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','\x20member(s);\x20they\x20will\x20lose\x20this\x20group.','appCode','4358UkzeKo','214AktZVq','POST','11DGBsqs','953974ljOAJG','/smartapi/permit/role/delete','11523450cOprfP','userCount','role','99GcrgOL','num','high-risk-write','roleName','1177464ihiZEm','39992WpcRzg','Role\x20still\x20has\x20','4474344wdjSaX','delete','6466780kFyBaw','9XgCmJG'];a164_0x2145=function(){return _0x335b58;};return a164_0x2145();}
1
+ const a172_0x51d2c8=a172_0x407d;(function(_0x48cad2,_0x495cf7){const _0x2deb0e=a172_0x407d,_0xb9c13f=_0x48cad2();while(!![]){try{const _0x3db397=-parseInt(_0x2deb0e(0x15b))/0x1+parseInt(_0x2deb0e(0x152))/0x2+parseInt(_0x2deb0e(0x153))/0x3+-parseInt(_0x2deb0e(0x158))/0x4*(-parseInt(_0x2deb0e(0x15e))/0x5)+-parseInt(_0x2deb0e(0x15d))/0x6*(-parseInt(_0x2deb0e(0x155))/0x7)+parseInt(_0x2deb0e(0x162))/0x8+-parseInt(_0x2deb0e(0x15a))/0x9;if(_0x3db397===_0x495cf7)break;else _0xb9c13f['push'](_0xb9c13f['shift']());}catch(_0x7ca0cd){_0xb9c13f['push'](_0xb9c13f['shift']());}}}(a172_0x4d13,0x5d227));function a172_0x407d(_0x56c16f,_0x3d2db2){_0x56c16f=_0x56c16f-0x152;const _0x4d1316=a172_0x4d13();let _0x407d77=_0x4d1316[_0x56c16f];return _0x407d77;}import{deleteAppRole}from'../../core/api-client.js';function a172_0x4d13(){const _0x1e4cbb=['329799hQvyew','high-risk-write','229974tCjEON','135165vpJlsE','POST','userCount','delete','1078048NMUxGZ','appCode','561640zPcdaO','615852GHWHvK','\x20(id=','49dJAVcG','num','role','52JfikGL','/smartapi/permit/role/delete','4763826HIoPmQ'];a172_0x4d13=function(){return _0x1e4cbb;};return a172_0x4d13();}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=a172_0x51d2c8(0x159);export const roleDelete={'service':a172_0x51d2c8(0x157),'command':a172_0x51d2c8(0x161),'description':'Delete\x20a\x20CUSTOM\x20role\x20(DEV/ADMIN\x20rejected);\x20requires\x20--yes','risk':a172_0x51d2c8(0x15c),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x442399){const _0x3aeb74=a172_0x51d2c8,_0xcc0a32=_0x442399[_0x3aeb74(0x156)]('id'),_0x5ebaa3=await getRoleById(_0x442399[_0x3aeb74(0x163)],_0xcc0a32);return assertCustomRole(_0x5ebaa3,_0x3aeb74(0x161)),asDryRunResult({'operation':_0x3aeb74(0x161),'selector':{'appCode':_0x442399[_0x3aeb74(0x163)],'roleId':_0xcc0a32,'roleName':_0x5ebaa3['roleName']},'before':projectRole(_0x5ebaa3),'after':null,'dryRun':!![],'backend':{'method':_0x3aeb74(0x15f),'path':DELETE_PATH},'warnings':_0x5ebaa3['userCount']>0x0?['Role\x20still\x20has\x20'+_0x5ebaa3[_0x3aeb74(0x160)]+'\x20member(s);\x20they\x20will\x20lose\x20this\x20group.']:[]},{'method':_0x3aeb74(0x15f),'url':DELETE_PATH});},async 'execute'(_0x5efd5f){const _0x1f8e9c=a172_0x51d2c8,_0x28034f=_0x5efd5f['num']('id'),_0x41572c=await getRoleById(_0x5efd5f[_0x1f8e9c(0x163)],_0x28034f);return assertCustomRole(_0x41572c,_0x1f8e9c(0x161)),await deleteAppRole(_0x28034f),{'ok':!![],'data':{'operation':_0x1f8e9c(0x161),'selector':{'appCode':_0x5efd5f[_0x1f8e9c(0x163)],'roleId':_0x28034f,'roleName':_0x41572c['roleName']},'before':projectRole(_0x41572c),'after':null,'dryRun':![],'backend':{'method':'POST','path':DELETE_PATH},'warnings':[]},'message':'Deleted\x20role\x20'+_0x41572c['roleName']+_0x1f8e9c(0x154)+_0x28034f+')'};}};
@@ -1 +1 @@
1
- const a165_0x14af5f=a165_0x4bc4;function a165_0xeb48(){const _0x51d5ab=['1174868NPLmsF','num','appCode','detail','roleType','roleName','1576595jqeeYn','12164080fqKKKP','role','3631398HbtkQJ','15900YZgkbT','416971VYIbwa','2329880pDeHuc','Role\x20','62sGhwla','Show\x20a\x20single\x20role\x27s\x20detail'];a165_0xeb48=function(){return _0x51d5ab;};return a165_0xeb48();}(function(_0x3fae6b,_0x31301a){const _0x632cf5=a165_0x4bc4,_0xcf749e=_0x3fae6b();while(!![]){try{const _0x33ca64=-parseInt(_0x632cf5(0x1bb))/0x1+-parseInt(_0x632cf5(0x1be))/0x2*(-parseInt(_0x632cf5(0x1ba))/0x3)+-parseInt(_0x632cf5(0x1c0))/0x4+parseInt(_0x632cf5(0x1c6))/0x5+-parseInt(_0x632cf5(0x1c9))/0x6+-parseInt(_0x632cf5(0x1bc))/0x7+parseInt(_0x632cf5(0x1c7))/0x8;if(_0x33ca64===_0x31301a)break;else _0xcf749e['push'](_0xcf749e['shift']());}catch(_0x50afce){_0xcf749e['push'](_0xcf749e['shift']());}}}(a165_0xeb48,0x55c88));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a165_0x4bc4(_0x4907bd,_0x323458){_0x4907bd=_0x4907bd-0x1ba;const _0xeb48a2=a165_0xeb48();let _0x4bc451=_0xeb48a2[_0x4907bd];return _0x4bc451;}export const roleDetail={'service':a165_0x14af5f(0x1c8),'command':a165_0x14af5f(0x1c3),'description':a165_0x14af5f(0x1bf),'risk':'read','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x2c677c){const _0x3b0a75=a165_0x14af5f,_0x25966f=_0x2c677c[_0x3b0a75(0x1c1)]('id'),_0x3eb01b=await getRoleById(_0x2c677c[_0x3b0a75(0x1c2)],_0x25966f);return{'ok':!![],'data':{'role':projectRole(_0x3eb01b)},'message':_0x3b0a75(0x1bd)+_0x3eb01b[_0x3b0a75(0x1c5)]+'\x20('+_0x3eb01b[_0x3b0a75(0x1c4)]+')'};}};
1
+ (function(_0x4dc969,_0x3b7ea8){const _0x3b0421=a173_0x3aad,_0x4f6dab=_0x4dc969();while(!![]){try{const _0x841481=-parseInt(_0x3b0421(0x1f3))/0x1*(parseInt(_0x3b0421(0x1ee))/0x2)+parseInt(_0x3b0421(0x1ef))/0x3+-parseInt(_0x3b0421(0x1eb))/0x4*(-parseInt(_0x3b0421(0x1f0))/0x5)+parseInt(_0x3b0421(0x1ec))/0x6+parseInt(_0x3b0421(0x1f1))/0x7+-parseInt(_0x3b0421(0x1f2))/0x8*(parseInt(_0x3b0421(0x1ed))/0x9)+parseInt(_0x3b0421(0x1ea))/0xa*(parseInt(_0x3b0421(0x1e7))/0xb);if(_0x841481===_0x3b7ea8)break;else _0x4f6dab['push'](_0x4f6dab['shift']());}catch(_0x50f5d3){_0x4f6dab['push'](_0x4f6dab['shift']());}}}(a173_0x1076,0x499e6));function a173_0x1076(){const _0x25f7ca=['8FHCfFn','224309uUkjfV','roleType','3377JDmXlS','num','roleName','8860sZaDbC','1540bBitIK','1417950gDCHaB','5140305WCwCnm','2SvxwvK','15174mLDFuV','6805EBPzws','417382qnynRR'];a173_0x1076=function(){return _0x25f7ca;};return a173_0x1076();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a173_0x3aad(_0x57a3f7,_0x2aee01){_0x57a3f7=_0x57a3f7-0x1e6;const _0x107625=a173_0x1076();let _0x3aad14=_0x107625[_0x57a3f7];return _0x3aad14;}export const roleDetail={'service':'role','command':'detail','description':'Show\x20a\x20single\x20role\x27s\x20detail','risk':'read','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x3bf886){const _0x36429b=a173_0x3aad,_0x389052=_0x3bf886[_0x36429b(0x1e8)]('id'),_0x3062db=await getRoleById(_0x3bf886['appCode'],_0x389052);return{'ok':!![],'data':{'role':projectRole(_0x3062db)},'message':'Role\x20'+_0x3062db[_0x36429b(0x1e9)]+'\x20('+_0x3062db[_0x36429b(0x1e6)]+')'};}};
@@ -1 +1 @@
1
- (function(_0x1fe42b,_0x1ff2e1){const _0x49f303=a166_0x28cf,_0x4f4783=_0x1fe42b();while(!![]){try{const _0x470f78=-parseInt(_0x49f303(0x8e))/0x1+-parseInt(_0x49f303(0x89))/0x2*(-parseInt(_0x49f303(0x8a))/0x3)+parseInt(_0x49f303(0x90))/0x4+parseInt(_0x49f303(0x88))/0x5*(-parseInt(_0x49f303(0x8c))/0x6)+parseInt(_0x49f303(0x8b))/0x7+-parseInt(_0x49f303(0x8f))/0x8*(-parseInt(_0x49f303(0x8d))/0x9)+-parseInt(_0x49f303(0x91))/0xa*(parseInt(_0x49f303(0x92))/0xb);if(_0x470f78===_0x1ff2e1)break;else _0x4f4783['push'](_0x4f4783['shift']());}catch(_0xed772d){_0x4f4783['push'](_0x4f4783['shift']());}}}(a166_0x26ef,0xeee1e));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';function a166_0x26ef(){const _0x2dda18=['48MAIJJX','128989oEtdZk','5245518HvZfHd','9TDZQsK','1723360QBamjY','13567672pcIWtR','7809640hLoups','3198830HotUJU','33XipjEK','5mnJXBq','108616XuKVGv'];a166_0x26ef=function(){return _0x2dda18;};return a166_0x26ef();}import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';function a166_0x28cf(_0x59abd8,_0x23ce2d){_0x59abd8=_0x59abd8-0x88;const _0x26ef18=a166_0x26ef();let _0x28cf87=_0x26ef18[_0x59abd8];return _0x28cf87;}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(_0x2e839f,_0x222796){const _0x4f8b61=a174_0x1828,_0x190492=_0x2e839f();while(!![]){try{const _0x217b6e=-parseInt(_0x4f8b61(0x145))/0x1*(parseInt(_0x4f8b61(0x13d))/0x2)+-parseInt(_0x4f8b61(0x143))/0x3+parseInt(_0x4f8b61(0x141))/0x4*(-parseInt(_0x4f8b61(0x13e))/0x5)+parseInt(_0x4f8b61(0x146))/0x6*(parseInt(_0x4f8b61(0x13f))/0x7)+parseInt(_0x4f8b61(0x140))/0x8+-parseInt(_0x4f8b61(0x142))/0x9+parseInt(_0x4f8b61(0x144))/0xa;if(_0x217b6e===_0x222796)break;else _0x190492['push'](_0x190492['shift']());}catch(_0x2632d8){_0x190492['push'](_0x190492['shift']());}}}(a174_0x4f69,0x31dc6));import{roleList}from'../../commands/role/list.js';function a174_0x1828(_0x469001,_0x1ca074){_0x469001=_0x469001-0x13d;const _0x4f69b0=a174_0x4f69();let _0x182829=_0x4f69b0[_0x469001];return _0x182829;}import{roleDetail}from'../../commands/role/detail.js';import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';function a174_0x4f69(){const _0x5255db=['3090AKBMfJ','12EtoVYU','35NGUtZw','2429bpuSGy','605512RtvgDq','68468hMmcIB','1742580nlyRBX','1021467lAQFoN','10031420RPUTGy','66563TSigBE'];a174_0x4f69=function(){return _0x5255db;};return a174_0x4f69();}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_0x407a8f=a167_0x1e57;(function(_0x57a6ae,_0x39a649){const _0x15fd89=a167_0x1e57,_0x41f2b1=_0x57a6ae();while(!![]){try{const _0x4b668b=-parseInt(_0x15fd89(0xf7))/0x1*(-parseInt(_0x15fd89(0x106))/0x2)+-parseInt(_0x15fd89(0x118))/0x3*(-parseInt(_0x15fd89(0x10e))/0x4)+-parseInt(_0x15fd89(0x10b))/0x5*(-parseInt(_0x15fd89(0xfe))/0x6)+-parseInt(_0x15fd89(0x101))/0x7*(parseInt(_0x15fd89(0x10c))/0x8)+-parseInt(_0x15fd89(0x11c))/0x9*(-parseInt(_0x15fd89(0x105))/0xa)+parseInt(_0x15fd89(0x107))/0xb*(-parseInt(_0x15fd89(0xfa))/0xc)+-parseInt(_0x15fd89(0x100))/0xd;if(_0x4b668b===_0x39a649)break;else _0x41f2b1['push'](_0x41f2b1['shift']());}catch(_0x10ef2d){_0x41f2b1['push'](_0x41f2b1['shift']());}}}(a167_0x258f,0xf170b));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a167_0x1e57(_0x3fe0d0,_0x3c5af9){_0x3fe0d0=_0x3fe0d0-0xf5;const _0x258fd5=a167_0x258f();let _0x1e571e=_0x258fd5[_0x3fe0d0];return _0x1e571e;}function a167_0x258f(){const _0x5ea75c=['12UTaMUS','Page\x20index\x20(1-based)','16684096MHgAtc','672SblSCI','map','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','2309420ELsPsu','4qlPOYX','6588362yoTtXX','length','USER','join','1876115DWfMyM','80072vDHLtq','number','5036OORtna','num','string','read','trim','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','validation','page','Found\x20','ADMIN','21bBAcqz','\x20role(s)','pagesize','str','54JfWGdP','type','CUSTOM','appCode','includes','843613oYhmTw','toUpperCase','DEV','12BwhMJJ','Use\x20one\x20of:\x20','Invalid\x20--type\x20\x22','filter'];a167_0x258f=function(){return _0x5ea75c;};return a167_0x258f();}import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a167_0x407a8f(0x117),a167_0x407a8f(0xf9),a167_0x407a8f(0x109),a167_0x407a8f(0x11e)];export const roleList={'service':'role','command':'list','description':a167_0x407a8f(0x103),'risk':a167_0x407a8f(0x111),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a167_0x407a8f(0x11d),'type':a167_0x407a8f(0x110),'required':![],'description':'Filter\x20by\x20role\x20type','enum':ROLE_TYPES},{'name':a167_0x407a8f(0x115),'type':a167_0x407a8f(0x10d),'description':a167_0x407a8f(0xff),'default':0x1},{'name':'pagesize','type':a167_0x407a8f(0x10d),'description':'Page\x20size\x20(1-100)','default':0x64}],async 'validate'(_0x354c61){const _0x458800=a167_0x407a8f,_0x5ba450=_0x354c61['str'](_0x458800(0x11d))[_0x458800(0x112)]();if(_0x5ba450&&!ROLE_TYPES[_0x458800(0xf6)](_0x5ba450[_0x458800(0xf8)]()))throw CliErrors[_0x458800(0x114)](_0x458800(0xfc)+_0x5ba450+'\x22.',_0x458800(0xfb)+ROLE_TYPES[_0x458800(0x10a)](',\x20')+'.');const _0x1c0e78=_0x354c61[_0x458800(0x10f)]('page',0x1),_0xd922c0=_0x354c61['num'](_0x458800(0x11a),0x64);if(_0x1c0e78<0x1)throw CliErrors['validation'](_0x458800(0x113));if(_0xd922c0<0x1||_0xd922c0>0x64)throw CliErrors[_0x458800(0x114)](_0x458800(0x104));},async 'execute'(_0x8bd5e6){const _0x49cc38=a167_0x407a8f,_0x50a85f=_0x8bd5e6[_0x49cc38(0x10f)](_0x49cc38(0x115),0x1)||0x1,_0x2f90f7=_0x8bd5e6[_0x49cc38(0x10f)](_0x49cc38(0x11a),0x64)||0x64,_0x552708=_0x8bd5e6[_0x49cc38(0x11b)](_0x49cc38(0x11d))[_0x49cc38(0x112)]()[_0x49cc38(0xf8)](),{items:_0x38beed,paging:_0x5118f6}=await listAppRoles(_0x8bd5e6[_0x49cc38(0xf5)],{'currentPage':_0x50a85f,'pageSize':_0x2f90f7}),_0xbfccd0=_0x552708?_0x38beed[_0x49cc38(0xfd)](_0x5134b8=>_0x5134b8['roleType']===_0x552708):_0x38beed,_0x437ff5=_0xbfccd0[_0x49cc38(0x102)](projectRole);return{'ok':!![],'data':{'roles':_0x437ff5,'paging':_0x5118f6},'message':_0x49cc38(0x116)+_0x437ff5[_0x49cc38(0x108)]+_0x49cc38(0x119)};}};
1
+ function a175_0xf6d2(_0x4880c2,_0x5efe6f){_0x4880c2=_0x4880c2-0x195;const _0x48c870=a175_0x48c8();let _0xf6d2f4=_0x48c870[_0x4880c2];return _0xf6d2f4;}const a175_0x27f223=a175_0xf6d2;(function(_0x205bef,_0x2fdb1b){const _0x1a9ce6=a175_0xf6d2,_0x3dd202=_0x205bef();while(!![]){try{const _0x1f9509=-parseInt(_0x1a9ce6(0x19f))/0x1*(-parseInt(_0x1a9ce6(0x1a6))/0x2)+parseInt(_0x1a9ce6(0x19b))/0x3+-parseInt(_0x1a9ce6(0x1b3))/0x4*(-parseInt(_0x1a9ce6(0x1ac))/0x5)+parseInt(_0x1a9ce6(0x1b4))/0x6+parseInt(_0x1a9ce6(0x1a8))/0x7+-parseInt(_0x1a9ce6(0x1b8))/0x8+-parseInt(_0x1a9ce6(0x1a9))/0x9*(parseInt(_0x1a9ce6(0x1b6))/0xa);if(_0x1f9509===_0x2fdb1b)break;else _0x3dd202['push'](_0x3dd202['shift']());}catch(_0x4e0157){_0x3dd202['push'](_0x3dd202['shift']());}}}(a175_0x48c8,0x90083));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a175_0x48c8(){const _0x6720de=['187288vndgAF','2770212bkEzMS','number','19792810VarXzB','appCode','6866760uageKU','validation','type','includes','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','Page\x20size\x20(1-100)','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','\x20role(s)','map','Use\x20one\x20of:\x20','2465478zsjOVo','length','filter','Invalid\x20--type\x20\x22','246397eoZKgC','toUpperCase','role','join','num','Found\x20','CUSTOM','2bTtcZh','trim','6073004cyjQEx','9PnNxlC','str','list','110HTnjLx','string','Page\x20index\x20(1-based)','pagesize','page','ADMIN','read'];a175_0x48c8=function(){return _0x6720de;};return a175_0x48c8();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a175_0x27f223(0x1b1),'DEV','USER',a175_0x27f223(0x1a5)];export const roleList={'service':a175_0x27f223(0x1a1),'command':a175_0x27f223(0x1ab),'description':a175_0x27f223(0x195),'risk':a175_0x27f223(0x1b2),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a175_0x27f223(0x1ba),'type':a175_0x27f223(0x1ad),'required':![],'description':'Filter\x20by\x20role\x20type','enum':ROLE_TYPES},{'name':'page','type':a175_0x27f223(0x1b5),'description':a175_0x27f223(0x1ae),'default':0x1},{'name':'pagesize','type':a175_0x27f223(0x1b5),'description':a175_0x27f223(0x196),'default':0x64}],async 'validate'(_0x9847f0){const _0x34796f=a175_0x27f223,_0x494bfb=_0x9847f0[_0x34796f(0x1aa)](_0x34796f(0x1ba))[_0x34796f(0x1a7)]();if(_0x494bfb&&!ROLE_TYPES[_0x34796f(0x1bb)](_0x494bfb[_0x34796f(0x1a0)]()))throw CliErrors[_0x34796f(0x1b9)](_0x34796f(0x19e)+_0x494bfb+'\x22.',_0x34796f(0x19a)+ROLE_TYPES[_0x34796f(0x1a2)](',\x20')+'.');const _0x51e7f7=_0x9847f0[_0x34796f(0x1a3)]('page',0x1),_0x3785ff=_0x9847f0[_0x34796f(0x1a3)](_0x34796f(0x1af),0x64);if(_0x51e7f7<0x1)throw CliErrors[_0x34796f(0x1b9)](_0x34796f(0x197));if(_0x3785ff<0x1||_0x3785ff>0x64)throw CliErrors[_0x34796f(0x1b9)]('--pagesize\x20must\x20be\x20between\x201\x20and\x20100.');},async 'execute'(_0x5ac266){const _0x5dfee1=a175_0x27f223,_0x386560=_0x5ac266['num'](_0x5dfee1(0x1b0),0x1)||0x1,_0x2c3080=_0x5ac266[_0x5dfee1(0x1a3)]('pagesize',0x64)||0x64,_0x3ad4ca=_0x5ac266[_0x5dfee1(0x1aa)](_0x5dfee1(0x1ba))['trim']()[_0x5dfee1(0x1a0)](),{items:_0x2bf9c4,paging:_0x2b7591}=await listAppRoles(_0x5ac266[_0x5dfee1(0x1b7)],{'currentPage':_0x386560,'pageSize':_0x2c3080}),_0x582d54=_0x3ad4ca?_0x2bf9c4[_0x5dfee1(0x19d)](_0x19c681=>_0x19c681['roleType']===_0x3ad4ca):_0x2bf9c4,_0x10e8e7=_0x582d54[_0x5dfee1(0x199)](projectRole);return{'ok':!![],'data':{'roles':_0x10e8e7,'paging':_0x2b7591},'message':_0x5dfee1(0x1a4)+_0x10e8e7[_0x5dfee1(0x19c)]+_0x5dfee1(0x198)};}};
@@ -1 +1 @@
1
- const a168_0x174918=a168_0x326d;(function(_0xcb8909,_0x41290c){const _0x4cca78=a168_0x326d,_0x3c242a=_0xcb8909();while(!![]){try{const _0x1496f5=parseInt(_0x4cca78(0xba))/0x1+parseInt(_0x4cca78(0xab))/0x2*(-parseInt(_0x4cca78(0x97))/0x3)+-parseInt(_0x4cca78(0x8d))/0x4+-parseInt(_0x4cca78(0xb1))/0x5+-parseInt(_0x4cca78(0x7f))/0x6+parseInt(_0x4cca78(0x9d))/0x7+parseInt(_0x4cca78(0xbd))/0x8;if(_0x1496f5===_0x41290c)break;else _0x3c242a['push'](_0x3c242a['shift']());}catch(_0x421a70){_0x3c242a['push'](_0x3c242a['shift']());}}}(a168_0x3de6,0x1fc4b));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':'number','required':!![],'description':a168_0x174918(0xb3)};export const ROLE_REF_FLAG={'name':a168_0x174918(0x9b),'type':a168_0x174918(0xb4),'required':!![],'description':a168_0x174918(0x89)};export const USER_REF_FLAG={'name':'user','type':a168_0x174918(0xb4),'required':!![],'description':a168_0x174918(0x86)};export const NAME_FLAG={'name':'name','type':a168_0x174918(0xb4),'required':!![],'description':a168_0x174918(0x94)};export const USER_NAME_FLAG={'name':'name','type':'string','required':!![],'description':'Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId'};export const REMARK_FLAG={'name':'remark','type':a168_0x174918(0xb4),'required':![],'description':a168_0x174918(0xaa)};export const EXPECT_USER_COUNT_FLAG={'name':a168_0x174918(0x9f),'type':a168_0x174918(0x8e),'required':![],'description':a168_0x174918(0xa4)};export const BUILTIN_ROLE_TYPES=[a168_0x174918(0xbe),'DEV',a168_0x174918(0xc1)];export function isBuiltinRole(_0x3e09f6){const _0x28480e=a168_0x174918;return BUILTIN_ROLE_TYPES[_0x28480e(0xa6)](_0x3e09f6);}export function assertCustomRole(_0x377141,_0x3596ef){const _0x300d72=a168_0x174918;if(_0x377141['roleType']!==_0x300d72(0xb0))throw CliErrors['validation'](_0x300d72(0x7c)+_0x3596ef+_0x300d72(0xc0)+_0x377141[_0x300d72(0x80)]+'\x20('+_0x377141['roleType']+').',_0x300d72(0x87));}export function assertPermConfigurable(_0x54a9f4){const _0x46f6bb=a168_0x174918;if(_0x54a9f4[_0x46f6bb(0xa8)]==='DEV'||_0x54a9f4[_0x46f6bb(0xa8)]===_0x46f6bb(0xbe))throw CliErrors[_0x46f6bb(0x8f)](_0x46f6bb(0x83)+_0x54a9f4['roleName']+'\x20('+_0x54a9f4['roleType']+').',_0x46f6bb(0x88));}export function projectRole(_0x47e596){const _0x1b6445=a168_0x174918;return{'id':_0x47e596['id'],'roleName':_0x47e596[_0x1b6445(0x80)],'roleType':_0x47e596[_0x1b6445(0xa8)],'remark':_0x47e596['remark'],'userCount':_0x47e596[_0x1b6445(0xb8)],'permitCount':_0x47e596['permitCount'],'builtin':isBuiltinRole(_0x47e596[_0x1b6445(0xa8)])};}function a168_0x326d(_0x3706ff,_0x143fe3){_0x3706ff=_0x3706ff-0x7c;const _0x3de6fc=a168_0x3de6();let _0x326da6=_0x3de6fc[_0x3706ff];return _0x326da6;}export async function resolveRoleRef(_0x17dfa8,_0x49f055){const _0x13910c=a168_0x174918,_0x3bef42=_0x49f055['trim']();if(!_0x3bef42)throw CliErrors[_0x13910c(0x8f)](_0x13910c(0xac),'Pass\x20--role\x20<id|name>.');if(/^\d+$/['test'](_0x3bef42))return getRoleById(_0x17dfa8,Number(_0x3bef42));const _0x8c3099=await listAllAppRoles(_0x17dfa8),_0x41c2d5=_0x8c3099['filter'](_0x308e9e=>_0x308e9e[_0x13910c(0x80)]===_0x3bef42);if(_0x41c2d5['length']===0x0)throw CliErrors[_0x13910c(0x8f)]('Role\x20name\x20\x22'+_0x3bef42+_0x13910c(0x98)+_0x17dfa8+'.',_0x13910c(0xb7));if(_0x41c2d5['length']>0x1){const _0x967e13=_0x41c2d5[_0x13910c(0x9c)](_0xe936a6=>_0xe936a6['id'])[_0x13910c(0xa2)](',\x20');throw CliErrors['validation'](_0x13910c(0xc9)+_0x3bef42+_0x13910c(0x95)+_0x967e13+').','Disambiguate\x20with\x20--role\x20<id>.');}return _0x41c2d5[0x0];}export async function getRoleById(_0x2f19ce,_0x5ec16b){const _0x1a8b1c=a168_0x174918,_0x26839a=await getAppRole(_0x5ec16b);if(!_0x26839a)throw CliErrors['validation']('Role\x20id\x20'+_0x5ec16b+'\x20not\x20found\x20in\x20app\x20'+_0x2f19ce+'.',_0x1a8b1c(0x7e));return _0x26839a;}async function listAllAppRoles(_0x5d461e){const _0x526e40=a168_0x174918,_0x3159cc=0x64,_0x16897d=[];for(let _0x56ada0=0x1;;_0x56ada0+=0x1){const {items:_0x41d77d,paging:_0x2f295b}=await listAppRoles(_0x5d461e,{'currentPage':_0x56ada0,'pageSize':_0x3159cc});_0x16897d['push'](..._0x41d77d);if(_0x41d77d['length']<_0x3159cc||_0x2f295b&&_0x16897d['length']>=_0x2f295b[_0x526e40(0x90)])return _0x16897d;}}export async function resolveTenantCode(){const _0x3f298c=a168_0x174918,_0x2052b9=await getSessionUserInfo(),_0x2423b4=_0x2052b9?.[_0x3f298c(0xbf)]?.[_0x3f298c(0xc8)]?.[_0x3f298c(0xaf)];if(!_0x2423b4)throw CliErrors[_0x3f298c(0x8a)]('Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.');return _0x2423b4;}function matchMember(_0x13e998,_0x3399e1){const _0x10ffdc=a168_0x174918,_0x48afed=_0x3399e1[_0x10ffdc(0xbb)]()[_0x10ffdc(0xae)]();return(_0x13e998['nickname']??'')['toLowerCase']()===_0x48afed||(_0x13e998[_0x10ffdc(0x84)]??'')[_0x10ffdc(0xae)]()===_0x48afed;}export async function resolveUserRef(_0x2f7d11){const _0x1a8412=a168_0x174918,_0x477066=_0x2f7d11[_0x1a8412(0xbb)]();if(!_0x477066)throw CliErrors['validation'](_0x1a8412(0xbc),_0x1a8412(0xb2));const _0x153ac6=await resolveTenantCode(),_0x58fb6e=await getTenantMembers(_0x153ac6);if(/^\d+$/[_0x1a8412(0xa9)](_0x477066)){const _0x27da5d=Number(_0x477066),_0x4c1323=_0x58fb6e[_0x1a8412(0xc6)](_0x36444d=>_0x36444d[_0x1a8412(0xb9)]===_0x27da5d);return{'userId':_0x27da5d,'username':_0x4c1323?.[_0x1a8412(0x84)]??String(_0x27da5d),'nickname':_0x4c1323?.[_0x1a8412(0xc7)],'matchedBy':'id'};}const _0x5493ca=_0x58fb6e[_0x1a8412(0x93)](_0x59a9ef=>matchMember(_0x59a9ef,_0x477066));if(_0x5493ca[_0x1a8412(0xa1)]===0x0)throw CliErrors['validation'](_0x1a8412(0x92)+_0x477066+'\x22.',_0x1a8412(0x9a));if(_0x5493ca[_0x1a8412(0xa1)]>0x1){const _0x18e243=_0x5493ca[_0x1a8412(0x9c)](_0x970869=>(_0x970869[_0x1a8412(0xc7)]??_0x970869['username']??'?')+'('+_0x970869[_0x1a8412(0xb9)]+')')[_0x1a8412(0xa2)](',\x20');throw CliErrors[_0x1a8412(0x8f)](_0x1a8412(0xa3)+_0x477066+_0x1a8412(0x81)+_0x18e243+'.',_0x1a8412(0xa0));}const _0x2ab5af=_0x5493ca[0x0];return{'userId':_0x2ab5af[_0x1a8412(0xb9)],'username':_0x2ab5af[_0x1a8412(0x84)]??String(_0x2ab5af[_0x1a8412(0xb9)]),'nickname':_0x2ab5af[_0x1a8412(0xc7)],'matchedBy':'name'};}export const UPDATE_USER_LIST_PATH='/smartapi/permit/user-role/update-user-list';function userIdsOf(_0x25f63c){const _0xb217d9=a168_0x174918;return(_0x25f63c?.[_0xb217d9(0x82)]??[])[_0xb217d9(0x9c)](_0x117f5b=>_0x117f5b[_0xb217d9(0xb9)]);}export function computeRoleUserMutation(_0x228e7a){const _0xc4448=a168_0x174918,{operation:_0x11a668,appCode:_0x402f3f,roleUsers:_0x532d80,targetRoleId:_0x1a8a66,user:_0x440339}=_0x228e7a,_0xc13d4f=_0x532d80[_0xc4448(0xc6)](_0x27c144=>_0x27c144['id']===_0x1a8a66);if(!_0xc13d4f)throw CliErrors[_0xc4448(0x8f)](_0xc4448(0x96)+_0x1a8a66+_0xc4448(0x85),_0xc4448(0x7e));const _0x484695=userIdsOf(_0xc13d4f),_0x10b2bc=[];if(_0x228e7a[_0xc4448(0xc3)]!==undefined&&_0x228e7a[_0xc4448(0xc3)]!==_0x484695['length'])throw CliErrors[_0xc4448(0x8f)]('Anti-drift\x20check\x20failed:\x20expected\x20'+_0x228e7a[_0xc4448(0xc3)]+'\x20member(s)\x20but\x20role\x20has\x20'+_0x484695[_0xc4448(0xa1)]+'.',_0xc4448(0x99));const _0x3833c8=_0x484695[_0xc4448(0xa6)](_0x440339[_0xc4448(0xb9)]);let _0x251118=![];const _0x3fb839=[..._0xc13d4f[_0xc4448(0x82)]];if(_0x11a668===_0xc4448(0xa7))_0x3833c8?_0x10b2bc[_0xc4448(0xad)](_0xc4448(0xc2)+_0x440339[_0xc4448(0xb9)]+_0xc4448(0xb6)+_0xc13d4f[_0xc4448(0x80)]+';\x20no\x20change.'):(_0x3fb839['push']({'userId':_0x440339[_0xc4448(0xb9)],'username':_0x440339[_0xc4448(0x84)],..._0x440339[_0xc4448(0xc7)]?{'nickname':_0x440339[_0xc4448(0xc7)]}:{}}),_0x251118=!![]);else{if(!_0x3833c8)_0x10b2bc[_0xc4448(0xad)](_0xc4448(0xc2)+_0x440339[_0xc4448(0xb9)]+_0xc4448(0x9e)+_0xc13d4f[_0xc4448(0x80)]+';\x20no\x20change.');else{const _0x494e03=_0x3fb839['findIndex'](_0x22750b=>_0x22750b[_0xc4448(0xb9)]===_0x440339['userId']);if(_0x494e03>=0x0)_0x3fb839[_0xc4448(0xa5)](_0x494e03,0x1);_0x251118=!![];}}const _0x26fff2=_0x532d80['map'](_0x445a95=>_0x445a95['id']===_0x1a8a66?{..._0x445a95,'userList':_0x3fb839}:_0x445a95),_0x7717c8=_0x3fb839[_0xc4448(0x9c)](_0x32f3b3=>_0x32f3b3['userId']),_0x2a1a3d={'operation':_0x11a668,'selector':{'appCode':_0x402f3f,'roleId':_0x1a8a66,'roleName':_0xc13d4f[_0xc4448(0x80)],'userId':_0x440339[_0xc4448(0xb9)]},'before':{'userIds':_0x484695},'after':{'userIds':_0x7717c8},'dryRun':_0x228e7a[_0xc4448(0x91)],'backend':{'method':_0xc4448(0x8b),'path':UPDATE_USER_LIST_PATH},'warnings':_0x10b2bc};return{'roleList':_0x26fff2,'mutation':_0x2a1a3d,'changed':_0x251118};}export async function loadRoleUsers(_0xef465f){return listRoleUsers(_0xef465f);}export function readRoleRef(_0x466e4f){const _0x4a0f39=a168_0x174918,_0x3d501f=_0x466e4f[_0x4a0f39(0x7d)](_0x4a0f39(0x9b))[_0x4a0f39(0xbb)]();if(!_0x3d501f)throw CliErrors[_0x4a0f39(0x8c)](_0x4a0f39(0x9b),_0x4a0f39(0xc4));return _0x3d501f;}export async function prepareUserMutation(_0x2e74f0,_0x2874cc,_0x5a8fd9){const _0x277104=a168_0x174918,_0x805879=readRoleRef(_0x2e74f0),_0x277a69=_0x2e74f0['str'](_0x277104(0xbf))[_0x277104(0xbb)]();if(!_0x277a69)throw CliErrors['flagMissing']('user','Pass\x20--user\x20<id|name>.');const _0x283c6f=_0x2e74f0[_0x277104(0xb5)]('expect-user-count'),_0x1eee7f=_0x283c6f===undefined||_0x283c6f===null?undefined:Number(_0x283c6f),_0x5cb1fc=await resolveRoleRef(_0x2e74f0[_0x277104(0xc5)],_0x805879),_0x3b9f05=await resolveUserRef(_0x277a69),_0x2984f0=await loadRoleUsers(_0x2e74f0['appCode']);return computeRoleUserMutation({'operation':_0x2874cc,'appCode':_0x2e74f0[_0x277104(0xc5)],'roleUsers':_0x2984f0,'targetRoleId':_0x5cb1fc['id'],'user':{'userId':_0x3b9f05['userId'],'username':_0x3b9f05[_0x277104(0x84)],'nickname':_0x3b9f05[_0x277104(0xc7)]},'dryRun':_0x5a8fd9,..._0x1eee7f!==undefined?{'expectUserCount':_0x1eee7f}:{}});}function a168_0x3de6(){const _0xda5af3=['length','join','Multiple\x20tenant\x20members\x20match\x20\x22','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','splice','includes','user-add','roleType','test','Optional\x20role\x20remark/description','2846yZAQkH','Missing\x20role\x20reference.','push','toLowerCase','tenant_code','CUSTOM','760525xRiEYa','Pass\x20--user\x20<id|name>.','Role\x20id\x20(from\x20`role\x20list`)','string','flag','\x20is\x20already\x20a\x20member\x20of\x20role\x20','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','userCount','userId','216524xxwXom','trim','Missing\x20user\x20reference.','2939648Daoltw','ADMIN','user','\x20built-in\x20role\x20','USER','User\x20','expectUserCount','Pass\x20--role\x20<id|name>.','appCode','find','nickname','tenant','Role\x20name\x20\x22','Cannot\x20','str','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','269202aSgige','roleName','\x22:\x20','userList','Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20','username','\x20not\x20found\x20in\x20the\x20user-role\x20list.','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)','authRequired','POST','flagMissing','982460Vdfkdh','number','validation','totalCount','dryRun','No\x20tenant\x20member\x20matches\x20\x22','filter','Role\x20name','\x22\x20is\x20ambiguous\x20(ids:\x20','Role\x20id\x20','345oMrimA','\x22\x20not\x20found\x20in\x20app\x20','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','role','map','1066625wduUci','\x20is\x20not\x20a\x20member\x20of\x20role\x20','expect-user-count','Disambiguate\x20with\x20--user\x20<id>.'];a168_0x3de6=function(){return _0xda5af3;};return a168_0x3de6();}
1
+ const a176_0x118add=a176_0x4aaf;(function(_0x4a7c40,_0x45e0fd){const _0x2483b7=a176_0x4aaf,_0x44cec5=_0x4a7c40();while(!![]){try{const _0x537cab=-parseInt(_0x2483b7(0x199))/0x1*(parseInt(_0x2483b7(0x1c4))/0x2)+-parseInt(_0x2483b7(0x1ca))/0x3+parseInt(_0x2483b7(0x1a5))/0x4*(parseInt(_0x2483b7(0x1b0))/0x5)+-parseInt(_0x2483b7(0x1c6))/0x6+parseInt(_0x2483b7(0x1e6))/0x7+-parseInt(_0x2483b7(0x1df))/0x8*(parseInt(_0x2483b7(0x1e2))/0x9)+-parseInt(_0x2483b7(0x1b4))/0xa*(-parseInt(_0x2483b7(0x1ae))/0xb);if(_0x537cab===_0x45e0fd)break;else _0x44cec5['push'](_0x44cec5['shift']());}catch(_0x2ae689){_0x44cec5['push'](_0x44cec5['shift']());}}}(a176_0x21b1,0xbea63));import{getAppRole,getTenantMembers,listAppRoles,listRoleUsers}from'../../core/api-client.js';function a176_0x21b1(){const _0x25a076=['CUSTOM','str','\x20is\x20not\x20a\x20member\x20of\x20role\x20','3111237qXKHit','tenant_code','Disambiguate\x20with\x20--user\x20<id>.','remark','totalCount','Anti-drift\x20check\x20failed:\x20expected\x20','Missing\x20user\x20reference.','DEV\x20/\x20ADMIN\x20keep\x20full\x20access\x20by\x20design;\x20configure\x20a\x20CUSTOM\x20role\x20instead.','username','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','authRequired','\x20not\x20found\x20in\x20app\x20','Check\x20the\x20nickname/username,\x20or\x20pass\x20--user\x20<id>.','toLowerCase','dryRun','userList','\x20is\x20already\x20a\x20member\x20of\x20role\x20','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','expectUserCount','No\x20tenant\x20member\x20matches\x20\x22','expect-user-count','497880UZFkBp','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','name','18dHbPDx','push','\x20built-in\x20role\x20','Disambiguate\x20with\x20--role\x20<id>.','8221773UUaOdS','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','DEV','join','validation','\x20not\x20found\x20in\x20the\x20user-role\x20list.',';\x20no\x20change.','Multiple\x20tenant\x20members\x20match\x20\x22','Missing\x20role\x20reference.','permitCount','Optional\x20role\x20remark/description','15305oKSFSf','role','Pass\x20--user\x20<id|name>.','includes','\x22\x20is\x20ambiguous\x20(ids:\x20','test','map','userId','ADMIN','flag','string','Cannot\x20','100pJEIVk','find','filter','\x22:\x20','user-add','Role\x20name','nickname','user','roleType','11hslcBX','Role\x20id\x20','5065deJLci','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','\x20member(s)\x20but\x20role\x20has\x20','/smartapi/permit/user-role/update-user-list','25185480PZrcbq','\x22\x20not\x20found\x20in\x20app\x20','flagMissing','appCode','findIndex','splice','Role\x20id\x20(from\x20`role\x20list`)','userCount','number','POST','trim','USER','roleName','length','Role\x20name\x20\x22','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','106IEaetF','User\x20','5788794LSqINx'];a176_0x21b1=function(){return _0x25a076;};return a176_0x21b1();}import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':a176_0x118add(0x1bc),'required':!![],'description':a176_0x118add(0x1ba)};export const ROLE_REF_FLAG={'name':a176_0x118add(0x19a),'type':'string','required':!![],'description':'Role\x20id\x20or\x20role\x20name\x20(CUSTOM\x20roles\x20may\x20be\x20referenced\x20by\x20name)'};export const USER_REF_FLAG={'name':a176_0x118add(0x1ac),'type':a176_0x118add(0x1a3),'required':!![],'description':'User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId'};export const NAME_FLAG={'name':a176_0x118add(0x1e1),'type':a176_0x118add(0x1a3),'required':!![],'description':a176_0x118add(0x1aa)};export const USER_NAME_FLAG={'name':a176_0x118add(0x1e1),'type':a176_0x118add(0x1a3),'required':!![],'description':a176_0x118add(0x1e7)};export const REMARK_FLAG={'name':'remark','type':a176_0x118add(0x1a3),'required':![],'description':a176_0x118add(0x198)};export const EXPECT_USER_COUNT_FLAG={'name':a176_0x118add(0x1de),'type':'number','required':![],'description':a176_0x118add(0x1b1)};export const BUILTIN_ROLE_TYPES=['ADMIN',a176_0x118add(0x1e8),a176_0x118add(0x1bf)];export function isBuiltinRole(_0x467c3f){const _0x255908=a176_0x118add;return BUILTIN_ROLE_TYPES[_0x255908(0x19c)](_0x467c3f);}export function assertCustomRole(_0x5ec7dd,_0x2d516a){const _0x353c87=a176_0x118add;if(_0x5ec7dd[_0x353c87(0x1ad)]!==_0x353c87(0x1c7))throw CliErrors[_0x353c87(0x192)](_0x353c87(0x1a4)+_0x2d516a+_0x353c87(0x1e4)+_0x5ec7dd[_0x353c87(0x1c0)]+'\x20('+_0x5ec7dd['roleType']+').',_0x353c87(0x1d3));}export function assertPermConfigurable(_0x391220){const _0x5ad408=a176_0x118add;if(_0x391220[_0x5ad408(0x1ad)]===_0x5ad408(0x1e8)||_0x391220[_0x5ad408(0x1ad)]===_0x5ad408(0x1a1))throw CliErrors['validation']('Cannot\x20change\x20the\x20permission\x20matrix\x20of\x20built-in\x20role\x20'+_0x391220[_0x5ad408(0x1c0)]+'\x20('+_0x391220['roleType']+').',_0x5ad408(0x1d1));}export function projectRole(_0x4e4267){const _0x5b5724=a176_0x118add;return{'id':_0x4e4267['id'],'roleName':_0x4e4267[_0x5b5724(0x1c0)],'roleType':_0x4e4267[_0x5b5724(0x1ad)],'remark':_0x4e4267[_0x5b5724(0x1cd)],'userCount':_0x4e4267[_0x5b5724(0x1bb)],'permitCount':_0x4e4267[_0x5b5724(0x197)],'builtin':isBuiltinRole(_0x4e4267[_0x5b5724(0x1ad)])};}export async function resolveRoleRef(_0x299e4f,_0x1ebc03){const _0x531726=a176_0x118add,_0x64864c=_0x1ebc03[_0x531726(0x1be)]();if(!_0x64864c)throw CliErrors['validation'](_0x531726(0x196),'Pass\x20--role\x20<id|name>.');if(/^\d+$/[_0x531726(0x19e)](_0x64864c))return getRoleById(_0x299e4f,Number(_0x64864c));const _0x4f96f4=await listAllAppRoles(_0x299e4f),_0x17a362=_0x4f96f4['filter'](_0x2935ef=>_0x2935ef[_0x531726(0x1c0)]===_0x64864c);if(_0x17a362[_0x531726(0x1c1)]===0x0)throw CliErrors['validation'](_0x531726(0x1c2)+_0x64864c+_0x531726(0x1b5)+_0x299e4f+'.',_0x531726(0x1c3));if(_0x17a362['length']>0x1){const _0x3c681f=_0x17a362[_0x531726(0x19f)](_0x457408=>_0x457408['id'])[_0x531726(0x191)](',\x20');throw CliErrors[_0x531726(0x192)](_0x531726(0x1c2)+_0x64864c+_0x531726(0x19d)+_0x3c681f+').',_0x531726(0x1e5));}return _0x17a362[0x0];}export async function getRoleById(_0x29e9e8,_0x2a2568){const _0x4fb578=a176_0x118add,_0x4f3124=await getAppRole(_0x2a2568);if(!_0x4f3124)throw CliErrors[_0x4fb578(0x192)](_0x4fb578(0x1af)+_0x2a2568+_0x4fb578(0x1d5)+_0x29e9e8+'.',_0x4fb578(0x1db));return _0x4f3124;}async function listAllAppRoles(_0x2b9a2b){const _0x216bdd=a176_0x118add,_0x36e4d6=0x64,_0x4ef2f7=[];for(let _0x2804ce=0x1;;_0x2804ce+=0x1){const {items:_0xf6c38e,paging:_0x575bb8}=await listAppRoles(_0x2b9a2b,{'currentPage':_0x2804ce,'pageSize':_0x36e4d6});_0x4ef2f7['push'](..._0xf6c38e);if(_0xf6c38e[_0x216bdd(0x1c1)]<_0x36e4d6||_0x575bb8&&_0x4ef2f7[_0x216bdd(0x1c1)]>=_0x575bb8[_0x216bdd(0x1ce)])return _0x4ef2f7;}}export async function resolveTenantCode(){const _0x23f5f7=a176_0x118add,_0x102e3c=await getSessionUserInfo(),_0x77d927=_0x102e3c?.[_0x23f5f7(0x1ac)]?.['tenant']?.[_0x23f5f7(0x1cb)];if(!_0x77d927)throw CliErrors[_0x23f5f7(0x1d4)]('Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.');return _0x77d927;}function matchMember(_0x3e5fec,_0x2198bd){const _0x2d90ba=a176_0x118add,_0x2689bc=_0x2198bd[_0x2d90ba(0x1be)]()[_0x2d90ba(0x1d7)]();return(_0x3e5fec['nickname']??'')['toLowerCase']()===_0x2689bc||(_0x3e5fec['username']??'')[_0x2d90ba(0x1d7)]()===_0x2689bc;}export async function resolveUserRef(_0x51ef38){const _0x1d2418=a176_0x118add,_0x11e56d=_0x51ef38[_0x1d2418(0x1be)]();if(!_0x11e56d)throw CliErrors[_0x1d2418(0x192)](_0x1d2418(0x1d0),_0x1d2418(0x19b));const _0x2563e0=await resolveTenantCode(),_0x4bab98=await getTenantMembers(_0x2563e0);if(/^\d+$/[_0x1d2418(0x19e)](_0x11e56d)){const _0x4233a4=Number(_0x11e56d),_0x4c9cfb=_0x4bab98[_0x1d2418(0x1a6)](_0x305786=>_0x305786[_0x1d2418(0x1a0)]===_0x4233a4);return{'userId':_0x4233a4,'username':_0x4c9cfb?.[_0x1d2418(0x1d2)]??String(_0x4233a4),'nickname':_0x4c9cfb?.[_0x1d2418(0x1ab)],'matchedBy':'id'};}const _0x19e179=_0x4bab98[_0x1d2418(0x1a7)](_0x2f1d99=>matchMember(_0x2f1d99,_0x11e56d));if(_0x19e179[_0x1d2418(0x1c1)]===0x0)throw CliErrors[_0x1d2418(0x192)](_0x1d2418(0x1dd)+_0x11e56d+'\x22.',_0x1d2418(0x1d6));if(_0x19e179[_0x1d2418(0x1c1)]>0x1){const _0x2f24f5=_0x19e179[_0x1d2418(0x19f)](_0x179cc2=>(_0x179cc2['nickname']??_0x179cc2[_0x1d2418(0x1d2)]??'?')+'('+_0x179cc2[_0x1d2418(0x1a0)]+')')[_0x1d2418(0x191)](',\x20');throw CliErrors[_0x1d2418(0x192)](_0x1d2418(0x195)+_0x11e56d+_0x1d2418(0x1a8)+_0x2f24f5+'.',_0x1d2418(0x1cc));}const _0x455814=_0x19e179[0x0];return{'userId':_0x455814[_0x1d2418(0x1a0)],'username':_0x455814[_0x1d2418(0x1d2)]??String(_0x455814['userId']),'nickname':_0x455814['nickname'],'matchedBy':_0x1d2418(0x1e1)};}export const UPDATE_USER_LIST_PATH=a176_0x118add(0x1b3);function userIdsOf(_0x1fbc10){const _0x4aef0f=a176_0x118add;return(_0x1fbc10?.[_0x4aef0f(0x1d9)]??[])[_0x4aef0f(0x19f)](_0x5a1b93=>_0x5a1b93['userId']);}export function computeRoleUserMutation(_0x3ae986){const _0x456bb3=a176_0x118add,{operation:_0x908c8a,appCode:_0x4aba71,roleUsers:_0x3fc6fa,targetRoleId:_0x366fa9,user:_0x4baec7}=_0x3ae986,_0x5dbe82=_0x3fc6fa[_0x456bb3(0x1a6)](_0x5aaba4=>_0x5aaba4['id']===_0x366fa9);if(!_0x5dbe82)throw CliErrors[_0x456bb3(0x192)]('Role\x20id\x20'+_0x366fa9+_0x456bb3(0x193),'Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.');const _0x57cf0f=userIdsOf(_0x5dbe82),_0x3a4917=[];if(_0x3ae986['expectUserCount']!==undefined&&_0x3ae986[_0x456bb3(0x1dc)]!==_0x57cf0f[_0x456bb3(0x1c1)])throw CliErrors[_0x456bb3(0x192)](_0x456bb3(0x1cf)+_0x3ae986[_0x456bb3(0x1dc)]+_0x456bb3(0x1b2)+_0x57cf0f[_0x456bb3(0x1c1)]+'.',_0x456bb3(0x1e0));const _0x118788=_0x57cf0f[_0x456bb3(0x19c)](_0x4baec7[_0x456bb3(0x1a0)]);let _0x2fcf83=![];const _0x5f0f01=[..._0x5dbe82[_0x456bb3(0x1d9)]];if(_0x908c8a===_0x456bb3(0x1a9))_0x118788?_0x3a4917['push'](_0x456bb3(0x1c5)+_0x4baec7['userId']+_0x456bb3(0x1da)+_0x5dbe82['roleName']+_0x456bb3(0x194)):(_0x5f0f01[_0x456bb3(0x1e3)]({'userId':_0x4baec7[_0x456bb3(0x1a0)],'username':_0x4baec7[_0x456bb3(0x1d2)],..._0x4baec7[_0x456bb3(0x1ab)]?{'nickname':_0x4baec7[_0x456bb3(0x1ab)]}:{}}),_0x2fcf83=!![]);else{if(!_0x118788)_0x3a4917['push'](_0x456bb3(0x1c5)+_0x4baec7['userId']+_0x456bb3(0x1c9)+_0x5dbe82[_0x456bb3(0x1c0)]+';\x20no\x20change.');else{const _0x43a0f0=_0x5f0f01[_0x456bb3(0x1b8)](_0x38fe9b=>_0x38fe9b[_0x456bb3(0x1a0)]===_0x4baec7[_0x456bb3(0x1a0)]);if(_0x43a0f0>=0x0)_0x5f0f01[_0x456bb3(0x1b9)](_0x43a0f0,0x1);_0x2fcf83=!![];}}const _0x1918d2=_0x3fc6fa['map'](_0xcadbbc=>_0xcadbbc['id']===_0x366fa9?{..._0xcadbbc,'userList':_0x5f0f01}:_0xcadbbc),_0x54def2=_0x5f0f01[_0x456bb3(0x19f)](_0x13cbe8=>_0x13cbe8[_0x456bb3(0x1a0)]),_0x2cc8e6={'operation':_0x908c8a,'selector':{'appCode':_0x4aba71,'roleId':_0x366fa9,'roleName':_0x5dbe82[_0x456bb3(0x1c0)],'userId':_0x4baec7[_0x456bb3(0x1a0)]},'before':{'userIds':_0x57cf0f},'after':{'userIds':_0x54def2},'dryRun':_0x3ae986[_0x456bb3(0x1d8)],'backend':{'method':_0x456bb3(0x1bd),'path':UPDATE_USER_LIST_PATH},'warnings':_0x3a4917};return{'roleList':_0x1918d2,'mutation':_0x2cc8e6,'changed':_0x2fcf83};}export async function loadRoleUsers(_0x2e8d8c){return listRoleUsers(_0x2e8d8c);}function a176_0x4aaf(_0x3d8839,_0x11c4e0){_0x3d8839=_0x3d8839-0x191;const _0x21b170=a176_0x21b1();let _0x4aaf4e=_0x21b170[_0x3d8839];return _0x4aaf4e;}export function readRoleRef(_0x11e717){const _0x255a0a=a176_0x118add,_0x5aafd2=_0x11e717[_0x255a0a(0x1c8)](_0x255a0a(0x19a))[_0x255a0a(0x1be)]();if(!_0x5aafd2)throw CliErrors[_0x255a0a(0x1b6)](_0x255a0a(0x19a),'Pass\x20--role\x20<id|name>.');return _0x5aafd2;}export async function prepareUserMutation(_0x21331a,_0x3aa916,_0x7a660f){const _0x31e004=a176_0x118add,_0x7e2a11=readRoleRef(_0x21331a),_0x3a6b94=_0x21331a[_0x31e004(0x1c8)](_0x31e004(0x1ac))[_0x31e004(0x1be)]();if(!_0x3a6b94)throw CliErrors[_0x31e004(0x1b6)](_0x31e004(0x1ac),'Pass\x20--user\x20<id|name>.');const _0x322d6f=_0x21331a[_0x31e004(0x1a2)](_0x31e004(0x1de)),_0x8cc58=_0x322d6f===undefined||_0x322d6f===null?undefined:Number(_0x322d6f),_0x189c15=await resolveRoleRef(_0x21331a[_0x31e004(0x1b7)],_0x7e2a11),_0x49d610=await resolveUserRef(_0x3a6b94),_0x3d199a=await loadRoleUsers(_0x21331a[_0x31e004(0x1b7)]);return computeRoleUserMutation({'operation':_0x3aa916,'appCode':_0x21331a['appCode'],'roleUsers':_0x3d199a,'targetRoleId':_0x189c15['id'],'user':{'userId':_0x49d610[_0x31e004(0x1a0)],'username':_0x49d610[_0x31e004(0x1d2)],'nickname':_0x49d610[_0x31e004(0x1ab)]},'dryRun':_0x7a660f,..._0x8cc58!==undefined?{'expectUserCount':_0x8cc58}:{}});}
@@ -1 +1 @@
1
- const a169_0xdfbb37=a169_0x18d2;(function(_0x2b8940,_0x92571a){const _0x5753cc=a169_0x18d2,_0xc74409=_0x2b8940();while(!![]){try{const _0x5ad707=-parseInt(_0x5753cc(0xb6))/0x1+-parseInt(_0x5753cc(0xbe))/0x2+parseInt(_0x5753cc(0xa6))/0x3+parseInt(_0x5753cc(0xb3))/0x4+-parseInt(_0x5753cc(0xac))/0x5*(parseInt(_0x5753cc(0xbb))/0x6)+parseInt(_0x5753cc(0xb1))/0x7*(parseInt(_0x5753cc(0xc0))/0x8)+-parseInt(_0x5753cc(0xb5))/0x9*(-parseInt(_0x5753cc(0xb2))/0xa);if(_0x5ad707===_0x92571a)break;else _0xc74409['push'](_0xc74409['shift']());}catch(_0x213a1c){_0xc74409['push'](_0xc74409['shift']());}}}(a169_0x403f,0xdeb32));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';const UPDATE_PATH=a169_0xdfbb37(0xaf);function a169_0x403f(){const _0x5e608f=['validation','\x20(id=','2536566TjzkTu','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','1645792ZbIfxh','appCode','355272DdlfGA','roleName','update','--name\x20cannot\x20be\x20empty.','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','length','1021475cMkWJB','trim','Updated\x20role\x20','/smartapi/permit/role/update','write','56qAyYbS','1803370Bcacgf','7155360ESoLFG','POST','45lMEuWp','1661395qXdQCX','remark','num','flag','name','18JdUGGI'];a169_0x403f=function(){return _0x5e608f;};return a169_0x403f();}function a169_0x18d2(_0x257215,_0x364ba9){_0x257215=_0x257215-0xa5;const _0x403f3c=a169_0x403f();let _0x18d23d=_0x403f3c[_0x257215];return _0x18d23d;}function readPatch(_0x13b641){const _0x471123=a169_0xdfbb37,_0x400af1=_0x13b641['flag'](_0x471123(0xba)),_0x233f11=_0x13b641[_0x471123(0xb9)](_0x471123(0xb7)),_0x28904e={};if(_0x400af1!==undefined&&_0x400af1!==null){const _0x25bafb=String(_0x400af1)[_0x471123(0xad)]();if(!_0x25bafb)throw CliErrors[_0x471123(0xbc)](_0x471123(0xa9));if(_0x25bafb[_0x471123(0xab)]>0x40)throw CliErrors[_0x471123(0xbc)](_0x471123(0xaa));_0x28904e[_0x471123(0xa7)]=_0x25bafb;}_0x233f11!==undefined&&_0x233f11!==null&&(_0x28904e[_0x471123(0xb7)]=String(_0x233f11));if(_0x28904e[_0x471123(0xa7)]===undefined&&_0x28904e[_0x471123(0xb7)]===undefined)throw CliErrors[_0x471123(0xbc)]('Nothing\x20to\x20update.',_0x471123(0xbf));return _0x28904e;}export const roleUpdate={'service':'role','command':a169_0xdfbb37(0xa8),'description':'Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','risk':a169_0xdfbb37(0xb0),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a169_0xdfbb37(0xba),'type':'string','required':![],'description':'New\x20role\x20name'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x32a4e7){readPatch(_0x32a4e7);},async 'dryRun'(_0x2bdcd7){const _0x7d911a=a169_0xdfbb37,_0x2cec36=_0x2bdcd7[_0x7d911a(0xb8)]('id'),_0x388ce2=readPatch(_0x2bdcd7),_0x14652f=await getRoleById(_0x2bdcd7[_0x7d911a(0xa5)],_0x2cec36);return assertCustomRole(_0x14652f,'update'),asDryRunResult({'operation':_0x7d911a(0xa8),'selector':{'appCode':_0x2bdcd7[_0x7d911a(0xa5)],'roleId':_0x2cec36,'roleName':_0x14652f[_0x7d911a(0xa7)]},'before':projectRole(_0x14652f),'after':projectRole({..._0x14652f,..._0x388ce2[_0x7d911a(0xa7)]!==undefined?{'roleName':_0x388ce2['roleName']}:{},..._0x388ce2['remark']!==undefined?{'remark':_0x388ce2[_0x7d911a(0xb7)]}:{}}),'dryRun':!![],'backend':{'method':_0x7d911a(0xb4),'path':UPDATE_PATH},'warnings':[]},{'method':_0x7d911a(0xb4),'url':UPDATE_PATH});},async 'execute'(_0x349904){const _0x15f7b0=a169_0xdfbb37,_0x5371b9=_0x349904[_0x15f7b0(0xb8)]('id'),_0x31173b=readPatch(_0x349904),_0x27be5f=await getRoleById(_0x349904[_0x15f7b0(0xa5)],_0x5371b9);assertCustomRole(_0x27be5f,_0x15f7b0(0xa8)),await updateAppRole({'id':_0x5371b9,'appCode':_0x349904[_0x15f7b0(0xa5)],..._0x31173b[_0x15f7b0(0xa7)]!==undefined?{'roleName':_0x31173b[_0x15f7b0(0xa7)]}:{},..._0x31173b[_0x15f7b0(0xb7)]!==undefined?{'remark':_0x31173b[_0x15f7b0(0xb7)]}:{}});const _0x341178=await getRoleById(_0x349904[_0x15f7b0(0xa5)],_0x5371b9);return{'ok':!![],'data':{'operation':_0x15f7b0(0xa8),'selector':{'appCode':_0x349904[_0x15f7b0(0xa5)],'roleId':_0x5371b9,'roleName':_0x341178['roleName']},'before':projectRole(_0x27be5f),'after':projectRole(_0x341178),'dryRun':![],'backend':{'method':_0x15f7b0(0xb4),'path':UPDATE_PATH},'warnings':[]},'message':_0x15f7b0(0xae)+_0x341178[_0x15f7b0(0xa7)]+_0x15f7b0(0xbd)+_0x5371b9+')'};}};
1
+ function a177_0x2b09(){const _0x1bfe8c=['Updated\x20role\x20','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','length','13352598QgrEVB','update','721416aBGGOT','425397VvFjHq','string','trim','POST','9681498sShfus','validation','40712uotjlb','roleName','appCode','2wZimmX','/smartapi/permit/role/update','829081tkxnDq','--name\x20cannot\x20be\x20empty.','role','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','5EuWjYe','1208NcIjai','remark','name','250nZnIFc','3688968eIMmzQ','Nothing\x20to\x20update.','New\x20role\x20name','flag'];a177_0x2b09=function(){return _0x1bfe8c;};return a177_0x2b09();}const a177_0xcf0843=a177_0x2eda;function a177_0x2eda(_0x5181bd,_0x2aa323){_0x5181bd=_0x5181bd-0x1ce;const _0x2b09ce=a177_0x2b09();let _0x2eda16=_0x2b09ce[_0x5181bd];return _0x2eda16;}(function(_0x54c07,_0x3ef31c){const _0x2aa91c=a177_0x2eda,_0x574fed=_0x54c07();while(!![]){try{const _0x36e562=parseInt(_0x2aa91c(0x1d3))/0x1+-parseInt(_0x2aa91c(0x1dd))/0x2*(-parseInt(_0x2aa91c(0x1d4))/0x3)+-parseInt(_0x2aa91c(0x1e8))/0x4*(parseInt(_0x2aa91c(0x1e3))/0x5)+-parseInt(_0x2aa91c(0x1d8))/0x6+parseInt(_0x2aa91c(0x1da))/0x7*(-parseInt(_0x2aa91c(0x1e4))/0x8)+parseInt(_0x2aa91c(0x1d1))/0x9+-parseInt(_0x2aa91c(0x1e7))/0xa*(-parseInt(_0x2aa91c(0x1df))/0xb);if(_0x36e562===_0x3ef31c)break;else _0x574fed['push'](_0x574fed['shift']());}catch(_0x5f06cd){_0x574fed['push'](_0x574fed['shift']());}}}(a177_0x2b09,0xc77af));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';const UPDATE_PATH=a177_0xcf0843(0x1de);function readPatch(_0x1ffe3a){const _0x12b98a=a177_0xcf0843,_0x9924e6=_0x1ffe3a[_0x12b98a(0x1eb)](_0x12b98a(0x1e6)),_0x50a4a2=_0x1ffe3a['flag'](_0x12b98a(0x1e5)),_0x20d65c={};if(_0x9924e6!==undefined&&_0x9924e6!==null){const _0x344220=String(_0x9924e6)[_0x12b98a(0x1d6)]();if(!_0x344220)throw CliErrors[_0x12b98a(0x1d9)](_0x12b98a(0x1e0));if(_0x344220[_0x12b98a(0x1d0)]>0x40)throw CliErrors['validation'](_0x12b98a(0x1cf));_0x20d65c[_0x12b98a(0x1db)]=_0x344220;}_0x50a4a2!==undefined&&_0x50a4a2!==null&&(_0x20d65c[_0x12b98a(0x1e5)]=String(_0x50a4a2));if(_0x20d65c['roleName']===undefined&&_0x20d65c[_0x12b98a(0x1e5)]===undefined)throw CliErrors['validation'](_0x12b98a(0x1e9),_0x12b98a(0x1e2));return _0x20d65c;}export const roleUpdate={'service':a177_0xcf0843(0x1e1),'command':'update','description':'Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(DEV/ADMIN\x20rejected)','risk':'write','flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a177_0xcf0843(0x1e6),'type':a177_0xcf0843(0x1d5),'required':![],'description':a177_0xcf0843(0x1ea)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5943d1){readPatch(_0x5943d1);},async 'dryRun'(_0x30118c){const _0x265e42=a177_0xcf0843,_0x47b349=_0x30118c['num']('id'),_0x5a86ca=readPatch(_0x30118c),_0xdc72a4=await getRoleById(_0x30118c[_0x265e42(0x1dc)],_0x47b349);return assertCustomRole(_0xdc72a4,_0x265e42(0x1d2)),asDryRunResult({'operation':_0x265e42(0x1d2),'selector':{'appCode':_0x30118c[_0x265e42(0x1dc)],'roleId':_0x47b349,'roleName':_0xdc72a4[_0x265e42(0x1db)]},'before':projectRole(_0xdc72a4),'after':projectRole({..._0xdc72a4,..._0x5a86ca['roleName']!==undefined?{'roleName':_0x5a86ca[_0x265e42(0x1db)]}:{},..._0x5a86ca['remark']!==undefined?{'remark':_0x5a86ca['remark']}:{}}),'dryRun':!![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},{'method':_0x265e42(0x1d7),'url':UPDATE_PATH});},async 'execute'(_0x1f15b5){const _0x42b274=a177_0xcf0843,_0x2e10ea=_0x1f15b5['num']('id'),_0x1e4af4=readPatch(_0x1f15b5),_0x33b693=await getRoleById(_0x1f15b5[_0x42b274(0x1dc)],_0x2e10ea);assertCustomRole(_0x33b693,'update'),await updateAppRole({'id':_0x2e10ea,'appCode':_0x1f15b5['appCode'],..._0x1e4af4[_0x42b274(0x1db)]!==undefined?{'roleName':_0x1e4af4['roleName']}:{},..._0x1e4af4['remark']!==undefined?{'remark':_0x1e4af4['remark']}:{}});const _0x396233=await getRoleById(_0x1f15b5[_0x42b274(0x1dc)],_0x2e10ea);return{'ok':!![],'data':{'operation':'update','selector':{'appCode':_0x1f15b5[_0x42b274(0x1dc)],'roleId':_0x2e10ea,'roleName':_0x396233[_0x42b274(0x1db)]},'before':projectRole(_0x33b693),'after':projectRole(_0x396233),'dryRun':![],'backend':{'method':_0x42b274(0x1d7),'path':UPDATE_PATH},'warnings':[]},'message':_0x42b274(0x1ce)+_0x396233['roleName']+'\x20(id='+_0x2e10ea+')'};}};
@@ -1 +1 @@
1
- const a170_0x53ee88=a170_0x4a16;function a170_0x549f(){const _0x27255b=['2IDlZyn','4332pcUITH','POST','122868swHfLd','657763BZdCUZ','1342530hoxQDv','75somHHd','14888nFawYm','roleName','47368hQPozS','Added\x20user\x20','Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','559cAInMk','\x20already\x20in\x20role\x20','\x20to\x20role\x20','10mIlJcj','appCode','3630BiuUwL','selector','5160331HoZvYr','userId','user-add','2177kOJacY','role'];a170_0x549f=function(){return _0x27255b;};return a170_0x549f();}(function(_0x556795,_0x119359){const _0x9015df=a170_0x4a16,_0x2ce141=_0x556795();while(!![]){try{const _0x365bc5=-parseInt(_0x9015df(0xf7))/0x1*(-parseInt(_0x9015df(0xf3))/0x2)+parseInt(_0x9015df(0xe1))/0x3*(-parseInt(_0x9015df(0xe4))/0x4)+parseInt(_0x9015df(0xec))/0x5*(parseInt(_0x9015df(0xf4))/0x6)+-parseInt(_0x9015df(0xf1))/0x7*(parseInt(_0x9015df(0xe2))/0x8)+parseInt(_0x9015df(0xf8))/0x9+parseInt(_0x9015df(0xea))/0xa*(parseInt(_0x9015df(0xee))/0xb)+parseInt(_0x9015df(0xf6))/0xc*(-parseInt(_0x9015df(0xe7))/0xd);if(_0x365bc5===_0x119359)break;else _0x2ce141['push'](_0x2ce141['shift']());}catch(_0x4c3d2a){_0x2ce141['push'](_0x2ce141['shift']());}}}(a170_0x549f,0x76708));function a170_0x4a16(_0x31d269,_0x4d3bcc){_0x31d269=_0x31d269-0xe1;const _0x549fd7=a170_0x549f();let _0x4a1608=_0x549fd7[_0x31d269];return _0x4a1608;}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 roleUserAdd={'service':a170_0x53ee88(0xf2),'command':a170_0x53ee88(0xf0),'description':a170_0x53ee88(0xe6),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x126574){const _0x4e7f60=a170_0x53ee88,{mutation:_0xd64f28}=await prepareUserMutation(_0x126574,_0x4e7f60(0xf0),!![]);return asDryRunResult(_0xd64f28,{'method':_0x4e7f60(0xf5),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x7bb7c){const _0x177826=a170_0x53ee88,{roleList:_0x96ba3,mutation:_0x55ba78,changed:_0x56cdd0}=await prepareUserMutation(_0x7bb7c,_0x177826(0xf0),![]);return _0x56cdd0&&await updateRoleUsers(_0x7bb7c[_0x177826(0xeb)],_0x96ba3),{'ok':!![],'data':_0x55ba78,'message':_0x56cdd0?_0x177826(0xe5)+_0x55ba78[_0x177826(0xed)][_0x177826(0xef)]+_0x177826(0xe9)+_0x55ba78['selector']['roleName']:'No\x20change:\x20user\x20'+_0x55ba78[_0x177826(0xed)][_0x177826(0xef)]+_0x177826(0xe8)+_0x55ba78[_0x177826(0xed)][_0x177826(0xe3)]};}};
1
+ const a178_0x46694c=a178_0x4e5d;(function(_0x4ba0f4,_0x3fbceb){const _0x4071d9=a178_0x4e5d,_0x14c912=_0x4ba0f4();while(!![]){try{const _0x35e05a=parseInt(_0x4071d9(0x152))/0x1*(-parseInt(_0x4071d9(0x156))/0x2)+-parseInt(_0x4071d9(0x143))/0x3*(-parseInt(_0x4071d9(0x14c))/0x4)+-parseInt(_0x4071d9(0x14a))/0x5+parseInt(_0x4071d9(0x149))/0x6*(-parseInt(_0x4071d9(0x153))/0x7)+-parseInt(_0x4071d9(0x148))/0x8*(parseInt(_0x4071d9(0x154))/0x9)+-parseInt(_0x4071d9(0x147))/0xa+parseInt(_0x4071d9(0x151))/0xb;if(_0x35e05a===_0x3fbceb)break;else _0x14c912['push'](_0x14c912['shift']());}catch(_0x1a6747){_0x14c912['push'](_0x14c912['shift']());}}}(a178_0x4c14,0xbbcb5));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a178_0x4e5d(_0x10d400,_0x4e44de){_0x10d400=_0x10d400-0x141;const _0x4c1485=a178_0x4c14();let _0x4e5d48=_0x4c1485[_0x10d400];return _0x4e5d48;}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_0x4c14(){const _0x23a77e=['\x20already\x20in\x20role\x20','6188RCcIhC','user-add','Added\x20user\x20','userId','roleName','56604042DgJvws','2ekinVj','28tiNjOE','8271TOlZwn','\x20to\x20role\x20','1001750NitlyK','POST','Add\x20a\x20user\x20to\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','selector','93RsDmvO','No\x20change:\x20user\x20','high-risk-write','appCode','12673660AYNePN','8632tYMThC','1011198mZxLGQ','2448625jcHsob'];a178_0x4c14=function(){return _0x23a77e;};return a178_0x4c14();}export const roleUserAdd={'service':'role','command':a178_0x46694c(0x14d),'description':a178_0x46694c(0x141),'risk':a178_0x46694c(0x145),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x15dc21){const _0x5dcdab=a178_0x46694c,{mutation:_0x943770}=await prepareUserMutation(_0x15dc21,_0x5dcdab(0x14d),!![]);return asDryRunResult(_0x943770,{'method':_0x5dcdab(0x157),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x2e2e8d){const _0x5a07a8=a178_0x46694c,{roleList:_0x20e7c1,mutation:_0x158078,changed:_0x4daf78}=await prepareUserMutation(_0x2e2e8d,_0x5a07a8(0x14d),![]);return _0x4daf78&&await updateRoleUsers(_0x2e2e8d[_0x5a07a8(0x146)],_0x20e7c1),{'ok':!![],'data':_0x158078,'message':_0x4daf78?_0x5a07a8(0x14e)+_0x158078[_0x5a07a8(0x142)]['userId']+_0x5a07a8(0x155)+_0x158078[_0x5a07a8(0x142)]['roleName']:_0x5a07a8(0x144)+_0x158078[_0x5a07a8(0x142)][_0x5a07a8(0x14f)]+_0x5a07a8(0x14b)+_0x158078[_0x5a07a8(0x142)][_0x5a07a8(0x150)]};}};
@@ -1 +1 @@
1
- const a171_0x54fcab=a171_0xd8f5;(function(_0xec5e10,_0x10ef8f){const _0x1ee03a=a171_0xd8f5,_0x35c93b=_0xec5e10();while(!![]){try{const _0x53377b=parseInt(_0x1ee03a(0x177))/0x1*(parseInt(_0x1ee03a(0x174))/0x2)+-parseInt(_0x1ee03a(0x173))/0x3*(parseInt(_0x1ee03a(0x183))/0x4)+-parseInt(_0x1ee03a(0x179))/0x5*(-parseInt(_0x1ee03a(0x17f))/0x6)+-parseInt(_0x1ee03a(0x180))/0x7+parseInt(_0x1ee03a(0x185))/0x8+parseInt(_0x1ee03a(0x17c))/0x9*(-parseInt(_0x1ee03a(0x189))/0xa)+parseInt(_0x1ee03a(0x17e))/0xb;if(_0x53377b===_0x10ef8f)break;else _0x35c93b['push'](_0x35c93b['shift']());}catch(_0x9386e2){_0x35c93b['push'](_0x35c93b['shift']());}}}(a171_0x3371,0xa8068));import{updateRoleUsers}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a171_0xd8f5(_0x28911e,_0x30ec5e){_0x28911e=_0x28911e-0x173;const _0x337161=a171_0x3371();let _0xd8f535=_0x337161[_0x28911e];return _0xd8f535;}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_0x54fcab(0x184),'description':a171_0x54fcab(0x181),'risk':a171_0x54fcab(0x182),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x2c6356){const _0x1834a5=a171_0x54fcab,{mutation:_0x2630e5}=await prepareUserMutation(_0x2c6356,_0x1834a5(0x184),!![]);return asDryRunResult(_0x2630e5,{'method':_0x1834a5(0x17b),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x5f36fc){const _0x51d734=a171_0x54fcab,{roleList:_0x46d70d,mutation:_0x215dcf,changed:_0x5c5e85}=await prepareUserMutation(_0x5f36fc,_0x51d734(0x184),![]);return _0x5c5e85&&await updateRoleUsers(_0x5f36fc[_0x51d734(0x187)],_0x46d70d),{'ok':!![],'data':_0x215dcf,'message':_0x5c5e85?_0x51d734(0x175)+_0x215dcf['selector'][_0x51d734(0x17a)]+_0x51d734(0x176)+_0x215dcf[_0x51d734(0x188)][_0x51d734(0x186)]:_0x51d734(0x178)+_0x215dcf['selector'][_0x51d734(0x17a)]+_0x51d734(0x17d)+_0x215dcf[_0x51d734(0x188)][_0x51d734(0x186)]};}};function a171_0x3371(){const _0x49337d=['31326NhOMno','4751754gXpqtT','Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','high-risk-write','4653892RtWrRQ','user-remove','1529008VRdkJz','roleName','appCode','selector','12990HlfsGR','3YAchus','1010736RHArgg','Removed\x20user\x20','\x20from\x20role\x20','2WnjVxX','No\x20change:\x20user\x20','355icjWtX','userId','POST','4878SGsHEq','\x20not\x20in\x20role\x20','18282352ESrfRy'];a171_0x3371=function(){return _0x49337d;};return a171_0x3371();}
1
+ const a179_0x3e6df3=a179_0x2cac;function a179_0x3b54(){const _0x391bb2=['userId','role','user-remove','POST','42OuJsYr','506753uFXpCM','selector','139642klLohl','558593xsVRwX','appCode','No\x20change:\x20user\x20','Remove\x20a\x20user\x20from\x20a\x20role\x20(internal\x20merge\x20+\x20anti-drift);\x20requires\x20--yes','22519953fxKods','10584176vbcOsZ','90939LkQgPz','roleName','226030wWsboK','52nyXuxG','\x20not\x20in\x20role\x20'];a179_0x3b54=function(){return _0x391bb2;};return a179_0x3b54();}function a179_0x2cac(_0xefdd2b,_0x362c00){_0xefdd2b=_0xefdd2b-0x136;const _0x3b54f1=a179_0x3b54();let _0x2caca2=_0x3b54f1[_0xefdd2b];return _0x2caca2;}(function(_0x26a9ae,_0x1bee9a){const _0x33dccb=a179_0x2cac,_0x19f28b=_0x26a9ae();while(!![]){try{const _0x184064=-parseInt(_0x33dccb(0x139))/0x1+parseInt(_0x33dccb(0x13b))/0x2+-parseInt(_0x33dccb(0x142))/0x3*(-parseInt(_0x33dccb(0x145))/0x4)+parseInt(_0x33dccb(0x144))/0x5*(-parseInt(_0x33dccb(0x138))/0x6)+-parseInt(_0x33dccb(0x13c))/0x7+-parseInt(_0x33dccb(0x141))/0x8+parseInt(_0x33dccb(0x140))/0x9;if(_0x184064===_0x1bee9a)break;else _0x19f28b['push'](_0x19f28b['shift']());}catch(_0x4b8f8d){_0x19f28b['push'](_0x19f28b['shift']());}}}(a179_0x3b54,0xb4afb));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':a179_0x3e6df3(0x148),'command':a179_0x3e6df3(0x136),'description':a179_0x3e6df3(0x13f),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x21a485){const _0x36aa82=a179_0x3e6df3,{mutation:_0x35ad31}=await prepareUserMutation(_0x21a485,_0x36aa82(0x136),!![]);return asDryRunResult(_0x35ad31,{'method':_0x36aa82(0x137),'url':UPDATE_USER_LIST_PATH});},async 'execute'(_0x349a0e){const _0x1e74a7=a179_0x3e6df3,{roleList:_0x4a6a12,mutation:_0x1013e4,changed:_0x18079d}=await prepareUserMutation(_0x349a0e,_0x1e74a7(0x136),![]);return _0x18079d&&await updateRoleUsers(_0x349a0e[_0x1e74a7(0x13d)],_0x4a6a12),{'ok':!![],'data':_0x1013e4,'message':_0x18079d?'Removed\x20user\x20'+_0x1013e4[_0x1e74a7(0x13a)][_0x1e74a7(0x147)]+'\x20from\x20role\x20'+_0x1013e4[_0x1e74a7(0x13a)]['roleName']:_0x1e74a7(0x13e)+_0x1013e4[_0x1e74a7(0x13a)]['userId']+_0x1e74a7(0x146)+_0x1013e4[_0x1e74a7(0x13a)][_0x1e74a7(0x143)]};}};
@@ -1 +1 @@
1
- function a172_0x19ba(){const _0x1e3336=['userId','6hEmrNr','2860767bpzUNH','2591729awGMCi','username','704918KHaNfB','user-resolve','1228875SrfEHH','read','nickname','2827770ZnQVQy','str','name','flagMissing','5757544ZhWCbP','1074188ReRAEN','6jcOOcO','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','2tAbQew'];a172_0x19ba=function(){return _0x1e3336;};return a172_0x19ba();}const a172_0x5f2e45=a172_0xf736;(function(_0x3502a2,_0x2c6a71){const _0x288f0e=a172_0xf736,_0x367a21=_0x3502a2();while(!![]){try{const _0x110fe8=parseInt(_0x288f0e(0x1af))/0x1*(parseInt(_0x288f0e(0x1b5))/0x2)+parseInt(_0x288f0e(0x1ad))/0x3*(parseInt(_0x288f0e(0x1ac))/0x4)+parseInt(_0x288f0e(0x1b7))/0x5+parseInt(_0x288f0e(0x1b1))/0x6*(-parseInt(_0x288f0e(0x1b3))/0x7)+-parseInt(_0x288f0e(0x1ab))/0x8+parseInt(_0x288f0e(0x1b2))/0x9+-parseInt(_0x288f0e(0x1ba))/0xa;if(_0x110fe8===_0x2c6a71)break;else _0x367a21['push'](_0x367a21['shift']());}catch(_0x24dc9c){_0x367a21['push'](_0x367a21['shift']());}}}(a172_0x19ba,0x69b25));function a172_0xf736(_0xc2cfc0,_0xca1826){_0xc2cfc0=_0xc2cfc0-0x1ab;const _0x19ba04=a172_0x19ba();let _0xf736e8=_0x19ba04[_0xc2cfc0];return _0xf736e8;}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':'role','command':a172_0x5f2e45(0x1b6),'description':a172_0x5f2e45(0x1ae),'risk':a172_0x5f2e45(0x1b8),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x37e1ca){const _0x2964bb=a172_0x5f2e45;if(!_0x37e1ca['str']('name')['trim']())throw CliErrors[_0x2964bb(0x1bd)](_0x2964bb(0x1bc),'Pass\x20--name\x20<nickname|username>.');},async 'execute'(_0x1d5abe){const _0x592d95=a172_0x5f2e45,_0x3805e3=_0x1d5abe[_0x592d95(0x1bb)](_0x592d95(0x1bc))['trim'](),_0x43a63e=await resolveUserRef(_0x3805e3);return{'ok':!![],'data':{'user':{'userId':_0x43a63e[_0x592d95(0x1b0)],'username':_0x43a63e[_0x592d95(0x1b4)],'nickname':_0x43a63e[_0x592d95(0x1b9)],'matchedBy':_0x43a63e['matchedBy']}},'message':'Resolved\x20\x22'+_0x3805e3+'\x22\x20→\x20userId\x20'+_0x43a63e[_0x592d95(0x1b0)]};}};
1
+ function a180_0x36c7(_0x27136e,_0x6da5b5){_0x27136e=_0x27136e-0xca;const _0x350875=a180_0x3508();let _0x36c760=_0x350875[_0x27136e];return _0x36c760;}const a180_0x562d85=a180_0x36c7;(function(_0x2bdaa8,_0x1cfda1){const _0x246604=a180_0x36c7,_0x351fad=_0x2bdaa8();while(!![]){try{const _0x44643b=parseInt(_0x246604(0xd5))/0x1*(parseInt(_0x246604(0xdd))/0x2)+parseInt(_0x246604(0xcb))/0x3*(parseInt(_0x246604(0xd9))/0x4)+parseInt(_0x246604(0xd7))/0x5+parseInt(_0x246604(0xdc))/0x6*(-parseInt(_0x246604(0xd6))/0x7)+-parseInt(_0x246604(0xd3))/0x8+-parseInt(_0x246604(0xd2))/0x9+parseInt(_0x246604(0xdb))/0xa;if(_0x44643b===_0x1cfda1)break;else _0x351fad['push'](_0x351fad['shift']());}catch(_0x3f8d55){_0x351fad['push'](_0x351fad['shift']());}}}(a180_0x3508,0x859b7));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_0x3508(){const _0x5d0788=['Pass\x20--name\x20<nickname|username>.','username','7773966GxdxGK','2453760jpIRcG','\x22\x20→\x20userId\x20','2swJQJU','131593CHsgWn','4110880Trsxte','str','3812NsPBoy','trim','3926720giRbnc','78YJjuip','225044zqzZil','user-resolve','matchedBy','role','1644MxMtEk','userId','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','name','read'];a180_0x3508=function(){return _0x5d0788;};return a180_0x3508();}export const roleUserResolve={'service':a180_0x562d85(0xca),'command':a180_0x562d85(0xde),'description':a180_0x562d85(0xcd),'risk':a180_0x562d85(0xcf),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1bc6e4){const _0xf2a094=a180_0x562d85;if(!_0x1bc6e4[_0xf2a094(0xd8)](_0xf2a094(0xce))[_0xf2a094(0xda)]())throw CliErrors['flagMissing']('name',_0xf2a094(0xd0));},async 'execute'(_0x3f37e4){const _0x240a50=a180_0x562d85,_0x1274c2=_0x3f37e4[_0x240a50(0xd8)](_0x240a50(0xce))[_0x240a50(0xda)](),_0x5c0388=await resolveUserRef(_0x1274c2);return{'ok':!![],'data':{'user':{'userId':_0x5c0388['userId'],'username':_0x5c0388[_0x240a50(0xd1)],'nickname':_0x5c0388['nickname'],'matchedBy':_0x5c0388[_0x240a50(0xdf)]}},'message':'Resolved\x20\x22'+_0x1274c2+_0x240a50(0xd4)+_0x5c0388[_0x240a50(0xcc)]};}};
@@ -1 +1 @@
1
- const a173_0x54a909=a173_0x349c;(function(_0x214b82,_0xc6898c){const _0x56d8b3=a173_0x349c,_0x584142=_0x214b82();while(!![]){try{const _0x477594=parseInt(_0x56d8b3(0xc1))/0x1+-parseInt(_0x56d8b3(0xae))/0x2*(-parseInt(_0x56d8b3(0xb4))/0x3)+parseInt(_0x56d8b3(0xd6))/0x4+-parseInt(_0x56d8b3(0xe4))/0x5+parseInt(_0x56d8b3(0xd8))/0x6+-parseInt(_0x56d8b3(0xcd))/0x7+parseInt(_0x56d8b3(0xc3))/0x8*(parseInt(_0x56d8b3(0xda))/0x9);if(_0x477594===_0xc6898c)break;else _0x584142['push'](_0x584142['shift']());}catch(_0x52928b){_0x584142['push'](_0x584142['shift']());}}}(a173_0x5d51,0x88f38));function a173_0x349c(_0xa27ee0,_0x58937b){_0xa27ee0=_0xa27ee0-0xab;const _0x5d5118=a173_0x5d51();let _0x349c94=_0x5d5118[_0xa27ee0];return _0x349c94;}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(['start',a173_0x54a909(0xc7)]);function readPackageScripts(_0x18ddd6){const _0xd27841=a173_0x54a909,_0x433598=resolve(_0x18ddd6,'package.json');if(!existsSync(_0x433598))return null;try{const _0x2d814d=JSON[_0xd27841(0xca)](readFileSync(_0x433598,_0xd27841(0xe2)));return _0x2d814d[_0xd27841(0xd3)]??{};}catch{return null;}}function detectPackageManager(_0x333539){const _0xa9bad5=a173_0x54a909;if(existsSync(resolve(_0x333539,'bun.lockb'))||existsSync(resolve(_0x333539,_0xa9bad5(0xc5))))return _0xa9bad5(0xd9);if(existsSync(resolve(_0x333539,_0xa9bad5(0xb1))))return _0xa9bad5(0xb9);if(existsSync(resolve(_0x333539,_0xa9bad5(0xc2))))return _0xa9bad5(0xbd);return'npm';}function a173_0x5d51(){const _0xb2dc37=['42984oZgTLO','yarn.lock','1074760IQVTFw','belowMinimum','bun.lock','watch','dev','join','\x20run\x20preview','parse','\x22\x20not\x20found\x20in\x20package.json.','.bin','620158BXWDuV','vite\x20preview\x20exited\x20with\x20code\x20','run','\x20\x20EXAMPLES','length','\x20run\x20build','scripts','has','error','711428IXleHa','\x20\x20\x20\x20','3430578omNBNe','bun','45kGFEoL','\x20run\x20preview\x20--watch','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','Script\x20\x22','boolean','keys','Available:\x20','log','utf-8','No\x20package.json\x20found\x20in\x20current\x20directory.','5398985GfRSLC','\x0a\x20\x20Usage:\x20','all','close','Script\x20name\x20defined\x20in\x20package.json','88338cRZRvy','cwd','build','pnpm-lock.yaml','\x20run\x20','slice','18IMMQlO','needsUpgrade','inherit','validation','push','pnpm','preview','node_modules','\x0a\x20\x20Available\x20scripts:\x0a','yarn','args','No\x20scripts\x20defined\x20in\x20package.json.','\x20exited\x20with\x20code\x20'];a173_0x5d51=function(){return _0xb2dc37;};return a173_0x5d51();}async function versionCheck(_0x4f4f75){const _0x223a46=a173_0x54a909,_0x504467=await checkCliVersion();(_0x504467[_0x223a46(0xb5)]||_0x504467[_0x223a46(0xc4)])&&(printCliUpgradeWarning(_0x504467),assertCliVersionSupported(_0x504467));const _0x3582e3=await checkSdkVersion(_0x4f4f75);if(_0x3582e3[_0x223a46(0xb5)])printSdkUpgradeWarning(_0x3582e3);}function spawnScript(_0x5513e9,_0x18d30d,_0x3c5946,_0x5c119f){return new Promise((_0x38484c,_0xe09456)=>{const _0xcbc8a6=a173_0x349c,_0x288278=[_0xcbc8a6(0xcf),_0x18d30d,..._0x3c5946],_0x58b6b5=spawn(_0x5513e9,_0x288278,{'cwd':_0x5c119f,'stdio':_0xcbc8a6(0xb6),'shell':!![],'env':{...process.env,'PATH':''+join(_0x5c119f,_0xcbc8a6(0xbb),'.bin')+delimiter+process.env.PATH}});_0x58b6b5['on']('close',_0x32a184=>{const _0x18b581=_0xcbc8a6;if(_0x32a184===0x0||_0x32a184===null)_0x38484c();else _0xe09456(new Error(_0x5513e9+_0x18b581(0xb2)+_0x18d30d+_0x18b581(0xc0)+_0x32a184));}),_0x58b6b5['on'](_0xcbc8a6(0xd5),_0xe09456);});}function spawnViteBuildWatch(_0x3e3eaf){return new Promise((_0x2b1d4b,_0x559c52)=>{const _0xf853db=a173_0x349c,_0x1b0ee6=spawn('vite',[_0xf853db(0xb0),'--watch'],{'cwd':_0x3e3eaf,'stdio':_0xf853db(0xb6),'shell':!![],'env':{...process.env,'PATH':''+join(_0x3e3eaf,_0xf853db(0xbb),_0xf853db(0xcc))+delimiter+process.env.PATH}});_0x1b0ee6['on'](_0xf853db(0xac),_0x2c4cf6=>{const _0xf8149c=_0xf853db;if(_0x2c4cf6===0x0||_0x2c4cf6===null)_0x2b1d4b();else _0x559c52(new Error(_0xf8149c(0xdc)+_0x2c4cf6));}),_0x1b0ee6['on'](_0xf853db(0xd5),_0x559c52);});}function spawnVitePreview(_0x580986){return new Promise((_0x1bd58d,_0x29b133)=>{const _0x4737c8=a173_0x349c,_0x4f269b=spawn('vite',['preview'],{'cwd':_0x580986,'stdio':_0x4737c8(0xb6),'shell':!![],'env':{...process.env,'PATH':''+join(_0x580986,_0x4737c8(0xbb),_0x4737c8(0xcc))+delimiter+process.env.PATH}});_0x4f269b['on'](_0x4737c8(0xac),_0x1ac896=>{const _0x4efc83=_0x4737c8;if(_0x1ac896===0x0||_0x1ac896===null)_0x1bd58d();else _0x29b133(new Error(_0x4efc83(0xce)+_0x1ac896));}),_0x4f269b['on'](_0x4737c8(0xd5),_0x29b133);});}const runFlags=[{'name':a173_0x54a909(0xc6),'type':a173_0x54a909(0xde),'description':'Enable\x20watch\x20mode\x20for\x20preview','default':![]}];export const runDefinition={'service':a173_0x54a909(0xcf),'command':a173_0x54a909(0xcf),'description':'Run\x20a\x20package.json\x20script','risk':'high-risk-write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'script','description':a173_0x54a909(0xad),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x567ca3=a173_0x54a909,_0x1d5e63=[];return _0x1d5e63[_0x567ca3(0xb8)](_0x567ca3(0xd0)),_0x1d5e63['push'](_0x567ca3(0xd7)+CLI_BIN_NAME+'\x20run\x20start'),_0x1d5e63['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x567ca3(0xd2)),_0x1d5e63[_0x567ca3(0xb8)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x567ca3(0xc9)),_0x1d5e63['push'](_0x567ca3(0xd7)+CLI_BIN_NAME+_0x567ca3(0xdb)),_0x1d5e63[_0x567ca3(0xc8)]('\x0a');},async 'execute'(_0x5ae788){const _0x573166=a173_0x54a909,_0x28099f=process[_0x573166(0xaf)](),_0x461350=_0x5ae788[_0x573166(0xbe)][0x0],_0x1fb6c5=_0x5ae788['args'][_0x573166(0xb3)](0x1),_0x328012=readPackageScripts(_0x28099f);if(!_0x328012)throw CliErrors['validation'](_0x573166(0xe3));if(!_0x461350){const _0x310081=Object['keys'](_0x328012);if(_0x310081[_0x573166(0xd1)]===0x0)console[_0x573166(0xe1)](_0x573166(0xbf));else{console['log'](_0x573166(0xbc));for(const _0x2e9650 of _0x310081){console['log'](_0x573166(0xd7)+_0x2e9650);}console[_0x573166(0xe1)](_0x573166(0xe5)+CLI_BIN_NAME+'\x20run\x20<script>\x0a');}return{'ok':!![]};}if(!_0x328012[_0x461350])throw CliErrors[_0x573166(0xb7)](_0x573166(0xdd)+_0x461350+_0x573166(0xcb),_0x573166(0xe0)+(Object[_0x573166(0xdf)](_0x328012)['join'](',\x20')||'(none)'));const _0x3c6f41=detectPackageManager(_0x28099f);VERSION_CHECK_SCRIPTS[_0x573166(0xd4)](_0x461350)&&await versionCheck(_0x28099f);if(_0x461350===_0x573166(0xba)&&_0x5ae788['bool']('watch'))return await Promise[_0x573166(0xab)]([spawnViteBuildWatch(_0x28099f),spawnVitePreview(_0x28099f)]),{'ok':!![]};return await spawnScript(_0x3c6f41,_0x461350,_0x1fb6c5,_0x28099f),{'ok':!![]};}};
1
+ function a181_0x4d79(){const _0x146bf3=['No\x20package.json\x20found\x20in\x20current\x20directory.','slice','Script\x20\x22','has','push','utf-8','all','needsUpgrade','validation','\x20run\x20preview','\x20run\x20<script>\x0a','bun.lockb','Available:\x20','log','script','1863992NkCeFk','bool','vite','watch','587993lheucY','\x20run\x20build','vite\x20preview\x20exited\x20with\x20code\x20','run','inherit','error','6211890WFkNci','\x20\x20\x20\x20','cwd','args','pnpm-lock.yaml','node_modules','dev','start','30wVybYy','3qUtXoF','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','\x22\x20not\x20found\x20in\x20package.json.','--watch','boolean','\x20exited\x20with\x20code\x20','\x20run\x20start','yarn.lock','2350224uHkdSC','\x20run\x20','\x0a\x20\x20Available\x20scripts:\x0a','.bin','560998SAvRHH','close','Script\x20name\x20defined\x20in\x20package.json','Enable\x20watch\x20mode\x20for\x20preview','package.json','belowMinimum','\x20run\x20preview\x20--watch','keys','2398251RVyMON','bun.lock','preview','\x0a\x20\x20Usage:\x20','3065400CEFXwC','npm'];a181_0x4d79=function(){return _0x146bf3;};return a181_0x4d79();}const a181_0x44721e=a181_0x396f;(function(_0x111389,_0x1f44df){const _0x236c23=a181_0x396f,_0xd137d=_0x111389();while(!![]){try{const _0x47cac9=-parseInt(_0x236c23(0x175))/0x1*(-parseInt(_0x236c23(0x181))/0x2)+-parseInt(_0x236c23(0x189))/0x3+parseInt(_0x236c23(0x17d))/0x4+-parseInt(_0x236c23(0x18d))/0x5+-parseInt(_0x236c23(0x174))/0x6*(parseInt(_0x236c23(0x1a2))/0x7)+parseInt(_0x236c23(0x19e))/0x8+parseInt(_0x236c23(0x1a8))/0x9;if(_0x47cac9===_0x1f44df)break;else _0xd137d['push'](_0xd137d['shift']());}catch(_0x59241d){_0xd137d['push'](_0xd137d['shift']());}}}(a181_0x4d79,0x7ee5a));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';function a181_0x396f(_0x37b3be,_0x3ae38b){_0x37b3be=_0x37b3be-0x171;const _0x4d7938=a181_0x4d79();let _0x396f49=_0x4d7938[_0x37b3be];return _0x396f49;}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_0x44721e(0x173),a181_0x44721e(0x172)]);function readPackageScripts(_0x2ba4b2){const _0x26c430=a181_0x44721e,_0x1c14b0=resolve(_0x2ba4b2,_0x26c430(0x185));if(!existsSync(_0x1c14b0))return null;try{const _0x57b514=JSON['parse'](readFileSync(_0x1c14b0,_0x26c430(0x194)));return _0x57b514['scripts']??{};}catch{return null;}}function detectPackageManager(_0x1b6e58){const _0x31f5fb=a181_0x44721e;if(existsSync(resolve(_0x1b6e58,_0x31f5fb(0x19a)))||existsSync(resolve(_0x1b6e58,_0x31f5fb(0x18a))))return'bun';if(existsSync(resolve(_0x1b6e58,_0x31f5fb(0x1ac))))return'pnpm';if(existsSync(resolve(_0x1b6e58,_0x31f5fb(0x17c))))return'yarn';return _0x31f5fb(0x18e);}async function versionCheck(_0x458eff){const _0x4e9352=a181_0x44721e,_0x178285=await checkCliVersion();(_0x178285[_0x4e9352(0x196)]||_0x178285[_0x4e9352(0x186)])&&(printCliUpgradeWarning(_0x178285),assertCliVersionSupported(_0x178285));const _0x6c2a15=await checkSdkVersion(_0x458eff);if(_0x6c2a15[_0x4e9352(0x196)])printSdkUpgradeWarning(_0x6c2a15);}function spawnScript(_0x37ab10,_0x151ca7,_0x8d068f,_0x58e1a5){return new Promise((_0x3618b0,_0xf7f5b6)=>{const _0x137713=a181_0x396f,_0x286ef7=['run',_0x151ca7,..._0x8d068f],_0x3610be=spawn(_0x37ab10,_0x286ef7,{'cwd':_0x58e1a5,'stdio':_0x137713(0x1a6),'shell':!![],'env':{...process.env,'PATH':''+join(_0x58e1a5,_0x137713(0x171),'.bin')+delimiter+process.env.PATH}});_0x3610be['on']('close',_0x136b40=>{const _0x5e6473=_0x137713;if(_0x136b40===0x0||_0x136b40===null)_0x3618b0();else _0xf7f5b6(new Error(_0x37ab10+_0x5e6473(0x17e)+_0x151ca7+_0x5e6473(0x17a)+_0x136b40));}),_0x3610be['on'](_0x137713(0x1a7),_0xf7f5b6);});}function spawnViteBuildWatch(_0x23bf13){return new Promise((_0x145392,_0x556d43)=>{const _0x523edc=a181_0x396f,_0x49ec2c=spawn(_0x523edc(0x1a0),['build',_0x523edc(0x178)],{'cwd':_0x23bf13,'stdio':_0x523edc(0x1a6),'shell':!![],'env':{...process.env,'PATH':''+join(_0x23bf13,_0x523edc(0x171),_0x523edc(0x180))+delimiter+process.env.PATH}});_0x49ec2c['on'](_0x523edc(0x182),_0x39074b=>{const _0x20652a=_0x523edc;if(_0x39074b===0x0||_0x39074b===null)_0x145392();else _0x556d43(new Error(_0x20652a(0x176)+_0x39074b));}),_0x49ec2c['on'](_0x523edc(0x1a7),_0x556d43);});}function spawnVitePreview(_0xb57ce1){return new Promise((_0x261f99,_0x1f2dc1)=>{const _0x581e98=a181_0x396f,_0x5f183a=spawn(_0x581e98(0x1a0),[_0x581e98(0x18b)],{'cwd':_0xb57ce1,'stdio':_0x581e98(0x1a6),'shell':!![],'env':{...process.env,'PATH':''+join(_0xb57ce1,_0x581e98(0x171),_0x581e98(0x180))+delimiter+process.env.PATH}});_0x5f183a['on'](_0x581e98(0x182),_0x103b8c=>{const _0x3d40b2=_0x581e98;if(_0x103b8c===0x0||_0x103b8c===null)_0x261f99();else _0x1f2dc1(new Error(_0x3d40b2(0x1a4)+_0x103b8c));}),_0x5f183a['on'](_0x581e98(0x1a7),_0x1f2dc1);});}const runFlags=[{'name':a181_0x44721e(0x1a1),'type':a181_0x44721e(0x179),'description':a181_0x44721e(0x184),'default':![]}];export const runDefinition={'service':a181_0x44721e(0x1a5),'command':a181_0x44721e(0x1a5),'description':'Run\x20a\x20package.json\x20script','risk':'high-risk-write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a181_0x44721e(0x19d),'description':a181_0x44721e(0x183),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x628b5f=a181_0x44721e,_0x1f170e=[];return _0x1f170e[_0x628b5f(0x193)]('\x20\x20EXAMPLES'),_0x1f170e[_0x628b5f(0x193)](_0x628b5f(0x1a9)+CLI_BIN_NAME+_0x628b5f(0x17b)),_0x1f170e[_0x628b5f(0x193)](_0x628b5f(0x1a9)+CLI_BIN_NAME+_0x628b5f(0x1a3)),_0x1f170e[_0x628b5f(0x193)](_0x628b5f(0x1a9)+CLI_BIN_NAME+_0x628b5f(0x198)),_0x1f170e[_0x628b5f(0x193)](_0x628b5f(0x1a9)+CLI_BIN_NAME+_0x628b5f(0x187)),_0x1f170e['join']('\x0a');},async 'execute'(_0x3d015b){const _0xbd6d2e=a181_0x44721e,_0x250fd7=process[_0xbd6d2e(0x1aa)](),_0x759b56=_0x3d015b[_0xbd6d2e(0x1ab)][0x0],_0x52b9f0=_0x3d015b[_0xbd6d2e(0x1ab)][_0xbd6d2e(0x190)](0x1),_0x1e9e34=readPackageScripts(_0x250fd7);if(!_0x1e9e34)throw CliErrors[_0xbd6d2e(0x197)](_0xbd6d2e(0x18f));if(!_0x759b56){const _0xad8462=Object['keys'](_0x1e9e34);if(_0xad8462['length']===0x0)console[_0xbd6d2e(0x19c)]('No\x20scripts\x20defined\x20in\x20package.json.');else{console[_0xbd6d2e(0x19c)](_0xbd6d2e(0x17f));for(const _0x426f71 of _0xad8462){console[_0xbd6d2e(0x19c)]('\x20\x20\x20\x20'+_0x426f71);}console[_0xbd6d2e(0x19c)](_0xbd6d2e(0x18c)+CLI_BIN_NAME+_0xbd6d2e(0x199));}return{'ok':!![]};}if(!_0x1e9e34[_0x759b56])throw CliErrors[_0xbd6d2e(0x197)](_0xbd6d2e(0x191)+_0x759b56+_0xbd6d2e(0x177),_0xbd6d2e(0x19b)+(Object[_0xbd6d2e(0x188)](_0x1e9e34)['join'](',\x20')||'(none)'));const _0x8e922d=detectPackageManager(_0x250fd7);VERSION_CHECK_SCRIPTS[_0xbd6d2e(0x192)](_0x759b56)&&await versionCheck(_0x250fd7);if(_0x759b56===_0xbd6d2e(0x18b)&&_0x3d015b[_0xbd6d2e(0x19f)](_0xbd6d2e(0x1a1)))return await Promise[_0xbd6d2e(0x195)]([spawnViteBuildWatch(_0x250fd7),spawnVitePreview(_0x250fd7)]),{'ok':!![]};return await spawnScript(_0x8e922d,_0x759b56,_0x52b9f0,_0x250fd7),{'ok':!![]};}};
@@ -1 +1 @@
1
- const a174_0x58bcba=a174_0x1ffb;(function(_0x3c808f,_0x38b752){const _0x27b360=a174_0x1ffb,_0x24684c=_0x3c808f();while(!![]){try{const _0x40ea7f=-parseInt(_0x27b360(0xc3))/0x1+-parseInt(_0x27b360(0xc1))/0x2*(parseInt(_0x27b360(0xc5))/0x3)+-parseInt(_0x27b360(0xc9))/0x4*(parseInt(_0x27b360(0xce))/0x5)+parseInt(_0x27b360(0xcf))/0x6+parseInt(_0x27b360(0xcb))/0x7*(parseInt(_0x27b360(0xc6))/0x8)+parseInt(_0x27b360(0xca))/0x9+-parseInt(_0x27b360(0xcc))/0xa*(parseInt(_0x27b360(0xcd))/0xb);if(_0x40ea7f===_0x38b752)break;else _0x24684c['push'](_0x24684c['shift']());}catch(_0x21307b){_0x24684c['push'](_0x24684c['shift']());}}}(a174_0x562d,0x18e19));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x142385){const _0x50a676=await buildSchemaPayload();return{'ok':!![],'data':_0x50a676};}function a174_0x562d(){const _0x281302=['json','981gKHpaP','1352064hqMsrg','Export\x20machine-readable\x20command\x20schema\x20(JSON)','read','52SJJhEK','1584891tXBWMa','7SdduHY','2199030dREkqO','11EhZtWP','48295GRAMXM','1166160gvpOum','schema','374YPhqHU','export','30935DDyZez'];a174_0x562d=function(){return _0x281302;};return a174_0x562d();}function a174_0x1ffb(_0x73a4d3,_0x4c0d6c){_0x73a4d3=_0x73a4d3-0xc0;const _0x562d83=a174_0x562d();let _0x1ffbfa=_0x562d83[_0x73a4d3];return _0x1ffbfa;}export const schemaDefinition={'service':a174_0x58bcba(0xc0),'command':a174_0x58bcba(0xc2),'description':a174_0x58bcba(0xc7),'risk':a174_0x58bcba(0xc8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a174_0x58bcba(0xc4),'flags':[],'execute':execute};
1
+ const a182_0x38fff3=a182_0x2cc2;function a182_0x2cc2(_0x2ff946,_0x4aabd7){_0x2ff946=_0x2ff946-0x11e;const _0x282a3a=a182_0x282a();let _0x2cc29c=_0x282a3a[_0x2ff946];return _0x2cc29c;}(function(_0x2f0780,_0x2c192d){const _0x104cf1=a182_0x2cc2,_0x42058c=_0x2f0780();while(!![]){try{const _0x41c70f=-parseInt(_0x104cf1(0x11f))/0x1*(-parseInt(_0x104cf1(0x123))/0x2)+parseInt(_0x104cf1(0x12b))/0x3+-parseInt(_0x104cf1(0x120))/0x4*(-parseInt(_0x104cf1(0x122))/0x5)+parseInt(_0x104cf1(0x129))/0x6*(-parseInt(_0x104cf1(0x12c))/0x7)+parseInt(_0x104cf1(0x11e))/0x8*(parseInt(_0x104cf1(0x125))/0x9)+-parseInt(_0x104cf1(0x128))/0xa*(parseInt(_0x104cf1(0x126))/0xb)+-parseInt(_0x104cf1(0x121))/0xc;if(_0x41c70f===_0x2c192d)break;else _0x42058c['push'](_0x42058c['shift']());}catch(_0x240ba5){_0x42058c['push'](_0x42058c['shift']());}}}(a182_0x282a,0xd6070));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x5f4c90){const _0x4a6806=await buildSchemaPayload();return{'ok':!![],'data':_0x4a6806};}export const schemaDefinition={'service':a182_0x38fff3(0x124),'command':'export','description':a182_0x38fff3(0x12a),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a182_0x38fff3(0x127),'flags':[],'execute':execute};function a182_0x282a(){const _0x5e9327=['20rtRdJc','1152946lQVGjQ','schema','2829051vvLsby','1892bUgpJS','json','43630qwgXAt','1149042XclQFA','Export\x20machine-readable\x20command\x20schema\x20(JSON)','4455786uXjGpl','49XpgNWS','40whLyjo','1WYOdIO','303412PHTjUD','11630412pVUDzk'];a182_0x282a=function(){return _0x5e9327;};return a182_0x282a();}
@@ -1 +1 @@
1
- const a175_0x5c7eb8=a175_0x1e5a;function a175_0x1e5a(_0x1a4447,_0x405a07){_0x1a4447=_0x1a4447-0x115;const _0x26fb81=a175_0x26fb();let _0x1e5ae2=_0x26fb81[_0x1a4447];return _0x1e5ae2;}(function(_0x543e71,_0xff66b2){const _0x3bad61=a175_0x1e5a,_0x4be675=_0x543e71();while(!![]){try{const _0x327c80=parseInt(_0x3bad61(0x11a))/0x1*(-parseInt(_0x3bad61(0x148))/0x2)+parseInt(_0x3bad61(0x11d))/0x3*(-parseInt(_0x3bad61(0x117))/0x4)+-parseInt(_0x3bad61(0x143))/0x5*(parseInt(_0x3bad61(0x151))/0x6)+parseInt(_0x3bad61(0x125))/0x7*(-parseInt(_0x3bad61(0x128))/0x8)+-parseInt(_0x3bad61(0x149))/0x9*(-parseInt(_0x3bad61(0x13b))/0xa)+-parseInt(_0x3bad61(0x11f))/0xb+-parseInt(_0x3bad61(0x157))/0xc*(-parseInt(_0x3bad61(0x138))/0xd);if(_0x327c80===_0xff66b2)break;else _0x4be675['push'](_0x4be675['shift']());}catch(_0x12f2bf){_0x4be675['push'](_0x4be675['shift']());}}}(a175_0x26fb,0x3d4fb));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';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(_0x1ddf4c){const _0x2c267b=a175_0x1e5a;if(_0x1ddf4c===_0x2c267b(0x116))return[_0x2c267b(0x126),_0x2c267b(0x14d),_0x2c267b(0x153),'']['join']('\x0a');return['SELECT\x201\x20AS\x20id;',''][_0x2c267b(0x14b)]('\x0a');}export const sqlCreate={'service':a175_0x5c7eb8(0x14a),'command':'create','description':a175_0x5c7eb8(0x134),'risk':a175_0x5c7eb8(0x131),'flags':[{'name':'name','type':'string','description':a175_0x5c7eb8(0x147)},{'name':a175_0x5c7eb8(0x11e),'type':a175_0x5c7eb8(0x11c),'description':a175_0x5c7eb8(0x118)},{'name':a175_0x5c7eb8(0x14f),'type':a175_0x5c7eb8(0x139),'enum':[a175_0x5c7eb8(0x14a),a175_0x5c7eb8(0x116)],'description':a175_0x5c7eb8(0x158)}],async 'validate'(_0x179944){const _0x112d57=a175_0x5c7eb8;if(!_0x179944[_0x112d57(0x11b)])return;if(!_0x179944[_0x112d57(0x152)](_0x112d57(0x115))[_0x112d57(0x141)]())throw CliErrors[_0x112d57(0x14e)](_0x112d57(0x115),_0x112d57(0x130));const _0x44d8a4=resolveProvidedDbId(_0x179944);if(typeof _0x44d8a4!==_0x112d57(0x11c)||!Number[_0x112d57(0x142)](_0x44d8a4)||_0x44d8a4<=0x0)throw CliErrors[_0x112d57(0x14e)](_0x112d57(0x11e),_0x112d57(0x13f));if(!_0x179944[_0x112d57(0x152)](_0x112d57(0x14f))[_0x112d57(0x141)]())throw CliErrors['flagMissing']('mode',_0x112d57(0x15a));},async 'dryRun'(_0x4f3f99){const _0x5b9f0f=a175_0x5c7eb8,_0x34baa4=loadSqlProjectConfig(_0x4f3f99[_0x5b9f0f(0x150)]),{sqlName:_0x33ca29,dbId:_0x2f4e4a,dbName:_0x1f797d,mode:_0x3a45f4}=await resolveSqlNewInputs(_0x4f3f99),_0x422adb=buildSqlRelativePath(_0x5b9f0f(0x145),_0x33ca29,_0x1f797d,_0x3a45f4,_0x2f4e4a),_0x39a337=_0x34baa4[_0x5b9f0f(0x15e)]+'/'+_0x422adb;return{'method':_0x5b9f0f(0x137),'url':_0x5b9f0f(0x146),'body':{'appCode':_0x4f3f99[_0x5b9f0f(0x150)],'sqlName':_0x33ca29,'dbId':_0x2f4e4a,'mode':_0x3a45f4,'localPath':_0x39a337},'description':_0x5b9f0f(0x13a)+_0x34baa4[_0x5b9f0f(0x15e)]};},async 'execute'(_0xb05be4){const _0x2a7b4b=a175_0x5c7eb8,_0x255c4e=loadSqlProjectConfig(_0xb05be4[_0x2a7b4b(0x150)]),{sqlName:_0x2fe8cf,dbId:_0x5bc276,dbName:_0x21ace9,mode:_0x4ac2bb}=await resolveSqlNewInputs(_0xb05be4),_0x12c303=generateSqlTemplate(_0x4ac2bb),_0x22d817=await createSqlQuery({'appCode':_0xb05be4[_0x2a7b4b(0x150)],'sqlName':_0x2fe8cf,'dbId':_0x5bc276,'sqlContent':_0x12c303}),_0x6ea4ac=ensureRemoteSqlContent(_0x22d817),_0x58437e=_0x21ace9||await getDbName(_0xb05be4[_0x2a7b4b(0x150)],_0x5bc276)[_0x2a7b4b(0x121)](()=>undefined),_0x4604a7=buildSqlRelativePath(_0x22d817[_0x2a7b4b(0x15b)],_0x22d817['sqlName'],_0x58437e,_0x4ac2bb,_0x5bc276),_0x39d132=_0x255c4e[_0x2a7b4b(0x15e)]+'/'+_0x4604a7,_0x421ef2=buildLocalSqlFileContent({'sqlCode':_0x22d817[_0x2a7b4b(0x15b)],'sqlName':_0x22d817[_0x2a7b4b(0x12d)],'dbId':_0x22d817[_0x2a7b4b(0x12a)]},_0x6ea4ac,{'dbName':_0x58437e,'mode':_0x4ac2bb,'syncedAt':new Date()[_0x2a7b4b(0x13c)](),'description':_0x22d817[_0x2a7b4b(0x15c)]});if(await fileExists(_0x39d132))throw CliErrors[_0x2a7b4b(0x122)](_0x2a7b4b(0x160)+_0x39d132);await ensureParentDirectory(_0x39d132),await writeFile(_0x39d132,_0x421ef2,'utf8');const _0x324391=await readSqlLockFile(_0x255c4e[_0x2a7b4b(0x156)]),{lockData:_0x4e88bf,appLock:_0x3b86c1}=ensureSqlLockScope(_0x324391??createEmptySqlLock(),_0x255c4e['appCode'],_0x255c4e[_0x2a7b4b(0x12e)],_0x2a7b4b(0x155));return _0x3b86c1[_0x2a7b4b(0x133)][_0x22d817['sqlCode']]={...buildSqlLockEntry(_0x22d817,_0x6ea4ac,computeSqlContentHash(_0x421ef2),{'dbName':_0x58437e}),'path':_0x4604a7,'mode':_0x4ac2bb},_0x3b86c1[_0x2a7b4b(0x12b)]=new Date()[_0x2a7b4b(0x13c)](),await writeSqlLockFile(_0x255c4e[_0x2a7b4b(0x156)],_0x4e88bf),{'ok':!![],'data':{'id':_0x22d817['id'],'sqlCode':_0x22d817[_0x2a7b4b(0x15b)],'sqlName':_0x22d817['sqlName'],'dbId':_0x22d817[_0x2a7b4b(0x12a)],'path':_0x39d132,'mode':_0x4ac2bb},'message':_0x2a7b4b(0x124)+_0x22d817[_0x2a7b4b(0x15b)]};}};async function resolveSqlNewInputs(_0x1728fc){const _0x407f67=await resolveSqlNameInput(_0x1728fc),{dbId:_0x541de4,dbName:_0x194c18}=await resolveDbSelection(_0x1728fc),_0x1cb6f4=await resolveSqlModeInput(_0x1728fc);return{'sqlName':_0x407f67,'dbId':_0x541de4,'dbName':_0x194c18,'mode':_0x1cb6f4};}async function resolveSqlNameInput(_0x531c1b){const _0x26ce06=a175_0x5c7eb8,_0x168b1e=_0x531c1b[_0x26ce06(0x152)](_0x26ce06(0x115))[_0x26ce06(0x141)]();if(_0x168b1e)return _0x168b1e;if(_0x531c1b[_0x26ce06(0x11b)])throw CliErrors['flagMissing'](_0x26ce06(0x115),_0x26ce06(0x130));return(await input({'message':_0x26ce06(0x136),'validate':_0x156b88=>_0x156b88[_0x26ce06(0x141)]()?!![]:'SQL\x20名称不能为空'}))[_0x26ce06(0x141)]();}function a175_0x26fb(){const _0x251e82=['flag','sqlRootDir','请选择本地\x20SQL\x20模式:','File\x20already\x20exists:\x20','map','name','mybatisXml','4ITtLSB','Target\x20database\x20ID','适合带动态标签的\x20MyBatis\x20XML\x20SQL','4861YMkovB','nonInteractive','number','878487kAOeOK','db-id','4452987duMrGL','Invalid\x20database\x20selection\x20payload:\x20','catch','validation','请输入目标数据库\x20dbId:','Created\x20SQL\x20query\x20','21KjKqWQ','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','length','334936icdyLt','dbId\x20必须为正整数','dbId','lastSync','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','sqlName','sqlRoot','普通\x20SQL(sql)','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','write','dbName','sqls','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','MyBatis\x20XML(mybatisXml)','请输入\x20SQL\x20名称:','POST','13ZWTfgh','string','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','6130wiAzzI','toISOString','stringify','isInteger','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','parse','trim','isFinite','55BXGemF','✎\x20手动输入\x20dbId','<server-generated-sqlCode>','/smartapi/custom/saveUserCustomSql','SQL\x20query\x20display\x20name','16CZgOVx','1665KNapej','sql','join','dbId\x20不能为空','\x20\x20SELECT\x201\x20AS\x20id','flagMissing','mode','appCode','58368mHeZUP','str','</select>','请选择目标数据库:','new','lockFilePath','13282428woZnfc','Local\x20SQL\x20file\x20mode','__manual__','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','sqlCode','description'];a175_0x26fb=function(){return _0x251e82;};return a175_0x26fb();}async function resolveDbSelection(_0x3a5656){const _0x5ef07f=a175_0x5c7eb8,_0x38c966=resolveProvidedDbId(_0x3a5656);if(typeof _0x38c966===_0x5ef07f(0x11c)&&Number[_0x5ef07f(0x142)](_0x38c966)&&_0x38c966>0x0)return{'dbId':_0x38c966,'dbName':await getDbName(_0x3a5656['appCode'],_0x38c966)[_0x5ef07f(0x121)](()=>undefined)};if(_0x3a5656[_0x5ef07f(0x11b)])throw CliErrors[_0x5ef07f(0x14e)](_0x5ef07f(0x11e),_0x5ef07f(0x13f));const _0x26f23a=await listDatabases(_0x3a5656[_0x5ef07f(0x150)])[_0x5ef07f(0x121)](()=>[]);if(_0x26f23a['length']===0x1)return{'dbId':_0x26f23a[0x0][_0x5ef07f(0x12a)],'dbName':_0x26f23a[0x0]['dbName']};if(_0x26f23a[_0x5ef07f(0x127)]>0x1){const _0x121a5d=await select({'message':_0x5ef07f(0x154),'choices':[..._0x26f23a[_0x5ef07f(0x161)](_0x3b45c2=>({'name':_0x3b45c2['dbName']+'\x20('+_0x3b45c2[_0x5ef07f(0x12a)]+')','value':serializeDbSelection(_0x3b45c2)})),{'name':_0x5ef07f(0x144),'value':'__manual__'}]});if(_0x121a5d!==_0x5ef07f(0x159))return deserializeDbSelection(_0x121a5d);}const _0x1f8f71=await input({'message':_0x5ef07f(0x123),'validate':_0x2fdd07=>{const _0x5b4c49=_0x5ef07f,_0x37c6ab=_0x2fdd07[_0x5b4c49(0x141)]();if(!_0x37c6ab)return _0x5b4c49(0x14c);const _0x4d6d4a=Number(_0x37c6ab);if(!Number[_0x5b4c49(0x13e)](_0x4d6d4a)||_0x4d6d4a<=0x0)return _0x5b4c49(0x129);return!![];}});return{'dbId':Number(_0x1f8f71[_0x5ef07f(0x141)]())};}async function resolveSqlModeInput(_0x4cb1c6){const _0x242d4e=a175_0x5c7eb8,_0x115de7=_0x4cb1c6[_0x242d4e(0x152)](_0x242d4e(0x14f))[_0x242d4e(0x141)]();if(_0x115de7===_0x242d4e(0x14a)||_0x115de7===_0x242d4e(0x116))return _0x115de7;if(_0x4cb1c6['nonInteractive'])throw CliErrors['flagMissing'](_0x242d4e(0x14f),_0x242d4e(0x15a));return await select({'message':_0x242d4e(0x15f),'choices':[{'name':_0x242d4e(0x12f),'value':'sql','description':_0x242d4e(0x12c)},{'name':_0x242d4e(0x135),'value':_0x242d4e(0x116),'description':_0x242d4e(0x119)}]});}function serializeDbSelection(_0x2fdf25){const _0x2a0514=a175_0x5c7eb8;return JSON[_0x2a0514(0x13d)]({'dbId':_0x2fdf25[_0x2a0514(0x12a)],'dbName':_0x2fdf25[_0x2a0514(0x132)]});}function deserializeDbSelection(_0x51bfd9){const _0x24590c=a175_0x5c7eb8;try{const _0x473075=JSON[_0x24590c(0x140)](_0x51bfd9);if(typeof _0x473075[_0x24590c(0x12a)]===_0x24590c(0x11c)&&Number[_0x24590c(0x142)](_0x473075[_0x24590c(0x12a)]))return{'dbId':_0x473075[_0x24590c(0x12a)],'dbName':_0x473075[_0x24590c(0x132)]};}catch{}throw CliErrors[_0x24590c(0x122)](_0x24590c(0x120)+_0x51bfd9);}function resolveProvidedDbId(_0x508fb1){const _0x3d618e=a175_0x5c7eb8,_0x41c7b2=_0x508fb1[_0x3d618e(0x15d)]('db-id');if(typeof _0x41c7b2===_0x3d618e(0x11c)&&Number['isFinite'](_0x41c7b2))return _0x41c7b2;return undefined;}
1
+ const a183_0x36594d=a183_0x27f7;(function(_0x34fea1,_0x1a269b){const _0x4f3926=a183_0x27f7,_0x409bf1=_0x34fea1();while(!![]){try{const _0x56dd3d=parseInt(_0x4f3926(0x1c0))/0x1*(-parseInt(_0x4f3926(0x1b4))/0x2)+-parseInt(_0x4f3926(0x1be))/0x3+-parseInt(_0x4f3926(0x1d7))/0x4*(-parseInt(_0x4f3926(0x1ab))/0x5)+-parseInt(_0x4f3926(0x1c9))/0x6+-parseInt(_0x4f3926(0x1d9))/0x7*(-parseInt(_0x4f3926(0x1b3))/0x8)+-parseInt(_0x4f3926(0x1cb))/0x9+parseInt(_0x4f3926(0x1c4))/0xa*(parseInt(_0x4f3926(0x1c5))/0xb);if(_0x56dd3d===_0x1a269b)break;else _0x409bf1['push'](_0x409bf1['shift']());}catch(_0xc75180){_0x409bf1['push'](_0x409bf1['shift']());}}}(a183_0x512c,0x8bfda));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';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';function a183_0x27f7(_0x1dfe6e,_0xc7f87d){_0x1dfe6e=_0x1dfe6e-0x19e;const _0x512cd0=a183_0x512c();let _0x27f70a=_0x512cd0[_0x1dfe6e];return _0x27f70a;}import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x22a00e){const _0x347629=a183_0x27f7;if(_0x22a00e===_0x347629(0x1ad))return['<select\x20id=\x22query\x22\x20resultType=\x22map\x22>',_0x347629(0x1bf),_0x347629(0x19f),''][_0x347629(0x1b1)]('\x0a');return['SELECT\x201\x20AS\x20id;',''][_0x347629(0x1b1)]('\x0a');}export const sqlCreate={'service':a183_0x36594d(0x1b9),'command':'create','description':'Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','risk':a183_0x36594d(0x1b5),'flags':[{'name':a183_0x36594d(0x1a2),'type':'string','description':'SQL\x20query\x20display\x20name'},{'name':a183_0x36594d(0x1bb),'type':'number','description':a183_0x36594d(0x1ac)},{'name':'mode','type':a183_0x36594d(0x1dd),'enum':[a183_0x36594d(0x1b9),a183_0x36594d(0x1ad)],'description':a183_0x36594d(0x1d1)}],async 'validate'(_0x40c265){const _0x170a8=a183_0x36594d;if(!_0x40c265[_0x170a8(0x1b7)])return;if(!_0x40c265[_0x170a8(0x1a8)](_0x170a8(0x1a2))[_0x170a8(0x1c3)]())throw CliErrors[_0x170a8(0x1b8)](_0x170a8(0x1a2),_0x170a8(0x1c8));const _0xdfc479=resolveProvidedDbId(_0x40c265);if(typeof _0xdfc479!==_0x170a8(0x1d0)||!Number['isFinite'](_0xdfc479)||_0xdfc479<=0x0)throw CliErrors['flagMissing'](_0x170a8(0x1bb),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');if(!_0x40c265['str'](_0x170a8(0x1a1))['trim']())throw CliErrors[_0x170a8(0x1b8)](_0x170a8(0x1a1),_0x170a8(0x1a9));},async 'dryRun'(_0x36b649){const _0x1ea1b4=a183_0x36594d,_0x9efb8c=loadSqlProjectConfig(_0x36b649[_0x1ea1b4(0x1a7)]),{sqlName:_0x2978fe,dbId:_0x379119,dbName:_0x5d7b3f,mode:_0x246019}=await resolveSqlNewInputs(_0x36b649),_0x236181=buildSqlRelativePath('<server-generated-sqlCode>',_0x2978fe,_0x5d7b3f,_0x246019,_0x379119),_0x508ffa=_0x9efb8c[_0x1ea1b4(0x1cd)]+'/'+_0x236181;return{'method':'POST','url':'/smartapi/custom/saveUserCustomSql','body':{'appCode':_0x36b649[_0x1ea1b4(0x1a7)],'sqlName':_0x2978fe,'dbId':_0x379119,'mode':_0x246019,'localPath':_0x508ffa},'description':_0x1ea1b4(0x1ca)+_0x9efb8c['sqlRootDir']};},async 'execute'(_0x3d3fdd){const _0xe75634=a183_0x36594d,_0x599364=loadSqlProjectConfig(_0x3d3fdd[_0xe75634(0x1a7)]),{sqlName:_0x2c2b2d,dbId:_0x5e4f7e,dbName:_0x30686d,mode:_0x4779bb}=await resolveSqlNewInputs(_0x3d3fdd),_0x4d9573=generateSqlTemplate(_0x4779bb),_0xd8b83c=await createSqlQuery({'appCode':_0x3d3fdd[_0xe75634(0x1a7)],'sqlName':_0x2c2b2d,'dbId':_0x5e4f7e,'sqlContent':_0x4d9573}),_0x1fd607=ensureRemoteSqlContent(_0xd8b83c),_0x44741d=_0x30686d||await getDbName(_0x3d3fdd['appCode'],_0x5e4f7e)[_0xe75634(0x1bc)](()=>undefined),_0x4d1989=buildSqlRelativePath(_0xd8b83c[_0xe75634(0x1c6)],_0xd8b83c['sqlName'],_0x44741d,_0x4779bb,_0x5e4f7e),_0x413e71=_0x599364[_0xe75634(0x1cd)]+'/'+_0x4d1989,_0x2a9385=buildLocalSqlFileContent({'sqlCode':_0xd8b83c[_0xe75634(0x1c6)],'sqlName':_0xd8b83c['sqlName'],'dbId':_0xd8b83c[_0xe75634(0x1b0)]},_0x1fd607,{'dbName':_0x44741d,'mode':_0x4779bb,'syncedAt':new Date()[_0xe75634(0x1bd)](),'description':_0xd8b83c[_0xe75634(0x1d2)]});if(await fileExists(_0x413e71))throw CliErrors[_0xe75634(0x1d5)]('File\x20already\x20exists:\x20'+_0x413e71);await ensureParentDirectory(_0x413e71),await writeFile(_0x413e71,_0x2a9385,_0xe75634(0x1aa));const _0x5bfecb=await readSqlLockFile(_0x599364[_0xe75634(0x1a0)]),{lockData:_0x1946ce,appLock:_0x4a6219}=ensureSqlLockScope(_0x5bfecb??createEmptySqlLock(),_0x599364[_0xe75634(0x1a7)],_0x599364[_0xe75634(0x1cc)],'new');return _0x4a6219[_0xe75634(0x1db)][_0xd8b83c['sqlCode']]={...buildSqlLockEntry(_0xd8b83c,_0x1fd607,computeSqlContentHash(_0x2a9385),{'dbName':_0x44741d}),'path':_0x4d1989,'mode':_0x4779bb},_0x4a6219['lastSync']=new Date()[_0xe75634(0x1bd)](),await writeSqlLockFile(_0x599364[_0xe75634(0x1a0)],_0x1946ce),{'ok':!![],'data':{'id':_0xd8b83c['id'],'sqlCode':_0xd8b83c[_0xe75634(0x1c6)],'sqlName':_0xd8b83c[_0xe75634(0x1a5)],'dbId':_0xd8b83c[_0xe75634(0x1b0)],'path':_0x413e71,'mode':_0x4779bb},'message':_0xe75634(0x1b2)+_0xd8b83c[_0xe75634(0x1c6)]};}};async function resolveSqlNewInputs(_0x243b67){const _0x5ce58=await resolveSqlNameInput(_0x243b67),{dbId:_0x5b25a2,dbName:_0x468959}=await resolveDbSelection(_0x243b67),_0x37cf94=await resolveSqlModeInput(_0x243b67);return{'sqlName':_0x5ce58,'dbId':_0x5b25a2,'dbName':_0x468959,'mode':_0x37cf94};}async function resolveSqlNameInput(_0x3c071d){const _0x3563ed=a183_0x36594d,_0x59316b=_0x3c071d[_0x3563ed(0x1a8)]('name')['trim']();if(_0x59316b)return _0x59316b;if(_0x3c071d[_0x3563ed(0x1b7)])throw CliErrors[_0x3563ed(0x1b8)]('name',_0x3563ed(0x1c8));return(await input({'message':_0x3563ed(0x1da),'validate':_0x175db4=>_0x175db4[_0x3563ed(0x1c3)]()?!![]:_0x3563ed(0x1de)}))[_0x3563ed(0x1c3)]();}async function resolveDbSelection(_0x1b6ff3){const _0x271aaf=a183_0x36594d,_0x5329e0=resolveProvidedDbId(_0x1b6ff3);if(typeof _0x5329e0===_0x271aaf(0x1d0)&&Number[_0x271aaf(0x1a6)](_0x5329e0)&&_0x5329e0>0x0)return{'dbId':_0x5329e0,'dbName':await getDbName(_0x1b6ff3[_0x271aaf(0x1a7)],_0x5329e0)[_0x271aaf(0x1bc)](()=>undefined)};if(_0x1b6ff3[_0x271aaf(0x1b7)])throw CliErrors[_0x271aaf(0x1b8)]('db-id','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x594580=await listDatabases(_0x1b6ff3[_0x271aaf(0x1a7)])[_0x271aaf(0x1bc)](()=>[]);if(_0x594580[_0x271aaf(0x1b6)]===0x1)return{'dbId':_0x594580[0x0][_0x271aaf(0x1b0)],'dbName':_0x594580[0x0][_0x271aaf(0x1dc)]};if(_0x594580[_0x271aaf(0x1b6)]>0x1){const _0x172e6f=await select({'message':_0x271aaf(0x1a3),'choices':[..._0x594580[_0x271aaf(0x1ba)](_0xb77345=>({'name':_0xb77345[_0x271aaf(0x1dc)]+'\x20('+_0xb77345[_0x271aaf(0x1b0)]+')','value':serializeDbSelection(_0xb77345)})),{'name':'✎\x20手动输入\x20dbId','value':_0x271aaf(0x1c7)}]});if(_0x172e6f!==_0x271aaf(0x1c7))return deserializeDbSelection(_0x172e6f);}const _0x5abe02=await input({'message':_0x271aaf(0x1cf),'validate':_0xfe2d8f=>{const _0x27379b=_0x271aaf,_0x11c625=_0xfe2d8f[_0x27379b(0x1c3)]();if(!_0x11c625)return _0x27379b(0x1d8);const _0xb9ef10=Number(_0x11c625);if(!Number[_0x27379b(0x1c1)](_0xb9ef10)||_0xb9ef10<=0x0)return _0x27379b(0x1d3);return!![];}});return{'dbId':Number(_0x5abe02[_0x271aaf(0x1c3)]())};}async function resolveSqlModeInput(_0x24752b){const _0x5df28b=a183_0x36594d,_0x5539c2=_0x24752b[_0x5df28b(0x1a8)]('mode')[_0x5df28b(0x1c3)]();if(_0x5539c2==='sql'||_0x5539c2==='mybatisXml')return _0x5539c2;if(_0x24752b['nonInteractive'])throw CliErrors[_0x5df28b(0x1b8)](_0x5df28b(0x1a1),_0x5df28b(0x1a9));return await select({'message':_0x5df28b(0x1d4),'choices':[{'name':_0x5df28b(0x1ce),'value':'sql','description':'适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句'},{'name':_0x5df28b(0x1c2),'value':'mybatisXml','description':_0x5df28b(0x1af)}]});}function a183_0x512c(){const _0xe7b507=['write','length','nonInteractive','flagMissing','sql','map','db-id','catch','toISOString','1514139Qmeass','\x20\x20SELECT\x201\x20AS\x20id','2311iqLCcC','isInteger','MyBatis\x20XML(mybatisXml)','trim','46170zrFvBq','3256UCsrLj','sqlCode','__manual__','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','2478252pWhZwy','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','5908995zFTMxM','sqlRoot','sqlRootDir','普通\x20SQL(sql)','请输入目标数据库\x20dbId:','number','Local\x20SQL\x20file\x20mode','description','dbId\x20必须为正整数','请选择本地\x20SQL\x20模式:','validation','parse','4tWQYBQ','dbId\x20不能为空','2676576ypUjrb','请输入\x20SQL\x20名称:','sqls','dbName','string','SQL\x20名称不能为空','stringify','</select>','lockFilePath','mode','name','请选择目标数据库:','flag','sqlName','isFinite','appCode','str','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','utf8','1364325PiSCZv','Target\x20database\x20ID','mybatisXml','Invalid\x20database\x20selection\x20payload:\x20','适合带动态标签的\x20MyBatis\x20XML\x20SQL','dbId','join','Created\x20SQL\x20query\x20','16pSWZzR','222TWNrpT'];a183_0x512c=function(){return _0xe7b507;};return a183_0x512c();}function serializeDbSelection(_0x31874b){const _0x4799d8=a183_0x36594d;return JSON[_0x4799d8(0x19e)]({'dbId':_0x31874b[_0x4799d8(0x1b0)],'dbName':_0x31874b[_0x4799d8(0x1dc)]});}function deserializeDbSelection(_0x358de0){const _0x1efd4a=a183_0x36594d;try{const _0x98072=JSON[_0x1efd4a(0x1d6)](_0x358de0);if(typeof _0x98072[_0x1efd4a(0x1b0)]===_0x1efd4a(0x1d0)&&Number[_0x1efd4a(0x1a6)](_0x98072[_0x1efd4a(0x1b0)]))return{'dbId':_0x98072[_0x1efd4a(0x1b0)],'dbName':_0x98072[_0x1efd4a(0x1dc)]};}catch{}throw CliErrors[_0x1efd4a(0x1d5)](_0x1efd4a(0x1ae)+_0x358de0);}function resolveProvidedDbId(_0x201247){const _0x387f99=a183_0x36594d,_0xf8c97a=_0x201247[_0x387f99(0x1a4)](_0x387f99(0x1bb));if(typeof _0xf8c97a===_0x387f99(0x1d0)&&Number[_0x387f99(0x1a6)](_0xf8c97a))return _0xf8c97a;return undefined;}
@@ -1 +1 @@
1
- const a176_0x381324=a176_0x3f22;(function(_0x2b712d,_0x48fd33){const _0x41860c=a176_0x3f22,_0xfc333f=_0x2b712d();while(!![]){try{const _0x4c4108=parseInt(_0x41860c(0x1aa))/0x1*(parseInt(_0x41860c(0x195))/0x2)+parseInt(_0x41860c(0x1a0))/0x3*(-parseInt(_0x41860c(0x18f))/0x4)+-parseInt(_0x41860c(0x18a))/0x5+-parseInt(_0x41860c(0x194))/0x6*(parseInt(_0x41860c(0x1ab))/0x7)+parseInt(_0x41860c(0x1b0))/0x8*(-parseInt(_0x41860c(0x199))/0x9)+parseInt(_0x41860c(0x19f))/0xa+parseInt(_0x41860c(0x1a3))/0xb*(parseInt(_0x41860c(0x19e))/0xc);if(_0x4c4108===_0x48fd33)break;else _0xfc333f['push'](_0xfc333f['shift']());}catch(_0x5742a2){_0xfc333f['push'](_0xfc333f['shift']());}}}(a176_0x2daf,0xa4d1b));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';function a176_0x3f22(_0x5c6f39,_0x563b42){_0x5c6f39=_0x5c6f39-0x18a;const _0x2dafd2=a176_0x2daf();let _0x3f22c9=_0x2dafd2[_0x5c6f39];return _0x3f22c9;}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';function a176_0x2daf(){const _0x13953f=['\x20(local\x20file\x20moved\x20to\x20trash)','11xePAMG','remoteId','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','trashDir','sqlRoot','lastSync','1WIgJet','70SYVGHj','filter','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','POST','sqlcode','24GdEEnx','1449970cKnwkh','appCode','sqls','Deleted\x20','high-risk-write','460gUNNME','str','lockFilePath','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','/smartapi/custom/deleteUserCustomSql','435486srvEBD','1793042gTsOtr','sql','toISOString','replace','1862919khLMwH','SQL\x20lock\x20file\x20not\x20found.','Would\x20delete\x20SQL\x20','validation','delete','20927652wzXdab','95990jlFCzU','8823NDhBUm','projectRoot'];a176_0x2daf=function(){return _0x13953f;};return a176_0x2daf();}import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a176_0x381324(0x196),'command':'delete','description':a176_0x381324(0x1a5),'risk':a176_0x381324(0x18e),'flags':[SQLCODE_FLAG],async 'validate'(_0x112fbe){const _0x28f208=a176_0x381324,_0x3aea90=loadSqlProjectConfig(_0x112fbe[_0x28f208(0x18b)]),_0x3bfd29=await readSqlLockFile(_0x3aea90[_0x28f208(0x191)]);if(!_0x3bfd29)throw CliErrors[_0x28f208(0x19c)](_0x28f208(0x1a6));},async 'dryRun'(_0x12d71b){const _0x43f40a=a176_0x381324,_0x1e9c63=loadSqlProjectConfig(_0x12d71b['appCode']),_0x357600=await readSqlLockFile(_0x1e9c63[_0x43f40a(0x191)]);if(!_0x357600)throw CliErrors['validation'](_0x43f40a(0x1a6));const {appLock:_0x503ce9}=ensureSqlLockScope(_0x357600,_0x12d71b['appCode'],_0x1e9c63[_0x43f40a(0x1a8)],_0x43f40a(0x19d)),_0x18564d=_0x12d71b[_0x43f40a(0x190)]('sqlcode'),_0x449694=_0x503ce9[_0x43f40a(0x18c)][_0x18564d];if(!_0x449694)throw CliErrors['validation'](_0x43f40a(0x1ad)+_0x18564d+'\x22.');return{'method':_0x43f40a(0x1ae),'url':_0x43f40a(0x193),'body':{'sqlCode':_0x18564d,'id':_0x449694[_0x43f40a(0x1a4)],'localPath':resolveLocalSqlFilePath(_0x1e9c63,_0x18564d,_0x449694)},'description':_0x43f40a(0x19b)+_0x18564d+_0x43f40a(0x192)+_0x1e9c63['trashDir']};},async 'execute'(_0x412633){const _0x12c6e7=a176_0x381324,_0x5e0270=loadSqlProjectConfig(_0x412633[_0x12c6e7(0x18b)]),_0x15640a=await readSqlLockFile(_0x5e0270[_0x12c6e7(0x191)]);if(!_0x15640a)throw CliErrors[_0x12c6e7(0x19c)](_0x12c6e7(0x19a));const {lockData:_0x19326d,appLock:_0x492d0f}=ensureSqlLockScope(_0x15640a,_0x412633['appCode'],_0x5e0270[_0x12c6e7(0x1a8)],_0x12c6e7(0x19d)),_0x3b81f6=_0x412633[_0x12c6e7(0x190)](_0x12c6e7(0x1af)),_0x24baa9=_0x492d0f['sqls'][_0x3b81f6];if(!_0x24baa9)throw CliErrors['validation'](_0x12c6e7(0x1ad)+_0x3b81f6+'\x22.');await deleteSqlQuery({'id':_0x24baa9['remoteId'],'sqlCode':_0x3b81f6}),_0x492d0f[_0x12c6e7(0x18c)]=Object['fromEntries'](Object['entries'](_0x492d0f[_0x12c6e7(0x18c)])[_0x12c6e7(0x1ac)](([_0x218aba])=>_0x218aba!==_0x3b81f6)),_0x492d0f[_0x12c6e7(0x1a9)]=new Date()[_0x12c6e7(0x197)](),await writeSqlLockFile(_0x5e0270[_0x12c6e7(0x191)],_0x19326d);const _0x2cdc2a=resolveLocalSqlFilePath(_0x5e0270,_0x3b81f6,_0x24baa9);let _0x5a6ab5;await fileExists(_0x2cdc2a)&&(_0x5a6ab5=await moveToTrash(_0x5e0270[_0x12c6e7(0x1a1)],_0x5e0270[_0x12c6e7(0x1a7)],_0x2cdc2a),await cleanupEmptyDirectories(dirname(_0x2cdc2a),_0x5e0270['sqlRootDir']));const _0x572599={'deleted':_0x3b81f6,'remoteId':_0x24baa9[_0x12c6e7(0x1a4)]};if(_0x5a6ab5)_0x572599['trashedTo']=_0x5a6ab5;return{'ok':!![],'data':_0x572599,'message':_0x12c6e7(0x18d)+_0x3b81f6+(_0x5a6ab5?_0x12c6e7(0x1a2):'')};}};async function moveToTrash(_0x57437a,_0x488fef,_0x262aff){const _0x426b6f=a176_0x381324,_0xe1011e=new Date()[_0x426b6f(0x197)]()[_0x426b6f(0x198)](/[:.]/g,'-'),_0x38578d=relative(_0x57437a,_0x262aff),_0x2948e6=join(_0x488fef,_0xe1011e,_0x38578d);return await mkdir(dirname(_0x2948e6),{'recursive':!![]}),await rename(_0x262aff,_0x2948e6),_0x2948e6;}async function cleanupEmptyDirectories(_0x4c91d1,_0x5d06c6){let _0x391852=resolve(_0x4c91d1);const _0x9d579b=resolve(_0x5d06c6);while(_0x391852['startsWith'](''+_0x9d579b+sep)||_0x391852===_0x9d579b){if(_0x391852===_0x9d579b)return;try{const _0x85feda=await readdir(_0x391852);if(_0x85feda['length']>0x0)return;await rmdir(_0x391852);}catch{return;}_0x391852=dirname(_0x391852);}}
1
+ const a184_0x5d2293=a184_0x2bb0;function a184_0x2bb0(_0x399278,_0x47dabb){_0x399278=_0x399278-0x13d;const _0x510a96=a184_0x510a();let _0x2bb0ef=_0x510a96[_0x399278];return _0x2bb0ef;}(function(_0x2ed1e8,_0x2f83f3){const _0x3aff58=a184_0x2bb0,_0x599207=_0x2ed1e8();while(!![]){try{const _0x5561ab=parseInt(_0x3aff58(0x158))/0x1*(-parseInt(_0x3aff58(0x159))/0x2)+-parseInt(_0x3aff58(0x15e))/0x3+-parseInt(_0x3aff58(0x157))/0x4+-parseInt(_0x3aff58(0x141))/0x5+parseInt(_0x3aff58(0x155))/0x6*(parseInt(_0x3aff58(0x14d))/0x7)+parseInt(_0x3aff58(0x150))/0x8+parseInt(_0x3aff58(0x13d))/0x9;if(_0x5561ab===_0x2f83f3)break;else _0x599207['push'](_0x599207['shift']());}catch(_0x20b7f2){_0x599207['push'](_0x599207['shift']());}}}(a184_0x510a,0x48042));function a184_0x510a(){const _0x97f9b9=['92639owxQiA','2qePJIo','replace','toISOString','sqlcode','POST','453741HRwJmb','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','length','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','5014323huTHwD','sql','sqlRootDir','sqlRoot','359905IYAHba','lockFilePath','\x20(local\x20file\x20moved\x20to\x20trash)','high-risk-write','delete','str','remoteId','/smartapi/custom/deleteUserCustomSql','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','lastSync','Deleted\x20','fromEntries','34797wHfjeA','sqls','projectRoot','512368frNgrW','validation','filter','appCode','trashDir','108iQzBwm','entries','399304FeQWiN'];a184_0x510a=function(){return _0x97f9b9;};return a184_0x510a();}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_0x5d2293(0x13e),'command':a184_0x5d2293(0x145),'description':'Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','risk':a184_0x5d2293(0x144),'flags':[SQLCODE_FLAG],async 'validate'(_0x2cd0cf){const _0x5b1bc5=a184_0x5d2293,_0x565e8e=loadSqlProjectConfig(_0x2cd0cf[_0x5b1bc5(0x153)]),_0x9ca034=await readSqlLockFile(_0x565e8e[_0x5b1bc5(0x142)]);if(!_0x9ca034)throw CliErrors['validation'](_0x5b1bc5(0x161));},async 'dryRun'(_0x170d1e){const _0x2bfe2b=a184_0x5d2293,_0x415e0a=loadSqlProjectConfig(_0x170d1e[_0x2bfe2b(0x153)]),_0x40765d=await readSqlLockFile(_0x415e0a['lockFilePath']);if(!_0x40765d)throw CliErrors[_0x2bfe2b(0x151)](_0x2bfe2b(0x161));const {appLock:_0x36a251}=ensureSqlLockScope(_0x40765d,_0x170d1e[_0x2bfe2b(0x153)],_0x415e0a['sqlRoot'],_0x2bfe2b(0x145)),_0xea7512=_0x170d1e[_0x2bfe2b(0x146)](_0x2bfe2b(0x15c)),_0x205a16=_0x36a251[_0x2bfe2b(0x14e)][_0xea7512];if(!_0x205a16)throw CliErrors[_0x2bfe2b(0x151)](_0x2bfe2b(0x15f)+_0xea7512+'\x22.');return{'method':_0x2bfe2b(0x15d),'url':_0x2bfe2b(0x148),'body':{'sqlCode':_0xea7512,'id':_0x205a16[_0x2bfe2b(0x147)],'localPath':resolveLocalSqlFilePath(_0x415e0a,_0xea7512,_0x205a16)},'description':'Would\x20delete\x20SQL\x20'+_0xea7512+_0x2bfe2b(0x149)+_0x415e0a[_0x2bfe2b(0x154)]};},async 'execute'(_0x260090){const _0x214410=a184_0x5d2293,_0x4b29af=loadSqlProjectConfig(_0x260090[_0x214410(0x153)]),_0x1126cf=await readSqlLockFile(_0x4b29af[_0x214410(0x142)]);if(!_0x1126cf)throw CliErrors[_0x214410(0x151)]('SQL\x20lock\x20file\x20not\x20found.');const {lockData:_0x3e7cef,appLock:_0x390285}=ensureSqlLockScope(_0x1126cf,_0x260090[_0x214410(0x153)],_0x4b29af[_0x214410(0x140)],'delete'),_0x240fa0=_0x260090[_0x214410(0x146)](_0x214410(0x15c)),_0xe08eae=_0x390285['sqls'][_0x240fa0];if(!_0xe08eae)throw CliErrors[_0x214410(0x151)](_0x214410(0x15f)+_0x240fa0+'\x22.');await deleteSqlQuery({'id':_0xe08eae[_0x214410(0x147)],'sqlCode':_0x240fa0}),_0x390285[_0x214410(0x14e)]=Object[_0x214410(0x14c)](Object[_0x214410(0x156)](_0x390285['sqls'])[_0x214410(0x152)](([_0x3f85a3])=>_0x3f85a3!==_0x240fa0)),_0x390285[_0x214410(0x14a)]=new Date()[_0x214410(0x15b)](),await writeSqlLockFile(_0x4b29af[_0x214410(0x142)],_0x3e7cef);const _0x161383=resolveLocalSqlFilePath(_0x4b29af,_0x240fa0,_0xe08eae);let _0x2998df;await fileExists(_0x161383)&&(_0x2998df=await moveToTrash(_0x4b29af[_0x214410(0x14f)],_0x4b29af[_0x214410(0x154)],_0x161383),await cleanupEmptyDirectories(dirname(_0x161383),_0x4b29af[_0x214410(0x13f)]));const _0x5186e4={'deleted':_0x240fa0,'remoteId':_0xe08eae['remoteId']};if(_0x2998df)_0x5186e4['trashedTo']=_0x2998df;return{'ok':!![],'data':_0x5186e4,'message':_0x214410(0x14b)+_0x240fa0+(_0x2998df?_0x214410(0x143):'')};}};async function moveToTrash(_0xc5a7a2,_0x235b89,_0x500215){const _0x36d9f3=a184_0x5d2293,_0x29790a=new Date()[_0x36d9f3(0x15b)]()[_0x36d9f3(0x15a)](/[:.]/g,'-'),_0x6ee806=relative(_0xc5a7a2,_0x500215),_0x47f629=join(_0x235b89,_0x29790a,_0x6ee806);return await mkdir(dirname(_0x47f629),{'recursive':!![]}),await rename(_0x500215,_0x47f629),_0x47f629;}async function cleanupEmptyDirectories(_0x47a17c,_0xaf0982){const _0x1d6d5b=a184_0x5d2293;let _0x410cfc=resolve(_0x47a17c);const _0x5c9c42=resolve(_0xaf0982);while(_0x410cfc['startsWith'](''+_0x5c9c42+sep)||_0x410cfc===_0x5c9c42){if(_0x410cfc===_0x5c9c42)return;try{const _0x44dba9=await readdir(_0x410cfc);if(_0x44dba9[_0x1d6d5b(0x160)]>0x0)return;await rmdir(_0x410cfc);}catch{return;}_0x410cfc=dirname(_0x410cfc);}}
@@ -1 +1 @@
1
- const a177_0xaff853=a177_0x362f;(function(_0x1e6f2e,_0x452894){const _0x4abb2a=a177_0x362f,_0x30d463=_0x1e6f2e();while(!![]){try{const _0x1d22d1=-parseInt(_0x4abb2a(0x176))/0x1+-parseInt(_0x4abb2a(0x16d))/0x2+-parseInt(_0x4abb2a(0x17f))/0x3*(parseInt(_0x4abb2a(0x169))/0x4)+-parseInt(_0x4abb2a(0x17a))/0x5*(parseInt(_0x4abb2a(0x17d))/0x6)+parseInt(_0x4abb2a(0x16e))/0x7*(-parseInt(_0x4abb2a(0x178))/0x8)+-parseInt(_0x4abb2a(0x16b))/0x9+-parseInt(_0x4abb2a(0x179))/0xa*(-parseInt(_0x4abb2a(0x170))/0xb);if(_0x1d22d1===_0x452894)break;else _0x30d463['push'](_0x30d463['shift']());}catch(_0x43b151){_0x30d463['push'](_0x30d463['shift']());}}}(a177_0x574f,0xe4b1c));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a177_0x362f(_0x1c8e54,_0x1833e4){_0x1c8e54=_0x1c8e54-0x168;const _0x574f29=a177_0x574f();let _0x362f5b=_0x574f29[_0x1c8e54];return _0x362f5b;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a177_0x574f(){const _0xf6d827=['verbose','boolean','476QRdyHD','sqlCode','12169737dRhiXT','Return\x20full\x20raw\x20SQL\x20query\x20object','2009642PARZiQ','7qDMHZT','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','313742EOSxib','appCode','description','sql','sqlName','read','1526468hBhuDB','bool','7774600TLpwLA','2790HzVFOf','2545VwhvRi','sqlContent','sqlcode','10284oEkhHQ','dbId','32601NGUftC','detail'];a177_0x574f=function(){return _0xf6d827;};return a177_0x574f();}export const sqlDetail={'service':a177_0xaff853(0x173),'command':a177_0xaff853(0x180),'description':a177_0xaff853(0x16f),'risk':a177_0xaff853(0x175),'flags':[SQLCODE_FLAG,{'name':'verbose','type':a177_0xaff853(0x168),'description':a177_0xaff853(0x16c)}],async 'execute'(_0x2b04d9){const _0x254dfc=a177_0xaff853,_0x3458e2=await getSqlQueryInfo(_0x2b04d9['appCode'],_0x2b04d9['str'](_0x254dfc(0x17c))),_0xd78ece=_0x2b04d9[_0x254dfc(0x177)](_0x254dfc(0x181));if(_0xd78ece)return{'ok':!![],'data':_0x3458e2};const _0x3b377e=_0x3458e2['dbId']?await getDbName(_0x2b04d9[_0x254dfc(0x171)],_0x3458e2[_0x254dfc(0x17e)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x3458e2[_0x254dfc(0x16a)],'sqlName':_0x3458e2[_0x254dfc(0x174)],'db':_0x3b377e?_0x3b377e+'\x20('+_0x3458e2['dbId']+')':_0x3458e2[_0x254dfc(0x17e)]??'','description':_0x3458e2[_0x254dfc(0x172)]??'','sqlContent':_0x3458e2[_0x254dfc(0x17b)]??''}};}};
1
+ const a185_0x54965e=a185_0x4af3;(function(_0x342768,_0x24bc77){const _0x555b48=a185_0x4af3,_0x2cc36e=_0x342768();while(!![]){try{const _0x4a06f0=-parseInt(_0x555b48(0x170))/0x1+-parseInt(_0x555b48(0x176))/0x2*(parseInt(_0x555b48(0x16b))/0x3)+-parseInt(_0x555b48(0x165))/0x4*(-parseInt(_0x555b48(0x16a))/0x5)+parseInt(_0x555b48(0x175))/0x6*(-parseInt(_0x555b48(0x171))/0x7)+parseInt(_0x555b48(0x167))/0x8+parseInt(_0x555b48(0x172))/0x9+parseInt(_0x555b48(0x177))/0xa;if(_0x4a06f0===_0x24bc77)break;else _0x2cc36e['push'](_0x2cc36e['shift']());}catch(_0x50ce80){_0x2cc36e['push'](_0x2cc36e['shift']());}}}(a185_0x1567,0xc047b));import{getSqlQueryInfo}from'../../core/api-client.js';function a185_0x4af3(_0x346291,_0x3363c2){_0x346291=_0x346291-0x165;const _0x1567f2=a185_0x1567();let _0x4af33f=_0x1567f2[_0x346291];return _0x4af33f;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a185_0x54965e(0x178),'command':a185_0x54965e(0x179),'description':a185_0x54965e(0x166),'risk':'read','flags':[SQLCODE_FLAG,{'name':'verbose','type':a185_0x54965e(0x16f),'description':a185_0x54965e(0x174)}],async 'execute'(_0x8a6d9a){const _0x185b0b=a185_0x54965e,_0xd2975e=await getSqlQueryInfo(_0x8a6d9a['appCode'],_0x8a6d9a[_0x185b0b(0x169)](_0x185b0b(0x16e))),_0x1ccd47=_0x8a6d9a[_0x185b0b(0x16d)](_0x185b0b(0x173));if(_0x1ccd47)return{'ok':!![],'data':_0xd2975e};const _0x20d124=_0xd2975e['dbId']?await getDbName(_0x8a6d9a[_0x185b0b(0x17a)],_0xd2975e[_0x185b0b(0x16c)]):undefined;return{'ok':!![],'data':{'sqlCode':_0xd2975e['sqlCode'],'sqlName':_0xd2975e[_0x185b0b(0x168)],'db':_0x20d124?_0x20d124+'\x20('+_0xd2975e[_0x185b0b(0x16c)]+')':_0xd2975e[_0x185b0b(0x16c)]??'','description':_0xd2975e['description']??'','sqlContent':_0xd2975e[_0x185b0b(0x17b)]??''}};}};function a185_0x1567(){const _0x3a76c1=['appCode','sqlContent','3657512uYuDrJ','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','7995128bSpkQj','sqlName','str','5qscanr','354YkNpIk','dbId','bool','sqlcode','boolean','478321EwOrSR','7UlrXGg','3469707ZBWhOC','verbose','Return\x20full\x20raw\x20SQL\x20query\x20object','3701160yXYlZi','25598hKUKTi','10937500rLeenM','sql','detail'];a185_0x1567=function(){return _0x3a76c1;};return a185_0x1567();}
@@ -1 +1 @@
1
- const a178_0x560fa3=a178_0x589d;(function(_0x444ade,_0x3864ff){const _0x1b70b2=a178_0x589d,_0x522a81=_0x444ade();while(!![]){try{const _0x12c9e5=parseInt(_0x1b70b2(0x92))/0x1*(parseInt(_0x1b70b2(0x98))/0x2)+-parseInt(_0x1b70b2(0x8d))/0x3+parseInt(_0x1b70b2(0x90))/0x4+-parseInt(_0x1b70b2(0x9d))/0x5*(-parseInt(_0x1b70b2(0x9c))/0x6)+-parseInt(_0x1b70b2(0x8f))/0x7+parseInt(_0x1b70b2(0x88))/0x8*(parseInt(_0x1b70b2(0x96))/0x9)+-parseInt(_0x1b70b2(0x9a))/0xa*(parseInt(_0x1b70b2(0x95))/0xb);if(_0x12c9e5===_0x3864ff)break;else _0x522a81['push'](_0x522a81['shift']());}catch(_0xc40a34){_0x522a81['push'](_0x522a81['shift']());}}}(a178_0x21a0,0xb6f58));function a178_0x21a0(){const _0x4af945=['execSuccess','2bvhoyN','execError','31154560PDrnDZ','appCode','6829122jODAUs','5QCIUNw','exec','str','329288hgWWMy','Returned\x20','now','sqlcode','length','264978AwFCbj','isArray','1373498XIVYge','1561524UVgrdN','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','1427159xBmfDM','params','SQL\x20execution\x20failed','11ArGtgi','261OhYOzS'];a178_0x21a0=function(){return _0x4af945;};return a178_0x21a0();}function a178_0x589d(_0x3f3aa1,_0x3dc228){_0x3f3aa1=_0x3f3aa1-0x88;const _0x21a0a6=a178_0x21a0();let _0x589d17=_0x21a0a6[_0x3f3aa1];return _0x589d17;}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_0x560fa3(0x9e),'description':a178_0x560fa3(0x91),'risk':'read','flags':[SQLCODE_FLAG,{'name':a178_0x560fa3(0x93),'type':'string','description':'SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)'}],async 'execute'(_0x19a963){const _0x48bd31=a178_0x560fa3,_0x24aa88=parseJsonParams(_0x19a963[_0x48bd31(0x9f)](_0x48bd31(0x93))),_0x3f2c75=Date['now'](),_0x3b13c3=await executeSql(_0x19a963[_0x48bd31(0x9b)],_0x19a963[_0x48bd31(0x9f)](_0x48bd31(0x8b)),_0x24aa88),_0x2a8948=Date[_0x48bd31(0x8a)]()-_0x3f2c75,_0x51337b=_0x3b13c3?.['execResult']??_0x3b13c3,_0x54067e=_0x3b13c3?.[_0x48bd31(0x97)]??!![];if(!_0x54067e)return{'ok':![],'data':{'error':_0x3b13c3?.[_0x48bd31(0x99)]||_0x48bd31(0x94),'elapsed':_0x2a8948},'message':_0x48bd31(0x94)};const _0x4af888=Array[_0x48bd31(0x8e)](_0x51337b)?_0x51337b:[];return{'ok':!![],'data':{'rows':_0x4af888,'rowCount':_0x4af888['length'],'elapsed':_0x2a8948},'message':_0x48bd31(0x89)+_0x4af888[_0x48bd31(0x8c)]+'\x20row(s)\x20in\x20'+_0x2a8948+'ms'};}};
1
+ const a186_0xf82e2=a186_0x32b9;(function(_0x1bcabd,_0x384eab){const _0x47aa61=a186_0x32b9,_0x1ad153=_0x1bcabd();while(!![]){try{const _0x2f52e7=parseInt(_0x47aa61(0x186))/0x1+-parseInt(_0x47aa61(0x196))/0x2+parseInt(_0x47aa61(0x18c))/0x3+parseInt(_0x47aa61(0x180))/0x4*(-parseInt(_0x47aa61(0x194))/0x5)+-parseInt(_0x47aa61(0x195))/0x6+-parseInt(_0x47aa61(0x197))/0x7+parseInt(_0x47aa61(0x189))/0x8;if(_0x2f52e7===_0x384eab)break;else _0x1ad153['push'](_0x1ad153['shift']());}catch(_0x226fc2){_0x1ad153['push'](_0x1ad153['shift']());}}}(a186_0x2e3f,0x8980b));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a186_0x2e3f(){const _0x1177a7=['2475378UOklYF','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','execResult','\x20row(s)\x20in\x20','length','params','sql','135AXYiDd','2804232eYXxSb','1402478wZJDSO','6573938XwUWRb','read','Returned\x20','execError','67384sMHdTn','exec','execSuccess','sqlcode','now','str','445620nnnwSI','SQL\x20execution\x20failed','isArray','14840416XWJXUh','string','appCode'];a186_0x2e3f=function(){return _0x1177a7;};return a186_0x2e3f();}function a186_0x32b9(_0xe95e67,_0xc681b4){_0xe95e67=_0xe95e67-0x17f;const _0x2e3ff2=a186_0x2e3f();let _0x32b930=_0x2e3ff2[_0xe95e67];return _0x32b930;}import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a186_0xf82e2(0x193),'command':a186_0xf82e2(0x181),'description':a186_0xf82e2(0x18d),'risk':a186_0xf82e2(0x198),'flags':[SQLCODE_FLAG,{'name':'params','type':a186_0xf82e2(0x18a),'description':a186_0xf82e2(0x18e)}],async 'execute'(_0x3c9897){const _0x261c61=a186_0xf82e2,_0x4b131d=parseJsonParams(_0x3c9897[_0x261c61(0x185)](_0x261c61(0x192))),_0x1cfa0f=Date[_0x261c61(0x184)](),_0x36c073=await executeSql(_0x3c9897[_0x261c61(0x18b)],_0x3c9897['str'](_0x261c61(0x183)),_0x4b131d),_0x599f5f=Date[_0x261c61(0x184)]()-_0x1cfa0f,_0x54ff84=_0x36c073?.[_0x261c61(0x18f)]??_0x36c073,_0x56d835=_0x36c073?.[_0x261c61(0x182)]??!![];if(!_0x56d835)return{'ok':![],'data':{'error':_0x36c073?.[_0x261c61(0x17f)]||_0x261c61(0x187),'elapsed':_0x599f5f},'message':_0x261c61(0x187)};const _0x14832e=Array[_0x261c61(0x188)](_0x54ff84)?_0x54ff84:[];return{'ok':!![],'data':{'rows':_0x14832e,'rowCount':_0x14832e[_0x261c61(0x191)],'elapsed':_0x599f5f},'message':_0x261c61(0x199)+_0x14832e[_0x261c61(0x191)]+_0x261c61(0x190)+_0x599f5f+'ms'};}};
@@ -1 +1 @@
1
- (function(_0x254c25,_0x41a938){const _0x332860=a179_0x42c2,_0x2da0d1=_0x254c25();while(!![]){try{const _0x442b3f=parseInt(_0x332860(0x14d))/0x1*(-parseInt(_0x332860(0x14b))/0x2)+parseInt(_0x332860(0x152))/0x3+-parseInt(_0x332860(0x153))/0x4+-parseInt(_0x332860(0x14e))/0x5+-parseInt(_0x332860(0x14c))/0x6*(parseInt(_0x332860(0x14f))/0x7)+-parseInt(_0x332860(0x150))/0x8+-parseInt(_0x332860(0x151))/0x9*(-parseInt(_0x332860(0x14a))/0xa);if(_0x442b3f===_0x41a938)break;else _0x2da0d1['push'](_0x2da0d1['shift']());}catch(_0x5584c0){_0x2da0d1['push'](_0x2da0d1['shift']());}}}(a179_0x1017,0x862bb));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';import{sqlCreate}from'../../commands/sql/create.js';function a179_0x1017(){const _0x3ec800=['2735620isKvlM','14868390yLqMlq','1049714xvhZjA','102NLjEEX','2fEQxpL','2294335VbnHjr','135121RQnIuC','3576224xLjjGG','18IOKgjI','1630650vsglhK'];a179_0x1017=function(){return _0x3ec800;};return a179_0x1017();}import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';function a179_0x42c2(_0x44b4b2,_0x1972df){_0x44b4b2=_0x44b4b2-0x14a;const _0x101775=a179_0x1017();let _0x42c210=_0x101775[_0x44b4b2];return _0x42c210;}export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
1
+ (function(_0x57b8b6,_0x365077){const _0x3b1ed6=a187_0x2e1e,_0x1448fe=_0x57b8b6();while(!![]){try{const _0x24e7cb=-parseInt(_0x3b1ed6(0x1f6))/0x1+-parseInt(_0x3b1ed6(0x1f7))/0x2+-parseInt(_0x3b1ed6(0x1f8))/0x3*(-parseInt(_0x3b1ed6(0x1f3))/0x4)+parseInt(_0x3b1ed6(0x1f1))/0x5+parseInt(_0x3b1ed6(0x1f5))/0x6*(-parseInt(_0x3b1ed6(0x1f2))/0x7)+-parseInt(_0x3b1ed6(0x1f4))/0x8+parseInt(_0x3b1ed6(0x1f0))/0x9;if(_0x24e7cb===_0x365077)break;else _0x1448fe['push'](_0x1448fe['shift']());}catch(_0x47007d){_0x1448fe['push'](_0x1448fe['shift']());}}}(a187_0x48c0,0xa5f9e));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';function a187_0x48c0(){const _0x5d38c5=['1153630tgQtAT','6SgnQFy','26540325eaBTkv','2706870PtwcfV','35JOfYMH','174424BYpTge','3103704WiPJQg','887898OxRLWV','1192980cuyDSk'];a187_0x48c0=function(){return _0x5d38c5;};return a187_0x48c0();}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';function a187_0x2e1e(_0x74fac,_0x2a69e9){_0x74fac=_0x74fac-0x1f0;const _0x48c0fe=a187_0x48c0();let _0x2e1eb=_0x48c0fe[_0x74fac];return _0x2e1eb;}import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];