@lovrabet/rabetbase-cli 2.5.9-beta.1 → 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_0x31ca6c=a232_0x2af0;(function(_0x193d11,_0xe87072){const _0x12f5db=a232_0x2af0,_0x355aa7=_0x193d11();while(!![]){try{const _0x2d8f76=parseInt(_0x12f5db(0x14f))/0x1*(-parseInt(_0x12f5db(0x14b))/0x2)+-parseInt(_0x12f5db(0x14d))/0x3*(parseInt(_0x12f5db(0x14a))/0x4)+-parseInt(_0x12f5db(0x145))/0x5+parseInt(_0x12f5db(0x143))/0x6+parseInt(_0x12f5db(0x142))/0x7*(parseInt(_0x12f5db(0x147))/0x8)+parseInt(_0x12f5db(0x144))/0x9+-parseInt(_0x12f5db(0x149))/0xa;if(_0x2d8f76===_0xe87072)break;else _0x355aa7['push'](_0x355aa7['shift']());}catch(_0x3de6c8){_0x355aa7['push'](_0x355aa7['shift']());}}}(a232_0x19f0,0x21e27));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a232_0x2af0(_0x542f7c,_0x3190e6){_0x542f7c=_0x542f7c-0x140;const _0x19f042=a232_0x19f0();let _0x2af068=_0x19f042[_0x542f7c];return _0x2af068;}function a232_0x19f0(){const _0x2b5294=['195AXuzOC','appCode','3WpMqJI','role','roleName','read','94213JYUheY','1110372xllAvl','306585axPKmG','247400PLvHIm','Role\x20','152sHOfWe','num','592950HVnopx','12028qWdRyZ','21218HnNeHH','dev'];a232_0x19f0=function(){return _0x2b5294;};return a232_0x19f0();}export const roleDetail={'service':a232_0x31ca6c(0x150),'command':'detail','description':'Show\x20a\x20single\x20role\x27s\x20detail','risk':a232_0x31ca6c(0x141),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x42ef7a){const _0x48ec35=a232_0x31ca6c,_0x13418e=_0x42ef7a[_0x48ec35(0x148)]('id'),_0x180771=await getRoleById(_0x42ef7a[_0x48ec35(0x14e)],_0x13418e);return{'ok':!![],'data':{'scope':_0x48ec35(0x14c),'role':projectRole(_0x180771)},'message':_0x48ec35(0x146)+_0x180771[_0x48ec35(0x140)]+'\x20('+_0x180771['roleType']+')'};}};
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(_0x351208,_0x36f512){const _0x235a23=a233_0x24e0,_0x4c6605=_0x351208();while(!![]){try{const _0x233731=parseInt(_0x235a23(0x11f))/0x1*(parseInt(_0x235a23(0x118))/0x2)+-parseInt(_0x235a23(0x11e))/0x3*(-parseInt(_0x235a23(0x122))/0x4)+parseInt(_0x235a23(0x11b))/0x5*(parseInt(_0x235a23(0x11a))/0x6)+parseInt(_0x235a23(0x120))/0x7*(-parseInt(_0x235a23(0x11c))/0x8)+parseInt(_0x235a23(0x123))/0x9*(-parseInt(_0x235a23(0x119))/0xa)+parseInt(_0x235a23(0x11d))/0xb+parseInt(_0x235a23(0x121))/0xc*(-parseInt(_0x235a23(0x117))/0xd);if(_0x233731===_0x36f512)break;else _0x4c6605['push'](_0x4c6605['shift']());}catch(_0x1df6cf){_0x4c6605['push'](_0x4c6605['shift']());}}}(a233_0x1570,0x524ed));import{roleList}from'../../commands/role/list.js';function a233_0x1570(){const _0x1a3c68=['3557337PqLsBV','12YqHfLm','713764AKPlBw','3546Kxwbop','13473083poIOHw','839666qQQkWF','7630MmRMpm','852nmOdru','22025ZcgFlC','8lwaiGg','6618381IuoEXH','9PFJtjj','1hXjrKF'];a233_0x1570=function(){return _0x1a3c68;};return a233_0x1570();}import{roleDetail}from'../../commands/role/detail.js';function a233_0x24e0(_0x44e46b,_0x2de4e4){_0x44e46b=_0x44e46b-0x117;const _0x157009=a233_0x1570();let _0x24e0de=_0x157009[_0x44e46b];return _0x24e0de;}import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';import{roleUserResolve}from'../../commands/role/user-resolve.js';import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,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_0x5c3830=a234_0x1835;(function(_0x47745c,_0x1c48e3){const _0x36f477=a234_0x1835,_0x271899=_0x47745c();while(!![]){try{const _0xc4cbbe=-parseInt(_0x36f477(0x121))/0x1+parseInt(_0x36f477(0x140))/0x2*(parseInt(_0x36f477(0x13d))/0x3)+-parseInt(_0x36f477(0x13c))/0x4*(parseInt(_0x36f477(0x127))/0x5)+parseInt(_0x36f477(0x137))/0x6*(parseInt(_0x36f477(0x131))/0x7)+-parseInt(_0x36f477(0x125))/0x8+parseInt(_0x36f477(0x13e))/0x9*(parseInt(_0x36f477(0x124))/0xa)+parseInt(_0x36f477(0x12e))/0xb*(parseInt(_0x36f477(0x11f))/0xc);if(_0xc4cbbe===_0x1c48e3)break;else _0x271899['push'](_0x271899['shift']());}catch(_0x271c78){_0x271899['push'](_0x271899['shift']());}}}(a234_0x2508,0xb208f));import{listAppRoles}from'../../core/api-client.js';function a234_0x1835(_0xbcb834,_0x4b47ae){_0xbcb834=_0xbcb834-0x11f;const _0x2508c8=a234_0x2508();let _0x183566=_0x2508c8[_0xbcb834];return _0x183566;}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_0x5c3830(0x120),'DEV',a234_0x5c3830(0x132),'CUSTOM'];function a234_0x2508(){const _0x7612db=['652690NwrjKe','9161056NnAorz','type','413575zbDvRd','role','appCode','Use\x20one\x20of:\x20','length','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','Filter\x20by\x20role\x20type','11bitqbj','\x20role(s)','number','21moeojT','OWNER','pagesize','filter','Page\x20index\x20(1-based)','Found\x20','2412114abRosR','Invalid\x20--type\x20\x22','Page\x20size\x20(1-100)','join','read','20MqdeOu','21SIbwvC','72gMXMZt','page','372770qWwrHb','trim','num','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','validation','roleType','includes','3336252eoRXpS','ADMIN','1022987usRLAa','toUpperCase','str'];a234_0x2508=function(){return _0x7612db;};return a234_0x2508();}export const roleList={'service':a234_0x5c3830(0x128),'command':'list','description':a234_0x5c3830(0x12c),'risk':a234_0x5c3830(0x13b),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a234_0x5c3830(0x126),'type':'string','required':![],'description':a234_0x5c3830(0x12d),'enum':ROLE_TYPES},{'name':a234_0x5c3830(0x13f),'type':a234_0x5c3830(0x130),'description':a234_0x5c3830(0x135),'default':0x1},{'name':a234_0x5c3830(0x133),'type':'number','description':a234_0x5c3830(0x139),'default':0x64}],async 'validate'(_0x540305){const _0x4c765d=a234_0x5c3830,_0x3da7cc=_0x540305[_0x4c765d(0x123)](_0x4c765d(0x126))['trim']();if(_0x3da7cc&&!ROLE_TYPES[_0x4c765d(0x146)](_0x3da7cc[_0x4c765d(0x122)]()))throw CliErrors[_0x4c765d(0x144)](_0x4c765d(0x138)+_0x3da7cc+'\x22.',_0x4c765d(0x12a)+ROLE_TYPES[_0x4c765d(0x13a)](',\x20')+'.');const _0x4a5085=_0x540305[_0x4c765d(0x142)](_0x4c765d(0x13f),0x1),_0xceb8a7=_0x540305[_0x4c765d(0x142)](_0x4c765d(0x133),0x64);if(_0x4a5085<0x1)throw CliErrors[_0x4c765d(0x144)](_0x4c765d(0x143));if(_0xceb8a7<0x1||_0xceb8a7>0x64)throw CliErrors['validation']('--pagesize\x20must\x20be\x20between\x201\x20and\x20100.');},async 'execute'(_0x86e315){const _0x48ae1c=a234_0x5c3830,_0xedb570=_0x86e315['num'](_0x48ae1c(0x13f),0x1)||0x1,_0x4f19d6=_0x86e315['num'](_0x48ae1c(0x133),0x64)||0x64,_0x597185=_0x86e315[_0x48ae1c(0x123)](_0x48ae1c(0x126))[_0x48ae1c(0x141)]()['toUpperCase'](),{items:_0x46934d,paging:_0x184a66}=await listAppRoles(_0x86e315[_0x48ae1c(0x129)],{'currentPage':_0xedb570,'pageSize':_0x4f19d6}),_0x3d3a57=_0x597185?_0x46934d[_0x48ae1c(0x134)](_0x161a0f=>_0x161a0f[_0x48ae1c(0x145)]===_0x597185):_0x46934d,_0x4e4199=_0x3d3a57['map'](projectRole);return{'ok':!![],'data':{'scope':'dev','roles':_0x4e4199,'paging':_0x184a66},'message':_0x48ae1c(0x136)+_0x4e4199[_0x48ae1c(0x12b)]+_0x48ae1c(0x12f)};}};
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_0xe6d5d6=a235_0x14b7;(function(_0x1dfb6f,_0x546290){const _0x33abad=a235_0x14b7,_0x3e4e4e=_0x1dfb6f();while(!![]){try{const _0x3efb0b=-parseInt(_0x33abad(0x175))/0x1+-parseInt(_0x33abad(0x162))/0x2*(parseInt(_0x33abad(0x157))/0x3)+parseInt(_0x33abad(0x163))/0x4*(parseInt(_0x33abad(0x16e))/0x5)+parseInt(_0x33abad(0x173))/0x6+parseInt(_0x33abad(0x161))/0x7+-parseInt(_0x33abad(0x18b))/0x8+parseInt(_0x33abad(0x16a))/0x9;if(_0x3efb0b===_0x546290)break;else _0x3e4e4e['push'](_0x3e4e4e['shift']());}catch(_0x2998fc){_0x3e4e4e['push'](_0x3e4e4e['shift']());}}}(a235_0x33e5,0xdfd15));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_0xe6d5d6(0x17c),'required':!![],'description':'Role\x20id\x20(from\x20`role\x20list`)'};export const ROLE_REF_FLAG={'name':a235_0xe6d5d6(0x17e),'type':a235_0xe6d5d6(0x19d),'required':!![],'description':a235_0xe6d5d6(0x18e)};export const USER_REF_FLAG={'name':'user','type':a235_0xe6d5d6(0x19d),'required':!![],'description':a235_0xe6d5d6(0x18c)};export const NAME_FLAG={'name':a235_0xe6d5d6(0x191),'type':a235_0xe6d5d6(0x19d),'required':!![],'description':a235_0xe6d5d6(0x180)};export const USER_NAME_FLAG={'name':a235_0xe6d5d6(0x191),'type':a235_0xe6d5d6(0x19d),'required':!![],'description':a235_0xe6d5d6(0x185)};export const REMARK_FLAG={'name':'remark','type':a235_0xe6d5d6(0x19d),'required':![],'description':'Optional\x20role\x20remark/description'};export const EXPECT_USER_COUNT_FLAG={'name':'expect-user-count','type':a235_0xe6d5d6(0x17c),'required':![],'description':a235_0xe6d5d6(0x181)};export const BUILTIN_ROLE_TYPES=[a235_0xe6d5d6(0x15e),a235_0xe6d5d6(0x160),a235_0xe6d5d6(0x158)];export function isBuiltinRole(_0x5228dc){const _0x351a65=a235_0xe6d5d6;return BUILTIN_ROLE_TYPES[_0x351a65(0x170)](_0x5228dc);}function a235_0x14b7(_0x237b77,_0xec76bf){_0x237b77=_0x237b77-0x152;const _0x33e54a=a235_0x33e5();let _0x14b701=_0x33e54a[_0x237b77];return _0x14b701;}export function assertCustomRole(_0xe9f3f2,_0x410c75){const _0xe2ccdb=a235_0xe6d5d6;if(_0xe9f3f2[_0xe2ccdb(0x168)]!==_0xe2ccdb(0x194))throw CliErrors[_0xe2ccdb(0x18d)]('Cannot\x20'+_0x410c75+_0xe2ccdb(0x165)+_0xe9f3f2[_0xe2ccdb(0x166)]+'\x20('+_0xe9f3f2[_0xe2ccdb(0x168)]+').','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.');}export function projectRole(_0x27f2c7){const _0x2afbfc=a235_0xe6d5d6;return{'id':_0x27f2c7['id'],'roleName':_0x27f2c7['roleName'],'roleType':_0x27f2c7[_0x2afbfc(0x168)],'remark':_0x27f2c7[_0x2afbfc(0x15f)],'userCount':_0x27f2c7[_0x2afbfc(0x159)],'permitCount':_0x27f2c7[_0x2afbfc(0x15c)],'builtin':isBuiltinRole(_0x27f2c7[_0x2afbfc(0x168)])};}export async function resolveRoleRef(_0xcecbac,_0x10aaac){const _0x2a6cd3=a235_0xe6d5d6,_0x2d4f06=_0x10aaac[_0x2a6cd3(0x19a)]();if(!_0x2d4f06)throw CliErrors[_0x2a6cd3(0x18d)]('Missing\x20role\x20reference.','Pass\x20--role\x20<id|name>.');if(/^\d+$/['test'](_0x2d4f06))return getRoleById(_0xcecbac,Number(_0x2d4f06));const _0x3dd540=await listAllAppRoles(_0xcecbac),_0x58e5c8=_0x3dd540['filter'](_0x41104d=>_0x41104d['roleName']===_0x2d4f06);if(_0x58e5c8[_0x2a6cd3(0x19c)]===0x0)throw CliErrors[_0x2a6cd3(0x18d)](_0x2a6cd3(0x189)+_0x2d4f06+'\x22\x20not\x20found\x20in\x20app\x20'+_0xcecbac+'.',_0x2a6cd3(0x197));if(_0x58e5c8['length']>0x1){const _0x310571=_0x58e5c8[_0x2a6cd3(0x192)](_0x19da3e=>_0x19da3e['id'])[_0x2a6cd3(0x16f)](',\x20');throw CliErrors[_0x2a6cd3(0x18d)](_0x2a6cd3(0x189)+_0x2d4f06+_0x2a6cd3(0x18f)+_0x310571+').','Disambiguate\x20with\x20--role\x20<id>.');}return _0x58e5c8[0x0];}export async function getRoleById(_0x3f51b3,_0x139f12){const _0x8fb804=a235_0xe6d5d6,_0x210b32=await listAllAppRoles(_0x3f51b3),_0x2fcd26=_0x210b32[_0x8fb804(0x17d)](_0x53b111=>_0x53b111['id']===_0x139f12&&(!_0x53b111['appCode']||_0x53b111[_0x8fb804(0x17f)]===_0x3f51b3));if(_0x2fcd26['length']!==0x1)throw CliErrors[_0x8fb804(0x18d)]('Role\x20id\x20'+_0x139f12+_0x8fb804(0x19f)+_0x3f51b3+'.',_0x8fb804(0x174));return _0x2fcd26[0x0];}async function listAllAppRoles(_0x459189){const _0x5051fc=a235_0xe6d5d6,_0xf89011=0x64,_0x53b34f=[];for(let _0x2a05e5=0x1;;_0x2a05e5+=0x1){const {items:_0x1fe56d,paging:_0x10e16f}=await listAppRoles(_0x459189,{'currentPage':_0x2a05e5,'pageSize':_0xf89011});_0x53b34f['push'](..._0x1fe56d);if(_0x1fe56d[_0x5051fc(0x19c)]<_0xf89011||_0x10e16f&&_0x53b34f[_0x5051fc(0x19c)]>=_0x10e16f[_0x5051fc(0x198)])return _0x53b34f;}}export async function resolveTenantCode(){const _0x51594c=a235_0xe6d5d6,_0x45ced9=await getSessionUserInfo(),_0x20e433=_0x45ced9?.[_0x51594c(0x179)]?.[_0x51594c(0x15a)]?.[_0x51594c(0x154)];if(!_0x20e433)throw CliErrors[_0x51594c(0x186)](_0x51594c(0x178));return _0x20e433;}function matchMember(_0x425571,_0x5ba3b3){const _0x7944b9=a235_0xe6d5d6,_0x466823=_0x5ba3b3['trim']()['toLowerCase']();return(_0x425571[_0x7944b9(0x177)]??'')[_0x7944b9(0x187)]()===_0x466823||(_0x425571[_0x7944b9(0x164)]??'')[_0x7944b9(0x187)]()===_0x466823;}export async function resolveUserRef(_0x120e6e,_0x26d73f=a235_0xe6d5d6(0x183)){const _0xdd1b4=a235_0xe6d5d6,_0x86b754=_0x120e6e[_0xdd1b4(0x19a)]();if(!_0x86b754)throw CliErrors[_0xdd1b4(0x18d)](_0xdd1b4(0x193),_0xdd1b4(0x155));const _0x5f73f5=await resolveTenantCode(),_0x3028fa=await getTenantMembers(_0x5f73f5);if(/^\d+$/['test'](_0x86b754)){const _0x12a287=Number(_0x86b754),_0x467e3d=_0x3028fa[_0xdd1b4(0x17a)](_0x782a08=>_0x782a08[_0xdd1b4(0x152)]===_0x12a287);return{'userId':_0x12a287,'username':_0x467e3d?.['username']??String(_0x12a287),'nickname':_0x467e3d?.[_0xdd1b4(0x177)],'matchedBy':'id'};}const _0x2378c6=_0x3028fa['filter'](_0x200092=>matchMember(_0x200092,_0x86b754));if(_0x2378c6[_0xdd1b4(0x19c)]===0x0)throw CliErrors[_0xdd1b4(0x18d)]('No\x20tenant\x20member\x20matches\x20\x22'+_0x86b754+'\x22.',_0xdd1b4(0x15d)+_0x26d73f);if(_0x2378c6[_0xdd1b4(0x19c)]>0x1){const _0x1cd3f4=_0x2378c6[_0xdd1b4(0x192)](_0x579c5c=>(_0x579c5c[_0xdd1b4(0x177)]??_0x579c5c[_0xdd1b4(0x164)]??'?')+'('+_0x579c5c[_0xdd1b4(0x152)]+')')[_0xdd1b4(0x16f)](',\x20');throw CliErrors[_0xdd1b4(0x18d)](_0xdd1b4(0x18a)+_0x86b754+_0xdd1b4(0x176)+_0x1cd3f4+'.',_0x26d73f);}const _0x46aee3=_0x2378c6[0x0];return{'userId':_0x46aee3[_0xdd1b4(0x152)],'username':_0x46aee3[_0xdd1b4(0x164)]??String(_0x46aee3[_0xdd1b4(0x152)]),'nickname':_0x46aee3[_0xdd1b4(0x177)],'matchedBy':'name'};}export const CREATE_USER_ROLE_PATH=a235_0xe6d5d6(0x16d);export const DELETE_USER_ROLE_PATH='/smartapi/permit/user-role/delete';export function computeRoleUserMutation(_0x3e9ea0){const _0x431674=a235_0xe6d5d6,{operation:_0x573f46,appCode:_0xb5dff6,role:_0xeb8e58,relations:_0x426e22,user:_0x12d1c4}=_0x3e9ea0,_0x30a9fb=[...new Set(_0x426e22[_0x431674(0x192)](_0x1b23d5=>_0x1b23d5[_0x431674(0x152)]))],_0x4f6ed1=[];if(_0x3e9ea0[_0x431674(0x182)]!==undefined&&_0x3e9ea0[_0x431674(0x182)]!==_0x30a9fb[_0x431674(0x19c)])throw CliErrors[_0x431674(0x18d)](_0x431674(0x195)+_0x3e9ea0[_0x431674(0x182)]+_0x431674(0x184)+_0x30a9fb[_0x431674(0x19c)]+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x4008be=_0x30a9fb['includes'](_0x12d1c4[_0x431674(0x152)]),_0x525b2c=_0x426e22[_0x431674(0x17d)](_0x81307c=>_0x81307c['userId']===_0x12d1c4[_0x431674(0x152)])[_0x431674(0x192)](_0x30481b=>_0x30481b['id']),_0x4f7fbc=_0x573f46==='user-add'?!_0x4008be:_0x4008be;let _0x52333b=_0x30a9fb;_0x573f46===_0x431674(0x169)?_0x4008be?_0x4f6ed1['push'](_0x431674(0x196)+_0x12d1c4[_0x431674(0x152)]+_0x431674(0x19b)+_0xeb8e58[_0x431674(0x166)]+_0x431674(0x172)):_0x52333b=[..._0x30a9fb,_0x12d1c4[_0x431674(0x152)]]:!_0x4008be?_0x4f6ed1[_0x431674(0x171)](_0x431674(0x196)+_0x12d1c4[_0x431674(0x152)]+_0x431674(0x19e)+_0xeb8e58[_0x431674(0x166)]+_0x431674(0x172)):(_0x52333b=_0x30a9fb[_0x431674(0x17d)](_0x52f655=>_0x52f655!==_0x12d1c4[_0x431674(0x152)]),_0x525b2c[_0x431674(0x19c)]>0x1&&_0x4f6ed1[_0x431674(0x171)](_0x431674(0x17b)+_0x525b2c[_0x431674(0x19c)]+_0x431674(0x167)+_0x12d1c4['userId']+'.'));const _0x4dc9d9={'scope':'dev','operation':_0x573f46,'selector':{'appCode':_0xb5dff6,'roleId':_0xeb8e58['id'],'roleName':_0xeb8e58[_0x431674(0x166)],'userId':_0x12d1c4[_0x431674(0x152)]},'before':{'userIds':_0x30a9fb},'after':{'userIds':_0x52333b},'dryRun':_0x3e9ea0['dryRun'],'backend':{'method':_0x431674(0x190),'path':_0x573f46===_0x431674(0x169)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x4f6ed1};return{'mutation':_0x4dc9d9,'changed':_0x4f7fbc,'matchingRelationIds':_0x525b2c};}function a235_0x33e5(){const _0x14e7ac=['appCode','Role\x20name','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','expectUserCount','Pass\x20--user\x20<id>.','\x20member(s)\x20but\x20role\x20has\x20','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','authRequired','toLowerCase','flag','Role\x20name\x20\x22','Multiple\x20tenant\x20members\x20match\x20\x22','2353744xmdvmi','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','validation','Role\x20id\x20or\x20exact\x20role\x20name','\x22\x20is\x20ambiguous\x20(ids:\x20','POST','name','map','Missing\x20user\x20reference.','CUSTOM','Anti-drift\x20check\x20failed:\x20expected\x20','User\x20','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','totalCount','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','trim','\x20is\x20already\x20a\x20member\x20of\x20role\x20','length','string','\x20is\x20not\x20a\x20member\x20of\x20role\x20','\x20not\x20found\x20in\x20app\x20','userId','\x20members\x20of\x20the\x20OWNER\x20role.','tenant_code','Pass\x20--user\x20<id|name>.','expect-user-count','6ybFSrp','OWNER','userCount','tenant','Cannot\x20','permitCount','Check\x20the\x20nickname/username.\x20','ADMIN','remark','DEV','3495870sfUHNs','1024510IVCLjN','844GOzFOD','username','\x20built-in\x20role\x20','roleName','\x20duplicate\x20memberships\x20for\x20user\x20','roleType','user-add','9487980VIrxAE','str','flagMissing','/smartapi/permit/user-role/create','31805EmAJzj','join','includes','push',';\x20no\x20change.','970842DxZGdX','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','822123sRRmVK','\x22:\x20','nickname','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','user','find','Removed\x20','number','filter','role'];a235_0x33e5=function(){return _0x14e7ac;};return a235_0x33e5();}export async function loadDevRoleRelations(_0x3e21e5,_0x58b62d){const _0x4cd4ba=a235_0xe6d5d6,_0x40bcb5=0x64,_0x2997c6=[];for(let _0x209b5b=0x1;;_0x209b5b+=0x1){const {items:_0x1fa0c6,paging:_0x92fe81}=await listDevUserRoleRelations(_0x3e21e5,{'roleId':_0x58b62d,'currentPage':_0x209b5b,'pageSize':_0x40bcb5});_0x2997c6[_0x4cd4ba(0x171)](..._0x1fa0c6);if(_0x1fa0c6['length']<_0x40bcb5||_0x92fe81&&_0x2997c6[_0x4cd4ba(0x19c)]>=_0x92fe81[_0x4cd4ba(0x198)])return _0x2997c6;}}export function readRoleRef(_0x5dca11){const _0x5e27f8=a235_0xe6d5d6,_0x514631=_0x5dca11[_0x5e27f8(0x16b)](_0x5e27f8(0x17e))[_0x5e27f8(0x19a)]();if(!_0x514631)throw CliErrors[_0x5e27f8(0x16c)](_0x5e27f8(0x17e),'Pass\x20--role\x20<id|name>.');return _0x514631;}export async function prepareUserMutation(_0x4bddf4,_0x1eee63,_0x42349f){const _0x915219=a235_0xe6d5d6,_0x37c312=readRoleRef(_0x4bddf4),_0x353ff7=_0x4bddf4[_0x915219(0x16b)](_0x915219(0x179))[_0x915219(0x19a)]();if(!_0x353ff7)throw CliErrors['flagMissing'](_0x915219(0x179),'Pass\x20--user\x20<id|name>.');const _0x3c1b66=_0x4bddf4[_0x915219(0x188)](_0x915219(0x156)),_0x5c8bc1=_0x3c1b66===undefined||_0x3c1b66===null?undefined:Number(_0x3c1b66),_0x107ac4=await resolveRoleRef(_0x4bddf4[_0x915219(0x17f)],_0x37c312);if(_0x107ac4[_0x915219(0x168)]===_0x915219(0x158))throw CliErrors[_0x915219(0x18d)](_0x915219(0x15b)+_0x1eee63+_0x915219(0x153),_0x915219(0x199));const _0x3bf04d=await resolveUserRef(_0x353ff7),_0x3c3786=await loadDevRoleRelations(_0x4bddf4[_0x915219(0x17f)],_0x107ac4['id']);return{...computeRoleUserMutation({'operation':_0x1eee63,'appCode':_0x4bddf4['appCode'],'role':_0x107ac4,'relations':_0x3c3786,'user':{'userId':_0x3bf04d['userId'],'username':_0x3bf04d['username'],'nickname':_0x3bf04d[_0x915219(0x177)]},'dryRun':_0x42349f,..._0x5c8bc1!==undefined?{'expectUserCount':_0x5c8bc1}:{}}),'role':_0x107ac4,'user':_0x3bf04d};}
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_0x3f1cb1=a236_0x4813;(function(_0x14fc72,_0x8bc160){const _0x401210=a236_0x4813,_0x129e6f=_0x14fc72();while(!![]){try{const _0x30d429=-parseInt(_0x401210(0x78))/0x1+parseInt(_0x401210(0x82))/0x2+parseInt(_0x401210(0x7d))/0x3+-parseInt(_0x401210(0x6f))/0x4+parseInt(_0x401210(0x69))/0x5+-parseInt(_0x401210(0x7f))/0x6*(parseInt(_0x401210(0x80))/0x7)+-parseInt(_0x401210(0x6d))/0x8*(-parseInt(_0x401210(0x6b))/0x9);if(_0x30d429===_0x8bc160)break;else _0x129e6f['push'](_0x129e6f['shift']());}catch(_0x2b1e53){_0x129e6f['push'](_0x129e6f['shift']());}}}(a236_0x2050,0xf32fa));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=a236_0x3f1cb1(0x7e);function readPatch(_0x216691){const _0x2dc8b2=a236_0x3f1cb1,_0x4d1a41=_0x216691[_0x2dc8b2(0x6e)](_0x2dc8b2(0x74)),_0x51f8a7=_0x216691[_0x2dc8b2(0x6e)](_0x2dc8b2(0x7b)),_0xcde1cc={};if(_0x4d1a41!==undefined&&_0x4d1a41!==null){const _0xe36111=String(_0x4d1a41)[_0x2dc8b2(0x77)]();if(!_0xe36111)throw CliErrors['validation'](_0x2dc8b2(0x73));if(_0xe36111[_0x2dc8b2(0x81)]>0x40)throw CliErrors[_0x2dc8b2(0x6c)](_0x2dc8b2(0x72));_0xcde1cc[_0x2dc8b2(0x75)]=_0xe36111;}_0x51f8a7!==undefined&&_0x51f8a7!==null&&(_0xcde1cc[_0x2dc8b2(0x7b)]=String(_0x51f8a7));if(_0xcde1cc[_0x2dc8b2(0x75)]===undefined&&_0xcde1cc[_0x2dc8b2(0x7b)]===undefined)throw CliErrors[_0x2dc8b2(0x6c)](_0x2dc8b2(0x79),_0x2dc8b2(0x7c));return _0xcde1cc;}function a236_0x2050(){const _0x1b7a68=['Nothing\x20to\x20update.','POST','remark','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','2714082QrscGI','/smartapi/permit/role/update','1794066TsnNLa','28AGHeRV','length','1398246BUthBA','New\x20role\x20name','role','Updated\x20role\x20','appCode','string','update','1729700VlsUwU','\x20(id=','9SUFPVR','validation','13754872nJtUkB','flag','32984nASlYe','num','dev','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','--name\x20cannot\x20be\x20empty.','name','roleName','write','trim','1468736eXPygX'];a236_0x2050=function(){return _0x1b7a68;};return a236_0x2050();}function a236_0x4813(_0x56cee1,_0x8a7568){_0x56cee1=_0x56cee1-0x64;const _0x205041=a236_0x2050();let _0x481395=_0x205041[_0x56cee1];return _0x481395;}export const roleUpdate={'service':a236_0x3f1cb1(0x64),'command':a236_0x3f1cb1(0x68),'description':'Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','risk':a236_0x3f1cb1(0x76),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a236_0x3f1cb1(0x74),'type':a236_0x3f1cb1(0x67),'required':![],'description':a236_0x3f1cb1(0x83)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1bf667){readPatch(_0x1bf667);},async 'dryRun'(_0x5c7bdd){const _0x1156ed=a236_0x3f1cb1,_0x583211=_0x5c7bdd[_0x1156ed(0x70)]('id'),_0x41989d=readPatch(_0x5c7bdd),_0x2c49b8=await getRoleById(_0x5c7bdd[_0x1156ed(0x66)],_0x583211);return assertCustomRole(_0x2c49b8,_0x1156ed(0x68)),asDryRunResult({'scope':_0x1156ed(0x71),'operation':'update','selector':{'appCode':_0x5c7bdd[_0x1156ed(0x66)],'roleId':_0x583211,'roleName':_0x2c49b8[_0x1156ed(0x75)]},'before':projectRole(_0x2c49b8),'after':projectRole({..._0x2c49b8,..._0x41989d[_0x1156ed(0x75)]!==undefined?{'roleName':_0x41989d[_0x1156ed(0x75)]}:{},..._0x41989d[_0x1156ed(0x7b)]!==undefined?{'remark':_0x41989d[_0x1156ed(0x7b)]}:{}}),'dryRun':!![],'backend':{'method':_0x1156ed(0x7a),'path':UPDATE_PATH},'warnings':[]},{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x5b51d9){const _0x54eb98=a236_0x3f1cb1,_0x4b1ca2=_0x5b51d9[_0x54eb98(0x70)]('id'),_0x1306fe=readPatch(_0x5b51d9),_0x34a7be=await getRoleById(_0x5b51d9[_0x54eb98(0x66)],_0x4b1ca2);assertCustomRole(_0x34a7be,_0x54eb98(0x68)),await updateAppRole({'id':_0x4b1ca2,'appCode':_0x5b51d9[_0x54eb98(0x66)],..._0x1306fe[_0x54eb98(0x75)]!==undefined?{'roleName':_0x1306fe[_0x54eb98(0x75)]}:{},..._0x1306fe[_0x54eb98(0x7b)]!==undefined?{'remark':_0x1306fe[_0x54eb98(0x7b)]}:{}});const _0x5d7fc0=await getRoleById(_0x5b51d9[_0x54eb98(0x66)],_0x4b1ca2);return{'ok':!![],'data':{'scope':_0x54eb98(0x71),'operation':_0x54eb98(0x68),'selector':{'appCode':_0x5b51d9[_0x54eb98(0x66)],'roleId':_0x4b1ca2,'roleName':_0x5d7fc0[_0x54eb98(0x75)]},'before':projectRole(_0x34a7be),'after':projectRole(_0x5d7fc0),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':_0x54eb98(0x65)+_0x5d7fc0[_0x54eb98(0x75)]+_0x54eb98(0x6a)+_0x4b1ca2+')'};}};
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
- const a237_0x3c736d=a237_0x1cd0;function a237_0x1cd0(_0x10ca82,_0x273525){_0x10ca82=_0x10ca82-0x14a;const _0x3a99db=a237_0x3a99();let _0x1cd05c=_0x3a99db[_0x10ca82];return _0x1cd05c;}function a237_0x3a99(){const _0x1b9952=['1661mmgaNc','Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','284MvKucU','315531wtIVDg','high-risk-write','selector','roleId','user-add','6521895MPFSNC','username','532945NTBKfX','4Hmpsmn','10XWiwBy','5239664rJDLiY','userId','appCode','roleName','105ydWoVR','\x20to\x20role\x20','roleType','role','POST','Added\x20user\x20','41268rUlHkr','9978nGPqIy','5754YkGZuV'];a237_0x3a99=function(){return _0x1b9952;};return a237_0x3a99();}(function(_0x14cd1f,_0x460e99){const _0x46676b=a237_0x1cd0,_0x896e8=_0x14cd1f();while(!![]){try{const _0x9bc80c=-parseInt(_0x46676b(0x157))/0x1*(-parseInt(_0x46676b(0x15f))/0x2)+parseInt(_0x46676b(0x153))/0x3*(parseInt(_0x46676b(0x156))/0x4)+parseInt(_0x46676b(0x15e))/0x5+parseInt(_0x46676b(0x152))/0x6*(-parseInt(_0x46676b(0x14b))/0x7)+-parseInt(_0x46676b(0x161))/0x8+parseInt(_0x46676b(0x15c))/0x9*(parseInt(_0x46676b(0x160))/0xa)+parseInt(_0x46676b(0x154))/0xb*(-parseInt(_0x46676b(0x151))/0xc);if(_0x9bc80c===_0x460e99)break;else _0x896e8['push'](_0x896e8['shift']());}catch(_0x51ea8f){_0x896e8['push'](_0x896e8['shift']());}}}(a237_0x3a99,0x617bc));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_0x3c736d(0x14e),'command':'user-add','description':a237_0x3c736d(0x155),'risk':a237_0x3c736d(0x158),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x3d65b9){const _0x3a1f8a=a237_0x3c736d,{mutation:_0x4b8d85}=await prepareUserMutation(_0x3d65b9,'user-add',!![]);return asDryRunResult(_0x4b8d85,{'method':_0x3a1f8a(0x14f),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x38da00){const _0xaf0db9=a237_0x3c736d,{mutation:_0x2fb4de,changed:_0x220b93,role:_0x4177b6,user:_0xc20b7e}=await prepareUserMutation(_0x38da00,_0xaf0db9(0x15b),![]);return _0x220b93&&await createDevUserRole({'appCode':_0x38da00[_0xaf0db9(0x163)],'userId':_0xc20b7e[_0xaf0db9(0x162)],'username':_0xc20b7e[_0xaf0db9(0x15d)],'roleType':_0x4177b6[_0xaf0db9(0x14d)],'roleId':_0x2fb4de[_0xaf0db9(0x159)][_0xaf0db9(0x15a)]}),{'ok':!![],'data':_0x2fb4de,'message':_0x220b93?_0xaf0db9(0x150)+_0x2fb4de[_0xaf0db9(0x159)]['userId']+_0xaf0db9(0x14c)+_0x2fb4de[_0xaf0db9(0x159)]['roleName']:'No\x20change:\x20user\x20'+_0x2fb4de[_0xaf0db9(0x159)][_0xaf0db9(0x162)]+'\x20already\x20in\x20role\x20'+_0x2fb4de[_0xaf0db9(0x159)][_0xaf0db9(0x14a)]};}};
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
- function a238_0x3a55(_0x375f26,_0x413d78){_0x375f26=_0x375f26-0x11b;const _0x4b3125=a238_0x4b31();let _0x3a551c=_0x4b3125[_0x375f26];return _0x3a551c;}const a238_0x2709f5=a238_0x3a55;(function(_0x29b0f6,_0x399955){const _0x5d6233=a238_0x3a55,_0x15c575=_0x29b0f6();while(!![]){try{const _0x2e8127=-parseInt(_0x5d6233(0x123))/0x1*(parseInt(_0x5d6233(0x125))/0x2)+parseInt(_0x5d6233(0x11d))/0x3+-parseInt(_0x5d6233(0x130))/0x4*(-parseInt(_0x5d6233(0x11f))/0x5)+parseInt(_0x5d6233(0x121))/0x6+-parseInt(_0x5d6233(0x120))/0x7+parseInt(_0x5d6233(0x122))/0x8*(parseInt(_0x5d6233(0x11e))/0x9)+-parseInt(_0x5d6233(0x12e))/0xa*(-parseInt(_0x5d6233(0x128))/0xb);if(_0x2e8127===_0x399955)break;else _0x15c575['push'](_0x15c575['shift']());}catch(_0x351737){_0x15c575['push'](_0x15c575['shift']());}}}(a238_0x4b31,0xdd1e3));import{deleteDevUserRole}from'../../core/api-client.js';function a238_0x4b31(){const _0x26edce=['160lQMRIs','role','8ZhrrJW','high-risk-write','No\x20change:\x20user\x20','155613ucOrBm','801eYeCyA','1212415DeiFve','7417004dHMLPT','4970646GsqzNK','97080JVDWFh','668883MKFafA','\x20from\x20role\x20','4VcFKUO','userId','roleName','589699EqqxHW','user-remove','selector','\x20not\x20in\x20role\x20','Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','Removed\x20user\x20'];a238_0x4b31=function(){return _0x26edce;};return a238_0x4b31();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,DELETE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':a238_0x2709f5(0x12f),'command':a238_0x2709f5(0x129),'description':a238_0x2709f5(0x12c),'risk':a238_0x2709f5(0x11b),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x53cf0f){const _0x595d0d=a238_0x2709f5,{mutation:_0x2a7d9d}=await prepareUserMutation(_0x53cf0f,_0x595d0d(0x129),!![]);return asDryRunResult(_0x2a7d9d,{'method':'POST','url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x311482){const _0x2d6dc6=a238_0x2709f5,{matchingRelationIds:_0x2c97ab,mutation:_0x1954a8,changed:_0x45986e}=await prepareUserMutation(_0x311482,_0x2d6dc6(0x129),![]);if(_0x45986e)for(const _0x18800c of _0x2c97ab){await deleteDevUserRole(_0x18800c);}return{'ok':!![],'data':_0x1954a8,'message':_0x45986e?_0x2d6dc6(0x12d)+_0x1954a8['selector']['userId']+_0x2d6dc6(0x124)+_0x1954a8[_0x2d6dc6(0x12a)]['roleName']:_0x2d6dc6(0x11c)+_0x1954a8[_0x2d6dc6(0x12a)][_0x2d6dc6(0x126)]+_0x2d6dc6(0x12b)+_0x1954a8[_0x2d6dc6(0x12a)][_0x2d6dc6(0x127)]};}};
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
- const a239_0x1b7309=a239_0x2468;(function(_0x408a8d,_0x133a46){const _0x5a0a5d=a239_0x2468,_0x5103fb=_0x408a8d();while(!![]){try{const _0x4f97d1=parseInt(_0x5a0a5d(0x142))/0x1+parseInt(_0x5a0a5d(0x12f))/0x2+-parseInt(_0x5a0a5d(0x135))/0x3+-parseInt(_0x5a0a5d(0x13f))/0x4*(-parseInt(_0x5a0a5d(0x143))/0x5)+parseInt(_0x5a0a5d(0x12d))/0x6+-parseInt(_0x5a0a5d(0x12e))/0x7*(-parseInt(_0x5a0a5d(0x132))/0x8)+-parseInt(_0x5a0a5d(0x141))/0x9;if(_0x4f97d1===_0x133a46)break;else _0x5103fb['push'](_0x5103fb['shift']());}catch(_0x1a61a0){_0x5103fb['push'](_0x5103fb['shift']());}}}(a239_0x4eac,0x6ccea));import{CliErrors}from'../../errors.js';function a239_0x4eac(){const _0x419b8c=['nickname','24ccHWEn','Resolved\x20\x22','Pass\x20--name\x20<nickname|username>.','83412jkVYRd','trim','\x22\x20→\x20userId\x20','role','user-resolve','str','username','userId','matchedBy','name','992fPUCkq','read','15743178uavxtn','544523BBupCh','2620tFjFeZ','Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.','4006950timmmJ','676711FsqKXb','1180802MsWNpk','flagMissing'];a239_0x4eac=function(){return _0x419b8c;};return a239_0x4eac();}function a239_0x2468(_0x2d5287,_0x2b9667){_0x2d5287=_0x2d5287-0x12d;const _0x4eacc2=a239_0x4eac();let _0x24689b=_0x4eacc2[_0x2d5287];return _0x24689b;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a239_0x1b7309(0x138),'command':a239_0x1b7309(0x139),'description':'Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','risk':a239_0x1b7309(0x140),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x13df5c){const _0x225e4a=a239_0x1b7309;if(!_0x13df5c['str']('name')[_0x225e4a(0x136)]())throw CliErrors[_0x225e4a(0x130)](_0x225e4a(0x13e),_0x225e4a(0x134));},async 'execute'(_0x4934cc){const _0x57397a=a239_0x1b7309,_0x5d8110=_0x4934cc[_0x57397a(0x13a)]('name')[_0x57397a(0x136)](),_0x3bd3ad=await resolveUserRef(_0x5d8110,_0x57397a(0x144));return{'ok':!![],'data':{'user':{'userId':_0x3bd3ad[_0x57397a(0x13c)],'username':_0x3bd3ad[_0x57397a(0x13b)],'nickname':_0x3bd3ad[_0x57397a(0x131)],'matchedBy':_0x3bd3ad[_0x57397a(0x13d)]}},'message':_0x57397a(0x133)+_0x5d8110+_0x57397a(0x137)+_0x3bd3ad[_0x57397a(0x13c)]};}};
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
- function a240_0x4bb8(_0x3b98c9,_0x64b041){_0x3b98c9=_0x3b98c9-0xb0;const _0x47fb8e=a240_0x47fb();let _0x4bb826=_0x47fb8e[_0x3b98c9];return _0x4bb826;}function a240_0x47fb(){const _0x4f0104=['12IJEJBh','get','cookie','629487QDzlXA','2233000lrNrah','3689HQGocE','9494487pmqckS','\x20for\x20','Get\x20one\x20agent\x20context\x20rule\x20for\x20the\x20resolved\x20app','20813772jgbcek','2424dDbRMk','1688390vttaXQ','10800RVHiRq','39CPKYkm','rule','\x20is\x20not\x20configured\x20for\x20app\x20','6Xetpmt','10MMAUNu','read','Loaded\x20','appCode','Create\x20it\x20with\x20`rabetbase\x20rule\x20set\x20--type\x20','\x20--file\x20<path>\x20--dry-run`.'];a240_0x47fb=function(){return _0x4f0104;};return a240_0x47fb();}const a240_0x36a411=a240_0x4bb8;(function(_0xd818fe,_0x74b7b3){const _0x302842=a240_0x4bb8,_0x58e906=_0xd818fe();while(!![]){try{const _0x22ca34=-parseInt(_0x302842(0xb0))/0x1*(-parseInt(_0x302842(0xc4))/0x2)+-parseInt(_0x302842(0xbd))/0x3*(-parseInt(_0x302842(0xba))/0x4)+parseInt(_0x302842(0xc5))/0x5*(-parseInt(_0x302842(0xb3))/0x6)+-parseInt(_0x302842(0xbf))/0x7*(-parseInt(_0x302842(0xc6))/0x8)+-parseInt(_0x302842(0xc0))/0x9*(-parseInt(_0x302842(0xb4))/0xa)+parseInt(_0x302842(0xbe))/0xb+-parseInt(_0x302842(0xc3))/0xc;if(_0x22ca34===_0x74b7b3)break;else _0x58e906['push'](_0x58e906['shift']());}catch(_0x228607){_0x58e906['push'](_0x58e906['shift']());}}}(a240_0x47fb,0x8c225));import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPE_FLAG,appRuleError,appRuleFileName,projectAppRule,readAppRuleType}from'../../commands/rule/shared.js';export const ruleGet={'service':a240_0x36a411(0xb1),'command':a240_0x36a411(0xbb),'description':a240_0x36a411(0xc2),'risk':a240_0x36a411(0xb5),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG],async 'validate'(_0x1c3690){readAppRuleType(_0x1c3690);},async 'execute'(_0x4354a3){const _0x52338a=a240_0x36a411,_0x4aab4b=readAppRuleType(_0x4354a3),_0x44e721=await getAppRule(_0x4354a3[_0x52338a(0xbc)],{'appCode':_0x4354a3[_0x52338a(0xb7)],'type':_0x4aab4b});if(!_0x44e721)throw appRuleError('app_rule_not_found',appRuleFileName(_0x4aab4b)+_0x52338a(0xb2)+_0x4354a3[_0x52338a(0xb7)]+'.',_0x52338a(0xb8)+_0x4aab4b+_0x52338a(0xb9));return{'ok':!![],'data':{'rule':{...projectAppRule(_0x4aab4b,_0x44e721),'content':_0x44e721['content']}},'message':_0x52338a(0xb6)+appRuleFileName(_0x4aab4b)+_0x52338a(0xc1)+_0x4354a3['appCode']};}};
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
- const a241_0x181023=a241_0x4c10;(function(_0x150165,_0x48b8aa){const _0x5eb217=a241_0x4c10,_0x4dc12e=_0x150165();while(!![]){try{const _0x3935e6=-parseInt(_0x5eb217(0x1ed))/0x1+parseInt(_0x5eb217(0x1eb))/0x2+parseInt(_0x5eb217(0x1ec))/0x3*(parseInt(_0x5eb217(0x1f1))/0x4)+parseInt(_0x5eb217(0x1ef))/0x5+-parseInt(_0x5eb217(0x1f4))/0x6*(-parseInt(_0x5eb217(0x1f6))/0x7)+-parseInt(_0x5eb217(0x1f0))/0x8+parseInt(_0x5eb217(0x1f7))/0x9*(parseInt(_0x5eb217(0x1f5))/0xa);if(_0x3935e6===_0x48b8aa)break;else _0x4dc12e['push'](_0x4dc12e['shift']());}catch(_0x4b811f){_0x4dc12e['push'](_0x4dc12e['shift']());}}}(a241_0x40c7,0x7a98d));function a241_0x4c10(_0x2b1793,_0x214da4){_0x2b1793=_0x2b1793-0x1ea;const _0x40c7cb=a241_0x40c7();let _0x4c10ca=_0x40c7cb[_0x2b1793];return _0x4c10ca;}import{withKbManagementSession}from'../../core/kb-management-client.js';import{ruleGet}from'../../commands/rule/get.js';import{ruleList}from'../../commands/rule/list.js';function a241_0x40c7(){const _0x5b02e7=['2373760AIGcdZ','41988gTsIzW','map','signal','6YZXilG','7490nCcoqm','5558581FyWrQR','657LfXntm','dryRun','347554uwxSKv','39nWdtii','565453HohQms','execute','1026660BiBjLr'];a241_0x40c7=function(){return _0x5b02e7;};return a241_0x40c7();}import{ruleSet}from'../../commands/rule/set.js';export const ruleDefinitions=[ruleList,ruleGet,ruleSet][a241_0x181023(0x1f2)](_0x405788=>({..._0x405788,'execute':_0x574b66=>withKbManagementSession(_0x574b66[a241_0x181023(0x1f3)],()=>_0x405788[a241_0x181023(0x1ee)](_0x574b66)),..._0x405788[a241_0x181023(0x1ea)]?{'dryRun':_0x5d8308=>withKbManagementSession(_0x5d8308[a241_0x181023(0x1f3)],()=>_0x405788[a241_0x181023(0x1ea)](_0x5d8308))}:{}}));
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_0x38d991=a242_0x4eb3;function a242_0x2848(){const _0x2c9f11=['map','appCode','18855MlqJvo','List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','7792150WcrHYp','length','Loaded\x20app\x20rule\x20configuration\x20for\x20','2097214psTofh','15Raoijv','cookie','22AlZTqU','read','rule','2972436vwpYXp','57aZwZbm','1128dSqfup','382660SuCqRN','1003848fDUtUC','all','33626FPaKpP'];a242_0x2848=function(){return _0x2c9f11;};return a242_0x2848();}(function(_0x1bbabe,_0x4a5e70){const _0x136577=a242_0x4eb3,_0x20d3b5=_0x1bbabe();while(!![]){try{const _0x4261dc=-parseInt(_0x136577(0xf7))/0x1*(-parseInt(_0x136577(0xe8))/0x2)+-parseInt(_0x136577(0xfa))/0x3+parseInt(_0x136577(0xf9))/0x4+parseInt(_0x136577(0xf1))/0x5*(-parseInt(_0x136577(0xf6))/0x6)+parseInt(_0x136577(0xf0))/0x7+parseInt(_0x136577(0xf8))/0x8*(-parseInt(_0x136577(0xeb))/0x9)+-parseInt(_0x136577(0xed))/0xa*(-parseInt(_0x136577(0xf3))/0xb);if(_0x4261dc===_0x4a5e70)break;else _0x20d3b5['push'](_0x20d3b5['shift']());}catch(_0x44702b){_0x20d3b5['push'](_0x20d3b5['shift']());}}}(a242_0x2848,0xc24a1));function a242_0x4eb3(_0x10eaa6,_0xae418e){_0x10eaa6=_0x10eaa6-0xe8;const _0x284851=a242_0x2848();let _0x4eb3e2=_0x284851[_0x10eaa6];return _0x4eb3e2;}import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';export const ruleList={'service':a242_0x38d991(0xf5),'command':'list','description':a242_0x38d991(0xec),'risk':a242_0x38d991(0xf4),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x5663ed){const _0x4d7805=a242_0x38d991,_0x31434d=await Promise[_0x4d7805(0xfb)](APP_RULE_TYPES['map'](_0x1c23c2=>getAppRule(_0x5663ed[_0x4d7805(0xf2)],{'appCode':_0x5663ed[_0x4d7805(0xea)],'type':_0x1c23c2}))),_0x3517e5=APP_RULE_TYPES[_0x4d7805(0xe9)]((_0x292f3d,_0x5bfd7f)=>projectAppRule(_0x292f3d,_0x31434d[_0x5bfd7f]??null));return{'ok':!![],'data':{'total':_0x3517e5[_0x4d7805(0xee)],'rules':_0x3517e5},'message':_0x4d7805(0xef)+_0x5663ed[_0x4d7805(0xea)]};}};
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_0x109c30=a243_0x5b53;(function(_0x1cac8e,_0x19715b){const _0x1e302f=a243_0x5b53,_0x541e7c=_0x1cac8e();while(!![]){try{const _0x577e37=parseInt(_0x1e302f(0x104))/0x1*(-parseInt(_0x1e302f(0xde))/0x2)+-parseInt(_0x1e302f(0xc5))/0x3*(parseInt(_0x1e302f(0xfa))/0x4)+parseInt(_0x1e302f(0xc8))/0x5+-parseInt(_0x1e302f(0xfc))/0x6+-parseInt(_0x1e302f(0xf7))/0x7+parseInt(_0x1e302f(0xf4))/0x8*(-parseInt(_0x1e302f(0xdf))/0x9)+parseInt(_0x1e302f(0xf6))/0xa;if(_0x577e37===_0x19715b)break;else _0x541e7c['push'](_0x541e7c['shift']());}catch(_0x4eb10b){_0x541e7c['push'](_0x541e7c['shift']());}}}(a243_0xe197,0xcf9c7));import{knowledgeDocumentsPath}from'../../core/api-client.js';import{getAppRule,isPlatformTransportFailure,saveAppRule}from'../../core/api-client.js';function a243_0x5b53(_0x50a6b2,_0xc7639c){_0x50a6b2=_0x50a6b2-0xc5;const _0xe1976e=a243_0xe197();let _0x5b53df=_0xe1976e[_0x50a6b2];return _0x5b53df;}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(_0x1c5695){const _0x5e6386=a243_0x5b53,_0x245914=readAppRuleType(_0x1c5695),_0x229f34=_0x1c5695[_0x5e6386(0xe0)]('file')[_0x5e6386(0xf1)]();if(!_0x229f34)throw appRuleError('app_rule_file_required',_0x5e6386(0xd5),_0x5e6386(0xda));const _0x301c60=_0x1c5695[_0x5e6386(0xe7)]('expected-version');let _0x32987e;if(_0x301c60!==undefined){_0x32987e=Number(_0x301c60);if(!Number[_0x5e6386(0xec)](_0x32987e)||_0x32987e<0x0)throw appRuleError(_0x5e6386(0xe5),'--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.');}return{'type':_0x245914,'file':_0x229f34,'expectedVersion':_0x32987e};}async function prepareSet(_0x3d8fba){const _0x523bed=a243_0x5b53,_0x1a7f6b=readSetInput(_0x3d8fba),_0xc2c956=await readAppRuleFile(_0x1a7f6b['file']);if(_0x1a7f6b[_0x523bed(0xfe)]==='rules'&&_0xc2c956['content']['length']>0x7d0)throw appRuleError(_0x523bed(0x107),_0x523bed(0xd8));const _0x471597=await getAppRule(_0x3d8fba[_0x523bed(0xd2)],{'appCode':_0x3d8fba[_0x523bed(0x103)],'type':_0x1a7f6b[_0x523bed(0xfe)]});if(_0x1a7f6b[_0x523bed(0xf2)]!==undefined&&(_0x471597?.[_0x523bed(0xcc)]??0x0)!==_0x1a7f6b[_0x523bed(0xf2)])throw appRuleError(_0x523bed(0xcd),appRuleFileName(_0x1a7f6b[_0x523bed(0xfe)])+_0x523bed(0xc7),_0x523bed(0xd4)+_0x1a7f6b[_0x523bed(0xf2)]+_0x523bed(0xd7)+(_0x471597?.[_0x523bed(0xcc)]??_0x523bed(0xf9))+_0x523bed(0xeb));return{'input':_0x1a7f6b,'replacement':_0xc2c956,'beforeRecord':_0x471597,'before':projectAppRule(_0x1a7f6b[_0x523bed(0xfe)],_0x471597),'planned':{'type':_0x1a7f6b[_0x523bed(0xfe)],'fileName':appRuleFileName(_0x1a7f6b[_0x523bed(0xfe)]),'contextScope':appRuleContextScope(_0x1a7f6b['type']),'enabled':!![],'appCode':_0x3d8fba[_0x523bed(0x103)],'scope':'rules','contentByteSize':_0xc2c956[_0x523bed(0x106)],'contentHash':_0xc2c956['contentHash']}};}function warningsFor(_0x3d717f){return[];}export const ruleSet={'service':'rule','command':a243_0x109c30(0xdc),'description':a243_0x109c30(0x102),'risk':a243_0x109c30(0xc6),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':a243_0x109c30(0x100),'type':a243_0x109c30(0xd3),'required':!![],'description':'UTF-8\x20Markdown\x20file\x20(RULES:\x202000\x20UTF-16\x20units;\x20DATABASE:\x205242880\x20units)'},{'name':a243_0x109c30(0xe1),'type':a243_0x109c30(0xce),'required':![],'description':a243_0x109c30(0xee)}],async 'validate'(_0x4b3323){readSetInput(_0x4b3323);},async 'dryRun'(_0x19390b){const _0x4a7531=a243_0x109c30,_0x369409=await prepareSet(_0x19390b);return asDryRunResult({'operation':_0x4a7531(0xdc),'selector':{'appCode':_0x19390b[_0x4a7531(0x103)],'scope':_0x4a7531(0xea),'type':_0x369409[_0x4a7531(0xd0)][_0x4a7531(0xfe)]},'before':_0x369409[_0x4a7531(0xe9)],'after':_0x369409['planned'],'dryRun':!![],'backend':{'method':_0x4a7531(0xef),'path':knowledgeDocumentsPath('rules',_0x369409[_0x4a7531(0xd1)]?_0x4a7531(0xcb):'create'),'body':{'appCode':_0x19390b['appCode'],..._0x369409[_0x4a7531(0xd1)]?{'id':_0x369409[_0x4a7531(0xd1)]['id']}:{},'title':_0x369409[_0x4a7531(0xd0)][_0x4a7531(0xfe)]==='rules'?_0x4a7531(0xf8):_0x4a7531(0xed),'contentHash':_0x369409['replacement'][_0x4a7531(0xff)],'contentByteSize':_0x369409[_0x4a7531(0xc9)][_0x4a7531(0x106)],..._0x369409['beforeRecord']?{'expectedVersion':_0x369409['beforeRecord'][_0x4a7531(0xcc)]}:{}}},'warnings':warningsFor(_0x369409[_0x4a7531(0xd0)][_0x4a7531(0xf2)]),'verification':{'expectedVersion':_0x369409[_0x4a7531(0xd1)]?.[_0x4a7531(0xcc)]??0x0,'atomicCompareAndSet':!![],'lookupCommand':'rabetbase\x20rule\x20get\x20--type\x20'+_0x369409[_0x4a7531(0xd0)][_0x4a7531(0xfe)]+_0x4a7531(0xdd)}},{'method':_0x4a7531(0xef),'url':knowledgeDocumentsPath(_0x4a7531(0xea),_0x369409['beforeRecord']?_0x4a7531(0xcb):_0x4a7531(0xd6))});},async 'execute'(_0x25f75b){const _0x1896ca=a243_0x109c30,_0x456b32=await prepareSet(_0x25f75b),_0x116c53=_0x456b32[_0x1896ca(0xd1)]===null?0x1:_0x456b32[_0x1896ca(0xd1)][_0x1896ca(0xcc)]+(_0x456b32[_0x1896ca(0xd1)][_0x1896ca(0x101)]===_0x456b32[_0x1896ca(0xc9)]['content']?0x0:0x1);let _0x2d92d9,_0x505bab=![];try{_0x2d92d9=await saveAppRule(_0x25f75b['cookie'],{'appCode':_0x25f75b[_0x1896ca(0x103)],'type':_0x456b32[_0x1896ca(0xd0)][_0x1896ca(0xfe)],'content':_0x456b32['replacement'][_0x1896ca(0x101)],'expectedVersion':_0x456b32[_0x1896ca(0xd1)]?.['version']??0x0,..._0x456b32[_0x1896ca(0xd1)]?{'id':_0x456b32[_0x1896ca(0xd1)]['id']}:{}});if(_0x2d92d9[_0x1896ca(0xcc)]!==_0x116c53||_0x2d92d9['content']!==_0x456b32['replacement']['content']||_0x456b32[_0x1896ca(0xd1)]!==null&&_0x2d92d9['id']!==_0x456b32['beforeRecord']['id'])throw appRuleError(_0x1896ca(0xfb),_0x1896ca(0xf5),_0x1896ca(0xfd));}catch(_0x2f7e64){if(!isPlatformTransportFailure(_0x2f7e64))throw _0x2f7e64;_0x505bab=!![];}let _0x2db9bf;try{_0x2db9bf=await getAppRule(_0x25f75b[_0x1896ca(0xd2)],{'appCode':_0x25f75b[_0x1896ca(0x103)],'type':_0x456b32[_0x1896ca(0xd0)][_0x1896ca(0xfe)]});}catch(_0x57aff6){const _0x13fe58=appRuleError(_0x505bab?_0x1896ca(0x105):_0x1896ca(0xd9),_0x1896ca(0xf3)+appRuleFileName(_0x456b32[_0x1896ca(0xd0)][_0x1896ca(0xfe)])+'\x20could\x20not\x20be\x20verified.',_0x1896ca(0xf0));Object['defineProperty'](_0x13fe58,_0x1896ca(0xca),{'value':_0x57aff6,'enumerable':![]});throw _0x13fe58;}const _0x5bb1ee=_0x2db9bf&&inspectAppRuleContent(_0x2db9bf['content'])[_0x1896ca(0xff)]===_0x456b32[_0x1896ca(0xc9)][_0x1896ca(0xff)],_0xd65f96=_0x2db9bf&&_0x2db9bf[_0x1896ca(0xcc)]===_0x116c53&&(!_0x2d92d9||_0x2db9bf['id']===_0x2d92d9['id']&&_0x2db9bf[_0x1896ca(0xcc)]===_0x2d92d9[_0x1896ca(0xcc)]);if(!_0x2db9bf||!_0x5bb1ee||!_0xd65f96||_0x456b32[_0x1896ca(0xd1)]!==null&&_0x2db9bf['id']!==_0x456b32[_0x1896ca(0xd1)]['id'])throw appRuleError(_0x505bab?_0x1896ca(0x105):_0x1896ca(0xfb),appRuleFileName(_0x456b32['input'][_0x1896ca(0xfe)])+_0x1896ca(0xe3),_0x1896ca(0xe6)+_0x456b32[_0x1896ca(0xd0)][_0x1896ca(0xfe)]+_0x1896ca(0xe8));const _0x38cf50=warningsFor(_0x456b32[_0x1896ca(0xd0)]['expectedVersion']);_0x505bab&&_0x38cf50['push'](_0x1896ca(0xe2));const _0x52ae3b=projectAppRule(_0x456b32[_0x1896ca(0xd0)][_0x1896ca(0xfe)],_0x2db9bf);return{'ok':!![],'data':{'operation':_0x1896ca(0xdc),'selector':{'appCode':_0x25f75b[_0x1896ca(0x103)],'scope':_0x1896ca(0xea),'type':_0x456b32[_0x1896ca(0xd0)]['type']},'before':_0x456b32[_0x1896ca(0xe9)],'after':_0x52ae3b,'dryRun':![],'backend':{'method':'POST','path':knowledgeDocumentsPath(_0x1896ca(0xea),_0x456b32[_0x1896ca(0xd1)]?_0x1896ca(0xcb):'create')},'warnings':_0x38cf50,'verification':{'status':_0x1896ca(0xdb),'recoveredAfterUnknownResponse':_0x505bab,'expectedVersion':_0x456b32['beforeRecord']?.['version']??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x1896ca(0xe4)+_0x456b32[_0x1896ca(0xd0)]['type']+_0x1896ca(0xdd)}},'message':'Set\x20'+appRuleFileName(_0x456b32[_0x1896ca(0xd0)][_0x1896ca(0xfe)])+_0x1896ca(0xcf)+_0x25f75b[_0x1896ca(0x103)]};}};function a243_0xe197(){const _0x3ccafb=['flag','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','before','rules','.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.','isSafeInteger','DATABASE','Require\x20the\x20current\x20version\x20before\x20atomic\x20compare-and-set','POST','Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.','trim','expectedVersion','The\x20set\x20request\x20was\x20sent,\x20but\x20','1171912rDLGZK','The\x20received\x20rule\x20state\x20contradicts\x20the\x20requested\x20changes.','21202420azZcqK','870254jZlKqj','RULES','unconfigured','7396mXOGZe','app_rule_verification_failed','4295262UzmJKz','Use\x20read-only\x20rule\x20reconciliation;\x20do\x20not\x20resubmit\x20automatically.','type','contentHash','file','content','Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','appCode','9gKHMGr','app_rule_set_outcome_unknown','byteSize','app_rule_content_too_large','1083vCzZxU','write','\x20version\x20changed\x20before\x20write.','4290485PfNqMh','replacement','cause','update','version','app_rule_version_mismatch','number','\x20for\x20','input','beforeRecord','cookie','string','Expected\x20','--file\x20is\x20required.','create',';\x20current\x20version\x20is\x20','RULES\x20content\x20exceeds\x202000\x20UTF-16\x20units.','app_rule_verification_unavailable','Pass\x20a\x20UTF-8\x20Markdown\x20file.','verified','set','\x20--format\x20compress','105286WctYHd','9MTWyWV','str','expected-version','Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.','\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','rabetbase\x20rule\x20get\x20--type\x20','app_rule_expected_version_invalid','Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20'];a243_0xe197=function(){return _0x3ccafb;};return a243_0xe197();}
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_0x458a9c=a244_0x3260;(function(_0x56379f,_0x5cbaf8){const _0xeb3561=a244_0x3260,_0x4b9b8a=_0x56379f();while(!![]){try{const _0x263dae=-parseInt(_0xeb3561(0x167))/0x1+-parseInt(_0xeb3561(0x189))/0x2+parseInt(_0xeb3561(0x172))/0x3*(parseInt(_0xeb3561(0x16b))/0x4)+parseInt(_0xeb3561(0x170))/0x5+-parseInt(_0xeb3561(0x171))/0x6+parseInt(_0xeb3561(0x17f))/0x7*(-parseInt(_0xeb3561(0x187))/0x8)+-parseInt(_0xeb3561(0x176))/0x9*(-parseInt(_0xeb3561(0x191))/0xa);if(_0x263dae===_0x5cbaf8)break;else _0x4b9b8a['push'](_0x4b9b8a['shift']());}catch(_0x2a503b){_0x4b9b8a['push'](_0x4b9b8a['shift']());}}}(a244_0x26ab,0x8ab64));import{createHash}from'node:crypto';import{readFile,stat}from'node:fs/promises';import{resolve}from'node:path';import{TextDecoder}from'node:util';function a244_0x3260(_0x1f3db7,_0x49c50d){_0x1f3db7=_0x1f3db7-0x163;const _0x26abc3=a244_0x26ab();let _0x32601f=_0x26abc3[_0x1f3db7];return _0x32601f;}import{CliError}from'../../errors.js';export const APP_RULE_TYPES=[a244_0x458a9c(0x168),'database'];export const MAX_APP_RULE_UNITS=0x5*0x400*0x400;function a244_0x26ab(){const _0x742901=['from','RULES.md','size','19620963upNlKD','updateTime','createTime','app_rule_file_invalid','hex','isFile','utf8','DATABASE.md','database-analysis','7rGkFnc','toLowerCase','Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','sha256','app_rule_content_invalid','byteSize','message','appCode','2066992tcWdaf','app_rule_type_invalid','1249580EOzYaR','digest','version','trim','app_rule_content_too_large','--type\x20must\x20be\x20either\x20rules\x20or\x20database.','scope','--file\x20is\x20required.','10xkwyxp','string','App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','app_rule_file_required','App\x20rule\x20content\x20exceeds\x20the\x20bounded\x20UTF-8\x20file\x20limit.','content','str','contentHash','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','length','indexStatus','App\x20rule\x20content\x20exceeds\x205242880\x20UTF-16\x20units.','418498PAjAWc','rules','app_rule_file_unreadable','update','1060ocBTXw','Pass\x20a\x20UTF-8\x20Markdown\x20file.','Cannot\x20access\x20app\x20rule\x20file:\x20','App\x20rule\x20file\x20is\x20blank:\x20','type','3429050EDzDMa','5978136OwEjgt','3rLQmyH'];a244_0x26ab=function(){return _0x742901;};return a244_0x26ab();}export const MAX_APP_RULE_BYTES=MAX_APP_RULE_UNITS*0x4;const APP_RULE_FILES={'rules':a244_0x458a9c(0x174),'database':a244_0x458a9c(0x17d)},APP_RULE_CONTEXT_SCOPES={'rules':'page-api-development','database':a244_0x458a9c(0x17e)};export function appRuleError(_0x15aa79,_0x2eb96c,_0x43d578){return new CliError(_0x15aa79,0x1,_0x2eb96c,_0x43d578);}export function readAppRuleType(_0x19edd3){const _0x46d605=a244_0x458a9c,_0x425973=_0x19edd3[_0x46d605(0x197)](_0x46d605(0x16f))[_0x46d605(0x18c)]()[_0x46d605(0x180)]();if(_0x425973!==_0x46d605(0x168)&&_0x425973!=='database')throw appRuleError(_0x46d605(0x188),_0x46d605(0x18e));return _0x425973;}export function appRuleFileName(_0x1f4a1b){return APP_RULE_FILES[_0x1f4a1b];}export function appRuleContextScope(_0x85b3c){return APP_RULE_CONTEXT_SCOPES[_0x85b3c];}export function inspectAppRuleContent(_0x507bcc){const _0x49b6e3=a244_0x458a9c,_0x23e2c4=Buffer[_0x49b6e3(0x173)](_0x507bcc,_0x49b6e3(0x17c));return{'content':_0x507bcc,'byteSize':_0x23e2c4['byteLength'],'contentHash':'sha256:'+createHash(_0x49b6e3(0x182))[_0x49b6e3(0x16a)](_0x23e2c4)[_0x49b6e3(0x18a)](_0x49b6e3(0x17a))};}export async function readAppRuleFile(_0x9c83b7){const _0x49b93f=a244_0x458a9c,_0x109b45=_0x9c83b7[_0x49b93f(0x18c)]();if(!_0x109b45)throw appRuleError(_0x49b93f(0x194),_0x49b93f(0x190),_0x49b93f(0x16c));const _0x4a6196=resolve(_0x109b45);let _0x81486d;try{_0x81486d=await stat(_0x4a6196);}catch(_0xe0950f){throw appRuleError(_0x49b93f(0x169),_0x49b93f(0x16d)+_0x109b45,_0xe0950f instanceof Error?_0xe0950f[_0x49b93f(0x185)]:String(_0xe0950f));}if(!_0x81486d[_0x49b93f(0x17b)]())throw appRuleError(_0x49b93f(0x179),_0x49b93f(0x163)+_0x109b45);if(_0x81486d[_0x49b93f(0x175)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x49b93f(0x18d),_0x49b93f(0x195));let _0x24fcdb;try{_0x24fcdb=await readFile(_0x4a6196);}catch(_0x418af6){throw appRuleError(_0x49b93f(0x169),'Cannot\x20read\x20app\x20rule\x20file:\x20'+_0x109b45,_0x418af6 instanceof Error?_0x418af6[_0x49b93f(0x185)]:String(_0x418af6));}if(_0x24fcdb['byteLength']>MAX_APP_RULE_BYTES)throw appRuleError('app_rule_content_too_large',_0x49b93f(0x195));let _0x4a42cd;try{_0x4a42cd=new TextDecoder('utf-8',{'fatal':!![],'ignoreBOM':!![]})['decode'](_0x24fcdb);}catch{throw appRuleError(_0x49b93f(0x183),_0x49b93f(0x193)+_0x109b45);}if(_0x4a42cd[_0x49b93f(0x164)]>MAX_APP_RULE_UNITS)throw appRuleError('app_rule_content_too_large',_0x49b93f(0x166));if(!_0x4a42cd[_0x49b93f(0x18c)]())throw appRuleError(_0x49b93f(0x183),_0x49b93f(0x16e)+_0x109b45);return inspectAppRuleContent(_0x4a42cd);}export function projectAppRule(_0x16b42b,_0x54e61d){const _0x5b3ed3=a244_0x458a9c;if(!_0x54e61d)return{'type':_0x16b42b,'fileName':appRuleFileName(_0x16b42b),'contextScope':appRuleContextScope(_0x16b42b),'enabled':![]};const _0x38b456=inspectAppRuleContent(_0x54e61d[_0x5b3ed3(0x196)]);return{'type':_0x16b42b,'fileName':appRuleFileName(_0x16b42b),'contextScope':appRuleContextScope(_0x16b42b),'enabled':!![],'id':_0x54e61d['id'],'scope':_0x54e61d[_0x5b3ed3(0x18f)],'appCode':_0x54e61d[_0x5b3ed3(0x186)],'version':_0x54e61d[_0x5b3ed3(0x18b)],..._0x54e61d[_0x5b3ed3(0x165)]!==undefined?{'indexStatus':_0x54e61d[_0x5b3ed3(0x165)]}:{},'contentByteSize':_0x38b456[_0x5b3ed3(0x184)],'contentHash':_0x38b456[_0x5b3ed3(0x198)],..._0x54e61d[_0x5b3ed3(0x178)]!==undefined&&_0x54e61d[_0x5b3ed3(0x178)]!==null?{'createTime':_0x54e61d[_0x5b3ed3(0x178)]}:{},..._0x54e61d[_0x5b3ed3(0x177)]!==undefined&&_0x54e61d[_0x5b3ed3(0x177)]!==null?{'updateTime':_0x54e61d[_0x5b3ed3(0x177)]}:{}};}export const APP_RULE_TYPE_FLAG={'name':a244_0x458a9c(0x16f),'type':a244_0x458a9c(0x192),'required':!![],'description':a244_0x458a9c(0x181),'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_0x4ad350=a245_0x35cd;(function(_0x6de55e,_0x5946c4){const _0x3570e7=a245_0x35cd,_0x9b99bd=_0x6de55e();while(!![]){try{const _0x42c160=parseInt(_0x3570e7(0x1c8))/0x1+-parseInt(_0x3570e7(0x19e))/0x2*(-parseInt(_0x3570e7(0x1ac))/0x3)+parseInt(_0x3570e7(0x1c7))/0x4+-parseInt(_0x3570e7(0x19d))/0x5*(-parseInt(_0x3570e7(0x195))/0x6)+parseInt(_0x3570e7(0x1c1))/0x7+-parseInt(_0x3570e7(0x1a1))/0x8+-parseInt(_0x3570e7(0x197))/0x9;if(_0x42c160===_0x5946c4)break;else _0x9b99bd['push'](_0x9b99bd['shift']());}catch(_0x520a6b){_0x9b99bd['push'](_0x9b99bd['shift']());}}}(a245_0x4c07,0x2df46));import{readFileSync,existsSync}from'node:fs';function a245_0x4c07(){const _0x1f625d=['4841550YGHLGx','\x20run\x20start','yarn','parse','No\x20package.json\x20found\x20in\x20current\x20directory.','\x20run\x20','35LIoVWv','2168WLYYtk','length','yarn.lock','2142240hXjiZl','inherit','node_modules','cwd','package.json','\x20run\x20<script>\x0a','Available:\x20','vite\x20preview\x20exited\x20with\x20code\x20','Enable\x20watch\x20mode\x20for\x20preview','\x20\x20\x20\x20','args','546XnAkbj','log','pnpm','write','build','Domain\x20routing\x20synchronized:\x20','keys','\x20\x20EXAMPLES','Script\x20\x22','changed','(none)','has','\x20run\x20preview\x20--watch','vite','\x20run\x20build','\x22\x20not\x20found\x20in\x20package.json.','--watch','dev','utf-8','path','bun.lock','1038695eBwXxh','start','push','bun.lockb','\x20exited\x20with\x20code\x20','close','667328zfTVYd','184032zWxVck','No\x20scripts\x20defined\x20in\x20package.json.','slice','validation','watch','\x20run\x20preview','npm','pnpm-lock.yaml','all','error','preview','254934MSgIbK','belowMinimum'];a245_0x4c07=function(){return _0x1f625d;};return a245_0x4c07();}function a245_0x35cd(_0x42b3c3,_0x31be2d){_0x42b3c3=_0x42b3c3-0x18f;const _0x4c070d=a245_0x4c07();let _0x35cd8d=_0x4c070d[_0x42b3c3];return _0x35cd8d;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{findProjectRootDirectory,resolveConfigPath}from'../../context/config-loader.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a245_0x4ad350(0x1c2),a245_0x4ad350(0x1bd)]),DOMAIN_ROUTING_SYNC_SCRIPTS=new Set([a245_0x4ad350(0x1c2),a245_0x4ad350(0x1bd),a245_0x4ad350(0x1b0),a245_0x4ad350(0x194)]);export function syncProjectDomainRoutingBeforeScript(_0x3ca7b4,_0x38b31c){const _0x5d6f73=a245_0x4ad350;if(!DOMAIN_ROUTING_SYNC_SCRIPTS['has'](_0x38b31c))return null;const _0x1129c7=findProjectRootDirectory(_0x3ca7b4);if(!resolveConfigPath(_0x1129c7))return null;const _0x1f0447=writeProjectDomainRoutingManifest(_0x1129c7);return{'path':_0x1f0447[_0x5d6f73(0x1bf)],'changed':_0x1f0447[_0x5d6f73(0x1b5)]};}function readPackageScripts(_0x2b2aea){const _0x5ae94e=a245_0x4ad350,_0x4bef58=resolve(_0x2b2aea,_0x5ae94e(0x1a5));if(!existsSync(_0x4bef58))return null;try{const _0x31a17a=JSON[_0x5ae94e(0x19a)](readFileSync(_0x4bef58,_0x5ae94e(0x1be)));return _0x31a17a['scripts']??{};}catch{return null;}}function detectPackageManager(_0x3dae7f){const _0x58d05e=a245_0x4ad350;if(existsSync(resolve(_0x3dae7f,_0x58d05e(0x1c4)))||existsSync(resolve(_0x3dae7f,_0x58d05e(0x1c0))))return'bun';if(existsSync(resolve(_0x3dae7f,_0x58d05e(0x191))))return _0x58d05e(0x1ae);if(existsSync(resolve(_0x3dae7f,_0x58d05e(0x1a0))))return _0x58d05e(0x199);return _0x58d05e(0x190);}async function versionCheck(_0x5daf1a){const _0x3bd1ed=a245_0x4ad350,_0x181836=await checkCliVersion();(_0x181836['needsUpgrade']||_0x181836[_0x3bd1ed(0x196)])&&(printCliUpgradeWarning(_0x181836),assertCliVersionSupported(_0x181836));const _0x49f767=await checkSdkVersion(_0x5daf1a);if(_0x49f767['needsUpgrade'])printSdkUpgradeWarning(_0x49f767);}function spawnScript(_0x4e6b56,_0x4f754a,_0x52a325,_0x429e24){return new Promise((_0x146cf0,_0x5365de)=>{const _0x3dd6c7=a245_0x35cd,_0x276b56=['run',_0x4f754a,..._0x52a325],_0x503bb8=spawn(_0x4e6b56,_0x276b56,{'cwd':_0x429e24,'stdio':_0x3dd6c7(0x1a2),'shell':!![],'env':{...process.env,'PATH':''+join(_0x429e24,'node_modules','.bin')+delimiter+process.env.PATH}});_0x503bb8['on'](_0x3dd6c7(0x1c6),_0x1bee0a=>{const _0x270fd7=_0x3dd6c7;if(_0x1bee0a===0x0||_0x1bee0a===null)_0x146cf0();else _0x5365de(new Error(_0x4e6b56+_0x270fd7(0x19c)+_0x4f754a+_0x270fd7(0x1c5)+_0x1bee0a));}),_0x503bb8['on']('error',_0x5365de);});}function spawnViteBuildWatch(_0x14f772){return new Promise((_0x3334ba,_0x42ebd0)=>{const _0x1b7ccd=a245_0x35cd,_0x364d7a=spawn(_0x1b7ccd(0x1b9),['build',_0x1b7ccd(0x1bc)],{'cwd':_0x14f772,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x14f772,_0x1b7ccd(0x1a3),'.bin')+delimiter+process.env.PATH}});_0x364d7a['on'](_0x1b7ccd(0x1c6),_0x19402a=>{if(_0x19402a===0x0||_0x19402a===null)_0x3334ba();else _0x42ebd0(new Error('vite\x20build\x20--watch\x20exited\x20with\x20code\x20'+_0x19402a));}),_0x364d7a['on'](_0x1b7ccd(0x193),_0x42ebd0);});}function spawnVitePreview(_0x36112d){return new Promise((_0x13976c,_0x2027b8)=>{const _0x56d851=a245_0x35cd,_0x2a767f=spawn(_0x56d851(0x1b9),['preview'],{'cwd':_0x36112d,'stdio':_0x56d851(0x1a2),'shell':!![],'env':{...process.env,'PATH':''+join(_0x36112d,_0x56d851(0x1a3),'.bin')+delimiter+process.env.PATH}});_0x2a767f['on'](_0x56d851(0x1c6),_0x5d776e=>{const _0xd61b13=_0x56d851;if(_0x5d776e===0x0||_0x5d776e===null)_0x13976c();else _0x2027b8(new Error(_0xd61b13(0x1a8)+_0x5d776e));}),_0x2a767f['on'](_0x56d851(0x193),_0x2027b8);});}const runFlags=[{'name':a245_0x4ad350(0x1cc),'type':'boolean','description':a245_0x4ad350(0x1a9),'default':![]}];export const runDefinition={'service':'run','command':'run','description':'Run\x20a\x20package.json\x20script','risk':a245_0x4ad350(0x1af),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'script','description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x10ca07=a245_0x4ad350,_0x373e48=[];return _0x373e48[_0x10ca07(0x1c3)](_0x10ca07(0x1b3)),_0x373e48[_0x10ca07(0x1c3)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x10ca07(0x198)),_0x373e48[_0x10ca07(0x1c3)](_0x10ca07(0x1aa)+CLI_BIN_NAME+_0x10ca07(0x1ba)),_0x373e48[_0x10ca07(0x1c3)](_0x10ca07(0x1aa)+CLI_BIN_NAME+_0x10ca07(0x18f)),_0x373e48[_0x10ca07(0x1c3)](_0x10ca07(0x1aa)+CLI_BIN_NAME+_0x10ca07(0x1b8)),_0x373e48['join']('\x0a');},async 'execute'(_0x1ba251){const _0xcb4c91=a245_0x4ad350,_0x1ef3aa=process[_0xcb4c91(0x1a4)](),_0x15ded7=_0x1ba251[_0xcb4c91(0x1ab)][0x0],_0x1d9f75=_0x1ba251[_0xcb4c91(0x1ab)][_0xcb4c91(0x1ca)](0x1),_0x79a633=readPackageScripts(_0x1ef3aa);if(!_0x79a633)throw CliErrors[_0xcb4c91(0x1cb)](_0xcb4c91(0x19b));if(!_0x15ded7){const _0x3d16fa=Object[_0xcb4c91(0x1b2)](_0x79a633);if(_0x3d16fa[_0xcb4c91(0x19f)]===0x0)console['log'](_0xcb4c91(0x1c9));else{console['log']('\x0a\x20\x20Available\x20scripts:\x0a');for(const _0x45c1fe of _0x3d16fa){console['log']('\x20\x20\x20\x20'+_0x45c1fe);}console[_0xcb4c91(0x1ad)]('\x0a\x20\x20Usage:\x20'+CLI_BIN_NAME+_0xcb4c91(0x1a6));}return{'ok':!![]};}if(!_0x79a633[_0x15ded7])throw CliErrors[_0xcb4c91(0x1cb)](_0xcb4c91(0x1b4)+_0x15ded7+_0xcb4c91(0x1bb),_0xcb4c91(0x1a7)+(Object[_0xcb4c91(0x1b2)](_0x79a633)['join'](',\x20')||_0xcb4c91(0x1b6)));const _0x100c0a=detectPackageManager(_0x1ef3aa),_0x5cb8b5=syncProjectDomainRoutingBeforeScript(_0x1ef3aa,_0x15ded7);_0x5cb8b5?.[_0xcb4c91(0x1b5)]&&console[_0xcb4c91(0x193)](_0xcb4c91(0x1b1)+_0x5cb8b5[_0xcb4c91(0x1bf)]);VERSION_CHECK_SCRIPTS[_0xcb4c91(0x1b7)](_0x15ded7)&&await versionCheck(_0x1ef3aa);if(_0x15ded7===_0xcb4c91(0x194)&&_0x1ba251['bool']('watch'))return await Promise[_0xcb4c91(0x192)]([spawnViteBuildWatch(_0x1ef3aa),spawnVitePreview(_0x1ef3aa)]),{'ok':!![]};return await spawnScript(_0x100c0a,_0x15ded7,_0x1d9f75,_0x1ef3aa),{'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_0x3ca1a7=a246_0x3c55;function a246_0x3c55(_0x52b519,_0x528333){_0x52b519=_0x52b519-0xf9;const _0x6da6d1=a246_0x6da6();let _0x3c553a=_0x6da6d1[_0x52b519];return _0x3c553a;}(function(_0x5466be,_0x1ed5e3){const _0x541f49=a246_0x3c55,_0x1bcf7c=_0x5466be();while(!![]){try{const _0x4402a6=parseInt(_0x541f49(0xff))/0x1+parseInt(_0x541f49(0xfa))/0x2*(-parseInt(_0x541f49(0x104))/0x3)+-parseInt(_0x541f49(0x103))/0x4+parseInt(_0x541f49(0x102))/0x5*(parseInt(_0x541f49(0x101))/0x6)+-parseInt(_0x541f49(0xf9))/0x7+parseInt(_0x541f49(0xfc))/0x8*(-parseInt(_0x541f49(0xfb))/0x9)+parseInt(_0x541f49(0xfe))/0xa;if(_0x4402a6===_0x1ed5e3)break;else _0x1bcf7c['push'](_0x1bcf7c['shift']());}catch(_0xeb215){_0x1bcf7c['push'](_0x1bcf7c['shift']());}}}(a246_0x6da6,0x90092));import{buildSchemaPayload}from'../framework/schema-export.js';function a246_0x6da6(){const _0xb570f9=['176115aFNZeN','108899RcFKMH','40fTpuRV','237555DfcxAc','48Tyiwso','Export\x20machine-readable\x20command\x20schema\x20(JSON)','11881040IXhswG','996076csqiWY','json','33210lhhFvw','665mJPUHS','3929352FmYPjR'];a246_0x6da6=function(){return _0xb570f9;};return a246_0x6da6();}async function execute(_0x670fd2){const _0x29ed12=await buildSchemaPayload();return{'ok':!![],'data':_0x29ed12};}export const schemaDefinition={'service':'schema','command':'export','description':a246_0x3ca1a7(0xfd),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a246_0x3ca1a7(0x100),'flags':[],'execute':execute};
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
- function a247_0xde10(_0x9e92b,_0x11661b){_0x9e92b=_0x9e92b-0xc4;const _0x4c90ac=a247_0x4c90();let _0xde1075=_0x4c90ac[_0x9e92b];return _0xde1075;}const a247_0x4a1ffd=a247_0xde10;(function(_0x5841a2,_0x253863){const _0x5ab969=a247_0xde10,_0x350ab3=_0x5841a2();while(!![]){try{const _0x4dc473=-parseInt(_0x5ab969(0xce))/0x1+-parseInt(_0x5ab969(0xf5))/0x2*(parseInt(_0x5ab969(0xdd))/0x3)+-parseInt(_0x5ab969(0x100))/0x4*(parseInt(_0x5ab969(0xf2))/0x5)+parseInt(_0x5ab969(0xd8))/0x6+parseInt(_0x5ab969(0xc7))/0x7+parseInt(_0x5ab969(0xc4))/0x8*(parseInt(_0x5ab969(0x108))/0x9)+-parseInt(_0x5ab969(0xe9))/0xa*(-parseInt(_0x5ab969(0xf8))/0xb);if(_0x4dc473===_0x253863)break;else _0x350ab3['push'](_0x350ab3['shift']());}catch(_0x47467d){_0x350ab3['push'](_0x350ab3['shift']());}}}(a247_0x4c90,0xa140e));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_0x4c90(){const _0x571edd=['File\x20already\x20exists:\x20','SELECT\x201\x20AS\x20id;','mybatisXml','sqlRootDir','1256771kRGJfD','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','/smartapi/custom/saveUserCustomSql','catch','sqls','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','SQL\x20name\x20cannot\x20be\x20empty','isInteger','<server-generated-sqlCode>','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','1839528bHtzaY','write','parse','dbId','sql','3nBUozx','trim','map','POST','dbId\x20cannot\x20be\x20empty','dbName','✎\x20Enter\x20dbId\x20manually','For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly','toISOString','Created\x20SQL\x20query\x20','sqlRoot','flagMissing','170rCikRL','SQL\x20query\x20display\x20name','sqlName','db-id','nonInteractive','number','Local\x20SQL\x20file\x20mode','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','appCode','5JZofmT','Select\x20the\x20target\x20database:','validation','1677918dWudWB','Plain\x20SQL\x20(sql)','length','855426QNnOzU','__manual__','\x20\x20SELECT\x201\x20AS\x20id','str','isFinite','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','string','join','334556YyAAIK','sqlCode','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','create','name','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','Invalid\x20database\x20selection\x20payload:\x20','lastSync','9BnQiDO','7768640Stjgjj','MyBatis\x20XML\x20(mybatisXml)','utf8','1681211wIQGqZ','</select>','mode'];a247_0x4c90=function(){return _0x571edd;};return a247_0x4c90();}function generateSqlTemplate(_0x363849){const _0x2094ac=a247_0xde10;if(_0x363849==='mybatisXml')return[_0x2094ac(0xfd),_0x2094ac(0xfa),_0x2094ac(0xc8),''][_0x2094ac(0xff)]('\x0a');return[_0x2094ac(0xcb),''][_0x2094ac(0xff)]('\x0a');}export const sqlCreate={'service':a247_0x4a1ffd(0xdc),'command':a247_0x4a1ffd(0x103),'description':a247_0x4a1ffd(0xd3),'risk':a247_0x4a1ffd(0xd9),'flags':[{'name':'name','type':a247_0x4a1ffd(0xfe),'description':a247_0x4a1ffd(0xea)},{'name':'db-id','type':a247_0x4a1ffd(0xee),'description':'Target\x20database\x20ID'},{'name':a247_0x4a1ffd(0xc9),'type':a247_0x4a1ffd(0xfe),'enum':[a247_0x4a1ffd(0xdc),a247_0x4a1ffd(0xcc)],'description':a247_0x4a1ffd(0xef)}],async 'validate'(_0x58d6fa){const _0x586e2=a247_0x4a1ffd;if(!_0x58d6fa[_0x586e2(0xed)])return;if(!_0x58d6fa[_0x586e2(0xfb)](_0x586e2(0x104))[_0x586e2(0xde)]())throw CliErrors[_0x586e2(0xe8)](_0x586e2(0x104),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x3785e1=resolveProvidedDbId(_0x58d6fa);if(typeof _0x3785e1!==_0x586e2(0xee)||!Number[_0x586e2(0xfc)](_0x3785e1)||_0x3785e1<=0x0)throw CliErrors[_0x586e2(0xe8)](_0x586e2(0xec),_0x586e2(0xf0));if(!_0x58d6fa[_0x586e2(0xfb)](_0x586e2(0xc9))['trim']())throw CliErrors[_0x586e2(0xe8)](_0x586e2(0xc9),_0x586e2(0xcf));},async 'dryRun'(_0x323f01){const _0x144419=a247_0x4a1ffd,_0x4f2913=loadSqlProjectConfig(_0x323f01['appCode']),{sqlName:_0x438ea0,dbId:_0xd7dc6b,dbName:_0x194dd9,mode:_0x16bc0d}=await resolveSqlNewInputs(_0x323f01),_0x4357ff=buildSqlRelativePath(_0x144419(0xd6),_0x438ea0,_0x194dd9,_0x16bc0d,_0xd7dc6b),_0x2ae7e8=_0x4f2913[_0x144419(0xcd)]+'/'+_0x4357ff;return{'method':_0x144419(0xe0),'url':_0x144419(0xd0),'body':{'appCode':_0x323f01[_0x144419(0xf1)],'sqlName':_0x438ea0,'dbId':_0xd7dc6b,'mode':_0x16bc0d,'localPath':_0x2ae7e8},'description':_0x144419(0xd7)+_0x4f2913['sqlRootDir']};},async 'execute'(_0x56100a){const _0x56cc27=a247_0x4a1ffd,_0x339a40=loadSqlProjectConfig(_0x56100a[_0x56cc27(0xf1)]),{sqlName:_0x3bd289,dbId:_0x39aa8b,dbName:_0x1db422,mode:_0x242f71}=await resolveSqlNewInputs(_0x56100a),_0x1420a5=generateSqlTemplate(_0x242f71),_0x34d832=await createSqlQuery({'appCode':_0x56100a[_0x56cc27(0xf1)],'sqlName':_0x3bd289,'dbId':_0x39aa8b,'sqlContent':_0x1420a5}),_0xd5f594=ensureRemoteSqlContent(_0x34d832),_0x2d824c=_0x1db422||await getDbName(_0x56100a['appCode'],_0x39aa8b)[_0x56cc27(0xd1)](()=>undefined),_0x3ad83a=buildSqlRelativePath(_0x34d832[_0x56cc27(0x101)],_0x34d832[_0x56cc27(0xeb)],_0x2d824c,_0x242f71,_0x39aa8b),_0x537dc3=_0x339a40['sqlRootDir']+'/'+_0x3ad83a,_0x10bb40=buildLocalSqlFileContent({'sqlCode':_0x34d832['sqlCode'],'sqlName':_0x34d832[_0x56cc27(0xeb)],'dbId':_0x34d832['dbId']},_0xd5f594,{'dbName':_0x2d824c,'mode':_0x242f71,'syncedAt':new Date()[_0x56cc27(0xe5)](),'description':_0x34d832['description']});if(await fileExists(_0x537dc3))throw CliErrors[_0x56cc27(0xf4)](_0x56cc27(0xca)+_0x537dc3);await ensureParentDirectory(_0x537dc3),await writeFile(_0x537dc3,_0x10bb40,_0x56cc27(0xc6));const _0x5d240e=await readSqlLockFile(_0x339a40['lockFilePath']),{lockData:_0x4fe5f0,appLock:_0x94f6f3}=ensureSqlLockScope(_0x5d240e??createEmptySqlLock(),_0x339a40[_0x56cc27(0xf1)],_0x339a40[_0x56cc27(0xe7)],'new');return _0x94f6f3[_0x56cc27(0xd2)][_0x34d832[_0x56cc27(0x101)]]={...buildSqlLockEntry(_0x34d832,_0xd5f594,computeSqlContentHash(_0x10bb40),{'dbName':_0x2d824c}),'path':_0x3ad83a,'mode':_0x242f71},_0x94f6f3[_0x56cc27(0x107)]=new Date()[_0x56cc27(0xe5)](),await writeSqlLockFile(_0x339a40['lockFilePath'],_0x4fe5f0),{'ok':!![],'data':{'id':_0x34d832['id'],'sqlCode':_0x34d832[_0x56cc27(0x101)],'sqlName':_0x34d832[_0x56cc27(0xeb)],'dbId':_0x34d832['dbId'],'path':_0x537dc3,'mode':_0x242f71},'message':_0x56cc27(0xe6)+_0x34d832[_0x56cc27(0x101)]};}};async function resolveSqlNewInputs(_0x42fcd6){const _0x278688=await resolveSqlNameInput(_0x42fcd6),{dbId:_0x385c3a,dbName:_0xe4dd64}=await resolveDbSelection(_0x42fcd6),_0x3d42c8=await resolveSqlModeInput(_0x42fcd6);return{'sqlName':_0x278688,'dbId':_0x385c3a,'dbName':_0xe4dd64,'mode':_0x3d42c8};}async function resolveSqlNameInput(_0x1271a0){const _0x3238e1=a247_0x4a1ffd,_0x2710cb=_0x1271a0[_0x3238e1(0xfb)](_0x3238e1(0x104))[_0x3238e1(0xde)]();if(_0x2710cb)return _0x2710cb;if(_0x1271a0[_0x3238e1(0xed)])throw CliErrors[_0x3238e1(0xe8)](_0x3238e1(0x104),_0x3238e1(0x102));return(await input({'message':'SQL\x20name:','validate':_0x3ea0fc=>_0x3ea0fc[_0x3238e1(0xde)]()?!![]:_0x3238e1(0xd4)}))['trim']();}async function resolveDbSelection(_0x542f25){const _0x2825f9=a247_0x4a1ffd,_0x47174f=resolveProvidedDbId(_0x542f25);if(typeof _0x47174f===_0x2825f9(0xee)&&Number[_0x2825f9(0xfc)](_0x47174f)&&_0x47174f>0x0)return{'dbId':_0x47174f,'dbName':await getDbName(_0x542f25[_0x2825f9(0xf1)],_0x47174f)[_0x2825f9(0xd1)](()=>undefined)};if(_0x542f25[_0x2825f9(0xed)])throw CliErrors['flagMissing'](_0x2825f9(0xec),_0x2825f9(0xf0));const _0x2a0b97=await listDatabases(_0x542f25[_0x2825f9(0xf1)])[_0x2825f9(0xd1)](()=>[]);if(_0x2a0b97[_0x2825f9(0xf7)]===0x1)return{'dbId':_0x2a0b97[0x0][_0x2825f9(0xdb)],'dbName':_0x2a0b97[0x0][_0x2825f9(0xe2)]};if(_0x2a0b97['length']>0x1){const _0x3c4826=await select({'message':_0x2825f9(0xf3),'choices':[..._0x2a0b97[_0x2825f9(0xdf)](_0x92d471=>({'name':_0x92d471[_0x2825f9(0xe2)]+'\x20('+_0x92d471[_0x2825f9(0xdb)]+')','value':serializeDbSelection(_0x92d471)})),{'name':_0x2825f9(0xe3),'value':_0x2825f9(0xf9)}]});if(_0x3c4826!==_0x2825f9(0xf9))return deserializeDbSelection(_0x3c4826);}const _0x3b2d61=await input({'message':'Target\x20database\x20dbId:','validate':_0x1ac9c2=>{const _0x2cc44a=_0x2825f9,_0x432a3f=_0x1ac9c2['trim']();if(!_0x432a3f)return _0x2cc44a(0xe1);const _0x649740=Number(_0x432a3f);if(!Number[_0x2cc44a(0xd5)](_0x649740)||_0x649740<=0x0)return'dbId\x20must\x20be\x20a\x20positive\x20integer';return!![];}});return{'dbId':Number(_0x3b2d61[_0x2825f9(0xde)]())};}async function resolveSqlModeInput(_0x344876){const _0x44d1b9=a247_0x4a1ffd,_0x52ed33=_0x344876[_0x44d1b9(0xfb)](_0x44d1b9(0xc9))['trim']();if(_0x52ed33===_0x44d1b9(0xdc)||_0x52ed33===_0x44d1b9(0xcc))return _0x52ed33;if(_0x344876[_0x44d1b9(0xed)])throw CliErrors[_0x44d1b9(0xe8)](_0x44d1b9(0xc9),_0x44d1b9(0xcf));return await select({'message':'Select\x20the\x20local\x20SQL\x20mode:','choices':[{'name':_0x44d1b9(0xf6),'value':_0x44d1b9(0xdc),'description':_0x44d1b9(0xe4)},{'name':_0x44d1b9(0xc5),'value':'mybatisXml','description':_0x44d1b9(0x105)}]});}function serializeDbSelection(_0x46bac9){const _0x359c46=a247_0x4a1ffd;return JSON['stringify']({'dbId':_0x46bac9[_0x359c46(0xdb)],'dbName':_0x46bac9[_0x359c46(0xe2)]});}function deserializeDbSelection(_0x2d9443){const _0x5bdcf6=a247_0x4a1ffd;try{const _0x341f6a=JSON[_0x5bdcf6(0xda)](_0x2d9443);if(typeof _0x341f6a[_0x5bdcf6(0xdb)]===_0x5bdcf6(0xee)&&Number['isFinite'](_0x341f6a[_0x5bdcf6(0xdb)]))return{'dbId':_0x341f6a['dbId'],'dbName':_0x341f6a[_0x5bdcf6(0xe2)]};}catch{}throw CliErrors[_0x5bdcf6(0xf4)](_0x5bdcf6(0x106)+_0x2d9443);}function resolveProvidedDbId(_0x2e540c){const _0x348d4b=a247_0x4a1ffd,_0x974a23=_0x2e540c['flag']('db-id');if(typeof _0x974a23==='number'&&Number[_0x348d4b(0xfc)](_0x974a23))return _0x974a23;return undefined;}
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;}