@expo/entity 0.60.0 → 0.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/src/AuthorizationResultBasedEntityAssociationLoader.d.ts +6 -6
- package/build/src/AuthorizationResultBasedEntityAssociationLoader.js +5 -10
- package/build/src/AuthorizationResultBasedEntityLoader.d.ts +9 -9
- package/build/src/AuthorizationResultBasedEntityLoader.js +27 -35
- package/build/src/AuthorizationResultBasedEntityMutator.d.ts +13 -13
- package/build/src/AuthorizationResultBasedEntityMutator.js +54 -65
- package/build/src/ComposedEntityCacheAdapter.d.ts +3 -3
- package/build/src/ComposedEntityCacheAdapter.js +15 -23
- package/build/src/ComposedSecondaryEntityCache.d.ts +1 -1
- package/build/src/ComposedSecondaryEntityCache.js +4 -12
- package/build/src/EnforcingEntityAssociationLoader.d.ts +5 -5
- package/build/src/EnforcingEntityAssociationLoader.js +6 -11
- package/build/src/EnforcingEntityCreator.d.ts +4 -4
- package/build/src/EnforcingEntityCreator.js +3 -8
- package/build/src/EnforcingEntityDeleter.d.ts +4 -4
- package/build/src/EnforcingEntityDeleter.js +3 -8
- package/build/src/EnforcingEntityLoader.d.ts +5 -5
- package/build/src/EnforcingEntityLoader.js +9 -14
- package/build/src/EnforcingEntityUpdater.d.ts +4 -4
- package/build/src/EnforcingEntityUpdater.js +3 -8
- package/build/src/Entity.d.ts +9 -9
- package/build/src/Entity.js +11 -16
- package/build/src/EntityAssociationLoader.d.ts +5 -5
- package/build/src/EntityAssociationLoader.js +5 -10
- package/build/src/EntityCompanion.d.ts +9 -9
- package/build/src/EntityCompanion.js +6 -11
- package/build/src/EntityCompanionProvider.d.ts +13 -12
- package/build/src/EntityCompanionProvider.js +13 -21
- package/build/src/EntityConfiguration.d.ts +4 -4
- package/build/src/EntityConfiguration.js +14 -23
- package/build/src/EntityConstructionUtils.d.ts +8 -8
- package/build/src/EntityConstructionUtils.js +15 -23
- package/build/src/EntityCreator.d.ts +7 -7
- package/build/src/EntityCreator.js +3 -8
- package/build/src/EntityDatabaseAdapter.d.ts +4 -4
- package/build/src/EntityDatabaseAdapter.js +19 -27
- package/build/src/EntityDeleter.d.ts +7 -7
- package/build/src/EntityDeleter.js +3 -8
- package/build/src/EntityFieldDefinition.d.ts +4 -4
- package/build/src/EntityFieldDefinition.js +5 -10
- package/build/src/EntityFields.d.ts +2 -1
- package/build/src/EntityFields.js +12 -27
- package/build/src/EntityInvalidationUtils.d.ts +8 -10
- package/build/src/EntityInvalidationUtils.js +5 -10
- package/build/src/EntityLoader.d.ts +7 -7
- package/build/src/EntityLoader.js +3 -8
- package/build/src/EntityLoaderFactory.d.ts +11 -11
- package/build/src/EntityLoaderFactory.js +7 -12
- package/build/src/EntityMutationInfo.d.ts +2 -2
- package/build/src/EntityMutationInfo.js +2 -6
- package/build/src/EntityMutationTriggerConfiguration.d.ts +4 -4
- package/build/src/EntityMutationTriggerConfiguration.js +2 -8
- package/build/src/EntityMutationValidatorConfiguration.d.ts +4 -4
- package/build/src/EntityMutationValidatorConfiguration.js +1 -6
- package/build/src/EntityMutatorFactory.d.ts +13 -13
- package/build/src/EntityMutatorFactory.js +5 -10
- package/build/src/EntityPrivacyPolicy.d.ts +7 -7
- package/build/src/EntityPrivacyPolicy.js +22 -27
- package/build/src/EntityQueryContext.d.ts +1 -1
- package/build/src/EntityQueryContext.js +11 -22
- package/build/src/EntityQueryContextProvider.d.ts +2 -1
- package/build/src/EntityQueryContextProvider.js +7 -12
- package/build/src/EntitySecondaryCacheLoader.d.ts +7 -7
- package/build/src/EntitySecondaryCacheLoader.js +4 -9
- package/build/src/EntityUpdater.d.ts +7 -7
- package/build/src/EntityUpdater.js +3 -8
- package/build/src/GenericEntityCacheAdapter.d.ts +4 -4
- package/build/src/GenericEntityCacheAdapter.js +5 -13
- package/build/src/GenericSecondaryEntityCache.d.ts +2 -2
- package/build/src/GenericSecondaryEntityCache.js +10 -18
- package/build/src/IEntityCacheAdapter.d.ts +2 -2
- package/build/src/IEntityCacheAdapter.js +1 -3
- package/build/src/IEntityCacheAdapterProvider.d.ts +2 -2
- package/build/src/IEntityCacheAdapterProvider.js +1 -3
- package/build/src/IEntityDatabaseAdapterProvider.d.ts +2 -2
- package/build/src/IEntityDatabaseAdapterProvider.js +1 -3
- package/build/src/IEntityGenericCacher.d.ts +2 -2
- package/build/src/IEntityGenericCacher.js +1 -3
- package/build/src/ReadonlyEntity.d.ts +10 -10
- package/build/src/ReadonlyEntity.js +9 -17
- package/build/src/ViewerContext.d.ts +6 -6
- package/build/src/ViewerContext.js +3 -8
- package/build/src/ViewerScopedEntityCompanion.d.ts +8 -8
- package/build/src/ViewerScopedEntityCompanion.js +5 -10
- package/build/src/ViewerScopedEntityCompanionProvider.d.ts +6 -6
- package/build/src/ViewerScopedEntityCompanionProvider.js +3 -8
- package/build/src/ViewerScopedEntityLoaderFactory.d.ts +9 -9
- package/build/src/ViewerScopedEntityLoaderFactory.js +1 -6
- package/build/src/ViewerScopedEntityMutatorFactory.d.ts +7 -7
- package/build/src/ViewerScopedEntityMutatorFactory.js +1 -6
- package/build/src/entityUtils.d.ts +1 -1
- package/build/src/entityUtils.js +9 -21
- package/build/src/errors/EntityCacheAdapterError.d.ts +1 -1
- package/build/src/errors/EntityCacheAdapterError.js +5 -11
- package/build/src/errors/EntityDatabaseAdapterError.d.ts +1 -1
- package/build/src/errors/EntityDatabaseAdapterError.js +41 -59
- package/build/src/errors/EntityError.js +5 -10
- package/build/src/errors/EntityInvalidFieldValueError.d.ts +5 -5
- package/build/src/errors/EntityInvalidFieldValueError.js +4 -9
- package/build/src/errors/EntityNotAuthorizedError.d.ts +4 -4
- package/build/src/errors/EntityNotAuthorizedError.js +6 -11
- package/build/src/errors/EntityNotFoundError.d.ts +5 -5
- package/build/src/errors/EntityNotFoundError.js +4 -9
- package/build/src/index.d.ts +77 -77
- package/build/src/index.js +77 -94
- package/build/src/internal/CompositeFieldHolder.d.ts +3 -2
- package/build/src/internal/CompositeFieldHolder.js +11 -21
- package/build/src/internal/CompositeFieldValueMap.d.ts +2 -2
- package/build/src/internal/CompositeFieldValueMap.js +7 -12
- package/build/src/internal/EntityDataManager.d.ts +6 -6
- package/build/src/internal/EntityDataManager.js +25 -33
- package/build/src/internal/EntityFieldTransformationUtils.d.ts +1 -1
- package/build/src/internal/EntityFieldTransformationUtils.js +11 -23
- package/build/src/internal/EntityLoadInterfaces.d.ts +3 -2
- package/build/src/internal/EntityLoadInterfaces.js +4 -9
- package/build/src/internal/EntityTableDataCoordinator.d.ts +8 -8
- package/build/src/internal/EntityTableDataCoordinator.js +4 -9
- package/build/src/internal/ReadThroughEntityCache.d.ts +3 -3
- package/build/src/internal/ReadThroughEntityCache.js +7 -15
- package/build/src/internal/SingleFieldHolder.d.ts +3 -2
- package/build/src/internal/SingleFieldHolder.js +9 -19
- package/build/src/metrics/EntityMetricsUtils.d.ts +3 -3
- package/build/src/metrics/EntityMetricsUtils.js +6 -14
- package/build/src/metrics/IEntityMetricsAdapter.d.ts +2 -2
- package/build/src/metrics/IEntityMetricsAdapter.js +8 -12
- package/build/src/metrics/NoOpEntityMetricsAdapter.d.ts +1 -1
- package/build/src/metrics/NoOpEntityMetricsAdapter.js +1 -6
- package/build/src/rules/AllowIfAllSubRulesAllowPrivacyPolicyRule.d.ts +5 -5
- package/build/src/rules/AllowIfAllSubRulesAllowPrivacyPolicyRule.js +5 -10
- package/build/src/rules/AllowIfAnySubRuleAllowsPrivacyPolicyRule.d.ts +5 -5
- package/build/src/rules/AllowIfAnySubRuleAllowsPrivacyPolicyRule.js +5 -10
- package/build/src/rules/AllowIfInParentCascadeDeletionPrivacyPolicyRule.d.ts +6 -6
- package/build/src/rules/AllowIfInParentCascadeDeletionPrivacyPolicyRule.js +6 -11
- package/build/src/rules/AlwaysAllowPrivacyPolicyRule.d.ts +5 -5
- package/build/src/rules/AlwaysAllowPrivacyPolicyRule.js +3 -8
- package/build/src/rules/AlwaysDenyPrivacyPolicyRule.d.ts +5 -5
- package/build/src/rules/AlwaysDenyPrivacyPolicyRule.js +3 -8
- package/build/src/rules/AlwaysSkipPrivacyPolicyRule.d.ts +5 -5
- package/build/src/rules/AlwaysSkipPrivacyPolicyRule.js +3 -8
- package/build/src/rules/EvaluateIfEntityFieldPredicatePrivacyPolicyRule.d.ts +5 -5
- package/build/src/rules/EvaluateIfEntityFieldPredicatePrivacyPolicyRule.js +3 -8
- package/build/src/rules/PrivacyPolicyRule.d.ts +4 -4
- package/build/src/rules/PrivacyPolicyRule.js +3 -8
- package/build/src/utils/EntityCreationUtils.d.ts +5 -5
- package/build/src/utils/EntityCreationUtils.js +6 -11
- package/build/src/utils/EntityPrivacyUtils.d.ts +5 -5
- package/build/src/utils/EntityPrivacyUtils.js +20 -27
- package/build/src/utils/collections/SerializableKeyMap.js +1 -6
- package/build/src/utils/collections/maps.js +11 -27
- package/build/src/utils/collections/sets.js +1 -5
- package/build/src/utils/mergeEntityMutationTriggerConfigurations.d.ts +3 -3
- package/build/src/utils/mergeEntityMutationTriggerConfigurations.js +1 -5
- package/package.json +8 -7
- package/src/AuthorizationResultBasedEntityAssociationLoader.ts +7 -6
- package/src/AuthorizationResultBasedEntityLoader.ts +19 -17
- package/src/AuthorizationResultBasedEntityMutator.ts +24 -22
- package/src/ComposedEntityCacheAdapter.ts +5 -4
- package/src/ComposedSecondaryEntityCache.ts +2 -2
- package/src/EnforcingEntityAssociationLoader.ts +7 -7
- package/src/EnforcingEntityCreator.ts +4 -4
- package/src/EnforcingEntityDeleter.ts +4 -4
- package/src/EnforcingEntityLoader.ts +8 -8
- package/src/EnforcingEntityUpdater.ts +4 -4
- package/src/Entity.ts +13 -13
- package/src/EntityAssociationLoader.ts +6 -6
- package/src/EntityCompanion.ts +13 -10
- package/src/EntityCompanionProvider.ts +15 -14
- package/src/EntityConfiguration.ts +6 -8
- package/src/EntityConstructionUtils.ts +16 -12
- package/src/EntityCreator.ts +7 -7
- package/src/EntityDatabaseAdapter.ts +6 -6
- package/src/EntityDeleter.ts +7 -7
- package/src/EntityFieldDefinition.ts +4 -4
- package/src/EntityFields.ts +3 -3
- package/src/EntityInvalidationUtils.ts +8 -25
- package/src/EntityLoader.ts +7 -7
- package/src/EntityLoaderFactory.ts +13 -12
- package/src/EntityMutationInfo.ts +2 -2
- package/src/EntityMutationTriggerConfiguration.ts +4 -4
- package/src/EntityMutationValidatorConfiguration.ts +4 -4
- package/src/EntityMutatorFactory.ts +13 -13
- package/src/EntityPrivacyPolicy.ts +9 -10
- package/src/EntityQueryContext.ts +1 -1
- package/src/EntityQueryContextProvider.ts +2 -2
- package/src/EntitySecondaryCacheLoader.ts +8 -8
- package/src/EntityUpdater.ts +7 -7
- package/src/GenericEntityCacheAdapter.ts +5 -5
- package/src/GenericSecondaryEntityCache.ts +4 -4
- package/src/IEntityCacheAdapter.ts +2 -2
- package/src/IEntityCacheAdapterProvider.ts +2 -2
- package/src/IEntityDatabaseAdapterProvider.ts +2 -2
- package/src/IEntityGenericCacher.ts +2 -2
- package/src/ReadonlyEntity.ts +12 -19
- package/src/ViewerContext.ts +8 -8
- package/src/ViewerScopedEntityCompanion.ts +8 -8
- package/src/ViewerScopedEntityCompanionProvider.ts +6 -6
- package/src/ViewerScopedEntityLoaderFactory.ts +11 -9
- package/src/ViewerScopedEntityMutatorFactory.ts +8 -8
- package/src/__tests__/AuthorizationResultBasedEntityAssociationLoader-test.ts +6 -6
- package/src/__tests__/AuthorizationResultBasedEntityLoader-constructor-test.ts +16 -15
- package/src/__tests__/AuthorizationResultBasedEntityLoader-test.ts +21 -21
- package/src/__tests__/ComposedCacheAdapter-test.ts +8 -7
- package/src/__tests__/ComposedSecondaryEntityCache-test.ts +3 -3
- package/src/__tests__/EnforcingEntityAssociationLoader-test.ts +2 -2
- package/src/__tests__/EnforcingEntityLoader-test.ts +4 -4
- package/src/__tests__/Entity-test.ts +8 -8
- package/src/__tests__/EntityAssociationLoader-test.ts +6 -6
- package/src/__tests__/EntityCommonUseCases-test.ts +17 -13
- package/src/__tests__/EntityCompanion-test.ts +11 -11
- package/src/__tests__/EntityCompanionProvider-test.ts +8 -7
- package/src/__tests__/EntityConfiguration-test.ts +3 -3
- package/src/__tests__/EntityDatabaseAdapter-test.ts +11 -7
- package/src/__tests__/EntityEdges-test.ts +17 -19
- package/src/__tests__/EntityFields-test.ts +3 -3
- package/src/__tests__/EntityLoader-test.ts +7 -7
- package/src/__tests__/EntityMutator-MutationCacheConsistency-test.ts +12 -11
- package/src/__tests__/EntityMutator-SingleCompositeFieldCacheConsistency-test.ts +4 -4
- package/src/__tests__/EntityMutator-test.ts +32 -36
- package/src/__tests__/EntityPrivacyPolicy-test.ts +19 -19
- package/src/__tests__/EntityQueryContext-test.ts +9 -9
- package/src/__tests__/EntitySecondaryCacheLoader-test.ts +8 -7
- package/src/__tests__/EntitySelfReferentialEdges-test.ts +12 -12
- package/src/__tests__/GenericEntityCacheAdapter-test.ts +6 -6
- package/src/__tests__/GenericSecondaryEntityCache-test.ts +16 -18
- package/src/__tests__/ReadonlyEntity-test.ts +10 -10
- package/src/__tests__/ViewerContext-test.ts +3 -3
- package/src/__tests__/ViewerScopedEntityCompanion-test.ts +7 -7
- package/src/__tests__/ViewerScopedEntityCompanionProvider-test.ts +5 -5
- package/src/__tests__/ViewerScopedEntityLoaderFactory-test.ts +5 -5
- package/src/__tests__/ViewerScopedEntityMutatorFactory-test.ts +6 -6
- package/src/__tests__/cases/TwoEntitySameTableDisjointRows-test.ts +9 -9
- package/src/__tests__/cases/TwoEntitySameTableOverlappingRows-test.ts +8 -8
- package/src/__tests__/entityUtils-test.ts +4 -4
- package/src/entityUtils.ts +1 -1
- package/src/errors/EntityCacheAdapterError.ts +1 -1
- package/src/errors/EntityDatabaseAdapterError.ts +1 -1
- package/src/errors/EntityInvalidFieldValueError.ts +5 -5
- package/src/errors/EntityNotAuthorizedError.ts +4 -4
- package/src/errors/EntityNotFoundError.ts +5 -5
- package/src/errors/__tests__/EntityDatabaseAdapterError-test.ts +2 -2
- package/src/errors/__tests__/EntityError-test.ts +7 -7
- package/src/index.ts +77 -77
- package/src/internal/CompositeFieldHolder.ts +6 -10
- package/src/internal/CompositeFieldValueMap.ts +3 -5
- package/src/internal/EntityDataManager.ts +11 -14
- package/src/internal/EntityFieldTransformationUtils.ts +2 -2
- package/src/internal/EntityLoadInterfaces.ts +3 -2
- package/src/internal/EntityTableDataCoordinator.ts +9 -9
- package/src/internal/ReadThroughEntityCache.ts +4 -4
- package/src/internal/SingleFieldHolder.ts +4 -8
- package/src/internal/__tests__/CompositeFieldHolder-test.ts +1 -1
- package/src/internal/__tests__/CompositeFieldValueMap-test.ts +3 -3
- package/src/internal/__tests__/EntityDataManager-test.ts +15 -18
- package/src/internal/__tests__/EntityFieldTransformationUtils-test.ts +3 -3
- package/src/internal/__tests__/ReadThroughEntityCache-test.ts +6 -6
- package/src/metrics/EntityMetricsUtils.ts +5 -5
- package/src/metrics/IEntityMetricsAdapter.ts +3 -3
- package/src/metrics/NoOpEntityMetricsAdapter.ts +2 -2
- package/src/metrics/__tests__/EntityMetricsUtils-test.ts +4 -7
- package/src/rules/AllowIfAllSubRulesAllowPrivacyPolicyRule.ts +5 -5
- package/src/rules/AllowIfAnySubRuleAllowsPrivacyPolicyRule.ts +5 -5
- package/src/rules/AllowIfInParentCascadeDeletionPrivacyPolicyRule.ts +9 -6
- package/src/rules/AlwaysAllowPrivacyPolicyRule.ts +5 -5
- package/src/rules/AlwaysDenyPrivacyPolicyRule.ts +5 -5
- package/src/rules/AlwaysSkipPrivacyPolicyRule.ts +5 -5
- package/src/rules/EvaluateIfEntityFieldPredicatePrivacyPolicyRule.ts +5 -5
- package/src/rules/PrivacyPolicyRule.ts +4 -4
- package/src/rules/__tests__/AllowIfAllSubRulesAllowPrivacyPolicyRule-test.ts +8 -8
- package/src/rules/__tests__/AllowIfAnySubRuleAllowsPrivacyPolicyRule-test.ts +8 -8
- package/src/rules/__tests__/AllowIfInParentCascadeDeletionPrivacyPolicyRule-test.ts +7 -7
- package/src/rules/__tests__/AlwaysAllowPrivacyPolicyRule-test.ts +5 -5
- package/src/rules/__tests__/AlwaysDenyPrivacyPolicyRule-test.ts +5 -5
- package/src/rules/__tests__/AlwaysSkipPrivacyPolicyRule-test.ts +5 -5
- package/src/rules/__tests__/EvaluateIfEntityFieldPredicatePrivacyPolicyRule-test.ts +9 -8
- package/src/utils/EntityCreationUtils.ts +7 -7
- package/src/utils/EntityPrivacyUtils.ts +13 -9
- package/src/utils/__testfixtures__/PrivacyPolicyRuleTestUtils.ts +6 -5
- package/src/utils/__testfixtures__/SimpleTestEntity.ts +7 -7
- package/src/utils/__testfixtures__/StubCacheAdapter.ts +6 -5
- package/src/utils/__testfixtures__/StubDatabaseAdapter.ts +6 -6
- package/src/utils/__testfixtures__/StubDatabaseAdapterProvider.ts +4 -4
- package/src/utils/__testfixtures__/StubQueryContextProvider.ts +2 -2
- package/src/utils/__testfixtures__/TSMockitoExtensions.ts +5 -5
- package/src/utils/__testfixtures__/TestEntity.ts +9 -8
- package/src/utils/__testfixtures__/TestEntity2.ts +7 -7
- package/src/utils/__testfixtures__/TestEntityWithMutationTriggers.ts +10 -10
- package/src/utils/__testfixtures__/TestViewerContext.ts +1 -1
- package/src/utils/__testfixtures__/createUnitTestEntityCompanionProvider.ts +6 -6
- package/src/utils/__testfixtures__/describeFieldTestCase.ts +1 -1
- package/src/utils/__tests__/EntityCreationUtils-test.ts +7 -7
- package/src/utils/__tests__/EntityPrivacyUtils-test.ts +20 -21
- package/src/utils/__tests__/canViewerDeleteAsync-edgeDeletionPermissionInferenceBehavior-test.ts +12 -12
- package/src/utils/__tests__/mergeEntityMutationTriggerConfigurations-test.ts +2 -2
- package/src/utils/collections/__tests__/SerializableKeyMap-test.ts +2 -1
- package/src/utils/collections/__tests__/maps-test.ts +5 -5
- package/src/utils/collections/__tests__/sets-test.ts +1 -1
- package/src/utils/mergeEntityMutationTriggerConfigurations.ts +3 -3
- package/build/src/AuthorizationResultBasedEntityAssociationLoader.js.map +0 -1
- package/build/src/AuthorizationResultBasedEntityLoader.js.map +0 -1
- package/build/src/AuthorizationResultBasedEntityMutator.js.map +0 -1
- package/build/src/ComposedEntityCacheAdapter.js.map +0 -1
- package/build/src/ComposedSecondaryEntityCache.js.map +0 -1
- package/build/src/EnforcingEntityAssociationLoader.js.map +0 -1
- package/build/src/EnforcingEntityCreator.js.map +0 -1
- package/build/src/EnforcingEntityDeleter.js.map +0 -1
- package/build/src/EnforcingEntityLoader.js.map +0 -1
- package/build/src/EnforcingEntityUpdater.js.map +0 -1
- package/build/src/Entity.js.map +0 -1
- package/build/src/EntityAssociationLoader.js.map +0 -1
- package/build/src/EntityCompanion.js.map +0 -1
- package/build/src/EntityCompanionProvider.js.map +0 -1
- package/build/src/EntityConfiguration.js.map +0 -1
- package/build/src/EntityConstructionUtils.js.map +0 -1
- package/build/src/EntityCreator.js.map +0 -1
- package/build/src/EntityDatabaseAdapter.js.map +0 -1
- package/build/src/EntityDeleter.js.map +0 -1
- package/build/src/EntityFieldDefinition.js.map +0 -1
- package/build/src/EntityFields.js.map +0 -1
- package/build/src/EntityInvalidationUtils.js.map +0 -1
- package/build/src/EntityLoader.js.map +0 -1
- package/build/src/EntityLoaderFactory.js.map +0 -1
- package/build/src/EntityMutationInfo.js.map +0 -1
- package/build/src/EntityMutationTriggerConfiguration.js.map +0 -1
- package/build/src/EntityMutationValidatorConfiguration.js.map +0 -1
- package/build/src/EntityMutatorFactory.js.map +0 -1
- package/build/src/EntityPrivacyPolicy.js.map +0 -1
- package/build/src/EntityQueryContext.js.map +0 -1
- package/build/src/EntityQueryContextProvider.js.map +0 -1
- package/build/src/EntitySecondaryCacheLoader.js.map +0 -1
- package/build/src/EntityUpdater.js.map +0 -1
- package/build/src/GenericEntityCacheAdapter.js.map +0 -1
- package/build/src/GenericSecondaryEntityCache.js.map +0 -1
- package/build/src/IEntityCacheAdapter.js.map +0 -1
- package/build/src/IEntityCacheAdapterProvider.js.map +0 -1
- package/build/src/IEntityDatabaseAdapterProvider.js.map +0 -1
- package/build/src/IEntityGenericCacher.js.map +0 -1
- package/build/src/ReadonlyEntity.js.map +0 -1
- package/build/src/ViewerContext.js.map +0 -1
- package/build/src/ViewerScopedEntityCompanion.js.map +0 -1
- package/build/src/ViewerScopedEntityCompanionProvider.js.map +0 -1
- package/build/src/ViewerScopedEntityLoaderFactory.js.map +0 -1
- package/build/src/ViewerScopedEntityMutatorFactory.js.map +0 -1
- package/build/src/entityUtils.js.map +0 -1
- package/build/src/errors/EntityCacheAdapterError.js.map +0 -1
- package/build/src/errors/EntityDatabaseAdapterError.js.map +0 -1
- package/build/src/errors/EntityError.js.map +0 -1
- package/build/src/errors/EntityInvalidFieldValueError.js.map +0 -1
- package/build/src/errors/EntityNotAuthorizedError.js.map +0 -1
- package/build/src/errors/EntityNotFoundError.js.map +0 -1
- package/build/src/index.js.map +0 -1
- package/build/src/internal/CompositeFieldHolder.js.map +0 -1
- package/build/src/internal/CompositeFieldValueMap.js.map +0 -1
- package/build/src/internal/EntityDataManager.js.map +0 -1
- package/build/src/internal/EntityFieldTransformationUtils.js.map +0 -1
- package/build/src/internal/EntityLoadInterfaces.js.map +0 -1
- package/build/src/internal/EntityTableDataCoordinator.js.map +0 -1
- package/build/src/internal/ReadThroughEntityCache.js.map +0 -1
- package/build/src/internal/SingleFieldHolder.js.map +0 -1
- package/build/src/metrics/EntityMetricsUtils.js.map +0 -1
- package/build/src/metrics/IEntityMetricsAdapter.js.map +0 -1
- package/build/src/metrics/NoOpEntityMetricsAdapter.js.map +0 -1
- package/build/src/rules/AllowIfAllSubRulesAllowPrivacyPolicyRule.js.map +0 -1
- package/build/src/rules/AllowIfAnySubRuleAllowsPrivacyPolicyRule.js.map +0 -1
- package/build/src/rules/AllowIfInParentCascadeDeletionPrivacyPolicyRule.js.map +0 -1
- package/build/src/rules/AlwaysAllowPrivacyPolicyRule.js.map +0 -1
- package/build/src/rules/AlwaysDenyPrivacyPolicyRule.js.map +0 -1
- package/build/src/rules/AlwaysSkipPrivacyPolicyRule.js.map +0 -1
- package/build/src/rules/EvaluateIfEntityFieldPredicatePrivacyPolicyRule.js.map +0 -1
- package/build/src/rules/PrivacyPolicyRule.js.map +0 -1
- package/build/src/utils/EntityCreationUtils.js.map +0 -1
- package/build/src/utils/EntityPrivacyUtils.js.map +0 -1
- package/build/src/utils/collections/SerializableKeyMap.js.map +0 -1
- package/build/src/utils/collections/maps.js.map +0 -1
- package/build/src/utils/collections/sets.js.map +0 -1
- package/build/src/utils/mergeEntityMutationTriggerConfigurations.js.map +0 -1
|
@@ -2,19 +2,19 @@ import {
|
|
|
2
2
|
AuthorizationResultBasedCreateMutator,
|
|
3
3
|
AuthorizationResultBasedDeleteMutator,
|
|
4
4
|
AuthorizationResultBasedUpdateMutator,
|
|
5
|
-
} from './AuthorizationResultBasedEntityMutator';
|
|
6
|
-
import { Entity, IEntityClass } from './Entity';
|
|
7
|
-
import { EntityCompanionProvider } from './EntityCompanionProvider';
|
|
8
|
-
import { EntityConfiguration } from './EntityConfiguration';
|
|
9
|
-
import { EntityDatabaseAdapter } from './EntityDatabaseAdapter';
|
|
10
|
-
import { EntityLoaderFactory } from './EntityLoaderFactory';
|
|
11
|
-
import { EntityCascadingDeletionInfo } from './EntityMutationInfo';
|
|
12
|
-
import { EntityMutationTriggerConfiguration } from './EntityMutationTriggerConfiguration';
|
|
13
|
-
import { EntityMutationValidatorConfiguration } from './EntityMutationValidatorConfiguration';
|
|
14
|
-
import { EntityPrivacyPolicy } from './EntityPrivacyPolicy';
|
|
15
|
-
import { EntityQueryContext } from './EntityQueryContext';
|
|
16
|
-
import { ViewerContext } from './ViewerContext';
|
|
17
|
-
import { IEntityMetricsAdapter } from './metrics/IEntityMetricsAdapter';
|
|
5
|
+
} from './AuthorizationResultBasedEntityMutator.ts';
|
|
6
|
+
import type { Entity, IEntityClass } from './Entity.ts';
|
|
7
|
+
import type { EntityCompanionProvider } from './EntityCompanionProvider.ts';
|
|
8
|
+
import type { EntityConfiguration } from './EntityConfiguration.ts';
|
|
9
|
+
import type { EntityDatabaseAdapter } from './EntityDatabaseAdapter.ts';
|
|
10
|
+
import type { EntityLoaderFactory } from './EntityLoaderFactory.ts';
|
|
11
|
+
import type { EntityCascadingDeletionInfo } from './EntityMutationInfo.ts';
|
|
12
|
+
import type { EntityMutationTriggerConfiguration } from './EntityMutationTriggerConfiguration.ts';
|
|
13
|
+
import type { EntityMutationValidatorConfiguration } from './EntityMutationValidatorConfiguration.ts';
|
|
14
|
+
import type { EntityPrivacyPolicy } from './EntityPrivacyPolicy.ts';
|
|
15
|
+
import type { EntityQueryContext } from './EntityQueryContext.ts';
|
|
16
|
+
import type { ViewerContext } from './ViewerContext.ts';
|
|
17
|
+
import type { IEntityMetricsAdapter } from './metrics/IEntityMetricsAdapter.ts';
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* The primary interface for creating, mutating, and deleting entities.
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { EntityCascadingDeletionInfo } from './EntityMutationInfo';
|
|
2
|
-
import { EntityQueryContext } from './EntityQueryContext';
|
|
3
|
-
import { ReadonlyEntity } from './ReadonlyEntity';
|
|
4
|
-
import { ViewerContext } from './ViewerContext';
|
|
5
|
-
import { EntityNotAuthorizedError } from './errors/EntityNotAuthorizedError';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} from './
|
|
10
|
-
import { PrivacyPolicyRule, RuleEvaluationResult } from './rules/PrivacyPolicyRule';
|
|
1
|
+
import type { EntityCascadingDeletionInfo } from './EntityMutationInfo.ts';
|
|
2
|
+
import type { EntityQueryContext } from './EntityQueryContext.ts';
|
|
3
|
+
import type { ReadonlyEntity } from './ReadonlyEntity.ts';
|
|
4
|
+
import type { ViewerContext } from './ViewerContext.ts';
|
|
5
|
+
import { EntityNotAuthorizedError } from './errors/EntityNotAuthorizedError.ts';
|
|
6
|
+
import type { IEntityMetricsAdapter } from './metrics/IEntityMetricsAdapter.ts';
|
|
7
|
+
import { EntityMetricsAuthorizationResult } from './metrics/IEntityMetricsAdapter.ts';
|
|
8
|
+
import type { PrivacyPolicyRule } from './rules/PrivacyPolicyRule.ts';
|
|
9
|
+
import { RuleEvaluationResult } from './rules/PrivacyPolicyRule.ts';
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* Information about the reason this privacy policy is being evaluated.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import assert from 'assert';
|
|
2
2
|
|
|
3
|
-
import { EntityQueryContextProvider } from './EntityQueryContextProvider';
|
|
3
|
+
import type { EntityQueryContextProvider } from './EntityQueryContextProvider.ts';
|
|
4
4
|
|
|
5
5
|
export type PostCommitCallback = (...args: any) => Promise<any>;
|
|
6
6
|
export type PreCommitCallback = (
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
2
|
|
|
3
|
+
import type { TransactionConfig } from './EntityQueryContext.ts';
|
|
3
4
|
import {
|
|
4
5
|
EntityNestedTransactionalQueryContext,
|
|
5
6
|
EntityNonTransactionalQueryContext,
|
|
6
7
|
EntityTransactionalQueryContext,
|
|
7
|
-
TransactionConfig,
|
|
8
8
|
TransactionalDataLoaderMode,
|
|
9
|
-
} from './EntityQueryContext';
|
|
9
|
+
} from './EntityQueryContext.ts';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* A query context provider vends transactional and non-transactional query contexts.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Result } from '@expo/results';
|
|
1
|
+
import type { Result } from '@expo/results';
|
|
2
2
|
|
|
3
|
-
import { IEntityClass } from './Entity';
|
|
4
|
-
import { EntityConstructionUtils } from './EntityConstructionUtils';
|
|
5
|
-
import { EntityPrivacyPolicy } from './EntityPrivacyPolicy';
|
|
6
|
-
import { EntityQueryContext } from './EntityQueryContext';
|
|
7
|
-
import { ReadonlyEntity } from './ReadonlyEntity';
|
|
8
|
-
import { ViewerContext } from './ViewerContext';
|
|
9
|
-
import { mapMap } from './utils/collections/maps';
|
|
3
|
+
import type { IEntityClass } from './Entity.ts';
|
|
4
|
+
import type { EntityConstructionUtils } from './EntityConstructionUtils.ts';
|
|
5
|
+
import type { EntityPrivacyPolicy } from './EntityPrivacyPolicy.ts';
|
|
6
|
+
import type { EntityQueryContext } from './EntityQueryContext.ts';
|
|
7
|
+
import type { ReadonlyEntity } from './ReadonlyEntity.ts';
|
|
8
|
+
import type { ViewerContext } from './ViewerContext.ts';
|
|
9
|
+
import { mapMap } from './utils/collections/maps.ts';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* An interface that knows how to load many objects from a cache by load params and invalidate
|
package/src/EntityUpdater.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { AuthorizationResultBasedUpdateMutator } from './AuthorizationResultBasedEntityMutator';
|
|
2
|
-
import { EnforcingEntityUpdater } from './EnforcingEntityUpdater';
|
|
3
|
-
import { IEntityClass } from './Entity';
|
|
4
|
-
import { EntityPrivacyPolicy } from './EntityPrivacyPolicy';
|
|
5
|
-
import { EntityQueryContext } from './EntityQueryContext';
|
|
6
|
-
import { ReadonlyEntity } from './ReadonlyEntity';
|
|
7
|
-
import { ViewerContext } from './ViewerContext';
|
|
1
|
+
import type { AuthorizationResultBasedUpdateMutator } from './AuthorizationResultBasedEntityMutator.ts';
|
|
2
|
+
import { EnforcingEntityUpdater } from './EnforcingEntityUpdater.ts';
|
|
3
|
+
import type { IEntityClass } from './Entity.ts';
|
|
4
|
+
import type { EntityPrivacyPolicy } from './EntityPrivacyPolicy.ts';
|
|
5
|
+
import type { EntityQueryContext } from './EntityQueryContext.ts';
|
|
6
|
+
import type { ReadonlyEntity } from './ReadonlyEntity.ts';
|
|
7
|
+
import type { ViewerContext } from './ViewerContext.ts';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* The primary interface for updating entities.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import invariant from 'invariant';
|
|
2
2
|
|
|
3
|
-
import { IEntityCacheAdapter } from './IEntityCacheAdapter';
|
|
4
|
-
import { IEntityGenericCacher } from './IEntityGenericCacher';
|
|
5
|
-
import { IEntityLoadKey, IEntityLoadValue } from './internal/EntityLoadInterfaces';
|
|
6
|
-
import { CacheLoadResult } from './internal/ReadThroughEntityCache';
|
|
7
|
-
import { mapKeys } from './utils/collections/maps';
|
|
3
|
+
import type { IEntityCacheAdapter } from './IEntityCacheAdapter.ts';
|
|
4
|
+
import type { IEntityGenericCacher } from './IEntityGenericCacher.ts';
|
|
5
|
+
import type { IEntityLoadKey, IEntityLoadValue } from './internal/EntityLoadInterfaces.ts';
|
|
6
|
+
import type { CacheLoadResult } from './internal/ReadThroughEntityCache.ts';
|
|
7
|
+
import { mapKeys } from './utils/collections/maps.ts';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* A standard IEntityCacheAdapter that coordinates caching through an IEntityGenericCacher.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import invariant from 'invariant';
|
|
2
2
|
|
|
3
|
-
import { ISecondaryEntityCache } from './EntitySecondaryCacheLoader';
|
|
4
|
-
import { IEntityGenericCacher } from './IEntityGenericCacher';
|
|
5
|
-
import { CacheStatus } from './internal/ReadThroughEntityCache';
|
|
6
|
-
import { filterMap, zipToMap } from './utils/collections/maps';
|
|
3
|
+
import type { ISecondaryEntityCache } from './EntitySecondaryCacheLoader.ts';
|
|
4
|
+
import type { IEntityGenericCacher } from './IEntityGenericCacher.ts';
|
|
5
|
+
import { CacheStatus } from './internal/ReadThroughEntityCache.ts';
|
|
6
|
+
import { filterMap, zipToMap } from './utils/collections/maps.ts';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* A custom secondary read-through entity cache is a way to add a custom second layer of caching for a particular
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* c8 ignore start - interface only */
|
|
2
2
|
|
|
3
|
-
import { IEntityLoadKey, IEntityLoadValue } from './internal/EntityLoadInterfaces';
|
|
4
|
-
import { CacheLoadResult } from './internal/ReadThroughEntityCache';
|
|
3
|
+
import type { IEntityLoadKey, IEntityLoadValue } from './internal/EntityLoadInterfaces.ts';
|
|
4
|
+
import type { CacheLoadResult } from './internal/ReadThroughEntityCache.ts';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* A cache adapter is an interface by which objects can be
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* c8 ignore start - interface only */
|
|
2
2
|
|
|
3
|
-
import { EntityConfiguration } from './EntityConfiguration';
|
|
4
|
-
import { IEntityCacheAdapter } from './IEntityCacheAdapter';
|
|
3
|
+
import type { EntityConfiguration } from './EntityConfiguration.ts';
|
|
4
|
+
import type { IEntityCacheAdapter } from './IEntityCacheAdapter.ts';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* A cache adapter provider vends cache adapters for a particular cache adapter type.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* c8 ignore start - interface only */
|
|
2
2
|
|
|
3
|
-
import { EntityConfiguration } from './EntityConfiguration';
|
|
4
|
-
import { EntityDatabaseAdapter } from './EntityDatabaseAdapter';
|
|
3
|
+
import type { EntityConfiguration } from './EntityConfiguration.ts';
|
|
4
|
+
import type { EntityDatabaseAdapter } from './EntityDatabaseAdapter.ts';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* A database adapter provider vends database adapters for a particular database adapter type.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* c8 ignore start - interface only */
|
|
2
2
|
|
|
3
|
-
import { IEntityLoadKey, IEntityLoadValue } from './internal/EntityLoadInterfaces';
|
|
4
|
-
import { CacheLoadResult } from './internal/ReadThroughEntityCache';
|
|
3
|
+
import type { IEntityLoadKey, IEntityLoadValue } from './internal/EntityLoadInterfaces.ts';
|
|
4
|
+
import type { CacheLoadResult } from './internal/ReadThroughEntityCache.ts';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* A generic cacher stores and loads key-value pairs. It also supports negative caching - it stores the absence
|
package/src/ReadonlyEntity.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import invariant from 'invariant';
|
|
2
2
|
|
|
3
|
-
import { AuthorizationResultBasedEntityAssociationLoader } from './AuthorizationResultBasedEntityAssociationLoader';
|
|
4
|
-
import { AuthorizationResultBasedEntityLoader } from './AuthorizationResultBasedEntityLoader';
|
|
5
|
-
import { EnforcingEntityAssociationLoader } from './EnforcingEntityAssociationLoader';
|
|
6
|
-
import { EnforcingEntityLoader } from './EnforcingEntityLoader';
|
|
7
|
-
import { IEntityClass } from './Entity';
|
|
8
|
-
import { EntityAssociationLoader } from './EntityAssociationLoader';
|
|
9
|
-
import { EntityInvalidationUtils } from './EntityInvalidationUtils';
|
|
10
|
-
import { EntityLoader } from './EntityLoader';
|
|
11
|
-
import { EntityPrivacyPolicy } from './EntityPrivacyPolicy';
|
|
12
|
-
import { EntityQueryContext } from './EntityQueryContext';
|
|
13
|
-
import { ViewerContext } from './ViewerContext';
|
|
3
|
+
import type { AuthorizationResultBasedEntityAssociationLoader } from './AuthorizationResultBasedEntityAssociationLoader.ts';
|
|
4
|
+
import type { AuthorizationResultBasedEntityLoader } from './AuthorizationResultBasedEntityLoader.ts';
|
|
5
|
+
import type { EnforcingEntityAssociationLoader } from './EnforcingEntityAssociationLoader.ts';
|
|
6
|
+
import type { EnforcingEntityLoader } from './EnforcingEntityLoader.ts';
|
|
7
|
+
import type { IEntityClass } from './Entity.ts';
|
|
8
|
+
import { EntityAssociationLoader } from './EntityAssociationLoader.ts';
|
|
9
|
+
import type { EntityInvalidationUtils } from './EntityInvalidationUtils.ts';
|
|
10
|
+
import { EntityLoader } from './EntityLoader.ts';
|
|
11
|
+
import type { EntityPrivacyPolicy } from './EntityPrivacyPolicy.ts';
|
|
12
|
+
import type { EntityQueryContext } from './EntityQueryContext.ts';
|
|
13
|
+
import type { ViewerContext } from './ViewerContext.ts';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* A readonly entity exposes only the read functionality of an Entity. Used as the base
|
|
@@ -257,14 +257,7 @@ export abstract class ReadonlyEntity<
|
|
|
257
257
|
TMSelectedFields
|
|
258
258
|
>,
|
|
259
259
|
viewerContext: TMViewerContext2,
|
|
260
|
-
): EntityInvalidationUtils<
|
|
261
|
-
TMFields,
|
|
262
|
-
TMIDField,
|
|
263
|
-
TMViewerContext,
|
|
264
|
-
TMEntity,
|
|
265
|
-
TMPrivacyPolicy,
|
|
266
|
-
TMSelectedFields
|
|
267
|
-
> {
|
|
260
|
+
): EntityInvalidationUtils<TMFields, TMIDField, TMViewerContext, TMEntity, TMSelectedFields> {
|
|
268
261
|
return viewerContext
|
|
269
262
|
.getViewerScopedEntityCompanionForClass(this)
|
|
270
263
|
.getLoaderFactory()
|
package/src/ViewerContext.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { IEntityClass } from './Entity';
|
|
2
|
-
import { DatabaseAdapterFlavor, EntityCompanionProvider } from './EntityCompanionProvider';
|
|
3
|
-
import { EntityPrivacyPolicy } from './EntityPrivacyPolicy';
|
|
4
|
-
import {
|
|
1
|
+
import type { IEntityClass } from './Entity.ts';
|
|
2
|
+
import type { DatabaseAdapterFlavor, EntityCompanionProvider } from './EntityCompanionProvider.ts';
|
|
3
|
+
import type { EntityPrivacyPolicy } from './EntityPrivacyPolicy.ts';
|
|
4
|
+
import type {
|
|
5
5
|
EntityQueryContext,
|
|
6
6
|
EntityTransactionalQueryContext,
|
|
7
7
|
TransactionConfig,
|
|
8
|
-
} from './EntityQueryContext';
|
|
9
|
-
import { ReadonlyEntity } from './ReadonlyEntity';
|
|
10
|
-
import { ViewerScopedEntityCompanion } from './ViewerScopedEntityCompanion';
|
|
11
|
-
import { ViewerScopedEntityCompanionProvider } from './ViewerScopedEntityCompanionProvider';
|
|
8
|
+
} from './EntityQueryContext.ts';
|
|
9
|
+
import type { ReadonlyEntity } from './ReadonlyEntity.ts';
|
|
10
|
+
import type { ViewerScopedEntityCompanion } from './ViewerScopedEntityCompanion.ts';
|
|
11
|
+
import { ViewerScopedEntityCompanionProvider } from './ViewerScopedEntityCompanionProvider.ts';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* A viewer context encapsulates all information necessary to evaluate an EntityPrivacyPolicy.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { EntityCompanion } from './EntityCompanion';
|
|
2
|
-
import { EntityPrivacyPolicy } from './EntityPrivacyPolicy';
|
|
3
|
-
import { EntityQueryContextProvider } from './EntityQueryContextProvider';
|
|
4
|
-
import { ReadonlyEntity } from './ReadonlyEntity';
|
|
5
|
-
import { ViewerContext } from './ViewerContext';
|
|
6
|
-
import { ViewerScopedEntityLoaderFactory } from './ViewerScopedEntityLoaderFactory';
|
|
7
|
-
import { ViewerScopedEntityMutatorFactory } from './ViewerScopedEntityMutatorFactory';
|
|
8
|
-
import { IEntityMetricsAdapter } from './metrics/IEntityMetricsAdapter';
|
|
1
|
+
import type { EntityCompanion } from './EntityCompanion.ts';
|
|
2
|
+
import type { EntityPrivacyPolicy } from './EntityPrivacyPolicy.ts';
|
|
3
|
+
import type { EntityQueryContextProvider } from './EntityQueryContextProvider.ts';
|
|
4
|
+
import type { ReadonlyEntity } from './ReadonlyEntity.ts';
|
|
5
|
+
import type { ViewerContext } from './ViewerContext.ts';
|
|
6
|
+
import { ViewerScopedEntityLoaderFactory } from './ViewerScopedEntityLoaderFactory.ts';
|
|
7
|
+
import { ViewerScopedEntityMutatorFactory } from './ViewerScopedEntityMutatorFactory.ts';
|
|
8
|
+
import type { IEntityMetricsAdapter } from './metrics/IEntityMetricsAdapter.ts';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Provides a simpler API for loading and mutating entities by injecting the ViewerContext
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { IEntityClass } from './Entity';
|
|
2
|
-
import { EntityCompanionProvider } from './EntityCompanionProvider';
|
|
3
|
-
import { EntityPrivacyPolicy } from './EntityPrivacyPolicy';
|
|
4
|
-
import { ReadonlyEntity } from './ReadonlyEntity';
|
|
5
|
-
import { ViewerContext } from './ViewerContext';
|
|
6
|
-
import { ViewerScopedEntityCompanion } from './ViewerScopedEntityCompanion';
|
|
1
|
+
import type { IEntityClass } from './Entity.ts';
|
|
2
|
+
import type { EntityCompanionProvider } from './EntityCompanionProvider.ts';
|
|
3
|
+
import type { EntityPrivacyPolicy } from './EntityPrivacyPolicy.ts';
|
|
4
|
+
import type { ReadonlyEntity } from './ReadonlyEntity.ts';
|
|
5
|
+
import type { ViewerContext } from './ViewerContext.ts';
|
|
6
|
+
import { ViewerScopedEntityCompanion } from './ViewerScopedEntityCompanion.ts';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Provides viewer-scoped entity companions providers for a simpler API.
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { AuthorizationResultBasedEntityLoader } from './AuthorizationResultBasedEntityLoader';
|
|
2
|
-
import { EntityConstructionUtils } from './EntityConstructionUtils';
|
|
3
|
-
import { EntityInvalidationUtils } from './EntityInvalidationUtils';
|
|
4
|
-
import { EntityLoaderFactory } from './EntityLoaderFactory';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import type { AuthorizationResultBasedEntityLoader } from './AuthorizationResultBasedEntityLoader.ts';
|
|
2
|
+
import type { EntityConstructionUtils } from './EntityConstructionUtils.ts';
|
|
3
|
+
import type { EntityInvalidationUtils } from './EntityInvalidationUtils.ts';
|
|
4
|
+
import type { EntityLoaderFactory } from './EntityLoaderFactory.ts';
|
|
5
|
+
import type {
|
|
6
|
+
EntityPrivacyPolicy,
|
|
7
|
+
EntityPrivacyPolicyEvaluationContext,
|
|
8
|
+
} from './EntityPrivacyPolicy.ts';
|
|
9
|
+
import type { EntityQueryContext } from './EntityQueryContext.ts';
|
|
10
|
+
import type { ReadonlyEntity } from './ReadonlyEntity.ts';
|
|
11
|
+
import type { ViewerContext } from './ViewerContext.ts';
|
|
9
12
|
|
|
10
13
|
/**
|
|
11
14
|
* Provides a cleaner API for loading entities by passing through the ViewerContext.
|
|
@@ -41,7 +44,6 @@ export class ViewerScopedEntityLoaderFactory<
|
|
|
41
44
|
TIDField,
|
|
42
45
|
TViewerContext,
|
|
43
46
|
TEntity,
|
|
44
|
-
TPrivacyPolicy,
|
|
45
47
|
TSelectedFields
|
|
46
48
|
> {
|
|
47
49
|
return this.entityLoaderFactory.invalidationUtils();
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
AuthorizationResultBasedCreateMutator,
|
|
3
3
|
AuthorizationResultBasedDeleteMutator,
|
|
4
4
|
AuthorizationResultBasedUpdateMutator,
|
|
5
|
-
} from './AuthorizationResultBasedEntityMutator';
|
|
6
|
-
import { EntityCascadingDeletionInfo } from './EntityMutationInfo';
|
|
7
|
-
import { EntityMutatorFactory } from './EntityMutatorFactory';
|
|
8
|
-
import { EntityPrivacyPolicy } from './EntityPrivacyPolicy';
|
|
9
|
-
import { EntityQueryContext } from './EntityQueryContext';
|
|
10
|
-
import { ReadonlyEntity } from './ReadonlyEntity';
|
|
11
|
-
import { ViewerContext } from './ViewerContext';
|
|
5
|
+
} from './AuthorizationResultBasedEntityMutator.ts';
|
|
6
|
+
import type { EntityCascadingDeletionInfo } from './EntityMutationInfo.ts';
|
|
7
|
+
import type { EntityMutatorFactory } from './EntityMutatorFactory.ts';
|
|
8
|
+
import type { EntityPrivacyPolicy } from './EntityPrivacyPolicy.ts';
|
|
9
|
+
import type { EntityQueryContext } from './EntityQueryContext.ts';
|
|
10
|
+
import type { ReadonlyEntity } from './ReadonlyEntity.ts';
|
|
11
|
+
import type { ViewerContext } from './ViewerContext.ts';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Provides a cleaner API for mutating entities by passing through the ViewerContext.
|
|
@@ -2,12 +2,12 @@ import { enforceAsyncResult } from '@expo/results';
|
|
|
2
2
|
import { describe, expect, it } from '@jest/globals';
|
|
3
3
|
import { v4 as uuidv4 } from 'uuid';
|
|
4
4
|
|
|
5
|
-
import { AuthorizationResultBasedEntityAssociationLoader } from '../AuthorizationResultBasedEntityAssociationLoader';
|
|
6
|
-
import { enforceResultsAsync } from '../entityUtils';
|
|
7
|
-
import { TestEntity } from '../utils/__testfixtures__/TestEntity';
|
|
8
|
-
import { TestEntity2 } from '../utils/__testfixtures__/TestEntity2';
|
|
9
|
-
import { TestViewerContext } from '../utils/__testfixtures__/TestViewerContext';
|
|
10
|
-
import { createUnitTestEntityCompanionProvider } from '../utils/__testfixtures__/createUnitTestEntityCompanionProvider';
|
|
5
|
+
import { AuthorizationResultBasedEntityAssociationLoader } from '../AuthorizationResultBasedEntityAssociationLoader.ts';
|
|
6
|
+
import { enforceResultsAsync } from '../entityUtils.ts';
|
|
7
|
+
import { TestEntity } from '../utils/__testfixtures__/TestEntity.ts';
|
|
8
|
+
import { TestEntity2 } from '../utils/__testfixtures__/TestEntity2.ts';
|
|
9
|
+
import { TestViewerContext } from '../utils/__testfixtures__/TestViewerContext.ts';
|
|
10
|
+
import { createUnitTestEntityCompanionProvider } from '../utils/__testfixtures__/createUnitTestEntityCompanionProvider.ts';
|
|
11
11
|
|
|
12
12
|
describe(AuthorizationResultBasedEntityAssociationLoader, () => {
|
|
13
13
|
describe('loadAssociatedEntityAsync', () => {
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { describe, expect, it } from '@jest/globals';
|
|
2
2
|
import { instance, mock } from 'ts-mockito';
|
|
3
3
|
|
|
4
|
-
import { AuthorizationResultBasedEntityLoader } from '../AuthorizationResultBasedEntityLoader';
|
|
5
|
-
import { Entity } from '../Entity';
|
|
6
|
-
import { EntityCompanionDefinition } from '../EntityCompanionProvider';
|
|
7
|
-
import { EntityConfiguration } from '../EntityConfiguration';
|
|
8
|
-
import { EntityConstructionUtils } from '../EntityConstructionUtils';
|
|
9
|
-
import { StringField } from '../EntityFields';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
4
|
+
import { AuthorizationResultBasedEntityLoader } from '../AuthorizationResultBasedEntityLoader.ts';
|
|
5
|
+
import { Entity } from '../Entity.ts';
|
|
6
|
+
import type { EntityCompanionDefinition } from '../EntityCompanionProvider.ts';
|
|
7
|
+
import { EntityConfiguration } from '../EntityConfiguration.ts';
|
|
8
|
+
import { EntityConstructionUtils } from '../EntityConstructionUtils.ts';
|
|
9
|
+
import { StringField } from '../EntityFields.ts';
|
|
10
|
+
import type { EntityPrivacyPolicyEvaluationContext } from '../EntityPrivacyPolicy.ts';
|
|
11
|
+
import { EntityPrivacyPolicy } from '../EntityPrivacyPolicy.ts';
|
|
12
|
+
import { ViewerContext } from '../ViewerContext.ts';
|
|
13
|
+
import { EntityDataManager } from '../internal/EntityDataManager.ts';
|
|
14
|
+
import { ReadThroughEntityCache } from '../internal/ReadThroughEntityCache.ts';
|
|
15
|
+
import type { IEntityMetricsAdapter } from '../metrics/IEntityMetricsAdapter.ts';
|
|
16
|
+
import { AlwaysAllowPrivacyPolicyRule } from '../rules/AlwaysAllowPrivacyPolicyRule.ts';
|
|
17
|
+
import { NoCacheStubCacheAdapterProvider } from '../utils/__testfixtures__/StubCacheAdapter.ts';
|
|
18
|
+
import { StubDatabaseAdapter } from '../utils/__testfixtures__/StubDatabaseAdapter.ts';
|
|
19
|
+
import { StubQueryContextProvider } from '../utils/__testfixtures__/StubQueryContextProvider.ts';
|
|
19
20
|
|
|
20
21
|
export type TestFields = {
|
|
21
22
|
id: string;
|
|
@@ -3,32 +3,35 @@ import { describe, expect, it } from '@jest/globals';
|
|
|
3
3
|
import { anyOfClass, anything, instance, mock, spy, verify, when } from 'ts-mockito';
|
|
4
4
|
import { v4 as uuidv4 } from 'uuid';
|
|
5
5
|
|
|
6
|
-
import { AuthorizationResultBasedEntityLoader } from '../AuthorizationResultBasedEntityLoader';
|
|
7
|
-
import { EntityConstructionUtils } from '../EntityConstructionUtils';
|
|
8
|
-
import { EntityInvalidationUtils } from '../EntityInvalidationUtils';
|
|
9
|
-
import { EntityPrivacyPolicyEvaluationContext } from '../EntityPrivacyPolicy';
|
|
10
|
-
import { ViewerContext } from '../ViewerContext';
|
|
11
|
-
import { enforceResultsAsync } from '../entityUtils';
|
|
12
|
-
import { EntityNotFoundError } from '../errors/EntityNotFoundError';
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
import { AuthorizationResultBasedEntityLoader } from '../AuthorizationResultBasedEntityLoader.ts';
|
|
7
|
+
import { EntityConstructionUtils } from '../EntityConstructionUtils.ts';
|
|
8
|
+
import { EntityInvalidationUtils } from '../EntityInvalidationUtils.ts';
|
|
9
|
+
import type { EntityPrivacyPolicyEvaluationContext } from '../EntityPrivacyPolicy.ts';
|
|
10
|
+
import { ViewerContext } from '../ViewerContext.ts';
|
|
11
|
+
import { enforceResultsAsync } from '../entityUtils.ts';
|
|
12
|
+
import { EntityNotFoundError } from '../errors/EntityNotFoundError.ts';
|
|
13
|
+
import {
|
|
14
|
+
CompositeFieldHolder,
|
|
15
|
+
CompositeFieldValueHolder,
|
|
16
|
+
} from '../internal/CompositeFieldHolder.ts';
|
|
17
|
+
import { EntityDataManager } from '../internal/EntityDataManager.ts';
|
|
18
|
+
import { ReadThroughEntityCache } from '../internal/ReadThroughEntityCache.ts';
|
|
16
19
|
import {
|
|
17
20
|
SingleFieldHolder,
|
|
18
21
|
SingleFieldValueHolder,
|
|
19
22
|
SingleFieldValueHolderMap,
|
|
20
|
-
} from '../internal/SingleFieldHolder';
|
|
21
|
-
import { IEntityMetricsAdapter } from '../metrics/IEntityMetricsAdapter';
|
|
22
|
-
import { NoCacheStubCacheAdapterProvider } from '../utils/__testfixtures__/StubCacheAdapter';
|
|
23
|
-
import { StubDatabaseAdapter } from '../utils/__testfixtures__/StubDatabaseAdapter';
|
|
24
|
-
import { StubQueryContextProvider } from '../utils/__testfixtures__/StubQueryContextProvider';
|
|
25
|
-
import { deepEqualEntityAware } from '../utils/__testfixtures__/TSMockitoExtensions';
|
|
23
|
+
} from '../internal/SingleFieldHolder.ts';
|
|
24
|
+
import type { IEntityMetricsAdapter } from '../metrics/IEntityMetricsAdapter.ts';
|
|
25
|
+
import { NoCacheStubCacheAdapterProvider } from '../utils/__testfixtures__/StubCacheAdapter.ts';
|
|
26
|
+
import { StubDatabaseAdapter } from '../utils/__testfixtures__/StubDatabaseAdapter.ts';
|
|
27
|
+
import { StubQueryContextProvider } from '../utils/__testfixtures__/StubQueryContextProvider.ts';
|
|
28
|
+
import { deepEqualEntityAware } from '../utils/__testfixtures__/TSMockitoExtensions.ts';
|
|
29
|
+
import type { TestFields } from '../utils/__testfixtures__/TestEntity.ts';
|
|
26
30
|
import {
|
|
27
31
|
TestEntity,
|
|
28
32
|
TestEntityPrivacyPolicy,
|
|
29
|
-
TestFields,
|
|
30
33
|
testEntityConfiguration,
|
|
31
|
-
} from '../utils/__testfixtures__/TestEntity';
|
|
34
|
+
} from '../utils/__testfixtures__/TestEntity.ts';
|
|
32
35
|
|
|
33
36
|
describe(AuthorizationResultBasedEntityLoader, () => {
|
|
34
37
|
it('loads entities', async () => {
|
|
@@ -406,7 +409,6 @@ describe(AuthorizationResultBasedEntityLoader, () => {
|
|
|
406
409
|
const id1 = uuidv4();
|
|
407
410
|
const invalidationUtils = new EntityInvalidationUtils(
|
|
408
411
|
testEntityConfiguration,
|
|
409
|
-
TestEntity,
|
|
410
412
|
dataManagerInstance,
|
|
411
413
|
metricsAdapter,
|
|
412
414
|
);
|
|
@@ -485,7 +487,6 @@ describe(AuthorizationResultBasedEntityLoader, () => {
|
|
|
485
487
|
|
|
486
488
|
const invalidationUtils = new EntityInvalidationUtils(
|
|
487
489
|
testEntityConfiguration,
|
|
488
|
-
TestEntity,
|
|
489
490
|
dataManagerInstance,
|
|
490
491
|
metricsAdapter,
|
|
491
492
|
);
|
|
@@ -557,7 +558,6 @@ describe(AuthorizationResultBasedEntityLoader, () => {
|
|
|
557
558
|
await new StubQueryContextProvider().runInTransactionAsync(async (queryContext) => {
|
|
558
559
|
const invalidationUtils = new EntityInvalidationUtils(
|
|
559
560
|
testEntityConfiguration,
|
|
560
|
-
TestEntity,
|
|
561
561
|
dataManagerInstance,
|
|
562
562
|
metricsAdapter,
|
|
563
563
|
);
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { describe, expect, it } from '@jest/globals';
|
|
2
2
|
|
|
3
|
-
import { ComposedEntityCacheAdapter } from '../ComposedEntityCacheAdapter';
|
|
4
|
-
import { EntityConfiguration } from '../EntityConfiguration';
|
|
5
|
-
import { UUIDField } from '../EntityFields';
|
|
6
|
-
import { IEntityCacheAdapter } from '../IEntityCacheAdapter';
|
|
7
|
-
import { IEntityLoadKey, IEntityLoadValue } from '../internal/EntityLoadInterfaces';
|
|
8
|
-
import { CacheLoadResult
|
|
9
|
-
import {
|
|
3
|
+
import { ComposedEntityCacheAdapter } from '../ComposedEntityCacheAdapter.ts';
|
|
4
|
+
import { EntityConfiguration } from '../EntityConfiguration.ts';
|
|
5
|
+
import { UUIDField } from '../EntityFields.ts';
|
|
6
|
+
import type { IEntityCacheAdapter } from '../IEntityCacheAdapter.ts';
|
|
7
|
+
import type { IEntityLoadKey, IEntityLoadValue } from '../internal/EntityLoadInterfaces.ts';
|
|
8
|
+
import type { CacheLoadResult } from '../internal/ReadThroughEntityCache.ts';
|
|
9
|
+
import { CacheStatus } from '../internal/ReadThroughEntityCache.ts';
|
|
10
|
+
import { SingleFieldHolder, SingleFieldValueHolder } from '../internal/SingleFieldHolder.ts';
|
|
10
11
|
|
|
11
12
|
type BlahFields = {
|
|
12
13
|
id: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import nullthrows from '@expo/nullthrows';
|
|
1
2
|
import { describe, expect, it } from '@jest/globals';
|
|
2
3
|
import invariant from 'invariant';
|
|
3
|
-
import nullthrows from 'nullthrows';
|
|
4
4
|
|
|
5
|
-
import { ComposedSecondaryEntityCache } from '../ComposedSecondaryEntityCache';
|
|
6
|
-
import { ISecondaryEntityCache } from '../EntitySecondaryCacheLoader';
|
|
5
|
+
import { ComposedSecondaryEntityCache } from '../ComposedSecondaryEntityCache.ts';
|
|
6
|
+
import type { ISecondaryEntityCache } from '../EntitySecondaryCacheLoader.ts';
|
|
7
7
|
|
|
8
8
|
type TestFields = { id: string };
|
|
9
9
|
type TestLoadParams = { lp: string };
|
|
@@ -2,8 +2,8 @@ import { result } from '@expo/results';
|
|
|
2
2
|
import { describe, expect, it } from '@jest/globals';
|
|
3
3
|
import { anything, instance, mock, when } from 'ts-mockito';
|
|
4
4
|
|
|
5
|
-
import { AuthorizationResultBasedEntityAssociationLoader } from '../AuthorizationResultBasedEntityAssociationLoader';
|
|
6
|
-
import { EnforcingEntityAssociationLoader } from '../EnforcingEntityAssociationLoader';
|
|
5
|
+
import { AuthorizationResultBasedEntityAssociationLoader } from '../AuthorizationResultBasedEntityAssociationLoader.ts';
|
|
6
|
+
import { EnforcingEntityAssociationLoader } from '../EnforcingEntityAssociationLoader.ts';
|
|
7
7
|
|
|
8
8
|
describe(EnforcingEntityAssociationLoader, () => {
|
|
9
9
|
describe('loadAssociatedEntityAsync', () => {
|
|
@@ -2,10 +2,10 @@ import { result } from '@expo/results';
|
|
|
2
2
|
import { describe, expect, it } from '@jest/globals';
|
|
3
3
|
import { anything, instance, mock, when } from 'ts-mockito';
|
|
4
4
|
|
|
5
|
-
import { AuthorizationResultBasedEntityLoader } from '../AuthorizationResultBasedEntityLoader';
|
|
6
|
-
import { EnforcingEntityLoader } from '../EnforcingEntityLoader';
|
|
7
|
-
import { CompositeFieldValueHolder } from '../internal/CompositeFieldHolder';
|
|
8
|
-
import { CompositeFieldValueMap } from '../internal/CompositeFieldValueMap';
|
|
5
|
+
import { AuthorizationResultBasedEntityLoader } from '../AuthorizationResultBasedEntityLoader.ts';
|
|
6
|
+
import { EnforcingEntityLoader } from '../EnforcingEntityLoader.ts';
|
|
7
|
+
import { CompositeFieldValueHolder } from '../internal/CompositeFieldHolder.ts';
|
|
8
|
+
import { CompositeFieldValueMap } from '../internal/CompositeFieldValueMap.ts';
|
|
9
9
|
|
|
10
10
|
describe(EnforcingEntityLoader, () => {
|
|
11
11
|
describe('loadManyByFieldEqualingManyAsync', () => {
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
AuthorizationResultBasedCreateMutator,
|
|
5
5
|
AuthorizationResultBasedDeleteMutator,
|
|
6
6
|
AuthorizationResultBasedUpdateMutator,
|
|
7
|
-
} from '../AuthorizationResultBasedEntityMutator';
|
|
8
|
-
import { EnforcingEntityCreator } from '../EnforcingEntityCreator';
|
|
9
|
-
import { EnforcingEntityDeleter } from '../EnforcingEntityDeleter';
|
|
10
|
-
import { EnforcingEntityUpdater } from '../EnforcingEntityUpdater';
|
|
11
|
-
import { Entity } from '../Entity';
|
|
12
|
-
import { ViewerContext } from '../ViewerContext';
|
|
13
|
-
import { SimpleTestEntity } from '../utils/__testfixtures__/SimpleTestEntity';
|
|
14
|
-
import { createUnitTestEntityCompanionProvider } from '../utils/__testfixtures__/createUnitTestEntityCompanionProvider';
|
|
7
|
+
} from '../AuthorizationResultBasedEntityMutator.ts';
|
|
8
|
+
import { EnforcingEntityCreator } from '../EnforcingEntityCreator.ts';
|
|
9
|
+
import { EnforcingEntityDeleter } from '../EnforcingEntityDeleter.ts';
|
|
10
|
+
import { EnforcingEntityUpdater } from '../EnforcingEntityUpdater.ts';
|
|
11
|
+
import { Entity } from '../Entity.ts';
|
|
12
|
+
import { ViewerContext } from '../ViewerContext.ts';
|
|
13
|
+
import { SimpleTestEntity } from '../utils/__testfixtures__/SimpleTestEntity.ts';
|
|
14
|
+
import { createUnitTestEntityCompanionProvider } from '../utils/__testfixtures__/createUnitTestEntityCompanionProvider.ts';
|
|
15
15
|
|
|
16
16
|
describe(Entity, () => {
|
|
17
17
|
describe('creator', () => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { describe, expect, it } from '@jest/globals';
|
|
2
2
|
|
|
3
|
-
import { AuthorizationResultBasedEntityAssociationLoader } from '../AuthorizationResultBasedEntityAssociationLoader';
|
|
4
|
-
import { EnforcingEntityAssociationLoader } from '../EnforcingEntityAssociationLoader';
|
|
5
|
-
import { EntityAssociationLoader } from '../EntityAssociationLoader';
|
|
6
|
-
import { ViewerContext } from '../ViewerContext';
|
|
7
|
-
import { SimpleTestEntity } from '../utils/__testfixtures__/SimpleTestEntity';
|
|
8
|
-
import { createUnitTestEntityCompanionProvider } from '../utils/__testfixtures__/createUnitTestEntityCompanionProvider';
|
|
3
|
+
import { AuthorizationResultBasedEntityAssociationLoader } from '../AuthorizationResultBasedEntityAssociationLoader.ts';
|
|
4
|
+
import { EnforcingEntityAssociationLoader } from '../EnforcingEntityAssociationLoader.ts';
|
|
5
|
+
import { EntityAssociationLoader } from '../EntityAssociationLoader.ts';
|
|
6
|
+
import { ViewerContext } from '../ViewerContext.ts';
|
|
7
|
+
import { SimpleTestEntity } from '../utils/__testfixtures__/SimpleTestEntity.ts';
|
|
8
|
+
import { createUnitTestEntityCompanionProvider } from '../utils/__testfixtures__/createUnitTestEntityCompanionProvider.ts';
|
|
9
9
|
|
|
10
10
|
describe(EntityAssociationLoader, () => {
|
|
11
11
|
describe('enforcing', () => {
|