joist-orm 1.294.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 (482) 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 -128
  18. package/build/index.d.ts.map +1 -1
  19. package/build/index.js +8 -284
  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/package.json +85 -16
  38. package/build/AliasAssigner.d.ts +0 -7
  39. package/build/AliasAssigner.d.ts.map +0 -1
  40. package/build/AliasAssigner.js +0 -30
  41. package/build/AliasAssigner.js.map +0 -1
  42. package/build/Aliases.d.ts +0 -110
  43. package/build/Aliases.d.ts.map +0 -1
  44. package/build/Aliases.js +0 -456
  45. package/build/Aliases.js.map +0 -1
  46. package/build/BaseEntity.d.ts +0 -66
  47. package/build/BaseEntity.d.ts.map +0 -1
  48. package/build/BaseEntity.js +0 -120
  49. package/build/BaseEntity.js.map +0 -1
  50. package/build/ConditionBuilder.d.ts +0 -50
  51. package/build/ConditionBuilder.d.ts.map +0 -1
  52. package/build/ConditionBuilder.js +0 -178
  53. package/build/ConditionBuilder.js.map +0 -1
  54. package/build/Entity.d.ts +0 -38
  55. package/build/Entity.d.ts.map +0 -1
  56. package/build/Entity.js +0 -8
  57. package/build/Entity.js.map +0 -1
  58. package/build/EntityFields.d.ts +0 -37
  59. package/build/EntityFields.d.ts.map +0 -1
  60. package/build/EntityFields.js +0 -3
  61. package/build/EntityFields.js.map +0 -1
  62. package/build/EntityFilter.d.ts +0 -113
  63. package/build/EntityFilter.d.ts.map +0 -1
  64. package/build/EntityFilter.js +0 -3
  65. package/build/EntityFilter.js.map +0 -1
  66. package/build/EntityGraphQLFilter.d.ts +0 -51
  67. package/build/EntityGraphQLFilter.d.ts.map +0 -1
  68. package/build/EntityGraphQLFilter.js +0 -54
  69. package/build/EntityGraphQLFilter.js.map +0 -1
  70. package/build/EntityManager.d.ts +0 -734
  71. package/build/EntityManager.d.ts.map +0 -1
  72. package/build/EntityManager.js +0 -2075
  73. package/build/EntityManager.js.map +0 -1
  74. package/build/EntityMetadata.d.ts +0 -185
  75. package/build/EntityMetadata.d.ts.map +0 -1
  76. package/build/EntityMetadata.js +0 -61
  77. package/build/EntityMetadata.js.map +0 -1
  78. package/build/EnumMetadata.d.ts +0 -15
  79. package/build/EnumMetadata.d.ts.map +0 -1
  80. package/build/EnumMetadata.js +0 -3
  81. package/build/EnumMetadata.js.map +0 -1
  82. package/build/FlushLock.d.ts +0 -26
  83. package/build/FlushLock.d.ts.map +0 -1
  84. package/build/FlushLock.js +0 -57
  85. package/build/FlushLock.js.map +0 -1
  86. package/build/HintTree.d.ts +0 -42
  87. package/build/HintTree.d.ts.map +0 -1
  88. package/build/HintTree.js +0 -64
  89. package/build/HintTree.js.map +0 -1
  90. package/build/IndexManager.d.ts +0 -30
  91. package/build/IndexManager.d.ts.map +0 -1
  92. package/build/IndexManager.js +0 -206
  93. package/build/IndexManager.js.map +0 -1
  94. package/build/InstanceData.d.ts +0 -59
  95. package/build/InstanceData.d.ts.map +0 -1
  96. package/build/InstanceData.js +0 -162
  97. package/build/InstanceData.js.map +0 -1
  98. package/build/IsLoadedCache.d.ts +0 -32
  99. package/build/IsLoadedCache.d.ts.map +0 -1
  100. package/build/IsLoadedCache.js +0 -80
  101. package/build/IsLoadedCache.js.map +0 -1
  102. package/build/JoinRows.d.ts +0 -75
  103. package/build/JoinRows.d.ts.map +0 -1
  104. package/build/JoinRows.js +0 -246
  105. package/build/JoinRows.js.map +0 -1
  106. package/build/PluginManager.d.ts +0 -90
  107. package/build/PluginManager.d.ts.map +0 -1
  108. package/build/PluginManager.js +0 -97
  109. package/build/PluginManager.js.map +0 -1
  110. package/build/QueryParser.d.ts +0 -271
  111. package/build/QueryParser.d.ts.map +0 -1
  112. package/build/QueryParser.js +0 -853
  113. package/build/QueryParser.js.map +0 -1
  114. package/build/QueryParser.pruning.d.ts +0 -5
  115. package/build/QueryParser.pruning.d.ts.map +0 -1
  116. package/build/QueryParser.pruning.js +0 -118
  117. package/build/QueryParser.pruning.js.map +0 -1
  118. package/build/QueryVisitor.d.ts +0 -19
  119. package/build/QueryVisitor.d.ts.map +0 -1
  120. package/build/QueryVisitor.js +0 -84
  121. package/build/QueryVisitor.js.map +0 -1
  122. package/build/ReactionsManager.d.ts +0 -84
  123. package/build/ReactionsManager.d.ts.map +0 -1
  124. package/build/ReactionsManager.js +0 -308
  125. package/build/ReactionsManager.js.map +0 -1
  126. package/build/Todo.d.ts +0 -31
  127. package/build/Todo.d.ts.map +0 -1
  128. package/build/Todo.js +0 -73
  129. package/build/Todo.js.map +0 -1
  130. package/build/caches.d.ts +0 -6
  131. package/build/caches.d.ts.map +0 -1
  132. package/build/caches.js +0 -42
  133. package/build/caches.js.map +0 -1
  134. package/build/changes.d.ts +0 -79
  135. package/build/changes.d.ts.map +0 -1
  136. package/build/changes.js +0 -251
  137. package/build/changes.js.map +0 -1
  138. package/build/config.d.ts +0 -237
  139. package/build/config.d.ts.map +0 -1
  140. package/build/config.js +0 -298
  141. package/build/config.js.map +0 -1
  142. package/build/config.test.d.ts +0 -2
  143. package/build/config.test.d.ts.map +0 -1
  144. package/build/config.test.js +0 -53
  145. package/build/config.test.js.map +0 -1
  146. package/build/configure.d.ts +0 -13
  147. package/build/configure.d.ts.map +0 -1
  148. package/build/configure.js +0 -329
  149. package/build/configure.js.map +0 -1
  150. package/build/dataloaders/findByUniqueDataLoader.d.ts +0 -7
  151. package/build/dataloaders/findByUniqueDataLoader.d.ts.map +0 -1
  152. package/build/dataloaders/findByUniqueDataLoader.js +0 -47
  153. package/build/dataloaders/findByUniqueDataLoader.js.map +0 -1
  154. package/build/dataloaders/findCountDataLoader.d.ts +0 -7
  155. package/build/dataloaders/findCountDataLoader.d.ts.map +0 -1
  156. package/build/dataloaders/findCountDataLoader.js +0 -74
  157. package/build/dataloaders/findCountDataLoader.js.map +0 -1
  158. package/build/dataloaders/findDataLoader.d.ts +0 -37
  159. package/build/dataloaders/findDataLoader.d.ts.map +0 -1
  160. package/build/dataloaders/findDataLoader.js +0 -337
  161. package/build/dataloaders/findDataLoader.js.map +0 -1
  162. package/build/dataloaders/findIdsDataLoader.d.ts +0 -7
  163. package/build/dataloaders/findIdsDataLoader.d.ts.map +0 -1
  164. package/build/dataloaders/findIdsDataLoader.js +0 -74
  165. package/build/dataloaders/findIdsDataLoader.js.map +0 -1
  166. package/build/dataloaders/findOrCreateDataLoader.d.ts +0 -13
  167. package/build/dataloaders/findOrCreateDataLoader.d.ts.map +0 -1
  168. package/build/dataloaders/findOrCreateDataLoader.js +0 -174
  169. package/build/dataloaders/findOrCreateDataLoader.js.map +0 -1
  170. package/build/dataloaders/lensDataLoader.d.ts +0 -12
  171. package/build/dataloaders/lensDataLoader.d.ts.map +0 -1
  172. package/build/dataloaders/lensDataLoader.js +0 -180
  173. package/build/dataloaders/lensDataLoader.js.map +0 -1
  174. package/build/dataloaders/loadDataLoader.d.ts +0 -11
  175. package/build/dataloaders/loadDataLoader.d.ts.map +0 -1
  176. package/build/dataloaders/loadDataLoader.js +0 -54
  177. package/build/dataloaders/loadDataLoader.js.map +0 -1
  178. package/build/dataloaders/manyToManyDataLoader.d.ts +0 -8
  179. package/build/dataloaders/manyToManyDataLoader.d.ts.map +0 -1
  180. package/build/dataloaders/manyToManyDataLoader.js +0 -74
  181. package/build/dataloaders/manyToManyDataLoader.js.map +0 -1
  182. package/build/dataloaders/manyToManyFindDataLoader.d.ts +0 -8
  183. package/build/dataloaders/manyToManyFindDataLoader.d.ts.map +0 -1
  184. package/build/dataloaders/manyToManyFindDataLoader.js +0 -70
  185. package/build/dataloaders/manyToManyFindDataLoader.js.map +0 -1
  186. package/build/dataloaders/oneToManyDataLoader.d.ts +0 -7
  187. package/build/dataloaders/oneToManyDataLoader.d.ts.map +0 -1
  188. package/build/dataloaders/oneToManyDataLoader.js +0 -60
  189. package/build/dataloaders/oneToManyDataLoader.js.map +0 -1
  190. package/build/dataloaders/oneToManyFindDataLoader.d.ts +0 -8
  191. package/build/dataloaders/oneToManyFindDataLoader.d.ts.map +0 -1
  192. package/build/dataloaders/oneToManyFindDataLoader.js +0 -71
  193. package/build/dataloaders/oneToManyFindDataLoader.js.map +0 -1
  194. package/build/dataloaders/oneToOneDataLoader.d.ts +0 -7
  195. package/build/dataloaders/oneToOneDataLoader.d.ts.map +0 -1
  196. package/build/dataloaders/oneToOneDataLoader.js +0 -59
  197. package/build/dataloaders/oneToOneDataLoader.js.map +0 -1
  198. package/build/dataloaders/populateDataLoader.d.ts +0 -13
  199. package/build/dataloaders/populateDataLoader.d.ts.map +0 -1
  200. package/build/dataloaders/populateDataLoader.js +0 -148
  201. package/build/dataloaders/populateDataLoader.js.map +0 -1
  202. package/build/dataloaders/recursiveChildrenDataLoader.d.ts +0 -7
  203. package/build/dataloaders/recursiveChildrenDataLoader.d.ts.map +0 -1
  204. package/build/dataloaders/recursiveChildrenDataLoader.js +0 -77
  205. package/build/dataloaders/recursiveChildrenDataLoader.js.map +0 -1
  206. package/build/dataloaders/recursiveParentsDataLoader.d.ts +0 -7
  207. package/build/dataloaders/recursiveParentsDataLoader.d.ts.map +0 -1
  208. package/build/dataloaders/recursiveParentsDataLoader.js +0 -59
  209. package/build/dataloaders/recursiveParentsDataLoader.js.map +0 -1
  210. package/build/defaults.d.ts +0 -54
  211. package/build/defaults.d.ts.map +0 -1
  212. package/build/defaults.js +0 -282
  213. package/build/defaults.js.map +0 -1
  214. package/build/driverApi.d.ts +0 -19
  215. package/build/driverApi.d.ts.map +0 -1
  216. package/build/driverApi.js +0 -17
  217. package/build/driverApi.js.map +0 -1
  218. package/build/drivers/Driver.d.ts +0 -26
  219. package/build/drivers/Driver.d.ts.map +0 -1
  220. package/build/drivers/Driver.js +0 -3
  221. package/build/drivers/Driver.js.map +0 -1
  222. package/build/drivers/EntityWriter.d.ts +0 -64
  223. package/build/drivers/EntityWriter.d.ts.map +0 -1
  224. package/build/drivers/EntityWriter.js +0 -237
  225. package/build/drivers/EntityWriter.js.map +0 -1
  226. package/build/drivers/IdAssigner.d.ts +0 -50
  227. package/build/drivers/IdAssigner.d.ts.map +0 -1
  228. package/build/drivers/IdAssigner.js +0 -133
  229. package/build/drivers/IdAssigner.js.map +0 -1
  230. package/build/drivers/PostgresDriver.d.ts.map +0 -1
  231. package/build/drivers/PostgresDriver.js.map +0 -1
  232. package/build/drivers/buildRawQuery.d.ts +0 -20
  233. package/build/drivers/buildRawQuery.d.ts.map +0 -1
  234. package/build/drivers/buildRawQuery.js +0 -148
  235. package/build/drivers/buildRawQuery.js.map +0 -1
  236. package/build/drivers/buildUtils.d.ts +0 -4
  237. package/build/drivers/buildUtils.d.ts.map +0 -1
  238. package/build/drivers/buildUtils.js +0 -79
  239. package/build/drivers/buildUtils.js.map +0 -1
  240. package/build/drivers/index.d.ts +0 -5
  241. package/build/drivers/index.d.ts.map +0 -1
  242. package/build/drivers/index.js.map +0 -1
  243. package/build/fields.d.ts +0 -24
  244. package/build/fields.d.ts.map +0 -1
  245. package/build/fields.js +0 -162
  246. package/build/fields.js.map +0 -1
  247. package/build/getProperties.d.ts +0 -28
  248. package/build/getProperties.d.ts.map +0 -1
  249. package/build/getProperties.js +0 -141
  250. package/build/getProperties.js.map +0 -1
  251. package/build/json.d.ts +0 -77
  252. package/build/json.d.ts.map +0 -1
  253. package/build/json.js +0 -116
  254. package/build/json.js.map +0 -1
  255. package/build/k.d.ts +0 -2
  256. package/build/k.d.ts.map +0 -1
  257. package/build/k.js +0 -9
  258. package/build/k.js.map +0 -1
  259. package/build/keys.d.ts +0 -49
  260. package/build/keys.d.ts.map +0 -1
  261. package/build/keys.js +0 -195
  262. package/build/keys.js.map +0 -1
  263. package/build/keywords.d.ts +0 -5
  264. package/build/keywords.d.ts.map +0 -1
  265. package/build/keywords.js +0 -124
  266. package/build/keywords.js.map +0 -1
  267. package/build/loadHints.d.ts +0 -112
  268. package/build/loadHints.d.ts.map +0 -1
  269. package/build/loadHints.js +0 -75
  270. package/build/loadHints.js.map +0 -1
  271. package/build/loadLens.d.ts +0 -66
  272. package/build/loadLens.d.ts.map +0 -1
  273. package/build/loadLens.js +0 -287
  274. package/build/loadLens.js.map +0 -1
  275. package/build/logging/FactoryLogger.d.ts +0 -24
  276. package/build/logging/FactoryLogger.d.ts.map +0 -1
  277. package/build/logging/FactoryLogger.js +0 -77
  278. package/build/logging/FactoryLogger.js.map +0 -1
  279. package/build/logging/FieldLogger.d.ts +0 -27
  280. package/build/logging/FieldLogger.d.ts.map +0 -1
  281. package/build/logging/FieldLogger.js +0 -69
  282. package/build/logging/FieldLogger.js.map +0 -1
  283. package/build/logging/ReactionLogger.d.ts +0 -23
  284. package/build/logging/ReactionLogger.d.ts.map +0 -1
  285. package/build/logging/ReactionLogger.js +0 -65
  286. package/build/logging/ReactionLogger.js.map +0 -1
  287. package/build/newEntity.d.ts +0 -45
  288. package/build/newEntity.d.ts.map +0 -1
  289. package/build/newEntity.js +0 -106
  290. package/build/newEntity.js.map +0 -1
  291. package/build/newTestInstance.d.ts +0 -193
  292. package/build/newTestInstance.d.ts.map +0 -1
  293. package/build/newTestInstance.js +0 -738
  294. package/build/newTestInstance.js.map +0 -1
  295. package/build/normalizeHints.d.ts +0 -16
  296. package/build/normalizeHints.d.ts.map +0 -1
  297. package/build/normalizeHints.js +0 -31
  298. package/build/normalizeHints.js.map +0 -1
  299. package/build/plugins/ImmutableEntitiesPlugin.d.ts +0 -9
  300. package/build/plugins/ImmutableEntitiesPlugin.d.ts.map +0 -1
  301. package/build/plugins/ImmutableEntitiesPlugin.js +0 -21
  302. package/build/plugins/ImmutableEntitiesPlugin.js.map +0 -1
  303. package/build/plugins/PreloadPlugin.d.ts +0 -69
  304. package/build/plugins/PreloadPlugin.d.ts.map +0 -1
  305. package/build/plugins/PreloadPlugin.js +0 -3
  306. package/build/plugins/PreloadPlugin.js.map +0 -1
  307. package/build/preloading/JsonAggregatePreloader.d.ts +0 -16
  308. package/build/preloading/JsonAggregatePreloader.d.ts.map +0 -1
  309. package/build/preloading/JsonAggregatePreloader.js +0 -238
  310. package/build/preloading/JsonAggregatePreloader.js.map +0 -1
  311. package/build/preloading/canPreload.d.ts +0 -3
  312. package/build/preloading/canPreload.d.ts.map +0 -1
  313. package/build/preloading/canPreload.js +0 -21
  314. package/build/preloading/canPreload.js.map +0 -1
  315. package/build/preloading/partitionHint.d.ts +0 -5
  316. package/build/preloading/partitionHint.d.ts.map +0 -1
  317. package/build/preloading/partitionHint.js +0 -56
  318. package/build/preloading/partitionHint.js.map +0 -1
  319. package/build/reactiveHints.d.ts +0 -129
  320. package/build/reactiveHints.d.ts.map +0 -1
  321. package/build/reactiveHints.js +0 -458
  322. package/build/reactiveHints.js.map +0 -1
  323. package/build/relations/AbstractPropertyImpl.d.ts +0 -8
  324. package/build/relations/AbstractPropertyImpl.d.ts.map +0 -1
  325. package/build/relations/AbstractPropertyImpl.js +0 -15
  326. package/build/relations/AbstractPropertyImpl.js.map +0 -1
  327. package/build/relations/AbstractRelationImpl.d.ts +0 -36
  328. package/build/relations/AbstractRelationImpl.d.ts.map +0 -1
  329. package/build/relations/AbstractRelationImpl.js +0 -19
  330. package/build/relations/AbstractRelationImpl.js.map +0 -1
  331. package/build/relations/Collection.d.ts +0 -28
  332. package/build/relations/Collection.d.ts.map +0 -1
  333. package/build/relations/Collection.js +0 -18
  334. package/build/relations/Collection.js.map +0 -1
  335. package/build/relations/CustomCollection.d.ts +0 -69
  336. package/build/relations/CustomCollection.d.ts.map +0 -1
  337. package/build/relations/CustomCollection.js +0 -166
  338. package/build/relations/CustomCollection.js.map +0 -1
  339. package/build/relations/CustomReference.d.ts +0 -71
  340. package/build/relations/CustomReference.d.ts.map +0 -1
  341. package/build/relations/CustomReference.js +0 -152
  342. package/build/relations/CustomReference.js.map +0 -1
  343. package/build/relations/LargeCollection.d.ts +0 -19
  344. package/build/relations/LargeCollection.d.ts.map +0 -1
  345. package/build/relations/LargeCollection.js +0 -3
  346. package/build/relations/LargeCollection.js.map +0 -1
  347. package/build/relations/ManyToManyCollection.d.ts +0 -44
  348. package/build/relations/ManyToManyCollection.d.ts.map +0 -1
  349. package/build/relations/ManyToManyCollection.js +0 -268
  350. package/build/relations/ManyToManyCollection.js.map +0 -1
  351. package/build/relations/ManyToManyLargeCollection.d.ts +0 -30
  352. package/build/relations/ManyToManyLargeCollection.d.ts.map +0 -1
  353. package/build/relations/ManyToManyLargeCollection.js +0 -119
  354. package/build/relations/ManyToManyLargeCollection.js.map +0 -1
  355. package/build/relations/ManyToOneReference.d.ts +0 -121
  356. package/build/relations/ManyToOneReference.d.ts.map +0 -1
  357. package/build/relations/ManyToOneReference.js +0 -389
  358. package/build/relations/ManyToOneReference.js.map +0 -1
  359. package/build/relations/OneToManyCollection.d.ts +0 -58
  360. package/build/relations/OneToManyCollection.d.ts.map +0 -1
  361. package/build/relations/OneToManyCollection.js +0 -347
  362. package/build/relations/OneToManyCollection.js.map +0 -1
  363. package/build/relations/OneToManyLargeCollection.d.ts +0 -26
  364. package/build/relations/OneToManyLargeCollection.d.ts.map +0 -1
  365. package/build/relations/OneToManyLargeCollection.js +0 -102
  366. package/build/relations/OneToManyLargeCollection.js.map +0 -1
  367. package/build/relations/OneToOneReference.d.ts +0 -93
  368. package/build/relations/OneToOneReference.d.ts.map +0 -1
  369. package/build/relations/OneToOneReference.js +0 -228
  370. package/build/relations/OneToOneReference.js.map +0 -1
  371. package/build/relations/PolymorphicReference.d.ts +0 -89
  372. package/build/relations/PolymorphicReference.d.ts.map +0 -1
  373. package/build/relations/PolymorphicReference.js +0 -244
  374. package/build/relations/PolymorphicReference.js.map +0 -1
  375. package/build/relations/ReactiveField.d.ts +0 -87
  376. package/build/relations/ReactiveField.d.ts.map +0 -1
  377. package/build/relations/ReactiveField.js +0 -149
  378. package/build/relations/ReactiveField.js.map +0 -1
  379. package/build/relations/ReactiveGetter.d.ts +0 -30
  380. package/build/relations/ReactiveGetter.d.ts.map +0 -1
  381. package/build/relations/ReactiveGetter.js +0 -38
  382. package/build/relations/ReactiveGetter.js.map +0 -1
  383. package/build/relations/ReactiveManyToMany.d.ts +0 -56
  384. package/build/relations/ReactiveManyToMany.d.ts.map +0 -1
  385. package/build/relations/ReactiveManyToMany.js +0 -243
  386. package/build/relations/ReactiveManyToMany.js.map +0 -1
  387. package/build/relations/ReactiveManyToManyOtherSide.d.ts +0 -47
  388. package/build/relations/ReactiveManyToManyOtherSide.d.ts.map +0 -1
  389. package/build/relations/ReactiveManyToManyOtherSide.js +0 -155
  390. package/build/relations/ReactiveManyToManyOtherSide.js.map +0 -1
  391. package/build/relations/ReactiveQueryField.d.ts +0 -41
  392. package/build/relations/ReactiveQueryField.d.ts.map +0 -1
  393. package/build/relations/ReactiveQueryField.js +0 -125
  394. package/build/relations/ReactiveQueryField.js.map +0 -1
  395. package/build/relations/ReactiveReference.d.ts +0 -119
  396. package/build/relations/ReactiveReference.d.ts.map +0 -1
  397. package/build/relations/ReactiveReference.js +0 -333
  398. package/build/relations/ReactiveReference.js.map +0 -1
  399. package/build/relations/ReadOnlyCollection.d.ts +0 -19
  400. package/build/relations/ReadOnlyCollection.d.ts.map +0 -1
  401. package/build/relations/ReadOnlyCollection.js +0 -15
  402. package/build/relations/ReadOnlyCollection.js.map +0 -1
  403. package/build/relations/RecursiveCollection.d.ts +0 -84
  404. package/build/relations/RecursiveCollection.d.ts.map +0 -1
  405. package/build/relations/RecursiveCollection.js +0 -296
  406. package/build/relations/RecursiveCollection.js.map +0 -1
  407. package/build/relations/Reference.d.ts +0 -35
  408. package/build/relations/Reference.d.ts.map +0 -1
  409. package/build/relations/Reference.js +0 -21
  410. package/build/relations/Reference.js.map +0 -1
  411. package/build/relations/Relation.d.ts +0 -14
  412. package/build/relations/Relation.d.ts.map +0 -1
  413. package/build/relations/Relation.js +0 -12
  414. package/build/relations/Relation.js.map +0 -1
  415. package/build/relations/hasAsyncMethod.d.ts +0 -27
  416. package/build/relations/hasAsyncMethod.d.ts.map +0 -1
  417. package/build/relations/hasAsyncMethod.js +0 -47
  418. package/build/relations/hasAsyncMethod.js.map +0 -1
  419. package/build/relations/hasAsyncProperty.d.ts +0 -49
  420. package/build/relations/hasAsyncProperty.d.ts.map +0 -1
  421. package/build/relations/hasAsyncProperty.js +0 -98
  422. package/build/relations/hasAsyncProperty.js.map +0 -1
  423. package/build/relations/hasManyDerived.d.ts +0 -22
  424. package/build/relations/hasManyDerived.d.ts.map +0 -1
  425. package/build/relations/hasManyDerived.js +0 -32
  426. package/build/relations/hasManyDerived.js.map +0 -1
  427. package/build/relations/hasManyThrough.d.ts +0 -10
  428. package/build/relations/hasManyThrough.d.ts.map +0 -1
  429. package/build/relations/hasManyThrough.js +0 -24
  430. package/build/relations/hasManyThrough.js.map +0 -1
  431. package/build/relations/hasOneDerived.d.ts +0 -12
  432. package/build/relations/hasOneDerived.d.ts.map +0 -1
  433. package/build/relations/hasOneDerived.js +0 -24
  434. package/build/relations/hasOneDerived.js.map +0 -1
  435. package/build/relations/hasOneThrough.d.ts +0 -10
  436. package/build/relations/hasOneThrough.d.ts.map +0 -1
  437. package/build/relations/hasOneThrough.js +0 -24
  438. package/build/relations/hasOneThrough.js.map +0 -1
  439. package/build/relations/index.d.ts +0 -28
  440. package/build/relations/index.d.ts.map +0 -1
  441. package/build/relations/index.js +0 -88
  442. package/build/relations/index.js.map +0 -1
  443. package/build/rules.d.ts +0 -123
  444. package/build/rules.d.ts.map +0 -1
  445. package/build/rules.js +0 -231
  446. package/build/rules.js.map +0 -1
  447. package/build/runtimeConfig.d.ts +0 -17
  448. package/build/runtimeConfig.d.ts.map +0 -1
  449. package/build/runtimeConfig.js +0 -18
  450. package/build/runtimeConfig.js.map +0 -1
  451. package/build/serde.d.ts +0 -277
  452. package/build/serde.d.ts.map +0 -1
  453. package/build/serde.js +0 -517
  454. package/build/serde.js.map +0 -1
  455. package/build/temporal.d.ts +0 -16
  456. package/build/temporal.d.ts.map +0 -1
  457. package/build/temporal.js +0 -48
  458. package/build/temporal.js.map +0 -1
  459. package/build/temporalMappers.d.ts +0 -25
  460. package/build/temporalMappers.d.ts.map +0 -1
  461. package/build/temporalMappers.js +0 -59
  462. package/build/temporalMappers.js.map +0 -1
  463. package/build/typeMap.d.ts +0 -68
  464. package/build/typeMap.d.ts.map +0 -1
  465. package/build/typeMap.js +0 -3
  466. package/build/typeMap.js.map +0 -1
  467. package/build/unnest.d.ts +0 -13
  468. package/build/unnest.d.ts.map +0 -1
  469. package/build/unnest.js +0 -85
  470. package/build/unnest.js.map +0 -1
  471. package/build/upsert.d.ts +0 -42
  472. package/build/upsert.d.ts.map +0 -1
  473. package/build/upsert.js +0 -265
  474. package/build/upsert.js.map +0 -1
  475. package/build/utils.d.ts +0 -58
  476. package/build/utils.d.ts.map +0 -1
  477. package/build/utils.js +0 -236
  478. package/build/utils.js.map +0 -1
  479. package/build/withLoaded.d.ts +0 -56
  480. package/build/withLoaded.d.ts.map +0 -1
  481. package/build/withLoaded.js +0 -76
  482. package/build/withLoaded.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"partitionHint.js","sourceRoot":"","sources":["../../src/preloading/partitionHint.ts"],"names":[],"mappings":";;AAQA,sCAwCC;AA/CD,oDAAiD;AAEjD,sDAAqE;AACrE,4CAAqD;AACrD,6CAA0C;AAE1C,8DAA8D;AAC9D,SAAgB,aAAa,CAC3B,IAAgC,EAChC,IAAmB;IAEnB,IAAI,GAAG,GAAoC,SAAS,CAAC;IACrD,IAAI,GAAG,GAAoC,SAAS,CAAC;IACrD,KAAK,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAA,8BAAa,EAAC,IAAI,CAAC,CAAC,EAAE,CAAC;QACjE,MAAM,KAAK,GAAG,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC;QACnC,IAAI,KAAK,IAAI,IAAA,uBAAU,EAAC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC;YACrC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,aAAa,EAAE,EAAE,OAAO,CAAC,CAAC;YACnE,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;YAClD,IAAI,IAAI;gBAAE,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;QACxD,CAAC;aAAM,C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AC,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC"}
@@ -1,129 +0,0 @@
1
- import { Entity } from "./Entity";
2
- import { MaybeAbstractEntityConstructor } from "./EntityManager";
3
- import { EntityMetadata } from "./EntityMetadata";
4
- import { Changes } from "./changes";
5
- import { Loadable, Loaded, LoadHint } from "./loadHints";
6
- import { NormalizeHint, SuffixSeperator } from "./normalizeHints";
7
- import { AsyncProperty, Collection, LoadedCollection, LoadedProperty, LoadedReadOnlyCollection, LoadedReference, OneToOneReference, PolymorphicReference, ReactiveGetter, ReadOnlyCollection, Reference } from "./relations";
8
- import { LoadedOneToOneReference } from "./relations/OneToOneReference";
9
- import { FieldsOf, RelationsOf } from "./typeMap";
10
- /** The keys in `T` that rules & hooks can react to. */
11
- export type Reactable<T extends Entity> = FieldsOf<T> & Loadable<T> & Gettable<T> & SuffixedFieldsOf<T> & SuffixedLoadable<T> & SuffixedGettable<T>;
12
- /** Finds `hasReactiveGetters` which are not "loadable" b/c they're always loaded. */
13
- export type Gettable<T extends Entity> = {
14
- -readonly [K in keyof T as GettableValue<T[K]> extends never ? never : K]: GettableValue<T[K]>;
15
- };
16
- type GettableValue<V> = V extends ReactiveGetter<any, infer P> ? P : never;
17
- /** The fields of `T` suffixed with `:ro` or `_ro`. */
18
- type SuffixedFieldsOf<T extends Entity> = {
19
- [K in keyof FieldsOf<T> & string as `${K}${SuffixSeperator}ro`]: FieldsOf<T>[K];
20
- };
21
- type SuffixedLoadable<T extends Entity> = {
22
- [K in keyof Loadable<T> & string as `${K}${SuffixSeperator}ro`]: Loadable<T>[K];
23
- };
24
- type SuffixedGettable<T extends Entity> = {
25
- [K in keyof Gettable<T> & string as `${K}${SuffixSeperator}ro`]: Gettable<T>[K];
26
- };
27
- /**
28
- * A reactive hint of a single key, multiple keys, or nested keys and sub-hints.
29
- *
30
- * Reactive hints are different from load hints in that reactive hints include specific
31
- * fields to react against, while load hints contain only relations, collections, and async
32
- * properties to preload.
33
- */
34
- export type ReactiveHint<T extends Entity> = (keyof Reactable<T> & string) | ReadonlyArray<keyof Reactable<T> & string> | NestedReactiveHint<T>;
35
- export type NestedReactiveHint<T extends Entity> = {
36
- [K in keyof Reactable<T>]?: Reactable<T>[K] extends infer U extends Entity ? ReactiveHint<U> : {};
37
- };
38
- /** Given an entity `T` that is being reacted with hint `H`, mark only the `H` attributes visible & populated. */
39
- export type Reacted<T extends Entity, H> = Entity & {
40
- [K in keyof NormalizeHint<H> & keyof T]: T[K] extends OneToOneReference<any, infer U> ? LoadedOneToOneReference<T, Entity & Reacted<U, NormalizeHint<H>[K]>> : T[K] extends PolymorphicReference<any, infer U, infer N> ? PolymorphicReference<T, U, N> & LoadedReference<T, Entity & Reacted<U, NormalizeHint<H>[K]>, N> : T[K] extends Reference<any, infer U, infer N> ? LoadedReference<T, Entity & Reacted<U, NormalizeHint<H>[K]>, N> : T[K] extends Collection<any, infer U> ? LoadedCollection<T, Entity & Reacted<U, NormalizeHint<H>[K]>> : T[K] extends ReadOnlyCollection<any, infer U> ? LoadedReadOnlyCollection<T, Entity & Reacted<U, NormalizeHint<H>[K]>> : T[K] extends AsyncProperty<any, infer V> ? LoadedProperty<any, V> : T[K];
41
- } & {
42
- /**
43
- * Gives reactive rules & fields a way to get the full entity if they really need it.
44
- *
45
- * This should be used carefully b/c it will side-step the reactive system, and instead
46
- * reactive rules & fields should explicitly declare access to the fields they need, which
47
- * will then allow accessing the field via the `Reacted<Author, ...>` type.
48
- */
49
- fullNonReactiveAccess: Loaded<T, H>;
50
- /** Allow detecting if a reactive change is due to nuances like `hasUpdated` or `hasChanged`. */
51
- changes: Changes<T, keyof (FieldsOf<T> & RelationsOf<T>), keyof NormalizeHint<H>>;
52
- } & MaybeTransientFields<T>;
53
- /** Allow returning reacted entities from `hasReactiveReference`. */
54
- export type MaybeReactedEntity<V> = V extends Entity ? {
55
- fullNonReactiveAccess: V;
56
- } : V;
57
- /**
58
- * Allow returning reacted entities from `hasReactiveAsyncProperty`.
59
- *
60
- * The `MaybeReactedEntity` is used by `hasReactiveReference` which already has `undefined | never`
61
- * broken out as a separate generic; `hasReactiveAsyncProperty` does not, and so this type conditionally
62
- * pulls `undefined` out first, and then defers to `MaybeReactedEntity`.
63
- */
64
- export type MaybeReactedPropertyEntity<V> = V extends (infer V1 extends Entity) | undefined ? MaybeReactedEntity<V1> | undefined : MaybeReactedEntity<V>;
65
- /**
66
- * A reactive hint that only allows fields immediately on the entity, i.e. no nested hints.
67
- *
68
- * This is used by `ReactiveGetter`s to guarantee that their lambda functions will
69
- * always be `.get`-able and hence not need loading.
70
- */
71
- export type ShallowReactiveHint<T extends Entity> = (keyof FieldsOf<T> & string) | ReadonlyArray<keyof FieldsOf<T> & string>;
72
- /** If the domain model has transient fields, allow reactive behavior to see it, i.e. don't run validation rules for special operations. */
73
- export type MaybeTransientFields<T> = "transientFields" extends keyof T ? {
74
- transientFields: T["transientFields"];
75
- } : {};
76
- /**
77
- * Takes a reactive hint and returns the `ReactiveTarget`s that, should they change, need to
78
- * walk back to this watching reactable.
79
- *
80
- * @param rootType The original type that contained the reactive rule/field, used for helpful error messages
81
- * @param entityType The current entity of the step we're walking
82
- * @param hint The current hint we're walking
83
- * @param reactForOtherSide the name of our FK column, if the previous collection needs to react to our FK changing
84
- * @param isFirst
85
- */
86
- export declare function reverseReactiveHint<T extends Entity>(rootType: MaybeAbstractEntityConstructor<T>, entityType: MaybeAbstractEntityConstructor<T>, hint: ReactiveHint<T>, reactForOtherSide?: string, reactForOtherSideIsReadOnly?: "field-read-only" | "hint-read-only" | false, isFirst?: boolean): ReactiveTarget[];
87
- /**
88
- * Walks `reverseHint` for every entity in `entities`.
89
- *
90
- * I.e. given `[book1, book2]` and `["author", 'publisher"]`, will return all the books' authors' publishers.
91
- *
92
- * Note that for references (and only references), we walk both through "the current value"
93
- * and "the original value". This is fundamentally because references are the true "owner"
94
- * of the relation, while collections are derived.
95
- *
96
- * For example, with reversals walking through collections:
97
- *
98
- * - Given a hint `book: { author: firstName }`
99
- * - Which reverses to `author[firstName] -> books`
100
- * - When we walk through `a1.books`, we use only the current value, which might have only `[b2]` in it.
101
- * - We don't need to worry about "the old a1.books" value, which might have previously had `[b1]` in it,
102
- * because the `b1.author` changing authors (from `a1` to `a2`) will trigger its own reactivity.
103
- *
104
- * Contrast with reversals walking through references:
105
- *
106
- * - Given a hint `author: { books: "title" }`
107
- * - Which reverses to `book[title] -> author`
108
- * - When we traverse through `b1.author`, we use both the current value and original value, so that both
109
- * "our prior author" and "our new author" see their latest `author.books` collection values.
110
- */
111
- export declare function followReverseHint(reactionName: string, entities: Entity[], reverseHint: string[]): Promise<Entity[]>;
112
- /** Converts a normalized reactive `hint` into a load hint. */
113
- export declare function convertToLoadHint<T extends Entity>(meta: EntityMetadata, hint: ReactiveHint<T>, allowCustomKeys?: boolean): LoadHint<T>;
114
- /** An entity that, when `fields` change, should trigger the reactive rule/field pointed to by `path`. */
115
- export interface ReactiveTarget {
116
- kind: "read-only" | "update";
117
- /** The entity that contains a field our reactive rule/field accesses. */
118
- entity: MaybeAbstractEntityConstructor<any>;
119
- /** The field(s) that our reactive rule/field accesses, plus any implicit fields like FKs. */
120
- fields: string[];
121
- /** The path from this `entity` back to the source reactive rule/field. */
122
- path: string[];
123
- }
124
- export declare function isPolyHint(key: string): boolean;
125
- export declare function splitPolyHintToKeyAndType(key: string): [string, string];
126
- /** If this hint is a poly like `author@Book`, return the type, otherwise return undefined. */
127
- export declare function getRelationFromMaybePolyKey(entity: Entity, key: string): any;
128
- export {};
129
- //# sourceMappingURL=reactiveHints.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reactiveHints.d.ts","sourceRoot":"","sources":["../src/reactiveHints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAoB,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AACnF,OAAO,EACL,cAAc,EASf,MAAM,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AC,EACrB,iBAAiB,CAAC,EAAE,MAAM,EAC1B,2BAA2B,CAAC,EAAE,iBAAiB,GAAG,gBAAgB,GAAG,KAAK,EAC1E,OAAO,GAAE,OAAc,GACtB,cAAc,EAAE,CA8ClB;AAqMD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,iBAAiB,CACrC,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAAE,EAClB,WAAW,EAAE,MAAM,EAAE,GACpB,OAAO,CAAC,MAAM,EAAE,CAAC,CAmEnB;AAED,8DAA8D;AAC9D,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAChD,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,EACrB,eAAe,UAAQ,GACtB,QAAQ,CAAC,CAAC,CAAC,CAgEb;AAED,yGAAyG;AACzG,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,WAAW,GAAG,QAAQ,CAAC;IAC7B,yEAAyE;IACzE,MAAM,EAAE,8BAA8B,CAAC,GAAG,CAAC,CAAC;IAC5C,6FAA6F;IAC7F,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,0EAA0E;IAC1E,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AA8BD,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE/C;AAED,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAGvE;AAED,8FAA8F;AAC9F,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,GAAG,CAU5E"}
@@ -1,458 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.reverseReactiveHint = reverseReactiveHint;
4
- exports.followReverseHint = followReverseHint;
5
- exports.convertToLoadHint = convertToLoadHint;
6
- exports.isPolyHint = isPolyHint;
7
- exports.splitPolyHintToKeyAndType = splitPolyHintToKeyAndType;
8
- exports.getRelationFromMaybePolyKey = getRelationFromMaybePolyKey;
9
- const EntityManager_1 = require("./EntityManager");
10
- const EntityMetadata_1 = require("./EntityMetadata");
11
- const configure_1 = require("./configure");
12
- const fields_1 = require("./fields");
13
- const getProperties_1 = require("./getProperties");
14
- const normalizeHints_1 = require("./normalizeHints");
15
- const relations_1 = require("./relations");
16
- const ReactiveGetter_1 = require("./relations/ReactiveGetter");
17
- const RecursiveCollection_1 = require("./relations/RecursiveCollection");
18
- const utils_1 = require("./utils");
19
- /**
20
- * Takes a reactive hint and returns the `ReactiveTarget`s that, should they change, need to
21
- * walk back to this watching reactable.
22
- *
23
- * @param rootType The original type that contained the reactive rule/field, used for helpful error messages
24
- * @param entityType The current entity of the step we're walking
25
- * @param hint The current hint we're walking
26
- * @param reactForOtherSide the name of our FK column, if the previous collection needs to react to our FK changing
27
- * @param isFirst
28
- */
29
- function reverseReactiveHint(rootType, entityType, hint, reactForOtherSide, reactForOtherSideIsReadOnly, isFirst = true) {
30
- const meta = (0, EntityMetadata_1.getMetadata)(entityType);
31
- // This is the list of fields for this `entityType` that we will react to their changing values
32
- const fields = [];
33
- const readOnlyFields = [];
34
- const maybeRecursive = [];
35
- // If the hint before us was a collection, i.e. { books: ["title"] }, besides just reacting
36
- // to our `title` changing, `reactForOtherSide` tells us to react to our `author` field as well.
37
- if (reactForOtherSide) {
38
- const _fields = reactForOtherSideIsReadOnly ? readOnlyFields : fields;
39
- _fields.push(reactForOtherSide);
40
- if (meta.timestampFields?.deletedAt) {
41
- _fields.push(meta.timestampFields.deletedAt);
42
- }
43
- }
44
- // Look through the hint for our own fields, i.e. `["firstName", "lastName]`, and nested hints like `{ books: "title" }`.
45
- const subHintTargets = Object.entries((0, normalizeHints_1.normalizeHint)(hint)).flatMap(([keyMaybeSuffix, subHint]) => {
46
- return reverseSubHint(rootType, entityType, hint, meta,
47
- // Pass fields & readOnlyFields, so `reverseSubHint` can append any of our primitive fields it finds
48
- fields, readOnlyFields, maybeRecursive, keyMaybeSuffix, // maybeSuffix = might end with `_ro` like `name_ro`
49
- subHint);
50
- });
51
- const myTargets = [];
52
- // If any of our primitives (or m2o fields) change, establish a reactive path from "here" (entityType)
53
- // that is initially empty (path: []) but will have paths layered on by upstream callers
54
- if (fields.length > 0 || isFirst || reactForOtherSideIsReadOnly === "field-read-only") {
55
- myTargets.push({ kind: "update", entity: entityType, fields, path: [] });
56
- }
57
- // Normally read-only fields don't trigger true async reactivity, but IsLoadedCache
58
- // needs them for same-EM cache invalidation.
59
- if (readOnlyFields.length > 0) {
60
- myTargets.push({ kind: "read-only", entity: entityType, fields: readOnlyFields, path: [] });
61
- }
62
- return [...myTargets, ...maybeRecursive, ...subHintTargets];
63
- }
64
- function reverseSubHint(rootType, entityType, hint, meta, fields, readOnlyFields, maybeRecursive, keyMaybeSuffix, subHint) {
65
- const key = keyMaybeSuffix.replace(normalizeHints_1.suffixRe, "");
66
- const field = meta.allFields[key];
67
- const isReadOnly = !!keyMaybeSuffix.match(normalizeHints_1.suffixRe) || (field && field.immutable);
68
- const _fields = isReadOnly ? readOnlyFields : fields;
69
- if (field) {
70
- switch (field.kind) {
71
- case "m2o": {
72
- // If this is a ReactiveReference, maybe we do something different?
73
- _fields.push(field.fieldName);
74
- const otherMeta = field.otherMetadata();
75
- // If this is a ReactiveReference, it won't have an "other" side, which is fine if:
76
- // - we're only reacting to the RR value itself (and have no sub-hints), or
77
- // - all of our sub-hints are read-only
78
- const otherField = otherMeta.allFields[field.otherFieldName];
79
- if (!otherField && !isAllReadOnly(subHint)) {
80
- throw new Error(`Invalid hint in ${rootType.name}.ts, we don't currently support reacting through ReactiveReferences, ${JSON.stringify(hint)}`);
81
- }
82
- return reverseReactiveHint(rootType, otherMeta.cstr, subHint, undefined, false, false).map(appendPath(maybeAddTypeFilterSuffix(meta, field)));
83
- }
84
- case "poly": {
85
- _fields.push(field.fieldName);
86
- // A poly is basically multiple m2os glued together, so copy/paste the `case m2o` code
87
- // above but do it for each component FK, and glue them together.
88
- return field.components.flatMap((comp) => {
89
- return reverseReactiveHint(rootType, comp.otherMetadata().cstr, subHint, undefined, false, false).map(appendPath(maybeAddTypeFilterSuffix(meta, comp)));
90
- });
91
- }
92
- case "m2m": {
93
- // While o2m and o2o can watch for just FK changes by passing `reactForOtherSide` (the FK lives in the other
94
- // table), for m2m reactivity we push the collection name into the reactive hint, because it's effectively
95
- // "the other/reverse side", and JoinRows will trigger `queueDownstreamReactables` explicitly, instead of
96
- // `setField` which handles regular/non-m2m mutations.
97
- fields.push(field.fieldName);
98
- const otherFieldName = maybeAddTypeFilterSuffix(meta, field);
99
- return reverseReactiveHint(rootType, field.otherMetadata().cstr, subHint,
100
- // For m2m, we can always pass undefined here, as otherwise having the opposite m2m collection
101
- // recalc all of its children will cause over-reactivity
102
- undefined, false, false).map(appendPath(otherFieldName));
103
- }
104
- case "o2m":
105
- case "o2o": {
106
- const isOtherReadOnly = field.otherMetadata().allFields[field.otherFieldName].immutable;
107
- const otherFieldName = maybeAddTypeFilterSuffix(meta, field);
108
- // This is not a field, but we want our reverse side to be reactive, so pass reactForOtherSide
109
- return reverseReactiveHint(rootType, field.otherMetadata().cstr, subHint,
110
- // IsLoadedCache invalidation always needs to know the otherField name, so we must
111
- // end up with either a kind=update or kind=read-only target with `otherFieldName` in it.
112
- field.otherFieldName,
113
- // We can have three outcomes:
114
- // - kind=update fields=[otherFieldName] (normal behavior)
115
- // - kind=update fields=[] + kind=read-only fields=[otherFieldName] (isOtherReadOnly)
116
- // - kind=read-only fields=[otherFieldName] (hint isReadOnly)
117
- isReadOnly ? "hint-read-only" : isOtherReadOnly ? "field-read-only" : false, false).map(appendPath(otherFieldName));
118
- }
119
- case "primaryKey":
120
- case "primitive":
121
- case "enum":
122
- _fields.push(key);
123
- return [];
124
- default:
125
- throw new Error(`Invalid hint in ${rootType.name}.ts hint ${JSON.stringify(hint)}`);
126
- }
127
- }
128
- else {
129
- // We only need to look for ReactiveAsyncProperties here, because ReactiveFields & ReactiveReferences
130
- // have underlying primitive fields that, when/if they change, will be handled in the ^ code.
131
- //
132
- // I.e. we specifically don't need to handle RFs & RRs ^, because the EntityManager.flush loop will
133
- // notice their primitive values changing, and kicking off any downstream reactive fields as necessary.
134
- const p = (0, getProperties_1.getProperties)(meta)[key];
135
- if (p instanceof relations_1.AsyncPropertyImpl) {
136
- // If the field is marked as readonly (i.e. using the `_ro` suffix), then we can assume that applies to its
137
- // entire hint as well and can simply omit it. This also allows us to use non-reactive async props as long as
138
- // they are readonly.
139
- if (isReadOnly)
140
- return [];
141
- if (!p.reactiveHint) {
142
- throw new Error(`AsyncProperty ${key} cannot be used in reactive hints in ${rootType.name}.ts hint ${JSON.stringify(hint)}, please use hasReactiveAsyncProperty instead`);
143
- }
144
- return reverseReactiveHint(rootType, meta.cstr, p.reactiveHint, undefined, false, false);
145
- }
146
- else if (p instanceof ReactiveGetter_1.ReactiveGetterImpl) {
147
- // If the field is marked as readonly, then we can assume that applies to its entire hint as well and can
148
- // simply omit it.
149
- if (isReadOnly)
150
- return [];
151
- return reverseReactiveHint(rootType, meta.cstr, p.reactiveHint, undefined, false, false);
152
- }
153
- else if (p instanceof RecursiveCollection_1.RecursiveParentsCollectionImpl) {
154
- // I.e. if this is `Author.mentorsRecursive`:
155
- // - fieldName=mentorsRecursive (being watched by the caller)
156
- // - otherFieldName=menteesRecursive (our reversal for walking down)
157
- // - m2oFieldName = mentor
158
- //
159
- // Note that "reversing parents" is generally easier, b/c when the tree changes, any given node can
160
- // still "walk down" to find its children w/the "current value" childrenRecursive; and any just-now
161
- // orphaned parents will themselves trigger their own childrenRecursive changes (i.e. we do not need
162
- // any "old reference value" / "new reference value" handling).
163
- //
164
- // I.e. given a tree of `A is mentor of B is mentor of C`, when B changes mentors, and we need to
165
- // "walk to all affected/children mentees, so they can observe their new mentorsRecursive", merely
166
- // walking down from (b itself & it's mentees) will find all affected mentees.
167
- const { otherFieldName, m2oFieldName } = p;
168
- // When a mentor.firstName/etc field changes, walk to its transitive children (through otherFieldName)
169
- // via the `return reverseReactiveHint` line below.
170
- //
171
- // But if the `author.mentor` field itself changes, we ourselves are also "a new mentee" of the mentor, so
172
- // do `fields.push(m2oFieldName)` to notify our direct reactable (a new mentee), and then our transitive
173
- // children/mentees. This avoids going "up to the mentor, and walking down all of his mentees", which would go
174
- // through our siblings, which would not have changed/need reactivity.
175
- _fields.push(m2oFieldName);
176
- maybeRecursive.push({
177
- kind: isReadOnly ? "read-only" : "update",
178
- entity: entityType,
179
- fields: [m2oFieldName],
180
- path: [otherFieldName],
181
- });
182
- // Any reactables who were watching `parentsRecursive`, we'll back down to by going through `childrenRecursive`
183
- return reverseReactiveHint(rootType, entityType, subHint, undefined, false).map(appendPath(otherFieldName));
184
- }
185
- else if (p instanceof RecursiveCollection_1.RecursiveChildrenCollectionImpl) {
186
- const { otherFieldName, o2mFieldName } = p;
187
- // I.e. this is `Author.menteesRecursive`
188
- // - fieldName=menteesRecursive` (being watched by the caller)
189
- // - otherFieldName=mentorsRecursive` (our reversal for walking up)
190
- // - The o2m's otherFieldName gives us the FK field (e.g., "mentor") on the child entity.
191
- //
192
- // Note that "reversing children" is trickier than reversing parents, b/c when the tree changes,
193
- // we need to consider both "old reference value" and "new reference value" scenarios.
194
- const o2mField = meta.allFields[o2mFieldName];
195
- const m2oFieldName = o2mField.otherFieldName;
196
- _fields.push(m2oFieldName);
197
- maybeRecursive.push({
198
- kind: isReadOnly ? "read-only" : "update",
199
- entity: entityType,
200
- fields: [m2oFieldName], // i.e. parent
201
- path: [otherFieldName], // i.e. parentsRecursive to tell them "observe your new childrenRecursive"
202
- });
203
- // Any reactables who were watching `childrenRecursive`, we'll up to by going through `parentsRecursive`
204
- return reverseReactiveHint(rootType, entityType, subHint, undefined, false).map(appendPath(otherFieldName));
205
- }
206
- else {
207
- throw new Error(`Invalid hint in ${rootType.name}.ts ${JSON.stringify(hint)}`);
208
- }
209
- }
210
- }
211
- function maybeAddTypeFilterSuffix(meta, field) {
212
- const otherField = field.otherMetadata().allFields[field.otherFieldName];
213
- if (!otherField) {
214
- // This is usually an error, unless if its ReactiveReference which we don't create o2m-s for
215
- const isReactiveReference = "kind" in field && field.kind === "m2o" && field.derived === "async";
216
- if (!isReactiveReference)
217
- (0, utils_1.fail)(`No field ${field.otherMetadata().type}.${field.otherFieldName}`);
218
- return field.otherFieldName;
219
- }
220
- // If we're Foo, and the other field (which we'll traverse back from at runtime) is actually
221
- // a poly FK pointing back to multiple `owner=Foo | Bar | Zaz`, add a suffix of `@Foo` so
222
- // that any runtime traversal that hit `owner` and see a `Bar | Zaz` will stop.
223
- const nextFieldIsPoly = otherField.kind === "poly";
224
- // If we're a SubType, and the other field points to our base type, assume there might be
225
- // SubType-specific fields in the path so far, so tell the other side to only walk back through
226
- // us if its value is actually a SubType.
227
- const nextFieldPointsToBaseType = !!meta.baseType && otherField.kind !== "poly" && otherField.otherMetadata().cstr !== meta.cstr;
228
- return nextFieldIsPoly || nextFieldPointsToBaseType ? `${field.otherFieldName}@${meta.type}` : field.otherFieldName;
229
- }
230
- /**
231
- * Walks `reverseHint` for every entity in `entities`.
232
- *
233
- * I.e. given `[book1, book2]` and `["author", 'publisher"]`, will return all the books' authors' publishers.
234
- *
235
- * Note that for references (and only references), we walk both through "the current value"
236
- * and "the original value". This is fundamentally because references are the true "owner"
237
- * of the relation, while collections are derived.
238
- *
239
- * For example, with reversals walking through collections:
240
- *
241
- * - Given a hint `book: { author: firstName }`
242
- * - Which reverses to `author[firstName] -> books`
243
- * - When we walk through `a1.books`, we use only the current value, which might have only `[b2]` in it.
244
- * - We don't need to worry about "the old a1.books" value, which might have previously had `[b1]` in it,
245
- * because the `b1.author` changing authors (from `a1` to `a2`) will trigger its own reactivity.
246
- *
247
- * Contrast with reversals walking through references:
248
- *
249
- * - Given a hint `author: { books: "title" }`
250
- * - Which reverses to `book[title] -> author`
251
- * - When we traverse through `b1.author`, we use both the current value and original value, so that both
252
- * "our prior author" and "our new author" see their latest `author.books` collection values.
253
- */
254
- async function followReverseHint(reactionName, entities, reverseHint) {
255
- // Start at the current (unique) entities
256
- let current = new Set(entities);
257
- const paths = [...reverseHint];
258
- // And "walk backwards" through the reverse hint
259
- while (paths.length) {
260
- const path = paths.shift();
261
- const [fieldName, viaType] = path.split("@");
262
- const promises = new Array(current.size);
263
- // The path might touch either a reference or a collection
264
- for (const c of current) {
265
- const relation = c[fieldName];
266
- // If `!relation`, I'd really like to `fail`, but atm we're knowingly creating invalid reversals for when
267
- // a ReactiveField depends on a ReactiveReference; b/c RRs lack an "other side", we cannot walk them in
268
- // reverse, and so for awhile we "supported" the RF -> RR pattern by relying on a totally-read-only reactive
269
- // hint -> dropped during reversal.
270
- //
271
- // However, now IsLoadedCache means that even these "totally read only" RFs need to be reactive at least
272
- // during their initial EM creation, to avoid stale values being observed during first-flush mutations,
273
- // and so we're now stuck with these "invalid RR reversals" until we can figure out a better way to handle them.
274
- // (Now that IsLoadedCache doesn't technically walk paths, it just invalidates given entity+field pairs, so
275
- // it is not bothered by an invalid/missing RR reversal.)
276
- if (!relation)
277
- continue;
278
- // fail(`Attempting to react for ${reactionName} for ${c.toString()}, but there is no "reverse walkable" field ${c.constructor.name}.${fieldName}`,);
279
- const currentValuePromise = maybeApplyTypeFilter(relation.load(), viaType);
280
- // Always wait for the relation itself
281
- promises.push(currentValuePromise);
282
- // If we're going from Book.author back to Author to re-validate the Author.books collection,
283
- // see if Book.author has changed, so we can re-validate both the old author's books and the
284
- // new author's books.
285
- const fieldKind = (0, EntityMetadata_1.getMetadata)(c).fields[fieldName]?.kind;
286
- const isReference = fieldKind === "m2o" || fieldKind === "poly";
287
- const isManyToMany = fieldKind === "m2m";
288
- const changed = (0, fields_1.isChangeableField)(c, fieldName) ? c.changes[fieldName] : undefined;
289
- // See jsdoc comment about why this is only necessary for references...
290
- if (isReference && changed && changed.hasUpdated && changed.originalValue) {
291
- promises.push(maybeApplyTypeFilter(changed.originalEntity, viaType));
292
- }
293
- if (isManyToMany) {
294
- const m2m = c[fieldName];
295
- const joinRows = (0, EntityManager_1.getEmInternalApi)(m2m.entity.em).joinRows(m2m);
296
- // Return a tuple of [currentRows, removedRows]
297
- promises.push(joinRows.removedFor(m2m, c));
298
- }
299
- // Walk up the old parents
300
- if (relation instanceof RecursiveCollection_1.RecursiveParentsCollectionImpl) {
301
- const { m2oFieldName } = relation;
302
- const changed = (0, fields_1.isChangeableField)(c, m2oFieldName) ? c.changes[m2oFieldName] : undefined;
303
- if (changed && changed.hasUpdated && changed.originalValue) {
304
- promises.push(
305
- // First load the original parent itself
306
- changed.originalEntity.then((oldParent) => {
307
- // And then resolve its fieldName=parentsRecursive
308
- const oldParentRecursiveParents = oldParent[fieldName];
309
- return oldParentRecursiveParents.load().then((parents) => {
310
- return [oldParent, ...parents];
311
- });
312
- }));
313
- }
314
- }
315
- }
316
- const nextLevel = await Promise.all(promises);
317
- // Make a new set so that we dedupe as we go
318
- current = (0, utils_1.flatAndUnique)(nextLevel);
319
- }
320
- return [...current];
321
- }
322
- /** Converts a normalized reactive `hint` into a load hint. */
323
- function convertToLoadHint(meta, hint, allowCustomKeys = false) {
324
- const loadHint = {};
325
- // Process the hints individually instead of just calling Object.fromEntries so that
326
- // we can handle inlined reactive hints that overlap.
327
- for (const [keyMaybeSuffix, subHint] of Object.entries((0, normalizeHints_1.normalizeHint)(hint))) {
328
- let key = keyMaybeSuffix.replace(normalizeHints_1.suffixRe, "");
329
- let field = meta.allFields[key];
330
- // If `allowCustomKeys` is enabled, we're probably doing `toJSON`,
331
- // so look for `companyId` & `companyIds` to turn into `company`
332
- if (!field && allowCustomKeys) {
333
- const realField = Object.values(meta.allFields).find((f) => f.fieldIdName === key);
334
- if (realField) {
335
- field = realField;
336
- key = realField.fieldName;
337
- }
338
- }
339
- if (field) {
340
- switch (field.kind) {
341
- case "m2m":
342
- case "m2o":
343
- case "o2m":
344
- case "o2o":
345
- (0, utils_1.mergeNormalizedHints)(loadHint, { [key]: convertToLoadHint(field.otherMetadata(), subHint, allowCustomKeys) });
346
- break;
347
- case "poly":
348
- for (const comp of field.components) {
349
- // Write `{ parent: { child@Type: hint } }` into the load hint
350
- (0, utils_1.mergeNormalizedHints)(loadHint, {
351
- [key]: Object.fromEntries(Object.entries(convertToLoadHint(comp.otherMetadata(), subHint, allowCustomKeys)).map(
352
- // Map the subHint keys to add in `@Type`
353
- ([subKey, subHint]) => [`${subKey}@${comp.otherMetadata().type}`, subHint])),
354
- });
355
- }
356
- break;
357
- case "primitive":
358
- case "enum":
359
- if (field.derived === "async") {
360
- (0, utils_1.mergeNormalizedHints)(loadHint, { [key]: {} });
361
- }
362
- continue;
363
- case "primaryKey":
364
- continue;
365
- default:
366
- throw new Error(`Invalid reactive hint ${meta.tableName} ${JSON.stringify(hint)}`);
367
- }
368
- }
369
- else {
370
- const p = (0, getProperties_1.getProperties)(meta)[key];
371
- if (p instanceof RecursiveCollection_1.RecursiveParentsCollectionImpl) {
372
- (0, utils_1.mergeNormalizedHints)(loadHint, { [p.fieldName]: convertToLoadHint(meta, subHint, allowCustomKeys) });
373
- }
374
- else if (p instanceof RecursiveCollection_1.RecursiveChildrenCollectionImpl) {
375
- (0, utils_1.mergeNormalizedHints)(loadHint, { [p.fieldName]: convertToLoadHint(meta, subHint, allowCustomKeys) });
376
- }
377
- else if (p && p.reactiveHint) {
378
- (0, utils_1.mergeNormalizedHints)(loadHint, convertToLoadHint(meta, p.reactiveHint, allowCustomKeys));
379
- }
380
- else if (!allowCustomKeys) {
381
- (0, utils_1.fail)(`Invalid reactive hint on ${meta.tableName} ${JSON.stringify(hint)}`);
382
- }
383
- }
384
- }
385
- return loadHint;
386
- }
387
- function maybeApplyTypeFilter(loadPromise, viaType) {
388
- if (viaType) {
389
- return loadPromise.then((loaded) => {
390
- if (Array.isArray(loaded)) {
391
- return loaded.filter((e) => isTypeOrSubType(e, viaType));
392
- }
393
- else if (loaded && isTypeOrSubType(loaded, viaType)) {
394
- return loaded;
395
- }
396
- else {
397
- return undefined;
398
- }
399
- });
400
- }
401
- return loadPromise;
402
- }
403
- /** Handle `viaType` filtering with subtype awareness. */
404
- function isTypeOrSubType(entity, typeName) {
405
- const meta = (0, EntityMetadata_1.getMetadata)(entity);
406
- // Easy check for the name is the same
407
- if (meta.type === typeName)
408
- return true;
409
- // Otherwise see if the entity is a subtype of the typeName, i.e. if our poly/type
410
- // filter is `@Publisher`, and we're a `SmallPublisher`, that's valid to traverse.
411
- for (const other of (0, EntityMetadata_1.getSubMetas)((0, configure_1.getMetadataForType)(typeName))) {
412
- if (other.type === typeName)
413
- return true;
414
- }
415
- return false;
416
- }
417
- function isPolyHint(key) {
418
- return key.includes("@");
419
- }
420
- function splitPolyHintToKeyAndType(key) {
421
- const [k, type] = key.split("@");
422
- return [k, type];
423
- }
424
- /** If this hint is a poly like `author@Book`, return the type, otherwise return undefined. */
425
- function getRelationFromMaybePolyKey(entity, key) {
426
- if (isPolyHint(key)) {
427
- const [realKey, typeName] = splitPolyHintToKeyAndType(key);
428
- // Even though `entity[realKey]` might exist, if it's from a different poly type, we don't want it
429
- const isApplicable = (0, EntityMetadata_1.getBaseAndSelfMetas)((0, EntityMetadata_1.getMetadata)(entity)).some((meta) => meta.type === typeName);
430
- if (!isApplicable)
431
- return undefined;
432
- return entity[realKey];
433
- }
434
- else {
435
- return entity[key];
436
- }
437
- }
438
- /**
439
- * For an `author -> books -> bookReviews` hint, appends `BookReview.book`, `Book.author`,
440
- * i.e. the "other side" relation, to the reversed path on the way "out" from a mutated BookReview
441
- * to the target `Author` RF/RR/rule.
442
- */
443
- function appendPath(reverseField) {
444
- return (rt) => {
445
- // We can mutate this array b/c it's only owned by a single/continually-updated `ReactiveTarget`
446
- rt.path = [...rt.path, reverseField];
447
- return rt;
448
- };
449
- }
450
- function isAllReadOnly(hint) {
451
- for (const [key, subHint] of Object.entries((0, normalizeHints_1.normalizeHint)(hint))) {
452
- const okay = (key.endsWith("_ro") || key.endsWith(":ro")) && isAllReadOnly(subHint);
453
- if (!okay)
454
- return false;
455
- }
456
- return true;
457
- }
458
- //# sourceMappingURL=reactiveHints.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reactiveHints.js","sourceRoot":"","sources":["../src/reactiveHints.ts"],"names":[],"mappings":";;AA6JA,kDAqDC;AA6ND,8CAuEC;AAGD,8CAoEC;AAyCD,gCAEC;AAED,8DAGC;AAGD,kEAUC;AAznBD,mDAAmF;AACnF,qDAU0B;AAE1B,2CAAiD;AACjD,qCAA6C;AAC7C,mDAAgD;AAEhD,qDAA2F;AAC3F,2CAcqB;AAErB,+DAAgE;AAChE,yEAAkH;AAElH,mCAAoE;AA6GpE;;;;;;;;;GASG;AACH,SAAgB,mBAAmB,CACjC,QAA2C,EAC3C,UAA6C,EAC7C,IAAqB,EACrB,iBAA0B,EAC1B,2BAA0E,EAC1E,UAAmB,IAAI;IAEvB,MAAM,IAAI,GAAG,IAAA,4BAAW,EAAC,UAAU,CAAC,CAAC;IACrC,+FAA+F;IAC/F,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,MAAM,cAAc,GAAa,EAAE,CAAC;IACpC,MAAM,cAAc,GAAqB,EAAE,CAAC;IAE5C,2FAA2F;IAC3F,gGAAgG;IAChG,IAAI,iBAAiB,EAAE,CAAC;QACtB,MAAM,OAAO,GAAG,2BAA2B,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC;QACtE,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAChC,IAAI,IAAI,CAAC,eAAe,EAAE,SAAS,EAAE,CAAC;YACpC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IAED,yHAAyH;IACzH,MAAM,cAAc,GAAqB,MAAM,CAAC,OAAO,CAAC,IAAA,8BAAa,EAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,EAAE,OAAO,CAAC,EAAE,EAAE;Q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