@lovrabet/rabetbase-cli 2.5.9 → 2.5.10-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (377) hide show
  1. package/README.md +1 -1
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/api-group.js +1 -1
  4. package/lib/api/fetch-model-list.js +1 -1
  5. package/lib/api/generate-api-file.js +1 -1
  6. package/lib/api/generate-sdk-config-file.js +1 -1
  7. package/lib/api/legacy-api-file.js +1 -1
  8. package/lib/api/model-registry-file.js +1 -1
  9. package/lib/api/model-registry-scaffold.js +1 -1
  10. package/lib/api/model-source.js +1 -1
  11. package/lib/auth/auth-server-ui.js +1 -1
  12. package/lib/auth/auth-server.js +1 -1
  13. package/lib/auth/constant.js +1 -1
  14. package/lib/auth/get-cookie.js +1 -1
  15. package/lib/auth/get-session-user.js +1 -1
  16. package/lib/auth/is-session-valid.js +1 -1
  17. package/lib/auth/login-success-html.js +1 -1
  18. package/lib/auth/logout.js +1 -1
  19. package/lib/cli-flags.js +1 -1
  20. package/lib/cli.js +1 -1
  21. package/lib/commands/api/generate.js +1 -1
  22. package/lib/commands/api/index.js +1 -1
  23. package/lib/commands/api/list.js +1 -1
  24. package/lib/commands/api/pull.js +1 -1
  25. package/lib/commands/api/shared.js +1 -1
  26. package/lib/commands/app/detail.js +1 -1
  27. package/lib/commands/app/index.js +1 -1
  28. package/lib/commands/app/list.js +1 -1
  29. package/lib/commands/app/members-list.js +1 -1
  30. package/lib/commands/app/remote-directory.js +1 -1
  31. package/lib/commands/app/shared.js +1 -1
  32. package/lib/commands/app-config/delete.js +1 -1
  33. package/lib/commands/app-config/get.js +1 -1
  34. package/lib/commands/app-config/index.js +1 -1
  35. package/lib/commands/app-config/list.js +1 -1
  36. package/lib/commands/app-config/set.js +1 -1
  37. package/lib/commands/app-config/shared.js +1 -1
  38. package/lib/commands/auth/index.js +1 -1
  39. package/lib/commands/bff/create.js +1 -1
  40. package/lib/commands/bff/delete.js +1 -1
  41. package/lib/commands/bff/detail.js +1 -1
  42. package/lib/commands/bff/index.js +1 -1
  43. package/lib/commands/bff/list.js +1 -1
  44. package/lib/commands/bff/logs.js +1 -1
  45. package/lib/commands/bff/pull.js +1 -1
  46. package/lib/commands/bff/push.js +1 -1
  47. package/lib/commands/bff/status.js +1 -1
  48. package/lib/commands/cli-skill/index.js +1 -1
  49. package/lib/commands/cli-update.js +1 -1
  50. package/lib/commands/codegen/index.js +1 -1
  51. package/lib/commands/codegen/sdk.js +1 -1
  52. package/lib/commands/codegen/sql.js +1 -1
  53. package/lib/commands/common/app-registry.js +1 -1
  54. package/lib/commands/common/app-selector.js +1 -1
  55. package/lib/commands/common/async-task.js +1 -1
  56. package/lib/commands/common/dry-run.js +1 -1
  57. package/lib/commands/common/flags.js +1 -1
  58. package/lib/commands/common/local-file.js +1 -1
  59. package/lib/commands/common/validate.js +1 -1
  60. package/lib/commands/config/delete.js +1 -1
  61. package/lib/commands/config/get.js +1 -1
  62. package/lib/commands/config/index.js +1 -1
  63. package/lib/commands/config/init.js +1 -1
  64. package/lib/commands/config/list.js +1 -1
  65. package/lib/commands/config/set.js +1 -1
  66. package/lib/commands/config/shared.js +1 -1
  67. package/lib/commands/dataset/batch-design.js +1 -1
  68. package/lib/commands/dataset/business-group-update.js +1 -1
  69. package/lib/commands/dataset/business-groups.js +1 -1
  70. package/lib/commands/dataset/capability.js +1 -1
  71. package/lib/commands/dataset/cross-relation-create.js +1 -1
  72. package/lib/commands/dataset/cross-relation-delete.js +1 -1
  73. package/lib/commands/dataset/cross-relation-list.js +1 -1
  74. package/lib/commands/dataset/cross-relation-shared.js +1 -1
  75. package/lib/commands/dataset/cross-relation-update.js +1 -1
  76. package/lib/commands/dataset/delete.js +1 -1
  77. package/lib/commands/dataset/design-context.js +1 -1
  78. package/lib/commands/dataset/design-start.js +1 -1
  79. package/lib/commands/dataset/design-status.js +1 -1
  80. package/lib/commands/dataset/design-sync-retry.js +1 -1
  81. package/lib/commands/dataset/design-sync-status.js +1 -1
  82. package/lib/commands/dataset/design-validate.js +1 -1
  83. package/lib/commands/dataset/detail.js +1 -1
  84. package/lib/commands/dataset/extend-update.js +1 -1
  85. package/lib/commands/dataset/field-restore.js +1 -1
  86. package/lib/commands/dataset/field-update.js +1 -1
  87. package/lib/commands/dataset/generate.js +1 -1
  88. package/lib/commands/dataset/index.js +1 -1
  89. package/lib/commands/dataset/list.js +1 -1
  90. package/lib/commands/dataset/operations.js +1 -1
  91. package/lib/commands/dataset/relation-audit.js +1 -1
  92. package/lib/commands/dataset/relation-create.js +1 -1
  93. package/lib/commands/dataset/relation-delete.js +1 -1
  94. package/lib/commands/dataset/relation-shared.js +1 -1
  95. package/lib/commands/dataset/relation-update.js +1 -1
  96. package/lib/commands/dataset/relations.js +1 -1
  97. package/lib/commands/dataset/rename.js +1 -1
  98. package/lib/commands/dataset/restore.js +1 -1
  99. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  100. package/lib/commands/db/analysis-batching.js +1 -1
  101. package/lib/commands/db/analyze-batch-plan.js +1 -1
  102. package/lib/commands/db/analyze-cancel.js +1 -1
  103. package/lib/commands/db/analyze-start.js +1 -1
  104. package/lib/commands/db/analyze-status.js +1 -1
  105. package/lib/commands/db/create.js +1 -1
  106. package/lib/commands/db/cross-db-analysis-shared.js +1 -1
  107. package/lib/commands/db/cross-db-analyze-latest.js +1 -1
  108. package/lib/commands/db/cross-db-analyze-start.js +1 -1
  109. package/lib/commands/db/cross-db-analyze-status.js +1 -1
  110. package/lib/commands/db/delete.js +1 -1
  111. package/lib/commands/db/detail.js +1 -1
  112. package/lib/commands/db/diff-refresh-start.js +1 -1
  113. package/lib/commands/db/diff-refresh-status.js +1 -1
  114. package/lib/commands/db/diff.js +1 -1
  115. package/lib/commands/db/index.js +1 -1
  116. package/lib/commands/db/list.js +1 -1
  117. package/lib/commands/db/shared.js +1 -1
  118. package/lib/commands/db/table-diff-shared.js +1 -1
  119. package/lib/commands/db/tables.js +1 -1
  120. package/lib/commands/db/test.js +1 -1
  121. package/lib/commands/db/update.js +1 -1
  122. package/lib/commands/deployment/index.js +1 -1
  123. package/lib/commands/deployment/sync-all.js +1 -1
  124. package/lib/commands/deployment/sync-jobs.js +1 -1
  125. package/lib/commands/deployment/sync-status.js +1 -1
  126. package/lib/commands/doctor.js +1 -1
  127. package/lib/commands/file/index.js +1 -1
  128. package/lib/commands/flow/create.js +1 -1
  129. package/lib/commands/flow/detail.js +1 -1
  130. package/lib/commands/flow/index.js +1 -1
  131. package/lib/commands/flow/list.js +1 -1
  132. package/lib/commands/flow/page-list.js +1 -1
  133. package/lib/commands/flow/publish.js +1 -1
  134. package/lib/commands/flow/runtime-resources-shared.js +1 -1
  135. package/lib/commands/flow/runtime-role-list.js +1 -1
  136. package/lib/commands/flow/runtime-role-user-list.js +1 -1
  137. package/lib/commands/flow/runtime-user-search.js +1 -1
  138. package/lib/commands/flow/shared.js +1 -1
  139. package/lib/commands/flow/update.js +1 -1
  140. package/lib/commands/flow/validate.js +1 -1
  141. package/lib/commands/instant-api-policy/current.js +1 -1
  142. package/lib/commands/instant-api-policy/index.js +1 -1
  143. package/lib/commands/instant-api-policy/init.js +1 -1
  144. package/lib/commands/instant-api-policy/publish.js +1 -1
  145. package/lib/commands/instant-api-policy/pull.js +1 -1
  146. package/lib/commands/instant-api-policy/revision.js +1 -1
  147. package/lib/commands/instant-api-policy/revisions.js +1 -1
  148. package/lib/commands/instant-api-policy/rollback.js +1 -1
  149. package/lib/commands/instant-api-policy/shared.js +1 -1
  150. package/lib/commands/instant-api-policy/validate.js +1 -1
  151. package/lib/commands/issue/index.js +1 -1
  152. package/lib/commands/issue/nudge.js +1 -1
  153. package/lib/commands/issue/report.js +1 -1
  154. package/lib/commands/issue/shared.js +1 -1
  155. package/lib/commands/kb/create.js +1 -1
  156. package/lib/commands/kb/delete.js +1 -1
  157. package/lib/commands/kb/detail.js +1 -1
  158. package/lib/commands/kb/index.js +1 -1
  159. package/lib/commands/kb/list.js +1 -1
  160. package/lib/commands/kb/search.js +1 -1
  161. package/lib/commands/kb/shared.js +1 -1
  162. package/lib/commands/kb/update.js +1 -1
  163. package/lib/commands/logs/index.js +1 -1
  164. package/lib/commands/menu/asset-update.js +1 -1
  165. package/lib/commands/menu/delete.js +1 -1
  166. package/lib/commands/menu/external-link-create.js +1 -1
  167. package/lib/commands/menu/external-link-update.js +1 -1
  168. package/lib/commands/menu/group-create.js +1 -1
  169. package/lib/commands/menu/group-update.js +1 -1
  170. package/lib/commands/menu/index.js +1 -1
  171. package/lib/commands/menu/list.js +1 -1
  172. package/lib/commands/menu/move.js +1 -1
  173. package/lib/commands/menu/regroup-start.js +1 -1
  174. package/lib/commands/menu/rename.js +1 -1
  175. package/lib/commands/menu/shared/compare-table.js +1 -1
  176. package/lib/commands/menu/shared/delete-plan.js +1 -1
  177. package/lib/commands/menu/shared/facts.js +1 -1
  178. package/lib/commands/menu/shared/index.js +1 -1
  179. package/lib/commands/menu/shared/inquirer.js +1 -1
  180. package/lib/commands/menu/shared/local-pages.js +1 -1
  181. package/lib/commands/menu/shared/logic.js +1 -1
  182. package/lib/commands/menu/shared/mutations.js +1 -1
  183. package/lib/commands/menu/shared/path.js +1 -1
  184. package/lib/commands/menu/shared/service.js +1 -1
  185. package/lib/commands/menu/shared/subapp-assets.js +1 -1
  186. package/lib/commands/menu/shared/sync-core.js +1 -1
  187. package/lib/commands/menu/shared/update-core.js +1 -1
  188. package/lib/commands/menu/shared/valid-url.js +1 -1
  189. package/lib/commands/menu/subapp-assets-status.js +1 -1
  190. package/lib/commands/menu/subapp-assets-update.js +1 -1
  191. package/lib/commands/menu/sync.js +1 -1
  192. package/lib/commands/menu/visibility-update.js +1 -1
  193. package/lib/commands/notification/config-create.js +1 -1
  194. package/lib/commands/notification/config-delete.js +1 -1
  195. package/lib/commands/notification/config-list.js +1 -1
  196. package/lib/commands/notification/config-update.js +1 -1
  197. package/lib/commands/notification/index.js +1 -1
  198. package/lib/commands/notification/shared.js +1 -1
  199. package/lib/commands/ocr/index.js +1 -1
  200. package/lib/commands/page/create.js +1 -1
  201. package/lib/commands/page/custom/detail.js +1 -1
  202. package/lib/commands/page/custom/list.js +1 -1
  203. package/lib/commands/page/custom/publish.js +1 -1
  204. package/lib/commands/page/custom/shared.js +1 -1
  205. package/lib/commands/page/custom/syntax.js +1 -1
  206. package/lib/commands/page/custom/update.js +1 -1
  207. package/lib/commands/page/data-list-status.js +1 -1
  208. package/lib/commands/page/generate-start.js +1 -1
  209. package/lib/commands/page/generate-status.js +1 -1
  210. package/lib/commands/page/index.js +1 -1
  211. package/lib/commands/page/pull.js +1 -1
  212. package/lib/commands/page/push.js +1 -1
  213. package/lib/commands/page/relation-audit.js +1 -1
  214. package/lib/commands/page/restore.js +1 -1
  215. package/lib/commands/page/shared.js +1 -1
  216. package/lib/commands/page/sync.js +1 -1
  217. package/lib/commands/project/api-architecture-upgrade.js +1 -1
  218. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  219. package/lib/commands/project/create/format-elapsed.js +1 -1
  220. package/lib/commands/project/create/main.js +1 -1
  221. package/lib/commands/project/create/materialize-project-template.js +1 -1
  222. package/lib/commands/project/create/project-name.js +1 -1
  223. package/lib/commands/project/create/project-template-archive.js +1 -1
  224. package/lib/commands/project/create/project-template-path.js +1 -1
  225. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  226. package/lib/commands/project/create/use-format-code.js +1 -1
  227. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  228. package/lib/commands/project/domain-routing-sync.js +1 -1
  229. package/lib/commands/project/index.js +1 -1
  230. package/lib/commands/project/upgrade.js +1 -1
  231. package/lib/commands/registry.js +1 -1
  232. package/lib/commands/role/delete.js +1 -1
  233. package/lib/commands/role/detail.js +1 -1
  234. package/lib/commands/role/index.js +1 -1
  235. package/lib/commands/role/list.js +1 -1
  236. package/lib/commands/role/shared.js +1 -1
  237. package/lib/commands/role/update.js +1 -1
  238. package/lib/commands/role/user-add.js +1 -1
  239. package/lib/commands/role/user-remove.js +1 -1
  240. package/lib/commands/role/user-resolve.js +1 -1
  241. package/lib/commands/rule/get.js +1 -1
  242. package/lib/commands/rule/index.js +1 -1
  243. package/lib/commands/rule/list.js +1 -1
  244. package/lib/commands/rule/set.js +1 -1
  245. package/lib/commands/rule/shared.js +1 -1
  246. package/lib/commands/run/index.js +1 -1
  247. package/lib/commands/schema.js +1 -1
  248. package/lib/commands/sql/create.js +1 -1
  249. package/lib/commands/sql/delete.js +1 -1
  250. package/lib/commands/sql/detail.js +1 -1
  251. package/lib/commands/sql/exec.js +1 -1
  252. package/lib/commands/sql/index.js +1 -1
  253. package/lib/commands/sql/list.js +1 -1
  254. package/lib/commands/sql/pull.js +1 -1
  255. package/lib/commands/sql/push.js +1 -1
  256. package/lib/commands/sql/shared.js +1 -1
  257. package/lib/commands/sql/status.js +1 -1
  258. package/lib/commands/sql/validate.js +1 -1
  259. package/lib/commands/task/index.js +1 -1
  260. package/lib/commands/task/status.js +1 -1
  261. package/lib/commands/tenant/index.js +1 -1
  262. package/lib/commands/tenant/members-list.js +1 -1
  263. package/lib/commands/tenant/shared.js +1 -1
  264. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  265. package/lib/commands/user-account/feishu-bind.js +1 -1
  266. package/lib/commands/user-account/index.js +1 -1
  267. package/lib/commands/workspace/add.js +1 -1
  268. package/lib/commands/workspace/index.js +1 -1
  269. package/lib/commands/workspace/remove.js +1 -1
  270. package/lib/config/domain-config.js +1 -1
  271. package/lib/config/project-domain-routing.js +1 -1
  272. package/lib/config/region-config.js +1 -1
  273. package/lib/config/schema.js +1 -1
  274. package/lib/constant/cdn.js +1 -1
  275. package/lib/constant/cli.js +1 -1
  276. package/lib/constant/defaults.js +1 -1
  277. package/lib/constant/domain.js +1 -1
  278. package/lib/constant/env.js +1 -1
  279. package/lib/constant/output.js +1 -1
  280. package/lib/constant/paths.js +1 -1
  281. package/lib/constant/region.js +1 -1
  282. package/lib/constant/risk.js +1 -1
  283. package/lib/constant/routing-profile.js +1 -1
  284. package/lib/context/app-resolver.js +1 -1
  285. package/lib/context/auth-resolver.js +1 -1
  286. package/lib/context/config-loader.js +1 -1
  287. package/lib/context.js +1 -1
  288. package/lib/core/alias-resolver.js +1 -1
  289. package/lib/core/api-client.js +1 -1
  290. package/lib/core/bff/config.js +1 -1
  291. package/lib/core/bff/file-system.js +1 -1
  292. package/lib/core/bff/hash.js +1 -1
  293. package/lib/core/bff/hook-directory.js +1 -1
  294. package/lib/core/bff/lock.js +1 -1
  295. package/lib/core/bff/utils.js +1 -1
  296. package/lib/core/cross-db-analysis.js +1 -1
  297. package/lib/core/cross-db-relation.js +1 -1
  298. package/lib/core/db-resolver.js +1 -1
  299. package/lib/core/flow-config.js +1 -1
  300. package/lib/core/instant-api-policy/config.js +1 -1
  301. package/lib/core/kb-management-client.js +1 -1
  302. package/lib/core/kb-search-client.js +1 -1
  303. package/lib/core/page/file-system.js +1 -1
  304. package/lib/core/page/hash.js +1 -1
  305. package/lib/core/page/lock.js +1 -1
  306. package/lib/core/page/lr-smart-jsx.js +1 -1
  307. package/lib/core/sql-index-auditor.js +1 -1
  308. package/lib/core/sql-sync/config.js +1 -1
  309. package/lib/core/sql-sync/file-system.js +1 -1
  310. package/lib/core/sql-sync/hash.js +1 -1
  311. package/lib/core/sql-sync/lock.js +1 -1
  312. package/lib/core/sql-sync/utils.js +1 -1
  313. package/lib/core/sql-validator.js +1 -1
  314. package/lib/errors.js +1 -1
  315. package/lib/framework/build-all-flags.js +1 -1
  316. package/lib/framework/error-output.js +1 -1
  317. package/lib/framework/explicit-yes.js +1 -1
  318. package/lib/framework/flags.js +1 -1
  319. package/lib/framework/help.js +1 -1
  320. package/lib/framework/index.js +1 -1
  321. package/lib/framework/output.js +1 -1
  322. package/lib/framework/response.js +1 -1
  323. package/lib/framework/runner-alias.js +1 -1
  324. package/lib/framework/runner.js +1 -1
  325. package/lib/framework/schema-export.js +1 -1
  326. package/lib/framework/supported-flags.js +1 -1
  327. package/lib/framework/types.js +1 -1
  328. package/lib/generated/build-info.d.ts +4 -4
  329. package/lib/generated/build-info.js +1 -1
  330. package/lib/generated/official-routing.js +1 -1
  331. package/lib/generated/routing-contract.js +1 -1
  332. package/lib/help.js +1 -1
  333. package/lib/postinstall.js +1 -1
  334. package/lib/runtime/confirmation.js +1 -1
  335. package/lib/runtime/event.js +1 -1
  336. package/lib/runtime/index.js +1 -1
  337. package/lib/runtime/queue.js +1 -1
  338. package/lib/runtime/resolve.js +1 -1
  339. package/lib/services/dataset-design/checkpoint.js +1 -1
  340. package/lib/services/dataset-design/commands.js +1 -1
  341. package/lib/services/dataset-design/contract.js +1 -1
  342. package/lib/skills/builtin-skill.js +1 -1
  343. package/lib/skills/main.js +1 -1
  344. package/lib/skills/npx-skills-add.js +1 -1
  345. package/lib/skills/skill-presence.js +1 -1
  346. package/lib/telemetry/cli-command-trace.js +1 -1
  347. package/lib/telemetry/cli-help-trace.js +1 -1
  348. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  349. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  350. package/lib/telemetry/send-cli-trace-log.js +1 -1
  351. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  352. package/lib/utils/ai_config.js +1 -1
  353. package/lib/utils/apply-jq-filter.js +1 -1
  354. package/lib/utils/cdn-config.js +1 -1
  355. package/lib/utils/check-sdk-version.js +1 -1
  356. package/lib/utils/cli-version-check.js +1 -1
  357. package/lib/utils/cli-version-policy.js +1 -1
  358. package/lib/utils/config.js +1 -1
  359. package/lib/utils/entity-with-id.js +1 -1
  360. package/lib/utils/file-utils.js +1 -1
  361. package/lib/utils/guides-cdn.js +1 -1
  362. package/lib/utils/http-client.js +1 -1
  363. package/lib/utils/is-non-interactive.js +1 -1
  364. package/lib/utils/logger.js +1 -1
  365. package/lib/utils/params.js +1 -1
  366. package/lib/utils/platform.js +1 -1
  367. package/lib/utils/sleep.js +1 -1
  368. package/lib/utils/template-replacer.js +1 -1
  369. package/lib/utils/update-notice.js +1 -1
  370. package/lib/utils/version.js +1 -1
  371. package/lib/utils/with-active-cookie.js +1 -1
  372. package/lib/utils/write-cli-side-channel.js +1 -1
  373. package/package.json +2 -2
  374. package/skills/rabetbase/SKILL.md +2 -2
  375. package/skills/rabetbase-dataset-generation/SKILL.md +2 -2
  376. package/skills/rabetbase-page-generation/SKILL.md +2 -2
  377. package/skills/rabetbase.manifest.json +3 -3
@@ -1 +1 @@
1
- const a232_0x5814e9=a232_0xb8e5;(function(_0x294114,_0x1e43a7){const _0x147981=a232_0xb8e5,_0x37ea5a=_0x294114();while(!![]){try{const _0x312827=parseInt(_0x147981(0x18f))/0x1*(parseInt(_0x147981(0x198))/0x2)+-parseInt(_0x147981(0x18c))/0x3*(-parseInt(_0x147981(0x191))/0x4)+-parseInt(_0x147981(0x19b))/0x5*(-parseInt(_0x147981(0x199))/0x6)+parseInt(_0x147981(0x197))/0x7*(-parseInt(_0x147981(0x193))/0x8)+-parseInt(_0x147981(0x18b))/0x9+parseInt(_0x147981(0x18a))/0xa+parseInt(_0x147981(0x192))/0xb*(-parseInt(_0x147981(0x196))/0xc);if(_0x312827===_0x1e43a7)break;else _0x37ea5a['push'](_0x37ea5a['shift']());}catch(_0x49cc1d){_0x37ea5a['push'](_0x37ea5a['shift']());}}}(a232_0x2167,0xe512d));function a232_0xb8e5(_0x7023a8,_0x574a3e){_0x7023a8=_0x7023a8-0x189;const _0x21677d=a232_0x2167();let _0xb8e52d=_0x21677d[_0x7023a8];return _0xb8e52d;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a232_0x2167(){const _0x1820a0=['17350152qZCkmN','497mrdJdc','14usDXCG','11009472dAkRJK','roleName','5CEoTej','Show\x20a\x20single\x20role\x27s\x20detail','dev','roleType','1173820fyyMwq','11909925JuXmen','10677obehEE','role','appCode','197431ReoLid','read','996OBigeV','11qKBflq','57808YXnCdZ','Role\x20','detail'];a232_0x2167=function(){return _0x1820a0;};return a232_0x2167();}export const roleDetail={'service':a232_0x5814e9(0x18d),'command':a232_0x5814e9(0x195),'description':a232_0x5814e9(0x19c),'risk':a232_0x5814e9(0x190),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x11484d){const _0x155b66=a232_0x5814e9,_0x416d84=_0x11484d['num']('id'),_0x2fab7f=await getRoleById(_0x11484d[_0x155b66(0x18e)],_0x416d84);return{'ok':!![],'data':{'scope':_0x155b66(0x19d),'role':projectRole(_0x2fab7f)},'message':_0x155b66(0x194)+_0x2fab7f[_0x155b66(0x19a)]+'\x20('+_0x2fab7f[_0x155b66(0x189)]+')'};}};
1
+ const a232_0x32da8a=a232_0x28f2;function a232_0x28f2(_0x418067,_0x5298f4){_0x418067=_0x418067-0xa2;const _0x486164=a232_0x4861();let _0x28f2b5=_0x486164[_0x418067];return _0x28f2b5;}function a232_0x4861(){const _0x6fc870=['role','Role\x20','1634124NEnWSA','Show\x20a\x20single\x20role\x27s\x20detail','2997293OhzbNR','detail','11ZWEQgz','num','1980pRizzu','3hFWFKn','2725289KhfGij','354443KBOhKf','18CuPSjJ','2rsxvyF','8250lkSILJ','826852gnCgSg','8ciJdty','appCode','roleType','432105XcBjgL','roleName'];a232_0x4861=function(){return _0x6fc870;};return a232_0x4861();}(function(_0x137128,_0xea7b2f){const _0x1681a0=a232_0x28f2,_0x80a8de=_0x137128();while(!![]){try{const _0x16ee3a=parseInt(_0x1681a0(0xb5))/0x1*(parseInt(_0x1681a0(0xa2))/0x2)+parseInt(_0x1681a0(0xb3))/0x3*(-parseInt(_0x1681a0(0xa4))/0x4)+-parseInt(_0x1681a0(0xa8))/0x5*(parseInt(_0x1681a0(0xb6))/0x6)+parseInt(_0x1681a0(0xb4))/0x7*(parseInt(_0x1681a0(0xa5))/0x8)+-parseInt(_0x1681a0(0xb2))/0x9*(-parseInt(_0x1681a0(0xa3))/0xa)+parseInt(_0x1681a0(0xb0))/0xb*(parseInt(_0x1681a0(0xac))/0xc)+-parseInt(_0x1681a0(0xae))/0xd;if(_0x16ee3a===_0xea7b2f)break;else _0x80a8de['push'](_0x80a8de['shift']());}catch(_0x18d9fa){_0x80a8de['push'](_0x80a8de['shift']());}}}(a232_0x4861,0x5916e));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a232_0x32da8a(0xaa),'command':a232_0x32da8a(0xaf),'description':a232_0x32da8a(0xad),'risk':'read','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x35556e){const _0x334e37=a232_0x32da8a,_0x1ac9cb=_0x35556e[_0x334e37(0xb1)]('id'),_0x1ba3f9=await getRoleById(_0x35556e[_0x334e37(0xa6)],_0x1ac9cb);return{'ok':!![],'data':{'scope':'dev','role':projectRole(_0x1ba3f9)},'message':_0x334e37(0xab)+_0x1ba3f9[_0x334e37(0xa9)]+'\x20('+_0x1ba3f9[_0x334e37(0xa7)]+')'};}};
@@ -1 +1 @@
1
- (function(_0x135853,_0x2f66b3){const _0x16cd9a=a233_0x3c2d,_0x106168=_0x135853();while(!![]){try{const _0x2ca844=parseInt(_0x16cd9a(0x99))/0x1+parseInt(_0x16cd9a(0x94))/0x2+parseInt(_0x16cd9a(0x95))/0x3*(parseInt(_0x16cd9a(0x9c))/0x4)+-parseInt(_0x16cd9a(0x9a))/0x5*(parseInt(_0x16cd9a(0x92))/0x6)+-parseInt(_0x16cd9a(0x9b))/0x7*(-parseInt(_0x16cd9a(0x98))/0x8)+parseInt(_0x16cd9a(0x96))/0x9*(-parseInt(_0x16cd9a(0x9d))/0xa)+parseInt(_0x16cd9a(0x97))/0xb*(-parseInt(_0x16cd9a(0x93))/0xc);if(_0x2ca844===_0x2f66b3)break;else _0x106168['push'](_0x106168['shift']());}catch(_0x88ffff){_0x106168['push'](_0x106168['shift']());}}}(a233_0x14c5,0x7c526));import{roleList}from'../../commands/role/list.js';function a233_0x14c5(){const _0x55b6a1=['1723445jYBgTs','7BgJxzz','24UaucIh','93080jewpnv','6DPyTfx','1092972RihxYX','1372058VIJCUS','463881XMadhH','909gRrvjS','77PfpDlG','5474864pHqCFu','133437Ebndfn'];a233_0x14c5=function(){return _0x55b6a1;};return a233_0x14c5();}import{roleDetail}from'../../commands/role/detail.js';import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';function a233_0x3c2d(_0x2ab53a,_0x4f2f4f){_0x2ab53a=_0x2ab53a-0x92;const _0x14c558=a233_0x14c5();let _0x3c2dc4=_0x14c558[_0x2ab53a];return _0x3c2dc4;}import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
1
+ (function(_0x1721d7,_0x2d4e6f){const _0x3d25d5=a233_0x7e10,_0x36e064=_0x1721d7();while(!![]){try{const _0x4a12b2=parseInt(_0x3d25d5(0x1ea))/0x1*(parseInt(_0x3d25d5(0x1ed))/0x2)+-parseInt(_0x3d25d5(0x1ef))/0x3*(parseInt(_0x3d25d5(0x1f0))/0x4)+parseInt(_0x3d25d5(0x1e9))/0x5+parseInt(_0x3d25d5(0x1eb))/0x6*(parseInt(_0x3d25d5(0x1e8))/0x7)+-parseInt(_0x3d25d5(0x1ec))/0x8*(-parseInt(_0x3d25d5(0x1ee))/0x9)+parseInt(_0x3d25d5(0x1f2))/0xa+-parseInt(_0x3d25d5(0x1f1))/0xb;if(_0x4a12b2===_0x2d4e6f)break;else _0x36e064['push'](_0x36e064['shift']());}catch(_0x9179ad){_0x36e064['push'](_0x36e064['shift']());}}}(a233_0x4c11,0xdd6cb));function a233_0x7e10(_0x11192c,_0x2b75f0){_0x11192c=_0x11192c-0x1e8;const _0x4c1147=a233_0x4c11();let _0x7e1056=_0x4c1147[_0x11192c];return _0x7e1056;}import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';function a233_0x4c11(){const _0x69aaf1=['91dSOtva','453895zbWuTc','941vPISat','472674yEajOk','1356232AOSzkU','3026BoSvCR','18qQQVIP','12sGXNZm','427236nauZQU','18427849tsohBl','1317530fOMycu'];a233_0x4c11=function(){return _0x69aaf1;};return a233_0x4c11();}import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleUpdate,roleDelete,roleUserResolve,roleUserAdd,roleUserRemove];
@@ -1 +1 @@
1
- const a234_0x3a13cd=a234_0x2278;function a234_0x1d6f(){const _0x39159d=['1204116dHNgTy','toUpperCase','list','Use\x20one\x20of:\x20','roleType','34753UykZTD','num','3020AfppGm','Filter\x20by\x20role\x20type','DEV','pagesize','length','Page\x20index\x20(1-based)','ADMIN','774720MmHQGt','30KrehcH','type','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','2SGPUMm','string','appCode','4517755VinBJY','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','str','validation','join','Invalid\x20--type\x20\x22','1389czAhvs','7sCzPcs','role','452775ZHDNzj','read','includes','\x20role(s)','dev','CUSTOM','number','OWNER','trim','page','3052368XImCUC'];a234_0x1d6f=function(){return _0x39159d;};return a234_0x1d6f();}(function(_0x48a4cb,_0x246c5e){const _0x5c7c3e=a234_0x2278,_0xcfc66b=_0x48a4cb();while(!![]){try{const _0x212fbb=-parseInt(_0x5c7c3e(0x1ee))/0x1*(-parseInt(_0x5c7c3e(0x1fb))/0x2)+-parseInt(_0x5c7c3e(0x204))/0x3*(parseInt(_0x5c7c3e(0x1f0))/0x4)+-parseInt(_0x5c7c3e(0x207))/0x5+parseInt(_0x5c7c3e(0x212))/0x6*(-parseInt(_0x5c7c3e(0x205))/0x7)+-parseInt(_0x5c7c3e(0x1f7))/0x8+-parseInt(_0x5c7c3e(0x211))/0x9+-parseInt(_0x5c7c3e(0x1f8))/0xa*(-parseInt(_0x5c7c3e(0x1fe))/0xb);if(_0x212fbb===_0x246c5e)break;else _0xcfc66b['push'](_0xcfc66b['shift']());}catch(_0x2a9134){_0xcfc66b['push'](_0xcfc66b['shift']());}}}(a234_0x1d6f,0x2e676));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a234_0x3a13cd(0x1f6),a234_0x3a13cd(0x1f2),a234_0x3a13cd(0x20e),a234_0x3a13cd(0x20c)];function a234_0x2278(_0x3a8350,_0x10f0ba){_0x3a8350=_0x3a8350-0x1ee;const _0x1d6f20=a234_0x1d6f();let _0x2278f6=_0x1d6f20[_0x3a8350];return _0x2278f6;}export const roleList={'service':a234_0x3a13cd(0x206),'command':a234_0x3a13cd(0x214),'description':a234_0x3a13cd(0x1fa),'risk':a234_0x3a13cd(0x208),'flags':[APPCODE_FLAG_OPTIONAL,{'name':'type','type':a234_0x3a13cd(0x1fc),'required':![],'description':a234_0x3a13cd(0x1f1),'enum':ROLE_TYPES},{'name':a234_0x3a13cd(0x210),'type':a234_0x3a13cd(0x20d),'description':a234_0x3a13cd(0x1f5),'default':0x1},{'name':a234_0x3a13cd(0x1f3),'type':'number','description':'Page\x20size\x20(1-100)','default':0x64}],async 'validate'(_0x4095df){const _0x1834cf=a234_0x3a13cd,_0x1a6e79=_0x4095df[_0x1834cf(0x200)](_0x1834cf(0x1f9))[_0x1834cf(0x20f)]();if(_0x1a6e79&&!ROLE_TYPES[_0x1834cf(0x209)](_0x1a6e79[_0x1834cf(0x213)]()))throw CliErrors[_0x1834cf(0x201)](_0x1834cf(0x203)+_0x1a6e79+'\x22.',_0x1834cf(0x215)+ROLE_TYPES[_0x1834cf(0x202)](',\x20')+'.');const _0x460a4e=_0x4095df[_0x1834cf(0x1ef)]('page',0x1),_0x1fcfd0=_0x4095df[_0x1834cf(0x1ef)](_0x1834cf(0x1f3),0x64);if(_0x460a4e<0x1)throw CliErrors[_0x1834cf(0x201)]('--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.');if(_0x1fcfd0<0x1||_0x1fcfd0>0x64)throw CliErrors[_0x1834cf(0x201)](_0x1834cf(0x1ff));},async 'execute'(_0x32b55a){const _0x562e78=a234_0x3a13cd,_0x4e0764=_0x32b55a['num'](_0x562e78(0x210),0x1)||0x1,_0x422330=_0x32b55a[_0x562e78(0x1ef)](_0x562e78(0x1f3),0x64)||0x64,_0x211919=_0x32b55a['str'](_0x562e78(0x1f9))[_0x562e78(0x20f)]()[_0x562e78(0x213)](),{items:_0xa44b65,paging:_0x113587}=await listAppRoles(_0x32b55a[_0x562e78(0x1fd)],{'currentPage':_0x4e0764,'pageSize':_0x422330}),_0x3a9029=_0x211919?_0xa44b65['filter'](_0x2b06fa=>_0x2b06fa[_0x562e78(0x216)]===_0x211919):_0xa44b65,_0x3f3f58=_0x3a9029['map'](projectRole);return{'ok':!![],'data':{'scope':_0x562e78(0x20b),'roles':_0x3f3f58,'paging':_0x113587},'message':'Found\x20'+_0x3f3f58[_0x562e78(0x1f4)]+_0x562e78(0x20a)};}};
1
+ const a234_0xe43c35=a234_0x58fe;(function(_0x5f00ca,_0x2514ab){const _0x446b89=a234_0x58fe,_0x2e3e7f=_0x5f00ca();while(!![]){try{const _0x545675=parseInt(_0x446b89(0x8b))/0x1+-parseInt(_0x446b89(0x73))/0x2+-parseInt(_0x446b89(0x79))/0x3+parseInt(_0x446b89(0x88))/0x4*(parseInt(_0x446b89(0x83))/0x5)+-parseInt(_0x446b89(0x71))/0x6+-parseInt(_0x446b89(0x90))/0x7+parseInt(_0x446b89(0x84))/0x8;if(_0x545675===_0x2514ab)break;else _0x2e3e7f['push'](_0x2e3e7f['shift']());}catch(_0x5199cd){_0x2e3e7f['push'](_0x2e3e7f['shift']());}}}(a234_0xe6fe,0xe7612));function a234_0x58fe(_0x5d46e3,_0x52a0c0){_0x5d46e3=_0x5d46e3-0x70;const _0xe6fede=a234_0xe6fe();let _0x58fea4=_0xe6fede[_0x5d46e3];return _0x58fea4;}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 a234_0xe6fe(){const _0x26191f=['includes','722599EeVpYO','str','trim','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','number','7424060RiqRcP','Found\x20','appCode','7515780aMQjrV','roleType','2954324wjRhgt','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','Filter\x20by\x20role\x20type','string','Use\x20one\x20of:\x20','type','97551QPpRSz','length','toUpperCase','ADMIN','pagesize','role','num','DEV','map','Page\x20index\x20(1-based)','45ZqSYOH','26284536SUJleC','page','read','validation','338868SNFVzq','OWNER'];a234_0xe6fe=function(){return _0x26191f;};return a234_0xe6fe();}const ROLE_TYPES=[a234_0xe43c35(0x7c),a234_0xe43c35(0x80),a234_0xe43c35(0x89),'CUSTOM'];export const roleList={'service':a234_0xe43c35(0x7e),'command':'list','description':'List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','risk':a234_0xe43c35(0x86),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a234_0xe43c35(0x78),'type':a234_0xe43c35(0x76),'required':![],'description':a234_0xe43c35(0x75),'enum':ROLE_TYPES},{'name':a234_0xe43c35(0x85),'type':a234_0xe43c35(0x8f),'description':a234_0xe43c35(0x82),'default':0x1},{'name':a234_0xe43c35(0x7d),'type':a234_0xe43c35(0x8f),'description':'Page\x20size\x20(1-100)','default':0x64}],async 'validate'(_0x14ccf2){const _0x2d9eda=a234_0xe43c35,_0x347e2e=_0x14ccf2[_0x2d9eda(0x8c)](_0x2d9eda(0x78))[_0x2d9eda(0x8d)]();if(_0x347e2e&&!ROLE_TYPES[_0x2d9eda(0x8a)](_0x347e2e[_0x2d9eda(0x7b)]()))throw CliErrors[_0x2d9eda(0x87)]('Invalid\x20--type\x20\x22'+_0x347e2e+'\x22.',_0x2d9eda(0x77)+ROLE_TYPES['join'](',\x20')+'.');const _0x4fb004=_0x14ccf2['num'](_0x2d9eda(0x85),0x1),_0x301f58=_0x14ccf2[_0x2d9eda(0x7f)]('pagesize',0x64);if(_0x4fb004<0x1)throw CliErrors[_0x2d9eda(0x87)](_0x2d9eda(0x8e));if(_0x301f58<0x1||_0x301f58>0x64)throw CliErrors[_0x2d9eda(0x87)](_0x2d9eda(0x74));},async 'execute'(_0x2c5d36){const _0x1bfeea=a234_0xe43c35,_0x11e8d7=_0x2c5d36[_0x1bfeea(0x7f)]('page',0x1)||0x1,_0x3b9a7a=_0x2c5d36[_0x1bfeea(0x7f)]('pagesize',0x64)||0x64,_0x50bf7f=_0x2c5d36[_0x1bfeea(0x8c)]('type')[_0x1bfeea(0x8d)]()['toUpperCase'](),{items:_0x353a88,paging:_0x3a53ec}=await listAppRoles(_0x2c5d36[_0x1bfeea(0x70)],{'currentPage':_0x11e8d7,'pageSize':_0x3b9a7a}),_0x21d68a=_0x50bf7f?_0x353a88['filter'](_0x304134=>_0x304134[_0x1bfeea(0x72)]===_0x50bf7f):_0x353a88,_0xfb8395=_0x21d68a[_0x1bfeea(0x81)](projectRole);return{'ok':!![],'data':{'scope':'dev','roles':_0xfb8395,'paging':_0x3a53ec},'message':_0x1bfeea(0x91)+_0xfb8395[_0x1bfeea(0x7a)]+'\x20role(s)'};}};
@@ -1 +1 @@
1
- const a235_0x26e15b=a235_0x1f9c;(function(_0x20bf64,_0x9c3507){const _0x4cc996=a235_0x1f9c,_0x421441=_0x20bf64();while(!![]){try{const _0xf41a5d=-parseInt(_0x4cc996(0x1a2))/0x1*(parseInt(_0x4cc996(0x19b))/0x2)+parseInt(_0x4cc996(0x1a3))/0x3*(-parseInt(_0x4cc996(0x197))/0x4)+parseInt(_0x4cc996(0x169))/0x5+-parseInt(_0x4cc996(0x177))/0x6+-parseInt(_0x4cc996(0x168))/0x7*(-parseInt(_0x4cc996(0x15f))/0x8)+-parseInt(_0x4cc996(0x19f))/0x9+-parseInt(_0x4cc996(0x160))/0xa*(-parseInt(_0x4cc996(0x1a8))/0xb);if(_0xf41a5d===_0x9c3507)break;else _0x421441['push'](_0x421441['shift']());}catch(_0x309e18){_0x421441['push'](_0x421441['shift']());}}}(a235_0x37e4,0xc4ef6));import{getTenantMembers,listDevUserRoleRelations,listAppRoles}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';function a235_0x37e4(){const _0x587727=['\x20duplicate\x20memberships\x20for\x20user\x20','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','push','role','Disambiguate\x20with\x20--role\x20<id>.','authRequired','roleName','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','join','tenant_code','Anti-drift\x20check\x20failed:\x20expected\x20','7916058CghJqv','user','name','Role\x20id\x20(from\x20`role\x20list`)','toLowerCase','CUSTOM','\x20member(s)\x20but\x20role\x20has\x20','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','Pass\x20--user\x20<id>.','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','\x20built-in\x20role\x20','userCount','Missing\x20role\x20reference.','filter','number','\x20is\x20not\x20a\x20member\x20of\x20role\x20','OWNER','\x22\x20not\x20found\x20in\x20app\x20','length','Role\x20id\x20or\x20exact\x20role\x20name','\x20members\x20of\x20the\x20OWNER\x20role.','Pass\x20--user\x20<id|name>.','nickname','Missing\x20user\x20reference.','trim','User\x20','DEV','username','Multiple\x20tenant\x20members\x20match\x20\x22','expectUserCount','totalCount','POST','4eypSuG','ADMIN','\x20not\x20found\x20in\x20app\x20','str','21642KqQySz','flagMissing','string','roleType','7176555eIoWdt','map','userId','8DNuMIj','358257vvgYKn','\x20is\x20already\x20a\x20member\x20of\x20role\x20','Optional\x20role\x20remark/description','appCode','remark','174350razgVV','dryRun','Check\x20the\x20nickname/username.\x20','includes','\x22:\x20','/smartapi/permit/user-role/delete',';\x20no\x20change.','expect-user-count','Cannot\x20','user-add','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','/smartapi/permit/user-role/create','373328weYLWn','1010nzJjyg','Role\x20name\x20\x22','validation','Pass\x20--role\x20<id|name>.','test','No\x20tenant\x20member\x20matches\x20\x22','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','Role\x20name','35oYpFiH','6475955QaJtpK','flag','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.'];a235_0x37e4=function(){return _0x587727;};return a235_0x37e4();}export const ROLE_ID_FLAG={'name':'id','type':a235_0x26e15b(0x185),'required':!![],'description':a235_0x26e15b(0x17a)};export const ROLE_REF_FLAG={'name':a235_0x26e15b(0x16f),'type':a235_0x26e15b(0x19d),'required':!![],'description':a235_0x26e15b(0x18a)};export const USER_REF_FLAG={'name':a235_0x26e15b(0x178),'type':'string','required':!![],'description':a235_0x26e15b(0x180)};export const NAME_FLAG={'name':a235_0x26e15b(0x179),'type':a235_0x26e15b(0x19d),'required':!![],'description':a235_0x26e15b(0x167)};export const USER_NAME_FLAG={'name':a235_0x26e15b(0x179),'type':a235_0x26e15b(0x19d),'required':!![],'description':a235_0x26e15b(0x17e)};export const REMARK_FLAG={'name':a235_0x26e15b(0x1a7),'type':a235_0x26e15b(0x19d),'required':![],'description':a235_0x26e15b(0x1a5)};export const EXPECT_USER_COUNT_FLAG={'name':a235_0x26e15b(0x15a),'type':a235_0x26e15b(0x185),'required':![],'description':a235_0x26e15b(0x16d)};export const BUILTIN_ROLE_TYPES=[a235_0x26e15b(0x198),a235_0x26e15b(0x191),a235_0x26e15b(0x187)];export function isBuiltinRole(_0x14295b){const _0xffec26=a235_0x26e15b;return BUILTIN_ROLE_TYPES[_0xffec26(0x1ab)](_0x14295b);}export function assertCustomRole(_0x320a1b,_0x233346){const _0x147c95=a235_0x26e15b;if(_0x320a1b[_0x147c95(0x19e)]!==_0x147c95(0x17c))throw CliErrors[_0x147c95(0x162)](_0x147c95(0x15b)+_0x233346+_0x147c95(0x181)+_0x320a1b[_0x147c95(0x172)]+'\x20('+_0x320a1b[_0x147c95(0x19e)]+').',_0x147c95(0x16b));}export function projectRole(_0x4ef16e){const _0x18800d=a235_0x26e15b;return{'id':_0x4ef16e['id'],'roleName':_0x4ef16e['roleName'],'roleType':_0x4ef16e[_0x18800d(0x19e)],'remark':_0x4ef16e[_0x18800d(0x1a7)],'userCount':_0x4ef16e[_0x18800d(0x182)],'permitCount':_0x4ef16e['permitCount'],'builtin':isBuiltinRole(_0x4ef16e[_0x18800d(0x19e)])};}export async function resolveRoleRef(_0x9d0b3b,_0x181f2b){const _0x39a9da=a235_0x26e15b,_0x3035b6=_0x181f2b[_0x39a9da(0x18f)]();if(!_0x3035b6)throw CliErrors[_0x39a9da(0x162)](_0x39a9da(0x183),'Pass\x20--role\x20<id|name>.');if(/^\d+$/['test'](_0x3035b6))return getRoleById(_0x9d0b3b,Number(_0x3035b6));const _0x5bd63e=await listAllAppRoles(_0x9d0b3b),_0x486a57=_0x5bd63e[_0x39a9da(0x184)](_0x2b67d5=>_0x2b67d5[_0x39a9da(0x172)]===_0x3035b6);if(_0x486a57[_0x39a9da(0x189)]===0x0)throw CliErrors['validation'](_0x39a9da(0x161)+_0x3035b6+_0x39a9da(0x188)+_0x9d0b3b+'.',_0x39a9da(0x173));if(_0x486a57[_0x39a9da(0x189)]>0x1){const _0x4ec671=_0x486a57[_0x39a9da(0x1a0)](_0x578cbd=>_0x578cbd['id'])[_0x39a9da(0x174)](',\x20');throw CliErrors[_0x39a9da(0x162)]('Role\x20name\x20\x22'+_0x3035b6+'\x22\x20is\x20ambiguous\x20(ids:\x20'+_0x4ec671+').',_0x39a9da(0x170));}return _0x486a57[0x0];}export async function getRoleById(_0x47c840,_0x31a6df){const _0x2ccc76=a235_0x26e15b,_0x179b23=await listAllAppRoles(_0x47c840),_0x4f1155=_0x179b23['filter'](_0xcb4fde=>_0xcb4fde['id']===_0x31a6df&&(!_0xcb4fde['appCode']||_0xcb4fde[_0x2ccc76(0x1a6)]===_0x47c840));if(_0x4f1155[_0x2ccc76(0x189)]!==0x1)throw CliErrors[_0x2ccc76(0x162)]('Role\x20id\x20'+_0x31a6df+_0x2ccc76(0x199)+_0x47c840+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.');return _0x4f1155[0x0];}async function listAllAppRoles(_0x1269e4){const _0x35df30=a235_0x26e15b,_0x4a7329=0x64,_0x119e74=[];for(let _0xae60b2=0x1;;_0xae60b2+=0x1){const {items:_0x29fb5e,paging:_0x27a8b5}=await listAppRoles(_0x1269e4,{'currentPage':_0xae60b2,'pageSize':_0x4a7329});_0x119e74[_0x35df30(0x16e)](..._0x29fb5e);if(_0x29fb5e[_0x35df30(0x189)]<_0x4a7329||_0x27a8b5&&_0x119e74['length']>=_0x27a8b5[_0x35df30(0x195)])return _0x119e74;}}export async function resolveTenantCode(){const _0x20f84c=a235_0x26e15b,_0x47086e=await getSessionUserInfo(),_0x163ddc=_0x47086e?.[_0x20f84c(0x178)]?.['tenant']?.[_0x20f84c(0x175)];if(!_0x163ddc)throw CliErrors[_0x20f84c(0x171)](_0x20f84c(0x166));return _0x163ddc;}function matchMember(_0x577c10,_0x1ffa07){const _0x48dbee=a235_0x26e15b,_0x36e6d8=_0x1ffa07[_0x48dbee(0x18f)]()[_0x48dbee(0x17b)]();return(_0x577c10['nickname']??'')[_0x48dbee(0x17b)]()===_0x36e6d8||(_0x577c10[_0x48dbee(0x192)]??'')[_0x48dbee(0x17b)]()===_0x36e6d8;}export async function resolveUserRef(_0x49cc9e,_0x3f8c54=a235_0x26e15b(0x17f)){const _0xc5b986=a235_0x26e15b,_0x4dd48d=_0x49cc9e[_0xc5b986(0x18f)]();if(!_0x4dd48d)throw CliErrors[_0xc5b986(0x162)](_0xc5b986(0x18e),_0xc5b986(0x18c));const _0x1c0f40=await resolveTenantCode(),_0x11a0ee=await getTenantMembers(_0x1c0f40);if(/^\d+$/[_0xc5b986(0x164)](_0x4dd48d)){const _0x40e2fb=Number(_0x4dd48d),_0x5db90b=_0x11a0ee['find'](_0x3ad589=>_0x3ad589[_0xc5b986(0x1a1)]===_0x40e2fb);return{'userId':_0x40e2fb,'username':_0x5db90b?.[_0xc5b986(0x192)]??String(_0x40e2fb),'nickname':_0x5db90b?.[_0xc5b986(0x18d)],'matchedBy':'id'};}const _0x13fbe3=_0x11a0ee[_0xc5b986(0x184)](_0x22d5fe=>matchMember(_0x22d5fe,_0x4dd48d));if(_0x13fbe3[_0xc5b986(0x189)]===0x0)throw CliErrors['validation'](_0xc5b986(0x165)+_0x4dd48d+'\x22.',_0xc5b986(0x1aa)+_0x3f8c54);if(_0x13fbe3[_0xc5b986(0x189)]>0x1){const _0xcdac24=_0x13fbe3[_0xc5b986(0x1a0)](_0x139f45=>(_0x139f45['nickname']??_0x139f45[_0xc5b986(0x192)]??'?')+'('+_0x139f45[_0xc5b986(0x1a1)]+')')[_0xc5b986(0x174)](',\x20');throw CliErrors[_0xc5b986(0x162)](_0xc5b986(0x193)+_0x4dd48d+_0xc5b986(0x1ac)+_0xcdac24+'.',_0x3f8c54);}const _0x4e89b9=_0x13fbe3[0x0];return{'userId':_0x4e89b9['userId'],'username':_0x4e89b9['username']??String(_0x4e89b9[_0xc5b986(0x1a1)]),'nickname':_0x4e89b9[_0xc5b986(0x18d)],'matchedBy':'name'};}export const CREATE_USER_ROLE_PATH=a235_0x26e15b(0x15e);export const DELETE_USER_ROLE_PATH=a235_0x26e15b(0x1ad);export function computeRoleUserMutation(_0x49d817){const _0x3934be=a235_0x26e15b,{operation:_0x296c41,appCode:_0x59a597,role:_0x264d43,relations:_0x56c804,user:_0x25a20d}=_0x49d817,_0x550322=[...new Set(_0x56c804[_0x3934be(0x1a0)](_0x25c3e4=>_0x25c3e4[_0x3934be(0x1a1)]))],_0x65bc56=[];if(_0x49d817[_0x3934be(0x194)]!==undefined&&_0x49d817[_0x3934be(0x194)]!==_0x550322[_0x3934be(0x189)])throw CliErrors[_0x3934be(0x162)](_0x3934be(0x176)+_0x49d817[_0x3934be(0x194)]+_0x3934be(0x17d)+_0x550322[_0x3934be(0x189)]+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x5e93c8=_0x550322['includes'](_0x25a20d[_0x3934be(0x1a1)]),_0x2e6db8=_0x56c804[_0x3934be(0x184)](_0x561777=>_0x561777[_0x3934be(0x1a1)]===_0x25a20d['userId'])[_0x3934be(0x1a0)](_0x4a5b8a=>_0x4a5b8a['id']),_0x384a1d=_0x296c41===_0x3934be(0x15c)?!_0x5e93c8:_0x5e93c8;let _0x54e2e5=_0x550322;_0x296c41==='user-add'?_0x5e93c8?_0x65bc56[_0x3934be(0x16e)](_0x3934be(0x190)+_0x25a20d[_0x3934be(0x1a1)]+_0x3934be(0x1a4)+_0x264d43[_0x3934be(0x172)]+_0x3934be(0x159)):_0x54e2e5=[..._0x550322,_0x25a20d[_0x3934be(0x1a1)]]:!_0x5e93c8?_0x65bc56[_0x3934be(0x16e)](_0x3934be(0x190)+_0x25a20d[_0x3934be(0x1a1)]+_0x3934be(0x186)+_0x264d43[_0x3934be(0x172)]+';\x20no\x20change.'):(_0x54e2e5=_0x550322[_0x3934be(0x184)](_0x370d51=>_0x370d51!==_0x25a20d['userId']),_0x2e6db8[_0x3934be(0x189)]>0x1&&_0x65bc56[_0x3934be(0x16e)]('Removed\x20'+_0x2e6db8[_0x3934be(0x189)]+_0x3934be(0x16c)+_0x25a20d['userId']+'.'));const _0x4eae55={'scope':'dev','operation':_0x296c41,'selector':{'appCode':_0x59a597,'roleId':_0x264d43['id'],'roleName':_0x264d43[_0x3934be(0x172)],'userId':_0x25a20d['userId']},'before':{'userIds':_0x550322},'after':{'userIds':_0x54e2e5},'dryRun':_0x49d817[_0x3934be(0x1a9)],'backend':{'method':_0x3934be(0x196),'path':_0x296c41===_0x3934be(0x15c)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x65bc56};return{'mutation':_0x4eae55,'changed':_0x384a1d,'matchingRelationIds':_0x2e6db8};}function a235_0x1f9c(_0x2e41aa,_0x5e8592){_0x2e41aa=_0x2e41aa-0x159;const _0x37e4b8=a235_0x37e4();let _0x1f9c80=_0x37e4b8[_0x2e41aa];return _0x1f9c80;}export async function loadDevRoleRelations(_0x5c5218,_0xf0239b){const _0x5bbba3=a235_0x26e15b,_0x587f14=0x64,_0x1ff562=[];for(let _0x189cea=0x1;;_0x189cea+=0x1){const {items:_0xfc0e03,paging:_0x11ed23}=await listDevUserRoleRelations(_0x5c5218,{'roleId':_0xf0239b,'currentPage':_0x189cea,'pageSize':_0x587f14});_0x1ff562[_0x5bbba3(0x16e)](..._0xfc0e03);if(_0xfc0e03['length']<_0x587f14||_0x11ed23&&_0x1ff562[_0x5bbba3(0x189)]>=_0x11ed23[_0x5bbba3(0x195)])return _0x1ff562;}}export function readRoleRef(_0x301dc0){const _0x524ee1=a235_0x26e15b,_0x565b8c=_0x301dc0['str'](_0x524ee1(0x16f))[_0x524ee1(0x18f)]();if(!_0x565b8c)throw CliErrors['flagMissing']('role',_0x524ee1(0x163));return _0x565b8c;}export async function prepareUserMutation(_0x1bb38d,_0x239d8f,_0x5c26a4){const _0x353318=a235_0x26e15b,_0x57fb3d=readRoleRef(_0x1bb38d),_0x4101cf=_0x1bb38d[_0x353318(0x19a)](_0x353318(0x178))[_0x353318(0x18f)]();if(!_0x4101cf)throw CliErrors[_0x353318(0x19c)]('user',_0x353318(0x18c));const _0x5331c9=_0x1bb38d[_0x353318(0x16a)](_0x353318(0x15a)),_0x5daf2d=_0x5331c9===undefined||_0x5331c9===null?undefined:Number(_0x5331c9),_0x21e307=await resolveRoleRef(_0x1bb38d[_0x353318(0x1a6)],_0x57fb3d);if(_0x21e307['roleType']===_0x353318(0x187))throw CliErrors['validation'](_0x353318(0x15b)+_0x239d8f+_0x353318(0x18b),_0x353318(0x15d));const _0x316dd8=await resolveUserRef(_0x4101cf),_0x414ba4=await loadDevRoleRelations(_0x1bb38d[_0x353318(0x1a6)],_0x21e307['id']);return{...computeRoleUserMutation({'operation':_0x239d8f,'appCode':_0x1bb38d[_0x353318(0x1a6)],'role':_0x21e307,'relations':_0x414ba4,'user':{'userId':_0x316dd8[_0x353318(0x1a1)],'username':_0x316dd8['username'],'nickname':_0x316dd8[_0x353318(0x18d)]},'dryRun':_0x5c26a4,..._0x5daf2d!==undefined?{'expectUserCount':_0x5daf2d}:{}}),'role':_0x21e307,'user':_0x316dd8};}
1
+ const a235_0x42bd67=a235_0x4864;(function(_0x237c02,_0x53a09f){const _0x1322e6=a235_0x4864,_0x25c73c=_0x237c02();while(!![]){try{const _0xd23871=parseInt(_0x1322e6(0xa1))/0x1*(-parseInt(_0x1322e6(0xb5))/0x2)+parseInt(_0x1322e6(0x93))/0x3+parseInt(_0x1322e6(0xb8))/0x4+-parseInt(_0x1322e6(0xd6))/0x5+parseInt(_0x1322e6(0x8b))/0x6+-parseInt(_0x1322e6(0x9e))/0x7+-parseInt(_0x1322e6(0xd1))/0x8*(-parseInt(_0x1322e6(0x8c))/0x9);if(_0xd23871===_0x53a09f)break;else _0x25c73c['push'](_0x25c73c['shift']());}catch(_0x1fb85f){_0x25c73c['push'](_0x25c73c['shift']());}}}(a235_0x103a,0x904a3));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':a235_0x42bd67(0x90),'required':!![],'description':a235_0x42bd67(0xc8)};export const ROLE_REF_FLAG={'name':a235_0x42bd67(0xc9),'type':'string','required':!![],'description':a235_0x42bd67(0xce)};export const USER_REF_FLAG={'name':a235_0x42bd67(0x89),'type':a235_0x42bd67(0x91),'required':!![],'description':a235_0x42bd67(0xa8)};export const NAME_FLAG={'name':a235_0x42bd67(0x9d),'type':a235_0x42bd67(0x91),'required':!![],'description':'Role\x20name'};function a235_0x103a(){const _0xf54554=['user-add','552PugeIz','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','join','CUSTOM','Anti-drift\x20check\x20failed:\x20expected\x20','1793720uaNcMW','appCode','Missing\x20user\x20reference.','expectUserCount','flagMissing','user','tenant_code','1716834jYgKGC','154863PXJQUD','Pass\x20--user\x20<id|name>.','OWNER','Role\x20id\x20','number','string','Missing\x20role\x20reference.','280491vurPGA','test','Multiple\x20tenant\x20members\x20match\x20\x22','roleName','\x20is\x20not\x20a\x20member\x20of\x20role\x20','nickname','\x20member(s)\x20but\x20role\x20has\x20','toLowerCase','/smartapi/permit/user-role/create','permitCount','name','4074518BfaLuF','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','totalCount','93239cYqQyI','trim','userCount','Check\x20the\x20nickname/username.\x20','\x20built-in\x20role\x20','includes','\x22\x20is\x20ambiguous\x20(ids:\x20','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','ADMIN','map','\x22:\x20','User\x20','length','validation','No\x20tenant\x20member\x20matches\x20\x22','flag','expect-user-count','Role\x20name\x20\x22','userId','Pass\x20--role\x20<id|name>.','10WpTcNp','Pass\x20--user\x20<id>.','push','1724420jdXKSa','authRequired','Optional\x20role\x20remark/description','POST','Cannot\x20','tenant','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','Disambiguate\x20with\x20--role\x20<id>.','remark','username',';\x20no\x20change.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','find','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','filter','\x20duplicate\x20memberships\x20for\x20user\x20','Role\x20id\x20(from\x20`role\x20list`)','role','\x20not\x20found\x20in\x20app\x20','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','roleType','DEV','Role\x20id\x20or\x20exact\x20role\x20name','Removed\x20'];a235_0x103a=function(){return _0xf54554;};return a235_0x103a();}export const USER_NAME_FLAG={'name':a235_0x42bd67(0x9d),'type':a235_0x42bd67(0x91),'required':!![],'description':a235_0x42bd67(0xd2)};export const REMARK_FLAG={'name':a235_0x42bd67(0xc0),'type':'string','required':![],'description':a235_0x42bd67(0xba)};export const EXPECT_USER_COUNT_FLAG={'name':a235_0x42bd67(0xb1),'type':a235_0x42bd67(0x90),'required':![],'description':a235_0x42bd67(0xbe)};export const BUILTIN_ROLE_TYPES=[a235_0x42bd67(0xa9),a235_0x42bd67(0xcd),a235_0x42bd67(0x8e)];export function isBuiltinRole(_0x28b1cb){return BUILTIN_ROLE_TYPES['includes'](_0x28b1cb);}export function assertCustomRole(_0x1b1b01,_0x387efa){const _0x48b835=a235_0x42bd67;if(_0x1b1b01['roleType']!==_0x48b835(0xd4))throw CliErrors[_0x48b835(0xae)](_0x48b835(0xbc)+_0x387efa+_0x48b835(0xa5)+_0x1b1b01[_0x48b835(0x96)]+'\x20('+_0x1b1b01[_0x48b835(0xcc)]+').','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.');}export function projectRole(_0xc535c9){const _0x40a547=a235_0x42bd67;return{'id':_0xc535c9['id'],'roleName':_0xc535c9[_0x40a547(0x96)],'roleType':_0xc535c9['roleType'],'remark':_0xc535c9[_0x40a547(0xc0)],'userCount':_0xc535c9[_0x40a547(0xa3)],'permitCount':_0xc535c9[_0x40a547(0x9c)],'builtin':isBuiltinRole(_0xc535c9[_0x40a547(0xcc)])};}export async function resolveRoleRef(_0x121349,_0xe27f86){const _0x2ae1f3=a235_0x42bd67,_0x8d91b7=_0xe27f86['trim']();if(!_0x8d91b7)throw CliErrors[_0x2ae1f3(0xae)](_0x2ae1f3(0x92),_0x2ae1f3(0xb4));if(/^\d+$/['test'](_0x8d91b7))return getRoleById(_0x121349,Number(_0x8d91b7));const _0x33810a=await listAllAppRoles(_0x121349),_0x417e4b=_0x33810a[_0x2ae1f3(0xc6)](_0x163c4f=>_0x163c4f[_0x2ae1f3(0x96)]===_0x8d91b7);if(_0x417e4b[_0x2ae1f3(0xad)]===0x0)throw CliErrors['validation'](_0x2ae1f3(0xb2)+_0x8d91b7+'\x22\x20not\x20found\x20in\x20app\x20'+_0x121349+'.',_0x2ae1f3(0xcb));if(_0x417e4b[_0x2ae1f3(0xad)]>0x1){const _0x59166c=_0x417e4b[_0x2ae1f3(0xaa)](_0xef81e2=>_0xef81e2['id'])[_0x2ae1f3(0xd3)](',\x20');throw CliErrors[_0x2ae1f3(0xae)](_0x2ae1f3(0xb2)+_0x8d91b7+_0x2ae1f3(0xa7)+_0x59166c+').',_0x2ae1f3(0xbf));}return _0x417e4b[0x0];}export async function getRoleById(_0x523218,_0x15b212){const _0x4add52=a235_0x42bd67,_0x3c8cd0=await listAllAppRoles(_0x523218),_0x23bc0d=_0x3c8cd0['filter'](_0x22bdc1=>_0x22bdc1['id']===_0x15b212&&(!_0x22bdc1[_0x4add52(0x85)]||_0x22bdc1[_0x4add52(0x85)]===_0x523218));if(_0x23bc0d[_0x4add52(0xad)]!==0x1)throw CliErrors[_0x4add52(0xae)](_0x4add52(0x8f)+_0x15b212+_0x4add52(0xca)+_0x523218+'.',_0x4add52(0xc3));return _0x23bc0d[0x0];}async function listAllAppRoles(_0xd3b1e6){const _0x2fb27f=a235_0x42bd67,_0x5c459f=0x64,_0x2a9a1c=[];for(let _0xfbd09c=0x1;;_0xfbd09c+=0x1){const {items:_0x19d964,paging:_0xed3432}=await listAppRoles(_0xd3b1e6,{'currentPage':_0xfbd09c,'pageSize':_0x5c459f});_0x2a9a1c[_0x2fb27f(0xb7)](..._0x19d964);if(_0x19d964[_0x2fb27f(0xad)]<_0x5c459f||_0xed3432&&_0x2a9a1c['length']>=_0xed3432[_0x2fb27f(0xa0)])return _0x2a9a1c;}}function a235_0x4864(_0x3a1f79,_0x3c14a1){_0x3a1f79=_0x3a1f79-0x85;const _0x103a43=a235_0x103a();let _0x4864d0=_0x103a43[_0x3a1f79];return _0x4864d0;}export async function resolveTenantCode(){const _0x384555=a235_0x42bd67,_0xa2f55=await getSessionUserInfo(),_0x50301f=_0xa2f55?.[_0x384555(0x89)]?.[_0x384555(0xbd)]?.[_0x384555(0x8a)];if(!_0x50301f)throw CliErrors[_0x384555(0xb9)](_0x384555(0xc5));return _0x50301f;}function matchMember(_0x4a95b3,_0x4368d1){const _0x5be8c1=a235_0x42bd67,_0x3da6f2=_0x4368d1[_0x5be8c1(0xa2)]()[_0x5be8c1(0x9a)]();return(_0x4a95b3[_0x5be8c1(0x98)]??'')[_0x5be8c1(0x9a)]()===_0x3da6f2||(_0x4a95b3[_0x5be8c1(0xc1)]??'')[_0x5be8c1(0x9a)]()===_0x3da6f2;}export async function resolveUserRef(_0x352d58,_0x5b57d2=a235_0x42bd67(0xb6)){const _0x4e26c1=a235_0x42bd67,_0x411576=_0x352d58['trim']();if(!_0x411576)throw CliErrors[_0x4e26c1(0xae)](_0x4e26c1(0x86),_0x4e26c1(0x8d));const _0x4569d1=await resolveTenantCode(),_0x55cdcf=await getTenantMembers(_0x4569d1);if(/^\d+$/[_0x4e26c1(0x94)](_0x411576)){const _0x4926e4=Number(_0x411576),_0x364a7c=_0x55cdcf[_0x4e26c1(0xc4)](_0xbae12a=>_0xbae12a[_0x4e26c1(0xb3)]===_0x4926e4);return{'userId':_0x4926e4,'username':_0x364a7c?.[_0x4e26c1(0xc1)]??String(_0x4926e4),'nickname':_0x364a7c?.['nickname'],'matchedBy':'id'};}const _0x58d967=_0x55cdcf[_0x4e26c1(0xc6)](_0x6bfbad=>matchMember(_0x6bfbad,_0x411576));if(_0x58d967['length']===0x0)throw CliErrors[_0x4e26c1(0xae)](_0x4e26c1(0xaf)+_0x411576+'\x22.',_0x4e26c1(0xa4)+_0x5b57d2);if(_0x58d967[_0x4e26c1(0xad)]>0x1){const _0x10eacd=_0x58d967[_0x4e26c1(0xaa)](_0x28487e=>(_0x28487e['nickname']??_0x28487e[_0x4e26c1(0xc1)]??'?')+'('+_0x28487e[_0x4e26c1(0xb3)]+')')[_0x4e26c1(0xd3)](',\x20');throw CliErrors[_0x4e26c1(0xae)](_0x4e26c1(0x95)+_0x411576+_0x4e26c1(0xab)+_0x10eacd+'.',_0x5b57d2);}const _0x27b813=_0x58d967[0x0];return{'userId':_0x27b813[_0x4e26c1(0xb3)],'username':_0x27b813[_0x4e26c1(0xc1)]??String(_0x27b813[_0x4e26c1(0xb3)]),'nickname':_0x27b813['nickname'],'matchedBy':_0x4e26c1(0x9d)};}export const CREATE_USER_ROLE_PATH=a235_0x42bd67(0x9b);export const DELETE_USER_ROLE_PATH='/smartapi/permit/user-role/delete';export function computeRoleUserMutation(_0x5a7143){const _0x4023e8=a235_0x42bd67,{operation:_0x58ae3b,appCode:_0x1324c6,role:_0x34e7be,relations:_0x1a53da,user:_0x527c27}=_0x5a7143,_0x55c7a0=[...new Set(_0x1a53da[_0x4023e8(0xaa)](_0x5da81f=>_0x5da81f[_0x4023e8(0xb3)]))],_0xf7165=[];if(_0x5a7143[_0x4023e8(0x87)]!==undefined&&_0x5a7143['expectUserCount']!==_0x55c7a0[_0x4023e8(0xad)])throw CliErrors[_0x4023e8(0xae)](_0x4023e8(0xd5)+_0x5a7143[_0x4023e8(0x87)]+_0x4023e8(0x99)+_0x55c7a0['length']+'.',_0x4023e8(0x9f));const _0x57cb0a=_0x55c7a0[_0x4023e8(0xa6)](_0x527c27[_0x4023e8(0xb3)]),_0x4ed776=_0x1a53da[_0x4023e8(0xc6)](_0x124c66=>_0x124c66[_0x4023e8(0xb3)]===_0x527c27[_0x4023e8(0xb3)])[_0x4023e8(0xaa)](_0x1392d6=>_0x1392d6['id']),_0x1d4867=_0x58ae3b==='user-add'?!_0x57cb0a:_0x57cb0a;let _0x3e2a87=_0x55c7a0;_0x58ae3b===_0x4023e8(0xd0)?_0x57cb0a?_0xf7165[_0x4023e8(0xb7)]('User\x20'+_0x527c27[_0x4023e8(0xb3)]+'\x20is\x20already\x20a\x20member\x20of\x20role\x20'+_0x34e7be['roleName']+_0x4023e8(0xc2)):_0x3e2a87=[..._0x55c7a0,_0x527c27[_0x4023e8(0xb3)]]:!_0x57cb0a?_0xf7165[_0x4023e8(0xb7)](_0x4023e8(0xac)+_0x527c27[_0x4023e8(0xb3)]+_0x4023e8(0x97)+_0x34e7be['roleName']+_0x4023e8(0xc2)):(_0x3e2a87=_0x55c7a0[_0x4023e8(0xc6)](_0x530301=>_0x530301!==_0x527c27[_0x4023e8(0xb3)]),_0x4ed776[_0x4023e8(0xad)]>0x1&&_0xf7165[_0x4023e8(0xb7)](_0x4023e8(0xcf)+_0x4ed776[_0x4023e8(0xad)]+_0x4023e8(0xc7)+_0x527c27[_0x4023e8(0xb3)]+'.'));const _0x9f3048={'scope':'dev','operation':_0x58ae3b,'selector':{'appCode':_0x1324c6,'roleId':_0x34e7be['id'],'roleName':_0x34e7be[_0x4023e8(0x96)],'userId':_0x527c27[_0x4023e8(0xb3)]},'before':{'userIds':_0x55c7a0},'after':{'userIds':_0x3e2a87},'dryRun':_0x5a7143['dryRun'],'backend':{'method':_0x4023e8(0xbb),'path':_0x58ae3b===_0x4023e8(0xd0)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0xf7165};return{'mutation':_0x9f3048,'changed':_0x1d4867,'matchingRelationIds':_0x4ed776};}export async function loadDevRoleRelations(_0x1f7adc,_0x121792){const _0x27638d=a235_0x42bd67,_0x304540=0x64,_0x4eb877=[];for(let _0x3efe88=0x1;;_0x3efe88+=0x1){const {items:_0x1669b0,paging:_0x1ca54b}=await listDevUserRoleRelations(_0x1f7adc,{'roleId':_0x121792,'currentPage':_0x3efe88,'pageSize':_0x304540});_0x4eb877[_0x27638d(0xb7)](..._0x1669b0);if(_0x1669b0[_0x27638d(0xad)]<_0x304540||_0x1ca54b&&_0x4eb877['length']>=_0x1ca54b[_0x27638d(0xa0)])return _0x4eb877;}}export function readRoleRef(_0x49c1de){const _0x59b4a1=a235_0x42bd67,_0x5ef821=_0x49c1de['str']('role')[_0x59b4a1(0xa2)]();if(!_0x5ef821)throw CliErrors[_0x59b4a1(0x88)](_0x59b4a1(0xc9),_0x59b4a1(0xb4));return _0x5ef821;}export async function prepareUserMutation(_0x2020b6,_0x1c43ad,_0x8b4aa){const _0x5e2518=a235_0x42bd67,_0x44e120=readRoleRef(_0x2020b6),_0x1a6ffc=_0x2020b6['str']('user')['trim']();if(!_0x1a6ffc)throw CliErrors[_0x5e2518(0x88)](_0x5e2518(0x89),'Pass\x20--user\x20<id|name>.');const _0x24c225=_0x2020b6[_0x5e2518(0xb0)]('expect-user-count'),_0x4dd89a=_0x24c225===undefined||_0x24c225===null?undefined:Number(_0x24c225),_0x50f9f8=await resolveRoleRef(_0x2020b6[_0x5e2518(0x85)],_0x44e120);if(_0x50f9f8[_0x5e2518(0xcc)]==='OWNER')throw CliErrors[_0x5e2518(0xae)](_0x5e2518(0xbc)+_0x1c43ad+'\x20members\x20of\x20the\x20OWNER\x20role.','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.');const _0x47eaec=await resolveUserRef(_0x1a6ffc),_0x377187=await loadDevRoleRelations(_0x2020b6[_0x5e2518(0x85)],_0x50f9f8['id']);return{...computeRoleUserMutation({'operation':_0x1c43ad,'appCode':_0x2020b6[_0x5e2518(0x85)],'role':_0x50f9f8,'relations':_0x377187,'user':{'userId':_0x47eaec[_0x5e2518(0xb3)],'username':_0x47eaec['username'],'nickname':_0x47eaec[_0x5e2518(0x98)]},'dryRun':_0x8b4aa,..._0x4dd89a!==undefined?{'expectUserCount':_0x4dd89a}:{}}),'role':_0x50f9f8,'user':_0x47eaec};}
@@ -1 +1 @@
1
- const a236_0x6d2ef2=a236_0xf707;(function(_0x288473,_0x575f39){const _0x498a54=a236_0xf707,_0x3a0d78=_0x288473();while(!![]){try{const _0x5c2f85=-parseInt(_0x498a54(0x15a))/0x1*(parseInt(_0x498a54(0x14e))/0x2)+-parseInt(_0x498a54(0x154))/0x3+parseInt(_0x498a54(0x15f))/0x4+parseInt(_0x498a54(0x148))/0x5+parseInt(_0x498a54(0x14b))/0x6+parseInt(_0x498a54(0x161))/0x7*(-parseInt(_0x498a54(0x152))/0x8)+-parseInt(_0x498a54(0x151))/0x9*(-parseInt(_0x498a54(0x153))/0xa);if(_0x5c2f85===_0x575f39)break;else _0x3a0d78['push'](_0x3a0d78['shift']());}catch(_0x3a4e55){_0x3a0d78['push'](_0x3a0d78['shift']());}}}(a236_0x1869,0x4e462));function a236_0xf707(_0x12b6e1,_0x50a8bc){_0x12b6e1=_0x12b6e1-0x145;const _0x186952=a236_0x1869();let _0xf707ec=_0x186952[_0x12b6e1];return _0xf707ec;}function a236_0x1869(){const _0x7ba67a=['1728816oFlVRZ','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','406PcWVDY','dev','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','name','909815CuyLip','\x20(id=','validation','3222096dqvhHG','update','flag','21224pqpGJm','--name\x20cannot\x20be\x20empty.','Updated\x20role\x20','45KXrABI','25240CgJfJV','259140jdHbxN','1503723elPcBE','trim','write','remark','appCode','length','26VhAzZA','POST','roleName','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','num'];a236_0x1869=function(){return _0x7ba67a;};return a236_0x1869();}import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH='/smartapi/permit/role/update';function readPatch(_0x289194){const _0x34e3b4=a236_0xf707,_0x2912cd=_0x289194[_0x34e3b4(0x14d)](_0x34e3b4(0x147)),_0x4092b5=_0x289194[_0x34e3b4(0x14d)]('remark'),_0x58bad8={};if(_0x2912cd!==undefined&&_0x2912cd!==null){const _0x5d4d5a=String(_0x2912cd)[_0x34e3b4(0x155)]();if(!_0x5d4d5a)throw CliErrors[_0x34e3b4(0x14a)](_0x34e3b4(0x14f));if(_0x5d4d5a[_0x34e3b4(0x159)]>0x40)throw CliErrors[_0x34e3b4(0x14a)](_0x34e3b4(0x160));_0x58bad8[_0x34e3b4(0x15c)]=_0x5d4d5a;}_0x4092b5!==undefined&&_0x4092b5!==null&&(_0x58bad8[_0x34e3b4(0x157)]=String(_0x4092b5));if(_0x58bad8[_0x34e3b4(0x15c)]===undefined&&_0x58bad8[_0x34e3b4(0x157)]===undefined)throw CliErrors[_0x34e3b4(0x14a)]('Nothing\x20to\x20update.',_0x34e3b4(0x146));return _0x58bad8;}export const roleUpdate={'service':'role','command':'update','description':a236_0x6d2ef2(0x15d),'risk':a236_0x6d2ef2(0x156),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a236_0x6d2ef2(0x147),'type':'string','required':![],'description':'New\x20role\x20name'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5c64d2){readPatch(_0x5c64d2);},async 'dryRun'(_0x306ae6){const _0x4f9fa9=a236_0x6d2ef2,_0x5c706f=_0x306ae6[_0x4f9fa9(0x15e)]('id'),_0x4f72da=readPatch(_0x306ae6),_0x2715be=await getRoleById(_0x306ae6[_0x4f9fa9(0x158)],_0x5c706f);return assertCustomRole(_0x2715be,'update'),asDryRunResult({'scope':_0x4f9fa9(0x145),'operation':'update','selector':{'appCode':_0x306ae6['appCode'],'roleId':_0x5c706f,'roleName':_0x2715be[_0x4f9fa9(0x15c)]},'before':projectRole(_0x2715be),'after':projectRole({..._0x2715be,..._0x4f72da[_0x4f9fa9(0x15c)]!==undefined?{'roleName':_0x4f72da[_0x4f9fa9(0x15c)]}:{},..._0x4f72da[_0x4f9fa9(0x157)]!==undefined?{'remark':_0x4f72da[_0x4f9fa9(0x157)]}:{}}),'dryRun':!![],'backend':{'method':_0x4f9fa9(0x15b),'path':UPDATE_PATH},'warnings':[]},{'method':_0x4f9fa9(0x15b),'url':UPDATE_PATH});},async 'execute'(_0x2bf65a){const _0x4d7553=a236_0x6d2ef2,_0x19642f=_0x2bf65a[_0x4d7553(0x15e)]('id'),_0xd41dbc=readPatch(_0x2bf65a),_0x2f1761=await getRoleById(_0x2bf65a[_0x4d7553(0x158)],_0x19642f);assertCustomRole(_0x2f1761,_0x4d7553(0x14c)),await updateAppRole({'id':_0x19642f,'appCode':_0x2bf65a[_0x4d7553(0x158)],..._0xd41dbc[_0x4d7553(0x15c)]!==undefined?{'roleName':_0xd41dbc[_0x4d7553(0x15c)]}:{},..._0xd41dbc[_0x4d7553(0x157)]!==undefined?{'remark':_0xd41dbc[_0x4d7553(0x157)]}:{}});const _0x548d0a=await getRoleById(_0x2bf65a['appCode'],_0x19642f);return{'ok':!![],'data':{'scope':_0x4d7553(0x145),'operation':_0x4d7553(0x14c),'selector':{'appCode':_0x2bf65a[_0x4d7553(0x158)],'roleId':_0x19642f,'roleName':_0x548d0a[_0x4d7553(0x15c)]},'before':projectRole(_0x2f1761),'after':projectRole(_0x548d0a),'dryRun':![],'backend':{'method':_0x4d7553(0x15b),'path':UPDATE_PATH},'warnings':[]},'message':_0x4d7553(0x150)+_0x548d0a[_0x4d7553(0x15c)]+_0x4d7553(0x149)+_0x19642f+')'};}};
1
+ const a236_0xc7d84b=a236_0x3bdd;function a236_0x300a(){const _0x3a0f80=['2393867oipBtT','write','name','Nothing\x20to\x20update.','num','2036504OtPEfH','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','string','170401djWaXq','flag','1555UWIZgR','length','update','\x20(id=','6ZZynoS','remark','role','2346192FGkJll','New\x20role\x20name','dev','appCode','validation','Updated\x20role\x20','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','roleName','472414ubfizJ','POST','3504pgZzbP','trim','13860513VKMgPS'];a236_0x300a=function(){return _0x3a0f80;};return a236_0x300a();}(function(_0x5a0b13,_0x440c2e){const _0x852b79=a236_0x3bdd,_0x1e9b30=_0x5a0b13();while(!![]){try{const _0x4d4a71=-parseInt(_0x852b79(0x1d9))/0x1+-parseInt(_0x852b79(0x1ea))/0x2*(parseInt(_0x852b79(0x1df))/0x3)+parseInt(_0x852b79(0x1ce))/0x4*(-parseInt(_0x852b79(0x1db))/0x5)+parseInt(_0x852b79(0x1e2))/0x6+-parseInt(_0x852b79(0x1d1))/0x7+-parseInt(_0x852b79(0x1d6))/0x8+parseInt(_0x852b79(0x1d0))/0x9;if(_0x4d4a71===_0x440c2e)break;else _0x1e9b30['push'](_0x1e9b30['shift']());}catch(_0x52a3b9){_0x1e9b30['push'](_0x1e9b30['shift']());}}}(a236_0x300a,0x665de));function a236_0x3bdd(_0x459399,_0x5311f9){_0x459399=_0x459399-0x1cd;const _0x300a82=a236_0x300a();let _0x3bdd2e=_0x300a82[_0x459399];return _0x3bdd2e;}import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH='/smartapi/permit/role/update';function readPatch(_0x3a226f){const _0x2ec5e5=a236_0x3bdd,_0x16aaeb=_0x3a226f[_0x2ec5e5(0x1da)](_0x2ec5e5(0x1d3)),_0x339d90=_0x3a226f[_0x2ec5e5(0x1da)](_0x2ec5e5(0x1e0)),_0xb07edc={};if(_0x16aaeb!==undefined&&_0x16aaeb!==null){const _0xe7afec=String(_0x16aaeb)[_0x2ec5e5(0x1cf)]();if(!_0xe7afec)throw CliErrors[_0x2ec5e5(0x1e6)]('--name\x20cannot\x20be\x20empty.');if(_0xe7afec[_0x2ec5e5(0x1dc)]>0x40)throw CliErrors[_0x2ec5e5(0x1e6)](_0x2ec5e5(0x1d7));_0xb07edc[_0x2ec5e5(0x1e9)]=_0xe7afec;}_0x339d90!==undefined&&_0x339d90!==null&&(_0xb07edc[_0x2ec5e5(0x1e0)]=String(_0x339d90));if(_0xb07edc['roleName']===undefined&&_0xb07edc[_0x2ec5e5(0x1e0)]===undefined)throw CliErrors[_0x2ec5e5(0x1e6)](_0x2ec5e5(0x1d4),_0x2ec5e5(0x1e8));return _0xb07edc;}export const roleUpdate={'service':a236_0xc7d84b(0x1e1),'command':a236_0xc7d84b(0x1dd),'description':'Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','risk':a236_0xc7d84b(0x1d2),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':'name','type':a236_0xc7d84b(0x1d8),'required':![],'description':a236_0xc7d84b(0x1e3)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x535166){readPatch(_0x535166);},async 'dryRun'(_0x36808b){const _0x547f85=a236_0xc7d84b,_0x47acbf=_0x36808b[_0x547f85(0x1d5)]('id'),_0x40d1fb=readPatch(_0x36808b),_0x156609=await getRoleById(_0x36808b[_0x547f85(0x1e5)],_0x47acbf);return assertCustomRole(_0x156609,_0x547f85(0x1dd)),asDryRunResult({'scope':_0x547f85(0x1e4),'operation':_0x547f85(0x1dd),'selector':{'appCode':_0x36808b[_0x547f85(0x1e5)],'roleId':_0x47acbf,'roleName':_0x156609[_0x547f85(0x1e9)]},'before':projectRole(_0x156609),'after':projectRole({..._0x156609,..._0x40d1fb[_0x547f85(0x1e9)]!==undefined?{'roleName':_0x40d1fb['roleName']}:{},..._0x40d1fb[_0x547f85(0x1e0)]!==undefined?{'remark':_0x40d1fb[_0x547f85(0x1e0)]}:{}}),'dryRun':!![],'backend':{'method':_0x547f85(0x1cd),'path':UPDATE_PATH},'warnings':[]},{'method':_0x547f85(0x1cd),'url':UPDATE_PATH});},async 'execute'(_0xc9a5a){const _0x5e1427=a236_0xc7d84b,_0x2de37e=_0xc9a5a[_0x5e1427(0x1d5)]('id'),_0x46eba1=readPatch(_0xc9a5a),_0x57ab9a=await getRoleById(_0xc9a5a[_0x5e1427(0x1e5)],_0x2de37e);assertCustomRole(_0x57ab9a,_0x5e1427(0x1dd)),await updateAppRole({'id':_0x2de37e,'appCode':_0xc9a5a[_0x5e1427(0x1e5)],..._0x46eba1[_0x5e1427(0x1e9)]!==undefined?{'roleName':_0x46eba1['roleName']}:{},..._0x46eba1[_0x5e1427(0x1e0)]!==undefined?{'remark':_0x46eba1[_0x5e1427(0x1e0)]}:{}});const _0x109688=await getRoleById(_0xc9a5a[_0x5e1427(0x1e5)],_0x2de37e);return{'ok':!![],'data':{'scope':'dev','operation':_0x5e1427(0x1dd),'selector':{'appCode':_0xc9a5a[_0x5e1427(0x1e5)],'roleId':_0x2de37e,'roleName':_0x109688[_0x5e1427(0x1e9)]},'before':projectRole(_0x57ab9a),'after':projectRole(_0x109688),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':_0x5e1427(0x1e7)+_0x109688['roleName']+_0x5e1427(0x1de)+_0x2de37e+')'};}};
@@ -1 +1 @@
1
- function a237_0x2d91(){const _0x13aecb=['userId','roleName','6707310dkKrGe','user-add','selector','roleId','11940RPgIdF','No\x20change:\x20user\x20','\x20to\x20role\x20','148oflrNh','roleType','607920MlumDu','role','Added\x20user\x20','appCode','108LXSJFx','POST','3367712ELVdvL','5075028EltrLd','2172YVHkhd','965499dTliYW','high-risk-write','username','31413oxRfjX'];a237_0x2d91=function(){return _0x13aecb;};return a237_0x2d91();}const a237_0x3eca58=a237_0xa8b4;(function(_0x4b05a6,_0x171523){const _0x4043e0=a237_0xa8b4,_0x2a4b34=_0x4b05a6();while(!![]){try{const _0xc68105=-parseInt(_0x4043e0(0xc2))/0x1+-parseInt(_0x4043e0(0xcf))/0x2*(parseInt(_0x4043e0(0xc5))/0x3)+parseInt(_0x4043e0(0xbf))/0x4+parseInt(_0x4043e0(0xcc))/0x5*(-parseInt(_0x4043e0(0xc1))/0x6)+parseInt(_0x4043e0(0xc0))/0x7+-parseInt(_0x4043e0(0xd1))/0x8*(-parseInt(_0x4043e0(0xbd))/0x9)+parseInt(_0x4043e0(0xc8))/0xa;if(_0xc68105===_0x171523)break;else _0x2a4b34['push'](_0x2a4b34['shift']());}catch(_0x58676c){_0x2a4b34['push'](_0x2a4b34['shift']());}}}(a237_0x2d91,0x84fde));import{createDevUserRole}from'../../core/api-client.js';function a237_0xa8b4(_0x4f824a,_0x371c74){_0x4f824a=_0x4f824a-0xbc;const _0x2d9101=a237_0x2d91();let _0xa8b48a=_0x2d9101[_0x4f824a];return _0xa8b48a;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,CREATE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':a237_0x3eca58(0xd2),'command':'user-add','description':'Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','risk':a237_0x3eca58(0xc3),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x527389){const _0x1bca18=a237_0x3eca58,{mutation:_0x38d201}=await prepareUserMutation(_0x527389,_0x1bca18(0xc9),!![]);return asDryRunResult(_0x38d201,{'method':_0x1bca18(0xbe),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x2bd2c4){const _0x36b8ac=a237_0x3eca58,{mutation:_0x174cdb,changed:_0x162ec1,role:_0x46f3a3,user:_0x4f5f31}=await prepareUserMutation(_0x2bd2c4,_0x36b8ac(0xc9),![]);return _0x162ec1&&await createDevUserRole({'appCode':_0x2bd2c4[_0x36b8ac(0xbc)],'userId':_0x4f5f31[_0x36b8ac(0xc6)],'username':_0x4f5f31[_0x36b8ac(0xc4)],'roleType':_0x46f3a3[_0x36b8ac(0xd0)],'roleId':_0x174cdb['selector'][_0x36b8ac(0xcb)]}),{'ok':!![],'data':_0x174cdb,'message':_0x162ec1?_0x36b8ac(0xd3)+_0x174cdb[_0x36b8ac(0xca)][_0x36b8ac(0xc6)]+_0x36b8ac(0xce)+_0x174cdb[_0x36b8ac(0xca)]['roleName']:_0x36b8ac(0xcd)+_0x174cdb[_0x36b8ac(0xca)][_0x36b8ac(0xc6)]+'\x20already\x20in\x20role\x20'+_0x174cdb['selector'][_0x36b8ac(0xc7)]};}};
1
+ function a237_0x345e(){const _0x39781c=['role','appCode','543034gemnEa','No\x20change:\x20user\x20','roleName','8IAceSK','12265749lvsJGg','7739424DzBGOG','5910110vbMdqw','roleId','Added\x20user\x20','Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','selector','username','2252548qPVQEC','1OvYOIQ','10kxOcdq','\x20to\x20role\x20','userId','POST','913176idFuVB','\x20already\x20in\x20role\x20','6813695VByHbK','user-add'];a237_0x345e=function(){return _0x39781c;};return a237_0x345e();}function a237_0x3499(_0x2657c0,_0x2d2729){_0x2657c0=_0x2657c0-0x8c;const _0x345ed5=a237_0x345e();let _0x349958=_0x345ed5[_0x2657c0];return _0x349958;}const a237_0xa153b=a237_0x3499;(function(_0xd63a7f,_0x42278d){const _0x3383f6=a237_0x3499,_0x541c73=_0xd63a7f();while(!![]){try{const _0xb5e24e=parseInt(_0x3383f6(0xa1))/0x1*(-parseInt(_0x3383f6(0x94))/0x2)+parseInt(_0x3383f6(0x8e))/0x3+-parseInt(_0x3383f6(0xa0))/0x4*(-parseInt(_0x3383f6(0xa2))/0x5)+parseInt(_0x3383f6(0x99))/0x6+-parseInt(_0x3383f6(0x90))/0x7+-parseInt(_0x3383f6(0x97))/0x8*(parseInt(_0x3383f6(0x98))/0x9)+parseInt(_0x3383f6(0x9a))/0xa;if(_0xb5e24e===_0x42278d)break;else _0x541c73['push'](_0x541c73['shift']());}catch(_0x18e612){_0x541c73['push'](_0x541c73['shift']());}}}(a237_0x345e,0xabd4a));import{createDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,CREATE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':a237_0xa153b(0x92),'command':'user-add','description':a237_0xa153b(0x9d),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x3763f9){const _0x2bb581=a237_0xa153b,{mutation:_0x5d87b0}=await prepareUserMutation(_0x3763f9,_0x2bb581(0x91),!![]);return asDryRunResult(_0x5d87b0,{'method':_0x2bb581(0x8d),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x12a78c){const _0x1db9a1=a237_0xa153b,{mutation:_0x4526fa,changed:_0x3bab2a,role:_0x15987c,user:_0x43eae3}=await prepareUserMutation(_0x12a78c,'user-add',![]);return _0x3bab2a&&await createDevUserRole({'appCode':_0x12a78c[_0x1db9a1(0x93)],'userId':_0x43eae3[_0x1db9a1(0x8c)],'username':_0x43eae3[_0x1db9a1(0x9f)],'roleType':_0x15987c['roleType'],'roleId':_0x4526fa[_0x1db9a1(0x9e)][_0x1db9a1(0x9b)]}),{'ok':!![],'data':_0x4526fa,'message':_0x3bab2a?_0x1db9a1(0x9c)+_0x4526fa['selector'][_0x1db9a1(0x8c)]+_0x1db9a1(0xa3)+_0x4526fa[_0x1db9a1(0x9e)]['roleName']:_0x1db9a1(0x95)+_0x4526fa[_0x1db9a1(0x9e)][_0x1db9a1(0x8c)]+_0x1db9a1(0x8f)+_0x4526fa[_0x1db9a1(0x9e)][_0x1db9a1(0x96)]};}};
@@ -1 +1 @@
1
- const a238_0x111590=a238_0xe242;(function(_0xcf61bd,_0x32047c){const _0x23ea9f=a238_0xe242,_0x4aba28=_0xcf61bd();while(!![]){try{const _0x84183f=parseInt(_0x23ea9f(0x127))/0x1*(parseInt(_0x23ea9f(0x123))/0x2)+parseInt(_0x23ea9f(0x11a))/0x3*(parseInt(_0x23ea9f(0x125))/0x4)+parseInt(_0x23ea9f(0x11b))/0x5*(-parseInt(_0x23ea9f(0x128))/0x6)+-parseInt(_0x23ea9f(0x129))/0x7*(parseInt(_0x23ea9f(0x11d))/0x8)+parseInt(_0x23ea9f(0x11e))/0x9+parseInt(_0x23ea9f(0x124))/0xa+-parseInt(_0x23ea9f(0x121))/0xb*(-parseInt(_0x23ea9f(0x11f))/0xc);if(_0x84183f===_0x32047c)break;else _0x4aba28['push'](_0x4aba28['shift']());}catch(_0x3474fb){_0x4aba28['push'](_0x4aba28['shift']());}}}(a238_0x5d11,0xec8ef));import{deleteDevUserRole}from'../../core/api-client.js';function a238_0x5d11(){const _0x58c1fb=['Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','Removed\x20user\x20','36jKTgtb','8441695MDPiLb','userId','64ovsyzL','5626944ANsuXC','276CFyZfv','roleName','364254yBGuwF','selector','787134nVFTDm','11466020mquSjt','143124dTCEdI','\x20from\x20role\x20','2wFrnJn','6Iuiwjt','956081xGrhnO','user-remove'];a238_0x5d11=function(){return _0x58c1fb;};return a238_0x5d11();}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';function a238_0xe242(_0x48490b,_0x5e4c0a){_0x48490b=_0x48490b-0x11a;const _0x5d11df=a238_0x5d11();let _0xe242ea=_0x5d11df[_0x48490b];return _0xe242ea;}export const roleUserRemove={'service':'role','command':a238_0x111590(0x12a),'description':a238_0x111590(0x12b),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x29cb56){const _0x1cb238=a238_0x111590,{mutation:_0x437e9b}=await prepareUserMutation(_0x29cb56,_0x1cb238(0x12a),!![]);return asDryRunResult(_0x437e9b,{'method':'POST','url':DELETE_USER_ROLE_PATH});},async 'execute'(_0xecaf4a){const _0x42041f=a238_0x111590,{matchingRelationIds:_0x43c7fa,mutation:_0x4ef214,changed:_0x1e5d06}=await prepareUserMutation(_0xecaf4a,_0x42041f(0x12a),![]);if(_0x1e5d06)for(const _0x235398 of _0x43c7fa){await deleteDevUserRole(_0x235398);}return{'ok':!![],'data':_0x4ef214,'message':_0x1e5d06?_0x42041f(0x12c)+_0x4ef214['selector'][_0x42041f(0x11c)]+_0x42041f(0x126)+_0x4ef214[_0x42041f(0x122)]['roleName']:'No\x20change:\x20user\x20'+_0x4ef214[_0x42041f(0x122)][_0x42041f(0x11c)]+'\x20not\x20in\x20role\x20'+_0x4ef214[_0x42041f(0x122)][_0x42041f(0x120)]};}};
1
+ const a238_0x40d8c7=a238_0x3960;(function(_0x61923d,_0x2fe730){const _0xf1f517=a238_0x3960,_0x25f794=_0x61923d();while(!![]){try{const _0x132627=parseInt(_0xf1f517(0xc1))/0x1+-parseInt(_0xf1f517(0xbe))/0x2+parseInt(_0xf1f517(0xb0))/0x3+-parseInt(_0xf1f517(0xba))/0x4*(parseInt(_0xf1f517(0xbb))/0x5)+-parseInt(_0xf1f517(0xb6))/0x6*(-parseInt(_0xf1f517(0xc2))/0x7)+parseInt(_0xf1f517(0xb8))/0x8+-parseInt(_0xf1f517(0xbc))/0x9*(parseInt(_0xf1f517(0xb3))/0xa);if(_0x132627===_0x2fe730)break;else _0x25f794['push'](_0x25f794['shift']());}catch(_0x30e0ec){_0x25f794['push'](_0x25f794['shift']());}}}(a238_0x21de,0x6434c));import{deleteDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a238_0x3960(_0x21a759,_0x283d71){_0x21a759=_0x21a759-0xaf;const _0x21dee4=a238_0x21de();let _0x396035=_0x21dee4[_0x21a759];return _0x396035;}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':a238_0x40d8c7(0xb2),'description':a238_0x40d8c7(0xaf),'risk':a238_0x40d8c7(0xb4),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x343440){const _0x51ea45=a238_0x40d8c7,{mutation:_0x1302a2}=await prepareUserMutation(_0x343440,_0x51ea45(0xb2),!![]);return asDryRunResult(_0x1302a2,{'method':_0x51ea45(0xbd),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x470fde){const _0x57a766=a238_0x40d8c7,{matchingRelationIds:_0x3eb5ff,mutation:_0x3461c1,changed:_0x4eb68b}=await prepareUserMutation(_0x470fde,_0x57a766(0xb2),![]);if(_0x4eb68b)for(const _0x581e04 of _0x3eb5ff){await deleteDevUserRole(_0x581e04);}return{'ok':!![],'data':_0x3461c1,'message':_0x4eb68b?_0x57a766(0xb5)+_0x3461c1[_0x57a766(0xb9)][_0x57a766(0xb7)]+_0x57a766(0xbf)+_0x3461c1[_0x57a766(0xb9)][_0x57a766(0xb1)]:_0x57a766(0xc0)+_0x3461c1['selector'][_0x57a766(0xb7)]+'\x20not\x20in\x20role\x20'+_0x3461c1[_0x57a766(0xb9)][_0x57a766(0xb1)]};}};function a238_0x21de(){const _0x4bc903=['POST','1597700mhMGOi','\x20from\x20role\x20','No\x20change:\x20user\x20','487227eFuTZM','7xleILa','Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','1191222nTAvIA','roleName','user-remove','10lpBFWq','high-risk-write','Removed\x20user\x20','4882230KCuZMK','userId','1774464pIFUtG','selector','460748ZDxesr','5qrqWZD','5357997DWEVuV'];a238_0x21de=function(){return _0x4bc903;};return a238_0x21de();}
@@ -1 +1 @@
1
- function a239_0x1417(_0x35fc89,_0x318dfa){_0x35fc89=_0x35fc89-0x126;const _0x3db590=a239_0x3db5();let _0x1417d0=_0x3db590[_0x35fc89];return _0x1417d0;}function a239_0x3db5(){const _0x19c223=['flagMissing','1652IKeioW','5vbCrUf','\x22\x20→\x20userId\x20','read','3215660WAyTjT','userId','username','nickname','role','41759Jafora','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','3141831dSdijZ','13815LJmeUe','matchedBy','str','3011388XJyeqI','3693XNdqub','344XyYxDG','name','2915704AGKSTU','22Xxfxud'];a239_0x3db5=function(){return _0x19c223;};return a239_0x3db5();}const a239_0x38c886=a239_0x1417;(function(_0x3ef846,_0x46fcf0){const _0x3a0677=a239_0x1417,_0x4b7141=_0x3ef846();while(!![]){try{const _0x2b45ed=parseInt(_0x3a0677(0x12a))/0x1*(parseInt(_0x3a0677(0x135))/0x2)+-parseInt(_0x3a0677(0x131))/0x3*(-parseInt(_0x3a0677(0x137))/0x4)+-parseInt(_0x3a0677(0x138))/0x5*(parseInt(_0x3a0677(0x130))/0x6)+parseInt(_0x3a0677(0x12c))/0x7+-parseInt(_0x3a0677(0x132))/0x8*(parseInt(_0x3a0677(0x12d))/0x9)+-parseInt(_0x3a0677(0x13b))/0xa+-parseInt(_0x3a0677(0x134))/0xb;if(_0x2b45ed===_0x46fcf0)break;else _0x4b7141['push'](_0x4b7141['shift']());}catch(_0x46afa8){_0x4b7141['push'](_0x4b7141['shift']());}}}(a239_0x3db5,0x3ffa4));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':a239_0x38c886(0x129),'command':'user-resolve','description':a239_0x38c886(0x12b),'risk':a239_0x38c886(0x13a),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2bbdef){const _0x5d68eb=a239_0x38c886;if(!_0x2bbdef[_0x5d68eb(0x12f)](_0x5d68eb(0x133))['trim']())throw CliErrors[_0x5d68eb(0x136)](_0x5d68eb(0x133),'Pass\x20--name\x20<nickname|username>.');},async 'execute'(_0x2e0bca){const _0x31d31c=a239_0x38c886,_0x32c00f=_0x2e0bca[_0x31d31c(0x12f)](_0x31d31c(0x133))['trim'](),_0x311d20=await resolveUserRef(_0x32c00f,'Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.');return{'ok':!![],'data':{'user':{'userId':_0x311d20[_0x31d31c(0x126)],'username':_0x311d20[_0x31d31c(0x127)],'nickname':_0x311d20[_0x31d31c(0x128)],'matchedBy':_0x311d20[_0x31d31c(0x12e)]}},'message':'Resolved\x20\x22'+_0x32c00f+_0x31d31c(0x139)+_0x311d20[_0x31d31c(0x126)]};}};
1
+ const a239_0x233f2e=a239_0x1bcf;function a239_0x1bcf(_0x5110cf,_0x1f30fd){_0x5110cf=_0x5110cf-0xc7;const _0x264455=a239_0x2644();let _0x1bcf1e=_0x264455[_0x5110cf];return _0x1bcf1e;}function a239_0x2644(){const _0x3460ba=['2066450acYhWS','3219165AekVHb','19089207kGlPON','Resolved\x20\x22','matchedBy','userId','flagMissing','\x22\x20→\x20userId\x20','15SmgTwp','6819968yZLMZi','6hFrvge','name','str','user-resolve','read','trim','1399556rBiiLm','7350308dgfoEH','nickname','username','176420rdpvgJ'];a239_0x2644=function(){return _0x3460ba;};return a239_0x2644();}(function(_0x5f4def,_0x308eb3){const _0x105644=a239_0x1bcf,_0x402b1f=_0x5f4def();while(!![]){try{const _0x1ee5af=-parseInt(_0x105644(0xcf))/0x1+parseInt(_0x105644(0xd0))/0x2+parseInt(_0x105644(0xd1))/0x3+parseInt(_0x105644(0xcb))/0x4*(parseInt(_0x105644(0xd8))/0x5)+parseInt(_0x105644(0xda))/0x6*(-parseInt(_0x105644(0xcc))/0x7)+parseInt(_0x105644(0xd9))/0x8+-parseInt(_0x105644(0xd2))/0x9;if(_0x1ee5af===_0x308eb3)break;else _0x402b1f['push'](_0x402b1f['shift']());}catch(_0x552f5a){_0x402b1f['push'](_0x402b1f['shift']());}}}(a239_0x2644,0xa15dc));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':'role','command':a239_0x233f2e(0xc8),'description':'Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','risk':a239_0x233f2e(0xc9),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3ae378){const _0x1ce625=a239_0x233f2e;if(!_0x3ae378[_0x1ce625(0xc7)](_0x1ce625(0xdb))[_0x1ce625(0xca)]())throw CliErrors[_0x1ce625(0xd6)]('name','Pass\x20--name\x20<nickname|username>.');},async 'execute'(_0x332bda){const _0x4354d8=a239_0x233f2e,_0x2db747=_0x332bda[_0x4354d8(0xc7)](_0x4354d8(0xdb))[_0x4354d8(0xca)](),_0x37439f=await resolveUserRef(_0x2db747,'Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.');return{'ok':!![],'data':{'user':{'userId':_0x37439f[_0x4354d8(0xd5)],'username':_0x37439f[_0x4354d8(0xce)],'nickname':_0x37439f[_0x4354d8(0xcd)],'matchedBy':_0x37439f[_0x4354d8(0xd4)]}},'message':_0x4354d8(0xd3)+_0x2db747+_0x4354d8(0xd7)+_0x37439f[_0x4354d8(0xd5)]};}};
@@ -1 +1 @@
1
- const a240_0x388d98=a240_0x5ae8;function a240_0x39eb(){const _0x3ed288=['read','175680JOsHlh','Loaded\x20','1cMnDTe','app_rule_not_found','Get\x20one\x20agent\x20context\x20rule\x20for\x20the\x20resolved\x20app','605114FIFDpN','6ZeShMm','rule','1809304VpxMMP','1384062qqMxoH','\x20--file\x20<path>\x20--dry-run`.','cookie','24uBtOBa','1351071lnYAxy','appCode','1076ukRQlL','\x20is\x20not\x20configured\x20for\x20app\x20','8734jATlZL','1670gjoXJO','4310eIFijE'];a240_0x39eb=function(){return _0x3ed288;};return a240_0x39eb();}(function(_0x38ac29,_0x569034){const _0x419251=a240_0x5ae8,_0x4cf961=_0x38ac29();while(!![]){try{const _0x3e3b53=parseInt(_0x419251(0x1be))/0x1*(-parseInt(_0x419251(0x1c1))/0x2)+parseInt(_0x419251(0x1b0))/0x3+parseInt(_0x419251(0x1b6))/0x4*(-parseInt(_0x419251(0x1b9))/0x5)+-parseInt(_0x419251(0x1ad))/0x6*(-parseInt(_0x419251(0x1af))/0x7)+parseInt(_0x419251(0x1b3))/0x8*(-parseInt(_0x419251(0x1b4))/0x9)+parseInt(_0x419251(0x1ba))/0xa*(parseInt(_0x419251(0x1b8))/0xb)+parseInt(_0x419251(0x1bc))/0xc;if(_0x3e3b53===_0x569034)break;else _0x4cf961['push'](_0x4cf961['shift']());}catch(_0x3874da){_0x4cf961['push'](_0x4cf961['shift']());}}}(a240_0x39eb,0x391c0));import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPE_FLAG,appRuleError,appRuleFileName,projectAppRule,readAppRuleType}from'../../commands/rule/shared.js';function a240_0x5ae8(_0x3cf40,_0x21da96){_0x3cf40=_0x3cf40-0x1ad;const _0x39eb8a=a240_0x39eb();let _0x5ae88e=_0x39eb8a[_0x3cf40];return _0x5ae88e;}export const ruleGet={'service':a240_0x388d98(0x1ae),'command':'get','description':a240_0x388d98(0x1c0),'risk':a240_0x388d98(0x1bb),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG],async 'validate'(_0x4f737f){readAppRuleType(_0x4f737f);},async 'execute'(_0x48c333){const _0x5072b0=a240_0x388d98,_0x24dddd=readAppRuleType(_0x48c333),_0x4ae783=await getAppRule(_0x48c333[_0x5072b0(0x1b2)],{'appCode':_0x48c333['appCode'],'type':_0x24dddd});if(!_0x4ae783)throw appRuleError(_0x5072b0(0x1bf),appRuleFileName(_0x24dddd)+_0x5072b0(0x1b7)+_0x48c333['appCode']+'.','Create\x20it\x20with\x20`rabetbase\x20rule\x20set\x20--type\x20'+_0x24dddd+_0x5072b0(0x1b1));return{'ok':!![],'data':{'rule':{...projectAppRule(_0x24dddd,_0x4ae783),'content':_0x4ae783['content']}},'message':_0x5072b0(0x1bd)+appRuleFileName(_0x24dddd)+'\x20for\x20'+_0x48c333[_0x5072b0(0x1b5)]};}};
1
+ function a240_0x21eb(){const _0x324cc6=['1340gKdUqe','60ZdKWDe','appCode','259548uXyDCe','app_rule_not_found','90qUwcvi','352947FNxQPb','1778820NZHEus','32YZbjDu','\x20--file\x20<path>\x20--dry-run`.','47456UdJxna','content','666642mIAnrB','Create\x20it\x20with\x20`rabetbase\x20rule\x20set\x20--type\x20','66TxQkwq','30442ahAJzd','Loaded\x20','rule','70yaMpUs','\x20for\x20','read'];a240_0x21eb=function(){return _0x324cc6;};return a240_0x21eb();}const a240_0x2d18de=a240_0x4ffc;(function(_0x35a6b7,_0x221a7c){const _0x37e52c=a240_0x4ffc,_0x27851b=_0x35a6b7();while(!![]){try{const _0x3f73b1=parseInt(_0x37e52c(0x13b))/0x1*(parseInt(_0x37e52c(0x134))/0x2)+parseInt(_0x37e52c(0x132))/0x3+-parseInt(_0x37e52c(0x141))/0x4*(-parseInt(_0x37e52c(0x12d))/0x5)+-parseInt(_0x37e52c(0x138))/0x6*(-parseInt(_0x37e52c(0x13e))/0x7)+parseInt(_0x37e52c(0x136))/0x8*(parseInt(_0x37e52c(0x131))/0x9)+parseInt(_0x37e52c(0x133))/0xa*(-parseInt(_0x37e52c(0x13a))/0xb)+parseInt(_0x37e52c(0x12f))/0xc;if(_0x3f73b1===_0x221a7c)break;else _0x27851b['push'](_0x27851b['shift']());}catch(_0x5bd52f){_0x27851b['push'](_0x27851b['shift']());}}}(a240_0x21eb,0xb311c));import{getAppRule}from'../../core/api-client.js';function a240_0x4ffc(_0x4a12de,_0x281841){_0x4a12de=_0x4a12de-0x12d;const _0x21eba0=a240_0x21eb();let _0x4ffc48=_0x21eba0[_0x4a12de];return _0x4ffc48;}import{APP_RULE_TYPE_FLAG,appRuleError,appRuleFileName,projectAppRule,readAppRuleType}from'../../commands/rule/shared.js';export const ruleGet={'service':a240_0x2d18de(0x13d),'command':'get','description':'Get\x20one\x20agent\x20context\x20rule\x20for\x20the\x20resolved\x20app','risk':a240_0x2d18de(0x140),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG],async 'validate'(_0x2d58c0){readAppRuleType(_0x2d58c0);},async 'execute'(_0x396e2e){const _0x3449b2=a240_0x2d18de,_0x1d04d0=readAppRuleType(_0x396e2e),_0x1548ad=await getAppRule(_0x396e2e['cookie'],{'appCode':_0x396e2e[_0x3449b2(0x12e)],'type':_0x1d04d0});if(!_0x1548ad)throw appRuleError(_0x3449b2(0x130),appRuleFileName(_0x1d04d0)+'\x20is\x20not\x20configured\x20for\x20app\x20'+_0x396e2e['appCode']+'.',_0x3449b2(0x139)+_0x1d04d0+_0x3449b2(0x135));return{'ok':!![],'data':{'rule':{...projectAppRule(_0x1d04d0,_0x1548ad),'content':_0x1548ad[_0x3449b2(0x137)]}},'message':_0x3449b2(0x13c)+appRuleFileName(_0x1d04d0)+_0x3449b2(0x13f)+_0x396e2e[_0x3449b2(0x12e)]};}};
@@ -1 +1 @@
1
- function a241_0x534e(){const _0x4c9525=['20tbhAIN','6165365Lcgvpc','signal','dryRun','4006064oBTOpd','1132338ZMATHf','70956GDUWlw','5497452DDJjOj','1217574Nhhufw','42khQAYT','91lkufMV','107028DhkTjF'];a241_0x534e=function(){return _0x4c9525;};return a241_0x534e();}const a241_0x44310d=a241_0x2868;(function(_0x87f405,_0x32092a){const _0x16e300=a241_0x2868,_0x30662f=_0x87f405();while(!![]){try{const _0x127665=parseInt(_0x16e300(0x156))/0x1+parseInt(_0x16e300(0x159))/0x2+-parseInt(_0x16e300(0x15a))/0x3*(parseInt(_0x16e300(0x15c))/0x4)+parseInt(_0x16e300(0x15e))/0x5+-parseInt(_0x16e300(0x157))/0x6*(parseInt(_0x16e300(0x15b))/0x7)+-parseInt(_0x16e300(0x155))/0x8+-parseInt(_0x16e300(0x158))/0x9*(parseInt(_0x16e300(0x15d))/0xa);if(_0x127665===_0x32092a)break;else _0x30662f['push'](_0x30662f['shift']());}catch(_0x98404b){_0x30662f['push'](_0x30662f['shift']());}}}(a241_0x534e,0xb09f8));import{withKbManagementSession}from'../../core/kb-management-client.js';import{ruleGet}from'../../commands/rule/get.js';function a241_0x2868(_0x2d1282,_0x3c93d6){_0x2d1282=_0x2d1282-0x155;const _0x534e6b=a241_0x534e();let _0x286814=_0x534e6b[_0x2d1282];return _0x286814;}import{ruleList}from'../../commands/rule/list.js';import{ruleSet}from'../../commands/rule/set.js';export const ruleDefinitions=[ruleList,ruleGet,ruleSet]['map'](_0x4227c3=>({..._0x4227c3,'execute':_0x4799cc=>withKbManagementSession(_0x4799cc[a241_0x44310d(0x15f)],()=>_0x4227c3['execute'](_0x4799cc)),..._0x4227c3['dryRun']?{'dryRun':_0x3c3a9=>withKbManagementSession(_0x3c3a9['signal'],()=>_0x4227c3[a241_0x44310d(0x160)](_0x3c3a9))}:{}}));
1
+ const a241_0x49c3eb=a241_0x1e2e;(function(_0x10e065,_0x2755c8){const _0x3f58d6=a241_0x1e2e,_0x564ae6=_0x10e065();while(!![]){try{const _0x50be7f=-parseInt(_0x3f58d6(0x174))/0x1*(-parseInt(_0x3f58d6(0x178))/0x2)+-parseInt(_0x3f58d6(0x17b))/0x3+-parseInt(_0x3f58d6(0x176))/0x4+parseInt(_0x3f58d6(0x17a))/0x5+-parseInt(_0x3f58d6(0x17f))/0x6+-parseInt(_0x3f58d6(0x17e))/0x7*(parseInt(_0x3f58d6(0x179))/0x8)+parseInt(_0x3f58d6(0x173))/0x9;if(_0x50be7f===_0x2755c8)break;else _0x564ae6['push'](_0x564ae6['shift']());}catch(_0x2fe899){_0x564ae6['push'](_0x564ae6['shift']());}}}(a241_0x866b,0x31f8b));import{withKbManagementSession}from'../../core/kb-management-client.js';import{ruleGet}from'../../commands/rule/get.js';import{ruleList}from'../../commands/rule/list.js';function a241_0x866b(){const _0x117595=['map','2gxZxeZ','256Yucgkh','122240unTQsI','687450VQgGcG','signal','execute','66577BJwVPq','569556vQMRRy','6316767lfCumm','399963TOOoxz','dryRun','1172652GWaClv'];a241_0x866b=function(){return _0x117595;};return a241_0x866b();}function a241_0x1e2e(_0x2b0ac5,_0x2f1648){_0x2b0ac5=_0x2b0ac5-0x173;const _0x866b8a=a241_0x866b();let _0x1e2e5c=_0x866b8a[_0x2b0ac5];return _0x1e2e5c;}import{ruleSet}from'../../commands/rule/set.js';export const ruleDefinitions=[ruleList,ruleGet,ruleSet][a241_0x49c3eb(0x177)](_0x5345f6=>({..._0x5345f6,'execute':_0x240c3b=>withKbManagementSession(_0x240c3b[a241_0x49c3eb(0x17c)],()=>_0x5345f6[a241_0x49c3eb(0x17d)](_0x240c3b)),..._0x5345f6[a241_0x49c3eb(0x175)]?{'dryRun':_0x4d3837=>withKbManagementSession(_0x4d3837[a241_0x49c3eb(0x17c)],()=>_0x5345f6[a241_0x49c3eb(0x175)](_0x4d3837))}:{}}));
@@ -1 +1 @@
1
- const a242_0x5485a4=a242_0x4cc1;(function(_0x1c4ae6,_0x4ee4e9){const _0x3c5c81=a242_0x4cc1,_0x5058a1=_0x1c4ae6();while(!![]){try{const _0x3c628f=parseInt(_0x3c5c81(0x104))/0x1*(-parseInt(_0x3c5c81(0xf4))/0x2)+-parseInt(_0x3c5c81(0xf7))/0x3+-parseInt(_0x3c5c81(0xf6))/0x4*(parseInt(_0x3c5c81(0x100))/0x5)+parseInt(_0x3c5c81(0x105))/0x6+-parseInt(_0x3c5c81(0xfc))/0x7*(-parseInt(_0x3c5c81(0xfb))/0x8)+-parseInt(_0x3c5c81(0x107))/0x9+-parseInt(_0x3c5c81(0x101))/0xa*(-parseInt(_0x3c5c81(0xfd))/0xb);if(_0x3c628f===_0x4ee4e9)break;else _0x5058a1['push'](_0x5058a1['shift']());}catch(_0x35746a){_0x5058a1['push'](_0x5058a1['shift']());}}}(a242_0x3a7a,0x1a4b3));import{getAppRule}from'../../core/api-client.js';function a242_0x4cc1(_0x4fc0a5,_0x19a1ea){_0x4fc0a5=_0x4fc0a5-0xf4;const _0x3a7acd=a242_0x3a7a();let _0x4cc1c6=_0x3a7acd[_0x4fc0a5];return _0x4cc1c6;}import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';function a242_0x3a7a(){const _0x472843=['read','19JdKWMt','230412parwrp','cookie','25965FPORZG','2824njjgXL','map','4QKFteU','624600hZcimf','List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','list','rule','224bgOylw','7483BYxExy','11ygyKCV','appCode','Loaded\x20app\x20rule\x20configuration\x20for\x20','642865SmNlOh','4058510mxBpdP','length'];a242_0x3a7a=function(){return _0x472843;};return a242_0x3a7a();}export const ruleList={'service':a242_0x5485a4(0xfa),'command':a242_0x5485a4(0xf9),'description':a242_0x5485a4(0xf8),'risk':a242_0x5485a4(0x103),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x44c419){const _0x7c76a6=a242_0x5485a4,_0xab2457=await Promise['all'](APP_RULE_TYPES[_0x7c76a6(0xf5)](_0x3b1563=>getAppRule(_0x44c419[_0x7c76a6(0x106)],{'appCode':_0x44c419['appCode'],'type':_0x3b1563}))),_0x594500=APP_RULE_TYPES[_0x7c76a6(0xf5)]((_0x576fa3,_0x4e3ad4)=>projectAppRule(_0x576fa3,_0xab2457[_0x4e3ad4]??null));return{'ok':!![],'data':{'total':_0x594500[_0x7c76a6(0x102)],'rules':_0x594500},'message':_0x7c76a6(0xff)+_0x44c419[_0x7c76a6(0xfe)]};}};
1
+ function a242_0x3053(_0x32a44b,_0x50e677){_0x32a44b=_0x32a44b-0x116;const _0x594fbc=a242_0x594f();let _0x30530b=_0x594fbc[_0x32a44b];return _0x30530b;}const a242_0x4c76cd=a242_0x3053;(function(_0x2ca80e,_0x58b8e6){const _0x29ce23=a242_0x3053,_0x251c69=_0x2ca80e();while(!![]){try{const _0x526f5d=parseInt(_0x29ce23(0x122))/0x1*(parseInt(_0x29ce23(0x121))/0x2)+-parseInt(_0x29ce23(0x11c))/0x3+parseInt(_0x29ce23(0x129))/0x4*(-parseInt(_0x29ce23(0x127))/0x5)+-parseInt(_0x29ce23(0x11d))/0x6*(-parseInt(_0x29ce23(0x119))/0x7)+-parseInt(_0x29ce23(0x124))/0x8*(-parseInt(_0x29ce23(0x11e))/0x9)+-parseInt(_0x29ce23(0x11a))/0xa+parseInt(_0x29ce23(0x126))/0xb*(parseInt(_0x29ce23(0x116))/0xc);if(_0x526f5d===_0x58b8e6)break;else _0x251c69['push'](_0x251c69['shift']());}catch(_0x1785ac){_0x251c69['push'](_0x251c69['shift']());}}}(a242_0x594f,0x63ab2));import{getAppRule}from'../../core/api-client.js';function a242_0x594f(){const _0xe4a97=['Loaded\x20app\x20rule\x20configuration\x20for\x20','759256oxLUOG','map','7909oBxArO','9865BUeUNx','List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','1324lULRov','all','7656TXeLZV','appCode','length','50582hicXbG','408590gnlCDo','rule','1161897GBChmd','48FesITJ','18yQcpIE','read','list','1566238MYqFbe','1MeruyF'];a242_0x594f=function(){return _0xe4a97;};return a242_0x594f();}import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';export const ruleList={'service':a242_0x4c76cd(0x11b),'command':a242_0x4c76cd(0x120),'description':a242_0x4c76cd(0x128),'risk':a242_0x4c76cd(0x11f),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x236def){const _0x36c307=a242_0x4c76cd,_0x3eff5c=await Promise[_0x36c307(0x12a)](APP_RULE_TYPES[_0x36c307(0x125)](_0x15fee7=>getAppRule(_0x236def['cookie'],{'appCode':_0x236def[_0x36c307(0x117)],'type':_0x15fee7}))),_0x351af9=APP_RULE_TYPES[_0x36c307(0x125)]((_0x410c36,_0x106f04)=>projectAppRule(_0x410c36,_0x3eff5c[_0x106f04]??null));return{'ok':!![],'data':{'total':_0x351af9[_0x36c307(0x118)],'rules':_0x351af9},'message':_0x36c307(0x123)+_0x236def['appCode']};}};
@@ -1 +1 @@
1
- const a243_0xa3a42e=a243_0x4584;(function(_0x304c49,_0x3b679f){const _0x4b528f=a243_0x4584,_0x48e93d=_0x304c49();while(!![]){try{const _0x742ed9=parseInt(_0x4b528f(0x157))/0x1*(parseInt(_0x4b528f(0x12c))/0x2)+-parseInt(_0x4b528f(0x170))/0x3*(parseInt(_0x4b528f(0x161))/0x4)+parseInt(_0x4b528f(0x158))/0x5*(parseInt(_0x4b528f(0x15d))/0x6)+parseInt(_0x4b528f(0x164))/0x7*(-parseInt(_0x4b528f(0x149))/0x8)+parseInt(_0x4b528f(0x151))/0x9+-parseInt(_0x4b528f(0x16d))/0xa*(parseInt(_0x4b528f(0x137))/0xb)+-parseInt(_0x4b528f(0x140))/0xc;if(_0x742ed9===_0x3b679f)break;else _0x48e93d['push'](_0x48e93d['shift']());}catch(_0x1cb4a2){_0x48e93d['push'](_0x48e93d['shift']());}}}(a243_0x4a9c,0x40093));function a243_0x4a9c(){const _0x438e91=['type','str','content','app_rule_expected_version_invalid','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','\x20for\x20','unconfigured','1529XZHvIi','number','contentHash','write','DATABASE','Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','The\x20received\x20rule\x20state\x20contradicts\x20the\x20requested\x20changes.','version','beforeRecord','5727636KHCZAs','file','input','cause','update','appCode','app_rule_verification_failed','Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20','.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.','17336DNhyGS','Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.','Require\x20the\x20current\x20version\x20before\x20atomic\x20compare-and-set','UTF-8\x20Markdown\x20file\x20(RULES:\x202000\x20UTF-16\x20units;\x20DATABASE:\x205242880\x20units)','expected-version','Use\x20read-only\x20rule\x20reconciliation;\x20do\x20not\x20resubmit\x20automatically.','Set\x20','POST','4204890lYNkZZ','\x20--format\x20compress','isSafeInteger','before','\x20could\x20not\x20be\x20verified.','cookie','63843PGltbD','20fPyNhA','app_rule_file_required','expectedVersion','app_rule_set_outcome_unknown','create','751164SQYxDf','\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','RULES\x20content\x20exceeds\x202000\x20UTF-16\x20units.','app_rule_version_mismatch','24obKAMp','app_rule_verification_unavailable','push','763PBttGx','rule','The\x20set\x20request\x20was\x20sent,\x20but\x20','trim','--file\x20is\x20required.','rules','byteSize','Pass\x20a\x20UTF-8\x20Markdown\x20file.','replacement','1060dLtNbb','string','rabetbase\x20rule\x20get\x20--type\x20','148335DnDVfO','set','10UCPzgH','Expected\x20','Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.','--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.'];a243_0x4a9c=function(){return _0x438e91;};return a243_0x4a9c();}function a243_0x4584(_0x431eeb,_0x17a0ee){_0x431eeb=_0x431eeb-0x12b;const _0x4a9c88=a243_0x4a9c();let _0x45844c=_0x4a9c88[_0x431eeb];return _0x45844c;}import{knowledgeDocumentsPath}from'../../core/api-client.js';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 readSetInput(_0x1c56ca){const _0x27f4fb=a243_0x4584,_0x30d34a=readAppRuleType(_0x1c56ca),_0x5a8e0=_0x1c56ca[_0x27f4fb(0x131)](_0x27f4fb(0x141))[_0x27f4fb(0x167)]();if(!_0x5a8e0)throw appRuleError(_0x27f4fb(0x159),_0x27f4fb(0x168),_0x27f4fb(0x16b));const _0x55e273=_0x1c56ca['flag'](_0x27f4fb(0x14d));let _0x121099;if(_0x55e273!==undefined){_0x121099=Number(_0x55e273);if(!Number[_0x27f4fb(0x153)](_0x121099)||_0x121099<0x0)throw appRuleError(_0x27f4fb(0x133),_0x27f4fb(0x12f));}return{'type':_0x30d34a,'file':_0x5a8e0,'expectedVersion':_0x121099};}async function prepareSet(_0x5ea188){const _0x34cced=a243_0x4584,_0x284dbe=readSetInput(_0x5ea188),_0x5a0667=await readAppRuleFile(_0x284dbe[_0x34cced(0x141)]);if(_0x284dbe[_0x34cced(0x130)]===_0x34cced(0x169)&&_0x5a0667[_0x34cced(0x132)]['length']>0x7d0)throw appRuleError('app_rule_content_too_large',_0x34cced(0x15f));const _0x3ffcc6=await getAppRule(_0x5ea188[_0x34cced(0x156)],{'appCode':_0x5ea188[_0x34cced(0x145)],'type':_0x284dbe[_0x34cced(0x130)]});if(_0x284dbe[_0x34cced(0x15a)]!==undefined&&(_0x3ffcc6?.[_0x34cced(0x13e)]??0x0)!==_0x284dbe['expectedVersion'])throw appRuleError(_0x34cced(0x160),appRuleFileName(_0x284dbe[_0x34cced(0x130)])+'\x20version\x20changed\x20before\x20write.',_0x34cced(0x12d)+_0x284dbe['expectedVersion']+';\x20current\x20version\x20is\x20'+(_0x3ffcc6?.[_0x34cced(0x13e)]??_0x34cced(0x136))+_0x34cced(0x148));return{'input':_0x284dbe,'replacement':_0x5a0667,'beforeRecord':_0x3ffcc6,'before':projectAppRule(_0x284dbe[_0x34cced(0x130)],_0x3ffcc6),'planned':{'type':_0x284dbe[_0x34cced(0x130)],'fileName':appRuleFileName(_0x284dbe[_0x34cced(0x130)]),'contextScope':appRuleContextScope(_0x284dbe[_0x34cced(0x130)]),'enabled':!![],'appCode':_0x5ea188['appCode'],'scope':_0x34cced(0x169),'contentByteSize':_0x5a0667['byteSize'],'contentHash':_0x5a0667[_0x34cced(0x139)]}};}function warningsFor(_0x26b829){return[];}export const ruleSet={'service':a243_0xa3a42e(0x165),'command':a243_0xa3a42e(0x12b),'description':a243_0xa3a42e(0x13c),'risk':a243_0xa3a42e(0x13a),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':a243_0xa3a42e(0x141),'type':a243_0xa3a42e(0x16e),'required':!![],'description':a243_0xa3a42e(0x14c)},{'name':a243_0xa3a42e(0x14d),'type':a243_0xa3a42e(0x138),'required':![],'description':a243_0xa3a42e(0x14b)}],async 'validate'(_0xa8827f){readSetInput(_0xa8827f);},async 'dryRun'(_0x54e349){const _0x30c0c7=a243_0xa3a42e,_0x31294d=await prepareSet(_0x54e349);return asDryRunResult({'operation':_0x30c0c7(0x12b),'selector':{'appCode':_0x54e349[_0x30c0c7(0x145)],'scope':'rules','type':_0x31294d[_0x30c0c7(0x142)]['type']},'before':_0x31294d[_0x30c0c7(0x154)],'after':_0x31294d['planned'],'dryRun':!![],'backend':{'method':_0x30c0c7(0x150),'path':knowledgeDocumentsPath(_0x30c0c7(0x169),_0x31294d[_0x30c0c7(0x13f)]?_0x30c0c7(0x144):'create'),'body':{'appCode':_0x54e349['appCode'],..._0x31294d['beforeRecord']?{'id':_0x31294d[_0x30c0c7(0x13f)]['id']}:{},'title':_0x31294d['input'][_0x30c0c7(0x130)]==='rules'?'RULES':_0x30c0c7(0x13b),'contentHash':_0x31294d[_0x30c0c7(0x16c)][_0x30c0c7(0x139)],'contentByteSize':_0x31294d[_0x30c0c7(0x16c)][_0x30c0c7(0x16a)],..._0x31294d[_0x30c0c7(0x13f)]?{'expectedVersion':_0x31294d[_0x30c0c7(0x13f)]['version']}:{}}},'warnings':warningsFor(_0x31294d['input']['expectedVersion']),'verification':{'expectedVersion':_0x31294d[_0x30c0c7(0x13f)]?.[_0x30c0c7(0x13e)]??0x0,'atomicCompareAndSet':!![],'lookupCommand':'rabetbase\x20rule\x20get\x20--type\x20'+_0x31294d['input'][_0x30c0c7(0x130)]+_0x30c0c7(0x152)}},{'method':_0x30c0c7(0x150),'url':knowledgeDocumentsPath(_0x30c0c7(0x169),_0x31294d[_0x30c0c7(0x13f)]?_0x30c0c7(0x144):_0x30c0c7(0x15c))});},async 'execute'(_0x2cbba7){const _0x5b56cc=a243_0xa3a42e,_0x3d90a6=await prepareSet(_0x2cbba7),_0x40a18e=_0x3d90a6[_0x5b56cc(0x13f)]===null?0x1:_0x3d90a6[_0x5b56cc(0x13f)][_0x5b56cc(0x13e)]+(_0x3d90a6[_0x5b56cc(0x13f)][_0x5b56cc(0x132)]===_0x3d90a6[_0x5b56cc(0x16c)][_0x5b56cc(0x132)]?0x0:0x1);let _0x17259d,_0x3cba7a=![];try{_0x17259d=await saveAppRule(_0x2cbba7[_0x5b56cc(0x156)],{'appCode':_0x2cbba7[_0x5b56cc(0x145)],'type':_0x3d90a6[_0x5b56cc(0x142)][_0x5b56cc(0x130)],'content':_0x3d90a6[_0x5b56cc(0x16c)][_0x5b56cc(0x132)],'expectedVersion':_0x3d90a6[_0x5b56cc(0x13f)]?.['version']??0x0,..._0x3d90a6[_0x5b56cc(0x13f)]?{'id':_0x3d90a6[_0x5b56cc(0x13f)]['id']}:{}});if(_0x17259d[_0x5b56cc(0x13e)]!==_0x40a18e||_0x17259d[_0x5b56cc(0x132)]!==_0x3d90a6[_0x5b56cc(0x16c)][_0x5b56cc(0x132)]||_0x3d90a6[_0x5b56cc(0x13f)]!==null&&_0x17259d['id']!==_0x3d90a6[_0x5b56cc(0x13f)]['id'])throw appRuleError(_0x5b56cc(0x146),_0x5b56cc(0x13d),_0x5b56cc(0x14e));}catch(_0x1cef00){if(!isPlatformTransportFailure(_0x1cef00))throw _0x1cef00;_0x3cba7a=!![];}let _0x51fdfb;try{_0x51fdfb=await getAppRule(_0x2cbba7['cookie'],{'appCode':_0x2cbba7[_0x5b56cc(0x145)],'type':_0x3d90a6[_0x5b56cc(0x142)]['type']});}catch(_0x493874){const _0x2bf56e=appRuleError(_0x3cba7a?_0x5b56cc(0x15b):_0x5b56cc(0x162),_0x5b56cc(0x166)+appRuleFileName(_0x3d90a6[_0x5b56cc(0x142)][_0x5b56cc(0x130)])+_0x5b56cc(0x155),_0x5b56cc(0x14a));Object['defineProperty'](_0x2bf56e,_0x5b56cc(0x143),{'value':_0x493874,'enumerable':![]});throw _0x2bf56e;}const _0x17a9f9=_0x51fdfb&&inspectAppRuleContent(_0x51fdfb[_0x5b56cc(0x132)])['contentHash']===_0x3d90a6[_0x5b56cc(0x16c)]['contentHash'],_0x127cc0=_0x51fdfb&&_0x51fdfb['version']===_0x40a18e&&(!_0x17259d||_0x51fdfb['id']===_0x17259d['id']&&_0x51fdfb[_0x5b56cc(0x13e)]===_0x17259d[_0x5b56cc(0x13e)]);if(!_0x51fdfb||!_0x17a9f9||!_0x127cc0||_0x3d90a6[_0x5b56cc(0x13f)]!==null&&_0x51fdfb['id']!==_0x3d90a6[_0x5b56cc(0x13f)]['id'])throw appRuleError(_0x3cba7a?_0x5b56cc(0x15b):_0x5b56cc(0x146),appRuleFileName(_0x3d90a6['input'][_0x5b56cc(0x130)])+_0x5b56cc(0x15e),_0x5b56cc(0x147)+_0x3d90a6[_0x5b56cc(0x142)]['type']+_0x5b56cc(0x134));const _0x297047=warningsFor(_0x3d90a6['input'][_0x5b56cc(0x15a)]);_0x3cba7a&&_0x297047[_0x5b56cc(0x163)](_0x5b56cc(0x12e));const _0xd4bbc4=projectAppRule(_0x3d90a6[_0x5b56cc(0x142)][_0x5b56cc(0x130)],_0x51fdfb);return{'ok':!![],'data':{'operation':_0x5b56cc(0x12b),'selector':{'appCode':_0x2cbba7[_0x5b56cc(0x145)],'scope':'rules','type':_0x3d90a6[_0x5b56cc(0x142)][_0x5b56cc(0x130)]},'before':_0x3d90a6['before'],'after':_0xd4bbc4,'dryRun':![],'backend':{'method':_0x5b56cc(0x150),'path':knowledgeDocumentsPath('rules',_0x3d90a6[_0x5b56cc(0x13f)]?_0x5b56cc(0x144):_0x5b56cc(0x15c))},'warnings':_0x297047,'verification':{'status':'verified','recoveredAfterUnknownResponse':_0x3cba7a,'expectedVersion':_0x3d90a6[_0x5b56cc(0x13f)]?.[_0x5b56cc(0x13e)]??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x5b56cc(0x16f)+_0x3d90a6[_0x5b56cc(0x142)]['type']+_0x5b56cc(0x152)}},'message':_0x5b56cc(0x14f)+appRuleFileName(_0x3d90a6[_0x5b56cc(0x142)][_0x5b56cc(0x130)])+_0x5b56cc(0x135)+_0x2cbba7[_0x5b56cc(0x145)]};}};
1
+ function a243_0x428e(){const _0x48d1ea=['1eWwShJ',';\x20current\x20version\x20is\x20','\x20for\x20','length','unconfigured','planned','str','app_rule_set_outcome_unknown','set','.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.','app_rule_verification_failed','content','beforeRecord','Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.','DATABASE','defineProperty','rabetbase\x20rule\x20get\x20--type\x20','before','Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.','write','222zxTLNY','app_rule_verification_unavailable','rules','\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','Set\x20','10coBiup','type','isSafeInteger','cookie','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','1112duvxZi','87UEUgpx','verified','\x20version\x20changed\x20before\x20write.','expected-version','195979kgTbmS','6793776BAGGTe','app_rule_content_too_large','\x20--format\x20compress','appCode','update','--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','contentHash','8409807XarnAO','app_rule_expected_version_invalid','Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','9972457YwwmKc','create','replacement','push','RULES\x20content\x20exceeds\x202000\x20UTF-16\x20units.','input','byteSize','version','The\x20set\x20request\x20was\x20sent,\x20but\x20','The\x20received\x20rule\x20state\x20contradicts\x20the\x20requested\x20changes.','2617298oeMOsC','757115TRTHiW','rule','POST','string','expectedVersion','RULES','app_rule_file_required','Expected\x20','file'];a243_0x428e=function(){return _0x48d1ea;};return a243_0x428e();}const a243_0x1dffdb=a243_0xd82a;(function(_0x2961d0,_0x403472){const _0x32c3af=a243_0xd82a,_0x48b68e=_0x2961d0();while(!![]){try{const _0x51ad04=parseInt(_0x32c3af(0x14e))/0x1*(parseInt(_0x32c3af(0x144))/0x2)+-parseInt(_0x32c3af(0x12b))/0x3*(-parseInt(_0x32c3af(0x12a))/0x4)+-parseInt(_0x32c3af(0x145))/0x5+parseInt(_0x32c3af(0x162))/0x6*(-parseInt(_0x32c3af(0x12f))/0x7)+parseInt(_0x32c3af(0x130))/0x8+-parseInt(_0x32c3af(0x137))/0x9+parseInt(_0x32c3af(0x125))/0xa*(parseInt(_0x32c3af(0x13a))/0xb);if(_0x51ad04===_0x403472)break;else _0x48b68e['push'](_0x48b68e['shift']());}catch(_0x583c9a){_0x48b68e['push'](_0x48b68e['shift']());}}}(a243_0x428e,0xe8201));import{knowledgeDocumentsPath}from'../../core/api-client.js';function a243_0xd82a(_0x2b02ef,_0x29f0fb){_0x2b02ef=_0x2b02ef-0x123;const _0x428e71=a243_0x428e();let _0xd82a83=_0x428e71[_0x2b02ef];return _0xd82a83;}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 readSetInput(_0x359c22){const _0x1c8f2d=a243_0xd82a,_0x1e4d84=readAppRuleType(_0x359c22),_0x56d49a=_0x359c22[_0x1c8f2d(0x154)](_0x1c8f2d(0x14d))['trim']();if(!_0x56d49a)throw appRuleError(_0x1c8f2d(0x14b),'--file\x20is\x20required.','Pass\x20a\x20UTF-8\x20Markdown\x20file.');const _0x3b2457=_0x359c22['flag'](_0x1c8f2d(0x12e));let _0x5e87b6;if(_0x3b2457!==undefined){_0x5e87b6=Number(_0x3b2457);if(!Number[_0x1c8f2d(0x127)](_0x5e87b6)||_0x5e87b6<0x0)throw appRuleError(_0x1c8f2d(0x138),_0x1c8f2d(0x135));}return{'type':_0x1e4d84,'file':_0x56d49a,'expectedVersion':_0x5e87b6};}async function prepareSet(_0x4282cc){const _0x40682d=a243_0xd82a,_0x1459db=readSetInput(_0x4282cc),_0x5a2bd1=await readAppRuleFile(_0x1459db[_0x40682d(0x14d)]);if(_0x1459db['type']===_0x40682d(0x164)&&_0x5a2bd1[_0x40682d(0x159)][_0x40682d(0x151)]>0x7d0)throw appRuleError(_0x40682d(0x131),_0x40682d(0x13e));const _0x5c02c8=await getAppRule(_0x4282cc['cookie'],{'appCode':_0x4282cc[_0x40682d(0x133)],'type':_0x1459db[_0x40682d(0x126)]});if(_0x1459db[_0x40682d(0x149)]!==undefined&&(_0x5c02c8?.[_0x40682d(0x141)]??0x0)!==_0x1459db[_0x40682d(0x149)])throw appRuleError('app_rule_version_mismatch',appRuleFileName(_0x1459db[_0x40682d(0x126)])+_0x40682d(0x12d),_0x40682d(0x14c)+_0x1459db[_0x40682d(0x149)]+_0x40682d(0x14f)+(_0x5c02c8?.['version']??_0x40682d(0x152))+_0x40682d(0x157));return{'input':_0x1459db,'replacement':_0x5a2bd1,'beforeRecord':_0x5c02c8,'before':projectAppRule(_0x1459db['type'],_0x5c02c8),'planned':{'type':_0x1459db[_0x40682d(0x126)],'fileName':appRuleFileName(_0x1459db[_0x40682d(0x126)]),'contextScope':appRuleContextScope(_0x1459db['type']),'enabled':!![],'appCode':_0x4282cc[_0x40682d(0x133)],'scope':_0x40682d(0x164),'contentByteSize':_0x5a2bd1[_0x40682d(0x140)],'contentHash':_0x5a2bd1['contentHash']}};}function warningsFor(_0x2ff0c6){return[];}export const ruleSet={'service':a243_0x1dffdb(0x146),'command':a243_0x1dffdb(0x156),'description':a243_0x1dffdb(0x139),'risk':a243_0x1dffdb(0x161),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':a243_0x1dffdb(0x14d),'type':a243_0x1dffdb(0x148),'required':!![],'description':'UTF-8\x20Markdown\x20file\x20(RULES:\x202000\x20UTF-16\x20units;\x20DATABASE:\x205242880\x20units)'},{'name':a243_0x1dffdb(0x12e),'type':'number','required':![],'description':'Require\x20the\x20current\x20version\x20before\x20atomic\x20compare-and-set'}],async 'validate'(_0x33f649){readSetInput(_0x33f649);},async 'dryRun'(_0x5d889c){const _0x8be733=a243_0x1dffdb,_0x387549=await prepareSet(_0x5d889c);return asDryRunResult({'operation':_0x8be733(0x156),'selector':{'appCode':_0x5d889c['appCode'],'scope':_0x8be733(0x164),'type':_0x387549[_0x8be733(0x13f)][_0x8be733(0x126)]},'before':_0x387549[_0x8be733(0x15f)],'after':_0x387549[_0x8be733(0x153)],'dryRun':!![],'backend':{'method':'POST','path':knowledgeDocumentsPath('rules',_0x387549[_0x8be733(0x15a)]?'update':_0x8be733(0x13b)),'body':{'appCode':_0x5d889c[_0x8be733(0x133)],..._0x387549[_0x8be733(0x15a)]?{'id':_0x387549[_0x8be733(0x15a)]['id']}:{},'title':_0x387549[_0x8be733(0x13f)]['type']===_0x8be733(0x164)?_0x8be733(0x14a):_0x8be733(0x15c),'contentHash':_0x387549[_0x8be733(0x13c)][_0x8be733(0x136)],'contentByteSize':_0x387549[_0x8be733(0x13c)][_0x8be733(0x140)],..._0x387549[_0x8be733(0x15a)]?{'expectedVersion':_0x387549[_0x8be733(0x15a)]['version']}:{}}},'warnings':warningsFor(_0x387549[_0x8be733(0x13f)][_0x8be733(0x149)]),'verification':{'expectedVersion':_0x387549['beforeRecord']?.['version']??0x0,'atomicCompareAndSet':!![],'lookupCommand':'rabetbase\x20rule\x20get\x20--type\x20'+_0x387549['input']['type']+_0x8be733(0x132)}},{'method':_0x8be733(0x147),'url':knowledgeDocumentsPath(_0x8be733(0x164),_0x387549[_0x8be733(0x15a)]?_0x8be733(0x134):'create')});},async 'execute'(_0x296c7a){const _0xf29bae=a243_0x1dffdb,_0x3abdcb=await prepareSet(_0x296c7a),_0x46316a=_0x3abdcb[_0xf29bae(0x15a)]===null?0x1:_0x3abdcb[_0xf29bae(0x15a)][_0xf29bae(0x141)]+(_0x3abdcb[_0xf29bae(0x15a)][_0xf29bae(0x159)]===_0x3abdcb[_0xf29bae(0x13c)]['content']?0x0:0x1);let _0x354017,_0x1c57dd=![];try{_0x354017=await saveAppRule(_0x296c7a[_0xf29bae(0x128)],{'appCode':_0x296c7a[_0xf29bae(0x133)],'type':_0x3abdcb[_0xf29bae(0x13f)][_0xf29bae(0x126)],'content':_0x3abdcb[_0xf29bae(0x13c)][_0xf29bae(0x159)],'expectedVersion':_0x3abdcb[_0xf29bae(0x15a)]?.[_0xf29bae(0x141)]??0x0,..._0x3abdcb[_0xf29bae(0x15a)]?{'id':_0x3abdcb['beforeRecord']['id']}:{}});if(_0x354017[_0xf29bae(0x141)]!==_0x46316a||_0x354017[_0xf29bae(0x159)]!==_0x3abdcb[_0xf29bae(0x13c)][_0xf29bae(0x159)]||_0x3abdcb[_0xf29bae(0x15a)]!==null&&_0x354017['id']!==_0x3abdcb['beforeRecord']['id'])throw appRuleError(_0xf29bae(0x158),_0xf29bae(0x143),'Use\x20read-only\x20rule\x20reconciliation;\x20do\x20not\x20resubmit\x20automatically.');}catch(_0x554edf){if(!isPlatformTransportFailure(_0x554edf))throw _0x554edf;_0x1c57dd=!![];}let _0x34833e;try{_0x34833e=await getAppRule(_0x296c7a['cookie'],{'appCode':_0x296c7a[_0xf29bae(0x133)],'type':_0x3abdcb[_0xf29bae(0x13f)][_0xf29bae(0x126)]});}catch(_0x460cdb){const _0x1d6ce0=appRuleError(_0x1c57dd?_0xf29bae(0x155):_0xf29bae(0x163),_0xf29bae(0x142)+appRuleFileName(_0x3abdcb[_0xf29bae(0x13f)]['type'])+'\x20could\x20not\x20be\x20verified.',_0xf29bae(0x15b));Object[_0xf29bae(0x15d)](_0x1d6ce0,'cause',{'value':_0x460cdb,'enumerable':![]});throw _0x1d6ce0;}const _0x1bcbbc=_0x34833e&&inspectAppRuleContent(_0x34833e[_0xf29bae(0x159)])[_0xf29bae(0x136)]===_0x3abdcb[_0xf29bae(0x13c)][_0xf29bae(0x136)],_0xe8f9eb=_0x34833e&&_0x34833e['version']===_0x46316a&&(!_0x354017||_0x34833e['id']===_0x354017['id']&&_0x34833e[_0xf29bae(0x141)]===_0x354017[_0xf29bae(0x141)]);if(!_0x34833e||!_0x1bcbbc||!_0xe8f9eb||_0x3abdcb[_0xf29bae(0x15a)]!==null&&_0x34833e['id']!==_0x3abdcb[_0xf29bae(0x15a)]['id'])throw appRuleError(_0x1c57dd?_0xf29bae(0x155):_0xf29bae(0x158),appRuleFileName(_0x3abdcb[_0xf29bae(0x13f)][_0xf29bae(0x126)])+_0xf29bae(0x123),'Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20'+_0x3abdcb[_0xf29bae(0x13f)][_0xf29bae(0x126)]+_0xf29bae(0x129));const _0x2bf700=warningsFor(_0x3abdcb[_0xf29bae(0x13f)]['expectedVersion']);_0x1c57dd&&_0x2bf700[_0xf29bae(0x13d)](_0xf29bae(0x160));const _0x4bb6fd=projectAppRule(_0x3abdcb[_0xf29bae(0x13f)][_0xf29bae(0x126)],_0x34833e);return{'ok':!![],'data':{'operation':'set','selector':{'appCode':_0x296c7a['appCode'],'scope':'rules','type':_0x3abdcb['input']['type']},'before':_0x3abdcb[_0xf29bae(0x15f)],'after':_0x4bb6fd,'dryRun':![],'backend':{'method':'POST','path':knowledgeDocumentsPath(_0xf29bae(0x164),_0x3abdcb[_0xf29bae(0x15a)]?_0xf29bae(0x134):_0xf29bae(0x13b))},'warnings':_0x2bf700,'verification':{'status':_0xf29bae(0x12c),'recoveredAfterUnknownResponse':_0x1c57dd,'expectedVersion':_0x3abdcb[_0xf29bae(0x15a)]?.['version']??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0xf29bae(0x15e)+_0x3abdcb['input']['type']+_0xf29bae(0x132)}},'message':_0xf29bae(0x124)+appRuleFileName(_0x3abdcb[_0xf29bae(0x13f)][_0xf29bae(0x126)])+_0xf29bae(0x150)+_0x296c7a[_0xf29bae(0x133)]};}};
@@ -1 +1 @@
1
- const a244_0x268a4c=a244_0x1180;(function(_0x1f09ab,_0x1f40af){const _0x3b84a8=a244_0x1180,_0x1d48b6=_0x1f09ab();while(!![]){try{const _0xf422a2=-parseInt(_0x3b84a8(0x145))/0x1+parseInt(_0x3b84a8(0x141))/0x2+-parseInt(_0x3b84a8(0x14a))/0x3*(-parseInt(_0x3b84a8(0x14d))/0x4)+-parseInt(_0x3b84a8(0x146))/0x5+-parseInt(_0x3b84a8(0x143))/0x6+parseInt(_0x3b84a8(0x156))/0x7*(parseInt(_0x3b84a8(0x13f))/0x8)+-parseInt(_0x3b84a8(0x13d))/0x9;if(_0xf422a2===_0x1f40af)break;else _0x1d48b6['push'](_0x1d48b6['shift']());}catch(_0x50c8e1){_0x1d48b6['push'](_0x1d48b6['shift']());}}}(a244_0x3094,0x95ee8));import{createHash}from'node:crypto';function a244_0x3094(){const _0x4b27c2=['length','contentHash','database','App\x20rule\x20file\x20is\x20blank:\x20','1065969Bvzqsy','app_rule_content_too_large','6334288WufAvp','scope','604994LMumgU','Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','2304900hxSnGW','message','296266zPLdVQ','1690880wGAxQG','str','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','digest','15lVipsd','Cannot\x20read\x20app\x20rule\x20file:\x20','App\x20rule\x20content\x20exceeds\x205242880\x20UTF-16\x20units.','525496gJDEgw','appCode','page-api-development','RULES.md','app_rule_file_invalid','rules','content','byteLength','App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','7HRDjGn','app_rule_file_required','string','app_rule_content_invalid','createTime','Pass\x20a\x20UTF-8\x20Markdown\x20file.','Cannot\x20access\x20app\x20rule\x20file:\x20','size','sha256:','--file\x20is\x20required.','--type\x20must\x20be\x20either\x20rules\x20or\x20database.','byteSize','decode','app_rule_file_unreadable','utf8','App\x20rule\x20content\x20exceeds\x20the\x20bounded\x20UTF-8\x20file\x20limit.','updateTime','trim','type','indexStatus','update'];a244_0x3094=function(){return _0x4b27c2;};return a244_0x3094();}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=['rules',a244_0x268a4c(0x13b)];function a244_0x1180(_0x4366bd,_0x30c51f){_0x4366bd=_0x4366bd-0x125;const _0x3094fe=a244_0x3094();let _0x11808d=_0x3094fe[_0x4366bd];return _0x11808d;}export const MAX_APP_RULE_UNITS=0x5*0x400*0x400;export const MAX_APP_RULE_BYTES=MAX_APP_RULE_UNITS*0x4;const APP_RULE_FILES={'rules':a244_0x268a4c(0x150),'database':'DATABASE.md'},APP_RULE_CONTEXT_SCOPES={'rules':a244_0x268a4c(0x14f),'database':'database-analysis'};export function appRuleError(_0x5590f2,_0x24fbf5,_0x58a643){return new CliError(_0x5590f2,0x1,_0x24fbf5,_0x58a643);}export function readAppRuleType(_0x2edaed){const _0x3fe0c9=a244_0x268a4c,_0x10b373=_0x2edaed[_0x3fe0c9(0x147)](_0x3fe0c9(0x136))['trim']()['toLowerCase']();if(_0x10b373!==_0x3fe0c9(0x152)&&_0x10b373!==_0x3fe0c9(0x13b))throw appRuleError('app_rule_type_invalid',_0x3fe0c9(0x12e));return _0x10b373;}export function appRuleFileName(_0x5e7197){return APP_RULE_FILES[_0x5e7197];}export function appRuleContextScope(_0x4c801e){return APP_RULE_CONTEXT_SCOPES[_0x4c801e];}export function inspectAppRuleContent(_0x4214e5){const _0x57f3c7=a244_0x268a4c,_0x368e3a=Buffer['from'](_0x4214e5,_0x57f3c7(0x132));return{'content':_0x4214e5,'byteSize':_0x368e3a[_0x57f3c7(0x154)],'contentHash':_0x57f3c7(0x12c)+createHash('sha256')[_0x57f3c7(0x138)](_0x368e3a)[_0x57f3c7(0x149)]('hex')};}export async function readAppRuleFile(_0x493ed2){const _0x4fe0d6=a244_0x268a4c,_0x3f7124=_0x493ed2[_0x4fe0d6(0x135)]();if(!_0x3f7124)throw appRuleError(_0x4fe0d6(0x125),_0x4fe0d6(0x12d),_0x4fe0d6(0x129));const _0x4f8f6a=resolve(_0x3f7124);let _0x652393;try{_0x652393=await stat(_0x4f8f6a);}catch(_0x4ae365){throw appRuleError('app_rule_file_unreadable',_0x4fe0d6(0x12a)+_0x3f7124,_0x4ae365 instanceof Error?_0x4ae365['message']:String(_0x4ae365));}if(!_0x652393['isFile']())throw appRuleError(_0x4fe0d6(0x151),_0x4fe0d6(0x148)+_0x3f7124);if(_0x652393[_0x4fe0d6(0x12b)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x4fe0d6(0x13e),_0x4fe0d6(0x133));let _0x53bd8c;try{_0x53bd8c=await readFile(_0x4f8f6a);}catch(_0x1a271e){throw appRuleError(_0x4fe0d6(0x131),_0x4fe0d6(0x14b)+_0x3f7124,_0x1a271e instanceof Error?_0x1a271e[_0x4fe0d6(0x144)]:String(_0x1a271e));}if(_0x53bd8c['byteLength']>MAX_APP_RULE_BYTES)throw appRuleError('app_rule_content_too_large',_0x4fe0d6(0x133));let _0xe419da;try{_0xe419da=new TextDecoder('utf-8',{'fatal':!![],'ignoreBOM':!![]})[_0x4fe0d6(0x130)](_0x53bd8c);}catch{throw appRuleError(_0x4fe0d6(0x127),_0x4fe0d6(0x155)+_0x3f7124);}if(_0xe419da[_0x4fe0d6(0x139)]>MAX_APP_RULE_UNITS)throw appRuleError(_0x4fe0d6(0x13e),_0x4fe0d6(0x14c));if(!_0xe419da[_0x4fe0d6(0x135)]())throw appRuleError(_0x4fe0d6(0x127),_0x4fe0d6(0x13c)+_0x3f7124);return inspectAppRuleContent(_0xe419da);}export function projectAppRule(_0x453fa7,_0x2e58e5){const _0x1131c8=a244_0x268a4c;if(!_0x2e58e5)return{'type':_0x453fa7,'fileName':appRuleFileName(_0x453fa7),'contextScope':appRuleContextScope(_0x453fa7),'enabled':![]};const _0x2dfab3=inspectAppRuleContent(_0x2e58e5[_0x1131c8(0x153)]);return{'type':_0x453fa7,'fileName':appRuleFileName(_0x453fa7),'contextScope':appRuleContextScope(_0x453fa7),'enabled':!![],'id':_0x2e58e5['id'],'scope':_0x2e58e5[_0x1131c8(0x140)],'appCode':_0x2e58e5[_0x1131c8(0x14e)],'version':_0x2e58e5['version'],..._0x2e58e5['indexStatus']!==undefined?{'indexStatus':_0x2e58e5[_0x1131c8(0x137)]}:{},'contentByteSize':_0x2dfab3[_0x1131c8(0x12f)],'contentHash':_0x2dfab3[_0x1131c8(0x13a)],..._0x2e58e5[_0x1131c8(0x128)]!==undefined&&_0x2e58e5[_0x1131c8(0x128)]!==null?{'createTime':_0x2e58e5['createTime']}:{},..._0x2e58e5['updateTime']!==undefined&&_0x2e58e5[_0x1131c8(0x134)]!==null?{'updateTime':_0x2e58e5[_0x1131c8(0x134)]}:{}};}export const APP_RULE_TYPE_FLAG={'name':a244_0x268a4c(0x136),'type':a244_0x268a4c(0x126),'required':!![],'description':a244_0x268a4c(0x142),'enum':[...APP_RULE_TYPES]};
1
+ const a244_0x26c376=a244_0x1dab;(function(_0x491cc2,_0x2d5cbd){const _0x364204=a244_0x1dab,_0x1c195f=_0x491cc2();while(!![]){try{const _0xa0c985=-parseInt(_0x364204(0x162))/0x1+-parseInt(_0x364204(0x178))/0x2+parseInt(_0x364204(0x177))/0x3*(parseInt(_0x364204(0x172))/0x4)+-parseInt(_0x364204(0x17e))/0x5+-parseInt(_0x364204(0x173))/0x6+parseInt(_0x364204(0x165))/0x7+parseInt(_0x364204(0x15e))/0x8;if(_0xa0c985===_0x2d5cbd)break;else _0x1c195f['push'](_0x1c195f['shift']());}catch(_0x189170){_0x1c195f['push'](_0x1c195f['shift']());}}}(a244_0x2d39,0x80a2f));function a244_0x1dab(_0xf503a0,_0x517523){_0xf503a0=_0xf503a0-0x151;const _0x2d391c=a244_0x2d39();let _0x1dab18=_0x2d391c[_0xf503a0];return _0x1dab18;}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=['rules',a244_0x26c376(0x151)];export const MAX_APP_RULE_UNITS=0x5*0x400*0x400;export const MAX_APP_RULE_BYTES=MAX_APP_RULE_UNITS*0x4;const APP_RULE_FILES={'rules':a244_0x26c376(0x179),'database':a244_0x26c376(0x152)},APP_RULE_CONTEXT_SCOPES={'rules':a244_0x26c376(0x16b),'database':a244_0x26c376(0x176)};export function appRuleError(_0x509803,_0x161931,_0x4e82f7){return new CliError(_0x509803,0x1,_0x161931,_0x4e82f7);}export function readAppRuleType(_0x4340e6){const _0x1169a1=a244_0x26c376,_0x311bf6=_0x4340e6[_0x1169a1(0x15f)]('type')[_0x1169a1(0x169)]()['toLowerCase']();if(_0x311bf6!==_0x1169a1(0x16a)&&_0x311bf6!==_0x1169a1(0x151))throw appRuleError('app_rule_type_invalid','--type\x20must\x20be\x20either\x20rules\x20or\x20database.');return _0x311bf6;}export function appRuleFileName(_0x4b74e5){return APP_RULE_FILES[_0x4b74e5];}export function appRuleContextScope(_0x37cf28){return APP_RULE_CONTEXT_SCOPES[_0x37cf28];}export function inspectAppRuleContent(_0x433a02){const _0x15b859=a244_0x26c376,_0x13c8f7=Buffer[_0x15b859(0x168)](_0x433a02,_0x15b859(0x15a));return{'content':_0x433a02,'byteSize':_0x13c8f7[_0x15b859(0x17b)],'contentHash':_0x15b859(0x17c)+createHash(_0x15b859(0x182))[_0x15b859(0x166)](_0x13c8f7)[_0x15b859(0x16d)](_0x15b859(0x159))};}function a244_0x2d39(){const _0x5630de=['createTime','173555WkwVeN','string','--file\x20is\x20required.','Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','sha256','app_rule_content_too_large','database','DATABASE.md','appCode','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','app_rule_file_unreadable','App\x20rule\x20content\x20exceeds\x20the\x20bounded\x20UTF-8\x20file\x20limit.','App\x20rule\x20file\x20is\x20blank:\x20','message','hex','utf8','app_rule_file_invalid','Pass\x20a\x20UTF-8\x20Markdown\x20file.','indexStatus','14543144CwOSQC','str','updateTime','isFile','846162EoypeO','app_rule_content_invalid','scope','1842575PRnpNe','update','type','from','trim','rules','page-api-development','content','digest','Cannot\x20access\x20app\x20rule\x20file:\x20','App\x20rule\x20content\x20exceeds\x205242880\x20UTF-16\x20units.','app_rule_file_required','Cannot\x20read\x20app\x20rule\x20file:\x20','72MVKzPo','3574470fBepwn','version','byteSize','database-analysis','116151eGfAhZ','1549022wotCPM','RULES.md','utf-8','byteLength','sha256:'];a244_0x2d39=function(){return _0x5630de;};return a244_0x2d39();}export async function readAppRuleFile(_0x3f3ce0){const _0x579d18=a244_0x26c376,_0x52148c=_0x3f3ce0[_0x579d18(0x169)]();if(!_0x52148c)throw appRuleError(_0x579d18(0x170),_0x579d18(0x180),_0x579d18(0x15c));const _0x546b4c=resolve(_0x52148c);let _0x2ddd3e;try{_0x2ddd3e=await stat(_0x546b4c);}catch(_0x54790c){throw appRuleError('app_rule_file_unreadable',_0x579d18(0x16e)+_0x52148c,_0x54790c instanceof Error?_0x54790c[_0x579d18(0x158)]:String(_0x54790c));}if(!_0x2ddd3e[_0x579d18(0x161)]())throw appRuleError(_0x579d18(0x15b),_0x579d18(0x154)+_0x52148c);if(_0x2ddd3e['size']>MAX_APP_RULE_BYTES)throw appRuleError('app_rule_content_too_large',_0x579d18(0x156));let _0x5c4a4a;try{_0x5c4a4a=await readFile(_0x546b4c);}catch(_0x40101d){throw appRuleError(_0x579d18(0x155),_0x579d18(0x171)+_0x52148c,_0x40101d instanceof Error?_0x40101d['message']:String(_0x40101d));}if(_0x5c4a4a[_0x579d18(0x17b)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x579d18(0x183),'App\x20rule\x20content\x20exceeds\x20the\x20bounded\x20UTF-8\x20file\x20limit.');let _0x4e4238;try{_0x4e4238=new TextDecoder(_0x579d18(0x17a),{'fatal':!![],'ignoreBOM':!![]})['decode'](_0x5c4a4a);}catch{throw appRuleError(_0x579d18(0x163),'App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20'+_0x52148c);}if(_0x4e4238['length']>MAX_APP_RULE_UNITS)throw appRuleError('app_rule_content_too_large',_0x579d18(0x16f));if(!_0x4e4238[_0x579d18(0x169)]())throw appRuleError(_0x579d18(0x163),_0x579d18(0x157)+_0x52148c);return inspectAppRuleContent(_0x4e4238);}export function projectAppRule(_0xaac238,_0x1c7fce){const _0x5c4e83=a244_0x26c376;if(!_0x1c7fce)return{'type':_0xaac238,'fileName':appRuleFileName(_0xaac238),'contextScope':appRuleContextScope(_0xaac238),'enabled':![]};const _0x6edd1f=inspectAppRuleContent(_0x1c7fce[_0x5c4e83(0x16c)]);return{'type':_0xaac238,'fileName':appRuleFileName(_0xaac238),'contextScope':appRuleContextScope(_0xaac238),'enabled':!![],'id':_0x1c7fce['id'],'scope':_0x1c7fce[_0x5c4e83(0x164)],'appCode':_0x1c7fce[_0x5c4e83(0x153)],'version':_0x1c7fce[_0x5c4e83(0x174)],..._0x1c7fce[_0x5c4e83(0x15d)]!==undefined?{'indexStatus':_0x1c7fce[_0x5c4e83(0x15d)]}:{},'contentByteSize':_0x6edd1f[_0x5c4e83(0x175)],'contentHash':_0x6edd1f['contentHash'],..._0x1c7fce[_0x5c4e83(0x17d)]!==undefined&&_0x1c7fce[_0x5c4e83(0x17d)]!==null?{'createTime':_0x1c7fce[_0x5c4e83(0x17d)]}:{},..._0x1c7fce[_0x5c4e83(0x160)]!==undefined&&_0x1c7fce[_0x5c4e83(0x160)]!==null?{'updateTime':_0x1c7fce[_0x5c4e83(0x160)]}:{}};}export const APP_RULE_TYPE_FLAG={'name':a244_0x26c376(0x167),'type':a244_0x26c376(0x17f),'required':!![],'description':a244_0x26c376(0x181),'enum':[...APP_RULE_TYPES]};
@@ -1 +1 @@
1
- const a245_0xcfc987=a245_0x4995;(function(_0x53ed89,_0xf6312){const _0x2e25b0=a245_0x4995,_0x57bd3d=_0x53ed89();while(!![]){try{const _0x12f0fc=parseInt(_0x2e25b0(0xb8))/0x1*(-parseInt(_0x2e25b0(0xc2))/0x2)+parseInt(_0x2e25b0(0xe0))/0x3+parseInt(_0x2e25b0(0xb9))/0x4+parseInt(_0x2e25b0(0xb2))/0x5*(parseInt(_0x2e25b0(0xdd))/0x6)+-parseInt(_0x2e25b0(0xd7))/0x7*(-parseInt(_0x2e25b0(0xc8))/0x8)+parseInt(_0x2e25b0(0xd3))/0x9+-parseInt(_0x2e25b0(0xd2))/0xa;if(_0x12f0fc===_0xf6312)break;else _0x57bd3d['push'](_0x57bd3d['shift']());}catch(_0xa4bf08){_0x57bd3d['push'](_0x57bd3d['shift']());}}}(a245_0x367c,0x85279));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';function a245_0x367c(){const _0x587248=['pnpm','slice','all','belowMinimum','preview','vite\x20preview\x20exited\x20with\x20code\x20','watch','21777880CvEvTQ','6985773qyKEFZ','No\x20scripts\x20defined\x20in\x20package.json.','has','bun.lock','371805rFMQip','keys','vite','inherit','run','Run\x20a\x20package.json\x20script','84ENPslV','bun','\x20run\x20<script>\x0a','1753809THRypK','push','bun.lockb','bool','\x20run\x20preview','write','\x20exited\x20with\x20code\x20','args','log','parse','\x20\x20EXAMPLES','Script\x20\x22','pnpm-lock.yaml','boolean','\x20\x20\x20\x20','yarn.lock','dev','length','cwd','changed','path','Available:\x20','error','start','\x20run\x20start','285525BLlbfF','scripts','script','validation','.bin','Domain\x20routing\x20synchronized:\x20','643vQBnJc','813800gcRscq','\x20run\x20preview\x20--watch','\x22\x20not\x20found\x20in\x20package.json.','package.json','npm','needsUpgrade','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','node_modules','No\x20package.json\x20found\x20in\x20current\x20directory.','534VEXocE','Enable\x20watch\x20mode\x20for\x20preview','yarn','close','utf-8','--watch','80HJMZgN','\x0a\x20\x20Available\x20scripts:\x0a','\x20run\x20build'];a245_0x367c=function(){return _0x587248;};return a245_0x367c();}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([a245_0xcfc987(0xb0),a245_0xcfc987(0xa9)]),DOMAIN_ROUTING_SYNC_SCRIPTS=new Set([a245_0xcfc987(0xb0),a245_0xcfc987(0xa9),'build','preview']);export function syncProjectDomainRoutingBeforeScript(_0xbd3e87,_0x3a6ef2){const _0x28f692=a245_0xcfc987;if(!DOMAIN_ROUTING_SYNC_SCRIPTS['has'](_0x3a6ef2))return null;const _0x5b95e4=findProjectRootDirectory(_0xbd3e87);if(!resolveConfigPath(_0x5b95e4))return null;const _0x20c14f=writeProjectDomainRoutingManifest(_0x5b95e4);return{'path':_0x20c14f[_0x28f692(0xad)],'changed':_0x20c14f[_0x28f692(0xac)]};}function readPackageScripts(_0x20f684){const _0x2a2e20=a245_0xcfc987,_0x459930=resolve(_0x20f684,_0x2a2e20(0xbc));if(!existsSync(_0x459930))return null;try{const _0x15dd68=JSON[_0x2a2e20(0xa2)](readFileSync(_0x459930,_0x2a2e20(0xc6)));return _0x15dd68[_0x2a2e20(0xb3)]??{};}catch{return null;}}function detectPackageManager(_0x3bcb4b){const _0x423c68=a245_0xcfc987;if(existsSync(resolve(_0x3bcb4b,_0x423c68(0x9b)))||existsSync(resolve(_0x3bcb4b,_0x423c68(0xd6))))return _0x423c68(0xde);if(existsSync(resolve(_0x3bcb4b,_0x423c68(0xa5))))return _0x423c68(0xcb);if(existsSync(resolve(_0x3bcb4b,_0x423c68(0xa8))))return _0x423c68(0xc4);return _0x423c68(0xbd);}async function versionCheck(_0x4f7c34){const _0xba911=a245_0xcfc987,_0x28d042=await checkCliVersion();(_0x28d042[_0xba911(0xbe)]||_0x28d042[_0xba911(0xce)])&&(printCliUpgradeWarning(_0x28d042),assertCliVersionSupported(_0x28d042));const _0x908c25=await checkSdkVersion(_0x4f7c34);if(_0x908c25[_0xba911(0xbe)])printSdkUpgradeWarning(_0x908c25);}function spawnScript(_0x120022,_0x1df2c3,_0x34b2c0,_0xc1f762){return new Promise((_0x325e15,_0x1a521a)=>{const _0x384579=a245_0x4995,_0x4fb08a=['run',_0x1df2c3,..._0x34b2c0],_0x10f50b=spawn(_0x120022,_0x4fb08a,{'cwd':_0xc1f762,'stdio':_0x384579(0xda),'shell':!![],'env':{...process.env,'PATH':''+join(_0xc1f762,_0x384579(0xc0),_0x384579(0xb6))+delimiter+process.env.PATH}});_0x10f50b['on'](_0x384579(0xc5),_0x5607fa=>{const _0x33b564=_0x384579;if(_0x5607fa===0x0||_0x5607fa===null)_0x325e15();else _0x1a521a(new Error(_0x120022+'\x20run\x20'+_0x1df2c3+_0x33b564(0x9f)+_0x5607fa));}),_0x10f50b['on']('error',_0x1a521a);});}function spawnViteBuildWatch(_0x359bfa){return new Promise((_0x36368f,_0x3384d5)=>{const _0x1a54a4=a245_0x4995,_0x2b108f=spawn(_0x1a54a4(0xd9),['build',_0x1a54a4(0xc7)],{'cwd':_0x359bfa,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x359bfa,_0x1a54a4(0xc0),_0x1a54a4(0xb6))+delimiter+process.env.PATH}});_0x2b108f['on']('close',_0x4fd2f3=>{const _0x70a893=_0x1a54a4;if(_0x4fd2f3===0x0||_0x4fd2f3===null)_0x36368f();else _0x3384d5(new Error(_0x70a893(0xbf)+_0x4fd2f3));}),_0x2b108f['on']('error',_0x3384d5);});}function spawnVitePreview(_0x4d7343){return new Promise((_0x457ac2,_0x30a974)=>{const _0x5c3607=a245_0x4995,_0x386eb7=spawn('vite',[_0x5c3607(0xcf)],{'cwd':_0x4d7343,'stdio':_0x5c3607(0xda),'shell':!![],'env':{...process.env,'PATH':''+join(_0x4d7343,_0x5c3607(0xc0),_0x5c3607(0xb6))+delimiter+process.env.PATH}});_0x386eb7['on'](_0x5c3607(0xc5),_0x50bff0=>{const _0x1ca49f=_0x5c3607;if(_0x50bff0===0x0||_0x50bff0===null)_0x457ac2();else _0x30a974(new Error(_0x1ca49f(0xd0)+_0x50bff0));}),_0x386eb7['on'](_0x5c3607(0xaf),_0x30a974);});}function a245_0x4995(_0x5f8104,_0x2d31b0){_0x5f8104=_0x5f8104-0x9a;const _0x367c73=a245_0x367c();let _0x4995ce=_0x367c73[_0x5f8104];return _0x4995ce;}const runFlags=[{'name':a245_0xcfc987(0xd1),'type':a245_0xcfc987(0xa6),'description':a245_0xcfc987(0xc3),'default':![]}];export const runDefinition={'service':a245_0xcfc987(0xdb),'command':a245_0xcfc987(0xdb),'description':a245_0xcfc987(0xdc),'risk':a245_0xcfc987(0x9e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a245_0xcfc987(0xb4),'description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x117cfb=a245_0xcfc987,_0x2743bd=[];return _0x2743bd[_0x117cfb(0x9a)](_0x117cfb(0xa3)),_0x2743bd[_0x117cfb(0x9a)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x117cfb(0xb1)),_0x2743bd[_0x117cfb(0x9a)](_0x117cfb(0xa7)+CLI_BIN_NAME+_0x117cfb(0xca)),_0x2743bd[_0x117cfb(0x9a)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x117cfb(0x9d)),_0x2743bd[_0x117cfb(0x9a)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x117cfb(0xba)),_0x2743bd['join']('\x0a');},async 'execute'(_0x2d7802){const _0x52ffce=a245_0xcfc987,_0x34d0bd=process[_0x52ffce(0xab)](),_0x224c5f=_0x2d7802['args'][0x0],_0x318abb=_0x2d7802[_0x52ffce(0xa0)][_0x52ffce(0xcc)](0x1),_0x250b7b=readPackageScripts(_0x34d0bd);if(!_0x250b7b)throw CliErrors['validation'](_0x52ffce(0xc1));if(!_0x224c5f){const _0x51866e=Object[_0x52ffce(0xd8)](_0x250b7b);if(_0x51866e[_0x52ffce(0xaa)]===0x0)console[_0x52ffce(0xa1)](_0x52ffce(0xd4));else{console['log'](_0x52ffce(0xc9));for(const _0x1ed839 of _0x51866e){console[_0x52ffce(0xa1)](_0x52ffce(0xa7)+_0x1ed839);}console[_0x52ffce(0xa1)]('\x0a\x20\x20Usage:\x20'+CLI_BIN_NAME+_0x52ffce(0xdf));}return{'ok':!![]};}if(!_0x250b7b[_0x224c5f])throw CliErrors[_0x52ffce(0xb5)](_0x52ffce(0xa4)+_0x224c5f+_0x52ffce(0xbb),_0x52ffce(0xae)+(Object['keys'](_0x250b7b)['join'](',\x20')||'(none)'));const _0x4a7da9=detectPackageManager(_0x34d0bd),_0x3bcd09=syncProjectDomainRoutingBeforeScript(_0x34d0bd,_0x224c5f);_0x3bcd09?.[_0x52ffce(0xac)]&&console[_0x52ffce(0xaf)](_0x52ffce(0xb7)+_0x3bcd09[_0x52ffce(0xad)]);VERSION_CHECK_SCRIPTS[_0x52ffce(0xd5)](_0x224c5f)&&await versionCheck(_0x34d0bd);if(_0x224c5f===_0x52ffce(0xcf)&&_0x2d7802[_0x52ffce(0x9c)](_0x52ffce(0xd1)))return await Promise[_0x52ffce(0xcd)]([spawnViteBuildWatch(_0x34d0bd),spawnVitePreview(_0x34d0bd)]),{'ok':!![]};return await spawnScript(_0x4a7da9,_0x224c5f,_0x318abb,_0x34d0bd),{'ok':!![]};}};
1
+ const a245_0x5d0921=a245_0x1e80;(function(_0x584659,_0x28e2ee){const _0x40cbbe=a245_0x1e80,_0x4bd63b=_0x584659();while(!![]){try{const _0x20b525=parseInt(_0x40cbbe(0xd9))/0x1+parseInt(_0x40cbbe(0xec))/0x2+-parseInt(_0x40cbbe(0xe3))/0x3*(-parseInt(_0x40cbbe(0xee))/0x4)+parseInt(_0x40cbbe(0xfc))/0x5+parseInt(_0x40cbbe(0xe7))/0x6+-parseInt(_0x40cbbe(0x109))/0x7*(-parseInt(_0x40cbbe(0x10b))/0x8)+-parseInt(_0x40cbbe(0xfd))/0x9;if(_0x20b525===_0x28e2ee)break;else _0x4bd63b['push'](_0x4bd63b['shift']());}catch(_0x3e8511){_0x4bd63b['push'](_0x4bd63b['shift']());}}}(a245_0x3bc9,0x5bb71));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 a245_0x3bc9(){const _0x3634aa=['\x20run\x20','No\x20scripts\x20defined\x20in\x20package.json.','Script\x20name\x20defined\x20in\x20package.json','\x20\x20\x20\x20','run','353305DYvWaN','9453546CLZVxj','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','\x0a\x20\x20Available\x20scripts:\x0a','belowMinimum','bun','\x20run\x20preview\x20--watch','args','write','start','dev','error','\x20run\x20build','14qyRvee','(none)','86224DOOAhs','\x22\x20not\x20found\x20in\x20package.json.','has','log','--watch','path','.bin','inherit','Script\x20\x22','\x20run\x20start','575647BjrMuT','keys','validation','build','boolean','npm','preview','\x20run\x20preview','parse','close','69wrKpAF','Available:\x20','\x20run\x20<script>\x0a','push','759654YzAqde','\x0a\x20\x20Usage:\x20','bun.lockb','\x20\x20EXAMPLES','pnpm','498882GXXZdM','vite','66460rronOC','Domain\x20routing\x20synchronized:\x20','slice','node_modules','scripts','changed','all','No\x20package.json\x20found\x20in\x20current\x20directory.','watch'];a245_0x3bc9=function(){return _0x3634aa;};return a245_0x3bc9();}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([a245_0x5d0921(0x105),'dev']),DOMAIN_ROUTING_SYNC_SCRIPTS=new Set([a245_0x5d0921(0x105),a245_0x5d0921(0x106),a245_0x5d0921(0xdc),a245_0x5d0921(0xdf)]);export function syncProjectDomainRoutingBeforeScript(_0x3f4750,_0x3bbaf7){const _0x187d3f=a245_0x5d0921;if(!DOMAIN_ROUTING_SYNC_SCRIPTS[_0x187d3f(0x10d)](_0x3bbaf7))return null;const _0x450ce5=findProjectRootDirectory(_0x3f4750);if(!resolveConfigPath(_0x450ce5))return null;const _0x59d6a7=writeProjectDomainRoutingManifest(_0x450ce5);return{'path':_0x59d6a7['path'],'changed':_0x59d6a7[_0x187d3f(0xf3)]};}function readPackageScripts(_0x11e47f){const _0x3d53fa=a245_0x5d0921,_0xc2b5bd=resolve(_0x11e47f,'package.json');if(!existsSync(_0xc2b5bd))return null;try{const _0xa44b39=JSON[_0x3d53fa(0xe1)](readFileSync(_0xc2b5bd,'utf-8'));return _0xa44b39[_0x3d53fa(0xf2)]??{};}catch{return null;}}function detectPackageManager(_0x994d67){const _0x4d1854=a245_0x5d0921;if(existsSync(resolve(_0x994d67,_0x4d1854(0xe9)))||existsSync(resolve(_0x994d67,'bun.lock')))return _0x4d1854(0x101);if(existsSync(resolve(_0x994d67,'pnpm-lock.yaml')))return _0x4d1854(0xeb);if(existsSync(resolve(_0x994d67,'yarn.lock')))return'yarn';return _0x4d1854(0xde);}async function versionCheck(_0x354f3b){const _0xe98876=a245_0x5d0921,_0x13b5ed=await checkCliVersion();(_0x13b5ed['needsUpgrade']||_0x13b5ed[_0xe98876(0x100)])&&(printCliUpgradeWarning(_0x13b5ed),assertCliVersionSupported(_0x13b5ed));const _0xd9f97e=await checkSdkVersion(_0x354f3b);if(_0xd9f97e['needsUpgrade'])printSdkUpgradeWarning(_0xd9f97e);}function spawnScript(_0x45831b,_0x29c96e,_0x580c51,_0x714d73){return new Promise((_0x3a3604,_0x3d28df)=>{const _0x26b705=a245_0x1e80,_0x1e84e1=[_0x26b705(0xfb),_0x29c96e,..._0x580c51],_0x4fb714=spawn(_0x45831b,_0x1e84e1,{'cwd':_0x714d73,'stdio':_0x26b705(0xd6),'shell':!![],'env':{...process.env,'PATH':''+join(_0x714d73,_0x26b705(0xf1),_0x26b705(0xd5))+delimiter+process.env.PATH}});_0x4fb714['on'](_0x26b705(0xe2),_0x285a0b=>{const _0x2f739a=_0x26b705;if(_0x285a0b===0x0||_0x285a0b===null)_0x3a3604();else _0x3d28df(new Error(_0x45831b+_0x2f739a(0xf7)+_0x29c96e+'\x20exited\x20with\x20code\x20'+_0x285a0b));}),_0x4fb714['on']('error',_0x3d28df);});}function a245_0x1e80(_0xf05e5a,_0x9fbe17){_0xf05e5a=_0xf05e5a-0xd4;const _0x3bc991=a245_0x3bc9();let _0x1e803c=_0x3bc991[_0xf05e5a];return _0x1e803c;}function spawnViteBuildWatch(_0x570e57){return new Promise((_0x52481d,_0x1b43f9)=>{const _0x3fb403=a245_0x1e80,_0x3588ca=spawn(_0x3fb403(0xed),[_0x3fb403(0xdc),_0x3fb403(0x10f)],{'cwd':_0x570e57,'stdio':_0x3fb403(0xd6),'shell':!![],'env':{...process.env,'PATH':''+join(_0x570e57,'node_modules',_0x3fb403(0xd5))+delimiter+process.env.PATH}});_0x3588ca['on'](_0x3fb403(0xe2),_0x5c0ca8=>{const _0x1db0c9=_0x3fb403;if(_0x5c0ca8===0x0||_0x5c0ca8===null)_0x52481d();else _0x1b43f9(new Error(_0x1db0c9(0xfe)+_0x5c0ca8));}),_0x3588ca['on'](_0x3fb403(0x107),_0x1b43f9);});}function spawnVitePreview(_0x597593){return new Promise((_0xc01cfd,_0x345b70)=>{const _0x25509c=a245_0x1e80,_0x259b65=spawn(_0x25509c(0xed),[_0x25509c(0xdf)],{'cwd':_0x597593,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x597593,_0x25509c(0xf1),'.bin')+delimiter+process.env.PATH}});_0x259b65['on']('close',_0x21b0ae=>{if(_0x21b0ae===0x0||_0x21b0ae===null)_0xc01cfd();else _0x345b70(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x21b0ae));}),_0x259b65['on']('error',_0x345b70);});}const runFlags=[{'name':a245_0x5d0921(0xf6),'type':a245_0x5d0921(0xdd),'description':'Enable\x20watch\x20mode\x20for\x20preview','default':![]}];export const runDefinition={'service':a245_0x5d0921(0xfb),'command':'run','description':'Run\x20a\x20package.json\x20script','risk':a245_0x5d0921(0x104),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'script','description':a245_0x5d0921(0xf9),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x4a4076=a245_0x5d0921,_0x3b78b2=[];return _0x3b78b2[_0x4a4076(0xe6)](_0x4a4076(0xea)),_0x3b78b2[_0x4a4076(0xe6)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x4a4076(0xd8)),_0x3b78b2[_0x4a4076(0xe6)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x4a4076(0x108)),_0x3b78b2[_0x4a4076(0xe6)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x4a4076(0xe0)),_0x3b78b2['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x4a4076(0x102)),_0x3b78b2['join']('\x0a');},async 'execute'(_0x183f5){const _0x3c5664=a245_0x5d0921,_0x46647f=process['cwd'](),_0x4c00a5=_0x183f5[_0x3c5664(0x103)][0x0],_0xd24b09=_0x183f5[_0x3c5664(0x103)][_0x3c5664(0xf0)](0x1),_0x48c3ff=readPackageScripts(_0x46647f);if(!_0x48c3ff)throw CliErrors[_0x3c5664(0xdb)](_0x3c5664(0xf5));if(!_0x4c00a5){const _0x564772=Object[_0x3c5664(0xda)](_0x48c3ff);if(_0x564772['length']===0x0)console[_0x3c5664(0x10e)](_0x3c5664(0xf8));else{console['log'](_0x3c5664(0xff));for(const _0x363e08 of _0x564772){console[_0x3c5664(0x10e)](_0x3c5664(0xfa)+_0x363e08);}console[_0x3c5664(0x10e)](_0x3c5664(0xe8)+CLI_BIN_NAME+_0x3c5664(0xe5));}return{'ok':!![]};}if(!_0x48c3ff[_0x4c00a5])throw CliErrors['validation'](_0x3c5664(0xd7)+_0x4c00a5+_0x3c5664(0x10c),_0x3c5664(0xe4)+(Object[_0x3c5664(0xda)](_0x48c3ff)['join'](',\x20')||_0x3c5664(0x10a)));const _0x111e5a=detectPackageManager(_0x46647f),_0x3be9a4=syncProjectDomainRoutingBeforeScript(_0x46647f,_0x4c00a5);_0x3be9a4?.[_0x3c5664(0xf3)]&&console[_0x3c5664(0x107)](_0x3c5664(0xef)+_0x3be9a4[_0x3c5664(0xd4)]);VERSION_CHECK_SCRIPTS[_0x3c5664(0x10d)](_0x4c00a5)&&await versionCheck(_0x46647f);if(_0x4c00a5===_0x3c5664(0xdf)&&_0x183f5['bool']('watch'))return await Promise[_0x3c5664(0xf4)]([spawnViteBuildWatch(_0x46647f),spawnVitePreview(_0x46647f)]),{'ok':!![]};return await spawnScript(_0x111e5a,_0x4c00a5,_0xd24b09,_0x46647f),{'ok':!![]};}};
@@ -1 +1 @@
1
- const a246_0x2d46ed=a246_0x2648;(function(_0x5b2f17,_0x4a56b4){const _0x3f2588=a246_0x2648,_0x5bf3b8=_0x5b2f17();while(!![]){try{const _0x5ae167=parseInt(_0x3f2588(0x1e8))/0x1+-parseInt(_0x3f2588(0x1e0))/0x2*(parseInt(_0x3f2588(0x1e9))/0x3)+parseInt(_0x3f2588(0x1df))/0x4*(parseInt(_0x3f2588(0x1e2))/0x5)+-parseInt(_0x3f2588(0x1dc))/0x6+-parseInt(_0x3f2588(0x1e7))/0x7+parseInt(_0x3f2588(0x1eb))/0x8*(parseInt(_0x3f2588(0x1e5))/0x9)+parseInt(_0x3f2588(0x1e6))/0xa*(parseInt(_0x3f2588(0x1e3))/0xb);if(_0x5ae167===_0x4a56b4)break;else _0x5bf3b8['push'](_0x5bf3b8['shift']());}catch(_0x210aae){_0x5bf3b8['push'](_0x5bf3b8['shift']());}}}(a246_0x556e,0xc1845));import{buildSchemaPayload}from'../framework/schema-export.js';function a246_0x2648(_0x56e51c,_0x302088){_0x56e51c=_0x56e51c-0x1dc;const _0x556ef4=a246_0x556e();let _0x2648f2=_0x556ef4[_0x56e51c];return _0x2648f2;}async function execute(_0xb1d17e){const _0x1800b9=await buildSchemaPayload();return{'ok':!![],'data':_0x1800b9};}export const schemaDefinition={'service':a246_0x2d46ed(0x1ea),'command':a246_0x2d46ed(0x1de),'description':a246_0x2d46ed(0x1e1),'risk':a246_0x2d46ed(0x1dd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a246_0x2d46ed(0x1e4),'flags':[],'execute':execute};function a246_0x556e(){const _0x55a659=['export','200seTLyg','24qbCYLA','Export\x20machine-readable\x20command\x20schema\x20(JSON)','117470HlfHaN','3327247VyPDXB','json','99lnVllt','20OZUMBz','10064439BnVlQo','695552fHXEgF','207228cLROeH','schema','1009016hbJkeH','4819614YteDuT','read'];a246_0x556e=function(){return _0x55a659;};return a246_0x556e();}
1
+ const a246_0x265190=a246_0x4f70;function a246_0x4f70(_0xf66ab1,_0x383848){_0xf66ab1=_0xf66ab1-0x1c3;const _0x2a3e8d=a246_0x2a3e();let _0x4f70f3=_0x2a3e8d[_0xf66ab1];return _0x4f70f3;}function a246_0x2a3e(){const _0x317792=['5RIynXQ','3052347mjUNjY','4303208KlXVaS','json','17368587ntKsqH','18379WXNJaZ','export','5378032loggSr','5857145EXDWET','Export\x20machine-readable\x20command\x20schema\x20(JSON)','3839592KNKaKg','44RnHbse'];a246_0x2a3e=function(){return _0x317792;};return a246_0x2a3e();}(function(_0x588191,_0x14016c){const _0x1b6d2f=a246_0x4f70,_0x300087=_0x588191();while(!![]){try{const _0x11b3cb=parseInt(_0x1b6d2f(0x1c8))/0x1*(-parseInt(_0x1b6d2f(0x1ce))/0x2)+-parseInt(_0x1b6d2f(0x1c4))/0x3+parseInt(_0x1b6d2f(0x1c5))/0x4+parseInt(_0x1b6d2f(0x1c3))/0x5*(-parseInt(_0x1b6d2f(0x1cd))/0x6)+-parseInt(_0x1b6d2f(0x1cb))/0x7+parseInt(_0x1b6d2f(0x1ca))/0x8+parseInt(_0x1b6d2f(0x1c7))/0x9;if(_0x11b3cb===_0x14016c)break;else _0x300087['push'](_0x300087['shift']());}catch(_0x384316){_0x300087['push'](_0x300087['shift']());}}}(a246_0x2a3e,0xbe4b5));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x9321a7){const _0x20ea14=await buildSchemaPayload();return{'ok':!![],'data':_0x20ea14};}export const schemaDefinition={'service':'schema','command':a246_0x265190(0x1c9),'description':a246_0x265190(0x1cc),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a246_0x265190(0x1c6),'flags':[],'execute':execute};
@@ -1 +1 @@
1
- const a247_0x810517=a247_0x5455;(function(_0x3e3c06,_0x3e25ea){const _0x5ab2dd=a247_0x5455,_0x367b6d=_0x3e3c06();while(!![]){try{const _0x2d002c=parseInt(_0x5ab2dd(0x156))/0x1*(-parseInt(_0x5ab2dd(0x13d))/0x2)+-parseInt(_0x5ab2dd(0x151))/0x3+-parseInt(_0x5ab2dd(0x134))/0x4+-parseInt(_0x5ab2dd(0x14e))/0x5+-parseInt(_0x5ab2dd(0x14d))/0x6*(parseInt(_0x5ab2dd(0x154))/0x7)+parseInt(_0x5ab2dd(0x11e))/0x8*(parseInt(_0x5ab2dd(0x121))/0x9)+-parseInt(_0x5ab2dd(0x149))/0xa*(-parseInt(_0x5ab2dd(0x11f))/0xb);if(_0x2d002c===_0x3e25ea)break;else _0x367b6d['push'](_0x367b6d['shift']());}catch(_0xdeb9ed){_0x367b6d['push'](_0x367b6d['shift']());}}}(a247_0x3a30,0x3bede));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';function a247_0x5455(_0x5ff98d,_0x5dde34){_0x5ff98d=_0x5ff98d-0x115;const _0x3a3002=a247_0x3a30();let _0x5455a1=_0x3a3002[_0x5ff98d];return _0x5455a1;}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(_0x58b2c5){const _0x5f03c8=a247_0x5455;if(_0x58b2c5==='mybatisXml')return[_0x5f03c8(0x133),_0x5f03c8(0x12b),_0x5f03c8(0x117),''][_0x5f03c8(0x150)]('\x0a');return[_0x5f03c8(0x122),'']['join']('\x0a');}export const sqlCreate={'service':a247_0x810517(0x138),'command':a247_0x810517(0x129),'description':a247_0x810517(0x119),'risk':'write','flags':[{'name':'name','type':a247_0x810517(0x118),'description':a247_0x810517(0x12d)},{'name':a247_0x810517(0x148),'type':a247_0x810517(0x127),'description':'Target\x20database\x20ID'},{'name':a247_0x810517(0x132),'type':a247_0x810517(0x118),'enum':[a247_0x810517(0x138),a247_0x810517(0x14a)],'description':'Local\x20SQL\x20file\x20mode'}],async 'validate'(_0x784eaf){const _0x3c236a=a247_0x810517;if(!_0x784eaf[_0x3c236a(0x13b)])return;if(!_0x784eaf[_0x3c236a(0x11d)](_0x3c236a(0x125))[_0x3c236a(0x136)]())throw CliErrors['flagMissing'](_0x3c236a(0x125),_0x3c236a(0x155));const _0x403662=resolveProvidedDbId(_0x784eaf);if(typeof _0x403662!==_0x3c236a(0x127)||!Number[_0x3c236a(0x123)](_0x403662)||_0x403662<=0x0)throw CliErrors[_0x3c236a(0x13a)](_0x3c236a(0x148),_0x3c236a(0x116));if(!_0x784eaf[_0x3c236a(0x11d)](_0x3c236a(0x132))['trim']())throw CliErrors[_0x3c236a(0x13a)](_0x3c236a(0x132),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0x176264){const _0x3bd903=a247_0x810517,_0x1368f8=loadSqlProjectConfig(_0x176264[_0x3bd903(0x14f)]),{sqlName:_0x9c201f,dbId:_0xa591a7,dbName:_0x18b554,mode:_0x37c15e}=await resolveSqlNewInputs(_0x176264),_0x5ee7b2=buildSqlRelativePath(_0x3bd903(0x14b),_0x9c201f,_0x18b554,_0x37c15e,_0xa591a7),_0x5a6299=_0x1368f8['sqlRootDir']+'/'+_0x5ee7b2;return{'method':_0x3bd903(0x157),'url':_0x3bd903(0x143),'body':{'appCode':_0x176264['appCode'],'sqlName':_0x9c201f,'dbId':_0xa591a7,'mode':_0x37c15e,'localPath':_0x5a6299},'description':_0x3bd903(0x140)+_0x1368f8[_0x3bd903(0x158)]};},async 'execute'(_0x1ecba7){const _0x136789=a247_0x810517,_0xdf43f=loadSqlProjectConfig(_0x1ecba7[_0x136789(0x14f)]),{sqlName:_0x2d43f3,dbId:_0x84f982,dbName:_0x41f4f5,mode:_0x6fc216}=await resolveSqlNewInputs(_0x1ecba7),_0x5d85ac=generateSqlTemplate(_0x6fc216),_0x312499=await createSqlQuery({'appCode':_0x1ecba7[_0x136789(0x14f)],'sqlName':_0x2d43f3,'dbId':_0x84f982,'sqlContent':_0x5d85ac}),_0x432594=ensureRemoteSqlContent(_0x312499),_0x5bfa4f=_0x41f4f5||await getDbName(_0x1ecba7['appCode'],_0x84f982)[_0x136789(0x159)](()=>undefined),_0x5675a9=buildSqlRelativePath(_0x312499[_0x136789(0x153)],_0x312499[_0x136789(0x12e)],_0x5bfa4f,_0x6fc216,_0x84f982),_0x291514=_0xdf43f[_0x136789(0x158)]+'/'+_0x5675a9,_0x34f342=buildLocalSqlFileContent({'sqlCode':_0x312499[_0x136789(0x153)],'sqlName':_0x312499[_0x136789(0x12e)],'dbId':_0x312499[_0x136789(0x11a)]},_0x432594,{'dbName':_0x5bfa4f,'mode':_0x6fc216,'syncedAt':new Date()[_0x136789(0x13e)](),'description':_0x312499[_0x136789(0x147)]});if(await fileExists(_0x291514))throw CliErrors[_0x136789(0x135)](_0x136789(0x130)+_0x291514);await ensureParentDirectory(_0x291514),await writeFile(_0x291514,_0x34f342,_0x136789(0x13f));const _0x3e348c=await readSqlLockFile(_0xdf43f['lockFilePath']),{lockData:_0x482926,appLock:_0xb85992}=ensureSqlLockScope(_0x3e348c??createEmptySqlLock(),_0xdf43f['appCode'],_0xdf43f['sqlRoot'],_0x136789(0x139));return _0xb85992[_0x136789(0x126)][_0x312499[_0x136789(0x153)]]={...buildSqlLockEntry(_0x312499,_0x432594,computeSqlContentHash(_0x34f342),{'dbName':_0x5bfa4f}),'path':_0x5675a9,'mode':_0x6fc216},_0xb85992['lastSync']=new Date()[_0x136789(0x13e)](),await writeSqlLockFile(_0xdf43f[_0x136789(0x128)],_0x482926),{'ok':!![],'data':{'id':_0x312499['id'],'sqlCode':_0x312499[_0x136789(0x153)],'sqlName':_0x312499['sqlName'],'dbId':_0x312499[_0x136789(0x11a)],'path':_0x291514,'mode':_0x6fc216},'message':_0x136789(0x13c)+_0x312499[_0x136789(0x153)]};}};async function resolveSqlNewInputs(_0x49e589){const _0x3b9da4=await resolveSqlNameInput(_0x49e589),{dbId:_0x393e01,dbName:_0x10225e}=await resolveDbSelection(_0x49e589),_0x4c9122=await resolveSqlModeInput(_0x49e589);return{'sqlName':_0x3b9da4,'dbId':_0x393e01,'dbName':_0x10225e,'mode':_0x4c9122};}async function resolveSqlNameInput(_0x347df1){const _0x50f4af=a247_0x810517,_0x3c282e=_0x347df1[_0x50f4af(0x11d)](_0x50f4af(0x125))[_0x50f4af(0x136)]();if(_0x3c282e)return _0x3c282e;if(_0x347df1[_0x50f4af(0x13b)])throw CliErrors[_0x50f4af(0x13a)]('name',_0x50f4af(0x155));return(await input({'message':'SQL\x20name:','validate':_0xe28f6c=>_0xe28f6c[_0x50f4af(0x136)]()?!![]:_0x50f4af(0x12f)}))[_0x50f4af(0x136)]();}async function resolveDbSelection(_0x1ba491){const _0x1ca473=a247_0x810517,_0xd91534=resolveProvidedDbId(_0x1ba491);if(typeof _0xd91534===_0x1ca473(0x127)&&Number['isFinite'](_0xd91534)&&_0xd91534>0x0)return{'dbId':_0xd91534,'dbName':await getDbName(_0x1ba491[_0x1ca473(0x14f)],_0xd91534)['catch'](()=>undefined)};if(_0x1ba491[_0x1ca473(0x13b)])throw CliErrors[_0x1ca473(0x13a)]('db-id',_0x1ca473(0x116));const _0x15a7c1=await listDatabases(_0x1ba491[_0x1ca473(0x14f)])['catch'](()=>[]);if(_0x15a7c1[_0x1ca473(0x115)]===0x1)return{'dbId':_0x15a7c1[0x0][_0x1ca473(0x11a)],'dbName':_0x15a7c1[0x0]['dbName']};if(_0x15a7c1[_0x1ca473(0x115)]>0x1){const _0x4a6e33=await select({'message':_0x1ca473(0x12a),'choices':[..._0x15a7c1[_0x1ca473(0x14c)](_0x2dfb36=>({'name':_0x2dfb36[_0x1ca473(0x137)]+'\x20('+_0x2dfb36['dbId']+')','value':serializeDbSelection(_0x2dfb36)})),{'name':_0x1ca473(0x11c),'value':_0x1ca473(0x144)}]});if(_0x4a6e33!==_0x1ca473(0x144))return deserializeDbSelection(_0x4a6e33);}const _0x115eea=await input({'message':_0x1ca473(0x11b),'validate':_0x22023f=>{const _0x2873f5=_0x1ca473,_0x1893a0=_0x22023f['trim']();if(!_0x1893a0)return _0x2873f5(0x141);const _0x406049=Number(_0x1893a0);if(!Number[_0x2873f5(0x131)](_0x406049)||_0x406049<=0x0)return'dbId\x20must\x20be\x20a\x20positive\x20integer';return!![];}});return{'dbId':Number(_0x115eea[_0x1ca473(0x136)]())};}async function resolveSqlModeInput(_0x5e2c5c){const _0x40bb4a=a247_0x810517,_0x4165e1=_0x5e2c5c[_0x40bb4a(0x11d)](_0x40bb4a(0x132))[_0x40bb4a(0x136)]();if(_0x4165e1===_0x40bb4a(0x138)||_0x4165e1==='mybatisXml')return _0x4165e1;if(_0x5e2c5c[_0x40bb4a(0x13b)])throw CliErrors[_0x40bb4a(0x13a)](_0x40bb4a(0x132),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');return await select({'message':_0x40bb4a(0x142),'choices':[{'name':_0x40bb4a(0x124),'value':_0x40bb4a(0x138),'description':'For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly'},{'name':_0x40bb4a(0x152),'value':_0x40bb4a(0x14a),'description':_0x40bb4a(0x146)}]});}function serializeDbSelection(_0x5dfcdb){const _0x9c8db6=a247_0x810517;return JSON[_0x9c8db6(0x145)]({'dbId':_0x5dfcdb[_0x9c8db6(0x11a)],'dbName':_0x5dfcdb[_0x9c8db6(0x137)]});}function deserializeDbSelection(_0x50eda0){const _0x4b516f=a247_0x810517;try{const _0x1a0dba=JSON[_0x4b516f(0x120)](_0x50eda0);if(typeof _0x1a0dba[_0x4b516f(0x11a)]===_0x4b516f(0x127)&&Number['isFinite'](_0x1a0dba[_0x4b516f(0x11a)]))return{'dbId':_0x1a0dba[_0x4b516f(0x11a)],'dbName':_0x1a0dba['dbName']};}catch{}throw CliErrors[_0x4b516f(0x135)](_0x4b516f(0x12c)+_0x50eda0);}function resolveProvidedDbId(_0x34b363){const _0x30cfc6=a247_0x810517,_0x371e55=_0x34b363['flag'](_0x30cfc6(0x148));if(typeof _0x371e55===_0x30cfc6(0x127)&&Number[_0x30cfc6(0x123)](_0x371e55))return _0x371e55;return undefined;}function a247_0x3a30(){const _0x44b850=['isFinite','Plain\x20SQL\x20(sql)','name','sqls','number','lockFilePath','create','Select\x20the\x20target\x20database:','\x20\x20SELECT\x201\x20AS\x20id','Invalid\x20database\x20selection\x20payload:\x20','SQL\x20query\x20display\x20name','sqlName','SQL\x20name\x20cannot\x20be\x20empty','File\x20already\x20exists:\x20','isInteger','mode','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','153180WdTdZd','validation','trim','dbName','sql','new','flagMissing','nonInteractive','Created\x20SQL\x20query\x20','9856pCeXHZ','toISOString','utf8','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','dbId\x20cannot\x20be\x20empty','Select\x20the\x20local\x20SQL\x20mode:','/smartapi/custom/saveUserCustomSql','__manual__','stringify','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','description','db-id','40ItnUjo','mybatisXml','<server-generated-sqlCode>','map','57738mpcVyi','1199925UNYCjB','appCode','join','589974HuOSxi','MyBatis\x20XML\x20(mybatisXml)','sqlCode','14ciesJO','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','58WUJTMO','POST','sqlRootDir','catch','length','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','</select>','string','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','dbId','Target\x20database\x20dbId:','✎\x20Enter\x20dbId\x20manually','str','16UucOcD','2729089sVSGAD','parse','148869PjwGvv','SELECT\x201\x20AS\x20id;'];a247_0x3a30=function(){return _0x44b850;};return a247_0x3a30();}
1
+ const a247_0x3eb7e4=a247_0x40f4;(function(_0x302020,_0x5f3841){const _0x3604d4=a247_0x40f4,_0x283970=_0x302020();while(!![]){try{const _0x4c07bb=-parseInt(_0x3604d4(0x1a7))/0x1+parseInt(_0x3604d4(0x1bf))/0x2*(parseInt(_0x3604d4(0x19b))/0x3)+parseInt(_0x3604d4(0x1d2))/0x4*(parseInt(_0x3604d4(0x196))/0x5)+parseInt(_0x3604d4(0x1c5))/0x6+parseInt(_0x3604d4(0x1b1))/0x7*(-parseInt(_0x3604d4(0x1ad))/0x8)+parseInt(_0x3604d4(0x1c0))/0x9+-parseInt(_0x3604d4(0x1b9))/0xa;if(_0x4c07bb===_0x5f3841)break;else _0x283970['push'](_0x283970['shift']());}catch(_0x25e9c2){_0x283970['push'](_0x283970['shift']());}}}(a247_0x165c,0x8b60e));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function a247_0x165c(){const _0x411d8e=['SQL\x20name:','sqlRootDir','join','mybatisXml','</select>','flagMissing','213484FOwEaO','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','number','isInteger','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','string','30DvfzhG','lockFilePath','sql','SQL\x20name\x20cannot\x20be\x20empty','toISOString','158511BszgHl','trim','dbId\x20must\x20be\x20a\x20positive\x20integer','nonInteractive','stringify','Select\x20the\x20local\x20SQL\x20mode:','<server-generated-sqlCode>','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','Plain\x20SQL\x20(sql)','map','utf8','dbName','614608GwqwrT','validation','Select\x20the\x20target\x20database:','sqlName','description','str','138536cXQAaC','__manual__','flag','Local\x20SQL\x20file\x20mode','84tXpAfn','length','catch','new','File\x20already\x20exists:\x20','SELECT\x201\x20AS\x20id;','dbId\x20cannot\x20be\x20empty','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','5336250GkLBpu','create','sqls','name','Created\x20SQL\x20query\x20','/smartapi/custom/saveUserCustomSql','26XjnJGb','1794303LWdFQd','appCode','db-id','isFinite','write','4322742POKezn','mode','Target\x20database\x20dbId:','sqlCode','parse','Invalid\x20database\x20selection\x20payload:\x20','dbId'];a247_0x165c=function(){return _0x411d8e;};return a247_0x165c();}function generateSqlTemplate(_0x376681){const _0x1cdbaf=a247_0x40f4;if(_0x376681===_0x1cdbaf(0x1cf))return['<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','\x20\x20SELECT\x201\x20AS\x20id',_0x1cdbaf(0x1d0),''][_0x1cdbaf(0x1ce)]('\x0a');return[_0x1cdbaf(0x1b6),'']['join']('\x0a');}export const sqlCreate={'service':'sql','command':a247_0x3eb7e4(0x1ba),'description':'Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','risk':a247_0x3eb7e4(0x1c4),'flags':[{'name':a247_0x3eb7e4(0x1bc),'type':a247_0x3eb7e4(0x195),'description':'SQL\x20query\x20display\x20name'},{'name':'db-id','type':'number','description':'Target\x20database\x20ID'},{'name':a247_0x3eb7e4(0x1c6),'type':a247_0x3eb7e4(0x195),'enum':[a247_0x3eb7e4(0x198),a247_0x3eb7e4(0x1cf)],'description':a247_0x3eb7e4(0x1b0)}],async 'validate'(_0x3ada23){const _0x2c225e=a247_0x3eb7e4;if(!_0x3ada23[_0x2c225e(0x19e)])return;if(!_0x3ada23[_0x2c225e(0x1ac)](_0x2c225e(0x1bc))[_0x2c225e(0x19c)]())throw CliErrors['flagMissing'](_0x2c225e(0x1bc),_0x2c225e(0x194));const _0x56223b=resolveProvidedDbId(_0x3ada23);if(typeof _0x56223b!==_0x2c225e(0x192)||!Number['isFinite'](_0x56223b)||_0x56223b<=0x0)throw CliErrors['flagMissing'](_0x2c225e(0x1c2),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');if(!_0x3ada23[_0x2c225e(0x1ac)](_0x2c225e(0x1c6))[_0x2c225e(0x19c)]())throw CliErrors[_0x2c225e(0x1d1)](_0x2c225e(0x1c6),_0x2c225e(0x1b8));},async 'dryRun'(_0x244e8c){const _0x5f252c=a247_0x3eb7e4,_0x2fd121=loadSqlProjectConfig(_0x244e8c[_0x5f252c(0x1c1)]),{sqlName:_0x4738ef,dbId:_0x2bee5e,dbName:_0x5b40b7,mode:_0x1ef672}=await resolveSqlNewInputs(_0x244e8c),_0x599757=buildSqlRelativePath(_0x5f252c(0x1a1),_0x4738ef,_0x5b40b7,_0x1ef672,_0x2bee5e),_0x432f52=_0x2fd121[_0x5f252c(0x1cd)]+'/'+_0x599757;return{'method':'POST','url':_0x5f252c(0x1be),'body':{'appCode':_0x244e8c[_0x5f252c(0x1c1)],'sqlName':_0x4738ef,'dbId':_0x2bee5e,'mode':_0x1ef672,'localPath':_0x432f52},'description':'Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20'+_0x2fd121[_0x5f252c(0x1cd)]};},async 'execute'(_0x501e7b){const _0x2d8704=a247_0x3eb7e4,_0xb95c7f=loadSqlProjectConfig(_0x501e7b[_0x2d8704(0x1c1)]),{sqlName:_0x44bdae,dbId:_0x3dab7d,dbName:_0x7bba24,mode:_0x412a70}=await resolveSqlNewInputs(_0x501e7b),_0xd2781a=generateSqlTemplate(_0x412a70),_0x2d2284=await createSqlQuery({'appCode':_0x501e7b[_0x2d8704(0x1c1)],'sqlName':_0x44bdae,'dbId':_0x3dab7d,'sqlContent':_0xd2781a}),_0x261523=ensureRemoteSqlContent(_0x2d2284),_0x36dac0=_0x7bba24||await getDbName(_0x501e7b[_0x2d8704(0x1c1)],_0x3dab7d)['catch'](()=>undefined),_0x2b821e=buildSqlRelativePath(_0x2d2284[_0x2d8704(0x1c8)],_0x2d2284[_0x2d8704(0x1aa)],_0x36dac0,_0x412a70,_0x3dab7d),_0x731e59=_0xb95c7f['sqlRootDir']+'/'+_0x2b821e,_0x4c3512=buildLocalSqlFileContent({'sqlCode':_0x2d2284[_0x2d8704(0x1c8)],'sqlName':_0x2d2284[_0x2d8704(0x1aa)],'dbId':_0x2d2284[_0x2d8704(0x1cb)]},_0x261523,{'dbName':_0x36dac0,'mode':_0x412a70,'syncedAt':new Date()[_0x2d8704(0x19a)](),'description':_0x2d2284[_0x2d8704(0x1ab)]});if(await fileExists(_0x731e59))throw CliErrors[_0x2d8704(0x1a8)](_0x2d8704(0x1b5)+_0x731e59);await ensureParentDirectory(_0x731e59),await writeFile(_0x731e59,_0x4c3512,_0x2d8704(0x1a5));const _0x3febbc=await readSqlLockFile(_0xb95c7f[_0x2d8704(0x197)]),{lockData:_0x3a116e,appLock:_0x24ee2f}=ensureSqlLockScope(_0x3febbc??createEmptySqlLock(),_0xb95c7f[_0x2d8704(0x1c1)],_0xb95c7f['sqlRoot'],_0x2d8704(0x1b4));return _0x24ee2f[_0x2d8704(0x1bb)][_0x2d2284['sqlCode']]={...buildSqlLockEntry(_0x2d2284,_0x261523,computeSqlContentHash(_0x4c3512),{'dbName':_0x36dac0}),'path':_0x2b821e,'mode':_0x412a70},_0x24ee2f['lastSync']=new Date()['toISOString'](),await writeSqlLockFile(_0xb95c7f[_0x2d8704(0x197)],_0x3a116e),{'ok':!![],'data':{'id':_0x2d2284['id'],'sqlCode':_0x2d2284[_0x2d8704(0x1c8)],'sqlName':_0x2d2284[_0x2d8704(0x1aa)],'dbId':_0x2d2284[_0x2d8704(0x1cb)],'path':_0x731e59,'mode':_0x412a70},'message':_0x2d8704(0x1bd)+_0x2d2284[_0x2d8704(0x1c8)]};}};async function resolveSqlNewInputs(_0x4800f6){const _0x1e94ca=await resolveSqlNameInput(_0x4800f6),{dbId:_0x27d286,dbName:_0x4d0493}=await resolveDbSelection(_0x4800f6),_0x25376b=await resolveSqlModeInput(_0x4800f6);return{'sqlName':_0x1e94ca,'dbId':_0x27d286,'dbName':_0x4d0493,'mode':_0x25376b};}async function resolveSqlNameInput(_0x59d65e){const _0x4977cc=a247_0x3eb7e4,_0x1fe493=_0x59d65e[_0x4977cc(0x1ac)](_0x4977cc(0x1bc))[_0x4977cc(0x19c)]();if(_0x1fe493)return _0x1fe493;if(_0x59d65e['nonInteractive'])throw CliErrors['flagMissing']('name',_0x4977cc(0x194));return(await input({'message':_0x4977cc(0x1cc),'validate':_0x11fb30=>_0x11fb30[_0x4977cc(0x19c)]()?!![]:_0x4977cc(0x199)}))[_0x4977cc(0x19c)]();}async function resolveDbSelection(_0x4e2bc6){const _0x2b2715=a247_0x3eb7e4,_0xb40d06=resolveProvidedDbId(_0x4e2bc6);if(typeof _0xb40d06===_0x2b2715(0x192)&&Number[_0x2b2715(0x1c3)](_0xb40d06)&&_0xb40d06>0x0)return{'dbId':_0xb40d06,'dbName':await getDbName(_0x4e2bc6[_0x2b2715(0x1c1)],_0xb40d06)[_0x2b2715(0x1b3)](()=>undefined)};if(_0x4e2bc6[_0x2b2715(0x19e)])throw CliErrors[_0x2b2715(0x1d1)]('db-id',_0x2b2715(0x1a2));const _0x13ed55=await listDatabases(_0x4e2bc6[_0x2b2715(0x1c1)])[_0x2b2715(0x1b3)](()=>[]);if(_0x13ed55[_0x2b2715(0x1b2)]===0x1)return{'dbId':_0x13ed55[0x0][_0x2b2715(0x1cb)],'dbName':_0x13ed55[0x0]['dbName']};if(_0x13ed55[_0x2b2715(0x1b2)]>0x1){const _0x3b785c=await select({'message':_0x2b2715(0x1a9),'choices':[..._0x13ed55[_0x2b2715(0x1a4)](_0x12d19d=>({'name':_0x12d19d[_0x2b2715(0x1a6)]+'\x20('+_0x12d19d['dbId']+')','value':serializeDbSelection(_0x12d19d)})),{'name':'✎\x20Enter\x20dbId\x20manually','value':_0x2b2715(0x1ae)}]});if(_0x3b785c!==_0x2b2715(0x1ae))return deserializeDbSelection(_0x3b785c);}const _0x17ff91=await input({'message':_0x2b2715(0x1c7),'validate':_0x1ede53=>{const _0x28a30d=_0x2b2715,_0xe804e=_0x1ede53[_0x28a30d(0x19c)]();if(!_0xe804e)return _0x28a30d(0x1b7);const _0x1d7d0d=Number(_0xe804e);if(!Number[_0x28a30d(0x193)](_0x1d7d0d)||_0x1d7d0d<=0x0)return _0x28a30d(0x19d);return!![];}});return{'dbId':Number(_0x17ff91[_0x2b2715(0x19c)]())};}async function resolveSqlModeInput(_0x495d84){const _0x570ab0=a247_0x3eb7e4,_0xee67be=_0x495d84[_0x570ab0(0x1ac)](_0x570ab0(0x1c6))[_0x570ab0(0x19c)]();if(_0xee67be==='sql'||_0xee67be===_0x570ab0(0x1cf))return _0xee67be;if(_0x495d84[_0x570ab0(0x19e)])throw CliErrors[_0x570ab0(0x1d1)](_0x570ab0(0x1c6),_0x570ab0(0x1b8));return await select({'message':_0x570ab0(0x1a0),'choices':[{'name':_0x570ab0(0x1a3),'value':_0x570ab0(0x198),'description':'For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly'},{'name':'MyBatis\x20XML\x20(mybatisXml)','value':_0x570ab0(0x1cf),'description':_0x570ab0(0x191)}]});}function a247_0x40f4(_0x47c5ff,_0x4cfaee){_0x47c5ff=_0x47c5ff-0x191;const _0x165c5f=a247_0x165c();let _0x40f40f=_0x165c5f[_0x47c5ff];return _0x40f40f;}function serializeDbSelection(_0x3df7f0){const _0xfcd255=a247_0x3eb7e4;return JSON[_0xfcd255(0x19f)]({'dbId':_0x3df7f0[_0xfcd255(0x1cb)],'dbName':_0x3df7f0[_0xfcd255(0x1a6)]});}function deserializeDbSelection(_0xf69d10){const _0x3a2bc0=a247_0x3eb7e4;try{const _0x523796=JSON[_0x3a2bc0(0x1c9)](_0xf69d10);if(typeof _0x523796['dbId']==='number'&&Number[_0x3a2bc0(0x1c3)](_0x523796[_0x3a2bc0(0x1cb)]))return{'dbId':_0x523796[_0x3a2bc0(0x1cb)],'dbName':_0x523796[_0x3a2bc0(0x1a6)]};}catch{}throw CliErrors[_0x3a2bc0(0x1a8)](_0x3a2bc0(0x1ca)+_0xf69d10);}function resolveProvidedDbId(_0x1e669d){const _0x13c028=a247_0x3eb7e4,_0x22b0b4=_0x1e669d[_0x13c028(0x1af)](_0x13c028(0x1c2));if(typeof _0x22b0b4===_0x13c028(0x192)&&Number[_0x13c028(0x1c3)](_0x22b0b4))return _0x22b0b4;return undefined;}