@expo/entity 0.45.0 → 0.46.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 → src/AuthorizationResultBasedEntityAssociationLoader.d.ts} +4 -4
- package/build/{AuthorizationResultBasedEntityAssociationLoader.js → src/AuthorizationResultBasedEntityAssociationLoader.js} +2 -1
- package/build/src/AuthorizationResultBasedEntityAssociationLoader.js.map +1 -0
- package/build/{AuthorizationResultBasedEntityLoader.d.ts → src/AuthorizationResultBasedEntityLoader.d.ts} +8 -8
- package/build/{AuthorizationResultBasedEntityLoader.js → src/AuthorizationResultBasedEntityLoader.js} +6 -5
- package/build/src/AuthorizationResultBasedEntityLoader.js.map +1 -0
- package/build/{AuthorizationResultBasedEntityMutator.d.ts → src/AuthorizationResultBasedEntityMutator.d.ts} +11 -11
- package/build/{AuthorizationResultBasedEntityMutator.js → src/AuthorizationResultBasedEntityMutator.js} +2 -2
- package/build/src/AuthorizationResultBasedEntityMutator.js.map +1 -0
- package/build/{ComposedEntityCacheAdapter.d.ts → src/ComposedEntityCacheAdapter.d.ts} +2 -2
- package/build/{ComposedEntityCacheAdapter.js → src/ComposedEntityCacheAdapter.js} +2 -1
- package/build/src/ComposedEntityCacheAdapter.js.map +1 -0
- package/build/{ComposedSecondaryEntityCache.d.ts → src/ComposedSecondaryEntityCache.d.ts} +1 -1
- package/build/{ComposedSecondaryEntityCache.js → src/ComposedSecondaryEntityCache.js} +2 -1
- package/build/src/ComposedSecondaryEntityCache.js.map +1 -0
- package/build/{EnforcingEntityAssociationLoader.d.ts → src/EnforcingEntityAssociationLoader.d.ts} +5 -5
- package/build/{EnforcingEntityAssociationLoader.js → src/EnforcingEntityAssociationLoader.js} +2 -1
- package/build/src/EnforcingEntityAssociationLoader.js.map +1 -0
- package/build/{EnforcingEntityCreator.d.ts → src/EnforcingEntityCreator.d.ts} +4 -4
- package/build/{EnforcingEntityCreator.js → src/EnforcingEntityCreator.js} +2 -1
- package/build/src/EnforcingEntityCreator.js.map +1 -0
- package/build/{EnforcingEntityDeleter.d.ts → src/EnforcingEntityDeleter.d.ts} +4 -4
- package/build/{EnforcingEntityDeleter.js → src/EnforcingEntityDeleter.js} +2 -1
- package/build/src/EnforcingEntityDeleter.js.map +1 -0
- package/build/{EnforcingEntityLoader.d.ts → src/EnforcingEntityLoader.d.ts} +5 -5
- package/build/{EnforcingEntityLoader.js → src/EnforcingEntityLoader.js} +2 -1
- package/build/src/EnforcingEntityLoader.js.map +1 -0
- package/build/{EnforcingEntityUpdater.d.ts → src/EnforcingEntityUpdater.d.ts} +4 -4
- package/build/{EnforcingEntityUpdater.js → src/EnforcingEntityUpdater.js} +2 -1
- package/build/src/EnforcingEntityUpdater.js.map +1 -0
- package/build/{Entity.d.ts → src/Entity.d.ts} +7 -7
- package/build/{Entity.js → src/Entity.js} +13 -15
- package/build/src/Entity.js.map +1 -0
- package/build/{EntityAssociationLoader.d.ts → src/EntityAssociationLoader.d.ts} +5 -5
- package/build/{EntityAssociationLoader.js → src/EntityAssociationLoader.js} +6 -8
- package/build/src/EntityAssociationLoader.js.map +1 -0
- package/build/{EntityCompanion.d.ts → src/EntityCompanion.d.ts} +10 -10
- package/build/{EntityCompanion.js → src/EntityCompanion.js} +6 -8
- package/build/src/EntityCompanion.js.map +1 -0
- package/build/{EntityCompanionProvider.d.ts → src/EntityCompanionProvider.d.ts} +12 -12
- package/build/{EntityCompanionProvider.js → src/EntityCompanionProvider.js} +6 -5
- package/build/src/EntityCompanionProvider.js.map +1 -0
- package/build/{EntityConfiguration.d.ts → src/EntityConfiguration.d.ts} +2 -2
- package/build/{EntityConfiguration.js → src/EntityConfiguration.js} +2 -2
- package/build/src/EntityConfiguration.js.map +1 -0
- package/build/{EntityCreator.d.ts → src/EntityCreator.d.ts} +5 -5
- package/build/{EntityCreator.js → src/EntityCreator.js} +4 -6
- package/build/{EntityCreator.js.map → src/EntityCreator.js.map} +1 -1
- package/build/{EntityDatabaseAdapter.d.ts → src/EntityDatabaseAdapter.d.ts} +2 -2
- package/build/{EntityDatabaseAdapter.js → src/EntityDatabaseAdapter.js} +2 -2
- package/build/src/EntityDatabaseAdapter.js.map +1 -0
- package/build/{EntityDeleter.d.ts → src/EntityDeleter.d.ts} +5 -5
- package/build/{EntityDeleter.js → src/EntityDeleter.js} +4 -6
- package/build/{EntityDeleter.js.map → src/EntityDeleter.js.map} +1 -1
- package/build/{EntityFieldDefinition.d.ts → src/EntityFieldDefinition.d.ts} +3 -3
- package/build/src/EntityFieldDefinition.js.map +1 -0
- package/build/src/EntityFields.js.map +1 -0
- package/build/{EntityLoader.d.ts → src/EntityLoader.d.ts} +7 -7
- package/build/{EntityLoader.js → src/EntityLoader.js} +4 -6
- package/build/{EntityLoader.js.map → src/EntityLoader.js.map} +1 -1
- package/build/{EntityLoaderFactory.d.ts → src/EntityLoaderFactory.d.ts} +8 -8
- package/build/src/EntityLoaderFactory.js +29 -0
- package/build/src/EntityLoaderFactory.js.map +1 -0
- package/build/{EntityLoaderUtils.d.ts → src/EntityLoaderUtils.d.ts} +7 -7
- package/build/{EntityLoaderUtils.js → src/EntityLoaderUtils.js} +2 -1
- package/build/src/EntityLoaderUtils.js.map +1 -0
- package/build/{EntityMutationInfo.d.ts → src/EntityMutationInfo.d.ts} +2 -2
- package/build/src/EntityMutationInfo.js.map +1 -0
- package/build/{EntityMutationTriggerConfiguration.d.ts → src/EntityMutationTriggerConfiguration.d.ts} +3 -3
- package/build/src/EntityMutationTriggerConfiguration.js.map +1 -0
- package/build/{EntityMutationValidator.d.ts → src/EntityMutationValidator.d.ts} +3 -3
- package/build/{EntityMutationValidator.js → src/EntityMutationValidator.js} +2 -1
- package/build/src/EntityMutationValidator.js.map +1 -0
- package/build/{EntityMutatorFactory.d.ts → src/EntityMutatorFactory.d.ts} +12 -12
- package/build/{EntityMutatorFactory.js → src/EntityMutatorFactory.js} +2 -1
- package/build/src/EntityMutatorFactory.js.map +1 -0
- package/build/{EntityPrivacyPolicy.d.ts → src/EntityPrivacyPolicy.d.ts} +6 -6
- package/build/{EntityPrivacyPolicy.js → src/EntityPrivacyPolicy.js} +8 -11
- package/build/{EntityPrivacyPolicy.js.map → src/EntityPrivacyPolicy.js.map} +1 -1
- package/build/{EntityQueryContext.d.ts → src/EntityQueryContext.d.ts} +1 -1
- package/build/src/EntityQueryContext.js.map +1 -0
- package/build/{EntityQueryContextProvider.d.ts → src/EntityQueryContextProvider.d.ts} +2 -2
- package/build/{EntityQueryContextProvider.js → src/EntityQueryContextProvider.js} +2 -1
- package/build/src/EntityQueryContextProvider.js.map +1 -0
- package/build/{EntitySecondaryCacheLoader.d.ts → src/EntitySecondaryCacheLoader.d.ts} +5 -5
- package/build/{EntitySecondaryCacheLoader.js → src/EntitySecondaryCacheLoader.js} +2 -1
- package/build/src/EntitySecondaryCacheLoader.js.map +1 -0
- package/build/{EntityUpdater.d.ts → src/EntityUpdater.d.ts} +5 -5
- package/build/{EntityUpdater.js → src/EntityUpdater.js} +4 -6
- package/build/{EntityUpdater.js.map → src/EntityUpdater.js.map} +1 -1
- package/build/{GenericEntityCacheAdapter.d.ts → src/GenericEntityCacheAdapter.d.ts} +3 -3
- package/build/{GenericEntityCacheAdapter.js → src/GenericEntityCacheAdapter.js} +2 -1
- package/build/src/GenericEntityCacheAdapter.js.map +1 -0
- package/build/{GenericSecondaryEntityCache.d.ts → src/GenericSecondaryEntityCache.d.ts} +2 -2
- package/build/{GenericSecondaryEntityCache.js → src/GenericSecondaryEntityCache.js} +2 -1
- package/build/src/GenericSecondaryEntityCache.js.map +1 -0
- package/build/{IEntityCacheAdapter.d.ts → src/IEntityCacheAdapter.d.ts} +1 -1
- package/build/src/IEntityCacheAdapter.js.map +1 -0
- package/build/{IEntityCacheAdapterProvider.d.ts → src/IEntityCacheAdapterProvider.d.ts} +3 -3
- package/build/src/IEntityCacheAdapterProvider.js.map +1 -0
- package/build/{IEntityDatabaseAdapterProvider.d.ts → src/IEntityDatabaseAdapterProvider.d.ts} +3 -3
- package/build/src/IEntityDatabaseAdapterProvider.js.map +1 -0
- package/build/{IEntityGenericCacher.d.ts → src/IEntityGenericCacher.d.ts} +1 -1
- package/build/src/IEntityGenericCacher.js.map +1 -0
- package/build/{ReadonlyEntity.d.ts → src/ReadonlyEntity.d.ts} +8 -8
- package/build/{ReadonlyEntity.js → src/ReadonlyEntity.js} +9 -8
- package/build/src/ReadonlyEntity.js.map +1 -0
- package/build/{ViewerContext.d.ts → src/ViewerContext.d.ts} +5 -5
- package/build/{ViewerContext.js → src/ViewerContext.js} +4 -6
- package/build/{ViewerContext.js.map → src/ViewerContext.js.map} +1 -1
- package/build/{ViewerScopedEntityCompanion.d.ts → src/ViewerScopedEntityCompanion.d.ts} +9 -9
- package/build/{ViewerScopedEntityCompanion.js → src/ViewerScopedEntityCompanion.js} +6 -8
- package/build/{ViewerScopedEntityCompanion.js.map → src/ViewerScopedEntityCompanion.js.map} +1 -1
- package/build/{ViewerScopedEntityCompanionProvider.d.ts → src/ViewerScopedEntityCompanionProvider.d.ts} +6 -6
- package/build/{ViewerScopedEntityCompanionProvider.js → src/ViewerScopedEntityCompanionProvider.js} +4 -6
- package/build/src/ViewerScopedEntityCompanionProvider.js.map +1 -0
- package/build/{ViewerScopedEntityLoaderFactory.d.ts → src/ViewerScopedEntityLoaderFactory.d.ts} +6 -6
- package/build/{ViewerScopedEntityLoaderFactory.js → src/ViewerScopedEntityLoaderFactory.js} +2 -1
- package/build/src/ViewerScopedEntityLoaderFactory.js.map +1 -0
- package/build/{ViewerScopedEntityMutatorFactory.d.ts → src/ViewerScopedEntityMutatorFactory.d.ts} +6 -6
- package/build/{ViewerScopedEntityMutatorFactory.js → src/ViewerScopedEntityMutatorFactory.js} +2 -1
- package/build/src/ViewerScopedEntityMutatorFactory.js.map +1 -0
- package/build/src/__tests__/AuthorizationResultBasedEntityAssociationLoader-test.d.ts +1 -0
- package/build/src/__tests__/AuthorizationResultBasedEntityAssociationLoader-test.js +240 -0
- package/build/src/__tests__/AuthorizationResultBasedEntityAssociationLoader-test.js.map +1 -0
- package/build/src/__tests__/AuthorizationResultBasedEntityLoader-constructor-test.d.ts +26 -0
- package/build/src/__tests__/AuthorizationResultBasedEntityLoader-constructor-test.js +109 -0
- package/build/src/__tests__/AuthorizationResultBasedEntityLoader-constructor-test.js.map +1 -0
- package/build/src/__tests__/AuthorizationResultBasedEntityLoader-test.d.ts +1 -0
- package/build/src/__tests__/AuthorizationResultBasedEntityLoader-test.js +590 -0
- package/build/src/__tests__/AuthorizationResultBasedEntityLoader-test.js.map +1 -0
- package/build/src/__tests__/ComposedCacheAdapter-test.d.ts +1 -0
- package/build/src/__tests__/ComposedCacheAdapter-test.js +259 -0
- package/build/src/__tests__/ComposedCacheAdapter-test.js.map +1 -0
- package/build/src/__tests__/ComposedSecondaryEntityCache-test.d.ts +1 -0
- package/build/src/__tests__/ComposedSecondaryEntityCache-test.js +67 -0
- package/build/src/__tests__/ComposedSecondaryEntityCache-test.js.map +1 -0
- package/build/src/__tests__/EnforcingEntityAssociationLoader-test.d.ts +1 -0
- package/build/src/__tests__/EnforcingEntityAssociationLoader-test.js +113 -0
- package/build/src/__tests__/EnforcingEntityAssociationLoader-test.js.map +1 -0
- package/build/src/__tests__/EnforcingEntityLoader-test.d.ts +1 -0
- package/build/src/__tests__/EnforcingEntityLoader-test.js +316 -0
- package/build/src/__tests__/EnforcingEntityLoader-test.js.map +1 -0
- package/build/src/__tests__/Entity-test.d.ts +1 -0
- package/build/src/__tests__/Entity-test.js +92 -0
- package/build/src/__tests__/Entity-test.js.map +1 -0
- package/build/src/__tests__/EntityAssociationLoader-test.d.ts +1 -0
- package/build/src/__tests__/EntityAssociationLoader-test.js +28 -0
- package/build/src/__tests__/EntityAssociationLoader-test.js.map +1 -0
- package/build/src/__tests__/EntityCommonUseCases-test.d.ts +1 -0
- package/build/src/__tests__/EntityCommonUseCases-test.js +111 -0
- package/build/src/__tests__/EntityCommonUseCases-test.js.map +1 -0
- package/build/src/__tests__/EntityCompanion-test.d.ts +1 -0
- package/build/src/__tests__/EntityCompanion-test.js +42 -0
- package/build/src/__tests__/EntityCompanion-test.js.map +1 -0
- package/build/src/__tests__/EntityCompanionProvider-test.d.ts +1 -0
- package/build/src/__tests__/EntityCompanionProvider-test.js +53 -0
- package/build/src/__tests__/EntityCompanionProvider-test.js.map +1 -0
- package/build/src/__tests__/EntityConfiguration-test.d.ts +1 -0
- package/build/src/__tests__/EntityConfiguration-test.js +164 -0
- package/build/src/__tests__/EntityConfiguration-test.js.map +1 -0
- package/build/src/__tests__/EntityDatabaseAdapter-test.d.ts +1 -0
- package/build/src/__tests__/EntityDatabaseAdapter-test.js +189 -0
- package/build/src/__tests__/EntityDatabaseAdapter-test.js.map +1 -0
- package/build/src/__tests__/EntityEdges-test.d.ts +1 -0
- package/build/src/__tests__/EntityEdges-test.js +680 -0
- package/build/src/__tests__/EntityEdges-test.js.map +1 -0
- package/build/src/__tests__/EntityFields-test.d.ts +1 -0
- package/build/src/__tests__/EntityFields-test.js +61 -0
- package/build/src/__tests__/EntityFields-test.js.map +1 -0
- package/build/src/__tests__/EntityLoader-test.d.ts +1 -0
- package/build/src/__tests__/EntityLoader-test.js +34 -0
- package/build/src/__tests__/EntityLoader-test.js.map +1 -0
- package/build/src/__tests__/EntityMutator-MutationCacheConsistency-test.d.ts +1 -0
- package/build/src/__tests__/EntityMutator-MutationCacheConsistency-test.js +71 -0
- package/build/src/__tests__/EntityMutator-MutationCacheConsistency-test.js.map +1 -0
- package/build/src/__tests__/EntityMutator-SingleCompositeFieldCacheConsistency-test.d.ts +1 -0
- package/build/src/__tests__/EntityMutator-SingleCompositeFieldCacheConsistency-test.js +54 -0
- package/build/src/__tests__/EntityMutator-SingleCompositeFieldCacheConsistency-test.js.map +1 -0
- package/build/src/__tests__/EntityMutator-test.d.ts +1 -0
- package/build/src/__tests__/EntityMutator-test.js +721 -0
- package/build/src/__tests__/EntityMutator-test.js.map +1 -0
- package/build/src/__tests__/EntityPrivacyPolicy-test.d.ts +1 -0
- package/build/src/__tests__/EntityPrivacyPolicy-test.js +429 -0
- package/build/src/__tests__/EntityPrivacyPolicy-test.js.map +1 -0
- package/build/src/__tests__/EntityQueryContext-test.d.ts +1 -0
- package/build/src/__tests__/EntityQueryContext-test.js +181 -0
- package/build/src/__tests__/EntityQueryContext-test.js.map +1 -0
- package/build/src/__tests__/EntitySecondaryCacheLoader-test.d.ts +1 -0
- package/build/src/__tests__/EntitySecondaryCacheLoader-test.js +58 -0
- package/build/src/__tests__/EntitySecondaryCacheLoader-test.js.map +1 -0
- package/build/src/__tests__/EntitySelfReferentialEdges-test.d.ts +1 -0
- package/build/src/__tests__/EntitySelfReferentialEdges-test.js +196 -0
- package/build/src/__tests__/EntitySelfReferentialEdges-test.js.map +1 -0
- package/build/src/__tests__/GenericEntityCacheAdapter-test.d.ts +1 -0
- package/build/src/__tests__/GenericEntityCacheAdapter-test.js +95 -0
- package/build/src/__tests__/GenericEntityCacheAdapter-test.js.map +1 -0
- package/build/src/__tests__/ReadonlyEntity-test.d.ts +1 -0
- package/build/src/__tests__/ReadonlyEntity-test.js +209 -0
- package/build/src/__tests__/ReadonlyEntity-test.js.map +1 -0
- package/build/src/__tests__/ViewerContext-test.d.ts +1 -0
- package/build/src/__tests__/ViewerContext-test.js +28 -0
- package/build/src/__tests__/ViewerContext-test.js.map +1 -0
- package/build/src/__tests__/ViewerScopedEntityCompanion-test.d.ts +1 -0
- package/build/src/__tests__/ViewerScopedEntityCompanion-test.js +18 -0
- package/build/src/__tests__/ViewerScopedEntityCompanion-test.js.map +1 -0
- package/build/src/__tests__/ViewerScopedEntityCompanionProvider-test.d.ts +1 -0
- package/build/src/__tests__/ViewerScopedEntityCompanionProvider-test.js +18 -0
- package/build/src/__tests__/ViewerScopedEntityCompanionProvider-test.js.map +1 -0
- package/build/src/__tests__/ViewerScopedEntityLoaderFactory-test.d.ts +1 -0
- package/build/src/__tests__/ViewerScopedEntityLoaderFactory-test.js +21 -0
- package/build/src/__tests__/ViewerScopedEntityLoaderFactory-test.js.map +1 -0
- package/build/src/__tests__/ViewerScopedEntityMutatorFactory-test.d.ts +1 -0
- package/build/src/__tests__/ViewerScopedEntityMutatorFactory-test.js +20 -0
- package/build/src/__tests__/ViewerScopedEntityMutatorFactory-test.js.map +1 -0
- package/build/src/__tests__/cases/TwoEntitySameTableDisjointRows-test.d.ts +1 -0
- package/build/src/__tests__/cases/TwoEntitySameTableDisjointRows-test.js +121 -0
- package/build/src/__tests__/cases/TwoEntitySameTableDisjointRows-test.js.map +1 -0
- package/build/src/__tests__/cases/TwoEntitySameTableOverlappingRows-test.d.ts +1 -0
- package/build/src/__tests__/cases/TwoEntitySameTableOverlappingRows-test.js +119 -0
- package/build/src/__tests__/cases/TwoEntitySameTableOverlappingRows-test.js.map +1 -0
- package/build/src/__tests__/entityUtils-test.d.ts +1 -0
- package/build/src/__tests__/entityUtils-test.js +88 -0
- package/build/src/__tests__/entityUtils-test.js.map +1 -0
- package/build/src/entityUtils.js.map +1 -0
- package/build/{errors → src/errors}/EntityCacheAdapterError.d.ts +2 -2
- package/build/src/errors/EntityCacheAdapterError.js +13 -0
- package/build/src/errors/EntityCacheAdapterError.js.map +1 -0
- package/build/{errors → src/errors}/EntityDatabaseAdapterError.d.ts +2 -2
- package/build/{errors → src/errors}/EntityDatabaseAdapterError.js +4 -37
- package/build/src/errors/EntityDatabaseAdapterError.js.map +1 -0
- package/build/{errors → src/errors}/EntityError.d.ts +1 -1
- package/build/{errors → src/errors}/EntityError.js +2 -2
- package/build/src/errors/EntityError.js.map +1 -0
- package/build/{errors → src/errors}/EntityInvalidFieldValueError.d.ts +5 -5
- package/build/src/errors/EntityInvalidFieldValueError.js +13 -0
- package/build/src/errors/EntityInvalidFieldValueError.js.map +1 -0
- package/build/{errors → src/errors}/EntityNotAuthorizedError.d.ts +4 -4
- package/build/src/errors/EntityNotAuthorizedError.js +16 -0
- package/build/src/errors/EntityNotAuthorizedError.js.map +1 -0
- package/build/{errors → src/errors}/EntityNotFoundError.d.ts +5 -5
- package/build/src/errors/EntityNotFoundError.js +18 -0
- package/build/src/errors/EntityNotFoundError.js.map +1 -0
- package/build/src/errors/__tests__/EntityDatabaseAdapterError-test.d.ts +1 -0
- package/build/src/errors/__tests__/EntityDatabaseAdapterError-test.js +21 -0
- package/build/src/errors/__tests__/EntityDatabaseAdapterError-test.js.map +1 -0
- package/build/src/index.d.ts +76 -0
- package/build/src/index.js +94 -0
- package/build/src/index.js.map +1 -0
- package/build/{internal → src/internal}/CompositeFieldHolder.d.ts +1 -1
- package/build/src/internal/CompositeFieldHolder.js.map +1 -0
- package/build/src/internal/CompositeFieldValueMap.js.map +1 -0
- package/build/{internal → src/internal}/EntityDataManager.d.ts +5 -5
- package/build/{internal → src/internal}/EntityDataManager.js +2 -1
- package/build/src/internal/EntityDataManager.js.map +1 -0
- package/build/{internal → src/internal}/EntityFieldTransformationUtils.d.ts +1 -1
- package/build/src/internal/EntityFieldTransformationUtils.js.map +1 -0
- package/build/{internal → src/internal}/EntityLoadInterfaces.d.ts +1 -1
- package/build/src/internal/EntityLoadInterfaces.js.map +1 -0
- package/build/{internal → src/internal}/EntityTableDataCoordinator.d.ts +9 -9
- package/build/{internal → src/internal}/EntityTableDataCoordinator.js +5 -7
- package/build/{internal → src/internal}/EntityTableDataCoordinator.js.map +1 -1
- package/build/{internal → src/internal}/ReadThroughEntityCache.d.ts +3 -3
- package/build/{internal → src/internal}/ReadThroughEntityCache.js +2 -2
- package/build/src/internal/ReadThroughEntityCache.js.map +1 -0
- package/build/{internal → src/internal}/SingleFieldHolder.d.ts +1 -1
- package/build/src/internal/SingleFieldHolder.js.map +1 -0
- package/build/src/internal/__tests__/CompositeFieldHolder-test.d.ts +1 -0
- package/build/src/internal/__tests__/CompositeFieldHolder-test.js +25 -0
- package/build/src/internal/__tests__/CompositeFieldHolder-test.js.map +1 -0
- package/build/src/internal/__tests__/CompositeFieldValueMap-test.d.ts +1 -0
- package/build/src/internal/__tests__/CompositeFieldValueMap-test.js +40 -0
- package/build/src/internal/__tests__/CompositeFieldValueMap-test.js.map +1 -0
- package/build/src/internal/__tests__/EntityDataManager-test.d.ts +1 -0
- package/build/src/internal/__tests__/EntityDataManager-test.js +666 -0
- package/build/src/internal/__tests__/EntityDataManager-test.js.map +1 -0
- package/build/src/internal/__tests__/EntityFieldTransformationUtils-test.d.ts +1 -0
- package/build/src/internal/__tests__/EntityFieldTransformationUtils-test.js +135 -0
- package/build/src/internal/__tests__/EntityFieldTransformationUtils-test.js.map +1 -0
- package/build/src/internal/__tests__/ReadThroughEntityCache-test.d.ts +1 -0
- package/build/src/internal/__tests__/ReadThroughEntityCache-test.js +217 -0
- package/build/src/internal/__tests__/ReadThroughEntityCache-test.js.map +1 -0
- package/build/{metrics → src/metrics}/EntityMetricsUtils.d.ts +1 -1
- package/build/src/metrics/EntityMetricsUtils.js.map +1 -0
- package/build/{metrics → src/metrics}/IEntityMetricsAdapter.d.ts +1 -1
- package/build/src/metrics/IEntityMetricsAdapter.js.map +1 -0
- package/build/{metrics → src/metrics}/NoOpEntityMetricsAdapter.d.ts +2 -2
- package/build/{metrics → src/metrics}/NoOpEntityMetricsAdapter.js +2 -1
- package/build/src/metrics/NoOpEntityMetricsAdapter.js.map +1 -0
- package/build/{rules → src/rules}/AlwaysAllowPrivacyPolicyRule.d.ts +4 -4
- package/build/src/rules/AlwaysAllowPrivacyPolicyRule.js +14 -0
- package/build/src/rules/AlwaysAllowPrivacyPolicyRule.js.map +1 -0
- package/build/{rules → src/rules}/AlwaysDenyPrivacyPolicyRule.d.ts +4 -4
- package/build/src/rules/AlwaysDenyPrivacyPolicyRule.js +14 -0
- package/build/src/rules/AlwaysDenyPrivacyPolicyRule.js.map +1 -0
- package/build/{rules → src/rules}/AlwaysSkipPrivacyPolicyRule.d.ts +4 -4
- package/build/src/rules/AlwaysSkipPrivacyPolicyRule.js +14 -0
- package/build/src/rules/AlwaysSkipPrivacyPolicyRule.js.map +1 -0
- package/build/{rules → src/rules}/PrivacyPolicyRule.d.ts +3 -3
- package/build/{rules → src/rules}/PrivacyPolicyRule.js +2 -2
- package/build/src/rules/PrivacyPolicyRule.js.map +1 -0
- package/build/src/rules/__tests__/AlwaysAllowPrivacyPolicyRule-test.d.ts +1 -0
- package/build/src/rules/__tests__/AlwaysAllowPrivacyPolicyRule-test.js +18 -0
- package/build/src/rules/__tests__/AlwaysAllowPrivacyPolicyRule-test.js.map +1 -0
- package/build/src/rules/__tests__/AlwaysDenyPrivacyPolicyRule-test.d.ts +1 -0
- package/build/src/rules/__tests__/AlwaysDenyPrivacyPolicyRule-test.js +18 -0
- package/build/src/rules/__tests__/AlwaysDenyPrivacyPolicyRule-test.js.map +1 -0
- package/build/src/rules/__tests__/AlwaysSkipPrivacyPolicyRule-test.d.ts +1 -0
- package/build/src/rules/__tests__/AlwaysSkipPrivacyPolicyRule-test.js +18 -0
- package/build/src/rules/__tests__/AlwaysSkipPrivacyPolicyRule-test.js.map +1 -0
- package/build/{utils → src/utils}/EntityCreationUtils.d.ts +3 -3
- package/build/{utils → src/utils}/EntityCreationUtils.js +2 -5
- package/build/{utils → src/utils}/EntityCreationUtils.js.map +1 -1
- package/build/{utils → src/utils}/EntityPrivacyUtils.d.ts +4 -4
- package/build/{utils → src/utils}/EntityPrivacyUtils.js +4 -7
- package/build/{utils → src/utils}/EntityPrivacyUtils.js.map +1 -1
- package/build/src/utils/__testfixtures__/PrivacyPolicyRuleTestUtils.d.ts +28 -0
- package/build/src/utils/__testfixtures__/PrivacyPolicyRuleTestUtils.js +53 -0
- package/build/src/utils/__testfixtures__/PrivacyPolicyRuleTestUtils.js.map +1 -0
- package/build/src/utils/__testfixtures__/SimpleTestEntity.d.ts +20 -0
- package/build/src/utils/__testfixtures__/SimpleTestEntity.js +46 -0
- package/build/src/utils/__testfixtures__/SimpleTestEntity.js.map +1 -0
- package/build/src/utils/__testfixtures__/StubCacheAdapter.d.ts +29 -0
- package/build/src/utils/__testfixtures__/StubCacheAdapter.js +103 -0
- package/build/src/utils/__testfixtures__/StubCacheAdapter.js.map +1 -0
- package/build/src/utils/__testfixtures__/StubDatabaseAdapter.d.ts +26 -0
- package/build/src/utils/__testfixtures__/StubDatabaseAdapter.js +173 -0
- package/build/src/utils/__testfixtures__/StubDatabaseAdapter.js.map +1 -0
- package/build/src/utils/__testfixtures__/StubDatabaseAdapterProvider.d.ts +7 -0
- package/build/src/utils/__testfixtures__/StubDatabaseAdapterProvider.js +12 -0
- package/build/src/utils/__testfixtures__/StubDatabaseAdapterProvider.js.map +1 -0
- package/build/src/utils/__testfixtures__/StubQueryContextProvider.d.ts +7 -0
- package/build/src/utils/__testfixtures__/StubQueryContextProvider.js +17 -0
- package/build/src/utils/__testfixtures__/StubQueryContextProvider.js.map +1 -0
- package/build/src/utils/__testfixtures__/TSMockitoExtensions.d.ts +9 -0
- package/build/src/utils/__testfixtures__/TSMockitoExtensions.js +65 -0
- package/build/src/utils/__testfixtures__/TSMockitoExtensions.js.map +1 -0
- package/build/src/utils/__testfixtures__/TestEntity.d.ts +30 -0
- package/build/src/utils/__testfixtures__/TestEntity.js +96 -0
- package/build/src/utils/__testfixtures__/TestEntity.js.map +1 -0
- package/build/src/utils/__testfixtures__/TestEntity2.d.ts +20 -0
- package/build/src/utils/__testfixtures__/TestEntity2.js +49 -0
- package/build/src/utils/__testfixtures__/TestEntity2.js.map +1 -0
- package/build/src/utils/__testfixtures__/TestEntityWithMutationTriggers.d.ts +36 -0
- package/build/src/utils/__testfixtures__/TestEntityWithMutationTriggers.js +80 -0
- package/build/src/utils/__testfixtures__/TestEntityWithMutationTriggers.js.map +1 -0
- package/build/src/utils/__testfixtures__/TestViewerContext.d.ts +3 -0
- package/build/src/utils/__testfixtures__/TestViewerContext.js +8 -0
- package/build/src/utils/__testfixtures__/TestViewerContext.js.map +1 -0
- package/build/src/utils/__testfixtures__/createUnitTestEntityCompanionProvider.d.ts +7 -0
- package/build/src/utils/__testfixtures__/createUnitTestEntityCompanionProvider.js +33 -0
- package/build/src/utils/__testfixtures__/createUnitTestEntityCompanionProvider.js.map +1 -0
- package/build/src/utils/__testfixtures__/describeFieldTestCase.d.ts +2 -0
- package/build/src/utils/__testfixtures__/describeFieldTestCase.js +19 -0
- package/build/src/utils/__testfixtures__/describeFieldTestCase.js.map +1 -0
- package/build/src/utils/__tests__/EntityCreationUtils-test.d.ts +1 -0
- package/build/src/utils/__tests__/EntityCreationUtils-test.js +144 -0
- package/build/src/utils/__tests__/EntityCreationUtils-test.js.map +1 -0
- package/build/src/utils/__tests__/EntityPrivacyUtils-test.d.ts +1 -0
- package/build/src/utils/__tests__/EntityPrivacyUtils-test.js +460 -0
- package/build/src/utils/__tests__/EntityPrivacyUtils-test.js.map +1 -0
- package/build/src/utils/__tests__/canViewerDeleteAsync-edgeDeletionPermissionInferenceBehavior-test.d.ts +1 -0
- package/build/src/utils/__tests__/canViewerDeleteAsync-edgeDeletionPermissionInferenceBehavior-test.js +180 -0
- package/build/src/utils/__tests__/canViewerDeleteAsync-edgeDeletionPermissionInferenceBehavior-test.js.map +1 -0
- package/build/src/utils/__tests__/mergeEntityMutationTriggerConfigurations-test.d.ts +1 -0
- package/build/src/utils/__tests__/mergeEntityMutationTriggerConfigurations-test.js +27 -0
- package/build/src/utils/__tests__/mergeEntityMutationTriggerConfigurations-test.js.map +1 -0
- package/build/src/utils/collections/SerializableKeyMap.js.map +1 -0
- package/build/src/utils/collections/__tests__/SerializableKeyMap-test.d.ts +5 -0
- package/build/src/utils/collections/__tests__/SerializableKeyMap-test.js +99 -0
- package/build/src/utils/collections/__tests__/SerializableKeyMap-test.js.map +1 -0
- package/build/src/utils/collections/__tests__/maps-test.d.ts +1 -0
- package/build/src/utils/collections/__tests__/maps-test.js +121 -0
- package/build/src/utils/collections/__tests__/maps-test.js.map +1 -0
- package/build/src/utils/collections/__tests__/sets-test.d.ts +1 -0
- package/build/src/utils/collections/__tests__/sets-test.js +19 -0
- package/build/src/utils/collections/__tests__/sets-test.js.map +1 -0
- package/build/src/utils/collections/maps.js.map +1 -0
- package/build/src/utils/collections/sets.js.map +1 -0
- package/build/{utils → src/utils}/mergeEntityMutationTriggerConfigurations.d.ts +3 -3
- package/build/src/utils/mergeEntityMutationTriggerConfigurations.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -0
- package/package.json +11 -23
- package/src/AuthorizationResultBasedEntityAssociationLoader.ts +4 -4
- package/src/AuthorizationResultBasedEntityLoader.ts +13 -12
- package/src/AuthorizationResultBasedEntityMutator.ts +15 -14
- package/src/ComposedEntityCacheAdapter.ts +3 -3
- package/src/ComposedSecondaryEntityCache.ts +1 -1
- package/src/EnforcingEntityAssociationLoader.ts +6 -5
- package/src/EnforcingEntityCreator.ts +4 -4
- package/src/EnforcingEntityDeleter.ts +4 -4
- package/src/EnforcingEntityLoader.ts +5 -5
- package/src/EnforcingEntityUpdater.ts +4 -4
- package/src/Entity.ts +10 -10
- package/src/EntityAssociationLoader.ts +5 -5
- package/src/EntityCompanion.ts +10 -10
- package/src/EntityCompanionProvider.ts +13 -13
- package/src/EntityConfiguration.ts +3 -3
- package/src/EntityCreator.ts +5 -5
- package/src/EntityDatabaseAdapter.ts +3 -3
- package/src/EntityDeleter.ts +5 -5
- package/src/EntityFieldDefinition.ts +3 -3
- package/src/EntityLoader.ts +7 -7
- package/src/EntityLoaderFactory.ts +9 -9
- package/src/EntityLoaderUtils.ts +7 -7
- package/src/EntityMutationInfo.ts +2 -2
- package/src/EntityMutationTriggerConfiguration.ts +3 -3
- package/src/EntityMutationValidator.ts +3 -3
- package/src/EntityMutatorFactory.ts +12 -12
- package/src/EntityPrivacyPolicy.ts +7 -6
- package/src/EntityQueryContext.ts +1 -1
- package/src/EntityQueryContextProvider.ts +3 -3
- package/src/EntitySecondaryCacheLoader.ts +5 -5
- package/src/EntityUpdater.ts +5 -5
- package/src/GenericEntityCacheAdapter.ts +3 -3
- package/src/GenericSecondaryEntityCache.ts +2 -2
- package/src/IEntityCacheAdapter.ts +1 -1
- package/src/IEntityCacheAdapterProvider.ts +3 -3
- package/src/IEntityDatabaseAdapterProvider.ts +3 -3
- package/src/IEntityGenericCacher.ts +1 -1
- package/src/ReadonlyEntity.ts +10 -10
- package/src/ViewerContext.ts +6 -6
- package/src/ViewerScopedEntityCompanion.ts +9 -9
- package/src/ViewerScopedEntityCompanionProvider.ts +6 -6
- package/src/ViewerScopedEntityLoaderFactory.ts +6 -6
- package/src/ViewerScopedEntityMutatorFactory.ts +6 -6
- package/src/__tests__/AuthorizationResultBasedEntityAssociationLoader-test.ts +5 -4
- package/src/__tests__/AuthorizationResultBasedEntityLoader-constructor-test.ts +14 -18
- package/src/__tests__/AuthorizationResultBasedEntityLoader-test.ts +18 -16
- package/src/__tests__/ComposedCacheAdapter-test.ts +5 -3
- package/src/__tests__/ComposedSecondaryEntityCache-test.ts +2 -1
- package/src/__tests__/EnforcingEntityAssociationLoader-test.ts +4 -3
- package/src/__tests__/EnforcingEntityLoader-test.ts +4 -3
- package/src/__tests__/Entity-test.ts +8 -6
- package/src/__tests__/EntityAssociationLoader-test.ts +7 -5
- package/src/__tests__/EntityCommonUseCases-test.ts +10 -9
- package/src/__tests__/EntityCompanion-test.ts +13 -11
- package/src/__tests__/EntityCompanionProvider-test.ts +7 -5
- package/src/__tests__/EntityConfiguration-test.ts +3 -1
- package/src/__tests__/EntityDatabaseAdapter-test.ts +9 -7
- package/src/__tests__/EntityEdges-test.ts +10 -8
- package/src/__tests__/EntityFields-test.ts +8 -7
- package/src/__tests__/EntityLoader-test.ts +8 -6
- package/src/__tests__/EntityMutator-MutationCacheConsistency-test.ts +8 -6
- package/src/__tests__/EntityMutator-SingleCompositeFieldCacheConsistency-test.ts +5 -3
- package/src/__tests__/EntityMutator-test.ts +33 -29
- package/src/__tests__/EntityPrivacyPolicy-test.ts +19 -16
- package/src/__tests__/EntityQueryContext-test.ts +7 -6
- package/src/__tests__/EntitySecondaryCacheLoader-test.ts +5 -3
- package/src/__tests__/EntitySelfReferentialEdges-test.ts +7 -5
- package/src/__tests__/GenericEntityCacheAdapter-test.ts +4 -3
- package/src/__tests__/ReadonlyEntity-test.ts +10 -9
- package/src/__tests__/ViewerContext-test.ts +3 -1
- package/src/__tests__/ViewerScopedEntityCompanion-test.ts +10 -8
- package/src/__tests__/ViewerScopedEntityCompanionProvider-test.ts +7 -6
- package/src/__tests__/ViewerScopedEntityLoaderFactory-test.ts +5 -4
- package/src/__tests__/ViewerScopedEntityMutatorFactory-test.ts +8 -6
- package/src/__tests__/cases/TwoEntitySameTableDisjointRows-test.ts +15 -13
- package/src/__tests__/cases/TwoEntitySameTableOverlappingRows-test.ts +7 -5
- package/src/__tests__/entityUtils-test.ts +3 -2
- package/src/errors/EntityCacheAdapterError.ts +2 -2
- package/src/errors/EntityDatabaseAdapterError.ts +2 -2
- package/src/errors/EntityError.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 +6 -3
- package/src/index.ts +39 -54
- package/src/internal/CompositeFieldHolder.ts +2 -1
- package/src/internal/EntityDataManager.ts +7 -5
- package/src/internal/EntityFieldTransformationUtils.ts +1 -1
- package/src/internal/EntityLoadInterfaces.ts +1 -1
- package/src/internal/EntityTableDataCoordinator.ts +10 -10
- package/src/internal/ReadThroughEntityCache.ts +3 -3
- package/src/internal/SingleFieldHolder.ts +1 -1
- package/src/internal/__tests__/CompositeFieldHolder-test.ts +2 -0
- package/src/internal/__tests__/CompositeFieldValueMap-test.ts +2 -0
- package/src/internal/__tests__/EntityDataManager-test.ts +34 -31
- package/src/internal/__tests__/EntityFieldTransformationUtils-test.ts +5 -3
- package/src/internal/__tests__/ReadThroughEntityCache-test.ts +5 -4
- package/src/metrics/EntityMetricsUtils.ts +3 -2
- package/src/metrics/IEntityMetricsAdapter.ts +1 -1
- package/src/metrics/NoOpEntityMetricsAdapter.ts +3 -2
- package/src/rules/AlwaysAllowPrivacyPolicyRule.ts +4 -4
- package/src/rules/AlwaysDenyPrivacyPolicyRule.ts +4 -4
- package/src/rules/AlwaysSkipPrivacyPolicyRule.ts +4 -4
- package/src/rules/PrivacyPolicyRule.ts +3 -3
- package/src/rules/__tests__/AlwaysAllowPrivacyPolicyRule-test.ts +3 -3
- package/src/rules/__tests__/AlwaysDenyPrivacyPolicyRule-test.ts +3 -3
- package/src/rules/__tests__/AlwaysSkipPrivacyPolicyRule-test.ts +3 -3
- package/src/utils/EntityCreationUtils.ts +4 -4
- package/src/utils/EntityPrivacyUtils.ts +5 -5
- package/src/utils/__testfixtures__/PrivacyPolicyRuleTestUtils.ts +5 -3
- package/src/utils/__testfixtures__/SimpleTestEntity.ts +6 -6
- package/src/utils/__testfixtures__/StubCacheAdapter.ts +4 -4
- package/src/utils/__testfixtures__/StubDatabaseAdapter.ts +8 -7
- package/src/utils/__testfixtures__/StubDatabaseAdapterProvider.ts +5 -5
- package/src/utils/__testfixtures__/StubQueryContextProvider.ts +2 -2
- package/src/utils/__testfixtures__/TestEntity.ts +7 -7
- package/src/utils/__testfixtures__/TestEntity2.ts +6 -6
- package/src/utils/__testfixtures__/TestEntityWithMutationTriggers.ts +6 -10
- package/src/utils/__testfixtures__/TestViewerContext.ts +2 -2
- package/src/utils/__testfixtures__/createUnitTestEntityCompanionProvider.ts +5 -5
- package/src/utils/__testfixtures__/describeFieldTestCase.ts +3 -1
- package/src/utils/__tests__/EntityCreationUtils-test.ts +5 -3
- package/src/utils/__tests__/EntityPrivacyUtils-test.ts +15 -13
- package/src/utils/__tests__/canViewerDeleteAsync-edgeDeletionPermissionInferenceBehavior-test.ts +10 -8
- package/src/utils/__tests__/mergeEntityMutationTriggerConfigurations-test.ts +2 -0
- package/src/utils/collections/__tests__/SerializableKeyMap-test.ts +2 -0
- package/src/utils/collections/__tests__/maps-test.ts +3 -1
- package/src/utils/collections/__tests__/sets-test.ts +2 -0
- package/src/utils/mergeEntityMutationTriggerConfigurations.ts +3 -3
- package/build/AuthorizationResultBasedEntityAssociationLoader.js.map +0 -1
- package/build/AuthorizationResultBasedEntityLoader.js.map +0 -1
- package/build/AuthorizationResultBasedEntityMutator.js.map +0 -1
- package/build/ComposedEntityCacheAdapter.js.map +0 -1
- package/build/ComposedSecondaryEntityCache.js.map +0 -1
- package/build/EnforcingEntityAssociationLoader.js.map +0 -1
- package/build/EnforcingEntityCreator.js.map +0 -1
- package/build/EnforcingEntityDeleter.js.map +0 -1
- package/build/EnforcingEntityLoader.js.map +0 -1
- package/build/EnforcingEntityUpdater.js.map +0 -1
- package/build/Entity.js.map +0 -1
- package/build/EntityAssociationLoader.js.map +0 -1
- package/build/EntityCompanion.js.map +0 -1
- package/build/EntityCompanionProvider.js.map +0 -1
- package/build/EntityConfiguration.js.map +0 -1
- package/build/EntityDatabaseAdapter.js.map +0 -1
- package/build/EntityFieldDefinition.js.map +0 -1
- package/build/EntityFields.js.map +0 -1
- package/build/EntityLoaderFactory.js +0 -31
- package/build/EntityLoaderFactory.js.map +0 -1
- package/build/EntityLoaderUtils.js.map +0 -1
- package/build/EntityMutationInfo.js.map +0 -1
- package/build/EntityMutationTriggerConfiguration.js.map +0 -1
- package/build/EntityMutationValidator.js.map +0 -1
- package/build/EntityMutatorFactory.js.map +0 -1
- package/build/EntityQueryContext.js.map +0 -1
- package/build/EntityQueryContextProvider.js.map +0 -1
- package/build/EntitySecondaryCacheLoader.js.map +0 -1
- package/build/GenericEntityCacheAdapter.js.map +0 -1
- package/build/GenericSecondaryEntityCache.js.map +0 -1
- package/build/IEntityCacheAdapter.js.map +0 -1
- package/build/IEntityCacheAdapterProvider.js.map +0 -1
- package/build/IEntityDatabaseAdapterProvider.js.map +0 -1
- package/build/IEntityGenericCacher.js.map +0 -1
- package/build/ReadonlyEntity.js.map +0 -1
- package/build/ViewerScopedEntityCompanionProvider.js.map +0 -1
- package/build/ViewerScopedEntityLoaderFactory.js.map +0 -1
- package/build/ViewerScopedEntityMutatorFactory.js.map +0 -1
- package/build/entityUtils.js.map +0 -1
- package/build/errors/EntityCacheAdapterError.js +0 -46
- package/build/errors/EntityCacheAdapterError.js.map +0 -1
- package/build/errors/EntityDatabaseAdapterError.js.map +0 -1
- package/build/errors/EntityError.js.map +0 -1
- package/build/errors/EntityInvalidFieldValueError.js +0 -45
- package/build/errors/EntityInvalidFieldValueError.js.map +0 -1
- package/build/errors/EntityNotAuthorizedError.js +0 -48
- package/build/errors/EntityNotAuthorizedError.js.map +0 -1
- package/build/errors/EntityNotFoundError.js +0 -50
- package/build/errors/EntityNotFoundError.js.map +0 -1
- package/build/index.d.ts +0 -91
- package/build/index.js +0 -155
- package/build/index.js.map +0 -1
- package/build/internal/CompositeFieldHolder.js.map +0 -1
- package/build/internal/CompositeFieldValueMap.js.map +0 -1
- package/build/internal/EntityDataManager.js.map +0 -1
- package/build/internal/EntityFieldTransformationUtils.js.map +0 -1
- package/build/internal/EntityLoadInterfaces.js.map +0 -1
- package/build/internal/ReadThroughEntityCache.js.map +0 -1
- package/build/internal/SingleFieldHolder.js.map +0 -1
- package/build/metrics/EntityMetricsUtils.js.map +0 -1
- package/build/metrics/IEntityMetricsAdapter.js.map +0 -1
- package/build/metrics/NoOpEntityMetricsAdapter.js.map +0 -1
- package/build/rules/AlwaysAllowPrivacyPolicyRule.js +0 -46
- package/build/rules/AlwaysAllowPrivacyPolicyRule.js.map +0 -1
- package/build/rules/AlwaysDenyPrivacyPolicyRule.js +0 -46
- package/build/rules/AlwaysDenyPrivacyPolicyRule.js.map +0 -1
- package/build/rules/AlwaysSkipPrivacyPolicyRule.js +0 -46
- package/build/rules/AlwaysSkipPrivacyPolicyRule.js.map +0 -1
- package/build/rules/PrivacyPolicyRule.js.map +0 -1
- package/build/tsconfig.build.tsbuildinfo +0 -1
- package/build/utils/collections/SerializableKeyMap.js.map +0 -1
- package/build/utils/collections/maps.js.map +0 -1
- package/build/utils/collections/sets.js.map +0 -1
- package/build/utils/mergeEntityMutationTriggerConfigurations.js.map +0 -1
- /package/build/{EntityFieldDefinition.js → src/EntityFieldDefinition.js} +0 -0
- /package/build/{EntityFields.d.ts → src/EntityFields.d.ts} +0 -0
- /package/build/{EntityFields.js → src/EntityFields.js} +0 -0
- /package/build/{EntityMutationInfo.js → src/EntityMutationInfo.js} +0 -0
- /package/build/{EntityMutationTriggerConfiguration.js → src/EntityMutationTriggerConfiguration.js} +0 -0
- /package/build/{EntityQueryContext.js → src/EntityQueryContext.js} +0 -0
- /package/build/{IEntityCacheAdapter.js → src/IEntityCacheAdapter.js} +0 -0
- /package/build/{IEntityCacheAdapterProvider.js → src/IEntityCacheAdapterProvider.js} +0 -0
- /package/build/{IEntityDatabaseAdapterProvider.js → src/IEntityDatabaseAdapterProvider.js} +0 -0
- /package/build/{IEntityGenericCacher.js → src/IEntityGenericCacher.js} +0 -0
- /package/build/{entityUtils.d.ts → src/entityUtils.d.ts} +0 -0
- /package/build/{entityUtils.js → src/entityUtils.js} +0 -0
- /package/build/{internal → src/internal}/CompositeFieldHolder.js +0 -0
- /package/build/{internal → src/internal}/CompositeFieldValueMap.d.ts +0 -0
- /package/build/{internal → src/internal}/CompositeFieldValueMap.js +0 -0
- /package/build/{internal → src/internal}/EntityFieldTransformationUtils.js +0 -0
- /package/build/{internal → src/internal}/EntityLoadInterfaces.js +0 -0
- /package/build/{internal → src/internal}/SingleFieldHolder.js +0 -0
- /package/build/{metrics → src/metrics}/EntityMetricsUtils.js +0 -0
- /package/build/{metrics → src/metrics}/IEntityMetricsAdapter.js +0 -0
- /package/build/{utils → src/utils}/collections/SerializableKeyMap.d.ts +0 -0
- /package/build/{utils → src/utils}/collections/SerializableKeyMap.js +0 -0
- /package/build/{utils → src/utils}/collections/maps.d.ts +0 -0
- /package/build/{utils → src/utils}/collections/maps.js +0 -0
- /package/build/{utils → src/utils}/collections/sets.d.ts +0 -0
- /package/build/{utils → src/utils}/collections/sets.js +0 -0
- /package/build/{utils → src/utils}/mergeEntityMutationTriggerConfigurations.js +0 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TestEntityWithMutationTriggers = exports.NonTransactionalTestMutationTrigger = exports.TestMutationTrigger = exports.TestEntityMTPrivacyPolicy = exports.testEntityMTConfiguration = void 0;
|
|
4
|
+
const Entity_1 = require("../../Entity");
|
|
5
|
+
const EntityConfiguration_1 = require("../../EntityConfiguration");
|
|
6
|
+
const EntityFields_1 = require("../../EntityFields");
|
|
7
|
+
const EntityMutationTriggerConfiguration_1 = require("../../EntityMutationTriggerConfiguration");
|
|
8
|
+
const EntityPrivacyPolicy_1 = require("../../EntityPrivacyPolicy");
|
|
9
|
+
const AlwaysAllowPrivacyPolicyRule_1 = require("../../rules/AlwaysAllowPrivacyPolicyRule");
|
|
10
|
+
exports.testEntityMTConfiguration = new EntityConfiguration_1.EntityConfiguration({
|
|
11
|
+
idField: 'id',
|
|
12
|
+
tableName: 'test_entity_should_not_write_to_db_3',
|
|
13
|
+
schema: {
|
|
14
|
+
id: new EntityFields_1.UUIDField({
|
|
15
|
+
columnName: 'id',
|
|
16
|
+
cache: false,
|
|
17
|
+
}),
|
|
18
|
+
stringField: new EntityFields_1.StringField({
|
|
19
|
+
columnName: 'string_field',
|
|
20
|
+
}),
|
|
21
|
+
},
|
|
22
|
+
databaseAdapterFlavor: 'postgres',
|
|
23
|
+
cacheAdapterFlavor: 'redis',
|
|
24
|
+
});
|
|
25
|
+
class TestEntityMTPrivacyPolicy extends EntityPrivacyPolicy_1.EntityPrivacyPolicy {
|
|
26
|
+
readRules = [
|
|
27
|
+
new AlwaysAllowPrivacyPolicyRule_1.AlwaysAllowPrivacyPolicyRule(),
|
|
28
|
+
];
|
|
29
|
+
createRules = [
|
|
30
|
+
new AlwaysAllowPrivacyPolicyRule_1.AlwaysAllowPrivacyPolicyRule(),
|
|
31
|
+
];
|
|
32
|
+
updateRules = [
|
|
33
|
+
new AlwaysAllowPrivacyPolicyRule_1.AlwaysAllowPrivacyPolicyRule(),
|
|
34
|
+
];
|
|
35
|
+
deleteRules = [
|
|
36
|
+
new AlwaysAllowPrivacyPolicyRule_1.AlwaysAllowPrivacyPolicyRule(),
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
exports.TestEntityMTPrivacyPolicy = TestEntityMTPrivacyPolicy;
|
|
40
|
+
class TestMutationTrigger extends EntityMutationTriggerConfiguration_1.EntityMutationTrigger {
|
|
41
|
+
key;
|
|
42
|
+
constructor(
|
|
43
|
+
// @ts-expect-error key is never used but is helpful for debugging
|
|
44
|
+
key) {
|
|
45
|
+
super();
|
|
46
|
+
this.key = key;
|
|
47
|
+
}
|
|
48
|
+
async executeAsync(_viewerContext, _queryContext, _entity, _mutationInfo) { }
|
|
49
|
+
}
|
|
50
|
+
exports.TestMutationTrigger = TestMutationTrigger;
|
|
51
|
+
class NonTransactionalTestMutationTrigger extends EntityMutationTriggerConfiguration_1.EntityNonTransactionalMutationTrigger {
|
|
52
|
+
key;
|
|
53
|
+
constructor(
|
|
54
|
+
// @ts-expect-error key is never used but is helpful for debugging
|
|
55
|
+
key) {
|
|
56
|
+
super();
|
|
57
|
+
this.key = key;
|
|
58
|
+
}
|
|
59
|
+
async executeAsync(_viewerContext, _entity, _mutationInfo) { }
|
|
60
|
+
}
|
|
61
|
+
exports.NonTransactionalTestMutationTrigger = NonTransactionalTestMutationTrigger;
|
|
62
|
+
/**
|
|
63
|
+
* A test Entity that has one afterCreate and one afterAll trigger
|
|
64
|
+
*/
|
|
65
|
+
class TestEntityWithMutationTriggers extends Entity_1.Entity {
|
|
66
|
+
static defineCompanionDefinition() {
|
|
67
|
+
return {
|
|
68
|
+
entityClass: TestEntityWithMutationTriggers,
|
|
69
|
+
entityConfiguration: exports.testEntityMTConfiguration,
|
|
70
|
+
privacyPolicyClass: TestEntityMTPrivacyPolicy,
|
|
71
|
+
mutationTriggers: {
|
|
72
|
+
afterCreate: [new TestMutationTrigger('localAfterCreate')],
|
|
73
|
+
afterAll: [new TestMutationTrigger('localAfterAll')],
|
|
74
|
+
afterCommit: [new NonTransactionalTestMutationTrigger('localAfterCommit')],
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.TestEntityWithMutationTriggers = TestEntityWithMutationTriggers;
|
|
80
|
+
//# sourceMappingURL=TestEntityWithMutationTriggers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TestEntityWithMutationTriggers.js","sourceRoot":"","sources":["../../../../src/utils/__testfixtures__/TestEntityWithMutationTriggers.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AAEtC,mEAAgE;AAChE,qDAA4D;AAE5D,iGAGkD;AAClD,mEAAgE;AAGhE,2FAAwF;AAO3E,QAAA,yBAAyB,GAAG,IAAI,yCAAmB,CAAqB;IACnF,OAAO,EAAE,IAAI;IACb,SAAS,EAAE,sCAAsC;IACjD,MAAM,EAAE;QACN,EAAE,EAAE,IAAI,wBAAS,CAAC;YAChB,UAAU,EAAE,IAAI;YAChB,KAAK,EAAE,KAAK;SACb,CAAC;QACF,WAAW,EAAE,IAAI,0BAAW,CAAC;YAC3B,UAAU,EAAE,cAAc;SAC3B,CAAC;KACH;IACD,qBAAqB,EAAE,UAAU;IACjC,kBAAkB,EAAE,OAAO;CAC5B,CAAC,CAAC;AAEH,MAAa,yBAA0B,SAAQ,yCAK9C;IAC6B,SAAS,GAAG;QACtC,IAAI,2DAA4B,EAK7B;KACJ,CAAC;IAC0B,WAAW,GAAG;QACxC,IAAI,2DAA4B,EAK7B;KACJ,CAAC;IAC0B,WAAW,GAAG;QACxC,IAAI,2DAA4B,EAK7B;KACJ,CAAC;IAC0B,WAAW,GAAG;QACxC,IAAI,2DAA4B,EAK7B;KACJ,CAAC;CACH;AAtCD,8DAsCC;AAED,MAAa,mBAAoB,SAAQ,0DAMxC;IAGoB;IAFnB;IACE,kEAAkE;IACjD,GAAW;QAE5B,KAAK,EAAE,CAAC;QAFS,QAAG,GAAH,GAAG,CAAQ;IAG9B,CAAC;IAED,KAAK,CAAC,YAAY,CAChB,cAA6B,EAC7B,aAAiC,EACjC,OAAuC,EACvC,aAMC,IACe,CAAC;CACpB;AA1BD,kDA0BC;AAED,MAAa,mCAAoC,SAAQ,0EAMxD;IAGoB;IAFnB;IACE,kEAAkE;IACjD,GAAW;QAE5B,KAAK,EAAE,CAAC;QAFS,QAAG,GAAH,GAAG,CAAQ;IAG9B,CAAC;IAED,KAAK,CAAC,YAAY,CAChB,cAA6B,EAC7B,OAAuC,EACvC,aAMC,IACe,CAAC;CACpB;AAzBD,kFAyBC;AAED;;GAEG;AACH,MAAa,8BAA+B,SAAQ,eAAyC;IAC3F,MAAM,CAAC,yBAAyB;QAO9B,OAAO;YACL,WAAW,EAAE,8BAA8B;YAC3C,mBAAmB,EAAE,iCAAyB;YAC9C,kBAAkB,EAAE,yBAAyB;YAC7C,gBAAgB,EAAE;gBAChB,WAAW,EAAE,CAAC,IAAI,mBAAmB,CAAC,kBAAkB,CAAC,CAAC;gBAC1D,QAAQ,EAAE,CAAC,IAAI,mBAAmB,CAAC,eAAe,CAAC,CAAC;gBACpD,WAAW,EAAE,CAAC,IAAI,mCAAmC,CAAC,kBAAkB,CAAC,CAAC;aAC3E;SACF,CAAC;IACJ,CAAC;CACF;AAnBD,wEAmBC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TestViewerContext = void 0;
|
|
4
|
+
const ViewerContext_1 = require("../../ViewerContext");
|
|
5
|
+
class TestViewerContext extends ViewerContext_1.ViewerContext {
|
|
6
|
+
}
|
|
7
|
+
exports.TestViewerContext = TestViewerContext;
|
|
8
|
+
//# sourceMappingURL=TestViewerContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TestViewerContext.js","sourceRoot":"","sources":["../../../../src/utils/__testfixtures__/TestViewerContext.ts"],"names":[],"mappings":";;;AAAA,uDAAoD;AAEpD,MAAa,iBAAkB,SAAQ,6BAAa;CAAG;AAAvD,8CAAuD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EntityCompanionProvider } from '../../EntityCompanionProvider';
|
|
2
|
+
import { IEntityMetricsAdapter } from '../../metrics/IEntityMetricsAdapter';
|
|
3
|
+
/**
|
|
4
|
+
* Entity companion provider for use in unit tests. All database and cache implementations
|
|
5
|
+
* are replaced with in-memory simulations.
|
|
6
|
+
*/
|
|
7
|
+
export declare const createUnitTestEntityCompanionProvider: (metricsAdapter?: IEntityMetricsAdapter) => EntityCompanionProvider;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createUnitTestEntityCompanionProvider = void 0;
|
|
4
|
+
const StubCacheAdapter_1 = require("./StubCacheAdapter");
|
|
5
|
+
const StubDatabaseAdapterProvider_1 = require("./StubDatabaseAdapterProvider");
|
|
6
|
+
const StubQueryContextProvider_1 = require("./StubQueryContextProvider");
|
|
7
|
+
const EntityCompanionProvider_1 = require("../../EntityCompanionProvider");
|
|
8
|
+
const NoOpEntityMetricsAdapter_1 = require("../../metrics/NoOpEntityMetricsAdapter");
|
|
9
|
+
const queryContextProvider = new StubQueryContextProvider_1.StubQueryContextProvider();
|
|
10
|
+
/**
|
|
11
|
+
* Entity companion provider for use in unit tests. All database and cache implementations
|
|
12
|
+
* are replaced with in-memory simulations.
|
|
13
|
+
*/
|
|
14
|
+
const createUnitTestEntityCompanionProvider = (metricsAdapter = new NoOpEntityMetricsAdapter_1.NoOpEntityMetricsAdapter()) => {
|
|
15
|
+
return new EntityCompanionProvider_1.EntityCompanionProvider(metricsAdapter, new Map([
|
|
16
|
+
[
|
|
17
|
+
'postgres',
|
|
18
|
+
{
|
|
19
|
+
adapterProvider: new StubDatabaseAdapterProvider_1.StubDatabaseAdapterProvider(),
|
|
20
|
+
queryContextProvider,
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
]), new Map([
|
|
24
|
+
[
|
|
25
|
+
'redis',
|
|
26
|
+
{
|
|
27
|
+
cacheAdapterProvider: new StubCacheAdapter_1.InMemoryFullCacheStubCacheAdapterProvider(),
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
]));
|
|
31
|
+
};
|
|
32
|
+
exports.createUnitTestEntityCompanionProvider = createUnitTestEntityCompanionProvider;
|
|
33
|
+
//# sourceMappingURL=createUnitTestEntityCompanionProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createUnitTestEntityCompanionProvider.js","sourceRoot":"","sources":["../../../../src/utils/__testfixtures__/createUnitTestEntityCompanionProvider.ts"],"names":[],"mappings":";;;AAAA,yDAA+E;AAC/E,+EAA4E;AAC5E,yEAAsE;AACtE,2EAAwE;AAExE,qFAAkF;AAElF,MAAM,oBAAoB,GAAG,IAAI,mDAAwB,EAAE,CAAC;AAE5D;;;GAGG;AACI,MAAM,qCAAqC,GAAG,CACnD,iBAAwC,IAAI,mDAAwB,EAAE,EAC7C,EAAE;IAC3B,OAAO,IAAI,iDAAuB,CAChC,cAAc,EACd,IAAI,GAAG,CAAC;QACN;YACE,UAAU;YACV;gBACE,eAAe,EAAE,IAAI,yDAA2B,EAAE;gBAClD,oBAAoB;aACrB;SACF;KACF,CAAC,EACF,IAAI,GAAG,CAAC;QACN;YACE,OAAO;YACP;gBACE,oBAAoB,EAAE,IAAI,4DAAyC,EAAE;aACtE;SACF;KACF,CAAC,CACH,CAAC;AACJ,CAAC,CAAC;AAvBW,QAAA,qCAAqC,yCAuBhD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.describeFieldTestCase = describeFieldTestCase;
|
|
4
|
+
const globals_1 = require("@jest/globals");
|
|
5
|
+
function describeFieldTestCase(fieldDefinition, validValues, invalidValues) {
|
|
6
|
+
(0, globals_1.describe)(fieldDefinition.constructor.name, () => {
|
|
7
|
+
if (validValues.length > 0) {
|
|
8
|
+
globals_1.test.each(validValues)(`${fieldDefinition.constructor.name}.valid %p`, (value) => {
|
|
9
|
+
(0, globals_1.expect)(fieldDefinition.validateInputValue(value)).toBe(true);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
if (invalidValues.length > 0) {
|
|
13
|
+
globals_1.test.each(invalidValues)(`${fieldDefinition.constructor.name}.invalid %p`, (value) => {
|
|
14
|
+
(0, globals_1.expect)(fieldDefinition.validateInputValue(value)).toBe(false);
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=describeFieldTestCase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"describeFieldTestCase.js","sourceRoot":"","sources":["../../../../src/utils/__testfixtures__/describeFieldTestCase.ts"],"names":[],"mappings":";;AAIA,sDAkBC;AAtBD,2CAAuD;AAIvD,SAAgB,qBAAqB,CACnC,eAA8C,EAC9C,WAAgB,EAChB,aAAoB;IAEpB,IAAA,kBAAQ,EAAC,eAAe,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,EAAE;QAC9C,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3B,cAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE;gBAC/E,IAAA,gBAAM,EAAC,eAAe,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC/D,CAAC,CAAC,CAAC;QACL,CAAC;QAED,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7B,cAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE;gBACnF,IAAA,gBAAM,EAAC,eAAe,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAChE,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const globals_1 = require("@jest/globals");
|
|
4
|
+
const ViewerContext_1 = require("../../ViewerContext");
|
|
5
|
+
const EntityDatabaseAdapterError_1 = require("../../errors/EntityDatabaseAdapterError");
|
|
6
|
+
const EntityNotFoundError_1 = require("../../errors/EntityNotFoundError");
|
|
7
|
+
const EntityCreationUtils_1 = require("../EntityCreationUtils");
|
|
8
|
+
const SimpleTestEntity_1 = require("../__testfixtures__/SimpleTestEntity");
|
|
9
|
+
const createUnitTestEntityCompanionProvider_1 = require("../__testfixtures__/createUnitTestEntityCompanionProvider");
|
|
10
|
+
globals_1.describe.each([true, false])('in transaction %p', (inTransaction) => {
|
|
11
|
+
(0, globals_1.describe)(EntityCreationUtils_1.createOrGetExistingAsync, () => {
|
|
12
|
+
(0, globals_1.it)('does not create when already exists', async () => {
|
|
13
|
+
const companionProvider = (0, createUnitTestEntityCompanionProvider_1.createUnitTestEntityCompanionProvider)();
|
|
14
|
+
const viewerContext = new ViewerContext_1.ViewerContext(companionProvider);
|
|
15
|
+
const entity = await SimpleTestEntity_1.SimpleTestEntity.creator(viewerContext).createAsync();
|
|
16
|
+
const args = {};
|
|
17
|
+
const getFn = globals_1.jest.fn(async (_vc, _args, _queryContext) => {
|
|
18
|
+
return entity;
|
|
19
|
+
});
|
|
20
|
+
const createFn = globals_1.jest.fn(async (vc, _args, queryContext) => {
|
|
21
|
+
return await SimpleTestEntity_1.SimpleTestEntity.creator(vc, queryContext).createAsync();
|
|
22
|
+
});
|
|
23
|
+
if (inTransaction) {
|
|
24
|
+
await viewerContext.runInTransactionForDatabaseAdaptorFlavorAsync('postgres', async (queryContext) => {
|
|
25
|
+
await (0, EntityCreationUtils_1.createOrGetExistingAsync)(viewerContext, SimpleTestEntity_1.SimpleTestEntity, getFn, args, createFn, args, queryContext);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
await (0, EntityCreationUtils_1.createOrGetExistingAsync)(viewerContext, SimpleTestEntity_1.SimpleTestEntity, getFn, args, createFn, args);
|
|
30
|
+
}
|
|
31
|
+
(0, globals_1.expect)(getFn).toHaveBeenCalledTimes(1);
|
|
32
|
+
(0, globals_1.expect)(createFn).toHaveBeenCalledTimes(0);
|
|
33
|
+
});
|
|
34
|
+
(0, globals_1.it)('creates when not found', async () => {
|
|
35
|
+
const companionProvider = (0, createUnitTestEntityCompanionProvider_1.createUnitTestEntityCompanionProvider)();
|
|
36
|
+
const viewerContext = new ViewerContext_1.ViewerContext(companionProvider);
|
|
37
|
+
const args = {};
|
|
38
|
+
const getFn = globals_1.jest.fn(async (_vc, _args, _queryContext) => {
|
|
39
|
+
return null;
|
|
40
|
+
});
|
|
41
|
+
const createFn = globals_1.jest.fn(async (vc, _args, queryContext) => {
|
|
42
|
+
return await SimpleTestEntity_1.SimpleTestEntity.creator(vc, queryContext).createAsync();
|
|
43
|
+
});
|
|
44
|
+
if (inTransaction) {
|
|
45
|
+
await viewerContext.runInTransactionForDatabaseAdaptorFlavorAsync('postgres', async (queryContext) => {
|
|
46
|
+
await (0, EntityCreationUtils_1.createOrGetExistingAsync)(viewerContext, SimpleTestEntity_1.SimpleTestEntity, getFn, args, createFn, args, queryContext);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
await (0, EntityCreationUtils_1.createOrGetExistingAsync)(viewerContext, SimpleTestEntity_1.SimpleTestEntity, getFn, args, createFn, args);
|
|
51
|
+
}
|
|
52
|
+
(0, globals_1.expect)(getFn).toHaveBeenCalledTimes(1);
|
|
53
|
+
(0, globals_1.expect)(createFn).toHaveBeenCalledTimes(1);
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
(0, globals_1.describe)(EntityCreationUtils_1.createWithUniqueConstraintRecoveryAsync, () => {
|
|
57
|
+
(0, globals_1.it)('does not call get when creation succeeds', async () => {
|
|
58
|
+
const companionProvider = (0, createUnitTestEntityCompanionProvider_1.createUnitTestEntityCompanionProvider)();
|
|
59
|
+
const viewerContext = new ViewerContext_1.ViewerContext(companionProvider);
|
|
60
|
+
const args = {};
|
|
61
|
+
const getFn = globals_1.jest.fn(async (_vc, _args, _queryContext) => {
|
|
62
|
+
return null;
|
|
63
|
+
});
|
|
64
|
+
const createFn = globals_1.jest.fn(async (vc, _args, queryContext) => {
|
|
65
|
+
return await SimpleTestEntity_1.SimpleTestEntity.creator(vc, queryContext).createAsync();
|
|
66
|
+
});
|
|
67
|
+
if (inTransaction) {
|
|
68
|
+
await viewerContext.runInTransactionForDatabaseAdaptorFlavorAsync('postgres', async (queryContext) => {
|
|
69
|
+
await (0, EntityCreationUtils_1.createWithUniqueConstraintRecoveryAsync)(viewerContext, SimpleTestEntity_1.SimpleTestEntity, getFn, args, createFn, args, queryContext);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
await (0, EntityCreationUtils_1.createWithUniqueConstraintRecoveryAsync)(viewerContext, SimpleTestEntity_1.SimpleTestEntity, getFn, args, createFn, args);
|
|
74
|
+
}
|
|
75
|
+
(0, globals_1.expect)(getFn).toHaveBeenCalledTimes(0);
|
|
76
|
+
(0, globals_1.expect)(createFn).toHaveBeenCalledTimes(1);
|
|
77
|
+
});
|
|
78
|
+
(0, globals_1.it)('calls get when database adapter throws EntityDatabaseAdapterUniqueConstraintError', async () => {
|
|
79
|
+
const companionProvider = (0, createUnitTestEntityCompanionProvider_1.createUnitTestEntityCompanionProvider)();
|
|
80
|
+
const viewerContext = new ViewerContext_1.ViewerContext(companionProvider);
|
|
81
|
+
const entity = await SimpleTestEntity_1.SimpleTestEntity.creator(viewerContext).createAsync();
|
|
82
|
+
const args = {};
|
|
83
|
+
const getFn = globals_1.jest.fn(async (_vc, _args, _queryContext) => {
|
|
84
|
+
return entity;
|
|
85
|
+
});
|
|
86
|
+
const createFn = globals_1.jest.fn(async (_vc, _args, _queryContext) => {
|
|
87
|
+
throw new EntityDatabaseAdapterError_1.EntityDatabaseAdapterUniqueConstraintError('wat');
|
|
88
|
+
});
|
|
89
|
+
if (inTransaction) {
|
|
90
|
+
await viewerContext.runInTransactionForDatabaseAdaptorFlavorAsync('postgres', async (queryContext) => {
|
|
91
|
+
await (0, EntityCreationUtils_1.createWithUniqueConstraintRecoveryAsync)(viewerContext, SimpleTestEntity_1.SimpleTestEntity, getFn, args, createFn, args, queryContext);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
await (0, EntityCreationUtils_1.createWithUniqueConstraintRecoveryAsync)(viewerContext, SimpleTestEntity_1.SimpleTestEntity, getFn, args, createFn, args);
|
|
96
|
+
}
|
|
97
|
+
(0, globals_1.expect)(getFn).toHaveBeenCalledTimes(1);
|
|
98
|
+
(0, globals_1.expect)(createFn).toHaveBeenCalledTimes(1);
|
|
99
|
+
});
|
|
100
|
+
(0, globals_1.it)('throws an EntityNotFoundError when database adapter throws EntityDatabaseAdapterUniqueConstraintError and getFn returns null', async () => {
|
|
101
|
+
const companionProvider = (0, createUnitTestEntityCompanionProvider_1.createUnitTestEntityCompanionProvider)();
|
|
102
|
+
const viewerContext = new ViewerContext_1.ViewerContext(companionProvider);
|
|
103
|
+
const args = {};
|
|
104
|
+
const getFn = globals_1.jest.fn(async (_vc, _args, _queryContext) => {
|
|
105
|
+
return null;
|
|
106
|
+
});
|
|
107
|
+
const createFn = globals_1.jest.fn(async (_vc, _args, _queryContext) => {
|
|
108
|
+
throw new EntityDatabaseAdapterError_1.EntityDatabaseAdapterUniqueConstraintError('wat');
|
|
109
|
+
});
|
|
110
|
+
if (inTransaction) {
|
|
111
|
+
await (0, globals_1.expect)(viewerContext.runInTransactionForDatabaseAdaptorFlavorAsync('postgres', async (queryContext) => {
|
|
112
|
+
return await (0, EntityCreationUtils_1.createWithUniqueConstraintRecoveryAsync)(viewerContext, SimpleTestEntity_1.SimpleTestEntity, getFn, args, createFn, args, queryContext);
|
|
113
|
+
})).rejects.toThrow(EntityNotFoundError_1.EntityNotFoundError);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
await (0, globals_1.expect)((0, EntityCreationUtils_1.createWithUniqueConstraintRecoveryAsync)(viewerContext, SimpleTestEntity_1.SimpleTestEntity, getFn, args, createFn, args)).rejects.toThrow(EntityNotFoundError_1.EntityNotFoundError);
|
|
117
|
+
}
|
|
118
|
+
(0, globals_1.expect)(getFn).toHaveBeenCalledTimes(1);
|
|
119
|
+
(0, globals_1.expect)(createFn).toHaveBeenCalledTimes(1);
|
|
120
|
+
});
|
|
121
|
+
(0, globals_1.it)('rethrows whatever error is thrown from database adapter if not EntityDatabaseAdapterUniqueConstraintError', async () => {
|
|
122
|
+
const companionProvider = (0, createUnitTestEntityCompanionProvider_1.createUnitTestEntityCompanionProvider)();
|
|
123
|
+
const viewerContext = new ViewerContext_1.ViewerContext(companionProvider);
|
|
124
|
+
const args = {};
|
|
125
|
+
const getFn = globals_1.jest.fn(async (_vc, _args, _queryContext) => {
|
|
126
|
+
return null;
|
|
127
|
+
});
|
|
128
|
+
const createFn = globals_1.jest.fn(async (_vc, _args, _queryContext) => {
|
|
129
|
+
throw new Error('wat');
|
|
130
|
+
});
|
|
131
|
+
if (inTransaction) {
|
|
132
|
+
await (0, globals_1.expect)(viewerContext.runInTransactionForDatabaseAdaptorFlavorAsync('postgres', async (queryContext) => {
|
|
133
|
+
return await (0, EntityCreationUtils_1.createWithUniqueConstraintRecoveryAsync)(viewerContext, SimpleTestEntity_1.SimpleTestEntity, getFn, args, createFn, args, queryContext);
|
|
134
|
+
})).rejects.toThrow('wat');
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
await (0, globals_1.expect)((0, EntityCreationUtils_1.createWithUniqueConstraintRecoveryAsync)(viewerContext, SimpleTestEntity_1.SimpleTestEntity, getFn, args, createFn, args)).rejects.toThrow('wat');
|
|
138
|
+
}
|
|
139
|
+
(0, globals_1.expect)(getFn).toHaveBeenCalledTimes(0);
|
|
140
|
+
(0, globals_1.expect)(createFn).toHaveBeenCalledTimes(1);
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
//# sourceMappingURL=EntityCreationUtils-test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityCreationUtils-test.js","sourceRoot":"","sources":["../../../../src/utils/__tests__/EntityCreationUtils-test.ts"],"names":[],"mappings":";;AAAA,2CAA2D;AAG3D,uDAAoD;AACpD,wFAAqG;AACrG,0EAAuE;AACvE,gEAGgC;AAChC,2EAAwE;AACxE,qHAAkH;AAIlH,kBAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,mBAAmB,EAAE,CAAC,aAAa,EAAE,EAAE;IAClE,IAAA,kBAAQ,EAAC,8CAAwB,EAAE,GAAG,EAAE;QACtC,IAAA,YAAE,EAAC,qCAAqC,EAAE,KAAK,IAAI,EAAE;YACnD,MAAM,iBAAiB,GAAG,IAAA,6EAAqC,GAAE,CAAC;YAClE,MAAM,aAAa,GAAG,IAAI,6BAAa,CAAC,iBAAiB,CAAC,CAAC;YAE3D,MAAM,MAAM,GAAG,MAAM,mCAAgB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,WAAW,EAAE,CAAC;YAE3E,MAAM,IAAI,GAAU,EAAE,CAAC;YAEvB,MAAM,KAAK,GAAG,cAAI,CAAC,EAAE,CACnB,KAAK,EACH,GAAkB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