@lovrabet/rabetbase-cli 2.5.8 → 2.5.9-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 (384) hide show
  1. package/README.md +6 -6
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/api-group.js +1 -1
  4. package/lib/api/fetch-model-list.js +1 -1
  5. package/lib/api/generate-api-file.js +1 -1
  6. package/lib/api/generate-sdk-config-file.js +1 -1
  7. package/lib/api/legacy-api-file.js +1 -1
  8. package/lib/api/model-registry-file.js +1 -1
  9. package/lib/api/model-registry-scaffold.js +1 -1
  10. package/lib/api/model-source.js +1 -1
  11. package/lib/auth/auth-server-ui.js +1 -1
  12. package/lib/auth/auth-server.js +1 -1
  13. package/lib/auth/constant.js +1 -1
  14. package/lib/auth/get-cookie.js +1 -1
  15. package/lib/auth/get-session-user.js +1 -1
  16. package/lib/auth/is-session-valid.js +1 -1
  17. package/lib/auth/login-success-html.js +1 -1
  18. package/lib/auth/logout.js +1 -1
  19. package/lib/cli-flags.js +1 -1
  20. package/lib/cli.js +1 -1
  21. package/lib/commands/api/generate.js +1 -1
  22. package/lib/commands/api/index.js +1 -1
  23. package/lib/commands/api/list.js +1 -1
  24. package/lib/commands/api/pull.js +1 -1
  25. package/lib/commands/api/shared.js +1 -1
  26. package/lib/commands/app/detail.js +1 -1
  27. package/lib/commands/app/index.js +1 -1
  28. package/lib/commands/app/list.js +1 -1
  29. package/lib/commands/app/members-list.js +1 -1
  30. package/lib/commands/app/remote-directory.js +1 -1
  31. package/lib/commands/app/shared.js +1 -1
  32. package/lib/commands/app-config/delete.js +1 -1
  33. package/lib/commands/app-config/get.js +1 -1
  34. package/lib/commands/app-config/index.js +1 -1
  35. package/lib/commands/app-config/list.js +1 -1
  36. package/lib/commands/app-config/set.js +1 -1
  37. package/lib/commands/app-config/shared.js +1 -1
  38. package/lib/commands/auth/index.js +1 -1
  39. package/lib/commands/bff/create.js +1 -1
  40. package/lib/commands/bff/delete.js +1 -1
  41. package/lib/commands/bff/detail.js +1 -1
  42. package/lib/commands/bff/index.js +1 -1
  43. package/lib/commands/bff/list.js +1 -1
  44. package/lib/commands/bff/logs.js +1 -1
  45. package/lib/commands/bff/pull.js +1 -1
  46. package/lib/commands/bff/push.js +1 -1
  47. package/lib/commands/bff/status.js +1 -1
  48. package/lib/commands/cli-skill/index.js +1 -1
  49. package/lib/commands/cli-update.js +1 -1
  50. package/lib/commands/codegen/index.js +1 -1
  51. package/lib/commands/codegen/sdk.js +1 -1
  52. package/lib/commands/codegen/sql.js +1 -1
  53. package/lib/commands/common/app-registry.js +1 -1
  54. package/lib/commands/common/app-selector.js +1 -1
  55. package/lib/commands/common/async-task.js +1 -1
  56. package/lib/commands/common/dry-run.js +1 -1
  57. package/lib/commands/common/flags.js +1 -1
  58. package/lib/commands/common/local-file.js +1 -1
  59. package/lib/commands/common/validate.js +1 -1
  60. package/lib/commands/config/delete.js +1 -1
  61. package/lib/commands/config/get.js +1 -1
  62. package/lib/commands/config/index.js +1 -1
  63. package/lib/commands/config/init.js +1 -1
  64. package/lib/commands/config/list.js +1 -1
  65. package/lib/commands/config/set.js +1 -1
  66. package/lib/commands/config/shared.js +1 -1
  67. package/lib/commands/dataset/batch-design.js +1 -1
  68. package/lib/commands/dataset/business-group-update.js +1 -1
  69. package/lib/commands/dataset/business-groups.js +1 -1
  70. package/lib/commands/dataset/capability.js +1 -1
  71. package/lib/commands/dataset/cross-relation-create.js +1 -1
  72. package/lib/commands/dataset/cross-relation-delete.js +1 -1
  73. package/lib/commands/dataset/cross-relation-list.js +1 -1
  74. package/lib/commands/dataset/cross-relation-shared.js +1 -1
  75. package/lib/commands/dataset/cross-relation-update.js +1 -1
  76. package/lib/commands/dataset/delete.js +1 -1
  77. package/lib/commands/dataset/design-context.js +1 -1
  78. package/lib/commands/dataset/design-start.js +1 -1
  79. package/lib/commands/dataset/design-status.js +1 -1
  80. package/lib/commands/dataset/design-sync-retry.js +1 -1
  81. package/lib/commands/dataset/design-sync-status.js +1 -1
  82. package/lib/commands/dataset/design-validate.js +1 -1
  83. package/lib/commands/dataset/detail.js +1 -1
  84. package/lib/commands/dataset/extend-update.js +1 -1
  85. package/lib/commands/dataset/field-restore.js +1 -1
  86. package/lib/commands/dataset/field-update.js +1 -1
  87. package/lib/commands/dataset/generate.js +1 -1
  88. package/lib/commands/dataset/index.js +1 -1
  89. package/lib/commands/dataset/list.js +1 -1
  90. package/lib/commands/dataset/operations.js +1 -1
  91. package/lib/commands/dataset/relation-audit.js +1 -1
  92. package/lib/commands/dataset/relation-create.js +1 -1
  93. package/lib/commands/dataset/relation-delete.js +1 -1
  94. package/lib/commands/dataset/relation-shared.js +1 -1
  95. package/lib/commands/dataset/relation-update.js +1 -1
  96. package/lib/commands/dataset/relations.js +1 -1
  97. package/lib/commands/dataset/rename.js +1 -1
  98. package/lib/commands/dataset/restore.js +1 -1
  99. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  100. package/lib/commands/db/analysis-batching.js +1 -1
  101. package/lib/commands/db/analyze-batch-plan.js +1 -1
  102. package/lib/commands/db/analyze-cancel.js +1 -1
  103. package/lib/commands/db/analyze-start.js +1 -1
  104. package/lib/commands/db/analyze-status.js +1 -1
  105. package/lib/commands/db/create.js +1 -1
  106. package/lib/commands/db/cross-db-analysis-shared.js +1 -1
  107. package/lib/commands/db/cross-db-analyze-latest.js +1 -1
  108. package/lib/commands/db/cross-db-analyze-start.js +1 -1
  109. package/lib/commands/db/cross-db-analyze-status.js +1 -1
  110. package/lib/commands/db/delete.js +1 -1
  111. package/lib/commands/db/detail.js +1 -1
  112. package/lib/commands/db/diff-refresh-start.js +1 -1
  113. package/lib/commands/db/diff-refresh-status.js +1 -1
  114. package/lib/commands/db/diff.js +1 -1
  115. package/lib/commands/db/index.js +1 -1
  116. package/lib/commands/db/list.js +1 -1
  117. package/lib/commands/db/shared.js +1 -1
  118. package/lib/commands/db/table-diff-shared.js +1 -1
  119. package/lib/commands/db/tables.js +1 -1
  120. package/lib/commands/db/test.js +1 -1
  121. package/lib/commands/db/update.js +1 -1
  122. package/lib/commands/deployment/index.js +1 -1
  123. package/lib/commands/deployment/sync-all.js +1 -1
  124. package/lib/commands/deployment/sync-jobs.js +1 -1
  125. package/lib/commands/deployment/sync-status.js +1 -1
  126. package/lib/commands/doctor.js +1 -1
  127. package/lib/commands/file/index.js +1 -1
  128. package/lib/commands/flow/create.js +1 -1
  129. package/lib/commands/flow/detail.js +1 -1
  130. package/lib/commands/flow/index.js +1 -1
  131. package/lib/commands/flow/list.js +1 -1
  132. package/lib/commands/flow/page-list.js +1 -1
  133. package/lib/commands/flow/publish.js +1 -1
  134. package/lib/commands/flow/runtime-resources-shared.js +1 -1
  135. package/lib/commands/flow/runtime-role-list.js +1 -1
  136. package/lib/commands/flow/runtime-role-user-list.js +1 -1
  137. package/lib/commands/flow/runtime-user-search.js +1 -1
  138. package/lib/commands/flow/shared.js +1 -1
  139. package/lib/commands/flow/update.js +1 -1
  140. package/lib/commands/flow/validate.js +1 -1
  141. package/lib/commands/instant-api-policy/current.js +1 -1
  142. package/lib/commands/instant-api-policy/index.js +1 -1
  143. package/lib/commands/instant-api-policy/init.js +1 -1
  144. package/lib/commands/instant-api-policy/publish.js +1 -1
  145. package/lib/commands/instant-api-policy/pull.js +1 -1
  146. package/lib/commands/instant-api-policy/revision.js +1 -1
  147. package/lib/commands/instant-api-policy/revisions.js +1 -1
  148. package/lib/commands/instant-api-policy/rollback.js +1 -1
  149. package/lib/commands/instant-api-policy/shared.js +1 -1
  150. package/lib/commands/instant-api-policy/validate.js +1 -1
  151. package/lib/commands/issue/index.js +1 -1
  152. package/lib/commands/issue/nudge.js +1 -1
  153. package/lib/commands/issue/report.js +1 -1
  154. package/lib/commands/issue/shared.js +1 -1
  155. package/lib/commands/kb/create.js +1 -1
  156. package/lib/commands/kb/delete.js +1 -1
  157. package/lib/commands/kb/detail.js +1 -1
  158. package/lib/commands/kb/index.js +1 -1
  159. package/lib/commands/kb/list.js +1 -1
  160. package/lib/commands/kb/search.js +1 -1
  161. package/lib/commands/kb/shared.d.ts +8 -5
  162. package/lib/commands/kb/shared.js +1 -1
  163. package/lib/commands/kb/update.js +1 -1
  164. package/lib/commands/logs/index.js +1 -1
  165. package/lib/commands/menu/asset-update.js +1 -1
  166. package/lib/commands/menu/delete.js +1 -1
  167. package/lib/commands/menu/external-link-create.js +1 -1
  168. package/lib/commands/menu/external-link-update.js +1 -1
  169. package/lib/commands/menu/group-create.js +1 -1
  170. package/lib/commands/menu/group-update.js +1 -1
  171. package/lib/commands/menu/index.js +1 -1
  172. package/lib/commands/menu/list.js +1 -1
  173. package/lib/commands/menu/move.js +1 -1
  174. package/lib/commands/menu/regroup-start.js +1 -1
  175. package/lib/commands/menu/rename.js +1 -1
  176. package/lib/commands/menu/shared/compare-table.js +1 -1
  177. package/lib/commands/menu/shared/delete-plan.js +1 -1
  178. package/lib/commands/menu/shared/facts.js +1 -1
  179. package/lib/commands/menu/shared/index.js +1 -1
  180. package/lib/commands/menu/shared/inquirer.js +1 -1
  181. package/lib/commands/menu/shared/local-pages.js +1 -1
  182. package/lib/commands/menu/shared/logic.js +1 -1
  183. package/lib/commands/menu/shared/mutations.js +1 -1
  184. package/lib/commands/menu/shared/path.js +1 -1
  185. package/lib/commands/menu/shared/service.js +1 -1
  186. package/lib/commands/menu/shared/subapp-assets.js +1 -1
  187. package/lib/commands/menu/shared/sync-core.js +1 -1
  188. package/lib/commands/menu/shared/update-core.js +1 -1
  189. package/lib/commands/menu/shared/valid-url.js +1 -1
  190. package/lib/commands/menu/subapp-assets-status.js +1 -1
  191. package/lib/commands/menu/subapp-assets-update.js +1 -1
  192. package/lib/commands/menu/sync.js +1 -1
  193. package/lib/commands/menu/visibility-update.js +1 -1
  194. package/lib/commands/notification/config-create.js +1 -1
  195. package/lib/commands/notification/config-delete.js +1 -1
  196. package/lib/commands/notification/config-list.js +1 -1
  197. package/lib/commands/notification/config-update.js +1 -1
  198. package/lib/commands/notification/index.js +1 -1
  199. package/lib/commands/notification/shared.js +1 -1
  200. package/lib/commands/ocr/index.js +1 -1
  201. package/lib/commands/page/create.js +1 -1
  202. package/lib/commands/page/custom/detail.js +1 -1
  203. package/lib/commands/page/custom/list.js +1 -1
  204. package/lib/commands/page/custom/publish.js +1 -1
  205. package/lib/commands/page/custom/shared.js +1 -1
  206. package/lib/commands/page/custom/syntax.js +1 -1
  207. package/lib/commands/page/custom/update.js +1 -1
  208. package/lib/commands/page/data-list-status.js +1 -1
  209. package/lib/commands/page/generate-start.js +1 -1
  210. package/lib/commands/page/generate-status.js +1 -1
  211. package/lib/commands/page/index.js +1 -1
  212. package/lib/commands/page/pull.js +1 -1
  213. package/lib/commands/page/push.js +1 -1
  214. package/lib/commands/page/relation-audit.js +1 -1
  215. package/lib/commands/page/restore.js +1 -1
  216. package/lib/commands/page/shared.js +1 -1
  217. package/lib/commands/page/sync.js +1 -1
  218. package/lib/commands/project/api-architecture-upgrade.js +1 -1
  219. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  220. package/lib/commands/project/create/format-elapsed.js +1 -1
  221. package/lib/commands/project/create/main.js +1 -1
  222. package/lib/commands/project/create/materialize-project-template.js +1 -1
  223. package/lib/commands/project/create/project-name.js +1 -1
  224. package/lib/commands/project/create/project-template-archive.js +1 -1
  225. package/lib/commands/project/create/project-template-path.js +1 -1
  226. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  227. package/lib/commands/project/create/use-format-code.js +1 -1
  228. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  229. package/lib/commands/project/domain-routing-sync.js +1 -1
  230. package/lib/commands/project/index.js +1 -1
  231. package/lib/commands/project/upgrade.js +1 -1
  232. package/lib/commands/registry.js +1 -1
  233. package/lib/commands/role/delete.js +1 -1
  234. package/lib/commands/role/detail.js +1 -1
  235. package/lib/commands/role/index.js +1 -1
  236. package/lib/commands/role/list.js +1 -1
  237. package/lib/commands/role/shared.js +1 -1
  238. package/lib/commands/role/update.js +1 -1
  239. package/lib/commands/role/user-add.js +1 -1
  240. package/lib/commands/role/user-remove.js +1 -1
  241. package/lib/commands/role/user-resolve.js +1 -1
  242. package/lib/commands/rule/get.js +1 -1
  243. package/lib/commands/rule/index.js +1 -1
  244. package/lib/commands/rule/list.js +1 -1
  245. package/lib/commands/rule/set.js +1 -1
  246. package/lib/commands/rule/shared.d.ts +5 -3
  247. package/lib/commands/rule/shared.js +1 -1
  248. package/lib/commands/run/index.js +1 -1
  249. package/lib/commands/schema.js +1 -1
  250. package/lib/commands/sql/create.js +1 -1
  251. package/lib/commands/sql/delete.js +1 -1
  252. package/lib/commands/sql/detail.js +1 -1
  253. package/lib/commands/sql/exec.js +1 -1
  254. package/lib/commands/sql/index.js +1 -1
  255. package/lib/commands/sql/list.js +1 -1
  256. package/lib/commands/sql/pull.js +1 -1
  257. package/lib/commands/sql/push.js +1 -1
  258. package/lib/commands/sql/shared.js +1 -1
  259. package/lib/commands/sql/status.js +1 -1
  260. package/lib/commands/sql/validate.js +1 -1
  261. package/lib/commands/task/index.js +1 -1
  262. package/lib/commands/task/status.js +1 -1
  263. package/lib/commands/tenant/index.js +1 -1
  264. package/lib/commands/tenant/members-list.js +1 -1
  265. package/lib/commands/tenant/shared.js +1 -1
  266. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  267. package/lib/commands/user-account/feishu-bind.js +1 -1
  268. package/lib/commands/user-account/index.js +1 -1
  269. package/lib/commands/workspace/add.js +1 -1
  270. package/lib/commands/workspace/index.js +1 -1
  271. package/lib/commands/workspace/remove.js +1 -1
  272. package/lib/config/domain-config.js +1 -1
  273. package/lib/config/project-domain-routing.js +1 -1
  274. package/lib/config/region-config.js +1 -1
  275. package/lib/config/schema.js +1 -1
  276. package/lib/constant/cdn.js +1 -1
  277. package/lib/constant/cli.js +1 -1
  278. package/lib/constant/defaults.js +1 -1
  279. package/lib/constant/domain.js +1 -1
  280. package/lib/constant/env.js +1 -1
  281. package/lib/constant/output.js +1 -1
  282. package/lib/constant/paths.js +1 -1
  283. package/lib/constant/region.js +1 -1
  284. package/lib/constant/risk.js +1 -1
  285. package/lib/constant/routing-profile.js +1 -1
  286. package/lib/context/app-resolver.js +1 -1
  287. package/lib/context/auth-resolver.js +1 -1
  288. package/lib/context/config-loader.js +1 -1
  289. package/lib/context.js +1 -1
  290. package/lib/core/alias-resolver.js +1 -1
  291. package/lib/core/api-client.d.ts +14 -11
  292. package/lib/core/api-client.js +1 -1
  293. package/lib/core/bff/config.js +1 -1
  294. package/lib/core/bff/file-system.js +1 -1
  295. package/lib/core/bff/hash.js +1 -1
  296. package/lib/core/bff/hook-directory.js +1 -1
  297. package/lib/core/bff/lock.js +1 -1
  298. package/lib/core/bff/utils.js +1 -1
  299. package/lib/core/cross-db-analysis.js +1 -1
  300. package/lib/core/cross-db-relation.js +1 -1
  301. package/lib/core/db-resolver.js +1 -1
  302. package/lib/core/flow-config.js +1 -1
  303. package/lib/core/instant-api-policy/config.js +1 -1
  304. package/lib/core/kb-management-client.d.ts +2 -2
  305. package/lib/core/kb-management-client.js +1 -1
  306. package/lib/core/kb-search-client.d.ts +3 -1
  307. package/lib/core/kb-search-client.js +1 -1
  308. package/lib/core/page/file-system.js +1 -1
  309. package/lib/core/page/hash.js +1 -1
  310. package/lib/core/page/lock.js +1 -1
  311. package/lib/core/page/lr-smart-jsx.js +1 -1
  312. package/lib/core/sql-index-auditor.js +1 -1
  313. package/lib/core/sql-sync/config.js +1 -1
  314. package/lib/core/sql-sync/file-system.js +1 -1
  315. package/lib/core/sql-sync/hash.js +1 -1
  316. package/lib/core/sql-sync/lock.js +1 -1
  317. package/lib/core/sql-sync/utils.js +1 -1
  318. package/lib/core/sql-validator.js +1 -1
  319. package/lib/errors.js +1 -1
  320. package/lib/framework/build-all-flags.js +1 -1
  321. package/lib/framework/error-output.js +1 -1
  322. package/lib/framework/explicit-yes.js +1 -1
  323. package/lib/framework/flags.js +1 -1
  324. package/lib/framework/help.js +1 -1
  325. package/lib/framework/index.js +1 -1
  326. package/lib/framework/output.js +1 -1
  327. package/lib/framework/response.js +1 -1
  328. package/lib/framework/runner-alias.js +1 -1
  329. package/lib/framework/runner.js +1 -1
  330. package/lib/framework/schema-export.js +1 -1
  331. package/lib/framework/supported-flags.js +1 -1
  332. package/lib/framework/types.js +1 -1
  333. package/lib/generated/build-info.d.ts +4 -4
  334. package/lib/generated/build-info.js +1 -1
  335. package/lib/generated/official-routing.js +1 -1
  336. package/lib/generated/routing-contract.js +1 -1
  337. package/lib/help.js +1 -1
  338. package/lib/postinstall.js +1 -1
  339. package/lib/runtime/confirmation.js +1 -1
  340. package/lib/runtime/event.js +1 -1
  341. package/lib/runtime/index.js +1 -1
  342. package/lib/runtime/queue.js +1 -1
  343. package/lib/runtime/resolve.js +1 -1
  344. package/lib/services/dataset-design/checkpoint.js +1 -1
  345. package/lib/services/dataset-design/commands.js +1 -1
  346. package/lib/services/dataset-design/contract.js +1 -1
  347. package/lib/skills/builtin-skill.js +1 -1
  348. package/lib/skills/main.js +1 -1
  349. package/lib/skills/npx-skills-add.js +1 -1
  350. package/lib/skills/skill-presence.js +1 -1
  351. package/lib/telemetry/cli-command-trace.js +1 -1
  352. package/lib/telemetry/cli-help-trace.js +1 -1
  353. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  354. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  355. package/lib/telemetry/send-cli-trace-log.js +1 -1
  356. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  357. package/lib/utils/ai_config.js +1 -1
  358. package/lib/utils/apply-jq-filter.js +1 -1
  359. package/lib/utils/cdn-config.js +1 -1
  360. package/lib/utils/check-sdk-version.js +1 -1
  361. package/lib/utils/cli-version-check.js +1 -1
  362. package/lib/utils/cli-version-policy.js +1 -1
  363. package/lib/utils/config.js +1 -1
  364. package/lib/utils/entity-with-id.js +1 -1
  365. package/lib/utils/file-utils.js +1 -1
  366. package/lib/utils/guides-cdn.js +1 -1
  367. package/lib/utils/http-client.js +1 -1
  368. package/lib/utils/is-non-interactive.js +1 -1
  369. package/lib/utils/logger.js +1 -1
  370. package/lib/utils/params.js +1 -1
  371. package/lib/utils/platform.js +1 -1
  372. package/lib/utils/sleep.js +1 -1
  373. package/lib/utils/template-replacer.js +1 -1
  374. package/lib/utils/update-notice.js +1 -1
  375. package/lib/utils/version.js +1 -1
  376. package/lib/utils/with-active-cookie.js +1 -1
  377. package/lib/utils/write-cli-side-channel.js +1 -1
  378. package/package.json +1 -1
  379. package/skills/rabetbase/SKILL.md +1 -1
  380. package/skills/rabetbase/references/rabetbase-kb.md +17 -15
  381. package/skills/rabetbase/references/rabetbase-rule.md +8 -6
  382. package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
  383. package/skills/rabetbase-page-generation/SKILL.md +1 -1
  384. package/skills/rabetbase.manifest.json +3 -3
@@ -1 +1 @@
1
- const a244_0x5a0a74=a244_0x3f4e;(function(_0x1787ea,_0x49fb30){const _0x26f2ad=a244_0x3f4e,_0x10d406=_0x1787ea();while(!![]){try{const _0x902f4b=-parseInt(_0x26f2ad(0xb4))/0x1*(-parseInt(_0x26f2ad(0xaa))/0x2)+parseInt(_0x26f2ad(0xac))/0x3+parseInt(_0x26f2ad(0xca))/0x4*(-parseInt(_0x26f2ad(0xc7))/0x5)+-parseInt(_0x26f2ad(0xa3))/0x6*(-parseInt(_0x26f2ad(0xa7))/0x7)+parseInt(_0x26f2ad(0xa5))/0x8*(parseInt(_0x26f2ad(0xa6))/0x9)+-parseInt(_0x26f2ad(0xaf))/0xa*(-parseInt(_0x26f2ad(0x9e))/0xb)+-parseInt(_0x26f2ad(0xab))/0xc;if(_0x902f4b===_0x49fb30)break;else _0x10d406['push'](_0x10d406['shift']());}catch(_0x1bf622){_0x10d406['push'](_0x10d406['shift']());}}}(a244_0x5edf,0xaf73e));import{createHash}from'node:crypto';import{readFile,stat}from'node:fs/promises';import{resolve}from'node:path';function a244_0x5edf(){const _0x26d2fe=['Cannot\x20access\x20app\x20rule\x20file:\x20','4268uDEhzQ','trim','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','app_rule_content_too_large','app_rule_file_unreadable','page-api-development','1195106rzhSda','digest','--type\x20must\x20be\x20either\x20rules\x20or\x20database.','type','isFile','12hEoadF','contentHash','6909536kvsrid','9jcXwRu','1311933QFqRDd','updateTime','sha256:','2338jIJGgm','20044920dHIWhD','4134744qlkVQn','toLowerCase','string','50NTMulY','byteSize','scope','Cannot\x20read\x20app\x20rule\x20file:\x20','App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','371fkLpfD','version','database','App\x20rule\x20file\x20is\x20blank:\x20','utf-8','update','DATABASE.md','database-analysis','Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','createTime','size','RULES.md','content','rules','--file\x20is\x20required.','sha256','byteLength','Pass\x20a\x20UTF-8\x20Markdown\x20file.','utf8','5645tMotGq','decode'];a244_0x5edf=function(){return _0x26d2fe;};return a244_0x5edf();}import{TextDecoder}from'node:util';import{CliError}from'../../errors.js';export const APP_RULE_TYPES=[a244_0x5a0a74(0xc1),a244_0x5a0a74(0xb6)];export const MAX_APP_RULE_BYTES=0x5*0x400*0x400;const APP_RULE_FILES={'rules':a244_0x5a0a74(0xbf),'database':a244_0x5a0a74(0xba)},APP_RULE_CONTEXT_SCOPES={'rules':a244_0x5a0a74(0x9d),'database':a244_0x5a0a74(0xbb)};function a244_0x3f4e(_0x31bd2d,_0x13cf24){_0x31bd2d=_0x31bd2d-0x9a;const _0x5edf79=a244_0x5edf();let _0x3f4e49=_0x5edf79[_0x31bd2d];return _0x3f4e49;}export function appRuleError(_0x361468,_0x4a080b,_0x5a4a25){return new CliError(_0x361468,0x1,_0x4a080b,_0x5a4a25);}export function readAppRuleType(_0x5cf872){const _0x44d241=a244_0x5a0a74,_0x570e7f=_0x5cf872['str']('type')[_0x44d241(0xcb)]()[_0x44d241(0xad)]();if(_0x570e7f!==_0x44d241(0xc1)&&_0x570e7f!==_0x44d241(0xb6))throw appRuleError('app_rule_type_invalid',_0x44d241(0xa0));return _0x570e7f;}export function appRuleFileName(_0xfe0b7d){return APP_RULE_FILES[_0xfe0b7d];}export function appRuleContextScope(_0x32a997){return APP_RULE_CONTEXT_SCOPES[_0x32a997];}export function inspectAppRuleContent(_0x574383){const _0x33fb3c=a244_0x5a0a74,_0x4b6e9a=Buffer['from'](_0x574383,_0x33fb3c(0xc6));return{'content':_0x574383,'byteSize':_0x4b6e9a['byteLength'],'contentHash':_0x33fb3c(0xa9)+createHash(_0x33fb3c(0xc3))[_0x33fb3c(0xb9)](_0x4b6e9a)[_0x33fb3c(0x9f)]('hex')};}export async function readAppRuleFile(_0x3a7ba){const _0x130bfe=a244_0x5a0a74,_0x5b7691=_0x3a7ba[_0x130bfe(0xcb)]();if(!_0x5b7691)throw appRuleError('app_rule_file_required',_0x130bfe(0xc2),_0x130bfe(0xc5));const _0x4a7392=resolve(_0x5b7691);let _0x5cd8ad;try{_0x5cd8ad=await stat(_0x4a7392);}catch(_0x540c7c){throw appRuleError(_0x130bfe(0x9c),_0x130bfe(0xc9)+_0x5b7691,_0x540c7c instanceof Error?_0x540c7c['message']:String(_0x540c7c));}if(!_0x5cd8ad[_0x130bfe(0xa2)]())throw appRuleError('app_rule_file_invalid',_0x130bfe(0x9a)+_0x5b7691);if(_0x5cd8ad[_0x130bfe(0xbe)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x130bfe(0x9b),'App\x20rule\x20content\x20exceeds\x20the\x205\x20MiB\x20server\x20limit.');let _0x4a506b;try{_0x4a506b=await readFile(_0x4a7392);}catch(_0x344af1){throw appRuleError('app_rule_file_unreadable',_0x130bfe(0xb2)+_0x5b7691,_0x344af1 instanceof Error?_0x344af1['message']:String(_0x344af1));}if(_0x4a506b[_0x130bfe(0xc4)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x130bfe(0x9b),'App\x20rule\x20content\x20exceeds\x20the\x205\x20MiB\x20server\x20limit.');let _0x100f8c;try{_0x100f8c=new TextDecoder(_0x130bfe(0xb8),{'fatal':!![],'ignoreBOM':!![]})[_0x130bfe(0xc8)](_0x4a506b);}catch{throw appRuleError('app_rule_content_invalid',_0x130bfe(0xb3)+_0x5b7691);}if(!_0x100f8c[_0x130bfe(0xcb)]())throw appRuleError('app_rule_content_invalid',_0x130bfe(0xb7)+_0x5b7691);return inspectAppRuleContent(_0x100f8c);}export function projectAppRule(_0x54b579,_0x275d85){const _0x2a7ff0=a244_0x5a0a74;if(!_0x275d85)return{'type':_0x54b579,'fileName':appRuleFileName(_0x54b579),'contextScope':appRuleContextScope(_0x54b579),'enabled':![]};const _0x5e17a5=inspectAppRuleContent(_0x275d85[_0x2a7ff0(0xc0)]);return{'type':_0x54b579,'fileName':appRuleFileName(_0x54b579),'contextScope':appRuleContextScope(_0x54b579),'enabled':!![],'id':_0x275d85['id'],'scope':_0x275d85[_0x2a7ff0(0xb1)],'appCode':_0x275d85['appCode'],'version':_0x275d85[_0x2a7ff0(0xb5)],'contentByteSize':_0x5e17a5[_0x2a7ff0(0xb0)],'contentHash':_0x5e17a5[_0x2a7ff0(0xa4)],..._0x275d85[_0x2a7ff0(0xbd)]!==undefined&&_0x275d85[_0x2a7ff0(0xbd)]!==null?{'createTime':_0x275d85['createTime']}:{},..._0x275d85[_0x2a7ff0(0xa8)]!==undefined&&_0x275d85['updateTime']!==null?{'updateTime':_0x275d85[_0x2a7ff0(0xa8)]}:{}};}export const APP_RULE_TYPE_FLAG={'name':a244_0x5a0a74(0xa1),'type':a244_0x5a0a74(0xae),'required':!![],'description':a244_0x5a0a74(0xbc),'enum':[...APP_RULE_TYPES]};
1
+ const a244_0x458a9c=a244_0x3260;(function(_0x56379f,_0x5cbaf8){const _0xeb3561=a244_0x3260,_0x4b9b8a=_0x56379f();while(!![]){try{const _0x263dae=-parseInt(_0xeb3561(0x167))/0x1+-parseInt(_0xeb3561(0x189))/0x2+parseInt(_0xeb3561(0x172))/0x3*(parseInt(_0xeb3561(0x16b))/0x4)+parseInt(_0xeb3561(0x170))/0x5+-parseInt(_0xeb3561(0x171))/0x6+parseInt(_0xeb3561(0x17f))/0x7*(-parseInt(_0xeb3561(0x187))/0x8)+-parseInt(_0xeb3561(0x176))/0x9*(-parseInt(_0xeb3561(0x191))/0xa);if(_0x263dae===_0x5cbaf8)break;else _0x4b9b8a['push'](_0x4b9b8a['shift']());}catch(_0x2a503b){_0x4b9b8a['push'](_0x4b9b8a['shift']());}}}(a244_0x26ab,0x8ab64));import{createHash}from'node:crypto';import{readFile,stat}from'node:fs/promises';import{resolve}from'node:path';import{TextDecoder}from'node:util';function a244_0x3260(_0x1f3db7,_0x49c50d){_0x1f3db7=_0x1f3db7-0x163;const _0x26abc3=a244_0x26ab();let _0x32601f=_0x26abc3[_0x1f3db7];return _0x32601f;}import{CliError}from'../../errors.js';export const APP_RULE_TYPES=[a244_0x458a9c(0x168),'database'];export const MAX_APP_RULE_UNITS=0x5*0x400*0x400;function a244_0x26ab(){const _0x742901=['from','RULES.md','size','19620963upNlKD','updateTime','createTime','app_rule_file_invalid','hex','isFile','utf8','DATABASE.md','database-analysis','7rGkFnc','toLowerCase','Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','sha256','app_rule_content_invalid','byteSize','message','appCode','2066992tcWdaf','app_rule_type_invalid','1249580EOzYaR','digest','version','trim','app_rule_content_too_large','--type\x20must\x20be\x20either\x20rules\x20or\x20database.','scope','--file\x20is\x20required.','10xkwyxp','string','App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','app_rule_file_required','App\x20rule\x20content\x20exceeds\x20the\x20bounded\x20UTF-8\x20file\x20limit.','content','str','contentHash','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','length','indexStatus','App\x20rule\x20content\x20exceeds\x205242880\x20UTF-16\x20units.','418498PAjAWc','rules','app_rule_file_unreadable','update','1060ocBTXw','Pass\x20a\x20UTF-8\x20Markdown\x20file.','Cannot\x20access\x20app\x20rule\x20file:\x20','App\x20rule\x20file\x20is\x20blank:\x20','type','3429050EDzDMa','5978136OwEjgt','3rLQmyH'];a244_0x26ab=function(){return _0x742901;};return a244_0x26ab();}export const MAX_APP_RULE_BYTES=MAX_APP_RULE_UNITS*0x4;const APP_RULE_FILES={'rules':a244_0x458a9c(0x174),'database':a244_0x458a9c(0x17d)},APP_RULE_CONTEXT_SCOPES={'rules':'page-api-development','database':a244_0x458a9c(0x17e)};export function appRuleError(_0x15aa79,_0x2eb96c,_0x43d578){return new CliError(_0x15aa79,0x1,_0x2eb96c,_0x43d578);}export function readAppRuleType(_0x19edd3){const _0x46d605=a244_0x458a9c,_0x425973=_0x19edd3[_0x46d605(0x197)](_0x46d605(0x16f))[_0x46d605(0x18c)]()[_0x46d605(0x180)]();if(_0x425973!==_0x46d605(0x168)&&_0x425973!=='database')throw appRuleError(_0x46d605(0x188),_0x46d605(0x18e));return _0x425973;}export function appRuleFileName(_0x1f4a1b){return APP_RULE_FILES[_0x1f4a1b];}export function appRuleContextScope(_0x85b3c){return APP_RULE_CONTEXT_SCOPES[_0x85b3c];}export function inspectAppRuleContent(_0x507bcc){const _0x49b6e3=a244_0x458a9c,_0x23e2c4=Buffer[_0x49b6e3(0x173)](_0x507bcc,_0x49b6e3(0x17c));return{'content':_0x507bcc,'byteSize':_0x23e2c4['byteLength'],'contentHash':'sha256:'+createHash(_0x49b6e3(0x182))[_0x49b6e3(0x16a)](_0x23e2c4)[_0x49b6e3(0x18a)](_0x49b6e3(0x17a))};}export async function readAppRuleFile(_0x9c83b7){const _0x49b93f=a244_0x458a9c,_0x109b45=_0x9c83b7[_0x49b93f(0x18c)]();if(!_0x109b45)throw appRuleError(_0x49b93f(0x194),_0x49b93f(0x190),_0x49b93f(0x16c));const _0x4a6196=resolve(_0x109b45);let _0x81486d;try{_0x81486d=await stat(_0x4a6196);}catch(_0xe0950f){throw appRuleError(_0x49b93f(0x169),_0x49b93f(0x16d)+_0x109b45,_0xe0950f instanceof Error?_0xe0950f[_0x49b93f(0x185)]:String(_0xe0950f));}if(!_0x81486d[_0x49b93f(0x17b)]())throw appRuleError(_0x49b93f(0x179),_0x49b93f(0x163)+_0x109b45);if(_0x81486d[_0x49b93f(0x175)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x49b93f(0x18d),_0x49b93f(0x195));let _0x24fcdb;try{_0x24fcdb=await readFile(_0x4a6196);}catch(_0x418af6){throw appRuleError(_0x49b93f(0x169),'Cannot\x20read\x20app\x20rule\x20file:\x20'+_0x109b45,_0x418af6 instanceof Error?_0x418af6[_0x49b93f(0x185)]:String(_0x418af6));}if(_0x24fcdb['byteLength']>MAX_APP_RULE_BYTES)throw appRuleError('app_rule_content_too_large',_0x49b93f(0x195));let _0x4a42cd;try{_0x4a42cd=new TextDecoder('utf-8',{'fatal':!![],'ignoreBOM':!![]})['decode'](_0x24fcdb);}catch{throw appRuleError(_0x49b93f(0x183),_0x49b93f(0x193)+_0x109b45);}if(_0x4a42cd[_0x49b93f(0x164)]>MAX_APP_RULE_UNITS)throw appRuleError('app_rule_content_too_large',_0x49b93f(0x166));if(!_0x4a42cd[_0x49b93f(0x18c)]())throw appRuleError(_0x49b93f(0x183),_0x49b93f(0x16e)+_0x109b45);return inspectAppRuleContent(_0x4a42cd);}export function projectAppRule(_0x16b42b,_0x54e61d){const _0x5b3ed3=a244_0x458a9c;if(!_0x54e61d)return{'type':_0x16b42b,'fileName':appRuleFileName(_0x16b42b),'contextScope':appRuleContextScope(_0x16b42b),'enabled':![]};const _0x38b456=inspectAppRuleContent(_0x54e61d[_0x5b3ed3(0x196)]);return{'type':_0x16b42b,'fileName':appRuleFileName(_0x16b42b),'contextScope':appRuleContextScope(_0x16b42b),'enabled':!![],'id':_0x54e61d['id'],'scope':_0x54e61d[_0x5b3ed3(0x18f)],'appCode':_0x54e61d[_0x5b3ed3(0x186)],'version':_0x54e61d[_0x5b3ed3(0x18b)],..._0x54e61d[_0x5b3ed3(0x165)]!==undefined?{'indexStatus':_0x54e61d[_0x5b3ed3(0x165)]}:{},'contentByteSize':_0x38b456[_0x5b3ed3(0x184)],'contentHash':_0x38b456[_0x5b3ed3(0x198)],..._0x54e61d[_0x5b3ed3(0x178)]!==undefined&&_0x54e61d[_0x5b3ed3(0x178)]!==null?{'createTime':_0x54e61d[_0x5b3ed3(0x178)]}:{},..._0x54e61d[_0x5b3ed3(0x177)]!==undefined&&_0x54e61d[_0x5b3ed3(0x177)]!==null?{'updateTime':_0x54e61d[_0x5b3ed3(0x177)]}:{}};}export const APP_RULE_TYPE_FLAG={'name':a244_0x458a9c(0x16f),'type':a244_0x458a9c(0x192),'required':!![],'description':a244_0x458a9c(0x181),'enum':[...APP_RULE_TYPES]};
@@ -1 +1 @@
1
- const a245_0xf841e8=a245_0x5000;(function(_0x32ec9e,_0x3a7ec4){const _0x59a742=a245_0x5000,_0x865815=_0x32ec9e();while(!![]){try{const _0x5a10d4=-parseInt(_0x59a742(0xae))/0x1*(-parseInt(_0x59a742(0xc9))/0x2)+-parseInt(_0x59a742(0xb6))/0x3+parseInt(_0x59a742(0xc1))/0x4+parseInt(_0x59a742(0x94))/0x5*(-parseInt(_0x59a742(0xba))/0x6)+-parseInt(_0x59a742(0x9b))/0x7+-parseInt(_0x59a742(0x95))/0x8*(parseInt(_0x59a742(0xc7))/0x9)+-parseInt(_0x59a742(0xa5))/0xa*(-parseInt(_0x59a742(0xa1))/0xb);if(_0x5a10d4===_0x3a7ec4)break;else _0x865815['push'](_0x865815['shift']());}catch(_0x555c49){_0x865815['push'](_0x865815['shift']());}}}(a245_0x28f3,0x4c75f));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{findProjectRootDirectory,resolveConfigPath}from'../../context/config-loader.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';function a245_0x28f3(){const _0x393dfb=['Enable\x20watch\x20mode\x20for\x20preview','scripts','has','Script\x20\x22','bun.lock','\x20\x20\x20\x20','args','changed','1gSyfMj','dev','No\x20package.json\x20found\x20in\x20current\x20directory.','close','start','log','all','\x20run\x20','701889WsTClC','yarn.lock','No\x20scripts\x20defined\x20in\x20package.json.','slice','2238iBowpf','build','package.json','\x22\x20not\x20found\x20in\x20package.json.','--watch','bun.lockb','preview','470836keOjEe','\x20run\x20preview\x20--watch','\x0a\x20\x20Usage:\x20','validation','keys','\x20run\x20start','168633eOCnzW','write','910492nIaLdb','\x20run\x20<script>\x0a','\x20run\x20preview','parse','needsUpgrade','vite','inherit','\x20exited\x20with\x20code\x20','yarn','join','Run\x20a\x20package.json\x20script','1605UkYELq','24kzoLVv','vite\x20preview\x20exited\x20with\x20code\x20','Available:\x20','(none)','run','pnpm-lock.yaml','1774395gLqOTT','pnpm','path','error','bool','Script\x20name\x20defined\x20in\x20package.json','385HjCsBt','push','node_modules','cwd','115320pWGnjM'];a245_0x28f3=function(){return _0x393dfb;};return a245_0x28f3();}import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a245_0xf841e8(0xb2),a245_0xf841e8(0xaf)]),DOMAIN_ROUTING_SYNC_SCRIPTS=new Set(['start','dev',a245_0xf841e8(0xbb),a245_0xf841e8(0xc0)]);export function syncProjectDomainRoutingBeforeScript(_0x37df4e,_0x381cd0){const _0x429329=a245_0xf841e8;if(!DOMAIN_ROUTING_SYNC_SCRIPTS[_0x429329(0xa8)](_0x381cd0))return null;const _0x4d0ff0=findProjectRootDirectory(_0x37df4e);if(!resolveConfigPath(_0x4d0ff0))return null;const _0x188de4=writeProjectDomainRoutingManifest(_0x4d0ff0);return{'path':_0x188de4[_0x429329(0x9d)],'changed':_0x188de4['changed']};}function readPackageScripts(_0x4046b9){const _0x445ec1=a245_0xf841e8,_0x59aac5=resolve(_0x4046b9,_0x445ec1(0xbc));if(!existsSync(_0x59aac5))return null;try{const _0x339cb1=JSON[_0x445ec1(0x8c)](readFileSync(_0x59aac5,'utf-8'));return _0x339cb1[_0x445ec1(0xa7)]??{};}catch{return null;}}function detectPackageManager(_0x58ae5a){const _0x37c81e=a245_0xf841e8;if(existsSync(resolve(_0x58ae5a,_0x37c81e(0xbf)))||existsSync(resolve(_0x58ae5a,_0x37c81e(0xaa))))return'bun';if(existsSync(resolve(_0x58ae5a,_0x37c81e(0x9a))))return _0x37c81e(0x9c);if(existsSync(resolve(_0x58ae5a,_0x37c81e(0xb7))))return _0x37c81e(0x91);return'npm';}async function versionCheck(_0x12f4a0){const _0x49807f=a245_0xf841e8,_0x21a445=await checkCliVersion();(_0x21a445[_0x49807f(0x8d)]||_0x21a445['belowMinimum'])&&(printCliUpgradeWarning(_0x21a445),assertCliVersionSupported(_0x21a445));const _0x1fc6fa=await checkSdkVersion(_0x12f4a0);if(_0x1fc6fa[_0x49807f(0x8d)])printSdkUpgradeWarning(_0x1fc6fa);}function a245_0x5000(_0x41e05f,_0x10f5e5){_0x41e05f=_0x41e05f-0x8c;const _0x28f39d=a245_0x28f3();let _0x500069=_0x28f39d[_0x41e05f];return _0x500069;}function spawnScript(_0x4d708d,_0xb02ea9,_0x25dfc7,_0x43fe7d){return new Promise((_0x2178f7,_0x2a17d1)=>{const _0x3e8e54=a245_0x5000,_0x19cef9=[_0x3e8e54(0x99),_0xb02ea9,..._0x25dfc7],_0x36c345=spawn(_0x4d708d,_0x19cef9,{'cwd':_0x43fe7d,'stdio':_0x3e8e54(0x8f),'shell':!![],'env':{...process.env,'PATH':''+join(_0x43fe7d,_0x3e8e54(0xa3),'.bin')+delimiter+process.env.PATH}});_0x36c345['on'](_0x3e8e54(0xb1),_0x1721c6=>{const _0x58cc5b=_0x3e8e54;if(_0x1721c6===0x0||_0x1721c6===null)_0x2178f7();else _0x2a17d1(new Error(_0x4d708d+_0x58cc5b(0xb5)+_0xb02ea9+_0x58cc5b(0x90)+_0x1721c6));}),_0x36c345['on'](_0x3e8e54(0x9e),_0x2a17d1);});}function spawnViteBuildWatch(_0x3c186f){return new Promise((_0x299d88,_0x4a7f91)=>{const _0x4a81bf=a245_0x5000,_0x1dfb44=spawn(_0x4a81bf(0x8e),[_0x4a81bf(0xbb),_0x4a81bf(0xbe)],{'cwd':_0x3c186f,'stdio':_0x4a81bf(0x8f),'shell':!![],'env':{...process.env,'PATH':''+join(_0x3c186f,_0x4a81bf(0xa3),'.bin')+delimiter+process.env.PATH}});_0x1dfb44['on']('close',_0x3e5963=>{if(_0x3e5963===0x0||_0x3e5963===null)_0x299d88();else _0x4a7f91(new Error('vite\x20build\x20--watch\x20exited\x20with\x20code\x20'+_0x3e5963));}),_0x1dfb44['on'](_0x4a81bf(0x9e),_0x4a7f91);});}function spawnVitePreview(_0x117a40){return new Promise((_0x33f0bb,_0xb11f86)=>{const _0x50bb04=a245_0x5000,_0x26fc42=spawn('vite',[_0x50bb04(0xc0)],{'cwd':_0x117a40,'stdio':_0x50bb04(0x8f),'shell':!![],'env':{...process.env,'PATH':''+join(_0x117a40,'node_modules','.bin')+delimiter+process.env.PATH}});_0x26fc42['on']('close',_0x33c5c8=>{const _0x54e387=_0x50bb04;if(_0x33c5c8===0x0||_0x33c5c8===null)_0x33f0bb();else _0xb11f86(new Error(_0x54e387(0x96)+_0x33c5c8));}),_0x26fc42['on'](_0x50bb04(0x9e),_0xb11f86);});}const runFlags=[{'name':'watch','type':'boolean','description':a245_0xf841e8(0xa6),'default':![]}];export const runDefinition={'service':a245_0xf841e8(0x99),'command':a245_0xf841e8(0x99),'description':a245_0xf841e8(0x93),'risk':a245_0xf841e8(0xc8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'script','description':a245_0xf841e8(0xa0),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x48a98d=a245_0xf841e8,_0x350e2d=[];return _0x350e2d['push']('\x20\x20EXAMPLES'),_0x350e2d[_0x48a98d(0xa2)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x48a98d(0xc6)),_0x350e2d['push'](_0x48a98d(0xab)+CLI_BIN_NAME+'\x20run\x20build'),_0x350e2d['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x48a98d(0xcb)),_0x350e2d[_0x48a98d(0xa2)](_0x48a98d(0xab)+CLI_BIN_NAME+_0x48a98d(0xc2)),_0x350e2d[_0x48a98d(0x92)]('\x0a');},async 'execute'(_0x226f61){const _0x434a0f=a245_0xf841e8,_0x5f34f1=process[_0x434a0f(0xa4)](),_0x197be6=_0x226f61[_0x434a0f(0xac)][0x0],_0xb1a63a=_0x226f61[_0x434a0f(0xac)][_0x434a0f(0xb9)](0x1),_0x4a9740=readPackageScripts(_0x5f34f1);if(!_0x4a9740)throw CliErrors['validation'](_0x434a0f(0xb0));if(!_0x197be6){const _0x287812=Object[_0x434a0f(0xc5)](_0x4a9740);if(_0x287812['length']===0x0)console[_0x434a0f(0xb3)](_0x434a0f(0xb8));else{console[_0x434a0f(0xb3)]('\x0a\x20\x20Available\x20scripts:\x0a');for(const _0x1a8d03 of _0x287812){console['log'](_0x434a0f(0xab)+_0x1a8d03);}console[_0x434a0f(0xb3)](_0x434a0f(0xc3)+CLI_BIN_NAME+_0x434a0f(0xca));}return{'ok':!![]};}if(!_0x4a9740[_0x197be6])throw CliErrors[_0x434a0f(0xc4)](_0x434a0f(0xa9)+_0x197be6+_0x434a0f(0xbd),_0x434a0f(0x97)+(Object[_0x434a0f(0xc5)](_0x4a9740)[_0x434a0f(0x92)](',\x20')||_0x434a0f(0x98)));const _0x232421=detectPackageManager(_0x5f34f1),_0xfe8f26=syncProjectDomainRoutingBeforeScript(_0x5f34f1,_0x197be6);_0xfe8f26?.[_0x434a0f(0xad)]&&console[_0x434a0f(0x9e)]('Domain\x20routing\x20synchronized:\x20'+_0xfe8f26[_0x434a0f(0x9d)]);VERSION_CHECK_SCRIPTS[_0x434a0f(0xa8)](_0x197be6)&&await versionCheck(_0x5f34f1);if(_0x197be6===_0x434a0f(0xc0)&&_0x226f61[_0x434a0f(0x9f)]('watch'))return await Promise[_0x434a0f(0xb4)]([spawnViteBuildWatch(_0x5f34f1),spawnVitePreview(_0x5f34f1)]),{'ok':!![]};return await spawnScript(_0x232421,_0x197be6,_0xb1a63a,_0x5f34f1),{'ok':!![]};}};
1
+ const a245_0x4ad350=a245_0x35cd;(function(_0x6de55e,_0x5946c4){const _0x3570e7=a245_0x35cd,_0x9b99bd=_0x6de55e();while(!![]){try{const _0x42c160=parseInt(_0x3570e7(0x1c8))/0x1+-parseInt(_0x3570e7(0x19e))/0x2*(-parseInt(_0x3570e7(0x1ac))/0x3)+parseInt(_0x3570e7(0x1c7))/0x4+-parseInt(_0x3570e7(0x19d))/0x5*(-parseInt(_0x3570e7(0x195))/0x6)+parseInt(_0x3570e7(0x1c1))/0x7+-parseInt(_0x3570e7(0x1a1))/0x8+-parseInt(_0x3570e7(0x197))/0x9;if(_0x42c160===_0x5946c4)break;else _0x9b99bd['push'](_0x9b99bd['shift']());}catch(_0x520a6b){_0x9b99bd['push'](_0x9b99bd['shift']());}}}(a245_0x4c07,0x2df46));import{readFileSync,existsSync}from'node:fs';function a245_0x4c07(){const _0x1f625d=['4841550YGHLGx','\x20run\x20start','yarn','parse','No\x20package.json\x20found\x20in\x20current\x20directory.','\x20run\x20','35LIoVWv','2168WLYYtk','length','yarn.lock','2142240hXjiZl','inherit','node_modules','cwd','package.json','\x20run\x20<script>\x0a','Available:\x20','vite\x20preview\x20exited\x20with\x20code\x20','Enable\x20watch\x20mode\x20for\x20preview','\x20\x20\x20\x20','args','546XnAkbj','log','pnpm','write','build','Domain\x20routing\x20synchronized:\x20','keys','\x20\x20EXAMPLES','Script\x20\x22','changed','(none)','has','\x20run\x20preview\x20--watch','vite','\x20run\x20build','\x22\x20not\x20found\x20in\x20package.json.','--watch','dev','utf-8','path','bun.lock','1038695eBwXxh','start','push','bun.lockb','\x20exited\x20with\x20code\x20','close','667328zfTVYd','184032zWxVck','No\x20scripts\x20defined\x20in\x20package.json.','slice','validation','watch','\x20run\x20preview','npm','pnpm-lock.yaml','all','error','preview','254934MSgIbK','belowMinimum'];a245_0x4c07=function(){return _0x1f625d;};return a245_0x4c07();}function a245_0x35cd(_0x42b3c3,_0x31be2d){_0x42b3c3=_0x42b3c3-0x18f;const _0x4c070d=a245_0x4c07();let _0x35cd8d=_0x4c070d[_0x42b3c3];return _0x35cd8d;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{findProjectRootDirectory,resolveConfigPath}from'../../context/config-loader.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a245_0x4ad350(0x1c2),a245_0x4ad350(0x1bd)]),DOMAIN_ROUTING_SYNC_SCRIPTS=new Set([a245_0x4ad350(0x1c2),a245_0x4ad350(0x1bd),a245_0x4ad350(0x1b0),a245_0x4ad350(0x194)]);export function syncProjectDomainRoutingBeforeScript(_0x3ca7b4,_0x38b31c){const _0x5d6f73=a245_0x4ad350;if(!DOMAIN_ROUTING_SYNC_SCRIPTS['has'](_0x38b31c))return null;const _0x1129c7=findProjectRootDirectory(_0x3ca7b4);if(!resolveConfigPath(_0x1129c7))return null;const _0x1f0447=writeProjectDomainRoutingManifest(_0x1129c7);return{'path':_0x1f0447[_0x5d6f73(0x1bf)],'changed':_0x1f0447[_0x5d6f73(0x1b5)]};}function readPackageScripts(_0x2b2aea){const _0x5ae94e=a245_0x4ad350,_0x4bef58=resolve(_0x2b2aea,_0x5ae94e(0x1a5));if(!existsSync(_0x4bef58))return null;try{const _0x31a17a=JSON[_0x5ae94e(0x19a)](readFileSync(_0x4bef58,_0x5ae94e(0x1be)));return _0x31a17a['scripts']??{};}catch{return null;}}function detectPackageManager(_0x3dae7f){const _0x58d05e=a245_0x4ad350;if(existsSync(resolve(_0x3dae7f,_0x58d05e(0x1c4)))||existsSync(resolve(_0x3dae7f,_0x58d05e(0x1c0))))return'bun';if(existsSync(resolve(_0x3dae7f,_0x58d05e(0x191))))return _0x58d05e(0x1ae);if(existsSync(resolve(_0x3dae7f,_0x58d05e(0x1a0))))return _0x58d05e(0x199);return _0x58d05e(0x190);}async function versionCheck(_0x5daf1a){const _0x3bd1ed=a245_0x4ad350,_0x181836=await checkCliVersion();(_0x181836['needsUpgrade']||_0x181836[_0x3bd1ed(0x196)])&&(printCliUpgradeWarning(_0x181836),assertCliVersionSupported(_0x181836));const _0x49f767=await checkSdkVersion(_0x5daf1a);if(_0x49f767['needsUpgrade'])printSdkUpgradeWarning(_0x49f767);}function spawnScript(_0x4e6b56,_0x4f754a,_0x52a325,_0x429e24){return new Promise((_0x146cf0,_0x5365de)=>{const _0x3dd6c7=a245_0x35cd,_0x276b56=['run',_0x4f754a,..._0x52a325],_0x503bb8=spawn(_0x4e6b56,_0x276b56,{'cwd':_0x429e24,'stdio':_0x3dd6c7(0x1a2),'shell':!![],'env':{...process.env,'PATH':''+join(_0x429e24,'node_modules','.bin')+delimiter+process.env.PATH}});_0x503bb8['on'](_0x3dd6c7(0x1c6),_0x1bee0a=>{const _0x270fd7=_0x3dd6c7;if(_0x1bee0a===0x0||_0x1bee0a===null)_0x146cf0();else _0x5365de(new Error(_0x4e6b56+_0x270fd7(0x19c)+_0x4f754a+_0x270fd7(0x1c5)+_0x1bee0a));}),_0x503bb8['on']('error',_0x5365de);});}function spawnViteBuildWatch(_0x14f772){return new Promise((_0x3334ba,_0x42ebd0)=>{const _0x1b7ccd=a245_0x35cd,_0x364d7a=spawn(_0x1b7ccd(0x1b9),['build',_0x1b7ccd(0x1bc)],{'cwd':_0x14f772,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x14f772,_0x1b7ccd(0x1a3),'.bin')+delimiter+process.env.PATH}});_0x364d7a['on'](_0x1b7ccd(0x1c6),_0x19402a=>{if(_0x19402a===0x0||_0x19402a===null)_0x3334ba();else _0x42ebd0(new Error('vite\x20build\x20--watch\x20exited\x20with\x20code\x20'+_0x19402a));}),_0x364d7a['on'](_0x1b7ccd(0x193),_0x42ebd0);});}function spawnVitePreview(_0x36112d){return new Promise((_0x13976c,_0x2027b8)=>{const _0x56d851=a245_0x35cd,_0x2a767f=spawn(_0x56d851(0x1b9),['preview'],{'cwd':_0x36112d,'stdio':_0x56d851(0x1a2),'shell':!![],'env':{...process.env,'PATH':''+join(_0x36112d,_0x56d851(0x1a3),'.bin')+delimiter+process.env.PATH}});_0x2a767f['on'](_0x56d851(0x1c6),_0x5d776e=>{const _0xd61b13=_0x56d851;if(_0x5d776e===0x0||_0x5d776e===null)_0x13976c();else _0x2027b8(new Error(_0xd61b13(0x1a8)+_0x5d776e));}),_0x2a767f['on'](_0x56d851(0x193),_0x2027b8);});}const runFlags=[{'name':a245_0x4ad350(0x1cc),'type':'boolean','description':a245_0x4ad350(0x1a9),'default':![]}];export const runDefinition={'service':'run','command':'run','description':'Run\x20a\x20package.json\x20script','risk':a245_0x4ad350(0x1af),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'script','description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x10ca07=a245_0x4ad350,_0x373e48=[];return _0x373e48[_0x10ca07(0x1c3)](_0x10ca07(0x1b3)),_0x373e48[_0x10ca07(0x1c3)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x10ca07(0x198)),_0x373e48[_0x10ca07(0x1c3)](_0x10ca07(0x1aa)+CLI_BIN_NAME+_0x10ca07(0x1ba)),_0x373e48[_0x10ca07(0x1c3)](_0x10ca07(0x1aa)+CLI_BIN_NAME+_0x10ca07(0x18f)),_0x373e48[_0x10ca07(0x1c3)](_0x10ca07(0x1aa)+CLI_BIN_NAME+_0x10ca07(0x1b8)),_0x373e48['join']('\x0a');},async 'execute'(_0x1ba251){const _0xcb4c91=a245_0x4ad350,_0x1ef3aa=process[_0xcb4c91(0x1a4)](),_0x15ded7=_0x1ba251[_0xcb4c91(0x1ab)][0x0],_0x1d9f75=_0x1ba251[_0xcb4c91(0x1ab)][_0xcb4c91(0x1ca)](0x1),_0x79a633=readPackageScripts(_0x1ef3aa);if(!_0x79a633)throw CliErrors[_0xcb4c91(0x1cb)](_0xcb4c91(0x19b));if(!_0x15ded7){const _0x3d16fa=Object[_0xcb4c91(0x1b2)](_0x79a633);if(_0x3d16fa[_0xcb4c91(0x19f)]===0x0)console['log'](_0xcb4c91(0x1c9));else{console['log']('\x0a\x20\x20Available\x20scripts:\x0a');for(const _0x45c1fe of _0x3d16fa){console['log']('\x20\x20\x20\x20'+_0x45c1fe);}console[_0xcb4c91(0x1ad)]('\x0a\x20\x20Usage:\x20'+CLI_BIN_NAME+_0xcb4c91(0x1a6));}return{'ok':!![]};}if(!_0x79a633[_0x15ded7])throw CliErrors[_0xcb4c91(0x1cb)](_0xcb4c91(0x1b4)+_0x15ded7+_0xcb4c91(0x1bb),_0xcb4c91(0x1a7)+(Object[_0xcb4c91(0x1b2)](_0x79a633)['join'](',\x20')||_0xcb4c91(0x1b6)));const _0x100c0a=detectPackageManager(_0x1ef3aa),_0x5cb8b5=syncProjectDomainRoutingBeforeScript(_0x1ef3aa,_0x15ded7);_0x5cb8b5?.[_0xcb4c91(0x1b5)]&&console[_0xcb4c91(0x193)](_0xcb4c91(0x1b1)+_0x5cb8b5[_0xcb4c91(0x1bf)]);VERSION_CHECK_SCRIPTS[_0xcb4c91(0x1b7)](_0x15ded7)&&await versionCheck(_0x1ef3aa);if(_0x15ded7===_0xcb4c91(0x194)&&_0x1ba251['bool']('watch'))return await Promise[_0xcb4c91(0x192)]([spawnViteBuildWatch(_0x1ef3aa),spawnVitePreview(_0x1ef3aa)]),{'ok':!![]};return await spawnScript(_0x100c0a,_0x15ded7,_0x1d9f75,_0x1ef3aa),{'ok':!![]};}};
@@ -1 +1 @@
1
- const a246_0x541124=a246_0x311b;(function(_0x4d6f0f,_0x552e68){const _0xb98283=a246_0x311b,_0x463770=_0x4d6f0f();while(!![]){try{const _0x27f447=-parseInt(_0xb98283(0xaa))/0x1*(-parseInt(_0xb98283(0xad))/0x2)+parseInt(_0xb98283(0xb3))/0x3*(parseInt(_0xb98283(0xb1))/0x4)+parseInt(_0xb98283(0xac))/0x5*(-parseInt(_0xb98283(0xb4))/0x6)+-parseInt(_0xb98283(0xab))/0x7+-parseInt(_0xb98283(0xa6))/0x8+-parseInt(_0xb98283(0xa8))/0x9*(parseInt(_0xb98283(0xaf))/0xa)+parseInt(_0xb98283(0xa5))/0xb;if(_0x27f447===_0x552e68)break;else _0x463770['push'](_0x463770['shift']());}catch(_0x5c8630){_0x463770['push'](_0x463770['shift']());}}}(a246_0x4daf,0xc4336));import{buildSchemaPayload}from'../framework/schema-export.js';function a246_0x4daf(){const _0x1157a8=['10122926KKRQUB','3344072cRyqgU','schema','3177SwZvTd','read','17kXiCNR','1013929JMFoxU','5JefJbf','39622ARWnbV','json','5630ROnfKy','export','844TeJOLl','Export\x20machine-readable\x20command\x20schema\x20(JSON)','6051PXONBf','704442MvrVmL'];a246_0x4daf=function(){return _0x1157a8;};return a246_0x4daf();}async function execute(_0x32fcc0){const _0x448b93=await buildSchemaPayload();return{'ok':!![],'data':_0x448b93};}function a246_0x311b(_0xf9423,_0x4f1e07){_0xf9423=_0xf9423-0xa5;const _0x4daf93=a246_0x4daf();let _0x311b1e=_0x4daf93[_0xf9423];return _0x311b1e;}export const schemaDefinition={'service':a246_0x541124(0xa7),'command':a246_0x541124(0xb0),'description':a246_0x541124(0xb2),'risk':a246_0x541124(0xa9),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a246_0x541124(0xae),'flags':[],'execute':execute};
1
+ const a246_0x3ca1a7=a246_0x3c55;function a246_0x3c55(_0x52b519,_0x528333){_0x52b519=_0x52b519-0xf9;const _0x6da6d1=a246_0x6da6();let _0x3c553a=_0x6da6d1[_0x52b519];return _0x3c553a;}(function(_0x5466be,_0x1ed5e3){const _0x541f49=a246_0x3c55,_0x1bcf7c=_0x5466be();while(!![]){try{const _0x4402a6=parseInt(_0x541f49(0xff))/0x1+parseInt(_0x541f49(0xfa))/0x2*(-parseInt(_0x541f49(0x104))/0x3)+-parseInt(_0x541f49(0x103))/0x4+parseInt(_0x541f49(0x102))/0x5*(parseInt(_0x541f49(0x101))/0x6)+-parseInt(_0x541f49(0xf9))/0x7+parseInt(_0x541f49(0xfc))/0x8*(-parseInt(_0x541f49(0xfb))/0x9)+parseInt(_0x541f49(0xfe))/0xa;if(_0x4402a6===_0x1ed5e3)break;else _0x1bcf7c['push'](_0x1bcf7c['shift']());}catch(_0xeb215){_0x1bcf7c['push'](_0x1bcf7c['shift']());}}}(a246_0x6da6,0x90092));import{buildSchemaPayload}from'../framework/schema-export.js';function a246_0x6da6(){const _0xb570f9=['176115aFNZeN','108899RcFKMH','40fTpuRV','237555DfcxAc','48Tyiwso','Export\x20machine-readable\x20command\x20schema\x20(JSON)','11881040IXhswG','996076csqiWY','json','33210lhhFvw','665mJPUHS','3929352FmYPjR'];a246_0x6da6=function(){return _0xb570f9;};return a246_0x6da6();}async function execute(_0x670fd2){const _0x29ed12=await buildSchemaPayload();return{'ok':!![],'data':_0x29ed12};}export const schemaDefinition={'service':'schema','command':'export','description':a246_0x3ca1a7(0xfd),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a246_0x3ca1a7(0x100),'flags':[],'execute':execute};
@@ -1 +1 @@
1
- const a247_0x3a9f7b=a247_0x9107;(function(_0x2d0729,_0x2d95b5){const _0x299aa4=a247_0x9107,_0x358665=_0x2d0729();while(!![]){try{const _0x1c8836=parseInt(_0x299aa4(0x1d5))/0x1*(-parseInt(_0x299aa4(0x1c7))/0x2)+parseInt(_0x299aa4(0x1c2))/0x3+parseInt(_0x299aa4(0x1d7))/0x4*(-parseInt(_0x299aa4(0x1d6))/0x5)+parseInt(_0x299aa4(0x1ee))/0x6*(parseInt(_0x299aa4(0x1e6))/0x7)+-parseInt(_0x299aa4(0x1cf))/0x8+parseInt(_0x299aa4(0x1c0))/0x9+parseInt(_0x299aa4(0x1fa))/0xa;if(_0x1c8836===_0x2d95b5)break;else _0x358665['push'](_0x358665['shift']());}catch(_0x39d043){_0x358665['push'](_0x358665['shift']());}}}(a247_0x45ed,0xc1ee9));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';function a247_0x9107(_0x2b950f,_0x2dc492){_0x2b950f=_0x2b950f-0x1bd;const _0x45ed81=a247_0x45ed();let _0x9107e2=_0x45ed81[_0x2b950f];return _0x9107e2;}import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';function a247_0x45ed(){const _0xeb50b=['sql','19610520RgNIte','__manual__','Local\x20SQL\x20file\x20mode','lastSync','parse','sqlRootDir','4710951zjDYbf','Created\x20SQL\x20query\x20','2063151VfKIST','create','POST','mybatisXml','isInteger','18GGpBEV','validation','write','trim','str','description','isFinite','lockFilePath','11252616rcUIaH','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','stringify','Invalid\x20database\x20selection\x20payload:\x20','Plain\x20SQL\x20(sql)','127631uKgJJR','1535AWQYMl','1884gxBtuA','dbId\x20must\x20be\x20a\x20positive\x20integer','toISOString','MyBatis\x20XML\x20(mybatisXml)','mode','new','appCode','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','string','SQL\x20query\x20display\x20name','sqlCode','sqlName','map','/smartapi/custom/saveUserCustomSql','<server-generated-sqlCode>','42wSqhRR','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','flagMissing','dbId','Select\x20the\x20target\x20database:','sqls','sqlRoot','321990sUmrHA','name','db-id','Select\x20the\x20local\x20SQL\x20mode:','SQL\x20name\x20cannot\x20be\x20empty','nonInteractive','length','\x20\x20SELECT\x201\x20AS\x20id','dbName','catch','number'];a247_0x45ed=function(){return _0xeb50b;};return a247_0x45ed();}import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x18d570){const _0x56fecc=a247_0x9107;if(_0x18d570===_0x56fecc(0x1c5))return['<select\x20id=\x22query\x22\x20resultType=\x22map\x22>',_0x56fecc(0x1f5),'</select>','']['join']('\x0a');return['SELECT\x201\x20AS\x20id;','']['join']('\x0a');}export const sqlCreate={'service':a247_0x3a9f7b(0x1f9),'command':a247_0x3a9f7b(0x1c3),'description':a247_0x3a9f7b(0x1e7),'risk':a247_0x3a9f7b(0x1c9),'flags':[{'name':a247_0x3a9f7b(0x1ef),'type':a247_0x3a9f7b(0x1df),'description':a247_0x3a9f7b(0x1e0)},{'name':a247_0x3a9f7b(0x1f0),'type':a247_0x3a9f7b(0x1f8),'description':'Target\x20database\x20ID'},{'name':a247_0x3a9f7b(0x1db),'type':a247_0x3a9f7b(0x1df),'enum':[a247_0x3a9f7b(0x1f9),a247_0x3a9f7b(0x1c5)],'description':a247_0x3a9f7b(0x1fc)}],async 'validate'(_0x3e1f92){const _0xa5d4e2=a247_0x3a9f7b;if(!_0x3e1f92[_0xa5d4e2(0x1f3)])return;if(!_0x3e1f92[_0xa5d4e2(0x1cb)]('name')[_0xa5d4e2(0x1ca)]())throw CliErrors[_0xa5d4e2(0x1e9)](_0xa5d4e2(0x1ef),_0xa5d4e2(0x1e8));const _0x4f3ff4=resolveProvidedDbId(_0x3e1f92);if(typeof _0x4f3ff4!=='number'||!Number[_0xa5d4e2(0x1cd)](_0x4f3ff4)||_0x4f3ff4<=0x0)throw CliErrors['flagMissing'](_0xa5d4e2(0x1f0),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');if(!_0x3e1f92['str']('mode')[_0xa5d4e2(0x1ca)]())throw CliErrors[_0xa5d4e2(0x1e9)](_0xa5d4e2(0x1db),_0xa5d4e2(0x1d0));},async 'dryRun'(_0x1b9a2d){const _0x403274=a247_0x3a9f7b,_0x5d2d68=loadSqlProjectConfig(_0x1b9a2d['appCode']),{sqlName:_0x371a96,dbId:_0x3c8e27,dbName:_0x3dc4f1,mode:_0x19d662}=await resolveSqlNewInputs(_0x1b9a2d),_0x2160e7=buildSqlRelativePath(_0x403274(0x1e5),_0x371a96,_0x3dc4f1,_0x19d662,_0x3c8e27),_0x264f8c=_0x5d2d68[_0x403274(0x1bf)]+'/'+_0x2160e7;return{'method':_0x403274(0x1c4),'url':_0x403274(0x1e4),'body':{'appCode':_0x1b9a2d[_0x403274(0x1dd)],'sqlName':_0x371a96,'dbId':_0x3c8e27,'mode':_0x19d662,'localPath':_0x264f8c},'description':_0x403274(0x1d1)+_0x5d2d68[_0x403274(0x1bf)]};},async 'execute'(_0x5b9bc7){const _0x196fe0=a247_0x3a9f7b,_0x8555d7=loadSqlProjectConfig(_0x5b9bc7[_0x196fe0(0x1dd)]),{sqlName:_0x374919,dbId:_0x307271,dbName:_0x188d22,mode:_0x3cd83e}=await resolveSqlNewInputs(_0x5b9bc7),_0x1f2917=generateSqlTemplate(_0x3cd83e),_0xfdf990=await createSqlQuery({'appCode':_0x5b9bc7[_0x196fe0(0x1dd)],'sqlName':_0x374919,'dbId':_0x307271,'sqlContent':_0x1f2917}),_0x40bae2=ensureRemoteSqlContent(_0xfdf990),_0x5dedf9=_0x188d22||await getDbName(_0x5b9bc7[_0x196fe0(0x1dd)],_0x307271)['catch'](()=>undefined),_0x4b2a2f=buildSqlRelativePath(_0xfdf990[_0x196fe0(0x1e1)],_0xfdf990[_0x196fe0(0x1e2)],_0x5dedf9,_0x3cd83e,_0x307271),_0x29a313=_0x8555d7['sqlRootDir']+'/'+_0x4b2a2f,_0x409667=buildLocalSqlFileContent({'sqlCode':_0xfdf990[_0x196fe0(0x1e1)],'sqlName':_0xfdf990[_0x196fe0(0x1e2)],'dbId':_0xfdf990[_0x196fe0(0x1ea)]},_0x40bae2,{'dbName':_0x5dedf9,'mode':_0x3cd83e,'syncedAt':new Date()[_0x196fe0(0x1d9)](),'description':_0xfdf990[_0x196fe0(0x1cc)]});if(await fileExists(_0x29a313))throw CliErrors[_0x196fe0(0x1c8)]('File\x20already\x20exists:\x20'+_0x29a313);await ensureParentDirectory(_0x29a313),await writeFile(_0x29a313,_0x409667,'utf8');const _0x712e0d=await readSqlLockFile(_0x8555d7['lockFilePath']),{lockData:_0x161336,appLock:_0x32a9c3}=ensureSqlLockScope(_0x712e0d??createEmptySqlLock(),_0x8555d7[_0x196fe0(0x1dd)],_0x8555d7[_0x196fe0(0x1ed)],_0x196fe0(0x1dc));return _0x32a9c3[_0x196fe0(0x1ec)][_0xfdf990[_0x196fe0(0x1e1)]]={...buildSqlLockEntry(_0xfdf990,_0x40bae2,computeSqlContentHash(_0x409667),{'dbName':_0x5dedf9}),'path':_0x4b2a2f,'mode':_0x3cd83e},_0x32a9c3[_0x196fe0(0x1bd)]=new Date()[_0x196fe0(0x1d9)](),await writeSqlLockFile(_0x8555d7[_0x196fe0(0x1ce)],_0x161336),{'ok':!![],'data':{'id':_0xfdf990['id'],'sqlCode':_0xfdf990[_0x196fe0(0x1e1)],'sqlName':_0xfdf990['sqlName'],'dbId':_0xfdf990[_0x196fe0(0x1ea)],'path':_0x29a313,'mode':_0x3cd83e},'message':_0x196fe0(0x1c1)+_0xfdf990[_0x196fe0(0x1e1)]};}};async function resolveSqlNewInputs(_0xa7b273){const _0x5c64c7=await resolveSqlNameInput(_0xa7b273),{dbId:_0x22ed54,dbName:_0x208059}=await resolveDbSelection(_0xa7b273),_0x1f8790=await resolveSqlModeInput(_0xa7b273);return{'sqlName':_0x5c64c7,'dbId':_0x22ed54,'dbName':_0x208059,'mode':_0x1f8790};}async function resolveSqlNameInput(_0x5f59e3){const _0x40d72f=a247_0x3a9f7b,_0x2deb4c=_0x5f59e3[_0x40d72f(0x1cb)](_0x40d72f(0x1ef))[_0x40d72f(0x1ca)]();if(_0x2deb4c)return _0x2deb4c;if(_0x5f59e3[_0x40d72f(0x1f3)])throw CliErrors[_0x40d72f(0x1e9)]('name',_0x40d72f(0x1e8));return(await input({'message':'SQL\x20name:','validate':_0x55e90d=>_0x55e90d[_0x40d72f(0x1ca)]()?!![]:_0x40d72f(0x1f2)}))[_0x40d72f(0x1ca)]();}async function resolveDbSelection(_0x556801){const _0x137254=a247_0x3a9f7b,_0x53c23d=resolveProvidedDbId(_0x556801);if(typeof _0x53c23d===_0x137254(0x1f8)&&Number[_0x137254(0x1cd)](_0x53c23d)&&_0x53c23d>0x0)return{'dbId':_0x53c23d,'dbName':await getDbName(_0x556801[_0x137254(0x1dd)],_0x53c23d)['catch'](()=>undefined)};if(_0x556801[_0x137254(0x1f3)])throw CliErrors[_0x137254(0x1e9)](_0x137254(0x1f0),_0x137254(0x1de));const _0x5eb58c=await listDatabases(_0x556801[_0x137254(0x1dd)])[_0x137254(0x1f7)](()=>[]);if(_0x5eb58c['length']===0x1)return{'dbId':_0x5eb58c[0x0][_0x137254(0x1ea)],'dbName':_0x5eb58c[0x0][_0x137254(0x1f6)]};if(_0x5eb58c[_0x137254(0x1f4)]>0x1){const _0x1c257b=await select({'message':_0x137254(0x1eb),'choices':[..._0x5eb58c[_0x137254(0x1e3)](_0x50907b=>({'name':_0x50907b[_0x137254(0x1f6)]+'\x20('+_0x50907b[_0x137254(0x1ea)]+')','value':serializeDbSelection(_0x50907b)})),{'name':'✎\x20Enter\x20dbId\x20manually','value':_0x137254(0x1fb)}]});if(_0x1c257b!==_0x137254(0x1fb))return deserializeDbSelection(_0x1c257b);}const _0x4765f3=await input({'message':'Target\x20database\x20dbId:','validate':_0x529c03=>{const _0xb88e4e=_0x137254,_0x227bc1=_0x529c03[_0xb88e4e(0x1ca)]();if(!_0x227bc1)return'dbId\x20cannot\x20be\x20empty';const _0x3897a1=Number(_0x227bc1);if(!Number[_0xb88e4e(0x1c6)](_0x3897a1)||_0x3897a1<=0x0)return _0xb88e4e(0x1d8);return!![];}});return{'dbId':Number(_0x4765f3[_0x137254(0x1ca)]())};}async function resolveSqlModeInput(_0x2f82ec){const _0x338535=a247_0x3a9f7b,_0x4375ff=_0x2f82ec[_0x338535(0x1cb)](_0x338535(0x1db))[_0x338535(0x1ca)]();if(_0x4375ff===_0x338535(0x1f9)||_0x4375ff==='mybatisXml')return _0x4375ff;if(_0x2f82ec[_0x338535(0x1f3)])throw CliErrors[_0x338535(0x1e9)]('mode','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');return await select({'message':_0x338535(0x1f1),'choices':[{'name':_0x338535(0x1d4),'value':_0x338535(0x1f9),'description':'For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly'},{'name':_0x338535(0x1da),'value':_0x338535(0x1c5),'description':'For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags'}]});}function serializeDbSelection(_0x31f872){const _0xc6f934=a247_0x3a9f7b;return JSON[_0xc6f934(0x1d2)]({'dbId':_0x31f872[_0xc6f934(0x1ea)],'dbName':_0x31f872[_0xc6f934(0x1f6)]});}function deserializeDbSelection(_0x44fc75){const _0x3d5f45=a247_0x3a9f7b;try{const _0x3fdf74=JSON[_0x3d5f45(0x1be)](_0x44fc75);if(typeof _0x3fdf74['dbId']==='number'&&Number[_0x3d5f45(0x1cd)](_0x3fdf74[_0x3d5f45(0x1ea)]))return{'dbId':_0x3fdf74[_0x3d5f45(0x1ea)],'dbName':_0x3fdf74['dbName']};}catch{}throw CliErrors[_0x3d5f45(0x1c8)](_0x3d5f45(0x1d3)+_0x44fc75);}function resolveProvidedDbId(_0x3fa5fb){const _0x58a7a6=a247_0x3a9f7b,_0x3f8308=_0x3fa5fb['flag'](_0x58a7a6(0x1f0));if(typeof _0x3f8308===_0x58a7a6(0x1f8)&&Number['isFinite'](_0x3f8308))return _0x3f8308;return undefined;}
1
+ function a247_0xde10(_0x9e92b,_0x11661b){_0x9e92b=_0x9e92b-0xc4;const _0x4c90ac=a247_0x4c90();let _0xde1075=_0x4c90ac[_0x9e92b];return _0xde1075;}const a247_0x4a1ffd=a247_0xde10;(function(_0x5841a2,_0x253863){const _0x5ab969=a247_0xde10,_0x350ab3=_0x5841a2();while(!![]){try{const _0x4dc473=-parseInt(_0x5ab969(0xce))/0x1+-parseInt(_0x5ab969(0xf5))/0x2*(parseInt(_0x5ab969(0xdd))/0x3)+-parseInt(_0x5ab969(0x100))/0x4*(parseInt(_0x5ab969(0xf2))/0x5)+parseInt(_0x5ab969(0xd8))/0x6+parseInt(_0x5ab969(0xc7))/0x7+parseInt(_0x5ab969(0xc4))/0x8*(parseInt(_0x5ab969(0x108))/0x9)+-parseInt(_0x5ab969(0xe9))/0xa*(-parseInt(_0x5ab969(0xf8))/0xb);if(_0x4dc473===_0x253863)break;else _0x350ab3['push'](_0x350ab3['shift']());}catch(_0x47467d){_0x350ab3['push'](_0x350ab3['shift']());}}}(a247_0x4c90,0xa140e));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function a247_0x4c90(){const _0x571edd=['File\x20already\x20exists:\x20','SELECT\x201\x20AS\x20id;','mybatisXml','sqlRootDir','1256771kRGJfD','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','/smartapi/custom/saveUserCustomSql','catch','sqls','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','SQL\x20name\x20cannot\x20be\x20empty','isInteger','<server-generated-sqlCode>','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','1839528bHtzaY','write','parse','dbId','sql','3nBUozx','trim','map','POST','dbId\x20cannot\x20be\x20empty','dbName','✎\x20Enter\x20dbId\x20manually','For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly','toISOString','Created\x20SQL\x20query\x20','sqlRoot','flagMissing','170rCikRL','SQL\x20query\x20display\x20name','sqlName','db-id','nonInteractive','number','Local\x20SQL\x20file\x20mode','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','appCode','5JZofmT','Select\x20the\x20target\x20database:','validation','1677918dWudWB','Plain\x20SQL\x20(sql)','length','855426QNnOzU','__manual__','\x20\x20SELECT\x201\x20AS\x20id','str','isFinite','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','string','join','334556YyAAIK','sqlCode','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','create','name','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','Invalid\x20database\x20selection\x20payload:\x20','lastSync','9BnQiDO','7768640Stjgjj','MyBatis\x20XML\x20(mybatisXml)','utf8','1681211wIQGqZ','</select>','mode'];a247_0x4c90=function(){return _0x571edd;};return a247_0x4c90();}function generateSqlTemplate(_0x363849){const _0x2094ac=a247_0xde10;if(_0x363849==='mybatisXml')return[_0x2094ac(0xfd),_0x2094ac(0xfa),_0x2094ac(0xc8),''][_0x2094ac(0xff)]('\x0a');return[_0x2094ac(0xcb),''][_0x2094ac(0xff)]('\x0a');}export const sqlCreate={'service':a247_0x4a1ffd(0xdc),'command':a247_0x4a1ffd(0x103),'description':a247_0x4a1ffd(0xd3),'risk':a247_0x4a1ffd(0xd9),'flags':[{'name':'name','type':a247_0x4a1ffd(0xfe),'description':a247_0x4a1ffd(0xea)},{'name':'db-id','type':a247_0x4a1ffd(0xee),'description':'Target\x20database\x20ID'},{'name':a247_0x4a1ffd(0xc9),'type':a247_0x4a1ffd(0xfe),'enum':[a247_0x4a1ffd(0xdc),a247_0x4a1ffd(0xcc)],'description':a247_0x4a1ffd(0xef)}],async 'validate'(_0x58d6fa){const _0x586e2=a247_0x4a1ffd;if(!_0x58d6fa[_0x586e2(0xed)])return;if(!_0x58d6fa[_0x586e2(0xfb)](_0x586e2(0x104))[_0x586e2(0xde)]())throw CliErrors[_0x586e2(0xe8)](_0x586e2(0x104),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x3785e1=resolveProvidedDbId(_0x58d6fa);if(typeof _0x3785e1!==_0x586e2(0xee)||!Number[_0x586e2(0xfc)](_0x3785e1)||_0x3785e1<=0x0)throw CliErrors[_0x586e2(0xe8)](_0x586e2(0xec),_0x586e2(0xf0));if(!_0x58d6fa[_0x586e2(0xfb)](_0x586e2(0xc9))['trim']())throw CliErrors[_0x586e2(0xe8)](_0x586e2(0xc9),_0x586e2(0xcf));},async 'dryRun'(_0x323f01){const _0x144419=a247_0x4a1ffd,_0x4f2913=loadSqlProjectConfig(_0x323f01['appCode']),{sqlName:_0x438ea0,dbId:_0xd7dc6b,dbName:_0x194dd9,mode:_0x16bc0d}=await resolveSqlNewInputs(_0x323f01),_0x4357ff=buildSqlRelativePath(_0x144419(0xd6),_0x438ea0,_0x194dd9,_0x16bc0d,_0xd7dc6b),_0x2ae7e8=_0x4f2913[_0x144419(0xcd)]+'/'+_0x4357ff;return{'method':_0x144419(0xe0),'url':_0x144419(0xd0),'body':{'appCode':_0x323f01[_0x144419(0xf1)],'sqlName':_0x438ea0,'dbId':_0xd7dc6b,'mode':_0x16bc0d,'localPath':_0x2ae7e8},'description':_0x144419(0xd7)+_0x4f2913['sqlRootDir']};},async 'execute'(_0x56100a){const _0x56cc27=a247_0x4a1ffd,_0x339a40=loadSqlProjectConfig(_0x56100a[_0x56cc27(0xf1)]),{sqlName:_0x3bd289,dbId:_0x39aa8b,dbName:_0x1db422,mode:_0x242f71}=await resolveSqlNewInputs(_0x56100a),_0x1420a5=generateSqlTemplate(_0x242f71),_0x34d832=await createSqlQuery({'appCode':_0x56100a[_0x56cc27(0xf1)],'sqlName':_0x3bd289,'dbId':_0x39aa8b,'sqlContent':_0x1420a5}),_0xd5f594=ensureRemoteSqlContent(_0x34d832),_0x2d824c=_0x1db422||await getDbName(_0x56100a['appCode'],_0x39aa8b)[_0x56cc27(0xd1)](()=>undefined),_0x3ad83a=buildSqlRelativePath(_0x34d832[_0x56cc27(0x101)],_0x34d832[_0x56cc27(0xeb)],_0x2d824c,_0x242f71,_0x39aa8b),_0x537dc3=_0x339a40['sqlRootDir']+'/'+_0x3ad83a,_0x10bb40=buildLocalSqlFileContent({'sqlCode':_0x34d832['sqlCode'],'sqlName':_0x34d832[_0x56cc27(0xeb)],'dbId':_0x34d832['dbId']},_0xd5f594,{'dbName':_0x2d824c,'mode':_0x242f71,'syncedAt':new Date()[_0x56cc27(0xe5)](),'description':_0x34d832['description']});if(await fileExists(_0x537dc3))throw CliErrors[_0x56cc27(0xf4)](_0x56cc27(0xca)+_0x537dc3);await ensureParentDirectory(_0x537dc3),await writeFile(_0x537dc3,_0x10bb40,_0x56cc27(0xc6));const _0x5d240e=await readSqlLockFile(_0x339a40['lockFilePath']),{lockData:_0x4fe5f0,appLock:_0x94f6f3}=ensureSqlLockScope(_0x5d240e??createEmptySqlLock(),_0x339a40[_0x56cc27(0xf1)],_0x339a40[_0x56cc27(0xe7)],'new');return _0x94f6f3[_0x56cc27(0xd2)][_0x34d832[_0x56cc27(0x101)]]={...buildSqlLockEntry(_0x34d832,_0xd5f594,computeSqlContentHash(_0x10bb40),{'dbName':_0x2d824c}),'path':_0x3ad83a,'mode':_0x242f71},_0x94f6f3[_0x56cc27(0x107)]=new Date()[_0x56cc27(0xe5)](),await writeSqlLockFile(_0x339a40['lockFilePath'],_0x4fe5f0),{'ok':!![],'data':{'id':_0x34d832['id'],'sqlCode':_0x34d832[_0x56cc27(0x101)],'sqlName':_0x34d832[_0x56cc27(0xeb)],'dbId':_0x34d832['dbId'],'path':_0x537dc3,'mode':_0x242f71},'message':_0x56cc27(0xe6)+_0x34d832[_0x56cc27(0x101)]};}};async function resolveSqlNewInputs(_0x42fcd6){const _0x278688=await resolveSqlNameInput(_0x42fcd6),{dbId:_0x385c3a,dbName:_0xe4dd64}=await resolveDbSelection(_0x42fcd6),_0x3d42c8=await resolveSqlModeInput(_0x42fcd6);return{'sqlName':_0x278688,'dbId':_0x385c3a,'dbName':_0xe4dd64,'mode':_0x3d42c8};}async function resolveSqlNameInput(_0x1271a0){const _0x3238e1=a247_0x4a1ffd,_0x2710cb=_0x1271a0[_0x3238e1(0xfb)](_0x3238e1(0x104))[_0x3238e1(0xde)]();if(_0x2710cb)return _0x2710cb;if(_0x1271a0[_0x3238e1(0xed)])throw CliErrors[_0x3238e1(0xe8)](_0x3238e1(0x104),_0x3238e1(0x102));return(await input({'message':'SQL\x20name:','validate':_0x3ea0fc=>_0x3ea0fc[_0x3238e1(0xde)]()?!![]:_0x3238e1(0xd4)}))['trim']();}async function resolveDbSelection(_0x542f25){const _0x2825f9=a247_0x4a1ffd,_0x47174f=resolveProvidedDbId(_0x542f25);if(typeof _0x47174f===_0x2825f9(0xee)&&Number[_0x2825f9(0xfc)](_0x47174f)&&_0x47174f>0x0)return{'dbId':_0x47174f,'dbName':await getDbName(_0x542f25[_0x2825f9(0xf1)],_0x47174f)[_0x2825f9(0xd1)](()=>undefined)};if(_0x542f25[_0x2825f9(0xed)])throw CliErrors['flagMissing'](_0x2825f9(0xec),_0x2825f9(0xf0));const _0x2a0b97=await listDatabases(_0x542f25[_0x2825f9(0xf1)])[_0x2825f9(0xd1)](()=>[]);if(_0x2a0b97[_0x2825f9(0xf7)]===0x1)return{'dbId':_0x2a0b97[0x0][_0x2825f9(0xdb)],'dbName':_0x2a0b97[0x0][_0x2825f9(0xe2)]};if(_0x2a0b97['length']>0x1){const _0x3c4826=await select({'message':_0x2825f9(0xf3),'choices':[..._0x2a0b97[_0x2825f9(0xdf)](_0x92d471=>({'name':_0x92d471[_0x2825f9(0xe2)]+'\x20('+_0x92d471[_0x2825f9(0xdb)]+')','value':serializeDbSelection(_0x92d471)})),{'name':_0x2825f9(0xe3),'value':_0x2825f9(0xf9)}]});if(_0x3c4826!==_0x2825f9(0xf9))return deserializeDbSelection(_0x3c4826);}const _0x3b2d61=await input({'message':'Target\x20database\x20dbId:','validate':_0x1ac9c2=>{const _0x2cc44a=_0x2825f9,_0x432a3f=_0x1ac9c2['trim']();if(!_0x432a3f)return _0x2cc44a(0xe1);const _0x649740=Number(_0x432a3f);if(!Number[_0x2cc44a(0xd5)](_0x649740)||_0x649740<=0x0)return'dbId\x20must\x20be\x20a\x20positive\x20integer';return!![];}});return{'dbId':Number(_0x3b2d61[_0x2825f9(0xde)]())};}async function resolveSqlModeInput(_0x344876){const _0x44d1b9=a247_0x4a1ffd,_0x52ed33=_0x344876[_0x44d1b9(0xfb)](_0x44d1b9(0xc9))['trim']();if(_0x52ed33===_0x44d1b9(0xdc)||_0x52ed33===_0x44d1b9(0xcc))return _0x52ed33;if(_0x344876[_0x44d1b9(0xed)])throw CliErrors[_0x44d1b9(0xe8)](_0x44d1b9(0xc9),_0x44d1b9(0xcf));return await select({'message':'Select\x20the\x20local\x20SQL\x20mode:','choices':[{'name':_0x44d1b9(0xf6),'value':_0x44d1b9(0xdc),'description':_0x44d1b9(0xe4)},{'name':_0x44d1b9(0xc5),'value':'mybatisXml','description':_0x44d1b9(0x105)}]});}function serializeDbSelection(_0x46bac9){const _0x359c46=a247_0x4a1ffd;return JSON['stringify']({'dbId':_0x46bac9[_0x359c46(0xdb)],'dbName':_0x46bac9[_0x359c46(0xe2)]});}function deserializeDbSelection(_0x2d9443){const _0x5bdcf6=a247_0x4a1ffd;try{const _0x341f6a=JSON[_0x5bdcf6(0xda)](_0x2d9443);if(typeof _0x341f6a[_0x5bdcf6(0xdb)]===_0x5bdcf6(0xee)&&Number['isFinite'](_0x341f6a[_0x5bdcf6(0xdb)]))return{'dbId':_0x341f6a['dbId'],'dbName':_0x341f6a[_0x5bdcf6(0xe2)]};}catch{}throw CliErrors[_0x5bdcf6(0xf4)](_0x5bdcf6(0x106)+_0x2d9443);}function resolveProvidedDbId(_0x2e540c){const _0x348d4b=a247_0x4a1ffd,_0x974a23=_0x2e540c['flag']('db-id');if(typeof _0x974a23==='number'&&Number[_0x348d4b(0xfc)](_0x974a23))return _0x974a23;return undefined;}
@@ -1 +1 @@
1
- function a248_0x22ca(){const _0x194ad5=['sql','high-risk-write','1390732VxMAxu','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','lastSync','validation','1773mIVVra','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','60765XAZcVz','toISOString','lockFilePath','483304hQhUwq','3965124Evyzku','sqls','delete','entries','fromEntries','filter','91cBwiRx','\x20(local\x20file\x20moved\x20to\x20trash)','Deleted\x20','appCode','101330lKDkJZ','replace','projectRoot','1789912gATQju','remoteId','SQL\x20lock\x20file\x20not\x20found.','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','length','3kvLDkv','POST','2332030NMgRqk','Would\x20delete\x20SQL\x20','str','trashDir','sqlcode','sqlRoot'];a248_0x22ca=function(){return _0x194ad5;};return a248_0x22ca();}const a248_0x2b6cea=a248_0x5df9;(function(_0x587733,_0x19a8d1){const _0x49b1ee=a248_0x5df9,_0x1e22b1=_0x587733();while(!![]){try{const _0x67156c=parseInt(_0x49b1ee(0x9a))/0x1+parseInt(_0x49b1ee(0xab))/0x2*(-parseInt(_0x49b1ee(0x8a))/0x3)+parseInt(_0x49b1ee(0x94))/0x4+parseInt(_0x49b1ee(0x8c))/0x5+-parseInt(_0x49b1ee(0x9e))/0x6+parseInt(_0x49b1ee(0xa4))/0x7*(-parseInt(_0x49b1ee(0x9d))/0x8)+-parseInt(_0x49b1ee(0x98))/0x9*(-parseInt(_0x49b1ee(0xa8))/0xa);if(_0x67156c===_0x19a8d1)break;else _0x1e22b1['push'](_0x1e22b1['shift']());}catch(_0x22b85){_0x1e22b1['push'](_0x1e22b1['shift']());}}}(a248_0x22ca,0x815d4));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';function a248_0x5df9(_0xbe3e7,_0x293962){_0xbe3e7=_0xbe3e7-0x87;const _0x22ca27=a248_0x22ca();let _0x5df9a1=_0x22ca27[_0xbe3e7];return _0x5df9a1;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a248_0x2b6cea(0x92),'command':a248_0x2b6cea(0xa0),'description':'Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','risk':a248_0x2b6cea(0x93),'flags':[SQLCODE_FLAG],async 'validate'(_0x6b3316){const _0x4373a1=a248_0x2b6cea,_0x28493a=loadSqlProjectConfig(_0x6b3316[_0x4373a1(0xa7)]),_0x136115=await readSqlLockFile(_0x28493a[_0x4373a1(0x9c)]);if(!_0x136115)throw CliErrors[_0x4373a1(0x97)](_0x4373a1(0x99));},async 'dryRun'(_0x52a0fc){const _0x3d06fd=a248_0x2b6cea,_0x144da9=loadSqlProjectConfig(_0x52a0fc[_0x3d06fd(0xa7)]),_0x165d47=await readSqlLockFile(_0x144da9[_0x3d06fd(0x9c)]);if(!_0x165d47)throw CliErrors['validation'](_0x3d06fd(0x99));const {appLock:_0x903a6e}=ensureSqlLockScope(_0x165d47,_0x52a0fc[_0x3d06fd(0xa7)],_0x144da9[_0x3d06fd(0x91)],_0x3d06fd(0xa0)),_0x2bc135=_0x52a0fc[_0x3d06fd(0x8e)]('sqlcode'),_0x396aaa=_0x903a6e['sqls'][_0x2bc135];if(!_0x396aaa)throw CliErrors[_0x3d06fd(0x97)](_0x3d06fd(0x95)+_0x2bc135+'\x22.');return{'method':_0x3d06fd(0x8b),'url':'/smartapi/custom/deleteUserCustomSql','body':{'sqlCode':_0x2bc135,'id':_0x396aaa['remoteId'],'localPath':resolveLocalSqlFilePath(_0x144da9,_0x2bc135,_0x396aaa)},'description':_0x3d06fd(0x8d)+_0x2bc135+_0x3d06fd(0x88)+_0x144da9[_0x3d06fd(0x8f)]};},async 'execute'(_0x638d42){const _0x299607=a248_0x2b6cea,_0x2b5fa7=loadSqlProjectConfig(_0x638d42['appCode']),_0x15c654=await readSqlLockFile(_0x2b5fa7[_0x299607(0x9c)]);if(!_0x15c654)throw CliErrors[_0x299607(0x97)](_0x299607(0x87));const {lockData:_0x156cd5,appLock:_0x4afb13}=ensureSqlLockScope(_0x15c654,_0x638d42[_0x299607(0xa7)],_0x2b5fa7[_0x299607(0x91)],_0x299607(0xa0)),_0x47ebcf=_0x638d42['str'](_0x299607(0x90)),_0x563ab2=_0x4afb13[_0x299607(0x9f)][_0x47ebcf];if(!_0x563ab2)throw CliErrors[_0x299607(0x97)](_0x299607(0x95)+_0x47ebcf+'\x22.');await deleteSqlQuery({'id':_0x563ab2[_0x299607(0xac)],'sqlCode':_0x47ebcf}),_0x4afb13[_0x299607(0x9f)]=Object[_0x299607(0xa2)](Object[_0x299607(0xa1)](_0x4afb13[_0x299607(0x9f)])[_0x299607(0xa3)](([_0x9ff7d3])=>_0x9ff7d3!==_0x47ebcf)),_0x4afb13[_0x299607(0x96)]=new Date()[_0x299607(0x9b)](),await writeSqlLockFile(_0x2b5fa7[_0x299607(0x9c)],_0x156cd5);const _0x43fabc=resolveLocalSqlFilePath(_0x2b5fa7,_0x47ebcf,_0x563ab2);let _0xb2b557;await fileExists(_0x43fabc)&&(_0xb2b557=await moveToTrash(_0x2b5fa7[_0x299607(0xaa)],_0x2b5fa7[_0x299607(0x8f)],_0x43fabc),await cleanupEmptyDirectories(dirname(_0x43fabc),_0x2b5fa7['sqlRootDir']));const _0x142a64={'deleted':_0x47ebcf,'remoteId':_0x563ab2['remoteId']};if(_0xb2b557)_0x142a64['trashedTo']=_0xb2b557;return{'ok':!![],'data':_0x142a64,'message':_0x299607(0xa6)+_0x47ebcf+(_0xb2b557?_0x299607(0xa5):'')};}};async function moveToTrash(_0x524354,_0xe95b6,_0x579565){const _0x539af3=a248_0x2b6cea,_0x5685c2=new Date()[_0x539af3(0x9b)]()[_0x539af3(0xa9)](/[:.]/g,'-'),_0x598c59=relative(_0x524354,_0x579565),_0x3e7473=join(_0xe95b6,_0x5685c2,_0x598c59);return await mkdir(dirname(_0x3e7473),{'recursive':!![]}),await rename(_0x579565,_0x3e7473),_0x3e7473;}async function cleanupEmptyDirectories(_0x424ab8,_0x222dfe){const _0x15eb0c=a248_0x2b6cea;let _0x1dd459=resolve(_0x424ab8);const _0x45846f=resolve(_0x222dfe);while(_0x1dd459['startsWith'](''+_0x45846f+sep)||_0x1dd459===_0x45846f){if(_0x1dd459===_0x45846f)return;try{const _0x2e1a0f=await readdir(_0x1dd459);if(_0x2e1a0f[_0x15eb0c(0x89)]>0x0)return;await rmdir(_0x1dd459);}catch{return;}_0x1dd459=dirname(_0x1dd459);}}
1
+ const a248_0x38edc3=a248_0x332c;(function(_0x566d3a,_0x4dfc6a){const _0x3b2cae=a248_0x332c,_0x4fe06b=_0x566d3a();while(!![]){try{const _0xa60adb=parseInt(_0x3b2cae(0x172))/0x1+-parseInt(_0x3b2cae(0x187))/0x2+-parseInt(_0x3b2cae(0x183))/0x3+parseInt(_0x3b2cae(0x184))/0x4+-parseInt(_0x3b2cae(0x179))/0x5*(-parseInt(_0x3b2cae(0x169))/0x6)+parseInt(_0x3b2cae(0x168))/0x7*(parseInt(_0x3b2cae(0x17a))/0x8)+-parseInt(_0x3b2cae(0x16e))/0x9;if(_0xa60adb===_0x4dfc6a)break;else _0x4fe06b['push'](_0x4fe06b['shift']());}catch(_0x4852c9){_0x4fe06b['push'](_0x4fe06b['shift']());}}}(a248_0x51b4,0x43e72));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';function a248_0x332c(_0x138763,_0x245819){_0x138763=_0x138763-0x168;const _0x51b4f5=a248_0x51b4();let _0x332c22=_0x51b4f5[_0x138763];return _0x332c22;}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a248_0x51b4(){const _0x2c84fe=['sqlRoot','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','str','toISOString','projectRoot','\x20(local\x20file\x20moved\x20to\x20trash)','869270ZnDBAU','4456dlVYVz','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','delete','validation','trashDir','high-risk-write','POST','sqlRootDir','Would\x20delete\x20SQL\x20','163257rZBrkU','2087284yuuWrt','replace','/smartapi/custom/deleteUserCustomSql','343742MyoDWX','appCode','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','filter','6538CqnJwU','12QjLEbs','entries','sqlcode','lockFilePath','sqls','11025540HUYHTv','trashedTo','startsWith','length','339713jMAyLb'];a248_0x51b4=function(){return _0x2c84fe;};return a248_0x51b4();}import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':'sql','command':'delete','description':a248_0x38edc3(0x17b),'risk':a248_0x38edc3(0x17f),'flags':[SQLCODE_FLAG],async 'validate'(_0x394fb6){const _0x170f69=a248_0x38edc3,_0x2cce1f=loadSqlProjectConfig(_0x394fb6['appCode']),_0x48961b=await readSqlLockFile(_0x2cce1f[_0x170f69(0x16c)]);if(!_0x48961b)throw CliErrors['validation']('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');},async 'dryRun'(_0x529ebd){const _0x122889=a248_0x38edc3,_0x4ac8d2=loadSqlProjectConfig(_0x529ebd['appCode']),_0x182aee=await readSqlLockFile(_0x4ac8d2[_0x122889(0x16c)]);if(!_0x182aee)throw CliErrors[_0x122889(0x17d)](_0x122889(0x174));const {appLock:_0x3c24e6}=ensureSqlLockScope(_0x182aee,_0x529ebd[_0x122889(0x188)],_0x4ac8d2[_0x122889(0x173)],_0x122889(0x17c)),_0x3f324d=_0x529ebd['str']('sqlcode'),_0x576e49=_0x3c24e6['sqls'][_0x3f324d];if(!_0x576e49)throw CliErrors[_0x122889(0x17d)](_0x122889(0x189)+_0x3f324d+'\x22.');return{'method':_0x122889(0x180),'url':_0x122889(0x186),'body':{'sqlCode':_0x3f324d,'id':_0x576e49['remoteId'],'localPath':resolveLocalSqlFilePath(_0x4ac8d2,_0x3f324d,_0x576e49)},'description':_0x122889(0x182)+_0x3f324d+'\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20'+_0x4ac8d2[_0x122889(0x17e)]};},async 'execute'(_0x1b2de0){const _0x37b007=a248_0x38edc3,_0x53e004=loadSqlProjectConfig(_0x1b2de0['appCode']),_0x26a2d2=await readSqlLockFile(_0x53e004[_0x37b007(0x16c)]);if(!_0x26a2d2)throw CliErrors[_0x37b007(0x17d)]('SQL\x20lock\x20file\x20not\x20found.');const {lockData:_0x436759,appLock:_0x2fe35d}=ensureSqlLockScope(_0x26a2d2,_0x1b2de0[_0x37b007(0x188)],_0x53e004[_0x37b007(0x173)],_0x37b007(0x17c)),_0x20106a=_0x1b2de0[_0x37b007(0x175)](_0x37b007(0x16b)),_0x2737ad=_0x2fe35d[_0x37b007(0x16d)][_0x20106a];if(!_0x2737ad)throw CliErrors[_0x37b007(0x17d)](_0x37b007(0x189)+_0x20106a+'\x22.');await deleteSqlQuery({'id':_0x2737ad['remoteId'],'sqlCode':_0x20106a}),_0x2fe35d[_0x37b007(0x16d)]=Object['fromEntries'](Object[_0x37b007(0x16a)](_0x2fe35d['sqls'])[_0x37b007(0x18a)](([_0x4083e7])=>_0x4083e7!==_0x20106a)),_0x2fe35d['lastSync']=new Date()[_0x37b007(0x176)](),await writeSqlLockFile(_0x53e004[_0x37b007(0x16c)],_0x436759);const _0x1eab00=resolveLocalSqlFilePath(_0x53e004,_0x20106a,_0x2737ad);let _0x3a9504;await fileExists(_0x1eab00)&&(_0x3a9504=await moveToTrash(_0x53e004[_0x37b007(0x177)],_0x53e004[_0x37b007(0x17e)],_0x1eab00),await cleanupEmptyDirectories(dirname(_0x1eab00),_0x53e004[_0x37b007(0x181)]));const _0x24a32e={'deleted':_0x20106a,'remoteId':_0x2737ad['remoteId']};if(_0x3a9504)_0x24a32e[_0x37b007(0x16f)]=_0x3a9504;return{'ok':!![],'data':_0x24a32e,'message':'Deleted\x20'+_0x20106a+(_0x3a9504?_0x37b007(0x178):'')};}};async function moveToTrash(_0xf6341,_0x3f0c0f,_0x28bf59){const _0x227618=a248_0x38edc3,_0x4d2f95=new Date()[_0x227618(0x176)]()[_0x227618(0x185)](/[:.]/g,'-'),_0x2cd2d8=relative(_0xf6341,_0x28bf59),_0x57dd24=join(_0x3f0c0f,_0x4d2f95,_0x2cd2d8);return await mkdir(dirname(_0x57dd24),{'recursive':!![]}),await rename(_0x28bf59,_0x57dd24),_0x57dd24;}async function cleanupEmptyDirectories(_0x4ac953,_0x579df0){const _0x2b6be9=a248_0x38edc3;let _0xcd42=resolve(_0x4ac953);const _0x28fc4e=resolve(_0x579df0);while(_0xcd42[_0x2b6be9(0x170)](''+_0x28fc4e+sep)||_0xcd42===_0x28fc4e){if(_0xcd42===_0x28fc4e)return;try{const _0x370318=await readdir(_0xcd42);if(_0x370318[_0x2b6be9(0x171)]>0x0)return;await rmdir(_0xcd42);}catch{return;}_0xcd42=dirname(_0xcd42);}}
@@ -1 +1 @@
1
- const a249_0x30edba=a249_0x1efb;(function(_0x4b5f66,_0x1bd31b){const _0x57a637=a249_0x1efb,_0x2e55c2=_0x4b5f66();while(!![]){try{const _0x50f8df=parseInt(_0x57a637(0xe7))/0x1+-parseInt(_0x57a637(0xe2))/0x2+parseInt(_0x57a637(0xe8))/0x3*(parseInt(_0x57a637(0xec))/0x4)+parseInt(_0x57a637(0xeb))/0x5+-parseInt(_0x57a637(0xde))/0x6+-parseInt(_0x57a637(0xed))/0x7+parseInt(_0x57a637(0xea))/0x8;if(_0x50f8df===_0x1bd31b)break;else _0x2e55c2['push'](_0x2e55c2['shift']());}catch(_0x1e3e5c){_0x2e55c2['push'](_0x2e55c2['shift']());}}}(a249_0x3b8b,0x471f6));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a249_0x1efb(_0x13a89e,_0x38d9f8){_0x13a89e=_0x13a89e-0xde;const _0x3b8b40=a249_0x3b8b();let _0x1efb8b=_0x3b8b40[_0x13a89e];return _0x1efb8b;}function a249_0x3b8b(){const _0x8dd7a5=['description','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','read','445931ugHjnq','3ipLPqN','detail','4902792klgwJy','520230MqXTkh','715784xcYojg','2616523eKCISW','1286886zoLPBJ','verbose','appCode','dbId','924368fGxagH','str'];a249_0x3b8b=function(){return _0x8dd7a5;};return a249_0x3b8b();}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':'sql','command':a249_0x30edba(0xe9),'description':a249_0x30edba(0xe5),'risk':a249_0x30edba(0xe6),'flags':[SQLCODE_FLAG,{'name':a249_0x30edba(0xdf),'type':'boolean','description':'Return\x20full\x20raw\x20SQL\x20query\x20object'}],async 'execute'(_0x55ee43){const _0x13abc7=a249_0x30edba,_0xc5b652=await getSqlQueryInfo(_0x55ee43[_0x13abc7(0xe0)],_0x55ee43[_0x13abc7(0xe3)]('sqlcode')),_0x1cfb39=_0x55ee43['bool'](_0x13abc7(0xdf));if(_0x1cfb39)return{'ok':!![],'data':_0xc5b652};const _0x2b3da5=_0xc5b652['dbId']?await getDbName(_0x55ee43['appCode'],_0xc5b652[_0x13abc7(0xe1)]):undefined;return{'ok':!![],'data':{'sqlCode':_0xc5b652['sqlCode'],'sqlName':_0xc5b652['sqlName'],'db':_0x2b3da5?_0x2b3da5+'\x20('+_0xc5b652[_0x13abc7(0xe1)]+')':_0xc5b652[_0x13abc7(0xe1)]??'','description':_0xc5b652[_0x13abc7(0xe4)]??'','sqlContent':_0xc5b652['sqlContent']??''}};}};
1
+ const a249_0x2038f1=a249_0x4abe;(function(_0x1450d2,_0x35c20a){const _0x47a9ff=a249_0x4abe,_0x476c3d=_0x1450d2();while(!![]){try{const _0x44dd3a=-parseInt(_0x47a9ff(0xd4))/0x1*(-parseInt(_0x47a9ff(0xc9))/0x2)+-parseInt(_0x47a9ff(0xdd))/0x3+-parseInt(_0x47a9ff(0xca))/0x4*(-parseInt(_0x47a9ff(0xcc))/0x5)+-parseInt(_0x47a9ff(0xcd))/0x6+parseInt(_0x47a9ff(0xd7))/0x7*(parseInt(_0x47a9ff(0xce))/0x8)+parseInt(_0x47a9ff(0xd6))/0x9*(parseInt(_0x47a9ff(0xdb))/0xa)+-parseInt(_0x47a9ff(0xcf))/0xb;if(_0x44dd3a===_0x35c20a)break;else _0x476c3d['push'](_0x476c3d['shift']());}catch(_0x39cc09){_0x476c3d['push'](_0x476c3d['shift']());}}}(a249_0x4dc8,0x71adb));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a249_0x4abe(_0x53fecf,_0x3cc8c5){_0x53fecf=_0x53fecf-0xc9;const _0x4dc881=a249_0x4dc8();let _0x4abeb1=_0x4dc881[_0x53fecf];return _0x4abeb1;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a249_0x2038f1(0xdc),'command':a249_0x2038f1(0xd8),'description':a249_0x2038f1(0xcb),'risk':a249_0x2038f1(0xdf),'flags':[SQLCODE_FLAG,{'name':a249_0x2038f1(0xde),'type':a249_0x2038f1(0xd1),'description':a249_0x2038f1(0xd0)}],async 'execute'(_0xbd28ab){const _0x21bf6d=a249_0x2038f1,_0x205618=await getSqlQueryInfo(_0xbd28ab['appCode'],_0xbd28ab['str']('sqlcode')),_0x3b2488=_0xbd28ab[_0x21bf6d(0xd3)](_0x21bf6d(0xde));if(_0x3b2488)return{'ok':!![],'data':_0x205618};const _0x462f47=_0x205618[_0x21bf6d(0xd9)]?await getDbName(_0xbd28ab[_0x21bf6d(0xda)],_0x205618['dbId']):undefined;return{'ok':!![],'data':{'sqlCode':_0x205618['sqlCode'],'sqlName':_0x205618[_0x21bf6d(0xd2)],'db':_0x462f47?_0x462f47+'\x20('+_0x205618[_0x21bf6d(0xd9)]+')':_0x205618[_0x21bf6d(0xd9)]??'','description':_0x205618[_0x21bf6d(0xd5)]??'','sqlContent':_0x205618['sqlContent']??''}};}};function a249_0x4dc8(){const _0x2398f9=['23626uvBtMN','124YaaSqp','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','106395TtKAny','3104838oeyNpO','190752HTqrbi','19980939RMzpnH','Return\x20full\x20raw\x20SQL\x20query\x20object','boolean','sqlName','bool','57tYEIUO','description','5517fZTcAE','217FDStGB','detail','dbId','appCode','13620puhyuJ','sql','322533vGzzIq','verbose','read'];a249_0x4dc8=function(){return _0x2398f9;};return a249_0x4dc8();}
@@ -1 +1 @@
1
- const a250_0x391d29=a250_0x3e93;(function(_0x42d6b3,_0x36c417){const _0x4e04ed=a250_0x3e93,_0x275732=_0x42d6b3();while(!![]){try{const _0x266357=parseInt(_0x4e04ed(0x12f))/0x1*(parseInt(_0x4e04ed(0x13d))/0x2)+-parseInt(_0x4e04ed(0x132))/0x3*(-parseInt(_0x4e04ed(0x137))/0x4)+-parseInt(_0x4e04ed(0x128))/0x5*(parseInt(_0x4e04ed(0x124))/0x6)+parseInt(_0x4e04ed(0x13b))/0x7+parseInt(_0x4e04ed(0x127))/0x8+parseInt(_0x4e04ed(0x12a))/0x9+-parseInt(_0x4e04ed(0x125))/0xa;if(_0x266357===_0x36c417)break;else _0x275732['push'](_0x275732['shift']());}catch(_0x4f932f){_0x275732['push'](_0x275732['shift']());}}}(a250_0xba25,0xe61a4));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a250_0x3e93(_0xdb417c,_0x453346){_0xdb417c=_0xdb417c-0x124;const _0xba2525=a250_0xba25();let _0x3e9337=_0xba2525[_0xdb417c];return _0x3e9337;}import{parseJsonParams}from'../../utils/params.js';function a250_0xba25(){const _0x1ee9b1=['exec','100047BBsZUK','str','appCode','Returned\x20','execResult','16HSgoaf','read','execSuccess','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','12718482OOtPzR','params','38IRQQDu','6FqSJpr','17437050nSgBII','SQL\x20execution\x20failed','4763272wQKHxL','4059300SdOujR','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','7611525dBUBCz','length','sqlcode','now','isArray','5611GpKnGr','sql'];a250_0xba25=function(){return _0x1ee9b1;};return a250_0xba25();}export const sqlExec={'service':a250_0x391d29(0x130),'command':a250_0x391d29(0x131),'description':a250_0x391d29(0x129),'risk':a250_0x391d29(0x138),'flags':[SQLCODE_FLAG,{'name':a250_0x391d29(0x13c),'type':'string','description':a250_0x391d29(0x13a)}],async 'execute'(_0x364a62){const _0x2b2195=a250_0x391d29,_0x1c2a7d=parseJsonParams(_0x364a62[_0x2b2195(0x133)](_0x2b2195(0x13c))),_0x244475=Date[_0x2b2195(0x12d)](),_0x31d9e3=await executeSql(_0x364a62[_0x2b2195(0x134)],_0x364a62[_0x2b2195(0x133)](_0x2b2195(0x12c)),_0x1c2a7d),_0x2dbc84=Date[_0x2b2195(0x12d)]()-_0x244475,_0x4c3fbc=_0x31d9e3?.[_0x2b2195(0x136)]??_0x31d9e3,_0x192c0a=_0x31d9e3?.[_0x2b2195(0x139)]??!![];if(!_0x192c0a)return{'ok':![],'data':{'error':_0x31d9e3?.['execError']||_0x2b2195(0x126),'elapsed':_0x2dbc84},'message':_0x2b2195(0x126)};const _0x512867=Array[_0x2b2195(0x12e)](_0x4c3fbc)?_0x4c3fbc:[];return{'ok':!![],'data':{'rows':_0x512867,'rowCount':_0x512867[_0x2b2195(0x12b)],'elapsed':_0x2dbc84},'message':_0x2b2195(0x135)+_0x512867['length']+'\x20row(s)\x20in\x20'+_0x2dbc84+'ms'};}};
1
+ const a250_0x4c5090=a250_0x3a2f;function a250_0x3a2f(_0x33f61e,_0x2dc5da){_0x33f61e=_0x33f61e-0x94;const _0x577b9f=a250_0x577b();let _0x3a2f88=_0x577b9f[_0x33f61e];return _0x3a2f88;}(function(_0x27c742,_0x800277){const _0x2dc2b7=a250_0x3a2f,_0x2cf7b8=_0x27c742();while(!![]){try{const _0x2cf19a=parseInt(_0x2dc2b7(0x9d))/0x1*(-parseInt(_0x2dc2b7(0x98))/0x2)+parseInt(_0x2dc2b7(0x96))/0x3+parseInt(_0x2dc2b7(0x9f))/0x4+-parseInt(_0x2dc2b7(0xab))/0x5*(-parseInt(_0x2dc2b7(0x9b))/0x6)+parseInt(_0x2dc2b7(0x9a))/0x7*(-parseInt(_0x2dc2b7(0x9e))/0x8)+parseInt(_0x2dc2b7(0xa4))/0x9+parseInt(_0x2dc2b7(0xa1))/0xa*(-parseInt(_0x2dc2b7(0x9c))/0xb);if(_0x2cf19a===_0x800277)break;else _0x2cf7b8['push'](_0x2cf7b8['shift']());}catch(_0x137222){_0x2cf7b8['push'](_0x2cf7b8['shift']());}}}(a250_0x577b,0xbf3ac));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a250_0x577b(){const _0x92629b=['SQL\x20execution\x20failed','length','11861604dqRGyh','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','appCode','str','string','execSuccess','20EEzWXv','isArray','exec','2161773cMWSOT','params','406vGGnbr','now','105atjXZS','788928lVKsNo','5203LxqAhs','409lrvyVP','474104BgXgyv','5772700FlcDMs','sql','47620nXjEPe'];a250_0x577b=function(){return _0x92629b;};return a250_0x577b();}import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a250_0x4c5090(0xa0),'command':a250_0x4c5090(0x95),'description':a250_0x4c5090(0xa6),'risk':'read','flags':[SQLCODE_FLAG,{'name':a250_0x4c5090(0x97),'type':a250_0x4c5090(0xa9),'description':a250_0x4c5090(0xa5)}],async 'execute'(_0x290ce5){const _0x4898db=a250_0x4c5090,_0x2db242=parseJsonParams(_0x290ce5[_0x4898db(0xa8)](_0x4898db(0x97))),_0x16ce6f=Date[_0x4898db(0x99)](),_0x375093=await executeSql(_0x290ce5[_0x4898db(0xa7)],_0x290ce5[_0x4898db(0xa8)]('sqlcode'),_0x2db242),_0x180deb=Date['now']()-_0x16ce6f,_0x2f3236=_0x375093?.['execResult']??_0x375093,_0x5d5310=_0x375093?.[_0x4898db(0xaa)]??!![];if(!_0x5d5310)return{'ok':![],'data':{'error':_0x375093?.['execError']||_0x4898db(0xa2),'elapsed':_0x180deb},'message':_0x4898db(0xa2)};const _0x771224=Array[_0x4898db(0x94)](_0x2f3236)?_0x2f3236:[];return{'ok':!![],'data':{'rows':_0x771224,'rowCount':_0x771224[_0x4898db(0xa3)],'elapsed':_0x180deb},'message':'Returned\x20'+_0x771224[_0x4898db(0xa3)]+'\x20row(s)\x20in\x20'+_0x180deb+'ms'};}};
@@ -1 +1 @@
1
- function a251_0x3c22(_0x4cc417,_0x23c5c1){_0x4cc417=_0x4cc417-0x6d;const _0x406f4c=a251_0x406f();let _0x3c223b=_0x406f4c[_0x4cc417];return _0x3c223b;}(function(_0x4913ea,_0x5b5a90){const _0x4013d9=a251_0x3c22,_0x2b31f6=_0x4913ea();while(!![]){try{const _0x2003b8=parseInt(_0x4013d9(0x77))/0x1+parseInt(_0x4013d9(0x6e))/0x2*(-parseInt(_0x4013d9(0x6d))/0x3)+parseInt(_0x4013d9(0x72))/0x4*(-parseInt(_0x4013d9(0x70))/0x5)+-parseInt(_0x4013d9(0x73))/0x6+-parseInt(_0x4013d9(0x75))/0x7*(parseInt(_0x4013d9(0x71))/0x8)+parseInt(_0x4013d9(0x74))/0x9*(-parseInt(_0x4013d9(0x76))/0xa)+parseInt(_0x4013d9(0x6f))/0xb;if(_0x2003b8===_0x5b5a90)break;else _0x2b31f6['push'](_0x2b31f6['shift']());}catch(_0x447437){_0x2b31f6['push'](_0x2b31f6['shift']());}}}(a251_0x406f,0xe13bc));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 a251_0x406f(){const _0x1a7641=['162099mNhzAO','882EVHzJr','230exLkJQ','1508174jWoIrd','6TyqPxJ','497966TDFkog','30720140FQWwDJ','4360paRMPr','1112HKPwXb','6652AMpntt','5990934DjAxOy'];a251_0x406f=function(){return _0x1a7641;};return a251_0x406f();}export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
1
+ (function(_0x5ae38e,_0x9230d4){const _0x55bd4b=a251_0x1ebf,_0x23512e=_0x5ae38e();while(!![]){try{const _0x1a4e63=-parseInt(_0x55bd4b(0x139))/0x1+parseInt(_0x55bd4b(0x13b))/0x2*(parseInt(_0x55bd4b(0x13c))/0x3)+-parseInt(_0x55bd4b(0x13f))/0x4+parseInt(_0x55bd4b(0x138))/0x5+parseInt(_0x55bd4b(0x13a))/0x6+parseInt(_0x55bd4b(0x13e))/0x7+parseInt(_0x55bd4b(0x13d))/0x8;if(_0x1a4e63===_0x9230d4)break;else _0x23512e['push'](_0x23512e['shift']());}catch(_0x355161){_0x23512e['push'](_0x23512e['shift']());}}}(a251_0x5ef6,0xbd3b2));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';function a251_0x5ef6(){const _0xe29069=['1358644BPBKIK','4135412mwlHJl','3318820rIReTm','1301267zGPDag','3684102cLpUtw','248eVMGZa','30177yEYjRp','3128168puSpKi'];a251_0x5ef6=function(){return _0xe29069;};return a251_0x5ef6();}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 a251_0x1ebf(_0x5ef449,_0x53dca1){_0x5ef449=_0x5ef449-0x138;const _0x5ef686=a251_0x5ef6();let _0x1ebffb=_0x5ef686[_0x5ef449];return _0x1ebffb;}export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
@@ -1 +1 @@
1
- const a252_0x5c60bc=a252_0x3a5e;(function(_0x4602c4,_0x516e4e){const _0x33a47b=a252_0x3a5e,_0x18bfb6=_0x4602c4();while(!![]){try{const _0x31d1e2=-parseInt(_0x33a47b(0x13f))/0x1*(-parseInt(_0x33a47b(0x14d))/0x2)+-parseInt(_0x33a47b(0x146))/0x3+-parseInt(_0x33a47b(0x157))/0x4+-parseInt(_0x33a47b(0x143))/0x5+-parseInt(_0x33a47b(0x14e))/0x6+-parseInt(_0x33a47b(0x158))/0x7*(parseInt(_0x33a47b(0x148))/0x8)+parseInt(_0x33a47b(0x141))/0x9*(parseInt(_0x33a47b(0x15b))/0xa);if(_0x31d1e2===_0x516e4e)break;else _0x18bfb6['push'](_0x18bfb6['shift']());}catch(_0x2a2a84){_0x18bfb6['push'](_0x18bfb6['shift']());}}}(a252_0x8bf8,0x671e2));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a252_0x8bf8(){const _0x5bf0b4=['str','214600wAcjFN','34097xuDMzA','num','Found\x20','10TVXgrX','dbId','number','description','boolean','51HYoDAX','length','16984197uQUWXe','pagesize','687435mGeeFb','name','No\x20custom\x20SQL\x20queries\x20found.','2320353SIZenp','appCode','928sdOhMB','bool','list','sqlCode','Page\x20number','12946skwHhn','1591572iBBpPZ','verbose','totalCount','page','all','sqlcode','\x20SQL\x20queries\x20(total:\x20','Filter\x20by\x20SQL\x20name'];a252_0x8bf8=function(){return _0x5bf0b4;};return a252_0x8bf8();}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a252_0x3a5e(_0x66ded6,_0x1bcb30){_0x66ded6=_0x66ded6-0x13c;const _0x8bf864=a252_0x8bf8();let _0x3a5e68=_0x8bf864[_0x66ded6];return _0x3a5e68;}export const sqlList={'service':'sql','command':a252_0x5c60bc(0x14a),'description':'List\x20custom\x20SQL\x20queries','risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a252_0x5c60bc(0x144),'type':'string','description':a252_0x5c60bc(0x155)},{'name':a252_0x5c60bc(0x151),'type':'number','description':a252_0x5c60bc(0x14c),'default':0x1},{'name':a252_0x5c60bc(0x142),'type':a252_0x5c60bc(0x13c),'description':'Page\x20size'},{'name':a252_0x5c60bc(0x14f),'type':a252_0x5c60bc(0x13e),'description':'Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content'}],async 'execute'(_0x88a05c){const _0x9f94a=a252_0x5c60bc,_0x5b975f=await listSqlQueries(_0x88a05c[_0x9f94a(0x147)],{'sqlCode':_0x88a05c[_0x9f94a(0x156)](_0x9f94a(0x153))||undefined,'sqlName':_0x88a05c[_0x9f94a(0x156)](_0x9f94a(0x144))||undefined,'currentPage':_0x88a05c[_0x9f94a(0x159)](_0x9f94a(0x151)),'pageSize':_0x88a05c['num'](_0x9f94a(0x142),0x32)}),_0x52d7de=_0x88a05c[_0x9f94a(0x149)]('verbose'),_0x43364f=_0x5b975f['tableData']??[],_0x4a7078=_0x5b975f['paging']?.[_0x9f94a(0x150)]??_0x43364f['length'];let _0x1cc5ca;return _0x52d7de?_0x1cc5ca=_0x43364f:_0x1cc5ca=await Promise[_0x9f94a(0x152)](_0x43364f['map'](async _0x4d5eab=>{const _0x6c232d=_0x9f94a;let _0x51d6c0;try{_0x51d6c0=_0x4d5eab[_0x6c232d(0x15c)]?await getDbName(_0x88a05c[_0x6c232d(0x147)],_0x4d5eab[_0x6c232d(0x15c)]):undefined;}catch{}return{'sqlCode':_0x4d5eab[_0x6c232d(0x14b)],'sqlName':_0x4d5eab['sqlName'],'description':_0x4d5eab[_0x6c232d(0x13d)]??'','db':_0x51d6c0?_0x51d6c0+'\x20('+_0x4d5eab[_0x6c232d(0x15c)]+')':_0x4d5eab['dbId']??''};})),{'ok':!![],'data':_0x1cc5ca,'message':_0x43364f[_0x9f94a(0x140)]===0x0?_0x9f94a(0x145):_0x9f94a(0x15a)+_0x43364f[_0x9f94a(0x140)]+_0x9f94a(0x154)+_0x4a7078+').'};}};
1
+ const a252_0x126c6c=a252_0x54aa;(function(_0x3d199d,_0xa8282){const _0x6fba58=a252_0x54aa,_0x3f0944=_0x3d199d();while(!![]){try{const _0x4780b2=-parseInt(_0x6fba58(0xec))/0x1+-parseInt(_0x6fba58(0xf4))/0x2*(-parseInt(_0x6fba58(0xef))/0x3)+parseInt(_0x6fba58(0xe8))/0x4*(parseInt(_0x6fba58(0xfb))/0x5)+-parseInt(_0x6fba58(0xe7))/0x6*(parseInt(_0x6fba58(0xfa))/0x7)+-parseInt(_0x6fba58(0x106))/0x8+parseInt(_0x6fba58(0xea))/0x9+parseInt(_0x6fba58(0xeb))/0xa*(parseInt(_0x6fba58(0xf8))/0xb);if(_0x4780b2===_0xa8282)break;else _0x3f0944['push'](_0x3f0944['shift']());}catch(_0x472b84){_0x3f0944['push'](_0x3f0944['shift']());}}}(a252_0x3d30,0xed129));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a252_0x54aa(_0x32880a,_0x50461d){_0x32880a=_0x32880a-0xe3;const _0x3d3048=a252_0x3d30();let _0x54aa10=_0x3d3048[_0x32880a];return _0x54aa10;}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a252_0x3d30(){const _0x2f8207=['bool','7207016JTeWQj','dbId','verbose','Page\x20number','page','6KyiiRO','234188YkiLjk','name','2861604zeUBmI','6775390avoezF','1257896sDjLFF','Filter\x20by\x20SQL\x20name','pagesize','41322JtKMZM','tableData','paging','num','description','88CIAoCC','str','boolean','sqlName','33wpOBaN','length','836794AMrFPu','25zbDjyV','sqlCode','sqlcode','read','No\x20custom\x20SQL\x20queries\x20found.','number','appCode','List\x20custom\x20SQL\x20queries','Page\x20size','\x20SQL\x20queries\x20(total:\x20'];a252_0x3d30=function(){return _0x2f8207;};return a252_0x3d30();}export const sqlList={'service':'sql','command':'list','description':a252_0x126c6c(0x102),'risk':a252_0x126c6c(0xfe),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a252_0x126c6c(0xe9),'type':'string','description':a252_0x126c6c(0xed)},{'name':a252_0x126c6c(0xe6),'type':a252_0x126c6c(0x100),'description':a252_0x126c6c(0xe5),'default':0x1},{'name':a252_0x126c6c(0xee),'type':a252_0x126c6c(0x100),'description':a252_0x126c6c(0x103)},{'name':a252_0x126c6c(0xe4),'type':a252_0x126c6c(0xf6),'description':'Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content'}],async 'execute'(_0x16c9e2){const _0x5d9356=a252_0x126c6c,_0x54c981=await listSqlQueries(_0x16c9e2[_0x5d9356(0x101)],{'sqlCode':_0x16c9e2[_0x5d9356(0xf5)](_0x5d9356(0xfd))||undefined,'sqlName':_0x16c9e2[_0x5d9356(0xf5)](_0x5d9356(0xe9))||undefined,'currentPage':_0x16c9e2[_0x5d9356(0xf2)](_0x5d9356(0xe6)),'pageSize':_0x16c9e2[_0x5d9356(0xf2)](_0x5d9356(0xee),0x32)}),_0xed7157=_0x16c9e2[_0x5d9356(0x105)](_0x5d9356(0xe4)),_0x4065a7=_0x54c981[_0x5d9356(0xf0)]??[],_0x29e0ba=_0x54c981[_0x5d9356(0xf1)]?.['totalCount']??_0x4065a7['length'];let _0x59ac27;return _0xed7157?_0x59ac27=_0x4065a7:_0x59ac27=await Promise['all'](_0x4065a7['map'](async _0x45d708=>{const _0x35f0d6=_0x5d9356;let _0x245735;try{_0x245735=_0x45d708[_0x35f0d6(0xe3)]?await getDbName(_0x16c9e2['appCode'],_0x45d708[_0x35f0d6(0xe3)]):undefined;}catch{}return{'sqlCode':_0x45d708[_0x35f0d6(0xfc)],'sqlName':_0x45d708[_0x35f0d6(0xf7)],'description':_0x45d708[_0x35f0d6(0xf3)]??'','db':_0x245735?_0x245735+'\x20('+_0x45d708[_0x35f0d6(0xe3)]+')':_0x45d708[_0x35f0d6(0xe3)]??''};})),{'ok':!![],'data':_0x59ac27,'message':_0x4065a7[_0x5d9356(0xf9)]===0x0?_0x5d9356(0xff):'Found\x20'+_0x4065a7[_0x5d9356(0xf9)]+_0x5d9356(0x104)+_0x29e0ba+').'};}};
@@ -1 +1 @@
1
- const a253_0x54315f=a253_0xf02c;(function(_0x133f2e,_0x312ece){const _0x1dc161=a253_0xf02c,_0x98c168=_0x133f2e();while(!![]){try{const _0x34de48=parseInt(_0x1dc161(0x1e8))/0x1*(-parseInt(_0x1dc161(0x1c1))/0x2)+parseInt(_0x1dc161(0x1d8))/0x3*(parseInt(_0x1dc161(0x1bc))/0x4)+parseInt(_0x1dc161(0x1f3))/0x5+-parseInt(_0x1dc161(0x1da))/0x6*(parseInt(_0x1dc161(0x1f7))/0x7)+parseInt(_0x1dc161(0x1f2))/0x8+parseInt(_0x1dc161(0x1b6))/0x9+-parseInt(_0x1dc161(0x1df))/0xa;if(_0x34de48===_0x312ece)break;else _0x98c168['push'](_0x98c168['shift']());}catch(_0x278216){_0x98c168['push'](_0x98c168['shift']());}}}(a253_0x3473,0x6f5b4));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';function a253_0x3473(){const _0x1127da=['str','2860DRIbuT','utf8','Force\x20pull\x20cancelled.','appCode','POST','1593214ZdVOgt','unchanged','some','endsWith','apps','hash','catch','sqlRoot','sqlCode','filter','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','message','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','find','mybatisXml','isCanonical','Force\x20overwrite\x20local\x20unsynced\x20changes','trim','sqlName','lockFilePath','tableData','push','string','822nzDCTL','bool','12cScqgd','path','lastSync','filePath','totalCount','2484600rzWXFN','content','.xml','Filter\x20by\x20SQL\x20display\x20name','dbId','read','Would\x20pull\x20','map','equivalent','1varPVW','sqlContent','force','pull','skipped','toISOString','sql','sqlcode','local\x20differs\x20from\x20remote','nonInteractive','5299600MxseaZ','2953020wfUXrW','No\x20remote\x20SQL\x20queries\x20matched.','test','\x20skipped,\x20','282499UgpBpX','would_pull','cancelled','name','sqlRootDir','conflict','split','description','replace','\x20SQL\x20file(s)\x20into\x20','\x20failed','all','1196397EqmiSz','mode','length','file','sqls'];a253_0x3473=function(){return _0x1127da;};return a253_0x3473();}function a253_0xf02c(_0x277ec0,_0x4d15fa){_0x277ec0=_0x277ec0-0x1ad;const _0x3473c3=a253_0x3473();let _0xf02c13=_0x3473c3[_0x277ec0];return _0xf02c13;}import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{detectSqlMode}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x966bb6,_0x1e3011){const _0x45c208=a253_0xf02c,_0x49ffc4=[];let _0xd420f1=0x1;while(!![]){const _0x3e71bc=await listSqlQueries(_0x966bb6,{'currentPage':_0xd420f1,'pageSize':PAGE_SIZE,'sqlCode':_0x1e3011[_0x45c208(0x1c9)],'sqlName':_0x1e3011['sqlName']}),_0x32c43f=_0x3e71bc[_0x45c208(0x1d5)]??[];_0x49ffc4[_0x45c208(0x1d6)](..._0x32c43f);if(_0x32c43f[_0x45c208(0x1b8)]===0x0)break;const _0x55c663=_0x3e71bc['paging']?.[_0x45c208(0x1de)];if(_0x55c663!=null?_0x49ffc4['length']>=_0x55c663:_0x32c43f[_0x45c208(0x1b8)]<PAGE_SIZE)break;_0xd420f1++;}return _0x49ffc4;}async function ensureSqlContent(_0x5b967a){const _0x102a85=a253_0xf02c;if(_0x5b967a[_0x102a85(0x1e9)]!=null&&String(_0x5b967a[_0x102a85(0x1e9)])[_0x102a85(0x1b8)]>0x0)return _0x5b967a;return getSqlQueryDetail(_0x5b967a[_0x102a85(0x1c9)]);}export const sqlPull={'service':'sql','command':'pull','description':a253_0x54315f(0x1cb),'risk':a253_0x54315f(0x1e4),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a253_0x54315f(0x1ad),'type':a253_0x54315f(0x1d7),'description':a253_0x54315f(0x1e2)},{'name':'force','type':'boolean','description':a253_0x54315f(0x1d1)}],async 'dryRun'(_0x542639){const _0x48154a=a253_0x54315f,_0x77299d=loadSqlProjectConfig(_0x542639[_0x48154a(0x1bf)]),_0x1876ce=await readSqlLockFile(_0x77299d[_0x48154a(0x1d4)]),{appLock:_0x25223d}=ensureSqlLockScope(_0x1876ce??createEmptySqlLock(),_0x77299d[_0x48154a(0x1bf)],_0x77299d[_0x48154a(0x1c8)],_0x48154a(0x1eb)),_0x1a04d8=await fetchAllSqlQueries(_0x542639[_0x48154a(0x1bf)],{'sqlCode':_0x542639['str']('sqlcode')||undefined,'sqlName':_0x542639[_0x48154a(0x1bb)](_0x48154a(0x1ad))||undefined}),_0x2c994b=[];for(const _0x5d421c of _0x1a04d8){const _0x2522ee=await ensureSqlContent(_0x5d421c),_0x12fc4f=ensureRemoteSqlContent(_0x2522ee),_0x537e66=detectSqlMode(_0x12fc4f),_0x4a415d=_0x2522ee[_0x48154a(0x1e3)]?await getDbName(_0x542639['appCode'],Number(_0x2522ee[_0x48154a(0x1e3)]))[_0x48154a(0x1c7)](()=>undefined):undefined,_0x2ff7c0=buildLocalSqlFileContent({'sqlCode':_0x2522ee[_0x48154a(0x1c9)],'sqlName':_0x2522ee[_0x48154a(0x1d3)],'dbId':_0x2522ee[_0x48154a(0x1e3)]},_0x12fc4f,{'dbName':_0x4a415d,'mode':_0x537e66,'syncedAt':new Date()[_0x48154a(0x1ed)](),'description':_0x2522ee[_0x48154a(0x1b1)]}),_0x58e6dd=buildSqlLockEntry(_0x2522ee,_0x12fc4f,'',{'dbName':_0x4a415d}),_0x1d7174=resolveLocalSqlFilePath(_0x77299d,_0x2522ee['sqlCode'],_0x58e6dd);let _0x11d23b=_0x48154a(0x1f8),_0x2f990c;const _0x486e07=await findExistingSqlFiles(_0x77299d,_0x1d7174,_0x537e66,_0x25223d['sqls'][_0x2522ee[_0x48154a(0x1c9)]]);if(_0x486e07[_0x48154a(0x1b8)]>0x0){const _0x2169ba=await compareExistingSqlFiles(_0x486e07,_0x2ff7c0,_0x537e66);if(_0x2169ba[_0x48154a(0x1c3)](({equivalent:_0x48ae74})=>!_0x48ae74))_0x11d23b=_0x48154a(0x1af),_0x2f990c=_0x48154a(0x1cd);else _0x2169ba[_0x48154a(0x1b8)]===0x1&&_0x2169ba[0x0]?.['file'][_0x48154a(0x1d0)]&&(_0x11d23b=_0x48154a(0x1ec),_0x2f990c=_0x48154a(0x1c2));}_0x2c994b[_0x48154a(0x1d6)]({'sqlCode':_0x2522ee[_0x48154a(0x1c9)],'sqlName':_0x2522ee[_0x48154a(0x1d3)],'filePath':_0x1d7174,'status':_0x11d23b,'reason':_0x2f990c});}return{'method':_0x48154a(0x1c0),'url':'/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','body':{'appCode':_0x542639['appCode'],'sqlCode':_0x542639[_0x48154a(0x1bb)](_0x48154a(0x1ef))||null,'sqlName':_0x542639[_0x48154a(0x1bb)]('name')||null,'files':_0x2c994b},'description':_0x48154a(0x1e5)+_0x2c994b[_0x48154a(0x1b8)]+_0x48154a(0x1b3)+_0x77299d['sqlRootDir']};},async 'execute'(_0x50fb0b){const _0xae9674=a253_0x54315f,_0x5466d4=loadSqlProjectConfig(_0x50fb0b['appCode']),_0x3b839b=await readSqlLockFile(_0x5466d4[_0xae9674(0x1d4)]),{lockData:_0x505221,appLock:_0x594035}=ensureSqlLockScope(_0x3b839b??createEmptySqlLock(),_0x5466d4[_0xae9674(0x1bf)],_0x5466d4[_0xae9674(0x1c8)],_0xae9674(0x1eb)),_0x2c91ca=_0x50fb0b[_0xae9674(0x1d9)](_0xae9674(0x1ea)),_0x2952e5=await fetchAllSqlQueries(_0x50fb0b[_0xae9674(0x1bf)],{'sqlCode':_0x50fb0b[_0xae9674(0x1bb)]('sqlcode')||undefined,'sqlName':_0x50fb0b[_0xae9674(0x1bb)](_0xae9674(0x1ad))||undefined});if(_0x2952e5['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0xae9674(0x1f4)};const _0x1d2f9d=[],_0x2bd77a=[];for(const _0x2fd113 of _0x2952e5){try{_0x1d2f9d[_0xae9674(0x1d6)](await ensureSqlContent(_0x2fd113));}catch(_0x534a1b){_0x2bd77a[_0xae9674(0x1d6)]({'sqlCode':_0x2fd113[_0xae9674(0x1c9)],'error':_0x534a1b instanceof Error?_0x534a1b[_0xae9674(0x1cc)]:String(_0x534a1b)});}}if(_0x2c91ca&&!_0x50fb0b[_0xae9674(0x1f1)]){let _0x45a882=![];for(const _0x12c1c0 of _0x1d2f9d){const _0x2a5cd5=detectSqlMode(ensureRemoteSqlContent(_0x12c1c0)),_0x1c7e93=_0x12c1c0[_0xae9674(0x1e3)]?await getDbName(_0x50fb0b['appCode'],Number(_0x12c1c0['dbId']))[_0xae9674(0x1c7)](()=>undefined):undefined,_0xd24204=buildLocalSqlFileContent({'sqlCode':_0x12c1c0['sqlCode'],'sqlName':_0x12c1c0[_0xae9674(0x1d3)],'dbId':_0x12c1c0[_0xae9674(0x1e3)]},ensureRemoteSqlContent(_0x12c1c0),{'dbName':_0x1c7e93,'mode':_0x2a5cd5,'syncedAt':new Date()['toISOString'](),'description':_0x12c1c0[_0xae9674(0x1b1)]}),_0x17ac17=resolveLocalSqlFilePath(_0x5466d4,_0x12c1c0['sqlCode'],buildSqlLockEntry(_0x12c1c0,ensureRemoteSqlContent(_0x12c1c0),'',{'dbName':_0x1c7e93})),_0x5d91b8=await findExistingSqlFiles(_0x5466d4,_0x17ac17,_0x2a5cd5,_0x594035[_0xae9674(0x1ba)][_0x12c1c0[_0xae9674(0x1c9)]]),_0xe92525=await compareExistingSqlFiles(_0x5d91b8,_0xd24204,_0x2a5cd5);if(_0xe92525[_0xae9674(0x1c3)](({equivalent:_0xa7db9})=>!_0xa7db9)){_0x45a882=!![];break;}}if(_0x45a882){const _0x3e1c69=await confirmForceOverwrite('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.');if(!_0x3e1c69)throw CliErrors[_0xae9674(0x1f9)](_0xae9674(0x1be));}}const _0x7c3d54=cloneSqlLockData(_0x505221),_0x42672d=_0x7c3d54[_0xae9674(0x1c5)][_0x5466d4[_0xae9674(0x1bf)]],_0x3c6f57=[],_0x277eff=[];for(const _0x24247d of _0x1d2f9d){const _0x51a589=_0x42672d[_0xae9674(0x1ba)][_0x24247d['sqlCode']],_0x1b9b3f=ensureRemoteSqlContent(_0x24247d),_0x3662e7=detectSqlMode(_0x1b9b3f),_0x1b2f05=_0x24247d[_0xae9674(0x1e3)]?await getDbName(_0x50fb0b[_0xae9674(0x1bf)],Number(_0x24247d[_0xae9674(0x1e3)]))[_0xae9674(0x1c7)](()=>undefined):undefined,_0x3ec067=buildLocalSqlFileContent({'sqlCode':_0x24247d[_0xae9674(0x1c9)],'sqlName':_0x24247d[_0xae9674(0x1d3)],'dbId':_0x24247d[_0xae9674(0x1e3)]},_0x1b9b3f,{'dbName':_0x1b2f05,'mode':_0x3662e7,'syncedAt':new Date()[_0xae9674(0x1ed)](),'description':_0x24247d[_0xae9674(0x1b1)]}),_0xd57b7f=buildSqlLockEntry(_0x24247d,_0x1b9b3f,computeSqlContentHash(_0x3ec067),{'dbName':_0x1b2f05}),_0x3f5671=_0xd57b7f[_0xae9674(0x1db)],_0x181edf=join(_0x5466d4['sqlRootDir'],_0x3f5671);try{const _0x33f592=await findExistingSqlFiles(_0x5466d4,_0x181edf,_0x3662e7,_0x51a589),_0x2196d9=await compareExistingSqlFiles(_0x33f592,_0x3ec067,_0x3662e7);if(!_0x2c91ca&&_0x2196d9[_0xae9674(0x1c3)](({equivalent:_0x591780})=>!_0x591780)){_0x277eff[_0xae9674(0x1d6)]({'sqlCode':_0x24247d['sqlCode'],'reason':_0xae9674(0x1f0)});continue;}const _0x4454f9=_0x2196d9[_0xae9674(0x1ce)](({file:_0x57b43d})=>_0x57b43d[_0xae9674(0x1d0)]),_0x2019a9=_0x2196d9[_0xae9674(0x1ce)](({file:_0x403a89})=>!_0x403a89[_0xae9674(0x1d0)]);if(_0x4454f9?.[_0xae9674(0x1e7)]&&!_0x2019a9){_0x277eff[_0xae9674(0x1d6)]({'sqlCode':_0x24247d['sqlCode'],'reason':_0xae9674(0x1c2)}),_0x42672d[_0xae9674(0x1ba)][_0x24247d[_0xae9674(0x1c9)]]={..._0xd57b7f,'hash':computeSqlContentHash(_0x4454f9[_0xae9674(0x1e0)]),'path':_0x3f5671};continue;}!_0x4454f9?.[_0xae9674(0x1e7)]&&(await ensureParentDirectory(_0x181edf),await writeFile(_0x181edf,_0x3ec067,_0xae9674(0x1bd))),_0x2019a9&&await rm(_0x2019a9[_0xae9674(0x1b9)][_0xae9674(0x1dd)],{'force':!![]}),_0x42672d[_0xae9674(0x1ba)][_0x24247d[_0xae9674(0x1c9)]]={..._0xd57b7f,'hash':_0x4454f9?.[_0xae9674(0x1e7)]?computeSqlContentHash(_0x4454f9[_0xae9674(0x1e0)]):_0xd57b7f[_0xae9674(0x1c6)],'path':_0x3f5671},_0x3c6f57[_0xae9674(0x1d6)]({'sqlCode':_0x24247d[_0xae9674(0x1c9)],'filePath':_0x181edf});}catch(_0x4957a9){_0x2bd77a[_0xae9674(0x1d6)]({'sqlCode':_0x24247d[_0xae9674(0x1c9)],'error':_0x4957a9 instanceof Error?_0x4957a9[_0xae9674(0x1cc)]:String(_0x4957a9)});}}return _0x42672d[_0xae9674(0x1dc)]=new Date()[_0xae9674(0x1ed)](),await writeSqlLockFile(_0x5466d4[_0xae9674(0x1d4)],_0x7c3d54),{'ok':_0x2bd77a[_0xae9674(0x1b8)]===0x0,'data':{'pulled':_0x3c6f57,'skipped':_0x277eff,'failed':_0x2bd77a},'message':'Pull\x20complete:\x20'+_0x3c6f57[_0xae9674(0x1b8)]+'\x20written,\x20'+_0x277eff[_0xae9674(0x1b8)]+_0xae9674(0x1f6)+_0x2bd77a[_0xae9674(0x1b8)]+_0xae9674(0x1b4)};}};function isEquivalentPulledSqlFile(_0x2989f3,_0x4a2d17,_0x5e0550,_0x61dbfe){if(_0x5e0550!==_0x61dbfe)return normalizePulledSqlBody(_0x2989f3,_0x5e0550)===normalizePulledSqlBody(_0x4a2d17,_0x61dbfe);return normalizePullComparableContent(_0x2989f3,_0x5e0550)===normalizePullComparableContent(_0x4a2d17,_0x61dbfe);}async function findExistingSqlFiles(_0x7dcf8,_0x179a0e,_0x20a627,_0x3d467a){const _0xa04a0b=a253_0x54315f,_0x3b8837=[];await fileExists(_0x179a0e)&&_0x3b8837[_0xa04a0b(0x1d6)]({'filePath':_0x179a0e,'mode':_0x20a627,'isCanonical':!![]});if(!_0x3d467a?.[_0xa04a0b(0x1db)])return _0x3b8837;const _0x504d65=join(_0x7dcf8[_0xa04a0b(0x1ae)],_0x3d467a['path']);if(_0x504d65===_0x179a0e)return _0x3b8837;return await fileExists(_0x504d65)&&_0x3b8837[_0xa04a0b(0x1d6)]({'filePath':_0x504d65,'mode':_0x3d467a[_0xa04a0b(0x1b7)]??modeFromFilePath(_0x504d65),'isCanonical':![]}),_0x3b8837;}async function compareExistingSqlFiles(_0x41ac05,_0x3e5c35,_0x5823f2){const _0x4e85d7=a253_0x54315f;return Promise[_0x4e85d7(0x1b5)](_0x41ac05[_0x4e85d7(0x1e6)](async _0x1e92c6=>{const _0x4a03c7=_0x4e85d7,_0x1a1567=await readFile(_0x1e92c6[_0x4a03c7(0x1dd)],_0x4a03c7(0x1bd));return{'file':_0x1e92c6,'content':_0x1a1567,'equivalent':isEquivalentPulledSqlFile(_0x1a1567,_0x3e5c35,_0x1e92c6[_0x4a03c7(0x1b7)],_0x5823f2)};}));}function modeFromFilePath(_0xa4b1a3){const _0x51eb52=a253_0x54315f;return _0xa4b1a3['toLowerCase']()[_0x51eb52(0x1c4)](_0x51eb52(0x1e1))?'mybatisXml':_0x51eb52(0x1ee);}function normalizePulledSqlBody(_0x2cfc51,_0x572fd8){const _0x5cb8d8=a253_0x54315f;return stripLocalSqlMetadata(_0x2cfc51,_0x572fd8)['replace'](/\r\n/g,'\x0a')[_0x5cb8d8(0x1d2)]();}function normalizePullComparableContent(_0x41e2bd,_0x152750){const _0x5819a6=a253_0x54315f,_0x16f5a1=_0x41e2bd[_0x5819a6(0x1b2)](/\r\n/g,'\x0a')[_0x5819a6(0x1b0)]('\x0a'),_0x3dc51f=_0x16f5a1[_0x5819a6(0x1ca)](_0x5ecd52=>!isSyncedAtMetadataLine(_0x5ecd52,_0x152750));return _0x3dc51f['join']('\x0a');}function isSyncedAtMetadataLine(_0x7e6ae,_0x455fe6){const _0x44e097=a253_0x54315f;if(_0x455fe6===_0x44e097(0x1cf))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x7e6ae);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x44e097(0x1f5)](_0x7e6ae);}
1
+ const a253_0x4ba897=a253_0x7b79;(function(_0x2f5d24,_0x2064d7){const _0x29b744=a253_0x7b79,_0x34c6aa=_0x2f5d24();while(!![]){try{const _0x578cce=-parseInt(_0x29b744(0x181))/0x1+parseInt(_0x29b744(0x186))/0x2*(parseInt(_0x29b744(0x158))/0x3)+parseInt(_0x29b744(0x168))/0x4+-parseInt(_0x29b744(0x154))/0x5+parseInt(_0x29b744(0x146))/0x6*(-parseInt(_0x29b744(0x182))/0x7)+parseInt(_0x29b744(0x157))/0x8*(-parseInt(_0x29b744(0x18f))/0x9)+parseInt(_0x29b744(0x14d))/0xa*(parseInt(_0x29b744(0x14e))/0xb);if(_0x578cce===_0x2064d7)break;else _0x34c6aa['push'](_0x34c6aa['shift']());}catch(_0x10a009){_0x34c6aa['push'](_0x34c6aa['shift']());}}}(a253_0x10da,0xaca30));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 a253_0x10da(){const _0x3cc881=['toISOString','isCanonical','boolean','Would\x20pull\x20','110kLBcHr','3744323UDOptG','conflict','sqlRoot','split','Filter\x20by\x20SQL\x20display\x20name','appCode','5825305rEjXew','would_pull','paging','8pcdBsZ','3PJiSRd','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','sqlcode','name','all','lockFilePath','string','pull','str','tableData','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','utf8','description','sqlCode','dbId','toLowerCase','1965300hPyCnB','No\x20remote\x20SQL\x20queries\x20matched.','path','catch','\x20failed','push','unchanged','file','content','\x20SQL\x20file(s)\x20into\x20','sqlRootDir','sqlName','sqls','Pull\x20complete:\x20','length','find','force','.xml','mode','some','replace','hash','cancelled','filter','endsWith','852475WuIOCU','7xmcqtj','message','sql','local\x20differs\x20from\x20remote','875314TZgfZn','POST','apps','mybatisXml','\x20skipped,\x20','Force\x20overwrite\x20local\x20unsynced\x20changes','test','filePath','lastSync','7478838HsfFUQ','equivalent','6706002gwHZXK','join','map'];a253_0x10da=function(){return _0x3cc881;};return a253_0x10da();}import{detectSqlMode}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x54b3ed,_0x99a053){const _0x193b7d=a253_0x7b79,_0x1c6808=[];let _0x55c76a=0x1;while(!![]){const _0x244695=await listSqlQueries(_0x54b3ed,{'currentPage':_0x55c76a,'pageSize':PAGE_SIZE,'sqlCode':_0x99a053[_0x193b7d(0x165)],'sqlName':_0x99a053[_0x193b7d(0x173)]}),_0x41dab4=_0x244695[_0x193b7d(0x161)]??[];_0x1c6808[_0x193b7d(0x16d)](..._0x41dab4);if(_0x41dab4[_0x193b7d(0x176)]===0x0)break;const _0x237bc1=_0x244695[_0x193b7d(0x156)]?.['totalCount'];if(_0x237bc1!=null?_0x1c6808['length']>=_0x237bc1:_0x41dab4[_0x193b7d(0x176)]<PAGE_SIZE)break;_0x55c76a++;}return _0x1c6808;}async function ensureSqlContent(_0x261d22){const _0x20fc58=a253_0x7b79;if(_0x261d22['sqlContent']!=null&&String(_0x261d22['sqlContent'])['length']>0x0)return _0x261d22;return getSqlQueryDetail(_0x261d22[_0x20fc58(0x165)]);}export const sqlPull={'service':a253_0x4ba897(0x184),'command':a253_0x4ba897(0x15f),'description':'Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a253_0x4ba897(0x15b),'type':a253_0x4ba897(0x15e),'description':a253_0x4ba897(0x152)},{'name':a253_0x4ba897(0x178),'type':a253_0x4ba897(0x14b),'description':a253_0x4ba897(0x18b)}],async 'dryRun'(_0x8c9457){const _0x1a8eb1=a253_0x4ba897,_0x59f4bf=loadSqlProjectConfig(_0x8c9457[_0x1a8eb1(0x153)]),_0x30e7f5=await readSqlLockFile(_0x59f4bf[_0x1a8eb1(0x15d)]),{appLock:_0x1993cd}=ensureSqlLockScope(_0x30e7f5??createEmptySqlLock(),_0x59f4bf[_0x1a8eb1(0x153)],_0x59f4bf[_0x1a8eb1(0x150)],_0x1a8eb1(0x15f)),_0xc7f25f=await fetchAllSqlQueries(_0x8c9457['appCode'],{'sqlCode':_0x8c9457['str'](_0x1a8eb1(0x15a))||undefined,'sqlName':_0x8c9457['str']('name')||undefined}),_0x23e48a=[];for(const _0x33b40a of _0xc7f25f){const _0x49e91f=await ensureSqlContent(_0x33b40a),_0xef3c23=ensureRemoteSqlContent(_0x49e91f),_0x4b601d=detectSqlMode(_0xef3c23),_0x1424b0=_0x49e91f[_0x1a8eb1(0x166)]?await getDbName(_0x8c9457[_0x1a8eb1(0x153)],Number(_0x49e91f['dbId']))['catch'](()=>undefined):undefined,_0x4acc73=buildLocalSqlFileContent({'sqlCode':_0x49e91f[_0x1a8eb1(0x165)],'sqlName':_0x49e91f[_0x1a8eb1(0x173)],'dbId':_0x49e91f['dbId']},_0xef3c23,{'dbName':_0x1424b0,'mode':_0x4b601d,'syncedAt':new Date()[_0x1a8eb1(0x149)](),'description':_0x49e91f['description']}),_0x1987da=buildSqlLockEntry(_0x49e91f,_0xef3c23,'',{'dbName':_0x1424b0}),_0x22faf=resolveLocalSqlFilePath(_0x59f4bf,_0x49e91f[_0x1a8eb1(0x165)],_0x1987da);let _0xf44d4a=_0x1a8eb1(0x155),_0x5d2c20;const _0x1294d1=await findExistingSqlFiles(_0x59f4bf,_0x22faf,_0x4b601d,_0x1993cd[_0x1a8eb1(0x174)][_0x49e91f[_0x1a8eb1(0x165)]]);if(_0x1294d1[_0x1a8eb1(0x176)]>0x0){const _0x38c33a=await compareExistingSqlFiles(_0x1294d1,_0x4acc73,_0x4b601d);if(_0x38c33a[_0x1a8eb1(0x17b)](({equivalent:_0x58e4cd})=>!_0x58e4cd))_0xf44d4a=_0x1a8eb1(0x14f),_0x5d2c20='local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)';else _0x38c33a[_0x1a8eb1(0x176)]===0x1&&_0x38c33a[0x0]?.[_0x1a8eb1(0x16f)][_0x1a8eb1(0x14a)]&&(_0xf44d4a='skipped',_0x5d2c20='unchanged');}_0x23e48a[_0x1a8eb1(0x16d)]({'sqlCode':_0x49e91f['sqlCode'],'sqlName':_0x49e91f[_0x1a8eb1(0x173)],'filePath':_0x22faf,'status':_0xf44d4a,'reason':_0x5d2c20});}return{'method':_0x1a8eb1(0x187),'url':_0x1a8eb1(0x159),'body':{'appCode':_0x8c9457[_0x1a8eb1(0x153)],'sqlCode':_0x8c9457[_0x1a8eb1(0x160)](_0x1a8eb1(0x15a))||null,'sqlName':_0x8c9457['str'](_0x1a8eb1(0x15b))||null,'files':_0x23e48a},'description':_0x1a8eb1(0x14c)+_0x23e48a['length']+_0x1a8eb1(0x171)+_0x59f4bf[_0x1a8eb1(0x172)]};},async 'execute'(_0x5d7b6e){const _0x4101cc=a253_0x4ba897,_0x44c33c=loadSqlProjectConfig(_0x5d7b6e[_0x4101cc(0x153)]),_0x2a7195=await readSqlLockFile(_0x44c33c[_0x4101cc(0x15d)]),{lockData:_0x2b29f7,appLock:_0x18460d}=ensureSqlLockScope(_0x2a7195??createEmptySqlLock(),_0x44c33c['appCode'],_0x44c33c['sqlRoot'],_0x4101cc(0x15f)),_0x4335eb=_0x5d7b6e['bool'](_0x4101cc(0x178)),_0x41d388=await fetchAllSqlQueries(_0x5d7b6e[_0x4101cc(0x153)],{'sqlCode':_0x5d7b6e[_0x4101cc(0x160)]('sqlcode')||undefined,'sqlName':_0x5d7b6e['str'](_0x4101cc(0x15b))||undefined});if(_0x41d388['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x4101cc(0x169)};const _0x33cfe4=[],_0x1d6964=[];for(const _0x303b4d of _0x41d388){try{_0x33cfe4[_0x4101cc(0x16d)](await ensureSqlContent(_0x303b4d));}catch(_0x568ad6){_0x1d6964[_0x4101cc(0x16d)]({'sqlCode':_0x303b4d[_0x4101cc(0x165)],'error':_0x568ad6 instanceof Error?_0x568ad6[_0x4101cc(0x183)]:String(_0x568ad6)});}}if(_0x4335eb&&!_0x5d7b6e['nonInteractive']){let _0x515976=![];for(const _0x655c7a of _0x33cfe4){const _0x2f5e2c=detectSqlMode(ensureRemoteSqlContent(_0x655c7a)),_0x287477=_0x655c7a['dbId']?await getDbName(_0x5d7b6e[_0x4101cc(0x153)],Number(_0x655c7a['dbId']))[_0x4101cc(0x16b)](()=>undefined):undefined,_0xd4da50=buildLocalSqlFileContent({'sqlCode':_0x655c7a[_0x4101cc(0x165)],'sqlName':_0x655c7a[_0x4101cc(0x173)],'dbId':_0x655c7a['dbId']},ensureRemoteSqlContent(_0x655c7a),{'dbName':_0x287477,'mode':_0x2f5e2c,'syncedAt':new Date()['toISOString'](),'description':_0x655c7a[_0x4101cc(0x164)]}),_0x18c59c=resolveLocalSqlFilePath(_0x44c33c,_0x655c7a[_0x4101cc(0x165)],buildSqlLockEntry(_0x655c7a,ensureRemoteSqlContent(_0x655c7a),'',{'dbName':_0x287477})),_0x21f9f0=await findExistingSqlFiles(_0x44c33c,_0x18c59c,_0x2f5e2c,_0x18460d[_0x4101cc(0x174)][_0x655c7a[_0x4101cc(0x165)]]),_0x5cad1a=await compareExistingSqlFiles(_0x21f9f0,_0xd4da50,_0x2f5e2c);if(_0x5cad1a[_0x4101cc(0x17b)](({equivalent:_0x2bf51f})=>!_0x2bf51f)){_0x515976=!![];break;}}if(_0x515976){const _0x1dacc6=await confirmForceOverwrite(_0x4101cc(0x162));if(!_0x1dacc6)throw CliErrors[_0x4101cc(0x17e)]('Force\x20pull\x20cancelled.');}}const _0x176b1f=cloneSqlLockData(_0x2b29f7),_0x3dac7e=_0x176b1f[_0x4101cc(0x188)][_0x44c33c[_0x4101cc(0x153)]],_0xe18ca7=[],_0x2aeb02=[];for(const _0x250637 of _0x33cfe4){const _0x5b2698=_0x3dac7e[_0x4101cc(0x174)][_0x250637['sqlCode']],_0x5d07db=ensureRemoteSqlContent(_0x250637),_0x15de9b=detectSqlMode(_0x5d07db),_0x88f90f=_0x250637['dbId']?await getDbName(_0x5d7b6e[_0x4101cc(0x153)],Number(_0x250637[_0x4101cc(0x166)]))[_0x4101cc(0x16b)](()=>undefined):undefined,_0x2da80e=buildLocalSqlFileContent({'sqlCode':_0x250637[_0x4101cc(0x165)],'sqlName':_0x250637[_0x4101cc(0x173)],'dbId':_0x250637[_0x4101cc(0x166)]},_0x5d07db,{'dbName':_0x88f90f,'mode':_0x15de9b,'syncedAt':new Date()[_0x4101cc(0x149)](),'description':_0x250637['description']}),_0x15f8ff=buildSqlLockEntry(_0x250637,_0x5d07db,computeSqlContentHash(_0x2da80e),{'dbName':_0x88f90f}),_0x4e540d=_0x15f8ff[_0x4101cc(0x16a)],_0x27bab2=join(_0x44c33c[_0x4101cc(0x172)],_0x4e540d);try{const _0x4f17d7=await findExistingSqlFiles(_0x44c33c,_0x27bab2,_0x15de9b,_0x5b2698),_0x1c66c7=await compareExistingSqlFiles(_0x4f17d7,_0x2da80e,_0x15de9b);if(!_0x4335eb&&_0x1c66c7[_0x4101cc(0x17b)](({equivalent:_0x21ef78})=>!_0x21ef78)){_0x2aeb02[_0x4101cc(0x16d)]({'sqlCode':_0x250637[_0x4101cc(0x165)],'reason':_0x4101cc(0x185)});continue;}const _0x182b9c=_0x1c66c7[_0x4101cc(0x177)](({file:_0x4ec3d4})=>_0x4ec3d4[_0x4101cc(0x14a)]),_0x29f4ac=_0x1c66c7['find'](({file:_0x3714bc})=>!_0x3714bc['isCanonical']);if(_0x182b9c?.[_0x4101cc(0x190)]&&!_0x29f4ac){_0x2aeb02['push']({'sqlCode':_0x250637['sqlCode'],'reason':_0x4101cc(0x16e)}),_0x3dac7e[_0x4101cc(0x174)][_0x250637[_0x4101cc(0x165)]]={..._0x15f8ff,'hash':computeSqlContentHash(_0x182b9c[_0x4101cc(0x170)]),'path':_0x4e540d};continue;}!_0x182b9c?.['equivalent']&&(await ensureParentDirectory(_0x27bab2),await writeFile(_0x27bab2,_0x2da80e,'utf8')),_0x29f4ac&&await rm(_0x29f4ac['file'][_0x4101cc(0x18d)],{'force':!![]}),_0x3dac7e[_0x4101cc(0x174)][_0x250637[_0x4101cc(0x165)]]={..._0x15f8ff,'hash':_0x182b9c?.[_0x4101cc(0x190)]?computeSqlContentHash(_0x182b9c[_0x4101cc(0x170)]):_0x15f8ff[_0x4101cc(0x17d)],'path':_0x4e540d},_0xe18ca7['push']({'sqlCode':_0x250637[_0x4101cc(0x165)],'filePath':_0x27bab2});}catch(_0x29155d){_0x1d6964['push']({'sqlCode':_0x250637[_0x4101cc(0x165)],'error':_0x29155d instanceof Error?_0x29155d[_0x4101cc(0x183)]:String(_0x29155d)});}}return _0x3dac7e[_0x4101cc(0x18e)]=new Date()[_0x4101cc(0x149)](),await writeSqlLockFile(_0x44c33c['lockFilePath'],_0x176b1f),{'ok':_0x1d6964[_0x4101cc(0x176)]===0x0,'data':{'pulled':_0xe18ca7,'skipped':_0x2aeb02,'failed':_0x1d6964},'message':_0x4101cc(0x175)+_0xe18ca7[_0x4101cc(0x176)]+'\x20written,\x20'+_0x2aeb02['length']+_0x4101cc(0x18a)+_0x1d6964['length']+_0x4101cc(0x16c)};}};function isEquivalentPulledSqlFile(_0x5e92c9,_0x3735ca,_0x4ad565,_0x59162e){if(_0x4ad565!==_0x59162e)return normalizePulledSqlBody(_0x5e92c9,_0x4ad565)===normalizePulledSqlBody(_0x3735ca,_0x59162e);return normalizePullComparableContent(_0x5e92c9,_0x4ad565)===normalizePullComparableContent(_0x3735ca,_0x59162e);}async function findExistingSqlFiles(_0x497352,_0x334aa4,_0x1dc6a7,_0x1d32be){const _0x16bd4a=a253_0x4ba897,_0x790a6c=[];await fileExists(_0x334aa4)&&_0x790a6c[_0x16bd4a(0x16d)]({'filePath':_0x334aa4,'mode':_0x1dc6a7,'isCanonical':!![]});if(!_0x1d32be?.[_0x16bd4a(0x16a)])return _0x790a6c;const _0x42f877=join(_0x497352[_0x16bd4a(0x172)],_0x1d32be['path']);if(_0x42f877===_0x334aa4)return _0x790a6c;return await fileExists(_0x42f877)&&_0x790a6c[_0x16bd4a(0x16d)]({'filePath':_0x42f877,'mode':_0x1d32be[_0x16bd4a(0x17a)]??modeFromFilePath(_0x42f877),'isCanonical':![]}),_0x790a6c;}async function compareExistingSqlFiles(_0x43fd75,_0xbe5013,_0x3a78a2){const _0x159f74=a253_0x4ba897;return Promise[_0x159f74(0x15c)](_0x43fd75[_0x159f74(0x148)](async _0xa4a1da=>{const _0x335da5=_0x159f74,_0x102b95=await readFile(_0xa4a1da['filePath'],_0x335da5(0x163));return{'file':_0xa4a1da,'content':_0x102b95,'equivalent':isEquivalentPulledSqlFile(_0x102b95,_0xbe5013,_0xa4a1da['mode'],_0x3a78a2)};}));}function a253_0x7b79(_0x302d0b,_0x294e6c){_0x302d0b=_0x302d0b-0x146;const _0x10da0c=a253_0x10da();let _0x7b7947=_0x10da0c[_0x302d0b];return _0x7b7947;}function modeFromFilePath(_0x361aeb){const _0x1a6371=a253_0x4ba897;return _0x361aeb[_0x1a6371(0x167)]()[_0x1a6371(0x180)](_0x1a6371(0x179))?'mybatisXml':'sql';}function normalizePulledSqlBody(_0x462227,_0x10e7d2){const _0x703b14=a253_0x4ba897;return stripLocalSqlMetadata(_0x462227,_0x10e7d2)[_0x703b14(0x17c)](/\r\n/g,'\x0a')['trim']();}function normalizePullComparableContent(_0x169ea8,_0x343cdc){const _0x5695cd=a253_0x4ba897,_0x325470=_0x169ea8[_0x5695cd(0x17c)](/\r\n/g,'\x0a')[_0x5695cd(0x151)]('\x0a'),_0xfe5a08=_0x325470[_0x5695cd(0x17f)](_0x1f4c62=>!isSyncedAtMetadataLine(_0x1f4c62,_0x343cdc));return _0xfe5a08[_0x5695cd(0x147)]('\x0a');}function isSyncedAtMetadataLine(_0x13f0d2,_0x3193d9){const _0x820359=a253_0x4ba897;if(_0x3193d9===_0x820359(0x189))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x13f0d2);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x820359(0x18c)](_0x13f0d2);}
@@ -1 +1 @@
1
- const a254_0x160440=a254_0x3aff;(function(_0x133492,_0x10dfba){const _0x2606ed=a254_0x3aff,_0x1d8726=_0x133492();while(!![]){try{const _0x45699a=-parseInt(_0x2606ed(0xfb))/0x1*(parseInt(_0x2606ed(0x102))/0x2)+-parseInt(_0x2606ed(0xf4))/0x3*(-parseInt(_0x2606ed(0xd0))/0x4)+-parseInt(_0x2606ed(0xd9))/0x5*(parseInt(_0x2606ed(0xfc))/0x6)+parseInt(_0x2606ed(0xf9))/0x7+parseInt(_0x2606ed(0xd3))/0x8+parseInt(_0x2606ed(0xe9))/0x9+parseInt(_0x2606ed(0xe7))/0xa*(parseInt(_0x2606ed(0xd5))/0xb);if(_0x45699a===_0x10dfba)break;else _0x1d8726['push'](_0x1d8726['shift']());}catch(_0x29475a){_0x1d8726['push'](_0x1d8726['shift']());}}}(a254_0x4aa0,0x66742));function a254_0x4aa0(){const _0x1bf54b=['3160976QZLmPd','No\x20local\x20SQL\x20files\x20found.','13219LhmUsz','4599156gWHoae','force','sqls','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','sqlConfig','Push\x20local\x20SQL\x20files\x20to\x20remote','50HkzqXE','\x22\x20for\x20sqlCode\x20','POST','push','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20',':\x20missing\x20remote\x20version;\x20run\x20sql\x20pull\x20first.','hash','sqlRootDir','lockFilePath','appCode',':\x20SQL\x20content\x20is\x20empty.','\x20SQL\x20file(s)','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','catch','sql','get','utf8','remoteId','length','startsWith','filter','filePath','validation','dbDirectory','188aEcyno','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','projectRoot','1333024tnPkCL','Local\x20directory\x20\x22','697400mSFkPf','dbName','toISOString','Local\x20SQL\x20not\x20found:\x20','5yjhUrn','set','trashDir','Push\x20complete:\x20','Would\x20push\x20','\x20pushed,\x20','No\x20database\x20matches\x20local\x20directory\x20\x22','sqlRoot','/smartapi/custom/updateUserCustomSql','bool','\x20skipped,\x20','boolean','unchanged','lastSync','40uvmkvI','sqlcode','2649384zXOXlQ','sqlCode',':\x20local\x20SQL\x20is\x20not\x20tracked;\x20run\x20sql\x20create\x20or\x20sql\x20pull\x20first.','version','str','entries','write','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','path','message','relativePath','22371pzZKLG','sqlName','mode','dbId','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'];a254_0x4aa0=function(){return _0x1bf54b;};return a254_0x4aa0();}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';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(_0x35fa6d){const _0x31ac5d=a254_0x3aff,_0x350084=stripLocalSqlMetadata(await readFile(_0x35fa6d[_0x31ac5d(0xcd)],_0x31ac5d(0xc8)),_0x35fa6d[_0x31ac5d(0xf6)]);if(!_0x350084['trim']())throw CliErrors['validation'](_0x35fa6d['sqlCode']+_0x31ac5d(0xc2));return _0x350084;}async function getTargetSqlQueries(_0x5176fa,_0xedd34a,_0x3ce888){const _0x4956d3=a254_0x3aff,_0x2fe7bb=await scanLocalSqlQueries(_0x5176fa),_0x3da093=new Map();for(const _0x21c92a of _0x2fe7bb){if(_0x3ce888&&_0x21c92a['sqlCode']!==_0x3ce888)continue;const _0x161024=_0x3da093[_0x4956d3(0xc7)](_0x21c92a[_0x4956d3(0xea)])??[];_0x161024['push'](_0x21c92a),_0x3da093[_0x4956d3(0xda)](_0x21c92a[_0x4956d3(0xea)],_0x161024);}if(_0x3ce888&&!_0x3da093['has'](_0x3ce888))throw CliErrors['validation'](_0x4956d3(0xd8)+_0x3ce888);const _0x5da353=[];for(const [_0x377bfd,_0x27894d]of _0x3da093[_0x4956d3(0xee)]()){if(_0x27894d[_0x4956d3(0xca)]===0x1){_0x5da353[_0x4956d3(0x105)](_0x27894d[0x0]);continue;}const _0x4a5d81=_0xedd34a[_0x4956d3(0xfe)][_0x377bfd],_0x592d28=_0x4a5d81?.['path'],_0x434712=_0x592d28?_0x27894d[_0x4956d3(0xcc)](_0x7f083c=>_0x7f083c[_0x4956d3(0xf3)]!==_0x592d28):_0x27894d;if(_0x4a5d81&&_0x434712[_0x4956d3(0xca)]===0x1){_0x5da353['push'](_0x434712[0x0]);continue;}throw CliErrors[_0x4956d3(0xce)](_0x4956d3(0xf0)+_0x377bfd+_0x4956d3(0xff));}return _0x5da353;}export const sqlPush={'service':a254_0x160440(0xc6),'command':a254_0x160440(0x105),'description':a254_0x160440(0x101),'risk':a254_0x160440(0xef),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':a254_0x160440(0xe4),'description':a254_0x160440(0xf8)}],async 'dryRun'(_0x324a50){const _0x16c6cc=a254_0x160440,_0x5cb00a=loadSqlProjectConfig(_0x324a50[_0x16c6cc(0xc1)]),_0x55a19b=await readSqlLockFile(_0x5cb00a['lockFilePath']),{appLock:_0x4c29fa}=ensureSqlLockScope(_0x55a19b??createEmptySqlLock(),_0x324a50[_0x16c6cc(0xc1)],_0x5cb00a['sqlRoot'],'push'),_0x293152=await getTargetSqlQueries(_0x5cb00a,_0x4c29fa,_0x324a50[_0x16c6cc(0xed)](_0x16c6cc(0xe8))||undefined),_0x490070=[];for(const _0x1fb025 of _0x293152){const _0x78311c=await computeSqlFileHash(_0x1fb025['filePath']),_0x347179=_0x4c29fa[_0x16c6cc(0xfe)][_0x1fb025[_0x16c6cc(0xea)]],_0x27086a=!!_0x347179&&(_0x347179[_0x16c6cc(0xf1)]!==_0x1fb025[_0x16c6cc(0xf3)]||!!_0x1fb025[_0x16c6cc(0xf5)]&&_0x347179[_0x16c6cc(0xf5)]!==_0x1fb025[_0x16c6cc(0xf5)]||_0x347179[_0x16c6cc(0xf6)]!==_0x1fb025[_0x16c6cc(0xf6)]);if(!_0x324a50[_0x16c6cc(0xe2)](_0x16c6cc(0xfd))&&_0x347179&&_0x347179[_0x16c6cc(0x108)]===_0x78311c&&!_0x27086a)continue;if(!_0x347179)throw CliErrors[_0x16c6cc(0xce)](_0x1fb025[_0x16c6cc(0xea)]+_0x16c6cc(0xeb));if(_0x347179[_0x16c6cc(0xec)]==null)throw CliErrors[_0x16c6cc(0xce)](_0x1fb025[_0x16c6cc(0xea)]+_0x16c6cc(0x107));await resolveTargetDbBinding(_0x324a50[_0x16c6cc(0xc1)],_0x1fb025,_0x347179),await readSqlUploadContent(_0x1fb025),_0x490070[_0x16c6cc(0x105)](_0x1fb025[_0x16c6cc(0xea)]);}return{'method':_0x16c6cc(0x104),'url':_0x16c6cc(0xe1),'body':{'sqlCodes':_0x490070,'appCode':_0x324a50[_0x16c6cc(0xc1)]},'description':_0x16c6cc(0xdd)+_0x490070[_0x16c6cc(0xca)]+_0x16c6cc(0xc3)};},async 'execute'(_0x1c9df3){const _0x4d94eb=a254_0x160440,_0x575162=loadSqlProjectConfig(_0x1c9df3['appCode']),_0xe31a08=await readSqlLockFile(_0x575162[_0x4d94eb(0x10a)]),{lockData:_0x55f874,appLock:_0x369b2a}=ensureSqlLockScope(_0xe31a08??createEmptySqlLock(),_0x1c9df3[_0x4d94eb(0xc1)],_0x575162[_0x4d94eb(0xe0)],'push'),_0x1e9319=await getTargetSqlQueries(_0x575162,_0x369b2a,_0x1c9df3[_0x4d94eb(0xed)](_0x4d94eb(0xe8))||undefined);if(_0x1e9319[_0x4d94eb(0xca)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x4d94eb(0xfa)};const _0x25f2e3=[],_0x5a71ec=[],_0x4a01c1=[];let _0x20886b=![];for(const _0x1824fb of _0x1e9319){const _0x5a1a5c=_0x369b2a[_0x4d94eb(0xfe)][_0x1824fb[_0x4d94eb(0xea)]];if(!_0x5a1a5c){_0x4a01c1[_0x4d94eb(0x105)]({'sqlCode':_0x1824fb['sqlCode'],'error':_0x4d94eb(0xd1)});continue;}try{const _0x11ac73=await computeSqlFileHash(_0x1824fb[_0x4d94eb(0xcd)]),_0x40593d=_0x5a1a5c[_0x4d94eb(0xf1)]!==_0x1824fb[_0x4d94eb(0xf3)]||!!_0x1824fb[_0x4d94eb(0xf5)]&&_0x5a1a5c['sqlName']!==_0x1824fb[_0x4d94eb(0xf5)]||_0x5a1a5c[_0x4d94eb(0xf6)]!==_0x1824fb[_0x4d94eb(0xf6)];if(!_0x1c9df3[_0x4d94eb(0xe2)]('force')&&_0x5a1a5c[_0x4d94eb(0x108)]===_0x11ac73&&!_0x40593d){_0x5a71ec[_0x4d94eb(0x105)]({'sqlCode':_0x1824fb[_0x4d94eb(0xea)],'reason':_0x4d94eb(0xe5)});continue;}if(_0x5a1a5c[_0x4d94eb(0xec)]==null){_0x4a01c1['push']({'sqlCode':_0x1824fb[_0x4d94eb(0xea)],'error':_0x4d94eb(0xc4)});continue;}const _0x25dc5d=_0x1824fb['sqlName']||_0x5a1a5c[_0x4d94eb(0xf5)],_0x4a2265=await resolveTargetDbBinding(_0x1c9df3[_0x4d94eb(0xc1)],_0x1824fb,_0x5a1a5c),_0x3665ff=await readSqlUploadContent(_0x1824fb),_0x1f87bf=await updateSqlQuery({'id':_0x5a1a5c[_0x4d94eb(0xc9)],'appCode':_0x1c9df3[_0x4d94eb(0xc1)],'sqlCode':_0x1824fb[_0x4d94eb(0xea)],'sqlName':_0x25dc5d,'dbId':_0x4a2265[_0x4d94eb(0xf7)],'version':_0x5a1a5c[_0x4d94eb(0xec)],'sqlContent':_0x3665ff,'sqlConfig':_0x5a1a5c[_0x4d94eb(0x100)]??undefined}),_0xa52b3c=_0x1f87bf[_0x4d94eb(0xf7)]?await getDbName(_0x1c9df3[_0x4d94eb(0xc1)],Number(_0x1f87bf[_0x4d94eb(0xf7)]))[_0x4d94eb(0xc5)](()=>_0x4a2265[_0x4d94eb(0xd6)]):_0x4a2265['dbName'];_0x369b2a[_0x4d94eb(0xfe)][_0x1824fb[_0x4d94eb(0xea)]]={...buildSqlLockEntry(_0x1f87bf,_0x3665ff,_0x11ac73,{'dbName':_0xa52b3c}),'path':_0x1824fb[_0x4d94eb(0xf3)],'mode':_0x1824fb[_0x4d94eb(0xf6)]},_0x20886b=!![],await archivePreviousSqlFileIfNeeded(_0x575162,_0x5a1a5c['path'],_0x1824fb[_0x4d94eb(0xf3)]),_0x25f2e3['push']({'sqlCode':_0x1824fb[_0x4d94eb(0xea)],'remoteId':_0x5a1a5c[_0x4d94eb(0xc9)]});}catch(_0x560381){_0x4a01c1[_0x4d94eb(0x105)]({'sqlCode':_0x1824fb[_0x4d94eb(0xea)],'error':_0x560381 instanceof Error?_0x560381[_0x4d94eb(0xf2)]:String(_0x560381)});}}(_0x20886b||_0x4a01c1[_0x4d94eb(0xca)]===0x0)&&(_0x369b2a[_0x4d94eb(0xe6)]=new Date()[_0x4d94eb(0xd7)](),await writeSqlLockFile(_0x575162[_0x4d94eb(0x10a)],_0x55f874));const _0xafa000=_0x4a01c1[_0x4d94eb(0xca)]===0x0;return{'ok':_0xafa000,'data':{'pushed':_0x25f2e3,'skipped':_0x5a71ec,'failed':_0x4a01c1},'message':_0x4d94eb(0xdc)+_0x25f2e3[_0x4d94eb(0xca)]+_0x4d94eb(0xde)+_0x5a71ec[_0x4d94eb(0xca)]+_0x4d94eb(0xe3)+_0x4a01c1['length']+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x556c3d,_0xfece9f,_0x224592){const _0x54c59e=a254_0x160440;if(!_0xfece9f||_0xfece9f===_0x224592)return;const _0x5dc1ef=join(_0x556c3d[_0x54c59e(0x109)],_0xfece9f);if(!await fileExists(_0x5dc1ef))return;const _0x296cf3=await moveToTrash(_0x556c3d[_0x54c59e(0xd2)],_0x556c3d[_0x54c59e(0xdb)],_0x5dc1ef);await cleanupEmptyDirectories(dirname(_0x5dc1ef),_0x556c3d['sqlRootDir']),void _0x296cf3;}function a254_0x3aff(_0x118661,_0x5c5928){_0x118661=_0x118661-0xc1;const _0x4aa06c=a254_0x4aa0();let _0x3aff59=_0x4aa06c[_0x118661];return _0x3aff59;}async function moveToTrash(_0xdd92c8,_0x398efc,_0x5a2f09){const _0x5f09d2=a254_0x160440,_0x3066e8=new Date()[_0x5f09d2(0xd7)]()['replace'](/[:.]/g,'-'),_0x347d68=relative(_0xdd92c8,_0x5a2f09),_0x4ad26f=join(_0x398efc,_0x3066e8,_0x347d68);return await mkdir(dirname(_0x4ad26f),{'recursive':!![]}),await rename(_0x5a2f09,_0x4ad26f),_0x4ad26f;}async function cleanupEmptyDirectories(_0x3ff9a0,_0x3c6e16){const _0x550fb2=a254_0x160440;let _0x4f6311=resolve(_0x3ff9a0);const _0x325436=resolve(_0x3c6e16);while(_0x4f6311[_0x550fb2(0xcb)](''+_0x325436+sep)||_0x4f6311===_0x325436){if(_0x4f6311===_0x325436)return;try{const _0x8f21da=await readdir(_0x4f6311);if(_0x8f21da['length']>0x0)return;await rmdir(_0x4f6311);}catch{return;}_0x4f6311=dirname(_0x4f6311);}}async function resolveTargetDbBinding(_0x2f8d9e,_0x260b80,_0x4e6c0d){const _0x20fe6c=a254_0x160440,_0x2bdb07=_0x260b80[_0x20fe6c(0xcf)];if(!_0x2bdb07)return{'dbId':_0x4e6c0d[_0x20fe6c(0xf7)],'dbName':_0x4e6c0d[_0x20fe6c(0xd6)]};const _0x24ddca=buildDbDirectoryName(_0x4e6c0d[_0x20fe6c(0xd6)],_0x4e6c0d[_0x20fe6c(0xf7)]);if(_0x2bdb07===_0x24ddca)return{'dbId':_0x4e6c0d['dbId'],'dbName':_0x4e6c0d[_0x20fe6c(0xd6)]};const _0x5890d7=parseExplicitDbDirectory(_0x2bdb07);if(_0x5890d7!=null)return{'dbId':_0x5890d7,'dbName':await getDbName(_0x2f8d9e,_0x5890d7)[_0x20fe6c(0xc5)](()=>undefined)};const _0x536c44=await listDatabases(_0x2f8d9e),_0x5ee294=_0x536c44['filter'](_0x33b194=>buildDbDirectoryName(_0x33b194[_0x20fe6c(0xd6)],_0x33b194[_0x20fe6c(0xf7)])===_0x2bdb07);if(_0x5ee294[_0x20fe6c(0xca)]===0x1)return{'dbId':_0x5ee294[0x0][_0x20fe6c(0xf7)],'dbName':_0x5ee294[0x0]['dbName']};if(_0x5ee294[_0x20fe6c(0xca)]===0x0)throw CliErrors[_0x20fe6c(0xce)](_0x20fe6c(0xdf)+_0x2bdb07+_0x20fe6c(0x103)+_0x260b80['sqlCode']+'.');const _0x3b9a15=_0x5ee294['map'](_0x4cba1a=>_0x4cba1a[_0x20fe6c(0xd6)]+'\x20('+_0x4cba1a['dbId']+')')['join'](',\x20');throw CliErrors['validation'](_0x20fe6c(0xd4)+_0x2bdb07+_0x20fe6c(0x106)+_0x260b80['sqlCode']+':\x20'+_0x3b9a15);}function parseExplicitDbDirectory(_0x18ea27){const _0x1ef098=/^db-(\d+)$/['exec'](_0x18ea27);if(!_0x1ef098)return null;const _0x1db19d=Number(_0x1ef098[0x1]);return Number['isFinite'](_0x1db19d)&&_0x1db19d>0x0?_0x1db19d:null;}
1
+ const a254_0x5e9230=a254_0x40a7;(function(_0x5190fb,_0x54390f){const _0x2868bb=a254_0x40a7,_0x51661d=_0x5190fb();while(!![]){try{const _0x4c78a1=-parseInt(_0x2868bb(0xc6))/0x1+-parseInt(_0x2868bb(0xc4))/0x2+-parseInt(_0x2868bb(0xb7))/0x3+-parseInt(_0x2868bb(0xb4))/0x4+-parseInt(_0x2868bb(0xc5))/0x5+-parseInt(_0x2868bb(0xae))/0x6+parseInt(_0x2868bb(0xbe))/0x7;if(_0x4c78a1===_0x54390f)break;else _0x51661d['push'](_0x51661d['shift']());}catch(_0x359530){_0x51661d['push'](_0x51661d['shift']());}}}(a254_0x23a3,0x920f5));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';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';function a254_0x23a3(){const _0x6b4905=['toISOString','map','\x20skipped,\x20','isFinite','length','Push\x20local\x20SQL\x20files\x20to\x20remote','push','path','replace','lastSync','bool','get','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','Local\x20directory\x20\x22','mode',':\x20SQL\x20content\x20is\x20empty.','\x20failed','join','sqlConfig','sqlName','boolean','\x22\x20for\x20sqlCode\x20','relativePath','/smartapi/custom/updateUserCustomSql','unchanged','lockFilePath','exec','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','dbDirectory','write','209082ISENHY','sql','sqlcode','\x20SQL\x20file(s)','force','sqls','378260nUHmQT','POST','dbId','2015943XKoCLi','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','sqlRootDir','hash','version','trashDir','Would\x20push\x20','28865900uLZZVE','projectRoot','sqlCode','validation','message','No\x20local\x20SQL\x20files\x20found.','1076360MpguLm','5185840jsxjQp','1148698KSWQye','dbName','sqlRoot','str','utf8','appCode','Push\x20complete:\x20'];a254_0x23a3=function(){return _0x6b4905;};return a254_0x23a3();}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';function a254_0x40a7(_0x44b108,_0x53bfc5){_0x44b108=_0x44b108-0xa6;const _0x23a393=a254_0x23a3();let _0x40a742=_0x23a393[_0x44b108];return _0x40a742;}async function readSqlUploadContent(_0x1e114e){const _0x256198=a254_0x40a7,_0xb7c352=stripLocalSqlMetadata(await readFile(_0x1e114e['filePath'],_0x256198(0xca)),_0x1e114e['mode']);if(!_0xb7c352['trim']())throw CliErrors[_0x256198(0xc1)](_0x1e114e['sqlCode']+_0x256198(0xdc));return _0xb7c352;}async function getTargetSqlQueries(_0x5130c4,_0x4c3363,_0x2daefa){const _0x3ecedd=a254_0x40a7,_0x4b5f07=await scanLocalSqlQueries(_0x5130c4),_0x78919=new Map();for(const _0x52351a of _0x4b5f07){if(_0x2daefa&&_0x52351a[_0x3ecedd(0xc0)]!==_0x2daefa)continue;const _0x4e1f2b=_0x78919[_0x3ecedd(0xd8)](_0x52351a['sqlCode'])??[];_0x4e1f2b[_0x3ecedd(0xd3)](_0x52351a),_0x78919['set'](_0x52351a[_0x3ecedd(0xc0)],_0x4e1f2b);}if(_0x2daefa&&!_0x78919['has'](_0x2daefa))throw CliErrors[_0x3ecedd(0xc1)]('Local\x20SQL\x20not\x20found:\x20'+_0x2daefa);const _0x40461f=[];for(const [_0x3fe31c,_0x2fb7db]of _0x78919['entries']()){if(_0x2fb7db['length']===0x1){_0x40461f[_0x3ecedd(0xd3)](_0x2fb7db[0x0]);continue;}const _0x204808=_0x4c3363[_0x3ecedd(0xb3)][_0x3fe31c],_0x987538=_0x204808?.[_0x3ecedd(0xd4)],_0x23fde3=_0x987538?_0x2fb7db['filter'](_0x1f984e=>_0x1f984e[_0x3ecedd(0xa6)]!==_0x987538):_0x2fb7db;if(_0x204808&&_0x23fde3[_0x3ecedd(0xd1)]===0x1){_0x40461f[_0x3ecedd(0xd3)](_0x23fde3[0x0]);continue;}throw CliErrors['validation'](_0x3ecedd(0xb8)+_0x3fe31c+_0x3ecedd(0xab));}return _0x40461f;}export const sqlPush={'service':a254_0x5e9230(0xaf),'command':'push','description':a254_0x5e9230(0xd2),'risk':a254_0x5e9230(0xad),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':a254_0x5e9230(0xe1),'description':'Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'}],async 'dryRun'(_0xcd6256){const _0x423176=a254_0x5e9230,_0x52621f=loadSqlProjectConfig(_0xcd6256[_0x423176(0xcb)]),_0x45d59e=await readSqlLockFile(_0x52621f[_0x423176(0xa9)]),{appLock:_0x538d70}=ensureSqlLockScope(_0x45d59e??createEmptySqlLock(),_0xcd6256[_0x423176(0xcb)],_0x52621f['sqlRoot'],_0x423176(0xd3)),_0x198a01=await getTargetSqlQueries(_0x52621f,_0x538d70,_0xcd6256[_0x423176(0xc9)](_0x423176(0xb0))||undefined),_0x2cea00=[];for(const _0x48038a of _0x198a01){const _0x45c580=await computeSqlFileHash(_0x48038a['filePath']),_0x290701=_0x538d70[_0x423176(0xb3)][_0x48038a['sqlCode']],_0x2cdc28=!!_0x290701&&(_0x290701[_0x423176(0xd4)]!==_0x48038a[_0x423176(0xa6)]||!!_0x48038a[_0x423176(0xe0)]&&_0x290701[_0x423176(0xe0)]!==_0x48038a[_0x423176(0xe0)]||_0x290701[_0x423176(0xdb)]!==_0x48038a['mode']);if(!_0xcd6256[_0x423176(0xd7)]('force')&&_0x290701&&_0x290701[_0x423176(0xba)]===_0x45c580&&!_0x2cdc28)continue;if(!_0x290701)throw CliErrors[_0x423176(0xc1)](_0x48038a[_0x423176(0xc0)]+':\x20local\x20SQL\x20is\x20not\x20tracked;\x20run\x20sql\x20create\x20or\x20sql\x20pull\x20first.');if(_0x290701[_0x423176(0xbb)]==null)throw CliErrors[_0x423176(0xc1)](_0x48038a[_0x423176(0xc0)]+':\x20missing\x20remote\x20version;\x20run\x20sql\x20pull\x20first.');await resolveTargetDbBinding(_0xcd6256[_0x423176(0xcb)],_0x48038a,_0x290701),await readSqlUploadContent(_0x48038a),_0x2cea00['push'](_0x48038a['sqlCode']);}return{'method':_0x423176(0xb5),'url':_0x423176(0xa7),'body':{'sqlCodes':_0x2cea00,'appCode':_0xcd6256[_0x423176(0xcb)]},'description':_0x423176(0xbd)+_0x2cea00[_0x423176(0xd1)]+_0x423176(0xb1)};},async 'execute'(_0x58ae9e){const _0x22ca18=a254_0x5e9230,_0x10aad2=loadSqlProjectConfig(_0x58ae9e[_0x22ca18(0xcb)]),_0x5c5e97=await readSqlLockFile(_0x10aad2[_0x22ca18(0xa9)]),{lockData:_0x453acf,appLock:_0x288ffe}=ensureSqlLockScope(_0x5c5e97??createEmptySqlLock(),_0x58ae9e['appCode'],_0x10aad2[_0x22ca18(0xc8)],_0x22ca18(0xd3)),_0x2ac655=await getTargetSqlQueries(_0x10aad2,_0x288ffe,_0x58ae9e[_0x22ca18(0xc9)](_0x22ca18(0xb0))||undefined);if(_0x2ac655[_0x22ca18(0xd1)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x22ca18(0xc3)};const _0x2b20b3=[],_0x30aac8=[],_0x1f46e0=[];let _0x4bf5c8=![];for(const _0x449ecd of _0x2ac655){const _0x2b0903=_0x288ffe[_0x22ca18(0xb3)][_0x449ecd['sqlCode']];if(!_0x2b0903){_0x1f46e0['push']({'sqlCode':_0x449ecd[_0x22ca18(0xc0)],'error':_0x22ca18(0xd9)});continue;}try{const _0x1c542f=await computeSqlFileHash(_0x449ecd['filePath']),_0x3b4a8a=_0x2b0903['path']!==_0x449ecd[_0x22ca18(0xa6)]||!!_0x449ecd[_0x22ca18(0xe0)]&&_0x2b0903[_0x22ca18(0xe0)]!==_0x449ecd['sqlName']||_0x2b0903['mode']!==_0x449ecd[_0x22ca18(0xdb)];if(!_0x58ae9e[_0x22ca18(0xd7)](_0x22ca18(0xb2))&&_0x2b0903[_0x22ca18(0xba)]===_0x1c542f&&!_0x3b4a8a){_0x30aac8[_0x22ca18(0xd3)]({'sqlCode':_0x449ecd[_0x22ca18(0xc0)],'reason':_0x22ca18(0xa8)});continue;}if(_0x2b0903[_0x22ca18(0xbb)]==null){_0x1f46e0[_0x22ca18(0xd3)]({'sqlCode':_0x449ecd[_0x22ca18(0xc0)],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x12bca8=_0x449ecd['sqlName']||_0x2b0903['sqlName'],_0x4b6c1a=await resolveTargetDbBinding(_0x58ae9e['appCode'],_0x449ecd,_0x2b0903),_0x5e94a5=await readSqlUploadContent(_0x449ecd),_0xa5e621=await updateSqlQuery({'id':_0x2b0903['remoteId'],'appCode':_0x58ae9e['appCode'],'sqlCode':_0x449ecd[_0x22ca18(0xc0)],'sqlName':_0x12bca8,'dbId':_0x4b6c1a['dbId'],'version':_0x2b0903[_0x22ca18(0xbb)],'sqlContent':_0x5e94a5,'sqlConfig':_0x2b0903[_0x22ca18(0xdf)]??undefined}),_0x40c8fe=_0xa5e621['dbId']?await getDbName(_0x58ae9e['appCode'],Number(_0xa5e621[_0x22ca18(0xb6)]))['catch'](()=>_0x4b6c1a['dbName']):_0x4b6c1a[_0x22ca18(0xc7)];_0x288ffe[_0x22ca18(0xb3)][_0x449ecd[_0x22ca18(0xc0)]]={...buildSqlLockEntry(_0xa5e621,_0x5e94a5,_0x1c542f,{'dbName':_0x40c8fe}),'path':_0x449ecd[_0x22ca18(0xa6)],'mode':_0x449ecd[_0x22ca18(0xdb)]},_0x4bf5c8=!![],await archivePreviousSqlFileIfNeeded(_0x10aad2,_0x2b0903[_0x22ca18(0xd4)],_0x449ecd[_0x22ca18(0xa6)]),_0x2b20b3['push']({'sqlCode':_0x449ecd['sqlCode'],'remoteId':_0x2b0903['remoteId']});}catch(_0x181b5a){_0x1f46e0[_0x22ca18(0xd3)]({'sqlCode':_0x449ecd[_0x22ca18(0xc0)],'error':_0x181b5a instanceof Error?_0x181b5a[_0x22ca18(0xc2)]:String(_0x181b5a)});}}(_0x4bf5c8||_0x1f46e0[_0x22ca18(0xd1)]===0x0)&&(_0x288ffe[_0x22ca18(0xd6)]=new Date()['toISOString'](),await writeSqlLockFile(_0x10aad2[_0x22ca18(0xa9)],_0x453acf));const _0x183fd4=_0x1f46e0[_0x22ca18(0xd1)]===0x0;return{'ok':_0x183fd4,'data':{'pushed':_0x2b20b3,'skipped':_0x30aac8,'failed':_0x1f46e0},'message':_0x22ca18(0xcc)+_0x2b20b3[_0x22ca18(0xd1)]+'\x20pushed,\x20'+_0x30aac8[_0x22ca18(0xd1)]+_0x22ca18(0xcf)+_0x1f46e0['length']+_0x22ca18(0xdd)};}};async function archivePreviousSqlFileIfNeeded(_0x1d91bb,_0x36aa72,_0x5da0be){const _0x2fae76=a254_0x5e9230;if(!_0x36aa72||_0x36aa72===_0x5da0be)return;const _0x2578a0=join(_0x1d91bb[_0x2fae76(0xb9)],_0x36aa72);if(!await fileExists(_0x2578a0))return;const _0x4a43d4=await moveToTrash(_0x1d91bb[_0x2fae76(0xbf)],_0x1d91bb[_0x2fae76(0xbc)],_0x2578a0);await cleanupEmptyDirectories(dirname(_0x2578a0),_0x1d91bb[_0x2fae76(0xb9)]),void _0x4a43d4;}async function moveToTrash(_0x1c54b6,_0x1e5e7e,_0x3a1e1e){const _0x282065=a254_0x5e9230,_0x2c2ca9=new Date()[_0x282065(0xcd)]()[_0x282065(0xd5)](/[:.]/g,'-'),_0x486ec4=relative(_0x1c54b6,_0x3a1e1e),_0x262d0b=join(_0x1e5e7e,_0x2c2ca9,_0x486ec4);return await mkdir(dirname(_0x262d0b),{'recursive':!![]}),await rename(_0x3a1e1e,_0x262d0b),_0x262d0b;}async function cleanupEmptyDirectories(_0x129223,_0x1747e0){const _0xd90003=a254_0x5e9230;let _0x57e32c=resolve(_0x129223);const _0x6b53e5=resolve(_0x1747e0);while(_0x57e32c['startsWith'](''+_0x6b53e5+sep)||_0x57e32c===_0x6b53e5){if(_0x57e32c===_0x6b53e5)return;try{const _0xee91c8=await readdir(_0x57e32c);if(_0xee91c8[_0xd90003(0xd1)]>0x0)return;await rmdir(_0x57e32c);}catch{return;}_0x57e32c=dirname(_0x57e32c);}}async function resolveTargetDbBinding(_0x3d8f05,_0x2c1c58,_0x5c3762){const _0x11ffa9=a254_0x5e9230,_0x247db1=_0x2c1c58[_0x11ffa9(0xac)];if(!_0x247db1)return{'dbId':_0x5c3762['dbId'],'dbName':_0x5c3762[_0x11ffa9(0xc7)]};const _0x1d5837=buildDbDirectoryName(_0x5c3762[_0x11ffa9(0xc7)],_0x5c3762[_0x11ffa9(0xb6)]);if(_0x247db1===_0x1d5837)return{'dbId':_0x5c3762[_0x11ffa9(0xb6)],'dbName':_0x5c3762[_0x11ffa9(0xc7)]};const _0x183749=parseExplicitDbDirectory(_0x247db1);if(_0x183749!=null)return{'dbId':_0x183749,'dbName':await getDbName(_0x3d8f05,_0x183749)['catch'](()=>undefined)};const _0x4c3bb2=await listDatabases(_0x3d8f05),_0x5823d1=_0x4c3bb2['filter'](_0x35b4d0=>buildDbDirectoryName(_0x35b4d0[_0x11ffa9(0xc7)],_0x35b4d0[_0x11ffa9(0xb6)])===_0x247db1);if(_0x5823d1[_0x11ffa9(0xd1)]===0x1)return{'dbId':_0x5823d1[0x0][_0x11ffa9(0xb6)],'dbName':_0x5823d1[0x0][_0x11ffa9(0xc7)]};if(_0x5823d1[_0x11ffa9(0xd1)]===0x0)throw CliErrors[_0x11ffa9(0xc1)]('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x247db1+_0x11ffa9(0xe2)+_0x2c1c58['sqlCode']+'.');const _0x33a9fe=_0x5823d1[_0x11ffa9(0xce)](_0x27072c=>_0x27072c['dbName']+'\x20('+_0x27072c[_0x11ffa9(0xb6)]+')')[_0x11ffa9(0xde)](',\x20');throw CliErrors['validation'](_0x11ffa9(0xda)+_0x247db1+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x2c1c58[_0x11ffa9(0xc0)]+':\x20'+_0x33a9fe);}function parseExplicitDbDirectory(_0x5e3bf7){const _0x24a9c8=a254_0x5e9230,_0x2d9b89=/^db-(\d+)$/[_0x24a9c8(0xaa)](_0x5e3bf7);if(!_0x2d9b89)return null;const _0x2202a5=Number(_0x2d9b89[0x1]);return Number[_0x24a9c8(0xd0)](_0x2202a5)&&_0x2202a5>0x0?_0x2202a5:null;}
@@ -1 +1 @@
1
- (function(_0xe1e2e1,_0x3355fb){const _0x1ed1e7=a255_0x4e44,_0x21e230=_0xe1e2e1();while(!![]){try{const _0x30da3a=parseInt(_0x1ed1e7(0x91))/0x1+-parseInt(_0x1ed1e7(0x87))/0x2*(-parseInt(_0x1ed1e7(0x95))/0x3)+-parseInt(_0x1ed1e7(0x8e))/0x4*(parseInt(_0x1ed1e7(0xa7))/0x5)+parseInt(_0x1ed1e7(0xab))/0x6*(parseInt(_0x1ed1e7(0xb6))/0x7)+parseInt(_0x1ed1e7(0xb4))/0x8*(parseInt(_0x1ed1e7(0x9b))/0x9)+-parseInt(_0x1ed1e7(0xa2))/0xa+-parseInt(_0x1ed1e7(0x8c))/0xb*(parseInt(_0x1ed1e7(0x97))/0xc);if(_0x30da3a===_0x3355fb)break;else _0x21e230['push'](_0x21e230['shift']());}catch(_0x50ef63){_0x21e230['push'](_0x21e230['shift']());}}}(a255_0x3f48,0xa59fe));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR='.rabetbase/sql';export function buildSqlLockEntry(_0x2b4c27,_0x516693,_0x196be7,_0x35d9ff){const _0x431f1d=a255_0x4e44,_0x2dcda5=detectSqlMode(_0x516693);return{'path':buildSqlRelativePath(_0x2b4c27[_0x431f1d(0xb5)],_0x2b4c27[_0x431f1d(0xaf)],_0x35d9ff?.[_0x431f1d(0xad)],_0x2dcda5,_0x2b4c27['dbId']),'hash':_0x196be7,'remoteId':_0x2b4c27['id'],'version':_0x2b4c27[_0x431f1d(0x98)],'dbId':Number(_0x2b4c27['dbId']),'dbName':_0x35d9ff?.[_0x431f1d(0xad)],'sqlName':_0x2b4c27[_0x431f1d(0xaf)],'sqlConfig':_0x2b4c27[_0x431f1d(0xa1)]??undefined,'mode':_0x2dcda5};}function a255_0x4e44(_0x16d918,_0x42a5ff){_0x16d918=_0x16d918-0x85;const _0x3f4894=a255_0x3f48();let _0x4e44a0=_0x3f4894[_0x16d918];return _0x4e44a0;}export function cloneSqlLockData(_0x9901ed){const _0x531699=a255_0x4e44;return{'apps':Object[_0x531699(0x9e)](Object[_0x531699(0xb7)](_0x9901ed[_0x531699(0xa5)])[_0x531699(0xac)](([_0x4df80d,_0x57c5ea])=>[_0x4df80d,{'sqlRoot':_0x57c5ea[_0x531699(0xa6)],'lastSync':_0x57c5ea[_0x531699(0x9d)],'sqls':{..._0x57c5ea['sqls']}}]))};}export function ensureRemoteSqlContent(_0x489929){return _0x489929['sqlContent']??'';}export function buildLocalSqlFileContent(_0x14dce9,_0x4efc82,_0x18e2a9){const _0x4c8fe8=a255_0x4e44,_0x2333d1=_0x18e2a9?.['mode']??detectSqlMode(_0x4efc82),_0x45811e=stripLocalSqlMetadata(_0x4efc82,_0x2333d1)[_0x4c8fe8(0x8a)](),_0x30290f=buildMetadataHeaderLines({'sqlCode':_0x14dce9[_0x4c8fe8(0xb5)],'sqlName':_0x14dce9['sqlName'],'dbId':_0x14dce9[_0x4c8fe8(0xa4)],'dbName':_0x18e2a9?.[_0x4c8fe8(0xad)],'mode':_0x2333d1,'syncedAt':_0x18e2a9?.['syncedAt'],'description':_0x18e2a9?.['description']},_0x2333d1),_0x1f0452=_0x2333d1===_0x4c8fe8(0x90)?splitXmlDeclaration(_0x45811e):{'body':_0x45811e},_0x19f8bc=[..._0x1f0452['declaration']?[_0x1f0452[_0x4c8fe8(0x96)]]:[],..._0x30290f,'',_0x1f0452[_0x4c8fe8(0x86)][_0x4c8fe8(0x92)]()],_0x43e106=_0x19f8bc[_0x4c8fe8(0x8b)]('\x0a');return _0x43e106[_0x4c8fe8(0x8d)]('\x0a')?_0x43e106:_0x43e106+'\x0a';}export function stripLocalSqlMetadata(_0x134949,_0x206a39){const _0x3ecff7=a255_0x4e44;if(_0x206a39===_0x3ecff7(0x90)){const {declaration:_0x16c215,body:_0x5eb8d9}=splitXmlDeclaration(_0x134949['replace'](/\r\n/g,'\x0a')),_0x3cbf5b=stripLeadingMetadataLines(_0x5eb8d9,/^\s*<!--\s*@lovrabet\./);return _0x16c215?''+_0x16c215+(_0x3cbf5b?'\x0a'+_0x3cbf5b:''):_0x3cbf5b;}return stripLeadingMetadataLines(_0x134949[_0x3ecff7(0xb0)](/\r\n/g,'\x0a'),/^\s*--\s*@lovrabet\./);}export function resolveSqlMode(_0x534a3f,_0x24b8c8){const _0xa056c2=a255_0x4e44;if(_0x24b8c8?.['mode'])return _0x24b8c8[_0xa056c2(0x88)];return detectSqlMode(_0x534a3f);}export function resolveSqlFileName(_0xa252fe,_0x4b3b85,_0x1fa946){const _0x3fd182=a255_0x4e44;if(_0x1fa946?.['path'])return _0x1fa946[_0x3fd182(0x89)];if(_0x1fa946?.[_0x3fd182(0xaf)]||_0x1fa946?.['dbName'])return buildSqlRelativePath(_0xa252fe,_0x1fa946?.[_0x3fd182(0xaf)],_0x1fa946?.[_0x3fd182(0xad)],resolveSqlMode(_0x4b3b85,_0x1fa946),_0x1fa946?.[_0x3fd182(0xa4)]);return buildDefaultSqlFileName(_0xa252fe,resolveSqlMode(_0x4b3b85,_0x1fa946));}export function resolveSqlLocalDir(_0x311c81,_0x37107c){return join(_0x311c81,SQL_LOCAL_REL_DIR,_0x37107c);}export async function confirmForceOverwrite(_0x577995){const _0x1c81ce=a255_0x4e44,_0x36ba60=createInterface({'input':process[_0x1c81ce(0xa9)],'output':process['stderr']}),_0x52ee77=await new Promise(_0x43d3a5=>{const _0x241188=_0x1c81ce;_0x36ba60['question'](_0x577995+_0x241188(0xb3),_0x43d3a5);});return _0x36ba60[_0x1c81ce(0x9c)](),['y',_0x1c81ce(0xae)][_0x1c81ce(0x93)](_0x52ee77[_0x1c81ce(0x8a)]()[_0x1c81ce(0xaa)]());}export function findSqlLockScope(_0x33ebcc,_0x163916){const _0x47cffc=a255_0x4e44;return _0x33ebcc[_0x47cffc(0xa5)][_0x163916];}function buildMetadataHeaderLines(_0x230cef,_0x5468c0){const _0x27cdad=a255_0x4e44,_0x2625e9=[['sqlCode',_0x230cef[_0x27cdad(0xb5)]],[_0x27cdad(0xaf),_0x230cef['sqlName']],[_0x27cdad(0xa4),_0x230cef['dbId']],[_0x27cdad(0xad),_0x230cef[_0x27cdad(0xad)]],[_0x27cdad(0x88),_0x230cef[_0x27cdad(0x88)]],['syncedAt',_0x230cef[_0x27cdad(0x9a)]],[_0x27cdad(0xa0),_0x230cef['description']]];if(_0x5468c0==='mybatisXml')return _0x2625e9[_0x27cdad(0x99)](([,_0xc8e068])=>_0xc8e068!==undefined&&_0xc8e068!==null&&String(_0xc8e068)[_0x27cdad(0x8a)]()!=='')[_0x27cdad(0xac)](([_0xe696a3,_0x5eeac5])=>_0x27cdad(0xb1)+_0xe696a3+':\x20'+String(_0x5eeac5)+_0x27cdad(0x9f));return _0x2625e9[_0x27cdad(0x99)](([,_0x442c20])=>_0x442c20!==undefined&&_0x442c20!==null&&String(_0x442c20)['trim']()!=='')[_0x27cdad(0xac)](([_0x58451f,_0x30e536])=>_0x27cdad(0xa8)+_0x58451f+':\x20'+String(_0x30e536));}function splitXmlDeclaration(_0x144ca3){const _0xf4898b=a255_0x4e44,_0x4ff058=_0x144ca3[_0xf4898b(0x92)](),_0x5312fd=/^<\?xml(?=\s|\?>)[\s\S]*?\?>/i[_0xf4898b(0xb2)](_0x4ff058);if(!_0x5312fd)return{'body':_0x144ca3};return{'declaration':_0x5312fd[0x0],'body':_0x4ff058[_0xf4898b(0x94)](_0x5312fd[0x0][_0xf4898b(0xa3)])};}function stripLeadingMetadataLines(_0x45ec49,_0x51fc4a){const _0x4d87c9=a255_0x4e44,_0x146349=_0x45ec49[_0x4d87c9(0x8f)]('\x0a');let _0x518d6e=0x0;while(_0x518d6e<_0x146349[_0x4d87c9(0xa3)]){const _0x3e82e3=_0x146349[_0x518d6e]??'';if(_0x51fc4a[_0x4d87c9(0x85)](_0x3e82e3)||_0x3e82e3[_0x4d87c9(0x8a)]()===''){_0x518d6e++;continue;}break;}return _0x146349[_0x4d87c9(0x94)](_0x518d6e)['join']('\x0a')[_0x4d87c9(0x92)]();}function a255_0x3f48(){const _0x13d217=['toLowerCase','12tjlyzX','map','dbName','yes','sqlName','replace','<!--\x20@lovrabet.','exec','\x20[y/N]\x20','2008LPwTjX','sqlCode','40446pExMbu','entries','test','body','1930354hUhHyM','mode','path','trim','join','66RtWMlG','endsWith','44036dqbsYE','split','mybatisXml','1175854hOlonq','trimStart','includes','slice','3ksJGDX','declaration','2082864LUAuCH','version','filter','syncedAt','14598MOmiop','close','lastSync','fromEntries','\x20-->','description','sqlConfig','3004380hgDHMV','length','dbId','apps','sqlRoot','245BvbPhc','--\x20@lovrabet.','stdin'];a255_0x3f48=function(){return _0x13d217;};return a255_0x3f48();}
1
+ (function(_0x1c8b56,_0x30de10){const _0x5eabbb=a255_0x46f4,_0x333cb1=_0x1c8b56();while(!![]){try{const _0x4c4030=-parseInt(_0x5eabbb(0x119))/0x1+-parseInt(_0x5eabbb(0x10d))/0x2+parseInt(_0x5eabbb(0x124))/0x3+parseInt(_0x5eabbb(0x132))/0x4+-parseInt(_0x5eabbb(0x10a))/0x5*(-parseInt(_0x5eabbb(0x135))/0x6)+parseInt(_0x5eabbb(0x111))/0x7*(parseInt(_0x5eabbb(0x11d))/0x8)+-parseInt(_0x5eabbb(0x118))/0x9;if(_0x4c4030===_0x30de10)break;else _0x333cb1['push'](_0x333cb1['shift']());}catch(_0x936fc0){_0x333cb1['push'](_0x333cb1['shift']());}}}(a255_0x2a04,0x61634));function a255_0x46f4(_0x16cff5,_0x4e2485){_0x16cff5=_0x16cff5-0x105;const _0x2a04e2=a255_0x2a04();let _0x46f4e3=_0x2a04e2[_0x16cff5];return _0x46f4e3;}import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR='.rabetbase/sql';export function buildSqlLockEntry(_0x269e7d,_0x36e87c,_0xf2cc41,_0x44f5e6){const _0x2e68d9=a255_0x46f4,_0xf3d49e=detectSqlMode(_0x36e87c);return{'path':buildSqlRelativePath(_0x269e7d[_0x2e68d9(0x11a)],_0x269e7d[_0x2e68d9(0x133)],_0x44f5e6?.[_0x2e68d9(0x106)],_0xf3d49e,_0x269e7d['dbId']),'hash':_0xf2cc41,'remoteId':_0x269e7d['id'],'version':_0x269e7d[_0x2e68d9(0x11f)],'dbId':Number(_0x269e7d[_0x2e68d9(0x12e)]),'dbName':_0x44f5e6?.[_0x2e68d9(0x106)],'sqlName':_0x269e7d[_0x2e68d9(0x133)],'sqlConfig':_0x269e7d['sqlConfig']??undefined,'mode':_0xf3d49e};}export function cloneSqlLockData(_0x1ee17b){const _0x4144c8=a255_0x46f4;return{'apps':Object[_0x4144c8(0x107)](Object[_0x4144c8(0x12d)](_0x1ee17b['apps'])[_0x4144c8(0x113)](([_0x2c1b6f,_0x20e003])=>[_0x2c1b6f,{'sqlRoot':_0x20e003[_0x4144c8(0x10b)],'lastSync':_0x20e003[_0x4144c8(0x125)],'sqls':{..._0x20e003[_0x4144c8(0x12f)]}}]))};}export function ensureRemoteSqlContent(_0x266e63){const _0x1c9e04=a255_0x46f4;return _0x266e63[_0x1c9e04(0x120)]??'';}export function buildLocalSqlFileContent(_0x3fb9d6,_0x7c5174,_0x1642e6){const _0x560ea1=a255_0x46f4,_0x2a1dc0=_0x1642e6?.['mode']??detectSqlMode(_0x7c5174),_0x5e531e=stripLocalSqlMetadata(_0x7c5174,_0x2a1dc0)['trim'](),_0x5dec39=buildMetadataHeaderLines({'sqlCode':_0x3fb9d6[_0x560ea1(0x11a)],'sqlName':_0x3fb9d6[_0x560ea1(0x133)],'dbId':_0x3fb9d6[_0x560ea1(0x12e)],'dbName':_0x1642e6?.[_0x560ea1(0x106)],'mode':_0x2a1dc0,'syncedAt':_0x1642e6?.[_0x560ea1(0x116)],'description':_0x1642e6?.[_0x560ea1(0x11e)]},_0x2a1dc0),_0x312c96=_0x2a1dc0===_0x560ea1(0x122)?splitXmlDeclaration(_0x5e531e):{'body':_0x5e531e},_0x167bbc=[..._0x312c96['declaration']?[_0x312c96[_0x560ea1(0x10f)]]:[],..._0x5dec39,'',_0x312c96[_0x560ea1(0x131)][_0x560ea1(0x12c)]()],_0x479b86=_0x167bbc[_0x560ea1(0x112)]('\x0a');return _0x479b86[_0x560ea1(0x115)]('\x0a')?_0x479b86:_0x479b86+'\x0a';}export function stripLocalSqlMetadata(_0x540980,_0x204297){const _0x2e6f23=a255_0x46f4;if(_0x204297===_0x2e6f23(0x122)){const {declaration:_0x22495b,body:_0x6fff07}=splitXmlDeclaration(_0x540980[_0x2e6f23(0x105)](/\r\n/g,'\x0a')),_0x1208a2=stripLeadingMetadataLines(_0x6fff07,/^\s*<!--\s*@lovrabet\./);return _0x22495b?''+_0x22495b+(_0x1208a2?'\x0a'+_0x1208a2:''):_0x1208a2;}return stripLeadingMetadataLines(_0x540980[_0x2e6f23(0x105)](/\r\n/g,'\x0a'),/^\s*--\s*@lovrabet\./);}export function resolveSqlMode(_0x2a0737,_0x328146){const _0x27426c=a255_0x46f4;if(_0x328146?.['mode'])return _0x328146[_0x27426c(0x129)];return detectSqlMode(_0x2a0737);}export function resolveSqlFileName(_0x564227,_0x339f83,_0x48b0a3){const _0x25fd69=a255_0x46f4;if(_0x48b0a3?.[_0x25fd69(0x117)])return _0x48b0a3[_0x25fd69(0x117)];if(_0x48b0a3?.['sqlName']||_0x48b0a3?.['dbName'])return buildSqlRelativePath(_0x564227,_0x48b0a3?.[_0x25fd69(0x133)],_0x48b0a3?.[_0x25fd69(0x106)],resolveSqlMode(_0x339f83,_0x48b0a3),_0x48b0a3?.[_0x25fd69(0x12e)]);return buildDefaultSqlFileName(_0x564227,resolveSqlMode(_0x339f83,_0x48b0a3));}export function resolveSqlLocalDir(_0x2cf351,_0x2df306){return join(_0x2cf351,SQL_LOCAL_REL_DIR,_0x2df306);}export async function confirmForceOverwrite(_0x4f756d){const _0x3533a4=a255_0x46f4,_0x3c6df1=createInterface({'input':process[_0x3533a4(0x130)],'output':process[_0x3533a4(0x110)]}),_0xdf4e4d=await new Promise(_0x6aa25d=>{const _0x37b68e=_0x3533a4;_0x3c6df1[_0x37b68e(0x128)](_0x4f756d+_0x37b68e(0x121),_0x6aa25d);});return _0x3c6df1[_0x3533a4(0x10e)](),['y',_0x3533a4(0x114)][_0x3533a4(0x12a)](_0xdf4e4d[_0x3533a4(0x11c)]()[_0x3533a4(0x123)]());}export function findSqlLockScope(_0x5d4ee2,_0x2baf8f){return _0x5d4ee2['apps'][_0x2baf8f];}function buildMetadataHeaderLines(_0x22a627,_0x3f1d08){const _0x35d2d8=a255_0x46f4,_0x833c6a=[[_0x35d2d8(0x11a),_0x22a627[_0x35d2d8(0x11a)]],[_0x35d2d8(0x133),_0x22a627[_0x35d2d8(0x133)]],['dbId',_0x22a627[_0x35d2d8(0x12e)]],[_0x35d2d8(0x106),_0x22a627['dbName']],[_0x35d2d8(0x129),_0x22a627['mode']],[_0x35d2d8(0x116),_0x22a627[_0x35d2d8(0x116)]],[_0x35d2d8(0x11e),_0x22a627[_0x35d2d8(0x11e)]]];if(_0x3f1d08===_0x35d2d8(0x122))return _0x833c6a[_0x35d2d8(0x12b)](([,_0x2aae4a])=>_0x2aae4a!==undefined&&_0x2aae4a!==null&&String(_0x2aae4a)[_0x35d2d8(0x11c)]()!=='')['map'](([_0x2716eb,_0x240f00])=>_0x35d2d8(0x108)+_0x2716eb+':\x20'+String(_0x240f00)+'\x20-->');return _0x833c6a[_0x35d2d8(0x12b)](([,_0xab5fb5])=>_0xab5fb5!==undefined&&_0xab5fb5!==null&&String(_0xab5fb5)[_0x35d2d8(0x11c)]()!=='')[_0x35d2d8(0x113)](([_0x553f2a,_0x5ed6b2])=>_0x35d2d8(0x134)+_0x553f2a+':\x20'+String(_0x5ed6b2));}function splitXmlDeclaration(_0x3c2596){const _0x5345bf=a255_0x46f4,_0x326fd9=_0x3c2596[_0x5345bf(0x12c)](),_0x3675d4=/^<\?xml(?=\s|\?>)[\s\S]*?\?>/i[_0x5345bf(0x10c)](_0x326fd9);if(!_0x3675d4)return{'body':_0x3c2596};return{'declaration':_0x3675d4[0x0],'body':_0x326fd9[_0x5345bf(0x127)](_0x3675d4[0x0][_0x5345bf(0x109)])};}function stripLeadingMetadataLines(_0x2a1dcc,_0x561d26){const _0x59a981=a255_0x46f4,_0x1a7c45=_0x2a1dcc[_0x59a981(0x11b)]('\x0a');let _0x28dfcb=0x0;while(_0x28dfcb<_0x1a7c45[_0x59a981(0x109)]){const _0x597e6e=_0x1a7c45[_0x28dfcb]??'';if(_0x561d26[_0x59a981(0x126)](_0x597e6e)||_0x597e6e['trim']()===''){_0x28dfcb++;continue;}break;}return _0x1a7c45[_0x59a981(0x127)](_0x28dfcb)[_0x59a981(0x112)]('\x0a')[_0x59a981(0x12c)]();}function a255_0x2a04(){const _0x2fb7e1=['lastSync','test','slice','question','mode','includes','filter','trimStart','entries','dbId','sqls','stdin','body','2714688tqqzsN','sqlName','--\x20@lovrabet.','108xXkjMW','replace','dbName','fromEntries','<!--\x20@lovrabet.','length','176520CfQAOO','sqlRoot','exec','643786KNSVMG','close','declaration','stderr','826JcxntN','join','map','yes','endsWith','syncedAt','path','10683513YPyeQx','510162JnamMc','sqlCode','split','trim','22648DmSbyJ','description','version','sqlContent','\x20[y/N]\x20','mybatisXml','toLowerCase','2309430FNJiUC'];a255_0x2a04=function(){return _0x2fb7e1;};return a255_0x2a04();}