@expo/entity 0.60.0 → 0.62.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 (375) hide show
  1. package/build/src/AuthorizationResultBasedEntityAssociationLoader.d.ts +6 -6
  2. package/build/src/AuthorizationResultBasedEntityAssociationLoader.js +5 -10
  3. package/build/src/AuthorizationResultBasedEntityLoader.d.ts +9 -9
  4. package/build/src/AuthorizationResultBasedEntityLoader.js +27 -35
  5. package/build/src/AuthorizationResultBasedEntityMutator.d.ts +13 -13
  6. package/build/src/AuthorizationResultBasedEntityMutator.js +54 -65
  7. package/build/src/ComposedEntityCacheAdapter.d.ts +3 -3
  8. package/build/src/ComposedEntityCacheAdapter.js +15 -23
  9. package/build/src/ComposedSecondaryEntityCache.d.ts +1 -1
  10. package/build/src/ComposedSecondaryEntityCache.js +4 -12
  11. package/build/src/EnforcingEntityAssociationLoader.d.ts +5 -5
  12. package/build/src/EnforcingEntityAssociationLoader.js +6 -11
  13. package/build/src/EnforcingEntityCreator.d.ts +4 -4
  14. package/build/src/EnforcingEntityCreator.js +3 -8
  15. package/build/src/EnforcingEntityDeleter.d.ts +4 -4
  16. package/build/src/EnforcingEntityDeleter.js +3 -8
  17. package/build/src/EnforcingEntityLoader.d.ts +5 -5
  18. package/build/src/EnforcingEntityLoader.js +9 -14
  19. package/build/src/EnforcingEntityUpdater.d.ts +4 -4
  20. package/build/src/EnforcingEntityUpdater.js +3 -8
  21. package/build/src/Entity.d.ts +9 -9
  22. package/build/src/Entity.js +11 -16
  23. package/build/src/EntityAssociationLoader.d.ts +5 -5
  24. package/build/src/EntityAssociationLoader.js +5 -10
  25. package/build/src/EntityCompanion.d.ts +9 -9
  26. package/build/src/EntityCompanion.js +6 -11
  27. package/build/src/EntityCompanionProvider.d.ts +13 -12
  28. package/build/src/EntityCompanionProvider.js +13 -21
  29. package/build/src/EntityConfiguration.d.ts +4 -4
  30. package/build/src/EntityConfiguration.js +14 -23
  31. package/build/src/EntityConstructionUtils.d.ts +8 -8
  32. package/build/src/EntityConstructionUtils.js +15 -23
  33. package/build/src/EntityCreator.d.ts +7 -7
  34. package/build/src/EntityCreator.js +3 -8
  35. package/build/src/EntityDatabaseAdapter.d.ts +4 -4
  36. package/build/src/EntityDatabaseAdapter.js +19 -27
  37. package/build/src/EntityDeleter.d.ts +7 -7
  38. package/build/src/EntityDeleter.js +3 -8
  39. package/build/src/EntityFieldDefinition.d.ts +4 -4
  40. package/build/src/EntityFieldDefinition.js +5 -10
  41. package/build/src/EntityFields.d.ts +2 -1
  42. package/build/src/EntityFields.js +12 -27
  43. package/build/src/EntityInvalidationUtils.d.ts +8 -10
  44. package/build/src/EntityInvalidationUtils.js +5 -10
  45. package/build/src/EntityLoader.d.ts +7 -7
  46. package/build/src/EntityLoader.js +3 -8
  47. package/build/src/EntityLoaderFactory.d.ts +11 -11
  48. package/build/src/EntityLoaderFactory.js +7 -12
  49. package/build/src/EntityMutationInfo.d.ts +2 -2
  50. package/build/src/EntityMutationInfo.js +2 -6
  51. package/build/src/EntityMutationTriggerConfiguration.d.ts +4 -4
  52. package/build/src/EntityMutationTriggerConfiguration.js +2 -8
  53. package/build/src/EntityMutationValidatorConfiguration.d.ts +4 -4
  54. package/build/src/EntityMutationValidatorConfiguration.js +1 -6
  55. package/build/src/EntityMutatorFactory.d.ts +13 -13
  56. package/build/src/EntityMutatorFactory.js +5 -10
  57. package/build/src/EntityPrivacyPolicy.d.ts +7 -7
  58. package/build/src/EntityPrivacyPolicy.js +22 -27
  59. package/build/src/EntityQueryContext.d.ts +1 -1
  60. package/build/src/EntityQueryContext.js +11 -22
  61. package/build/src/EntityQueryContextProvider.d.ts +2 -1
  62. package/build/src/EntityQueryContextProvider.js +7 -12
  63. package/build/src/EntitySecondaryCacheLoader.d.ts +7 -7
  64. package/build/src/EntitySecondaryCacheLoader.js +4 -9
  65. package/build/src/EntityUpdater.d.ts +7 -7
  66. package/build/src/EntityUpdater.js +3 -8
  67. package/build/src/GenericEntityCacheAdapter.d.ts +4 -4
  68. package/build/src/GenericEntityCacheAdapter.js +5 -13
  69. package/build/src/GenericSecondaryEntityCache.d.ts +2 -2
  70. package/build/src/GenericSecondaryEntityCache.js +10 -18
  71. package/build/src/IEntityCacheAdapter.d.ts +2 -2
  72. package/build/src/IEntityCacheAdapter.js +1 -3
  73. package/build/src/IEntityCacheAdapterProvider.d.ts +2 -2
  74. package/build/src/IEntityCacheAdapterProvider.js +1 -3
  75. package/build/src/IEntityDatabaseAdapterProvider.d.ts +2 -2
  76. package/build/src/IEntityDatabaseAdapterProvider.js +1 -3
  77. package/build/src/IEntityGenericCacher.d.ts +2 -2
  78. package/build/src/IEntityGenericCacher.js +1 -3
  79. package/build/src/ReadonlyEntity.d.ts +10 -10
  80. package/build/src/ReadonlyEntity.js +9 -17
  81. package/build/src/ViewerContext.d.ts +6 -6
  82. package/build/src/ViewerContext.js +3 -8
  83. package/build/src/ViewerScopedEntityCompanion.d.ts +8 -8
  84. package/build/src/ViewerScopedEntityCompanion.js +5 -10
  85. package/build/src/ViewerScopedEntityCompanionProvider.d.ts +6 -6
  86. package/build/src/ViewerScopedEntityCompanionProvider.js +3 -8
  87. package/build/src/ViewerScopedEntityLoaderFactory.d.ts +9 -9
  88. package/build/src/ViewerScopedEntityLoaderFactory.js +1 -6
  89. package/build/src/ViewerScopedEntityMutatorFactory.d.ts +7 -7
  90. package/build/src/ViewerScopedEntityMutatorFactory.js +1 -6
  91. package/build/src/entityUtils.d.ts +1 -1
  92. package/build/src/entityUtils.js +9 -21
  93. package/build/src/errors/EntityCacheAdapterError.d.ts +1 -1
  94. package/build/src/errors/EntityCacheAdapterError.js +5 -11
  95. package/build/src/errors/EntityDatabaseAdapterError.d.ts +1 -1
  96. package/build/src/errors/EntityDatabaseAdapterError.js +41 -59
  97. package/build/src/errors/EntityError.js +5 -10
  98. package/build/src/errors/EntityInvalidFieldValueError.d.ts +5 -5
  99. package/build/src/errors/EntityInvalidFieldValueError.js +4 -9
  100. package/build/src/errors/EntityNotAuthorizedError.d.ts +4 -4
  101. package/build/src/errors/EntityNotAuthorizedError.js +6 -11
  102. package/build/src/errors/EntityNotFoundError.d.ts +5 -5
  103. package/build/src/errors/EntityNotFoundError.js +4 -9
  104. package/build/src/index.d.ts +77 -77
  105. package/build/src/index.js +77 -94
  106. package/build/src/internal/CompositeFieldHolder.d.ts +3 -2
  107. package/build/src/internal/CompositeFieldHolder.js +11 -21
  108. package/build/src/internal/CompositeFieldValueMap.d.ts +2 -2
  109. package/build/src/internal/CompositeFieldValueMap.js +7 -12
  110. package/build/src/internal/EntityDataManager.d.ts +6 -6
  111. package/build/src/internal/EntityDataManager.js +25 -33
  112. package/build/src/internal/EntityFieldTransformationUtils.d.ts +1 -1
  113. package/build/src/internal/EntityFieldTransformationUtils.js +11 -23
  114. package/build/src/internal/EntityLoadInterfaces.d.ts +3 -2
  115. package/build/src/internal/EntityLoadInterfaces.js +4 -9
  116. package/build/src/internal/EntityTableDataCoordinator.d.ts +8 -8
  117. package/build/src/internal/EntityTableDataCoordinator.js +4 -9
  118. package/build/src/internal/ReadThroughEntityCache.d.ts +3 -3
  119. package/build/src/internal/ReadThroughEntityCache.js +7 -15
  120. package/build/src/internal/SingleFieldHolder.d.ts +3 -2
  121. package/build/src/internal/SingleFieldHolder.js +9 -19
  122. package/build/src/metrics/EntityMetricsUtils.d.ts +3 -3
  123. package/build/src/metrics/EntityMetricsUtils.js +6 -14
  124. package/build/src/metrics/IEntityMetricsAdapter.d.ts +2 -2
  125. package/build/src/metrics/IEntityMetricsAdapter.js +8 -12
  126. package/build/src/metrics/NoOpEntityMetricsAdapter.d.ts +1 -1
  127. package/build/src/metrics/NoOpEntityMetricsAdapter.js +1 -6
  128. package/build/src/rules/AllowIfAllSubRulesAllowPrivacyPolicyRule.d.ts +5 -5
  129. package/build/src/rules/AllowIfAllSubRulesAllowPrivacyPolicyRule.js +5 -10
  130. package/build/src/rules/AllowIfAnySubRuleAllowsPrivacyPolicyRule.d.ts +5 -5
  131. package/build/src/rules/AllowIfAnySubRuleAllowsPrivacyPolicyRule.js +5 -10
  132. package/build/src/rules/AllowIfInParentCascadeDeletionPrivacyPolicyRule.d.ts +6 -6
  133. package/build/src/rules/AllowIfInParentCascadeDeletionPrivacyPolicyRule.js +6 -11
  134. package/build/src/rules/AlwaysAllowPrivacyPolicyRule.d.ts +5 -5
  135. package/build/src/rules/AlwaysAllowPrivacyPolicyRule.js +3 -8
  136. package/build/src/rules/AlwaysDenyPrivacyPolicyRule.d.ts +5 -5
  137. package/build/src/rules/AlwaysDenyPrivacyPolicyRule.js +3 -8
  138. package/build/src/rules/AlwaysSkipPrivacyPolicyRule.d.ts +5 -5
  139. package/build/src/rules/AlwaysSkipPrivacyPolicyRule.js +3 -8
  140. package/build/src/rules/EvaluateIfEntityFieldPredicatePrivacyPolicyRule.d.ts +5 -5
  141. package/build/src/rules/EvaluateIfEntityFieldPredicatePrivacyPolicyRule.js +3 -8
  142. package/build/src/rules/PrivacyPolicyRule.d.ts +4 -4
  143. package/build/src/rules/PrivacyPolicyRule.js +3 -8
  144. package/build/src/utils/EntityCreationUtils.d.ts +5 -5
  145. package/build/src/utils/EntityCreationUtils.js +6 -11
  146. package/build/src/utils/EntityPrivacyUtils.d.ts +5 -5
  147. package/build/src/utils/EntityPrivacyUtils.js +20 -27
  148. package/build/src/utils/collections/SerializableKeyMap.js +1 -6
  149. package/build/src/utils/collections/maps.js +11 -27
  150. package/build/src/utils/collections/sets.js +1 -5
  151. package/build/src/utils/mergeEntityMutationTriggerConfigurations.d.ts +3 -3
  152. package/build/src/utils/mergeEntityMutationTriggerConfigurations.js +1 -5
  153. package/package.json +8 -7
  154. package/src/AuthorizationResultBasedEntityAssociationLoader.ts +7 -6
  155. package/src/AuthorizationResultBasedEntityLoader.ts +19 -17
  156. package/src/AuthorizationResultBasedEntityMutator.ts +24 -22
  157. package/src/ComposedEntityCacheAdapter.ts +5 -4
  158. package/src/ComposedSecondaryEntityCache.ts +2 -2
  159. package/src/EnforcingEntityAssociationLoader.ts +7 -7
  160. package/src/EnforcingEntityCreator.ts +4 -4
  161. package/src/EnforcingEntityDeleter.ts +4 -4
  162. package/src/EnforcingEntityLoader.ts +8 -8
  163. package/src/EnforcingEntityUpdater.ts +4 -4
  164. package/src/Entity.ts +13 -13
  165. package/src/EntityAssociationLoader.ts +6 -6
  166. package/src/EntityCompanion.ts +13 -10
  167. package/src/EntityCompanionProvider.ts +15 -14
  168. package/src/EntityConfiguration.ts +6 -8
  169. package/src/EntityConstructionUtils.ts +16 -12
  170. package/src/EntityCreator.ts +7 -7
  171. package/src/EntityDatabaseAdapter.ts +6 -6
  172. package/src/EntityDeleter.ts +7 -7
  173. package/src/EntityFieldDefinition.ts +4 -4
  174. package/src/EntityFields.ts +3 -3
  175. package/src/EntityInvalidationUtils.ts +8 -25
  176. package/src/EntityLoader.ts +7 -7
  177. package/src/EntityLoaderFactory.ts +13 -12
  178. package/src/EntityMutationInfo.ts +2 -2
  179. package/src/EntityMutationTriggerConfiguration.ts +4 -4
  180. package/src/EntityMutationValidatorConfiguration.ts +4 -4
  181. package/src/EntityMutatorFactory.ts +13 -13
  182. package/src/EntityPrivacyPolicy.ts +9 -10
  183. package/src/EntityQueryContext.ts +1 -1
  184. package/src/EntityQueryContextProvider.ts +2 -2
  185. package/src/EntitySecondaryCacheLoader.ts +8 -8
  186. package/src/EntityUpdater.ts +7 -7
  187. package/src/GenericEntityCacheAdapter.ts +5 -5
  188. package/src/GenericSecondaryEntityCache.ts +4 -4
  189. package/src/IEntityCacheAdapter.ts +2 -2
  190. package/src/IEntityCacheAdapterProvider.ts +2 -2
  191. package/src/IEntityDatabaseAdapterProvider.ts +2 -2
  192. package/src/IEntityGenericCacher.ts +2 -2
  193. package/src/ReadonlyEntity.ts +12 -19
  194. package/src/ViewerContext.ts +8 -8
  195. package/src/ViewerScopedEntityCompanion.ts +8 -8
  196. package/src/ViewerScopedEntityCompanionProvider.ts +6 -6
  197. package/src/ViewerScopedEntityLoaderFactory.ts +11 -9
  198. package/src/ViewerScopedEntityMutatorFactory.ts +8 -8
  199. package/src/__tests__/AuthorizationResultBasedEntityAssociationLoader-test.ts +6 -6
  200. package/src/__tests__/AuthorizationResultBasedEntityLoader-constructor-test.ts +16 -15
  201. package/src/__tests__/AuthorizationResultBasedEntityLoader-test.ts +21 -21
  202. package/src/__tests__/ComposedCacheAdapter-test.ts +8 -7
  203. package/src/__tests__/ComposedSecondaryEntityCache-test.ts +3 -3
  204. package/src/__tests__/EnforcingEntityAssociationLoader-test.ts +2 -2
  205. package/src/__tests__/EnforcingEntityLoader-test.ts +4 -4
  206. package/src/__tests__/Entity-test.ts +8 -8
  207. package/src/__tests__/EntityAssociationLoader-test.ts +6 -6
  208. package/src/__tests__/EntityCommonUseCases-test.ts +17 -13
  209. package/src/__tests__/EntityCompanion-test.ts +11 -11
  210. package/src/__tests__/EntityCompanionProvider-test.ts +8 -7
  211. package/src/__tests__/EntityConfiguration-test.ts +3 -3
  212. package/src/__tests__/EntityDatabaseAdapter-test.ts +11 -7
  213. package/src/__tests__/EntityEdges-test.ts +17 -19
  214. package/src/__tests__/EntityFields-test.ts +3 -3
  215. package/src/__tests__/EntityLoader-test.ts +7 -7
  216. package/src/__tests__/EntityMutator-MutationCacheConsistency-test.ts +12 -11
  217. package/src/__tests__/EntityMutator-SingleCompositeFieldCacheConsistency-test.ts +4 -4
  218. package/src/__tests__/EntityMutator-test.ts +32 -36
  219. package/src/__tests__/EntityPrivacyPolicy-test.ts +19 -19
  220. package/src/__tests__/EntityQueryContext-test.ts +9 -9
  221. package/src/__tests__/EntitySecondaryCacheLoader-test.ts +8 -7
  222. package/src/__tests__/EntitySelfReferentialEdges-test.ts +12 -12
  223. package/src/__tests__/GenericEntityCacheAdapter-test.ts +6 -6
  224. package/src/__tests__/GenericSecondaryEntityCache-test.ts +16 -18
  225. package/src/__tests__/ReadonlyEntity-test.ts +10 -10
  226. package/src/__tests__/ViewerContext-test.ts +3 -3
  227. package/src/__tests__/ViewerScopedEntityCompanion-test.ts +7 -7
  228. package/src/__tests__/ViewerScopedEntityCompanionProvider-test.ts +5 -5
  229. package/src/__tests__/ViewerScopedEntityLoaderFactory-test.ts +5 -5
  230. package/src/__tests__/ViewerScopedEntityMutatorFactory-test.ts +6 -6
  231. package/src/__tests__/cases/TwoEntitySameTableDisjointRows-test.ts +9 -9
  232. package/src/__tests__/cases/TwoEntitySameTableOverlappingRows-test.ts +8 -8
  233. package/src/__tests__/entityUtils-test.ts +4 -4
  234. package/src/entityUtils.ts +1 -1
  235. package/src/errors/EntityCacheAdapterError.ts +1 -1
  236. package/src/errors/EntityDatabaseAdapterError.ts +1 -1
  237. package/src/errors/EntityInvalidFieldValueError.ts +5 -5
  238. package/src/errors/EntityNotAuthorizedError.ts +4 -4
  239. package/src/errors/EntityNotFoundError.ts +5 -5
  240. package/src/errors/__tests__/EntityDatabaseAdapterError-test.ts +2 -2
  241. package/src/errors/__tests__/EntityError-test.ts +7 -7
  242. package/src/index.ts +77 -77
  243. package/src/internal/CompositeFieldHolder.ts +6 -10
  244. package/src/internal/CompositeFieldValueMap.ts +3 -5
  245. package/src/internal/EntityDataManager.ts +11 -14
  246. package/src/internal/EntityFieldTransformationUtils.ts +2 -2
  247. package/src/internal/EntityLoadInterfaces.ts +3 -2
  248. package/src/internal/EntityTableDataCoordinator.ts +9 -9
  249. package/src/internal/ReadThroughEntityCache.ts +4 -4
  250. package/src/internal/SingleFieldHolder.ts +4 -8
  251. package/src/internal/__tests__/CompositeFieldHolder-test.ts +1 -1
  252. package/src/internal/__tests__/CompositeFieldValueMap-test.ts +3 -3
  253. package/src/internal/__tests__/EntityDataManager-test.ts +15 -18
  254. package/src/internal/__tests__/EntityFieldTransformationUtils-test.ts +3 -3
  255. package/src/internal/__tests__/ReadThroughEntityCache-test.ts +6 -6
  256. package/src/metrics/EntityMetricsUtils.ts +5 -5
  257. package/src/metrics/IEntityMetricsAdapter.ts +3 -3
  258. package/src/metrics/NoOpEntityMetricsAdapter.ts +2 -2
  259. package/src/metrics/__tests__/EntityMetricsUtils-test.ts +4 -7
  260. package/src/rules/AllowIfAllSubRulesAllowPrivacyPolicyRule.ts +5 -5
  261. package/src/rules/AllowIfAnySubRuleAllowsPrivacyPolicyRule.ts +5 -5
  262. package/src/rules/AllowIfInParentCascadeDeletionPrivacyPolicyRule.ts +9 -6
  263. package/src/rules/AlwaysAllowPrivacyPolicyRule.ts +5 -5
  264. package/src/rules/AlwaysDenyPrivacyPolicyRule.ts +5 -5
  265. package/src/rules/AlwaysSkipPrivacyPolicyRule.ts +5 -5
  266. package/src/rules/EvaluateIfEntityFieldPredicatePrivacyPolicyRule.ts +5 -5
  267. package/src/rules/PrivacyPolicyRule.ts +4 -4
  268. package/src/rules/__tests__/AllowIfAllSubRulesAllowPrivacyPolicyRule-test.ts +8 -8
  269. package/src/rules/__tests__/AllowIfAnySubRuleAllowsPrivacyPolicyRule-test.ts +8 -8
  270. package/src/rules/__tests__/AllowIfInParentCascadeDeletionPrivacyPolicyRule-test.ts +7 -7
  271. package/src/rules/__tests__/AlwaysAllowPrivacyPolicyRule-test.ts +5 -5
  272. package/src/rules/__tests__/AlwaysDenyPrivacyPolicyRule-test.ts +5 -5
  273. package/src/rules/__tests__/AlwaysSkipPrivacyPolicyRule-test.ts +5 -5
  274. package/src/rules/__tests__/EvaluateIfEntityFieldPredicatePrivacyPolicyRule-test.ts +9 -8
  275. package/src/utils/EntityCreationUtils.ts +7 -7
  276. package/src/utils/EntityPrivacyUtils.ts +13 -9
  277. package/src/utils/__testfixtures__/PrivacyPolicyRuleTestUtils.ts +6 -5
  278. package/src/utils/__testfixtures__/SimpleTestEntity.ts +7 -7
  279. package/src/utils/__testfixtures__/StubCacheAdapter.ts +6 -5
  280. package/src/utils/__testfixtures__/StubDatabaseAdapter.ts +6 -6
  281. package/src/utils/__testfixtures__/StubDatabaseAdapterProvider.ts +4 -4
  282. package/src/utils/__testfixtures__/StubQueryContextProvider.ts +2 -2
  283. package/src/utils/__testfixtures__/TSMockitoExtensions.ts +5 -5
  284. package/src/utils/__testfixtures__/TestEntity.ts +9 -8
  285. package/src/utils/__testfixtures__/TestEntity2.ts +7 -7
  286. package/src/utils/__testfixtures__/TestEntityWithMutationTriggers.ts +10 -10
  287. package/src/utils/__testfixtures__/TestViewerContext.ts +1 -1
  288. package/src/utils/__testfixtures__/createUnitTestEntityCompanionProvider.ts +6 -6
  289. package/src/utils/__testfixtures__/describeFieldTestCase.ts +1 -1
  290. package/src/utils/__tests__/EntityCreationUtils-test.ts +7 -7
  291. package/src/utils/__tests__/EntityPrivacyUtils-test.ts +20 -21
  292. package/src/utils/__tests__/canViewerDeleteAsync-edgeDeletionPermissionInferenceBehavior-test.ts +12 -12
  293. package/src/utils/__tests__/mergeEntityMutationTriggerConfigurations-test.ts +2 -2
  294. package/src/utils/collections/__tests__/SerializableKeyMap-test.ts +2 -1
  295. package/src/utils/collections/__tests__/maps-test.ts +5 -5
  296. package/src/utils/collections/__tests__/sets-test.ts +1 -1
  297. package/src/utils/mergeEntityMutationTriggerConfigurations.ts +3 -3
  298. package/build/src/AuthorizationResultBasedEntityAssociationLoader.js.map +0 -1
  299. package/build/src/AuthorizationResultBasedEntityLoader.js.map +0 -1
  300. package/build/src/AuthorizationResultBasedEntityMutator.js.map +0 -1
  301. package/build/src/ComposedEntityCacheAdapter.js.map +0 -1
  302. package/build/src/ComposedSecondaryEntityCache.js.map +0 -1
  303. package/build/src/EnforcingEntityAssociationLoader.js.map +0 -1
  304. package/build/src/EnforcingEntityCreator.js.map +0 -1
  305. package/build/src/EnforcingEntityDeleter.js.map +0 -1
  306. package/build/src/EnforcingEntityLoader.js.map +0 -1
  307. package/build/src/EnforcingEntityUpdater.js.map +0 -1
  308. package/build/src/Entity.js.map +0 -1
  309. package/build/src/EntityAssociationLoader.js.map +0 -1
  310. package/build/src/EntityCompanion.js.map +0 -1
  311. package/build/src/EntityCompanionProvider.js.map +0 -1
  312. package/build/src/EntityConfiguration.js.map +0 -1
  313. package/build/src/EntityConstructionUtils.js.map +0 -1
  314. package/build/src/EntityCreator.js.map +0 -1
  315. package/build/src/EntityDatabaseAdapter.js.map +0 -1
  316. package/build/src/EntityDeleter.js.map +0 -1
  317. package/build/src/EntityFieldDefinition.js.map +0 -1
  318. package/build/src/EntityFields.js.map +0 -1
  319. package/build/src/EntityInvalidationUtils.js.map +0 -1
  320. package/build/src/EntityLoader.js.map +0 -1
  321. package/build/src/EntityLoaderFactory.js.map +0 -1
  322. package/build/src/EntityMutationInfo.js.map +0 -1
  323. package/build/src/EntityMutationTriggerConfiguration.js.map +0 -1
  324. package/build/src/EntityMutationValidatorConfiguration.js.map +0 -1
  325. package/build/src/EntityMutatorFactory.js.map +0 -1
  326. package/build/src/EntityPrivacyPolicy.js.map +0 -1
  327. package/build/src/EntityQueryContext.js.map +0 -1
  328. package/build/src/EntityQueryContextProvider.js.map +0 -1
  329. package/build/src/EntitySecondaryCacheLoader.js.map +0 -1
  330. package/build/src/EntityUpdater.js.map +0 -1
  331. package/build/src/GenericEntityCacheAdapter.js.map +0 -1
  332. package/build/src/GenericSecondaryEntityCache.js.map +0 -1
  333. package/build/src/IEntityCacheAdapter.js.map +0 -1
  334. package/build/src/IEntityCacheAdapterProvider.js.map +0 -1
  335. package/build/src/IEntityDatabaseAdapterProvider.js.map +0 -1
  336. package/build/src/IEntityGenericCacher.js.map +0 -1
  337. package/build/src/ReadonlyEntity.js.map +0 -1
  338. package/build/src/ViewerContext.js.map +0 -1
  339. package/build/src/ViewerScopedEntityCompanion.js.map +0 -1
  340. package/build/src/ViewerScopedEntityCompanionProvider.js.map +0 -1
  341. package/build/src/ViewerScopedEntityLoaderFactory.js.map +0 -1
  342. package/build/src/ViewerScopedEntityMutatorFactory.js.map +0 -1
  343. package/build/src/entityUtils.js.map +0 -1
  344. package/build/src/errors/EntityCacheAdapterError.js.map +0 -1
  345. package/build/src/errors/EntityDatabaseAdapterError.js.map +0 -1
  346. package/build/src/errors/EntityError.js.map +0 -1
  347. package/build/src/errors/EntityInvalidFieldValueError.js.map +0 -1
  348. package/build/src/errors/EntityNotAuthorizedError.js.map +0 -1
  349. package/build/src/errors/EntityNotFoundError.js.map +0 -1
  350. package/build/src/index.js.map +0 -1
  351. package/build/src/internal/CompositeFieldHolder.js.map +0 -1
  352. package/build/src/internal/CompositeFieldValueMap.js.map +0 -1
  353. package/build/src/internal/EntityDataManager.js.map +0 -1
  354. package/build/src/internal/EntityFieldTransformationUtils.js.map +0 -1
  355. package/build/src/internal/EntityLoadInterfaces.js.map +0 -1
  356. package/build/src/internal/EntityTableDataCoordinator.js.map +0 -1
  357. package/build/src/internal/ReadThroughEntityCache.js.map +0 -1
  358. package/build/src/internal/SingleFieldHolder.js.map +0 -1
  359. package/build/src/metrics/EntityMetricsUtils.js.map +0 -1
  360. package/build/src/metrics/IEntityMetricsAdapter.js.map +0 -1
  361. package/build/src/metrics/NoOpEntityMetricsAdapter.js.map +0 -1
  362. package/build/src/rules/AllowIfAllSubRulesAllowPrivacyPolicyRule.js.map +0 -1
  363. package/build/src/rules/AllowIfAnySubRuleAllowsPrivacyPolicyRule.js.map +0 -1
  364. package/build/src/rules/AllowIfInParentCascadeDeletionPrivacyPolicyRule.js.map +0 -1
  365. package/build/src/rules/AlwaysAllowPrivacyPolicyRule.js.map +0 -1
  366. package/build/src/rules/AlwaysDenyPrivacyPolicyRule.js.map +0 -1
  367. package/build/src/rules/AlwaysSkipPrivacyPolicyRule.js.map +0 -1
  368. package/build/src/rules/EvaluateIfEntityFieldPredicatePrivacyPolicyRule.js.map +0 -1
  369. package/build/src/rules/PrivacyPolicyRule.js.map +0 -1
  370. package/build/src/utils/EntityCreationUtils.js.map +0 -1
  371. package/build/src/utils/EntityPrivacyUtils.js.map +0 -1
  372. package/build/src/utils/collections/SerializableKeyMap.js.map +0 -1
  373. package/build/src/utils/collections/maps.js.map +0 -1
  374. package/build/src/utils/collections/sets.js.map +0 -1
  375. package/build/src/utils/mergeEntityMutationTriggerConfigurations.js.map +0 -1
@@ -1,13 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LoadValueMap = exports.EntityLoadMethodType = void 0;
4
- const SerializableKeyMap_1 = require("../utils/collections/SerializableKeyMap");
1
+ import { SerializableKeyMap } from "../utils/collections/SerializableKeyMap.js";
5
2
  /**
6
3
  * Load method type identifier of a load key. Used for keying data loaders and identification in metrics.
7
4
  *
8
5
  * @internal
9
6
  */
10
- var EntityLoadMethodType;
7
+ export var EntityLoadMethodType;
11
8
  (function (EntityLoadMethodType) {
12
9
  /**
13
10
  * Load method type for loading entities by single fieldName and fieldValue(s).
@@ -17,13 +14,11 @@ var EntityLoadMethodType;
17
14
  * Load method type for loading entities by composite field.
18
15
  */
19
16
  EntityLoadMethodType["COMPOSITE"] = "composite";
20
- })(EntityLoadMethodType || (exports.EntityLoadMethodType = EntityLoadMethodType = {}));
17
+ })(EntityLoadMethodType || (EntityLoadMethodType = {}));
21
18
  /**
22
19
  * Map from load value interface to value.
23
20
  *
24
21
  * @internal
25
22
  */
26
- class LoadValueMap extends SerializableKeyMap_1.SerializableKeyMap {
23
+ export class LoadValueMap extends SerializableKeyMap {
27
24
  }
28
- exports.LoadValueMap = LoadValueMap;
29
- //# sourceMappingURL=EntityLoadInterfaces.js.map
@@ -1,11 +1,11 @@
1
- import { EntityConfiguration } from '../EntityConfiguration';
2
- import { EntityDatabaseAdapter } from '../EntityDatabaseAdapter';
3
- import { EntityQueryContextProvider } from '../EntityQueryContextProvider';
4
- import { IEntityCacheAdapter } from '../IEntityCacheAdapter';
5
- import { IEntityCacheAdapterProvider } from '../IEntityCacheAdapterProvider';
6
- import { IEntityDatabaseAdapterProvider } from '../IEntityDatabaseAdapterProvider';
7
- import { EntityDataManager } from './EntityDataManager';
8
- import { IEntityMetricsAdapter } from '../metrics/IEntityMetricsAdapter';
1
+ import type { EntityConfiguration } from '../EntityConfiguration.ts';
2
+ import type { EntityDatabaseAdapter } from '../EntityDatabaseAdapter.ts';
3
+ import type { EntityQueryContextProvider } from '../EntityQueryContextProvider.ts';
4
+ import type { IEntityCacheAdapter } from '../IEntityCacheAdapter.ts';
5
+ import type { IEntityCacheAdapterProvider } from '../IEntityCacheAdapterProvider.ts';
6
+ import type { IEntityDatabaseAdapterProvider } from '../IEntityDatabaseAdapterProvider.ts';
7
+ import { EntityDataManager } from './EntityDataManager.ts';
8
+ import type { IEntityMetricsAdapter } from '../metrics/IEntityMetricsAdapter.ts';
9
9
  /**
10
10
  * Responsible for orchestrating fetching and caching of entity data from a
11
11
  * table. Note that one instance is shared amongst all entities that read from
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EntityTableDataCoordinator = void 0;
4
- const EntityDataManager_1 = require("./EntityDataManager");
5
- const ReadThroughEntityCache_1 = require("./ReadThroughEntityCache");
1
+ import { EntityDataManager } from "./EntityDataManager.js";
2
+ import { ReadThroughEntityCache } from "./ReadThroughEntityCache.js";
6
3
  /**
7
4
  * Responsible for orchestrating fetching and caching of entity data from a
8
5
  * table. Note that one instance is shared amongst all entities that read from
@@ -10,7 +7,7 @@ const ReadThroughEntityCache_1 = require("./ReadThroughEntityCache");
10
7
  *
11
8
  * @internal
12
9
  */
13
- class EntityTableDataCoordinator {
10
+ export class EntityTableDataCoordinator {
14
11
  entityConfiguration;
15
12
  queryContextProvider;
16
13
  metricsAdapter;
@@ -25,11 +22,9 @@ class EntityTableDataCoordinator {
25
22
  this.entityClassName = entityClassName;
26
23
  this.databaseAdapter = databaseAdapterProvider.getDatabaseAdapter(entityConfiguration);
27
24
  this.cacheAdapter = cacheAdapterProvider.getCacheAdapter(entityConfiguration);
28
- this.dataManager = new EntityDataManager_1.EntityDataManager(this.databaseAdapter, new ReadThroughEntityCache_1.ReadThroughEntityCache(entityConfiguration, this.cacheAdapter), queryContextProvider, metricsAdapter, entityClassName);
25
+ this.dataManager = new EntityDataManager(this.databaseAdapter, new ReadThroughEntityCache(entityConfiguration, this.cacheAdapter), queryContextProvider, metricsAdapter, entityClassName);
29
26
  }
30
27
  getQueryContextProvider() {
31
28
  return this.queryContextProvider;
32
29
  }
33
30
  }
34
- exports.EntityTableDataCoordinator = EntityTableDataCoordinator;
35
- //# sourceMappingURL=EntityTableDataCoordinator.js.map
@@ -1,6 +1,6 @@
1
- import { EntityConfiguration } from '../EntityConfiguration';
2
- import { IEntityCacheAdapter } from '../IEntityCacheAdapter';
3
- import { IEntityLoadKey, IEntityLoadValue } from './EntityLoadInterfaces';
1
+ import type { EntityConfiguration } from '../EntityConfiguration.ts';
2
+ import type { IEntityCacheAdapter } from '../IEntityCacheAdapter.ts';
3
+ import type { IEntityLoadKey, IEntityLoadValue } from './EntityLoadInterfaces.ts';
4
4
  /**
5
5
  * @internal
6
6
  */
@@ -1,27 +1,21 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ReadThroughEntityCache = exports.CacheStatus = void 0;
7
- const invariant_1 = __importDefault(require("invariant"));
8
- const maps_1 = require("../utils/collections/maps");
1
+ import invariant from 'invariant';
2
+ import { filterMap } from "../utils/collections/maps.js";
9
3
  /**
10
4
  * @internal
11
5
  */
12
- var CacheStatus;
6
+ export var CacheStatus;
13
7
  (function (CacheStatus) {
14
8
  CacheStatus[CacheStatus["HIT"] = 0] = "HIT";
15
9
  CacheStatus[CacheStatus["MISS"] = 1] = "MISS";
16
10
  CacheStatus[CacheStatus["NEGATIVE"] = 2] = "NEGATIVE";
17
- })(CacheStatus || (exports.CacheStatus = CacheStatus = {}));
11
+ })(CacheStatus || (CacheStatus = {}));
18
12
  /**
19
13
  * A read-through entity cache is responsible for coordinating EntityDatabaseAdapter and
20
14
  * EntityCacheAdapter within the EntityDataManager.
21
15
  *
22
16
  * @internal
23
17
  */
24
- class ReadThroughEntityCache {
18
+ export class ReadThroughEntityCache {
25
19
  entityConfiguration;
26
20
  entityCacheAdapter;
27
21
  constructor(entityConfiguration, entityCacheAdapter) {
@@ -53,8 +47,8 @@ class ReadThroughEntityCache {
53
47
  return await fetcher(values);
54
48
  }
55
49
  const cacheLoadResults = await this.entityCacheAdapter.loadManyAsync(key, values);
56
- (0, invariant_1.default)(cacheLoadResults.size === values.length, `${this.constructor.name} loadMany should return a result for each value`);
57
- const valuesToFetchFromDB = Array.from((0, maps_1.filterMap)(cacheLoadResults, (cacheLoadResult) => cacheLoadResult.status === CacheStatus.MISS).keys());
50
+ invariant(cacheLoadResults.size === values.length, `${this.constructor.name} loadMany should return a result for each value`);
51
+ const valuesToFetchFromDB = Array.from(filterMap(cacheLoadResults, (cacheLoadResult) => cacheLoadResult.status === CacheStatus.MISS).keys());
58
52
  // put transformed cache hits in result map
59
53
  const results = key.vendNewLoadValueMap();
60
54
  cacheLoadResults.forEach((cacheLoadResult, value) => {
@@ -105,5 +99,3 @@ class ReadThroughEntityCache {
105
99
  await this.entityCacheAdapter.invalidateManyAsync(key, values);
106
100
  }
107
101
  }
108
- exports.ReadThroughEntityCache = ReadThroughEntityCache;
109
- //# sourceMappingURL=ReadThroughEntityCache.js.map
@@ -1,5 +1,6 @@
1
- import { EntityConfiguration } from '../EntityConfiguration';
2
- import { EntityLoadMethodType, IEntityLoadKey, IEntityLoadValue, LoadValueMap } from './EntityLoadInterfaces';
1
+ import type { EntityConfiguration } from '../EntityConfiguration.ts';
2
+ import type { IEntityLoadKey, IEntityLoadValue } from './EntityLoadInterfaces.ts';
3
+ import { EntityLoadMethodType, LoadValueMap } from './EntityLoadInterfaces.ts';
3
4
  /**
4
5
  * A load key that represents a single field (fieldName) on an entity.
5
6
  *
@@ -1,18 +1,12 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.SingleFieldValueHolderMap = exports.SingleFieldValueHolder = exports.SingleFieldHolder = void 0;
7
- const invariant_1 = __importDefault(require("invariant"));
8
- const EntityFieldTransformationUtils_1 = require("./EntityFieldTransformationUtils");
9
- const EntityLoadInterfaces_1 = require("./EntityLoadInterfaces");
1
+ import invariant from 'invariant';
2
+ import { getDatabaseFieldForEntityField } from "./EntityFieldTransformationUtils.js";
3
+ import { EntityLoadMethodType, LoadValueMap } from "./EntityLoadInterfaces.js";
10
4
  /**
11
5
  * A load key that represents a single field (fieldName) on an entity.
12
6
  *
13
7
  * @internal
14
8
  */
15
- class SingleFieldHolder {
9
+ export class SingleFieldHolder {
16
10
  fieldName;
17
11
  constructor(fieldName) {
18
12
  this.fieldName = fieldName;
@@ -24,7 +18,7 @@ class SingleFieldHolder {
24
18
  return entityConfiguration.cacheableKeys.has(this.fieldName);
25
19
  }
26
20
  getDatabaseColumns(entityConfiguration) {
27
- return [(0, EntityFieldTransformationUtils_1.getDatabaseFieldForEntityField)(entityConfiguration, this.fieldName)];
21
+ return [getDatabaseFieldForEntityField(entityConfiguration, this.fieldName)];
28
22
  }
29
23
  getDatabaseValues(value) {
30
24
  return [value.fieldValue];
@@ -38,11 +32,11 @@ class SingleFieldHolder {
38
32
  }
39
33
  createCacheKeyPartsForLoadValue(entityConfiguration, value) {
40
34
  const columnName = entityConfiguration.entityToDBFieldsKeyMapping.get(this.fieldName);
41
- (0, invariant_1.default)(columnName, `database field mapping missing for ${String(this.fieldName)}`);
35
+ invariant(columnName, `database field mapping missing for ${String(this.fieldName)}`);
42
36
  return [columnName, String(value.fieldValue)];
43
37
  }
44
38
  getLoadMethodType() {
45
- return EntityLoadInterfaces_1.EntityLoadMethodType.SINGLE;
39
+ return EntityLoadMethodType.SINGLE;
46
40
  }
47
41
  getDataManagerDataLoaderKey() {
48
42
  return this.fieldName;
@@ -63,13 +57,12 @@ class SingleFieldHolder {
63
57
  return new SingleFieldValueHolderMap();
64
58
  }
65
59
  }
66
- exports.SingleFieldHolder = SingleFieldHolder;
67
60
  /**
68
61
  * A load value for a SingleFieldHolder.
69
62
  *
70
63
  * @internal
71
64
  */
72
- class SingleFieldValueHolder {
65
+ export class SingleFieldValueHolder {
73
66
  fieldValue;
74
67
  constructor(fieldValue) {
75
68
  this.fieldValue = fieldValue;
@@ -84,14 +77,11 @@ class SingleFieldValueHolder {
84
77
  return new SingleFieldValueHolder(fieldValue);
85
78
  }
86
79
  }
87
- exports.SingleFieldValueHolder = SingleFieldValueHolder;
88
80
  /**
89
81
  * @internal
90
82
  */
91
- class SingleFieldValueHolderMap extends EntityLoadInterfaces_1.LoadValueMap {
83
+ export class SingleFieldValueHolderMap extends LoadValueMap {
92
84
  deserializeKey(serializedKey) {
93
85
  return SingleFieldValueHolder.deserialize(serializedKey);
94
86
  }
95
87
  }
96
- exports.SingleFieldValueHolderMap = SingleFieldValueHolderMap;
97
- //# sourceMappingURL=SingleFieldHolder.js.map
@@ -1,6 +1,6 @@
1
- import { EntityQueryContext } from '../EntityQueryContext';
2
- import { EntityMetricsLoadType, EntityMetricsMutationType, IEntityMetricsAdapter } from './IEntityMetricsAdapter';
3
- import { IEntityLoadValue } from '../internal/EntityLoadInterfaces';
1
+ import type { EntityQueryContext } from '../EntityQueryContext.ts';
2
+ import type { EntityMetricsLoadType, EntityMetricsMutationType, IEntityMetricsAdapter } from './IEntityMetricsAdapter.ts';
3
+ import type { IEntityLoadValue } from '../internal/EntityLoadInterfaces.ts';
4
4
  export declare const timeAndLogLoadEventAsync: (metricsAdapter: IEntityMetricsAdapter, loadType: EntityMetricsLoadType, entityClassName: string, queryContext: EntityQueryContext) => <TFields>(promise: Promise<readonly Readonly<TFields>[]>) => Promise<readonly Readonly<TFields>[]>;
5
5
  export declare const timeAndLogLoadOneEventAsync: (metricsAdapter: IEntityMetricsAdapter, loadType: EntityMetricsLoadType, entityClassName: string, queryContext: EntityQueryContext) => <TFields>(promise: Promise<Readonly<TFields> | null>) => Promise<Readonly<TFields> | null>;
6
6
  export declare const timeAndLogLoadMapEventAsync: (metricsAdapter: IEntityMetricsAdapter, loadType: EntityMetricsLoadType, entityClassName: string, queryContext: EntityQueryContext) => <TFields extends Record<string, any>, TSerializedLoadValue, TLoadValue extends IEntityLoadValue<TSerializedLoadValue>>(promise: Promise<ReadonlyMap<TLoadValue, readonly Readonly<TFields>[]>>) => Promise<ReadonlyMap<TLoadValue, readonly Readonly<TFields>[]>>;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.timeAndLogMutationEventAsync = exports.timeAndLogLoadMapEventAsync = exports.timeAndLogLoadOneEventAsync = exports.timeAndLogLoadEventAsync = void 0;
4
- const maps_1 = require("../utils/collections/maps");
5
- const timeAndLogLoadEventAsync = (metricsAdapter, loadType, entityClassName, queryContext) => async (promise) => {
1
+ import { reduceMap } from "../utils/collections/maps.js";
2
+ export const timeAndLogLoadEventAsync = (metricsAdapter, loadType, entityClassName, queryContext) => async (promise) => {
6
3
  const startTime = Date.now();
7
4
  const result = await promise;
8
5
  const endTime = Date.now();
@@ -15,8 +12,7 @@ const timeAndLogLoadEventAsync = (metricsAdapter, loadType, entityClassName, que
15
12
  });
16
13
  return result;
17
14
  };
18
- exports.timeAndLogLoadEventAsync = timeAndLogLoadEventAsync;
19
- const timeAndLogLoadOneEventAsync = (metricsAdapter, loadType, entityClassName, queryContext) => async (promise) => {
15
+ export const timeAndLogLoadOneEventAsync = (metricsAdapter, loadType, entityClassName, queryContext) => async (promise) => {
20
16
  const startTime = Date.now();
21
17
  const result = await promise;
22
18
  const endTime = Date.now();
@@ -29,12 +25,11 @@ const timeAndLogLoadOneEventAsync = (metricsAdapter, loadType, entityClassName,
29
25
  });
30
26
  return result;
31
27
  };
32
- exports.timeAndLogLoadOneEventAsync = timeAndLogLoadOneEventAsync;
33
- const timeAndLogLoadMapEventAsync = (metricsAdapter, loadType, entityClassName, queryContext) => async (promise) => {
28
+ export const timeAndLogLoadMapEventAsync = (metricsAdapter, loadType, entityClassName, queryContext) => async (promise) => {
34
29
  const startTime = Date.now();
35
30
  const result = await promise;
36
31
  const endTime = Date.now();
37
- const count = (0, maps_1.reduceMap)(result, (acc, v) => acc + v.length, 0);
32
+ const count = reduceMap(result, (acc, v) => acc + v.length, 0);
38
33
  metricsAdapter.logDataManagerLoadEvent({
39
34
  type: loadType,
40
35
  isInTransaction: queryContext.isInTransaction(),
@@ -44,8 +39,7 @@ const timeAndLogLoadMapEventAsync = (metricsAdapter, loadType, entityClassName,
44
39
  });
45
40
  return result;
46
41
  };
47
- exports.timeAndLogLoadMapEventAsync = timeAndLogLoadMapEventAsync;
48
- const timeAndLogMutationEventAsync = (metricsAdapter, mutationType, entityClassName, queryContext) => async (promise) => {
42
+ export const timeAndLogMutationEventAsync = (metricsAdapter, mutationType, entityClassName, queryContext) => async (promise) => {
49
43
  const startTime = Date.now();
50
44
  const result = await promise;
51
45
  const endTime = Date.now();
@@ -57,5 +51,3 @@ const timeAndLogMutationEventAsync = (metricsAdapter, mutationType, entityClassN
57
51
  });
58
52
  return result;
59
53
  };
60
- exports.timeAndLogMutationEventAsync = timeAndLogMutationEventAsync;
61
- //# sourceMappingURL=EntityMetricsUtils.js.map
@@ -1,5 +1,5 @@
1
- import { EntityAuthorizationAction, EntityPrivacyPolicyEvaluationMode } from '../EntityPrivacyPolicy';
2
- import { EntityLoadMethodType } from '../internal/EntityLoadInterfaces';
1
+ import type { EntityAuthorizationAction, EntityPrivacyPolicyEvaluationMode } from '../EntityPrivacyPolicy.ts';
2
+ import type { EntityLoadMethodType } from '../internal/EntityLoadInterfaces.ts';
3
3
  export declare enum EntityMetricsLoadType {
4
4
  LOAD_MANY = 0,
5
5
  LOAD_MANY_EQUALITY_CONJUNCTION = 1,
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EntityMetricsAuthorizationResult = exports.IncrementLoadCountEventType = exports.EntityMetricsMutationType = exports.EntityMetricsLoadType = void 0;
4
- var EntityMetricsLoadType;
1
+ export var EntityMetricsLoadType;
5
2
  (function (EntityMetricsLoadType) {
6
3
  EntityMetricsLoadType[EntityMetricsLoadType["LOAD_MANY"] = 0] = "LOAD_MANY";
7
4
  EntityMetricsLoadType[EntityMetricsLoadType["LOAD_MANY_EQUALITY_CONJUNCTION"] = 1] = "LOAD_MANY_EQUALITY_CONJUNCTION";
@@ -9,14 +6,14 @@ var EntityMetricsLoadType;
9
6
  EntityMetricsLoadType[EntityMetricsLoadType["LOAD_MANY_SQL"] = 3] = "LOAD_MANY_SQL";
10
7
  EntityMetricsLoadType[EntityMetricsLoadType["LOAD_ONE"] = 4] = "LOAD_ONE";
11
8
  EntityMetricsLoadType[EntityMetricsLoadType["LOAD_PAGE"] = 5] = "LOAD_PAGE";
12
- })(EntityMetricsLoadType || (exports.EntityMetricsLoadType = EntityMetricsLoadType = {}));
13
- var EntityMetricsMutationType;
9
+ })(EntityMetricsLoadType || (EntityMetricsLoadType = {}));
10
+ export var EntityMetricsMutationType;
14
11
  (function (EntityMetricsMutationType) {
15
12
  EntityMetricsMutationType[EntityMetricsMutationType["CREATE"] = 0] = "CREATE";
16
13
  EntityMetricsMutationType[EntityMetricsMutationType["UPDATE"] = 1] = "UPDATE";
17
14
  EntityMetricsMutationType[EntityMetricsMutationType["DELETE"] = 2] = "DELETE";
18
- })(EntityMetricsMutationType || (exports.EntityMetricsMutationType = EntityMetricsMutationType = {}));
19
- var IncrementLoadCountEventType;
15
+ })(EntityMetricsMutationType || (EntityMetricsMutationType = {}));
16
+ export var IncrementLoadCountEventType;
20
17
  (function (IncrementLoadCountEventType) {
21
18
  /**
22
19
  * Type for when a dataloader load is initiated via the standard load methods
@@ -31,10 +28,9 @@ var IncrementLoadCountEventType;
31
28
  * Type for when a database load is initiated due to a dataloader and cache miss, when an entity query doesn't support caching, or during a transaction.
32
29
  */
33
30
  IncrementLoadCountEventType[IncrementLoadCountEventType["DATABASE"] = 2] = "DATABASE";
34
- })(IncrementLoadCountEventType || (exports.IncrementLoadCountEventType = IncrementLoadCountEventType = {}));
35
- var EntityMetricsAuthorizationResult;
31
+ })(IncrementLoadCountEventType || (IncrementLoadCountEventType = {}));
32
+ export var EntityMetricsAuthorizationResult;
36
33
  (function (EntityMetricsAuthorizationResult) {
37
34
  EntityMetricsAuthorizationResult[EntityMetricsAuthorizationResult["DENY"] = 0] = "DENY";
38
35
  EntityMetricsAuthorizationResult[EntityMetricsAuthorizationResult["ALLOW"] = 1] = "ALLOW";
39
- })(EntityMetricsAuthorizationResult || (exports.EntityMetricsAuthorizationResult = EntityMetricsAuthorizationResult = {}));
40
- //# sourceMappingURL=IEntityMetricsAdapter.js.map
36
+ })(EntityMetricsAuthorizationResult || (EntityMetricsAuthorizationResult = {}));
@@ -1,4 +1,4 @@
1
- import { EntityMetricsAuthorizationEvent, EntityMetricsLoadEvent, EntityMetricsMutationEvent, IEntityMetricsAdapter, IncrementLoadCountEvent } from './IEntityMetricsAdapter';
1
+ import type { EntityMetricsAuthorizationEvent, EntityMetricsLoadEvent, EntityMetricsMutationEvent, IEntityMetricsAdapter, IncrementLoadCountEvent } from './IEntityMetricsAdapter.ts';
2
2
  export declare class NoOpEntityMetricsAdapter implements IEntityMetricsAdapter {
3
3
  logAuthorizationEvent(_authorizationEvent: EntityMetricsAuthorizationEvent): void;
4
4
  logDataManagerLoadEvent(_loadEvent: EntityMetricsLoadEvent): void;
@@ -1,11 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NoOpEntityMetricsAdapter = void 0;
4
- class NoOpEntityMetricsAdapter {
1
+ export class NoOpEntityMetricsAdapter {
5
2
  logAuthorizationEvent(_authorizationEvent) { }
6
3
  logDataManagerLoadEvent(_loadEvent) { }
7
4
  logMutatorMutationEvent(_mutationEvent) { }
8
5
  incrementDataManagerLoadCount(_incrementLoadCountEvent) { }
9
6
  }
10
- exports.NoOpEntityMetricsAdapter = NoOpEntityMetricsAdapter;
11
- //# sourceMappingURL=NoOpEntityMetricsAdapter.js.map
@@ -1,8 +1,8 @@
1
- import { EntityPrivacyPolicyRuleEvaluationContext } from '../EntityPrivacyPolicy';
2
- import { EntityQueryContext } from '../EntityQueryContext';
3
- import { ReadonlyEntity } from '../ReadonlyEntity';
4
- import { ViewerContext } from '../ViewerContext';
5
- import { PrivacyPolicyRule, RuleEvaluationResult } from './PrivacyPolicyRule';
1
+ import type { EntityPrivacyPolicyRuleEvaluationContext } from '../EntityPrivacyPolicy.ts';
2
+ import type { EntityQueryContext } from '../EntityQueryContext.ts';
3
+ import type { ReadonlyEntity } from '../ReadonlyEntity.ts';
4
+ import type { ViewerContext } from '../ViewerContext.ts';
5
+ import { PrivacyPolicyRule, RuleEvaluationResult } from './PrivacyPolicyRule.ts';
6
6
  export declare class AllowIfAllSubRulesAllowPrivacyPolicyRule<TFields extends object, TIDField extends keyof NonNullable<Pick<TFields, TSelectedFields>>, TViewerContext extends ViewerContext, TEntity extends ReadonlyEntity<TFields, TIDField, TViewerContext, TSelectedFields>, TSelectedFields extends keyof TFields = keyof TFields> extends PrivacyPolicyRule<TFields, TIDField, TViewerContext, TEntity, TSelectedFields> {
7
7
  private readonly subRules;
8
8
  constructor(subRules: PrivacyPolicyRule<TFields, TIDField, TViewerContext, TEntity, TSelectedFields>[]);
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AllowIfAllSubRulesAllowPrivacyPolicyRule = void 0;
4
- const PrivacyPolicyRule_1 = require("./PrivacyPolicyRule");
5
- class AllowIfAllSubRulesAllowPrivacyPolicyRule extends PrivacyPolicyRule_1.PrivacyPolicyRule {
1
+ import { PrivacyPolicyRule, RuleEvaluationResult } from "./PrivacyPolicyRule.js";
2
+ export class AllowIfAllSubRulesAllowPrivacyPolicyRule extends PrivacyPolicyRule {
6
3
  subRules;
7
4
  constructor(subRules) {
8
5
  super();
@@ -10,10 +7,8 @@ class AllowIfAllSubRulesAllowPrivacyPolicyRule extends PrivacyPolicyRule_1.Priva
10
7
  }
11
8
  async evaluateAsync(viewerContext, queryContext, evaluationContext, entity) {
12
9
  const results = await Promise.all(this.subRules.map((subRule) => subRule.evaluateAsync(viewerContext, queryContext, evaluationContext, entity)));
13
- return results.every((result) => result === PrivacyPolicyRule_1.RuleEvaluationResult.ALLOW)
14
- ? PrivacyPolicyRule_1.RuleEvaluationResult.ALLOW
15
- : PrivacyPolicyRule_1.RuleEvaluationResult.SKIP;
10
+ return results.every((result) => result === RuleEvaluationResult.ALLOW)
11
+ ? RuleEvaluationResult.ALLOW
12
+ : RuleEvaluationResult.SKIP;
16
13
  }
17
14
  }
18
- exports.AllowIfAllSubRulesAllowPrivacyPolicyRule = AllowIfAllSubRulesAllowPrivacyPolicyRule;
19
- //# sourceMappingURL=AllowIfAllSubRulesAllowPrivacyPolicyRule.js.map
@@ -1,8 +1,8 @@
1
- import { EntityPrivacyPolicyRuleEvaluationContext } from '../EntityPrivacyPolicy';
2
- import { EntityQueryContext } from '../EntityQueryContext';
3
- import { ReadonlyEntity } from '../ReadonlyEntity';
4
- import { ViewerContext } from '../ViewerContext';
5
- import { PrivacyPolicyRule, RuleEvaluationResult } from './PrivacyPolicyRule';
1
+ import type { EntityPrivacyPolicyRuleEvaluationContext } from '../EntityPrivacyPolicy.ts';
2
+ import type { EntityQueryContext } from '../EntityQueryContext.ts';
3
+ import type { ReadonlyEntity } from '../ReadonlyEntity.ts';
4
+ import type { ViewerContext } from '../ViewerContext.ts';
5
+ import { PrivacyPolicyRule, RuleEvaluationResult } from './PrivacyPolicyRule.ts';
6
6
  export declare class AllowIfAnySubRuleAllowsPrivacyPolicyRule<TFields extends object, TIDField extends keyof NonNullable<Pick<TFields, TSelectedFields>>, TViewerContext extends ViewerContext, TEntity extends ReadonlyEntity<TFields, TIDField, TViewerContext, TSelectedFields>, TSelectedFields extends keyof TFields = keyof TFields> extends PrivacyPolicyRule<TFields, TIDField, TViewerContext, TEntity, TSelectedFields> {
7
7
  private readonly subRules;
8
8
  constructor(subRules: PrivacyPolicyRule<TFields, TIDField, TViewerContext, TEntity, TSelectedFields>[]);
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AllowIfAnySubRuleAllowsPrivacyPolicyRule = void 0;
4
- const PrivacyPolicyRule_1 = require("./PrivacyPolicyRule");
5
- class AllowIfAnySubRuleAllowsPrivacyPolicyRule extends PrivacyPolicyRule_1.PrivacyPolicyRule {
1
+ import { PrivacyPolicyRule, RuleEvaluationResult } from "./PrivacyPolicyRule.js";
2
+ export class AllowIfAnySubRuleAllowsPrivacyPolicyRule extends PrivacyPolicyRule {
6
3
  subRules;
7
4
  constructor(subRules) {
8
5
  super();
@@ -10,10 +7,8 @@ class AllowIfAnySubRuleAllowsPrivacyPolicyRule extends PrivacyPolicyRule_1.Priva
10
7
  }
11
8
  async evaluateAsync(viewerContext, queryContext, evaluationContext, entity) {
12
9
  const results = await Promise.all(this.subRules.map((subRule) => subRule.evaluateAsync(viewerContext, queryContext, evaluationContext, entity)));
13
- return results.includes(PrivacyPolicyRule_1.RuleEvaluationResult.ALLOW)
14
- ? PrivacyPolicyRule_1.RuleEvaluationResult.ALLOW
15
- : PrivacyPolicyRule_1.RuleEvaluationResult.SKIP;
10
+ return results.includes(RuleEvaluationResult.ALLOW)
11
+ ? RuleEvaluationResult.ALLOW
12
+ : RuleEvaluationResult.SKIP;
16
13
  }
17
14
  }
18
- exports.AllowIfAnySubRuleAllowsPrivacyPolicyRule = AllowIfAnySubRuleAllowsPrivacyPolicyRule;
19
- //# sourceMappingURL=AllowIfAnySubRuleAllowsPrivacyPolicyRule.js.map
@@ -1,9 +1,9 @@
1
- import { IEntityClass } from '../Entity';
2
- import { EntityPrivacyPolicy, EntityPrivacyPolicyEvaluationContext } from '../EntityPrivacyPolicy';
3
- import { EntityQueryContext } from '../EntityQueryContext';
4
- import { ReadonlyEntity } from '../ReadonlyEntity';
5
- import { ViewerContext } from '../ViewerContext';
6
- import { PrivacyPolicyRule, RuleEvaluationResult } from './PrivacyPolicyRule';
1
+ import type { IEntityClass } from '../Entity.ts';
2
+ import type { EntityPrivacyPolicy, EntityPrivacyPolicyEvaluationContext } from '../EntityPrivacyPolicy.ts';
3
+ import type { EntityQueryContext } from '../EntityQueryContext.ts';
4
+ import type { ReadonlyEntity } from '../ReadonlyEntity.ts';
5
+ import type { ViewerContext } from '../ViewerContext.ts';
6
+ import { PrivacyPolicyRule, RuleEvaluationResult } from './PrivacyPolicyRule.ts';
7
7
  /**
8
8
  * Directive for specifying the parent relationship in AllowIfInParentCascadeDeletionPrivacyPolicyRule.
9
9
  */
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AllowIfInParentCascadeDeletionPrivacyPolicyRule = void 0;
4
- const PrivacyPolicyRule_1 = require("./PrivacyPolicyRule");
1
+ import { PrivacyPolicyRule, RuleEvaluationResult } from "./PrivacyPolicyRule.js";
5
2
  /**
6
3
  * A generic privacy policy rule that allows when an entity is being authorized
7
4
  * as part of a cascading delete from a parent entity. Handles two cases:
@@ -38,7 +35,7 @@ const PrivacyPolicyRule_1 = require("./PrivacyPolicyRule");
38
35
  * }
39
36
  * ```
40
37
  */
41
- class AllowIfInParentCascadeDeletionPrivacyPolicyRule extends PrivacyPolicyRule_1.PrivacyPolicyRule {
38
+ export class AllowIfInParentCascadeDeletionPrivacyPolicyRule extends PrivacyPolicyRule {
42
39
  directive;
43
40
  constructor(directive) {
44
41
  super();
@@ -48,7 +45,7 @@ class AllowIfInParentCascadeDeletionPrivacyPolicyRule extends PrivacyPolicyRule_
48
45
  const parentEntityClass = this.directive.parentEntityClass;
49
46
  const deleteCause = evaluationContext.cascadingDeleteCause;
50
47
  if (!deleteCause || !(deleteCause.entity instanceof parentEntityClass)) {
51
- return PrivacyPolicyRule_1.RuleEvaluationResult.SKIP;
48
+ return RuleEvaluationResult.SKIP;
52
49
  }
53
50
  const entityBeingDeleted = deleteCause.entity;
54
51
  // allow if parent foreign key field matches specified field in the entity being authorized
@@ -58,7 +55,7 @@ class AllowIfInParentCascadeDeletionPrivacyPolicyRule extends PrivacyPolicyRule_
58
55
  : entityBeingDeleted.getID();
59
56
  if (valueInThisEntityReferencingParent &&
60
57
  valueInThisEntityReferencingParent === valueInParent) {
61
- return PrivacyPolicyRule_1.RuleEvaluationResult.ALLOW;
58
+ return RuleEvaluationResult.ALLOW;
62
59
  }
63
60
  // allow if parent foreign key field matches specified field in the entity being authorized, and the
64
61
  // field in the entity being authorized has been null'ed out due to cascading set null
@@ -66,10 +63,8 @@ class AllowIfInParentCascadeDeletionPrivacyPolicyRule extends PrivacyPolicyRule_
66
63
  if (valueInPreviousValueOfThisEntityReferencingParent &&
67
64
  valueInPreviousValueOfThisEntityReferencingParent === valueInParent &&
68
65
  valueInThisEntityReferencingParent === null) {
69
- return PrivacyPolicyRule_1.RuleEvaluationResult.ALLOW;
66
+ return RuleEvaluationResult.ALLOW;
70
67
  }
71
- return PrivacyPolicyRule_1.RuleEvaluationResult.SKIP;
68
+ return RuleEvaluationResult.SKIP;
72
69
  }
73
70
  }
74
- exports.AllowIfInParentCascadeDeletionPrivacyPolicyRule = AllowIfInParentCascadeDeletionPrivacyPolicyRule;
75
- //# sourceMappingURL=AllowIfInParentCascadeDeletionPrivacyPolicyRule.js.map
@@ -1,8 +1,8 @@
1
- import { EntityPrivacyPolicyEvaluationContext } from '../EntityPrivacyPolicy';
2
- import { EntityQueryContext } from '../EntityQueryContext';
3
- import { ReadonlyEntity } from '../ReadonlyEntity';
4
- import { ViewerContext } from '../ViewerContext';
5
- import { PrivacyPolicyRule, RuleEvaluationResult } from './PrivacyPolicyRule';
1
+ import type { EntityPrivacyPolicyEvaluationContext } from '../EntityPrivacyPolicy.ts';
2
+ import type { EntityQueryContext } from '../EntityQueryContext.ts';
3
+ import type { ReadonlyEntity } from '../ReadonlyEntity.ts';
4
+ import type { ViewerContext } from '../ViewerContext.ts';
5
+ import { PrivacyPolicyRule, RuleEvaluationResult } from './PrivacyPolicyRule.ts';
6
6
  /**
7
7
  * Privacy policy rule that always allows.
8
8
  */
@@ -1,14 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AlwaysAllowPrivacyPolicyRule = void 0;
4
- const PrivacyPolicyRule_1 = require("./PrivacyPolicyRule");
1
+ import { PrivacyPolicyRule, RuleEvaluationResult } from "./PrivacyPolicyRule.js";
5
2
  /**
6
3
  * Privacy policy rule that always allows.
7
4
  */
8
- class AlwaysAllowPrivacyPolicyRule extends PrivacyPolicyRule_1.PrivacyPolicyRule {
5
+ export class AlwaysAllowPrivacyPolicyRule extends PrivacyPolicyRule {
9
6
  async evaluateAsync(_viewerContext, _queryContext, _evaluationContext, _entity) {
10
- return PrivacyPolicyRule_1.RuleEvaluationResult.ALLOW;
7
+ return RuleEvaluationResult.ALLOW;
11
8
  }
12
9
  }
13
- exports.AlwaysAllowPrivacyPolicyRule = AlwaysAllowPrivacyPolicyRule;
14
- //# sourceMappingURL=AlwaysAllowPrivacyPolicyRule.js.map
@@ -1,8 +1,8 @@
1
- import { EntityPrivacyPolicyEvaluationContext } from '../EntityPrivacyPolicy';
2
- import { EntityQueryContext } from '../EntityQueryContext';
3
- import { ReadonlyEntity } from '../ReadonlyEntity';
4
- import { ViewerContext } from '../ViewerContext';
5
- import { PrivacyPolicyRule, RuleEvaluationResult } from './PrivacyPolicyRule';
1
+ import type { EntityPrivacyPolicyEvaluationContext } from '../EntityPrivacyPolicy.ts';
2
+ import type { EntityQueryContext } from '../EntityQueryContext.ts';
3
+ import type { ReadonlyEntity } from '../ReadonlyEntity.ts';
4
+ import type { ViewerContext } from '../ViewerContext.ts';
5
+ import { PrivacyPolicyRule, RuleEvaluationResult } from './PrivacyPolicyRule.ts';
6
6
  /**
7
7
  * Privacy policy rule that always denies.
8
8
  */
@@ -1,14 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AlwaysDenyPrivacyPolicyRule = void 0;
4
- const PrivacyPolicyRule_1 = require("./PrivacyPolicyRule");
1
+ import { PrivacyPolicyRule, RuleEvaluationResult } from "./PrivacyPolicyRule.js";
5
2
  /**
6
3
  * Privacy policy rule that always denies.
7
4
  */
8
- class AlwaysDenyPrivacyPolicyRule extends PrivacyPolicyRule_1.PrivacyPolicyRule {
5
+ export class AlwaysDenyPrivacyPolicyRule extends PrivacyPolicyRule {
9
6
  async evaluateAsync(_viewerContext, _queryContext, _evaluationContext, _entity) {
10
- return PrivacyPolicyRule_1.RuleEvaluationResult.DENY;
7
+ return RuleEvaluationResult.DENY;
11
8
  }
12
9
  }
13
- exports.AlwaysDenyPrivacyPolicyRule = AlwaysDenyPrivacyPolicyRule;
14
- //# sourceMappingURL=AlwaysDenyPrivacyPolicyRule.js.map
@@ -1,8 +1,8 @@
1
- import { EntityPrivacyPolicyEvaluationContext } from '../EntityPrivacyPolicy';
2
- import { EntityQueryContext } from '../EntityQueryContext';
3
- import { ReadonlyEntity } from '../ReadonlyEntity';
4
- import { ViewerContext } from '../ViewerContext';
5
- import { PrivacyPolicyRule, RuleEvaluationResult } from './PrivacyPolicyRule';
1
+ import type { EntityPrivacyPolicyEvaluationContext } from '../EntityPrivacyPolicy.ts';
2
+ import type { EntityQueryContext } from '../EntityQueryContext.ts';
3
+ import type { ReadonlyEntity } from '../ReadonlyEntity.ts';
4
+ import type { ViewerContext } from '../ViewerContext.ts';
5
+ import { PrivacyPolicyRule, RuleEvaluationResult } from './PrivacyPolicyRule.ts';
6
6
  /**
7
7
  * A no-op policy rule that always skips.
8
8
  */
@@ -1,14 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AlwaysSkipPrivacyPolicyRule = void 0;
4
- const PrivacyPolicyRule_1 = require("./PrivacyPolicyRule");
1
+ import { PrivacyPolicyRule, RuleEvaluationResult } from "./PrivacyPolicyRule.js";
5
2
  /**
6
3
  * A no-op policy rule that always skips.
7
4
  */
8
- class AlwaysSkipPrivacyPolicyRule extends PrivacyPolicyRule_1.PrivacyPolicyRule {
5
+ export class AlwaysSkipPrivacyPolicyRule extends PrivacyPolicyRule {
9
6
  async evaluateAsync(_viewerContext, _queryContext, _evaluationContext, _entity) {
10
- return PrivacyPolicyRule_1.RuleEvaluationResult.SKIP;
7
+ return RuleEvaluationResult.SKIP;
11
8
  }
12
9
  }
13
- exports.AlwaysSkipPrivacyPolicyRule = AlwaysSkipPrivacyPolicyRule;
14
- //# sourceMappingURL=AlwaysSkipPrivacyPolicyRule.js.map