@lovrabet/rabetbase-cli 2.3.16-beta.3 → 2.3.16-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (568) hide show
  1. package/lib/api/api-doc.d.ts +9 -0
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/fetch-model-list.d.ts +2 -0
  4. package/lib/api/fetch-model-list.js +1 -1
  5. package/lib/api/generate-api-file.d.ts +8 -0
  6. package/lib/api/generate-api-file.js +1 -1
  7. package/lib/auth/auth-server-ui.d.ts +13 -0
  8. package/lib/auth/auth-server-ui.js +1 -1
  9. package/lib/auth/auth-server.d.ts +25 -0
  10. package/lib/auth/auth-server.js +1 -1
  11. package/lib/auth/constant.d.ts +2 -0
  12. package/lib/auth/constant.js +1 -1
  13. package/lib/auth/get-cookie.d.ts +1 -0
  14. package/lib/auth/get-cookie.js +1 -1
  15. package/lib/auth/get-session-user.d.ts +51 -0
  16. package/lib/auth/get-session-user.js +1 -1
  17. package/lib/auth/is-session-valid.d.ts +1 -0
  18. package/lib/auth/is-session-valid.js +1 -1
  19. package/lib/auth/login-success-html.d.ts +5 -0
  20. package/lib/auth/login-success-html.js +1 -1
  21. package/lib/auth/logout.d.ts +1 -0
  22. package/lib/auth/logout.js +1 -1
  23. package/lib/cli-flags.d.ts +12 -0
  24. package/lib/cli-flags.js +1 -1
  25. package/lib/cli.d.ts +2 -0
  26. package/lib/cli.js +1 -1
  27. package/lib/commands/api/generate.d.ts +2 -0
  28. package/lib/commands/api/generate.js +1 -1
  29. package/lib/commands/api/index.d.ts +2 -0
  30. package/lib/commands/api/index.js +1 -1
  31. package/lib/commands/api/list.d.ts +2 -0
  32. package/lib/commands/api/list.js +1 -1
  33. package/lib/commands/api/pull.d.ts +2 -0
  34. package/lib/commands/api/pull.js +1 -1
  35. package/lib/commands/api/shared.d.ts +18 -0
  36. package/lib/commands/api/shared.js +1 -1
  37. package/lib/commands/app/index.d.ts +5 -0
  38. package/lib/commands/app/index.js +1 -1
  39. package/lib/commands/app/list.d.ts +10 -0
  40. package/lib/commands/app/list.js +1 -1
  41. package/lib/commands/app/members-list.d.ts +2 -0
  42. package/lib/commands/app/members-list.js +1 -1
  43. package/lib/commands/app/remote-directory.d.ts +11 -0
  44. package/lib/commands/app/remote-directory.js +1 -1
  45. package/lib/commands/app/shared.d.ts +46 -0
  46. package/lib/commands/app/shared.js +1 -1
  47. package/lib/commands/app-config/delete.d.ts +2 -0
  48. package/lib/commands/app-config/delete.js +1 -1
  49. package/lib/commands/app-config/get.d.ts +2 -0
  50. package/lib/commands/app-config/get.js +1 -1
  51. package/lib/commands/app-config/index.d.ts +2 -0
  52. package/lib/commands/app-config/index.js +1 -1
  53. package/lib/commands/app-config/list.d.ts +2 -0
  54. package/lib/commands/app-config/list.js +1 -1
  55. package/lib/commands/app-config/set.d.ts +2 -0
  56. package/lib/commands/app-config/set.js +1 -1
  57. package/lib/commands/app-config/shared.d.ts +105 -0
  58. package/lib/commands/app-config/shared.js +1 -1
  59. package/lib/commands/auth/index.d.ts +2 -0
  60. package/lib/commands/auth/index.js +1 -1
  61. package/lib/commands/bff/create.d.ts +4 -0
  62. package/lib/commands/bff/create.js +1 -1
  63. package/lib/commands/bff/delete.d.ts +2 -0
  64. package/lib/commands/bff/delete.js +1 -1
  65. package/lib/commands/bff/detail.d.ts +2 -0
  66. package/lib/commands/bff/detail.js +1 -1
  67. package/lib/commands/bff/index.d.ts +5 -0
  68. package/lib/commands/bff/index.js +1 -1
  69. package/lib/commands/bff/list.d.ts +2 -0
  70. package/lib/commands/bff/list.js +1 -1
  71. package/lib/commands/bff/pull.d.ts +2 -0
  72. package/lib/commands/bff/pull.js +1 -1
  73. package/lib/commands/bff/push.d.ts +2 -0
  74. package/lib/commands/bff/push.js +1 -1
  75. package/lib/commands/bff/status.d.ts +2 -0
  76. package/lib/commands/bff/status.js +1 -1
  77. package/lib/commands/cli-skill/index.d.ts +8 -0
  78. package/lib/commands/cli-skill/index.js +1 -1
  79. package/lib/commands/cli-update.d.ts +2 -0
  80. package/lib/commands/cli-update.js +1 -1
  81. package/lib/commands/codegen/index.d.ts +2 -0
  82. package/lib/commands/codegen/index.js +1 -1
  83. package/lib/commands/codegen/sdk.d.ts +2 -0
  84. package/lib/commands/codegen/sdk.js +1 -1
  85. package/lib/commands/codegen/sql.d.ts +2 -0
  86. package/lib/commands/codegen/sql.js +1 -1
  87. package/lib/commands/common/app-registry.d.ts +17 -0
  88. package/lib/commands/common/app-registry.js +1 -1
  89. package/lib/commands/common/app-selector.d.ts +17 -0
  90. package/lib/commands/common/app-selector.js +1 -1
  91. package/lib/commands/common/async-task.d.ts +11 -0
  92. package/lib/commands/common/async-task.js +1 -1
  93. package/lib/commands/common/dry-run.d.ts +12 -0
  94. package/lib/commands/common/dry-run.js +1 -1
  95. package/lib/commands/common/flags.d.ts +26 -0
  96. package/lib/commands/common/flags.js +1 -1
  97. package/lib/commands/common/local-file.d.ts +6 -0
  98. package/lib/commands/common/local-file.js +1 -1
  99. package/lib/commands/common/validate.d.ts +13 -0
  100. package/lib/commands/common/validate.js +1 -1
  101. package/lib/commands/config/get.d.ts +5 -0
  102. package/lib/commands/config/get.js +1 -1
  103. package/lib/commands/config/index.d.ts +5 -0
  104. package/lib/commands/config/index.js +1 -1
  105. package/lib/commands/config/list.d.ts +5 -0
  106. package/lib/commands/config/list.js +1 -1
  107. package/lib/commands/config/set.d.ts +5 -0
  108. package/lib/commands/config/set.js +1 -1
  109. package/lib/commands/config/shared.d.ts +16 -0
  110. package/lib/commands/config/shared.js +1 -1
  111. package/lib/commands/data/filter.d.ts +7 -0
  112. package/lib/commands/data/filter.js +1 -1
  113. package/lib/commands/data/getOne.d.ts +7 -0
  114. package/lib/commands/data/getOne.js +1 -1
  115. package/lib/commands/data/index.d.ts +8 -0
  116. package/lib/commands/data/index.js +1 -1
  117. package/lib/commands/data/shared.d.ts +33 -0
  118. package/lib/commands/data/shared.js +1 -1
  119. package/lib/commands/dataset/business-group-update.d.ts +18 -0
  120. package/lib/commands/dataset/business-group-update.js +1 -1
  121. package/lib/commands/dataset/capability.d.ts +11 -0
  122. package/lib/commands/dataset/capability.js +1 -1
  123. package/lib/commands/dataset/delete.d.ts +2 -0
  124. package/lib/commands/dataset/delete.js +1 -1
  125. package/lib/commands/dataset/detail.d.ts +2 -0
  126. package/lib/commands/dataset/detail.js +1 -1
  127. package/lib/commands/dataset/extend-update.d.ts +26 -0
  128. package/lib/commands/dataset/extend-update.js +1 -1
  129. package/lib/commands/dataset/field-update.d.ts +27 -0
  130. package/lib/commands/dataset/field-update.js +1 -1
  131. package/lib/commands/dataset/generate.d.ts +3 -0
  132. package/lib/commands/dataset/generate.js +1 -1
  133. package/lib/commands/dataset/index.d.ts +2 -0
  134. package/lib/commands/dataset/index.js +1 -1
  135. package/lib/commands/dataset/list.d.ts +2 -0
  136. package/lib/commands/dataset/list.js +1 -1
  137. package/lib/commands/dataset/operations.d.ts +2 -0
  138. package/lib/commands/dataset/operations.js +1 -1
  139. package/lib/commands/dataset/relation-audit.d.ts +2 -0
  140. package/lib/commands/dataset/relation-audit.js +1 -1
  141. package/lib/commands/dataset/relation-create.d.ts +2 -0
  142. package/lib/commands/dataset/relation-create.js +1 -1
  143. package/lib/commands/dataset/relation-delete.d.ts +2 -0
  144. package/lib/commands/dataset/relation-delete.js +1 -1
  145. package/lib/commands/dataset/relation-shared.d.ts +128 -0
  146. package/lib/commands/dataset/relation-shared.js +1 -1
  147. package/lib/commands/dataset/relation-update.d.ts +2 -0
  148. package/lib/commands/dataset/relation-update.js +1 -1
  149. package/lib/commands/dataset/relations.d.ts +53 -0
  150. package/lib/commands/dataset/relations.js +1 -1
  151. package/lib/commands/dataset/rename.d.ts +17 -0
  152. package/lib/commands/dataset/rename.js +1 -1
  153. package/lib/commands/dataset/restore.d.ts +2 -0
  154. package/lib/commands/dataset/restore.js +1 -1
  155. package/lib/commands/db/analysis-batching.d.ts +30 -0
  156. package/lib/commands/db/analysis-batching.js +1 -1
  157. package/lib/commands/db/analyze-batch-plan.d.ts +2 -0
  158. package/lib/commands/db/analyze-batch-plan.js +1 -1
  159. package/lib/commands/db/analyze-cancel.d.ts +2 -0
  160. package/lib/commands/db/analyze-cancel.js +1 -1
  161. package/lib/commands/db/analyze-start.d.ts +2 -0
  162. package/lib/commands/db/analyze-start.js +1 -1
  163. package/lib/commands/db/analyze-status.d.ts +2 -0
  164. package/lib/commands/db/analyze-status.js +1 -1
  165. package/lib/commands/db/create.d.ts +2 -0
  166. package/lib/commands/db/create.js +1 -1
  167. package/lib/commands/db/delete.d.ts +2 -0
  168. package/lib/commands/db/delete.js +1 -1
  169. package/lib/commands/db/detail.d.ts +2 -0
  170. package/lib/commands/db/detail.js +1 -1
  171. package/lib/commands/db/diff.d.ts +2 -0
  172. package/lib/commands/db/diff.js +1 -1
  173. package/lib/commands/db/index.d.ts +5 -0
  174. package/lib/commands/db/index.js +1 -1
  175. package/lib/commands/db/list.d.ts +2 -0
  176. package/lib/commands/db/list.js +1 -1
  177. package/lib/commands/db/shared.d.ts +15 -0
  178. package/lib/commands/db/shared.js +1 -1
  179. package/lib/commands/db/tables.d.ts +2 -0
  180. package/lib/commands/db/tables.js +1 -1
  181. package/lib/commands/db/test.d.ts +2 -0
  182. package/lib/commands/db/test.js +1 -1
  183. package/lib/commands/db/update.d.ts +2 -0
  184. package/lib/commands/db/update.js +1 -1
  185. package/lib/commands/doctor.d.ts +2 -0
  186. package/lib/commands/doctor.js +1 -1
  187. package/lib/commands/file/index.d.ts +2 -0
  188. package/lib/commands/file/index.js +1 -1
  189. package/lib/commands/init/index.d.ts +11 -0
  190. package/lib/commands/init/index.js +1 -1
  191. package/lib/commands/issue/index.d.ts +2 -0
  192. package/lib/commands/issue/index.js +1 -1
  193. package/lib/commands/issue/nudge.d.ts +23 -0
  194. package/lib/commands/issue/nudge.js +1 -1
  195. package/lib/commands/issue/report.d.ts +2 -0
  196. package/lib/commands/issue/report.js +1 -1
  197. package/lib/commands/issue/shared.d.ts +32 -0
  198. package/lib/commands/issue/shared.js +1 -1
  199. package/lib/commands/kb/create.d.ts +2 -0
  200. package/lib/commands/kb/create.js +1 -1
  201. package/lib/commands/kb/delete.d.ts +2 -0
  202. package/lib/commands/kb/delete.js +1 -1
  203. package/lib/commands/kb/detail.d.ts +2 -0
  204. package/lib/commands/kb/detail.js +1 -1
  205. package/lib/commands/kb/index.d.ts +2 -0
  206. package/lib/commands/kb/index.js +1 -1
  207. package/lib/commands/kb/list.d.ts +2 -0
  208. package/lib/commands/kb/list.js +1 -1
  209. package/lib/commands/kb/shared.d.ts +33 -0
  210. package/lib/commands/kb/shared.js +1 -1
  211. package/lib/commands/kb/update.d.ts +2 -0
  212. package/lib/commands/kb/update.js +1 -1
  213. package/lib/commands/logs/index.d.ts +5 -0
  214. package/lib/commands/logs/index.js +1 -1
  215. package/lib/commands/menu/asset-update.d.ts +2 -0
  216. package/lib/commands/menu/asset-update.js +1 -1
  217. package/lib/commands/menu/delete.d.ts +2 -0
  218. package/lib/commands/menu/delete.js +1 -1
  219. package/lib/commands/menu/external-link-create.d.ts +3 -0
  220. package/lib/commands/menu/external-link-create.js +1 -1
  221. package/lib/commands/menu/external-link-update.d.ts +2 -0
  222. package/lib/commands/menu/external-link-update.js +1 -1
  223. package/lib/commands/menu/group-create.d.ts +2 -0
  224. package/lib/commands/menu/group-create.js +1 -1
  225. package/lib/commands/menu/group-update.d.ts +2 -0
  226. package/lib/commands/menu/group-update.js +1 -1
  227. package/lib/commands/menu/index.d.ts +17 -0
  228. package/lib/commands/menu/index.js +1 -1
  229. package/lib/commands/menu/list.d.ts +2 -0
  230. package/lib/commands/menu/list.js +1 -1
  231. package/lib/commands/menu/move.d.ts +2 -0
  232. package/lib/commands/menu/move.js +1 -1
  233. package/lib/commands/menu/regroup-start.d.ts +2 -0
  234. package/lib/commands/menu/regroup-start.js +1 -1
  235. package/lib/commands/menu/rename.d.ts +2 -0
  236. package/lib/commands/menu/rename.js +1 -1
  237. package/lib/commands/menu/shared/compare-table.d.ts +27 -0
  238. package/lib/commands/menu/shared/compare-table.js +1 -1
  239. package/lib/commands/menu/shared/delete-plan.d.ts +51 -0
  240. package/lib/commands/menu/shared/delete-plan.js +1 -1
  241. package/lib/commands/menu/shared/facts.d.ts +12 -0
  242. package/lib/commands/menu/shared/facts.js +1 -1
  243. package/lib/commands/menu/shared/index.d.ts +12 -0
  244. package/lib/commands/menu/shared/index.js +1 -1
  245. package/lib/commands/menu/shared/inquirer.d.ts +10 -0
  246. package/lib/commands/menu/shared/inquirer.js +1 -1
  247. package/lib/commands/menu/shared/local-pages.d.ts +12 -0
  248. package/lib/commands/menu/shared/local-pages.js +1 -1
  249. package/lib/commands/menu/shared/logic.d.ts +28 -0
  250. package/lib/commands/menu/shared/logic.js +1 -1
  251. package/lib/commands/menu/shared/mutations.d.ts +69 -0
  252. package/lib/commands/menu/shared/mutations.js +1 -1
  253. package/lib/commands/menu/shared/service.d.ts +17 -0
  254. package/lib/commands/menu/shared/service.js +1 -1
  255. package/lib/commands/menu/shared/sync-core.d.ts +7 -0
  256. package/lib/commands/menu/shared/sync-core.js +1 -1
  257. package/lib/commands/menu/shared/types.d.ts +162 -0
  258. package/lib/commands/menu/shared/update-core.d.ts +11 -0
  259. package/lib/commands/menu/shared/update-core.js +1 -1
  260. package/lib/commands/menu/shared/valid-url.d.ts +6 -0
  261. package/lib/commands/menu/shared/valid-url.js +1 -1
  262. package/lib/commands/menu/sync.d.ts +2 -0
  263. package/lib/commands/menu/sync.js +1 -1
  264. package/lib/commands/notification/config-list.d.ts +2 -0
  265. package/lib/commands/notification/config-list.js +1 -1
  266. package/lib/commands/notification/index.d.ts +2 -0
  267. package/lib/commands/notification/index.js +1 -1
  268. package/lib/commands/ocr/index.d.ts +2 -0
  269. package/lib/commands/ocr/index.js +1 -1
  270. package/lib/commands/page/generate-start.d.ts +2 -0
  271. package/lib/commands/page/generate-start.js +1 -1
  272. package/lib/commands/page/generate-status.d.ts +2 -0
  273. package/lib/commands/page/generate-status.js +1 -1
  274. package/lib/commands/page/index.d.ts +2 -0
  275. package/lib/commands/page/index.js +1 -1
  276. package/lib/commands/page/pull.d.ts +2 -0
  277. package/lib/commands/page/pull.js +1 -1
  278. package/lib/commands/page/push.d.ts +2 -0
  279. package/lib/commands/page/push.js +1 -1
  280. package/lib/commands/page/relation-audit.d.ts +2 -0
  281. package/lib/commands/page/relation-audit.js +1 -1
  282. package/lib/commands/page/restore.d.ts +2 -0
  283. package/lib/commands/page/restore.js +1 -1
  284. package/lib/commands/page/shared.d.ts +105 -0
  285. package/lib/commands/page/shared.js +1 -1
  286. package/lib/commands/page/standard-page-status.d.ts +2 -0
  287. package/lib/commands/page/standard-page-status.js +1 -1
  288. package/lib/commands/page/sync.d.ts +2 -0
  289. package/lib/commands/page/sync.js +1 -1
  290. package/lib/commands/permit/index.d.ts +2 -0
  291. package/lib/commands/permit/index.js +1 -1
  292. package/lib/commands/permit/page-get.d.ts +2 -0
  293. package/lib/commands/permit/page-get.js +1 -1
  294. package/lib/commands/permit/page-set.d.ts +2 -0
  295. package/lib/commands/permit/page-set.js +1 -1
  296. package/lib/commands/permit/role-apis-set.d.ts +2 -0
  297. package/lib/commands/permit/role-apis-set.js +1 -1
  298. package/lib/commands/permit/role-menus-set.d.ts +2 -0
  299. package/lib/commands/permit/role-menus-set.js +1 -1
  300. package/lib/commands/permit/role-menus.d.ts +2 -0
  301. package/lib/commands/permit/role-menus.js +1 -1
  302. package/lib/commands/permit/shared.d.ts +74 -0
  303. package/lib/commands/permit/shared.js +1 -1
  304. package/lib/commands/project/create/enhanced-guided-create.d.ts +7 -0
  305. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  306. package/lib/commands/project/create/format-elapsed.d.ts +1 -0
  307. package/lib/commands/project/create/format-elapsed.js +1 -1
  308. package/lib/commands/project/create/main.d.ts +6 -0
  309. package/lib/commands/project/create/main.js +1 -1
  310. package/lib/commands/project/create/non-interactive.d.ts +9 -0
  311. package/lib/commands/project/create/non-interactive.js +1 -1
  312. package/lib/commands/project/create/project-template-path.d.ts +4 -0
  313. package/lib/commands/project/create/project-template-path.js +1 -1
  314. package/lib/commands/project/create/use-copy-project-template.d.ts +1 -0
  315. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  316. package/lib/commands/project/create/use-format-code.d.ts +1 -0
  317. package/lib/commands/project/create/use-format-code.js +1 -1
  318. package/lib/commands/project/create/use-install-dependencies.d.ts +1 -0
  319. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  320. package/lib/commands/project/index.d.ts +2 -0
  321. package/lib/commands/project/index.js +1 -1
  322. package/lib/commands/project/upgrade.d.ts +1 -0
  323. package/lib/commands/project/upgrade.js +1 -1
  324. package/lib/commands/registry.d.ts +66 -0
  325. package/lib/commands/registry.js +1 -1
  326. package/lib/commands/role/create.d.ts +2 -0
  327. package/lib/commands/role/create.js +1 -1
  328. package/lib/commands/role/delete.d.ts +2 -0
  329. package/lib/commands/role/delete.js +1 -1
  330. package/lib/commands/role/detail.d.ts +2 -0
  331. package/lib/commands/role/detail.js +1 -1
  332. package/lib/commands/role/index.d.ts +2 -0
  333. package/lib/commands/role/index.js +1 -1
  334. package/lib/commands/role/list.d.ts +2 -0
  335. package/lib/commands/role/list.js +1 -1
  336. package/lib/commands/role/shared.d.ts +107 -0
  337. package/lib/commands/role/shared.js +1 -1
  338. package/lib/commands/role/update.d.ts +2 -0
  339. package/lib/commands/role/update.js +1 -1
  340. package/lib/commands/role/user-add.d.ts +2 -0
  341. package/lib/commands/role/user-add.js +1 -1
  342. package/lib/commands/role/user-remove.d.ts +2 -0
  343. package/lib/commands/role/user-remove.js +1 -1
  344. package/lib/commands/role/user-resolve.d.ts +2 -0
  345. package/lib/commands/role/user-resolve.js +1 -1
  346. package/lib/commands/run/index.d.ts +2 -0
  347. package/lib/commands/run/index.js +1 -1
  348. package/lib/commands/schema.d.ts +5 -0
  349. package/lib/commands/schema.js +1 -1
  350. package/lib/commands/sql/create.d.ts +10 -0
  351. package/lib/commands/sql/create.js +1 -1
  352. package/lib/commands/sql/delete.d.ts +5 -0
  353. package/lib/commands/sql/delete.js +1 -1
  354. package/lib/commands/sql/detail.d.ts +2 -0
  355. package/lib/commands/sql/detail.js +1 -1
  356. package/lib/commands/sql/exec.d.ts +2 -0
  357. package/lib/commands/sql/exec.js +1 -1
  358. package/lib/commands/sql/index.d.ts +5 -0
  359. package/lib/commands/sql/index.js +1 -1
  360. package/lib/commands/sql/list.d.ts +2 -0
  361. package/lib/commands/sql/list.js +1 -1
  362. package/lib/commands/sql/pull.d.ts +5 -0
  363. package/lib/commands/sql/pull.js +1 -1
  364. package/lib/commands/sql/push.d.ts +5 -0
  365. package/lib/commands/sql/push.js +1 -1
  366. package/lib/commands/sql/shared.d.ts +23 -0
  367. package/lib/commands/sql/shared.js +1 -1
  368. package/lib/commands/sql/status.d.ts +5 -0
  369. package/lib/commands/sql/status.js +1 -1
  370. package/lib/commands/sql/validate.d.ts +2 -0
  371. package/lib/commands/sql/validate.js +1 -1
  372. package/lib/commands/task/index.d.ts +2 -0
  373. package/lib/commands/task/index.js +1 -1
  374. package/lib/commands/task/status.d.ts +2 -0
  375. package/lib/commands/task/status.js +1 -1
  376. package/lib/commands/tenant/index.d.ts +2 -0
  377. package/lib/commands/tenant/index.js +1 -1
  378. package/lib/commands/tenant/members-list.d.ts +2 -0
  379. package/lib/commands/tenant/members-list.js +1 -1
  380. package/lib/commands/tenant/shared.d.ts +10 -0
  381. package/lib/commands/tenant/shared.js +1 -1
  382. package/lib/commands/workspace/add.d.ts +6 -0
  383. package/lib/commands/workspace/add.js +1 -1
  384. package/lib/commands/workspace/index.d.ts +11 -0
  385. package/lib/commands/workspace/index.js +1 -1
  386. package/lib/commands/workspace/remove.d.ts +6 -0
  387. package/lib/commands/workspace/remove.js +1 -1
  388. package/lib/config/schema.d.ts +50 -0
  389. package/lib/config/schema.js +1 -1
  390. package/lib/constant/cdn.d.ts +1 -0
  391. package/lib/constant/cdn.js +1 -1
  392. package/lib/constant/cli.d.ts +34 -0
  393. package/lib/constant/cli.js +1 -1
  394. package/lib/constant/defaults.d.ts +10 -0
  395. package/lib/constant/defaults.js +1 -1
  396. package/lib/constant/domain.d.ts +14 -0
  397. package/lib/constant/domain.js +1 -1
  398. package/lib/constant/env.d.ts +11 -0
  399. package/lib/constant/env.js +1 -1
  400. package/lib/constant/output.d.ts +1 -0
  401. package/lib/constant/output.js +1 -1
  402. package/lib/constant/paths.d.ts +5 -0
  403. package/lib/constant/paths.js +1 -1
  404. package/lib/constant/risk.d.ts +1 -0
  405. package/lib/constant/risk.js +1 -1
  406. package/lib/context/app-resolver.d.ts +36 -0
  407. package/lib/context/app-resolver.js +1 -1
  408. package/lib/context/auth-resolver.d.ts +5 -0
  409. package/lib/context/auth-resolver.js +1 -1
  410. package/lib/context/config-loader.d.ts +61 -0
  411. package/lib/context/config-loader.js +1 -1
  412. package/lib/context.d.ts +102 -0
  413. package/lib/context.js +1 -1
  414. package/lib/core/alias-resolver.d.ts +31 -0
  415. package/lib/core/alias-resolver.js +1 -1
  416. package/lib/core/api-client.d.ts +1018 -0
  417. package/lib/core/api-client.js +1 -1
  418. package/lib/core/bff/config.d.ts +8 -0
  419. package/lib/core/bff/config.js +1 -1
  420. package/lib/core/bff/file-system.d.ts +28 -0
  421. package/lib/core/bff/file-system.js +1 -1
  422. package/lib/core/bff/hash.d.ts +7 -0
  423. package/lib/core/bff/hash.js +1 -1
  424. package/lib/core/bff/lock.d.ts +25 -0
  425. package/lib/core/bff/lock.js +1 -1
  426. package/lib/core/bff/types.d.ts +92 -0
  427. package/lib/core/bff/utils.d.ts +25 -0
  428. package/lib/core/bff/utils.js +1 -1
  429. package/lib/core/db-resolver.d.ts +43 -0
  430. package/lib/core/db-resolver.js +1 -1
  431. package/lib/core/page/file-system.d.ts +6 -0
  432. package/lib/core/page/file-system.js +1 -1
  433. package/lib/core/page/hash.d.ts +4 -0
  434. package/lib/core/page/hash.js +1 -1
  435. package/lib/core/page/lock.d.ts +8 -0
  436. package/lib/core/page/lock.js +1 -1
  437. package/lib/core/page/types.d.ts +22 -0
  438. package/lib/core/sql-index-auditor.d.ts +33 -0
  439. package/lib/core/sql-index-auditor.js +1 -1
  440. package/lib/core/sql-sync/config.d.ts +7 -0
  441. package/lib/core/sql-sync/config.js +1 -1
  442. package/lib/core/sql-sync/file-system.d.ts +7 -0
  443. package/lib/core/sql-sync/file-system.js +1 -1
  444. package/lib/core/sql-sync/hash.d.ts +5 -0
  445. package/lib/core/sql-sync/hash.js +1 -1
  446. package/lib/core/sql-sync/lock.d.ts +14 -0
  447. package/lib/core/sql-sync/lock.js +1 -1
  448. package/lib/core/sql-sync/types.d.ts +43 -0
  449. package/lib/core/sql-sync/utils.d.ts +10 -0
  450. package/lib/core/sql-sync/utils.js +1 -1
  451. package/lib/core/sql-validator.d.ts +34 -0
  452. package/lib/core/sql-validator.js +1 -1
  453. package/lib/errors.d.ts +3 -0
  454. package/lib/errors.js +1 -1
  455. package/lib/framework/build-all-flags.d.ts +2 -0
  456. package/lib/framework/build-all-flags.js +1 -1
  457. package/lib/framework/error-output.d.ts +9 -0
  458. package/lib/framework/error-output.js +1 -1
  459. package/lib/framework/explicit-yes.d.ts +3 -0
  460. package/lib/framework/explicit-yes.js +1 -1
  461. package/lib/framework/flags.d.ts +3 -0
  462. package/lib/framework/flags.js +1 -1
  463. package/lib/framework/help.d.ts +4 -0
  464. package/lib/framework/help.js +1 -1
  465. package/lib/framework/index.d.ts +11 -0
  466. package/lib/framework/index.js +1 -1
  467. package/lib/framework/output.d.ts +15 -0
  468. package/lib/framework/output.js +1 -1
  469. package/lib/framework/response.d.ts +2 -0
  470. package/lib/framework/response.js +1 -1
  471. package/lib/framework/runner-alias.d.ts +14 -0
  472. package/lib/framework/runner-alias.js +1 -1
  473. package/lib/framework/runner.d.ts +36 -0
  474. package/lib/framework/runner.js +1 -1
  475. package/lib/framework/schema-export.d.ts +3 -0
  476. package/lib/framework/schema-export.js +1 -1
  477. package/lib/framework/types.d.ts +63 -0
  478. package/lib/framework/types.js +1 -1
  479. package/lib/generated/build-info.d.ts +4 -0
  480. package/lib/generated/build-info.js +1 -1
  481. package/lib/help.d.ts +1 -0
  482. package/lib/help.js +1 -1
  483. package/lib/runtime/confirmation.d.ts +4 -0
  484. package/lib/runtime/confirmation.js +1 -0
  485. package/lib/runtime/event.d.ts +5 -0
  486. package/lib/runtime/event.js +1 -0
  487. package/lib/runtime/index.d.ts +7 -0
  488. package/lib/runtime/index.js +1 -0
  489. package/lib/runtime/queue.d.ts +5 -0
  490. package/lib/runtime/queue.js +1 -0
  491. package/lib/runtime/resolve.d.ts +8 -0
  492. package/lib/runtime/resolve.js +1 -0
  493. package/lib/runtime/types.d.ts +50 -0
  494. package/lib/runtime/types.js +1 -0
  495. package/lib/skills/main.d.ts +41 -0
  496. package/lib/skills/main.js +1 -1
  497. package/lib/skills/npx-skills-add.d.ts +99 -0
  498. package/lib/skills/npx-skills-add.js +1 -1
  499. package/lib/skills/skill-presence.d.ts +44 -0
  500. package/lib/skills/skill-presence.js +1 -1
  501. package/lib/telemetry/cli-command-trace.d.ts +12 -0
  502. package/lib/telemetry/cli-command-trace.js +1 -1
  503. package/lib/telemetry/cli-help-trace.d.ts +8 -0
  504. package/lib/telemetry/cli-help-trace.js +1 -1
  505. package/lib/telemetry/ensure-cli-otel-config.d.ts +6 -0
  506. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  507. package/lib/telemetry/register-otel-exit-shutdown.d.ts +3 -0
  508. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  509. package/lib/telemetry/send-cli-trace-log.d.ts +17 -0
  510. package/lib/telemetry/send-cli-trace-log.js +1 -1
  511. package/lib/telemetry/send-platform-issue-collect-log.d.ts +26 -0
  512. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  513. package/lib/types/index.d.ts +93 -0
  514. package/lib/utils/ai_config.d.ts +47 -0
  515. package/lib/utils/ai_config.js +1 -1
  516. package/lib/utils/apply-jq-filter.d.ts +1 -0
  517. package/lib/utils/apply-jq-filter.js +1 -1
  518. package/lib/utils/cdn-config.d.ts +42 -0
  519. package/lib/utils/cdn-config.js +1 -1
  520. package/lib/utils/check-sdk-version.d.ts +23 -0
  521. package/lib/utils/check-sdk-version.js +1 -1
  522. package/lib/utils/cli-version-check.d.ts +37 -0
  523. package/lib/utils/cli-version-check.js +1 -1
  524. package/lib/utils/cli-version-policy.d.ts +9 -0
  525. package/lib/utils/cli-version-policy.js +1 -1
  526. package/lib/utils/config.d.ts +42 -0
  527. package/lib/utils/config.js +1 -1
  528. package/lib/utils/copy-directory.d.ts +1 -0
  529. package/lib/utils/copy-directory.js +1 -1
  530. package/lib/utils/entity-with-id.d.ts +30 -0
  531. package/lib/utils/entity-with-id.js +1 -1
  532. package/lib/utils/file-utils.d.ts +25 -0
  533. package/lib/utils/file-utils.js +1 -1
  534. package/lib/utils/guides-cdn.d.ts +80 -0
  535. package/lib/utils/guides-cdn.js +1 -1
  536. package/lib/utils/http-client.d.ts +30 -0
  537. package/lib/utils/http-client.js +1 -1
  538. package/lib/utils/is-non-interactive.d.ts +7 -0
  539. package/lib/utils/is-non-interactive.js +1 -1
  540. package/lib/utils/logger.d.ts +62 -0
  541. package/lib/utils/logger.js +1 -1
  542. package/lib/utils/params.d.ts +15 -0
  543. package/lib/utils/params.js +1 -1
  544. package/lib/utils/platform.d.ts +21 -0
  545. package/lib/utils/platform.js +1 -1
  546. package/lib/utils/rules-cdn.d.ts +38 -0
  547. package/lib/utils/rules-cdn.js +1 -1
  548. package/lib/utils/sleep.d.ts +1 -0
  549. package/lib/utils/sleep.js +1 -1
  550. package/lib/utils/template-replacer.d.ts +55 -0
  551. package/lib/utils/template-replacer.js +1 -1
  552. package/lib/utils/update-notice.d.ts +10 -0
  553. package/lib/utils/update-notice.js +1 -1
  554. package/lib/utils/version.d.ts +1 -0
  555. package/lib/utils/version.js +1 -1
  556. package/lib/utils/with-active-cookie.d.ts +1 -0
  557. package/lib/utils/with-active-cookie.js +1 -1
  558. package/lib/utils/write-cli-side-channel.d.ts +6 -0
  559. package/lib/utils/write-cli-side-channel.js +1 -1
  560. package/package.json +9 -1
  561. package/lib/commands/page/react/create.js +0 -1
  562. package/lib/commands/page/react/detail.js +0 -1
  563. package/lib/commands/page/react/list.js +0 -1
  564. package/lib/commands/page/react/publish.js +0 -1
  565. package/lib/commands/page/react/shared.js +0 -1
  566. package/lib/commands/page/react/syntax.js +0 -1
  567. package/lib/commands/page/react/template.js +0 -1
  568. package/lib/commands/page/react/update.js +0 -1
@@ -0,0 +1,25 @@
1
+ /**
2
+ * BFF 同步体系 —— 工具函数
3
+ *
4
+ * 纯逻辑工具,不依赖 CLI 交互、cookie、domain 等运行时环境。
5
+ */
6
+ import type { BffLockEntry, HookLocation } from "../../core/bff/types.js";
7
+ export declare function snakeToCamel(value: string): string;
8
+ /**
9
+ * Reverse-lookup a HOOK location from lock entries by remote script ID.
10
+ * Used as fallback when statistics data doesn't cover a given script.
11
+ */
12
+ export declare function findHookLocationByRemoteId(lockFunctions: Record<string, BffLockEntry>, remoteId?: number): HookLocation | undefined;
13
+ /**
14
+ * Extract description from a script's header comment block.
15
+ * Looks for `[脚本描述] xxx` pattern.
16
+ */
17
+ export declare function extractScriptDescription(scriptContent: string): string | undefined;
18
+ /**
19
+ * Validate that a string is a legal JavaScript identifier (for function names).
20
+ */
21
+ export declare function isValidBffFunctionName(functionName: string): boolean;
22
+ /**
23
+ * Normalize HOOK function node to "before" or "after".
24
+ */
25
+ export declare function normalizeHookFunctionNode(functionNode?: string): "before" | "after" | undefined;
@@ -1 +1 @@
1
- function a222_0xdf66(_0x45197a,_0x2d0cbd){_0x45197a=_0x45197a-0xfd;const _0x41eb2f=a222_0x41eb();let _0xdf666=_0x41eb2f[_0x45197a];return _0xdf666;}(function(_0x3d3eed,_0x4cccf2){const _0x10e32e=a222_0xdf66,_0xb02c81=_0x3d3eed();while(!![]){try{const _0x2dc2b3=-parseInt(_0x10e32e(0x110))/0x1*(-parseInt(_0x10e32e(0x102))/0x2)+-parseInt(_0x10e32e(0x104))/0x3+-parseInt(_0x10e32e(0x10d))/0x4+-parseInt(_0x10e32e(0x112))/0x5*(parseInt(_0x10e32e(0x103))/0x6)+-parseInt(_0x10e32e(0xff))/0x7+parseInt(_0x10e32e(0x106))/0x8*(parseInt(_0x10e32e(0x111))/0x9)+parseInt(_0x10e32e(0x108))/0xa;if(_0x2dc2b3===_0x4cccf2)break;else _0xb02c81['push'](_0xb02c81['shift']());}catch(_0x5af131){_0xb02c81['push'](_0xb02c81['shift']());}}}(a222_0x41eb,0x78611));export function snakeToCamel(_0x42daab){const _0x1a37a3=a222_0xdf66;return _0x42daab[_0x1a37a3(0xfe)]()[_0x1a37a3(0x10c)](/_([a-z])/g,(_0xe89aba,_0x1e3f64)=>_0x1e3f64[_0x1a37a3(0x10a)]());}export function findHookLocationByRemoteId(_0x3905eb,_0x570515){const _0x56651c=a222_0xdf66;if(!_0x570515)return undefined;for(const _0x194f14 of Object[_0x56651c(0x105)](_0x3905eb)){if(_0x194f14[_0x56651c(0x10f)]===_0x570515&&_0x194f14[_0x56651c(0xfd)]&&_0x194f14[_0x56651c(0x101)]&&_0x194f14[_0x56651c(0x109)])return{'datasetCode':_0x194f14[_0x56651c(0xfd)],'operationType':_0x194f14['operationType'],'functionNode':_0x194f14['functionNode']};}return undefined;}export function extractScriptDescription(_0x14b783){const _0x4a43c3=a222_0xdf66,_0x4bb2ce=_0x14b783[_0x4a43c3(0x10b)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x4bb2ce?.[0x1]?.[_0x4a43c3(0x10e)]()||undefined;}export function isValidBffFunctionName(_0x4561b3){const _0x20198f=a222_0xdf66;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x20198f(0x100)](_0x4561b3);}export function normalizeHookFunctionNode(_0x8ab0f1){const _0x3d132a=a222_0xdf66;if(!_0x8ab0f1)return undefined;const _0x414866=_0x8ab0f1[_0x3d132a(0x10e)]()[_0x3d132a(0xfe)]();if(_0x414866===_0x3d132a(0x107)||_0x414866==='after')return _0x414866;return undefined;}function a222_0x41eb(){const _0x3f9e4e=['2429036mvimli','trim','remoteId','7JVEjlM','9qEtcks','45UWwjgI','datasetCode','toLowerCase','4568690YwUIAA','test','operationType','256642ffcrEc','117954ZzBWRe','1900863UamOxA','values','6221704TxoHdv','before','8875940hfMVcp','functionNode','toUpperCase','match','replace'];a222_0x41eb=function(){return _0x3f9e4e;};return a222_0x41eb();}
1
+ function a214_0x3b2f(_0x208505,_0x4bf67f){_0x208505=_0x208505-0x133;const _0x5f232d=a214_0x5f23();let _0x3b2f15=_0x5f232d[_0x208505];return _0x3b2f15;}(function(_0x43d924,_0x420b0a){const _0x400593=a214_0x3b2f,_0x135323=_0x43d924();while(!![]){try{const _0x1b945e=-parseInt(_0x400593(0x13c))/0x1*(-parseInt(_0x400593(0x13e))/0x2)+parseInt(_0x400593(0x140))/0x3+parseInt(_0x400593(0x148))/0x4+parseInt(_0x400593(0x136))/0x5*(-parseInt(_0x400593(0x139))/0x6)+-parseInt(_0x400593(0x137))/0x7+parseInt(_0x400593(0x143))/0x8*(parseInt(_0x400593(0x146))/0x9)+parseInt(_0x400593(0x13f))/0xa*(-parseInt(_0x400593(0x142))/0xb);if(_0x1b945e===_0x420b0a)break;else _0x135323['push'](_0x135323['shift']());}catch(_0x37af81){_0x135323['push'](_0x135323['shift']());}}}(a214_0x5f23,0x56b63));export function snakeToCamel(_0x65168f){const _0x345990=a214_0x3b2f;return _0x65168f['toLowerCase']()[_0x345990(0x134)](/_([a-z])/g,(_0x3e141b,_0x295a31)=>_0x295a31[_0x345990(0x147)]());}export function findHookLocationByRemoteId(_0x360eb3,_0x36861f){const _0x165ac0=a214_0x3b2f;if(!_0x36861f)return undefined;for(const _0x23bf40 of Object[_0x165ac0(0x138)](_0x360eb3)){if(_0x23bf40[_0x165ac0(0x13a)]===_0x36861f&&_0x23bf40[_0x165ac0(0x145)]&&_0x23bf40[_0x165ac0(0x135)]&&_0x23bf40[_0x165ac0(0x13d)])return{'datasetCode':_0x23bf40[_0x165ac0(0x145)],'operationType':_0x23bf40[_0x165ac0(0x135)],'functionNode':_0x23bf40[_0x165ac0(0x13d)]};}return undefined;}export function extractScriptDescription(_0x565846){const _0x333a4d=a214_0x3b2f,_0x2d786f=_0x565846[_0x333a4d(0x13b)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x2d786f?.[0x1]?.[_0x333a4d(0x141)]()||undefined;}export function isValidBffFunctionName(_0x21917c){return/^[A-Za-z_$][A-Za-z0-9_$]*$/['test'](_0x21917c);}export function normalizeHookFunctionNode(_0x181459){const _0x5d5c6a=a214_0x3b2f;if(!_0x181459)return undefined;const _0x2b0d64=_0x181459[_0x5d5c6a(0x141)]()['toLowerCase']();if(_0x2b0d64===_0x5d5c6a(0x144)||_0x2b0d64===_0x5d5c6a(0x133))return _0x2b0d64;return undefined;}function a214_0x5f23(){const _0x314301=['remoteId','match','5wVBKkn','functionNode','116718CVAMAu','9492130qUUriY','79095xFYYXo','trim','11NBWIIR','5410968KNAydC','before','datasetCode','9cAiWVl','toUpperCase','2735808dqdjwq','after','replace','operationType','1060InMKgp','180481kAJNYD','values','9858gTKIKF'];a214_0x5f23=function(){return _0x314301;};return a214_0x5f23();}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * 通用数据库解析层
3
+ *
4
+ * 任何需要 dbId 的命令都通过此模块解析:
5
+ * - 传数字 → 直接当 dbId
6
+ * - 传字符串 → 按 dbName 模糊匹配
7
+ * - 不传 → 返回当前应用所有关联数据库
8
+ *
9
+ * 内部通过 dataset list 构建 dbId ↔ dbName 映射,
10
+ * 同一 appCode 在单次 CLI 调用中只请求一次(进程级缓存)。
11
+ */
12
+ export interface DbEntry {
13
+ dbId: number;
14
+ dbName: string;
15
+ }
16
+ /**
17
+ * 获取当前应用的所有数据库连接信息
18
+ */
19
+ export declare function listDatabases(appCode: string): Promise<DbEntry[]>;
20
+ export interface ResolveResult {
21
+ resolved: DbEntry[];
22
+ /** 解析失败时的错误信息(resolved 为空时存在) */
23
+ error?: string;
24
+ }
25
+ /**
26
+ * 解析 --db 参数:
27
+ * - undefined / "" → 返回全部数据库
28
+ * - 纯数字字符串 → 按 dbId 精确匹配
29
+ * - 其他字符串 → 按 dbName 包含匹配(大小写不敏感)
30
+ */
31
+ export declare function resolveDb(appCode: string, dbFlag?: string): Promise<ResolveResult>;
32
+ /**
33
+ * 解析单个数据库(用于 sql create 等必须指定单库的场景)
34
+ * dbFlag 为空时,若应用只有一个数据库则自动选中
35
+ */
36
+ export declare function resolveOneDb(appCode: string, dbFlag?: string): Promise<{
37
+ db: DbEntry | null;
38
+ error?: string;
39
+ }>;
40
+ /**
41
+ * 根据 dbId 查找 dbName(用于输出增强,给纯数字 ID 加上可读名称)
42
+ */
43
+ export declare function getDbName(appCode: string, dbId: number): Promise<string | undefined>;
@@ -1 +1 @@
1
- (function(_0x2f5867,_0x3c81a1){const _0x43cfa6=a223_0x30cb,_0x3e8338=_0x2f5867();while(!![]){try{const _0x1bca8e=-parseInt(_0x43cfa6(0x86))/0x1+-parseInt(_0x43cfa6(0x89))/0x2+parseInt(_0x43cfa6(0x7c))/0x3+parseInt(_0x43cfa6(0x83))/0x4+parseInt(_0x43cfa6(0x75))/0x5*(-parseInt(_0x43cfa6(0x74))/0x6)+parseInt(_0x43cfa6(0x8e))/0x7*(-parseInt(_0x43cfa6(0x7a))/0x8)+parseInt(_0x43cfa6(0x80))/0x9;if(_0x1bca8e===_0x3c81a1)break;else _0x3e8338['push'](_0x3e8338['shift']());}catch(_0x14e053){_0x3e8338['push'](_0x3e8338['shift']());}}}(a223_0x3cd9,0x1c85e));import{listDatasets}from'../core/api-client.js';const cache=new Map();function a223_0x30cb(_0x462989,_0x21ec92){_0x462989=_0x462989-0x71;const _0x3cd9f5=a223_0x3cd9();let _0x30cbad=_0x3cd9f5[_0x462989];return _0x30cbad;}export async function listDatabases(_0x3563d8){const _0x5c6086=a223_0x30cb;if(cache[_0x5c6086(0x73)](_0x3563d8))return cache['get'](_0x3563d8);const _0xded5a4=await listDatasets(_0x3563d8),_0x16929a=new Map();for(const _0x20a644 of _0xded5a4){const _0x43a152=_0x20a644[_0x5c6086(0x81)];_0x43a152?.[_0x5c6086(0x71)]!=null&&_0x16929a['set'](_0x43a152[_0x5c6086(0x71)],_0x43a152[_0x5c6086(0x87)]??_0x5c6086(0x7e)+_0x43a152['dbId']);}const _0xb40526=[..._0x16929a[_0x5c6086(0x79)]()]['map'](([_0xbdb2d6,_0x275db7])=>({'dbId':_0xbdb2d6,'dbName':_0x275db7}));return cache[_0x5c6086(0x76)](_0x3563d8,_0xb40526),_0xb40526;}export async function resolveDb(_0x1249cb,_0x3b118f){const _0x4cb207=a223_0x30cb,_0x13c30f=await listDatabases(_0x1249cb);if(_0x13c30f[_0x4cb207(0x78)]===0x0)return{'resolved':[],'error':_0x4cb207(0x88)+_0x1249cb+'\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.'};if(!_0x3b118f)return{'resolved':_0x13c30f};const _0x4e512e=Number(_0x3b118f);if(!Number['isNaN'](_0x4e512e)){const _0x5ca017=_0x13c30f[_0x4cb207(0x84)](_0x5b7395=>_0x5b7395[_0x4cb207(0x71)]===_0x4e512e);if(_0x5ca017)return{'resolved':[_0x5ca017]};}const _0x396d4c=_0x3b118f[_0x4cb207(0x7f)](),_0x1fe662=_0x13c30f[_0x4cb207(0x8b)](_0x9941c1=>_0x9941c1[_0x4cb207(0x87)]['toLowerCase']()[_0x4cb207(0x72)](_0x396d4c));if(_0x1fe662['length']>0x0)return{'resolved':_0x1fe662};const _0x39fb66=_0x13c30f[_0x4cb207(0x8c)](_0x2f40a6=>_0x2f40a6[_0x4cb207(0x87)]+'\x20('+_0x2f40a6['dbId']+')')[_0x4cb207(0x82)](',\x20');return{'resolved':[],'error':'No\x20database\x20matching\x20\x22'+_0x3b118f+_0x4cb207(0x77)+_0x1249cb+_0x4cb207(0x8a)+_0x39fb66+_0x4cb207(0x7d)};}export async function resolveOneDb(_0x363bbb,_0x469d33){const _0x28794e=a223_0x30cb,{resolved:_0x4210c3,error:_0x4bbada}=await resolveDb(_0x363bbb,_0x469d33);if(_0x4bbada)return{'db':null,'error':_0x4bbada};if(_0x4210c3[_0x28794e(0x78)]===0x1)return{'db':_0x4210c3[0x0]};if(!_0x469d33){const _0x539384=_0x4210c3[_0x28794e(0x8c)](_0x4dd849=>_0x4dd849[_0x28794e(0x87)]+'\x20('+_0x4dd849[_0x28794e(0x71)]+')')[_0x28794e(0x82)](',\x20');return{'db':null,'error':_0x28794e(0x7b)+_0x539384};}const _0x41b47e=_0x4210c3['map'](_0x98e146=>_0x98e146[_0x28794e(0x87)]+'\x20('+_0x98e146[_0x28794e(0x71)]+')')[_0x28794e(0x82)](',\x20');return{'db':null,'error':'\x22'+_0x469d33+_0x28794e(0x85)+_0x41b47e+_0x28794e(0x8d)};}export async function getDbName(_0x4ae8c0,_0x4da092){const _0x1cc085=a223_0x30cb,_0x4bc9d9=await listDatabases(_0x4ae8c0);return _0x4bc9d9[_0x1cc085(0x84)](_0x4afdae=>_0x4afdae[_0x1cc085(0x71)]===_0x4da092)?.[_0x1cc085(0x87)];}function a223_0x3cd9(){const _0x1e0c81=['760710OumIeY','5dPzoJA','set','\x22\x20under\x20app\x20\x22','length','entries','16IOYFdO','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','115281DTcFNJ','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','db-','toLowerCase','5285862eEyKNP','dbtableConfig','join','837580HtPiiD','find','\x22\x20matches\x20multiple\x20databases:\x20','214710GVTwTW','dbName','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','419022KwkEVi','\x22.\x20Available:\x20','filter','map','.\x20Be\x20more\x20specific.','585564QHRePS','dbId','includes','has'];a223_0x3cd9=function(){return _0x1e0c81;};return a223_0x3cd9();}
1
+ (function(_0x3fd628,_0x2c0ea8){const _0x5ea63b=a215_0x322d,_0x5695a6=_0x3fd628();while(!![]){try{const _0x46ab80=-parseInt(_0x5ea63b(0x1f5))/0x1*(parseInt(_0x5ea63b(0x204))/0x2)+parseInt(_0x5ea63b(0x1f8))/0x3+-parseInt(_0x5ea63b(0x1f2))/0x4+parseInt(_0x5ea63b(0x20c))/0x5+-parseInt(_0x5ea63b(0x205))/0x6+-parseInt(_0x5ea63b(0x200))/0x7+-parseInt(_0x5ea63b(0x201))/0x8*(-parseInt(_0x5ea63b(0x203))/0x9);if(_0x46ab80===_0x2c0ea8)break;else _0x5695a6['push'](_0x5695a6['shift']());}catch(_0x2a9ade){_0x5695a6['push'](_0x5695a6['shift']());}}}(a215_0x286b,0x6c4e5));import{listDatasets}from'../core/api-client.js';const cache=new Map();function a215_0x322d(_0xbdb6c9,_0xf26197){_0xbdb6c9=_0xbdb6c9-0x1f2;const _0x286b56=a215_0x286b();let _0x322d0c=_0x286b56[_0xbdb6c9];return _0x322d0c;}export async function listDatabases(_0x48a73d){const _0x21b602=a215_0x322d;if(cache[_0x21b602(0x208)](_0x48a73d))return cache[_0x21b602(0x202)](_0x48a73d);const _0x4866ce=await listDatasets(_0x48a73d),_0xf83f85=new Map();for(const _0x3d5146 of _0x4866ce){const _0x1342c3=_0x3d5146[_0x21b602(0x1fc)];_0x1342c3?.[_0x21b602(0x1fe)]!=null&&_0xf83f85[_0x21b602(0x1fd)](_0x1342c3[_0x21b602(0x1fe)],_0x1342c3[_0x21b602(0x1f3)]??_0x21b602(0x206)+_0x1342c3[_0x21b602(0x1fe)]);}const _0x3ca932=[..._0xf83f85[_0x21b602(0x209)]()][_0x21b602(0x1ff)](([_0x448dbb,_0x340598])=>({'dbId':_0x448dbb,'dbName':_0x340598}));return cache['set'](_0x48a73d,_0x3ca932),_0x3ca932;}function a215_0x286b(){const _0x26da39=['No\x20database\x20matching\x20\x22','dbtableConfig','set','dbId','map','1430660nqIFAA','279944ndiytb','get','252YnwnQO','8fGHDFp','1385178spUVnZ','db-','filter','has','entries','isNaN','toLowerCase','4034600SNMYuf','.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','\x22\x20matches\x20multiple\x20databases:\x20','1418352SEKXIz','dbName','\x22\x20under\x20app\x20\x22','186817kPnVVE','join','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','581988uhkIZJ','length','\x22.\x20Available:\x20'];a215_0x286b=function(){return _0x26da39;};return a215_0x286b();}export async function resolveDb(_0x3c42ca,_0x512d49){const _0x246703=a215_0x322d,_0x1ea2d1=await listDatabases(_0x3c42ca);if(_0x1ea2d1[_0x246703(0x1f9)]===0x0)return{'resolved':[],'error':_0x246703(0x20e)+_0x3c42ca+_0x246703(0x20f)};if(!_0x512d49)return{'resolved':_0x1ea2d1};const _0x5070a4=Number(_0x512d49);if(!Number[_0x246703(0x20a)](_0x5070a4)){const _0x18102d=_0x1ea2d1['find'](_0x1ff6c6=>_0x1ff6c6['dbId']===_0x5070a4);if(_0x18102d)return{'resolved':[_0x18102d]};}const _0x2a13be=_0x512d49['toLowerCase'](),_0x1eb34b=_0x1ea2d1[_0x246703(0x207)](_0x2f7b21=>_0x2f7b21[_0x246703(0x1f3)][_0x246703(0x20b)]()['includes'](_0x2a13be));if(_0x1eb34b[_0x246703(0x1f9)]>0x0)return{'resolved':_0x1eb34b};const _0xecbc7a=_0x1ea2d1['map'](_0x180714=>_0x180714['dbName']+'\x20('+_0x180714['dbId']+')')['join'](',\x20');return{'resolved':[],'error':_0x246703(0x1fb)+_0x512d49+_0x246703(0x1f4)+_0x3c42ca+_0x246703(0x1fa)+_0xecbc7a+_0x246703(0x20d)};}export async function resolveOneDb(_0x1d6a7f,_0x2b9acd){const _0x27bc32=a215_0x322d,{resolved:_0x1ccc98,error:_0x39d85f}=await resolveDb(_0x1d6a7f,_0x2b9acd);if(_0x39d85f)return{'db':null,'error':_0x39d85f};if(_0x1ccc98[_0x27bc32(0x1f9)]===0x1)return{'db':_0x1ccc98[0x0]};if(!_0x2b9acd){const _0x14b0a9=_0x1ccc98[_0x27bc32(0x1ff)](_0x15ec75=>_0x15ec75[_0x27bc32(0x1f3)]+'\x20('+_0x15ec75[_0x27bc32(0x1fe)]+')')[_0x27bc32(0x1f6)](',\x20');return{'db':null,'error':_0x27bc32(0x1f7)+_0x14b0a9};}const _0x16df74=_0x1ccc98['map'](_0x180463=>_0x180463['dbName']+'\x20('+_0x180463[_0x27bc32(0x1fe)]+')')[_0x27bc32(0x1f6)](',\x20');return{'db':null,'error':'\x22'+_0x2b9acd+_0x27bc32(0x210)+_0x16df74+'.\x20Be\x20more\x20specific.'};}export async function getDbName(_0x1a47fe,_0xfc7c46){const _0x35a144=a215_0x322d,_0x10c3e5=await listDatabases(_0x1a47fe);return _0x10c3e5['find'](_0x2dc911=>_0x2dc911[_0x35a144(0x1fe)]===_0xfc7c46)?.[_0x35a144(0x1f3)];}
@@ -0,0 +1,6 @@
1
+ import type { PageProjectConfig } from "../../core/page/types.js";
2
+ export declare function loadPageProjectConfig(appCode: string, cwd?: string): PageProjectConfig;
3
+ export declare function buildPageFileName(pageId: number, type: string): string;
4
+ export declare function resolvePageFilePath(config: PageProjectConfig, pageId: number, type: string): string;
5
+ export declare function ensureParentDirectory(filePath: string): Promise<void>;
6
+ export declare function fileExists(filePath: string): Promise<boolean>;
@@ -1 +1 @@
1
- const a224_0x1d644b=a224_0xe98f;(function(_0x41a296,_0x1bb8fc){const _0x1b3b6c=a224_0xe98f,_0xca9e7d=_0x41a296();while(!![]){try{const _0x382c0d=-parseInt(_0x1b3b6c(0x1b1))/0x1*(-parseInt(_0x1b3b6c(0x1b2))/0x2)+-parseInt(_0x1b3b6c(0x1a4))/0x3*(-parseInt(_0x1b3b6c(0x1ac))/0x4)+-parseInt(_0x1b3b6c(0x1aa))/0x5+parseInt(_0x1b3b6c(0x1ae))/0x6+-parseInt(_0x1b3b6c(0x1a3))/0x7*(parseInt(_0x1b3b6c(0x1b0))/0x8)+-parseInt(_0x1b3b6c(0x1ad))/0x9+parseInt(_0x1b3b6c(0x1a7))/0xa*(-parseInt(_0x1b3b6c(0x1ab))/0xb);if(_0x382c0d===_0x1bb8fc)break;else _0xca9e7d['push'](_0xca9e7d['shift']());}catch(_0xe54c17){_0xca9e7d['push'](_0xca9e7d['shift']());}}}(a224_0x4b0d,0x7de65));import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';function a224_0xe98f(_0x3a356c,_0x572518){_0x3a356c=_0x3a356c-0x1a3;const _0x4b0dff=a224_0x4b0d();let _0xe98ff6=_0x4b0dff[_0x3a356c];return _0xe98ff6;}export function loadPageProjectConfig(_0x158695,_0x3c3356=process[a224_0x1d644b(0x1a8)]()){const _0x3b8d01=a224_0x1d644b,_0x3b841e=resolve(_0x3c3356),_0x22a6bc=join(_0x3b841e,'.rabetbase',_0x3b8d01(0x1a5));return{'projectRoot':_0x3b841e,'pagesBaseDir':_0x22a6bc,'appPagesDir':join(_0x22a6bc,_0x158695),'lockFilePath':join(_0x3b841e,'.rabetbase',_0x3b8d01(0x1af))};}export function buildPageFileName(_0x5107c0,_0x114302){return _0x5107c0+'-'+String(_0x114302)['toUpperCase']()+'.json';}export function resolvePageFilePath(_0x346375,_0xd7b42b,_0x1bee4a){const _0x13effa=a224_0x1d644b;return join(_0x346375[_0x13effa(0x1a9)],buildPageFileName(_0xd7b42b,_0x1bee4a));}function a224_0x4b0d(){const _0x6523dc=['4wcZewJ','283698YUQCSr','1569756tNtIVr','page.lock.json','2980120nZskfv','5vVKjlU','215294yGaltz','7cXHaiR','1417809KJgJSF','page','F_OK','1486770KxWEME','cwd','appPagesDir','1020325GMTrHf','11PuaSSq'];a224_0x4b0d=function(){return _0x6523dc;};return a224_0x4b0d();}export async function ensureParentDirectory(_0x246a5){await mkdir(dirname(_0x246a5),{'recursive':!![]});}export async function fileExists(_0x4fcb54){const _0x2eb7d9=a224_0x1d644b;try{return await access(_0x4fcb54,constants[_0x2eb7d9(0x1a6)]),!![];}catch{return![];}}
1
+ const a216_0x51d4dc=a216_0x13f1;(function(_0x20fff0,_0x46f1f4){const _0x1bc757=a216_0x13f1,_0x51f68f=_0x20fff0();while(!![]){try{const _0x242079=parseInt(_0x1bc757(0x162))/0x1*(parseInt(_0x1bc757(0x16b))/0x2)+parseInt(_0x1bc757(0x168))/0x3+parseInt(_0x1bc757(0x16a))/0x4*(parseInt(_0x1bc757(0x16f))/0x5)+parseInt(_0x1bc757(0x163))/0x6+parseInt(_0x1bc757(0x166))/0x7*(parseInt(_0x1bc757(0x169))/0x8)+-parseInt(_0x1bc757(0x16c))/0x9*(-parseInt(_0x1bc757(0x15e))/0xa)+parseInt(_0x1bc757(0x15f))/0xb*(-parseInt(_0x1bc757(0x160))/0xc);if(_0x242079===_0x46f1f4)break;else _0x51f68f['push'](_0x51f68f['shift']());}catch(_0x57c1c8){_0x51f68f['push'](_0x51f68f['shift']());}}}(a216_0x3395,0x93a81));import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0xc8c978,_0x397218=process[a216_0x51d4dc(0x165)]()){const _0x597f94=a216_0x51d4dc,_0x2b8b7e=resolve(_0x397218),_0x4e0887=join(_0x2b8b7e,_0x597f94(0x16d),_0x597f94(0x161));return{'projectRoot':_0x2b8b7e,'pagesBaseDir':_0x4e0887,'appPagesDir':join(_0x4e0887,_0xc8c978),'lockFilePath':join(_0x2b8b7e,'.rabetbase','page.lock.json')};}function a216_0x13f1(_0x41a3a9,_0x3ee719){_0x41a3a9=_0x41a3a9-0x15e;const _0x3395d7=a216_0x3395();let _0x13f14e=_0x3395d7[_0x41a3a9];return _0x13f14e;}export function buildPageFileName(_0x24275b,_0x1fdc1b){const _0x47abc3=a216_0x51d4dc;return _0x24275b+'-'+String(_0x1fdc1b)['toUpperCase']()+_0x47abc3(0x16e);}export function resolvePageFilePath(_0xa14a41,_0x4736b1,_0x5f29b2){const _0x578396=a216_0x51d4dc;return join(_0xa14a41[_0x578396(0x167)],buildPageFileName(_0x4736b1,_0x5f29b2));}export async function ensureParentDirectory(_0x5227b9){await mkdir(dirname(_0x5227b9),{'recursive':!![]});}function a216_0x3395(){const _0x313df3=['191849RnhXuJ','appPagesDir','2109915BbqVTy','96ozrpZh','406408MXcjjh','10FbzSlG','241308VTwpMq','.rabetbase','.json','10tiCbRu','110vSgtRS','704iZMwrs','370920mIYTNV','page','128665NQrrFo','2456346IPEvfS','F_OK','cwd'];a216_0x3395=function(){return _0x313df3;};return a216_0x3395();}export async function fileExists(_0x56cc82){const _0x847496=a216_0x51d4dc;try{return await access(_0x56cc82,constants[_0x847496(0x164)]),!![];}catch{return![];}}
@@ -0,0 +1,4 @@
1
+ export declare function serializePageSchemaForFile(schema: string): string;
2
+ export declare function computePageContentHash(content: string): string;
3
+ export declare function computeSerializedSchemaHash(schema: string): string;
4
+ export declare function computePageFileHash(filePath: string): Promise<string>;
@@ -1 +1 @@
1
- (function(_0x902ca9,_0x2e7e11){const _0x298b47=a225_0x51ec,_0xcc54d3=_0x902ca9();while(!![]){try{const _0x1418dc=-parseInt(_0x298b47(0x88))/0x1+-parseInt(_0x298b47(0x8d))/0x2*(-parseInt(_0x298b47(0x85))/0x3)+parseInt(_0x298b47(0x90))/0x4+parseInt(_0x298b47(0x91))/0x5*(-parseInt(_0x298b47(0x8e))/0x6)+-parseInt(_0x298b47(0x8f))/0x7*(parseInt(_0x298b47(0x8a))/0x8)+parseInt(_0x298b47(0x8b))/0x9*(-parseInt(_0x298b47(0x84))/0xa)+parseInt(_0x298b47(0x89))/0xb;if(_0x1418dc===_0x2e7e11)break;else _0xcc54d3['push'](_0xcc54d3['shift']());}catch(_0xac65f3){_0xcc54d3['push'](_0xcc54d3['shift']());}}}(a225_0x821d,0x3ad52));import a225_0x260539 from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x24db6e){return JSON['stringify'](JSON['parse'](_0x24db6e),null,0x2)+'\x0a';}function a225_0x821d(){const _0x4b6d3e=['319566aYddzs','14762539MqEUPJ','136utVybC','208296tbgmny','hex','33594tIavTQ','180opTwul','182560hQvagN','161184LNkdfk','59900sIwQXp','30JxNlZT','9pBVTGs','md5','digest'];a225_0x821d=function(){return _0x4b6d3e;};return a225_0x821d();}export function computePageContentHash(_0x5c8938){const _0x325610=a225_0x51ec;return a225_0x260539['createHash'](_0x325610(0x86))['update'](_0x5c8938)[_0x325610(0x87)](_0x325610(0x8c));}function a225_0x51ec(_0x10b5ca,_0x2fbc78){_0x10b5ca=_0x10b5ca-0x84;const _0x821d57=a225_0x821d();let _0x51ecd0=_0x821d57[_0x10b5ca];return _0x51ecd0;}export function computeSerializedSchemaHash(_0x20129d){return computePageContentHash(serializePageSchemaForFile(_0x20129d));}export async function computePageFileHash(_0x29e51b){const _0x58dcaa=await readFile(_0x29e51b,'utf8');return computePageContentHash(_0x58dcaa);}
1
+ function a217_0x4704(_0xefc52f,_0x5c3926){_0xefc52f=_0xefc52f-0xf2;const _0x43d49e=a217_0x43d4();let _0x4704b4=_0x43d49e[_0xefc52f];return _0x4704b4;}(function(_0x188397,_0x5db4d3){const _0x3a0af5=a217_0x4704,_0x109af3=_0x188397();while(!![]){try{const _0x58caa7=parseInt(_0x3a0af5(0xfd))/0x1*(-parseInt(_0x3a0af5(0xf3))/0x2)+parseInt(_0x3a0af5(0xf7))/0x3*(parseInt(_0x3a0af5(0x101))/0x4)+-parseInt(_0x3a0af5(0x100))/0x5+-parseInt(_0x3a0af5(0xfc))/0x6*(parseInt(_0x3a0af5(0xf5))/0x7)+-parseInt(_0x3a0af5(0xf2))/0x8+parseInt(_0x3a0af5(0xf8))/0x9*(-parseInt(_0x3a0af5(0xfa))/0xa)+parseInt(_0x3a0af5(0xfe))/0xb*(parseInt(_0x3a0af5(0xfb))/0xc);if(_0x58caa7===_0x5db4d3)break;else _0x109af3['push'](_0x109af3['shift']());}catch(_0x42a389){_0x109af3['push'](_0x109af3['shift']());}}}(a217_0x43d4,0x38a27));function a217_0x43d4(){const _0x138809=['164129FcCRfD','utf8','183vekilz','9gGfSst','createHash','95590djjKMG','70692MRpaag','102fkriOL','291976jAOqEX','2277VOaVpr','parse','1738200AQJbeW','15116rqKscU','stringify','update','hex','1361656OTixbE','2lqqieH','md5'];a217_0x43d4=function(){return _0x138809;};return a217_0x43d4();}import a217_0x2da018 from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x2ed9a2){const _0x4b940e=a217_0x4704;return JSON[_0x4b940e(0x102)](JSON[_0x4b940e(0xff)](_0x2ed9a2),null,0x2)+'\x0a';}export function computePageContentHash(_0x1dd2e6){const _0x4ddf8d=a217_0x4704;return a217_0x2da018[_0x4ddf8d(0xf9)](_0x4ddf8d(0xf4))[_0x4ddf8d(0x103)](_0x1dd2e6)['digest'](_0x4ddf8d(0x104));}export function computeSerializedSchemaHash(_0x160a81){return computePageContentHash(serializePageSchemaForFile(_0x160a81));}export async function computePageFileHash(_0x44c8c5){const _0x323f86=a217_0x4704,_0x4f9c55=await readFile(_0x44c8c5,_0x323f86(0xf6));return computePageContentHash(_0x4f9c55);}
@@ -0,0 +1,8 @@
1
+ import type { PageLockFile, PageLockScope } from "../../core/page/types.js";
2
+ export declare function createEmptyPageLock(): PageLockFile;
3
+ export declare function ensurePageLockScope(lockData: PageLockFile, appCode: string): {
4
+ lockData: PageLockFile;
5
+ appLock: PageLockScope;
6
+ };
7
+ export declare function readPageLockFile(lockFilePath: string): Promise<PageLockFile | null>;
8
+ export declare function writePageLockFile(lockFilePath: string, lockData: PageLockFile): Promise<void>;
@@ -1 +1 @@
1
- (function(_0x774769,_0x1b50b7){const _0x4465ff=a226_0x2534,_0x3e3f2d=_0x774769();while(!![]){try{const _0x4a92b5=parseInt(_0x4465ff(0x125))/0x1+-parseInt(_0x4465ff(0x128))/0x2+parseInt(_0x4465ff(0x11b))/0x3*(-parseInt(_0x4465ff(0x11c))/0x4)+parseInt(_0x4465ff(0x120))/0x5*(-parseInt(_0x4465ff(0x124))/0x6)+-parseInt(_0x4465ff(0x11e))/0x7+parseInt(_0x4465ff(0x127))/0x8+parseInt(_0x4465ff(0x122))/0x9;if(_0x4a92b5===_0x1b50b7)break;else _0x3e3f2d['push'](_0x3e3f2d['shift']());}catch(_0xe91e8d){_0x3e3f2d['push'](_0x3e3f2d['shift']());}}}(a226_0xd9ba,0xbf2d9));function a226_0x2534(_0xcf8232,_0x30e2ae){_0xcf8232=_0xcf8232-0x11a;const _0xd9ba42=a226_0xd9ba();let _0x2534a5=_0xd9ba42[_0xcf8232];return _0x2534a5;}import{mkdir,readFile,writeFile}from'node:fs/promises';function a226_0xd9ba(){const _0x1a4df4=['308956FepFKj','parse','ENOENT','code','apps','pages','2055nGOfZa','8116AYGXtz','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','2182509aJkNhy','stringify','80285UWspvE','object','12378978ciufoA','utf8','90qBRiFF','1395391DzWrmn','lastSync','873736GLlKHR'];a226_0xd9ba=function(){return _0x1a4df4;};return a226_0xd9ba();}import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x28ba42,_0x391e1e){const _0x5e006d=a226_0x2534,_0x5d5f77={'apps':_0x28ba42['apps']&&typeof _0x28ba42['apps']===_0x5e006d(0x121)?_0x28ba42[_0x5e006d(0x12c)]:{}};let _0x141886=_0x5d5f77[_0x5e006d(0x12c)][_0x391e1e];if(!_0x141886)return _0x141886={'lastSync':'','pages':{}},_0x5d5f77[_0x5e006d(0x12c)][_0x391e1e]=_0x141886,{'lockData':_0x5d5f77,'appLock':_0x141886};return!_0x141886[_0x5e006d(0x126)]&&(_0x141886[_0x5e006d(0x126)]=''),(!_0x141886[_0x5e006d(0x11a)]||typeof _0x141886[_0x5e006d(0x11a)]!==_0x5e006d(0x121))&&(_0x141886[_0x5e006d(0x11a)]={}),{'lockData':_0x5d5f77,'appLock':_0x141886};}export async function readPageLockFile(_0x2914a6){const _0x1da334=a226_0x2534;try{const _0x30cb13=await readFile(_0x2914a6,_0x1da334(0x123)),_0x264721=JSON[_0x1da334(0x129)](_0x30cb13);return{'apps':_0x264721[_0x1da334(0x12c)]&&typeof _0x264721[_0x1da334(0x12c)]===_0x1da334(0x121)?_0x264721[_0x1da334(0x12c)]:{}};}catch(_0x54898b){if(_0x54898b[_0x1da334(0x12b)]===_0x1da334(0x12a))return null;throw new Error(_0x1da334(0x11d)+String(_0x54898b));}}export async function writePageLockFile(_0x20e58f,_0x3c0cad){const _0x486cb6=a226_0x2534;await mkdir(dirname(_0x20e58f),{'recursive':!![]}),await writeFile(_0x20e58f,JSON[_0x486cb6(0x11f)](_0x3c0cad,null,0x2),_0x486cb6(0x123));}
1
+ (function(_0x32e002,_0x44e809){const _0x3322c6=a218_0x5a1f,_0x532e51=_0x32e002();while(!![]){try{const _0x19c5a1=-parseInt(_0x3322c6(0x1ad))/0x1+-parseInt(_0x3322c6(0x1a0))/0x2+-parseInt(_0x3322c6(0x1ae))/0x3*(parseInt(_0x3322c6(0x19e))/0x4)+parseInt(_0x3322c6(0x1a8))/0x5*(parseInt(_0x3322c6(0x1a5))/0x6)+-parseInt(_0x3322c6(0x1a2))/0x7*(-parseInt(_0x3322c6(0x19f))/0x8)+parseInt(_0x3322c6(0x1a3))/0x9+parseInt(_0x3322c6(0x1ac))/0xa*(-parseInt(_0x3322c6(0x1aa))/0xb);if(_0x19c5a1===_0x44e809)break;else _0x532e51['push'](_0x532e51['shift']());}catch(_0x3d861c){_0x532e51['push'](_0x532e51['shift']());}}}(a218_0x2087,0xaebdf));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a218_0x5a1f(_0x352f20,_0x5c82b1){_0x352f20=_0x352f20-0x19d;const _0x208754=a218_0x2087();let _0x5a1fba=_0x208754[_0x352f20];return _0x5a1fba;}function a218_0x2087(){const _0x1de809=['apps','2226WHXIuf','code','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','18565tGSdKW','pages','568084bPYAHU','parse','10jAlVfq','789730dwMRLU','371502WohMQA','object','utf8','8QNmoBf','1496gtckpy','1862404nbPZbE','lastSync','9100IQWGSx','10038276wayRlN'];a218_0x2087=function(){return _0x1de809;};return a218_0x2087();}export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x43a495,_0xb5399){const _0x3c236d=a218_0x5a1f,_0x3eedb2={'apps':_0x43a495[_0x3c236d(0x1a4)]&&typeof _0x43a495[_0x3c236d(0x1a4)]===_0x3c236d(0x1af)?_0x43a495['apps']:{}};let _0x5434bc=_0x3eedb2[_0x3c236d(0x1a4)][_0xb5399];if(!_0x5434bc)return _0x5434bc={'lastSync':'','pages':{}},_0x3eedb2['apps'][_0xb5399]=_0x5434bc,{'lockData':_0x3eedb2,'appLock':_0x5434bc};return!_0x5434bc['lastSync']&&(_0x5434bc[_0x3c236d(0x1a1)]=''),(!_0x5434bc['pages']||typeof _0x5434bc[_0x3c236d(0x1a9)]!==_0x3c236d(0x1af))&&(_0x5434bc['pages']={}),{'lockData':_0x3eedb2,'appLock':_0x5434bc};}export async function readPageLockFile(_0x375ddb){const _0x590d42=a218_0x5a1f;try{const _0x5b3adf=await readFile(_0x375ddb,_0x590d42(0x19d)),_0x46574d=JSON[_0x590d42(0x1ab)](_0x5b3adf);return{'apps':_0x46574d[_0x590d42(0x1a4)]&&typeof _0x46574d[_0x590d42(0x1a4)]===_0x590d42(0x1af)?_0x46574d['apps']:{}};}catch(_0x214c19){if(_0x214c19[_0x590d42(0x1a6)]==='ENOENT')return null;throw new Error(_0x590d42(0x1a7)+String(_0x214c19));}}export async function writePageLockFile(_0x46dc82,_0x224f2c){const _0x20cbd6=a218_0x5a1f;await mkdir(dirname(_0x46dc82),{'recursive':!![]}),await writeFile(_0x46dc82,JSON['stringify'](_0x224f2c,null,0x2),_0x20cbd6(0x19d));}
@@ -0,0 +1,22 @@
1
+ export interface PageProjectConfig {
2
+ projectRoot: string;
3
+ pagesBaseDir: string;
4
+ appPagesDir: string;
5
+ lockFilePath: string;
6
+ }
7
+ export interface PageLockEntry {
8
+ hash: string;
9
+ pageId: number;
10
+ pageVersion?: number | null;
11
+ type: string;
12
+ title: string;
13
+ datasetIds: number[];
14
+ versionTag?: string | null;
15
+ }
16
+ export interface PageLockScope {
17
+ lastSync: string;
18
+ pages: Record<string, PageLockEntry>;
19
+ }
20
+ export interface PageLockFile {
21
+ apps: Record<string, PageLockScope>;
22
+ }
@@ -0,0 +1,33 @@
1
+ export interface SqlIndexMetadata {
2
+ name?: string;
3
+ type?: string;
4
+ columns: string[];
5
+ }
6
+ export interface SqlTableIndexMetadata {
7
+ tableName: string;
8
+ indexes: SqlIndexMetadata[];
9
+ metadataAvailable?: boolean;
10
+ }
11
+ export interface SqlJoinIndexAuditResult {
12
+ checked: boolean;
13
+ joins: SqlJoinIndexCheck[];
14
+ warnings: SqlJoinIndexWarning[];
15
+ }
16
+ export interface SqlJoinIndexCheck {
17
+ table: string;
18
+ alias: string;
19
+ columns: string[];
20
+ status: "covered" | "warning" | "unavailable";
21
+ matchedIndex?: SqlIndexMetadata & {
22
+ matchedPrefix: string[];
23
+ };
24
+ candidateIndexes?: SqlIndexMetadata[];
25
+ }
26
+ export interface SqlJoinIndexWarning {
27
+ code: "JOIN_INDEX_MISSING" | "JOIN_INDEX_NOT_USABLE" | "INDEX_METADATA_UNAVAILABLE" | "JOIN_PREDICATE_UNSUPPORTED";
28
+ table: string;
29
+ alias: string;
30
+ columns: string[];
31
+ reason: string;
32
+ }
33
+ export declare function auditSqlJoinIndexes(sqlContent: string, tables: SqlTableIndexMetadata[]): SqlJoinIndexAuditResult;
@@ -1 +1 @@
1
- (function(_0x347e4a,_0x5bcf4c){const _0x46a2e1=a228_0x56d2,_0x197a08=_0x347e4a();while(!![]){try{const _0x18fba5=parseInt(_0x46a2e1(0x1a7))/0x1*(-parseInt(_0x46a2e1(0x1bf))/0x2)+-parseInt(_0x46a2e1(0x1b4))/0x3+parseInt(_0x46a2e1(0x191))/0x4+-parseInt(_0x46a2e1(0x17c))/0x5*(-parseInt(_0x46a2e1(0x188))/0x6)+parseInt(_0x46a2e1(0x18f))/0x7+-parseInt(_0x46a2e1(0x17a))/0x8*(parseInt(_0x46a2e1(0x187))/0x9)+parseInt(_0x46a2e1(0x17e))/0xa;if(_0x18fba5===_0x5bcf4c)break;else _0x197a08['push'](_0x197a08['shift']());}catch(_0x2f2be3){_0x197a08['push'](_0x197a08['shift']());}}}(a228_0x62fc,0x1b1f1));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x2a43de,_0x2175fc){const _0x42db26=a228_0x56d2,_0x708081=[],_0x2c004b=normalizeSqlForStaticAnalysis(_0x2a43de),_0x18755c=(_0x2c004b[_0x42db26(0x182)]?[]:extractJoinFacts(_0x2c004b[_0x42db26(0x1b2)]))[_0x42db26(0x1b9)](_0x1179cf=>{const _0x349f87=_0x42db26;if(_0x1179cf[_0x349f87(0x181)]||_0x1179cf[_0x349f87(0x193)][_0x349f87(0x1a2)]===0x0)return _0x708081[_0x349f87(0x1a4)]({'code':_0x349f87(0x19c),'table':_0x1179cf[_0x349f87(0x1ad)],'alias':_0x1179cf[_0x349f87(0x1a5)],'columns':_0x1179cf['columns'],'reason':_0x1179cf['unsupportedReason']??_0x349f87(0x1bb)}),{'table':_0x1179cf[_0x349f87(0x1ad)],'alias':_0x1179cf['alias'],'columns':_0x1179cf[_0x349f87(0x193)],'status':_0x349f87(0x1af)};const _0x21450d=resolveTableMetadata(_0x2175fc,_0x1179cf['table']),_0x3f20c7=(_0x21450d?.[_0x349f87(0x1a1)]??[])['map'](_0x248220=>({'index':_0x248220,'matchedPrefix':findEqualityPrefix(_0x248220[_0x349f87(0x193)],_0x1179cf['columns'])}))[_0x349f87(0x19d)](_0x17f7e0=>_0x17f7e0[_0x349f87(0x18d)][_0x349f87(0x1a2)]>0x0),_0x489fc4=_0x3f20c7[_0x349f87(0x1b3)]((_0x73210e,_0x1fa26d)=>!_0x73210e||_0x1fa26d[_0x349f87(0x18d)]['length']>_0x73210e[_0x349f87(0x18d)][_0x349f87(0x1a2)]?_0x1fa26d:_0x73210e,_0x3f20c7[0x0]);if(_0x489fc4)return{'table':_0x1179cf[_0x349f87(0x1ad)],'alias':_0x1179cf[_0x349f87(0x1a5)],'columns':_0x1179cf[_0x349f87(0x193)],'status':'covered','matchedIndex':{..._0x489fc4[_0x349f87(0x1b7)],'matchedPrefix':_0x489fc4[_0x349f87(0x18d)]}};const _0xc92bb=_0x21450d?.[_0x349f87(0x1a1)][_0x349f87(0x19d)](_0x39f440=>_0x39f440[_0x349f87(0x193)][_0x349f87(0x190)](_0xa4e53c=>_0x1179cf['columns'][_0x349f87(0x190)](_0x4fc6f4=>columnNamesMatch(_0xa4e53c,_0x4fc6f4))))??[];if(_0xc92bb[_0x349f87(0x1a2)]>0x0)return _0x708081[_0x349f87(0x1a4)]({'code':_0x349f87(0x1b0),'table':_0x1179cf[_0x349f87(0x1ad)],'alias':_0x1179cf['alias'],'columns':_0x1179cf[_0x349f87(0x193)],'reason':'Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.'}),{'table':_0x1179cf['table'],'alias':_0x1179cf[_0x349f87(0x1a5)],'columns':_0x1179cf[_0x349f87(0x193)],'status':_0x349f87(0x1ba),'candidateIndexes':_0xc92bb};if(_0x21450d&&_0x21450d[_0x349f87(0x17f)]!==![]&&_0x21450d['indexes']['length']>0x0&&_0x1179cf[_0x349f87(0x193)]['length']>0x0)return _0x708081[_0x349f87(0x1a4)]({'code':'JOIN_INDEX_MISSING','table':_0x1179cf['table'],'alias':_0x1179cf[_0x349f87(0x1a5)],'columns':_0x1179cf[_0x349f87(0x193)],'reason':_0x349f87(0x1c0)}),{'table':_0x1179cf[_0x349f87(0x1ad)],'alias':_0x1179cf[_0x349f87(0x1a5)],'columns':_0x1179cf[_0x349f87(0x193)],'status':_0x349f87(0x1ba)};return _0x708081[_0x349f87(0x1a4)]({'code':_0x349f87(0x183),'table':_0x1179cf[_0x349f87(0x1ad)],'alias':_0x1179cf[_0x349f87(0x1a5)],'columns':_0x1179cf[_0x349f87(0x193)],'reason':_0x21450d?_0x349f87(0x1a3):'No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.'}),{'table':_0x1179cf[_0x349f87(0x1ad)],'alias':_0x1179cf[_0x349f87(0x1a5)],'columns':_0x1179cf[_0x349f87(0x193)],'status':_0x349f87(0x1af)};});return{'checked':_0x18755c[_0x42db26(0x1a2)]>0x0,'joins':_0x18755c,'warnings':_0x708081};}function extractJoinFacts(_0x15c1c1){const _0x5e7570=a228_0x56d2,_0x147dc3=maskNestedQueries(stripSqlNoise(_0x15c1c1)),_0x3fe185=maskQuotedIdentifiers(_0x147dc3),_0x1c9dfd=[],_0x5f5b0f=new Set(),_0x30cb2b=/\b(?:(INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?\s+ON\s+([\s\S]*?)(?=\s+(?:(?:(?:INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\b|(?:WHERE|GROUP\s+BY|ORDER\s+BY|HAVING|LIMIT|UNION)\b)|;|$)/gi;for(const _0x5af2ff of _0x147dc3[_0x5e7570(0x1a9)](_0x30cb2b)){const _0x1aa214=_0x5af2ff[_0x5e7570(0x1b7)]??0x0,_0x312d62=_0x5af2ff[0x0][_0x5e7570(0x195)](/\bJOIN\b/i),_0x175c9d=_0x1aa214+Math[_0x5e7570(0x1b5)](0x0,_0x312d62);if(!/^JOIN\b/i[_0x5e7570(0x184)](_0x3fe185[_0x5e7570(0x192)](_0x175c9d)))continue;_0x5f5b0f[_0x5e7570(0x1ab)](_0x175c9d);const _0x50817a=normalizeIdentifier(_0x5af2ff[0x1]||_0x5e7570(0x19a)),_0x39aed2=normalizeIdentifier(_0x5af2ff[0x2]??''),_0x5ef2e2=normalizeIdentifier(_0x5af2ff[0x3]||_0x39aed2[_0x5e7570(0x17b)]('.')['at'](-0x1)||_0x39aed2),_0x4611d8=[],_0x1aaf63=_0x39aed2==='__sq__';let _0x524e60=_0x50817a===_0x5e7570(0x1c5)||_0x50817a==='full'||_0x1aaf63,_0x558f39=_0x524e60?_0x1aaf63?'Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.':_0x50817a[_0x5e7570(0x199)]()+_0x5e7570(0x1bd):undefined;const _0x289afa=stripOuterParentheses(_0x5af2ff[0x4]??''),_0x51cb4a=_0x289afa['includes'](MYBATIS_DYNAMIC_START_MARKER)||_0x289afa['includes'](MYBATIS_DYNAMIC_END_MARKER),_0x422cba=_0x289afa[_0x5e7570(0x1a0)](MYBATIS_INCLUDE_MARKER);_0x51cb4a&&(_0x524e60=!![],_0x558f39??=_0x5e7570(0x197));_0x422cba&&(_0x524e60=!![],_0x558f39??=_0x5e7570(0x1aa));const _0xf568fd=_0x289afa[_0x5e7570(0x189)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x5e7570(0x189)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x5e7570(0x189)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0xf568fd,'OR')&&(_0x524e60=!![],_0x558f39??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.');for(const _0x12e8b3 of splitTopLevelAnd(_0xf568fd)){const _0x269467=stripOuterParentheses(_0x12e8b3);if(hasTopLevelKeyword(_0x269467,'OR')){_0x524e60=!![],_0x558f39??=_0x5e7570(0x1c2);continue;}const _0x1fbdf9=splitEquality(_0x269467);if(!_0x1fbdf9){containsColumnReference(_0x12e8b3,_0x5ef2e2)&&(_0x524e60=!![]);continue;}const _0x257da6=parseDirectColumnReference(_0x1fbdf9[0x0],_0x5ef2e2),_0x5ad8e3=parseDirectColumnReference(_0x1fbdf9[0x1],_0x5ef2e2),_0x3fc40c=containsColumnReference(_0x1fbdf9[0x0],_0x5ef2e2),_0x55bdc2=containsColumnReference(_0x1fbdf9[0x1],_0x5ef2e2),_0x517615=_0x257da6&&!_0x55bdc2?_0x257da6:_0x5ad8e3&&!_0x3fc40c?_0x5ad8e3:null;if(_0x517615&&!_0x4611d8['includes'](_0x517615))_0x4611d8[_0x5e7570(0x1a4)](_0x517615);else!_0x517615&&containsColumnReference(_0x12e8b3,_0x5ef2e2)&&(_0x524e60=!![]);}_0x1c9dfd[_0x5e7570(0x1a4)]({'table':_0x39aed2,'alias':_0x5ef2e2,'columns':_0x4611d8,'unsupportedPredicate':_0x524e60,'unsupportedReason':_0x558f39,'containsUnresolvedInclude':_0x422cba,'position':_0x175c9d});}for(const _0x2c2575 of _0x3fe185[_0x5e7570(0x1a9)](/\bJOIN\b/gi)){const _0x367101=_0x2c2575['index']??0x0;if(_0x5f5b0f[_0x5e7570(0x1b8)](_0x367101))continue;const _0x206e5e=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x5e7570(0x198)](_0x147dc3[_0x5e7570(0x192)](_0x367101+_0x2c2575[0x0]['length'])),_0x5725bb=normalizeIdentifier(_0x206e5e?.[0x1]||_0x5e7570(0x194)),_0x21efce=normalizeIdentifier(_0x206e5e?.[0x2]||''),_0x18af19=isSqlClauseKeyword(_0x21efce)?_0x5725bb['split']('.')['at'](-0x1)||_0x5725bb:_0x21efce||_0x5725bb[_0x5e7570(0x17b)]('.')['at'](-0x1)||_0x5725bb;_0x1c9dfd[_0x5e7570(0x1a4)]({'table':_0x5725bb,'alias':_0x18af19,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','position':_0x367101});}const _0x397146=_0x3fe185[_0x5e7570(0x196)](MYBATIS_INCLUDE_MARKER);return _0x397146>=0x0&&!_0x1c9dfd[_0x5e7570(0x190)](_0xa437cf=>_0xa437cf[_0x5e7570(0x1ac)])&&_0x1c9dfd[_0x5e7570(0x1a4)]({'table':_0x5e7570(0x194),'alias':_0x5e7570(0x194),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x5e7570(0x18a),'containsUnresolvedInclude':!![],'position':_0x397146}),_0x1c9dfd[_0x5e7570(0x19b)]((_0x4caec5,_0x523d5e)=>_0x4caec5[_0x5e7570(0x19f)]-_0x523d5e[_0x5e7570(0x19f)]);}function stripSqlNoise(_0x5baa9d){const _0x429ea6=a228_0x56d2,_0x136bda=Array[_0x429ea6(0x1c1)](_0x5baa9d),_0x156334=(_0x2c8fee,_0x3a97fd)=>{for(let _0x239a0a=_0x2c8fee;_0x239a0a<_0x3a97fd;_0x239a0a+=0x1){_0x136bda[_0x239a0a]!=='\x0a'&&_0x136bda[_0x239a0a]!=='\x0d'&&(_0x136bda[_0x239a0a]='\x20');}};for(let _0x17f0f1=0x0;_0x17f0f1<_0x136bda[_0x429ea6(0x1a2)];_0x17f0f1+=0x1){const _0x51ff6a=_0x136bda[_0x17f0f1],_0x3d51dc=_0x136bda[_0x17f0f1+0x1];if(_0x51ff6a==='\x27'||_0x51ff6a==='\x22'||_0x51ff6a==='`'){const _0x1cb5ab=_0x51ff6a,_0x1f2355=_0x17f0f1;_0x17f0f1+=0x1;while(_0x17f0f1<_0x136bda['length']){if(_0x136bda[_0x17f0f1]==='\x5c'&&_0x17f0f1+0x1<_0x136bda[_0x429ea6(0x1a2)]){_0x17f0f1+=0x2;continue;}if(_0x136bda[_0x17f0f1]!==_0x1cb5ab){_0x17f0f1+=0x1;continue;}if(_0x136bda[_0x17f0f1+0x1]===_0x1cb5ab){_0x17f0f1+=0x2;continue;}break;}if(_0x1cb5ab==='\x27')_0x156334(_0x1f2355,Math['min'](_0x17f0f1+0x1,_0x136bda['length']));continue;}if(_0x51ff6a==='-'&&_0x3d51dc==='-'){const _0x420710=_0x17f0f1;while(_0x17f0f1<_0x136bda[_0x429ea6(0x1a2)]&&_0x136bda[_0x17f0f1]!=='\x0a')_0x17f0f1+=0x1;_0x156334(_0x420710,_0x17f0f1);continue;}if(_0x51ff6a==='/'&&_0x3d51dc==='*'){const _0x29a761=_0x17f0f1;_0x17f0f1+=0x2;while(_0x17f0f1<_0x136bda['length']&&!(_0x136bda[_0x17f0f1]==='*'&&_0x136bda[_0x17f0f1+0x1]==='/')){_0x17f0f1+=0x1;}_0x17f0f1=Math[_0x429ea6(0x1bc)](_0x17f0f1+0x1,_0x136bda[_0x429ea6(0x1a2)]-0x1),_0x156334(_0x29a761,_0x17f0f1+0x1);continue;}if(_0x51ff6a==='#'&&_0x3d51dc!=='{'){const _0x19b8a8=_0x17f0f1;while(_0x17f0f1<_0x136bda[_0x429ea6(0x1a2)]&&_0x136bda[_0x17f0f1]!=='\x0a')_0x17f0f1+=0x1;_0x156334(_0x19b8a8,_0x17f0f1);continue;}if((_0x51ff6a==='#'||_0x51ff6a==='$')&&_0x3d51dc==='{'){const _0xec5a17=_0x17f0f1;_0x17f0f1+=0x2;while(_0x17f0f1<_0x136bda[_0x429ea6(0x1a2)]&&_0x136bda[_0x17f0f1]!=='}')_0x17f0f1+=0x1;_0x156334(_0xec5a17,Math[_0x429ea6(0x1bc)](_0x17f0f1+0x1,_0x136bda[_0x429ea6(0x1a2)]));}}return _0x136bda[_0x429ea6(0x1b6)]('');}function maskQuotedIdentifiers(_0x2a9e46){const _0x1938e6=a228_0x56d2,_0x1122c6=Array[_0x1938e6(0x1c1)](_0x2a9e46);for(let _0x3ba276=0x0;_0x3ba276<_0x1122c6[_0x1938e6(0x1a2)];_0x3ba276+=0x1){const _0x1cca85=_0x1122c6[_0x3ba276];if(_0x1cca85!=='\x22'&&_0x1cca85!=='`')continue;_0x3ba276+=0x1;while(_0x3ba276<_0x1122c6['length']){if(_0x1122c6[_0x3ba276]===_0x1cca85){if(_0x1122c6[_0x3ba276+0x1]===_0x1cca85){_0x1122c6[_0x3ba276]='\x20',_0x1122c6[_0x3ba276+0x1]='\x20',_0x3ba276+=0x2;continue;}break;}_0x1122c6[_0x3ba276]='\x20',_0x3ba276+=0x1;}}return _0x1122c6['join']('');}function maskNestedQueries(_0x58518f){const _0x473ad6=a228_0x56d2,_0x3c57ee=Array[_0x473ad6(0x1c1)](_0x58518f);for(let _0x44cc43=0x0;_0x44cc43<_0x3c57ee[_0x473ad6(0x1a2)];_0x44cc43+=0x1){if(_0x3c57ee[_0x44cc43]!=='(')continue;const _0x2330e8=_0x58518f[_0x473ad6(0x192)](_0x44cc43+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x473ad6(0x184)](_0x2330e8))continue;let _0x55f01b=0x1,_0x39139=_0x44cc43+0x1;for(;_0x39139<_0x3c57ee[_0x473ad6(0x1a2)]&&_0x55f01b>0x0;_0x39139+=0x1){if(_0x3c57ee[_0x39139]==='(')_0x55f01b+=0x1;if(_0x3c57ee[_0x39139]===')')_0x55f01b-=0x1;}if(_0x55f01b!==0x0)continue;for(let _0x14d3ae=_0x44cc43;_0x14d3ae<_0x39139;_0x14d3ae+=0x1){_0x3c57ee[_0x14d3ae]='\x20';}const _0x11d1ce=_0x473ad6(0x1a6);for(let _0x52059e=0x0;_0x52059e<_0x11d1ce[_0x473ad6(0x1a2)]&&_0x44cc43+_0x52059e<_0x39139;_0x52059e+=0x1){_0x3c57ee[_0x44cc43+_0x52059e]=_0x11d1ce[_0x52059e];}_0x44cc43=_0x39139-0x1;}return _0x3c57ee[_0x473ad6(0x1b6)]('');}function a228_0x62fc(){const _0x50e613=['unavailable','JOIN_INDEX_NOT_USABLE','(?:^|[^\x5cw$])','sql','reduce','385317OkknVA','max','join','index','has','map','warning','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','min','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','\x5c$&','8044pKmxpx','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','from','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','replace','inner','right','cross','1126648pKLRyF','split','5BpeBxi','natural','1519210gJvtmL','metadataAvailable','toLowerCase','unsupportedPredicate','error','INDEX_METADATA_UNAVAILABLE','test','match','startsWith','9IujrWw','880266gMHGJg','replaceAll','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','endsWith','trim','matchedPrefix','left','1164023mlaTBN','some','433976NkbWri','slice','columns','unknown','search','indexOf','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','exec','toUpperCase','INNER','sort','JOIN_PREDICATE_UNSUPPORTED','filter','tableName','position','includes','indexes','length','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','push','alias','__sq__','48PekBOC','where','matchAll','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','add','containsUnresolvedInclude','table','\x5cs*\x5c.\x5cs*[\x5cw$]+'];a228_0x62fc=function(){return _0x50e613;};return a228_0x62fc();}function splitTopLevelAnd(_0x4bf84b){const _0x457f94=a228_0x56d2,_0x3e65c4=[];let _0x4ab47f=0x0,_0x1a2100=0x0;for(let _0x216bae=0x0;_0x216bae<_0x4bf84b['length'];_0x216bae+=0x1){const _0x24da33=_0x4bf84b[_0x216bae];if(_0x24da33==='(')_0x4ab47f+=0x1;if(_0x24da33===')')_0x4ab47f=Math[_0x457f94(0x1b5)](0x0,_0x4ab47f-0x1);_0x4ab47f===0x0&&_0x4bf84b[_0x457f94(0x192)](_0x216bae)[_0x457f94(0x185)](/^AND\b/i)&&(_0x216bae===0x0||/\s/['test'](_0x4bf84b[_0x216bae-0x1]??''))&&(_0x3e65c4[_0x457f94(0x1a4)](_0x4bf84b[_0x457f94(0x192)](_0x1a2100,_0x216bae)[_0x457f94(0x18c)]()),_0x216bae+=0x2,_0x1a2100=_0x216bae+0x1);}const _0x5515a7=_0x4bf84b[_0x457f94(0x192)](_0x1a2100)[_0x457f94(0x18c)]();if(_0x5515a7)_0x3e65c4[_0x457f94(0x1a4)](_0x5515a7);return _0x3e65c4;}function hasTopLevelKeyword(_0x172318,_0x5df640){const _0x449222=a228_0x56d2;let _0x4293f8=0x0;for(let _0xfde014=0x0;_0xfde014<_0x172318[_0x449222(0x1a2)];_0xfde014+=0x1){const _0x3d7320=_0x172318[_0xfde014];if(_0x3d7320==='(')_0x4293f8+=0x1;if(_0x3d7320===')')_0x4293f8=Math[_0x449222(0x1b5)](0x0,_0x4293f8-0x1);if(_0x4293f8!==0x0)continue;const _0x5c9545=_0x172318['slice'](_0xfde014,_0xfde014+_0x5df640[_0x449222(0x1a2)]),_0x4f56fe=_0x172318[_0xfde014-0x1]??'\x20',_0x8e44ed=_0x172318[_0xfde014+_0x5df640[_0x449222(0x1a2)]]??'\x20';if(_0x5c9545['toUpperCase']()===_0x5df640[_0x449222(0x199)]()&&!/[\w$]/[_0x449222(0x184)](_0x4f56fe)&&!/[\w$]/[_0x449222(0x184)](_0x8e44ed))return!![];}return![];}function splitEquality(_0x31a41d){const _0x5df498=a228_0x56d2,_0x123d79=stripOuterParentheses(_0x31a41d);let _0x45b9ab=0x0,_0x342381;for(let _0x68ce37=0x0;_0x68ce37<_0x123d79[_0x5df498(0x1a2)];_0x68ce37+=0x1){const _0x308862=_0x123d79[_0x68ce37];if(_0x308862==='(')_0x45b9ab+=0x1;if(_0x308862===')')_0x45b9ab=Math[_0x5df498(0x1b5)](0x0,_0x45b9ab-0x1);const _0x3a9aa8=_0x123d79[_0x68ce37-0x1]??'',_0x4bd6a9=_0x123d79[_0x68ce37+0x1]??'';if(_0x308862==='='&&_0x45b9ab===0x0&&!/[!<>=:]/[_0x5df498(0x184)](_0x3a9aa8)&&_0x4bd6a9!=='='){if(_0x342381!==undefined)return null;_0x342381=_0x68ce37;}}return _0x342381===undefined?null:[_0x123d79['slice'](0x0,_0x342381)[_0x5df498(0x18c)](),_0x123d79[_0x5df498(0x192)](_0x342381+0x1)[_0x5df498(0x18c)]()];}function parseDirectColumnReference(_0x2a5bad,_0x32e1af){const _0x524139=a228_0x56d2,_0x157812=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x524139(0x198)](stripOuterParentheses(_0x2a5bad));if(!_0x157812)return null;if(normalizeIdentifier(_0x157812[0x1]??'')!==normalizeIdentifier(_0x32e1af))return null;return normalizeIdentifier(_0x157812[0x2]??'');}function containsColumnReference(_0x150c39,_0x25bb8f){const _0x300dd4=a228_0x56d2,_0x284a51=_0x150c39['replace'](/[`"]/g,''),_0x1f7503=_0x25bb8f[_0x300dd4(0x1c3)](/[.*+?^${}()|[\]\\]/g,_0x300dd4(0x1be));return new RegExp(_0x300dd4(0x1b1)+_0x1f7503+_0x300dd4(0x1ae),'i')['test'](_0x284a51);}function findEqualityPrefix(_0x423d63,_0x2e3593){const _0x1c4f8c=a228_0x56d2,_0x3f7f69=new Set(_0x2e3593[_0x1c4f8c(0x1b9)](normalizeIdentifier)),_0x52e3c0=[];for(const _0x35a072 of _0x423d63){if(!_0x3f7f69['has'](normalizeIdentifier(_0x35a072)))break;_0x52e3c0['push'](_0x35a072);}return _0x52e3c0;}function resolveTableMetadata(_0x5d2a5e,_0x4ede2f){const _0x520e85=a228_0x56d2,_0x360d9c=normalizeIdentifier(_0x4ede2f),_0x139786=_0x5d2a5e[_0x520e85(0x19d)](_0x2d3000=>normalizeIdentifier(_0x2d3000[_0x520e85(0x19e)])===_0x360d9c);if(_0x139786[_0x520e85(0x1a2)]===0x1)return _0x139786[0x0];const _0x5485fe=_0x360d9c[_0x520e85(0x1a0)]('.'),_0x597ba4=_0x360d9c['split']('.')['at'](-0x1),_0x588371=_0x5d2a5e[_0x520e85(0x19d)](_0x2d5301=>{const _0x48a606=_0x520e85,_0x2dc303=normalizeIdentifier(_0x2d5301['tableName']);if(_0x5485fe&&_0x2dc303[_0x48a606(0x1a0)]('.'))return![];return _0x2dc303[_0x48a606(0x17b)]('.')['at'](-0x1)===_0x597ba4;});return _0x588371[_0x520e85(0x1a2)]===0x1?_0x588371[0x0]:undefined;}function a228_0x56d2(_0x5ccc3f,_0x162c2a){_0x5ccc3f=_0x5ccc3f-0x179;const _0x62fc79=a228_0x62fc();let _0x56d202=_0x62fc79[_0x5ccc3f];return _0x56d202;}function columnNamesMatch(_0xfa7959,_0x4efb74){return normalizeIdentifier(_0xfa7959)===normalizeIdentifier(_0x4efb74);}function normalizeIdentifier(_0x2bb9be){const _0x7d70f3=a228_0x56d2;return _0x2bb9be[_0x7d70f3(0x1c3)](/[`"]/g,'')[_0x7d70f3(0x18c)]()[_0x7d70f3(0x180)]();}function isSqlClauseKeyword(_0x4cd697){const _0x121c55=a228_0x56d2;return new Set(['on','using',_0x121c55(0x1a8),_0x121c55(0x1b6),_0x121c55(0x1c4),_0x121c55(0x18e),_0x121c55(0x1c5),'full',_0x121c55(0x179),_0x121c55(0x17d)])[_0x121c55(0x1b8)](_0x4cd697);}function stripOuterParentheses(_0x189dc1){const _0x324a86=a228_0x56d2;let _0x4ebbe8=_0x189dc1[_0x324a86(0x18c)]();while(_0x4ebbe8[_0x324a86(0x186)]('(')&&_0x4ebbe8[_0x324a86(0x18b)](')')){let _0x3402c8=0x0,_0x171673=!![];for(let _0x4f761b=0x0;_0x4f761b<_0x4ebbe8['length'];_0x4f761b+=0x1){if(_0x4ebbe8[_0x4f761b]==='(')_0x3402c8+=0x1;if(_0x4ebbe8[_0x4f761b]===')')_0x3402c8-=0x1;if(_0x3402c8===0x0&&_0x4f761b<_0x4ebbe8[_0x324a86(0x1a2)]-0x1){_0x171673=![];break;}}if(!_0x171673||_0x3402c8!==0x0)break;_0x4ebbe8=_0x4ebbe8[_0x324a86(0x192)](0x1,-0x1)[_0x324a86(0x18c)]();}return _0x4ebbe8;}
1
+ (function(_0x495686,_0xa47759){const _0x4220f0=a220_0x5e71,_0x469fe7=_0x495686();while(!![]){try{const _0x228721=parseInt(_0x4220f0(0x1cd))/0x1+-parseInt(_0x4220f0(0x1b8))/0x2+-parseInt(_0x4220f0(0x1d5))/0x3*(-parseInt(_0x4220f0(0x1c1))/0x4)+-parseInt(_0x4220f0(0x1ab))/0x5+-parseInt(_0x4220f0(0x1f4))/0x6+parseInt(_0x4220f0(0x1ef))/0x7+parseInt(_0x4220f0(0x1e1))/0x8*(parseInt(_0x4220f0(0x1d0))/0x9);if(_0x228721===_0xa47759)break;else _0x469fe7['push'](_0x469fe7['shift']());}catch(_0x5dc2f3){_0x469fe7['push'](_0x469fe7['shift']());}}}(a220_0x1296,0xf002b));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x9d59e7,_0x4ac8a1){const _0x38a6e7=a220_0x5e71,_0x40ba26=[],_0x15dec4=normalizeSqlForStaticAnalysis(_0x9d59e7),_0x92951e=(_0x15dec4[_0x38a6e7(0x1d4)]?[]:extractJoinFacts(_0x15dec4[_0x38a6e7(0x1cf)]))[_0x38a6e7(0x1dd)](_0x104547=>{const _0x108508=_0x38a6e7;if(_0x104547[_0x108508(0x1b4)]||_0x104547[_0x108508(0x1de)][_0x108508(0x1c6)]===0x0)return _0x40ba26[_0x108508(0x1bc)]({'code':_0x108508(0x1d8),'table':_0x104547['table'],'alias':_0x104547[_0x108508(0x1d9)],'columns':_0x104547['columns'],'reason':_0x104547[_0x108508(0x1ce)]??_0x108508(0x1c4)}),{'table':_0x104547[_0x108508(0x1b2)],'alias':_0x104547['alias'],'columns':_0x104547['columns'],'status':'unavailable'};const _0x4bf7a3=resolveTableMetadata(_0x4ac8a1,_0x104547['table']),_0x5cb36b=(_0x4bf7a3?.['indexes']??[])[_0x108508(0x1dd)](_0x29dfd7=>({'index':_0x29dfd7,'matchedPrefix':findEqualityPrefix(_0x29dfd7[_0x108508(0x1de)],_0x104547[_0x108508(0x1de)])}))[_0x108508(0x1e7)](_0x2f0f78=>_0x2f0f78[_0x108508(0x1bb)][_0x108508(0x1c6)]>0x0),_0x41086e=_0x5cb36b[_0x108508(0x1cc)]((_0x5dd8bc,_0x50b4a3)=>!_0x5dd8bc||_0x50b4a3['matchedPrefix'][_0x108508(0x1c6)]>_0x5dd8bc[_0x108508(0x1bb)][_0x108508(0x1c6)]?_0x50b4a3:_0x5dd8bc,_0x5cb36b[0x0]);if(_0x41086e)return{'table':_0x104547['table'],'alias':_0x104547[_0x108508(0x1d9)],'columns':_0x104547[_0x108508(0x1de)],'status':_0x108508(0x1ee),'matchedIndex':{..._0x41086e[_0x108508(0x1e8)],'matchedPrefix':_0x41086e[_0x108508(0x1bb)]}};const _0xb59fa3=_0x4bf7a3?.['indexes'][_0x108508(0x1e7)](_0x5d7688=>_0x5d7688[_0x108508(0x1de)][_0x108508(0x1f1)](_0x3c2d29=>_0x104547[_0x108508(0x1de)]['some'](_0x41b4df=>columnNamesMatch(_0x3c2d29,_0x41b4df))))??[];if(_0xb59fa3['length']>0x0)return _0x40ba26[_0x108508(0x1bc)]({'code':_0x108508(0x1af),'table':_0x104547[_0x108508(0x1b2)],'alias':_0x104547[_0x108508(0x1d9)],'columns':_0x104547['columns'],'reason':_0x108508(0x1e4)}),{'table':_0x104547[_0x108508(0x1b2)],'alias':_0x104547[_0x108508(0x1d9)],'columns':_0x104547[_0x108508(0x1de)],'status':'warning','candidateIndexes':_0xb59fa3};if(_0x4bf7a3&&_0x4bf7a3[_0x108508(0x1ca)]!==![]&&_0x4bf7a3['indexes'][_0x108508(0x1c6)]>0x0&&_0x104547['columns'][_0x108508(0x1c6)]>0x0)return _0x40ba26[_0x108508(0x1bc)]({'code':_0x108508(0x1ac),'table':_0x104547['table'],'alias':_0x104547['alias'],'columns':_0x104547[_0x108508(0x1de)],'reason':_0x108508(0x1e0)}),{'table':_0x104547['table'],'alias':_0x104547[_0x108508(0x1d9)],'columns':_0x104547[_0x108508(0x1de)],'status':_0x108508(0x1c8)};return _0x40ba26['push']({'code':'INDEX_METADATA_UNAVAILABLE','table':_0x104547[_0x108508(0x1b2)],'alias':_0x104547[_0x108508(0x1d9)],'columns':_0x104547[_0x108508(0x1de)],'reason':_0x4bf7a3?_0x108508(0x1eb):_0x108508(0x1f6)}),{'table':_0x104547['table'],'alias':_0x104547[_0x108508(0x1d9)],'columns':_0x104547[_0x108508(0x1de)],'status':_0x108508(0x1dc)};});return{'checked':_0x92951e['length']>0x0,'joins':_0x92951e,'warnings':_0x40ba26};}function extractJoinFacts(_0x5835af){const _0x3561f6=a220_0x5e71,_0x3e6256=maskNestedQueries(stripSqlNoise(_0x5835af)),_0x54dde1=maskQuotedIdentifiers(_0x3e6256),_0x530f51=[],_0x3a9197=new Set(),_0x219daa=/\b(?:(INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?\s+ON\s+([\s\S]*?)(?=\s+(?:(?:(?:INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\b|(?:WHERE|GROUP\s+BY|ORDER\s+BY|HAVING|LIMIT|UNION)\b)|;|$)/gi;for(const _0x4b12f7 of _0x3e6256['matchAll'](_0x219daa)){const _0x597c5c=_0x4b12f7[_0x3561f6(0x1e8)]??0x0,_0x11f308=_0x4b12f7[0x0]['search'](/\bJOIN\b/i),_0xddb01c=_0x597c5c+Math[_0x3561f6(0x1d7)](0x0,_0x11f308);if(!/^JOIN\b/i[_0x3561f6(0x1b3)](_0x54dde1['slice'](_0xddb01c)))continue;_0x3a9197[_0x3561f6(0x1d3)](_0xddb01c);const _0x9305df=normalizeIdentifier(_0x4b12f7[0x1]||_0x3561f6(0x1e9)),_0x5d420a=normalizeIdentifier(_0x4b12f7[0x2]??''),_0x19d7ce=normalizeIdentifier(_0x4b12f7[0x3]||_0x5d420a[_0x3561f6(0x1ae)]('.')['at'](-0x1)||_0x5d420a),_0xc8602a=[],_0x330811=_0x5d420a===_0x3561f6(0x1e6);let _0x1f1f7e=_0x9305df===_0x3561f6(0x1f3)||_0x9305df==='full'||_0x330811,_0x2b7d20=_0x1f1f7e?_0x330811?_0x3561f6(0x1ba):_0x9305df[_0x3561f6(0x1be)]()+_0x3561f6(0x1c5):undefined;const _0x95f1eb=stripOuterParentheses(_0x4b12f7[0x4]??''),_0xe1b146=_0x95f1eb['includes'](MYBATIS_DYNAMIC_START_MARKER)||_0x95f1eb[_0x3561f6(0x1ed)](MYBATIS_DYNAMIC_END_MARKER),_0x57869a=_0x95f1eb['includes'](MYBATIS_INCLUDE_MARKER);_0xe1b146&&(_0x1f1f7e=!![],_0x2b7d20??=_0x3561f6(0x1c9));_0x57869a&&(_0x1f1f7e=!![],_0x2b7d20??=_0x3561f6(0x1df));const _0x557a3d=_0x95f1eb[_0x3561f6(0x1a9)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x3561f6(0x1a9)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x3561f6(0x1a9)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x557a3d,'OR')&&(_0x1f1f7e=!![],_0x2b7d20??=_0x3561f6(0x1b6));for(const _0xde90dc of splitTopLevelAnd(_0x557a3d)){const _0x503630=stripOuterParentheses(_0xde90dc);if(hasTopLevelKeyword(_0x503630,'OR')){_0x1f1f7e=!![],_0x2b7d20??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.';continue;}const _0x37de4c=splitEquality(_0x503630);if(!_0x37de4c){containsColumnReference(_0xde90dc,_0x19d7ce)&&(_0x1f1f7e=!![]);continue;}const _0xfbb4c=parseDirectColumnReference(_0x37de4c[0x0],_0x19d7ce),_0x272ce0=parseDirectColumnReference(_0x37de4c[0x1],_0x19d7ce),_0x4a8fcc=containsColumnReference(_0x37de4c[0x0],_0x19d7ce),_0x1bdd1b=containsColumnReference(_0x37de4c[0x1],_0x19d7ce),_0x57282f=_0xfbb4c&&!_0x1bdd1b?_0xfbb4c:_0x272ce0&&!_0x4a8fcc?_0x272ce0:null;if(_0x57282f&&!_0xc8602a['includes'](_0x57282f))_0xc8602a[_0x3561f6(0x1bc)](_0x57282f);else!_0x57282f&&containsColumnReference(_0xde90dc,_0x19d7ce)&&(_0x1f1f7e=!![]);}_0x530f51[_0x3561f6(0x1bc)]({'table':_0x5d420a,'alias':_0x19d7ce,'columns':_0xc8602a,'unsupportedPredicate':_0x1f1f7e,'unsupportedReason':_0x2b7d20,'containsUnresolvedInclude':_0x57869a,'position':_0xddb01c});}for(const _0x436d68 of _0x54dde1[_0x3561f6(0x1b1)](/\bJOIN\b/gi)){const _0x70d553=_0x436d68[_0x3561f6(0x1e8)]??0x0;if(_0x3a9197['has'](_0x70d553))continue;const _0x465539=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x3561f6(0x1aa)](_0x3e6256['slice'](_0x70d553+_0x436d68[0x0][_0x3561f6(0x1c6)])),_0x12cd27=normalizeIdentifier(_0x465539?.[0x1]||'unknown'),_0x225906=normalizeIdentifier(_0x465539?.[0x2]||''),_0x22df3b=isSqlClauseKeyword(_0x225906)?_0x12cd27[_0x3561f6(0x1ae)]('.')['at'](-0x1)||_0x12cd27:_0x225906||_0x12cd27[_0x3561f6(0x1ae)]('.')['at'](-0x1)||_0x12cd27;_0x530f51[_0x3561f6(0x1bc)]({'table':_0x12cd27,'alias':_0x22df3b,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x3561f6(0x1f0),'position':_0x70d553});}const _0x12c8aa=_0x54dde1[_0x3561f6(0x1d2)](MYBATIS_INCLUDE_MARKER);return _0x12c8aa>=0x0&&!_0x530f51[_0x3561f6(0x1f1)](_0xa06776=>_0xa06776['containsUnresolvedInclude'])&&_0x530f51[_0x3561f6(0x1bc)]({'table':_0x3561f6(0x1d6),'alias':_0x3561f6(0x1d6),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x3561f6(0x1e2),'containsUnresolvedInclude':!![],'position':_0x12c8aa}),_0x530f51[_0x3561f6(0x1f5)]((_0x21651c,_0x245fff)=>_0x21651c[_0x3561f6(0x1bd)]-_0x245fff[_0x3561f6(0x1bd)]);}function stripSqlNoise(_0x517aba){const _0x293b03=a220_0x5e71,_0x31e2c5=Array[_0x293b03(0x1db)](_0x517aba),_0x1de39b=(_0xa3a979,_0x4ae783)=>{for(let _0x30c31b=_0xa3a979;_0x30c31b<_0x4ae783;_0x30c31b+=0x1){_0x31e2c5[_0x30c31b]!=='\x0a'&&_0x31e2c5[_0x30c31b]!=='\x0d'&&(_0x31e2c5[_0x30c31b]='\x20');}};for(let _0x1f207e=0x0;_0x1f207e<_0x31e2c5['length'];_0x1f207e+=0x1){const _0x312537=_0x31e2c5[_0x1f207e],_0x25996e=_0x31e2c5[_0x1f207e+0x1];if(_0x312537==='\x27'||_0x312537==='\x22'||_0x312537==='`'){const _0x4e8a84=_0x312537,_0x4b63b1=_0x1f207e;_0x1f207e+=0x1;while(_0x1f207e<_0x31e2c5[_0x293b03(0x1c6)]){if(_0x31e2c5[_0x1f207e]==='\x5c'&&_0x1f207e+0x1<_0x31e2c5[_0x293b03(0x1c6)]){_0x1f207e+=0x2;continue;}if(_0x31e2c5[_0x1f207e]!==_0x4e8a84){_0x1f207e+=0x1;continue;}if(_0x31e2c5[_0x1f207e+0x1]===_0x4e8a84){_0x1f207e+=0x2;continue;}break;}if(_0x4e8a84==='\x27')_0x1de39b(_0x4b63b1,Math['min'](_0x1f207e+0x1,_0x31e2c5[_0x293b03(0x1c6)]));continue;}if(_0x312537==='-'&&_0x25996e==='-'){const _0x2ebeef=_0x1f207e;while(_0x1f207e<_0x31e2c5['length']&&_0x31e2c5[_0x1f207e]!=='\x0a')_0x1f207e+=0x1;_0x1de39b(_0x2ebeef,_0x1f207e);continue;}if(_0x312537==='/'&&_0x25996e==='*'){const _0x18dfe0=_0x1f207e;_0x1f207e+=0x2;while(_0x1f207e<_0x31e2c5[_0x293b03(0x1c6)]&&!(_0x31e2c5[_0x1f207e]==='*'&&_0x31e2c5[_0x1f207e+0x1]==='/')){_0x1f207e+=0x1;}_0x1f207e=Math['min'](_0x1f207e+0x1,_0x31e2c5[_0x293b03(0x1c6)]-0x1),_0x1de39b(_0x18dfe0,_0x1f207e+0x1);continue;}if(_0x312537==='#'&&_0x25996e!=='{'){const _0x67e285=_0x1f207e;while(_0x1f207e<_0x31e2c5[_0x293b03(0x1c6)]&&_0x31e2c5[_0x1f207e]!=='\x0a')_0x1f207e+=0x1;_0x1de39b(_0x67e285,_0x1f207e);continue;}if((_0x312537==='#'||_0x312537==='$')&&_0x25996e==='{'){const _0x2fc925=_0x1f207e;_0x1f207e+=0x2;while(_0x1f207e<_0x31e2c5[_0x293b03(0x1c6)]&&_0x31e2c5[_0x1f207e]!=='}')_0x1f207e+=0x1;_0x1de39b(_0x2fc925,Math[_0x293b03(0x1e3)](_0x1f207e+0x1,_0x31e2c5[_0x293b03(0x1c6)]));}}return _0x31e2c5[_0x293b03(0x1ad)]('');}function maskQuotedIdentifiers(_0x1f9ed5){const _0x5c43c6=a220_0x5e71,_0x43d80b=Array[_0x5c43c6(0x1db)](_0x1f9ed5);for(let _0x44de05=0x0;_0x44de05<_0x43d80b['length'];_0x44de05+=0x1){const _0x441ed2=_0x43d80b[_0x44de05];if(_0x441ed2!=='\x22'&&_0x441ed2!=='`')continue;_0x44de05+=0x1;while(_0x44de05<_0x43d80b[_0x5c43c6(0x1c6)]){if(_0x43d80b[_0x44de05]===_0x441ed2){if(_0x43d80b[_0x44de05+0x1]===_0x441ed2){_0x43d80b[_0x44de05]='\x20',_0x43d80b[_0x44de05+0x1]='\x20',_0x44de05+=0x2;continue;}break;}_0x43d80b[_0x44de05]='\x20',_0x44de05+=0x1;}}return _0x43d80b[_0x5c43c6(0x1ad)]('');}function maskNestedQueries(_0x9ddde2){const _0x2838be=a220_0x5e71,_0x515601=Array[_0x2838be(0x1db)](_0x9ddde2);for(let _0x3727cd=0x0;_0x3727cd<_0x515601[_0x2838be(0x1c6)];_0x3727cd+=0x1){if(_0x515601[_0x3727cd]!=='(')continue;const _0x663101=_0x9ddde2[_0x2838be(0x1ea)](_0x3727cd+0x1);if(!/^\s*(?:SELECT|WITH)\b/i['test'](_0x663101))continue;let _0x1a2e45=0x1,_0x1ef440=_0x3727cd+0x1;for(;_0x1ef440<_0x515601['length']&&_0x1a2e45>0x0;_0x1ef440+=0x1){if(_0x515601[_0x1ef440]==='(')_0x1a2e45+=0x1;if(_0x515601[_0x1ef440]===')')_0x1a2e45-=0x1;}if(_0x1a2e45!==0x0)continue;for(let _0xebbc1=_0x3727cd;_0xebbc1<_0x1ef440;_0xebbc1+=0x1){_0x515601[_0xebbc1]='\x20';}const _0x3dea89=_0x2838be(0x1e6);for(let _0x592cec=0x0;_0x592cec<_0x3dea89['length']&&_0x3727cd+_0x592cec<_0x1ef440;_0x592cec+=0x1){_0x515601[_0x3727cd+_0x592cec]=_0x3dea89[_0x592cec];}_0x3727cd=_0x1ef440-0x1;}return _0x515601[_0x2838be(0x1ad)]('');}function splitTopLevelAnd(_0xf85518){const _0x349b97=a220_0x5e71,_0x2fbe89=[];let _0x24fa28=0x0,_0x264a68=0x0;for(let _0x5a2e80=0x0;_0x5a2e80<_0xf85518[_0x349b97(0x1c6)];_0x5a2e80+=0x1){const _0xb21213=_0xf85518[_0x5a2e80];if(_0xb21213==='(')_0x24fa28+=0x1;if(_0xb21213===')')_0x24fa28=Math[_0x349b97(0x1d7)](0x0,_0x24fa28-0x1);_0x24fa28===0x0&&_0xf85518['slice'](_0x5a2e80)['match'](/^AND\b/i)&&(_0x5a2e80===0x0||/\s/[_0x349b97(0x1b3)](_0xf85518[_0x5a2e80-0x1]??''))&&(_0x2fbe89[_0x349b97(0x1bc)](_0xf85518[_0x349b97(0x1ea)](_0x264a68,_0x5a2e80)[_0x349b97(0x1c0)]()),_0x5a2e80+=0x2,_0x264a68=_0x5a2e80+0x1);}const _0x438c0e=_0xf85518['slice'](_0x264a68)[_0x349b97(0x1c0)]();if(_0x438c0e)_0x2fbe89[_0x349b97(0x1bc)](_0x438c0e);return _0x2fbe89;}function hasTopLevelKeyword(_0x31842d,_0x4630ef){const _0x30ca7a=a220_0x5e71;let _0xf94a=0x0;for(let _0x44338d=0x0;_0x44338d<_0x31842d[_0x30ca7a(0x1c6)];_0x44338d+=0x1){const _0x348f74=_0x31842d[_0x44338d];if(_0x348f74==='(')_0xf94a+=0x1;if(_0x348f74===')')_0xf94a=Math['max'](0x0,_0xf94a-0x1);if(_0xf94a!==0x0)continue;const _0x171cf5=_0x31842d[_0x30ca7a(0x1ea)](_0x44338d,_0x44338d+_0x4630ef[_0x30ca7a(0x1c6)]),_0xe66db5=_0x31842d[_0x44338d-0x1]??'\x20',_0x193366=_0x31842d[_0x44338d+_0x4630ef[_0x30ca7a(0x1c6)]]??'\x20';if(_0x171cf5[_0x30ca7a(0x1be)]()===_0x4630ef[_0x30ca7a(0x1be)]()&&!/[\w$]/['test'](_0xe66db5)&&!/[\w$]/['test'](_0x193366))return!![];}return![];}function splitEquality(_0x3869e0){const _0x279646=a220_0x5e71,_0xd7ae1a=stripOuterParentheses(_0x3869e0);let _0x3f3e7d=0x0,_0x323f7c;for(let _0xc1e685=0x0;_0xc1e685<_0xd7ae1a['length'];_0xc1e685+=0x1){const _0x54d7a8=_0xd7ae1a[_0xc1e685];if(_0x54d7a8==='(')_0x3f3e7d+=0x1;if(_0x54d7a8===')')_0x3f3e7d=Math[_0x279646(0x1d7)](0x0,_0x3f3e7d-0x1);const _0x45c6b1=_0xd7ae1a[_0xc1e685-0x1]??'',_0x236b4f=_0xd7ae1a[_0xc1e685+0x1]??'';if(_0x54d7a8==='='&&_0x3f3e7d===0x0&&!/[!<>=:]/[_0x279646(0x1b3)](_0x45c6b1)&&_0x236b4f!=='='){if(_0x323f7c!==undefined)return null;_0x323f7c=_0xc1e685;}}return _0x323f7c===undefined?null:[_0xd7ae1a[_0x279646(0x1ea)](0x0,_0x323f7c)[_0x279646(0x1c0)](),_0xd7ae1a[_0x279646(0x1ea)](_0x323f7c+0x1)['trim']()];}function parseDirectColumnReference(_0x1017a9,_0x436d25){const _0x4db5c1=a220_0x5e71,_0x4e45f0=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x4db5c1(0x1aa)](stripOuterParentheses(_0x1017a9));if(!_0x4e45f0)return null;if(normalizeIdentifier(_0x4e45f0[0x1]??'')!==normalizeIdentifier(_0x436d25))return null;return normalizeIdentifier(_0x4e45f0[0x2]??'');}function containsColumnReference(_0x43f3f6,_0x483a2b){const _0x399afd=a220_0x5e71,_0x1c4ec4=_0x43f3f6[_0x399afd(0x1b9)](/[`"]/g,''),_0xa9a065=_0x483a2b[_0x399afd(0x1b9)](/[.*+?^${}()|[\]\\]/g,_0x399afd(0x1e5));return new RegExp(_0x399afd(0x1bf)+_0xa9a065+_0x399afd(0x1b0),'i')[_0x399afd(0x1b3)](_0x1c4ec4);}function a220_0x5e71(_0x1fc689,_0x2f1dc0){_0x1fc689=_0x1fc689-0x1a9;const _0x129608=a220_0x1296();let _0x5e717c=_0x129608[_0x1fc689];return _0x5e717c;}function findEqualityPrefix(_0x3f9c14,_0x325963){const _0x39af7b=a220_0x5e71,_0x2acd61=new Set(_0x325963[_0x39af7b(0x1dd)](normalizeIdentifier)),_0x1989dd=[];for(const _0x26c19a of _0x3f9c14){if(!_0x2acd61[_0x39af7b(0x1c2)](normalizeIdentifier(_0x26c19a)))break;_0x1989dd[_0x39af7b(0x1bc)](_0x26c19a);}return _0x1989dd;}function resolveTableMetadata(_0x55ae05,_0x4a5dff){const _0x5519d4=a220_0x5e71,_0x537c40=normalizeIdentifier(_0x4a5dff),_0xcdf6ea=_0x55ae05['filter'](_0x4bc6ed=>normalizeIdentifier(_0x4bc6ed[_0x5519d4(0x1c3)])===_0x537c40);if(_0xcdf6ea['length']===0x1)return _0xcdf6ea[0x0];const _0x442ea9=_0x537c40[_0x5519d4(0x1ed)]('.'),_0x4634f4=_0x537c40['split']('.')['at'](-0x1),_0x29800a=_0x55ae05['filter'](_0x2186db=>{const _0x2e3722=_0x5519d4,_0x280f98=normalizeIdentifier(_0x2186db[_0x2e3722(0x1c3)]);if(_0x442ea9&&_0x280f98[_0x2e3722(0x1ed)]('.'))return![];return _0x280f98['split']('.')['at'](-0x1)===_0x4634f4;});return _0x29800a[_0x5519d4(0x1c6)]===0x1?_0x29800a[0x0]:undefined;}function columnNamesMatch(_0xd9dc92,_0x4f84d7){return normalizeIdentifier(_0xd9dc92)===normalizeIdentifier(_0x4f84d7);}function a220_0x1296(){const _0x5e4980=['\x5c$&','__sq__','filter','index','INNER','slice','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','endsWith','includes','covered','2177574dXcKIN','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','some','natural','right','303054bmoJra','sort','No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.','replaceAll','exec','5220660KgMfnh','JOIN_INDEX_MISSING','join','split','JOIN_INDEX_NOT_USABLE','\x5cs*\x5c.\x5cs*[\x5cw$]+','matchAll','table','test','unsupportedPredicate','startsWith','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','full','2596214IdDuVZ','replace','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','matchedPrefix','push','position','toUpperCase','(?:^|[^\x5cw$])','trim','36kFwACD','has','tableName','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','length','left','warning','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','metadataAvailable','inner','reduce','824721IpAmRN','unsupportedReason','sql','6366141XszmOa','using','indexOf','add','error','39327DMupkB','unknown','max','JOIN_PREDICATE_UNSUPPORTED','alias','cross','from','unavailable','map','columns','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','24TJfmgy','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','min','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.'];a220_0x1296=function(){return _0x5e4980;};return a220_0x1296();}function normalizeIdentifier(_0x5d36b8){const _0x4ee8c3=a220_0x5e71;return _0x5d36b8[_0x4ee8c3(0x1b9)](/[`"]/g,'')[_0x4ee8c3(0x1c0)]()['toLowerCase']();}function isSqlClauseKeyword(_0x1639a0){const _0x1748d8=a220_0x5e71;return new Set(['on',_0x1748d8(0x1d1),'where',_0x1748d8(0x1ad),_0x1748d8(0x1cb),_0x1748d8(0x1c7),_0x1748d8(0x1f3),_0x1748d8(0x1b7),_0x1748d8(0x1da),_0x1748d8(0x1f2)])[_0x1748d8(0x1c2)](_0x1639a0);}function stripOuterParentheses(_0x1baf27){const _0x5cd00a=a220_0x5e71;let _0x533d5c=_0x1baf27[_0x5cd00a(0x1c0)]();while(_0x533d5c[_0x5cd00a(0x1b5)]('(')&&_0x533d5c[_0x5cd00a(0x1ec)](')')){let _0x3df03d=0x0,_0x105621=!![];for(let _0xba13b2=0x0;_0xba13b2<_0x533d5c[_0x5cd00a(0x1c6)];_0xba13b2+=0x1){if(_0x533d5c[_0xba13b2]==='(')_0x3df03d+=0x1;if(_0x533d5c[_0xba13b2]===')')_0x3df03d-=0x1;if(_0x3df03d===0x0&&_0xba13b2<_0x533d5c['length']-0x1){_0x105621=![];break;}}if(!_0x105621||_0x3df03d!==0x0)break;_0x533d5c=_0x533d5c[_0x5cd00a(0x1ea)](0x1,-0x1)['trim']();}return _0x533d5c;}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * SQL 本地同步体系 —— 项目配置
3
+ *
4
+ * 纯路径计算:接收已解析的 appCode,返回 sqlRoot / lockFilePath 等派生路径。
5
+ */
6
+ import type { SqlProjectConfig } from "./types.js";
7
+ export declare function loadSqlProjectConfig(appCode: string, projectRoot?: string): SqlProjectConfig;
@@ -1 +1 @@
1
- function a229_0x33d9(){const _0x20524a=['116hVzANT','.rabetbase','3760330OJucqW','sql-trash','5460zslNTQ','11jKIzKz','132033wpYDel','12884HRECVQ','1176VvkUcM','/sql','sql.lock.json','4049055PawInh','2700110uyObky','sql','6488064DOXZDG','12XsAopl'];a229_0x33d9=function(){return _0x20524a;};return a229_0x33d9();}const a229_0x205901=a229_0x52cd;(function(_0x2f09ee,_0x547a1b){const _0x457784=a229_0x52cd,_0xf3cc2d=_0x2f09ee();while(!![]){try{const _0x3798b7=parseInt(_0x457784(0xf0))/0x1*(parseInt(_0x457784(0xf9))/0x2)+parseInt(_0x457784(0xef))/0x3*(parseInt(_0x457784(0xf8))/0x4)+-parseInt(_0x457784(0xf5))/0x5+-parseInt(_0x457784(0xf1))/0x6*(-parseInt(_0x457784(0xfd))/0x7)+parseInt(_0x457784(0xf7))/0x8+-parseInt(_0x457784(0xf4))/0x9+-parseInt(_0x457784(0xfb))/0xa*(parseInt(_0x457784(0xfe))/0xb);if(_0x3798b7===_0x547a1b)break;else _0xf3cc2d['push'](_0xf3cc2d['shift']());}catch(_0x2444d0){_0xf3cc2d['push'](_0xf3cc2d['shift']());}}}(a229_0x33d9,0x7483b));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a229_0x205901(0xfa),LOCK_FILE_NAME=a229_0x205901(0xf3),TRASH_DIR_NAME=a229_0x205901(0xfc);function a229_0x52cd(_0x4238ca,_0x29956e){_0x4238ca=_0x4238ca-0xef;const _0x33d9f0=a229_0x33d9();let _0x52cd53=_0x33d9f0[_0x4238ca];return _0x52cd53;}export function loadSqlProjectConfig(_0x48c115,_0x1b22df){const _0x2bf92f=a229_0x205901,_0xc4fd72=resolve(_0x1b22df??findProjectRootDirectory()),_0x4def99=DOT_DIR+_0x2bf92f(0xf2),_0x274063=_0x4def99+'/'+_0x48c115;return{'projectRoot':_0xc4fd72,'appCode':_0x48c115,'sqlWorkspaceRoot':_0x4def99,'sqlRoot':_0x274063,'sqlRootDir':resolve(_0xc4fd72,DOT_DIR,_0x2bf92f(0xf6),_0x48c115),'lockFilePath':resolve(_0xc4fd72,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0xc4fd72,DOT_DIR,TRASH_DIR_NAME)};}
1
+ const a221_0x549a34=a221_0x28c8;(function(_0x30259a,_0x507312){const _0x401e6f=a221_0x28c8,_0x3b1ecd=_0x30259a();while(!![]){try{const _0x47fe52=parseInt(_0x401e6f(0x138))/0x1+-parseInt(_0x401e6f(0x136))/0x2+-parseInt(_0x401e6f(0x13b))/0x3+-parseInt(_0x401e6f(0x13c))/0x4*(-parseInt(_0x401e6f(0x135))/0x5)+-parseInt(_0x401e6f(0x13f))/0x6*(parseInt(_0x401e6f(0x13a))/0x7)+parseInt(_0x401e6f(0x139))/0x8*(-parseInt(_0x401e6f(0x140))/0x9)+parseInt(_0x401e6f(0x13d))/0xa;if(_0x47fe52===_0x507312)break;else _0x3b1ecd['push'](_0x3b1ecd['shift']());}catch(_0x1aa4e8){_0x3b1ecd['push'](_0x3b1ecd['shift']());}}}(a221_0x1759,0x87234));function a221_0x28c8(_0x3a2f43,_0x5af424){_0x3a2f43=_0x3a2f43-0x135;const _0x1759ba=a221_0x1759();let _0x28c8d8=_0x1759ba[_0x3a2f43];return _0x28c8d8;}import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a221_0x549a34(0x141),LOCK_FILE_NAME=a221_0x549a34(0x13e),TRASH_DIR_NAME='sql-trash';function a221_0x1759(){const _0xee58fb=['883084qbicnc','/sql','330788aYXuKP','1525232jvvzwM','35hRHgSe','41970jldFmm','69868MEYGJK','8738500XetnNM','sql.lock.json','222636lvcFZs','45ulODQs','.rabetbase','270geJhWT'];a221_0x1759=function(){return _0xee58fb;};return a221_0x1759();}export function loadSqlProjectConfig(_0x49f8e4,_0x2d8a24){const _0x1c5ee5=a221_0x549a34,_0x283f=resolve(_0x2d8a24??findProjectRootDirectory()),_0x481ef4=DOT_DIR+_0x1c5ee5(0x137),_0x27622b=_0x481ef4+'/'+_0x49f8e4;return{'projectRoot':_0x283f,'appCode':_0x49f8e4,'sqlWorkspaceRoot':_0x481ef4,'sqlRoot':_0x27622b,'sqlRootDir':resolve(_0x283f,DOT_DIR,'sql',_0x49f8e4),'lockFilePath':resolve(_0x283f,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x283f,DOT_DIR,TRASH_DIR_NAME)};}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * SQL 本地同步体系 —— 本地文件扫描与路径解析
3
+ */
4
+ import type { LocalSqlQuery, SqlLockEntry, SqlProjectConfig } from "./types.js";
5
+ export declare function scanLocalSqlQueries(config: SqlProjectConfig): Promise<LocalSqlQuery[]>;
6
+ export declare function resolveLocalSqlFilePath(config: SqlProjectConfig, sqlCode: string, lockEntry?: SqlLockEntry): string;
7
+ export declare function directoryExists(dirPath: string): Promise<boolean>;
@@ -1 +1 @@
1
- function a230_0x4b81(){const _0x12c7de=['129884hItpaR','isDirectory','43990sVdUgv','code','.sql','189372UAKAtJ','replace','233217pPvAza','dbName','ENOENT','length','4JfzHXj','push','name','split','sqlRootDir','63030pkXwoz','filter','sql','108HkyHlI','590360lVhBVM','6oyHpVn','mode','10LkDaGA','slice','sqlCode','sqlName','475601WrbKoQ','9KWhCoU','.xml','mybatisXml'];a230_0x4b81=function(){return _0x12c7de;};return a230_0x4b81();}(function(_0x287001,_0x134fbf){const _0x34cb7c=a230_0x28ba,_0x41017d=_0x287001();while(!![]){try{const _0x3be128=parseInt(_0x34cb7c(0xfa))/0x1+-parseInt(_0x34cb7c(0x105))/0x2*(parseInt(_0x34cb7c(0x101))/0x3)+parseInt(_0x34cb7c(0xff))/0x4*(parseInt(_0x34cb7c(0xf2))/0x5)+-parseInt(_0x34cb7c(0xf0))/0x6*(-parseInt(_0x34cb7c(0xf6))/0x7)+parseInt(_0x34cb7c(0xef))/0x8*(parseInt(_0x34cb7c(0xf7))/0x9)+parseInt(_0x34cb7c(0xfc))/0xa+parseInt(_0x34cb7c(0xeb))/0xb*(-parseInt(_0x34cb7c(0xee))/0xc);if(_0x3be128===_0x134fbf)break;else _0x41017d['push'](_0x41017d['shift']());}catch(_0xb380fe){_0x41017d['push'](_0x41017d['shift']());}}}(a230_0x4b81,0x27f4b));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function a230_0x28ba(_0x2eaf4e,_0x1d1329){_0x2eaf4e=_0x2eaf4e-0xe7;const _0x4b8136=a230_0x4b81();let _0x28ba78=_0x4b8136[_0x2eaf4e];return _0x28ba78;}function extensionToMode(_0x37a902){const _0x39ec34=a230_0x28ba;if(_0x37a902===_0x39ec34(0xfe))return _0x39ec34(0xed);if(_0x37a902===_0x39ec34(0xf8))return _0x39ec34(0xf9);return undefined;}async function scanSqlFilesRecursively(_0x3207f6,_0x42dfc3){const _0x52e96f=a230_0x28ba,_0x2f6f88=[];try{const _0x560dbf=await readdir(_0x3207f6,{'withFileTypes':!![]});for(const _0x338dec of _0x560dbf){const _0x2db6d0=join(_0x3207f6,_0x338dec[_0x52e96f(0xe8)]);if(_0x338dec['isDirectory']()){_0x2f6f88[_0x52e96f(0xe7)](...await scanSqlFilesRecursively(_0x2db6d0,_0x42dfc3));continue;}if(!_0x338dec['isFile']())continue;const _0x439ba3=extname(_0x338dec[_0x52e96f(0xe8)])['toLowerCase'](),_0x1dcce4=extensionToMode(_0x439ba3);if(!_0x1dcce4)continue;const _0x55793e=relative(_0x42dfc3,_0x2db6d0)[_0x52e96f(0x100)](/\\/g,'/'),_0x3cb7b8=_0x55793e[_0x52e96f(0xe9)]('/')[_0x52e96f(0xec)](Boolean),_0x2c9b7d=parseSqlPath(_0x3cb7b8,_0x338dec[_0x52e96f(0xe8)],_0x439ba3);if(!_0x2c9b7d)continue;_0x2f6f88[_0x52e96f(0xe7)]({'sqlCode':_0x2c9b7d['sqlCode'],'sqlName':_0x2c9b7d['sqlName'],'dbDirectory':_0x3cb7b8[0x0],'filePath':_0x2db6d0,'relativePath':_0x55793e,'lockKey':_0x2c9b7d[_0x52e96f(0xf4)],'mode':_0x1dcce4});}}catch(_0x37ecdd){if(_0x37ecdd[_0x52e96f(0xfd)]!==_0x52e96f(0x103))throw _0x37ecdd;}return _0x2f6f88;}export async function scanLocalSqlQueries(_0x3e038b){const _0x29f460=a230_0x28ba;return scanSqlFilesRecursively(_0x3e038b['sqlRootDir'],_0x3e038b[_0x29f460(0xea)]);}export function resolveLocalSqlFilePath(_0x2683a5,_0x3bbbab,_0x59ab6a){const _0x1527d5=a230_0x28ba,_0x4b4aec=_0x59ab6a?.['path']||(_0x59ab6a?.[_0x1527d5(0xf5)]||_0x59ab6a?.[_0x1527d5(0x102)]?buildSqlRelativePath(_0x3bbbab,_0x59ab6a?.[_0x1527d5(0xf5)],_0x59ab6a?.[_0x1527d5(0x102)],_0x59ab6a?.[_0x1527d5(0xf1)]||_0x1527d5(0xed),_0x59ab6a?.['dbId']):buildDefaultSqlFileName(_0x3bbbab,_0x59ab6a?.[_0x1527d5(0xf1)]||_0x1527d5(0xed)));return join(_0x2683a5[_0x1527d5(0xea)],_0x4b4aec);}export async function directoryExists(_0x7cc18d){const _0x284c06=a230_0x28ba;try{const _0x45009a=await stat(_0x7cc18d);return _0x45009a[_0x284c06(0xfb)]();}catch{return![];}}function parseSqlPath(_0x6dfbde,_0x3d3b1a,_0x2de0b9){const _0x2aff90=a230_0x28ba,_0x1b4730=_0x3d3b1a['slice'](0x0,-_0x2de0b9['length']);if(_0x6dfbde[_0x2aff90(0x104)]<0x2)return null;const _0x42b209=_0x1b4730['indexOf']('_');if(_0x42b209<=0x0||_0x42b209>=_0x1b4730[_0x2aff90(0x104)]-0x1)return null;const _0xe3bab2=_0x1b4730['slice'](0x0,_0x42b209);if(!isLikelySqlCode(_0xe3bab2))return null;return{'sqlCode':_0xe3bab2,'sqlName':_0x1b4730[_0x2aff90(0xf3)](_0x42b209+0x1)};}function isLikelySqlCode(_0x42b2dd){return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/['test'](_0x42b2dd);}
1
+ (function(_0x37fb9d,_0x59faee){const _0x16910d=a222_0x34d2,_0x3e4400=_0x37fb9d();while(!![]){try{const _0x23ba8a=parseInt(_0x16910d(0x1ea))/0x1+-parseInt(_0x16910d(0x1e5))/0x2+parseInt(_0x16910d(0x1e3))/0x3*(-parseInt(_0x16910d(0x1e0))/0x4)+-parseInt(_0x16910d(0x1db))/0x5+-parseInt(_0x16910d(0x1df))/0x6+-parseInt(_0x16910d(0x1e9))/0x7*(-parseInt(_0x16910d(0x1d7))/0x8)+parseInt(_0x16910d(0x1f0))/0x9*(parseInt(_0x16910d(0x1d5))/0xa);if(_0x23ba8a===_0x59faee)break;else _0x3e4400['push'](_0x3e4400['shift']());}catch(_0x3e5f50){_0x3e4400['push'](_0x3e4400['shift']());}}}(a222_0x14c3,0xa9faa));function a222_0x34d2(_0x2cd372,_0x45ef57){_0x2cd372=_0x2cd372-0x1d5;const _0x14c3f5=a222_0x14c3();let _0x34d2ab=_0x14c3f5[_0x2cd372];return _0x34d2ab;}import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x326398){const _0x3d0c25=a222_0x34d2;if(_0x326398==='.sql')return _0x3d0c25(0x1dc);if(_0x326398===_0x3d0c25(0x1d6))return _0x3d0c25(0x1ee);return undefined;}async function scanSqlFilesRecursively(_0x5c4c3a,_0x4304b4){const _0x43a042=a222_0x34d2,_0x513319=[];try{const _0x3a1626=await readdir(_0x5c4c3a,{'withFileTypes':!![]});for(const _0x2c80b2 of _0x3a1626){const _0x183dc2=join(_0x5c4c3a,_0x2c80b2[_0x43a042(0x1da)]);if(_0x2c80b2[_0x43a042(0x1e8)]()){_0x513319['push'](...await scanSqlFilesRecursively(_0x183dc2,_0x4304b4));continue;}if(!_0x2c80b2[_0x43a042(0x1e7)]())continue;const _0x25242f=extname(_0x2c80b2['name'])[_0x43a042(0x1eb)](),_0xde88ce=extensionToMode(_0x25242f);if(!_0xde88ce)continue;const _0x5162a8=relative(_0x4304b4,_0x183dc2)[_0x43a042(0x1d8)](/\\/g,'/'),_0xe1cf32=_0x5162a8[_0x43a042(0x1e2)]('/')['filter'](Boolean),_0x2a52a1=parseSqlPath(_0xe1cf32,_0x2c80b2[_0x43a042(0x1da)],_0x25242f);if(!_0x2a52a1)continue;_0x513319[_0x43a042(0x1ed)]({'sqlCode':_0x2a52a1[_0x43a042(0x1e6)],'sqlName':_0x2a52a1[_0x43a042(0x1ef)],'dbDirectory':_0xe1cf32[0x0],'filePath':_0x183dc2,'relativePath':_0x5162a8,'lockKey':_0x2a52a1['sqlCode'],'mode':_0xde88ce});}}catch(_0x139b92){if(_0x139b92['code']!==_0x43a042(0x1de))throw _0x139b92;}return _0x513319;}function a222_0x14c3(){const _0x372bc8=['ENOENT','3849102BtltUK','1337036qUBcOh','length','split','3CAWOUH','slice','769388GtTCDE','sqlCode','isFile','isDirectory','9627401Nvzxgd','494500yQLkaY','toLowerCase','dbId','push','mybatisXml','sqlName','171dMzSrf','mode','611270NVqiYW','.xml','8upVmSw','replace','sqlRootDir','name','4872760NdzIWm','sql','dbName'];a222_0x14c3=function(){return _0x372bc8;};return a222_0x14c3();}export async function scanLocalSqlQueries(_0x1ac9e0){const _0x2299f8=a222_0x34d2;return scanSqlFilesRecursively(_0x1ac9e0[_0x2299f8(0x1d9)],_0x1ac9e0['sqlRootDir']);}export function resolveLocalSqlFilePath(_0x43d1f7,_0x8c87fd,_0x15331b){const _0x5b7cb3=a222_0x34d2,_0x32c4a3=_0x15331b?.['path']||(_0x15331b?.[_0x5b7cb3(0x1ef)]||_0x15331b?.[_0x5b7cb3(0x1dd)]?buildSqlRelativePath(_0x8c87fd,_0x15331b?.[_0x5b7cb3(0x1ef)],_0x15331b?.[_0x5b7cb3(0x1dd)],_0x15331b?.[_0x5b7cb3(0x1f1)]||_0x5b7cb3(0x1dc),_0x15331b?.[_0x5b7cb3(0x1ec)]):buildDefaultSqlFileName(_0x8c87fd,_0x15331b?.[_0x5b7cb3(0x1f1)]||'sql'));return join(_0x43d1f7[_0x5b7cb3(0x1d9)],_0x32c4a3);}export async function directoryExists(_0x5cc219){const _0x596020=a222_0x34d2;try{const _0xb25ed=await stat(_0x5cc219);return _0xb25ed[_0x596020(0x1e8)]();}catch{return![];}}function parseSqlPath(_0x2d6b83,_0x3a7601,_0x135291){const _0x958e6f=a222_0x34d2,_0x10fd16=_0x3a7601[_0x958e6f(0x1e4)](0x0,-_0x135291[_0x958e6f(0x1e1)]);if(_0x2d6b83[_0x958e6f(0x1e1)]<0x2)return null;const _0x2fd811=_0x10fd16['indexOf']('_');if(_0x2fd811<=0x0||_0x2fd811>=_0x10fd16['length']-0x1)return null;const _0x967abb=_0x10fd16[_0x958e6f(0x1e4)](0x0,_0x2fd811);if(!isLikelySqlCode(_0x967abb))return null;return{'sqlCode':_0x967abb,'sqlName':_0x10fd16[_0x958e6f(0x1e4)](_0x2fd811+0x1)};}function isLikelySqlCode(_0xc328e6){return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/['test'](_0xc328e6);}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * SQL 本地同步体系 —— 内容哈希
3
+ */
4
+ export declare function computeSqlContentHash(content: string): string;
5
+ export declare function computeSqlFileHash(filePath: string): Promise<string>;
@@ -1 +1 @@
1
- (function(_0xac0551,_0x26ef66){const _0x3ebf42=a231_0x120d,_0x4a3b67=_0xac0551();while(!![]){try{const _0x50b94f=-parseInt(_0x3ebf42(0x150))/0x1*(parseInt(_0x3ebf42(0x15a))/0x2)+-parseInt(_0x3ebf42(0x14a))/0x3+parseInt(_0x3ebf42(0x14c))/0x4*(-parseInt(_0x3ebf42(0x158))/0x5)+parseInt(_0x3ebf42(0x14b))/0x6+parseInt(_0x3ebf42(0x155))/0x7*(parseInt(_0x3ebf42(0x157))/0x8)+-parseInt(_0x3ebf42(0x14e))/0x9*(-parseInt(_0x3ebf42(0x153))/0xa)+parseInt(_0x3ebf42(0x14d))/0xb*(parseInt(_0x3ebf42(0x15b))/0xc);if(_0x50b94f===_0x26ef66)break;else _0x4a3b67['push'](_0x4a3b67['shift']());}catch(_0x35e895){_0x4a3b67['push'](_0x4a3b67['shift']());}}}(a231_0x2cee,0x6d22d));import{readFile}from'node:fs/promises';import a231_0xfaff47 from'node:crypto';export function computeSqlContentHash(_0x5a7f08){const _0x4cce70=a231_0x120d;return a231_0xfaff47[_0x4cce70(0x152)](_0x4cce70(0x151))[_0x4cce70(0x154)](_0x5a7f08)[_0x4cce70(0x156)](_0x4cce70(0x14f));}export async function computeSqlFileHash(_0x4da799){const _0x3ab6b0=a231_0x120d,_0x54babd=await readFile(_0x4da799,_0x3ab6b0(0x159));return computeSqlContentHash(_0x54babd);}function a231_0x120d(_0x48a244,_0x49b50d){_0x48a244=_0x48a244-0x14a;const _0x2cee06=a231_0x2cee();let _0x120dc5=_0x2cee06[_0x48a244];return _0x120dc5;}function a231_0x2cee(){const _0x487659=['1387284NtSVnX','28kKBejI','8659717yrVvdt','1125jOICRq','hex','35467IYzhIj','md5','createHash','16410Wdtzqq','update','18809MecYKG','digest','2384oAEilC','513650ysRKez','utf8','6kSGEyG','12VxsoZO','2255340DUAAoQ'];a231_0x2cee=function(){return _0x487659;};return a231_0x2cee();}
1
+ (function(_0x597c5d,_0x42fb7c){const _0x389f6f=a223_0x1c35,_0x2dfc24=_0x597c5d();while(!![]){try{const _0x47f31b=parseInt(_0x389f6f(0x182))/0x1*(-parseInt(_0x389f6f(0x17b))/0x2)+parseInt(_0x389f6f(0x185))/0x3+-parseInt(_0x389f6f(0x181))/0x4*(-parseInt(_0x389f6f(0x17f))/0x5)+parseInt(_0x389f6f(0x183))/0x6*(parseInt(_0x389f6f(0x17c))/0x7)+parseInt(_0x389f6f(0x17d))/0x8+parseInt(_0x389f6f(0x17e))/0x9+-parseInt(_0x389f6f(0x17a))/0xa;if(_0x47f31b===_0x42fb7c)break;else _0x2dfc24['push'](_0x2dfc24['shift']());}catch(_0x13d724){_0x2dfc24['push'](_0x2dfc24['shift']());}}}(a223_0x21fc,0xa21cc));function a223_0x21fc(){const _0x1a4502=['7BHvxla','3687160FMEUFd','5873067LVkQcb','2965595adQPxc','md5','8zSWJIj','291YVpSkd','7054680iCsZRx','update','2842164ZFIJDv','createHash','utf8','30848960tDhtwv','4632lDntbW'];a223_0x21fc=function(){return _0x1a4502;};return a223_0x21fc();}import{readFile}from'node:fs/promises';function a223_0x1c35(_0x1a2961,_0x27b5e9){_0x1a2961=_0x1a2961-0x178;const _0x21fc54=a223_0x21fc();let _0x1c3538=_0x21fc54[_0x1a2961];return _0x1c3538;}import a223_0x3ed4f2 from'node:crypto';export function computeSqlContentHash(_0x264df8){const _0x2faddc=a223_0x1c35;return a223_0x3ed4f2[_0x2faddc(0x178)](_0x2faddc(0x180))[_0x2faddc(0x184)](_0x264df8)['digest']('hex');}export async function computeSqlFileHash(_0x10ed15){const _0x193ac7=a223_0x1c35,_0x23afeb=await readFile(_0x10ed15,_0x193ac7(0x179));return computeSqlContentHash(_0x23afeb);}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * SQL 本地同步体系 —— Lock 文件管理
3
+ *
4
+ * .rabetbase/sql.lock.json 记录每个 appCode 下 SQL 文件的 hash / remoteId / dbId / mode 等信息,
5
+ * 用于 push / pull 的变更检测与本地执行元数据加载。
6
+ */
7
+ import type { SqlLockFile, SqlLockScope } from "./types.js";
8
+ export declare function createEmptySqlLock(): SqlLockFile;
9
+ export declare function ensureSqlLockScope(lockData: SqlLockFile, currentAppCode: string, currentSqlRoot: string, commandName: string): {
10
+ lockData: SqlLockFile;
11
+ appLock: SqlLockScope;
12
+ };
13
+ export declare function readSqlLockFile(lockFilePath: string): Promise<SqlLockFile | null>;
14
+ export declare function writeSqlLockFile(lockFilePath: string, lockData: SqlLockFile): Promise<void>;
@@ -1 +1 @@
1
- (function(_0x3ceda2,_0x29f9e2){const _0x37579d=a232_0x5c57,_0x534fa6=_0x3ceda2();while(!![]){try{const _0x1f8ce4=parseInt(_0x37579d(0xb2))/0x1*(-parseInt(_0x37579d(0xbd))/0x2)+-parseInt(_0x37579d(0xb7))/0x3*(parseInt(_0x37579d(0xbb))/0x4)+-parseInt(_0x37579d(0xbc))/0x5+-parseInt(_0x37579d(0xb6))/0x6+-parseInt(_0x37579d(0xb4))/0x7+-parseInt(_0x37579d(0xbe))/0x8+-parseInt(_0x37579d(0xb1))/0x9*(-parseInt(_0x37579d(0xb8))/0xa);if(_0x1f8ce4===_0x29f9e2)break;else _0x534fa6['push'](_0x534fa6['shift']());}catch(_0x21ce3d){_0x534fa6['push'](_0x534fa6['shift']());}}}(a232_0x3779,0xc8ead));import{mkdir,readFile,writeFile}from'node:fs/promises';function a232_0x5c57(_0xce397e,_0x480352){_0xce397e=_0xce397e-0xa9;const _0x377968=a232_0x3779();let _0x5c573f=_0x377968[_0xce397e];return _0x5c573f;}import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x809943,_0x136b2d,_0x5e95ca,_0x11da53){const _0xad3fa6=a232_0x5c57,_0x3839eb=_0x809943??createEmptySqlLock();let _0x575d54=_0x3839eb[_0xad3fa6(0xb5)][_0x136b2d];if(!_0x575d54)return _0x575d54={'sqlRoot':_0x5e95ca,'lastSync':'','sqls':{}},_0x3839eb[_0xad3fa6(0xb5)][_0x136b2d]=_0x575d54,{'lockData':_0x3839eb,'appLock':_0x575d54};if(!_0x575d54[_0xad3fa6(0xb9)])_0x575d54['sqlRoot']=_0x5e95ca;else{if(_0x575d54[_0xad3fa6(0xb9)]!==_0x5e95ca)throw new Error(_0x11da53+_0xad3fa6(0xb0)+_0x5e95ca+_0xad3fa6(0xaf)+_0x575d54[_0xad3fa6(0xb9)]+_0xad3fa6(0xba)+_0xad3fa6(0xad));}return!_0x575d54[_0xad3fa6(0xae)]&&(_0x575d54[_0xad3fa6(0xae)]={}),!_0x575d54[_0xad3fa6(0xa9)]&&(_0x575d54[_0xad3fa6(0xa9)]=''),{'lockData':_0x3839eb,'appLock':_0x575d54};}export async function readSqlLockFile(_0x354b76){const _0x506475=a232_0x5c57;try{const _0x3ac521=await readFile(_0x354b76,_0x506475(0xbf));return JSON[_0x506475(0xaa)](_0x3ac521);}catch(_0x245f0c){if(_0x245f0c[_0x506475(0xac)]===_0x506475(0xab))return null;throw new Error('Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20'+String(_0x245f0c));}}function a232_0x3779(){const _0x1ee2c3=['1117858qlElvW','314512qTbMdb','utf8','lastSync','parse','ENOENT','code','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','sqls','\x22\x20vs\x20lock\x20\x22',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','3190419dofgjD','1fehoSS','stringify','8367338SCzbYk','apps','6720708UWFKVZ','5808qQhdid','190YarMBn','sqlRoot','\x22.\x20','3244bkWzPT','7142905cVPiyF'];a232_0x3779=function(){return _0x1ee2c3;};return a232_0x3779();}export async function writeSqlLockFile(_0x381125,_0x2490d5){const _0x101bb0=a232_0x5c57;await mkdir(dirname(_0x381125),{'recursive':!![]}),await writeFile(_0x381125,JSON[_0x101bb0(0xb3)](_0x2490d5,null,0x2),'utf8');}
1
+ function a224_0x22bd(){const _0x33f59d=['code',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','2807301BlHAST','1538535DeczQI','338418EPwCYa','24bZeOsn','4rpspCj','55labLRR','utf8','1635220FGXFjR','parse','350167vTQlCe','1283283MqyfOV','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','sqlRoot','306282BkmrzJ','sqls','ENOENT','apps','lastSync'];a224_0x22bd=function(){return _0x33f59d;};return a224_0x22bd();}(function(_0x4b5d07,_0x237f80){const _0x2dd647=a224_0x3806,_0xb60899=_0x4b5d07();while(!![]){try{const _0x2968a4=-parseInt(_0x2dd647(0xb9))/0x1+-parseInt(_0x2dd647(0xc6))/0x2+-parseInt(_0x2dd647(0xc5))/0x3*(-parseInt(_0x2dd647(0xc8))/0x4)+parseInt(_0x2dd647(0xc9))/0x5*(parseInt(_0x2dd647(0xbd))/0x6)+parseInt(_0x2dd647(0xc4))/0x7+parseInt(_0x2dd647(0xc7))/0x8*(-parseInt(_0x2dd647(0xba))/0x9)+-parseInt(_0x2dd647(0xb7))/0xa;if(_0x2968a4===_0x237f80)break;else _0xb60899['push'](_0xb60899['shift']());}catch(_0x47bd8a){_0xb60899['push'](_0xb60899['shift']());}}}(a224_0x22bd,0x590ca));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}function a224_0x3806(_0x4df1c6,_0x4e1bcf){_0x4df1c6=_0x4df1c6-0xb6;const _0x22bd60=a224_0x22bd();let _0x3806a0=_0x22bd60[_0x4df1c6];return _0x3806a0;}export function ensureSqlLockScope(_0x12cd42,_0xb737df,_0x195f77,_0x4e1968){const _0x306ad7=a224_0x3806,_0x2a4fde=_0x12cd42??createEmptySqlLock();let _0x45bfc7=_0x2a4fde[_0x306ad7(0xc0)][_0xb737df];if(!_0x45bfc7)return _0x45bfc7={'sqlRoot':_0x195f77,'lastSync':'','sqls':{}},_0x2a4fde[_0x306ad7(0xc0)][_0xb737df]=_0x45bfc7,{'lockData':_0x2a4fde,'appLock':_0x45bfc7};if(!_0x45bfc7['sqlRoot'])_0x45bfc7['sqlRoot']=_0x195f77;else{if(_0x45bfc7[_0x306ad7(0xbc)]!==_0x195f77)throw new Error(_0x4e1968+_0x306ad7(0xc3)+_0x195f77+'\x22\x20vs\x20lock\x20\x22'+_0x45bfc7[_0x306ad7(0xbc)]+'\x22.\x20'+'Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x45bfc7[_0x306ad7(0xbe)]&&(_0x45bfc7['sqls']={}),!_0x45bfc7['lastSync']&&(_0x45bfc7[_0x306ad7(0xc1)]=''),{'lockData':_0x2a4fde,'appLock':_0x45bfc7};}export async function readSqlLockFile(_0x253acd){const _0x14026c=a224_0x3806;try{const _0x332b8c=await readFile(_0x253acd,_0x14026c(0xb6));return JSON[_0x14026c(0xb8)](_0x332b8c);}catch(_0x3ceed6){if(_0x3ceed6[_0x14026c(0xc2)]===_0x14026c(0xbf))return null;throw new Error(_0x14026c(0xbb)+String(_0x3ceed6));}}export async function writeSqlLockFile(_0x3a27ff,_0xff5a8f){await mkdir(dirname(_0x3a27ff),{'recursive':!![]}),await writeFile(_0x3a27ff,JSON['stringify'](_0xff5a8f,null,0x2),'utf8');}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * SQL 本地同步体系 —— 类型定义
3
+ *
4
+ * 覆盖 lock 文件结构、本地 SQL 描述、项目配置等。
5
+ */
6
+ export type SqlLocalMode = "sql" | "mybatisXml";
7
+ export interface SqlProjectConfig {
8
+ projectRoot: string;
9
+ appCode: string;
10
+ sqlWorkspaceRoot: string;
11
+ sqlRoot: string;
12
+ sqlRootDir: string;
13
+ lockFilePath: string;
14
+ trashDir: string;
15
+ }
16
+ export interface LocalSqlQuery {
17
+ sqlCode: string;
18
+ sqlName?: string;
19
+ dbDirectory?: string;
20
+ filePath: string;
21
+ relativePath: string;
22
+ lockKey: string;
23
+ mode: SqlLocalMode;
24
+ }
25
+ export interface SqlLockEntry {
26
+ path: string;
27
+ hash: string;
28
+ remoteId: number;
29
+ version?: number;
30
+ dbId: number;
31
+ dbName?: string;
32
+ sqlName: string;
33
+ sqlConfig?: string | null;
34
+ mode: SqlLocalMode;
35
+ }
36
+ export interface SqlLockScope {
37
+ sqlRoot: string;
38
+ lastSync: string;
39
+ sqls: Record<string, SqlLockEntry>;
40
+ }
41
+ export interface SqlLockFile {
42
+ apps: Record<string, SqlLockScope>;
43
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * SQL 本地同步体系 —— 工具函数
3
+ */
4
+ import type { SqlLocalMode } from "./types.js";
5
+ export declare function detectSqlMode(sqlContent: string): SqlLocalMode;
6
+ export declare function getSqlFileExtension(mode: SqlLocalMode): ".sql" | ".xml";
7
+ export declare function buildDefaultSqlFileName(sqlCode: string, mode: SqlLocalMode): string;
8
+ export declare function sanitizeSqlPathSegment(value: string | undefined, fallback: string): string;
9
+ export declare function buildDbDirectoryName(dbName: string | undefined, dbId?: number): string;
10
+ export declare function buildSqlRelativePath(sqlCode: string, sqlName: string | undefined, dbName: string | undefined, mode: SqlLocalMode, dbId?: number): string;
@@ -1 +1 @@
1
- (function(_0x319bcf,_0x241ec6){const _0x827b8d=a234_0x7b6d,_0x5b8d7c=_0x319bcf();while(!![]){try{const _0x393d56=-parseInt(_0x827b8d(0x88))/0x1*(-parseInt(_0x827b8d(0x86))/0x2)+parseInt(_0x827b8d(0x7e))/0x3*(parseInt(_0x827b8d(0x81))/0x4)+-parseInt(_0x827b8d(0x8a))/0x5*(parseInt(_0x827b8d(0x80))/0x6)+parseInt(_0x827b8d(0x8e))/0x7*(parseInt(_0x827b8d(0x7c))/0x8)+parseInt(_0x827b8d(0x87))/0x9*(-parseInt(_0x827b8d(0x89))/0xa)+-parseInt(_0x827b8d(0x82))/0xb*(parseInt(_0x827b8d(0x7d))/0xc)+parseInt(_0x827b8d(0x7a))/0xd;if(_0x393d56===_0x241ec6)break;else _0x5b8d7c['push'](_0x5b8d7c['shift']());}catch(_0x42f4c0){_0x5b8d7c['push'](_0x5b8d7c['shift']());}}}(a234_0x52f4,0x947a9));export function detectSqlMode(_0x288096){const _0x5d0b14=a234_0x7b6d,_0x1e6ca8=_0x288096[_0x5d0b14(0x8f)]();if(/^<(select|insert|update|delete)\b/i[_0x5d0b14(0x8d)](_0x1e6ca8))return'mybatisXml';return _0x5d0b14(0x90);}export function getSqlFileExtension(_0x4ff19e){const _0x541fa9=a234_0x7b6d;return _0x4ff19e==='mybatisXml'?_0x541fa9(0x83):_0x541fa9(0x8b);}export function buildDefaultSqlFileName(_0x4f8e52,_0x5ce7ae){return''+_0x4f8e52+getSqlFileExtension(_0x5ce7ae);}export function sanitizeSqlPathSegment(_0x6d5717,_0x1e917b){const _0x4f11af=a234_0x7b6d,_0x3dd731=String(_0x6d5717??'')[_0x4f11af(0x7b)](),_0x12fe30=_0x3dd731[_0x4f11af(0x84)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x4f11af(0x84)](/\s+/g,'-')[_0x4f11af(0x84)](/-+/g,'-')['replace'](/^\.+/,'')[_0x4f11af(0x84)](/\.+$/,'')[_0x4f11af(0x84)](/^-+/,'')[_0x4f11af(0x84)](/-+$/,'');return _0x12fe30||_0x1e917b;}export function buildDbDirectoryName(_0x2d0f6b,_0x463f52){const _0x192135=a234_0x7b6d;return sanitizeSqlPathSegment(_0x2d0f6b,_0x463f52!=null?_0x192135(0x85)+_0x463f52:_0x192135(0x8c));}function a234_0x52f4(){const _0x1d041a=['4ajXwZj','18YhgCGR','68489hIyxQn','343630oxFZOL','5DYlcSg','.sql','unknown-db','test','2380259AuVMFy','trimStart','sql','6044272dyBYeT','trim','24vMAndU','12uYJjVO','4839bfcjwG','unknown-sql','1485474hZZjxs','316CFDgRs','9074846zPFxZD','.xml','replace','db-'];a234_0x52f4=function(){return _0x1d041a;};return a234_0x52f4();}function a234_0x7b6d(_0x19296b,_0x34a23a){_0x19296b=_0x19296b-0x7a;const _0x52f421=a234_0x52f4();let _0x7b6d1c=_0x52f421[_0x19296b];return _0x7b6d1c;}export function buildSqlRelativePath(_0x2ed73d,_0x4cea84,_0x38071c,_0x37d135,_0x36a80d){const _0x40dfb9=a234_0x7b6d,_0x443f6a=buildDbDirectoryName(_0x38071c,_0x36a80d),_0x5698ac=sanitizeSqlPathSegment(_0x2ed73d,_0x40dfb9(0x7f)),_0x3eb8a4=sanitizeSqlPathSegment(_0x4cea84,_0x5698ac);return _0x443f6a+'/'+_0x5698ac+'_'+_0x3eb8a4+getSqlFileExtension(_0x37d135);}
1
+ (function(_0x17918b,_0x43b67f){const _0xd5584d=a226_0xb939,_0x3c544b=_0x17918b();while(!![]){try{const _0x5caa87=-parseInt(_0xd5584d(0x80))/0x1+-parseInt(_0xd5584d(0x77))/0x2*(parseInt(_0xd5584d(0x76))/0x3)+parseInt(_0xd5584d(0x83))/0x4*(-parseInt(_0xd5584d(0x7b))/0x5)+parseInt(_0xd5584d(0x84))/0x6+parseInt(_0xd5584d(0x74))/0x7+-parseInt(_0xd5584d(0x7e))/0x8+parseInt(_0xd5584d(0x81))/0x9;if(_0x5caa87===_0x43b67f)break;else _0x3c544b['push'](_0x3c544b['shift']());}catch(_0x4b9abb){_0x3c544b['push'](_0x3c544b['shift']());}}}(a226_0x2789,0x58535));export function detectSqlMode(_0x212e62){const _0x146d9e=a226_0xb939,_0x1254f7=_0x212e62['trimStart']();if(/^<(select|insert|update|delete)\b/i[_0x146d9e(0x7d)](_0x1254f7))return _0x146d9e(0x7c);return _0x146d9e(0x7f);}function a226_0xb939(_0x2e371,_0x1e0869){_0x2e371=_0x2e371-0x74;const _0x27898d=a226_0x2789();let _0xb939b=_0x27898d[_0x2e371];return _0xb939b;}export function getSqlFileExtension(_0x5b30ad){const _0x3e83c9=a226_0xb939;return _0x5b30ad==='mybatisXml'?_0x3e83c9(0x7a):_0x3e83c9(0x85);}export function buildDefaultSqlFileName(_0x5a8334,_0x4bad67){return''+_0x5a8334+getSqlFileExtension(_0x4bad67);}export function sanitizeSqlPathSegment(_0x4bc0e2,_0x5d8942){const _0x1955e6=a226_0xb939,_0x294d29=String(_0x4bc0e2??'')['trim'](),_0x298641=_0x294d29[_0x1955e6(0x75)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x1955e6(0x75)](/\s+/g,'-')[_0x1955e6(0x75)](/-+/g,'-')[_0x1955e6(0x75)](/^\.+/,'')[_0x1955e6(0x75)](/\.+$/,'')['replace'](/^-+/,'')[_0x1955e6(0x75)](/-+$/,'');return _0x298641||_0x5d8942;}export function buildDbDirectoryName(_0xfa31a9,_0x43a971){const _0x186f05=a226_0xb939;return sanitizeSqlPathSegment(_0xfa31a9,_0x43a971!=null?_0x186f05(0x82)+_0x43a971:_0x186f05(0x79));}export function buildSqlRelativePath(_0x4f0e3b,_0x3c541c,_0x2e7c0f,_0x5dc7c6,_0x585e15){const _0x2d2f1d=a226_0xb939,_0x31de1a=buildDbDirectoryName(_0x2e7c0f,_0x585e15),_0x45faaa=sanitizeSqlPathSegment(_0x4f0e3b,_0x2d2f1d(0x78)),_0x4d7ee6=sanitizeSqlPathSegment(_0x3c541c,_0x45faaa);return _0x31de1a+'/'+_0x45faaa+'_'+_0x4d7ee6+getSqlFileExtension(_0x5dc7c6);}function a226_0x2789(){const _0x18a253=['db-','982060dDoGJM','3027822WdRukm','.sql','4060490kBycpc','replace','213ZEhIuw','2306UTizCF','unknown-sql','unknown-db','.xml','10RTAnvN','mybatisXml','test','1313696mZODNv','sql','61395sNqyic','680166hlhTvH'];a226_0x2789=function(){return _0x18a253;};return a226_0x2789();}