@lovrabet/rabetbase-cli 2.5.3-beta.1 → 2.5.3-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (374) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/api/generate-sdk-config-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/logs.d.ts +7 -0
  38. package/lib/commands/bff/logs.js +1 -0
  39. package/lib/commands/bff/pull.js +1 -1
  40. package/lib/commands/bff/push.js +1 -1
  41. package/lib/commands/bff/status.js +1 -1
  42. package/lib/commands/cli-skill/index.js +1 -1
  43. package/lib/commands/cli-update.js +1 -1
  44. package/lib/commands/codegen/index.js +1 -1
  45. package/lib/commands/codegen/sdk.js +1 -1
  46. package/lib/commands/codegen/sql.js +1 -1
  47. package/lib/commands/common/app-registry.js +1 -1
  48. package/lib/commands/common/app-selector.js +1 -1
  49. package/lib/commands/common/async-task.js +1 -1
  50. package/lib/commands/common/dry-run.js +1 -1
  51. package/lib/commands/common/flags.js +1 -1
  52. package/lib/commands/common/local-file.js +1 -1
  53. package/lib/commands/common/validate.js +1 -1
  54. package/lib/commands/config/delete.js +1 -1
  55. package/lib/commands/config/get.js +1 -1
  56. package/lib/commands/config/index.js +1 -1
  57. package/lib/commands/config/init.js +1 -1
  58. package/lib/commands/config/list.js +1 -1
  59. package/lib/commands/config/set.js +1 -1
  60. package/lib/commands/config/shared.js +1 -1
  61. package/lib/commands/dataset/batch-design.d.ts +21 -0
  62. package/lib/commands/dataset/batch-design.js +1 -0
  63. package/lib/commands/dataset/business-group-update.js +1 -1
  64. package/lib/commands/dataset/business-groups.js +1 -1
  65. package/lib/commands/dataset/capability.js +1 -1
  66. package/lib/commands/dataset/delete.js +1 -1
  67. package/lib/commands/dataset/detail.js +1 -1
  68. package/lib/commands/dataset/extend-update.js +1 -1
  69. package/lib/commands/dataset/field-restore.js +1 -1
  70. package/lib/commands/dataset/field-update.js +1 -1
  71. package/lib/commands/dataset/generate.js +1 -1
  72. package/lib/commands/dataset/index.js +1 -1
  73. package/lib/commands/dataset/list.js +1 -1
  74. package/lib/commands/dataset/operations.js +1 -1
  75. package/lib/commands/dataset/relation-audit.js +1 -1
  76. package/lib/commands/dataset/relation-create.js +1 -1
  77. package/lib/commands/dataset/relation-delete.js +1 -1
  78. package/lib/commands/dataset/relation-shared.js +1 -1
  79. package/lib/commands/dataset/relation-update.js +1 -1
  80. package/lib/commands/dataset/relations.js +1 -1
  81. package/lib/commands/dataset/rename.js +1 -1
  82. package/lib/commands/dataset/restore.js +1 -1
  83. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  84. package/lib/commands/db/analysis-batching.js +1 -1
  85. package/lib/commands/db/analyze-batch-plan.js +1 -1
  86. package/lib/commands/db/analyze-cancel.js +1 -1
  87. package/lib/commands/db/analyze-start.js +1 -1
  88. package/lib/commands/db/analyze-status.js +1 -1
  89. package/lib/commands/db/create.js +1 -1
  90. package/lib/commands/db/delete.js +1 -1
  91. package/lib/commands/db/detail.js +1 -1
  92. package/lib/commands/db/diff-refresh-start.js +1 -1
  93. package/lib/commands/db/diff-refresh-status.js +1 -1
  94. package/lib/commands/db/diff.js +1 -1
  95. package/lib/commands/db/index.js +1 -1
  96. package/lib/commands/db/list.js +1 -1
  97. package/lib/commands/db/shared.js +1 -1
  98. package/lib/commands/db/table-diff-shared.js +1 -1
  99. package/lib/commands/db/tables.js +1 -1
  100. package/lib/commands/db/test.js +1 -1
  101. package/lib/commands/db/update.js +1 -1
  102. package/lib/commands/deployment/index.js +1 -1
  103. package/lib/commands/deployment/sync-all.js +1 -1
  104. package/lib/commands/deployment/sync-jobs.js +1 -1
  105. package/lib/commands/deployment/sync-status.js +1 -1
  106. package/lib/commands/doctor.js +1 -1
  107. package/lib/commands/file/index.js +1 -1
  108. package/lib/commands/flow/create.d.ts +2 -0
  109. package/lib/commands/flow/create.js +1 -0
  110. package/lib/commands/flow/detail.d.ts +2 -0
  111. package/lib/commands/flow/detail.js +1 -0
  112. package/lib/commands/flow/index.d.ts +3 -0
  113. package/lib/commands/flow/index.js +1 -0
  114. package/lib/commands/flow/list.d.ts +2 -0
  115. package/lib/commands/flow/list.js +1 -0
  116. package/lib/commands/flow/publish.d.ts +2 -0
  117. package/lib/commands/flow/publish.js +1 -0
  118. package/lib/commands/flow/runtime-resources-shared.d.ts +40 -0
  119. package/lib/commands/flow/runtime-resources-shared.js +1 -0
  120. package/lib/commands/flow/runtime-role-list.d.ts +2 -0
  121. package/lib/commands/flow/runtime-role-list.js +1 -0
  122. package/lib/commands/flow/runtime-role-user-list.d.ts +2 -0
  123. package/lib/commands/flow/runtime-role-user-list.js +1 -0
  124. package/lib/commands/flow/runtime-user-search.d.ts +2 -0
  125. package/lib/commands/flow/runtime-user-search.js +1 -0
  126. package/lib/commands/flow/shared.d.ts +41 -0
  127. package/lib/commands/flow/shared.js +1 -0
  128. package/lib/commands/flow/update.d.ts +2 -0
  129. package/lib/commands/flow/update.js +1 -0
  130. package/lib/commands/flow/validate.d.ts +3 -0
  131. package/lib/commands/flow/validate.js +1 -0
  132. package/lib/commands/instant-api-policy/current.js +1 -1
  133. package/lib/commands/instant-api-policy/index.js +1 -1
  134. package/lib/commands/instant-api-policy/init.js +1 -1
  135. package/lib/commands/instant-api-policy/publish.js +1 -1
  136. package/lib/commands/instant-api-policy/pull.js +1 -1
  137. package/lib/commands/instant-api-policy/revision.js +1 -1
  138. package/lib/commands/instant-api-policy/revisions.js +1 -1
  139. package/lib/commands/instant-api-policy/rollback.js +1 -1
  140. package/lib/commands/instant-api-policy/shared.js +1 -1
  141. package/lib/commands/instant-api-policy/validate.js +1 -1
  142. package/lib/commands/issue/index.js +1 -1
  143. package/lib/commands/issue/nudge.js +1 -1
  144. package/lib/commands/issue/report.js +1 -1
  145. package/lib/commands/issue/shared.js +1 -1
  146. package/lib/commands/kb/create.js +1 -1
  147. package/lib/commands/kb/delete.js +1 -1
  148. package/lib/commands/kb/detail.js +1 -1
  149. package/lib/commands/kb/index.js +1 -1
  150. package/lib/commands/kb/list.js +1 -1
  151. package/lib/commands/kb/search.js +1 -1
  152. package/lib/commands/kb/shared.js +1 -1
  153. package/lib/commands/kb/update.js +1 -1
  154. package/lib/commands/logs/index.js +1 -1
  155. package/lib/commands/menu/asset-update.js +1 -1
  156. package/lib/commands/menu/delete.js +1 -1
  157. package/lib/commands/menu/external-link-create.js +1 -1
  158. package/lib/commands/menu/external-link-update.js +1 -1
  159. package/lib/commands/menu/group-create.js +1 -1
  160. package/lib/commands/menu/group-update.js +1 -1
  161. package/lib/commands/menu/index.js +1 -1
  162. package/lib/commands/menu/list.js +1 -1
  163. package/lib/commands/menu/move.js +1 -1
  164. package/lib/commands/menu/regroup-start.js +1 -1
  165. package/lib/commands/menu/rename.js +1 -1
  166. package/lib/commands/menu/shared/compare-table.js +1 -1
  167. package/lib/commands/menu/shared/delete-plan.js +1 -1
  168. package/lib/commands/menu/shared/facts.js +1 -1
  169. package/lib/commands/menu/shared/index.js +1 -1
  170. package/lib/commands/menu/shared/inquirer.js +1 -1
  171. package/lib/commands/menu/shared/local-pages.js +1 -1
  172. package/lib/commands/menu/shared/logic.js +1 -1
  173. package/lib/commands/menu/shared/mutations.js +1 -1
  174. package/lib/commands/menu/shared/service.js +1 -1
  175. package/lib/commands/menu/shared/sync-core.js +1 -1
  176. package/lib/commands/menu/shared/update-core.js +1 -1
  177. package/lib/commands/menu/shared/valid-url.js +1 -1
  178. package/lib/commands/menu/sync.js +1 -1
  179. package/lib/commands/menu/visibility-update.js +1 -1
  180. package/lib/commands/notification/config-create.js +1 -1
  181. package/lib/commands/notification/config-delete.js +1 -1
  182. package/lib/commands/notification/config-list.js +1 -1
  183. package/lib/commands/notification/config-update.js +1 -1
  184. package/lib/commands/notification/index.js +1 -1
  185. package/lib/commands/notification/shared.js +1 -1
  186. package/lib/commands/ocr/index.js +1 -1
  187. package/lib/commands/page/create.js +1 -1
  188. package/lib/commands/page/custom/detail.js +1 -1
  189. package/lib/commands/page/custom/list.js +1 -1
  190. package/lib/commands/page/custom/publish.js +1 -1
  191. package/lib/commands/page/custom/shared.js +1 -1
  192. package/lib/commands/page/custom/syntax.js +1 -1
  193. package/lib/commands/page/custom/update.js +1 -1
  194. package/lib/commands/page/data-list-status.js +1 -1
  195. package/lib/commands/page/generate-start.js +1 -1
  196. package/lib/commands/page/generate-status.js +1 -1
  197. package/lib/commands/page/index.js +1 -1
  198. package/lib/commands/page/pull.js +1 -1
  199. package/lib/commands/page/push.js +1 -1
  200. package/lib/commands/page/relation-audit.js +1 -1
  201. package/lib/commands/page/restore.js +1 -1
  202. package/lib/commands/page/shared.js +1 -1
  203. package/lib/commands/page/sync.js +1 -1
  204. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  205. package/lib/commands/project/create/format-elapsed.js +1 -1
  206. package/lib/commands/project/create/main.js +1 -1
  207. package/lib/commands/project/create/materialize-project-template.js +1 -1
  208. package/lib/commands/project/create/project-name.js +1 -1
  209. package/lib/commands/project/create/project-template-archive.js +1 -1
  210. package/lib/commands/project/create/project-template-path.js +1 -1
  211. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  212. package/lib/commands/project/create/use-format-code.js +1 -1
  213. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  214. package/lib/commands/project/domain-routing-sync.js +1 -1
  215. package/lib/commands/project/index.js +1 -1
  216. package/lib/commands/project/upgrade.js +1 -1
  217. package/lib/commands/registry.js +1 -1
  218. package/lib/commands/role/delete.js +1 -1
  219. package/lib/commands/role/detail.js +1 -1
  220. package/lib/commands/role/index.js +1 -1
  221. package/lib/commands/role/list.js +1 -1
  222. package/lib/commands/role/shared.js +1 -1
  223. package/lib/commands/role/update.js +1 -1
  224. package/lib/commands/role/user-add.js +1 -1
  225. package/lib/commands/role/user-remove.js +1 -1
  226. package/lib/commands/role/user-resolve.js +1 -1
  227. package/lib/commands/rule/get.js +1 -1
  228. package/lib/commands/rule/index.js +1 -1
  229. package/lib/commands/rule/list.js +1 -1
  230. package/lib/commands/rule/set.js +1 -1
  231. package/lib/commands/rule/shared.js +1 -1
  232. package/lib/commands/run/index.js +1 -1
  233. package/lib/commands/schema.js +1 -1
  234. package/lib/commands/sql/create.js +1 -1
  235. package/lib/commands/sql/delete.js +1 -1
  236. package/lib/commands/sql/detail.js +1 -1
  237. package/lib/commands/sql/exec.js +1 -1
  238. package/lib/commands/sql/index.js +1 -1
  239. package/lib/commands/sql/list.js +1 -1
  240. package/lib/commands/sql/pull.js +1 -1
  241. package/lib/commands/sql/push.js +1 -1
  242. package/lib/commands/sql/shared.js +1 -1
  243. package/lib/commands/sql/status.js +1 -1
  244. package/lib/commands/sql/validate.js +1 -1
  245. package/lib/commands/task/index.js +1 -1
  246. package/lib/commands/task/status.js +1 -1
  247. package/lib/commands/tenant/index.js +1 -1
  248. package/lib/commands/tenant/members-list.js +1 -1
  249. package/lib/commands/tenant/shared.js +1 -1
  250. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  251. package/lib/commands/user-account/index.js +1 -1
  252. package/lib/commands/workspace/add.js +1 -1
  253. package/lib/commands/workspace/index.js +1 -1
  254. package/lib/commands/workspace/remove.js +1 -1
  255. package/lib/config/domain-config.js +1 -1
  256. package/lib/config/project-domain-routing.js +1 -1
  257. package/lib/config/region-config.js +1 -1
  258. package/lib/config/schema.js +1 -1
  259. package/lib/constant/cdn.js +1 -1
  260. package/lib/constant/cli.js +1 -1
  261. package/lib/constant/defaults.js +1 -1
  262. package/lib/constant/domain.js +1 -1
  263. package/lib/constant/env.js +1 -1
  264. package/lib/constant/output.js +1 -1
  265. package/lib/constant/paths.js +1 -1
  266. package/lib/constant/region.js +1 -1
  267. package/lib/constant/risk.js +1 -1
  268. package/lib/constant/routing-profile.js +1 -1
  269. package/lib/context/app-resolver.js +1 -1
  270. package/lib/context/auth-resolver.js +1 -1
  271. package/lib/context/config-loader.js +1 -1
  272. package/lib/context.js +1 -1
  273. package/lib/core/alias-resolver.js +1 -1
  274. package/lib/core/api-client.d.ts +170 -1
  275. package/lib/core/api-client.js +1 -1
  276. package/lib/core/bff/config.js +1 -1
  277. package/lib/core/bff/file-system.js +1 -1
  278. package/lib/core/bff/hash.js +1 -1
  279. package/lib/core/bff/hook-directory.d.ts +55 -0
  280. package/lib/core/bff/hook-directory.js +1 -0
  281. package/lib/core/bff/lock.js +1 -1
  282. package/lib/core/bff/types.d.ts +15 -0
  283. package/lib/core/bff/utils.js +1 -1
  284. package/lib/core/db-resolver.js +1 -1
  285. package/lib/core/flow-config.d.ts +628 -0
  286. package/lib/core/flow-config.js +1 -0
  287. package/lib/core/instant-api-policy/config.js +1 -1
  288. package/lib/core/kb-search-client.js +1 -1
  289. package/lib/core/page/file-system.js +1 -1
  290. package/lib/core/page/hash.js +1 -1
  291. package/lib/core/page/lock.js +1 -1
  292. package/lib/core/page/lr-smart-jsx.js +1 -1
  293. package/lib/core/sql-index-auditor.js +1 -1
  294. package/lib/core/sql-sync/config.js +1 -1
  295. package/lib/core/sql-sync/file-system.js +1 -1
  296. package/lib/core/sql-sync/hash.js +1 -1
  297. package/lib/core/sql-sync/lock.js +1 -1
  298. package/lib/core/sql-sync/utils.js +1 -1
  299. package/lib/core/sql-validator.js +1 -1
  300. package/lib/errors.js +1 -1
  301. package/lib/framework/build-all-flags.js +1 -1
  302. package/lib/framework/error-output.js +1 -1
  303. package/lib/framework/explicit-yes.js +1 -1
  304. package/lib/framework/flags.js +1 -1
  305. package/lib/framework/help.js +1 -1
  306. package/lib/framework/index.js +1 -1
  307. package/lib/framework/output.js +1 -1
  308. package/lib/framework/response.js +1 -1
  309. package/lib/framework/runner-alias.js +1 -1
  310. package/lib/framework/runner.js +1 -1
  311. package/lib/framework/schema-export.js +1 -1
  312. package/lib/framework/supported-flags.js +1 -1
  313. package/lib/framework/types.js +1 -1
  314. package/lib/generated/build-info.d.ts +4 -4
  315. package/lib/generated/build-info.js +1 -1
  316. package/lib/generated/official-routing.js +1 -1
  317. package/lib/generated/routing-contract.js +1 -1
  318. package/lib/help.js +1 -1
  319. package/lib/postinstall.js +1 -1
  320. package/lib/runtime/confirmation.js +1 -1
  321. package/lib/runtime/event.js +1 -1
  322. package/lib/runtime/index.js +1 -1
  323. package/lib/runtime/queue.js +1 -1
  324. package/lib/runtime/resolve.js +1 -1
  325. package/lib/skills/builtin-skill.js +1 -1
  326. package/lib/skills/main.js +1 -1
  327. package/lib/skills/npx-skills-add.js +1 -1
  328. package/lib/skills/skill-presence.js +1 -1
  329. package/lib/telemetry/cli-command-trace.js +1 -1
  330. package/lib/telemetry/cli-help-trace.js +1 -1
  331. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  332. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  333. package/lib/telemetry/send-cli-trace-log.js +1 -1
  334. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  335. package/lib/utils/ai_config.js +1 -1
  336. package/lib/utils/apply-jq-filter.js +1 -1
  337. package/lib/utils/cdn-config.js +1 -1
  338. package/lib/utils/check-sdk-version.js +1 -1
  339. package/lib/utils/cli-version-check.js +1 -1
  340. package/lib/utils/cli-version-policy.js +1 -1
  341. package/lib/utils/config.js +1 -1
  342. package/lib/utils/entity-with-id.js +1 -1
  343. package/lib/utils/file-utils.js +1 -1
  344. package/lib/utils/guides-cdn.js +1 -1
  345. package/lib/utils/http-client.js +1 -1
  346. package/lib/utils/is-non-interactive.js +1 -1
  347. package/lib/utils/logger.js +1 -1
  348. package/lib/utils/params.js +1 -1
  349. package/lib/utils/platform.js +1 -1
  350. package/lib/utils/sleep.js +1 -1
  351. package/lib/utils/template-replacer.js +1 -1
  352. package/lib/utils/update-notice.js +1 -1
  353. package/lib/utils/version.js +1 -1
  354. package/lib/utils/with-active-cookie.js +1 -1
  355. package/lib/utils/write-cli-side-channel.js +1 -1
  356. package/package.json +1 -1
  357. package/skills/rabetbase/SKILL.md +22 -4
  358. package/skills/rabetbase/guides/approval-flow-development-workflow.md +137 -0
  359. package/skills/rabetbase/guides/backend-function.md +19 -9
  360. package/skills/rabetbase/guides/bff-creation-workflow.md +10 -1
  361. package/skills/rabetbase/guides/conflict-detection.md +2 -0
  362. package/skills/rabetbase/guides/sdk-client-generation.md +1 -0
  363. package/skills/rabetbase/knowledge/approval-flow/config-json-schema.md +290 -0
  364. package/skills/rabetbase/references/rabetbase-bff-create.md +1 -1
  365. package/skills/rabetbase/references/rabetbase-bff-logs.md +47 -0
  366. package/skills/rabetbase/references/rabetbase-bff-pull.md +7 -3
  367. package/skills/rabetbase/references/rabetbase-bff-push.md +10 -2
  368. package/skills/rabetbase/references/rabetbase-dataset-generate.md +52 -2
  369. package/skills/rabetbase/references/rabetbase-flow-commands.md +86 -0
  370. package/skills/rabetbase/references/rabetbase-flow-resources.md +83 -0
  371. package/skills/rabetbase/references/rabetbase-flow-runtime-boundary.md +25 -0
  372. package/skills/rabetbase/references/rabetbase-instant-api-policy.md +103 -11
  373. package/skills/rabetbase/references/rabetbase-notification-config-list.md +17 -0
  374. package/skills/rabetbase.manifest.json +9 -3
@@ -1 +1 @@
1
- function a193_0x5d42(){const _0x18370d=['type','OWNER','33540KtghXu','Use\x20one\x20of:\x20','Filter\x20by\x20role\x20type','203mFQbPd','ADMIN','appCode','10ypezRE','4268OEtENK','DEV','1043559ipTGyM','11290ABSJHA','filter','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','page','471259vAXQmh','356967OvYsEV','includes','validation','role','str','Found\x20','trim','string','length','pagesize','read','2366286kzUczJ','184xlSSwX','Page\x20size\x20(1-100)','num','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','CUSTOM','toUpperCase','31128FEZqNt','Invalid\x20--type\x20\x22','number'];a193_0x5d42=function(){return _0x18370d;};return a193_0x5d42();}const a193_0x13dfdf=a193_0x5366;(function(_0x3e1e9a,_0x57365c){const _0xccad8=a193_0x5366,_0xd13be4=_0x3e1e9a();while(!![]){try{const _0x539d6c=parseInt(_0xccad8(0x1cd))/0x1+-parseInt(_0xccad8(0x1c5))/0x2*(-parseInt(_0xccad8(0x1ce))/0x3)+-parseInt(_0xccad8(0x1da))/0x4*(parseInt(_0xccad8(0x1bf))/0x5)+parseInt(_0xccad8(0x1d9))/0x6+-parseInt(_0xccad8(0x1c2))/0x7*(parseInt(_0xccad8(0x1ba))/0x8)+-parseInt(_0xccad8(0x1c8))/0x9+-parseInt(_0xccad8(0x1c9))/0xa*(parseInt(_0xccad8(0x1c6))/0xb);if(_0x539d6c===_0x57365c)break;else _0xd13be4['push'](_0xd13be4['shift']());}catch(_0x551880){_0xd13be4['push'](_0xd13be4['shift']());}}}(a193_0x5d42,0x76737));import{listAppRoles}from'../../core/api-client.js';function a193_0x5366(_0x4a26d6,_0x5d6242){_0x4a26d6=_0x4a26d6-0x1b5;const _0x5d42bd=a193_0x5d42();let _0x5366da=_0x5d42bd[_0x4a26d6];return _0x5366da;}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a193_0x13dfdf(0x1c3),a193_0x13dfdf(0x1c7),a193_0x13dfdf(0x1be),a193_0x13dfdf(0x1b8)];export const roleList={'service':a193_0x13dfdf(0x1d1),'command':'list','description':a193_0x13dfdf(0x1b7),'risk':a193_0x13dfdf(0x1d8),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a193_0x13dfdf(0x1bd),'type':a193_0x13dfdf(0x1d5),'required':![],'description':a193_0x13dfdf(0x1c1),'enum':ROLE_TYPES},{'name':'page','type':a193_0x13dfdf(0x1bc),'description':'Page\x20index\x20(1-based)','default':0x1},{'name':a193_0x13dfdf(0x1d7),'type':a193_0x13dfdf(0x1bc),'description':a193_0x13dfdf(0x1b5),'default':0x64}],async 'validate'(_0xe21167){const _0x40dbb7=a193_0x13dfdf,_0x1ebb32=_0xe21167[_0x40dbb7(0x1d2)](_0x40dbb7(0x1bd))['trim']();if(_0x1ebb32&&!ROLE_TYPES[_0x40dbb7(0x1cf)](_0x1ebb32[_0x40dbb7(0x1b9)]()))throw CliErrors[_0x40dbb7(0x1d0)](_0x40dbb7(0x1bb)+_0x1ebb32+'\x22.',_0x40dbb7(0x1c0)+ROLE_TYPES['join'](',\x20')+'.');const _0x12d5cf=_0xe21167[_0x40dbb7(0x1b6)](_0x40dbb7(0x1cc),0x1),_0x205d0a=_0xe21167[_0x40dbb7(0x1b6)](_0x40dbb7(0x1d7),0x64);if(_0x12d5cf<0x1)throw CliErrors['validation']('--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.');if(_0x205d0a<0x1||_0x205d0a>0x64)throw CliErrors[_0x40dbb7(0x1d0)](_0x40dbb7(0x1cb));},async 'execute'(_0x425198){const _0xb9091c=a193_0x13dfdf,_0x4c0a28=_0x425198[_0xb9091c(0x1b6)](_0xb9091c(0x1cc),0x1)||0x1,_0x1ef26d=_0x425198[_0xb9091c(0x1b6)]('pagesize',0x64)||0x64,_0x12dac1=_0x425198['str']('type')[_0xb9091c(0x1d4)]()[_0xb9091c(0x1b9)](),{items:_0x30ad39,paging:_0x496c72}=await listAppRoles(_0x425198[_0xb9091c(0x1c4)],{'currentPage':_0x4c0a28,'pageSize':_0x1ef26d}),_0xea610a=_0x12dac1?_0x30ad39[_0xb9091c(0x1ca)](_0x271e6b=>_0x271e6b['roleType']===_0x12dac1):_0x30ad39,_0xc8ba11=_0xea610a['map'](projectRole);return{'ok':!![],'data':{'scope':'dev','roles':_0xc8ba11,'paging':_0x496c72},'message':_0xb9091c(0x1d3)+_0xc8ba11[_0xb9091c(0x1d6)]+'\x20role(s)'};}};
1
+ const a207_0x24e629=a207_0x3d78;function a207_0x4e10(){const _0x13014a=['9dNBGgK','string','177aRbgLg','length','\x20role(s)','read','join','91044BpbJjw','page','role','num','trim','Found\x20','toUpperCase','includes','6924235zQtzJF','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','Invalid\x20--type\x20\x22','number','dev','105717lRcCDM','type','Filter\x20by\x20role\x20type','filter','5182384dQduxS','list','validation','20353080xTobyy','Page\x20index\x20(1-based)','CUSTOM','appCode','DEV','350DmmzYY','str','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','1622992dCkjJC','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','36006ElvKBe','ADMIN','Page\x20size\x20(1-100)','pagesize'];a207_0x4e10=function(){return _0x13014a;};return a207_0x4e10();}(function(_0x52e1e4,_0x1693fe){const _0x1c3c1b=a207_0x3d78,_0x35d13d=_0x52e1e4();while(!![]){try{const _0x253912=-parseInt(_0x1c3c1b(0x12d))/0x1+-parseInt(_0x1c3c1b(0x113))/0x2+parseInt(_0x1c3c1b(0x11b))/0x3*(parseInt(_0x1c3c1b(0x120))/0x4)+-parseInt(_0x1c3c1b(0x128))/0x5+parseInt(_0x1c3c1b(0x115))/0x6*(parseInt(_0x1c3c1b(0x110))/0x7)+-parseInt(_0x1c3c1b(0x131))/0x8*(parseInt(_0x1c3c1b(0x119))/0x9)+parseInt(_0x1c3c1b(0x134))/0xa;if(_0x253912===_0x1693fe)break;else _0x35d13d['push'](_0x35d13d['shift']());}catch(_0x5f24ba){_0x35d13d['push'](_0x35d13d['shift']());}}}(a207_0x4e10,0xb1d4f));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a207_0x3d78(_0x35674e,_0x48a095){_0x35674e=_0x35674e-0x10c;const _0x4e1019=a207_0x4e10();let _0x3d784=_0x4e1019[_0x35674e];return _0x3d784;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a207_0x24e629(0x116),a207_0x24e629(0x10f),'OWNER',a207_0x24e629(0x10d)];export const roleList={'service':a207_0x24e629(0x122),'command':a207_0x24e629(0x132),'description':a207_0x24e629(0x112),'risk':a207_0x24e629(0x11e),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a207_0x24e629(0x12e),'type':a207_0x24e629(0x11a),'required':![],'description':a207_0x24e629(0x12f),'enum':ROLE_TYPES},{'name':a207_0x24e629(0x121),'type':a207_0x24e629(0x12b),'description':a207_0x24e629(0x10c),'default':0x1},{'name':a207_0x24e629(0x118),'type':'number','description':a207_0x24e629(0x117),'default':0x64}],async 'validate'(_0x2260bf){const _0x46b1b2=a207_0x24e629,_0xf8b97f=_0x2260bf[_0x46b1b2(0x111)](_0x46b1b2(0x12e))[_0x46b1b2(0x124)]();if(_0xf8b97f&&!ROLE_TYPES[_0x46b1b2(0x127)](_0xf8b97f['toUpperCase']()))throw CliErrors[_0x46b1b2(0x133)](_0x46b1b2(0x12a)+_0xf8b97f+'\x22.','Use\x20one\x20of:\x20'+ROLE_TYPES[_0x46b1b2(0x11f)](',\x20')+'.');const _0x7b4c10=_0x2260bf[_0x46b1b2(0x123)]('page',0x1),_0x55f1b7=_0x2260bf[_0x46b1b2(0x123)]('pagesize',0x64);if(_0x7b4c10<0x1)throw CliErrors[_0x46b1b2(0x133)](_0x46b1b2(0x129));if(_0x55f1b7<0x1||_0x55f1b7>0x64)throw CliErrors['validation'](_0x46b1b2(0x114));},async 'execute'(_0x725e1e){const _0x44a481=a207_0x24e629,_0xa2107b=_0x725e1e[_0x44a481(0x123)](_0x44a481(0x121),0x1)||0x1,_0x5ca580=_0x725e1e[_0x44a481(0x123)](_0x44a481(0x118),0x64)||0x64,_0x13f6fa=_0x725e1e[_0x44a481(0x111)](_0x44a481(0x12e))[_0x44a481(0x124)]()[_0x44a481(0x126)](),{items:_0x5022c7,paging:_0x4d4204}=await listAppRoles(_0x725e1e[_0x44a481(0x10e)],{'currentPage':_0xa2107b,'pageSize':_0x5ca580}),_0x41fb2f=_0x13f6fa?_0x5022c7[_0x44a481(0x130)](_0x312145=>_0x312145['roleType']===_0x13f6fa):_0x5022c7,_0x4133ff=_0x41fb2f['map'](projectRole);return{'ok':!![],'data':{'scope':_0x44a481(0x12c),'roles':_0x4133ff,'paging':_0x4d4204},'message':_0x44a481(0x125)+_0x4133ff[_0x44a481(0x11c)]+_0x44a481(0x11d)};}};
@@ -1 +1 @@
1
- const a194_0x5a2978=a194_0x4732;(function(_0x4df329,_0x1f1faa){const _0x4e4bc9=a194_0x4732,_0x5f2d08=_0x4df329();while(!![]){try{const _0x16123a=parseInt(_0x4e4bc9(0xf8))/0x1*(parseInt(_0x4e4bc9(0xfe))/0x2)+parseInt(_0x4e4bc9(0xef))/0x3+parseInt(_0x4e4bc9(0x103))/0x4*(parseInt(_0x4e4bc9(0x11d))/0x5)+-parseInt(_0x4e4bc9(0xff))/0x6+-parseInt(_0x4e4bc9(0x109))/0x7*(-parseInt(_0x4e4bc9(0xf1))/0x8)+parseInt(_0x4e4bc9(0xec))/0x9*(parseInt(_0x4e4bc9(0x111))/0xa)+-parseInt(_0x4e4bc9(0x104))/0xb;if(_0x16123a===_0x1f1faa)break;else _0x5f2d08['push'](_0x5f2d08['shift']());}catch(_0x5186f8){_0x5f2d08['push'](_0x5f2d08['shift']());}}}(a194_0x4d1b,0xaa47d));import{getTenantMembers,listDevUserRoleRelations,listAppRoles}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':a194_0x5a2978(0x11e),'required':!![],'description':a194_0x5a2978(0x10c)};export const ROLE_REF_FLAG={'name':a194_0x5a2978(0x116),'type':a194_0x5a2978(0x12d),'required':!![],'description':a194_0x5a2978(0x12e)};export const USER_REF_FLAG={'name':a194_0x5a2978(0x119),'type':a194_0x5a2978(0x12d),'required':!![],'description':a194_0x5a2978(0x102)};export const NAME_FLAG={'name':a194_0x5a2978(0xf4),'type':'string','required':!![],'description':'Role\x20name'};export const USER_NAME_FLAG={'name':a194_0x5a2978(0xf4),'type':a194_0x5a2978(0x12d),'required':!![],'description':a194_0x5a2978(0xf2)};export const REMARK_FLAG={'name':a194_0x5a2978(0xea),'type':'string','required':![],'description':a194_0x5a2978(0x105)};export const EXPECT_USER_COUNT_FLAG={'name':a194_0x5a2978(0x11f),'type':a194_0x5a2978(0x11e),'required':![],'description':a194_0x5a2978(0x122)};export const BUILTIN_ROLE_TYPES=['ADMIN',a194_0x5a2978(0x128),a194_0x5a2978(0x106)];export function isBuiltinRole(_0x80903a){const _0x3722c8=a194_0x5a2978;return BUILTIN_ROLE_TYPES[_0x3722c8(0xf5)](_0x80903a);}export function assertCustomRole(_0x433571,_0x216225){const _0x3e516c=a194_0x5a2978;if(_0x433571['roleType']!==_0x3e516c(0xf3))throw CliErrors[_0x3e516c(0x110)](_0x3e516c(0xe9)+_0x216225+'\x20built-in\x20role\x20'+_0x433571['roleName']+'\x20('+_0x433571[_0x3e516c(0xfb)]+').',_0x3e516c(0xee));}export function projectRole(_0x20cdda){const _0x1641ef=a194_0x5a2978;return{'id':_0x20cdda['id'],'roleName':_0x20cdda['roleName'],'roleType':_0x20cdda['roleType'],'remark':_0x20cdda[_0x1641ef(0xea)],'userCount':_0x20cdda[_0x1641ef(0xfa)],'permitCount':_0x20cdda[_0x1641ef(0x12a)],'builtin':isBuiltinRole(_0x20cdda[_0x1641ef(0xfb)])};}export async function resolveRoleRef(_0x352239,_0x10601c){const _0x45f3d3=a194_0x5a2978,_0x90817c=_0x10601c['trim']();if(!_0x90817c)throw CliErrors[_0x45f3d3(0x110)](_0x45f3d3(0x113),_0x45f3d3(0x127));if(/^\d+$/['test'](_0x90817c))return getRoleById(_0x352239,Number(_0x90817c));const _0xfcc287=await listAllAppRoles(_0x352239),_0x6e2e1c=_0xfcc287[_0x45f3d3(0x124)](_0x36ac2d=>_0x36ac2d['roleName']===_0x90817c);if(_0x6e2e1c[_0x45f3d3(0x118)]===0x0)throw CliErrors[_0x45f3d3(0x110)](_0x45f3d3(0xf9)+_0x90817c+'\x22\x20not\x20found\x20in\x20app\x20'+_0x352239+'.',_0x45f3d3(0xfc));if(_0x6e2e1c['length']>0x1){const _0x57e10f=_0x6e2e1c[_0x45f3d3(0x126)](_0x17739d=>_0x17739d['id'])[_0x45f3d3(0x117)](',\x20');throw CliErrors[_0x45f3d3(0x110)]('Role\x20name\x20\x22'+_0x90817c+_0x45f3d3(0x132)+_0x57e10f+').','Disambiguate\x20with\x20--role\x20<id>.');}return _0x6e2e1c[0x0];}export async function getRoleById(_0x2abe96,_0x221691){const _0x189b41=a194_0x5a2978,_0x414629=await listAllAppRoles(_0x2abe96),_0xa640be=_0x414629['filter'](_0x4ee034=>_0x4ee034['id']===_0x221691&&(!_0x4ee034[_0x189b41(0x10e)]||_0x4ee034['appCode']===_0x2abe96));if(_0xa640be[_0x189b41(0x118)]!==0x1)throw CliErrors[_0x189b41(0x110)](_0x189b41(0x10a)+_0x221691+'\x20not\x20found\x20in\x20app\x20'+_0x2abe96+'.',_0x189b41(0x12c));return _0xa640be[0x0];}async function listAllAppRoles(_0x228834){const _0x3f20e4=a194_0x5a2978,_0x5b9bed=0x64,_0x513768=[];for(let _0x347272=0x1;;_0x347272+=0x1){const {items:_0x1b08c0,paging:_0x3c2203}=await listAppRoles(_0x228834,{'currentPage':_0x347272,'pageSize':_0x5b9bed});_0x513768[_0x3f20e4(0x10b)](..._0x1b08c0);if(_0x1b08c0['length']<_0x5b9bed||_0x3c2203&&_0x513768[_0x3f20e4(0x118)]>=_0x3c2203[_0x3f20e4(0x134)])return _0x513768;}}export async function resolveTenantCode(){const _0x46db2c=a194_0x5a2978,_0x59647f=await getSessionUserInfo(),_0x5c5e56=_0x59647f?.[_0x46db2c(0x119)]?.['tenant']?.['tenant_code'];if(!_0x5c5e56)throw CliErrors[_0x46db2c(0x12b)](_0x46db2c(0x100));return _0x5c5e56;}function matchMember(_0x3d0ddc,_0x29f484){const _0x28ba95=a194_0x5a2978,_0x1c7d48=_0x29f484[_0x28ba95(0xf0)]()['toLowerCase']();return(_0x3d0ddc[_0x28ba95(0x10f)]??'')[_0x28ba95(0xed)]()===_0x1c7d48||(_0x3d0ddc[_0x28ba95(0x129)]??'')[_0x28ba95(0xed)]()===_0x1c7d48;}export async function resolveUserRef(_0x586bc5,_0x18e8fe='Pass\x20--user\x20<id>.'){const _0x2dcf12=a194_0x5a2978,_0xbc0f5e=_0x586bc5[_0x2dcf12(0xf0)]();if(!_0xbc0f5e)throw CliErrors[_0x2dcf12(0x110)](_0x2dcf12(0xe8),_0x2dcf12(0x11c));const _0x909f4f=await resolveTenantCode(),_0x5c2095=await getTenantMembers(_0x909f4f);if(/^\d+$/['test'](_0xbc0f5e)){const _0x3379b9=Number(_0xbc0f5e),_0x76e444=_0x5c2095[_0x2dcf12(0xf7)](_0x1d8d45=>_0x1d8d45[_0x2dcf12(0xe7)]===_0x3379b9);return{'userId':_0x3379b9,'username':_0x76e444?.[_0x2dcf12(0x129)]??String(_0x3379b9),'nickname':_0x76e444?.[_0x2dcf12(0x10f)],'matchedBy':'id'};}const _0x56a850=_0x5c2095[_0x2dcf12(0x124)](_0x24fc58=>matchMember(_0x24fc58,_0xbc0f5e));if(_0x56a850[_0x2dcf12(0x118)]===0x0)throw CliErrors[_0x2dcf12(0x110)](_0x2dcf12(0x123)+_0xbc0f5e+'\x22.',_0x2dcf12(0x12f)+_0x18e8fe);if(_0x56a850['length']>0x1){const _0x5e2dbb=_0x56a850[_0x2dcf12(0x126)](_0x246bc3=>(_0x246bc3[_0x2dcf12(0x10f)]??_0x246bc3[_0x2dcf12(0x129)]??'?')+'('+_0x246bc3[_0x2dcf12(0xe7)]+')')[_0x2dcf12(0x117)](',\x20');throw CliErrors[_0x2dcf12(0x110)]('Multiple\x20tenant\x20members\x20match\x20\x22'+_0xbc0f5e+_0x2dcf12(0xf6)+_0x5e2dbb+'.',_0x18e8fe);}const _0x20c8db=_0x56a850[0x0];return{'userId':_0x20c8db['userId'],'username':_0x20c8db['username']??String(_0x20c8db[_0x2dcf12(0xe7)]),'nickname':_0x20c8db[_0x2dcf12(0x10f)],'matchedBy':'name'};}function a194_0x4732(_0x513828,_0x8011af){_0x513828=_0x513828-0xe5;const _0x4d1b08=a194_0x4d1b();let _0x473294=_0x4d1b08[_0x513828];return _0x473294;}export const CREATE_USER_ROLE_PATH=a194_0x5a2978(0x11a);export const DELETE_USER_ROLE_PATH=a194_0x5a2978(0x131);function a194_0x4d1b(){const _0x3c754f=['299770bvkJBR','number','expect-user-count','Anti-drift\x20check\x20failed:\x20expected\x20','Removed\x20','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','No\x20tenant\x20member\x20matches\x20\x22','filter','POST','map','Pass\x20--role\x20<id|name>.','DEV','username','permitCount','authRequired','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','string','Role\x20id\x20or\x20exact\x20role\x20name','Check\x20the\x20nickname/username.\x20','roleName','/smartapi/permit/user-role/delete','\x22\x20is\x20ambiguous\x20(ids:\x20','User\x20','totalCount','\x20is\x20already\x20a\x20member\x20of\x20role\x20','\x20is\x20not\x20a\x20member\x20of\x20role\x20','userId','Missing\x20user\x20reference.','Cannot\x20','remark','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','156798CKlWUS','toLowerCase','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','3076374jSDtTj','trim','472HJLiHb','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','CUSTOM','name','includes','\x22:\x20','find','838bbVMaU','Role\x20name\x20\x22','userCount','roleType','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','flag','2818rcGalF','646104DpyARl','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','dryRun','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','44bFngwj','44453376rcyEfz','Optional\x20role\x20remark/description','OWNER','flagMissing','str','71701XtizHA','Role\x20id\x20','push','Role\x20id\x20(from\x20`role\x20list`)','\x20members\x20of\x20the\x20OWNER\x20role.','appCode','nickname','validation','790HQFVCO','user-add','Missing\x20role\x20reference.',';\x20no\x20change.','\x20member(s)\x20but\x20role\x20has\x20','role','join','length','user','/smartapi/permit/user-role/create','expectUserCount','Pass\x20--user\x20<id|name>.'];a194_0x4d1b=function(){return _0x3c754f;};return a194_0x4d1b();}export function computeRoleUserMutation(_0x1627f6){const _0xc6618c=a194_0x5a2978,{operation:_0x1f0655,appCode:_0x2bf7d2,role:_0x387a68,relations:_0x18c989,user:_0x3a2b99}=_0x1627f6,_0x8e9333=[...new Set(_0x18c989[_0xc6618c(0x126)](_0x248729=>_0x248729[_0xc6618c(0xe7)]))],_0x2af19d=[];if(_0x1627f6[_0xc6618c(0x11b)]!==undefined&&_0x1627f6[_0xc6618c(0x11b)]!==_0x8e9333[_0xc6618c(0x118)])throw CliErrors[_0xc6618c(0x110)](_0xc6618c(0x120)+_0x1627f6[_0xc6618c(0x11b)]+_0xc6618c(0x115)+_0x8e9333[_0xc6618c(0x118)]+'.',_0xc6618c(0xeb));const _0x27a047=_0x8e9333[_0xc6618c(0xf5)](_0x3a2b99[_0xc6618c(0xe7)]),_0x5ac25f=_0x18c989[_0xc6618c(0x124)](_0x903374=>_0x903374[_0xc6618c(0xe7)]===_0x3a2b99[_0xc6618c(0xe7)])[_0xc6618c(0x126)](_0x2760b4=>_0x2760b4['id']),_0x24a90a=_0x1f0655==='user-add'?!_0x27a047:_0x27a047;let _0x4bafa7=_0x8e9333;_0x1f0655===_0xc6618c(0x112)?_0x27a047?_0x2af19d['push'](_0xc6618c(0x133)+_0x3a2b99[_0xc6618c(0xe7)]+_0xc6618c(0xe5)+_0x387a68[_0xc6618c(0x130)]+_0xc6618c(0x114)):_0x4bafa7=[..._0x8e9333,_0x3a2b99[_0xc6618c(0xe7)]]:!_0x27a047?_0x2af19d[_0xc6618c(0x10b)](_0xc6618c(0x133)+_0x3a2b99[_0xc6618c(0xe7)]+_0xc6618c(0xe6)+_0x387a68['roleName']+_0xc6618c(0x114)):(_0x4bafa7=_0x8e9333[_0xc6618c(0x124)](_0xdb8920=>_0xdb8920!==_0x3a2b99[_0xc6618c(0xe7)]),_0x5ac25f[_0xc6618c(0x118)]>0x1&&_0x2af19d[_0xc6618c(0x10b)](_0xc6618c(0x121)+_0x5ac25f[_0xc6618c(0x118)]+'\x20duplicate\x20memberships\x20for\x20user\x20'+_0x3a2b99[_0xc6618c(0xe7)]+'.'));const _0x4a5878={'scope':'dev','operation':_0x1f0655,'selector':{'appCode':_0x2bf7d2,'roleId':_0x387a68['id'],'roleName':_0x387a68[_0xc6618c(0x130)],'userId':_0x3a2b99[_0xc6618c(0xe7)]},'before':{'userIds':_0x8e9333},'after':{'userIds':_0x4bafa7},'dryRun':_0x1627f6[_0xc6618c(0x101)],'backend':{'method':_0xc6618c(0x125),'path':_0x1f0655==='user-add'?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x2af19d};return{'mutation':_0x4a5878,'changed':_0x24a90a,'matchingRelationIds':_0x5ac25f};}export async function loadDevRoleRelations(_0x201710,_0x477355){const _0x4d4b76=a194_0x5a2978,_0x4a298b=0x64,_0x44bec6=[];for(let _0x592e6c=0x1;;_0x592e6c+=0x1){const {items:_0xfe0d7b,paging:_0x3267e8}=await listDevUserRoleRelations(_0x201710,{'roleId':_0x477355,'currentPage':_0x592e6c,'pageSize':_0x4a298b});_0x44bec6['push'](..._0xfe0d7b);if(_0xfe0d7b[_0x4d4b76(0x118)]<_0x4a298b||_0x3267e8&&_0x44bec6['length']>=_0x3267e8[_0x4d4b76(0x134)])return _0x44bec6;}}export function readRoleRef(_0x20f45c){const _0x12475c=a194_0x5a2978,_0x1ce6b0=_0x20f45c[_0x12475c(0x108)](_0x12475c(0x116))[_0x12475c(0xf0)]();if(!_0x1ce6b0)throw CliErrors[_0x12475c(0x107)](_0x12475c(0x116),'Pass\x20--role\x20<id|name>.');return _0x1ce6b0;}export async function prepareUserMutation(_0x224cfa,_0x41429,_0x5f4675){const _0x35ab40=a194_0x5a2978,_0x351798=readRoleRef(_0x224cfa),_0x4e8d7c=_0x224cfa[_0x35ab40(0x108)]('user')['trim']();if(!_0x4e8d7c)throw CliErrors['flagMissing'](_0x35ab40(0x119),_0x35ab40(0x11c));const _0x447037=_0x224cfa[_0x35ab40(0xfd)](_0x35ab40(0x11f)),_0x4e223f=_0x447037===undefined||_0x447037===null?undefined:Number(_0x447037),_0x1a0402=await resolveRoleRef(_0x224cfa[_0x35ab40(0x10e)],_0x351798);if(_0x1a0402[_0x35ab40(0xfb)]==='OWNER')throw CliErrors['validation']('Cannot\x20'+_0x41429+_0x35ab40(0x10d),'Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.');const _0x3b0080=await resolveUserRef(_0x4e8d7c),_0x5f24da=await loadDevRoleRelations(_0x224cfa[_0x35ab40(0x10e)],_0x1a0402['id']);return{...computeRoleUserMutation({'operation':_0x41429,'appCode':_0x224cfa[_0x35ab40(0x10e)],'role':_0x1a0402,'relations':_0x5f24da,'user':{'userId':_0x3b0080['userId'],'username':_0x3b0080[_0x35ab40(0x129)],'nickname':_0x3b0080[_0x35ab40(0x10f)]},'dryRun':_0x5f4675,..._0x4e223f!==undefined?{'expectUserCount':_0x4e223f}:{}}),'role':_0x1a0402,'user':_0x3b0080};}
1
+ const a208_0x55f51d=a208_0x51e0;(function(_0x4c01c2,_0x1dfcdc){const _0x52cd86=a208_0x51e0,_0x3ad327=_0x4c01c2();while(!![]){try{const _0x29d05d=-parseInt(_0x52cd86(0x106))/0x1*(parseInt(_0x52cd86(0x12c))/0x2)+parseInt(_0x52cd86(0x138))/0x3*(parseInt(_0x52cd86(0x13a))/0x4)+-parseInt(_0x52cd86(0x133))/0x5+-parseInt(_0x52cd86(0x135))/0x6+-parseInt(_0x52cd86(0x146))/0x7+-parseInt(_0x52cd86(0x10e))/0x8+parseInt(_0x52cd86(0x14c))/0x9;if(_0x29d05d===_0x1dfcdc)break;else _0x3ad327['push'](_0x3ad327['shift']());}catch(_0x3e81c2){_0x3ad327['push'](_0x3ad327['shift']());}}}(a208_0x8a9f,0x2a144));import{getTenantMembers,listDevUserRoleRelations,listAppRoles}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':a208_0x55f51d(0x12a),'required':!![],'description':a208_0x55f51d(0x116)};export const ROLE_REF_FLAG={'name':a208_0x55f51d(0x122),'type':'string','required':!![],'description':a208_0x55f51d(0x13f)};export const USER_REF_FLAG={'name':a208_0x55f51d(0x121),'type':'string','required':!![],'description':'User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId'};export const NAME_FLAG={'name':'name','type':a208_0x55f51d(0x104),'required':!![],'description':a208_0x55f51d(0x151)};function a208_0x51e0(_0x1a711d,_0x2847d4){_0x1a711d=_0x1a711d-0x100;const _0x8a9fd4=a208_0x8a9f();let _0x51e082=_0x8a9fd4[_0x1a711d];return _0x51e082;}function a208_0x8a9f(){const _0x3e79c8=['number','Cannot\x20','72322ufTXPK','roleName','Optional\x20role\x20remark/description','map','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','DEV','ADMIN','1263555gwrNTy','filter','1614504PgHxAK',';\x20no\x20change.','\x22:\x20','661935gxgFoN','POST','4BRSpQS','Pass\x20--role\x20<id|name>.','tenant_code','\x22\x20is\x20ambiguous\x20(ids:\x20','\x20is\x20not\x20a\x20member\x20of\x20role\x20','Role\x20id\x20or\x20exact\x20role\x20name','push','length','includes','expect-user-count','Role\x20name\x20\x22','Disambiguate\x20with\x20--role\x20<id>.','1063496rUDMoU','dryRun','authRequired','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','No\x20tenant\x20member\x20matches\x20\x22','flag','9036144AasLZN','toLowerCase','Missing\x20role\x20reference.','username','\x22\x20not\x20found\x20in\x20app\x20','Role\x20name','dev','validation','userId','\x20built-in\x20role\x20','string','remark','3oIWxSX','str','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','test','trim','totalCount','Missing\x20user\x20reference.','/smartapi/permit/user-role/delete','2160792fffZfd','CUSTOM','appCode','/smartapi/permit/user-role/create','nickname','Pass\x20--user\x20<id|name>.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','find','Role\x20id\x20(from\x20`role\x20list`)','User\x20','expectUserCount','userCount','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','tenant','Check\x20the\x20nickname/username.\x20','user-add','\x20member(s)\x20but\x20role\x20has\x20','roleType','Multiple\x20tenant\x20members\x20match\x20\x22','user','role','\x20members\x20of\x20the\x20OWNER\x20role.','join','Anti-drift\x20check\x20failed:\x20expected\x20','OWNER','\x20duplicate\x20memberships\x20for\x20user\x20','flagMissing','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.'];a208_0x8a9f=function(){return _0x3e79c8;};return a208_0x8a9f();}export const USER_NAME_FLAG={'name':'name','type':a208_0x55f51d(0x104),'required':!![],'description':a208_0x55f51d(0x108)};export const REMARK_FLAG={'name':'remark','type':a208_0x55f51d(0x104),'required':![],'description':a208_0x55f51d(0x12e)};export const EXPECT_USER_COUNT_FLAG={'name':a208_0x55f51d(0x143),'type':'number','required':![],'description':a208_0x55f51d(0x130)};export const BUILTIN_ROLE_TYPES=[a208_0x55f51d(0x132),a208_0x55f51d(0x131),a208_0x55f51d(0x126)];export function isBuiltinRole(_0x287b2c){return BUILTIN_ROLE_TYPES['includes'](_0x287b2c);}export function assertCustomRole(_0x2ea38c,_0x42d920){const _0xf31ce3=a208_0x55f51d;if(_0x2ea38c[_0xf31ce3(0x11f)]!==_0xf31ce3(0x10f))throw CliErrors['validation'](_0xf31ce3(0x12b)+_0x42d920+_0xf31ce3(0x103)+_0x2ea38c[_0xf31ce3(0x12d)]+'\x20('+_0x2ea38c[_0xf31ce3(0x11f)]+').',_0xf31ce3(0x149));}export function projectRole(_0x3afb85){const _0x357086=a208_0x55f51d;return{'id':_0x3afb85['id'],'roleName':_0x3afb85[_0x357086(0x12d)],'roleType':_0x3afb85[_0x357086(0x11f)],'remark':_0x3afb85[_0x357086(0x105)],'userCount':_0x3afb85[_0x357086(0x119)],'permitCount':_0x3afb85['permitCount'],'builtin':isBuiltinRole(_0x3afb85['roleType'])};}export async function resolveRoleRef(_0x16dc9e,_0x4c7b1a){const _0x2a25ad=a208_0x55f51d,_0x1ccf76=_0x4c7b1a[_0x2a25ad(0x10a)]();if(!_0x1ccf76)throw CliErrors[_0x2a25ad(0x101)](_0x2a25ad(0x14e),_0x2a25ad(0x13b));if(/^\d+$/[_0x2a25ad(0x109)](_0x1ccf76))return getRoleById(_0x16dc9e,Number(_0x1ccf76));const _0x3f823d=await listAllAppRoles(_0x16dc9e),_0x2da1be=_0x3f823d[_0x2a25ad(0x134)](_0xe46fde=>_0xe46fde[_0x2a25ad(0x12d)]===_0x1ccf76);if(_0x2da1be[_0x2a25ad(0x141)]===0x0)throw CliErrors[_0x2a25ad(0x101)](_0x2a25ad(0x144)+_0x1ccf76+_0x2a25ad(0x150)+_0x16dc9e+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.');if(_0x2da1be[_0x2a25ad(0x141)]>0x1){const _0x4d7036=_0x2da1be[_0x2a25ad(0x12f)](_0x97e586=>_0x97e586['id'])[_0x2a25ad(0x124)](',\x20');throw CliErrors[_0x2a25ad(0x101)](_0x2a25ad(0x144)+_0x1ccf76+_0x2a25ad(0x13d)+_0x4d7036+').',_0x2a25ad(0x145));}return _0x2da1be[0x0];}export async function getRoleById(_0x556b68,_0x2a54ad){const _0x2ccd28=a208_0x55f51d,_0x349ae5=await listAllAppRoles(_0x556b68),_0x1c64eb=_0x349ae5[_0x2ccd28(0x134)](_0x4cf2f6=>_0x4cf2f6['id']===_0x2a54ad&&(!_0x4cf2f6[_0x2ccd28(0x110)]||_0x4cf2f6[_0x2ccd28(0x110)]===_0x556b68));if(_0x1c64eb[_0x2ccd28(0x141)]!==0x1)throw CliErrors[_0x2ccd28(0x101)]('Role\x20id\x20'+_0x2a54ad+'\x20not\x20found\x20in\x20app\x20'+_0x556b68+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.');return _0x1c64eb[0x0];}async function listAllAppRoles(_0x4a01f9){const _0x2f0e6b=a208_0x55f51d,_0xed393c=0x64,_0x29a118=[];for(let _0x22941d=0x1;;_0x22941d+=0x1){const {items:_0x43a125,paging:_0x541966}=await listAppRoles(_0x4a01f9,{'currentPage':_0x22941d,'pageSize':_0xed393c});_0x29a118[_0x2f0e6b(0x140)](..._0x43a125);if(_0x43a125[_0x2f0e6b(0x141)]<_0xed393c||_0x541966&&_0x29a118[_0x2f0e6b(0x141)]>=_0x541966[_0x2f0e6b(0x10b)])return _0x29a118;}}export async function resolveTenantCode(){const _0xdc4173=a208_0x55f51d,_0x538d4c=await getSessionUserInfo(),_0x50b13c=_0x538d4c?.[_0xdc4173(0x121)]?.[_0xdc4173(0x11b)]?.[_0xdc4173(0x13c)];if(!_0x50b13c)throw CliErrors[_0xdc4173(0x148)](_0xdc4173(0x11a));return _0x50b13c;}function matchMember(_0x33b4f8,_0x1b15aa){const _0x5d453d=a208_0x55f51d,_0x58c414=_0x1b15aa['trim']()[_0x5d453d(0x14d)]();return(_0x33b4f8[_0x5d453d(0x112)]??'')[_0x5d453d(0x14d)]()===_0x58c414||(_0x33b4f8[_0x5d453d(0x14f)]??'')[_0x5d453d(0x14d)]()===_0x58c414;}export async function resolveUserRef(_0x37caca,_0x207163='Pass\x20--user\x20<id>.'){const _0x2b8698=a208_0x55f51d,_0x530058=_0x37caca['trim']();if(!_0x530058)throw CliErrors['validation'](_0x2b8698(0x10c),_0x2b8698(0x113));const _0x46fff8=await resolveTenantCode(),_0x3ae13a=await getTenantMembers(_0x46fff8);if(/^\d+$/[_0x2b8698(0x109)](_0x530058)){const _0x12df93=Number(_0x530058),_0x4a28e9=_0x3ae13a[_0x2b8698(0x115)](_0x17bbc6=>_0x17bbc6[_0x2b8698(0x102)]===_0x12df93);return{'userId':_0x12df93,'username':_0x4a28e9?.['username']??String(_0x12df93),'nickname':_0x4a28e9?.['nickname'],'matchedBy':'id'};}const _0x146b85=_0x3ae13a[_0x2b8698(0x134)](_0xeffa9=>matchMember(_0xeffa9,_0x530058));if(_0x146b85[_0x2b8698(0x141)]===0x0)throw CliErrors[_0x2b8698(0x101)](_0x2b8698(0x14a)+_0x530058+'\x22.',_0x2b8698(0x11c)+_0x207163);if(_0x146b85['length']>0x1){const _0x59a385=_0x146b85[_0x2b8698(0x12f)](_0x2af327=>(_0x2af327[_0x2b8698(0x112)]??_0x2af327['username']??'?')+'('+_0x2af327[_0x2b8698(0x102)]+')')[_0x2b8698(0x124)](',\x20');throw CliErrors['validation'](_0x2b8698(0x120)+_0x530058+_0x2b8698(0x137)+_0x59a385+'.',_0x207163);}const _0x54fb1f=_0x146b85[0x0];return{'userId':_0x54fb1f['userId'],'username':_0x54fb1f[_0x2b8698(0x14f)]??String(_0x54fb1f[_0x2b8698(0x102)]),'nickname':_0x54fb1f['nickname'],'matchedBy':'name'};}export const CREATE_USER_ROLE_PATH=a208_0x55f51d(0x111);export const DELETE_USER_ROLE_PATH=a208_0x55f51d(0x10d);export function computeRoleUserMutation(_0x557291){const _0x1e0705=a208_0x55f51d,{operation:_0x5cd0cc,appCode:_0x532dea,role:_0x37491e,relations:_0x68f5b3,user:_0x356e8e}=_0x557291,_0xcf8388=[...new Set(_0x68f5b3['map'](_0x4f299c=>_0x4f299c['userId']))],_0x1f94ea=[];if(_0x557291[_0x1e0705(0x118)]!==undefined&&_0x557291[_0x1e0705(0x118)]!==_0xcf8388[_0x1e0705(0x141)])throw CliErrors[_0x1e0705(0x101)](_0x1e0705(0x125)+_0x557291[_0x1e0705(0x118)]+_0x1e0705(0x11e)+_0xcf8388[_0x1e0705(0x141)]+'.',_0x1e0705(0x114));const _0x31f5c6=_0xcf8388[_0x1e0705(0x142)](_0x356e8e['userId']),_0x442a7b=_0x68f5b3[_0x1e0705(0x134)](_0x18d232=>_0x18d232[_0x1e0705(0x102)]===_0x356e8e[_0x1e0705(0x102)])[_0x1e0705(0x12f)](_0x398970=>_0x398970['id']),_0xaaf42a=_0x5cd0cc===_0x1e0705(0x11d)?!_0x31f5c6:_0x31f5c6;let _0x4b56a8=_0xcf8388;_0x5cd0cc==='user-add'?_0x31f5c6?_0x1f94ea['push']('User\x20'+_0x356e8e['userId']+'\x20is\x20already\x20a\x20member\x20of\x20role\x20'+_0x37491e[_0x1e0705(0x12d)]+_0x1e0705(0x136)):_0x4b56a8=[..._0xcf8388,_0x356e8e[_0x1e0705(0x102)]]:!_0x31f5c6?_0x1f94ea['push'](_0x1e0705(0x117)+_0x356e8e[_0x1e0705(0x102)]+_0x1e0705(0x13e)+_0x37491e[_0x1e0705(0x12d)]+_0x1e0705(0x136)):(_0x4b56a8=_0xcf8388[_0x1e0705(0x134)](_0x260513=>_0x260513!==_0x356e8e[_0x1e0705(0x102)]),_0x442a7b['length']>0x1&&_0x1f94ea[_0x1e0705(0x140)]('Removed\x20'+_0x442a7b[_0x1e0705(0x141)]+_0x1e0705(0x127)+_0x356e8e['userId']+'.'));const _0x8ea234={'scope':_0x1e0705(0x100),'operation':_0x5cd0cc,'selector':{'appCode':_0x532dea,'roleId':_0x37491e['id'],'roleName':_0x37491e[_0x1e0705(0x12d)],'userId':_0x356e8e[_0x1e0705(0x102)]},'before':{'userIds':_0xcf8388},'after':{'userIds':_0x4b56a8},'dryRun':_0x557291[_0x1e0705(0x147)],'backend':{'method':_0x1e0705(0x139),'path':_0x5cd0cc===_0x1e0705(0x11d)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x1f94ea};return{'mutation':_0x8ea234,'changed':_0xaaf42a,'matchingRelationIds':_0x442a7b};}export async function loadDevRoleRelations(_0x3a45e4,_0x22778a){const _0x119ea7=a208_0x55f51d,_0x1dc0ce=0x64,_0xc6b901=[];for(let _0x4b7833=0x1;;_0x4b7833+=0x1){const {items:_0x7248fe,paging:_0x210c73}=await listDevUserRoleRelations(_0x3a45e4,{'roleId':_0x22778a,'currentPage':_0x4b7833,'pageSize':_0x1dc0ce});_0xc6b901[_0x119ea7(0x140)](..._0x7248fe);if(_0x7248fe[_0x119ea7(0x141)]<_0x1dc0ce||_0x210c73&&_0xc6b901[_0x119ea7(0x141)]>=_0x210c73[_0x119ea7(0x10b)])return _0xc6b901;}}export function readRoleRef(_0x342ff3){const _0x284645=a208_0x55f51d,_0x56653e=_0x342ff3[_0x284645(0x107)](_0x284645(0x122))['trim']();if(!_0x56653e)throw CliErrors[_0x284645(0x128)](_0x284645(0x122),'Pass\x20--role\x20<id|name>.');return _0x56653e;}export async function prepareUserMutation(_0x184691,_0x540843,_0x5af6f0){const _0x376277=a208_0x55f51d,_0x1ae81e=readRoleRef(_0x184691),_0x1f2b3b=_0x184691[_0x376277(0x107)](_0x376277(0x121))['trim']();if(!_0x1f2b3b)throw CliErrors[_0x376277(0x128)](_0x376277(0x121),_0x376277(0x113));const _0x141aa4=_0x184691[_0x376277(0x14b)](_0x376277(0x143)),_0x31f934=_0x141aa4===undefined||_0x141aa4===null?undefined:Number(_0x141aa4),_0x468ac5=await resolveRoleRef(_0x184691[_0x376277(0x110)],_0x1ae81e);if(_0x468ac5[_0x376277(0x11f)]===_0x376277(0x126))throw CliErrors[_0x376277(0x101)](_0x376277(0x12b)+_0x540843+_0x376277(0x123),_0x376277(0x129));const _0x8d786e=await resolveUserRef(_0x1f2b3b),_0x239724=await loadDevRoleRelations(_0x184691[_0x376277(0x110)],_0x468ac5['id']);return{...computeRoleUserMutation({'operation':_0x540843,'appCode':_0x184691[_0x376277(0x110)],'role':_0x468ac5,'relations':_0x239724,'user':{'userId':_0x8d786e[_0x376277(0x102)],'username':_0x8d786e[_0x376277(0x14f)],'nickname':_0x8d786e[_0x376277(0x112)]},'dryRun':_0x5af6f0,..._0x31f934!==undefined?{'expectUserCount':_0x31f934}:{}}),'role':_0x468ac5,'user':_0x8d786e};}
@@ -1 +1 @@
1
- const a195_0x59dd3a=a195_0xb576;function a195_0x5299(){const _0x876593=['15594650xmaxyi','5wuNHMs','2072744ndFoeL','165516oHkSph','dev','Updated\x20role\x20','Nothing\x20to\x20update.','validation','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','appCode','flag','update','length','New\x20role\x20name','--name\x20cannot\x20be\x20empty.','140QjjSap','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','trim','205844SKitDF','num','role','remark','roleName','101800GSSsdB','778894wkPoAF','POST','name','1684248FxMUOA','/smartapi/permit/role/update','306SXwOTj','string'];a195_0x5299=function(){return _0x876593;};return a195_0x5299();}(function(_0x124718,_0x7ed20d){const _0x4e944b=a195_0xb576,_0x99681=_0x124718();while(!![]){try{const _0x44c91b=parseInt(_0x4e944b(0xd5))/0x1+-parseInt(_0x4e944b(0xdb))/0x2+-parseInt(_0x4e944b(0xde))/0x3+parseInt(_0x4e944b(0xc5))/0x4*(-parseInt(_0x4e944b(0xc4))/0x5)+parseInt(_0x4e944b(0xc6))/0x6*(parseInt(_0x4e944b(0xd2))/0x7)+parseInt(_0x4e944b(0xda))/0x8*(-parseInt(_0x4e944b(0xe0))/0x9)+parseInt(_0x4e944b(0xc3))/0xa;if(_0x44c91b===_0x7ed20d)break;else _0x99681['push'](_0x99681['shift']());}catch(_0x237692){_0x99681['push'](_0x99681['shift']());}}}(a195_0x5299,0x65662));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a195_0xb576(_0x24a3fc,_0x289253){_0x24a3fc=_0x24a3fc-0xc2;const _0x529951=a195_0x5299();let _0xb576b0=_0x529951[_0x24a3fc];return _0xb576b0;}const UPDATE_PATH=a195_0x59dd3a(0xdf);function readPatch(_0x2de85b){const _0x4ad3d6=a195_0x59dd3a,_0x35b395=_0x2de85b[_0x4ad3d6(0xcd)](_0x4ad3d6(0xdd)),_0x86200f=_0x2de85b[_0x4ad3d6(0xcd)]('remark'),_0x2915e4={};if(_0x35b395!==undefined&&_0x35b395!==null){const _0x3fb9da=String(_0x35b395)[_0x4ad3d6(0xd4)]();if(!_0x3fb9da)throw CliErrors[_0x4ad3d6(0xca)](_0x4ad3d6(0xd1));if(_0x3fb9da[_0x4ad3d6(0xcf)]>0x40)throw CliErrors[_0x4ad3d6(0xca)](_0x4ad3d6(0xcb));_0x2915e4[_0x4ad3d6(0xd9)]=_0x3fb9da;}_0x86200f!==undefined&&_0x86200f!==null&&(_0x2915e4[_0x4ad3d6(0xd8)]=String(_0x86200f));if(_0x2915e4[_0x4ad3d6(0xd9)]===undefined&&_0x2915e4[_0x4ad3d6(0xd8)]===undefined)throw CliErrors[_0x4ad3d6(0xca)](_0x4ad3d6(0xc9),'Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.');return _0x2915e4;}export const roleUpdate={'service':a195_0x59dd3a(0xd7),'command':a195_0x59dd3a(0xce),'description':a195_0x59dd3a(0xd3),'risk':'write','flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a195_0x59dd3a(0xdd),'type':a195_0x59dd3a(0xc2),'required':![],'description':a195_0x59dd3a(0xd0)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1f7e61){readPatch(_0x1f7e61);},async 'dryRun'(_0x9e6e24){const _0x60aa55=a195_0x59dd3a,_0x1c6e2a=_0x9e6e24[_0x60aa55(0xd6)]('id'),_0x5c9e8b=readPatch(_0x9e6e24),_0x30cf26=await getRoleById(_0x9e6e24[_0x60aa55(0xcc)],_0x1c6e2a);return assertCustomRole(_0x30cf26,_0x60aa55(0xce)),asDryRunResult({'scope':_0x60aa55(0xc7),'operation':'update','selector':{'appCode':_0x9e6e24[_0x60aa55(0xcc)],'roleId':_0x1c6e2a,'roleName':_0x30cf26[_0x60aa55(0xd9)]},'before':projectRole(_0x30cf26),'after':projectRole({..._0x30cf26,..._0x5c9e8b['roleName']!==undefined?{'roleName':_0x5c9e8b[_0x60aa55(0xd9)]}:{},..._0x5c9e8b[_0x60aa55(0xd8)]!==undefined?{'remark':_0x5c9e8b[_0x60aa55(0xd8)]}:{}}),'dryRun':!![],'backend':{'method':_0x60aa55(0xdc),'path':UPDATE_PATH},'warnings':[]},{'method':_0x60aa55(0xdc),'url':UPDATE_PATH});},async 'execute'(_0x527549){const _0x59fdd3=a195_0x59dd3a,_0x59475e=_0x527549[_0x59fdd3(0xd6)]('id'),_0x616f52=readPatch(_0x527549),_0x4aeb2b=await getRoleById(_0x527549[_0x59fdd3(0xcc)],_0x59475e);assertCustomRole(_0x4aeb2b,_0x59fdd3(0xce)),await updateAppRole({'id':_0x59475e,'appCode':_0x527549['appCode'],..._0x616f52[_0x59fdd3(0xd9)]!==undefined?{'roleName':_0x616f52[_0x59fdd3(0xd9)]}:{},..._0x616f52[_0x59fdd3(0xd8)]!==undefined?{'remark':_0x616f52[_0x59fdd3(0xd8)]}:{}});const _0x1c5dcd=await getRoleById(_0x527549[_0x59fdd3(0xcc)],_0x59475e);return{'ok':!![],'data':{'scope':_0x59fdd3(0xc7),'operation':_0x59fdd3(0xce),'selector':{'appCode':_0x527549[_0x59fdd3(0xcc)],'roleId':_0x59475e,'roleName':_0x1c5dcd[_0x59fdd3(0xd9)]},'before':projectRole(_0x4aeb2b),'after':projectRole(_0x1c5dcd),'dryRun':![],'backend':{'method':_0x59fdd3(0xdc),'path':UPDATE_PATH},'warnings':[]},'message':_0x59fdd3(0xc8)+_0x1c5dcd[_0x59fdd3(0xd9)]+'\x20(id='+_0x59475e+')'};}};
1
+ const a209_0x2c86db=a209_0x3a7f;function a209_0x19fb(){const _0x251482=['flag','update','217452tLcSPX','string','4178658lhIcWh','remark','name','POST','validation','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','140qidRBM','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','num','\x20(id=','roleName','Updated\x20role\x20','4472010bcXUky','145877BZhbTM','appCode','--name\x20cannot\x20be\x20empty.','10Nmbuol','Nothing\x20to\x20update.','4BPzVNd','dev','2679483dDjYYr','trim','136SqJlpp','10934XmxVjE','2162210IcJUMZ','New\x20role\x20name'];a209_0x19fb=function(){return _0x251482;};return a209_0x19fb();}(function(_0x5eccae,_0x2ccfcd){const _0x3a3d3d=a209_0x3a7f,_0x17b7e1=_0x5eccae();while(!![]){try{const _0x3d2e09=-parseInt(_0x3a3d3d(0x140))/0x1+-parseInt(_0x3a3d3d(0x14b))/0x2+-parseInt(_0x3a3d3d(0x147))/0x3*(-parseInt(_0x3a3d3d(0x145))/0x4)+-parseInt(_0x3a3d3d(0x139))/0x5*(-parseInt(_0x3a3d3d(0x131))/0x6)+-parseInt(_0x3a3d3d(0x14a))/0x7*(-parseInt(_0x3a3d3d(0x149))/0x8)+-parseInt(_0x3a3d3d(0x13f))/0x9+parseInt(_0x3a3d3d(0x143))/0xa*(parseInt(_0x3a3d3d(0x133))/0xb);if(_0x3d2e09===_0x2ccfcd)break;else _0x17b7e1['push'](_0x17b7e1['shift']());}catch(_0x4f6215){_0x17b7e1['push'](_0x17b7e1['shift']());}}}(a209_0x19fb,0x902a1));import{updateAppRole}from'../../core/api-client.js';function a209_0x3a7f(_0x3e76af,_0x2efefb){_0x3e76af=_0x3e76af-0x130;const _0x19fb95=a209_0x19fb();let _0x3a7fb1=_0x19fb95[_0x3e76af];return _0x3a7fb1;}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='/smartapi/permit/role/update';function readPatch(_0x16738f){const _0x5a6ec3=a209_0x3a7f,_0xbd1255=_0x16738f['flag'](_0x5a6ec3(0x135)),_0xd85ea3=_0x16738f[_0x5a6ec3(0x14d)](_0x5a6ec3(0x134)),_0x12ae88={};if(_0xbd1255!==undefined&&_0xbd1255!==null){const _0x1c24a7=String(_0xbd1255)[_0x5a6ec3(0x148)]();if(!_0x1c24a7)throw CliErrors[_0x5a6ec3(0x137)](_0x5a6ec3(0x142));if(_0x1c24a7['length']>0x40)throw CliErrors['validation'](_0x5a6ec3(0x138));_0x12ae88[_0x5a6ec3(0x13d)]=_0x1c24a7;}_0xd85ea3!==undefined&&_0xd85ea3!==null&&(_0x12ae88['remark']=String(_0xd85ea3));if(_0x12ae88[_0x5a6ec3(0x13d)]===undefined&&_0x12ae88['remark']===undefined)throw CliErrors['validation'](_0x5a6ec3(0x144),_0x5a6ec3(0x13a));return _0x12ae88;}export const roleUpdate={'service':'role','command':'update','description':'Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','risk':'write','flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a209_0x2c86db(0x135),'type':a209_0x2c86db(0x132),'required':![],'description':a209_0x2c86db(0x14c)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3b3d46){readPatch(_0x3b3d46);},async 'dryRun'(_0x24697e){const _0x29771b=a209_0x2c86db,_0x8ea271=_0x24697e['num']('id'),_0x1618a9=readPatch(_0x24697e),_0x4a14b9=await getRoleById(_0x24697e[_0x29771b(0x141)],_0x8ea271);return assertCustomRole(_0x4a14b9,'update'),asDryRunResult({'scope':_0x29771b(0x146),'operation':_0x29771b(0x130),'selector':{'appCode':_0x24697e[_0x29771b(0x141)],'roleId':_0x8ea271,'roleName':_0x4a14b9[_0x29771b(0x13d)]},'before':projectRole(_0x4a14b9),'after':projectRole({..._0x4a14b9,..._0x1618a9[_0x29771b(0x13d)]!==undefined?{'roleName':_0x1618a9[_0x29771b(0x13d)]}:{},..._0x1618a9[_0x29771b(0x134)]!==undefined?{'remark':_0x1618a9['remark']}:{}}),'dryRun':!![],'backend':{'method':_0x29771b(0x136),'path':UPDATE_PATH},'warnings':[]},{'method':_0x29771b(0x136),'url':UPDATE_PATH});},async 'execute'(_0x3e3b58){const _0x33c335=a209_0x2c86db,_0x557bfe=_0x3e3b58[_0x33c335(0x13b)]('id'),_0x5d39b6=readPatch(_0x3e3b58),_0x53df3e=await getRoleById(_0x3e3b58[_0x33c335(0x141)],_0x557bfe);assertCustomRole(_0x53df3e,_0x33c335(0x130)),await updateAppRole({'id':_0x557bfe,'appCode':_0x3e3b58[_0x33c335(0x141)],..._0x5d39b6['roleName']!==undefined?{'roleName':_0x5d39b6[_0x33c335(0x13d)]}:{},..._0x5d39b6[_0x33c335(0x134)]!==undefined?{'remark':_0x5d39b6[_0x33c335(0x134)]}:{}});const _0x421826=await getRoleById(_0x3e3b58[_0x33c335(0x141)],_0x557bfe);return{'ok':!![],'data':{'scope':'dev','operation':_0x33c335(0x130),'selector':{'appCode':_0x3e3b58[_0x33c335(0x141)],'roleId':_0x557bfe,'roleName':_0x421826['roleName']},'before':projectRole(_0x53df3e),'after':projectRole(_0x421826),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':_0x33c335(0x13e)+_0x421826[_0x33c335(0x13d)]+_0x33c335(0x13c)+_0x557bfe+')'};}};
@@ -1 +1 @@
1
- const a196_0x1007f5=a196_0x3f3d;function a196_0x1bf5(){const _0x4ec0b5=['high-risk-write','10sKpZbi','POST','1960620DJkqBH','2921868UCmEiY','No\x20change:\x20user\x20','userId','610SunKAj','selector','32dfhdvb','Added\x20user\x20','589714lCmpiT','33884ZOWBjo','roleName','roleType','27201229WMnpkT','12pEgLTy','username','\x20already\x20in\x20role\x20','\x20to\x20role\x20','703535zjRULL','roleId','user-add','appCode','48387ZaWrCX'];a196_0x1bf5=function(){return _0x4ec0b5;};return a196_0x1bf5();}(function(_0x3927cf,_0x120b49){const _0x568549=a196_0x3f3d,_0x1c5dc8=_0x3927cf();while(!![]){try{const _0x3c0ae9=-parseInt(_0x568549(0x11b))/0x1+parseInt(_0x568549(0x12c))/0x2+-parseInt(_0x568549(0x128))/0x3+-parseInt(_0x568549(0x11c))/0x4*(parseInt(_0x568549(0x130))/0x5)+-parseInt(_0x568549(0x120))/0x6*(-parseInt(_0x568549(0x124))/0x7)+parseInt(_0x568549(0x119))/0x8*(-parseInt(_0x568549(0x12d))/0x9)+-parseInt(_0x568549(0x12a))/0xa*(-parseInt(_0x568549(0x11f))/0xb);if(_0x3c0ae9===_0x120b49)break;else _0x1c5dc8['push'](_0x1c5dc8['shift']());}catch(_0xdbd9c7){_0x1c5dc8['push'](_0x1c5dc8['shift']());}}}(a196_0x1bf5,0xaedd6));import{createDevUserRole}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,CREATE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';function a196_0x3f3d(_0x37ea2d,_0x9a970d){_0x37ea2d=_0x37ea2d-0x118;const _0x1bf5b2=a196_0x1bf5();let _0x3f3d58=_0x1bf5b2[_0x37ea2d];return _0x3f3d58;}export const roleUserAdd={'service':'role','command':a196_0x1007f5(0x126),'description':'Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','risk':a196_0x1007f5(0x129),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0xa02822){const _0x49b3db=a196_0x1007f5,{mutation:_0x3088e7}=await prepareUserMutation(_0xa02822,_0x49b3db(0x126),!![]);return asDryRunResult(_0x3088e7,{'method':_0x49b3db(0x12b),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x452ab6){const _0x4e60be=a196_0x1007f5,{mutation:_0x46b67a,changed:_0x1fdc9e,role:_0x3ed61e,user:_0xe6126c}=await prepareUserMutation(_0x452ab6,'user-add',![]);return _0x1fdc9e&&await createDevUserRole({'appCode':_0x452ab6[_0x4e60be(0x127)],'userId':_0xe6126c[_0x4e60be(0x12f)],'username':_0xe6126c[_0x4e60be(0x121)],'roleType':_0x3ed61e[_0x4e60be(0x11e)],'roleId':_0x46b67a['selector'][_0x4e60be(0x125)]}),{'ok':!![],'data':_0x46b67a,'message':_0x1fdc9e?_0x4e60be(0x11a)+_0x46b67a[_0x4e60be(0x118)]['userId']+_0x4e60be(0x123)+_0x46b67a[_0x4e60be(0x118)][_0x4e60be(0x11d)]:_0x4e60be(0x12e)+_0x46b67a[_0x4e60be(0x118)]['userId']+_0x4e60be(0x122)+_0x46b67a[_0x4e60be(0x118)]['roleName']};}};
1
+ const a210_0x321388=a210_0x4dd6;(function(_0x28f42a,_0x2fdb2a){const _0x3f2078=a210_0x4dd6,_0x3511c2=_0x28f42a();while(!![]){try{const _0x180f5d=-parseInt(_0x3f2078(0xa6))/0x1*(parseInt(_0x3f2078(0xb5))/0x2)+parseInt(_0x3f2078(0xae))/0x3*(parseInt(_0x3f2078(0xb8))/0x4)+-parseInt(_0x3f2078(0xab))/0x5*(-parseInt(_0x3f2078(0xad))/0x6)+-parseInt(_0x3f2078(0xaa))/0x7+-parseInt(_0x3f2078(0xbb))/0x8+-parseInt(_0x3f2078(0xb4))/0x9+parseInt(_0x3f2078(0xb3))/0xa*(parseInt(_0x3f2078(0xa8))/0xb);if(_0x180f5d===_0x2fdb2a)break;else _0x3511c2['push'](_0x3511c2['shift']());}catch(_0x525317){_0x3511c2['push'](_0x3511c2['shift']());}}}(a210_0x4267,0x1aa6f));import{createDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a210_0x4267(){const _0x273cf8=['\x20to\x20role\x20','1204OxfuHm','POST','role','808976hFUZIk','username','2qGlonm','user-add','91014YjzwyW','roleId','155757YJEsgD','45ANRXKr','userId','103242qwvIin','21WjxRDJ','No\x20change:\x20user\x20','selector','appCode','roleName','240CPllwb','38916XxUdWv','118682WSXwAL','high-risk-write'];a210_0x4267=function(){return _0x273cf8;};return a210_0x4267();}function a210_0x4dd6(_0xeef622,_0x3eeddf){_0xeef622=_0xeef622-0xa6;const _0x426713=a210_0x4267();let _0x4dd66e=_0x426713[_0xeef622];return _0x4dd66e;}import{EXPECT_USER_COUNT_FLAG,CREATE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':a210_0x321388(0xba),'command':a210_0x321388(0xa7),'description':'Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','risk':a210_0x321388(0xb6),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x39ece5){const _0x3e83ee=a210_0x321388,{mutation:_0x37a574}=await prepareUserMutation(_0x39ece5,_0x3e83ee(0xa7),!![]);return asDryRunResult(_0x37a574,{'method':_0x3e83ee(0xb9),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0xd995df){const _0x3d7728=a210_0x321388,{mutation:_0x38d39f,changed:_0x5e1f46,role:_0x302938,user:_0x31c94e}=await prepareUserMutation(_0xd995df,_0x3d7728(0xa7),![]);return _0x5e1f46&&await createDevUserRole({'appCode':_0xd995df[_0x3d7728(0xb1)],'userId':_0x31c94e[_0x3d7728(0xac)],'username':_0x31c94e[_0x3d7728(0xbc)],'roleType':_0x302938['roleType'],'roleId':_0x38d39f[_0x3d7728(0xb0)][_0x3d7728(0xa9)]}),{'ok':!![],'data':_0x38d39f,'message':_0x5e1f46?'Added\x20user\x20'+_0x38d39f[_0x3d7728(0xb0)][_0x3d7728(0xac)]+_0x3d7728(0xb7)+_0x38d39f[_0x3d7728(0xb0)][_0x3d7728(0xb2)]:_0x3d7728(0xaf)+_0x38d39f[_0x3d7728(0xb0)][_0x3d7728(0xac)]+'\x20already\x20in\x20role\x20'+_0x38d39f[_0x3d7728(0xb0)]['roleName']};}};
@@ -1 +1 @@
1
- const a197_0x16ef4d=a197_0x2fdc;(function(_0x5e040a,_0x431ad2){const _0x270efe=a197_0x2fdc,_0x38d560=_0x5e040a();while(!![]){try{const _0x22b9b3=-parseInt(_0x270efe(0x154))/0x1*(parseInt(_0x270efe(0x153))/0x2)+-parseInt(_0x270efe(0x147))/0x3+parseInt(_0x270efe(0x158))/0x4+-parseInt(_0x270efe(0x152))/0x5+-parseInt(_0x270efe(0x14f))/0x6+-parseInt(_0x270efe(0x150))/0x7+parseInt(_0x270efe(0x144))/0x8*(parseInt(_0x270efe(0x149))/0x9);if(_0x22b9b3===_0x431ad2)break;else _0x38d560['push'](_0x38d560['shift']());}catch(_0x47c7f1){_0x38d560['push'](_0x38d560['shift']());}}}(a197_0x2ea3,0x8e20a));import{deleteDevUserRole}from'../../core/api-client.js';function a197_0x2fdc(_0x73789d,_0xb042b0){_0x73789d=_0x73789d-0x144;const _0x2ea33b=a197_0x2ea3();let _0x2fdc2b=_0x2ea33b[_0x73789d];return _0x2fdc2b;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,DELETE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':a197_0x16ef4d(0x145),'command':'user-remove','description':a197_0x16ef4d(0x14b),'risk':a197_0x16ef4d(0x14a),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x14f69f){const _0x1ad7dc=a197_0x16ef4d,{mutation:_0x41ea27}=await prepareUserMutation(_0x14f69f,_0x1ad7dc(0x148),!![]);return asDryRunResult(_0x41ea27,{'method':_0x1ad7dc(0x157),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0xc62052){const _0x4e5e90=a197_0x16ef4d,{matchingRelationIds:_0x588549,mutation:_0x349471,changed:_0x6e3616}=await prepareUserMutation(_0xc62052,'user-remove',![]);if(_0x6e3616)for(const _0x44db97 of _0x588549){await deleteDevUserRole(_0x44db97);}return{'ok':!![],'data':_0x349471,'message':_0x6e3616?_0x4e5e90(0x14d)+_0x349471[_0x4e5e90(0x146)][_0x4e5e90(0x156)]+_0x4e5e90(0x14e)+_0x349471[_0x4e5e90(0x146)][_0x4e5e90(0x155)]:_0x4e5e90(0x151)+_0x349471[_0x4e5e90(0x146)]['userId']+_0x4e5e90(0x14c)+_0x349471['selector'][_0x4e5e90(0x155)]};}};function a197_0x2ea3(){const _0x57b0a8=['Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','\x20not\x20in\x20role\x20','Removed\x20user\x20','\x20from\x20role\x20','2980278tbEUwo','6415899msWCfb','No\x20change:\x20user\x20','4682265QserEo','44zlNSmR','3357AfaMnr','roleName','userId','POST','2430216tJCnti','26919760VVzUpU','role','selector','2900379UsQDrX','user-remove','9BzEPMk','high-risk-write'];a197_0x2ea3=function(){return _0x57b0a8;};return a197_0x2ea3();}
1
+ const a211_0xdab33c=a211_0x3be2;(function(_0x187d7d,_0x48b12b){const _0x3dcb29=a211_0x3be2,_0x22e1d0=_0x187d7d();while(!![]){try{const _0x18f679=-parseInt(_0x3dcb29(0x1e3))/0x1*(-parseInt(_0x3dcb29(0x1e4))/0x2)+-parseInt(_0x3dcb29(0x1f6))/0x3*(parseInt(_0x3dcb29(0x1e6))/0x4)+parseInt(_0x3dcb29(0x1ed))/0x5*(parseInt(_0x3dcb29(0x1f2))/0x6)+-parseInt(_0x3dcb29(0x1f4))/0x7+parseInt(_0x3dcb29(0x1e9))/0x8+-parseInt(_0x3dcb29(0x1f7))/0x9*(parseInt(_0x3dcb29(0x1e8))/0xa)+-parseInt(_0x3dcb29(0x1e5))/0xb;if(_0x18f679===_0x48b12b)break;else _0x22e1d0['push'](_0x22e1d0['shift']());}catch(_0x5e46b3){_0x22e1d0['push'](_0x22e1d0['shift']());}}}(a211_0x7da6,0x48dc2));import{deleteDevUserRole}from'../../core/api-client.js';function a211_0x7da6(){const _0x45957f=['8KqTlpc','\x20from\x20role\x20','10srCFmP','3493672sKNfqh','userId','high-risk-write','roleName','28075tUXsgU','Removed\x20user\x20','POST','user-remove','\x20not\x20in\x20role\x20','228cYtclx','selector','405209EECdIY','No\x20change:\x20user\x20','474537siNALB','726255xqWZjb','236994IiVTEC','2AcEdNQ','1470689crfrKH'];a211_0x7da6=function(){return _0x45957f;};return a211_0x7da6();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a211_0x3be2(_0x5a6db7,_0x4f18ff){_0x5a6db7=_0x5a6db7-0x1e3;const _0x7da6c0=a211_0x7da6();let _0x3be2ed=_0x7da6c0[_0x5a6db7];return _0x3be2ed;}import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,DELETE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':'role','command':'user-remove','description':'Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','risk':a211_0xdab33c(0x1eb),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x152846){const _0x1588d9=a211_0xdab33c,{mutation:_0x135855}=await prepareUserMutation(_0x152846,'user-remove',!![]);return asDryRunResult(_0x135855,{'method':_0x1588d9(0x1ef),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x388fd5){const _0x4fefa0=a211_0xdab33c,{matchingRelationIds:_0x43d4fc,mutation:_0x38a983,changed:_0x5da938}=await prepareUserMutation(_0x388fd5,_0x4fefa0(0x1f0),![]);if(_0x5da938)for(const _0x2827f6 of _0x43d4fc){await deleteDevUserRole(_0x2827f6);}return{'ok':!![],'data':_0x38a983,'message':_0x5da938?_0x4fefa0(0x1ee)+_0x38a983[_0x4fefa0(0x1f3)][_0x4fefa0(0x1ea)]+_0x4fefa0(0x1e7)+_0x38a983[_0x4fefa0(0x1f3)][_0x4fefa0(0x1ec)]:_0x4fefa0(0x1f5)+_0x38a983[_0x4fefa0(0x1f3)]['userId']+_0x4fefa0(0x1f1)+_0x38a983[_0x4fefa0(0x1f3)][_0x4fefa0(0x1ec)]};}};
@@ -1 +1 @@
1
- const a198_0x712efb=a198_0x3aae;(function(_0x375069,_0x4a6d27){const _0x33f476=a198_0x3aae,_0x16d07a=_0x375069();while(!![]){try{const _0x25a131=-parseInt(_0x33f476(0x189))/0x1*(-parseInt(_0x33f476(0x185))/0x2)+parseInt(_0x33f476(0x199))/0x3+parseInt(_0x33f476(0x194))/0x4+-parseInt(_0x33f476(0x191))/0x5*(parseInt(_0x33f476(0x188))/0x6)+-parseInt(_0x33f476(0x18b))/0x7+-parseInt(_0x33f476(0x18d))/0x8*(parseInt(_0x33f476(0x197))/0x9)+parseInt(_0x33f476(0x18f))/0xa;if(_0x25a131===_0x4a6d27)break;else _0x16d07a['push'](_0x16d07a['shift']());}catch(_0x4b6c74){_0x16d07a['push'](_0x16d07a['shift']());}}}(a198_0x54b1,0x2271b));function a198_0x3aae(_0x7ddf09,_0x55e94e){_0x7ddf09=_0x7ddf09-0x184;const _0x54b141=a198_0x54b1();let _0x3aae84=_0x54b141[_0x7ddf09];return _0x3aae84;}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a198_0x54b1(){const _0x1827cf=['userId','46592kgjtSV','nickname','3984600nVJAcT','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','10kLeMID','str','Resolved\x20\x22','173740zEJsIv','trim','flagMissing','369bDDGTH','Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.','91830vCrQdI','\x22\x20→\x20userId\x20','118vHtAuc','user-resolve','name','139014fhToSj','3042eyjXbr','Pass\x20--name\x20<nickname|username>.','1580446QkcGIi'];a198_0x54b1=function(){return _0x1827cf;};return a198_0x54b1();}import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':'role','command':a198_0x712efb(0x186),'description':a198_0x712efb(0x190),'risk':'read','flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x27d4a8){const _0x46e6c4=a198_0x712efb;if(!_0x27d4a8[_0x46e6c4(0x192)](_0x46e6c4(0x187))[_0x46e6c4(0x195)]())throw CliErrors[_0x46e6c4(0x196)](_0x46e6c4(0x187),_0x46e6c4(0x18a));},async 'execute'(_0x10b78c){const _0x2291b8=a198_0x712efb,_0x1888a5=_0x10b78c['str'](_0x2291b8(0x187))[_0x2291b8(0x195)](),_0x55c5a7=await resolveUserRef(_0x1888a5,_0x2291b8(0x198));return{'ok':!![],'data':{'user':{'userId':_0x55c5a7['userId'],'username':_0x55c5a7['username'],'nickname':_0x55c5a7[_0x2291b8(0x18e)],'matchedBy':_0x55c5a7['matchedBy']}},'message':_0x2291b8(0x193)+_0x1888a5+_0x2291b8(0x184)+_0x55c5a7[_0x2291b8(0x18c)]};}};
1
+ const a212_0x5063b2=a212_0x10c6;(function(_0x35f4bf,_0x430caa){const _0x23be0e=a212_0x10c6,_0x285b2f=_0x35f4bf();while(!![]){try{const _0xb009b5=-parseInt(_0x23be0e(0x1b5))/0x1+parseInt(_0x23be0e(0x1b3))/0x2+parseInt(_0x23be0e(0x1be))/0x3*(-parseInt(_0x23be0e(0x1bc))/0x4)+-parseInt(_0x23be0e(0x1c3))/0x5+parseInt(_0x23be0e(0x1af))/0x6*(parseInt(_0x23be0e(0x1ba))/0x7)+-parseInt(_0x23be0e(0x1c5))/0x8*(parseInt(_0x23be0e(0x1b8))/0x9)+-parseInt(_0x23be0e(0x1b0))/0xa*(-parseInt(_0x23be0e(0x1c1))/0xb);if(_0xb009b5===_0x430caa)break;else _0x285b2f['push'](_0x285b2f['shift']());}catch(_0x5e178){_0x285b2f['push'](_0x285b2f['shift']());}}}(a212_0x482a,0x411b6));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a212_0x10c6(_0x12cb4f,_0x41fcb0){_0x12cb4f=_0x12cb4f-0x1af;const _0x482a99=a212_0x482a();let _0x10c683=_0x482a99[_0x12cb4f];return _0x10c683;}function a212_0x482a(){const _0x1262ca=['1031744zAsaYg','str','504387cQcucI','username','Resolved\x20\x22','72EscuMM','name','2198uwUhkz','nickname','172MOkVhS','userId','30018PHTjWH','Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.','flagMissing','275yEGCuc','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','1119450ILihuS','user-resolve','520936ZaiDuu','1158KEYmJE','547870VquTbg','Pass\x20--name\x20<nickname|username>.','role'];a212_0x482a=function(){return _0x1262ca;};return a212_0x482a();}import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a212_0x5063b2(0x1b2),'command':a212_0x5063b2(0x1c4),'description':a212_0x5063b2(0x1c2),'risk':'read','flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0xbb9045){const _0x899cc9=a212_0x5063b2;if(!_0xbb9045[_0x899cc9(0x1b4)]('name')['trim']())throw CliErrors[_0x899cc9(0x1c0)](_0x899cc9(0x1b9),_0x899cc9(0x1b1));},async 'execute'(_0x44c865){const _0x37cb9d=a212_0x5063b2,_0x1fd096=_0x44c865['str'](_0x37cb9d(0x1b9))['trim'](),_0xc15bb3=await resolveUserRef(_0x1fd096,_0x37cb9d(0x1bf));return{'ok':!![],'data':{'user':{'userId':_0xc15bb3[_0x37cb9d(0x1bd)],'username':_0xc15bb3[_0x37cb9d(0x1b6)],'nickname':_0xc15bb3[_0x37cb9d(0x1bb)],'matchedBy':_0xc15bb3['matchedBy']}},'message':_0x37cb9d(0x1b7)+_0x1fd096+'\x22\x20→\x20userId\x20'+_0xc15bb3['userId']};}};
@@ -1 +1 @@
1
- const a199_0x162f87=a199_0x1733;(function(_0x44a8d1,_0x1ca483){const _0x2f3f23=a199_0x1733,_0x590556=_0x44a8d1();while(!![]){try{const _0x1c795e=-parseInt(_0x2f3f23(0x1f3))/0x1*(parseInt(_0x2f3f23(0x1fb))/0x2)+-parseInt(_0x2f3f23(0x1fa))/0x3+parseInt(_0x2f3f23(0x202))/0x4*(parseInt(_0x2f3f23(0x1f6))/0x5)+parseInt(_0x2f3f23(0x1fe))/0x6+-parseInt(_0x2f3f23(0x1f4))/0x7+parseInt(_0x2f3f23(0x1f9))/0x8+parseInt(_0x2f3f23(0x1fd))/0x9;if(_0x1c795e===_0x1ca483)break;else _0x590556['push'](_0x590556['shift']());}catch(_0x337f59){_0x590556['push'](_0x590556['shift']());}}}(a199_0x1eb8,0x80c64));function a199_0x1eb8(){const _0x107aaf=['get','Get\x20one\x20agent\x20context\x20rule\x20for\x20the\x20resolved\x20app','rule','1986188OLtNgt','Loaded\x20','\x20for\x20','\x20is\x20not\x20configured\x20for\x20app\x20','169sccgSb','466333UcaQWV','read','5tABZBM','cookie','appCode','657768Yhjgkq','1478730yVTqHa','5218AAQeWB','Create\x20it\x20with\x20`rabetbase\x20rule\x20set\x20--type\x20','6538995WfIcbe','1335522PfJKgN'];a199_0x1eb8=function(){return _0x107aaf;};return a199_0x1eb8();}import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPE_FLAG,appRuleError,appRuleFileName,projectAppRule,readAppRuleType}from'../../commands/rule/shared.js';function a199_0x1733(_0x3c230a,_0x4aec80){_0x3c230a=_0x3c230a-0x1f3;const _0x1eb878=a199_0x1eb8();let _0x1733c6=_0x1eb878[_0x3c230a];return _0x1733c6;}export const ruleGet={'service':a199_0x162f87(0x201),'command':a199_0x162f87(0x1ff),'description':a199_0x162f87(0x200),'risk':a199_0x162f87(0x1f5),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG],async 'validate'(_0x35d863){readAppRuleType(_0x35d863);},async 'execute'(_0x3e10b7){const _0x47b0b4=a199_0x162f87,_0x4108eb=readAppRuleType(_0x3e10b7),_0x257034=await getAppRule(_0x3e10b7[_0x47b0b4(0x1f7)],{'appCode':_0x3e10b7[_0x47b0b4(0x1f8)],'type':_0x4108eb});if(!_0x257034)throw appRuleError('app_rule_not_found',appRuleFileName(_0x4108eb)+_0x47b0b4(0x205)+_0x3e10b7[_0x47b0b4(0x1f8)]+'.',_0x47b0b4(0x1fc)+_0x4108eb+'\x20--file\x20<path>\x20--dry-run`.');return{'ok':!![],'data':{'rule':{...projectAppRule(_0x4108eb,_0x257034),'content':_0x257034['content']}},'message':_0x47b0b4(0x203)+appRuleFileName(_0x4108eb)+_0x47b0b4(0x204)+_0x3e10b7[_0x47b0b4(0x1f8)]};}};
1
+ function a213_0x37f2(_0x5d07d0,_0x3f968e){_0x5d07d0=_0x5d07d0-0x8d;const _0x1a0946=a213_0x1a09();let _0x37f2f7=_0x1a0946[_0x5d07d0];return _0x37f2f7;}const a213_0x13c029=a213_0x37f2;(function(_0x58c844,_0xec35d5){const _0x2d5123=a213_0x37f2,_0x38779d=_0x58c844();while(!![]){try{const _0x3a74b4=-parseInt(_0x2d5123(0x8d))/0x1+-parseInt(_0x2d5123(0x90))/0x2*(-parseInt(_0x2d5123(0x98))/0x3)+-parseInt(_0x2d5123(0x95))/0x4+-parseInt(_0x2d5123(0x9d))/0x5+parseInt(_0x2d5123(0x9c))/0x6+-parseInt(_0x2d5123(0x91))/0x7+-parseInt(_0x2d5123(0x94))/0x8*(-parseInt(_0x2d5123(0x8e))/0x9);if(_0x3a74b4===_0xec35d5)break;else _0x38779d['push'](_0x38779d['shift']());}catch(_0x5ccdbb){_0x38779d['push'](_0x38779d['shift']());}}}(a213_0x1a09,0x66c0b));import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPE_FLAG,appRuleError,appRuleFileName,projectAppRule,readAppRuleType}from'../../commands/rule/shared.js';function a213_0x1a09(){const _0x33aa5e=['app_rule_not_found','4616XbbxjD','1659260vURxSB','rule','\x20--file\x20<path>\x20--dry-run`.','15gPmdkp','Loaded\x20','appCode','\x20for\x20','1877130elOEyj','4179845lWjvxL','read','533831VvfonU','26964uZxuIi','\x20is\x20not\x20configured\x20for\x20app\x20','189996uSorhy','2177329jNZLjb','Get\x20one\x20agent\x20context\x20rule\x20for\x20the\x20resolved\x20app'];a213_0x1a09=function(){return _0x33aa5e;};return a213_0x1a09();}export const ruleGet={'service':a213_0x13c029(0x96),'command':'get','description':a213_0x13c029(0x92),'risk':a213_0x13c029(0x9e),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG],async 'validate'(_0x31c729){readAppRuleType(_0x31c729);},async 'execute'(_0x189f54){const _0x48dd70=a213_0x13c029,_0x1a7485=readAppRuleType(_0x189f54),_0x5b026a=await getAppRule(_0x189f54['cookie'],{'appCode':_0x189f54[_0x48dd70(0x9a)],'type':_0x1a7485});if(!_0x5b026a)throw appRuleError(_0x48dd70(0x93),appRuleFileName(_0x1a7485)+_0x48dd70(0x8f)+_0x189f54[_0x48dd70(0x9a)]+'.','Create\x20it\x20with\x20`rabetbase\x20rule\x20set\x20--type\x20'+_0x1a7485+_0x48dd70(0x97));return{'ok':!![],'data':{'rule':{...projectAppRule(_0x1a7485,_0x5b026a),'content':_0x5b026a['content']}},'message':_0x48dd70(0x99)+appRuleFileName(_0x1a7485)+_0x48dd70(0x9b)+_0x189f54[_0x48dd70(0x9a)]};}};
@@ -1 +1 @@
1
- (function(_0x3f8240,_0x229193){const _0x448644=a200_0x1742,_0x5d087a=_0x3f8240();while(!![]){try{const _0x1b4b89=-parseInt(_0x448644(0x18c))/0x1+-parseInt(_0x448644(0x18f))/0x2*(-parseInt(_0x448644(0x191))/0x3)+parseInt(_0x448644(0x190))/0x4+-parseInt(_0x448644(0x18b))/0x5*(-parseInt(_0x448644(0x188))/0x6)+parseInt(_0x448644(0x189))/0x7+parseInt(_0x448644(0x18e))/0x8*(parseInt(_0x448644(0x18a))/0x9)+parseInt(_0x448644(0x18d))/0xa*(-parseInt(_0x448644(0x192))/0xb);if(_0x1b4b89===_0x229193)break;else _0x5d087a['push'](_0x5d087a['shift']());}catch(_0x5491e9){_0x5d087a['push'](_0x5d087a['shift']());}}}(a200_0x4160,0x3bb35));import{ruleGet}from'../../commands/rule/get.js';function a200_0x4160(){const _0x11b4c3=['77570rQdjSp','133025akXabQ','5869030teZHDW','24BKKdQz','292308xTnIel','1221584nGcXip','3MzHSSj','11IEZmOD','30HRWPEu','2268896pJFlkz','333639PlVlXB'];a200_0x4160=function(){return _0x11b4c3;};return a200_0x4160();}import{ruleList}from'../../commands/rule/list.js';function a200_0x1742(_0x321159,_0x11c39a){_0x321159=_0x321159-0x188;const _0x41600e=a200_0x4160();let _0x17427c=_0x41600e[_0x321159];return _0x17427c;}import{ruleSet}from'../../commands/rule/set.js';export const ruleDefinitions=[ruleList,ruleGet,ruleSet];
1
+ (function(_0x2d9f41,_0x26c971){const _0x33c93a=a214_0x1546,_0x3e6654=_0x2d9f41();while(!![]){try{const _0x1ca3ea=-parseInt(_0x33c93a(0x89))/0x1+-parseInt(_0x33c93a(0x8b))/0x2+-parseInt(_0x33c93a(0x8f))/0x3*(-parseInt(_0x33c93a(0x8e))/0x4)+-parseInt(_0x33c93a(0x8a))/0x5+parseInt(_0x33c93a(0x8c))/0x6*(-parseInt(_0x33c93a(0x8d))/0x7)+-parseInt(_0x33c93a(0x90))/0x8*(-parseInt(_0x33c93a(0x92))/0x9)+parseInt(_0x33c93a(0x91))/0xa;if(_0x1ca3ea===_0x26c971)break;else _0x3e6654['push'](_0x3e6654['shift']());}catch(_0x299a8c){_0x3e6654['push'](_0x3e6654['shift']());}}}(a214_0xec8e,0x43e1e));import{ruleGet}from'../../commands/rule/get.js';import{ruleList}from'../../commands/rule/list.js';function a214_0xec8e(){const _0x367022=['196DweLjS','939fTOfJP','8LMioou','5184700cMJmVM','4315032iIaJoO','444391pcqLvs','613170vuJpRE','165760gyzbUF','255912xFalMs','14pAxHPm'];a214_0xec8e=function(){return _0x367022;};return a214_0xec8e();}function a214_0x1546(_0x30428c,_0x81b2db){_0x30428c=_0x30428c-0x89;const _0xec8e3b=a214_0xec8e();let _0x1546b6=_0xec8e3b[_0x30428c];return _0x1546b6;}import{ruleSet}from'../../commands/rule/set.js';export const ruleDefinitions=[ruleList,ruleGet,ruleSet];
@@ -1 +1 @@
1
- function a201_0x273f(){const _0x3dd96d=['2229IYHnuF','1020550OVTKnO','678830RdthRW','map','list','read','1314nDdnpu','279rkMMhN','cookie','482432ZjMpNT','76240MLHWck','Loaded\x20app\x20rule\x20configuration\x20for\x20','366aoXbna','71624XoMfjV','length','List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','all','rule','appCode','9121PjcWkQ'];a201_0x273f=function(){return _0x3dd96d;};return a201_0x273f();}const a201_0x2d1102=a201_0x5c43;(function(_0x4b4d18,_0x7a966c){const _0x1b94f1=a201_0x5c43,_0x49f697=_0x4b4d18();while(!![]){try{const _0xa7133d=-parseInt(_0x1b94f1(0x11c))/0x1+parseInt(_0x1b94f1(0x11e))/0x2*(-parseInt(_0x1b94f1(0x112))/0x3)+parseInt(_0x1b94f1(0x11b))/0x4+parseInt(_0x1b94f1(0x114))/0x5+-parseInt(_0x1b94f1(0x118))/0x6*(-parseInt(_0x1b94f1(0x111))/0x7)+-parseInt(_0x1b94f1(0x11f))/0x8*(parseInt(_0x1b94f1(0x119))/0x9)+parseInt(_0x1b94f1(0x113))/0xa;if(_0xa7133d===_0x7a966c)break;else _0x49f697['push'](_0x49f697['shift']());}catch(_0x3c5a4e){_0x49f697['push'](_0x49f697['shift']());}}}(a201_0x273f,0x259b2));import{getAppRule}from'../../core/api-client.js';function a201_0x5c43(_0x1c4f7b,_0x3cedf6){_0x1c4f7b=_0x1c4f7b-0x10c;const _0x273fa9=a201_0x273f();let _0x5c438d=_0x273fa9[_0x1c4f7b];return _0x5c438d;}import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';export const ruleList={'service':a201_0x2d1102(0x10f),'command':a201_0x2d1102(0x116),'description':a201_0x2d1102(0x10d),'risk':a201_0x2d1102(0x117),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x270f9b){const _0x4f4f7d=a201_0x2d1102,_0x51f2ac=await Promise[_0x4f4f7d(0x10e)](APP_RULE_TYPES[_0x4f4f7d(0x115)](_0x446459=>getAppRule(_0x270f9b[_0x4f4f7d(0x11a)],{'appCode':_0x270f9b[_0x4f4f7d(0x110)],'type':_0x446459}))),_0x33ab4a=APP_RULE_TYPES[_0x4f4f7d(0x115)]((_0x2565f1,_0x4d372b)=>projectAppRule(_0x2565f1,_0x51f2ac[_0x4d372b]??null));return{'ok':!![],'data':{'total':_0x33ab4a[_0x4f4f7d(0x10c)],'rules':_0x33ab4a},'message':_0x4f4f7d(0x11d)+_0x270f9b['appCode']};}};
1
+ const a215_0x4d93f9=a215_0x486c;(function(_0x3aaa62,_0x591bf1){const _0x4d6d8b=a215_0x486c,_0x17210b=_0x3aaa62();while(!![]){try{const _0x1745a2=-parseInt(_0x4d6d8b(0x1d1))/0x1+-parseInt(_0x4d6d8b(0x1d8))/0x2+parseInt(_0x4d6d8b(0x1dc))/0x3*(-parseInt(_0x4d6d8b(0x1cf))/0x4)+parseInt(_0x4d6d8b(0x1d6))/0x5*(parseInt(_0x4d6d8b(0x1ce))/0x6)+parseInt(_0x4d6d8b(0x1d3))/0x7+parseInt(_0x4d6d8b(0x1d4))/0x8*(-parseInt(_0x4d6d8b(0x1da))/0x9)+parseInt(_0x4d6d8b(0x1d5))/0xa*(parseInt(_0x4d6d8b(0x1dd))/0xb);if(_0x1745a2===_0x591bf1)break;else _0x17210b['push'](_0x17210b['shift']());}catch(_0x415327){_0x17210b['push'](_0x17210b['shift']());}}}(a215_0xc6f3,0xf3a7c));function a215_0x486c(_0x386dea,_0x337974){_0x386dea=_0x386dea-0x1cd;const _0xc6f3ae=a215_0xc6f3();let _0x486c90=_0xc6f3ae[_0x386dea];return _0x486c90;}import{getAppRule}from'../../core/api-client.js';function a215_0xc6f3(){const _0x21071b=['3014912pHQYAK','10BQXtPU','1762315hBLqGH','Loaded\x20app\x20rule\x20configuration\x20for\x20','3948048QBwDvG','all','45StpbGY','list','3vFRESg','48566430Lwqadv','map','appCode','12LtpMOP','7898884tQuybE','length','57182iYlRpW','read','12377421BLPbsh'];a215_0xc6f3=function(){return _0x21071b;};return a215_0xc6f3();}import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';export const ruleList={'service':'rule','command':a215_0x4d93f9(0x1db),'description':'List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','risk':a215_0x4d93f9(0x1d2),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x4d9f10){const _0x1d9b17=a215_0x4d93f9,_0x4900bf=await Promise[_0x1d9b17(0x1d9)](APP_RULE_TYPES[_0x1d9b17(0x1de)](_0x52223d=>getAppRule(_0x4d9f10['cookie'],{'appCode':_0x4d9f10['appCode'],'type':_0x52223d}))),_0x1d7883=APP_RULE_TYPES['map']((_0x1810df,_0x52244a)=>projectAppRule(_0x1810df,_0x4900bf[_0x52244a]??null));return{'ok':!![],'data':{'total':_0x1d7883[_0x1d9b17(0x1d0)],'rules':_0x1d7883},'message':_0x1d9b17(0x1d7)+_0x4d9f10[_0x1d9b17(0x1cd)]};}};
@@ -1 +1 @@
1
- function a202_0x5d39(_0x61a209,_0x3671fc){_0x61a209=_0x61a209-0x1a4;const _0x218051=a202_0x2180();let _0x5d3923=_0x218051[_0x61a209];return _0x5d3923;}const a202_0x51f545=a202_0x5d39;(function(_0x1cf6aa,_0x1a4d2a){const _0x182c7a=a202_0x5d39,_0x598bce=_0x1cf6aa();while(!![]){try{const _0x4c3fb4=parseInt(_0x182c7a(0x1cd))/0x1*(parseInt(_0x182c7a(0x1d0))/0x2)+parseInt(_0x182c7a(0x1a8))/0x3+parseInt(_0x182c7a(0x1c3))/0x4*(-parseInt(_0x182c7a(0x1c9))/0x5)+parseInt(_0x182c7a(0x1cb))/0x6+-parseInt(_0x182c7a(0x1ad))/0x7*(parseInt(_0x182c7a(0x1ca))/0x8)+-parseInt(_0x182c7a(0x1d1))/0x9*(parseInt(_0x182c7a(0x1a9))/0xa)+parseInt(_0x182c7a(0x1ce))/0xb;if(_0x4c3fb4===_0x1a4d2a)break;else _0x598bce['push'](_0x598bce['shift']());}catch(_0x195712){_0x598bce['push'](_0x598bce['shift']());}}}(a202_0x2180,0x961c5));import{getAppRule,isPlatformTransportFailure,saveAppRule}from'../../core/api-client.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{APP_RULE_TYPE_FLAG,appRuleContextScope,appRuleError,appRuleFileName,inspectAppRuleContent,projectAppRule,readAppRuleFile,readAppRuleType}from'../../commands/rule/shared.js';const SAVE_PATH=a202_0x51f545(0x1c6),NON_ATOMIC_WARNING=a202_0x51f545(0x1bc);function readSetInput(_0xba645d){const _0x32acb9=a202_0x51f545,_0x5d73cc=readAppRuleType(_0xba645d),_0x25d632=_0xba645d[_0x32acb9(0x1cf)](_0x32acb9(0x1b1))['trim']();if(!_0x25d632)throw appRuleError(_0x32acb9(0x1c8),'--file\x20is\x20required.',_0x32acb9(0x1ba));const _0x56686e=_0xba645d[_0x32acb9(0x1a4)](_0x32acb9(0x1d4));let _0x28a42f;if(_0x56686e!==undefined){_0x28a42f=Number(_0x56686e);if(!Number[_0x32acb9(0x1b8)](_0x28a42f)||_0x28a42f<0x0)throw appRuleError('app_rule_expected_version_invalid',_0x32acb9(0x1a5));}return{'type':_0x5d73cc,'file':_0x25d632,'expectedVersion':_0x28a42f};}async function prepareSet(_0x21c192){const _0x59df0f=a202_0x51f545,_0x8ff385=readSetInput(_0x21c192),_0x3b254c=await readAppRuleFile(_0x8ff385['file']),_0x108b20=await getAppRule(_0x21c192['cookie'],{'appCode':_0x21c192[_0x59df0f(0x1ac)],'type':_0x8ff385['type']});if(_0x8ff385[_0x59df0f(0x1d6)]!==undefined&&_0x108b20?.[_0x59df0f(0x1d3)]!==_0x8ff385[_0x59df0f(0x1d6)])throw appRuleError(_0x59df0f(0x1bb),appRuleFileName(_0x8ff385[_0x59df0f(0x1c1)])+'\x20version\x20changed\x20before\x20write.','Expected\x20'+_0x8ff385[_0x59df0f(0x1d6)]+';\x20current\x20version\x20is\x20'+(_0x108b20?.['version']??_0x59df0f(0x1dd))+_0x59df0f(0x1c5));return{'input':_0x8ff385,'replacement':_0x3b254c,'beforeRecord':_0x108b20,'before':projectAppRule(_0x8ff385[_0x59df0f(0x1c1)],_0x108b20),'planned':{'type':_0x8ff385[_0x59df0f(0x1c1)],'fileName':appRuleFileName(_0x8ff385['type']),'contextScope':appRuleContextScope(_0x8ff385[_0x59df0f(0x1c1)]),'enabled':!![],'appCode':_0x21c192['appCode'],'scope':_0x59df0f(0x1d2),'contentByteSize':_0x3b254c[_0x59df0f(0x1be)],'contentHash':_0x3b254c[_0x59df0f(0x1bf)]}};}function warningsFor(_0x48c74b){return _0x48c74b===undefined?[]:[NON_ATOMIC_WARNING];}function a202_0x2180(){const _0x6a23fb=['app_rule_file_required','170335LAPfwl','856JkTYmE','4671132ZXRXKQ','Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','482343fsKufS','7612528IuHHrM','str','2izeCGu','9495657zELdXT','rules','version','expected-version','app_rule_set_outcome_unknown','expectedVersion','cookie','Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20','Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.','app_rule_verification_failed','string','Non-atomic\x20preflight\x20assertion\x20for\x20the\x20current\x20version','unconfigured','app_rule_verification_unavailable','POST','\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','\x20--format\x20compress','flag','--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','rabetbase\x20rule\x20get\x20--type\x20','\x20for\x20','2211420RAJXsc','10ARvBEb','write','set','appCode','26621IvudCl','\x20could\x20not\x20be\x20verified.','UTF-8\x20Markdown\x20file\x20(maximum\x205\x20MiB)','Set\x20','file','input','verified','beforeRecord','rule','cause','before','isSafeInteger','replacement','Pass\x20a\x20UTF-8\x20Markdown\x20file.','app_rule_version_mismatch','--expected-version\x20is\x20a\x20non-atomic\x20read-before-write\x20assertion;\x20the\x20server\x20save\x20contract\x20has\x20no\x20version\x20predicate.','number','byteSize','contentHash','defineProperty','type','Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.','72MmCiXE','push','.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.','/smartapi/knowledge-base/save','The\x20set\x20request\x20was\x20sent,\x20but\x20'];a202_0x2180=function(){return _0x6a23fb;};return a202_0x2180();}export const ruleSet={'service':a202_0x51f545(0x1b5),'command':a202_0x51f545(0x1ab),'description':a202_0x51f545(0x1cc),'risk':a202_0x51f545(0x1aa),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':'file','type':a202_0x51f545(0x1db),'required':!![],'description':a202_0x51f545(0x1af)},{'name':'expected-version','type':a202_0x51f545(0x1bd),'required':![],'description':a202_0x51f545(0x1dc)}],async 'validate'(_0x27637e){readSetInput(_0x27637e);},async 'dryRun'(_0x3d5e4f){const _0x2730b1=a202_0x51f545,_0x42755c=await prepareSet(_0x3d5e4f);return asDryRunResult({'operation':_0x2730b1(0x1ab),'selector':{'appCode':_0x3d5e4f[_0x2730b1(0x1ac)],'scope':_0x2730b1(0x1d2),'type':_0x42755c['input'][_0x2730b1(0x1c1)]},'before':_0x42755c['before'],'after':_0x42755c['planned'],'dryRun':!![],'backend':{'method':_0x2730b1(0x1df),'path':SAVE_PATH},'warnings':warningsFor(_0x42755c[_0x2730b1(0x1b2)][_0x2730b1(0x1d6)]),'verification':{'expectedVersion':_0x42755c[_0x2730b1(0x1b2)][_0x2730b1(0x1d6)]??null,'atomicCompareAndSet':![],'lookupCommand':_0x2730b1(0x1a6)+_0x42755c[_0x2730b1(0x1b2)][_0x2730b1(0x1c1)]+_0x2730b1(0x1e2)}},{'method':'POST','url':SAVE_PATH});},async 'execute'(_0x13b339){const _0x434f70=a202_0x51f545,_0x499750=await prepareSet(_0x13b339);let _0x2e5d91=![];try{await saveAppRule(_0x13b339[_0x434f70(0x1d7)],{'appCode':_0x13b339[_0x434f70(0x1ac)],'type':_0x499750[_0x434f70(0x1b2)][_0x434f70(0x1c1)],'content':_0x499750[_0x434f70(0x1b9)]['content']});}catch(_0x420943){if(!isPlatformTransportFailure(_0x420943))throw _0x420943;_0x2e5d91=!![];}let _0x7a7633;try{_0x7a7633=await getAppRule(_0x13b339[_0x434f70(0x1d7)],{'appCode':_0x13b339[_0x434f70(0x1ac)],'type':_0x499750[_0x434f70(0x1b2)][_0x434f70(0x1c1)]});}catch(_0x3f4d49){const _0x2f6a43=appRuleError(_0x2e5d91?_0x434f70(0x1d5):_0x434f70(0x1de),_0x434f70(0x1c7)+appRuleFileName(_0x499750['input'][_0x434f70(0x1c1)])+_0x434f70(0x1ae),_0x434f70(0x1d9));Object[_0x434f70(0x1c0)](_0x2f6a43,_0x434f70(0x1b6),{'value':_0x3f4d49,'enumerable':![]});throw _0x2f6a43;}const _0x26240f=_0x7a7633&&inspectAppRuleContent(_0x7a7633['content'])[_0x434f70(0x1bf)]===_0x499750[_0x434f70(0x1b9)][_0x434f70(0x1bf)],_0x37b43b=_0x7a7633&&(_0x499750['beforeRecord']===null||_0x7a7633[_0x434f70(0x1d3)]>_0x499750[_0x434f70(0x1b4)]['version']);if(!_0x7a7633||!_0x26240f||!_0x37b43b)throw appRuleError(_0x2e5d91?_0x434f70(0x1d5):_0x434f70(0x1da),appRuleFileName(_0x499750[_0x434f70(0x1b2)][_0x434f70(0x1c1)])+_0x434f70(0x1e0),_0x434f70(0x1d8)+_0x499750[_0x434f70(0x1b2)][_0x434f70(0x1c1)]+_0x434f70(0x1e1));const _0x40271b=warningsFor(_0x499750[_0x434f70(0x1b2)]['expectedVersion']);_0x2e5d91&&_0x40271b[_0x434f70(0x1c4)](_0x434f70(0x1c2));const _0x17325c=projectAppRule(_0x499750[_0x434f70(0x1b2)][_0x434f70(0x1c1)],_0x7a7633);return{'ok':!![],'data':{'operation':_0x434f70(0x1ab),'selector':{'appCode':_0x13b339['appCode'],'scope':'rules','type':_0x499750[_0x434f70(0x1b2)][_0x434f70(0x1c1)]},'before':_0x499750[_0x434f70(0x1b7)],'after':_0x17325c,'dryRun':![],'backend':{'method':_0x434f70(0x1df),'path':SAVE_PATH},'warnings':_0x40271b,'verification':{'status':_0x434f70(0x1b3),'recoveredAfterUnknownResponse':_0x2e5d91,'expectedVersion':_0x499750[_0x434f70(0x1b2)][_0x434f70(0x1d6)]??null,'atomicCompareAndSet':![],'lookupCommand':_0x434f70(0x1a6)+_0x499750['input']['type']+_0x434f70(0x1e2)}},'message':_0x434f70(0x1b0)+appRuleFileName(_0x499750[_0x434f70(0x1b2)][_0x434f70(0x1c1)])+_0x434f70(0x1a7)+_0x13b339[_0x434f70(0x1ac)]};}};
1
+ const a216_0x4103ae=a216_0x2061;(function(_0x3979bd,_0x2e62f0){const _0x4d8426=a216_0x2061,_0x511294=_0x3979bd();while(!![]){try{const _0x5f4dc5=parseInt(_0x4d8426(0x1e3))/0x1+parseInt(_0x4d8426(0x1ff))/0x2+-parseInt(_0x4d8426(0x1fd))/0x3+parseInt(_0x4d8426(0x1ea))/0x4*(-parseInt(_0x4d8426(0x1e2))/0x5)+parseInt(_0x4d8426(0x1ee))/0x6*(parseInt(_0x4d8426(0x1e0))/0x7)+parseInt(_0x4d8426(0x214))/0x8*(-parseInt(_0x4d8426(0x20d))/0x9)+-parseInt(_0x4d8426(0x207))/0xa*(-parseInt(_0x4d8426(0x1e1))/0xb);if(_0x5f4dc5===_0x2e62f0)break;else _0x511294['push'](_0x511294['shift']());}catch(_0x2cb2e8){_0x511294['push'](_0x511294['shift']());}}}(a216_0x4515,0x97265));import{getAppRule,isPlatformTransportFailure,saveAppRule}from'../../core/api-client.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a216_0x4515(){const _0x203ae6=['contentHash','cookie','expectedVersion','\x20for\x20','file','Pass\x20a\x20UTF-8\x20Markdown\x20file.','flag','710rXXMEM','--file\x20is\x20required.','isSafeInteger','type','\x20could\x20not\x20be\x20verified.','\x20version\x20changed\x20before\x20write.','1909557oQlpMJ',';\x20current\x20version\x20is\x20','app_rule_expected_version_invalid','beforeRecord','str','number','Non-atomic\x20preflight\x20assertion\x20for\x20the\x20current\x20version','40xJAfKJ','input','verified','byteSize','826252jwuiEz','149237RgtKNb','235ZofCzW','395564sWLRJq','rules','unconfigured','defineProperty','appCode','before','content','55976yXpKDo','app_rule_set_outcome_unknown','\x20--format\x20compress','app_rule_file_required','12DmKwgv','\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','rule','app_rule_verification_failed','POST','trim','version','set','/smartapi/knowledge-base/save','string','--expected-version\x20is\x20a\x20non-atomic\x20read-before-write\x20assertion;\x20the\x20server\x20save\x20contract\x20has\x20no\x20version\x20predicate.','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','cause','write','replacement','719379bFbfsZ','rabetbase\x20rule\x20get\x20--type\x20','1965184icZVWS'];a216_0x4515=function(){return _0x203ae6;};return a216_0x4515();}import{APP_RULE_TYPE_FLAG,appRuleContextScope,appRuleError,appRuleFileName,inspectAppRuleContent,projectAppRule,readAppRuleFile,readAppRuleType}from'../../commands/rule/shared.js';const SAVE_PATH=a216_0x4103ae(0x1f6),NON_ATOMIC_WARNING=a216_0x4103ae(0x1f8);function a216_0x2061(_0xb97f18,_0x21d961){_0xb97f18=_0xb97f18-0x1de;const _0x451578=a216_0x4515();let _0x20616a=_0x451578[_0xb97f18];return _0x20616a;}function readSetInput(_0x251180){const _0x1e617f=a216_0x4103ae,_0x3c1067=readAppRuleType(_0x251180),_0xb49b41=_0x251180[_0x1e617f(0x211)]('file')[_0x1e617f(0x1f3)]();if(!_0xb49b41)throw appRuleError(_0x1e617f(0x1ed),_0x1e617f(0x208),_0x1e617f(0x205));const _0x2e06e3=_0x251180[_0x1e617f(0x206)]('expected-version');let _0x1f2f02;if(_0x2e06e3!==undefined){_0x1f2f02=Number(_0x2e06e3);if(!Number[_0x1e617f(0x209)](_0x1f2f02)||_0x1f2f02<0x0)throw appRuleError(_0x1e617f(0x20f),'--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.');}return{'type':_0x3c1067,'file':_0xb49b41,'expectedVersion':_0x1f2f02};}async function prepareSet(_0x1510ff){const _0x4fd582=a216_0x4103ae,_0xff0097=readSetInput(_0x1510ff),_0x28d6cf=await readAppRuleFile(_0xff0097[_0x4fd582(0x204)]),_0x26ae44=await getAppRule(_0x1510ff[_0x4fd582(0x201)],{'appCode':_0x1510ff['appCode'],'type':_0xff0097[_0x4fd582(0x20a)]});if(_0xff0097[_0x4fd582(0x202)]!==undefined&&_0x26ae44?.[_0x4fd582(0x1f4)]!==_0xff0097['expectedVersion'])throw appRuleError('app_rule_version_mismatch',appRuleFileName(_0xff0097[_0x4fd582(0x20a)])+_0x4fd582(0x20c),'Expected\x20'+_0xff0097[_0x4fd582(0x202)]+_0x4fd582(0x20e)+(_0x26ae44?.[_0x4fd582(0x1f4)]??_0x4fd582(0x1e5))+'.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.');return{'input':_0xff0097,'replacement':_0x28d6cf,'beforeRecord':_0x26ae44,'before':projectAppRule(_0xff0097[_0x4fd582(0x20a)],_0x26ae44),'planned':{'type':_0xff0097[_0x4fd582(0x20a)],'fileName':appRuleFileName(_0xff0097[_0x4fd582(0x20a)]),'contextScope':appRuleContextScope(_0xff0097[_0x4fd582(0x20a)]),'enabled':!![],'appCode':_0x1510ff[_0x4fd582(0x1e7)],'scope':_0x4fd582(0x1e4),'contentByteSize':_0x28d6cf[_0x4fd582(0x1df)],'contentHash':_0x28d6cf['contentHash']}};}function warningsFor(_0xcf211b){return _0xcf211b===undefined?[]:[NON_ATOMIC_WARNING];}export const ruleSet={'service':a216_0x4103ae(0x1f0),'command':a216_0x4103ae(0x1f5),'description':'Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','risk':a216_0x4103ae(0x1fb),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':a216_0x4103ae(0x204),'type':a216_0x4103ae(0x1f7),'required':!![],'description':'UTF-8\x20Markdown\x20file\x20(maximum\x205\x20MiB)'},{'name':'expected-version','type':a216_0x4103ae(0x212),'required':![],'description':a216_0x4103ae(0x213)}],async 'validate'(_0x5b78a2){readSetInput(_0x5b78a2);},async 'dryRun'(_0x28e59b){const _0x2d79f9=a216_0x4103ae,_0x148f49=await prepareSet(_0x28e59b);return asDryRunResult({'operation':_0x2d79f9(0x1f5),'selector':{'appCode':_0x28e59b[_0x2d79f9(0x1e7)],'scope':_0x2d79f9(0x1e4),'type':_0x148f49['input']['type']},'before':_0x148f49[_0x2d79f9(0x1e8)],'after':_0x148f49['planned'],'dryRun':!![],'backend':{'method':_0x2d79f9(0x1f2),'path':SAVE_PATH},'warnings':warningsFor(_0x148f49[_0x2d79f9(0x215)][_0x2d79f9(0x202)]),'verification':{'expectedVersion':_0x148f49['input'][_0x2d79f9(0x202)]??null,'atomicCompareAndSet':![],'lookupCommand':_0x2d79f9(0x1fe)+_0x148f49[_0x2d79f9(0x215)]['type']+'\x20--format\x20compress'}},{'method':'POST','url':SAVE_PATH});},async 'execute'(_0x20899c){const _0x2af536=a216_0x4103ae,_0x6e939c=await prepareSet(_0x20899c);let _0x59fdd4=![];try{await saveAppRule(_0x20899c[_0x2af536(0x201)],{'appCode':_0x20899c[_0x2af536(0x1e7)],'type':_0x6e939c['input'][_0x2af536(0x20a)],'content':_0x6e939c[_0x2af536(0x1fc)][_0x2af536(0x1e9)]});}catch(_0x4e4621){if(!isPlatformTransportFailure(_0x4e4621))throw _0x4e4621;_0x59fdd4=!![];}let _0x532530;try{_0x532530=await getAppRule(_0x20899c[_0x2af536(0x201)],{'appCode':_0x20899c[_0x2af536(0x1e7)],'type':_0x6e939c[_0x2af536(0x215)][_0x2af536(0x20a)]});}catch(_0x2eb084){const _0x5d35ce=appRuleError(_0x59fdd4?_0x2af536(0x1eb):'app_rule_verification_unavailable','The\x20set\x20request\x20was\x20sent,\x20but\x20'+appRuleFileName(_0x6e939c['input']['type'])+_0x2af536(0x20b),'Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.');Object[_0x2af536(0x1e6)](_0x5d35ce,_0x2af536(0x1fa),{'value':_0x2eb084,'enumerable':![]});throw _0x5d35ce;}const _0x448b34=_0x532530&&inspectAppRuleContent(_0x532530[_0x2af536(0x1e9)])[_0x2af536(0x200)]===_0x6e939c['replacement'][_0x2af536(0x200)],_0x1dd7fc=_0x532530&&(_0x6e939c[_0x2af536(0x210)]===null||_0x532530[_0x2af536(0x1f4)]>_0x6e939c[_0x2af536(0x210)]['version']);if(!_0x532530||!_0x448b34||!_0x1dd7fc)throw appRuleError(_0x59fdd4?'app_rule_set_outcome_unknown':_0x2af536(0x1f1),appRuleFileName(_0x6e939c[_0x2af536(0x215)]['type'])+_0x2af536(0x1ef),'Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20'+_0x6e939c[_0x2af536(0x215)][_0x2af536(0x20a)]+_0x2af536(0x1f9));const _0x35f2c9=warningsFor(_0x6e939c[_0x2af536(0x215)]['expectedVersion']);_0x59fdd4&&_0x35f2c9['push']('Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.');const _0x3bda5a=projectAppRule(_0x6e939c[_0x2af536(0x215)][_0x2af536(0x20a)],_0x532530);return{'ok':!![],'data':{'operation':'set','selector':{'appCode':_0x20899c[_0x2af536(0x1e7)],'scope':'rules','type':_0x6e939c[_0x2af536(0x215)][_0x2af536(0x20a)]},'before':_0x6e939c['before'],'after':_0x3bda5a,'dryRun':![],'backend':{'method':_0x2af536(0x1f2),'path':SAVE_PATH},'warnings':_0x35f2c9,'verification':{'status':_0x2af536(0x1de),'recoveredAfterUnknownResponse':_0x59fdd4,'expectedVersion':_0x6e939c[_0x2af536(0x215)]['expectedVersion']??null,'atomicCompareAndSet':![],'lookupCommand':_0x2af536(0x1fe)+_0x6e939c[_0x2af536(0x215)][_0x2af536(0x20a)]+_0x2af536(0x1ec)}},'message':'Set\x20'+appRuleFileName(_0x6e939c[_0x2af536(0x215)][_0x2af536(0x20a)])+_0x2af536(0x203)+_0x20899c[_0x2af536(0x1e7)]};}};
@@ -1 +1 @@
1
- const a203_0x54f9da=a203_0x104c;(function(_0x1b93a3,_0xc3873d){const _0x2a14d0=a203_0x104c,_0x29ad52=_0x1b93a3();while(!![]){try{const _0x2e93a4=parseInt(_0x2a14d0(0x173))/0x1+-parseInt(_0x2a14d0(0x188))/0x2*(parseInt(_0x2a14d0(0x17f))/0x3)+parseInt(_0x2a14d0(0x170))/0x4+-parseInt(_0x2a14d0(0x182))/0x5*(-parseInt(_0x2a14d0(0x16e))/0x6)+parseInt(_0x2a14d0(0x19b))/0x7*(-parseInt(_0x2a14d0(0x192))/0x8)+-parseInt(_0x2a14d0(0x189))/0x9+parseInt(_0x2a14d0(0x178))/0xa;if(_0x2e93a4===_0xc3873d)break;else _0x29ad52['push'](_0x29ad52['shift']());}catch(_0x9bfaec){_0x29ad52['push'](_0x29ad52['shift']());}}}(a203_0x8ca6,0x21e94));import{createHash}from'node:crypto';import{readFile,stat}from'node:fs/promises';import{resolve}from'node:path';import{TextDecoder}from'node:util';import{CliError}from'../../errors.js';export const APP_RULE_TYPES=[a203_0x54f9da(0x180),a203_0x54f9da(0x18c)];export const MAX_APP_RULE_BYTES=0x5*0x400*0x400;const APP_RULE_FILES={'rules':a203_0x54f9da(0x19f),'database':a203_0x54f9da(0x18b)},APP_RULE_CONTEXT_SCOPES={'rules':a203_0x54f9da(0x19d),'database':a203_0x54f9da(0x18f)};export function appRuleError(_0x7874eb,_0x1dd82d,_0x20de35){return new CliError(_0x7874eb,0x1,_0x1dd82d,_0x20de35);}export function readAppRuleType(_0x340d73){const _0x55bfff=a203_0x54f9da,_0x31112a=_0x340d73[_0x55bfff(0x171)](_0x55bfff(0x1a4))[_0x55bfff(0x18a)]()[_0x55bfff(0x17e)]();if(_0x31112a!==_0x55bfff(0x180)&&_0x31112a!==_0x55bfff(0x18c))throw appRuleError(_0x55bfff(0x193),_0x55bfff(0x186));return _0x31112a;}function a203_0x8ca6(){const _0x3dfe24=['update','database-analysis','createTime','decode','8ZFRwBQ','app_rule_type_invalid','digest','App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','app_rule_file_invalid','app_rule_file_unreadable','size','utf-8','isFile','1111579wBjUqN','content','page-api-development','byteLength','RULES.md','app_rule_content_too_large','byteSize','utf8','sha256','type','122022CRjFKQ','App\x20rule\x20content\x20exceeds\x20the\x205\x20MiB\x20server\x20limit.','942176QgGTjJ','str','hex','158819axNrem','app_rule_content_invalid','from','updateTime','Cannot\x20access\x20app\x20rule\x20file:\x20','1642380HihsiY','contentHash','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','--file\x20is\x20required.','App\x20rule\x20file\x20is\x20blank:\x20','Cannot\x20read\x20app\x20rule\x20file:\x20','toLowerCase','202956UXjZWF','rules','version','10ILxush','scope','Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','message','--type\x20must\x20be\x20either\x20rules\x20or\x20database.','appCode','2GiLmoq','2105334pxaeSh','trim','DATABASE.md','database','app_rule_file_required'];a203_0x8ca6=function(){return _0x3dfe24;};return a203_0x8ca6();}export function appRuleFileName(_0x34e1ea){return APP_RULE_FILES[_0x34e1ea];}export function appRuleContextScope(_0x597d1b){return APP_RULE_CONTEXT_SCOPES[_0x597d1b];}export function inspectAppRuleContent(_0x3e85be){const _0x3dfe05=a203_0x54f9da,_0x54827d=Buffer[_0x3dfe05(0x175)](_0x3e85be,_0x3dfe05(0x1a2));return{'content':_0x3e85be,'byteSize':_0x54827d[_0x3dfe05(0x19e)],'contentHash':'sha256:'+createHash(_0x3dfe05(0x1a3))[_0x3dfe05(0x18e)](_0x54827d)[_0x3dfe05(0x194)](_0x3dfe05(0x172))};}export async function readAppRuleFile(_0x1db151){const _0x23a030=a203_0x54f9da,_0x19214f=_0x1db151[_0x23a030(0x18a)]();if(!_0x19214f)throw appRuleError(_0x23a030(0x18d),_0x23a030(0x17b),'Pass\x20a\x20UTF-8\x20Markdown\x20file.');const _0xa83530=resolve(_0x19214f);let _0x51946f;try{_0x51946f=await stat(_0xa83530);}catch(_0x205c08){throw appRuleError(_0x23a030(0x197),_0x23a030(0x177)+_0x19214f,_0x205c08 instanceof Error?_0x205c08[_0x23a030(0x185)]:String(_0x205c08));}if(!_0x51946f[_0x23a030(0x19a)]())throw appRuleError(_0x23a030(0x196),_0x23a030(0x17a)+_0x19214f);if(_0x51946f[_0x23a030(0x198)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x23a030(0x1a0),'App\x20rule\x20content\x20exceeds\x20the\x205\x20MiB\x20server\x20limit.');let _0xc381e3;try{_0xc381e3=await readFile(_0xa83530);}catch(_0x34aac4){throw appRuleError(_0x23a030(0x197),_0x23a030(0x17d)+_0x19214f,_0x34aac4 instanceof Error?_0x34aac4[_0x23a030(0x185)]:String(_0x34aac4));}if(_0xc381e3[_0x23a030(0x19e)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x23a030(0x1a0),_0x23a030(0x16f));let _0x81ddef;try{_0x81ddef=new TextDecoder(_0x23a030(0x199),{'fatal':!![],'ignoreBOM':!![]})[_0x23a030(0x191)](_0xc381e3);}catch{throw appRuleError(_0x23a030(0x174),_0x23a030(0x195)+_0x19214f);}if(!_0x81ddef[_0x23a030(0x18a)]())throw appRuleError(_0x23a030(0x174),_0x23a030(0x17c)+_0x19214f);return inspectAppRuleContent(_0x81ddef);}function a203_0x104c(_0x7fbf5,_0x74004b){_0x7fbf5=_0x7fbf5-0x16e;const _0x8ca62b=a203_0x8ca6();let _0x104cd3=_0x8ca62b[_0x7fbf5];return _0x104cd3;}export function projectAppRule(_0x39edf5,_0x4251d0){const _0x366ee4=a203_0x54f9da;if(!_0x4251d0)return{'type':_0x39edf5,'fileName':appRuleFileName(_0x39edf5),'contextScope':appRuleContextScope(_0x39edf5),'enabled':![]};const _0x2a9cea=inspectAppRuleContent(_0x4251d0[_0x366ee4(0x19c)]);return{'type':_0x39edf5,'fileName':appRuleFileName(_0x39edf5),'contextScope':appRuleContextScope(_0x39edf5),'enabled':!![],'id':_0x4251d0['id'],'scope':_0x4251d0[_0x366ee4(0x183)],'appCode':_0x4251d0[_0x366ee4(0x187)],'version':_0x4251d0[_0x366ee4(0x181)],'contentByteSize':_0x2a9cea[_0x366ee4(0x1a1)],'contentHash':_0x2a9cea[_0x366ee4(0x179)],..._0x4251d0['createTime']!==undefined&&_0x4251d0['createTime']!==null?{'createTime':_0x4251d0[_0x366ee4(0x190)]}:{},..._0x4251d0[_0x366ee4(0x176)]!==undefined&&_0x4251d0['updateTime']!==null?{'updateTime':_0x4251d0[_0x366ee4(0x176)]}:{}};}export const APP_RULE_TYPE_FLAG={'name':a203_0x54f9da(0x1a4),'type':'string','required':!![],'description':a203_0x54f9da(0x184),'enum':[...APP_RULE_TYPES]};
1
+ const a217_0x24c578=a217_0x4bb5;(function(_0x4d7a96,_0x273d72){const _0x451ac9=a217_0x4bb5,_0x53343d=_0x4d7a96();while(!![]){try{const _0x10dfff=-parseInt(_0x451ac9(0x8d))/0x1*(-parseInt(_0x451ac9(0x91))/0x2)+-parseInt(_0x451ac9(0x84))/0x3*(parseInt(_0x451ac9(0x98))/0x4)+-parseInt(_0x451ac9(0xb1))/0x5+parseInt(_0x451ac9(0x83))/0x6+parseInt(_0x451ac9(0x97))/0x7*(parseInt(_0x451ac9(0x80))/0x8)+parseInt(_0x451ac9(0xaa))/0x9*(-parseInt(_0x451ac9(0x7f))/0xa)+-parseInt(_0x451ac9(0x9f))/0xb*(-parseInt(_0x451ac9(0x88))/0xc);if(_0x10dfff===_0x273d72)break;else _0x53343d['push'](_0x53343d['shift']());}catch(_0x1101ba){_0x53343d['push'](_0x53343d['shift']());}}}(a217_0x2c44,0x38206));import{createHash}from'node:crypto';import{readFile,stat}from'node:fs/promises';import{resolve}from'node:path';import{TextDecoder}from'node:util';import{CliError}from'../../errors.js';export const APP_RULE_TYPES=[a217_0x24c578(0x8c),a217_0x24c578(0xa6)];export const MAX_APP_RULE_BYTES=0x5*0x400*0x400;function a217_0x4bb5(_0x313b69,_0x11e2e6){_0x313b69=_0x313b69-0x7d;const _0x2c447b=a217_0x2c44();let _0x4bb536=_0x2c447b[_0x313b69];return _0x4bb536;}const APP_RULE_FILES={'rules':a217_0x24c578(0x8f),'database':a217_0x24c578(0xa1)},APP_RULE_CONTEXT_SCOPES={'rules':a217_0x24c578(0xae),'database':a217_0x24c578(0xa8)};export function appRuleError(_0x14c9b4,_0x17019d,_0x40e537){return new CliError(_0x14c9b4,0x1,_0x17019d,_0x40e537);}export function readAppRuleType(_0xac3175){const _0x1fd0ce=a217_0x24c578,_0x32c078=_0xac3175[_0x1fd0ce(0x7d)](_0x1fd0ce(0xb0))[_0x1fd0ce(0x9e)]()[_0x1fd0ce(0x9c)]();if(_0x32c078!=='rules'&&_0x32c078!==_0x1fd0ce(0xa6))throw appRuleError('app_rule_type_invalid',_0x1fd0ce(0xab));return _0x32c078;}export function appRuleFileName(_0x2787de){return APP_RULE_FILES[_0x2787de];}export function appRuleContextScope(_0x280100){return APP_RULE_CONTEXT_SCOPES[_0x280100];}function a217_0x2c44(){const _0x12d529=['app_rule_content_invalid','toLowerCase','Cannot\x20read\x20app\x20rule\x20file:\x20','trim','22Czrypq','decode','DATABASE.md','App\x20rule\x20file\x20is\x20blank:\x20','app_rule_content_too_large','App\x20rule\x20content\x20exceeds\x20the\x205\x20MiB\x20server\x20limit.','app_rule_file_invalid','database','version','database-analysis','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','459BpcMAe','--type\x20must\x20be\x20either\x20rules\x20or\x20database.','utf8','Pass\x20a\x20UTF-8\x20Markdown\x20file.','page-api-development','appCode','type','1490145VrwmAM','str','Cannot\x20access\x20app\x20rule\x20file:\x20','63980CZTQay','912jmXaNX','content','app_rule_file_required','1547298modbqH','7131ukuewv','createTime','updateTime','sha256:','4592748FyDwpt','from','app_rule_file_unreadable','message','rules','137jYycVL','scope','RULES.md','contentHash','72oCIaDQ','App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','string','hex','byteLength','byteSize','1281OiYeLS','328KIEkby','size','Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis'];a217_0x2c44=function(){return _0x12d529;};return a217_0x2c44();}export function inspectAppRuleContent(_0x191dca){const _0x548d0c=a217_0x24c578,_0x19f4e0=Buffer[_0x548d0c(0x89)](_0x191dca,_0x548d0c(0xac));return{'content':_0x191dca,'byteSize':_0x19f4e0[_0x548d0c(0x95)],'contentHash':_0x548d0c(0x87)+createHash('sha256')['update'](_0x19f4e0)['digest'](_0x548d0c(0x94))};}export async function readAppRuleFile(_0x165626){const _0x72dbac=a217_0x24c578,_0x1d51ee=_0x165626[_0x72dbac(0x9e)]();if(!_0x1d51ee)throw appRuleError(_0x72dbac(0x82),'--file\x20is\x20required.',_0x72dbac(0xad));const _0x34b9d8=resolve(_0x1d51ee);let _0x2ab112;try{_0x2ab112=await stat(_0x34b9d8);}catch(_0x32ae80){throw appRuleError(_0x72dbac(0x8a),_0x72dbac(0x7e)+_0x1d51ee,_0x32ae80 instanceof Error?_0x32ae80[_0x72dbac(0x8b)]:String(_0x32ae80));}if(!_0x2ab112['isFile']())throw appRuleError(_0x72dbac(0xa5),_0x72dbac(0xa9)+_0x1d51ee);if(_0x2ab112[_0x72dbac(0x99)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x72dbac(0xa3),_0x72dbac(0xa4));let _0x2be6c0;try{_0x2be6c0=await readFile(_0x34b9d8);}catch(_0x1cc7bc){throw appRuleError(_0x72dbac(0x8a),_0x72dbac(0x9d)+_0x1d51ee,_0x1cc7bc instanceof Error?_0x1cc7bc['message']:String(_0x1cc7bc));}if(_0x2be6c0['byteLength']>MAX_APP_RULE_BYTES)throw appRuleError(_0x72dbac(0xa3),_0x72dbac(0xa4));let _0x337477;try{_0x337477=new TextDecoder('utf-8',{'fatal':!![],'ignoreBOM':!![]})[_0x72dbac(0xa0)](_0x2be6c0);}catch{throw appRuleError(_0x72dbac(0x9b),_0x72dbac(0x92)+_0x1d51ee);}if(!_0x337477[_0x72dbac(0x9e)]())throw appRuleError(_0x72dbac(0x9b),_0x72dbac(0xa2)+_0x1d51ee);return inspectAppRuleContent(_0x337477);}export function projectAppRule(_0x12f838,_0x3b6dc2){const _0x22476b=a217_0x24c578;if(!_0x3b6dc2)return{'type':_0x12f838,'fileName':appRuleFileName(_0x12f838),'contextScope':appRuleContextScope(_0x12f838),'enabled':![]};const _0x2b8e39=inspectAppRuleContent(_0x3b6dc2[_0x22476b(0x81)]);return{'type':_0x12f838,'fileName':appRuleFileName(_0x12f838),'contextScope':appRuleContextScope(_0x12f838),'enabled':!![],'id':_0x3b6dc2['id'],'scope':_0x3b6dc2[_0x22476b(0x8e)],'appCode':_0x3b6dc2[_0x22476b(0xaf)],'version':_0x3b6dc2[_0x22476b(0xa7)],'contentByteSize':_0x2b8e39[_0x22476b(0x96)],'contentHash':_0x2b8e39[_0x22476b(0x90)],..._0x3b6dc2[_0x22476b(0x85)]!==undefined&&_0x3b6dc2[_0x22476b(0x85)]!==null?{'createTime':_0x3b6dc2[_0x22476b(0x85)]}:{},..._0x3b6dc2[_0x22476b(0x86)]!==undefined&&_0x3b6dc2[_0x22476b(0x86)]!==null?{'updateTime':_0x3b6dc2[_0x22476b(0x86)]}:{}};}export const APP_RULE_TYPE_FLAG={'name':a217_0x24c578(0xb0),'type':a217_0x24c578(0x93),'required':!![],'description':a217_0x24c578(0x9a),'enum':[...APP_RULE_TYPES]};
@@ -1 +1 @@
1
- const a204_0x350ae7=a204_0x3b74;(function(_0x55f378,_0x319c71){const _0x156d6a=a204_0x3b74,_0x2ad812=_0x55f378();while(!![]){try{const _0x378de1=parseInt(_0x156d6a(0x216))/0x1+parseInt(_0x156d6a(0x1fe))/0x2*(parseInt(_0x156d6a(0x209))/0x3)+-parseInt(_0x156d6a(0x1ec))/0x4*(-parseInt(_0x156d6a(0x1e9))/0x5)+-parseInt(_0x156d6a(0x221))/0x6*(-parseInt(_0x156d6a(0x21d))/0x7)+-parseInt(_0x156d6a(0x202))/0x8+parseInt(_0x156d6a(0x208))/0x9+-parseInt(_0x156d6a(0x20f))/0xa*(parseInt(_0x156d6a(0x206))/0xb);if(_0x378de1===_0x319c71)break;else _0x2ad812['push'](_0x2ad812['shift']());}catch(_0x323386){_0x2ad812['push'](_0x2ad812['shift']());}}}(a204_0x3dd8,0x9b898));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';function a204_0x3b74(_0x2485d6,_0x32f9fe){_0x2485d6=_0x2485d6-0x1e1;const _0x3dd86a=a204_0x3dd8();let _0x3b742f=_0x3dd86a[_0x2485d6];return _0x3b742f;}import{resolve,delimiter,join}from'node:path';function a204_0x3dd8(){const _0x122de0=['No\x20scripts\x20defined\x20in\x20package.json.','No\x20package.json\x20found\x20in\x20current\x20directory.','build','push','12VoQJYn','pnpm-lock.yaml','pnpm','needsUpgrade','9311960gbsGws','validation','.bin','preview','3286063NIeUBu','slice','1095543nwChmG','503445bSOaBl','\x20run\x20start','\x20run\x20build','watch','args','dev','50yYvrcW','Enable\x20watch\x20mode\x20for\x20preview','utf-8','close','parse','start','error','13361knVlJL','Script\x20\x22','bun','bun.lock','\x20run\x20preview','\x22\x20not\x20found\x20in\x20package.json.','changed','8464547ZzAMzl','\x20run\x20preview\x20--watch','\x20run\x20','has','6WRmLGh','bun.lockb','\x20exited\x20with\x20code\x20','join','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','bool','length','run','scripts','4717705LZuBgX','keys','log','4gtalMu','\x20\x20\x20\x20','vite','inherit','all','yarn','yarn.lock','boolean','belowMinimum','\x20run\x20<script>\x0a','cwd','write','path','\x0a\x20\x20Usage:\x20'];a204_0x3dd8=function(){return _0x122de0;};return a204_0x3dd8();}import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{findProjectRootDirectory,resolveConfigPath}from'../../context/config-loader.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.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([a204_0x350ae7(0x214),a204_0x350ae7(0x20e)]),DOMAIN_ROUTING_SYNC_SCRIPTS=new Set([a204_0x350ae7(0x214),'dev',a204_0x350ae7(0x1fc),a204_0x350ae7(0x205)]);export function syncProjectDomainRoutingBeforeScript(_0x1e29ca,_0x1da74b){const _0x352df5=a204_0x350ae7;if(!DOMAIN_ROUTING_SYNC_SCRIPTS['has'](_0x1da74b))return null;const _0x10047a=findProjectRootDirectory(_0x1e29ca);if(!resolveConfigPath(_0x10047a))return null;const _0x16c194=writeProjectDomainRoutingManifest(_0x10047a);return{'path':_0x16c194[_0x352df5(0x1f8)],'changed':_0x16c194[_0x352df5(0x21c)]};}function readPackageScripts(_0x578e5a){const _0x2bdd84=a204_0x350ae7,_0x5180e5=resolve(_0x578e5a,'package.json');if(!existsSync(_0x5180e5))return null;try{const _0x2b1c22=JSON[_0x2bdd84(0x213)](readFileSync(_0x5180e5,_0x2bdd84(0x211)));return _0x2b1c22[_0x2bdd84(0x1e8)]??{};}catch{return null;}}function detectPackageManager(_0x1c2896){const _0x5b854b=a204_0x350ae7;if(existsSync(resolve(_0x1c2896,_0x5b854b(0x1e1)))||existsSync(resolve(_0x1c2896,_0x5b854b(0x219))))return _0x5b854b(0x218);if(existsSync(resolve(_0x1c2896,_0x5b854b(0x1ff))))return _0x5b854b(0x200);if(existsSync(resolve(_0x1c2896,_0x5b854b(0x1f2))))return _0x5b854b(0x1f1);return'npm';}async function versionCheck(_0x3131cf){const _0x13f212=a204_0x350ae7,_0x912eb7=await checkCliVersion();(_0x912eb7[_0x13f212(0x201)]||_0x912eb7[_0x13f212(0x1f4)])&&(printCliUpgradeWarning(_0x912eb7),assertCliVersionSupported(_0x912eb7));const _0x475130=await checkSdkVersion(_0x3131cf);if(_0x475130[_0x13f212(0x201)])printSdkUpgradeWarning(_0x475130);}function spawnScript(_0x4c695e,_0x13ab62,_0x20bb32,_0xa24922){return new Promise((_0x1d6821,_0xaa7cd6)=>{const _0x2d0421=a204_0x3b74,_0x3dbd3d=['run',_0x13ab62,..._0x20bb32],_0x227608=spawn(_0x4c695e,_0x3dbd3d,{'cwd':_0xa24922,'stdio':_0x2d0421(0x1ef),'shell':!![],'env':{...process.env,'PATH':''+join(_0xa24922,'node_modules',_0x2d0421(0x204))+delimiter+process.env.PATH}});_0x227608['on'](_0x2d0421(0x212),_0x40d045=>{const _0x3fd81a=_0x2d0421;if(_0x40d045===0x0||_0x40d045===null)_0x1d6821();else _0xaa7cd6(new Error(_0x4c695e+_0x3fd81a(0x21f)+_0x13ab62+_0x3fd81a(0x1e2)+_0x40d045));}),_0x227608['on'](_0x2d0421(0x215),_0xaa7cd6);});}function spawnViteBuildWatch(_0x44b468){return new Promise((_0x31b7a7,_0x4bc308)=>{const _0x9b1084=a204_0x3b74,_0x2cc6c4=spawn(_0x9b1084(0x1ee),['build','--watch'],{'cwd':_0x44b468,'stdio':_0x9b1084(0x1ef),'shell':!![],'env':{...process.env,'PATH':''+join(_0x44b468,'node_modules',_0x9b1084(0x204))+delimiter+process.env.PATH}});_0x2cc6c4['on'](_0x9b1084(0x212),_0x54da08=>{const _0xc15ad4=_0x9b1084;if(_0x54da08===0x0||_0x54da08===null)_0x31b7a7();else _0x4bc308(new Error(_0xc15ad4(0x1e4)+_0x54da08));}),_0x2cc6c4['on']('error',_0x4bc308);});}function spawnVitePreview(_0x5a95b9){return new Promise((_0x20a19a,_0x22fcad)=>{const _0x1e5eb6=a204_0x3b74,_0x4d6aa0=spawn(_0x1e5eb6(0x1ee),['preview'],{'cwd':_0x5a95b9,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x5a95b9,'node_modules',_0x1e5eb6(0x204))+delimiter+process.env.PATH}});_0x4d6aa0['on']('close',_0x3b781f=>{if(_0x3b781f===0x0||_0x3b781f===null)_0x20a19a();else _0x22fcad(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x3b781f));}),_0x4d6aa0['on']('error',_0x22fcad);});}const runFlags=[{'name':a204_0x350ae7(0x20c),'type':a204_0x350ae7(0x1f3),'description':a204_0x350ae7(0x210),'default':![]}];export const runDefinition={'service':a204_0x350ae7(0x1e7),'command':a204_0x350ae7(0x1e7),'description':'Run\x20a\x20package.json\x20script','risk':a204_0x350ae7(0x1f7),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'script','description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x5b089d=a204_0x350ae7,_0x2915e7=[];return _0x2915e7[_0x5b089d(0x1fd)]('\x20\x20EXAMPLES'),_0x2915e7[_0x5b089d(0x1fd)](_0x5b089d(0x1ed)+CLI_BIN_NAME+_0x5b089d(0x20a)),_0x2915e7['push'](_0x5b089d(0x1ed)+CLI_BIN_NAME+_0x5b089d(0x20b)),_0x2915e7[_0x5b089d(0x1fd)](_0x5b089d(0x1ed)+CLI_BIN_NAME+_0x5b089d(0x21a)),_0x2915e7[_0x5b089d(0x1fd)](_0x5b089d(0x1ed)+CLI_BIN_NAME+_0x5b089d(0x21e)),_0x2915e7[_0x5b089d(0x1e3)]('\x0a');},async 'execute'(_0x2195c9){const _0x5128cb=a204_0x350ae7,_0x5929d4=process[_0x5128cb(0x1f6)](),_0x3fb009=_0x2195c9[_0x5128cb(0x20d)][0x0],_0x5055b9=_0x2195c9[_0x5128cb(0x20d)][_0x5128cb(0x207)](0x1),_0x3eeaca=readPackageScripts(_0x5929d4);if(!_0x3eeaca)throw CliErrors['validation'](_0x5128cb(0x1fb));if(!_0x3fb009){const _0x538db9=Object[_0x5128cb(0x1ea)](_0x3eeaca);if(_0x538db9[_0x5128cb(0x1e6)]===0x0)console['log'](_0x5128cb(0x1fa));else{console['log']('\x0a\x20\x20Available\x20scripts:\x0a');for(const _0x37d324 of _0x538db9){console[_0x5128cb(0x1eb)](_0x5128cb(0x1ed)+_0x37d324);}console['log'](_0x5128cb(0x1f9)+CLI_BIN_NAME+_0x5128cb(0x1f5));}return{'ok':!![]};}if(!_0x3eeaca[_0x3fb009])throw CliErrors[_0x5128cb(0x203)](_0x5128cb(0x217)+_0x3fb009+_0x5128cb(0x21b),'Available:\x20'+(Object['keys'](_0x3eeaca)[_0x5128cb(0x1e3)](',\x20')||'(none)'));const _0x3575b7=detectPackageManager(_0x5929d4),_0x481382=syncProjectDomainRoutingBeforeScript(_0x5929d4,_0x3fb009);_0x481382?.['changed']&&console[_0x5128cb(0x215)]('Domain\x20routing\x20synchronized:\x20'+_0x481382[_0x5128cb(0x1f8)]);VERSION_CHECK_SCRIPTS[_0x5128cb(0x220)](_0x3fb009)&&await versionCheck(_0x5929d4);if(_0x3fb009===_0x5128cb(0x205)&&_0x2195c9[_0x5128cb(0x1e5)]('watch'))return await Promise[_0x5128cb(0x1f0)]([spawnViteBuildWatch(_0x5929d4),spawnVitePreview(_0x5929d4)]),{'ok':!![]};return await spawnScript(_0x3575b7,_0x3fb009,_0x5055b9,_0x5929d4),{'ok':!![]};}};
1
+ const a218_0x1da3df=a218_0x141c;(function(_0x2098c7,_0x16bc15){const _0x2a64bc=a218_0x141c,_0x1babcb=_0x2098c7();while(!![]){try{const _0x47e17d=-parseInt(_0x2a64bc(0x16b))/0x1*(parseInt(_0x2a64bc(0x154))/0x2)+-parseInt(_0x2a64bc(0x16a))/0x3*(-parseInt(_0x2a64bc(0x153))/0x4)+-parseInt(_0x2a64bc(0x146))/0x5+parseInt(_0x2a64bc(0x160))/0x6+parseInt(_0x2a64bc(0x174))/0x7+-parseInt(_0x2a64bc(0x148))/0x8*(parseInt(_0x2a64bc(0x183))/0x9)+parseInt(_0x2a64bc(0x14e))/0xa*(-parseInt(_0x2a64bc(0x163))/0xb);if(_0x47e17d===_0x16bc15)break;else _0x1babcb['push'](_0x1babcb['shift']());}catch(_0x39c519){_0x1babcb['push'](_0x1babcb['shift']());}}}(a218_0xfd9b,0xa15a8));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';function a218_0x141c(_0x17bbd6,_0x5208bf){_0x17bbd6=_0x17bbd6-0x143;const _0xfd9b=a218_0xfd9b();let _0x141c0e=_0xfd9b[_0x17bbd6];return _0x141c0e;}import{findProjectRootDirectory,resolveConfigPath}from'../../context/config-loader.js';function a218_0xfd9b(){const _0x544fd6=['script','1563192rifyOj','keys','pnpm','605GKiLfz','Domain\x20routing\x20synchronized:\x20','args','\x20run\x20preview','\x20exited\x20with\x20code\x20','\x20\x20\x20\x20','Run\x20a\x20package.json\x20script','6zZLFYg','142953zilZGj','bun.lockb','\x20run\x20preview\x20--watch','Enable\x20watch\x20mode\x20for\x20preview','length','all','log','No\x20package.json\x20found\x20in\x20current\x20directory.','vite\x20preview\x20exited\x20with\x20code\x20','7636839YiXmGD','\x20run\x20build','watch','push','validation','join','error','boolean','yarn','.bin','vite','dev','utf-8','preview','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','141651JAoRvC','close','start','\x20run\x20<script>\x0a','bun','\x0a\x20\x20Usage:\x20','7845sGEblH','inherit','40XzQLfh','changed','yarn.lock','path','\x20run\x20','(none)','239800Hkbokq','scripts','npm','Script\x20\x22','slice','2274836dIISqY','6Pjmfpi','bun.lock','parse','run','build','belowMinimum','\x20\x20EXAMPLES','Script\x20name\x20defined\x20in\x20package.json','node_modules','Available:\x20','needsUpgrade'];a218_0xfd9b=function(){return _0x544fd6;};return a218_0xfd9b();}import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.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([a218_0x1da3df(0x185),a218_0x1da3df(0x17f)]),DOMAIN_ROUTING_SYNC_SCRIPTS=new Set([a218_0x1da3df(0x185),a218_0x1da3df(0x17f),a218_0x1da3df(0x158),a218_0x1da3df(0x181)]);export function syncProjectDomainRoutingBeforeScript(_0x4901fb,_0x3dab1c){const _0x2c1e1d=a218_0x1da3df;if(!DOMAIN_ROUTING_SYNC_SCRIPTS['has'](_0x3dab1c))return null;const _0x55d1c6=findProjectRootDirectory(_0x4901fb);if(!resolveConfigPath(_0x55d1c6))return null;const _0xdbac69=writeProjectDomainRoutingManifest(_0x55d1c6);return{'path':_0xdbac69[_0x2c1e1d(0x14b)],'changed':_0xdbac69[_0x2c1e1d(0x149)]};}function readPackageScripts(_0xcf4d49){const _0x5a8929=a218_0x1da3df,_0x11ec23=resolve(_0xcf4d49,'package.json');if(!existsSync(_0x11ec23))return null;try{const _0x2cbe33=JSON[_0x5a8929(0x156)](readFileSync(_0x11ec23,_0x5a8929(0x180)));return _0x2cbe33[_0x5a8929(0x14f)]??{};}catch{return null;}}function detectPackageManager(_0x35f39f){const _0x5d0d40=a218_0x1da3df;if(existsSync(resolve(_0x35f39f,_0x5d0d40(0x16c)))||existsSync(resolve(_0x35f39f,_0x5d0d40(0x155))))return _0x5d0d40(0x144);if(existsSync(resolve(_0x35f39f,'pnpm-lock.yaml')))return _0x5d0d40(0x162);if(existsSync(resolve(_0x35f39f,_0x5d0d40(0x14a))))return _0x5d0d40(0x17c);return _0x5d0d40(0x150);}async function versionCheck(_0x18d2b2){const _0x1fc832=a218_0x1da3df,_0x2945ca=await checkCliVersion();(_0x2945ca['needsUpgrade']||_0x2945ca[_0x1fc832(0x159)])&&(printCliUpgradeWarning(_0x2945ca),assertCliVersionSupported(_0x2945ca));const _0x1052fa=await checkSdkVersion(_0x18d2b2);if(_0x1052fa[_0x1fc832(0x15e)])printSdkUpgradeWarning(_0x1052fa);}function spawnScript(_0x4f447c,_0x3a6b50,_0x189670,_0x360d3c){return new Promise((_0xe5762b,_0x33ff36)=>{const _0x1170a6=a218_0x141c,_0x32c0ea=['run',_0x3a6b50,..._0x189670],_0x59dbe0=spawn(_0x4f447c,_0x32c0ea,{'cwd':_0x360d3c,'stdio':_0x1170a6(0x147),'shell':!![],'env':{...process.env,'PATH':''+join(_0x360d3c,_0x1170a6(0x15c),_0x1170a6(0x17d))+delimiter+process.env.PATH}});_0x59dbe0['on'](_0x1170a6(0x184),_0x5a6b01=>{const _0x3ac994=_0x1170a6;if(_0x5a6b01===0x0||_0x5a6b01===null)_0xe5762b();else _0x33ff36(new Error(_0x4f447c+_0x3ac994(0x14c)+_0x3a6b50+_0x3ac994(0x167)+_0x5a6b01));}),_0x59dbe0['on'](_0x1170a6(0x17a),_0x33ff36);});}function spawnViteBuildWatch(_0x4e93b0){return new Promise((_0x4c8ebd,_0x2d334e)=>{const _0x41fc28=a218_0x141c,_0x44feec=spawn('vite',['build','--watch'],{'cwd':_0x4e93b0,'stdio':_0x41fc28(0x147),'shell':!![],'env':{...process.env,'PATH':''+join(_0x4e93b0,_0x41fc28(0x15c),_0x41fc28(0x17d))+delimiter+process.env.PATH}});_0x44feec['on'](_0x41fc28(0x184),_0x217a97=>{const _0x4aa1f1=_0x41fc28;if(_0x217a97===0x0||_0x217a97===null)_0x4c8ebd();else _0x2d334e(new Error(_0x4aa1f1(0x182)+_0x217a97));}),_0x44feec['on']('error',_0x2d334e);});}function spawnVitePreview(_0x2487d2){return new Promise((_0x26cfe8,_0x556d9c)=>{const _0x3beb25=a218_0x141c,_0x42fe40=spawn(_0x3beb25(0x17e),[_0x3beb25(0x181)],{'cwd':_0x2487d2,'stdio':_0x3beb25(0x147),'shell':!![],'env':{...process.env,'PATH':''+join(_0x2487d2,'node_modules',_0x3beb25(0x17d))+delimiter+process.env.PATH}});_0x42fe40['on']('close',_0x48d40b=>{const _0x4b73ef=_0x3beb25;if(_0x48d40b===0x0||_0x48d40b===null)_0x26cfe8();else _0x556d9c(new Error(_0x4b73ef(0x173)+_0x48d40b));}),_0x42fe40['on'](_0x3beb25(0x17a),_0x556d9c);});}const runFlags=[{'name':a218_0x1da3df(0x176),'type':a218_0x1da3df(0x17b),'description':a218_0x1da3df(0x16e),'default':![]}];export const runDefinition={'service':a218_0x1da3df(0x157),'command':a218_0x1da3df(0x157),'description':a218_0x1da3df(0x169),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a218_0x1da3df(0x15f),'description':a218_0x1da3df(0x15b),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x5ee98e=a218_0x1da3df,_0x111776=[];return _0x111776['push'](_0x5ee98e(0x15a)),_0x111776[_0x5ee98e(0x177)](_0x5ee98e(0x168)+CLI_BIN_NAME+'\x20run\x20start'),_0x111776['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x5ee98e(0x175)),_0x111776[_0x5ee98e(0x177)](_0x5ee98e(0x168)+CLI_BIN_NAME+_0x5ee98e(0x166)),_0x111776[_0x5ee98e(0x177)](_0x5ee98e(0x168)+CLI_BIN_NAME+_0x5ee98e(0x16d)),_0x111776[_0x5ee98e(0x179)]('\x0a');},async 'execute'(_0x5f1c08){const _0x5a37fb=a218_0x1da3df,_0x2d80d1=process['cwd'](),_0x284833=_0x5f1c08[_0x5a37fb(0x165)][0x0],_0x539ef1=_0x5f1c08[_0x5a37fb(0x165)][_0x5a37fb(0x152)](0x1),_0x167687=readPackageScripts(_0x2d80d1);if(!_0x167687)throw CliErrors[_0x5a37fb(0x178)](_0x5a37fb(0x172));if(!_0x284833){const _0x56c06f=Object['keys'](_0x167687);if(_0x56c06f[_0x5a37fb(0x16f)]===0x0)console['log']('No\x20scripts\x20defined\x20in\x20package.json.');else{console['log']('\x0a\x20\x20Available\x20scripts:\x0a');for(const _0x403923 of _0x56c06f){console[_0x5a37fb(0x171)]('\x20\x20\x20\x20'+_0x403923);}console[_0x5a37fb(0x171)](_0x5a37fb(0x145)+CLI_BIN_NAME+_0x5a37fb(0x143));}return{'ok':!![]};}if(!_0x167687[_0x284833])throw CliErrors[_0x5a37fb(0x178)](_0x5a37fb(0x151)+_0x284833+'\x22\x20not\x20found\x20in\x20package.json.',_0x5a37fb(0x15d)+(Object[_0x5a37fb(0x161)](_0x167687)['join'](',\x20')||_0x5a37fb(0x14d)));const _0x5764fe=detectPackageManager(_0x2d80d1),_0x51f57e=syncProjectDomainRoutingBeforeScript(_0x2d80d1,_0x284833);_0x51f57e?.[_0x5a37fb(0x149)]&&console['error'](_0x5a37fb(0x164)+_0x51f57e[_0x5a37fb(0x14b)]);VERSION_CHECK_SCRIPTS['has'](_0x284833)&&await versionCheck(_0x2d80d1);if(_0x284833===_0x5a37fb(0x181)&&_0x5f1c08['bool'](_0x5a37fb(0x176)))return await Promise[_0x5a37fb(0x170)]([spawnViteBuildWatch(_0x2d80d1),spawnVitePreview(_0x2d80d1)]),{'ok':!![]};return await spawnScript(_0x5764fe,_0x284833,_0x539ef1,_0x2d80d1),{'ok':!![]};}};
@@ -1 +1 @@
1
- const a205_0x5cce1c=a205_0x2e98;(function(_0x3f990b,_0x1708d8){const _0x58595e=a205_0x2e98,_0x46f729=_0x3f990b();while(!![]){try{const _0x5e0434=-parseInt(_0x58595e(0x187))/0x1*(-parseInt(_0x58595e(0x18a))/0x2)+parseInt(_0x58595e(0x18e))/0x3+parseInt(_0x58595e(0x18c))/0x4+parseInt(_0x58595e(0x185))/0x5+parseInt(_0x58595e(0x186))/0x6*(-parseInt(_0x58595e(0x18d))/0x7)+parseInt(_0x58595e(0x190))/0x8+parseInt(_0x58595e(0x184))/0x9*(-parseInt(_0x58595e(0x183))/0xa);if(_0x5e0434===_0x1708d8)break;else _0x46f729['push'](_0x46f729['shift']());}catch(_0x18ffa2){_0x46f729['push'](_0x46f729['shift']());}}}(a205_0x509f,0x87573));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0xc6f198){const _0x3828b6=await buildSchemaPayload();return{'ok':!![],'data':_0x3828b6};}function a205_0x2e98(_0x2322f8,_0x523387){_0x2322f8=_0x2322f8-0x183;const _0x509f9a=a205_0x509f();let _0x2e98a8=_0x509f9a[_0x2322f8];return _0x2e98a8;}function a205_0x509f(){const _0x4d2e85=['1672458DEyhSH','Export\x20machine-readable\x20command\x20schema\x20(JSON)','1177120LuaQgW','88340VKOFdQ','2806071QTTIoz','read','7958896GAwXsJ','83170PibBRt','2799eurDPy','5449070cIzVOg','480YCAmrw','1XzZWmX','json','schema'];a205_0x509f=function(){return _0x4d2e85;};return a205_0x509f();}export const schemaDefinition={'service':a205_0x5cce1c(0x189),'command':'export','description':a205_0x5cce1c(0x18b),'risk':a205_0x5cce1c(0x18f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a205_0x5cce1c(0x188),'flags':[],'execute':execute};
1
+ function a219_0x3726(_0x252087,_0x2b6114){_0x252087=_0x252087-0xb6;const _0x4c2490=a219_0x4c24();let _0x3726dd=_0x4c2490[_0x252087];return _0x3726dd;}const a219_0x187373=a219_0x3726;function a219_0x4c24(){const _0x405f8b=['2948526voNPvG','40732CYHePo','json','1641222zhUmgd','5342838NhAJNN','1893214sKuqVl','Export\x20machine-readable\x20command\x20schema\x20(JSON)','808ANMqBO','1MkNbsN','export','schema','read','18710070SYLPyc','31423kYMHLl','11lcONbZ','110sLLxWp'];a219_0x4c24=function(){return _0x405f8b;};return a219_0x4c24();}(function(_0x30d275,_0x2b0156){const _0x2f8dc7=a219_0x3726,_0x540bfb=_0x30d275();while(!![]){try{const _0x54a389=-parseInt(_0x2f8dc7(0xc2))/0x1*(parseInt(_0x2f8dc7(0xbf))/0x2)+-parseInt(_0x2f8dc7(0xbd))/0x3+parseInt(_0x2f8dc7(0xbb))/0x4*(parseInt(_0x2f8dc7(0xb9))/0x5)+-parseInt(_0x2f8dc7(0xbe))/0x6+parseInt(_0x2f8dc7(0xb7))/0x7*(parseInt(_0x2f8dc7(0xc1))/0x8)+parseInt(_0x2f8dc7(0xba))/0x9+parseInt(_0x2f8dc7(0xb6))/0xa*(parseInt(_0x2f8dc7(0xb8))/0xb);if(_0x54a389===_0x2b0156)break;else _0x540bfb['push'](_0x540bfb['shift']());}catch(_0x3c1833){_0x540bfb['push'](_0x540bfb['shift']());}}}(a219_0x4c24,0x7816a));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x12c19d){const _0x5cac70=await buildSchemaPayload();return{'ok':!![],'data':_0x5cac70};}export const schemaDefinition={'service':a219_0x187373(0xc4),'command':a219_0x187373(0xc3),'description':a219_0x187373(0xc0),'risk':a219_0x187373(0xc5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a219_0x187373(0xbc),'flags':[],'execute':execute};
@@ -1 +1 @@
1
- const a206_0x101467=a206_0x1cb3;(function(_0xd12e8c,_0x5939f0){const _0x3b8db7=a206_0x1cb3,_0x2c1c63=_0xd12e8c();while(!![]){try{const _0x77e8b9=-parseInt(_0x3b8db7(0xf0))/0x1*(-parseInt(_0x3b8db7(0xec))/0x2)+-parseInt(_0x3b8db7(0x115))/0x3*(-parseInt(_0x3b8db7(0x10e))/0x4)+parseInt(_0x3b8db7(0x11c))/0x5*(parseInt(_0x3b8db7(0x12a))/0x6)+-parseInt(_0x3b8db7(0x119))/0x7*(parseInt(_0x3b8db7(0x10d))/0x8)+-parseInt(_0x3b8db7(0x117))/0x9*(parseInt(_0x3b8db7(0x12b))/0xa)+-parseInt(_0x3b8db7(0xf8))/0xb+parseInt(_0x3b8db7(0x122))/0xc*(parseInt(_0x3b8db7(0x116))/0xd);if(_0x77e8b9===_0x5939f0)break;else _0x2c1c63['push'](_0x2c1c63['shift']());}catch(_0x162adc){_0x2c1c63['push'](_0x2c1c63['shift']());}}}(a206_0x71d5,0xda73f));import{writeFile}from'node:fs/promises';function a206_0x1cb3(_0x2edacc,_0x2aec67){_0x2edacc=_0x2edacc-0xe8;const _0x71d598=a206_0x71d5();let _0x1cb344=_0x71d598[_0x2edacc];return _0x1cb344;}import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';function a206_0x71d5(){const _0x6019f4=['Select\x20the\x20target\x20database:','sqlRoot','mybatisXml','1317WRtUcs','13385047pwekQq','720RaNdLS','catch','166607Wkdtfx','length','flagMissing','80atYzHN','sqlName','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','sqlRootDir','isFinite','name','12xUvMiq','Plain\x20SQL\x20(sql)','SELECT\x201\x20AS\x20id;','POST','nonInteractive','db-id','SQL\x20name\x20cannot\x20be\x20empty','join','594840iMWMmE','159170xxNdfY','mode','Select\x20the\x20local\x20SQL\x20mode:','SQL\x20query\x20display\x20name','lockFilePath','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly','flag','39306iwvoft','trim','string','str','5WkSpzq','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','/smartapi/custom/saveUserCustomSql','new','✎\x20Enter\x20dbId\x20manually','</select>','dbName','appCode','7863339sgDzOj','isInteger','lastSync','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','utf8','Target\x20database\x20ID','Local\x20SQL\x20file\x20mode','__manual__','Invalid\x20database\x20selection\x20payload:\x20','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','stringify','dbId','\x20\x20SELECT\x201\x20AS\x20id','SQL\x20name:','sqlCode','toISOString','sql','write','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','create','parse','456TQJYtw','13900ypFjpD','dbId\x20must\x20be\x20a\x20positive\x20integer','MyBatis\x20XML\x20(mybatisXml)','number'];a206_0x71d5=function(){return _0x6019f4;};return a206_0x71d5();}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(_0x38aa85){const _0x46a1c2=a206_0x1cb3;if(_0x38aa85===_0x46a1c2(0x114))return['<select\x20id=\x22query\x22\x20resultType=\x22map\x22>',_0x46a1c2(0x104),_0x46a1c2(0xf5),''][_0x46a1c2(0x129)]('\x0a');return[_0x46a1c2(0x124),''][_0x46a1c2(0x129)]('\x0a');}export const sqlCreate={'service':a206_0x101467(0x108),'command':a206_0x101467(0x10b),'description':a206_0x101467(0x101),'risk':a206_0x101467(0x109),'flags':[{'name':a206_0x101467(0x121),'type':a206_0x101467(0xee),'description':a206_0x101467(0x12e)},{'name':a206_0x101467(0x127),'type':'number','description':a206_0x101467(0xfd)},{'name':a206_0x101467(0x12c),'type':'string','enum':[a206_0x101467(0x108),a206_0x101467(0x114)],'description':a206_0x101467(0xfe)}],async 'validate'(_0xccedca){const _0x304a0a=a206_0x101467;if(!_0xccedca['nonInteractive'])return;if(!_0xccedca['str']('name')['trim']())throw CliErrors['flagMissing'](_0x304a0a(0x121),_0x304a0a(0xe9));const _0x4446cd=resolveProvidedDbId(_0xccedca);if(typeof _0x4446cd!==_0x304a0a(0x111)||!Number[_0x304a0a(0x120)](_0x4446cd)||_0x4446cd<=0x0)throw CliErrors[_0x304a0a(0x11b)](_0x304a0a(0x127),_0x304a0a(0x11e));if(!_0xccedca['str']('mode')['trim']())throw CliErrors[_0x304a0a(0x11b)](_0x304a0a(0x12c),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0x418813){const _0x233466=a206_0x101467,_0x5be692=loadSqlProjectConfig(_0x418813['appCode']),{sqlName:_0x2b9cf7,dbId:_0x562540,dbName:_0x26cb02,mode:_0x76cd25}=await resolveSqlNewInputs(_0x418813),_0x192a0c=buildSqlRelativePath('<server-generated-sqlCode>',_0x2b9cf7,_0x26cb02,_0x76cd25,_0x562540),_0x67dbcc=_0x5be692[_0x233466(0x11f)]+'/'+_0x192a0c;return{'method':_0x233466(0x125),'url':_0x233466(0xf2),'body':{'appCode':_0x418813[_0x233466(0xf7)],'sqlName':_0x2b9cf7,'dbId':_0x562540,'mode':_0x76cd25,'localPath':_0x67dbcc},'description':_0x233466(0xfb)+_0x5be692[_0x233466(0x11f)]};},async 'execute'(_0x379a8c){const _0xa60e21=a206_0x101467,_0x5a5da2=loadSqlProjectConfig(_0x379a8c[_0xa60e21(0xf7)]),{sqlName:_0x249418,dbId:_0x38f4d1,dbName:_0x3b5037,mode:_0x4dd1a8}=await resolveSqlNewInputs(_0x379a8c),_0x1c5506=generateSqlTemplate(_0x4dd1a8),_0x38590c=await createSqlQuery({'appCode':_0x379a8c['appCode'],'sqlName':_0x249418,'dbId':_0x38f4d1,'sqlContent':_0x1c5506}),_0x5efb9e=ensureRemoteSqlContent(_0x38590c),_0x2a1212=_0x3b5037||await getDbName(_0x379a8c['appCode'],_0x38f4d1)[_0xa60e21(0x118)](()=>undefined),_0x5c5f45=buildSqlRelativePath(_0x38590c[_0xa60e21(0x106)],_0x38590c[_0xa60e21(0x11d)],_0x2a1212,_0x4dd1a8,_0x38f4d1),_0x562088=_0x5a5da2[_0xa60e21(0x11f)]+'/'+_0x5c5f45,_0x39a475=buildLocalSqlFileContent({'sqlCode':_0x38590c[_0xa60e21(0x106)],'sqlName':_0x38590c[_0xa60e21(0x11d)],'dbId':_0x38590c[_0xa60e21(0x103)]},_0x5efb9e,{'dbName':_0x2a1212,'mode':_0x4dd1a8,'syncedAt':new Date()[_0xa60e21(0x107)](),'description':_0x38590c['description']});if(await fileExists(_0x562088))throw CliErrors['validation']('File\x20already\x20exists:\x20'+_0x562088);await ensureParentDirectory(_0x562088),await writeFile(_0x562088,_0x39a475,_0xa60e21(0xfc));const _0x133a78=await readSqlLockFile(_0x5a5da2['lockFilePath']),{lockData:_0x1049b2,appLock:_0x1fddcd}=ensureSqlLockScope(_0x133a78??createEmptySqlLock(),_0x5a5da2['appCode'],_0x5a5da2[_0xa60e21(0x113)],_0xa60e21(0xf3));return _0x1fddcd['sqls'][_0x38590c[_0xa60e21(0x106)]]={...buildSqlLockEntry(_0x38590c,_0x5efb9e,computeSqlContentHash(_0x39a475),{'dbName':_0x2a1212}),'path':_0x5c5f45,'mode':_0x4dd1a8},_0x1fddcd[_0xa60e21(0xfa)]=new Date()[_0xa60e21(0x107)](),await writeSqlLockFile(_0x5a5da2[_0xa60e21(0xe8)],_0x1049b2),{'ok':!![],'data':{'id':_0x38590c['id'],'sqlCode':_0x38590c[_0xa60e21(0x106)],'sqlName':_0x38590c[_0xa60e21(0x11d)],'dbId':_0x38590c[_0xa60e21(0x103)],'path':_0x562088,'mode':_0x4dd1a8},'message':'Created\x20SQL\x20query\x20'+_0x38590c[_0xa60e21(0x106)]};}};async function resolveSqlNewInputs(_0x1fba90){const _0x446c64=await resolveSqlNameInput(_0x1fba90),{dbId:_0x5872d4,dbName:_0x373e79}=await resolveDbSelection(_0x1fba90),_0x169c5f=await resolveSqlModeInput(_0x1fba90);return{'sqlName':_0x446c64,'dbId':_0x5872d4,'dbName':_0x373e79,'mode':_0x169c5f};}async function resolveSqlNameInput(_0x5d794c){const _0xb6c7db=a206_0x101467,_0x34e298=_0x5d794c[_0xb6c7db(0xef)]('name')['trim']();if(_0x34e298)return _0x34e298;if(_0x5d794c[_0xb6c7db(0x126)])throw CliErrors['flagMissing'](_0xb6c7db(0x121),_0xb6c7db(0xe9));return(await input({'message':_0xb6c7db(0x105),'validate':_0x2c3b89=>_0x2c3b89[_0xb6c7db(0xed)]()?!![]:_0xb6c7db(0x128)}))[_0xb6c7db(0xed)]();}async function resolveDbSelection(_0xd01abe){const _0x24d7a6=a206_0x101467,_0x436143=resolveProvidedDbId(_0xd01abe);if(typeof _0x436143==='number'&&Number['isFinite'](_0x436143)&&_0x436143>0x0)return{'dbId':_0x436143,'dbName':await getDbName(_0xd01abe[_0x24d7a6(0xf7)],_0x436143)[_0x24d7a6(0x118)](()=>undefined)};if(_0xd01abe[_0x24d7a6(0x126)])throw CliErrors['flagMissing'](_0x24d7a6(0x127),_0x24d7a6(0x11e));const _0x2dabe0=await listDatabases(_0xd01abe[_0x24d7a6(0xf7)])[_0x24d7a6(0x118)](()=>[]);if(_0x2dabe0['length']===0x1)return{'dbId':_0x2dabe0[0x0]['dbId'],'dbName':_0x2dabe0[0x0][_0x24d7a6(0xf6)]};if(_0x2dabe0[_0x24d7a6(0x11a)]>0x1){const _0x174386=await select({'message':_0x24d7a6(0x112),'choices':[..._0x2dabe0['map'](_0x1a27ff=>({'name':_0x1a27ff['dbName']+'\x20('+_0x1a27ff[_0x24d7a6(0x103)]+')','value':serializeDbSelection(_0x1a27ff)})),{'name':_0x24d7a6(0xf4),'value':_0x24d7a6(0xff)}]});if(_0x174386!==_0x24d7a6(0xff))return deserializeDbSelection(_0x174386);}const _0x1845ac=await input({'message':'Target\x20database\x20dbId:','validate':_0x553f54=>{const _0x2a57b8=_0x24d7a6,_0x3678a9=_0x553f54[_0x2a57b8(0xed)]();if(!_0x3678a9)return'dbId\x20cannot\x20be\x20empty';const _0x4f1d50=Number(_0x3678a9);if(!Number[_0x2a57b8(0xf9)](_0x4f1d50)||_0x4f1d50<=0x0)return _0x2a57b8(0x10f);return!![];}});return{'dbId':Number(_0x1845ac[_0x24d7a6(0xed)]())};}async function resolveSqlModeInput(_0x17e598){const _0x391c57=a206_0x101467,_0x168576=_0x17e598[_0x391c57(0xef)](_0x391c57(0x12c))[_0x391c57(0xed)]();if(_0x168576==='sql'||_0x168576==='mybatisXml')return _0x168576;if(_0x17e598['nonInteractive'])throw CliErrors[_0x391c57(0x11b)]('mode',_0x391c57(0xf1));return await select({'message':_0x391c57(0x12d),'choices':[{'name':_0x391c57(0x123),'value':_0x391c57(0x108),'description':_0x391c57(0xea)},{'name':_0x391c57(0x110),'value':_0x391c57(0x114),'description':_0x391c57(0x10a)}]});}function serializeDbSelection(_0x5d3f6a){const _0x2ebc82=a206_0x101467;return JSON[_0x2ebc82(0x102)]({'dbId':_0x5d3f6a[_0x2ebc82(0x103)],'dbName':_0x5d3f6a['dbName']});}function deserializeDbSelection(_0x2cadec){const _0x5d3d94=a206_0x101467;try{const _0x5440f6=JSON[_0x5d3d94(0x10c)](_0x2cadec);if(typeof _0x5440f6[_0x5d3d94(0x103)]===_0x5d3d94(0x111)&&Number[_0x5d3d94(0x120)](_0x5440f6[_0x5d3d94(0x103)]))return{'dbId':_0x5440f6[_0x5d3d94(0x103)],'dbName':_0x5440f6[_0x5d3d94(0xf6)]};}catch{}throw CliErrors['validation'](_0x5d3d94(0x100)+_0x2cadec);}function resolveProvidedDbId(_0xaa849f){const _0x2d4896=a206_0x101467,_0x20ac0e=_0xaa849f[_0x2d4896(0xeb)]('db-id');if(typeof _0x20ac0e===_0x2d4896(0x111)&&Number[_0x2d4896(0x120)](_0x20ac0e))return _0x20ac0e;return undefined;}
1
+ const a220_0x30b2ad=a220_0x33c6;(function(_0x3b482f,_0xa0fc3f){const _0x31d2af=a220_0x33c6,_0x6a9f0=_0x3b482f();while(!![]){try{const _0x438073=parseInt(_0x31d2af(0x141))/0x1+parseInt(_0x31d2af(0x169))/0x2+parseInt(_0x31d2af(0x14c))/0x3+parseInt(_0x31d2af(0x151))/0x4+parseInt(_0x31d2af(0x165))/0x5+parseInt(_0x31d2af(0x138))/0x6+-parseInt(_0x31d2af(0x15f))/0x7*(parseInt(_0x31d2af(0x149))/0x8);if(_0x438073===_0xa0fc3f)break;else _0x6a9f0['push'](_0x6a9f0['shift']());}catch(_0x21deb6){_0x6a9f0['push'](_0x6a9f0['shift']());}}}(a220_0x16c4,0x9c0a3));import{writeFile}from'node:fs/promises';function a220_0x33c6(_0x56413c,_0x1006c0){_0x56413c=_0x56413c-0x134;const _0x16c4cd=a220_0x16c4();let _0x33c6ac=_0x16c4cd[_0x56413c];return _0x33c6ac;}function a220_0x16c4(){const _0x2dc9e5=['Select\x20the\x20target\x20database:','str','validation','16340200RhOVqG','Target\x20database\x20ID','__manual__','2024913tqsrEt','<server-generated-sqlCode>','dbId\x20must\x20be\x20a\x20positive\x20integer','join','create','2406752xAZqqH','Invalid\x20database\x20selection\x20payload:\x20','Created\x20SQL\x20query\x20','Select\x20the\x20local\x20SQL\x20mode:','mode','sqlRoot','sqls','sqlName','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','isInteger','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','length','flagMissing','nonInteractive','7UuvvWr','db-id','sql','Plain\x20SQL\x20(sql)','SQL\x20name\x20cannot\x20be\x20empty','MyBatis\x20XML\x20(mybatisXml)','4630195oEgXcn','dbName','catch','/smartapi/custom/saveUserCustomSql','206832WERFSx','sqlRootDir','lastSync','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','sqlCode','dbId\x20cannot\x20be\x20empty','toISOString','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','name','number','mybatisXml','isFinite','1335510zxtWSh','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','trim','stringify','✎\x20Enter\x20dbId\x20manually','\x20\x20SELECT\x201\x20AS\x20id','appCode','dbId','new','152965lLqrRk','Target\x20database\x20dbId:','string','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','File\x20already\x20exists:\x20'];a220_0x16c4=function(){return _0x2dc9e5;};return a220_0x16c4();}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(_0x223f23){const _0x2e5a0c=a220_0x33c6;if(_0x223f23===_0x2e5a0c(0x136))return[_0x2e5a0c(0x159),_0x2e5a0c(0x13d),'</select>',''][_0x2e5a0c(0x14f)]('\x0a');return['SELECT\x201\x20AS\x20id;',''][_0x2e5a0c(0x14f)]('\x0a');}export const sqlCreate={'service':a220_0x30b2ad(0x161),'command':a220_0x30b2ad(0x150),'description':a220_0x30b2ad(0x16c),'risk':'write','flags':[{'name':a220_0x30b2ad(0x134),'type':a220_0x30b2ad(0x143),'description':'SQL\x20query\x20display\x20name'},{'name':a220_0x30b2ad(0x160),'type':a220_0x30b2ad(0x135),'description':a220_0x30b2ad(0x14a)},{'name':'mode','type':a220_0x30b2ad(0x143),'enum':['sql',a220_0x30b2ad(0x136)],'description':'Local\x20SQL\x20file\x20mode'}],async 'validate'(_0x5b617a){const _0x3aea28=a220_0x30b2ad;if(!_0x5b617a[_0x3aea28(0x15e)])return;if(!_0x5b617a['str'](_0x3aea28(0x134))[_0x3aea28(0x13a)]())throw CliErrors[_0x3aea28(0x15d)](_0x3aea28(0x134),_0x3aea28(0x144));const _0x5f4416=resolveProvidedDbId(_0x5b617a);if(typeof _0x5f4416!=='number'||!Number[_0x3aea28(0x137)](_0x5f4416)||_0x5f4416<=0x0)throw CliErrors['flagMissing'](_0x3aea28(0x160),_0x3aea28(0x139));if(!_0x5b617a[_0x3aea28(0x147)](_0x3aea28(0x155))[_0x3aea28(0x13a)]())throw CliErrors['flagMissing'](_0x3aea28(0x155),_0x3aea28(0x15b));},async 'dryRun'(_0x4ed3ab){const _0x4bcee3=a220_0x30b2ad,_0x5000d9=loadSqlProjectConfig(_0x4ed3ab['appCode']),{sqlName:_0x8f82d3,dbId:_0x5e9fbd,dbName:_0x16f40f,mode:_0x162dde}=await resolveSqlNewInputs(_0x4ed3ab),_0x27eb63=buildSqlRelativePath(_0x4bcee3(0x14d),_0x8f82d3,_0x16f40f,_0x162dde,_0x5e9fbd),_0x4fca6e=_0x5000d9[_0x4bcee3(0x16a)]+'/'+_0x27eb63;return{'method':'POST','url':_0x4bcee3(0x168),'body':{'appCode':_0x4ed3ab[_0x4bcee3(0x13e)],'sqlName':_0x8f82d3,'dbId':_0x5e9fbd,'mode':_0x162dde,'localPath':_0x4fca6e},'description':_0x4bcee3(0x170)+_0x5000d9['sqlRootDir']};},async 'execute'(_0x876b21){const _0x33dfd1=a220_0x30b2ad,_0x5c5179=loadSqlProjectConfig(_0x876b21[_0x33dfd1(0x13e)]),{sqlName:_0x23dd4b,dbId:_0x509c9b,dbName:_0x4b281c,mode:_0x4242de}=await resolveSqlNewInputs(_0x876b21),_0x4fac62=generateSqlTemplate(_0x4242de),_0x25966d=await createSqlQuery({'appCode':_0x876b21[_0x33dfd1(0x13e)],'sqlName':_0x23dd4b,'dbId':_0x509c9b,'sqlContent':_0x4fac62}),_0x1d0a1a=ensureRemoteSqlContent(_0x25966d),_0x37886e=_0x4b281c||await getDbName(_0x876b21[_0x33dfd1(0x13e)],_0x509c9b)['catch'](()=>undefined),_0x5f4876=buildSqlRelativePath(_0x25966d['sqlCode'],_0x25966d[_0x33dfd1(0x158)],_0x37886e,_0x4242de,_0x509c9b),_0x1b8dda=_0x5c5179[_0x33dfd1(0x16a)]+'/'+_0x5f4876,_0x53f6f8=buildLocalSqlFileContent({'sqlCode':_0x25966d[_0x33dfd1(0x16d)],'sqlName':_0x25966d[_0x33dfd1(0x158)],'dbId':_0x25966d[_0x33dfd1(0x13f)]},_0x1d0a1a,{'dbName':_0x37886e,'mode':_0x4242de,'syncedAt':new Date()['toISOString'](),'description':_0x25966d['description']});if(await fileExists(_0x1b8dda))throw CliErrors[_0x33dfd1(0x148)](_0x33dfd1(0x145)+_0x1b8dda);await ensureParentDirectory(_0x1b8dda),await writeFile(_0x1b8dda,_0x53f6f8,'utf8');const _0x24bc0=await readSqlLockFile(_0x5c5179['lockFilePath']),{lockData:_0x1c94f,appLock:_0x1c6f12}=ensureSqlLockScope(_0x24bc0??createEmptySqlLock(),_0x5c5179[_0x33dfd1(0x13e)],_0x5c5179[_0x33dfd1(0x156)],_0x33dfd1(0x140));return _0x1c6f12[_0x33dfd1(0x157)][_0x25966d[_0x33dfd1(0x16d)]]={...buildSqlLockEntry(_0x25966d,_0x1d0a1a,computeSqlContentHash(_0x53f6f8),{'dbName':_0x37886e}),'path':_0x5f4876,'mode':_0x4242de},_0x1c6f12[_0x33dfd1(0x16b)]=new Date()[_0x33dfd1(0x16f)](),await writeSqlLockFile(_0x5c5179['lockFilePath'],_0x1c94f),{'ok':!![],'data':{'id':_0x25966d['id'],'sqlCode':_0x25966d[_0x33dfd1(0x16d)],'sqlName':_0x25966d[_0x33dfd1(0x158)],'dbId':_0x25966d[_0x33dfd1(0x13f)],'path':_0x1b8dda,'mode':_0x4242de},'message':_0x33dfd1(0x153)+_0x25966d[_0x33dfd1(0x16d)]};}};async function resolveSqlNewInputs(_0x5afe18){const _0x3b47e1=await resolveSqlNameInput(_0x5afe18),{dbId:_0xa7b45a,dbName:_0x13d8fe}=await resolveDbSelection(_0x5afe18),_0x23e375=await resolveSqlModeInput(_0x5afe18);return{'sqlName':_0x3b47e1,'dbId':_0xa7b45a,'dbName':_0x13d8fe,'mode':_0x23e375};}async function resolveSqlNameInput(_0x1d8e16){const _0x3d67b3=a220_0x30b2ad,_0x33928e=_0x1d8e16[_0x3d67b3(0x147)](_0x3d67b3(0x134))[_0x3d67b3(0x13a)]();if(_0x33928e)return _0x33928e;if(_0x1d8e16[_0x3d67b3(0x15e)])throw CliErrors[_0x3d67b3(0x15d)](_0x3d67b3(0x134),_0x3d67b3(0x144));return(await input({'message':'SQL\x20name:','validate':_0x7f3531=>_0x7f3531[_0x3d67b3(0x13a)]()?!![]:_0x3d67b3(0x163)}))[_0x3d67b3(0x13a)]();}async function resolveDbSelection(_0x34b6b6){const _0x2cd737=a220_0x30b2ad,_0x5122a6=resolveProvidedDbId(_0x34b6b6);if(typeof _0x5122a6===_0x2cd737(0x135)&&Number['isFinite'](_0x5122a6)&&_0x5122a6>0x0)return{'dbId':_0x5122a6,'dbName':await getDbName(_0x34b6b6[_0x2cd737(0x13e)],_0x5122a6)[_0x2cd737(0x167)](()=>undefined)};if(_0x34b6b6[_0x2cd737(0x15e)])throw CliErrors[_0x2cd737(0x15d)]('db-id',_0x2cd737(0x139));const _0x5891ea=await listDatabases(_0x34b6b6[_0x2cd737(0x13e)])[_0x2cd737(0x167)](()=>[]);if(_0x5891ea[_0x2cd737(0x15c)]===0x1)return{'dbId':_0x5891ea[0x0][_0x2cd737(0x13f)],'dbName':_0x5891ea[0x0]['dbName']};if(_0x5891ea[_0x2cd737(0x15c)]>0x1){const _0x565009=await select({'message':_0x2cd737(0x146),'choices':[..._0x5891ea['map'](_0x35d877=>({'name':_0x35d877[_0x2cd737(0x166)]+'\x20('+_0x35d877[_0x2cd737(0x13f)]+')','value':serializeDbSelection(_0x35d877)})),{'name':_0x2cd737(0x13c),'value':_0x2cd737(0x14b)}]});if(_0x565009!=='__manual__')return deserializeDbSelection(_0x565009);}const _0x4a1d16=await input({'message':_0x2cd737(0x142),'validate':_0x4e01e0=>{const _0x26bee4=_0x2cd737,_0x404a30=_0x4e01e0[_0x26bee4(0x13a)]();if(!_0x404a30)return _0x26bee4(0x16e);const _0x37a096=Number(_0x404a30);if(!Number[_0x26bee4(0x15a)](_0x37a096)||_0x37a096<=0x0)return _0x26bee4(0x14e);return!![];}});return{'dbId':Number(_0x4a1d16['trim']())};}async function resolveSqlModeInput(_0x4d4c0e){const _0x711148=a220_0x30b2ad,_0x8a9c73=_0x4d4c0e[_0x711148(0x147)](_0x711148(0x155))[_0x711148(0x13a)]();if(_0x8a9c73==='sql'||_0x8a9c73===_0x711148(0x136))return _0x8a9c73;if(_0x4d4c0e['nonInteractive'])throw CliErrors[_0x711148(0x15d)](_0x711148(0x155),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');return await select({'message':_0x711148(0x154),'choices':[{'name':_0x711148(0x162),'value':_0x711148(0x161),'description':'For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly'},{'name':_0x711148(0x164),'value':_0x711148(0x136),'description':'For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags'}]});}function serializeDbSelection(_0x583317){const _0x2bf9c6=a220_0x30b2ad;return JSON[_0x2bf9c6(0x13b)]({'dbId':_0x583317[_0x2bf9c6(0x13f)],'dbName':_0x583317[_0x2bf9c6(0x166)]});}function deserializeDbSelection(_0x365345){const _0x35e9ac=a220_0x30b2ad;try{const _0x1adbf1=JSON['parse'](_0x365345);if(typeof _0x1adbf1['dbId']===_0x35e9ac(0x135)&&Number[_0x35e9ac(0x137)](_0x1adbf1['dbId']))return{'dbId':_0x1adbf1['dbId'],'dbName':_0x1adbf1[_0x35e9ac(0x166)]};}catch{}throw CliErrors[_0x35e9ac(0x148)](_0x35e9ac(0x152)+_0x365345);}function resolveProvidedDbId(_0x3d0349){const _0x5763c7=a220_0x30b2ad,_0x26e33f=_0x3d0349['flag'](_0x5763c7(0x160));if(typeof _0x26e33f==='number'&&Number[_0x5763c7(0x137)](_0x26e33f))return _0x26e33f;return undefined;}