@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
|
@@ -9,7 +9,7 @@ import ViewerContext from './ViewerContext';
|
|
|
9
9
|
* associated with an entity. In relational databases, these entities are often referenced
|
|
10
10
|
* by foreign keys.
|
|
11
11
|
*/
|
|
12
|
-
export default class AuthorizationResultBasedEntityAssociationLoader<TFields extends
|
|
12
|
+
export default class AuthorizationResultBasedEntityAssociationLoader<TFields extends Record<string, any>, TIDField extends keyof NonNullable<Pick<TFields, TSelectedFields>>, TViewerContext extends ViewerContext, TEntity extends ReadonlyEntity<TFields, TIDField, TViewerContext, TSelectedFields>, TSelectedFields extends keyof TFields> {
|
|
13
13
|
private readonly entity;
|
|
14
14
|
private readonly queryContext;
|
|
15
15
|
constructor(entity: TEntity, queryContext: EntityQueryContext);
|
|
@@ -19,7 +19,7 @@ export default class AuthorizationResultBasedEntityAssociationLoader<TFields ext
|
|
|
19
19
|
* @param fieldIdentifyingAssociatedEntity - field of this entity containing the ID of the associated entity
|
|
20
20
|
* @param associatedEntityClass - class of the associated entity
|
|
21
21
|
*/
|
|
22
|
-
loadAssociatedEntityAsync<TIdentifyingField extends keyof Pick<TFields, TSelectedFields>, TAssociatedFields extends object,
|
|
22
|
+
loadAssociatedEntityAsync<TIdentifyingField extends keyof Pick<TFields, TSelectedFields>, TAssociatedFields extends object, TAssociatedIDField extends keyof NonNullable<Pick<TAssociatedFields, TAssociatedSelectedFields>>, TAssociatedEntity extends ReadonlyEntity<TAssociatedFields, TAssociatedIDField, TViewerContext, TAssociatedSelectedFields>, TAssociatedPrivacyPolicy extends EntityPrivacyPolicy<TAssociatedFields, TAssociatedIDField, TViewerContext, TAssociatedEntity, TAssociatedSelectedFields>, TAssociatedSelectedFields extends keyof TAssociatedFields = keyof TAssociatedFields>(fieldIdentifyingAssociatedEntity: TIdentifyingField, associatedEntityClass: IEntityClass<TAssociatedFields, TAssociatedIDField, TViewerContext, TAssociatedEntity, TAssociatedPrivacyPolicy, TAssociatedSelectedFields>): Promise<Result<null extends TFields[TIdentifyingField] ? TAssociatedEntity | null : TAssociatedEntity>>;
|
|
23
23
|
/**
|
|
24
24
|
* Load many entities associated with this entity, often referred to as entites belonging
|
|
25
25
|
* to this entity. In a relational database, the field in the foreign entity is a
|
|
@@ -28,7 +28,7 @@ export default class AuthorizationResultBasedEntityAssociationLoader<TFields ext
|
|
|
28
28
|
* @param associatedEntityClass - class of the associated entities
|
|
29
29
|
* @param associatedEntityFieldContainingThisID - field of associated entity which contains the ID of this entity
|
|
30
30
|
*/
|
|
31
|
-
loadManyAssociatedEntitiesAsync<TAssociatedFields extends object,
|
|
31
|
+
loadManyAssociatedEntitiesAsync<TAssociatedFields extends object, TAssociatedIDField extends keyof NonNullable<Pick<TAssociatedFields, TAssociatedSelectedFields>>, TAssociatedEntity extends ReadonlyEntity<TAssociatedFields, TAssociatedIDField, TViewerContext, TAssociatedSelectedFields>, TAssociatedPrivacyPolicy extends EntityPrivacyPolicy<TAssociatedFields, TAssociatedIDField, TViewerContext, TAssociatedEntity, TAssociatedSelectedFields>, TAssociatedSelectedFields extends keyof TAssociatedFields = keyof TAssociatedFields>(associatedEntityClass: IEntityClass<TAssociatedFields, TAssociatedIDField, TViewerContext, TAssociatedEntity, TAssociatedPrivacyPolicy, TAssociatedSelectedFields>, associatedEntityFieldContainingThisID: keyof Pick<TAssociatedFields, TAssociatedSelectedFields>): Promise<readonly Result<TAssociatedEntity>[]>;
|
|
32
32
|
/**
|
|
33
33
|
* Load an associated entity identified by a field value of this entity. In a relational database,
|
|
34
34
|
* the field in this entity is a foreign key to a unique field of the associated entity.
|
|
@@ -36,7 +36,7 @@ export default class AuthorizationResultBasedEntityAssociationLoader<TFields ext
|
|
|
36
36
|
* @param associatedEntityClass - class of the associated entity
|
|
37
37
|
* @param associatedEntityLookupByField - field of associated entity with which to look up the associated entity
|
|
38
38
|
*/
|
|
39
|
-
loadAssociatedEntityByFieldEqualingAsync<TAssociatedFields extends object,
|
|
39
|
+
loadAssociatedEntityByFieldEqualingAsync<TAssociatedFields extends object, TAssociatedIDField extends keyof NonNullable<Pick<TAssociatedFields, TAssociatedSelectedFields>>, TAssociatedEntity extends ReadonlyEntity<TAssociatedFields, TAssociatedIDField, TViewerContext, TAssociatedSelectedFields>, TAssociatedPrivacyPolicy extends EntityPrivacyPolicy<TAssociatedFields, TAssociatedIDField, TViewerContext, TAssociatedEntity, TAssociatedSelectedFields>, TAssociatedSelectedFields extends keyof TAssociatedFields = keyof TAssociatedFields>(fieldIdentifyingAssociatedEntity: keyof Pick<TFields, TSelectedFields>, associatedEntityClass: IEntityClass<TAssociatedFields, TAssociatedIDField, TViewerContext, TAssociatedEntity, TAssociatedPrivacyPolicy, TAssociatedSelectedFields>, associatedEntityLookupByField: keyof Pick<TAssociatedFields, TAssociatedSelectedFields>): Promise<Result<TAssociatedEntity> | null>;
|
|
40
40
|
/**
|
|
41
41
|
* Load many associated entities identified by a field value of this entity. In a relational database,
|
|
42
42
|
* the field in this entity refers to a field of the associated entity.
|
|
@@ -44,33 +44,33 @@ export default class AuthorizationResultBasedEntityAssociationLoader<TFields ext
|
|
|
44
44
|
* @param associatedEntityClass - class of the associated entities
|
|
45
45
|
* @param associatedEntityLookupByField - field of associated entities with which to look up the associated entities
|
|
46
46
|
*/
|
|
47
|
-
loadManyAssociatedEntitiesByFieldEqualingAsync<TAssociatedFields extends object,
|
|
47
|
+
loadManyAssociatedEntitiesByFieldEqualingAsync<TAssociatedFields extends object, TAssociatedIDField extends keyof NonNullable<Pick<TAssociatedFields, TAssociatedSelectedFields>>, TAssociatedEntity extends ReadonlyEntity<TAssociatedFields, TAssociatedIDField, TViewerContext, TAssociatedSelectedFields>, TAssociatedPrivacyPolicy extends EntityPrivacyPolicy<TAssociatedFields, TAssociatedIDField, TViewerContext, TAssociatedEntity, TAssociatedSelectedFields>, TAssociatedSelectedFields extends keyof TAssociatedFields = keyof TAssociatedFields>(fieldIdentifyingAssociatedEntity: keyof Pick<TFields, TSelectedFields>, associatedEntityClass: IEntityClass<TAssociatedFields, TAssociatedIDField, TViewerContext, TAssociatedEntity, TAssociatedPrivacyPolicy, TAssociatedSelectedFields>, associatedEntityLookupByField: keyof Pick<TAssociatedFields, TAssociatedSelectedFields>): Promise<readonly Result<TAssociatedEntity>[]>;
|
|
48
48
|
/**
|
|
49
49
|
* Load an associated entity by folding a sequence of EntityLoadThroughDirective. At each
|
|
50
50
|
* fold step, load an associated entity identified by a field value of the current fold value.
|
|
51
51
|
* @param loadDirectives - associated entity load directives instructing each step of the folds
|
|
52
52
|
*/
|
|
53
|
-
loadAssociatedEntityThroughAsync<TFields2 extends object,
|
|
54
|
-
EntityLoadThroughDirective<TViewerContext, TFields, TFields2,
|
|
53
|
+
loadAssociatedEntityThroughAsync<TFields2 extends object, TIDField2 extends keyof NonNullable<Pick<TFields2, TSelectedFields2>>, TEntity2 extends ReadonlyEntity<TFields2, TIDField2, TViewerContext, TSelectedFields2>, TPrivacyPolicy2 extends EntityPrivacyPolicy<TFields2, TIDField2, TViewerContext, TEntity2, TSelectedFields2>, TSelectedFields2 extends keyof TFields2 = keyof TFields2>(loadDirectives: [
|
|
54
|
+
EntityLoadThroughDirective<TViewerContext, TFields, TFields2, TIDField2, TEntity2, TPrivacyPolicy2, TSelectedFields, TSelectedFields2>
|
|
55
55
|
]): Promise<Result<TEntity2> | null>;
|
|
56
56
|
/**
|
|
57
57
|
* Load an associated entity by folding a sequence of EntityLoadThroughDirective. At each
|
|
58
58
|
* fold step, load an associated entity identified by a field value of the current fold value.
|
|
59
59
|
* @param loadDirectives - associated entity load directives instructing each step of the folds
|
|
60
60
|
*/
|
|
61
|
-
loadAssociatedEntityThroughAsync<TFields2 extends object,
|
|
62
|
-
EntityLoadThroughDirective<TViewerContext, TFields, TFields2,
|
|
63
|
-
EntityLoadThroughDirective<TViewerContext, TFields2, TFields3,
|
|
61
|
+
loadAssociatedEntityThroughAsync<TFields2 extends object, TIDField2 extends keyof NonNullable<Pick<TFields2, TSelectedFields2>>, TEntity2 extends ReadonlyEntity<TFields2, TIDField2, TViewerContext, TSelectedFields2>, TPrivacyPolicy2 extends EntityPrivacyPolicy<TFields2, TIDField2, TViewerContext, TEntity2, TSelectedFields2>, TFields3 extends object, TIDField3 extends keyof NonNullable<Pick<TFields3, TSelectedFields3>>, TEntity3 extends ReadonlyEntity<TFields3, TIDField3, TViewerContext, TSelectedFields3>, TPrivacyPolicy3 extends EntityPrivacyPolicy<TFields3, TIDField3, TViewerContext, TEntity3, TSelectedFields3>, TSelectedFields2 extends keyof TFields2 = keyof TFields2, TSelectedFields3 extends keyof TFields3 = keyof TFields3>(loadDirectives: [
|
|
62
|
+
EntityLoadThroughDirective<TViewerContext, TFields, TFields2, TIDField2, TEntity2, TPrivacyPolicy2, TSelectedFields, TSelectedFields2>,
|
|
63
|
+
EntityLoadThroughDirective<TViewerContext, TFields2, TFields3, TIDField3, TEntity3, TPrivacyPolicy3, TSelectedFields2, TSelectedFields3>
|
|
64
64
|
]): Promise<Result<TEntity3> | null>;
|
|
65
65
|
/**
|
|
66
66
|
* Load an associated entity by folding a sequence of EntityLoadThroughDirective. At each
|
|
67
67
|
* fold step, load an associated entity identified by a field value of the current fold value.
|
|
68
68
|
* @param loadDirectives - associated entity load directives instructing each step of the folds
|
|
69
69
|
*/
|
|
70
|
-
loadAssociatedEntityThroughAsync<TFields2 extends object,
|
|
71
|
-
EntityLoadThroughDirective<TViewerContext, TFields, TFields2,
|
|
72
|
-
EntityLoadThroughDirective<TViewerContext, TFields2, TFields3,
|
|
73
|
-
EntityLoadThroughDirective<TViewerContext, TFields3, TFields4,
|
|
70
|
+
loadAssociatedEntityThroughAsync<TFields2 extends object, TIDField2 extends keyof NonNullable<Pick<TFields2, TSelectedFields2>>, TEntity2 extends ReadonlyEntity<TFields2, TIDField2, TViewerContext, TSelectedFields2>, TPrivacyPolicy2 extends EntityPrivacyPolicy<TFields2, TIDField2, TViewerContext, TEntity2, TSelectedFields2>, TFields3 extends object, TIDField3 extends keyof NonNullable<Pick<TFields3, TSelectedFields3>>, TEntity3 extends ReadonlyEntity<TFields3, TIDField3, TViewerContext, TSelectedFields3>, TPrivacyPolicy3 extends EntityPrivacyPolicy<TFields3, TIDField3, TViewerContext, TEntity3, TSelectedFields3>, TFields4 extends object, TIDField4 extends keyof NonNullable<Pick<TFields4, TSelectedFields4>>, TEntity4 extends ReadonlyEntity<TFields4, TIDField4, TViewerContext, TSelectedFields4>, TPrivacyPolicy4 extends EntityPrivacyPolicy<TFields4, TIDField4, TViewerContext, TEntity4, TSelectedFields4>, TSelectedFields2 extends keyof TFields2 = keyof TFields2, TSelectedFields3 extends keyof TFields3 = keyof TFields3, TSelectedFields4 extends keyof TFields4 = keyof TFields4>(loadDirectives: [
|
|
71
|
+
EntityLoadThroughDirective<TViewerContext, TFields, TFields2, TIDField2, TEntity2, TPrivacyPolicy2, TSelectedFields, TSelectedFields2>,
|
|
72
|
+
EntityLoadThroughDirective<TViewerContext, TFields2, TFields3, TIDField3, TEntity3, TPrivacyPolicy3, TSelectedFields2, TSelectedFields3>,
|
|
73
|
+
EntityLoadThroughDirective<TViewerContext, TFields3, TFields4, TIDField4, TEntity4, TPrivacyPolicy4, TSelectedFields3, TSelectedFields4>
|
|
74
74
|
]): Promise<Result<TEntity4> | null>;
|
|
75
75
|
/**
|
|
76
76
|
* Load an associated entity by folding a sequence of EntityLoadThroughDirective. At each
|
|
@@ -82,11 +82,11 @@ export default class AuthorizationResultBasedEntityAssociationLoader<TFields ext
|
|
|
82
82
|
/**
|
|
83
83
|
* Instruction for each step of a load-associated-through method.
|
|
84
84
|
*/
|
|
85
|
-
export interface EntityLoadThroughDirective<TViewerContext extends ViewerContext, TFields, TAssociatedFields extends object,
|
|
85
|
+
export interface EntityLoadThroughDirective<TViewerContext extends ViewerContext, TFields, TAssociatedFields extends object, TAssociatedIDField extends keyof NonNullable<Pick<TAssociatedFields, TAssociatedSelectedFields>>, TAssociatedEntity extends ReadonlyEntity<TAssociatedFields, TAssociatedIDField, TViewerContext, TAssociatedSelectedFields>, TAssociatedPrivacyPolicy extends EntityPrivacyPolicy<TAssociatedFields, TAssociatedIDField, TViewerContext, TAssociatedEntity, TAssociatedSelectedFields>, TSelectedFields extends keyof TFields = keyof TFields, TAssociatedSelectedFields extends keyof TAssociatedFields = keyof TAssociatedFields> {
|
|
86
86
|
/**
|
|
87
87
|
* Class of entity to load at this step.
|
|
88
88
|
*/
|
|
89
|
-
associatedEntityClass: IEntityClass<TAssociatedFields,
|
|
89
|
+
associatedEntityClass: IEntityClass<TAssociatedFields, TAssociatedIDField, TViewerContext, TAssociatedEntity, TAssociatedPrivacyPolicy, TAssociatedSelectedFields>;
|
|
90
90
|
/**
|
|
91
91
|
* Field of the current entity with which to load an instance of associatedEntityClass.
|
|
92
92
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthorizationResultBasedEntityAssociationLoader.js","sourceRoot":"","sources":["../src/AuthorizationResultBasedEntityAssociationLoader.ts"],"names":[],"mappings":";;AAAA,2CAA+C;AAQ/C;;;;GAIG;AACH,MAAqB,+CAA+C;IAQ/C;IACA;IAFnB,YACmB,MAAe,EACf,YAAgC;QADhC,WAAM,GAAN,MAAM,CAAS;QACf,iBAAY,GAAZ,YAAY,CAAoB;IAChD,CAAC;IAEJ;;;;;OAKG;IACH,KAAK,CAAC,yBAAyB,
|
|
1
|
+
{"version":3,"file":"AuthorizationResultBasedEntityAssociationLoader.js","sourceRoot":"","sources":["../src/AuthorizationResultBasedEntityAssociationLoader.ts"],"names":[],"mappings":";;AAAA,2CAA+C;AAQ/C;;;;GAIG;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ACJ,qBAAqB,EACrB,gCAAgC,EAChC,6BAA6B,GAC9B,GAAG,aAAa,CAAC;YAClB,IAAI,sBAAyE,CAAC;YAC9E,IAAI,6BAA6B,EAAE,CAAC;gBAClC,sBAAsB,GAAG,MAAM,aAAa;qBACzC,yCAAyC,CAAC,IAAI,CAAC,YAAY,CAAC;qBAC5D,wCAAwC,CACvC,gCAAgC,EAChC,qBAAqB,EACrB,6BAA6B,CAC9B,CAAC;YACN,CAAC;iBAAM,CAAC;gBACN,MAAM,2BAA2B,GAAG,MAAM,aAAa;qBACpD,yCAAyC,CAAC,IAAI,CAAC,YAAY,CAAC;qBAC5D,yBAAyB,CAAC,gCAAgC,EAAE,qBAAqB,CAAC,CAAC;gBAEtF,IAAI,2BAA2B,CAAC,EAAE,IAAI,2BAA2B,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;oBACjF,sBAAsB,GAAG,IAAI,CAAC;gBAChC,CAAC;qBAAM,CAAC;oBACN,sBAAsB,GAAG,2BAA2B,CAAC;gBACvD,CAAC;YACH,CAAC;YAED,IAAI,CAAC,sBAAsB,EAAE,CAAC;gBAC5B,OAAO,IAAI,CAAC;YACd,CAAC;YAED,IAAI,CAAC,sBAAsB,CAAC,EAAE,EAAE,CAAC;gBAC/B,OAAO,IAAA,gBAAM,EAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC;YAC/C,CAAC;YACD,aAAa,GAAG,sBAAsB,CAAC,KAAK,CAAC;QAC/C,CAAC;QACD,OAAO,IAAA,gBAAM,EAAC,aAAa,CAAC,CAAC;IAC/B,CAAC;CACF;AAnbD,kEAmbC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Result } from '@expo/results';
|
|
2
2
|
import { IEntityClass } from './Entity';
|
|
3
|
-
import EntityConfiguration from './EntityConfiguration';
|
|
3
|
+
import EntityConfiguration, { EntityCompositeField, EntityCompositeFieldValue } from './EntityConfiguration';
|
|
4
4
|
import { FieldEqualityCondition, QuerySelectionModifiers, QuerySelectionModifiersWithOrderByRaw } from './EntityDatabaseAdapter';
|
|
5
5
|
import EntityLoaderUtils from './EntityLoaderUtils';
|
|
6
6
|
import EntityPrivacyPolicy from './EntityPrivacyPolicy';
|
|
@@ -15,114 +15,86 @@ import IEntityMetricsAdapter from './metrics/IEntityMetricsAdapter';
|
|
|
15
15
|
* loader are are results (or null for some loader methods), where an unsuccessful result
|
|
16
16
|
* means an authorization error or entity construction error occurred. Other errors are thrown.
|
|
17
17
|
*/
|
|
18
|
-
export default class AuthorizationResultBasedEntityLoader<TFields extends
|
|
18
|
+
export default class AuthorizationResultBasedEntityLoader<TFields extends Record<string, any>, TIDField extends keyof NonNullable<Pick<TFields, TSelectedFields>>, TViewerContext extends ViewerContext, TEntity extends ReadonlyEntity<TFields, TIDField, TViewerContext, TSelectedFields>, TPrivacyPolicy extends EntityPrivacyPolicy<TFields, TIDField, TViewerContext, TEntity, TSelectedFields>, TSelectedFields extends keyof TFields> {
|
|
19
19
|
private readonly queryContext;
|
|
20
20
|
private readonly entityConfiguration;
|
|
21
21
|
private readonly entityClass;
|
|
22
22
|
private readonly dataManager;
|
|
23
23
|
protected readonly metricsAdapter: IEntityMetricsAdapter;
|
|
24
|
-
readonly utils: EntityLoaderUtils<TFields,
|
|
25
|
-
constructor(queryContext: EntityQueryContext, entityConfiguration: EntityConfiguration<TFields>, entityClass: IEntityClass<TFields,
|
|
24
|
+
readonly utils: EntityLoaderUtils<TFields, TIDField, TViewerContext, TEntity, TPrivacyPolicy, TSelectedFields>;
|
|
25
|
+
constructor(queryContext: EntityQueryContext, entityConfiguration: EntityConfiguration<TFields, TIDField>, entityClass: IEntityClass<TFields, TIDField, TViewerContext, TEntity, TPrivacyPolicy, TSelectedFields>, dataManager: EntityDataManager<TFields, TIDField>, metricsAdapter: IEntityMetricsAdapter, utils: EntityLoaderUtils<TFields, TIDField, TViewerContext, TEntity, TPrivacyPolicy, TSelectedFields>);
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
28
|
-
* @param fieldName - entity field being queried
|
|
29
|
-
* @param fieldValues - fieldName field values being queried
|
|
27
|
+
* Authorization-result-based version of the EnforcingEntityLoader method by the same name.
|
|
30
28
|
* @returns map from fieldValue to entity results that match the query for that fieldValue,
|
|
31
29
|
* where result errors can be UnauthorizedError
|
|
32
30
|
*/
|
|
33
31
|
loadManyByFieldEqualingManyAsync<N extends keyof Pick<TFields, TSelectedFields>>(fieldName: N, fieldValues: readonly NonNullable<TFields[N]>[]): Promise<ReadonlyMap<NonNullable<TFields[N]>, readonly Result<TEntity>[]>>;
|
|
34
32
|
/**
|
|
35
|
-
*
|
|
36
|
-
* @
|
|
37
|
-
*
|
|
33
|
+
* Authorization-result-based version of the EnforcingEntityLoader method by the same name.
|
|
34
|
+
* @returns map from compositeField to entity results that match the query for that compositeField,
|
|
35
|
+
* where result errors can be UnauthorizedError
|
|
36
|
+
*/
|
|
37
|
+
loadManyByCompositeFieldEqualingManyAsync<N extends EntityCompositeField<Pick<TFields, TSelectedFields>>>(compositeField: N, compositeFieldValues: readonly EntityCompositeFieldValue<Pick<TFields, TSelectedFields>, N>[]): Promise<ReadonlyMap<EntityCompositeFieldValue<TFields, N>, readonly Result<TEntity>[]>>;
|
|
38
|
+
/**
|
|
39
|
+
* Authorization-result-based version of the EnforcingEntityLoader method by the same name.
|
|
38
40
|
* @returns array of entity results that match the query for fieldValue, where result error can be UnauthorizedError
|
|
39
41
|
*/
|
|
40
42
|
loadManyByFieldEqualingAsync<N extends keyof Pick<TFields, TSelectedFields>>(fieldName: N, fieldValue: NonNullable<TFields[N]>): Promise<readonly Result<TEntity>[]>;
|
|
41
43
|
/**
|
|
42
|
-
*
|
|
43
|
-
* @
|
|
44
|
-
|
|
44
|
+
* Authorization-result-based version of the EnforcingEntityLoader method by the same name.
|
|
45
|
+
* @returns array of entity results that match the query for compositeFieldValue, where result error can be UnauthorizedError
|
|
46
|
+
*/
|
|
47
|
+
loadManyByCompositeFieldEqualingAsync<N extends EntityCompositeField<Pick<TFields, TSelectedFields>>>(compositeField: N, compositeFieldValue: EntityCompositeFieldValue<Pick<TFields, TSelectedFields>, N>): Promise<readonly Result<TEntity>[]>;
|
|
48
|
+
/**
|
|
49
|
+
* Authorization-result-based version of the EnforcingEntityLoader method by the same name.
|
|
45
50
|
* @returns entity result where uniqueFieldName equals fieldValue, or null if no entity matches the condition.
|
|
46
51
|
* @throws when multiple entities match the condition
|
|
47
52
|
*/
|
|
48
53
|
loadByFieldEqualingAsync<N extends keyof Pick<TFields, TSelectedFields>>(uniqueFieldName: N, fieldValue: NonNullable<TFields[N]>): Promise<Result<TEntity> | null>;
|
|
49
54
|
/**
|
|
50
|
-
*
|
|
51
|
-
* @
|
|
55
|
+
* Authorization-result-based version of the EnforcingEntityLoader method by the same name.
|
|
56
|
+
* @returns entity result where uniqueFieldName equals fieldValue, where result error can be UnauthorizedError.
|
|
57
|
+
*/
|
|
58
|
+
loadByCompositeFieldEqualingAsync<N extends EntityCompositeField<Pick<TFields, TSelectedFields>>>(compositeField: N, compositeFieldValue: EntityCompositeFieldValue<Pick<TFields, TSelectedFields>, N>): Promise<Result<TEntity> | null>;
|
|
59
|
+
/**
|
|
60
|
+
* Authorization-result-based version of the EnforcingEntityLoader method by the same name.
|
|
52
61
|
* @returns entity result for matching ID, where result error can be UnauthorizedError or EntityNotFoundError.
|
|
53
62
|
*/
|
|
54
|
-
loadByIDAsync(id:
|
|
63
|
+
loadByIDAsync(id: TFields[TIDField]): Promise<Result<TEntity>>;
|
|
55
64
|
/**
|
|
56
|
-
*
|
|
57
|
-
* @param id - ID of the entity
|
|
65
|
+
* Authorization-result-based version of the EnforcingEntityLoader method by the same name.
|
|
58
66
|
* @returns entity result for matching ID, or null if no entity exists for ID.
|
|
59
67
|
*/
|
|
60
|
-
loadByIDNullableAsync(id:
|
|
68
|
+
loadByIDNullableAsync(id: TFields[TIDField]): Promise<Result<TEntity> | null>;
|
|
61
69
|
/**
|
|
62
|
-
*
|
|
63
|
-
* @param ids - IDs of the entities to load
|
|
70
|
+
* Authorization-result-based version of the EnforcingEntityLoader method by the same name.
|
|
64
71
|
* @returns map from ID to corresponding entity result, where result error can be UnauthorizedError or EntityNotFoundError.
|
|
65
72
|
*/
|
|
66
|
-
loadManyByIDsAsync(ids: readonly
|
|
73
|
+
loadManyByIDsAsync(ids: readonly TFields[TIDField][]): Promise<ReadonlyMap<TFields[TIDField], Result<TEntity>>>;
|
|
67
74
|
/**
|
|
68
|
-
*
|
|
69
|
-
* @
|
|
70
|
-
* @returns map from ID to nullable corresponding entity result, where result error can be UnauthorizedError or EntityNotFoundError.
|
|
75
|
+
* Authorization-result-based version of the EnforcingEntityLoader method by the same name.
|
|
76
|
+
* @returns map from ID to nullable corresponding entity result, where result error can be UnauthorizedError.
|
|
71
77
|
*/
|
|
72
|
-
loadManyByIDsNullableAsync(ids: readonly
|
|
78
|
+
loadManyByIDsNullableAsync(ids: readonly TFields[TIDField][]): Promise<ReadonlyMap<TFields[TIDField], Result<TEntity> | null>>;
|
|
73
79
|
/**
|
|
74
|
-
*
|
|
75
|
-
* operands, or null if no matching entity exists. Entities loaded using this method are not
|
|
76
|
-
* batched or cached.
|
|
77
|
-
*
|
|
78
|
-
* This is a convenience method for {@link loadManyByFieldEqualityConjunctionAsync}. However, the
|
|
79
|
-
* `orderBy` option must be specified to define what "first" means. If ordering doesn't matter,
|
|
80
|
-
* explicitly pass in an empty array.
|
|
81
|
-
*
|
|
82
|
-
* @param fieldEqualityOperands - list of field equality selection operand specifications
|
|
83
|
-
* @param querySelectionModifiers - orderBy and optional offset for the query
|
|
80
|
+
* Authorization-result-based version of the EnforcingEntityLoader method by the same name.
|
|
84
81
|
* @returns the first entity results that matches the query, where result error can be
|
|
85
82
|
* UnauthorizedError
|
|
86
83
|
*/
|
|
87
84
|
loadFirstByFieldEqualityConjunctionAsync<N extends keyof Pick<TFields, TSelectedFields>>(fieldEqualityOperands: FieldEqualityCondition<TFields, N>[], querySelectionModifiers: Omit<QuerySelectionModifiers<TFields>, 'limit'> & Required<Pick<QuerySelectionModifiers<TFields>, 'orderBy'>>): Promise<Result<TEntity> | null>;
|
|
88
85
|
/**
|
|
89
|
-
*
|
|
90
|
-
* Entities loaded using this method are not batched or cached.
|
|
91
|
-
*
|
|
92
|
-
* @example
|
|
93
|
-
* fieldEqualityOperands:
|
|
94
|
-
* `[{fieldName: 'hello', fieldValue: 1}, {fieldName: 'world', fieldValues: [2, 3]}]`
|
|
95
|
-
* Entities returned with a SQL EntityDatabaseAdapter:
|
|
96
|
-
* `WHERE hello = 1 AND world = ANY({2, 3})`
|
|
97
|
-
*
|
|
98
|
-
* @param fieldEqualityOperands - list of field equality selection operand specifications
|
|
99
|
-
* @param querySelectionModifiers - limit, offset, and orderBy for the query
|
|
86
|
+
* Authorization-result-based version of the EnforcingEntityLoader method by the same name.
|
|
100
87
|
* @returns array of entity results that match the query, where result error can be UnauthorizedError
|
|
101
88
|
*/
|
|
102
89
|
loadManyByFieldEqualityConjunctionAsync<N extends keyof Pick<TFields, TSelectedFields>>(fieldEqualityOperands: FieldEqualityCondition<TFields, N>[], querySelectionModifiers?: QuerySelectionModifiers<TFields>): Promise<readonly Result<TEntity>[]>;
|
|
103
90
|
/**
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* @remarks
|
|
107
|
-
* Important notes:
|
|
108
|
-
* - Fields in clause are database column names instead of transformed entity field names.
|
|
109
|
-
* - Entities loaded using this method are not batched or cached.
|
|
110
|
-
* - Not all database adapters implement the ability to execute this method of fetching entities.
|
|
111
|
-
*
|
|
112
|
-
* @example
|
|
113
|
-
* rawWhereClause: `id = ?`
|
|
114
|
-
* bindings: `[1]`
|
|
115
|
-
* Entites returned `WHERE id = 1`
|
|
116
|
-
*
|
|
117
|
-
* http://knexjs.org/#Builder-whereRaw
|
|
118
|
-
* http://knexjs.org/#Raw-Bindings
|
|
119
|
-
*
|
|
120
|
-
* @param rawWhereClause - parameterized SQL WHERE clause with positional binding placeholders or named binding placeholders
|
|
121
|
-
* @param bindings - array of positional bindings or object of named bindings
|
|
122
|
-
* @param querySelectionModifiers - limit, offset, orderBy, and orderByRaw for the query
|
|
91
|
+
* Authorization-result-based version of the EnforcingEntityLoader method by the same name.
|
|
123
92
|
* @returns array of entity results that match the query, where result error can be UnauthorizedError
|
|
124
93
|
* @throws Error when rawWhereClause or bindings are invalid
|
|
125
94
|
*/
|
|
126
95
|
loadManyByRawWhereClauseAsync(rawWhereClause: string, bindings: any[] | object, querySelectionModifiers?: QuerySelectionModifiersWithOrderByRaw<TFields>): Promise<readonly Result<TEntity>[]>;
|
|
127
|
-
private
|
|
96
|
+
private validateFieldAndValues;
|
|
97
|
+
private validateFieldAndValuesAndConvertToHolders;
|
|
98
|
+
private validateCompositeFieldAndValuesAndConvertToHolders;
|
|
99
|
+
private constructAndAuthorizeEntitiesFromCompositeFieldValueHolderMapAsync;
|
|
128
100
|
}
|
|
@@ -9,7 +9,11 @@ const nullthrows_1 = __importDefault(require("nullthrows"));
|
|
|
9
9
|
const EntityDatabaseAdapter_1 = require("./EntityDatabaseAdapter");
|
|
10
10
|
const EntityInvalidFieldValueError_1 = __importDefault(require("./errors/EntityInvalidFieldValueError"));
|
|
11
11
|
const EntityNotFoundError_1 = __importDefault(require("./errors/EntityNotFoundError"));
|
|
12
|
+
const CompositeFieldHolder_1 = require("./internal/CompositeFieldHolder");
|
|
13
|
+
const CompositeFieldValueMap_1 = require("./internal/CompositeFieldValueMap");
|
|
14
|
+
const SingleFieldHolder_1 = require("./internal/SingleFieldHolder");
|
|
12
15
|
const maps_1 = require("./utils/collections/maps");
|
|
16
|
+
const sets_1 = require("./utils/collections/sets");
|
|
13
17
|
/**
|
|
14
18
|
* Authorization-result-based entity loader. All normal loads are batched,
|
|
15
19
|
* cached, and authorized against the entity's EntityPrivacyPolicy. All loads through this
|
|
@@ -32,21 +36,28 @@ class AuthorizationResultBasedEntityLoader {
|
|
|
32
36
|
this.utils = utils;
|
|
33
37
|
}
|
|
34
38
|
/**
|
|
35
|
-
*
|
|
36
|
-
* @param fieldName - entity field being queried
|
|
37
|
-
* @param fieldValues - fieldName field values being queried
|
|
39
|
+
* Authorization-result-based version of the EnforcingEntityLoader method by the same name.
|
|
38
40
|
* @returns map from fieldValue to entity results that match the query for that fieldValue,
|
|
39
41
|
* where result errors can be UnauthorizedError
|
|
40
42
|
*/
|
|
41
43
|
async loadManyByFieldEqualingManyAsync(fieldName, fieldValues) {
|
|
42
|
-
this.
|
|
43
|
-
const
|
|
44
|
+
const { loadKey, loadValues } = this.validateFieldAndValuesAndConvertToHolders(fieldName, fieldValues);
|
|
45
|
+
const loadValuesToFieldObjects = await this.dataManager.loadManyEqualingAsync(this.queryContext, loadKey, loadValues);
|
|
46
|
+
const fieldValuesToFieldObjects = (0, maps_1.mapKeys)(loadValuesToFieldObjects, (loadValue) => loadValue.fieldValue);
|
|
44
47
|
return await this.utils.constructAndAuthorizeEntitiesAsync(fieldValuesToFieldObjects);
|
|
45
48
|
}
|
|
46
49
|
/**
|
|
47
|
-
*
|
|
48
|
-
* @
|
|
49
|
-
*
|
|
50
|
+
* Authorization-result-based version of the EnforcingEntityLoader method by the same name.
|
|
51
|
+
* @returns map from compositeField to entity results that match the query for that compositeField,
|
|
52
|
+
* where result errors can be UnauthorizedError
|
|
53
|
+
*/
|
|
54
|
+
async loadManyByCompositeFieldEqualingManyAsync(compositeField, compositeFieldValues) {
|
|
55
|
+
const { compositeFieldHolder, compositeFieldValueHolders } = this.validateCompositeFieldAndValuesAndConvertToHolders(compositeField, compositeFieldValues);
|
|
56
|
+
const compositeFieldValuesToFieldObjects = await this.dataManager.loadManyEqualingAsync(this.queryContext, compositeFieldHolder, compositeFieldValueHolders);
|
|
57
|
+
return await this.constructAndAuthorizeEntitiesFromCompositeFieldValueHolderMapAsync(compositeFieldValuesToFieldObjects);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Authorization-result-based version of the EnforcingEntityLoader method by the same name.
|
|
50
61
|
* @returns array of entity results that match the query for fieldValue, where result error can be UnauthorizedError
|
|
51
62
|
*/
|
|
52
63
|
async loadManyByFieldEqualingAsync(fieldName, fieldValue) {
|
|
@@ -56,9 +67,19 @@ class AuthorizationResultBasedEntityLoader {
|
|
|
56
67
|
return entityResultsForFieldValue;
|
|
57
68
|
}
|
|
58
69
|
/**
|
|
59
|
-
*
|
|
60
|
-
* @
|
|
61
|
-
|
|
70
|
+
* Authorization-result-based version of the EnforcingEntityLoader method by the same name.
|
|
71
|
+
* @returns array of entity results that match the query for compositeFieldValue, where result error can be UnauthorizedError
|
|
72
|
+
*/
|
|
73
|
+
async loadManyByCompositeFieldEqualingAsync(compositeField, compositeFieldValue) {
|
|
74
|
+
const entityResults = await this.loadManyByCompositeFieldEqualingManyAsync(compositeField, [
|
|
75
|
+
compositeFieldValue,
|
|
76
|
+
]);
|
|
77
|
+
const entityResultForCompositeFieldValue = entityResults.get(compositeFieldValue);
|
|
78
|
+
(0, invariant_1.default)(entityResultForCompositeFieldValue !== undefined, `${compositeFieldValue} should be guaranteed to be present in returned map of entities`);
|
|
79
|
+
return entityResultForCompositeFieldValue;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Authorization-result-based version of the EnforcingEntityLoader method by the same name.
|
|
62
83
|
* @returns entity result where uniqueFieldName equals fieldValue, or null if no entity matches the condition.
|
|
63
84
|
* @throws when multiple entities match the condition
|
|
64
85
|
*/
|
|
@@ -68,8 +89,16 @@ class AuthorizationResultBasedEntityLoader {
|
|
|
68
89
|
return entityResults[0] ?? null;
|
|
69
90
|
}
|
|
70
91
|
/**
|
|
71
|
-
*
|
|
72
|
-
* @
|
|
92
|
+
* Authorization-result-based version of the EnforcingEntityLoader method by the same name.
|
|
93
|
+
* @returns entity result where uniqueFieldName equals fieldValue, where result error can be UnauthorizedError.
|
|
94
|
+
*/
|
|
95
|
+
async loadByCompositeFieldEqualingAsync(compositeField, compositeFieldValue) {
|
|
96
|
+
const entityResults = await this.loadManyByCompositeFieldEqualingAsync(compositeField, compositeFieldValue);
|
|
97
|
+
(0, invariant_1.default)(entityResults.length <= 1, `loadByCompositeFieldEqualing: Multiple entities of type ${this.entityClass.name} found for composite field (${compositeField.join(',')})=${JSON.stringify(compositeFieldValue)}`);
|
|
98
|
+
return entityResults[0] ?? null;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Authorization-result-based version of the EnforcingEntityLoader method by the same name.
|
|
73
102
|
* @returns entity result for matching ID, where result error can be UnauthorizedError or EntityNotFoundError.
|
|
74
103
|
*/
|
|
75
104
|
async loadByIDAsync(id) {
|
|
@@ -78,16 +107,14 @@ class AuthorizationResultBasedEntityLoader {
|
|
|
78
107
|
return (0, nullthrows_1.default)(entityResults.get(id));
|
|
79
108
|
}
|
|
80
109
|
/**
|
|
81
|
-
*
|
|
82
|
-
* @param id - ID of the entity
|
|
110
|
+
* Authorization-result-based version of the EnforcingEntityLoader method by the same name.
|
|
83
111
|
* @returns entity result for matching ID, or null if no entity exists for ID.
|
|
84
112
|
*/
|
|
85
113
|
async loadByIDNullableAsync(id) {
|
|
86
114
|
return await this.loadByFieldEqualingAsync(this.entityConfiguration.idField, id);
|
|
87
115
|
}
|
|
88
116
|
/**
|
|
89
|
-
*
|
|
90
|
-
* @param ids - IDs of the entities to load
|
|
117
|
+
* Authorization-result-based version of the EnforcingEntityLoader method by the same name.
|
|
91
118
|
* @returns map from ID to corresponding entity result, where result error can be UnauthorizedError or EntityNotFoundError.
|
|
92
119
|
*/
|
|
93
120
|
async loadManyByIDsAsync(ids) {
|
|
@@ -99,9 +126,8 @@ class AuthorizationResultBasedEntityLoader {
|
|
|
99
126
|
});
|
|
100
127
|
}
|
|
101
128
|
/**
|
|
102
|
-
*
|
|
103
|
-
* @
|
|
104
|
-
* @returns map from ID to nullable corresponding entity result, where result error can be UnauthorizedError or EntityNotFoundError.
|
|
129
|
+
* Authorization-result-based version of the EnforcingEntityLoader method by the same name.
|
|
130
|
+
* @returns map from ID to nullable corresponding entity result, where result error can be UnauthorizedError.
|
|
105
131
|
*/
|
|
106
132
|
async loadManyByIDsNullableAsync(ids) {
|
|
107
133
|
const entityResults = (await this.loadManyByFieldEqualingManyAsync(this.entityConfiguration.idField, ids));
|
|
@@ -110,16 +136,7 @@ class AuthorizationResultBasedEntityLoader {
|
|
|
110
136
|
});
|
|
111
137
|
}
|
|
112
138
|
/**
|
|
113
|
-
*
|
|
114
|
-
* operands, or null if no matching entity exists. Entities loaded using this method are not
|
|
115
|
-
* batched or cached.
|
|
116
|
-
*
|
|
117
|
-
* This is a convenience method for {@link loadManyByFieldEqualityConjunctionAsync}. However, the
|
|
118
|
-
* `orderBy` option must be specified to define what "first" means. If ordering doesn't matter,
|
|
119
|
-
* explicitly pass in an empty array.
|
|
120
|
-
*
|
|
121
|
-
* @param fieldEqualityOperands - list of field equality selection operand specifications
|
|
122
|
-
* @param querySelectionModifiers - orderBy and optional offset for the query
|
|
139
|
+
* Authorization-result-based version of the EnforcingEntityLoader method by the same name.
|
|
123
140
|
* @returns the first entity results that matches the query, where result error can be
|
|
124
141
|
* UnauthorizedError
|
|
125
142
|
*/
|
|
@@ -131,17 +148,7 @@ class AuthorizationResultBasedEntityLoader {
|
|
|
131
148
|
return results[0] ?? null;
|
|
132
149
|
}
|
|
133
150
|
/**
|
|
134
|
-
*
|
|
135
|
-
* Entities loaded using this method are not batched or cached.
|
|
136
|
-
*
|
|
137
|
-
* @example
|
|
138
|
-
* fieldEqualityOperands:
|
|
139
|
-
* `[{fieldName: 'hello', fieldValue: 1}, {fieldName: 'world', fieldValues: [2, 3]}]`
|
|
140
|
-
* Entities returned with a SQL EntityDatabaseAdapter:
|
|
141
|
-
* `WHERE hello = 1 AND world = ANY({2, 3})`
|
|
142
|
-
*
|
|
143
|
-
* @param fieldEqualityOperands - list of field equality selection operand specifications
|
|
144
|
-
* @param querySelectionModifiers - limit, offset, and orderBy for the query
|
|
151
|
+
* Authorization-result-based version of the EnforcingEntityLoader method by the same name.
|
|
145
152
|
* @returns array of entity results that match the query, where result error can be UnauthorizedError
|
|
146
153
|
*/
|
|
147
154
|
async loadManyByFieldEqualityConjunctionAsync(fieldEqualityOperands, querySelectionModifiers = {}) {
|
|
@@ -149,31 +156,13 @@ class AuthorizationResultBasedEntityLoader {
|
|
|
149
156
|
const fieldValues = (0, EntityDatabaseAdapter_1.isSingleValueFieldEqualityCondition)(fieldEqualityOperand)
|
|
150
157
|
? [fieldEqualityOperand.fieldValue]
|
|
151
158
|
: fieldEqualityOperand.fieldValues;
|
|
152
|
-
this.
|
|
159
|
+
this.validateFieldAndValues(fieldEqualityOperand.fieldName, fieldValues);
|
|
153
160
|
}
|
|
154
161
|
const fieldObjects = await this.dataManager.loadManyByFieldEqualityConjunctionAsync(this.queryContext, fieldEqualityOperands, querySelectionModifiers);
|
|
155
162
|
return await this.utils.constructAndAuthorizeEntitiesArrayAsync(fieldObjects);
|
|
156
163
|
}
|
|
157
164
|
/**
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
* @remarks
|
|
161
|
-
* Important notes:
|
|
162
|
-
* - Fields in clause are database column names instead of transformed entity field names.
|
|
163
|
-
* - Entities loaded using this method are not batched or cached.
|
|
164
|
-
* - Not all database adapters implement the ability to execute this method of fetching entities.
|
|
165
|
-
*
|
|
166
|
-
* @example
|
|
167
|
-
* rawWhereClause: `id = ?`
|
|
168
|
-
* bindings: `[1]`
|
|
169
|
-
* Entites returned `WHERE id = 1`
|
|
170
|
-
*
|
|
171
|
-
* http://knexjs.org/#Builder-whereRaw
|
|
172
|
-
* http://knexjs.org/#Raw-Bindings
|
|
173
|
-
*
|
|
174
|
-
* @param rawWhereClause - parameterized SQL WHERE clause with positional binding placeholders or named binding placeholders
|
|
175
|
-
* @param bindings - array of positional bindings or object of named bindings
|
|
176
|
-
* @param querySelectionModifiers - limit, offset, orderBy, and orderByRaw for the query
|
|
165
|
+
* Authorization-result-based version of the EnforcingEntityLoader method by the same name.
|
|
177
166
|
* @returns array of entity results that match the query, where result error can be UnauthorizedError
|
|
178
167
|
* @throws Error when rawWhereClause or bindings are invalid
|
|
179
168
|
*/
|
|
@@ -181,7 +170,7 @@ class AuthorizationResultBasedEntityLoader {
|
|
|
181
170
|
const fieldObjects = await this.dataManager.loadManyByRawWhereClauseAsync(this.queryContext, rawWhereClause, bindings, querySelectionModifiers);
|
|
182
171
|
return await this.utils.constructAndAuthorizeEntitiesArrayAsync(fieldObjects);
|
|
183
172
|
}
|
|
184
|
-
|
|
173
|
+
validateFieldAndValues(fieldName, fieldValues) {
|
|
185
174
|
const fieldDefinition = this.entityConfiguration.schema.get(fieldName);
|
|
186
175
|
(0, invariant_1.default)(fieldDefinition, `must have field definition for field = ${String(fieldName)}`);
|
|
187
176
|
for (const fieldValue of fieldValues) {
|
|
@@ -191,6 +180,40 @@ class AuthorizationResultBasedEntityLoader {
|
|
|
191
180
|
}
|
|
192
181
|
}
|
|
193
182
|
}
|
|
183
|
+
validateFieldAndValuesAndConvertToHolders(fieldName, fieldValues) {
|
|
184
|
+
this.validateFieldAndValues(fieldName, fieldValues);
|
|
185
|
+
return {
|
|
186
|
+
loadKey: new SingleFieldHolder_1.SingleFieldHolder(fieldName),
|
|
187
|
+
loadValues: fieldValues.map((fieldValue) => new SingleFieldHolder_1.SingleFieldValueHolder(fieldValue)),
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
validateCompositeFieldAndValuesAndConvertToHolders(compositeField, compositeFieldValues) {
|
|
191
|
+
// validate that the composite field input is defined in the entity configuration
|
|
192
|
+
const compositeFieldHolder = this.entityConfiguration.compositeFieldInfo.getCompositeFieldHolderForCompositeField(compositeField);
|
|
193
|
+
(0, invariant_1.default)(compositeFieldHolder, `must have composite field definition for composite field = ${String(compositeField)}`);
|
|
194
|
+
const cacheableCompositeFieldFieldsSet = compositeFieldHolder.getFieldSet();
|
|
195
|
+
const compositeFieldValueHolders = compositeFieldValues.map((compositeFieldValue) => new CompositeFieldHolder_1.CompositeFieldValueHolder(compositeFieldValue));
|
|
196
|
+
// validate that the composite field values are valid
|
|
197
|
+
for (const compositeFieldValueHolder of compositeFieldValueHolders) {
|
|
198
|
+
(0, invariant_1.default)((0, sets_1.areSetsEqual)(cacheableCompositeFieldFieldsSet, compositeFieldValueHolder.getFieldSet()), `composite field values must contain exactly the fields defined in the composite field definition: ${compositeField}`);
|
|
199
|
+
for (const field of compositeField) {
|
|
200
|
+
const fieldValue = compositeFieldValueHolder.compositeFieldValue[field];
|
|
201
|
+
this.validateFieldAndValues(field, [fieldValue]);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return {
|
|
205
|
+
compositeFieldHolder,
|
|
206
|
+
compositeFieldValueHolders,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
async constructAndAuthorizeEntitiesFromCompositeFieldValueHolderMapAsync(map) {
|
|
210
|
+
return new CompositeFieldValueMap_1.CompositeFieldValueMap(await Promise.all(Array.from(map.entries()).map(async ([compositeFieldValueHolder, fieldObjects]) => {
|
|
211
|
+
return [
|
|
212
|
+
compositeFieldValueHolder,
|
|
213
|
+
await this.utils.constructAndAuthorizeEntitiesArrayAsync(fieldObjects),
|
|
214
|
+
];
|
|
215
|
+
})));
|
|
216
|
+
}
|
|
194
217
|
}
|
|
195
218
|
exports.default = AuthorizationResultBasedEntityLoader;
|
|
196
219
|
//# sourceMappingURL=AuthorizationResultBasedEntityLoader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthorizationResultBasedEntityLoader.js","sourceRoot":"","sources":["../src/AuthorizationResultBasedEntityLoader.ts"],"names":[],"mappings":";;;;;AAAA,2CAA+C;AAC/C,0DAAkC;AAClC,4DAAoC;
|
|
1
|
+
{"version":3,"file":"AuthorizationResultBasedEntityLoader.js","sourceRoot":"","sources":["../src/AuthorizationResultBasedEntityLoader.ts"],"names":[],"mappings":";;;;;AAAA,2CAA+C;AAC/C,0DAAkC;AAClC,4DAAoC;AAOpC,mEAKiC;AAMjC,yGAAiF;AACjF,uFAA+D;AAC/D,0EAAkG;AA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