@lovrabet/rabetbase-cli 2.4.3 → 2.4.4

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 (381) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/index.js +1 -1
  20. package/lib/commands/app/list.js +1 -1
  21. package/lib/commands/app/members-list.js +1 -1
  22. package/lib/commands/app/remote-directory.js +1 -1
  23. package/lib/commands/app/shared.js +1 -1
  24. package/lib/commands/app-config/delete.js +1 -1
  25. package/lib/commands/app-config/get.js +1 -1
  26. package/lib/commands/app-config/index.js +1 -1
  27. package/lib/commands/app-config/list.js +1 -1
  28. package/lib/commands/app-config/set.js +1 -1
  29. package/lib/commands/app-config/shared.js +1 -1
  30. package/lib/commands/auth/index.js +1 -1
  31. package/lib/commands/bff/create.js +1 -1
  32. package/lib/commands/bff/delete.js +1 -1
  33. package/lib/commands/bff/detail.js +1 -1
  34. package/lib/commands/bff/index.js +1 -1
  35. package/lib/commands/bff/list.js +1 -1
  36. package/lib/commands/bff/pull.js +1 -1
  37. package/lib/commands/bff/push.js +1 -1
  38. package/lib/commands/bff/status.js +1 -1
  39. package/lib/commands/cli-skill/index.js +1 -1
  40. package/lib/commands/cli-update.js +1 -1
  41. package/lib/commands/codegen/index.js +1 -1
  42. package/lib/commands/codegen/sdk.js +1 -1
  43. package/lib/commands/codegen/sql.js +1 -1
  44. package/lib/commands/common/app-registry.js +1 -1
  45. package/lib/commands/common/app-selector.js +1 -1
  46. package/lib/commands/common/async-task.js +1 -1
  47. package/lib/commands/common/dry-run.js +1 -1
  48. package/lib/commands/common/flags.js +1 -1
  49. package/lib/commands/common/local-file.js +1 -1
  50. package/lib/commands/common/validate.js +1 -1
  51. package/lib/commands/config/get.js +1 -1
  52. package/lib/commands/config/index.js +1 -1
  53. package/lib/commands/config/list.js +1 -1
  54. package/lib/commands/config/set.js +1 -1
  55. package/lib/commands/config/shared.js +1 -1
  56. package/lib/commands/data/filter.js +1 -1
  57. package/lib/commands/data/getOne.js +1 -1
  58. package/lib/commands/data/index.js +1 -1
  59. package/lib/commands/data/shared.js +1 -1
  60. package/lib/commands/dataset/business-group-update.js +1 -1
  61. package/lib/commands/dataset/capability.js +1 -1
  62. package/lib/commands/dataset/delete.js +1 -1
  63. package/lib/commands/dataset/detail.js +1 -1
  64. package/lib/commands/dataset/extend-update.js +1 -1
  65. package/lib/commands/dataset/field-update.js +1 -1
  66. package/lib/commands/dataset/generate.js +1 -1
  67. package/lib/commands/dataset/index.js +1 -1
  68. package/lib/commands/dataset/list.js +1 -1
  69. package/lib/commands/dataset/operations.js +1 -1
  70. package/lib/commands/dataset/relation-audit.js +1 -1
  71. package/lib/commands/dataset/relation-create.js +1 -1
  72. package/lib/commands/dataset/relation-delete.js +1 -1
  73. package/lib/commands/dataset/relation-shared.js +1 -1
  74. package/lib/commands/dataset/relation-update.js +1 -1
  75. package/lib/commands/dataset/relations.js +1 -1
  76. package/lib/commands/dataset/rename.js +1 -1
  77. package/lib/commands/dataset/restore.js +1 -1
  78. package/lib/commands/db/analysis-batching.js +1 -1
  79. package/lib/commands/db/analyze-batch-plan.js +1 -1
  80. package/lib/commands/db/analyze-cancel.js +1 -1
  81. package/lib/commands/db/analyze-start.js +1 -1
  82. package/lib/commands/db/analyze-status.js +1 -1
  83. package/lib/commands/db/create.js +1 -1
  84. package/lib/commands/db/delete.js +1 -1
  85. package/lib/commands/db/detail.js +1 -1
  86. package/lib/commands/db/diff-refresh-start.d.ts +2 -0
  87. package/lib/commands/db/diff-refresh-start.js +1 -0
  88. package/lib/commands/db/diff-refresh-status.d.ts +2 -0
  89. package/lib/commands/db/diff-refresh-status.js +1 -0
  90. package/lib/commands/db/diff.js +1 -1
  91. package/lib/commands/db/index.js +1 -1
  92. package/lib/commands/db/list.js +1 -1
  93. package/lib/commands/db/shared.js +1 -1
  94. package/lib/commands/db/tables.js +1 -1
  95. package/lib/commands/db/test.js +1 -1
  96. package/lib/commands/db/update.js +1 -1
  97. package/lib/commands/doctor.js +1 -1
  98. package/lib/commands/file/index.js +1 -1
  99. package/lib/commands/init/index.js +1 -1
  100. package/lib/commands/issue/index.js +1 -1
  101. package/lib/commands/issue/nudge.js +1 -1
  102. package/lib/commands/issue/report.js +1 -1
  103. package/lib/commands/issue/shared.js +1 -1
  104. package/lib/commands/kb/create.js +1 -1
  105. package/lib/commands/kb/delete.js +1 -1
  106. package/lib/commands/kb/detail.js +1 -1
  107. package/lib/commands/kb/index.js +1 -1
  108. package/lib/commands/kb/list.js +1 -1
  109. package/lib/commands/kb/shared.js +1 -1
  110. package/lib/commands/kb/update.js +1 -1
  111. package/lib/commands/logs/index.js +1 -1
  112. package/lib/commands/menu/asset-update.js +1 -1
  113. package/lib/commands/menu/delete.js +1 -1
  114. package/lib/commands/menu/external-link-create.js +1 -1
  115. package/lib/commands/menu/external-link-update.js +1 -1
  116. package/lib/commands/menu/group-create.js +1 -1
  117. package/lib/commands/menu/group-update.js +1 -1
  118. package/lib/commands/menu/index.js +1 -1
  119. package/lib/commands/menu/list.js +1 -1
  120. package/lib/commands/menu/move.js +1 -1
  121. package/lib/commands/menu/regroup-start.js +1 -1
  122. package/lib/commands/menu/rename.js +1 -1
  123. package/lib/commands/menu/shared/compare-table.js +1 -1
  124. package/lib/commands/menu/shared/delete-plan.js +1 -1
  125. package/lib/commands/menu/shared/facts.js +1 -1
  126. package/lib/commands/menu/shared/index.js +1 -1
  127. package/lib/commands/menu/shared/inquirer.js +1 -1
  128. package/lib/commands/menu/shared/local-pages.js +1 -1
  129. package/lib/commands/menu/shared/logic.js +1 -1
  130. package/lib/commands/menu/shared/mutations.js +1 -1
  131. package/lib/commands/menu/shared/service.js +1 -1
  132. package/lib/commands/menu/shared/sync-core.js +1 -1
  133. package/lib/commands/menu/shared/update-core.js +1 -1
  134. package/lib/commands/menu/shared/valid-url.js +1 -1
  135. package/lib/commands/menu/sync.js +1 -1
  136. package/lib/commands/notification/config-create.d.ts +2 -0
  137. package/lib/commands/notification/config-create.js +1 -0
  138. package/lib/commands/notification/config-delete.d.ts +2 -0
  139. package/lib/commands/notification/config-delete.js +1 -0
  140. package/lib/commands/notification/config-list.js +1 -1
  141. package/lib/commands/notification/config-update.d.ts +2 -0
  142. package/lib/commands/notification/config-update.js +1 -0
  143. package/lib/commands/notification/index.js +1 -1
  144. package/lib/commands/notification/shared.d.ts +97 -0
  145. package/lib/commands/notification/shared.js +1 -0
  146. package/lib/commands/ocr/index.js +1 -1
  147. package/lib/commands/page/generate-start.js +1 -1
  148. package/lib/commands/page/generate-status.js +1 -1
  149. package/lib/commands/page/index.js +1 -1
  150. package/lib/commands/page/pull.js +1 -1
  151. package/lib/commands/page/push.js +1 -1
  152. package/lib/commands/page/react/create.js +1 -1
  153. package/lib/commands/page/react/detail.js +1 -1
  154. package/lib/commands/page/react/list.js +1 -1
  155. package/lib/commands/page/react/publish.js +1 -1
  156. package/lib/commands/page/react/shared.js +1 -1
  157. package/lib/commands/page/react/syntax.js +1 -1
  158. package/lib/commands/page/react/template.js +1 -1
  159. package/lib/commands/page/react/update.js +1 -1
  160. package/lib/commands/page/relation-audit.js +1 -1
  161. package/lib/commands/page/restore.js +1 -1
  162. package/lib/commands/page/shared.js +1 -1
  163. package/lib/commands/page/standard-page-status.js +1 -1
  164. package/lib/commands/page/sync.js +1 -1
  165. package/lib/commands/permit/index.js +1 -1
  166. package/lib/commands/permit/page-get.js +1 -1
  167. package/lib/commands/permit/page-set.js +1 -1
  168. package/lib/commands/permit/role-apis-set.js +1 -1
  169. package/lib/commands/permit/role-menus-set.js +1 -1
  170. package/lib/commands/permit/role-menus.js +1 -1
  171. package/lib/commands/permit/shared.js +1 -1
  172. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  173. package/lib/commands/project/create/format-elapsed.js +1 -1
  174. package/lib/commands/project/create/main.d.ts +1 -0
  175. package/lib/commands/project/create/main.js +1 -1
  176. package/lib/commands/project/create/materialize-project-template.d.ts +11 -0
  177. package/lib/commands/project/create/materialize-project-template.js +1 -0
  178. package/lib/commands/project/create/project-name.d.ts +2 -0
  179. package/lib/commands/project/create/project-name.js +1 -0
  180. package/lib/commands/project/create/project-template-archive.d.ts +6 -0
  181. package/lib/commands/project/create/project-template-archive.js +1 -0
  182. package/lib/commands/project/create/project-template-path.d.ts +1 -3
  183. package/lib/commands/project/create/project-template-path.js +1 -1
  184. package/lib/commands/project/create/use-copy-project-template.d.ts +2 -1
  185. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  186. package/lib/commands/project/create/use-format-code.js +1 -1
  187. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  188. package/lib/commands/project/index.js +1 -1
  189. package/lib/commands/project/upgrade.js +1 -1
  190. package/lib/commands/registry.js +1 -1
  191. package/lib/commands/role/create.js +1 -1
  192. package/lib/commands/role/delete.js +1 -1
  193. package/lib/commands/role/detail.js +1 -1
  194. package/lib/commands/role/index.js +1 -1
  195. package/lib/commands/role/list.js +1 -1
  196. package/lib/commands/role/shared.js +1 -1
  197. package/lib/commands/role/update.js +1 -1
  198. package/lib/commands/role/user-add.js +1 -1
  199. package/lib/commands/role/user-remove.js +1 -1
  200. package/lib/commands/role/user-resolve.js +1 -1
  201. package/lib/commands/run/index.js +1 -1
  202. package/lib/commands/schema.js +1 -1
  203. package/lib/commands/sql/create.js +1 -1
  204. package/lib/commands/sql/delete.js +1 -1
  205. package/lib/commands/sql/detail.js +1 -1
  206. package/lib/commands/sql/exec.js +1 -1
  207. package/lib/commands/sql/index.js +1 -1
  208. package/lib/commands/sql/list.js +1 -1
  209. package/lib/commands/sql/pull.js +1 -1
  210. package/lib/commands/sql/push.js +1 -1
  211. package/lib/commands/sql/shared.js +1 -1
  212. package/lib/commands/sql/status.js +1 -1
  213. package/lib/commands/sql/validate.js +1 -1
  214. package/lib/commands/task/index.js +1 -1
  215. package/lib/commands/task/status.js +1 -1
  216. package/lib/commands/tenant/index.js +1 -1
  217. package/lib/commands/tenant/members-list.js +1 -1
  218. package/lib/commands/tenant/shared.js +1 -1
  219. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  220. package/lib/commands/user-account/index.js +1 -1
  221. package/lib/commands/workspace/add.js +1 -1
  222. package/lib/commands/workspace/index.js +1 -1
  223. package/lib/commands/workspace/remove.js +1 -1
  224. package/lib/config/schema.js +1 -1
  225. package/lib/constant/cdn.d.ts +2 -0
  226. package/lib/constant/cdn.js +1 -1
  227. package/lib/constant/cli.js +1 -1
  228. package/lib/constant/defaults.js +1 -1
  229. package/lib/constant/domain.js +1 -1
  230. package/lib/constant/env.js +1 -1
  231. package/lib/constant/output.js +1 -1
  232. package/lib/constant/paths.js +1 -1
  233. package/lib/constant/risk.js +1 -1
  234. package/lib/context/app-resolver.js +1 -1
  235. package/lib/context/auth-resolver.js +1 -1
  236. package/lib/context/config-loader.js +1 -1
  237. package/lib/context.d.ts +1 -1
  238. package/lib/context.js +1 -1
  239. package/lib/core/alias-resolver.js +1 -1
  240. package/lib/core/api-client.d.ts +29 -2
  241. package/lib/core/api-client.js +1 -1
  242. package/lib/core/bff/config.js +1 -1
  243. package/lib/core/bff/file-system.js +1 -1
  244. package/lib/core/bff/hash.js +1 -1
  245. package/lib/core/bff/lock.js +1 -1
  246. package/lib/core/bff/utils.js +1 -1
  247. package/lib/core/db-resolver.js +1 -1
  248. package/lib/core/page/file-system.js +1 -1
  249. package/lib/core/page/hash.js +1 -1
  250. package/lib/core/page/lock.js +1 -1
  251. package/lib/core/sql-index-auditor.js +1 -1
  252. package/lib/core/sql-sync/config.js +1 -1
  253. package/lib/core/sql-sync/file-system.js +1 -1
  254. package/lib/core/sql-sync/hash.js +1 -1
  255. package/lib/core/sql-sync/lock.js +1 -1
  256. package/lib/core/sql-sync/utils.js +1 -1
  257. package/lib/core/sql-validator.js +1 -1
  258. package/lib/errors.js +1 -1
  259. package/lib/framework/build-all-flags.js +1 -1
  260. package/lib/framework/error-output.js +1 -1
  261. package/lib/framework/explicit-yes.js +1 -1
  262. package/lib/framework/flags.js +1 -1
  263. package/lib/framework/help.js +1 -1
  264. package/lib/framework/index.js +1 -1
  265. package/lib/framework/output.js +1 -1
  266. package/lib/framework/response.js +1 -1
  267. package/lib/framework/runner-alias.js +1 -1
  268. package/lib/framework/runner.js +1 -1
  269. package/lib/framework/schema-export.js +1 -1
  270. package/lib/framework/types.js +1 -1
  271. package/lib/generated/build-info.d.ts +4 -4
  272. package/lib/generated/build-info.js +1 -1
  273. package/lib/help.js +1 -1
  274. package/lib/postinstall.js +1 -1
  275. package/lib/runtime/confirmation.js +1 -1
  276. package/lib/runtime/event.js +1 -1
  277. package/lib/runtime/index.js +1 -1
  278. package/lib/runtime/queue.js +1 -1
  279. package/lib/runtime/resolve.js +1 -1
  280. package/lib/skills/builtin-skill.js +1 -1
  281. package/lib/skills/main.js +1 -1
  282. package/lib/skills/npx-skills-add.js +1 -1
  283. package/lib/skills/skill-presence.js +1 -1
  284. package/lib/telemetry/cli-command-trace.js +1 -1
  285. package/lib/telemetry/cli-help-trace.js +1 -1
  286. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  287. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  288. package/lib/telemetry/send-cli-trace-log.js +1 -1
  289. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  290. package/lib/utils/ai_config.js +1 -1
  291. package/lib/utils/apply-jq-filter.js +1 -1
  292. package/lib/utils/cdn-config.js +1 -1
  293. package/lib/utils/check-sdk-version.js +1 -1
  294. package/lib/utils/cli-version-check.js +1 -1
  295. package/lib/utils/cli-version-policy.d.ts +13 -0
  296. package/lib/utils/cli-version-policy.js +1 -1
  297. package/lib/utils/config.js +1 -1
  298. package/lib/utils/entity-with-id.js +1 -1
  299. package/lib/utils/file-utils.js +1 -1
  300. package/lib/utils/guides-cdn.js +1 -1
  301. package/lib/utils/http-client.js +1 -1
  302. package/lib/utils/is-non-interactive.js +1 -1
  303. package/lib/utils/logger.js +1 -1
  304. package/lib/utils/params.js +1 -1
  305. package/lib/utils/platform.js +1 -1
  306. package/lib/utils/rules-cdn.js +1 -1
  307. package/lib/utils/sleep.js +1 -1
  308. package/lib/utils/template-replacer.js +1 -1
  309. package/lib/utils/update-notice.js +1 -1
  310. package/lib/utils/version.js +1 -1
  311. package/lib/utils/with-active-cookie.js +1 -1
  312. package/lib/utils/write-cli-side-channel.js +1 -1
  313. package/package.json +9 -4
  314. package/skills/rabetbase/SKILL.md +33 -22
  315. package/skills/rabetbase/guides/backend-function.md +5 -3
  316. package/skills/rabetbase/guides/bff-creation-workflow.md +2 -2
  317. package/skills/rabetbase/guides/conflict-detection.md +2 -2
  318. package/skills/rabetbase/guides/database-connection-workflow.md +39 -5
  319. package/skills/rabetbase/guides/react-custom-page-workflow.md +16 -4
  320. package/skills/rabetbase/guides/sql-creation-workflow.md +4 -2
  321. package/skills/rabetbase/guides/sql-mybatis.md +2 -2
  322. package/skills/rabetbase/knowledge/page-schema/YtPage.md +3 -37
  323. package/skills/rabetbase/knowledge/react-page/generation-standards.md +14 -3
  324. package/skills/rabetbase/references/rabetbase-app-config.md +2 -2
  325. package/skills/rabetbase/references/rabetbase-bff-push.md +4 -5
  326. package/skills/rabetbase/references/rabetbase-bff-save.md +3 -3
  327. package/skills/rabetbase/references/rabetbase-config.md +2 -2
  328. package/skills/rabetbase/references/rabetbase-db-analyze.md +2 -2
  329. package/skills/rabetbase/references/rabetbase-db-detail.md +3 -0
  330. package/skills/rabetbase/references/rabetbase-db-diff-refresh.md +53 -0
  331. package/skills/rabetbase/references/rabetbase-db-diff.md +40 -21
  332. package/skills/rabetbase/references/rabetbase-db-list.md +1 -1
  333. package/skills/rabetbase/references/rabetbase-kb.md +5 -3
  334. package/skills/rabetbase/references/rabetbase-menu-asset-update.md +9 -10
  335. package/skills/rabetbase/references/rabetbase-menu-external-link-update.md +1 -3
  336. package/skills/rabetbase/references/rabetbase-menu-regroup-start.md +2 -3
  337. package/skills/rabetbase/references/rabetbase-notification-config-list.md +2 -2
  338. package/skills/rabetbase/references/rabetbase-notification-config-mutations.md +56 -0
  339. package/skills/rabetbase/references/rabetbase-page-react-detail.md +1 -1
  340. package/skills/rabetbase/references/rabetbase-page-react-list.md +1 -1
  341. package/skills/rabetbase/references/rabetbase-page-react-publish.md +2 -2
  342. package/skills/rabetbase/references/rabetbase-project-create.md +3 -0
  343. package/skills/rabetbase/references/rabetbase-run.md +1 -1
  344. package/skills/rabetbase/references/rabetbase-sql-create.md +1 -1
  345. package/skills/rabetbase/references/rabetbase-sql-push.md +3 -4
  346. package/skills/rabetbase/references/rabetbase-user-account.md +0 -1
  347. package/skills/rabetbase.manifest.json +5 -5
  348. package/templates/README.md +14 -2
  349. package/lib/commands/project/create/non-interactive.d.ts +0 -9
  350. package/lib/commands/project/create/non-interactive.js +0 -1
  351. package/lib/utils/copy-directory.d.ts +0 -1
  352. package/lib/utils/copy-directory.js +0 -1
  353. package/skills/rabetbase/knowledge/page-schema/LrSmartEcharts.md +0 -291
  354. package/skills/rabetbase/knowledge/page-schema/LrSmartStatistic.md +0 -223
  355. package/templates/projects/sub-app-react-demo/.prettierrc +0 -1
  356. package/templates/projects/sub-app-react-demo/CHANGELOG.md +0 -67
  357. package/templates/projects/sub-app-react-demo/README.md +0 -246
  358. package/templates/projects/sub-app-react-demo/docs/quick-start.md +0 -245
  359. package/templates/projects/sub-app-react-demo/index.html +0 -27
  360. package/templates/projects/sub-app-react-demo/package.json +0 -34
  361. package/templates/projects/sub-app-react-demo/public/logo.svg +0 -1
  362. package/templates/projects/sub-app-react-demo/public/vite.svg +0 -1
  363. package/templates/projects/sub-app-react-demo/src/api/api.ts +0 -26
  364. package/templates/projects/sub-app-react-demo/src/api/client.ts +0 -32
  365. package/templates/projects/sub-app-react-demo/src/components/demo-page-container/DemoPageContainer.module.css +0 -28
  366. package/templates/projects/sub-app-react-demo/src/components/demo-page-container/DemoPageContainer.tsx +0 -55
  367. package/templates/projects/sub-app-react-demo/src/layouts/MainLayout.tsx +0 -308
  368. package/templates/projects/sub-app-react-demo/src/main.tsx +0 -52
  369. package/templates/projects/sub-app-react-demo/src/pages/dashboard/index.tsx +0 -570
  370. package/templates/projects/sub-app-react-demo/src/pages/data-screen/index.tsx +0 -531
  371. package/templates/projects/sub-app-react-demo/src/pages/index.module.css +0 -500
  372. package/templates/projects/sub-app-react-demo/src/pages/index.tsx +0 -641
  373. package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +0 -536
  374. package/templates/projects/sub-app-react-demo/src/pages/workbench/index.module.css +0 -295
  375. package/templates/projects/sub-app-react-demo/src/pages/workbench/index.tsx +0 -242
  376. package/templates/projects/sub-app-react-demo/src/router/index.tsx +0 -30
  377. package/templates/projects/sub-app-react-demo/src/style.css +0 -108
  378. package/templates/projects/sub-app-react-demo/src/utils/api.ts +0 -12
  379. package/templates/projects/sub-app-react-demo/src/vite-env.d.ts +0 -2
  380. package/templates/projects/sub-app-react-demo/tsconfig.json +0 -26
  381. package/templates/projects/sub-app-react-demo/vite.config.ts +0 -111
@@ -1 +1 @@
1
- const a180_0x4ddc65=a180_0x2963;function a180_0x1a36(){const _0x28188c=['1596gYQtDR','username','527598uoxpwS','name','trim','710902SSnsJV','matchedBy','408080ESBGAk','userId','\x22\x20→\x20userId\x20','str','6402472EEalho','211362gwWXaD','2FiiHxY','Pass\x20--name\x20<nickname|username>.','150gGFEhd','26983mvKstF','338787FIxADe','7UqtvUe','Resolved\x20\x22','user-resolve','35zHvgPp','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','flagMissing','nickname'];a180_0x1a36=function(){return _0x28188c;};return a180_0x1a36();}function a180_0x2963(_0x4de3a4,_0x26c997){_0x4de3a4=_0x4de3a4-0x92;const _0x1a36a9=a180_0x1a36();let _0x2963d2=_0x1a36a9[_0x4de3a4];return _0x2963d2;}(function(_0x2953b5,_0xf525a5){const _0x324bed=a180_0x2963,_0x52d247=_0x2953b5();while(!![]){try{const _0x44374a=-parseInt(_0x324bed(0xa6))/0x1+parseInt(_0x324bed(0x95))/0x2*(-parseInt(_0x324bed(0x94))/0x3)+-parseInt(_0x324bed(0xa8))/0x4*(-parseInt(_0x324bed(0x9d))/0x5)+-parseInt(_0x324bed(0xa3))/0x6*(parseInt(_0x324bed(0x9a))/0x7)+parseInt(_0x324bed(0x93))/0x8+-parseInt(_0x324bed(0x99))/0x9*(parseInt(_0x324bed(0x97))/0xa)+parseInt(_0x324bed(0x98))/0xb*(parseInt(_0x324bed(0xa1))/0xc);if(_0x44374a===_0xf525a5)break;else _0x52d247['push'](_0x52d247['shift']());}catch(_0x1c144f){_0x52d247['push'](_0x52d247['shift']());}}}(a180_0x1a36,0x634ec));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':'role','command':a180_0x4ddc65(0x9c),'description':a180_0x4ddc65(0x9e),'risk':'read','flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2a60e6){const _0x2bc23b=a180_0x4ddc65;if(!_0x2a60e6[_0x2bc23b(0x92)](_0x2bc23b(0xa4))[_0x2bc23b(0xa5)]())throw CliErrors[_0x2bc23b(0x9f)](_0x2bc23b(0xa4),_0x2bc23b(0x96));},async 'execute'(_0x1b900a){const _0x594740=a180_0x4ddc65,_0x8a0cf3=_0x1b900a['str'](_0x594740(0xa4))[_0x594740(0xa5)](),_0x59ca40=await resolveUserRef(_0x8a0cf3);return{'ok':!![],'data':{'user':{'userId':_0x59ca40[_0x594740(0xa9)],'username':_0x59ca40[_0x594740(0xa2)],'nickname':_0x59ca40[_0x594740(0xa0)],'matchedBy':_0x59ca40[_0x594740(0xa7)]}},'message':_0x594740(0x9b)+_0x8a0cf3+_0x594740(0xaa)+_0x59ca40[_0x594740(0xa9)]};}};
1
+ function a188_0xdf81(){const _0x332142=['name','read','Pass\x20--name\x20<nickname|username>.','Resolved\x20\x22','\x22\x20→\x20userId\x20','user-resolve','29613oZTZMS','342748qMxBvQ','12447BFTKtO','115SmSmZw','3634815LtWEGF','248ittvlF','8613654IZQMoL','role','username','trim','str','matchedBy','23920EbnnlW','4SBWYhv','11170pHSMXl','userId','12hkmUwp','33523556WISvQD'];a188_0xdf81=function(){return _0x332142;};return a188_0xdf81();}const a188_0x541470=a188_0x9e75;function a188_0x9e75(_0x21b461,_0x1ae0d2){_0x21b461=_0x21b461-0xc7;const _0xdf813f=a188_0xdf81();let _0x9e7537=_0xdf813f[_0x21b461];return _0x9e7537;}(function(_0x36e540,_0x420985){const _0x34768d=a188_0x9e75,_0x1694cf=_0x36e540();while(!![]){try{const _0x33cf99=-parseInt(_0x34768d(0xda))/0x1*(parseInt(_0x34768d(0xcb))/0x2)+-parseInt(_0x34768d(0xd7))/0x3*(parseInt(_0x34768d(0xcc))/0x4)+parseInt(_0x34768d(0xdb))/0x5+parseInt(_0x34768d(0xdd))/0x6+-parseInt(_0x34768d(0xd8))/0x7*(-parseInt(_0x34768d(0xdc))/0x8)+parseInt(_0x34768d(0xd9))/0x9*(parseInt(_0x34768d(0xcd))/0xa)+-parseInt(_0x34768d(0xd0))/0xb*(parseInt(_0x34768d(0xcf))/0xc);if(_0x33cf99===_0x420985)break;else _0x1694cf['push'](_0x1694cf['shift']());}catch(_0x51c686){_0x1694cf['push'](_0x1694cf['shift']());}}}(a188_0xdf81,0xc1750));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a188_0x541470(0xde),'command':a188_0x541470(0xd6),'description':'Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','risk':a188_0x541470(0xd2),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4e8c3e){const _0x87c5ae=a188_0x541470;if(!_0x4e8c3e['str'](_0x87c5ae(0xd1))[_0x87c5ae(0xc8)]())throw CliErrors['flagMissing'](_0x87c5ae(0xd1),_0x87c5ae(0xd3));},async 'execute'(_0x19680f){const _0xbecab0=a188_0x541470,_0x500030=_0x19680f[_0xbecab0(0xc9)](_0xbecab0(0xd1))['trim'](),_0x5a1cfc=await resolveUserRef(_0x500030);return{'ok':!![],'data':{'user':{'userId':_0x5a1cfc[_0xbecab0(0xce)],'username':_0x5a1cfc[_0xbecab0(0xc7)],'nickname':_0x5a1cfc['nickname'],'matchedBy':_0x5a1cfc[_0xbecab0(0xca)]}},'message':_0xbecab0(0xd4)+_0x500030+_0xbecab0(0xd5)+_0x5a1cfc[_0xbecab0(0xce)]};}};
@@ -1 +1 @@
1
- const a181_0x15f241=a181_0x122a;(function(_0x16e1dd,_0xbe5964){const _0x3ee325=a181_0x122a,_0x2f3f4e=_0x16e1dd();while(!![]){try{const _0x10ba68=parseInt(_0x3ee325(0x93))/0x1+-parseInt(_0x3ee325(0x99))/0x2+-parseInt(_0x3ee325(0x98))/0x3*(-parseInt(_0x3ee325(0xb1))/0x4)+-parseInt(_0x3ee325(0xc5))/0x5+parseInt(_0x3ee325(0xb4))/0x6+parseInt(_0x3ee325(0x96))/0x7+parseInt(_0x3ee325(0x9f))/0x8*(-parseInt(_0x3ee325(0x97))/0x9);if(_0x10ba68===_0xbe5964)break;else _0x2f3f4e['push'](_0x2f3f4e['shift']());}catch(_0x1ac363){_0x2f3f4e['push'](_0x2f3f4e['shift']());}}}(a181_0x1e77,0x3e081));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{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a181_0x15f241(0x8b),a181_0x15f241(0xae)]);function readPackageScripts(_0x5b07b6){const _0x29a47f=a181_0x15f241,_0x52e07b=resolve(_0x5b07b6,_0x29a47f(0xb3));if(!existsSync(_0x52e07b))return null;try{const _0x37227f=JSON['parse'](readFileSync(_0x52e07b,'utf-8'));return _0x37227f[_0x29a47f(0xa5)]??{};}catch{return null;}}function detectPackageManager(_0x4f2854){const _0x32eebe=a181_0x15f241;if(existsSync(resolve(_0x4f2854,_0x32eebe(0xaf)))||existsSync(resolve(_0x4f2854,'bun.lock')))return _0x32eebe(0xbc);if(existsSync(resolve(_0x4f2854,_0x32eebe(0xc4))))return'pnpm';if(existsSync(resolve(_0x4f2854,_0x32eebe(0xa6))))return _0x32eebe(0xab);return _0x32eebe(0x9a);}async function versionCheck(_0x4cdc04){const _0x5ed21e=a181_0x15f241,_0xa34d26=await checkCliVersion();(_0xa34d26[_0x5ed21e(0xa4)]||_0xa34d26[_0x5ed21e(0xac)])&&(printCliUpgradeWarning(_0xa34d26),assertCliVersionSupported(_0xa34d26));const _0x5c6e01=await checkSdkVersion(_0x4cdc04);if(_0x5c6e01[_0x5ed21e(0xa4)])printSdkUpgradeWarning(_0x5c6e01);}function a181_0x1e77(){const _0xdeca76=['No\x20scripts\x20defined\x20in\x20package.json.','close','length','40lqDGyv','\x0a\x20\x20Available\x20scripts:\x0a','run','\x20run\x20start','all','needsUpgrade','scripts','yarn.lock','\x0a\x20\x20Usage:\x20','log','\x20run\x20','validation','yarn','belowMinimum','error','dev','bun.lockb','watch','904348rbwhds','--watch','package.json','277620Kmvwsh','has','Enable\x20watch\x20mode\x20for\x20preview','join','push','Script\x20\x22','inherit','vite','bun','args','No\x20package.json\x20found\x20in\x20current\x20directory.','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','\x20\x20EXAMPLES','\x20exited\x20with\x20code\x20','preview','\x20run\x20preview\x20--watch','pnpm-lock.yaml','512160LSBmuu','keys','start','boolean','node_modules','.bin','Available:\x20','script','\x20run\x20preview','slice','267464mHKCEB','Script\x20name\x20defined\x20in\x20package.json','\x20\x20\x20\x20','1352169Qlmcrr','845883CWVvOu','6mEUTNy','265254Mgnuhk','npm','build'];a181_0x1e77=function(){return _0xdeca76;};return a181_0x1e77();}function spawnScript(_0x37c32b,_0xe57311,_0x15917a,_0x448266){return new Promise((_0x936bdc,_0x54a9d4)=>{const _0x6997dd=a181_0x122a,_0x51d3a8=[_0x6997dd(0xa1),_0xe57311,..._0x15917a],_0x3e2907=spawn(_0x37c32b,_0x51d3a8,{'cwd':_0x448266,'stdio':_0x6997dd(0xba),'shell':!![],'env':{...process.env,'PATH':''+join(_0x448266,_0x6997dd(0x8d),_0x6997dd(0x8e))+delimiter+process.env.PATH}});_0x3e2907['on']('close',_0x51df4e=>{const _0x59cbe6=_0x6997dd;if(_0x51df4e===0x0||_0x51df4e===null)_0x936bdc();else _0x54a9d4(new Error(_0x37c32b+_0x59cbe6(0xa9)+_0xe57311+_0x59cbe6(0xc1)+_0x51df4e));}),_0x3e2907['on'](_0x6997dd(0xad),_0x54a9d4);});}function spawnViteBuildWatch(_0x133e26){return new Promise((_0x632bbb,_0xb9914f)=>{const _0x3b9675=a181_0x122a,_0x4e5231=spawn('vite',[_0x3b9675(0x9b),_0x3b9675(0xb2)],{'cwd':_0x133e26,'stdio':_0x3b9675(0xba),'shell':!![],'env':{...process.env,'PATH':''+join(_0x133e26,_0x3b9675(0x8d),'.bin')+delimiter+process.env.PATH}});_0x4e5231['on'](_0x3b9675(0x9d),_0x4b13ba=>{const _0x27c373=_0x3b9675;if(_0x4b13ba===0x0||_0x4b13ba===null)_0x632bbb();else _0xb9914f(new Error(_0x27c373(0xbf)+_0x4b13ba));}),_0x4e5231['on']('error',_0xb9914f);});}function a181_0x122a(_0x1ae7e1,_0x2b5cc6){_0x1ae7e1=_0x1ae7e1-0x8b;const _0x1e772c=a181_0x1e77();let _0x122a8d=_0x1e772c[_0x1ae7e1];return _0x122a8d;}function spawnVitePreview(_0x5127c1){return new Promise((_0x3972eb,_0x4b9f4e)=>{const _0x433cb4=a181_0x122a,_0x4e120d=spawn(_0x433cb4(0xbb),[_0x433cb4(0xc2)],{'cwd':_0x5127c1,'stdio':_0x433cb4(0xba),'shell':!![],'env':{...process.env,'PATH':''+join(_0x5127c1,_0x433cb4(0x8d),_0x433cb4(0x8e))+delimiter+process.env.PATH}});_0x4e120d['on'](_0x433cb4(0x9d),_0x176f5e=>{if(_0x176f5e===0x0||_0x176f5e===null)_0x3972eb();else _0x4b9f4e(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x176f5e));}),_0x4e120d['on']('error',_0x4b9f4e);});}const runFlags=[{'name':a181_0x15f241(0xb0),'type':a181_0x15f241(0x8c),'description':a181_0x15f241(0xb6),'default':![]}];export const runDefinition={'service':a181_0x15f241(0xa1),'command':a181_0x15f241(0xa1),'description':'Run\x20a\x20package.json\x20script','risk':'high-risk-write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a181_0x15f241(0x90),'description':a181_0x15f241(0x94),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x21bff1=a181_0x15f241,_0x3d6bd5=[];return _0x3d6bd5[_0x21bff1(0xb8)](_0x21bff1(0xc0)),_0x3d6bd5[_0x21bff1(0xb8)](_0x21bff1(0x95)+CLI_BIN_NAME+_0x21bff1(0xa2)),_0x3d6bd5[_0x21bff1(0xb8)](_0x21bff1(0x95)+CLI_BIN_NAME+'\x20run\x20build'),_0x3d6bd5['push'](_0x21bff1(0x95)+CLI_BIN_NAME+_0x21bff1(0x91)),_0x3d6bd5[_0x21bff1(0xb8)](_0x21bff1(0x95)+CLI_BIN_NAME+_0x21bff1(0xc3)),_0x3d6bd5[_0x21bff1(0xb7)]('\x0a');},async 'execute'(_0x2f1c6d){const _0x11344e=a181_0x15f241,_0x573c9c=process['cwd'](),_0x1bc164=_0x2f1c6d[_0x11344e(0xbd)][0x0],_0x2dff6a=_0x2f1c6d[_0x11344e(0xbd)][_0x11344e(0x92)](0x1),_0x49bb3e=readPackageScripts(_0x573c9c);if(!_0x49bb3e)throw CliErrors['validation'](_0x11344e(0xbe));if(!_0x1bc164){const _0x22f098=Object['keys'](_0x49bb3e);if(_0x22f098[_0x11344e(0x9e)]===0x0)console['log'](_0x11344e(0x9c));else{console['log'](_0x11344e(0xa0));for(const _0x52dfa8 of _0x22f098){console[_0x11344e(0xa8)](_0x11344e(0x95)+_0x52dfa8);}console['log'](_0x11344e(0xa7)+CLI_BIN_NAME+'\x20run\x20<script>\x0a');}return{'ok':!![]};}if(!_0x49bb3e[_0x1bc164])throw CliErrors[_0x11344e(0xaa)](_0x11344e(0xb9)+_0x1bc164+'\x22\x20not\x20found\x20in\x20package.json.',_0x11344e(0x8f)+(Object[_0x11344e(0xc6)](_0x49bb3e)[_0x11344e(0xb7)](',\x20')||'(none)'));const _0x51e978=detectPackageManager(_0x573c9c);VERSION_CHECK_SCRIPTS[_0x11344e(0xb5)](_0x1bc164)&&await versionCheck(_0x573c9c);if(_0x1bc164===_0x11344e(0xc2)&&_0x2f1c6d['bool'](_0x11344e(0xb0)))return await Promise[_0x11344e(0xa3)]([spawnViteBuildWatch(_0x573c9c),spawnVitePreview(_0x573c9c)]),{'ok':!![]};return await spawnScript(_0x51e978,_0x1bc164,_0x2dff6a,_0x573c9c),{'ok':!![]};}};
1
+ const a189_0x4b7edf=a189_0x416e;(function(_0x1ea5ce,_0xd76d2a){const _0x5019dd=a189_0x416e,_0x4bfdda=_0x1ea5ce();while(!![]){try{const _0x569b71=-parseInt(_0x5019dd(0x1fc))/0x1*(-parseInt(_0x5019dd(0x1fb))/0x2)+parseInt(_0x5019dd(0x1d1))/0x3*(-parseInt(_0x5019dd(0x1dc))/0x4)+parseInt(_0x5019dd(0x1c3))/0x5+parseInt(_0x5019dd(0x1f6))/0x6*(parseInt(_0x5019dd(0x1d5))/0x7)+parseInt(_0x5019dd(0x1e4))/0x8+-parseInt(_0x5019dd(0x1ca))/0x9+-parseInt(_0x5019dd(0x1f7))/0xa;if(_0x569b71===_0xd76d2a)break;else _0x4bfdda['push'](_0x4bfdda['shift']());}catch(_0x8475b5){_0x4bfdda['push'](_0x4bfdda['shift']());}}}(a189_0xc4bb,0x4451a));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{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';function a189_0x416e(_0x325114,_0x2c757f){_0x325114=_0x325114-0x1bd;const _0xc4bb58=a189_0xc4bb();let _0x416e51=_0xc4bb58[_0x325114];return _0x416e51;}import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set(['start',a189_0x4b7edf(0x1db)]);function readPackageScripts(_0x7265ca){const _0x4b5efc=a189_0x4b7edf,_0x206976=resolve(_0x7265ca,_0x4b5efc(0x1c5));if(!existsSync(_0x206976))return null;try{const _0x484316=JSON[_0x4b5efc(0x1ce)](readFileSync(_0x206976,_0x4b5efc(0x1d8)));return _0x484316[_0x4b5efc(0x1dd)]??{};}catch{return null;}}function detectPackageManager(_0x5ee9d4){const _0x57b158=a189_0x4b7edf;if(existsSync(resolve(_0x5ee9d4,_0x57b158(0x1c4)))||existsSync(resolve(_0x5ee9d4,_0x57b158(0x1d2))))return _0x57b158(0x1d4);if(existsSync(resolve(_0x5ee9d4,_0x57b158(0x1f2))))return _0x57b158(0x1f3);if(existsSync(resolve(_0x5ee9d4,_0x57b158(0x1c6))))return _0x57b158(0x1f1);return _0x57b158(0x1e3);}function a189_0xc4bb(){const _0x5bd9b6=['\x20run\x20<script>\x0a','yarn','pnpm-lock.yaml','pnpm','vite','join','122622rIHGsU','2438220kVZmsJ','Available:\x20','close','\x20run\x20preview','2qyXoOE','237983QdTVKj','needsUpgrade','No\x20scripts\x20defined\x20in\x20package.json.','\x20run\x20build','(none)','slice','build','481860XMNeBw','bun.lockb','package.json','yarn.lock','preview','\x20run\x20preview\x20--watch','keys','3193092CuNoER','Run\x20a\x20package.json\x20script','belowMinimum','\x20exited\x20with\x20code\x20','parse','\x20\x20EXAMPLES','script','27609cyGUOX','bun.lock','\x0a\x20\x20Usage:\x20','bun','161mzgqsK','\x20run\x20start','inherit','utf-8','--watch','No\x20package.json\x20found\x20in\x20current\x20directory.','dev','12EVYxsO','scripts','node_modules','write','cwd','watch','validation','npm','813176tuRhGe','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','Script\x20name\x20defined\x20in\x20package.json','boolean','run','\x20\x20\x20\x20','bool','.bin','has','log','push','\x0a\x20\x20Available\x20scripts:\x0a'];a189_0xc4bb=function(){return _0x5bd9b6;};return a189_0xc4bb();}async function versionCheck(_0xce07f){const _0xb522bc=a189_0x4b7edf,_0x5918d7=await checkCliVersion();(_0x5918d7[_0xb522bc(0x1bd)]||_0x5918d7[_0xb522bc(0x1cc)])&&(printCliUpgradeWarning(_0x5918d7),assertCliVersionSupported(_0x5918d7));const _0x3d8d8a=await checkSdkVersion(_0xce07f);if(_0x3d8d8a[_0xb522bc(0x1bd)])printSdkUpgradeWarning(_0x3d8d8a);}function spawnScript(_0x3c6c3d,_0x983f10,_0xcb87d6,_0x23dfc6){return new Promise((_0x4b5de7,_0x2513d3)=>{const _0x16766a=a189_0x416e,_0x153da3=['run',_0x983f10,..._0xcb87d6],_0x55a8f6=spawn(_0x3c6c3d,_0x153da3,{'cwd':_0x23dfc6,'stdio':_0x16766a(0x1d7),'shell':!![],'env':{...process.env,'PATH':''+join(_0x23dfc6,_0x16766a(0x1de),'.bin')+delimiter+process.env.PATH}});_0x55a8f6['on'](_0x16766a(0x1f9),_0x461a99=>{const _0x23a357=_0x16766a;if(_0x461a99===0x0||_0x461a99===null)_0x4b5de7();else _0x2513d3(new Error(_0x3c6c3d+'\x20run\x20'+_0x983f10+_0x23a357(0x1cd)+_0x461a99));}),_0x55a8f6['on']('error',_0x2513d3);});}function spawnViteBuildWatch(_0x273b08){return new Promise((_0x2cefb2,_0x4c9605)=>{const _0x3d7576=a189_0x416e,_0x5a4047=spawn(_0x3d7576(0x1f4),[_0x3d7576(0x1c2),_0x3d7576(0x1d9)],{'cwd':_0x273b08,'stdio':_0x3d7576(0x1d7),'shell':!![],'env':{...process.env,'PATH':''+join(_0x273b08,_0x3d7576(0x1de),_0x3d7576(0x1eb))+delimiter+process.env.PATH}});_0x5a4047['on']('close',_0x43b893=>{const _0x1caae1=_0x3d7576;if(_0x43b893===0x0||_0x43b893===null)_0x2cefb2();else _0x4c9605(new Error(_0x1caae1(0x1e5)+_0x43b893));}),_0x5a4047['on']('error',_0x4c9605);});}function spawnVitePreview(_0x4238f3){return new Promise((_0x3b7a71,_0x59df68)=>{const _0x564b0c=a189_0x416e,_0x3c2530=spawn(_0x564b0c(0x1f4),[_0x564b0c(0x1c7)],{'cwd':_0x4238f3,'stdio':_0x564b0c(0x1d7),'shell':!![],'env':{...process.env,'PATH':''+join(_0x4238f3,_0x564b0c(0x1de),_0x564b0c(0x1eb))+delimiter+process.env.PATH}});_0x3c2530['on'](_0x564b0c(0x1f9),_0x28d64c=>{if(_0x28d64c===0x0||_0x28d64c===null)_0x3b7a71();else _0x59df68(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x28d64c));}),_0x3c2530['on']('error',_0x59df68);});}const runFlags=[{'name':a189_0x4b7edf(0x1e1),'type':a189_0x4b7edf(0x1e7),'description':'Enable\x20watch\x20mode\x20for\x20preview','default':![]}];export const runDefinition={'service':'run','command':a189_0x4b7edf(0x1e8),'description':a189_0x4b7edf(0x1cb),'risk':a189_0x4b7edf(0x1df),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a189_0x4b7edf(0x1d0),'description':a189_0x4b7edf(0x1e6),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x494b41=a189_0x4b7edf,_0x4fa7f1=[];return _0x4fa7f1['push'](_0x494b41(0x1cf)),_0x4fa7f1[_0x494b41(0x1ee)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x494b41(0x1d6)),_0x4fa7f1['push'](_0x494b41(0x1e9)+CLI_BIN_NAME+_0x494b41(0x1bf)),_0x4fa7f1[_0x494b41(0x1ee)](_0x494b41(0x1e9)+CLI_BIN_NAME+_0x494b41(0x1fa)),_0x4fa7f1['push'](_0x494b41(0x1e9)+CLI_BIN_NAME+_0x494b41(0x1c8)),_0x4fa7f1[_0x494b41(0x1f5)]('\x0a');},async 'execute'(_0x3dd610){const _0xfb23d2=a189_0x4b7edf,_0x36638d=process[_0xfb23d2(0x1e0)](),_0x4fd0d3=_0x3dd610['args'][0x0],_0x9fa7fb=_0x3dd610['args'][_0xfb23d2(0x1c1)](0x1),_0x3cf5fb=readPackageScripts(_0x36638d);if(!_0x3cf5fb)throw CliErrors['validation'](_0xfb23d2(0x1da));if(!_0x4fd0d3){const _0x2fe73a=Object[_0xfb23d2(0x1c9)](_0x3cf5fb);if(_0x2fe73a['length']===0x0)console[_0xfb23d2(0x1ed)](_0xfb23d2(0x1be));else{console['log'](_0xfb23d2(0x1ef));for(const _0x5e6a89 of _0x2fe73a){console[_0xfb23d2(0x1ed)](_0xfb23d2(0x1e9)+_0x5e6a89);}console[_0xfb23d2(0x1ed)](_0xfb23d2(0x1d3)+CLI_BIN_NAME+_0xfb23d2(0x1f0));}return{'ok':!![]};}if(!_0x3cf5fb[_0x4fd0d3])throw CliErrors[_0xfb23d2(0x1e2)]('Script\x20\x22'+_0x4fd0d3+'\x22\x20not\x20found\x20in\x20package.json.',_0xfb23d2(0x1f8)+(Object[_0xfb23d2(0x1c9)](_0x3cf5fb)[_0xfb23d2(0x1f5)](',\x20')||_0xfb23d2(0x1c0)));const _0x20f937=detectPackageManager(_0x36638d);VERSION_CHECK_SCRIPTS[_0xfb23d2(0x1ec)](_0x4fd0d3)&&await versionCheck(_0x36638d);if(_0x4fd0d3===_0xfb23d2(0x1c7)&&_0x3dd610[_0xfb23d2(0x1ea)](_0xfb23d2(0x1e1)))return await Promise['all']([spawnViteBuildWatch(_0x36638d),spawnVitePreview(_0x36638d)]),{'ok':!![]};return await spawnScript(_0x20f937,_0x4fd0d3,_0x9fa7fb,_0x36638d),{'ok':!![]};}};
@@ -1 +1 @@
1
- function a182_0x3886(){const _0x3326db=['1019DjgUfx','3418nEHKbs','82210ZtvnDz','4125775fkfgwu','export','Export\x20machine-readable\x20command\x20schema\x20(JSON)','4jugZWD','json','52440267gmYicy','7307622ZjERmm','1422rPfoXO','12353832ldUmCb','schema','7FimOOt','2839314UYgCkm'];a182_0x3886=function(){return _0x3326db;};return a182_0x3886();}function a182_0xcf41(_0x5f3f0f,_0x2afb9b){_0x5f3f0f=_0x5f3f0f-0x10b;const _0x38868d=a182_0x3886();let _0xcf4105=_0x38868d[_0x5f3f0f];return _0xcf4105;}const a182_0x18ac41=a182_0xcf41;(function(_0x55273f,_0x4ae414){const _0x1a3004=a182_0xcf41,_0x4cea4d=_0x55273f();while(!![]){try{const _0x103427=-parseInt(_0x1a3004(0x112))/0x1*(-parseInt(_0x1a3004(0x113))/0x2)+-parseInt(_0x1a3004(0x111))/0x3+parseInt(_0x1a3004(0x118))/0x4*(parseInt(_0x1a3004(0x115))/0x5)+parseInt(_0x1a3004(0x10c))/0x6*(parseInt(_0x1a3004(0x110))/0x7)+parseInt(_0x1a3004(0x10e))/0x8+-parseInt(_0x1a3004(0x10d))/0x9*(-parseInt(_0x1a3004(0x114))/0xa)+-parseInt(_0x1a3004(0x10b))/0xb;if(_0x103427===_0x4ae414)break;else _0x4cea4d['push'](_0x4cea4d['shift']());}catch(_0x1865b4){_0x4cea4d['push'](_0x4cea4d['shift']());}}}(a182_0x3886,0xdf237));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x2dc530){const _0x49d61f=await buildSchemaPayload();return{'ok':!![],'data':_0x49d61f};}export const schemaDefinition={'service':a182_0x18ac41(0x10f),'command':a182_0x18ac41(0x116),'description':a182_0x18ac41(0x117),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a182_0x18ac41(0x119),'flags':[],'execute':execute};
1
+ function a190_0x252b(){const _0x899a37=['8260505BRdLpp','177332nFlYYY','80hGiJrV','1894338vhsbVa','schema','10AGBIZc','5972190xOlbzr','94545CJPgnG','2144556zGxqpm','export','6rimPWL','Export\x20machine-readable\x20command\x20schema\x20(JSON)','15BtcZDQ','689286yPfoEA','json','read'];a190_0x252b=function(){return _0x899a37;};return a190_0x252b();}const a190_0x5565d9=a190_0x4491;(function(_0x11cfe5,_0x29ae0b){const _0x1a1ef0=a190_0x4491,_0x400724=_0x11cfe5();while(!![]){try{const _0x50a91c=parseInt(_0x1a1ef0(0xc4))/0x1+parseInt(_0x1a1ef0(0xb8))/0x2*(-parseInt(_0x1a1ef0(0xc1))/0x3)+-parseInt(_0x1a1ef0(0xbf))/0x4+parseInt(_0x1a1ef0(0xc3))/0x5*(parseInt(_0x1a1ef0(0xba))/0x6)+-parseInt(_0x1a1ef0(0xbd))/0x7+-parseInt(_0x1a1ef0(0xb9))/0x8*(parseInt(_0x1a1ef0(0xbe))/0x9)+-parseInt(_0x1a1ef0(0xbc))/0xa*(-parseInt(_0x1a1ef0(0xb7))/0xb);if(_0x50a91c===_0x29ae0b)break;else _0x400724['push'](_0x400724['shift']());}catch(_0x1a79da){_0x400724['push'](_0x400724['shift']());}}}(a190_0x252b,0xaebc7));function a190_0x4491(_0x11459e,_0x5b5c8c){_0x11459e=_0x11459e-0xb7;const _0x252bad=a190_0x252b();let _0x4491f9=_0x252bad[_0x11459e];return _0x4491f9;}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x1a29c7){const _0xb6f4ad=await buildSchemaPayload();return{'ok':!![],'data':_0xb6f4ad};}export const schemaDefinition={'service':a190_0x5565d9(0xbb),'command':a190_0x5565d9(0xc0),'description':a190_0x5565d9(0xc2),'risk':a190_0x5565d9(0xc6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a190_0x5565d9(0xc5),'flags':[],'execute':execute};
@@ -1 +1 @@
1
- const a183_0x534c02=a183_0x1748;(function(_0x599a5b,_0x1a1755){const _0x2c67ee=a183_0x1748,_0x39224d=_0x599a5b();while(!![]){try{const _0x8737e6=parseInt(_0x2c67ee(0xc3))/0x1+-parseInt(_0x2c67ee(0xb5))/0x2+-parseInt(_0x2c67ee(0xc2))/0x3+-parseInt(_0x2c67ee(0x98))/0x4*(-parseInt(_0x2c67ee(0x99))/0x5)+parseInt(_0x2c67ee(0xbe))/0x6+-parseInt(_0x2c67ee(0xb1))/0x7*(parseInt(_0x2c67ee(0xc0))/0x8)+parseInt(_0x2c67ee(0xa2))/0x9;if(_0x8737e6===_0x1a1755)break;else _0x39224d['push'](_0x39224d['shift']());}catch(_0x441684){_0x39224d['push'](_0x39224d['shift']());}}}(a183_0x4453,0xb151a));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';function a183_0x4453(){const _0x4333c1=['dbId','toISOString','3892752sJEpea','string','24iEpHei','Invalid\x20database\x20selection\x20payload:\x20','4356786xUbThG','64960sOZsuX','appCode','catch','trim','Created\x20SQL\x20query\x20','create','dbId\x20不能为空','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','sqlCode','普通\x20SQL(sql)','validation','\x20\x20SELECT\x201\x20AS\x20id','__manual__','SELECT\x201\x20AS\x20id;','sqlRootDir','MyBatis\x20XML(mybatisXml)','flagMissing','stringify','mybatisXml','utf8','sqlRoot','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','join','请选择本地\x20SQL\x20模式:','nonInteractive','lastSync','376yrZeDg','17165sQiBsl','sqls','lockFilePath','POST','请输入目标数据库\x20dbId:','File\x20already\x20exists:\x20','sql','isFinite','Local\x20SQL\x20file\x20mode','27842094ygCxKp','map','/smartapi/custom/saveUserCustomSql','请输入\x20SQL\x20名称:','isInteger','length','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','sqlName','</select>','name','适合带动态标签的\x20MyBatis\x20XML\x20SQL','mode','parse','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','✎\x20手动输入\x20dbId','2000411NCXzAO','number','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','dbName','2188282quUbnY','db-id','dbId\x20必须为正整数','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','write','str','new'];a183_0x4453=function(){return _0x4333c1;};return a183_0x4453();}import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';function a183_0x1748(_0x44c3db,_0x292a28){_0x44c3db=_0x44c3db-0x8e;const _0x445308=a183_0x4453();let _0x1748ee=_0x445308[_0x44c3db];return _0x1748ee;}import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x2f83d5){const _0x3b6892=a183_0x1748;if(_0x2f83d5==='mybatisXml')return[_0x3b6892(0xb8),_0x3b6892(0xce),_0x3b6892(0xaa),''][_0x3b6892(0x94)]('\x0a');return[_0x3b6892(0xd0),''][_0x3b6892(0x94)]('\x0a');}export const sqlCreate={'service':'sql','command':a183_0x534c02(0xc8),'description':'Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','risk':a183_0x534c02(0xb9),'flags':[{'name':a183_0x534c02(0xab),'type':a183_0x534c02(0xbf),'description':'SQL\x20query\x20display\x20name'},{'name':a183_0x534c02(0xb6),'type':'number','description':'Target\x20database\x20ID'},{'name':a183_0x534c02(0xad),'type':a183_0x534c02(0xbf),'enum':[a183_0x534c02(0x9f),a183_0x534c02(0x90)],'description':a183_0x534c02(0xa1)}],async 'validate'(_0x58ae24){const _0x403afe=a183_0x534c02;if(!_0x58ae24['nonInteractive'])return;if(!_0x58ae24['str'](_0x403afe(0xab))['trim']())throw CliErrors['flagMissing']('name',_0x403afe(0xb3));const _0x1ab03d=resolveProvidedDbId(_0x58ae24);if(typeof _0x1ab03d!=='number'||!Number[_0x403afe(0xa0)](_0x1ab03d)||_0x1ab03d<=0x0)throw CliErrors[_0x403afe(0x8e)](_0x403afe(0xb6),_0x403afe(0xaf));if(!_0x58ae24[_0x403afe(0xba)]('mode')[_0x403afe(0xc6)]())throw CliErrors['flagMissing']('mode',_0x403afe(0xa8));},async 'dryRun'(_0x81ea5c){const _0x570bc9=a183_0x534c02,_0x114fd4=loadSqlProjectConfig(_0x81ea5c[_0x570bc9(0xc4)]),{sqlName:_0x3affbb,dbId:_0x28062e,dbName:_0x2212b8,mode:_0x740154}=await resolveSqlNewInputs(_0x81ea5c),_0x1255d9=buildSqlRelativePath('<server-generated-sqlCode>',_0x3affbb,_0x2212b8,_0x740154,_0x28062e),_0x3e41a2=_0x114fd4[_0x570bc9(0xd1)]+'/'+_0x1255d9;return{'method':_0x570bc9(0x9c),'url':_0x570bc9(0xa4),'body':{'appCode':_0x81ea5c[_0x570bc9(0xc4)],'sqlName':_0x3affbb,'dbId':_0x28062e,'mode':_0x740154,'localPath':_0x3e41a2},'description':_0x570bc9(0x93)+_0x114fd4['sqlRootDir']};},async 'execute'(_0x4c62e6){const _0x13e45f=a183_0x534c02,_0x3859e9=loadSqlProjectConfig(_0x4c62e6[_0x13e45f(0xc4)]),{sqlName:_0x180de9,dbId:_0xa96d5c,dbName:_0x5a7ef5,mode:_0x42df6f}=await resolveSqlNewInputs(_0x4c62e6),_0x4dd0b9=generateSqlTemplate(_0x42df6f),_0x56aec3=await createSqlQuery({'appCode':_0x4c62e6['appCode'],'sqlName':_0x180de9,'dbId':_0xa96d5c,'sqlContent':_0x4dd0b9}),_0x497a24=ensureRemoteSqlContent(_0x56aec3),_0x365451=_0x5a7ef5||await getDbName(_0x4c62e6['appCode'],_0xa96d5c)[_0x13e45f(0xc5)](()=>undefined),_0xf0cd90=buildSqlRelativePath(_0x56aec3['sqlCode'],_0x56aec3['sqlName'],_0x365451,_0x42df6f,_0xa96d5c),_0x274d90=_0x3859e9['sqlRootDir']+'/'+_0xf0cd90,_0x41300e=buildLocalSqlFileContent({'sqlCode':_0x56aec3[_0x13e45f(0xcb)],'sqlName':_0x56aec3['sqlName'],'dbId':_0x56aec3[_0x13e45f(0xbc)]},_0x497a24,{'dbName':_0x365451,'mode':_0x42df6f,'syncedAt':new Date()['toISOString'](),'description':_0x56aec3['description']});if(await fileExists(_0x274d90))throw CliErrors['validation'](_0x13e45f(0x9e)+_0x274d90);await ensureParentDirectory(_0x274d90),await writeFile(_0x274d90,_0x41300e,_0x13e45f(0x91));const _0x4131c2=await readSqlLockFile(_0x3859e9[_0x13e45f(0x9b)]),{lockData:_0x1cd5bf,appLock:_0x5e0399}=ensureSqlLockScope(_0x4131c2??createEmptySqlLock(),_0x3859e9[_0x13e45f(0xc4)],_0x3859e9[_0x13e45f(0x92)],_0x13e45f(0xbb));return _0x5e0399[_0x13e45f(0x9a)][_0x56aec3[_0x13e45f(0xcb)]]={...buildSqlLockEntry(_0x56aec3,_0x497a24,computeSqlContentHash(_0x41300e),{'dbName':_0x365451}),'path':_0xf0cd90,'mode':_0x42df6f},_0x5e0399[_0x13e45f(0x97)]=new Date()[_0x13e45f(0xbd)](),await writeSqlLockFile(_0x3859e9[_0x13e45f(0x9b)],_0x1cd5bf),{'ok':!![],'data':{'id':_0x56aec3['id'],'sqlCode':_0x56aec3[_0x13e45f(0xcb)],'sqlName':_0x56aec3[_0x13e45f(0xa9)],'dbId':_0x56aec3[_0x13e45f(0xbc)],'path':_0x274d90,'mode':_0x42df6f},'message':_0x13e45f(0xc7)+_0x56aec3[_0x13e45f(0xcb)]};}};async function resolveSqlNewInputs(_0x534451){const _0x5ca067=await resolveSqlNameInput(_0x534451),{dbId:_0x9b4cbd,dbName:_0x20b083}=await resolveDbSelection(_0x534451),_0x160ca9=await resolveSqlModeInput(_0x534451);return{'sqlName':_0x5ca067,'dbId':_0x9b4cbd,'dbName':_0x20b083,'mode':_0x160ca9};}async function resolveSqlNameInput(_0x4cc06b){const _0x87d4e3=a183_0x534c02,_0x1a2e2e=_0x4cc06b[_0x87d4e3(0xba)](_0x87d4e3(0xab))[_0x87d4e3(0xc6)]();if(_0x1a2e2e)return _0x1a2e2e;if(_0x4cc06b[_0x87d4e3(0x96)])throw CliErrors['flagMissing'](_0x87d4e3(0xab),_0x87d4e3(0xb3));return(await input({'message':_0x87d4e3(0xa5),'validate':_0x17e113=>_0x17e113['trim']()?!![]:'SQL\x20名称不能为空'}))['trim']();}async function resolveDbSelection(_0x3022eb){const _0x214af5=a183_0x534c02,_0x1127cc=resolveProvidedDbId(_0x3022eb);if(typeof _0x1127cc===_0x214af5(0xb2)&&Number[_0x214af5(0xa0)](_0x1127cc)&&_0x1127cc>0x0)return{'dbId':_0x1127cc,'dbName':await getDbName(_0x3022eb[_0x214af5(0xc4)],_0x1127cc)[_0x214af5(0xc5)](()=>undefined)};if(_0x3022eb[_0x214af5(0x96)])throw CliErrors['flagMissing'](_0x214af5(0xb6),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x395801=await listDatabases(_0x3022eb[_0x214af5(0xc4)])[_0x214af5(0xc5)](()=>[]);if(_0x395801[_0x214af5(0xa7)]===0x1)return{'dbId':_0x395801[0x0][_0x214af5(0xbc)],'dbName':_0x395801[0x0][_0x214af5(0xb4)]};if(_0x395801[_0x214af5(0xa7)]>0x1){const _0x34989a=await select({'message':'请选择目标数据库:','choices':[..._0x395801[_0x214af5(0xa3)](_0x13b0d6=>({'name':_0x13b0d6[_0x214af5(0xb4)]+'\x20('+_0x13b0d6[_0x214af5(0xbc)]+')','value':serializeDbSelection(_0x13b0d6)})),{'name':_0x214af5(0xb0),'value':_0x214af5(0xcf)}]});if(_0x34989a!==_0x214af5(0xcf))return deserializeDbSelection(_0x34989a);}const _0x43c226=await input({'message':_0x214af5(0x9d),'validate':_0x257a08=>{const _0x1c69bb=_0x214af5,_0xa9a10=_0x257a08['trim']();if(!_0xa9a10)return _0x1c69bb(0xc9);const _0x2a3169=Number(_0xa9a10);if(!Number[_0x1c69bb(0xa6)](_0x2a3169)||_0x2a3169<=0x0)return _0x1c69bb(0xb7);return!![];}});return{'dbId':Number(_0x43c226[_0x214af5(0xc6)]())};}async function resolveSqlModeInput(_0x5a44ba){const _0x18a9a0=a183_0x534c02,_0x5dfaee=_0x5a44ba[_0x18a9a0(0xba)](_0x18a9a0(0xad))[_0x18a9a0(0xc6)]();if(_0x5dfaee==='sql'||_0x5dfaee===_0x18a9a0(0x90))return _0x5dfaee;if(_0x5a44ba[_0x18a9a0(0x96)])throw CliErrors[_0x18a9a0(0x8e)]('mode',_0x18a9a0(0xa8));return await select({'message':_0x18a9a0(0x95),'choices':[{'name':_0x18a9a0(0xcc),'value':_0x18a9a0(0x9f),'description':_0x18a9a0(0xca)},{'name':_0x18a9a0(0xd2),'value':_0x18a9a0(0x90),'description':_0x18a9a0(0xac)}]});}function serializeDbSelection(_0x12c73a){const _0x5c16df=a183_0x534c02;return JSON[_0x5c16df(0x8f)]({'dbId':_0x12c73a[_0x5c16df(0xbc)],'dbName':_0x12c73a[_0x5c16df(0xb4)]});}function deserializeDbSelection(_0x434567){const _0x2f06d0=a183_0x534c02;try{const _0x5a817f=JSON[_0x2f06d0(0xae)](_0x434567);if(typeof _0x5a817f[_0x2f06d0(0xbc)]===_0x2f06d0(0xb2)&&Number[_0x2f06d0(0xa0)](_0x5a817f[_0x2f06d0(0xbc)]))return{'dbId':_0x5a817f['dbId'],'dbName':_0x5a817f['dbName']};}catch{}throw CliErrors[_0x2f06d0(0xcd)](_0x2f06d0(0xc1)+_0x434567);}function resolveProvidedDbId(_0x35e718){const _0x2ce00f=a183_0x534c02,_0x23e080=_0x35e718['flag']('db-id');if(typeof _0x23e080===_0x2ce00f(0xb2)&&Number['isFinite'](_0x23e080))return _0x23e080;return undefined;}
1
+ const a191_0x5d46b3=a191_0x259a;(function(_0x423951,_0x5dd6b3){const _0x388853=a191_0x259a,_0x28ec13=_0x423951();while(!![]){try{const _0x63cd0a=-parseInt(_0x388853(0x91))/0x1*(-parseInt(_0x388853(0x82))/0x2)+-parseInt(_0x388853(0x88))/0x3*(-parseInt(_0x388853(0x74))/0x4)+-parseInt(_0x388853(0x7c))/0x5*(parseInt(_0x388853(0x7a))/0x6)+-parseInt(_0x388853(0x9b))/0x7*(parseInt(_0x388853(0x72))/0x8)+-parseInt(_0x388853(0xae))/0x9+-parseInt(_0x388853(0xb1))/0xa*(-parseInt(_0x388853(0x71))/0xb)+-parseInt(_0x388853(0x77))/0xc*(-parseInt(_0x388853(0x87))/0xd);if(_0x63cd0a===_0x5dd6b3)break;else _0x28ec13['push'](_0x28ec13['shift']());}catch(_0x269aee){_0x28ec13['push'](_0x28ec13['shift']());}}}(a191_0x5569,0x73ca1));import{writeFile}from'node:fs/promises';function a191_0x5569(){const _0xeaeab1=['适合带动态标签的\x20MyBatis\x20XML\x20SQL','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','Local\x20SQL\x20file\x20mode','description','5899478vTRArs','9474TpkXSv','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','validation','toISOString','flagMissing','join','Invalid\x20database\x20selection\x20payload:\x20','dbName','sql','2wJgLst','__manual__','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','number','str','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','mode','stringify','lastSync','dbId\x20不能为空','21LilQsU','sqlRootDir','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','db-id','Target\x20database\x20ID','✎\x20手动输入\x20dbId','write','new','请选择本地\x20SQL\x20模式:','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','SELECT\x201\x20AS\x20id;','string','appCode','sqlName','utf8','SQL\x20名称不能为空','SQL\x20query\x20display\x20name','请选择目标数据库:','catch','595548YCOzBp','mybatisXml','length','50IXeYqE','sqlRoot','普通\x20SQL(sql)','请输入\x20SQL\x20名称:','606925guLtDc','1868656wumshg','sqls','556fYNfEL','map','nonInteractive','12NKWbmS','trim','dbId','1309452aGqJYT','sqlCode','10Xihiac','POST','isFinite','name','isInteger','请输入目标数据库\x20dbId:','509032NiTsas'];a191_0x5569=function(){return _0xeaeab1;};return a191_0x5569();}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';function a191_0x259a(_0x124f97,_0x12d53d){_0x124f97=_0x124f97-0x70;const _0x5569ea=a191_0x5569();let _0x259a34=_0x5569ea[_0x124f97];return _0x259a34;}import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x43743a){const _0x18b6ee=a191_0x259a;if(_0x43743a===_0x18b6ee(0xaf))return[_0x18b6ee(0x89),'\x20\x20SELECT\x201\x20AS\x20id','</select>',''][_0x18b6ee(0x8d)]('\x0a');return[_0x18b6ee(0xa5),''][_0x18b6ee(0x8d)]('\x0a');}export const sqlCreate={'service':a191_0x5d46b3(0x90),'command':'create','description':'Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','risk':a191_0x5d46b3(0xa1),'flags':[{'name':'name','type':a191_0x5d46b3(0xa6),'description':a191_0x5d46b3(0xab)},{'name':a191_0x5d46b3(0x9e),'type':a191_0x5d46b3(0x94),'description':a191_0x5d46b3(0x9f)},{'name':'mode','type':a191_0x5d46b3(0xa6),'enum':[a191_0x5d46b3(0x90),a191_0x5d46b3(0xaf)],'description':a191_0x5d46b3(0x85)}],async 'validate'(_0x889349){const _0x5b24f2=a191_0x5d46b3;if(!_0x889349[_0x5b24f2(0x76)])return;if(!_0x889349[_0x5b24f2(0x95)](_0x5b24f2(0x7f))[_0x5b24f2(0x78)]())throw CliErrors[_0x5b24f2(0x8c)](_0x5b24f2(0x7f),_0x5b24f2(0x9d));const _0x2ad156=resolveProvidedDbId(_0x889349);if(typeof _0x2ad156!=='number'||!Number[_0x5b24f2(0x7e)](_0x2ad156)||_0x2ad156<=0x0)throw CliErrors[_0x5b24f2(0x8c)](_0x5b24f2(0x9e),_0x5b24f2(0x84));if(!_0x889349[_0x5b24f2(0x95)]('mode')[_0x5b24f2(0x78)]())throw CliErrors[_0x5b24f2(0x8c)]('mode',_0x5b24f2(0x96));},async 'dryRun'(_0x56df83){const _0x2447bb=a191_0x5d46b3,_0x1afde9=loadSqlProjectConfig(_0x56df83[_0x2447bb(0xa7)]),{sqlName:_0x46ebb7,dbId:_0x1edf6d,dbName:_0x5c6eb1,mode:_0x5dce17}=await resolveSqlNewInputs(_0x56df83),_0x3f7983=buildSqlRelativePath('<server-generated-sqlCode>',_0x46ebb7,_0x5c6eb1,_0x5dce17,_0x1edf6d),_0x4278b2=_0x1afde9[_0x2447bb(0x9c)]+'/'+_0x3f7983;return{'method':_0x2447bb(0x7d),'url':'/smartapi/custom/saveUserCustomSql','body':{'appCode':_0x56df83['appCode'],'sqlName':_0x46ebb7,'dbId':_0x1edf6d,'mode':_0x5dce17,'localPath':_0x4278b2},'description':_0x2447bb(0x93)+_0x1afde9[_0x2447bb(0x9c)]};},async 'execute'(_0x3d0a22){const _0x1f4565=a191_0x5d46b3,_0xd28dc1=loadSqlProjectConfig(_0x3d0a22['appCode']),{sqlName:_0x59db43,dbId:_0x53ce8e,dbName:_0x311fb6,mode:_0x5a1867}=await resolveSqlNewInputs(_0x3d0a22),_0x147140=generateSqlTemplate(_0x5a1867),_0x402560=await createSqlQuery({'appCode':_0x3d0a22[_0x1f4565(0xa7)],'sqlName':_0x59db43,'dbId':_0x53ce8e,'sqlContent':_0x147140}),_0x502365=ensureRemoteSqlContent(_0x402560),_0x21bb53=_0x311fb6||await getDbName(_0x3d0a22[_0x1f4565(0xa7)],_0x53ce8e)[_0x1f4565(0xad)](()=>undefined),_0x385581=buildSqlRelativePath(_0x402560[_0x1f4565(0x7b)],_0x402560['sqlName'],_0x21bb53,_0x5a1867,_0x53ce8e),_0xa30790=_0xd28dc1[_0x1f4565(0x9c)]+'/'+_0x385581,_0x5ee49e=buildLocalSqlFileContent({'sqlCode':_0x402560[_0x1f4565(0x7b)],'sqlName':_0x402560[_0x1f4565(0xa8)],'dbId':_0x402560[_0x1f4565(0x79)]},_0x502365,{'dbName':_0x21bb53,'mode':_0x5a1867,'syncedAt':new Date()[_0x1f4565(0x8b)](),'description':_0x402560[_0x1f4565(0x86)]});if(await fileExists(_0xa30790))throw CliErrors[_0x1f4565(0x8a)]('File\x20already\x20exists:\x20'+_0xa30790);await ensureParentDirectory(_0xa30790),await writeFile(_0xa30790,_0x5ee49e,_0x1f4565(0xa9));const _0x45e3f1=await readSqlLockFile(_0xd28dc1['lockFilePath']),{lockData:_0x1cad03,appLock:_0x46fbbe}=ensureSqlLockScope(_0x45e3f1??createEmptySqlLock(),_0xd28dc1[_0x1f4565(0xa7)],_0xd28dc1[_0x1f4565(0xb2)],_0x1f4565(0xa2));return _0x46fbbe[_0x1f4565(0x73)][_0x402560[_0x1f4565(0x7b)]]={...buildSqlLockEntry(_0x402560,_0x502365,computeSqlContentHash(_0x5ee49e),{'dbName':_0x21bb53}),'path':_0x385581,'mode':_0x5a1867},_0x46fbbe[_0x1f4565(0x99)]=new Date()[_0x1f4565(0x8b)](),await writeSqlLockFile(_0xd28dc1['lockFilePath'],_0x1cad03),{'ok':!![],'data':{'id':_0x402560['id'],'sqlCode':_0x402560[_0x1f4565(0x7b)],'sqlName':_0x402560[_0x1f4565(0xa8)],'dbId':_0x402560[_0x1f4565(0x79)],'path':_0xa30790,'mode':_0x5a1867},'message':'Created\x20SQL\x20query\x20'+_0x402560[_0x1f4565(0x7b)]};}};async function resolveSqlNewInputs(_0x19c605){const _0x462531=await resolveSqlNameInput(_0x19c605),{dbId:_0x2a7f7b,dbName:_0x2cd7c9}=await resolveDbSelection(_0x19c605),_0x117516=await resolveSqlModeInput(_0x19c605);return{'sqlName':_0x462531,'dbId':_0x2a7f7b,'dbName':_0x2cd7c9,'mode':_0x117516};}async function resolveSqlNameInput(_0x508450){const _0x441506=a191_0x5d46b3,_0x1f5c09=_0x508450[_0x441506(0x95)](_0x441506(0x7f))[_0x441506(0x78)]();if(_0x1f5c09)return _0x1f5c09;if(_0x508450['nonInteractive'])throw CliErrors[_0x441506(0x8c)](_0x441506(0x7f),_0x441506(0x9d));return(await input({'message':_0x441506(0x70),'validate':_0x5940f0=>_0x5940f0[_0x441506(0x78)]()?!![]:_0x441506(0xaa)}))[_0x441506(0x78)]();}async function resolveDbSelection(_0x5acb26){const _0x3b9fe7=a191_0x5d46b3,_0x1d9ad6=resolveProvidedDbId(_0x5acb26);if(typeof _0x1d9ad6===_0x3b9fe7(0x94)&&Number['isFinite'](_0x1d9ad6)&&_0x1d9ad6>0x0)return{'dbId':_0x1d9ad6,'dbName':await getDbName(_0x5acb26['appCode'],_0x1d9ad6)[_0x3b9fe7(0xad)](()=>undefined)};if(_0x5acb26[_0x3b9fe7(0x76)])throw CliErrors[_0x3b9fe7(0x8c)](_0x3b9fe7(0x9e),_0x3b9fe7(0x84));const _0x47c5a7=await listDatabases(_0x5acb26[_0x3b9fe7(0xa7)])['catch'](()=>[]);if(_0x47c5a7['length']===0x1)return{'dbId':_0x47c5a7[0x0]['dbId'],'dbName':_0x47c5a7[0x0]['dbName']};if(_0x47c5a7[_0x3b9fe7(0xb0)]>0x1){const _0xb14569=await select({'message':_0x3b9fe7(0xac),'choices':[..._0x47c5a7[_0x3b9fe7(0x75)](_0x4e9158=>({'name':_0x4e9158[_0x3b9fe7(0x8f)]+'\x20('+_0x4e9158[_0x3b9fe7(0x79)]+')','value':serializeDbSelection(_0x4e9158)})),{'name':_0x3b9fe7(0xa0),'value':_0x3b9fe7(0x92)}]});if(_0xb14569!=='__manual__')return deserializeDbSelection(_0xb14569);}const _0x1b2f11=await input({'message':_0x3b9fe7(0x81),'validate':_0x3b0dfa=>{const _0x2d35f9=_0x3b9fe7,_0x358861=_0x3b0dfa[_0x2d35f9(0x78)]();if(!_0x358861)return _0x2d35f9(0x9a);const _0x49f452=Number(_0x358861);if(!Number[_0x2d35f9(0x80)](_0x49f452)||_0x49f452<=0x0)return'dbId\x20必须为正整数';return!![];}});return{'dbId':Number(_0x1b2f11[_0x3b9fe7(0x78)]())};}async function resolveSqlModeInput(_0x50b5b1){const _0x598b9e=a191_0x5d46b3,_0x434e61=_0x50b5b1['str'](_0x598b9e(0x97))[_0x598b9e(0x78)]();if(_0x434e61==='sql'||_0x434e61===_0x598b9e(0xaf))return _0x434e61;if(_0x50b5b1[_0x598b9e(0x76)])throw CliErrors[_0x598b9e(0x8c)](_0x598b9e(0x97),_0x598b9e(0x96));return await select({'message':_0x598b9e(0xa3),'choices':[{'name':_0x598b9e(0xb3),'value':_0x598b9e(0x90),'description':_0x598b9e(0xa4)},{'name':'MyBatis\x20XML(mybatisXml)','value':'mybatisXml','description':_0x598b9e(0x83)}]});}function serializeDbSelection(_0x710f12){const _0x2aa626=a191_0x5d46b3;return JSON[_0x2aa626(0x98)]({'dbId':_0x710f12['dbId'],'dbName':_0x710f12[_0x2aa626(0x8f)]});}function deserializeDbSelection(_0x3210f7){const _0x2343bc=a191_0x5d46b3;try{const _0x25e1f4=JSON['parse'](_0x3210f7);if(typeof _0x25e1f4[_0x2343bc(0x79)]===_0x2343bc(0x94)&&Number['isFinite'](_0x25e1f4[_0x2343bc(0x79)]))return{'dbId':_0x25e1f4[_0x2343bc(0x79)],'dbName':_0x25e1f4[_0x2343bc(0x8f)]};}catch{}throw CliErrors[_0x2343bc(0x8a)](_0x2343bc(0x8e)+_0x3210f7);}function resolveProvidedDbId(_0x364ce5){const _0xb55e29=a191_0x5d46b3,_0x3262f7=_0x364ce5['flag'](_0xb55e29(0x9e));if(typeof _0x3262f7==='number'&&Number['isFinite'](_0x3262f7))return _0x3262f7;return undefined;}
@@ -1 +1 @@
1
- function a184_0x339b(){const _0x49a994=['196440VMkiHg','33549399gFQxkv','sqlcode','Would\x20delete\x20SQL\x20','filter','replace','length','SQL\x20lock\x20file\x20not\x20found.','validation','toISOString','startsWith','appCode','sqlRootDir','str','\x20(local\x20file\x20moved\x20to\x20trash)','projectRoot','5340903UGKoYD','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','fromEntries','high-risk-write','lockFilePath','8533940SHbdPX','sqlRoot','lastSync','4940752KYFYKl','Deleted\x20','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','sql','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','94508DZxrNZ','6151240XTYCgY','37iGcoSt','trashDir','POST','delete','remoteId','sqls','147bTmQpN','/smartapi/custom/deleteUserCustomSql'];a184_0x339b=function(){return _0x49a994;};return a184_0x339b();}const a184_0x20f4fd=a184_0x1f8f;(function(_0x5d2ef5,_0x4e4620){const _0x25dc27=a184_0x1f8f,_0x6b9b43=_0x5d2ef5();while(!![]){try{const _0x3b35d6=parseInt(_0x25dc27(0x10b))/0x1*(parseInt(_0x25dc27(0x109))/0x2)+parseInt(_0x25dc27(0xfc))/0x3+parseInt(_0x25dc27(0x10a))/0x4+-parseInt(_0x25dc27(0x101))/0x5+parseInt(_0x25dc27(0xec))/0x6*(parseInt(_0x25dc27(0xea))/0x7)+parseInt(_0x25dc27(0x104))/0x8+-parseInt(_0x25dc27(0xed))/0x9;if(_0x3b35d6===_0x4e4620)break;else _0x6b9b43['push'](_0x6b9b43['shift']());}catch(_0x473f98){_0x6b9b43['push'](_0x6b9b43['shift']());}}}(a184_0x339b,0xe4cb8));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a184_0x1f8f(_0x1d2e2e,_0x5277e8){_0x1d2e2e=_0x1d2e2e-0xe9;const _0x339b82=a184_0x339b();let _0x1f8f89=_0x339b82[_0x1d2e2e];return _0x1f8f89;}export const sqlDelete={'service':a184_0x20f4fd(0x107),'command':a184_0x20f4fd(0x10e),'description':a184_0x20f4fd(0xfd),'risk':a184_0x20f4fd(0xff),'flags':[SQLCODE_FLAG],async 'validate'(_0x273f1f){const _0x3a65eb=a184_0x20f4fd,_0xd9fe96=loadSqlProjectConfig(_0x273f1f[_0x3a65eb(0xf7)]),_0x91ea15=await readSqlLockFile(_0xd9fe96['lockFilePath']);if(!_0x91ea15)throw CliErrors[_0x3a65eb(0xf4)](_0x3a65eb(0x106));},async 'dryRun'(_0x5e467f){const _0x54859f=a184_0x20f4fd,_0x51cd8a=loadSqlProjectConfig(_0x5e467f['appCode']),_0x74a039=await readSqlLockFile(_0x51cd8a['lockFilePath']);if(!_0x74a039)throw CliErrors[_0x54859f(0xf4)](_0x54859f(0x106));const {appLock:_0x53082b}=ensureSqlLockScope(_0x74a039,_0x5e467f[_0x54859f(0xf7)],_0x51cd8a[_0x54859f(0x102)],_0x54859f(0x10e)),_0x28fd22=_0x5e467f[_0x54859f(0xf9)](_0x54859f(0xee)),_0x1ef681=_0x53082b[_0x54859f(0xe9)][_0x28fd22];if(!_0x1ef681)throw CliErrors['validation'](_0x54859f(0x108)+_0x28fd22+'\x22.');return{'method':_0x54859f(0x10d),'url':_0x54859f(0xeb),'body':{'sqlCode':_0x28fd22,'id':_0x1ef681[_0x54859f(0x10f)],'localPath':resolveLocalSqlFilePath(_0x51cd8a,_0x28fd22,_0x1ef681)},'description':_0x54859f(0xef)+_0x28fd22+'\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20'+_0x51cd8a[_0x54859f(0x10c)]};},async 'execute'(_0x193d9a){const _0x341c60=a184_0x20f4fd,_0x18deda=loadSqlProjectConfig(_0x193d9a[_0x341c60(0xf7)]),_0x2029f5=await readSqlLockFile(_0x18deda[_0x341c60(0x100)]);if(!_0x2029f5)throw CliErrors[_0x341c60(0xf4)](_0x341c60(0xf3));const {lockData:_0xf287e6,appLock:_0x381107}=ensureSqlLockScope(_0x2029f5,_0x193d9a[_0x341c60(0xf7)],_0x18deda[_0x341c60(0x102)],'delete'),_0x282d4f=_0x193d9a['str'](_0x341c60(0xee)),_0x388c91=_0x381107[_0x341c60(0xe9)][_0x282d4f];if(!_0x388c91)throw CliErrors[_0x341c60(0xf4)](_0x341c60(0x108)+_0x282d4f+'\x22.');await deleteSqlQuery({'id':_0x388c91[_0x341c60(0x10f)],'sqlCode':_0x282d4f}),_0x381107[_0x341c60(0xe9)]=Object[_0x341c60(0xfe)](Object['entries'](_0x381107['sqls'])[_0x341c60(0xf0)](([_0x1cff79])=>_0x1cff79!==_0x282d4f)),_0x381107[_0x341c60(0x103)]=new Date()['toISOString'](),await writeSqlLockFile(_0x18deda[_0x341c60(0x100)],_0xf287e6);const _0x82e52e=resolveLocalSqlFilePath(_0x18deda,_0x282d4f,_0x388c91);let _0x3cfc25;await fileExists(_0x82e52e)&&(_0x3cfc25=await moveToTrash(_0x18deda[_0x341c60(0xfb)],_0x18deda['trashDir'],_0x82e52e),await cleanupEmptyDirectories(dirname(_0x82e52e),_0x18deda[_0x341c60(0xf8)]));const _0x34d360={'deleted':_0x282d4f,'remoteId':_0x388c91['remoteId']};if(_0x3cfc25)_0x34d360['trashedTo']=_0x3cfc25;return{'ok':!![],'data':_0x34d360,'message':_0x341c60(0x105)+_0x282d4f+(_0x3cfc25?_0x341c60(0xfa):'')};}};async function moveToTrash(_0x461e83,_0x5b9cf6,_0x202568){const _0x5d4ec1=a184_0x20f4fd,_0x534112=new Date()[_0x5d4ec1(0xf5)]()[_0x5d4ec1(0xf1)](/[:.]/g,'-'),_0x3197a2=relative(_0x461e83,_0x202568),_0xc5827f=join(_0x5b9cf6,_0x534112,_0x3197a2);return await mkdir(dirname(_0xc5827f),{'recursive':!![]}),await rename(_0x202568,_0xc5827f),_0xc5827f;}async function cleanupEmptyDirectories(_0x3aa6c5,_0x831bb1){const _0x54e930=a184_0x20f4fd;let _0x5a72d2=resolve(_0x3aa6c5);const _0x353038=resolve(_0x831bb1);while(_0x5a72d2[_0x54e930(0xf6)](''+_0x353038+sep)||_0x5a72d2===_0x353038){if(_0x5a72d2===_0x353038)return;try{const _0x3902da=await readdir(_0x5a72d2);if(_0x3902da[_0x54e930(0xf2)]>0x0)return;await rmdir(_0x5a72d2);}catch{return;}_0x5a72d2=dirname(_0x5a72d2);}}
1
+ const a192_0x5778c2=a192_0x2d58;(function(_0x5280b8,_0x267d8c){const _0x97c99f=a192_0x2d58,_0x52c921=_0x5280b8();while(!![]){try{const _0x18a61a=parseInt(_0x97c99f(0x157))/0x1*(-parseInt(_0x97c99f(0x16b))/0x2)+parseInt(_0x97c99f(0x14b))/0x3+-parseInt(_0x97c99f(0x14d))/0x4*(parseInt(_0x97c99f(0x146))/0x5)+parseInt(_0x97c99f(0x147))/0x6+parseInt(_0x97c99f(0x148))/0x7+-parseInt(_0x97c99f(0x15a))/0x8*(parseInt(_0x97c99f(0x16a))/0x9)+-parseInt(_0x97c99f(0x14f))/0xa*(-parseInt(_0x97c99f(0x158))/0xb);if(_0x18a61a===_0x267d8c)break;else _0x52c921['push'](_0x52c921['shift']());}catch(_0x4ea182){_0x52c921['push'](_0x52c921['shift']());}}}(a192_0x3a39,0xb9140));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':'sql','command':a192_0x5778c2(0x153),'description':a192_0x5778c2(0x168),'risk':a192_0x5778c2(0x16d),'flags':[SQLCODE_FLAG],async 'validate'(_0x329929){const _0x366ec7=a192_0x5778c2,_0x4a8b3b=loadSqlProjectConfig(_0x329929[_0x366ec7(0x156)]),_0x4f03df=await readSqlLockFile(_0x4a8b3b[_0x366ec7(0x167)]);if(!_0x4f03df)throw CliErrors[_0x366ec7(0x14c)](_0x366ec7(0x164));},async 'dryRun'(_0x212d64){const _0x4a2014=a192_0x5778c2,_0x1d22bd=loadSqlProjectConfig(_0x212d64[_0x4a2014(0x156)]),_0x2ee674=await readSqlLockFile(_0x1d22bd[_0x4a2014(0x167)]);if(!_0x2ee674)throw CliErrors[_0x4a2014(0x14c)](_0x4a2014(0x164));const {appLock:_0x3371d9}=ensureSqlLockScope(_0x2ee674,_0x212d64[_0x4a2014(0x156)],_0x1d22bd['sqlRoot'],_0x4a2014(0x153)),_0x390dce=_0x212d64[_0x4a2014(0x169)](_0x4a2014(0x144)),_0x59eee3=_0x3371d9[_0x4a2014(0x166)][_0x390dce];if(!_0x59eee3)throw CliErrors[_0x4a2014(0x14c)](_0x4a2014(0x154)+_0x390dce+'\x22.');return{'method':_0x4a2014(0x15b),'url':_0x4a2014(0x15e),'body':{'sqlCode':_0x390dce,'id':_0x59eee3[_0x4a2014(0x160)],'localPath':resolveLocalSqlFilePath(_0x1d22bd,_0x390dce,_0x59eee3)},'description':_0x4a2014(0x16c)+_0x390dce+'\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20'+_0x1d22bd[_0x4a2014(0x162)]};},async 'execute'(_0x477524){const _0x17dc87=a192_0x5778c2,_0x6275b0=loadSqlProjectConfig(_0x477524['appCode']),_0x5c864d=await readSqlLockFile(_0x6275b0[_0x17dc87(0x167)]);if(!_0x5c864d)throw CliErrors[_0x17dc87(0x14c)](_0x17dc87(0x145));const {lockData:_0x44841d,appLock:_0x3db27c}=ensureSqlLockScope(_0x5c864d,_0x477524['appCode'],_0x6275b0[_0x17dc87(0x14a)],'delete'),_0x58b1b1=_0x477524[_0x17dc87(0x169)](_0x17dc87(0x144)),_0x3c0170=_0x3db27c[_0x17dc87(0x166)][_0x58b1b1];if(!_0x3c0170)throw CliErrors[_0x17dc87(0x14c)](_0x17dc87(0x154)+_0x58b1b1+'\x22.');await deleteSqlQuery({'id':_0x3c0170['remoteId'],'sqlCode':_0x58b1b1}),_0x3db27c[_0x17dc87(0x166)]=Object[_0x17dc87(0x149)](Object[_0x17dc87(0x15d)](_0x3db27c[_0x17dc87(0x166)])[_0x17dc87(0x15c)](([_0xc1e602])=>_0xc1e602!==_0x58b1b1)),_0x3db27c[_0x17dc87(0x152)]=new Date()[_0x17dc87(0x163)](),await writeSqlLockFile(_0x6275b0[_0x17dc87(0x167)],_0x44841d);const _0x2ac6da=resolveLocalSqlFilePath(_0x6275b0,_0x58b1b1,_0x3c0170);let _0x301e3a;await fileExists(_0x2ac6da)&&(_0x301e3a=await moveToTrash(_0x6275b0[_0x17dc87(0x150)],_0x6275b0['trashDir'],_0x2ac6da),await cleanupEmptyDirectories(dirname(_0x2ac6da),_0x6275b0[_0x17dc87(0x165)]));const _0x9a4257={'deleted':_0x58b1b1,'remoteId':_0x3c0170[_0x17dc87(0x160)]};if(_0x301e3a)_0x9a4257[_0x17dc87(0x14e)]=_0x301e3a;return{'ok':!![],'data':_0x9a4257,'message':_0x17dc87(0x161)+_0x58b1b1+(_0x301e3a?_0x17dc87(0x151):'')};}};async function moveToTrash(_0x33a706,_0xf21855,_0x339ddf){const _0x227560=a192_0x5778c2,_0x29125a=new Date()[_0x227560(0x163)]()[_0x227560(0x159)](/[:.]/g,'-'),_0x344b42=relative(_0x33a706,_0x339ddf),_0x56d860=join(_0xf21855,_0x29125a,_0x344b42);return await mkdir(dirname(_0x56d860),{'recursive':!![]}),await rename(_0x339ddf,_0x56d860),_0x56d860;}function a192_0x2d58(_0x40bdaa,_0x43aa2b){_0x40bdaa=_0x40bdaa-0x144;const _0x3a39bb=a192_0x3a39();let _0x2d5858=_0x3a39bb[_0x40bdaa];return _0x2d5858;}async function cleanupEmptyDirectories(_0x3372ed,_0x23cd2a){const _0x724c77=a192_0x5778c2;let _0x3bfb37=resolve(_0x3372ed);const _0x148925=resolve(_0x23cd2a);while(_0x3bfb37[_0x724c77(0x15f)](''+_0x148925+sep)||_0x3bfb37===_0x148925){if(_0x3bfb37===_0x148925)return;try{const _0xc93fb6=await readdir(_0x3bfb37);if(_0xc93fb6[_0x724c77(0x155)]>0x0)return;await rmdir(_0x3bfb37);}catch{return;}_0x3bfb37=dirname(_0x3bfb37);}}function a192_0x3a39(){const _0x3b6ce8=['1727cKkcEl','replace','1708408PGJOcF','POST','filter','entries','/smartapi/custom/deleteUserCustomSql','startsWith','remoteId','Deleted\x20','trashDir','toISOString','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','sqlRootDir','sqls','lockFilePath','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','str','9Zfmfjl','1862cQKrje','Would\x20delete\x20SQL\x20','high-risk-write','sqlcode','SQL\x20lock\x20file\x20not\x20found.','105gjmIMS','6533376MHnjWK','5462289MYHxlX','fromEntries','sqlRoot','322896ZgajDF','validation','231784xARhOT','trashedTo','86300szTHQm','projectRoot','\x20(local\x20file\x20moved\x20to\x20trash)','lastSync','delete','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','length','appCode','1228nhEdVu'];a192_0x3a39=function(){return _0x3b6ce8;};return a192_0x3a39();}
@@ -1 +1 @@
1
- function a185_0x2347(_0x2e0234,_0x29224e){_0x2e0234=_0x2e0234-0xbc;const _0x55000c=a185_0x5500();let _0x234723=_0x55000c[_0x2e0234];return _0x234723;}const a185_0x4cc823=a185_0x2347;(function(_0x5a35e1,_0x24b467){const _0x227fd6=a185_0x2347,_0x3d9050=_0x5a35e1();while(!![]){try{const _0x462ba0=parseInt(_0x227fd6(0xc4))/0x1*(-parseInt(_0x227fd6(0xc1))/0x2)+parseInt(_0x227fd6(0xcb))/0x3*(parseInt(_0x227fd6(0xc6))/0x4)+parseInt(_0x227fd6(0xd1))/0x5+-parseInt(_0x227fd6(0xbd))/0x6+-parseInt(_0x227fd6(0xce))/0x7+-parseInt(_0x227fd6(0xc9))/0x8*(parseInt(_0x227fd6(0xbf))/0x9)+parseInt(_0x227fd6(0xca))/0xa*(parseInt(_0x227fd6(0xc8))/0xb);if(_0x462ba0===_0x24b467)break;else _0x3d9050['push'](_0x3d9050['shift']());}catch(_0x42486a){_0x3d9050['push'](_0x3d9050['shift']());}}}(a185_0x5500,0x3bb12));function a185_0x5500(){const _0x2906f4=['7519980tvfcWK','234774XrSaKd','appCode','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','478730MRTpgb','detail','verbose','1208220WcFNTn','sql','sqlName','738252ihLpjB','boolean','1722141nPanRV','dbId','2yjFzkp','bool','sqlcode','444621yZRqOG','Return\x20full\x20raw\x20SQL\x20query\x20object','4nkzuyj','sqlCode','11dumUjJ','8qVisNc'];a185_0x5500=function(){return _0x2906f4;};return a185_0x5500();}import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a185_0x4cc823(0xd2),'command':a185_0x4cc823(0xcf),'description':a185_0x4cc823(0xcd),'risk':'read','flags':[SQLCODE_FLAG,{'name':'verbose','type':a185_0x4cc823(0xbe),'description':a185_0x4cc823(0xc5)}],async 'execute'(_0x240cbe){const _0x5af163=a185_0x4cc823,_0x58903a=await getSqlQueryInfo(_0x240cbe[_0x5af163(0xcc)],_0x240cbe['str'](_0x5af163(0xc3))),_0x1f9083=_0x240cbe[_0x5af163(0xc2)](_0x5af163(0xd0));if(_0x1f9083)return{'ok':!![],'data':_0x58903a};const _0x2fc7a8=_0x58903a[_0x5af163(0xc0)]?await getDbName(_0x240cbe[_0x5af163(0xcc)],_0x58903a[_0x5af163(0xc0)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x58903a[_0x5af163(0xc7)],'sqlName':_0x58903a[_0x5af163(0xbc)],'db':_0x2fc7a8?_0x2fc7a8+'\x20('+_0x58903a[_0x5af163(0xc0)]+')':_0x58903a[_0x5af163(0xc0)]??'','description':_0x58903a['description']??'','sqlContent':_0x58903a['sqlContent']??''}};}};
1
+ function a193_0x1d93(_0x4e9861,_0x249125){_0x4e9861=_0x4e9861-0x85;const _0x560a5b=a193_0x560a();let _0x1d9308=_0x560a5b[_0x4e9861];return _0x1d9308;}function a193_0x560a(){const _0x303718=['121bIaYmJ','dbId','474Pargyo','27771276kTawNp','Return\x20full\x20raw\x20SQL\x20query\x20object','sqlContent','13DYliLf','bool','description','8KeDMBs','27498zZEiiD','sqlName','read','verbose','24970SsPSIJ','785hDihGo','sqlCode','454PrMQUZ','67785gjeXCU','sqlcode','104jggyRl','3826584OilHxW','str','sql','appCode','6587224TlQqiR'];a193_0x560a=function(){return _0x303718;};return a193_0x560a();}const a193_0x58cedd=a193_0x1d93;(function(_0x13d67c,_0x419638){const _0x2cf49c=a193_0x1d93,_0x4d3b3d=_0x13d67c();while(!![]){try{const _0x27b956=parseInt(_0x2cf49c(0x96))/0x1*(parseInt(_0x2cf49c(0x87))/0x2)+-parseInt(_0x2cf49c(0x97))/0x3*(-parseInt(_0x2cf49c(0x99))/0x4)+-parseInt(_0x2cf49c(0x94))/0x5*(-parseInt(_0x2cf49c(0x8f))/0x6)+parseInt(_0x2cf49c(0x9e))/0x7+-parseInt(_0x2cf49c(0x8e))/0x8*(-parseInt(_0x2cf49c(0x9a))/0x9)+-parseInt(_0x2cf49c(0x93))/0xa*(-parseInt(_0x2cf49c(0x85))/0xb)+-parseInt(_0x2cf49c(0x88))/0xc*(parseInt(_0x2cf49c(0x8b))/0xd);if(_0x27b956===_0x419638)break;else _0x4d3b3d['push'](_0x4d3b3d['shift']());}catch(_0x47552d){_0x4d3b3d['push'](_0x4d3b3d['shift']());}}}(a193_0x560a,0x789b1));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a193_0x58cedd(0x9c),'command':'detail','description':'Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','risk':a193_0x58cedd(0x91),'flags':[SQLCODE_FLAG,{'name':a193_0x58cedd(0x92),'type':'boolean','description':a193_0x58cedd(0x89)}],async 'execute'(_0xf5ffc2){const _0x448b57=a193_0x58cedd,_0x78f68=await getSqlQueryInfo(_0xf5ffc2['appCode'],_0xf5ffc2[_0x448b57(0x9b)](_0x448b57(0x98))),_0x1a7f99=_0xf5ffc2[_0x448b57(0x8c)](_0x448b57(0x92));if(_0x1a7f99)return{'ok':!![],'data':_0x78f68};const _0x52ac58=_0x78f68['dbId']?await getDbName(_0xf5ffc2[_0x448b57(0x9d)],_0x78f68[_0x448b57(0x86)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x78f68[_0x448b57(0x95)],'sqlName':_0x78f68[_0x448b57(0x90)],'db':_0x52ac58?_0x52ac58+'\x20('+_0x78f68['dbId']+')':_0x78f68[_0x448b57(0x86)]??'','description':_0x78f68[_0x448b57(0x8d)]??'','sqlContent':_0x78f68[_0x448b57(0x8a)]??''}};}};
@@ -1 +1 @@
1
- function a186_0x39c1(_0x200e16,_0x3794a7){_0x200e16=_0x200e16-0x9b;const _0x863fa0=a186_0x863f();let _0x39c190=_0x863fa0[_0x200e16];return _0x39c190;}function a186_0x863f(){const _0x565250=['execResult','read','now','124476JpIvEz','6730934VZeQnb','SQL\x20execution\x20failed','4547466TRhwwS','1420arqqai','125609wxsQkM','Returned\x20','8DgFaha','sql','isArray','exec','str','13404ZlwPkj','20mKGkUg','appCode','33018izvmDE','execSuccess','1518246GJRZNy','params','105xmgXdk'];a186_0x863f=function(){return _0x565250;};return a186_0x863f();}const a186_0x1883a8=a186_0x39c1;(function(_0x1d8628,_0x4b358d){const _0x30a42e=a186_0x39c1,_0x20d552=_0x1d8628();while(!![]){try{const _0x2256aa=parseInt(_0x30a42e(0xa1))/0x1+-parseInt(_0x30a42e(0xb0))/0x2*(parseInt(_0x30a42e(0x9d))/0x3)+-parseInt(_0x30a42e(0xad))/0x4*(-parseInt(_0x30a42e(0xa5))/0x5)+-parseInt(_0x30a42e(0xa4))/0x6+parseInt(_0x30a42e(0xa2))/0x7+-parseInt(_0x30a42e(0xa8))/0x8*(parseInt(_0x30a42e(0x9b))/0x9)+parseInt(_0x30a42e(0xae))/0xa*(parseInt(_0x30a42e(0xa6))/0xb);if(_0x2256aa===_0x4b358d)break;else _0x20d552['push'](_0x20d552['shift']());}catch(_0x15b874){_0x20d552['push'](_0x20d552['shift']());}}}(a186_0x863f,0x87c6c));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a186_0x1883a8(0xa9),'command':a186_0x1883a8(0xab),'description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','risk':a186_0x1883a8(0x9f),'flags':[SQLCODE_FLAG,{'name':a186_0x1883a8(0x9c),'type':'string','description':'SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)'}],async 'execute'(_0xbbf80c){const _0x20addf=a186_0x1883a8,_0x21efb1=parseJsonParams(_0xbbf80c[_0x20addf(0xac)](_0x20addf(0x9c))),_0x969584=Date[_0x20addf(0xa0)](),_0x504281=await executeSql(_0xbbf80c[_0x20addf(0xaf)],_0xbbf80c[_0x20addf(0xac)]('sqlcode'),_0x21efb1),_0x117d18=Date[_0x20addf(0xa0)]()-_0x969584,_0x54f3e6=_0x504281?.[_0x20addf(0x9e)]??_0x504281,_0x530558=_0x504281?.[_0x20addf(0xb1)]??!![];if(!_0x530558)return{'ok':![],'data':{'error':_0x504281?.['execError']||_0x20addf(0xa3),'elapsed':_0x117d18},'message':_0x20addf(0xa3)};const _0x5e4ef6=Array[_0x20addf(0xaa)](_0x54f3e6)?_0x54f3e6:[];return{'ok':!![],'data':{'rows':_0x5e4ef6,'rowCount':_0x5e4ef6['length'],'elapsed':_0x117d18},'message':_0x20addf(0xa7)+_0x5e4ef6['length']+'\x20row(s)\x20in\x20'+_0x117d18+'ms'};}};
1
+ const a194_0xbf14f7=a194_0x5854;(function(_0x133eec,_0x470cab){const _0x209866=a194_0x5854,_0x141c9c=_0x133eec();while(!![]){try{const _0xdb5869=parseInt(_0x209866(0xa5))/0x1+-parseInt(_0x209866(0x98))/0x2*(parseInt(_0x209866(0xad))/0x3)+-parseInt(_0x209866(0x94))/0x4+-parseInt(_0x209866(0x99))/0x5*(parseInt(_0x209866(0x9b))/0x6)+-parseInt(_0x209866(0x9c))/0x7*(-parseInt(_0x209866(0x9e))/0x8)+-parseInt(_0x209866(0xa8))/0x9+parseInt(_0x209866(0xa2))/0xa;if(_0xdb5869===_0x470cab)break;else _0x141c9c['push'](_0x141c9c['shift']());}catch(_0x999473){_0x141c9c['push'](_0x141c9c['shift']());}}}(a194_0x45f3,0x721c6));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';function a194_0x5854(_0x1ba5af,_0x2c1817){_0x1ba5af=_0x1ba5af-0x94;const _0x45f304=a194_0x45f3();let _0x5854a5=_0x45f304[_0x1ba5af];return _0x5854a5;}function a194_0x45f3(){const _0x404499=['2523320iOQzWC','read','params','length','14tnkOJd','95985SfbSkY','SQL\x20execution\x20failed','198Btilzt','7oxQVvV','now','67888gVxRRb','appCode','execError','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','18058450GqNHLT','execSuccess','string','625198KfOdAc','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','str','389610PzCkdg','Returned\x20','isArray','execResult','exec','284790MFnzbE'];a194_0x45f3=function(){return _0x404499;};return a194_0x45f3();}export const sqlExec={'service':'sql','command':a194_0xbf14f7(0xac),'description':a194_0xbf14f7(0xa6),'risk':a194_0xbf14f7(0x95),'flags':[SQLCODE_FLAG,{'name':a194_0xbf14f7(0x96),'type':a194_0xbf14f7(0xa4),'description':a194_0xbf14f7(0xa1)}],async 'execute'(_0x161da8){const _0x300d81=a194_0xbf14f7,_0x5cf25e=parseJsonParams(_0x161da8[_0x300d81(0xa7)](_0x300d81(0x96))),_0x475723=Date['now'](),_0x575a1a=await executeSql(_0x161da8[_0x300d81(0x9f)],_0x161da8['str']('sqlcode'),_0x5cf25e),_0x1a59fb=Date[_0x300d81(0x9d)]()-_0x475723,_0x4c02c7=_0x575a1a?.[_0x300d81(0xab)]??_0x575a1a,_0x3a1c33=_0x575a1a?.[_0x300d81(0xa3)]??!![];if(!_0x3a1c33)return{'ok':![],'data':{'error':_0x575a1a?.[_0x300d81(0xa0)]||_0x300d81(0x9a),'elapsed':_0x1a59fb},'message':'SQL\x20execution\x20failed'};const _0x539d9c=Array[_0x300d81(0xaa)](_0x4c02c7)?_0x4c02c7:[];return{'ok':!![],'data':{'rows':_0x539d9c,'rowCount':_0x539d9c[_0x300d81(0x97)],'elapsed':_0x1a59fb},'message':_0x300d81(0xa9)+_0x539d9c[_0x300d81(0x97)]+'\x20row(s)\x20in\x20'+_0x1a59fb+'ms'};}};
@@ -1 +1 @@
1
- (function(_0x3a745f,_0x8a5dbb){const _0x560719=a187_0x57e8,_0x1e88b8=_0x3a745f();while(!![]){try{const _0x83a2c1=parseInt(_0x560719(0xed))/0x1+-parseInt(_0x560719(0xf1))/0x2+parseInt(_0x560719(0xee))/0x3+parseInt(_0x560719(0xeb))/0x4+parseInt(_0x560719(0xef))/0x5*(-parseInt(_0x560719(0xf0))/0x6)+parseInt(_0x560719(0xec))/0x7+-parseInt(_0x560719(0xf3))/0x8*(parseInt(_0x560719(0xf2))/0x9);if(_0x83a2c1===_0x8a5dbb)break;else _0x1e88b8['push'](_0x1e88b8['shift']());}catch(_0x50f6c6){_0x1e88b8['push'](_0x1e88b8['shift']());}}}(a187_0x94c8,0xc03b6));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';function a187_0x94c8(){const _0x4d617d=['2043096MoExJm','9365909rdJuSj','552672tXQdYx','2647188rKDxNm','220RuIiRx','31278SJRJfy','540522vzBpJv','108261oJSyfY','1328OgEnhw'];a187_0x94c8=function(){return _0x4d617d;};return a187_0x94c8();}function a187_0x57e8(_0xe396d,_0x14cb7f){_0xe396d=_0xe396d-0xeb;const _0x94c8d4=a187_0x94c8();let _0x57e8ac=_0x94c8d4[_0xe396d];return _0x57e8ac;}import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
1
+ (function(_0x1476e0,_0x212b5e){const _0x13b831=a195_0x8889,_0x355767=_0x1476e0();while(!![]){try{const _0x581ba7=-parseInt(_0x13b831(0x16f))/0x1+-parseInt(_0x13b831(0x170))/0x2*(parseInt(_0x13b831(0x174))/0x3)+parseInt(_0x13b831(0x173))/0x4+-parseInt(_0x13b831(0x175))/0x5+parseInt(_0x13b831(0x171))/0x6+parseInt(_0x13b831(0x16e))/0x7*(parseInt(_0x13b831(0x172))/0x8)+parseInt(_0x13b831(0x176))/0x9;if(_0x581ba7===_0x212b5e)break;else _0x355767['push'](_0x355767['shift']());}catch(_0x4c18dd){_0x355767['push'](_0x355767['shift']());}}}(a195_0x48cd,0x69a8a));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';function a195_0x48cd(){const _0x3f4c32=['241100Ffqbdf','839376QkJasR','1588984AXeXTi','2943348dWOuFO','15wvDDcT','132060aIjbKb','3950469hAHOBm','14uzsjTl','649980sFpHUp'];a195_0x48cd=function(){return _0x3f4c32;};return a195_0x48cd();}import{sqlPull}from'../../commands/sql/pull.js';function a195_0x8889(_0x2db616,_0x4b696a){_0x2db616=_0x2db616-0x16e;const _0x48cda0=a195_0x48cd();let _0x8889c0=_0x48cda0[_0x2db616];return _0x8889c0;}import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
@@ -1 +1 @@
1
- const a188_0x30ee07=a188_0x5058;(function(_0x4a7d6a,_0x10a1ba){const _0x4cce29=a188_0x5058,_0x54db91=_0x4a7d6a();while(!![]){try{const _0x119453=parseInt(_0x4cce29(0x1a8))/0x1*(-parseInt(_0x4cce29(0x1aa))/0x2)+parseInt(_0x4cce29(0x1ad))/0x3*(parseInt(_0x4cce29(0x1ae))/0x4)+parseInt(_0x4cce29(0x1b1))/0x5*(parseInt(_0x4cce29(0x1ab))/0x6)+-parseInt(_0x4cce29(0x1a4))/0x7+parseInt(_0x4cce29(0x1ac))/0x8+parseInt(_0x4cce29(0x1bf))/0x9+parseInt(_0x4cce29(0x1c2))/0xa*(-parseInt(_0x4cce29(0x1c0))/0xb);if(_0x119453===_0x10a1ba)break;else _0x54db91['push'](_0x54db91['shift']());}catch(_0x1e9826){_0x54db91['push'](_0x54db91['shift']());}}}(a188_0x1a83,0x4dccc));import{listSqlQueries}from'../../core/api-client.js';function a188_0x5058(_0x575e0a,_0x1fed5f){_0x575e0a=_0x575e0a-0x1a2;const _0x1a83bd=a188_0x1a83();let _0x505865=_0x1a83bd[_0x575e0a];return _0x505865;}import{getDbName}from'../../core/db-resolver.js';function a188_0x1a83(){const _0x12379f=['No\x20custom\x20SQL\x20queries\x20found.','list','Page\x20size','2uCejSz','List\x20custom\x20SQL\x20queries','444502UkRtuF','162978JzsOKw','3116896KcwvAC','3swrTnt','2004156uMaxLj','all','appCode','60ExUBqg','str','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','description','dbId','string','totalCount','\x20SQL\x20queries\x20(total:\x20','name','pagesize','Filter\x20by\x20SQL\x20name','number','map','read','628083ZZnfHs','472109NkzvRs','length','50OwFqPS','sql','num','sqlName','Page\x20number','page','boolean','verbose','2160403xnAbWz'];a188_0x1a83=function(){return _0x12379f;};return a188_0x1a83();}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a188_0x30ee07(0x1c3),'command':a188_0x30ee07(0x1a6),'description':a188_0x30ee07(0x1a9),'risk':a188_0x30ee07(0x1be),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a188_0x30ee07(0x1b9),'type':a188_0x30ee07(0x1b6),'description':a188_0x30ee07(0x1bb)},{'name':a188_0x30ee07(0x1c7),'type':a188_0x30ee07(0x1bc),'description':a188_0x30ee07(0x1c6),'default':0x1},{'name':a188_0x30ee07(0x1ba),'type':'number','description':a188_0x30ee07(0x1a7)},{'name':a188_0x30ee07(0x1a3),'type':a188_0x30ee07(0x1a2),'description':a188_0x30ee07(0x1b3)}],async 'execute'(_0x4de189){const _0x4affec=a188_0x30ee07,_0x21950d=await listSqlQueries(_0x4de189[_0x4affec(0x1b0)],{'sqlCode':_0x4de189[_0x4affec(0x1b2)]('sqlcode')||undefined,'sqlName':_0x4de189[_0x4affec(0x1b2)](_0x4affec(0x1b9))||undefined,'currentPage':_0x4de189[_0x4affec(0x1c4)](_0x4affec(0x1c7)),'pageSize':_0x4de189[_0x4affec(0x1c4)](_0x4affec(0x1ba),0x32)}),_0x28e2b8=_0x4de189['bool'](_0x4affec(0x1a3)),_0x29d677=_0x21950d['tableData']??[],_0x3ecceb=_0x21950d['paging']?.[_0x4affec(0x1b7)]??_0x29d677['length'];let _0x11fea2;return _0x28e2b8?_0x11fea2=_0x29d677:_0x11fea2=await Promise[_0x4affec(0x1af)](_0x29d677[_0x4affec(0x1bd)](async _0x4151cd=>{const _0x21ed22=_0x4affec;let _0x2066c2;try{_0x2066c2=_0x4151cd[_0x21ed22(0x1b5)]?await getDbName(_0x4de189[_0x21ed22(0x1b0)],_0x4151cd[_0x21ed22(0x1b5)]):undefined;}catch{}return{'sqlCode':_0x4151cd['sqlCode'],'sqlName':_0x4151cd[_0x21ed22(0x1c5)],'description':_0x4151cd[_0x21ed22(0x1b4)]??'','db':_0x2066c2?_0x2066c2+'\x20('+_0x4151cd['dbId']+')':_0x4151cd[_0x21ed22(0x1b5)]??''};})),{'ok':!![],'data':_0x11fea2,'message':_0x29d677[_0x4affec(0x1c1)]===0x0?_0x4affec(0x1a5):'Found\x20'+_0x29d677[_0x4affec(0x1c1)]+_0x4affec(0x1b8)+_0x3ecceb+').'};}};
1
+ const a196_0xdf3e2=a196_0x496d;(function(_0x7ada95,_0x44b1d6){const _0x2a24b6=a196_0x496d,_0x2404ef=_0x7ada95();while(!![]){try{const _0x5a7831=parseInt(_0x2a24b6(0x13c))/0x1+-parseInt(_0x2a24b6(0x12a))/0x2*(parseInt(_0x2a24b6(0x146))/0x3)+-parseInt(_0x2a24b6(0x12e))/0x4*(parseInt(_0x2a24b6(0x132))/0x5)+-parseInt(_0x2a24b6(0x143))/0x6+parseInt(_0x2a24b6(0x14a))/0x7+-parseInt(_0x2a24b6(0x139))/0x8+-parseInt(_0x2a24b6(0x13d))/0x9*(-parseInt(_0x2a24b6(0x13b))/0xa);if(_0x5a7831===_0x44b1d6)break;else _0x2404ef['push'](_0x2404ef['shift']());}catch(_0x461b60){_0x2404ef['push'](_0x2404ef['shift']());}}}(a196_0x56d5,0x73475));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a196_0x496d(_0x1a7e2f,_0x4fb40c){_0x1a7e2f=_0x1a7e2f-0x128;const _0x56d5c4=a196_0x56d5();let _0x496dab=_0x56d5c4[_0x1a7e2f];return _0x496dab;}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a196_0xdf3e2(0x141),'command':a196_0xdf3e2(0x148),'description':a196_0xdf3e2(0x13a),'risk':a196_0xdf3e2(0x136),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a196_0xdf3e2(0x12c),'type':a196_0xdf3e2(0x137),'description':a196_0xdf3e2(0x12b)},{'name':a196_0xdf3e2(0x134),'type':a196_0xdf3e2(0x149),'description':a196_0xdf3e2(0x145),'default':0x1},{'name':'pagesize','type':a196_0xdf3e2(0x149),'description':a196_0xdf3e2(0x13f)},{'name':a196_0xdf3e2(0x128),'type':'boolean','description':a196_0xdf3e2(0x133)}],async 'execute'(_0x27f54c){const _0x4d1a4f=a196_0xdf3e2,_0x516065=await listSqlQueries(_0x27f54c[_0x4d1a4f(0x14c)],{'sqlCode':_0x27f54c['str'](_0x4d1a4f(0x14b))||undefined,'sqlName':_0x27f54c[_0x4d1a4f(0x144)](_0x4d1a4f(0x12c))||undefined,'currentPage':_0x27f54c['num']('page'),'pageSize':_0x27f54c[_0x4d1a4f(0x147)](_0x4d1a4f(0x138),0x32)}),_0x2eb098=_0x27f54c[_0x4d1a4f(0x129)](_0x4d1a4f(0x128)),_0x52dfc6=_0x516065[_0x4d1a4f(0x130)]??[],_0x13074b=_0x516065[_0x4d1a4f(0x13e)]?.[_0x4d1a4f(0x140)]??_0x52dfc6[_0x4d1a4f(0x131)];let _0x2912bc;return _0x2eb098?_0x2912bc=_0x52dfc6:_0x2912bc=await Promise['all'](_0x52dfc6['map'](async _0xf0ef9f=>{const _0x4bd9b4=_0x4d1a4f;let _0x48f0c2;try{_0x48f0c2=_0xf0ef9f[_0x4bd9b4(0x135)]?await getDbName(_0x27f54c['appCode'],_0xf0ef9f[_0x4bd9b4(0x135)]):undefined;}catch{}return{'sqlCode':_0xf0ef9f['sqlCode'],'sqlName':_0xf0ef9f[_0x4bd9b4(0x142)],'description':_0xf0ef9f['description']??'','db':_0x48f0c2?_0x48f0c2+'\x20('+_0xf0ef9f[_0x4bd9b4(0x135)]+')':_0xf0ef9f[_0x4bd9b4(0x135)]??''};})),{'ok':!![],'data':_0x2912bc,'message':_0x52dfc6[_0x4d1a4f(0x131)]===0x0?_0x4d1a4f(0x12d):_0x4d1a4f(0x12f)+_0x52dfc6[_0x4d1a4f(0x131)]+'\x20SQL\x20queries\x20(total:\x20'+_0x13074b+').'};}};function a196_0x56d5(){const _0x94c381=['3974117KJuarv','sqlcode','appCode','verbose','bool','270386qTQMqZ','Filter\x20by\x20SQL\x20name','name','No\x20custom\x20SQL\x20queries\x20found.','1899644ZTvkpa','Found\x20','tableData','length','5xHisfH','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','page','dbId','read','string','pagesize','38456xtkQXA','List\x20custom\x20SQL\x20queries','39740gweMoL','567189XQTvJj','1611CctgYm','paging','Page\x20size','totalCount','sql','sqlName','1310412EKPiiT','str','Page\x20number','15kyRriX','num','list','number'];a196_0x56d5=function(){return _0x94c381;};return a196_0x56d5();}
@@ -1 +1 @@
1
- const a189_0x3817b5=a189_0x2d14;(function(_0x1b0ccb,_0xba7479){const _0x566a67=a189_0x2d14,_0x564c3d=_0x1b0ccb();while(!![]){try{const _0x4cd3f6=parseInt(_0x566a67(0xb4))/0x1*(parseInt(_0x566a67(0x7b))/0x2)+parseInt(_0x566a67(0x7c))/0x3+parseInt(_0x566a67(0x86))/0x4+parseInt(_0x566a67(0x8b))/0x5*(-parseInt(_0x566a67(0x9d))/0x6)+-parseInt(_0x566a67(0x9b))/0x7*(-parseInt(_0x566a67(0xb2))/0x8)+-parseInt(_0x566a67(0xb3))/0x9+-parseInt(_0x566a67(0x95))/0xa*(parseInt(_0x566a67(0xa0))/0xb);if(_0x4cd3f6===_0xba7479)break;else _0x564c3d['push'](_0x564c3d['shift']());}catch(_0x374caf){_0x564c3d['push'](_0x564c3d['shift']());}}}(a189_0x5360,0x32547));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';function a189_0x5360(){const _0x47e93d=['split','mybatisXml','boolean','paging','name','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','string','sqlRoot','Force\x20pull\x20cancelled.','Would\x20pull\x20','push','\x20SQL\x20file(s)\x20into\x20','bool','test','str','\x20written,\x20','join','192iJXoTp','818451OLowoT','52mskPUF','apps','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','appCode','sqlCode','force','9172avDcyt','1018038zSBYAy','unchanged','trimStart','sqlName','POST','catch','\x20failed','sqlRootDir','Filter\x20by\x20SQL\x20display\x20name','skipped','283568qyBYNf','cancelled','filter','utf8','lockFilePath','3385lcrPxE','totalCount','nonInteractive','Pull\x20complete:\x20','conflict','pull','local\x20differs\x20from\x20remote','read','sqlContent','toISOString','950HdtVsV','would_pull','length','replace','description','message','112399iWYOqH','dbId','2934iVIxvm','path','sqls','47003EWDJiO'];a189_0x5360=function(){return _0x47e93d;};return a189_0x5360();}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{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(_0x41b95f,_0x2d7290){const _0x3efa2a=a189_0x2d14,_0x16d225=[];let _0x2b68b0=0x1;while(!![]){const _0x4be1a1=await listSqlQueries(_0x41b95f,{'currentPage':_0x2b68b0,'pageSize':PAGE_SIZE,'sqlCode':_0x2d7290['sqlCode'],'sqlName':_0x2d7290[_0x3efa2a(0x7f)]}),_0x3cc440=_0x4be1a1['tableData']??[];_0x16d225[_0x3efa2a(0xab)](..._0x3cc440);if(_0x3cc440[_0x3efa2a(0x97)]===0x0)break;const _0x59c7c0=_0x4be1a1[_0x3efa2a(0xa4)]?.[_0x3efa2a(0x8c)];if(_0x59c7c0!=null?_0x16d225[_0x3efa2a(0x97)]>=_0x59c7c0:_0x3cc440[_0x3efa2a(0x97)]<PAGE_SIZE)break;_0x2b68b0++;}return _0x16d225;}async function ensureSqlContent(_0x4c8dc3){const _0x43f32e=a189_0x2d14;if(_0x4c8dc3[_0x43f32e(0x93)]!=null&&String(_0x4c8dc3[_0x43f32e(0x93)])['length']>0x0)return _0x4c8dc3;return getSqlQueryDetail(_0x4c8dc3['sqlCode']);}export const sqlPull={'service':'sql','command':a189_0x3817b5(0x90),'description':'Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','risk':a189_0x3817b5(0x92),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a189_0x3817b5(0xa5),'type':a189_0x3817b5(0xa7),'description':a189_0x3817b5(0x84)},{'name':'force','type':a189_0x3817b5(0xa3),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x3fdeea){const _0x244d0a=a189_0x3817b5,_0x50d758=loadSqlProjectConfig(_0x3fdeea['appCode']),_0x38558c=await readSqlLockFile(_0x50d758['lockFilePath']),{appLock:_0x58bfb1}=ensureSqlLockScope(_0x38558c??createEmptySqlLock(),_0x50d758['appCode'],_0x50d758[_0x244d0a(0xa8)],'pull'),_0x50eb3b=await fetchAllSqlQueries(_0x3fdeea[_0x244d0a(0x78)],{'sqlCode':_0x3fdeea[_0x244d0a(0xaf)]('sqlcode')||undefined,'sqlName':_0x3fdeea[_0x244d0a(0xaf)](_0x244d0a(0xa5))||undefined}),_0x111300=[];for(const _0x2544fb of _0x50eb3b){const _0x51617b=await ensureSqlContent(_0x2544fb),_0x1c1723=ensureRemoteSqlContent(_0x51617b),_0x3f2fb7=detectModeFromSql(_0x51617b),_0x441094=_0x51617b['dbId']?await getDbName(_0x3fdeea['appCode'],Number(_0x51617b[_0x244d0a(0x9c)]))[_0x244d0a(0x81)](()=>undefined):undefined,_0x56631c=buildLocalSqlFileContent({'sqlCode':_0x51617b[_0x244d0a(0x79)],'sqlName':_0x51617b[_0x244d0a(0x7f)],'dbId':_0x51617b[_0x244d0a(0x9c)]},_0x1c1723,{'dbName':_0x441094,'mode':_0x3f2fb7,'syncedAt':new Date()[_0x244d0a(0x94)](),'description':_0x51617b[_0x244d0a(0x99)]}),_0x58c309=buildSqlLockEntry(_0x51617b,_0x1c1723,'',{'dbName':_0x441094}),_0xea7cee=resolveLocalSqlFilePath(_0x50d758,_0x51617b[_0x244d0a(0x79)],_0x58c309);let _0x5a32da=_0x244d0a(0x96),_0xef72ba;if(await fileExists(_0xea7cee)){const _0x1d3422=await readFile(_0xea7cee,_0x244d0a(0x89));isEquivalentPulledSqlFile(_0x1d3422,_0x56631c,_0x3f2fb7)?(_0x5a32da=_0x244d0a(0x85),_0xef72ba='unchanged'):(_0x5a32da=_0x244d0a(0x8f),_0xef72ba=_0x244d0a(0x77));}_0x111300[_0x244d0a(0xab)]({'sqlCode':_0x51617b[_0x244d0a(0x79)],'sqlName':_0x51617b['sqlName'],'filePath':_0xea7cee,'status':_0x5a32da,'reason':_0xef72ba});}return{'method':_0x244d0a(0x80),'url':_0x244d0a(0xa6),'body':{'appCode':_0x3fdeea[_0x244d0a(0x78)],'sqlCode':_0x3fdeea['str']('sqlcode')||null,'sqlName':_0x3fdeea['str']('name')||null,'files':_0x111300},'description':_0x244d0a(0xaa)+_0x111300[_0x244d0a(0x97)]+_0x244d0a(0xac)+_0x50d758[_0x244d0a(0x83)]};},async 'execute'(_0x999262){const _0xb59bad=a189_0x3817b5,_0x52172b=loadSqlProjectConfig(_0x999262[_0xb59bad(0x78)]),_0x4c4d20=await readSqlLockFile(_0x52172b[_0xb59bad(0x8a)]),{lockData:_0x24eb95,appLock:_0x4f9143}=ensureSqlLockScope(_0x4c4d20??createEmptySqlLock(),_0x52172b[_0xb59bad(0x78)],_0x52172b[_0xb59bad(0xa8)],_0xb59bad(0x90)),_0x8050=_0x999262[_0xb59bad(0xad)](_0xb59bad(0x7a)),_0x33bf34=await fetchAllSqlQueries(_0x999262[_0xb59bad(0x78)],{'sqlCode':_0x999262[_0xb59bad(0xaf)]('sqlcode')||undefined,'sqlName':_0x999262[_0xb59bad(0xaf)](_0xb59bad(0xa5))||undefined});if(_0x33bf34['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20SQL\x20queries\x20matched.'};const _0x1b6d9c=[],_0x35610a=[];for(const _0xdcf157 of _0x33bf34){try{_0x1b6d9c['push'](await ensureSqlContent(_0xdcf157));}catch(_0x42f72a){_0x35610a['push']({'sqlCode':_0xdcf157[_0xb59bad(0x79)],'error':_0x42f72a instanceof Error?_0x42f72a[_0xb59bad(0x9a)]:String(_0x42f72a)});}}if(_0x8050&&!_0x999262[_0xb59bad(0x8d)]){let _0x4ac9a1=![];for(const _0x1cb8d of _0x1b6d9c){const _0x241cf0=detectModeFromSql(_0x1cb8d),_0x22a491=_0x1cb8d['dbId']?await getDbName(_0x999262[_0xb59bad(0x78)],Number(_0x1cb8d[_0xb59bad(0x9c)]))[_0xb59bad(0x81)](()=>undefined):undefined,_0x5760fc=buildLocalSqlFileContent({'sqlCode':_0x1cb8d['sqlCode'],'sqlName':_0x1cb8d[_0xb59bad(0x7f)],'dbId':_0x1cb8d['dbId']},ensureRemoteSqlContent(_0x1cb8d),{'dbName':_0x22a491,'mode':_0x241cf0,'syncedAt':new Date()['toISOString'](),'description':_0x1cb8d[_0xb59bad(0x99)]}),_0x55e512=resolveLocalSqlFilePath(_0x52172b,_0x1cb8d[_0xb59bad(0x79)],buildSqlLockEntry(_0x1cb8d,ensureRemoteSqlContent(_0x1cb8d),'',{'dbName':_0x22a491}));if(await fileExists(_0x55e512)){const _0x4fdf77=await readFile(_0x55e512,'utf8');if(!isEquivalentPulledSqlFile(_0x4fdf77,_0x5760fc,_0x241cf0)){_0x4ac9a1=!![];break;}}}if(_0x4ac9a1){const _0x3d1891=await confirmForceOverwrite('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.');if(!_0x3d1891)throw CliErrors[_0xb59bad(0x87)](_0xb59bad(0xa9));}}const _0xbc54e4=cloneSqlLockData(_0x24eb95),_0x346909=_0xbc54e4[_0xb59bad(0x76)][_0x52172b[_0xb59bad(0x78)]],_0x1a6394=[],_0x3aae3c=[];for(const _0xe0cf2 of _0x1b6d9c){const _0x4bdb3a=_0x346909['sqls'][_0xe0cf2[_0xb59bad(0x79)]],_0x49a883=ensureRemoteSqlContent(_0xe0cf2),_0x43be2f=detectModeFromSql(_0xe0cf2),_0x58629c=_0xe0cf2[_0xb59bad(0x9c)]?await getDbName(_0x999262['appCode'],Number(_0xe0cf2['dbId']))[_0xb59bad(0x81)](()=>undefined):undefined,_0x4912f1=buildLocalSqlFileContent({'sqlCode':_0xe0cf2['sqlCode'],'sqlName':_0xe0cf2[_0xb59bad(0x7f)],'dbId':_0xe0cf2[_0xb59bad(0x9c)]},_0x49a883,{'dbName':_0x58629c,'mode':_0x43be2f,'syncedAt':new Date()['toISOString'](),'description':_0xe0cf2[_0xb59bad(0x99)]}),_0x1e3483=buildSqlLockEntry(_0xe0cf2,_0x49a883,computeSqlContentHash(_0x4912f1),{'dbName':_0x58629c}),_0xc99d70=_0x1e3483[_0xb59bad(0x9e)],_0x39cc47=join(_0x52172b['sqlRootDir'],_0xc99d70);try{if(await fileExists(_0x39cc47)){const _0x24826d=await readFile(_0x39cc47,_0xb59bad(0x89));if(isEquivalentPulledSqlFile(_0x24826d,_0x4912f1,_0x43be2f)){_0x3aae3c['push']({'sqlCode':_0xe0cf2['sqlCode'],'reason':_0xb59bad(0x7d)}),_0x346909['sqls'][_0xe0cf2[_0xb59bad(0x79)]]={..._0x1e3483,'hash':computeSqlContentHash(_0x24826d),'path':_0xc99d70};continue;}if(!_0x8050){_0x3aae3c[_0xb59bad(0xab)]({'sqlCode':_0xe0cf2[_0xb59bad(0x79)],'reason':_0xb59bad(0x91)});continue;}}const _0xb537fc=_0x4bdb3a?.['path']?join(_0x52172b[_0xb59bad(0x83)],_0x4bdb3a[_0xb59bad(0x9e)]):undefined;_0xb537fc&&_0xb537fc!==_0x39cc47&&await fileExists(_0xb537fc)&&await rm(_0xb537fc,{'force':!![]}),await ensureParentDirectory(_0x39cc47),await writeFile(_0x39cc47,_0x4912f1,_0xb59bad(0x89)),_0x346909[_0xb59bad(0x9f)][_0xe0cf2[_0xb59bad(0x79)]]={..._0x1e3483,'path':_0xc99d70},_0x1a6394[_0xb59bad(0xab)]({'sqlCode':_0xe0cf2[_0xb59bad(0x79)],'filePath':_0x39cc47});}catch(_0x48a5ee){_0x35610a[_0xb59bad(0xab)]({'sqlCode':_0xe0cf2[_0xb59bad(0x79)],'error':_0x48a5ee instanceof Error?_0x48a5ee[_0xb59bad(0x9a)]:String(_0x48a5ee)});}}return _0x346909['lastSync']=new Date()[_0xb59bad(0x94)](),await writeSqlLockFile(_0x52172b[_0xb59bad(0x8a)],_0xbc54e4),{'ok':_0x35610a['length']===0x0,'data':{'pulled':_0x1a6394,'skipped':_0x3aae3c,'failed':_0x35610a},'message':_0xb59bad(0x8e)+_0x1a6394[_0xb59bad(0x97)]+_0xb59bad(0xb0)+_0x3aae3c['length']+'\x20skipped,\x20'+_0x35610a[_0xb59bad(0x97)]+_0xb59bad(0x82)};}};function detectModeFromSql(_0x374432){const _0x5d50f3=a189_0x3817b5,_0x133dfa=ensureRemoteSqlContent(_0x374432),_0x40f005=stripLocalSqlMetadata(_0x133dfa,_0x5d50f3(0xa2))[_0x5d50f3(0x7e)]();if(/^<(select|insert|update|delete)\b/i[_0x5d50f3(0xae)](_0x40f005))return _0x5d50f3(0xa2);return'sql';}function isEquivalentPulledSqlFile(_0x2cd888,_0x17b8af,_0x312604){return normalizePullComparableContent(_0x2cd888,_0x312604)===normalizePullComparableContent(_0x17b8af,_0x312604);}function normalizePullComparableContent(_0x4e2efe,_0x42b9ac){const _0x593523=a189_0x3817b5,_0x135a52=_0x4e2efe[_0x593523(0x98)](/\r\n/g,'\x0a')[_0x593523(0xa1)]('\x0a'),_0x34f281=_0x135a52[_0x593523(0x88)](_0x5554f3=>!isSyncedAtMetadataLine(_0x5554f3,_0x42b9ac));return _0x34f281[_0x593523(0xb1)]('\x0a');}function a189_0x2d14(_0x4ca641,_0xa5e0e2){_0x4ca641=_0x4ca641-0x76;const _0x536015=a189_0x5360();let _0x2d145e=_0x536015[_0x4ca641];return _0x2d145e;}function isSyncedAtMetadataLine(_0x43017e,_0x3a2e68){const _0xabf420=a189_0x3817b5;if(_0x3a2e68===_0xabf420(0xa2))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x43017e);return/^\s*--\s*@lovrabet\.syncedAt:/[_0xabf420(0xae)](_0x43017e);}
1
+ const a197_0x426c60=a197_0x8d1b;(function(_0x176ec8,_0x81b284){const _0x14d08d=a197_0x8d1b,_0x1d7e6c=_0x176ec8();while(!![]){try{const _0x597add=-parseInt(_0x14d08d(0x1e8))/0x1*(-parseInt(_0x14d08d(0x1c5))/0x2)+parseInt(_0x14d08d(0x1e2))/0x3*(parseInt(_0x14d08d(0x1d9))/0x4)+-parseInt(_0x14d08d(0x1cd))/0x5*(-parseInt(_0x14d08d(0x1b0))/0x6)+parseInt(_0x14d08d(0x1d1))/0x7+parseInt(_0x14d08d(0x1ae))/0x8*(parseInt(_0x14d08d(0x1bd))/0x9)+-parseInt(_0x14d08d(0x1c2))/0xa+parseInt(_0x14d08d(0x1e1))/0xb*(-parseInt(_0x14d08d(0x1b9))/0xc);if(_0x597add===_0x81b284)break;else _0x1d7e6c['push'](_0x1d7e6c['shift']());}catch(_0x22e9b0){_0x1d7e6c['push'](_0x1d7e6c['shift']());}}}(a197_0x5a81,0x459a5));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{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(_0x25e88c,_0x431816){const _0x2266e1=a197_0x8d1b,_0x11a7ea=[];let _0x295490=0x1;while(!![]){const _0x12227f=await listSqlQueries(_0x25e88c,{'currentPage':_0x295490,'pageSize':PAGE_SIZE,'sqlCode':_0x431816[_0x2266e1(0x1dd)],'sqlName':_0x431816[_0x2266e1(0x1de)]}),_0x132eae=_0x12227f[_0x2266e1(0x1c4)]??[];_0x11a7ea['push'](..._0x132eae);if(_0x132eae[_0x2266e1(0x1ad)]===0x0)break;const _0x44590b=_0x12227f['paging']?.[_0x2266e1(0x1be)];if(_0x44590b!=null?_0x11a7ea[_0x2266e1(0x1ad)]>=_0x44590b:_0x132eae[_0x2266e1(0x1ad)]<PAGE_SIZE)break;_0x295490++;}return _0x11a7ea;}async function ensureSqlContent(_0x5c31f7){const _0x80dd7e=a197_0x8d1b;if(_0x5c31f7['sqlContent']!=null&&String(_0x5c31f7[_0x80dd7e(0x1c6)])[_0x80dd7e(0x1ad)]>0x0)return _0x5c31f7;return getSqlQueryDetail(_0x5c31f7[_0x80dd7e(0x1dd)]);}export const sqlPull={'service':a197_0x426c60(0x1b1),'command':a197_0x426c60(0x1e9),'description':a197_0x426c60(0x1da),'risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a197_0x426c60(0x1ec),'type':a197_0x426c60(0x1b2),'description':a197_0x426c60(0x1d3)},{'name':a197_0x426c60(0x1cf),'type':a197_0x426c60(0x1ed),'description':a197_0x426c60(0x1d2)}],async 'dryRun'(_0x7544cf){const _0x48b495=a197_0x426c60,_0x3beec2=loadSqlProjectConfig(_0x7544cf[_0x48b495(0x1c0)]),_0x37b454=await readSqlLockFile(_0x3beec2['lockFilePath']),{appLock:_0x277602}=ensureSqlLockScope(_0x37b454??createEmptySqlLock(),_0x3beec2[_0x48b495(0x1c0)],_0x3beec2[_0x48b495(0x1b7)],_0x48b495(0x1e9)),_0x38d8de=await fetchAllSqlQueries(_0x7544cf[_0x48b495(0x1c0)],{'sqlCode':_0x7544cf[_0x48b495(0x1d5)]('sqlcode')||undefined,'sqlName':_0x7544cf[_0x48b495(0x1d5)](_0x48b495(0x1ec))||undefined}),_0x48be89=[];for(const _0x33b0ea of _0x38d8de){const _0x17d2bd=await ensureSqlContent(_0x33b0ea),_0xda0c41=ensureRemoteSqlContent(_0x17d2bd),_0x477ea9=detectModeFromSql(_0x17d2bd),_0x3e0672=_0x17d2bd[_0x48b495(0x1c7)]?await getDbName(_0x7544cf[_0x48b495(0x1c0)],Number(_0x17d2bd[_0x48b495(0x1c7)]))[_0x48b495(0x1e7)](()=>undefined):undefined,_0x1be82a=buildLocalSqlFileContent({'sqlCode':_0x17d2bd[_0x48b495(0x1dd)],'sqlName':_0x17d2bd['sqlName'],'dbId':_0x17d2bd[_0x48b495(0x1c7)]},_0xda0c41,{'dbName':_0x3e0672,'mode':_0x477ea9,'syncedAt':new Date()[_0x48b495(0x1b5)](),'description':_0x17d2bd['description']}),_0x1142b8=buildSqlLockEntry(_0x17d2bd,_0xda0c41,'',{'dbName':_0x3e0672}),_0xe9cb82=resolveLocalSqlFilePath(_0x3beec2,_0x17d2bd[_0x48b495(0x1dd)],_0x1142b8);let _0x401cf6=_0x48b495(0x1eb),_0x7b6761;if(await fileExists(_0xe9cb82)){const _0x249109=await readFile(_0xe9cb82,'utf8');isEquivalentPulledSqlFile(_0x249109,_0x1be82a,_0x477ea9)?(_0x401cf6=_0x48b495(0x1ca),_0x7b6761=_0x48b495(0x1cb)):(_0x401cf6=_0x48b495(0x1d6),_0x7b6761=_0x48b495(0x1ea));}_0x48be89[_0x48b495(0x1ac)]({'sqlCode':_0x17d2bd[_0x48b495(0x1dd)],'sqlName':_0x17d2bd['sqlName'],'filePath':_0xe9cb82,'status':_0x401cf6,'reason':_0x7b6761});}return{'method':_0x48b495(0x1e4),'url':'/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','body':{'appCode':_0x7544cf['appCode'],'sqlCode':_0x7544cf[_0x48b495(0x1d5)](_0x48b495(0x1bf))||null,'sqlName':_0x7544cf[_0x48b495(0x1d5)](_0x48b495(0x1ec))||null,'files':_0x48be89},'description':_0x48b495(0x1d4)+_0x48be89[_0x48b495(0x1ad)]+_0x48b495(0x1d0)+_0x3beec2[_0x48b495(0x1e6)]};},async 'execute'(_0x114dc5){const _0x562c70=a197_0x426c60,_0x304e58=loadSqlProjectConfig(_0x114dc5[_0x562c70(0x1c0)]),_0x21b8ce=await readSqlLockFile(_0x304e58[_0x562c70(0x1e3)]),{lockData:_0x4683e7,appLock:_0x3067d6}=ensureSqlLockScope(_0x21b8ce??createEmptySqlLock(),_0x304e58['appCode'],_0x304e58['sqlRoot'],_0x562c70(0x1e9)),_0x3aa001=_0x114dc5[_0x562c70(0x1ce)]('force'),_0x1e2e4=await fetchAllSqlQueries(_0x114dc5[_0x562c70(0x1c0)],{'sqlCode':_0x114dc5[_0x562c70(0x1d5)](_0x562c70(0x1bf))||undefined,'sqlName':_0x114dc5[_0x562c70(0x1d5)](_0x562c70(0x1ec))||undefined});if(_0x1e2e4[_0x562c70(0x1ad)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20SQL\x20queries\x20matched.'};const _0x1ed442=[],_0x41587a=[];for(const _0x3e4a4d of _0x1e2e4){try{_0x1ed442[_0x562c70(0x1ac)](await ensureSqlContent(_0x3e4a4d));}catch(_0x35891e){_0x41587a[_0x562c70(0x1ac)]({'sqlCode':_0x3e4a4d[_0x562c70(0x1dd)],'error':_0x35891e instanceof Error?_0x35891e['message']:String(_0x35891e)});}}if(_0x3aa001&&!_0x114dc5[_0x562c70(0x1ba)]){let _0xf3c2c=![];for(const _0x489084 of _0x1ed442){const _0x48d109=detectModeFromSql(_0x489084),_0x4e63ec=_0x489084[_0x562c70(0x1c7)]?await getDbName(_0x114dc5[_0x562c70(0x1c0)],Number(_0x489084['dbId']))[_0x562c70(0x1e7)](()=>undefined):undefined,_0x1ac98a=buildLocalSqlFileContent({'sqlCode':_0x489084[_0x562c70(0x1dd)],'sqlName':_0x489084[_0x562c70(0x1de)],'dbId':_0x489084[_0x562c70(0x1c7)]},ensureRemoteSqlContent(_0x489084),{'dbName':_0x4e63ec,'mode':_0x48d109,'syncedAt':new Date()[_0x562c70(0x1b5)](),'description':_0x489084['description']}),_0x212903=resolveLocalSqlFilePath(_0x304e58,_0x489084['sqlCode'],buildSqlLockEntry(_0x489084,ensureRemoteSqlContent(_0x489084),'',{'dbName':_0x4e63ec}));if(await fileExists(_0x212903)){const _0x58e039=await readFile(_0x212903,'utf8');if(!isEquivalentPulledSqlFile(_0x58e039,_0x1ac98a,_0x48d109)){_0xf3c2c=!![];break;}}}if(_0xf3c2c){const _0x4bd775=await confirmForceOverwrite(_0x562c70(0x1e0));if(!_0x4bd775)throw CliErrors['cancelled']('Force\x20pull\x20cancelled.');}}const _0x5b719a=cloneSqlLockData(_0x4683e7),_0x26de66=_0x5b719a[_0x562c70(0x1c9)][_0x304e58[_0x562c70(0x1c0)]],_0x4c9d19=[],_0x504a6e=[];for(const _0x565e4a of _0x1ed442){const _0x3479ad=_0x26de66[_0x562c70(0x1b4)][_0x565e4a[_0x562c70(0x1dd)]],_0x5502b0=ensureRemoteSqlContent(_0x565e4a),_0x3f44da=detectModeFromSql(_0x565e4a),_0x1ea73f=_0x565e4a['dbId']?await getDbName(_0x114dc5['appCode'],Number(_0x565e4a[_0x562c70(0x1c7)]))[_0x562c70(0x1e7)](()=>undefined):undefined,_0x1a6072=buildLocalSqlFileContent({'sqlCode':_0x565e4a['sqlCode'],'sqlName':_0x565e4a[_0x562c70(0x1de)],'dbId':_0x565e4a[_0x562c70(0x1c7)]},_0x5502b0,{'dbName':_0x1ea73f,'mode':_0x3f44da,'syncedAt':new Date()[_0x562c70(0x1b5)](),'description':_0x565e4a[_0x562c70(0x1dc)]}),_0x1dd297=buildSqlLockEntry(_0x565e4a,_0x5502b0,computeSqlContentHash(_0x1a6072),{'dbName':_0x1ea73f}),_0x170abd=_0x1dd297['path'],_0x7bc63b=join(_0x304e58['sqlRootDir'],_0x170abd);try{if(await fileExists(_0x7bc63b)){const _0x309608=await readFile(_0x7bc63b,_0x562c70(0x1d8));if(isEquivalentPulledSqlFile(_0x309608,_0x1a6072,_0x3f44da)){_0x504a6e[_0x562c70(0x1ac)]({'sqlCode':_0x565e4a[_0x562c70(0x1dd)],'reason':_0x562c70(0x1cb)}),_0x26de66[_0x562c70(0x1b4)][_0x565e4a['sqlCode']]={..._0x1dd297,'hash':computeSqlContentHash(_0x309608),'path':_0x170abd};continue;}if(!_0x3aa001){_0x504a6e['push']({'sqlCode':_0x565e4a['sqlCode'],'reason':_0x562c70(0x1b3)});continue;}}const _0x3d8876=_0x3479ad?.['path']?join(_0x304e58['sqlRootDir'],_0x3479ad[_0x562c70(0x1c3)]):undefined;_0x3d8876&&_0x3d8876!==_0x7bc63b&&await fileExists(_0x3d8876)&&await rm(_0x3d8876,{'force':!![]}),await ensureParentDirectory(_0x7bc63b),await writeFile(_0x7bc63b,_0x1a6072,_0x562c70(0x1d8)),_0x26de66[_0x562c70(0x1b4)][_0x565e4a[_0x562c70(0x1dd)]]={..._0x1dd297,'path':_0x170abd},_0x4c9d19[_0x562c70(0x1ac)]({'sqlCode':_0x565e4a[_0x562c70(0x1dd)],'filePath':_0x7bc63b});}catch(_0x314217){_0x41587a[_0x562c70(0x1ac)]({'sqlCode':_0x565e4a[_0x562c70(0x1dd)],'error':_0x314217 instanceof Error?_0x314217[_0x562c70(0x1bb)]:String(_0x314217)});}}return _0x26de66['lastSync']=new Date()[_0x562c70(0x1b5)](),await writeSqlLockFile(_0x304e58[_0x562c70(0x1e3)],_0x5b719a),{'ok':_0x41587a[_0x562c70(0x1ad)]===0x0,'data':{'pulled':_0x4c9d19,'skipped':_0x504a6e,'failed':_0x41587a},'message':_0x562c70(0x1c1)+_0x4c9d19[_0x562c70(0x1ad)]+_0x562c70(0x1df)+_0x504a6e[_0x562c70(0x1ad)]+_0x562c70(0x1b6)+_0x41587a[_0x562c70(0x1ad)]+_0x562c70(0x1af)};}};function detectModeFromSql(_0x1bfdd5){const _0x1f3504=a197_0x426c60,_0x351dc6=ensureRemoteSqlContent(_0x1bfdd5),_0x278fcb=stripLocalSqlMetadata(_0x351dc6,_0x1f3504(0x1bc))[_0x1f3504(0x1cc)]();if(/^<(select|insert|update|delete)\b/i[_0x1f3504(0x1c8)](_0x278fcb))return _0x1f3504(0x1bc);return _0x1f3504(0x1b1);}function isEquivalentPulledSqlFile(_0x338858,_0x23e883,_0x10ed32){return normalizePullComparableContent(_0x338858,_0x10ed32)===normalizePullComparableContent(_0x23e883,_0x10ed32);}function a197_0x8d1b(_0x171217,_0x338e94){_0x171217=_0x171217-0x1ac;const _0x5a8139=a197_0x5a81();let _0x8d1b22=_0x5a8139[_0x171217];return _0x8d1b22;}function a197_0x5a81(){const _0x293f6a=['trimStart','490125Ajpmur','bool','force','\x20SQL\x20file(s)\x20into\x20','3264149iYrjBq','Force\x20overwrite\x20local\x20unsynced\x20changes','Filter\x20by\x20SQL\x20display\x20name','Would\x20pull\x20','str','conflict','split','utf8','36jLEsJi','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','join','description','sqlCode','sqlName','\x20written,\x20','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','11ymAmLq','139581ooIzbt','lockFilePath','POST','replace','sqlRootDir','catch','43PTgMvA','pull','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','would_pull','name','boolean','push','length','808nfiSbv','\x20failed','18WJGTDB','sql','string','local\x20differs\x20from\x20remote','sqls','toISOString','\x20skipped,\x20','sqlRoot','filter','15049752vSbkzE','nonInteractive','message','mybatisXml','7578Nmwmpi','totalCount','sqlcode','appCode','Pull\x20complete:\x20','1450810rHupgE','path','tableData','19542DgDiVt','sqlContent','dbId','test','apps','skipped','unchanged'];a197_0x5a81=function(){return _0x293f6a;};return a197_0x5a81();}function normalizePullComparableContent(_0x49b6b0,_0x19b0d5){const _0x52e808=a197_0x426c60,_0x2aa26b=_0x49b6b0[_0x52e808(0x1e5)](/\r\n/g,'\x0a')[_0x52e808(0x1d7)]('\x0a'),_0x2c00e7=_0x2aa26b[_0x52e808(0x1b8)](_0x4123b3=>!isSyncedAtMetadataLine(_0x4123b3,_0x19b0d5));return _0x2c00e7[_0x52e808(0x1db)]('\x0a');}function isSyncedAtMetadataLine(_0x406a98,_0x39cb57){const _0x176c50=a197_0x426c60;if(_0x39cb57===_0x176c50(0x1bc))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x406a98);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x176c50(0x1c8)](_0x406a98);}
@@ -1 +1 @@
1
- const a190_0x3690d3=a190_0x1a79;(function(_0x3aa9bb,_0x100d16){const _0x29668d=a190_0x1a79,_0x4969f2=_0x3aa9bb();while(!![]){try{const _0x1d5a37=-parseInt(_0x29668d(0x97))/0x1+-parseInt(_0x29668d(0xb1))/0x2*(parseInt(_0x29668d(0xbb))/0x3)+-parseInt(_0x29668d(0xa7))/0x4+parseInt(_0x29668d(0x96))/0x5*(-parseInt(_0x29668d(0x90))/0x6)+parseInt(_0x29668d(0x9d))/0x7+parseInt(_0x29668d(0xa4))/0x8*(parseInt(_0x29668d(0x94))/0x9)+parseInt(_0x29668d(0x86))/0xa;if(_0x1d5a37===_0x100d16)break;else _0x4969f2['push'](_0x4969f2['shift']());}catch(_0x5e9da6){_0x4969f2['push'](_0x4969f2['shift']());}}}(a190_0x5dba,0x62101));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';function a190_0x1a79(_0x435128,_0x2bd0bc){_0x435128=_0x435128-0x79;const _0x5dba67=a190_0x5dba();let _0x1a7935=_0x5dba67[_0x435128];return _0x1a7935;}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';function a190_0x5dba(){const _0x4d8aa5=['get','743487IGgHII','catch','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','lastSync','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','appCode','str','message','unchanged','has','length','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','force','dbName','19208180gLOJAM','set','toISOString','trashDir','sql','sqlCode','sqls','replace','startsWith','sqlRoot','4347132fqvOaf','dbId','entries','Local\x20directory\x20\x22','38268TTYTvL','version','5qMPZnt','472214HaSQNs','path','boolean','hash','remoteId','No\x20database\x20matches\x20local\x20directory\x20\x22','1910895DhqScv','Push\x20local\x20SQL\x20files\x20to\x20remote','validation','sqlRootDir','join','sqlName','utf8','136DwhMgs','Push\x20complete:\x20','filter','688112smAUjO','map','dbDirectory','filePath','Would\x20push\x20','\x20failed','lockFilePath','isFinite','No\x20local\x20SQL\x20files\x20found.','Local\x20SQL\x20not\x20found:\x20','4fdLKDN','sqlConfig','push','relativePath','POST','mode','bool','high-risk-write','\x20skipped,\x20'];a190_0x5dba=function(){return _0x4d8aa5;};return a190_0x5dba();}async function getTargetSqlQueries(_0x3aee6f,_0x2319d0,_0x41ece2){const _0x15dec3=a190_0x1a79,_0x474a73=await scanLocalSqlQueries(_0x3aee6f),_0x7d56f8=new Map();for(const _0x45d59f of _0x474a73){if(_0x41ece2&&_0x45d59f[_0x15dec3(0x8b)]!==_0x41ece2)continue;const _0x9639ad=_0x7d56f8[_0x15dec3(0xba)](_0x45d59f['sqlCode'])??[];_0x9639ad[_0x15dec3(0xb3)](_0x45d59f),_0x7d56f8[_0x15dec3(0x87)](_0x45d59f['sqlCode'],_0x9639ad);}if(_0x41ece2&&!_0x7d56f8[_0x15dec3(0x81)](_0x41ece2))throw CliErrors[_0x15dec3(0x9f)](_0x15dec3(0xb0)+_0x41ece2);const _0x9bf974=[];for(const [_0x5c6b85,_0x1f4707]of _0x7d56f8[_0x15dec3(0x92)]()){if(_0x1f4707[_0x15dec3(0x82)]===0x1){_0x9bf974[_0x15dec3(0xb3)](_0x1f4707[0x0]);continue;}const _0x4c1a7e=_0x2319d0[_0x15dec3(0x8c)][_0x5c6b85],_0x43e473=_0x4c1a7e?.[_0x15dec3(0x98)],_0x4ae965=_0x43e473?_0x1f4707[_0x15dec3(0xa6)](_0x168d0d=>_0x168d0d[_0x15dec3(0xb4)]!==_0x43e473):_0x1f4707;if(_0x4c1a7e&&_0x4ae965[_0x15dec3(0x82)]===0x1){_0x9bf974['push'](_0x4ae965[0x0]);continue;}throw CliErrors[_0x15dec3(0x9f)](_0x15dec3(0x7c)+_0x5c6b85+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0x9bf974;}export const sqlPush={'service':a190_0x3690d3(0x8a),'command':a190_0x3690d3(0xb3),'description':a190_0x3690d3(0x9e),'risk':a190_0x3690d3(0xb8),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a190_0x3690d3(0x84),'type':a190_0x3690d3(0x99),'description':'Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'}],async 'dryRun'(_0x499b77){const _0x4ae603=a190_0x3690d3,_0x37cfe9=loadSqlProjectConfig(_0x499b77['appCode']),_0x4485e5=await readSqlLockFile(_0x37cfe9['lockFilePath']),{appLock:_0x1cdb73}=ensureSqlLockScope(_0x4485e5??createEmptySqlLock(),_0x499b77[_0x4ae603(0x7d)],_0x37cfe9[_0x4ae603(0x8f)],_0x4ae603(0xb3)),_0x5d7d84=await getTargetSqlQueries(_0x37cfe9,_0x1cdb73,_0x499b77[_0x4ae603(0x7e)]('sqlcode')||undefined),_0x2cb1e4=[];for(const _0x3d0a01 of _0x5d7d84){const _0x2e2d0a=await computeSqlFileHash(_0x3d0a01[_0x4ae603(0xaa)]),_0x3b5495=_0x1cdb73[_0x4ae603(0x8c)][_0x3d0a01[_0x4ae603(0x8b)]],_0x1047e5=!!_0x3b5495&&(_0x3b5495[_0x4ae603(0x98)]!==_0x3d0a01[_0x4ae603(0xb4)]||!!_0x3d0a01[_0x4ae603(0xa2)]&&_0x3b5495[_0x4ae603(0xa2)]!==_0x3d0a01[_0x4ae603(0xa2)]);if(!_0x499b77[_0x4ae603(0xb7)](_0x4ae603(0x84))&&_0x3b5495&&_0x3b5495[_0x4ae603(0x9a)]===_0x2e2d0a&&!_0x1047e5)continue;_0x2cb1e4[_0x4ae603(0xb3)](_0x3d0a01[_0x4ae603(0x8b)]);}return{'method':_0x4ae603(0xb5),'url':'/smartapi/custom/updateUserCustomSql','body':{'sqlCodes':_0x2cb1e4,'appCode':_0x499b77[_0x4ae603(0x7d)]},'description':_0x4ae603(0xab)+_0x2cb1e4[_0x4ae603(0x82)]+'\x20SQL\x20file(s)'};},async 'execute'(_0x28df56){const _0x598427=a190_0x3690d3,_0x3a7931=loadSqlProjectConfig(_0x28df56[_0x598427(0x7d)]),_0x377313=await readSqlLockFile(_0x3a7931[_0x598427(0xad)]),{lockData:_0xe9389e,appLock:_0x248ac0}=ensureSqlLockScope(_0x377313??createEmptySqlLock(),_0x28df56['appCode'],_0x3a7931[_0x598427(0x8f)],'push'),_0x5e63e9=await getTargetSqlQueries(_0x3a7931,_0x248ac0,_0x28df56[_0x598427(0x7e)]('sqlcode')||undefined);if(_0x5e63e9[_0x598427(0x82)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x598427(0xaf)};const _0x5b98c6=[],_0x2d963c=[],_0x47f8d8=[];for(const _0x128713 of _0x5e63e9){const _0x223eec=_0x248ac0[_0x598427(0x8c)][_0x128713[_0x598427(0x8b)]];if(!_0x223eec){_0x47f8d8[_0x598427(0xb3)]({'sqlCode':_0x128713[_0x598427(0x8b)],'error':_0x598427(0x7a)});continue;}try{const _0x441c51=await computeSqlFileHash(_0x128713[_0x598427(0xaa)]),_0x5d9a58=_0x223eec[_0x598427(0x98)]!==_0x128713[_0x598427(0xb4)]||!!_0x128713[_0x598427(0xa2)]&&_0x223eec[_0x598427(0xa2)]!==_0x128713['sqlName'];if(!_0x28df56[_0x598427(0xb7)](_0x598427(0x84))&&_0x223eec['hash']===_0x441c51&&!_0x5d9a58){_0x2d963c[_0x598427(0xb3)]({'sqlCode':_0x128713[_0x598427(0x8b)],'reason':_0x598427(0x80)});continue;}if(_0x223eec[_0x598427(0x95)]==null){_0x47f8d8[_0x598427(0xb3)]({'sqlCode':_0x128713[_0x598427(0x8b)],'error':_0x598427(0x83)});continue;}const _0x75dff4=await readFile(_0x128713['filePath'],_0x598427(0xa3)),_0x463816=stripLocalSqlMetadata(_0x75dff4,_0x128713[_0x598427(0xb6)]),_0x382db2=_0x128713['sqlName']||_0x223eec[_0x598427(0xa2)],_0x5c5f8d=await resolveTargetDbBinding(_0x28df56['appCode'],_0x128713,_0x223eec),_0x477509=await updateSqlQuery({'id':_0x223eec[_0x598427(0x9b)],'appCode':_0x28df56['appCode'],'sqlCode':_0x128713[_0x598427(0x8b)],'sqlName':_0x382db2,'dbId':_0x5c5f8d[_0x598427(0x91)],'version':_0x223eec[_0x598427(0x95)],'sqlContent':_0x463816,'sqlConfig':_0x223eec[_0x598427(0xb2)]??undefined}),_0x1e431a=_0x477509[_0x598427(0x91)]?await getDbName(_0x28df56['appCode'],Number(_0x477509[_0x598427(0x91)]))['catch'](()=>_0x5c5f8d[_0x598427(0x85)]):_0x5c5f8d['dbName'];_0x248ac0['sqls'][_0x128713[_0x598427(0x8b)]]={...buildSqlLockEntry(_0x477509,_0x463816,_0x441c51,{'dbName':_0x1e431a}),'path':_0x128713['relativePath'],'mode':_0x223eec['mode']},await archivePreviousSqlFileIfNeeded(_0x3a7931,_0x223eec[_0x598427(0x98)],_0x128713[_0x598427(0xb4)]),_0x5b98c6[_0x598427(0xb3)]({'sqlCode':_0x128713['sqlCode'],'remoteId':_0x223eec[_0x598427(0x9b)]});}catch(_0x26e3de){_0x47f8d8[_0x598427(0xb3)]({'sqlCode':_0x128713[_0x598427(0x8b)],'error':_0x26e3de instanceof Error?_0x26e3de[_0x598427(0x7f)]:String(_0x26e3de)});}}return _0x248ac0[_0x598427(0x7b)]=new Date()[_0x598427(0x88)](),await writeSqlLockFile(_0x3a7931['lockFilePath'],_0xe9389e),{'ok':_0x47f8d8[_0x598427(0x82)]===0x0,'data':{'pushed':_0x5b98c6,'skipped':_0x2d963c,'failed':_0x47f8d8},'message':_0x598427(0xa5)+_0x5b98c6['length']+'\x20pushed,\x20'+_0x2d963c[_0x598427(0x82)]+_0x598427(0xb9)+_0x47f8d8[_0x598427(0x82)]+_0x598427(0xac)};}};async function archivePreviousSqlFileIfNeeded(_0x9fcb30,_0x511bf6,_0x1a46c8){const _0x1687e1=a190_0x3690d3;if(!_0x511bf6||_0x511bf6===_0x1a46c8)return;const _0x49cb03=join(_0x9fcb30[_0x1687e1(0xa0)],_0x511bf6);if(!await fileExists(_0x49cb03))return;const _0x3a4d9e=await moveToTrash(_0x9fcb30['projectRoot'],_0x9fcb30[_0x1687e1(0x89)],_0x49cb03);await cleanupEmptyDirectories(dirname(_0x49cb03),_0x9fcb30['sqlRootDir']),void _0x3a4d9e;}async function moveToTrash(_0x57cafa,_0x57b50e,_0x2db67e){const _0xff9fc5=a190_0x3690d3,_0x314905=new Date()[_0xff9fc5(0x88)]()[_0xff9fc5(0x8d)](/[:.]/g,'-'),_0x1d285a=relative(_0x57cafa,_0x2db67e),_0x4d3afc=join(_0x57b50e,_0x314905,_0x1d285a);return await mkdir(dirname(_0x4d3afc),{'recursive':!![]}),await rename(_0x2db67e,_0x4d3afc),_0x4d3afc;}async function cleanupEmptyDirectories(_0x1b0a09,_0x5bdc36){const _0x1e9c91=a190_0x3690d3;let _0x67194=resolve(_0x1b0a09);const _0x28588b=resolve(_0x5bdc36);while(_0x67194[_0x1e9c91(0x8e)](''+_0x28588b+sep)||_0x67194===_0x28588b){if(_0x67194===_0x28588b)return;try{const _0x42e6c5=await readdir(_0x67194);if(_0x42e6c5['length']>0x0)return;await rmdir(_0x67194);}catch{return;}_0x67194=dirname(_0x67194);}}async function resolveTargetDbBinding(_0x8c3d03,_0x19eb65,_0xb5170e){const _0x586396=a190_0x3690d3,_0x90a812=_0x19eb65[_0x586396(0xa9)];if(!_0x90a812)return{'dbId':_0xb5170e[_0x586396(0x91)],'dbName':_0xb5170e[_0x586396(0x85)]};const _0x4c7d99=buildDbDirectoryName(_0xb5170e[_0x586396(0x85)],_0xb5170e[_0x586396(0x91)]);if(_0x90a812===_0x4c7d99)return{'dbId':_0xb5170e[_0x586396(0x91)],'dbName':_0xb5170e['dbName']};const _0x271159=parseExplicitDbDirectory(_0x90a812);if(_0x271159!=null)return{'dbId':_0x271159,'dbName':await getDbName(_0x8c3d03,_0x271159)[_0x586396(0x79)](()=>undefined)};const _0xb52d94=await listDatabases(_0x8c3d03),_0x2193f1=_0xb52d94['filter'](_0x235b46=>buildDbDirectoryName(_0x235b46[_0x586396(0x85)],_0x235b46[_0x586396(0x91)])===_0x90a812);if(_0x2193f1['length']===0x1)return{'dbId':_0x2193f1[0x0][_0x586396(0x91)],'dbName':_0x2193f1[0x0][_0x586396(0x85)]};if(_0x2193f1[_0x586396(0x82)]===0x0)throw CliErrors[_0x586396(0x9f)](_0x586396(0x9c)+_0x90a812+'\x22\x20for\x20sqlCode\x20'+_0x19eb65['sqlCode']+'.');const _0x3a1f1c=_0x2193f1[_0x586396(0xa8)](_0x32ba66=>_0x32ba66[_0x586396(0x85)]+'\x20('+_0x32ba66[_0x586396(0x91)]+')')[_0x586396(0xa1)](',\x20');throw CliErrors['validation'](_0x586396(0x93)+_0x90a812+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x19eb65[_0x586396(0x8b)]+':\x20'+_0x3a1f1c);}function parseExplicitDbDirectory(_0x4c56d2){const _0x3d13cd=a190_0x3690d3,_0x30bec4=/^db-(\d+)$/['exec'](_0x4c56d2);if(!_0x30bec4)return null;const _0x3a13e0=Number(_0x30bec4[0x1]);return Number[_0x3d13cd(0xae)](_0x3a13e0)&&_0x3a13e0>0x0?_0x3a13e0:null;}
1
+ const a198_0x8130a9=a198_0x3f84;(function(_0x279125,_0x534fe8){const _0x2d16b4=a198_0x3f84,_0xc42f47=_0x279125();while(!![]){try{const _0x576a36=parseInt(_0x2d16b4(0x138))/0x1+parseInt(_0x2d16b4(0x136))/0x2*(parseInt(_0x2d16b4(0x135))/0x3)+parseInt(_0x2d16b4(0x168))/0x4+-parseInt(_0x2d16b4(0x164))/0x5*(-parseInt(_0x2d16b4(0x137))/0x6)+parseInt(_0x2d16b4(0x142))/0x7+parseInt(_0x2d16b4(0x157))/0x8*(-parseInt(_0x2d16b4(0x172))/0x9)+parseInt(_0x2d16b4(0x167))/0xa*(-parseInt(_0x2d16b4(0x14c))/0xb);if(_0x576a36===_0x534fe8)break;else _0xc42f47['push'](_0xc42f47['shift']());}catch(_0x55787c){_0xc42f47['push'](_0xc42f47['shift']());}}}(a198_0x4df4,0x7228c));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';function a198_0x4df4(){const _0x240c2d=['trashDir','9375872kDThrj','Local\x20SQL\x20not\x20found:\x20','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','length','Push\x20complete:\x20','sqlRoot','Local\x20directory\x20\x22','bool','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','get','\x20skipped,\x20','236744DufNoo','sqls','force','dbDirectory','No\x20local\x20SQL\x20files\x20found.','filter','push','sqlCode','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','sqlRootDir','replace','dbId','Push\x20local\x20SQL\x20files\x20to\x20remote','4260035NCGcnG','toISOString','mode','30wLyvnB','2435980Lqnpmr','appCode','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','sql','sqlName','lockFilePath','write','catch','\x20failed','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','27eYsrSn','map','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','set','exec','message','entries','relativePath','filePath','1611717NRPVyM','2byEsLA','6hyMqDk','684441yDaScK','\x20pushed,\x20','hash','sqlcode','remoteId','validation','/smartapi/custom/updateUserCustomSql','join','\x20SQL\x20file(s)','path','3015243axJLCM','boolean','utf8','POST','Would\x20push\x20','dbName','No\x20database\x20matches\x20local\x20directory\x20\x22','startsWith','lastSync'];a198_0x4df4=function(){return _0x240c2d;};return a198_0x4df4();}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';function a198_0x3f84(_0x1c3eb0,_0x3b285a){_0x1c3eb0=_0x1c3eb0-0x135;const _0x4df429=a198_0x4df4();let _0x3f8453=_0x4df429[_0x1c3eb0];return _0x3f8453;}import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x234fe2,_0x5ae8cb,_0x41e129){const _0x1377fe=a198_0x3f84,_0x21a57a=await scanLocalSqlQueries(_0x234fe2),_0x56a61e=new Map();for(const _0x135516 of _0x21a57a){if(_0x41e129&&_0x135516[_0x1377fe(0x15e)]!==_0x41e129)continue;const _0xab4030=_0x56a61e[_0x1377fe(0x155)](_0x135516['sqlCode'])??[];_0xab4030['push'](_0x135516),_0x56a61e[_0x1377fe(0x175)](_0x135516[_0x1377fe(0x15e)],_0xab4030);}if(_0x41e129&&!_0x56a61e['has'](_0x41e129))throw CliErrors[_0x1377fe(0x13d)](_0x1377fe(0x14d)+_0x41e129);const _0x3eb7ef=[];for(const [_0x1b552f,_0xf0a761]of _0x56a61e[_0x1377fe(0x178)]()){if(_0xf0a761[_0x1377fe(0x14f)]===0x1){_0x3eb7ef[_0x1377fe(0x15d)](_0xf0a761[0x0]);continue;}const _0x383bf1=_0x5ae8cb[_0x1377fe(0x158)][_0x1b552f],_0x2483a8=_0x383bf1?.[_0x1377fe(0x141)],_0x8f0848=_0x2483a8?_0xf0a761['filter'](_0x2133d8=>_0x2133d8[_0x1377fe(0x179)]!==_0x2483a8):_0xf0a761;if(_0x383bf1&&_0x8f0848['length']===0x1){_0x3eb7ef[_0x1377fe(0x15d)](_0x8f0848[0x0]);continue;}throw CliErrors[_0x1377fe(0x13d)](_0x1377fe(0x14e)+_0x1b552f+_0x1377fe(0x15f));}return _0x3eb7ef;}export const sqlPush={'service':a198_0x8130a9(0x16b),'command':'push','description':a198_0x8130a9(0x163),'risk':a198_0x8130a9(0x16e),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a198_0x8130a9(0x159),'type':a198_0x8130a9(0x143),'description':a198_0x8130a9(0x174)}],async 'dryRun'(_0x3491f1){const _0x404db9=a198_0x8130a9,_0x23b065=loadSqlProjectConfig(_0x3491f1[_0x404db9(0x169)]),_0x296622=await readSqlLockFile(_0x23b065[_0x404db9(0x16d)]),{appLock:_0x81ca33}=ensureSqlLockScope(_0x296622??createEmptySqlLock(),_0x3491f1[_0x404db9(0x169)],_0x23b065['sqlRoot'],'push'),_0x4bd504=await getTargetSqlQueries(_0x23b065,_0x81ca33,_0x3491f1['str'](_0x404db9(0x13b))||undefined),_0xc1259=[];for(const _0x2c22a7 of _0x4bd504){const _0x268156=await computeSqlFileHash(_0x2c22a7[_0x404db9(0x17a)]),_0x2c65b9=_0x81ca33['sqls'][_0x2c22a7[_0x404db9(0x15e)]],_0x3f9272=!!_0x2c65b9&&(_0x2c65b9[_0x404db9(0x141)]!==_0x2c22a7[_0x404db9(0x179)]||!!_0x2c22a7[_0x404db9(0x16c)]&&_0x2c65b9[_0x404db9(0x16c)]!==_0x2c22a7[_0x404db9(0x16c)]);if(!_0x3491f1[_0x404db9(0x153)](_0x404db9(0x159))&&_0x2c65b9&&_0x2c65b9['hash']===_0x268156&&!_0x3f9272)continue;_0xc1259[_0x404db9(0x15d)](_0x2c22a7[_0x404db9(0x15e)]);}return{'method':_0x404db9(0x145),'url':_0x404db9(0x13e),'body':{'sqlCodes':_0xc1259,'appCode':_0x3491f1[_0x404db9(0x169)]},'description':_0x404db9(0x146)+_0xc1259['length']+_0x404db9(0x140)};},async 'execute'(_0xa07ee5){const _0x1d9240=a198_0x8130a9,_0x52837a=loadSqlProjectConfig(_0xa07ee5['appCode']),_0x364539=await readSqlLockFile(_0x52837a[_0x1d9240(0x16d)]),{lockData:_0x4b978b,appLock:_0x29fe57}=ensureSqlLockScope(_0x364539??createEmptySqlLock(),_0xa07ee5[_0x1d9240(0x169)],_0x52837a[_0x1d9240(0x151)],_0x1d9240(0x15d)),_0x174d95=await getTargetSqlQueries(_0x52837a,_0x29fe57,_0xa07ee5['str']('sqlcode')||undefined);if(_0x174d95[_0x1d9240(0x14f)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x1d9240(0x15b)};const _0x1bdfb4=[],_0x3316fa=[],_0x510da0=[];for(const _0x28b734 of _0x174d95){const _0x5d87e3=_0x29fe57[_0x1d9240(0x158)][_0x28b734['sqlCode']];if(!_0x5d87e3){_0x510da0[_0x1d9240(0x15d)]({'sqlCode':_0x28b734[_0x1d9240(0x15e)],'error':_0x1d9240(0x154)});continue;}try{const _0x12c83e=await computeSqlFileHash(_0x28b734[_0x1d9240(0x17a)]),_0x1490f9=_0x5d87e3['path']!==_0x28b734[_0x1d9240(0x179)]||!!_0x28b734[_0x1d9240(0x16c)]&&_0x5d87e3['sqlName']!==_0x28b734['sqlName'];if(!_0xa07ee5[_0x1d9240(0x153)](_0x1d9240(0x159))&&_0x5d87e3[_0x1d9240(0x13a)]===_0x12c83e&&!_0x1490f9){_0x3316fa[_0x1d9240(0x15d)]({'sqlCode':_0x28b734[_0x1d9240(0x15e)],'reason':'unchanged'});continue;}if(_0x5d87e3['version']==null){_0x510da0[_0x1d9240(0x15d)]({'sqlCode':_0x28b734[_0x1d9240(0x15e)],'error':_0x1d9240(0x16a)});continue;}const _0x265b42=await readFile(_0x28b734[_0x1d9240(0x17a)],_0x1d9240(0x144)),_0x52f0cd=stripLocalSqlMetadata(_0x265b42,_0x28b734[_0x1d9240(0x166)]),_0x240165=_0x28b734[_0x1d9240(0x16c)]||_0x5d87e3[_0x1d9240(0x16c)],_0x36ee64=await resolveTargetDbBinding(_0xa07ee5[_0x1d9240(0x169)],_0x28b734,_0x5d87e3),_0xe157e5=await updateSqlQuery({'id':_0x5d87e3[_0x1d9240(0x13c)],'appCode':_0xa07ee5[_0x1d9240(0x169)],'sqlCode':_0x28b734[_0x1d9240(0x15e)],'sqlName':_0x240165,'dbId':_0x36ee64[_0x1d9240(0x162)],'version':_0x5d87e3['version'],'sqlContent':_0x52f0cd,'sqlConfig':_0x5d87e3['sqlConfig']??undefined}),_0x38b54b=_0xe157e5[_0x1d9240(0x162)]?await getDbName(_0xa07ee5[_0x1d9240(0x169)],Number(_0xe157e5[_0x1d9240(0x162)]))[_0x1d9240(0x16f)](()=>_0x36ee64[_0x1d9240(0x147)]):_0x36ee64[_0x1d9240(0x147)];_0x29fe57[_0x1d9240(0x158)][_0x28b734['sqlCode']]={...buildSqlLockEntry(_0xe157e5,_0x52f0cd,_0x12c83e,{'dbName':_0x38b54b}),'path':_0x28b734[_0x1d9240(0x179)],'mode':_0x5d87e3[_0x1d9240(0x166)]},await archivePreviousSqlFileIfNeeded(_0x52837a,_0x5d87e3[_0x1d9240(0x141)],_0x28b734[_0x1d9240(0x179)]),_0x1bdfb4['push']({'sqlCode':_0x28b734[_0x1d9240(0x15e)],'remoteId':_0x5d87e3[_0x1d9240(0x13c)]});}catch(_0x24b2e6){_0x510da0[_0x1d9240(0x15d)]({'sqlCode':_0x28b734[_0x1d9240(0x15e)],'error':_0x24b2e6 instanceof Error?_0x24b2e6[_0x1d9240(0x177)]:String(_0x24b2e6)});}}return _0x29fe57[_0x1d9240(0x14a)]=new Date()['toISOString'](),await writeSqlLockFile(_0x52837a[_0x1d9240(0x16d)],_0x4b978b),{'ok':_0x510da0[_0x1d9240(0x14f)]===0x0,'data':{'pushed':_0x1bdfb4,'skipped':_0x3316fa,'failed':_0x510da0},'message':_0x1d9240(0x150)+_0x1bdfb4[_0x1d9240(0x14f)]+_0x1d9240(0x139)+_0x3316fa[_0x1d9240(0x14f)]+_0x1d9240(0x156)+_0x510da0[_0x1d9240(0x14f)]+_0x1d9240(0x170)};}};async function archivePreviousSqlFileIfNeeded(_0x48c3ab,_0x1a6df2,_0x4de8f0){const _0x3cd742=a198_0x8130a9;if(!_0x1a6df2||_0x1a6df2===_0x4de8f0)return;const _0x238a03=join(_0x48c3ab['sqlRootDir'],_0x1a6df2);if(!await fileExists(_0x238a03))return;const _0x2606e3=await moveToTrash(_0x48c3ab['projectRoot'],_0x48c3ab[_0x3cd742(0x14b)],_0x238a03);await cleanupEmptyDirectories(dirname(_0x238a03),_0x48c3ab[_0x3cd742(0x160)]),void _0x2606e3;}async function moveToTrash(_0x4f19cb,_0x7c6537,_0x1b09a3){const _0x1dce91=a198_0x8130a9,_0xfa336b=new Date()[_0x1dce91(0x165)]()[_0x1dce91(0x161)](/[:.]/g,'-'),_0xef8a6f=relative(_0x4f19cb,_0x1b09a3),_0x3b3716=join(_0x7c6537,_0xfa336b,_0xef8a6f);return await mkdir(dirname(_0x3b3716),{'recursive':!![]}),await rename(_0x1b09a3,_0x3b3716),_0x3b3716;}async function cleanupEmptyDirectories(_0x81ce22,_0x4be9cc){const _0x446418=a198_0x8130a9;let _0x411427=resolve(_0x81ce22);const _0x5da06c=resolve(_0x4be9cc);while(_0x411427[_0x446418(0x149)](''+_0x5da06c+sep)||_0x411427===_0x5da06c){if(_0x411427===_0x5da06c)return;try{const _0x12ed32=await readdir(_0x411427);if(_0x12ed32['length']>0x0)return;await rmdir(_0x411427);}catch{return;}_0x411427=dirname(_0x411427);}}async function resolveTargetDbBinding(_0x365d35,_0x29c742,_0x23c93){const _0x35e841=a198_0x8130a9,_0x552e79=_0x29c742[_0x35e841(0x15a)];if(!_0x552e79)return{'dbId':_0x23c93[_0x35e841(0x162)],'dbName':_0x23c93[_0x35e841(0x147)]};const _0x32a2ae=buildDbDirectoryName(_0x23c93[_0x35e841(0x147)],_0x23c93['dbId']);if(_0x552e79===_0x32a2ae)return{'dbId':_0x23c93[_0x35e841(0x162)],'dbName':_0x23c93[_0x35e841(0x147)]};const _0xc5b942=parseExplicitDbDirectory(_0x552e79);if(_0xc5b942!=null)return{'dbId':_0xc5b942,'dbName':await getDbName(_0x365d35,_0xc5b942)[_0x35e841(0x16f)](()=>undefined)};const _0x502a15=await listDatabases(_0x365d35),_0x41e836=_0x502a15[_0x35e841(0x15c)](_0xbdcddb=>buildDbDirectoryName(_0xbdcddb['dbName'],_0xbdcddb['dbId'])===_0x552e79);if(_0x41e836[_0x35e841(0x14f)]===0x1)return{'dbId':_0x41e836[0x0][_0x35e841(0x162)],'dbName':_0x41e836[0x0][_0x35e841(0x147)]};if(_0x41e836[_0x35e841(0x14f)]===0x0)throw CliErrors[_0x35e841(0x13d)](_0x35e841(0x148)+_0x552e79+'\x22\x20for\x20sqlCode\x20'+_0x29c742[_0x35e841(0x15e)]+'.');const _0x3cc6c7=_0x41e836[_0x35e841(0x173)](_0x5c6a06=>_0x5c6a06[_0x35e841(0x147)]+'\x20('+_0x5c6a06[_0x35e841(0x162)]+')')[_0x35e841(0x13f)](',\x20');throw CliErrors[_0x35e841(0x13d)](_0x35e841(0x152)+_0x552e79+_0x35e841(0x171)+_0x29c742[_0x35e841(0x15e)]+':\x20'+_0x3cc6c7);}function parseExplicitDbDirectory(_0x4c4bdf){const _0x2cdfb6=a198_0x8130a9,_0x36f317=/^db-(\d+)$/[_0x2cdfb6(0x176)](_0x4c4bdf);if(!_0x36f317)return null;const _0x1e56ff=Number(_0x36f317[0x1]);return Number['isFinite'](_0x1e56ff)&&_0x1e56ff>0x0?_0x1e56ff:null;}
@@ -1 +1 @@
1
- const a191_0x47a8bf=a191_0x46a7;(function(_0x4e350c,_0x249e3f){const _0x30495e=a191_0x46a7,_0xd791c1=_0x4e350c();while(!![]){try{const _0x20d4ce=parseInt(_0x30495e(0x1c7))/0x1+-parseInt(_0x30495e(0x1c2))/0x2*(-parseInt(_0x30495e(0x1b8))/0x3)+parseInt(_0x30495e(0x1b1))/0x4*(parseInt(_0x30495e(0x1d5))/0x5)+parseInt(_0x30495e(0x1ca))/0x6+-parseInt(_0x30495e(0x1ce))/0x7+parseInt(_0x30495e(0x1bb))/0x8+-parseInt(_0x30495e(0x1c3))/0x9;if(_0x20d4ce===_0x249e3f)break;else _0xd791c1['push'](_0xd791c1['shift']());}catch(_0x2b53e4){_0xd791c1['push'](_0xd791c1['shift']());}}}(a191_0x270b,0x47f77));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=a191_0x47a8bf(0x1b7);function a191_0x270b(){const _0x23d32e=['sqlName','stdin','stderr','length','path','19828jURCOj','trim','mode','dbId','close','apps','.rabetbase/sql','6222sNwUTt','trimStart','mybatisXml','3028192MbHrcI','sqlRoot','sqlCode','lastSync','fromEntries','description','split','22XNyNcA','3221046QHUlvV','dbName','<!--\x20@lovrabet.','join','232252tbCUab','filter','endsWith','758340PeiRIz','\x20[y/N]\x20','sqlContent','map','3839388yIpFcd','--\x20@lovrabet.','\x20-->','toLowerCase','syncedAt','sqlConfig','version','445DLZuhu'];a191_0x270b=function(){return _0x23d32e;};return a191_0x270b();}export function buildSqlLockEntry(_0x4c3c36,_0x44bea7,_0x460da2,_0x13cbab){const _0x215f98=a191_0x47a8bf,_0x48c55b=detectSqlMode(_0x44bea7);return{'path':buildSqlRelativePath(_0x4c3c36[_0x215f98(0x1bd)],_0x4c3c36[_0x215f98(0x1ac)],_0x13cbab?.[_0x215f98(0x1c4)],_0x48c55b,_0x4c3c36[_0x215f98(0x1b4)]),'hash':_0x460da2,'remoteId':_0x4c3c36['id'],'version':_0x4c3c36[_0x215f98(0x1d4)],'dbId':Number(_0x4c3c36[_0x215f98(0x1b4)]),'dbName':_0x13cbab?.[_0x215f98(0x1c4)],'sqlName':_0x4c3c36[_0x215f98(0x1ac)],'sqlConfig':_0x4c3c36[_0x215f98(0x1d3)]??undefined,'mode':_0x48c55b};}export function cloneSqlLockData(_0x4ded65){const _0x2acd0d=a191_0x47a8bf;return{'apps':Object[_0x2acd0d(0x1bf)](Object['entries'](_0x4ded65[_0x2acd0d(0x1b6)])['map'](([_0x33c85a,_0x9d8519])=>[_0x33c85a,{'sqlRoot':_0x9d8519[_0x2acd0d(0x1bc)],'lastSync':_0x9d8519[_0x2acd0d(0x1be)],'sqls':{..._0x9d8519['sqls']}}]))};}export function ensureRemoteSqlContent(_0x1ed33e){const _0x4fa387=a191_0x47a8bf;return _0x1ed33e[_0x4fa387(0x1cc)]??'';}export function buildLocalSqlFileContent(_0x395069,_0x13af12,_0x30b352){const _0x4522ab=a191_0x47a8bf,_0x317b9b=_0x30b352?.[_0x4522ab(0x1b3)]??detectSqlMode(_0x13af12),_0x6f79e1=stripLocalSqlMetadata(_0x13af12,_0x317b9b)[_0x4522ab(0x1b2)](),_0x5f132d=[...buildMetadataHeaderLines({'sqlCode':_0x395069[_0x4522ab(0x1bd)],'sqlName':_0x395069[_0x4522ab(0x1ac)],'dbId':_0x395069[_0x4522ab(0x1b4)],'dbName':_0x30b352?.[_0x4522ab(0x1c4)],'mode':_0x317b9b,'syncedAt':_0x30b352?.[_0x4522ab(0x1d2)],'description':_0x30b352?.['description']},_0x317b9b),'',_0x6f79e1],_0x23875f=_0x5f132d['join']('\x0a');return _0x23875f[_0x4522ab(0x1c9)]('\x0a')?_0x23875f:_0x23875f+'\x0a';}export function stripLocalSqlMetadata(_0x37c671,_0x53c4ee){const _0x33854f=a191_0x47a8bf,_0x1d0ace=_0x37c671['replace'](/\r\n/g,'\x0a')[_0x33854f(0x1c1)]('\x0a'),_0x53abef=[];let _0x2c6fc9=0x0;if(_0x53c4ee==='mybatisXml')while(_0x2c6fc9<_0x1d0ace[_0x33854f(0x1af)]){const _0x4dd2ed=_0x1d0ace[_0x2c6fc9]??'';if(/^\s*<!--\s*@lovrabet\./['test'](_0x4dd2ed)){_0x2c6fc9++;continue;}if(_0x4dd2ed['trim']()===''&&_0x2c6fc9>0x0){_0x2c6fc9++;continue;}break;}else while(_0x2c6fc9<_0x1d0ace[_0x33854f(0x1af)]){const _0x2a1fcd=_0x1d0ace[_0x2c6fc9]??'';if(/^\s*--\s*@lovrabet\./['test'](_0x2a1fcd)){_0x2c6fc9++;continue;}if(_0x2a1fcd[_0x33854f(0x1b2)]()===''&&_0x2c6fc9>0x0){_0x2c6fc9++;continue;}break;}for(;_0x2c6fc9<_0x1d0ace['length'];_0x2c6fc9++){_0x53abef['push'](_0x1d0ace[_0x2c6fc9]);}return _0x53abef[_0x33854f(0x1c6)]('\x0a')[_0x33854f(0x1b9)]();}export function resolveSqlMode(_0x344658,_0x7187dc){const _0x18e275=a191_0x47a8bf;if(_0x7187dc?.[_0x18e275(0x1b3)])return _0x7187dc['mode'];return detectSqlMode(_0x344658);}export function resolveSqlFileName(_0x3ebbf6,_0x4e6a3b,_0x34a72d){const _0x55ceb3=a191_0x47a8bf;if(_0x34a72d?.[_0x55ceb3(0x1b0)])return _0x34a72d['path'];if(_0x34a72d?.['sqlName']||_0x34a72d?.['dbName'])return buildSqlRelativePath(_0x3ebbf6,_0x34a72d?.['sqlName'],_0x34a72d?.[_0x55ceb3(0x1c4)],resolveSqlMode(_0x4e6a3b,_0x34a72d),_0x34a72d?.[_0x55ceb3(0x1b4)]);return buildDefaultSqlFileName(_0x3ebbf6,resolveSqlMode(_0x4e6a3b,_0x34a72d));}export function resolveSqlLocalDir(_0x240b70,_0x548f9c){return join(_0x240b70,SQL_LOCAL_REL_DIR,_0x548f9c);}function a191_0x46a7(_0x47922d,_0x4cbdea){_0x47922d=_0x47922d-0x1ac;const _0x270b10=a191_0x270b();let _0x46a744=_0x270b10[_0x47922d];return _0x46a744;}export async function confirmForceOverwrite(_0x252fec){const _0x2e14cb=a191_0x47a8bf,_0x435ad3=createInterface({'input':process[_0x2e14cb(0x1ad)],'output':process[_0x2e14cb(0x1ae)]}),_0x441898=await new Promise(_0x56a9fd=>{const _0x2d4064=_0x2e14cb;_0x435ad3['question'](_0x252fec+_0x2d4064(0x1cb),_0x56a9fd);});return _0x435ad3[_0x2e14cb(0x1b5)](),['y','yes']['includes'](_0x441898[_0x2e14cb(0x1b2)]()[_0x2e14cb(0x1d1)]());}export function findSqlLockScope(_0x221a09,_0x1f50a0){const _0x16af0a=a191_0x47a8bf;return _0x221a09[_0x16af0a(0x1b6)][_0x1f50a0];}function buildMetadataHeaderLines(_0x35c015,_0x51dc82){const _0x2c43c6=a191_0x47a8bf,_0x375b65=[[_0x2c43c6(0x1bd),_0x35c015[_0x2c43c6(0x1bd)]],[_0x2c43c6(0x1ac),_0x35c015['sqlName']],[_0x2c43c6(0x1b4),_0x35c015[_0x2c43c6(0x1b4)]],[_0x2c43c6(0x1c4),_0x35c015[_0x2c43c6(0x1c4)]],['mode',_0x35c015[_0x2c43c6(0x1b3)]],[_0x2c43c6(0x1d2),_0x35c015[_0x2c43c6(0x1d2)]],['description',_0x35c015[_0x2c43c6(0x1c0)]]];if(_0x51dc82===_0x2c43c6(0x1ba))return _0x375b65[_0x2c43c6(0x1c8)](([,_0x4b9c77])=>_0x4b9c77!==undefined&&_0x4b9c77!==null&&String(_0x4b9c77)[_0x2c43c6(0x1b2)]()!=='')[_0x2c43c6(0x1cd)](([_0x10564a,_0x12d74c])=>_0x2c43c6(0x1c5)+_0x10564a+':\x20'+String(_0x12d74c)+_0x2c43c6(0x1d0));return _0x375b65[_0x2c43c6(0x1c8)](([,_0x2cea0d])=>_0x2cea0d!==undefined&&_0x2cea0d!==null&&String(_0x2cea0d)['trim']()!=='')[_0x2c43c6(0x1cd)](([_0x146169,_0x4a062d])=>_0x2c43c6(0x1cf)+_0x146169+':\x20'+String(_0x4a062d));}
1
+ const a199_0x7931c3=a199_0x4dd0;(function(_0x2c8131,_0x9391d9){const _0x4a8329=a199_0x4dd0,_0x362648=_0x2c8131();while(!![]){try{const _0x28c735=parseInt(_0x4a8329(0x115))/0x1*(parseInt(_0x4a8329(0x128))/0x2)+-parseInt(_0x4a8329(0x11e))/0x3*(parseInt(_0x4a8329(0x108))/0x4)+-parseInt(_0x4a8329(0x123))/0x5*(-parseInt(_0x4a8329(0x105))/0x6)+parseInt(_0x4a8329(0x118))/0x7*(-parseInt(_0x4a8329(0x110))/0x8)+-parseInt(_0x4a8329(0x111))/0x9*(-parseInt(_0x4a8329(0x11d))/0xa)+parseInt(_0x4a8329(0x122))/0xb+parseInt(_0x4a8329(0x126))/0xc*(-parseInt(_0x4a8329(0x109))/0xd);if(_0x28c735===_0x9391d9)break;else _0x362648['push'](_0x362648['shift']());}catch(_0x554f7a){_0x362648['push'](_0x362648['shift']());}}}(a199_0x468a,0x20f24));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';function a199_0x468a(){const _0x46ccc4=['70OvTCvm','sqlCode','close','.rabetbase/sql','\x20[y/N]\x20','20AqQKlf','3lvHkll','stderr','syncedAt','yes','2664156DEuHcb','5YWdfJZ','join','length','1116084VoLaxK','--\x20@lovrabet.','253700lYDUev','path','map','dbName','mybatisXml','filter','split','test','388536aAtVLt','<!--\x20@lovrabet.','sqlName','400852NcWZzy','13smxfPZ','description','apps','sqlContent','push','trim','dbId','156048qeyyNk','402417DMHXAS','version','\x20-->','lastSync','1yEAFgH','stdin','mode'];a199_0x468a=function(){return _0x46ccc4;};return a199_0x468a();}export const SQL_LOCAL_REL_DIR=a199_0x7931c3(0x11b);export function buildSqlLockEntry(_0xb20b3a,_0x39e01a,_0x5f314e,_0x5c1053){const _0x3c5ab7=a199_0x7931c3,_0x535b52=detectSqlMode(_0x39e01a);return{'path':buildSqlRelativePath(_0xb20b3a[_0x3c5ab7(0x119)],_0xb20b3a[_0x3c5ab7(0x107)],_0x5c1053?.[_0x3c5ab7(0x100)],_0x535b52,_0xb20b3a[_0x3c5ab7(0x10f)]),'hash':_0x5f314e,'remoteId':_0xb20b3a['id'],'version':_0xb20b3a[_0x3c5ab7(0x112)],'dbId':Number(_0xb20b3a[_0x3c5ab7(0x10f)]),'dbName':_0x5c1053?.[_0x3c5ab7(0x100)],'sqlName':_0xb20b3a[_0x3c5ab7(0x107)],'sqlConfig':_0xb20b3a['sqlConfig']??undefined,'mode':_0x535b52};}export function cloneSqlLockData(_0x3f081b){const _0x413565=a199_0x7931c3;return{'apps':Object['fromEntries'](Object['entries'](_0x3f081b[_0x413565(0x10b)])[_0x413565(0xff)](([_0x3f68f8,_0xa11a6e])=>[_0x3f68f8,{'sqlRoot':_0xa11a6e['sqlRoot'],'lastSync':_0xa11a6e[_0x413565(0x114)],'sqls':{..._0xa11a6e['sqls']}}]))};}export function ensureRemoteSqlContent(_0x3ab31c){const _0x5b76ea=a199_0x7931c3;return _0x3ab31c[_0x5b76ea(0x10c)]??'';}function a199_0x4dd0(_0x1d0987,_0x1b6be9){_0x1d0987=_0x1d0987-0xff;const _0x468a9c=a199_0x468a();let _0x4dd023=_0x468a9c[_0x1d0987];return _0x4dd023;}export function buildLocalSqlFileContent(_0x197d25,_0x21211d,_0x16bd6b){const _0xad9d98=a199_0x7931c3,_0xb45b12=_0x16bd6b?.[_0xad9d98(0x117)]??detectSqlMode(_0x21211d),_0x25fab9=stripLocalSqlMetadata(_0x21211d,_0xb45b12)['trim'](),_0x3af4db=[...buildMetadataHeaderLines({'sqlCode':_0x197d25[_0xad9d98(0x119)],'sqlName':_0x197d25[_0xad9d98(0x107)],'dbId':_0x197d25[_0xad9d98(0x10f)],'dbName':_0x16bd6b?.[_0xad9d98(0x100)],'mode':_0xb45b12,'syncedAt':_0x16bd6b?.['syncedAt'],'description':_0x16bd6b?.[_0xad9d98(0x10a)]},_0xb45b12),'',_0x25fab9],_0x25f03e=_0x3af4db[_0xad9d98(0x124)]('\x0a');return _0x25f03e['endsWith']('\x0a')?_0x25f03e:_0x25f03e+'\x0a';}export function stripLocalSqlMetadata(_0x28e8b5,_0x23c416){const _0x2e2ef2=a199_0x7931c3,_0x3a4180=_0x28e8b5['replace'](/\r\n/g,'\x0a')[_0x2e2ef2(0x103)]('\x0a'),_0x418ae9=[];let _0xa1e290=0x0;if(_0x23c416===_0x2e2ef2(0x101))while(_0xa1e290<_0x3a4180[_0x2e2ef2(0x125)]){const _0x3f5682=_0x3a4180[_0xa1e290]??'';if(/^\s*<!--\s*@lovrabet\./[_0x2e2ef2(0x104)](_0x3f5682)){_0xa1e290++;continue;}if(_0x3f5682[_0x2e2ef2(0x10e)]()===''&&_0xa1e290>0x0){_0xa1e290++;continue;}break;}else while(_0xa1e290<_0x3a4180[_0x2e2ef2(0x125)]){const _0x11ca27=_0x3a4180[_0xa1e290]??'';if(/^\s*--\s*@lovrabet\./[_0x2e2ef2(0x104)](_0x11ca27)){_0xa1e290++;continue;}if(_0x11ca27['trim']()===''&&_0xa1e290>0x0){_0xa1e290++;continue;}break;}for(;_0xa1e290<_0x3a4180[_0x2e2ef2(0x125)];_0xa1e290++){_0x418ae9[_0x2e2ef2(0x10d)](_0x3a4180[_0xa1e290]);}return _0x418ae9['join']('\x0a')['trimStart']();}export function resolveSqlMode(_0x4458af,_0x13dc7b){const _0x469645=a199_0x7931c3;if(_0x13dc7b?.[_0x469645(0x117)])return _0x13dc7b[_0x469645(0x117)];return detectSqlMode(_0x4458af);}export function resolveSqlFileName(_0x1e1e22,_0xa2c040,_0x4c7d06){const _0x46df0f=a199_0x7931c3;if(_0x4c7d06?.[_0x46df0f(0x129)])return _0x4c7d06[_0x46df0f(0x129)];if(_0x4c7d06?.[_0x46df0f(0x107)]||_0x4c7d06?.['dbName'])return buildSqlRelativePath(_0x1e1e22,_0x4c7d06?.[_0x46df0f(0x107)],_0x4c7d06?.[_0x46df0f(0x100)],resolveSqlMode(_0xa2c040,_0x4c7d06),_0x4c7d06?.['dbId']);return buildDefaultSqlFileName(_0x1e1e22,resolveSqlMode(_0xa2c040,_0x4c7d06));}export function resolveSqlLocalDir(_0x38d117,_0x2b6d6b){return join(_0x38d117,SQL_LOCAL_REL_DIR,_0x2b6d6b);}export async function confirmForceOverwrite(_0x288aa5){const _0x5bb283=a199_0x7931c3,_0x5ba4c9=createInterface({'input':process[_0x5bb283(0x116)],'output':process[_0x5bb283(0x11f)]}),_0x5919e2=await new Promise(_0x5c0591=>{const _0x20a92b=_0x5bb283;_0x5ba4c9['question'](_0x288aa5+_0x20a92b(0x11c),_0x5c0591);});return _0x5ba4c9[_0x5bb283(0x11a)](),['y',_0x5bb283(0x121)]['includes'](_0x5919e2[_0x5bb283(0x10e)]()['toLowerCase']());}export function findSqlLockScope(_0x5d90c8,_0xd1edfc){const _0x77f6f7=a199_0x7931c3;return _0x5d90c8[_0x77f6f7(0x10b)][_0xd1edfc];}function buildMetadataHeaderLines(_0x179e5a,_0x548032){const _0x48c0e9=a199_0x7931c3,_0x5c753e=[[_0x48c0e9(0x119),_0x179e5a[_0x48c0e9(0x119)]],[_0x48c0e9(0x107),_0x179e5a[_0x48c0e9(0x107)]],[_0x48c0e9(0x10f),_0x179e5a[_0x48c0e9(0x10f)]],[_0x48c0e9(0x100),_0x179e5a[_0x48c0e9(0x100)]],[_0x48c0e9(0x117),_0x179e5a[_0x48c0e9(0x117)]],[_0x48c0e9(0x120),_0x179e5a['syncedAt']],[_0x48c0e9(0x10a),_0x179e5a[_0x48c0e9(0x10a)]]];if(_0x548032==='mybatisXml')return _0x5c753e[_0x48c0e9(0x102)](([,_0x3e98db])=>_0x3e98db!==undefined&&_0x3e98db!==null&&String(_0x3e98db)[_0x48c0e9(0x10e)]()!=='')[_0x48c0e9(0xff)](([_0x16f2ac,_0x3d51c5])=>_0x48c0e9(0x106)+_0x16f2ac+':\x20'+String(_0x3d51c5)+_0x48c0e9(0x113));return _0x5c753e[_0x48c0e9(0x102)](([,_0x1323bb])=>_0x1323bb!==undefined&&_0x1323bb!==null&&String(_0x1323bb)[_0x48c0e9(0x10e)]()!=='')[_0x48c0e9(0xff)](([_0x7d0d0a,_0x47f7b6])=>_0x48c0e9(0x127)+_0x7d0d0a+':\x20'+String(_0x47f7b6));}
@@ -1 +1 @@
1
- const a192_0x409f62=a192_0x582d;(function(_0x18a3dd,_0x702461){const _0x396532=a192_0x582d,_0x3cd1b0=_0x18a3dd();while(!![]){try{const _0x2c978f=parseInt(_0x396532(0x125))/0x1+-parseInt(_0x396532(0x11b))/0x2+parseInt(_0x396532(0x120))/0x3*(-parseInt(_0x396532(0x122))/0x4)+-parseInt(_0x396532(0x114))/0x5+-parseInt(_0x396532(0x126))/0x6*(parseInt(_0x396532(0x11e))/0x7)+parseInt(_0x396532(0x10a))/0x8*(-parseInt(_0x396532(0x115))/0x9)+parseInt(_0x396532(0x11d))/0xa*(parseInt(_0x396532(0x118))/0xb);if(_0x2c978f===_0x702461)break;else _0x3cd1b0['push'](_0x3cd1b0['shift']());}catch(_0x41aae7){_0x3cd1b0['push'](_0x3cd1b0['shift']());}}}(a192_0x222e,0xe58f5));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a192_0x222e(){const _0x2e7ab6=['sqlRoot','filePath','456456giVLwo','690onGkln','path','read','map','has','bool','sqlCode','keys','length','\x20unchanged','169712ZgXNrT','\x20modified,\x20','relativePath','lockKey','\x20missing,\x20','totalCount','boolean','\x20added,\x20','status','appCode','8118185MYwicY','630RELbUd','push','lockFilePath','169598AZQtBL','sqlName','sqls','1201286wIxqPD','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','3730ZBnOSl','53620WnOxqm','sql','13449rJtvXL','All\x20SQL\x20queries\x20are\x20in\x20sync.','604wpVAoQ'];a192_0x222e=function(){return _0x2e7ab6;};return a192_0x222e();}import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0xedffb){const _0x160817=a192_0x582d,_0xa5b4b4=[];let _0x27d0d7=0x1;while(!![]){const _0x4b7f61=await listSqlQueries(_0xedffb,{'currentPage':_0x27d0d7,'pageSize':PAGE_SIZE}),_0x17254f=_0x4b7f61['tableData']??[];_0xa5b4b4[_0x160817(0x116)](..._0x17254f[_0x160817(0x129)](_0x10f8a2=>_0x10f8a2[_0x160817(0x12c)]));if(_0x17254f[_0x160817(0x108)]===0x0)break;const _0x236fb1=_0x4b7f61['paging']?.[_0x160817(0x10f)];if(_0x236fb1!=null?_0xa5b4b4[_0x160817(0x108)]>=_0x236fb1:_0x17254f[_0x160817(0x108)]<PAGE_SIZE)break;_0x27d0d7++;}return _0xa5b4b4;}function a192_0x582d(_0x398b2f,_0x29607e){_0x398b2f=_0x398b2f-0x108;const _0x222e6c=a192_0x222e();let _0x582d7b=_0x222e6c[_0x398b2f];return _0x582d7b;}export const sqlStatus={'service':a192_0x409f62(0x11f),'command':'status','description':'Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','risk':a192_0x409f62(0x128),'flags':[{'name':'remote','type':a192_0x409f62(0x110),'description':a192_0x409f62(0x11c)}],async 'execute'(_0x22ef6){const _0x2b43ef=a192_0x409f62,_0x592f7c=loadSqlProjectConfig(_0x22ef6[_0x2b43ef(0x113)]),_0x58f9e5=await readSqlLockFile(_0x592f7c[_0x2b43ef(0x117)]),{appLock:_0x5dbe36}=ensureSqlLockScope(_0x58f9e5??createEmptySqlLock(),_0x592f7c[_0x2b43ef(0x113)],_0x592f7c[_0x2b43ef(0x123)],_0x2b43ef(0x112)),_0x241d05=await scanLocalSqlQueries(_0x592f7c),_0x5ec908=[],_0x2eb507=[],_0x494419=[],_0x1451c4=[],_0x11cfc8=new Set(_0x241d05['map'](_0x266023=>_0x266023[_0x2b43ef(0x10d)]));for(const _0x23de79 of _0x241d05){const _0x1db43=await computeSqlFileHash(_0x23de79[_0x2b43ef(0x124)]),_0x4bdf83=_0x5dbe36['sqls'][_0x23de79['lockKey']],_0x104613=!!_0x4bdf83&&_0x4bdf83[_0x2b43ef(0x127)]!==_0x23de79[_0x2b43ef(0x10c)],_0x271da6=!!_0x4bdf83&&!!_0x23de79['sqlName']&&_0x4bdf83[_0x2b43ef(0x119)]!==_0x23de79['sqlName'];if(!_0x4bdf83)_0x5ec908['push'](_0x23de79[_0x2b43ef(0x10d)]);else _0x4bdf83['hash']!==_0x1db43||_0x104613||_0x271da6?_0x2eb507[_0x2b43ef(0x116)](_0x23de79[_0x2b43ef(0x10d)]):_0x494419[_0x2b43ef(0x116)](_0x23de79['lockKey']);}for(const _0x8442cb of Object[_0x2b43ef(0x12d)](_0x5dbe36[_0x2b43ef(0x11a)])){!_0x11cfc8[_0x2b43ef(0x12a)](_0x8442cb)&&_0x1451c4[_0x2b43ef(0x116)](_0x8442cb);}const _0xf44187=[];if(_0x22ef6[_0x2b43ef(0x12b)]('remote')){const _0x1d56db=await fetchAllSqlCodes(_0x22ef6['appCode']);for(const _0x4c42f1 of _0x1d56db){!_0x11cfc8['has'](_0x4c42f1)&&!_0x5dbe36[_0x2b43ef(0x11a)][_0x4c42f1]&&_0xf44187['push'](_0x4c42f1);}}const _0x5e71e0=_0x5ec908[_0x2b43ef(0x108)]===0x0&&_0x2eb507[_0x2b43ef(0x108)]===0x0&&_0x1451c4[_0x2b43ef(0x108)]===0x0&&_0xf44187[_0x2b43ef(0x108)]===0x0;return{'ok':!![],'data':{'added':_0x5ec908,'modified':_0x2eb507,'missing':_0x1451c4,'unchanged':_0x494419,'remoteOnly':_0xf44187},'message':_0x5e71e0?_0x2b43ef(0x121):_0x5ec908[_0x2b43ef(0x108)]+_0x2b43ef(0x111)+_0x2eb507[_0x2b43ef(0x108)]+_0x2b43ef(0x10b)+_0x1451c4[_0x2b43ef(0x108)]+_0x2b43ef(0x10e)+_0x494419[_0x2b43ef(0x108)]+_0x2b43ef(0x109)+(_0xf44187[_0x2b43ef(0x108)]>0x0?',\x20'+_0xf44187[_0x2b43ef(0x108)]+'\x20remote-only':'')};}};
1
+ const a200_0x47656a=a200_0x3465;(function(_0x41c439,_0x1b4adf){const _0x2067ca=a200_0x3465,_0x59b423=_0x41c439();while(!![]){try{const _0x1fc561=parseInt(_0x2067ca(0x1ba))/0x1*(parseInt(_0x2067ca(0x1a8))/0x2)+parseInt(_0x2067ca(0x1ac))/0x3*(parseInt(_0x2067ca(0x1c1))/0x4)+parseInt(_0x2067ca(0x1bd))/0x5*(parseInt(_0x2067ca(0x1bb))/0x6)+parseInt(_0x2067ca(0x1a1))/0x7*(parseInt(_0x2067ca(0x1a7))/0x8)+parseInt(_0x2067ca(0x1c0))/0x9*(-parseInt(_0x2067ca(0x1af))/0xa)+parseInt(_0x2067ca(0x1bc))/0xb*(parseInt(_0x2067ca(0x1a4))/0xc)+-parseInt(_0x2067ca(0x1ad))/0xd;if(_0x1fc561===_0x1b4adf)break;else _0x59b423['push'](_0x59b423['shift']());}catch(_0x4921b6){_0x59b423['push'](_0x59b423['shift']());}}}(a200_0x141b,0x9d03e));import{listSqlQueries}from'../../core/api-client.js';function a200_0x3465(_0x3ca09a,_0x51b35f){_0x3ca09a=_0x3ca09a-0x1a1;const _0x141b52=a200_0x141b();let _0x3465f6=_0x141b52[_0x3ca09a];return _0x3465f6;}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x3b005b){const _0x5ed89b=a200_0x3465,_0x5ed49e=[];let _0x26a6e3=0x1;while(!![]){const _0x3194a3=await listSqlQueries(_0x3b005b,{'currentPage':_0x26a6e3,'pageSize':PAGE_SIZE}),_0x2587dc=_0x3194a3['tableData']??[];_0x5ed49e[_0x5ed89b(0x1c4)](..._0x2587dc[_0x5ed89b(0x1c3)](_0xf10e2=>_0xf10e2[_0x5ed89b(0x1b3)]));if(_0x2587dc[_0x5ed89b(0x1b1)]===0x0)break;const _0x589149=_0x3194a3['paging']?.[_0x5ed89b(0x1a3)];if(_0x589149!=null?_0x5ed49e['length']>=_0x589149:_0x2587dc[_0x5ed89b(0x1b1)]<PAGE_SIZE)break;_0x26a6e3++;}return _0x5ed49e;}function a200_0x141b(){const _0x21df12=['sql','131350JexaCw','\x20unchanged','length','\x20modified,\x20','sqlCode','All\x20SQL\x20queries\x20are\x20in\x20sync.','lockKey','keys','lockFilePath','filePath','remote','11GQEQtt','51162ezdsSZ','21142APZDZl','190DNUWVt','sqlName','\x20remote-only','513fqKjZc','2164ypgOke','bool','map','push','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','\x20missing,\x20','sqls','917zpmQAL','path','totalCount','3972MZZhHN','read','sqlRoot','72272FGkUZe','61882mvGKEw','\x20added,\x20','appCode','boolean','3453nHcZmy','22293375UQzCah'];a200_0x141b=function(){return _0x21df12;};return a200_0x141b();}export const sqlStatus={'service':a200_0x47656a(0x1ae),'command':'status','description':a200_0x47656a(0x1c5),'risk':a200_0x47656a(0x1a5),'flags':[{'name':a200_0x47656a(0x1b9),'type':a200_0x47656a(0x1ab),'description':'Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally'}],async 'execute'(_0x20d6dc){const _0x37fe22=a200_0x47656a,_0x71dec8=loadSqlProjectConfig(_0x20d6dc['appCode']),_0x1e8968=await readSqlLockFile(_0x71dec8[_0x37fe22(0x1b7)]),{appLock:_0x1bf879}=ensureSqlLockScope(_0x1e8968??createEmptySqlLock(),_0x71dec8[_0x37fe22(0x1aa)],_0x71dec8[_0x37fe22(0x1a6)],'status'),_0xbbf5e6=await scanLocalSqlQueries(_0x71dec8),_0x54c285=[],_0x13555e=[],_0x15c864=[],_0x5e6e6d=[],_0x3c9b94=new Set(_0xbbf5e6[_0x37fe22(0x1c3)](_0x553469=>_0x553469['lockKey']));for(const _0x169205 of _0xbbf5e6){const _0x1cd5ff=await computeSqlFileHash(_0x169205[_0x37fe22(0x1b8)]),_0x47437f=_0x1bf879[_0x37fe22(0x1c7)][_0x169205[_0x37fe22(0x1b5)]],_0x169978=!!_0x47437f&&_0x47437f[_0x37fe22(0x1a2)]!==_0x169205['relativePath'],_0x3771a3=!!_0x47437f&&!!_0x169205[_0x37fe22(0x1be)]&&_0x47437f[_0x37fe22(0x1be)]!==_0x169205[_0x37fe22(0x1be)];if(!_0x47437f)_0x54c285[_0x37fe22(0x1c4)](_0x169205[_0x37fe22(0x1b5)]);else _0x47437f['hash']!==_0x1cd5ff||_0x169978||_0x3771a3?_0x13555e[_0x37fe22(0x1c4)](_0x169205[_0x37fe22(0x1b5)]):_0x15c864[_0x37fe22(0x1c4)](_0x169205[_0x37fe22(0x1b5)]);}for(const _0x2dfdeb of Object[_0x37fe22(0x1b6)](_0x1bf879[_0x37fe22(0x1c7)])){!_0x3c9b94['has'](_0x2dfdeb)&&_0x5e6e6d[_0x37fe22(0x1c4)](_0x2dfdeb);}const _0x1edfb9=[];if(_0x20d6dc[_0x37fe22(0x1c2)](_0x37fe22(0x1b9))){const _0x53f1=await fetchAllSqlCodes(_0x20d6dc['appCode']);for(const _0x5ea187 of _0x53f1){!_0x3c9b94['has'](_0x5ea187)&&!_0x1bf879['sqls'][_0x5ea187]&&_0x1edfb9[_0x37fe22(0x1c4)](_0x5ea187);}}const _0xe963bc=_0x54c285[_0x37fe22(0x1b1)]===0x0&&_0x13555e[_0x37fe22(0x1b1)]===0x0&&_0x5e6e6d[_0x37fe22(0x1b1)]===0x0&&_0x1edfb9[_0x37fe22(0x1b1)]===0x0;return{'ok':!![],'data':{'added':_0x54c285,'modified':_0x13555e,'missing':_0x5e6e6d,'unchanged':_0x15c864,'remoteOnly':_0x1edfb9},'message':_0xe963bc?_0x37fe22(0x1b4):_0x54c285[_0x37fe22(0x1b1)]+_0x37fe22(0x1a9)+_0x13555e[_0x37fe22(0x1b1)]+_0x37fe22(0x1b2)+_0x5e6e6d['length']+_0x37fe22(0x1c6)+_0x15c864[_0x37fe22(0x1b1)]+_0x37fe22(0x1b0)+(_0x1edfb9[_0x37fe22(0x1b1)]>0x0?',\x20'+_0x1edfb9[_0x37fe22(0x1b1)]+_0x37fe22(0x1bf):'')};}};