@lovrabet/rabetbase-cli 2.5.10-beta.4 → 2.5.10-beta.5

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 (376) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/api-group.js +1 -1
  3. package/lib/api/fetch-model-list.js +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/api/generate-sdk-config-file.js +1 -1
  6. package/lib/api/legacy-api-file.js +1 -1
  7. package/lib/api/model-registry-file.js +1 -1
  8. package/lib/api/model-registry-scaffold.js +1 -1
  9. package/lib/api/model-source.js +1 -1
  10. package/lib/auth/auth-server-ui.js +1 -1
  11. package/lib/auth/auth-server.js +1 -1
  12. package/lib/auth/constant.js +1 -1
  13. package/lib/auth/get-cookie.js +1 -1
  14. package/lib/auth/get-session-user.js +1 -1
  15. package/lib/auth/is-session-valid.js +1 -1
  16. package/lib/auth/login-success-html.js +1 -1
  17. package/lib/auth/logout.js +1 -1
  18. package/lib/cli-flags.js +1 -1
  19. package/lib/cli.js +1 -1
  20. package/lib/commands/api/generate.js +1 -1
  21. package/lib/commands/api/index.js +1 -1
  22. package/lib/commands/api/list.js +1 -1
  23. package/lib/commands/api/pull.js +1 -1
  24. package/lib/commands/api/shared.js +1 -1
  25. package/lib/commands/app/detail.js +1 -1
  26. package/lib/commands/app/index.js +1 -1
  27. package/lib/commands/app/list.js +1 -1
  28. package/lib/commands/app/members-list.js +1 -1
  29. package/lib/commands/app/remote-directory.js +1 -1
  30. package/lib/commands/app/shared.js +1 -1
  31. package/lib/commands/app-config/delete.js +1 -1
  32. package/lib/commands/app-config/get.js +1 -1
  33. package/lib/commands/app-config/index.js +1 -1
  34. package/lib/commands/app-config/list.js +1 -1
  35. package/lib/commands/app-config/set.js +1 -1
  36. package/lib/commands/app-config/shared.js +1 -1
  37. package/lib/commands/auth/index.js +1 -1
  38. package/lib/commands/bff/create.js +1 -1
  39. package/lib/commands/bff/delete.js +1 -1
  40. package/lib/commands/bff/detail.js +1 -1
  41. package/lib/commands/bff/index.js +1 -1
  42. package/lib/commands/bff/list.js +1 -1
  43. package/lib/commands/bff/logs.js +1 -1
  44. package/lib/commands/bff/pull.js +1 -1
  45. package/lib/commands/bff/push.js +1 -1
  46. package/lib/commands/bff/status.js +1 -1
  47. package/lib/commands/cli-skill/index.js +1 -1
  48. package/lib/commands/cli-update.js +1 -1
  49. package/lib/commands/codegen/index.js +1 -1
  50. package/lib/commands/codegen/sdk.js +1 -1
  51. package/lib/commands/codegen/sql.js +1 -1
  52. package/lib/commands/common/app-registry.js +1 -1
  53. package/lib/commands/common/app-selector.js +1 -1
  54. package/lib/commands/common/async-task.js +1 -1
  55. package/lib/commands/common/dry-run.js +1 -1
  56. package/lib/commands/common/flags.js +1 -1
  57. package/lib/commands/common/local-file.js +1 -1
  58. package/lib/commands/common/validate.js +1 -1
  59. package/lib/commands/config/delete.js +1 -1
  60. package/lib/commands/config/get.js +1 -1
  61. package/lib/commands/config/index.js +1 -1
  62. package/lib/commands/config/init.js +1 -1
  63. package/lib/commands/config/list.js +1 -1
  64. package/lib/commands/config/set.js +1 -1
  65. package/lib/commands/config/shared.js +1 -1
  66. package/lib/commands/dataset/batch-design.js +1 -1
  67. package/lib/commands/dataset/business-group-update.js +1 -1
  68. package/lib/commands/dataset/business-groups.js +1 -1
  69. package/lib/commands/dataset/capability.js +1 -1
  70. package/lib/commands/dataset/cross-relation-create.js +1 -1
  71. package/lib/commands/dataset/cross-relation-delete.js +1 -1
  72. package/lib/commands/dataset/cross-relation-list.js +1 -1
  73. package/lib/commands/dataset/cross-relation-shared.js +1 -1
  74. package/lib/commands/dataset/cross-relation-update.js +1 -1
  75. package/lib/commands/dataset/delete.js +1 -1
  76. package/lib/commands/dataset/design-context.js +1 -1
  77. package/lib/commands/dataset/design-start.js +1 -1
  78. package/lib/commands/dataset/design-status.js +1 -1
  79. package/lib/commands/dataset/design-sync-retry.js +1 -1
  80. package/lib/commands/dataset/design-sync-status.js +1 -1
  81. package/lib/commands/dataset/design-validate.js +1 -1
  82. package/lib/commands/dataset/detail.js +1 -1
  83. package/lib/commands/dataset/extend-update.js +1 -1
  84. package/lib/commands/dataset/field-restore.js +1 -1
  85. package/lib/commands/dataset/field-update.js +1 -1
  86. package/lib/commands/dataset/generate.js +1 -1
  87. package/lib/commands/dataset/index.js +1 -1
  88. package/lib/commands/dataset/list.js +1 -1
  89. package/lib/commands/dataset/operations.js +1 -1
  90. package/lib/commands/dataset/relation-audit.js +1 -1
  91. package/lib/commands/dataset/relation-create.js +1 -1
  92. package/lib/commands/dataset/relation-delete.js +1 -1
  93. package/lib/commands/dataset/relation-shared.js +1 -1
  94. package/lib/commands/dataset/relation-update.js +1 -1
  95. package/lib/commands/dataset/relations.js +1 -1
  96. package/lib/commands/dataset/rename.js +1 -1
  97. package/lib/commands/dataset/restore.js +1 -1
  98. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  99. package/lib/commands/db/analysis-batching.js +1 -1
  100. package/lib/commands/db/analyze-batch-plan.js +1 -1
  101. package/lib/commands/db/analyze-cancel.js +1 -1
  102. package/lib/commands/db/analyze-start.js +1 -1
  103. package/lib/commands/db/analyze-status.js +1 -1
  104. package/lib/commands/db/create.js +1 -1
  105. package/lib/commands/db/cross-db-analysis-shared.js +1 -1
  106. package/lib/commands/db/cross-db-analyze-latest.js +1 -1
  107. package/lib/commands/db/cross-db-analyze-start.js +1 -1
  108. package/lib/commands/db/cross-db-analyze-status.js +1 -1
  109. package/lib/commands/db/delete.js +1 -1
  110. package/lib/commands/db/detail.js +1 -1
  111. package/lib/commands/db/diff-refresh-start.js +1 -1
  112. package/lib/commands/db/diff-refresh-status.js +1 -1
  113. package/lib/commands/db/diff.js +1 -1
  114. package/lib/commands/db/index.js +1 -1
  115. package/lib/commands/db/list.js +1 -1
  116. package/lib/commands/db/shared.js +1 -1
  117. package/lib/commands/db/table-diff-shared.js +1 -1
  118. package/lib/commands/db/tables.js +1 -1
  119. package/lib/commands/db/test.js +1 -1
  120. package/lib/commands/db/update.js +1 -1
  121. package/lib/commands/deployment/index.js +1 -1
  122. package/lib/commands/deployment/sync-all.js +1 -1
  123. package/lib/commands/deployment/sync-jobs.js +1 -1
  124. package/lib/commands/deployment/sync-status.js +1 -1
  125. package/lib/commands/doctor.js +1 -1
  126. package/lib/commands/file/index.js +1 -1
  127. package/lib/commands/flow/create.js +1 -1
  128. package/lib/commands/flow/detail.js +1 -1
  129. package/lib/commands/flow/index.js +1 -1
  130. package/lib/commands/flow/list.js +1 -1
  131. package/lib/commands/flow/page-list.js +1 -1
  132. package/lib/commands/flow/publish.js +1 -1
  133. package/lib/commands/flow/runtime-resources-shared.js +1 -1
  134. package/lib/commands/flow/runtime-role-list.js +1 -1
  135. package/lib/commands/flow/runtime-role-user-list.js +1 -1
  136. package/lib/commands/flow/runtime-user-search.js +1 -1
  137. package/lib/commands/flow/shared.js +1 -1
  138. package/lib/commands/flow/update.js +1 -1
  139. package/lib/commands/flow/validate.js +1 -1
  140. package/lib/commands/instant-api-policy/current.js +1 -1
  141. package/lib/commands/instant-api-policy/index.js +1 -1
  142. package/lib/commands/instant-api-policy/init.js +1 -1
  143. package/lib/commands/instant-api-policy/publish.js +1 -1
  144. package/lib/commands/instant-api-policy/pull.js +1 -1
  145. package/lib/commands/instant-api-policy/revision.js +1 -1
  146. package/lib/commands/instant-api-policy/revisions.js +1 -1
  147. package/lib/commands/instant-api-policy/rollback.js +1 -1
  148. package/lib/commands/instant-api-policy/shared.js +1 -1
  149. package/lib/commands/instant-api-policy/validate.js +1 -1
  150. package/lib/commands/issue/context.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/kb/create.js +1 -1
  155. package/lib/commands/kb/delete.js +1 -1
  156. package/lib/commands/kb/detail.js +1 -1
  157. package/lib/commands/kb/index.js +1 -1
  158. package/lib/commands/kb/list.js +1 -1
  159. package/lib/commands/kb/search.js +1 -1
  160. package/lib/commands/kb/shared.js +1 -1
  161. package/lib/commands/kb/update.js +1 -1
  162. package/lib/commands/logs/index.js +1 -1
  163. package/lib/commands/menu/asset-update.js +1 -1
  164. package/lib/commands/menu/delete.js +1 -1
  165. package/lib/commands/menu/external-link-create.js +1 -1
  166. package/lib/commands/menu/external-link-update.js +1 -1
  167. package/lib/commands/menu/group-create.js +1 -1
  168. package/lib/commands/menu/group-update.js +1 -1
  169. package/lib/commands/menu/index.js +1 -1
  170. package/lib/commands/menu/list.js +1 -1
  171. package/lib/commands/menu/move.js +1 -1
  172. package/lib/commands/menu/regroup-start.js +1 -1
  173. package/lib/commands/menu/rename.js +1 -1
  174. package/lib/commands/menu/shared/compare-table.js +1 -1
  175. package/lib/commands/menu/shared/delete-plan.js +1 -1
  176. package/lib/commands/menu/shared/facts.js +1 -1
  177. package/lib/commands/menu/shared/index.js +1 -1
  178. package/lib/commands/menu/shared/inquirer.js +1 -1
  179. package/lib/commands/menu/shared/local-pages.js +1 -1
  180. package/lib/commands/menu/shared/logic.js +1 -1
  181. package/lib/commands/menu/shared/mutations.js +1 -1
  182. package/lib/commands/menu/shared/path.js +1 -1
  183. package/lib/commands/menu/shared/service.js +1 -1
  184. package/lib/commands/menu/shared/subapp-assets.js +1 -1
  185. package/lib/commands/menu/shared/sync-core.js +1 -1
  186. package/lib/commands/menu/shared/update-core.js +1 -1
  187. package/lib/commands/menu/shared/valid-url.js +1 -1
  188. package/lib/commands/menu/subapp-assets-status.js +1 -1
  189. package/lib/commands/menu/subapp-assets-update.js +1 -1
  190. package/lib/commands/menu/sync.js +1 -1
  191. package/lib/commands/menu/visibility-update.js +1 -1
  192. package/lib/commands/notification/config-create.js +1 -1
  193. package/lib/commands/notification/config-delete.js +1 -1
  194. package/lib/commands/notification/config-list.js +1 -1
  195. package/lib/commands/notification/config-update.js +1 -1
  196. package/lib/commands/notification/index.js +1 -1
  197. package/lib/commands/notification/shared.js +1 -1
  198. package/lib/commands/ocr/index.js +1 -1
  199. package/lib/commands/page/create.js +1 -1
  200. package/lib/commands/page/custom/detail.js +1 -1
  201. package/lib/commands/page/custom/list.js +1 -1
  202. package/lib/commands/page/custom/publish.js +1 -1
  203. package/lib/commands/page/custom/shared.js +1 -1
  204. package/lib/commands/page/custom/syntax.js +1 -1
  205. package/lib/commands/page/custom/update.js +1 -1
  206. package/lib/commands/page/data-list-status.js +1 -1
  207. package/lib/commands/page/generate-start.js +1 -1
  208. package/lib/commands/page/generate-status.js +1 -1
  209. package/lib/commands/page/index.js +1 -1
  210. package/lib/commands/page/pull.js +1 -1
  211. package/lib/commands/page/push.js +1 -1
  212. package/lib/commands/page/relation-audit.js +1 -1
  213. package/lib/commands/page/restore.js +1 -1
  214. package/lib/commands/page/shared.js +1 -1
  215. package/lib/commands/page/sync.js +1 -1
  216. package/lib/commands/project/api-architecture-upgrade.js +1 -1
  217. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  218. package/lib/commands/project/create/format-elapsed.js +1 -1
  219. package/lib/commands/project/create/main.js +1 -1
  220. package/lib/commands/project/create/materialize-project-template.js +1 -1
  221. package/lib/commands/project/create/project-name.js +1 -1
  222. package/lib/commands/project/create/project-template-archive.js +1 -1
  223. package/lib/commands/project/create/project-template-path.js +1 -1
  224. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  225. package/lib/commands/project/create/use-format-code.js +1 -1
  226. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  227. package/lib/commands/project/domain-routing-sync.js +1 -1
  228. package/lib/commands/project/index.js +1 -1
  229. package/lib/commands/project/upgrade.js +1 -1
  230. package/lib/commands/registry.js +1 -1
  231. package/lib/commands/role/delete.js +1 -1
  232. package/lib/commands/role/detail.js +1 -1
  233. package/lib/commands/role/index.js +1 -1
  234. package/lib/commands/role/list.js +1 -1
  235. package/lib/commands/role/shared.js +1 -1
  236. package/lib/commands/role/update.js +1 -1
  237. package/lib/commands/role/user-add.js +1 -1
  238. package/lib/commands/role/user-remove.js +1 -1
  239. package/lib/commands/role/user-resolve.js +1 -1
  240. package/lib/commands/rule/get.js +1 -1
  241. package/lib/commands/rule/index.js +1 -1
  242. package/lib/commands/rule/list.js +1 -1
  243. package/lib/commands/rule/set.js +1 -1
  244. package/lib/commands/rule/shared.js +1 -1
  245. package/lib/commands/run/index.js +1 -1
  246. package/lib/commands/schema.js +1 -1
  247. package/lib/commands/sql/create.js +1 -1
  248. package/lib/commands/sql/delete.js +1 -1
  249. package/lib/commands/sql/detail.js +1 -1
  250. package/lib/commands/sql/exec.js +1 -1
  251. package/lib/commands/sql/index.js +1 -1
  252. package/lib/commands/sql/list.js +1 -1
  253. package/lib/commands/sql/pull.js +1 -1
  254. package/lib/commands/sql/push.js +1 -1
  255. package/lib/commands/sql/shared.js +1 -1
  256. package/lib/commands/sql/status.js +1 -1
  257. package/lib/commands/sql/validate.js +1 -1
  258. package/lib/commands/task/index.js +1 -1
  259. package/lib/commands/task/status.js +1 -1
  260. package/lib/commands/tenant/index.js +1 -1
  261. package/lib/commands/tenant/members-list.js +1 -1
  262. package/lib/commands/tenant/shared.js +1 -1
  263. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  264. package/lib/commands/user-account/feishu-bind.js +1 -1
  265. package/lib/commands/user-account/index.js +1 -1
  266. package/lib/commands/workspace/add.js +1 -1
  267. package/lib/commands/workspace/index.js +1 -1
  268. package/lib/commands/workspace/remove.js +1 -1
  269. package/lib/config/domain-config.js +1 -1
  270. package/lib/config/project-domain-routing.js +1 -1
  271. package/lib/config/region-config.js +1 -1
  272. package/lib/config/schema.js +1 -1
  273. package/lib/constant/cdn.js +1 -1
  274. package/lib/constant/cli.js +1 -1
  275. package/lib/constant/defaults.js +1 -1
  276. package/lib/constant/domain.js +1 -1
  277. package/lib/constant/env.js +1 -1
  278. package/lib/constant/output.js +1 -1
  279. package/lib/constant/paths.js +1 -1
  280. package/lib/constant/region.js +1 -1
  281. package/lib/constant/risk.js +1 -1
  282. package/lib/constant/routing-profile.js +1 -1
  283. package/lib/context/app-resolver.js +1 -1
  284. package/lib/context/auth-resolver.js +1 -1
  285. package/lib/context/config-loader.js +1 -1
  286. package/lib/context.js +1 -1
  287. package/lib/core/alias-resolver.js +1 -1
  288. package/lib/core/api-client.js +1 -1
  289. package/lib/core/bff/config.js +1 -1
  290. package/lib/core/bff/file-system.js +1 -1
  291. package/lib/core/bff/hash.js +1 -1
  292. package/lib/core/bff/hook-directory.js +1 -1
  293. package/lib/core/bff/lock.js +1 -1
  294. package/lib/core/bff/utils.js +1 -1
  295. package/lib/core/cross-db-analysis.js +1 -1
  296. package/lib/core/cross-db-relation.js +1 -1
  297. package/lib/core/db-resolver.js +1 -1
  298. package/lib/core/flow-config.js +1 -1
  299. package/lib/core/instant-api-policy/config.js +1 -1
  300. package/lib/core/instant-api-policy/endpoints.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/utils/ai_config.js +1 -1
  352. package/lib/utils/apply-jq-filter.js +1 -1
  353. package/lib/utils/cdn-config.js +1 -1
  354. package/lib/utils/check-sdk-version.js +1 -1
  355. package/lib/utils/cli-version-check.js +1 -1
  356. package/lib/utils/cli-version-policy.js +1 -1
  357. package/lib/utils/config.js +1 -1
  358. package/lib/utils/entity-with-id.js +1 -1
  359. package/lib/utils/file-utils.js +1 -1
  360. package/lib/utils/guides-cdn.js +1 -1
  361. package/lib/utils/http-client.js +1 -1
  362. package/lib/utils/is-non-interactive.js +1 -1
  363. package/lib/utils/logger.js +1 -1
  364. package/lib/utils/params.js +1 -1
  365. package/lib/utils/platform.js +1 -1
  366. package/lib/utils/sleep.js +1 -1
  367. package/lib/utils/template-replacer.js +1 -1
  368. package/lib/utils/update-notice.js +1 -1
  369. package/lib/utils/version.js +1 -1
  370. package/lib/utils/with-active-cookie.js +1 -1
  371. package/lib/utils/write-cli-side-channel.js +1 -1
  372. package/package.json +4 -4
  373. package/skills/rabetbase/SKILL.md +1 -1
  374. package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
  375. package/skills/rabetbase-page-generation/SKILL.md +1 -1
  376. package/skills/rabetbase.manifest.json +3 -3
@@ -1 +1 @@
1
- const a232_0x5c42dd=a232_0x5613;function a232_0x14fe(){const _0x3a1c4d=['roleName','1161966VUZvMK','dev','Role\x20','Show\x20a\x20single\x20role\x27s\x20detail','9569DOcEKs','534600UjJUTP','appCode','32VVFDIx','num','read','515961gWezMk','2233884ajHDhy','1563528vWtbNI','4795000KCilPh','detail','1416fmuchB','role','1xOraoy'];a232_0x14fe=function(){return _0x3a1c4d;};return a232_0x14fe();}function a232_0x5613(_0x255247,_0x408e6b){_0x255247=_0x255247-0x7c;const _0x14fe77=a232_0x14fe();let _0x5613a3=_0x14fe77[_0x255247];return _0x5613a3;}(function(_0x7619b4,_0x50acc5){const _0x25a58b=a232_0x5613,_0x544655=_0x7619b4();while(!![]){try{const _0x8b043=-parseInt(_0x25a58b(0x88))/0x1*(parseInt(_0x25a58b(0x8a))/0x2)+parseInt(_0x25a58b(0x83))/0x3+parseInt(_0x25a58b(0x82))/0x4+-parseInt(_0x25a58b(0x7c))/0x5+parseInt(_0x25a58b(0x86))/0x6*(-parseInt(_0x25a58b(0x8e))/0x7)+-parseInt(_0x25a58b(0x7e))/0x8*(parseInt(_0x25a58b(0x81))/0x9)+parseInt(_0x25a58b(0x84))/0xa;if(_0x8b043===_0x50acc5)break;else _0x544655['push'](_0x544655['shift']());}catch(_0x577d6e){_0x544655['push'](_0x544655['shift']());}}}(a232_0x14fe,0x4df54));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_0x5c42dd(0x87),'command':a232_0x5c42dd(0x85),'description':a232_0x5c42dd(0x8d),'risk':a232_0x5c42dd(0x80),'flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x414f70){const _0x3c68bc=a232_0x5c42dd,_0x3fcab9=_0x414f70[_0x3c68bc(0x7f)]('id'),_0x1b4eb0=await getRoleById(_0x414f70[_0x3c68bc(0x7d)],_0x3fcab9);return{'ok':!![],'data':{'scope':_0x3c68bc(0x8b),'role':projectRole(_0x1b4eb0)},'message':_0x3c68bc(0x8c)+_0x1b4eb0[_0x3c68bc(0x89)]+'\x20('+_0x1b4eb0['roleType']+')'};}};
1
+ function a232_0x3dc4(_0x2c9453,_0x4580b0){_0x2c9453=_0x2c9453-0x1be;const _0x13dec2=a232_0x13de();let _0x3dc4b0=_0x13dec2[_0x2c9453];return _0x3dc4b0;}const a232_0x4c7ed4=a232_0x3dc4;(function(_0x5027f5,_0x3b987d){const _0x45b0bf=a232_0x3dc4,_0x26eabe=_0x5027f5();while(!![]){try{const _0x877080=parseInt(_0x45b0bf(0x1c1))/0x1*(parseInt(_0x45b0bf(0x1d0))/0x2)+-parseInt(_0x45b0bf(0x1cd))/0x3+-parseInt(_0x45b0bf(0x1d1))/0x4*(-parseInt(_0x45b0bf(0x1c8))/0x5)+parseInt(_0x45b0bf(0x1c5))/0x6*(parseInt(_0x45b0bf(0x1c2))/0x7)+-parseInt(_0x45b0bf(0x1c6))/0x8+parseInt(_0x45b0bf(0x1c4))/0x9*(-parseInt(_0x45b0bf(0x1bf))/0xa)+-parseInt(_0x45b0bf(0x1ce))/0xb*(-parseInt(_0x45b0bf(0x1c9))/0xc);if(_0x877080===_0x3b987d)break;else _0x26eabe['push'](_0x26eabe['shift']());}catch(_0x24f955){_0x26eabe['push'](_0x26eabe['shift']());}}}(a232_0x13de,0x90fb3));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getRoleById,projectRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a232_0x13de(){const _0x4e007f=['roleType','495VzWwrG','37524XaYiav','detail','role','roleName','811902CtjKkd','1243Unvoxe','appCode','55994tJZdAn','224NUdmcN','num','830EVMlnU','Show\x20a\x20single\x20role\x27s\x20detail','8KzfRzC','1749769xSmrEJ','dev','9981xFyWyG','18HZXCWQ','3009984umvBfR'];a232_0x13de=function(){return _0x4e007f;};return a232_0x13de();}export const roleDetail={'service':a232_0x4c7ed4(0x1cb),'command':a232_0x4c7ed4(0x1ca),'description':a232_0x4c7ed4(0x1c0),'risk':'read','flags':[ROLE_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x19f771){const _0x3e96d5=a232_0x4c7ed4,_0x8cb4aa=_0x19f771[_0x3e96d5(0x1be)]('id'),_0x4f5f6c=await getRoleById(_0x19f771[_0x3e96d5(0x1cf)],_0x8cb4aa);return{'ok':!![],'data':{'scope':_0x3e96d5(0x1c3),'role':projectRole(_0x4f5f6c)},'message':'Role\x20'+_0x4f5f6c[_0x3e96d5(0x1cc)]+'\x20('+_0x4f5f6c[_0x3e96d5(0x1c7)]+')'};}};
@@ -1 +1 @@
1
- (function(_0x3550ac,_0x686be6){const _0x50b5f2=a233_0x2025,_0x3eb09b=_0x3550ac();while(!![]){try{const _0x211f8d=-parseInt(_0x50b5f2(0xe8))/0x1+parseInt(_0x50b5f2(0xe9))/0x2+-parseInt(_0x50b5f2(0xe5))/0x3*(parseInt(_0x50b5f2(0xec))/0x4)+-parseInt(_0x50b5f2(0xea))/0x5*(parseInt(_0x50b5f2(0xeb))/0x6)+parseInt(_0x50b5f2(0xe7))/0x7+parseInt(_0x50b5f2(0xe4))/0x8*(parseInt(_0x50b5f2(0xe3))/0x9)+parseInt(_0x50b5f2(0xed))/0xa*(parseInt(_0x50b5f2(0xe6))/0xb);if(_0x211f8d===_0x686be6)break;else _0x3eb09b['push'](_0x3eb09b['shift']());}catch(_0x571f9a){_0x3eb09b['push'](_0x3eb09b['shift']());}}}(a233_0x2c8a,0x73379));import{roleList}from'../../commands/role/list.js';function a233_0x2025(_0x7e0e92,_0x697c2c){_0x7e0e92=_0x7e0e92-0xe3;const _0x2c8a1f=a233_0x2c8a();let _0x2025a1=_0x2c8a1f[_0x7e0e92];return _0x2025a1;}import{roleDetail}from'../../commands/role/detail.js';import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';function a233_0x2c8a(){const _0x391f1a=['4164emMljR','11UFlacG','5026994NrDQVO','886669NvVyVk','1149906nERzja','5mlDqVq','4883178tycgWf','1384anRZkY','5881990wCpslC','639tJpwRg','86920mRTPrd'];a233_0x2c8a=function(){return _0x391f1a;};return a233_0x2c8a();}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(_0x990e4e,_0x162594){const _0x3cd36d=a233_0x2de2,_0x3797b7=_0x990e4e();while(!![]){try{const _0xc58b37=-parseInt(_0x3cd36d(0x1e8))/0x1*(parseInt(_0x3cd36d(0x1e9))/0x2)+parseInt(_0x3cd36d(0x1e4))/0x3*(parseInt(_0x3cd36d(0x1e2))/0x4)+parseInt(_0x3cd36d(0x1e0))/0x5+parseInt(_0x3cd36d(0x1e5))/0x6+parseInt(_0x3cd36d(0x1e1))/0x7*(parseInt(_0x3cd36d(0x1e7))/0x8)+-parseInt(_0x3cd36d(0x1e6))/0x9+-parseInt(_0x3cd36d(0x1e3))/0xa;if(_0xc58b37===_0x162594)break;else _0x3797b7['push'](_0x3797b7['shift']());}catch(_0xf09785){_0x3797b7['push'](_0x3797b7['shift']());}}}(a233_0x27ed,0x84403));function a233_0x27ed(){const _0x3e7eb1=['4lFfUic','373174OrVyuI','4827380VYoDwY','7kxNHHb','1356PesClh','13102400OkYron','8859RkJjyg','5876856wcVmDp','8765910QflhbU','5010064tfJklN'];a233_0x27ed=function(){return _0x3e7eb1;};return a233_0x27ed();}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';function a233_0x2de2(_0x1980e0,_0x43dbce){_0x1980e0=_0x1980e0-0x1e0;const _0x27ed48=a233_0x27ed();let _0x2de2d=_0x27ed48[_0x1980e0];return _0x2de2d;}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 +1 @@
1
- const a234_0x387f86=a234_0xccab;function a234_0x13f4(){const _0x344fcb=['list','roleType','length','--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.','161753qMRLtP','152510xDmItK','2269287plmMgk','Filter\x20by\x20role\x20type','4668pEfyvb','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','string','\x20role(s)','OWNER','num','read','List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','pagesize','page','DEV','trim','4FTkHfr','8682710pYvSnb','dev','5245gMfJNe','type','3642056WWShGd','CUSTOM','ADMIN','role','10089959aCFbcK','24PhrbYx','str','Page\x20index\x20(1-based)','Invalid\x20--type\x20\x22','7hzQItU','validation','join','9cPSXGl','toUpperCase','number'];a234_0x13f4=function(){return _0x344fcb;};return a234_0x13f4();}(function(_0x3bb7c8,_0x518655){const _0x4c45f3=a234_0xccab,_0xcb2f25=_0x3bb7c8();while(!![]){try{const _0x556c2c=-parseInt(_0x4c45f3(0x141))/0x1+-parseInt(_0x4c45f3(0x142))/0x2+parseInt(_0x4c45f3(0x143))/0x3*(-parseInt(_0x4c45f3(0x129))/0x4)+parseInt(_0x4c45f3(0x12c))/0x5*(-parseInt(_0x4c45f3(0x145))/0x6)+parseInt(_0x4c45f3(0x137))/0x7*(-parseInt(_0x4c45f3(0x12e))/0x8)+parseInt(_0x4c45f3(0x13a))/0x9*(parseInt(_0x4c45f3(0x12a))/0xa)+parseInt(_0x4c45f3(0x132))/0xb*(parseInt(_0x4c45f3(0x133))/0xc);if(_0x556c2c===_0x518655)break;else _0xcb2f25['push'](_0xcb2f25['shift']());}catch(_0x2fc79c){_0xcb2f25['push'](_0xcb2f25['shift']());}}}(a234_0x13f4,0x6ab01));import{listAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a234_0xccab(_0x520d25,_0x409112){_0x520d25=_0x520d25-0x123;const _0x13f47f=a234_0x13f4();let _0xccab69=_0x13f47f[_0x520d25];return _0xccab69;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=[a234_0x387f86(0x130),a234_0x387f86(0x127),a234_0x387f86(0x149),a234_0x387f86(0x12f)];export const roleList={'service':a234_0x387f86(0x131),'command':a234_0x387f86(0x13d),'description':a234_0x387f86(0x124),'risk':a234_0x387f86(0x123),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a234_0x387f86(0x12d),'type':a234_0x387f86(0x147),'required':![],'description':a234_0x387f86(0x144),'enum':ROLE_TYPES},{'name':a234_0x387f86(0x126),'type':a234_0x387f86(0x13c),'description':a234_0x387f86(0x135),'default':0x1},{'name':'pagesize','type':a234_0x387f86(0x13c),'description':'Page\x20size\x20(1-100)','default':0x64}],async 'validate'(_0x1a20c4){const _0x75de04=a234_0x387f86,_0x564f4e=_0x1a20c4[_0x75de04(0x134)](_0x75de04(0x12d))[_0x75de04(0x128)]();if(_0x564f4e&&!ROLE_TYPES['includes'](_0x564f4e[_0x75de04(0x13b)]()))throw CliErrors[_0x75de04(0x138)](_0x75de04(0x136)+_0x564f4e+'\x22.','Use\x20one\x20of:\x20'+ROLE_TYPES[_0x75de04(0x139)](',\x20')+'.');const _0x2c5192=_0x1a20c4[_0x75de04(0x14a)](_0x75de04(0x126),0x1),_0x5239b0=_0x1a20c4[_0x75de04(0x14a)](_0x75de04(0x125),0x64);if(_0x2c5192<0x1)throw CliErrors[_0x75de04(0x138)](_0x75de04(0x140));if(_0x5239b0<0x1||_0x5239b0>0x64)throw CliErrors[_0x75de04(0x138)](_0x75de04(0x146));},async 'execute'(_0x59616d){const _0x2afa69=a234_0x387f86,_0x197272=_0x59616d[_0x2afa69(0x14a)](_0x2afa69(0x126),0x1)||0x1,_0x2c3054=_0x59616d[_0x2afa69(0x14a)]('pagesize',0x64)||0x64,_0x5565fc=_0x59616d[_0x2afa69(0x134)]('type')[_0x2afa69(0x128)]()[_0x2afa69(0x13b)](),{items:_0x3bc91c,paging:_0x59b564}=await listAppRoles(_0x59616d['appCode'],{'currentPage':_0x197272,'pageSize':_0x2c3054}),_0x216c6d=_0x5565fc?_0x3bc91c['filter'](_0x452e8f=>_0x452e8f[_0x2afa69(0x13e)]===_0x5565fc):_0x3bc91c,_0x253872=_0x216c6d['map'](projectRole);return{'ok':!![],'data':{'scope':_0x2afa69(0x12b),'roles':_0x253872,'paging':_0x59b564},'message':'Found\x20'+_0x253872[_0x2afa69(0x13f)]+_0x2afa69(0x148)};}};
1
+ const a234_0x2a75f9=a234_0x36f3;function a234_0x36f3(_0x535261,_0x54605e){_0x535261=_0x535261-0xd6;const _0x5813af=a234_0x5813();let _0x36f399=_0x5813af[_0x535261];return _0x36f399;}(function(_0x447fd3,_0x2dc583){const _0x146b8c=a234_0x36f3,_0x2a0b36=_0x447fd3();while(!![]){try{const _0x519c0=-parseInt(_0x146b8c(0xed))/0x1+-parseInt(_0x146b8c(0xf2))/0x2+parseInt(_0x146b8c(0xf5))/0x3*(parseInt(_0x146b8c(0xea))/0x4)+-parseInt(_0x146b8c(0xe4))/0x5*(parseInt(_0x146b8c(0xe3))/0x6)+-parseInt(_0x146b8c(0xd6))/0x7+-parseInt(_0x146b8c(0xe9))/0x8+parseInt(_0x146b8c(0xe2))/0x9;if(_0x519c0===_0x2dc583)break;else _0x2a0b36['push'](_0x2a0b36['shift']());}catch(_0x2d5c28){_0x2a0b36['push'](_0x2a0b36['shift']());}}}(a234_0x5813,0x5a710));import{listAppRoles}from'../../core/api-client.js';function a234_0x5813(){const _0x356f15=['9wcbEJt','length','page','dev','5157124TCImqC','OWNER','filter','validation','number','CUSTOM','str','Found\x20','--pagesize\x20must\x20be\x20between\x201\x20and\x20100.','includes','join','Use\x20one\x20of:\x20','26602911qzxeBC','12tumjaJ','1264565aWunup','num','trim','Invalid\x20--type\x20\x22','type','5436176ByLiKf','126716gQPgDA','appCode','\x20role(s)','30843zaFMqI','Filter\x20by\x20role\x20type','toUpperCase','roleType','pagesize','1455090yMjwCE','DEV','read'];a234_0x5813=function(){return _0x356f15;};return a234_0x5813();}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectRole}from'../../commands/role/shared.js';const ROLE_TYPES=['ADMIN',a234_0x2a75f9(0xf3),a234_0x2a75f9(0xd7),a234_0x2a75f9(0xdb)];export const roleList={'service':'role','command':'list','description':'List\x20user\x20groups\x20(roles)\x20for\x20the\x20current\x20app','risk':a234_0x2a75f9(0xf4),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a234_0x2a75f9(0xe8),'type':'string','required':![],'description':a234_0x2a75f9(0xee),'enum':ROLE_TYPES},{'name':'page','type':a234_0x2a75f9(0xda),'description':'Page\x20index\x20(1-based)','default':0x1},{'name':a234_0x2a75f9(0xf1),'type':'number','description':'Page\x20size\x20(1-100)','default':0x64}],async 'validate'(_0x5cb6b5){const _0x40226e=a234_0x2a75f9,_0x59c223=_0x5cb6b5[_0x40226e(0xdc)]('type')[_0x40226e(0xe6)]();if(_0x59c223&&!ROLE_TYPES[_0x40226e(0xdf)](_0x59c223[_0x40226e(0xef)]()))throw CliErrors['validation'](_0x40226e(0xe7)+_0x59c223+'\x22.',_0x40226e(0xe1)+ROLE_TYPES[_0x40226e(0xe0)](',\x20')+'.');const _0x4133da=_0x5cb6b5[_0x40226e(0xe5)](_0x40226e(0xf7),0x1),_0x1077e9=_0x5cb6b5['num'](_0x40226e(0xf1),0x64);if(_0x4133da<0x1)throw CliErrors[_0x40226e(0xd9)]('--page\x20must\x20be\x20greater\x20than\x20or\x20equal\x20to\x201.');if(_0x1077e9<0x1||_0x1077e9>0x64)throw CliErrors[_0x40226e(0xd9)](_0x40226e(0xde));},async 'execute'(_0x4658c1){const _0x4fcaf1=a234_0x2a75f9,_0x8605b8=_0x4658c1['num'](_0x4fcaf1(0xf7),0x1)||0x1,_0x15c3a3=_0x4658c1[_0x4fcaf1(0xe5)](_0x4fcaf1(0xf1),0x64)||0x64,_0x4d74db=_0x4658c1[_0x4fcaf1(0xdc)](_0x4fcaf1(0xe8))[_0x4fcaf1(0xe6)]()[_0x4fcaf1(0xef)](),{items:_0x2929d0,paging:_0x1d0022}=await listAppRoles(_0x4658c1[_0x4fcaf1(0xeb)],{'currentPage':_0x8605b8,'pageSize':_0x15c3a3}),_0x3b1160=_0x4d74db?_0x2929d0[_0x4fcaf1(0xd8)](_0x5d6239=>_0x5d6239[_0x4fcaf1(0xf0)]===_0x4d74db):_0x2929d0,_0x4f62e0=_0x3b1160['map'](projectRole);return{'ok':!![],'data':{'scope':_0x4fcaf1(0xf8),'roles':_0x4f62e0,'paging':_0x1d0022},'message':_0x4fcaf1(0xdd)+_0x4f62e0[_0x4fcaf1(0xf6)]+_0x4fcaf1(0xec)};}};
@@ -1 +1 @@
1
- const a235_0x1446c5=a235_0x2529;(function(_0x5ab451,_0x78a6cf){const _0x223b8d=a235_0x2529,_0x4d065a=_0x5ab451();while(!![]){try{const _0x35eeed=parseInt(_0x223b8d(0x9f))/0x1*(-parseInt(_0x223b8d(0xc6))/0x2)+-parseInt(_0x223b8d(0xc1))/0x3*(parseInt(_0x223b8d(0x97))/0x4)+-parseInt(_0x223b8d(0xa5))/0x5*(-parseInt(_0x223b8d(0xba))/0x6)+parseInt(_0x223b8d(0x8c))/0x7+parseInt(_0x223b8d(0x81))/0x8+parseInt(_0x223b8d(0xa6))/0x9+parseInt(_0x223b8d(0xca))/0xa;if(_0x35eeed===_0x78a6cf)break;else _0x4d065a['push'](_0x4d065a['shift']());}catch(_0x43639a){_0x4d065a['push'](_0x4d065a['shift']());}}}(a235_0x5132,0xd0206));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_0x1446c5(0x9d),'required':!![],'description':a235_0x1446c5(0xae)};export const ROLE_REF_FLAG={'name':a235_0x1446c5(0xc9),'type':a235_0x1446c5(0xb8),'required':!![],'description':'Role\x20id\x20or\x20exact\x20role\x20name'};export const USER_REF_FLAG={'name':a235_0x1446c5(0x7f),'type':'string','required':!![],'description':a235_0x1446c5(0x93)};function a235_0x5132(){const _0x34d7a8=['validation','Cannot\x20','flag','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','filter','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','appCode','4501424pevLEl','userId','/smartapi/permit/user-role/create','\x20is\x20not\x20a\x20member\x20of\x20role\x20','\x20is\x20already\x20a\x20member\x20of\x20role\x20','tenant','number','\x20members\x20of\x20the\x20OWNER\x20role.','141593MycGUJ','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','\x22\x20is\x20ambiguous\x20(ids:\x20','Disambiguate\x20with\x20--role\x20<id>.','\x20built-in\x20role\x20','remark','505ZoTGPI','5002704vontyK',';\x20no\x20change.','Role\x20id\x20','map','Multiple\x20tenant\x20members\x20match\x20\x22','roleType','test','Role\x20name\x20\x22','Role\x20id\x20(from\x20`role\x20list`)','totalCount','\x20duplicate\x20memberships\x20for\x20user\x20','\x22:\x20','str','/smartapi/permit/user-role/delete','\x20member(s)\x20but\x20role\x20has\x20','Missing\x20role\x20reference.','name','Missing\x20user\x20reference.','string','join','8754wFcLVV','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','Check\x20the\x20nickname/username.\x20','\x20not\x20found\x20in\x20app\x20','nickname','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','Pass\x20--user\x20<id|name>.','3CRRbCN','POST','find','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','trim','12rwocWE','Pass\x20--role\x20<id|name>.','tenant_code','role','3786430nwFUoE','ADMIN','push','dev','username','User\x20','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','user','expectUserCount','3579000RKsODX','Removed\x20','includes','flagMissing','OWNER','length','Pass\x20--user\x20<id>.','toLowerCase','userCount','Role\x20name','CUSTOM','9087169pNUIQI','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','user-add','roleName'];a235_0x5132=function(){return _0x34d7a8;};return a235_0x5132();}export const NAME_FLAG={'name':a235_0x1446c5(0xb6),'type':a235_0x1446c5(0xb8),'required':!![],'description':a235_0x1446c5(0x8a)};export const USER_NAME_FLAG={'name':a235_0x1446c5(0xb6),'type':a235_0x1446c5(0xb8),'required':!![],'description':a235_0x1446c5(0x95)};export const REMARK_FLAG={'name':'remark','type':a235_0x1446c5(0xb8),'required':![],'description':'Optional\x20role\x20remark/description'};export const EXPECT_USER_COUNT_FLAG={'name':'expect-user-count','type':a235_0x1446c5(0x9d),'required':![],'description':'Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs'};export const BUILTIN_ROLE_TYPES=[a235_0x1446c5(0x79),'DEV','OWNER'];export function isBuiltinRole(_0x1fde32){return BUILTIN_ROLE_TYPES['includes'](_0x1fde32);}export function assertCustomRole(_0x4f4d3f,_0x296503){const _0x537327=a235_0x1446c5;if(_0x4f4d3f[_0x537327(0xab)]!==_0x537327(0x8b))throw CliErrors[_0x537327(0x90)](_0x537327(0x91)+_0x296503+_0x537327(0xa3)+_0x4f4d3f[_0x537327(0x8f)]+'\x20('+_0x4f4d3f[_0x537327(0xab)]+').',_0x537327(0x7e));}export function projectRole(_0x3ecdea){const _0x802293=a235_0x1446c5;return{'id':_0x3ecdea['id'],'roleName':_0x3ecdea['roleName'],'roleType':_0x3ecdea[_0x802293(0xab)],'remark':_0x3ecdea[_0x802293(0xa4)],'userCount':_0x3ecdea[_0x802293(0x89)],'permitCount':_0x3ecdea['permitCount'],'builtin':isBuiltinRole(_0x3ecdea[_0x802293(0xab)])};}function a235_0x2529(_0x4271ac,_0x211d51){_0x4271ac=_0x4271ac-0x79;const _0x513288=a235_0x5132();let _0x25291b=_0x513288[_0x4271ac];return _0x25291b;}export async function resolveRoleRef(_0x1ec2d5,_0x23d10c){const _0x265e86=a235_0x1446c5,_0x4d1a89=_0x23d10c['trim']();if(!_0x4d1a89)throw CliErrors[_0x265e86(0x90)](_0x265e86(0xb5),_0x265e86(0xc7));if(/^\d+$/[_0x265e86(0xac)](_0x4d1a89))return getRoleById(_0x1ec2d5,Number(_0x4d1a89));const _0x33c1e4=await listAllAppRoles(_0x1ec2d5),_0x3fd91d=_0x33c1e4[_0x265e86(0x94)](_0x49ee13=>_0x49ee13['roleName']===_0x4d1a89);if(_0x3fd91d[_0x265e86(0x86)]===0x0)throw CliErrors[_0x265e86(0x90)](_0x265e86(0xad)+_0x4d1a89+'\x22\x20not\x20found\x20in\x20app\x20'+_0x1ec2d5+'.',_0x265e86(0x8d));if(_0x3fd91d['length']>0x1){const _0x1f63d5=_0x3fd91d[_0x265e86(0xa9)](_0x476300=>_0x476300['id'])[_0x265e86(0xb9)](',\x20');throw CliErrors[_0x265e86(0x90)](_0x265e86(0xad)+_0x4d1a89+_0x265e86(0xa1)+_0x1f63d5+').',_0x265e86(0xa2));}return _0x3fd91d[0x0];}export async function getRoleById(_0x367f19,_0x4246fd){const _0x2a60bb=a235_0x1446c5,_0x561a34=await listAllAppRoles(_0x367f19),_0x76e97c=_0x561a34[_0x2a60bb(0x94)](_0x3e0872=>_0x3e0872['id']===_0x4246fd&&(!_0x3e0872[_0x2a60bb(0x96)]||_0x3e0872['appCode']===_0x367f19));if(_0x76e97c[_0x2a60bb(0x86)]!==0x1)throw CliErrors[_0x2a60bb(0x90)](_0x2a60bb(0xa8)+_0x4246fd+_0x2a60bb(0xbd)+_0x367f19+'.',_0x2a60bb(0xbb));return _0x76e97c[0x0];}async function listAllAppRoles(_0x8b8609){const _0x45f606=a235_0x1446c5,_0x54b684=0x64,_0x18c853=[];for(let _0x4187e0=0x1;;_0x4187e0+=0x1){const {items:_0x42b065,paging:_0x3d5ea2}=await listAppRoles(_0x8b8609,{'currentPage':_0x4187e0,'pageSize':_0x54b684});_0x18c853[_0x45f606(0x7a)](..._0x42b065);if(_0x42b065[_0x45f606(0x86)]<_0x54b684||_0x3d5ea2&&_0x18c853['length']>=_0x3d5ea2[_0x45f606(0xaf)])return _0x18c853;}}export async function resolveTenantCode(){const _0x742e8d=a235_0x1446c5,_0x55083a=await getSessionUserInfo(),_0x5ce7ae=_0x55083a?.[_0x742e8d(0x7f)]?.[_0x742e8d(0x9c)]?.[_0x742e8d(0xc8)];if(!_0x5ce7ae)throw CliErrors['authRequired'](_0x742e8d(0xc4));return _0x5ce7ae;}function matchMember(_0x22e12b,_0x160dc6){const _0x35cc21=a235_0x1446c5,_0x5cfd26=_0x160dc6['trim']()[_0x35cc21(0x88)]();return(_0x22e12b['nickname']??'')['toLowerCase']()===_0x5cfd26||(_0x22e12b[_0x35cc21(0x7c)]??'')[_0x35cc21(0x88)]()===_0x5cfd26;}export async function resolveUserRef(_0x18cc04,_0x55d692=a235_0x1446c5(0x87)){const _0x56c32f=a235_0x1446c5,_0x30f62c=_0x18cc04['trim']();if(!_0x30f62c)throw CliErrors[_0x56c32f(0x90)](_0x56c32f(0xb7),_0x56c32f(0xc0));const _0x38a718=await resolveTenantCode(),_0x508bf0=await getTenantMembers(_0x38a718);if(/^\d+$/['test'](_0x30f62c)){const _0xa540e5=Number(_0x30f62c),_0x2f6115=_0x508bf0[_0x56c32f(0xc3)](_0x31a5ea=>_0x31a5ea['userId']===_0xa540e5);return{'userId':_0xa540e5,'username':_0x2f6115?.[_0x56c32f(0x7c)]??String(_0xa540e5),'nickname':_0x2f6115?.[_0x56c32f(0xbe)],'matchedBy':'id'};}const _0xc4490d=_0x508bf0['filter'](_0x3f7202=>matchMember(_0x3f7202,_0x30f62c));if(_0xc4490d[_0x56c32f(0x86)]===0x0)throw CliErrors[_0x56c32f(0x90)]('No\x20tenant\x20member\x20matches\x20\x22'+_0x30f62c+'\x22.',_0x56c32f(0xbc)+_0x55d692);if(_0xc4490d[_0x56c32f(0x86)]>0x1){const _0x3c6c63=_0xc4490d[_0x56c32f(0xa9)](_0x3c9625=>(_0x3c9625[_0x56c32f(0xbe)]??_0x3c9625['username']??'?')+'('+_0x3c9625[_0x56c32f(0x98)]+')')[_0x56c32f(0xb9)](',\x20');throw CliErrors[_0x56c32f(0x90)](_0x56c32f(0xaa)+_0x30f62c+_0x56c32f(0xb1)+_0x3c6c63+'.',_0x55d692);}const _0x139381=_0xc4490d[0x0];return{'userId':_0x139381[_0x56c32f(0x98)],'username':_0x139381[_0x56c32f(0x7c)]??String(_0x139381['userId']),'nickname':_0x139381[_0x56c32f(0xbe)],'matchedBy':'name'};}export const CREATE_USER_ROLE_PATH=a235_0x1446c5(0x99);export const DELETE_USER_ROLE_PATH=a235_0x1446c5(0xb3);export function computeRoleUserMutation(_0x47c654){const _0x5b6cfc=a235_0x1446c5,{operation:_0x2289f2,appCode:_0x533262,role:_0x422678,relations:_0x19da78,user:_0x4cfb70}=_0x47c654,_0x2a16bd=[...new Set(_0x19da78['map'](_0x5e5e05=>_0x5e5e05[_0x5b6cfc(0x98)]))],_0x1f0423=[];if(_0x47c654[_0x5b6cfc(0x80)]!==undefined&&_0x47c654[_0x5b6cfc(0x80)]!==_0x2a16bd['length'])throw CliErrors[_0x5b6cfc(0x90)]('Anti-drift\x20check\x20failed:\x20expected\x20'+_0x47c654[_0x5b6cfc(0x80)]+_0x5b6cfc(0xb4)+_0x2a16bd[_0x5b6cfc(0x86)]+'.',_0x5b6cfc(0xa0));const _0x27b866=_0x2a16bd[_0x5b6cfc(0x83)](_0x4cfb70[_0x5b6cfc(0x98)]),_0xb0efe6=_0x19da78['filter'](_0x458ec6=>_0x458ec6[_0x5b6cfc(0x98)]===_0x4cfb70[_0x5b6cfc(0x98)])['map'](_0x2279ae=>_0x2279ae['id']),_0xc79e0b=_0x2289f2===_0x5b6cfc(0x8e)?!_0x27b866:_0x27b866;let _0x2d067e=_0x2a16bd;_0x2289f2==='user-add'?_0x27b866?_0x1f0423[_0x5b6cfc(0x7a)](_0x5b6cfc(0x7d)+_0x4cfb70[_0x5b6cfc(0x98)]+_0x5b6cfc(0x9b)+_0x422678[_0x5b6cfc(0x8f)]+_0x5b6cfc(0xa7)):_0x2d067e=[..._0x2a16bd,_0x4cfb70['userId']]:!_0x27b866?_0x1f0423[_0x5b6cfc(0x7a)](_0x5b6cfc(0x7d)+_0x4cfb70[_0x5b6cfc(0x98)]+_0x5b6cfc(0x9a)+_0x422678[_0x5b6cfc(0x8f)]+_0x5b6cfc(0xa7)):(_0x2d067e=_0x2a16bd['filter'](_0x3f0c6e=>_0x3f0c6e!==_0x4cfb70['userId']),_0xb0efe6[_0x5b6cfc(0x86)]>0x1&&_0x1f0423['push'](_0x5b6cfc(0x82)+_0xb0efe6[_0x5b6cfc(0x86)]+_0x5b6cfc(0xb0)+_0x4cfb70[_0x5b6cfc(0x98)]+'.'));const _0x4ad5c3={'scope':_0x5b6cfc(0x7b),'operation':_0x2289f2,'selector':{'appCode':_0x533262,'roleId':_0x422678['id'],'roleName':_0x422678[_0x5b6cfc(0x8f)],'userId':_0x4cfb70[_0x5b6cfc(0x98)]},'before':{'userIds':_0x2a16bd},'after':{'userIds':_0x2d067e},'dryRun':_0x47c654['dryRun'],'backend':{'method':_0x5b6cfc(0xc2),'path':_0x2289f2===_0x5b6cfc(0x8e)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x1f0423};return{'mutation':_0x4ad5c3,'changed':_0xc79e0b,'matchingRelationIds':_0xb0efe6};}export async function loadDevRoleRelations(_0xff7f32,_0x5cec9e){const _0x97f22b=a235_0x1446c5,_0x839798=0x64,_0x927835=[];for(let _0x1a6cfd=0x1;;_0x1a6cfd+=0x1){const {items:_0x333af8,paging:_0x14b711}=await listDevUserRoleRelations(_0xff7f32,{'roleId':_0x5cec9e,'currentPage':_0x1a6cfd,'pageSize':_0x839798});_0x927835['push'](..._0x333af8);if(_0x333af8[_0x97f22b(0x86)]<_0x839798||_0x14b711&&_0x927835[_0x97f22b(0x86)]>=_0x14b711[_0x97f22b(0xaf)])return _0x927835;}}export function readRoleRef(_0xdb7d1d){const _0x1fc5b1=a235_0x1446c5,_0x53208e=_0xdb7d1d[_0x1fc5b1(0xb2)](_0x1fc5b1(0xc9))[_0x1fc5b1(0xc5)]();if(!_0x53208e)throw CliErrors['flagMissing']('role',_0x1fc5b1(0xc7));return _0x53208e;}export async function prepareUserMutation(_0x272ba6,_0x703ffd,_0xba954c){const _0x3b4132=a235_0x1446c5,_0x524276=readRoleRef(_0x272ba6),_0x52fb6d=_0x272ba6[_0x3b4132(0xb2)](_0x3b4132(0x7f))['trim']();if(!_0x52fb6d)throw CliErrors[_0x3b4132(0x84)](_0x3b4132(0x7f),_0x3b4132(0xc0));const _0x471ea8=_0x272ba6[_0x3b4132(0x92)]('expect-user-count'),_0x408618=_0x471ea8===undefined||_0x471ea8===null?undefined:Number(_0x471ea8),_0x5cf2a2=await resolveRoleRef(_0x272ba6[_0x3b4132(0x96)],_0x524276);if(_0x5cf2a2['roleType']===_0x3b4132(0x85))throw CliErrors['validation'](_0x3b4132(0x91)+_0x703ffd+_0x3b4132(0x9e),_0x3b4132(0xbf));const _0xc982f7=await resolveUserRef(_0x52fb6d),_0x4426c8=await loadDevRoleRelations(_0x272ba6[_0x3b4132(0x96)],_0x5cf2a2['id']);return{...computeRoleUserMutation({'operation':_0x703ffd,'appCode':_0x272ba6[_0x3b4132(0x96)],'role':_0x5cf2a2,'relations':_0x4426c8,'user':{'userId':_0xc982f7[_0x3b4132(0x98)],'username':_0xc982f7['username'],'nickname':_0xc982f7[_0x3b4132(0xbe)]},'dryRun':_0xba954c,..._0x408618!==undefined?{'expectUserCount':_0x408618}:{}}),'role':_0x5cf2a2,'user':_0xc982f7};}
1
+ function a235_0x7479(_0x13b43c,_0x4176fd){_0x13b43c=_0x13b43c-0xb7;const _0x22c641=a235_0x22c6();let _0x74796d=_0x22c641[_0x13b43c];return _0x74796d;}const a235_0x341aaf=a235_0x7479;(function(_0xa8c8bc,_0x4c22af){const _0x3faec2=a235_0x7479,_0x253ccf=_0xa8c8bc();while(!![]){try{const _0x5a914e=-parseInt(_0x3faec2(0xf6))/0x1+-parseInt(_0x3faec2(0xcd))/0x2*(parseInt(_0x3faec2(0xba))/0x3)+-parseInt(_0x3faec2(0xf9))/0x4*(-parseInt(_0x3faec2(0xce))/0x5)+parseInt(_0x3faec2(0xc5))/0x6+-parseInt(_0x3faec2(0xe2))/0x7+-parseInt(_0x3faec2(0xc4))/0x8*(-parseInt(_0x3faec2(0xef))/0x9)+parseInt(_0x3faec2(0xf7))/0xa;if(_0x5a914e===_0x4c22af)break;else _0x253ccf['push'](_0x253ccf['shift']());}catch(_0x4170cc){_0x253ccf['push'](_0x253ccf['shift']());}}}(a235_0x22c6,0x68fb8));import{getTenantMembers,listDevUserRoleRelations,listAppRoles}from'../../core/api-client.js';import{getSessionUserInfo}from'../../auth/get-session-user.js';import{CliErrors}from'../../errors.js';export const ROLE_ID_FLAG={'name':'id','type':'number','required':!![],'description':a235_0x341aaf(0xc1)};export const ROLE_REF_FLAG={'name':a235_0x341aaf(0xdb),'type':'string','required':!![],'description':a235_0x341aaf(0xff)};export const USER_REF_FLAG={'name':a235_0x341aaf(0xca),'type':a235_0x341aaf(0xd7),'required':!![],'description':a235_0x341aaf(0xec)};export const NAME_FLAG={'name':'name','type':'string','required':!![],'description':a235_0x341aaf(0xd9)};export const USER_NAME_FLAG={'name':'name','type':a235_0x341aaf(0xd7),'required':!![],'description':a235_0x341aaf(0xf3)};export const REMARK_FLAG={'name':a235_0x341aaf(0xe4),'type':a235_0x341aaf(0xd7),'required':![],'description':'Optional\x20role\x20remark/description'};export const EXPECT_USER_COUNT_FLAG={'name':a235_0x341aaf(0xfb),'type':'number','required':![],'description':'Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs'};function a235_0x22c6(){const _0x3bf5c2=['Check\x20the\x20nickname/username.\x20','Pass\x20--user\x20<id|name>.','validation','\x20member(s)\x20but\x20role\x20has\x20','Role\x20name\x20\x22','\x22\x20not\x20found\x20in\x20app\x20','filter','userId','string','find','Role\x20name','nickname','role','toLowerCase','trim','CUSTOM','user-add','OWNER','totalCount','5584488KajItS','Cannot\x20','remark','tenant_code','\x22:\x20','tenant','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.','Anti-drift\x20check\x20failed:\x20expected\x20','\x20built-in\x20role\x20','test','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','str','roleType','594gUuLsl','join','appCode','Role\x20id\x20','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','dev','/smartapi/permit/user-role/delete','325044reDWRR','5066890GuVdAF','permitCount','693580ezacLa','flag','expect-user-count','name','length','username','Role\x20id\x20or\x20exact\x20role\x20name','Missing\x20user\x20reference.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','Pass\x20--role\x20<id|name>.','dryRun','DEV','Removed\x20','POST','ADMIN','134571VHOwbY','includes','expectUserCount','map','flagMissing','User\x20','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','Role\x20id\x20(from\x20`role\x20list`)','push','No\x20tenant\x20member\x20matches\x20\x22','84616WbySCi','80046wpSkyK','\x20is\x20already\x20a\x20member\x20of\x20role\x20','Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.','Pass\x20--user\x20<id>.',';\x20no\x20change.','user','roleName','Multiple\x20tenant\x20members\x20match\x20\x22','16jGdsGO','20qsyNsj'];a235_0x22c6=function(){return _0x3bf5c2;};return a235_0x22c6();}export const BUILTIN_ROLE_TYPES=[a235_0x341aaf(0xb9),a235_0x341aaf(0x104),a235_0x341aaf(0xe0)];export function isBuiltinRole(_0xb34b22){const _0x158b65=a235_0x341aaf;return BUILTIN_ROLE_TYPES[_0x158b65(0xbb)](_0xb34b22);}export function assertCustomRole(_0x55ae41,_0xc7b1e){const _0x3d1982=a235_0x341aaf;if(_0x55ae41[_0x3d1982(0xee)]!==_0x3d1982(0xde))throw CliErrors[_0x3d1982(0xd1)](_0x3d1982(0xe3)+_0xc7b1e+_0x3d1982(0xea)+_0x55ae41['roleName']+'\x20('+_0x55ae41[_0x3d1982(0xee)]+').','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.');}export function projectRole(_0x677094){const _0x526e3f=a235_0x341aaf;return{'id':_0x677094['id'],'roleName':_0x677094['roleName'],'roleType':_0x677094[_0x526e3f(0xee)],'remark':_0x677094[_0x526e3f(0xe4)],'userCount':_0x677094['userCount'],'permitCount':_0x677094[_0x526e3f(0xf8)],'builtin':isBuiltinRole(_0x677094[_0x526e3f(0xee)])};}export async function resolveRoleRef(_0x250b4c,_0x13abf5){const _0x49873b=a235_0x341aaf,_0x3a69ab=_0x13abf5[_0x49873b(0xdd)]();if(!_0x3a69ab)throw CliErrors[_0x49873b(0xd1)]('Missing\x20role\x20reference.',_0x49873b(0x102));if(/^\d+$/[_0x49873b(0xeb)](_0x3a69ab))return getRoleById(_0x250b4c,Number(_0x3a69ab));const _0x55df59=await listAllAppRoles(_0x250b4c),_0x55eafd=_0x55df59[_0x49873b(0xd5)](_0x2c3f7c=>_0x2c3f7c[_0x49873b(0xcb)]===_0x3a69ab);if(_0x55eafd[_0x49873b(0xfd)]===0x0)throw CliErrors[_0x49873b(0xd1)](_0x49873b(0xd3)+_0x3a69ab+_0x49873b(0xd4)+_0x250b4c+'.',_0x49873b(0x101));if(_0x55eafd[_0x49873b(0xfd)]>0x1){const _0x228e41=_0x55eafd[_0x49873b(0xbd)](_0x3337aa=>_0x3337aa['id'])[_0x49873b(0xf0)](',\x20');throw CliErrors[_0x49873b(0xd1)](_0x49873b(0xd3)+_0x3a69ab+'\x22\x20is\x20ambiguous\x20(ids:\x20'+_0x228e41+').','Disambiguate\x20with\x20--role\x20<id>.');}return _0x55eafd[0x0];}export async function getRoleById(_0x1a3723,_0xf0b31f){const _0x546671=a235_0x341aaf,_0x1b2148=await listAllAppRoles(_0x1a3723),_0x4ff432=_0x1b2148[_0x546671(0xd5)](_0x1c07dc=>_0x1c07dc['id']===_0xf0b31f&&(!_0x1c07dc[_0x546671(0xf1)]||_0x1c07dc[_0x546671(0xf1)]===_0x1a3723));if(_0x4ff432[_0x546671(0xfd)]!==0x1)throw CliErrors[_0x546671(0xd1)](_0x546671(0xf2)+_0xf0b31f+'\x20not\x20found\x20in\x20app\x20'+_0x1a3723+'.',_0x546671(0xe8));return _0x4ff432[0x0];}async function listAllAppRoles(_0x12cdc4){const _0x108bdb=a235_0x341aaf,_0xda289c=0x64,_0x93e449=[];for(let _0x1b0a2e=0x1;;_0x1b0a2e+=0x1){const {items:_0x8f6a4d,paging:_0x22f4bc}=await listAppRoles(_0x12cdc4,{'currentPage':_0x1b0a2e,'pageSize':_0xda289c});_0x93e449[_0x108bdb(0xc2)](..._0x8f6a4d);if(_0x8f6a4d[_0x108bdb(0xfd)]<_0xda289c||_0x22f4bc&&_0x93e449[_0x108bdb(0xfd)]>=_0x22f4bc[_0x108bdb(0xe1)])return _0x93e449;}}export async function resolveTenantCode(){const _0x30b9a9=a235_0x341aaf,_0x826ebb=await getSessionUserInfo(),_0x269ca7=_0x826ebb?.[_0x30b9a9(0xca)]?.[_0x30b9a9(0xe7)]?.[_0x30b9a9(0xe5)];if(!_0x269ca7)throw CliErrors['authRequired'](_0x30b9a9(0xc7));return _0x269ca7;}function matchMember(_0x4542d4,_0x1a0bb6){const _0x8f3406=a235_0x341aaf,_0x19eba0=_0x1a0bb6[_0x8f3406(0xdd)]()[_0x8f3406(0xdc)]();return(_0x4542d4['nickname']??'')[_0x8f3406(0xdc)]()===_0x19eba0||(_0x4542d4[_0x8f3406(0xfe)]??'')['toLowerCase']()===_0x19eba0;}export async function resolveUserRef(_0x5cac08,_0x42f662=a235_0x341aaf(0xc8)){const _0x44a007=a235_0x341aaf,_0x546ffa=_0x5cac08['trim']();if(!_0x546ffa)throw CliErrors['validation'](_0x44a007(0x100),_0x44a007(0xd0));const _0x454cc1=await resolveTenantCode(),_0xb9cc9e=await getTenantMembers(_0x454cc1);if(/^\d+$/['test'](_0x546ffa)){const _0x2d73a1=Number(_0x546ffa),_0x4b7c1b=_0xb9cc9e[_0x44a007(0xd8)](_0x3529ff=>_0x3529ff[_0x44a007(0xd6)]===_0x2d73a1);return{'userId':_0x2d73a1,'username':_0x4b7c1b?.[_0x44a007(0xfe)]??String(_0x2d73a1),'nickname':_0x4b7c1b?.[_0x44a007(0xda)],'matchedBy':'id'};}const _0x58b9e2=_0xb9cc9e[_0x44a007(0xd5)](_0x1bc181=>matchMember(_0x1bc181,_0x546ffa));if(_0x58b9e2['length']===0x0)throw CliErrors[_0x44a007(0xd1)](_0x44a007(0xc3)+_0x546ffa+'\x22.',_0x44a007(0xcf)+_0x42f662);if(_0x58b9e2[_0x44a007(0xfd)]>0x1){const _0x32b3a7=_0x58b9e2['map'](_0x4d96cc=>(_0x4d96cc[_0x44a007(0xda)]??_0x4d96cc[_0x44a007(0xfe)]??'?')+'('+_0x4d96cc[_0x44a007(0xd6)]+')')['join'](',\x20');throw CliErrors['validation'](_0x44a007(0xcc)+_0x546ffa+_0x44a007(0xe6)+_0x32b3a7+'.',_0x42f662);}const _0x1ea73d=_0x58b9e2[0x0];return{'userId':_0x1ea73d[_0x44a007(0xd6)],'username':_0x1ea73d['username']??String(_0x1ea73d[_0x44a007(0xd6)]),'nickname':_0x1ea73d[_0x44a007(0xda)],'matchedBy':_0x44a007(0xfc)};}export const CREATE_USER_ROLE_PATH='/smartapi/permit/user-role/create';export const DELETE_USER_ROLE_PATH=a235_0x341aaf(0xf5);export function computeRoleUserMutation(_0x435df8){const _0x5b8409=a235_0x341aaf,{operation:_0x5a10ae,appCode:_0x4bb0ab,role:_0x366064,relations:_0xdf7af,user:_0x42902b}=_0x435df8,_0xd6b2b2=[...new Set(_0xdf7af['map'](_0x229cc9=>_0x229cc9['userId']))],_0x31b3d9=[];if(_0x435df8[_0x5b8409(0xbc)]!==undefined&&_0x435df8[_0x5b8409(0xbc)]!==_0xd6b2b2[_0x5b8409(0xfd)])throw CliErrors[_0x5b8409(0xd1)](_0x5b8409(0xe9)+_0x435df8[_0x5b8409(0xbc)]+_0x5b8409(0xd2)+_0xd6b2b2['length']+'.','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.');const _0x9a1c9e=_0xd6b2b2[_0x5b8409(0xbb)](_0x42902b[_0x5b8409(0xd6)]),_0x2f4e71=_0xdf7af['filter'](_0x31ed85=>_0x31ed85['userId']===_0x42902b['userId'])[_0x5b8409(0xbd)](_0x41fffb=>_0x41fffb['id']),_0x6eabdb=_0x5a10ae===_0x5b8409(0xdf)?!_0x9a1c9e:_0x9a1c9e;let _0xa75a26=_0xd6b2b2;_0x5a10ae==='user-add'?_0x9a1c9e?_0x31b3d9[_0x5b8409(0xc2)]('User\x20'+_0x42902b[_0x5b8409(0xd6)]+_0x5b8409(0xc6)+_0x366064[_0x5b8409(0xcb)]+';\x20no\x20change.'):_0xa75a26=[..._0xd6b2b2,_0x42902b[_0x5b8409(0xd6)]]:!_0x9a1c9e?_0x31b3d9[_0x5b8409(0xc2)](_0x5b8409(0xbf)+_0x42902b['userId']+'\x20is\x20not\x20a\x20member\x20of\x20role\x20'+_0x366064['roleName']+_0x5b8409(0xc9)):(_0xa75a26=_0xd6b2b2[_0x5b8409(0xd5)](_0x48d310=>_0x48d310!==_0x42902b['userId']),_0x2f4e71[_0x5b8409(0xfd)]>0x1&&_0x31b3d9[_0x5b8409(0xc2)](_0x5b8409(0xb7)+_0x2f4e71[_0x5b8409(0xfd)]+'\x20duplicate\x20memberships\x20for\x20user\x20'+_0x42902b['userId']+'.'));const _0x1dd22c={'scope':_0x5b8409(0xf4),'operation':_0x5a10ae,'selector':{'appCode':_0x4bb0ab,'roleId':_0x366064['id'],'roleName':_0x366064['roleName'],'userId':_0x42902b[_0x5b8409(0xd6)]},'before':{'userIds':_0xd6b2b2},'after':{'userIds':_0xa75a26},'dryRun':_0x435df8[_0x5b8409(0x103)],'backend':{'method':_0x5b8409(0xb8),'path':_0x5a10ae==='user-add'?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x31b3d9};return{'mutation':_0x1dd22c,'changed':_0x6eabdb,'matchingRelationIds':_0x2f4e71};}export async function loadDevRoleRelations(_0x4c3780,_0x265c87){const _0x6d192a=a235_0x341aaf,_0x373e3f=0x64,_0x1036d8=[];for(let _0x15c5b4=0x1;;_0x15c5b4+=0x1){const {items:_0x213733,paging:_0x5a8dc3}=await listDevUserRoleRelations(_0x4c3780,{'roleId':_0x265c87,'currentPage':_0x15c5b4,'pageSize':_0x373e3f});_0x1036d8[_0x6d192a(0xc2)](..._0x213733);if(_0x213733[_0x6d192a(0xfd)]<_0x373e3f||_0x5a8dc3&&_0x1036d8[_0x6d192a(0xfd)]>=_0x5a8dc3[_0x6d192a(0xe1)])return _0x1036d8;}}export function readRoleRef(_0x880e78){const _0x4a047b=a235_0x341aaf,_0x2e098b=_0x880e78[_0x4a047b(0xed)](_0x4a047b(0xdb))[_0x4a047b(0xdd)]();if(!_0x2e098b)throw CliErrors[_0x4a047b(0xbe)](_0x4a047b(0xdb),_0x4a047b(0x102));return _0x2e098b;}export async function prepareUserMutation(_0x2509fc,_0x244e84,_0x247963){const _0x2e4c51=a235_0x341aaf,_0x5c0d16=readRoleRef(_0x2509fc),_0xf956a2=_0x2509fc[_0x2e4c51(0xed)](_0x2e4c51(0xca))[_0x2e4c51(0xdd)]();if(!_0xf956a2)throw CliErrors[_0x2e4c51(0xbe)](_0x2e4c51(0xca),'Pass\x20--user\x20<id|name>.');const _0x4259ca=_0x2509fc[_0x2e4c51(0xfa)]('expect-user-count'),_0x31da9a=_0x4259ca===undefined||_0x4259ca===null?undefined:Number(_0x4259ca),_0x3b38d1=await resolveRoleRef(_0x2509fc[_0x2e4c51(0xf1)],_0x5c0d16);if(_0x3b38d1[_0x2e4c51(0xee)]===_0x2e4c51(0xe0))throw CliErrors[_0x2e4c51(0xd1)](_0x2e4c51(0xe3)+_0x244e84+'\x20members\x20of\x20the\x20OWNER\x20role.',_0x2e4c51(0xc0));const _0x12b068=await resolveUserRef(_0xf956a2),_0x10a353=await loadDevRoleRelations(_0x2509fc['appCode'],_0x3b38d1['id']);return{...computeRoleUserMutation({'operation':_0x244e84,'appCode':_0x2509fc[_0x2e4c51(0xf1)],'role':_0x3b38d1,'relations':_0x10a353,'user':{'userId':_0x12b068['userId'],'username':_0x12b068[_0x2e4c51(0xfe)],'nickname':_0x12b068['nickname']},'dryRun':_0x247963,..._0x31da9a!==undefined?{'expectUserCount':_0x31da9a}:{}}),'role':_0x3b38d1,'user':_0x12b068};}
@@ -1 +1 @@
1
- const a236_0x505347=a236_0x3c2c;(function(_0x2ccc14,_0x13130d){const _0x56ba6f=a236_0x3c2c,_0x16668a=_0x2ccc14();while(!![]){try{const _0x4ccce5=parseInt(_0x56ba6f(0x10d))/0x1+parseInt(_0x56ba6f(0x107))/0x2*(parseInt(_0x56ba6f(0x10c))/0x3)+parseInt(_0x56ba6f(0x121))/0x4*(-parseInt(_0x56ba6f(0x104))/0x5)+-parseInt(_0x56ba6f(0x11d))/0x6+parseInt(_0x56ba6f(0x113))/0x7+-parseInt(_0x56ba6f(0x116))/0x8+parseInt(_0x56ba6f(0x11e))/0x9;if(_0x4ccce5===_0x13130d)break;else _0x16668a['push'](_0x16668a['shift']());}catch(_0x19158c){_0x16668a['push'](_0x16668a['shift']());}}}(a236_0x5783,0x722bb));function a236_0x5783(){const _0x3dbcd1=['write','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','13284oSkPFx','num','105IpIhcV','--name\x20cannot\x20be\x20empty.','\x20(id=','412usORdf','POST','validation','flag','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','9HJShSr','323783eTMFIN','Updated\x20role\x20','trim','remark','role','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','6056491QpORwW','name','New\x20role\x20name','5297704ITMRbo','appCode','length','roleName','dev','update','string','1995204xRcQGo','3082653kMawjo'];a236_0x5783=function(){return _0x3dbcd1;};return a236_0x5783();}import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a236_0x3c2c(_0x12201f,_0x1e2af4){_0x12201f=_0x12201f-0x104;const _0x5783d5=a236_0x5783();let _0x3c2c73=_0x5783d5[_0x12201f];return _0x3c2c73;}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(_0x5a5b0a){const _0x5efe7e=a236_0x3c2c,_0x1d2d74=_0x5a5b0a[_0x5efe7e(0x10a)](_0x5efe7e(0x114)),_0x5bba28=_0x5a5b0a[_0x5efe7e(0x10a)](_0x5efe7e(0x110)),_0x2e112d={};if(_0x1d2d74!==undefined&&_0x1d2d74!==null){const _0x2d386d=String(_0x1d2d74)[_0x5efe7e(0x10f)]();if(!_0x2d386d)throw CliErrors[_0x5efe7e(0x109)](_0x5efe7e(0x105));if(_0x2d386d[_0x5efe7e(0x118)]>0x40)throw CliErrors[_0x5efe7e(0x109)](_0x5efe7e(0x120));_0x2e112d['roleName']=_0x2d386d;}_0x5bba28!==undefined&&_0x5bba28!==null&&(_0x2e112d[_0x5efe7e(0x110)]=String(_0x5bba28));if(_0x2e112d[_0x5efe7e(0x119)]===undefined&&_0x2e112d[_0x5efe7e(0x110)]===undefined)throw CliErrors[_0x5efe7e(0x109)]('Nothing\x20to\x20update.',_0x5efe7e(0x10b));return _0x2e112d;}export const roleUpdate={'service':a236_0x505347(0x111),'command':a236_0x505347(0x11b),'description':a236_0x505347(0x112),'risk':a236_0x505347(0x11f),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a236_0x505347(0x114),'type':a236_0x505347(0x11c),'required':![],'description':a236_0x505347(0x115)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3dca5a){readPatch(_0x3dca5a);},async 'dryRun'(_0x4f682d){const _0x16745a=a236_0x505347,_0x289c5e=_0x4f682d[_0x16745a(0x122)]('id'),_0x279118=readPatch(_0x4f682d),_0x5eaec0=await getRoleById(_0x4f682d[_0x16745a(0x117)],_0x289c5e);return assertCustomRole(_0x5eaec0,'update'),asDryRunResult({'scope':_0x16745a(0x11a),'operation':_0x16745a(0x11b),'selector':{'appCode':_0x4f682d[_0x16745a(0x117)],'roleId':_0x289c5e,'roleName':_0x5eaec0[_0x16745a(0x119)]},'before':projectRole(_0x5eaec0),'after':projectRole({..._0x5eaec0,..._0x279118[_0x16745a(0x119)]!==undefined?{'roleName':_0x279118[_0x16745a(0x119)]}:{},..._0x279118[_0x16745a(0x110)]!==undefined?{'remark':_0x279118[_0x16745a(0x110)]}:{}}),'dryRun':!![],'backend':{'method':_0x16745a(0x108),'path':UPDATE_PATH},'warnings':[]},{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x29d6ca){const _0x32c302=a236_0x505347,_0x1d2392=_0x29d6ca['num']('id'),_0x11224f=readPatch(_0x29d6ca),_0x6e165a=await getRoleById(_0x29d6ca['appCode'],_0x1d2392);assertCustomRole(_0x6e165a,_0x32c302(0x11b)),await updateAppRole({'id':_0x1d2392,'appCode':_0x29d6ca[_0x32c302(0x117)],..._0x11224f[_0x32c302(0x119)]!==undefined?{'roleName':_0x11224f[_0x32c302(0x119)]}:{},..._0x11224f['remark']!==undefined?{'remark':_0x11224f['remark']}:{}});const _0x1b8d37=await getRoleById(_0x29d6ca[_0x32c302(0x117)],_0x1d2392);return{'ok':!![],'data':{'scope':_0x32c302(0x11a),'operation':_0x32c302(0x11b),'selector':{'appCode':_0x29d6ca['appCode'],'roleId':_0x1d2392,'roleName':_0x1b8d37[_0x32c302(0x119)]},'before':projectRole(_0x6e165a),'after':projectRole(_0x1b8d37),'dryRun':![],'backend':{'method':_0x32c302(0x108),'path':UPDATE_PATH},'warnings':[]},'message':_0x32c302(0x10e)+_0x1b8d37[_0x32c302(0x119)]+_0x32c302(0x106)+_0x1d2392+')'};}};
1
+ const a236_0x1b25ad=a236_0x5683;(function(_0x1f434a,_0x5e009d){const _0x2e6a20=a236_0x5683,_0x13fe54=_0x1f434a();while(!![]){try{const _0x37232c=parseInt(_0x2e6a20(0x11f))/0x1*(parseInt(_0x2e6a20(0x125))/0x2)+-parseInt(_0x2e6a20(0x121))/0x3+parseInt(_0x2e6a20(0x131))/0x4*(-parseInt(_0x2e6a20(0x11c))/0x5)+parseInt(_0x2e6a20(0x136))/0x6*(parseInt(_0x2e6a20(0x130))/0x7)+-parseInt(_0x2e6a20(0x129))/0x8+-parseInt(_0x2e6a20(0x12c))/0x9*(-parseInt(_0x2e6a20(0x128))/0xa)+parseInt(_0x2e6a20(0x11e))/0xb;if(_0x37232c===_0x5e009d)break;else _0x13fe54['push'](_0x13fe54['shift']());}catch(_0x511607){_0x13fe54['push'](_0x13fe54['shift']());}}}(a236_0x15cb,0x273cd));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a236_0x15cb(){const _0x4273b2=['Updated\x20role\x20','6633UopXAg','roleName','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','81718bNbuAw','17328zSUPee','role','update','dev','num','162vExbmx','/smartapi/permit/role/update','\x20(id=','write','flag','trim','POST','335hYNiKC','--name\x20cannot\x20be\x20empty.','2147618vdbkxe','8sfTwGz','New\x20role\x20name','331824HhBBKs','appCode','Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','validation','27634GMPUBz','string','name','690WVxxZf','882048becviM','remark'];a236_0x15cb=function(){return _0x4273b2;};return a236_0x15cb();}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_0x1b25ad(0x137);function readPatch(_0x232b1a){const _0x5dfbbd=a236_0x1b25ad,_0x4f9911=_0x232b1a[_0x5dfbbd(0x13a)](_0x5dfbbd(0x127)),_0x31ccdd=_0x232b1a[_0x5dfbbd(0x13a)]('remark'),_0x49071d={};if(_0x4f9911!==undefined&&_0x4f9911!==null){const _0xeeb3a1=String(_0x4f9911)[_0x5dfbbd(0x13b)]();if(!_0xeeb3a1)throw CliErrors[_0x5dfbbd(0x124)](_0x5dfbbd(0x11d));if(_0xeeb3a1['length']>0x40)throw CliErrors[_0x5dfbbd(0x124)](_0x5dfbbd(0x12f));_0x49071d[_0x5dfbbd(0x12d)]=_0xeeb3a1;}_0x31ccdd!==undefined&&_0x31ccdd!==null&&(_0x49071d['remark']=String(_0x31ccdd));if(_0x49071d[_0x5dfbbd(0x12d)]===undefined&&_0x49071d[_0x5dfbbd(0x12a)]===undefined)throw CliErrors['validation']('Nothing\x20to\x20update.',_0x5dfbbd(0x123));return _0x49071d;}function a236_0x5683(_0x6508da,_0x4c89ef){_0x6508da=_0x6508da-0x11c;const _0x15cb61=a236_0x15cb();let _0x568356=_0x15cb61[_0x6508da];return _0x568356;}export const roleUpdate={'service':a236_0x1b25ad(0x132),'command':a236_0x1b25ad(0x133),'description':a236_0x1b25ad(0x12e),'risk':a236_0x1b25ad(0x139),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a236_0x1b25ad(0x127),'type':a236_0x1b25ad(0x126),'required':![],'description':a236_0x1b25ad(0x120)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x25dd72){readPatch(_0x25dd72);},async 'dryRun'(_0x3e5025){const _0x1a631f=a236_0x1b25ad,_0x48195a=_0x3e5025[_0x1a631f(0x135)]('id'),_0x25b0b7=readPatch(_0x3e5025),_0x3e1534=await getRoleById(_0x3e5025[_0x1a631f(0x122)],_0x48195a);return assertCustomRole(_0x3e1534,_0x1a631f(0x133)),asDryRunResult({'scope':_0x1a631f(0x134),'operation':'update','selector':{'appCode':_0x3e5025[_0x1a631f(0x122)],'roleId':_0x48195a,'roleName':_0x3e1534[_0x1a631f(0x12d)]},'before':projectRole(_0x3e1534),'after':projectRole({..._0x3e1534,..._0x25b0b7['roleName']!==undefined?{'roleName':_0x25b0b7[_0x1a631f(0x12d)]}:{},..._0x25b0b7[_0x1a631f(0x12a)]!==undefined?{'remark':_0x25b0b7['remark']}:{}}),'dryRun':!![],'backend':{'method':_0x1a631f(0x13c),'path':UPDATE_PATH},'warnings':[]},{'method':_0x1a631f(0x13c),'url':UPDATE_PATH});},async 'execute'(_0x346b7d){const _0x3612dc=a236_0x1b25ad,_0x3f1f75=_0x346b7d['num']('id'),_0x5c7ac8=readPatch(_0x346b7d),_0x319682=await getRoleById(_0x346b7d[_0x3612dc(0x122)],_0x3f1f75);assertCustomRole(_0x319682,_0x3612dc(0x133)),await updateAppRole({'id':_0x3f1f75,'appCode':_0x346b7d['appCode'],..._0x5c7ac8['roleName']!==undefined?{'roleName':_0x5c7ac8[_0x3612dc(0x12d)]}:{},..._0x5c7ac8['remark']!==undefined?{'remark':_0x5c7ac8['remark']}:{}});const _0x2a41ec=await getRoleById(_0x346b7d['appCode'],_0x3f1f75);return{'ok':!![],'data':{'scope':_0x3612dc(0x134),'operation':_0x3612dc(0x133),'selector':{'appCode':_0x346b7d[_0x3612dc(0x122)],'roleId':_0x3f1f75,'roleName':_0x2a41ec[_0x3612dc(0x12d)]},'before':projectRole(_0x319682),'after':projectRole(_0x2a41ec),'dryRun':![],'backend':{'method':_0x3612dc(0x13c),'path':UPDATE_PATH},'warnings':[]},'message':_0x3612dc(0x12b)+_0x2a41ec['roleName']+_0x3612dc(0x138)+_0x3f1f75+')'};}};
@@ -1 +1 @@
1
- function a237_0x8081(){const _0xca8ba6=['15BGfsPH','No\x20change:\x20user\x20','4174570GVUUUb','appCode','POST','Added\x20user\x20','roleType','119308qfmyoQ','roleId','12259872lPmYqP','4195758WUYfeO','high-risk-write','3497NCPrGl','selector','\x20to\x20role\x20','1354566pfwyZr','5923400BEeeWD','46tDZvfw','userId'];a237_0x8081=function(){return _0xca8ba6;};return a237_0x8081();}const a237_0x1b67de=a237_0x1925;(function(_0xc40466,_0x51789c){const _0x503272=a237_0x1925,_0x3551f0=_0xc40466();while(!![]){try{const _0x25e115=-parseInt(_0x503272(0x1d2))/0x1*(parseInt(_0x503272(0x1d7))/0x2)+parseInt(_0x503272(0x1d9))/0x3*(parseInt(_0x503272(0x1cd))/0x4)+-parseInt(_0x503272(0x1db))/0x5+-parseInt(_0x503272(0x1d5))/0x6+-parseInt(_0x503272(0x1d0))/0x7+parseInt(_0x503272(0x1d6))/0x8+parseInt(_0x503272(0x1cf))/0x9;if(_0x25e115===_0x51789c)break;else _0x3551f0['push'](_0x3551f0['shift']());}catch(_0x11f960){_0x3551f0['push'](_0x3551f0['shift']());}}}(a237_0x8081,0x7cd24));import{createDevUserRole}from'../../core/api-client.js';function a237_0x1925(_0x3addfd,_0x4306f2){_0x3addfd=_0x3addfd-0x1cd;const _0x808195=a237_0x8081();let _0x1925ed=_0x808195[_0x3addfd];return _0x1925ed;}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':'role','command':'user-add','description':'Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','risk':a237_0x1b67de(0x1d1),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x1ec930){const _0x5cbe7d=a237_0x1b67de,{mutation:_0x59dc64}=await prepareUserMutation(_0x1ec930,'user-add',!![]);return asDryRunResult(_0x59dc64,{'method':_0x5cbe7d(0x1dd),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x2b4db5){const _0xacc1a9=a237_0x1b67de,{mutation:_0xb124a9,changed:_0x48665d,role:_0x17dde2,user:_0x1fb5d4}=await prepareUserMutation(_0x2b4db5,'user-add',![]);return _0x48665d&&await createDevUserRole({'appCode':_0x2b4db5[_0xacc1a9(0x1dc)],'userId':_0x1fb5d4[_0xacc1a9(0x1d8)],'username':_0x1fb5d4['username'],'roleType':_0x17dde2[_0xacc1a9(0x1df)],'roleId':_0xb124a9[_0xacc1a9(0x1d3)][_0xacc1a9(0x1ce)]}),{'ok':!![],'data':_0xb124a9,'message':_0x48665d?_0xacc1a9(0x1de)+_0xb124a9['selector'][_0xacc1a9(0x1d8)]+_0xacc1a9(0x1d4)+_0xb124a9['selector']['roleName']:_0xacc1a9(0x1da)+_0xb124a9['selector'][_0xacc1a9(0x1d8)]+'\x20already\x20in\x20role\x20'+_0xb124a9[_0xacc1a9(0x1d3)]['roleName']};}};
1
+ const a237_0x24cfb9=a237_0x14fc;function a237_0x14fc(_0x20f3c6,_0x4eaa2f){_0x20f3c6=_0x20f3c6-0x104;const _0x19b150=a237_0x19b1();let _0x14fc97=_0x19b150[_0x20f3c6];return _0x14fc97;}(function(_0x45a940,_0x26b6e3){const _0x27dfdf=a237_0x14fc,_0x4b2862=_0x45a940();while(!![]){try{const _0x1b95a4=-parseInt(_0x27dfdf(0x10c))/0x1+-parseInt(_0x27dfdf(0x114))/0x2+parseInt(_0x27dfdf(0x115))/0x3*(parseInt(_0x27dfdf(0x110))/0x4)+parseInt(_0x27dfdf(0x108))/0x5*(-parseInt(_0x27dfdf(0x10b))/0x6)+parseInt(_0x27dfdf(0x10d))/0x7+-parseInt(_0x27dfdf(0x111))/0x8*(-parseInt(_0x27dfdf(0x10e))/0x9)+parseInt(_0x27dfdf(0x104))/0xa;if(_0x1b95a4===_0x26b6e3)break;else _0x4b2862['push'](_0x4b2862['shift']());}catch(_0x43ad7d){_0x4b2862['push'](_0x4b2862['shift']());}}}(a237_0x19b1,0x1d26d));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_0x24cfb9(0x106),'command':a237_0x24cfb9(0x105),'description':'Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x2c68f3){const _0x329558=a237_0x24cfb9,{mutation:_0x98cdfb}=await prepareUserMutation(_0x2c68f3,_0x329558(0x105),!![]);return asDryRunResult(_0x98cdfb,{'method':'POST','url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x172097){const _0x2bca94=a237_0x24cfb9,{mutation:_0x4c51be,changed:_0x22b2f7,role:_0x546da0,user:_0x3d3aff}=await prepareUserMutation(_0x172097,'user-add',![]);return _0x22b2f7&&await createDevUserRole({'appCode':_0x172097['appCode'],'userId':_0x3d3aff[_0x2bca94(0x116)],'username':_0x3d3aff['username'],'roleType':_0x546da0[_0x2bca94(0x113)],'roleId':_0x4c51be[_0x2bca94(0x10a)]['roleId']}),{'ok':!![],'data':_0x4c51be,'message':_0x22b2f7?_0x2bca94(0x109)+_0x4c51be[_0x2bca94(0x10a)]['userId']+_0x2bca94(0x10f)+_0x4c51be[_0x2bca94(0x10a)][_0x2bca94(0x107)]:'No\x20change:\x20user\x20'+_0x4c51be[_0x2bca94(0x10a)][_0x2bca94(0x116)]+_0x2bca94(0x112)+_0x4c51be['selector'][_0x2bca94(0x107)]};}};function a237_0x19b1(){const _0xae008=['user-add','role','roleName','90aCcwdM','Added\x20user\x20','selector','40398VJfoqm','81154ssOQOm','1017849TlReYI','1379133IoDfDg','\x20to\x20role\x20','58732yAfLxQ','8dicvNo','\x20already\x20in\x20role\x20','roleType','271000YsKqfj','27eJWOtd','userId','264620rqGydI'];a237_0x19b1=function(){return _0xae008;};return a237_0x19b1();}
@@ -1 +1 @@
1
- function a238_0x29ad(_0xd1d6d3,_0x190df6){_0xd1d6d3=_0xd1d6d3-0x176;const _0x4d791b=a238_0x4d79();let _0x29ad16=_0x4d791b[_0xd1d6d3];return _0x29ad16;}const a238_0xa7a319=a238_0x29ad;(function(_0x536613,_0x3aea93){const _0x45053c=a238_0x29ad,_0x418465=_0x536613();while(!![]){try{const _0x158efe=-parseInt(_0x45053c(0x17e))/0x1+parseInt(_0x45053c(0x18a))/0x2*(parseInt(_0x45053c(0x17a))/0x3)+-parseInt(_0x45053c(0x17c))/0x4+-parseInt(_0x45053c(0x17f))/0x5+-parseInt(_0x45053c(0x17b))/0x6+parseInt(_0x45053c(0x181))/0x7*(parseInt(_0x45053c(0x182))/0x8)+parseInt(_0x45053c(0x17d))/0x9;if(_0x158efe===_0x3aea93)break;else _0x418465['push'](_0x418465['shift']());}catch(_0x224ad5){_0x418465['push'](_0x418465['shift']());}}}(a238_0x4d79,0x1d774));import{deleteDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,DELETE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':a238_0xa7a319(0x189),'command':a238_0xa7a319(0x185),'description':a238_0xa7a319(0x188),'risk':a238_0xa7a319(0x180),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x25aa0b){const _0x2230a8=a238_0xa7a319,{mutation:_0x280ac4}=await prepareUserMutation(_0x25aa0b,'user-remove',!![]);return asDryRunResult(_0x280ac4,{'method':_0x2230a8(0x186),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x5189e6){const _0x3f2e60=a238_0xa7a319,{matchingRelationIds:_0x4ecc2d,mutation:_0x36196e,changed:_0x36733b}=await prepareUserMutation(_0x5189e6,'user-remove',![]);if(_0x36733b)for(const _0x1e84cd of _0x4ecc2d){await deleteDevUserRole(_0x1e84cd);}return{'ok':!![],'data':_0x36196e,'message':_0x36733b?_0x3f2e60(0x176)+_0x36196e[_0x3f2e60(0x179)][_0x3f2e60(0x183)]+_0x3f2e60(0x187)+_0x36196e['selector'][_0x3f2e60(0x184)]:_0x3f2e60(0x177)+_0x36196e[_0x3f2e60(0x179)][_0x3f2e60(0x183)]+_0x3f2e60(0x178)+_0x36196e[_0x3f2e60(0x179)]['roleName']};}};function a238_0x4d79(){const _0x3809cc=['9728btVabk','1382508lKCJZO','142783fvSsfP','336000dBNYIB','high-risk-write','240590hCBmNA','8cJbyFS','userId','roleName','user-remove','POST','\x20from\x20role\x20','Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','role','339928WwYgvU','Removed\x20user\x20','No\x20change:\x20user\x20','\x20not\x20in\x20role\x20','selector','3XJybze','149034BtUMZk'];a238_0x4d79=function(){return _0x3809cc;};return a238_0x4d79();}
1
+ const a238_0x231c03=a238_0x2d85;(function(_0x3e00d0,_0x1dc0fb){const _0x19fd71=a238_0x2d85,_0x33f5ac=_0x3e00d0();while(!![]){try{const _0x2b251a=parseInt(_0x19fd71(0xa4))/0x1*(-parseInt(_0x19fd71(0x9f))/0x2)+-parseInt(_0x19fd71(0x92))/0x3+-parseInt(_0x19fd71(0x97))/0x4*(parseInt(_0x19fd71(0x99))/0x5)+-parseInt(_0x19fd71(0xa5))/0x6*(parseInt(_0x19fd71(0x9e))/0x7)+-parseInt(_0x19fd71(0xa0))/0x8*(parseInt(_0x19fd71(0xa1))/0x9)+parseInt(_0x19fd71(0x94))/0xa+parseInt(_0x19fd71(0x9d))/0xb*(parseInt(_0x19fd71(0x9b))/0xc);if(_0x2b251a===_0x1dc0fb)break;else _0x33f5ac['push'](_0x33f5ac['shift']());}catch(_0x10467c){_0x33f5ac['push'](_0x33f5ac['shift']());}}}(a238_0x4c2e,0x6dec0));import{deleteDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a238_0x4c2e(){const _0x40cb51=['40396BdVhfi','Removed\x20user\x20','115BUeenT','high-risk-write','30054480SoASfP','userId','11rOgmcS','1472527CUKxxW','685534wrPzwm','392DUpQzQ','118458WbJLoH','\x20not\x20in\x20role\x20','No\x20change:\x20user\x20','1HDmDfK','18hdFbjW','user-remove','\x20from\x20role\x20','1686975xJIeoz','role','3590900eWPATW','selector','roleName'];a238_0x4c2e=function(){return _0x40cb51;};return a238_0x4c2e();}import{EXPECT_USER_COUNT_FLAG,DELETE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';function a238_0x2d85(_0x16b468,_0x5e2d43){_0x16b468=_0x16b468-0x90;const _0x4c2e78=a238_0x4c2e();let _0x2d856f=_0x4c2e78[_0x16b468];return _0x2d856f;}export const roleUserRemove={'service':a238_0x231c03(0x93),'command':'user-remove','description':'Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','risk':a238_0x231c03(0x9a),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x378a29){const _0x2d84a0=a238_0x231c03,{mutation:_0x3cadf7}=await prepareUserMutation(_0x378a29,_0x2d84a0(0x90),!![]);return asDryRunResult(_0x3cadf7,{'method':'POST','url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x4cc2da){const _0x1a77b5=a238_0x231c03,{matchingRelationIds:_0x18c1e8,mutation:_0x38626a,changed:_0x52d46c}=await prepareUserMutation(_0x4cc2da,_0x1a77b5(0x90),![]);if(_0x52d46c)for(const _0x76266f of _0x18c1e8){await deleteDevUserRole(_0x76266f);}return{'ok':!![],'data':_0x38626a,'message':_0x52d46c?_0x1a77b5(0x98)+_0x38626a[_0x1a77b5(0x95)]['userId']+_0x1a77b5(0x91)+_0x38626a[_0x1a77b5(0x95)][_0x1a77b5(0x96)]:_0x1a77b5(0xa3)+_0x38626a[_0x1a77b5(0x95)][_0x1a77b5(0x9c)]+_0x1a77b5(0xa2)+_0x38626a[_0x1a77b5(0x95)][_0x1a77b5(0x96)]};}};
@@ -1 +1 @@
1
- function a239_0x5e9c(_0x3bb868,_0x2f99e5){_0x3bb868=_0x3bb868-0xfb;const _0x3b15af=a239_0x3b15();let _0x5e9c38=_0x3b15af[_0x3bb868];return _0x5e9c38;}const a239_0x1edc7f=a239_0x5e9c;(function(_0x4fb4cf,_0x2feb01){const _0x539050=a239_0x5e9c,_0x267676=_0x4fb4cf();while(!![]){try{const _0x377655=parseInt(_0x539050(0x106))/0x1+-parseInt(_0x539050(0xff))/0x2+parseInt(_0x539050(0x101))/0x3+-parseInt(_0x539050(0xfb))/0x4*(-parseInt(_0x539050(0x103))/0x5)+parseInt(_0x539050(0x107))/0x6+parseInt(_0x539050(0xfd))/0x7+-parseInt(_0x539050(0xfc))/0x8;if(_0x377655===_0x2feb01)break;else _0x267676['push'](_0x267676['shift']());}catch(_0x40064c){_0x267676['push'](_0x267676['shift']());}}}(a239_0x3b15,0xaaecf));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a239_0x3b15(){const _0x15fe88=['name','userId','nickname','username','1645468msqAxS','12063984IPoKAg','7121121ibXhlT','role','2248704WizyOz','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','839880yCHicg','Pass\x20--name\x20<nickname|username>.','5kKAFCT','read','trim','997290hSkctc','3759246OTFclr'];a239_0x3b15=function(){return _0x15fe88;};return a239_0x3b15();}import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a239_0x1edc7f(0xfe),'command':'user-resolve','description':a239_0x1edc7f(0x100),'risk':a239_0x1edc7f(0x104),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x17eae9){const _0x26382a=a239_0x1edc7f;if(!_0x17eae9['str'](_0x26382a(0x108))[_0x26382a(0x105)]())throw CliErrors['flagMissing'](_0x26382a(0x108),_0x26382a(0x102));},async 'execute'(_0x4bf0e3){const _0x4f9f76=a239_0x1edc7f,_0x393838=_0x4bf0e3['str']('name')[_0x4f9f76(0x105)](),_0xa8165a=await resolveUserRef(_0x393838,'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':_0xa8165a[_0x4f9f76(0x109)],'username':_0xa8165a[_0x4f9f76(0x10b)],'nickname':_0xa8165a[_0x4f9f76(0x10a)],'matchedBy':_0xa8165a['matchedBy']}},'message':'Resolved\x20\x22'+_0x393838+'\x22\x20→\x20userId\x20'+_0xa8165a[_0x4f9f76(0x109)]};}};
1
+ function a239_0x1605(_0x564451,_0x5f172f){_0x564451=_0x564451-0x93;const _0x31b94b=a239_0x31b9();let _0x160534=_0x31b94b[_0x564451];return _0x160534;}function a239_0x31b9(){const _0x4d497c=['userId','str','169828BhlpbW','Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.','nickname','Resolved\x20\x22','14280TeIbON','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','162jQaPge','6382loHful','24213BhoyIa','username','7124630HzyuQX','matchedBy','trim','\x22\x20→\x20userId\x20','464391bDjXUY','111yRYHxC','user-resolve','1250555uzWEPj','40dlTLap'];a239_0x31b9=function(){return _0x4d497c;};return a239_0x31b9();}const a239_0x58bde9=a239_0x1605;(function(_0x5c4074,_0x4ea8ea){const _0x20b8e9=a239_0x1605,_0x49e73e=_0x5c4074();while(!![]){try{const _0x29697c=parseInt(_0x20b8e9(0xa0))/0x1+parseInt(_0x20b8e9(0xa3))/0x2*(-parseInt(_0x20b8e9(0x96))/0x3)+-parseInt(_0x20b8e9(0x9c))/0x4+-parseInt(_0x20b8e9(0x98))/0x5+parseInt(_0x20b8e9(0xa2))/0x6*(parseInt(_0x20b8e9(0xa4))/0x7)+-parseInt(_0x20b8e9(0x99))/0x8*(parseInt(_0x20b8e9(0x95))/0x9)+parseInt(_0x20b8e9(0xa6))/0xa;if(_0x29697c===_0x4ea8ea)break;else _0x49e73e['push'](_0x49e73e['shift']());}catch(_0x591c37){_0x49e73e['push'](_0x49e73e['shift']());}}}(a239_0x31b9,0x24fd2));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_0x58bde9(0x97),'description':a239_0x58bde9(0xa1),'risk':'read','flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x431f11){const _0x164b53=a239_0x58bde9;if(!_0x431f11[_0x164b53(0x9b)]('name')[_0x164b53(0x93)]())throw CliErrors['flagMissing']('name','Pass\x20--name\x20<nickname|username>.');},async 'execute'(_0x1ee9f9){const _0xe9f64c=a239_0x58bde9,_0x3b0a2b=_0x1ee9f9[_0xe9f64c(0x9b)]('name')['trim'](),_0x538ef2=await resolveUserRef(_0x3b0a2b,_0xe9f64c(0x9d));return{'ok':!![],'data':{'user':{'userId':_0x538ef2[_0xe9f64c(0x9a)],'username':_0x538ef2[_0xe9f64c(0xa5)],'nickname':_0x538ef2[_0xe9f64c(0x9e)],'matchedBy':_0x538ef2[_0xe9f64c(0xa7)]}},'message':_0xe9f64c(0x9f)+_0x3b0a2b+_0xe9f64c(0x94)+_0x538ef2[_0xe9f64c(0x9a)]};}};
@@ -1 +1 @@
1
- const a240_0x5cadfa=a240_0x48eb;(function(_0x1550a2,_0x1f9eb9){const _0x1ce151=a240_0x48eb,_0x4637e5=_0x1550a2();while(!![]){try{const _0x180485=-parseInt(_0x1ce151(0xca))/0x1+parseInt(_0x1ce151(0xd7))/0x2*(-parseInt(_0x1ce151(0xd5))/0x3)+-parseInt(_0x1ce151(0xc9))/0x4*(parseInt(_0x1ce151(0xdc))/0x5)+-parseInt(_0x1ce151(0xcc))/0x6*(-parseInt(_0x1ce151(0xd1))/0x7)+parseInt(_0x1ce151(0xd4))/0x8+parseInt(_0x1ce151(0xcb))/0x9*(-parseInt(_0x1ce151(0xd0))/0xa)+parseInt(_0x1ce151(0xd9))/0xb;if(_0x180485===_0x1f9eb9)break;else _0x4637e5['push'](_0x4637e5['shift']());}catch(_0x2276e0){_0x4637e5['push'](_0x4637e5['shift']());}}}(a240_0x1433,0x2eb12));import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPE_FLAG,appRuleError,appRuleFileName,projectAppRule,readAppRuleType}from'../../commands/rule/shared.js';function a240_0x48eb(_0x1b949a,_0x1e9b98){_0x1b949a=_0x1b949a-0xc8;const _0x1433df=a240_0x1433();let _0x48eb45=_0x1433df[_0x1b949a];return _0x48eb45;}export const ruleGet={'service':a240_0x5cadfa(0xdd),'command':a240_0x5cadfa(0xc8),'description':'Get\x20one\x20agent\x20context\x20rule\x20for\x20the\x20resolved\x20app','risk':a240_0x5cadfa(0xdb),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG],async 'validate'(_0x5a5782){readAppRuleType(_0x5a5782);},async 'execute'(_0x3f791b){const _0x106620=a240_0x5cadfa,_0x8aff02=readAppRuleType(_0x3f791b),_0x562e10=await getAppRule(_0x3f791b[_0x106620(0xda)],{'appCode':_0x3f791b[_0x106620(0xd6)],'type':_0x8aff02});if(!_0x562e10)throw appRuleError('app_rule_not_found',appRuleFileName(_0x8aff02)+_0x106620(0xcd)+_0x3f791b[_0x106620(0xd6)]+'.',_0x106620(0xd2)+_0x8aff02+_0x106620(0xd8));return{'ok':!![],'data':{'rule':{...projectAppRule(_0x8aff02,_0x562e10),'content':_0x562e10[_0x106620(0xd3)]}},'message':_0x106620(0xcf)+appRuleFileName(_0x8aff02)+_0x106620(0xce)+_0x3f791b[_0x106620(0xd6)]};}};function a240_0x1433(){const _0x4be2af=['rule','get','387716PBDRZj','186872yjEwso','47943CvjBCz','6JtHZsv','\x20is\x20not\x20configured\x20for\x20app\x20','\x20for\x20','Loaded\x20','430ZlQTgP','2340709DvmKas','Create\x20it\x20with\x20`rabetbase\x20rule\x20set\x20--type\x20','content','742296UZGMik','243pvrIjl','appCode','4298ztXlaR','\x20--file\x20<path>\x20--dry-run`.','4961077aomjAb','cookie','read','5rMHLtH'];a240_0x1433=function(){return _0x4be2af;};return a240_0x1433();}
1
+ function a240_0x42bf(_0x46bc0c,_0x157f05){_0x46bc0c=_0x46bc0c-0x90;const _0x275a20=a240_0x275a();let _0x42bf7a=_0x275a20[_0x46bc0c];return _0x42bf7a;}const a240_0x361ae9=a240_0x42bf;(function(_0x455b38,_0x3c90d2){const _0x4f796e=a240_0x42bf,_0x42fa0c=_0x455b38();while(!![]){try{const _0x47773b=-parseInt(_0x4f796e(0x91))/0x1+parseInt(_0x4f796e(0x9c))/0x2+parseInt(_0x4f796e(0x92))/0x3+-parseInt(_0x4f796e(0x98))/0x4+-parseInt(_0x4f796e(0xa0))/0x5+parseInt(_0x4f796e(0x99))/0x6+parseInt(_0x4f796e(0x9e))/0x7;if(_0x47773b===_0x3c90d2)break;else _0x42fa0c['push'](_0x42fa0c['shift']());}catch(_0x56f79c){_0x42fa0c['push'](_0x42fa0c['shift']());}}}(a240_0x275a,0x26e9c));import{getAppRule}from'../../core/api-client.js';function a240_0x275a(){const _0x3a9af3=['98482NHsccG','382425PCiOLW','rule','content','Create\x20it\x20with\x20`rabetbase\x20rule\x20set\x20--type\x20','\x20for\x20','read','305304GOBrLl','537900ILTyeP','Get\x20one\x20agent\x20context\x20rule\x20for\x20the\x20resolved\x20app','\x20is\x20not\x20configured\x20for\x20app\x20','516234GuOTDx','\x20--file\x20<path>\x20--dry-run`.','1243501nTpllM','app_rule_not_found','1593445yfwNtb','appCode'];a240_0x275a=function(){return _0x3a9af3;};return a240_0x275a();}import{APP_RULE_TYPE_FLAG,appRuleError,appRuleFileName,projectAppRule,readAppRuleType}from'../../commands/rule/shared.js';export const ruleGet={'service':a240_0x361ae9(0x93),'command':'get','description':a240_0x361ae9(0x9a),'risk':a240_0x361ae9(0x97),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG],async 'validate'(_0x432ad9){readAppRuleType(_0x432ad9);},async 'execute'(_0x40e66d){const _0x2adac8=a240_0x361ae9,_0x4f05a8=readAppRuleType(_0x40e66d),_0x2a6588=await getAppRule(_0x40e66d['cookie'],{'appCode':_0x40e66d[_0x2adac8(0x90)],'type':_0x4f05a8});if(!_0x2a6588)throw appRuleError(_0x2adac8(0x9f),appRuleFileName(_0x4f05a8)+_0x2adac8(0x9b)+_0x40e66d['appCode']+'.',_0x2adac8(0x95)+_0x4f05a8+_0x2adac8(0x9d));return{'ok':!![],'data':{'rule':{...projectAppRule(_0x4f05a8,_0x2a6588),'content':_0x2a6588[_0x2adac8(0x94)]}},'message':'Loaded\x20'+appRuleFileName(_0x4f05a8)+_0x2adac8(0x96)+_0x40e66d[_0x2adac8(0x90)]};}};
@@ -1 +1 @@
1
- function a241_0x5adc(){const _0xcde255=['123519pDkvam','dryRun','990465TmuvJf','8iQluMO','2393046GpnxCB','379088UZOeCO','execute','150602coJvbz','696857LgMkIT','map','6XyOLTl','signal','11ZbJhnr','4rDKJGY','238860pBNbJL'];a241_0x5adc=function(){return _0xcde255;};return a241_0x5adc();}const a241_0x4ce8ae=a241_0x483c;(function(_0x1589f8,_0x329617){const _0x341316=a241_0x483c,_0x61baa9=_0x1589f8();while(!![]){try{const _0x289345=-parseInt(_0x341316(0x1f5))/0x1+parseInt(_0x341316(0x1f7))/0x2+parseInt(_0x341316(0x1f0))/0x3*(-parseInt(_0x341316(0x1ee))/0x4)+parseInt(_0x341316(0x1f2))/0x5+-parseInt(_0x341316(0x1fa))/0x6*(-parseInt(_0x341316(0x1f8))/0x7)+parseInt(_0x341316(0x1f3))/0x8*(parseInt(_0x341316(0x1f4))/0x9)+-parseInt(_0x341316(0x1ef))/0xa*(parseInt(_0x341316(0x1fc))/0xb);if(_0x289345===_0x329617)break;else _0x61baa9['push'](_0x61baa9['shift']());}catch(_0x42f69c){_0x61baa9['push'](_0x61baa9['shift']());}}}(a241_0x5adc,0x2f884));import{withKbManagementSession}from'../../core/kb-management-client.js';import{ruleGet}from'../../commands/rule/get.js';function a241_0x483c(_0x348730,_0x5ab5b9){_0x348730=_0x348730-0x1ee;const _0x5adce4=a241_0x5adc();let _0x483ca2=_0x5adce4[_0x348730];return _0x483ca2;}import{ruleList}from'../../commands/rule/list.js';import{ruleSet}from'../../commands/rule/set.js';export const ruleDefinitions=[ruleList,ruleGet,ruleSet][a241_0x4ce8ae(0x1f9)](_0x144f1c=>({..._0x144f1c,'execute':_0x18da17=>withKbManagementSession(_0x18da17[a241_0x4ce8ae(0x1fb)],()=>_0x144f1c[a241_0x4ce8ae(0x1f6)](_0x18da17)),..._0x144f1c['dryRun']?{'dryRun':_0x32fc0e=>withKbManagementSession(_0x32fc0e[a241_0x4ce8ae(0x1fb)],()=>_0x144f1c[a241_0x4ce8ae(0x1f1)](_0x32fc0e))}:{}}));
1
+ const a241_0x414f3f=a241_0x32bf;function a241_0x4951(){const _0x349258=['dryRun','12JUplMM','1134123UiQGsI','1163504hvGzBA','4ErWeIx','1437435UOVuHQ','728378RttJYv','217908bxyWia','execute','8812360hndFds','signal','map','3921200ffszcn','1lnhmOE'];a241_0x4951=function(){return _0x349258;};return a241_0x4951();}(function(_0x572a7b,_0x388e2d){const _0x25cc0f=a241_0x32bf,_0x473264=_0x572a7b();while(!![]){try{const _0x3686bd=parseInt(_0x25cc0f(0xa8))/0x1*(parseInt(_0x25cc0f(0xac))/0x2)+parseInt(_0x25cc0f(0xab))/0x3*(parseInt(_0x25cc0f(0xad))/0x4)+parseInt(_0x25cc0f(0xae))/0x5*(parseInt(_0x25cc0f(0xaa))/0x6)+parseInt(_0x25cc0f(0xa1))/0x7+-parseInt(_0x25cc0f(0xa7))/0x8+parseInt(_0x25cc0f(0xa2))/0x9+-parseInt(_0x25cc0f(0xa4))/0xa;if(_0x3686bd===_0x388e2d)break;else _0x473264['push'](_0x473264['shift']());}catch(_0xbc69e6){_0x473264['push'](_0x473264['shift']());}}}(a241_0x4951,0x4733f));import{withKbManagementSession}from'../../core/kb-management-client.js';import{ruleGet}from'../../commands/rule/get.js';import{ruleList}from'../../commands/rule/list.js';import{ruleSet}from'../../commands/rule/set.js';function a241_0x32bf(_0x401a88,_0x5bc92f){_0x401a88=_0x401a88-0xa1;const _0x49511a=a241_0x4951();let _0x32bf52=_0x49511a[_0x401a88];return _0x32bf52;}export const ruleDefinitions=[ruleList,ruleGet,ruleSet][a241_0x414f3f(0xa6)](_0x5bfe21=>({..._0x5bfe21,'execute':_0x257108=>withKbManagementSession(_0x257108[a241_0x414f3f(0xa5)],()=>_0x5bfe21[a241_0x414f3f(0xa3)](_0x257108)),..._0x5bfe21[a241_0x414f3f(0xa9)]?{'dryRun':_0x5bf0d1=>withKbManagementSession(_0x5bf0d1[a241_0x414f3f(0xa5)],()=>_0x5bfe21[a241_0x414f3f(0xa9)](_0x5bf0d1))}:{}}));
@@ -1 +1 @@
1
- const a242_0x911f55=a242_0x23f0;(function(_0xc780d0,_0x5e43c0){const _0x34edfd=a242_0x23f0,_0x34478c=_0xc780d0();while(!![]){try{const _0x96a9b7=-parseInt(_0x34edfd(0x107))/0x1*(-parseInt(_0x34edfd(0x10f))/0x2)+-parseInt(_0x34edfd(0x115))/0x3*(parseInt(_0x34edfd(0x106))/0x4)+-parseInt(_0x34edfd(0x111))/0x5*(parseInt(_0x34edfd(0x110))/0x6)+parseInt(_0x34edfd(0x10b))/0x7*(parseInt(_0x34edfd(0x117))/0x8)+parseInt(_0x34edfd(0x108))/0x9+-parseInt(_0x34edfd(0x114))/0xa+parseInt(_0x34edfd(0x116))/0xb;if(_0x96a9b7===_0x5e43c0)break;else _0x34478c['push'](_0x34478c['shift']());}catch(_0x331b8c){_0x34478c['push'](_0x34478c['shift']());}}}(a242_0x28ad,0xea86e));function a242_0x28ad(){const _0x59d57d=['Loaded\x20app\x20rule\x20configuration\x20for\x20','4stmRWB','1EOSVFg','3040452NoOClx','cookie','appCode','7WBBMmq','list','read','all','3023174TvCVky','930MrHcMc','895Vbedpr','List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','length','9206160osqXoa','3756093FbhGuT','12075294YrMcpW','1710760tIEDPR'];a242_0x28ad=function(){return _0x59d57d;};return a242_0x28ad();}function a242_0x23f0(_0x5649df,_0x347e18){_0x5649df=_0x5649df-0x106;const _0x28ad1c=a242_0x28ad();let _0x23f070=_0x28ad1c[_0x5649df];return _0x23f070;}import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';export const ruleList={'service':'rule','command':a242_0x911f55(0x10c),'description':a242_0x911f55(0x112),'risk':a242_0x911f55(0x10d),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0xc61db8){const _0x55ed74=a242_0x911f55,_0x2404fe=await Promise[_0x55ed74(0x10e)](APP_RULE_TYPES['map'](_0x393b9a=>getAppRule(_0xc61db8[_0x55ed74(0x109)],{'appCode':_0xc61db8[_0x55ed74(0x10a)],'type':_0x393b9a}))),_0x284cfd=APP_RULE_TYPES['map']((_0x13d624,_0x1e33d9)=>projectAppRule(_0x13d624,_0x2404fe[_0x1e33d9]??null));return{'ok':!![],'data':{'total':_0x284cfd[_0x55ed74(0x113)],'rules':_0x284cfd},'message':_0x55ed74(0x118)+_0xc61db8['appCode']};}};
1
+ const a242_0x34ac20=a242_0x5d7e;function a242_0x5d7e(_0x3e913c,_0x172aee){_0x3e913c=_0x3e913c-0x141;const _0x482795=a242_0x4827();let _0x5d7e6b=_0x482795[_0x3e913c];return _0x5d7e6b;}(function(_0x25b08,_0x4ad543){const _0x3d05c2=a242_0x5d7e,_0x378820=_0x25b08();while(!![]){try{const _0x2b59ff=parseInt(_0x3d05c2(0x14b))/0x1+-parseInt(_0x3d05c2(0x142))/0x2+-parseInt(_0x3d05c2(0x146))/0x3+-parseInt(_0x3d05c2(0x145))/0x4+-parseInt(_0x3d05c2(0x147))/0x5*(parseInt(_0x3d05c2(0x148))/0x6)+parseInt(_0x3d05c2(0x14e))/0x7+parseInt(_0x3d05c2(0x149))/0x8;if(_0x2b59ff===_0x4ad543)break;else _0x378820['push'](_0x378820['shift']());}catch(_0x587a95){_0x378820['push'](_0x378820['shift']());}}}(a242_0x4827,0x496de));import{getAppRule}from'../../core/api-client.js';function a242_0x4827(){const _0x535fe8=['1007810DfIUvt','map','appCode','2005416CLMdRY','46875fvFXDF','210aYpqiF','35322lFNoMq','4618448MOlhnu','cookie','523762IldJtF','read','List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','3274852bYqLhG','length'];a242_0x4827=function(){return _0x535fe8;};return a242_0x4827();}import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';export const ruleList={'service':'rule','command':'list','description':a242_0x34ac20(0x14d),'risk':a242_0x34ac20(0x14c),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x26ff25){const _0x4c86d1=a242_0x34ac20,_0x48a35d=await Promise['all'](APP_RULE_TYPES[_0x4c86d1(0x143)](_0x427de6=>getAppRule(_0x26ff25[_0x4c86d1(0x14a)],{'appCode':_0x26ff25[_0x4c86d1(0x144)],'type':_0x427de6}))),_0x1c51f6=APP_RULE_TYPES[_0x4c86d1(0x143)]((_0x100025,_0x47b7c1)=>projectAppRule(_0x100025,_0x48a35d[_0x47b7c1]??null));return{'ok':!![],'data':{'total':_0x1c51f6[_0x4c86d1(0x141)],'rules':_0x1c51f6},'message':'Loaded\x20app\x20rule\x20configuration\x20for\x20'+_0x26ff25[_0x4c86d1(0x144)]};}};
@@ -1 +1 @@
1
- const a243_0x1185c5=a243_0x14f6;(function(_0x25549e,_0x260528){const _0x517b60=a243_0x14f6,_0x215300=_0x25549e();while(!![]){try{const _0x3a9cfe=-parseInt(_0x517b60(0x13e))/0x1+-parseInt(_0x517b60(0x170))/0x2*(parseInt(_0x517b60(0x16b))/0x3)+-parseInt(_0x517b60(0x15f))/0x4+-parseInt(_0x517b60(0x178))/0x5+-parseInt(_0x517b60(0x172))/0x6+parseInt(_0x517b60(0x153))/0x7*(-parseInt(_0x517b60(0x156))/0x8)+parseInt(_0x517b60(0x159))/0x9;if(_0x3a9cfe===_0x260528)break;else _0x215300['push'](_0x215300['shift']());}catch(_0x2c96d9){_0x215300['push'](_0x215300['shift']());}}}(a243_0x4343,0xb0567));import{knowledgeDocumentsPath}from'../../core/api-client.js';import{getAppRule,isPlatformTransportFailure,saveAppRule}from'../../core/api-client.js';function a243_0x4343(){const _0x1760aa=['1571095soXeFQ','app_rule_verification_failed','unconfigured','\x20for\x20','rule','\x20version\x20changed\x20before\x20write.','app_rule_expected_version_invalid','app_rule_content_too_large','byteSize','417289APErou','trim','app_rule_version_mismatch','rabetbase\x20rule\x20get\x20--type\x20','Require\x20the\x20current\x20version\x20before\x20atomic\x20compare-and-set','--file\x20is\x20required.','write','content','The\x20received\x20rule\x20state\x20contradicts\x20the\x20requested\x20changes.','verified','planned','Expected\x20','number','input','version','replacement','UTF-8\x20Markdown\x20file\x20(RULES:\x202000\x20UTF-16\x20units;\x20DATABASE:\x205242880\x20units)','defineProperty','isSafeInteger','RULES','Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.','91BvAQdU','contentHash','flag','230856hgQuTY','Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20','beforeRecord','27155205GaXAtO','POST','create','type','\x20could\x20not\x20be\x20verified.','cause','95732vQBtRH','rules','\x20--format\x20compress','cookie','Use\x20read-only\x20rule\x20reconciliation;\x20do\x20not\x20resubmit\x20automatically.','The\x20set\x20request\x20was\x20sent,\x20but\x20','expected-version','appCode','before','.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.','string','file','28011VDtovG','update',';\x20current\x20version\x20is\x20','set','RULES\x20content\x20exceeds\x202000\x20UTF-16\x20units.','142Ahoxjp','expectedVersion','3008742gfgqXP','\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','DATABASE','Set\x20','str','Pass\x20a\x20UTF-8\x20Markdown\x20file.'];a243_0x4343=function(){return _0x1760aa;};return a243_0x4343();}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 a243_0x14f6(_0x47f191,_0x476cd6){_0x47f191=_0x47f191-0x13c;const _0x434398=a243_0x4343();let _0x14f6c5=_0x434398[_0x47f191];return _0x14f6c5;}function readSetInput(_0x164170){const _0x5cd121=a243_0x14f6,_0x1bd0df=readAppRuleType(_0x164170),_0x77527b=_0x164170[_0x5cd121(0x176)](_0x5cd121(0x16a))[_0x5cd121(0x13f)]();if(!_0x77527b)throw appRuleError('app_rule_file_required',_0x5cd121(0x143),_0x5cd121(0x177));const _0x2abc6e=_0x164170[_0x5cd121(0x155)](_0x5cd121(0x165));let _0x417558;if(_0x2abc6e!==undefined){_0x417558=Number(_0x2abc6e);if(!Number[_0x5cd121(0x150)](_0x417558)||_0x417558<0x0)throw appRuleError(_0x5cd121(0x17e),'--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.');}return{'type':_0x1bd0df,'file':_0x77527b,'expectedVersion':_0x417558};}async function prepareSet(_0x10ac2e){const _0x239a61=a243_0x14f6,_0x392952=readSetInput(_0x10ac2e),_0x418829=await readAppRuleFile(_0x392952[_0x239a61(0x16a)]);if(_0x392952[_0x239a61(0x15c)]===_0x239a61(0x160)&&_0x418829[_0x239a61(0x145)]['length']>0x7d0)throw appRuleError(_0x239a61(0x13c),_0x239a61(0x16f));const _0x3aad16=await getAppRule(_0x10ac2e['cookie'],{'appCode':_0x10ac2e[_0x239a61(0x166)],'type':_0x392952[_0x239a61(0x15c)]});if(_0x392952['expectedVersion']!==undefined&&(_0x3aad16?.[_0x239a61(0x14c)]??0x0)!==_0x392952[_0x239a61(0x171)])throw appRuleError(_0x239a61(0x140),appRuleFileName(_0x392952[_0x239a61(0x15c)])+_0x239a61(0x17d),_0x239a61(0x149)+_0x392952[_0x239a61(0x171)]+_0x239a61(0x16d)+(_0x3aad16?.[_0x239a61(0x14c)]??_0x239a61(0x17a))+_0x239a61(0x168));return{'input':_0x392952,'replacement':_0x418829,'beforeRecord':_0x3aad16,'before':projectAppRule(_0x392952[_0x239a61(0x15c)],_0x3aad16),'planned':{'type':_0x392952[_0x239a61(0x15c)],'fileName':appRuleFileName(_0x392952['type']),'contextScope':appRuleContextScope(_0x392952['type']),'enabled':!![],'appCode':_0x10ac2e[_0x239a61(0x166)],'scope':_0x239a61(0x160),'contentByteSize':_0x418829[_0x239a61(0x13d)],'contentHash':_0x418829[_0x239a61(0x154)]}};}function warningsFor(_0xe29dde){return[];}export const ruleSet={'service':a243_0x1185c5(0x17c),'command':a243_0x1185c5(0x16e),'description':'Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','risk':a243_0x1185c5(0x144),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':'file','type':a243_0x1185c5(0x169),'required':!![],'description':a243_0x1185c5(0x14e)},{'name':'expected-version','type':a243_0x1185c5(0x14a),'required':![],'description':a243_0x1185c5(0x142)}],async 'validate'(_0x405bad){readSetInput(_0x405bad);},async 'dryRun'(_0x53127d){const _0xdf161d=a243_0x1185c5,_0x41d556=await prepareSet(_0x53127d);return asDryRunResult({'operation':'set','selector':{'appCode':_0x53127d[_0xdf161d(0x166)],'scope':_0xdf161d(0x160),'type':_0x41d556[_0xdf161d(0x14b)][_0xdf161d(0x15c)]},'before':_0x41d556[_0xdf161d(0x167)],'after':_0x41d556[_0xdf161d(0x148)],'dryRun':!![],'backend':{'method':_0xdf161d(0x15a),'path':knowledgeDocumentsPath(_0xdf161d(0x160),_0x41d556[_0xdf161d(0x158)]?_0xdf161d(0x16c):_0xdf161d(0x15b)),'body':{'appCode':_0x53127d[_0xdf161d(0x166)],..._0x41d556[_0xdf161d(0x158)]?{'id':_0x41d556[_0xdf161d(0x158)]['id']}:{},'title':_0x41d556[_0xdf161d(0x14b)][_0xdf161d(0x15c)]===_0xdf161d(0x160)?_0xdf161d(0x151):_0xdf161d(0x174),'contentHash':_0x41d556['replacement'][_0xdf161d(0x154)],'contentByteSize':_0x41d556[_0xdf161d(0x14d)][_0xdf161d(0x13d)],..._0x41d556[_0xdf161d(0x158)]?{'expectedVersion':_0x41d556[_0xdf161d(0x158)][_0xdf161d(0x14c)]}:{}}},'warnings':warningsFor(_0x41d556[_0xdf161d(0x14b)][_0xdf161d(0x171)]),'verification':{'expectedVersion':_0x41d556[_0xdf161d(0x158)]?.['version']??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0xdf161d(0x141)+_0x41d556[_0xdf161d(0x14b)][_0xdf161d(0x15c)]+_0xdf161d(0x161)}},{'method':'POST','url':knowledgeDocumentsPath(_0xdf161d(0x160),_0x41d556[_0xdf161d(0x158)]?_0xdf161d(0x16c):_0xdf161d(0x15b))});},async 'execute'(_0x59bdc2){const _0x219581=a243_0x1185c5,_0x1289bd=await prepareSet(_0x59bdc2),_0x21c1d8=_0x1289bd['beforeRecord']===null?0x1:_0x1289bd[_0x219581(0x158)][_0x219581(0x14c)]+(_0x1289bd[_0x219581(0x158)][_0x219581(0x145)]===_0x1289bd[_0x219581(0x14d)][_0x219581(0x145)]?0x0:0x1);let _0x43bfd1,_0x2d7c20=![];try{_0x43bfd1=await saveAppRule(_0x59bdc2['cookie'],{'appCode':_0x59bdc2['appCode'],'type':_0x1289bd[_0x219581(0x14b)][_0x219581(0x15c)],'content':_0x1289bd[_0x219581(0x14d)][_0x219581(0x145)],'expectedVersion':_0x1289bd[_0x219581(0x158)]?.[_0x219581(0x14c)]??0x0,..._0x1289bd[_0x219581(0x158)]?{'id':_0x1289bd[_0x219581(0x158)]['id']}:{}});if(_0x43bfd1['version']!==_0x21c1d8||_0x43bfd1[_0x219581(0x145)]!==_0x1289bd[_0x219581(0x14d)]['content']||_0x1289bd['beforeRecord']!==null&&_0x43bfd1['id']!==_0x1289bd[_0x219581(0x158)]['id'])throw appRuleError(_0x219581(0x179),_0x219581(0x146),_0x219581(0x163));}catch(_0x2ac210){if(!isPlatformTransportFailure(_0x2ac210))throw _0x2ac210;_0x2d7c20=!![];}let _0x734a44;try{_0x734a44=await getAppRule(_0x59bdc2[_0x219581(0x162)],{'appCode':_0x59bdc2[_0x219581(0x166)],'type':_0x1289bd[_0x219581(0x14b)][_0x219581(0x15c)]});}catch(_0xc12a2b){const _0x17ad51=appRuleError(_0x2d7c20?'app_rule_set_outcome_unknown':'app_rule_verification_unavailable',_0x219581(0x164)+appRuleFileName(_0x1289bd[_0x219581(0x14b)]['type'])+_0x219581(0x15d),'Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.');Object[_0x219581(0x14f)](_0x17ad51,_0x219581(0x15e),{'value':_0xc12a2b,'enumerable':![]});throw _0x17ad51;}const _0x175e40=_0x734a44&&inspectAppRuleContent(_0x734a44[_0x219581(0x145)])[_0x219581(0x154)]===_0x1289bd['replacement'][_0x219581(0x154)],_0x3b1427=_0x734a44&&_0x734a44[_0x219581(0x14c)]===_0x21c1d8&&(!_0x43bfd1||_0x734a44['id']===_0x43bfd1['id']&&_0x734a44[_0x219581(0x14c)]===_0x43bfd1[_0x219581(0x14c)]);if(!_0x734a44||!_0x175e40||!_0x3b1427||_0x1289bd[_0x219581(0x158)]!==null&&_0x734a44['id']!==_0x1289bd[_0x219581(0x158)]['id'])throw appRuleError(_0x2d7c20?'app_rule_set_outcome_unknown':_0x219581(0x179),appRuleFileName(_0x1289bd[_0x219581(0x14b)][_0x219581(0x15c)])+_0x219581(0x173),_0x219581(0x157)+_0x1289bd[_0x219581(0x14b)]['type']+'\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.');const _0x4d95f4=warningsFor(_0x1289bd[_0x219581(0x14b)]['expectedVersion']);_0x2d7c20&&_0x4d95f4['push'](_0x219581(0x152));const _0x42c8f4=projectAppRule(_0x1289bd[_0x219581(0x14b)][_0x219581(0x15c)],_0x734a44);return{'ok':!![],'data':{'operation':_0x219581(0x16e),'selector':{'appCode':_0x59bdc2[_0x219581(0x166)],'scope':_0x219581(0x160),'type':_0x1289bd['input'][_0x219581(0x15c)]},'before':_0x1289bd[_0x219581(0x167)],'after':_0x42c8f4,'dryRun':![],'backend':{'method':_0x219581(0x15a),'path':knowledgeDocumentsPath(_0x219581(0x160),_0x1289bd[_0x219581(0x158)]?_0x219581(0x16c):_0x219581(0x15b))},'warnings':_0x4d95f4,'verification':{'status':_0x219581(0x147),'recoveredAfterUnknownResponse':_0x2d7c20,'expectedVersion':_0x1289bd['beforeRecord']?.[_0x219581(0x14c)]??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x219581(0x141)+_0x1289bd[_0x219581(0x14b)]['type']+_0x219581(0x161)}},'message':_0x219581(0x175)+appRuleFileName(_0x1289bd[_0x219581(0x14b)]['type'])+_0x219581(0x17b)+_0x59bdc2['appCode']};}};
1
+ const a243_0x52a21b=a243_0x3e7e;(function(_0x2f1cb5,_0x16837d){const _0x21e7ec=a243_0x3e7e,_0x2af9e9=_0x2f1cb5();while(!![]){try{const _0x193c1e=parseInt(_0x21e7ec(0x104))/0x1+-parseInt(_0x21e7ec(0x124))/0x2+parseInt(_0x21e7ec(0x128))/0x3+parseInt(_0x21e7ec(0x133))/0x4+parseInt(_0x21e7ec(0x132))/0x5*(-parseInt(_0x21e7ec(0x117))/0x6)+-parseInt(_0x21e7ec(0x111))/0x7*(-parseInt(_0x21e7ec(0x11c))/0x8)+-parseInt(_0x21e7ec(0x11a))/0x9;if(_0x193c1e===_0x16837d)break;else _0x2af9e9['push'](_0x2af9e9['shift']());}catch(_0x72c850){_0x2af9e9['push'](_0x2af9e9['shift']());}}}(a243_0x3cf0,0xdf979));import{knowledgeDocumentsPath}from'../../core/api-client.js';import{getAppRule,isPlatformTransportFailure,saveAppRule}from'../../core/api-client.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{APP_RULE_TYPE_FLAG,appRuleContextScope,appRuleError,appRuleFileName,inspectAppRuleContent,projectAppRule,readAppRuleFile,readAppRuleType}from'../../commands/rule/shared.js';function readSetInput(_0xa4c766){const _0x474f8d=a243_0x3e7e,_0x48cc30=readAppRuleType(_0xa4c766),_0x1c2be6=_0xa4c766['str'](_0x474f8d(0x127))[_0x474f8d(0x12b)]();if(!_0x1c2be6)throw appRuleError(_0x474f8d(0x114),'--file\x20is\x20required.',_0x474f8d(0x129));const _0x4d465f=_0xa4c766[_0x474f8d(0x11e)](_0x474f8d(0x11d));let _0x5a6f10;if(_0x4d465f!==undefined){_0x5a6f10=Number(_0x4d465f);if(!Number[_0x474f8d(0x134)](_0x5a6f10)||_0x5a6f10<0x0)throw appRuleError(_0x474f8d(0x106),_0x474f8d(0x11b));}return{'type':_0x48cc30,'file':_0x1c2be6,'expectedVersion':_0x5a6f10};}function a243_0x3cf0(){const _0x263bd2=['rule','app_rule_file_required','update','set','89988NFDTxz','The\x20received\x20rule\x20state\x20contradicts\x20the\x20requested\x20changes.','contentHash','12134655rfNzNM','--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','27584AQwpHD','expected-version','flag','unconfigured','POST','replacement','\x20version\x20changed\x20before\x20write.','\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','902454MBkDol','defineProperty','beforeRecord','file','3935031iyINgX','Pass\x20a\x20UTF-8\x20Markdown\x20file.','length','trim','appCode','planned','RULES','app_rule_verification_failed','write','The\x20set\x20request\x20was\x20sent,\x20but\x20','205ouYxEV','4114768pEZzXw','isSafeInteger','content','rabetbase\x20rule\x20get\x20--type\x20','string','app_rule_verification_unavailable','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','cookie','Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.','UTF-8\x20Markdown\x20file\x20(RULES:\x202000\x20UTF-16\x20units;\x20DATABASE:\x205242880\x20units)','DATABASE','create','\x20could\x20not\x20be\x20verified.','Require\x20the\x20current\x20version\x20before\x20atomic\x20compare-and-set','expectedVersion','Use\x20read-only\x20rule\x20reconciliation;\x20do\x20not\x20resubmit\x20automatically.','version','934736YjWPNq','before','app_rule_expected_version_invalid','app_rule_set_outcome_unknown','rules','input','\x20--format\x20compress',';\x20current\x20version\x20is\x20','Expected\x20','type','number','verified','Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.','112ATUSjc','push'];a243_0x3cf0=function(){return _0x263bd2;};return a243_0x3cf0();}async function prepareSet(_0xcd3c67){const _0x46d30e=a243_0x3e7e,_0x5b6c5c=readSetInput(_0xcd3c67),_0x121383=await readAppRuleFile(_0x5b6c5c[_0x46d30e(0x127)]);if(_0x5b6c5c[_0x46d30e(0x10d)]===_0x46d30e(0x108)&&_0x121383[_0x46d30e(0x135)][_0x46d30e(0x12a)]>0x7d0)throw appRuleError('app_rule_content_too_large','RULES\x20content\x20exceeds\x202000\x20UTF-16\x20units.');const _0x9af2d8=await getAppRule(_0xcd3c67[_0x46d30e(0x13a)],{'appCode':_0xcd3c67[_0x46d30e(0x12c)],'type':_0x5b6c5c['type']});if(_0x5b6c5c['expectedVersion']!==undefined&&(_0x9af2d8?.['version']??0x0)!==_0x5b6c5c[_0x46d30e(0x101)])throw appRuleError('app_rule_version_mismatch',appRuleFileName(_0x5b6c5c[_0x46d30e(0x10d)])+_0x46d30e(0x122),_0x46d30e(0x10c)+_0x5b6c5c[_0x46d30e(0x101)]+_0x46d30e(0x10b)+(_0x9af2d8?.[_0x46d30e(0x103)]??_0x46d30e(0x11f))+'.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.');return{'input':_0x5b6c5c,'replacement':_0x121383,'beforeRecord':_0x9af2d8,'before':projectAppRule(_0x5b6c5c['type'],_0x9af2d8),'planned':{'type':_0x5b6c5c['type'],'fileName':appRuleFileName(_0x5b6c5c[_0x46d30e(0x10d)]),'contextScope':appRuleContextScope(_0x5b6c5c[_0x46d30e(0x10d)]),'enabled':!![],'appCode':_0xcd3c67[_0x46d30e(0x12c)],'scope':_0x46d30e(0x108),'contentByteSize':_0x121383['byteSize'],'contentHash':_0x121383[_0x46d30e(0x119)]}};}function warningsFor(_0x587844){return[];}function a243_0x3e7e(_0x1ddd15,_0x335aaf){_0x1ddd15=_0x1ddd15-0x100;const _0x3cf095=a243_0x3cf0();let _0x3e7ee0=_0x3cf095[_0x1ddd15];return _0x3e7ee0;}export const ruleSet={'service':a243_0x52a21b(0x113),'command':a243_0x52a21b(0x116),'description':'Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','risk':a243_0x52a21b(0x130),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':a243_0x52a21b(0x127),'type':a243_0x52a21b(0x137),'required':!![],'description':a243_0x52a21b(0x13c)},{'name':a243_0x52a21b(0x11d),'type':a243_0x52a21b(0x10e),'required':![],'description':a243_0x52a21b(0x100)}],async 'validate'(_0x20a897){readSetInput(_0x20a897);},async 'dryRun'(_0x4d7637){const _0x100b6b=a243_0x52a21b,_0x463531=await prepareSet(_0x4d7637);return asDryRunResult({'operation':'set','selector':{'appCode':_0x4d7637[_0x100b6b(0x12c)],'scope':_0x100b6b(0x108),'type':_0x463531[_0x100b6b(0x109)][_0x100b6b(0x10d)]},'before':_0x463531[_0x100b6b(0x105)],'after':_0x463531[_0x100b6b(0x12d)],'dryRun':!![],'backend':{'method':_0x100b6b(0x120),'path':knowledgeDocumentsPath('rules',_0x463531[_0x100b6b(0x126)]?_0x100b6b(0x115):_0x100b6b(0x13e)),'body':{'appCode':_0x4d7637[_0x100b6b(0x12c)],..._0x463531[_0x100b6b(0x126)]?{'id':_0x463531[_0x100b6b(0x126)]['id']}:{},'title':_0x463531[_0x100b6b(0x109)][_0x100b6b(0x10d)]===_0x100b6b(0x108)?_0x100b6b(0x12e):_0x100b6b(0x13d),'contentHash':_0x463531[_0x100b6b(0x121)][_0x100b6b(0x119)],'contentByteSize':_0x463531['replacement']['byteSize'],..._0x463531[_0x100b6b(0x126)]?{'expectedVersion':_0x463531[_0x100b6b(0x126)]['version']}:{}}},'warnings':warningsFor(_0x463531[_0x100b6b(0x109)][_0x100b6b(0x101)]),'verification':{'expectedVersion':_0x463531[_0x100b6b(0x126)]?.['version']??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x100b6b(0x136)+_0x463531['input'][_0x100b6b(0x10d)]+_0x100b6b(0x10a)}},{'method':_0x100b6b(0x120),'url':knowledgeDocumentsPath(_0x100b6b(0x108),_0x463531[_0x100b6b(0x126)]?'update':_0x100b6b(0x13e))});},async 'execute'(_0x3a8625){const _0x9284f2=a243_0x52a21b,_0x3b8377=await prepareSet(_0x3a8625),_0x398b16=_0x3b8377[_0x9284f2(0x126)]===null?0x1:_0x3b8377[_0x9284f2(0x126)]['version']+(_0x3b8377[_0x9284f2(0x126)][_0x9284f2(0x135)]===_0x3b8377[_0x9284f2(0x121)]['content']?0x0:0x1);let _0x1b3c96,_0x2ce320=![];try{_0x1b3c96=await saveAppRule(_0x3a8625[_0x9284f2(0x13a)],{'appCode':_0x3a8625[_0x9284f2(0x12c)],'type':_0x3b8377[_0x9284f2(0x109)][_0x9284f2(0x10d)],'content':_0x3b8377[_0x9284f2(0x121)][_0x9284f2(0x135)],'expectedVersion':_0x3b8377[_0x9284f2(0x126)]?.[_0x9284f2(0x103)]??0x0,..._0x3b8377['beforeRecord']?{'id':_0x3b8377[_0x9284f2(0x126)]['id']}:{}});if(_0x1b3c96[_0x9284f2(0x103)]!==_0x398b16||_0x1b3c96[_0x9284f2(0x135)]!==_0x3b8377[_0x9284f2(0x121)][_0x9284f2(0x135)]||_0x3b8377[_0x9284f2(0x126)]!==null&&_0x1b3c96['id']!==_0x3b8377['beforeRecord']['id'])throw appRuleError('app_rule_verification_failed',_0x9284f2(0x118),_0x9284f2(0x102));}catch(_0x215a0d){if(!isPlatformTransportFailure(_0x215a0d))throw _0x215a0d;_0x2ce320=!![];}let _0x1f4bc4;try{_0x1f4bc4=await getAppRule(_0x3a8625[_0x9284f2(0x13a)],{'appCode':_0x3a8625[_0x9284f2(0x12c)],'type':_0x3b8377[_0x9284f2(0x109)][_0x9284f2(0x10d)]});}catch(_0x1243d0){const _0x61dcf3=appRuleError(_0x2ce320?_0x9284f2(0x107):_0x9284f2(0x138),_0x9284f2(0x131)+appRuleFileName(_0x3b8377['input'][_0x9284f2(0x10d)])+_0x9284f2(0x13f),_0x9284f2(0x110));Object[_0x9284f2(0x125)](_0x61dcf3,'cause',{'value':_0x1243d0,'enumerable':![]});throw _0x61dcf3;}const _0x54947a=_0x1f4bc4&&inspectAppRuleContent(_0x1f4bc4[_0x9284f2(0x135)])[_0x9284f2(0x119)]===_0x3b8377[_0x9284f2(0x121)][_0x9284f2(0x119)],_0x488ed9=_0x1f4bc4&&_0x1f4bc4[_0x9284f2(0x103)]===_0x398b16&&(!_0x1b3c96||_0x1f4bc4['id']===_0x1b3c96['id']&&_0x1f4bc4[_0x9284f2(0x103)]===_0x1b3c96[_0x9284f2(0x103)]);if(!_0x1f4bc4||!_0x54947a||!_0x488ed9||_0x3b8377['beforeRecord']!==null&&_0x1f4bc4['id']!==_0x3b8377[_0x9284f2(0x126)]['id'])throw appRuleError(_0x2ce320?_0x9284f2(0x107):_0x9284f2(0x12f),appRuleFileName(_0x3b8377['input'][_0x9284f2(0x10d)])+_0x9284f2(0x123),'Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20'+_0x3b8377[_0x9284f2(0x109)][_0x9284f2(0x10d)]+_0x9284f2(0x139));const _0x8a4820=warningsFor(_0x3b8377['input'][_0x9284f2(0x101)]);_0x2ce320&&_0x8a4820[_0x9284f2(0x112)](_0x9284f2(0x13b));const _0x29c728=projectAppRule(_0x3b8377[_0x9284f2(0x109)][_0x9284f2(0x10d)],_0x1f4bc4);return{'ok':!![],'data':{'operation':'set','selector':{'appCode':_0x3a8625[_0x9284f2(0x12c)],'scope':_0x9284f2(0x108),'type':_0x3b8377[_0x9284f2(0x109)][_0x9284f2(0x10d)]},'before':_0x3b8377[_0x9284f2(0x105)],'after':_0x29c728,'dryRun':![],'backend':{'method':'POST','path':knowledgeDocumentsPath(_0x9284f2(0x108),_0x3b8377[_0x9284f2(0x126)]?_0x9284f2(0x115):_0x9284f2(0x13e))},'warnings':_0x8a4820,'verification':{'status':_0x9284f2(0x10f),'recoveredAfterUnknownResponse':_0x2ce320,'expectedVersion':_0x3b8377[_0x9284f2(0x126)]?.[_0x9284f2(0x103)]??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x9284f2(0x136)+_0x3b8377[_0x9284f2(0x109)][_0x9284f2(0x10d)]+_0x9284f2(0x10a)}},'message':'Set\x20'+appRuleFileName(_0x3b8377[_0x9284f2(0x109)][_0x9284f2(0x10d)])+'\x20for\x20'+_0x3a8625[_0x9284f2(0x12c)]};}};
@@ -1 +1 @@
1
- const a244_0x22b0c3=a244_0x3b40;(function(_0x395138,_0xaadeb){const _0x5c777f=a244_0x3b40,_0xcb132e=_0x395138();while(!![]){try{const _0x541f86=parseInt(_0x5c777f(0x208))/0x1+-parseInt(_0x5c777f(0x20e))/0x2*(parseInt(_0x5c777f(0x203))/0x3)+-parseInt(_0x5c777f(0x1ec))/0x4*(-parseInt(_0x5c777f(0x1eb))/0x5)+-parseInt(_0x5c777f(0x1e0))/0x6+parseInt(_0x5c777f(0x204))/0x7*(parseInt(_0x5c777f(0x20a))/0x8)+-parseInt(_0x5c777f(0x1f4))/0x9*(-parseInt(_0x5c777f(0x201))/0xa)+-parseInt(_0x5c777f(0x1ed))/0xb;if(_0x541f86===_0xaadeb)break;else _0xcb132e['push'](_0xcb132e['shift']());}catch(_0xc59466){_0xcb132e['push'](_0xcb132e['shift']());}}}(a244_0x3792,0xac2c2));function a244_0x3792(){const _0x2a2ff2=['hex','10WZxJbl','474256WOwnjv','11678524pRGSEj','Pass\x20a\x20UTF-8\x20Markdown\x20file.','digest','decode','page-api-development','updateTime','content','9BGszHa','database','App\x20rule\x20file\x20is\x20blank:\x20','contentHash','str','app_rule_file_required','app_rule_content_too_large','appCode','App\x20rule\x20content\x20exceeds\x205242880\x20UTF-16\x20units.','length','Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','size','isFile','5427480VhhIbk','app_rule_file_invalid','819KAznTf','2872226nCIPWR','--file\x20is\x20required.','RULES.md','from','1338435gsjeeR','version','16SnUWPX','rules','Cannot\x20access\x20app\x20rule\x20file:\x20','byteSize','3236dBpUEb','trim','app_rule_file_unreadable','createTime','byteLength','message','4381986oWVJxs','app_rule_content_invalid','update','indexStatus','utf8','string','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','type','sha256','sha256:'];a244_0x3792=function(){return _0x2a2ff2;};return a244_0x3792();}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=[a244_0x22b0c3(0x20b),a244_0x22b0c3(0x1f5)];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_0x22b0c3(0x206),'database':'DATABASE.md'},APP_RULE_CONTEXT_SCOPES={'rules':a244_0x22b0c3(0x1f1),'database':'database-analysis'};export function appRuleError(_0x5404b1,_0x5a499d,_0x382d5a){return new CliError(_0x5404b1,0x1,_0x5a499d,_0x382d5a);}function a244_0x3b40(_0x407062,_0x1227f2){_0x407062=_0x407062-0x1de;const _0x37922c=a244_0x3792();let _0x3b4073=_0x37922c[_0x407062];return _0x3b4073;}export function readAppRuleType(_0x44108e){const _0x40e69f=a244_0x22b0c3,_0x5e5591=_0x44108e[_0x40e69f(0x1f8)](_0x40e69f(0x1e7))['trim']()['toLowerCase']();if(_0x5e5591!==_0x40e69f(0x20b)&&_0x5e5591!=='database')throw appRuleError('app_rule_type_invalid','--type\x20must\x20be\x20either\x20rules\x20or\x20database.');return _0x5e5591;}export function appRuleFileName(_0x4aa014){return APP_RULE_FILES[_0x4aa014];}export function appRuleContextScope(_0x1183ac){return APP_RULE_CONTEXT_SCOPES[_0x1183ac];}export function inspectAppRuleContent(_0x3f726f){const _0x4be4a0=a244_0x22b0c3,_0x44db4f=Buffer[_0x4be4a0(0x207)](_0x3f726f,_0x4be4a0(0x1e4));return{'content':_0x3f726f,'byteSize':_0x44db4f[_0x4be4a0(0x1de)],'contentHash':_0x4be4a0(0x1e9)+createHash(_0x4be4a0(0x1e8))[_0x4be4a0(0x1e2)](_0x44db4f)[_0x4be4a0(0x1ef)](_0x4be4a0(0x1ea))};}export async function readAppRuleFile(_0x5df32d){const _0x123f56=a244_0x22b0c3,_0x2bbbfe=_0x5df32d[_0x123f56(0x20f)]();if(!_0x2bbbfe)throw appRuleError(_0x123f56(0x1f9),_0x123f56(0x205),_0x123f56(0x1ee));const _0x11d347=resolve(_0x2bbbfe);let _0x2d35f7;try{_0x2d35f7=await stat(_0x11d347);}catch(_0x1b82e3){throw appRuleError('app_rule_file_unreadable',_0x123f56(0x20c)+_0x2bbbfe,_0x1b82e3 instanceof Error?_0x1b82e3[_0x123f56(0x1df)]:String(_0x1b82e3));}if(!_0x2d35f7[_0x123f56(0x200)]())throw appRuleError(_0x123f56(0x202),_0x123f56(0x1e6)+_0x2bbbfe);if(_0x2d35f7[_0x123f56(0x1ff)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x123f56(0x1fa),'App\x20rule\x20content\x20exceeds\x20the\x20bounded\x20UTF-8\x20file\x20limit.');let _0x278d94;try{_0x278d94=await readFile(_0x11d347);}catch(_0x4db0c8){throw appRuleError(_0x123f56(0x210),'Cannot\x20read\x20app\x20rule\x20file:\x20'+_0x2bbbfe,_0x4db0c8 instanceof Error?_0x4db0c8[_0x123f56(0x1df)]:String(_0x4db0c8));}if(_0x278d94[_0x123f56(0x1de)]>MAX_APP_RULE_BYTES)throw appRuleError('app_rule_content_too_large','App\x20rule\x20content\x20exceeds\x20the\x20bounded\x20UTF-8\x20file\x20limit.');let _0x3f7a87;try{_0x3f7a87=new TextDecoder('utf-8',{'fatal':!![],'ignoreBOM':!![]})[_0x123f56(0x1f0)](_0x278d94);}catch{throw appRuleError(_0x123f56(0x1e1),'App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20'+_0x2bbbfe);}if(_0x3f7a87[_0x123f56(0x1fd)]>MAX_APP_RULE_UNITS)throw appRuleError(_0x123f56(0x1fa),_0x123f56(0x1fc));if(!_0x3f7a87['trim']())throw appRuleError('app_rule_content_invalid',_0x123f56(0x1f6)+_0x2bbbfe);return inspectAppRuleContent(_0x3f7a87);}export function projectAppRule(_0xa0f201,_0xcdab46){const _0x4bb778=a244_0x22b0c3;if(!_0xcdab46)return{'type':_0xa0f201,'fileName':appRuleFileName(_0xa0f201),'contextScope':appRuleContextScope(_0xa0f201),'enabled':![]};const _0x3904e1=inspectAppRuleContent(_0xcdab46[_0x4bb778(0x1f3)]);return{'type':_0xa0f201,'fileName':appRuleFileName(_0xa0f201),'contextScope':appRuleContextScope(_0xa0f201),'enabled':!![],'id':_0xcdab46['id'],'scope':_0xcdab46['scope'],'appCode':_0xcdab46[_0x4bb778(0x1fb)],'version':_0xcdab46[_0x4bb778(0x209)],..._0xcdab46[_0x4bb778(0x1e3)]!==undefined?{'indexStatus':_0xcdab46[_0x4bb778(0x1e3)]}:{},'contentByteSize':_0x3904e1[_0x4bb778(0x20d)],'contentHash':_0x3904e1[_0x4bb778(0x1f7)],..._0xcdab46[_0x4bb778(0x211)]!==undefined&&_0xcdab46[_0x4bb778(0x211)]!==null?{'createTime':_0xcdab46[_0x4bb778(0x211)]}:{},..._0xcdab46['updateTime']!==undefined&&_0xcdab46[_0x4bb778(0x1f2)]!==null?{'updateTime':_0xcdab46[_0x4bb778(0x1f2)]}:{}};}export const APP_RULE_TYPE_FLAG={'name':a244_0x22b0c3(0x1e7),'type':a244_0x22b0c3(0x1e5),'required':!![],'description':a244_0x22b0c3(0x1fe),'enum':[...APP_RULE_TYPES]};
1
+ const a244_0x51cdfd=a244_0x4707;(function(_0x17cf5f,_0x26ec3f){const _0x2c105d=a244_0x4707,_0x80aa5a=_0x17cf5f();while(!![]){try{const _0x10481e=parseInt(_0x2c105d(0x178))/0x1+-parseInt(_0x2c105d(0x171))/0x2+parseInt(_0x2c105d(0x188))/0x3*(parseInt(_0x2c105d(0x169))/0x4)+parseInt(_0x2c105d(0x186))/0x5+parseInt(_0x2c105d(0x17b))/0x6*(parseInt(_0x2c105d(0x183))/0x7)+parseInt(_0x2c105d(0x16a))/0x8+-parseInt(_0x2c105d(0x16e))/0x9*(parseInt(_0x2c105d(0x17a))/0xa);if(_0x10481e===_0x26ec3f)break;else _0x80aa5a['push'](_0x80aa5a['shift']());}catch(_0x49a656){_0x80aa5a['push'](_0x80aa5a['shift']());}}}(a244_0x4617,0x6b2f6));import{createHash}from'node:crypto';import{readFile,stat}from'node:fs/promises';function a244_0x4617(){const _0x5567ee=['utf-8','database-analysis','app_rule_content_invalid','byteSize','createTime','Cannot\x20read\x20app\x20rule\x20file:\x20','RULES.md','appCode','digest','App\x20rule\x20file\x20is\x20blank:\x20','scope','isFile','--type\x20must\x20be\x20either\x20rules\x20or\x20database.','page-api-development','138452CUokGs','4777768VxWkHC','database','app_rule_type_invalid','rules','277083zFclcO','hex','App\x20rule\x20content\x20exceeds\x20the\x20bounded\x20UTF-8\x20file\x20limit.','1094446JRartx','str','trim','byteLength','toLowerCase','app_rule_file_unreadable','--file\x20is\x20required.','861863RMVhCv','contentHash','890jlKFeU','942wlDIWo','utf8','update','type','Cannot\x20access\x20app\x20rule\x20file:\x20','from','app_rule_file_invalid','indexStatus','31766nQSFrD','app_rule_file_required','DATABASE.md','3793235SZMCNG','updateTime','69vcPhBa','length','message','decode','app_rule_content_too_large'];a244_0x4617=function(){return _0x5567ee;};return a244_0x4617();}import{resolve}from'node:path';import{TextDecoder}from'node:util';import{CliError}from'../../errors.js';export const APP_RULE_TYPES=[a244_0x51cdfd(0x16d),'database'];function a244_0x4707(_0x28ade0,_0x3eff6c){_0x28ade0=_0x28ade0-0x163;const _0x46173d=a244_0x4617();let _0x47079d=_0x46173d[_0x28ade0];return _0x47079d;}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_0x51cdfd(0x193),'database':a244_0x51cdfd(0x185)},APP_RULE_CONTEXT_SCOPES={'rules':a244_0x51cdfd(0x168),'database':a244_0x51cdfd(0x18e)};export function appRuleError(_0x5c350b,_0x27cb2f,_0x424007){return new CliError(_0x5c350b,0x1,_0x27cb2f,_0x424007);}export function readAppRuleType(_0xa20dc0){const _0xf2ab47=a244_0x51cdfd,_0x1d519c=_0xa20dc0[_0xf2ab47(0x172)]('type')[_0xf2ab47(0x173)]()[_0xf2ab47(0x175)]();if(_0x1d519c!==_0xf2ab47(0x16d)&&_0x1d519c!==_0xf2ab47(0x16b))throw appRuleError(_0xf2ab47(0x16c),_0xf2ab47(0x167));return _0x1d519c;}export function appRuleFileName(_0x3b5aeb){return APP_RULE_FILES[_0x3b5aeb];}export function appRuleContextScope(_0x166672){return APP_RULE_CONTEXT_SCOPES[_0x166672];}export function inspectAppRuleContent(_0x4b4a9b){const _0x565f71=a244_0x51cdfd,_0x43d295=Buffer[_0x565f71(0x180)](_0x4b4a9b,_0x565f71(0x17c));return{'content':_0x4b4a9b,'byteSize':_0x43d295[_0x565f71(0x174)],'contentHash':'sha256:'+createHash('sha256')[_0x565f71(0x17d)](_0x43d295)[_0x565f71(0x163)](_0x565f71(0x16f))};}export async function readAppRuleFile(_0x58c9fe){const _0x14a9ec=a244_0x51cdfd,_0x5b4d29=_0x58c9fe[_0x14a9ec(0x173)]();if(!_0x5b4d29)throw appRuleError(_0x14a9ec(0x184),_0x14a9ec(0x177),'Pass\x20a\x20UTF-8\x20Markdown\x20file.');const _0x5871d0=resolve(_0x5b4d29);let _0x1470ad;try{_0x1470ad=await stat(_0x5871d0);}catch(_0x57752e){throw appRuleError(_0x14a9ec(0x176),_0x14a9ec(0x17f)+_0x5b4d29,_0x57752e instanceof Error?_0x57752e[_0x14a9ec(0x18a)]:String(_0x57752e));}if(!_0x1470ad[_0x14a9ec(0x166)]())throw appRuleError(_0x14a9ec(0x181),'App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x5b4d29);if(_0x1470ad['size']>MAX_APP_RULE_BYTES)throw appRuleError(_0x14a9ec(0x18c),_0x14a9ec(0x170));let _0x38d16f;try{_0x38d16f=await readFile(_0x5871d0);}catch(_0xb41087){throw appRuleError(_0x14a9ec(0x176),_0x14a9ec(0x192)+_0x5b4d29,_0xb41087 instanceof Error?_0xb41087[_0x14a9ec(0x18a)]:String(_0xb41087));}if(_0x38d16f['byteLength']>MAX_APP_RULE_BYTES)throw appRuleError(_0x14a9ec(0x18c),_0x14a9ec(0x170));let _0x256601;try{_0x256601=new TextDecoder(_0x14a9ec(0x18d),{'fatal':!![],'ignoreBOM':!![]})[_0x14a9ec(0x18b)](_0x38d16f);}catch{throw appRuleError(_0x14a9ec(0x18f),'App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20'+_0x5b4d29);}if(_0x256601[_0x14a9ec(0x189)]>MAX_APP_RULE_UNITS)throw appRuleError(_0x14a9ec(0x18c),'App\x20rule\x20content\x20exceeds\x205242880\x20UTF-16\x20units.');if(!_0x256601[_0x14a9ec(0x173)]())throw appRuleError(_0x14a9ec(0x18f),_0x14a9ec(0x164)+_0x5b4d29);return inspectAppRuleContent(_0x256601);}export function projectAppRule(_0x1641f2,_0x368498){const _0x21d5d9=a244_0x51cdfd;if(!_0x368498)return{'type':_0x1641f2,'fileName':appRuleFileName(_0x1641f2),'contextScope':appRuleContextScope(_0x1641f2),'enabled':![]};const _0x5da2ea=inspectAppRuleContent(_0x368498['content']);return{'type':_0x1641f2,'fileName':appRuleFileName(_0x1641f2),'contextScope':appRuleContextScope(_0x1641f2),'enabled':!![],'id':_0x368498['id'],'scope':_0x368498[_0x21d5d9(0x165)],'appCode':_0x368498[_0x21d5d9(0x194)],'version':_0x368498['version'],..._0x368498[_0x21d5d9(0x182)]!==undefined?{'indexStatus':_0x368498['indexStatus']}:{},'contentByteSize':_0x5da2ea[_0x21d5d9(0x190)],'contentHash':_0x5da2ea[_0x21d5d9(0x179)],..._0x368498[_0x21d5d9(0x191)]!==undefined&&_0x368498[_0x21d5d9(0x191)]!==null?{'createTime':_0x368498[_0x21d5d9(0x191)]}:{},..._0x368498[_0x21d5d9(0x187)]!==undefined&&_0x368498['updateTime']!==null?{'updateTime':_0x368498[_0x21d5d9(0x187)]}:{}};}export const APP_RULE_TYPE_FLAG={'name':a244_0x51cdfd(0x17e),'type':'string','required':!![],'description':'Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','enum':[...APP_RULE_TYPES]};
@@ -1 +1 @@
1
- const a245_0x4fb4ff=a245_0x35a6;(function(_0x348bbc,_0x14eb71){const _0x15aedb=a245_0x35a6,_0x5905c1=_0x348bbc();while(!![]){try{const _0x1662d5=parseInt(_0x15aedb(0xe7))/0x1*(parseInt(_0x15aedb(0xe8))/0x2)+-parseInt(_0x15aedb(0xe2))/0x3+-parseInt(_0x15aedb(0xe4))/0x4+-parseInt(_0x15aedb(0xf4))/0x5+parseInt(_0x15aedb(0x106))/0x6+-parseInt(_0x15aedb(0xe5))/0x7+parseInt(_0x15aedb(0x117))/0x8;if(_0x1662d5===_0x14eb71)break;else _0x5905c1['push'](_0x5905c1['shift']());}catch(_0x2a1425){_0x5905c1['push'](_0x5905c1['shift']());}}}(a245_0x2acb,0x19543));function a245_0x2acb(){const _0x4d33cf=['dev','error','parse','npm','join','write','\x20exited\x20with\x20code\x20','script','keys','245028heqZWM','package.json','204128UNAPjy','417221rJpSGH','boolean','297ukNyLJ','906amlojw','scripts','pnpm-lock.yaml','validation','path','No\x20package.json\x20found\x20in\x20current\x20directory.','args','.bin','push','\x22\x20not\x20found\x20in\x20package.json.','close','--watch','724550jbCQnU','(none)','Script\x20\x22','length','\x0a\x20\x20Available\x20scripts:\x0a','log','run','\x0a\x20\x20Usage:\x20','cwd','vite','preview','Available:\x20','bun.lock','inherit','No\x20scripts\x20defined\x20in\x20package.json.','start','\x20run\x20build','\x20\x20EXAMPLES','572244TKDXcs','\x20\x20\x20\x20','\x20run\x20preview\x20--watch','bun','changed','has','\x20run\x20<script>\x0a','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','utf-8','\x20run\x20start','node_modules','\x20run\x20','needsUpgrade','Script\x20name\x20defined\x20in\x20package.json','bool','watch','yarn.lock','1688424CEqwEl'];a245_0x2acb=function(){return _0x4d33cf;};return a245_0x2acb();}import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{findProjectRootDirectory,resolveConfigPath}from'../../context/config-loader.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';function a245_0x35a6(_0x18066b,_0x2996b7){_0x18066b=_0x18066b-0xd9;const _0x2acbc7=a245_0x2acb();let _0x35a64f=_0x2acbc7[_0x18066b];return _0x35a64f;}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_0x4fb4ff(0x103),'dev']),DOMAIN_ROUTING_SYNC_SCRIPTS=new Set([a245_0x4fb4ff(0x103),a245_0x4fb4ff(0xd9),'build',a245_0x4fb4ff(0xfe)]);export function syncProjectDomainRoutingBeforeScript(_0x23e1bc,_0x4640d8){const _0x2df660=a245_0x4fb4ff;if(!DOMAIN_ROUTING_SYNC_SCRIPTS[_0x2df660(0x10b)](_0x4640d8))return null;const _0x49cccc=findProjectRootDirectory(_0x23e1bc);if(!resolveConfigPath(_0x49cccc))return null;const _0x5c1feb=writeProjectDomainRoutingManifest(_0x49cccc);return{'path':_0x5c1feb[_0x2df660(0xec)],'changed':_0x5c1feb[_0x2df660(0x10a)]};}function readPackageScripts(_0x5208c8){const _0x5046e1=a245_0x4fb4ff,_0x35e2ba=resolve(_0x5208c8,_0x5046e1(0xe3));if(!existsSync(_0x35e2ba))return null;try{const _0x43e5b9=JSON[_0x5046e1(0xdb)](readFileSync(_0x35e2ba,_0x5046e1(0x10e)));return _0x43e5b9[_0x5046e1(0xe9)]??{};}catch{return null;}}function detectPackageManager(_0x3100f1){const _0x301c65=a245_0x4fb4ff;if(existsSync(resolve(_0x3100f1,'bun.lockb'))||existsSync(resolve(_0x3100f1,_0x301c65(0x100))))return _0x301c65(0x109);if(existsSync(resolve(_0x3100f1,_0x301c65(0xea))))return'pnpm';if(existsSync(resolve(_0x3100f1,_0x301c65(0x116))))return'yarn';return _0x301c65(0xdc);}async function versionCheck(_0x205ade){const _0x2591d4=a245_0x4fb4ff,_0x467a17=await checkCliVersion();(_0x467a17[_0x2591d4(0x112)]||_0x467a17['belowMinimum'])&&(printCliUpgradeWarning(_0x467a17),assertCliVersionSupported(_0x467a17));const _0xe7d1a6=await checkSdkVersion(_0x205ade);if(_0xe7d1a6[_0x2591d4(0x112)])printSdkUpgradeWarning(_0xe7d1a6);}function spawnScript(_0x490873,_0x47caf3,_0x36fc86,_0x3779d5){return new Promise((_0x304f65,_0x290b64)=>{const _0x4feb7d=a245_0x35a6,_0x56427e=[_0x4feb7d(0xfa),_0x47caf3,..._0x36fc86],_0x14538e=spawn(_0x490873,_0x56427e,{'cwd':_0x3779d5,'stdio':_0x4feb7d(0x101),'shell':!![],'env':{...process.env,'PATH':''+join(_0x3779d5,_0x4feb7d(0x110),_0x4feb7d(0xef))+delimiter+process.env.PATH}});_0x14538e['on'](_0x4feb7d(0xf2),_0x9513e7=>{const _0x4d293a=_0x4feb7d;if(_0x9513e7===0x0||_0x9513e7===null)_0x304f65();else _0x290b64(new Error(_0x490873+_0x4d293a(0x111)+_0x47caf3+_0x4d293a(0xdf)+_0x9513e7));}),_0x14538e['on'](_0x4feb7d(0xda),_0x290b64);});}function spawnViteBuildWatch(_0x3907f6){return new Promise((_0x25f8ad,_0x1ebacf)=>{const _0x49a6dd=a245_0x35a6,_0x44b882=spawn(_0x49a6dd(0xfd),['build',_0x49a6dd(0xf3)],{'cwd':_0x3907f6,'stdio':_0x49a6dd(0x101),'shell':!![],'env':{...process.env,'PATH':''+join(_0x3907f6,_0x49a6dd(0x110),_0x49a6dd(0xef))+delimiter+process.env.PATH}});_0x44b882['on']('close',_0x100fb4=>{const _0x1b8de7=_0x49a6dd;if(_0x100fb4===0x0||_0x100fb4===null)_0x25f8ad();else _0x1ebacf(new Error(_0x1b8de7(0x10d)+_0x100fb4));}),_0x44b882['on'](_0x49a6dd(0xda),_0x1ebacf);});}function spawnVitePreview(_0x453408){return new Promise((_0x3b083d,_0x4c0f59)=>{const _0x55d68e=a245_0x35a6,_0x3df2cc=spawn('vite',[_0x55d68e(0xfe)],{'cwd':_0x453408,'stdio':_0x55d68e(0x101),'shell':!![],'env':{...process.env,'PATH':''+join(_0x453408,_0x55d68e(0x110),'.bin')+delimiter+process.env.PATH}});_0x3df2cc['on'](_0x55d68e(0xf2),_0x5bbdfa=>{if(_0x5bbdfa===0x0||_0x5bbdfa===null)_0x3b083d();else _0x4c0f59(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x5bbdfa));}),_0x3df2cc['on'](_0x55d68e(0xda),_0x4c0f59);});}const runFlags=[{'name':'watch','type':a245_0x4fb4ff(0xe6),'description':'Enable\x20watch\x20mode\x20for\x20preview','default':![]}];export const runDefinition={'service':a245_0x4fb4ff(0xfa),'command':a245_0x4fb4ff(0xfa),'description':'Run\x20a\x20package.json\x20script','risk':a245_0x4fb4ff(0xde),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a245_0x4fb4ff(0xe0),'description':a245_0x4fb4ff(0x113),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x2fa9d6=a245_0x4fb4ff,_0x229e45=[];return _0x229e45[_0x2fa9d6(0xf0)](_0x2fa9d6(0x105)),_0x229e45['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x2fa9d6(0x10f)),_0x229e45[_0x2fa9d6(0xf0)](_0x2fa9d6(0x107)+CLI_BIN_NAME+_0x2fa9d6(0x104)),_0x229e45[_0x2fa9d6(0xf0)](_0x2fa9d6(0x107)+CLI_BIN_NAME+'\x20run\x20preview'),_0x229e45[_0x2fa9d6(0xf0)](_0x2fa9d6(0x107)+CLI_BIN_NAME+_0x2fa9d6(0x108)),_0x229e45[_0x2fa9d6(0xdd)]('\x0a');},async 'execute'(_0x43e494){const _0x4b690c=a245_0x4fb4ff,_0x3623bf=process[_0x4b690c(0xfc)](),_0x3766e6=_0x43e494[_0x4b690c(0xee)][0x0],_0x24710d=_0x43e494[_0x4b690c(0xee)]['slice'](0x1),_0x2a1715=readPackageScripts(_0x3623bf);if(!_0x2a1715)throw CliErrors[_0x4b690c(0xeb)](_0x4b690c(0xed));if(!_0x3766e6){const _0x430756=Object[_0x4b690c(0xe1)](_0x2a1715);if(_0x430756[_0x4b690c(0xf7)]===0x0)console[_0x4b690c(0xf9)](_0x4b690c(0x102));else{console[_0x4b690c(0xf9)](_0x4b690c(0xf8));for(const _0x2f9f23 of _0x430756){console['log'](_0x4b690c(0x107)+_0x2f9f23);}console[_0x4b690c(0xf9)](_0x4b690c(0xfb)+CLI_BIN_NAME+_0x4b690c(0x10c));}return{'ok':!![]};}if(!_0x2a1715[_0x3766e6])throw CliErrors[_0x4b690c(0xeb)](_0x4b690c(0xf6)+_0x3766e6+_0x4b690c(0xf1),_0x4b690c(0xff)+(Object[_0x4b690c(0xe1)](_0x2a1715)['join'](',\x20')||_0x4b690c(0xf5)));const _0x73ea50=detectPackageManager(_0x3623bf),_0x2dbdce=syncProjectDomainRoutingBeforeScript(_0x3623bf,_0x3766e6);_0x2dbdce?.['changed']&&console['error']('Domain\x20routing\x20synchronized:\x20'+_0x2dbdce['path']);VERSION_CHECK_SCRIPTS[_0x4b690c(0x10b)](_0x3766e6)&&await versionCheck(_0x3623bf);if(_0x3766e6===_0x4b690c(0xfe)&&_0x43e494[_0x4b690c(0x114)](_0x4b690c(0x115)))return await Promise['all']([spawnViteBuildWatch(_0x3623bf),spawnVitePreview(_0x3623bf)]),{'ok':!![]};return await spawnScript(_0x73ea50,_0x3766e6,_0x24710d,_0x3623bf),{'ok':!![]};}};
1
+ const a245_0xdccf54=a245_0x34df;(function(_0x28be9c,_0x590ec8){const _0x21b32a=a245_0x34df,_0x1c2a77=_0x28be9c();while(!![]){try{const _0x534fab=-parseInt(_0x21b32a(0x14b))/0x1*(parseInt(_0x21b32a(0x17e))/0x2)+-parseInt(_0x21b32a(0x185))/0x3+-parseInt(_0x21b32a(0x14d))/0x4+parseInt(_0x21b32a(0x14e))/0x5*(parseInt(_0x21b32a(0x16b))/0x6)+-parseInt(_0x21b32a(0x186))/0x7+-parseInt(_0x21b32a(0x14c))/0x8*(-parseInt(_0x21b32a(0x16a))/0x9)+parseInt(_0x21b32a(0x16c))/0xa*(parseInt(_0x21b32a(0x168))/0xb);if(_0x534fab===_0x590ec8)break;else _0x1c2a77['push'](_0x1c2a77['shift']());}catch(_0x258fd7){_0x1c2a77['push'](_0x1c2a77['shift']());}}}(a245_0x5ea9,0x20446));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{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_0xdccf54(0x15c),a245_0xdccf54(0x152)]),DOMAIN_ROUTING_SYNC_SCRIPTS=new Set([a245_0xdccf54(0x15c),a245_0xdccf54(0x152),a245_0xdccf54(0x156),a245_0xdccf54(0x170)]);export function syncProjectDomainRoutingBeforeScript(_0xe869a2,_0x41acbd){const _0x1f33bb=a245_0xdccf54;if(!DOMAIN_ROUTING_SYNC_SCRIPTS[_0x1f33bb(0x15a)](_0x41acbd))return null;const _0x4ecb11=findProjectRootDirectory(_0xe869a2);if(!resolveConfigPath(_0x4ecb11))return null;const _0x7620e1=writeProjectDomainRoutingManifest(_0x4ecb11);return{'path':_0x7620e1[_0x1f33bb(0x148)],'changed':_0x7620e1[_0x1f33bb(0x155)]};}function readPackageScripts(_0x38a51b){const _0x249530=a245_0xdccf54,_0x3b4788=resolve(_0x38a51b,_0x249530(0x154));if(!existsSync(_0x3b4788))return null;try{const _0x2a1bcc=JSON[_0x249530(0x143)](readFileSync(_0x3b4788,'utf-8'));return _0x2a1bcc[_0x249530(0x157)]??{};}catch{return null;}}function a245_0x34df(_0x566757,_0x4bf1f5){_0x566757=_0x566757-0x143;const _0x5ea96d=a245_0x5ea9();let _0x34df9f=_0x5ea96d[_0x566757];return _0x34df9f;}function a245_0x5ea9(){const _0x163746=['boolean','41274qiwMXT','303018bFBNVb','2133580EdjMZM','Domain\x20routing\x20synchronized:\x20','error','(none)','preview','Run\x20a\x20package.json\x20script','\x0a\x20\x20Usage:\x20','slice','yarn.lock','vite\x20preview\x20exited\x20with\x20code\x20','vite','node_modules','belowMinimum','length','\x20run\x20start','validation','\x20run\x20build','write','99416SpVQgK','\x20run\x20preview\x20--watch','\x22\x20not\x20found\x20in\x20package.json.','yarn','join','close','\x0a\x20\x20Available\x20scripts:\x0a','28017uWwWxv','257425ikFHgK','bun.lockb','needsUpgrade','pnpm-lock.yaml','parse','No\x20package.json\x20found\x20in\x20current\x20directory.','Script\x20\x22','keys','No\x20scripts\x20defined\x20in\x20package.json.','path','\x20\x20EXAMPLES','Available:\x20','3ZXZGsh','280jvsQmI','791892KtnqQG','15zFJhZF','bun.lock','log','inherit','dev','Enable\x20watch\x20mode\x20for\x20preview','package.json','changed','build','scripts','pnpm','args','has','\x20\x20\x20\x20','start','script','\x20run\x20<script>\x0a','.bin','npm','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','\x20run\x20','bool','\x20exited\x20with\x20code\x20','watch','push','run','11ExFvEN'];a245_0x5ea9=function(){return _0x163746;};return a245_0x5ea9();}function detectPackageManager(_0x150966){const _0x24475a=a245_0xdccf54;if(existsSync(resolve(_0x150966,_0x24475a(0x187)))||existsSync(resolve(_0x150966,_0x24475a(0x14f))))return'bun';if(existsSync(resolve(_0x150966,_0x24475a(0x189))))return _0x24475a(0x158);if(existsSync(resolve(_0x150966,_0x24475a(0x174))))return _0x24475a(0x181);return _0x24475a(0x160);}async function versionCheck(_0x167455){const _0x4f580b=a245_0xdccf54,_0x402d29=await checkCliVersion();(_0x402d29['needsUpgrade']||_0x402d29[_0x4f580b(0x178)])&&(printCliUpgradeWarning(_0x402d29),assertCliVersionSupported(_0x402d29));const _0x226f43=await checkSdkVersion(_0x167455);if(_0x226f43[_0x4f580b(0x188)])printSdkUpgradeWarning(_0x226f43);}function spawnScript(_0xc2ebed,_0x15aaa0,_0x294bf1,_0x2a545f){return new Promise((_0x2433b3,_0x5792bc)=>{const _0x125f59=a245_0x34df,_0x44a930=['run',_0x15aaa0,..._0x294bf1],_0x574647=spawn(_0xc2ebed,_0x44a930,{'cwd':_0x2a545f,'stdio':_0x125f59(0x151),'shell':!![],'env':{...process.env,'PATH':''+join(_0x2a545f,_0x125f59(0x177),_0x125f59(0x15f))+delimiter+process.env.PATH}});_0x574647['on'](_0x125f59(0x183),_0x59528d=>{const _0x3b71c4=_0x125f59;if(_0x59528d===0x0||_0x59528d===null)_0x2433b3();else _0x5792bc(new Error(_0xc2ebed+_0x3b71c4(0x162)+_0x15aaa0+_0x3b71c4(0x164)+_0x59528d));}),_0x574647['on']('error',_0x5792bc);});}function spawnViteBuildWatch(_0x3d6c4b){return new Promise((_0x2f3416,_0x3e9556)=>{const _0x22e205=a245_0x34df,_0x4b3e7c=spawn('vite',[_0x22e205(0x156),'--watch'],{'cwd':_0x3d6c4b,'stdio':_0x22e205(0x151),'shell':!![],'env':{...process.env,'PATH':''+join(_0x3d6c4b,_0x22e205(0x177),_0x22e205(0x15f))+delimiter+process.env.PATH}});_0x4b3e7c['on'](_0x22e205(0x183),_0x1a9576=>{const _0x56bfc9=_0x22e205;if(_0x1a9576===0x0||_0x1a9576===null)_0x2f3416();else _0x3e9556(new Error(_0x56bfc9(0x161)+_0x1a9576));}),_0x4b3e7c['on'](_0x22e205(0x16e),_0x3e9556);});}function spawnVitePreview(_0x19cb27){return new Promise((_0x215f31,_0x2ce755)=>{const _0x34a2e1=a245_0x34df,_0x2323a2=spawn(_0x34a2e1(0x176),[_0x34a2e1(0x170)],{'cwd':_0x19cb27,'stdio':_0x34a2e1(0x151),'shell':!![],'env':{...process.env,'PATH':''+join(_0x19cb27,'node_modules','.bin')+delimiter+process.env.PATH}});_0x2323a2['on'](_0x34a2e1(0x183),_0x4347b3=>{const _0x857528=_0x34a2e1;if(_0x4347b3===0x0||_0x4347b3===null)_0x215f31();else _0x2ce755(new Error(_0x857528(0x175)+_0x4347b3));}),_0x2323a2['on']('error',_0x2ce755);});}const runFlags=[{'name':a245_0xdccf54(0x165),'type':a245_0xdccf54(0x169),'description':a245_0xdccf54(0x153),'default':![]}];export const runDefinition={'service':a245_0xdccf54(0x167),'command':a245_0xdccf54(0x167),'description':a245_0xdccf54(0x171),'risk':a245_0xdccf54(0x17d),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a245_0xdccf54(0x15d),'description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x334952=a245_0xdccf54,_0x421413=[];return _0x421413[_0x334952(0x166)](_0x334952(0x149)),_0x421413[_0x334952(0x166)](_0x334952(0x15b)+CLI_BIN_NAME+_0x334952(0x17a)),_0x421413['push'](_0x334952(0x15b)+CLI_BIN_NAME+_0x334952(0x17c)),_0x421413[_0x334952(0x166)](_0x334952(0x15b)+CLI_BIN_NAME+'\x20run\x20preview'),_0x421413[_0x334952(0x166)](_0x334952(0x15b)+CLI_BIN_NAME+_0x334952(0x17f)),_0x421413[_0x334952(0x182)]('\x0a');},async 'execute'(_0x3dc1e1){const _0x5bbabe=a245_0xdccf54,_0x38a3d2=process['cwd'](),_0x565adb=_0x3dc1e1[_0x5bbabe(0x159)][0x0],_0x340354=_0x3dc1e1[_0x5bbabe(0x159)][_0x5bbabe(0x173)](0x1),_0x4e365f=readPackageScripts(_0x38a3d2);if(!_0x4e365f)throw CliErrors[_0x5bbabe(0x17b)](_0x5bbabe(0x144));if(!_0x565adb){const _0x4fa296=Object[_0x5bbabe(0x146)](_0x4e365f);if(_0x4fa296[_0x5bbabe(0x179)]===0x0)console[_0x5bbabe(0x150)](_0x5bbabe(0x147));else{console['log'](_0x5bbabe(0x184));for(const _0x241bcb of _0x4fa296){console[_0x5bbabe(0x150)](_0x5bbabe(0x15b)+_0x241bcb);}console['log'](_0x5bbabe(0x172)+CLI_BIN_NAME+_0x5bbabe(0x15e));}return{'ok':!![]};}if(!_0x4e365f[_0x565adb])throw CliErrors['validation'](_0x5bbabe(0x145)+_0x565adb+_0x5bbabe(0x180),_0x5bbabe(0x14a)+(Object[_0x5bbabe(0x146)](_0x4e365f)[_0x5bbabe(0x182)](',\x20')||_0x5bbabe(0x16f)));const _0x374da2=detectPackageManager(_0x38a3d2),_0x3049fb=syncProjectDomainRoutingBeforeScript(_0x38a3d2,_0x565adb);_0x3049fb?.[_0x5bbabe(0x155)]&&console['error'](_0x5bbabe(0x16d)+_0x3049fb[_0x5bbabe(0x148)]);VERSION_CHECK_SCRIPTS['has'](_0x565adb)&&await versionCheck(_0x38a3d2);if(_0x565adb===_0x5bbabe(0x170)&&_0x3dc1e1[_0x5bbabe(0x163)](_0x5bbabe(0x165)))return await Promise['all']([spawnViteBuildWatch(_0x38a3d2),spawnVitePreview(_0x38a3d2)]),{'ok':!![]};return await spawnScript(_0x374da2,_0x565adb,_0x340354,_0x38a3d2),{'ok':!![]};}};
@@ -1 +1 @@
1
- const a246_0x24d8a3=a246_0x49d8;function a246_0x49d8(_0x246604,_0x5affea){_0x246604=_0x246604-0x1f3;const _0x304dd4=a246_0x304d();let _0x49d825=_0x304dd4[_0x246604];return _0x49d825;}(function(_0x3bbb86,_0x2a1587){const _0x27fb48=a246_0x49d8,_0xad5b92=_0x3bbb86();while(!![]){try{const _0x2c7024=parseInt(_0x27fb48(0x1fa))/0x1*(-parseInt(_0x27fb48(0x1f3))/0x2)+parseInt(_0x27fb48(0x1fc))/0x3*(parseInt(_0x27fb48(0x1ff))/0x4)+parseInt(_0x27fb48(0x1fb))/0x5+parseInt(_0x27fb48(0x1f9))/0x6*(parseInt(_0x27fb48(0x201))/0x7)+parseInt(_0x27fb48(0x1fd))/0x8*(-parseInt(_0x27fb48(0x1f6))/0x9)+parseInt(_0x27fb48(0x1f4))/0xa+-parseInt(_0x27fb48(0x1f5))/0xb;if(_0x2c7024===_0x2a1587)break;else _0xad5b92['push'](_0xad5b92['shift']());}catch(_0x1c3b31){_0xad5b92['push'](_0xad5b92['shift']());}}}(a246_0x304d,0xd6953));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x2b854e){const _0x17b07d=await buildSchemaPayload();return{'ok':!![],'data':_0x17b07d};}function a246_0x304d(){const _0xdbc8e0=['718035pmITXw','3gIFxAh','6896XbHzKN','json','2599276PoJvgu','export','251552pLfFGQ','2RySMnP','9562010CDytYl','14920147NMucBR','2304ZzaaHe','schema','Export\x20machine-readable\x20command\x20schema\x20(JSON)','264aROQlt','874831fZYbEv'];a246_0x304d=function(){return _0xdbc8e0;};return a246_0x304d();}export const schemaDefinition={'service':a246_0x24d8a3(0x1f7),'command':a246_0x24d8a3(0x200),'description':a246_0x24d8a3(0x1f8),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a246_0x24d8a3(0x1fe),'flags':[],'execute':execute};
1
+ const a246_0x5c18ef=a246_0x3e40;(function(_0x3901ca,_0x45c119){const _0x353d6a=a246_0x3e40,_0x37ea9a=_0x3901ca();while(!![]){try{const _0x4d1798=parseInt(_0x353d6a(0x175))/0x1*(parseInt(_0x353d6a(0x173))/0x2)+parseInt(_0x353d6a(0x170))/0x3*(-parseInt(_0x353d6a(0x172))/0x4)+-parseInt(_0x353d6a(0x177))/0x5*(-parseInt(_0x353d6a(0x16f))/0x6)+-parseInt(_0x353d6a(0x16e))/0x7+-parseInt(_0x353d6a(0x16b))/0x8*(parseInt(_0x353d6a(0x174))/0x9)+-parseInt(_0x353d6a(0x16c))/0xa+parseInt(_0x353d6a(0x176))/0xb;if(_0x4d1798===_0x45c119)break;else _0x37ea9a['push'](_0x37ea9a['shift']());}catch(_0x2083e5){_0x37ea9a['push'](_0x37ea9a['shift']());}}}(a246_0x3998,0x65ec9));function a246_0x3e40(_0x2d1966,_0x1712e1){_0x2d1966=_0x2d1966-0x16b;const _0x39989a=a246_0x3998();let _0x3e40ab=_0x39989a[_0x2d1966];return _0x3e40ab;}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x433dcb){const _0x5f4df5=await buildSchemaPayload();return{'ok':!![],'data':_0x5f4df5};}export const schemaDefinition={'service':a246_0x5c18ef(0x171),'command':'export','description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a246_0x5c18ef(0x16d),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':'json','flags':[],'execute':execute};function a246_0x3998(){const _0x219268=['4398640KHFMQc','read','902020qwtMIC','831414LzGEDg','131349nIyyeH','schema','4PiOMLM','8840RAmMQZ','9iNosfr','184RExZCK','19052xtMcXd','15kEQbUh','1605848TmcdFd'];a246_0x3998=function(){return _0x219268;};return a246_0x3998();}
@@ -1 +1 @@
1
- const a247_0x517cef=a247_0x145c;(function(_0x1c486f,_0x3654cd){const _0x26746b=a247_0x145c,_0x180be2=_0x1c486f();while(!![]){try{const _0x1a0c39=-parseInt(_0x26746b(0xa6))/0x1*(-parseInt(_0x26746b(0x9c))/0x2)+parseInt(_0x26746b(0x80))/0x3*(parseInt(_0x26746b(0x91))/0x4)+-parseInt(_0x26746b(0x93))/0x5+parseInt(_0x26746b(0x89))/0x6*(-parseInt(_0x26746b(0xae))/0x7)+-parseInt(_0x26746b(0x86))/0x8+parseInt(_0x26746b(0xb6))/0x9+parseInt(_0x26746b(0x81))/0xa*(parseInt(_0x26746b(0xb2))/0xb);if(_0x1a0c39===_0x3654cd)break;else _0x180be2['push'](_0x180be2['shift']());}catch(_0x4fc8d5){_0x180be2['push'](_0x180be2['shift']());}}}(a247_0x26b3,0x585fd));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';function a247_0x145c(_0x47e1eb,_0x1bfb45){_0x47e1eb=_0x47e1eb-0x7d;const _0x26b305=a247_0x26b3();let _0x145cf6=_0x26b305[_0x47e1eb];return _0x145cf6;}import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x150abe){const _0x467aae=a247_0x145c;if(_0x150abe===_0x467aae(0x87))return['<select\x20id=\x22query\x22\x20resultType=\x22map\x22>',_0x467aae(0xa9),_0x467aae(0x90),'']['join']('\x0a');return[_0x467aae(0x97),''][_0x467aae(0x82)]('\x0a');}export const sqlCreate={'service':a247_0x517cef(0x9d),'command':'create','description':'Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','risk':a247_0x517cef(0x94),'flags':[{'name':a247_0x517cef(0xb0),'type':a247_0x517cef(0x9e),'description':'SQL\x20query\x20display\x20name'},{'name':a247_0x517cef(0x9f),'type':a247_0x517cef(0x84),'description':'Target\x20database\x20ID'},{'name':a247_0x517cef(0xac),'type':'string','enum':[a247_0x517cef(0x9d),a247_0x517cef(0x87)],'description':'Local\x20SQL\x20file\x20mode'}],async 'validate'(_0x5723db){const _0x598ebc=a247_0x517cef;if(!_0x5723db[_0x598ebc(0xad)])return;if(!_0x5723db[_0x598ebc(0x83)]('name')[_0x598ebc(0xb5)]())throw CliErrors[_0x598ebc(0x9b)](_0x598ebc(0xb0),_0x598ebc(0x8d));const _0xeb409c=resolveProvidedDbId(_0x5723db);if(typeof _0xeb409c!==_0x598ebc(0x84)||!Number['isFinite'](_0xeb409c)||_0xeb409c<=0x0)throw CliErrors[_0x598ebc(0x9b)](_0x598ebc(0x9f),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');if(!_0x5723db[_0x598ebc(0x83)](_0x598ebc(0xac))['trim']())throw CliErrors[_0x598ebc(0x9b)]('mode','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0xd5b485){const _0x2b548d=a247_0x517cef,_0x21426a=loadSqlProjectConfig(_0xd5b485[_0x2b548d(0xaf)]),{sqlName:_0x23738d,dbId:_0x4b13cd,dbName:_0x215be7,mode:_0x544d1e}=await resolveSqlNewInputs(_0xd5b485),_0x4ee230=buildSqlRelativePath(_0x2b548d(0xa7),_0x23738d,_0x215be7,_0x544d1e,_0x4b13cd),_0x1c5b7f=_0x21426a[_0x2b548d(0x8f)]+'/'+_0x4ee230;return{'method':_0x2b548d(0x96),'url':_0x2b548d(0xa3),'body':{'appCode':_0xd5b485[_0x2b548d(0xaf)],'sqlName':_0x23738d,'dbId':_0x4b13cd,'mode':_0x544d1e,'localPath':_0x1c5b7f},'description':_0x2b548d(0xa1)+_0x21426a[_0x2b548d(0x8f)]};},async 'execute'(_0x31298b){const _0x331ef8=a247_0x517cef,_0x3778c7=loadSqlProjectConfig(_0x31298b['appCode']),{sqlName:_0x237123,dbId:_0x55e2eb,dbName:_0x308027,mode:_0x4508f3}=await resolveSqlNewInputs(_0x31298b),_0x34e837=generateSqlTemplate(_0x4508f3),_0x106b18=await createSqlQuery({'appCode':_0x31298b[_0x331ef8(0xaf)],'sqlName':_0x237123,'dbId':_0x55e2eb,'sqlContent':_0x34e837}),_0x29c7f4=ensureRemoteSqlContent(_0x106b18),_0xf24741=_0x308027||await getDbName(_0x31298b[_0x331ef8(0xaf)],_0x55e2eb)[_0x331ef8(0x85)](()=>undefined),_0xdfc6b8=buildSqlRelativePath(_0x106b18[_0x331ef8(0x8a)],_0x106b18[_0x331ef8(0x95)],_0xf24741,_0x4508f3,_0x55e2eb),_0x4c181=_0x3778c7[_0x331ef8(0x8f)]+'/'+_0xdfc6b8,_0x166ec0=buildLocalSqlFileContent({'sqlCode':_0x106b18['sqlCode'],'sqlName':_0x106b18[_0x331ef8(0x95)],'dbId':_0x106b18[_0x331ef8(0xb1)]},_0x29c7f4,{'dbName':_0xf24741,'mode':_0x4508f3,'syncedAt':new Date()[_0x331ef8(0xb7)](),'description':_0x106b18['description']});if(await fileExists(_0x4c181))throw CliErrors['validation'](_0x331ef8(0xa0)+_0x4c181);await ensureParentDirectory(_0x4c181),await writeFile(_0x4c181,_0x166ec0,_0x331ef8(0xa4));const _0x4280f6=await readSqlLockFile(_0x3778c7['lockFilePath']),{lockData:_0x5f3495,appLock:_0x4cd4fb}=ensureSqlLockScope(_0x4280f6??createEmptySqlLock(),_0x3778c7[_0x331ef8(0xaf)],_0x3778c7[_0x331ef8(0xa8)],'new');return _0x4cd4fb['sqls'][_0x106b18[_0x331ef8(0x8a)]]={...buildSqlLockEntry(_0x106b18,_0x29c7f4,computeSqlContentHash(_0x166ec0),{'dbName':_0xf24741}),'path':_0xdfc6b8,'mode':_0x4508f3},_0x4cd4fb[_0x331ef8(0x98)]=new Date()[_0x331ef8(0xb7)](),await writeSqlLockFile(_0x3778c7['lockFilePath'],_0x5f3495),{'ok':!![],'data':{'id':_0x106b18['id'],'sqlCode':_0x106b18[_0x331ef8(0x8a)],'sqlName':_0x106b18['sqlName'],'dbId':_0x106b18['dbId'],'path':_0x4c181,'mode':_0x4508f3},'message':'Created\x20SQL\x20query\x20'+_0x106b18[_0x331ef8(0x8a)]};}};async function resolveSqlNewInputs(_0x12398e){const _0x33510c=await resolveSqlNameInput(_0x12398e),{dbId:_0x4de2fd,dbName:_0x17b9e4}=await resolveDbSelection(_0x12398e),_0x431d4e=await resolveSqlModeInput(_0x12398e);return{'sqlName':_0x33510c,'dbId':_0x4de2fd,'dbName':_0x17b9e4,'mode':_0x431d4e};}function a247_0x26b3(){const _0x5ccf4e=['write','sqlName','POST','SELECT\x201\x20AS\x20id;','lastSync','length','Target\x20database\x20dbId:','flagMissing','4698aVRgok','sql','string','db-id','File\x20already\x20exists:\x20','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','__manual__','/smartapi/custom/saveUserCustomSql','utf8','dbId\x20must\x20be\x20a\x20positive\x20integer','131JpBZtG','<server-generated-sqlCode>','sqlRoot','\x20\x20SELECT\x201\x20AS\x20id','SQL\x20name:','Plain\x20SQL\x20(sql)','mode','nonInteractive','975107hYewkU','appCode','name','dbId','4446959PPgCoM','SQL\x20name\x20cannot\x20be\x20empty','dbId\x20cannot\x20be\x20empty','trim','4602816ryvvgr','toISOString','isInteger','MyBatis\x20XML\x20(mybatisXml)','validation','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','stringify','dbName','171471TzrgDQ','10keOjHU','join','str','number','catch','3682656joxYUp','mybatisXml','isFinite','6EaVdDz','sqlCode','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','✎\x20Enter\x20dbId\x20manually','sqlRootDir','</select>','4POSdKs','Select\x20the\x20target\x20database:','1594775JTjQTD'];a247_0x26b3=function(){return _0x5ccf4e;};return a247_0x26b3();}async function resolveSqlNameInput(_0x58e2c3){const _0x302be0=a247_0x517cef,_0x2166e3=_0x58e2c3['str'](_0x302be0(0xb0))[_0x302be0(0xb5)]();if(_0x2166e3)return _0x2166e3;if(_0x58e2c3['nonInteractive'])throw CliErrors[_0x302be0(0x9b)](_0x302be0(0xb0),_0x302be0(0x8d));return(await input({'message':_0x302be0(0xaa),'validate':_0x52233a=>_0x52233a[_0x302be0(0xb5)]()?!![]:_0x302be0(0xb3)}))['trim']();}async function resolveDbSelection(_0x156a84){const _0x8e88de=a247_0x517cef,_0x5694d6=resolveProvidedDbId(_0x156a84);if(typeof _0x5694d6===_0x8e88de(0x84)&&Number[_0x8e88de(0x88)](_0x5694d6)&&_0x5694d6>0x0)return{'dbId':_0x5694d6,'dbName':await getDbName(_0x156a84[_0x8e88de(0xaf)],_0x5694d6)[_0x8e88de(0x85)](()=>undefined)};if(_0x156a84[_0x8e88de(0xad)])throw CliErrors[_0x8e88de(0x9b)](_0x8e88de(0x9f),_0x8e88de(0x8b));const _0x32064b=await listDatabases(_0x156a84[_0x8e88de(0xaf)])[_0x8e88de(0x85)](()=>[]);if(_0x32064b[_0x8e88de(0x99)]===0x1)return{'dbId':_0x32064b[0x0][_0x8e88de(0xb1)],'dbName':_0x32064b[0x0][_0x8e88de(0x7f)]};if(_0x32064b[_0x8e88de(0x99)]>0x1){const _0x44b7b0=await select({'message':_0x8e88de(0x92),'choices':[..._0x32064b['map'](_0x74d856=>({'name':_0x74d856[_0x8e88de(0x7f)]+'\x20('+_0x74d856[_0x8e88de(0xb1)]+')','value':serializeDbSelection(_0x74d856)})),{'name':_0x8e88de(0x8e),'value':'__manual__'}]});if(_0x44b7b0!==_0x8e88de(0xa2))return deserializeDbSelection(_0x44b7b0);}const _0xa7c522=await input({'message':_0x8e88de(0x9a),'validate':_0x27d20a=>{const _0x1b3f17=_0x8e88de,_0x13e07d=_0x27d20a[_0x1b3f17(0xb5)]();if(!_0x13e07d)return _0x1b3f17(0xb4);const _0x8716b=Number(_0x13e07d);if(!Number[_0x1b3f17(0xb8)](_0x8716b)||_0x8716b<=0x0)return _0x1b3f17(0xa5);return!![];}});return{'dbId':Number(_0xa7c522[_0x8e88de(0xb5)]())};}async function resolveSqlModeInput(_0x117647){const _0x1921a6=a247_0x517cef,_0xdce764=_0x117647['str'](_0x1921a6(0xac))['trim']();if(_0xdce764===_0x1921a6(0x9d)||_0xdce764===_0x1921a6(0x87))return _0xdce764;if(_0x117647[_0x1921a6(0xad)])throw CliErrors[_0x1921a6(0x9b)]('mode','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');return await select({'message':'Select\x20the\x20local\x20SQL\x20mode:','choices':[{'name':_0x1921a6(0xab),'value':_0x1921a6(0x9d),'description':_0x1921a6(0x8c)},{'name':_0x1921a6(0xb9),'value':_0x1921a6(0x87),'description':_0x1921a6(0x7d)}]});}function serializeDbSelection(_0x54c3e5){const _0x459ff4=a247_0x517cef;return JSON[_0x459ff4(0x7e)]({'dbId':_0x54c3e5[_0x459ff4(0xb1)],'dbName':_0x54c3e5[_0x459ff4(0x7f)]});}function deserializeDbSelection(_0x132099){const _0x359386=a247_0x517cef;try{const _0x4c5554=JSON['parse'](_0x132099);if(typeof _0x4c5554['dbId']==='number'&&Number['isFinite'](_0x4c5554[_0x359386(0xb1)]))return{'dbId':_0x4c5554[_0x359386(0xb1)],'dbName':_0x4c5554[_0x359386(0x7f)]};}catch{}throw CliErrors[_0x359386(0xba)]('Invalid\x20database\x20selection\x20payload:\x20'+_0x132099);}function resolveProvidedDbId(_0x572ffc){const _0x384728=a247_0x517cef,_0x237b5d=_0x572ffc['flag'](_0x384728(0x9f));if(typeof _0x237b5d===_0x384728(0x84)&&Number[_0x384728(0x88)](_0x237b5d))return _0x237b5d;return undefined;}
1
+ const a247_0x2ed3f2=a247_0x2c78;(function(_0x4263fb,_0x242193){const _0x44eb6e=a247_0x2c78,_0x3d133a=_0x4263fb();while(!![]){try{const _0x1dc8b4=parseInt(_0x44eb6e(0x1e2))/0x1*(parseInt(_0x44eb6e(0x200))/0x2)+parseInt(_0x44eb6e(0x207))/0x3*(-parseInt(_0x44eb6e(0x1f1))/0x4)+parseInt(_0x44eb6e(0x204))/0x5+-parseInt(_0x44eb6e(0x206))/0x6*(-parseInt(_0x44eb6e(0x1da))/0x7)+-parseInt(_0x44eb6e(0x1f4))/0x8+-parseInt(_0x44eb6e(0x1f5))/0x9+parseInt(_0x44eb6e(0x1f3))/0xa;if(_0x1dc8b4===_0x242193)break;else _0x3d133a['push'](_0x3d133a['shift']());}catch(_0x2773ae){_0x3d133a['push'](_0x3d133a['shift']());}}}(a247_0x4ad0,0xe3068));import{writeFile}from'node:fs/promises';function a247_0x4ad0(){const _0x5bcec0=['appCode','map','length','Invalid\x20database\x20selection\x20payload:\x20','mode','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','Local\x20SQL\x20file\x20mode','23485YsGoCZ','sqlCode','sqlRoot','catch','description','dbId','db-id','isInteger','343481uEaIDL','lockFilePath','SQL\x20name:','__manual__','SQL\x20name\x20cannot\x20be\x20empty','✎\x20Enter\x20dbId\x20manually','Target\x20database\x20dbId:','write','Plain\x20SQL\x20(sql)','For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','File\x20already\x20exists:\x20','mybatisXml','sql','new','8vtKdPa','\x20\x20SELECT\x201\x20AS\x20id','42087680aIHqev','10085456kBlkwO','12560445clRIrr','str','name','POST','utf8','<server-generated-sqlCode>','trim','SQL\x20query\x20display\x20name','MyBatis\x20XML\x20(mybatisXml)','number','sqlRootDir','6IUkHxS','sqls','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','isFinite','152565nMZUyL','Created\x20SQL\x20query\x20','18MdDpYK','2540409VavjAA','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','parse','nonInteractive','flagMissing','string','toISOString','sqlName','dbId\x20cannot\x20be\x20empty','/smartapi/custom/saveUserCustomSql','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','join','dbName'];a247_0x4ad0=function(){return _0x5bcec0;};return a247_0x4ad0();}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';function a247_0x2c78(_0x39575b,_0x53c1d1){_0x39575b=_0x39575b-0x1d9;const _0x4ad0c4=a247_0x4ad0();let _0x2c783a=_0x4ad0c4[_0x39575b];return _0x2c783a;}import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x1f0f26){const _0x45d43f=a247_0x2c78;if(_0x1f0f26==='mybatisXml')return['<select\x20id=\x22query\x22\x20resultType=\x22map\x22>',_0x45d43f(0x1f2),'</select>','']['join']('\x0a');return['SELECT\x201\x20AS\x20id;',''][_0x45d43f(0x212)]('\x0a');}export const sqlCreate={'service':a247_0x2ed3f2(0x1ef),'command':'create','description':a247_0x2ed3f2(0x219),'risk':a247_0x2ed3f2(0x1e9),'flags':[{'name':a247_0x2ed3f2(0x1f7),'type':a247_0x2ed3f2(0x20c),'description':a247_0x2ed3f2(0x1fc)},{'name':a247_0x2ed3f2(0x1e0),'type':a247_0x2ed3f2(0x1fe),'description':'Target\x20database\x20ID'},{'name':'mode','type':a247_0x2ed3f2(0x20c),'enum':[a247_0x2ed3f2(0x1ef),a247_0x2ed3f2(0x1ee)],'description':a247_0x2ed3f2(0x1d9)}],async 'validate'(_0x1c5a28){const _0x1ef209=a247_0x2ed3f2;if(!_0x1c5a28[_0x1ef209(0x20a)])return;if(!_0x1c5a28['str'](_0x1ef209(0x1f7))[_0x1ef209(0x1fb)]())throw CliErrors[_0x1ef209(0x20b)](_0x1ef209(0x1f7),_0x1ef209(0x208));const _0x350372=resolveProvidedDbId(_0x1c5a28);if(typeof _0x350372!==_0x1ef209(0x1fe)||!Number[_0x1ef209(0x203)](_0x350372)||_0x350372<=0x0)throw CliErrors[_0x1ef209(0x20b)](_0x1ef209(0x1e0),_0x1ef209(0x211));if(!_0x1c5a28['str'](_0x1ef209(0x218))[_0x1ef209(0x1fb)]())throw CliErrors[_0x1ef209(0x20b)](_0x1ef209(0x218),_0x1ef209(0x1ec));},async 'dryRun'(_0x3bae48){const _0xf5ce52=a247_0x2ed3f2,_0x4d2072=loadSqlProjectConfig(_0x3bae48['appCode']),{sqlName:_0x467295,dbId:_0xf59b70,dbName:_0x1c48a2,mode:_0x135adf}=await resolveSqlNewInputs(_0x3bae48),_0x261965=buildSqlRelativePath(_0xf5ce52(0x1fa),_0x467295,_0x1c48a2,_0x135adf,_0xf59b70),_0x3d84e7=_0x4d2072[_0xf5ce52(0x1ff)]+'/'+_0x261965;return{'method':_0xf5ce52(0x1f8),'url':_0xf5ce52(0x210),'body':{'appCode':_0x3bae48['appCode'],'sqlName':_0x467295,'dbId':_0xf59b70,'mode':_0x135adf,'localPath':_0x3d84e7},'description':_0xf5ce52(0x202)+_0x4d2072[_0xf5ce52(0x1ff)]};},async 'execute'(_0x57f9da){const _0x15d88=a247_0x2ed3f2,_0x304fc7=loadSqlProjectConfig(_0x57f9da[_0x15d88(0x214)]),{sqlName:_0x661a47,dbId:_0x99c219,dbName:_0x5b9902,mode:_0x40abea}=await resolveSqlNewInputs(_0x57f9da),_0x4befa4=generateSqlTemplate(_0x40abea),_0x3e3338=await createSqlQuery({'appCode':_0x57f9da[_0x15d88(0x214)],'sqlName':_0x661a47,'dbId':_0x99c219,'sqlContent':_0x4befa4}),_0x117a38=ensureRemoteSqlContent(_0x3e3338),_0x4d36bf=_0x5b9902||await getDbName(_0x57f9da[_0x15d88(0x214)],_0x99c219)[_0x15d88(0x1dd)](()=>undefined),_0x1d58c2=buildSqlRelativePath(_0x3e3338[_0x15d88(0x1db)],_0x3e3338[_0x15d88(0x20e)],_0x4d36bf,_0x40abea,_0x99c219),_0x5f1c2e=_0x304fc7[_0x15d88(0x1ff)]+'/'+_0x1d58c2,_0x40e464=buildLocalSqlFileContent({'sqlCode':_0x3e3338['sqlCode'],'sqlName':_0x3e3338[_0x15d88(0x20e)],'dbId':_0x3e3338['dbId']},_0x117a38,{'dbName':_0x4d36bf,'mode':_0x40abea,'syncedAt':new Date()[_0x15d88(0x20d)](),'description':_0x3e3338[_0x15d88(0x1de)]});if(await fileExists(_0x5f1c2e))throw CliErrors['validation'](_0x15d88(0x1ed)+_0x5f1c2e);await ensureParentDirectory(_0x5f1c2e),await writeFile(_0x5f1c2e,_0x40e464,_0x15d88(0x1f9));const _0x39f4df=await readSqlLockFile(_0x304fc7['lockFilePath']),{lockData:_0x182e04,appLock:_0x471c05}=ensureSqlLockScope(_0x39f4df??createEmptySqlLock(),_0x304fc7['appCode'],_0x304fc7[_0x15d88(0x1dc)],_0x15d88(0x1f0));return _0x471c05[_0x15d88(0x201)][_0x3e3338[_0x15d88(0x1db)]]={...buildSqlLockEntry(_0x3e3338,_0x117a38,computeSqlContentHash(_0x40e464),{'dbName':_0x4d36bf}),'path':_0x1d58c2,'mode':_0x40abea},_0x471c05['lastSync']=new Date()['toISOString'](),await writeSqlLockFile(_0x304fc7[_0x15d88(0x1e3)],_0x182e04),{'ok':!![],'data':{'id':_0x3e3338['id'],'sqlCode':_0x3e3338[_0x15d88(0x1db)],'sqlName':_0x3e3338[_0x15d88(0x20e)],'dbId':_0x3e3338[_0x15d88(0x1df)],'path':_0x5f1c2e,'mode':_0x40abea},'message':_0x15d88(0x205)+_0x3e3338[_0x15d88(0x1db)]};}};async function resolveSqlNewInputs(_0x4f107d){const _0x3a7c9f=await resolveSqlNameInput(_0x4f107d),{dbId:_0x5261bf,dbName:_0x1269cf}=await resolveDbSelection(_0x4f107d),_0x58a4db=await resolveSqlModeInput(_0x4f107d);return{'sqlName':_0x3a7c9f,'dbId':_0x5261bf,'dbName':_0x1269cf,'mode':_0x58a4db};}async function resolveSqlNameInput(_0x57b545){const _0x2e4e23=a247_0x2ed3f2,_0x4c6903=_0x57b545[_0x2e4e23(0x1f6)](_0x2e4e23(0x1f7))[_0x2e4e23(0x1fb)]();if(_0x4c6903)return _0x4c6903;if(_0x57b545['nonInteractive'])throw CliErrors[_0x2e4e23(0x20b)](_0x2e4e23(0x1f7),_0x2e4e23(0x208));return(await input({'message':_0x2e4e23(0x1e4),'validate':_0x49b37f=>_0x49b37f['trim']()?!![]:_0x2e4e23(0x1e6)}))[_0x2e4e23(0x1fb)]();}async function resolveDbSelection(_0x194bbe){const _0x5b1b71=a247_0x2ed3f2,_0x39df54=resolveProvidedDbId(_0x194bbe);if(typeof _0x39df54===_0x5b1b71(0x1fe)&&Number['isFinite'](_0x39df54)&&_0x39df54>0x0)return{'dbId':_0x39df54,'dbName':await getDbName(_0x194bbe[_0x5b1b71(0x214)],_0x39df54)[_0x5b1b71(0x1dd)](()=>undefined)};if(_0x194bbe[_0x5b1b71(0x20a)])throw CliErrors[_0x5b1b71(0x20b)](_0x5b1b71(0x1e0),_0x5b1b71(0x211));const _0x3327df=await listDatabases(_0x194bbe['appCode'])[_0x5b1b71(0x1dd)](()=>[]);if(_0x3327df[_0x5b1b71(0x216)]===0x1)return{'dbId':_0x3327df[0x0]['dbId'],'dbName':_0x3327df[0x0][_0x5b1b71(0x213)]};if(_0x3327df[_0x5b1b71(0x216)]>0x1){const _0x316c32=await select({'message':'Select\x20the\x20target\x20database:','choices':[..._0x3327df[_0x5b1b71(0x215)](_0x180d4f=>({'name':_0x180d4f[_0x5b1b71(0x213)]+'\x20('+_0x180d4f['dbId']+')','value':serializeDbSelection(_0x180d4f)})),{'name':_0x5b1b71(0x1e7),'value':_0x5b1b71(0x1e5)}]});if(_0x316c32!==_0x5b1b71(0x1e5))return deserializeDbSelection(_0x316c32);}const _0xc59731=await input({'message':_0x5b1b71(0x1e8),'validate':_0xb2dbd5=>{const _0x1d71b1=_0x5b1b71,_0x24ea46=_0xb2dbd5['trim']();if(!_0x24ea46)return _0x1d71b1(0x20f);const _0x59c4f0=Number(_0x24ea46);if(!Number[_0x1d71b1(0x1e1)](_0x59c4f0)||_0x59c4f0<=0x0)return'dbId\x20must\x20be\x20a\x20positive\x20integer';return!![];}});return{'dbId':Number(_0xc59731['trim']())};}async function resolveSqlModeInput(_0x376980){const _0x385646=a247_0x2ed3f2,_0x319f3b=_0x376980[_0x385646(0x1f6)](_0x385646(0x218))[_0x385646(0x1fb)]();if(_0x319f3b===_0x385646(0x1ef)||_0x319f3b===_0x385646(0x1ee))return _0x319f3b;if(_0x376980['nonInteractive'])throw CliErrors[_0x385646(0x20b)](_0x385646(0x218),_0x385646(0x1ec));return await select({'message':'Select\x20the\x20local\x20SQL\x20mode:','choices':[{'name':_0x385646(0x1ea),'value':_0x385646(0x1ef),'description':_0x385646(0x1eb)},{'name':_0x385646(0x1fd),'value':'mybatisXml','description':'For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags'}]});}function serializeDbSelection(_0x1e3935){const _0x315443=a247_0x2ed3f2;return JSON['stringify']({'dbId':_0x1e3935[_0x315443(0x1df)],'dbName':_0x1e3935[_0x315443(0x213)]});}function deserializeDbSelection(_0x11d7df){const _0x594e50=a247_0x2ed3f2;try{const _0x3a07b3=JSON[_0x594e50(0x209)](_0x11d7df);if(typeof _0x3a07b3[_0x594e50(0x1df)]===_0x594e50(0x1fe)&&Number[_0x594e50(0x203)](_0x3a07b3[_0x594e50(0x1df)]))return{'dbId':_0x3a07b3['dbId'],'dbName':_0x3a07b3['dbName']};}catch{}throw CliErrors['validation'](_0x594e50(0x217)+_0x11d7df);}function resolveProvidedDbId(_0x582a20){const _0x1a8fbe=a247_0x2ed3f2,_0x553076=_0x582a20['flag']('db-id');if(typeof _0x553076===_0x1a8fbe(0x1fe)&&Number[_0x1a8fbe(0x203)](_0x553076))return _0x553076;return undefined;}