joist-orm 1.293.0 → 2.0.0

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 (486) hide show
  1. package/build/{drivers/PostgresDriver.d.ts → PostgresDriver.d.ts} +1 -4
  2. package/build/PostgresDriver.d.ts.map +1 -0
  3. package/build/{drivers/PostgresDriver.js → PostgresDriver.js} +49 -58
  4. package/build/PostgresDriver.js.map +1 -0
  5. package/build/codegen.d.ts +2 -0
  6. package/build/codegen.d.ts.map +1 -0
  7. package/build/codegen.js +29 -0
  8. package/build/codegen.js.map +1 -0
  9. package/build/graphql-codegen-export.d.ts +2 -0
  10. package/build/graphql-codegen-export.d.ts.map +1 -0
  11. package/build/{drivers/index.js → graphql-codegen-export.js} +3 -5
  12. package/build/graphql-codegen-export.js.map +1 -0
  13. package/build/graphql-export.d.ts +2 -0
  14. package/build/graphql-export.d.ts.map +1 -0
  15. package/build/graphql-export.js +19 -0
  16. package/build/graphql-export.js.map +1 -0
  17. package/build/index.d.ts +3 -127
  18. package/build/index.d.ts.map +1 -1
  19. package/build/index.js +8 -282
  20. package/build/index.js.map +1 -1
  21. package/build/knex-export.d.ts +2 -0
  22. package/build/knex-export.d.ts.map +1 -0
  23. package/build/knex-export.js +19 -0
  24. package/build/knex-export.js.map +1 -0
  25. package/build/pg-migrate.d.ts +2 -0
  26. package/build/pg-migrate.d.ts.map +1 -0
  27. package/build/pg-migrate.js +30 -0
  28. package/build/pg-migrate.js.map +1 -0
  29. package/build/postgres-driver.d.ts +2 -0
  30. package/build/postgres-driver.d.ts.map +1 -0
  31. package/build/postgres-driver.js +7 -0
  32. package/build/postgres-driver.js.map +1 -0
  33. package/build/tests-export.d.ts +2 -0
  34. package/build/tests-export.d.ts.map +1 -0
  35. package/build/tests-export.js +19 -0
  36. package/build/tests-export.js.map +1 -0
  37. package/build/trusted.d.ts +5 -0
  38. package/build/trusted.d.ts.map +1 -0
  39. package/build/trusted.js +15 -0
  40. package/build/trusted.js.map +1 -0
  41. package/package.json +85 -16
  42. package/build/AliasAssigner.d.ts +0 -7
  43. package/build/AliasAssigner.d.ts.map +0 -1
  44. package/build/AliasAssigner.js +0 -30
  45. package/build/AliasAssigner.js.map +0 -1
  46. package/build/Aliases.d.ts +0 -110
  47. package/build/Aliases.d.ts.map +0 -1
  48. package/build/Aliases.js +0 -456
  49. package/build/Aliases.js.map +0 -1
  50. package/build/BaseEntity.d.ts +0 -66
  51. package/build/BaseEntity.d.ts.map +0 -1
  52. package/build/BaseEntity.js +0 -120
  53. package/build/BaseEntity.js.map +0 -1
  54. package/build/ConditionBuilder.d.ts +0 -50
  55. package/build/ConditionBuilder.d.ts.map +0 -1
  56. package/build/ConditionBuilder.js +0 -178
  57. package/build/ConditionBuilder.js.map +0 -1
  58. package/build/Entity.d.ts +0 -38
  59. package/build/Entity.d.ts.map +0 -1
  60. package/build/Entity.js +0 -8
  61. package/build/Entity.js.map +0 -1
  62. package/build/EntityFields.d.ts +0 -37
  63. package/build/EntityFields.d.ts.map +0 -1
  64. package/build/EntityFields.js +0 -3
  65. package/build/EntityFields.js.map +0 -1
  66. package/build/EntityFilter.d.ts +0 -113
  67. package/build/EntityFilter.d.ts.map +0 -1
  68. package/build/EntityFilter.js +0 -3
  69. package/build/EntityFilter.js.map +0 -1
  70. package/build/EntityGraphQLFilter.d.ts +0 -51
  71. package/build/EntityGraphQLFilter.d.ts.map +0 -1
  72. package/build/EntityGraphQLFilter.js +0 -54
  73. package/build/EntityGraphQLFilter.js.map +0 -1
  74. package/build/EntityManager.d.ts +0 -734
  75. package/build/EntityManager.d.ts.map +0 -1
  76. package/build/EntityManager.js +0 -2069
  77. package/build/EntityManager.js.map +0 -1
  78. package/build/EntityMetadata.d.ts +0 -185
  79. package/build/EntityMetadata.d.ts.map +0 -1
  80. package/build/EntityMetadata.js +0 -61
  81. package/build/EntityMetadata.js.map +0 -1
  82. package/build/EnumMetadata.d.ts +0 -15
  83. package/build/EnumMetadata.d.ts.map +0 -1
  84. package/build/EnumMetadata.js +0 -3
  85. package/build/EnumMetadata.js.map +0 -1
  86. package/build/FlushLock.d.ts +0 -26
  87. package/build/FlushLock.d.ts.map +0 -1
  88. package/build/FlushLock.js +0 -57
  89. package/build/FlushLock.js.map +0 -1
  90. package/build/HintTree.d.ts +0 -42
  91. package/build/HintTree.d.ts.map +0 -1
  92. package/build/HintTree.js +0 -64
  93. package/build/HintTree.js.map +0 -1
  94. package/build/IndexManager.d.ts +0 -30
  95. package/build/IndexManager.d.ts.map +0 -1
  96. package/build/IndexManager.js +0 -206
  97. package/build/IndexManager.js.map +0 -1
  98. package/build/InstanceData.d.ts +0 -59
  99. package/build/InstanceData.d.ts.map +0 -1
  100. package/build/InstanceData.js +0 -162
  101. package/build/InstanceData.js.map +0 -1
  102. package/build/IsLoadedCache.d.ts +0 -32
  103. package/build/IsLoadedCache.d.ts.map +0 -1
  104. package/build/IsLoadedCache.js +0 -80
  105. package/build/IsLoadedCache.js.map +0 -1
  106. package/build/JoinRows.d.ts +0 -75
  107. package/build/JoinRows.d.ts.map +0 -1
  108. package/build/JoinRows.js +0 -246
  109. package/build/JoinRows.js.map +0 -1
  110. package/build/PluginManager.d.ts +0 -90
  111. package/build/PluginManager.d.ts.map +0 -1
  112. package/build/PluginManager.js +0 -97
  113. package/build/PluginManager.js.map +0 -1
  114. package/build/QueryParser.d.ts +0 -271
  115. package/build/QueryParser.d.ts.map +0 -1
  116. package/build/QueryParser.js +0 -853
  117. package/build/QueryParser.js.map +0 -1
  118. package/build/QueryParser.pruning.d.ts +0 -5
  119. package/build/QueryParser.pruning.d.ts.map +0 -1
  120. package/build/QueryParser.pruning.js +0 -118
  121. package/build/QueryParser.pruning.js.map +0 -1
  122. package/build/QueryVisitor.d.ts +0 -19
  123. package/build/QueryVisitor.d.ts.map +0 -1
  124. package/build/QueryVisitor.js +0 -84
  125. package/build/QueryVisitor.js.map +0 -1
  126. package/build/ReactionsManager.d.ts +0 -84
  127. package/build/ReactionsManager.d.ts.map +0 -1
  128. package/build/ReactionsManager.js +0 -307
  129. package/build/ReactionsManager.js.map +0 -1
  130. package/build/Todo.d.ts +0 -31
  131. package/build/Todo.d.ts.map +0 -1
  132. package/build/Todo.js +0 -73
  133. package/build/Todo.js.map +0 -1
  134. package/build/caches.d.ts +0 -6
  135. package/build/caches.d.ts.map +0 -1
  136. package/build/caches.js +0 -42
  137. package/build/caches.js.map +0 -1
  138. package/build/changes.d.ts +0 -79
  139. package/build/changes.d.ts.map +0 -1
  140. package/build/changes.js +0 -251
  141. package/build/changes.js.map +0 -1
  142. package/build/config.d.ts +0 -237
  143. package/build/config.d.ts.map +0 -1
  144. package/build/config.js +0 -298
  145. package/build/config.js.map +0 -1
  146. package/build/config.test.d.ts +0 -2
  147. package/build/config.test.d.ts.map +0 -1
  148. package/build/config.test.js +0 -53
  149. package/build/config.test.js.map +0 -1
  150. package/build/configure.d.ts +0 -13
  151. package/build/configure.d.ts.map +0 -1
  152. package/build/configure.js +0 -329
  153. package/build/configure.js.map +0 -1
  154. package/build/dataloaders/findByUniqueDataLoader.d.ts +0 -7
  155. package/build/dataloaders/findByUniqueDataLoader.d.ts.map +0 -1
  156. package/build/dataloaders/findByUniqueDataLoader.js +0 -47
  157. package/build/dataloaders/findByUniqueDataLoader.js.map +0 -1
  158. package/build/dataloaders/findCountDataLoader.d.ts +0 -7
  159. package/build/dataloaders/findCountDataLoader.d.ts.map +0 -1
  160. package/build/dataloaders/findCountDataLoader.js +0 -74
  161. package/build/dataloaders/findCountDataLoader.js.map +0 -1
  162. package/build/dataloaders/findDataLoader.d.ts +0 -37
  163. package/build/dataloaders/findDataLoader.d.ts.map +0 -1
  164. package/build/dataloaders/findDataLoader.js +0 -337
  165. package/build/dataloaders/findDataLoader.js.map +0 -1
  166. package/build/dataloaders/findIdsDataLoader.d.ts +0 -7
  167. package/build/dataloaders/findIdsDataLoader.d.ts.map +0 -1
  168. package/build/dataloaders/findIdsDataLoader.js +0 -74
  169. package/build/dataloaders/findIdsDataLoader.js.map +0 -1
  170. package/build/dataloaders/findOrCreateDataLoader.d.ts +0 -13
  171. package/build/dataloaders/findOrCreateDataLoader.d.ts.map +0 -1
  172. package/build/dataloaders/findOrCreateDataLoader.js +0 -174
  173. package/build/dataloaders/findOrCreateDataLoader.js.map +0 -1
  174. package/build/dataloaders/lensDataLoader.d.ts +0 -12
  175. package/build/dataloaders/lensDataLoader.d.ts.map +0 -1
  176. package/build/dataloaders/lensDataLoader.js +0 -180
  177. package/build/dataloaders/lensDataLoader.js.map +0 -1
  178. package/build/dataloaders/loadDataLoader.d.ts +0 -11
  179. package/build/dataloaders/loadDataLoader.d.ts.map +0 -1
  180. package/build/dataloaders/loadDataLoader.js +0 -54
  181. package/build/dataloaders/loadDataLoader.js.map +0 -1
  182. package/build/dataloaders/manyToManyDataLoader.d.ts +0 -8
  183. package/build/dataloaders/manyToManyDataLoader.d.ts.map +0 -1
  184. package/build/dataloaders/manyToManyDataLoader.js +0 -74
  185. package/build/dataloaders/manyToManyDataLoader.js.map +0 -1
  186. package/build/dataloaders/manyToManyFindDataLoader.d.ts +0 -8
  187. package/build/dataloaders/manyToManyFindDataLoader.d.ts.map +0 -1
  188. package/build/dataloaders/manyToManyFindDataLoader.js +0 -70
  189. package/build/dataloaders/manyToManyFindDataLoader.js.map +0 -1
  190. package/build/dataloaders/oneToManyDataLoader.d.ts +0 -7
  191. package/build/dataloaders/oneToManyDataLoader.d.ts.map +0 -1
  192. package/build/dataloaders/oneToManyDataLoader.js +0 -60
  193. package/build/dataloaders/oneToManyDataLoader.js.map +0 -1
  194. package/build/dataloaders/oneToManyFindDataLoader.d.ts +0 -8
  195. package/build/dataloaders/oneToManyFindDataLoader.d.ts.map +0 -1
  196. package/build/dataloaders/oneToManyFindDataLoader.js +0 -71
  197. package/build/dataloaders/oneToManyFindDataLoader.js.map +0 -1
  198. package/build/dataloaders/oneToOneDataLoader.d.ts +0 -7
  199. package/build/dataloaders/oneToOneDataLoader.d.ts.map +0 -1
  200. package/build/dataloaders/oneToOneDataLoader.js +0 -59
  201. package/build/dataloaders/oneToOneDataLoader.js.map +0 -1
  202. package/build/dataloaders/populateDataLoader.d.ts +0 -13
  203. package/build/dataloaders/populateDataLoader.d.ts.map +0 -1
  204. package/build/dataloaders/populateDataLoader.js +0 -148
  205. package/build/dataloaders/populateDataLoader.js.map +0 -1
  206. package/build/dataloaders/recursiveChildrenDataLoader.d.ts +0 -7
  207. package/build/dataloaders/recursiveChildrenDataLoader.d.ts.map +0 -1
  208. package/build/dataloaders/recursiveChildrenDataLoader.js +0 -77
  209. package/build/dataloaders/recursiveChildrenDataLoader.js.map +0 -1
  210. package/build/dataloaders/recursiveParentsDataLoader.d.ts +0 -7
  211. package/build/dataloaders/recursiveParentsDataLoader.d.ts.map +0 -1
  212. package/build/dataloaders/recursiveParentsDataLoader.js +0 -59
  213. package/build/dataloaders/recursiveParentsDataLoader.js.map +0 -1
  214. package/build/defaults.d.ts +0 -54
  215. package/build/defaults.d.ts.map +0 -1
  216. package/build/defaults.js +0 -282
  217. package/build/defaults.js.map +0 -1
  218. package/build/driverApi.d.ts +0 -19
  219. package/build/driverApi.d.ts.map +0 -1
  220. package/build/driverApi.js +0 -17
  221. package/build/driverApi.js.map +0 -1
  222. package/build/drivers/Driver.d.ts +0 -26
  223. package/build/drivers/Driver.d.ts.map +0 -1
  224. package/build/drivers/Driver.js +0 -3
  225. package/build/drivers/Driver.js.map +0 -1
  226. package/build/drivers/EntityWriter.d.ts +0 -64
  227. package/build/drivers/EntityWriter.d.ts.map +0 -1
  228. package/build/drivers/EntityWriter.js +0 -237
  229. package/build/drivers/EntityWriter.js.map +0 -1
  230. package/build/drivers/IdAssigner.d.ts +0 -50
  231. package/build/drivers/IdAssigner.d.ts.map +0 -1
  232. package/build/drivers/IdAssigner.js +0 -133
  233. package/build/drivers/IdAssigner.js.map +0 -1
  234. package/build/drivers/PostgresDriver.d.ts.map +0 -1
  235. package/build/drivers/PostgresDriver.js.map +0 -1
  236. package/build/drivers/buildRawQuery.d.ts +0 -20
  237. package/build/drivers/buildRawQuery.d.ts.map +0 -1
  238. package/build/drivers/buildRawQuery.js +0 -148
  239. package/build/drivers/buildRawQuery.js.map +0 -1
  240. package/build/drivers/buildUtils.d.ts +0 -4
  241. package/build/drivers/buildUtils.d.ts.map +0 -1
  242. package/build/drivers/buildUtils.js +0 -79
  243. package/build/drivers/buildUtils.js.map +0 -1
  244. package/build/drivers/index.d.ts +0 -5
  245. package/build/drivers/index.d.ts.map +0 -1
  246. package/build/drivers/index.js.map +0 -1
  247. package/build/fields.d.ts +0 -24
  248. package/build/fields.d.ts.map +0 -1
  249. package/build/fields.js +0 -161
  250. package/build/fields.js.map +0 -1
  251. package/build/getProperties.d.ts +0 -28
  252. package/build/getProperties.d.ts.map +0 -1
  253. package/build/getProperties.js +0 -141
  254. package/build/getProperties.js.map +0 -1
  255. package/build/json.d.ts +0 -77
  256. package/build/json.d.ts.map +0 -1
  257. package/build/json.js +0 -116
  258. package/build/json.js.map +0 -1
  259. package/build/k.d.ts +0 -2
  260. package/build/k.d.ts.map +0 -1
  261. package/build/k.js +0 -9
  262. package/build/k.js.map +0 -1
  263. package/build/keys.d.ts +0 -49
  264. package/build/keys.d.ts.map +0 -1
  265. package/build/keys.js +0 -195
  266. package/build/keys.js.map +0 -1
  267. package/build/keywords.d.ts +0 -5
  268. package/build/keywords.d.ts.map +0 -1
  269. package/build/keywords.js +0 -124
  270. package/build/keywords.js.map +0 -1
  271. package/build/loadHints.d.ts +0 -112
  272. package/build/loadHints.d.ts.map +0 -1
  273. package/build/loadHints.js +0 -75
  274. package/build/loadHints.js.map +0 -1
  275. package/build/loadLens.d.ts +0 -66
  276. package/build/loadLens.d.ts.map +0 -1
  277. package/build/loadLens.js +0 -287
  278. package/build/loadLens.js.map +0 -1
  279. package/build/logging/FactoryLogger.d.ts +0 -24
  280. package/build/logging/FactoryLogger.d.ts.map +0 -1
  281. package/build/logging/FactoryLogger.js +0 -77
  282. package/build/logging/FactoryLogger.js.map +0 -1
  283. package/build/logging/FieldLogger.d.ts +0 -27
  284. package/build/logging/FieldLogger.d.ts.map +0 -1
  285. package/build/logging/FieldLogger.js +0 -69
  286. package/build/logging/FieldLogger.js.map +0 -1
  287. package/build/logging/ReactionLogger.d.ts +0 -23
  288. package/build/logging/ReactionLogger.d.ts.map +0 -1
  289. package/build/logging/ReactionLogger.js +0 -65
  290. package/build/logging/ReactionLogger.js.map +0 -1
  291. package/build/newEntity.d.ts +0 -45
  292. package/build/newEntity.d.ts.map +0 -1
  293. package/build/newEntity.js +0 -106
  294. package/build/newEntity.js.map +0 -1
  295. package/build/newTestInstance.d.ts +0 -193
  296. package/build/newTestInstance.d.ts.map +0 -1
  297. package/build/newTestInstance.js +0 -738
  298. package/build/newTestInstance.js.map +0 -1
  299. package/build/normalizeHints.d.ts +0 -16
  300. package/build/normalizeHints.d.ts.map +0 -1
  301. package/build/normalizeHints.js +0 -31
  302. package/build/normalizeHints.js.map +0 -1
  303. package/build/plugins/ImmutableEntitiesPlugin.d.ts +0 -9
  304. package/build/plugins/ImmutableEntitiesPlugin.d.ts.map +0 -1
  305. package/build/plugins/ImmutableEntitiesPlugin.js +0 -21
  306. package/build/plugins/ImmutableEntitiesPlugin.js.map +0 -1
  307. package/build/plugins/PreloadPlugin.d.ts +0 -69
  308. package/build/plugins/PreloadPlugin.d.ts.map +0 -1
  309. package/build/plugins/PreloadPlugin.js +0 -3
  310. package/build/plugins/PreloadPlugin.js.map +0 -1
  311. package/build/preloading/JsonAggregatePreloader.d.ts +0 -16
  312. package/build/preloading/JsonAggregatePreloader.d.ts.map +0 -1
  313. package/build/preloading/JsonAggregatePreloader.js +0 -238
  314. package/build/preloading/JsonAggregatePreloader.js.map +0 -1
  315. package/build/preloading/canPreload.d.ts +0 -3
  316. package/build/preloading/canPreload.d.ts.map +0 -1
  317. package/build/preloading/canPreload.js +0 -21
  318. package/build/preloading/canPreload.js.map +0 -1
  319. package/build/preloading/partitionHint.d.ts +0 -5
  320. package/build/preloading/partitionHint.d.ts.map +0 -1
  321. package/build/preloading/partitionHint.js +0 -56
  322. package/build/preloading/partitionHint.js.map +0 -1
  323. package/build/reactiveHints.d.ts +0 -129
  324. package/build/reactiveHints.d.ts.map +0 -1
  325. package/build/reactiveHints.js +0 -458
  326. package/build/reactiveHints.js.map +0 -1
  327. package/build/relations/AbstractPropertyImpl.d.ts +0 -8
  328. package/build/relations/AbstractPropertyImpl.d.ts.map +0 -1
  329. package/build/relations/AbstractPropertyImpl.js +0 -15
  330. package/build/relations/AbstractPropertyImpl.js.map +0 -1
  331. package/build/relations/AbstractRelationImpl.d.ts +0 -36
  332. package/build/relations/AbstractRelationImpl.d.ts.map +0 -1
  333. package/build/relations/AbstractRelationImpl.js +0 -19
  334. package/build/relations/AbstractRelationImpl.js.map +0 -1
  335. package/build/relations/Collection.d.ts +0 -28
  336. package/build/relations/Collection.d.ts.map +0 -1
  337. package/build/relations/Collection.js +0 -18
  338. package/build/relations/Collection.js.map +0 -1
  339. package/build/relations/CustomCollection.d.ts +0 -69
  340. package/build/relations/CustomCollection.d.ts.map +0 -1
  341. package/build/relations/CustomCollection.js +0 -166
  342. package/build/relations/CustomCollection.js.map +0 -1
  343. package/build/relations/CustomReference.d.ts +0 -71
  344. package/build/relations/CustomReference.d.ts.map +0 -1
  345. package/build/relations/CustomReference.js +0 -152
  346. package/build/relations/CustomReference.js.map +0 -1
  347. package/build/relations/LargeCollection.d.ts +0 -19
  348. package/build/relations/LargeCollection.d.ts.map +0 -1
  349. package/build/relations/LargeCollection.js +0 -3
  350. package/build/relations/LargeCollection.js.map +0 -1
  351. package/build/relations/ManyToManyCollection.d.ts +0 -44
  352. package/build/relations/ManyToManyCollection.d.ts.map +0 -1
  353. package/build/relations/ManyToManyCollection.js +0 -268
  354. package/build/relations/ManyToManyCollection.js.map +0 -1
  355. package/build/relations/ManyToManyLargeCollection.d.ts +0 -30
  356. package/build/relations/ManyToManyLargeCollection.d.ts.map +0 -1
  357. package/build/relations/ManyToManyLargeCollection.js +0 -119
  358. package/build/relations/ManyToManyLargeCollection.js.map +0 -1
  359. package/build/relations/ManyToOneReference.d.ts +0 -121
  360. package/build/relations/ManyToOneReference.d.ts.map +0 -1
  361. package/build/relations/ManyToOneReference.js +0 -389
  362. package/build/relations/ManyToOneReference.js.map +0 -1
  363. package/build/relations/OneToManyCollection.d.ts +0 -58
  364. package/build/relations/OneToManyCollection.d.ts.map +0 -1
  365. package/build/relations/OneToManyCollection.js +0 -347
  366. package/build/relations/OneToManyCollection.js.map +0 -1
  367. package/build/relations/OneToManyLargeCollection.d.ts +0 -26
  368. package/build/relations/OneToManyLargeCollection.d.ts.map +0 -1
  369. package/build/relations/OneToManyLargeCollection.js +0 -102
  370. package/build/relations/OneToManyLargeCollection.js.map +0 -1
  371. package/build/relations/OneToOneReference.d.ts +0 -93
  372. package/build/relations/OneToOneReference.d.ts.map +0 -1
  373. package/build/relations/OneToOneReference.js +0 -228
  374. package/build/relations/OneToOneReference.js.map +0 -1
  375. package/build/relations/PolymorphicReference.d.ts +0 -89
  376. package/build/relations/PolymorphicReference.d.ts.map +0 -1
  377. package/build/relations/PolymorphicReference.js +0 -244
  378. package/build/relations/PolymorphicReference.js.map +0 -1
  379. package/build/relations/ReactiveField.d.ts +0 -87
  380. package/build/relations/ReactiveField.d.ts.map +0 -1
  381. package/build/relations/ReactiveField.js +0 -149
  382. package/build/relations/ReactiveField.js.map +0 -1
  383. package/build/relations/ReactiveGetter.d.ts +0 -30
  384. package/build/relations/ReactiveGetter.d.ts.map +0 -1
  385. package/build/relations/ReactiveGetter.js +0 -38
  386. package/build/relations/ReactiveGetter.js.map +0 -1
  387. package/build/relations/ReactiveManyToMany.d.ts +0 -56
  388. package/build/relations/ReactiveManyToMany.d.ts.map +0 -1
  389. package/build/relations/ReactiveManyToMany.js +0 -243
  390. package/build/relations/ReactiveManyToMany.js.map +0 -1
  391. package/build/relations/ReactiveManyToManyOtherSide.d.ts +0 -47
  392. package/build/relations/ReactiveManyToManyOtherSide.d.ts.map +0 -1
  393. package/build/relations/ReactiveManyToManyOtherSide.js +0 -155
  394. package/build/relations/ReactiveManyToManyOtherSide.js.map +0 -1
  395. package/build/relations/ReactiveQueryField.d.ts +0 -41
  396. package/build/relations/ReactiveQueryField.d.ts.map +0 -1
  397. package/build/relations/ReactiveQueryField.js +0 -125
  398. package/build/relations/ReactiveQueryField.js.map +0 -1
  399. package/build/relations/ReactiveReference.d.ts +0 -119
  400. package/build/relations/ReactiveReference.d.ts.map +0 -1
  401. package/build/relations/ReactiveReference.js +0 -333
  402. package/build/relations/ReactiveReference.js.map +0 -1
  403. package/build/relations/ReadOnlyCollection.d.ts +0 -19
  404. package/build/relations/ReadOnlyCollection.d.ts.map +0 -1
  405. package/build/relations/ReadOnlyCollection.js +0 -15
  406. package/build/relations/ReadOnlyCollection.js.map +0 -1
  407. package/build/relations/RecursiveCollection.d.ts +0 -84
  408. package/build/relations/RecursiveCollection.d.ts.map +0 -1
  409. package/build/relations/RecursiveCollection.js +0 -296
  410. package/build/relations/RecursiveCollection.js.map +0 -1
  411. package/build/relations/Reference.d.ts +0 -35
  412. package/build/relations/Reference.d.ts.map +0 -1
  413. package/build/relations/Reference.js +0 -21
  414. package/build/relations/Reference.js.map +0 -1
  415. package/build/relations/Relation.d.ts +0 -14
  416. package/build/relations/Relation.d.ts.map +0 -1
  417. package/build/relations/Relation.js +0 -12
  418. package/build/relations/Relation.js.map +0 -1
  419. package/build/relations/hasAsyncMethod.d.ts +0 -27
  420. package/build/relations/hasAsyncMethod.d.ts.map +0 -1
  421. package/build/relations/hasAsyncMethod.js +0 -47
  422. package/build/relations/hasAsyncMethod.js.map +0 -1
  423. package/build/relations/hasAsyncProperty.d.ts +0 -49
  424. package/build/relations/hasAsyncProperty.d.ts.map +0 -1
  425. package/build/relations/hasAsyncProperty.js +0 -98
  426. package/build/relations/hasAsyncProperty.js.map +0 -1
  427. package/build/relations/hasManyDerived.d.ts +0 -22
  428. package/build/relations/hasManyDerived.d.ts.map +0 -1
  429. package/build/relations/hasManyDerived.js +0 -32
  430. package/build/relations/hasManyDerived.js.map +0 -1
  431. package/build/relations/hasManyThrough.d.ts +0 -10
  432. package/build/relations/hasManyThrough.d.ts.map +0 -1
  433. package/build/relations/hasManyThrough.js +0 -24
  434. package/build/relations/hasManyThrough.js.map +0 -1
  435. package/build/relations/hasOneDerived.d.ts +0 -12
  436. package/build/relations/hasOneDerived.d.ts.map +0 -1
  437. package/build/relations/hasOneDerived.js +0 -24
  438. package/build/relations/hasOneDerived.js.map +0 -1
  439. package/build/relations/hasOneThrough.d.ts +0 -10
  440. package/build/relations/hasOneThrough.d.ts.map +0 -1
  441. package/build/relations/hasOneThrough.js +0 -24
  442. package/build/relations/hasOneThrough.js.map +0 -1
  443. package/build/relations/index.d.ts +0 -28
  444. package/build/relations/index.d.ts.map +0 -1
  445. package/build/relations/index.js +0 -88
  446. package/build/relations/index.js.map +0 -1
  447. package/build/rules.d.ts +0 -123
  448. package/build/rules.d.ts.map +0 -1
  449. package/build/rules.js +0 -231
  450. package/build/rules.js.map +0 -1
  451. package/build/runtimeConfig.d.ts +0 -17
  452. package/build/runtimeConfig.d.ts.map +0 -1
  453. package/build/runtimeConfig.js +0 -18
  454. package/build/runtimeConfig.js.map +0 -1
  455. package/build/serde.d.ts +0 -277
  456. package/build/serde.d.ts.map +0 -1
  457. package/build/serde.js +0 -517
  458. package/build/serde.js.map +0 -1
  459. package/build/temporal.d.ts +0 -16
  460. package/build/temporal.d.ts.map +0 -1
  461. package/build/temporal.js +0 -48
  462. package/build/temporal.js.map +0 -1
  463. package/build/temporalMappers.d.ts +0 -25
  464. package/build/temporalMappers.d.ts.map +0 -1
  465. package/build/temporalMappers.js +0 -59
  466. package/build/temporalMappers.js.map +0 -1
  467. package/build/typeMap.d.ts +0 -68
  468. package/build/typeMap.d.ts.map +0 -1
  469. package/build/typeMap.js +0 -3
  470. package/build/typeMap.js.map +0 -1
  471. package/build/unnest.d.ts +0 -13
  472. package/build/unnest.d.ts.map +0 -1
  473. package/build/unnest.js +0 -85
  474. package/build/unnest.js.map +0 -1
  475. package/build/upsert.d.ts +0 -42
  476. package/build/upsert.d.ts.map +0 -1
  477. package/build/upsert.js +0 -265
  478. package/build/upsert.js.map +0 -1
  479. package/build/utils.d.ts +0 -58
  480. package/build/utils.d.ts.map +0 -1
  481. package/build/utils.js +0 -236
  482. package/build/utils.js.map +0 -1
  483. package/build/withLoaded.d.ts +0 -56
  484. package/build/withLoaded.d.ts.map +0 -1
  485. package/build/withLoaded.js +0 -76
  486. package/build/withLoaded.js.map +0 -1
@@ -1,98 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AsyncPropertyImpl = exports.AsyncPropertyT = void 0;
4
- exports.hasAsyncProperty = hasAsyncProperty;
5
- exports.hasReactiveAsyncProperty = hasReactiveAsyncProperty;
6
- exports.isAsyncProperty = isAsyncProperty;
7
- exports.isLoadedAsyncProperty = isLoadedAsyncProperty;
8
- const EntityMetadata_1 = require("../EntityMetadata");
9
- const loadHints_1 = require("../loadHints");
10
- const newEntity_1 = require("../newEntity");
11
- const reactiveHints_1 = require("../reactiveHints");
12
- const utils_1 = require("../utils");
13
- exports.AsyncPropertyT = Symbol();
14
- /**
15
- * Creates a calculated derived value from a load hint + lambda.
16
- *
17
- * The property can be accessed by default as a promise, with `someProperty.load()`.
18
- *
19
- * But if `someProperty` is used as a populate hint, then it can be accessed synchronously,
20
- * with `someProperty.get`.
21
- */
22
- function hasAsyncProperty(loadHint, fn) {
23
- return (0, newEntity_1.lazyField)((entity) => {
24
- return new AsyncPropertyImpl(entity, loadHint, fn);
25
- });
26
- }
27
- /**
28
- * Creates a calculated derived value from a load hint + lambda.
29
- *
30
- * The property can be accessed by default as a promise, with `someProperty.load()`.
31
- *
32
- * But if `someProperty` is used as a populate hint, then it can be accessed synchronously,
33
- * with `someProperty.get`.
34
- */
35
- function hasReactiveAsyncProperty(reactiveHint, fn) {
36
- return (0, newEntity_1.lazyField)((entity) => {
37
- return new AsyncPropertyImpl(entity, reactiveHint, fn, { isReactive: true });
38
- });
39
- }
40
- class AsyncPropertyImpl {
41
- fn;
42
- opts;
43
- // We'll probe for loaded if undefined
44
- #loaded = undefined;
45
- #loadPromise;
46
- #entity;
47
- #hint;
48
- #reactiveHint;
49
- constructor(entity, hint, fn, opts = {}) {
50
- this.fn = fn;
51
- this.opts = opts;
52
- const { isReactive = false } = opts;
53
- this.#entity = entity;
54
- this.#hint = isReactive ? undefined : hint;
55
- this.#reactiveHint = isReactive ? hint : undefined;
56
- }
57
- load() {
58
- if (!this.isLoaded) {
59
- const { loadHint, fn } = this;
60
- return (this.#loadPromise ??= this.#entity.em.populate(this.#entity, loadHint).then((loaded) => {
61
- this.#loaded = true;
62
- return fn(loaded);
63
- }));
64
- }
65
- return (0, utils_1.tryResolve)(() => this.get);
66
- }
67
- get loadHint() {
68
- if (!this.#hint) {
69
- // Would be nice to statically (but lazily?) cache this...
70
- this.#hint = (0, reactiveHints_1.convertToLoadHint)((0, EntityMetadata_1.getMetadata)(this.#entity), this.#reactiveHint);
71
- }
72
- return this.#hint;
73
- }
74
- get reactiveHint() {
75
- return this.#reactiveHint;
76
- }
77
- get get() {
78
- return this.fn(this.#entity);
79
- }
80
- get isLoaded() {
81
- // Probe the first time, which is useful for factories that are DeepNew
82
- if (this.#loaded === undefined) {
83
- this.#loaded = (0, loadHints_1.isLoaded)(this.#entity, this.loadHint);
84
- }
85
- return !!this.#loaded;
86
- }
87
- [exports.AsyncPropertyT] = undefined;
88
- }
89
- exports.AsyncPropertyImpl = AsyncPropertyImpl;
90
- /** Type guard utility for determining if an entity field is an AsyncProperty. */
91
- function isAsyncProperty(maybeAsyncProperty) {
92
- return maybeAsyncProperty instanceof AsyncPropertyImpl;
93
- }
94
- /** Type guard utility for determining if an entity field is a loaded AsyncProperty. */
95
- function isLoadedAsyncProperty(maybeAsyncProperty) {
96
- return isAsyncProperty(maybeAsyncProperty) && maybeAsyncProperty.isLoaded;
97
- }
98
- //# sourceMappingURL=hasAsyncProperty.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hasAsyncProperty.js","sourceRoot":"","sources":["../../src/relations/hasAsyncProperty.ts"],"names":[],"mappings":";;;AA4BA,4CAOC;AAUD,4DAOC;AA6DD,0CAEC;AAGD,sDAIC;AAzHD,sDAAgD;AAChD,4CAA0D;AAC1D,4CAAyC;AACzC,oDAAwG;AACxG,oCAAsC;AAEzB,QAAA,cAAc,GAAG,MAAM,EAAE,CAAC;AAavC;;;;;;;GAOG;AACH,SAAgB,gBAAgB,CAC9B,QAAW,EACX,EAA+B;IAE/B,OAAO,IAAA,qBAAS,EAAC,CAAC,MAAS,EAAE,EAAE;QAC7B,OAAO,IAAI,iBAAiB,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,wBAAwB,CACtC,YAAe,EACf,EAA4D;IAE5D,OAAO,IAAA,qBAAS,EAAC,CAAC,MAAS,EAAE,EAAE;QAC7B,OAAO,IAAI,iBAAiB,CAAC,MAAM,EAAE,YAAmB,EAAE,EAAS,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7F,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAa,iBAAiB;IAWlB;IACA;IAXV,sCAAsC;IACtC,OAAO,GAAwB,SAAS,CAAC;IACzC,YAAY,CAAM;IAET,OAAO,CAAI;IACpB,KAAK,CAAgB;IACrB,aAAa,CAA8B;IAC3C,YACE,MAAS,EACT,IAAyB,EACjB,EAA+B,EAC/B,OAAiC,EAAE;QADnC,OAAE,GAAF,EAAE,CAA6B;QAC/B,SAAI,GAAJ,IAAI,CAA+B;QAE3C,MAAM,EAAE,UAAU,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC;QACpC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,KAAK,G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AAA,oBAAQ,EAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvD,CAAC;QACD,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,CAAC,sBAAc,CAAC,GAAG,SAAqB,CAAC;CAC1C;AAxDD,8CAwDC;AAED,iFAAiF;AACjF,SAAgB,eAAe,CAAC,kBAAuB;IACrD,OAAO,kBAAkB,YAAY,iBAAiB,CAAC;AACzD,CAAC;AAED,uFAAuF;AACvF,SAAgB,qBAAqB,CACnC,kBAAuB;IAEvB,OAAO,eAAe,CAAC,kBAAkB,CAAC,IAAI,kBAAkB,CAAC,QAAQ,CAAC;AAC5E,CAAC"}
@@ -1,22 +0,0 @@
1
- import { Collection } from "../";
2
- import { Entity } from "../Entity";
3
- import { LoadHint, Loaded } from "../loadHints";
4
- type HasManyDerivedOpts<T extends Entity, U extends Entity, H extends LoadHint<T>> = {
5
- load?: (entity: T, opts: {
6
- forceReload?: boolean;
7
- }) => Promise<any>;
8
- get: (entity: Loaded<T, H>) => readonly U[];
9
- set?: (entity: Loaded<T, H>, values: U[]) => void;
10
- add?: (entity: Loaded<T, H>, value: U) => void;
11
- remove?: (entity: Loaded<T, H>, value: U) => void;
12
- };
13
- /**
14
- * Creates a CustomCollection that can conditionally walk across references in the object graph.
15
- *
16
- * I.e. An Author "has many reviews" through the `author -> books -> reviews` relation.
17
- *
18
- * Because this is based on `CustomCollection`, it will work in populates, i.e. `em.populate(author, "reviews")`.
19
- */
20
- export declare function hasManyDerived<T extends Entity, U extends Entity, H extends LoadHint<T>>(loadHint: H, opts: HasManyDerivedOpts<T, U, H>): Collection<T, U>;
21
- export {};
22
- //# sourceMappingURL=hasManyDerived.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hasManyDerived.d.ts","sourceRoot":"","sources":["../../src/relations/hasManyDerived.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAY,MAAM,KAAK,C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__1 = require("../");
5
- const newEntity_1 = require("../newEntity");
6
- const CustomCollection_1 = require("./CustomCollection");
7
- /**
8
- * Creates a CustomCollection that can conditionally walk across references in the object graph.
9
- *
10
- * I.e. An Author "has many reviews" through the `author -> books -> reviews` relation.
11
- *
12
- * Because this is based on `CustomCollection`, it will work in populates, i.e. `em.populate(author, "reviews")`.
13
- */
14
- function hasManyDerived(loadHint, opts) {
15
- const { load, ...rest } = opts;
16
- return (0, newEntity_1.lazyField)((entity) => {
17
- return new CustomCollection_1.CustomCollection(entity, {
18
- load(entity, opts) {
19
- if (load) {
20
- return load(entity, opts);
21
- }
22
- else {
23
- return entity.em.populate(entity, { hint: loadHint, ...opts });
24
- }
25
- },
26
- isLoaded: () => (0, __1.isLoaded)(entity, loadHint),
27
- loadHint,
28
- ...rest,
29
- });
30
- });
31
- }
32
- //# sourceMappingURL=hasManyDerived.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hasManyDerived.js","sourceRoot":"","sources":["../../src/relations/hasManyDerived.ts"],"names":[],"mappings":";;AAqBA,wCAmBC;AAxCD,2BAA2C;AAG3C,4CAAyC;AACzC,yDAAsD;AAUtD;;;;;;GAMG;AACH,SAAgB,cAAc,CAC5B,QAAW,EACX,IAAiC;IAEjC,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;IAC/B,OAAO,IAAA,qBAAS,EAAC,CAAC,MAAS,EAAE,EAAE;QAC7B,OAAO,IAAI,mCAAgB,CAAO,MAAM,EAAE;YACxC,IAAI,CAAC,MAAM,EAAE,IAAI;gBACf,IAAI,IAAI,EAAE,CAAC;oBACT,OAAO,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;gBAC5B,CAAC;qBAAM,CAAC;oBACN,OAAO,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;gBACjE,CAAC;YACH,CAAC;YACD,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAA,YAAQ,EAAC,MAAM,EAAE,QAAQ,CAAC;YAC1C,QAAQ;YACR,GAAI,IAAY;SACjB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,10 +0,0 @@
1
- import { Collection, Entity, Lens } from "../index";
2
- /**
3
- * Creates a CustomCollection that will walk across references in the object graph.
4
- *
5
- * I.e. An Author "has many reviews" through the `author -> books -> reviews` relation.
6
- *
7
- * Because this is based on `CustomCollection`, it will work in populates, i.e. `em.populate(author, "reviews")`.
8
- */
9
- export declare function hasManyThrough<T extends Entity, U extends Entity>(lens: (lens: Lens<T>) => Lens<U, U[]>): Collection<T, U>;
10
- //# sourceMappingURL=hasManyThrough.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hasManyThrough.d.ts","sourceRoot":"","sources":["../../src/relations/hasManyThrough.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAEV,MAAM,EAIN,IAAI,EAGL,MAAM,UAAU,CAAC;AAGlB;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,EAC/D,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GACpC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAUlB"}
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hasManyThrough = hasManyThrough;
4
- const index_1 = require("../index");
5
- const newEntity_1 = require("../newEntity");
6
- /**
7
- * Creates a CustomCollection that will walk across references in the object graph.
8
- *
9
- * I.e. An Author "has many reviews" through the `author -> books -> reviews` relation.
10
- *
11
- * Because this is based on `CustomCollection`, it will work in populates, i.e. `em.populate(author, "reviews")`.
12
- */
13
- function hasManyThrough(lens) {
14
- return (0, newEntity_1.lazyField)((entity) => {
15
- const meta = (0, index_1.getMetadata)(entity);
16
- return new index_1.CustomCollection(entity, {
17
- load: (entity, opts) => (0, index_1.loadLens)(entity, lens, opts),
18
- get: () => (0, index_1.getLens)(meta, entity, lens),
19
- isLoaded: () => (0, index_1.isLensLoaded)(entity, lens),
20
- loadHint: () => (0, index_1.lensToLoadHint)(lens),
21
- });
22
- });
23
- }
24
- //# sourceMappingURL=hasManyThrough.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hasManyThrough.js","sourceRoot":"","sources":["../../src/relations/hasManyThrough.ts"],"names":[],"mappings":";;AAoBA,wCAYC;AAhCD,oCAUkB;AAClB,4CAAyC;AAEzC;;;;;;GAMG;AACH,SAAgB,cAAc,CAC5B,IAAqC;IAErC,OAAO,IAAA,qBAAS,EAAC,CAAC,MAAS,EAAE,EAAE;QAC7B,MAAM,IAAI,GAAG,IAAA,mBAAW,EAAC,MAAM,CAAC,CAAC;QACjC,OAAO,IAAI,wBAAgB,CAAO,MAAM,EAAE;YACxC,IAAI,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,IAAA,gBAAQ,EAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC;YACpD,GAAG,EAAE,GAAG,EAAE,CAAC,IAAA,eAAO,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC;YACtC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAA,oBAAY,EAAC,MAAM,EAAE,IAAI,CAAC;YAC1C,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAA,sBAAc,EAAC,IAAI,CAAC;SACrC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,12 +0,0 @@
1
- import { Entity } from "../Entity";
2
- import { LoadHint, Loaded } from "../loadHints";
3
- import { Reference } from "./Reference";
4
- /**
5
- * Creates a CustomReference that can conditionally walk across references in the object graph.
6
- *
7
- * I.e. A BookReview "has one author" through the `review -> book -> author` relation.
8
- *
9
- * Because this is based on `CustomReference`, it will work in populates, i.e. `em.populate(review, "author")`.
10
- */
11
- export declare function hasOneDerived<T extends Entity, U extends Entity, N extends never | undefined, V extends U | N, const H extends LoadHint<T>>(loadHint: H, get: (entity: Loaded<T, H>) => V): Reference<T, U, N>;
12
- //# sourceMappingURL=hasOneDerived.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hasOneDerived.d.ts","sourceRoot":"","sources":["../../src/relations/hasOneDerived.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,CAAC,SAAS,MAAM,EAChB,CAAC,SAAS,MAAM,EAChB,CAAC,SAAS,KAAK,GAAG,SAAS,EAC3B,CAAC,SAAS,CAAC,GAAG,CAAC,EACf,KAAK,CAAC,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,EAC3B,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CASnE"}
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hasOneDerived = hasOneDerived;
4
- const __1 = require("../");
5
- const newEntity_1 = require("../newEntity");
6
- const CustomReference_1 = require("./CustomReference");
7
- /**
8
- * Creates a CustomReference that can conditionally walk across references in the object graph.
9
- *
10
- * I.e. A BookReview "has one author" through the `review -> book -> author` relation.
11
- *
12
- * Because this is based on `CustomReference`, it will work in populates, i.e. `em.populate(review, "author")`.
13
- */
14
- function hasOneDerived(loadHint, get) {
15
- return (0, newEntity_1.lazyField)((entity) => {
16
- return new CustomReference_1.CustomReference(entity, {
17
- load: (entity, opts) => entity.em.populate(entity, { hint: loadHint, ...opts }),
18
- get: () => get(entity),
19
- isLoaded: () => (0, __1.isLoaded)(entity, loadHint),
20
- loadHint,
21
- });
22
- });
23
- }
24
- //# sourceMappingURL=hasOneDerived.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hasOneDerived.js","sourceRoot":"","sources":["../../src/relations/hasOneDerived.ts"],"names":[],"mappings":";;AAcA,sCAeC;AA7BD,2BAA+B;AAG/B,4CAAyC;AACzC,uDAAoD;AAGpD;;;;;;GAMG;AACH,SAAgB,aAAa,CAM3B,QAAW,EAAE,GAAgC;IAC7C,OAAO,IAAA,qBAAS,EAAC,CAAC,MAAS,EAAE,EAAE;QAC7B,OAAO,IAAI,iCAAe,CAAU,MAAM,EAAE;YAC1C,IAAI,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,CAAC;YAC/E,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAsB,CAAC;YACtC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAA,YAAQ,EAAC,MAAM,EAAE,QAAuB,CAAC;YACzD,QAAQ;SACT,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,10 +0,0 @@
1
- import { Entity, Lens, Reference } from "../index";
2
- /**
3
- * Creates a CustomReference that will walk across references in the object graph.
4
- *
5
- * I.e. A BookReview "has one author" through the `review -> book -> author` relation.
6
- *
7
- * Because this is based on `CustomReference`, it will work in populates, i.e. `em.populate(review, "author")`.
8
- */
9
- export declare function hasOneThrough<T extends Entity, U extends Entity, N extends never | undefined, V extends U | N>(lens: (lens: Lens<T>) => Lens<V>): Reference<T, U, N>;
10
- //# sourceMappingURL=hasOneThrough.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hasOneThrough.d.ts","sourceRoot":"","sources":["../../src/relations/hasOneThrough.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAIN,IAAI,EAGJ,SAAS,EACV,MAAM,UAAU,CAAC;AAGlB;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,KAAK,GAAG,SAAS,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,EAC5G,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,GAC/B,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAUpB"}
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hasOneThrough = hasOneThrough;
4
- const index_1 = require("../index");
5
- const newEntity_1 = require("../newEntity");
6
- /**
7
- * Creates a CustomReference that will walk across references in the object graph.
8
- *
9
- * I.e. A BookReview "has one author" through the `review -> book -> author` relation.
10
- *
11
- * Because this is based on `CustomReference`, it will work in populates, i.e. `em.populate(review, "author")`.
12
- */
13
- function hasOneThrough(lens) {
14
- return (0, newEntity_1.lazyField)((entity) => {
15
- const meta = (0, index_1.getMetadata)(entity);
16
- return new index_1.CustomReference(entity, {
17
- load: (entity, opts) => (0, index_1.loadLens)(entity, lens, opts),
18
- get: () => (0, index_1.getLens)(meta, entity, lens),
19
- isLoaded: () => (0, index_1.isLensLoaded)(entity, lens),
20
- loadHint: () => (0, index_1.lensToLoadHint)(lens),
21
- });
22
- });
23
- }
24
- //# sourceMappingURL=hasOneThrough.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hasOneThrough.js","sourceRoot":"","sources":["../../src/relations/hasOneThrough.ts"],"names":[],"mappings":";;AAoBA,sCAYC;AAhCD,oCAUkB;AAClB,4CAAyC;AAEzC;;;;;;GAMG;AACH,SAAgB,aAAa,CAC3B,IAAgC;IAEhC,OAAO,IAAA,qBAAS,EAAC,CAAC,MAAS,EAAE,EAAE;QAC7B,MAAM,IAAI,GAAG,IAAA,mBAAW,EAAC,MAAM,CAAC,CAAC;QACjC,OAAO,IAAI,uBAAe,CAAU,MAAM,EAAE;YAC1C,IAAI,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,IAAA,gBAAQ,EAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC;YACpD,GAAG,EAAE,GAAG,EAAE,CAAC,IAAA,eAAO,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC;YACtC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAA,oBAAY,EAAC,MAAM,EAAE,IAAI,CAAC;YAC1C,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAA,sBAAc,EAAC,IAAI,CAAC;SACrC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,28 +0,0 @@
1
- export { Collection, LoadedCollection, isCollection, isLoadedCollection } from "./Collection";
2
- export { CustomCollection, hasCustomCollection } from "./CustomCollection";
3
- export { CustomReference, hasCustomReference } from "./CustomReference";
4
- export { AsyncMethod, LoadedMethod, hasAsyncMethod } from "./hasAsyncMethod";
5
- export { AsyncProperty, AsyncPropertyImpl, LoadedProperty, hasAsyncProperty, hasReactiveAsyncProperty, isAsyncProperty, isLoadedAsyncProperty, } from "./hasAsyncProperty";
6
- export { hasManyDerived } from "./hasManyDerived";
7
- export { hasManyThrough } from "./hasManyThrough";
8
- export { hasOneDerived } from "./hasOneDerived";
9
- export { hasOneThrough } from "./hasOneThrough";
10
- export { LargeCollection } from "./LargeCollection";
11
- export { ManyToManyCollection, hasManyToMany } from "./ManyToManyCollection";
12
- export { ManyToManyLargeCollection, hasLargeManyToMany } from "./ManyToManyLargeCollection";
13
- export { ManyToOneReference, ManyToOneReferenceImpl, hasOne, isManyToOneReference } from "./ManyToOneReference";
14
- export { OneToManyCollection, hasMany } from "./OneToManyCollection";
15
- export { OneToManyLargeCollection, hasLargeMany } from "./OneToManyLargeCollection";
16
- export { OneToOneReference, OneToOneReferenceImpl, hasOneToOne, isLoadedOneToOneReference, isOneToOneReference, } from "./OneToOneReference";
17
- export { PolymorphicReference, PolymorphicReferenceImpl, hasOnePolymorphic, isPolymorphicReference, } from "./PolymorphicReference";
18
- export { ReactiveField, hasReactiveField, isReactiveField } from "./ReactiveField";
19
- export { ReactiveGetter, hasReactiveGetter, isReactiveGetter } from "./ReactiveGetter";
20
- export { hasReactiveQueryField, isReactiveQueryField } from "./ReactiveQueryField";
21
- export { ReactiveReference, ReactiveReferenceImpl, hasReactiveReference, isReactiveReference, } from "./ReactiveReference";
22
- export { ReactiveManyToMany, ReactiveManyToManyImpl, hasReactiveManyToMany, isReactiveManyToMany, } from "./ReactiveManyToMany";
23
- export { ReactiveManyToManyOtherSide, ReactiveManyToManyOtherSideImpl, hasReactiveManyToManyOtherSide, isReactiveManyToManyOtherSide, } from "./ReactiveManyToManyOtherSide";
24
- export { LoadedReadOnlyCollection, ReadOnlyCollection, isLoadedReadOnlyCollection, isReadOnlyCollection, } from "./ReadOnlyCollection";
25
- export { RecursiveCycleError, hasRecursiveChildren, hasRecursiveParents } from "./RecursiveCollection";
26
- export { LoadedReference, Reference, isLoadedReference, isReference } from "./Reference";
27
- export { Relation, isRelation } from "./Relation";
28
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/relations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC9F,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,cA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AqB,EACrB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,2BAA2B,EAC3B,+BAA+B,EAC/B,8BAA8B,EAC9B,6BAA6B,GAC9B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvG,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACzF,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC"}
@@ -1,88 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isLoadedReadOnlyCollection = exports.isReactiveManyToManyOtherSide = exports.hasReactiveManyToManyOtherSide = exports.ReactiveManyToManyOtherSideImpl = exports.isReactiveManyToMany = exports.hasReactiveManyToMany = exports.ReactiveManyToManyImpl = exports.isReactiveReference = exports.hasReactiveReference = exports.ReactiveReferenceImpl = exports.isReactiveQueryField = exports.hasReactiveQueryField = exports.isReactiveGetter = exports.hasReactiveGetter = exports.isReactiveField = exports.hasReactiveField = exports.isPolymorphicReference = exports.hasOnePolymorphic = exports.PolymorphicReferenceImpl = exports.isOneToOneReference = exports.isLoadedOneToOneReference = exports.hasOneToOne = exports.OneToOneReferenceImpl = exports.hasLargeMany = exports.OneToManyLargeCollection = exports.hasMany = exports.OneToManyCollection = exports.isManyToOneReference = exports.hasOne = exports.ManyToOneReferenceImpl = exports.hasLargeManyToMany = exports.ManyToManyLargeCollection = exports.hasManyToMany = exports.ManyToManyCollection = exports.hasOneThrough = exports.hasOneDerived = exports.hasManyThrough = exports.hasManyDerived = exports.isLoadedAsyncProperty = exports.isAsyncProperty = exports.hasReactiveAsyncProperty = exports.hasAsyncProperty = exports.AsyncPropertyImpl = exports.hasAsyncMethod = exports.hasCustomReference = exports.CustomReference = exports.hasCustomCollection = exports.CustomCollection = exports.isLoadedCollection = exports.isCollection = void 0;
4
- exports.isRelation = exports.isReference = exports.isLoadedReference = exports.hasRecursiveParents = exports.hasRecursiveChildren = exports.RecursiveCycleError = exports.isReadOnlyCollection = void 0;
5
- var Collection_1 = require("./Collection");
6
- Object.defineProperty(exports, "isCollection", { enumerable: true, get: function () { return Collection_1.isCollection; } });
7
- Object.defineProperty(exports, "isLoadedCollection", { enumerable: true, get: function () { return Collection_1.isLoadedCollection; } });
8
- var CustomCollection_1 = require("./CustomCollection");
9
- Object.defineProperty(exports, "CustomCollection", { enumerable: true, get: function () { return CustomCollection_1.CustomCollection; } });
10
- Object.defineProperty(exports, "hasCustomCollection", { enumerable: true, get: function () { return CustomCollection_1.hasCustomCollection; } });
11
- var CustomReference_1 = require("./CustomReference");
12
- Object.defineProperty(exports, "CustomReference", { enumerable: true, get: function () { return CustomReference_1.CustomReference; } });
13
- Object.defineProperty(exports, "hasCustomReference", { enumerable: true, get: function () { return CustomReference_1.hasCustomReference; } });
14
- var hasAsyncMethod_1 = require("./hasAsyncMethod");
15
- Object.defineProperty(exports, "hasAsyncMethod", { enumerable: true, get: function () { return hasAsyncMethod_1.hasAsyncMethod; } });
16
- var hasAsyncProperty_1 = require("./hasAsyncProperty");
17
- Object.defineProperty(exports, "AsyncPropertyImpl", { enumerable: true, get: function () { return hasAsyncProperty_1.AsyncPropertyImpl; } });
18
- Object.defineProperty(exports, "hasAsyncProperty", { enumerable: true, get: function () { return hasAsyncProperty_1.hasAsyncProperty; } });
19
- Object.defineProperty(exports, "hasReactiveAsyncProperty", { enumerable: true, get: function () { return hasAsyncProperty_1.hasReactiveAsyncProperty; } });
20
- Object.defineProperty(exports, "isAsyncProperty", { enumerable: true, get: function () { return hasAsyncProperty_1.isAsyncProperty; } });
21
- Object.defineProperty(exports, "isLoadedAsyncProperty", { enumerable: true, get: function () { return hasAsyncProperty_1.isLoadedAsyncProperty; } });
22
- var hasManyDerived_1 = require("./hasManyDerived");
23
- Object.defineProperty(exports, "hasManyDerived", { enumerable: true, get: function () { return hasManyDerived_1.hasManyDerived; } });
24
- var hasManyThrough_1 = require("./hasManyThrough");
25
- Object.defineProperty(exports, "hasManyThrough", { enumerable: true, get: function () { return hasManyThrough_1.hasManyThrough; } });
26
- var hasOneDerived_1 = require("./hasOneDerived");
27
- Object.defineProperty(exports, "hasOneDerived", { enumerable: true, get: function () { return hasOneDerived_1.hasOneDerived; } });
28
- var hasOneThrough_1 = require("./hasOneThrough");
29
- Object.defineProperty(exports, "hasOneThrough", { enumerable: true, get: function () { return hasOneThrough_1.hasOneThrough; } });
30
- var ManyToManyCollection_1 = require("./ManyToManyCollection");
31
- Object.defineProperty(exports, "ManyToManyCollection", { enumerable: true, get: function () { return ManyToManyCollection_1.ManyToManyCollection; } });
32
- Object.defineProperty(exports, "hasManyToMany", { enumerable: true, get: function () { return ManyToManyCollection_1.hasManyToMany; } });
33
- var ManyToManyLargeCollection_1 = require("./ManyToManyLargeCollection");
34
- Object.defineProperty(exports, "ManyToManyLargeCollection", { enumerable: true, get: function () { return ManyToManyLargeCollection_1.ManyToManyLargeCollection; } });
35
- Object.defineProperty(exports, "hasLargeManyToMany", { enumerable: true, get: function () { return ManyToManyLargeCollection_1.hasLargeManyToMany; } });
36
- var ManyToOneReference_1 = require("./ManyToOneReference");
37
- Object.defineProperty(exports, "ManyToOneReferenceImpl", { enumerable: true, get: function () { return ManyToOneReference_1.ManyToOneReferenceImpl; } });
38
- Object.defineProperty(exports, "hasOne", { enumerable: true, get: function () { return ManyToOneReference_1.hasOne; } });
39
- Object.defineProperty(exports, "isManyToOneReference", { enumerable: true, get: function () { return ManyToOneReference_1.isManyToOneReference; } });
40
- var OneToManyCollection_1 = require("./OneToManyCollection");
41
- Object.defineProperty(exports, "OneToManyCollection", { enumerable: true, get: function () { return OneToManyCollection_1.OneToManyCollection; } });
42
- Object.defineProperty(exports, "hasMany", { enumerable: true, get: function () { return OneToManyCollection_1.hasMany; } });
43
- var OneToManyLargeCollection_1 = require("./OneToManyLargeCollection");
44
- Object.defineProperty(exports, "OneToManyLargeCollection", { enumerable: true, get: function () { return OneToManyLargeCollection_1.OneToManyLargeCollection; } });
45
- Object.defineProperty(exports, "hasLargeMany", { enumerable: true, get: function () { return OneToManyLargeCollection_1.hasLargeMany; } });
46
- var OneToOneReference_1 = require("./OneToOneReference");
47
- Object.defineProperty(exports, "OneToOneReferenceImpl", { enumerable: true, get: function () { return OneToOneReference_1.OneToOneReferenceImpl; } });
48
- Object.defineProperty(exports, "hasOneToOne", { enumerable: true, get: function () { return OneToOneReference_1.hasOneToOne; } });
49
- Object.defineProperty(exports, "isLoadedOneToOneReference", { enumerable: true, get: function () { return OneToOneReference_1.isLoadedOneToOneReference; } });
50
- Object.defineProperty(exports, "isOneToOneReference", { enumerable: true, get: function () { return OneToOneReference_1.isOneToOneReference; } });
51
- var PolymorphicReference_1 = require("./PolymorphicReference");
52
- Object.defineProperty(exports, "PolymorphicReferenceImpl", { enumerable: true, get: function () { return PolymorphicReference_1.PolymorphicReferenceImpl; } });
53
- Object.defineProperty(exports, "hasOnePolymorphic", { enumerable: true, get: function () { return PolymorphicReference_1.hasOnePolymorphic; } });
54
- Object.defineProperty(exports, "isPolymorphicReference", { enumerable: true, get: function () { return PolymorphicReference_1.isPolymorphicReference; } });
55
- var ReactiveField_1 = require("./ReactiveField");
56
- Object.defineProperty(exports, "hasReactiveField", { enumerable: true, get: function () { return ReactiveField_1.hasReactiveField; } });
57
- Object.defineProperty(exports, "isReactiveField", { enumerable: true, get: function () { return ReactiveField_1.isReactiveField; } });
58
- var ReactiveGetter_1 = require("./ReactiveGetter");
59
- Object.defineProperty(exports, "hasReactiveGetter", { enumerable: true, get: function () { return ReactiveGetter_1.hasReactiveGetter; } });
60
- Object.defineProperty(exports, "isReactiveGetter", { enumerable: true, get: function () { return ReactiveGetter_1.isReactiveGetter; } });
61
- var ReactiveQueryField_1 = require("./ReactiveQueryField");
62
- Object.defineProperty(exports, "hasReactiveQueryField", { enumerable: true, get: function () { return ReactiveQueryField_1.hasReactiveQueryField; } });
63
- Object.defineProperty(exports, "isReactiveQueryField", { enumerable: true, get: function () { return ReactiveQueryField_1.isReactiveQueryField; } });
64
- var ReactiveReference_1 = require("./ReactiveReference");
65
- Object.defineProperty(exports, "ReactiveReferenceImpl", { enumerable: true, get: function () { return ReactiveReference_1.ReactiveReferenceImpl; } });
66
- Object.defineProperty(exports, "hasReactiveReference", { enumerable: true, get: function () { return ReactiveReference_1.hasReactiveReference; } });
67
- Object.defineProperty(exports, "isReactiveReference", { enumerable: true, get: function () { return ReactiveReference_1.isReactiveReference; } });
68
- var ReactiveManyToMany_1 = require("./ReactiveManyToMany");
69
- Object.defineProperty(exports, "ReactiveManyToManyImpl", { enumerable: true, get: function () { return ReactiveManyToMany_1.ReactiveManyToManyImpl; } });
70
- Object.defineProperty(exports, "hasReactiveManyToMany", { enumerable: true, get: function () { return ReactiveManyToMany_1.hasReactiveManyToMany; } });
71
- Object.defineProperty(exports, "isReactiveManyToMany", { enumerable: true, get: function () { return ReactiveManyToMany_1.isReactiveManyToMany; } });
72
- var ReactiveManyToManyOtherSide_1 = require("./ReactiveManyToManyOtherSide");
73
- Object.defineProperty(exports, "ReactiveManyToManyOtherSideImpl", { enumerable: true, get: function () { return ReactiveManyToManyOtherSide_1.ReactiveManyToManyOtherSideImpl; } });
74
- Object.defineProperty(exports, "hasReactiveManyToManyOtherSide", { enumerable: true, get: function () { return ReactiveManyToManyOtherSide_1.hasReactiveManyToManyOtherSide; } });
75
- Object.defineProperty(exports, "isReactiveManyToManyOtherSide", { enumerable: true, get: function () { return ReactiveManyToManyOtherSide_1.isReactiveManyToManyOtherSide; } });
76
- var ReadOnlyCollection_1 = require("./ReadOnlyCollection");
77
- Object.defineProperty(exports, "isLoadedReadOnlyCollection", { enumerable: true, get: function () { return ReadOnlyCollection_1.isLoadedReadOnlyCollection; } });
78
- Object.defineProperty(exports, "isReadOnlyCollection", { enumerable: true, get: function () { return ReadOnlyCollection_1.isReadOnlyCollection; } });
79
- var RecursiveCollection_1 = require("./RecursiveCollection");
80
- Object.defineProperty(exports, "RecursiveCycleError", { enumerable: true, get: function () { return RecursiveCollection_1.RecursiveCycleError; } });
81
- Object.defineProperty(exports, "hasRecursiveChildren", { enumerable: true, get: function () { return RecursiveCollection_1.hasRecursiveChildren; } });
82
- Object.defineProperty(exports, "hasRecursiveParents", { enumerable: true, get: function () { return RecursiveCollection_1.hasRecursiveParents; } });
83
- var Reference_1 = require("./Reference");
84
- Object.defineProperty(exports, "isLoadedReference", { enumerable: true, get: function () { return Reference_1.isLoadedReference; } });
85
- Object.defineProperty(exports, "isReference", { enumerable: true, get: function () { return Reference_1.isReference; } });
86
- var Relation_1 = require("./Relation");
87
- Object.defineProperty(exports, "isRelation", { enumerable: true, get: function () { return Relation_1.isRelation; } });
88
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/relations/index.ts"],"names":[],"mappings":";;;;AAAA,2CAA8F;AAAvD,0GAAA,YAAY,OAAA;AAAE,gHAAA,kBAAkB,OAAA;AACvE,uDAA2E;AAAlE,oHAAA,gBAAgB,OAAA;AAAE,uHAAA,mBAAmB,OAAA;AAC9C,qDAAwE;AAA/D,kHAAA,eAAe,OAAA;AAAE,qHAAA,kBAAkB,OAAA;AAC5C,mDAA6E;AAAzC,gHAAA,cAAc,OAAA;AAClD,uDAQ4B;AAN1B,qHAAA,iBAAiB,OAAA;AAEjB,oHAAA,gBAAgB,OAAA;AAChB,4HAAA,wBAAwB,OAAA;AACxB,mHAAA,eAAe,OAAA;AACf,yHAAA,qBAAqB,OAAA;AAEvB,mDAAkD;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C9B,4IAAA,6BAA6B,OAAA;AAE/B,2DAK8B;AAF5B,gIAAA,0BAA0B,OAAA;AAC1B,0HAAA,oBAAoB,OAAA;AAEtB,6DAAuG;AAA9F,0HAAA,mBAAmB,OAAA;AAAE,2HAAA,oBAAoB,OAAA;AAAE,0HAAA,mBAAmB,OAAA;AACvE,yCAAyF;AAApD,8GAAA,iBAAiB,OAAA;AAAE,wGAAA,WAAW,OAAA;AACnE,uCAAkD;AAA/B,sGAAA,UAAU,OAAA"}
package/build/rules.d.ts DELETED
@@ -1,123 +0,0 @@
1
- import { Changes } from "./changes";
2
- import { Entity } from "./Entity";
3
- import { ReactiveHint } from "./reactiveHints";
4
- import { FieldsOf } from "./typeMap";
5
- import { MaybePromise } from "./utils";
6
- export declare enum ValidationCode {
7
- required = "required",
8
- cannotBeUpdated = "not-updatable",
9
- cannotBeChanged = "not-changeable",
10
- numeric = "not-numeric",
11
- minValue = "under-min",
12
- maxValue = "over-max"
13
- }
14
- /**
15
- * The return type of `ValidationRule` lambdas.
16
- *
17
- * We're flexible and allow rules to return a variety of shapes, like just a string, string[], etc.
18
- *
19
- * Returning `undefined` means the rule passed.
20
- */
21
- export type ValidationRuleResult = string | string[] | GenericError | GenericError[] | undefined | void;
22
- /** An entity validation rule. */
23
- export type ValidationRule<T extends Entity> = (entity: T) => MaybePromise<ValidationRuleResult>;
24
- /** Internal metadata for an async/reactive validation rule. */
25
- export type ValidationRuleInternal<T extends Entity> = {
26
- name: string;
27
- hint: ReactiveHint<T> | undefined;
28
- fn: ValidationRule<T>;
29
- };
30
- /** A generic error which contains a message, and optional field/codes. */
31
- export type GenericError = {
32
- message: string;
33
- field?: string;
34
- code?: string;
35
- };
36
- /** Combines the GenericError with the `entity` that caused it. */
37
- export type ValidationError = {
38
- entity: Entity;
39
- } & GenericError;
40
- export type ValidationRuleOptsFn<T extends Entity> = (entity: T) => MaybePromise<boolean>;
41
- export type ValidationRuleOpts<T extends Entity> = {
42
- unless?: ValidationRuleOptsFn<T>;
43
- if?: ValidationRuleOptsFn<T>;
44
- };
45
- export declare class ValidationErrors extends Error {
46
- errors: Array<GenericError | ValidationError>;
47
- readonly toJSON: () => string;
48
- constructor(errors: ValidationError[]);
49
- constructor(message: string);
50
- }
51
- /**
52
- * Creates a validation rule for required fields.
53
- *
54
- * This is added automatically by codegen to entities based on FK not-nulls.
55
- */
56
- export declare function newRequiredRule<T extends Entity>(key: keyof FieldsOf<T> & string, opts?: ValidationRuleOpts<T>): ValidationRule<T>;
57
- /**
58
- * Creates a validation rule that a field cannot be updated; it can only be set on creation.
59
- *
60
- * If the optional `unless` function returns true, then the update is allowed.
61
- */
62
- export declare function cannotBeUpdated<T extends Entity, K extends keyof Changes<T> & string>(field: K, opts?: ValidationRuleOpts<T>): CannotBeUpdatedRule<T>;
63
- export declare function cannotBeUpdated<T extends Entity, K extends keyof Changes<T> & string>(field: K, unless?: ValidationRuleOptsFn<T>): CannotBeUpdatedRule<T>;
64
- /**
65
- * Creates a validation rule that a field cannot be changed once set.
66
- *
67
- * If the optional `unless` function returns true, then the update is allowed.
68
- */
69
- export declare function cannotBeChanged<T extends Entity, K extends keyof Changes<T> & string>(field: K, opts?: ValidationRuleOpts<T>): ValidationRule<T>;
70
- type CannotBeUpdatedRule<T extends Entity> = ValidationRule<T> & {
71
- field: string;
72
- immutable: boolean;
73
- };
74
- export declare function isCannotBeUpdatedRule(rule: Function): rule is CannotBeUpdatedRule<any>;
75
- /** For STI, enforces subtype-specific relations/FKs at runtime. */
76
- export declare function mustBeSubType<T extends Entity, K extends keyof Changes<T> & string>(relationName: K, opts?: ValidationRuleOpts<T>): ValidationRule<T>;
77
- /**
78
- * Creates a validation rule that a field value cannot be smaller than a
79
- * certain value.
80
- *
81
- * @param field The field to validate
82
- * @param minValue The inclusive minimum value. e.g 0 range is [0, Infinity]
83
- * @param opts Optional validation rule options that control when the rule should run:
84
- * - unless: Function that returns true to skip validation
85
- * - if: Function that returns true to run validation
86
- *
87
- * @example
88
- * // Age cannot be smaller than 0
89
- * config.addRule(minValueRule("age", 0));
90
- */
91
- export declare function minValueRule<T extends Entity, K extends keyof T & string>(field: K, minValue: number, opts?: ValidationRuleOpts<T>): ValidationRule<T>;
92
- /**
93
- * Creates a validation rule that a field value cannot be greater than a
94
- * certain value.
95
- *
96
- * @param field The field to validate
97
- * @param maxValue The include maximum value. e.g 10 range is [-Infinity, 10]
98
- * @param opts Optional validation rule options that control when the rule should run:
99
- * - unless: Function that returns true to skip validation
100
- * - if: Function that returns true to run validation
101
- *
102
- * @example
103
- * // Age cannot be greater than 150
104
- * config.addRule(maxValueRule("age", 150));
105
- */
106
- export declare function maxValueRule<T extends Entity, K extends keyof T & string>(field: K, maxValue: number, opts?: ValidationRuleOpts<T>): ValidationRule<T>;
107
- /**
108
- * Creates a validation rule that a field value must be within a range of
109
- * certain values
110
- *
111
- * @param field The field to validate
112
- * @param minValue The inclusive minimum value. e.g 0 [0, Infinity]
113
- * @param maxValue The include maximum value. e.g 10 [-Infinity, 10]
114
- * @param opts Optional validation rule options that control when the rule should run:
115
- * - unless: Function that returns true to skip validation
116
- * - if: Function that returns true to run validation * @example
117
- *
118
- * // Age must be between 0 and 150
119
- * config.addRule(rangeValueRule("age", 0, 150));
120
- */
121
- export declare function rangeValueRule<T extends Entity, K extends keyof T & string>(field: K, minValue: number, maxValue: number, opts?: ValidationRuleOpts<T>): ValidationRule<T>;
122
- export {};
123
- //# sourceMappingURL=rules.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../src/rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAiB,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAW,YAAY,EAAoB,MAAM,SAAS,CAAC;AA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