@warlock.js/cascade 4.0.48 → 4.0.59

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 (401) hide show
  1. package/cjs/context/database-data-source-context.d.ts +29 -0
  2. package/cjs/context/database-data-source-context.d.ts.map +1 -0
  3. package/cjs/context/database-data-source-context.js +28 -0
  4. package/cjs/context/database-data-source-context.js.map +1 -0
  5. package/cjs/context/database-transaction-context.d.ts +31 -0
  6. package/cjs/context/database-transaction-context.d.ts.map +1 -0
  7. package/cjs/context/database-transaction-context.js +34 -0
  8. package/cjs/context/database-transaction-context.js.map +1 -0
  9. package/cjs/contracts/database-driver.contract.d.ts +143 -0
  10. package/cjs/contracts/database-driver.contract.d.ts.map +1 -0
  11. package/cjs/contracts/database-id-generator.contract.d.ts +109 -0
  12. package/cjs/contracts/database-id-generator.contract.d.ts.map +1 -0
  13. package/cjs/contracts/database-remover.contract.d.ts +104 -0
  14. package/cjs/contracts/database-remover.contract.d.ts.map +1 -0
  15. package/cjs/contracts/database-restorer.contract.d.ts +143 -0
  16. package/cjs/contracts/database-restorer.contract.d.ts.map +1 -0
  17. package/cjs/contracts/database-writer.contract.d.ts +119 -0
  18. package/cjs/contracts/database-writer.contract.d.ts.map +1 -0
  19. package/cjs/contracts/driver-blueprint.contract.d.ts +45 -0
  20. package/cjs/contracts/driver-blueprint.contract.d.ts.map +1 -0
  21. package/cjs/contracts/index.d.ts +10 -0
  22. package/cjs/contracts/index.d.ts.map +1 -0
  23. package/cjs/contracts/migration-driver.contract.d.ts +365 -0
  24. package/cjs/contracts/migration-driver.contract.d.ts.map +1 -0
  25. package/cjs/contracts/query-builder.contract.d.ts +1128 -0
  26. package/cjs/contracts/query-builder.contract.d.ts.map +1 -0
  27. package/cjs/contracts/sync-adapter.contract.d.ts +58 -0
  28. package/cjs/contracts/sync-adapter.contract.d.ts.map +1 -0
  29. package/cjs/data-source/data-source-registry.d.ts +104 -0
  30. package/cjs/data-source/data-source-registry.d.ts.map +1 -0
  31. package/cjs/data-source/data-source-registry.js +138 -0
  32. package/cjs/data-source/data-source-registry.js.map +1 -0
  33. package/cjs/data-source/data-source.d.ts +106 -0
  34. package/cjs/data-source/data-source.d.ts.map +1 -0
  35. package/cjs/data-source/data-source.js +77 -0
  36. package/cjs/data-source/data-source.js.map +1 -0
  37. package/cjs/database-dirty-tracker.d.ts +253 -0
  38. package/cjs/database-dirty-tracker.d.ts.map +1 -0
  39. package/cjs/database-dirty-tracker.js +389 -0
  40. package/cjs/database-dirty-tracker.js.map +1 -0
  41. package/cjs/drivers/mongo/mongo-id-generator.d.ts +116 -0
  42. package/cjs/drivers/mongo/mongo-id-generator.d.ts.map +1 -0
  43. package/cjs/drivers/mongo/mongo-id-generator.js +149 -0
  44. package/cjs/drivers/mongo/mongo-id-generator.js.map +1 -0
  45. package/cjs/drivers/mongo/mongo-migration-driver.d.ts +228 -0
  46. package/cjs/drivers/mongo/mongo-migration-driver.d.ts.map +1 -0
  47. package/cjs/drivers/mongo/mongo-migration-driver.js +524 -0
  48. package/cjs/drivers/mongo/mongo-migration-driver.js.map +1 -0
  49. package/cjs/drivers/mongo/mongo-query-builder.d.ts +922 -0
  50. package/cjs/drivers/mongo/mongo-query-builder.d.ts.map +1 -0
  51. package/cjs/drivers/mongo/mongo-query-builder.js +1740 -0
  52. package/cjs/drivers/mongo/mongo-query-builder.js.map +1 -0
  53. package/cjs/drivers/mongo/mongo-query-operations.d.ts +226 -0
  54. package/cjs/drivers/mongo/mongo-query-operations.d.ts.map +1 -0
  55. package/cjs/drivers/mongo/mongo-query-operations.js +270 -0
  56. package/cjs/drivers/mongo/mongo-query-operations.js.map +1 -0
  57. package/cjs/drivers/mongo/mongo-query-parser.d.ts +262 -0
  58. package/cjs/drivers/mongo/mongo-query-parser.d.ts.map +1 -0
  59. package/cjs/drivers/mongo/mongo-query-parser.js +1351 -0
  60. package/cjs/drivers/mongo/mongo-query-parser.js.map +1 -0
  61. package/cjs/drivers/mongo/mongo-sync-adapter.d.ts +79 -0
  62. package/cjs/drivers/mongo/mongo-sync-adapter.d.ts.map +1 -0
  63. package/cjs/drivers/mongo/mongo-sync-adapter.js +146 -0
  64. package/cjs/drivers/mongo/mongo-sync-adapter.js.map +1 -0
  65. package/cjs/drivers/mongo/mongodb-blueprint.d.ts +30 -0
  66. package/cjs/drivers/mongo/mongodb-blueprint.d.ts.map +1 -0
  67. package/cjs/drivers/mongo/mongodb-blueprint.js +51 -0
  68. package/cjs/drivers/mongo/mongodb-blueprint.js.map +1 -0
  69. package/cjs/drivers/mongo/mongodb-driver.d.ts +188 -0
  70. package/cjs/drivers/mongo/mongodb-driver.d.ts.map +1 -0
  71. package/cjs/drivers/mongo/mongodb-driver.js +411 -0
  72. package/cjs/drivers/mongo/mongodb-driver.js.map +1 -0
  73. package/cjs/drivers/mongo/types.d.ts +43 -0
  74. package/cjs/drivers/mongo/types.d.ts.map +1 -0
  75. package/cjs/errors/missing-data-source.error.d.ts +22 -0
  76. package/cjs/errors/missing-data-source.error.d.ts.map +1 -0
  77. package/cjs/errors/missing-data-source.error.js +29 -0
  78. package/cjs/errors/missing-data-source.error.js.map +1 -0
  79. package/cjs/events/model-events.d.ts +231 -0
  80. package/cjs/events/model-events.d.ts.map +1 -0
  81. package/cjs/events/model-events.js +259 -0
  82. package/cjs/events/model-events.js.map +1 -0
  83. package/cjs/expressions/aggregate-expressions.d.ts +215 -0
  84. package/cjs/expressions/aggregate-expressions.d.ts.map +1 -0
  85. package/cjs/expressions/aggregate-expressions.js +221 -0
  86. package/cjs/expressions/aggregate-expressions.js.map +1 -0
  87. package/cjs/expressions/index.d.ts +2 -0
  88. package/cjs/expressions/index.d.ts.map +1 -0
  89. package/cjs/index.d.ts +41 -0
  90. package/cjs/index.d.ts.map +1 -0
  91. package/cjs/index.js +1 -267
  92. package/cjs/index.js.map +1 -1
  93. package/cjs/migration/column-builder.d.ts +167 -0
  94. package/cjs/migration/column-builder.d.ts.map +1 -0
  95. package/cjs/migration/column-builder.js +217 -0
  96. package/cjs/migration/column-builder.js.map +1 -0
  97. package/cjs/migration/foreign-key-builder.d.ts +110 -0
  98. package/cjs/migration/foreign-key-builder.d.ts.map +1 -0
  99. package/cjs/migration/foreign-key-builder.js +129 -0
  100. package/cjs/migration/foreign-key-builder.js.map +1 -0
  101. package/cjs/migration/index.d.ts +6 -0
  102. package/cjs/migration/index.d.ts.map +1 -0
  103. package/cjs/migration/migration-runner.d.ts +231 -0
  104. package/cjs/migration/migration-runner.d.ts.map +1 -0
  105. package/cjs/migration/migration-runner.js +443 -0
  106. package/cjs/migration/migration-runner.js.map +1 -0
  107. package/cjs/migration/migration.js +1346 -0
  108. package/cjs/migration/migration.js.map +1 -0
  109. package/cjs/migration/types.d.ts +132 -0
  110. package/cjs/migration/types.d.ts.map +1 -0
  111. package/cjs/model/model.d.ts +1267 -0
  112. package/cjs/model/model.d.ts.map +1 -0
  113. package/cjs/model/model.js +1463 -0
  114. package/cjs/model/model.js.map +1 -0
  115. package/cjs/model/register-model.d.ts +80 -0
  116. package/cjs/model/register-model.d.ts.map +1 -0
  117. package/cjs/model/register-model.js +91 -0
  118. package/cjs/model/register-model.js.map +1 -0
  119. package/cjs/remover/database-remover.d.ts +100 -0
  120. package/cjs/remover/database-remover.d.ts.map +1 -0
  121. package/cjs/remover/database-remover.js +209 -0
  122. package/cjs/remover/database-remover.js.map +1 -0
  123. package/cjs/restorer/database-restorer.d.ts +131 -0
  124. package/cjs/restorer/database-restorer.d.ts.map +1 -0
  125. package/cjs/restorer/database-restorer.js +425 -0
  126. package/cjs/restorer/database-restorer.js.map +1 -0
  127. package/cjs/sync/index.d.ts +12 -0
  128. package/cjs/sync/index.d.ts.map +1 -0
  129. package/cjs/sync/model-events.d.ts +62 -0
  130. package/cjs/sync/model-events.d.ts.map +1 -0
  131. package/cjs/sync/model-events.js +49 -0
  132. package/cjs/sync/model-events.js.map +1 -0
  133. package/cjs/sync/model-sync-operation.d.ts +163 -0
  134. package/cjs/sync/model-sync-operation.d.ts.map +1 -0
  135. package/cjs/sync/model-sync-operation.js +292 -0
  136. package/cjs/sync/model-sync-operation.js.map +1 -0
  137. package/cjs/sync/model-sync.d.ts +130 -0
  138. package/cjs/sync/model-sync.d.ts.map +1 -0
  139. package/cjs/sync/model-sync.js +178 -0
  140. package/cjs/sync/model-sync.js.map +1 -0
  141. package/cjs/sync/sync-context.d.ts +70 -0
  142. package/cjs/sync/sync-context.d.ts.map +1 -0
  143. package/cjs/sync/sync-context.js +101 -0
  144. package/cjs/sync/sync-context.js.map +1 -0
  145. package/cjs/sync/sync-manager.d.ts +213 -0
  146. package/cjs/sync/sync-manager.d.ts.map +1 -0
  147. package/cjs/sync/sync-manager.js +689 -0
  148. package/cjs/sync/sync-manager.js.map +1 -0
  149. package/cjs/sync/types.d.ts +289 -0
  150. package/cjs/sync/types.d.ts.map +1 -0
  151. package/cjs/types.d.ts +45 -0
  152. package/cjs/types.d.ts.map +1 -0
  153. package/cjs/utils/connect-to-database.d.ts +246 -0
  154. package/cjs/utils/connect-to-database.d.ts.map +1 -0
  155. package/cjs/utils/connect-to-database.js +92 -0
  156. package/cjs/utils/connect-to-database.js.map +1 -0
  157. package/cjs/utils/database-writer.utils.d.ts +15 -0
  158. package/cjs/utils/database-writer.utils.d.ts.map +1 -0
  159. package/cjs/utils/database-writer.utils.js +14 -0
  160. package/cjs/utils/database-writer.utils.js.map +1 -0
  161. package/cjs/utils/define-model.js +100 -0
  162. package/cjs/utils/define-model.js.map +1 -0
  163. package/cjs/utils/once-connected.d.ts +146 -0
  164. package/cjs/utils/once-connected.d.ts.map +1 -0
  165. package/cjs/utils/once-connected.js +252 -0
  166. package/cjs/utils/once-connected.js.map +1 -0
  167. package/cjs/validation/database-seal-plugins.d.ts +2 -0
  168. package/cjs/validation/database-seal-plugins.d.ts.map +1 -0
  169. package/cjs/validation/database-seal-plugins.js +4 -0
  170. package/cjs/validation/database-seal-plugins.js.map +1 -0
  171. package/cjs/validation/database-writer-validation-error.d.ts +97 -0
  172. package/cjs/validation/database-writer-validation-error.d.ts.map +1 -0
  173. package/cjs/validation/database-writer-validation-error.js +160 -0
  174. package/cjs/validation/database-writer-validation-error.js.map +1 -0
  175. package/cjs/validation/index.d.ts +3 -0
  176. package/cjs/validation/index.d.ts.map +1 -0
  177. package/cjs/validation/mutators/embed-mutator.d.ts +9 -0
  178. package/cjs/validation/mutators/embed-mutator.d.ts.map +1 -0
  179. package/cjs/validation/mutators/embed-mutator.js +33 -0
  180. package/cjs/validation/mutators/embed-mutator.js.map +1 -0
  181. package/cjs/validation/plugins/embed-validator-plugin.d.ts +24 -0
  182. package/cjs/validation/plugins/embed-validator-plugin.d.ts.map +1 -0
  183. package/cjs/validation/plugins/embed-validator-plugin.js +18 -0
  184. package/cjs/validation/plugins/embed-validator-plugin.js.map +1 -0
  185. package/cjs/validation/rules/database-model-rule.d.ts +7 -0
  186. package/cjs/validation/rules/database-model-rule.d.ts.map +1 -0
  187. package/cjs/validation/rules/database-model-rule.js +27 -0
  188. package/cjs/validation/rules/database-model-rule.js.map +1 -0
  189. package/cjs/validation/transformers/embed-model-transformer.d.ts +3 -0
  190. package/cjs/validation/transformers/embed-model-transformer.d.ts.map +1 -0
  191. package/cjs/validation/transformers/embed-model-transformer.js +18 -0
  192. package/cjs/validation/transformers/embed-model-transformer.js.map +1 -0
  193. package/cjs/validation/validators/embed-validator.d.ts +21 -0
  194. package/cjs/validation/validators/embed-validator.d.ts.map +1 -0
  195. package/cjs/validation/validators/embed-validator.js +42 -0
  196. package/cjs/validation/validators/embed-validator.js.map +1 -0
  197. package/cjs/writer/database-writer.d.ts +181 -0
  198. package/cjs/writer/database-writer.d.ts.map +1 -0
  199. package/cjs/writer/database-writer.js +402 -0
  200. package/cjs/writer/database-writer.js.map +1 -0
  201. package/esm/context/database-data-source-context.d.ts +29 -0
  202. package/esm/context/database-data-source-context.d.ts.map +1 -0
  203. package/esm/context/database-data-source-context.js +28 -0
  204. package/esm/context/database-data-source-context.js.map +1 -0
  205. package/esm/context/database-transaction-context.d.ts +31 -0
  206. package/esm/context/database-transaction-context.d.ts.map +1 -0
  207. package/esm/context/database-transaction-context.js +34 -0
  208. package/esm/context/database-transaction-context.js.map +1 -0
  209. package/esm/contracts/database-driver.contract.d.ts +143 -0
  210. package/esm/contracts/database-driver.contract.d.ts.map +1 -0
  211. package/esm/contracts/database-id-generator.contract.d.ts +109 -0
  212. package/esm/contracts/database-id-generator.contract.d.ts.map +1 -0
  213. package/esm/contracts/database-remover.contract.d.ts +104 -0
  214. package/esm/contracts/database-remover.contract.d.ts.map +1 -0
  215. package/esm/contracts/database-restorer.contract.d.ts +143 -0
  216. package/esm/contracts/database-restorer.contract.d.ts.map +1 -0
  217. package/esm/contracts/database-writer.contract.d.ts +119 -0
  218. package/esm/contracts/database-writer.contract.d.ts.map +1 -0
  219. package/esm/contracts/driver-blueprint.contract.d.ts +45 -0
  220. package/esm/contracts/driver-blueprint.contract.d.ts.map +1 -0
  221. package/esm/contracts/index.d.ts +10 -0
  222. package/esm/contracts/index.d.ts.map +1 -0
  223. package/esm/contracts/migration-driver.contract.d.ts +365 -0
  224. package/esm/contracts/migration-driver.contract.d.ts.map +1 -0
  225. package/esm/contracts/query-builder.contract.d.ts +1128 -0
  226. package/esm/contracts/query-builder.contract.d.ts.map +1 -0
  227. package/esm/contracts/sync-adapter.contract.d.ts +58 -0
  228. package/esm/contracts/sync-adapter.contract.d.ts.map +1 -0
  229. package/esm/data-source/data-source-registry.d.ts +104 -0
  230. package/esm/data-source/data-source-registry.d.ts.map +1 -0
  231. package/esm/data-source/data-source-registry.js +138 -0
  232. package/esm/data-source/data-source-registry.js.map +1 -0
  233. package/esm/data-source/data-source.d.ts +106 -0
  234. package/esm/data-source/data-source.d.ts.map +1 -0
  235. package/esm/data-source/data-source.js +77 -0
  236. package/esm/data-source/data-source.js.map +1 -0
  237. package/esm/database-dirty-tracker.d.ts +253 -0
  238. package/esm/database-dirty-tracker.d.ts.map +1 -0
  239. package/esm/database-dirty-tracker.js +389 -0
  240. package/esm/database-dirty-tracker.js.map +1 -0
  241. package/esm/drivers/mongo/mongo-id-generator.d.ts +116 -0
  242. package/esm/drivers/mongo/mongo-id-generator.d.ts.map +1 -0
  243. package/esm/drivers/mongo/mongo-id-generator.js +149 -0
  244. package/esm/drivers/mongo/mongo-id-generator.js.map +1 -0
  245. package/esm/drivers/mongo/mongo-migration-driver.d.ts +228 -0
  246. package/esm/drivers/mongo/mongo-migration-driver.d.ts.map +1 -0
  247. package/esm/drivers/mongo/mongo-migration-driver.js +524 -0
  248. package/esm/drivers/mongo/mongo-migration-driver.js.map +1 -0
  249. package/esm/drivers/mongo/mongo-query-builder.d.ts +922 -0
  250. package/esm/drivers/mongo/mongo-query-builder.d.ts.map +1 -0
  251. package/esm/drivers/mongo/mongo-query-builder.js +1740 -0
  252. package/esm/drivers/mongo/mongo-query-builder.js.map +1 -0
  253. package/esm/drivers/mongo/mongo-query-operations.d.ts +226 -0
  254. package/esm/drivers/mongo/mongo-query-operations.d.ts.map +1 -0
  255. package/esm/drivers/mongo/mongo-query-operations.js +270 -0
  256. package/esm/drivers/mongo/mongo-query-operations.js.map +1 -0
  257. package/esm/drivers/mongo/mongo-query-parser.d.ts +262 -0
  258. package/esm/drivers/mongo/mongo-query-parser.d.ts.map +1 -0
  259. package/esm/drivers/mongo/mongo-query-parser.js +1351 -0
  260. package/esm/drivers/mongo/mongo-query-parser.js.map +1 -0
  261. package/esm/drivers/mongo/mongo-sync-adapter.d.ts +79 -0
  262. package/esm/drivers/mongo/mongo-sync-adapter.d.ts.map +1 -0
  263. package/esm/drivers/mongo/mongo-sync-adapter.js +146 -0
  264. package/esm/drivers/mongo/mongo-sync-adapter.js.map +1 -0
  265. package/esm/drivers/mongo/mongodb-blueprint.d.ts +30 -0
  266. package/esm/drivers/mongo/mongodb-blueprint.d.ts.map +1 -0
  267. package/esm/drivers/mongo/mongodb-blueprint.js +51 -0
  268. package/esm/drivers/mongo/mongodb-blueprint.js.map +1 -0
  269. package/esm/drivers/mongo/mongodb-driver.d.ts +188 -0
  270. package/esm/drivers/mongo/mongodb-driver.d.ts.map +1 -0
  271. package/esm/drivers/mongo/mongodb-driver.js +411 -0
  272. package/esm/drivers/mongo/mongodb-driver.js.map +1 -0
  273. package/esm/drivers/mongo/types.d.ts +43 -0
  274. package/esm/drivers/mongo/types.d.ts.map +1 -0
  275. package/esm/errors/missing-data-source.error.d.ts +22 -0
  276. package/esm/errors/missing-data-source.error.d.ts.map +1 -0
  277. package/esm/errors/missing-data-source.error.js +29 -0
  278. package/esm/errors/missing-data-source.error.js.map +1 -0
  279. package/esm/events/model-events.d.ts +231 -0
  280. package/esm/events/model-events.d.ts.map +1 -0
  281. package/esm/events/model-events.js +259 -0
  282. package/esm/events/model-events.js.map +1 -0
  283. package/esm/expressions/aggregate-expressions.d.ts +215 -0
  284. package/esm/expressions/aggregate-expressions.d.ts.map +1 -0
  285. package/esm/expressions/aggregate-expressions.js +221 -0
  286. package/esm/expressions/aggregate-expressions.js.map +1 -0
  287. package/esm/expressions/index.d.ts +2 -0
  288. package/esm/expressions/index.d.ts.map +1 -0
  289. package/esm/index.d.ts +41 -0
  290. package/esm/index.d.ts.map +1 -0
  291. package/esm/index.js +1 -40
  292. package/esm/index.js.map +1 -1
  293. package/esm/migration/column-builder.d.ts +167 -0
  294. package/esm/migration/column-builder.d.ts.map +1 -0
  295. package/esm/migration/column-builder.js +217 -0
  296. package/esm/migration/column-builder.js.map +1 -0
  297. package/esm/migration/foreign-key-builder.d.ts +110 -0
  298. package/esm/migration/foreign-key-builder.d.ts.map +1 -0
  299. package/esm/migration/foreign-key-builder.js +129 -0
  300. package/esm/migration/foreign-key-builder.js.map +1 -0
  301. package/esm/migration/index.d.ts +6 -0
  302. package/esm/migration/index.d.ts.map +1 -0
  303. package/esm/migration/migration-runner.d.ts +231 -0
  304. package/esm/migration/migration-runner.d.ts.map +1 -0
  305. package/esm/migration/migration-runner.js +443 -0
  306. package/esm/migration/migration-runner.js.map +1 -0
  307. package/esm/migration/migration.js +1346 -0
  308. package/esm/migration/migration.js.map +1 -0
  309. package/esm/migration/types.d.ts +132 -0
  310. package/esm/migration/types.d.ts.map +1 -0
  311. package/esm/model/model.d.ts +1267 -0
  312. package/esm/model/model.d.ts.map +1 -0
  313. package/esm/model/model.js +1463 -0
  314. package/esm/model/model.js.map +1 -0
  315. package/esm/model/register-model.d.ts +80 -0
  316. package/esm/model/register-model.d.ts.map +1 -0
  317. package/esm/model/register-model.js +91 -0
  318. package/esm/model/register-model.js.map +1 -0
  319. package/esm/remover/database-remover.d.ts +100 -0
  320. package/esm/remover/database-remover.d.ts.map +1 -0
  321. package/esm/remover/database-remover.js +209 -0
  322. package/esm/remover/database-remover.js.map +1 -0
  323. package/esm/restorer/database-restorer.d.ts +131 -0
  324. package/esm/restorer/database-restorer.d.ts.map +1 -0
  325. package/esm/restorer/database-restorer.js +425 -0
  326. package/esm/restorer/database-restorer.js.map +1 -0
  327. package/esm/sync/index.d.ts +12 -0
  328. package/esm/sync/index.d.ts.map +1 -0
  329. package/esm/sync/model-events.d.ts +62 -0
  330. package/esm/sync/model-events.d.ts.map +1 -0
  331. package/esm/sync/model-events.js +49 -0
  332. package/esm/sync/model-events.js.map +1 -0
  333. package/esm/sync/model-sync-operation.d.ts +163 -0
  334. package/esm/sync/model-sync-operation.d.ts.map +1 -0
  335. package/esm/sync/model-sync-operation.js +292 -0
  336. package/esm/sync/model-sync-operation.js.map +1 -0
  337. package/esm/sync/model-sync.d.ts +130 -0
  338. package/esm/sync/model-sync.d.ts.map +1 -0
  339. package/esm/sync/model-sync.js +178 -0
  340. package/esm/sync/model-sync.js.map +1 -0
  341. package/esm/sync/sync-context.d.ts +70 -0
  342. package/esm/sync/sync-context.d.ts.map +1 -0
  343. package/esm/sync/sync-context.js +101 -0
  344. package/esm/sync/sync-context.js.map +1 -0
  345. package/esm/sync/sync-manager.d.ts +213 -0
  346. package/esm/sync/sync-manager.d.ts.map +1 -0
  347. package/esm/sync/sync-manager.js +689 -0
  348. package/esm/sync/sync-manager.js.map +1 -0
  349. package/esm/sync/types.d.ts +289 -0
  350. package/esm/sync/types.d.ts.map +1 -0
  351. package/esm/types.d.ts +45 -0
  352. package/esm/types.d.ts.map +1 -0
  353. package/esm/utils/connect-to-database.d.ts +246 -0
  354. package/esm/utils/connect-to-database.d.ts.map +1 -0
  355. package/esm/utils/connect-to-database.js +92 -0
  356. package/esm/utils/connect-to-database.js.map +1 -0
  357. package/esm/utils/database-writer.utils.d.ts +15 -0
  358. package/esm/utils/database-writer.utils.d.ts.map +1 -0
  359. package/esm/utils/database-writer.utils.js +14 -0
  360. package/esm/utils/database-writer.utils.js.map +1 -0
  361. package/esm/utils/define-model.js +100 -0
  362. package/esm/utils/define-model.js.map +1 -0
  363. package/esm/utils/once-connected.d.ts +146 -0
  364. package/esm/utils/once-connected.d.ts.map +1 -0
  365. package/esm/utils/once-connected.js +252 -0
  366. package/esm/utils/once-connected.js.map +1 -0
  367. package/esm/validation/database-seal-plugins.d.ts +2 -0
  368. package/esm/validation/database-seal-plugins.d.ts.map +1 -0
  369. package/esm/validation/database-seal-plugins.js +4 -0
  370. package/esm/validation/database-seal-plugins.js.map +1 -0
  371. package/esm/validation/database-writer-validation-error.d.ts +97 -0
  372. package/esm/validation/database-writer-validation-error.d.ts.map +1 -0
  373. package/esm/validation/database-writer-validation-error.js +160 -0
  374. package/esm/validation/database-writer-validation-error.js.map +1 -0
  375. package/esm/validation/index.d.ts +3 -0
  376. package/esm/validation/index.d.ts.map +1 -0
  377. package/esm/validation/mutators/embed-mutator.d.ts +9 -0
  378. package/esm/validation/mutators/embed-mutator.d.ts.map +1 -0
  379. package/esm/validation/mutators/embed-mutator.js +33 -0
  380. package/esm/validation/mutators/embed-mutator.js.map +1 -0
  381. package/esm/validation/plugins/embed-validator-plugin.d.ts +24 -0
  382. package/esm/validation/plugins/embed-validator-plugin.d.ts.map +1 -0
  383. package/esm/validation/plugins/embed-validator-plugin.js +18 -0
  384. package/esm/validation/plugins/embed-validator-plugin.js.map +1 -0
  385. package/esm/validation/rules/database-model-rule.d.ts +7 -0
  386. package/esm/validation/rules/database-model-rule.d.ts.map +1 -0
  387. package/esm/validation/rules/database-model-rule.js +27 -0
  388. package/esm/validation/rules/database-model-rule.js.map +1 -0
  389. package/esm/validation/transformers/embed-model-transformer.d.ts +3 -0
  390. package/esm/validation/transformers/embed-model-transformer.d.ts.map +1 -0
  391. package/esm/validation/transformers/embed-model-transformer.js +18 -0
  392. package/esm/validation/transformers/embed-model-transformer.js.map +1 -0
  393. package/esm/validation/validators/embed-validator.d.ts +21 -0
  394. package/esm/validation/validators/embed-validator.d.ts.map +1 -0
  395. package/esm/validation/validators/embed-validator.js +42 -0
  396. package/esm/validation/validators/embed-validator.js.map +1 -0
  397. package/esm/writer/database-writer.d.ts +181 -0
  398. package/esm/writer/database-writer.d.ts.map +1 -0
  399. package/esm/writer/database-writer.js +402 -0
  400. package/esm/writer/database-writer.js.map +1 -0
  401. package/package.json +61 -52
@@ -0,0 +1,116 @@
1
+ import type { GenerateIdOptions, IdGeneratorContract } from "../../contracts";
2
+ import type { MongoDbDriver } from "./mongodb-driver";
3
+ /**
4
+ * MongoDB-specific ID generator for auto-incrementing integer IDs.
5
+ *
6
+ * Maintains a separate collection that tracks the last generated ID for each table.
7
+ * Generates auto-incrementing IDs similar to SQL's AUTO_INCREMENT feature.
8
+ *
9
+ * **Collection Structure:**
10
+ * ```json
11
+ * {
12
+ * "collection": "users",
13
+ * "id": 12345
14
+ * }
15
+ * ```
16
+ *
17
+ * **Features:**
18
+ * - Atomic ID generation using findOneAndUpdate with aggregation pipeline
19
+ * - Automatic transaction support (driver handles session context)
20
+ * - Configurable initial ID and increment values
21
+ * - Thread-safe and concurrent-safe
22
+ *
23
+ * @example
24
+ * ```typescript
25
+ * const mongoDriver = new MongoDbDriver(config);
26
+ * const idGenerator = new MongoIdGenerator(mongoDriver);
27
+ *
28
+ * const dataSource = new DataSource({
29
+ * name: "primary",
30
+ * driver: mongoDriver,
31
+ * idGenerator,
32
+ * });
33
+ *
34
+ * // Generate IDs with custom configuration
35
+ * const id = await idGenerator.generateNextId({
36
+ * table: "users",
37
+ * initialId: 1000,
38
+ * incrementIdBy: 1
39
+ * });
40
+ * ```
41
+ */
42
+ export declare class MongoIdGenerator implements IdGeneratorContract {
43
+ private readonly driver;
44
+ /**
45
+ * The collection name that stores ID counters.
46
+ * Each document tracks the last ID for a specific table.
47
+ *
48
+ * Named "MasterMind" for backward compatibility with legacy Cascade.
49
+ */
50
+ readonly counterCollection: string;
51
+ /**
52
+ * Create a new MongoDB ID generator instance.
53
+ *
54
+ * @param driver - The MongoDB driver instance
55
+ * @param counterCollection - Name of the collection storing ID counters (default: "MasterMind")
56
+ *
57
+ * @example
58
+ * ```typescript
59
+ * const idGenerator = new MongoIdGenerator(mongoDriver, "id_counters");
60
+ * ```
61
+ */
62
+ constructor(driver: MongoDbDriver, counterCollection?: string);
63
+ /**
64
+ * Generate the next ID for a table.
65
+ *
66
+ * Uses atomic findOneAndUpdate with aggregation pipeline to ensure uniqueness
67
+ * even in concurrent scenarios. Automatically participates in active transactions.
68
+ *
69
+ * @param options - Configuration for ID generation
70
+ * @returns The generated ID
71
+ *
72
+ * @example
73
+ * ```typescript
74
+ * // Simple usage
75
+ * const id = await idGenerator.generateNextId({ table: "users" });
76
+ *
77
+ * // With custom initial ID
78
+ * const id = await idGenerator.generateNextId({
79
+ * table: "products",
80
+ * initialId: 1000,
81
+ * incrementIdBy: 1
82
+ * });
83
+ * ```
84
+ */
85
+ generateNextId(options: GenerateIdOptions): Promise<number>;
86
+ /**
87
+ * Get the last generated ID for a table.
88
+ *
89
+ * @param table - The table/collection name
90
+ * @returns The last generated ID, or 0 if none exists
91
+ *
92
+ * @example
93
+ * ```typescript
94
+ * const lastId = await idGenerator.getLastId("users");
95
+ * console.log(`Last user ID: ${lastId}`);
96
+ * ```
97
+ */
98
+ getLastId(table: string): Promise<number>;
99
+ /**
100
+ * Set the last ID for a table.
101
+ *
102
+ * Creates or updates the counter document for the specified table.
103
+ * Useful for seeding or resetting ID sequences.
104
+ *
105
+ * @param table - The table/collection name
106
+ * @param id - The ID to set as the last generated ID
107
+ *
108
+ * @example
109
+ * ```typescript
110
+ * // Reset user IDs to start from 1000
111
+ * await idGenerator.setLastId("users", 1000);
112
+ * ```
113
+ */
114
+ setLastId(table: string, id: number): Promise<void>;
115
+ }
116
+ //# sourceMappingURL=mongo-id-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mongo-id-generator.d.ts","sourceRoot":"","sources":["../../../src/drivers/mongo/mongo-id-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,qBAAa,gBAAiB,YAAW,mBAAmB;IAqBxD,OAAO,CAAC,QAAQ,CAAC,MAAM;IApBzB;;;;;OAKG;IACH,SAAgB,iBAAiB,EAAE,MAAM,CAAgB;IAEzD;;;;;;;;;;OAUG;gBAEgB,MAAM,EAAE,aAAa,EACtC,iBAAiB,CAAC,EAAE,MAAM;IAO5B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACU,cAAc,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC;IAkCxE;;;;;;;;;;;OAWG;IACU,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAMtD;;;;;;;;;;;;;;OAcG;IACU,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAQjE"}
@@ -0,0 +1,149 @@
1
+ 'use strict';/**
2
+ * MongoDB-specific ID generator for auto-incrementing integer IDs.
3
+ *
4
+ * Maintains a separate collection that tracks the last generated ID for each table.
5
+ * Generates auto-incrementing IDs similar to SQL's AUTO_INCREMENT feature.
6
+ *
7
+ * **Collection Structure:**
8
+ * ```json
9
+ * {
10
+ * "collection": "users",
11
+ * "id": 12345
12
+ * }
13
+ * ```
14
+ *
15
+ * **Features:**
16
+ * - Atomic ID generation using findOneAndUpdate with aggregation pipeline
17
+ * - Automatic transaction support (driver handles session context)
18
+ * - Configurable initial ID and increment values
19
+ * - Thread-safe and concurrent-safe
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * const mongoDriver = new MongoDbDriver(config);
24
+ * const idGenerator = new MongoIdGenerator(mongoDriver);
25
+ *
26
+ * const dataSource = new DataSource({
27
+ * name: "primary",
28
+ * driver: mongoDriver,
29
+ * idGenerator,
30
+ * });
31
+ *
32
+ * // Generate IDs with custom configuration
33
+ * const id = await idGenerator.generateNextId({
34
+ * table: "users",
35
+ * initialId: 1000,
36
+ * incrementIdBy: 1
37
+ * });
38
+ * ```
39
+ */
40
+ class MongoIdGenerator {
41
+ driver;
42
+ /**
43
+ * The collection name that stores ID counters.
44
+ * Each document tracks the last ID for a specific table.
45
+ *
46
+ * Named "MasterMind" for backward compatibility with legacy Cascade.
47
+ */
48
+ counterCollection = "MasterMind";
49
+ /**
50
+ * Create a new MongoDB ID generator instance.
51
+ *
52
+ * @param driver - The MongoDB driver instance
53
+ * @param counterCollection - Name of the collection storing ID counters (default: "MasterMind")
54
+ *
55
+ * @example
56
+ * ```typescript
57
+ * const idGenerator = new MongoIdGenerator(mongoDriver, "id_counters");
58
+ * ```
59
+ */
60
+ constructor(driver, counterCollection) {
61
+ this.driver = driver;
62
+ if (counterCollection) {
63
+ this.counterCollection = counterCollection;
64
+ }
65
+ }
66
+ /**
67
+ * Generate the next ID for a table.
68
+ *
69
+ * Uses atomic findOneAndUpdate with aggregation pipeline to ensure uniqueness
70
+ * even in concurrent scenarios. Automatically participates in active transactions.
71
+ *
72
+ * @param options - Configuration for ID generation
73
+ * @returns The generated ID
74
+ *
75
+ * @example
76
+ * ```typescript
77
+ * // Simple usage
78
+ * const id = await idGenerator.generateNextId({ table: "users" });
79
+ *
80
+ * // With custom initial ID
81
+ * const id = await idGenerator.generateNextId({
82
+ * table: "products",
83
+ * initialId: 1000,
84
+ * incrementIdBy: 1
85
+ * });
86
+ * ```
87
+ */
88
+ async generateNextId(options) {
89
+ const { table, initialId = 1, incrementIdBy = 1 } = options;
90
+ // Get the MongoDB database instance
91
+ const database = this.driver.getDatabase();
92
+ const collection = database.collection(this.counterCollection);
93
+ // Use atomic findOneAndUpdate with aggregation pipeline
94
+ // The driver's withSession method will automatically attach the session if in a transaction
95
+ const result = await collection.findOneAndUpdate({ collection: table }, [
96
+ {
97
+ $set: {
98
+ id: {
99
+ $cond: {
100
+ if: { $or: [{ $eq: ["$id", null] }, { $not: "$id" }] },
101
+ then: initialId,
102
+ else: { $add: ["$id", incrementIdBy] },
103
+ },
104
+ },
105
+ collection: table,
106
+ },
107
+ },
108
+ ], {
109
+ upsert: true,
110
+ returnDocument: "after",
111
+ });
112
+ return result?.id ?? initialId;
113
+ }
114
+ /**
115
+ * Get the last generated ID for a table.
116
+ *
117
+ * @param table - The table/collection name
118
+ * @returns The last generated ID, or 0 if none exists
119
+ *
120
+ * @example
121
+ * ```typescript
122
+ * const lastId = await idGenerator.getLastId("users");
123
+ * console.log(`Last user ID: ${lastId}`);
124
+ * ```
125
+ */
126
+ async getLastId(table) {
127
+ const query = this.driver.queryBuilder(this.counterCollection);
128
+ const doc = (await query.where("collection", table).first());
129
+ return doc?.id ?? 0;
130
+ }
131
+ /**
132
+ * Set the last ID for a table.
133
+ *
134
+ * Creates or updates the counter document for the specified table.
135
+ * Useful for seeding or resetting ID sequences.
136
+ *
137
+ * @param table - The table/collection name
138
+ * @param id - The ID to set as the last generated ID
139
+ *
140
+ * @example
141
+ * ```typescript
142
+ * // Reset user IDs to start from 1000
143
+ * await idGenerator.setLastId("users", 1000);
144
+ * ```
145
+ */
146
+ async setLastId(table, id) {
147
+ await this.driver.update(this.counterCollection, { collection: table }, { $set: { id, collection: table } }, { upsert: true });
148
+ }
149
+ }exports.MongoIdGenerator=MongoIdGenerator;//# sourceMappingURL=mongo-id-generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mongo-id-generator.js","sources":["../../../src/drivers/mongo/mongo-id-generator.ts"],"sourcesContent":[null],"names":[],"mappings":"aAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCG;MACU,gBAAgB,CAAA;AAqBR,IAAA,MAAA,CAAA;AApBnB;;;;;AAKG;IACa,iBAAiB,GAAW,YAAY,CAAC;AAEzD;;;;;;;;;;AAUG;IACH,WACmB,CAAA,MAAqB,EACtC,iBAA0B,EAAA;QADT,IAAM,CAAA,MAAA,GAAN,MAAM,CAAe;AAGtC,QAAA,IAAI,iBAAiB,EAAE;AACrB,YAAA,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;AAC5C,SAAA;KACF;AAED;;;;;;;;;;;;;;;;;;;;;AAqBG;IACI,MAAM,cAAc,CAAC,OAA0B,EAAA;AACpD,QAAA,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,CAAC,EAAE,aAAa,GAAG,CAAC,EAAE,GAAG,OAAO,CAAC;;QAG5D,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;QAC3C,MAAM,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;;;AAI/D,QAAA,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,gBAAgB,CAC9C,EAAE,UAAU,EAAE,KAAK,EAAE,EACrB;AACE,YAAA;AACE,gBAAA,IAAI,EAAE;AACJ,oBAAA,EAAE,EAAE;AACF,wBAAA,KAAK,EAAE;4BACL,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE;AACtD,4BAAA,IAAI,EAAE,SAAS;4BACf,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,EAAE;AACvC,yBAAA;AACF,qBAAA;AACD,oBAAA,UAAU,EAAE,KAAK;AAClB,iBAAA;AACF,aAAA;SACF,EACD;AACE,YAAA,MAAM,EAAE,IAAI;AACZ,YAAA,cAAc,EAAE,OAAO;AACxB,SAAA,CACF,CAAC;AAEF,QAAA,OAAO,MAAM,EAAE,EAAE,IAAI,SAAS,CAAC;KAChC;AAED;;;;;;;;;;;AAWG;IACI,MAAM,SAAS,CAAC,KAAa,EAAA;AAClC,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;AAC/D,QAAA,MAAM,GAAG,IAAI,MAAM,KAAK,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC,KAAK,EAAE,CAAmC,CAAC;AAC/F,QAAA,OAAQ,GAAG,EAAE,EAAa,IAAI,CAAC,CAAC;KACjC;AAED;;;;;;;;;;;;;;AAcG;AACI,IAAA,MAAM,SAAS,CAAC,KAAa,EAAE,EAAU,EAAA;AAC9C,QAAA,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CACtB,IAAI,CAAC,iBAAiB,EACtB,EAAE,UAAU,EAAE,KAAK,EAAE,EACrB,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EACnC,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB,CAAC;KACH;AACF"}
@@ -0,0 +1,228 @@
1
+ import type { ColumnDefinition, ForeignKeyDefinition, FullTextIndexOptions, GeoIndexOptions, IndexDefinition, MigrationDriverContract, VectorIndexOptions } from "../../contracts/migration-driver.contract";
2
+ import type { MongoDbDriver } from "./mongodb-driver";
3
+ /**
4
+ * MongoDB-specific migration driver implementation.
5
+ *
6
+ * Key behaviors:
7
+ * - Column operations are **no-ops** (MongoDB is schema-less)
8
+ * - Index operations use native `createIndex()`
9
+ * - Foreign keys are **no-ops** (MongoDB has no FK constraints)
10
+ * - TTL indexes supported natively
11
+ * - Vector indexes use Atlas Search (when available)
12
+ * - Schema validation uses `collMod` command
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * const migrationDriver = new MongoMigrationDriver(mongoDriver);
17
+ * await migrationDriver.createIndex("users", {
18
+ * columns: ["email"],
19
+ * unique: true,
20
+ * });
21
+ * ```
22
+ */
23
+ export declare class MongoMigrationDriver implements MigrationDriverContract {
24
+ private readonly driver;
25
+ /** Active transaction session (if any) */
26
+ private session?;
27
+ /**
28
+ * Create a new MongoDB migration driver.
29
+ *
30
+ * @param driver - The MongoDB driver instance
31
+ */
32
+ constructor(driver: MongoDbDriver);
33
+ /**
34
+ * Get the MongoDB database instance.
35
+ */
36
+ private get db();
37
+ /**
38
+ * Get session options for operations.
39
+ */
40
+ private get sessionOptions();
41
+ /**
42
+ * Create a new collection.
43
+ *
44
+ * MongoDB creates collections lazily on first insert, but this method
45
+ * creates them explicitly for migrations that need to add indexes or
46
+ * schema validation.
47
+ */
48
+ createTable(table: string): Promise<void>;
49
+ /**
50
+ * Create table if not exists
51
+ */
52
+ createTableIfNotExists(table: string): Promise<void>;
53
+ /**
54
+ * Drop an existing collection.
55
+ *
56
+ * @throws Error if collection doesn't exist
57
+ */
58
+ dropTable(table: string): Promise<void>;
59
+ /**
60
+ * Drop collection if it exists (no error if missing).
61
+ */
62
+ dropTableIfExists(table: string): Promise<void>;
63
+ /**
64
+ * Rename a collection.
65
+ */
66
+ renameTable(from: string, to: string): Promise<void>;
67
+ /**
68
+ * Check if a collection exists.
69
+ */
70
+ tableExists(table: string): Promise<boolean>;
71
+ /**
72
+ * Add a column (no-op for MongoDB).
73
+ *
74
+ * MongoDB is schema-less, so columns don't need to be declared.
75
+ */
76
+ addColumn(_table: string, _column: ColumnDefinition): Promise<void>;
77
+ /**
78
+ * Drop a column by running $unset on all documents.
79
+ *
80
+ * This actually removes the field from all documents in the collection.
81
+ */
82
+ dropColumn(table: string, column: string): Promise<void>;
83
+ /**
84
+ * Drop multiple columns by running $unset on all documents.
85
+ */
86
+ dropColumns(table: string, columns: string[]): Promise<void>;
87
+ /**
88
+ * Rename a column by running $rename on all documents.
89
+ */
90
+ renameColumn(table: string, from: string, to: string): Promise<void>;
91
+ /**
92
+ * Modify a column definition (no-op for MongoDB).
93
+ *
94
+ * MongoDB is schema-less, so column types don't need to be modified.
95
+ */
96
+ modifyColumn(_table: string, _column: ColumnDefinition): Promise<void>;
97
+ /**
98
+ * Create an index on one or more columns.
99
+ */
100
+ createIndex(table: string, index: IndexDefinition): Promise<void>;
101
+ /**
102
+ * Drop an index by name or columns.
103
+ *
104
+ * @param indexNameOrColumns - Index name (string) or columns array
105
+ */
106
+ dropIndex(table: string, indexNameOrColumns: string | string[]): Promise<void>;
107
+ /**
108
+ * Create a unique index/constraint.
109
+ */
110
+ createUniqueIndex(table: string, columns: string[], name?: string): Promise<void>;
111
+ /**
112
+ * Drop a unique index by finding its name from columns.
113
+ */
114
+ dropUniqueIndex(table: string, columns: string[]): Promise<void>;
115
+ /**
116
+ * Create a full-text search index.
117
+ *
118
+ * MongoDB uses "text" index type for full-text search.
119
+ */
120
+ createFullTextIndex(table: string, columns: string[], options?: FullTextIndexOptions): Promise<void>;
121
+ /**
122
+ * Drop a full-text search index.
123
+ */
124
+ dropFullTextIndex(table: string, name: string): Promise<void>;
125
+ /**
126
+ * Create a geo-spatial index.
127
+ */
128
+ createGeoIndex(table: string, column: string, options?: GeoIndexOptions): Promise<void>;
129
+ /**
130
+ * Drop a geo-spatial index.
131
+ */
132
+ dropGeoIndex(table: string, column: string): Promise<void>;
133
+ /**
134
+ * Create a vector search index for AI embeddings.
135
+ *
136
+ * Note: This requires MongoDB Atlas with Vector Search enabled.
137
+ * For self-hosted MongoDB, this will create a regular index on the field.
138
+ */
139
+ createVectorIndex(table: string, column: string, options: VectorIndexOptions): Promise<void>;
140
+ /**
141
+ * Drop a vector search index.
142
+ */
143
+ dropVectorIndex(table: string, column: string): Promise<void>;
144
+ /**
145
+ * Create a TTL (time-to-live) index for automatic document expiration.
146
+ */
147
+ createTTLIndex(table: string, column: string, expireAfterSeconds: number): Promise<void>;
148
+ /**
149
+ * Drop a TTL index.
150
+ */
151
+ dropTTLIndex(table: string, column: string): Promise<void>;
152
+ /**
153
+ * Add a foreign key constraint (no-op for MongoDB).
154
+ *
155
+ * MongoDB doesn't support foreign key constraints.
156
+ * Use application-level validation or DBRefs instead.
157
+ */
158
+ addForeignKey(_table: string, _foreignKey: ForeignKeyDefinition): Promise<void>;
159
+ /**
160
+ * Drop a foreign key constraint (no-op for MongoDB).
161
+ */
162
+ dropForeignKey(_table: string, _name: string): Promise<void>;
163
+ /**
164
+ * Add a primary key constraint (no-op for MongoDB).
165
+ *
166
+ * MongoDB always has _id as the primary key.
167
+ */
168
+ addPrimaryKey(_table: string, _columns: string[]): Promise<void>;
169
+ /**
170
+ * Drop the primary key constraint (no-op for MongoDB).
171
+ */
172
+ dropPrimaryKey(_table: string): Promise<void>;
173
+ /**
174
+ * Set JSON schema validation rules on a collection.
175
+ *
176
+ * Uses MongoDB's validator feature to enforce document structure.
177
+ *
178
+ * @example
179
+ * ```typescript
180
+ * await driver.setSchemaValidation("users", {
181
+ * bsonType: "object",
182
+ * required: ["name", "email"],
183
+ * properties: {
184
+ * name: { bsonType: "string" },
185
+ * email: { bsonType: "string" },
186
+ * },
187
+ * });
188
+ * ```
189
+ */
190
+ setSchemaValidation(table: string, schema: object): Promise<void>;
191
+ /**
192
+ * Remove schema validation rules from a collection.
193
+ */
194
+ removeSchemaValidation(table: string): Promise<void>;
195
+ /**
196
+ * Begin a database transaction.
197
+ *
198
+ * Uses the driver's transaction mechanism.
199
+ */
200
+ beginTransaction(): Promise<void>;
201
+ /**
202
+ * Commit the current transaction.
203
+ */
204
+ commit(): Promise<void>;
205
+ /**
206
+ * Rollback the current transaction.
207
+ */
208
+ rollback(): Promise<void>;
209
+ /**
210
+ * MongoDB supports transactions (requires replica set).
211
+ */
212
+ supportsTransactions(): boolean;
213
+ /**
214
+ * Execute raw operations with direct database access.
215
+ *
216
+ * @param callback - Callback receiving the MongoDB Db instance
217
+ * @returns Result from callback
218
+ *
219
+ * @example
220
+ * ```typescript
221
+ * await driver.raw(async (db) => {
222
+ * await db.collection("users").updateMany({}, { $set: { active: true } });
223
+ * });
224
+ * ```
225
+ */
226
+ raw<T>(callback: (connection: unknown) => Promise<T>): Promise<T>;
227
+ }
228
+ //# sourceMappingURL=mongo-migration-driver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mongo-migration-driver.d.ts","sourceRoot":"","sources":["../../../src/drivers/mongo/mongo-migration-driver.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,oBAAqB,YAAW,uBAAuB;IAS/C,OAAO,CAAC,QAAQ,CAAC,MAAM;IAR1C,0CAA0C;IAC1C,OAAO,CAAC,OAAO,CAAC,CAAgB;IAEhC;;;;OAIG;gBACiC,MAAM,EAAE,aAAa;IAEzD;;OAEG;IACH,OAAO,KAAK,EAAE,GAEb;IAED;;OAEG;IACH,OAAO,KAAK,cAAc,GAGzB;IAMD;;;;;;OAMG;IACU,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAYtD;;OAEG;IACU,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAYjE;;;;OAIG;IACU,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG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