@expo/entity 0.41.0 → 0.43.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
|
@@ -42,19 +42,19 @@ import SimpleTestEntity, {
|
|
|
42
42
|
simpleTestEntityConfiguration,
|
|
43
43
|
SimpleTestEntityPrivacyPolicy,
|
|
44
44
|
SimpleTestFields,
|
|
45
|
-
} from '../
|
|
45
|
+
} from '../utils/__testfixtures__/SimpleTestEntity';
|
|
46
|
+
import { NoCacheStubCacheAdapterProvider } from '../utils/__testfixtures__/StubCacheAdapter';
|
|
47
|
+
import StubDatabaseAdapter from '../utils/__testfixtures__/StubDatabaseAdapter';
|
|
48
|
+
import StubQueryContextProvider from '../utils/__testfixtures__/StubQueryContextProvider';
|
|
46
49
|
import TestEntity, {
|
|
47
50
|
TestFields,
|
|
48
51
|
TestEntityPrivacyPolicy,
|
|
49
52
|
testEntityConfiguration,
|
|
50
|
-
} from '../
|
|
51
|
-
import { NoCacheStubCacheAdapterProvider } from '../utils/testing/StubCacheAdapter';
|
|
52
|
-
import StubDatabaseAdapter from '../utils/testing/StubDatabaseAdapter';
|
|
53
|
-
import StubQueryContextProvider from '../utils/testing/StubQueryContextProvider';
|
|
53
|
+
} from '../utils/__testfixtures__/TestEntity';
|
|
54
54
|
|
|
55
55
|
class TestMutationTrigger extends EntityMutationTrigger<
|
|
56
56
|
TestFields,
|
|
57
|
-
|
|
57
|
+
'customIdField',
|
|
58
58
|
ViewerContext,
|
|
59
59
|
TestEntity,
|
|
60
60
|
keyof TestFields
|
|
@@ -65,7 +65,7 @@ class TestMutationTrigger extends EntityMutationTrigger<
|
|
|
65
65
|
_entity: TestEntity,
|
|
66
66
|
_mutationInfo: EntityTriggerMutationInfo<
|
|
67
67
|
TestFields,
|
|
68
|
-
|
|
68
|
+
'customIdField',
|
|
69
69
|
ViewerContext,
|
|
70
70
|
TestEntity,
|
|
71
71
|
keyof TestFields
|
|
@@ -75,7 +75,7 @@ class TestMutationTrigger extends EntityMutationTrigger<
|
|
|
75
75
|
|
|
76
76
|
class TestNonTransactionalMutationTrigger extends EntityNonTransactionalMutationTrigger<
|
|
77
77
|
TestFields,
|
|
78
|
-
|
|
78
|
+
'customIdField',
|
|
79
79
|
ViewerContext,
|
|
80
80
|
TestEntity,
|
|
81
81
|
keyof TestFields
|
|
@@ -86,12 +86,18 @@ class TestNonTransactionalMutationTrigger extends EntityNonTransactionalMutation
|
|
|
86
86
|
const setUpMutationValidatorSpies = (
|
|
87
87
|
mutationValidators: EntityMutationValidator<
|
|
88
88
|
TestFields,
|
|
89
|
-
|
|
89
|
+
'customIdField',
|
|
90
90
|
ViewerContext,
|
|
91
91
|
TestEntity,
|
|
92
92
|
keyof TestFields
|
|
93
93
|
>[],
|
|
94
|
-
): EntityMutationValidator<
|
|
94
|
+
): EntityMutationValidator<
|
|
95
|
+
TestFields,
|
|
96
|
+
'customIdField',
|
|
97
|
+
ViewerContext,
|
|
98
|
+
TestEntity,
|
|
99
|
+
keyof TestFields
|
|
100
|
+
>[] => {
|
|
95
101
|
return mutationValidators.map((validator) => spy(validator));
|
|
96
102
|
};
|
|
97
103
|
|
|
@@ -99,7 +105,7 @@ const verifyValidatorCounts = (
|
|
|
99
105
|
viewerContext: ViewerContext,
|
|
100
106
|
mutationValidatorSpies: EntityMutationValidator<
|
|
101
107
|
TestFields,
|
|
102
|
-
|
|
108
|
+
'customIdField',
|
|
103
109
|
ViewerContext,
|
|
104
110
|
TestEntity,
|
|
105
111
|
keyof TestFields
|
|
@@ -107,7 +113,7 @@ const verifyValidatorCounts = (
|
|
|
107
113
|
expectedCalls: number,
|
|
108
114
|
mutationInfo: EntityValidatorMutationInfo<
|
|
109
115
|
TestFields,
|
|
110
|
-
|
|
116
|
+
'customIdField',
|
|
111
117
|
ViewerContext,
|
|
112
118
|
TestEntity,
|
|
113
119
|
keyof TestFields
|
|
@@ -128,14 +134,14 @@ const verifyValidatorCounts = (
|
|
|
128
134
|
const setUpMutationTriggerSpies = (
|
|
129
135
|
mutationTriggers: EntityMutationTriggerConfiguration<
|
|
130
136
|
TestFields,
|
|
131
|
-
|
|
137
|
+
'customIdField',
|
|
132
138
|
ViewerContext,
|
|
133
139
|
TestEntity,
|
|
134
140
|
keyof TestFields
|
|
135
141
|
>,
|
|
136
142
|
): EntityMutationTriggerConfiguration<
|
|
137
143
|
TestFields,
|
|
138
|
-
|
|
144
|
+
'customIdField',
|
|
139
145
|
ViewerContext,
|
|
140
146
|
TestEntity,
|
|
141
147
|
keyof TestFields
|
|
@@ -157,7 +163,7 @@ const verifyTriggerCounts = (
|
|
|
157
163
|
viewerContext: ViewerContext,
|
|
158
164
|
mutationTriggerSpies: EntityMutationTriggerConfiguration<
|
|
159
165
|
TestFields,
|
|
160
|
-
|
|
166
|
+
'customIdField',
|
|
161
167
|
ViewerContext,
|
|
162
168
|
TestEntity,
|
|
163
169
|
keyof TestFields
|
|
@@ -166,7 +172,7 @@ const verifyTriggerCounts = (
|
|
|
166
172
|
keyof Pick<
|
|
167
173
|
EntityMutationTriggerConfiguration<
|
|
168
174
|
TestFields,
|
|
169
|
-
|
|
175
|
+
'customIdField',
|
|
170
176
|
ViewerContext,
|
|
171
177
|
TestEntity,
|
|
172
178
|
keyof TestFields
|
|
@@ -182,7 +188,7 @@ const verifyTriggerCounts = (
|
|
|
182
188
|
>,
|
|
183
189
|
mutationInfo: EntityTriggerMutationInfo<
|
|
184
190
|
TestFields,
|
|
185
|
-
|
|
191
|
+
'customIdField',
|
|
186
192
|
ViewerContext,
|
|
187
193
|
TestEntity,
|
|
188
194
|
keyof TestFields
|
|
@@ -243,7 +249,7 @@ const createEntityMutatorFactory = (
|
|
|
243
249
|
privacyPolicy: TestEntityPrivacyPolicy;
|
|
244
250
|
entityLoaderFactory: EntityLoaderFactory<
|
|
245
251
|
TestFields,
|
|
246
|
-
|
|
252
|
+
'customIdField',
|
|
247
253
|
ViewerContext,
|
|
248
254
|
TestEntity,
|
|
249
255
|
TestEntityPrivacyPolicy,
|
|
@@ -251,7 +257,7 @@ const createEntityMutatorFactory = (
|
|
|
251
257
|
>;
|
|
252
258
|
entityMutatorFactory: EntityMutatorFactory<
|
|
253
259
|
TestFields,
|
|
254
|
-
|
|
260
|
+
'customIdField',
|
|
255
261
|
ViewerContext,
|
|
256
262
|
TestEntity,
|
|
257
263
|
TestEntityPrivacyPolicy
|
|
@@ -259,14 +265,14 @@ const createEntityMutatorFactory = (
|
|
|
259
265
|
metricsAdapter: IEntityMetricsAdapter;
|
|
260
266
|
mutationValidators: EntityMutationValidator<
|
|
261
267
|
TestFields,
|
|
262
|
-
|
|
268
|
+
'customIdField',
|
|
263
269
|
ViewerContext,
|
|
264
270
|
TestEntity,
|
|
265
271
|
keyof TestFields
|
|
266
272
|
>[];
|
|
267
273
|
mutationTriggers: EntityMutationTriggerConfiguration<
|
|
268
274
|
TestFields,
|
|
269
|
-
|
|
275
|
+
'customIdField',
|
|
270
276
|
ViewerContext,
|
|
271
277
|
TestEntity,
|
|
272
278
|
keyof TestFields
|
|
@@ -274,14 +280,14 @@ const createEntityMutatorFactory = (
|
|
|
274
280
|
} => {
|
|
275
281
|
const mutationValidators: EntityMutationValidator<
|
|
276
282
|
TestFields,
|
|
277
|
-
|
|
283
|
+
'customIdField',
|
|
278
284
|
ViewerContext,
|
|
279
285
|
TestEntity,
|
|
280
286
|
keyof TestFields
|
|
281
287
|
>[] = [new TestMutationTrigger()];
|
|
282
288
|
const mutationTriggers: EntityMutationTriggerConfiguration<
|
|
283
289
|
TestFields,
|
|
284
|
-
|
|
290
|
+
'customIdField',
|
|
285
291
|
ViewerContext,
|
|
286
292
|
TestEntity,
|
|
287
293
|
keyof TestFields
|
|
@@ -296,7 +302,7 @@ const createEntityMutatorFactory = (
|
|
|
296
302
|
afterAll: [new TestMutationTrigger()],
|
|
297
303
|
afterCommit: [new TestNonTransactionalMutationTrigger()],
|
|
298
304
|
};
|
|
299
|
-
const databaseAdapter = new StubDatabaseAdapter<TestFields>(
|
|
305
|
+
const databaseAdapter = new StubDatabaseAdapter<TestFields, 'customIdField'>(
|
|
300
306
|
testEntityConfiguration,
|
|
301
307
|
StubDatabaseAdapter.convertFieldObjectsToDataStore(
|
|
302
308
|
testEntityConfiguration,
|
|
@@ -304,16 +310,19 @@ const createEntityMutatorFactory = (
|
|
|
304
310
|
),
|
|
305
311
|
);
|
|
306
312
|
const customStubDatabaseAdapterProvider: IEntityDatabaseAdapterProvider = {
|
|
307
|
-
getDatabaseAdapter<TFields extends Record<
|
|
308
|
-
_entityConfiguration: EntityConfiguration<TFields>,
|
|
309
|
-
): EntityDatabaseAdapter<TFields> {
|
|
310
|
-
return databaseAdapter as any as EntityDatabaseAdapter<TFields>;
|
|
313
|
+
getDatabaseAdapter<TFields extends Record<'customIdField', any>>(
|
|
314
|
+
_entityConfiguration: EntityConfiguration<TFields, 'customIdField'>,
|
|
315
|
+
): EntityDatabaseAdapter<TFields, 'customIdField'> {
|
|
316
|
+
return databaseAdapter as any as EntityDatabaseAdapter<TFields, 'customIdField'>;
|
|
311
317
|
},
|
|
312
318
|
};
|
|
313
319
|
const metricsAdapter = new NoOpEntityMetricsAdapter();
|
|
314
320
|
const cacheAdapterProvider = new NoCacheStubCacheAdapterProvider();
|
|
315
321
|
const cacheAdapter = cacheAdapterProvider.getCacheAdapter(testEntityConfiguration);
|
|
316
|
-
const entityCache = new ReadThroughEntityCache<TestFields>(
|
|
322
|
+
const entityCache = new ReadThroughEntityCache<TestFields, 'customIdField'>(
|
|
323
|
+
testEntityConfiguration,
|
|
324
|
+
cacheAdapter,
|
|
325
|
+
);
|
|
317
326
|
|
|
318
327
|
const queryContextProvider = new StubQueryContextProvider();
|
|
319
328
|
const companionProvider = new EntityCompanionProvider(
|
|
@@ -545,7 +554,7 @@ describe(EntityMutatorFactory, () => {
|
|
|
545
554
|
mock<
|
|
546
555
|
EntityPrivacyPolicyEvaluationContext<
|
|
547
556
|
TestFields,
|
|
548
|
-
|
|
557
|
+
'customIdField',
|
|
549
558
|
ViewerContext,
|
|
550
559
|
TestEntity,
|
|
551
560
|
keyof TestFields
|
|
@@ -669,7 +678,7 @@ describe(EntityMutatorFactory, () => {
|
|
|
669
678
|
mock<
|
|
670
679
|
EntityPrivacyPolicyEvaluationContext<
|
|
671
680
|
TestFields,
|
|
672
|
-
|
|
681
|
+
'customIdField',
|
|
673
682
|
ViewerContext,
|
|
674
683
|
TestEntity,
|
|
675
684
|
keyof TestFields
|
|
@@ -741,7 +750,7 @@ describe(EntityMutatorFactory, () => {
|
|
|
741
750
|
mock<
|
|
742
751
|
EntityPrivacyPolicyEvaluationContext<
|
|
743
752
|
TestFields,
|
|
744
|
-
|
|
753
|
+
'customIdField',
|
|
745
754
|
ViewerContext,
|
|
746
755
|
TestEntity,
|
|
747
756
|
keyof TestFields
|
|
@@ -801,7 +810,7 @@ describe(EntityMutatorFactory, () => {
|
|
|
801
810
|
mock<
|
|
802
811
|
EntityPrivacyPolicyEvaluationContext<
|
|
803
812
|
TestFields,
|
|
804
|
-
|
|
813
|
+
'customIdField',
|
|
805
814
|
ViewerContext,
|
|
806
815
|
TestEntity,
|
|
807
816
|
keyof TestFields
|
|
@@ -854,7 +863,7 @@ describe(EntityMutatorFactory, () => {
|
|
|
854
863
|
mock<
|
|
855
864
|
EntityPrivacyPolicyEvaluationContext<
|
|
856
865
|
TestFields,
|
|
857
|
-
|
|
866
|
+
'customIdField',
|
|
858
867
|
ViewerContext,
|
|
859
868
|
TestEntity,
|
|
860
869
|
keyof TestFields
|
|
@@ -902,7 +911,7 @@ describe(EntityMutatorFactory, () => {
|
|
|
902
911
|
mock<
|
|
903
912
|
EntityPrivacyPolicyEvaluationContext<
|
|
904
913
|
TestFields,
|
|
905
|
-
|
|
914
|
+
'customIdField',
|
|
906
915
|
ViewerContext,
|
|
907
916
|
TestEntity,
|
|
908
917
|
keyof TestFields
|
|
@@ -954,7 +963,7 @@ describe(EntityMutatorFactory, () => {
|
|
|
954
963
|
mock<
|
|
955
964
|
EntityPrivacyPolicyEvaluationContext<
|
|
956
965
|
TestFields,
|
|
957
|
-
|
|
966
|
+
'customIdField',
|
|
958
967
|
ViewerContext,
|
|
959
968
|
TestEntity,
|
|
960
969
|
keyof TestFields
|
|
@@ -1010,7 +1019,7 @@ describe(EntityMutatorFactory, () => {
|
|
|
1010
1019
|
mock<
|
|
1011
1020
|
EntityPrivacyPolicyEvaluationContext<
|
|
1012
1021
|
TestFields,
|
|
1013
|
-
|
|
1022
|
+
'customIdField',
|
|
1014
1023
|
ViewerContext,
|
|
1015
1024
|
TestEntity,
|
|
1016
1025
|
keyof TestFields
|
|
@@ -1057,7 +1066,7 @@ describe(EntityMutatorFactory, () => {
|
|
|
1057
1066
|
mock<
|
|
1058
1067
|
EntityPrivacyPolicyEvaluationContext<
|
|
1059
1068
|
TestFields,
|
|
1060
|
-
|
|
1069
|
+
'customIdField',
|
|
1061
1070
|
ViewerContext,
|
|
1062
1071
|
TestEntity,
|
|
1063
1072
|
keyof TestFields
|
|
@@ -1084,11 +1093,21 @@ describe(EntityMutatorFactory, () => {
|
|
|
1084
1093
|
.loadManyByFieldEqualingAsync('stringField', 'huh'),
|
|
1085
1094
|
);
|
|
1086
1095
|
expect(entites1).toHaveLength(1);
|
|
1096
|
+
const entitiesLoadedByComposite1 = await enforceResultsAsync(
|
|
1097
|
+
entityLoaderFactory
|
|
1098
|
+
.forLoad(viewerContext, queryContext, privacyPolicyEvaluationContext)
|
|
1099
|
+
.loadManyByCompositeFieldEqualingAsync(['stringField', 'intField'], {
|
|
1100
|
+
stringField: 'huh',
|
|
1101
|
+
intField: 3,
|
|
1102
|
+
}),
|
|
1103
|
+
);
|
|
1104
|
+
expect(entitiesLoadedByComposite1).toHaveLength(1);
|
|
1087
1105
|
|
|
1088
1106
|
await enforceAsyncResult(
|
|
1089
1107
|
entityMutatorFactory
|
|
1090
1108
|
.forCreate(viewerContext, queryContext)
|
|
1091
1109
|
.setField('stringField', 'huh')
|
|
1110
|
+
.setField('intField', 3)
|
|
1092
1111
|
.createAsync(),
|
|
1093
1112
|
);
|
|
1094
1113
|
|
|
@@ -1098,6 +1117,15 @@ describe(EntityMutatorFactory, () => {
|
|
|
1098
1117
|
.loadManyByFieldEqualingAsync('stringField', 'huh'),
|
|
1099
1118
|
);
|
|
1100
1119
|
expect(entities2).toHaveLength(2);
|
|
1120
|
+
const entitiesLoadedByComposite2 = await enforceResultsAsync(
|
|
1121
|
+
entityLoaderFactory
|
|
1122
|
+
.forLoad(viewerContext, queryContext, privacyPolicyEvaluationContext)
|
|
1123
|
+
.loadManyByCompositeFieldEqualingAsync(['stringField', 'intField'], {
|
|
1124
|
+
stringField: 'huh',
|
|
1125
|
+
intField: 3,
|
|
1126
|
+
}),
|
|
1127
|
+
);
|
|
1128
|
+
expect(entitiesLoadedByComposite2).toHaveLength(2);
|
|
1101
1129
|
});
|
|
1102
1130
|
|
|
1103
1131
|
it('throws error when field not valid', async () => {
|
|
@@ -1142,7 +1170,7 @@ describe(EntityMutatorFactory, () => {
|
|
|
1142
1170
|
const viewerContext = instance(mock(ViewerContext));
|
|
1143
1171
|
const queryContext = new StubQueryContextProvider().getQueryContext();
|
|
1144
1172
|
const privacyPolicyMock = mock(SimpleTestEntityPrivacyPolicy);
|
|
1145
|
-
const databaseAdapter = instance(mock<EntityDatabaseAdapter<SimpleTestFields>>());
|
|
1173
|
+
const databaseAdapter = instance(mock<EntityDatabaseAdapter<SimpleTestFields, 'id'>>());
|
|
1146
1174
|
const metricsAdapter = instance(mock<IEntityMetricsAdapter>());
|
|
1147
1175
|
|
|
1148
1176
|
const id1 = uuidv4();
|
|
@@ -1160,7 +1188,7 @@ describe(EntityMutatorFactory, () => {
|
|
|
1160
1188
|
const entityLoaderMock = mock<
|
|
1161
1189
|
AuthorizationResultBasedEntityLoader<
|
|
1162
1190
|
SimpleTestFields,
|
|
1163
|
-
|
|
1191
|
+
'id',
|
|
1164
1192
|
ViewerContext,
|
|
1165
1193
|
SimpleTestEntity,
|
|
1166
1194
|
SimpleTestEntityPrivacyPolicy,
|
|
@@ -1171,7 +1199,7 @@ describe(EntityMutatorFactory, () => {
|
|
|
1171
1199
|
mock<
|
|
1172
1200
|
EntityLoaderUtils<
|
|
1173
1201
|
SimpleTestFields,
|
|
1174
|
-
|
|
1202
|
+
'id',
|
|
1175
1203
|
ViewerContext,
|
|
1176
1204
|
SimpleTestEntity,
|
|
1177
1205
|
SimpleTestEntityPrivacyPolicy,
|
|
@@ -1186,7 +1214,7 @@ describe(EntityMutatorFactory, () => {
|
|
|
1186
1214
|
mock<
|
|
1187
1215
|
EntityLoaderFactory<
|
|
1188
1216
|
SimpleTestFields,
|
|
1189
|
-
|
|
1217
|
+
'id',
|
|
1190
1218
|
ViewerContext,
|
|
1191
1219
|
SimpleTestEntity,
|
|
1192
1220
|
SimpleTestEntityPrivacyPolicy,
|
|
@@ -1277,7 +1305,7 @@ describe(EntityMutatorFactory, () => {
|
|
|
1277
1305
|
const viewerContext = instance(mock(ViewerContext));
|
|
1278
1306
|
const queryContext = new StubQueryContextProvider().getQueryContext();
|
|
1279
1307
|
const privacyPolicy = instance(mock(SimpleTestEntityPrivacyPolicy));
|
|
1280
|
-
const databaseAdapterMock = mock<EntityDatabaseAdapter<SimpleTestFields>>();
|
|
1308
|
+
const databaseAdapterMock = mock<EntityDatabaseAdapter<SimpleTestFields, 'id'>>();
|
|
1281
1309
|
const metricsAdapter = instance(mock<IEntityMetricsAdapter>());
|
|
1282
1310
|
|
|
1283
1311
|
const id1 = uuidv4();
|
|
@@ -1295,7 +1323,7 @@ describe(EntityMutatorFactory, () => {
|
|
|
1295
1323
|
const entityLoaderMock = mock<
|
|
1296
1324
|
AuthorizationResultBasedEntityLoader<
|
|
1297
1325
|
SimpleTestFields,
|
|
1298
|
-
|
|
1326
|
+
'id',
|
|
1299
1327
|
ViewerContext,
|
|
1300
1328
|
SimpleTestEntity,
|
|
1301
1329
|
SimpleTestEntityPrivacyPolicy,
|
|
@@ -1306,7 +1334,7 @@ describe(EntityMutatorFactory, () => {
|
|
|
1306
1334
|
mock<
|
|
1307
1335
|
EntityLoaderUtils<
|
|
1308
1336
|
SimpleTestFields,
|
|
1309
|
-
|
|
1337
|
+
'id',
|
|
1310
1338
|
ViewerContext,
|
|
1311
1339
|
SimpleTestEntity,
|
|
1312
1340
|
SimpleTestEntityPrivacyPolicy,
|
|
@@ -1321,7 +1349,7 @@ describe(EntityMutatorFactory, () => {
|
|
|
1321
1349
|
mock<
|
|
1322
1350
|
EntityLoaderFactory<
|
|
1323
1351
|
SimpleTestFields,
|
|
1324
|
-
|
|
1352
|
+
'id',
|
|
1325
1353
|
ViewerContext,
|
|
1326
1354
|
SimpleTestEntity,
|
|
1327
1355
|
SimpleTestEntityPrivacyPolicy,
|