@lovrabet/rabetbase-cli 2.5.2 → 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 (395) 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.d.ts +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/api/generate-sdk-config-file.d.ts +2 -1
  6. package/lib/api/generate-sdk-config-file.js +1 -1
  7. package/lib/auth/auth-server-ui.js +1 -1
  8. package/lib/auth/auth-server.js +1 -1
  9. package/lib/auth/constant.js +1 -1
  10. package/lib/auth/get-cookie.js +1 -1
  11. package/lib/auth/get-session-user.js +1 -1
  12. package/lib/auth/is-session-valid.js +1 -1
  13. package/lib/auth/login-success-html.js +1 -1
  14. package/lib/auth/logout.js +1 -1
  15. package/lib/cli-flags.js +1 -1
  16. package/lib/cli.js +1 -1
  17. package/lib/commands/api/generate.js +1 -1
  18. package/lib/commands/api/index.js +1 -1
  19. package/lib/commands/api/list.js +1 -1
  20. package/lib/commands/api/pull.js +1 -1
  21. package/lib/commands/api/shared.js +1 -1
  22. package/lib/commands/app/index.js +1 -1
  23. package/lib/commands/app/list.js +1 -1
  24. package/lib/commands/app/members-list.js +1 -1
  25. package/lib/commands/app/remote-directory.js +1 -1
  26. package/lib/commands/app/shared.js +1 -1
  27. package/lib/commands/app-config/delete.js +1 -1
  28. package/lib/commands/app-config/get.js +1 -1
  29. package/lib/commands/app-config/index.js +1 -1
  30. package/lib/commands/app-config/list.js +1 -1
  31. package/lib/commands/app-config/set.js +1 -1
  32. package/lib/commands/app-config/shared.js +1 -1
  33. package/lib/commands/auth/index.js +1 -1
  34. package/lib/commands/bff/create.js +1 -1
  35. package/lib/commands/bff/delete.js +1 -1
  36. package/lib/commands/bff/detail.js +1 -1
  37. package/lib/commands/bff/index.js +1 -1
  38. package/lib/commands/bff/list.js +1 -1
  39. package/lib/commands/bff/logs.d.ts +7 -0
  40. package/lib/commands/bff/logs.js +1 -0
  41. package/lib/commands/bff/pull.js +1 -1
  42. package/lib/commands/bff/push.js +1 -1
  43. package/lib/commands/bff/status.js +1 -1
  44. package/lib/commands/cli-skill/index.js +1 -1
  45. package/lib/commands/cli-update.js +1 -1
  46. package/lib/commands/codegen/index.js +1 -1
  47. package/lib/commands/codegen/sdk.js +1 -1
  48. package/lib/commands/codegen/sql.js +1 -1
  49. package/lib/commands/common/app-registry.js +1 -1
  50. package/lib/commands/common/app-selector.js +1 -1
  51. package/lib/commands/common/async-task.js +1 -1
  52. package/lib/commands/common/dry-run.js +1 -1
  53. package/lib/commands/common/flags.js +1 -1
  54. package/lib/commands/common/local-file.js +1 -1
  55. package/lib/commands/common/validate.js +1 -1
  56. package/lib/commands/config/delete.js +1 -1
  57. package/lib/commands/config/get.js +1 -1
  58. package/lib/commands/config/index.js +1 -1
  59. package/lib/commands/config/init.js +1 -1
  60. package/lib/commands/config/list.js +1 -1
  61. package/lib/commands/config/set.js +1 -1
  62. package/lib/commands/config/shared.js +1 -1
  63. package/lib/commands/dataset/batch-design.d.ts +21 -0
  64. package/lib/commands/dataset/batch-design.js +1 -0
  65. package/lib/commands/dataset/business-group-update.js +1 -1
  66. package/lib/commands/dataset/business-groups.js +1 -1
  67. package/lib/commands/dataset/capability.js +1 -1
  68. package/lib/commands/dataset/delete.js +1 -1
  69. package/lib/commands/dataset/detail.js +1 -1
  70. package/lib/commands/dataset/extend-update.js +1 -1
  71. package/lib/commands/dataset/field-restore.js +1 -1
  72. package/lib/commands/dataset/field-update.js +1 -1
  73. package/lib/commands/dataset/generate.js +1 -1
  74. package/lib/commands/dataset/index.js +1 -1
  75. package/lib/commands/dataset/list.js +1 -1
  76. package/lib/commands/dataset/operations.js +1 -1
  77. package/lib/commands/dataset/relation-audit.js +1 -1
  78. package/lib/commands/dataset/relation-create.js +1 -1
  79. package/lib/commands/dataset/relation-delete.js +1 -1
  80. package/lib/commands/dataset/relation-shared.js +1 -1
  81. package/lib/commands/dataset/relation-update.js +1 -1
  82. package/lib/commands/dataset/relations.js +1 -1
  83. package/lib/commands/dataset/rename.js +1 -1
  84. package/lib/commands/dataset/restore.js +1 -1
  85. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  86. package/lib/commands/db/analysis-batching.js +1 -1
  87. package/lib/commands/db/analyze-batch-plan.js +1 -1
  88. package/lib/commands/db/analyze-cancel.js +1 -1
  89. package/lib/commands/db/analyze-start.js +1 -1
  90. package/lib/commands/db/analyze-status.js +1 -1
  91. package/lib/commands/db/create.js +1 -1
  92. package/lib/commands/db/delete.js +1 -1
  93. package/lib/commands/db/detail.js +1 -1
  94. package/lib/commands/db/diff-refresh-start.js +1 -1
  95. package/lib/commands/db/diff-refresh-status.js +1 -1
  96. package/lib/commands/db/diff.js +1 -1
  97. package/lib/commands/db/index.js +1 -1
  98. package/lib/commands/db/list.js +1 -1
  99. package/lib/commands/db/shared.js +1 -1
  100. package/lib/commands/db/table-diff-shared.js +1 -1
  101. package/lib/commands/db/tables.js +1 -1
  102. package/lib/commands/db/test.js +1 -1
  103. package/lib/commands/db/update.js +1 -1
  104. package/lib/commands/deployment/index.js +1 -1
  105. package/lib/commands/deployment/sync-all.js +1 -1
  106. package/lib/commands/deployment/sync-jobs.js +1 -1
  107. package/lib/commands/deployment/sync-status.js +1 -1
  108. package/lib/commands/doctor.js +1 -1
  109. package/lib/commands/file/index.js +1 -1
  110. package/lib/commands/flow/create.d.ts +2 -0
  111. package/lib/commands/flow/create.js +1 -0
  112. package/lib/commands/flow/detail.d.ts +2 -0
  113. package/lib/commands/flow/detail.js +1 -0
  114. package/lib/commands/flow/index.d.ts +3 -0
  115. package/lib/commands/flow/index.js +1 -0
  116. package/lib/commands/flow/list.d.ts +2 -0
  117. package/lib/commands/flow/list.js +1 -0
  118. package/lib/commands/flow/publish.d.ts +2 -0
  119. package/lib/commands/flow/publish.js +1 -0
  120. package/lib/commands/flow/runtime-resources-shared.d.ts +40 -0
  121. package/lib/commands/flow/runtime-resources-shared.js +1 -0
  122. package/lib/commands/flow/runtime-role-list.d.ts +2 -0
  123. package/lib/commands/flow/runtime-role-list.js +1 -0
  124. package/lib/commands/flow/runtime-role-user-list.d.ts +2 -0
  125. package/lib/commands/flow/runtime-role-user-list.js +1 -0
  126. package/lib/commands/flow/runtime-user-search.d.ts +2 -0
  127. package/lib/commands/flow/runtime-user-search.js +1 -0
  128. package/lib/commands/flow/shared.d.ts +41 -0
  129. package/lib/commands/flow/shared.js +1 -0
  130. package/lib/commands/flow/update.d.ts +2 -0
  131. package/lib/commands/flow/update.js +1 -0
  132. package/lib/commands/flow/validate.d.ts +3 -0
  133. package/lib/commands/flow/validate.js +1 -0
  134. package/lib/commands/instant-api-policy/current.js +1 -1
  135. package/lib/commands/instant-api-policy/index.js +1 -1
  136. package/lib/commands/instant-api-policy/init.js +1 -1
  137. package/lib/commands/instant-api-policy/publish.js +1 -1
  138. package/lib/commands/instant-api-policy/pull.js +1 -1
  139. package/lib/commands/instant-api-policy/revision.js +1 -1
  140. package/lib/commands/instant-api-policy/revisions.js +1 -1
  141. package/lib/commands/instant-api-policy/rollback.js +1 -1
  142. package/lib/commands/instant-api-policy/shared.js +1 -1
  143. package/lib/commands/instant-api-policy/validate.js +1 -1
  144. package/lib/commands/issue/index.js +1 -1
  145. package/lib/commands/issue/nudge.js +1 -1
  146. package/lib/commands/issue/report.js +1 -1
  147. package/lib/commands/issue/shared.js +1 -1
  148. package/lib/commands/kb/create.js +1 -1
  149. package/lib/commands/kb/delete.js +1 -1
  150. package/lib/commands/kb/detail.js +1 -1
  151. package/lib/commands/kb/index.js +1 -1
  152. package/lib/commands/kb/list.js +1 -1
  153. package/lib/commands/kb/search.js +1 -1
  154. package/lib/commands/kb/shared.js +1 -1
  155. package/lib/commands/kb/update.js +1 -1
  156. package/lib/commands/logs/index.js +1 -1
  157. package/lib/commands/menu/asset-update.js +1 -1
  158. package/lib/commands/menu/delete.js +1 -1
  159. package/lib/commands/menu/external-link-create.js +1 -1
  160. package/lib/commands/menu/external-link-update.js +1 -1
  161. package/lib/commands/menu/group-create.js +1 -1
  162. package/lib/commands/menu/group-update.js +1 -1
  163. package/lib/commands/menu/index.js +1 -1
  164. package/lib/commands/menu/list.js +1 -1
  165. package/lib/commands/menu/move.js +1 -1
  166. package/lib/commands/menu/regroup-start.js +1 -1
  167. package/lib/commands/menu/rename.js +1 -1
  168. package/lib/commands/menu/shared/compare-table.js +1 -1
  169. package/lib/commands/menu/shared/delete-plan.js +1 -1
  170. package/lib/commands/menu/shared/facts.js +1 -1
  171. package/lib/commands/menu/shared/index.js +1 -1
  172. package/lib/commands/menu/shared/inquirer.js +1 -1
  173. package/lib/commands/menu/shared/local-pages.js +1 -1
  174. package/lib/commands/menu/shared/logic.js +1 -1
  175. package/lib/commands/menu/shared/mutations.js +1 -1
  176. package/lib/commands/menu/shared/service.js +1 -1
  177. package/lib/commands/menu/shared/sync-core.js +1 -1
  178. package/lib/commands/menu/shared/update-core.js +1 -1
  179. package/lib/commands/menu/shared/valid-url.js +1 -1
  180. package/lib/commands/menu/sync.js +1 -1
  181. package/lib/commands/menu/visibility-update.js +1 -1
  182. package/lib/commands/notification/config-create.js +1 -1
  183. package/lib/commands/notification/config-delete.js +1 -1
  184. package/lib/commands/notification/config-list.js +1 -1
  185. package/lib/commands/notification/config-update.js +1 -1
  186. package/lib/commands/notification/index.js +1 -1
  187. package/lib/commands/notification/shared.js +1 -1
  188. package/lib/commands/ocr/index.js +1 -1
  189. package/lib/commands/page/create.js +1 -1
  190. package/lib/commands/page/custom/detail.js +1 -1
  191. package/lib/commands/page/custom/list.js +1 -1
  192. package/lib/commands/page/custom/publish.js +1 -1
  193. package/lib/commands/page/custom/shared.js +1 -1
  194. package/lib/commands/page/custom/syntax.js +1 -1
  195. package/lib/commands/page/custom/update.js +1 -1
  196. package/lib/commands/page/data-list-status.js +1 -1
  197. package/lib/commands/page/generate-start.js +1 -1
  198. package/lib/commands/page/generate-status.js +1 -1
  199. package/lib/commands/page/index.js +1 -1
  200. package/lib/commands/page/pull.js +1 -1
  201. package/lib/commands/page/push.js +1 -1
  202. package/lib/commands/page/relation-audit.js +1 -1
  203. package/lib/commands/page/restore.js +1 -1
  204. package/lib/commands/page/shared.js +1 -1
  205. package/lib/commands/page/sync.js +1 -1
  206. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  207. package/lib/commands/project/create/format-elapsed.js +1 -1
  208. package/lib/commands/project/create/main.js +1 -1
  209. package/lib/commands/project/create/materialize-project-template.js +1 -1
  210. package/lib/commands/project/create/project-name.js +1 -1
  211. package/lib/commands/project/create/project-template-archive.js +1 -1
  212. package/lib/commands/project/create/project-template-path.js +1 -1
  213. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  214. package/lib/commands/project/create/use-format-code.js +1 -1
  215. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  216. package/lib/commands/project/domain-routing-sync.js +1 -1
  217. package/lib/commands/project/index.js +1 -1
  218. package/lib/commands/project/upgrade.js +1 -1
  219. package/lib/commands/registry.js +1 -1
  220. package/lib/commands/role/delete.js +1 -1
  221. package/lib/commands/role/detail.js +1 -1
  222. package/lib/commands/role/index.js +1 -1
  223. package/lib/commands/role/list.js +1 -1
  224. package/lib/commands/role/shared.js +1 -1
  225. package/lib/commands/role/update.js +1 -1
  226. package/lib/commands/role/user-add.js +1 -1
  227. package/lib/commands/role/user-remove.js +1 -1
  228. package/lib/commands/role/user-resolve.js +1 -1
  229. package/lib/commands/rule/get.js +1 -1
  230. package/lib/commands/rule/index.js +1 -1
  231. package/lib/commands/rule/list.js +1 -1
  232. package/lib/commands/rule/set.js +1 -1
  233. package/lib/commands/rule/shared.js +1 -1
  234. package/lib/commands/run/index.js +1 -1
  235. package/lib/commands/schema.js +1 -1
  236. package/lib/commands/sql/create.js +1 -1
  237. package/lib/commands/sql/delete.js +1 -1
  238. package/lib/commands/sql/detail.js +1 -1
  239. package/lib/commands/sql/exec.js +1 -1
  240. package/lib/commands/sql/index.js +1 -1
  241. package/lib/commands/sql/list.js +1 -1
  242. package/lib/commands/sql/pull.js +1 -1
  243. package/lib/commands/sql/push.js +1 -1
  244. package/lib/commands/sql/shared.js +1 -1
  245. package/lib/commands/sql/status.js +1 -1
  246. package/lib/commands/sql/validate.js +1 -1
  247. package/lib/commands/task/index.js +1 -1
  248. package/lib/commands/task/status.js +1 -1
  249. package/lib/commands/tenant/index.js +1 -1
  250. package/lib/commands/tenant/members-list.js +1 -1
  251. package/lib/commands/tenant/shared.js +1 -1
  252. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  253. package/lib/commands/user-account/index.js +1 -1
  254. package/lib/commands/workspace/add.js +1 -1
  255. package/lib/commands/workspace/index.js +1 -1
  256. package/lib/commands/workspace/remove.js +1 -1
  257. package/lib/config/domain-config.js +1 -1
  258. package/lib/config/project-domain-routing.js +1 -1
  259. package/lib/config/region-config.d.ts +23 -0
  260. package/lib/config/region-config.js +1 -0
  261. package/lib/config/schema.d.ts +15 -0
  262. package/lib/config/schema.js +1 -1
  263. package/lib/constant/cdn.js +1 -1
  264. package/lib/constant/cli.js +1 -1
  265. package/lib/constant/defaults.js +1 -1
  266. package/lib/constant/domain.js +1 -1
  267. package/lib/constant/env.js +1 -1
  268. package/lib/constant/output.js +1 -1
  269. package/lib/constant/paths.js +1 -1
  270. package/lib/constant/region.js +1 -1
  271. package/lib/constant/risk.js +1 -1
  272. package/lib/constant/routing-profile.js +1 -1
  273. package/lib/context/app-resolver.d.ts +6 -0
  274. package/lib/context/app-resolver.js +1 -1
  275. package/lib/context/auth-resolver.js +1 -1
  276. package/lib/context/config-loader.js +1 -1
  277. package/lib/context.d.ts +13 -0
  278. package/lib/context.js +1 -1
  279. package/lib/core/alias-resolver.js +1 -1
  280. package/lib/core/api-client.d.ts +172 -1
  281. package/lib/core/api-client.js +1 -1
  282. package/lib/core/bff/config.js +1 -1
  283. package/lib/core/bff/file-system.js +1 -1
  284. package/lib/core/bff/hash.js +1 -1
  285. package/lib/core/bff/hook-directory.d.ts +55 -0
  286. package/lib/core/bff/hook-directory.js +1 -0
  287. package/lib/core/bff/lock.js +1 -1
  288. package/lib/core/bff/types.d.ts +15 -0
  289. package/lib/core/bff/utils.js +1 -1
  290. package/lib/core/db-resolver.js +1 -1
  291. package/lib/core/flow-config.d.ts +628 -0
  292. package/lib/core/flow-config.js +1 -0
  293. package/lib/core/instant-api-policy/config.js +1 -1
  294. package/lib/core/kb-search-client.js +1 -1
  295. package/lib/core/page/file-system.js +1 -1
  296. package/lib/core/page/hash.js +1 -1
  297. package/lib/core/page/lock.js +1 -1
  298. package/lib/core/page/lr-smart-jsx.d.ts +6 -0
  299. package/lib/core/page/lr-smart-jsx.js +1 -0
  300. package/lib/core/sql-index-auditor.js +1 -1
  301. package/lib/core/sql-sync/config.js +1 -1
  302. package/lib/core/sql-sync/file-system.js +1 -1
  303. package/lib/core/sql-sync/hash.js +1 -1
  304. package/lib/core/sql-sync/lock.js +1 -1
  305. package/lib/core/sql-sync/utils.js +1 -1
  306. package/lib/core/sql-validator.js +1 -1
  307. package/lib/errors.js +1 -1
  308. package/lib/framework/build-all-flags.js +1 -1
  309. package/lib/framework/error-output.js +1 -1
  310. package/lib/framework/explicit-yes.js +1 -1
  311. package/lib/framework/flags.js +1 -1
  312. package/lib/framework/help.js +1 -1
  313. package/lib/framework/index.js +1 -1
  314. package/lib/framework/output.js +1 -1
  315. package/lib/framework/response.js +1 -1
  316. package/lib/framework/runner-alias.js +1 -1
  317. package/lib/framework/runner.js +1 -1
  318. package/lib/framework/schema-export.js +1 -1
  319. package/lib/framework/supported-flags.js +1 -1
  320. package/lib/framework/types.js +1 -1
  321. package/lib/generated/build-info.d.ts +4 -4
  322. package/lib/generated/build-info.js +1 -1
  323. package/lib/generated/official-routing.js +1 -1
  324. package/lib/generated/routing-contract.js +1 -1
  325. package/lib/help.js +1 -1
  326. package/lib/postinstall.js +1 -1
  327. package/lib/runtime/confirmation.js +1 -1
  328. package/lib/runtime/event.js +1 -1
  329. package/lib/runtime/index.js +1 -1
  330. package/lib/runtime/queue.js +1 -1
  331. package/lib/runtime/resolve.js +1 -1
  332. package/lib/skills/builtin-skill.js +1 -1
  333. package/lib/skills/main.js +1 -1
  334. package/lib/skills/npx-skills-add.js +1 -1
  335. package/lib/skills/skill-presence.js +1 -1
  336. package/lib/telemetry/cli-command-trace.js +1 -1
  337. package/lib/telemetry/cli-help-trace.js +1 -1
  338. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  339. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  340. package/lib/telemetry/send-cli-trace-log.js +1 -1
  341. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  342. package/lib/types/index.d.ts +1 -1
  343. package/lib/utils/ai_config.js +1 -1
  344. package/lib/utils/apply-jq-filter.js +1 -1
  345. package/lib/utils/cdn-config.js +1 -1
  346. package/lib/utils/check-sdk-version.js +1 -1
  347. package/lib/utils/cli-version-check.js +1 -1
  348. package/lib/utils/cli-version-policy.js +1 -1
  349. package/lib/utils/config.d.ts +2 -8
  350. package/lib/utils/config.js +1 -1
  351. package/lib/utils/entity-with-id.js +1 -1
  352. package/lib/utils/file-utils.js +1 -1
  353. package/lib/utils/guides-cdn.js +1 -1
  354. package/lib/utils/http-client.js +1 -1
  355. package/lib/utils/is-non-interactive.js +1 -1
  356. package/lib/utils/logger.js +1 -1
  357. package/lib/utils/params.js +1 -1
  358. package/lib/utils/platform.js +1 -1
  359. package/lib/utils/sleep.js +1 -1
  360. package/lib/utils/template-replacer.d.ts +2 -1
  361. package/lib/utils/template-replacer.js +1 -1
  362. package/lib/utils/update-notice.js +1 -1
  363. package/lib/utils/version.js +1 -1
  364. package/lib/utils/with-active-cookie.js +1 -1
  365. package/lib/utils/write-cli-side-channel.js +1 -1
  366. package/package.json +1 -1
  367. package/skills/rabetbase/SKILL.md +27 -8
  368. package/skills/rabetbase/guides/approval-flow-development-workflow.md +137 -0
  369. package/skills/rabetbase/guides/backend-function.md +19 -9
  370. package/skills/rabetbase/guides/bff-creation-workflow.md +10 -1
  371. package/skills/rabetbase/guides/conflict-detection.md +2 -0
  372. package/skills/rabetbase/guides/page-development-workflow.md +3 -0
  373. package/skills/rabetbase/guides/sdk-client-generation.md +6 -5
  374. package/skills/rabetbase/knowledge/approval-flow/config-json-schema.md +290 -0
  375. package/skills/rabetbase/knowledge/page-schema/LrSmartJsx.md +11 -3
  376. package/skills/rabetbase/references/rabetbase-api-pull.md +5 -4
  377. package/skills/rabetbase/references/rabetbase-app-list.md +3 -0
  378. package/skills/rabetbase/references/rabetbase-bff-create.md +1 -1
  379. package/skills/rabetbase/references/rabetbase-bff-list.md +1 -1
  380. package/skills/rabetbase/references/rabetbase-bff-logs.md +47 -0
  381. package/skills/rabetbase/references/rabetbase-bff-pull.md +9 -3
  382. package/skills/rabetbase/references/rabetbase-bff-push.md +10 -2
  383. package/skills/rabetbase/references/rabetbase-bff-status.md +2 -0
  384. package/skills/rabetbase/references/rabetbase-config.md +10 -9
  385. package/skills/rabetbase/references/rabetbase-dataset-generate.md +52 -2
  386. package/skills/rabetbase/references/rabetbase-doctor.md +2 -2
  387. package/skills/rabetbase/references/rabetbase-flow-commands.md +86 -0
  388. package/skills/rabetbase/references/rabetbase-flow-resources.md +83 -0
  389. package/skills/rabetbase/references/rabetbase-flow-runtime-boundary.md +25 -0
  390. package/skills/rabetbase/references/rabetbase-instant-api-policy.md +103 -11
  391. package/skills/rabetbase/references/rabetbase-notification-config-list.md +17 -0
  392. package/skills/rabetbase/references/rabetbase-page-push.md +5 -1
  393. package/skills/rabetbase/references/rabetbase-workspace.md +4 -2
  394. package/skills/rabetbase.manifest.json +9 -3
  395. package/templates/generate-api/client.ts.tpl +1 -1
@@ -1 +1 @@
1
- function a193_0x5e8b(){const _0xc2fd93=['--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','Filter\x20by\x20role\x20type','106734eJsfag','trim','toUpperCase','appCode','Page\x20size\x20(1-100)','role','7504609UKBGqp','ADMIN','num','dev','list','484748aauJGD','\x20role(s)','roleType','CUSTOM','6dPDdaH','type','page','pagesize','number','validation','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','Found\x20','5100695KdYAeq','Page\x20index\x20(1-based)','2271984qtAlNi','filter','3799736mBEqwU','read','join','map','Use\x20one\x20of:\x20','24388216agQtJz'];a193_0x5e8b=function(){return _0xc2fd93;};return a193_0x5e8b();}const a193_0x540bf1=a193_0x53d8;(function(_0x17d229,_0x3aec0e){const _0x23d4c1=a193_0x53d8,_0x2c9bd8=_0x17d229();while(!![]){try{const _0x564855=parseInt(_0x23d4c1(0xc8))/0x1+-parseInt(_0x23d4c1(0xb0))/0x2+parseInt(_0x23d4c1(0xbe))/0x3+parseInt(_0x23d4c1(0xc0))/0x4+parseInt(_0x23d4c1(0xbc))/0x5*(parseInt(_0x23d4c1(0xb4))/0x6)+parseInt(_0x23d4c1(0xce))/0x7+-parseInt(_0x23d4c1(0xc5))/0x8;if(_0x564855===_0x3aec0e)break;else _0x2c9bd8['push'](_0x2c9bd8['shift']());}catch(_0x17c1da){_0x2c9bd8['push'](_0x2c9bd8['shift']());}}}(a193_0x5e8b,0x96399));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';function a193_0x53d8(_0x577af5,_0x2a89c4){_0x577af5=_0x577af5-0xae;const _0x5e8bf6=a193_0x5e8b();let _0x53d861=_0x5e8bf6[_0x577af5];return _0x53d861;}const ROLE_TYPES=[a193_0x540bf1(0xcf),'DEV','OWNER',a193_0x540bf1(0xb3)];export const roleList={'service':a193_0x540bf1(0xcd),'command':a193_0x540bf1(0xaf),'description':'List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','risk':a193_0x540bf1(0xc1),'flags':[APPCODE_FLAG_OPTIONAL,{'name':'type','type':'string','required':![],'description':a193_0x540bf1(0xc7),'enum':ROLE_TYPES},{'name':a193_0x540bf1(0xb6),'type':a193_0x540bf1(0xb8),'description':a193_0x540bf1(0xbd),'default':0x1},{'name':a193_0x540bf1(0xb7),'type':a193_0x540bf1(0xb8),'description':a193_0x540bf1(0xcc),'default':0x64}],async 'validate'(_0x359454){const _0x46033d=a193_0x540bf1,_0x1333e5=_0x359454['str'](_0x46033d(0xb5))[_0x46033d(0xc9)]();if(_0x1333e5&&!ROLE_TYPES['includes'](_0x1333e5[_0x46033d(0xca)]()))throw CliErrors[_0x46033d(0xb9)]('Invalid\x20--type\x20\x22'+_0x1333e5+'\x22.',_0x46033d(0xc4)+ROLE_TYPES[_0x46033d(0xc2)](',\x20')+'.');const _0x26f70a=_0x359454[_0x46033d(0xd0)]('page',0x1),_0x4cf6c0=_0x359454[_0x46033d(0xd0)](_0x46033d(0xb7),0x64);if(_0x26f70a<0x1)throw CliErrors[_0x46033d(0xb9)](_0x46033d(0xba));if(_0x4cf6c0<0x1||_0x4cf6c0>0x64)throw CliErrors[_0x46033d(0xb9)](_0x46033d(0xc6));},async 'execute'(_0x617260){const _0x3fb585=a193_0x540bf1,_0x33e119=_0x617260[_0x3fb585(0xd0)]('page',0x1)||0x1,_0x210027=_0x617260['num'](_0x3fb585(0xb7),0x64)||0x64,_0x559488=_0x617260['str'](_0x3fb585(0xb5))[_0x3fb585(0xc9)]()[_0x3fb585(0xca)](),{items:_0x1a9a8e,paging:_0x2471ed}=await listAppRoles(_0x617260[_0x3fb585(0xcb)],{'currentPage':_0x33e119,'pageSize':_0x210027}),_0x3b92f2=_0x559488?_0x1a9a8e[_0x3fb585(0xbf)](_0x1e58cc=>_0x1e58cc[_0x3fb585(0xb2)]===_0x559488):_0x1a9a8e,_0x3c0132=_0x3b92f2[_0x3fb585(0xc3)](projectRole);return{'ok':!![],'data':{'scope':_0x3fb585(0xae),'roles':_0x3c0132,'paging':_0x2471ed},'message':_0x3fb585(0xbb)+_0x3c0132['length']+_0x3fb585(0xb1)};}};
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_0x478f8f=a194_0x2124;(function(_0x12ced5,_0x42fe71){const _0x49fa12=a194_0x2124,_0xac4f53=_0x12ced5();while(!![]){try{const _0x49c2fb=-parseInt(_0x49fa12(0x7e))/0x1+-parseInt(_0x49fa12(0x96))/0x2*(parseInt(_0x49fa12(0x82))/0x3)+-parseInt(_0x49fa12(0x94))/0x4+-parseInt(_0x49fa12(0x6e))/0x5+parseInt(_0x49fa12(0x72))/0x6+-parseInt(_0x49fa12(0xab))/0x7*(parseInt(_0x49fa12(0xa2))/0x8)+parseInt(_0x49fa12(0x9c))/0x9;if(_0x49c2fb===_0x42fe71)break;else _0xac4f53['push'](_0xac4f53['shift']());}catch(_0x398c4f){_0xac4f53['push'](_0xac4f53['shift']());}}}(a194_0x3cf4,0x76d27));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':'number','required':!![],'description':a194_0x478f8f(0xa8)};export const ROLE_REF_FLAG={'name':a194_0x478f8f(0x84),'type':a194_0x478f8f(0x74),'required':!![],'description':'Role\x20id\x20or\x20exact\x20role\x20name'};export const USER_REF_FLAG={'name':'user','type':'string','required':!![],'description':a194_0x478f8f(0x8b)};export const NAME_FLAG={'name':a194_0x478f8f(0xb6),'type':a194_0x478f8f(0x74),'required':!![],'description':a194_0x478f8f(0x79)};export const USER_NAME_FLAG={'name':a194_0x478f8f(0xb6),'type':a194_0x478f8f(0x74),'required':!![],'description':a194_0x478f8f(0x9b)};export const REMARK_FLAG={'name':a194_0x478f8f(0x87),'type':a194_0x478f8f(0x74),'required':![],'description':a194_0x478f8f(0x78)};export const EXPECT_USER_COUNT_FLAG={'name':a194_0x478f8f(0x85),'type':a194_0x478f8f(0x81),'required':![],'description':'Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs'};export const BUILTIN_ROLE_TYPES=['ADMIN',a194_0x478f8f(0x90),a194_0x478f8f(0xa0)];export function isBuiltinRole(_0x1eeefe){return BUILTIN_ROLE_TYPES['includes'](_0x1eeefe);}export function assertCustomRole(_0x3a7a3e,_0x4000f6){const _0x321691=a194_0x478f8f;if(_0x3a7a3e[_0x321691(0x9f)]!==_0x321691(0x98))throw CliErrors[_0x321691(0x75)](_0x321691(0xac)+_0x4000f6+_0x321691(0x6d)+_0x3a7a3e[_0x321691(0x89)]+'\x20('+_0x3a7a3e[_0x321691(0x9f)]+').',_0x321691(0x7d));}function a194_0x2124(_0x23712b,_0x1238db){_0x23712b=_0x23712b-0x6b;const _0x3cf4b3=a194_0x3cf4();let _0x212473=_0x3cf4b3[_0x23712b];return _0x212473;}export function projectRole(_0x5f7f90){const _0x45597d=a194_0x478f8f;return{'id':_0x5f7f90['id'],'roleName':_0x5f7f90[_0x45597d(0x89)],'roleType':_0x5f7f90['roleType'],'remark':_0x5f7f90[_0x45597d(0x87)],'userCount':_0x5f7f90[_0x45597d(0x71)],'permitCount':_0x5f7f90['permitCount'],'builtin':isBuiltinRole(_0x5f7f90['roleType'])};}export async function resolveRoleRef(_0x45e636,_0x3bb83c){const _0x3f7d71=a194_0x478f8f,_0x5d3e11=_0x3bb83c['trim']();if(!_0x5d3e11)throw CliErrors['validation'](_0x3f7d71(0x8f),_0x3f7d71(0xad));if(/^\d+$/[_0x3f7d71(0xb4)](_0x5d3e11))return getRoleById(_0x45e636,Number(_0x5d3e11));const _0x32918d=await listAllAppRoles(_0x45e636),_0x548041=_0x32918d[_0x3f7d71(0x9d)](_0x33fe2b=>_0x33fe2b['roleName']===_0x5d3e11);if(_0x548041[_0x3f7d71(0x8d)]===0x0)throw CliErrors[_0x3f7d71(0x75)](_0x3f7d71(0x8e)+_0x5d3e11+_0x3f7d71(0x7c)+_0x45e636+'.',_0x3f7d71(0x93));if(_0x548041[_0x3f7d71(0x8d)]>0x1){const _0x12a4b0=_0x548041[_0x3f7d71(0xaa)](_0x1629cf=>_0x1629cf['id'])[_0x3f7d71(0x7a)](',\x20');throw CliErrors[_0x3f7d71(0x75)](_0x3f7d71(0x8e)+_0x5d3e11+_0x3f7d71(0x9e)+_0x12a4b0+').',_0x3f7d71(0x6c));}return _0x548041[0x0];}export async function getRoleById(_0x2ada89,_0x259b18){const _0x310ca0=a194_0x478f8f,_0x40ca3c=await listAllAppRoles(_0x2ada89),_0x3f81ed=_0x40ca3c[_0x310ca0(0x9d)](_0x502ac1=>_0x502ac1['id']===_0x259b18&&(!_0x502ac1[_0x310ca0(0x8a)]||_0x502ac1['appCode']===_0x2ada89));if(_0x3f81ed['length']!==0x1)throw CliErrors[_0x310ca0(0x75)](_0x310ca0(0x77)+_0x259b18+'\x20not\x20found\x20in\x20app\x20'+_0x2ada89+'.',_0x310ca0(0x76));return _0x3f81ed[0x0];}async function listAllAppRoles(_0x1383e4){const _0x19be80=a194_0x478f8f,_0x5858a8=0x64,_0x3eb60f=[];for(let _0x5b7133=0x1;;_0x5b7133+=0x1){const {items:_0xcf1544,paging:_0x29097d}=await listAppRoles(_0x1383e4,{'currentPage':_0x5b7133,'pageSize':_0x5858a8});_0x3eb60f[_0x19be80(0xaf)](..._0xcf1544);if(_0xcf1544[_0x19be80(0x8d)]<_0x5858a8||_0x29097d&&_0x3eb60f[_0x19be80(0x8d)]>=_0x29097d['totalCount'])return _0x3eb60f;}}export async function resolveTenantCode(){const _0x344874=a194_0x478f8f,_0x3d469d=await getSessionUserInfo(),_0x287520=_0x3d469d?.[_0x344874(0xb1)]?.[_0x344874(0x9a)]?.[_0x344874(0x86)];if(!_0x287520)throw CliErrors[_0x344874(0xa6)](_0x344874(0x97));return _0x287520;}function matchMember(_0x257934,_0x598482){const _0x314819=a194_0x478f8f,_0x2fcf0e=_0x598482['trim']()[_0x314819(0xb7)]();return(_0x257934[_0x314819(0x8c)]??'')[_0x314819(0xb7)]()===_0x2fcf0e||(_0x257934[_0x314819(0x91)]??'')[_0x314819(0xb7)]()===_0x2fcf0e;}function a194_0x3cf4(){const _0x307459=['string','validation','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','Role\x20id\x20','Optional\x20role\x20remark/description','Role\x20name','join','trim','\x22\x20not\x20found\x20in\x20app\x20','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','772696CYeNTF','flag','totalCount','number','2094678IRlyhl','Removed\x20','role','expect-user-count','tenant_code','remark','dev','roleName','appCode','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','nickname','length','Role\x20name\x20\x22','Missing\x20role\x20reference.','DEV','username','Check\x20the\x20nickname/username.\x20','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','3217984JVkBgZ','userId','2Qbtcub','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','CUSTOM','\x20is\x20not\x20a\x20member\x20of\x20role\x20','tenant','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','21050694MIGSAT','filter','\x22\x20is\x20ambiguous\x20(ids:\x20','roleType','OWNER','\x20member(s)\x20but\x20role\x20has\x20','808DcMBwT','\x20members\x20of\x20the\x20OWNER\x20role.','str','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','authRequired','user-add','Role\x20id\x20(from\x20`role\x20list`)','Pass\x20--user\x20<id|name>.','map','630VJDWHZ','Cannot\x20','Pass\x20--role\x20<id|name>.','includes','push','flagMissing','user','No\x20tenant\x20member\x20matches\x20\x22','User\x20','test','\x20duplicate\x20memberships\x20for\x20user\x20','name','toLowerCase','Pass\x20--user\x20<id>.','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','Disambiguate\x20with\x20--role\x20<id>.','\x20built-in\x20role\x20','298265NFLpKr',';\x20no\x20change.','POST','userCount','2951340fFRVvu','/smartapi/permit/user-role/create'];a194_0x3cf4=function(){return _0x307459;};return a194_0x3cf4();}export async function resolveUserRef(_0xb7f4d0,_0x31f804=a194_0x478f8f(0xb8)){const _0x3b3d27=a194_0x478f8f,_0x3b4741=_0xb7f4d0[_0x3b3d27(0x7b)]();if(!_0x3b4741)throw CliErrors[_0x3b3d27(0x75)]('Missing\x20user\x20reference.',_0x3b3d27(0xa9));const _0x20d8c2=await resolveTenantCode(),_0x8be42c=await getTenantMembers(_0x20d8c2);if(/^\d+$/[_0x3b3d27(0xb4)](_0x3b4741)){const _0x39dc5c=Number(_0x3b4741),_0x3a6fcb=_0x8be42c['find'](_0x3a30b0=>_0x3a30b0[_0x3b3d27(0x95)]===_0x39dc5c);return{'userId':_0x39dc5c,'username':_0x3a6fcb?.[_0x3b3d27(0x91)]??String(_0x39dc5c),'nickname':_0x3a6fcb?.['nickname'],'matchedBy':'id'};}const _0x4989a5=_0x8be42c[_0x3b3d27(0x9d)](_0x1c9c49=>matchMember(_0x1c9c49,_0x3b4741));if(_0x4989a5[_0x3b3d27(0x8d)]===0x0)throw CliErrors[_0x3b3d27(0x75)](_0x3b3d27(0xb2)+_0x3b4741+'\x22.',_0x3b3d27(0x92)+_0x31f804);if(_0x4989a5[_0x3b3d27(0x8d)]>0x1){const _0x1fa3e2=_0x4989a5[_0x3b3d27(0xaa)](_0x3cffbb=>(_0x3cffbb[_0x3b3d27(0x8c)]??_0x3cffbb[_0x3b3d27(0x91)]??'?')+'('+_0x3cffbb[_0x3b3d27(0x95)]+')')['join'](',\x20');throw CliErrors['validation']('Multiple\x20tenant\x20members\x20match\x20\x22'+_0x3b4741+'\x22:\x20'+_0x1fa3e2+'.',_0x31f804);}const _0x40ebdd=_0x4989a5[0x0];return{'userId':_0x40ebdd['userId'],'username':_0x40ebdd[_0x3b3d27(0x91)]??String(_0x40ebdd[_0x3b3d27(0x95)]),'nickname':_0x40ebdd[_0x3b3d27(0x8c)],'matchedBy':_0x3b3d27(0xb6)};}export const CREATE_USER_ROLE_PATH=a194_0x478f8f(0x73);export const DELETE_USER_ROLE_PATH='/smartapi/permit/user-role/delete';export function computeRoleUserMutation(_0x3e8281){const _0x171511=a194_0x478f8f,{operation:_0x1fcd02,appCode:_0x378959,role:_0x5f1cf4,relations:_0x3bf287,user:_0x2e0978}=_0x3e8281,_0x3a8885=[...new Set(_0x3bf287['map'](_0xbd1c09=>_0xbd1c09['userId']))],_0x300db0=[];if(_0x3e8281['expectUserCount']!==undefined&&_0x3e8281['expectUserCount']!==_0x3a8885['length'])throw CliErrors['validation']('Anti-drift\x20check\x20failed:\x20expected\x20'+_0x3e8281['expectUserCount']+_0x171511(0xa1)+_0x3a8885[_0x171511(0x8d)]+'.',_0x171511(0xa5));const _0x1062d1=_0x3a8885[_0x171511(0xae)](_0x2e0978[_0x171511(0x95)]),_0x4e92ac=_0x3bf287[_0x171511(0x9d)](_0x1aefa6=>_0x1aefa6[_0x171511(0x95)]===_0x2e0978[_0x171511(0x95)])[_0x171511(0xaa)](_0x146d99=>_0x146d99['id']),_0x17abbc=_0x1fcd02===_0x171511(0xa7)?!_0x1062d1:_0x1062d1;let _0x17ea33=_0x3a8885;_0x1fcd02===_0x171511(0xa7)?_0x1062d1?_0x300db0[_0x171511(0xaf)](_0x171511(0xb3)+_0x2e0978[_0x171511(0x95)]+'\x20is\x20already\x20a\x20member\x20of\x20role\x20'+_0x5f1cf4['roleName']+_0x171511(0x6f)):_0x17ea33=[..._0x3a8885,_0x2e0978[_0x171511(0x95)]]:!_0x1062d1?_0x300db0[_0x171511(0xaf)](_0x171511(0xb3)+_0x2e0978[_0x171511(0x95)]+_0x171511(0x99)+_0x5f1cf4[_0x171511(0x89)]+_0x171511(0x6f)):(_0x17ea33=_0x3a8885[_0x171511(0x9d)](_0x765281=>_0x765281!==_0x2e0978['userId']),_0x4e92ac['length']>0x1&&_0x300db0[_0x171511(0xaf)](_0x171511(0x83)+_0x4e92ac['length']+_0x171511(0xb5)+_0x2e0978[_0x171511(0x95)]+'.'));const _0xdbe245={'scope':_0x171511(0x88),'operation':_0x1fcd02,'selector':{'appCode':_0x378959,'roleId':_0x5f1cf4['id'],'roleName':_0x5f1cf4[_0x171511(0x89)],'userId':_0x2e0978['userId']},'before':{'userIds':_0x3a8885},'after':{'userIds':_0x17ea33},'dryRun':_0x3e8281['dryRun'],'backend':{'method':_0x171511(0x70),'path':_0x1fcd02==='user-add'?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x300db0};return{'mutation':_0xdbe245,'changed':_0x17abbc,'matchingRelationIds':_0x4e92ac};}export async function loadDevRoleRelations(_0x93014e,_0x4e1233){const _0xb1738b=a194_0x478f8f,_0x4381d4=0x64,_0x31fe96=[];for(let _0x3f6b48=0x1;;_0x3f6b48+=0x1){const {items:_0x48442e,paging:_0x595142}=await listDevUserRoleRelations(_0x93014e,{'roleId':_0x4e1233,'currentPage':_0x3f6b48,'pageSize':_0x4381d4});_0x31fe96[_0xb1738b(0xaf)](..._0x48442e);if(_0x48442e[_0xb1738b(0x8d)]<_0x4381d4||_0x595142&&_0x31fe96['length']>=_0x595142[_0xb1738b(0x80)])return _0x31fe96;}}export function readRoleRef(_0x450e89){const _0x23ab1b=a194_0x478f8f,_0x1cb96a=_0x450e89[_0x23ab1b(0xa4)]('role')[_0x23ab1b(0x7b)]();if(!_0x1cb96a)throw CliErrors[_0x23ab1b(0xb0)]('role',_0x23ab1b(0xad));return _0x1cb96a;}export async function prepareUserMutation(_0x1ad316,_0x2db580,_0x45a935){const _0x22c843=a194_0x478f8f,_0x1d6269=readRoleRef(_0x1ad316),_0x488c5e=_0x1ad316[_0x22c843(0xa4)](_0x22c843(0xb1))[_0x22c843(0x7b)]();if(!_0x488c5e)throw CliErrors[_0x22c843(0xb0)]('user',_0x22c843(0xa9));const _0x226746=_0x1ad316[_0x22c843(0x7f)](_0x22c843(0x85)),_0x3761c8=_0x226746===undefined||_0x226746===null?undefined:Number(_0x226746),_0x217878=await resolveRoleRef(_0x1ad316[_0x22c843(0x8a)],_0x1d6269);if(_0x217878[_0x22c843(0x9f)]===_0x22c843(0xa0))throw CliErrors[_0x22c843(0x75)](_0x22c843(0xac)+_0x2db580+_0x22c843(0xa3),_0x22c843(0x6b));const _0x4cbb06=await resolveUserRef(_0x488c5e),_0x15f5ba=await loadDevRoleRelations(_0x1ad316[_0x22c843(0x8a)],_0x217878['id']);return{...computeRoleUserMutation({'operation':_0x2db580,'appCode':_0x1ad316['appCode'],'role':_0x217878,'relations':_0x15f5ba,'user':{'userId':_0x4cbb06['userId'],'username':_0x4cbb06[_0x22c843(0x91)],'nickname':_0x4cbb06['nickname']},'dryRun':_0x45a935,..._0x3761c8!==undefined?{'expectUserCount':_0x3761c8}:{}}),'role':_0x217878,'user':_0x4cbb06};}
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_0x57ef1c=a195_0x2545;(function(_0x5a5470,_0x2172c6){const _0x5030b3=a195_0x2545,_0x160230=_0x5a5470();while(!![]){try{const _0x41fe70=parseInt(_0x5030b3(0x1f5))/0x1+-parseInt(_0x5030b3(0x1f7))/0x2*(parseInt(_0x5030b3(0x1fc))/0x3)+-parseInt(_0x5030b3(0x1f3))/0x4+-parseInt(_0x5030b3(0x1fe))/0x5*(parseInt(_0x5030b3(0x1ea))/0x6)+-parseInt(_0x5030b3(0x1e7))/0x7+-parseInt(_0x5030b3(0x1e4))/0x8*(-parseInt(_0x5030b3(0x1e9))/0x9)+parseInt(_0x5030b3(0x200))/0xa;if(_0x41fe70===_0x2172c6)break;else _0x160230['push'](_0x160230['shift']());}catch(_0x590e4d){_0x160230['push'](_0x160230['shift']());}}}(a195_0x4022,0x4bd59));import{updateAppRole}from'../../core/api-client.js';function a195_0x4022(){const _0x20b9cf=['2984965mHPCsD','num','20101920FJPFLR','616JgQNrP','Nothing\x20to\x20update.','string','3462564ouYjtE','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','19746FfXKTQ','6wzWbSJ','dev','Updated\x20role\x20','update','POST','appCode','roleName','role','validation','1579144sQJsRu','remark','151707pTBIhH','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','34438IaxOSo','--name\x20cannot\x20be\x20empty.','/smartapi/permit/role/update','write','length','93CjtlTN','New\x20role\x20name'];a195_0x4022=function(){return _0x20b9cf;};return a195_0x4022();}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=a195_0x57ef1c(0x1f9);function readPatch(_0xa73ef3){const _0x52c4c2=a195_0x57ef1c,_0xbf97fd=_0xa73ef3['flag']('name'),_0x4ee9e9=_0xa73ef3['flag']('remark'),_0x469b9a={};if(_0xbf97fd!==undefined&&_0xbf97fd!==null){const _0xdddde8=String(_0xbf97fd)['trim']();if(!_0xdddde8)throw CliErrors[_0x52c4c2(0x1f2)](_0x52c4c2(0x1f8));if(_0xdddde8[_0x52c4c2(0x1fb)]>0x40)throw CliErrors[_0x52c4c2(0x1f2)]('Role\x20name\x20cannot\x20exceed\x2064\x20characters.');_0x469b9a[_0x52c4c2(0x1f0)]=_0xdddde8;}_0x4ee9e9!==undefined&&_0x4ee9e9!==null&&(_0x469b9a[_0x52c4c2(0x1f4)]=String(_0x4ee9e9));if(_0x469b9a[_0x52c4c2(0x1f0)]===undefined&&_0x469b9a[_0x52c4c2(0x1f4)]===undefined)throw CliErrors['validation'](_0x52c4c2(0x1e5),_0x52c4c2(0x1e8));return _0x469b9a;}function a195_0x2545(_0x4f1418,_0x5a9b76){_0x4f1418=_0x4f1418-0x1e4;const _0x40220a=a195_0x4022();let _0x2545bd=_0x40220a[_0x4f1418];return _0x2545bd;}export const roleUpdate={'service':a195_0x57ef1c(0x1f1),'command':'update','description':a195_0x57ef1c(0x1f6),'risk':a195_0x57ef1c(0x1fa),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':'name','type':a195_0x57ef1c(0x1e6),'required':![],'description':a195_0x57ef1c(0x1fd)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3d71f2){readPatch(_0x3d71f2);},async 'dryRun'(_0x32f79d){const _0x11a111=a195_0x57ef1c,_0x3ddcf3=_0x32f79d['num']('id'),_0x230aa3=readPatch(_0x32f79d),_0x2fb8c4=await getRoleById(_0x32f79d[_0x11a111(0x1ef)],_0x3ddcf3);return assertCustomRole(_0x2fb8c4,_0x11a111(0x1ed)),asDryRunResult({'scope':_0x11a111(0x1eb),'operation':'update','selector':{'appCode':_0x32f79d[_0x11a111(0x1ef)],'roleId':_0x3ddcf3,'roleName':_0x2fb8c4[_0x11a111(0x1f0)]},'before':projectRole(_0x2fb8c4),'after':projectRole({..._0x2fb8c4,..._0x230aa3[_0x11a111(0x1f0)]!==undefined?{'roleName':_0x230aa3[_0x11a111(0x1f0)]}:{},..._0x230aa3[_0x11a111(0x1f4)]!==undefined?{'remark':_0x230aa3[_0x11a111(0x1f4)]}:{}}),'dryRun':!![],'backend':{'method':_0x11a111(0x1ee),'path':UPDATE_PATH},'warnings':[]},{'method':_0x11a111(0x1ee),'url':UPDATE_PATH});},async 'execute'(_0x577138){const _0x3b9a41=a195_0x57ef1c,_0xe0186=_0x577138[_0x3b9a41(0x1ff)]('id'),_0x19c361=readPatch(_0x577138),_0x43fdfc=await getRoleById(_0x577138['appCode'],_0xe0186);assertCustomRole(_0x43fdfc,_0x3b9a41(0x1ed)),await updateAppRole({'id':_0xe0186,'appCode':_0x577138[_0x3b9a41(0x1ef)],..._0x19c361[_0x3b9a41(0x1f0)]!==undefined?{'roleName':_0x19c361[_0x3b9a41(0x1f0)]}:{},..._0x19c361[_0x3b9a41(0x1f4)]!==undefined?{'remark':_0x19c361['remark']}:{}});const _0x2cad78=await getRoleById(_0x577138[_0x3b9a41(0x1ef)],_0xe0186);return{'ok':!![],'data':{'scope':_0x3b9a41(0x1eb),'operation':_0x3b9a41(0x1ed),'selector':{'appCode':_0x577138[_0x3b9a41(0x1ef)],'roleId':_0xe0186,'roleName':_0x2cad78[_0x3b9a41(0x1f0)]},'before':projectRole(_0x43fdfc),'after':projectRole(_0x2cad78),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':_0x3b9a41(0x1ec)+_0x2cad78[_0x3b9a41(0x1f0)]+'\x20(id='+_0xe0186+')'};}};
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
- function a196_0x3673(_0x30030f,_0x1d5799){_0x30030f=_0x30030f-0x9a;const _0x7ec589=a196_0x7ec5();let _0x36736a=_0x7ec589[_0x30030f];return _0x36736a;}const a196_0x58a552=a196_0x3673;(function(_0x3cf743,_0x3bd05b){const _0xa1751f=a196_0x3673,_0x420544=_0x3cf743();while(!![]){try{const _0x3c77a1=-parseInt(_0xa1751f(0xb1))/0x1*(-parseInt(_0xa1751f(0x9a))/0x2)+parseInt(_0xa1751f(0xa8))/0x3+parseInt(_0xa1751f(0x9d))/0x4+parseInt(_0xa1751f(0x9b))/0x5+parseInt(_0xa1751f(0xad))/0x6+parseInt(_0xa1751f(0xa3))/0x7*(-parseInt(_0xa1751f(0xa4))/0x8)+-parseInt(_0xa1751f(0xa9))/0x9;if(_0x3c77a1===_0x3bd05b)break;else _0x420544['push'](_0x420544['shift']());}catch(_0x6e520f){_0x420544['push'](_0x420544['shift']());}}}(a196_0x7ec5,0x235df));import{createDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a196_0x7ec5(){const _0x26410e=['1101702sPgTpJ','Added\x20user\x20','appCode','role','1MLLuXP','312178CRfBPd','868430Otdbcv','POST','571800kSVFZW','No\x20change:\x20user\x20','roleName','roleType','user-add','\x20to\x20role\x20','46193JYmrKo','152bbSmNp','Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','roleId','selector','809817AZRzXe','5904333oxqYNq','high-risk-write','userId','username'];a196_0x7ec5=function(){return _0x26410e;};return a196_0x7ec5();}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';export const roleUserAdd={'service':a196_0x58a552(0xb0),'command':a196_0x58a552(0xa1),'description':a196_0x58a552(0xa5),'risk':a196_0x58a552(0xaa),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x7cd13f){const _0x3d62c0=a196_0x58a552,{mutation:_0x2afa74}=await prepareUserMutation(_0x7cd13f,'user-add',!![]);return asDryRunResult(_0x2afa74,{'method':_0x3d62c0(0x9c),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x10a145){const _0x3b91f4=a196_0x58a552,{mutation:_0x11c146,changed:_0x384f26,role:_0x1c305e,user:_0x53d44e}=await prepareUserMutation(_0x10a145,_0x3b91f4(0xa1),![]);return _0x384f26&&await createDevUserRole({'appCode':_0x10a145[_0x3b91f4(0xaf)],'userId':_0x53d44e[_0x3b91f4(0xab)],'username':_0x53d44e[_0x3b91f4(0xac)],'roleType':_0x1c305e[_0x3b91f4(0xa0)],'roleId':_0x11c146[_0x3b91f4(0xa7)][_0x3b91f4(0xa6)]}),{'ok':!![],'data':_0x11c146,'message':_0x384f26?_0x3b91f4(0xae)+_0x11c146[_0x3b91f4(0xa7)][_0x3b91f4(0xab)]+_0x3b91f4(0xa2)+_0x11c146[_0x3b91f4(0xa7)]['roleName']:_0x3b91f4(0x9e)+_0x11c146['selector'][_0x3b91f4(0xab)]+'\x20already\x20in\x20role\x20'+_0x11c146[_0x3b91f4(0xa7)][_0x3b91f4(0x9f)]};}};
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
- function a197_0x1247(){const _0x2a3a4f=['Removed\x20user\x20','high-risk-write','1514mgOcoW','1116kSqZcg','No\x20change:\x20user\x20','user-remove','roleName','1026ZkBfiZ','712257gDfzlu','POST','1108430KJRyLY','88acHAeJ','104672gWQFUq','38085sVnnOS','userId','Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','20AMFAhN','role','5551147UxucfJ','selector','36958392OdgjuU','1603RZAYMg'];a197_0x1247=function(){return _0x2a3a4f;};return a197_0x1247();}function a197_0x1b33(_0x4ea181,_0x10c566){_0x4ea181=_0x4ea181-0xba;const _0x12472a=a197_0x1247();let _0x1b3361=_0x12472a[_0x4ea181];return _0x1b3361;}const a197_0x59273f=a197_0x1b33;(function(_0x482ca0,_0x55ac9d){const _0x2f3a4d=a197_0x1b33,_0x47a709=_0x482ca0();while(!![]){try{const _0x437724=parseInt(_0x2f3a4d(0xc8))/0x1*(parseInt(_0x2f3a4d(0xcb))/0x2)+parseInt(_0x2f3a4d(0xbb))/0x3*(parseInt(_0x2f3a4d(0xc3))/0x4)+-parseInt(_0x2f3a4d(0xc0))/0x5*(parseInt(_0x2f3a4d(0xba))/0x6)+-parseInt(_0x2f3a4d(0xc5))/0x7+parseInt(_0x2f3a4d(0xbf))/0x8*(-parseInt(_0x2f3a4d(0xcc))/0x9)+parseInt(_0x2f3a4d(0xbd))/0xa*(-parseInt(_0x2f3a4d(0xbe))/0xb)+parseInt(_0x2f3a4d(0xc7))/0xc;if(_0x437724===_0x55ac9d)break;else _0x47a709['push'](_0x47a709['shift']());}catch(_0x21e225){_0x47a709['push'](_0x47a709['shift']());}}}(a197_0x1247,0xd5ce0));import{deleteDevUserRole}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,DELETE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':a197_0x59273f(0xc4),'command':a197_0x59273f(0xce),'description':a197_0x59273f(0xc2),'risk':a197_0x59273f(0xca),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x554367){const _0x3767d5=a197_0x59273f,{mutation:_0x17193f}=await prepareUserMutation(_0x554367,_0x3767d5(0xce),!![]);return asDryRunResult(_0x17193f,{'method':_0x3767d5(0xbc),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x11714a){const _0x347f4d=a197_0x59273f,{matchingRelationIds:_0x135b54,mutation:_0x546822,changed:_0x16b536}=await prepareUserMutation(_0x11714a,_0x347f4d(0xce),![]);if(_0x16b536)for(const _0x4a920d of _0x135b54){await deleteDevUserRole(_0x4a920d);}return{'ok':!![],'data':_0x546822,'message':_0x16b536?_0x347f4d(0xc9)+_0x546822['selector'][_0x347f4d(0xc1)]+'\x20from\x20role\x20'+_0x546822[_0x347f4d(0xc6)][_0x347f4d(0xcf)]:_0x347f4d(0xcd)+_0x546822[_0x347f4d(0xc6)][_0x347f4d(0xc1)]+'\x20not\x20in\x20role\x20'+_0x546822[_0x347f4d(0xc6)][_0x347f4d(0xcf)]};}};
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
- function a198_0xa77f(){const _0x1ea0d4=['matchedBy','\x22\x20→\x20userId\x20','2517790rdcRgH','392EWCsSk','name','user-resolve','flagMissing','1269676jBaZwY','Resolved\x20\x22','Pass\x20--name\x20<nickname|username>.','read','Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.','1175904ubrpJJ','role','10496502fLhyVB','username','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','trim','1351984DoRGtK','9289aSAiCg','3823296oZlexu','str','userId','25IookBG'];a198_0xa77f=function(){return _0x1ea0d4;};return a198_0xa77f();}const a198_0x37c99c=a198_0x58d2;(function(_0x4809e4,_0x54b3f6){const _0x5c3f06=a198_0x58d2,_0x1cda5a=_0x4809e4();while(!![]){try{const _0xb3c46f=parseInt(_0x5c3f06(0x102))/0x1+parseInt(_0x5c3f06(0x10a))/0x2+parseInt(_0x5c3f06(0xfc))/0x3+-parseInt(_0x5c3f06(0xf7))/0x4*(parseInt(_0x5c3f06(0x107))/0x5)+parseInt(_0x5c3f06(0x104))/0x6+parseInt(_0x5c3f06(0x103))/0x7*(parseInt(_0x5c3f06(0x10b))/0x8)+-parseInt(_0x5c3f06(0xfe))/0x9;if(_0xb3c46f===_0x54b3f6)break;else _0x1cda5a['push'](_0x1cda5a['shift']());}catch(_0x4fc25a){_0x1cda5a['push'](_0x1cda5a['shift']());}}}(a198_0xa77f,0xe85a1));function a198_0x58d2(_0x30adb5,_0x4a03df){_0x30adb5=_0x30adb5-0xf5;const _0xa77ff0=a198_0xa77f();let _0x58d210=_0xa77ff0[_0x30adb5];return _0x58d210;}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a198_0x37c99c(0xfd),'command':a198_0x37c99c(0xf5),'description':a198_0x37c99c(0x100),'risk':a198_0x37c99c(0xfa),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2a6d79){const _0x10e01d=a198_0x37c99c;if(!_0x2a6d79[_0x10e01d(0x105)](_0x10e01d(0x10c))['trim']())throw CliErrors[_0x10e01d(0xf6)](_0x10e01d(0x10c),_0x10e01d(0xf9));},async 'execute'(_0x5d77ed){const _0x333b66=a198_0x37c99c,_0xf8bb02=_0x5d77ed[_0x333b66(0x105)](_0x333b66(0x10c))[_0x333b66(0x101)](),_0x69fe6c=await resolveUserRef(_0xf8bb02,_0x333b66(0xfb));return{'ok':!![],'data':{'user':{'userId':_0x69fe6c[_0x333b66(0x106)],'username':_0x69fe6c[_0x333b66(0xff)],'nickname':_0x69fe6c['nickname'],'matchedBy':_0x69fe6c[_0x333b66(0x108)]}},'message':_0x333b66(0xf8)+_0xf8bb02+_0x333b66(0x109)+_0x69fe6c[_0x333b66(0x106)]};}};
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_0x58a2a5=a199_0x4cd3;function a199_0x4cd3(_0x1be8ec,_0x57be68){_0x1be8ec=_0x1be8ec-0x189;const _0x4109f4=a199_0x4109();let _0x4cd383=_0x4109f4[_0x1be8ec];return _0x4cd383;}function a199_0x4109(){const _0x2a1fb2=['2GoFavV','\x20--file\x20<path>\x20--dry-run`.','\x20for\x20','14040342YERMah','10429140mMsXpP','rule','Get\x20one\x20agent\x20context\x20rule\x20for\x20the\x20resolved\x20app','8ySZLdD','3952953NlxyfV','get','1124613UPJead','appCode','cookie','66603DNHqrf','Create\x20it\x20with\x20`rabetbase\x20rule\x20set\x20--type\x20','content','read','1042315QoSZDX','7339464kCzFeI'];a199_0x4109=function(){return _0x2a1fb2;};return a199_0x4109();}(function(_0x595e78,_0xd2fec7){const _0x3c7991=a199_0x4cd3,_0x26b23e=_0x595e78();while(!![]){try{const _0x2e6bd3=parseInt(_0x3c7991(0x18d))/0x1*(parseInt(_0x3c7991(0x193))/0x2)+-parseInt(_0x3c7991(0x19b))/0x3+parseInt(_0x3c7991(0x19a))/0x4*(-parseInt(_0x3c7991(0x191))/0x5)+parseInt(_0x3c7991(0x197))/0x6+parseInt(_0x3c7991(0x18a))/0x7+-parseInt(_0x3c7991(0x192))/0x8+parseInt(_0x3c7991(0x196))/0x9;if(_0x2e6bd3===_0xd2fec7)break;else _0x26b23e['push'](_0x26b23e['shift']());}catch(_0xdb350c){_0x26b23e['push'](_0x26b23e['shift']());}}}(a199_0x4109,0xd5408));import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPE_FLAG,appRuleError,appRuleFileName,projectAppRule,readAppRuleType}from'../../commands/rule/shared.js';export const ruleGet={'service':a199_0x58a2a5(0x198),'command':a199_0x58a2a5(0x189),'description':a199_0x58a2a5(0x199),'risk':a199_0x58a2a5(0x190),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG],async 'validate'(_0x2746f2){readAppRuleType(_0x2746f2);},async 'execute'(_0x5a853a){const _0x1dc2ae=a199_0x58a2a5,_0x9672a=readAppRuleType(_0x5a853a),_0x54d848=await getAppRule(_0x5a853a[_0x1dc2ae(0x18c)],{'appCode':_0x5a853a[_0x1dc2ae(0x18b)],'type':_0x9672a});if(!_0x54d848)throw appRuleError('app_rule_not_found',appRuleFileName(_0x9672a)+'\x20is\x20not\x20configured\x20for\x20app\x20'+_0x5a853a[_0x1dc2ae(0x18b)]+'.',_0x1dc2ae(0x18e)+_0x9672a+_0x1dc2ae(0x194));return{'ok':!![],'data':{'rule':{...projectAppRule(_0x9672a,_0x54d848),'content':_0x54d848[_0x1dc2ae(0x18f)]}},'message':'Loaded\x20'+appRuleFileName(_0x9672a)+_0x1dc2ae(0x195)+_0x5a853a[_0x1dc2ae(0x18b)]};}};
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(_0x407408,_0x28a412){const _0x44afa0=a200_0xacd3,_0x4c07e8=_0x407408();while(!![]){try{const _0x379a9e=-parseInt(_0x44afa0(0x1cb))/0x1*(-parseInt(_0x44afa0(0x1c7))/0x2)+-parseInt(_0x44afa0(0x1c2))/0x3+-parseInt(_0x44afa0(0x1c4))/0x4+-parseInt(_0x44afa0(0x1ca))/0x5+-parseInt(_0x44afa0(0x1c8))/0x6*(-parseInt(_0x44afa0(0x1c5))/0x7)+parseInt(_0x44afa0(0x1c6))/0x8*(-parseInt(_0x44afa0(0x1c3))/0x9)+-parseInt(_0x44afa0(0x1cc))/0xa*(-parseInt(_0x44afa0(0x1c9))/0xb);if(_0x379a9e===_0x28a412)break;else _0x4c07e8['push'](_0x4c07e8['shift']());}catch(_0x555020){_0x4c07e8['push'](_0x4c07e8['shift']());}}}(a200_0x2f01,0x94eb6));function a200_0xacd3(_0x3cc47a,_0x1dcf4e){_0x3cc47a=_0x3cc47a-0x1c2;const _0x2f01e3=a200_0x2f01();let _0xacd3b6=_0x2f01e3[_0x3cc47a];return _0xacd3b6;}import{ruleGet}from'../../commands/rule/get.js';import{ruleList}from'../../commands/rule/list.js';import{ruleSet}from'../../commands/rule/set.js';function a200_0x2f01(){const _0x488634=['890kdHCJf','186456ZATApW','3663207sbHdNg','2929248ITyVhQ','254884zfIOXv','8LFqeXG','506eJXwot','48JShfLc','182523eOvnPP','1575565cHDxYd','1417aeJAYw'];a200_0x2f01=function(){return _0x488634;};return a200_0x2f01();}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
- const a201_0x35959a=a201_0x1355;(function(_0x5a536b,_0x381ce5){const _0x2dfab0=a201_0x1355,_0x259771=_0x5a536b();while(!![]){try{const _0x20fb7c=-parseInt(_0x2dfab0(0x1e4))/0x1*(parseInt(_0x2dfab0(0x1e7))/0x2)+-parseInt(_0x2dfab0(0x1f0))/0x3*(parseInt(_0x2dfab0(0x1e2))/0x4)+-parseInt(_0x2dfab0(0x1eb))/0x5+parseInt(_0x2dfab0(0x1e3))/0x6+parseInt(_0x2dfab0(0x1e6))/0x7+parseInt(_0x2dfab0(0x1f3))/0x8*(-parseInt(_0x2dfab0(0x1ea))/0x9)+parseInt(_0x2dfab0(0x1e1))/0xa*(parseInt(_0x2dfab0(0x1ee))/0xb);if(_0x20fb7c===_0x381ce5)break;else _0x259771['push'](_0x259771['shift']());}catch(_0x1ed0a4){_0x259771['push'](_0x259771['shift']());}}}(a201_0x5e95,0x67609));import{getAppRule}from'../../core/api-client.js';function a201_0x5e95(){const _0x46e473=['map','267971hutulp','appCode','2047995ZZKcPR','read','Loaded\x20app\x20rule\x20configuration\x20for\x20','252832djPotN','610oKaiYA','4kkoyOb','2409108wqPqJd','1rIYuYV','all','5038229FuyxoS','114986qRwAOc','rule','List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','171vtFZjk','4216095DjBpjT','cookie'];a201_0x5e95=function(){return _0x46e473;};return a201_0x5e95();}import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';function a201_0x1355(_0x7615f6,_0x18172f){_0x7615f6=_0x7615f6-0x1e1;const _0x5e95df=a201_0x5e95();let _0x135572=_0x5e95df[_0x7615f6];return _0x135572;}export const ruleList={'service':a201_0x35959a(0x1e8),'command':'list','description':a201_0x35959a(0x1e9),'risk':a201_0x35959a(0x1f1),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x1b53a4){const _0x67ad80=a201_0x35959a,_0x562f87=await Promise[_0x67ad80(0x1e5)](APP_RULE_TYPES[_0x67ad80(0x1ed)](_0x258439=>getAppRule(_0x1b53a4[_0x67ad80(0x1ec)],{'appCode':_0x1b53a4[_0x67ad80(0x1ef)],'type':_0x258439}))),_0x594955=APP_RULE_TYPES[_0x67ad80(0x1ed)]((_0x5e0dc8,_0x4eaa69)=>projectAppRule(_0x5e0dc8,_0x562f87[_0x4eaa69]??null));return{'ok':!![],'data':{'total':_0x594955['length'],'rules':_0x594955},'message':_0x67ad80(0x1f2)+_0x1b53a4[_0x67ad80(0x1ef)]};}};
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
- const a202_0x507f92=a202_0x3ab3;(function(_0x407a24,_0x530ffe){const _0x23704e=a202_0x3ab3,_0x588025=_0x407a24();while(!![]){try{const _0x2cf9b5=-parseInt(_0x23704e(0x111))/0x1+-parseInt(_0x23704e(0xe4))/0x2+-parseInt(_0x23704e(0xf8))/0x3*(parseInt(_0x23704e(0xe6))/0x4)+parseInt(_0x23704e(0x11a))/0x5*(-parseInt(_0x23704e(0xf3))/0x6)+parseInt(_0x23704e(0x100))/0x7+-parseInt(_0x23704e(0x114))/0x8*(parseInt(_0x23704e(0xe3))/0x9)+parseInt(_0x23704e(0x10b))/0xa;if(_0x2cf9b5===_0x530ffe)break;else _0x588025['push'](_0x588025['shift']());}catch(_0x560dff){_0x588025['push'](_0x588025['shift']());}}}(a202_0x19fb,0x8e7bb));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';function a202_0x19fb(){const _0x258d1e=['byteSize','set','verified','planned','34358300aOqwRo','number','cause','content','trim','type','1164157kGJJHX','rules','write','8XXzfqU','app_rule_expected_version_invalid','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20','defineProperty','\x20--format\x20compress','5mUIzGa','flag','7230807HAODxg','111122WTOkNi','rule','79832MFOUmX',';\x20current\x20version\x20is\x20','beforeRecord','\x20version\x20changed\x20before\x20write.','before','replacement','POST','app_rule_file_required','string','input','app_rule_verification_unavailable','appCode','contentHash','2638452xHhOdF','expected-version','cookie','UTF-8\x20Markdown\x20file\x20(maximum\x205\x20MiB)','app_rule_version_mismatch','171INqhkZ','app_rule_set_outcome_unknown','Non-atomic\x20preflight\x20assertion\x20for\x20the\x20current\x20version','version','Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.','expectedVersion','push','Set\x20','5237890FJKuiw','rabetbase\x20rule\x20get\x20--type\x20','Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','str','/smartapi/knowledge-base/save','--file\x20is\x20required.','file'];a202_0x19fb=function(){return _0x258d1e;};return a202_0x19fb();}const SAVE_PATH=a202_0x507f92(0x104),NON_ATOMIC_WARNING='--expected-version\x20is\x20a\x20non-atomic\x20read-before-write\x20assertion;\x20the\x20server\x20save\x20contract\x20has\x20no\x20version\x20predicate.';function readSetInput(_0x31e074){const _0x520740=a202_0x507f92,_0x37e6b5=readAppRuleType(_0x31e074),_0x5cdff0=_0x31e074[_0x520740(0x103)](_0x520740(0x106))[_0x520740(0x10f)]();if(!_0x5cdff0)throw appRuleError(_0x520740(0xed),_0x520740(0x105),'Pass\x20a\x20UTF-8\x20Markdown\x20file.');const _0x509e68=_0x31e074[_0x520740(0xe2)](_0x520740(0xf4));let _0x546a64;if(_0x509e68!==undefined){_0x546a64=Number(_0x509e68);if(!Number['isSafeInteger'](_0x546a64)||_0x546a64<0x0)throw appRuleError(_0x520740(0x115),'--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.');}return{'type':_0x37e6b5,'file':_0x5cdff0,'expectedVersion':_0x546a64};}async function prepareSet(_0x33ebee){const _0x20f9e3=a202_0x507f92,_0x582341=readSetInput(_0x33ebee),_0xac89c=await readAppRuleFile(_0x582341[_0x20f9e3(0x106)]),_0x43c2c3=await getAppRule(_0x33ebee['cookie'],{'appCode':_0x33ebee[_0x20f9e3(0xf1)],'type':_0x582341['type']});if(_0x582341[_0x20f9e3(0xfd)]!==undefined&&_0x43c2c3?.[_0x20f9e3(0xfb)]!==_0x582341[_0x20f9e3(0xfd)])throw appRuleError(_0x20f9e3(0xf7),appRuleFileName(_0x582341[_0x20f9e3(0x110)])+_0x20f9e3(0xe9),'Expected\x20'+_0x582341['expectedVersion']+_0x20f9e3(0xe7)+(_0x43c2c3?.[_0x20f9e3(0xfb)]??'unconfigured')+'.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.');return{'input':_0x582341,'replacement':_0xac89c,'beforeRecord':_0x43c2c3,'before':projectAppRule(_0x582341[_0x20f9e3(0x110)],_0x43c2c3),'planned':{'type':_0x582341[_0x20f9e3(0x110)],'fileName':appRuleFileName(_0x582341['type']),'contextScope':appRuleContextScope(_0x582341[_0x20f9e3(0x110)]),'enabled':!![],'appCode':_0x33ebee[_0x20f9e3(0xf1)],'scope':_0x20f9e3(0x112),'contentByteSize':_0xac89c[_0x20f9e3(0x107)],'contentHash':_0xac89c[_0x20f9e3(0xf2)]}};}function warningsFor(_0x586760){return _0x586760===undefined?[]:[NON_ATOMIC_WARNING];}function a202_0x3ab3(_0x72c628,_0x222bb3){_0x72c628=_0x72c628-0xe2;const _0x19fbec=a202_0x19fb();let _0x3ab31a=_0x19fbec[_0x72c628];return _0x3ab31a;}export const ruleSet={'service':a202_0x507f92(0xe5),'command':'set','description':a202_0x507f92(0x102),'risk':a202_0x507f92(0x113),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':a202_0x507f92(0x106),'type':a202_0x507f92(0xee),'required':!![],'description':a202_0x507f92(0xf6)},{'name':a202_0x507f92(0xf4),'type':a202_0x507f92(0x10c),'required':![],'description':a202_0x507f92(0xfa)}],async 'validate'(_0x381b56){readSetInput(_0x381b56);},async 'dryRun'(_0x28d281){const _0x25f6db=a202_0x507f92,_0x2e4f5d=await prepareSet(_0x28d281);return asDryRunResult({'operation':_0x25f6db(0x108),'selector':{'appCode':_0x28d281[_0x25f6db(0xf1)],'scope':_0x25f6db(0x112),'type':_0x2e4f5d[_0x25f6db(0xef)][_0x25f6db(0x110)]},'before':_0x2e4f5d[_0x25f6db(0xea)],'after':_0x2e4f5d[_0x25f6db(0x10a)],'dryRun':!![],'backend':{'method':'POST','path':SAVE_PATH},'warnings':warningsFor(_0x2e4f5d[_0x25f6db(0xef)][_0x25f6db(0xfd)]),'verification':{'expectedVersion':_0x2e4f5d[_0x25f6db(0xef)][_0x25f6db(0xfd)]??null,'atomicCompareAndSet':![],'lookupCommand':'rabetbase\x20rule\x20get\x20--type\x20'+_0x2e4f5d['input']['type']+_0x25f6db(0x119)}},{'method':'POST','url':SAVE_PATH});},async 'execute'(_0x2e21d7){const _0x12eeca=a202_0x507f92,_0x21566d=await prepareSet(_0x2e21d7);let _0x5d6cfc=![];try{await saveAppRule(_0x2e21d7['cookie'],{'appCode':_0x2e21d7['appCode'],'type':_0x21566d[_0x12eeca(0xef)][_0x12eeca(0x110)],'content':_0x21566d[_0x12eeca(0xeb)][_0x12eeca(0x10e)]});}catch(_0x25af34){if(!isPlatformTransportFailure(_0x25af34))throw _0x25af34;_0x5d6cfc=!![];}let _0x4c62c6;try{_0x4c62c6=await getAppRule(_0x2e21d7[_0x12eeca(0xf5)],{'appCode':_0x2e21d7[_0x12eeca(0xf1)],'type':_0x21566d['input'][_0x12eeca(0x110)]});}catch(_0xc22b2d){const _0x474732=appRuleError(_0x5d6cfc?_0x12eeca(0xf9):_0x12eeca(0xf0),'The\x20set\x20request\x20was\x20sent,\x20but\x20'+appRuleFileName(_0x21566d['input'][_0x12eeca(0x110)])+'\x20could\x20not\x20be\x20verified.',_0x12eeca(0xfc));Object[_0x12eeca(0x118)](_0x474732,_0x12eeca(0x10d),{'value':_0xc22b2d,'enumerable':![]});throw _0x474732;}const _0x47cf7d=_0x4c62c6&&inspectAppRuleContent(_0x4c62c6[_0x12eeca(0x10e)])[_0x12eeca(0xf2)]===_0x21566d[_0x12eeca(0xeb)][_0x12eeca(0xf2)],_0x3355be=_0x4c62c6&&(_0x21566d[_0x12eeca(0xe8)]===null||_0x4c62c6[_0x12eeca(0xfb)]>_0x21566d[_0x12eeca(0xe8)][_0x12eeca(0xfb)]);if(!_0x4c62c6||!_0x47cf7d||!_0x3355be)throw appRuleError(_0x5d6cfc?_0x12eeca(0xf9):'app_rule_verification_failed',appRuleFileName(_0x21566d[_0x12eeca(0xef)][_0x12eeca(0x110)])+'\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.',_0x12eeca(0x117)+_0x21566d[_0x12eeca(0xef)][_0x12eeca(0x110)]+_0x12eeca(0x116));const _0x8e8e40=warningsFor(_0x21566d[_0x12eeca(0xef)][_0x12eeca(0xfd)]);_0x5d6cfc&&_0x8e8e40[_0x12eeca(0xfe)]('Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.');const _0x59f9d7=projectAppRule(_0x21566d[_0x12eeca(0xef)][_0x12eeca(0x110)],_0x4c62c6);return{'ok':!![],'data':{'operation':_0x12eeca(0x108),'selector':{'appCode':_0x2e21d7[_0x12eeca(0xf1)],'scope':'rules','type':_0x21566d[_0x12eeca(0xef)][_0x12eeca(0x110)]},'before':_0x21566d[_0x12eeca(0xea)],'after':_0x59f9d7,'dryRun':![],'backend':{'method':_0x12eeca(0xec),'path':SAVE_PATH},'warnings':_0x8e8e40,'verification':{'status':_0x12eeca(0x109),'recoveredAfterUnknownResponse':_0x5d6cfc,'expectedVersion':_0x21566d['input'][_0x12eeca(0xfd)]??null,'atomicCompareAndSet':![],'lookupCommand':_0x12eeca(0x101)+_0x21566d[_0x12eeca(0xef)][_0x12eeca(0x110)]+_0x12eeca(0x119)}},'message':_0x12eeca(0xff)+appRuleFileName(_0x21566d[_0x12eeca(0xef)][_0x12eeca(0x110)])+'\x20for\x20'+_0x2e21d7[_0x12eeca(0xf1)]};}};
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_0x4b94c7=a203_0x489f;(function(_0x40a89e,_0x41ad44){const _0x385714=a203_0x489f,_0x6f958d=_0x40a89e();while(!![]){try{const _0x64fb07=parseInt(_0x385714(0x90))/0x1*(-parseInt(_0x385714(0xb4))/0x2)+parseInt(_0x385714(0xb0))/0x3+parseInt(_0x385714(0x9c))/0x4+-parseInt(_0x385714(0xb5))/0x5+-parseInt(_0x385714(0xac))/0x6+parseInt(_0x385714(0x99))/0x7+parseInt(_0x385714(0xb8))/0x8;if(_0x64fb07===_0x41ad44)break;else _0x6f958d['push'](_0x6f958d['shift']());}catch(_0x4d351d){_0x6f958d['push'](_0x6f958d['shift']());}}}(a203_0x238e,0x498b3));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_0x4b94c7(0xae),'database'];export const MAX_APP_RULE_BYTES=0x5*0x400*0x400;function a203_0x489f(_0x26c6c2,_0x4b6db7){_0x26c6c2=_0x26c6c2-0x8a;const _0x238edd=a203_0x238e();let _0x489f26=_0x238edd[_0x26c6c2];return _0x489f26;}const APP_RULE_FILES={'rules':a203_0x4b94c7(0xa1),'database':a203_0x4b94c7(0xaa)},APP_RULE_CONTEXT_SCOPES={'rules':a203_0x4b94c7(0x93),'database':'database-analysis'};export function appRuleError(_0xe2d1e2,_0x1367dd,_0x313732){return new CliError(_0xe2d1e2,0x1,_0x1367dd,_0x313732);}export function readAppRuleType(_0x3181bb){const _0x2e2930=a203_0x4b94c7,_0x300b23=_0x3181bb[_0x2e2930(0x8a)](_0x2e2930(0x91))[_0x2e2930(0xaf)]()['toLowerCase']();if(_0x300b23!=='rules'&&_0x300b23!==_0x2e2930(0xb3))throw appRuleError(_0x2e2930(0xb1),'--type\x20must\x20be\x20either\x20rules\x20or\x20database.');return _0x300b23;}export function appRuleFileName(_0x31524c){return APP_RULE_FILES[_0x31524c];}function a203_0x238e(){const _0x4038fc=['DATABASE.md','updateTime','2158914fDaPUD','byteSize','rules','trim','338421jtqfdv','app_rule_type_invalid','app_rule_file_required','database','86790SKdbuU','2463005gGtAqe','app_rule_file_invalid','app_rule_file_unreadable','1299248FZBvjs','str','scope','utf-8','createTime','appCode','Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','1RPZoWi','type','contentHash','page-api-development','App\x20rule\x20content\x20exceeds\x20the\x205\x20MiB\x20server\x20limit.','size','from','App\x20rule\x20file\x20is\x20blank:\x20','Pass\x20a\x20UTF-8\x20Markdown\x20file.','2353645ssNgdz','app_rule_content_invalid','version','2342408bWGclw','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','isFile','utf8','update','RULES.md','string','message','decode','sha256','App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','byteLength','digest','app_rule_content_too_large'];a203_0x238e=function(){return _0x4038fc;};return a203_0x238e();}export function appRuleContextScope(_0x36350e){return APP_RULE_CONTEXT_SCOPES[_0x36350e];}export function inspectAppRuleContent(_0x262cd7){const _0xe8ffaa=a203_0x4b94c7,_0x47e83b=Buffer[_0xe8ffaa(0x96)](_0x262cd7,_0xe8ffaa(0x9f));return{'content':_0x262cd7,'byteSize':_0x47e83b[_0xe8ffaa(0xa7)],'contentHash':'sha256:'+createHash(_0xe8ffaa(0xa5))[_0xe8ffaa(0xa0)](_0x47e83b)[_0xe8ffaa(0xa8)]('hex')};}export async function readAppRuleFile(_0x19d910){const _0x211cbb=a203_0x4b94c7,_0xa21406=_0x19d910[_0x211cbb(0xaf)]();if(!_0xa21406)throw appRuleError(_0x211cbb(0xb2),'--file\x20is\x20required.',_0x211cbb(0x98));const _0x1c9222=resolve(_0xa21406);let _0x1acb3c;try{_0x1acb3c=await stat(_0x1c9222);}catch(_0x1cdc79){throw appRuleError(_0x211cbb(0xb7),'Cannot\x20access\x20app\x20rule\x20file:\x20'+_0xa21406,_0x1cdc79 instanceof Error?_0x1cdc79[_0x211cbb(0xa3)]:String(_0x1cdc79));}if(!_0x1acb3c[_0x211cbb(0x9e)]())throw appRuleError(_0x211cbb(0xb6),_0x211cbb(0x9d)+_0xa21406);if(_0x1acb3c[_0x211cbb(0x95)]>MAX_APP_RULE_BYTES)throw appRuleError('app_rule_content_too_large','App\x20rule\x20content\x20exceeds\x20the\x205\x20MiB\x20server\x20limit.');let _0x2e5dd2;try{_0x2e5dd2=await readFile(_0x1c9222);}catch(_0x1aa05d){throw appRuleError(_0x211cbb(0xb7),'Cannot\x20read\x20app\x20rule\x20file:\x20'+_0xa21406,_0x1aa05d instanceof Error?_0x1aa05d[_0x211cbb(0xa3)]:String(_0x1aa05d));}if(_0x2e5dd2[_0x211cbb(0xa7)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x211cbb(0xa9),_0x211cbb(0x94));let _0x3e5f54;try{_0x3e5f54=new TextDecoder(_0x211cbb(0x8c),{'fatal':!![],'ignoreBOM':!![]})[_0x211cbb(0xa4)](_0x2e5dd2);}catch{throw appRuleError(_0x211cbb(0x9a),_0x211cbb(0xa6)+_0xa21406);}if(!_0x3e5f54[_0x211cbb(0xaf)]())throw appRuleError('app_rule_content_invalid',_0x211cbb(0x97)+_0xa21406);return inspectAppRuleContent(_0x3e5f54);}export function projectAppRule(_0x523737,_0x46bed2){const _0x24121f=a203_0x4b94c7;if(!_0x46bed2)return{'type':_0x523737,'fileName':appRuleFileName(_0x523737),'contextScope':appRuleContextScope(_0x523737),'enabled':![]};const _0x45190c=inspectAppRuleContent(_0x46bed2['content']);return{'type':_0x523737,'fileName':appRuleFileName(_0x523737),'contextScope':appRuleContextScope(_0x523737),'enabled':!![],'id':_0x46bed2['id'],'scope':_0x46bed2[_0x24121f(0x8b)],'appCode':_0x46bed2[_0x24121f(0x8e)],'version':_0x46bed2[_0x24121f(0x9b)],'contentByteSize':_0x45190c[_0x24121f(0xad)],'contentHash':_0x45190c[_0x24121f(0x92)],..._0x46bed2[_0x24121f(0x8d)]!==undefined&&_0x46bed2['createTime']!==null?{'createTime':_0x46bed2[_0x24121f(0x8d)]}:{},..._0x46bed2['updateTime']!==undefined&&_0x46bed2[_0x24121f(0xab)]!==null?{'updateTime':_0x46bed2[_0x24121f(0xab)]}:{}};}export const APP_RULE_TYPE_FLAG={'name':a203_0x4b94c7(0x91),'type':a203_0x4b94c7(0xa2),'required':!![],'description':a203_0x4b94c7(0x8f),'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_0x540963=a204_0xab91;(function(_0xef1f1d,_0x3b212a){const _0x4a5e91=a204_0xab91,_0x52c6ed=_0xef1f1d();while(!![]){try{const _0x5a0809=parseInt(_0x4a5e91(0x79))/0x1+-parseInt(_0x4a5e91(0x94))/0x2*(-parseInt(_0x4a5e91(0x9d))/0x3)+parseInt(_0x4a5e91(0xa5))/0x4*(-parseInt(_0x4a5e91(0x8e))/0x5)+parseInt(_0x4a5e91(0xaa))/0x6*(-parseInt(_0x4a5e91(0x7d))/0x7)+parseInt(_0x4a5e91(0x9e))/0x8+-parseInt(_0x4a5e91(0x8d))/0x9*(-parseInt(_0x4a5e91(0x9a))/0xa)+-parseInt(_0x4a5e91(0x83))/0xb;if(_0x5a0809===_0x3b212a)break;else _0x52c6ed['push'](_0x52c6ed['shift']());}catch(_0x4b80e5){_0x52c6ed['push'](_0x52c6ed['shift']());}}}(a204_0x4a9c,0x56740));import{readFileSync,existsSync}from'node:fs';function a204_0xab91(_0x49b0d0,_0x540329){_0x49b0d0=_0x49b0d0-0x76;const _0x4a9c69=a204_0x4a9c();let _0xab9139=_0x4a9c69[_0x49b0d0];return _0xab9139;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{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_0x540963(0x89),a204_0x540963(0xa6)]),DOMAIN_ROUTING_SYNC_SCRIPTS=new Set(['start',a204_0x540963(0xa6),a204_0x540963(0x8b),a204_0x540963(0x7e)]);export function syncProjectDomainRoutingBeforeScript(_0x4e999f,_0x4107a3){const _0x3d6d00=a204_0x540963;if(!DOMAIN_ROUTING_SYNC_SCRIPTS[_0x3d6d00(0x96)](_0x4107a3))return null;const _0x273a01=findProjectRootDirectory(_0x4e999f);if(!resolveConfigPath(_0x273a01))return null;const _0x147261=writeProjectDomainRoutingManifest(_0x273a01);return{'path':_0x147261[_0x3d6d00(0xb9)],'changed':_0x147261[_0x3d6d00(0x99)]};}function readPackageScripts(_0x49d43a){const _0x4ea66e=a204_0x540963,_0x5d9ab8=resolve(_0x49d43a,_0x4ea66e(0xb3));if(!existsSync(_0x5d9ab8))return null;try{const _0x1b56a6=JSON['parse'](readFileSync(_0x5d9ab8,_0x4ea66e(0xad)));return _0x1b56a6[_0x4ea66e(0x76)]??{};}catch{return null;}}function detectPackageManager(_0x5dd17d){const _0x481571=a204_0x540963;if(existsSync(resolve(_0x5dd17d,_0x481571(0xae)))||existsSync(resolve(_0x5dd17d,_0x481571(0x88))))return _0x481571(0x77);if(existsSync(resolve(_0x5dd17d,_0x481571(0xaf))))return _0x481571(0x91);if(existsSync(resolve(_0x5dd17d,'yarn.lock')))return'yarn';return'npm';}async function versionCheck(_0x59260c){const _0x5c70da=a204_0x540963,_0x157839=await checkCliVersion();(_0x157839[_0x5c70da(0x97)]||_0x157839[_0x5c70da(0xa7)])&&(printCliUpgradeWarning(_0x157839),assertCliVersionSupported(_0x157839));const _0x5373f7=await checkSdkVersion(_0x59260c);if(_0x5373f7['needsUpgrade'])printSdkUpgradeWarning(_0x5373f7);}function spawnScript(_0x218aee,_0x31cec8,_0x2dcf02,_0x2e8fa5){return new Promise((_0x54199e,_0x160e54)=>{const _0xba4776=a204_0xab91,_0x485727=[_0xba4776(0x95),_0x31cec8,..._0x2dcf02],_0x4a3b24=spawn(_0x218aee,_0x485727,{'cwd':_0x2e8fa5,'stdio':_0xba4776(0xb6),'shell':!![],'env':{...process.env,'PATH':''+join(_0x2e8fa5,_0xba4776(0xb4),'.bin')+delimiter+process.env.PATH}});_0x4a3b24['on'](_0xba4776(0xb2),_0x4766e5=>{const _0x318f4d=_0xba4776;if(_0x4766e5===0x0||_0x4766e5===null)_0x54199e();else _0x160e54(new Error(_0x218aee+_0x318f4d(0x9c)+_0x31cec8+_0x318f4d(0xb0)+_0x4766e5));}),_0x4a3b24['on']('error',_0x160e54);});}function spawnViteBuildWatch(_0xc393fe){return new Promise((_0x468ea9,_0x2028de)=>{const _0x30409d=a204_0xab91,_0x2d829a=spawn(_0x30409d(0x7f),[_0x30409d(0x8b),_0x30409d(0x90)],{'cwd':_0xc393fe,'stdio':_0x30409d(0xb6),'shell':!![],'env':{...process.env,'PATH':''+join(_0xc393fe,'node_modules',_0x30409d(0x9f))+delimiter+process.env.PATH}});_0x2d829a['on'](_0x30409d(0xb2),_0x17c462=>{if(_0x17c462===0x0||_0x17c462===null)_0x468ea9();else _0x2028de(new Error('vite\x20build\x20--watch\x20exited\x20with\x20code\x20'+_0x17c462));}),_0x2d829a['on']('error',_0x2028de);});}function a204_0x4a9c(){const _0x28fa18=['validation','3609puOxZu','10Zhioyl','Script\x20\x22','--watch','pnpm','boolean','error','953222qfBZVH','run','has','needsUpgrade','No\x20scripts\x20defined\x20in\x20package.json.','changed','13980ILPQSw','cwd','\x20run\x20','3BCcTdv','5437696UjPtVe','.bin','log','vite\x20preview\x20exited\x20with\x20code\x20','Domain\x20routing\x20synchronized:\x20','watch','push','82308cqVJJz','dev','belowMinimum','\x22\x20not\x20found\x20in\x20package.json.','all','1104Bzgebx','\x20run\x20preview\x20--watch','\x20\x20\x20\x20','utf-8','bun.lockb','pnpm-lock.yaml','\x20exited\x20with\x20code\x20','length','close','package.json','node_modules','write','inherit','No\x20package.json\x20found\x20in\x20current\x20directory.','Script\x20name\x20defined\x20in\x20package.json','path','scripts','bun','\x20\x20EXAMPLES','475775dnbBNJ','\x20run\x20start','\x0a\x20\x20Available\x20scripts:\x0a','\x20run\x20preview','4844VxvRSE','preview','vite','(none)','script','bool','18371122tAChfs','args','slice','join','Enable\x20watch\x20mode\x20for\x20preview','bun.lock','start','keys','build'];a204_0x4a9c=function(){return _0x28fa18;};return a204_0x4a9c();}function spawnVitePreview(_0x4ea746){return new Promise((_0x47bfd4,_0x22ab4c)=>{const _0x2cd0b5=a204_0xab91,_0xc0d0fc=spawn(_0x2cd0b5(0x7f),[_0x2cd0b5(0x7e)],{'cwd':_0x4ea746,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x4ea746,_0x2cd0b5(0xb4),'.bin')+delimiter+process.env.PATH}});_0xc0d0fc['on']('close',_0x3856ee=>{const _0x43dd43=_0x2cd0b5;if(_0x3856ee===0x0||_0x3856ee===null)_0x47bfd4();else _0x22ab4c(new Error(_0x43dd43(0xa1)+_0x3856ee));}),_0xc0d0fc['on'](_0x2cd0b5(0x93),_0x22ab4c);});}const runFlags=[{'name':a204_0x540963(0xa3),'type':a204_0x540963(0x92),'description':a204_0x540963(0x87),'default':![]}];export const runDefinition={'service':'run','command':a204_0x540963(0x95),'description':'Run\x20a\x20package.json\x20script','risk':a204_0x540963(0xb5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a204_0x540963(0x81),'description':a204_0x540963(0xb8),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x5be92c=a204_0x540963,_0x22ead8=[];return _0x22ead8[_0x5be92c(0xa4)](_0x5be92c(0x78)),_0x22ead8[_0x5be92c(0xa4)](_0x5be92c(0xac)+CLI_BIN_NAME+_0x5be92c(0x7a)),_0x22ead8['push'](_0x5be92c(0xac)+CLI_BIN_NAME+'\x20run\x20build'),_0x22ead8[_0x5be92c(0xa4)](_0x5be92c(0xac)+CLI_BIN_NAME+_0x5be92c(0x7c)),_0x22ead8[_0x5be92c(0xa4)](_0x5be92c(0xac)+CLI_BIN_NAME+_0x5be92c(0xab)),_0x22ead8[_0x5be92c(0x86)]('\x0a');},async 'execute'(_0x396885){const _0x2be0b3=a204_0x540963,_0x84a863=process[_0x2be0b3(0x9b)](),_0x5e0e79=_0x396885['args'][0x0],_0x5a7bb3=_0x396885[_0x2be0b3(0x84)][_0x2be0b3(0x85)](0x1),_0x1d02e9=readPackageScripts(_0x84a863);if(!_0x1d02e9)throw CliErrors[_0x2be0b3(0x8c)](_0x2be0b3(0xb7));if(!_0x5e0e79){const _0x348d77=Object[_0x2be0b3(0x8a)](_0x1d02e9);if(_0x348d77[_0x2be0b3(0xb1)]===0x0)console[_0x2be0b3(0xa0)](_0x2be0b3(0x98));else{console[_0x2be0b3(0xa0)](_0x2be0b3(0x7b));for(const _0xf2e704 of _0x348d77){console[_0x2be0b3(0xa0)](_0x2be0b3(0xac)+_0xf2e704);}console['log']('\x0a\x20\x20Usage:\x20'+CLI_BIN_NAME+'\x20run\x20<script>\x0a');}return{'ok':!![]};}if(!_0x1d02e9[_0x5e0e79])throw CliErrors[_0x2be0b3(0x8c)](_0x2be0b3(0x8f)+_0x5e0e79+_0x2be0b3(0xa8),'Available:\x20'+(Object[_0x2be0b3(0x8a)](_0x1d02e9)[_0x2be0b3(0x86)](',\x20')||_0x2be0b3(0x80)));const _0x54b48f=detectPackageManager(_0x84a863),_0x293095=syncProjectDomainRoutingBeforeScript(_0x84a863,_0x5e0e79);_0x293095?.[_0x2be0b3(0x99)]&&console[_0x2be0b3(0x93)](_0x2be0b3(0xa2)+_0x293095[_0x2be0b3(0xb9)]);VERSION_CHECK_SCRIPTS['has'](_0x5e0e79)&&await versionCheck(_0x84a863);if(_0x5e0e79===_0x2be0b3(0x7e)&&_0x396885[_0x2be0b3(0x82)]('watch'))return await Promise[_0x2be0b3(0xa9)]([spawnViteBuildWatch(_0x84a863),spawnVitePreview(_0x84a863)]),{'ok':!![]};return await spawnScript(_0x54b48f,_0x5e0e79,_0x5a7bb3,_0x84a863),{'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_0x2f3c79=a205_0x219f;function a205_0x219f(_0x5b4e82,_0x2f5ab9){_0x5b4e82=_0x5b4e82-0x109;const _0x56568f=a205_0x5656();let _0x219f89=_0x56568f[_0x5b4e82];return _0x219f89;}function a205_0x5656(){const _0x14fed5=['9163520CNtwTV','15YTOwCy','9403471RACogE','schema','436116PuLWcj','1422850UROebp','30vpghyF','945320EleTBW','18KnFLMb','240420GRFjde','export','2248821Jzrlyj'];a205_0x5656=function(){return _0x14fed5;};return a205_0x5656();}(function(_0x3b6b0a,_0x5f1a8f){const _0x50ac25=a205_0x219f,_0x5784a0=_0x3b6b0a();while(!![]){try{const _0xc06fac=-parseInt(_0x50ac25(0x10d))/0x1+-parseInt(_0x50ac25(0x112))/0x2+parseInt(_0x50ac25(0x10a))/0x3*(parseInt(_0x50ac25(0x110))/0x4)+-parseInt(_0x50ac25(0x10e))/0x5*(parseInt(_0x50ac25(0x111))/0x6)+parseInt(_0x50ac25(0x10b))/0x7+-parseInt(_0x50ac25(0x109))/0x8+parseInt(_0x50ac25(0x114))/0x9*(parseInt(_0x50ac25(0x10f))/0xa);if(_0xc06fac===_0x5f1a8f)break;else _0x5784a0['push'](_0x5784a0['shift']());}catch(_0x519961){_0x5784a0['push'](_0x5784a0['shift']());}}}(a205_0x5656,0xaf91e));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x3b24b1){const _0x25a614=await buildSchemaPayload();return{'ok':!![],'data':_0x25a614};}export const schemaDefinition={'service':a205_0x2f3c79(0x10c),'command':a205_0x2f3c79(0x113),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':'json','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_0x1cf83b=a206_0x2785;(function(_0x17ed89,_0xc12730){const _0x1c7d0c=a206_0x2785,_0x274bb1=_0x17ed89();while(!![]){try{const _0x42261d=parseInt(_0x1c7d0c(0xb9))/0x1*(-parseInt(_0x1c7d0c(0x8b))/0x2)+parseInt(_0x1c7d0c(0xa5))/0x3*(parseInt(_0x1c7d0c(0xa0))/0x4)+-parseInt(_0x1c7d0c(0xbf))/0x5*(-parseInt(_0x1c7d0c(0xb5))/0x6)+-parseInt(_0x1c7d0c(0xb0))/0x7*(parseInt(_0x1c7d0c(0xa4))/0x8)+parseInt(_0x1c7d0c(0x82))/0x9+parseInt(_0x1c7d0c(0xb8))/0xa+parseInt(_0x1c7d0c(0x88))/0xb*(-parseInt(_0x1c7d0c(0x9a))/0xc);if(_0x42261d===_0xc12730)break;else _0x274bb1['push'](_0x274bb1['shift']());}catch(_0x319ab0){_0x274bb1['push'](_0x274bb1['shift']());}}}(a206_0xac97,0xc61cd));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a206_0x2785(_0x291cfd,_0x46d54f){_0x291cfd=_0x291cfd-0x82;const _0xac97a1=a206_0xac97();let _0x2785e6=_0xac97a1[_0x291cfd];return _0x2785e6;}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 a206_0xac97(){const _0x114d4c=['SQL\x20name\x20cannot\x20be\x20empty','\x20\x20SELECT\x201\x20AS\x20id','string','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','isInteger','6223cmwTuL','toISOString','number','dbName','File\x20already\x20exists:\x20','209958JVKUjB','lastSync','utf8','10005940otdiCN','587464mnicGH','dbId\x20cannot\x20be\x20empty','sqlRootDir','For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly','str','sqlName','135gxBUzu','parse','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','sqlCode','dbId','10835559ccIrYF','length','Target\x20database\x20dbId:','sqlRoot','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','/smartapi/custom/saveUserCustomSql','1117391SJnAar','flag','Plain\x20SQL\x20(sql)','2okYKAs','flagMissing','validation','trim','name','Select\x20the\x20target\x20database:','isFinite','catch','nonInteractive','mybatisXml','mode','appCode','Select\x20the\x20local\x20SQL\x20mode:','SELECT\x201\x20AS\x20id;','Created\x20SQL\x20query\x20','204pbQZMk','db-id','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','stringify','join','POST','334120oLEZoY','Invalid\x20database\x20selection\x20payload:\x20','create','Local\x20SQL\x20file\x20mode','9232hotoSY','36jqNiXY','</select>','sql','map','dbId\x20must\x20be\x20a\x20positive\x20integer','__manual__'];a206_0xac97=function(){return _0x114d4c;};return a206_0xac97();}function generateSqlTemplate(_0x3c4d60){const _0x1948fc=a206_0x2785;if(_0x3c4d60===_0x1948fc(0x94))return['<select\x20id=\x22query\x22\x20resultType=\x22map\x22>',_0x1948fc(0xac),_0x1948fc(0xa6),''][_0x1948fc(0x9e)]('\x0a');return[_0x1948fc(0x98),''][_0x1948fc(0x9e)]('\x0a');}export const sqlCreate={'service':a206_0x1cf83b(0xa7),'command':a206_0x1cf83b(0xa2),'description':a206_0x1cf83b(0x9c),'risk':'write','flags':[{'name':a206_0x1cf83b(0x8f),'type':a206_0x1cf83b(0xad),'description':'SQL\x20query\x20display\x20name'},{'name':a206_0x1cf83b(0x9b),'type':a206_0x1cf83b(0xb2),'description':'Target\x20database\x20ID'},{'name':a206_0x1cf83b(0x95),'type':a206_0x1cf83b(0xad),'enum':[a206_0x1cf83b(0xa7),a206_0x1cf83b(0x94)],'description':a206_0x1cf83b(0xa3)}],async 'validate'(_0x6b9cc1){const _0x51025f=a206_0x1cf83b;if(!_0x6b9cc1[_0x51025f(0x93)])return;if(!_0x6b9cc1[_0x51025f(0xbd)](_0x51025f(0x8f))[_0x51025f(0x8e)]())throw CliErrors[_0x51025f(0x8c)](_0x51025f(0x8f),_0x51025f(0x86));const _0x1653fb=resolveProvidedDbId(_0x6b9cc1);if(typeof _0x1653fb!==_0x51025f(0xb2)||!Number[_0x51025f(0x91)](_0x1653fb)||_0x1653fb<=0x0)throw CliErrors[_0x51025f(0x8c)](_0x51025f(0x9b),_0x51025f(0xc1));if(!_0x6b9cc1[_0x51025f(0xbd)](_0x51025f(0x95))[_0x51025f(0x8e)]())throw CliErrors[_0x51025f(0x8c)](_0x51025f(0x95),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0x57f7b0){const _0x2fa7d0=a206_0x1cf83b,_0x230aa7=loadSqlProjectConfig(_0x57f7b0[_0x2fa7d0(0x96)]),{sqlName:_0x5c94a5,dbId:_0x10b97b,dbName:_0x2ff289,mode:_0x2b8a35}=await resolveSqlNewInputs(_0x57f7b0),_0x240f76=buildSqlRelativePath('<server-generated-sqlCode>',_0x5c94a5,_0x2ff289,_0x2b8a35,_0x10b97b),_0x5f5d08=_0x230aa7[_0x2fa7d0(0xbb)]+'/'+_0x240f76;return{'method':_0x2fa7d0(0x9f),'url':_0x2fa7d0(0x87),'body':{'appCode':_0x57f7b0[_0x2fa7d0(0x96)],'sqlName':_0x5c94a5,'dbId':_0x10b97b,'mode':_0x2b8a35,'localPath':_0x5f5d08},'description':'Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20'+_0x230aa7[_0x2fa7d0(0xbb)]};},async 'execute'(_0x854fdd){const _0x59373f=a206_0x1cf83b,_0x5093a1=loadSqlProjectConfig(_0x854fdd[_0x59373f(0x96)]),{sqlName:_0x116725,dbId:_0x3c4cca,dbName:_0x15e635,mode:_0x393dee}=await resolveSqlNewInputs(_0x854fdd),_0x235b27=generateSqlTemplate(_0x393dee),_0x307192=await createSqlQuery({'appCode':_0x854fdd[_0x59373f(0x96)],'sqlName':_0x116725,'dbId':_0x3c4cca,'sqlContent':_0x235b27}),_0x180e6d=ensureRemoteSqlContent(_0x307192),_0x5e1d70=_0x15e635||await getDbName(_0x854fdd['appCode'],_0x3c4cca)[_0x59373f(0x92)](()=>undefined),_0x4bc693=buildSqlRelativePath(_0x307192['sqlCode'],_0x307192[_0x59373f(0xbe)],_0x5e1d70,_0x393dee,_0x3c4cca),_0x1945d2=_0x5093a1['sqlRootDir']+'/'+_0x4bc693,_0x3fa9bb=buildLocalSqlFileContent({'sqlCode':_0x307192['sqlCode'],'sqlName':_0x307192[_0x59373f(0xbe)],'dbId':_0x307192[_0x59373f(0xc3)]},_0x180e6d,{'dbName':_0x5e1d70,'mode':_0x393dee,'syncedAt':new Date()['toISOString'](),'description':_0x307192['description']});if(await fileExists(_0x1945d2))throw CliErrors[_0x59373f(0x8d)](_0x59373f(0xb4)+_0x1945d2);await ensureParentDirectory(_0x1945d2),await writeFile(_0x1945d2,_0x3fa9bb,_0x59373f(0xb7));const _0x13e06=await readSqlLockFile(_0x5093a1['lockFilePath']),{lockData:_0x498b90,appLock:_0x51a844}=ensureSqlLockScope(_0x13e06??createEmptySqlLock(),_0x5093a1[_0x59373f(0x96)],_0x5093a1[_0x59373f(0x85)],'new');return _0x51a844['sqls'][_0x307192[_0x59373f(0xc2)]]={...buildSqlLockEntry(_0x307192,_0x180e6d,computeSqlContentHash(_0x3fa9bb),{'dbName':_0x5e1d70}),'path':_0x4bc693,'mode':_0x393dee},_0x51a844[_0x59373f(0xb6)]=new Date()[_0x59373f(0xb1)](),await writeSqlLockFile(_0x5093a1['lockFilePath'],_0x498b90),{'ok':!![],'data':{'id':_0x307192['id'],'sqlCode':_0x307192[_0x59373f(0xc2)],'sqlName':_0x307192['sqlName'],'dbId':_0x307192[_0x59373f(0xc3)],'path':_0x1945d2,'mode':_0x393dee},'message':_0x59373f(0x99)+_0x307192[_0x59373f(0xc2)]};}};async function resolveSqlNewInputs(_0x59d710){const _0x3e4924=await resolveSqlNameInput(_0x59d710),{dbId:_0x3c29c1,dbName:_0x161e39}=await resolveDbSelection(_0x59d710),_0x113e21=await resolveSqlModeInput(_0x59d710);return{'sqlName':_0x3e4924,'dbId':_0x3c29c1,'dbName':_0x161e39,'mode':_0x113e21};}async function resolveSqlNameInput(_0x44de3f){const _0x3c7c10=a206_0x1cf83b,_0x2b777f=_0x44de3f[_0x3c7c10(0xbd)]('name')['trim']();if(_0x2b777f)return _0x2b777f;if(_0x44de3f[_0x3c7c10(0x93)])throw CliErrors[_0x3c7c10(0x8c)](_0x3c7c10(0x8f),_0x3c7c10(0x86));return(await input({'message':'SQL\x20name:','validate':_0xcb0d77=>_0xcb0d77[_0x3c7c10(0x8e)]()?!![]:_0x3c7c10(0xab)}))[_0x3c7c10(0x8e)]();}async function resolveDbSelection(_0x4afe76){const _0x4bc929=a206_0x1cf83b,_0xad18ba=resolveProvidedDbId(_0x4afe76);if(typeof _0xad18ba===_0x4bc929(0xb2)&&Number['isFinite'](_0xad18ba)&&_0xad18ba>0x0)return{'dbId':_0xad18ba,'dbName':await getDbName(_0x4afe76[_0x4bc929(0x96)],_0xad18ba)[_0x4bc929(0x92)](()=>undefined)};if(_0x4afe76[_0x4bc929(0x93)])throw CliErrors[_0x4bc929(0x8c)](_0x4bc929(0x9b),_0x4bc929(0xc1));const _0xa6ae1c=await listDatabases(_0x4afe76[_0x4bc929(0x96)])[_0x4bc929(0x92)](()=>[]);if(_0xa6ae1c['length']===0x1)return{'dbId':_0xa6ae1c[0x0]['dbId'],'dbName':_0xa6ae1c[0x0][_0x4bc929(0xb3)]};if(_0xa6ae1c[_0x4bc929(0x83)]>0x1){const _0xdd0523=await select({'message':_0x4bc929(0x90),'choices':[..._0xa6ae1c[_0x4bc929(0xa8)](_0x23526c=>({'name':_0x23526c['dbName']+'\x20('+_0x23526c[_0x4bc929(0xc3)]+')','value':serializeDbSelection(_0x23526c)})),{'name':'✎\x20Enter\x20dbId\x20manually','value':_0x4bc929(0xaa)}]});if(_0xdd0523!==_0x4bc929(0xaa))return deserializeDbSelection(_0xdd0523);}const _0x236079=await input({'message':_0x4bc929(0x84),'validate':_0x2af753=>{const _0x154ca0=_0x4bc929,_0x5ea6d9=_0x2af753[_0x154ca0(0x8e)]();if(!_0x5ea6d9)return _0x154ca0(0xba);const _0x314b24=Number(_0x5ea6d9);if(!Number[_0x154ca0(0xaf)](_0x314b24)||_0x314b24<=0x0)return _0x154ca0(0xa9);return!![];}});return{'dbId':Number(_0x236079[_0x4bc929(0x8e)]())};}async function resolveSqlModeInput(_0x443e70){const _0x4acade=a206_0x1cf83b,_0x1d5223=_0x443e70[_0x4acade(0xbd)](_0x4acade(0x95))[_0x4acade(0x8e)]();if(_0x1d5223===_0x4acade(0xa7)||_0x1d5223===_0x4acade(0x94))return _0x1d5223;if(_0x443e70[_0x4acade(0x93)])throw CliErrors[_0x4acade(0x8c)](_0x4acade(0x95),_0x4acade(0xae));return await select({'message':_0x4acade(0x97),'choices':[{'name':_0x4acade(0x8a),'value':_0x4acade(0xa7),'description':_0x4acade(0xbc)},{'name':'MyBatis\x20XML\x20(mybatisXml)','value':_0x4acade(0x94),'description':'For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags'}]});}function serializeDbSelection(_0x3ea71){const _0x4c985a=a206_0x1cf83b;return JSON[_0x4c985a(0x9d)]({'dbId':_0x3ea71[_0x4c985a(0xc3)],'dbName':_0x3ea71[_0x4c985a(0xb3)]});}function deserializeDbSelection(_0x63e158){const _0x22d534=a206_0x1cf83b;try{const _0x3e2c16=JSON[_0x22d534(0xc0)](_0x63e158);if(typeof _0x3e2c16[_0x22d534(0xc3)]===_0x22d534(0xb2)&&Number['isFinite'](_0x3e2c16[_0x22d534(0xc3)]))return{'dbId':_0x3e2c16[_0x22d534(0xc3)],'dbName':_0x3e2c16['dbName']};}catch{}throw CliErrors['validation'](_0x22d534(0xa1)+_0x63e158);}function resolveProvidedDbId(_0x3ca68e){const _0x76087=a206_0x1cf83b,_0x5a26d2=_0x3ca68e[_0x76087(0x89)](_0x76087(0x9b));if(typeof _0x5a26d2===_0x76087(0xb2)&&Number['isFinite'](_0x5a26d2))return _0x5a26d2;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;}