@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
|
@@ -0,0 +1,659 @@
|
|
|
1
|
+
var __webpack_modules__ = ({
|
|
2
|
+
"./src/collections/Changes.ts":
|
|
3
|
+
/*!************************************!*\
|
|
4
|
+
!*** ./src/collections/Changes.ts ***!
|
|
5
|
+
\************************************/
|
|
6
|
+
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
7
|
+
__webpack_require__.r(__webpack_exports__);
|
|
8
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
9
|
+
BulkPersistChanges: () => (BulkPersistChanges),
|
|
10
|
+
BulkPersistResult: () => (BulkPersistResult),
|
|
11
|
+
SchemaPersistChanges: () => (SchemaPersistChanges),
|
|
12
|
+
SchemaPersistResult: () => (SchemaPersistResult)
|
|
13
|
+
});
|
|
14
|
+
/* ESM import */var _TagCollection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./TagCollection */ "./src/collections/TagCollection.ts");
|
|
15
|
+
|
|
16
|
+
class BulkPersistResult extends Map {
|
|
17
|
+
resolve(schemaId) {
|
|
18
|
+
if (this.has(schemaId)) {
|
|
19
|
+
return this.get(schemaId);
|
|
20
|
+
}
|
|
21
|
+
this.set(schemaId, new SchemaPersistResult());
|
|
22
|
+
return this.get(schemaId);
|
|
23
|
+
}
|
|
24
|
+
get(schemaId) {
|
|
25
|
+
return super.get(schemaId);
|
|
26
|
+
}
|
|
27
|
+
get aggregate() {
|
|
28
|
+
return {
|
|
29
|
+
size: this.aggregateSize,
|
|
30
|
+
adds: this.aggregateAddsSize,
|
|
31
|
+
updates: this.aggregateUpdatesSize,
|
|
32
|
+
removes: this.aggregateRemovesSize
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
get aggregateSize() {
|
|
36
|
+
let count = 0;
|
|
37
|
+
for (const [, result] of this) {
|
|
38
|
+
count += result.total;
|
|
39
|
+
}
|
|
40
|
+
return count;
|
|
41
|
+
}
|
|
42
|
+
get aggregateAddsSize() {
|
|
43
|
+
let count = 0;
|
|
44
|
+
for (const [, result] of this) {
|
|
45
|
+
count += result.adds.length;
|
|
46
|
+
}
|
|
47
|
+
return count;
|
|
48
|
+
}
|
|
49
|
+
get aggregateUpdatesSize() {
|
|
50
|
+
let count = 0;
|
|
51
|
+
for (const [, result] of this) {
|
|
52
|
+
count += result.updates.length;
|
|
53
|
+
}
|
|
54
|
+
return count;
|
|
55
|
+
}
|
|
56
|
+
get aggregateRemovesSize() {
|
|
57
|
+
let count = 0;
|
|
58
|
+
for (const [, result] of this) {
|
|
59
|
+
count += result.removes.length;
|
|
60
|
+
}
|
|
61
|
+
return count;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
class BulkPersistChanges extends Map {
|
|
65
|
+
resolve(schemaId) {
|
|
66
|
+
if (this.has(schemaId)) {
|
|
67
|
+
return this.get(schemaId);
|
|
68
|
+
}
|
|
69
|
+
this.set(schemaId, new SchemaPersistChanges());
|
|
70
|
+
return this.get(schemaId);
|
|
71
|
+
}
|
|
72
|
+
get(schemaId) {
|
|
73
|
+
return super.get(schemaId);
|
|
74
|
+
}
|
|
75
|
+
get aggregate() {
|
|
76
|
+
return {
|
|
77
|
+
size: this.aggregateSize,
|
|
78
|
+
adds: this.aggregateAddsSize,
|
|
79
|
+
updates: this.aggregateUpdatesSize,
|
|
80
|
+
removes: this.aggregateRemovesSize
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
get aggregateSize() {
|
|
84
|
+
let count = 0;
|
|
85
|
+
for (const [, result] of this) {
|
|
86
|
+
count += result.total;
|
|
87
|
+
}
|
|
88
|
+
return count;
|
|
89
|
+
}
|
|
90
|
+
get aggregateAddsSize() {
|
|
91
|
+
let count = 0;
|
|
92
|
+
for (const [, result] of this) {
|
|
93
|
+
count += result.adds.length;
|
|
94
|
+
}
|
|
95
|
+
return count;
|
|
96
|
+
}
|
|
97
|
+
get aggregateUpdatesSize() {
|
|
98
|
+
let count = 0;
|
|
99
|
+
for (const [, result] of this) {
|
|
100
|
+
count += result.updates.length;
|
|
101
|
+
}
|
|
102
|
+
return count;
|
|
103
|
+
}
|
|
104
|
+
get aggregateRemovesSize() {
|
|
105
|
+
let count = 0;
|
|
106
|
+
for (const [, result] of this) {
|
|
107
|
+
count += result.removes.length;
|
|
108
|
+
}
|
|
109
|
+
return count;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Ensures the result has the same result sets as the change sets
|
|
113
|
+
* @returns
|
|
114
|
+
*/
|
|
115
|
+
toResult() {
|
|
116
|
+
const result = new BulkPersistResult();
|
|
117
|
+
for (const [schemaId] of this) {
|
|
118
|
+
result.set(schemaId, new SchemaPersistResult());
|
|
119
|
+
}
|
|
120
|
+
return result;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
class SchemaPersistChanges {
|
|
124
|
+
adds = [];
|
|
125
|
+
updates = [];
|
|
126
|
+
removes = [];
|
|
127
|
+
tags = new _TagCollection__WEBPACK_IMPORTED_MODULE_0__.TagCollection();
|
|
128
|
+
get hasItems() {
|
|
129
|
+
return this.total > 0;
|
|
130
|
+
}
|
|
131
|
+
get total() {
|
|
132
|
+
return this.adds.length + this.updates.length + this.removes.length;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
class SchemaPersistResult {
|
|
136
|
+
adds = [];
|
|
137
|
+
updates = [];
|
|
138
|
+
removes = [];
|
|
139
|
+
get hasItems() {
|
|
140
|
+
return this.total > 0;
|
|
141
|
+
}
|
|
142
|
+
get total() {
|
|
143
|
+
return this.adds.length + this.updates.length + this.removes.length;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
}),
|
|
149
|
+
"./src/collections/IdSet.ts":
|
|
150
|
+
/*!**********************************!*\
|
|
151
|
+
!*** ./src/collections/IdSet.ts ***!
|
|
152
|
+
\**********************************/
|
|
153
|
+
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
154
|
+
__webpack_require__.r(__webpack_exports__);
|
|
155
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
156
|
+
IdSet: () => (IdSet)
|
|
157
|
+
});
|
|
158
|
+
class IdSet {
|
|
159
|
+
ids;
|
|
160
|
+
constructor(...ids) {
|
|
161
|
+
this.ids = Object.freeze(ids);
|
|
162
|
+
}
|
|
163
|
+
equals(other) {
|
|
164
|
+
if (this.ids.length === 1) {
|
|
165
|
+
return this.ids[0] === other.ids[0];
|
|
166
|
+
}
|
|
167
|
+
return this.toString() === other.toString();
|
|
168
|
+
}
|
|
169
|
+
toString() {
|
|
170
|
+
if (this.ids.length === 1) {
|
|
171
|
+
return String(this.ids[0]);
|
|
172
|
+
}
|
|
173
|
+
return this.ids.toString();
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
}),
|
|
179
|
+
"./src/collections/MemoryDataCollection.ts":
|
|
180
|
+
/*!*************************************************!*\
|
|
181
|
+
!*** ./src/collections/MemoryDataCollection.ts ***!
|
|
182
|
+
\*************************************************/
|
|
183
|
+
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
184
|
+
__webpack_require__.r(__webpack_exports__);
|
|
185
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
186
|
+
MemoryDataCollection: () => (MemoryDataCollection)
|
|
187
|
+
});
|
|
188
|
+
/* ESM import */var _schema__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../schema */ "./src/schema/types.ts");
|
|
189
|
+
/* ESM import */var _results__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../results */ "./src/results/Result.ts");
|
|
190
|
+
/* ESM import */var _utilities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utilities */ "./src/utilities/uuid.ts");
|
|
191
|
+
/* ESM import */var _IdSet__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./IdSet */ "./src/collections/IdSet.ts");
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
class MemoryDataCollection {
|
|
197
|
+
nextNumericalIds;
|
|
198
|
+
data;
|
|
199
|
+
schema;
|
|
200
|
+
idProperties;
|
|
201
|
+
get size() {
|
|
202
|
+
return this.data.size;
|
|
203
|
+
}
|
|
204
|
+
get records() {
|
|
205
|
+
return [...this.data.values()];
|
|
206
|
+
}
|
|
207
|
+
constructor(schema) {
|
|
208
|
+
this.data = new Map();
|
|
209
|
+
this.nextNumericalIds = new Map();
|
|
210
|
+
this.schema = schema;
|
|
211
|
+
this.idProperties = schema.idProperties;
|
|
212
|
+
}
|
|
213
|
+
_getNextId(property) {
|
|
214
|
+
let nextId = 1;
|
|
215
|
+
if (this.nextNumericalIds.has(property.id) === true) {
|
|
216
|
+
nextId = this.nextNumericalIds.get(property.id) + 1;
|
|
217
|
+
}
|
|
218
|
+
this.nextNumericalIds.set(property.id, nextId);
|
|
219
|
+
return nextId;
|
|
220
|
+
}
|
|
221
|
+
getAndSetId(item, property) {
|
|
222
|
+
if (item[property.name] != null) {
|
|
223
|
+
return item[property.name];
|
|
224
|
+
}
|
|
225
|
+
if (property.type === _schema__WEBPACK_IMPORTED_MODULE_0__.SchemaTypes.String) {
|
|
226
|
+
const uuid = (0,_utilities__WEBPACK_IMPORTED_MODULE_1__.uuidv4)();
|
|
227
|
+
item[property.name] = uuid;
|
|
228
|
+
return uuid;
|
|
229
|
+
}
|
|
230
|
+
if (property.type === _schema__WEBPACK_IMPORTED_MODULE_0__.SchemaTypes.Number) {
|
|
231
|
+
const id = this._getNextId(property);
|
|
232
|
+
item[property.name] = id;
|
|
233
|
+
return id;
|
|
234
|
+
}
|
|
235
|
+
throw new Error(`Id Property '${property.name}' must be string or number, found '${property.type}'`);
|
|
236
|
+
}
|
|
237
|
+
seed(items) {
|
|
238
|
+
for (let i = 0, length = items.length; i < length; i++) {
|
|
239
|
+
const id = this.resolveIdSet(items[i]);
|
|
240
|
+
this.data.set(id.toString(), items[i]);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
resolveCurrentIdSet(item) {
|
|
244
|
+
const idProperties = this.schema.idProperties;
|
|
245
|
+
const ids = [];
|
|
246
|
+
// ensure keys
|
|
247
|
+
for (let j = 0, l = idProperties.length; j < l; j++) {
|
|
248
|
+
const property = idProperties[j];
|
|
249
|
+
const value = property.getValue(item);
|
|
250
|
+
if (value == null) {
|
|
251
|
+
throw new Error(`Key cannot be null. Key: ${property.name}`);
|
|
252
|
+
}
|
|
253
|
+
ids.push(value);
|
|
254
|
+
}
|
|
255
|
+
return new _IdSet__WEBPACK_IMPORTED_MODULE_2__.IdSet(...ids);
|
|
256
|
+
}
|
|
257
|
+
resolveIdSet(item) {
|
|
258
|
+
if (this.schema.hasIdentityKeys) {
|
|
259
|
+
const ids = [];
|
|
260
|
+
const idProperties = this.schema.idProperties;
|
|
261
|
+
if (idProperties.length === 1) {
|
|
262
|
+
ids.push(this.getAndSetId(item, idProperties[0]));
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
for (let j = 0, l = idProperties.length; j < l; j++) {
|
|
266
|
+
ids.push(this.getAndSetId(item, idProperties[j]));
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
return new _IdSet__WEBPACK_IMPORTED_MODULE_2__.IdSet(...ids);
|
|
270
|
+
}
|
|
271
|
+
return this.resolveCurrentIdSet(item);
|
|
272
|
+
}
|
|
273
|
+
add(item) {
|
|
274
|
+
const id = this.resolveIdSet(item);
|
|
275
|
+
this.data.set(id.toString(), item);
|
|
276
|
+
}
|
|
277
|
+
remove(item) {
|
|
278
|
+
const id = this.resolveCurrentIdSet(item);
|
|
279
|
+
this.data.delete(id.toString());
|
|
280
|
+
}
|
|
281
|
+
update(item) {
|
|
282
|
+
const id = this.resolveCurrentIdSet(item);
|
|
283
|
+
this.data.set(id.toString(), item);
|
|
284
|
+
}
|
|
285
|
+
destroy(done) {
|
|
286
|
+
this.nextNumericalIds.clear();
|
|
287
|
+
this.data.clear();
|
|
288
|
+
done(_results__WEBPACK_IMPORTED_MODULE_3__.Result.success());
|
|
289
|
+
}
|
|
290
|
+
load(done) {
|
|
291
|
+
done(_results__WEBPACK_IMPORTED_MODULE_3__.Result.success());
|
|
292
|
+
}
|
|
293
|
+
save(done) {
|
|
294
|
+
done(_results__WEBPACK_IMPORTED_MODULE_3__.Result.success());
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
}),
|
|
300
|
+
"./src/collections/SchemaCollection.ts":
|
|
301
|
+
/*!*********************************************!*\
|
|
302
|
+
!*** ./src/collections/SchemaCollection.ts ***!
|
|
303
|
+
\*********************************************/
|
|
304
|
+
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
305
|
+
__webpack_require__.r(__webpack_exports__);
|
|
306
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
307
|
+
SchemaCollection: () => (SchemaCollection)
|
|
308
|
+
});
|
|
309
|
+
/**
|
|
310
|
+
* Collection of schemas with generic typing for type-safe schema retrieval
|
|
311
|
+
*/
|
|
312
|
+
class SchemaCollection extends Map {
|
|
313
|
+
get(schemaId) {
|
|
314
|
+
return super.get(schemaId);
|
|
315
|
+
}
|
|
316
|
+
getByName(collectionName) {
|
|
317
|
+
const found = [...this].find(x => x[1].collectionName === collectionName);
|
|
318
|
+
if (found != null) {
|
|
319
|
+
return found[1];
|
|
320
|
+
}
|
|
321
|
+
return undefined;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
}),
|
|
327
|
+
"./src/collections/TagCollection.ts":
|
|
328
|
+
/*!******************************************!*\
|
|
329
|
+
!*** ./src/collections/TagCollection.ts ***!
|
|
330
|
+
\******************************************/
|
|
331
|
+
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
332
|
+
__webpack_require__.r(__webpack_exports__);
|
|
333
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
334
|
+
TagCollection: () => (TagCollection)
|
|
335
|
+
});
|
|
336
|
+
class TagCollection {
|
|
337
|
+
data = new Map();
|
|
338
|
+
_size = 0;
|
|
339
|
+
get size() {
|
|
340
|
+
return this._size;
|
|
341
|
+
}
|
|
342
|
+
get(key) {
|
|
343
|
+
return this.data.get(key);
|
|
344
|
+
}
|
|
345
|
+
has(key) {
|
|
346
|
+
return this.data.has(key);
|
|
347
|
+
}
|
|
348
|
+
set(key, tag) {
|
|
349
|
+
this._size++;
|
|
350
|
+
return this.data.set(key, tag);
|
|
351
|
+
}
|
|
352
|
+
delete(key) {
|
|
353
|
+
const result = this.data.delete(key);
|
|
354
|
+
if (result) {
|
|
355
|
+
this._size--;
|
|
356
|
+
}
|
|
357
|
+
return result;
|
|
358
|
+
}
|
|
359
|
+
setMany(keys, tag) {
|
|
360
|
+
this._size += keys.length;
|
|
361
|
+
for (let i = 0, length = keys.length; i < length; i++) {
|
|
362
|
+
const key = keys[i];
|
|
363
|
+
this.set(key, tag);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
combine(tags) {
|
|
367
|
+
for (const [key, value] of tags) {
|
|
368
|
+
this.data.set(key, value);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
values() {
|
|
372
|
+
return this.data.values();
|
|
373
|
+
}
|
|
374
|
+
keys() {
|
|
375
|
+
return this.data.keys();
|
|
376
|
+
}
|
|
377
|
+
[Symbol.dispose]() {
|
|
378
|
+
this.data = null;
|
|
379
|
+
}
|
|
380
|
+
[Symbol.iterator]() {
|
|
381
|
+
return this.data[Symbol.iterator]();
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
}),
|
|
387
|
+
"./src/results/Result.ts":
|
|
388
|
+
/*!*******************************!*\
|
|
389
|
+
!*** ./src/results/Result.ts ***!
|
|
390
|
+
\*******************************/
|
|
391
|
+
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
392
|
+
__webpack_require__.r(__webpack_exports__);
|
|
393
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
394
|
+
PluginEventResult: () => (PluginEventResult),
|
|
395
|
+
Result: () => (Result)
|
|
396
|
+
});
|
|
397
|
+
class BaseResult {
|
|
398
|
+
static ERROR = "error";
|
|
399
|
+
static SUCCESS = "success";
|
|
400
|
+
static PARTIAL = "partial";
|
|
401
|
+
static resolve(result, resolve, reject) {
|
|
402
|
+
if (result.ok === BaseResult.SUCCESS) {
|
|
403
|
+
resolve(result.data);
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
if (result.ok === BaseResult.PARTIAL) {
|
|
407
|
+
reject({
|
|
408
|
+
partial: result.data,
|
|
409
|
+
error: result.error
|
|
410
|
+
});
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
reject(result.error);
|
|
414
|
+
}
|
|
415
|
+
static assertSuccess(result) {
|
|
416
|
+
if (result.ok !== BaseResult.SUCCESS) {
|
|
417
|
+
throw new Error(`Expected success result, but got ${result.ok}: ${result.error}`);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
class Result extends BaseResult {
|
|
422
|
+
static success(data) {
|
|
423
|
+
return {
|
|
424
|
+
ok: Result.SUCCESS,
|
|
425
|
+
data
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
static error(error) {
|
|
429
|
+
return {
|
|
430
|
+
ok: Result.ERROR,
|
|
431
|
+
error
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
static partial(data, error) {
|
|
435
|
+
return {
|
|
436
|
+
ok: Result.PARTIAL,
|
|
437
|
+
data,
|
|
438
|
+
error
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
class PluginEventResult extends BaseResult {
|
|
443
|
+
static success(id, data) {
|
|
444
|
+
return {
|
|
445
|
+
id,
|
|
446
|
+
ok: Result.SUCCESS,
|
|
447
|
+
data
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
static error(id, error) {
|
|
451
|
+
return {
|
|
452
|
+
id,
|
|
453
|
+
ok: Result.ERROR,
|
|
454
|
+
error
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
static partial(id, data, error) {
|
|
458
|
+
return {
|
|
459
|
+
id,
|
|
460
|
+
ok: Result.PARTIAL,
|
|
461
|
+
data,
|
|
462
|
+
error
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
static assertSuccess(result) {
|
|
466
|
+
if (result.ok !== Result.SUCCESS) {
|
|
467
|
+
throw new Error(`Expected success result, but got ${result.ok}: ${result.error}`);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
}),
|
|
474
|
+
"./src/schema/types.ts":
|
|
475
|
+
/*!*****************************!*\
|
|
476
|
+
!*** ./src/schema/types.ts ***!
|
|
477
|
+
\*****************************/
|
|
478
|
+
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
479
|
+
__webpack_require__.r(__webpack_exports__);
|
|
480
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
481
|
+
HashType: () => (HashType),
|
|
482
|
+
SchemaTypes: () => (SchemaTypes)
|
|
483
|
+
});
|
|
484
|
+
var SchemaTypes;
|
|
485
|
+
(function (SchemaTypes) {
|
|
486
|
+
SchemaTypes["Array"] = "Array";
|
|
487
|
+
SchemaTypes["Boolean"] = "Boolean";
|
|
488
|
+
SchemaTypes["Date"] = "Date";
|
|
489
|
+
SchemaTypes["Number"] = "Number";
|
|
490
|
+
SchemaTypes["Object"] = "Object";
|
|
491
|
+
SchemaTypes["String"] = "String";
|
|
492
|
+
SchemaTypes["Definition"] = "Definition";
|
|
493
|
+
SchemaTypes["Function"] = "Function";
|
|
494
|
+
SchemaTypes["Computed"] = "Computed";
|
|
495
|
+
})(SchemaTypes || (SchemaTypes = {}));
|
|
496
|
+
var HashType;
|
|
497
|
+
(function (HashType) {
|
|
498
|
+
HashType["Ids"] = "Ids";
|
|
499
|
+
HashType["Object"] = "Object";
|
|
500
|
+
})(HashType || (HashType = {}));
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
}),
|
|
504
|
+
"./src/utilities/uuid.ts":
|
|
505
|
+
/*!*******************************!*\
|
|
506
|
+
!*** ./src/utilities/uuid.ts ***!
|
|
507
|
+
\*******************************/
|
|
508
|
+
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
509
|
+
__webpack_require__.r(__webpack_exports__);
|
|
510
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
511
|
+
uuid: () => (uuid),
|
|
512
|
+
uuidv4: () => (uuidv4)
|
|
513
|
+
});
|
|
514
|
+
const uuid = (length = 16) => {
|
|
515
|
+
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
516
|
+
const charLength = chars.length;
|
|
517
|
+
let result = '';
|
|
518
|
+
for (let i = 0; i < length; i++) {
|
|
519
|
+
result += chars[Math.random() * charLength | 0];
|
|
520
|
+
}
|
|
521
|
+
return result;
|
|
522
|
+
};
|
|
523
|
+
const HEX_CHARS = '0123456789abcdef';
|
|
524
|
+
const UUID_TEMPLATE = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';
|
|
525
|
+
const hasCrypto = typeof crypto !== 'undefined' && typeof crypto.getRandomValues === 'function';
|
|
526
|
+
const uuidv4 = () => {
|
|
527
|
+
let randomBytes = null;
|
|
528
|
+
if (hasCrypto) {
|
|
529
|
+
randomBytes = crypto.getRandomValues(new Uint8Array(16));
|
|
530
|
+
}
|
|
531
|
+
let byteIndex = 0;
|
|
532
|
+
let uuid = '';
|
|
533
|
+
for (let i = 0; i < UUID_TEMPLATE.length; i++) {
|
|
534
|
+
const c = UUID_TEMPLATE[i];
|
|
535
|
+
if (c === '-') {
|
|
536
|
+
uuid += '-';
|
|
537
|
+
continue;
|
|
538
|
+
}
|
|
539
|
+
let r;
|
|
540
|
+
if (hasCrypto && randomBytes) {
|
|
541
|
+
// Each byte gives two hex digits (nibbles)
|
|
542
|
+
r =
|
|
543
|
+
(i % 2 === 0
|
|
544
|
+
? randomBytes[byteIndex] >> 4
|
|
545
|
+
: randomBytes[byteIndex++] & 0x0f);
|
|
546
|
+
}
|
|
547
|
+
else {
|
|
548
|
+
r = Math.floor(Math.random() * 16);
|
|
549
|
+
}
|
|
550
|
+
if (c === 'x') {
|
|
551
|
+
uuid += HEX_CHARS[r];
|
|
552
|
+
}
|
|
553
|
+
else if (c === 'y') {
|
|
554
|
+
// Variant bits: 8, 9, A, or B
|
|
555
|
+
uuid += HEX_CHARS[(r & 0x3) | 0x8];
|
|
556
|
+
}
|
|
557
|
+
else if (c === '4') {
|
|
558
|
+
uuid += '4';
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
return uuid;
|
|
562
|
+
};
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
}),
|
|
566
|
+
|
|
567
|
+
});
|
|
568
|
+
/************************************************************************/
|
|
569
|
+
// The module cache
|
|
570
|
+
var __webpack_module_cache__ = {};
|
|
571
|
+
|
|
572
|
+
// The require function
|
|
573
|
+
function __webpack_require__(moduleId) {
|
|
574
|
+
|
|
575
|
+
// Check if module is in cache
|
|
576
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
577
|
+
if (cachedModule !== undefined) {
|
|
578
|
+
return cachedModule.exports;
|
|
579
|
+
}
|
|
580
|
+
// Create a new module (and put it into the cache)
|
|
581
|
+
var module = (__webpack_module_cache__[moduleId] = {
|
|
582
|
+
exports: {}
|
|
583
|
+
});
|
|
584
|
+
// Execute the module function
|
|
585
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
586
|
+
|
|
587
|
+
// Return the exports of the module
|
|
588
|
+
return module.exports;
|
|
589
|
+
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
/************************************************************************/
|
|
593
|
+
// webpack/runtime/define_property_getters
|
|
594
|
+
(() => {
|
|
595
|
+
__webpack_require__.d = (exports, definition) => {
|
|
596
|
+
for(var key in definition) {
|
|
597
|
+
if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
598
|
+
Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
};
|
|
602
|
+
})();
|
|
603
|
+
// webpack/runtime/has_own_property
|
|
604
|
+
(() => {
|
|
605
|
+
__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
606
|
+
})();
|
|
607
|
+
// webpack/runtime/make_namespace_object
|
|
608
|
+
(() => {
|
|
609
|
+
// define __esModule on exports
|
|
610
|
+
__webpack_require__.r = (exports) => {
|
|
611
|
+
if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
612
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
613
|
+
}
|
|
614
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
615
|
+
};
|
|
616
|
+
})();
|
|
617
|
+
/************************************************************************/
|
|
618
|
+
var __webpack_exports__ = {};
|
|
619
|
+
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
|
|
620
|
+
(() => {
|
|
621
|
+
|
|
622
|
+
/*!**********************************!*\
|
|
623
|
+
!*** ./src/collections/index.ts ***!
|
|
624
|
+
\**********************************/
|
|
625
|
+
__webpack_require__.r(__webpack_exports__);
|
|
626
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
627
|
+
BulkPersistChanges: () => (/* reexport safe */ _Changes__WEBPACK_IMPORTED_MODULE_0__.BulkPersistChanges),
|
|
628
|
+
BulkPersistResult: () => (/* reexport safe */ _Changes__WEBPACK_IMPORTED_MODULE_0__.BulkPersistResult),
|
|
629
|
+
IdSet: () => (/* reexport safe */ _IdSet__WEBPACK_IMPORTED_MODULE_2__.IdSet),
|
|
630
|
+
MemoryDataCollection: () => (/* reexport safe */ _MemoryDataCollection__WEBPACK_IMPORTED_MODULE_3__.MemoryDataCollection),
|
|
631
|
+
SchemaCollection: () => (/* reexport safe */ _SchemaCollection__WEBPACK_IMPORTED_MODULE_4__.SchemaCollection),
|
|
632
|
+
SchemaPersistChanges: () => (/* reexport safe */ _Changes__WEBPACK_IMPORTED_MODULE_0__.SchemaPersistChanges),
|
|
633
|
+
SchemaPersistResult: () => (/* reexport safe */ _Changes__WEBPACK_IMPORTED_MODULE_0__.SchemaPersistResult),
|
|
634
|
+
TagCollection: () => (/* reexport safe */ _TagCollection__WEBPACK_IMPORTED_MODULE_1__.TagCollection)
|
|
635
|
+
});
|
|
636
|
+
/* ESM import */var _Changes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Changes */ "./src/collections/Changes.ts");
|
|
637
|
+
/* ESM import */var _TagCollection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TagCollection */ "./src/collections/TagCollection.ts");
|
|
638
|
+
/* ESM import */var _IdSet__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./IdSet */ "./src/collections/IdSet.ts");
|
|
639
|
+
/* ESM import */var _MemoryDataCollection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./MemoryDataCollection */ "./src/collections/MemoryDataCollection.ts");
|
|
640
|
+
/* ESM import */var _SchemaCollection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./SchemaCollection */ "./src/collections/SchemaCollection.ts");
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
})();
|
|
648
|
+
|
|
649
|
+
var __webpack_exports__BulkPersistChanges = __webpack_exports__.BulkPersistChanges;
|
|
650
|
+
var __webpack_exports__BulkPersistResult = __webpack_exports__.BulkPersistResult;
|
|
651
|
+
var __webpack_exports__IdSet = __webpack_exports__.IdSet;
|
|
652
|
+
var __webpack_exports__MemoryDataCollection = __webpack_exports__.MemoryDataCollection;
|
|
653
|
+
var __webpack_exports__SchemaCollection = __webpack_exports__.SchemaCollection;
|
|
654
|
+
var __webpack_exports__SchemaPersistChanges = __webpack_exports__.SchemaPersistChanges;
|
|
655
|
+
var __webpack_exports__SchemaPersistResult = __webpack_exports__.SchemaPersistResult;
|
|
656
|
+
var __webpack_exports__TagCollection = __webpack_exports__.TagCollection;
|
|
657
|
+
export { __webpack_exports__BulkPersistChanges as BulkPersistChanges, __webpack_exports__BulkPersistResult as BulkPersistResult, __webpack_exports__IdSet as IdSet, __webpack_exports__MemoryDataCollection as MemoryDataCollection, __webpack_exports__SchemaCollection as SchemaCollection, __webpack_exports__SchemaPersistChanges as SchemaPersistChanges, __webpack_exports__SchemaPersistResult as SchemaPersistResult, __webpack_exports__TagCollection as TagCollection };
|
|
658
|
+
|
|
659
|
+
//# sourceMappingURL=index.js.map
|