@lovrabet/rabetbase-cli 2.5.12-beta.1 → 2.5.12

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 +1 -1
  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 a242_0x4220a9=a242_0x17d5;(function(_0x44b181,_0x154ce5){const _0x2e6ae5=a242_0x17d5,_0x96f237=_0x44b181();while(!![]){try{const _0x45327f=-parseInt(_0x2e6ae5(0xcd))/0x1+-parseInt(_0x2e6ae5(0xc2))/0x2*(parseInt(_0x2e6ae5(0xd4))/0x3)+parseInt(_0x2e6ae5(0xd2))/0x4*(parseInt(_0x2e6ae5(0xcb))/0x5)+-parseInt(_0x2e6ae5(0xca))/0x6+parseInt(_0x2e6ae5(0xc3))/0x7*(-parseInt(_0x2e6ae5(0xc6))/0x8)+parseInt(_0x2e6ae5(0xcc))/0x9*(-parseInt(_0x2e6ae5(0xd3))/0xa)+-parseInt(_0x2e6ae5(0xc4))/0xb*(-parseInt(_0x2e6ae5(0xd1))/0xc);if(_0x45327f===_0x154ce5)break;else _0x96f237['push'](_0x96f237['shift']());}catch(_0x14d39e){_0x96f237['push'](_0x96f237['shift']());}}}(a242_0x50ea,0xba426));import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';function a242_0x50ea(){const _0x58bcc1=['5LjEOvY','153abAGNN','331307LcReVW','rule','map','List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','40545888sXpPaf','1419344UikhyM','171830cdRrOI','246RKVbxg','appCode','24322Borzvu','7pOVmuv','11kbjwpp','length','9099400TanDYh','cookie','read','Loaded\x20app\x20rule\x20configuration\x20for\x20','1276182dzGukB'];a242_0x50ea=function(){return _0x58bcc1;};return a242_0x50ea();}function a242_0x17d5(_0x54b18e,_0x370b38){_0x54b18e=_0x54b18e-0xc1;const _0x50ea39=a242_0x50ea();let _0x17d54c=_0x50ea39[_0x54b18e];return _0x17d54c;}export const ruleList={'service':a242_0x4220a9(0xce),'command':'list','description':a242_0x4220a9(0xd0),'risk':a242_0x4220a9(0xc8),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x1b59e0){const _0x38bfcb=a242_0x4220a9,_0x2014ef=await Promise['all'](APP_RULE_TYPES['map'](_0x4d8608=>getAppRule(_0x1b59e0[_0x38bfcb(0xc7)],{'appCode':_0x1b59e0[_0x38bfcb(0xc1)],'type':_0x4d8608}))),_0x3077c1=APP_RULE_TYPES[_0x38bfcb(0xcf)]((_0x35f236,_0x3c3400)=>projectAppRule(_0x35f236,_0x2014ef[_0x3c3400]??null));return{'ok':!![],'data':{'total':_0x3077c1[_0x38bfcb(0xc5)],'rules':_0x3077c1},'message':_0x38bfcb(0xc9)+_0x1b59e0[_0x38bfcb(0xc1)]};}};
1
+ const a242_0x2ba4ea=a242_0x18e6;function a242_0x24fa(){const _0x2d49cb=['2DEOsoU','125112CzirXP','2334876aOdOrf','2465460ZRrTkB','map','list','1580910LokZhs','rule','all','length','read','appCode','932251jBztaO','1913232LGlocr','182lOKzbK','Loaded\x20app\x20rule\x20configuration\x20for\x20','2224260iCZlmo'];a242_0x24fa=function(){return _0x2d49cb;};return a242_0x24fa();}(function(_0x42108c,_0x435cd7){const _0x46edb8=a242_0x18e6,_0x5eb383=_0x42108c();while(!![]){try{const _0x5ae0ae=-parseInt(_0x46edb8(0x181))/0x1*(-parseInt(_0x46edb8(0x186))/0x2)+-parseInt(_0x46edb8(0x188))/0x3+parseInt(_0x46edb8(0x189))/0x4+parseInt(_0x46edb8(0x18c))/0x5+parseInt(_0x46edb8(0x182))/0x6+parseInt(_0x46edb8(0x183))/0x7*(-parseInt(_0x46edb8(0x187))/0x8)+-parseInt(_0x46edb8(0x185))/0x9;if(_0x5ae0ae===_0x435cd7)break;else _0x5eb383['push'](_0x5eb383['shift']());}catch(_0x21d0fd){_0x5eb383['push'](_0x5eb383['shift']());}}}(a242_0x24fa,0xb7808));import{getAppRule}from'../../core/api-client.js';function a242_0x18e6(_0x2962fe,_0x14a0d9){_0x2962fe=_0x2962fe-0x181;const _0x24fa1d=a242_0x24fa();let _0x18e673=_0x24fa1d[_0x2962fe];return _0x18e673;}import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';export const ruleList={'service':a242_0x2ba4ea(0x18d),'command':a242_0x2ba4ea(0x18b),'description':'List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','risk':a242_0x2ba4ea(0x190),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x348cca){const _0x1702d0=a242_0x2ba4ea,_0x478a15=await Promise[_0x1702d0(0x18e)](APP_RULE_TYPES['map'](_0x672516=>getAppRule(_0x348cca['cookie'],{'appCode':_0x348cca[_0x1702d0(0x191)],'type':_0x672516}))),_0x50736f=APP_RULE_TYPES[_0x1702d0(0x18a)]((_0x13a2d7,_0x390e0e)=>projectAppRule(_0x13a2d7,_0x478a15[_0x390e0e]??null));return{'ok':!![],'data':{'total':_0x50736f[_0x1702d0(0x18f)],'rules':_0x50736f},'message':_0x1702d0(0x184)+_0x348cca['appCode']};}};
@@ -1 +1 @@
1
- const a243_0x43699c=a243_0x31d7;function a243_0x6c73(){const _0x2ab8ab=['UTF-8\x20Markdown\x20file\x20(RULES:\x202000\x20UTF-16\x20units;\x20DATABASE:\x205242880\x20units)','7814121oXulBG','--file\x20is\x20required.','rules','Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.','set','replacement','create','Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20','trim','write',';\x20current\x20version\x20is\x20','app_rule_version_mismatch','rabetbase\x20rule\x20get\x20--type\x20','cookie','input','file','number','DATABASE','appCode','Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.','isSafeInteger','app_rule_verification_unavailable','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','byteSize','app_rule_verification_failed','Pass\x20a\x20UTF-8\x20Markdown\x20file.','8403616RSFcgX','POST','type','app_rule_content_too_large','\x20--format\x20compress','flag','beforeRecord','expectedVersion','17152MaSirQ','planned','string','contentHash','Use\x20read-only\x20rule\x20reconciliation;\x20do\x20not\x20resubmit\x20automatically.','app_rule_expected_version_invalid','--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','9sAjvvn','13922460CVJUsN','version','cause','str','201910TCPxFT','content','The\x20received\x20rule\x20state\x20contradicts\x20the\x20requested\x20changes.','update','Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','Expected\x20','1dZfkhd','before','\x20could\x20not\x20be\x20verified.','\x20version\x20changed\x20before\x20write.','rule','\x20for\x20','Set\x20','761950lBmdtu','30lAUgwF','expected-version','.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.','RULES','11202768smJswi','Require\x20the\x20current\x20version\x20before\x20atomic\x20compare-and-set'];a243_0x6c73=function(){return _0x2ab8ab;};return a243_0x6c73();}(function(_0x5a0856,_0x3624e9){const _0x548c6f=a243_0x31d7,_0x4259f2=_0x5a0856();while(!![]){try{const _0x1716aa=-parseInt(_0x548c6f(0xd1))/0x1*(-parseInt(_0x548c6f(0xd8))/0x2)+-parseInt(_0x548c6f(0xc6))/0x3*(-parseInt(_0x548c6f(0xbf))/0x4)+parseInt(_0x548c6f(0xcb))/0x5*(-parseInt(_0x548c6f(0xd9))/0x6)+-parseInt(_0x548c6f(0xe0))/0x7+-parseInt(_0x548c6f(0xb7))/0x8+parseInt(_0x548c6f(0xdd))/0x9+parseInt(_0x548c6f(0xc7))/0xa;if(_0x1716aa===_0x3624e9)break;else _0x4259f2['push'](_0x4259f2['shift']());}catch(_0x4ce68d){_0x4259f2['push'](_0x4259f2['shift']());}}}(a243_0x6c73,0xa1a9c));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(_0x451ea3){const _0x5c0450=a243_0x31d7,_0x1c0a38=readAppRuleType(_0x451ea3),_0xf3a79a=_0x451ea3[_0x5c0450(0xca)](_0x5c0450(0xac))[_0x5c0450(0xe8)]();if(!_0xf3a79a)throw appRuleError('app_rule_file_required',_0x5c0450(0xe1),_0x5c0450(0xb6));const _0x13bda0=_0x451ea3[_0x5c0450(0xbc)]('expected-version');let _0x2a48e1;if(_0x13bda0!==undefined){_0x2a48e1=Number(_0x13bda0);if(!Number[_0x5c0450(0xb1)](_0x2a48e1)||_0x2a48e1<0x0)throw appRuleError(_0x5c0450(0xc4),_0x5c0450(0xc5));}return{'type':_0x1c0a38,'file':_0xf3a79a,'expectedVersion':_0x2a48e1};}async function prepareSet(_0x13e443){const _0x2b3e5b=a243_0x31d7,_0x3ce70f=readSetInput(_0x13e443),_0x291a47=await readAppRuleFile(_0x3ce70f['file']);if(_0x3ce70f['type']===_0x2b3e5b(0xe2)&&_0x291a47[_0x2b3e5b(0xcc)]['length']>0x7d0)throw appRuleError(_0x2b3e5b(0xba),'RULES\x20content\x20exceeds\x202000\x20UTF-16\x20units.');const _0x4f5582=await getAppRule(_0x13e443[_0x2b3e5b(0xed)],{'appCode':_0x13e443[_0x2b3e5b(0xaf)],'type':_0x3ce70f[_0x2b3e5b(0xb9)]});if(_0x3ce70f[_0x2b3e5b(0xbe)]!==undefined&&(_0x4f5582?.['version']??0x0)!==_0x3ce70f[_0x2b3e5b(0xbe)])throw appRuleError(_0x2b3e5b(0xeb),appRuleFileName(_0x3ce70f[_0x2b3e5b(0xb9)])+_0x2b3e5b(0xd4),_0x2b3e5b(0xd0)+_0x3ce70f[_0x2b3e5b(0xbe)]+_0x2b3e5b(0xea)+(_0x4f5582?.[_0x2b3e5b(0xc8)]??'unconfigured')+_0x2b3e5b(0xdb));return{'input':_0x3ce70f,'replacement':_0x291a47,'beforeRecord':_0x4f5582,'before':projectAppRule(_0x3ce70f['type'],_0x4f5582),'planned':{'type':_0x3ce70f[_0x2b3e5b(0xb9)],'fileName':appRuleFileName(_0x3ce70f[_0x2b3e5b(0xb9)]),'contextScope':appRuleContextScope(_0x3ce70f[_0x2b3e5b(0xb9)]),'enabled':!![],'appCode':_0x13e443[_0x2b3e5b(0xaf)],'scope':_0x2b3e5b(0xe2),'contentByteSize':_0x291a47[_0x2b3e5b(0xb4)],'contentHash':_0x291a47[_0x2b3e5b(0xc2)]}};}function a243_0x31d7(_0x78a9e6,_0x54a6d0){_0x78a9e6=_0x78a9e6-0xab;const _0x6c734a=a243_0x6c73();let _0x31d7c9=_0x6c734a[_0x78a9e6];return _0x31d7c9;}function warningsFor(_0x3f2ecc){return[];}export const ruleSet={'service':a243_0x43699c(0xd5),'command':'set','description':a243_0x43699c(0xcf),'risk':a243_0x43699c(0xe9),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':a243_0x43699c(0xac),'type':a243_0x43699c(0xc1),'required':!![],'description':a243_0x43699c(0xdf)},{'name':a243_0x43699c(0xda),'type':a243_0x43699c(0xad),'required':![],'description':a243_0x43699c(0xde)}],async 'validate'(_0x5dd5e7){readSetInput(_0x5dd5e7);},async 'dryRun'(_0x2b795c){const _0x49fee3=a243_0x43699c,_0x13899b=await prepareSet(_0x2b795c);return asDryRunResult({'operation':_0x49fee3(0xe4),'selector':{'appCode':_0x2b795c[_0x49fee3(0xaf)],'scope':'rules','type':_0x13899b[_0x49fee3(0xab)][_0x49fee3(0xb9)]},'before':_0x13899b[_0x49fee3(0xd2)],'after':_0x13899b[_0x49fee3(0xc0)],'dryRun':!![],'backend':{'method':_0x49fee3(0xb8),'path':knowledgeDocumentsPath(_0x49fee3(0xe2),_0x13899b[_0x49fee3(0xbd)]?'update':'create'),'body':{'appCode':_0x2b795c['appCode'],..._0x13899b[_0x49fee3(0xbd)]?{'id':_0x13899b[_0x49fee3(0xbd)]['id']}:{},'title':_0x13899b['input'][_0x49fee3(0xb9)]==='rules'?_0x49fee3(0xdc):_0x49fee3(0xae),'contentHash':_0x13899b['replacement'][_0x49fee3(0xc2)],'contentByteSize':_0x13899b[_0x49fee3(0xe5)][_0x49fee3(0xb4)],..._0x13899b['beforeRecord']?{'expectedVersion':_0x13899b[_0x49fee3(0xbd)][_0x49fee3(0xc8)]}:{}}},'warnings':warningsFor(_0x13899b['input'][_0x49fee3(0xbe)]),'verification':{'expectedVersion':_0x13899b[_0x49fee3(0xbd)]?.[_0x49fee3(0xc8)]??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x49fee3(0xec)+_0x13899b[_0x49fee3(0xab)][_0x49fee3(0xb9)]+_0x49fee3(0xbb)}},{'method':_0x49fee3(0xb8),'url':knowledgeDocumentsPath(_0x49fee3(0xe2),_0x13899b[_0x49fee3(0xbd)]?'update':_0x49fee3(0xe6))});},async 'execute'(_0x3c6283){const _0x483d03=a243_0x43699c,_0x189e00=await prepareSet(_0x3c6283),_0x57acc2=_0x189e00['beforeRecord']===null?0x1:_0x189e00[_0x483d03(0xbd)][_0x483d03(0xc8)]+(_0x189e00[_0x483d03(0xbd)][_0x483d03(0xcc)]===_0x189e00['replacement'][_0x483d03(0xcc)]?0x0:0x1);let _0x5c8dcb,_0x32ec7e=![];try{_0x5c8dcb=await saveAppRule(_0x3c6283[_0x483d03(0xed)],{'appCode':_0x3c6283[_0x483d03(0xaf)],'type':_0x189e00['input'][_0x483d03(0xb9)],'content':_0x189e00[_0x483d03(0xe5)][_0x483d03(0xcc)],'expectedVersion':_0x189e00['beforeRecord']?.[_0x483d03(0xc8)]??0x0,..._0x189e00[_0x483d03(0xbd)]?{'id':_0x189e00[_0x483d03(0xbd)]['id']}:{}});if(_0x5c8dcb['version']!==_0x57acc2||_0x5c8dcb[_0x483d03(0xcc)]!==_0x189e00['replacement'][_0x483d03(0xcc)]||_0x189e00[_0x483d03(0xbd)]!==null&&_0x5c8dcb['id']!==_0x189e00['beforeRecord']['id'])throw appRuleError(_0x483d03(0xb5),_0x483d03(0xcd),_0x483d03(0xc3));}catch(_0x307cf7){if(!isPlatformTransportFailure(_0x307cf7))throw _0x307cf7;_0x32ec7e=!![];}let _0x375204;try{_0x375204=await getAppRule(_0x3c6283[_0x483d03(0xed)],{'appCode':_0x3c6283[_0x483d03(0xaf)],'type':_0x189e00[_0x483d03(0xab)][_0x483d03(0xb9)]});}catch(_0xc54f8e){const _0x2e78d4=appRuleError(_0x32ec7e?'app_rule_set_outcome_unknown':_0x483d03(0xb2),'The\x20set\x20request\x20was\x20sent,\x20but\x20'+appRuleFileName(_0x189e00[_0x483d03(0xab)]['type'])+_0x483d03(0xd3),_0x483d03(0xe3));Object['defineProperty'](_0x2e78d4,_0x483d03(0xc9),{'value':_0xc54f8e,'enumerable':![]});throw _0x2e78d4;}const _0x577f63=_0x375204&&inspectAppRuleContent(_0x375204[_0x483d03(0xcc)])[_0x483d03(0xc2)]===_0x189e00[_0x483d03(0xe5)]['contentHash'],_0x8b7012=_0x375204&&_0x375204[_0x483d03(0xc8)]===_0x57acc2&&(!_0x5c8dcb||_0x375204['id']===_0x5c8dcb['id']&&_0x375204['version']===_0x5c8dcb[_0x483d03(0xc8)]);if(!_0x375204||!_0x577f63||!_0x8b7012||_0x189e00[_0x483d03(0xbd)]!==null&&_0x375204['id']!==_0x189e00[_0x483d03(0xbd)]['id'])throw appRuleError(_0x32ec7e?'app_rule_set_outcome_unknown':_0x483d03(0xb5),appRuleFileName(_0x189e00[_0x483d03(0xab)][_0x483d03(0xb9)])+'\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.',_0x483d03(0xe7)+_0x189e00[_0x483d03(0xab)][_0x483d03(0xb9)]+_0x483d03(0xb3));const _0x1010a6=warningsFor(_0x189e00[_0x483d03(0xab)][_0x483d03(0xbe)]);_0x32ec7e&&_0x1010a6['push'](_0x483d03(0xb0));const _0x2a3473=projectAppRule(_0x189e00[_0x483d03(0xab)][_0x483d03(0xb9)],_0x375204);return{'ok':!![],'data':{'operation':_0x483d03(0xe4),'selector':{'appCode':_0x3c6283[_0x483d03(0xaf)],'scope':'rules','type':_0x189e00[_0x483d03(0xab)][_0x483d03(0xb9)]},'before':_0x189e00[_0x483d03(0xd2)],'after':_0x2a3473,'dryRun':![],'backend':{'method':_0x483d03(0xb8),'path':knowledgeDocumentsPath('rules',_0x189e00['beforeRecord']?_0x483d03(0xce):_0x483d03(0xe6))},'warnings':_0x1010a6,'verification':{'status':'verified','recoveredAfterUnknownResponse':_0x32ec7e,'expectedVersion':_0x189e00[_0x483d03(0xbd)]?.[_0x483d03(0xc8)]??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x483d03(0xec)+_0x189e00[_0x483d03(0xab)][_0x483d03(0xb9)]+_0x483d03(0xbb)}},'message':_0x483d03(0xd7)+appRuleFileName(_0x189e00[_0x483d03(0xab)][_0x483d03(0xb9)])+_0x483d03(0xd6)+_0x3c6283[_0x483d03(0xaf)]};}};
1
+ const a243_0x106366=a243_0x4652;function a243_0x13bb(){const _0x33eaa4=['424450WlewAb','DATABASE','1531392ZDFklG','Set\x20','isSafeInteger','\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','appCode','Pass\x20a\x20UTF-8\x20Markdown\x20file.','set','version','update','270HhcEXP','create','rules','expectedVersion','--file\x20is\x20required.','app_rule_version_mismatch','cookie','input','297493ZGKXmN','app_rule_expected_version_invalid','content','planned','\x20for\x20','rule','trim','144YJFNXl','unconfigured','RULES\x20content\x20exceeds\x202000\x20UTF-16\x20units.','164175biTZOG',';\x20current\x20version\x20is\x20','defineProperty','751293eWROHR','The\x20set\x20request\x20was\x20sent,\x20but\x20','before','file','2984448YHbeIa','app_rule_verification_unavailable','UTF-8\x20Markdown\x20file\x20(RULES:\x202000\x20UTF-16\x20units;\x20DATABASE:\x205242880\x20units)','str','number','\x20--format\x20compress','Expected\x20','app_rule_set_outcome_unknown','replacement','--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','contentHash','cause','length','5dZJnpt','beforeRecord','POST','\x20could\x20not\x20be\x20verified.','write','rabetbase\x20rule\x20get\x20--type\x20','expected-version','push','type','verified','1437024AGERYO'];a243_0x13bb=function(){return _0x33eaa4;};return a243_0x13bb();}(function(_0x1f2a83,_0x4eae5b){const _0x3cd4c1=a243_0x4652,_0x260f7b=_0x1f2a83();while(!![]){try{const _0x2bc982=-parseInt(_0x3cd4c1(0xfd))/0x1+-parseInt(_0x3cd4c1(0xc3))/0x2+parseInt(_0x3cd4c1(0xde))/0x3+parseInt(_0x3cd4c1(0xe5))/0x4+parseInt(_0x3cd4c1(0xf2))/0x5*(-parseInt(_0x3cd4c1(0xfc))/0x6)+parseInt(_0x3cd4c1(0xd4))/0x7*(-parseInt(_0x3cd4c1(0xdb))/0x8)+-parseInt(_0x3cd4c1(0xe1))/0x9*(-parseInt(_0x3cd4c1(0xcc))/0xa);if(_0x2bc982===_0x4eae5b)break;else _0x260f7b['push'](_0x260f7b['shift']());}catch(_0x4ca133){_0x260f7b['push'](_0x260f7b['shift']());}}}(a243_0x13bb,0xd1fb4));import{knowledgeDocumentsPath}from'../../core/api-client.js';import{getAppRule,isPlatformTransportFailure,saveAppRule}from'../../core/api-client.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a243_0x4652(_0x43982c,_0x1f006a){_0x43982c=_0x43982c-0xc3;const _0x13bbbd=a243_0x13bb();let _0x4652cd=_0x13bbbd[_0x43982c];return _0x4652cd;}import{APP_RULE_TYPE_FLAG,appRuleContextScope,appRuleError,appRuleFileName,inspectAppRuleContent,projectAppRule,readAppRuleFile,readAppRuleType}from'../../commands/rule/shared.js';function readSetInput(_0xc1fe2a){const _0x4e7e8a=a243_0x4652,_0x280ce6=readAppRuleType(_0xc1fe2a),_0x2a7cc2=_0xc1fe2a[_0x4e7e8a(0xe8)](_0x4e7e8a(0xe4))[_0x4e7e8a(0xda)]();if(!_0x2a7cc2)throw appRuleError('app_rule_file_required',_0x4e7e8a(0xd0),_0x4e7e8a(0xc8));const _0x516761=_0xc1fe2a['flag'](_0x4e7e8a(0xf8));let _0x49566d;if(_0x516761!==undefined){_0x49566d=Number(_0x516761);if(!Number[_0x4e7e8a(0xc5)](_0x49566d)||_0x49566d<0x0)throw appRuleError(_0x4e7e8a(0xd5),_0x4e7e8a(0xee));}return{'type':_0x280ce6,'file':_0x2a7cc2,'expectedVersion':_0x49566d};}async function prepareSet(_0x3b03d0){const _0x20070c=a243_0x4652,_0x4caa9d=readSetInput(_0x3b03d0),_0x2cb035=await readAppRuleFile(_0x4caa9d['file']);if(_0x4caa9d[_0x20070c(0xfa)]==='rules'&&_0x2cb035['content'][_0x20070c(0xf1)]>0x7d0)throw appRuleError('app_rule_content_too_large',_0x20070c(0xdd));const _0x1ab456=await getAppRule(_0x3b03d0['cookie'],{'appCode':_0x3b03d0['appCode'],'type':_0x4caa9d[_0x20070c(0xfa)]});if(_0x4caa9d[_0x20070c(0xcf)]!==undefined&&(_0x1ab456?.[_0x20070c(0xca)]??0x0)!==_0x4caa9d['expectedVersion'])throw appRuleError(_0x20070c(0xd1),appRuleFileName(_0x4caa9d[_0x20070c(0xfa)])+'\x20version\x20changed\x20before\x20write.',_0x20070c(0xeb)+_0x4caa9d[_0x20070c(0xcf)]+_0x20070c(0xdf)+(_0x1ab456?.[_0x20070c(0xca)]??_0x20070c(0xdc))+'.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.');return{'input':_0x4caa9d,'replacement':_0x2cb035,'beforeRecord':_0x1ab456,'before':projectAppRule(_0x4caa9d[_0x20070c(0xfa)],_0x1ab456),'planned':{'type':_0x4caa9d[_0x20070c(0xfa)],'fileName':appRuleFileName(_0x4caa9d['type']),'contextScope':appRuleContextScope(_0x4caa9d[_0x20070c(0xfa)]),'enabled':!![],'appCode':_0x3b03d0['appCode'],'scope':_0x20070c(0xce),'contentByteSize':_0x2cb035['byteSize'],'contentHash':_0x2cb035['contentHash']}};}function warningsFor(_0x250eda){return[];}export const ruleSet={'service':a243_0x106366(0xd9),'command':a243_0x106366(0xc9),'description':'Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','risk':a243_0x106366(0xf6),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':'file','type':'string','required':!![],'description':a243_0x106366(0xe7)},{'name':'expected-version','type':a243_0x106366(0xe9),'required':![],'description':'Require\x20the\x20current\x20version\x20before\x20atomic\x20compare-and-set'}],async 'validate'(_0x4a147d){readSetInput(_0x4a147d);},async 'dryRun'(_0x1357a1){const _0x1480f3=a243_0x106366,_0xa18528=await prepareSet(_0x1357a1);return asDryRunResult({'operation':_0x1480f3(0xc9),'selector':{'appCode':_0x1357a1[_0x1480f3(0xc7)],'scope':_0x1480f3(0xce),'type':_0xa18528[_0x1480f3(0xd3)][_0x1480f3(0xfa)]},'before':_0xa18528[_0x1480f3(0xe3)],'after':_0xa18528[_0x1480f3(0xd7)],'dryRun':!![],'backend':{'method':'POST','path':knowledgeDocumentsPath(_0x1480f3(0xce),_0xa18528['beforeRecord']?_0x1480f3(0xcb):_0x1480f3(0xcd)),'body':{'appCode':_0x1357a1[_0x1480f3(0xc7)],..._0xa18528[_0x1480f3(0xf3)]?{'id':_0xa18528['beforeRecord']['id']}:{},'title':_0xa18528[_0x1480f3(0xd3)]['type']===_0x1480f3(0xce)?'RULES':_0x1480f3(0xfe),'contentHash':_0xa18528[_0x1480f3(0xed)][_0x1480f3(0xef)],'contentByteSize':_0xa18528[_0x1480f3(0xed)]['byteSize'],..._0xa18528[_0x1480f3(0xf3)]?{'expectedVersion':_0xa18528['beforeRecord'][_0x1480f3(0xca)]}:{}}},'warnings':warningsFor(_0xa18528[_0x1480f3(0xd3)][_0x1480f3(0xcf)]),'verification':{'expectedVersion':_0xa18528[_0x1480f3(0xf3)]?.[_0x1480f3(0xca)]??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x1480f3(0xf7)+_0xa18528['input']['type']+_0x1480f3(0xea)}},{'method':_0x1480f3(0xf4),'url':knowledgeDocumentsPath('rules',_0xa18528[_0x1480f3(0xf3)]?_0x1480f3(0xcb):_0x1480f3(0xcd))});},async 'execute'(_0x344cbd){const _0x2bcbd6=a243_0x106366,_0x51381c=await prepareSet(_0x344cbd),_0x78d873=_0x51381c['beforeRecord']===null?0x1:_0x51381c['beforeRecord'][_0x2bcbd6(0xca)]+(_0x51381c[_0x2bcbd6(0xf3)]['content']===_0x51381c['replacement'][_0x2bcbd6(0xd6)]?0x0:0x1);let _0x1e543f,_0x127573=![];try{_0x1e543f=await saveAppRule(_0x344cbd['cookie'],{'appCode':_0x344cbd[_0x2bcbd6(0xc7)],'type':_0x51381c[_0x2bcbd6(0xd3)][_0x2bcbd6(0xfa)],'content':_0x51381c[_0x2bcbd6(0xed)][_0x2bcbd6(0xd6)],'expectedVersion':_0x51381c[_0x2bcbd6(0xf3)]?.[_0x2bcbd6(0xca)]??0x0,..._0x51381c[_0x2bcbd6(0xf3)]?{'id':_0x51381c[_0x2bcbd6(0xf3)]['id']}:{}});if(_0x1e543f[_0x2bcbd6(0xca)]!==_0x78d873||_0x1e543f['content']!==_0x51381c[_0x2bcbd6(0xed)][_0x2bcbd6(0xd6)]||_0x51381c[_0x2bcbd6(0xf3)]!==null&&_0x1e543f['id']!==_0x51381c[_0x2bcbd6(0xf3)]['id'])throw appRuleError('app_rule_verification_failed','The\x20received\x20rule\x20state\x20contradicts\x20the\x20requested\x20changes.','Use\x20read-only\x20rule\x20reconciliation;\x20do\x20not\x20resubmit\x20automatically.');}catch(_0x4055db){if(!isPlatformTransportFailure(_0x4055db))throw _0x4055db;_0x127573=!![];}let _0x5ab953;try{_0x5ab953=await getAppRule(_0x344cbd[_0x2bcbd6(0xd2)],{'appCode':_0x344cbd[_0x2bcbd6(0xc7)],'type':_0x51381c[_0x2bcbd6(0xd3)]['type']});}catch(_0x4420d4){const _0x314ec0=appRuleError(_0x127573?_0x2bcbd6(0xec):_0x2bcbd6(0xe6),_0x2bcbd6(0xe2)+appRuleFileName(_0x51381c[_0x2bcbd6(0xd3)][_0x2bcbd6(0xfa)])+_0x2bcbd6(0xf5),'Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.');Object[_0x2bcbd6(0xe0)](_0x314ec0,_0x2bcbd6(0xf0),{'value':_0x4420d4,'enumerable':![]});throw _0x314ec0;}const _0x2938e7=_0x5ab953&&inspectAppRuleContent(_0x5ab953['content'])[_0x2bcbd6(0xef)]===_0x51381c[_0x2bcbd6(0xed)][_0x2bcbd6(0xef)],_0x52547e=_0x5ab953&&_0x5ab953['version']===_0x78d873&&(!_0x1e543f||_0x5ab953['id']===_0x1e543f['id']&&_0x5ab953[_0x2bcbd6(0xca)]===_0x1e543f[_0x2bcbd6(0xca)]);if(!_0x5ab953||!_0x2938e7||!_0x52547e||_0x51381c[_0x2bcbd6(0xf3)]!==null&&_0x5ab953['id']!==_0x51381c['beforeRecord']['id'])throw appRuleError(_0x127573?_0x2bcbd6(0xec):'app_rule_verification_failed',appRuleFileName(_0x51381c[_0x2bcbd6(0xd3)][_0x2bcbd6(0xfa)])+_0x2bcbd6(0xc6),'Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20'+_0x51381c[_0x2bcbd6(0xd3)][_0x2bcbd6(0xfa)]+'\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.');const _0x367b81=warningsFor(_0x51381c[_0x2bcbd6(0xd3)]['expectedVersion']);_0x127573&&_0x367b81[_0x2bcbd6(0xf9)]('Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.');const _0x4b3f30=projectAppRule(_0x51381c[_0x2bcbd6(0xd3)][_0x2bcbd6(0xfa)],_0x5ab953);return{'ok':!![],'data':{'operation':_0x2bcbd6(0xc9),'selector':{'appCode':_0x344cbd[_0x2bcbd6(0xc7)],'scope':_0x2bcbd6(0xce),'type':_0x51381c[_0x2bcbd6(0xd3)][_0x2bcbd6(0xfa)]},'before':_0x51381c['before'],'after':_0x4b3f30,'dryRun':![],'backend':{'method':_0x2bcbd6(0xf4),'path':knowledgeDocumentsPath(_0x2bcbd6(0xce),_0x51381c['beforeRecord']?_0x2bcbd6(0xcb):_0x2bcbd6(0xcd))},'warnings':_0x367b81,'verification':{'status':_0x2bcbd6(0xfb),'recoveredAfterUnknownResponse':_0x127573,'expectedVersion':_0x51381c['beforeRecord']?.[_0x2bcbd6(0xca)]??0x0,'atomicCompareAndSet':!![],'lookupCommand':_0x2bcbd6(0xf7)+_0x51381c[_0x2bcbd6(0xd3)][_0x2bcbd6(0xfa)]+_0x2bcbd6(0xea)}},'message':_0x2bcbd6(0xc4)+appRuleFileName(_0x51381c[_0x2bcbd6(0xd3)]['type'])+_0x2bcbd6(0xd8)+_0x344cbd['appCode']};}};
@@ -1 +1 @@
1
- const a244_0x1b33da=a244_0x4269;(function(_0x49d7c9,_0x545e81){const _0x4fdebe=a244_0x4269,_0x4955ed=_0x49d7c9();while(!![]){try{const _0x374809=-parseInt(_0x4fdebe(0xa1))/0x1+-parseInt(_0x4fdebe(0xb2))/0x2+-parseInt(_0x4fdebe(0xbf))/0x3*(parseInt(_0x4fdebe(0xad))/0x4)+parseInt(_0x4fdebe(0x92))/0x5*(parseInt(_0x4fdebe(0x8f))/0x6)+parseInt(_0x4fdebe(0xa4))/0x7+parseInt(_0x4fdebe(0xbe))/0x8+parseInt(_0x4fdebe(0xb4))/0x9*(-parseInt(_0x4fdebe(0xac))/0xa);if(_0x374809===_0x545e81)break;else _0x4955ed['push'](_0x4955ed['shift']());}catch(_0xb3ef45){_0x4955ed['push'](_0x4955ed['shift']());}}}(a244_0x27db,0xd4f67));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_0x1b33da(0x94),a244_0x1b33da(0x99)];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':'RULES.md','database':a244_0x1b33da(0xa8)},APP_RULE_CONTEXT_SCOPES={'rules':a244_0x1b33da(0xb8),'database':a244_0x1b33da(0x98)};export function appRuleError(_0x13fd39,_0x421c21,_0x193bcc){return new CliError(_0x13fd39,0x1,_0x421c21,_0x193bcc);}export function readAppRuleType(_0x46ab44){const _0x3caabf=a244_0x1b33da,_0x1b0e6d=_0x46ab44[_0x3caabf(0xaa)](_0x3caabf(0x91))[_0x3caabf(0x90)]()[_0x3caabf(0xb7)]();if(_0x1b0e6d!=='rules'&&_0x1b0e6d!==_0x3caabf(0x99))throw appRuleError(_0x3caabf(0x96),_0x3caabf(0xb5));return _0x1b0e6d;}export function appRuleFileName(_0x520c1c){return APP_RULE_FILES[_0x520c1c];}export function appRuleContextScope(_0x95e0c8){return APP_RULE_CONTEXT_SCOPES[_0x95e0c8];}export function inspectAppRuleContent(_0x121295){const _0x427623=a244_0x1b33da,_0x1957d3=Buffer['from'](_0x121295,_0x427623(0xa3));return{'content':_0x121295,'byteSize':_0x1957d3['byteLength'],'contentHash':_0x427623(0x9c)+createHash(_0x427623(0x97))['update'](_0x1957d3)['digest'](_0x427623(0xa6))};}export async function readAppRuleFile(_0x4f6967){const _0x44110e=a244_0x1b33da,_0x598d6c=_0x4f6967[_0x44110e(0x90)]();if(!_0x598d6c)throw appRuleError(_0x44110e(0x9d),_0x44110e(0x9e),_0x44110e(0xaf));const _0x34a0c1=resolve(_0x598d6c);let _0x2457d3;try{_0x2457d3=await stat(_0x34a0c1);}catch(_0x1bea0b){throw appRuleError(_0x44110e(0xa2),'Cannot\x20access\x20app\x20rule\x20file:\x20'+_0x598d6c,_0x1bea0b instanceof Error?_0x1bea0b[_0x44110e(0x93)]:String(_0x1bea0b));}if(!_0x2457d3[_0x44110e(0xa5)]())throw appRuleError(_0x44110e(0xae),_0x44110e(0xc0)+_0x598d6c);if(_0x2457d3['size']>MAX_APP_RULE_BYTES)throw appRuleError(_0x44110e(0xb1),'App\x20rule\x20content\x20exceeds\x20the\x20bounded\x20UTF-8\x20file\x20limit.');let _0x1779c9;try{_0x1779c9=await readFile(_0x34a0c1);}catch(_0x84bb38){throw appRuleError(_0x44110e(0xa2),_0x44110e(0xba)+_0x598d6c,_0x84bb38 instanceof Error?_0x84bb38[_0x44110e(0x93)]:String(_0x84bb38));}if(_0x1779c9[_0x44110e(0x9b)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x44110e(0xb1),_0x44110e(0xa7));let _0x1a9182;try{_0x1a9182=new TextDecoder(_0x44110e(0xb9),{'fatal':!![],'ignoreBOM':!![]})['decode'](_0x1779c9);}catch{throw appRuleError(_0x44110e(0x9a),_0x44110e(0xb0)+_0x598d6c);}if(_0x1a9182[_0x44110e(0xb6)]>MAX_APP_RULE_UNITS)throw appRuleError(_0x44110e(0xb1),_0x44110e(0x9f));if(!_0x1a9182[_0x44110e(0x90)]())throw appRuleError(_0x44110e(0x9a),'App\x20rule\x20file\x20is\x20blank:\x20'+_0x598d6c);return inspectAppRuleContent(_0x1a9182);}function a244_0x27db(){const _0x508d09=['isFile','hex','App\x20rule\x20content\x20exceeds\x20the\x20bounded\x20UTF-8\x20file\x20limit.','DATABASE.md','updateTime','str','version','10otRZUR','224288yYkASU','app_rule_file_invalid','Pass\x20a\x20UTF-8\x20Markdown\x20file.','App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','app_rule_content_too_large','795932SwyKNl','contentHash','5713911aEkqji','--type\x20must\x20be\x20either\x20rules\x20or\x20database.','length','toLowerCase','page-api-development','utf-8','Cannot\x20read\x20app\x20rule\x20file:\x20','content','createTime','Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','4478760VdvboC','21yZCyaS','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','2759112ghTQTl','trim','type','10fchNxL','message','rules','scope','app_rule_type_invalid','sha256','database-analysis','database','app_rule_content_invalid','byteLength','sha256:','app_rule_file_required','--file\x20is\x20required.','App\x20rule\x20content\x20exceeds\x205242880\x20UTF-16\x20units.','indexStatus','759783denSAC','app_rule_file_unreadable','utf8','11045146NDrNTR'];a244_0x27db=function(){return _0x508d09;};return a244_0x27db();}function a244_0x4269(_0x7d494d,_0x2b24e){_0x7d494d=_0x7d494d-0x8f;const _0x27db67=a244_0x27db();let _0x42692e=_0x27db67[_0x7d494d];return _0x42692e;}export function projectAppRule(_0x598931,_0x440ff4){const _0x15c2ee=a244_0x1b33da;if(!_0x440ff4)return{'type':_0x598931,'fileName':appRuleFileName(_0x598931),'contextScope':appRuleContextScope(_0x598931),'enabled':![]};const _0x317562=inspectAppRuleContent(_0x440ff4[_0x15c2ee(0xbb)]);return{'type':_0x598931,'fileName':appRuleFileName(_0x598931),'contextScope':appRuleContextScope(_0x598931),'enabled':!![],'id':_0x440ff4['id'],'scope':_0x440ff4[_0x15c2ee(0x95)],'appCode':_0x440ff4['appCode'],'version':_0x440ff4[_0x15c2ee(0xab)],..._0x440ff4[_0x15c2ee(0xa0)]!==undefined?{'indexStatus':_0x440ff4['indexStatus']}:{},'contentByteSize':_0x317562['byteSize'],'contentHash':_0x317562[_0x15c2ee(0xb3)],..._0x440ff4[_0x15c2ee(0xbc)]!==undefined&&_0x440ff4['createTime']!==null?{'createTime':_0x440ff4['createTime']}:{},..._0x440ff4[_0x15c2ee(0xa9)]!==undefined&&_0x440ff4[_0x15c2ee(0xa9)]!==null?{'updateTime':_0x440ff4[_0x15c2ee(0xa9)]}:{}};}export const APP_RULE_TYPE_FLAG={'name':a244_0x1b33da(0x91),'type':'string','required':!![],'description':a244_0x1b33da(0xbd),'enum':[...APP_RULE_TYPES]};
1
+ function a244_0x5b84(_0x1c6a37,_0x2c8301){_0x1c6a37=_0x1c6a37-0x172;const _0x88026=a244_0x8802();let _0x5b84a8=_0x88026[_0x1c6a37];return _0x5b84a8;}const a244_0x1b57f6=a244_0x5b84;(function(_0x33c0ab,_0x2e0197){const _0x139313=a244_0x5b84,_0x2d4f66=_0x33c0ab();while(!![]){try{const _0x19ce0d=parseInt(_0x139313(0x173))/0x1*(parseInt(_0x139313(0x199))/0x2)+parseInt(_0x139313(0x1a4))/0x3+-parseInt(_0x139313(0x19d))/0x4*(-parseInt(_0x139313(0x1a2))/0x5)+-parseInt(_0x139313(0x196))/0x6+-parseInt(_0x139313(0x17e))/0x7+-parseInt(_0x139313(0x185))/0x8*(parseInt(_0x139313(0x17d))/0x9)+-parseInt(_0x139313(0x191))/0xa;if(_0x19ce0d===_0x2e0197)break;else _0x2d4f66['push'](_0x2d4f66['shift']());}catch(_0x4155ff){_0x2d4f66['push'](_0x2d4f66['shift']());}}}(a244_0x8802,0x1ae2a));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_0x1b57f6(0x19c),a244_0x1b57f6(0x176)];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_0x1b57f6(0x198),'database':a244_0x1b57f6(0x18d)},APP_RULE_CONTEXT_SCOPES={'rules':a244_0x1b57f6(0x195),'database':a244_0x1b57f6(0x17b)};export function appRuleError(_0x282cbb,_0x259735,_0x50e41a){return new CliError(_0x282cbb,0x1,_0x259735,_0x50e41a);}export function readAppRuleType(_0x53ced8){const _0x1a21ed=a244_0x1b57f6,_0x5dc8d7=_0x53ced8['str'](_0x1a21ed(0x1a0))[_0x1a21ed(0x193)]()[_0x1a21ed(0x19b)]();if(_0x5dc8d7!==_0x1a21ed(0x19c)&&_0x5dc8d7!==_0x1a21ed(0x176))throw appRuleError(_0x1a21ed(0x172),_0x1a21ed(0x1a7));return _0x5dc8d7;}export function appRuleFileName(_0x578ab6){return APP_RULE_FILES[_0x578ab6];}export function appRuleContextScope(_0x5a0730){return APP_RULE_CONTEXT_SCOPES[_0x5a0730];}function a244_0x8802(){const _0x4436c6=['database','App\x20rule\x20file\x20is\x20blank:\x20','scope','Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','size','database-analysis','Pass\x20a\x20UTF-8\x20Markdown\x20file.','514341oUeDwW','230027fNyWvN','App\x20rule\x20content\x20exceeds\x205242880\x20UTF-16\x20units.','digest','App\x20rule\x20content\x20exceeds\x20the\x20bounded\x20UTF-8\x20file\x20limit.','app_rule_file_required','length','createTime','8XHUcpF','indexStatus','Cannot\x20access\x20app\x20rule\x20file:\x20','updateTime','isFile','decode','utf-8','utf8','DATABASE.md','app_rule_file_invalid','appCode','byteSize','2363360tpAEhd','from','trim','sha256:','page-api-development','939240LmyqDS','--file\x20is\x20required.','RULES.md','129502LCMcAJ','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','toLowerCase','rules','851416xRGVGW','string','app_rule_content_too_large','type','content','5fGKyIe','update','557703hZZEmy','App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','app_rule_content_invalid','--type\x20must\x20be\x20either\x20rules\x20or\x20database.','app_rule_type_invalid','3QPzuTu','sha256','version'];a244_0x8802=function(){return _0x4436c6;};return a244_0x8802();}export function inspectAppRuleContent(_0x4e5e2b){const _0x437210=a244_0x1b57f6,_0xb3aa98=Buffer[_0x437210(0x192)](_0x4e5e2b,_0x437210(0x18c));return{'content':_0x4e5e2b,'byteSize':_0xb3aa98['byteLength'],'contentHash':_0x437210(0x194)+createHash(_0x437210(0x174))[_0x437210(0x1a3)](_0xb3aa98)[_0x437210(0x180)]('hex')};}export async function readAppRuleFile(_0x3746e5){const _0x5a8c48=a244_0x1b57f6,_0xf518c=_0x3746e5['trim']();if(!_0xf518c)throw appRuleError(_0x5a8c48(0x182),_0x5a8c48(0x197),_0x5a8c48(0x17c));const _0x5d1b96=resolve(_0xf518c);let _0x194e0e;try{_0x194e0e=await stat(_0x5d1b96);}catch(_0x281db0){throw appRuleError('app_rule_file_unreadable',_0x5a8c48(0x187)+_0xf518c,_0x281db0 instanceof Error?_0x281db0['message']:String(_0x281db0));}if(!_0x194e0e[_0x5a8c48(0x189)]())throw appRuleError(_0x5a8c48(0x18e),_0x5a8c48(0x19a)+_0xf518c);if(_0x194e0e[_0x5a8c48(0x17a)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x5a8c48(0x19f),_0x5a8c48(0x181));let _0x2927a5;try{_0x2927a5=await readFile(_0x5d1b96);}catch(_0x2f5586){throw appRuleError('app_rule_file_unreadable','Cannot\x20read\x20app\x20rule\x20file:\x20'+_0xf518c,_0x2f5586 instanceof Error?_0x2f5586['message']:String(_0x2f5586));}if(_0x2927a5['byteLength']>MAX_APP_RULE_BYTES)throw appRuleError(_0x5a8c48(0x19f),_0x5a8c48(0x181));let _0x3105b7;try{_0x3105b7=new TextDecoder(_0x5a8c48(0x18b),{'fatal':!![],'ignoreBOM':!![]})[_0x5a8c48(0x18a)](_0x2927a5);}catch{throw appRuleError(_0x5a8c48(0x1a6),_0x5a8c48(0x1a5)+_0xf518c);}if(_0x3105b7[_0x5a8c48(0x183)]>MAX_APP_RULE_UNITS)throw appRuleError(_0x5a8c48(0x19f),_0x5a8c48(0x17f));if(!_0x3105b7[_0x5a8c48(0x193)]())throw appRuleError(_0x5a8c48(0x1a6),_0x5a8c48(0x177)+_0xf518c);return inspectAppRuleContent(_0x3105b7);}export function projectAppRule(_0x35f986,_0x1f8df4){const _0x3eaf45=a244_0x1b57f6;if(!_0x1f8df4)return{'type':_0x35f986,'fileName':appRuleFileName(_0x35f986),'contextScope':appRuleContextScope(_0x35f986),'enabled':![]};const _0xf5f65e=inspectAppRuleContent(_0x1f8df4[_0x3eaf45(0x1a1)]);return{'type':_0x35f986,'fileName':appRuleFileName(_0x35f986),'contextScope':appRuleContextScope(_0x35f986),'enabled':!![],'id':_0x1f8df4['id'],'scope':_0x1f8df4[_0x3eaf45(0x178)],'appCode':_0x1f8df4[_0x3eaf45(0x18f)],'version':_0x1f8df4[_0x3eaf45(0x175)],..._0x1f8df4[_0x3eaf45(0x186)]!==undefined?{'indexStatus':_0x1f8df4[_0x3eaf45(0x186)]}:{},'contentByteSize':_0xf5f65e[_0x3eaf45(0x190)],'contentHash':_0xf5f65e['contentHash'],..._0x1f8df4[_0x3eaf45(0x184)]!==undefined&&_0x1f8df4[_0x3eaf45(0x184)]!==null?{'createTime':_0x1f8df4[_0x3eaf45(0x184)]}:{},..._0x1f8df4[_0x3eaf45(0x188)]!==undefined&&_0x1f8df4[_0x3eaf45(0x188)]!==null?{'updateTime':_0x1f8df4[_0x3eaf45(0x188)]}:{}};}export const APP_RULE_TYPE_FLAG={'name':a244_0x1b57f6(0x1a0),'type':a244_0x1b57f6(0x19e),'required':!![],'description':a244_0x1b57f6(0x179),'enum':[...APP_RULE_TYPES]};
@@ -1 +1 @@
1
- const a245_0x3fcd4a=a245_0x11d8;(function(_0x8f8731,_0x5ebcab){const _0x5753d7=a245_0x11d8,_0x519252=_0x8f8731();while(!![]){try{const _0x29891e=parseInt(_0x5753d7(0x114))/0x1+parseInt(_0x5753d7(0x10a))/0x2+-parseInt(_0x5753d7(0x107))/0x3*(-parseInt(_0x5753d7(0x102))/0x4)+-parseInt(_0x5753d7(0x124))/0x5*(-parseInt(_0x5753d7(0x11d))/0x6)+parseInt(_0x5753d7(0x11b))/0x7+-parseInt(_0x5753d7(0xf9))/0x8*(-parseInt(_0x5753d7(0x11a))/0x9)+-parseInt(_0x5753d7(0x109))/0xa*(parseInt(_0x5753d7(0x119))/0xb);if(_0x29891e===_0x5ebcab)break;else _0x519252['push'](_0x519252['shift']());}catch(_0x17f95c){_0x519252['push'](_0x519252['shift']());}}}(a245_0x3055,0x4b856));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{findProjectRootDirectory,resolveConfigPath}from'../../context/config-loader.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';function a245_0x11d8(_0x5d1fbb,_0x30dd48){_0x5d1fbb=_0x5d1fbb-0xec;const _0x30553c=a245_0x3055();let _0x11d818=_0x30553c[_0x5d1fbb];return _0x11d818;}import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';function a245_0x3055(){const _0x1a875f=['utf-8','all','yarn.lock','\x22\x20not\x20found\x20in\x20package.json.','Run\x20a\x20package.json\x20script','package.json','pnpm-lock.yaml','No\x20package.json\x20found\x20in\x20current\x20directory.','73983rFxfgb','log','preview','keys','\x20run\x20','2277ShhuyS','3465828VOMdqr','1089291PvSNAF','No\x20scripts\x20defined\x20in\x20package.json.','3589506vKQVrw','.bin','\x20run\x20preview','needsUpgrade','Domain\x20routing\x20synchronized:\x20','parse','\x0a\x20\x20Available\x20scripts:\x0a','5SBAOFK','vite','yarn','\x20\x20\x20\x20','push','bun.lockb','--watch','run','error','script','bun.lock','watch','bun','start','node_modules','Enable\x20watch\x20mode\x20for\x20preview','slice','dev','npm','write','changed','inherit','join','8EDROtx','\x20run\x20build','length','bool','Script\x20\x22','cwd','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','\x20run\x20start','(none)','52NuCmrM','pnpm','path','build','validation','34746VjzSFF','close','65270fXDgYb','593836ioFsGe','belowMinimum'];a245_0x3055=function(){return _0x1a875f;};return a245_0x3055();}const VERSION_CHECK_SCRIPTS=new Set([a245_0x3fcd4a(0xef),a245_0x3fcd4a(0xf3)]),DOMAIN_ROUTING_SYNC_SCRIPTS=new Set(['start',a245_0x3fcd4a(0xf3),'build','preview']);export function syncProjectDomainRoutingBeforeScript(_0x2647b0,_0x9af01d){const _0x464ff0=a245_0x3fcd4a;if(!DOMAIN_ROUTING_SYNC_SCRIPTS['has'](_0x9af01d))return null;const _0x42cc1f=findProjectRootDirectory(_0x2647b0);if(!resolveConfigPath(_0x42cc1f))return null;const _0x41504b=writeProjectDomainRoutingManifest(_0x42cc1f);return{'path':_0x41504b[_0x464ff0(0x104)],'changed':_0x41504b[_0x464ff0(0xf6)]};}function readPackageScripts(_0x26374d){const _0x5b9d13=a245_0x3fcd4a,_0x3e7fd3=resolve(_0x26374d,_0x5b9d13(0x111));if(!existsSync(_0x3e7fd3))return null;try{const _0x5aafb1=JSON[_0x5b9d13(0x122)](readFileSync(_0x3e7fd3,_0x5b9d13(0x10c)));return _0x5aafb1['scripts']??{};}catch{return null;}}function detectPackageManager(_0x5ceedb){const _0x404efe=a245_0x3fcd4a;if(existsSync(resolve(_0x5ceedb,_0x404efe(0x129)))||existsSync(resolve(_0x5ceedb,_0x404efe(0xec))))return _0x404efe(0xee);if(existsSync(resolve(_0x5ceedb,_0x404efe(0x112))))return _0x404efe(0x103);if(existsSync(resolve(_0x5ceedb,_0x404efe(0x10e))))return _0x404efe(0x126);return _0x404efe(0xf4);}async function versionCheck(_0x2438d3){const _0x31e4c9=a245_0x3fcd4a,_0x1d4582=await checkCliVersion();(_0x1d4582[_0x31e4c9(0x120)]||_0x1d4582[_0x31e4c9(0x10b)])&&(printCliUpgradeWarning(_0x1d4582),assertCliVersionSupported(_0x1d4582));const _0x2044ab=await checkSdkVersion(_0x2438d3);if(_0x2044ab[_0x31e4c9(0x120)])printSdkUpgradeWarning(_0x2044ab);}function spawnScript(_0x306d39,_0x199976,_0x37402c,_0x356da9){return new Promise((_0x417ff2,_0x173fab)=>{const _0x252ba9=a245_0x11d8,_0x4a7ba9=[_0x252ba9(0x12b),_0x199976,..._0x37402c],_0x114a54=spawn(_0x306d39,_0x4a7ba9,{'cwd':_0x356da9,'stdio':_0x252ba9(0xf7),'shell':!![],'env':{...process.env,'PATH':''+join(_0x356da9,_0x252ba9(0xf0),_0x252ba9(0x11e))+delimiter+process.env.PATH}});_0x114a54['on']('close',_0x101c60=>{const _0x4e4452=_0x252ba9;if(_0x101c60===0x0||_0x101c60===null)_0x417ff2();else _0x173fab(new Error(_0x306d39+_0x4e4452(0x118)+_0x199976+'\x20exited\x20with\x20code\x20'+_0x101c60));}),_0x114a54['on'](_0x252ba9(0x12c),_0x173fab);});}function spawnViteBuildWatch(_0x5504fb){return new Promise((_0x59cd34,_0x2571cd)=>{const _0x42d4d1=a245_0x11d8,_0x4878ad=spawn('vite',[_0x42d4d1(0x105),_0x42d4d1(0x12a)],{'cwd':_0x5504fb,'stdio':_0x42d4d1(0xf7),'shell':!![],'env':{...process.env,'PATH':''+join(_0x5504fb,'node_modules',_0x42d4d1(0x11e))+delimiter+process.env.PATH}});_0x4878ad['on'](_0x42d4d1(0x108),_0x4a29f1=>{const _0x2cdbc2=_0x42d4d1;if(_0x4a29f1===0x0||_0x4a29f1===null)_0x59cd34();else _0x2571cd(new Error(_0x2cdbc2(0xff)+_0x4a29f1));}),_0x4878ad['on']('error',_0x2571cd);});}function spawnVitePreview(_0x27f01c){return new Promise((_0x11f1cd,_0x78de3b)=>{const _0x70debf=a245_0x11d8,_0xcecda=spawn(_0x70debf(0x125),[_0x70debf(0x116)],{'cwd':_0x27f01c,'stdio':_0x70debf(0xf7),'shell':!![],'env':{...process.env,'PATH':''+join(_0x27f01c,_0x70debf(0xf0),_0x70debf(0x11e))+delimiter+process.env.PATH}});_0xcecda['on'](_0x70debf(0x108),_0x895855=>{if(_0x895855===0x0||_0x895855===null)_0x11f1cd();else _0x78de3b(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x895855));}),_0xcecda['on']('error',_0x78de3b);});}const runFlags=[{'name':a245_0x3fcd4a(0xed),'type':'boolean','description':a245_0x3fcd4a(0xf1),'default':![]}];export const runDefinition={'service':'run','command':'run','description':a245_0x3fcd4a(0x110),'risk':a245_0x3fcd4a(0xf5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a245_0x3fcd4a(0x12d),'description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x1919ac=a245_0x3fcd4a,_0x54de1d=[];return _0x54de1d[_0x1919ac(0x128)]('\x20\x20EXAMPLES'),_0x54de1d['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x1919ac(0x100)),_0x54de1d[_0x1919ac(0x128)](_0x1919ac(0x127)+CLI_BIN_NAME+_0x1919ac(0xfa)),_0x54de1d[_0x1919ac(0x128)](_0x1919ac(0x127)+CLI_BIN_NAME+_0x1919ac(0x11f)),_0x54de1d[_0x1919ac(0x128)](_0x1919ac(0x127)+CLI_BIN_NAME+'\x20run\x20preview\x20--watch'),_0x54de1d[_0x1919ac(0xf8)]('\x0a');},async 'execute'(_0x10ae5c){const _0x361bba=a245_0x3fcd4a,_0x96d4f9=process[_0x361bba(0xfe)](),_0x20ffdb=_0x10ae5c['args'][0x0],_0x22c94a=_0x10ae5c['args'][_0x361bba(0xf2)](0x1),_0x4674bf=readPackageScripts(_0x96d4f9);if(!_0x4674bf)throw CliErrors[_0x361bba(0x106)](_0x361bba(0x113));if(!_0x20ffdb){const _0x1082c4=Object['keys'](_0x4674bf);if(_0x1082c4[_0x361bba(0xfb)]===0x0)console[_0x361bba(0x115)](_0x361bba(0x11c));else{console[_0x361bba(0x115)](_0x361bba(0x123));for(const _0x4eba98 of _0x1082c4){console['log'](_0x361bba(0x127)+_0x4eba98);}console[_0x361bba(0x115)]('\x0a\x20\x20Usage:\x20'+CLI_BIN_NAME+'\x20run\x20<script>\x0a');}return{'ok':!![]};}if(!_0x4674bf[_0x20ffdb])throw CliErrors[_0x361bba(0x106)](_0x361bba(0xfd)+_0x20ffdb+_0x361bba(0x10f),'Available:\x20'+(Object[_0x361bba(0x117)](_0x4674bf)['join'](',\x20')||_0x361bba(0x101)));const _0x5115e4=detectPackageManager(_0x96d4f9),_0x28a2a8=syncProjectDomainRoutingBeforeScript(_0x96d4f9,_0x20ffdb);_0x28a2a8?.[_0x361bba(0xf6)]&&console['error'](_0x361bba(0x121)+_0x28a2a8[_0x361bba(0x104)]);VERSION_CHECK_SCRIPTS['has'](_0x20ffdb)&&await versionCheck(_0x96d4f9);if(_0x20ffdb===_0x361bba(0x116)&&_0x10ae5c[_0x361bba(0xfc)]('watch'))return await Promise[_0x361bba(0x10d)]([spawnViteBuildWatch(_0x96d4f9),spawnVitePreview(_0x96d4f9)]),{'ok':!![]};return await spawnScript(_0x5115e4,_0x20ffdb,_0x22c94a,_0x96d4f9),{'ok':!![]};}};
1
+ const a245_0x5089f2=a245_0xc42e;(function(_0x5a7332,_0x3b698a){const _0x445f87=a245_0xc42e,_0x1ec976=_0x5a7332();while(!![]){try{const _0x5cf0cb=parseInt(_0x445f87(0xeb))/0x1+-parseInt(_0x445f87(0x101))/0x2*(parseInt(_0x445f87(0xef))/0x3)+parseInt(_0x445f87(0xe7))/0x4+-parseInt(_0x445f87(0xf3))/0x5+parseInt(_0x445f87(0xee))/0x6+parseInt(_0x445f87(0xf7))/0x7+-parseInt(_0x445f87(0xf5))/0x8;if(_0x5cf0cb===_0x3b698a)break;else _0x1ec976['push'](_0x1ec976['shift']());}catch(_0x4728a7){_0x1ec976['push'](_0x1ec976['shift']());}}}(a245_0x44d0,0x1d454));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';function a245_0xc42e(_0x71deab,_0x1a21fc){_0x71deab=_0x71deab-0xe5;const _0x44d008=a245_0x44d0();let _0xc42e0b=_0x44d008[_0x71deab];return _0xc42e0b;}function a245_0x44d0(){const _0x41e2a3=['cwd','has','749682DXJjov','5886VtzddD','needsUpgrade','\x20exited\x20with\x20code\x20','\x20run\x20preview\x20--watch','578445PYXUuN','yarn','841184posuOa','\x20run\x20<script>\x0a','177135vHFtDy','log','parse','\x0a\x20\x20Usage:\x20','inherit','Available:\x20','\x20run\x20build','slice','Enable\x20watch\x20mode\x20for\x20preview','(none)','134hrHugr','keys','Run\x20a\x20package.json\x20script','vite\x20preview\x20exited\x20with\x20code\x20','preview','\x20run\x20start','error','\x20\x20\x20\x20','\x22\x20not\x20found\x20in\x20package.json.','write','vite','run','push','start','\x20\x20EXAMPLES','Script\x20\x22','belowMinimum','bun.lock','close','build','utf-8','No\x20scripts\x20defined\x20in\x20package.json.','boolean','package.json','yarn.lock','Domain\x20routing\x20synchronized:\x20','bun.lockb','\x0a\x20\x20Available\x20scripts:\x0a','validation','args','pnpm-lock.yaml','path','459352wAbUdo','node_modules','watch','.bin','207093aMmKtL'];a245_0x44d0=function(){return _0x41e2a3;};return a245_0x44d0();}const VERSION_CHECK_SCRIPTS=new Set([a245_0x5089f2(0x10e),'dev']),DOMAIN_ROUTING_SYNC_SCRIPTS=new Set([a245_0x5089f2(0x10e),'dev',a245_0x5089f2(0x114),a245_0x5089f2(0x105)]);export function syncProjectDomainRoutingBeforeScript(_0x6cab4b,_0x2291ed){const _0x4ed5c2=a245_0x5089f2;if(!DOMAIN_ROUTING_SYNC_SCRIPTS[_0x4ed5c2(0xed)](_0x2291ed))return null;const _0x13b941=findProjectRootDirectory(_0x6cab4b);if(!resolveConfigPath(_0x13b941))return null;const _0x1fc121=writeProjectDomainRoutingManifest(_0x13b941);return{'path':_0x1fc121[_0x4ed5c2(0xe6)],'changed':_0x1fc121['changed']};}function readPackageScripts(_0x4aaa72){const _0x5c8bf0=a245_0x5089f2,_0x3c7380=resolve(_0x4aaa72,_0x5c8bf0(0x118));if(!existsSync(_0x3c7380))return null;try{const _0x5751e2=JSON[_0x5c8bf0(0xf9)](readFileSync(_0x3c7380,_0x5c8bf0(0x115)));return _0x5751e2['scripts']??{};}catch{return null;}}function detectPackageManager(_0x584219){const _0x3e817a=a245_0x5089f2;if(existsSync(resolve(_0x584219,_0x3e817a(0x11b)))||existsSync(resolve(_0x584219,_0x3e817a(0x112))))return'bun';if(existsSync(resolve(_0x584219,_0x3e817a(0xe5))))return'pnpm';if(existsSync(resolve(_0x584219,_0x3e817a(0x119))))return _0x3e817a(0xf4);return'npm';}async function versionCheck(_0x49dee8){const _0x572641=a245_0x5089f2,_0x46d0e1=await checkCliVersion();(_0x46d0e1[_0x572641(0xf0)]||_0x46d0e1[_0x572641(0x111)])&&(printCliUpgradeWarning(_0x46d0e1),assertCliVersionSupported(_0x46d0e1));const _0x1e4ebb=await checkSdkVersion(_0x49dee8);if(_0x1e4ebb[_0x572641(0xf0)])printSdkUpgradeWarning(_0x1e4ebb);}function spawnScript(_0x28a9e9,_0x324655,_0x27d74c,_0x1d380f){return new Promise((_0x1b65a5,_0x4b00dc)=>{const _0x2757a9=a245_0xc42e,_0x3b6c46=[_0x2757a9(0x10c),_0x324655,..._0x27d74c],_0x873589=spawn(_0x28a9e9,_0x3b6c46,{'cwd':_0x1d380f,'stdio':_0x2757a9(0xfb),'shell':!![],'env':{...process.env,'PATH':''+join(_0x1d380f,'node_modules',_0x2757a9(0xea))+delimiter+process.env.PATH}});_0x873589['on']('close',_0xfa6165=>{const _0x50b614=_0x2757a9;if(_0xfa6165===0x0||_0xfa6165===null)_0x1b65a5();else _0x4b00dc(new Error(_0x28a9e9+'\x20run\x20'+_0x324655+_0x50b614(0xf1)+_0xfa6165));}),_0x873589['on'](_0x2757a9(0x107),_0x4b00dc);});}function spawnViteBuildWatch(_0x4f3b68){return new Promise((_0x57298d,_0x4fa097)=>{const _0x891216=a245_0xc42e,_0x327767=spawn(_0x891216(0x10b),[_0x891216(0x114),'--watch'],{'cwd':_0x4f3b68,'stdio':_0x891216(0xfb),'shell':!![],'env':{...process.env,'PATH':''+join(_0x4f3b68,'node_modules',_0x891216(0xea))+delimiter+process.env.PATH}});_0x327767['on']('close',_0x579203=>{if(_0x579203===0x0||_0x579203===null)_0x57298d();else _0x4fa097(new Error('vite\x20build\x20--watch\x20exited\x20with\x20code\x20'+_0x579203));}),_0x327767['on'](_0x891216(0x107),_0x4fa097);});}function spawnVitePreview(_0x535ce9){return new Promise((_0x29d88e,_0x1863a2)=>{const _0x4b007b=a245_0xc42e,_0x39387a=spawn(_0x4b007b(0x10b),[_0x4b007b(0x105)],{'cwd':_0x535ce9,'stdio':_0x4b007b(0xfb),'shell':!![],'env':{...process.env,'PATH':''+join(_0x535ce9,_0x4b007b(0xe8),_0x4b007b(0xea))+delimiter+process.env.PATH}});_0x39387a['on'](_0x4b007b(0x113),_0x1b7b37=>{const _0x52c4e4=_0x4b007b;if(_0x1b7b37===0x0||_0x1b7b37===null)_0x29d88e();else _0x1863a2(new Error(_0x52c4e4(0x104)+_0x1b7b37));}),_0x39387a['on'](_0x4b007b(0x107),_0x1863a2);});}const runFlags=[{'name':'watch','type':a245_0x5089f2(0x117),'description':a245_0x5089f2(0xff),'default':![]}];export const runDefinition={'service':'run','command':a245_0x5089f2(0x10c),'description':a245_0x5089f2(0x103),'risk':a245_0x5089f2(0x10a),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'script','description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x3bf6bf=a245_0x5089f2,_0x435584=[];return _0x435584[_0x3bf6bf(0x10d)](_0x3bf6bf(0x10f)),_0x435584[_0x3bf6bf(0x10d)](_0x3bf6bf(0x108)+CLI_BIN_NAME+_0x3bf6bf(0x106)),_0x435584['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x3bf6bf(0xfd)),_0x435584[_0x3bf6bf(0x10d)]('\x20\x20\x20\x20'+CLI_BIN_NAME+'\x20run\x20preview'),_0x435584[_0x3bf6bf(0x10d)](_0x3bf6bf(0x108)+CLI_BIN_NAME+_0x3bf6bf(0xf2)),_0x435584['join']('\x0a');},async 'execute'(_0x2b7790){const _0x964cf3=a245_0x5089f2,_0x4dc946=process[_0x964cf3(0xec)](),_0x2eb9d3=_0x2b7790[_0x964cf3(0x11e)][0x0],_0xc276b2=_0x2b7790[_0x964cf3(0x11e)][_0x964cf3(0xfe)](0x1),_0xc19c0=readPackageScripts(_0x4dc946);if(!_0xc19c0)throw CliErrors[_0x964cf3(0x11d)]('No\x20package.json\x20found\x20in\x20current\x20directory.');if(!_0x2eb9d3){const _0x1d9f09=Object[_0x964cf3(0x102)](_0xc19c0);if(_0x1d9f09['length']===0x0)console[_0x964cf3(0xf8)](_0x964cf3(0x116));else{console[_0x964cf3(0xf8)](_0x964cf3(0x11c));for(const _0x26675 of _0x1d9f09){console[_0x964cf3(0xf8)](_0x964cf3(0x108)+_0x26675);}console['log'](_0x964cf3(0xfa)+CLI_BIN_NAME+_0x964cf3(0xf6));}return{'ok':!![]};}if(!_0xc19c0[_0x2eb9d3])throw CliErrors[_0x964cf3(0x11d)](_0x964cf3(0x110)+_0x2eb9d3+_0x964cf3(0x109),_0x964cf3(0xfc)+(Object['keys'](_0xc19c0)['join'](',\x20')||_0x964cf3(0x100)));const _0x23d82c=detectPackageManager(_0x4dc946),_0x5bf681=syncProjectDomainRoutingBeforeScript(_0x4dc946,_0x2eb9d3);_0x5bf681?.['changed']&&console[_0x964cf3(0x107)](_0x964cf3(0x11a)+_0x5bf681['path']);VERSION_CHECK_SCRIPTS[_0x964cf3(0xed)](_0x2eb9d3)&&await versionCheck(_0x4dc946);if(_0x2eb9d3==='preview'&&_0x2b7790['bool'](_0x964cf3(0xe9)))return await Promise['all']([spawnViteBuildWatch(_0x4dc946),spawnVitePreview(_0x4dc946)]),{'ok':!![]};return await spawnScript(_0x23d82c,_0x2eb9d3,_0xc276b2,_0x4dc946),{'ok':!![]};}};
@@ -1 +1 @@
1
- const a246_0x4dce19=a246_0x26e1;function a246_0x3182(){const _0x4c16c3=['2629578unnExr','schema','6988612CysNki','1213401NHFClf','12iiqnHp','214792wVKsGz','10952736swgCrF','19871352KqJEsV','2564990uKKJwh','18MuanXl'];a246_0x3182=function(){return _0x4c16c3;};return a246_0x3182();}(function(_0x59a61d,_0x33daea){const _0x445734=a246_0x26e1,_0x426c14=_0x59a61d();while(!![]){try{const _0xd9872e=-parseInt(_0x445734(0x124))/0x1*(-parseInt(_0x445734(0x123))/0x2)+parseInt(_0x445734(0x129))/0x3+-parseInt(_0x445734(0x121))/0x4+-parseInt(_0x445734(0x127))/0x5*(-parseInt(_0x445734(0x128))/0x6)+-parseInt(_0x445734(0x122))/0x7+parseInt(_0x445734(0x125))/0x8+-parseInt(_0x445734(0x126))/0x9;if(_0xd9872e===_0x33daea)break;else _0x426c14['push'](_0x426c14['shift']());}catch(_0x36261b){_0x426c14['push'](_0x426c14['shift']());}}}(a246_0x3182,0xe6b2c));function a246_0x26e1(_0xdb872f,_0x32fc8d){_0xdb872f=_0xdb872f-0x121;const _0x318218=a246_0x3182();let _0x26e102=_0x318218[_0xdb872f];return _0x26e102;}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x46afff){const _0x4b61fe=await buildSchemaPayload();return{'ok':!![],'data':_0x4b61fe};}export const schemaDefinition={'service':a246_0x4dce19(0x12a),'command':'export','description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':'json','flags':[],'execute':execute};
1
+ function a246_0x4be8(_0x4d8274,_0x586421){_0x4d8274=_0x4d8274-0x87;const _0x2a4534=a246_0x2a45();let _0x4be8bd=_0x2a4534[_0x4d8274];return _0x4be8bd;}const a246_0x4e41d8=a246_0x4be8;(function(_0x29cf30,_0x16ca14){const _0x2629e6=a246_0x4be8,_0x4f02b8=_0x29cf30();while(!![]){try{const _0xd66559=-parseInt(_0x2629e6(0x8a))/0x1+-parseInt(_0x2629e6(0x92))/0x2*(parseInt(_0x2629e6(0x90))/0x3)+parseInt(_0x2629e6(0x88))/0x4+parseInt(_0x2629e6(0x91))/0x5+-parseInt(_0x2629e6(0x87))/0x6+-parseInt(_0x2629e6(0x8d))/0x7*(parseInt(_0x2629e6(0x8b))/0x8)+parseInt(_0x2629e6(0x8c))/0x9;if(_0xd66559===_0x16ca14)break;else _0x4f02b8['push'](_0x4f02b8['shift']());}catch(_0x4603ee){_0x4f02b8['push'](_0x4f02b8['shift']());}}}(a246_0x2a45,0x811dd));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x1b71b8){const _0x44f44c=await buildSchemaPayload();return{'ok':!![],'data':_0x44f44c};}export const schemaDefinition={'service':a246_0x4e41d8(0x8f),'command':a246_0x4e41d8(0x89),'description':a246_0x4e41d8(0x8e),'risk':a246_0x4e41d8(0x93),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':'json','flags':[],'execute':execute};function a246_0x2a45(){const _0x5a8e81=['3994566blGxcC','3391160DuMUSe','export','442170pqGPDM','23224jQHDva','15747021HmoJKE','2373YEQrqY','Export\x20machine-readable\x20command\x20schema\x20(JSON)','schema','126624hAGwQZ','4127010WRBhRq','38VEAiRo','read'];a246_0x2a45=function(){return _0x5a8e81;};return a246_0x2a45();}
@@ -1 +1 @@
1
- function a247_0xb3c8(){const _0x1696a3=['sqlRootDir','toISOString','name','new','join','length','Invalid\x20database\x20selection\x20payload:\x20','number','2169RPInJG','create','/smartapi/custom/saveUserCustomSql','flagMissing','2205SIwcpr','sqlName','stringify','validation','string','SELECT\x201\x20AS\x20id;','dbName','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','write','Select\x20the\x20local\x20SQL\x20mode:','map','trim','parse','7720AaQRrE','78168YxIRKO','185aoKnnl','sql','File\x20already\x20exists:\x20','✎\x20Enter\x20dbId\x20manually','mybatisXml','\x20\x20SELECT\x201\x20AS\x20id','9339pRZmGz','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','appCode','Target\x20database\x20ID','str','Target\x20database\x20dbId:','SQL\x20name:','23784mAUQhY','Select\x20the\x20target\x20database:','sqls','sqlCode','db-id','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','sqlRoot','dbId\x20cannot\x20be\x20empty','44786HhLKPk','description','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','3277512oKDXPm','mode','For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly','lockFilePath','lastSync','Local\x20SQL\x20file\x20mode','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','56gUklrK','SQL\x20query\x20display\x20name','catch','4780fchtkS','nonInteractive','isFinite','MyBatis\x20XML\x20(mybatisXml)','dbId','dbId\x20must\x20be\x20a\x20positive\x20integer','33169212ZvjmDF','isInteger','Plain\x20SQL\x20(sql)'];a247_0xb3c8=function(){return _0x1696a3;};return a247_0xb3c8();}const a247_0x299107=a247_0x4ab2;(function(_0x431cd6,_0x429dc4){const _0x5b9947=a247_0x4ab2,_0x457901=_0x431cd6();while(!![]){try{const _0x2706a1=-parseInt(_0x5b9947(0x133))/0x1*(-parseInt(_0x5b9947(0x129))/0x2)+parseInt(_0x5b9947(0x147))/0x3*(parseInt(_0x5b9947(0x136))/0x4)+-parseInt(_0x5b9947(0x15a))/0x5*(parseInt(_0x5b9947(0x159))/0x6)+parseInt(_0x5b9947(0x12c))/0x7+-parseInt(_0x5b9947(0x121))/0x8*(-parseInt(_0x5b9947(0x14b))/0x9)+-parseInt(_0x5b9947(0x158))/0xa*(-parseInt(_0x5b9947(0x160))/0xb)+-parseInt(_0x5b9947(0x13c))/0xc;if(_0x2706a1===_0x429dc4)break;else _0x457901['push'](_0x457901['shift']());}catch(_0x154c5a){_0x457901['push'](_0x457901['shift']());}}}(a247_0xb3c8,0xb0bad));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_0x4ab2(_0x13c755,_0xa90677){_0x13c755=_0x13c755-0x11f;const _0xb3c8ca=a247_0xb3c8();let _0x4ab22d=_0xb3c8ca[_0x13c755];return _0x4ab22d;}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(_0x3f22f4){const _0x5c95bf=a247_0x4ab2;if(_0x3f22f4===_0x5c95bf(0x15e))return[_0x5c95bf(0x132),_0x5c95bf(0x15f),'</select>',''][_0x5c95bf(0x143)]('\x0a');return[_0x5c95bf(0x150),''][_0x5c95bf(0x143)]('\x0a');}export const sqlCreate={'service':a247_0x299107(0x15b),'command':a247_0x299107(0x148),'description':'Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','risk':a247_0x299107(0x153),'flags':[{'name':a247_0x299107(0x141),'type':a247_0x299107(0x14f),'description':a247_0x299107(0x134)},{'name':a247_0x299107(0x125),'type':a247_0x299107(0x146),'description':a247_0x299107(0x163)},{'name':a247_0x299107(0x12d),'type':a247_0x299107(0x14f),'enum':['sql',a247_0x299107(0x15e)],'description':a247_0x299107(0x131)}],async 'validate'(_0x3298cc){const _0x110bad=a247_0x299107;if(!_0x3298cc['nonInteractive'])return;if(!_0x3298cc['str']('name')[_0x110bad(0x156)]())throw CliErrors[_0x110bad(0x14a)]('name','--name\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x3fc6f1=resolveProvidedDbId(_0x3298cc);if(typeof _0x3fc6f1!==_0x110bad(0x146)||!Number[_0x110bad(0x138)](_0x3fc6f1)||_0x3fc6f1<=0x0)throw CliErrors[_0x110bad(0x14a)](_0x110bad(0x125),_0x110bad(0x12b));if(!_0x3298cc[_0x110bad(0x164)](_0x110bad(0x12d))[_0x110bad(0x156)]())throw CliErrors[_0x110bad(0x14a)](_0x110bad(0x12d),_0x110bad(0x152));},async 'dryRun'(_0xcd0db0){const _0x223f48=a247_0x299107,_0x2fd42c=loadSqlProjectConfig(_0xcd0db0[_0x223f48(0x162)]),{sqlName:_0x478b81,dbId:_0x37bd90,dbName:_0x246128,mode:_0x50024f}=await resolveSqlNewInputs(_0xcd0db0),_0x47617d=buildSqlRelativePath('<server-generated-sqlCode>',_0x478b81,_0x246128,_0x50024f,_0x37bd90),_0x4394ab=_0x2fd42c[_0x223f48(0x13f)]+'/'+_0x47617d;return{'method':'POST','url':_0x223f48(0x149),'body':{'appCode':_0xcd0db0['appCode'],'sqlName':_0x478b81,'dbId':_0x37bd90,'mode':_0x50024f,'localPath':_0x4394ab},'description':_0x223f48(0x126)+_0x2fd42c[_0x223f48(0x13f)]};},async 'execute'(_0x3ac898){const _0x5d655e=a247_0x299107,_0x5ebf09=loadSqlProjectConfig(_0x3ac898[_0x5d655e(0x162)]),{sqlName:_0x367db8,dbId:_0x3376cb,dbName:_0x1bbc56,mode:_0x582b36}=await resolveSqlNewInputs(_0x3ac898),_0x1724e9=generateSqlTemplate(_0x582b36),_0x288873=await createSqlQuery({'appCode':_0x3ac898[_0x5d655e(0x162)],'sqlName':_0x367db8,'dbId':_0x3376cb,'sqlContent':_0x1724e9}),_0x1f8431=ensureRemoteSqlContent(_0x288873),_0x37318e=_0x1bbc56||await getDbName(_0x3ac898[_0x5d655e(0x162)],_0x3376cb)[_0x5d655e(0x135)](()=>undefined),_0x1e528a=buildSqlRelativePath(_0x288873[_0x5d655e(0x124)],_0x288873['sqlName'],_0x37318e,_0x582b36,_0x3376cb),_0x39730c=_0x5ebf09['sqlRootDir']+'/'+_0x1e528a,_0x52078c=buildLocalSqlFileContent({'sqlCode':_0x288873[_0x5d655e(0x124)],'sqlName':_0x288873[_0x5d655e(0x14c)],'dbId':_0x288873[_0x5d655e(0x13a)]},_0x1f8431,{'dbName':_0x37318e,'mode':_0x582b36,'syncedAt':new Date()[_0x5d655e(0x140)](),'description':_0x288873[_0x5d655e(0x12a)]});if(await fileExists(_0x39730c))throw CliErrors['validation'](_0x5d655e(0x15c)+_0x39730c);await ensureParentDirectory(_0x39730c),await writeFile(_0x39730c,_0x52078c,'utf8');const _0x2584cd=await readSqlLockFile(_0x5ebf09[_0x5d655e(0x12f)]),{lockData:_0x574272,appLock:_0x2e99b8}=ensureSqlLockScope(_0x2584cd??createEmptySqlLock(),_0x5ebf09[_0x5d655e(0x162)],_0x5ebf09[_0x5d655e(0x127)],_0x5d655e(0x142));return _0x2e99b8[_0x5d655e(0x123)][_0x288873['sqlCode']]={...buildSqlLockEntry(_0x288873,_0x1f8431,computeSqlContentHash(_0x52078c),{'dbName':_0x37318e}),'path':_0x1e528a,'mode':_0x582b36},_0x2e99b8[_0x5d655e(0x130)]=new Date()[_0x5d655e(0x140)](),await writeSqlLockFile(_0x5ebf09[_0x5d655e(0x12f)],_0x574272),{'ok':!![],'data':{'id':_0x288873['id'],'sqlCode':_0x288873[_0x5d655e(0x124)],'sqlName':_0x288873[_0x5d655e(0x14c)],'dbId':_0x288873[_0x5d655e(0x13a)],'path':_0x39730c,'mode':_0x582b36},'message':'Created\x20SQL\x20query\x20'+_0x288873[_0x5d655e(0x124)]};}};async function resolveSqlNewInputs(_0x395d85){const _0x5d8946=await resolveSqlNameInput(_0x395d85),{dbId:_0x1f9832,dbName:_0x4f45c6}=await resolveDbSelection(_0x395d85),_0x306549=await resolveSqlModeInput(_0x395d85);return{'sqlName':_0x5d8946,'dbId':_0x1f9832,'dbName':_0x4f45c6,'mode':_0x306549};}async function resolveSqlNameInput(_0x122198){const _0x208fce=a247_0x299107,_0x2340b4=_0x122198[_0x208fce(0x164)]('name')[_0x208fce(0x156)]();if(_0x2340b4)return _0x2340b4;if(_0x122198[_0x208fce(0x137)])throw CliErrors['flagMissing'](_0x208fce(0x141),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');return(await input({'message':_0x208fce(0x120),'validate':_0xe4198f=>_0xe4198f[_0x208fce(0x156)]()?!![]:'SQL\x20name\x20cannot\x20be\x20empty'}))[_0x208fce(0x156)]();}async function resolveDbSelection(_0x370113){const _0x22e417=a247_0x299107,_0x17b49a=resolveProvidedDbId(_0x370113);if(typeof _0x17b49a===_0x22e417(0x146)&&Number['isFinite'](_0x17b49a)&&_0x17b49a>0x0)return{'dbId':_0x17b49a,'dbName':await getDbName(_0x370113[_0x22e417(0x162)],_0x17b49a)[_0x22e417(0x135)](()=>undefined)};if(_0x370113[_0x22e417(0x137)])throw CliErrors[_0x22e417(0x14a)](_0x22e417(0x125),_0x22e417(0x12b));const _0x50fe5d=await listDatabases(_0x370113['appCode'])[_0x22e417(0x135)](()=>[]);if(_0x50fe5d['length']===0x1)return{'dbId':_0x50fe5d[0x0]['dbId'],'dbName':_0x50fe5d[0x0][_0x22e417(0x151)]};if(_0x50fe5d[_0x22e417(0x144)]>0x1){const _0x2a84a3=await select({'message':_0x22e417(0x122),'choices':[..._0x50fe5d[_0x22e417(0x155)](_0x294ddb=>({'name':_0x294ddb[_0x22e417(0x151)]+'\x20('+_0x294ddb['dbId']+')','value':serializeDbSelection(_0x294ddb)})),{'name':_0x22e417(0x15d),'value':'__manual__'}]});if(_0x2a84a3!=='__manual__')return deserializeDbSelection(_0x2a84a3);}const _0x1249d2=await input({'message':_0x22e417(0x11f),'validate':_0x4969c9=>{const _0x4278ed=_0x22e417,_0x12dac8=_0x4969c9[_0x4278ed(0x156)]();if(!_0x12dac8)return _0x4278ed(0x128);const _0x3a280b=Number(_0x12dac8);if(!Number[_0x4278ed(0x13d)](_0x3a280b)||_0x3a280b<=0x0)return _0x4278ed(0x13b);return!![];}});return{'dbId':Number(_0x1249d2[_0x22e417(0x156)]())};}async function resolveSqlModeInput(_0x1f4d1b){const _0x554525=a247_0x299107,_0x2e3d2a=_0x1f4d1b['str'](_0x554525(0x12d))['trim']();if(_0x2e3d2a===_0x554525(0x15b)||_0x2e3d2a==='mybatisXml')return _0x2e3d2a;if(_0x1f4d1b[_0x554525(0x137)])throw CliErrors['flagMissing']('mode',_0x554525(0x152));return await select({'message':_0x554525(0x154),'choices':[{'name':_0x554525(0x13e),'value':_0x554525(0x15b),'description':_0x554525(0x12e)},{'name':_0x554525(0x139),'value':'mybatisXml','description':_0x554525(0x161)}]});}function serializeDbSelection(_0x560e8f){const _0x1d0175=a247_0x299107;return JSON[_0x1d0175(0x14d)]({'dbId':_0x560e8f['dbId'],'dbName':_0x560e8f['dbName']});}function deserializeDbSelection(_0x143d8c){const _0x56bb69=a247_0x299107;try{const _0x3f5549=JSON[_0x56bb69(0x157)](_0x143d8c);if(typeof _0x3f5549[_0x56bb69(0x13a)]==='number'&&Number[_0x56bb69(0x138)](_0x3f5549['dbId']))return{'dbId':_0x3f5549[_0x56bb69(0x13a)],'dbName':_0x3f5549[_0x56bb69(0x151)]};}catch{}throw CliErrors[_0x56bb69(0x14e)](_0x56bb69(0x145)+_0x143d8c);}function resolveProvidedDbId(_0x3fa3c9){const _0x284a13=a247_0x299107,_0x48ce34=_0x3fa3c9['flag'](_0x284a13(0x125));if(typeof _0x48ce34==='number'&&Number[_0x284a13(0x138)](_0x48ce34))return _0x48ce34;return undefined;}
1
+ const a247_0x23c4da=a247_0x131c;(function(_0x45951c,_0x3fd2b0){const _0x30cd9b=a247_0x131c,_0x3e8eeb=_0x45951c();while(!![]){try{const _0x1014a3=parseInt(_0x30cd9b(0x138))/0x1*(parseInt(_0x30cd9b(0x13d))/0x2)+parseInt(_0x30cd9b(0x117))/0x3*(-parseInt(_0x30cd9b(0x135))/0x4)+parseInt(_0x30cd9b(0x11b))/0x5*(parseInt(_0x30cd9b(0x13f))/0x6)+-parseInt(_0x30cd9b(0x144))/0x7*(-parseInt(_0x30cd9b(0x111))/0x8)+parseInt(_0x30cd9b(0x10a))/0x9+parseInt(_0x30cd9b(0x13a))/0xa*(-parseInt(_0x30cd9b(0x118))/0xb)+-parseInt(_0x30cd9b(0x145))/0xc;if(_0x1014a3===_0x3fd2b0)break;else _0x3e8eeb['push'](_0x3e8eeb['shift']());}catch(_0x3e1f33){_0x3e8eeb['push'](_0x3e8eeb['shift']());}}}(a247_0x5a08,0xb0751));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x49ea50){const _0x218c05=a247_0x131c;if(_0x49ea50===_0x218c05(0x119))return[_0x218c05(0x114),_0x218c05(0x123),_0x218c05(0x12e),'']['join']('\x0a');return[_0x218c05(0x132),''][_0x218c05(0x11d)]('\x0a');}export const sqlCreate={'service':'sql','command':a247_0x23c4da(0x112),'description':a247_0x23c4da(0x140),'risk':a247_0x23c4da(0x130),'flags':[{'name':a247_0x23c4da(0x116),'type':'string','description':a247_0x23c4da(0x139)},{'name':a247_0x23c4da(0x124),'type':a247_0x23c4da(0x12c),'description':a247_0x23c4da(0x11e)},{'name':a247_0x23c4da(0x13e),'type':a247_0x23c4da(0x12b),'enum':[a247_0x23c4da(0x129),a247_0x23c4da(0x119)],'description':a247_0x23c4da(0x133)}],async 'validate'(_0x139bd6){const _0x4fab1f=a247_0x23c4da;if(!_0x139bd6['nonInteractive'])return;if(!_0x139bd6[_0x4fab1f(0x125)](_0x4fab1f(0x116))[_0x4fab1f(0x110)]())throw CliErrors[_0x4fab1f(0x136)](_0x4fab1f(0x116),_0x4fab1f(0x10e));const _0x3a03f1=resolveProvidedDbId(_0x139bd6);if(typeof _0x3a03f1!==_0x4fab1f(0x12c)||!Number['isFinite'](_0x3a03f1)||_0x3a03f1<=0x0)throw CliErrors[_0x4fab1f(0x136)]('db-id',_0x4fab1f(0x104));if(!_0x139bd6[_0x4fab1f(0x125)]('mode')[_0x4fab1f(0x110)]())throw CliErrors['flagMissing'](_0x4fab1f(0x13e),_0x4fab1f(0x11c));},async 'dryRun'(_0x5d3141){const _0x55df21=a247_0x23c4da,_0x4548d5=loadSqlProjectConfig(_0x5d3141[_0x55df21(0x10d)]),{sqlName:_0x142375,dbId:_0x55fd78,dbName:_0x43388f,mode:_0x9e20c0}=await resolveSqlNewInputs(_0x5d3141),_0x320e4f=buildSqlRelativePath(_0x55df21(0x10b),_0x142375,_0x43388f,_0x9e20c0,_0x55fd78),_0x45a4bf=_0x4548d5[_0x55df21(0x128)]+'/'+_0x320e4f;return{'method':'POST','url':'/smartapi/custom/saveUserCustomSql','body':{'appCode':_0x5d3141[_0x55df21(0x10d)],'sqlName':_0x142375,'dbId':_0x55fd78,'mode':_0x9e20c0,'localPath':_0x45a4bf},'description':'Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20'+_0x4548d5[_0x55df21(0x128)]};},async 'execute'(_0x3be550){const _0x2b1d01=a247_0x23c4da,_0x6521a1=loadSqlProjectConfig(_0x3be550['appCode']),{sqlName:_0x344e92,dbId:_0x428044,dbName:_0x44b5d6,mode:_0x57e938}=await resolveSqlNewInputs(_0x3be550),_0x5061cd=generateSqlTemplate(_0x57e938),_0x116118=await createSqlQuery({'appCode':_0x3be550[_0x2b1d01(0x10d)],'sqlName':_0x344e92,'dbId':_0x428044,'sqlContent':_0x5061cd}),_0x4d1149=ensureRemoteSqlContent(_0x116118),_0x256fa8=_0x44b5d6||await getDbName(_0x3be550[_0x2b1d01(0x10d)],_0x428044)[_0x2b1d01(0x10f)](()=>undefined),_0x5adc09=buildSqlRelativePath(_0x116118[_0x2b1d01(0x127)],_0x116118[_0x2b1d01(0x148)],_0x256fa8,_0x57e938,_0x428044),_0x4133ef=_0x6521a1[_0x2b1d01(0x128)]+'/'+_0x5adc09,_0x41f928=buildLocalSqlFileContent({'sqlCode':_0x116118[_0x2b1d01(0x127)],'sqlName':_0x116118['sqlName'],'dbId':_0x116118[_0x2b1d01(0x13c)]},_0x4d1149,{'dbName':_0x256fa8,'mode':_0x57e938,'syncedAt':new Date()[_0x2b1d01(0x147)](),'description':_0x116118[_0x2b1d01(0x137)]});if(await fileExists(_0x4133ef))throw CliErrors['validation'](_0x2b1d01(0x134)+_0x4133ef);await ensureParentDirectory(_0x4133ef),await writeFile(_0x4133ef,_0x41f928,_0x2b1d01(0x146));const _0x8ae610=await readSqlLockFile(_0x6521a1['lockFilePath']),{lockData:_0x363255,appLock:_0x4b74b0}=ensureSqlLockScope(_0x8ae610??createEmptySqlLock(),_0x6521a1[_0x2b1d01(0x10d)],_0x6521a1[_0x2b1d01(0x126)],'new');return _0x4b74b0['sqls'][_0x116118[_0x2b1d01(0x127)]]={...buildSqlLockEntry(_0x116118,_0x4d1149,computeSqlContentHash(_0x41f928),{'dbName':_0x256fa8}),'path':_0x5adc09,'mode':_0x57e938},_0x4b74b0[_0x2b1d01(0x12f)]=new Date()[_0x2b1d01(0x147)](),await writeSqlLockFile(_0x6521a1['lockFilePath'],_0x363255),{'ok':!![],'data':{'id':_0x116118['id'],'sqlCode':_0x116118[_0x2b1d01(0x127)],'sqlName':_0x116118[_0x2b1d01(0x148)],'dbId':_0x116118[_0x2b1d01(0x13c)],'path':_0x4133ef,'mode':_0x57e938},'message':_0x2b1d01(0x141)+_0x116118['sqlCode']};}};async function resolveSqlNewInputs(_0x16d84e){const _0x53d57c=await resolveSqlNameInput(_0x16d84e),{dbId:_0x2ba84f,dbName:_0x3bb57d}=await resolveDbSelection(_0x16d84e),_0x233651=await resolveSqlModeInput(_0x16d84e);return{'sqlName':_0x53d57c,'dbId':_0x2ba84f,'dbName':_0x3bb57d,'mode':_0x233651};}async function resolveSqlNameInput(_0x319460){const _0x504b92=a247_0x23c4da,_0x2be16f=_0x319460['str']('name')[_0x504b92(0x110)]();if(_0x2be16f)return _0x2be16f;if(_0x319460[_0x504b92(0x108)])throw CliErrors[_0x504b92(0x136)](_0x504b92(0x116),_0x504b92(0x10e));return(await input({'message':'SQL\x20name:','validate':_0x35f0b7=>_0x35f0b7[_0x504b92(0x110)]()?!![]:_0x504b92(0x13b)}))['trim']();}async function resolveDbSelection(_0x55d6e9){const _0x3666a4=a247_0x23c4da,_0x1ce638=resolveProvidedDbId(_0x55d6e9);if(typeof _0x1ce638===_0x3666a4(0x12c)&&Number['isFinite'](_0x1ce638)&&_0x1ce638>0x0)return{'dbId':_0x1ce638,'dbName':await getDbName(_0x55d6e9[_0x3666a4(0x10d)],_0x1ce638)[_0x3666a4(0x10f)](()=>undefined)};if(_0x55d6e9['nonInteractive'])throw CliErrors[_0x3666a4(0x136)]('db-id',_0x3666a4(0x104));const _0x140cef=await listDatabases(_0x55d6e9[_0x3666a4(0x10d)])[_0x3666a4(0x10f)](()=>[]);if(_0x140cef[_0x3666a4(0x113)]===0x1)return{'dbId':_0x140cef[0x0][_0x3666a4(0x13c)],'dbName':_0x140cef[0x0]['dbName']};if(_0x140cef[_0x3666a4(0x113)]>0x1){const _0xe234e6=await select({'message':'Select\x20the\x20target\x20database:','choices':[..._0x140cef[_0x3666a4(0x143)](_0x3ba4f6=>({'name':_0x3ba4f6[_0x3666a4(0x122)]+'\x20('+_0x3ba4f6[_0x3666a4(0x13c)]+')','value':serializeDbSelection(_0x3ba4f6)})),{'name':_0x3666a4(0x11f),'value':_0x3666a4(0x120)}]});if(_0xe234e6!==_0x3666a4(0x120))return deserializeDbSelection(_0xe234e6);}const _0x106920=await input({'message':_0x3666a4(0x115),'validate':_0x44dd2c=>{const _0x3d5687=_0x3666a4,_0x535266=_0x44dd2c[_0x3d5687(0x110)]();if(!_0x535266)return _0x3d5687(0x10c);const _0x400813=Number(_0x535266);if(!Number['isInteger'](_0x400813)||_0x400813<=0x0)return _0x3d5687(0x107);return!![];}});return{'dbId':Number(_0x106920[_0x3666a4(0x110)]())};}function a247_0x5a08(){const _0x238697=['write','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','SELECT\x201\x20AS\x20id;','Local\x20SQL\x20file\x20mode','File\x20already\x20exists:\x20','1316kYtKQo','flagMissing','description','1DsBgHO','SQL\x20query\x20display\x20name','310rxUlUr','SQL\x20name\x20cannot\x20be\x20empty','dbId','1422134sjKRwE','mode','2709318ZdOIeb','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','Created\x20SQL\x20query\x20','MyBatis\x20XML\x20(mybatisXml)','map','193655ErZZQN','20523996TsbQCk','utf8','toISOString','sqlName','parse','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','flag','Select\x20the\x20local\x20SQL\x20mode:','dbId\x20must\x20be\x20a\x20positive\x20integer','nonInteractive','For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly','9729495gzcIhL','<server-generated-sqlCode>','dbId\x20cannot\x20be\x20empty','appCode','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','catch','trim','152HTyIWm','create','length','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','Target\x20database\x20dbId:','name','1260nYXjLh','70268mdaUzj','mybatisXml','Plain\x20SQL\x20(sql)','5WTnOKJ','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','join','Target\x20database\x20ID','✎\x20Enter\x20dbId\x20manually','__manual__','isFinite','dbName','\x20\x20SELECT\x201\x20AS\x20id','db-id','str','sqlRoot','sqlCode','sqlRootDir','sql','stringify','string','number','Invalid\x20database\x20selection\x20payload:\x20','</select>','lastSync'];a247_0x5a08=function(){return _0x238697;};return a247_0x5a08();}async function resolveSqlModeInput(_0x118ef4){const _0x3fdefd=a247_0x23c4da,_0x5d61e5=_0x118ef4[_0x3fdefd(0x125)]('mode')['trim']();if(_0x5d61e5==='sql'||_0x5d61e5===_0x3fdefd(0x119))return _0x5d61e5;if(_0x118ef4[_0x3fdefd(0x108)])throw CliErrors[_0x3fdefd(0x136)]('mode',_0x3fdefd(0x11c));return await select({'message':_0x3fdefd(0x106),'choices':[{'name':_0x3fdefd(0x11a),'value':_0x3fdefd(0x129),'description':_0x3fdefd(0x109)},{'name':_0x3fdefd(0x142),'value':'mybatisXml','description':_0x3fdefd(0x131)}]});}function serializeDbSelection(_0x3fec29){const _0x55833a=a247_0x23c4da;return JSON[_0x55833a(0x12a)]({'dbId':_0x3fec29['dbId'],'dbName':_0x3fec29['dbName']});}function deserializeDbSelection(_0x373d81){const _0xb2a11=a247_0x23c4da;try{const _0x5cc218=JSON[_0xb2a11(0x103)](_0x373d81);if(typeof _0x5cc218[_0xb2a11(0x13c)]===_0xb2a11(0x12c)&&Number[_0xb2a11(0x121)](_0x5cc218[_0xb2a11(0x13c)]))return{'dbId':_0x5cc218['dbId'],'dbName':_0x5cc218[_0xb2a11(0x122)]};}catch{}throw CliErrors['validation'](_0xb2a11(0x12d)+_0x373d81);}function a247_0x131c(_0x5a5b36,_0x5e5000){_0x5a5b36=_0x5a5b36-0x103;const _0x5a08ec=a247_0x5a08();let _0x131c46=_0x5a08ec[_0x5a5b36];return _0x131c46;}function resolveProvidedDbId(_0x5aee3b){const _0x5d90c0=a247_0x23c4da,_0x126a5b=_0x5aee3b[_0x5d90c0(0x105)](_0x5d90c0(0x124));if(typeof _0x126a5b==='number'&&Number[_0x5d90c0(0x121)](_0x126a5b))return _0x126a5b;return undefined;}
@@ -1 +1 @@
1
- const a248_0x3df418=a248_0x3fce;(function(_0x523eaf,_0x550495){const _0x4b2d74=a248_0x3fce,_0x3e9769=_0x523eaf();while(!![]){try{const _0x4fa439=-parseInt(_0x4b2d74(0x7a))/0x1*(parseInt(_0x4b2d74(0x81))/0x2)+-parseInt(_0x4b2d74(0x8d))/0x3*(parseInt(_0x4b2d74(0x84))/0x4)+-parseInt(_0x4b2d74(0x86))/0x5+-parseInt(_0x4b2d74(0x99))/0x6*(-parseInt(_0x4b2d74(0x9c))/0x7)+parseInt(_0x4b2d74(0x98))/0x8*(-parseInt(_0x4b2d74(0x83))/0x9)+parseInt(_0x4b2d74(0x92))/0xa+parseInt(_0x4b2d74(0x8a))/0xb;if(_0x4fa439===_0x550495)break;else _0x3e9769['push'](_0x3e9769['shift']());}catch(_0x45bb27){_0x3e9769['push'](_0x3e9769['shift']());}}}(a248_0x49fd,0x7bc30));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';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';function a248_0x3fce(_0x24c694,_0xd3e26b){_0x24c694=_0x24c694-0x78;const _0x49fdea=a248_0x49fd();let _0x3fcef9=_0x49fdea[_0x24c694];return _0x3fcef9;}export const sqlDelete={'service':'sql','command':a248_0x3df418(0x8b),'description':a248_0x3df418(0x91),'risk':a248_0x3df418(0x79),'flags':[SQLCODE_FLAG],async 'validate'(_0x1c9cdc){const _0x1ad229=a248_0x3df418,_0x2fc260=loadSqlProjectConfig(_0x1c9cdc['appCode']),_0x20de76=await readSqlLockFile(_0x2fc260['lockFilePath']);if(!_0x20de76)throw CliErrors[_0x1ad229(0x7d)](_0x1ad229(0x8f));},async 'dryRun'(_0x4a477b){const _0xa3e3e6=a248_0x3df418,_0xac896f=loadSqlProjectConfig(_0x4a477b[_0xa3e3e6(0x9d)]),_0x3410d4=await readSqlLockFile(_0xac896f[_0xa3e3e6(0x93)]);if(!_0x3410d4)throw CliErrors[_0xa3e3e6(0x7d)](_0xa3e3e6(0x8f));const {appLock:_0x4a1ae5}=ensureSqlLockScope(_0x3410d4,_0x4a477b[_0xa3e3e6(0x9d)],_0xac896f[_0xa3e3e6(0x87)],_0xa3e3e6(0x8b)),_0x1b24fb=_0x4a477b[_0xa3e3e6(0x85)](_0xa3e3e6(0x97)),_0x2c560b=_0x4a1ae5[_0xa3e3e6(0x7e)][_0x1b24fb];if(!_0x2c560b)throw CliErrors[_0xa3e3e6(0x7d)]('No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22'+_0x1b24fb+'\x22.');return{'method':_0xa3e3e6(0x94),'url':'/smartapi/custom/deleteUserCustomSql','body':{'sqlCode':_0x1b24fb,'id':_0x2c560b[_0xa3e3e6(0x7c)],'localPath':resolveLocalSqlFilePath(_0xac896f,_0x1b24fb,_0x2c560b)},'description':_0xa3e3e6(0x8e)+_0x1b24fb+'\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20'+_0xac896f[_0xa3e3e6(0x95)]};},async 'execute'(_0x567f73){const _0x34cd94=a248_0x3df418,_0x22fe7c=loadSqlProjectConfig(_0x567f73['appCode']),_0xc9c94c=await readSqlLockFile(_0x22fe7c[_0x34cd94(0x93)]);if(!_0xc9c94c)throw CliErrors[_0x34cd94(0x7d)](_0x34cd94(0x8c));const {lockData:_0x544793,appLock:_0x123ca9}=ensureSqlLockScope(_0xc9c94c,_0x567f73[_0x34cd94(0x9d)],_0x22fe7c['sqlRoot'],'delete'),_0x3cc191=_0x567f73['str'](_0x34cd94(0x97)),_0xfc5a23=_0x123ca9['sqls'][_0x3cc191];if(!_0xfc5a23)throw CliErrors[_0x34cd94(0x7d)](_0x34cd94(0x96)+_0x3cc191+'\x22.');await deleteSqlQuery({'id':_0xfc5a23['remoteId'],'sqlCode':_0x3cc191}),_0x123ca9[_0x34cd94(0x7e)]=Object[_0x34cd94(0x7f)](Object['entries'](_0x123ca9['sqls'])[_0x34cd94(0x80)](([_0x1effc4])=>_0x1effc4!==_0x3cc191)),_0x123ca9[_0x34cd94(0x7b)]=new Date()['toISOString'](),await writeSqlLockFile(_0x22fe7c[_0x34cd94(0x93)],_0x544793);const _0x138b99=resolveLocalSqlFilePath(_0x22fe7c,_0x3cc191,_0xfc5a23);let _0x5416c3;await fileExists(_0x138b99)&&(_0x5416c3=await moveToTrash(_0x22fe7c[_0x34cd94(0x9b)],_0x22fe7c[_0x34cd94(0x95)],_0x138b99),await cleanupEmptyDirectories(dirname(_0x138b99),_0x22fe7c['sqlRootDir']));const _0x2391e1={'deleted':_0x3cc191,'remoteId':_0xfc5a23[_0x34cd94(0x7c)]};if(_0x5416c3)_0x2391e1[_0x34cd94(0x82)]=_0x5416c3;return{'ok':!![],'data':_0x2391e1,'message':_0x34cd94(0x90)+_0x3cc191+(_0x5416c3?_0x34cd94(0x78):'')};}};async function moveToTrash(_0x231faa,_0x578969,_0x237cfb){const _0x39ebe3=a248_0x3df418,_0x1bb164=new Date()[_0x39ebe3(0x9a)]()['replace'](/[:.]/g,'-'),_0x45c492=relative(_0x231faa,_0x237cfb),_0x591359=join(_0x578969,_0x1bb164,_0x45c492);return await mkdir(dirname(_0x591359),{'recursive':!![]}),await rename(_0x237cfb,_0x591359),_0x591359;}function a248_0x49fd(){const _0x1c447e=['lastSync','remoteId','validation','sqls','fromEntries','filter','1910752DOvVjC','trashedTo','9cpaEIO','4QDrCdw','str','3101915nGImLf','sqlRoot','startsWith','length','22605506dzoczx','delete','SQL\x20lock\x20file\x20not\x20found.','88401cZNOpA','Would\x20delete\x20SQL\x20','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','Deleted\x20','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','5363810XxlKLS','lockFilePath','POST','trashDir','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','sqlcode','4379448eVvSrv','636yoyYKF','toISOString','projectRoot','4501yJNVqS','appCode','\x20(local\x20file\x20moved\x20to\x20trash)','high-risk-write','1fyzWsA'];a248_0x49fd=function(){return _0x1c447e;};return a248_0x49fd();}async function cleanupEmptyDirectories(_0x16312e,_0x1078c5){const _0x17ee28=a248_0x3df418;let _0x479165=resolve(_0x16312e);const _0x3b2c19=resolve(_0x1078c5);while(_0x479165[_0x17ee28(0x88)](''+_0x3b2c19+sep)||_0x479165===_0x3b2c19){if(_0x479165===_0x3b2c19)return;try{const _0x2371fb=await readdir(_0x479165);if(_0x2371fb[_0x17ee28(0x89)]>0x0)return;await rmdir(_0x479165);}catch{return;}_0x479165=dirname(_0x479165);}}
1
+ const a248_0x49093f=a248_0x1526;function a248_0x1526(_0x1924bf,_0x5588ca){_0x1924bf=_0x1924bf-0x18d;const _0x3ac6b7=a248_0x3ac6();let _0x152678=_0x3ac6b7[_0x1924bf];return _0x152678;}(function(_0x168900,_0x4f353d){const _0x315d77=a248_0x1526,_0x3f641f=_0x168900();while(!![]){try{const _0x27e2e2=-parseInt(_0x315d77(0x196))/0x1+parseInt(_0x315d77(0x1a7))/0x2*(-parseInt(_0x315d77(0x19d))/0x3)+-parseInt(_0x315d77(0x1b2))/0x4+parseInt(_0x315d77(0x198))/0x5*(parseInt(_0x315d77(0x191))/0x6)+-parseInt(_0x315d77(0x1a3))/0x7*(-parseInt(_0x315d77(0x1ad))/0x8)+parseInt(_0x315d77(0x194))/0x9+-parseInt(_0x315d77(0x19b))/0xa*(-parseInt(_0x315d77(0x18e))/0xb);if(_0x27e2e2===_0x4f353d)break;else _0x3f641f['push'](_0x3f641f['shift']());}catch(_0x16cea7){_0x3f641f['push'](_0x3f641f['shift']());}}}(a248_0x3ac6,0x7939d));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a248_0x3ac6(){const _0x17a70a=['7kmTOME','POST','fromEntries','remoteId','34xDAHBK','Would\x20delete\x20SQL\x20','delete','projectRoot','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','filter','3141592hRYbnm','toISOString','sqlRootDir','sqlRoot','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','3557404rNfIZf','trashDir','898502Xsjyoj','replace','sqlcode','41052aNttke','length','validation','8078229HlIiqh','lastSync','374171crddaa','appCode','685qLThmF','entries','high-risk-write','10bEuUdD','sqls','96927RrJhHi','/smartapi/custom/deleteUserCustomSql','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','str','lockFilePath','startsWith'];a248_0x3ac6=function(){return _0x17a70a;};return a248_0x3ac6();}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':'sql','command':'delete','description':'Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','risk':a248_0x49093f(0x19a),'flags':[SQLCODE_FLAG],async 'validate'(_0x6ff45f){const _0x3b7ede=a248_0x49093f,_0x3cdeec=loadSqlProjectConfig(_0x6ff45f[_0x3b7ede(0x197)]),_0x3ae53d=await readSqlLockFile(_0x3cdeec[_0x3b7ede(0x1a1)]);if(!_0x3ae53d)throw CliErrors[_0x3b7ede(0x193)](_0x3b7ede(0x1ab));},async 'dryRun'(_0x167249){const _0x4d3f87=a248_0x49093f,_0x4a62ca=loadSqlProjectConfig(_0x167249[_0x4d3f87(0x197)]),_0x2b371f=await readSqlLockFile(_0x4a62ca['lockFilePath']);if(!_0x2b371f)throw CliErrors[_0x4d3f87(0x193)](_0x4d3f87(0x1ab));const {appLock:_0x1ca0be}=ensureSqlLockScope(_0x2b371f,_0x167249[_0x4d3f87(0x197)],_0x4a62ca[_0x4d3f87(0x1b0)],_0x4d3f87(0x1a9)),_0x3bca78=_0x167249[_0x4d3f87(0x1a0)](_0x4d3f87(0x190)),_0x505bae=_0x1ca0be[_0x4d3f87(0x19c)][_0x3bca78];if(!_0x505bae)throw CliErrors[_0x4d3f87(0x193)](_0x4d3f87(0x1b1)+_0x3bca78+'\x22.');return{'method':_0x4d3f87(0x1a4),'url':_0x4d3f87(0x19e),'body':{'sqlCode':_0x3bca78,'id':_0x505bae[_0x4d3f87(0x1a6)],'localPath':resolveLocalSqlFilePath(_0x4a62ca,_0x3bca78,_0x505bae)},'description':_0x4d3f87(0x1a8)+_0x3bca78+_0x4d3f87(0x19f)+_0x4a62ca[_0x4d3f87(0x18d)]};},async 'execute'(_0x3d6eeb){const _0x2a19cc=a248_0x49093f,_0x5c38a7=loadSqlProjectConfig(_0x3d6eeb[_0x2a19cc(0x197)]),_0xb3042=await readSqlLockFile(_0x5c38a7[_0x2a19cc(0x1a1)]);if(!_0xb3042)throw CliErrors[_0x2a19cc(0x193)]('SQL\x20lock\x20file\x20not\x20found.');const {lockData:_0x1b3a11,appLock:_0x2ee96d}=ensureSqlLockScope(_0xb3042,_0x3d6eeb[_0x2a19cc(0x197)],_0x5c38a7[_0x2a19cc(0x1b0)],'delete'),_0x44b4eb=_0x3d6eeb[_0x2a19cc(0x1a0)]('sqlcode'),_0x1ee187=_0x2ee96d[_0x2a19cc(0x19c)][_0x44b4eb];if(!_0x1ee187)throw CliErrors[_0x2a19cc(0x193)]('No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22'+_0x44b4eb+'\x22.');await deleteSqlQuery({'id':_0x1ee187[_0x2a19cc(0x1a6)],'sqlCode':_0x44b4eb}),_0x2ee96d['sqls']=Object[_0x2a19cc(0x1a5)](Object[_0x2a19cc(0x199)](_0x2ee96d[_0x2a19cc(0x19c)])[_0x2a19cc(0x1ac)](([_0x16af45])=>_0x16af45!==_0x44b4eb)),_0x2ee96d[_0x2a19cc(0x195)]=new Date()[_0x2a19cc(0x1ae)](),await writeSqlLockFile(_0x5c38a7[_0x2a19cc(0x1a1)],_0x1b3a11);const _0x504579=resolveLocalSqlFilePath(_0x5c38a7,_0x44b4eb,_0x1ee187);let _0x573e92;await fileExists(_0x504579)&&(_0x573e92=await moveToTrash(_0x5c38a7[_0x2a19cc(0x1aa)],_0x5c38a7[_0x2a19cc(0x18d)],_0x504579),await cleanupEmptyDirectories(dirname(_0x504579),_0x5c38a7[_0x2a19cc(0x1af)]));const _0x1d3982={'deleted':_0x44b4eb,'remoteId':_0x1ee187['remoteId']};if(_0x573e92)_0x1d3982['trashedTo']=_0x573e92;return{'ok':!![],'data':_0x1d3982,'message':'Deleted\x20'+_0x44b4eb+(_0x573e92?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};async function moveToTrash(_0x1ac90d,_0x1362cd,_0x25a63b){const _0x38d230=a248_0x49093f,_0x4fbb41=new Date()['toISOString']()[_0x38d230(0x18f)](/[:.]/g,'-'),_0x53d275=relative(_0x1ac90d,_0x25a63b),_0x36e69d=join(_0x1362cd,_0x4fbb41,_0x53d275);return await mkdir(dirname(_0x36e69d),{'recursive':!![]}),await rename(_0x25a63b,_0x36e69d),_0x36e69d;}async function cleanupEmptyDirectories(_0x42168c,_0x230a4b){const _0x37a56c=a248_0x49093f;let _0x399687=resolve(_0x42168c);const _0x2dcd8c=resolve(_0x230a4b);while(_0x399687[_0x37a56c(0x1a2)](''+_0x2dcd8c+sep)||_0x399687===_0x2dcd8c){if(_0x399687===_0x2dcd8c)return;try{const _0x422504=await readdir(_0x399687);if(_0x422504[_0x37a56c(0x192)]>0x0)return;await rmdir(_0x399687);}catch{return;}_0x399687=dirname(_0x399687);}}
@@ -1 +1 @@
1
- const a249_0x2358b1=a249_0x6be0;(function(_0x51785c,_0x113762){const _0x35f285=a249_0x6be0,_0x5ec8c0=_0x51785c();while(!![]){try{const _0x1cff1e=-parseInt(_0x35f285(0x1a7))/0x1*(-parseInt(_0x35f285(0x1b2))/0x2)+-parseInt(_0x35f285(0x1b7))/0x3+parseInt(_0x35f285(0x1a4))/0x4+parseInt(_0x35f285(0x1bb))/0x5*(parseInt(_0x35f285(0x1b5))/0x6)+-parseInt(_0x35f285(0x1aa))/0x7+parseInt(_0x35f285(0x1b9))/0x8+-parseInt(_0x35f285(0x1b0))/0x9;if(_0x1cff1e===_0x113762)break;else _0x5ec8c0['push'](_0x5ec8c0['shift']());}catch(_0x49a412){_0x5ec8c0['push'](_0x5ec8c0['shift']());}}}(a249_0x290e,0x831e2));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a249_0x290e(){const _0xa1d56c=['3712856qvxcEP','appCode','bool','sqlContent','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','verbose','7623108teWkPM','str','62XcbLFs','Return\x20full\x20raw\x20SQL\x20query\x20object','sql','250266WEmAmt','read','1614150CaXCmR','detail','7191672dPmaew','description','85YNtTsy','3291748QyJufS','boolean','sqlName','695xrwcpz','dbId','sqlcode'];a249_0x290e=function(){return _0xa1d56c;};return a249_0x290e();}function a249_0x6be0(_0x370a57,_0x15da48){_0x370a57=_0x370a57-0x1a4;const _0x290ee0=a249_0x290e();let _0x6be0ea=_0x290ee0[_0x370a57];return _0x6be0ea;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a249_0x2358b1(0x1b4),'command':a249_0x2358b1(0x1b8),'description':a249_0x2358b1(0x1ae),'risk':a249_0x2358b1(0x1b6),'flags':[SQLCODE_FLAG,{'name':a249_0x2358b1(0x1af),'type':a249_0x2358b1(0x1a5),'description':a249_0x2358b1(0x1b3)}],async 'execute'(_0x1c410e){const _0x11934f=a249_0x2358b1,_0x283b2c=await getSqlQueryInfo(_0x1c410e[_0x11934f(0x1ab)],_0x1c410e[_0x11934f(0x1b1)](_0x11934f(0x1a9))),_0x79ede5=_0x1c410e[_0x11934f(0x1ac)]('verbose');if(_0x79ede5)return{'ok':!![],'data':_0x283b2c};const _0xa0b80d=_0x283b2c[_0x11934f(0x1a8)]?await getDbName(_0x1c410e[_0x11934f(0x1ab)],_0x283b2c[_0x11934f(0x1a8)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x283b2c['sqlCode'],'sqlName':_0x283b2c[_0x11934f(0x1a6)],'db':_0xa0b80d?_0xa0b80d+'\x20('+_0x283b2c[_0x11934f(0x1a8)]+')':_0x283b2c[_0x11934f(0x1a8)]??'','description':_0x283b2c[_0x11934f(0x1ba)]??'','sqlContent':_0x283b2c[_0x11934f(0x1ad)]??''}};}};
1
+ function a249_0x51e0(_0xd4ef64,_0x47a89c){_0xd4ef64=_0xd4ef64-0x8c;const _0x24c7e9=a249_0x24c7();let _0x51e03f=_0x24c7e9[_0xd4ef64];return _0x51e03f;}const a249_0x157550=a249_0x51e0;(function(_0x4b940b,_0x117e51){const _0x451d64=a249_0x51e0,_0x41a2d1=_0x4b940b();while(!![]){try{const _0x3c169b=-parseInt(_0x451d64(0x91))/0x1+-parseInt(_0x451d64(0x9c))/0x2*(parseInt(_0x451d64(0x9b))/0x3)+parseInt(_0x451d64(0x93))/0x4+parseInt(_0x451d64(0x95))/0x5+parseInt(_0x451d64(0x8f))/0x6+-parseInt(_0x451d64(0x9e))/0x7+parseInt(_0x451d64(0x8c))/0x8;if(_0x3c169b===_0x117e51)break;else _0x41a2d1['push'](_0x41a2d1['shift']());}catch(_0x1b6030){_0x41a2d1['push'](_0x41a2d1['shift']());}}}(a249_0x24c7,0xab3c8));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a249_0x24c7(){const _0xf04ba0=['boolean','1085208WFttLV','detail','125499GvEbdw','description','5014008SefNKG','Return\x20full\x20raw\x20SQL\x20query\x20object','6035265CpjQmT','sqlContent','dbId','verbose','sql','str','6pPXbAf','965778NeBnFk','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','6328371ChzJJS','bool','sqlcode','442328uTzCcR','read'];a249_0x24c7=function(){return _0xf04ba0;};return a249_0x24c7();}export const sqlDetail={'service':a249_0x157550(0x99),'command':a249_0x157550(0x90),'description':a249_0x157550(0x9d),'risk':a249_0x157550(0x8d),'flags':[SQLCODE_FLAG,{'name':'verbose','type':a249_0x157550(0x8e),'description':a249_0x157550(0x94)}],async 'execute'(_0x5857c9){const _0x10da92=a249_0x157550,_0x24adc8=await getSqlQueryInfo(_0x5857c9['appCode'],_0x5857c9[_0x10da92(0x9a)](_0x10da92(0xa0))),_0x4c53b4=_0x5857c9[_0x10da92(0x9f)](_0x10da92(0x98));if(_0x4c53b4)return{'ok':!![],'data':_0x24adc8};const _0x38f322=_0x24adc8[_0x10da92(0x97)]?await getDbName(_0x5857c9['appCode'],_0x24adc8[_0x10da92(0x97)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x24adc8['sqlCode'],'sqlName':_0x24adc8['sqlName'],'db':_0x38f322?_0x38f322+'\x20('+_0x24adc8[_0x10da92(0x97)]+')':_0x24adc8[_0x10da92(0x97)]??'','description':_0x24adc8[_0x10da92(0x92)]??'','sqlContent':_0x24adc8[_0x10da92(0x96)]??''}};}};
@@ -1 +1 @@
1
- const a250_0x491de2=a250_0x24b5;(function(_0x219687,_0xca23c3){const _0x498692=a250_0x24b5,_0x3a4fc3=_0x219687();while(!![]){try{const _0x4080dd=-parseInt(_0x498692(0x17c))/0x1+parseInt(_0x498692(0x176))/0x2*(parseInt(_0x498692(0x17a))/0x3)+-parseInt(_0x498692(0x16c))/0x4+-parseInt(_0x498692(0x16b))/0x5*(-parseInt(_0x498692(0x183))/0x6)+parseInt(_0x498692(0x179))/0x7+-parseInt(_0x498692(0x174))/0x8*(-parseInt(_0x498692(0x172))/0x9)+parseInt(_0x498692(0x17d))/0xa*(parseInt(_0x498692(0x175))/0xb);if(_0x4080dd===_0xca23c3)break;else _0x3a4fc3['push'](_0x3a4fc3['shift']());}catch(_0x261e9a){_0x3a4fc3['push'](_0x3a4fc3['shift']());}}}(a250_0xb7c3,0xa1b66));function a250_0x24b5(_0x16deb1,_0x5b4175){_0x16deb1=_0x16deb1-0x16b;const _0xb7c388=a250_0xb7c3();let _0x24b53e=_0xb7c388[_0x16deb1];return _0x24b53e;}import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a250_0xb7c3(){const _0x3ea492=['execResult','958746syXXQW','isArray','5oLSigy','3229884jJYBEw','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','Returned\x20','read','params','exec','505854kSVhHi','execSuccess','32HbIJTl','77BwvzlJ','2yfOBGG','SQL\x20execution\x20failed','\x20row(s)\x20in\x20','272251CIjrCc','1002477haxavO','string','602849csqYAa','1878610sDgNsx','now','str','execError','sqlcode'];a250_0xb7c3=function(){return _0x3ea492;};return a250_0xb7c3();}import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':'sql','command':a250_0x491de2(0x171),'description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','risk':a250_0x491de2(0x16f),'flags':[SQLCODE_FLAG,{'name':a250_0x491de2(0x170),'type':a250_0x491de2(0x17b),'description':a250_0x491de2(0x16d)}],async 'execute'(_0x15bd1d){const _0x33e01f=a250_0x491de2,_0xf429c2=parseJsonParams(_0x15bd1d[_0x33e01f(0x17f)]('params')),_0x15eedb=Date[_0x33e01f(0x17e)](),_0x37d199=await executeSql(_0x15bd1d['appCode'],_0x15bd1d[_0x33e01f(0x17f)](_0x33e01f(0x181)),_0xf429c2),_0x4ca653=Date[_0x33e01f(0x17e)]()-_0x15eedb,_0x116e77=_0x37d199?.[_0x33e01f(0x182)]??_0x37d199,_0x268da5=_0x37d199?.[_0x33e01f(0x173)]??!![];if(!_0x268da5)return{'ok':![],'data':{'error':_0x37d199?.[_0x33e01f(0x180)]||_0x33e01f(0x177),'elapsed':_0x4ca653},'message':'SQL\x20execution\x20failed'};const _0xe8efcf=Array[_0x33e01f(0x184)](_0x116e77)?_0x116e77:[];return{'ok':!![],'data':{'rows':_0xe8efcf,'rowCount':_0xe8efcf['length'],'elapsed':_0x4ca653},'message':_0x33e01f(0x16e)+_0xe8efcf['length']+_0x33e01f(0x178)+_0x4ca653+'ms'};}};
1
+ const a250_0x59f96f=a250_0x6606;(function(_0x3c4996,_0x375460){const _0x5f5bb0=a250_0x6606,_0x5047a5=_0x3c4996();while(!![]){try{const _0x59de48=-parseInt(_0x5f5bb0(0x1a1))/0x1+parseInt(_0x5f5bb0(0x1a5))/0x2+parseInt(_0x5f5bb0(0x1ab))/0x3+parseInt(_0x5f5bb0(0x1a0))/0x4*(-parseInt(_0x5f5bb0(0x19f))/0x5)+parseInt(_0x5f5bb0(0x1a8))/0x6+-parseInt(_0x5f5bb0(0x19e))/0x7+parseInt(_0x5f5bb0(0x19c))/0x8;if(_0x59de48===_0x375460)break;else _0x5047a5['push'](_0x5047a5['shift']());}catch(_0x355a5d){_0x5047a5['push'](_0x5047a5['shift']());}}}(a250_0x2445,0xb32a1));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';function a250_0x6606(_0x1a9ff5,_0x14b3af){_0x1a9ff5=_0x1a9ff5-0x198;const _0x2445e1=a250_0x2445();let _0x660652=_0x2445e1[_0x1a9ff5];return _0x660652;}function a250_0x2445(){const _0x4d0073=['935936IPcTwu','execSuccess','length','3613320yhmidu','execResult','read','3389100NwsnrD','appCode','SQL\x20execution\x20failed','exec','Returned\x20','sqlcode','\x20row(s)\x20in\x20','6626304SHmWmq','sql','463540ogrUAG','115mDhfGD','205720JLZRUo','1045209DbnPBK','str','now','params'];a250_0x2445=function(){return _0x4d0073;};return a250_0x2445();}export const sqlExec={'service':a250_0x59f96f(0x19d),'command':a250_0x59f96f(0x198),'description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','risk':a250_0x59f96f(0x1aa),'flags':[SQLCODE_FLAG,{'name':a250_0x59f96f(0x1a4),'type':'string','description':'SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)'}],async 'execute'(_0x5dde47){const _0x3ca454=a250_0x59f96f,_0x2aaaf1=parseJsonParams(_0x5dde47['str'](_0x3ca454(0x1a4))),_0x2fec10=Date['now'](),_0x23f244=await executeSql(_0x5dde47[_0x3ca454(0x1ac)],_0x5dde47[_0x3ca454(0x1a2)](_0x3ca454(0x19a)),_0x2aaaf1),_0x54d731=Date[_0x3ca454(0x1a3)]()-_0x2fec10,_0x1b140e=_0x23f244?.[_0x3ca454(0x1a9)]??_0x23f244,_0xbeb177=_0x23f244?.[_0x3ca454(0x1a6)]??!![];if(!_0xbeb177)return{'ok':![],'data':{'error':_0x23f244?.['execError']||_0x3ca454(0x1ad),'elapsed':_0x54d731},'message':'SQL\x20execution\x20failed'};const _0x400de6=Array['isArray'](_0x1b140e)?_0x1b140e:[];return{'ok':!![],'data':{'rows':_0x400de6,'rowCount':_0x400de6[_0x3ca454(0x1a7)],'elapsed':_0x54d731},'message':_0x3ca454(0x199)+_0x400de6[_0x3ca454(0x1a7)]+_0x3ca454(0x19b)+_0x54d731+'ms'};}};
@@ -1 +1 @@
1
- (function(_0x37110f,_0x321789){const _0x588fdf=a251_0x2b96,_0x5c78c2=_0x37110f();while(!![]){try{const _0x7f5898=parseInt(_0x588fdf(0xdc))/0x1+parseInt(_0x588fdf(0xdd))/0x2+parseInt(_0x588fdf(0xd9))/0x3*(parseInt(_0x588fdf(0xd8))/0x4)+-parseInt(_0x588fdf(0xd7))/0x5+-parseInt(_0x588fdf(0xda))/0x6+-parseInt(_0x588fdf(0xde))/0x7+parseInt(_0x588fdf(0xdb))/0x8;if(_0x7f5898===_0x321789)break;else _0x5c78c2['push'](_0x5c78c2['shift']());}catch(_0x3d4840){_0x5c78c2['push'](_0x5c78c2['shift']());}}}(a251_0xcd6a,0x43f2d));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';function a251_0xcd6a(){const _0x598ef6=['889539CtWtpu','602115vTDpUU','8uNqnYb','58965twMZTL','1081650Wpewcp','2052648cOUqFq','334818DcrlUg','150766JuvSjy'];a251_0xcd6a=function(){return _0x598ef6;};return a251_0xcd6a();}function a251_0x2b96(_0x3fc200,_0x23ff95){_0x3fc200=_0x3fc200-0xd7;const _0xcd6a7e=a251_0xcd6a();let _0x2b96e4=_0xcd6a7e[_0x3fc200];return _0x2b96e4;}import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
1
+ (function(_0x30ce2e,_0x5bf229){const _0x1eae30=a251_0xff78,_0x2b4c4d=_0x30ce2e();while(!![]){try{const _0x1b28fb=parseInt(_0x1eae30(0x19c))/0x1*(parseInt(_0x1eae30(0x195))/0x2)+-parseInt(_0x1eae30(0x196))/0x3+-parseInt(_0x1eae30(0x197))/0x4+parseInt(_0x1eae30(0x19a))/0x5*(-parseInt(_0x1eae30(0x19b))/0x6)+-parseInt(_0x1eae30(0x199))/0x7*(parseInt(_0x1eae30(0x194))/0x8)+parseInt(_0x1eae30(0x193))/0x9+parseInt(_0x1eae30(0x198))/0xa;if(_0x1b28fb===_0x5bf229)break;else _0x2b4c4d['push'](_0x2b4c4d['shift']());}catch(_0x2c1125){_0x2b4c4d['push'](_0x2b4c4d['shift']());}}}(a251_0x543a,0x5a4b1));import{sqlList}from'../../commands/sql/list.js';function a251_0xff78(_0x16d99f,_0x59db94){_0x16d99f=_0x16d99f-0x193;const _0x543a45=a251_0x543a();let _0xff782a=_0x543a45[_0x16d99f];return _0xff782a;}import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';function a251_0x543a(){const _0x28823a=['1490eXzCnV','272430hlwrYi','142792UbEImo','5000930oeGtOF','77pEQiHs','10gOHNdn','1681368Adyaji','916oXtKrw','670329RZTiwp','145592WlCisc'];a251_0x543a=function(){return _0x28823a;};return a251_0x543a();}import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
@@ -1 +1 @@
1
- function a252_0x268d(_0x17a24,_0x91486f){_0x17a24=_0x17a24-0x1c4;const _0xc924f7=a252_0xc924();let _0x268dc1=_0xc924f7[_0x17a24];return _0x268dc1;}const a252_0xf44a16=a252_0x268d;function a252_0xc924(){const _0x43e0f1=['verbose','all','num','List\x20custom\x20SQL\x20queries','66849CAbfVD','487990dRGVcJ','str','map','sql','\x20SQL\x20queries\x20(total:\x20','read','bool','appCode','dbId','string','1702028eLYZqG','Page\x20number','tableData','203jtmWqX','9kGUULa','sqlCode','totalCount','length','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','7880895lesmmw','196408XYEEUc','No\x20custom\x20SQL\x20queries\x20found.','Page\x20size','number','sqlName','boolean','paging','page','sqlcode','6ppMLRp','Found\x20','2684545pxlkMc','pagesize','1CtYiyR','description','name','4xwjKfQ','26760540YIXDSG'];a252_0xc924=function(){return _0x43e0f1;};return a252_0xc924();}(function(_0x272e47,_0x2e0413){const _0x5f4ec2=a252_0x268d,_0x2e4eda=_0x272e47();while(!![]){try{const _0x2482da=-parseInt(_0x5f4ec2(0x1cb))/0x1*(-parseInt(_0x5f4ec2(0x1df))/0x2)+-parseInt(_0x5f4ec2(0x1d4))/0x3*(parseInt(_0x5f4ec2(0x1ce))/0x4)+-parseInt(_0x5f4ec2(0x1c9))/0x5*(-parseInt(_0x5f4ec2(0x1c7))/0x6)+parseInt(_0x5f4ec2(0x1e2))/0x7*(parseInt(_0x5f4ec2(0x1e9))/0x8)+parseInt(_0x5f4ec2(0x1e3))/0x9*(-parseInt(_0x5f4ec2(0x1d5))/0xa)+parseInt(_0x5f4ec2(0x1e8))/0xb+-parseInt(_0x5f4ec2(0x1cf))/0xc;if(_0x2482da===_0x2e0413)break;else _0x2e4eda['push'](_0x2e4eda['shift']());}catch(_0x39990a){_0x2e4eda['push'](_0x2e4eda['shift']());}}}(a252_0xc924,0x7dc94));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a252_0xf44a16(0x1d8),'command':'list','description':a252_0xf44a16(0x1d3),'risk':a252_0xf44a16(0x1da),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a252_0xf44a16(0x1cd),'type':a252_0xf44a16(0x1de),'description':'Filter\x20by\x20SQL\x20name'},{'name':a252_0xf44a16(0x1c5),'type':a252_0xf44a16(0x1ec),'description':a252_0xf44a16(0x1e0),'default':0x1},{'name':a252_0xf44a16(0x1ca),'type':a252_0xf44a16(0x1ec),'description':a252_0xf44a16(0x1eb)},{'name':'verbose','type':a252_0xf44a16(0x1ee),'description':a252_0xf44a16(0x1e7)}],async 'execute'(_0x15f414){const _0xb51bc=a252_0xf44a16,_0x58f266=await listSqlQueries(_0x15f414[_0xb51bc(0x1dc)],{'sqlCode':_0x15f414[_0xb51bc(0x1d6)](_0xb51bc(0x1c6))||undefined,'sqlName':_0x15f414[_0xb51bc(0x1d6)](_0xb51bc(0x1cd))||undefined,'currentPage':_0x15f414[_0xb51bc(0x1d2)](_0xb51bc(0x1c5)),'pageSize':_0x15f414['num'](_0xb51bc(0x1ca),0x32)}),_0x5cbe85=_0x15f414[_0xb51bc(0x1db)](_0xb51bc(0x1d0)),_0x3c727e=_0x58f266[_0xb51bc(0x1e1)]??[],_0x12f141=_0x58f266[_0xb51bc(0x1c4)]?.[_0xb51bc(0x1e5)]??_0x3c727e[_0xb51bc(0x1e6)];let _0x2b3b6c;return _0x5cbe85?_0x2b3b6c=_0x3c727e:_0x2b3b6c=await Promise[_0xb51bc(0x1d1)](_0x3c727e[_0xb51bc(0x1d7)](async _0x4150ba=>{const _0x560a79=_0xb51bc;let _0x3fffbf;try{_0x3fffbf=_0x4150ba['dbId']?await getDbName(_0x15f414[_0x560a79(0x1dc)],_0x4150ba[_0x560a79(0x1dd)]):undefined;}catch{}return{'sqlCode':_0x4150ba[_0x560a79(0x1e4)],'sqlName':_0x4150ba[_0x560a79(0x1ed)],'description':_0x4150ba[_0x560a79(0x1cc)]??'','db':_0x3fffbf?_0x3fffbf+'\x20('+_0x4150ba[_0x560a79(0x1dd)]+')':_0x4150ba[_0x560a79(0x1dd)]??''};})),{'ok':!![],'data':_0x2b3b6c,'message':_0x3c727e['length']===0x0?_0xb51bc(0x1ea):_0xb51bc(0x1c8)+_0x3c727e[_0xb51bc(0x1e6)]+_0xb51bc(0x1d9)+_0x12f141+').'};}};
1
+ const a252_0x2cb769=a252_0xc893;function a252_0x2516(){const _0x57ec6f=['1457198yLJIjI','map','21ERCvRu','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','Page\x20size','appCode','length','sqlName','3512331ulewIR','boolean','tableData','paging','sqlCode','pagesize','read','Page\x20number','9069168GhkHJs','618087eegGFb','name','number','str','num','30ApsNQO','273uEMJRa','Filter\x20by\x20SQL\x20name','1601870LIXAKQ','bool','dbId','\x20SQL\x20queries\x20(total:\x20','verbose','all','135570juEKPT','sqlcode','list','page','464652rsfdst'];a252_0x2516=function(){return _0x57ec6f;};return a252_0x2516();}(function(_0x48b951,_0x383768){const _0x33a7b0=a252_0xc893,_0x2fbcf3=_0x48b951();while(!![]){try{const _0x3344fb=-parseInt(_0x33a7b0(0x136))/0x1+-parseInt(_0x33a7b0(0x125))/0x2+parseInt(_0x33a7b0(0x127))/0x3*(parseInt(_0x33a7b0(0x124))/0x4)+-parseInt(_0x33a7b0(0x13e))/0x5+parseInt(_0x33a7b0(0x144))/0x6*(-parseInt(_0x33a7b0(0x13c))/0x7)+parseInt(_0x33a7b0(0x135))/0x8+parseInt(_0x33a7b0(0x12d))/0x9*(parseInt(_0x33a7b0(0x13b))/0xa);if(_0x3344fb===_0x383768)break;else _0x2fbcf3['push'](_0x2fbcf3['shift']());}catch(_0x544b61){_0x2fbcf3['push'](_0x2fbcf3['shift']());}}}(a252_0x2516,0x8afd3));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a252_0xc893(_0x350b88,_0x5513d3){_0x350b88=_0x350b88-0x121;const _0x2516e5=a252_0x2516();let _0xc89392=_0x2516e5[_0x350b88];return _0xc89392;}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':'sql','command':a252_0x2cb769(0x122),'description':'List\x20custom\x20SQL\x20queries','risk':a252_0x2cb769(0x133),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a252_0x2cb769(0x137),'type':'string','description':a252_0x2cb769(0x13d)},{'name':a252_0x2cb769(0x123),'type':'number','description':a252_0x2cb769(0x134),'default':0x1},{'name':a252_0x2cb769(0x132),'type':a252_0x2cb769(0x138),'description':a252_0x2cb769(0x129)},{'name':a252_0x2cb769(0x142),'type':a252_0x2cb769(0x12e),'description':a252_0x2cb769(0x128)}],async 'execute'(_0x358fdb){const _0x5c9e2d=a252_0x2cb769,_0x1b6ba4=await listSqlQueries(_0x358fdb['appCode'],{'sqlCode':_0x358fdb['str'](_0x5c9e2d(0x121))||undefined,'sqlName':_0x358fdb[_0x5c9e2d(0x139)](_0x5c9e2d(0x137))||undefined,'currentPage':_0x358fdb[_0x5c9e2d(0x13a)]('page'),'pageSize':_0x358fdb['num'](_0x5c9e2d(0x132),0x32)}),_0x2b3539=_0x358fdb[_0x5c9e2d(0x13f)]('verbose'),_0x16c945=_0x1b6ba4[_0x5c9e2d(0x12f)]??[],_0x4e3aa7=_0x1b6ba4[_0x5c9e2d(0x130)]?.['totalCount']??_0x16c945[_0x5c9e2d(0x12b)];let _0x209738;return _0x2b3539?_0x209738=_0x16c945:_0x209738=await Promise[_0x5c9e2d(0x143)](_0x16c945[_0x5c9e2d(0x126)](async _0x54219e=>{const _0x63e70=_0x5c9e2d;let _0x1c1f28;try{_0x1c1f28=_0x54219e['dbId']?await getDbName(_0x358fdb[_0x63e70(0x12a)],_0x54219e[_0x63e70(0x140)]):undefined;}catch{}return{'sqlCode':_0x54219e[_0x63e70(0x131)],'sqlName':_0x54219e[_0x63e70(0x12c)],'description':_0x54219e['description']??'','db':_0x1c1f28?_0x1c1f28+'\x20('+_0x54219e[_0x63e70(0x140)]+')':_0x54219e[_0x63e70(0x140)]??''};})),{'ok':!![],'data':_0x209738,'message':_0x16c945[_0x5c9e2d(0x12b)]===0x0?'No\x20custom\x20SQL\x20queries\x20found.':'Found\x20'+_0x16c945[_0x5c9e2d(0x12b)]+_0x5c9e2d(0x141)+_0x4e3aa7+').'};}};
@@ -1 +1 @@
1
- const a253_0x113200=a253_0x287d;(function(_0x5e5a45,_0xc02bf2){const _0x491977=a253_0x287d,_0x4446de=_0x5e5a45();while(!![]){try{const _0x342dc3=-parseInt(_0x491977(0x182))/0x1+parseInt(_0x491977(0x157))/0x2*(parseInt(_0x491977(0x16b))/0x3)+parseInt(_0x491977(0x153))/0x4+-parseInt(_0x491977(0x184))/0x5+-parseInt(_0x491977(0x155))/0x6*(parseInt(_0x491977(0x154))/0x7)+parseInt(_0x491977(0x169))/0x8*(-parseInt(_0x491977(0x14e))/0x9)+parseInt(_0x491977(0x170))/0xa*(parseInt(_0x491977(0x17f))/0xb);if(_0x342dc3===_0xc02bf2)break;else _0x4446de['push'](_0x4446de['shift']());}catch(_0x343967){_0x4446de['push'](_0x4446de['shift']());}}}(a253_0x48fa,0xdb3ef));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{detectSqlMode}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x426bbb,_0x35c980){const _0x2928f3=a253_0x287d,_0x2eb322=[];let _0x193cee=0x1;while(!![]){const _0x32eab0=await listSqlQueries(_0x426bbb,{'currentPage':_0x193cee,'pageSize':PAGE_SIZE,'sqlCode':_0x35c980[_0x2928f3(0x18e)],'sqlName':_0x35c980[_0x2928f3(0x162)]}),_0xe92d65=_0x32eab0['tableData']??[];_0x2eb322[_0x2928f3(0x185)](..._0xe92d65);if(_0xe92d65[_0x2928f3(0x172)]===0x0)break;const _0x1c5d2d=_0x32eab0['paging']?.[_0x2928f3(0x152)];if(_0x1c5d2d!=null?_0x2eb322[_0x2928f3(0x172)]>=_0x1c5d2d:_0xe92d65['length']<PAGE_SIZE)break;_0x193cee++;}return _0x2eb322;}async function ensureSqlContent(_0x55edc2){const _0x2f92ef=a253_0x287d;if(_0x55edc2['sqlContent']!=null&&String(_0x55edc2[_0x2f92ef(0x18a)])['length']>0x0)return _0x55edc2;return getSqlQueryDetail(_0x55edc2[_0x2f92ef(0x18e)]);}function a253_0x48fa(){const _0x21d344=['lockFilePath','string','POST','unchanged','replace','filePath','Filter\x20by\x20SQL\x20display\x20name','trim','appCode','boolean','sqlName','apps','dbId','some','sqlcode','\x20failed','isCanonical','120IHioQH','pull','2608437ujlMVZ','lastSync','path','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','content','13517260bHljEd','sqls','length','test','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','Force\x20pull\x20cancelled.','equivalent','description','catch','Force\x20overwrite\x20local\x20unsynced\x20changes','toISOString','No\x20remote\x20SQL\x20queries\x20matched.','skipped','str','mode','22OHSYMC','would_pull','cancelled','710817gemynB','Pull\x20complete:\x20','7792945eMBZtS','push','map','.xml','sqlRootDir','sql','sqlContent','mybatisXml','force','Would\x20pull\x20','sqlCode','nonInteractive','hash','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','sqlRoot','utf8','bool','conflict','\x20SQL\x20file(s)\x20into\x20','name','601362TLXpMs','join','message','file','totalCount','3495348oMOsAd','3227KkMWWG','3606AAysPi','find','2dioIVX'];a253_0x48fa=function(){return _0x21d344;};return a253_0x48fa();}export const sqlPull={'service':a253_0x113200(0x189),'command':a253_0x113200(0x16a),'description':a253_0x113200(0x174),'risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a253_0x113200(0x14d),'type':a253_0x113200(0x159),'description':a253_0x113200(0x15e)},{'name':a253_0x113200(0x18c),'type':a253_0x113200(0x161),'description':a253_0x113200(0x179)}],async 'dryRun'(_0x235b96){const _0x3e2f24=a253_0x113200,_0x8be9d1=loadSqlProjectConfig(_0x235b96['appCode']),_0x2d8b5e=await readSqlLockFile(_0x8be9d1[_0x3e2f24(0x158)]),{appLock:_0x28d7e7}=ensureSqlLockScope(_0x2d8b5e??createEmptySqlLock(),_0x8be9d1[_0x3e2f24(0x160)],_0x8be9d1[_0x3e2f24(0x148)],_0x3e2f24(0x16a)),_0x293cd0=await fetchAllSqlQueries(_0x235b96[_0x3e2f24(0x160)],{'sqlCode':_0x235b96[_0x3e2f24(0x17d)](_0x3e2f24(0x166))||undefined,'sqlName':_0x235b96[_0x3e2f24(0x17d)]('name')||undefined}),_0x113e80=[];for(const _0x5f2ec0 of _0x293cd0){const _0x266ebd=await ensureSqlContent(_0x5f2ec0),_0x8dc059=ensureRemoteSqlContent(_0x266ebd),_0x53a6c8=detectSqlMode(_0x8dc059),_0x44404e=_0x266ebd[_0x3e2f24(0x164)]?await getDbName(_0x235b96[_0x3e2f24(0x160)],Number(_0x266ebd[_0x3e2f24(0x164)]))['catch'](()=>undefined):undefined,_0xb145b3=buildLocalSqlFileContent({'sqlCode':_0x266ebd[_0x3e2f24(0x18e)],'sqlName':_0x266ebd['sqlName'],'dbId':_0x266ebd[_0x3e2f24(0x164)]},_0x8dc059,{'dbName':_0x44404e,'mode':_0x53a6c8,'syncedAt':new Date()[_0x3e2f24(0x17a)](),'description':_0x266ebd['description']}),_0x1fd4d9=buildSqlLockEntry(_0x266ebd,_0x8dc059,'',{'dbName':_0x44404e}),_0x3da1e2=resolveLocalSqlFilePath(_0x8be9d1,_0x266ebd[_0x3e2f24(0x18e)],_0x1fd4d9);let _0x45dbf7=_0x3e2f24(0x180),_0x3ccc38;const _0x144a2b=await findExistingSqlFiles(_0x8be9d1,_0x3da1e2,_0x53a6c8,_0x28d7e7['sqls'][_0x266ebd['sqlCode']]);if(_0x144a2b[_0x3e2f24(0x172)]>0x0){const _0x1e63b1=await compareExistingSqlFiles(_0x144a2b,_0xb145b3,_0x53a6c8);if(_0x1e63b1['some'](({equivalent:_0x22eee3})=>!_0x22eee3))_0x45dbf7=_0x3e2f24(0x14b),_0x3ccc38=_0x3e2f24(0x147);else _0x1e63b1[_0x3e2f24(0x172)]===0x1&&_0x1e63b1[0x0]?.[_0x3e2f24(0x151)]['isCanonical']&&(_0x45dbf7=_0x3e2f24(0x17c),_0x3ccc38=_0x3e2f24(0x15b));}_0x113e80[_0x3e2f24(0x185)]({'sqlCode':_0x266ebd[_0x3e2f24(0x18e)],'sqlName':_0x266ebd[_0x3e2f24(0x162)],'filePath':_0x3da1e2,'status':_0x45dbf7,'reason':_0x3ccc38});}return{'method':_0x3e2f24(0x15a),'url':_0x3e2f24(0x16e),'body':{'appCode':_0x235b96[_0x3e2f24(0x160)],'sqlCode':_0x235b96['str'](_0x3e2f24(0x166))||null,'sqlName':_0x235b96['str'](_0x3e2f24(0x14d))||null,'files':_0x113e80},'description':_0x3e2f24(0x18d)+_0x113e80[_0x3e2f24(0x172)]+_0x3e2f24(0x14c)+_0x8be9d1[_0x3e2f24(0x188)]};},async 'execute'(_0x2dd4f5){const _0x34a2f3=a253_0x113200,_0x438a1d=loadSqlProjectConfig(_0x2dd4f5[_0x34a2f3(0x160)]),_0x49a88e=await readSqlLockFile(_0x438a1d['lockFilePath']),{lockData:_0x1200ed,appLock:_0x126bcf}=ensureSqlLockScope(_0x49a88e??createEmptySqlLock(),_0x438a1d[_0x34a2f3(0x160)],_0x438a1d[_0x34a2f3(0x148)],_0x34a2f3(0x16a)),_0x4bb678=_0x2dd4f5[_0x34a2f3(0x14a)](_0x34a2f3(0x18c)),_0x55f346=await fetchAllSqlQueries(_0x2dd4f5[_0x34a2f3(0x160)],{'sqlCode':_0x2dd4f5[_0x34a2f3(0x17d)](_0x34a2f3(0x166))||undefined,'sqlName':_0x2dd4f5['str'](_0x34a2f3(0x14d))||undefined});if(_0x55f346[_0x34a2f3(0x172)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x34a2f3(0x17b)};const _0x3abec8=[],_0x4aadd7=[];for(const _0x1b7f8f of _0x55f346){try{_0x3abec8[_0x34a2f3(0x185)](await ensureSqlContent(_0x1b7f8f));}catch(_0x59ff32){_0x4aadd7['push']({'sqlCode':_0x1b7f8f[_0x34a2f3(0x18e)],'error':_0x59ff32 instanceof Error?_0x59ff32[_0x34a2f3(0x150)]:String(_0x59ff32)});}}if(_0x4bb678&&!_0x2dd4f5[_0x34a2f3(0x145)]){let _0x233d51=![];for(const _0x1dfde5 of _0x3abec8){const _0x43a323=detectSqlMode(ensureRemoteSqlContent(_0x1dfde5)),_0x48c93e=_0x1dfde5['dbId']?await getDbName(_0x2dd4f5[_0x34a2f3(0x160)],Number(_0x1dfde5['dbId']))['catch'](()=>undefined):undefined,_0x5979ae=buildLocalSqlFileContent({'sqlCode':_0x1dfde5['sqlCode'],'sqlName':_0x1dfde5[_0x34a2f3(0x162)],'dbId':_0x1dfde5[_0x34a2f3(0x164)]},ensureRemoteSqlContent(_0x1dfde5),{'dbName':_0x48c93e,'mode':_0x43a323,'syncedAt':new Date()[_0x34a2f3(0x17a)](),'description':_0x1dfde5['description']}),_0xb6abce=resolveLocalSqlFilePath(_0x438a1d,_0x1dfde5[_0x34a2f3(0x18e)],buildSqlLockEntry(_0x1dfde5,ensureRemoteSqlContent(_0x1dfde5),'',{'dbName':_0x48c93e})),_0x1804fd=await findExistingSqlFiles(_0x438a1d,_0xb6abce,_0x43a323,_0x126bcf[_0x34a2f3(0x171)][_0x1dfde5[_0x34a2f3(0x18e)]]),_0x3e3ef9=await compareExistingSqlFiles(_0x1804fd,_0x5979ae,_0x43a323);if(_0x3e3ef9[_0x34a2f3(0x165)](({equivalent:_0x2543b7})=>!_0x2543b7)){_0x233d51=!![];break;}}if(_0x233d51){const _0x3465b0=await confirmForceOverwrite('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.');if(!_0x3465b0)throw CliErrors[_0x34a2f3(0x181)](_0x34a2f3(0x175));}}const _0x520d3e=cloneSqlLockData(_0x1200ed),_0x457c0e=_0x520d3e[_0x34a2f3(0x163)][_0x438a1d[_0x34a2f3(0x160)]],_0x53df61=[],_0x3daeec=[];for(const _0x2b92c1 of _0x3abec8){const _0x14b4b7=_0x457c0e[_0x34a2f3(0x171)][_0x2b92c1['sqlCode']],_0x3a7a2f=ensureRemoteSqlContent(_0x2b92c1),_0x2b1940=detectSqlMode(_0x3a7a2f),_0x5a9eed=_0x2b92c1[_0x34a2f3(0x164)]?await getDbName(_0x2dd4f5[_0x34a2f3(0x160)],Number(_0x2b92c1['dbId']))[_0x34a2f3(0x178)](()=>undefined):undefined,_0x2b5108=buildLocalSqlFileContent({'sqlCode':_0x2b92c1['sqlCode'],'sqlName':_0x2b92c1[_0x34a2f3(0x162)],'dbId':_0x2b92c1[_0x34a2f3(0x164)]},_0x3a7a2f,{'dbName':_0x5a9eed,'mode':_0x2b1940,'syncedAt':new Date()['toISOString'](),'description':_0x2b92c1[_0x34a2f3(0x177)]}),_0x477606=buildSqlLockEntry(_0x2b92c1,_0x3a7a2f,computeSqlContentHash(_0x2b5108),{'dbName':_0x5a9eed}),_0x20d09e=_0x477606[_0x34a2f3(0x16d)],_0x2449e4=join(_0x438a1d[_0x34a2f3(0x188)],_0x20d09e);try{const _0x7f3797=await findExistingSqlFiles(_0x438a1d,_0x2449e4,_0x2b1940,_0x14b4b7),_0x425d8c=await compareExistingSqlFiles(_0x7f3797,_0x2b5108,_0x2b1940);if(!_0x4bb678&&_0x425d8c[_0x34a2f3(0x165)](({equivalent:_0x54c168})=>!_0x54c168)){_0x3daeec[_0x34a2f3(0x185)]({'sqlCode':_0x2b92c1[_0x34a2f3(0x18e)],'reason':'local\x20differs\x20from\x20remote'});continue;}const _0x188b3c=_0x425d8c[_0x34a2f3(0x156)](({file:_0x157ee})=>_0x157ee[_0x34a2f3(0x168)]),_0x494397=_0x425d8c[_0x34a2f3(0x156)](({file:_0x5b348e})=>!_0x5b348e[_0x34a2f3(0x168)]);if(_0x188b3c?.[_0x34a2f3(0x176)]&&!_0x494397){_0x3daeec[_0x34a2f3(0x185)]({'sqlCode':_0x2b92c1[_0x34a2f3(0x18e)],'reason':_0x34a2f3(0x15b)}),_0x457c0e[_0x34a2f3(0x171)][_0x2b92c1[_0x34a2f3(0x18e)]]={..._0x477606,'hash':computeSqlContentHash(_0x188b3c['content']),'path':_0x20d09e};continue;}!_0x188b3c?.[_0x34a2f3(0x176)]&&(await ensureParentDirectory(_0x2449e4),await writeFile(_0x2449e4,_0x2b5108,_0x34a2f3(0x149))),_0x494397&&await rm(_0x494397[_0x34a2f3(0x151)][_0x34a2f3(0x15d)],{'force':!![]}),_0x457c0e[_0x34a2f3(0x171)][_0x2b92c1[_0x34a2f3(0x18e)]]={..._0x477606,'hash':_0x188b3c?.['equivalent']?computeSqlContentHash(_0x188b3c[_0x34a2f3(0x16f)]):_0x477606[_0x34a2f3(0x146)],'path':_0x20d09e},_0x53df61['push']({'sqlCode':_0x2b92c1['sqlCode'],'filePath':_0x2449e4});}catch(_0x28338c){_0x4aadd7[_0x34a2f3(0x185)]({'sqlCode':_0x2b92c1['sqlCode'],'error':_0x28338c instanceof Error?_0x28338c[_0x34a2f3(0x150)]:String(_0x28338c)});}}return _0x457c0e[_0x34a2f3(0x16c)]=new Date()[_0x34a2f3(0x17a)](),await writeSqlLockFile(_0x438a1d[_0x34a2f3(0x158)],_0x520d3e),{'ok':_0x4aadd7[_0x34a2f3(0x172)]===0x0,'data':{'pulled':_0x53df61,'skipped':_0x3daeec,'failed':_0x4aadd7},'message':_0x34a2f3(0x183)+_0x53df61[_0x34a2f3(0x172)]+'\x20written,\x20'+_0x3daeec['length']+'\x20skipped,\x20'+_0x4aadd7[_0x34a2f3(0x172)]+_0x34a2f3(0x167)};}};function isEquivalentPulledSqlFile(_0x2718ae,_0x1daa75,_0xb0e41d,_0x10e147){if(_0xb0e41d!==_0x10e147)return normalizePulledSqlBody(_0x2718ae,_0xb0e41d)===normalizePulledSqlBody(_0x1daa75,_0x10e147);return normalizePullComparableContent(_0x2718ae,_0xb0e41d)===normalizePullComparableContent(_0x1daa75,_0x10e147);}async function findExistingSqlFiles(_0x3a0089,_0x3f8d90,_0x217f34,_0x3e8fa6){const _0xf909fe=a253_0x113200,_0x252595=[];await fileExists(_0x3f8d90)&&_0x252595[_0xf909fe(0x185)]({'filePath':_0x3f8d90,'mode':_0x217f34,'isCanonical':!![]});if(!_0x3e8fa6?.[_0xf909fe(0x16d)])return _0x252595;const _0x472ec2=join(_0x3a0089[_0xf909fe(0x188)],_0x3e8fa6[_0xf909fe(0x16d)]);if(_0x472ec2===_0x3f8d90)return _0x252595;return await fileExists(_0x472ec2)&&_0x252595[_0xf909fe(0x185)]({'filePath':_0x472ec2,'mode':_0x3e8fa6[_0xf909fe(0x17e)]??modeFromFilePath(_0x472ec2),'isCanonical':![]}),_0x252595;}async function compareExistingSqlFiles(_0x56057d,_0x45efe6,_0x258de8){const _0x13fba8=a253_0x113200;return Promise['all'](_0x56057d[_0x13fba8(0x186)](async _0x108caf=>{const _0x434f48=_0x13fba8,_0x489184=await readFile(_0x108caf[_0x434f48(0x15d)],_0x434f48(0x149));return{'file':_0x108caf,'content':_0x489184,'equivalent':isEquivalentPulledSqlFile(_0x489184,_0x45efe6,_0x108caf['mode'],_0x258de8)};}));}function modeFromFilePath(_0xbc1667){const _0x196c92=a253_0x113200;return _0xbc1667['toLowerCase']()['endsWith'](_0x196c92(0x187))?_0x196c92(0x18b):_0x196c92(0x189);}function a253_0x287d(_0x3bbbb8,_0x40b8b9){_0x3bbbb8=_0x3bbbb8-0x145;const _0x48fa6f=a253_0x48fa();let _0x287d6e=_0x48fa6f[_0x3bbbb8];return _0x287d6e;}function normalizePulledSqlBody(_0x3fb90a,_0x241bf5){const _0x4ff69c=a253_0x113200;return stripLocalSqlMetadata(_0x3fb90a,_0x241bf5)[_0x4ff69c(0x15c)](/\r\n/g,'\x0a')[_0x4ff69c(0x15f)]();}function normalizePullComparableContent(_0x38d341,_0x3a76b7){const _0x230759=a253_0x113200,_0x2d3866=_0x38d341['replace'](/\r\n/g,'\x0a')['split']('\x0a'),_0x254f24=_0x2d3866['filter'](_0x31a5ed=>!isSyncedAtMetadataLine(_0x31a5ed,_0x3a76b7));return _0x254f24[_0x230759(0x14f)]('\x0a');}function isSyncedAtMetadataLine(_0x457226,_0x103344){const _0x4c0ab4=a253_0x113200;if(_0x103344===_0x4c0ab4(0x18b))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x457226);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x4c0ab4(0x173)](_0x457226);}
1
+ const a253_0x1e67f3=a253_0x4366;(function(_0x54e302,_0x58ee71){const _0x100569=a253_0x4366,_0x1fb9c1=_0x54e302();while(!![]){try{const _0x9075b5=-parseInt(_0x100569(0xdd))/0x1+-parseInt(_0x100569(0x10b))/0x2+parseInt(_0x100569(0xde))/0x3*(parseInt(_0x100569(0xed))/0x4)+parseInt(_0x100569(0xe4))/0x5*(parseInt(_0x100569(0x109))/0x6)+parseInt(_0x100569(0x10e))/0x7+parseInt(_0x100569(0xf4))/0x8*(parseInt(_0x100569(0xf5))/0x9)+-parseInt(_0x100569(0x114))/0xa;if(_0x9075b5===_0x58ee71)break;else _0x1fb9c1['push'](_0x1fb9c1['shift']());}catch(_0x3c3861){_0x1fb9c1['push'](_0x1fb9c1['shift']());}}}(a253_0x29d8,0x97d12));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';function a253_0x29d8(){const _0x4dafea=['read','499510FXHwfD','3UJMAdZ','dbId','find','sql','trim','boolean','1350feUBJr','would_pull','unchanged','sqlName','test','apps','No\x20remote\x20SQL\x20queries\x20matched.','tableData','sqlContent','1877116dtcCfS','message','content','file','mybatisXml','local\x20differs\x20from\x20remote','endsWith','4735912SmcSKj','9LgDTZa','\x20failed','sqlRoot','lastSync','str','.xml','equivalent','path','Force\x20pull\x20cancelled.','filter','Force\x20overwrite\x20local\x20unsynced\x20changes','appCode','description','some','sqlCode','conflict','isCanonical','\x20written,\x20','toISOString','hash','8172hYLLez','force','779366MoJVVB','catch','string','4284399QAJvSJ','Pull\x20complete:\x20','split','totalCount','sqlcode','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','5300300cIPFbw','sqls','\x20SQL\x20file(s)\x20into\x20','lockFilePath','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','pull','POST','length','skipped','utf8','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','replace','nonInteractive','name','push','bool','sqlRootDir','mode'];a253_0x29d8=function(){return _0x4dafea;};return a253_0x29d8();}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';function a253_0x4366(_0x3546de,_0xd26feb){_0x3546de=_0x3546de-0xcb;const _0x29d884=a253_0x29d8();let _0x43665e=_0x29d884[_0x3546de];return _0x43665e;}import{detectSqlMode}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x1e4e26,_0x44ec1e){const _0x3aa413=a253_0x4366,_0x2c8c9e=[];let _0x21214d=0x1;while(!![]){const _0x359cbe=await listSqlQueries(_0x1e4e26,{'currentPage':_0x21214d,'pageSize':PAGE_SIZE,'sqlCode':_0x44ec1e['sqlCode'],'sqlName':_0x44ec1e[_0x3aa413(0xe7)]}),_0x5bfabe=_0x359cbe[_0x3aa413(0xeb)]??[];_0x2c8c9e[_0x3aa413(0xd8)](..._0x5bfabe);if(_0x5bfabe[_0x3aa413(0xd1)]===0x0)break;const _0x26ea79=_0x359cbe['paging']?.[_0x3aa413(0x111)];if(_0x26ea79!=null?_0x2c8c9e[_0x3aa413(0xd1)]>=_0x26ea79:_0x5bfabe[_0x3aa413(0xd1)]<PAGE_SIZE)break;_0x21214d++;}return _0x2c8c9e;}async function ensureSqlContent(_0x330ac8){const _0x14ce9f=a253_0x4366;if(_0x330ac8[_0x14ce9f(0xec)]!=null&&String(_0x330ac8[_0x14ce9f(0xec)])[_0x14ce9f(0xd1)]>0x0)return _0x330ac8;return getSqlQueryDetail(_0x330ac8[_0x14ce9f(0x103)]);}export const sqlPull={'service':a253_0x1e67f3(0xe1),'command':a253_0x1e67f3(0xcf),'description':'Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','risk':a253_0x1e67f3(0xdc),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a253_0x1e67f3(0xd7),'type':a253_0x1e67f3(0x10d),'description':'Filter\x20by\x20SQL\x20display\x20name'},{'name':a253_0x1e67f3(0x10a),'type':a253_0x1e67f3(0xe3),'description':a253_0x1e67f3(0xff)}],async 'dryRun'(_0xf30cc3){const _0x381ced=a253_0x1e67f3,_0x273639=loadSqlProjectConfig(_0xf30cc3[_0x381ced(0x100)]),_0x46d681=await readSqlLockFile(_0x273639[_0x381ced(0xcd)]),{appLock:_0x5d8eef}=ensureSqlLockScope(_0x46d681??createEmptySqlLock(),_0x273639['appCode'],_0x273639[_0x381ced(0xf7)],'pull'),_0xa84d4b=await fetchAllSqlQueries(_0xf30cc3[_0x381ced(0x100)],{'sqlCode':_0xf30cc3[_0x381ced(0xf9)](_0x381ced(0x112))||undefined,'sqlName':_0xf30cc3['str'](_0x381ced(0xd7))||undefined}),_0x42ce9a=[];for(const _0x5c144d of _0xa84d4b){const _0x2e59eb=await ensureSqlContent(_0x5c144d),_0x4ae43a=ensureRemoteSqlContent(_0x2e59eb),_0x5ab0be=detectSqlMode(_0x4ae43a),_0x520d4a=_0x2e59eb[_0x381ced(0xdf)]?await getDbName(_0xf30cc3[_0x381ced(0x100)],Number(_0x2e59eb[_0x381ced(0xdf)]))[_0x381ced(0x10c)](()=>undefined):undefined,_0x2a09ee=buildLocalSqlFileContent({'sqlCode':_0x2e59eb['sqlCode'],'sqlName':_0x2e59eb[_0x381ced(0xe7)],'dbId':_0x2e59eb['dbId']},_0x4ae43a,{'dbName':_0x520d4a,'mode':_0x5ab0be,'syncedAt':new Date()[_0x381ced(0x107)](),'description':_0x2e59eb[_0x381ced(0x101)]}),_0x4e62b8=buildSqlLockEntry(_0x2e59eb,_0x4ae43a,'',{'dbName':_0x520d4a}),_0x2baa5f=resolveLocalSqlFilePath(_0x273639,_0x2e59eb[_0x381ced(0x103)],_0x4e62b8);let _0x3bb179=_0x381ced(0xe5),_0x18279b;const _0x73b716=await findExistingSqlFiles(_0x273639,_0x2baa5f,_0x5ab0be,_0x5d8eef['sqls'][_0x2e59eb['sqlCode']]);if(_0x73b716[_0x381ced(0xd1)]>0x0){const _0x44b205=await compareExistingSqlFiles(_0x73b716,_0x2a09ee,_0x5ab0be);if(_0x44b205[_0x381ced(0x102)](({equivalent:_0x52966f})=>!_0x52966f))_0x3bb179=_0x381ced(0x104),_0x18279b=_0x381ced(0xce);else _0x44b205[_0x381ced(0xd1)]===0x1&&_0x44b205[0x0]?.['file'][_0x381ced(0x105)]&&(_0x3bb179=_0x381ced(0xd2),_0x18279b=_0x381ced(0xe6));}_0x42ce9a['push']({'sqlCode':_0x2e59eb[_0x381ced(0x103)],'sqlName':_0x2e59eb[_0x381ced(0xe7)],'filePath':_0x2baa5f,'status':_0x3bb179,'reason':_0x18279b});}return{'method':_0x381ced(0xd0),'url':_0x381ced(0x113),'body':{'appCode':_0xf30cc3['appCode'],'sqlCode':_0xf30cc3[_0x381ced(0xf9)](_0x381ced(0x112))||null,'sqlName':_0xf30cc3[_0x381ced(0xf9)]('name')||null,'files':_0x42ce9a},'description':'Would\x20pull\x20'+_0x42ce9a[_0x381ced(0xd1)]+_0x381ced(0xcc)+_0x273639[_0x381ced(0xda)]};},async 'execute'(_0x5449b0){const _0x5a5342=a253_0x1e67f3,_0x3d1b46=loadSqlProjectConfig(_0x5449b0[_0x5a5342(0x100)]),_0x489721=await readSqlLockFile(_0x3d1b46[_0x5a5342(0xcd)]),{lockData:_0x28f563,appLock:_0x1a3459}=ensureSqlLockScope(_0x489721??createEmptySqlLock(),_0x3d1b46[_0x5a5342(0x100)],_0x3d1b46[_0x5a5342(0xf7)],'pull'),_0x3cdfa3=_0x5449b0[_0x5a5342(0xd9)]('force'),_0x5dc565=await fetchAllSqlQueries(_0x5449b0[_0x5a5342(0x100)],{'sqlCode':_0x5449b0[_0x5a5342(0xf9)](_0x5a5342(0x112))||undefined,'sqlName':_0x5449b0[_0x5a5342(0xf9)](_0x5a5342(0xd7))||undefined});if(_0x5dc565[_0x5a5342(0xd1)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x5a5342(0xea)};const _0x5309ed=[],_0x20c24c=[];for(const _0xc5375d of _0x5dc565){try{_0x5309ed[_0x5a5342(0xd8)](await ensureSqlContent(_0xc5375d));}catch(_0x4b47e2){_0x20c24c[_0x5a5342(0xd8)]({'sqlCode':_0xc5375d[_0x5a5342(0x103)],'error':_0x4b47e2 instanceof Error?_0x4b47e2['message']:String(_0x4b47e2)});}}if(_0x3cdfa3&&!_0x5449b0[_0x5a5342(0xd6)]){let _0x9c640b=![];for(const _0x8fc1e5 of _0x5309ed){const _0x55b38a=detectSqlMode(ensureRemoteSqlContent(_0x8fc1e5)),_0x492496=_0x8fc1e5['dbId']?await getDbName(_0x5449b0[_0x5a5342(0x100)],Number(_0x8fc1e5[_0x5a5342(0xdf)]))[_0x5a5342(0x10c)](()=>undefined):undefined,_0x2669ff=buildLocalSqlFileContent({'sqlCode':_0x8fc1e5[_0x5a5342(0x103)],'sqlName':_0x8fc1e5[_0x5a5342(0xe7)],'dbId':_0x8fc1e5[_0x5a5342(0xdf)]},ensureRemoteSqlContent(_0x8fc1e5),{'dbName':_0x492496,'mode':_0x55b38a,'syncedAt':new Date()[_0x5a5342(0x107)](),'description':_0x8fc1e5[_0x5a5342(0x101)]}),_0x22e57b=resolveLocalSqlFilePath(_0x3d1b46,_0x8fc1e5['sqlCode'],buildSqlLockEntry(_0x8fc1e5,ensureRemoteSqlContent(_0x8fc1e5),'',{'dbName':_0x492496})),_0x35d3f4=await findExistingSqlFiles(_0x3d1b46,_0x22e57b,_0x55b38a,_0x1a3459[_0x5a5342(0xcb)][_0x8fc1e5['sqlCode']]),_0x5e49f8=await compareExistingSqlFiles(_0x35d3f4,_0x2669ff,_0x55b38a);if(_0x5e49f8[_0x5a5342(0x102)](({equivalent:_0xb5147f})=>!_0xb5147f)){_0x9c640b=!![];break;}}if(_0x9c640b){const _0x39efb2=await confirmForceOverwrite(_0x5a5342(0xd4));if(!_0x39efb2)throw CliErrors['cancelled'](_0x5a5342(0xfd));}}const _0x14dd09=cloneSqlLockData(_0x28f563),_0x50a486=_0x14dd09[_0x5a5342(0xe9)][_0x3d1b46[_0x5a5342(0x100)]],_0x147bb8=[],_0x4c5496=[];for(const _0x15ce43 of _0x5309ed){const _0x31b376=_0x50a486[_0x5a5342(0xcb)][_0x15ce43['sqlCode']],_0x5cfb91=ensureRemoteSqlContent(_0x15ce43),_0x1dd701=detectSqlMode(_0x5cfb91),_0x34f573=_0x15ce43[_0x5a5342(0xdf)]?await getDbName(_0x5449b0[_0x5a5342(0x100)],Number(_0x15ce43[_0x5a5342(0xdf)]))[_0x5a5342(0x10c)](()=>undefined):undefined,_0x2f2b28=buildLocalSqlFileContent({'sqlCode':_0x15ce43[_0x5a5342(0x103)],'sqlName':_0x15ce43[_0x5a5342(0xe7)],'dbId':_0x15ce43[_0x5a5342(0xdf)]},_0x5cfb91,{'dbName':_0x34f573,'mode':_0x1dd701,'syncedAt':new Date()[_0x5a5342(0x107)](),'description':_0x15ce43[_0x5a5342(0x101)]}),_0x128c03=buildSqlLockEntry(_0x15ce43,_0x5cfb91,computeSqlContentHash(_0x2f2b28),{'dbName':_0x34f573}),_0x2e8c92=_0x128c03[_0x5a5342(0xfc)],_0x49f59d=join(_0x3d1b46[_0x5a5342(0xda)],_0x2e8c92);try{const _0x49a1a9=await findExistingSqlFiles(_0x3d1b46,_0x49f59d,_0x1dd701,_0x31b376),_0x7114d7=await compareExistingSqlFiles(_0x49a1a9,_0x2f2b28,_0x1dd701);if(!_0x3cdfa3&&_0x7114d7['some'](({equivalent:_0x4476ac})=>!_0x4476ac)){_0x4c5496['push']({'sqlCode':_0x15ce43[_0x5a5342(0x103)],'reason':_0x5a5342(0xf2)});continue;}const _0x4435ec=_0x7114d7[_0x5a5342(0xe0)](({file:_0x4af0eb})=>_0x4af0eb['isCanonical']),_0x28bf4c=_0x7114d7[_0x5a5342(0xe0)](({file:_0x437580})=>!_0x437580[_0x5a5342(0x105)]);if(_0x4435ec?.[_0x5a5342(0xfb)]&&!_0x28bf4c){_0x4c5496['push']({'sqlCode':_0x15ce43[_0x5a5342(0x103)],'reason':_0x5a5342(0xe6)}),_0x50a486['sqls'][_0x15ce43[_0x5a5342(0x103)]]={..._0x128c03,'hash':computeSqlContentHash(_0x4435ec[_0x5a5342(0xef)]),'path':_0x2e8c92};continue;}!_0x4435ec?.[_0x5a5342(0xfb)]&&(await ensureParentDirectory(_0x49f59d),await writeFile(_0x49f59d,_0x2f2b28,_0x5a5342(0xd3))),_0x28bf4c&&await rm(_0x28bf4c[_0x5a5342(0xf0)]['filePath'],{'force':!![]}),_0x50a486['sqls'][_0x15ce43[_0x5a5342(0x103)]]={..._0x128c03,'hash':_0x4435ec?.['equivalent']?computeSqlContentHash(_0x4435ec[_0x5a5342(0xef)]):_0x128c03[_0x5a5342(0x108)],'path':_0x2e8c92},_0x147bb8[_0x5a5342(0xd8)]({'sqlCode':_0x15ce43[_0x5a5342(0x103)],'filePath':_0x49f59d});}catch(_0x1c8ded){_0x20c24c[_0x5a5342(0xd8)]({'sqlCode':_0x15ce43[_0x5a5342(0x103)],'error':_0x1c8ded instanceof Error?_0x1c8ded[_0x5a5342(0xee)]:String(_0x1c8ded)});}}return _0x50a486[_0x5a5342(0xf8)]=new Date()['toISOString'](),await writeSqlLockFile(_0x3d1b46[_0x5a5342(0xcd)],_0x14dd09),{'ok':_0x20c24c['length']===0x0,'data':{'pulled':_0x147bb8,'skipped':_0x4c5496,'failed':_0x20c24c},'message':_0x5a5342(0x10f)+_0x147bb8[_0x5a5342(0xd1)]+_0x5a5342(0x106)+_0x4c5496['length']+'\x20skipped,\x20'+_0x20c24c[_0x5a5342(0xd1)]+_0x5a5342(0xf6)};}};function isEquivalentPulledSqlFile(_0x2be404,_0x4c950a,_0x1037df,_0x1d5b4c){if(_0x1037df!==_0x1d5b4c)return normalizePulledSqlBody(_0x2be404,_0x1037df)===normalizePulledSqlBody(_0x4c950a,_0x1d5b4c);return normalizePullComparableContent(_0x2be404,_0x1037df)===normalizePullComparableContent(_0x4c950a,_0x1d5b4c);}async function findExistingSqlFiles(_0x30a540,_0x3c67de,_0x449604,_0xadeabb){const _0x51d7cf=a253_0x1e67f3,_0x59fa4c=[];await fileExists(_0x3c67de)&&_0x59fa4c[_0x51d7cf(0xd8)]({'filePath':_0x3c67de,'mode':_0x449604,'isCanonical':!![]});if(!_0xadeabb?.['path'])return _0x59fa4c;const _0x52472b=join(_0x30a540[_0x51d7cf(0xda)],_0xadeabb[_0x51d7cf(0xfc)]);if(_0x52472b===_0x3c67de)return _0x59fa4c;return await fileExists(_0x52472b)&&_0x59fa4c[_0x51d7cf(0xd8)]({'filePath':_0x52472b,'mode':_0xadeabb[_0x51d7cf(0xdb)]??modeFromFilePath(_0x52472b),'isCanonical':![]}),_0x59fa4c;}async function compareExistingSqlFiles(_0x597757,_0x48aba1,_0xdff5cf){return Promise['all'](_0x597757['map'](async _0x5f10d6=>{const _0x70b06a=a253_0x4366,_0x3bac0c=await readFile(_0x5f10d6['filePath'],_0x70b06a(0xd3));return{'file':_0x5f10d6,'content':_0x3bac0c,'equivalent':isEquivalentPulledSqlFile(_0x3bac0c,_0x48aba1,_0x5f10d6[_0x70b06a(0xdb)],_0xdff5cf)};}));}function modeFromFilePath(_0x26bdde){const _0x186cd2=a253_0x1e67f3;return _0x26bdde['toLowerCase']()[_0x186cd2(0xf3)](_0x186cd2(0xfa))?_0x186cd2(0xf1):_0x186cd2(0xe1);}function normalizePulledSqlBody(_0x17a3b9,_0xb4b3cd){const _0x2c3ded=a253_0x1e67f3;return stripLocalSqlMetadata(_0x17a3b9,_0xb4b3cd)[_0x2c3ded(0xd5)](/\r\n/g,'\x0a')[_0x2c3ded(0xe2)]();}function normalizePullComparableContent(_0x132cf2,_0x50474a){const _0x577441=a253_0x1e67f3,_0x198a44=_0x132cf2[_0x577441(0xd5)](/\r\n/g,'\x0a')[_0x577441(0x110)]('\x0a'),_0x5112c7=_0x198a44[_0x577441(0xfe)](_0x3dc631=>!isSyncedAtMetadataLine(_0x3dc631,_0x50474a));return _0x5112c7['join']('\x0a');}function isSyncedAtMetadataLine(_0xcabb70,_0x47d9b5){const _0x431e3b=a253_0x1e67f3;if(_0x47d9b5===_0x431e3b(0xf1))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x431e3b(0xe8)](_0xcabb70);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x431e3b(0xe8)](_0xcabb70);}