@expo/entity 0.59.0 → 0.61.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 -8
- package/build/src/EntityInvalidationUtils.js +4 -9
- package/build/src/EntityLoader.d.ts +7 -7
- package/build/src/EntityLoader.js +3 -8
- package/build/src/EntityLoaderFactory.d.ts +10 -10
- 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 +9 -9
- 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 +8 -8
- 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 +7 -6
- 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 +10 -10
- package/src/EntityLoader.ts +7 -7
- package/src/EntityLoaderFactory.ts +13 -10
- 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 +11 -11
- package/src/ViewerContext.ts +8 -8
- package/src/ViewerScopedEntityCompanion.ts +8 -8
- package/src/ViewerScopedEntityCompanionProvider.ts +6 -6
- package/src/ViewerScopedEntityLoaderFactory.ts +11 -8
- 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 -18
- 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
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EntityInvalidFieldValueError = void 0;
|
|
4
|
-
const EntityError_1 = require("./EntityError");
|
|
1
|
+
import { EntityError, EntityErrorCode, EntityErrorState } from "./EntityError.js";
|
|
5
2
|
/**
|
|
6
3
|
* Error thrown when an entity field has an invalid value, either during load or mutation.
|
|
7
4
|
*/
|
|
8
|
-
class EntityInvalidFieldValueError extends
|
|
5
|
+
export class EntityInvalidFieldValueError extends EntityError {
|
|
9
6
|
static {
|
|
10
7
|
this.prototype.name = 'EntityInvalidFieldValueError';
|
|
11
8
|
}
|
|
12
9
|
get state() {
|
|
13
|
-
return
|
|
10
|
+
return EntityErrorState.PERMANENT;
|
|
14
11
|
}
|
|
15
12
|
get code() {
|
|
16
|
-
return
|
|
13
|
+
return EntityErrorCode.ERR_ENTITY_INVALID_FIELD_VALUE;
|
|
17
14
|
}
|
|
18
15
|
constructor(entityClass, fieldName, fieldValue) {
|
|
19
16
|
super(`Entity field not valid: ${entityClass.name} (${String(fieldName)} = ${fieldValue})`);
|
|
20
17
|
}
|
|
21
18
|
}
|
|
22
|
-
exports.EntityInvalidFieldValueError = EntityInvalidFieldValueError;
|
|
23
|
-
//# sourceMappingURL=EntityInvalidFieldValueError.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { EntityAuthorizationAction } from '../EntityPrivacyPolicy';
|
|
2
|
-
import { ReadonlyEntity } from '../ReadonlyEntity';
|
|
3
|
-
import { ViewerContext } from '../ViewerContext';
|
|
4
|
-
import { EntityError, EntityErrorCode, EntityErrorState } from './EntityError';
|
|
1
|
+
import { EntityAuthorizationAction } from '../EntityPrivacyPolicy.ts';
|
|
2
|
+
import type { ReadonlyEntity } from '../ReadonlyEntity.ts';
|
|
3
|
+
import type { ViewerContext } from '../ViewerContext.ts';
|
|
4
|
+
import { EntityError, EntityErrorCode, EntityErrorState } from './EntityError.ts';
|
|
5
5
|
/**
|
|
6
6
|
* Error thrown when viewer context is not authorized to perform an action on an entity.
|
|
7
7
|
*/
|
|
@@ -1,26 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.EntityNotAuthorizedError = void 0;
|
|
4
|
-
const EntityPrivacyPolicy_1 = require("../EntityPrivacyPolicy");
|
|
5
|
-
const EntityError_1 = require("./EntityError");
|
|
1
|
+
import { EntityAuthorizationAction } from "../EntityPrivacyPolicy.js";
|
|
2
|
+
import { EntityError, EntityErrorCode, EntityErrorState } from "./EntityError.js";
|
|
6
3
|
/**
|
|
7
4
|
* Error thrown when viewer context is not authorized to perform an action on an entity.
|
|
8
5
|
*/
|
|
9
|
-
class EntityNotAuthorizedError extends
|
|
6
|
+
export class EntityNotAuthorizedError extends EntityError {
|
|
10
7
|
static {
|
|
11
8
|
this.prototype.name = 'EntityNotAuthorizedError';
|
|
12
9
|
}
|
|
13
10
|
get state() {
|
|
14
|
-
return
|
|
11
|
+
return EntityErrorState.PERMANENT;
|
|
15
12
|
}
|
|
16
13
|
get code() {
|
|
17
|
-
return
|
|
14
|
+
return EntityErrorCode.ERR_ENTITY_NOT_AUTHORIZED;
|
|
18
15
|
}
|
|
19
16
|
entityClassName;
|
|
20
17
|
constructor(entity, viewerContext, action, ruleIndex) {
|
|
21
|
-
super(`Entity not authorized: ${entity} (viewer = ${viewerContext}, action = ${
|
|
18
|
+
super(`Entity not authorized: ${entity} (viewer = ${viewerContext}, action = ${EntityAuthorizationAction[action]}, ruleIndex = ${ruleIndex})`);
|
|
22
19
|
this.entityClassName = entity.constructor.name;
|
|
23
20
|
}
|
|
24
21
|
}
|
|
25
|
-
exports.EntityNotAuthorizedError = EntityNotAuthorizedError;
|
|
26
|
-
//# sourceMappingURL=EntityNotAuthorizedError.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IEntityClass } from '../Entity';
|
|
2
|
-
import { EntityPrivacyPolicy } from '../EntityPrivacyPolicy';
|
|
3
|
-
import { ReadonlyEntity } from '../ReadonlyEntity';
|
|
4
|
-
import { ViewerContext } from '../ViewerContext';
|
|
5
|
-
import { EntityError, EntityErrorCode, EntityErrorState } from './EntityError';
|
|
1
|
+
import type { IEntityClass } from '../Entity.ts';
|
|
2
|
+
import type { EntityPrivacyPolicy } from '../EntityPrivacyPolicy.ts';
|
|
3
|
+
import type { ReadonlyEntity } from '../ReadonlyEntity.ts';
|
|
4
|
+
import type { ViewerContext } from '../ViewerContext.ts';
|
|
5
|
+
import { EntityError, EntityErrorCode, EntityErrorState } from './EntityError.ts';
|
|
6
6
|
type EntityNotFoundOptions<TFields extends Record<string, any>, TIDField extends keyof NonNullable<Pick<TFields, TSelectedFields>>, TViewerContext extends ViewerContext, TEntity extends ReadonlyEntity<TFields, TIDField, TViewerContext, TSelectedFields>, TPrivacyPolicy extends EntityPrivacyPolicy<TFields, TIDField, TViewerContext, TEntity, TSelectedFields>, N extends keyof TFields, TSelectedFields extends keyof TFields = keyof TFields> = {
|
|
7
7
|
entityClass: IEntityClass<TFields, TIDField, TViewerContext, TEntity, TPrivacyPolicy, TSelectedFields>;
|
|
8
8
|
fieldName: N;
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EntityNotFoundError = void 0;
|
|
4
|
-
const EntityError_1 = require("./EntityError");
|
|
1
|
+
import { EntityError, EntityErrorCode, EntityErrorState } from "./EntityError.js";
|
|
5
2
|
/**
|
|
6
3
|
* Error thrown when an entity is not found during certain load methods.
|
|
7
4
|
*/
|
|
8
|
-
class EntityNotFoundError extends
|
|
5
|
+
export class EntityNotFoundError extends EntityError {
|
|
9
6
|
static {
|
|
10
7
|
this.prototype.name = 'EntityNotFoundError';
|
|
11
8
|
}
|
|
12
9
|
get state() {
|
|
13
|
-
return
|
|
10
|
+
return EntityErrorState.PERMANENT;
|
|
14
11
|
}
|
|
15
12
|
get code() {
|
|
16
|
-
return
|
|
13
|
+
return EntityErrorCode.ERR_ENTITY_NOT_FOUND;
|
|
17
14
|
}
|
|
18
15
|
constructor(messageOrOptions) {
|
|
19
16
|
if (typeof messageOrOptions === 'string') {
|
|
@@ -24,5 +21,3 @@ class EntityNotFoundError extends EntityError_1.EntityError {
|
|
|
24
21
|
}
|
|
25
22
|
}
|
|
26
23
|
}
|
|
27
|
-
exports.EntityNotFoundError = EntityNotFoundError;
|
|
28
|
-
//# sourceMappingURL=EntityNotFoundError.js.map
|
package/build/src/index.d.ts
CHANGED
|
@@ -2,80 +2,80 @@
|
|
|
2
2
|
* @packageDocumentation
|
|
3
3
|
* @module @expo/entity
|
|
4
4
|
*/
|
|
5
|
-
export * from './AuthorizationResultBasedEntityAssociationLoader';
|
|
6
|
-
export * from './AuthorizationResultBasedEntityLoader';
|
|
7
|
-
export * from './AuthorizationResultBasedEntityMutator';
|
|
8
|
-
export * from './ComposedEntityCacheAdapter';
|
|
9
|
-
export * from './ComposedSecondaryEntityCache';
|
|
10
|
-
export * from './EnforcingEntityAssociationLoader';
|
|
11
|
-
export * from './EnforcingEntityCreator';
|
|
12
|
-
export * from './EnforcingEntityDeleter';
|
|
13
|
-
export * from './EnforcingEntityLoader';
|
|
14
|
-
export * from './EnforcingEntityUpdater';
|
|
15
|
-
export * from './Entity';
|
|
16
|
-
export * from './EntityAssociationLoader';
|
|
17
|
-
export * from './EntityCompanion';
|
|
18
|
-
export * from './EntityCompanionProvider';
|
|
19
|
-
export * from './EntityConfiguration';
|
|
20
|
-
export * from './EntityConstructionUtils';
|
|
21
|
-
export * from './EntityCreator';
|
|
22
|
-
export * from './EntityDatabaseAdapter';
|
|
23
|
-
export * from './EntityDeleter';
|
|
24
|
-
export * from './EntityFieldDefinition';
|
|
25
|
-
export * from './EntityFields';
|
|
26
|
-
export * from './EntityInvalidationUtils';
|
|
27
|
-
export * from './EntityLoader';
|
|
28
|
-
export * from './EntityLoaderFactory';
|
|
29
|
-
export * from './EntityMutationInfo';
|
|
30
|
-
export * from './EntityMutationTriggerConfiguration';
|
|
31
|
-
export * from './EntityMutationValidatorConfiguration';
|
|
32
|
-
export * from './EntityMutatorFactory';
|
|
33
|
-
export * from './EntityPrivacyPolicy';
|
|
34
|
-
export * from './EntityQueryContext';
|
|
35
|
-
export * from './EntityQueryContextProvider';
|
|
36
|
-
export * from './EntitySecondaryCacheLoader';
|
|
37
|
-
export * from './EntityUpdater';
|
|
38
|
-
export * from './entityUtils';
|
|
39
|
-
export * from './GenericEntityCacheAdapter';
|
|
40
|
-
export * from './GenericSecondaryEntityCache';
|
|
41
|
-
export * from './IEntityCacheAdapter';
|
|
42
|
-
export * from './IEntityCacheAdapterProvider';
|
|
43
|
-
export * from './IEntityDatabaseAdapterProvider';
|
|
44
|
-
export * from './IEntityGenericCacher';
|
|
45
|
-
export * from './ReadonlyEntity';
|
|
46
|
-
export * from './ViewerContext';
|
|
47
|
-
export * from './ViewerScopedEntityCompanion';
|
|
48
|
-
export * from './ViewerScopedEntityCompanionProvider';
|
|
49
|
-
export * from './ViewerScopedEntityLoaderFactory';
|
|
50
|
-
export * from './ViewerScopedEntityMutatorFactory';
|
|
51
|
-
export * from './errors/EntityCacheAdapterError';
|
|
52
|
-
export * from './errors/EntityDatabaseAdapterError';
|
|
53
|
-
export * from './errors/EntityError';
|
|
54
|
-
export * from './errors/EntityInvalidFieldValueError';
|
|
55
|
-
export * from './errors/EntityNotAuthorizedError';
|
|
56
|
-
export * from './errors/EntityNotFoundError';
|
|
57
|
-
export * from './internal/CompositeFieldHolder';
|
|
58
|
-
export * from './internal/CompositeFieldValueMap';
|
|
59
|
-
export * from './internal/EntityDataManager';
|
|
60
|
-
export * from './internal/EntityFieldTransformationUtils';
|
|
61
|
-
export * from './internal/EntityLoadInterfaces';
|
|
62
|
-
export * from './internal/EntityTableDataCoordinator';
|
|
63
|
-
export * from './internal/ReadThroughEntityCache';
|
|
64
|
-
export * from './internal/SingleFieldHolder';
|
|
65
|
-
export * from './metrics/EntityMetricsUtils';
|
|
66
|
-
export * from './metrics/IEntityMetricsAdapter';
|
|
67
|
-
export * from './metrics/NoOpEntityMetricsAdapter';
|
|
68
|
-
export * from './rules/AllowIfAllSubRulesAllowPrivacyPolicyRule';
|
|
69
|
-
export * from './rules/AllowIfAnySubRuleAllowsPrivacyPolicyRule';
|
|
70
|
-
export * from './rules/AllowIfInParentCascadeDeletionPrivacyPolicyRule';
|
|
71
|
-
export * from './rules/AlwaysAllowPrivacyPolicyRule';
|
|
72
|
-
export * from './rules/AlwaysDenyPrivacyPolicyRule';
|
|
73
|
-
export * from './rules/AlwaysSkipPrivacyPolicyRule';
|
|
74
|
-
export * from './rules/EvaluateIfEntityFieldPredicatePrivacyPolicyRule';
|
|
75
|
-
export * from './rules/PrivacyPolicyRule';
|
|
76
|
-
export * from './utils/EntityCreationUtils';
|
|
77
|
-
export * from './utils/EntityPrivacyUtils';
|
|
78
|
-
export * from './utils/mergeEntityMutationTriggerConfigurations';
|
|
79
|
-
export * from './utils/collections/maps';
|
|
80
|
-
export * from './utils/collections/SerializableKeyMap';
|
|
81
|
-
export * from './utils/collections/sets';
|
|
5
|
+
export * from './AuthorizationResultBasedEntityAssociationLoader.ts';
|
|
6
|
+
export * from './AuthorizationResultBasedEntityLoader.ts';
|
|
7
|
+
export * from './AuthorizationResultBasedEntityMutator.ts';
|
|
8
|
+
export * from './ComposedEntityCacheAdapter.ts';
|
|
9
|
+
export * from './ComposedSecondaryEntityCache.ts';
|
|
10
|
+
export * from './EnforcingEntityAssociationLoader.ts';
|
|
11
|
+
export * from './EnforcingEntityCreator.ts';
|
|
12
|
+
export * from './EnforcingEntityDeleter.ts';
|
|
13
|
+
export * from './EnforcingEntityLoader.ts';
|
|
14
|
+
export * from './EnforcingEntityUpdater.ts';
|
|
15
|
+
export * from './Entity.ts';
|
|
16
|
+
export * from './EntityAssociationLoader.ts';
|
|
17
|
+
export * from './EntityCompanion.ts';
|
|
18
|
+
export * from './EntityCompanionProvider.ts';
|
|
19
|
+
export * from './EntityConfiguration.ts';
|
|
20
|
+
export * from './EntityConstructionUtils.ts';
|
|
21
|
+
export * from './EntityCreator.ts';
|
|
22
|
+
export * from './EntityDatabaseAdapter.ts';
|
|
23
|
+
export * from './EntityDeleter.ts';
|
|
24
|
+
export * from './EntityFieldDefinition.ts';
|
|
25
|
+
export * from './EntityFields.ts';
|
|
26
|
+
export * from './EntityInvalidationUtils.ts';
|
|
27
|
+
export * from './EntityLoader.ts';
|
|
28
|
+
export * from './EntityLoaderFactory.ts';
|
|
29
|
+
export * from './EntityMutationInfo.ts';
|
|
30
|
+
export * from './EntityMutationTriggerConfiguration.ts';
|
|
31
|
+
export * from './EntityMutationValidatorConfiguration.ts';
|
|
32
|
+
export * from './EntityMutatorFactory.ts';
|
|
33
|
+
export * from './EntityPrivacyPolicy.ts';
|
|
34
|
+
export * from './EntityQueryContext.ts';
|
|
35
|
+
export * from './EntityQueryContextProvider.ts';
|
|
36
|
+
export * from './EntitySecondaryCacheLoader.ts';
|
|
37
|
+
export * from './EntityUpdater.ts';
|
|
38
|
+
export * from './entityUtils.ts';
|
|
39
|
+
export * from './GenericEntityCacheAdapter.ts';
|
|
40
|
+
export * from './GenericSecondaryEntityCache.ts';
|
|
41
|
+
export * from './IEntityCacheAdapter.ts';
|
|
42
|
+
export * from './IEntityCacheAdapterProvider.ts';
|
|
43
|
+
export * from './IEntityDatabaseAdapterProvider.ts';
|
|
44
|
+
export * from './IEntityGenericCacher.ts';
|
|
45
|
+
export * from './ReadonlyEntity.ts';
|
|
46
|
+
export * from './ViewerContext.ts';
|
|
47
|
+
export * from './ViewerScopedEntityCompanion.ts';
|
|
48
|
+
export * from './ViewerScopedEntityCompanionProvider.ts';
|
|
49
|
+
export * from './ViewerScopedEntityLoaderFactory.ts';
|
|
50
|
+
export * from './ViewerScopedEntityMutatorFactory.ts';
|
|
51
|
+
export * from './errors/EntityCacheAdapterError.ts';
|
|
52
|
+
export * from './errors/EntityDatabaseAdapterError.ts';
|
|
53
|
+
export * from './errors/EntityError.ts';
|
|
54
|
+
export * from './errors/EntityInvalidFieldValueError.ts';
|
|
55
|
+
export * from './errors/EntityNotAuthorizedError.ts';
|
|
56
|
+
export * from './errors/EntityNotFoundError.ts';
|
|
57
|
+
export * from './internal/CompositeFieldHolder.ts';
|
|
58
|
+
export * from './internal/CompositeFieldValueMap.ts';
|
|
59
|
+
export * from './internal/EntityDataManager.ts';
|
|
60
|
+
export * from './internal/EntityFieldTransformationUtils.ts';
|
|
61
|
+
export * from './internal/EntityLoadInterfaces.ts';
|
|
62
|
+
export * from './internal/EntityTableDataCoordinator.ts';
|
|
63
|
+
export * from './internal/ReadThroughEntityCache.ts';
|
|
64
|
+
export * from './internal/SingleFieldHolder.ts';
|
|
65
|
+
export * from './metrics/EntityMetricsUtils.ts';
|
|
66
|
+
export * from './metrics/IEntityMetricsAdapter.ts';
|
|
67
|
+
export * from './metrics/NoOpEntityMetricsAdapter.ts';
|
|
68
|
+
export * from './rules/AllowIfAllSubRulesAllowPrivacyPolicyRule.ts';
|
|
69
|
+
export * from './rules/AllowIfAnySubRuleAllowsPrivacyPolicyRule.ts';
|
|
70
|
+
export * from './rules/AllowIfInParentCascadeDeletionPrivacyPolicyRule.ts';
|
|
71
|
+
export * from './rules/AlwaysAllowPrivacyPolicyRule.ts';
|
|
72
|
+
export * from './rules/AlwaysDenyPrivacyPolicyRule.ts';
|
|
73
|
+
export * from './rules/AlwaysSkipPrivacyPolicyRule.ts';
|
|
74
|
+
export * from './rules/EvaluateIfEntityFieldPredicatePrivacyPolicyRule.ts';
|
|
75
|
+
export * from './rules/PrivacyPolicyRule.ts';
|
|
76
|
+
export * from './utils/EntityCreationUtils.ts';
|
|
77
|
+
export * from './utils/EntityPrivacyUtils.ts';
|
|
78
|
+
export * from './utils/mergeEntityMutationTriggerConfigurations.ts';
|
|
79
|
+
export * from './utils/collections/maps.ts';
|
|
80
|
+
export * from './utils/collections/SerializableKeyMap.ts';
|
|
81
|
+
export * from './utils/collections/sets.ts';
|
package/build/src/index.js
CHANGED
|
@@ -1,99 +1,82 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/* eslint-disable tsdoc/syntax */
|
|
3
2
|
/**
|
|
4
3
|
* @packageDocumentation
|
|
5
4
|
* @module @expo/entity
|
|
6
5
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
__exportStar(require("./metrics/NoOpEntityMetricsAdapter"), exports);
|
|
85
|
-
__exportStar(require("./rules/AllowIfAllSubRulesAllowPrivacyPolicyRule"), exports);
|
|
86
|
-
__exportStar(require("./rules/AllowIfAnySubRuleAllowsPrivacyPolicyRule"), exports);
|
|
87
|
-
__exportStar(require("./rules/AllowIfInParentCascadeDeletionPrivacyPolicyRule"), exports);
|
|
88
|
-
__exportStar(require("./rules/AlwaysAllowPrivacyPolicyRule"), exports);
|
|
89
|
-
__exportStar(require("./rules/AlwaysDenyPrivacyPolicyRule"), exports);
|
|
90
|
-
__exportStar(require("./rules/AlwaysSkipPrivacyPolicyRule"), exports);
|
|
91
|
-
__exportStar(require("./rules/EvaluateIfEntityFieldPredicatePrivacyPolicyRule"), exports);
|
|
92
|
-
__exportStar(require("./rules/PrivacyPolicyRule"), exports);
|
|
93
|
-
__exportStar(require("./utils/EntityCreationUtils"), exports);
|
|
94
|
-
__exportStar(require("./utils/EntityPrivacyUtils"), exports);
|
|
95
|
-
__exportStar(require("./utils/mergeEntityMutationTriggerConfigurations"), exports);
|
|
96
|
-
__exportStar(require("./utils/collections/maps"), exports);
|
|
97
|
-
__exportStar(require("./utils/collections/SerializableKeyMap"), exports);
|
|
98
|
-
__exportStar(require("./utils/collections/sets"), exports);
|
|
99
|
-
//# sourceMappingURL=index.js.map
|
|
6
|
+
export * from "./AuthorizationResultBasedEntityAssociationLoader.js";
|
|
7
|
+
export * from "./AuthorizationResultBasedEntityLoader.js";
|
|
8
|
+
export * from "./AuthorizationResultBasedEntityMutator.js";
|
|
9
|
+
export * from "./ComposedEntityCacheAdapter.js";
|
|
10
|
+
export * from "./ComposedSecondaryEntityCache.js";
|
|
11
|
+
export * from "./EnforcingEntityAssociationLoader.js";
|
|
12
|
+
export * from "./EnforcingEntityCreator.js";
|
|
13
|
+
export * from "./EnforcingEntityDeleter.js";
|
|
14
|
+
export * from "./EnforcingEntityLoader.js";
|
|
15
|
+
export * from "./EnforcingEntityUpdater.js";
|
|
16
|
+
export * from "./Entity.js";
|
|
17
|
+
export * from "./EntityAssociationLoader.js";
|
|
18
|
+
export * from "./EntityCompanion.js";
|
|
19
|
+
export * from "./EntityCompanionProvider.js";
|
|
20
|
+
export * from "./EntityConfiguration.js";
|
|
21
|
+
export * from "./EntityConstructionUtils.js";
|
|
22
|
+
export * from "./EntityCreator.js";
|
|
23
|
+
export * from "./EntityDatabaseAdapter.js";
|
|
24
|
+
export * from "./EntityDeleter.js";
|
|
25
|
+
export * from "./EntityFieldDefinition.js";
|
|
26
|
+
export * from "./EntityFields.js";
|
|
27
|
+
export * from "./EntityInvalidationUtils.js";
|
|
28
|
+
export * from "./EntityLoader.js";
|
|
29
|
+
export * from "./EntityLoaderFactory.js";
|
|
30
|
+
export * from "./EntityMutationInfo.js";
|
|
31
|
+
export * from "./EntityMutationTriggerConfiguration.js";
|
|
32
|
+
export * from "./EntityMutationValidatorConfiguration.js";
|
|
33
|
+
export * from "./EntityMutatorFactory.js";
|
|
34
|
+
export * from "./EntityPrivacyPolicy.js";
|
|
35
|
+
export * from "./EntityQueryContext.js";
|
|
36
|
+
export * from "./EntityQueryContextProvider.js";
|
|
37
|
+
export * from "./EntitySecondaryCacheLoader.js";
|
|
38
|
+
export * from "./EntityUpdater.js";
|
|
39
|
+
export * from "./entityUtils.js";
|
|
40
|
+
export * from "./GenericEntityCacheAdapter.js";
|
|
41
|
+
export * from "./GenericSecondaryEntityCache.js";
|
|
42
|
+
export * from "./IEntityCacheAdapter.js";
|
|
43
|
+
export * from "./IEntityCacheAdapterProvider.js";
|
|
44
|
+
export * from "./IEntityDatabaseAdapterProvider.js";
|
|
45
|
+
export * from "./IEntityGenericCacher.js";
|
|
46
|
+
export * from "./ReadonlyEntity.js";
|
|
47
|
+
export * from "./ViewerContext.js";
|
|
48
|
+
export * from "./ViewerScopedEntityCompanion.js";
|
|
49
|
+
export * from "./ViewerScopedEntityCompanionProvider.js";
|
|
50
|
+
export * from "./ViewerScopedEntityLoaderFactory.js";
|
|
51
|
+
export * from "./ViewerScopedEntityMutatorFactory.js";
|
|
52
|
+
export * from "./errors/EntityCacheAdapterError.js";
|
|
53
|
+
export * from "./errors/EntityDatabaseAdapterError.js";
|
|
54
|
+
export * from "./errors/EntityError.js";
|
|
55
|
+
export * from "./errors/EntityInvalidFieldValueError.js";
|
|
56
|
+
export * from "./errors/EntityNotAuthorizedError.js";
|
|
57
|
+
export * from "./errors/EntityNotFoundError.js";
|
|
58
|
+
export * from "./internal/CompositeFieldHolder.js";
|
|
59
|
+
export * from "./internal/CompositeFieldValueMap.js";
|
|
60
|
+
export * from "./internal/EntityDataManager.js";
|
|
61
|
+
export * from "./internal/EntityFieldTransformationUtils.js";
|
|
62
|
+
export * from "./internal/EntityLoadInterfaces.js";
|
|
63
|
+
export * from "./internal/EntityTableDataCoordinator.js";
|
|
64
|
+
export * from "./internal/ReadThroughEntityCache.js";
|
|
65
|
+
export * from "./internal/SingleFieldHolder.js";
|
|
66
|
+
export * from "./metrics/EntityMetricsUtils.js";
|
|
67
|
+
export * from "./metrics/IEntityMetricsAdapter.js";
|
|
68
|
+
export * from "./metrics/NoOpEntityMetricsAdapter.js";
|
|
69
|
+
export * from "./rules/AllowIfAllSubRulesAllowPrivacyPolicyRule.js";
|
|
70
|
+
export * from "./rules/AllowIfAnySubRuleAllowsPrivacyPolicyRule.js";
|
|
71
|
+
export * from "./rules/AllowIfInParentCascadeDeletionPrivacyPolicyRule.js";
|
|
72
|
+
export * from "./rules/AlwaysAllowPrivacyPolicyRule.js";
|
|
73
|
+
export * from "./rules/AlwaysDenyPrivacyPolicyRule.js";
|
|
74
|
+
export * from "./rules/AlwaysSkipPrivacyPolicyRule.js";
|
|
75
|
+
export * from "./rules/EvaluateIfEntityFieldPredicatePrivacyPolicyRule.js";
|
|
76
|
+
export * from "./rules/PrivacyPolicyRule.js";
|
|
77
|
+
export * from "./utils/EntityCreationUtils.js";
|
|
78
|
+
export * from "./utils/EntityPrivacyUtils.js";
|
|
79
|
+
export * from "./utils/mergeEntityMutationTriggerConfigurations.js";
|
|
80
|
+
export * from "./utils/collections/maps.js";
|
|
81
|
+
export * from "./utils/collections/SerializableKeyMap.js";
|
|
82
|
+
export * from "./utils/collections/sets.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { EntityCompositeField, EntityCompositeFieldValue, EntityConfiguration } from '../EntityConfiguration';
|
|
2
|
-
import {
|
|
1
|
+
import type { EntityCompositeField, EntityCompositeFieldValue, EntityConfiguration } from '../EntityConfiguration.ts';
|
|
2
|
+
import type { IEntityLoadKey, IEntityLoadValue } from '../internal/EntityLoadInterfaces.ts';
|
|
3
|
+
import { EntityLoadMethodType, LoadValueMap } from '../internal/EntityLoadInterfaces.ts';
|
|
3
4
|
declare const CompositeFieldHolderSerializedBrand: unique symbol;
|
|
4
5
|
/**
|
|
5
6
|
* @internal
|
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.CompositeFieldValueHolderMap = exports.CompositeFieldValueHolder = exports.CompositeFieldHolder = void 0;
|
|
7
|
-
const invariant_1 = __importDefault(require("invariant"));
|
|
8
|
-
const entityUtils_1 = require("../entityUtils");
|
|
9
|
-
const EntityFieldTransformationUtils_1 = require("./EntityFieldTransformationUtils");
|
|
10
|
-
const EntityLoadInterfaces_1 = require("../internal/EntityLoadInterfaces");
|
|
1
|
+
import invariant from 'invariant';
|
|
2
|
+
import { pick } from "../entityUtils.js";
|
|
3
|
+
import { getDatabaseFieldForEntityField } from "./EntityFieldTransformationUtils.js";
|
|
4
|
+
import { EntityLoadMethodType, LoadValueMap } from "../internal/EntityLoadInterfaces.js";
|
|
11
5
|
/**
|
|
12
6
|
* A load key that represents a composite field (set of fieldName) on an entity.
|
|
13
7
|
* Must be defined in the entity configuration composite field definition.
|
|
14
8
|
*
|
|
15
9
|
* @internal
|
|
16
10
|
*/
|
|
17
|
-
class CompositeFieldHolder {
|
|
11
|
+
export class CompositeFieldHolder {
|
|
18
12
|
compositeField;
|
|
19
13
|
constructor(compositeFieldInput) {
|
|
20
14
|
this.compositeField = [...compositeFieldInput].sort();
|
|
@@ -26,7 +20,7 @@ class CompositeFieldHolder {
|
|
|
26
20
|
return new Set(this.compositeField);
|
|
27
21
|
}
|
|
28
22
|
extractCompositeFieldValueHolderFromObjectFields(objectFields) {
|
|
29
|
-
const selection =
|
|
23
|
+
const selection = pick(objectFields, this.compositeField);
|
|
30
24
|
if (Object.values(selection).some((value) => value === undefined || value === null)) {
|
|
31
25
|
return null;
|
|
32
26
|
}
|
|
@@ -39,7 +33,7 @@ class CompositeFieldHolder {
|
|
|
39
33
|
return entityConfiguration.compositeFieldInfo.canCacheCompositeField(this.compositeField);
|
|
40
34
|
}
|
|
41
35
|
getDatabaseColumns(entityConfiguration) {
|
|
42
|
-
return this.compositeField.map((fieldName) =>
|
|
36
|
+
return this.compositeField.map((fieldName) => getDatabaseFieldForEntityField(entityConfiguration, fieldName));
|
|
43
37
|
}
|
|
44
38
|
getDatabaseValues(value) {
|
|
45
39
|
return this.compositeField.map((fieldName) => value.compositeFieldValue[fieldName]);
|
|
@@ -50,14 +44,14 @@ class CompositeFieldHolder {
|
|
|
50
44
|
createCacheKeyPartsForLoadValue(entityConfiguration, value) {
|
|
51
45
|
const columnNames = this.compositeField.map((fieldName) => {
|
|
52
46
|
const columnName = entityConfiguration.entityToDBFieldsKeyMapping.get(fieldName);
|
|
53
|
-
(
|
|
47
|
+
invariant(columnName, `database field mapping missing for ${String(fieldName)}`);
|
|
54
48
|
return columnName;
|
|
55
49
|
});
|
|
56
50
|
const compositeFieldValues = this.compositeField.map((fieldName) => value.compositeFieldValue[fieldName]);
|
|
57
51
|
return [...columnNames, ...compositeFieldValues.map((value) => String(value))];
|
|
58
52
|
}
|
|
59
53
|
getLoadMethodType() {
|
|
60
|
-
return
|
|
54
|
+
return EntityLoadMethodType.COMPOSITE;
|
|
61
55
|
}
|
|
62
56
|
getDataManagerDataLoaderKey() {
|
|
63
57
|
return this.serialize();
|
|
@@ -79,13 +73,12 @@ class CompositeFieldHolder {
|
|
|
79
73
|
return new CompositeFieldValueHolderMap();
|
|
80
74
|
}
|
|
81
75
|
}
|
|
82
|
-
exports.CompositeFieldHolder = CompositeFieldHolder;
|
|
83
76
|
/**
|
|
84
77
|
* A load value for a CompositeFieldHolder.
|
|
85
78
|
*
|
|
86
79
|
* @internal
|
|
87
80
|
*/
|
|
88
|
-
class CompositeFieldValueHolder {
|
|
81
|
+
export class CompositeFieldValueHolder {
|
|
89
82
|
compositeFieldValue;
|
|
90
83
|
constructor(compositeFieldValue) {
|
|
91
84
|
this.compositeFieldValue = compositeFieldValue;
|
|
@@ -110,14 +103,11 @@ class CompositeFieldValueHolder {
|
|
|
110
103
|
return JSON.stringify(this.compositeFieldValue, Object.keys(this.compositeFieldValue).sort());
|
|
111
104
|
}
|
|
112
105
|
}
|
|
113
|
-
exports.CompositeFieldValueHolder = CompositeFieldValueHolder;
|
|
114
106
|
/**
|
|
115
107
|
* @internal
|
|
116
108
|
*/
|
|
117
|
-
class CompositeFieldValueHolderMap extends
|
|
109
|
+
export class CompositeFieldValueHolderMap extends LoadValueMap {
|
|
118
110
|
deserializeKey(serializedKey) {
|
|
119
111
|
return CompositeFieldValueHolder.deserialize(serializedKey);
|
|
120
112
|
}
|
|
121
113
|
}
|
|
122
|
-
exports.CompositeFieldValueHolderMap = CompositeFieldValueHolderMap;
|
|
123
|
-
//# sourceMappingURL=CompositeFieldHolder.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EntityCompositeField, EntityCompositeFieldValue } from '../EntityConfiguration';
|
|
2
|
-
import { CompositeFieldValueHolder } from './CompositeFieldHolder';
|
|
1
|
+
import type { EntityCompositeField, EntityCompositeFieldValue } from '../EntityConfiguration.ts';
|
|
2
|
+
import { CompositeFieldValueHolder } from './CompositeFieldHolder.ts';
|
|
3
3
|
/**
|
|
4
4
|
* @internal
|
|
5
5
|
*/
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CompositeFieldValueMap = void 0;
|
|
4
|
-
const CompositeFieldHolder_1 = require("./CompositeFieldHolder");
|
|
1
|
+
import { CompositeFieldValueHolder } from "./CompositeFieldHolder.js";
|
|
5
2
|
/**
|
|
6
3
|
* @internal
|
|
7
4
|
*/
|
|
8
|
-
class CompositeFieldValueMap {
|
|
5
|
+
export class CompositeFieldValueMap {
|
|
9
6
|
map;
|
|
10
7
|
constructor(entries) {
|
|
11
8
|
const map = new Map();
|
|
@@ -15,14 +12,14 @@ class CompositeFieldValueMap {
|
|
|
15
12
|
this.map = map;
|
|
16
13
|
}
|
|
17
14
|
get(compositeFieldValue) {
|
|
18
|
-
return this.map.get(new
|
|
15
|
+
return this.map.get(new CompositeFieldValueHolder(compositeFieldValue).serialize());
|
|
19
16
|
}
|
|
20
17
|
has(compositeFieldValue) {
|
|
21
|
-
return this.map.has(new
|
|
18
|
+
return this.map.has(new CompositeFieldValueHolder(compositeFieldValue).serialize());
|
|
22
19
|
}
|
|
23
20
|
forEach(callbackfn, thisArg) {
|
|
24
21
|
this.map.forEach((value, key) => {
|
|
25
|
-
callbackfn.call(thisArg, value,
|
|
22
|
+
callbackfn.call(thisArg, value, CompositeFieldValueHolder.deserialize(key).compositeFieldValue, this);
|
|
26
23
|
});
|
|
27
24
|
}
|
|
28
25
|
get size() {
|
|
@@ -30,12 +27,12 @@ class CompositeFieldValueMap {
|
|
|
30
27
|
}
|
|
31
28
|
*entries() {
|
|
32
29
|
for (const [key, value] of this.map.entries()) {
|
|
33
|
-
yield [
|
|
30
|
+
yield [CompositeFieldValueHolder.deserialize(key).compositeFieldValue, value];
|
|
34
31
|
}
|
|
35
32
|
}
|
|
36
33
|
*keys() {
|
|
37
34
|
for (const key of this.map.keys()) {
|
|
38
|
-
yield
|
|
35
|
+
yield CompositeFieldValueHolder.deserialize(key).compositeFieldValue;
|
|
39
36
|
}
|
|
40
37
|
}
|
|
41
38
|
*values() {
|
|
@@ -50,5 +47,3 @@ class CompositeFieldValueMap {
|
|
|
50
47
|
return 'CompositeFieldValueMap';
|
|
51
48
|
}
|
|
52
49
|
}
|
|
53
|
-
exports.CompositeFieldValueMap = CompositeFieldValueMap;
|
|
54
|
-
//# sourceMappingURL=CompositeFieldValueMap.js.map
|