@lovrabet/rabetbase-cli 2.5.4-beta.5 → 2.5.5-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (379) 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/detail.js +1 -1
  77. package/lib/commands/dataset/extend-update.js +1 -1
  78. package/lib/commands/dataset/field-restore.js +1 -1
  79. package/lib/commands/dataset/field-update.js +1 -1
  80. package/lib/commands/dataset/generate.js +1 -1
  81. package/lib/commands/dataset/index.js +1 -1
  82. package/lib/commands/dataset/list.js +1 -1
  83. package/lib/commands/dataset/operations.js +1 -1
  84. package/lib/commands/dataset/relation-audit.js +1 -1
  85. package/lib/commands/dataset/relation-create.js +1 -1
  86. package/lib/commands/dataset/relation-delete.js +1 -1
  87. package/lib/commands/dataset/relation-shared.js +1 -1
  88. package/lib/commands/dataset/relation-update.js +1 -1
  89. package/lib/commands/dataset/relations.js +1 -1
  90. package/lib/commands/dataset/rename.js +1 -1
  91. package/lib/commands/dataset/restore.js +1 -1
  92. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  93. package/lib/commands/db/analysis-batching.js +1 -1
  94. package/lib/commands/db/analyze-batch-plan.js +1 -1
  95. package/lib/commands/db/analyze-cancel.js +1 -1
  96. package/lib/commands/db/analyze-start.js +1 -1
  97. package/lib/commands/db/analyze-status.js +1 -1
  98. package/lib/commands/db/create.js +1 -1
  99. package/lib/commands/db/delete.js +1 -1
  100. package/lib/commands/db/detail.js +1 -1
  101. package/lib/commands/db/diff-refresh-start.js +1 -1
  102. package/lib/commands/db/diff-refresh-status.js +1 -1
  103. package/lib/commands/db/diff.js +1 -1
  104. package/lib/commands/db/index.js +1 -1
  105. package/lib/commands/db/list.js +1 -1
  106. package/lib/commands/db/shared.js +1 -1
  107. package/lib/commands/db/table-diff-shared.js +1 -1
  108. package/lib/commands/db/tables.js +1 -1
  109. package/lib/commands/db/test.js +1 -1
  110. package/lib/commands/db/update.js +1 -1
  111. package/lib/commands/deployment/index.js +1 -1
  112. package/lib/commands/deployment/sync-all.js +1 -1
  113. package/lib/commands/deployment/sync-jobs.js +1 -1
  114. package/lib/commands/deployment/sync-status.js +1 -1
  115. package/lib/commands/doctor.js +1 -1
  116. package/lib/commands/file/index.js +1 -1
  117. package/lib/commands/flow/create.js +1 -1
  118. package/lib/commands/flow/detail.js +1 -1
  119. package/lib/commands/flow/index.js +1 -1
  120. package/lib/commands/flow/list.js +1 -1
  121. package/lib/commands/flow/publish.js +1 -1
  122. package/lib/commands/flow/runtime-resources-shared.js +1 -1
  123. package/lib/commands/flow/runtime-role-list.js +1 -1
  124. package/lib/commands/flow/runtime-role-user-list.js +1 -1
  125. package/lib/commands/flow/runtime-user-search.js +1 -1
  126. package/lib/commands/flow/shared.js +1 -1
  127. package/lib/commands/flow/update.js +1 -1
  128. package/lib/commands/flow/validate.js +1 -1
  129. package/lib/commands/instant-api-policy/current.js +1 -1
  130. package/lib/commands/instant-api-policy/index.js +1 -1
  131. package/lib/commands/instant-api-policy/init.js +1 -1
  132. package/lib/commands/instant-api-policy/publish.js +1 -1
  133. package/lib/commands/instant-api-policy/pull.js +1 -1
  134. package/lib/commands/instant-api-policy/revision.js +1 -1
  135. package/lib/commands/instant-api-policy/revisions.js +1 -1
  136. package/lib/commands/instant-api-policy/rollback.js +1 -1
  137. package/lib/commands/instant-api-policy/shared.js +1 -1
  138. package/lib/commands/instant-api-policy/validate.js +1 -1
  139. package/lib/commands/issue/index.js +1 -1
  140. package/lib/commands/issue/nudge.js +1 -1
  141. package/lib/commands/issue/report.js +1 -1
  142. package/lib/commands/issue/shared.js +1 -1
  143. package/lib/commands/kb/create.js +1 -1
  144. package/lib/commands/kb/delete.js +1 -1
  145. package/lib/commands/kb/detail.js +1 -1
  146. package/lib/commands/kb/index.js +1 -1
  147. package/lib/commands/kb/list.js +1 -1
  148. package/lib/commands/kb/search.js +1 -1
  149. package/lib/commands/kb/shared.js +1 -1
  150. package/lib/commands/kb/update.js +1 -1
  151. package/lib/commands/logs/index.js +1 -1
  152. package/lib/commands/menu/asset-update.js +1 -1
  153. package/lib/commands/menu/delete.js +1 -1
  154. package/lib/commands/menu/external-link-create.js +1 -1
  155. package/lib/commands/menu/external-link-update.js +1 -1
  156. package/lib/commands/menu/group-create.js +1 -1
  157. package/lib/commands/menu/group-update.js +1 -1
  158. package/lib/commands/menu/index.js +1 -1
  159. package/lib/commands/menu/list.js +1 -1
  160. package/lib/commands/menu/move.js +1 -1
  161. package/lib/commands/menu/regroup-start.js +1 -1
  162. package/lib/commands/menu/rename.js +1 -1
  163. package/lib/commands/menu/shared/compare-table.js +1 -1
  164. package/lib/commands/menu/shared/delete-plan.js +1 -1
  165. package/lib/commands/menu/shared/facts.js +1 -1
  166. package/lib/commands/menu/shared/index.js +1 -1
  167. package/lib/commands/menu/shared/inquirer.js +1 -1
  168. package/lib/commands/menu/shared/local-pages.js +1 -1
  169. package/lib/commands/menu/shared/logic.js +1 -1
  170. package/lib/commands/menu/shared/mutations.js +1 -1
  171. package/lib/commands/menu/shared/path.js +1 -1
  172. package/lib/commands/menu/shared/service.js +1 -1
  173. package/lib/commands/menu/shared/subapp-assets.js +1 -1
  174. package/lib/commands/menu/shared/sync-core.js +1 -1
  175. package/lib/commands/menu/shared/update-core.js +1 -1
  176. package/lib/commands/menu/shared/valid-url.js +1 -1
  177. package/lib/commands/menu/subapp-assets-status.js +1 -1
  178. package/lib/commands/menu/subapp-assets-update.js +1 -1
  179. package/lib/commands/menu/sync.js +1 -1
  180. package/lib/commands/menu/visibility-update.js +1 -1
  181. package/lib/commands/notification/config-create.js +1 -1
  182. package/lib/commands/notification/config-delete.js +1 -1
  183. package/lib/commands/notification/config-list.js +1 -1
  184. package/lib/commands/notification/config-update.js +1 -1
  185. package/lib/commands/notification/index.js +1 -1
  186. package/lib/commands/notification/shared.js +1 -1
  187. package/lib/commands/ocr/index.js +1 -1
  188. package/lib/commands/page/create.js +1 -1
  189. package/lib/commands/page/custom/detail.js +1 -1
  190. package/lib/commands/page/custom/list.js +1 -1
  191. package/lib/commands/page/custom/publish.js +1 -1
  192. package/lib/commands/page/custom/shared.js +1 -1
  193. package/lib/commands/page/custom/syntax.js +1 -1
  194. package/lib/commands/page/custom/update.js +1 -1
  195. package/lib/commands/page/data-list-status.js +1 -1
  196. package/lib/commands/page/generate-start.js +1 -1
  197. package/lib/commands/page/generate-status.js +1 -1
  198. package/lib/commands/page/index.js +1 -1
  199. package/lib/commands/page/pull.js +1 -1
  200. package/lib/commands/page/push.js +1 -1
  201. package/lib/commands/page/relation-audit.js +1 -1
  202. package/lib/commands/page/restore.js +1 -1
  203. package/lib/commands/page/shared.js +1 -1
  204. package/lib/commands/page/sync.js +1 -1
  205. package/lib/commands/project/api-architecture-upgrade.js +1 -1
  206. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  207. package/lib/commands/project/create/format-elapsed.js +1 -1
  208. package/lib/commands/project/create/main.js +1 -1
  209. package/lib/commands/project/create/materialize-project-template.js +1 -1
  210. package/lib/commands/project/create/project-name.js +1 -1
  211. package/lib/commands/project/create/project-template-archive.js +1 -1
  212. package/lib/commands/project/create/project-template-path.js +1 -1
  213. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  214. package/lib/commands/project/create/use-format-code.js +1 -1
  215. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  216. package/lib/commands/project/domain-routing-sync.js +1 -1
  217. package/lib/commands/project/index.js +1 -1
  218. package/lib/commands/project/upgrade.js +1 -1
  219. package/lib/commands/registry.js +1 -1
  220. package/lib/commands/role/delete.js +1 -1
  221. package/lib/commands/role/detail.js +1 -1
  222. package/lib/commands/role/index.js +1 -1
  223. package/lib/commands/role/list.js +1 -1
  224. package/lib/commands/role/shared.js +1 -1
  225. package/lib/commands/role/update.js +1 -1
  226. package/lib/commands/role/user-add.js +1 -1
  227. package/lib/commands/role/user-remove.js +1 -1
  228. package/lib/commands/role/user-resolve.js +1 -1
  229. package/lib/commands/rule/get.js +1 -1
  230. package/lib/commands/rule/index.js +1 -1
  231. package/lib/commands/rule/list.js +1 -1
  232. package/lib/commands/rule/set.js +1 -1
  233. package/lib/commands/rule/shared.js +1 -1
  234. package/lib/commands/run/index.js +1 -1
  235. package/lib/commands/schema.js +1 -1
  236. package/lib/commands/sql/create.js +1 -1
  237. package/lib/commands/sql/delete.js +1 -1
  238. package/lib/commands/sql/detail.js +1 -1
  239. package/lib/commands/sql/exec.js +1 -1
  240. package/lib/commands/sql/index.js +1 -1
  241. package/lib/commands/sql/list.js +1 -1
  242. package/lib/commands/sql/pull.js +1 -1
  243. package/lib/commands/sql/push.js +1 -1
  244. package/lib/commands/sql/shared.js +1 -1
  245. package/lib/commands/sql/status.js +1 -1
  246. package/lib/commands/sql/validate.js +1 -1
  247. package/lib/commands/task/index.js +1 -1
  248. package/lib/commands/task/status.js +1 -1
  249. package/lib/commands/tenant/index.js +1 -1
  250. package/lib/commands/tenant/members-list.js +1 -1
  251. package/lib/commands/tenant/shared.js +1 -1
  252. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  253. package/lib/commands/user-account/feishu-bind.js +1 -1
  254. package/lib/commands/user-account/index.js +1 -1
  255. package/lib/commands/workspace/add.js +1 -1
  256. package/lib/commands/workspace/index.js +1 -1
  257. package/lib/commands/workspace/remove.js +1 -1
  258. package/lib/config/domain-config.js +1 -1
  259. package/lib/config/project-domain-routing.js +1 -1
  260. package/lib/config/region-config.js +1 -1
  261. package/lib/config/schema.js +1 -1
  262. package/lib/constant/cdn.js +1 -1
  263. package/lib/constant/cli.js +1 -1
  264. package/lib/constant/defaults.js +1 -1
  265. package/lib/constant/domain.js +1 -1
  266. package/lib/constant/env.js +1 -1
  267. package/lib/constant/output.js +1 -1
  268. package/lib/constant/paths.js +1 -1
  269. package/lib/constant/region.js +1 -1
  270. package/lib/constant/risk.js +1 -1
  271. package/lib/constant/routing-profile.js +1 -1
  272. package/lib/context/app-resolver.js +1 -1
  273. package/lib/context/auth-resolver.js +1 -1
  274. package/lib/context/config-loader.js +1 -1
  275. package/lib/context.js +1 -1
  276. package/lib/core/alias-resolver.js +1 -1
  277. package/lib/core/api-client.js +1 -1
  278. package/lib/core/bff/config.js +1 -1
  279. package/lib/core/bff/file-system.js +1 -1
  280. package/lib/core/bff/hash.js +1 -1
  281. package/lib/core/bff/hook-directory.js +1 -1
  282. package/lib/core/bff/lock.js +1 -1
  283. package/lib/core/bff/utils.js +1 -1
  284. package/lib/core/cross-db-relation.js +1 -1
  285. package/lib/core/db-resolver.js +1 -1
  286. package/lib/core/flow-config.js +1 -1
  287. package/lib/core/instant-api-policy/config.js +1 -1
  288. package/lib/core/kb-search-client.js +1 -1
  289. package/lib/core/page/file-system.js +1 -1
  290. package/lib/core/page/hash.js +1 -1
  291. package/lib/core/page/lock.js +1 -1
  292. package/lib/core/page/lr-smart-jsx.js +1 -1
  293. package/lib/core/sql-index-auditor.js +1 -1
  294. package/lib/core/sql-sync/config.js +1 -1
  295. package/lib/core/sql-sync/file-system.js +1 -1
  296. package/lib/core/sql-sync/hash.js +1 -1
  297. package/lib/core/sql-sync/lock.js +1 -1
  298. package/lib/core/sql-sync/utils.js +1 -1
  299. package/lib/core/sql-validator.js +1 -1
  300. package/lib/errors.js +1 -1
  301. package/lib/framework/build-all-flags.js +1 -1
  302. package/lib/framework/error-output.js +1 -1
  303. package/lib/framework/explicit-yes.js +1 -1
  304. package/lib/framework/flags.js +1 -1
  305. package/lib/framework/help.js +1 -1
  306. package/lib/framework/index.js +1 -1
  307. package/lib/framework/output.js +1 -1
  308. package/lib/framework/response.js +1 -1
  309. package/lib/framework/runner-alias.js +1 -1
  310. package/lib/framework/runner.js +1 -1
  311. package/lib/framework/schema-export.js +1 -1
  312. package/lib/framework/supported-flags.js +1 -1
  313. package/lib/framework/types.js +1 -1
  314. package/lib/generated/build-info.d.ts +4 -4
  315. package/lib/generated/build-info.js +1 -1
  316. package/lib/generated/official-routing.js +1 -1
  317. package/lib/generated/routing-contract.js +1 -1
  318. package/lib/help.js +1 -1
  319. package/lib/postinstall.js +1 -1
  320. package/lib/runtime/confirmation.js +1 -1
  321. package/lib/runtime/event.js +1 -1
  322. package/lib/runtime/index.js +1 -1
  323. package/lib/runtime/queue.js +1 -1
  324. package/lib/runtime/resolve.js +1 -1
  325. package/lib/skills/builtin-skill.js +1 -1
  326. package/lib/skills/main.js +1 -1
  327. package/lib/skills/npx-skills-add.js +1 -1
  328. package/lib/skills/skill-presence.js +1 -1
  329. package/lib/telemetry/cli-command-trace.js +1 -1
  330. package/lib/telemetry/cli-help-trace.js +1 -1
  331. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  332. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  333. package/lib/telemetry/send-cli-trace-log.js +1 -1
  334. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  335. package/lib/utils/ai_config.js +1 -1
  336. package/lib/utils/apply-jq-filter.js +1 -1
  337. package/lib/utils/cdn-config.js +1 -1
  338. package/lib/utils/check-sdk-version.js +1 -1
  339. package/lib/utils/cli-version-check.js +1 -1
  340. package/lib/utils/cli-version-policy.js +1 -1
  341. package/lib/utils/config.js +1 -1
  342. package/lib/utils/entity-with-id.js +1 -1
  343. package/lib/utils/file-utils.js +1 -1
  344. package/lib/utils/guides-cdn.js +1 -1
  345. package/lib/utils/http-client.js +1 -1
  346. package/lib/utils/is-non-interactive.js +1 -1
  347. package/lib/utils/logger.js +1 -1
  348. package/lib/utils/params.js +1 -1
  349. package/lib/utils/platform.js +1 -1
  350. package/lib/utils/sleep.js +1 -1
  351. package/lib/utils/template-replacer.js +1 -1
  352. package/lib/utils/update-notice.js +1 -1
  353. package/lib/utils/version.js +1 -1
  354. package/lib/utils/with-active-cookie.js +1 -1
  355. package/lib/utils/write-cli-side-channel.js +1 -1
  356. package/package.json +2 -1
  357. package/skills/rabetbase/SKILL.md +1 -1
  358. package/skills/rabetbase-page-generation/SKILL.md +35 -0
  359. package/skills/rabetbase-page-generation/references/component-baseline.md +18 -0
  360. package/skills/rabetbase-page-generation/references/generation.md +77 -0
  361. package/skills/rabetbase-page-generation/templates/onepage/build.mjs +63 -0
  362. package/skills/rabetbase-page-generation/templates/onepage/create/README.md +20 -0
  363. package/skills/rabetbase-page-generation/templates/onepage/create/index.jsx +4 -0
  364. package/skills/rabetbase-page-generation/templates/onepage/create/preview.png +0 -0
  365. package/skills/rabetbase-page-generation/templates/onepage/detail/README.md +20 -0
  366. package/skills/rabetbase-page-generation/templates/onepage/detail/index.jsx +194 -0
  367. package/skills/rabetbase-page-generation/templates/onepage/detail/preview.png +0 -0
  368. package/skills/rabetbase-page-generation/templates/onepage/list/README.md +20 -0
  369. package/skills/rabetbase-page-generation/templates/onepage/list/index.jsx +717 -0
  370. package/skills/rabetbase-page-generation/templates/onepage/list/preview.png +0 -0
  371. package/skills/rabetbase-page-generation/templates/onepage/shared/editor.jsx +395 -0
  372. package/skills/rabetbase-page-generation/templates/onepage/shared/model.js +141 -0
  373. package/skills/rabetbase-page-generation/templates/onepage/shared/page.css +377 -0
  374. package/skills/rabetbase-page-generation/templates/onepage/shared/record-layout.jsx +90 -0
  375. package/skills/rabetbase-page-generation/templates/onepage/shared/responsive.jsx +70 -0
  376. package/skills/rabetbase-page-generation/templates/onepage/update/README.md +21 -0
  377. package/skills/rabetbase-page-generation/templates/onepage/update/index.jsx +4 -0
  378. package/skills/rabetbase-page-generation/templates/onepage/update/preview.png +0 -0
  379. package/skills/rabetbase.manifest.json +3 -3
@@ -1 +1 @@
1
- function a231_0x3e0b(_0x4222e8,_0x13ac16){_0x4222e8=_0x4222e8-0x1c0;const _0x4e9601=a231_0x4e96();let _0x3e0b39=_0x4e9601[_0x4222e8];return _0x3e0b39;}const a231_0x4a0f7d=a231_0x3e0b;function a231_0x4e96(){const _0x1773a9=['5089536hQwtSt','3534984fgjciz','List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','list','3519425rROVkK','43511430IPDFXl','all','8NZNJUp','103245LihtJc','3xnyyYo','9wSceVc','7121100wFxQkn','map','734834EgVAOg','read','length'];a231_0x4e96=function(){return _0x1773a9;};return a231_0x4e96();}(function(_0x2087a5,_0x459727){const _0x34d181=a231_0x3e0b,_0x583373=_0x2087a5();while(!![]){try{const _0x1638c8=parseInt(_0x34d181(0x1cf))/0x1*(-parseInt(_0x34d181(0x1c3))/0x2)+-parseInt(_0x34d181(0x1ce))/0x3*(parseInt(_0x34d181(0x1cd))/0x4)+-parseInt(_0x34d181(0x1c1))/0x5+-parseInt(_0x34d181(0x1c6))/0x6+-parseInt(_0x34d181(0x1ca))/0x7+parseInt(_0x34d181(0x1c7))/0x8+parseInt(_0x34d181(0x1c0))/0x9*(parseInt(_0x34d181(0x1cb))/0xa);if(_0x1638c8===_0x459727)break;else _0x583373['push'](_0x583373['shift']());}catch(_0x1e07d4){_0x583373['push'](_0x583373['shift']());}}}(a231_0x4e96,0xceb5c));import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';export const ruleList={'service':'rule','command':a231_0x4a0f7d(0x1c9),'description':a231_0x4a0f7d(0x1c8),'risk':a231_0x4a0f7d(0x1c4),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x518e44){const _0x256435=a231_0x4a0f7d,_0x26e771=await Promise[_0x256435(0x1cc)](APP_RULE_TYPES['map'](_0x2b0c1c=>getAppRule(_0x518e44['cookie'],{'appCode':_0x518e44['appCode'],'type':_0x2b0c1c}))),_0x4b6fd9=APP_RULE_TYPES[_0x256435(0x1c2)]((_0x14f26f,_0x51b65f)=>projectAppRule(_0x14f26f,_0x26e771[_0x51b65f]??null));return{'ok':!![],'data':{'total':_0x4b6fd9[_0x256435(0x1c5)],'rules':_0x4b6fd9},'message':'Loaded\x20app\x20rule\x20configuration\x20for\x20'+_0x518e44['appCode']};}};
1
+ const a231_0x28b172=a231_0x1ce5;function a231_0x1ce5(_0x2aaddf,_0x5e5649){_0x2aaddf=_0x2aaddf-0x1da;const _0x381cc1=a231_0x381c();let _0x1ce50e=_0x381cc1[_0x2aaddf];return _0x1ce50e;}(function(_0x7e8733,_0x5678f6){const _0x26da73=a231_0x1ce5,_0x5d0e6e=_0x7e8733();while(!![]){try{const _0x52ed37=parseInt(_0x26da73(0x1ec))/0x1+parseInt(_0x26da73(0x1e3))/0x2+-parseInt(_0x26da73(0x1de))/0x3*(-parseInt(_0x26da73(0x1e0))/0x4)+parseInt(_0x26da73(0x1e2))/0x5*(parseInt(_0x26da73(0x1db))/0x6)+parseInt(_0x26da73(0x1dd))/0x7+-parseInt(_0x26da73(0x1e4))/0x8*(-parseInt(_0x26da73(0x1e7))/0x9)+-parseInt(_0x26da73(0x1df))/0xa*(parseInt(_0x26da73(0x1dc))/0xb);if(_0x52ed37===_0x5678f6)break;else _0x5d0e6e['push'](_0x5d0e6e['shift']());}catch(_0x541caf){_0x5d0e6e['push'](_0x5d0e6e['shift']());}}}(a231_0x381c,0x317c5));import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';function a231_0x381c(){const _0x51f7b2=['Loaded\x20app\x20rule\x20configuration\x20for\x20','340233mvyuIy','appCode','67362koboTM','415437qxpLbQ','2323909ZIjbZO','15Bkatdk','250tEpqLK','32572AscYPz','rule','105qtlKJY','100764WlFgpP','591136zxrqnr','List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','all','18pYtToL','list','read','map'];a231_0x381c=function(){return _0x51f7b2;};return a231_0x381c();}export const ruleList={'service':a231_0x28b172(0x1e1),'command':a231_0x28b172(0x1e8),'description':a231_0x28b172(0x1e5),'risk':a231_0x28b172(0x1e9),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x30c80b){const _0x3ddc1d=a231_0x28b172,_0x4d0d44=await Promise[_0x3ddc1d(0x1e6)](APP_RULE_TYPES[_0x3ddc1d(0x1ea)](_0x175c38=>getAppRule(_0x30c80b['cookie'],{'appCode':_0x30c80b[_0x3ddc1d(0x1da)],'type':_0x175c38}))),_0x1fa598=APP_RULE_TYPES[_0x3ddc1d(0x1ea)]((_0x59f00e,_0x43915d)=>projectAppRule(_0x59f00e,_0x4d0d44[_0x43915d]??null));return{'ok':!![],'data':{'total':_0x1fa598['length'],'rules':_0x1fa598},'message':_0x3ddc1d(0x1eb)+_0x30c80b[_0x3ddc1d(0x1da)]};}};
@@ -1 +1 @@
1
- const a232_0xabb6ce=a232_0x1577;(function(_0x444b9a,_0x5201b8){const _0x59d7c6=a232_0x1577,_0xccab0c=_0x444b9a();while(!![]){try{const _0x1167cc=parseInt(_0x59d7c6(0x149))/0x1+-parseInt(_0x59d7c6(0x139))/0x2+-parseInt(_0x59d7c6(0x144))/0x3+parseInt(_0x59d7c6(0x12e))/0x4*(-parseInt(_0x59d7c6(0x157))/0x5)+parseInt(_0x59d7c6(0x143))/0x6+-parseInt(_0x59d7c6(0x163))/0x7+parseInt(_0x59d7c6(0x162))/0x8;if(_0x1167cc===_0x5201b8)break;else _0xccab0c['push'](_0xccab0c['shift']());}catch(_0xba0b20){_0xccab0c['push'](_0xccab0c['shift']());}}}(a232_0x127f,0xb25b6));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 a232_0x127f(){const _0x370ad7=['rules','1171484euQskD','app_rule_verification_failed','number','planned','app_rule_set_outcome_unknown','cause','flag','.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.','--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','Expected\x20','Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.','830054UcyduU','The\x20set\x20request\x20was\x20sent,\x20but\x20','byteSize','rule','\x20version\x20changed\x20before\x20write.','POST','expectedVersion','beforeRecord','Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20','type','6634230PdZQsp','2233719QBAvTq','file','string','str','trim','142235qGOScn','content','app_rule_verification_unavailable','--expected-version\x20is\x20a\x20non-atomic\x20read-before-write\x20assertion;\x20the\x20server\x20save\x20contract\x20has\x20no\x20version\x20predicate.','\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','replacement','contentHash','defineProperty','app_rule_expected_version_invalid','Pass\x20a\x20UTF-8\x20Markdown\x20file.','app_rule_version_mismatch','input','Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.','cookie','5vTDwSs','unconfigured','rabetbase\x20rule\x20get\x20--type\x20','version','appCode','push','--file\x20is\x20required.','\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.',';\x20current\x20version\x20is\x20','set','Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','18207776kHzRJT','9386237vALBTj','expected-version','before','app_rule_file_required','\x20--format\x20compress'];a232_0x127f=function(){return _0x370ad7;};return a232_0x127f();}function a232_0x1577(_0x2366b0,_0x344692){_0x2366b0=_0x2366b0-0x12b;const _0x127f20=a232_0x127f();let _0x15774b=_0x127f20[_0x2366b0];return _0x15774b;}const SAVE_PATH='/smartapi/knowledge-base/save',NON_ATOMIC_WARNING=a232_0xabb6ce(0x14c);function readSetInput(_0x2c2921){const _0x20507a=a232_0xabb6ce,_0x4945fe=readAppRuleType(_0x2c2921),_0x3752ee=_0x2c2921[_0x20507a(0x147)](_0x20507a(0x145))[_0x20507a(0x148)]();if(!_0x3752ee)throw appRuleError(_0x20507a(0x12b),_0x20507a(0x15d),_0x20507a(0x152));const _0xbfa3d7=_0x2c2921[_0x20507a(0x134)](_0x20507a(0x164));let _0x598e38;if(_0xbfa3d7!==undefined){_0x598e38=Number(_0xbfa3d7);if(!Number['isSafeInteger'](_0x598e38)||_0x598e38<0x0)throw appRuleError(_0x20507a(0x151),_0x20507a(0x136));}return{'type':_0x4945fe,'file':_0x3752ee,'expectedVersion':_0x598e38};}async function prepareSet(_0x5d0be9){const _0x4db0ec=a232_0xabb6ce,_0x3c57af=readSetInput(_0x5d0be9),_0x5e2229=await readAppRuleFile(_0x3c57af['file']),_0x3e16bc=await getAppRule(_0x5d0be9[_0x4db0ec(0x156)],{'appCode':_0x5d0be9[_0x4db0ec(0x15b)],'type':_0x3c57af[_0x4db0ec(0x142)]});if(_0x3c57af[_0x4db0ec(0x13f)]!==undefined&&_0x3e16bc?.[_0x4db0ec(0x15a)]!==_0x3c57af[_0x4db0ec(0x13f)])throw appRuleError(_0x4db0ec(0x153),appRuleFileName(_0x3c57af[_0x4db0ec(0x142)])+_0x4db0ec(0x13d),_0x4db0ec(0x137)+_0x3c57af[_0x4db0ec(0x13f)]+_0x4db0ec(0x15f)+(_0x3e16bc?.[_0x4db0ec(0x15a)]??_0x4db0ec(0x158))+_0x4db0ec(0x135));return{'input':_0x3c57af,'replacement':_0x5e2229,'beforeRecord':_0x3e16bc,'before':projectAppRule(_0x3c57af[_0x4db0ec(0x142)],_0x3e16bc),'planned':{'type':_0x3c57af[_0x4db0ec(0x142)],'fileName':appRuleFileName(_0x3c57af[_0x4db0ec(0x142)]),'contextScope':appRuleContextScope(_0x3c57af['type']),'enabled':!![],'appCode':_0x5d0be9[_0x4db0ec(0x15b)],'scope':_0x4db0ec(0x12d),'contentByteSize':_0x5e2229[_0x4db0ec(0x13b)],'contentHash':_0x5e2229[_0x4db0ec(0x14f)]}};}function warningsFor(_0x2b00b0){return _0x2b00b0===undefined?[]:[NON_ATOMIC_WARNING];}export const ruleSet={'service':a232_0xabb6ce(0x13c),'command':a232_0xabb6ce(0x160),'description':a232_0xabb6ce(0x161),'risk':'write','requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':a232_0xabb6ce(0x145),'type':a232_0xabb6ce(0x146),'required':!![],'description':'UTF-8\x20Markdown\x20file\x20(maximum\x205\x20MiB)'},{'name':'expected-version','type':a232_0xabb6ce(0x130),'required':![],'description':'Non-atomic\x20preflight\x20assertion\x20for\x20the\x20current\x20version'}],async 'validate'(_0x2d1582){readSetInput(_0x2d1582);},async 'dryRun'(_0x16b753){const _0x286dd2=a232_0xabb6ce,_0x46ca0a=await prepareSet(_0x16b753);return asDryRunResult({'operation':'set','selector':{'appCode':_0x16b753[_0x286dd2(0x15b)],'scope':_0x286dd2(0x12d),'type':_0x46ca0a[_0x286dd2(0x154)][_0x286dd2(0x142)]},'before':_0x46ca0a[_0x286dd2(0x165)],'after':_0x46ca0a[_0x286dd2(0x131)],'dryRun':!![],'backend':{'method':_0x286dd2(0x13e),'path':SAVE_PATH},'warnings':warningsFor(_0x46ca0a[_0x286dd2(0x154)][_0x286dd2(0x13f)]),'verification':{'expectedVersion':_0x46ca0a[_0x286dd2(0x154)]['expectedVersion']??null,'atomicCompareAndSet':![],'lookupCommand':_0x286dd2(0x159)+_0x46ca0a[_0x286dd2(0x154)][_0x286dd2(0x142)]+'\x20--format\x20compress'}},{'method':'POST','url':SAVE_PATH});},async 'execute'(_0x2c016c){const _0x4dcb64=a232_0xabb6ce,_0x244f1a=await prepareSet(_0x2c016c);let _0x170348=![];try{await saveAppRule(_0x2c016c[_0x4dcb64(0x156)],{'appCode':_0x2c016c['appCode'],'type':_0x244f1a[_0x4dcb64(0x154)][_0x4dcb64(0x142)],'content':_0x244f1a[_0x4dcb64(0x14e)][_0x4dcb64(0x14a)]});}catch(_0x516896){if(!isPlatformTransportFailure(_0x516896))throw _0x516896;_0x170348=!![];}let _0x5b5a3d;try{_0x5b5a3d=await getAppRule(_0x2c016c[_0x4dcb64(0x156)],{'appCode':_0x2c016c[_0x4dcb64(0x15b)],'type':_0x244f1a[_0x4dcb64(0x154)][_0x4dcb64(0x142)]});}catch(_0xbb2807){const _0x18406a=appRuleError(_0x170348?_0x4dcb64(0x132):_0x4dcb64(0x14b),_0x4dcb64(0x13a)+appRuleFileName(_0x244f1a[_0x4dcb64(0x154)][_0x4dcb64(0x142)])+'\x20could\x20not\x20be\x20verified.',_0x4dcb64(0x155));Object[_0x4dcb64(0x150)](_0x18406a,_0x4dcb64(0x133),{'value':_0xbb2807,'enumerable':![]});throw _0x18406a;}const _0x56f00b=_0x5b5a3d&&inspectAppRuleContent(_0x5b5a3d[_0x4dcb64(0x14a)])[_0x4dcb64(0x14f)]===_0x244f1a[_0x4dcb64(0x14e)][_0x4dcb64(0x14f)],_0x4fb2d2=_0x5b5a3d&&(_0x244f1a[_0x4dcb64(0x140)]===null||_0x5b5a3d['version']>_0x244f1a[_0x4dcb64(0x140)][_0x4dcb64(0x15a)]);if(!_0x5b5a3d||!_0x56f00b||!_0x4fb2d2)throw appRuleError(_0x170348?_0x4dcb64(0x132):_0x4dcb64(0x12f),appRuleFileName(_0x244f1a['input'][_0x4dcb64(0x142)])+_0x4dcb64(0x14d),_0x4dcb64(0x141)+_0x244f1a['input'][_0x4dcb64(0x142)]+_0x4dcb64(0x15e));const _0x576850=warningsFor(_0x244f1a['input'][_0x4dcb64(0x13f)]);_0x170348&&_0x576850[_0x4dcb64(0x15c)](_0x4dcb64(0x138));const _0x5a0124=projectAppRule(_0x244f1a[_0x4dcb64(0x154)]['type'],_0x5b5a3d);return{'ok':!![],'data':{'operation':_0x4dcb64(0x160),'selector':{'appCode':_0x2c016c['appCode'],'scope':'rules','type':_0x244f1a['input'][_0x4dcb64(0x142)]},'before':_0x244f1a[_0x4dcb64(0x165)],'after':_0x5a0124,'dryRun':![],'backend':{'method':_0x4dcb64(0x13e),'path':SAVE_PATH},'warnings':_0x576850,'verification':{'status':'verified','recoveredAfterUnknownResponse':_0x170348,'expectedVersion':_0x244f1a['input'][_0x4dcb64(0x13f)]??null,'atomicCompareAndSet':![],'lookupCommand':_0x4dcb64(0x159)+_0x244f1a[_0x4dcb64(0x154)][_0x4dcb64(0x142)]+_0x4dcb64(0x12c)}},'message':'Set\x20'+appRuleFileName(_0x244f1a[_0x4dcb64(0x154)][_0x4dcb64(0x142)])+'\x20for\x20'+_0x2c016c[_0x4dcb64(0x15b)]};}};
1
+ const a232_0x4ce663=a232_0x1d22;(function(_0x2e1a93,_0x112a70){const _0x2cf3d2=a232_0x1d22,_0x21f212=_0x2e1a93();while(!![]){try{const _0x5d59a4=-parseInt(_0x2cf3d2(0x1fd))/0x1+-parseInt(_0x2cf3d2(0x209))/0x2+-parseInt(_0x2cf3d2(0x201))/0x3+-parseInt(_0x2cf3d2(0x20d))/0x4+-parseInt(_0x2cf3d2(0x1f9))/0x5*(parseInt(_0x2cf3d2(0x205))/0x6)+parseInt(_0x2cf3d2(0x220))/0x7+parseInt(_0x2cf3d2(0x1e9))/0x8;if(_0x5d59a4===_0x112a70)break;else _0x21f212['push'](_0x21f212['shift']());}catch(_0xe08223){_0x21f212['push'](_0x21f212['shift']());}}}(a232_0x14cc,0x95a10));import{getAppRule,isPlatformTransportFailure,saveAppRule}from'../../core/api-client.js';function a232_0x1d22(_0x1a4b8e,_0xedfa01){_0x1a4b8e=_0x1a4b8e-0x1e8;const _0x14cc9a=a232_0x14cc();let _0x1d22e3=_0x14cc9a[_0x1a4b8e];return _0x1d22e3;}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';const SAVE_PATH='/smartapi/knowledge-base/save',NON_ATOMIC_WARNING=a232_0x4ce663(0x20b);function a232_0x14cc(){const _0x57fa40=['The\x20set\x20request\x20was\x20sent,\x20but\x20','app_rule_file_required','8221500cDHrvk','app_rule_verification_failed','before','cause','17559920kxmCmL','input','trim','rule','\x20version\x20changed\x20before\x20write.','expectedVersion','version','POST','set','write','string','flag','expected-version','defineProperty','cookie','Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20','225enLfBk','byteSize','contentHash','Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','1182771WQeHRY','file','Set\x20','Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.','1113459RrTZTj',';\x20current\x20version\x20is\x20','\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','1926SgKdTt','content','--file\x20is\x20required.','type','1097148HUWaoo','planned','--expected-version\x20is\x20a\x20non-atomic\x20read-before-write\x20assertion;\x20the\x20server\x20save\x20contract\x20has\x20no\x20version\x20predicate.','Expected\x20','2558668wnVyNv','\x20could\x20not\x20be\x20verified.','\x20--format\x20compress','\x20for\x20','UTF-8\x20Markdown\x20file\x20(maximum\x205\x20MiB)','Pass\x20a\x20UTF-8\x20Markdown\x20file.','appCode','beforeRecord','replacement','isSafeInteger','rules','app_rule_set_outcome_unknown','rabetbase\x20rule\x20get\x20--type\x20','Non-atomic\x20preflight\x20assertion\x20for\x20the\x20current\x20version','str','push','verified'];a232_0x14cc=function(){return _0x57fa40;};return a232_0x14cc();}function readSetInput(_0x5d1fd0){const _0x2f210=a232_0x4ce663,_0x164f44=readAppRuleType(_0x5d1fd0),_0x4581af=_0x5d1fd0[_0x2f210(0x21b)]('file')[_0x2f210(0x1eb)]();if(!_0x4581af)throw appRuleError(_0x2f210(0x21f),_0x2f210(0x207),_0x2f210(0x212));const _0x132dba=_0x5d1fd0[_0x2f210(0x1f4)](_0x2f210(0x1f5));let _0x4e6d94;if(_0x132dba!==undefined){_0x4e6d94=Number(_0x132dba);if(!Number[_0x2f210(0x216)](_0x4e6d94)||_0x4e6d94<0x0)throw appRuleError('app_rule_expected_version_invalid',_0x2f210(0x204));}return{'type':_0x164f44,'file':_0x4581af,'expectedVersion':_0x4e6d94};}async function prepareSet(_0x461490){const _0x2c1bc3=a232_0x4ce663,_0x35cc7f=readSetInput(_0x461490),_0x595a60=await readAppRuleFile(_0x35cc7f[_0x2c1bc3(0x1fe)]),_0x18d54d=await getAppRule(_0x461490['cookie'],{'appCode':_0x461490['appCode'],'type':_0x35cc7f[_0x2c1bc3(0x208)]});if(_0x35cc7f['expectedVersion']!==undefined&&_0x18d54d?.[_0x2c1bc3(0x1ef)]!==_0x35cc7f['expectedVersion'])throw appRuleError('app_rule_version_mismatch',appRuleFileName(_0x35cc7f['type'])+_0x2c1bc3(0x1ed),_0x2c1bc3(0x20c)+_0x35cc7f['expectedVersion']+_0x2c1bc3(0x202)+(_0x18d54d?.[_0x2c1bc3(0x1ef)]??'unconfigured')+'.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.');return{'input':_0x35cc7f,'replacement':_0x595a60,'beforeRecord':_0x18d54d,'before':projectAppRule(_0x35cc7f[_0x2c1bc3(0x208)],_0x18d54d),'planned':{'type':_0x35cc7f['type'],'fileName':appRuleFileName(_0x35cc7f[_0x2c1bc3(0x208)]),'contextScope':appRuleContextScope(_0x35cc7f['type']),'enabled':!![],'appCode':_0x461490[_0x2c1bc3(0x213)],'scope':_0x2c1bc3(0x217),'contentByteSize':_0x595a60[_0x2c1bc3(0x1fa)],'contentHash':_0x595a60[_0x2c1bc3(0x1fb)]}};}function warningsFor(_0x2edbe8){return _0x2edbe8===undefined?[]:[NON_ATOMIC_WARNING];}export const ruleSet={'service':a232_0x4ce663(0x1ec),'command':'set','description':a232_0x4ce663(0x1fc),'risk':a232_0x4ce663(0x1f2),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':a232_0x4ce663(0x1fe),'type':a232_0x4ce663(0x1f3),'required':!![],'description':a232_0x4ce663(0x211)},{'name':a232_0x4ce663(0x1f5),'type':'number','required':![],'description':a232_0x4ce663(0x21a)}],async 'validate'(_0x538526){readSetInput(_0x538526);},async 'dryRun'(_0x4a7357){const _0x5c9522=a232_0x4ce663,_0x158e68=await prepareSet(_0x4a7357);return asDryRunResult({'operation':_0x5c9522(0x1f1),'selector':{'appCode':_0x4a7357['appCode'],'scope':_0x5c9522(0x217),'type':_0x158e68[_0x5c9522(0x1ea)][_0x5c9522(0x208)]},'before':_0x158e68[_0x5c9522(0x222)],'after':_0x158e68[_0x5c9522(0x20a)],'dryRun':!![],'backend':{'method':'POST','path':SAVE_PATH},'warnings':warningsFor(_0x158e68['input']['expectedVersion']),'verification':{'expectedVersion':_0x158e68['input'][_0x5c9522(0x1ee)]??null,'atomicCompareAndSet':![],'lookupCommand':_0x5c9522(0x219)+_0x158e68['input'][_0x5c9522(0x208)]+_0x5c9522(0x20f)}},{'method':_0x5c9522(0x1f0),'url':SAVE_PATH});},async 'execute'(_0x91830f){const _0x25ca39=a232_0x4ce663,_0x5d3d9d=await prepareSet(_0x91830f);let _0x1449ce=![];try{await saveAppRule(_0x91830f[_0x25ca39(0x1f7)],{'appCode':_0x91830f[_0x25ca39(0x213)],'type':_0x5d3d9d[_0x25ca39(0x1ea)][_0x25ca39(0x208)],'content':_0x5d3d9d[_0x25ca39(0x215)][_0x25ca39(0x206)]});}catch(_0x53cf0b){if(!isPlatformTransportFailure(_0x53cf0b))throw _0x53cf0b;_0x1449ce=!![];}let _0x3771ab;try{_0x3771ab=await getAppRule(_0x91830f[_0x25ca39(0x1f7)],{'appCode':_0x91830f[_0x25ca39(0x213)],'type':_0x5d3d9d[_0x25ca39(0x1ea)][_0x25ca39(0x208)]});}catch(_0x47255a){const _0x5ef42f=appRuleError(_0x1449ce?'app_rule_set_outcome_unknown':'app_rule_verification_unavailable',_0x25ca39(0x21e)+appRuleFileName(_0x5d3d9d[_0x25ca39(0x1ea)][_0x25ca39(0x208)])+_0x25ca39(0x20e),_0x25ca39(0x200));Object[_0x25ca39(0x1f6)](_0x5ef42f,_0x25ca39(0x1e8),{'value':_0x47255a,'enumerable':![]});throw _0x5ef42f;}const _0x2e7648=_0x3771ab&&inspectAppRuleContent(_0x3771ab[_0x25ca39(0x206)])[_0x25ca39(0x1fb)]===_0x5d3d9d[_0x25ca39(0x215)][_0x25ca39(0x1fb)],_0x360dfd=_0x3771ab&&(_0x5d3d9d['beforeRecord']===null||_0x3771ab[_0x25ca39(0x1ef)]>_0x5d3d9d[_0x25ca39(0x214)][_0x25ca39(0x1ef)]);if(!_0x3771ab||!_0x2e7648||!_0x360dfd)throw appRuleError(_0x1449ce?_0x25ca39(0x218):_0x25ca39(0x221),appRuleFileName(_0x5d3d9d[_0x25ca39(0x1ea)][_0x25ca39(0x208)])+_0x25ca39(0x203),_0x25ca39(0x1f8)+_0x5d3d9d[_0x25ca39(0x1ea)][_0x25ca39(0x208)]+'\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.');const _0x3f6197=warningsFor(_0x5d3d9d[_0x25ca39(0x1ea)][_0x25ca39(0x1ee)]);_0x1449ce&&_0x3f6197[_0x25ca39(0x21c)]('Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.');const _0x27cf90=projectAppRule(_0x5d3d9d[_0x25ca39(0x1ea)]['type'],_0x3771ab);return{'ok':!![],'data':{'operation':_0x25ca39(0x1f1),'selector':{'appCode':_0x91830f[_0x25ca39(0x213)],'scope':_0x25ca39(0x217),'type':_0x5d3d9d['input'][_0x25ca39(0x208)]},'before':_0x5d3d9d['before'],'after':_0x27cf90,'dryRun':![],'backend':{'method':'POST','path':SAVE_PATH},'warnings':_0x3f6197,'verification':{'status':_0x25ca39(0x21d),'recoveredAfterUnknownResponse':_0x1449ce,'expectedVersion':_0x5d3d9d[_0x25ca39(0x1ea)][_0x25ca39(0x1ee)]??null,'atomicCompareAndSet':![],'lookupCommand':'rabetbase\x20rule\x20get\x20--type\x20'+_0x5d3d9d[_0x25ca39(0x1ea)][_0x25ca39(0x208)]+_0x25ca39(0x20f)}},'message':_0x25ca39(0x1ff)+appRuleFileName(_0x5d3d9d[_0x25ca39(0x1ea)][_0x25ca39(0x208)])+_0x25ca39(0x210)+_0x91830f[_0x25ca39(0x213)]};}};
@@ -1 +1 @@
1
- const a233_0x3ff7ab=a233_0x315b;(function(_0x58bb6b,_0x1d1e3f){const _0x5081ad=a233_0x315b,_0x30594e=_0x58bb6b();while(!![]){try{const _0x426222=parseInt(_0x5081ad(0x86))/0x1+-parseInt(_0x5081ad(0x8b))/0x2*(parseInt(_0x5081ad(0x76))/0x3)+-parseInt(_0x5081ad(0x94))/0x4+-parseInt(_0x5081ad(0x81))/0x5+-parseInt(_0x5081ad(0x98))/0x6*(-parseInt(_0x5081ad(0x7f))/0x7)+-parseInt(_0x5081ad(0x7e))/0x8+parseInt(_0x5081ad(0x72))/0x9;if(_0x426222===_0x1d1e3f)break;else _0x30594e['push'](_0x30594e['shift']());}catch(_0x2efd35){_0x30594e['push'](_0x30594e['shift']());}}}(a233_0x1410,0x4ee9a));import{createHash}from'node:crypto';function a233_0x1410(){const _0x395038=['scope','Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','utf8','app_rule_content_invalid','hex','App\x20rule\x20file\x20is\x20blank:\x20','12287871iXfpHE','byteSize','isFile','App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','24yOhAsw','updateTime','database','contentHash','Cannot\x20access\x20app\x20rule\x20file:\x20','type','App\x20rule\x20content\x20exceeds\x20the\x205\x20MiB\x20server\x20limit.','utf-8','2054872uedXyr','1706117bzTQon','Cannot\x20read\x20app\x20rule\x20file:\x20','810795GWONPQ','app_rule_file_required','update','page-api-development','app_rule_type_invalid','231216QrYlCM','decode','--type\x20must\x20be\x20either\x20rules\x20or\x20database.','sha256:','RULES.md','131578ecGsen','content','size','byteLength','database-analysis','string','message','app_rule_content_too_large','app_rule_file_unreadable','2286840wNAgUT','from','Pass\x20a\x20UTF-8\x20Markdown\x20file.','app_rule_file_invalid','6SkoenW','trim'];a233_0x1410=function(){return _0x395038;};return a233_0x1410();}import{readFile,stat}from'node:fs/promises';import{resolve}from'node:path';import{TextDecoder}from'node:util';import{CliError}from'../../errors.js';function a233_0x315b(_0x44decb,_0x3d6e19){_0x44decb=_0x44decb-0x6e;const _0x141003=a233_0x1410();let _0x315bca=_0x141003[_0x44decb];return _0x315bca;}export const APP_RULE_TYPES=['rules',a233_0x3ff7ab(0x78)];export const MAX_APP_RULE_BYTES=0x5*0x400*0x400;const APP_RULE_FILES={'rules':a233_0x3ff7ab(0x8a),'database':'DATABASE.md'},APP_RULE_CONTEXT_SCOPES={'rules':a233_0x3ff7ab(0x84),'database':a233_0x3ff7ab(0x8f)};export function appRuleError(_0x425fb0,_0x1f2c72,_0x200ab4){return new CliError(_0x425fb0,0x1,_0x1f2c72,_0x200ab4);}export function readAppRuleType(_0x4815b1){const _0x5cad44=a233_0x3ff7ab,_0x7483f0=_0x4815b1['str'](_0x5cad44(0x7b))[_0x5cad44(0x99)]()['toLowerCase']();if(_0x7483f0!=='rules'&&_0x7483f0!==_0x5cad44(0x78))throw appRuleError(_0x5cad44(0x85),_0x5cad44(0x88));return _0x7483f0;}export function appRuleFileName(_0x2039da){return APP_RULE_FILES[_0x2039da];}export function appRuleContextScope(_0x37dae9){return APP_RULE_CONTEXT_SCOPES[_0x37dae9];}export function inspectAppRuleContent(_0xa08c32){const _0x31635a=a233_0x3ff7ab,_0x5d3255=Buffer[_0x31635a(0x95)](_0xa08c32,_0x31635a(0x6e));return{'content':_0xa08c32,'byteSize':_0x5d3255[_0x31635a(0x8e)],'contentHash':_0x31635a(0x89)+createHash('sha256')[_0x31635a(0x83)](_0x5d3255)['digest'](_0x31635a(0x70))};}export async function readAppRuleFile(_0x3bcfe8){const _0x28567d=a233_0x3ff7ab,_0x4eae3e=_0x3bcfe8['trim']();if(!_0x4eae3e)throw appRuleError(_0x28567d(0x82),'--file\x20is\x20required.',_0x28567d(0x96));const _0x31e717=resolve(_0x4eae3e);let _0x351292;try{_0x351292=await stat(_0x31e717);}catch(_0x14927c){throw appRuleError(_0x28567d(0x93),_0x28567d(0x7a)+_0x4eae3e,_0x14927c instanceof Error?_0x14927c[_0x28567d(0x91)]:String(_0x14927c));}if(!_0x351292[_0x28567d(0x74)]())throw appRuleError(_0x28567d(0x97),'App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x4eae3e);if(_0x351292[_0x28567d(0x8d)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x28567d(0x92),_0x28567d(0x7c));let _0x510549;try{_0x510549=await readFile(_0x31e717);}catch(_0x3bfb48){throw appRuleError(_0x28567d(0x93),_0x28567d(0x80)+_0x4eae3e,_0x3bfb48 instanceof Error?_0x3bfb48['message']:String(_0x3bfb48));}if(_0x510549[_0x28567d(0x8e)]>MAX_APP_RULE_BYTES)throw appRuleError('app_rule_content_too_large',_0x28567d(0x7c));let _0xd7dba4;try{_0xd7dba4=new TextDecoder(_0x28567d(0x7d),{'fatal':!![],'ignoreBOM':!![]})[_0x28567d(0x87)](_0x510549);}catch{throw appRuleError('app_rule_content_invalid',_0x28567d(0x75)+_0x4eae3e);}if(!_0xd7dba4[_0x28567d(0x99)]())throw appRuleError(_0x28567d(0x6f),_0x28567d(0x71)+_0x4eae3e);return inspectAppRuleContent(_0xd7dba4);}export function projectAppRule(_0x40331c,_0x25b08b){const _0x57f2f1=a233_0x3ff7ab;if(!_0x25b08b)return{'type':_0x40331c,'fileName':appRuleFileName(_0x40331c),'contextScope':appRuleContextScope(_0x40331c),'enabled':![]};const _0x30f7e8=inspectAppRuleContent(_0x25b08b[_0x57f2f1(0x8c)]);return{'type':_0x40331c,'fileName':appRuleFileName(_0x40331c),'contextScope':appRuleContextScope(_0x40331c),'enabled':!![],'id':_0x25b08b['id'],'scope':_0x25b08b[_0x57f2f1(0x9a)],'appCode':_0x25b08b['appCode'],'version':_0x25b08b['version'],'contentByteSize':_0x30f7e8[_0x57f2f1(0x73)],'contentHash':_0x30f7e8[_0x57f2f1(0x79)],..._0x25b08b['createTime']!==undefined&&_0x25b08b['createTime']!==null?{'createTime':_0x25b08b['createTime']}:{},..._0x25b08b[_0x57f2f1(0x77)]!==undefined&&_0x25b08b[_0x57f2f1(0x77)]!==null?{'updateTime':_0x25b08b[_0x57f2f1(0x77)]}:{}};}export const APP_RULE_TYPE_FLAG={'name':'type','type':a233_0x3ff7ab(0x90),'required':!![],'description':a233_0x3ff7ab(0x9b),'enum':[...APP_RULE_TYPES]};
1
+ const a233_0x49873a=a233_0x3ce8;(function(_0x4d2ccf,_0x40d475){const _0x2e84fd=a233_0x3ce8,_0x27fc41=_0x4d2ccf();while(!![]){try{const _0x44ecb7=-parseInt(_0x2e84fd(0x13d))/0x1*(parseInt(_0x2e84fd(0x131))/0x2)+-parseInt(_0x2e84fd(0x122))/0x3*(parseInt(_0x2e84fd(0x12c))/0x4)+parseInt(_0x2e84fd(0x11a))/0x5+parseInt(_0x2e84fd(0x12d))/0x6*(parseInt(_0x2e84fd(0x144))/0x7)+parseInt(_0x2e84fd(0x149))/0x8*(parseInt(_0x2e84fd(0x12f))/0x9)+-parseInt(_0x2e84fd(0x124))/0xa*(-parseInt(_0x2e84fd(0x11d))/0xb)+-parseInt(_0x2e84fd(0x130))/0xc;if(_0x44ecb7===_0x40d475)break;else _0x27fc41['push'](_0x27fc41['shift']());}catch(_0x19be3a){_0x27fc41['push'](_0x27fc41['shift']());}}}(a233_0x236e,0xb9d4e));import{createHash}from'node:crypto';function a233_0x236e(){const _0x517fe3=['version','--type\x20must\x20be\x20either\x20rules\x20or\x20database.','sha256','app_rule_content_invalid','decode','Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','1268zwgVFM','7913832yAwqad','app_rule_type_invalid','12628323SaSeYg','20790516jfeins','2129036WpTpVu','size','app_rule_file_unreadable','hex','update','digest','message','page-api-development','type','utf-8','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','app_rule_file_invalid','1BRGlXq','app_rule_content_too_large','createTime','DATABASE.md','Cannot\x20access\x20app\x20rule\x20file:\x20','updateTime','App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','7baKAqz','isFile','App\x20rule\x20file\x20is\x20blank:\x20','sha256:','toLowerCase','8PBYTcI','RULES.md','App\x20rule\x20content\x20exceeds\x20the\x205\x20MiB\x20server\x20limit.','database','appCode','content','scope','5554100LHptYI','byteSize','Pass\x20a\x20UTF-8\x20Markdown\x20file.','2522498XNXkWc','rules','trim','database-analysis','str','4770yaWixD','--file\x20is\x20required.','10hsmgKI','utf8'];a233_0x236e=function(){return _0x517fe3;};return a233_0x236e();}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=[a233_0x49873a(0x11e),a233_0x49873a(0x14c)];export const MAX_APP_RULE_BYTES=0x5*0x400*0x400;const APP_RULE_FILES={'rules':a233_0x49873a(0x14a),'database':a233_0x49873a(0x140)},APP_RULE_CONTEXT_SCOPES={'rules':a233_0x49873a(0x138),'database':a233_0x49873a(0x120)};export function appRuleError(_0x267fff,_0x58543c,_0x401095){return new CliError(_0x267fff,0x1,_0x58543c,_0x401095);}export function readAppRuleType(_0x3afc81){const _0x705d46=a233_0x49873a,_0x539bd5=_0x3afc81[_0x705d46(0x121)](_0x705d46(0x139))[_0x705d46(0x11f)]()[_0x705d46(0x148)]();if(_0x539bd5!==_0x705d46(0x11e)&&_0x539bd5!==_0x705d46(0x14c))throw appRuleError(_0x705d46(0x12e),_0x705d46(0x127));return _0x539bd5;}export function appRuleFileName(_0x59d070){return APP_RULE_FILES[_0x59d070];}export function appRuleContextScope(_0x29a76a){return APP_RULE_CONTEXT_SCOPES[_0x29a76a];}export function inspectAppRuleContent(_0x4eca0c){const _0x2fd97a=a233_0x49873a,_0x4f52a7=Buffer['from'](_0x4eca0c,_0x2fd97a(0x125));return{'content':_0x4eca0c,'byteSize':_0x4f52a7['byteLength'],'contentHash':_0x2fd97a(0x147)+createHash(_0x2fd97a(0x128))[_0x2fd97a(0x135)](_0x4f52a7)[_0x2fd97a(0x136)](_0x2fd97a(0x134))};}export async function readAppRuleFile(_0x302e6f){const _0x2537e7=a233_0x49873a,_0x3e0bab=_0x302e6f[_0x2537e7(0x11f)]();if(!_0x3e0bab)throw appRuleError('app_rule_file_required',_0x2537e7(0x123),_0x2537e7(0x11c));const _0x3c5b5a=resolve(_0x3e0bab);let _0x1c84b5;try{_0x1c84b5=await stat(_0x3c5b5a);}catch(_0x47d438){throw appRuleError(_0x2537e7(0x133),_0x2537e7(0x141)+_0x3e0bab,_0x47d438 instanceof Error?_0x47d438[_0x2537e7(0x137)]:String(_0x47d438));}if(!_0x1c84b5[_0x2537e7(0x145)]())throw appRuleError(_0x2537e7(0x13c),_0x2537e7(0x13b)+_0x3e0bab);if(_0x1c84b5[_0x2537e7(0x132)]>MAX_APP_RULE_BYTES)throw appRuleError('app_rule_content_too_large',_0x2537e7(0x14b));let _0x1eb023;try{_0x1eb023=await readFile(_0x3c5b5a);}catch(_0xca61ba){throw appRuleError('app_rule_file_unreadable','Cannot\x20read\x20app\x20rule\x20file:\x20'+_0x3e0bab,_0xca61ba instanceof Error?_0xca61ba[_0x2537e7(0x137)]:String(_0xca61ba));}if(_0x1eb023['byteLength']>MAX_APP_RULE_BYTES)throw appRuleError(_0x2537e7(0x13e),_0x2537e7(0x14b));let _0xa9ea0;try{_0xa9ea0=new TextDecoder(_0x2537e7(0x13a),{'fatal':!![],'ignoreBOM':!![]})[_0x2537e7(0x12a)](_0x1eb023);}catch{throw appRuleError('app_rule_content_invalid',_0x2537e7(0x143)+_0x3e0bab);}if(!_0xa9ea0[_0x2537e7(0x11f)]())throw appRuleError(_0x2537e7(0x129),_0x2537e7(0x146)+_0x3e0bab);return inspectAppRuleContent(_0xa9ea0);}function a233_0x3ce8(_0x1f7f0f,_0x149a34){_0x1f7f0f=_0x1f7f0f-0x11a;const _0x236e25=a233_0x236e();let _0x3ce824=_0x236e25[_0x1f7f0f];return _0x3ce824;}export function projectAppRule(_0x5cdcbb,_0x1a78ba){const _0xafe061=a233_0x49873a;if(!_0x1a78ba)return{'type':_0x5cdcbb,'fileName':appRuleFileName(_0x5cdcbb),'contextScope':appRuleContextScope(_0x5cdcbb),'enabled':![]};const _0x252f43=inspectAppRuleContent(_0x1a78ba[_0xafe061(0x14e)]);return{'type':_0x5cdcbb,'fileName':appRuleFileName(_0x5cdcbb),'contextScope':appRuleContextScope(_0x5cdcbb),'enabled':!![],'id':_0x1a78ba['id'],'scope':_0x1a78ba[_0xafe061(0x14f)],'appCode':_0x1a78ba[_0xafe061(0x14d)],'version':_0x1a78ba[_0xafe061(0x126)],'contentByteSize':_0x252f43[_0xafe061(0x11b)],'contentHash':_0x252f43['contentHash'],..._0x1a78ba[_0xafe061(0x13f)]!==undefined&&_0x1a78ba['createTime']!==null?{'createTime':_0x1a78ba['createTime']}:{},..._0x1a78ba[_0xafe061(0x142)]!==undefined&&_0x1a78ba[_0xafe061(0x142)]!==null?{'updateTime':_0x1a78ba[_0xafe061(0x142)]}:{}};}export const APP_RULE_TYPE_FLAG={'name':'type','type':'string','required':!![],'description':a233_0x49873a(0x12b),'enum':[...APP_RULE_TYPES]};
@@ -1 +1 @@
1
- const a234_0x2cf3a9=a234_0x3fe9;(function(_0x4b03a4,_0x43a606){const _0x1d9f3e=a234_0x3fe9,_0x2e8553=_0x4b03a4();while(!![]){try{const _0x1e85ec=parseInt(_0x1d9f3e(0x15d))/0x1*(-parseInt(_0x1d9f3e(0x19f))/0x2)+-parseInt(_0x1d9f3e(0x167))/0x3*(parseInt(_0x1d9f3e(0x187))/0x4)+parseInt(_0x1d9f3e(0x173))/0x5*(parseInt(_0x1d9f3e(0x164))/0x6)+parseInt(_0x1d9f3e(0x199))/0x7*(-parseInt(_0x1d9f3e(0x15b))/0x8)+parseInt(_0x1d9f3e(0x18e))/0x9*(-parseInt(_0x1d9f3e(0x166))/0xa)+parseInt(_0x1d9f3e(0x19e))/0xb*(-parseInt(_0x1d9f3e(0x193))/0xc)+-parseInt(_0x1d9f3e(0x18d))/0xd*(-parseInt(_0x1d9f3e(0x17c))/0xe);if(_0x1e85ec===_0x43a606)break;else _0x2e8553['push'](_0x2e8553['shift']());}catch(_0x5ecb47){_0x2e8553['push'](_0x2e8553['shift']());}}}(a234_0x27eb,0x2b461));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{findProjectRootDirectory,resolveConfigPath}from'../../context/config-loader.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set(['start',a234_0x2cf3a9(0x183)]),DOMAIN_ROUTING_SYNC_SCRIPTS=new Set([a234_0x2cf3a9(0x195),a234_0x2cf3a9(0x183),'build',a234_0x2cf3a9(0x190)]);export function syncProjectDomainRoutingBeforeScript(_0x4d12ac,_0x1df649){const _0x5e3b01=a234_0x2cf3a9;if(!DOMAIN_ROUTING_SYNC_SCRIPTS[_0x5e3b01(0x160)](_0x1df649))return null;const _0x12481f=findProjectRootDirectory(_0x4d12ac);if(!resolveConfigPath(_0x12481f))return null;const _0x12ef7b=writeProjectDomainRoutingManifest(_0x12481f);return{'path':_0x12ef7b[_0x5e3b01(0x15e)],'changed':_0x12ef7b['changed']};}function readPackageScripts(_0x10b49e){const _0x3555d2=a234_0x2cf3a9,_0x1ce207=resolve(_0x10b49e,_0x3555d2(0x15c));if(!existsSync(_0x1ce207))return null;try{const _0x586cf0=JSON[_0x3555d2(0x163)](readFileSync(_0x1ce207,_0x3555d2(0x161)));return _0x586cf0[_0x3555d2(0x19c)]??{};}catch{return null;}}function a234_0x27eb(){const _0x529001=['cwd','Enable\x20watch\x20mode\x20for\x20preview','\x20run\x20','yarn.lock','length','yarn','script','Domain\x20routing\x20synchronized:\x20','228952VriHMi','package.json','3QSuYKy','path','\x20run\x20preview','has','utf-8','boolean','parse','54dauJBl','No\x20package.json\x20found\x20in\x20current\x20directory.','10gwZyIB','3KLPWtW','pnpm-lock.yaml','changed','log','vite\x20preview\x20exited\x20with\x20code\x20','bool','error','keys','Script\x20\x22','pnpm','validation','watch','152010YMLxZq','bun','\x0a\x20\x20Available\x20scripts:\x0a','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','\x20exited\x20with\x20code\x20','build','Run\x20a\x20package.json\x20script','close','push','1414bOGlLt','Available:\x20','join','\x20run\x20<script>\x0a','inherit','No\x20scripts\x20defined\x20in\x20package.json.','slice','dev','\x22\x20not\x20found\x20in\x20package.json.','node_modules','write','267528jghjKn','bun.lockb','\x20\x20\x20\x20','\x0a\x20\x20Usage:\x20','needsUpgrade','bun.lock','102401qtAXNW','241551krJkku','run','preview','Script\x20name\x20defined\x20in\x20package.json','\x20run\x20build','8220oUPxni','\x20run\x20preview\x20--watch','start','vite','--watch','.bin','35vMvjJq','npm','\x20run\x20start','scripts','args','5533WQUrsh','207050axGRqU'];a234_0x27eb=function(){return _0x529001;};return a234_0x27eb();}function a234_0x3fe9(_0x372f7e,_0x5debad){_0x372f7e=_0x372f7e-0x156;const _0x27ebb3=a234_0x27eb();let _0x3fe956=_0x27ebb3[_0x372f7e];return _0x3fe956;}function detectPackageManager(_0x23007a){const _0x17eee5=a234_0x2cf3a9;if(existsSync(resolve(_0x23007a,_0x17eee5(0x188)))||existsSync(resolve(_0x23007a,_0x17eee5(0x18c))))return _0x17eee5(0x174);if(existsSync(resolve(_0x23007a,_0x17eee5(0x168))))return _0x17eee5(0x170);if(existsSync(resolve(_0x23007a,_0x17eee5(0x156))))return _0x17eee5(0x158);return _0x17eee5(0x19a);}async function versionCheck(_0x43b585){const _0x2c0dc3=a234_0x2cf3a9,_0x361ab4=await checkCliVersion();(_0x361ab4[_0x2c0dc3(0x18b)]||_0x361ab4['belowMinimum'])&&(printCliUpgradeWarning(_0x361ab4),assertCliVersionSupported(_0x361ab4));const _0x49cf26=await checkSdkVersion(_0x43b585);if(_0x49cf26[_0x2c0dc3(0x18b)])printSdkUpgradeWarning(_0x49cf26);}function spawnScript(_0x54d90c,_0x432982,_0x3b8b26,_0x4a4e38){return new Promise((_0x168b12,_0x25a7d7)=>{const _0x5f2d3f=a234_0x3fe9,_0x5eaa34=[_0x5f2d3f(0x18f),_0x432982,..._0x3b8b26],_0x4be093=spawn(_0x54d90c,_0x5eaa34,{'cwd':_0x4a4e38,'stdio':_0x5f2d3f(0x180),'shell':!![],'env':{...process.env,'PATH':''+join(_0x4a4e38,_0x5f2d3f(0x185),_0x5f2d3f(0x198))+delimiter+process.env.PATH}});_0x4be093['on'](_0x5f2d3f(0x17a),_0x1ef416=>{const _0xac27e=_0x5f2d3f;if(_0x1ef416===0x0||_0x1ef416===null)_0x168b12();else _0x25a7d7(new Error(_0x54d90c+_0xac27e(0x1a2)+_0x432982+_0xac27e(0x177)+_0x1ef416));}),_0x4be093['on'](_0x5f2d3f(0x16d),_0x25a7d7);});}function spawnViteBuildWatch(_0x53db10){return new Promise((_0x11dabe,_0x3359dd)=>{const _0x110e02=a234_0x3fe9,_0x443688=spawn(_0x110e02(0x196),[_0x110e02(0x178),_0x110e02(0x197)],{'cwd':_0x53db10,'stdio':_0x110e02(0x180),'shell':!![],'env':{...process.env,'PATH':''+join(_0x53db10,_0x110e02(0x185),_0x110e02(0x198))+delimiter+process.env.PATH}});_0x443688['on']('close',_0x2b7639=>{const _0x4e19ba=_0x110e02;if(_0x2b7639===0x0||_0x2b7639===null)_0x11dabe();else _0x3359dd(new Error(_0x4e19ba(0x176)+_0x2b7639));}),_0x443688['on'](_0x110e02(0x16d),_0x3359dd);});}function spawnVitePreview(_0x2e1f6a){return new Promise((_0x3d4ccb,_0x254e6a)=>{const _0x1b9b06=a234_0x3fe9,_0x28c85e=spawn(_0x1b9b06(0x196),[_0x1b9b06(0x190)],{'cwd':_0x2e1f6a,'stdio':_0x1b9b06(0x180),'shell':!![],'env':{...process.env,'PATH':''+join(_0x2e1f6a,'node_modules',_0x1b9b06(0x198))+delimiter+process.env.PATH}});_0x28c85e['on']('close',_0x2c1ab6=>{const _0x5abf1=_0x1b9b06;if(_0x2c1ab6===0x0||_0x2c1ab6===null)_0x3d4ccb();else _0x254e6a(new Error(_0x5abf1(0x16b)+_0x2c1ab6));}),_0x28c85e['on']('error',_0x254e6a);});}const runFlags=[{'name':a234_0x2cf3a9(0x172),'type':a234_0x2cf3a9(0x162),'description':a234_0x2cf3a9(0x1a1),'default':![]}];export const runDefinition={'service':a234_0x2cf3a9(0x18f),'command':'run','description':a234_0x2cf3a9(0x179),'risk':a234_0x2cf3a9(0x186),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a234_0x2cf3a9(0x159),'description':a234_0x2cf3a9(0x191),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0xecfaa2=a234_0x2cf3a9,_0x13a6f6=[];return _0x13a6f6[_0xecfaa2(0x17b)]('\x20\x20EXAMPLES'),_0x13a6f6[_0xecfaa2(0x17b)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0xecfaa2(0x19b)),_0x13a6f6[_0xecfaa2(0x17b)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0xecfaa2(0x192)),_0x13a6f6['push'](_0xecfaa2(0x189)+CLI_BIN_NAME+_0xecfaa2(0x15f)),_0x13a6f6['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0xecfaa2(0x194)),_0x13a6f6[_0xecfaa2(0x17e)]('\x0a');},async 'execute'(_0x43922a){const _0x25239e=a234_0x2cf3a9,_0x2ae530=process[_0x25239e(0x1a0)](),_0x696def=_0x43922a[_0x25239e(0x19d)][0x0],_0x450792=_0x43922a[_0x25239e(0x19d)][_0x25239e(0x182)](0x1),_0x62b9b4=readPackageScripts(_0x2ae530);if(!_0x62b9b4)throw CliErrors[_0x25239e(0x171)](_0x25239e(0x165));if(!_0x696def){const _0x401a99=Object[_0x25239e(0x16e)](_0x62b9b4);if(_0x401a99[_0x25239e(0x157)]===0x0)console[_0x25239e(0x16a)](_0x25239e(0x181));else{console[_0x25239e(0x16a)](_0x25239e(0x175));for(const _0x3b0b67 of _0x401a99){console[_0x25239e(0x16a)](_0x25239e(0x189)+_0x3b0b67);}console[_0x25239e(0x16a)](_0x25239e(0x18a)+CLI_BIN_NAME+_0x25239e(0x17f));}return{'ok':!![]};}if(!_0x62b9b4[_0x696def])throw CliErrors['validation'](_0x25239e(0x16f)+_0x696def+_0x25239e(0x184),_0x25239e(0x17d)+(Object[_0x25239e(0x16e)](_0x62b9b4)[_0x25239e(0x17e)](',\x20')||'(none)'));const _0x85c3df=detectPackageManager(_0x2ae530),_0x1b04bd=syncProjectDomainRoutingBeforeScript(_0x2ae530,_0x696def);_0x1b04bd?.[_0x25239e(0x169)]&&console['error'](_0x25239e(0x15a)+_0x1b04bd[_0x25239e(0x15e)]);VERSION_CHECK_SCRIPTS[_0x25239e(0x160)](_0x696def)&&await versionCheck(_0x2ae530);if(_0x696def===_0x25239e(0x190)&&_0x43922a[_0x25239e(0x16c)](_0x25239e(0x172)))return await Promise['all']([spawnViteBuildWatch(_0x2ae530),spawnVitePreview(_0x2ae530)]),{'ok':!![]};return await spawnScript(_0x85c3df,_0x696def,_0x450792,_0x2ae530),{'ok':!![]};}};
1
+ const a234_0xe707ed=a234_0xa91e;(function(_0x91b94,_0x5ad450){const _0x5e7e5d=a234_0xa91e,_0x5ca4fc=_0x91b94();while(!![]){try{const _0x4bba92=-parseInt(_0x5e7e5d(0x1d4))/0x1+-parseInt(_0x5e7e5d(0x1f8))/0x2+-parseInt(_0x5e7e5d(0x1cf))/0x3+parseInt(_0x5e7e5d(0x1f7))/0x4+-parseInt(_0x5e7e5d(0x1f6))/0x5+parseInt(_0x5e7e5d(0x1c4))/0x6*(-parseInt(_0x5e7e5d(0x1f5))/0x7)+-parseInt(_0x5e7e5d(0x1ef))/0x8*(-parseInt(_0x5e7e5d(0x1de))/0x9);if(_0x4bba92===_0x5ad450)break;else _0x5ca4fc['push'](_0x5ca4fc['shift']());}catch(_0x189247){_0x5ca4fc['push'](_0x5ca4fc['shift']());}}}(a234_0x5709,0x72a11));import{readFileSync,existsSync}from'node:fs';function a234_0x5709(){const _0x2f77bc=['\x20run\x20start','watch','Run\x20a\x20package.json\x20script','bun.lockb','has','length','inherit','2326920VjTFxy','run','package.json','.bin','dev','546945swVfNP','boolean','log','keys','cwd','\x20\x20\x20\x20','Domain\x20routing\x20synchronized:\x20','join','utf-8','preview','9kUAyBV','path','changed','\x20run\x20','error','validation','parse','\x20run\x20<script>\x0a','\x20run\x20preview','bun.lock','\x20exited\x20with\x20code\x20','No\x20scripts\x20defined\x20in\x20package.json.','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','node_modules','belowMinimum','build','(none)','20883608GEFMEV','Available:\x20','\x0a\x20\x20Usage:\x20','npm','needsUpgrade','scripts','19733IWsFIx','2522040gCElpS','2042956JZooNf','1249054ADszCE','\x20\x20EXAMPLES','args','vite','close','Script\x20\x22','push','pnpm','yarn.lock','Enable\x20watch\x20mode\x20for\x20preview','426irlsHE','start','yarn','bool'];a234_0x5709=function(){return _0x2f77bc;};return a234_0x5709();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{findProjectRootDirectory,resolveConfigPath}from'../../context/config-loader.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a234_0xe707ed(0x1c5),a234_0xe707ed(0x1d3)]),DOMAIN_ROUTING_SYNC_SCRIPTS=new Set([a234_0xe707ed(0x1c5),a234_0xe707ed(0x1d3),a234_0xe707ed(0x1ed),a234_0xe707ed(0x1dd)]);export function syncProjectDomainRoutingBeforeScript(_0x27daff,_0x6dc0bf){const _0x2df99a=a234_0xe707ed;if(!DOMAIN_ROUTING_SYNC_SCRIPTS[_0x2df99a(0x1cc)](_0x6dc0bf))return null;const _0x1d83b3=findProjectRootDirectory(_0x27daff);if(!resolveConfigPath(_0x1d83b3))return null;const _0x2e1865=writeProjectDomainRoutingManifest(_0x1d83b3);return{'path':_0x2e1865[_0x2df99a(0x1df)],'changed':_0x2e1865[_0x2df99a(0x1e0)]};}function a234_0xa91e(_0x2f71b5,_0x1ec80e){_0x2f71b5=_0x2f71b5-0x1bb;const _0x570986=a234_0x5709();let _0xa91e18=_0x570986[_0x2f71b5];return _0xa91e18;}function readPackageScripts(_0x2fd26d){const _0x5559cc=a234_0xe707ed,_0x2c1abf=resolve(_0x2fd26d,_0x5559cc(0x1d1));if(!existsSync(_0x2c1abf))return null;try{const _0x18efed=JSON[_0x5559cc(0x1e4)](readFileSync(_0x2c1abf,_0x5559cc(0x1dc)));return _0x18efed[_0x5559cc(0x1f4)]??{};}catch{return null;}}function detectPackageManager(_0x4b01a5){const _0x2426d1=a234_0xe707ed;if(existsSync(resolve(_0x4b01a5,_0x2426d1(0x1cb)))||existsSync(resolve(_0x4b01a5,_0x2426d1(0x1e7))))return'bun';if(existsSync(resolve(_0x4b01a5,'pnpm-lock.yaml')))return _0x2426d1(0x1c1);if(existsSync(resolve(_0x4b01a5,_0x2426d1(0x1c2))))return _0x2426d1(0x1c6);return _0x2426d1(0x1f2);}async function versionCheck(_0x3f56d0){const _0x587991=a234_0xe707ed,_0x4f18a9=await checkCliVersion();(_0x4f18a9[_0x587991(0x1f3)]||_0x4f18a9[_0x587991(0x1ec)])&&(printCliUpgradeWarning(_0x4f18a9),assertCliVersionSupported(_0x4f18a9));const _0x355a97=await checkSdkVersion(_0x3f56d0);if(_0x355a97['needsUpgrade'])printSdkUpgradeWarning(_0x355a97);}function spawnScript(_0x5e6007,_0x52a794,_0x1a161f,_0x33b945){return new Promise((_0x5df588,_0x4a4b29)=>{const _0x446c0e=a234_0xa91e,_0x2ff5d5=['run',_0x52a794,..._0x1a161f],_0x4b8977=spawn(_0x5e6007,_0x2ff5d5,{'cwd':_0x33b945,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x33b945,'node_modules',_0x446c0e(0x1d2))+delimiter+process.env.PATH}});_0x4b8977['on'](_0x446c0e(0x1be),_0x5426f9=>{const _0x4bbbc4=_0x446c0e;if(_0x5426f9===0x0||_0x5426f9===null)_0x5df588();else _0x4a4b29(new Error(_0x5e6007+_0x4bbbc4(0x1e1)+_0x52a794+_0x4bbbc4(0x1e8)+_0x5426f9));}),_0x4b8977['on'](_0x446c0e(0x1e2),_0x4a4b29);});}function spawnViteBuildWatch(_0x319a99){return new Promise((_0x43a3f5,_0x21d441)=>{const _0x320a95=a234_0xa91e,_0xe0a189=spawn(_0x320a95(0x1bd),[_0x320a95(0x1ed),'--watch'],{'cwd':_0x319a99,'stdio':_0x320a95(0x1ce),'shell':!![],'env':{...process.env,'PATH':''+join(_0x319a99,_0x320a95(0x1eb),'.bin')+delimiter+process.env.PATH}});_0xe0a189['on'](_0x320a95(0x1be),_0x464800=>{const _0x5f5bb6=_0x320a95;if(_0x464800===0x0||_0x464800===null)_0x43a3f5();else _0x21d441(new Error(_0x5f5bb6(0x1ea)+_0x464800));}),_0xe0a189['on'](_0x320a95(0x1e2),_0x21d441);});}function spawnVitePreview(_0x5d0090){return new Promise((_0x181bc0,_0x4978e6)=>{const _0x4a6a00=a234_0xa91e,_0x33bc49=spawn(_0x4a6a00(0x1bd),[_0x4a6a00(0x1dd)],{'cwd':_0x5d0090,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x5d0090,'node_modules',_0x4a6a00(0x1d2))+delimiter+process.env.PATH}});_0x33bc49['on'](_0x4a6a00(0x1be),_0x46340c=>{if(_0x46340c===0x0||_0x46340c===null)_0x181bc0();else _0x4978e6(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x46340c));}),_0x33bc49['on'](_0x4a6a00(0x1e2),_0x4978e6);});}const runFlags=[{'name':'watch','type':a234_0xe707ed(0x1d5),'description':a234_0xe707ed(0x1c3),'default':![]}];export const runDefinition={'service':'run','command':a234_0xe707ed(0x1d0),'description':a234_0xe707ed(0x1ca),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'script','description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x4d1204=a234_0xe707ed,_0x5ac213=[];return _0x5ac213['push'](_0x4d1204(0x1bb)),_0x5ac213['push'](_0x4d1204(0x1d9)+CLI_BIN_NAME+_0x4d1204(0x1c8)),_0x5ac213[_0x4d1204(0x1c0)]('\x20\x20\x20\x20'+CLI_BIN_NAME+'\x20run\x20build'),_0x5ac213[_0x4d1204(0x1c0)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x4d1204(0x1e6)),_0x5ac213[_0x4d1204(0x1c0)]('\x20\x20\x20\x20'+CLI_BIN_NAME+'\x20run\x20preview\x20--watch'),_0x5ac213[_0x4d1204(0x1db)]('\x0a');},async 'execute'(_0x3f5330){const _0x338e33=a234_0xe707ed,_0x1e8132=process[_0x338e33(0x1d8)](),_0x530d4e=_0x3f5330['args'][0x0],_0x149433=_0x3f5330[_0x338e33(0x1bc)]['slice'](0x1),_0x13811c=readPackageScripts(_0x1e8132);if(!_0x13811c)throw CliErrors[_0x338e33(0x1e3)]('No\x20package.json\x20found\x20in\x20current\x20directory.');if(!_0x530d4e){const _0x3f0d8a=Object[_0x338e33(0x1d7)](_0x13811c);if(_0x3f0d8a[_0x338e33(0x1cd)]===0x0)console[_0x338e33(0x1d6)](_0x338e33(0x1e9));else{console[_0x338e33(0x1d6)]('\x0a\x20\x20Available\x20scripts:\x0a');for(const _0x2d58c6 of _0x3f0d8a){console[_0x338e33(0x1d6)](_0x338e33(0x1d9)+_0x2d58c6);}console[_0x338e33(0x1d6)](_0x338e33(0x1f1)+CLI_BIN_NAME+_0x338e33(0x1e5));}return{'ok':!![]};}if(!_0x13811c[_0x530d4e])throw CliErrors['validation'](_0x338e33(0x1bf)+_0x530d4e+'\x22\x20not\x20found\x20in\x20package.json.',_0x338e33(0x1f0)+(Object[_0x338e33(0x1d7)](_0x13811c)['join'](',\x20')||_0x338e33(0x1ee)));const _0x86ab5a=detectPackageManager(_0x1e8132),_0x3d9761=syncProjectDomainRoutingBeforeScript(_0x1e8132,_0x530d4e);_0x3d9761?.[_0x338e33(0x1e0)]&&console[_0x338e33(0x1e2)](_0x338e33(0x1da)+_0x3d9761[_0x338e33(0x1df)]);VERSION_CHECK_SCRIPTS[_0x338e33(0x1cc)](_0x530d4e)&&await versionCheck(_0x1e8132);if(_0x530d4e===_0x338e33(0x1dd)&&_0x3f5330[_0x338e33(0x1c7)](_0x338e33(0x1c9)))return await Promise['all']([spawnViteBuildWatch(_0x1e8132),spawnVitePreview(_0x1e8132)]),{'ok':!![]};return await spawnScript(_0x86ab5a,_0x530d4e,_0x149433,_0x1e8132),{'ok':!![]};}};
@@ -1 +1 @@
1
- const a235_0x1216c6=a235_0x5942;(function(_0x24b22e,_0x2e77ef){const _0x1661fc=a235_0x5942,_0x34a0c8=_0x24b22e();while(!![]){try{const _0x2f4ab2=parseInt(_0x1661fc(0x17a))/0x1*(parseInt(_0x1661fc(0x176))/0x2)+parseInt(_0x1661fc(0x17c))/0x3+parseInt(_0x1661fc(0x17d))/0x4+-parseInt(_0x1661fc(0x177))/0x5+-parseInt(_0x1661fc(0x173))/0x6+-parseInt(_0x1661fc(0x178))/0x7*(parseInt(_0x1661fc(0x17f))/0x8)+parseInt(_0x1661fc(0x17e))/0x9;if(_0x2f4ab2===_0x2e77ef)break;else _0x34a0c8['push'](_0x34a0c8['shift']());}catch(_0x263375){_0x34a0c8['push'](_0x34a0c8['shift']());}}}(a235_0x3a7e,0xa49f0));import{buildSchemaPayload}from'../framework/schema-export.js';function a235_0x5942(_0x25be8d,_0x2574c6){_0x25be8d=_0x25be8d-0x173;const _0x3a7e2e=a235_0x3a7e();let _0x594222=_0x3a7e2e[_0x25be8d];return _0x594222;}function a235_0x3a7e(){const _0x4de1da=['read','37NfCiGh','json','1406817hxNqka','601080eCuSsp','6491196zErIkS','8ClxMHS','export','1441932sqDCXV','Export\x20machine-readable\x20command\x20schema\x20(JSON)','schema','28586tYGgAx','744875erHPUX','5639963wJVFnE'];a235_0x3a7e=function(){return _0x4de1da;};return a235_0x3a7e();}async function execute(_0xc94089){const _0x12c0e2=await buildSchemaPayload();return{'ok':!![],'data':_0x12c0e2};}export const schemaDefinition={'service':a235_0x1216c6(0x175),'command':a235_0x1216c6(0x180),'description':a235_0x1216c6(0x174),'risk':a235_0x1216c6(0x179),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a235_0x1216c6(0x17b),'flags':[],'execute':execute};
1
+ function a235_0x1378(_0x78e9d5,_0x2faaaa){_0x78e9d5=_0x78e9d5-0x93;const _0x455f9e=a235_0x455f();let _0x13787c=_0x455f9e[_0x78e9d5];return _0x13787c;}const a235_0x30f963=a235_0x1378;(function(_0x1da63c,_0xd2c8f2){const _0x1e2194=a235_0x1378,_0x3435fe=_0x1da63c();while(!![]){try{const _0x672e58=parseInt(_0x1e2194(0x97))/0x1+parseInt(_0x1e2194(0x9b))/0x2*(-parseInt(_0x1e2194(0x9e))/0x3)+-parseInt(_0x1e2194(0x99))/0x4+-parseInt(_0x1e2194(0x9f))/0x5+-parseInt(_0x1e2194(0x9c))/0x6*(-parseInt(_0x1e2194(0x98))/0x7)+parseInt(_0x1e2194(0x9d))/0x8*(-parseInt(_0x1e2194(0x95))/0x9)+parseInt(_0x1e2194(0x94))/0xa*(parseInt(_0x1e2194(0xa0))/0xb);if(_0x672e58===_0xd2c8f2)break;else _0x3435fe['push'](_0x3435fe['shift']());}catch(_0x5ae38c){_0x3435fe['push'](_0x3435fe['shift']());}}}(a235_0x455f,0x7b7f3));function a235_0x455f(){const _0x384dac=['read','546711zysaaR','1894655rzKJCD','946388CuFtrR','json','6DczjWN','6DQxtwm','417400ddYOHF','967728YDhVdK','1340580UzxLKk','49027YorWWD','schema','3190kICXXo','45ZnPAfM'];a235_0x455f=function(){return _0x384dac;};return a235_0x455f();}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x22df2e){const _0x2597f6=await buildSchemaPayload();return{'ok':!![],'data':_0x2597f6};}export const schemaDefinition={'service':a235_0x30f963(0x93),'command':'export','description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a235_0x30f963(0x96),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a235_0x30f963(0x9a),'flags':[],'execute':execute};
@@ -1 +1 @@
1
- const a236_0xfd8194=a236_0x5d03;(function(_0x578ca2,_0x2d982c){const _0xfaa205=a236_0x5d03,_0xa0b259=_0x578ca2();while(!![]){try{const _0x55d601=-parseInt(_0xfaa205(0x1ce))/0x1*(-parseInt(_0xfaa205(0x1e1))/0x2)+-parseInt(_0xfaa205(0x1d8))/0x3*(-parseInt(_0xfaa205(0x1da))/0x4)+parseInt(_0xfaa205(0x1d5))/0x5+parseInt(_0xfaa205(0x1b5))/0x6*(-parseInt(_0xfaa205(0x1b9))/0x7)+parseInt(_0xfaa205(0x1dc))/0x8+parseInt(_0xfaa205(0x1c6))/0x9+parseInt(_0xfaa205(0x1ad))/0xa*(-parseInt(_0xfaa205(0x1d2))/0xb);if(_0x55d601===_0x2d982c)break;else _0xa0b259['push'](_0xa0b259['shift']());}catch(_0x5089eb){_0xa0b259['push'](_0xa0b259['shift']());}}}(a236_0x5638,0xa91c8));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 a236_0x5d03(_0x37d929,_0x1ff9b0){_0x37d929=_0x37d929-0x1ab;const _0x5638db=a236_0x5638();let _0x5d0394=_0x5638db[_0x37d929];return _0x5d0394;}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(_0x1bd0e2){const _0x9c9441=a236_0x5d03;if(_0x1bd0e2===_0x9c9441(0x1dd))return[_0x9c9441(0x1d0),_0x9c9441(0x1bb),_0x9c9441(0x1d7),'']['join']('\x0a');return['SELECT\x201\x20AS\x20id;','']['join']('\x0a');}function a236_0x5638(){const _0x166b2d=['db-id','10037259lbNPmR','Select\x20the\x20local\x20SQL\x20mode:','number','/smartapi/custom/saveUserCustomSql','write','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','Target\x20database\x20ID','dbId\x20cannot\x20be\x20empty','7zkrJwR','description','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','isFinite','55aWpPXa','__manual__','For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly','635790hOSKWI','sqlRoot','</select>','154221sCdkYR','toISOString','52EcBQtS','dbId','10116936sHzHKk','mybatisXml','Invalid\x20database\x20selection\x20payload:\x20','string','POST','132122qtNnqq','validation','str','catch','new','sqls','isInteger','utf8','nonInteractive','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','flagMissing','lastSync','SQL\x20name\x20cannot\x20be\x20empty','sql','5700830ALePNz','File\x20already\x20exists:\x20','flag','parse','Select\x20the\x20target\x20database:','appCode','dbName','create','6KqBrST','sqlCode','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','lockFilePath','662543bNxKTi','sqlRootDir','\x20\x20SELECT\x201\x20AS\x20id','Plain\x20SQL\x20(sql)','name','<server-generated-sqlCode>','trim','MyBatis\x20XML\x20(mybatisXml)','Created\x20SQL\x20query\x20','mode','length','✎\x20Enter\x20dbId\x20manually'];a236_0x5638=function(){return _0x166b2d;};return a236_0x5638();}export const sqlCreate={'service':a236_0xfd8194(0x1ac),'command':a236_0xfd8194(0x1b4),'description':a236_0xfd8194(0x1b7),'risk':a236_0xfd8194(0x1ca),'flags':[{'name':'name','type':a236_0xfd8194(0x1df),'description':'SQL\x20query\x20display\x20name'},{'name':a236_0xfd8194(0x1c5),'type':a236_0xfd8194(0x1c8),'description':a236_0xfd8194(0x1cc)},{'name':a236_0xfd8194(0x1c2),'type':a236_0xfd8194(0x1df),'enum':[a236_0xfd8194(0x1ac),'mybatisXml'],'description':'Local\x20SQL\x20file\x20mode'}],async 'validate'(_0xd41de0){const _0x11e47e=a236_0xfd8194;if(!_0xd41de0[_0x11e47e(0x1e9)])return;if(!_0xd41de0[_0x11e47e(0x1e3)](_0x11e47e(0x1bd))[_0x11e47e(0x1bf)]())throw CliErrors[_0x11e47e(0x1eb)](_0x11e47e(0x1bd),_0x11e47e(0x1ea));const _0x5da697=resolveProvidedDbId(_0xd41de0);if(typeof _0x5da697!==_0x11e47e(0x1c8)||!Number[_0x11e47e(0x1d1)](_0x5da697)||_0x5da697<=0x0)throw CliErrors[_0x11e47e(0x1eb)](_0x11e47e(0x1c5),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');if(!_0xd41de0['str'](_0x11e47e(0x1c2))['trim']())throw CliErrors[_0x11e47e(0x1eb)](_0x11e47e(0x1c2),_0x11e47e(0x1cb));},async 'dryRun'(_0x31d84a){const _0x36db1a=a236_0xfd8194,_0x23ee92=loadSqlProjectConfig(_0x31d84a['appCode']),{sqlName:_0x2a4ade,dbId:_0x514cfe,dbName:_0x37914e,mode:_0x26b0df}=await resolveSqlNewInputs(_0x31d84a),_0xa7310f=buildSqlRelativePath(_0x36db1a(0x1be),_0x2a4ade,_0x37914e,_0x26b0df,_0x514cfe),_0x37dc89=_0x23ee92['sqlRootDir']+'/'+_0xa7310f;return{'method':_0x36db1a(0x1e0),'url':_0x36db1a(0x1c9),'body':{'appCode':_0x31d84a[_0x36db1a(0x1b2)],'sqlName':_0x2a4ade,'dbId':_0x514cfe,'mode':_0x26b0df,'localPath':_0x37dc89},'description':'Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20'+_0x23ee92[_0x36db1a(0x1ba)]};},async 'execute'(_0xcda7c0){const _0x3b60ec=a236_0xfd8194,_0x67826d=loadSqlProjectConfig(_0xcda7c0[_0x3b60ec(0x1b2)]),{sqlName:_0x38d585,dbId:_0x271200,dbName:_0x59032b,mode:_0x48fdcf}=await resolveSqlNewInputs(_0xcda7c0),_0x30dcf9=generateSqlTemplate(_0x48fdcf),_0x8ec13e=await createSqlQuery({'appCode':_0xcda7c0[_0x3b60ec(0x1b2)],'sqlName':_0x38d585,'dbId':_0x271200,'sqlContent':_0x30dcf9}),_0x21c273=ensureRemoteSqlContent(_0x8ec13e),_0x2b677e=_0x59032b||await getDbName(_0xcda7c0[_0x3b60ec(0x1b2)],_0x271200)[_0x3b60ec(0x1e4)](()=>undefined),_0x7c4705=buildSqlRelativePath(_0x8ec13e[_0x3b60ec(0x1b6)],_0x8ec13e['sqlName'],_0x2b677e,_0x48fdcf,_0x271200),_0x1e52f9=_0x67826d[_0x3b60ec(0x1ba)]+'/'+_0x7c4705,_0x1365dd=buildLocalSqlFileContent({'sqlCode':_0x8ec13e[_0x3b60ec(0x1b6)],'sqlName':_0x8ec13e['sqlName'],'dbId':_0x8ec13e[_0x3b60ec(0x1db)]},_0x21c273,{'dbName':_0x2b677e,'mode':_0x48fdcf,'syncedAt':new Date()['toISOString'](),'description':_0x8ec13e[_0x3b60ec(0x1cf)]});if(await fileExists(_0x1e52f9))throw CliErrors[_0x3b60ec(0x1e2)](_0x3b60ec(0x1ae)+_0x1e52f9);await ensureParentDirectory(_0x1e52f9),await writeFile(_0x1e52f9,_0x1365dd,_0x3b60ec(0x1e8));const _0x2ded69=await readSqlLockFile(_0x67826d[_0x3b60ec(0x1b8)]),{lockData:_0x2c94ac,appLock:_0xe3406}=ensureSqlLockScope(_0x2ded69??createEmptySqlLock(),_0x67826d['appCode'],_0x67826d[_0x3b60ec(0x1d6)],_0x3b60ec(0x1e5));return _0xe3406[_0x3b60ec(0x1e6)][_0x8ec13e[_0x3b60ec(0x1b6)]]={...buildSqlLockEntry(_0x8ec13e,_0x21c273,computeSqlContentHash(_0x1365dd),{'dbName':_0x2b677e}),'path':_0x7c4705,'mode':_0x48fdcf},_0xe3406[_0x3b60ec(0x1ec)]=new Date()[_0x3b60ec(0x1d9)](),await writeSqlLockFile(_0x67826d[_0x3b60ec(0x1b8)],_0x2c94ac),{'ok':!![],'data':{'id':_0x8ec13e['id'],'sqlCode':_0x8ec13e[_0x3b60ec(0x1b6)],'sqlName':_0x8ec13e['sqlName'],'dbId':_0x8ec13e[_0x3b60ec(0x1db)],'path':_0x1e52f9,'mode':_0x48fdcf},'message':_0x3b60ec(0x1c1)+_0x8ec13e[_0x3b60ec(0x1b6)]};}};async function resolveSqlNewInputs(_0x2eebe3){const _0xdbedc9=await resolveSqlNameInput(_0x2eebe3),{dbId:_0x44870b,dbName:_0x238eac}=await resolveDbSelection(_0x2eebe3),_0x5566a8=await resolveSqlModeInput(_0x2eebe3);return{'sqlName':_0xdbedc9,'dbId':_0x44870b,'dbName':_0x238eac,'mode':_0x5566a8};}async function resolveSqlNameInput(_0x456119){const _0x5800a0=a236_0xfd8194,_0x1c975a=_0x456119['str']('name')[_0x5800a0(0x1bf)]();if(_0x1c975a)return _0x1c975a;if(_0x456119['nonInteractive'])throw CliErrors[_0x5800a0(0x1eb)](_0x5800a0(0x1bd),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');return(await input({'message':'SQL\x20name:','validate':_0x4e972e=>_0x4e972e[_0x5800a0(0x1bf)]()?!![]:_0x5800a0(0x1ab)}))[_0x5800a0(0x1bf)]();}async function resolveDbSelection(_0x4ea2b9){const _0x533288=a236_0xfd8194,_0x494238=resolveProvidedDbId(_0x4ea2b9);if(typeof _0x494238==='number'&&Number['isFinite'](_0x494238)&&_0x494238>0x0)return{'dbId':_0x494238,'dbName':await getDbName(_0x4ea2b9['appCode'],_0x494238)[_0x533288(0x1e4)](()=>undefined)};if(_0x4ea2b9[_0x533288(0x1e9)])throw CliErrors[_0x533288(0x1eb)]('db-id','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x134d38=await listDatabases(_0x4ea2b9['appCode'])[_0x533288(0x1e4)](()=>[]);if(_0x134d38['length']===0x1)return{'dbId':_0x134d38[0x0]['dbId'],'dbName':_0x134d38[0x0][_0x533288(0x1b3)]};if(_0x134d38[_0x533288(0x1c3)]>0x1){const _0x5a92ea=await select({'message':_0x533288(0x1b1),'choices':[..._0x134d38['map'](_0x2f89d3=>({'name':_0x2f89d3[_0x533288(0x1b3)]+'\x20('+_0x2f89d3[_0x533288(0x1db)]+')','value':serializeDbSelection(_0x2f89d3)})),{'name':_0x533288(0x1c4),'value':_0x533288(0x1d3)}]});if(_0x5a92ea!=='__manual__')return deserializeDbSelection(_0x5a92ea);}const _0x2bfb25=await input({'message':'Target\x20database\x20dbId:','validate':_0xc8345c=>{const _0x283d45=_0x533288,_0x50c845=_0xc8345c[_0x283d45(0x1bf)]();if(!_0x50c845)return _0x283d45(0x1cd);const _0x23568b=Number(_0x50c845);if(!Number[_0x283d45(0x1e7)](_0x23568b)||_0x23568b<=0x0)return'dbId\x20must\x20be\x20a\x20positive\x20integer';return!![];}});return{'dbId':Number(_0x2bfb25['trim']())};}async function resolveSqlModeInput(_0x24bd6b){const _0x57ee22=a236_0xfd8194,_0x49885a=_0x24bd6b['str']('mode')[_0x57ee22(0x1bf)]();if(_0x49885a===_0x57ee22(0x1ac)||_0x49885a==='mybatisXml')return _0x49885a;if(_0x24bd6b['nonInteractive'])throw CliErrors[_0x57ee22(0x1eb)](_0x57ee22(0x1c2),_0x57ee22(0x1cb));return await select({'message':_0x57ee22(0x1c7),'choices':[{'name':_0x57ee22(0x1bc),'value':_0x57ee22(0x1ac),'description':_0x57ee22(0x1d4)},{'name':_0x57ee22(0x1c0),'value':_0x57ee22(0x1dd),'description':'For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags'}]});}function serializeDbSelection(_0x326b29){const _0x2b1370=a236_0xfd8194;return JSON['stringify']({'dbId':_0x326b29[_0x2b1370(0x1db)],'dbName':_0x326b29['dbName']});}function deserializeDbSelection(_0x4011af){const _0x312a7c=a236_0xfd8194;try{const _0x51bbf2=JSON[_0x312a7c(0x1b0)](_0x4011af);if(typeof _0x51bbf2[_0x312a7c(0x1db)]==='number'&&Number[_0x312a7c(0x1d1)](_0x51bbf2[_0x312a7c(0x1db)]))return{'dbId':_0x51bbf2[_0x312a7c(0x1db)],'dbName':_0x51bbf2[_0x312a7c(0x1b3)]};}catch{}throw CliErrors['validation'](_0x312a7c(0x1de)+_0x4011af);}function resolveProvidedDbId(_0x5f457f){const _0x9f9c0e=a236_0xfd8194,_0x49e346=_0x5f457f[_0x9f9c0e(0x1af)](_0x9f9c0e(0x1c5));if(typeof _0x49e346===_0x9f9c0e(0x1c8)&&Number[_0x9f9c0e(0x1d1)](_0x49e346))return _0x49e346;return undefined;}
1
+ const a236_0x1c20ff=a236_0x5cfa;function a236_0x5cfa(_0x2e12a8,_0x45522b){_0x2e12a8=_0x2e12a8-0x11b;const _0xb2aae2=a236_0xb2aa();let _0x5cfab2=_0xb2aae2[_0x2e12a8];return _0x5cfab2;}(function(_0x2ae1af,_0x121762){const _0x39175a=a236_0x5cfa,_0x36a738=_0x2ae1af();while(!![]){try{const _0x54ed99=-parseInt(_0x39175a(0x134))/0x1*(-parseInt(_0x39175a(0x11d))/0x2)+parseInt(_0x39175a(0x129))/0x3+parseInt(_0x39175a(0x140))/0x4+-parseInt(_0x39175a(0x15a))/0x5+-parseInt(_0x39175a(0x125))/0x6*(-parseInt(_0x39175a(0x12c))/0x7)+parseInt(_0x39175a(0x13f))/0x8*(-parseInt(_0x39175a(0x124))/0x9)+-parseInt(_0x39175a(0x157))/0xa*(-parseInt(_0x39175a(0x15d))/0xb);if(_0x54ed99===_0x121762)break;else _0x36a738['push'](_0x36a738['shift']());}catch(_0x3ffea3){_0x36a738['push'](_0x36a738['shift']());}}}(a236_0xb2aa,0x83537));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';function a236_0xb2aa(){const _0x4cf32d=['dbId\x20must\x20be\x20a\x20positive\x20integer','str','sqlCode','join','MyBatis\x20XML\x20(mybatisXml)','lastSync','number','flag','Plain\x20SQL\x20(sql)','Target\x20database\x20dbId:','name','✎\x20Enter\x20dbId\x20manually','flagMissing','trim','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','db-id','3340tlNKyZ','nonInteractive','File\x20already\x20exists:\x20','1413095Azhtbb','description','sql','1254IJkKlp','length','isFinite','SELECT\x201\x20AS\x20id;','For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly','mybatisXml','stringify','9248ZWqUWf','toISOString','</select>','lockFilePath','dbName','Invalid\x20database\x20selection\x20payload:\x20','Select\x20the\x20target\x20database:','414eTerbV','18CdqtaX','dbId\x20cannot\x20be\x20empty','validation','Local\x20SQL\x20file\x20mode','1741254SwBpDT','__manual__','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','108143qdoTME','Created\x20SQL\x20query\x20','parse','sqlName','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','<server-generated-sqlCode>','new','SQL\x20name\x20cannot\x20be\x20empty','63leUehy','POST','\x20\x20SELECT\x201\x20AS\x20id','catch','/smartapi/custom/saveUserCustomSql','Select\x20the\x20local\x20SQL\x20mode:','string','sqls','mode','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','dbId','134200HBrrBT','2544108aBKPyy','sqlRootDir','map','appCode','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','isInteger'];a236_0xb2aa=function(){return _0x4cf32d;};return a236_0xb2aa();}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(_0x400352){const _0x1b3a4b=a236_0x5cfa;if(_0x400352===_0x1b3a4b(0x11b))return[_0x1b3a4b(0x145),_0x1b3a4b(0x136),_0x1b3a4b(0x11f),'']['join']('\x0a');return[_0x1b3a4b(0x160),''][_0x1b3a4b(0x14a)]('\x0a');}export const sqlCreate={'service':'sql','command':'create','description':a236_0x1c20ff(0x12b),'risk':'write','flags':[{'name':a236_0x1c20ff(0x151),'type':a236_0x1c20ff(0x13a),'description':'SQL\x20query\x20display\x20name'},{'name':a236_0x1c20ff(0x156),'type':a236_0x1c20ff(0x14d),'description':'Target\x20database\x20ID'},{'name':a236_0x1c20ff(0x13c),'type':'string','enum':[a236_0x1c20ff(0x15c),a236_0x1c20ff(0x11b)],'description':a236_0x1c20ff(0x128)}],async 'validate'(_0x1c9420){const _0x623109=a236_0x1c20ff;if(!_0x1c9420[_0x623109(0x158)])return;if(!_0x1c9420[_0x623109(0x148)]('name')['trim']())throw CliErrors[_0x623109(0x153)](_0x623109(0x151),_0x623109(0x13d));const _0x3ce426=resolveProvidedDbId(_0x1c9420);if(typeof _0x3ce426!=='number'||!Number[_0x623109(0x15f)](_0x3ce426)||_0x3ce426<=0x0)throw CliErrors['flagMissing'](_0x623109(0x156),_0x623109(0x144));if(!_0x1c9420[_0x623109(0x148)](_0x623109(0x13c))[_0x623109(0x154)]())throw CliErrors[_0x623109(0x153)](_0x623109(0x13c),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0x2238fa){const _0x37eaf3=a236_0x1c20ff,_0x5aac33=loadSqlProjectConfig(_0x2238fa[_0x37eaf3(0x143)]),{sqlName:_0xa19b18,dbId:_0x4da386,dbName:_0x273cbd,mode:_0x1d7689}=await resolveSqlNewInputs(_0x2238fa),_0x3d2046=buildSqlRelativePath(_0x37eaf3(0x131),_0xa19b18,_0x273cbd,_0x1d7689,_0x4da386),_0x17f7a2=_0x5aac33[_0x37eaf3(0x141)]+'/'+_0x3d2046;return{'method':_0x37eaf3(0x135),'url':_0x37eaf3(0x138),'body':{'appCode':_0x2238fa['appCode'],'sqlName':_0xa19b18,'dbId':_0x4da386,'mode':_0x1d7689,'localPath':_0x17f7a2},'description':_0x37eaf3(0x155)+_0x5aac33['sqlRootDir']};},async 'execute'(_0x3a0a4b){const _0x2a882a=a236_0x1c20ff,_0x3501da=loadSqlProjectConfig(_0x3a0a4b['appCode']),{sqlName:_0x33c481,dbId:_0x1bb2e8,dbName:_0x5f2b25,mode:_0x5bb08c}=await resolveSqlNewInputs(_0x3a0a4b),_0x5b064d=generateSqlTemplate(_0x5bb08c),_0xbd04dd=await createSqlQuery({'appCode':_0x3a0a4b['appCode'],'sqlName':_0x33c481,'dbId':_0x1bb2e8,'sqlContent':_0x5b064d}),_0x18b9f4=ensureRemoteSqlContent(_0xbd04dd),_0x2a6551=_0x5f2b25||await getDbName(_0x3a0a4b['appCode'],_0x1bb2e8)[_0x2a882a(0x137)](()=>undefined),_0x2a00f9=buildSqlRelativePath(_0xbd04dd['sqlCode'],_0xbd04dd[_0x2a882a(0x12f)],_0x2a6551,_0x5bb08c,_0x1bb2e8),_0x93daf9=_0x3501da[_0x2a882a(0x141)]+'/'+_0x2a00f9,_0x146866=buildLocalSqlFileContent({'sqlCode':_0xbd04dd[_0x2a882a(0x149)],'sqlName':_0xbd04dd[_0x2a882a(0x12f)],'dbId':_0xbd04dd['dbId']},_0x18b9f4,{'dbName':_0x2a6551,'mode':_0x5bb08c,'syncedAt':new Date()['toISOString'](),'description':_0xbd04dd[_0x2a882a(0x15b)]});if(await fileExists(_0x93daf9))throw CliErrors[_0x2a882a(0x127)](_0x2a882a(0x159)+_0x93daf9);await ensureParentDirectory(_0x93daf9),await writeFile(_0x93daf9,_0x146866,'utf8');const _0x520f22=await readSqlLockFile(_0x3501da[_0x2a882a(0x120)]),{lockData:_0x1297e2,appLock:_0x47a3a0}=ensureSqlLockScope(_0x520f22??createEmptySqlLock(),_0x3501da[_0x2a882a(0x143)],_0x3501da['sqlRoot'],_0x2a882a(0x132));return _0x47a3a0[_0x2a882a(0x13b)][_0xbd04dd[_0x2a882a(0x149)]]={...buildSqlLockEntry(_0xbd04dd,_0x18b9f4,computeSqlContentHash(_0x146866),{'dbName':_0x2a6551}),'path':_0x2a00f9,'mode':_0x5bb08c},_0x47a3a0[_0x2a882a(0x14c)]=new Date()[_0x2a882a(0x11e)](),await writeSqlLockFile(_0x3501da[_0x2a882a(0x120)],_0x1297e2),{'ok':!![],'data':{'id':_0xbd04dd['id'],'sqlCode':_0xbd04dd['sqlCode'],'sqlName':_0xbd04dd['sqlName'],'dbId':_0xbd04dd['dbId'],'path':_0x93daf9,'mode':_0x5bb08c},'message':_0x2a882a(0x12d)+_0xbd04dd['sqlCode']};}};async function resolveSqlNewInputs(_0x2c6616){const _0x2d1de0=await resolveSqlNameInput(_0x2c6616),{dbId:_0x9829be,dbName:_0x43941a}=await resolveDbSelection(_0x2c6616),_0x23939a=await resolveSqlModeInput(_0x2c6616);return{'sqlName':_0x2d1de0,'dbId':_0x9829be,'dbName':_0x43941a,'mode':_0x23939a};}async function resolveSqlNameInput(_0x4366fd){const _0x3a0e76=a236_0x1c20ff,_0x3a8ee3=_0x4366fd[_0x3a0e76(0x148)](_0x3a0e76(0x151))[_0x3a0e76(0x154)]();if(_0x3a8ee3)return _0x3a8ee3;if(_0x4366fd[_0x3a0e76(0x158)])throw CliErrors['flagMissing'](_0x3a0e76(0x151),_0x3a0e76(0x13d));return(await input({'message':'SQL\x20name:','validate':_0x5c9510=>_0x5c9510[_0x3a0e76(0x154)]()?!![]:_0x3a0e76(0x133)}))[_0x3a0e76(0x154)]();}async function resolveDbSelection(_0x312a16){const _0x4811b5=a236_0x1c20ff,_0x24ec91=resolveProvidedDbId(_0x312a16);if(typeof _0x24ec91===_0x4811b5(0x14d)&&Number[_0x4811b5(0x15f)](_0x24ec91)&&_0x24ec91>0x0)return{'dbId':_0x24ec91,'dbName':await getDbName(_0x312a16[_0x4811b5(0x143)],_0x24ec91)[_0x4811b5(0x137)](()=>undefined)};if(_0x312a16[_0x4811b5(0x158)])throw CliErrors['flagMissing']('db-id','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x1213e1=await listDatabases(_0x312a16[_0x4811b5(0x143)])['catch'](()=>[]);if(_0x1213e1[_0x4811b5(0x15e)]===0x1)return{'dbId':_0x1213e1[0x0][_0x4811b5(0x13e)],'dbName':_0x1213e1[0x0]['dbName']};if(_0x1213e1[_0x4811b5(0x15e)]>0x1){const _0x452db4=await select({'message':_0x4811b5(0x123),'choices':[..._0x1213e1[_0x4811b5(0x142)](_0x2db259=>({'name':_0x2db259[_0x4811b5(0x121)]+'\x20('+_0x2db259[_0x4811b5(0x13e)]+')','value':serializeDbSelection(_0x2db259)})),{'name':_0x4811b5(0x152),'value':_0x4811b5(0x12a)}]});if(_0x452db4!==_0x4811b5(0x12a))return deserializeDbSelection(_0x452db4);}const _0x290741=await input({'message':_0x4811b5(0x150),'validate':_0x6ead5f=>{const _0x507d1f=_0x4811b5,_0x3e51a8=_0x6ead5f[_0x507d1f(0x154)]();if(!_0x3e51a8)return _0x507d1f(0x126);const _0x39be29=Number(_0x3e51a8);if(!Number[_0x507d1f(0x146)](_0x39be29)||_0x39be29<=0x0)return _0x507d1f(0x147);return!![];}});return{'dbId':Number(_0x290741[_0x4811b5(0x154)]())};}async function resolveSqlModeInput(_0xaaedb3){const _0x4950ce=a236_0x1c20ff,_0x4147b4=_0xaaedb3[_0x4950ce(0x148)](_0x4950ce(0x13c))[_0x4950ce(0x154)]();if(_0x4147b4===_0x4950ce(0x15c)||_0x4147b4===_0x4950ce(0x11b))return _0x4147b4;if(_0xaaedb3[_0x4950ce(0x158)])throw CliErrors[_0x4950ce(0x153)](_0x4950ce(0x13c),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');return await select({'message':_0x4950ce(0x139),'choices':[{'name':_0x4950ce(0x14f),'value':_0x4950ce(0x15c),'description':_0x4950ce(0x161)},{'name':_0x4950ce(0x14b),'value':'mybatisXml','description':_0x4950ce(0x130)}]});}function serializeDbSelection(_0x4e3b62){const _0x19a9b7=a236_0x1c20ff;return JSON[_0x19a9b7(0x11c)]({'dbId':_0x4e3b62['dbId'],'dbName':_0x4e3b62[_0x19a9b7(0x121)]});}function deserializeDbSelection(_0x359a6e){const _0x95a24b=a236_0x1c20ff;try{const _0x200a14=JSON[_0x95a24b(0x12e)](_0x359a6e);if(typeof _0x200a14[_0x95a24b(0x13e)]===_0x95a24b(0x14d)&&Number[_0x95a24b(0x15f)](_0x200a14[_0x95a24b(0x13e)]))return{'dbId':_0x200a14['dbId'],'dbName':_0x200a14[_0x95a24b(0x121)]};}catch{}throw CliErrors[_0x95a24b(0x127)](_0x95a24b(0x122)+_0x359a6e);}function resolveProvidedDbId(_0x1b838c){const _0x5cb3a4=a236_0x1c20ff,_0x3de2b0=_0x1b838c[_0x5cb3a4(0x14e)](_0x5cb3a4(0x156));if(typeof _0x3de2b0==='number'&&Number['isFinite'](_0x3de2b0))return _0x3de2b0;return undefined;}
@@ -1 +1 @@
1
- const a237_0x953149=a237_0x2333;(function(_0x150ee4,_0x5bdce8){const _0x44d3c5=a237_0x2333,_0x600ad9=_0x150ee4();while(!![]){try{const _0x590b94=parseInt(_0x44d3c5(0x127))/0x1+-parseInt(_0x44d3c5(0x12e))/0x2*(-parseInt(_0x44d3c5(0x129))/0x3)+parseInt(_0x44d3c5(0x142))/0x4*(parseInt(_0x44d3c5(0x131))/0x5)+parseInt(_0x44d3c5(0x128))/0x6+-parseInt(_0x44d3c5(0x148))/0x7*(parseInt(_0x44d3c5(0x141))/0x8)+parseInt(_0x44d3c5(0x12f))/0x9*(-parseInt(_0x44d3c5(0x13a))/0xa)+parseInt(_0x44d3c5(0x13f))/0xb*(-parseInt(_0x44d3c5(0x14b))/0xc);if(_0x590b94===_0x5bdce8)break;else _0x600ad9['push'](_0x600ad9['shift']());}catch(_0x3a4678){_0x600ad9['push'](_0x600ad9['shift']());}}}(a237_0x43bd,0x38614));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';function a237_0x43bd(){const _0x501b2b=['projectRoot','trashDir','20uYxDDW','fromEntries','appCode','length','startsWith','55YIyOcL','/smartapi/custom/deleteUserCustomSql','8ptzFfx','15804KfvaGB','delete','lastSync','str','remoteId','sqls','612647EqomCX','validation','POST','943524ghWFnc','Would\x20delete\x20SQL\x20','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','Deleted\x20','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','high-risk-write','135233HmYVsE','1638174kZBkcl','1129209unRcxT','sql','SQL\x20lock\x20file\x20not\x20found.','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','trashedTo','2xBLhok','808893znLRMn','sqlcode','135JUJrBB','filter','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','entries','sqlRoot','lockFilePath','toISOString'];a237_0x43bd=function(){return _0x501b2b;};return a237_0x43bd();}import{dirname,join,relative,resolve,sep}from'node:path';function a237_0x2333(_0x39bbae,_0xaabfa1){_0x39bbae=_0x39bbae-0x127;const _0x43bd22=a237_0x43bd();let _0x2333e2=_0x43bd22[_0x39bbae];return _0x2333e2;}import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a237_0x953149(0x12a),'command':a237_0x953149(0x143),'description':a237_0x953149(0x14d),'risk':a237_0x953149(0x150),'flags':[SQLCODE_FLAG],async 'validate'(_0x3453a7){const _0x2afca4=a237_0x953149,_0x49ee67=loadSqlProjectConfig(_0x3453a7[_0x2afca4(0x13c)]),_0x5672fd=await readSqlLockFile(_0x49ee67[_0x2afca4(0x136)]);if(!_0x5672fd)throw CliErrors[_0x2afca4(0x149)](_0x2afca4(0x133));},async 'dryRun'(_0x1b7c87){const _0x4d1272=a237_0x953149,_0x3ecbcd=loadSqlProjectConfig(_0x1b7c87['appCode']),_0x496037=await readSqlLockFile(_0x3ecbcd[_0x4d1272(0x136)]);if(!_0x496037)throw CliErrors['validation'](_0x4d1272(0x133));const {appLock:_0xff110d}=ensureSqlLockScope(_0x496037,_0x1b7c87[_0x4d1272(0x13c)],_0x3ecbcd['sqlRoot'],_0x4d1272(0x143)),_0x4e7485=_0x1b7c87['str'](_0x4d1272(0x130)),_0x45d742=_0xff110d[_0x4d1272(0x147)][_0x4e7485];if(!_0x45d742)throw CliErrors[_0x4d1272(0x149)](_0x4d1272(0x14f)+_0x4e7485+'\x22.');return{'method':_0x4d1272(0x14a),'url':_0x4d1272(0x140),'body':{'sqlCode':_0x4e7485,'id':_0x45d742[_0x4d1272(0x146)],'localPath':resolveLocalSqlFilePath(_0x3ecbcd,_0x4e7485,_0x45d742)},'description':_0x4d1272(0x14c)+_0x4e7485+_0x4d1272(0x12c)+_0x3ecbcd[_0x4d1272(0x139)]};},async 'execute'(_0x1db5f7){const _0x5065e3=a237_0x953149,_0x2029a9=loadSqlProjectConfig(_0x1db5f7[_0x5065e3(0x13c)]),_0x1d84c8=await readSqlLockFile(_0x2029a9[_0x5065e3(0x136)]);if(!_0x1d84c8)throw CliErrors[_0x5065e3(0x149)](_0x5065e3(0x12b));const {lockData:_0x3a9af4,appLock:_0x222d2a}=ensureSqlLockScope(_0x1d84c8,_0x1db5f7[_0x5065e3(0x13c)],_0x2029a9[_0x5065e3(0x135)],'delete'),_0x59ceaf=_0x1db5f7[_0x5065e3(0x145)](_0x5065e3(0x130)),_0x30aad1=_0x222d2a[_0x5065e3(0x147)][_0x59ceaf];if(!_0x30aad1)throw CliErrors['validation']('No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22'+_0x59ceaf+'\x22.');await deleteSqlQuery({'id':_0x30aad1[_0x5065e3(0x146)],'sqlCode':_0x59ceaf}),_0x222d2a[_0x5065e3(0x147)]=Object[_0x5065e3(0x13b)](Object[_0x5065e3(0x134)](_0x222d2a[_0x5065e3(0x147)])[_0x5065e3(0x132)](([_0x161446])=>_0x161446!==_0x59ceaf)),_0x222d2a[_0x5065e3(0x144)]=new Date()['toISOString'](),await writeSqlLockFile(_0x2029a9[_0x5065e3(0x136)],_0x3a9af4);const _0x28cadd=resolveLocalSqlFilePath(_0x2029a9,_0x59ceaf,_0x30aad1);let _0xe73812;await fileExists(_0x28cadd)&&(_0xe73812=await moveToTrash(_0x2029a9[_0x5065e3(0x138)],_0x2029a9[_0x5065e3(0x139)],_0x28cadd),await cleanupEmptyDirectories(dirname(_0x28cadd),_0x2029a9['sqlRootDir']));const _0xe3db97={'deleted':_0x59ceaf,'remoteId':_0x30aad1[_0x5065e3(0x146)]};if(_0xe73812)_0xe3db97[_0x5065e3(0x12d)]=_0xe73812;return{'ok':!![],'data':_0xe3db97,'message':_0x5065e3(0x14e)+_0x59ceaf+(_0xe73812?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};async function moveToTrash(_0x2dc897,_0x8f3197,_0x43b334){const _0x19679b=a237_0x953149,_0x2eef2e=new Date()[_0x19679b(0x137)]()['replace'](/[:.]/g,'-'),_0x3e31f0=relative(_0x2dc897,_0x43b334),_0x11a1fb=join(_0x8f3197,_0x2eef2e,_0x3e31f0);return await mkdir(dirname(_0x11a1fb),{'recursive':!![]}),await rename(_0x43b334,_0x11a1fb),_0x11a1fb;}async function cleanupEmptyDirectories(_0x7e96ed,_0x236c82){const _0x222d62=a237_0x953149;let _0x2c0bfc=resolve(_0x7e96ed);const _0x238535=resolve(_0x236c82);while(_0x2c0bfc[_0x222d62(0x13e)](''+_0x238535+sep)||_0x2c0bfc===_0x238535){if(_0x2c0bfc===_0x238535)return;try{const _0x1c9a75=await readdir(_0x2c0bfc);if(_0x1c9a75[_0x222d62(0x13d)]>0x0)return;await rmdir(_0x2c0bfc);}catch{return;}_0x2c0bfc=dirname(_0x2c0bfc);}}
1
+ const a237_0x2ae4a7=a237_0x5160;function a237_0x3eaf(){const _0x4b26d7=['projectRoot','Deleted\x20','166265gnYeRE','4931694WaiQJT','\x20(local\x20file\x20moved\x20to\x20trash)','105464qGYsUC','trashedTo','Would\x20delete\x20SQL\x20','479525TVYxUT','15HEmFXz','fromEntries','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','408106wWkAsx','sqlRoot','str','remoteId','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','appCode','POST','sqlcode','delete','lockFilePath','replace','toISOString','sqls','66IHTOVp','validation','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','length','3969160kbCouy','entries','startsWith','trashDir','sql','2008524mJJrKg','lastSync','SQL\x20lock\x20file\x20not\x20found.'];a237_0x3eaf=function(){return _0x4b26d7;};return a237_0x3eaf();}(function(_0x170554,_0x41132e){const _0x5716d2=a237_0x5160,_0x37b901=_0x170554();while(!![]){try{const _0x3c2a5c=-parseInt(_0x5716d2(0xfc))/0x1+parseInt(_0x5716d2(0x100))/0x2+parseInt(_0x5716d2(0xfd))/0x3*(-parseInt(_0x5716d2(0xf9))/0x4)+parseInt(_0x5716d2(0xf6))/0x5*(parseInt(_0x5716d2(0xe8))/0x6)+parseInt(_0x5716d2(0xf1))/0x7+-parseInt(_0x5716d2(0xec))/0x8+parseInt(_0x5716d2(0xf7))/0x9;if(_0x3c2a5c===_0x41132e)break;else _0x37b901['push'](_0x37b901['shift']());}catch(_0x3fb6d8){_0x37b901['push'](_0x37b901['shift']());}}}(a237_0x3eaf,0x48912));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';function a237_0x5160(_0x2c372f,_0x328277){_0x2c372f=_0x2c372f-0xdc;const _0x3eaf7f=a237_0x3eaf();let _0x5160e5=_0x3eaf7f[_0x2c372f];return _0x5160e5;}import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a237_0x2ae4a7(0xf0),'command':a237_0x2ae4a7(0xe3),'description':a237_0x2ae4a7(0xff),'risk':'high-risk-write','flags':[SQLCODE_FLAG],async 'validate'(_0x416892){const _0x1f1959=a237_0x2ae4a7,_0x7a513e=loadSqlProjectConfig(_0x416892[_0x1f1959(0xe0)]),_0x103c74=await readSqlLockFile(_0x7a513e[_0x1f1959(0xe4)]);if(!_0x103c74)throw CliErrors[_0x1f1959(0xe9)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');},async 'dryRun'(_0x4cc618){const _0x3c2255=a237_0x2ae4a7,_0x93fc2b=loadSqlProjectConfig(_0x4cc618['appCode']),_0x248ec8=await readSqlLockFile(_0x93fc2b[_0x3c2255(0xe4)]);if(!_0x248ec8)throw CliErrors[_0x3c2255(0xe9)](_0x3c2255(0xea));const {appLock:_0xb64430}=ensureSqlLockScope(_0x248ec8,_0x4cc618['appCode'],_0x93fc2b[_0x3c2255(0xdc)],_0x3c2255(0xe3)),_0x15f09e=_0x4cc618[_0x3c2255(0xdd)](_0x3c2255(0xe2)),_0x54dc2b=_0xb64430[_0x3c2255(0xe7)][_0x15f09e];if(!_0x54dc2b)throw CliErrors[_0x3c2255(0xe9)](_0x3c2255(0xdf)+_0x15f09e+'\x22.');return{'method':_0x3c2255(0xe1),'url':'/smartapi/custom/deleteUserCustomSql','body':{'sqlCode':_0x15f09e,'id':_0x54dc2b[_0x3c2255(0xde)],'localPath':resolveLocalSqlFilePath(_0x93fc2b,_0x15f09e,_0x54dc2b)},'description':_0x3c2255(0xfb)+_0x15f09e+'\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20'+_0x93fc2b['trashDir']};},async 'execute'(_0x47175b){const _0x20b813=a237_0x2ae4a7,_0x30a6d6=loadSqlProjectConfig(_0x47175b['appCode']),_0x168789=await readSqlLockFile(_0x30a6d6[_0x20b813(0xe4)]);if(!_0x168789)throw CliErrors[_0x20b813(0xe9)](_0x20b813(0xf3));const {lockData:_0x4acc3e,appLock:_0x595548}=ensureSqlLockScope(_0x168789,_0x47175b[_0x20b813(0xe0)],_0x30a6d6[_0x20b813(0xdc)],'delete'),_0xca7945=_0x47175b[_0x20b813(0xdd)]('sqlcode'),_0x2e762c=_0x595548[_0x20b813(0xe7)][_0xca7945];if(!_0x2e762c)throw CliErrors['validation'](_0x20b813(0xdf)+_0xca7945+'\x22.');await deleteSqlQuery({'id':_0x2e762c[_0x20b813(0xde)],'sqlCode':_0xca7945}),_0x595548['sqls']=Object[_0x20b813(0xfe)](Object[_0x20b813(0xed)](_0x595548[_0x20b813(0xe7)])['filter'](([_0x29785c])=>_0x29785c!==_0xca7945)),_0x595548[_0x20b813(0xf2)]=new Date()['toISOString'](),await writeSqlLockFile(_0x30a6d6[_0x20b813(0xe4)],_0x4acc3e);const _0xfb9659=resolveLocalSqlFilePath(_0x30a6d6,_0xca7945,_0x2e762c);let _0x2be04e;await fileExists(_0xfb9659)&&(_0x2be04e=await moveToTrash(_0x30a6d6[_0x20b813(0xf4)],_0x30a6d6[_0x20b813(0xef)],_0xfb9659),await cleanupEmptyDirectories(dirname(_0xfb9659),_0x30a6d6['sqlRootDir']));const _0x4c04cb={'deleted':_0xca7945,'remoteId':_0x2e762c[_0x20b813(0xde)]};if(_0x2be04e)_0x4c04cb[_0x20b813(0xfa)]=_0x2be04e;return{'ok':!![],'data':_0x4c04cb,'message':_0x20b813(0xf5)+_0xca7945+(_0x2be04e?_0x20b813(0xf8):'')};}};async function moveToTrash(_0x1f5a2b,_0x3aa2b2,_0x4f999b){const _0x21282c=a237_0x2ae4a7,_0x161bac=new Date()[_0x21282c(0xe6)]()[_0x21282c(0xe5)](/[:.]/g,'-'),_0x111bbd=relative(_0x1f5a2b,_0x4f999b),_0x2c6b56=join(_0x3aa2b2,_0x161bac,_0x111bbd);return await mkdir(dirname(_0x2c6b56),{'recursive':!![]}),await rename(_0x4f999b,_0x2c6b56),_0x2c6b56;}async function cleanupEmptyDirectories(_0x1abcc8,_0x31afdc){const _0x2e8d0f=a237_0x2ae4a7;let _0x45ed52=resolve(_0x1abcc8);const _0x2777e9=resolve(_0x31afdc);while(_0x45ed52[_0x2e8d0f(0xee)](''+_0x2777e9+sep)||_0x45ed52===_0x2777e9){if(_0x45ed52===_0x2777e9)return;try{const _0x2ca40d=await readdir(_0x45ed52);if(_0x2ca40d[_0x2e8d0f(0xeb)]>0x0)return;await rmdir(_0x45ed52);}catch{return;}_0x45ed52=dirname(_0x45ed52);}}
@@ -1 +1 @@
1
- const a238_0x132486=a238_0x9b1a;function a238_0x4929(){const _0x404c80=['16051200abmRnl','344202OwBmPq','sqlcode','3730RGhDci','9AHoyid','63DRXaFb','description','9229qGDukp','boolean','dbId','379664YdsQyD','verbose','detail','2UAtMjv','appCode','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','382904nOydEm','403315jgYKvV','Return\x20full\x20raw\x20SQL\x20query\x20object','1628991aHIjTN','sql','12JQRLDY','sqlContent'];a238_0x4929=function(){return _0x404c80;};return a238_0x4929();}(function(_0x3a696c,_0x21afd4){const _0x4b0ff2=a238_0x9b1a,_0x5d7595=_0x3a696c();while(!![]){try{const _0x34345d=-parseInt(_0x4b0ff2(0x93))/0x1*(parseInt(_0x4b0ff2(0x96))/0x2)+-parseInt(_0x4b0ff2(0x85))/0x3+parseInt(_0x4b0ff2(0x87))/0x4*(parseInt(_0x4b0ff2(0x83))/0x5)+parseInt(_0x4b0ff2(0x8a))/0x6*(parseInt(_0x4b0ff2(0x8e))/0x7)+-parseInt(_0x4b0ff2(0x82))/0x8*(-parseInt(_0x4b0ff2(0x8d))/0x9)+parseInt(_0x4b0ff2(0x8c))/0xa*(-parseInt(_0x4b0ff2(0x90))/0xb)+parseInt(_0x4b0ff2(0x89))/0xc;if(_0x34345d===_0x21afd4)break;else _0x5d7595['push'](_0x5d7595['shift']());}catch(_0x906002){_0x5d7595['push'](_0x5d7595['shift']());}}}(a238_0x4929,0xddb73));function a238_0x9b1a(_0x32f652,_0x3df726){_0x32f652=_0x32f652-0x82;const _0x492986=a238_0x4929();let _0x9b1ac0=_0x492986[_0x32f652];return _0x9b1ac0;}import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a238_0x132486(0x86),'command':a238_0x132486(0x95),'description':a238_0x132486(0x98),'risk':'read','flags':[SQLCODE_FLAG,{'name':a238_0x132486(0x94),'type':a238_0x132486(0x91),'description':a238_0x132486(0x84)}],async 'execute'(_0x2a7f14){const _0x19fb17=a238_0x132486,_0x361ac6=await getSqlQueryInfo(_0x2a7f14[_0x19fb17(0x97)],_0x2a7f14['str'](_0x19fb17(0x8b))),_0x30573c=_0x2a7f14['bool'](_0x19fb17(0x94));if(_0x30573c)return{'ok':!![],'data':_0x361ac6};const _0x378072=_0x361ac6[_0x19fb17(0x92)]?await getDbName(_0x2a7f14['appCode'],_0x361ac6['dbId']):undefined;return{'ok':!![],'data':{'sqlCode':_0x361ac6['sqlCode'],'sqlName':_0x361ac6['sqlName'],'db':_0x378072?_0x378072+'\x20('+_0x361ac6[_0x19fb17(0x92)]+')':_0x361ac6['dbId']??'','description':_0x361ac6[_0x19fb17(0x8f)]??'','sqlContent':_0x361ac6[_0x19fb17(0x88)]??''}};}};
1
+ const a238_0xffcc97=a238_0x46d9;function a238_0x46d9(_0x547741,_0x15ae4a){_0x547741=_0x547741-0x184;const _0x32b09e=a238_0x32b0();let _0x46d9db=_0x32b09e[_0x547741];return _0x46d9db;}(function(_0x4ac6c4,_0x2d6bf9){const _0x24c40c=a238_0x46d9,_0x38f35e=_0x4ac6c4();while(!![]){try{const _0x1382ad=parseInt(_0x24c40c(0x195))/0x1+parseInt(_0x24c40c(0x197))/0x2*(-parseInt(_0x24c40c(0x190))/0x3)+-parseInt(_0x24c40c(0x192))/0x4*(-parseInt(_0x24c40c(0x185))/0x5)+-parseInt(_0x24c40c(0x187))/0x6+parseInt(_0x24c40c(0x19a))/0x7*(-parseInt(_0x24c40c(0x186))/0x8)+-parseInt(_0x24c40c(0x19d))/0x9*(parseInt(_0x24c40c(0x18c))/0xa)+-parseInt(_0x24c40c(0x194))/0xb*(-parseInt(_0x24c40c(0x18d))/0xc);if(_0x1382ad===_0x2d6bf9)break;else _0x38f35e['push'](_0x38f35e['shift']());}catch(_0x3d172b){_0x38f35e['push'](_0x38f35e['shift']());}}}(a238_0x32b0,0xd8438));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a238_0x32b0(){const _0x25efb8=['7430166xBYbGZ','sql','sqlName','sqlCode','Return\x20full\x20raw\x20SQL\x20query\x20object','10190goqOvb','12Psjgnj','dbId','sqlcode','177nNStWF','read','36PNnWXz','detail','42189785PzUXOY','810726WbtViS','description','43046FjHUaG','boolean','appCode','1808240sOzUvq','sqlContent','verbose','15606kklwXK','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','860055XHfIaX','32fQtaZI'];a238_0x32b0=function(){return _0x25efb8;};return a238_0x32b0();}export const sqlDetail={'service':a238_0xffcc97(0x188),'command':a238_0xffcc97(0x193),'description':a238_0xffcc97(0x184),'risk':a238_0xffcc97(0x191),'flags':[SQLCODE_FLAG,{'name':a238_0xffcc97(0x19c),'type':a238_0xffcc97(0x198),'description':a238_0xffcc97(0x18b)}],async 'execute'(_0x587edc){const _0x3e902b=a238_0xffcc97,_0x551fd7=await getSqlQueryInfo(_0x587edc[_0x3e902b(0x199)],_0x587edc['str'](_0x3e902b(0x18f))),_0x33d136=_0x587edc['bool']('verbose');if(_0x33d136)return{'ok':!![],'data':_0x551fd7};const _0x52ae6a=_0x551fd7[_0x3e902b(0x18e)]?await getDbName(_0x587edc[_0x3e902b(0x199)],_0x551fd7[_0x3e902b(0x18e)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x551fd7[_0x3e902b(0x18a)],'sqlName':_0x551fd7[_0x3e902b(0x189)],'db':_0x52ae6a?_0x52ae6a+'\x20('+_0x551fd7[_0x3e902b(0x18e)]+')':_0x551fd7[_0x3e902b(0x18e)]??'','description':_0x551fd7[_0x3e902b(0x196)]??'','sqlContent':_0x551fd7[_0x3e902b(0x19b)]??''}};}};
@@ -1 +1 @@
1
- function a239_0x4a3e(_0x55b4b6,_0x7420b8){_0x55b4b6=_0x55b4b6-0xb2;const _0x24571e=a239_0x2457();let _0x4a3e6d=_0x24571e[_0x55b4b6];return _0x4a3e6d;}const a239_0x1be826=a239_0x4a3e;function a239_0x2457(){const _0x59d4f9=['length','248YLYidR','read','execError','272944WXQWZo','3027740XaYqbO','31988yBKizX','isArray','11195XkdmJf','execResult','9pVgANT','now','appCode','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','2dIlbhQ','1852jsWwuc','execSuccess','2993154QTRBeW','3122586oAEvka','sql','1061266VelUUn','8868cfXPve','SQL\x20execution\x20failed'];a239_0x2457=function(){return _0x59d4f9;};return a239_0x2457();}(function(_0x5a8df7,_0x514e75){const _0x48f5c2=a239_0x4a3e,_0x539445=_0x5a8df7();while(!![]){try{const _0x28a74c=-parseInt(_0x48f5c2(0xc6))/0x1*(parseInt(_0x48f5c2(0xb5))/0x2)+parseInt(_0x48f5c2(0xb3))/0x3+-parseInt(_0x48f5c2(0xc7))/0x4*(parseInt(_0x48f5c2(0xc0))/0x5)+parseInt(_0x48f5c2(0xb2))/0x6+parseInt(_0x48f5c2(0xbc))/0x7*(-parseInt(_0x48f5c2(0xb9))/0x8)+parseInt(_0x48f5c2(0xc2))/0x9*(parseInt(_0x48f5c2(0xbd))/0xa)+-parseInt(_0x48f5c2(0xbe))/0xb*(-parseInt(_0x48f5c2(0xb6))/0xc);if(_0x28a74c===_0x514e75)break;else _0x539445['push'](_0x539445['shift']());}catch(_0x44bda0){_0x539445['push'](_0x539445['shift']());}}}(a239_0x2457,0xa7320));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a239_0x1be826(0xb4),'command':'exec','description':a239_0x1be826(0xc5),'risk':a239_0x1be826(0xba),'flags':[SQLCODE_FLAG,{'name':'params','type':'string','description':'SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)'}],async 'execute'(_0x17bd3c){const _0x5278b3=a239_0x1be826,_0x513e3d=parseJsonParams(_0x17bd3c['str']('params')),_0x293f94=Date[_0x5278b3(0xc3)](),_0x17a6e9=await executeSql(_0x17bd3c[_0x5278b3(0xc4)],_0x17bd3c['str']('sqlcode'),_0x513e3d),_0x467589=Date[_0x5278b3(0xc3)]()-_0x293f94,_0x56228c=_0x17a6e9?.[_0x5278b3(0xc1)]??_0x17a6e9,_0x12a1b1=_0x17a6e9?.[_0x5278b3(0xc8)]??!![];if(!_0x12a1b1)return{'ok':![],'data':{'error':_0x17a6e9?.[_0x5278b3(0xbb)]||_0x5278b3(0xb7),'elapsed':_0x467589},'message':'SQL\x20execution\x20failed'};const _0x2ce618=Array[_0x5278b3(0xbf)](_0x56228c)?_0x56228c:[];return{'ok':!![],'data':{'rows':_0x2ce618,'rowCount':_0x2ce618[_0x5278b3(0xb8)],'elapsed':_0x467589},'message':'Returned\x20'+_0x2ce618[_0x5278b3(0xb8)]+'\x20row(s)\x20in\x20'+_0x467589+'ms'};}};
1
+ const a239_0xd22ec7=a239_0x151d;function a239_0x151d(_0x340d26,_0x270375){_0x340d26=_0x340d26-0x164;const _0x2013e0=a239_0x2013();let _0x151dfa=_0x2013e0[_0x340d26];return _0x151dfa;}function a239_0x2013(){const _0x339679=['3895ixVAqp','136961SBeWfX','32VovqWo','read','6030300rMrqUt','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','isArray','execError','appCode','execSuccess','3266775tuXTku','4cohhBl','now','params','2149215zxcUhk','string','10506OXhHDQ','sqlcode','3797584SddqNR','length','SQL\x20execution\x20failed','str','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','execResult','2373048QqpEqi'];a239_0x2013=function(){return _0x339679;};return a239_0x2013();}(function(_0x373242,_0x35cc65){const _0x6bcdf4=a239_0x151d,_0x2f7f48=_0x373242();while(!![]){try{const _0x9cdc73=parseInt(_0x6bcdf4(0x16c))/0x1+parseInt(_0x6bcdf4(0x176))/0x2*(parseInt(_0x6bcdf4(0x179))/0x3)+-parseInt(_0x6bcdf4(0x16a))/0x4+parseInt(_0x6bcdf4(0x16b))/0x5*(parseInt(_0x6bcdf4(0x17b))/0x6)+parseInt(_0x6bcdf4(0x164))/0x7+-parseInt(_0x6bcdf4(0x16d))/0x8*(parseInt(_0x6bcdf4(0x175))/0x9)+-parseInt(_0x6bcdf4(0x16f))/0xa;if(_0x9cdc73===_0x35cc65)break;else _0x2f7f48['push'](_0x2f7f48['shift']());}catch(_0x32c5cd){_0x2f7f48['push'](_0x2f7f48['shift']());}}}(a239_0x2013,0xca2d8));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':'sql','command':'exec','description':a239_0xd22ec7(0x168),'risk':a239_0xd22ec7(0x16e),'flags':[SQLCODE_FLAG,{'name':a239_0xd22ec7(0x178),'type':a239_0xd22ec7(0x17a),'description':a239_0xd22ec7(0x170)}],async 'execute'(_0x265179){const _0x22d587=a239_0xd22ec7,_0xd71f65=parseJsonParams(_0x265179[_0x22d587(0x167)](_0x22d587(0x178))),_0xdb63b1=Date[_0x22d587(0x177)](),_0x266046=await executeSql(_0x265179[_0x22d587(0x173)],_0x265179[_0x22d587(0x167)](_0x22d587(0x17c)),_0xd71f65),_0x1044df=Date[_0x22d587(0x177)]()-_0xdb63b1,_0x47c9d2=_0x266046?.[_0x22d587(0x169)]??_0x266046,_0x463bf7=_0x266046?.[_0x22d587(0x174)]??!![];if(!_0x463bf7)return{'ok':![],'data':{'error':_0x266046?.[_0x22d587(0x172)]||_0x22d587(0x166),'elapsed':_0x1044df},'message':_0x22d587(0x166)};const _0x5e3e7b=Array[_0x22d587(0x171)](_0x47c9d2)?_0x47c9d2:[];return{'ok':!![],'data':{'rows':_0x5e3e7b,'rowCount':_0x5e3e7b[_0x22d587(0x165)],'elapsed':_0x1044df},'message':'Returned\x20'+_0x5e3e7b[_0x22d587(0x165)]+'\x20row(s)\x20in\x20'+_0x1044df+'ms'};}};
@@ -1 +1 @@
1
- function a240_0x54cc(){const _0x295daf=['176MQrIHj','39970HZwpTK','1300578lTdHgC','1832yPhiEW','456mTSQWD','364010PEcKtX','36KSdwjh','9bhaapU','1140607AkILJK','230rKoIGq','5250808aULEfV','21FoIFuy','721364XPwTcR'];a240_0x54cc=function(){return _0x295daf;};return a240_0x54cc();}(function(_0x11fd95,_0x4667b6){const _0x1e8e91=a240_0x2c05,_0x220495=_0x11fd95();while(!![]){try{const _0x455d93=-parseInt(_0x1e8e91(0xe5))/0x1+-parseInt(_0x1e8e91(0xe7))/0x2*(parseInt(_0x1e8e91(0xdf))/0x3)+parseInt(_0x1e8e91(0xdc))/0x4*(-parseInt(_0x1e8e91(0xe2))/0x5)+parseInt(_0x1e8e91(0xe8))/0x6*(-parseInt(_0x1e8e91(0xe4))/0x7)+-parseInt(_0x1e8e91(0xe3))/0x8*(parseInt(_0x1e8e91(0xe0))/0x9)+-parseInt(_0x1e8e91(0xde))/0xa*(parseInt(_0x1e8e91(0xe6))/0xb)+-parseInt(_0x1e8e91(0xdd))/0xc*(-parseInt(_0x1e8e91(0xe1))/0xd);if(_0x455d93===_0x4667b6)break;else _0x220495['push'](_0x220495['shift']());}catch(_0x5408a8){_0x220495['push'](_0x220495['shift']());}}}(a240_0x54cc,0x70fb6));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';function a240_0x2c05(_0x6e19d0,_0x39c682){_0x6e19d0=_0x6e19d0-0xdc;const _0x54cc5e=a240_0x54cc();let _0x2c0551=_0x54cc5e[_0x6e19d0];return _0x2c0551;}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';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
1
+ (function(_0x128361,_0x39ed1e){const _0x157cc3=a240_0x3d2d,_0x5649cb=_0x128361();while(!![]){try{const _0x11b70b=-parseInt(_0x157cc3(0x17f))/0x1+-parseInt(_0x157cc3(0x17d))/0x2+-parseInt(_0x157cc3(0x185))/0x3*(-parseInt(_0x157cc3(0x17c))/0x4)+-parseInt(_0x157cc3(0x182))/0x5+parseInt(_0x157cc3(0x180))/0x6*(parseInt(_0x157cc3(0x183))/0x7)+-parseInt(_0x157cc3(0x184))/0x8*(-parseInt(_0x157cc3(0x17e))/0x9)+parseInt(_0x157cc3(0x181))/0xa;if(_0x11b70b===_0x39ed1e)break;else _0x5649cb['push'](_0x5649cb['shift']());}catch(_0x1bda21){_0x5649cb['push'](_0x5649cb['shift']());}}}(a240_0x569e,0xa57b9));function a240_0x3d2d(_0x22249a,_0x512b68){_0x22249a=_0x22249a-0x17c;const _0x569e6c=a240_0x569e();let _0x3d2d9e=_0x569e6c[_0x22249a];return _0x3d2d9e;}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';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';function a240_0x569e(){const _0x4979b0=['492496eApySk','2688812fbVJuA','357759OWDIWM','924955NpisTI','35832LSxkgZ','25044340SHmyJC','5030775mjLPyt','371tcMdoU','104EnaYvu','15cCubte'];a240_0x569e=function(){return _0x4979b0;};return a240_0x569e();}export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
@@ -1 +1 @@
1
- const a241_0x28114=a241_0x3d18;function a241_0x3d18(_0x4f13c3,_0x378c7a){_0x4f13c3=_0x4f13c3-0xf6;const _0x8b9659=a241_0x8b96();let _0x3d185d=_0x8b9659[_0x4f13c3];return _0x3d185d;}(function(_0x125883,_0x15b361){const _0x1e31fb=a241_0x3d18,_0x3867cb=_0x125883();while(!![]){try{const _0x12b82a=parseInt(_0x1e31fb(0x101))/0x1+parseInt(_0x1e31fb(0xfb))/0x2*(-parseInt(_0x1e31fb(0x10d))/0x3)+parseInt(_0x1e31fb(0x10c))/0x4*(parseInt(_0x1e31fb(0x100))/0x5)+-parseInt(_0x1e31fb(0x113))/0x6+parseInt(_0x1e31fb(0x111))/0x7*(parseInt(_0x1e31fb(0xfa))/0x8)+parseInt(_0x1e31fb(0x118))/0x9*(-parseInt(_0x1e31fb(0x114))/0xa)+parseInt(_0x1e31fb(0x10f))/0xb;if(_0x12b82a===_0x15b361)break;else _0x3867cb['push'](_0x3867cb['shift']());}catch(_0x3b8fb6){_0x3867cb['push'](_0x3867cb['shift']());}}}(a241_0x8b96,0x4f63d));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a241_0x8b96(){const _0x226121=['page','description','sql','4vBdjNd','11622kVOfqL','sqlCode','4324672Iqszxt','read','11123IZIEAF','dbId','1090788MMUIqU','13800WBVkmt','List\x20custom\x20SQL\x20queries','string','Page\x20size','3501tJAUBf','paging','tableData','str','\x20SQL\x20queries\x20(total:\x20','appCode','pagesize','376kdtNVl','38SbTuVW','name','No\x20custom\x20SQL\x20queries\x20found.','totalCount','Found\x20','1605925IdTuth','328385sZkhpG','bool','boolean','verbose','map','Page\x20number','length','number'];a241_0x8b96=function(){return _0x226121;};return a241_0x8b96();}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a241_0x28114(0x10b),'command':'list','description':a241_0x28114(0x115),'risk':a241_0x28114(0x110),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'name','type':a241_0x28114(0x116),'description':'Filter\x20by\x20SQL\x20name'},{'name':a241_0x28114(0x109),'type':a241_0x28114(0x108),'description':a241_0x28114(0x106),'default':0x1},{'name':a241_0x28114(0xf9),'type':'number','description':a241_0x28114(0x117)},{'name':a241_0x28114(0x104),'type':a241_0x28114(0x103),'description':'Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content'}],async 'execute'(_0x1a7c64){const _0x5515a1=a241_0x28114,_0x55d618=await listSqlQueries(_0x1a7c64[_0x5515a1(0xf8)],{'sqlCode':_0x1a7c64[_0x5515a1(0xf6)]('sqlcode')||undefined,'sqlName':_0x1a7c64['str'](_0x5515a1(0xfc))||undefined,'currentPage':_0x1a7c64['num']('page'),'pageSize':_0x1a7c64['num'](_0x5515a1(0xf9),0x32)}),_0x53f782=_0x1a7c64[_0x5515a1(0x102)](_0x5515a1(0x104)),_0x351184=_0x55d618[_0x5515a1(0x11a)]??[],_0x1c9c1b=_0x55d618[_0x5515a1(0x119)]?.[_0x5515a1(0xfe)]??_0x351184[_0x5515a1(0x107)];let _0x287558;return _0x53f782?_0x287558=_0x351184:_0x287558=await Promise['all'](_0x351184[_0x5515a1(0x105)](async _0x373e76=>{const _0x5b527f=_0x5515a1;let _0x213529;try{_0x213529=_0x373e76[_0x5b527f(0x112)]?await getDbName(_0x1a7c64[_0x5b527f(0xf8)],_0x373e76['dbId']):undefined;}catch{}return{'sqlCode':_0x373e76[_0x5b527f(0x10e)],'sqlName':_0x373e76['sqlName'],'description':_0x373e76[_0x5b527f(0x10a)]??'','db':_0x213529?_0x213529+'\x20('+_0x373e76[_0x5b527f(0x112)]+')':_0x373e76[_0x5b527f(0x112)]??''};})),{'ok':!![],'data':_0x287558,'message':_0x351184['length']===0x0?_0x5515a1(0xfd):_0x5515a1(0xff)+_0x351184[_0x5515a1(0x107)]+_0x5515a1(0xf7)+_0x1c9c1b+').'};}};
1
+ const a241_0x44cf6e=a241_0x2f6a;(function(_0x459886,_0x4e0666){const _0x116e33=a241_0x2f6a,_0x79b699=_0x459886();while(!![]){try{const _0x5f095a=parseInt(_0x116e33(0xb5))/0x1+-parseInt(_0x116e33(0x95))/0x2*(-parseInt(_0x116e33(0xa1))/0x3)+parseInt(_0x116e33(0xaa))/0x4+parseInt(_0x116e33(0xb3))/0x5+-parseInt(_0x116e33(0x9a))/0x6+-parseInt(_0x116e33(0xb0))/0x7+-parseInt(_0x116e33(0x9f))/0x8;if(_0x5f095a===_0x4e0666)break;else _0x79b699['push'](_0x79b699['shift']());}catch(_0x414368){_0x79b699['push'](_0x79b699['shift']());}}}(a241_0x5d2c,0x213f9));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a241_0x2f6a(_0x7d4667,_0x41c87){_0x7d4667=_0x7d4667-0x93;const _0x5d2ccd=a241_0x5d2c();let _0x2f6af3=_0x5d2ccd[_0x7d4667];return _0x2f6af3;}function a241_0x5d2c(){const _0x1cc698=['pagesize','verbose','List\x20custom\x20SQL\x20queries','sqlcode','list','770994aHDfEK','num','dbId','910705BdiDaG','Filter\x20by\x20SQL\x20name','180271dzIOZG','\x20SQL\x20queries\x20(total:\x20','sqlCode','map','447958hgHPLe','Page\x20size','read','sqlName','bool','954564brPVqR','length','sql','string','No\x20custom\x20SQL\x20queries\x20found.','2806416AJcmpv','totalCount','3kRvUTo','paging','page','name','appCode','boolean','number','str','Found\x20','679328hUPPFc'];a241_0x5d2c=function(){return _0x1cc698;};return a241_0x5d2c();}export const sqlList={'service':a241_0x44cf6e(0x9c),'command':a241_0x44cf6e(0xaf),'description':a241_0x44cf6e(0xad),'risk':a241_0x44cf6e(0x97),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a241_0x44cf6e(0xa4),'type':a241_0x44cf6e(0x9d),'description':a241_0x44cf6e(0xb4)},{'name':a241_0x44cf6e(0xa3),'type':a241_0x44cf6e(0xa7),'description':'Page\x20number','default':0x1},{'name':a241_0x44cf6e(0xab),'type':'number','description':a241_0x44cf6e(0x96)},{'name':a241_0x44cf6e(0xac),'type':a241_0x44cf6e(0xa6),'description':'Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content'}],async 'execute'(_0x576811){const _0x1d2b34=a241_0x44cf6e,_0x2ae84b=await listSqlQueries(_0x576811[_0x1d2b34(0xa5)],{'sqlCode':_0x576811[_0x1d2b34(0xa8)](_0x1d2b34(0xae))||undefined,'sqlName':_0x576811[_0x1d2b34(0xa8)](_0x1d2b34(0xa4))||undefined,'currentPage':_0x576811[_0x1d2b34(0xb1)](_0x1d2b34(0xa3)),'pageSize':_0x576811[_0x1d2b34(0xb1)](_0x1d2b34(0xab),0x32)}),_0x22b978=_0x576811[_0x1d2b34(0x99)](_0x1d2b34(0xac)),_0x5dd9b5=_0x2ae84b['tableData']??[],_0x3a1fa3=_0x2ae84b[_0x1d2b34(0xa2)]?.[_0x1d2b34(0xa0)]??_0x5dd9b5[_0x1d2b34(0x9b)];let _0x29cd7b;return _0x22b978?_0x29cd7b=_0x5dd9b5:_0x29cd7b=await Promise['all'](_0x5dd9b5[_0x1d2b34(0x94)](async _0x569bed=>{const _0x436ed5=_0x1d2b34;let _0x5cab17;try{_0x5cab17=_0x569bed[_0x436ed5(0xb2)]?await getDbName(_0x576811[_0x436ed5(0xa5)],_0x569bed['dbId']):undefined;}catch{}return{'sqlCode':_0x569bed[_0x436ed5(0x93)],'sqlName':_0x569bed[_0x436ed5(0x98)],'description':_0x569bed['description']??'','db':_0x5cab17?_0x5cab17+'\x20('+_0x569bed[_0x436ed5(0xb2)]+')':_0x569bed[_0x436ed5(0xb2)]??''};})),{'ok':!![],'data':_0x29cd7b,'message':_0x5dd9b5[_0x1d2b34(0x9b)]===0x0?_0x1d2b34(0x9e):_0x1d2b34(0xa9)+_0x5dd9b5[_0x1d2b34(0x9b)]+_0x1d2b34(0xb6)+_0x3a1fa3+').'};}};
@@ -1 +1 @@
1
- const a242_0x78035e=a242_0x3989;(function(_0x1ce0bf,_0x1a54d9){const _0x2f1838=a242_0x3989,_0x5712cb=_0x1ce0bf();while(!![]){try{const _0x3f5dc5=-parseInt(_0x2f1838(0x106))/0x1+-parseInt(_0x2f1838(0x149))/0x2+-parseInt(_0x2f1838(0x117))/0x3*(parseInt(_0x2f1838(0x108))/0x4)+parseInt(_0x2f1838(0x104))/0x5+-parseInt(_0x2f1838(0x136))/0x6+parseInt(_0x2f1838(0x107))/0x7*(parseInt(_0x2f1838(0x122))/0x8)+parseInt(_0x2f1838(0x10f))/0x9;if(_0x3f5dc5===_0x1a54d9)break;else _0x5712cb['push'](_0x5712cb['shift']());}catch(_0x4b70d0){_0x5712cb['push'](_0x5712cb['shift']());}}}(a242_0x4808,0x69f68));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';function a242_0x3989(_0x6c24c,_0x111de7){_0x6c24c=_0x6c24c-0xfe;const _0x480865=a242_0x4808();let _0x3989ad=_0x480865[_0x6c24c];return _0x3989ad;}import{detectSqlMode}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';function a242_0x4808(){const _0x3082a5=['sql','578930utAmMy','sqlcode','pull','description','join','force','\x20written,\x20','369635ghyoeb','all','468083flnsfw','1456623yoifej','52jwWfHT','catch','filePath','\x20SQL\x20file(s)\x20into\x20','local\x20differs\x20from\x20remote','path','lastSync','12621465wzVmOs','file','name','sqls','Force\x20pull\x20cancelled.','No\x20remote\x20SQL\x20queries\x20matched.','endsWith','\x20skipped,\x20','64041UhZfzL','test','unchanged','isCanonical','appCode','mode','sqlContent','boolean','push','find','toLowerCase','8gnlqVi','length','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','str','nonInteractive','sqlCode','split','sqlName','mybatisXml','some','cancelled','Would\x20pull\x20','string','replace','tableData','sqlRoot','lockFilePath','conflict','hash','dbId','1291908jqUdwc','toISOString','equivalent','.xml','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','skipped','Pull\x20complete:\x20','paging','message','map','Force\x20overwrite\x20local\x20unsynced\x20changes','apps','filter','bool','Filter\x20by\x20SQL\x20display\x20name','\x20failed','would_pull','sqlRootDir'];a242_0x4808=function(){return _0x3082a5;};return a242_0x4808();}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(_0x674418,_0x87be45){const _0x3889e9=a242_0x3989,_0x5a1c2f=[];let _0x5e240b=0x1;while(!![]){const _0x2c92bc=await listSqlQueries(_0x674418,{'currentPage':_0x5e240b,'pageSize':PAGE_SIZE,'sqlCode':_0x87be45[_0x3889e9(0x127)],'sqlName':_0x87be45['sqlName']}),_0x2f5295=_0x2c92bc[_0x3889e9(0x130)]??[];_0x5a1c2f[_0x3889e9(0x11f)](..._0x2f5295);if(_0x2f5295[_0x3889e9(0x123)]===0x0)break;const _0x3905cb=_0x2c92bc[_0x3889e9(0x13d)]?.['totalCount'];if(_0x3905cb!=null?_0x5a1c2f['length']>=_0x3905cb:_0x2f5295['length']<PAGE_SIZE)break;_0x5e240b++;}return _0x5a1c2f;}async function ensureSqlContent(_0x27bf62){const _0x3cab7e=a242_0x3989;if(_0x27bf62['sqlContent']!=null&&String(_0x27bf62[_0x3cab7e(0x11d)])['length']>0x0)return _0x27bf62;return getSqlQueryDetail(_0x27bf62['sqlCode']);}export const sqlPull={'service':a242_0x78035e(0x148),'command':a242_0x78035e(0xff),'description':'Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':'name','type':a242_0x78035e(0x12e),'description':a242_0x78035e(0x144)},{'name':a242_0x78035e(0x102),'type':a242_0x78035e(0x11e),'description':a242_0x78035e(0x140)}],async 'dryRun'(_0x1bf746){const _0x39df32=a242_0x78035e,_0x2b05fd=loadSqlProjectConfig(_0x1bf746[_0x39df32(0x11b)]),_0x5e135b=await readSqlLockFile(_0x2b05fd[_0x39df32(0x132)]),{appLock:_0x2e0740}=ensureSqlLockScope(_0x5e135b??createEmptySqlLock(),_0x2b05fd[_0x39df32(0x11b)],_0x2b05fd[_0x39df32(0x131)],'pull'),_0x48df14=await fetchAllSqlQueries(_0x1bf746[_0x39df32(0x11b)],{'sqlCode':_0x1bf746['str'](_0x39df32(0xfe))||undefined,'sqlName':_0x1bf746[_0x39df32(0x125)](_0x39df32(0x111))||undefined}),_0x1e93a2=[];for(const _0x4012d3 of _0x48df14){const _0x161ea3=await ensureSqlContent(_0x4012d3),_0x12c60b=ensureRemoteSqlContent(_0x161ea3),_0x57553f=detectSqlMode(_0x12c60b),_0x250677=_0x161ea3[_0x39df32(0x135)]?await getDbName(_0x1bf746[_0x39df32(0x11b)],Number(_0x161ea3['dbId']))[_0x39df32(0x109)](()=>undefined):undefined,_0x376357=buildLocalSqlFileContent({'sqlCode':_0x161ea3[_0x39df32(0x127)],'sqlName':_0x161ea3[_0x39df32(0x129)],'dbId':_0x161ea3[_0x39df32(0x135)]},_0x12c60b,{'dbName':_0x250677,'mode':_0x57553f,'syncedAt':new Date()[_0x39df32(0x137)](),'description':_0x161ea3[_0x39df32(0x100)]}),_0x54108f=buildSqlLockEntry(_0x161ea3,_0x12c60b,'',{'dbName':_0x250677}),_0x31c02b=resolveLocalSqlFilePath(_0x2b05fd,_0x161ea3[_0x39df32(0x127)],_0x54108f);let _0x5ddbb5=_0x39df32(0x146),_0x33a803;const _0x3d462c=await findExistingSqlFiles(_0x2b05fd,_0x31c02b,_0x57553f,_0x2e0740[_0x39df32(0x112)][_0x161ea3[_0x39df32(0x127)]]);if(_0x3d462c[_0x39df32(0x123)]>0x0){const _0x1f1c09=await compareExistingSqlFiles(_0x3d462c,_0x376357,_0x57553f);if(_0x1f1c09['some'](({equivalent:_0x354b5d})=>!_0x354b5d))_0x5ddbb5=_0x39df32(0x133),_0x33a803='local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)';else _0x1f1c09['length']===0x1&&_0x1f1c09[0x0]?.[_0x39df32(0x110)][_0x39df32(0x11a)]&&(_0x5ddbb5=_0x39df32(0x13b),_0x33a803=_0x39df32(0x119));}_0x1e93a2[_0x39df32(0x11f)]({'sqlCode':_0x161ea3['sqlCode'],'sqlName':_0x161ea3[_0x39df32(0x129)],'filePath':_0x31c02b,'status':_0x5ddbb5,'reason':_0x33a803});}return{'method':'POST','url':_0x39df32(0x124),'body':{'appCode':_0x1bf746[_0x39df32(0x11b)],'sqlCode':_0x1bf746[_0x39df32(0x125)](_0x39df32(0xfe))||null,'sqlName':_0x1bf746[_0x39df32(0x125)]('name')||null,'files':_0x1e93a2},'description':_0x39df32(0x12d)+_0x1e93a2[_0x39df32(0x123)]+_0x39df32(0x10b)+_0x2b05fd[_0x39df32(0x147)]};},async 'execute'(_0x57c76f){const _0xd49005=a242_0x78035e,_0xed97bb=loadSqlProjectConfig(_0x57c76f[_0xd49005(0x11b)]),_0x4e2523=await readSqlLockFile(_0xed97bb['lockFilePath']),{lockData:_0x5343a6,appLock:_0x49b4e8}=ensureSqlLockScope(_0x4e2523??createEmptySqlLock(),_0xed97bb['appCode'],_0xed97bb['sqlRoot'],'pull'),_0x446644=_0x57c76f[_0xd49005(0x143)](_0xd49005(0x102)),_0x313456=await fetchAllSqlQueries(_0x57c76f[_0xd49005(0x11b)],{'sqlCode':_0x57c76f[_0xd49005(0x125)]('sqlcode')||undefined,'sqlName':_0x57c76f[_0xd49005(0x125)](_0xd49005(0x111))||undefined});if(_0x313456[_0xd49005(0x123)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0xd49005(0x114)};const _0x59568b=[],_0x39bfe6=[];for(const _0x2b87af of _0x313456){try{_0x59568b[_0xd49005(0x11f)](await ensureSqlContent(_0x2b87af));}catch(_0x350edd){_0x39bfe6[_0xd49005(0x11f)]({'sqlCode':_0x2b87af['sqlCode'],'error':_0x350edd instanceof Error?_0x350edd[_0xd49005(0x13e)]:String(_0x350edd)});}}if(_0x446644&&!_0x57c76f[_0xd49005(0x126)]){let _0x4e019f=![];for(const _0x370be4 of _0x59568b){const _0x558a7f=detectSqlMode(ensureRemoteSqlContent(_0x370be4)),_0x544fa8=_0x370be4[_0xd49005(0x135)]?await getDbName(_0x57c76f[_0xd49005(0x11b)],Number(_0x370be4['dbId']))[_0xd49005(0x109)](()=>undefined):undefined,_0x4a5e62=buildLocalSqlFileContent({'sqlCode':_0x370be4[_0xd49005(0x127)],'sqlName':_0x370be4[_0xd49005(0x129)],'dbId':_0x370be4['dbId']},ensureRemoteSqlContent(_0x370be4),{'dbName':_0x544fa8,'mode':_0x558a7f,'syncedAt':new Date()[_0xd49005(0x137)](),'description':_0x370be4[_0xd49005(0x100)]}),_0x128782=resolveLocalSqlFilePath(_0xed97bb,_0x370be4[_0xd49005(0x127)],buildSqlLockEntry(_0x370be4,ensureRemoteSqlContent(_0x370be4),'',{'dbName':_0x544fa8})),_0x1348f4=await findExistingSqlFiles(_0xed97bb,_0x128782,_0x558a7f,_0x49b4e8[_0xd49005(0x112)][_0x370be4[_0xd49005(0x127)]]),_0x125683=await compareExistingSqlFiles(_0x1348f4,_0x4a5e62,_0x558a7f);if(_0x125683[_0xd49005(0x12b)](({equivalent:_0x3ab866})=>!_0x3ab866)){_0x4e019f=!![];break;}}if(_0x4e019f){const _0x54b712=await confirmForceOverwrite(_0xd49005(0x13a));if(!_0x54b712)throw CliErrors[_0xd49005(0x12c)](_0xd49005(0x113));}}const _0xdc1a0e=cloneSqlLockData(_0x5343a6),_0xa3dac8=_0xdc1a0e[_0xd49005(0x141)][_0xed97bb[_0xd49005(0x11b)]],_0x245756=[],_0x531bc6=[];for(const _0xa7b8e2 of _0x59568b){const _0x230cb1=_0xa3dac8[_0xd49005(0x112)][_0xa7b8e2['sqlCode']],_0x1d3b6c=ensureRemoteSqlContent(_0xa7b8e2),_0x37b9a5=detectSqlMode(_0x1d3b6c),_0x373cc9=_0xa7b8e2[_0xd49005(0x135)]?await getDbName(_0x57c76f[_0xd49005(0x11b)],Number(_0xa7b8e2['dbId']))[_0xd49005(0x109)](()=>undefined):undefined,_0x3f9e5c=buildLocalSqlFileContent({'sqlCode':_0xa7b8e2[_0xd49005(0x127)],'sqlName':_0xa7b8e2[_0xd49005(0x129)],'dbId':_0xa7b8e2[_0xd49005(0x135)]},_0x1d3b6c,{'dbName':_0x373cc9,'mode':_0x37b9a5,'syncedAt':new Date()[_0xd49005(0x137)](),'description':_0xa7b8e2[_0xd49005(0x100)]}),_0x5ba94f=buildSqlLockEntry(_0xa7b8e2,_0x1d3b6c,computeSqlContentHash(_0x3f9e5c),{'dbName':_0x373cc9}),_0x34bbc4=_0x5ba94f[_0xd49005(0x10d)],_0x4e8de2=join(_0xed97bb[_0xd49005(0x147)],_0x34bbc4);try{const _0x1fe373=await findExistingSqlFiles(_0xed97bb,_0x4e8de2,_0x37b9a5,_0x230cb1),_0x5f31d2=await compareExistingSqlFiles(_0x1fe373,_0x3f9e5c,_0x37b9a5);if(!_0x446644&&_0x5f31d2[_0xd49005(0x12b)](({equivalent:_0x35619c})=>!_0x35619c)){_0x531bc6[_0xd49005(0x11f)]({'sqlCode':_0xa7b8e2[_0xd49005(0x127)],'reason':_0xd49005(0x10c)});continue;}const _0x30df16=_0x5f31d2['find'](({file:_0x2e610a})=>_0x2e610a[_0xd49005(0x11a)]),_0x5605cd=_0x5f31d2[_0xd49005(0x120)](({file:_0xbe6ca0})=>!_0xbe6ca0[_0xd49005(0x11a)]);if(_0x30df16?.[_0xd49005(0x138)]&&!_0x5605cd){_0x531bc6[_0xd49005(0x11f)]({'sqlCode':_0xa7b8e2[_0xd49005(0x127)],'reason':_0xd49005(0x119)}),_0xa3dac8[_0xd49005(0x112)][_0xa7b8e2[_0xd49005(0x127)]]={..._0x5ba94f,'hash':computeSqlContentHash(_0x30df16['content']),'path':_0x34bbc4};continue;}!_0x30df16?.[_0xd49005(0x138)]&&(await ensureParentDirectory(_0x4e8de2),await writeFile(_0x4e8de2,_0x3f9e5c,'utf8')),_0x5605cd&&await rm(_0x5605cd[_0xd49005(0x110)][_0xd49005(0x10a)],{'force':!![]}),_0xa3dac8[_0xd49005(0x112)][_0xa7b8e2[_0xd49005(0x127)]]={..._0x5ba94f,'hash':_0x30df16?.[_0xd49005(0x138)]?computeSqlContentHash(_0x30df16['content']):_0x5ba94f[_0xd49005(0x134)],'path':_0x34bbc4},_0x245756[_0xd49005(0x11f)]({'sqlCode':_0xa7b8e2[_0xd49005(0x127)],'filePath':_0x4e8de2});}catch(_0x25a236){_0x39bfe6[_0xd49005(0x11f)]({'sqlCode':_0xa7b8e2[_0xd49005(0x127)],'error':_0x25a236 instanceof Error?_0x25a236['message']:String(_0x25a236)});}}return _0xa3dac8[_0xd49005(0x10e)]=new Date()[_0xd49005(0x137)](),await writeSqlLockFile(_0xed97bb[_0xd49005(0x132)],_0xdc1a0e),{'ok':_0x39bfe6[_0xd49005(0x123)]===0x0,'data':{'pulled':_0x245756,'skipped':_0x531bc6,'failed':_0x39bfe6},'message':_0xd49005(0x13c)+_0x245756['length']+_0xd49005(0x103)+_0x531bc6[_0xd49005(0x123)]+_0xd49005(0x116)+_0x39bfe6['length']+_0xd49005(0x145)};}};function isEquivalentPulledSqlFile(_0xda995c,_0xed7044,_0x2f4fe3,_0xe2314){if(_0x2f4fe3!==_0xe2314)return normalizePulledSqlBody(_0xda995c,_0x2f4fe3)===normalizePulledSqlBody(_0xed7044,_0xe2314);return normalizePullComparableContent(_0xda995c,_0x2f4fe3)===normalizePullComparableContent(_0xed7044,_0xe2314);}async function findExistingSqlFiles(_0x446c3e,_0x3557b7,_0x1e4afe,_0x3cb681){const _0x39dac6=a242_0x78035e,_0x3f917e=[];await fileExists(_0x3557b7)&&_0x3f917e[_0x39dac6(0x11f)]({'filePath':_0x3557b7,'mode':_0x1e4afe,'isCanonical':!![]});if(!_0x3cb681?.[_0x39dac6(0x10d)])return _0x3f917e;const _0x163e67=join(_0x446c3e[_0x39dac6(0x147)],_0x3cb681[_0x39dac6(0x10d)]);if(_0x163e67===_0x3557b7)return _0x3f917e;return await fileExists(_0x163e67)&&_0x3f917e[_0x39dac6(0x11f)]({'filePath':_0x163e67,'mode':_0x3cb681['mode']??modeFromFilePath(_0x163e67),'isCanonical':![]}),_0x3f917e;}async function compareExistingSqlFiles(_0x293b54,_0xe59c24,_0x5ec318){const _0x5bcf4d=a242_0x78035e;return Promise[_0x5bcf4d(0x105)](_0x293b54[_0x5bcf4d(0x13f)](async _0x23fe67=>{const _0x28883a=_0x5bcf4d,_0x31232b=await readFile(_0x23fe67[_0x28883a(0x10a)],'utf8');return{'file':_0x23fe67,'content':_0x31232b,'equivalent':isEquivalentPulledSqlFile(_0x31232b,_0xe59c24,_0x23fe67[_0x28883a(0x11c)],_0x5ec318)};}));}function modeFromFilePath(_0x40dec5){const _0xc17569=a242_0x78035e;return _0x40dec5[_0xc17569(0x121)]()[_0xc17569(0x115)](_0xc17569(0x139))?_0xc17569(0x12a):'sql';}function normalizePulledSqlBody(_0xf1638e,_0x14f782){return stripLocalSqlMetadata(_0xf1638e,_0x14f782)['replace'](/\r\n/g,'\x0a')['trim']();}function normalizePullComparableContent(_0x4d8372,_0x2c7f7e){const _0x3a9d60=a242_0x78035e,_0x3dec44=_0x4d8372[_0x3a9d60(0x12f)](/\r\n/g,'\x0a')[_0x3a9d60(0x128)]('\x0a'),_0x34fdea=_0x3dec44[_0x3a9d60(0x142)](_0x19ad94=>!isSyncedAtMetadataLine(_0x19ad94,_0x2c7f7e));return _0x34fdea[_0x3a9d60(0x101)]('\x0a');}function isSyncedAtMetadataLine(_0x26d12c,_0x139940){const _0x1feb58=a242_0x78035e;if(_0x139940===_0x1feb58(0x12a))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x1feb58(0x118)](_0x26d12c);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x1feb58(0x118)](_0x26d12c);}
1
+ const a242_0x1a79b6=a242_0x4e2f;function a242_0x5ba8(){const _0x91fafc=['equivalent','sqlContent','POST','7GrDNdJ','sqlcode','trim','.xml','No\x20remote\x20SQL\x20queries\x20matched.','\x20SQL\x20file(s)\x20into\x20','totalCount','lockFilePath','push','mode','test','toLowerCase','Pull\x20complete:\x20','12RJVNEC','map','read','str','catch','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','sqls','569022trfgdP','force','content','\x20skipped,\x20','569560zmxpRh','233637pgHfYk','path','description','replace','name','Filter\x20by\x20SQL\x20display\x20name','message','length','dbId','sqlName','\x20failed','\x20written,\x20','some','isCanonical','sqlRootDir','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','hash','filter','boolean','tableData','mybatisXml','split','lastSync','55058bnscKe','2651930UrTrgl','file','sqlRoot','3279108AEUkTv','all','sqlCode','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','cancelled','pull','string','4Joomtw','9GPTVYV','5WqpBtY','Would\x20pull\x20','toISOString','appCode','join','skipped','utf8','Force\x20pull\x20cancelled.','1423455RWcmuD','sql','8IHdRzi','local\x20differs\x20from\x20remote','nonInteractive','39yfIuRd','filePath'];a242_0x5ba8=function(){return _0x91fafc;};return a242_0x5ba8();}(function(_0x42f00e,_0x4d5b2f){const _0xe48ca8=a242_0x4e2f,_0x1eb8c4=_0x42f00e();while(!![]){try{const _0x19d924=-parseInt(_0xe48ca8(0x1a1))/0x1*(parseInt(_0xe48ca8(0x18a))/0x2)+-parseInt(_0xe48ca8(0x1c2))/0x3*(-parseInt(_0xe48ca8(0x195))/0x4)+parseInt(_0xe48ca8(0x197))/0x5*(-parseInt(_0xe48ca8(0x1bd))/0x6)+-parseInt(_0xe48ca8(0x1a9))/0x7*(-parseInt(_0xe48ca8(0x1c1))/0x8)+parseInt(_0xe48ca8(0x196))/0x9*(-parseInt(_0xe48ca8(0x18b))/0xa)+parseInt(_0xe48ca8(0x19f))/0xb*(-parseInt(_0xe48ca8(0x1b6))/0xc)+parseInt(_0xe48ca8(0x1a4))/0xd*(parseInt(_0xe48ca8(0x18e))/0xe);if(_0x19d924===_0x4d5b2f)break;else _0x1eb8c4['push'](_0x1eb8c4['shift']());}catch(_0x5e52e4){_0x1eb8c4['push'](_0x1eb8c4['shift']());}}}(a242_0x5ba8,0x22af9));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;function a242_0x4e2f(_0x13f456,_0x20899f){_0x13f456=_0x13f456-0x179;const _0x5ba83c=a242_0x5ba8();let _0x4e2f62=_0x5ba83c[_0x13f456];return _0x4e2f62;}async function fetchAllSqlQueries(_0x430491,_0x15fab4){const _0x5b30fa=a242_0x4e2f,_0x53f3ab=[];let _0x278621=0x1;while(!![]){const _0x102f9b=await listSqlQueries(_0x430491,{'currentPage':_0x278621,'pageSize':PAGE_SIZE,'sqlCode':_0x15fab4[_0x5b30fa(0x190)],'sqlName':_0x15fab4[_0x5b30fa(0x17c)]}),_0x580a12=_0x102f9b[_0x5b30fa(0x186)]??[];_0x53f3ab[_0x5b30fa(0x1b1)](..._0x580a12);if(_0x580a12[_0x5b30fa(0x17a)]===0x0)break;const _0x2ba950=_0x102f9b['paging']?.[_0x5b30fa(0x1af)];if(_0x2ba950!=null?_0x53f3ab['length']>=_0x2ba950:_0x580a12[_0x5b30fa(0x17a)]<PAGE_SIZE)break;_0x278621++;}return _0x53f3ab;}async function ensureSqlContent(_0x1a3476){const _0x240d7d=a242_0x4e2f;if(_0x1a3476['sqlContent']!=null&&String(_0x1a3476[_0x240d7d(0x1a7)])['length']>0x0)return _0x1a3476;return getSqlQueryDetail(_0x1a3476[_0x240d7d(0x190)]);}export const sqlPull={'service':a242_0x1a79b6(0x1a0),'command':a242_0x1a79b6(0x193),'description':a242_0x1a79b6(0x1bb),'risk':a242_0x1a79b6(0x1b8),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a242_0x1a79b6(0x1c6),'type':a242_0x1a79b6(0x194),'description':a242_0x1a79b6(0x1c7)},{'name':a242_0x1a79b6(0x1be),'type':a242_0x1a79b6(0x185),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x3ca7a3){const _0x350986=a242_0x1a79b6,_0x2b89fe=loadSqlProjectConfig(_0x3ca7a3[_0x350986(0x19a)]),_0x2fe5b1=await readSqlLockFile(_0x2b89fe['lockFilePath']),{appLock:_0x424bc7}=ensureSqlLockScope(_0x2fe5b1??createEmptySqlLock(),_0x2b89fe['appCode'],_0x2b89fe[_0x350986(0x18d)],_0x350986(0x193)),_0x3d9534=await fetchAllSqlQueries(_0x3ca7a3['appCode'],{'sqlCode':_0x3ca7a3[_0x350986(0x1b9)](_0x350986(0x1aa))||undefined,'sqlName':_0x3ca7a3['str']('name')||undefined}),_0x32310d=[];for(const _0xff2a18 of _0x3d9534){const _0x3d8b85=await ensureSqlContent(_0xff2a18),_0x2725b2=ensureRemoteSqlContent(_0x3d8b85),_0x224d53=detectSqlMode(_0x2725b2),_0x21c1a2=_0x3d8b85[_0x350986(0x17b)]?await getDbName(_0x3ca7a3[_0x350986(0x19a)],Number(_0x3d8b85[_0x350986(0x17b)]))[_0x350986(0x1ba)](()=>undefined):undefined,_0x10aabf=buildLocalSqlFileContent({'sqlCode':_0x3d8b85[_0x350986(0x190)],'sqlName':_0x3d8b85[_0x350986(0x17c)],'dbId':_0x3d8b85['dbId']},_0x2725b2,{'dbName':_0x21c1a2,'mode':_0x224d53,'syncedAt':new Date()['toISOString'](),'description':_0x3d8b85[_0x350986(0x1c4)]}),_0x316ff5=buildSqlLockEntry(_0x3d8b85,_0x2725b2,'',{'dbName':_0x21c1a2}),_0x177c3f=resolveLocalSqlFilePath(_0x2b89fe,_0x3d8b85[_0x350986(0x190)],_0x316ff5);let _0x16d0d4='would_pull',_0xdd6414;const _0x41cbdc=await findExistingSqlFiles(_0x2b89fe,_0x177c3f,_0x224d53,_0x424bc7[_0x350986(0x1bc)][_0x3d8b85['sqlCode']]);if(_0x41cbdc[_0x350986(0x17a)]>0x0){const _0xb89f3b=await compareExistingSqlFiles(_0x41cbdc,_0x10aabf,_0x224d53);if(_0xb89f3b[_0x350986(0x17f)](({equivalent:_0x4432aa})=>!_0x4432aa))_0x16d0d4='conflict',_0xdd6414=_0x350986(0x191);else _0xb89f3b[_0x350986(0x17a)]===0x1&&_0xb89f3b[0x0]?.[_0x350986(0x18c)][_0x350986(0x180)]&&(_0x16d0d4=_0x350986(0x19c),_0xdd6414='unchanged');}_0x32310d[_0x350986(0x1b1)]({'sqlCode':_0x3d8b85[_0x350986(0x190)],'sqlName':_0x3d8b85['sqlName'],'filePath':_0x177c3f,'status':_0x16d0d4,'reason':_0xdd6414});}return{'method':_0x350986(0x1a8),'url':'/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','body':{'appCode':_0x3ca7a3[_0x350986(0x19a)],'sqlCode':_0x3ca7a3[_0x350986(0x1b9)]('sqlcode')||null,'sqlName':_0x3ca7a3[_0x350986(0x1b9)]('name')||null,'files':_0x32310d},'description':_0x350986(0x198)+_0x32310d['length']+_0x350986(0x1ae)+_0x2b89fe[_0x350986(0x181)]};},async 'execute'(_0xc8a5b0){const _0x4049c2=a242_0x1a79b6,_0x21716a=loadSqlProjectConfig(_0xc8a5b0['appCode']),_0x5e5fd9=await readSqlLockFile(_0x21716a[_0x4049c2(0x1b0)]),{lockData:_0x2da450,appLock:_0x3972fc}=ensureSqlLockScope(_0x5e5fd9??createEmptySqlLock(),_0x21716a[_0x4049c2(0x19a)],_0x21716a[_0x4049c2(0x18d)],'pull'),_0x138fac=_0xc8a5b0['bool'](_0x4049c2(0x1be)),_0x535535=await fetchAllSqlQueries(_0xc8a5b0[_0x4049c2(0x19a)],{'sqlCode':_0xc8a5b0[_0x4049c2(0x1b9)](_0x4049c2(0x1aa))||undefined,'sqlName':_0xc8a5b0[_0x4049c2(0x1b9)](_0x4049c2(0x1c6))||undefined});if(_0x535535[_0x4049c2(0x17a)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x4049c2(0x1ad)};const _0x58d809=[],_0x31b666=[];for(const _0x1aaf21 of _0x535535){try{_0x58d809['push'](await ensureSqlContent(_0x1aaf21));}catch(_0x6778ec){_0x31b666['push']({'sqlCode':_0x1aaf21['sqlCode'],'error':_0x6778ec instanceof Error?_0x6778ec[_0x4049c2(0x179)]:String(_0x6778ec)});}}if(_0x138fac&&!_0xc8a5b0[_0x4049c2(0x1a3)]){let _0x244d66=![];for(const _0x172b79 of _0x58d809){const _0x3a348c=detectSqlMode(ensureRemoteSqlContent(_0x172b79)),_0x375394=_0x172b79[_0x4049c2(0x17b)]?await getDbName(_0xc8a5b0[_0x4049c2(0x19a)],Number(_0x172b79['dbId']))[_0x4049c2(0x1ba)](()=>undefined):undefined,_0x2e7141=buildLocalSqlFileContent({'sqlCode':_0x172b79[_0x4049c2(0x190)],'sqlName':_0x172b79[_0x4049c2(0x17c)],'dbId':_0x172b79[_0x4049c2(0x17b)]},ensureRemoteSqlContent(_0x172b79),{'dbName':_0x375394,'mode':_0x3a348c,'syncedAt':new Date()[_0x4049c2(0x199)](),'description':_0x172b79['description']}),_0x4ee573=resolveLocalSqlFilePath(_0x21716a,_0x172b79[_0x4049c2(0x190)],buildSqlLockEntry(_0x172b79,ensureRemoteSqlContent(_0x172b79),'',{'dbName':_0x375394})),_0x1dae7d=await findExistingSqlFiles(_0x21716a,_0x4ee573,_0x3a348c,_0x3972fc[_0x4049c2(0x1bc)][_0x172b79[_0x4049c2(0x190)]]),_0x319e99=await compareExistingSqlFiles(_0x1dae7d,_0x2e7141,_0x3a348c);if(_0x319e99[_0x4049c2(0x17f)](({equivalent:_0x449a86})=>!_0x449a86)){_0x244d66=!![];break;}}if(_0x244d66){const _0x2610a4=await confirmForceOverwrite(_0x4049c2(0x182));if(!_0x2610a4)throw CliErrors[_0x4049c2(0x192)](_0x4049c2(0x19e));}}const _0x1faed8=cloneSqlLockData(_0x2da450),_0x1b7462=_0x1faed8['apps'][_0x21716a[_0x4049c2(0x19a)]],_0x26bb1d=[],_0x2f6ed2=[];for(const _0x5421fe of _0x58d809){const _0x3bc206=_0x1b7462[_0x4049c2(0x1bc)][_0x5421fe[_0x4049c2(0x190)]],_0x3e08f5=ensureRemoteSqlContent(_0x5421fe),_0x54bf70=detectSqlMode(_0x3e08f5),_0x31cc1b=_0x5421fe[_0x4049c2(0x17b)]?await getDbName(_0xc8a5b0['appCode'],Number(_0x5421fe[_0x4049c2(0x17b)]))['catch'](()=>undefined):undefined,_0x350747=buildLocalSqlFileContent({'sqlCode':_0x5421fe[_0x4049c2(0x190)],'sqlName':_0x5421fe[_0x4049c2(0x17c)],'dbId':_0x5421fe[_0x4049c2(0x17b)]},_0x3e08f5,{'dbName':_0x31cc1b,'mode':_0x54bf70,'syncedAt':new Date()['toISOString'](),'description':_0x5421fe[_0x4049c2(0x1c4)]}),_0x231af4=buildSqlLockEntry(_0x5421fe,_0x3e08f5,computeSqlContentHash(_0x350747),{'dbName':_0x31cc1b}),_0x572339=_0x231af4[_0x4049c2(0x1c3)],_0x476da7=join(_0x21716a[_0x4049c2(0x181)],_0x572339);try{const _0x535c49=await findExistingSqlFiles(_0x21716a,_0x476da7,_0x54bf70,_0x3bc206),_0x560786=await compareExistingSqlFiles(_0x535c49,_0x350747,_0x54bf70);if(!_0x138fac&&_0x560786[_0x4049c2(0x17f)](({equivalent:_0x2e18cb})=>!_0x2e18cb)){_0x2f6ed2[_0x4049c2(0x1b1)]({'sqlCode':_0x5421fe[_0x4049c2(0x190)],'reason':_0x4049c2(0x1a2)});continue;}const _0x5e6229=_0x560786['find'](({file:_0x4a9f38})=>_0x4a9f38[_0x4049c2(0x180)]),_0x514b55=_0x560786['find'](({file:_0x197b7f})=>!_0x197b7f['isCanonical']);if(_0x5e6229?.[_0x4049c2(0x1a6)]&&!_0x514b55){_0x2f6ed2['push']({'sqlCode':_0x5421fe[_0x4049c2(0x190)],'reason':'unchanged'}),_0x1b7462[_0x4049c2(0x1bc)][_0x5421fe['sqlCode']]={..._0x231af4,'hash':computeSqlContentHash(_0x5e6229[_0x4049c2(0x1bf)]),'path':_0x572339};continue;}!_0x5e6229?.[_0x4049c2(0x1a6)]&&(await ensureParentDirectory(_0x476da7),await writeFile(_0x476da7,_0x350747,'utf8')),_0x514b55&&await rm(_0x514b55[_0x4049c2(0x18c)][_0x4049c2(0x1a5)],{'force':!![]}),_0x1b7462[_0x4049c2(0x1bc)][_0x5421fe[_0x4049c2(0x190)]]={..._0x231af4,'hash':_0x5e6229?.[_0x4049c2(0x1a6)]?computeSqlContentHash(_0x5e6229[_0x4049c2(0x1bf)]):_0x231af4[_0x4049c2(0x183)],'path':_0x572339},_0x26bb1d[_0x4049c2(0x1b1)]({'sqlCode':_0x5421fe[_0x4049c2(0x190)],'filePath':_0x476da7});}catch(_0x1922c2){_0x31b666[_0x4049c2(0x1b1)]({'sqlCode':_0x5421fe[_0x4049c2(0x190)],'error':_0x1922c2 instanceof Error?_0x1922c2[_0x4049c2(0x179)]:String(_0x1922c2)});}}return _0x1b7462[_0x4049c2(0x189)]=new Date()[_0x4049c2(0x199)](),await writeSqlLockFile(_0x21716a['lockFilePath'],_0x1faed8),{'ok':_0x31b666[_0x4049c2(0x17a)]===0x0,'data':{'pulled':_0x26bb1d,'skipped':_0x2f6ed2,'failed':_0x31b666},'message':_0x4049c2(0x1b5)+_0x26bb1d[_0x4049c2(0x17a)]+_0x4049c2(0x17e)+_0x2f6ed2[_0x4049c2(0x17a)]+_0x4049c2(0x1c0)+_0x31b666[_0x4049c2(0x17a)]+_0x4049c2(0x17d)};}};function isEquivalentPulledSqlFile(_0x4edb39,_0x27cd99,_0x1abf3b,_0x15a4e4){if(_0x1abf3b!==_0x15a4e4)return normalizePulledSqlBody(_0x4edb39,_0x1abf3b)===normalizePulledSqlBody(_0x27cd99,_0x15a4e4);return normalizePullComparableContent(_0x4edb39,_0x1abf3b)===normalizePullComparableContent(_0x27cd99,_0x15a4e4);}async function findExistingSqlFiles(_0xa3397a,_0x279a4a,_0x525dce,_0x2ee989){const _0x42424c=a242_0x1a79b6,_0x276df9=[];await fileExists(_0x279a4a)&&_0x276df9['push']({'filePath':_0x279a4a,'mode':_0x525dce,'isCanonical':!![]});if(!_0x2ee989?.[_0x42424c(0x1c3)])return _0x276df9;const _0x305131=join(_0xa3397a[_0x42424c(0x181)],_0x2ee989[_0x42424c(0x1c3)]);if(_0x305131===_0x279a4a)return _0x276df9;return await fileExists(_0x305131)&&_0x276df9[_0x42424c(0x1b1)]({'filePath':_0x305131,'mode':_0x2ee989[_0x42424c(0x1b2)]??modeFromFilePath(_0x305131),'isCanonical':![]}),_0x276df9;}async function compareExistingSqlFiles(_0x464681,_0x319bc8,_0x2b5d89){const _0x2f1311=a242_0x1a79b6;return Promise[_0x2f1311(0x18f)](_0x464681[_0x2f1311(0x1b7)](async _0x4325e7=>{const _0x4ed08c=_0x2f1311,_0x4db559=await readFile(_0x4325e7[_0x4ed08c(0x1a5)],_0x4ed08c(0x19d));return{'file':_0x4325e7,'content':_0x4db559,'equivalent':isEquivalentPulledSqlFile(_0x4db559,_0x319bc8,_0x4325e7[_0x4ed08c(0x1b2)],_0x2b5d89)};}));}function modeFromFilePath(_0x186058){const _0x1a5d45=a242_0x1a79b6;return _0x186058[_0x1a5d45(0x1b4)]()['endsWith'](_0x1a5d45(0x1ac))?_0x1a5d45(0x187):_0x1a5d45(0x1a0);}function normalizePulledSqlBody(_0x5a02a5,_0x1509c4){const _0x3a363c=a242_0x1a79b6;return stripLocalSqlMetadata(_0x5a02a5,_0x1509c4)[_0x3a363c(0x1c5)](/\r\n/g,'\x0a')[_0x3a363c(0x1ab)]();}function normalizePullComparableContent(_0x5ac4fb,_0x4e1161){const _0x175c40=a242_0x1a79b6,_0x400f24=_0x5ac4fb[_0x175c40(0x1c5)](/\r\n/g,'\x0a')[_0x175c40(0x188)]('\x0a'),_0x4f8ed6=_0x400f24[_0x175c40(0x184)](_0x599afc=>!isSyncedAtMetadataLine(_0x599afc,_0x4e1161));return _0x4f8ed6[_0x175c40(0x19b)]('\x0a');}function isSyncedAtMetadataLine(_0x1c9871,_0xd3fac5){const _0x227b95=a242_0x1a79b6;if(_0xd3fac5===_0x227b95(0x187))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x1c9871);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x227b95(0x1b3)](_0x1c9871);}
@@ -1 +1 @@
1
- const a243_0x53a130=a243_0x492e;(function(_0x101bd0,_0x17d71e){const _0x3239e2=a243_0x492e,_0x4c4a36=_0x101bd0();while(!![]){try{const _0x1c708d=-parseInt(_0x3239e2(0x1ff))/0x1*(-parseInt(_0x3239e2(0x1fa))/0x2)+parseInt(_0x3239e2(0x1f0))/0x3*(parseInt(_0x3239e2(0x1c1))/0x4)+-parseInt(_0x3239e2(0x1c5))/0x5*(parseInt(_0x3239e2(0x1eb))/0x6)+-parseInt(_0x3239e2(0x1c7))/0x7+-parseInt(_0x3239e2(0x1fe))/0x8+-parseInt(_0x3239e2(0x1c3))/0x9*(-parseInt(_0x3239e2(0x1e7))/0xa)+parseInt(_0x3239e2(0x1f9))/0xb*(parseInt(_0x3239e2(0x1f5))/0xc);if(_0x1c708d===_0x17d71e)break;else _0x4c4a36['push'](_0x4c4a36['shift']());}catch(_0x19fd90){_0x4c4a36['push'](_0x4c4a36['shift']());}}}(a243_0xf7de,0x32907));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';function a243_0x492e(_0x1b904b,_0xe74cc1){_0x1b904b=_0x1b904b-0x1be;const _0xf7dee=a243_0xf7de();let _0x492e49=_0xf7dee[_0x1b904b];return _0x492e49;}import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function readSqlUploadContent(_0x454f87){const _0x2d4192=a243_0x492e,_0x353773=stripLocalSqlMetadata(await readFile(_0x454f87['filePath'],_0x2d4192(0x1e0)),_0x454f87['mode']);if(!_0x353773[_0x2d4192(0x202)]())throw CliErrors[_0x2d4192(0x201)](_0x454f87[_0x2d4192(0x1d8)]+':\x20SQL\x20content\x20is\x20empty.');return _0x353773;}async function getTargetSqlQueries(_0x327529,_0x12699,_0x3bbf79){const _0x2c91ab=a243_0x492e,_0x3508c9=await scanLocalSqlQueries(_0x327529),_0x1dcca1=new Map();for(const _0x317ded of _0x3508c9){if(_0x3bbf79&&_0x317ded[_0x2c91ab(0x1d8)]!==_0x3bbf79)continue;const _0x186eaf=_0x1dcca1[_0x2c91ab(0x1d5)](_0x317ded[_0x2c91ab(0x1d8)])??[];_0x186eaf['push'](_0x317ded),_0x1dcca1['set'](_0x317ded['sqlCode'],_0x186eaf);}if(_0x3bbf79&&!_0x1dcca1[_0x2c91ab(0x1d7)](_0x3bbf79))throw CliErrors[_0x2c91ab(0x201)](_0x2c91ab(0x1dc)+_0x3bbf79);const _0x4e605f=[];for(const [_0x3d79ce,_0x1afc76]of _0x1dcca1[_0x2c91ab(0x1e8)]()){if(_0x1afc76['length']===0x1){_0x4e605f[_0x2c91ab(0x1c8)](_0x1afc76[0x0]);continue;}const _0x53b426=_0x12699[_0x2c91ab(0x1ec)][_0x3d79ce],_0x1f01bd=_0x53b426?.[_0x2c91ab(0x1c2)],_0x532338=_0x1f01bd?_0x1afc76[_0x2c91ab(0x1ee)](_0x55a1b6=>_0x55a1b6[_0x2c91ab(0x1f4)]!==_0x1f01bd):_0x1afc76;if(_0x53b426&&_0x532338[_0x2c91ab(0x1d3)]===0x1){_0x4e605f[_0x2c91ab(0x1c8)](_0x532338[0x0]);continue;}throw CliErrors[_0x2c91ab(0x201)]('Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20'+_0x3d79ce+_0x2c91ab(0x1f2));}return _0x4e605f;}export const sqlPush={'service':a243_0x53a130(0x1fb),'command':a243_0x53a130(0x1c8),'description':a243_0x53a130(0x1f1),'risk':a243_0x53a130(0x203),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a243_0x53a130(0x1d2),'type':a243_0x53a130(0x1bf),'description':'Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'}],async 'dryRun'(_0x317d1d){const _0x258696=a243_0x53a130,_0x39c748=loadSqlProjectConfig(_0x317d1d[_0x258696(0x1ea)]),_0x3ec1d0=await readSqlLockFile(_0x39c748['lockFilePath']),{appLock:_0x19e4b1}=ensureSqlLockScope(_0x3ec1d0??createEmptySqlLock(),_0x317d1d[_0x258696(0x1ea)],_0x39c748['sqlRoot'],'push'),_0x1be163=await getTargetSqlQueries(_0x39c748,_0x19e4b1,_0x317d1d['str']('sqlcode')||undefined),_0x1e9d5c=[];for(const _0x335d23 of _0x1be163){const _0x3af0be=await computeSqlFileHash(_0x335d23[_0x258696(0x1f3)]),_0x184263=_0x19e4b1[_0x258696(0x1ec)][_0x335d23[_0x258696(0x1d8)]],_0x8c11a3=!!_0x184263&&(_0x184263[_0x258696(0x1c2)]!==_0x335d23[_0x258696(0x1f4)]||!!_0x335d23['sqlName']&&_0x184263[_0x258696(0x1d9)]!==_0x335d23[_0x258696(0x1d9)]||_0x184263[_0x258696(0x1e1)]!==_0x335d23[_0x258696(0x1e1)]);if(!_0x317d1d[_0x258696(0x1cc)](_0x258696(0x1d2))&&_0x184263&&_0x184263[_0x258696(0x1df)]===_0x3af0be&&!_0x8c11a3)continue;if(!_0x184263)throw CliErrors[_0x258696(0x201)](_0x335d23[_0x258696(0x1d8)]+':\x20local\x20SQL\x20is\x20not\x20tracked;\x20run\x20sql\x20create\x20or\x20sql\x20pull\x20first.');if(_0x184263[_0x258696(0x1c0)]==null)throw CliErrors[_0x258696(0x201)](_0x335d23[_0x258696(0x1d8)]+_0x258696(0x1de));await resolveTargetDbBinding(_0x317d1d[_0x258696(0x1ea)],_0x335d23,_0x184263),await readSqlUploadContent(_0x335d23),_0x1e9d5c['push'](_0x335d23['sqlCode']);}return{'method':'POST','url':_0x258696(0x1c4),'body':{'sqlCodes':_0x1e9d5c,'appCode':_0x317d1d[_0x258696(0x1ea)]},'description':'Would\x20push\x20'+_0x1e9d5c['length']+'\x20SQL\x20file(s)'};},async 'execute'(_0x4c3976){const _0x5d126a=a243_0x53a130,_0x352304=loadSqlProjectConfig(_0x4c3976['appCode']),_0x11deb9=await readSqlLockFile(_0x352304[_0x5d126a(0x1da)]),{lockData:_0x4beaed,appLock:_0x43d76f}=ensureSqlLockScope(_0x11deb9??createEmptySqlLock(),_0x4c3976[_0x5d126a(0x1ea)],_0x352304['sqlRoot'],_0x5d126a(0x1c8)),_0x279fbe=await getTargetSqlQueries(_0x352304,_0x43d76f,_0x4c3976[_0x5d126a(0x1f6)](_0x5d126a(0x1ef))||undefined);if(_0x279fbe[_0x5d126a(0x1d3)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x5d126a(0x1e4)};const _0x752736=[],_0x31678d=[],_0x1a1e91=[];let _0x4e4d71=![];for(const _0xbe8c10 of _0x279fbe){const _0x366a49=_0x43d76f[_0x5d126a(0x1ec)][_0xbe8c10[_0x5d126a(0x1d8)]];if(!_0x366a49){_0x1a1e91[_0x5d126a(0x1c8)]({'sqlCode':_0xbe8c10[_0x5d126a(0x1d8)],'error':_0x5d126a(0x1cd)});continue;}try{const _0x3fadaa=await computeSqlFileHash(_0xbe8c10['filePath']),_0x156418=_0x366a49[_0x5d126a(0x1c2)]!==_0xbe8c10[_0x5d126a(0x1f4)]||!!_0xbe8c10[_0x5d126a(0x1d9)]&&_0x366a49[_0x5d126a(0x1d9)]!==_0xbe8c10[_0x5d126a(0x1d9)]||_0x366a49[_0x5d126a(0x1e1)]!==_0xbe8c10[_0x5d126a(0x1e1)];if(!_0x4c3976[_0x5d126a(0x1cc)](_0x5d126a(0x1d2))&&_0x366a49['hash']===_0x3fadaa&&!_0x156418){_0x31678d['push']({'sqlCode':_0xbe8c10[_0x5d126a(0x1d8)],'reason':_0x5d126a(0x1c6)});continue;}if(_0x366a49[_0x5d126a(0x1c0)]==null){_0x1a1e91[_0x5d126a(0x1c8)]({'sqlCode':_0xbe8c10[_0x5d126a(0x1d8)],'error':_0x5d126a(0x1cf)});continue;}const _0xbd0eb7=_0xbe8c10[_0x5d126a(0x1d9)]||_0x366a49[_0x5d126a(0x1d9)],_0x148ba9=await resolveTargetDbBinding(_0x4c3976[_0x5d126a(0x1ea)],_0xbe8c10,_0x366a49),_0x5563ad=await readSqlUploadContent(_0xbe8c10),_0x37d89d=await updateSqlQuery({'id':_0x366a49[_0x5d126a(0x1fc)],'appCode':_0x4c3976[_0x5d126a(0x1ea)],'sqlCode':_0xbe8c10['sqlCode'],'sqlName':_0xbd0eb7,'dbId':_0x148ba9['dbId'],'version':_0x366a49[_0x5d126a(0x1c0)],'sqlContent':_0x5563ad,'sqlConfig':_0x366a49[_0x5d126a(0x1ca)]??undefined}),_0x5d6341=_0x37d89d['dbId']?await getDbName(_0x4c3976[_0x5d126a(0x1ea)],Number(_0x37d89d[_0x5d126a(0x1f7)]))[_0x5d126a(0x1ce)](()=>_0x148ba9[_0x5d126a(0x1e9)]):_0x148ba9['dbName'];_0x43d76f[_0x5d126a(0x1ec)][_0xbe8c10[_0x5d126a(0x1d8)]]={...buildSqlLockEntry(_0x37d89d,_0x5563ad,_0x3fadaa,{'dbName':_0x5d6341}),'path':_0xbe8c10[_0x5d126a(0x1f4)],'mode':_0xbe8c10['mode']},_0x4e4d71=!![],await archivePreviousSqlFileIfNeeded(_0x352304,_0x366a49['path'],_0xbe8c10[_0x5d126a(0x1f4)]),_0x752736[_0x5d126a(0x1c8)]({'sqlCode':_0xbe8c10[_0x5d126a(0x1d8)],'remoteId':_0x366a49[_0x5d126a(0x1fc)]});}catch(_0x46657b){_0x1a1e91['push']({'sqlCode':_0xbe8c10[_0x5d126a(0x1d8)],'error':_0x46657b instanceof Error?_0x46657b[_0x5d126a(0x1d1)]:String(_0x46657b)});}}(_0x4e4d71||_0x1a1e91[_0x5d126a(0x1d3)]===0x0)&&(_0x43d76f[_0x5d126a(0x1f8)]=new Date()[_0x5d126a(0x1e3)](),await writeSqlLockFile(_0x352304[_0x5d126a(0x1da)],_0x4beaed));const _0x11218c=_0x1a1e91['length']===0x0;return{'ok':_0x11218c,'data':{'pushed':_0x752736,'skipped':_0x31678d,'failed':_0x1a1e91},'message':_0x5d126a(0x200)+_0x752736[_0x5d126a(0x1d3)]+_0x5d126a(0x1fd)+_0x31678d[_0x5d126a(0x1d3)]+_0x5d126a(0x1be)+_0x1a1e91['length']+_0x5d126a(0x1e5)};}};async function archivePreviousSqlFileIfNeeded(_0x251065,_0x2e8dae,_0x3fad05){const _0x1e55d3=a243_0x53a130;if(!_0x2e8dae||_0x2e8dae===_0x3fad05)return;const _0x519464=join(_0x251065['sqlRootDir'],_0x2e8dae);if(!await fileExists(_0x519464))return;const _0x2dc602=await moveToTrash(_0x251065['projectRoot'],_0x251065[_0x1e55d3(0x1cb)],_0x519464);await cleanupEmptyDirectories(dirname(_0x519464),_0x251065[_0x1e55d3(0x1dd)]),void _0x2dc602;}async function moveToTrash(_0x3a89ed,_0x35560d,_0x14127f){const _0x4ef70e=new Date()['toISOString']()['replace'](/[:.]/g,'-'),_0x1117d2=relative(_0x3a89ed,_0x14127f),_0x13c055=join(_0x35560d,_0x4ef70e,_0x1117d2);return await mkdir(dirname(_0x13c055),{'recursive':!![]}),await rename(_0x14127f,_0x13c055),_0x13c055;}function a243_0xf7de(){const _0x5c0068=['dbId','lastSync','3311330RzduCO','47176QBrlyG','sql','remoteId','\x20pushed,\x20','674928rZniAs','8WiwHbn','Push\x20complete:\x20','validation','trim','write','\x20skipped,\x20','boolean','version','11296AQOKGI','path','2138706viTCLh','/smartapi/custom/updateUserCustomSql','109615zFtetk','unchanged','1164450gPRbNd','push','exec','sqlConfig','trashDir','bool','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','catch','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','startsWith','message','force','length','map','get','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','has','sqlCode','sqlName','lockFilePath','Local\x20directory\x20\x22','Local\x20SQL\x20not\x20found:\x20','sqlRootDir',':\x20missing\x20remote\x20version;\x20run\x20sql\x20pull\x20first.','hash','utf8','mode','No\x20database\x20matches\x20local\x20directory\x20\x22','toISOString','No\x20local\x20SQL\x20files\x20found.','\x20failed','\x22\x20for\x20sqlCode\x20','10bmQumO','entries','dbName','appCode','90aIroNJ','sqls','dbDirectory','filter','sqlcode','63bbgVAm','Push\x20local\x20SQL\x20files\x20to\x20remote','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','filePath','relativePath','12ubpOJM','str'];a243_0xf7de=function(){return _0x5c0068;};return a243_0xf7de();}async function cleanupEmptyDirectories(_0x2ce55c,_0x4e199a){const _0x482624=a243_0x53a130;let _0xe10757=resolve(_0x2ce55c);const _0x409b0d=resolve(_0x4e199a);while(_0xe10757[_0x482624(0x1d0)](''+_0x409b0d+sep)||_0xe10757===_0x409b0d){if(_0xe10757===_0x409b0d)return;try{const _0x1ab8b3=await readdir(_0xe10757);if(_0x1ab8b3[_0x482624(0x1d3)]>0x0)return;await rmdir(_0xe10757);}catch{return;}_0xe10757=dirname(_0xe10757);}}async function resolveTargetDbBinding(_0x58e5e1,_0x1cc9b8,_0x5b0ecf){const _0x54ac74=a243_0x53a130,_0x3862e5=_0x1cc9b8[_0x54ac74(0x1ed)];if(!_0x3862e5)return{'dbId':_0x5b0ecf[_0x54ac74(0x1f7)],'dbName':_0x5b0ecf[_0x54ac74(0x1e9)]};const _0x583058=buildDbDirectoryName(_0x5b0ecf[_0x54ac74(0x1e9)],_0x5b0ecf[_0x54ac74(0x1f7)]);if(_0x3862e5===_0x583058)return{'dbId':_0x5b0ecf['dbId'],'dbName':_0x5b0ecf['dbName']};const _0x196c2b=parseExplicitDbDirectory(_0x3862e5);if(_0x196c2b!=null)return{'dbId':_0x196c2b,'dbName':await getDbName(_0x58e5e1,_0x196c2b)[_0x54ac74(0x1ce)](()=>undefined)};const _0x19da71=await listDatabases(_0x58e5e1),_0x4b4235=_0x19da71[_0x54ac74(0x1ee)](_0x5e9076=>buildDbDirectoryName(_0x5e9076['dbName'],_0x5e9076[_0x54ac74(0x1f7)])===_0x3862e5);if(_0x4b4235[_0x54ac74(0x1d3)]===0x1)return{'dbId':_0x4b4235[0x0][_0x54ac74(0x1f7)],'dbName':_0x4b4235[0x0]['dbName']};if(_0x4b4235[_0x54ac74(0x1d3)]===0x0)throw CliErrors[_0x54ac74(0x201)](_0x54ac74(0x1e2)+_0x3862e5+_0x54ac74(0x1e6)+_0x1cc9b8[_0x54ac74(0x1d8)]+'.');const _0x1fffcf=_0x4b4235[_0x54ac74(0x1d4)](_0x2a4bd4=>_0x2a4bd4[_0x54ac74(0x1e9)]+'\x20('+_0x2a4bd4[_0x54ac74(0x1f7)]+')')['join'](',\x20');throw CliErrors['validation'](_0x54ac74(0x1db)+_0x3862e5+_0x54ac74(0x1d6)+_0x1cc9b8['sqlCode']+':\x20'+_0x1fffcf);}function parseExplicitDbDirectory(_0x1b4db3){const _0x237ec1=a243_0x53a130,_0x275075=/^db-(\d+)$/[_0x237ec1(0x1c9)](_0x1b4db3);if(!_0x275075)return null;const _0x5a769f=Number(_0x275075[0x1]);return Number['isFinite'](_0x5a769f)&&_0x5a769f>0x0?_0x5a769f:null;}
1
+ const a243_0x4ed571=a243_0x1ecd;(function(_0x56caea,_0x365f46){const _0x2549fc=a243_0x1ecd,_0x1c9229=_0x56caea();while(!![]){try{const _0x2a7f5f=-parseInt(_0x2549fc(0x1dd))/0x1*(-parseInt(_0x2549fc(0x1b1))/0x2)+parseInt(_0x2549fc(0x1de))/0x3+-parseInt(_0x2549fc(0x1bf))/0x4*(parseInt(_0x2549fc(0x1b6))/0x5)+-parseInt(_0x2549fc(0x1eb))/0x6+parseInt(_0x2549fc(0x1d2))/0x7*(parseInt(_0x2549fc(0x1c3))/0x8)+parseInt(_0x2549fc(0x1ca))/0x9+-parseInt(_0x2549fc(0x1f5))/0xa*(parseInt(_0x2549fc(0x1c6))/0xb);if(_0x2a7f5f===_0x365f46)break;else _0x1c9229['push'](_0x1c9229['shift']());}catch(_0x24029e){_0x1c9229['push'](_0x1c9229['shift']());}}}(a243_0x2e8b,0x7de3a));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';function a243_0x1ecd(_0x5cd800,_0x214e3f){_0x5cd800=_0x5cd800-0x1ae;const _0x2e8bc2=a243_0x2e8b();let _0x1ecd98=_0x2e8bc2[_0x5cd800];return _0x1ecd98;}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function readSqlUploadContent(_0x6ac5bc){const _0x1e34f6=a243_0x1ecd,_0x4bbf71=stripLocalSqlMetadata(await readFile(_0x6ac5bc[_0x1e34f6(0x1b5)],_0x1e34f6(0x1d5)),_0x6ac5bc['mode']);if(!_0x4bbf71[_0x1e34f6(0x1b9)]())throw CliErrors[_0x1e34f6(0x1ef)](_0x6ac5bc[_0x1e34f6(0x1d8)]+_0x1e34f6(0x1c7));return _0x4bbf71;}async function getTargetSqlQueries(_0x2ad85d,_0x578bc2,_0x2db995){const _0x3c1e10=a243_0x1ecd,_0x2c35b3=await scanLocalSqlQueries(_0x2ad85d),_0x31833c=new Map();for(const _0x58c353 of _0x2c35b3){if(_0x2db995&&_0x58c353['sqlCode']!==_0x2db995)continue;const _0x289d21=_0x31833c[_0x3c1e10(0x1d7)](_0x58c353[_0x3c1e10(0x1d8)])??[];_0x289d21[_0x3c1e10(0x1df)](_0x58c353),_0x31833c['set'](_0x58c353[_0x3c1e10(0x1d8)],_0x289d21);}if(_0x2db995&&!_0x31833c[_0x3c1e10(0x1f3)](_0x2db995))throw CliErrors['validation'](_0x3c1e10(0x1bd)+_0x2db995);const _0x27efd1=[];for(const [_0x14fa8e,_0x2fb0ce]of _0x31833c[_0x3c1e10(0x1f4)]()){if(_0x2fb0ce[_0x3c1e10(0x1e9)]===0x1){_0x27efd1[_0x3c1e10(0x1df)](_0x2fb0ce[0x0]);continue;}const _0x20b346=_0x578bc2[_0x3c1e10(0x1d6)][_0x14fa8e],_0x19f0e3=_0x20b346?.[_0x3c1e10(0x1d4)],_0x1a3a65=_0x19f0e3?_0x2fb0ce[_0x3c1e10(0x1e3)](_0x53b7de=>_0x53b7de[_0x3c1e10(0x1c2)]!==_0x19f0e3):_0x2fb0ce;if(_0x20b346&&_0x1a3a65['length']===0x1){_0x27efd1[_0x3c1e10(0x1df)](_0x1a3a65[0x0]);continue;}throw CliErrors['validation'](_0x3c1e10(0x1cd)+_0x14fa8e+_0x3c1e10(0x1c4));}return _0x27efd1;}export const sqlPush={'service':a243_0x4ed571(0x1b0),'command':a243_0x4ed571(0x1df),'description':a243_0x4ed571(0x1cf),'risk':a243_0x4ed571(0x1ba),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a243_0x4ed571(0x1e7),'type':'boolean','description':'Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'}],async 'dryRun'(_0x4bae18){const _0x153f23=a243_0x4ed571,_0x2ca4e8=loadSqlProjectConfig(_0x4bae18[_0x153f23(0x1cc)]),_0x184997=await readSqlLockFile(_0x2ca4e8['lockFilePath']),{appLock:_0x40b77c}=ensureSqlLockScope(_0x184997??createEmptySqlLock(),_0x4bae18[_0x153f23(0x1cc)],_0x2ca4e8['sqlRoot'],_0x153f23(0x1df)),_0x174ad1=await getTargetSqlQueries(_0x2ca4e8,_0x40b77c,_0x4bae18[_0x153f23(0x1b4)](_0x153f23(0x1b7))||undefined),_0x228805=[];for(const _0x2d6e05 of _0x174ad1){const _0x5dbae7=await computeSqlFileHash(_0x2d6e05[_0x153f23(0x1b5)]),_0x54e2e1=_0x40b77c[_0x153f23(0x1d6)][_0x2d6e05[_0x153f23(0x1d8)]],_0x27cd3c=!!_0x54e2e1&&(_0x54e2e1[_0x153f23(0x1d4)]!==_0x2d6e05['relativePath']||!!_0x2d6e05[_0x153f23(0x1be)]&&_0x54e2e1[_0x153f23(0x1be)]!==_0x2d6e05['sqlName']||_0x54e2e1[_0x153f23(0x1e8)]!==_0x2d6e05[_0x153f23(0x1e8)]);if(!_0x4bae18[_0x153f23(0x1d1)](_0x153f23(0x1e7))&&_0x54e2e1&&_0x54e2e1[_0x153f23(0x1ce)]===_0x5dbae7&&!_0x27cd3c)continue;if(!_0x54e2e1)throw CliErrors[_0x153f23(0x1ef)](_0x2d6e05[_0x153f23(0x1d8)]+':\x20local\x20SQL\x20is\x20not\x20tracked;\x20run\x20sql\x20create\x20or\x20sql\x20pull\x20first.');if(_0x54e2e1[_0x153f23(0x1e2)]==null)throw CliErrors['validation'](_0x2d6e05['sqlCode']+_0x153f23(0x1d0));await resolveTargetDbBinding(_0x4bae18[_0x153f23(0x1cc)],_0x2d6e05,_0x54e2e1),await readSqlUploadContent(_0x2d6e05),_0x228805[_0x153f23(0x1df)](_0x2d6e05[_0x153f23(0x1d8)]);}return{'method':_0x153f23(0x1bc),'url':_0x153f23(0x1e6),'body':{'sqlCodes':_0x228805,'appCode':_0x4bae18[_0x153f23(0x1cc)]},'description':_0x153f23(0x1d9)+_0x228805[_0x153f23(0x1e9)]+_0x153f23(0x1ee)};},async 'execute'(_0xd007e6){const _0x176b2a=a243_0x4ed571,_0xd570b8=loadSqlProjectConfig(_0xd007e6[_0x176b2a(0x1cc)]),_0x33c599=await readSqlLockFile(_0xd570b8[_0x176b2a(0x1e4)]),{lockData:_0x42ce63,appLock:_0x3cdcff}=ensureSqlLockScope(_0x33c599??createEmptySqlLock(),_0xd007e6[_0x176b2a(0x1cc)],_0xd570b8[_0x176b2a(0x1c0)],_0x176b2a(0x1df)),_0x31ea87=await getTargetSqlQueries(_0xd570b8,_0x3cdcff,_0xd007e6[_0x176b2a(0x1b4)](_0x176b2a(0x1b7))||undefined);if(_0x31ea87[_0x176b2a(0x1e9)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x176b2a(0x1f0)};const _0xcf14a4=[],_0x32852b=[],_0x13ea07=[];let _0x45df9f=![];for(const _0x5a307c of _0x31ea87){const _0x51eb94=_0x3cdcff['sqls'][_0x5a307c['sqlCode']];if(!_0x51eb94){_0x13ea07[_0x176b2a(0x1df)]({'sqlCode':_0x5a307c[_0x176b2a(0x1d8)],'error':_0x176b2a(0x1ed)});continue;}try{const _0x10f435=await computeSqlFileHash(_0x5a307c[_0x176b2a(0x1b5)]),_0x583bcd=_0x51eb94[_0x176b2a(0x1d4)]!==_0x5a307c[_0x176b2a(0x1c2)]||!!_0x5a307c['sqlName']&&_0x51eb94[_0x176b2a(0x1be)]!==_0x5a307c[_0x176b2a(0x1be)]||_0x51eb94[_0x176b2a(0x1e8)]!==_0x5a307c['mode'];if(!_0xd007e6[_0x176b2a(0x1d1)](_0x176b2a(0x1e7))&&_0x51eb94[_0x176b2a(0x1ce)]===_0x10f435&&!_0x583bcd){_0x32852b['push']({'sqlCode':_0x5a307c[_0x176b2a(0x1d8)],'reason':_0x176b2a(0x1f1)});continue;}if(_0x51eb94[_0x176b2a(0x1e2)]==null){_0x13ea07['push']({'sqlCode':_0x5a307c[_0x176b2a(0x1d8)],'error':_0x176b2a(0x1b8)});continue;}const _0x369bef=_0x5a307c[_0x176b2a(0x1be)]||_0x51eb94[_0x176b2a(0x1be)],_0x51f257=await resolveTargetDbBinding(_0xd007e6[_0x176b2a(0x1cc)],_0x5a307c,_0x51eb94),_0x142370=await readSqlUploadContent(_0x5a307c),_0x27da56=await updateSqlQuery({'id':_0x51eb94[_0x176b2a(0x1da)],'appCode':_0xd007e6[_0x176b2a(0x1cc)],'sqlCode':_0x5a307c[_0x176b2a(0x1d8)],'sqlName':_0x369bef,'dbId':_0x51f257[_0x176b2a(0x1c9)],'version':_0x51eb94[_0x176b2a(0x1e2)],'sqlContent':_0x142370,'sqlConfig':_0x51eb94['sqlConfig']??undefined}),_0x37f7cf=_0x27da56[_0x176b2a(0x1c9)]?await getDbName(_0xd007e6['appCode'],Number(_0x27da56[_0x176b2a(0x1c9)]))[_0x176b2a(0x1cb)](()=>_0x51f257[_0x176b2a(0x1dc)]):_0x51f257[_0x176b2a(0x1dc)];_0x3cdcff[_0x176b2a(0x1d6)][_0x5a307c[_0x176b2a(0x1d8)]]={...buildSqlLockEntry(_0x27da56,_0x142370,_0x10f435,{'dbName':_0x37f7cf}),'path':_0x5a307c[_0x176b2a(0x1c2)],'mode':_0x5a307c[_0x176b2a(0x1e8)]},_0x45df9f=!![],await archivePreviousSqlFileIfNeeded(_0xd570b8,_0x51eb94[_0x176b2a(0x1d4)],_0x5a307c['relativePath']),_0xcf14a4[_0x176b2a(0x1df)]({'sqlCode':_0x5a307c[_0x176b2a(0x1d8)],'remoteId':_0x51eb94[_0x176b2a(0x1da)]});}catch(_0x4f6203){_0x13ea07[_0x176b2a(0x1df)]({'sqlCode':_0x5a307c[_0x176b2a(0x1d8)],'error':_0x4f6203 instanceof Error?_0x4f6203[_0x176b2a(0x1c8)]:String(_0x4f6203)});}}(_0x45df9f||_0x13ea07[_0x176b2a(0x1e9)]===0x0)&&(_0x3cdcff[_0x176b2a(0x1ec)]=new Date()[_0x176b2a(0x1e1)](),await writeSqlLockFile(_0xd570b8[_0x176b2a(0x1e4)],_0x42ce63));const _0x2ae82d=_0x13ea07[_0x176b2a(0x1e9)]===0x0;return{'ok':_0x2ae82d,'data':{'pushed':_0xcf14a4,'skipped':_0x32852b,'failed':_0x13ea07},'message':'Push\x20complete:\x20'+_0xcf14a4[_0x176b2a(0x1e9)]+_0x176b2a(0x1ae)+_0x32852b[_0x176b2a(0x1e9)]+_0x176b2a(0x1b2)+_0x13ea07['length']+_0x176b2a(0x1b3)};}};async function archivePreviousSqlFileIfNeeded(_0x1b6624,_0x5b4494,_0x4782b2){const _0x20f406=a243_0x4ed571;if(!_0x5b4494||_0x5b4494===_0x4782b2)return;const _0x37f8a5=join(_0x1b6624[_0x20f406(0x1db)],_0x5b4494);if(!await fileExists(_0x37f8a5))return;const _0x242ee6=await moveToTrash(_0x1b6624[_0x20f406(0x1ea)],_0x1b6624['trashDir'],_0x37f8a5);await cleanupEmptyDirectories(dirname(_0x37f8a5),_0x1b6624[_0x20f406(0x1db)]),void _0x242ee6;}async function moveToTrash(_0x3d2da4,_0x27498f,_0x32e7ca){const _0x2c0051=a243_0x4ed571,_0x332940=new Date()[_0x2c0051(0x1e1)]()[_0x2c0051(0x1f2)](/[:.]/g,'-'),_0x4918f9=relative(_0x3d2da4,_0x32e7ca),_0x332741=join(_0x27498f,_0x332940,_0x4918f9);return await mkdir(dirname(_0x332741),{'recursive':!![]}),await rename(_0x32e7ca,_0x332741),_0x332741;}async function cleanupEmptyDirectories(_0x14c627,_0x1d7dba){const _0x1a9d32=a243_0x4ed571;let _0x10db40=resolve(_0x14c627);const _0x1643df=resolve(_0x1d7dba);while(_0x10db40[_0x1a9d32(0x1bb)](''+_0x1643df+sep)||_0x10db40===_0x1643df){if(_0x10db40===_0x1643df)return;try{const _0x346f03=await readdir(_0x10db40);if(_0x346f03[_0x1a9d32(0x1e9)]>0x0)return;await rmdir(_0x10db40);}catch{return;}_0x10db40=dirname(_0x10db40);}}function a243_0x2e8b(){const _0x29d654=['push','map','toISOString','version','filter','lockFilePath','Local\x20directory\x20\x22','/smartapi/custom/updateUserCustomSql','force','mode','length','projectRoot','4983114lmmHZo','lastSync','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','\x20SQL\x20file(s)','validation','No\x20local\x20SQL\x20files\x20found.','unchanged','replace','has','entries','22150zsjpTu','\x20pushed,\x20','exec','sql','2YrnncK','\x20skipped,\x20','\x20failed','str','filePath','356795mFYFrb','sqlcode','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','trim','write','startsWith','POST','Local\x20SQL\x20not\x20found:\x20','sqlName','52zctxHd','sqlRoot','No\x20database\x20matches\x20local\x20directory\x20\x22','relativePath','184rrXdmh','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','198uZIHwU',':\x20SQL\x20content\x20is\x20empty.','message','dbId','5359599SVBDMD','catch','appCode','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','hash','Push\x20local\x20SQL\x20files\x20to\x20remote',':\x20missing\x20remote\x20version;\x20run\x20sql\x20pull\x20first.','bool','29477jXIXYe','join','path','utf8','sqls','get','sqlCode','Would\x20push\x20','remoteId','sqlRootDir','dbName','607741kBaGYD','3040779ynrZaJ'];a243_0x2e8b=function(){return _0x29d654;};return a243_0x2e8b();}async function resolveTargetDbBinding(_0x4636f7,_0x202a91,_0x1bf78e){const _0x22f24d=a243_0x4ed571,_0x47b2c7=_0x202a91['dbDirectory'];if(!_0x47b2c7)return{'dbId':_0x1bf78e[_0x22f24d(0x1c9)],'dbName':_0x1bf78e[_0x22f24d(0x1dc)]};const _0x7a2302=buildDbDirectoryName(_0x1bf78e[_0x22f24d(0x1dc)],_0x1bf78e[_0x22f24d(0x1c9)]);if(_0x47b2c7===_0x7a2302)return{'dbId':_0x1bf78e[_0x22f24d(0x1c9)],'dbName':_0x1bf78e[_0x22f24d(0x1dc)]};const _0x282dcc=parseExplicitDbDirectory(_0x47b2c7);if(_0x282dcc!=null)return{'dbId':_0x282dcc,'dbName':await getDbName(_0x4636f7,_0x282dcc)['catch'](()=>undefined)};const _0x432e0f=await listDatabases(_0x4636f7),_0x5d1910=_0x432e0f[_0x22f24d(0x1e3)](_0x8d4e77=>buildDbDirectoryName(_0x8d4e77[_0x22f24d(0x1dc)],_0x8d4e77[_0x22f24d(0x1c9)])===_0x47b2c7);if(_0x5d1910[_0x22f24d(0x1e9)]===0x1)return{'dbId':_0x5d1910[0x0]['dbId'],'dbName':_0x5d1910[0x0][_0x22f24d(0x1dc)]};if(_0x5d1910[_0x22f24d(0x1e9)]===0x0)throw CliErrors[_0x22f24d(0x1ef)](_0x22f24d(0x1c1)+_0x47b2c7+'\x22\x20for\x20sqlCode\x20'+_0x202a91['sqlCode']+'.');const _0x4449bf=_0x5d1910[_0x22f24d(0x1e0)](_0x380bc4=>_0x380bc4[_0x22f24d(0x1dc)]+'\x20('+_0x380bc4[_0x22f24d(0x1c9)]+')')[_0x22f24d(0x1d3)](',\x20');throw CliErrors['validation'](_0x22f24d(0x1e5)+_0x47b2c7+_0x22f24d(0x1c5)+_0x202a91['sqlCode']+':\x20'+_0x4449bf);}function parseExplicitDbDirectory(_0x4db1f6){const _0x1137d2=a243_0x4ed571,_0x1b1060=/^db-(\d+)$/[_0x1137d2(0x1af)](_0x4db1f6);if(!_0x1b1060)return null;const _0xe90e49=Number(_0x1b1060[0x1]);return Number['isFinite'](_0xe90e49)&&_0xe90e49>0x0?_0xe90e49:null;}