@warlock.js/cascade 4.0.157 → 4.0.161

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 (689) hide show
  1. package/package.json +4 -4
  2. package/cjs/context/database-data-source-context.d.ts +0 -29
  3. package/cjs/context/database-data-source-context.d.ts.map +0 -1
  4. package/cjs/context/database-data-source-context.js +0 -28
  5. package/cjs/context/database-data-source-context.js.map +0 -1
  6. package/cjs/context/database-transaction-context.d.ts +0 -35
  7. package/cjs/context/database-transaction-context.d.ts.map +0 -1
  8. package/cjs/context/database-transaction-context.js +0 -40
  9. package/cjs/context/database-transaction-context.js.map +0 -1
  10. package/cjs/contracts/database-driver.contract.d.ts +0 -450
  11. package/cjs/contracts/database-driver.contract.d.ts.map +0 -1
  12. package/cjs/contracts/database-id-generator.contract.d.ts +0 -109
  13. package/cjs/contracts/database-id-generator.contract.d.ts.map +0 -1
  14. package/cjs/contracts/database-remover.contract.d.ts +0 -104
  15. package/cjs/contracts/database-remover.contract.d.ts.map +0 -1
  16. package/cjs/contracts/database-restorer.contract.d.ts +0 -143
  17. package/cjs/contracts/database-restorer.contract.d.ts.map +0 -1
  18. package/cjs/contracts/database-writer.contract.d.ts +0 -119
  19. package/cjs/contracts/database-writer.contract.d.ts.map +0 -1
  20. package/cjs/contracts/driver-blueprint.contract.d.ts +0 -49
  21. package/cjs/contracts/driver-blueprint.contract.d.ts.map +0 -1
  22. package/cjs/contracts/index.d.ts +0 -10
  23. package/cjs/contracts/index.d.ts.map +0 -1
  24. package/cjs/contracts/migration-driver.contract.d.ts +0 -522
  25. package/cjs/contracts/migration-driver.contract.d.ts.map +0 -1
  26. package/cjs/contracts/query-builder.contract.d.ts +0 -1609
  27. package/cjs/contracts/query-builder.contract.d.ts.map +0 -1
  28. package/cjs/contracts/sync-adapter.contract.d.ts +0 -58
  29. package/cjs/contracts/sync-adapter.contract.d.ts.map +0 -1
  30. package/cjs/data-source/data-source-registry.d.ts +0 -108
  31. package/cjs/data-source/data-source-registry.d.ts.map +0 -1
  32. package/cjs/data-source/data-source-registry.js +0 -145
  33. package/cjs/data-source/data-source-registry.js.map +0 -1
  34. package/cjs/data-source/data-source.d.ts +0 -147
  35. package/cjs/data-source/data-source.d.ts.map +0 -1
  36. package/cjs/data-source/data-source.js +0 -83
  37. package/cjs/data-source/data-source.js.map +0 -1
  38. package/cjs/database-dirty-tracker.d.ts +0 -252
  39. package/cjs/database-dirty-tracker.d.ts.map +0 -1
  40. package/cjs/database-dirty-tracker.js +0 -386
  41. package/cjs/database-dirty-tracker.js.map +0 -1
  42. package/cjs/drivers/mongodb/mongodb-blueprint.d.ts +0 -30
  43. package/cjs/drivers/mongodb/mongodb-blueprint.d.ts.map +0 -1
  44. package/cjs/drivers/mongodb/mongodb-blueprint.js +0 -51
  45. package/cjs/drivers/mongodb/mongodb-blueprint.js.map +0 -1
  46. package/cjs/drivers/mongodb/mongodb-driver.d.ts +0 -324
  47. package/cjs/drivers/mongodb/mongodb-driver.d.ts.map +0 -1
  48. package/cjs/drivers/mongodb/mongodb-driver.js +0 -799
  49. package/cjs/drivers/mongodb/mongodb-driver.js.map +0 -1
  50. package/cjs/drivers/mongodb/mongodb-id-generator.d.ts +0 -116
  51. package/cjs/drivers/mongodb/mongodb-id-generator.d.ts.map +0 -1
  52. package/cjs/drivers/mongodb/mongodb-id-generator.js +0 -149
  53. package/cjs/drivers/mongodb/mongodb-id-generator.js.map +0 -1
  54. package/cjs/drivers/mongodb/mongodb-migration-driver.d.ts +0 -317
  55. package/cjs/drivers/mongodb/mongodb-migration-driver.d.ts.map +0 -1
  56. package/cjs/drivers/mongodb/mongodb-migration-driver.js +0 -666
  57. package/cjs/drivers/mongodb/mongodb-migration-driver.js.map +0 -1
  58. package/cjs/drivers/mongodb/mongodb-query-builder.d.ts +0 -1122
  59. package/cjs/drivers/mongodb/mongodb-query-builder.d.ts.map +0 -1
  60. package/cjs/drivers/mongodb/mongodb-query-builder.js +0 -1988
  61. package/cjs/drivers/mongodb/mongodb-query-builder.js.map +0 -1
  62. package/cjs/drivers/mongodb/mongodb-query-operations.d.ts +0 -226
  63. package/cjs/drivers/mongodb/mongodb-query-operations.d.ts.map +0 -1
  64. package/cjs/drivers/mongodb/mongodb-query-operations.js +0 -270
  65. package/cjs/drivers/mongodb/mongodb-query-operations.js.map +0 -1
  66. package/cjs/drivers/mongodb/mongodb-query-parser.d.ts +0 -262
  67. package/cjs/drivers/mongodb/mongodb-query-parser.d.ts.map +0 -1
  68. package/cjs/drivers/mongodb/mongodb-query-parser.js +0 -1351
  69. package/cjs/drivers/mongodb/mongodb-query-parser.js.map +0 -1
  70. package/cjs/drivers/mongodb/mongodb-sync-adapter.d.ts +0 -79
  71. package/cjs/drivers/mongodb/mongodb-sync-adapter.d.ts.map +0 -1
  72. package/cjs/drivers/mongodb/mongodb-sync-adapter.js +0 -146
  73. package/cjs/drivers/mongodb/mongodb-sync-adapter.js.map +0 -1
  74. package/cjs/drivers/mongodb/types.d.ts +0 -43
  75. package/cjs/drivers/mongodb/types.d.ts.map +0 -1
  76. package/cjs/drivers/postgres/index.d.ts +0 -16
  77. package/cjs/drivers/postgres/index.d.ts.map +0 -1
  78. package/cjs/drivers/postgres/postgres-blueprint.d.ts +0 -64
  79. package/cjs/drivers/postgres/postgres-blueprint.d.ts.map +0 -1
  80. package/cjs/drivers/postgres/postgres-blueprint.js +0 -121
  81. package/cjs/drivers/postgres/postgres-blueprint.js.map +0 -1
  82. package/cjs/drivers/postgres/postgres-dialect.d.ts +0 -136
  83. package/cjs/drivers/postgres/postgres-dialect.d.ts.map +0 -1
  84. package/cjs/drivers/postgres/postgres-dialect.js +0 -268
  85. package/cjs/drivers/postgres/postgres-dialect.js.map +0 -1
  86. package/cjs/drivers/postgres/postgres-driver.d.ts +0 -432
  87. package/cjs/drivers/postgres/postgres-driver.d.ts.map +0 -1
  88. package/cjs/drivers/postgres/postgres-driver.js +0 -965
  89. package/cjs/drivers/postgres/postgres-driver.js.map +0 -1
  90. package/cjs/drivers/postgres/postgres-migration-driver.d.ts +0 -397
  91. package/cjs/drivers/postgres/postgres-migration-driver.d.ts.map +0 -1
  92. package/cjs/drivers/postgres/postgres-migration-driver.js +0 -900
  93. package/cjs/drivers/postgres/postgres-migration-driver.js.map +0 -1
  94. package/cjs/drivers/postgres/postgres-query-builder.d.ts +0 -254
  95. package/cjs/drivers/postgres/postgres-query-builder.d.ts.map +0 -1
  96. package/cjs/drivers/postgres/postgres-query-builder.js +0 -933
  97. package/cjs/drivers/postgres/postgres-query-builder.js.map +0 -1
  98. package/cjs/drivers/postgres/postgres-query-parser.d.ts +0 -328
  99. package/cjs/drivers/postgres/postgres-query-parser.d.ts.map +0 -1
  100. package/cjs/drivers/postgres/postgres-query-parser.js +0 -864
  101. package/cjs/drivers/postgres/postgres-query-parser.js.map +0 -1
  102. package/cjs/drivers/postgres/postgres-sql-serializer.d.ts +0 -37
  103. package/cjs/drivers/postgres/postgres-sql-serializer.d.ts.map +0 -1
  104. package/cjs/drivers/postgres/postgres-sql-serializer.js +0 -400
  105. package/cjs/drivers/postgres/postgres-sql-serializer.js.map +0 -1
  106. package/cjs/drivers/postgres/postgres-sync-adapter.d.ts +0 -83
  107. package/cjs/drivers/postgres/postgres-sync-adapter.d.ts.map +0 -1
  108. package/cjs/drivers/postgres/postgres-sync-adapter.js +0 -197
  109. package/cjs/drivers/postgres/postgres-sync-adapter.js.map +0 -1
  110. package/cjs/drivers/postgres/types.d.ts +0 -142
  111. package/cjs/drivers/postgres/types.d.ts.map +0 -1
  112. package/cjs/drivers/sql/index.d.ts +0 -10
  113. package/cjs/drivers/sql/index.d.ts.map +0 -1
  114. package/cjs/drivers/sql/sql-dialect.contract.d.ts +0 -204
  115. package/cjs/drivers/sql/sql-dialect.contract.d.ts.map +0 -1
  116. package/cjs/drivers/sql/sql-types.d.ts +0 -202
  117. package/cjs/drivers/sql/sql-types.d.ts.map +0 -1
  118. package/cjs/errors/missing-data-source.error.d.ts +0 -22
  119. package/cjs/errors/missing-data-source.error.d.ts.map +0 -1
  120. package/cjs/errors/missing-data-source.error.js +0 -29
  121. package/cjs/errors/missing-data-source.error.js.map +0 -1
  122. package/cjs/errors/transaction-rollback.error.d.ts +0 -20
  123. package/cjs/errors/transaction-rollback.error.d.ts.map +0 -1
  124. package/cjs/errors/transaction-rollback.error.js +0 -27
  125. package/cjs/errors/transaction-rollback.error.js.map +0 -1
  126. package/cjs/events/model-events.d.ts +0 -231
  127. package/cjs/events/model-events.d.ts.map +0 -1
  128. package/cjs/events/model-events.js +0 -259
  129. package/cjs/events/model-events.js.map +0 -1
  130. package/cjs/expressions/aggregate-expressions.d.ts +0 -215
  131. package/cjs/expressions/aggregate-expressions.d.ts.map +0 -1
  132. package/cjs/expressions/aggregate-expressions.js +0 -221
  133. package/cjs/expressions/aggregate-expressions.js.map +0 -1
  134. package/cjs/expressions/index.d.ts +0 -2
  135. package/cjs/expressions/index.d.ts.map +0 -1
  136. package/cjs/index.d.ts +0 -45
  137. package/cjs/index.d.ts.map +0 -1
  138. package/cjs/index.js +0 -1
  139. package/cjs/index.js.map +0 -1
  140. package/cjs/migration/column-builder.d.ts +0 -417
  141. package/cjs/migration/column-builder.d.ts.map +0 -1
  142. package/cjs/migration/column-builder.js +0 -586
  143. package/cjs/migration/column-builder.js.map +0 -1
  144. package/cjs/migration/column-helpers.d.ts +0 -275
  145. package/cjs/migration/column-helpers.d.ts.map +0 -1
  146. package/cjs/migration/column-helpers.js +0 -389
  147. package/cjs/migration/column-helpers.js.map +0 -1
  148. package/cjs/migration/foreign-key-builder.d.ts +0 -103
  149. package/cjs/migration/foreign-key-builder.d.ts.map +0 -1
  150. package/cjs/migration/foreign-key-builder.js +0 -121
  151. package/cjs/migration/foreign-key-builder.js.map +0 -1
  152. package/cjs/migration/index.d.ts +0 -7
  153. package/cjs/migration/index.d.ts.map +0 -1
  154. package/cjs/migration/migration-runner.d.ts +0 -278
  155. package/cjs/migration/migration-runner.d.ts.map +0 -1
  156. package/cjs/migration/migration-runner.js +0 -815
  157. package/cjs/migration/migration-runner.js.map +0 -1
  158. package/cjs/migration/migration.d.ts +0 -1992
  159. package/cjs/migration/migration.d.ts.map +0 -1
  160. package/cjs/migration/migration.js +0 -2162
  161. package/cjs/migration/migration.js.map +0 -1
  162. package/cjs/migration/sql-grammar.d.ts +0 -61
  163. package/cjs/migration/sql-grammar.d.ts.map +0 -1
  164. package/cjs/migration/sql-grammar.js +0 -164
  165. package/cjs/migration/sql-grammar.js.map +0 -1
  166. package/cjs/migration/sql-serializer.d.ts +0 -22
  167. package/cjs/migration/sql-serializer.d.ts.map +0 -1
  168. package/cjs/migration/sql-serializer.js +0 -26
  169. package/cjs/migration/sql-serializer.js.map +0 -1
  170. package/cjs/migration/types.d.ts +0 -155
  171. package/cjs/migration/types.d.ts.map +0 -1
  172. package/cjs/model/methods/accessor-methods.d.ts +0 -13
  173. package/cjs/model/methods/accessor-methods.d.ts.map +0 -1
  174. package/cjs/model/methods/accessor-methods.js +0 -51
  175. package/cjs/model/methods/accessor-methods.js.map +0 -1
  176. package/cjs/model/methods/delete-methods.d.ts +0 -10
  177. package/cjs/model/methods/delete-methods.d.ts.map +0 -1
  178. package/cjs/model/methods/delete-methods.js +0 -10
  179. package/cjs/model/methods/delete-methods.js.map +0 -1
  180. package/cjs/model/methods/dirty-methods.d.ts +0 -10
  181. package/cjs/model/methods/dirty-methods.d.ts.map +0 -1
  182. package/cjs/model/methods/dirty-methods.js +0 -15
  183. package/cjs/model/methods/dirty-methods.js.map +0 -1
  184. package/cjs/model/methods/hydration-methods.d.ts +0 -10
  185. package/cjs/model/methods/hydration-methods.d.ts.map +0 -1
  186. package/cjs/model/methods/hydration-methods.js +0 -57
  187. package/cjs/model/methods/hydration-methods.js.map +0 -1
  188. package/cjs/model/methods/instance-event-methods.d.ts +0 -7
  189. package/cjs/model/methods/instance-event-methods.d.ts.map +0 -1
  190. package/cjs/model/methods/instance-event-methods.js +0 -15
  191. package/cjs/model/methods/instance-event-methods.js.map +0 -1
  192. package/cjs/model/methods/meta-methods.d.ts +0 -7
  193. package/cjs/model/methods/meta-methods.d.ts.map +0 -1
  194. package/cjs/model/methods/meta-methods.js +0 -78
  195. package/cjs/model/methods/meta-methods.js.map +0 -1
  196. package/cjs/model/methods/query-methods.d.ts +0 -24
  197. package/cjs/model/methods/query-methods.d.ts.map +0 -1
  198. package/cjs/model/methods/query-methods.js +0 -161
  199. package/cjs/model/methods/query-methods.js.map +0 -1
  200. package/cjs/model/methods/restore-methods.d.ts +0 -10
  201. package/cjs/model/methods/restore-methods.d.ts.map +0 -1
  202. package/cjs/model/methods/restore-methods.js +0 -13
  203. package/cjs/model/methods/restore-methods.js.map +0 -1
  204. package/cjs/model/methods/scope-methods.d.ts +0 -7
  205. package/cjs/model/methods/scope-methods.d.ts.map +0 -1
  206. package/cjs/model/methods/scope-methods.js +0 -15
  207. package/cjs/model/methods/scope-methods.js.map +0 -1
  208. package/cjs/model/methods/serialization-methods.d.ts +0 -3
  209. package/cjs/model/methods/serialization-methods.d.ts.map +0 -1
  210. package/cjs/model/methods/serialization-methods.js +0 -27
  211. package/cjs/model/methods/serialization-methods.js.map +0 -1
  212. package/cjs/model/methods/static-event-methods.d.ts +0 -9
  213. package/cjs/model/methods/static-event-methods.d.ts.map +0 -1
  214. package/cjs/model/methods/static-event-methods.js +0 -29
  215. package/cjs/model/methods/static-event-methods.js.map +0 -1
  216. package/cjs/model/methods/write-methods.d.ts +0 -10
  217. package/cjs/model/methods/write-methods.d.ts.map +0 -1
  218. package/cjs/model/methods/write-methods.js +0 -52
  219. package/cjs/model/methods/write-methods.js.map +0 -1
  220. package/cjs/model/model.d.ts +0 -1650
  221. package/cjs/model/model.d.ts.map +0 -1
  222. package/cjs/model/model.js +0 -1657
  223. package/cjs/model/model.js.map +0 -1
  224. package/cjs/model/model.types.d.ts +0 -44
  225. package/cjs/model/model.types.d.ts.map +0 -1
  226. package/cjs/model/register-model.d.ts +0 -81
  227. package/cjs/model/register-model.d.ts.map +0 -1
  228. package/cjs/model/register-model.js +0 -94
  229. package/cjs/model/register-model.js.map +0 -1
  230. package/cjs/query-builder/query-builder.d.ts +0 -556
  231. package/cjs/query-builder/query-builder.d.ts.map +0 -1
  232. package/cjs/query-builder/query-builder.js +0 -1070
  233. package/cjs/query-builder/query-builder.js.map +0 -1
  234. package/cjs/relations/helpers.d.ts +0 -156
  235. package/cjs/relations/helpers.d.ts.map +0 -1
  236. package/cjs/relations/helpers.js +0 -201
  237. package/cjs/relations/helpers.js.map +0 -1
  238. package/cjs/relations/index.d.ts +0 -35
  239. package/cjs/relations/index.d.ts.map +0 -1
  240. package/cjs/relations/pivot-operations.d.ts +0 -160
  241. package/cjs/relations/pivot-operations.d.ts.map +0 -1
  242. package/cjs/relations/pivot-operations.js +0 -293
  243. package/cjs/relations/pivot-operations.js.map +0 -1
  244. package/cjs/relations/relation-hydrator.d.ts +0 -68
  245. package/cjs/relations/relation-hydrator.d.ts.map +0 -1
  246. package/cjs/relations/relation-hydrator.js +0 -81
  247. package/cjs/relations/relation-hydrator.js.map +0 -1
  248. package/cjs/relations/relation-loader.d.ts +0 -194
  249. package/cjs/relations/relation-loader.d.ts.map +0 -1
  250. package/cjs/relations/relation-loader.js +0 -466
  251. package/cjs/relations/relation-loader.js.map +0 -1
  252. package/cjs/relations/types.d.ts +0 -306
  253. package/cjs/relations/types.d.ts.map +0 -1
  254. package/cjs/remover/database-remover.d.ts +0 -100
  255. package/cjs/remover/database-remover.d.ts.map +0 -1
  256. package/cjs/remover/database-remover.js +0 -214
  257. package/cjs/remover/database-remover.js.map +0 -1
  258. package/cjs/restorer/database-restorer.d.ts +0 -131
  259. package/cjs/restorer/database-restorer.d.ts.map +0 -1
  260. package/cjs/restorer/database-restorer.js +0 -434
  261. package/cjs/restorer/database-restorer.js.map +0 -1
  262. package/cjs/sql-database-dirty-tracker.d.ts +0 -13
  263. package/cjs/sql-database-dirty-tracker.d.ts.map +0 -1
  264. package/cjs/sql-database-dirty-tracker.js +0 -14
  265. package/cjs/sql-database-dirty-tracker.js.map +0 -1
  266. package/cjs/sync/index.d.ts +0 -12
  267. package/cjs/sync/index.d.ts.map +0 -1
  268. package/cjs/sync/model-events.d.ts +0 -62
  269. package/cjs/sync/model-events.d.ts.map +0 -1
  270. package/cjs/sync/model-events.js +0 -49
  271. package/cjs/sync/model-events.js.map +0 -1
  272. package/cjs/sync/model-sync-operation.d.ts +0 -163
  273. package/cjs/sync/model-sync-operation.d.ts.map +0 -1
  274. package/cjs/sync/model-sync-operation.js +0 -292
  275. package/cjs/sync/model-sync-operation.js.map +0 -1
  276. package/cjs/sync/model-sync.d.ts +0 -130
  277. package/cjs/sync/model-sync.d.ts.map +0 -1
  278. package/cjs/sync/model-sync.js +0 -178
  279. package/cjs/sync/model-sync.js.map +0 -1
  280. package/cjs/sync/sync-context.d.ts +0 -70
  281. package/cjs/sync/sync-context.d.ts.map +0 -1
  282. package/cjs/sync/sync-context.js +0 -101
  283. package/cjs/sync/sync-context.js.map +0 -1
  284. package/cjs/sync/sync-manager.d.ts +0 -213
  285. package/cjs/sync/sync-manager.d.ts.map +0 -1
  286. package/cjs/sync/sync-manager.js +0 -689
  287. package/cjs/sync/sync-manager.js.map +0 -1
  288. package/cjs/sync/types.d.ts +0 -289
  289. package/cjs/sync/types.d.ts.map +0 -1
  290. package/cjs/test-migrations/test-enhanced-features.migration.d.ts +0 -15
  291. package/cjs/test-migrations/test-enhanced-features.migration.d.ts.map +0 -1
  292. package/cjs/types.d.ts +0 -371
  293. package/cjs/types.d.ts.map +0 -1
  294. package/cjs/utils/connect-to-database.d.ts +0 -300
  295. package/cjs/utils/connect-to-database.d.ts.map +0 -1
  296. package/cjs/utils/connect-to-database.js +0 -128
  297. package/cjs/utils/connect-to-database.js.map +0 -1
  298. package/cjs/utils/database-writer.utils.d.ts +0 -15
  299. package/cjs/utils/database-writer.utils.d.ts.map +0 -1
  300. package/cjs/utils/database-writer.utils.js +0 -14
  301. package/cjs/utils/database-writer.utils.js.map +0 -1
  302. package/cjs/utils/define-model.js +0 -100
  303. package/cjs/utils/define-model.js.map +0 -1
  304. package/cjs/utils/is-valid-date-value.d.ts +0 -5
  305. package/cjs/utils/is-valid-date-value.d.ts.map +0 -1
  306. package/cjs/utils/is-valid-date-value.js +0 -25
  307. package/cjs/utils/is-valid-date-value.js.map +0 -1
  308. package/cjs/utils/once-connected.d.ts +0 -146
  309. package/cjs/utils/once-connected.d.ts.map +0 -1
  310. package/cjs/utils/once-connected.js +0 -251
  311. package/cjs/utils/once-connected.js.map +0 -1
  312. package/cjs/validation/database-seal-plugins.d.ts +0 -12
  313. package/cjs/validation/database-seal-plugins.d.ts.map +0 -1
  314. package/cjs/validation/database-seal-plugins.js +0 -1
  315. package/cjs/validation/database-seal-plugins.js.map +0 -1
  316. package/cjs/validation/database-writer-validation-error.d.ts +0 -97
  317. package/cjs/validation/database-writer-validation-error.d.ts.map +0 -1
  318. package/cjs/validation/database-writer-validation-error.js +0 -160
  319. package/cjs/validation/database-writer-validation-error.js.map +0 -1
  320. package/cjs/validation/index.d.ts +0 -3
  321. package/cjs/validation/index.d.ts.map +0 -1
  322. package/cjs/validation/mutators/embed-mutator.d.ts +0 -9
  323. package/cjs/validation/mutators/embed-mutator.d.ts.map +0 -1
  324. package/cjs/validation/mutators/embed-mutator.js +0 -33
  325. package/cjs/validation/mutators/embed-mutator.js.map +0 -1
  326. package/cjs/validation/plugins/embed-validator-plugin.d.ts +0 -24
  327. package/cjs/validation/plugins/embed-validator-plugin.d.ts.map +0 -1
  328. package/cjs/validation/plugins/embed-validator-plugin.js +0 -18
  329. package/cjs/validation/plugins/embed-validator-plugin.js.map +0 -1
  330. package/cjs/validation/rules/database-model-rule.d.ts +0 -7
  331. package/cjs/validation/rules/database-model-rule.d.ts.map +0 -1
  332. package/cjs/validation/rules/database-model-rule.js +0 -27
  333. package/cjs/validation/rules/database-model-rule.js.map +0 -1
  334. package/cjs/validation/transformers/embed-model-transformer.d.ts +0 -3
  335. package/cjs/validation/transformers/embed-model-transformer.d.ts.map +0 -1
  336. package/cjs/validation/transformers/embed-model-transformer.js +0 -18
  337. package/cjs/validation/transformers/embed-model-transformer.js.map +0 -1
  338. package/cjs/validation/validators/embed-validator.d.ts +0 -21
  339. package/cjs/validation/validators/embed-validator.d.ts.map +0 -1
  340. package/cjs/validation/validators/embed-validator.js +0 -43
  341. package/cjs/validation/validators/embed-validator.js.map +0 -1
  342. package/cjs/writer/database-writer.d.ts +0 -181
  343. package/cjs/writer/database-writer.d.ts.map +0 -1
  344. package/cjs/writer/database-writer.js +0 -407
  345. package/cjs/writer/database-writer.js.map +0 -1
  346. package/esm/context/database-data-source-context.d.ts +0 -29
  347. package/esm/context/database-data-source-context.d.ts.map +0 -1
  348. package/esm/context/database-data-source-context.js +0 -28
  349. package/esm/context/database-data-source-context.js.map +0 -1
  350. package/esm/context/database-transaction-context.d.ts +0 -35
  351. package/esm/context/database-transaction-context.d.ts.map +0 -1
  352. package/esm/context/database-transaction-context.js +0 -40
  353. package/esm/context/database-transaction-context.js.map +0 -1
  354. package/esm/contracts/database-driver.contract.d.ts +0 -450
  355. package/esm/contracts/database-driver.contract.d.ts.map +0 -1
  356. package/esm/contracts/database-id-generator.contract.d.ts +0 -109
  357. package/esm/contracts/database-id-generator.contract.d.ts.map +0 -1
  358. package/esm/contracts/database-remover.contract.d.ts +0 -104
  359. package/esm/contracts/database-remover.contract.d.ts.map +0 -1
  360. package/esm/contracts/database-restorer.contract.d.ts +0 -143
  361. package/esm/contracts/database-restorer.contract.d.ts.map +0 -1
  362. package/esm/contracts/database-writer.contract.d.ts +0 -119
  363. package/esm/contracts/database-writer.contract.d.ts.map +0 -1
  364. package/esm/contracts/driver-blueprint.contract.d.ts +0 -49
  365. package/esm/contracts/driver-blueprint.contract.d.ts.map +0 -1
  366. package/esm/contracts/index.d.ts +0 -10
  367. package/esm/contracts/index.d.ts.map +0 -1
  368. package/esm/contracts/migration-driver.contract.d.ts +0 -522
  369. package/esm/contracts/migration-driver.contract.d.ts.map +0 -1
  370. package/esm/contracts/query-builder.contract.d.ts +0 -1609
  371. package/esm/contracts/query-builder.contract.d.ts.map +0 -1
  372. package/esm/contracts/sync-adapter.contract.d.ts +0 -58
  373. package/esm/contracts/sync-adapter.contract.d.ts.map +0 -1
  374. package/esm/data-source/data-source-registry.d.ts +0 -108
  375. package/esm/data-source/data-source-registry.d.ts.map +0 -1
  376. package/esm/data-source/data-source-registry.js +0 -145
  377. package/esm/data-source/data-source-registry.js.map +0 -1
  378. package/esm/data-source/data-source.d.ts +0 -147
  379. package/esm/data-source/data-source.d.ts.map +0 -1
  380. package/esm/data-source/data-source.js +0 -83
  381. package/esm/data-source/data-source.js.map +0 -1
  382. package/esm/database-dirty-tracker.d.ts +0 -252
  383. package/esm/database-dirty-tracker.d.ts.map +0 -1
  384. package/esm/database-dirty-tracker.js +0 -386
  385. package/esm/database-dirty-tracker.js.map +0 -1
  386. package/esm/drivers/mongodb/mongodb-blueprint.d.ts +0 -30
  387. package/esm/drivers/mongodb/mongodb-blueprint.d.ts.map +0 -1
  388. package/esm/drivers/mongodb/mongodb-blueprint.js +0 -51
  389. package/esm/drivers/mongodb/mongodb-blueprint.js.map +0 -1
  390. package/esm/drivers/mongodb/mongodb-driver.d.ts +0 -324
  391. package/esm/drivers/mongodb/mongodb-driver.d.ts.map +0 -1
  392. package/esm/drivers/mongodb/mongodb-driver.js +0 -799
  393. package/esm/drivers/mongodb/mongodb-driver.js.map +0 -1
  394. package/esm/drivers/mongodb/mongodb-id-generator.d.ts +0 -116
  395. package/esm/drivers/mongodb/mongodb-id-generator.d.ts.map +0 -1
  396. package/esm/drivers/mongodb/mongodb-id-generator.js +0 -149
  397. package/esm/drivers/mongodb/mongodb-id-generator.js.map +0 -1
  398. package/esm/drivers/mongodb/mongodb-migration-driver.d.ts +0 -317
  399. package/esm/drivers/mongodb/mongodb-migration-driver.d.ts.map +0 -1
  400. package/esm/drivers/mongodb/mongodb-migration-driver.js +0 -666
  401. package/esm/drivers/mongodb/mongodb-migration-driver.js.map +0 -1
  402. package/esm/drivers/mongodb/mongodb-query-builder.d.ts +0 -1122
  403. package/esm/drivers/mongodb/mongodb-query-builder.d.ts.map +0 -1
  404. package/esm/drivers/mongodb/mongodb-query-builder.js +0 -1988
  405. package/esm/drivers/mongodb/mongodb-query-builder.js.map +0 -1
  406. package/esm/drivers/mongodb/mongodb-query-operations.d.ts +0 -226
  407. package/esm/drivers/mongodb/mongodb-query-operations.d.ts.map +0 -1
  408. package/esm/drivers/mongodb/mongodb-query-operations.js +0 -270
  409. package/esm/drivers/mongodb/mongodb-query-operations.js.map +0 -1
  410. package/esm/drivers/mongodb/mongodb-query-parser.d.ts +0 -262
  411. package/esm/drivers/mongodb/mongodb-query-parser.d.ts.map +0 -1
  412. package/esm/drivers/mongodb/mongodb-query-parser.js +0 -1351
  413. package/esm/drivers/mongodb/mongodb-query-parser.js.map +0 -1
  414. package/esm/drivers/mongodb/mongodb-sync-adapter.d.ts +0 -79
  415. package/esm/drivers/mongodb/mongodb-sync-adapter.d.ts.map +0 -1
  416. package/esm/drivers/mongodb/mongodb-sync-adapter.js +0 -146
  417. package/esm/drivers/mongodb/mongodb-sync-adapter.js.map +0 -1
  418. package/esm/drivers/mongodb/types.d.ts +0 -43
  419. package/esm/drivers/mongodb/types.d.ts.map +0 -1
  420. package/esm/drivers/postgres/index.d.ts +0 -16
  421. package/esm/drivers/postgres/index.d.ts.map +0 -1
  422. package/esm/drivers/postgres/postgres-blueprint.d.ts +0 -64
  423. package/esm/drivers/postgres/postgres-blueprint.d.ts.map +0 -1
  424. package/esm/drivers/postgres/postgres-blueprint.js +0 -121
  425. package/esm/drivers/postgres/postgres-blueprint.js.map +0 -1
  426. package/esm/drivers/postgres/postgres-dialect.d.ts +0 -136
  427. package/esm/drivers/postgres/postgres-dialect.d.ts.map +0 -1
  428. package/esm/drivers/postgres/postgres-dialect.js +0 -268
  429. package/esm/drivers/postgres/postgres-dialect.js.map +0 -1
  430. package/esm/drivers/postgres/postgres-driver.d.ts +0 -432
  431. package/esm/drivers/postgres/postgres-driver.d.ts.map +0 -1
  432. package/esm/drivers/postgres/postgres-driver.js +0 -965
  433. package/esm/drivers/postgres/postgres-driver.js.map +0 -1
  434. package/esm/drivers/postgres/postgres-migration-driver.d.ts +0 -397
  435. package/esm/drivers/postgres/postgres-migration-driver.d.ts.map +0 -1
  436. package/esm/drivers/postgres/postgres-migration-driver.js +0 -900
  437. package/esm/drivers/postgres/postgres-migration-driver.js.map +0 -1
  438. package/esm/drivers/postgres/postgres-query-builder.d.ts +0 -254
  439. package/esm/drivers/postgres/postgres-query-builder.d.ts.map +0 -1
  440. package/esm/drivers/postgres/postgres-query-builder.js +0 -933
  441. package/esm/drivers/postgres/postgres-query-builder.js.map +0 -1
  442. package/esm/drivers/postgres/postgres-query-parser.d.ts +0 -328
  443. package/esm/drivers/postgres/postgres-query-parser.d.ts.map +0 -1
  444. package/esm/drivers/postgres/postgres-query-parser.js +0 -864
  445. package/esm/drivers/postgres/postgres-query-parser.js.map +0 -1
  446. package/esm/drivers/postgres/postgres-sql-serializer.d.ts +0 -37
  447. package/esm/drivers/postgres/postgres-sql-serializer.d.ts.map +0 -1
  448. package/esm/drivers/postgres/postgres-sql-serializer.js +0 -400
  449. package/esm/drivers/postgres/postgres-sql-serializer.js.map +0 -1
  450. package/esm/drivers/postgres/postgres-sync-adapter.d.ts +0 -83
  451. package/esm/drivers/postgres/postgres-sync-adapter.d.ts.map +0 -1
  452. package/esm/drivers/postgres/postgres-sync-adapter.js +0 -197
  453. package/esm/drivers/postgres/postgres-sync-adapter.js.map +0 -1
  454. package/esm/drivers/postgres/types.d.ts +0 -142
  455. package/esm/drivers/postgres/types.d.ts.map +0 -1
  456. package/esm/drivers/sql/index.d.ts +0 -10
  457. package/esm/drivers/sql/index.d.ts.map +0 -1
  458. package/esm/drivers/sql/sql-dialect.contract.d.ts +0 -204
  459. package/esm/drivers/sql/sql-dialect.contract.d.ts.map +0 -1
  460. package/esm/drivers/sql/sql-types.d.ts +0 -202
  461. package/esm/drivers/sql/sql-types.d.ts.map +0 -1
  462. package/esm/errors/missing-data-source.error.d.ts +0 -22
  463. package/esm/errors/missing-data-source.error.d.ts.map +0 -1
  464. package/esm/errors/missing-data-source.error.js +0 -29
  465. package/esm/errors/missing-data-source.error.js.map +0 -1
  466. package/esm/errors/transaction-rollback.error.d.ts +0 -20
  467. package/esm/errors/transaction-rollback.error.d.ts.map +0 -1
  468. package/esm/errors/transaction-rollback.error.js +0 -27
  469. package/esm/errors/transaction-rollback.error.js.map +0 -1
  470. package/esm/events/model-events.d.ts +0 -231
  471. package/esm/events/model-events.d.ts.map +0 -1
  472. package/esm/events/model-events.js +0 -259
  473. package/esm/events/model-events.js.map +0 -1
  474. package/esm/expressions/aggregate-expressions.d.ts +0 -215
  475. package/esm/expressions/aggregate-expressions.d.ts.map +0 -1
  476. package/esm/expressions/aggregate-expressions.js +0 -221
  477. package/esm/expressions/aggregate-expressions.js.map +0 -1
  478. package/esm/expressions/index.d.ts +0 -2
  479. package/esm/expressions/index.d.ts.map +0 -1
  480. package/esm/index.d.ts +0 -45
  481. package/esm/index.d.ts.map +0 -1
  482. package/esm/index.js +0 -1
  483. package/esm/index.js.map +0 -1
  484. package/esm/migration/column-builder.d.ts +0 -417
  485. package/esm/migration/column-builder.d.ts.map +0 -1
  486. package/esm/migration/column-builder.js +0 -586
  487. package/esm/migration/column-builder.js.map +0 -1
  488. package/esm/migration/column-helpers.d.ts +0 -275
  489. package/esm/migration/column-helpers.d.ts.map +0 -1
  490. package/esm/migration/column-helpers.js +0 -389
  491. package/esm/migration/column-helpers.js.map +0 -1
  492. package/esm/migration/foreign-key-builder.d.ts +0 -103
  493. package/esm/migration/foreign-key-builder.d.ts.map +0 -1
  494. package/esm/migration/foreign-key-builder.js +0 -121
  495. package/esm/migration/foreign-key-builder.js.map +0 -1
  496. package/esm/migration/index.d.ts +0 -7
  497. package/esm/migration/index.d.ts.map +0 -1
  498. package/esm/migration/migration-runner.d.ts +0 -278
  499. package/esm/migration/migration-runner.d.ts.map +0 -1
  500. package/esm/migration/migration-runner.js +0 -815
  501. package/esm/migration/migration-runner.js.map +0 -1
  502. package/esm/migration/migration.d.ts +0 -1992
  503. package/esm/migration/migration.d.ts.map +0 -1
  504. package/esm/migration/migration.js +0 -2162
  505. package/esm/migration/migration.js.map +0 -1
  506. package/esm/migration/sql-grammar.d.ts +0 -61
  507. package/esm/migration/sql-grammar.d.ts.map +0 -1
  508. package/esm/migration/sql-grammar.js +0 -164
  509. package/esm/migration/sql-grammar.js.map +0 -1
  510. package/esm/migration/sql-serializer.d.ts +0 -22
  511. package/esm/migration/sql-serializer.d.ts.map +0 -1
  512. package/esm/migration/sql-serializer.js +0 -26
  513. package/esm/migration/sql-serializer.js.map +0 -1
  514. package/esm/migration/types.d.ts +0 -155
  515. package/esm/migration/types.d.ts.map +0 -1
  516. package/esm/model/methods/accessor-methods.d.ts +0 -13
  517. package/esm/model/methods/accessor-methods.d.ts.map +0 -1
  518. package/esm/model/methods/accessor-methods.js +0 -51
  519. package/esm/model/methods/accessor-methods.js.map +0 -1
  520. package/esm/model/methods/delete-methods.d.ts +0 -10
  521. package/esm/model/methods/delete-methods.d.ts.map +0 -1
  522. package/esm/model/methods/delete-methods.js +0 -10
  523. package/esm/model/methods/delete-methods.js.map +0 -1
  524. package/esm/model/methods/dirty-methods.d.ts +0 -10
  525. package/esm/model/methods/dirty-methods.d.ts.map +0 -1
  526. package/esm/model/methods/dirty-methods.js +0 -15
  527. package/esm/model/methods/dirty-methods.js.map +0 -1
  528. package/esm/model/methods/hydration-methods.d.ts +0 -10
  529. package/esm/model/methods/hydration-methods.d.ts.map +0 -1
  530. package/esm/model/methods/hydration-methods.js +0 -57
  531. package/esm/model/methods/hydration-methods.js.map +0 -1
  532. package/esm/model/methods/instance-event-methods.d.ts +0 -7
  533. package/esm/model/methods/instance-event-methods.d.ts.map +0 -1
  534. package/esm/model/methods/instance-event-methods.js +0 -15
  535. package/esm/model/methods/instance-event-methods.js.map +0 -1
  536. package/esm/model/methods/meta-methods.d.ts +0 -7
  537. package/esm/model/methods/meta-methods.d.ts.map +0 -1
  538. package/esm/model/methods/meta-methods.js +0 -78
  539. package/esm/model/methods/meta-methods.js.map +0 -1
  540. package/esm/model/methods/query-methods.d.ts +0 -24
  541. package/esm/model/methods/query-methods.d.ts.map +0 -1
  542. package/esm/model/methods/query-methods.js +0 -161
  543. package/esm/model/methods/query-methods.js.map +0 -1
  544. package/esm/model/methods/restore-methods.d.ts +0 -10
  545. package/esm/model/methods/restore-methods.d.ts.map +0 -1
  546. package/esm/model/methods/restore-methods.js +0 -13
  547. package/esm/model/methods/restore-methods.js.map +0 -1
  548. package/esm/model/methods/scope-methods.d.ts +0 -7
  549. package/esm/model/methods/scope-methods.d.ts.map +0 -1
  550. package/esm/model/methods/scope-methods.js +0 -15
  551. package/esm/model/methods/scope-methods.js.map +0 -1
  552. package/esm/model/methods/serialization-methods.d.ts +0 -3
  553. package/esm/model/methods/serialization-methods.d.ts.map +0 -1
  554. package/esm/model/methods/serialization-methods.js +0 -27
  555. package/esm/model/methods/serialization-methods.js.map +0 -1
  556. package/esm/model/methods/static-event-methods.d.ts +0 -9
  557. package/esm/model/methods/static-event-methods.d.ts.map +0 -1
  558. package/esm/model/methods/static-event-methods.js +0 -29
  559. package/esm/model/methods/static-event-methods.js.map +0 -1
  560. package/esm/model/methods/write-methods.d.ts +0 -10
  561. package/esm/model/methods/write-methods.d.ts.map +0 -1
  562. package/esm/model/methods/write-methods.js +0 -52
  563. package/esm/model/methods/write-methods.js.map +0 -1
  564. package/esm/model/model.d.ts +0 -1650
  565. package/esm/model/model.d.ts.map +0 -1
  566. package/esm/model/model.js +0 -1657
  567. package/esm/model/model.js.map +0 -1
  568. package/esm/model/model.types.d.ts +0 -44
  569. package/esm/model/model.types.d.ts.map +0 -1
  570. package/esm/model/register-model.d.ts +0 -81
  571. package/esm/model/register-model.d.ts.map +0 -1
  572. package/esm/model/register-model.js +0 -94
  573. package/esm/model/register-model.js.map +0 -1
  574. package/esm/query-builder/query-builder.d.ts +0 -556
  575. package/esm/query-builder/query-builder.d.ts.map +0 -1
  576. package/esm/query-builder/query-builder.js +0 -1070
  577. package/esm/query-builder/query-builder.js.map +0 -1
  578. package/esm/relations/helpers.d.ts +0 -156
  579. package/esm/relations/helpers.d.ts.map +0 -1
  580. package/esm/relations/helpers.js +0 -201
  581. package/esm/relations/helpers.js.map +0 -1
  582. package/esm/relations/index.d.ts +0 -35
  583. package/esm/relations/index.d.ts.map +0 -1
  584. package/esm/relations/pivot-operations.d.ts +0 -160
  585. package/esm/relations/pivot-operations.d.ts.map +0 -1
  586. package/esm/relations/pivot-operations.js +0 -293
  587. package/esm/relations/pivot-operations.js.map +0 -1
  588. package/esm/relations/relation-hydrator.d.ts +0 -68
  589. package/esm/relations/relation-hydrator.d.ts.map +0 -1
  590. package/esm/relations/relation-hydrator.js +0 -81
  591. package/esm/relations/relation-hydrator.js.map +0 -1
  592. package/esm/relations/relation-loader.d.ts +0 -194
  593. package/esm/relations/relation-loader.d.ts.map +0 -1
  594. package/esm/relations/relation-loader.js +0 -466
  595. package/esm/relations/relation-loader.js.map +0 -1
  596. package/esm/relations/types.d.ts +0 -306
  597. package/esm/relations/types.d.ts.map +0 -1
  598. package/esm/remover/database-remover.d.ts +0 -100
  599. package/esm/remover/database-remover.d.ts.map +0 -1
  600. package/esm/remover/database-remover.js +0 -214
  601. package/esm/remover/database-remover.js.map +0 -1
  602. package/esm/restorer/database-restorer.d.ts +0 -131
  603. package/esm/restorer/database-restorer.d.ts.map +0 -1
  604. package/esm/restorer/database-restorer.js +0 -434
  605. package/esm/restorer/database-restorer.js.map +0 -1
  606. package/esm/sql-database-dirty-tracker.d.ts +0 -13
  607. package/esm/sql-database-dirty-tracker.d.ts.map +0 -1
  608. package/esm/sql-database-dirty-tracker.js +0 -14
  609. package/esm/sql-database-dirty-tracker.js.map +0 -1
  610. package/esm/sync/index.d.ts +0 -12
  611. package/esm/sync/index.d.ts.map +0 -1
  612. package/esm/sync/model-events.d.ts +0 -62
  613. package/esm/sync/model-events.d.ts.map +0 -1
  614. package/esm/sync/model-events.js +0 -49
  615. package/esm/sync/model-events.js.map +0 -1
  616. package/esm/sync/model-sync-operation.d.ts +0 -163
  617. package/esm/sync/model-sync-operation.d.ts.map +0 -1
  618. package/esm/sync/model-sync-operation.js +0 -292
  619. package/esm/sync/model-sync-operation.js.map +0 -1
  620. package/esm/sync/model-sync.d.ts +0 -130
  621. package/esm/sync/model-sync.d.ts.map +0 -1
  622. package/esm/sync/model-sync.js +0 -178
  623. package/esm/sync/model-sync.js.map +0 -1
  624. package/esm/sync/sync-context.d.ts +0 -70
  625. package/esm/sync/sync-context.d.ts.map +0 -1
  626. package/esm/sync/sync-context.js +0 -101
  627. package/esm/sync/sync-context.js.map +0 -1
  628. package/esm/sync/sync-manager.d.ts +0 -213
  629. package/esm/sync/sync-manager.d.ts.map +0 -1
  630. package/esm/sync/sync-manager.js +0 -689
  631. package/esm/sync/sync-manager.js.map +0 -1
  632. package/esm/sync/types.d.ts +0 -289
  633. package/esm/sync/types.d.ts.map +0 -1
  634. package/esm/test-migrations/test-enhanced-features.migration.d.ts +0 -15
  635. package/esm/test-migrations/test-enhanced-features.migration.d.ts.map +0 -1
  636. package/esm/types.d.ts +0 -371
  637. package/esm/types.d.ts.map +0 -1
  638. package/esm/utils/connect-to-database.d.ts +0 -300
  639. package/esm/utils/connect-to-database.d.ts.map +0 -1
  640. package/esm/utils/connect-to-database.js +0 -128
  641. package/esm/utils/connect-to-database.js.map +0 -1
  642. package/esm/utils/database-writer.utils.d.ts +0 -15
  643. package/esm/utils/database-writer.utils.d.ts.map +0 -1
  644. package/esm/utils/database-writer.utils.js +0 -14
  645. package/esm/utils/database-writer.utils.js.map +0 -1
  646. package/esm/utils/define-model.js +0 -100
  647. package/esm/utils/define-model.js.map +0 -1
  648. package/esm/utils/is-valid-date-value.d.ts +0 -5
  649. package/esm/utils/is-valid-date-value.d.ts.map +0 -1
  650. package/esm/utils/is-valid-date-value.js +0 -25
  651. package/esm/utils/is-valid-date-value.js.map +0 -1
  652. package/esm/utils/once-connected.d.ts +0 -146
  653. package/esm/utils/once-connected.d.ts.map +0 -1
  654. package/esm/utils/once-connected.js +0 -251
  655. package/esm/utils/once-connected.js.map +0 -1
  656. package/esm/validation/database-seal-plugins.d.ts +0 -12
  657. package/esm/validation/database-seal-plugins.d.ts.map +0 -1
  658. package/esm/validation/database-seal-plugins.js +0 -1
  659. package/esm/validation/database-seal-plugins.js.map +0 -1
  660. package/esm/validation/database-writer-validation-error.d.ts +0 -97
  661. package/esm/validation/database-writer-validation-error.d.ts.map +0 -1
  662. package/esm/validation/database-writer-validation-error.js +0 -160
  663. package/esm/validation/database-writer-validation-error.js.map +0 -1
  664. package/esm/validation/index.d.ts +0 -3
  665. package/esm/validation/index.d.ts.map +0 -1
  666. package/esm/validation/mutators/embed-mutator.d.ts +0 -9
  667. package/esm/validation/mutators/embed-mutator.d.ts.map +0 -1
  668. package/esm/validation/mutators/embed-mutator.js +0 -33
  669. package/esm/validation/mutators/embed-mutator.js.map +0 -1
  670. package/esm/validation/plugins/embed-validator-plugin.d.ts +0 -24
  671. package/esm/validation/plugins/embed-validator-plugin.d.ts.map +0 -1
  672. package/esm/validation/plugins/embed-validator-plugin.js +0 -18
  673. package/esm/validation/plugins/embed-validator-plugin.js.map +0 -1
  674. package/esm/validation/rules/database-model-rule.d.ts +0 -7
  675. package/esm/validation/rules/database-model-rule.d.ts.map +0 -1
  676. package/esm/validation/rules/database-model-rule.js +0 -27
  677. package/esm/validation/rules/database-model-rule.js.map +0 -1
  678. package/esm/validation/transformers/embed-model-transformer.d.ts +0 -3
  679. package/esm/validation/transformers/embed-model-transformer.d.ts.map +0 -1
  680. package/esm/validation/transformers/embed-model-transformer.js +0 -18
  681. package/esm/validation/transformers/embed-model-transformer.js.map +0 -1
  682. package/esm/validation/validators/embed-validator.d.ts +0 -21
  683. package/esm/validation/validators/embed-validator.d.ts.map +0 -1
  684. package/esm/validation/validators/embed-validator.js +0 -43
  685. package/esm/validation/validators/embed-validator.js.map +0 -1
  686. package/esm/writer/database-writer.d.ts +0 -181
  687. package/esm/writer/database-writer.d.ts.map +0 -1
  688. package/esm/writer/database-writer.js +0 -407
  689. package/esm/writer/database-writer.js.map +0 -1
@@ -1,1122 +0,0 @@
1
- import { GenericObject } from "@mongez/reinforcements";
2
- import type { Collection } from "mongodb";
3
- import type { CursorPaginationOptions, CursorPaginationResult, DriverQuery, GroupByInput, HavingInput, JoinOptions, OrderDirection, PaginationOptions, PaginationResult, QueryBuilderContract, RawExpression, WhereCallback, WhereObject, WhereOperator } from "../../contracts";
4
- import { type DataSource } from "../../data-source/data-source";
5
- import { QueryBuilder } from "../../query-builder/query-builder";
6
- import { MongoQueryOperations } from "./mongodb-query-operations";
7
- import { MongoQueryParser } from "./mongodb-query-parser";
8
- import type { Operation } from "./types";
9
- /**
10
- * MongoDB-specific query builder implementation using aggregation pipeline.
11
- */
12
- export declare class MongoQueryBuilder<T = unknown> extends QueryBuilder<T> implements QueryBuilderContract<T> {
13
- readonly table: string;
14
- /**
15
- * Ordered list of operations to be converted to MongoDB aggregation pipeline.
16
- * Public to allow parser access. Uses MongoDB's own Operation type.
17
- *
18
- * NOTE: This shadows the base `operations: Op[]` field intentionally — the Mongo
19
- * Operation type carries an extra `stage` discriminator used by the pipeline assembler.
20
- */
21
- operations: Operation[];
22
- /**
23
- * Data source instance
24
- */
25
- readonly dataSource: DataSource;
26
- /**
27
- * Lazy-loaded operations helper for constructing pipeline operations.
28
- */
29
- protected _operationsHelper?: MongoQueryOperations;
30
- hydrateCallback?: (data: any, index: number) => any;
31
- private fetchingCallback?;
32
- private hydratingCallback?;
33
- private fetchedCallback?;
34
- /**
35
- * Create a new query builder for the given collection.
36
- * @param collection - The MongoDB collection to query
37
- */
38
- constructor(table: string, dataSource?: DataSource);
39
- /**
40
- * Gets the operations helper instance, creating it if needed.
41
- * @returns The operations helper instance
42
- */
43
- protected get operationsHelper(): MongoQueryOperations;
44
- /**
45
- * Get collection instance
46
- */
47
- get collection(): Collection;
48
- /**
49
- * Add hydrate callback function
50
- */
51
- hydrate(callback: (data: any, index: number) => any): this;
52
- /**
53
- * Register a callback to be invoked before query execution
54
- * @returns Unsubscribe function to remove the callback
55
- */
56
- onFetching(callback: (query: this) => void | Promise<void>): () => void;
57
- /**
58
- * Register a callback to be invoked after records are fetched but before hydration
59
- * @returns Unsubscribe function to remove the callback
60
- */
61
- onHydrating(callback: (records: any[], context: any) => void | Promise<void>): () => void;
62
- /**
63
- * Register a callback to be invoked after records are fetched and hydrated
64
- * @returns Unsubscribe function to remove the callback
65
- */
66
- onFetched(callback: (records: any[], context: any) => void | Promise<void>): () => void;
67
- /**
68
- * Disable one or more global scopes for this query
69
- */
70
- withoutGlobalScope(...scopeNames: string[]): this;
71
- /**
72
- * Disable all global scopes for this query
73
- */
74
- withoutGlobalScopes(): this;
75
- /**
76
- * Apply a local scope to this query
77
- */
78
- scope(scopeName: string, ...args: any[]): this;
79
- /**
80
- * Apply pending global scopes before query execution
81
- */
82
- private applyPendingScopes;
83
- /**
84
- * Adds a WHERE clause to filter documents. Supports equality, operators, objects, or callbacks.
85
- * @param field - Field name, or conditions object, or callback
86
- * @param operator - Comparison operator
87
- * @param value - Value to compare
88
- */
89
- where(field: string, value: unknown): this;
90
- where(field: string, operator: WhereOperator, value: unknown): this;
91
- where(conditions: WhereObject): this;
92
- where(callback: WhereCallback<T>): this;
93
- /**
94
- * Adds an OR WHERE clause. Works like where() but uses OR logic.
95
- * @param field - Field name, or conditions object, or callback
96
- * @param operator - Comparison operator
97
- * @param value - Value to compare
98
- */
99
- orWhere(field: string, value: unknown): this;
100
- orWhere(field: string, operator: WhereOperator, value: unknown): this;
101
- orWhere(conditions: WhereObject): this;
102
- orWhere(callback: WhereCallback<T>): this;
103
- /**
104
- * Adds a raw WHERE clause using MongoDB's native query syntax.
105
- * @param expression - Raw MongoDB expression
106
- * @param bindings - Optional parameter bindings for string expressions
107
- */
108
- whereRaw(expression: RawExpression, bindings?: unknown[]): this;
109
- /**
110
- * Adds a raw OR WHERE clause using MongoDB's native query syntax.
111
- * @param expression - Raw MongoDB expression
112
- * @param bindings - Optional parameter bindings
113
- */
114
- orWhereRaw(expression: RawExpression, bindings?: unknown[]): this;
115
- /**
116
- * Adds a WHERE clause comparing two columns/fields directly.
117
- * @param first - The first field name
118
- * @param operator - The comparison operator
119
- * @param second - The second field name
120
- */
121
- whereColumn(first: string, operator: WhereOperator, second: string): this;
122
- /**
123
- * Adds an OR WHERE clause comparing two columns/fields directly.
124
- * @param first - The first field name
125
- * @param operator - The comparison operator
126
- * @param second - The second field name
127
- */
128
- orWhereColumn(first: string, operator: WhereOperator, second: string): this;
129
- /**
130
- * Adds multiple column comparison clauses at once.
131
- * @param comparisons - Array of tuples [leftField, operator, rightField]
132
- */
133
- whereColumns(comparisons: Array<[left: string, operator: WhereOperator, right: string]>): this;
134
- /**
135
- * Filters documents where a field's value falls between two other fields.
136
- * @param field - The field to check
137
- * @param lowerColumn - The field defining the lower bound
138
- * @param upperColumn - The field defining the upper bound
139
- */
140
- whereBetweenColumns(field: string, lowerColumn: string, upperColumn: string): this;
141
- /**
142
- * Filters documents where a date field matches the given date (ignoring time).
143
- * @param field - The date field name
144
- * @param value - The date to match
145
- */
146
- whereDate(field: string, value: Date | string): this;
147
- /**
148
- * Alias for `whereDate()`. Filters by exact date match (ignoring time).
149
- * @param field - The date field name
150
- * @param value - The date to match
151
- */
152
- whereDateEquals(field: string, value: Date | string): this;
153
- /**
154
- * Filters documents where a date field is before the given date.
155
- * @param field - The date field name
156
- * @param value - The cutoff date
157
- */
158
- whereDateBefore(field: string, value: Date | string): this;
159
- /**
160
- * Filters documents where a date field is after the given date.
161
- * @param field - The date field name
162
- * @param value - The cutoff date
163
- */
164
- whereDateAfter(field: string, value: Date | string): this;
165
- /**
166
- * Filters documents where a time field matches the given time (HH:MM:SS format).
167
- * @param field - The time/datetime field name
168
- * @param value - The time string in HH:MM:SS format
169
- */
170
- whereTime(field: string, value: string): this;
171
- /**
172
- * Filters documents where the day of the month matches the given value (1-31).
173
- * @param field - The date field name
174
- * @param value - The day of the month
175
- */
176
- whereDay(field: string, value: number): this;
177
- /**
178
- * Filters documents where the month matches the given value (1-12).
179
- * @param field - The date field name
180
- * @param value - The month number
181
- */
182
- whereMonth(field: string, value: number): this;
183
- /**
184
- * Filters documents where the year matches the given value.
185
- * @param field - The date field name
186
- * @param value - The year
187
- */
188
- whereYear(field: string, value: number): this;
189
- /**
190
- * Filters documents where a JSON field contains the specified value.
191
- * @param path - The JSON path to check
192
- * @param value - The value to search for
193
- */
194
- whereJsonContains(path: string, value: unknown): this;
195
- /**
196
- * Filters documents where a JSON field does NOT contain the specified value.
197
- * @param path - The JSON path to check
198
- * @param value - The value to exclude
199
- */
200
- whereJsonDoesntContain(path: string, value: unknown): this;
201
- /**
202
- * Filters documents where a JSON field contains a specific key.
203
- * @param path - The JSON path to check for key existence
204
- */
205
- whereJsonContainsKey(path: string): this;
206
- /**
207
- * Filters documents where a JSON array or string has a specific length.
208
- * @param path - The JSON path to check
209
- * @param operator - The comparison operator
210
- * @param value - The length value to compare against
211
- */
212
- whereJsonLength(path: string, operator: WhereOperator, value: number): this;
213
- /**
214
- * Filters documents where a JSON field is an array.
215
- * @param path - The JSON path to check
216
- */
217
- whereJsonIsArray(path: string): this;
218
- /**
219
- * Filters documents where a JSON field is an object.
220
- * @param path - The JSON path to check
221
- */
222
- whereJsonIsObject(path: string): this;
223
- /**
224
- * Filters documents where an array field has a specific length.
225
- * @param field - The array field name
226
- * @param operator - The comparison operator
227
- * @param value - The length value to compare against
228
- */
229
- whereArrayLength(field: string, operator: WhereOperator, value: number): this;
230
- /**
231
- * Filters documents by ID (convenience method for `where("id", value)`).
232
- * @param value - The ID value to match
233
- */
234
- whereId(value: string | number): this;
235
- /**
236
- * Filters documents by multiple IDs (convenience method for `whereIn("id", values)`).
237
- * @param values - Array of ID values to match
238
- */
239
- whereIds(values: Array<string | number>): this;
240
- /**
241
- * Filters documents by UUID (convenience method for `where("uuid", value)`).
242
- * @param value - The UUID string to match
243
- */
244
- whereUuid(value: string): this;
245
- /**
246
- * Filters documents by ULID (convenience method for `where("ulid", value)`).
247
- * @param value - The ULID string to match
248
- */
249
- whereUlid(value: string): this;
250
- /**
251
- * Performs full-text search on one or more fields.
252
- * @param fields - Field name or array of field names to search
253
- * @param query - The search query string
254
- */
255
- whereFullText(fields: string | string[], query: string): this;
256
- /**
257
- * Performs full-text search with OR logic.
258
- * @param fields - Field name or array of field names to search
259
- * @param query - The search query string
260
- */
261
- orWhereFullText(fields: string | string[], query: string): this;
262
- /**
263
- * Alias for `whereFullText()` with a single field.
264
- * @param field - The field name to search
265
- * @param query - The search query string
266
- */
267
- whereSearch(field: string, query: string): this;
268
- /**
269
- * Negates a set of conditions using a callback.
270
- * @param callback - Callback function defining conditions to negate
271
- */
272
- whereNot(callback: WhereCallback<T>): this;
273
- /**
274
- * Negates a set of conditions with OR logic.
275
- * @param callback - Callback function defining conditions to negate
276
- */
277
- orWhereNot(callback: WhereCallback<T>): this;
278
- /**
279
- * Filters documents where a field's value matches any value in the given array.
280
- * @param field - The field name to check
281
- * @param values - Array of values to match against
282
- */
283
- whereIn(field: string, values: unknown[]): this;
284
- /**
285
- * Filters documents where a field's value does NOT match any value in the array.
286
- * @param field - The field name to check
287
- * @param values - Array of values to exclude
288
- */
289
- whereNotIn(field: string, values: unknown[]): this;
290
- /**
291
- * Filters documents where a field's value is null or undefined.
292
- * @param field - The field name to check
293
- */
294
- whereNull(field: string): this;
295
- /**
296
- * Filters documents where a field's value is NOT null or undefined.
297
- * @param field - The field name to check
298
- */
299
- whereNotNull(field: string): this;
300
- /**
301
- * Filters documents where a field's value falls within the given range (inclusive).
302
- * @param field - The field name to check
303
- * @param range - Tuple of [min, max] values
304
- */
305
- whereBetween(field: string, range: [unknown, unknown]): this;
306
- /**
307
- * Filters documents where a field's value is NOT within the given range.
308
- * @param field - The field name to check
309
- * @param range - Tuple of [min, max] values to exclude
310
- */
311
- whereNotBetween(field: string, range: [unknown, unknown]): this;
312
- /**
313
- * Filters documents where a field matches the given pattern (case-insensitive).
314
- * @param field - The field name to search
315
- * @param pattern - The pattern to match
316
- */
317
- whereLike(field: string, pattern: RegExp | string): this;
318
- /**
319
- * Filters documents where a field does NOT match the given pattern.
320
- * @param field - The field name to search
321
- * @param pattern - The pattern to exclude
322
- */
323
- whereNotLike(field: string, pattern: RegExp | string): this;
324
- /**
325
- * Filters documents where a field's value starts with the given prefix.
326
- * @param field - The field name to check
327
- * @param value - The prefix to match
328
- */
329
- whereStartsWith(field: string, value: string | number): this;
330
- /**
331
- * Filters documents where a field's value does NOT start with the given prefix.
332
- * @param field - The field name to check
333
- * @param value - The prefix to exclude
334
- */
335
- whereNotStartsWith(field: string, value: string | number): this;
336
- /**
337
- * Filters documents where a field's value ends with the given suffix.
338
- * @param field - The field name to check
339
- * @param value - The suffix to match
340
- */
341
- whereEndsWith(field: string, value: string | number): this;
342
- /**
343
- * Filters documents where a field's value does NOT end with the given suffix.
344
- * @param field - The field name to check
345
- * @param value - The suffix to exclude
346
- */
347
- whereNotEndsWith(field: string, value: string | number): this;
348
- /**
349
- * Filters documents where a date field falls within the given date range.
350
- * @param field - The date field name
351
- * @param range - Tuple of [startDate, endDate]
352
- */
353
- whereDateBetween(field: string, range: [Date, Date]): this;
354
- /**
355
- * Filters documents where a date field is NOT within the given date range.
356
- * @param field - The date field name
357
- * @param range - Tuple of [startDate, endDate] to exclude
358
- */
359
- whereDateNotBetween(field: string, range: [Date, Date]): this;
360
- /**
361
- * Filters documents where a field exists (has any value including null).
362
- * @param field - The field name to check for existence
363
- * @param callback - Optional callback for subquery existence
364
- */
365
- whereExists(field: string): this;
366
- whereExists(callback: WhereCallback<T>): this;
367
- /**
368
- * Filters documents where a field does NOT exist in the document.
369
- * @param field - The field name to check for absence
370
- * @param callback - Optional callback for subquery non-existence
371
- */
372
- whereNotExists(field: string): this;
373
- whereNotExists(callback: WhereCallback<T>): this;
374
- /**
375
- * Filters documents where an array field has a specific size.
376
- * @param field - The array field name
377
- * @param size - The exact size to match
378
- * @param operator - Optional comparison operator
379
- */
380
- whereSize(field: string, size: number): this;
381
- whereSize(field: string, operator: ">" | ">=" | "=" | "<" | "<=", size: number): this;
382
- /**
383
- * Performs a full-text search on the specified fields.
384
- * @param query - The search query string
385
- * @param filters - Optional additional filter conditions
386
- */
387
- textSearch(query: string, filters?: WhereObject): this;
388
- /**
389
- * Filters documents where an array field contains the given value.
390
- * @param field - The array field name
391
- * @param value - The value to search for in the array
392
- * @param key - Optional key to check within array objects
393
- */
394
- whereArrayContains(field: string, value: unknown, key?: string): this;
395
- /**
396
- * Filters documents where an array field does NOT contain the given value.
397
- * @param field - The array field name
398
- * @param value - The value to exclude from the array
399
- * @param key - Optional key to check within array objects
400
- */
401
- whereArrayNotContains(field: string, value: unknown, key?: string): this;
402
- /**
403
- * Filters documents where an array field contains the value OR is empty.
404
- * @param field - The array field name
405
- * @param value - The value to search for
406
- * @param key - Optional key to check within array objects
407
- */
408
- whereArrayHasOrEmpty(field: string, value: unknown, key?: string): this;
409
- /**
410
- * Filters documents where an array field does NOT contain the value AND is not empty.
411
- * @param field - The array field name
412
- * @param value - The value to exclude
413
- * @param key - Optional key to check within array objects
414
- */
415
- whereArrayNotHaveOrEmpty(field: string, value: unknown, key?: string): this;
416
- /**
417
- * Internal helper for processing where clause arguments.
418
- * @param prefix - The operation prefix
419
- * @param args - The arguments passed to where/orWhere
420
- */
421
- protected addWhereClause(prefix: "where" | "orWhere", args: any[]): void;
422
- /**
423
- * Internal helper for adding raw where clauses.
424
- * @param type - The operation type
425
- * @param expression - The raw expression in MongoDB query language
426
- * @param bindings - Optional bindings for the expression
427
- */
428
- protected addRawWhere(type: "whereRaw" | "orWhereRaw", expression: RawExpression, bindings?: unknown[]): this;
429
- /**
430
- * Normalizes select field arguments into a structured format.
431
- * @param args - The arguments to normalize
432
- * @returns Normalized selection object with fields and aliases
433
- */
434
- protected normalizeSelectFields(args: any[]): {
435
- fields?: string[];
436
- projection?: Record<string, unknown>;
437
- };
438
- /**
439
- * Specifies which fields to include in the query results.
440
- * Supports arrays, multiple args, or object with aliases/inclusion/exclusion.
441
- * @param fields - Field names, array, or projection object
442
- */
443
- select(fields: string[]): this;
444
- select(fields: Record<string, 0 | 1 | boolean | string>): this;
445
- select(...fields: string[]): this;
446
- /**
447
- * Selects a field with an alias.
448
- * @param field - The field to select
449
- * @param alias - The alias name for the field
450
- * @returns The query builder instance
451
- */
452
- selectAs(field: string, alias: string): this;
453
- /**
454
- * Adds a computed field using a raw MongoDB expression.
455
- * @param expression - The raw MongoDB expression
456
- * @param bindings - Optional parameter bindings for string expressions
457
- */
458
- selectRaw(expression: RawExpression, bindings?: unknown[]): this;
459
- /**
460
- * Adds multiple computed fields using raw MongoDB expressions.
461
- * @param definitions - Array of field definitions with alias, expression, and optional bindings
462
- */
463
- selectRawMany(definitions: Array<{
464
- alias: string;
465
- expression: RawExpression;
466
- bindings?: unknown[];
467
- }>): this;
468
- /**
469
- * Adds a subquery as a computed field.
470
- * @param expression - The subquery expression
471
- * @param alias - The alias for the computed field
472
- */
473
- selectSub(expression: RawExpression, alias: string): this;
474
- /**
475
- * Adds an additional subquery field to existing selections.
476
- * @param expression - The subquery expression
477
- * @param alias - The alias for the computed field
478
- */
479
- addSelectSub(expression: RawExpression, alias: string): this;
480
- /**
481
- * Adds an aggregate value as a computed field.
482
- * @param field - The field to aggregate
483
- * @param aggregate - The aggregate function to apply
484
- * @param alias - The alias for the computed field
485
- */
486
- selectAggregate(field: string, aggregate: "sum" | "avg" | "min" | "max" | "count" | "first" | "last", alias: string): this;
487
- /**
488
- * Adds a boolean field indicating whether a related document exists.
489
- * @param field - The field to check for existence
490
- * @param alias - The alias for the boolean field
491
- */
492
- selectExists(field: string, alias: string): this;
493
- /**
494
- * Adds a count field for a related collection.
495
- * @param field - The field to count
496
- * @param alias - The alias for the count field
497
- */
498
- selectCount(field: string, alias: string): this;
499
- /**
500
- * Adds a CASE-like conditional field using multiple conditions.
501
- * @param cases - Array of when/then pairs
502
- * @param otherwise - Default value if no conditions match
503
- * @param alias - The alias for the computed field
504
- */
505
- selectCase(cases: Array<{
506
- when: RawExpression;
507
- then: RawExpression | unknown;
508
- }>, otherwise: RawExpression | unknown, alias: string): this;
509
- /**
510
- * Adds a simple conditional field (if/else).
511
- * @param condition - The condition to evaluate
512
- * @param thenValue - Value if condition is true
513
- * @param elseValue - Value if condition is false
514
- * @param alias - The alias for the computed field
515
- */
516
- selectWhen(condition: RawExpression, thenValue: RawExpression | unknown, elseValue: RawExpression | unknown, alias: string): this;
517
- /**
518
- * Allows direct manipulation of the MongoDB projection object.
519
- * @param callback - Function that receives and modifies the projection object
520
- */
521
- selectDriverProjection(callback: (projection: Record<string, unknown>) => void): this;
522
- /**
523
- * Extracts a JSON field from a document.
524
- * @param path - The JSON path to extract
525
- * @param alias - Optional alias for the extracted field
526
- */
527
- selectJson(path: string, alias?: string): this;
528
- /**
529
- * Extracts a JSON field using a raw MongoDB expression.
530
- * @param path - The JSON path
531
- * @param expression - The raw expression for extraction
532
- * @param alias - The alias for the extracted field
533
- */
534
- selectJsonRaw(path: string, expression: RawExpression, alias: string): this;
535
- /**
536
- * Excludes a JSON path from the results.
537
- * @param path - The JSON path to exclude
538
- */
539
- deselectJson(path: string): this;
540
- /**
541
- * Concatenates multiple fields into a single string field.
542
- * @param fields - Array of fields or expressions to concatenate
543
- * @param alias - The alias for the concatenated field
544
- */
545
- selectConcat(fields: Array<string | RawExpression>, alias: string): this;
546
- /**
547
- * Returns the first non-null value from a list of fields.
548
- * @param fields - Array of fields to check
549
- * @param alias - The alias for the coalesced field
550
- */
551
- selectCoalesce(fields: Array<string | RawExpression>, alias: string): this;
552
- /**
553
- * Adds window function operations to the query.
554
- * @param spec - The window function specification
555
- */
556
- selectWindow(spec: RawExpression): this;
557
- /**
558
- * Excludes specific fields from the query results.
559
- * @param fields - Field names to exclude
560
- */
561
- deselect(fields: string[]): this;
562
- deselect(...fields: Array<string | string[]>): this;
563
- /**
564
- * Returns only distinct values for the specified fields.
565
- * @param fields - Optional field names to use for distinctness
566
- */
567
- distinctValues(fields?: string | string[]): this;
568
- /**
569
- * Adds additional fields to an existing selection.
570
- * @param fields - Additional field names to include
571
- */
572
- addSelect(fields: string[]): this;
573
- addSelect(...fields: Array<string | string[]>): this;
574
- /**
575
- * Removes all field selection restrictions.
576
- */
577
- clearSelect(): this;
578
- /**
579
- * Alias for `clearSelect()`. Removes all field restrictions.
580
- */
581
- selectAll(): this;
582
- /**
583
- * Alias for `clearSelect()`. Resets to default field selection.
584
- */
585
- selectDefault(): this;
586
- /**
587
- * Orders the query results by a specific field or multiple fields.
588
- *
589
- * @param field - The field name to sort by, or an object with multiple fields
590
- * @param direction - The sort direction (only used when field is a string)
591
- *
592
- * @example
593
- * ```typescript
594
- * // Single field
595
- * query.orderBy("createdAt", "desc");
596
- *
597
- * // Multiple fields
598
- * query.orderBy({ id: "asc", age: "desc", createdAt: "desc" });
599
- * ```
600
- */
601
- orderBy(field: string, direction?: OrderDirection): this;
602
- orderBy(fields: Record<string, OrderDirection>): this;
603
- /**
604
- * Orders the query results by a field in descending order.
605
- * @param field - The field name to sort by
606
- */
607
- orderByDesc(field: string): this;
608
- /**
609
- * Orders the query results using a raw MongoDB sort expression.
610
- * @param expression - The raw MongoDB sort expression
611
- * @param bindings - Optional parameter bindings
612
- */
613
- orderByRaw(expression: RawExpression, bindings?: unknown[]): this;
614
- /**
615
- * Orders the query results randomly.
616
- */
617
- orderByRandom(limit?: number): this;
618
- /**
619
- * Orders results by a date field in descending order (newest first).
620
- * @param column - The date column to sort by
621
- */
622
- latest(column?: string): Promise<T[]>;
623
- /**
624
- * Orders results by a date field in ascending order (oldest first).
625
- * @param column - The date column to sort by
626
- */
627
- oldest(column?: string): this;
628
- /**
629
- * Limits the number of documents returned by the query.
630
- * @param value - The maximum number of documents to return
631
- */
632
- limit(value: number): this;
633
- /**
634
- * Skips a specified number of documents in the query results.
635
- * @param value - The number of documents to skip
636
- */
637
- skip(value: number): this;
638
- /**
639
- * Alias for `skip()`. Skips a specified number of documents.
640
- * @param value - The number of documents to skip
641
- */
642
- offset(value: number): this;
643
- /**
644
- * Alias for `limit()`. Limits the number of documents returned.
645
- * @param value - The maximum number of documents to return
646
- */
647
- take(value: number): this;
648
- /**
649
- * Applies cursor-based filtering for pagination.
650
- * @param after - Cursor value for forward pagination
651
- * @param before - Cursor value for backward pagination
652
- */
653
- cursor(after?: unknown, before?: unknown): this;
654
- /**
655
- * Groups documents by one or more fields.
656
- *
657
- * @param fields - Field(s) to group by
658
- * @param aggregates - Optional aggregate operations to perform
659
- *
660
- * @example
661
- * ```typescript
662
- * import { $agg } from '@warlock.js/cascade';
663
- *
664
- * // Simple grouping
665
- * query.groupBy("type");
666
- *
667
- * // Grouping with aggregates
668
- * query.groupBy("type", {
669
- * count: $agg.count(),
670
- * total: $agg.sum("duration")
671
- * });
672
- * ```
673
- */
674
- groupBy(fields: GroupByInput): this;
675
- groupBy(fields: GroupByInput, aggregates: Record<string, RawExpression>): this;
676
- /**
677
- * Groups documents using a raw MongoDB expression.
678
- * @param expression - The raw grouping expression
679
- * @param bindings - Optional parameter bindings
680
- */
681
- groupByRaw(expression: RawExpression, bindings?: unknown[]): this;
682
- /**
683
- * Filters grouped results based on aggregate conditions.
684
- * @param field - The aggregate field to filter on
685
- * @param value - The value to compare against
686
- * @param operator - The comparison operator
687
- * @param condition - A condition object for complex filters
688
- */
689
- having(field: string, value: unknown): this;
690
- having(field: string, operator: WhereOperator, value: unknown): this;
691
- having(condition: HavingInput): this;
692
- /**
693
- * Filters grouped results using a raw MongoDB expression.
694
- * @param expression - The raw having expression
695
- * @param bindings - Optional parameter bindings
696
- */
697
- havingRaw(expression: RawExpression, bindings?: unknown[]): this;
698
- /**
699
- * Performs a join with another collection using MongoDB's $lookup.
700
- *
701
- * @param table - Target collection name
702
- * @param localField - Field from the input documents
703
- * @param foreignField - Field from the documents of the "from" collection
704
- */
705
- join(table: string, localField: string, foreignField: string): this;
706
- /**
707
- * Performs a join with another collection using MongoDB's $lookup.
708
- *
709
- * @param options - Join configuration including table, fields, and optional pipeline
710
- */
711
- join(options: JoinOptions): this;
712
- /**
713
- * Performs a left outer join with another collection.
714
- * In MongoDB, this is the standard $lookup behavior.
715
- *
716
- * @param table - Target collection name
717
- * @param localField - Field from the input documents
718
- * @param foreignField - Field from the documents of the "from" collection
719
- */
720
- leftJoin(table: string, localField: string, foreignField: string): this;
721
- /**
722
- * Performs a left outer join with another collection.
723
- *
724
- * @param options - Join configuration
725
- */
726
- leftJoin(options: JoinOptions): this;
727
- /**
728
- * Performs a right outer join with another collection.
729
- *
730
- * Note: MongoDB doesn't natively support right joins. This is implemented
731
- * as a regular left join with a warning. For true right join semantics,
732
- * consider reversing the collections in your query.
733
- *
734
- * @param table - Target collection name
735
- * @param localField - Field from the input documents
736
- * @param foreignField - Field from the documents of the "from" collection
737
- */
738
- rightJoin(table: string, localField: string, foreignField: string): this;
739
- /**
740
- * Performs a right outer join with another collection.
741
- *
742
- * @param options - Join configuration
743
- */
744
- rightJoin(options: JoinOptions): this;
745
- /**
746
- * Performs an inner join with another collection.
747
- *
748
- * This adds a $lookup followed by a $match to filter out documents
749
- * where the joined array is empty.
750
- *
751
- * @param table - Target collection name
752
- * @param localField - Field from the input documents
753
- * @param foreignField - Field from the documents of the "from" collection
754
- */
755
- innerJoin(table: string, localField: string, foreignField: string): this;
756
- /**
757
- * Performs an inner join with another collection.
758
- *
759
- * @param options - Join configuration
760
- */
761
- innerJoin(options: JoinOptions): this;
762
- /**
763
- * Performs a full outer join with another collection.
764
- *
765
- * Note: MongoDB doesn't natively support full outer joins. This is implemented
766
- * as a regular left join. For true full outer join semantics, you would need
767
- * to use $unionWith and additional aggregation logic.
768
- *
769
- * @param table - Target collection name
770
- * @param localField - Field from the input documents
771
- * @param foreignField - Field from the documents of the "from" collection
772
- */
773
- fullJoin(table: string, localField: string, foreignField: string): this;
774
- /**
775
- * Performs a full outer join with another collection.
776
- *
777
- * @param options - Join configuration
778
- */
779
- fullJoin(options: JoinOptions): this;
780
- /**
781
- * Performs a cross join with another collection.
782
- *
783
- * This creates a cartesian product by using $lookup with empty matching criteria.
784
- *
785
- * @param table - Target collection name
786
- */
787
- crossJoin(table: string): this;
788
- /**
789
- * Performs a raw join using a custom aggregation pipeline.
790
- *
791
- * This allows full control over the $lookup stage for complex join scenarios.
792
- *
793
- * @param expression - Raw expression (typically a $lookup stage or pipeline)
794
- * @param _bindings - Optional bindings (not used in MongoDB but kept for API consistency)
795
- */
796
- joinRaw(expression: RawExpression, _bindings?: unknown[]): this;
797
- /**
798
- * Allows direct manipulation of the native MongoDB query.
799
- * @param builder - Function that receives and modifies the native query
800
- */
801
- raw(builder: (native: unknown) => unknown): this;
802
- /**
803
- * Extends the query builder with driver-specific functionality.
804
- * @param extension - The extension name
805
- * @param _args - Extension-specific arguments
806
- * @returns The extension's return value
807
- */
808
- extend<R>(extension: string, ..._args: unknown[]): R;
809
- /**
810
- * Creates a deep copy of the query builder.
811
- * @returns A new query builder instance with copied operations
812
- */
813
- clone(): this;
814
- /**
815
- * Executes a callback with the query builder without breaking the chain.
816
- * @param callback - Function to execute with the builder
817
- */
818
- tap(callback: (builder: this) => void): this;
819
- /**
820
- * Conditionally applies query modifications based on a condition.
821
- * @param condition - The condition to evaluate
822
- * @param callback - Function to execute if condition is true
823
- * @param otherwise - Optional function to execute if condition is false
824
- *
825
- * @example
826
- * query.when(searchTerm, (q, term) => q.whereLike('name', term))
827
- */
828
- when<V>(condition: V | boolean, callback: (builder: this, value: V) => void, otherwise?: (builder: this) => void): this;
829
- /**
830
- * Executes the query and returns all matching documents.
831
- * @returns an array of matching documents
832
- */
833
- get<Output = T>(): Promise<Output[]>;
834
- /**
835
- * Execute the query and get first result
836
- * This is different than `first` as first adds a `limit = 1` to the pipeline
837
- */
838
- getFirst<Output = T>(): Promise<Output | null>;
839
- /**
840
- * Executes the query and returns the first matching document.
841
- * @returns the first document or null
842
- */
843
- first<Output = T>(): Promise<Output | null>;
844
- /**
845
- * Executes the query and returns the first matching document, throwing if none found.
846
- * @returns the first document
847
- */
848
- firstOrFail<Output = T>(): Promise<Output>;
849
- /**
850
- * Find a document by its primary key (id field).
851
- */
852
- find<Output = T>(id: number | string): Promise<Output | null>;
853
- /**
854
- * Configures the query to retrieve the last matching document.
855
- */
856
- last<Output = T>(field?: string): Promise<Output | null>;
857
- /**
858
- * Counts the number of documents matching the query.
859
- * @returns the count of matching documents
860
- */
861
- count(): Promise<number>;
862
- /**
863
- * Calculates the sum of a numeric field across matching documents.
864
- * @param field - The numeric field to sum
865
- * @returns the sum value
866
- */
867
- sum(field: string): Promise<number>;
868
- /**
869
- * Calculates the average value of a numeric field across matching documents.
870
- * @param field - The numeric field to average
871
- * @returns the average value
872
- */
873
- avg(field: string): Promise<number>;
874
- /**
875
- * Finds the minimum value of a field across matching documents.
876
- * @param field - The field to find the minimum of
877
- * @returns the minimum value
878
- */
879
- min(field: string): Promise<number>;
880
- /**
881
- * Finds the maximum value of a field across matching documents.
882
- * @param field - The field to find the maximum of
883
- * @returns the maximum value
884
- */
885
- max(field: string): Promise<number>;
886
- /**
887
- * Returns an array of distinct values for a field, respecting query filters.
888
- * @param field - The field to get distinct values from
889
- * @returns an array of distinct values
890
- */
891
- distinct<T = unknown>(field: string, ignoreNull?: boolean): Promise<T[]>;
892
- /**
893
- * Count distinct values for a field, respecting query filters.
894
- * @param field - The field to count distinct values for
895
- * @returns the count of distinct values
896
- */
897
- countDistinct(field: string, ignoreNull?: boolean): Promise<number>;
898
- /**
899
- * Extracts a single field value from each matching document.
900
- * @param field - The field to extract
901
- * @returns an array of field values
902
- */
903
- pluck<T = unknown>(field: string): Promise<T[]>;
904
- /**
905
- * Gets the value of a single field from the first matching document.
906
- * @param field - The field to extract
907
- * @returns the field value or null
908
- */
909
- value<T = unknown>(field: string): Promise<T | null>;
910
- /**
911
- * Checks if any documents match the query.
912
- * @param filter - Optional filter to apply to the query
913
- * @returns true if documents exist, false otherwise
914
- */
915
- exists(filter?: GenericObject): Promise<boolean>;
916
- /**
917
- * Checks if no documents match the query.
918
- * @param filter - Optional filter to apply to the query
919
- * @returns true if no documents exist, false otherwise
920
- */
921
- notExists(filter?: GenericObject): Promise<boolean>;
922
- /**
923
- * Increments a numeric field by the specified amount for first matching document.
924
- * @param field - The field to increment
925
- * @param amount - The amount to increment by (default: 1)
926
- * @returns the new value
927
- */
928
- increment(field: string, amount?: number): Promise<number>;
929
- /**
930
- * Decrements a numeric field by the specified amount.
931
- * @param field - The field to decrement
932
- * @param amount - The amount to decrement by
933
- * @returns the new value
934
- */
935
- decrement(field: string, amount?: number): Promise<number>;
936
- /**
937
- * Increments a numeric field by the specified amount for all matching documents.
938
- * @param field - The field to increment
939
- * @param amount - The amount to increment by (default: 1)
940
- * @returns the number of documents modified
941
- */
942
- incrementMany(field: string, amount?: number): Promise<number>;
943
- /**
944
- * Decrements a numeric field by the specified amount for all matching documents.
945
- * @param field - The field to decrement
946
- * @param amount - The amount to decrement by (default: 1)
947
- * @returns the number of documents modified
948
- */
949
- decrementMany(field: string, amount?: number): Promise<number>;
950
- /**
951
- * Delete all documents matching the query.
952
- */
953
- delete(): Promise<number>;
954
- /**
955
- * Delete a single document matching the query.
956
- */
957
- deleteOne(): Promise<number>;
958
- /**
959
- * Update the given fields for all documents matching the query.
960
- */
961
- update(fields: Record<string, unknown>): Promise<number>;
962
- /**
963
- * Unset the given fields from all documents matching the query.
964
- */
965
- unset(...fields: string[]): Promise<number>;
966
- /**
967
- * Processes query results in chunks, executing a callback for each chunk.
968
- * @param size - The number of documents per chunk
969
- * @param callback - Function to execute for each chunk
970
- * @returns void
971
- */
972
- chunk(size: number, callback: (rows: T[], chunkIndex: number) => Promise<boolean | void> | boolean | void): Promise<void>;
973
- /**
974
- * Executes the query with traditional page-based pagination.
975
- * @param options - Pagination options
976
- * @returns pagination result with data and metadata
977
- */
978
- paginate(options?: PaginationOptions): Promise<PaginationResult<T>>;
979
- /**
980
- * Executes the query with cursor-based pagination supporting both directions.
981
- * @param options - Cursor pagination options
982
- * @returns cursor pagination result with data and cursor info
983
- */
984
- cursorPaginate(options?: CursorPaginationOptions): Promise<CursorPaginationResult<T>>;
985
- /**
986
- * Returns the MongoDB aggregation pipeline that will be executed.
987
- */
988
- parse(): DriverQuery;
989
- /**
990
- * Returns a formatted string representation of the query pipeline.
991
- * @returns A formatted string representation of the pipeline
992
- */
993
- pretty(): string;
994
- /**
995
- * Returns the MongoDB query execution plan.
996
- * @returns MongoDB's explain output
997
- */
998
- explain(): Promise<unknown>;
999
- /**
1000
- * Get query parser instance
1001
- */
1002
- protected getParser(): MongoQueryParser;
1003
- /**
1004
- * Build the MongoDB aggregation pipeline from the operations list.
1005
- * @returns The MongoDB aggregation pipeline
1006
- */
1007
- protected buildPipeline(): any[];
1008
- /**
1009
- * Build a MongoDB filter object from the query's where clauses.
1010
- * Used for update operations like increment/decrement.
1011
- * @returns The MongoDB filter object
1012
- */
1013
- protected buildFilter(): Record<string, unknown>;
1014
- /**
1015
- * Execute the aggregate command
1016
- */
1017
- protected execute<T extends any = any>(pipeline?: any[]): Promise<T[]>;
1018
- /**
1019
- * Relations to eagerly load.
1020
- */
1021
- eagerLoadRelations: Map<string, boolean | ((query: QueryBuilderContract) => void)>;
1022
- /**
1023
- * Relations to count.
1024
- */
1025
- countRelations: string[];
1026
- /**
1027
- * Relations to load via $lookup (single query).
1028
- */
1029
- joinRelations: Map<string, {
1030
- alias: string;
1031
- type: "belongsTo" | "hasOne" | "hasMany";
1032
- }>;
1033
- /**
1034
- * Relation definitions from the model.
1035
- */
1036
- relationDefinitions?: Record<string, any>;
1037
- /**
1038
- * Model class reference.
1039
- */
1040
- modelClass?: any;
1041
- /**
1042
- * Load relations using MongoDB $lookup in a single aggregation query.
1043
- *
1044
- * Unlike `with()` which uses separate queries, `joinWith()` uses
1045
- * $lookup to fetch related data in a single aggregation pipeline.
1046
- *
1047
- * @param relations - Relation names to load via $lookup
1048
- * @returns This builder for chaining
1049
- */
1050
- joinWith(...relations: string[]): this;
1051
- /**
1052
- * Eagerly load one or more relations.
1053
- *
1054
- * Supported patterns:
1055
- * - `with("posts")` - Load relation
1056
- * - `with("posts", "comments")` - Load multiple relations
1057
- * - `with("posts", callback)` - Load relation with constraint
1058
- * - `with({ posts: true, comments: callback })` - Object configuration
1059
- *
1060
- * @param args - Relation name(s), callbacks, or configuration object
1061
- */
1062
- with(...args: (string | Record<string, boolean | ((query: QueryBuilderContract) => void)> | ((query: QueryBuilderContract) => void))[]): this;
1063
- /**
1064
- * Add a count of related models as a virtual field.
1065
- * @param relations - Relation name(s) to count
1066
- */
1067
- withCount(...relations: string[]): this;
1068
- /**
1069
- * Filter results to only those that have related models.
1070
- * @param relation - Relation name
1071
- * @param operator - Optional comparison operator
1072
- * @param count - Optional count to compare against
1073
- */
1074
- has(relation: string, operator?: string, count?: number): this;
1075
- /**
1076
- * Filter results that have related models matching specific conditions.
1077
- * @param relation - Relation name
1078
- * @param callback - Callback to define conditions
1079
- */
1080
- whereHas(relation: string, callback: (query: QueryBuilderContract) => void): this;
1081
- /**
1082
- * Filter results that don't have any related models.
1083
- * @param relation - Relation name
1084
- */
1085
- doesntHave(relation: string): this;
1086
- /**
1087
- * Filter results that don't have related models matching specific conditions.
1088
- * @param relation - Relation name
1089
- * @param callback - Callback to define conditions
1090
- */
1091
- whereDoesntHave(relation: string, callback: (query: QueryBuilderContract) => void): this;
1092
- /**
1093
- * Nearest-neighbour vector similarity search via MongoDB Atlas $vectorSearch.
1094
- *
1095
- * Adds two pipeline stages:
1096
- * 1. `$vectorSearch` — runs the ANN search using the Atlas vector index.
1097
- * Must be the first stage in the pipeline. Limit is embedded here.
1098
- * 2. `$addFields` — exposes `{ $meta: "vectorSearchScore" }` under `alias`
1099
- * so callers can filter by minimum score after `.get()`.
1100
- *
1101
- * **Prerequisites:**
1102
- * - MongoDB Atlas cluster (local/Community MongoDB does NOT support $vectorSearch)
1103
- * - A vector search index on the collection, e.g.:
1104
- * `{ "fields": [{ "type": "vector", "path": "embedding", "numDimensions": 1536, "similarity": "cosine" }] }`
1105
- * - The index name convention used here is `"${column}_index"` (override via `alias` if needed).
1106
- *
1107
- * @param column - Vector column name (e.g. `"embedding"`)
1108
- * @param embedding - Query embedding as a plain number array
1109
- * @param alias - Score alias added to each result row (default: `"score"`)
1110
- *
1111
- * @example
1112
- * ```typescript
1113
- * const results = await Vector.query()
1114
- * .where({ organization_id: "org-123" })
1115
- * .nearestTo("embedding", queryEmbedding)
1116
- * .limit(5)
1117
- * .get<VectorRow & { score: number }>();
1118
- * ```
1119
- */
1120
- nearestTo(column: string, embedding: number[], alias?: string): this;
1121
- }
1122
- //# sourceMappingURL=mongodb-query-builder.d.ts.map