@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,374 +0,0 @@
|
|
|
1
|
-
import { SchemaBase } from './property/base/SchemaBase';
|
|
2
|
-
import { SchemaArray } from './property/types/SchemaArray';
|
|
3
|
-
import { DefaultValue, FunctionBody, PropertyDeserializer, PropertySerializer, SchemaTypes } from './types';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Represents metadata and utilities for a property in a schema, including its type, name, parent, children, and serialization details.
|
|
7
|
-
*/
|
|
8
|
-
export class PropertyInfo<T extends {}> {
|
|
9
|
-
|
|
10
|
-
get id() {
|
|
11
|
-
if (this._idCache) {
|
|
12
|
-
return this._idCache;
|
|
13
|
-
}
|
|
14
|
-
this._idCache = this.getPathArray().join(".");
|
|
15
|
-
return this._idCache;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/** The name of the property. */
|
|
19
|
-
readonly name: string;
|
|
20
|
-
/** The name of the property we need to map from. */
|
|
21
|
-
readonly from: string | null = null;
|
|
22
|
-
/** The schema type of the property. */
|
|
23
|
-
readonly type: SchemaTypes;
|
|
24
|
-
|
|
25
|
-
/** Whether the property can be null. */
|
|
26
|
-
readonly isNullable: boolean;
|
|
27
|
-
/** Whether the property is optional. */
|
|
28
|
-
readonly isOptional: boolean;
|
|
29
|
-
/** Whether the property is a key. */
|
|
30
|
-
readonly isKey: boolean;
|
|
31
|
-
/** Whether the property is an identity property. */
|
|
32
|
-
readonly isIdentity: boolean;
|
|
33
|
-
/** Whether the property is readonly. */
|
|
34
|
-
readonly isReadonly: boolean;
|
|
35
|
-
/** Whether the property is unmapped. */
|
|
36
|
-
readonly isUnmapped: boolean;
|
|
37
|
-
/** Whether the property is distinct. */
|
|
38
|
-
readonly isDistinct: boolean;
|
|
39
|
-
/** Indexes associated with the property. */
|
|
40
|
-
readonly indexes: string[];
|
|
41
|
-
|
|
42
|
-
/** Any injected value for the property. */
|
|
43
|
-
readonly injected: any | null = null;
|
|
44
|
-
/** The default value for the property, if any. */
|
|
45
|
-
readonly defaultValue: DefaultValue<any> | null = null;
|
|
46
|
-
/** Serializer for the property value, if any. */
|
|
47
|
-
readonly valueSerializer: PropertySerializer<T> | null = null;
|
|
48
|
-
/** Deserializer for the property value, if any. */
|
|
49
|
-
readonly valueDeserializer: PropertyDeserializer<T> | null = null;
|
|
50
|
-
/** Function body for computed properties, if any. */
|
|
51
|
-
readonly functionBody: FunctionBody<any, T> | null;
|
|
52
|
-
/** Child properties of this property. */
|
|
53
|
-
readonly children: PropertyInfo<T>[] = [];
|
|
54
|
-
/** The schema this property belongs to. */
|
|
55
|
-
readonly schema: SchemaBase<T, any>;
|
|
56
|
-
/** The inner schema if this property is an array. */
|
|
57
|
-
readonly innerSchema?: SchemaBase<unknown, any>;
|
|
58
|
-
/** Literal values allowed for this property. */
|
|
59
|
-
readonly literals: T[];
|
|
60
|
-
|
|
61
|
-
/** The parent property, if any. */
|
|
62
|
-
readonly parent?: PropertyInfo<T>;
|
|
63
|
-
|
|
64
|
-
// Cached computed values for performance
|
|
65
|
-
private _propertyChainCache?: PropertyInfo<T>[];
|
|
66
|
-
private _pathArrayCache?: string[];
|
|
67
|
-
private _parentPathArrayCache?: string[];
|
|
68
|
-
private _idCache?: string;
|
|
69
|
-
private _levelCache?: number;
|
|
70
|
-
private _hasNullableParentsCache?: boolean;
|
|
71
|
-
|
|
72
|
-
constructor(schema: SchemaBase<T, any>, name: string, parent?: PropertyInfo<T> | null) {
|
|
73
|
-
this.schema = schema;
|
|
74
|
-
this.name = name;
|
|
75
|
-
this.type = schema.type;
|
|
76
|
-
this.literals = schema.literals;
|
|
77
|
-
|
|
78
|
-
if (schema instanceof SchemaArray) {
|
|
79
|
-
this.innerSchema = schema.innerSchema;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
this.isNullable = schema.isNullable;
|
|
83
|
-
this.isOptional = schema.isOptional;
|
|
84
|
-
this.isKey = schema.isKey;
|
|
85
|
-
this.isIdentity = schema.isIdentity;
|
|
86
|
-
this.isReadonly = schema.isReadonly;
|
|
87
|
-
this.isUnmapped = schema.isUnmapped;
|
|
88
|
-
this.injected = schema.injected;
|
|
89
|
-
this.isDistinct = schema.isDistict;
|
|
90
|
-
this.indexes = schema.indexes;
|
|
91
|
-
this.from = schema.fromPropertyName;
|
|
92
|
-
|
|
93
|
-
this.defaultValue = schema.defaultValue;
|
|
94
|
-
this.valueSerializer = schema.valueSerializer;
|
|
95
|
-
this.valueDeserializer = schema.valueDeserializer;
|
|
96
|
-
this.functionBody = schema.functionBody;
|
|
97
|
-
|
|
98
|
-
this.parent = parent;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Returns the depth (level) of this property in the property tree.
|
|
103
|
-
*
|
|
104
|
-
* The root property has a level of 0. Each child property increases the level by 1.
|
|
105
|
-
* Traverses up the parent chain, incrementing the level for each parent until the root is reached.
|
|
106
|
-
*
|
|
107
|
-
* @returns {number} The number of parent properties above this property (0 for root).
|
|
108
|
-
*/
|
|
109
|
-
get level() {
|
|
110
|
-
if (this._levelCache !== undefined) {
|
|
111
|
-
return this._levelCache;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
let level = 0;
|
|
115
|
-
let current: PropertyInfo<T> | undefined = this;
|
|
116
|
-
|
|
117
|
-
while (current) {
|
|
118
|
-
if (current.parent == null) {
|
|
119
|
-
this._levelCache = level;
|
|
120
|
-
return level;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
current = current.parent;
|
|
124
|
-
level++;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
this._levelCache = level;
|
|
128
|
-
return level;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
private _getPropertyChain(): PropertyInfo<T>[] {
|
|
132
|
-
if (this._propertyChainCache) {
|
|
133
|
-
return this._propertyChainCache;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
const chain: PropertyInfo<T>[] = [];
|
|
137
|
-
let current: PropertyInfo<T> | undefined = this;
|
|
138
|
-
|
|
139
|
-
while (current) {
|
|
140
|
-
chain.unshift(current);
|
|
141
|
-
current = current.parent;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
this._propertyChainCache = chain;
|
|
145
|
-
return chain;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
private _needsOptionalChaining(prop: PropertyInfo<T>, assignmentType?: AssignmentType): boolean {
|
|
149
|
-
if (assignmentType === "ASSIGNMENT") {
|
|
150
|
-
return false;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
return assignmentType === "FORCE_NULLABLE_OR_OPTIONAL" || prop.isNullable || prop.isOptional;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
private _resolvePathArray(options?: {
|
|
157
|
-
root?: string,
|
|
158
|
-
assignmentType?: AssignmentType
|
|
159
|
-
useFromPropertyName?: boolean
|
|
160
|
-
}) {
|
|
161
|
-
const propertyChain = this._getPropertyChain();
|
|
162
|
-
const hasRoot = options?.root != null;
|
|
163
|
-
const path: string[] = hasRoot ? [options!.root!] : [];
|
|
164
|
-
|
|
165
|
-
for (const prop of propertyChain) {
|
|
166
|
-
const accessor = this._needsOptionalChaining(prop, options?.assignmentType) ? '?.' : '.';
|
|
167
|
-
path.push(accessor, options?.useFromPropertyName ? prop.from : prop.name);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
return path;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Returns an array of property names representing the path from the root to this property.
|
|
175
|
-
*
|
|
176
|
-
* @returns {string[]} The property path as an array of names.
|
|
177
|
-
*/
|
|
178
|
-
getPathArray() {
|
|
179
|
-
if (this._pathArrayCache) {
|
|
180
|
-
return this._pathArrayCache;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
const path: string[] = [];
|
|
184
|
-
const propertyChain = this._getPropertyChain();
|
|
185
|
-
|
|
186
|
-
for (const prop of propertyChain) {
|
|
187
|
-
path.push(prop.name);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
this._pathArrayCache = path;
|
|
191
|
-
return path;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* Returns an array of property names representing the path from the root to the parent of this property.
|
|
196
|
-
*
|
|
197
|
-
* @returns {string[]} The property path as an array of names, excluding this property.
|
|
198
|
-
*/
|
|
199
|
-
getParentPathArray() {
|
|
200
|
-
if (this._parentPathArrayCache) {
|
|
201
|
-
return this._parentPathArrayCache;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
const path: string[] = [];
|
|
205
|
-
const propertyChain = this._getPropertyChain();
|
|
206
|
-
|
|
207
|
-
for (let i = 0; i < propertyChain.length - 1; i++) {
|
|
208
|
-
const prop = propertyChain[i];
|
|
209
|
-
path.push(prop.name);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
this._parentPathArrayCache = path;
|
|
213
|
-
return path;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* Returns true if any parent property is nullable or optional.
|
|
218
|
-
*
|
|
219
|
-
* @returns {boolean} True if any parent is nullable or optional, false otherwise.
|
|
220
|
-
*/
|
|
221
|
-
get hasNullableParents() {
|
|
222
|
-
if (this._hasNullableParentsCache !== undefined) {
|
|
223
|
-
return this._hasNullableParentsCache;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
let parent = this.parent;
|
|
227
|
-
while (parent != null) {
|
|
228
|
-
if (parent.isNullable || parent.isOptional) {
|
|
229
|
-
this._hasNullableParentsCache = true;
|
|
230
|
-
return true;
|
|
231
|
-
}
|
|
232
|
-
parent = parent.parent;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
this._hasNullableParentsCache = false;
|
|
236
|
-
return false;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
* Returns true if any child property (recursively) is an identity property.
|
|
241
|
-
*
|
|
242
|
-
* @returns {boolean} True if any child is an identity property, false otherwise.
|
|
243
|
-
*/
|
|
244
|
-
get hasIdentityChildren() {
|
|
245
|
-
const children = [...this.children];
|
|
246
|
-
for (let i = 0; i < children.length; i++) {
|
|
247
|
-
const child = children[i];
|
|
248
|
-
if (child.isIdentity === true) {
|
|
249
|
-
return true;
|
|
250
|
-
}
|
|
251
|
-
if (child.children.length > 0) {
|
|
252
|
-
children.push(...child.children)
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
return false;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* Gets the value of this property from the given instance, following the property path.
|
|
260
|
-
*
|
|
261
|
-
* @param instance The object instance to retrieve the value from.
|
|
262
|
-
* @returns The value of the property, or null if not found.
|
|
263
|
-
*/
|
|
264
|
-
getValue(instance: unknown) {
|
|
265
|
-
if (instance == null) {
|
|
266
|
-
return null;
|
|
267
|
-
}
|
|
268
|
-
const pathArray = this.getPathArray();
|
|
269
|
-
let current: any = instance;
|
|
270
|
-
for (const prop of pathArray) {
|
|
271
|
-
if (current == null) {
|
|
272
|
-
return null;
|
|
273
|
-
}
|
|
274
|
-
current = current[prop];
|
|
275
|
-
}
|
|
276
|
-
return current;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
/**
|
|
280
|
-
* Sets the value of this property on the given instance, creating intermediate objects as needed.
|
|
281
|
-
*
|
|
282
|
-
* @param instance The object instance to set the value on.
|
|
283
|
-
* @param value The value to set.
|
|
284
|
-
*/
|
|
285
|
-
setValue(instance: unknown, value: unknown) {
|
|
286
|
-
if (instance == null) {
|
|
287
|
-
throw new Error('Cannot set value on null or undefined instance');
|
|
288
|
-
}
|
|
289
|
-
const pathArray = this.getPathArray();
|
|
290
|
-
const length = pathArray.length;
|
|
291
|
-
// Fast path for single level properties
|
|
292
|
-
if (length === 1) {
|
|
293
|
-
(instance as any)[pathArray[0]] = value;
|
|
294
|
-
return;
|
|
295
|
-
}
|
|
296
|
-
let current: any = instance;
|
|
297
|
-
let i = 0;
|
|
298
|
-
// Navigate to the parent of the target property
|
|
299
|
-
while (i < length - 1) {
|
|
300
|
-
const prop = pathArray[i];
|
|
301
|
-
const next = current[prop];
|
|
302
|
-
// Only create new object if next level doesn't exist
|
|
303
|
-
if (next == null) {
|
|
304
|
-
current[prop] = {};
|
|
305
|
-
}
|
|
306
|
-
current = current[prop];
|
|
307
|
-
i++;
|
|
308
|
-
}
|
|
309
|
-
// Set the value on the final property
|
|
310
|
-
current[pathArray[length - 1]] = value;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
/**
|
|
314
|
-
* Returns a selector path string for this property, starting from the given parent variable name.
|
|
315
|
-
*
|
|
316
|
-
* @param options.parent The root variable name.
|
|
317
|
-
* @param options.assignmentType Optional assignment type for path resolution.
|
|
318
|
-
* @returns {string} The selector path string (e.g., 'parent.prop1.prop2').
|
|
319
|
-
*/
|
|
320
|
-
getSelectrorPath(options: { parent: string, assignmentType?: AssignmentType, useFromPropertyName?: boolean }) {
|
|
321
|
-
const parts = this._resolvePathArray({
|
|
322
|
-
root: options.parent,
|
|
323
|
-
assignmentType: options.assignmentType,
|
|
324
|
-
useFromPropertyName: options.useFromPropertyName
|
|
325
|
-
});
|
|
326
|
-
return parts.join("");
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
/**
|
|
330
|
-
* Returns an assignment path string for this property, optionally starting from a parent variable name.
|
|
331
|
-
*
|
|
332
|
-
* @param options.parent Optional root variable name.
|
|
333
|
-
* @returns {string} The assignment path string (e.g., 'prop1.prop2').
|
|
334
|
-
*/
|
|
335
|
-
getAssignmentPath(options?: { parent?: string, useFromPropertyName?: boolean }) {
|
|
336
|
-
const parts = this._resolvePathArray({
|
|
337
|
-
root: options?.parent,
|
|
338
|
-
assignmentType: "ASSIGNMENT",
|
|
339
|
-
useFromPropertyName: options?.useFromPropertyName
|
|
340
|
-
});
|
|
341
|
-
|
|
342
|
-
if (options?.parent == null) {
|
|
343
|
-
return parts.slice(1).join("");
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
return parts.join("");
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
deserialize(value: string | number) {
|
|
350
|
-
if (this.valueDeserializer != null) {
|
|
351
|
-
return this.valueDeserializer(value);
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
if (this.type === SchemaTypes.Date) {
|
|
355
|
-
return new Date(value);
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
if (this.type === SchemaTypes.String) {
|
|
359
|
-
return String(value);
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
if (this.type === SchemaTypes.Number) {
|
|
363
|
-
return Number(value);
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
if (this.type === SchemaTypes.Boolean) {
|
|
367
|
-
return Boolean(value);
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
throw new Error(`Unsupported deserialization for type. Type: ${this.type}`);
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
type AssignmentType = "FORCE_NULLABLE_OR_OPTIONAL" | "ASSIGNMENT";
|