@routier/core 0.0.1-alpha.1 → 0.0.1-alpha.2
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/dist/assertions/index.d.ts +5 -0
- package/dist/assertions/index.js +131 -0
- package/dist/assertions/index.js.map +1 -0
- package/dist/codegen/SlotPath.d.ts +7 -0
- package/dist/codegen/blocks.d.ts +130 -0
- package/dist/codegen/handlers/CloneHandlerBuilder.d.ts +4 -0
- package/dist/codegen/handlers/CompareHandlerBuilder.d.ts +4 -0
- package/dist/codegen/handlers/DeserializeHandlerBuilder.d.ts +4 -0
- package/dist/codegen/handlers/EnableChangeTrackingHandlerBuilder.d.ts +4 -0
- package/dist/codegen/handlers/EnrichmentHandlerBuilder.d.ts +4 -0
- package/dist/codegen/handlers/FreezeHandlerBuilder.d.ts +4 -0
- package/dist/codegen/handlers/HashHandlerBuilder.d.ts +4 -0
- package/dist/codegen/handlers/HashTypeHandlerBuilder.d.ts +4 -0
- package/dist/codegen/handlers/IdSelectorHandlerBuilder.d.ts +4 -0
- package/dist/codegen/handlers/MergeHandlerBuilder.d.ts +4 -0
- package/dist/codegen/handlers/PrepareHandlerBuilder.d.ts +4 -0
- package/dist/codegen/handlers/SerializeHandlerBuilder.d.ts +4 -0
- package/dist/codegen/handlers/StripHandlerBuilder.d.ts +4 -0
- package/dist/codegen/handlers/clone/CloneObjectHandler.d.ts +6 -0
- package/dist/codegen/handlers/clone/CloneValueHandler.d.ts +6 -0
- package/dist/codegen/handlers/compare/CompareObjectHandler.d.ts +6 -0
- package/dist/codegen/handlers/compare/CompareValueHandler.d.ts +6 -0
- package/dist/codegen/handlers/deserialize/DeserializeComputedValueHandler.d.ts +6 -0
- package/dist/codegen/handlers/deserialize/DeserializeDateHandler.d.ts +9 -0
- package/dist/codegen/handlers/deserialize/DeserializeFunctionHandler.d.ts +6 -0
- package/dist/codegen/handlers/deserialize/DeserializeObjectHandler.d.ts +6 -0
- package/dist/codegen/handlers/deserialize/DeserializeValueHandler.d.ts +6 -0
- package/dist/codegen/handlers/enableChangeTracking/EnableChangeTrackingObjectHandler.d.ts +6 -0
- package/dist/codegen/handlers/enableChangeTracking/EnableChangeTrackingPrimitiveValueHandler.d.ts +6 -0
- package/dist/codegen/handlers/enrichment/EnrichmentComputedValueHandler.d.ts +6 -0
- package/dist/codegen/handlers/enrichment/EnrichmentDefaultFunctionHandler.d.ts +6 -0
- package/dist/codegen/handlers/enrichment/EnrichmentDefaultValueHandler.d.ts +6 -0
- package/dist/codegen/handlers/enrichment/EnrichmentFunctionHandler.d.ts +6 -0
- package/dist/codegen/handlers/enrichment/EnrichmentNullableObjectHandler.d.ts +6 -0
- package/dist/codegen/handlers/enrichment/EnrichmentObjectHandler.d.ts +6 -0
- package/dist/codegen/handlers/enrichment/EnrichmentObjectIdentityHandler.d.ts +6 -0
- package/dist/codegen/handlers/enrichment/EnrichmentPrimitiveHandler.d.ts +6 -0
- package/dist/codegen/handlers/enrichment/EnrichmentPrimitiveIdentityHandler.d.ts +6 -0
- package/dist/codegen/handlers/freeze/FreezeObjectHandler.d.ts +6 -0
- package/dist/codegen/handlers/freeze/FreezePrimitiveValueHandler.d.ts +6 -0
- package/dist/codegen/handlers/hash/HashComputedValueHandler.d.ts +6 -0
- package/dist/codegen/handlers/hash/HashDateHandler.d.ts +6 -0
- package/dist/codegen/handlers/hash/HashFunctionHandler.d.ts +6 -0
- package/dist/codegen/handlers/hash/HashIdentityHandler.d.ts +6 -0
- package/dist/codegen/handlers/hash/HashKeyHandler.d.ts +6 -0
- package/dist/codegen/handlers/hash/HashValueHandler.d.ts +6 -0
- package/dist/codegen/handlers/hashType/HashTypeValueHandler.d.ts +6 -0
- package/dist/codegen/handlers/idSelector/IdSelectorValueHandler.d.ts +6 -0
- package/{src/codegen/handlers/index.ts → dist/codegen/handlers/index.d.ts} +1 -1
- package/dist/codegen/handlers/merge/MergeComputedValueHandler.d.ts +6 -0
- package/dist/codegen/handlers/merge/MergeDefaultFunctionHandler.d.ts +6 -0
- package/dist/codegen/handlers/merge/MergeDefaultValueHandler.d.ts +6 -0
- package/dist/codegen/handlers/merge/MergeFunctionHandler.d.ts +6 -0
- package/dist/codegen/handlers/merge/MergePrimitiveHandler.d.ts +6 -0
- package/dist/codegen/handlers/prepare/PrepareComputedValueHandler.d.ts +6 -0
- package/dist/codegen/handlers/prepare/PrepareFunctionHandler.d.ts +6 -0
- package/dist/codegen/handlers/prepare/PrepareIdentityHandler.d.ts +6 -0
- package/dist/codegen/handlers/prepare/PrepareKeyHandler.d.ts +6 -0
- package/dist/codegen/handlers/prepare/PrepareObjectHandler.d.ts +6 -0
- package/dist/codegen/handlers/prepare/PrepareValueHandler.d.ts +6 -0
- package/dist/codegen/handlers/serialize/SerializeDateHandler.d.ts +9 -0
- package/dist/codegen/handlers/serialize/SerializeObjectHandler.d.ts +6 -0
- package/dist/codegen/handlers/serialize/SerializeValueHandler.d.ts +6 -0
- package/dist/codegen/handlers/strip/StripIdentityHandler.d.ts +6 -0
- package/dist/codegen/handlers/strip/StripKeyHandler.d.ts +6 -0
- package/dist/codegen/handlers/strip/StripObjectHandler.d.ts +6 -0
- package/dist/codegen/handlers/strip/StripValueHandler.d.ts +6 -0
- package/dist/codegen/handlers/types.d.ts +18 -0
- package/{src/codegen/index.ts → dist/codegen/index.d.ts} +1 -1
- package/dist/codegen/types.d.ts +9 -0
- package/dist/codegen/utils.d.ts +22 -0
- package/dist/collections/Changes.d.ts +51 -0
- package/dist/collections/Changes.test.d.ts +1 -0
- package/dist/collections/IdSet.d.ts +7 -0
- package/dist/collections/MemoryDataCollection.d.ts +22 -0
- package/dist/collections/MemoryDataCollection.test.d.ts +1 -0
- package/dist/collections/SchemaCollection.d.ts +8 -0
- package/dist/collections/TagCollection.d.ts +15 -0
- package/dist/collections/TagCollection.test.d.ts +1 -0
- package/{src/collections/index.ts → dist/collections/index.d.ts} +1 -1
- package/dist/collections/index.js +659 -0
- package/dist/collections/index.js.map +1 -0
- package/dist/errors/SchemaError.d.ts +3 -0
- package/dist/errors/index.d.ts +1 -0
- package/dist/errors/index.js +90 -0
- package/dist/errors/index.js.map +1 -0
- package/{src/expressions/index.ts → dist/expressions/index.d.ts} +1 -1
- package/{src/expressions/parser.ts → dist/expressions/index.js} +387 -205
- package/dist/expressions/index.js.map +1 -0
- package/dist/expressions/parser.d.ts +4 -0
- package/dist/expressions/parser.test.d.ts +1 -0
- package/{src/expressions/types.ts → dist/expressions/types.d.ts} +42 -99
- package/dist/expressions/utils.d.ts +10 -0
- package/dist/expressions/utils.test.d.ts +1 -0
- package/{src/index.ts → dist/index.d.ts} +1 -1
- package/dist/index.js +8434 -0
- package/dist/index.js.map +1 -0
- package/dist/performance/index.d.ts +5 -0
- package/dist/performance/index.js +65 -0
- package/dist/performance/index.js.map +1 -0
- package/dist/pipeline/SyncronousQueue.d.ts +7 -0
- package/dist/pipeline/SyncronousQueue.test.d.ts +1 -0
- package/dist/pipeline/TrampolinePipeline.d.ts +36 -0
- package/dist/pipeline/TrampolinePipeline.test.d.ts +1 -0
- package/dist/pipeline/index.d.ts +2 -0
- package/{src/pipeline/TrampolinePipeline.ts → dist/pipeline/index.js} +297 -140
- package/dist/pipeline/index.js.map +1 -0
- package/dist/plugins/EphemeralDataPlugin.d.ts +13 -0
- package/dist/plugins/capabilities/DbPluginCapability.d.ts +23 -0
- package/{src/plugins/capabilities/index.ts → dist/plugins/capabilities/index.d.ts} +1 -1
- package/dist/plugins/capabilities/logging/DbPluginLoggingCapability.d.ts +28 -0
- package/dist/plugins/capabilities/logging/index.d.ts +1 -0
- package/{src/plugins/index.ts → dist/plugins/index.d.ts} +1 -1
- package/dist/plugins/index.js +2328 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/query/Query.d.ts +13 -0
- package/dist/plugins/query/QueryOptionsCollection.d.ts +27 -0
- package/dist/plugins/query/QueryOptionsCollection.test.d.ts +1 -0
- package/{src/plugins/query/index.ts → dist/plugins/query/index.d.ts} +1 -1
- package/{src/plugins/query/types.ts → dist/plugins/query/types.d.ts} +29 -20
- package/dist/plugins/replication/OptimisticReplicationDbPlugin.d.ts +21 -0
- package/dist/plugins/replication/ReplicationDbPlugin.d.ts +21 -0
- package/{src/plugins/replication/index.ts → dist/plugins/replication/index.d.ts} +1 -1
- package/{src/plugins/replication/types.ts → dist/plugins/replication/types.d.ts} +1 -2
- package/dist/plugins/translators/DataTranslator.d.ts +18 -0
- package/dist/plugins/translators/JsonTranslator.d.ts +17 -0
- package/dist/plugins/translators/JsonTranslator.test.d.ts +1 -0
- package/dist/plugins/translators/SqlTranslator.d.ts +14 -0
- package/{src/plugins/translators/index.ts → dist/plugins/translators/index.d.ts} +1 -1
- package/{src/plugins/types.ts → dist/plugins/types.d.ts} +11 -26
- package/dist/results/Result.d.ts +29 -0
- package/{src/results/index.ts → dist/results/index.d.ts} +1 -1
- package/dist/results/index.js +192 -0
- package/dist/results/index.js.map +1 -0
- package/{src/results/types.ts → dist/results/types.d.ts} +18 -7
- package/dist/results/utils.d.ts +2 -0
- package/dist/schema/PropertyInfo.d.ts +132 -0
- package/dist/schema/PropertyInfo.test.d.ts +1 -0
- package/dist/schema/SchemaDefinition.d.ts +17 -0
- package/dist/schema/builder.d.ts +17 -0
- package/{src/schema/index.ts → dist/schema/index.d.ts} +1 -1
- package/dist/schema/index.js +4822 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/property/base/SchemaBase.d.ts +23 -0
- package/dist/schema/property/base/index.d.ts +1 -0
- package/dist/schema/property/modifiers/SchemaDefault.d.ts +13 -0
- package/dist/schema/property/modifiers/SchemaDeserialize.d.ts +11 -0
- package/dist/schema/property/modifiers/SchemaDistinct.d.ts +7 -0
- package/dist/schema/property/modifiers/SchemaFrom.d.ts +23 -0
- package/dist/schema/property/modifiers/SchemaIdentity.d.ts +7 -0
- package/dist/schema/property/modifiers/SchemaIndex.d.ts +23 -0
- package/dist/schema/property/modifiers/SchemaKey.d.ts +13 -0
- package/dist/schema/property/modifiers/SchemaNullable.d.ts +9 -0
- package/dist/schema/property/modifiers/SchemaOptional.d.ts +9 -0
- package/dist/schema/property/modifiers/SchemaReadonly.d.ts +15 -0
- package/dist/schema/property/modifiers/SchemaSerialize.d.ts +9 -0
- package/dist/schema/property/modifiers/SchemaTracked.d.ts +7 -0
- package/{src/schema/property/modifiers/index.ts → dist/schema/property/modifiers/index.d.ts} +1 -1
- package/dist/schema/property/types/SchemaArray.d.ts +23 -0
- package/dist/schema/property/types/SchemaBoolean.d.ts +27 -0
- package/dist/schema/property/types/SchemaDate.d.ts +27 -0
- package/dist/schema/property/types/SchemaNumber.d.ts +31 -0
- package/dist/schema/property/types/SchemaObject.d.ts +20 -0
- package/dist/schema/property/types/SchemaString.d.ts +31 -0
- package/{src/schema/property/types/index.ts → dist/schema/property/types/index.d.ts} +1 -1
- package/dist/schema/table/SchemaComputed.d.ts +10 -0
- package/dist/schema/table/SchemaFunction.d.ts +8 -0
- package/{src/schema/table/index.ts → dist/schema/table/index.d.ts} +1 -1
- package/{src/schema/types.ts → dist/schema/types.d.ts} +59 -99
- package/{src/types/index.ts → dist/types/index.d.ts} +1 -2
- package/dist/types/index.js +25 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utilities/arrays.d.ts +1 -0
- package/dist/utilities/arrays.test.d.ts +1 -0
- package/dist/utilities/dates.d.ts +1 -0
- package/dist/utilities/dates.test.d.ts +1 -0
- package/dist/utilities/dbPluginEventUtils.d.ts +14 -0
- package/{src/utilities/index.ts → dist/utilities/index.d.ts} +1 -1
- package/dist/utilities/index.js +554 -0
- package/dist/utilities/index.js.map +1 -0
- package/dist/utilities/objects.d.ts +2 -0
- package/dist/utilities/queryOptionsCollection.d.ts +2 -0
- package/dist/utilities/replication.d.ts +3 -0
- package/dist/utilities/runtime.d.ts +1 -0
- package/dist/utilities/strings.d.ts +1 -0
- package/dist/utilities/types.d.ts +1 -0
- package/dist/utilities/uuid.d.ts +2 -0
- package/package.json +6 -1
- package/readme.md +95 -0
- package/CHANGELOG.md +0 -8
- package/rspack.config.mjs +0 -65
- package/src/assertions/index.ts +0 -37
- package/src/codegen/SlotPath.ts +0 -20
- package/src/codegen/blocks.ts +0 -578
- package/src/codegen/handlers/CloneHandlerBuilder.ts +0 -13
- package/src/codegen/handlers/CompareHandlerBuilder.ts +0 -13
- package/src/codegen/handlers/DeserializeHandlerBuilder.ts +0 -20
- package/src/codegen/handlers/EnableChangeTrackingHandlerBuilder.ts +0 -13
- package/src/codegen/handlers/EnrichmentHandlerBuilder.ts +0 -28
- package/src/codegen/handlers/FreezeHandlerBuilder.ts +0 -13
- package/src/codegen/handlers/HashHandlerBuilder.ts +0 -25
- package/src/codegen/handlers/HashTypeHandlerBuilder.ts +0 -11
- package/src/codegen/handlers/IdSelectorHandlerBuilder.ts +0 -10
- package/src/codegen/handlers/MergeHandlerBuilder.ts +0 -19
- package/src/codegen/handlers/PrepareHandlerBuilder.ts +0 -23
- package/src/codegen/handlers/SerializeHandlerBuilder.ts +0 -15
- package/src/codegen/handlers/StripHandlerBuilder.ts +0 -18
- package/src/codegen/handlers/clone/CloneObjectHandler.ts +0 -29
- package/src/codegen/handlers/clone/CloneValueHandler.ts +0 -33
- package/src/codegen/handlers/compare/CompareObjectHandler.ts +0 -15
- package/src/codegen/handlers/compare/CompareValueHandler.ts +0 -27
- package/src/codegen/handlers/deserialize/DeserializeComputedValueHandler.ts +0 -16
- package/src/codegen/handlers/deserialize/DeserializeDateHandler.ts +0 -45
- package/src/codegen/handlers/deserialize/DeserializeFunctionHandler.ts +0 -16
- package/src/codegen/handlers/deserialize/DeserializeObjectHandler.ts +0 -29
- package/src/codegen/handlers/deserialize/DeserializeValueHandler.ts +0 -33
- package/src/codegen/handlers/enableChangeTracking/EnableChangeTrackingObjectHandler.ts +0 -20
- package/src/codegen/handlers/enableChangeTracking/EnableChangeTrackingPrimitiveValueHandler.ts +0 -15
- package/src/codegen/handlers/enrichment/EnrichmentComputedValueHandler.ts +0 -37
- package/src/codegen/handlers/enrichment/EnrichmentDefaultFunctionHandler.ts +0 -50
- package/src/codegen/handlers/enrichment/EnrichmentDefaultValueHandler.ts +0 -18
- package/src/codegen/handlers/enrichment/EnrichmentFunctionHandler.ts +0 -38
- package/src/codegen/handlers/enrichment/EnrichmentNullableObjectHandler.ts +0 -44
- package/src/codegen/handlers/enrichment/EnrichmentObjectHandler.ts +0 -29
- package/src/codegen/handlers/enrichment/EnrichmentObjectIdentityHandler.ts +0 -16
- package/src/codegen/handlers/enrichment/EnrichmentPrimitiveHandler.ts +0 -13
- package/src/codegen/handlers/enrichment/EnrichmentPrimitiveIdentityHandler.ts +0 -21
- package/src/codegen/handlers/freeze/FreezeObjectHandler.ts +0 -20
- package/src/codegen/handlers/freeze/FreezePrimitiveValueHandler.ts +0 -15
- package/src/codegen/handlers/hash/HashComputedValueHandler.ts +0 -15
- package/src/codegen/handlers/hash/HashDateHandler.ts +0 -26
- package/src/codegen/handlers/hash/HashFunctionHandler.ts +0 -16
- package/src/codegen/handlers/hash/HashIdentityHandler.ts +0 -15
- package/src/codegen/handlers/hash/HashKeyHandler.ts +0 -26
- package/src/codegen/handlers/hash/HashValueHandler.ts +0 -26
- package/src/codegen/handlers/hashType/HashTypeValueHandler.ts +0 -20
- package/src/codegen/handlers/idSelector/IdSelectorValueHandler.ts +0 -28
- package/src/codegen/handlers/merge/MergeComputedValueHandler.ts +0 -37
- package/src/codegen/handlers/merge/MergeDefaultFunctionHandler.ts +0 -40
- package/src/codegen/handlers/merge/MergeDefaultValueHandler.ts +0 -32
- package/src/codegen/handlers/merge/MergeFunctionHandler.ts +0 -16
- package/src/codegen/handlers/merge/MergePrimitiveHandler.ts +0 -21
- package/src/codegen/handlers/prepare/PrepareComputedValueHandler.ts +0 -16
- package/src/codegen/handlers/prepare/PrepareFunctionHandler.ts +0 -16
- package/src/codegen/handlers/prepare/PrepareIdentityHandler.ts +0 -21
- package/src/codegen/handlers/prepare/PrepareKeyHandler.ts +0 -21
- package/src/codegen/handlers/prepare/PrepareObjectHandler.ts +0 -38
- package/src/codegen/handlers/prepare/PrepareValueHandler.ts +0 -36
- package/src/codegen/handlers/serialize/SerializeDateHandler.ts +0 -45
- package/src/codegen/handlers/serialize/SerializeObjectHandler.ts +0 -28
- package/src/codegen/handlers/serialize/SerializeValueHandler.ts +0 -33
- package/src/codegen/handlers/strip/StripIdentityHandler.ts +0 -15
- package/src/codegen/handlers/strip/StripKeyHandler.ts +0 -15
- package/src/codegen/handlers/strip/StripObjectHandler.ts +0 -35
- package/src/codegen/handlers/strip/StripValueHandler.ts +0 -36
- package/src/codegen/handlers/types.ts +0 -119
- package/src/codegen/types.ts +0 -2
- package/src/codegen/utils.ts +0 -74
- package/src/collections/Changes.test.ts +0 -337
- package/src/collections/Changes.ts +0 -177
- package/src/collections/IdSet.ts +0 -28
- package/src/collections/MemoryDataCollection.test.ts +0 -424
- package/src/collections/MemoryDataCollection.ts +0 -134
- package/src/collections/SchemaCollection.ts +0 -22
- package/src/collections/TagCollection.test.ts +0 -443
- package/src/collections/TagCollection.ts +0 -62
- package/src/errors/SchemaError.ts +0 -6
- package/src/errors/index.ts +0 -1
- package/src/expressions/parser.test.ts +0 -913
- package/src/expressions/utils.test.ts +0 -346
- package/src/expressions/utils.ts +0 -59
- package/src/performance/index.ts +0 -26
- package/src/pipeline/SyncronousQueue.test.ts +0 -269
- package/src/pipeline/SyncronousQueue.ts +0 -30
- package/src/pipeline/TrampolinePipeline.test.ts +0 -374
- package/src/pipeline/index.ts +0 -2
- package/src/plugins/EphemeralDataPlugin.ts +0 -132
- package/src/plugins/capabilities/DbPluginCapability.ts +0 -111
- package/src/plugins/capabilities/logging/DbPluginLoggingCapability.ts +0 -261
- package/src/plugins/capabilities/logging/index.ts +0 -1
- package/src/plugins/query/Query.ts +0 -67
- package/src/plugins/query/QueryOptionsCollection.test.ts +0 -86
- package/src/plugins/query/QueryOptionsCollection.ts +0 -154
- package/src/plugins/replication/OptimisticReplicationDbPlugin.ts +0 -202
- package/src/plugins/replication/ReplicationDbPlugin.ts +0 -137
- package/src/plugins/translators/DataTranslator.ts +0 -46
- package/src/plugins/translators/JsonTranslator.test.ts +0 -618
- package/src/plugins/translators/JsonTranslator.ts +0 -211
- package/src/plugins/translators/SqlTranslator.ts +0 -45
- package/src/results/Result.ts +0 -91
- package/src/results/utils.ts +0 -15
- package/src/schema/PropertyInfo.test.ts +0 -479
- package/src/schema/PropertyInfo.ts +0 -374
- package/src/schema/SchemaDefinition.ts +0 -626
- package/src/schema/builder.ts +0 -18
- package/src/schema/property/base/SchemaBase.ts +0 -49
- package/src/schema/property/base/index.ts +0 -1
- package/src/schema/property/modifiers/SchemaDefault.ts +0 -29
- package/src/schema/property/modifiers/SchemaDeserialize.ts +0 -23
- package/src/schema/property/modifiers/SchemaDistinct.ts +0 -14
- package/src/schema/property/modifiers/SchemaFrom.ts +0 -54
- package/src/schema/property/modifiers/SchemaIdentity.ts +0 -13
- package/src/schema/property/modifiers/SchemaIndex.ts +0 -60
- package/src/schema/property/modifiers/SchemaKey.ts +0 -28
- package/src/schema/property/modifiers/SchemaNullable.ts +0 -18
- package/src/schema/property/modifiers/SchemaOptional.ts +0 -19
- package/src/schema/property/modifiers/SchemaReadonly.ts +0 -34
- package/src/schema/property/modifiers/SchemaSerialize.ts +0 -18
- package/src/schema/property/modifiers/SchemaTracked.ts +0 -14
- package/src/schema/property/types/SchemaArray.ts +0 -50
- package/src/schema/property/types/SchemaBoolean.ts +0 -59
- package/src/schema/property/types/SchemaDate.ts +0 -58
- package/src/schema/property/types/SchemaNumber.ts +0 -69
- package/src/schema/property/types/SchemaObject.ts +0 -44
- package/src/schema/property/types/SchemaString.ts +0 -69
- package/src/schema/table/SchemaComputed.ts +0 -20
- package/src/schema/table/SchemaFunction.ts +0 -15
- package/src/utilities/arrays.test.ts +0 -312
- package/src/utilities/arrays.ts +0 -12
- package/src/utilities/dates.test.ts +0 -388
- package/src/utilities/dates.ts +0 -11
- package/src/utilities/dbPluginEventUtils.ts +0 -44
- package/src/utilities/objects.ts +0 -7
- package/src/utilities/queryOptionsCollection.ts +0 -16
- package/src/utilities/replication.ts +0 -23
- package/src/utilities/runtime.ts +0 -3
- package/src/utilities/strings.ts +0 -18
- package/src/utilities/types.ts +0 -1
- package/src/utilities/uuid.ts +0 -56
- package/tsconfig.json +0 -28
- package/vitest.config.ts +0 -11
|
@@ -1,479 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach } from 'vitest';
|
|
2
|
-
import { PropertyInfo } from './PropertyInfo';
|
|
3
|
-
import { SchemaBase } from './property/base/SchemaBase';
|
|
4
|
-
import { SchemaTypes } from './types';
|
|
5
|
-
|
|
6
|
-
class MockSchema extends SchemaBase<any, any> {
|
|
7
|
-
instance = {};
|
|
8
|
-
type = SchemaTypes.String;
|
|
9
|
-
isNullable = false;
|
|
10
|
-
isOptional = false;
|
|
11
|
-
isKey = false;
|
|
12
|
-
isIdentity = false;
|
|
13
|
-
isReadonly = false;
|
|
14
|
-
isUnmapped = false;
|
|
15
|
-
isDistict = false;
|
|
16
|
-
indexes: string[] = [];
|
|
17
|
-
injected: any = null;
|
|
18
|
-
defaultValue: any = null;
|
|
19
|
-
valueSerializer: any = null;
|
|
20
|
-
valueDeserializer: any = null;
|
|
21
|
-
functionBody: any = null;
|
|
22
|
-
literals: any[] = [];
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
class MockNullableSchema extends SchemaBase<any, any> {
|
|
26
|
-
instance = {};
|
|
27
|
-
type = SchemaTypes.String;
|
|
28
|
-
isNullable = true;
|
|
29
|
-
isOptional = false;
|
|
30
|
-
isKey = false;
|
|
31
|
-
isIdentity = false;
|
|
32
|
-
isReadonly = false;
|
|
33
|
-
isUnmapped = false;
|
|
34
|
-
isDistict = false;
|
|
35
|
-
indexes: string[] = [];
|
|
36
|
-
injected: any = null;
|
|
37
|
-
defaultValue: any = null;
|
|
38
|
-
valueSerializer: any = null;
|
|
39
|
-
valueDeserializer: any = null;
|
|
40
|
-
functionBody: any = null;
|
|
41
|
-
literals: any[] = [];
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
class MockOptionalSchema extends SchemaBase<any, any> {
|
|
45
|
-
instance = {};
|
|
46
|
-
type = SchemaTypes.String;
|
|
47
|
-
isNullable = false;
|
|
48
|
-
isOptional = true;
|
|
49
|
-
isKey = false;
|
|
50
|
-
isIdentity = false;
|
|
51
|
-
isReadonly = false;
|
|
52
|
-
isUnmapped = false;
|
|
53
|
-
isDistict = false;
|
|
54
|
-
indexes: string[] = [];
|
|
55
|
-
injected: any = null;
|
|
56
|
-
defaultValue: any = null;
|
|
57
|
-
valueSerializer: any = null;
|
|
58
|
-
valueDeserializer: any = null;
|
|
59
|
-
functionBody: any = null;
|
|
60
|
-
literals: any[] = [];
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
describe('PropertyInfo', () => {
|
|
64
|
-
let mockSchema: MockSchema;
|
|
65
|
-
let nullableSchema: MockNullableSchema;
|
|
66
|
-
let optionalSchema: MockOptionalSchema;
|
|
67
|
-
|
|
68
|
-
beforeEach(() => {
|
|
69
|
-
mockSchema = new MockSchema();
|
|
70
|
-
nullableSchema = new MockNullableSchema();
|
|
71
|
-
optionalSchema = new MockOptionalSchema();
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
describe('constructor and basic properties', () => {
|
|
75
|
-
it('should create PropertyInfo with correct basic properties', () => {
|
|
76
|
-
const propertyInfo = new PropertyInfo(mockSchema, 'testProperty');
|
|
77
|
-
|
|
78
|
-
expect(propertyInfo.name).toBe('testProperty');
|
|
79
|
-
expect(propertyInfo.type).toBe(SchemaTypes.String);
|
|
80
|
-
expect(propertyInfo.isNullable).toBe(false);
|
|
81
|
-
expect(propertyInfo.isOptional).toBe(false);
|
|
82
|
-
expect(propertyInfo.isKey).toBe(false);
|
|
83
|
-
expect(propertyInfo.isIdentity).toBe(false);
|
|
84
|
-
expect(propertyInfo.isReadonly).toBe(false);
|
|
85
|
-
expect(propertyInfo.isUnmapped).toBe(false);
|
|
86
|
-
expect(propertyInfo.isDistinct).toBe(false);
|
|
87
|
-
expect(propertyInfo.indexes).toEqual([]);
|
|
88
|
-
expect(propertyInfo.injected).toBeNull();
|
|
89
|
-
expect(propertyInfo.defaultValue).toBeNull();
|
|
90
|
-
expect(propertyInfo.valueSerializer).toBeNull();
|
|
91
|
-
expect(propertyInfo.valueDeserializer).toBeNull();
|
|
92
|
-
expect(propertyInfo.functionBody).toBeNull();
|
|
93
|
-
expect(propertyInfo.children).toEqual([]);
|
|
94
|
-
expect(propertyInfo.schema).toBe(mockSchema);
|
|
95
|
-
expect(propertyInfo.parent).toBeUndefined();
|
|
96
|
-
expect(propertyInfo.literals).toEqual([]);
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
it('should create PropertyInfo with nullable schema', () => {
|
|
100
|
-
const propertyInfo = new PropertyInfo(nullableSchema, 'nullableProperty');
|
|
101
|
-
|
|
102
|
-
expect(propertyInfo.isNullable).toBe(true);
|
|
103
|
-
expect(propertyInfo.isOptional).toBe(false);
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
it('should create PropertyInfo with optional schema', () => {
|
|
107
|
-
const propertyInfo = new PropertyInfo(optionalSchema, 'optionalProperty');
|
|
108
|
-
|
|
109
|
-
expect(propertyInfo.isNullable).toBe(false);
|
|
110
|
-
expect(propertyInfo.isOptional).toBe(true);
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
it('should create PropertyInfo with parent', () => {
|
|
114
|
-
const parentPropertyInfo = new PropertyInfo(mockSchema, 'parentProperty');
|
|
115
|
-
const childPropertyInfo = new PropertyInfo(mockSchema, 'childProperty', parentPropertyInfo);
|
|
116
|
-
|
|
117
|
-
expect(childPropertyInfo.parent).toBe(parentPropertyInfo);
|
|
118
|
-
expect(childPropertyInfo.name).toBe('childProperty');
|
|
119
|
-
});
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
describe('id property', () => {
|
|
123
|
-
it('should return property name for root property', () => {
|
|
124
|
-
const propertyInfo = new PropertyInfo(mockSchema, 'testProperty');
|
|
125
|
-
|
|
126
|
-
expect(propertyInfo.id).toBe('testProperty');
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
it('should return dot-separated path for nested property', () => {
|
|
130
|
-
const parentPropertyInfo = new PropertyInfo(mockSchema, 'parentProperty');
|
|
131
|
-
const childPropertyInfo = new PropertyInfo(mockSchema, 'childProperty', parentPropertyInfo);
|
|
132
|
-
|
|
133
|
-
expect(childPropertyInfo.id).toBe('parentProperty.childProperty');
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
it('should return full path for deeply nested property', () => {
|
|
137
|
-
const grandparentPropertyInfo = new PropertyInfo(mockSchema, 'grandparentProperty');
|
|
138
|
-
const parentPropertyInfo = new PropertyInfo(mockSchema, 'parentProperty', grandparentPropertyInfo);
|
|
139
|
-
const childPropertyInfo = new PropertyInfo(mockSchema, 'childProperty', parentPropertyInfo);
|
|
140
|
-
|
|
141
|
-
expect(childPropertyInfo.id).toBe('grandparentProperty.parentProperty.childProperty');
|
|
142
|
-
});
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
describe('level property', () => {
|
|
146
|
-
it('should return 0 for root property', () => {
|
|
147
|
-
const propertyInfo = new PropertyInfo(mockSchema, 'testProperty');
|
|
148
|
-
|
|
149
|
-
expect(propertyInfo.level).toBe(0);
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
it('should return 1 for first level child', () => {
|
|
153
|
-
const parentPropertyInfo = new PropertyInfo(mockSchema, 'parentProperty');
|
|
154
|
-
const childPropertyInfo = new PropertyInfo(mockSchema, 'childProperty', parentPropertyInfo);
|
|
155
|
-
|
|
156
|
-
expect(childPropertyInfo.level).toBe(1);
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
it('should return 2 for second level child', () => {
|
|
160
|
-
const grandparentPropertyInfo = new PropertyInfo(mockSchema, 'grandparentProperty');
|
|
161
|
-
const parentPropertyInfo = new PropertyInfo(mockSchema, 'parentProperty', grandparentPropertyInfo);
|
|
162
|
-
const childPropertyInfo = new PropertyInfo(mockSchema, 'childProperty', parentPropertyInfo);
|
|
163
|
-
|
|
164
|
-
expect(childPropertyInfo.level).toBe(2);
|
|
165
|
-
});
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
describe('getPathArray', () => {
|
|
169
|
-
it('should return array with property name for root property', () => {
|
|
170
|
-
const propertyInfo = new PropertyInfo(mockSchema, 'testProperty');
|
|
171
|
-
|
|
172
|
-
expect(propertyInfo.getPathArray()).toEqual(['testProperty']);
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
it('should return full path array for nested property', () => {
|
|
176
|
-
const parentPropertyInfo = new PropertyInfo(mockSchema, 'parentProperty');
|
|
177
|
-
const childPropertyInfo = new PropertyInfo(mockSchema, 'childProperty', parentPropertyInfo);
|
|
178
|
-
|
|
179
|
-
expect(childPropertyInfo.getPathArray()).toEqual(['parentProperty', 'childProperty']);
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
it('should return full path array for deeply nested property', () => {
|
|
183
|
-
const grandparentPropertyInfo = new PropertyInfo(mockSchema, 'grandparentProperty');
|
|
184
|
-
const parentPropertyInfo = new PropertyInfo(mockSchema, 'parentProperty', grandparentPropertyInfo);
|
|
185
|
-
const childPropertyInfo = new PropertyInfo(mockSchema, 'childProperty', parentPropertyInfo);
|
|
186
|
-
|
|
187
|
-
expect(childPropertyInfo.getPathArray()).toEqual(['grandparentProperty', 'parentProperty', 'childProperty']);
|
|
188
|
-
});
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
describe('getParentPathArray', () => {
|
|
192
|
-
it('should return empty array for root property', () => {
|
|
193
|
-
const propertyInfo = new PropertyInfo(mockSchema, 'testProperty');
|
|
194
|
-
|
|
195
|
-
expect(propertyInfo.getParentPathArray()).toEqual([]);
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
it('should return parent path array for nested property', () => {
|
|
199
|
-
const parentPropertyInfo = new PropertyInfo(mockSchema, 'parentProperty');
|
|
200
|
-
const childPropertyInfo = new PropertyInfo(mockSchema, 'childProperty', parentPropertyInfo);
|
|
201
|
-
|
|
202
|
-
expect(childPropertyInfo.getParentPathArray()).toEqual(['parentProperty']);
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
it('should return full parent path array for deeply nested property', () => {
|
|
206
|
-
const grandparentPropertyInfo = new PropertyInfo(mockSchema, 'grandparentProperty');
|
|
207
|
-
const parentPropertyInfo = new PropertyInfo(mockSchema, 'parentProperty', grandparentPropertyInfo);
|
|
208
|
-
const childPropertyInfo = new PropertyInfo(mockSchema, 'childProperty', parentPropertyInfo);
|
|
209
|
-
|
|
210
|
-
expect(childPropertyInfo.getParentPathArray()).toEqual(['grandparentProperty', 'parentProperty']);
|
|
211
|
-
});
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
describe('hasNullableParents', () => {
|
|
215
|
-
it('should return false for root property with non-nullable schema', () => {
|
|
216
|
-
const propertyInfo = new PropertyInfo(mockSchema, 'testProperty');
|
|
217
|
-
|
|
218
|
-
expect(propertyInfo.hasNullableParents).toBe(false);
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
it('should return true when parent is nullable', () => {
|
|
222
|
-
const parentPropertyInfo = new PropertyInfo(nullableSchema, 'parentProperty');
|
|
223
|
-
const childPropertyInfo = new PropertyInfo(mockSchema, 'childProperty', parentPropertyInfo);
|
|
224
|
-
|
|
225
|
-
expect(childPropertyInfo.hasNullableParents).toBe(true);
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
it('should return true when grandparent is nullable', () => {
|
|
229
|
-
const grandparentPropertyInfo = new PropertyInfo(nullableSchema, 'grandparentProperty');
|
|
230
|
-
const parentPropertyInfo = new PropertyInfo(mockSchema, 'parentProperty', grandparentPropertyInfo);
|
|
231
|
-
const childPropertyInfo = new PropertyInfo(mockSchema, 'childProperty', parentPropertyInfo);
|
|
232
|
-
|
|
233
|
-
expect(childPropertyInfo.hasNullableParents).toBe(true);
|
|
234
|
-
});
|
|
235
|
-
|
|
236
|
-
it('should return false when no parents are nullable', () => {
|
|
237
|
-
const parentPropertyInfo = new PropertyInfo(mockSchema, 'parentProperty');
|
|
238
|
-
const childPropertyInfo = new PropertyInfo(mockSchema, 'childProperty', parentPropertyInfo);
|
|
239
|
-
|
|
240
|
-
expect(childPropertyInfo.hasNullableParents).toBe(false);
|
|
241
|
-
});
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
describe('hasIdentityChildren', () => {
|
|
245
|
-
it('should return false for property with no children', () => {
|
|
246
|
-
const propertyInfo = new PropertyInfo(mockSchema, 'testProperty');
|
|
247
|
-
|
|
248
|
-
expect(propertyInfo.hasIdentityChildren).toBe(false);
|
|
249
|
-
});
|
|
250
|
-
|
|
251
|
-
it('should return true when direct child is identity', () => {
|
|
252
|
-
const identitySchema = new MockSchema();
|
|
253
|
-
identitySchema.isIdentity = true;
|
|
254
|
-
|
|
255
|
-
const parentPropertyInfo = new PropertyInfo(mockSchema, 'parentProperty');
|
|
256
|
-
const childPropertyInfo = new PropertyInfo(identitySchema, 'childProperty', parentPropertyInfo);
|
|
257
|
-
|
|
258
|
-
// Manually add child to parent's children array
|
|
259
|
-
(parentPropertyInfo as any).children.push(childPropertyInfo);
|
|
260
|
-
|
|
261
|
-
expect(parentPropertyInfo.hasIdentityChildren).toBe(true);
|
|
262
|
-
});
|
|
263
|
-
|
|
264
|
-
it('should return true when grandchild is identity', () => {
|
|
265
|
-
const identitySchema = new MockSchema();
|
|
266
|
-
identitySchema.isIdentity = true;
|
|
267
|
-
|
|
268
|
-
const grandparentPropertyInfo = new PropertyInfo(mockSchema, 'grandparentProperty');
|
|
269
|
-
const parentPropertyInfo = new PropertyInfo(mockSchema, 'parentProperty', grandparentPropertyInfo);
|
|
270
|
-
const childPropertyInfo = new PropertyInfo(identitySchema, 'childProperty', parentPropertyInfo);
|
|
271
|
-
|
|
272
|
-
// Manually add children to their respective parents
|
|
273
|
-
(grandparentPropertyInfo as any).children.push(parentPropertyInfo);
|
|
274
|
-
(parentPropertyInfo as any).children.push(childPropertyInfo);
|
|
275
|
-
|
|
276
|
-
expect(grandparentPropertyInfo.hasIdentityChildren).toBe(true);
|
|
277
|
-
});
|
|
278
|
-
|
|
279
|
-
it('should return false when no children are identity', () => {
|
|
280
|
-
const parentPropertyInfo = new PropertyInfo(mockSchema, 'parentProperty');
|
|
281
|
-
const childPropertyInfo = new PropertyInfo(mockSchema, 'childProperty', parentPropertyInfo);
|
|
282
|
-
|
|
283
|
-
expect(parentPropertyInfo.hasIdentityChildren).toBe(false);
|
|
284
|
-
});
|
|
285
|
-
});
|
|
286
|
-
|
|
287
|
-
describe('getValue', () => {
|
|
288
|
-
it('should return null for null instance', () => {
|
|
289
|
-
const propertyInfo = new PropertyInfo(mockSchema, 'testProperty');
|
|
290
|
-
|
|
291
|
-
expect(propertyInfo.getValue(null)).toBeNull();
|
|
292
|
-
});
|
|
293
|
-
|
|
294
|
-
it('should return null for undefined instance', () => {
|
|
295
|
-
const propertyInfo = new PropertyInfo(mockSchema, 'testProperty');
|
|
296
|
-
|
|
297
|
-
expect(propertyInfo.getValue(undefined)).toBeNull();
|
|
298
|
-
});
|
|
299
|
-
|
|
300
|
-
it('should return value for simple property', () => {
|
|
301
|
-
const propertyInfo = new PropertyInfo(mockSchema, 'testProperty');
|
|
302
|
-
const instance = { testProperty: 'testValue' };
|
|
303
|
-
|
|
304
|
-
expect(propertyInfo.getValue(instance)).toBe('testValue');
|
|
305
|
-
});
|
|
306
|
-
|
|
307
|
-
it('should return value for nested property', () => {
|
|
308
|
-
const parentPropertyInfo = new PropertyInfo(mockSchema, 'parentProperty');
|
|
309
|
-
const childPropertyInfo = new PropertyInfo(mockSchema, 'childProperty', parentPropertyInfo);
|
|
310
|
-
const instance: any = { parentProperty: { childProperty: 'nestedValue' } };
|
|
311
|
-
|
|
312
|
-
expect(childPropertyInfo.getValue(instance)).toBe('nestedValue');
|
|
313
|
-
});
|
|
314
|
-
|
|
315
|
-
it('should return null when intermediate property is null', () => {
|
|
316
|
-
const parentPropertyInfo = new PropertyInfo(mockSchema, 'parentProperty');
|
|
317
|
-
const childPropertyInfo = new PropertyInfo(mockSchema, 'childProperty', parentPropertyInfo);
|
|
318
|
-
const instance: any = { parentProperty: null };
|
|
319
|
-
|
|
320
|
-
expect(childPropertyInfo.getValue(instance)).toBeNull();
|
|
321
|
-
});
|
|
322
|
-
|
|
323
|
-
it('should return null when intermediate property is undefined', () => {
|
|
324
|
-
const parentPropertyInfo = new PropertyInfo(mockSchema, 'parentProperty');
|
|
325
|
-
const childPropertyInfo = new PropertyInfo(mockSchema, 'childProperty', parentPropertyInfo);
|
|
326
|
-
const instance: any = { parentProperty: undefined };
|
|
327
|
-
|
|
328
|
-
expect(childPropertyInfo.getValue(instance)).toBeNull();
|
|
329
|
-
});
|
|
330
|
-
});
|
|
331
|
-
|
|
332
|
-
describe('setValue', () => {
|
|
333
|
-
it('should set value for simple property', () => {
|
|
334
|
-
const propertyInfo = new PropertyInfo(mockSchema, 'testProperty');
|
|
335
|
-
const instance = {};
|
|
336
|
-
|
|
337
|
-
propertyInfo.setValue(instance, 'newValue');
|
|
338
|
-
|
|
339
|
-
expect(instance).toEqual({ testProperty: 'newValue' });
|
|
340
|
-
});
|
|
341
|
-
|
|
342
|
-
it('should set value for nested property', () => {
|
|
343
|
-
const parentPropertyInfo = new PropertyInfo(mockSchema, 'parentProperty');
|
|
344
|
-
const childPropertyInfo = new PropertyInfo(mockSchema, 'childProperty', parentPropertyInfo);
|
|
345
|
-
const instance = {};
|
|
346
|
-
|
|
347
|
-
childPropertyInfo.setValue(instance, 'nestedValue');
|
|
348
|
-
|
|
349
|
-
expect(instance).toEqual({ parentProperty: { childProperty: 'nestedValue' } });
|
|
350
|
-
});
|
|
351
|
-
|
|
352
|
-
it('should create intermediate objects when they do not exist', () => {
|
|
353
|
-
const grandparentPropertyInfo = new PropertyInfo(mockSchema, 'grandparentProperty');
|
|
354
|
-
const parentPropertyInfo = new PropertyInfo(mockSchema, 'parentProperty', grandparentPropertyInfo);
|
|
355
|
-
const childPropertyInfo = new PropertyInfo(mockSchema, 'childProperty', parentPropertyInfo);
|
|
356
|
-
const instance = {};
|
|
357
|
-
|
|
358
|
-
childPropertyInfo.setValue(instance, 'deepValue');
|
|
359
|
-
|
|
360
|
-
expect(instance).toEqual({
|
|
361
|
-
grandparentProperty: {
|
|
362
|
-
parentProperty: {
|
|
363
|
-
childProperty: 'deepValue'
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
});
|
|
367
|
-
});
|
|
368
|
-
|
|
369
|
-
it('should use existing intermediate objects', () => {
|
|
370
|
-
const parentPropertyInfo = new PropertyInfo(mockSchema, 'parentProperty');
|
|
371
|
-
const childPropertyInfo = new PropertyInfo(mockSchema, 'childProperty', parentPropertyInfo);
|
|
372
|
-
const instance = { parentProperty: { existingProperty: 'existingValue' } };
|
|
373
|
-
|
|
374
|
-
childPropertyInfo.setValue(instance, 'newValue');
|
|
375
|
-
|
|
376
|
-
expect(instance).toEqual({
|
|
377
|
-
parentProperty: {
|
|
378
|
-
existingProperty: 'existingValue',
|
|
379
|
-
childProperty: 'newValue'
|
|
380
|
-
}
|
|
381
|
-
});
|
|
382
|
-
});
|
|
383
|
-
|
|
384
|
-
it('should throw error for null instance', () => {
|
|
385
|
-
const propertyInfo = new PropertyInfo(mockSchema, 'testProperty');
|
|
386
|
-
|
|
387
|
-
expect(() => propertyInfo.setValue(null, 'value')).toThrow('Cannot set value on null or undefined instance');
|
|
388
|
-
});
|
|
389
|
-
|
|
390
|
-
it('should throw error for undefined instance', () => {
|
|
391
|
-
const propertyInfo = new PropertyInfo(mockSchema, 'testProperty');
|
|
392
|
-
|
|
393
|
-
expect(() => propertyInfo.setValue(undefined, 'value')).toThrow('Cannot set value on null or undefined instance');
|
|
394
|
-
});
|
|
395
|
-
});
|
|
396
|
-
|
|
397
|
-
describe('getSelectrorPath', () => {
|
|
398
|
-
it('should return path with parent for root property', () => {
|
|
399
|
-
const propertyInfo = new PropertyInfo(mockSchema, 'testProperty');
|
|
400
|
-
|
|
401
|
-
expect(propertyInfo.getSelectrorPath({ parent: 'entity' })).toBe('entity.testProperty');
|
|
402
|
-
});
|
|
403
|
-
|
|
404
|
-
it('should return path with parent for nested property', () => {
|
|
405
|
-
const parentPropertyInfo = new PropertyInfo(mockSchema, 'parentProperty');
|
|
406
|
-
const childPropertyInfo = new PropertyInfo(mockSchema, 'childProperty', parentPropertyInfo);
|
|
407
|
-
|
|
408
|
-
expect(childPropertyInfo.getSelectrorPath({ parent: 'entity' })).toBe('entity.parentProperty.childProperty');
|
|
409
|
-
});
|
|
410
|
-
|
|
411
|
-
it('should return path with optional chaining for nullable property', () => {
|
|
412
|
-
const propertyInfo = new PropertyInfo(nullableSchema, 'testProperty');
|
|
413
|
-
|
|
414
|
-
expect(propertyInfo.getSelectrorPath({ parent: 'entity' })).toBe('entity?.testProperty');
|
|
415
|
-
});
|
|
416
|
-
|
|
417
|
-
it('should return path with optional chaining for optional property', () => {
|
|
418
|
-
const propertyInfo = new PropertyInfo(optionalSchema, 'testProperty');
|
|
419
|
-
|
|
420
|
-
expect(propertyInfo.getSelectrorPath({ parent: 'entity' })).toBe('entity?.testProperty');
|
|
421
|
-
});
|
|
422
|
-
|
|
423
|
-
it('should return path with optional chaining when parent is nullable', () => {
|
|
424
|
-
const parentPropertyInfo = new PropertyInfo(nullableSchema, 'parentProperty');
|
|
425
|
-
const childPropertyInfo = new PropertyInfo(mockSchema, 'childProperty', parentPropertyInfo);
|
|
426
|
-
|
|
427
|
-
expect(childPropertyInfo.getSelectrorPath({ parent: 'entity' })).toBe('entity?.parentProperty.childProperty');
|
|
428
|
-
});
|
|
429
|
-
|
|
430
|
-
it('should return path without optional chaining for assignment type', () => {
|
|
431
|
-
const propertyInfo = new PropertyInfo(nullableSchema, 'testProperty');
|
|
432
|
-
|
|
433
|
-
expect(propertyInfo.getSelectrorPath({
|
|
434
|
-
parent: 'entity',
|
|
435
|
-
assignmentType: 'ASSIGNMENT'
|
|
436
|
-
})).toBe('entity.testProperty');
|
|
437
|
-
});
|
|
438
|
-
});
|
|
439
|
-
|
|
440
|
-
describe('getAssignmentPath', () => {
|
|
441
|
-
it('should return property name for root property without parent', () => {
|
|
442
|
-
const propertyInfo = new PropertyInfo(mockSchema, 'testProperty');
|
|
443
|
-
|
|
444
|
-
expect(propertyInfo.getAssignmentPath()).toBe('testProperty');
|
|
445
|
-
});
|
|
446
|
-
|
|
447
|
-
it('should return path for nested property without parent', () => {
|
|
448
|
-
const parentPropertyInfo = new PropertyInfo(mockSchema, 'parentProperty');
|
|
449
|
-
const childPropertyInfo = new PropertyInfo(mockSchema, 'childProperty', parentPropertyInfo);
|
|
450
|
-
|
|
451
|
-
expect(childPropertyInfo.getAssignmentPath()).toBe('parentProperty.childProperty');
|
|
452
|
-
});
|
|
453
|
-
|
|
454
|
-
it('should return path with parent when provided', () => {
|
|
455
|
-
const propertyInfo = new PropertyInfo(mockSchema, 'testProperty');
|
|
456
|
-
|
|
457
|
-
expect(propertyInfo.getAssignmentPath({ parent: 'entity' })).toBe('entity.testProperty');
|
|
458
|
-
});
|
|
459
|
-
|
|
460
|
-
it('should return path with parent for nested property', () => {
|
|
461
|
-
const parentPropertyInfo = new PropertyInfo(mockSchema, 'parentProperty');
|
|
462
|
-
const childPropertyInfo = new PropertyInfo(mockSchema, 'childProperty', parentPropertyInfo);
|
|
463
|
-
|
|
464
|
-
expect(childPropertyInfo.getAssignmentPath({ parent: 'entity' })).toBe('entity.parentProperty.childProperty');
|
|
465
|
-
});
|
|
466
|
-
|
|
467
|
-
it('should return path without optional chaining for nullable property', () => {
|
|
468
|
-
const propertyInfo = new PropertyInfo(nullableSchema, 'testProperty');
|
|
469
|
-
|
|
470
|
-
expect(propertyInfo.getAssignmentPath()).toBe('testProperty');
|
|
471
|
-
});
|
|
472
|
-
|
|
473
|
-
it('should return path without optional chaining for optional property', () => {
|
|
474
|
-
const propertyInfo = new PropertyInfo(optionalSchema, 'testProperty');
|
|
475
|
-
|
|
476
|
-
expect(propertyInfo.getAssignmentPath()).toBe('testProperty');
|
|
477
|
-
});
|
|
478
|
-
});
|
|
479
|
-
});
|