@expo/entity 0.41.0 → 0.42.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.
- package/build/AuthorizationResultBasedEntityAssociationLoader.d.ts +16 -16
- package/build/AuthorizationResultBasedEntityAssociationLoader.js.map +1 -1
- package/build/AuthorizationResultBasedEntityLoader.d.ts +39 -67
- package/build/AuthorizationResultBasedEntityLoader.js +85 -62
- package/build/AuthorizationResultBasedEntityLoader.js.map +1 -1
- package/build/AuthorizationResultBasedEntityMutator.d.ts +16 -16
- package/build/AuthorizationResultBasedEntityMutator.js.map +1 -1
- package/build/ComposedEntityCacheAdapter.d.ts +7 -6
- package/build/ComposedEntityCacheAdapter.js +28 -28
- package/build/ComposedEntityCacheAdapter.js.map +1 -1
- package/build/ComposedSecondaryEntityCache.d.ts +1 -1
- package/build/ComposedSecondaryEntityCache.js.map +1 -1
- package/build/EnforcingEntityAssociationLoader.d.ts +15 -15
- package/build/EnforcingEntityAssociationLoader.js.map +1 -1
- package/build/EnforcingEntityCreator.d.ts +2 -2
- package/build/EnforcingEntityDeleter.d.ts +2 -2
- package/build/EnforcingEntityLoader.d.ts +104 -18
- package/build/EnforcingEntityLoader.js +113 -12
- package/build/EnforcingEntityLoader.js.map +1 -1
- package/build/EnforcingEntityUpdater.d.ts +2 -2
- package/build/Entity.d.ts +10 -10
- package/build/Entity.js.map +1 -1
- package/build/EntityAssociationLoader.d.ts +3 -3
- package/build/EntityCompanion.d.ts +5 -5
- package/build/EntityCompanion.js.map +1 -1
- package/build/EntityCompanionProvider.d.ts +6 -6
- package/build/EntityCompanionProvider.js.map +1 -1
- package/build/EntityConfiguration.d.ts +46 -5
- package/build/EntityConfiguration.js +39 -1
- package/build/EntityConfiguration.js.map +1 -1
- package/build/EntityCreator.d.ts +4 -4
- package/build/EntityDatabaseAdapter.d.ts +15 -14
- package/build/EntityDatabaseAdapter.js +20 -12
- package/build/EntityDatabaseAdapter.js.map +1 -1
- package/build/EntityDeleter.d.ts +4 -4
- package/build/EntityFieldDefinition.d.ts +20 -10
- package/build/EntityFieldDefinition.js +3 -1
- package/build/EntityFieldDefinition.js.map +1 -1
- package/build/EntityFields.d.ts +14 -12
- package/build/EntityFields.js.map +1 -1
- package/build/EntityLoader.d.ts +5 -5
- package/build/EntityLoaderFactory.d.ts +3 -3
- package/build/EntityLoaderFactory.js.map +1 -1
- package/build/EntityLoaderUtils.d.ts +2 -2
- package/build/EntityLoaderUtils.js +27 -1
- package/build/EntityLoaderUtils.js.map +1 -1
- package/build/EntityMutationInfo.d.ts +2 -2
- package/build/EntityMutationTriggerConfiguration.d.ts +14 -14
- package/build/EntityMutationTriggerConfiguration.js.map +1 -1
- package/build/EntityMutationValidator.d.ts +2 -2
- package/build/EntityMutatorFactory.d.ts +5 -5
- package/build/EntityMutatorFactory.js.map +1 -1
- package/build/EntityPrivacyPolicy.d.ts +14 -14
- package/build/EntityPrivacyPolicy.js.map +1 -1
- package/build/EntitySecondaryCacheLoader.d.ts +4 -4
- package/build/EntityUpdater.d.ts +4 -4
- package/build/GenericEntityCacheAdapter.d.ts +7 -6
- package/build/GenericEntityCacheAdapter.js +13 -14
- package/build/GenericEntityCacheAdapter.js.map +1 -1
- package/build/GenericSecondaryEntityCache.d.ts +3 -3
- package/build/GenericSecondaryEntityCache.js.map +1 -1
- package/build/IEntityCacheAdapter.d.ts +17 -16
- package/build/IEntityCacheAdapterProvider.d.ts +1 -1
- package/build/IEntityDatabaseAdapterProvider.d.ts +1 -1
- package/build/IEntityGenericCacher.d.ts +15 -5
- package/build/ReadonlyEntity.d.ts +8 -8
- package/build/ReadonlyEntity.js.map +1 -1
- package/build/ViewerContext.d.ts +1 -1
- package/build/ViewerScopedEntityCompanion.d.ts +5 -5
- package/build/ViewerScopedEntityCompanionProvider.d.ts +1 -1
- package/build/ViewerScopedEntityLoaderFactory.d.ts +3 -3
- package/build/ViewerScopedEntityMutatorFactory.d.ts +5 -5
- package/build/entityUtils.d.ts +1 -1
- package/build/entityUtils.js.map +1 -1
- package/build/errors/EntityInvalidFieldValueError.d.ts +2 -2
- package/build/errors/EntityNotAuthorizedError.d.ts +1 -1
- package/build/errors/EntityNotFoundError.d.ts +2 -2
- package/build/index.d.ts +7 -7
- package/build/index.js +8 -13
- package/build/index.js.map +1 -1
- package/build/internal/CompositeFieldHolder.d.ts +48 -0
- package/build/internal/CompositeFieldHolder.js +116 -0
- package/build/internal/CompositeFieldHolder.js.map +1 -0
- package/build/internal/CompositeFieldValueMap.d.ts +15 -0
- package/build/internal/CompositeFieldValueMap.js +51 -0
- package/build/internal/CompositeFieldValueMap.js.map +1 -0
- package/build/internal/EntityDataManager.d.ts +16 -16
- package/build/internal/EntityDataManager.js +42 -45
- package/build/internal/EntityDataManager.js.map +1 -1
- package/build/internal/EntityFieldTransformationUtils.d.ts +5 -5
- package/build/internal/EntityFieldTransformationUtils.js.map +1 -1
- package/build/internal/EntityLoadInterfaces.d.ts +104 -0
- package/build/internal/EntityLoadInterfaces.js +25 -0
- package/build/internal/EntityLoadInterfaces.js.map +1 -0
- package/build/internal/EntityTableDataCoordinator.d.ts +6 -6
- package/build/internal/EntityTableDataCoordinator.js.map +1 -1
- package/build/internal/ReadThroughEntityCache.d.ts +17 -16
- package/build/internal/ReadThroughEntityCache.js +36 -36
- package/build/internal/ReadThroughEntityCache.js.map +1 -1
- package/build/internal/SingleFieldHolder.d.ts +34 -0
- package/build/internal/SingleFieldHolder.js +90 -0
- package/build/internal/SingleFieldHolder.js.map +1 -0
- package/build/metrics/EntityMetricsUtils.d.ts +2 -1
- package/build/metrics/EntityMetricsUtils.js.map +1 -1
- package/build/metrics/IEntityMetricsAdapter.d.ts +5 -0
- package/build/metrics/IEntityMetricsAdapter.js.map +1 -1
- package/build/rules/AlwaysAllowPrivacyPolicyRule.d.ts +2 -2
- package/build/rules/AlwaysAllowPrivacyPolicyRule.js.map +1 -1
- package/build/rules/AlwaysDenyPrivacyPolicyRule.d.ts +2 -2
- package/build/rules/AlwaysDenyPrivacyPolicyRule.js.map +1 -1
- package/build/rules/AlwaysSkipPrivacyPolicyRule.d.ts +2 -2
- package/build/rules/AlwaysSkipPrivacyPolicyRule.js.map +1 -1
- package/build/rules/PrivacyPolicyRule.d.ts +2 -2
- package/build/tsconfig.build.tsbuildinfo +1 -0
- package/build/utils/EntityPrivacyUtils.d.ts +4 -4
- package/build/utils/EntityPrivacyUtils.js.map +1 -1
- package/build/utils/collections/SerializableKeyMap.d.ts +27 -0
- package/build/utils/collections/SerializableKeyMap.js +60 -0
- package/build/utils/collections/SerializableKeyMap.js.map +1 -0
- package/build/utils/collections/maps.js +1 -2
- package/build/utils/collections/maps.js.map +1 -1
- package/build/utils/collections/sets.d.ts +1 -0
- package/build/utils/collections/sets.js +7 -0
- package/build/utils/collections/sets.js.map +1 -0
- package/build/utils/mergeEntityMutationTriggerConfigurations.d.ts +1 -1
- package/package.json +8 -5
- package/src/AuthorizationResultBasedEntityAssociationLoader.ts +56 -49
- package/src/AuthorizationResultBasedEntityLoader.ts +194 -81
- package/src/AuthorizationResultBasedEntityMutator.ts +71 -45
- package/src/ComposedEntityCacheAdapter.ts +55 -46
- package/src/ComposedSecondaryEntityCache.ts +5 -2
- package/src/EnforcingEntityAssociationLoader.ts +52 -44
- package/src/EnforcingEntityCreator.ts +5 -5
- package/src/EnforcingEntityDeleter.ts +5 -5
- package/src/EnforcingEntityLoader.ts +158 -21
- package/src/EnforcingEntityUpdater.ts +5 -5
- package/src/Entity.ts +39 -39
- package/src/EntityAssociationLoader.ts +6 -6
- package/src/EntityCompanion.ts +11 -11
- package/src/EntityCompanionProvider.ts +21 -18
- package/src/EntityConfiguration.ts +123 -9
- package/src/EntityCreator.ts +7 -7
- package/src/EntityDatabaseAdapter.ts +51 -28
- package/src/EntityDeleter.ts +7 -7
- package/src/EntityFieldDefinition.ts +32 -12
- package/src/EntityFields.ts +49 -12
- package/src/EntityLoader.ts +8 -8
- package/src/EntityLoaderFactory.ts +8 -8
- package/src/EntityLoaderUtils.ts +39 -10
- package/src/EntityMutationInfo.ts +6 -6
- package/src/EntityMutationTriggerConfiguration.ts +68 -20
- package/src/EntityMutationValidator.ts +4 -4
- package/src/EntityMutatorFactory.ts +13 -13
- package/src/EntityPrivacyPolicy.ts +50 -26
- package/src/EntitySecondaryCacheLoader.ts +6 -6
- package/src/EntityUpdater.ts +7 -7
- package/src/GenericEntityCacheAdapter.ts +39 -28
- package/src/GenericSecondaryEntityCache.ts +6 -3
- package/src/IEntityCacheAdapter.ts +45 -25
- package/src/IEntityCacheAdapterProvider.ts +3 -3
- package/src/IEntityDatabaseAdapterProvider.ts +3 -3
- package/src/IEntityGenericCacher.ts +33 -5
- package/src/ReadonlyEntity.ts +24 -24
- package/src/ViewerContext.ts +5 -5
- package/src/ViewerScopedEntityCompanion.ts +7 -7
- package/src/ViewerScopedEntityCompanionProvider.ts +6 -6
- package/src/ViewerScopedEntityLoaderFactory.ts +7 -7
- package/src/ViewerScopedEntityMutatorFactory.ts +8 -8
- package/src/__tests__/AuthorizationResultBasedEntityAssociationLoader-test.ts +4 -4
- package/src/__tests__/AuthorizationResultBasedEntityLoader-constructor-test.ts +14 -13
- package/src/__tests__/AuthorizationResultBasedEntityLoader-test.ts +367 -69
- package/src/__tests__/ComposedCacheAdapter-test.ts +235 -117
- package/src/__tests__/EnforcingEntityLoader-test.ts +135 -1
- package/src/__tests__/Entity-test.ts +2 -2
- package/src/__tests__/EntityAssociationLoader-test.ts +2 -2
- package/src/__tests__/EntityCommonUseCases-test.ts +11 -11
- package/src/__tests__/EntityCompanion-test.ts +4 -4
- package/src/__tests__/EntityCompanionProvider-test.ts +9 -8
- package/src/__tests__/EntityConfiguration-test.ts +85 -6
- package/src/__tests__/EntityDatabaseAdapter-test.ts +113 -17
- package/src/__tests__/EntityEdges-test.ts +97 -72
- package/src/__tests__/EntityFields-test.ts +2 -2
- package/src/__tests__/EntityLoader-test.ts +2 -2
- package/src/__tests__/EntityMutator-MutationCacheConsistency-test.ts +11 -11
- package/src/__tests__/EntityMutator-SingleCompositeFieldCacheConsistency-test.ts +73 -0
- package/src/__tests__/EntityMutator-test.ts +74 -46
- package/src/__tests__/EntityPrivacyPolicy-test.ts +51 -74
- package/src/__tests__/EntityQueryContext-test.ts +1 -1
- package/src/__tests__/EntitySecondaryCacheLoader-test.ts +3 -3
- package/src/__tests__/EntitySelfReferentialEdges-test.ts +64 -39
- package/src/__tests__/GenericEntityCacheAdapter-test.ts +83 -28
- package/src/__tests__/ReadonlyEntity-test.ts +3 -3
- package/src/__tests__/ViewerContext-test.ts +1 -1
- package/src/__tests__/ViewerScopedEntityCompanion-test.ts +5 -2
- package/src/__tests__/ViewerScopedEntityCompanionProvider-test.ts +1 -1
- package/src/__tests__/ViewerScopedEntityMutatorFactory-test.ts +12 -3
- package/src/__tests__/cases/TwoEntitySameTableDisjointRows-test.ts +12 -12
- package/src/__tests__/cases/TwoEntitySameTableOverlappingRows-test.ts +12 -12
- package/src/entityUtils.ts +4 -1
- package/src/errors/EntityInvalidFieldValueError.ts +5 -5
- package/src/errors/EntityNotAuthorizedError.ts +3 -3
- package/src/errors/EntityNotFoundError.ts +5 -5
- package/src/index.ts +7 -7
- package/src/internal/CompositeFieldHolder.ts +218 -0
- package/src/internal/CompositeFieldValueMap.ts +78 -0
- package/src/internal/EntityDataManager.ts +107 -96
- package/src/internal/EntityFieldTransformationUtils.ts +33 -14
- package/src/internal/EntityLoadInterfaces.ts +143 -0
- package/src/internal/EntityTableDataCoordinator.ts +8 -5
- package/src/internal/ReadThroughEntityCache.ts +63 -50
- package/src/internal/SingleFieldHolder.ts +131 -0
- package/src/internal/__tests__/CompositeFieldHolder-test.ts +25 -0
- package/src/internal/__tests__/CompositeFieldValueMap-test.ts +43 -0
- package/src/internal/__tests__/EntityDataManager-test.ts +308 -91
- package/src/internal/__tests__/EntityFieldTransformationUtils-test.ts +3 -2
- package/src/internal/__tests__/ReadThroughEntityCache-test.ts +315 -107
- package/src/metrics/EntityMetricsUtils.ts +7 -2
- package/src/metrics/IEntityMetricsAdapter.ts +6 -0
- package/src/rules/AlwaysAllowPrivacyPolicyRule.ts +5 -5
- package/src/rules/AlwaysDenyPrivacyPolicyRule.ts +5 -5
- package/src/rules/AlwaysSkipPrivacyPolicyRule.ts +5 -5
- package/src/rules/PrivacyPolicyRule.ts +4 -4
- package/src/rules/__tests__/AlwaysAllowPrivacyPolicyRule-test.ts +1 -1
- package/src/rules/__tests__/AlwaysDenyPrivacyPolicyRule-test.ts +1 -1
- package/src/rules/__tests__/AlwaysSkipPrivacyPolicyRule-test.ts +1 -1
- package/src/utils/EntityPrivacyUtils.ts +72 -30
- package/src/utils/{testing → __testfixtures__}/PrivacyPolicyRuleTestUtils.ts +26 -26
- package/src/{testfixtures → utils/__testfixtures__}/SimpleTestEntity.ts +16 -15
- package/src/utils/__testfixtures__/StubCacheAdapter.ts +164 -0
- package/src/utils/{testing → __testfixtures__}/StubDatabaseAdapter.ts +19 -12
- package/src/utils/{testing → __testfixtures__}/StubDatabaseAdapterProvider.ts +4 -4
- package/src/utils/__testfixtures__/TSMockitoExtensions.ts +69 -0
- package/src/{testfixtures → utils/__testfixtures__}/TestEntity.ts +21 -15
- package/src/{testfixtures → utils/__testfixtures__}/TestEntity2.ts +16 -15
- package/src/{testfixtures → utils/__testfixtures__}/TestEntityWithMutationTriggers.ts +23 -22
- package/src/{testfixtures → utils/__testfixtures__}/TestViewerContext.ts +1 -1
- package/src/utils/{testing → __testfixtures__}/describeFieldTestCase.ts +1 -1
- package/src/utils/__tests__/EntityPrivacyUtils-test.ts +62 -66
- package/src/utils/__tests__/canViewerDeleteAsync-edgeDeletionPermissionInferenceBehavior-test.ts +29 -25
- package/src/utils/__tests__/mergeEntityMutationTriggerConfigurations-test.ts +1 -1
- package/src/utils/collections/SerializableKeyMap.ts +84 -0
- package/src/utils/collections/__tests__/SerializableKeyMap-test.ts +119 -0
- package/src/utils/collections/__tests__/sets-test.ts +17 -0
- package/src/utils/collections/maps.ts +7 -8
- package/src/utils/collections/sets.ts +3 -0
- package/src/utils/mergeEntityMutationTriggerConfigurations.ts +5 -5
- package/build/__tests__/AuthorizationResultBasedEntityAssociationLoader-test.d.ts +0 -1
- package/build/__tests__/AuthorizationResultBasedEntityAssociationLoader-test.js +0 -242
- package/build/__tests__/AuthorizationResultBasedEntityAssociationLoader-test.js.map +0 -1
- package/build/__tests__/AuthorizationResultBasedEntityLoader-constructor-test.d.ts +0 -26
- package/build/__tests__/AuthorizationResultBasedEntityLoader-constructor-test.js +0 -110
- package/build/__tests__/AuthorizationResultBasedEntityLoader-constructor-test.js.map +0 -1
- package/build/__tests__/AuthorizationResultBasedEntityLoader-test.d.ts +0 -1
- package/build/__tests__/AuthorizationResultBasedEntityLoader-test.js +0 -401
- package/build/__tests__/AuthorizationResultBasedEntityLoader-test.js.map +0 -1
- package/build/__tests__/ComposedCacheAdapter-test.d.ts +0 -1
- package/build/__tests__/ComposedCacheAdapter-test.js +0 -229
- package/build/__tests__/ComposedCacheAdapter-test.js.map +0 -1
- package/build/__tests__/ComposedSecondaryEntityCache-test.d.ts +0 -1
- package/build/__tests__/ComposedSecondaryEntityCache-test.js +0 -66
- package/build/__tests__/ComposedSecondaryEntityCache-test.js.map +0 -1
- package/build/__tests__/EnforcingEntityAssociationLoader-test.d.ts +0 -1
- package/build/__tests__/EnforcingEntityAssociationLoader-test.js +0 -115
- package/build/__tests__/EnforcingEntityAssociationLoader-test.js.map +0 -1
- package/build/__tests__/EnforcingEntityLoader-test.d.ts +0 -1
- package/build/__tests__/EnforcingEntityLoader-test.js +0 -253
- package/build/__tests__/EnforcingEntityLoader-test.js.map +0 -1
- package/build/__tests__/Entity-test.d.ts +0 -1
- package/build/__tests__/Entity-test.js +0 -94
- package/build/__tests__/Entity-test.js.map +0 -1
- package/build/__tests__/EntityAssociationLoader-test.d.ts +0 -1
- package/build/__tests__/EntityAssociationLoader-test.js +0 -30
- package/build/__tests__/EntityAssociationLoader-test.js.map +0 -1
- package/build/__tests__/EntityCommonUseCases-test.d.ts +0 -1
- package/build/__tests__/EntityCommonUseCases-test.js +0 -146
- package/build/__tests__/EntityCommonUseCases-test.js.map +0 -1
- package/build/__tests__/EntityCompanion-test.d.ts +0 -1
- package/build/__tests__/EntityCompanion-test.js +0 -77
- package/build/__tests__/EntityCompanion-test.js.map +0 -1
- package/build/__tests__/EntityCompanionProvider-test.d.ts +0 -1
- package/build/__tests__/EntityCompanionProvider-test.js +0 -54
- package/build/__tests__/EntityCompanionProvider-test.js.map +0 -1
- package/build/__tests__/EntityConfiguration-test.d.ts +0 -1
- package/build/__tests__/EntityConfiguration-test.js +0 -103
- package/build/__tests__/EntityConfiguration-test.js.map +0 -1
- package/build/__tests__/EntityDatabaseAdapter-test.d.ts +0 -1
- package/build/__tests__/EntityDatabaseAdapter-test.js +0 -146
- package/build/__tests__/EntityDatabaseAdapter-test.js.map +0 -1
- package/build/__tests__/EntityEdges-test.d.ts +0 -1
- package/build/__tests__/EntityEdges-test.js +0 -723
- package/build/__tests__/EntityEdges-test.js.map +0 -1
- package/build/__tests__/EntityFields-test.d.ts +0 -1
- package/build/__tests__/EntityFields-test.js +0 -63
- package/build/__tests__/EntityFields-test.js.map +0 -1
- package/build/__tests__/EntityLoader-test.d.ts +0 -1
- package/build/__tests__/EntityLoader-test.js +0 -36
- package/build/__tests__/EntityLoader-test.js.map +0 -1
- package/build/__tests__/EntityMutator-MutationCacheConsistency-test.d.ts +0 -1
- package/build/__tests__/EntityMutator-MutationCacheConsistency-test.js +0 -73
- package/build/__tests__/EntityMutator-MutationCacheConsistency-test.js.map +0 -1
- package/build/__tests__/EntityMutator-test.d.ts +0 -1
- package/build/__tests__/EntityMutator-test.js +0 -741
- package/build/__tests__/EntityMutator-test.js.map +0 -1
- package/build/__tests__/EntityPrivacyPolicy-test.d.ts +0 -1
- package/build/__tests__/EntityPrivacyPolicy-test.js +0 -463
- package/build/__tests__/EntityPrivacyPolicy-test.js.map +0 -1
- package/build/__tests__/EntityQueryContext-test.d.ts +0 -1
- package/build/__tests__/EntityQueryContext-test.js +0 -116
- package/build/__tests__/EntityQueryContext-test.js.map +0 -1
- package/build/__tests__/EntitySecondaryCacheLoader-test.d.ts +0 -1
- package/build/__tests__/EntitySecondaryCacheLoader-test.js +0 -60
- package/build/__tests__/EntitySecondaryCacheLoader-test.js.map +0 -1
- package/build/__tests__/EntitySelfReferentialEdges-test.d.ts +0 -1
- package/build/__tests__/EntitySelfReferentialEdges-test.js +0 -201
- package/build/__tests__/EntitySelfReferentialEdges-test.js.map +0 -1
- package/build/__tests__/GenericEntityCacheAdapter-test.d.ts +0 -1
- package/build/__tests__/GenericEntityCacheAdapter-test.js +0 -80
- package/build/__tests__/GenericEntityCacheAdapter-test.js.map +0 -1
- package/build/__tests__/ReadonlyEntity-test.d.ts +0 -1
- package/build/__tests__/ReadonlyEntity-test.js +0 -211
- package/build/__tests__/ReadonlyEntity-test.js.map +0 -1
- package/build/__tests__/ViewerContext-test.d.ts +0 -1
- package/build/__tests__/ViewerContext-test.js +0 -30
- package/build/__tests__/ViewerContext-test.js.map +0 -1
- package/build/__tests__/ViewerScopedEntityCompanion-test.d.ts +0 -1
- package/build/__tests__/ViewerScopedEntityCompanion-test.js +0 -20
- package/build/__tests__/ViewerScopedEntityCompanion-test.js.map +0 -1
- package/build/__tests__/ViewerScopedEntityCompanionProvider-test.d.ts +0 -1
- package/build/__tests__/ViewerScopedEntityCompanionProvider-test.js +0 -20
- package/build/__tests__/ViewerScopedEntityCompanionProvider-test.js.map +0 -1
- package/build/__tests__/ViewerScopedEntityLoaderFactory-test.d.ts +0 -1
- package/build/__tests__/ViewerScopedEntityLoaderFactory-test.js +0 -23
- package/build/__tests__/ViewerScopedEntityLoaderFactory-test.js.map +0 -1
- package/build/__tests__/ViewerScopedEntityMutatorFactory-test.d.ts +0 -1
- package/build/__tests__/ViewerScopedEntityMutatorFactory-test.js +0 -22
- package/build/__tests__/ViewerScopedEntityMutatorFactory-test.js.map +0 -1
- package/build/__tests__/cases/TwoEntitySameTableDisjointRows-test.d.ts +0 -1
- package/build/__tests__/cases/TwoEntitySameTableDisjointRows-test.js +0 -123
- package/build/__tests__/cases/TwoEntitySameTableDisjointRows-test.js.map +0 -1
- package/build/__tests__/cases/TwoEntitySameTableOverlappingRows-test.d.ts +0 -1
- package/build/__tests__/cases/TwoEntitySameTableOverlappingRows-test.js +0 -121
- package/build/__tests__/cases/TwoEntitySameTableOverlappingRows-test.js.map +0 -1
- package/build/__tests__/entityUtils-test.d.ts +0 -1
- package/build/__tests__/entityUtils-test.js +0 -87
- package/build/__tests__/entityUtils-test.js.map +0 -1
- package/build/internal/__tests__/EntityDataManager-test.d.ts +0 -1
- package/build/internal/__tests__/EntityDataManager-test.js +0 -373
- package/build/internal/__tests__/EntityDataManager-test.js.map +0 -1
- package/build/internal/__tests__/EntityFieldTransformationUtils-test.d.ts +0 -1
- package/build/internal/__tests__/EntityFieldTransformationUtils-test.js +0 -136
- package/build/internal/__tests__/EntityFieldTransformationUtils-test.js.map +0 -1
- package/build/internal/__tests__/ReadThroughEntityCache-test.d.ts +0 -1
- package/build/internal/__tests__/ReadThroughEntityCache-test.js +0 -206
- package/build/internal/__tests__/ReadThroughEntityCache-test.js.map +0 -1
- package/build/rules/__tests__/AlwaysAllowPrivacyPolicyRule-test.d.ts +0 -1
- package/build/rules/__tests__/AlwaysAllowPrivacyPolicyRule-test.js +0 -21
- package/build/rules/__tests__/AlwaysAllowPrivacyPolicyRule-test.js.map +0 -1
- package/build/rules/__tests__/AlwaysDenyPrivacyPolicyRule-test.d.ts +0 -1
- package/build/rules/__tests__/AlwaysDenyPrivacyPolicyRule-test.js +0 -21
- package/build/rules/__tests__/AlwaysDenyPrivacyPolicyRule-test.js.map +0 -1
- package/build/rules/__tests__/AlwaysSkipPrivacyPolicyRule-test.d.ts +0 -1
- package/build/rules/__tests__/AlwaysSkipPrivacyPolicyRule-test.js +0 -21
- package/build/rules/__tests__/AlwaysSkipPrivacyPolicyRule-test.js.map +0 -1
- package/build/testfixtures/DateIDTestEntity.d.ts +0 -19
- package/build/testfixtures/DateIDTestEntity.js +0 -48
- package/build/testfixtures/DateIDTestEntity.js.map +0 -1
- package/build/testfixtures/SimpleTestEntity.d.ts +0 -20
- package/build/testfixtures/SimpleTestEntity.js +0 -48
- package/build/testfixtures/SimpleTestEntity.js.map +0 -1
- package/build/testfixtures/TestEntity.d.ts +0 -30
- package/build/testfixtures/TestEntity.js +0 -93
- package/build/testfixtures/TestEntity.js.map +0 -1
- package/build/testfixtures/TestEntity2.d.ts +0 -20
- package/build/testfixtures/TestEntity2.js +0 -51
- package/build/testfixtures/TestEntity2.js.map +0 -1
- package/build/testfixtures/TestEntityNumberKey.d.ts +0 -19
- package/build/testfixtures/TestEntityNumberKey.js +0 -48
- package/build/testfixtures/TestEntityNumberKey.js.map +0 -1
- package/build/testfixtures/TestEntityWithMutationTriggers.d.ts +0 -36
- package/build/testfixtures/TestEntityWithMutationTriggers.js +0 -82
- package/build/testfixtures/TestEntityWithMutationTriggers.js.map +0 -1
- package/build/testfixtures/TestViewerContext.d.ts +0 -3
- package/build/testfixtures/TestViewerContext.js +0 -10
- package/build/testfixtures/TestViewerContext.js.map +0 -1
- package/build/utils/__tests__/EntityPrivacyUtils-test.d.ts +0 -1
- package/build/utils/__tests__/EntityPrivacyUtils-test.js +0 -486
- package/build/utils/__tests__/EntityPrivacyUtils-test.js.map +0 -1
- package/build/utils/__tests__/canViewerDeleteAsync-edgeDeletionPermissionInferenceBehavior-test.d.ts +0 -1
- package/build/utils/__tests__/canViewerDeleteAsync-edgeDeletionPermissionInferenceBehavior-test.js +0 -178
- package/build/utils/__tests__/canViewerDeleteAsync-edgeDeletionPermissionInferenceBehavior-test.js.map +0 -1
- package/build/utils/__tests__/mergeEntityMutationTriggerConfigurations-test.d.ts +0 -1
- package/build/utils/__tests__/mergeEntityMutationTriggerConfigurations-test.js +0 -26
- package/build/utils/__tests__/mergeEntityMutationTriggerConfigurations-test.js.map +0 -1
- package/build/utils/collections/__tests__/maps-test.d.ts +0 -1
- package/build/utils/collections/__tests__/maps-test.js +0 -120
- package/build/utils/collections/__tests__/maps-test.js.map +0 -1
- package/build/utils/testing/PrivacyPolicyRuleTestUtils.d.ts +0 -28
- package/build/utils/testing/PrivacyPolicyRuleTestUtils.js +0 -52
- package/build/utils/testing/PrivacyPolicyRuleTestUtils.js.map +0 -1
- package/build/utils/testing/StubCacheAdapter.d.ts +0 -27
- package/build/utils/testing/StubCacheAdapter.js +0 -86
- package/build/utils/testing/StubCacheAdapter.js.map +0 -1
- package/build/utils/testing/StubDatabaseAdapter.d.ts +0 -25
- package/build/utils/testing/StubDatabaseAdapter.js +0 -191
- package/build/utils/testing/StubDatabaseAdapter.js.map +0 -1
- package/build/utils/testing/StubDatabaseAdapterProvider.d.ts +0 -7
- package/build/utils/testing/StubDatabaseAdapterProvider.js +0 -14
- package/build/utils/testing/StubDatabaseAdapterProvider.js.map +0 -1
- package/build/utils/testing/StubQueryContextProvider.d.ts +0 -7
- package/build/utils/testing/StubQueryContextProvider.js +0 -19
- package/build/utils/testing/StubQueryContextProvider.js.map +0 -1
- package/build/utils/testing/__tests__/PrivacyPolicyRuleTestUtils-test.d.ts +0 -1
- package/build/utils/testing/__tests__/PrivacyPolicyRuleTestUtils-test.js +0 -42
- package/build/utils/testing/__tests__/PrivacyPolicyRuleTestUtils-test.js.map +0 -1
- package/build/utils/testing/__tests__/StubDatabaseAdapter-test.d.ts +0 -1
- package/build/utils/testing/__tests__/StubDatabaseAdapter-test.js +0 -402
- package/build/utils/testing/__tests__/StubDatabaseAdapter-test.js.map +0 -1
- package/build/utils/testing/createUnitTestEntityCompanionProvider.d.ts +0 -7
- package/build/utils/testing/createUnitTestEntityCompanionProvider.js +0 -36
- package/build/utils/testing/createUnitTestEntityCompanionProvider.js.map +0 -1
- package/build/utils/testing/describeFieldTestCase.d.ts +0 -2
- package/build/utils/testing/describeFieldTestCase.js +0 -18
- package/build/utils/testing/describeFieldTestCase.js.map +0 -1
- package/src/testfixtures/DateIDTestEntity.ts +0 -59
- package/src/testfixtures/TestEntityNumberKey.ts +0 -59
- package/src/utils/testing/StubCacheAdapter.ts +0 -122
- package/src/utils/testing/__tests__/PrivacyPolicyRuleTestUtils-test.ts +0 -42
- package/src/utils/testing/__tests__/StubDatabaseAdapter-test.ts +0 -548
- /package/src/utils/{testing → __testfixtures__}/StubQueryContextProvider.ts +0 -0
- /package/src/utils/{testing → __testfixtures__}/createUnitTestEntityCompanionProvider.ts +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import invariant from 'invariant';
|
|
2
|
-
|
|
3
1
|
import ComposedEntityCacheAdapter from '../ComposedEntityCacheAdapter';
|
|
4
2
|
import EntityConfiguration from '../EntityConfiguration';
|
|
5
3
|
import { UUIDField } from '../EntityFields';
|
|
6
4
|
import IEntityCacheAdapter from '../IEntityCacheAdapter';
|
|
5
|
+
import { IEntityLoadKey, IEntityLoadValue } from '../internal/EntityLoadInterfaces';
|
|
7
6
|
import { CacheLoadResult, CacheStatus } from '../internal/ReadThroughEntityCache';
|
|
7
|
+
import { SingleFieldHolder, SingleFieldValueHolder } from '../internal/SingleFieldHolder';
|
|
8
8
|
|
|
9
9
|
type BlahFields = {
|
|
10
10
|
id: string;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
const entityConfiguration = new EntityConfiguration<BlahFields>({
|
|
13
|
+
const entityConfiguration = new EntityConfiguration<BlahFields, 'id'>({
|
|
14
14
|
idField: 'id',
|
|
15
15
|
tableName: 'blah',
|
|
16
16
|
schema: {
|
|
@@ -21,37 +21,43 @@ const entityConfiguration = new EntityConfiguration<BlahFields>({
|
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
export const DOES_NOT_EXIST_LOCAL_MEMORY_CACHE = Symbol('doesNotExist');
|
|
24
|
-
type LocalMemoryCacheValue<TFields
|
|
24
|
+
type LocalMemoryCacheValue<TFields extends Record<string, any>> =
|
|
25
|
+
| Readonly<TFields>
|
|
26
|
+
| typeof DOES_NOT_EXIST_LOCAL_MEMORY_CACHE;
|
|
25
27
|
|
|
26
|
-
class TestLocalCacheAdapter<TFields extends Record<string, any
|
|
27
|
-
implements IEntityCacheAdapter<TFields>
|
|
28
|
+
class TestLocalCacheAdapter<TFields extends Record<string, any>, TIDField extends keyof TFields>
|
|
29
|
+
implements IEntityCacheAdapter<TFields, TIDField>
|
|
28
30
|
{
|
|
29
31
|
constructor(
|
|
30
|
-
private readonly entityConfiguration: EntityConfiguration<TFields>,
|
|
32
|
+
private readonly entityConfiguration: EntityConfiguration<TFields, TIDField>,
|
|
31
33
|
private readonly cache: Map<string, LocalMemoryCacheValue<TFields>>,
|
|
32
34
|
) {}
|
|
33
35
|
|
|
34
|
-
public async loadManyAsync<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
public async loadManyAsync<
|
|
37
|
+
TLoadKey extends IEntityLoadKey<TFields, TIDField, TSerializedLoadValue, TLoadValue>,
|
|
38
|
+
TSerializedLoadValue,
|
|
39
|
+
TLoadValue extends IEntityLoadValue<TSerializedLoadValue>,
|
|
40
|
+
>(
|
|
41
|
+
key: TLoadKey,
|
|
42
|
+
values: readonly TLoadValue[],
|
|
43
|
+
): Promise<ReadonlyMap<TLoadValue, CacheLoadResult<TFields>>> {
|
|
38
44
|
const localMemoryCacheKeyToFieldValueMapping = new Map(
|
|
39
|
-
|
|
45
|
+
values.map((value) => [this.makeCacheKey(key, value), value]),
|
|
40
46
|
);
|
|
41
|
-
const cacheResults =
|
|
42
|
-
for (const [cacheKey,
|
|
47
|
+
const cacheResults = key.vendNewLoadValueMap<CacheLoadResult<TFields>>();
|
|
48
|
+
for (const [cacheKey, value] of localMemoryCacheKeyToFieldValueMapping) {
|
|
43
49
|
const cacheResult = this.cache.get(cacheKey);
|
|
44
50
|
if (cacheResult === DOES_NOT_EXIST_LOCAL_MEMORY_CACHE) {
|
|
45
|
-
cacheResults.set(
|
|
51
|
+
cacheResults.set(value, {
|
|
46
52
|
status: CacheStatus.NEGATIVE,
|
|
47
53
|
});
|
|
48
54
|
} else if (cacheResult) {
|
|
49
|
-
cacheResults.set(
|
|
55
|
+
cacheResults.set(value, {
|
|
50
56
|
status: CacheStatus.HIT,
|
|
51
57
|
item: cacheResult,
|
|
52
58
|
});
|
|
53
59
|
} else {
|
|
54
|
-
cacheResults.set(
|
|
60
|
+
cacheResults.set(value, {
|
|
55
61
|
status: CacheStatus.MISS,
|
|
56
62
|
});
|
|
57
63
|
}
|
|
@@ -60,62 +66,63 @@ class TestLocalCacheAdapter<TFields extends Record<string, any>>
|
|
|
60
66
|
return cacheResults;
|
|
61
67
|
}
|
|
62
68
|
|
|
63
|
-
public async cacheManyAsync<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
public async cacheManyAsync<
|
|
70
|
+
TLoadKey extends IEntityLoadKey<TFields, TIDField, TSerializedLoadValue, TLoadValue>,
|
|
71
|
+
TSerializedLoadValue,
|
|
72
|
+
TLoadValue extends IEntityLoadValue<TSerializedLoadValue>,
|
|
73
|
+
>(key: TLoadKey, objectMap: ReadonlyMap<TLoadValue, Readonly<TFields>>): Promise<void> {
|
|
74
|
+
for (const [value, item] of objectMap) {
|
|
75
|
+
const cacheKey = this.makeCacheKey(key, value);
|
|
69
76
|
this.cache.set(cacheKey, item);
|
|
70
77
|
}
|
|
71
78
|
}
|
|
72
79
|
|
|
73
|
-
public async cacheDBMissesAsync<
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
80
|
+
public async cacheDBMissesAsync<
|
|
81
|
+
TLoadKey extends IEntityLoadKey<TFields, TIDField, TSerializedLoadValue, TLoadValue>,
|
|
82
|
+
TSerializedLoadValue,
|
|
83
|
+
TLoadValue extends IEntityLoadValue<TSerializedLoadValue>,
|
|
84
|
+
>(key: TLoadKey, values: readonly TLoadValue[]): Promise<void> {
|
|
85
|
+
for (const value of values) {
|
|
86
|
+
const cacheKey = this.makeCacheKey(key, value);
|
|
79
87
|
this.cache.set(cacheKey, DOES_NOT_EXIST_LOCAL_MEMORY_CACHE);
|
|
80
88
|
}
|
|
81
89
|
}
|
|
82
90
|
|
|
83
|
-
public async invalidateManyAsync<
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
91
|
+
public async invalidateManyAsync<
|
|
92
|
+
TLoadKey extends IEntityLoadKey<TFields, TIDField, TSerializedLoadValue, TLoadValue>,
|
|
93
|
+
TSerializedLoadValue,
|
|
94
|
+
TLoadValue extends IEntityLoadValue<TSerializedLoadValue>,
|
|
95
|
+
>(key: TLoadKey, values: readonly TLoadValue[]): Promise<void> {
|
|
96
|
+
for (const value of values) {
|
|
97
|
+
const cacheKey = this.makeCacheKey(key, value);
|
|
89
98
|
this.cache.delete(cacheKey);
|
|
90
99
|
}
|
|
91
100
|
}
|
|
92
101
|
|
|
93
|
-
private makeCacheKey<
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
const parts =
|
|
102
|
+
private makeCacheKey<
|
|
103
|
+
TLoadKey extends IEntityLoadKey<TFields, TIDField, TSerializedLoadValue, TLoadValue>,
|
|
104
|
+
TSerializedLoadValue,
|
|
105
|
+
TLoadValue extends IEntityLoadValue<TSerializedLoadValue>,
|
|
106
|
+
>(key: TLoadKey, value: TLoadValue): string {
|
|
107
|
+
const cacheKeyType = key.getLoadMethodType();
|
|
108
|
+
const parts = key.createCacheKeyPartsForLoadValue(this.entityConfiguration, value);
|
|
109
|
+
const delimiter = ':';
|
|
110
|
+
const escapedParts = [
|
|
100
111
|
this.entityConfiguration.tableName,
|
|
112
|
+
cacheKeyType,
|
|
101
113
|
`${this.entityConfiguration.cacheKeyVersion}`,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
];
|
|
105
|
-
const delimiter = ':';
|
|
106
|
-
const escapedParts = parts.map((part) =>
|
|
107
|
-
part.replace('\\', '\\\\').replace(delimiter, `\\${delimiter}`),
|
|
108
|
-
);
|
|
114
|
+
...parts,
|
|
115
|
+
].map((part) => part.replace('\\', '\\\\').replace(delimiter, `\\${delimiter}`));
|
|
109
116
|
return escapedParts.join(delimiter);
|
|
110
117
|
}
|
|
111
118
|
}
|
|
112
119
|
|
|
113
120
|
function makeTestCacheAdapters(): {
|
|
114
121
|
primaryCache: Map<string, LocalMemoryCacheValue<BlahFields>>;
|
|
115
|
-
primaryCacheAdapter: TestLocalCacheAdapter<BlahFields>;
|
|
122
|
+
primaryCacheAdapter: TestLocalCacheAdapter<BlahFields, 'id'>;
|
|
116
123
|
fallbackCache: Map<string, LocalMemoryCacheValue<BlahFields>>;
|
|
117
|
-
fallbackCacheAdapter: TestLocalCacheAdapter<BlahFields>;
|
|
118
|
-
cacheAdapter: ComposedEntityCacheAdapter<BlahFields>;
|
|
124
|
+
fallbackCacheAdapter: TestLocalCacheAdapter<BlahFields, 'id'>;
|
|
125
|
+
cacheAdapter: ComposedEntityCacheAdapter<BlahFields, 'id'>;
|
|
119
126
|
} {
|
|
120
127
|
const primaryCache = new Map();
|
|
121
128
|
const primaryCacheAdapter = new TestLocalCacheAdapter(entityConfiguration, primaryCache);
|
|
@@ -139,96 +146,158 @@ describe(ComposedEntityCacheAdapter, () => {
|
|
|
139
146
|
it('returns primary results when populated', async () => {
|
|
140
147
|
const { primaryCacheAdapter, cacheAdapter } = makeTestCacheAdapters();
|
|
141
148
|
|
|
142
|
-
const cacheHits = new Map<
|
|
143
|
-
|
|
144
|
-
await primaryCacheAdapter.cacheDBMissesAsync('id', ['test-id-2']);
|
|
145
|
-
|
|
146
|
-
const results = await cacheAdapter.loadManyAsync('id', [
|
|
147
|
-
'test-id-1',
|
|
148
|
-
'test-id-2',
|
|
149
|
-
'test-id-3',
|
|
149
|
+
const cacheHits = new Map<SingleFieldValueHolder<BlahFields, 'id'>, Readonly<BlahFields>>([
|
|
150
|
+
[new SingleFieldValueHolder('test-id-1'), { id: 'test-id-1' }],
|
|
150
151
|
]);
|
|
152
|
+
await primaryCacheAdapter.cacheManyAsync(
|
|
153
|
+
new SingleFieldHolder<BlahFields, 'id', 'id'>('id'),
|
|
154
|
+
cacheHits,
|
|
155
|
+
);
|
|
156
|
+
await primaryCacheAdapter.cacheDBMissesAsync(
|
|
157
|
+
new SingleFieldHolder<BlahFields, 'id', 'id'>('id'),
|
|
158
|
+
[new SingleFieldValueHolder('test-id-2')],
|
|
159
|
+
);
|
|
151
160
|
|
|
152
|
-
|
|
161
|
+
const results = await cacheAdapter.loadManyAsync(
|
|
162
|
+
new SingleFieldHolder<BlahFields, 'id', 'id'>('id'),
|
|
163
|
+
[
|
|
164
|
+
new SingleFieldValueHolder('test-id-1'),
|
|
165
|
+
new SingleFieldValueHolder('test-id-2'),
|
|
166
|
+
new SingleFieldValueHolder('test-id-3'),
|
|
167
|
+
],
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
expect(results.get(new SingleFieldValueHolder('test-id-1'))).toMatchObject({
|
|
153
171
|
status: CacheStatus.HIT,
|
|
154
172
|
item: { id: 'test-id-1' },
|
|
155
173
|
});
|
|
156
|
-
expect(results.get('test-id-2')).toMatchObject({
|
|
157
|
-
|
|
174
|
+
expect(results.get(new SingleFieldValueHolder('test-id-2'))).toMatchObject({
|
|
175
|
+
status: CacheStatus.NEGATIVE,
|
|
176
|
+
});
|
|
177
|
+
expect(results.get(new SingleFieldValueHolder('test-id-3'))).toMatchObject({
|
|
178
|
+
status: CacheStatus.MISS,
|
|
179
|
+
});
|
|
158
180
|
expect(results.size).toBe(3);
|
|
159
181
|
});
|
|
160
182
|
|
|
161
183
|
it('returns fallback adapter results primary is empty', async () => {
|
|
162
184
|
const { fallbackCacheAdapter, cacheAdapter } = makeTestCacheAdapters();
|
|
163
185
|
|
|
164
|
-
const cacheHits = new Map<
|
|
165
|
-
|
|
166
|
-
await fallbackCacheAdapter.cacheDBMissesAsync('id', ['test-id-2']);
|
|
167
|
-
|
|
168
|
-
const results = await cacheAdapter.loadManyAsync('id', [
|
|
169
|
-
'test-id-1',
|
|
170
|
-
'test-id-2',
|
|
171
|
-
'test-id-3',
|
|
186
|
+
const cacheHits = new Map<SingleFieldValueHolder<BlahFields, 'id'>, Readonly<BlahFields>>([
|
|
187
|
+
[new SingleFieldValueHolder('test-id-1'), { id: 'test-id-1' }],
|
|
172
188
|
]);
|
|
189
|
+
await fallbackCacheAdapter.cacheManyAsync(
|
|
190
|
+
new SingleFieldHolder<BlahFields, 'id', 'id'>('id'),
|
|
191
|
+
cacheHits,
|
|
192
|
+
);
|
|
193
|
+
await fallbackCacheAdapter.cacheDBMissesAsync(
|
|
194
|
+
new SingleFieldHolder<BlahFields, 'id', 'id'>('id'),
|
|
195
|
+
[new SingleFieldValueHolder('test-id-2')],
|
|
196
|
+
);
|
|
197
|
+
|
|
198
|
+
const results = await cacheAdapter.loadManyAsync(
|
|
199
|
+
new SingleFieldHolder<BlahFields, 'id', 'id'>('id'),
|
|
200
|
+
[
|
|
201
|
+
new SingleFieldValueHolder('test-id-1'),
|
|
202
|
+
new SingleFieldValueHolder('test-id-2'),
|
|
203
|
+
new SingleFieldValueHolder('test-id-3'),
|
|
204
|
+
],
|
|
205
|
+
);
|
|
173
206
|
|
|
174
|
-
expect(results.get('test-id-1')).toMatchObject({
|
|
207
|
+
expect(results.get(new SingleFieldValueHolder('test-id-1'))).toMatchObject({
|
|
175
208
|
status: CacheStatus.HIT,
|
|
176
209
|
item: { id: 'test-id-1' },
|
|
177
210
|
});
|
|
178
|
-
expect(results.get('test-id-2')).toMatchObject({
|
|
179
|
-
|
|
211
|
+
expect(results.get(new SingleFieldValueHolder('test-id-2'))).toMatchObject({
|
|
212
|
+
status: CacheStatus.NEGATIVE,
|
|
213
|
+
});
|
|
214
|
+
expect(results.get(new SingleFieldValueHolder('test-id-3'))).toMatchObject({
|
|
215
|
+
status: CacheStatus.MISS,
|
|
216
|
+
});
|
|
180
217
|
expect(results.size).toBe(3);
|
|
181
218
|
});
|
|
182
219
|
|
|
183
220
|
it('populates primary adapter with fallback adapter results', async () => {
|
|
184
221
|
const { primaryCacheAdapter, fallbackCacheAdapter, cacheAdapter } = makeTestCacheAdapters();
|
|
185
222
|
|
|
186
|
-
const cacheHits = new Map<
|
|
187
|
-
|
|
188
|
-
|
|
223
|
+
const cacheHits = new Map<SingleFieldValueHolder<BlahFields, 'id'>, Readonly<BlahFields>>([
|
|
224
|
+
[new SingleFieldValueHolder('test-id-1'), { id: 'test-id-1' }],
|
|
225
|
+
]);
|
|
226
|
+
await fallbackCacheAdapter.cacheManyAsync(
|
|
227
|
+
new SingleFieldHolder<BlahFields, 'id', 'id'>('id'),
|
|
228
|
+
cacheHits,
|
|
229
|
+
);
|
|
230
|
+
await fallbackCacheAdapter.cacheDBMissesAsync(
|
|
231
|
+
new SingleFieldHolder<BlahFields, 'id', 'id'>('id'),
|
|
232
|
+
[new SingleFieldValueHolder('test-id-2')],
|
|
233
|
+
);
|
|
189
234
|
|
|
190
235
|
// should populate primary cache with fallback cache results
|
|
191
|
-
await cacheAdapter.loadManyAsync(
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
'test-id-
|
|
195
|
-
'test-id-2',
|
|
196
|
-
'test-id-3',
|
|
236
|
+
await cacheAdapter.loadManyAsync(new SingleFieldHolder<BlahFields, 'id', 'id'>('id'), [
|
|
237
|
+
new SingleFieldValueHolder('test-id-1'),
|
|
238
|
+
new SingleFieldValueHolder('test-id-2'),
|
|
239
|
+
new SingleFieldValueHolder('test-id-3'),
|
|
197
240
|
]);
|
|
198
241
|
|
|
199
|
-
|
|
242
|
+
const primaryResults = await primaryCacheAdapter.loadManyAsync(
|
|
243
|
+
new SingleFieldHolder<BlahFields, 'id', 'id'>('id'),
|
|
244
|
+
[
|
|
245
|
+
new SingleFieldValueHolder('test-id-1'),
|
|
246
|
+
new SingleFieldValueHolder('test-id-2'),
|
|
247
|
+
new SingleFieldValueHolder('test-id-3'),
|
|
248
|
+
],
|
|
249
|
+
);
|
|
250
|
+
|
|
251
|
+
expect(primaryResults.get(new SingleFieldValueHolder('test-id-1'))).toMatchObject({
|
|
200
252
|
status: CacheStatus.HIT,
|
|
201
253
|
item: { id: 'test-id-1' },
|
|
202
254
|
});
|
|
203
|
-
expect(primaryResults.get('test-id-2')).toMatchObject({
|
|
204
|
-
|
|
255
|
+
expect(primaryResults.get(new SingleFieldValueHolder('test-id-2'))).toMatchObject({
|
|
256
|
+
status: CacheStatus.NEGATIVE,
|
|
257
|
+
});
|
|
258
|
+
expect(primaryResults.get(new SingleFieldValueHolder('test-id-3'))).toMatchObject({
|
|
259
|
+
status: CacheStatus.MISS,
|
|
260
|
+
});
|
|
205
261
|
expect(primaryResults.size).toBe(3);
|
|
206
262
|
|
|
207
263
|
// ensure that populating the primary cache doesn't change the output
|
|
208
|
-
const composedResults = await cacheAdapter.loadManyAsync(
|
|
209
|
-
'
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
264
|
+
const composedResults = await cacheAdapter.loadManyAsync(
|
|
265
|
+
new SingleFieldHolder<BlahFields, 'id', 'id'>('id'),
|
|
266
|
+
[
|
|
267
|
+
new SingleFieldValueHolder('test-id-1'),
|
|
268
|
+
new SingleFieldValueHolder('test-id-2'),
|
|
269
|
+
new SingleFieldValueHolder('test-id-3'),
|
|
270
|
+
],
|
|
271
|
+
);
|
|
272
|
+
expect(composedResults.get(new SingleFieldValueHolder('test-id-1'))).toMatchObject({
|
|
214
273
|
status: CacheStatus.HIT,
|
|
215
274
|
item: { id: 'test-id-1' },
|
|
216
275
|
});
|
|
217
|
-
expect(composedResults.get('test-id-2')).toMatchObject({
|
|
218
|
-
|
|
276
|
+
expect(composedResults.get(new SingleFieldValueHolder('test-id-2'))).toMatchObject({
|
|
277
|
+
status: CacheStatus.NEGATIVE,
|
|
278
|
+
});
|
|
279
|
+
expect(composedResults.get(new SingleFieldValueHolder('test-id-3'))).toMatchObject({
|
|
280
|
+
status: CacheStatus.MISS,
|
|
281
|
+
});
|
|
219
282
|
expect(composedResults.size).toBe(3);
|
|
220
283
|
});
|
|
221
284
|
|
|
222
|
-
it('returns empty map when passed empty array of
|
|
285
|
+
it('returns empty map when passed empty array of values', async () => {
|
|
223
286
|
const { cacheAdapter } = makeTestCacheAdapters();
|
|
224
|
-
const results = await cacheAdapter.loadManyAsync(
|
|
225
|
-
|
|
287
|
+
const results = await cacheAdapter.loadManyAsync(
|
|
288
|
+
new SingleFieldHolder<BlahFields, 'id', 'id'>('id'),
|
|
289
|
+
[] as any,
|
|
290
|
+
);
|
|
291
|
+
expect(results.size).toBe(0);
|
|
226
292
|
});
|
|
227
293
|
|
|
228
294
|
it('handles 0 cache adapter compose case', async () => {
|
|
229
|
-
const cacheAdapter = new ComposedEntityCacheAdapter<
|
|
230
|
-
const results = await cacheAdapter.loadManyAsync(
|
|
231
|
-
|
|
295
|
+
const cacheAdapter = new ComposedEntityCacheAdapter<BlahFields, 'id'>([]);
|
|
296
|
+
const results = await cacheAdapter.loadManyAsync(
|
|
297
|
+
new SingleFieldHolder<BlahFields, 'id', 'id'>('id'),
|
|
298
|
+
[] as any,
|
|
299
|
+
);
|
|
300
|
+
expect(results.size).toBe(0);
|
|
232
301
|
});
|
|
233
302
|
});
|
|
234
303
|
|
|
@@ -242,14 +311,23 @@ describe(ComposedEntityCacheAdapter, () => {
|
|
|
242
311
|
cacheAdapter,
|
|
243
312
|
} = makeTestCacheAdapters();
|
|
244
313
|
|
|
245
|
-
await cacheAdapter.cacheManyAsync(
|
|
314
|
+
await cacheAdapter.cacheManyAsync(
|
|
315
|
+
new SingleFieldHolder<BlahFields, 'id', 'id'>('id'),
|
|
316
|
+
new Map([[new SingleFieldValueHolder('test-id-1'), { id: 'test-id-1' }]]),
|
|
317
|
+
);
|
|
246
318
|
|
|
247
|
-
const primaryLocalMemoryCacheKey = primaryCacheAdapter['makeCacheKey'](
|
|
319
|
+
const primaryLocalMemoryCacheKey = primaryCacheAdapter['makeCacheKey'](
|
|
320
|
+
new SingleFieldHolder<BlahFields, 'id', 'id'>('id'),
|
|
321
|
+
new SingleFieldValueHolder('test-id-1'),
|
|
322
|
+
);
|
|
248
323
|
expect(primaryCache.get(primaryLocalMemoryCacheKey)).toMatchObject({
|
|
249
324
|
id: 'test-id-1',
|
|
250
325
|
});
|
|
251
326
|
|
|
252
|
-
const fallbackLocalMemoryCacheKey = fallbackCacheAdapter['makeCacheKey'](
|
|
327
|
+
const fallbackLocalMemoryCacheKey = fallbackCacheAdapter['makeCacheKey'](
|
|
328
|
+
new SingleFieldHolder<BlahFields, 'id', 'id'>('id'),
|
|
329
|
+
new SingleFieldValueHolder('test-id-1'),
|
|
330
|
+
);
|
|
253
331
|
expect(fallbackCache.get(fallbackLocalMemoryCacheKey)).toMatchObject({
|
|
254
332
|
id: 'test-id-1',
|
|
255
333
|
});
|
|
@@ -266,12 +344,20 @@ describe(ComposedEntityCacheAdapter, () => {
|
|
|
266
344
|
cacheAdapter,
|
|
267
345
|
} = makeTestCacheAdapters();
|
|
268
346
|
|
|
269
|
-
await cacheAdapter.cacheDBMissesAsync('id',
|
|
347
|
+
await cacheAdapter.cacheDBMissesAsync(new SingleFieldHolder<BlahFields, 'id', 'id'>('id'), [
|
|
348
|
+
new SingleFieldValueHolder('test-id-1'),
|
|
349
|
+
]);
|
|
270
350
|
|
|
271
|
-
const primaryLocalMemoryCacheKey = primaryCacheAdapter['makeCacheKey'](
|
|
351
|
+
const primaryLocalMemoryCacheKey = primaryCacheAdapter['makeCacheKey'](
|
|
352
|
+
new SingleFieldHolder<BlahFields, 'id', 'id'>('id'),
|
|
353
|
+
new SingleFieldValueHolder('test-id-1'),
|
|
354
|
+
);
|
|
272
355
|
expect(primaryCache.get(primaryLocalMemoryCacheKey)).toBe(DOES_NOT_EXIST_LOCAL_MEMORY_CACHE);
|
|
273
356
|
|
|
274
|
-
const fallbackLocalMemoryCacheKey = fallbackCacheAdapter['makeCacheKey'](
|
|
357
|
+
const fallbackLocalMemoryCacheKey = fallbackCacheAdapter['makeCacheKey'](
|
|
358
|
+
new SingleFieldHolder<BlahFields, 'id', 'id'>('id'),
|
|
359
|
+
new SingleFieldValueHolder('test-id-1'),
|
|
360
|
+
);
|
|
275
361
|
expect(fallbackCache.get(fallbackLocalMemoryCacheKey)).toBe(
|
|
276
362
|
DOES_NOT_EXIST_LOCAL_MEMORY_CACHE,
|
|
277
363
|
);
|
|
@@ -288,29 +374,61 @@ describe(ComposedEntityCacheAdapter, () => {
|
|
|
288
374
|
cacheAdapter,
|
|
289
375
|
} = makeTestCacheAdapters();
|
|
290
376
|
|
|
291
|
-
const cacheHits = new Map<
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
await
|
|
295
|
-
|
|
377
|
+
const cacheHits = new Map<SingleFieldValueHolder<BlahFields, 'id'>, Readonly<BlahFields>>([
|
|
378
|
+
[new SingleFieldValueHolder('test-id-1'), { id: 'test-id-1' }],
|
|
379
|
+
]);
|
|
380
|
+
await primaryCacheAdapter.cacheManyAsync(
|
|
381
|
+
new SingleFieldHolder<BlahFields, 'id', 'id'>('id'),
|
|
382
|
+
cacheHits,
|
|
383
|
+
);
|
|
384
|
+
await primaryCacheAdapter.cacheDBMissesAsync(
|
|
385
|
+
new SingleFieldHolder<BlahFields, 'id', 'id'>('id'),
|
|
386
|
+
[new SingleFieldValueHolder('test-id-2')],
|
|
387
|
+
);
|
|
388
|
+
await fallbackCacheAdapter.cacheManyAsync(
|
|
389
|
+
new SingleFieldHolder<BlahFields, 'id', 'id'>('id'),
|
|
390
|
+
cacheHits,
|
|
391
|
+
);
|
|
392
|
+
await fallbackCacheAdapter.cacheDBMissesAsync(
|
|
393
|
+
new SingleFieldHolder<BlahFields, 'id', 'id'>('id'),
|
|
394
|
+
[new SingleFieldValueHolder('test-id-2')],
|
|
395
|
+
);
|
|
296
396
|
|
|
297
|
-
await cacheAdapter.invalidateManyAsync('id',
|
|
397
|
+
await cacheAdapter.invalidateManyAsync(new SingleFieldHolder<BlahFields, 'id', 'id'>('id'), [
|
|
398
|
+
new SingleFieldValueHolder('test-id-1'),
|
|
399
|
+
new SingleFieldValueHolder('test-id-2'),
|
|
400
|
+
]);
|
|
298
401
|
|
|
299
|
-
const primaryLocalMemoryCacheKey1 = primaryCacheAdapter['makeCacheKey'](
|
|
402
|
+
const primaryLocalMemoryCacheKey1 = primaryCacheAdapter['makeCacheKey'](
|
|
403
|
+
new SingleFieldHolder<BlahFields, 'id', 'id'>('id'),
|
|
404
|
+
new SingleFieldValueHolder('test-id-1'),
|
|
405
|
+
);
|
|
300
406
|
expect(primaryCache.get(primaryLocalMemoryCacheKey1)).toBe(undefined);
|
|
301
|
-
const primaryLocalMemoryCacheKey2 = primaryCacheAdapter['makeCacheKey'](
|
|
407
|
+
const primaryLocalMemoryCacheKey2 = primaryCacheAdapter['makeCacheKey'](
|
|
408
|
+
new SingleFieldHolder<BlahFields, 'id', 'id'>('id'),
|
|
409
|
+
new SingleFieldValueHolder('test-id-1'),
|
|
410
|
+
);
|
|
302
411
|
expect(primaryCache.get(primaryLocalMemoryCacheKey2)).toBe(undefined);
|
|
303
412
|
|
|
304
|
-
const fallbackLocalMemoryCacheKey1 = fallbackCacheAdapter['makeCacheKey'](
|
|
413
|
+
const fallbackLocalMemoryCacheKey1 = fallbackCacheAdapter['makeCacheKey'](
|
|
414
|
+
new SingleFieldHolder<BlahFields, 'id', 'id'>('id'),
|
|
415
|
+
new SingleFieldValueHolder('test-id-1'),
|
|
416
|
+
);
|
|
305
417
|
expect(fallbackCache.get(fallbackLocalMemoryCacheKey1)).toBe(undefined);
|
|
306
|
-
const fallbackLocalMemoryCacheKey2 = fallbackCacheAdapter['makeCacheKey'](
|
|
418
|
+
const fallbackLocalMemoryCacheKey2 = fallbackCacheAdapter['makeCacheKey'](
|
|
419
|
+
new SingleFieldHolder<BlahFields, 'id', 'id'>('id'),
|
|
420
|
+
new SingleFieldValueHolder('test-id-1'),
|
|
421
|
+
);
|
|
307
422
|
expect(fallbackCache.get(fallbackLocalMemoryCacheKey2)).toBe(undefined);
|
|
308
423
|
});
|
|
309
424
|
|
|
310
425
|
it('returns when passed empty array of fieldValues', async () => {
|
|
311
426
|
const { cacheAdapter } = makeTestCacheAdapters();
|
|
312
427
|
|
|
313
|
-
await cacheAdapter.invalidateManyAsync(
|
|
428
|
+
await cacheAdapter.invalidateManyAsync(
|
|
429
|
+
new SingleFieldHolder<BlahFields, 'id', 'id'>('id'),
|
|
430
|
+
[] as any,
|
|
431
|
+
);
|
|
314
432
|
});
|
|
315
433
|
});
|
|
316
434
|
});
|
|
@@ -3,6 +3,8 @@ import { mock, instance, when, anything } from 'ts-mockito';
|
|
|
3
3
|
|
|
4
4
|
import AuthorizationResultBasedEntityLoader from '../AuthorizationResultBasedEntityLoader';
|
|
5
5
|
import EnforcingEntityLoader from '../EnforcingEntityLoader';
|
|
6
|
+
import { CompositeFieldValueHolder } from '../internal/CompositeFieldHolder';
|
|
7
|
+
import { CompositeFieldValueMap } from '../internal/CompositeFieldValueMap';
|
|
6
8
|
|
|
7
9
|
describe(EnforcingEntityLoader, () => {
|
|
8
10
|
describe('loadManyByFieldEqualingManyAsync', () => {
|
|
@@ -55,6 +57,133 @@ describe(EnforcingEntityLoader, () => {
|
|
|
55
57
|
});
|
|
56
58
|
});
|
|
57
59
|
|
|
60
|
+
describe('loadManyByCompositeFieldEqualingManyAsync', () => {
|
|
61
|
+
it('throws when result is unsuccessful', async () => {
|
|
62
|
+
const nonEnforcingEntityLoaderMock = mock<
|
|
63
|
+
AuthorizationResultBasedEntityLoader<any, any, any, any, any, any>
|
|
64
|
+
>(AuthorizationResultBasedEntityLoader);
|
|
65
|
+
const rejection = new Error();
|
|
66
|
+
when(
|
|
67
|
+
nonEnforcingEntityLoaderMock.loadManyByCompositeFieldEqualingManyAsync(
|
|
68
|
+
anything(),
|
|
69
|
+
anything(),
|
|
70
|
+
),
|
|
71
|
+
).thenResolve(
|
|
72
|
+
new CompositeFieldValueMap([
|
|
73
|
+
[new CompositeFieldValueHolder({ wat: 'hello' }), [result(rejection)]],
|
|
74
|
+
]),
|
|
75
|
+
);
|
|
76
|
+
const nonEnforcingEntityLoader = instance(nonEnforcingEntityLoaderMock);
|
|
77
|
+
const enforcingEntityLoader = new EnforcingEntityLoader(nonEnforcingEntityLoader);
|
|
78
|
+
await expect(
|
|
79
|
+
enforcingEntityLoader.loadManyByCompositeFieldEqualingManyAsync(anything(), anything()),
|
|
80
|
+
).rejects.toThrow(rejection);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it('returns value when result is successful', async () => {
|
|
84
|
+
const nonEnforcingEntityLoaderMock = mock<
|
|
85
|
+
AuthorizationResultBasedEntityLoader<any, any, any, any, any, any>
|
|
86
|
+
>(AuthorizationResultBasedEntityLoader);
|
|
87
|
+
|
|
88
|
+
const resolved = {};
|
|
89
|
+
when(
|
|
90
|
+
nonEnforcingEntityLoaderMock.loadManyByCompositeFieldEqualingManyAsync(
|
|
91
|
+
anything(),
|
|
92
|
+
anything(),
|
|
93
|
+
),
|
|
94
|
+
).thenResolve(
|
|
95
|
+
new CompositeFieldValueMap([
|
|
96
|
+
[new CompositeFieldValueHolder({ wat: 'hello' }), [result(resolved)]],
|
|
97
|
+
]),
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
const nonEnforcingEntityLoader = instance(nonEnforcingEntityLoaderMock);
|
|
101
|
+
const enforcingEntityLoader = new EnforcingEntityLoader(nonEnforcingEntityLoader);
|
|
102
|
+
|
|
103
|
+
await expect(
|
|
104
|
+
enforcingEntityLoader.loadManyByCompositeFieldEqualingManyAsync(anything(), anything()),
|
|
105
|
+
).resolves.toEqual(
|
|
106
|
+
new CompositeFieldValueMap([[new CompositeFieldValueHolder({ wat: 'hello' }), [resolved]]]),
|
|
107
|
+
);
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
describe('loadManyByCompositeFieldEqualingAsync', () => {
|
|
112
|
+
it('throws when result is unsuccessful', async () => {
|
|
113
|
+
const nonEnforcingEntityLoaderMock = mock<
|
|
114
|
+
AuthorizationResultBasedEntityLoader<any, any, any, any, any, any>
|
|
115
|
+
>(AuthorizationResultBasedEntityLoader);
|
|
116
|
+
|
|
117
|
+
const rejection = new Error();
|
|
118
|
+
when(
|
|
119
|
+
nonEnforcingEntityLoaderMock.loadManyByCompositeFieldEqualingAsync(anything(), anything()),
|
|
120
|
+
).thenResolve([result(rejection)]);
|
|
121
|
+
|
|
122
|
+
const nonEnforcingEntityLoader = instance(nonEnforcingEntityLoaderMock);
|
|
123
|
+
const enforcingEntityLoader = new EnforcingEntityLoader(nonEnforcingEntityLoader);
|
|
124
|
+
|
|
125
|
+
await expect(
|
|
126
|
+
enforcingEntityLoader.loadManyByCompositeFieldEqualingAsync(anything(), anything()),
|
|
127
|
+
).rejects.toThrow(rejection);
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
it('returns value when result is successful', async () => {
|
|
131
|
+
const nonEnforcingEntityLoaderMock = mock<
|
|
132
|
+
AuthorizationResultBasedEntityLoader<any, any, any, any, any, any>
|
|
133
|
+
>(AuthorizationResultBasedEntityLoader);
|
|
134
|
+
|
|
135
|
+
const resolved = {};
|
|
136
|
+
when(
|
|
137
|
+
nonEnforcingEntityLoaderMock.loadManyByCompositeFieldEqualingAsync(anything(), anything()),
|
|
138
|
+
).thenResolve([result(resolved)]);
|
|
139
|
+
|
|
140
|
+
const nonEnforcingEntityLoader = instance(nonEnforcingEntityLoaderMock);
|
|
141
|
+
const enforcingEntityLoader = new EnforcingEntityLoader(nonEnforcingEntityLoader);
|
|
142
|
+
|
|
143
|
+
await expect(
|
|
144
|
+
enforcingEntityLoader.loadManyByCompositeFieldEqualingAsync(anything(), anything()),
|
|
145
|
+
).resolves.toEqual([resolved]);
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
describe('loadByCompositeFieldEqualingAsync', () => {
|
|
150
|
+
it('throws when result is unsuccessful', async () => {
|
|
151
|
+
const nonEnforcingEntityLoaderMock = mock<
|
|
152
|
+
AuthorizationResultBasedEntityLoader<any, any, any, any, any, any>
|
|
153
|
+
>(AuthorizationResultBasedEntityLoader);
|
|
154
|
+
|
|
155
|
+
const rejection = new Error();
|
|
156
|
+
when(
|
|
157
|
+
nonEnforcingEntityLoaderMock.loadByCompositeFieldEqualingAsync(anything(), anything()),
|
|
158
|
+
).thenResolve(result(rejection));
|
|
159
|
+
|
|
160
|
+
const nonEnforcingEntityLoader = instance(nonEnforcingEntityLoaderMock);
|
|
161
|
+
const enforcingEntityLoader = new EnforcingEntityLoader(nonEnforcingEntityLoader);
|
|
162
|
+
|
|
163
|
+
await expect(
|
|
164
|
+
enforcingEntityLoader.loadByCompositeFieldEqualingAsync(anything(), anything()),
|
|
165
|
+
).rejects.toThrow(rejection);
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
it('returns value when result is successful', async () => {
|
|
169
|
+
const nonEnforcingEntityLoaderMock = mock<
|
|
170
|
+
AuthorizationResultBasedEntityLoader<any, any, any, any, any, any>
|
|
171
|
+
>(AuthorizationResultBasedEntityLoader);
|
|
172
|
+
|
|
173
|
+
const resolved = {};
|
|
174
|
+
when(
|
|
175
|
+
nonEnforcingEntityLoaderMock.loadByCompositeFieldEqualingAsync(anything(), anything()),
|
|
176
|
+
).thenResolve(result(resolved));
|
|
177
|
+
|
|
178
|
+
const nonEnforcingEntityLoader = instance(nonEnforcingEntityLoaderMock);
|
|
179
|
+
const enforcingEntityLoader = new EnforcingEntityLoader(nonEnforcingEntityLoader);
|
|
180
|
+
|
|
181
|
+
await expect(
|
|
182
|
+
enforcingEntityLoader.loadByCompositeFieldEqualingAsync(anything(), anything()),
|
|
183
|
+
).resolves.toEqual(resolved);
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
|
|
58
187
|
describe('loadManyByFieldEqualingAsync', () => {
|
|
59
188
|
it('throws when result is unsuccessful', async () => {
|
|
60
189
|
const nonEnforcingEntityLoaderMock = mock<
|
|
@@ -449,7 +578,12 @@ describe(EnforcingEntityLoader, () => {
|
|
|
449
578
|
);
|
|
450
579
|
|
|
451
580
|
// ensure known differences still exist for sanity check
|
|
452
|
-
const knownLoaderOnlyDifferences = [
|
|
581
|
+
const knownLoaderOnlyDifferences = [
|
|
582
|
+
'validateFieldAndValues',
|
|
583
|
+
'validateFieldAndValuesAndConvertToHolders',
|
|
584
|
+
'validateCompositeFieldAndValuesAndConvertToHolders',
|
|
585
|
+
'constructAndAuthorizeEntitiesFromCompositeFieldValueHolderMapAsync',
|
|
586
|
+
];
|
|
453
587
|
expect(nonEnforcingLoaderProperties).toEqual(
|
|
454
588
|
expect.arrayContaining(knownLoaderOnlyDifferences),
|
|
455
589
|
);
|