@lovrabet/rabetbase-cli 2.5.10-beta.3 → 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 a235_0x25a3ea=a235_0x182d;(function(_0x524186,_0x4213ae){const _0x3d6690=a235_0x182d,_0x3477c7=_0x524186();while(!![]){try{const _0x2d46bd=parseInt(_0x3d6690(0x1b8))/0x1*(-parseInt(_0x3d6690(0x1ca))/0x2)+parseInt(_0x3d6690(0x1ab))/0x3+parseInt(_0x3d6690(0x1a8))/0x4*(parseInt(_0x3d6690(0x1ad))/0x5)+-parseInt(_0x3d6690(0x1d8))/0x6*(-parseInt(_0x3d6690(0x19e))/0x7)+parseInt(_0x3d6690(0x1d1))/0x8+parseInt(_0x3d6690(0x1b5))/0x9+-parseInt(_0x3d6690(0x19b))/0xa*(parseInt(_0x3d6690(0x1c6))/0xb);if(_0x2d46bd===_0x4213ae)break;else _0x3477c7['push'](_0x3477c7['shift']());}catch(_0x402ed2){_0x3477c7['push'](_0x3477c7['shift']());}}}(a235_0x123d,0xde7e4));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_0x25a3ea(0x1dc),'required':!![],'description':a235_0x25a3ea(0x193)};export const ROLE_REF_FLAG={'name':'role','type':a235_0x25a3ea(0x1be),'required':!![],'description':'Role\x20id\x20or\x20exact\x20role\x20name'};function a235_0x182d(_0xa76495,_0x1c28a9){_0xa76495=_0xa76495-0x190;const _0x123d19=a235_0x123d();let _0x182dc3=_0x123d19[_0xa76495];return _0x182dc3;}export const USER_REF_FLAG={'name':a235_0x25a3ea(0x1b4),'type':'string','required':!![],'description':a235_0x25a3ea(0x1cd)};export const NAME_FLAG={'name':'name','type':a235_0x25a3ea(0x1be),'required':!![],'description':'Role\x20name'};function a235_0x123d(){const _0x5593cd=['push','name','expect-user-count','Role\x20name\x20\x22','5847368ETIitU','username','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles,\x20or\x20pass\x20--role\x20<id>.','2491608DXhCUj','validation','5upqaGr','\x20built-in\x20role\x20','DEV','dryRun','\x22\x20not\x20found\x20in\x20app\x20','\x22\x20is\x20ambiguous\x20(ids:\x20','Disambiguate\x20with\x20--role\x20<id>.','user','16205913MrfxrY','Anti-drift\x20check\x20failed:\x20expected\x20','find','1TZqrqt','\x22:\x20','permitCount','User\x20','expectUserCount','Pass\x20--user\x20<id|name>.','string','user-add','Multiple\x20tenant\x20members\x20match\x20\x22','Missing\x20role\x20reference.','roleType','\x20is\x20already\x20a\x20member\x20of\x20role\x20','toLowerCase','remark','253IeqaJm','Cannot\x20','roleName','/smartapi/permit/user-role/delete','1994086Uvyjkp','OWNER','length','User\x20id,\x20username,\x20or\x20nickname\x20to\x20resolve\x20to\x20a\x20userId','/smartapi/permit/user-role/create','role','Removed\x20','6032264BNwLIb','Only\x20CUSTOM\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','Role\x20id\x20','Pass\x20--role\x20<id|name>.','map','tenant_code','flag','88470oXEwda','Anti-drift\x20guard:\x20fail\x20if\x20the\x20role\x27s\x20current\x20member\x20count\x20differs','appCode','Use\x20the\x20platform\x20ownership-transfer\x20workflow\x20to\x20change\x20the\x20application\x20owner.','number','dev','Nickname\x20or\x20username\x20to\x20resolve\x20to\x20a\x20userId','Missing\x20user\x20reference.','Role\x20id\x20(from\x20`role\x20list`)','\x20members\x20of\x20the\x20OWNER\x20role.','userId','totalCount',';\x20no\x20change.','flagMissing','filter','nickname','1700810OJMmeT','trim','join','462sXYdiZ','includes','\x20member(s)\x20but\x20role\x20has\x20','Optional\x20role\x20remark/description','Re-run\x20`role\x20detail`\x20/\x20`role\x20list`\x20and\x20retry\x20with\x20the\x20current\x20count.','test'];a235_0x123d=function(){return _0x5593cd;};return a235_0x123d();}export const USER_NAME_FLAG={'name':'name','type':a235_0x25a3ea(0x1be),'required':!![],'description':a235_0x25a3ea(0x191)};export const REMARK_FLAG={'name':a235_0x25a3ea(0x1c5),'type':a235_0x25a3ea(0x1be),'required':![],'description':a235_0x25a3ea(0x1a1)};export const EXPECT_USER_COUNT_FLAG={'name':a235_0x25a3ea(0x1a6),'type':a235_0x25a3ea(0x1dc),'required':![],'description':a235_0x25a3ea(0x1d9)};export const BUILTIN_ROLE_TYPES=['ADMIN',a235_0x25a3ea(0x1af),a235_0x25a3ea(0x1cb)];export function isBuiltinRole(_0x430868){return BUILTIN_ROLE_TYPES['includes'](_0x430868);}export function assertCustomRole(_0x3c7360,_0x26b96b){const _0x4e95c5=a235_0x25a3ea;if(_0x3c7360[_0x4e95c5(0x1c2)]!=='CUSTOM')throw CliErrors['validation'](_0x4e95c5(0x1c7)+_0x26b96b+_0x4e95c5(0x1ae)+_0x3c7360['roleName']+'\x20('+_0x3c7360[_0x4e95c5(0x1c2)]+').',_0x4e95c5(0x1d2));}export function projectRole(_0x3466cf){const _0x304295=a235_0x25a3ea;return{'id':_0x3466cf['id'],'roleName':_0x3466cf[_0x304295(0x1c8)],'roleType':_0x3466cf[_0x304295(0x1c2)],'remark':_0x3466cf[_0x304295(0x1c5)],'userCount':_0x3466cf['userCount'],'permitCount':_0x3466cf[_0x304295(0x1ba)],'builtin':isBuiltinRole(_0x3466cf[_0x304295(0x1c2)])};}export async function resolveRoleRef(_0x125869,_0x9ea3c4){const _0x557d94=a235_0x25a3ea,_0x5391c1=_0x9ea3c4[_0x557d94(0x19c)]();if(!_0x5391c1)throw CliErrors['validation'](_0x557d94(0x1c1),_0x557d94(0x1d4));if(/^\d+$/[_0x557d94(0x1a3)](_0x5391c1))return getRoleById(_0x125869,Number(_0x5391c1));const _0x161344=await listAllAppRoles(_0x125869),_0x36e8ce=_0x161344[_0x557d94(0x199)](_0x2c7259=>_0x2c7259[_0x557d94(0x1c8)]===_0x5391c1);if(_0x36e8ce[_0x557d94(0x1cc)]===0x0)throw CliErrors[_0x557d94(0x1ac)](_0x557d94(0x1a7)+_0x5391c1+_0x557d94(0x1b1)+_0x125869+'.',_0x557d94(0x1aa));if(_0x36e8ce[_0x557d94(0x1cc)]>0x1){const _0x41f43a=_0x36e8ce['map'](_0x39978b=>_0x39978b['id'])[_0x557d94(0x19d)](',\x20');throw CliErrors[_0x557d94(0x1ac)](_0x557d94(0x1a7)+_0x5391c1+_0x557d94(0x1b2)+_0x41f43a+').',_0x557d94(0x1b3));}return _0x36e8ce[0x0];}export async function getRoleById(_0x5f5ab3,_0x54d36f){const _0x4fff0e=a235_0x25a3ea,_0x506253=await listAllAppRoles(_0x5f5ab3),_0x2dbbf9=_0x506253[_0x4fff0e(0x199)](_0x9e418b=>_0x9e418b['id']===_0x54d36f&&(!_0x9e418b['appCode']||_0x9e418b[_0x4fff0e(0x1da)]===_0x5f5ab3));if(_0x2dbbf9['length']!==0x1)throw CliErrors['validation'](_0x4fff0e(0x1d3)+_0x54d36f+'\x20not\x20found\x20in\x20app\x20'+_0x5f5ab3+'.','Run\x20`role\x20list`\x20to\x20see\x20available\x20roles.');return _0x2dbbf9[0x0];}async function listAllAppRoles(_0x122146){const _0x385314=a235_0x25a3ea,_0x5c720d=0x64,_0x107252=[];for(let _0x551ef2=0x1;;_0x551ef2+=0x1){const {items:_0x483d31,paging:_0x5c7e57}=await listAppRoles(_0x122146,{'currentPage':_0x551ef2,'pageSize':_0x5c720d});_0x107252[_0x385314(0x1a4)](..._0x483d31);if(_0x483d31[_0x385314(0x1cc)]<_0x5c720d||_0x5c7e57&&_0x107252['length']>=_0x5c7e57[_0x385314(0x196)])return _0x107252;}}export async function resolveTenantCode(){const _0x5a845d=a235_0x25a3ea,_0x30848a=await getSessionUserInfo(),_0x264f7e=_0x30848a?.[_0x5a845d(0x1b4)]?.['tenant']?.[_0x5a845d(0x1d6)];if(!_0x264f7e)throw CliErrors['authRequired']('Cannot\x20resolve\x20current\x20tenant.\x20Run\x20`rabetbase\x20auth\x20login`\x20first.');return _0x264f7e;}function matchMember(_0x393e5b,_0xb2c4ab){const _0x379081=a235_0x25a3ea,_0x12c6a2=_0xb2c4ab[_0x379081(0x19c)]()[_0x379081(0x1c4)]();return(_0x393e5b[_0x379081(0x19a)]??'')['toLowerCase']()===_0x12c6a2||(_0x393e5b[_0x379081(0x1a9)]??'')[_0x379081(0x1c4)]()===_0x12c6a2;}export async function resolveUserRef(_0x1a1c18,_0x3adb06='Pass\x20--user\x20<id>.'){const _0x34770e=a235_0x25a3ea,_0x2c5bbb=_0x1a1c18[_0x34770e(0x19c)]();if(!_0x2c5bbb)throw CliErrors[_0x34770e(0x1ac)](_0x34770e(0x192),_0x34770e(0x1bd));const _0x408c28=await resolveTenantCode(),_0x47fc1c=await getTenantMembers(_0x408c28);if(/^\d+$/[_0x34770e(0x1a3)](_0x2c5bbb)){const _0x24ec9e=Number(_0x2c5bbb),_0x5c4ed1=_0x47fc1c[_0x34770e(0x1b7)](_0x293ccd=>_0x293ccd['userId']===_0x24ec9e);return{'userId':_0x24ec9e,'username':_0x5c4ed1?.[_0x34770e(0x1a9)]??String(_0x24ec9e),'nickname':_0x5c4ed1?.[_0x34770e(0x19a)],'matchedBy':'id'};}const _0x393300=_0x47fc1c[_0x34770e(0x199)](_0x1d1470=>matchMember(_0x1d1470,_0x2c5bbb));if(_0x393300[_0x34770e(0x1cc)]===0x0)throw CliErrors['validation']('No\x20tenant\x20member\x20matches\x20\x22'+_0x2c5bbb+'\x22.','Check\x20the\x20nickname/username.\x20'+_0x3adb06);if(_0x393300[_0x34770e(0x1cc)]>0x1){const _0x594f3b=_0x393300[_0x34770e(0x1d5)](_0x5de014=>(_0x5de014[_0x34770e(0x19a)]??_0x5de014[_0x34770e(0x1a9)]??'?')+'('+_0x5de014[_0x34770e(0x195)]+')')[_0x34770e(0x19d)](',\x20');throw CliErrors[_0x34770e(0x1ac)](_0x34770e(0x1c0)+_0x2c5bbb+_0x34770e(0x1b9)+_0x594f3b+'.',_0x3adb06);}const _0x39b5e8=_0x393300[0x0];return{'userId':_0x39b5e8[_0x34770e(0x195)],'username':_0x39b5e8['username']??String(_0x39b5e8[_0x34770e(0x195)]),'nickname':_0x39b5e8[_0x34770e(0x19a)],'matchedBy':_0x34770e(0x1a5)};}export const CREATE_USER_ROLE_PATH=a235_0x25a3ea(0x1ce);export const DELETE_USER_ROLE_PATH=a235_0x25a3ea(0x1c9);export function computeRoleUserMutation(_0x51123e){const _0x532238=a235_0x25a3ea,{operation:_0x2c30b5,appCode:_0x58026d,role:_0x1347ce,relations:_0x5a9eeb,user:_0x1ce200}=_0x51123e,_0x3eea1e=[...new Set(_0x5a9eeb[_0x532238(0x1d5)](_0x103600=>_0x103600[_0x532238(0x195)]))],_0x383a0e=[];if(_0x51123e[_0x532238(0x1bc)]!==undefined&&_0x51123e['expectUserCount']!==_0x3eea1e[_0x532238(0x1cc)])throw CliErrors[_0x532238(0x1ac)](_0x532238(0x1b6)+_0x51123e[_0x532238(0x1bc)]+_0x532238(0x1a0)+_0x3eea1e['length']+'.',_0x532238(0x1a2));const _0x237c1c=_0x3eea1e[_0x532238(0x19f)](_0x1ce200[_0x532238(0x195)]),_0x1a92f5=_0x5a9eeb[_0x532238(0x199)](_0x410edf=>_0x410edf['userId']===_0x1ce200[_0x532238(0x195)])[_0x532238(0x1d5)](_0x1606da=>_0x1606da['id']),_0x3d71ca=_0x2c30b5===_0x532238(0x1bf)?!_0x237c1c:_0x237c1c;let _0x38131b=_0x3eea1e;_0x2c30b5===_0x532238(0x1bf)?_0x237c1c?_0x383a0e[_0x532238(0x1a4)](_0x532238(0x1bb)+_0x1ce200['userId']+_0x532238(0x1c3)+_0x1347ce['roleName']+_0x532238(0x197)):_0x38131b=[..._0x3eea1e,_0x1ce200[_0x532238(0x195)]]:!_0x237c1c?_0x383a0e[_0x532238(0x1a4)](_0x532238(0x1bb)+_0x1ce200['userId']+'\x20is\x20not\x20a\x20member\x20of\x20role\x20'+_0x1347ce[_0x532238(0x1c8)]+_0x532238(0x197)):(_0x38131b=_0x3eea1e[_0x532238(0x199)](_0x286f93=>_0x286f93!==_0x1ce200[_0x532238(0x195)]),_0x1a92f5['length']>0x1&&_0x383a0e[_0x532238(0x1a4)](_0x532238(0x1d0)+_0x1a92f5[_0x532238(0x1cc)]+'\x20duplicate\x20memberships\x20for\x20user\x20'+_0x1ce200[_0x532238(0x195)]+'.'));const _0x2f7a7b={'scope':_0x532238(0x190),'operation':_0x2c30b5,'selector':{'appCode':_0x58026d,'roleId':_0x1347ce['id'],'roleName':_0x1347ce[_0x532238(0x1c8)],'userId':_0x1ce200['userId']},'before':{'userIds':_0x3eea1e},'after':{'userIds':_0x38131b},'dryRun':_0x51123e[_0x532238(0x1b0)],'backend':{'method':'POST','path':_0x2c30b5===_0x532238(0x1bf)?CREATE_USER_ROLE_PATH:DELETE_USER_ROLE_PATH},'warnings':_0x383a0e};return{'mutation':_0x2f7a7b,'changed':_0x3d71ca,'matchingRelationIds':_0x1a92f5};}export async function loadDevRoleRelations(_0x586198,_0x31be67){const _0x7a1f5e=a235_0x25a3ea,_0x3f21a2=0x64,_0x251cd8=[];for(let _0x2684b4=0x1;;_0x2684b4+=0x1){const {items:_0x5ba088,paging:_0x187fe2}=await listDevUserRoleRelations(_0x586198,{'roleId':_0x31be67,'currentPage':_0x2684b4,'pageSize':_0x3f21a2});_0x251cd8[_0x7a1f5e(0x1a4)](..._0x5ba088);if(_0x5ba088[_0x7a1f5e(0x1cc)]<_0x3f21a2||_0x187fe2&&_0x251cd8['length']>=_0x187fe2[_0x7a1f5e(0x196)])return _0x251cd8;}}export function readRoleRef(_0x23c2ba){const _0x21b340=a235_0x25a3ea,_0x2ba071=_0x23c2ba['str'](_0x21b340(0x1cf))[_0x21b340(0x19c)]();if(!_0x2ba071)throw CliErrors[_0x21b340(0x198)]('role',_0x21b340(0x1d4));return _0x2ba071;}export async function prepareUserMutation(_0x3602e0,_0x1814b6,_0x4e7e3c){const _0x2c2462=a235_0x25a3ea,_0x3b6d57=readRoleRef(_0x3602e0),_0x1da6be=_0x3602e0['str']('user')[_0x2c2462(0x19c)]();if(!_0x1da6be)throw CliErrors[_0x2c2462(0x198)]('user',_0x2c2462(0x1bd));const _0x1fa456=_0x3602e0[_0x2c2462(0x1d7)]('expect-user-count'),_0x475958=_0x1fa456===undefined||_0x1fa456===null?undefined:Number(_0x1fa456),_0x32e256=await resolveRoleRef(_0x3602e0['appCode'],_0x3b6d57);if(_0x32e256[_0x2c2462(0x1c2)]===_0x2c2462(0x1cb))throw CliErrors[_0x2c2462(0x1ac)](_0x2c2462(0x1c7)+_0x1814b6+_0x2c2462(0x194),_0x2c2462(0x1db));const _0x28f5c5=await resolveUserRef(_0x1da6be),_0x3fcd84=await loadDevRoleRelations(_0x3602e0[_0x2c2462(0x1da)],_0x32e256['id']);return{...computeRoleUserMutation({'operation':_0x1814b6,'appCode':_0x3602e0['appCode'],'role':_0x32e256,'relations':_0x3fcd84,'user':{'userId':_0x28f5c5[_0x2c2462(0x195)],'username':_0x28f5c5[_0x2c2462(0x1a9)],'nickname':_0x28f5c5[_0x2c2462(0x19a)]},'dryRun':_0x4e7e3c,..._0x475958!==undefined?{'expectUserCount':_0x475958}:{}}),'role':_0x32e256,'user':_0x28f5c5};}
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_0x125633=a236_0x4922;(function(_0x55bd49,_0xe1e988){const _0x363500=a236_0x4922,_0x2bb96e=_0x55bd49();while(!![]){try{const _0x5b476a=parseInt(_0x363500(0x116))/0x1+-parseInt(_0x363500(0x118))/0x2+parseInt(_0x363500(0x123))/0x3*(-parseInt(_0x363500(0x109))/0x4)+-parseInt(_0x363500(0x11a))/0x5*(-parseInt(_0x363500(0x110))/0x6)+parseInt(_0x363500(0x112))/0x7*(parseInt(_0x363500(0x108))/0x8)+-parseInt(_0x363500(0x114))/0x9*(-parseInt(_0x363500(0x10c))/0xa)+-parseInt(_0x363500(0x10e))/0xb;if(_0x5b476a===_0xe1e988)break;else _0x2bb96e['push'](_0x2bb96e['shift']());}catch(_0x20aaac){_0x2bb96e['push'](_0x2bb96e['shift']());}}}(a236_0x486f,0x42a77));import{updateAppRole}from'../../core/api-client.js';function a236_0x486f(){const _0x1e55b4=['appCode','943281aeUCkX','length','434504SjXaCk','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','424776nhpltl','Updated\x20role\x20','345kWhUnT','validation','--name\x20cannot\x20be\x20empty.','roleName','POST','role','New\x20role\x20name','remark','write','3LOjWvN','num','Nothing\x20to\x20update.','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','16LAKNpj','1770884iqlnLq','dev','\x20(id=','20JlnvRH','name','654236LShMjo','/smartapi/permit/role/update','2076vbNtaK','update','1118614FAzWrc'];a236_0x486f=function(){return _0x1e55b4;};return a236_0x486f();}function a236_0x4922(_0x1a7a97,_0x46728a){_0x1a7a97=_0x1a7a97-0x108;const _0x486f64=a236_0x486f();let _0x49221e=_0x486f64[_0x1a7a97];return _0x49221e;}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH=a236_0x125633(0x10f);function readPatch(_0x4d0e73){const _0x381cb2=a236_0x125633,_0x5f3756=_0x4d0e73['flag'](_0x381cb2(0x10d)),_0x147762=_0x4d0e73['flag'](_0x381cb2(0x121)),_0x3316b5={};if(_0x5f3756!==undefined&&_0x5f3756!==null){const _0x1b5240=String(_0x5f3756)['trim']();if(!_0x1b5240)throw CliErrors[_0x381cb2(0x11b)](_0x381cb2(0x11c));if(_0x1b5240[_0x381cb2(0x115)]>0x40)throw CliErrors[_0x381cb2(0x11b)](_0x381cb2(0x126));_0x3316b5[_0x381cb2(0x11d)]=_0x1b5240;}_0x147762!==undefined&&_0x147762!==null&&(_0x3316b5[_0x381cb2(0x121)]=String(_0x147762));if(_0x3316b5[_0x381cb2(0x11d)]===undefined&&_0x3316b5[_0x381cb2(0x121)]===undefined)throw CliErrors[_0x381cb2(0x11b)](_0x381cb2(0x125),'Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.');return _0x3316b5;}export const roleUpdate={'service':a236_0x125633(0x11f),'command':a236_0x125633(0x111),'description':a236_0x125633(0x117),'risk':a236_0x125633(0x122),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a236_0x125633(0x10d),'type':'string','required':![],'description':a236_0x125633(0x120)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2cff00){readPatch(_0x2cff00);},async 'dryRun'(_0x1fce7b){const _0x2355fb=a236_0x125633,_0x4de9cb=_0x1fce7b[_0x2355fb(0x124)]('id'),_0x3565b8=readPatch(_0x1fce7b),_0xb0f9d9=await getRoleById(_0x1fce7b[_0x2355fb(0x113)],_0x4de9cb);return assertCustomRole(_0xb0f9d9,_0x2355fb(0x111)),asDryRunResult({'scope':'dev','operation':_0x2355fb(0x111),'selector':{'appCode':_0x1fce7b[_0x2355fb(0x113)],'roleId':_0x4de9cb,'roleName':_0xb0f9d9[_0x2355fb(0x11d)]},'before':projectRole(_0xb0f9d9),'after':projectRole({..._0xb0f9d9,..._0x3565b8[_0x2355fb(0x11d)]!==undefined?{'roleName':_0x3565b8[_0x2355fb(0x11d)]}:{},..._0x3565b8[_0x2355fb(0x121)]!==undefined?{'remark':_0x3565b8[_0x2355fb(0x121)]}:{}}),'dryRun':!![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},{'method':_0x2355fb(0x11e),'url':UPDATE_PATH});},async 'execute'(_0x369aaf){const _0x35c2fb=a236_0x125633,_0x2d6eae=_0x369aaf[_0x35c2fb(0x124)]('id'),_0x50607e=readPatch(_0x369aaf),_0x3f59e8=await getRoleById(_0x369aaf[_0x35c2fb(0x113)],_0x2d6eae);assertCustomRole(_0x3f59e8,_0x35c2fb(0x111)),await updateAppRole({'id':_0x2d6eae,'appCode':_0x369aaf['appCode'],..._0x50607e[_0x35c2fb(0x11d)]!==undefined?{'roleName':_0x50607e[_0x35c2fb(0x11d)]}:{},..._0x50607e[_0x35c2fb(0x121)]!==undefined?{'remark':_0x50607e[_0x35c2fb(0x121)]}:{}});const _0x56f06b=await getRoleById(_0x369aaf[_0x35c2fb(0x113)],_0x2d6eae);return{'ok':!![],'data':{'scope':_0x35c2fb(0x10a),'operation':_0x35c2fb(0x111),'selector':{'appCode':_0x369aaf['appCode'],'roleId':_0x2d6eae,'roleName':_0x56f06b[_0x35c2fb(0x11d)]},'before':projectRole(_0x3f59e8),'after':projectRole(_0x56f06b),'dryRun':![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},'message':_0x35c2fb(0x119)+_0x56f06b['roleName']+_0x35c2fb(0x10b)+_0x2d6eae+')'};}};
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
- const a237_0x577eeb=a237_0x18af;(function(_0x11d5ed,_0x29583f){const _0x2931ba=a237_0x18af,_0x182a05=_0x11d5ed();while(!![]){try{const _0x47085b=-parseInt(_0x2931ba(0xbb))/0x1*(-parseInt(_0x2931ba(0xb9))/0x2)+-parseInt(_0x2931ba(0xaf))/0x3*(parseInt(_0x2931ba(0xb1))/0x4)+-parseInt(_0x2931ba(0xa7))/0x5*(-parseInt(_0x2931ba(0xa8))/0x6)+-parseInt(_0x2931ba(0xae))/0x7+-parseInt(_0x2931ba(0xad))/0x8+parseInt(_0x2931ba(0xba))/0x9*(-parseInt(_0x2931ba(0xb6))/0xa)+parseInt(_0x2931ba(0xa9))/0xb;if(_0x47085b===_0x29583f)break;else _0x182a05['push'](_0x182a05['shift']());}catch(_0x11aed1){_0x182a05['push'](_0x182a05['shift']());}}}(a237_0xc9c5,0x43600));import{createDevUserRole}from'../../core/api-client.js';function a237_0xc9c5(){const _0x5e6646=['112zAIZpe','appCode','roleId','Added\x20user\x20','roleType','470600MjUHGD','POST','roleName','2FoRBES','90hSAbzT','110270AMxSqE','\x20already\x20in\x20role\x20','\x20to\x20role\x20','role','Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','461255OjafRB','12qszgjq','20936806JBrome','No\x20change:\x20user\x20','user-add','selector','4129720tttiZu','3095393ZMKtRE','52836SGzPNk','userId'];a237_0xc9c5=function(){return _0x5e6646;};return a237_0xc9c5();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,CREATE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';function a237_0x18af(_0x2fc3f1,_0x16afdb){_0x2fc3f1=_0x2fc3f1-0xa4;const _0xc9c58e=a237_0xc9c5();let _0x18af55=_0xc9c58e[_0x2fc3f1];return _0x18af55;}export const roleUserAdd={'service':a237_0x577eeb(0xa5),'command':'user-add','description':a237_0x577eeb(0xa6),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x130eac){const _0x103fb1=a237_0x577eeb,{mutation:_0x3760d7}=await prepareUserMutation(_0x130eac,_0x103fb1(0xab),!![]);return asDryRunResult(_0x3760d7,{'method':_0x103fb1(0xb7),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x4fa35e){const _0x1b3353=a237_0x577eeb,{mutation:_0x442578,changed:_0x2719e4,role:_0x35aebf,user:_0x144e30}=await prepareUserMutation(_0x4fa35e,_0x1b3353(0xab),![]);return _0x2719e4&&await createDevUserRole({'appCode':_0x4fa35e[_0x1b3353(0xb2)],'userId':_0x144e30[_0x1b3353(0xb0)],'username':_0x144e30['username'],'roleType':_0x35aebf[_0x1b3353(0xb5)],'roleId':_0x442578['selector'][_0x1b3353(0xb3)]}),{'ok':!![],'data':_0x442578,'message':_0x2719e4?_0x1b3353(0xb4)+_0x442578[_0x1b3353(0xac)]['userId']+_0x1b3353(0xa4)+_0x442578[_0x1b3353(0xac)][_0x1b3353(0xb8)]:_0x1b3353(0xaa)+_0x442578[_0x1b3353(0xac)]['userId']+_0x1b3353(0xbc)+_0x442578[_0x1b3353(0xac)][_0x1b3353(0xb8)]};}};
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
- const a238_0x223347=a238_0xcf35;(function(_0x41758d,_0x5be8aa){const _0x3f91f7=a238_0xcf35,_0x3d2a2c=_0x41758d();while(!![]){try{const _0xbf5738=-parseInt(_0x3f91f7(0x1c5))/0x1*(-parseInt(_0x3f91f7(0x1cb))/0x2)+-parseInt(_0x3f91f7(0x1da))/0x3*(parseInt(_0x3f91f7(0x1ce))/0x4)+-parseInt(_0x3f91f7(0x1c9))/0x5*(-parseInt(_0x3f91f7(0x1d1))/0x6)+parseInt(_0x3f91f7(0x1d3))/0x7+parseInt(_0x3f91f7(0x1c8))/0x8+parseInt(_0x3f91f7(0x1d0))/0x9+parseInt(_0x3f91f7(0x1d8))/0xa*(parseInt(_0x3f91f7(0x1d2))/0xb);if(_0xbf5738===_0x5be8aa)break;else _0x3d2a2c['push'](_0x3d2a2c['shift']());}catch(_0x4932f3){_0x3d2a2c['push'](_0x3d2a2c['shift']());}}}(a238_0x4047,0x3eda7));function a238_0x4047(){const _0x1d6400=['userId','role','4iTrkBm','high-risk-write','1342845UTzSGf','1130124adQuxw','1382722oAseBz','241822xmhuKE','Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','POST','selector','No\x20change:\x20user\x20','10gkLLdq','\x20not\x20in\x20role\x20','1023441oNLwYP','27LXFwae','user-remove','roleName','160888GEgrNz','5YPzqAL','\x20from\x20role\x20','5976eFgZgz'];a238_0x4047=function(){return _0x1d6400;};return a238_0x4047();}import{deleteDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a238_0xcf35(_0x25c955,_0x5d0847){_0x25c955=_0x25c955-0x1c5;const _0x4047a8=a238_0x4047();let _0xcf3571=_0x4047a8[_0x25c955];return _0xcf3571;}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_0x223347(0x1cd),'command':'user-remove','description':a238_0x223347(0x1d4),'risk':a238_0x223347(0x1cf),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x99573){const _0x2b7d5f=a238_0x223347,{mutation:_0x367d79}=await prepareUserMutation(_0x99573,_0x2b7d5f(0x1c6),!![]);return asDryRunResult(_0x367d79,{'method':_0x2b7d5f(0x1d5),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x5681f3){const _0x5808a5=a238_0x223347,{matchingRelationIds:_0x5e4851,mutation:_0x322cf9,changed:_0x3eb92a}=await prepareUserMutation(_0x5681f3,_0x5808a5(0x1c6),![]);if(_0x3eb92a)for(const _0x404097 of _0x5e4851){await deleteDevUserRole(_0x404097);}return{'ok':!![],'data':_0x322cf9,'message':_0x3eb92a?'Removed\x20user\x20'+_0x322cf9['selector'][_0x5808a5(0x1cc)]+_0x5808a5(0x1ca)+_0x322cf9[_0x5808a5(0x1d6)][_0x5808a5(0x1c7)]:_0x5808a5(0x1d7)+_0x322cf9['selector'][_0x5808a5(0x1cc)]+_0x5808a5(0x1d9)+_0x322cf9[_0x5808a5(0x1d6)][_0x5808a5(0x1c7)]};}};
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_0x14bf(_0x15fec1,_0x30d634){_0x15fec1=_0x15fec1-0xf2;const _0x5a91cb=a239_0x5a91();let _0x14bf73=_0x5a91cb[_0x15fec1];return _0x14bf73;}function a239_0x5a91(){const _0x327ee5=['13715046bvikaC','55567900xfBSDe','userId','user-resolve','18grdHqe','148LQAnrH','role','68182SPuVrO','559118wRZBnP','name','24QWdVey','Pass\x20--name\x20<nickname|username>.','\x22\x20→\x20userId\x20','read','194205gzXocA','281920RDzBQQ','matchedBy','Resolved\x20\x22','str','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','8191904afplYO','username'];a239_0x5a91=function(){return _0x327ee5;};return a239_0x5a91();}const a239_0x2409cd=a239_0x14bf;(function(_0x4a257a,_0x21911c){const _0x571af7=a239_0x14bf,_0x2aeeea=_0x4a257a();while(!![]){try{const _0x359a78=-parseInt(_0x571af7(0xf4))/0x1+-parseInt(_0x571af7(0x102))/0x2*(parseInt(_0x571af7(0x105))/0x3)+-parseInt(_0x571af7(0x100))/0x4*(parseInt(_0x571af7(0xf3))/0x5)+-parseInt(_0x571af7(0xff))/0x6*(parseInt(_0x571af7(0x103))/0x7)+-parseInt(_0x571af7(0xf9))/0x8+-parseInt(_0x571af7(0xfb))/0x9+parseInt(_0x571af7(0xfc))/0xa;if(_0x359a78===_0x21911c)break;else _0x2aeeea['push'](_0x2aeeea['shift']());}catch(_0x126d9e){_0x2aeeea['push'](_0x2aeeea['shift']());}}}(a239_0x5a91,0xbdd31));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a239_0x2409cd(0x101),'command':a239_0x2409cd(0xfe),'description':a239_0x2409cd(0xf8),'risk':a239_0x2409cd(0xf2),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x417484){const _0x34956a=a239_0x2409cd;if(!_0x417484[_0x34956a(0xf7)]('name')['trim']())throw CliErrors['flagMissing']('name',_0x34956a(0x106));},async 'execute'(_0x839c23){const _0x251c9c=a239_0x2409cd,_0x5daa29=_0x839c23[_0x251c9c(0xf7)](_0x251c9c(0x104))['trim'](),_0x2a3174=await resolveUserRef(_0x5daa29,'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':_0x2a3174['userId'],'username':_0x2a3174[_0x251c9c(0xfa)],'nickname':_0x2a3174['nickname'],'matchedBy':_0x2a3174[_0x251c9c(0xf5)]}},'message':_0x251c9c(0xf6)+_0x5daa29+_0x251c9c(0x107)+_0x2a3174[_0x251c9c(0xfd)]};}};
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_0xefb1ab=a240_0x19e8;(function(_0xd3665b,_0x30f1a8){const _0x4c194f=a240_0x19e8,_0x36db62=_0xd3665b();while(!![]){try{const _0x55a2f8=parseInt(_0x4c194f(0xb7))/0x1*(parseInt(_0x4c194f(0xb5))/0x2)+parseInt(_0x4c194f(0xb3))/0x3+-parseInt(_0x4c194f(0xbb))/0x4+parseInt(_0x4c194f(0xb4))/0x5+-parseInt(_0x4c194f(0xb8))/0x6+parseInt(_0x4c194f(0xb2))/0x7+-parseInt(_0x4c194f(0xba))/0x8;if(_0x55a2f8===_0x30f1a8)break;else _0x36db62['push'](_0x36db62['shift']());}catch(_0x1018a3){_0x36db62['push'](_0x36db62['shift']());}}}(a240_0x14cf,0xb5c54));function a240_0x14cf(){const _0x9ad917=['rule','\x20for\x20','Create\x20it\x20with\x20`rabetbase\x20rule\x20set\x20--type\x20','read','cookie','content','7355761HGixxs','3443145bUngPI','2316020BdDbiy','4vZOtjO','\x20--file\x20<path>\x20--dry-run`.','462556hMlCPw','2619522YYGXyn','appCode','17836872CgWqGN','704504VpdfNL','\x20is\x20not\x20configured\x20for\x20app\x20','Loaded\x20','app_rule_not_found','Get\x20one\x20agent\x20context\x20rule\x20for\x20the\x20resolved\x20app'];a240_0x14cf=function(){return _0x9ad917;};return a240_0x14cf();}function a240_0x19e8(_0x1c9a12,_0x71349b){_0x1c9a12=_0x1c9a12-0xac;const _0x14cf09=a240_0x14cf();let _0x19e8bd=_0x14cf09[_0x1c9a12];return _0x19e8bd;}import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPE_FLAG,appRuleError,appRuleFileName,projectAppRule,readAppRuleType}from'../../commands/rule/shared.js';export const ruleGet={'service':a240_0xefb1ab(0xac),'command':'get','description':a240_0xefb1ab(0xbf),'risk':a240_0xefb1ab(0xaf),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG],async 'validate'(_0x4d6f64){readAppRuleType(_0x4d6f64);},async 'execute'(_0x5cc216){const _0x38cf12=a240_0xefb1ab,_0x32cd24=readAppRuleType(_0x5cc216),_0x98a628=await getAppRule(_0x5cc216[_0x38cf12(0xb0)],{'appCode':_0x5cc216[_0x38cf12(0xb9)],'type':_0x32cd24});if(!_0x98a628)throw appRuleError(_0x38cf12(0xbe),appRuleFileName(_0x32cd24)+_0x38cf12(0xbc)+_0x5cc216[_0x38cf12(0xb9)]+'.',_0x38cf12(0xae)+_0x32cd24+_0x38cf12(0xb6));return{'ok':!![],'data':{'rule':{...projectAppRule(_0x32cd24,_0x98a628),'content':_0x98a628[_0x38cf12(0xb1)]}},'message':_0x38cf12(0xbd)+appRuleFileName(_0x32cd24)+_0x38cf12(0xad)+_0x5cc216[_0x38cf12(0xb9)]};}};
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
- const a241_0x5a01d1=a241_0x4513;(function(_0x29057b,_0x530efd){const _0x37bfa9=a241_0x4513,_0x40c2bd=_0x29057b();while(!![]){try{const _0x444bf8=parseInt(_0x37bfa9(0x1b6))/0x1*(-parseInt(_0x37bfa9(0x1bd))/0x2)+-parseInt(_0x37bfa9(0x1be))/0x3*(-parseInt(_0x37bfa9(0x1b2))/0x4)+-parseInt(_0x37bfa9(0x1b5))/0x5*(parseInt(_0x37bfa9(0x1b1))/0x6)+parseInt(_0x37bfa9(0x1b9))/0x7+-parseInt(_0x37bfa9(0x1b8))/0x8*(-parseInt(_0x37bfa9(0x1bc))/0x9)+-parseInt(_0x37bfa9(0x1b4))/0xa*(parseInt(_0x37bfa9(0x1ba))/0xb)+-parseInt(_0x37bfa9(0x1b0))/0xc*(-parseInt(_0x37bfa9(0x1bb))/0xd);if(_0x444bf8===_0x530efd)break;else _0x40c2bd['push'](_0x40c2bd['shift']());}catch(_0x37e282){_0x40c2bd['push'](_0x40c2bd['shift']());}}}(a241_0x1d07,0xdf841));import{withKbManagementSession}from'../../core/kb-management-client.js';import{ruleGet}from'../../commands/rule/get.js';function a241_0x4513(_0x1432a4,_0x59e8ea){_0x1432a4=_0x1432a4-0x1ae;const _0x1d0736=a241_0x1d07();let _0x451380=_0x1d0736[_0x1432a4];return _0x451380;}function a241_0x1d07(){const _0x2acd12=['execute','dryRun','5820bwIHSK','6nTSlUZ','16UGUBgs','signal','5841140oGOWYM','1727295uhPmqX','96349KbHcoS','map','1215352rfnRoU','6607839tKMxng','33zVFLoa','28691ZHIcvL','45ViISFZ','2XNciZQ','251778DBqmqy'];a241_0x1d07=function(){return _0x2acd12;};return a241_0x1d07();}import{ruleList}from'../../commands/rule/list.js';import{ruleSet}from'../../commands/rule/set.js';export const ruleDefinitions=[ruleList,ruleGet,ruleSet][a241_0x5a01d1(0x1b7)](_0x1ef5b9=>({..._0x1ef5b9,'execute':_0x1ac6c7=>withKbManagementSession(_0x1ac6c7['signal'],()=>_0x1ef5b9[a241_0x5a01d1(0x1ae)](_0x1ac6c7)),..._0x1ef5b9[a241_0x5a01d1(0x1af)]?{'dryRun':_0x102617=>withKbManagementSession(_0x102617[a241_0x5a01d1(0x1b3)],()=>_0x1ef5b9[a241_0x5a01d1(0x1af)](_0x102617))}:{}}));
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_0x4da0da=a242_0x2212;function a242_0x4ab4(){const _0xf2973a=['rule','cookie','762081EbgumW','16wsHHcs','read','6137256mEDREe','list','all','59717kLNfTd','Loaded\x20app\x20rule\x20configuration\x20for\x20','877108wstNGr','882wFzhsP','length','14319891obioPd','1162554EONIMR','appCode','List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','map','1883885xqMzML'];a242_0x4ab4=function(){return _0xf2973a;};return a242_0x4ab4();}function a242_0x2212(_0x57e359,_0x54666a){_0x57e359=_0x57e359-0x1ca;const _0x4ab433=a242_0x4ab4();let _0x221253=_0x4ab433[_0x57e359];return _0x221253;}(function(_0x3dd2fa,_0x1b2ee4){const _0x326477=a242_0x2212,_0x251242=_0x3dd2fa();while(!![]){try{const _0x2496fc=parseInt(_0x326477(0x1cb))/0x1+-parseInt(_0x326477(0x1da))/0x2+parseInt(_0x326477(0x1d2))/0x3+parseInt(_0x326477(0x1d5))/0x4+parseInt(_0x326477(0x1cf))/0x5+-parseInt(_0x326477(0x1db))/0x6*(-parseInt(_0x326477(0x1d8))/0x7)+parseInt(_0x326477(0x1d3))/0x8*(-parseInt(_0x326477(0x1ca))/0x9);if(_0x2496fc===_0x1b2ee4)break;else _0x251242['push'](_0x251242['shift']());}catch(_0x4c2547){_0x251242['push'](_0x251242['shift']());}}}(a242_0x4ab4,0xea9d1));import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';export const ruleList={'service':a242_0x4da0da(0x1d0),'command':a242_0x4da0da(0x1d6),'description':a242_0x4da0da(0x1cd),'risk':a242_0x4da0da(0x1d4),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x3e02db){const _0x41e2fb=a242_0x4da0da,_0x58e48a=await Promise[_0x41e2fb(0x1d7)](APP_RULE_TYPES[_0x41e2fb(0x1ce)](_0x1aa2bd=>getAppRule(_0x3e02db[_0x41e2fb(0x1d1)],{'appCode':_0x3e02db['appCode'],'type':_0x1aa2bd}))),_0x3907af=APP_RULE_TYPES['map']((_0x26c9b6,_0x5183cb)=>projectAppRule(_0x26c9b6,_0x58e48a[_0x5183cb]??null));return{'ok':!![],'data':{'total':_0x3907af[_0x41e2fb(0x1dc)],'rules':_0x3907af},'message':_0x41e2fb(0x1d9)+_0x3e02db[_0x41e2fb(0x1cc)]};}};
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_0x3f3639=a243_0x3d3c;(function(_0x456dd0,_0x19fcf9){const _0x5d082f=a243_0x3d3c,_0x468181=_0x456dd0();while(!![]){try{const _0x448c86=parseInt(_0x5d082f(0x142))/0x1*(-parseInt(_0x5d082f(0x145))/0x2)+-parseInt(_0x5d082f(0x11a))/0x3+parseInt(_0x5d082f(0x129))/0x4+-parseInt(_0x5d082f(0x148))/0x5*(-parseInt(_0x5d082f(0x14c))/0x6)+-parseInt(_0x5d082f(0x127))/0x7+parseInt(_0x5d082f(0x115))/0x8*(-parseInt(_0x5d082f(0x12c))/0x9)+parseInt(_0x5d082f(0x125))/0xa;if(_0x448c86===_0x19fcf9)break;else _0x468181['push'](_0x468181['shift']());}catch(_0x4ce1bb){_0x468181['push'](_0x468181['shift']());}}}(a243_0x4119,0x43e5b));function a243_0x4119(){const _0x196a3b=['\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','file','string',';\x20current\x20version\x20is\x20','\x20for\x20','number','Expected\x20','cookie','RULES\x20content\x20exceeds\x202000\x20UTF-16\x20units.','Use\x20read-only\x20rule\x20reconciliation;\x20do\x20not\x20resubmit\x20automatically.','app_rule_expected_version_invalid','Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20','Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.','content','app_rule_verification_failed','rules','Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.','str','push','2399DEZOYn','unconfigured','planned','88XGLTOP','appCode','expectedVersion','11945drfVfF','\x20--format\x20compress','type','before','1050xMzSEO','replacement','contentHash','trim','beforeRecord','version','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','2592536VtmQTN','UTF-8\x20Markdown\x20file\x20(RULES:\x202000\x20UTF-16\x20units;\x20DATABASE:\x205242880\x20units)','POST','Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','rule','1525797zwnzqe','expected-version','The\x20set\x20request\x20was\x20sent,\x20but\x20','create','\x20version\x20changed\x20before\x20write.','.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.','byteSize','--file\x20is\x20required.','app_rule_set_outcome_unknown','flag','input','8533170SAElHG','rabetbase\x20rule\x20get\x20--type\x20','1518076OxJBMX','isSafeInteger','647220rgEhFh','Set\x20','update','9CvmZqO','--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','DATABASE'];a243_0x4119=function(){return _0x196a3b;};return a243_0x4119();}import{knowledgeDocumentsPath}from'../../core/api-client.js';function a243_0x3d3c(_0x58f1d5,_0xed2b65){_0x58f1d5=_0x58f1d5-0x112;const _0x411923=a243_0x4119();let _0x3d3cfb=_0x411923[_0x58f1d5];return _0x3d3cfb;}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(_0x34d28a){const _0x23088a=a243_0x3d3c,_0x3d35f6=readAppRuleType(_0x34d28a),_0x53f610=_0x34d28a[_0x23088a(0x140)](_0x23088a(0x130))[_0x23088a(0x14f)]();if(!_0x53f610)throw appRuleError('app_rule_file_required',_0x23088a(0x121),'Pass\x20a\x20UTF-8\x20Markdown\x20file.');const _0x43f723=_0x34d28a[_0x23088a(0x123)](_0x23088a(0x11b));let _0x4c171d;if(_0x43f723!==undefined){_0x4c171d=Number(_0x43f723);if(!Number[_0x23088a(0x128)](_0x4c171d)||_0x4c171d<0x0)throw appRuleError(_0x23088a(0x139),_0x23088a(0x12d));}return{'type':_0x3d35f6,'file':_0x53f610,'expectedVersion':_0x4c171d};}async function prepareSet(_0x30fa3e){const _0x591296=a243_0x3d3c,_0x283801=readSetInput(_0x30fa3e),_0x22f8b7=await readAppRuleFile(_0x283801[_0x591296(0x130)]);if(_0x283801[_0x591296(0x14a)]===_0x591296(0x13e)&&_0x22f8b7[_0x591296(0x13c)]['length']>0x7d0)throw appRuleError('app_rule_content_too_large',_0x591296(0x137));const _0x458f09=await getAppRule(_0x30fa3e[_0x591296(0x136)],{'appCode':_0x30fa3e[_0x591296(0x146)],'type':_0x283801[_0x591296(0x14a)]});if(_0x283801['expectedVersion']!==undefined&&(_0x458f09?.[_0x591296(0x113)]??0x0)!==_0x283801[_0x591296(0x147)])throw appRuleError('app_rule_version_mismatch',appRuleFileName(_0x283801[_0x591296(0x14a)])+_0x591296(0x11e),_0x591296(0x135)+_0x283801[_0x591296(0x147)]+_0x591296(0x132)+(_0x458f09?.[_0x591296(0x113)]??_0x591296(0x143))+_0x591296(0x11f));return{'input':_0x283801,'replacement':_0x22f8b7,'beforeRecord':_0x458f09,'before':projectAppRule(_0x283801['type'],_0x458f09),'planned':{'type':_0x283801[_0x591296(0x14a)],'fileName':appRuleFileName(_0x283801[_0x591296(0x14a)]),'contextScope':appRuleContextScope(_0x283801[_0x591296(0x14a)]),'enabled':!![],'appCode':_0x30fa3e[_0x591296(0x146)],'scope':'rules','contentByteSize':_0x22f8b7[_0x591296(0x120)],'contentHash':_0x22f8b7[_0x591296(0x14e)]}};}function warningsFor(_0x37a4ea){return[];}export const ruleSet={'service':a243_0x3f3639(0x119),'command':'set','description':a243_0x3f3639(0x118),'risk':'write','requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':a243_0x3f3639(0x130),'type':a243_0x3f3639(0x131),'required':!![],'description':a243_0x3f3639(0x116)},{'name':a243_0x3f3639(0x11b),'type':a243_0x3f3639(0x134),'required':![],'description':'Require\x20the\x20current\x20version\x20before\x20atomic\x20compare-and-set'}],async 'validate'(_0x41defa){readSetInput(_0x41defa);},async 'dryRun'(_0x1bc78c){const _0x4a515e=a243_0x3f3639,_0x486958=await prepareSet(_0x1bc78c);return asDryRunResult({'operation':'set','selector':{'appCode':_0x1bc78c[_0x4a515e(0x146)],'scope':'rules','type':_0x486958[_0x4a515e(0x124)][_0x4a515e(0x14a)]},'before':_0x486958[_0x4a515e(0x14b)],'after':_0x486958[_0x4a515e(0x144)],'dryRun':!![],'backend':{'method':_0x4a515e(0x117),'path':knowledgeDocumentsPath('rules',_0x486958[_0x4a515e(0x112)]?_0x4a515e(0x12b):_0x4a515e(0x11d)),'body':{'appCode':_0x1bc78c[_0x4a515e(0x146)],..._0x486958['beforeRecord']?{'id':_0x486958[_0x4a515e(0x112)]['id']}:{},'title':_0x486958[_0x4a515e(0x124)][_0x4a515e(0x14a)]===_0x4a515e(0x13e)?'RULES':_0x4a515e(0x12e),'contentHash':_0x486958['replacement'][_0x4a515e(0x14e)],'contentByteSize':_0x486958['replacement'][_0x4a515e(0x120)],..._0x486958['beforeRecord']?{'expectedVersion':_0x486958[_0x4a515e(0x112)][_0x4a515e(0x113)]}:{}}},'warnings':warningsFor(_0x486958[_0x4a515e(0x124)][_0x4a515e(0x147)]),'verification':{'expectedVersion':_0x486958[_0x4a515e(0x112)]?.[_0x4a515e(0x113)]??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x4a515e(0x126)+_0x486958[_0x4a515e(0x124)]['type']+_0x4a515e(0x149)}},{'method':'POST','url':knowledgeDocumentsPath(_0x4a515e(0x13e),_0x486958[_0x4a515e(0x112)]?_0x4a515e(0x12b):_0x4a515e(0x11d))});},async 'execute'(_0x37293a){const _0x29652c=a243_0x3f3639,_0x18e20a=await prepareSet(_0x37293a),_0x5e0335=_0x18e20a[_0x29652c(0x112)]===null?0x1:_0x18e20a[_0x29652c(0x112)][_0x29652c(0x113)]+(_0x18e20a[_0x29652c(0x112)][_0x29652c(0x13c)]===_0x18e20a['replacement']['content']?0x0:0x1);let _0x718a8e,_0x3fe441=![];try{_0x718a8e=await saveAppRule(_0x37293a[_0x29652c(0x136)],{'appCode':_0x37293a[_0x29652c(0x146)],'type':_0x18e20a['input'][_0x29652c(0x14a)],'content':_0x18e20a[_0x29652c(0x14d)][_0x29652c(0x13c)],'expectedVersion':_0x18e20a['beforeRecord']?.['version']??0x0,..._0x18e20a[_0x29652c(0x112)]?{'id':_0x18e20a[_0x29652c(0x112)]['id']}:{}});if(_0x718a8e[_0x29652c(0x113)]!==_0x5e0335||_0x718a8e['content']!==_0x18e20a[_0x29652c(0x14d)][_0x29652c(0x13c)]||_0x18e20a[_0x29652c(0x112)]!==null&&_0x718a8e['id']!==_0x18e20a[_0x29652c(0x112)]['id'])throw appRuleError(_0x29652c(0x13d),'The\x20received\x20rule\x20state\x20contradicts\x20the\x20requested\x20changes.',_0x29652c(0x138));}catch(_0x3f4804){if(!isPlatformTransportFailure(_0x3f4804))throw _0x3f4804;_0x3fe441=!![];}let _0x1e18e0;try{_0x1e18e0=await getAppRule(_0x37293a[_0x29652c(0x136)],{'appCode':_0x37293a[_0x29652c(0x146)],'type':_0x18e20a[_0x29652c(0x124)][_0x29652c(0x14a)]});}catch(_0x1ac9bc){const _0xe7d65e=appRuleError(_0x3fe441?_0x29652c(0x122):'app_rule_verification_unavailable',_0x29652c(0x11c)+appRuleFileName(_0x18e20a[_0x29652c(0x124)][_0x29652c(0x14a)])+'\x20could\x20not\x20be\x20verified.',_0x29652c(0x13b));Object['defineProperty'](_0xe7d65e,'cause',{'value':_0x1ac9bc,'enumerable':![]});throw _0xe7d65e;}const _0x1d0c9a=_0x1e18e0&&inspectAppRuleContent(_0x1e18e0[_0x29652c(0x13c)])[_0x29652c(0x14e)]===_0x18e20a[_0x29652c(0x14d)][_0x29652c(0x14e)],_0x73c373=_0x1e18e0&&_0x1e18e0[_0x29652c(0x113)]===_0x5e0335&&(!_0x718a8e||_0x1e18e0['id']===_0x718a8e['id']&&_0x1e18e0[_0x29652c(0x113)]===_0x718a8e[_0x29652c(0x113)]);if(!_0x1e18e0||!_0x1d0c9a||!_0x73c373||_0x18e20a[_0x29652c(0x112)]!==null&&_0x1e18e0['id']!==_0x18e20a['beforeRecord']['id'])throw appRuleError(_0x3fe441?_0x29652c(0x122):'app_rule_verification_failed',appRuleFileName(_0x18e20a[_0x29652c(0x124)][_0x29652c(0x14a)])+_0x29652c(0x12f),_0x29652c(0x13a)+_0x18e20a[_0x29652c(0x124)]['type']+_0x29652c(0x114));const _0x42fa75=warningsFor(_0x18e20a['input'][_0x29652c(0x147)]);_0x3fe441&&_0x42fa75[_0x29652c(0x141)](_0x29652c(0x13f));const _0x46218e=projectAppRule(_0x18e20a[_0x29652c(0x124)][_0x29652c(0x14a)],_0x1e18e0);return{'ok':!![],'data':{'operation':'set','selector':{'appCode':_0x37293a[_0x29652c(0x146)],'scope':_0x29652c(0x13e),'type':_0x18e20a[_0x29652c(0x124)][_0x29652c(0x14a)]},'before':_0x18e20a[_0x29652c(0x14b)],'after':_0x46218e,'dryRun':![],'backend':{'method':'POST','path':knowledgeDocumentsPath(_0x29652c(0x13e),_0x18e20a[_0x29652c(0x112)]?_0x29652c(0x12b):_0x29652c(0x11d))},'warnings':_0x42fa75,'verification':{'status':'verified','recoveredAfterUnknownResponse':_0x3fe441,'expectedVersion':_0x18e20a[_0x29652c(0x112)]?.['version']??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x29652c(0x126)+_0x18e20a[_0x29652c(0x124)][_0x29652c(0x14a)]+'\x20--format\x20compress'}},'message':_0x29652c(0x12a)+appRuleFileName(_0x18e20a[_0x29652c(0x124)][_0x29652c(0x14a)])+_0x29652c(0x133)+_0x37293a[_0x29652c(0x146)]};}};
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_0x3d4fe3=a244_0x8735;(function(_0x5b8359,_0x40172d){const _0x111fd2=a244_0x8735,_0x146c8c=_0x5b8359();while(!![]){try{const _0x58dbd0=-parseInt(_0x111fd2(0xd8))/0x1*(-parseInt(_0x111fd2(0xed))/0x2)+parseInt(_0x111fd2(0xd9))/0x3+parseInt(_0x111fd2(0xf2))/0x4*(parseInt(_0x111fd2(0xe0))/0x5)+parseInt(_0x111fd2(0xcd))/0x6+parseInt(_0x111fd2(0xf6))/0x7*(-parseInt(_0x111fd2(0xde))/0x8)+parseInt(_0x111fd2(0xce))/0x9*(-parseInt(_0x111fd2(0xf3))/0xa)+parseInt(_0x111fd2(0xe2))/0xb*(parseInt(_0x111fd2(0xeb))/0xc);if(_0x58dbd0===_0x40172d)break;else _0x146c8c['push'](_0x146c8c['shift']());}catch(_0x295f51){_0x146c8c['push'](_0x146c8c['shift']());}}}(a244_0x59d7,0x71805));function a244_0x8735(_0x4f31ae,_0x1712e8){_0x4f31ae=_0x4f31ae-0xc7;const _0x59d7f3=a244_0x59d7();let _0x8735aa=_0x59d7f3[_0x4f31ae];return _0x8735aa;}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_0x3d4fe3(0xcb),a244_0x3d4fe3(0xf0)];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_0x3d4fe3(0xcf),'database':'DATABASE.md'},APP_RULE_CONTEXT_SCOPES={'rules':a244_0x3d4fe3(0xe9),'database':a244_0x3d4fe3(0xd1)};function a244_0x59d7(){const _0x16d24b=['653986frFeia','string','indexStatus','database','hex','533164HgVEJU','540490GbubMc','App\x20rule\x20content\x20exceeds\x205242880\x20UTF-16\x20units.','str','1082291BEeDav','app_rule_content_invalid','createTime','utf8','App\x20rule\x20content\x20exceeds\x20the\x20bounded\x20UTF-8\x20file\x20limit.','app_rule_content_too_large','toLowerCase','updateTime','sha256','update','rules','utf-8','794958NUgEYI','135sRAinO','RULES.md','appCode','database-analysis','App\x20rule\x20file\x20is\x20blank:\x20','length','app_rule_file_unreadable','App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','app_rule_type_invalid','1Rgdqwj','402330qUcaeB','decode','byteLength','contentHash','--file\x20is\x20required.','8VhNvjH','message','10QyfArK','byteSize','11BRGRxL','type','sha256:','--type\x20must\x20be\x20either\x20rules\x20or\x20database.','digest','scope','trim','page-api-development','size','6840852CkHVCk','version'];a244_0x59d7=function(){return _0x16d24b;};return a244_0x59d7();}export function appRuleError(_0x2c8b0a,_0x37482c,_0x59d9f4){return new CliError(_0x2c8b0a,0x1,_0x37482c,_0x59d9f4);}export function readAppRuleType(_0x500071){const _0x168d3b=a244_0x3d4fe3,_0x7bc338=_0x500071[_0x168d3b(0xf5)]('type')[_0x168d3b(0xe8)]()[_0x168d3b(0xc7)]();if(_0x7bc338!==_0x168d3b(0xcb)&&_0x7bc338!==_0x168d3b(0xf0))throw appRuleError(_0x168d3b(0xd7),_0x168d3b(0xe5));return _0x7bc338;}export function appRuleFileName(_0x3bb6fa){return APP_RULE_FILES[_0x3bb6fa];}export function appRuleContextScope(_0x5b0f32){return APP_RULE_CONTEXT_SCOPES[_0x5b0f32];}export function inspectAppRuleContent(_0x59172c){const _0x37f576=a244_0x3d4fe3,_0x3d1c79=Buffer['from'](_0x59172c,_0x37f576(0xf9));return{'content':_0x59172c,'byteSize':_0x3d1c79[_0x37f576(0xdb)],'contentHash':_0x37f576(0xe4)+createHash(_0x37f576(0xc9))[_0x37f576(0xca)](_0x3d1c79)[_0x37f576(0xe6)](_0x37f576(0xf1))};}export async function readAppRuleFile(_0x5de938){const _0x1c1231=a244_0x3d4fe3,_0x338e08=_0x5de938[_0x1c1231(0xe8)]();if(!_0x338e08)throw appRuleError('app_rule_file_required',_0x1c1231(0xdd),'Pass\x20a\x20UTF-8\x20Markdown\x20file.');const _0x396773=resolve(_0x338e08);let _0x115795;try{_0x115795=await stat(_0x396773);}catch(_0x54d22d){throw appRuleError(_0x1c1231(0xd4),'Cannot\x20access\x20app\x20rule\x20file:\x20'+_0x338e08,_0x54d22d instanceof Error?_0x54d22d[_0x1c1231(0xdf)]:String(_0x54d22d));}if(!_0x115795['isFile']())throw appRuleError('app_rule_file_invalid',_0x1c1231(0xd6)+_0x338e08);if(_0x115795[_0x1c1231(0xea)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x1c1231(0xfb),'App\x20rule\x20content\x20exceeds\x20the\x20bounded\x20UTF-8\x20file\x20limit.');let _0x3343ba;try{_0x3343ba=await readFile(_0x396773);}catch(_0x12cb19){throw appRuleError(_0x1c1231(0xd4),'Cannot\x20read\x20app\x20rule\x20file:\x20'+_0x338e08,_0x12cb19 instanceof Error?_0x12cb19[_0x1c1231(0xdf)]:String(_0x12cb19));}if(_0x3343ba['byteLength']>MAX_APP_RULE_BYTES)throw appRuleError(_0x1c1231(0xfb),_0x1c1231(0xfa));let _0x5c1abd;try{_0x5c1abd=new TextDecoder(_0x1c1231(0xcc),{'fatal':!![],'ignoreBOM':!![]})[_0x1c1231(0xda)](_0x3343ba);}catch{throw appRuleError(_0x1c1231(0xf7),_0x1c1231(0xd5)+_0x338e08);}if(_0x5c1abd[_0x1c1231(0xd3)]>MAX_APP_RULE_UNITS)throw appRuleError(_0x1c1231(0xfb),_0x1c1231(0xf4));if(!_0x5c1abd[_0x1c1231(0xe8)]())throw appRuleError('app_rule_content_invalid',_0x1c1231(0xd2)+_0x338e08);return inspectAppRuleContent(_0x5c1abd);}export function projectAppRule(_0x4179b7,_0x50d91e){const _0x246246=a244_0x3d4fe3;if(!_0x50d91e)return{'type':_0x4179b7,'fileName':appRuleFileName(_0x4179b7),'contextScope':appRuleContextScope(_0x4179b7),'enabled':![]};const _0x2d72d4=inspectAppRuleContent(_0x50d91e['content']);return{'type':_0x4179b7,'fileName':appRuleFileName(_0x4179b7),'contextScope':appRuleContextScope(_0x4179b7),'enabled':!![],'id':_0x50d91e['id'],'scope':_0x50d91e[_0x246246(0xe7)],'appCode':_0x50d91e[_0x246246(0xd0)],'version':_0x50d91e[_0x246246(0xec)],..._0x50d91e['indexStatus']!==undefined?{'indexStatus':_0x50d91e[_0x246246(0xef)]}:{},'contentByteSize':_0x2d72d4[_0x246246(0xe1)],'contentHash':_0x2d72d4[_0x246246(0xdc)],..._0x50d91e[_0x246246(0xf8)]!==undefined&&_0x50d91e['createTime']!==null?{'createTime':_0x50d91e[_0x246246(0xf8)]}:{},..._0x50d91e[_0x246246(0xc8)]!==undefined&&_0x50d91e[_0x246246(0xc8)]!==null?{'updateTime':_0x50d91e[_0x246246(0xc8)]}:{}};}export const APP_RULE_TYPE_FLAG={'name':a244_0x3d4fe3(0xe3),'type':a244_0x3d4fe3(0xee),'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
+ 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
- function a245_0x19ec(_0x459ab9,_0x33298c){_0x459ab9=_0x459ab9-0x15b;const _0x518ac5=a245_0x518a();let _0x19ec5a=_0x518ac5[_0x459ab9];return _0x19ec5a;}const a245_0x517c89=a245_0x19ec;(function(_0xb681e0,_0x1f8a97){const _0x41bf5c=a245_0x19ec,_0x51e0b7=_0xb681e0();while(!![]){try{const _0x5e0dc7=-parseInt(_0x41bf5c(0x197))/0x1+-parseInt(_0x41bf5c(0x18c))/0x2+parseInt(_0x41bf5c(0x191))/0x3*(-parseInt(_0x41bf5c(0x18b))/0x4)+-parseInt(_0x41bf5c(0x176))/0x5+-parseInt(_0x41bf5c(0x193))/0x6+parseInt(_0x41bf5c(0x18d))/0x7*(parseInt(_0x41bf5c(0x18a))/0x8)+parseInt(_0x41bf5c(0x188))/0x9*(parseInt(_0x41bf5c(0x181))/0xa);if(_0x5e0dc7===_0x1f8a97)break;else _0x51e0b7['push'](_0x51e0b7['shift']());}catch(_0x4df994){_0x51e0b7['push'](_0x51e0b7['shift']());}}}(a245_0x518a,0x350f8));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_0x517c89(0x19c),'dev']),DOMAIN_ROUTING_SYNC_SCRIPTS=new Set([a245_0x517c89(0x19c),'dev',a245_0x517c89(0x172),'preview']);export function syncProjectDomainRoutingBeforeScript(_0x63ff05,_0xb1e2f4){const _0x2fffad=a245_0x517c89;if(!DOMAIN_ROUTING_SYNC_SCRIPTS['has'](_0xb1e2f4))return null;const _0x518ba3=findProjectRootDirectory(_0x63ff05);if(!resolveConfigPath(_0x518ba3))return null;const _0x58d5c4=writeProjectDomainRoutingManifest(_0x518ba3);return{'path':_0x58d5c4[_0x2fffad(0x16c)],'changed':_0x58d5c4[_0x2fffad(0x16d)]};}function readPackageScripts(_0x3327af){const _0x432092=a245_0x517c89,_0x1e5d2e=resolve(_0x3327af,_0x432092(0x15d));if(!existsSync(_0x1e5d2e))return null;try{const _0x20ac76=JSON[_0x432092(0x195)](readFileSync(_0x1e5d2e,_0x432092(0x19f)));return _0x20ac76[_0x432092(0x179)]??{};}catch{return null;}}function detectPackageManager(_0x105ec4){const _0x480bd9=a245_0x517c89;if(existsSync(resolve(_0x105ec4,_0x480bd9(0x17c)))||existsSync(resolve(_0x105ec4,_0x480bd9(0x17d))))return _0x480bd9(0x185);if(existsSync(resolve(_0x105ec4,_0x480bd9(0x167))))return'pnpm';if(existsSync(resolve(_0x105ec4,_0x480bd9(0x199))))return _0x480bd9(0x17f);return _0x480bd9(0x19a);}async function versionCheck(_0x2b273a){const _0x2ba757=a245_0x517c89,_0x2673ea=await checkCliVersion();(_0x2673ea['needsUpgrade']||_0x2673ea[_0x2ba757(0x15e)])&&(printCliUpgradeWarning(_0x2673ea),assertCliVersionSupported(_0x2673ea));const _0x39085d=await checkSdkVersion(_0x2b273a);if(_0x39085d[_0x2ba757(0x16e)])printSdkUpgradeWarning(_0x39085d);}function spawnScript(_0x15e656,_0x5127bc,_0x4e7f76,_0xd24219){return new Promise((_0x1ff958,_0x20851a)=>{const _0x2b0236=a245_0x19ec,_0x3131e1=[_0x2b0236(0x18e),_0x5127bc,..._0x4e7f76],_0xd78585=spawn(_0x15e656,_0x3131e1,{'cwd':_0xd24219,'stdio':_0x2b0236(0x183),'shell':!![],'env':{...process.env,'PATH':''+join(_0xd24219,_0x2b0236(0x164),'.bin')+delimiter+process.env.PATH}});_0xd78585['on'](_0x2b0236(0x19e),_0x103e0b=>{const _0x1aafcf=_0x2b0236;if(_0x103e0b===0x0||_0x103e0b===null)_0x1ff958();else _0x20851a(new Error(_0x15e656+_0x1aafcf(0x171)+_0x5127bc+'\x20exited\x20with\x20code\x20'+_0x103e0b));}),_0xd78585['on'](_0x2b0236(0x173),_0x20851a);});}function spawnViteBuildWatch(_0x34b9ac){return new Promise((_0x11d18b,_0x166b23)=>{const _0x5ca0a7=a245_0x19ec,_0x14a6ea=spawn(_0x5ca0a7(0x168),[_0x5ca0a7(0x172),_0x5ca0a7(0x190)],{'cwd':_0x34b9ac,'stdio':_0x5ca0a7(0x183),'shell':!![],'env':{...process.env,'PATH':''+join(_0x34b9ac,_0x5ca0a7(0x164),_0x5ca0a7(0x18f))+delimiter+process.env.PATH}});_0x14a6ea['on'](_0x5ca0a7(0x19e),_0x7b7496=>{const _0x361653=_0x5ca0a7;if(_0x7b7496===0x0||_0x7b7496===null)_0x11d18b();else _0x166b23(new Error(_0x361653(0x19b)+_0x7b7496));}),_0x14a6ea['on'](_0x5ca0a7(0x173),_0x166b23);});}function spawnVitePreview(_0x4e3d04){return new Promise((_0x1562ec,_0x2e625a)=>{const _0x1ca6f7=a245_0x19ec,_0x558450=spawn(_0x1ca6f7(0x168),[_0x1ca6f7(0x163)],{'cwd':_0x4e3d04,'stdio':_0x1ca6f7(0x183),'shell':!![],'env':{...process.env,'PATH':''+join(_0x4e3d04,_0x1ca6f7(0x164),_0x1ca6f7(0x18f))+delimiter+process.env.PATH}});_0x558450['on'](_0x1ca6f7(0x19e),_0x2bd7f0=>{const _0x256668=_0x1ca6f7;if(_0x2bd7f0===0x0||_0x2bd7f0===null)_0x1562ec();else _0x2e625a(new Error(_0x256668(0x174)+_0x2bd7f0));}),_0x558450['on'](_0x1ca6f7(0x173),_0x2e625a);});}const runFlags=[{'name':a245_0x517c89(0x17e),'type':a245_0x517c89(0x162),'description':a245_0x517c89(0x16a),'default':![]}];export const runDefinition={'service':a245_0x517c89(0x18e),'command':a245_0x517c89(0x18e),'description':a245_0x517c89(0x196),'risk':a245_0x517c89(0x186),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a245_0x517c89(0x182),'description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x8b90fa=a245_0x517c89,_0x394de5=[];return _0x394de5[_0x8b90fa(0x194)](_0x8b90fa(0x198)),_0x394de5[_0x8b90fa(0x194)](_0x8b90fa(0x161)+CLI_BIN_NAME+_0x8b90fa(0x189)),_0x394de5[_0x8b90fa(0x194)](_0x8b90fa(0x161)+CLI_BIN_NAME+_0x8b90fa(0x170)),_0x394de5[_0x8b90fa(0x194)](_0x8b90fa(0x161)+CLI_BIN_NAME+_0x8b90fa(0x169)),_0x394de5['push'](_0x8b90fa(0x161)+CLI_BIN_NAME+_0x8b90fa(0x19d)),_0x394de5[_0x8b90fa(0x17b)]('\x0a');},async 'execute'(_0x1ce304){const _0x45cdd7=a245_0x517c89,_0x4e5a97=process[_0x45cdd7(0x175)](),_0x2fb32d=_0x1ce304[_0x45cdd7(0x178)][0x0],_0x554550=_0x1ce304[_0x45cdd7(0x178)]['slice'](0x1),_0x58be1b=readPackageScripts(_0x4e5a97);if(!_0x58be1b)throw CliErrors[_0x45cdd7(0x165)](_0x45cdd7(0x16b));if(!_0x2fb32d){const _0x5b3f8b=Object['keys'](_0x58be1b);if(_0x5b3f8b[_0x45cdd7(0x15b)]===0x0)console[_0x45cdd7(0x166)](_0x45cdd7(0x177));else{console[_0x45cdd7(0x166)](_0x45cdd7(0x16f));for(const _0x2ee6df of _0x5b3f8b){console[_0x45cdd7(0x166)](_0x45cdd7(0x161)+_0x2ee6df);}console[_0x45cdd7(0x166)](_0x45cdd7(0x160)+CLI_BIN_NAME+_0x45cdd7(0x187));}return{'ok':!![]};}if(!_0x58be1b[_0x2fb32d])throw CliErrors[_0x45cdd7(0x165)](_0x45cdd7(0x17a)+_0x2fb32d+_0x45cdd7(0x180),_0x45cdd7(0x184)+(Object[_0x45cdd7(0x15f)](_0x58be1b)[_0x45cdd7(0x17b)](',\x20')||'(none)'));const _0x112386=detectPackageManager(_0x4e5a97),_0x498b2f=syncProjectDomainRoutingBeforeScript(_0x4e5a97,_0x2fb32d);_0x498b2f?.[_0x45cdd7(0x16d)]&&console['error']('Domain\x20routing\x20synchronized:\x20'+_0x498b2f[_0x45cdd7(0x16c)]);VERSION_CHECK_SCRIPTS['has'](_0x2fb32d)&&await versionCheck(_0x4e5a97);if(_0x2fb32d===_0x45cdd7(0x163)&&_0x1ce304[_0x45cdd7(0x15c)](_0x45cdd7(0x17e)))return await Promise[_0x45cdd7(0x192)]([spawnViteBuildWatch(_0x4e5a97),spawnVitePreview(_0x4e5a97)]),{'ok':!![]};return await spawnScript(_0x112386,_0x2fb32d,_0x554550,_0x4e5a97),{'ok':!![]};}};function a245_0x518a(){const _0x379553=['utf-8','length','bool','package.json','belowMinimum','keys','\x0a\x20\x20Usage:\x20','\x20\x20\x20\x20','boolean','preview','node_modules','validation','log','pnpm-lock.yaml','vite','\x20run\x20preview','Enable\x20watch\x20mode\x20for\x20preview','No\x20package.json\x20found\x20in\x20current\x20directory.','path','changed','needsUpgrade','\x0a\x20\x20Available\x20scripts:\x0a','\x20run\x20build','\x20run\x20','build','error','vite\x20preview\x20exited\x20with\x20code\x20','cwd','2080090KWFpCD','No\x20scripts\x20defined\x20in\x20package.json.','args','scripts','Script\x20\x22','join','bun.lockb','bun.lock','watch','yarn','\x22\x20not\x20found\x20in\x20package.json.','280LuNSJO','script','inherit','Available:\x20','bun','write','\x20run\x20<script>\x0a','348363IrZbzO','\x20run\x20start','264lCeBWZ','20kDNhkb','482926qrgivn','79464djNnfW','run','.bin','--watch','209037gAbcXA','all','373368OllDPw','push','parse','Run\x20a\x20package.json\x20script','172972toSnkN','\x20\x20EXAMPLES','yarn.lock','npm','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','start','\x20run\x20preview\x20--watch','close'];a245_0x518a=function(){return _0x379553;};return a245_0x518a();}
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_0x3caf3d=a246_0x39e7;function a246_0x2591(){const _0x1326c9=['4509603vLiViO','6101809jGeehq','1578EiWhXk','8DTyIIc','read','36NHALOG','915920WBvgwY','schema','export','36790zumsLX','187uINyJV','190131FibaCD','json','3023rdncnk','5529927tVnumC','438xEtdmT','84KtaWIv'];a246_0x2591=function(){return _0x1326c9;};return a246_0x2591();}(function(_0x3253c8,_0x463b7d){const _0xfc726b=a246_0x39e7,_0x4b1cce=_0x3253c8();while(!![]){try{const _0x15c375=-parseInt(_0xfc726b(0xbf))/0x1*(-parseInt(_0xfc726b(0xb0))/0x2)+-parseInt(_0xfc726b(0xbd))/0x3*(parseInt(_0xfc726b(0xb7))/0x4)+-parseInt(_0xfc726b(0xbb))/0x5*(-parseInt(_0xfc726b(0xb4))/0x6)+parseInt(_0xfc726b(0xb3))/0x7+parseInt(_0xfc726b(0xb5))/0x8*(-parseInt(_0xfc726b(0xb2))/0x9)+-parseInt(_0xfc726b(0xb8))/0xa*(-parseInt(_0xfc726b(0xbc))/0xb)+-parseInt(_0xfc726b(0xb1))/0xc*(parseInt(_0xfc726b(0xaf))/0xd);if(_0x15c375===_0x463b7d)break;else _0x4b1cce['push'](_0x4b1cce['shift']());}catch(_0x48947c){_0x4b1cce['push'](_0x4b1cce['shift']());}}}(a246_0x2591,0xee7bd));import{buildSchemaPayload}from'../framework/schema-export.js';function a246_0x39e7(_0x208a16,_0x8da7c2){_0x208a16=_0x208a16-0xaf;const _0x2591d0=a246_0x2591();let _0x39e75c=_0x2591d0[_0x208a16];return _0x39e75c;}async function execute(_0x114725){const _0x119d6d=await buildSchemaPayload();return{'ok':!![],'data':_0x119d6d};}export const schemaDefinition={'service':a246_0x3caf3d(0xb9),'command':a246_0x3caf3d(0xba),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a246_0x3caf3d(0xb6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a246_0x3caf3d(0xbe),'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_0x50deb8=a247_0x57ab;(function(_0x1cc1ce,_0x3f9d72){const _0x3a078d=a247_0x57ab,_0x43cd9e=_0x1cc1ce();while(!![]){try{const _0x4fd928=parseInt(_0x3a078d(0x89))/0x1*(-parseInt(_0x3a078d(0xa4))/0x2)+-parseInt(_0x3a078d(0xa8))/0x3*(parseInt(_0x3a078d(0x96))/0x4)+parseInt(_0x3a078d(0x98))/0x5*(-parseInt(_0x3a078d(0xb2))/0x6)+parseInt(_0x3a078d(0xa0))/0x7*(parseInt(_0x3a078d(0x82))/0x8)+parseInt(_0x3a078d(0xb0))/0x9*(-parseInt(_0x3a078d(0x9b))/0xa)+-parseInt(_0x3a078d(0x83))/0xb*(parseInt(_0x3a078d(0xb1))/0xc)+parseInt(_0x3a078d(0xb7))/0xd;if(_0x4fd928===_0x3f9d72)break;else _0x43cd9e['push'](_0x43cd9e['shift']());}catch(_0x5a2c10){_0x43cd9e['push'](_0x43cd9e['shift']());}}}(a247_0x33cd,0x4252c));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';function a247_0x57ab(_0x482910,_0x4b5e72){_0x482910=_0x482910-0x7e;const _0x33cd47=a247_0x33cd();let _0x57ab4d=_0x33cd47[_0x482910];return _0x57ab4d;}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(_0x1f15d3){const _0x30a9a9=a247_0x57ab;if(_0x1f15d3==='mybatisXml')return[_0x30a9a9(0x97),_0x30a9a9(0x88),_0x30a9a9(0xb8),'']['join']('\x0a');return['SELECT\x201\x20AS\x20id;','']['join']('\x0a');}export const sqlCreate={'service':a247_0x50deb8(0xaa),'command':'create','description':a247_0x50deb8(0x9e),'risk':a247_0x50deb8(0xb4),'flags':[{'name':'name','type':a247_0x50deb8(0x8f),'description':a247_0x50deb8(0x7e)},{'name':a247_0x50deb8(0xb5),'type':a247_0x50deb8(0xba),'description':a247_0x50deb8(0xac)},{'name':a247_0x50deb8(0xb3),'type':a247_0x50deb8(0x8f),'enum':['sql','mybatisXml'],'description':a247_0x50deb8(0x87)}],async 'validate'(_0x2663ff){const _0x40f39e=a247_0x50deb8;if(!_0x2663ff['nonInteractive'])return;if(!_0x2663ff['str'](_0x40f39e(0xc1))[_0x40f39e(0x9c)]())throw CliErrors[_0x40f39e(0x80)](_0x40f39e(0xc1),_0x40f39e(0x94));const _0x5cc4ad=resolveProvidedDbId(_0x2663ff);if(typeof _0x5cc4ad!==_0x40f39e(0xba)||!Number[_0x40f39e(0xa6)](_0x5cc4ad)||_0x5cc4ad<=0x0)throw CliErrors[_0x40f39e(0x80)](_0x40f39e(0xb5),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');if(!_0x2663ff[_0x40f39e(0xaf)]('mode')[_0x40f39e(0x9c)]())throw CliErrors['flagMissing'](_0x40f39e(0xb3),_0x40f39e(0xbb));},async 'dryRun'(_0x14acc1){const _0x5879c8=a247_0x50deb8,_0x316ffb=loadSqlProjectConfig(_0x14acc1[_0x5879c8(0x9a)]),{sqlName:_0x5864fd,dbId:_0x1ae6a4,dbName:_0x1a2610,mode:_0x1440cb}=await resolveSqlNewInputs(_0x14acc1),_0x4079da=buildSqlRelativePath('<server-generated-sqlCode>',_0x5864fd,_0x1a2610,_0x1440cb,_0x1ae6a4),_0x263307=_0x316ffb['sqlRootDir']+'/'+_0x4079da;return{'method':_0x5879c8(0xa7),'url':_0x5879c8(0x99),'body':{'appCode':_0x14acc1[_0x5879c8(0x9a)],'sqlName':_0x5864fd,'dbId':_0x1ae6a4,'mode':_0x1440cb,'localPath':_0x263307},'description':_0x5879c8(0x8c)+_0x316ffb[_0x5879c8(0x85)]};},async 'execute'(_0x4bd8eb){const _0x158ff8=a247_0x50deb8,_0x2891b3=loadSqlProjectConfig(_0x4bd8eb[_0x158ff8(0x9a)]),{sqlName:_0x3b21f2,dbId:_0x55115f,dbName:_0x4521e8,mode:_0x1607bc}=await resolveSqlNewInputs(_0x4bd8eb),_0x2ffce3=generateSqlTemplate(_0x1607bc),_0x17f424=await createSqlQuery({'appCode':_0x4bd8eb['appCode'],'sqlName':_0x3b21f2,'dbId':_0x55115f,'sqlContent':_0x2ffce3}),_0xc26afe=ensureRemoteSqlContent(_0x17f424),_0xbd05a8=_0x4521e8||await getDbName(_0x4bd8eb[_0x158ff8(0x9a)],_0x55115f)[_0x158ff8(0xa5)](()=>undefined),_0x36d5c5=buildSqlRelativePath(_0x17f424[_0x158ff8(0xae)],_0x17f424['sqlName'],_0xbd05a8,_0x1607bc,_0x55115f),_0x5aa20f=_0x2891b3[_0x158ff8(0x85)]+'/'+_0x36d5c5,_0x45773d=buildLocalSqlFileContent({'sqlCode':_0x17f424[_0x158ff8(0xae)],'sqlName':_0x17f424[_0x158ff8(0xad)],'dbId':_0x17f424['dbId']},_0xc26afe,{'dbName':_0xbd05a8,'mode':_0x1607bc,'syncedAt':new Date()['toISOString'](),'description':_0x17f424[_0x158ff8(0xbc)]});if(await fileExists(_0x5aa20f))throw CliErrors[_0x158ff8(0xb6)](_0x158ff8(0x84)+_0x5aa20f);await ensureParentDirectory(_0x5aa20f),await writeFile(_0x5aa20f,_0x45773d,_0x158ff8(0xa3));const _0x464fae=await readSqlLockFile(_0x2891b3[_0x158ff8(0x9f)]),{lockData:_0x383014,appLock:_0x1778c4}=ensureSqlLockScope(_0x464fae??createEmptySqlLock(),_0x2891b3[_0x158ff8(0x9a)],_0x2891b3[_0x158ff8(0x93)],_0x158ff8(0x86));return _0x1778c4[_0x158ff8(0xab)][_0x17f424['sqlCode']]={...buildSqlLockEntry(_0x17f424,_0xc26afe,computeSqlContentHash(_0x45773d),{'dbName':_0xbd05a8}),'path':_0x36d5c5,'mode':_0x1607bc},_0x1778c4[_0x158ff8(0x92)]=new Date()['toISOString'](),await writeSqlLockFile(_0x2891b3[_0x158ff8(0x9f)],_0x383014),{'ok':!![],'data':{'id':_0x17f424['id'],'sqlCode':_0x17f424['sqlCode'],'sqlName':_0x17f424['sqlName'],'dbId':_0x17f424['dbId'],'path':_0x5aa20f,'mode':_0x1607bc},'message':'Created\x20SQL\x20query\x20'+_0x17f424[_0x158ff8(0xae)]};}};async function resolveSqlNewInputs(_0x111bd6){const _0x5d6252=await resolveSqlNameInput(_0x111bd6),{dbId:_0x571989,dbName:_0x27fc0d}=await resolveDbSelection(_0x111bd6),_0x59a460=await resolveSqlModeInput(_0x111bd6);return{'sqlName':_0x5d6252,'dbId':_0x571989,'dbName':_0x27fc0d,'mode':_0x59a460};}async function resolveSqlNameInput(_0x2aa4a2){const _0x5ebaa9=a247_0x50deb8,_0x560cb3=_0x2aa4a2['str'](_0x5ebaa9(0xc1))[_0x5ebaa9(0x9c)]();if(_0x560cb3)return _0x560cb3;if(_0x2aa4a2[_0x5ebaa9(0xc0)])throw CliErrors[_0x5ebaa9(0x80)](_0x5ebaa9(0xc1),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');return(await input({'message':'SQL\x20name:','validate':_0x48d740=>_0x48d740[_0x5ebaa9(0x9c)]()?!![]:'SQL\x20name\x20cannot\x20be\x20empty'}))['trim']();}function a247_0x33cd(){const _0x171b32=['flagMissing','length','242936NbFYhF','57629Ytokao','File\x20already\x20exists:\x20','sqlRootDir','new','Local\x20SQL\x20file\x20mode','\x20\x20SELECT\x201\x20AS\x20id','10753iYahYo','parse','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','stringify','Select\x20the\x20target\x20database:','string','dbId\x20must\x20be\x20a\x20positive\x20integer','✎\x20Enter\x20dbId\x20manually','lastSync','sqlRoot','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','Invalid\x20database\x20selection\x20payload:\x20','74996FEecFA','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','83565jFhdTM','/smartapi/custom/saveUserCustomSql','appCode','1266620BFIeOq','trim','dbName','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','lockFilePath','28bwVeto','Plain\x20SQL\x20(sql)','isInteger','utf8','62RrVPhK','catch','isFinite','POST','12VGRCSu','__manual__','sql','sqls','Target\x20database\x20ID','sqlName','sqlCode','str','27BGiUen','660TxsNWS','12zOodbV','mode','write','db-id','validation','16381144loHCnw','</select>','mybatisXml','number','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','description','dbId','Target\x20database\x20dbId:','For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly','nonInteractive','name','SQL\x20query\x20display\x20name','dbId\x20cannot\x20be\x20empty'];a247_0x33cd=function(){return _0x171b32;};return a247_0x33cd();}async function resolveDbSelection(_0x49eca8){const _0x2e541f=a247_0x50deb8,_0x657eb=resolveProvidedDbId(_0x49eca8);if(typeof _0x657eb==='number'&&Number[_0x2e541f(0xa6)](_0x657eb)&&_0x657eb>0x0)return{'dbId':_0x657eb,'dbName':await getDbName(_0x49eca8[_0x2e541f(0x9a)],_0x657eb)[_0x2e541f(0xa5)](()=>undefined)};if(_0x49eca8[_0x2e541f(0xc0)])throw CliErrors[_0x2e541f(0x80)](_0x2e541f(0xb5),_0x2e541f(0x8b));const _0x1326f0=await listDatabases(_0x49eca8[_0x2e541f(0x9a)])['catch'](()=>[]);if(_0x1326f0[_0x2e541f(0x81)]===0x1)return{'dbId':_0x1326f0[0x0]['dbId'],'dbName':_0x1326f0[0x0]['dbName']};if(_0x1326f0['length']>0x1){const _0x3011fb=await select({'message':_0x2e541f(0x8e),'choices':[..._0x1326f0['map'](_0x42a9f8=>({'name':_0x42a9f8[_0x2e541f(0x9d)]+'\x20('+_0x42a9f8[_0x2e541f(0xbd)]+')','value':serializeDbSelection(_0x42a9f8)})),{'name':_0x2e541f(0x91),'value':_0x2e541f(0xa9)}]});if(_0x3011fb!==_0x2e541f(0xa9))return deserializeDbSelection(_0x3011fb);}const _0x458471=await input({'message':_0x2e541f(0xbe),'validate':_0x4851ec=>{const _0x36daa2=_0x2e541f,_0x2abadc=_0x4851ec[_0x36daa2(0x9c)]();if(!_0x2abadc)return _0x36daa2(0x7f);const _0x39b7f1=Number(_0x2abadc);if(!Number[_0x36daa2(0xa2)](_0x39b7f1)||_0x39b7f1<=0x0)return _0x36daa2(0x90);return!![];}});return{'dbId':Number(_0x458471[_0x2e541f(0x9c)]())};}async function resolveSqlModeInput(_0x77ec06){const _0x15e2cb=a247_0x50deb8,_0x51342f=_0x77ec06[_0x15e2cb(0xaf)]('mode')[_0x15e2cb(0x9c)]();if(_0x51342f==='sql'||_0x51342f===_0x15e2cb(0xb9))return _0x51342f;if(_0x77ec06[_0x15e2cb(0xc0)])throw CliErrors[_0x15e2cb(0x80)](_0x15e2cb(0xb3),_0x15e2cb(0xbb));return await select({'message':'Select\x20the\x20local\x20SQL\x20mode:','choices':[{'name':_0x15e2cb(0xa1),'value':'sql','description':_0x15e2cb(0xbf)},{'name':'MyBatis\x20XML\x20(mybatisXml)','value':'mybatisXml','description':'For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags'}]});}function serializeDbSelection(_0x5adae){const _0x4ddcb4=a247_0x50deb8;return JSON[_0x4ddcb4(0x8d)]({'dbId':_0x5adae[_0x4ddcb4(0xbd)],'dbName':_0x5adae[_0x4ddcb4(0x9d)]});}function deserializeDbSelection(_0x270cf4){const _0x26af36=a247_0x50deb8;try{const _0x1b1442=JSON[_0x26af36(0x8a)](_0x270cf4);if(typeof _0x1b1442['dbId']==='number'&&Number[_0x26af36(0xa6)](_0x1b1442[_0x26af36(0xbd)]))return{'dbId':_0x1b1442[_0x26af36(0xbd)],'dbName':_0x1b1442[_0x26af36(0x9d)]};}catch{}throw CliErrors[_0x26af36(0xb6)](_0x26af36(0x95)+_0x270cf4);}function resolveProvidedDbId(_0x727b5){const _0x3787bf=a247_0x50deb8,_0x4c6dd8=_0x727b5['flag'](_0x3787bf(0xb5));if(typeof _0x4c6dd8==='number'&&Number[_0x3787bf(0xa6)](_0x4c6dd8))return _0x4c6dd8;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;}
@@ -1 +1 @@
1
- const a248_0x2ff981=a248_0x213a;(function(_0x3bac75,_0x4f2fb1){const _0x4e40ab=a248_0x213a,_0x57d398=_0x3bac75();while(!![]){try{const _0x487d92=parseInt(_0x4e40ab(0x130))/0x1*(-parseInt(_0x4e40ab(0x145))/0x2)+parseInt(_0x4e40ab(0x122))/0x3+-parseInt(_0x4e40ab(0x138))/0x4+-parseInt(_0x4e40ab(0x127))/0x5+-parseInt(_0x4e40ab(0x12e))/0x6*(parseInt(_0x4e40ab(0x142))/0x7)+-parseInt(_0x4e40ab(0x13b))/0x8+parseInt(_0x4e40ab(0x133))/0x9;if(_0x487d92===_0x4f2fb1)break;else _0x57d398['push'](_0x57d398['shift']());}catch(_0x24975d){_0x57d398['push'](_0x57d398['shift']());}}}(a248_0x4214,0x9d307));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';function a248_0x213a(_0x2a7b72,_0x5374d4){_0x2a7b72=_0x2a7b72-0x122;const _0x42145d=a248_0x4214();let _0x213a64=_0x42145d[_0x2a7b72];return _0x213a64;}import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';function a248_0x4214(){const _0x306ca7=['str','lockFilePath','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','36uSyVvt','toISOString','1VPDolG','remoteId','SQL\x20lock\x20file\x20not\x20found.','47166318BsPlDj','replace','/smartapi/custom/deleteUserCustomSql','POST','filter','4404304mgqQkX','trashDir','\x20(local\x20file\x20moved\x20to\x20trash)','10025968DhEPjk','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','sqlRoot','Would\x20delete\x20SQL\x20','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','fromEntries','lastSync','1437072BSlJSy','sql','delete','2138302EbiqKz','1286547cjbpso','appCode','length','high-risk-write','sqlcode','1852275mknQoz','validation','sqls'];a248_0x4214=function(){return _0x306ca7;};return a248_0x4214();}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a248_0x2ff981(0x143),'command':a248_0x2ff981(0x144),'description':a248_0x2ff981(0x13c),'risk':a248_0x2ff981(0x125),'flags':[SQLCODE_FLAG],async 'validate'(_0x5d8f78){const _0x510a23=a248_0x2ff981,_0x4d25a4=loadSqlProjectConfig(_0x5d8f78['appCode']),_0x4d50b9=await readSqlLockFile(_0x4d25a4[_0x510a23(0x12b)]);if(!_0x4d50b9)throw CliErrors['validation'](_0x510a23(0x12c));},async 'dryRun'(_0x20c53b){const _0x39bf06=a248_0x2ff981,_0x398f9d=loadSqlProjectConfig(_0x20c53b[_0x39bf06(0x123)]),_0x4c62cc=await readSqlLockFile(_0x398f9d[_0x39bf06(0x12b)]);if(!_0x4c62cc)throw CliErrors['validation'](_0x39bf06(0x12c));const {appLock:_0x1be026}=ensureSqlLockScope(_0x4c62cc,_0x20c53b[_0x39bf06(0x123)],_0x398f9d[_0x39bf06(0x13d)],_0x39bf06(0x144)),_0x461c99=_0x20c53b[_0x39bf06(0x12a)](_0x39bf06(0x126)),_0x248d06=_0x1be026[_0x39bf06(0x129)][_0x461c99];if(!_0x248d06)throw CliErrors[_0x39bf06(0x128)]('No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22'+_0x461c99+'\x22.');return{'method':_0x39bf06(0x136),'url':_0x39bf06(0x135),'body':{'sqlCode':_0x461c99,'id':_0x248d06[_0x39bf06(0x131)],'localPath':resolveLocalSqlFilePath(_0x398f9d,_0x461c99,_0x248d06)},'description':_0x39bf06(0x13e)+_0x461c99+_0x39bf06(0x12d)+_0x398f9d[_0x39bf06(0x139)]};},async 'execute'(_0x39edec){const _0x56c41e=a248_0x2ff981,_0x62d509=loadSqlProjectConfig(_0x39edec[_0x56c41e(0x123)]),_0x537860=await readSqlLockFile(_0x62d509[_0x56c41e(0x12b)]);if(!_0x537860)throw CliErrors[_0x56c41e(0x128)](_0x56c41e(0x132));const {lockData:_0x5d2718,appLock:_0x29a872}=ensureSqlLockScope(_0x537860,_0x39edec['appCode'],_0x62d509['sqlRoot'],'delete'),_0x7b79f4=_0x39edec['str'](_0x56c41e(0x126)),_0x174e2b=_0x29a872[_0x56c41e(0x129)][_0x7b79f4];if(!_0x174e2b)throw CliErrors[_0x56c41e(0x128)](_0x56c41e(0x13f)+_0x7b79f4+'\x22.');await deleteSqlQuery({'id':_0x174e2b[_0x56c41e(0x131)],'sqlCode':_0x7b79f4}),_0x29a872['sqls']=Object[_0x56c41e(0x140)](Object['entries'](_0x29a872[_0x56c41e(0x129)])[_0x56c41e(0x137)](([_0x3493ff])=>_0x3493ff!==_0x7b79f4)),_0x29a872[_0x56c41e(0x141)]=new Date()[_0x56c41e(0x12f)](),await writeSqlLockFile(_0x62d509[_0x56c41e(0x12b)],_0x5d2718);const _0x5393c5=resolveLocalSqlFilePath(_0x62d509,_0x7b79f4,_0x174e2b);let _0x54c03e;await fileExists(_0x5393c5)&&(_0x54c03e=await moveToTrash(_0x62d509['projectRoot'],_0x62d509[_0x56c41e(0x139)],_0x5393c5),await cleanupEmptyDirectories(dirname(_0x5393c5),_0x62d509['sqlRootDir']));const _0x1f48ef={'deleted':_0x7b79f4,'remoteId':_0x174e2b[_0x56c41e(0x131)]};if(_0x54c03e)_0x1f48ef['trashedTo']=_0x54c03e;return{'ok':!![],'data':_0x1f48ef,'message':'Deleted\x20'+_0x7b79f4+(_0x54c03e?_0x56c41e(0x13a):'')};}};async function moveToTrash(_0x3d86c7,_0x3b3fab,_0x360459){const _0x42a5c5=a248_0x2ff981,_0x1fc346=new Date()['toISOString']()[_0x42a5c5(0x134)](/[:.]/g,'-'),_0x55d45b=relative(_0x3d86c7,_0x360459),_0x1536e6=join(_0x3b3fab,_0x1fc346,_0x55d45b);return await mkdir(dirname(_0x1536e6),{'recursive':!![]}),await rename(_0x360459,_0x1536e6),_0x1536e6;}async function cleanupEmptyDirectories(_0x3428cf,_0x34bfbd){const _0x24f571=a248_0x2ff981;let _0x3a0e5a=resolve(_0x3428cf);const _0x1b23f9=resolve(_0x34bfbd);while(_0x3a0e5a['startsWith'](''+_0x1b23f9+sep)||_0x3a0e5a===_0x1b23f9){if(_0x3a0e5a===_0x1b23f9)return;try{const _0x59cac1=await readdir(_0x3a0e5a);if(_0x59cac1[_0x24f571(0x124)]>0x0)return;await rmdir(_0x3a0e5a);}catch{return;}_0x3a0e5a=dirname(_0x3a0e5a);}}
1
+ function a248_0x575f(){const _0x3a4dcb=['projectRoot','fromEntries','331173LONbqq','startsWith','518422vnMCai','6heNhIE','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','toISOString','trashDir','high-risk-write','125762HjeYeH','50SCzMUL','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','sqlRoot','sql','sqlRootDir','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','12446652sRyDPl','lastSync','\x20(local\x20file\x20moved\x20to\x20trash)','SQL\x20lock\x20file\x20not\x20found.','str','sqls','120jyZzvu','11TOBUqn','filter','trashedTo','Would\x20delete\x20SQL\x20','sqlcode','8UqIfkr','validation','lockFilePath','643244nTAmGw','appCode','/smartapi/custom/deleteUserCustomSql','delete','entries','1727173KBjZcY','247566mpDtyP'];a248_0x575f=function(){return _0x3a4dcb;};return a248_0x575f();}const a248_0x4d6263=a248_0x2fbc;(function(_0x39be5d,_0x3040f1){const _0x5327c8=a248_0x2fbc,_0x16665b=_0x39be5d();while(!![]){try{const _0x285e4c=parseInt(_0x5327c8(0x140))/0x1+parseInt(_0x5327c8(0x13a))/0x2*(-parseInt(_0x5327c8(0x13b))/0x3)+-parseInt(_0x5327c8(0x156))/0x4+parseInt(_0x5327c8(0x141))/0x5*(-parseInt(_0x5327c8(0x135))/0x6)+-parseInt(_0x5327c8(0x134))/0x7*(parseInt(_0x5327c8(0x153))/0x8)+parseInt(_0x5327c8(0x138))/0x9*(parseInt(_0x5327c8(0x14d))/0xa)+-parseInt(_0x5327c8(0x14e))/0xb*(-parseInt(_0x5327c8(0x147))/0xc);if(_0x285e4c===_0x3040f1)break;else _0x16665b['push'](_0x16665b['shift']());}catch(_0x4dd7c6){_0x16665b['push'](_0x16665b['shift']());}}}(a248_0x575f,0x40eed));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';function a248_0x2fbc(_0x4680ba,_0x2d9859){_0x4680ba=_0x4680ba-0x133;const _0x575fa4=a248_0x575f();let _0x2fbc44=_0x575fa4[_0x4680ba];return _0x2fbc44;}import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a248_0x4d6263(0x144),'command':'delete','description':'Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','risk':a248_0x4d6263(0x13f),'flags':[SQLCODE_FLAG],async 'validate'(_0x41d0fb){const _0x1aed66=a248_0x4d6263,_0x1d416d=loadSqlProjectConfig(_0x41d0fb[_0x1aed66(0x157)]),_0x1d4b0c=await readSqlLockFile(_0x1d416d['lockFilePath']);if(!_0x1d4b0c)throw CliErrors[_0x1aed66(0x154)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');},async 'dryRun'(_0x570e3b){const _0x2fb836=a248_0x4d6263,_0x59da79=loadSqlProjectConfig(_0x570e3b[_0x2fb836(0x157)]),_0x3b114b=await readSqlLockFile(_0x59da79[_0x2fb836(0x155)]);if(!_0x3b114b)throw CliErrors[_0x2fb836(0x154)](_0x2fb836(0x13c));const {appLock:_0x21a5cb}=ensureSqlLockScope(_0x3b114b,_0x570e3b[_0x2fb836(0x157)],_0x59da79[_0x2fb836(0x143)],'delete'),_0x2a3c62=_0x570e3b[_0x2fb836(0x14b)](_0x2fb836(0x152)),_0x4fbf62=_0x21a5cb[_0x2fb836(0x14c)][_0x2a3c62];if(!_0x4fbf62)throw CliErrors['validation'](_0x2fb836(0x146)+_0x2a3c62+'\x22.');return{'method':'POST','url':_0x2fb836(0x158),'body':{'sqlCode':_0x2a3c62,'id':_0x4fbf62['remoteId'],'localPath':resolveLocalSqlFilePath(_0x59da79,_0x2a3c62,_0x4fbf62)},'description':_0x2fb836(0x151)+_0x2a3c62+_0x2fb836(0x142)+_0x59da79['trashDir']};},async 'execute'(_0x4aefd5){const _0x4ede1d=a248_0x4d6263,_0x1cce52=loadSqlProjectConfig(_0x4aefd5[_0x4ede1d(0x157)]),_0x13683d=await readSqlLockFile(_0x1cce52[_0x4ede1d(0x155)]);if(!_0x13683d)throw CliErrors[_0x4ede1d(0x154)](_0x4ede1d(0x14a));const {lockData:_0x256e10,appLock:_0x50a10b}=ensureSqlLockScope(_0x13683d,_0x4aefd5[_0x4ede1d(0x157)],_0x1cce52[_0x4ede1d(0x143)],_0x4ede1d(0x159)),_0x2a54de=_0x4aefd5['str'](_0x4ede1d(0x152)),_0x597679=_0x50a10b[_0x4ede1d(0x14c)][_0x2a54de];if(!_0x597679)throw CliErrors[_0x4ede1d(0x154)](_0x4ede1d(0x146)+_0x2a54de+'\x22.');await deleteSqlQuery({'id':_0x597679['remoteId'],'sqlCode':_0x2a54de}),_0x50a10b[_0x4ede1d(0x14c)]=Object[_0x4ede1d(0x137)](Object[_0x4ede1d(0x133)](_0x50a10b[_0x4ede1d(0x14c)])[_0x4ede1d(0x14f)](([_0x4920fe])=>_0x4920fe!==_0x2a54de)),_0x50a10b[_0x4ede1d(0x148)]=new Date()[_0x4ede1d(0x13d)](),await writeSqlLockFile(_0x1cce52[_0x4ede1d(0x155)],_0x256e10);const _0x4f941e=resolveLocalSqlFilePath(_0x1cce52,_0x2a54de,_0x597679);let _0xda10a3;await fileExists(_0x4f941e)&&(_0xda10a3=await moveToTrash(_0x1cce52[_0x4ede1d(0x136)],_0x1cce52[_0x4ede1d(0x13e)],_0x4f941e),await cleanupEmptyDirectories(dirname(_0x4f941e),_0x1cce52[_0x4ede1d(0x145)]));const _0x19da80={'deleted':_0x2a54de,'remoteId':_0x597679['remoteId']};if(_0xda10a3)_0x19da80[_0x4ede1d(0x150)]=_0xda10a3;return{'ok':!![],'data':_0x19da80,'message':'Deleted\x20'+_0x2a54de+(_0xda10a3?_0x4ede1d(0x149):'')};}};async function moveToTrash(_0x7f5baa,_0x2de485,_0x4dd305){const _0x46a0a3=a248_0x4d6263,_0x22afbc=new Date()[_0x46a0a3(0x13d)]()['replace'](/[:.]/g,'-'),_0x48e3ae=relative(_0x7f5baa,_0x4dd305),_0x191960=join(_0x2de485,_0x22afbc,_0x48e3ae);return await mkdir(dirname(_0x191960),{'recursive':!![]}),await rename(_0x4dd305,_0x191960),_0x191960;}async function cleanupEmptyDirectories(_0x103ab1,_0x129944){const _0xab5139=a248_0x4d6263;let _0x2d6a46=resolve(_0x103ab1);const _0x1e1006=resolve(_0x129944);while(_0x2d6a46[_0xab5139(0x139)](''+_0x1e1006+sep)||_0x2d6a46===_0x1e1006){if(_0x2d6a46===_0x1e1006)return;try{const _0x50f3bf=await readdir(_0x2d6a46);if(_0x50f3bf['length']>0x0)return;await rmdir(_0x2d6a46);}catch{return;}_0x2d6a46=dirname(_0x2d6a46);}}
@@ -1 +1 @@
1
- const a249_0x1fccb6=a249_0x1e78;(function(_0x538163,_0xacc5c2){const _0x1b25b9=a249_0x1e78,_0x4b196d=_0x538163();while(!![]){try{const _0x230e4e=parseInt(_0x1b25b9(0x1e0))/0x1+-parseInt(_0x1b25b9(0x1d4))/0x2+parseInt(_0x1b25b9(0x1c9))/0x3*(-parseInt(_0x1b25b9(0x1d0))/0x4)+-parseInt(_0x1b25b9(0x1da))/0x5*(-parseInt(_0x1b25b9(0x1cc))/0x6)+-parseInt(_0x1b25b9(0x1dd))/0x7*(-parseInt(_0x1b25b9(0x1db))/0x8)+parseInt(_0x1b25b9(0x1d2))/0x9*(parseInt(_0x1b25b9(0x1d5))/0xa)+-parseInt(_0x1b25b9(0x1cb))/0xb*(parseInt(_0x1b25b9(0x1d3))/0xc);if(_0x230e4e===_0xacc5c2)break;else _0x4b196d['push'](_0x4b196d['shift']());}catch(_0x5183d0){_0x4b196d['push'](_0x4b196d['shift']());}}}(a249_0x283f,0xc2b76));import{getSqlQueryInfo}from'../../core/api-client.js';function a249_0x283f(){const _0x55444c=['dbId','detail','742612BwIlSY','27pThuFJ','Return\x20full\x20raw\x20SQL\x20query\x20object','22QNPLLz','462XClkLh','boolean','verbose','appCode','611692aPiiFh','sql','9XyReXP','5334636Vxdcss','1701874FyFDeK','12746980ALSIPj','str','sqlcode','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','sqlContent','78515GeFhib','8qVklWC','description','4812269lQZOAa'];a249_0x283f=function(){return _0x55444c;};return a249_0x283f();}import{getDbName}from'../../core/db-resolver.js';function a249_0x1e78(_0x1c0be9,_0x5930bd){_0x1c0be9=_0x1c0be9-0x1c9;const _0x283fa9=a249_0x283f();let _0x1e7871=_0x283fa9[_0x1c0be9];return _0x1e7871;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a249_0x1fccb6(0x1d1),'command':a249_0x1fccb6(0x1df),'description':a249_0x1fccb6(0x1d8),'risk':'read','flags':[SQLCODE_FLAG,{'name':a249_0x1fccb6(0x1ce),'type':a249_0x1fccb6(0x1cd),'description':a249_0x1fccb6(0x1ca)}],async 'execute'(_0xa45ae5){const _0x41e01c=a249_0x1fccb6,_0x27b01b=await getSqlQueryInfo(_0xa45ae5[_0x41e01c(0x1cf)],_0xa45ae5[_0x41e01c(0x1d6)](_0x41e01c(0x1d7))),_0x3b79db=_0xa45ae5['bool']('verbose');if(_0x3b79db)return{'ok':!![],'data':_0x27b01b};const _0x23536e=_0x27b01b[_0x41e01c(0x1de)]?await getDbName(_0xa45ae5[_0x41e01c(0x1cf)],_0x27b01b[_0x41e01c(0x1de)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x27b01b['sqlCode'],'sqlName':_0x27b01b['sqlName'],'db':_0x23536e?_0x23536e+'\x20('+_0x27b01b[_0x41e01c(0x1de)]+')':_0x27b01b[_0x41e01c(0x1de)]??'','description':_0x27b01b[_0x41e01c(0x1dc)]??'','sqlContent':_0x27b01b[_0x41e01c(0x1d9)]??''}};}};
1
+ const a249_0x40f535=a249_0x151e;(function(_0xef9b19,_0xb508cc){const _0x3b3dc0=a249_0x151e,_0x106778=_0xef9b19();while(!![]){try{const _0x39c62e=parseInt(_0x3b3dc0(0x1c7))/0x1+-parseInt(_0x3b3dc0(0x1bc))/0x2+-parseInt(_0x3b3dc0(0x1c0))/0x3*(parseInt(_0x3b3dc0(0x1ca))/0x4)+parseInt(_0x3b3dc0(0x1c5))/0x5*(parseInt(_0x3b3dc0(0x1cc))/0x6)+parseInt(_0x3b3dc0(0x1c4))/0x7*(parseInt(_0x3b3dc0(0x1b8))/0x8)+-parseInt(_0x3b3dc0(0x1be))/0x9+parseInt(_0x3b3dc0(0x1bd))/0xa*(parseInt(_0x3b3dc0(0x1c8))/0xb);if(_0x39c62e===_0xb508cc)break;else _0x106778['push'](_0x106778['shift']());}catch(_0x9f3456){_0x106778['push'](_0x106778['shift']());}}}(a249_0x4fea,0xa7e52));import{getSqlQueryInfo}from'../../core/api-client.js';function a249_0x151e(_0x11b6cf,_0x4dc7a6){_0x11b6cf=_0x11b6cf-0x1b6;const _0x4feade=a249_0x4fea();let _0x151e57=_0x4feade[_0x11b6cf];return _0x151e57;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':'sql','command':'detail','description':a249_0x40f535(0x1b9),'risk':a249_0x40f535(0x1bb),'flags':[SQLCODE_FLAG,{'name':'verbose','type':a249_0x40f535(0x1b7),'description':a249_0x40f535(0x1c6)}],async 'execute'(_0x29a69b){const _0x28a32c=a249_0x40f535,_0xf28ee9=await getSqlQueryInfo(_0x29a69b[_0x28a32c(0x1bf)],_0x29a69b[_0x28a32c(0x1c9)](_0x28a32c(0x1c1))),_0x1c6af8=_0x29a69b[_0x28a32c(0x1cb)](_0x28a32c(0x1b6));if(_0x1c6af8)return{'ok':!![],'data':_0xf28ee9};const _0x49e360=_0xf28ee9[_0x28a32c(0x1c2)]?await getDbName(_0x29a69b['appCode'],_0xf28ee9[_0x28a32c(0x1c2)]):undefined;return{'ok':!![],'data':{'sqlCode':_0xf28ee9[_0x28a32c(0x1ba)],'sqlName':_0xf28ee9['sqlName'],'db':_0x49e360?_0x49e360+'\x20('+_0xf28ee9[_0x28a32c(0x1c2)]+')':_0xf28ee9[_0x28a32c(0x1c2)]??'','description':_0xf28ee9[_0x28a32c(0x1c3)]??'','sqlContent':_0xf28ee9['sqlContent']??''}};}};function a249_0x4fea(){const _0x2568b5=['21gPJlKZ','40320BJYwuA','Return\x20full\x20raw\x20SQL\x20query\x20object','516682FUyFtI','8109266QIOqyB','str','3946532vsXTJx','bool','774eKvKmu','verbose','boolean','1681472qzCthI','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','sqlCode','read','2101716kCbgaX','20xuwPUw','8430417HtlFkm','appCode','3FishIX','sqlcode','dbId','description'];a249_0x4fea=function(){return _0x2568b5;};return a249_0x4fea();}