@expo/entity 0.35.0 → 0.37.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/AuthorizationResultBasedEntityLoader.d.ts +128 -0
- package/build/AuthorizationResultBasedEntityLoader.js +196 -0
- package/build/AuthorizationResultBasedEntityLoader.js.map +1 -0
- package/build/ComposedEntityCacheAdapter.js +1 -0
- package/build/ComposedEntityCacheAdapter.js.map +1 -1
- package/build/ComposedSecondaryEntityCache.js +1 -0
- package/build/ComposedSecondaryEntityCache.js.map +1 -1
- package/build/EnforcingEntityLoader.d.ts +5 -4
- package/build/EnforcingEntityLoader.js +4 -2
- package/build/EnforcingEntityLoader.js.map +1 -1
- package/build/Entity.d.ts +0 -27
- package/build/Entity.js +0 -50
- package/build/Entity.js.map +1 -1
- package/build/EntityAssociationLoader.d.ts +1 -1
- package/build/EntityAssociationLoader.js +17 -8
- package/build/EntityAssociationLoader.js.map +1 -1
- package/build/EntityCompanion.js +9 -1
- package/build/EntityCompanion.js.map +1 -1
- package/build/EntityCompanionProvider.d.ts +3 -1
- package/build/EntityCompanionProvider.js +10 -4
- package/build/EntityCompanionProvider.js.map +1 -1
- package/build/EntityConfiguration.d.ts +2 -1
- package/build/EntityConfiguration.js +19 -1
- package/build/EntityConfiguration.js.map +1 -1
- package/build/EntityDatabaseAdapter.d.ts +2 -2
- package/build/EntityDatabaseAdapter.js +5 -3
- package/build/EntityDatabaseAdapter.js.map +1 -1
- package/build/EntityFieldDefinition.d.ts +21 -10
- package/build/EntityFieldDefinition.js +8 -9
- package/build/EntityFieldDefinition.js.map +1 -1
- package/build/EntityFields.d.ts +10 -0
- package/build/EntityFields.js +15 -1
- package/build/EntityFields.js.map +1 -1
- package/build/EntityLoader.d.ts +12 -125
- package/build/EntityLoader.js +24 -239
- package/build/EntityLoader.js.map +1 -1
- package/build/EntityLoaderFactory.d.ts +1 -1
- package/build/EntityLoaderFactory.js +3 -0
- package/build/EntityLoaderFactory.js.map +1 -1
- package/build/EntityLoaderUtils.d.ts +58 -0
- package/build/EntityLoaderUtils.js +109 -0
- package/build/EntityLoaderUtils.js.map +1 -0
- package/build/EntityMutator.d.ts +1 -0
- package/build/EntityMutator.js +71 -56
- package/build/EntityMutator.js.map +1 -1
- package/build/EntityMutatorFactory.js +9 -0
- package/build/EntityMutatorFactory.js.map +1 -1
- package/build/EntityPrivacyPolicy.d.ts +11 -5
- package/build/EntityPrivacyPolicy.js +5 -7
- package/build/EntityPrivacyPolicy.js.map +1 -1
- package/build/EntityQueryContext.d.ts +2 -1
- package/build/EntityQueryContext.js +11 -6
- package/build/EntityQueryContext.js.map +1 -1
- package/build/EntitySecondaryCacheLoader.js +5 -1
- package/build/EntitySecondaryCacheLoader.js.map +1 -1
- package/build/GenericEntityCacheAdapter.js +1 -0
- package/build/GenericEntityCacheAdapter.js.map +1 -1
- package/build/GenericSecondaryEntityCache.js +2 -0
- package/build/GenericSecondaryEntityCache.js.map +1 -1
- package/build/IEntityCacheAdapterProvider.d.ts +1 -1
- package/build/IEntityDatabaseAdapterProvider.d.ts +1 -1
- package/build/ReadonlyEntity.js +5 -1
- package/build/ReadonlyEntity.js.map +1 -1
- package/build/ViewerContext.js +2 -0
- package/build/ViewerContext.js.map +1 -1
- package/build/ViewerScopedEntityCompanion.js +2 -0
- package/build/ViewerScopedEntityCompanion.js.map +1 -1
- package/build/ViewerScopedEntityCompanionProvider.d.ts +0 -1
- package/build/ViewerScopedEntityCompanionProvider.js +2 -1
- package/build/ViewerScopedEntityCompanionProvider.js.map +1 -1
- package/build/ViewerScopedEntityLoaderFactory.d.ts +1 -1
- package/build/ViewerScopedEntityLoaderFactory.js +2 -0
- package/build/ViewerScopedEntityLoaderFactory.js.map +1 -1
- package/build/ViewerScopedEntityMutatorFactory.js +2 -0
- package/build/ViewerScopedEntityMutatorFactory.js.map +1 -1
- package/build/__tests__/ComposedCacheAdapter-test.js +2 -0
- package/build/__tests__/ComposedCacheAdapter-test.js.map +1 -1
- package/build/__tests__/ComposedSecondaryEntityCache-test.js +1 -0
- package/build/__tests__/ComposedSecondaryEntityCache-test.js.map +1 -1
- package/build/__tests__/EnforcingEntityLoader-test.js +101 -113
- package/build/__tests__/EnforcingEntityLoader-test.js.map +1 -1
- package/build/__tests__/Entity-test.js +0 -132
- package/build/__tests__/Entity-test.js.map +1 -1
- package/build/__tests__/EntityAssociationLoader-test.js +6 -2
- package/build/__tests__/EntityAssociationLoader-test.js.map +1 -1
- package/build/__tests__/EntityCommonUseCases-test.js +24 -22
- package/build/__tests__/EntityCommonUseCases-test.js.map +1 -1
- package/build/__tests__/EntityCompanion-test.js +26 -3
- package/build/__tests__/EntityCompanion-test.js.map +1 -1
- package/build/__tests__/EntityConfiguration-test.js +103 -0
- package/build/__tests__/EntityConfiguration-test.js.map +1 -0
- package/build/__tests__/EntityDatabaseAdapter-test.js +6 -0
- package/build/__tests__/EntityDatabaseAdapter-test.js.map +1 -1
- package/build/__tests__/EntityEdges-test.js +61 -20
- package/build/__tests__/EntityEdges-test.js.map +1 -1
- package/build/__tests__/EntityFields-test.js +6 -0
- package/build/__tests__/EntityFields-test.js.map +1 -1
- package/build/__tests__/EntityLoader-constructor-test.js +16 -17
- package/build/__tests__/EntityLoader-constructor-test.js.map +1 -1
- package/build/__tests__/EntityLoader-test.js +74 -22
- package/build/__tests__/EntityLoader-test.js.map +1 -1
- package/build/__tests__/EntityMutator-MutationCacheConsistency-test.js +12 -15
- package/build/__tests__/EntityMutator-MutationCacheConsistency-test.js.map +1 -1
- package/build/__tests__/EntityMutator-test.js +54 -9
- package/build/__tests__/EntityMutator-test.js.map +1 -1
- package/build/__tests__/EntityPrivacyPolicy-test.js +77 -59
- package/build/__tests__/EntityPrivacyPolicy-test.js.map +1 -1
- package/build/__tests__/EntityQueryContext-test.js +9 -0
- package/build/__tests__/EntityQueryContext-test.js.map +1 -1
- package/build/__tests__/EntitySelfReferentialEdges-test.js +42 -25
- package/build/__tests__/EntitySelfReferentialEdges-test.js.map +1 -1
- package/build/__tests__/ViewerScopedEntityLoaderFactory-test.js.map +1 -1
- package/build/__tests__/cases/TwoEntitySameTableDisjointRows-test.js +20 -18
- package/build/__tests__/cases/TwoEntitySameTableDisjointRows-test.js.map +1 -1
- package/build/__tests__/cases/TwoEntitySameTableOverlappingRows-test.js +12 -15
- package/build/__tests__/cases/TwoEntitySameTableOverlappingRows-test.js.map +1 -1
- package/build/entityUtils.d.ts +1 -1
- package/build/entityUtils.js.map +1 -1
- package/build/errors/EntityCacheAdapterError.js +2 -5
- package/build/errors/EntityCacheAdapterError.js.map +1 -1
- package/build/errors/EntityDatabaseAdapterError.js +14 -35
- package/build/errors/EntityDatabaseAdapterError.js.map +1 -1
- package/build/errors/EntityError.js +1 -0
- package/build/errors/EntityError.js.map +1 -1
- package/build/errors/EntityInvalidFieldValueError.js +2 -2
- package/build/errors/EntityInvalidFieldValueError.js.map +1 -1
- package/build/errors/EntityNotAuthorizedError.js +3 -2
- package/build/errors/EntityNotAuthorizedError.js.map +1 -1
- package/build/errors/EntityNotFoundError.js +2 -2
- package/build/errors/EntityNotFoundError.js.map +1 -1
- package/build/index.d.ts +26 -20
- package/build/index.js +38 -28
- package/build/index.js.map +1 -1
- package/build/internal/EntityDataManager.d.ts +1 -1
- package/build/internal/EntityDataManager.js +6 -1
- package/build/internal/EntityDataManager.js.map +1 -1
- package/build/internal/EntityFieldTransformationUtils.d.ts +5 -5
- package/build/internal/EntityFieldTransformationUtils.js +5 -8
- package/build/internal/EntityFieldTransformationUtils.js.map +1 -1
- package/build/internal/EntityTableDataCoordinator.d.ts +1 -1
- package/build/internal/EntityTableDataCoordinator.js +5 -0
- package/build/internal/EntityTableDataCoordinator.js.map +1 -1
- package/build/internal/ReadThroughEntityCache.d.ts +1 -1
- package/build/internal/ReadThroughEntityCache.js +2 -0
- package/build/internal/ReadThroughEntityCache.js.map +1 -1
- package/build/internal/__tests__/EntityFieldTransformationUtils-test.js +6 -2
- package/build/internal/__tests__/EntityFieldTransformationUtils-test.js.map +1 -1
- package/build/internal/__tests__/ReadThroughEntityCache-test.js +33 -0
- package/build/internal/__tests__/ReadThroughEntityCache-test.js.map +1 -1
- package/build/metrics/IEntityMetricsAdapter.d.ts +1 -1
- package/build/rules/AlwaysAllowPrivacyPolicyRule.d.ts +1 -1
- package/build/rules/AlwaysAllowPrivacyPolicyRule.js.map +1 -1
- package/build/rules/AlwaysDenyPrivacyPolicyRule.d.ts +1 -1
- package/build/rules/AlwaysDenyPrivacyPolicyRule.js.map +1 -1
- package/build/rules/AlwaysSkipPrivacyPolicyRule.d.ts +1 -1
- package/build/rules/AlwaysSkipPrivacyPolicyRule.js.map +1 -1
- package/build/rules/PrivacyPolicyRule.d.ts +1 -1
- package/build/rules/PrivacyPolicyRule.js.map +1 -1
- package/build/rules/__tests__/AlwaysAllowPrivacyPolicyRule-test.js.map +1 -1
- package/build/rules/__tests__/AlwaysDenyPrivacyPolicyRule-test.js.map +1 -1
- package/build/rules/__tests__/AlwaysSkipPrivacyPolicyRule-test.js.map +1 -1
- package/build/testfixtures/DateIDTestEntity.js +12 -15
- package/build/testfixtures/DateIDTestEntity.js.map +1 -1
- package/build/testfixtures/SimpleTestEntity.js +12 -15
- package/build/testfixtures/SimpleTestEntity.js.map +1 -1
- package/build/testfixtures/TestEntity.js +12 -15
- package/build/testfixtures/TestEntity.js.map +1 -1
- package/build/testfixtures/TestEntity2.js +12 -15
- package/build/testfixtures/TestEntity2.js.map +1 -1
- package/build/testfixtures/TestEntityNumberKey.js +12 -15
- package/build/testfixtures/TestEntityNumberKey.js.map +1 -1
- package/build/testfixtures/TestEntityWithMutationTriggers.d.ts +36 -0
- package/build/testfixtures/TestEntityWithMutationTriggers.js +82 -0
- package/build/testfixtures/TestEntityWithMutationTriggers.js.map +1 -0
- package/build/utils/EntityPrivacyUtils.d.ts +34 -0
- package/build/utils/EntityPrivacyUtils.js +160 -0
- package/build/utils/EntityPrivacyUtils.js.map +1 -0
- package/build/utils/__tests__/EntityPrivacyUtils-test.d.ts +1 -0
- package/build/utils/__tests__/EntityPrivacyUtils-test.js +395 -0
- package/build/utils/__tests__/EntityPrivacyUtils-test.js.map +1 -0
- package/build/utils/__tests__/mergeEntityMutationTriggerConfigurations-test.d.ts +1 -0
- package/build/utils/__tests__/mergeEntityMutationTriggerConfigurations-test.js +26 -0
- package/build/utils/__tests__/mergeEntityMutationTriggerConfigurations-test.js.map +1 -0
- package/build/utils/collections/maps.js.map +1 -1
- package/build/utils/mergeEntityMutationTriggerConfigurations.d.ts +4 -0
- package/build/utils/mergeEntityMutationTriggerConfigurations.js +28 -0
- package/build/utils/mergeEntityMutationTriggerConfigurations.js.map +1 -0
- package/build/utils/testing/PrivacyPolicyRuleTestUtils.d.ts +1 -1
- package/build/utils/testing/PrivacyPolicyRuleTestUtils.js.map +1 -1
- package/build/utils/testing/StubCacheAdapter.d.ts +3 -3
- package/build/utils/testing/StubCacheAdapter.js +3 -3
- package/build/utils/testing/StubCacheAdapter.js.map +1 -1
- package/build/utils/testing/StubDatabaseAdapter.d.ts +2 -2
- package/build/utils/testing/StubDatabaseAdapter.js +4 -2
- package/build/utils/testing/StubDatabaseAdapter.js.map +1 -1
- package/build/utils/testing/StubDatabaseAdapterProvider.d.ts +1 -1
- package/build/utils/testing/StubDatabaseAdapterProvider.js +1 -3
- package/build/utils/testing/StubDatabaseAdapterProvider.js.map +1 -1
- package/build/utils/testing/__tests__/PrivacyPolicyRuleTestUtils-test.d.ts +1 -0
- package/build/utils/testing/__tests__/PrivacyPolicyRuleTestUtils-test.js +42 -0
- package/build/utils/testing/__tests__/PrivacyPolicyRuleTestUtils-test.js.map +1 -0
- package/build/utils/testing/__tests__/StubDatabaseAdapter-test.js +53 -0
- package/build/utils/testing/__tests__/StubDatabaseAdapter-test.js.map +1 -1
- package/build/utils/testing/describeFieldTestCase.js.map +1 -1
- package/package.json +5 -4
- package/src/AuthorizationResultBasedEntityLoader.ts +297 -0
- package/src/ComposedEntityCacheAdapter.ts +6 -6
- package/src/ComposedSecondaryEntityCache.ts +8 -8
- package/src/EnforcingEntityLoader.ts +20 -19
- package/src/Entity.ts +11 -126
- package/src/EntityAssociationLoader.ts +40 -41
- package/src/EntityCompanion.ts +8 -4
- package/src/EntityCompanionProvider.ts +24 -16
- package/src/EntityConfiguration.ts +18 -7
- package/src/EntityDatabaseAdapter.ts +41 -41
- package/src/EntityFieldDefinition.ts +28 -18
- package/src/EntityFields.ts +15 -0
- package/src/EntityLoader.ts +63 -357
- package/src/EntityLoaderFactory.ts +10 -4
- package/src/EntityLoaderUtils.ts +149 -0
- package/src/EntityMutationInfo.ts +2 -2
- package/src/EntityMutationTriggerConfiguration.ts +5 -5
- package/src/EntityMutationValidator.ts +2 -2
- package/src/EntityMutator.ts +146 -144
- package/src/EntityMutatorFactory.ts +8 -8
- package/src/EntityPrivacyPolicy.ts +78 -28
- package/src/EntityQueryContext.ts +14 -13
- package/src/EntityQueryContextProvider.ts +5 -5
- package/src/EntitySecondaryCacheLoader.ts +13 -11
- package/src/GenericEntityCacheAdapter.ts +10 -10
- package/src/GenericSecondaryEntityCache.ts +6 -6
- package/src/IEntityCacheAdapter.ts +4 -4
- package/src/IEntityCacheAdapterProvider.ts +2 -2
- package/src/IEntityDatabaseAdapterProvider.ts +2 -2
- package/src/ReadonlyEntity.ts +5 -5
- package/src/ViewerContext.ts +5 -5
- package/src/ViewerScopedEntityCompanion.ts +4 -4
- package/src/ViewerScopedEntityCompanionProvider.ts +4 -5
- package/src/ViewerScopedEntityLoaderFactory.ts +10 -4
- package/src/ViewerScopedEntityMutatorFactory.ts +5 -5
- package/src/__tests__/ComposedCacheAdapter-test.ts +12 -10
- package/src/__tests__/ComposedSecondaryEntityCache-test.ts +8 -8
- package/src/__tests__/EnforcingEntityLoader-test.ts +236 -159
- package/src/__tests__/Entity-test.ts +0 -202
- package/src/__tests__/EntityAssociationLoader-test.ts +29 -25
- package/src/__tests__/EntityCommonUseCases-test.ts +29 -13
- package/src/__tests__/EntityCompanion-test.ts +57 -5
- package/src/__tests__/EntityConfiguration-test.ts +118 -0
- package/src/__tests__/EntityDatabaseAdapter-test.ts +11 -11
- package/src/__tests__/EntityEdges-test.ts +108 -36
- package/src/__tests__/EntityFields-test.ts +14 -2
- package/src/__tests__/EntityLoader-constructor-test.ts +20 -7
- package/src/__tests__/EntityLoader-test.ts +214 -86
- package/src/__tests__/EntityMutator-MutationCacheConsistency-test.ts +2 -2
- package/src/__tests__/EntityMutator-test.ts +281 -96
- package/src/__tests__/EntityPrivacyPolicy-test.ts +166 -53
- package/src/__tests__/EntityQueryContext-test.ts +30 -12
- package/src/__tests__/EntitySecondaryCacheLoader-test.ts +7 -7
- package/src/__tests__/EntitySelfReferentialEdges-test.ts +46 -26
- package/src/__tests__/GenericEntityCacheAdapter-test.ts +2 -2
- package/src/__tests__/ViewerContext-test.ts +1 -1
- package/src/__tests__/ViewerScopedEntityCompanion-test.ts +2 -2
- package/src/__tests__/ViewerScopedEntityCompanionProvider-test.ts +2 -2
- package/src/__tests__/ViewerScopedEntityLoaderFactory-test.ts +2 -1
- package/src/__tests__/cases/TwoEntitySameTableDisjointRows-test.ts +19 -19
- package/src/__tests__/entityUtils-test.ts +2 -2
- package/src/entityUtils.ts +4 -4
- package/src/errors/EntityError.ts +4 -1
- package/src/errors/EntityInvalidFieldValueError.ts +2 -2
- package/src/errors/EntityNotAuthorizedError.ts +3 -3
- package/src/errors/EntityNotFoundError.ts +2 -2
- package/src/index.ts +26 -20
- package/src/internal/EntityDataManager.ts +24 -24
- package/src/internal/EntityFieldTransformationUtils.ts +39 -32
- package/src/internal/EntityTableDataCoordinator.ts +3 -3
- package/src/internal/ReadThroughEntityCache.ts +9 -9
- package/src/internal/__tests__/EntityDataManager-test.ts +51 -51
- package/src/internal/__tests__/EntityFieldTransformationUtils-test.ts +14 -10
- package/src/internal/__tests__/ReadThroughEntityCache-test.ts +74 -18
- package/src/metrics/EntityMetricsUtils.ts +4 -4
- package/src/metrics/IEntityMetricsAdapter.ts +1 -1
- package/src/rules/AlwaysAllowPrivacyPolicyRule.ts +9 -3
- package/src/rules/AlwaysDenyPrivacyPolicyRule.ts +9 -3
- package/src/rules/AlwaysSkipPrivacyPolicyRule.ts +9 -3
- package/src/rules/PrivacyPolicyRule.ts +9 -3
- package/src/rules/__tests__/AlwaysAllowPrivacyPolicyRule-test.ts +2 -1
- package/src/rules/__tests__/AlwaysDenyPrivacyPolicyRule-test.ts +2 -1
- package/src/rules/__tests__/AlwaysSkipPrivacyPolicyRule-test.ts +2 -1
- package/src/testfixtures/TestEntity.ts +1 -1
- package/src/testfixtures/TestEntityWithMutationTriggers.ts +156 -0
- package/src/utils/EntityPrivacyUtils.ts +325 -0
- package/src/utils/__tests__/EntityPrivacyUtils-test.ts +570 -0
- package/src/utils/__tests__/mergeEntityMutationTriggerConfigurations-test.ts +29 -0
- package/src/utils/collections/__tests__/maps-test.ts +2 -2
- package/src/utils/collections/maps.ts +11 -11
- package/src/utils/mergeEntityMutationTriggerConfigurations.ts +44 -0
- package/src/utils/testing/PrivacyPolicyRuleTestUtils.ts +25 -22
- package/src/utils/testing/StubCacheAdapter.ts +17 -15
- package/src/utils/testing/StubDatabaseAdapter.ts +35 -30
- package/src/utils/testing/StubDatabaseAdapterProvider.ts +2 -2
- package/src/utils/testing/StubQueryContextProvider.ts +2 -2
- package/src/utils/testing/__tests__/PrivacyPolicyRuleTestUtils-test.ts +42 -0
- package/src/utils/testing/__tests__/StubDatabaseAdapter-test.ts +111 -29
- package/src/utils/testing/createUnitTestEntityCompanionProvider.ts +2 -2
- package/src/utils/testing/describeFieldTestCase.ts +1 -1
- package/build/__tests__/EntityDataConfiguration-test.js +0 -68
- package/build/__tests__/EntityDataConfiguration-test.js.map +0 -1
- package/src/__tests__/EntityDataConfiguration-test.ts +0 -77
- /package/build/__tests__/{EntityDataConfiguration-test.d.ts → EntityConfiguration-test.d.ts} +0 -0
|
@@ -47,8 +47,8 @@ describe(StubDatabaseAdapter, () => {
|
|
|
47
47
|
},
|
|
48
48
|
],
|
|
49
49
|
],
|
|
50
|
-
])
|
|
51
|
-
)
|
|
50
|
+
]),
|
|
51
|
+
),
|
|
52
52
|
);
|
|
53
53
|
|
|
54
54
|
const results = await databaseAdapter.fetchManyWhereAsync(queryContext, 'stringField', [
|
|
@@ -95,8 +95,8 @@ describe(StubDatabaseAdapter, () => {
|
|
|
95
95
|
},
|
|
96
96
|
],
|
|
97
97
|
],
|
|
98
|
-
])
|
|
99
|
-
)
|
|
98
|
+
]),
|
|
99
|
+
),
|
|
100
100
|
);
|
|
101
101
|
|
|
102
102
|
const results = await databaseAdapter.fetchManyByFieldEqualityConjunctionAsync(
|
|
@@ -120,7 +120,7 @@ describe(StubDatabaseAdapter, () => {
|
|
|
120
120
|
order: OrderByOrdering.DESCENDING,
|
|
121
121
|
},
|
|
122
122
|
],
|
|
123
|
-
}
|
|
123
|
+
},
|
|
124
124
|
);
|
|
125
125
|
|
|
126
126
|
expect(results).toHaveLength(2);
|
|
@@ -163,8 +163,8 @@ describe(StubDatabaseAdapter, () => {
|
|
|
163
163
|
},
|
|
164
164
|
],
|
|
165
165
|
],
|
|
166
|
-
])
|
|
167
|
-
)
|
|
166
|
+
]),
|
|
167
|
+
),
|
|
168
168
|
);
|
|
169
169
|
|
|
170
170
|
const results = await databaseAdapter.fetchManyByFieldEqualityConjunctionAsync(
|
|
@@ -186,7 +186,7 @@ describe(StubDatabaseAdapter, () => {
|
|
|
186
186
|
order: OrderByOrdering.DESCENDING,
|
|
187
187
|
},
|
|
188
188
|
],
|
|
189
|
-
}
|
|
189
|
+
},
|
|
190
190
|
);
|
|
191
191
|
|
|
192
192
|
expect(results).toHaveLength(3);
|
|
@@ -237,14 +237,14 @@ describe(StubDatabaseAdapter, () => {
|
|
|
237
237
|
},
|
|
238
238
|
],
|
|
239
239
|
],
|
|
240
|
-
])
|
|
241
|
-
)
|
|
240
|
+
]),
|
|
241
|
+
),
|
|
242
242
|
);
|
|
243
243
|
|
|
244
244
|
const results = await databaseAdapter.fetchManyByFieldEqualityConjunctionAsync(
|
|
245
245
|
queryContext,
|
|
246
246
|
[{ fieldName: 'nullableField', fieldValue: null }],
|
|
247
|
-
{}
|
|
247
|
+
{},
|
|
248
248
|
);
|
|
249
249
|
expect(results).toHaveLength(2);
|
|
250
250
|
expect(results[0]!.nullableField).toBeNull();
|
|
@@ -262,7 +262,7 @@ describe(StubDatabaseAdapter, () => {
|
|
|
262
262
|
order: OrderByOrdering.DESCENDING,
|
|
263
263
|
},
|
|
264
264
|
],
|
|
265
|
-
}
|
|
265
|
+
},
|
|
266
266
|
);
|
|
267
267
|
expect(results2).toHaveLength(2);
|
|
268
268
|
expect(results2.map((e) => e.nullableField)).toEqual([null, 'a']);
|
|
@@ -274,10 +274,10 @@ describe(StubDatabaseAdapter, () => {
|
|
|
274
274
|
const queryContext = instance(mock(EntityQueryContext));
|
|
275
275
|
const databaseAdapter = new StubDatabaseAdapter<TestFields>(
|
|
276
276
|
testEntityConfiguration,
|
|
277
|
-
new Map()
|
|
277
|
+
new Map(),
|
|
278
278
|
);
|
|
279
279
|
await expect(
|
|
280
|
-
databaseAdapter.fetchManyByRawWhereClauseAsync(queryContext, '', [], {})
|
|
280
|
+
databaseAdapter.fetchManyByRawWhereClauseAsync(queryContext, '', [], {}),
|
|
281
281
|
).rejects.toThrow();
|
|
282
282
|
});
|
|
283
283
|
});
|
|
@@ -287,7 +287,7 @@ describe(StubDatabaseAdapter, () => {
|
|
|
287
287
|
const queryContext = instance(mock(EntityQueryContext));
|
|
288
288
|
const databaseAdapter = new StubDatabaseAdapter<TestFields>(
|
|
289
289
|
testEntityConfiguration,
|
|
290
|
-
new Map()
|
|
290
|
+
new Map(),
|
|
291
291
|
);
|
|
292
292
|
const result = await databaseAdapter.insertAsync(queryContext, {
|
|
293
293
|
stringField: 'hello',
|
|
@@ -297,9 +297,29 @@ describe(StubDatabaseAdapter, () => {
|
|
|
297
297
|
});
|
|
298
298
|
|
|
299
299
|
expect(
|
|
300
|
-
databaseAdapter.getObjectCollectionForTable(testEntityConfiguration.tableName)
|
|
300
|
+
databaseAdapter.getObjectCollectionForTable(testEntityConfiguration.tableName),
|
|
301
301
|
).toHaveLength(1);
|
|
302
302
|
});
|
|
303
|
+
|
|
304
|
+
it('inserts a record with valid v7 id', async () => {
|
|
305
|
+
const expectedTime = new Date('2024-06-03T20:16:33.761Z');
|
|
306
|
+
|
|
307
|
+
jest.useFakeTimers({
|
|
308
|
+
now: expectedTime,
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
const queryContext = instance(mock(EntityQueryContext));
|
|
312
|
+
const databaseAdapter = new StubDatabaseAdapter<TestFields>(
|
|
313
|
+
testEntityConfiguration,
|
|
314
|
+
new Map(),
|
|
315
|
+
);
|
|
316
|
+
const result = await databaseAdapter.insertAsync(queryContext, {
|
|
317
|
+
stringField: 'hello',
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
const ts = getTimeFromUUIDv7(result.customIdField);
|
|
321
|
+
expect(ts).toEqual(expectedTime);
|
|
322
|
+
});
|
|
303
323
|
});
|
|
304
324
|
|
|
305
325
|
describe('updateAsync', () => {
|
|
@@ -323,8 +343,8 @@ describe(StubDatabaseAdapter, () => {
|
|
|
323
343
|
},
|
|
324
344
|
],
|
|
325
345
|
],
|
|
326
|
-
])
|
|
327
|
-
)
|
|
346
|
+
]),
|
|
347
|
+
),
|
|
328
348
|
);
|
|
329
349
|
const result = await databaseAdapter.updateAsync(queryContext, 'customIdField', 'hello', {
|
|
330
350
|
stringField: 'b',
|
|
@@ -334,6 +354,34 @@ describe(StubDatabaseAdapter, () => {
|
|
|
334
354
|
testIndexedField: 'h1',
|
|
335
355
|
});
|
|
336
356
|
});
|
|
357
|
+
|
|
358
|
+
it('throws error when empty update to match common DBMS behavior', async () => {
|
|
359
|
+
const queryContext = instance(mock(EntityQueryContext));
|
|
360
|
+
const databaseAdapter = new StubDatabaseAdapter<TestFields>(
|
|
361
|
+
testEntityConfiguration,
|
|
362
|
+
StubDatabaseAdapter.convertFieldObjectsToDataStore(
|
|
363
|
+
testEntityConfiguration,
|
|
364
|
+
new Map([
|
|
365
|
+
[
|
|
366
|
+
testEntityConfiguration.tableName,
|
|
367
|
+
[
|
|
368
|
+
{
|
|
369
|
+
customIdField: 'hello',
|
|
370
|
+
testIndexedField: 'h1',
|
|
371
|
+
intField: 3,
|
|
372
|
+
stringField: 'a',
|
|
373
|
+
dateField: new Date(),
|
|
374
|
+
nullableField: null,
|
|
375
|
+
},
|
|
376
|
+
],
|
|
377
|
+
],
|
|
378
|
+
]),
|
|
379
|
+
),
|
|
380
|
+
);
|
|
381
|
+
await expect(
|
|
382
|
+
databaseAdapter.updateAsync(queryContext, 'customIdField', 'hello', {}),
|
|
383
|
+
).rejects.toThrowError(`Empty update (custom_id = hello)`);
|
|
384
|
+
});
|
|
337
385
|
});
|
|
338
386
|
|
|
339
387
|
describe('deleteAsync', () => {
|
|
@@ -357,14 +405,14 @@ describe(StubDatabaseAdapter, () => {
|
|
|
357
405
|
},
|
|
358
406
|
],
|
|
359
407
|
],
|
|
360
|
-
])
|
|
361
|
-
)
|
|
408
|
+
]),
|
|
409
|
+
),
|
|
362
410
|
);
|
|
363
411
|
|
|
364
412
|
await databaseAdapter.deleteAsync(queryContext, 'customIdField', 'hello');
|
|
365
413
|
|
|
366
414
|
expect(
|
|
367
|
-
databaseAdapter.getObjectCollectionForTable(testEntityConfiguration.tableName)
|
|
415
|
+
databaseAdapter.getObjectCollectionForTable(testEntityConfiguration.tableName),
|
|
368
416
|
).toHaveLength(0);
|
|
369
417
|
});
|
|
370
418
|
});
|
|
@@ -373,24 +421,24 @@ describe(StubDatabaseAdapter, () => {
|
|
|
373
421
|
const queryContext = instance(mock(EntityQueryContext));
|
|
374
422
|
const databaseAdapter1 = new StubDatabaseAdapter<SimpleTestFields>(
|
|
375
423
|
simpleTestEntityConfiguration,
|
|
376
|
-
new Map()
|
|
424
|
+
new Map(),
|
|
377
425
|
);
|
|
378
426
|
const insertedObject1 = await databaseAdapter1.insertAsync(queryContext, {});
|
|
379
427
|
expect(typeof insertedObject1.id).toBe('string');
|
|
380
428
|
|
|
381
429
|
const databaseAdapter2 = new StubDatabaseAdapter<NumberKeyFields>(
|
|
382
430
|
numberKeyEntityConfiguration,
|
|
383
|
-
new Map()
|
|
431
|
+
new Map(),
|
|
384
432
|
);
|
|
385
433
|
const insertedObject2 = await databaseAdapter2.insertAsync(queryContext, {});
|
|
386
434
|
expect(typeof insertedObject2.id).toBe('number');
|
|
387
435
|
|
|
388
436
|
const databaseAdapter3 = new StubDatabaseAdapter<DateIDTestFields>(
|
|
389
437
|
dateIDTestEntityConfiguration,
|
|
390
|
-
new Map()
|
|
438
|
+
new Map(),
|
|
391
439
|
);
|
|
392
440
|
await expect(databaseAdapter3.insertAsync(queryContext, {})).rejects.toThrowError(
|
|
393
|
-
'Unsupported ID type for StubDatabaseAdapter: DateField'
|
|
441
|
+
'Unsupported ID type for StubDatabaseAdapter: DateField',
|
|
394
442
|
);
|
|
395
443
|
});
|
|
396
444
|
|
|
@@ -432,10 +480,24 @@ describe(StubDatabaseAdapter, () => {
|
|
|
432
480
|
},
|
|
433
481
|
{
|
|
434
482
|
hello: v2,
|
|
435
|
-
}
|
|
436
|
-
)
|
|
483
|
+
},
|
|
484
|
+
),
|
|
437
485
|
).toEqual(expectedResult);
|
|
438
486
|
});
|
|
487
|
+
|
|
488
|
+
it('works for empty', () => {
|
|
489
|
+
expect(
|
|
490
|
+
StubDatabaseAdapter['compareByOrderBys'](
|
|
491
|
+
[],
|
|
492
|
+
{
|
|
493
|
+
hello: 'test',
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
hello: 'blah',
|
|
497
|
+
},
|
|
498
|
+
),
|
|
499
|
+
).toEqual(0);
|
|
500
|
+
});
|
|
439
501
|
});
|
|
440
502
|
|
|
441
503
|
describe('recursing', () => {
|
|
@@ -458,9 +520,29 @@ describe(StubDatabaseAdapter, () => {
|
|
|
458
520
|
{
|
|
459
521
|
hello: 'a',
|
|
460
522
|
world: 2,
|
|
461
|
-
}
|
|
462
|
-
)
|
|
523
|
+
},
|
|
524
|
+
),
|
|
463
525
|
).toEqual(-1);
|
|
464
526
|
});
|
|
465
527
|
});
|
|
466
528
|
});
|
|
529
|
+
|
|
530
|
+
const UUIDV7_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* Returns the Date object encoded in the first 48 bits of the given UUIDv7.
|
|
534
|
+
* @throws TypeError if the UUID is not version 7
|
|
535
|
+
*/
|
|
536
|
+
function getTimeFromUUIDv7(uuid: string): Date {
|
|
537
|
+
if (!UUIDV7_REGEX.test(uuid)) {
|
|
538
|
+
throw new TypeError(`UUID must be version 7 to get its timestamp`);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
// The first 48 bits = 12 hex characters of the UUID encode the timestamp in big endian
|
|
542
|
+
const hexCharacters = uuid.replaceAll('-', '').split('', 12);
|
|
543
|
+
const milliseconds = hexCharacters.reduce(
|
|
544
|
+
(milliseconds, character) => milliseconds * 16 + parseInt(character, 16),
|
|
545
|
+
0,
|
|
546
|
+
);
|
|
547
|
+
return new Date(milliseconds);
|
|
548
|
+
}
|
|
@@ -10,7 +10,7 @@ import NoOpEntityMetricsAdapter from '../../metrics/NoOpEntityMetricsAdapter';
|
|
|
10
10
|
* are replaced with in-memory simulations.
|
|
11
11
|
*/
|
|
12
12
|
export const createUnitTestEntityCompanionProvider = (
|
|
13
|
-
metricsAdapter: IEntityMetricsAdapter = new NoOpEntityMetricsAdapter()
|
|
13
|
+
metricsAdapter: IEntityMetricsAdapter = new NoOpEntityMetricsAdapter(),
|
|
14
14
|
): EntityCompanionProvider => {
|
|
15
15
|
return new EntityCompanionProvider(
|
|
16
16
|
metricsAdapter,
|
|
@@ -30,6 +30,6 @@ export const createUnitTestEntityCompanionProvider = (
|
|
|
30
30
|
cacheAdapterProvider: new InMemoryFullCacheStubCacheAdapterProvider(),
|
|
31
31
|
},
|
|
32
32
|
],
|
|
33
|
-
])
|
|
33
|
+
]),
|
|
34
34
|
);
|
|
35
35
|
};
|
|
@@ -3,7 +3,7 @@ import { EntityFieldDefinition } from '../../EntityFieldDefinition';
|
|
|
3
3
|
export default function describeFieldTestCase<T>(
|
|
4
4
|
fieldDefinition: EntityFieldDefinition<T>,
|
|
5
5
|
validValues: T[],
|
|
6
|
-
invalidValues: any[]
|
|
6
|
+
invalidValues: any[],
|
|
7
7
|
): void {
|
|
8
8
|
describe(fieldDefinition.constructor.name, () => {
|
|
9
9
|
if (validValues.length > 0) {
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const EntityConfiguration_1 = __importDefault(require("../EntityConfiguration"));
|
|
7
|
-
const EntityFields_1 = require("../EntityFields");
|
|
8
|
-
describe(EntityConfiguration_1.default, () => {
|
|
9
|
-
const blahEntityConfiguration = new EntityConfiguration_1.default({
|
|
10
|
-
idField: 'id',
|
|
11
|
-
tableName: 'blah_table',
|
|
12
|
-
schema: {
|
|
13
|
-
id: new EntityFields_1.UUIDField({
|
|
14
|
-
columnName: 'id',
|
|
15
|
-
}),
|
|
16
|
-
cacheable: new EntityFields_1.StringField({
|
|
17
|
-
columnName: 'cacheable',
|
|
18
|
-
cache: true,
|
|
19
|
-
}),
|
|
20
|
-
uniqueButNotCacheable: new EntityFields_1.StringField({
|
|
21
|
-
columnName: 'unique_but_not_cacheable',
|
|
22
|
-
}),
|
|
23
|
-
},
|
|
24
|
-
databaseAdapterFlavor: 'postgres',
|
|
25
|
-
cacheAdapterFlavor: 'redis',
|
|
26
|
-
});
|
|
27
|
-
it('returns correct fields', () => {
|
|
28
|
-
expect(blahEntityConfiguration.idField).toEqual('id');
|
|
29
|
-
expect(blahEntityConfiguration.tableName).toEqual('blah_table');
|
|
30
|
-
expect(blahEntityConfiguration.databaseAdapterFlavor).toEqual('postgres');
|
|
31
|
-
expect(blahEntityConfiguration.cacheAdapterFlavor).toEqual('redis');
|
|
32
|
-
});
|
|
33
|
-
it('filters cacheable fields', () => {
|
|
34
|
-
expect(blahEntityConfiguration.cacheableKeys).toEqual(new Set(['cacheable']));
|
|
35
|
-
});
|
|
36
|
-
describe('cache key version', () => {
|
|
37
|
-
it('defaults to 0', () => {
|
|
38
|
-
const entityConfiguration = new EntityConfiguration_1.default({
|
|
39
|
-
idField: 'id',
|
|
40
|
-
tableName: 'blah',
|
|
41
|
-
schema: {
|
|
42
|
-
id: new EntityFields_1.UUIDField({
|
|
43
|
-
columnName: 'id',
|
|
44
|
-
}),
|
|
45
|
-
},
|
|
46
|
-
databaseAdapterFlavor: 'postgres',
|
|
47
|
-
cacheAdapterFlavor: 'redis',
|
|
48
|
-
});
|
|
49
|
-
expect(entityConfiguration.cacheKeyVersion).toEqual(0);
|
|
50
|
-
});
|
|
51
|
-
it('sets to custom version', () => {
|
|
52
|
-
const entityConfiguration = new EntityConfiguration_1.default({
|
|
53
|
-
idField: 'id',
|
|
54
|
-
tableName: 'blah',
|
|
55
|
-
schema: {
|
|
56
|
-
id: new EntityFields_1.UUIDField({
|
|
57
|
-
columnName: 'id',
|
|
58
|
-
}),
|
|
59
|
-
},
|
|
60
|
-
databaseAdapterFlavor: 'postgres',
|
|
61
|
-
cacheAdapterFlavor: 'redis',
|
|
62
|
-
cacheKeyVersion: 100,
|
|
63
|
-
});
|
|
64
|
-
expect(entityConfiguration.cacheKeyVersion).toEqual(100);
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
//# sourceMappingURL=EntityDataConfiguration-test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EntityDataConfiguration-test.js","sourceRoot":"","sources":["../../src/__tests__/EntityDataConfiguration-test.ts"],"names":[],"mappings":";;;;;AAAA,iFAAyD;AACzD,kDAAyD;AAEzD,QAAQ,CAAC,6BAAmB,EAAE,GAAG,EAAE;IAWjC,MAAM,uBAAuB,GAAG,IAAI,6BAAmB,CAAQ;QAC7D,OAAO,EAAE,IAAI;QACb,SAAS,EAAE,YAAY;QACvB,MAAM,EAAE;YACN,EAAE,EAAE,IAAI,wBAAS,CAAC;gBAChB,UAAU,EAAE,IAAI;aACjB,CAAC;YACF,SAAS,EAAE,IAAI,0BAAW,CAAC;gBACzB,UAAU,EAAE,WAAW;gBACvB,KAAK,EAAE,IAAI;aACZ,CAAC;YACF,qBAAqB,EAAE,IAAI,0BAAW,CAAC;gBACrC,UAAU,EAAE,0BAA0B;aACvC,CAAC;SACH;QACD,qBAAqB,EAAE,UAAU;QACjC,kBAAkB,EAAE,OAAO;KAC5B,CAAC,CAAC;IAEH,EAAE,CAAC,wBAAwB,EAAE,GAAG,EAAE;QAChC,MAAM,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACtD,MAAM,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QAChE,MAAM,CAAC,uBAAuB,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC1E,MAAM,CAAC,uBAAuB,CAAC,kBAAkB,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE;QAClC,MAAM,CAAC,uBAAuB,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAChF,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;QACjC,EAAE,CAAC,eAAe,EAAE,GAAG,EAAE;YACvB,MAAM,mBAAmB,GAAG,IAAI,6BAAmB,CAAS;gBAC1D,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,MAAM;gBACjB,MAAM,EAAE;oBACN,EAAE,EAAE,IAAI,wBAAS,CAAC;wBAChB,UAAU,EAAE,IAAI;qBACjB,CAAC;iBACH;gBACD,qBAAqB,EAAE,UAAU;gBACjC,kBAAkB,EAAE,OAAO;aAC5B,CAAC,CAAC;YACH,MAAM,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACzD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,wBAAwB,EAAE,GAAG,EAAE;YAChC,MAAM,mBAAmB,GAAG,IAAI,6BAAmB,CAAS;gBAC1D,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,MAAM;gBACjB,MAAM,EAAE;oBACN,EAAE,EAAE,IAAI,wBAAS,CAAC;wBAChB,UAAU,EAAE,IAAI;qBACjB,CAAC;iBACH;gBACD,qBAAqB,EAAE,UAAU;gBACjC,kBAAkB,EAAE,OAAO;gBAC3B,eAAe,EAAE,GAAG;aACrB,CAAC,CAAC;YACH,MAAM,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC3D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import EntityConfiguration from '../EntityConfiguration';
|
|
2
|
-
import { UUIDField, StringField } from '../EntityFields';
|
|
3
|
-
|
|
4
|
-
describe(EntityConfiguration, () => {
|
|
5
|
-
type BlahT = {
|
|
6
|
-
id: string;
|
|
7
|
-
cacheable: string;
|
|
8
|
-
uniqueButNotCacheable: string;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
type Blah2T = {
|
|
12
|
-
id: string;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const blahEntityConfiguration = new EntityConfiguration<BlahT>({
|
|
16
|
-
idField: 'id',
|
|
17
|
-
tableName: 'blah_table',
|
|
18
|
-
schema: {
|
|
19
|
-
id: new UUIDField({
|
|
20
|
-
columnName: 'id',
|
|
21
|
-
}),
|
|
22
|
-
cacheable: new StringField({
|
|
23
|
-
columnName: 'cacheable',
|
|
24
|
-
cache: true,
|
|
25
|
-
}),
|
|
26
|
-
uniqueButNotCacheable: new StringField({
|
|
27
|
-
columnName: 'unique_but_not_cacheable',
|
|
28
|
-
}),
|
|
29
|
-
},
|
|
30
|
-
databaseAdapterFlavor: 'postgres',
|
|
31
|
-
cacheAdapterFlavor: 'redis',
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it('returns correct fields', () => {
|
|
35
|
-
expect(blahEntityConfiguration.idField).toEqual('id');
|
|
36
|
-
expect(blahEntityConfiguration.tableName).toEqual('blah_table');
|
|
37
|
-
expect(blahEntityConfiguration.databaseAdapterFlavor).toEqual('postgres');
|
|
38
|
-
expect(blahEntityConfiguration.cacheAdapterFlavor).toEqual('redis');
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it('filters cacheable fields', () => {
|
|
42
|
-
expect(blahEntityConfiguration.cacheableKeys).toEqual(new Set(['cacheable']));
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
describe('cache key version', () => {
|
|
46
|
-
it('defaults to 0', () => {
|
|
47
|
-
const entityConfiguration = new EntityConfiguration<Blah2T>({
|
|
48
|
-
idField: 'id',
|
|
49
|
-
tableName: 'blah',
|
|
50
|
-
schema: {
|
|
51
|
-
id: new UUIDField({
|
|
52
|
-
columnName: 'id',
|
|
53
|
-
}),
|
|
54
|
-
},
|
|
55
|
-
databaseAdapterFlavor: 'postgres',
|
|
56
|
-
cacheAdapterFlavor: 'redis',
|
|
57
|
-
});
|
|
58
|
-
expect(entityConfiguration.cacheKeyVersion).toEqual(0);
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
it('sets to custom version', () => {
|
|
62
|
-
const entityConfiguration = new EntityConfiguration<Blah2T>({
|
|
63
|
-
idField: 'id',
|
|
64
|
-
tableName: 'blah',
|
|
65
|
-
schema: {
|
|
66
|
-
id: new UUIDField({
|
|
67
|
-
columnName: 'id',
|
|
68
|
-
}),
|
|
69
|
-
},
|
|
70
|
-
databaseAdapterFlavor: 'postgres',
|
|
71
|
-
cacheAdapterFlavor: 'redis',
|
|
72
|
-
cacheKeyVersion: 100,
|
|
73
|
-
});
|
|
74
|
-
expect(entityConfiguration.cacheKeyVersion).toEqual(100);
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
});
|
/package/build/__tests__/{EntityDataConfiguration-test.d.ts → EntityConfiguration-test.d.ts}
RENAMED
|
File without changes
|