@routier/core 0.2.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/{readme.md → README.md} +3 -3
- package/dist/assertions/index.cjs +191 -0
- package/dist/assertions/index.cjs.map +1 -0
- package/dist/assertions/index.js +43 -63
- package/dist/assertions/index.js.map +1 -1
- package/dist/capabilities/index.cjs +820 -0
- package/dist/capabilities/index.cjs.map +1 -0
- package/dist/capabilities/index.js +584 -558
- package/dist/capabilities/index.js.map +1 -1
- package/dist/codegen/handlers/CloneHandlerBuilder.d.ts +10 -1
- package/dist/codegen/handlers/clone/CloneArrayHandler.d.ts +3 -0
- package/dist/codegen/handlers/clone/CloneDateHandler.d.ts +13 -0
- package/dist/codegen/handlers/clone/CloneValueHandler.d.ts +16 -0
- package/dist/codegen/handlers/compare/CompareComputedHandler.d.ts +10 -0
- package/dist/codegen/handlers/compare/CompareFunctionHandler.d.ts +10 -0
- package/dist/codegen/handlers/deserialize/DeserializeArrayHandler.d.ts +14 -0
- package/dist/codegen/handlers/enableChangeTracking/EnableChangeTrackingArrayHandler.d.ts +11 -0
- package/dist/codegen/handlers/enrichment/EnrichmentArrayHandler.d.ts +11 -0
- package/dist/codegen/handlers/freeze/FreezeArrayHandler.d.ts +6 -0
- package/dist/codegen/handlers/hash/HashArrayHandler.d.ts +10 -0
- package/dist/codegen/handlers/hash/HashFileHandler.d.ts +24 -0
- package/dist/codegen/handlers/hash/HashObjectHandler.d.ts +10 -0
- package/dist/codegen/handlers/hash/HashTransformHandler.d.ts +23 -0
- package/dist/codegen/handlers/merge/MergeArrayHandler.d.ts +20 -0
- package/dist/codegen/handlers/merge/MergeObjectHandler.d.ts +10 -0
- package/dist/codegen/handlers/serialize/SerializeArrayHandler.d.ts +19 -0
- package/dist/codegen/handlers/strip/StripComputedHandler.d.ts +10 -0
- package/dist/codegen/handlers/strip/StripFunctionHandler.d.ts +9 -0
- package/dist/codegen/handlers/types.d.ts +55 -1
- package/dist/codegen/index.cjs +618 -0
- package/dist/codegen/index.cjs.map +1 -0
- package/dist/codegen/index.js +99 -127
- package/dist/codegen/index.js.map +1 -1
- package/dist/collections/MemoryDataCollection.d.ts +15 -1
- package/dist/collections/TagCollection.d.ts +0 -1
- package/dist/collections/index.cjs +702 -0
- package/dist/collections/index.cjs.map +1 -0
- package/dist/collections/index.js +282 -276
- package/dist/collections/index.js.map +1 -1
- package/dist/errors/OptimisticConcurrencyError.d.ts +18 -0
- package/dist/errors/PluginDestroyedError.d.ts +10 -0
- package/dist/errors/index.cjs +132 -0
- package/dist/errors/index.cjs.map +1 -0
- package/dist/errors/index.d.ts +2 -0
- package/dist/errors/index.js +61 -19
- package/dist/errors/index.js.map +1 -1
- package/dist/expressions/evaluate.d.ts +53 -0
- package/dist/expressions/index.cjs +2087 -0
- package/dist/expressions/index.cjs.map +1 -0
- package/dist/expressions/index.d.ts +1 -1
- package/dist/expressions/index.js +1727 -1082
- package/dist/expressions/index.js.map +1 -1
- package/dist/expressions/parser.d.ts +19 -0
- package/dist/expressions/types.d.ts +87 -2
- package/dist/index.cjs +14377 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +12374 -7931
- package/dist/index.js.map +1 -1
- package/dist/performance/index.cjs +217 -0
- package/dist/performance/index.cjs.map +1 -0
- package/dist/performance/index.js +120 -55
- package/dist/performance/index.js.map +1 -1
- package/dist/pipeline/index.cjs +576 -0
- package/dist/pipeline/index.cjs.map +1 -0
- package/dist/pipeline/index.js +223 -161
- package/dist/pipeline/index.js.map +1 -1
- package/dist/plugins/BatchingDbPlugin.d.ts +139 -0
- package/dist/plugins/CacheDbPlugin.d.ts +70 -0
- package/dist/plugins/ConcurrencyDbPlugin.d.ts +78 -0
- package/dist/plugins/EphemeralDataPlugin.d.ts +57 -1
- package/dist/plugins/RetryDbPlugin.d.ts +77 -0
- package/dist/plugins/index.cjs +6551 -0
- package/dist/plugins/index.cjs.map +1 -0
- package/dist/plugins/index.d.ts +5 -0
- package/dist/plugins/index.js +6271 -1170
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/query/QueryOptionsCollection.d.ts +34 -0
- package/dist/plugins/query/explain.d.ts +82 -0
- package/dist/plugins/query/formatExplanation.d.ts +9 -0
- package/dist/plugins/query/index.d.ts +4 -0
- package/dist/plugins/query/join.d.ts +210 -0
- package/dist/plugins/query/similarity.d.ts +38 -0
- package/dist/plugins/query/types.d.ts +75 -1
- package/dist/plugins/translators/DataTranslator.d.ts +28 -0
- package/dist/plugins/translators/JsonTranslator.d.ts +27 -0
- package/dist/plugins/translators/SqlTranslator.d.ts +45 -0
- package/dist/plugins/translators/TupleTranslator.d.ts +45 -0
- package/dist/plugins/translators/index.d.ts +1 -0
- package/dist/plugins/types.d.ts +125 -3
- package/dist/plugins/wire/handler.d.ts +122 -0
- package/dist/plugins/wire/index.d.ts +4 -0
- package/dist/plugins/wire/persist.d.ts +43 -0
- package/dist/plugins/wire/query.d.ts +49 -0
- package/dist/plugins/wire/types.d.ts +139 -0
- package/dist/results/index.cjs +174 -0
- package/dist/results/index.cjs.map +1 -0
- package/dist/results/index.js +29 -44
- package/dist/results/index.js.map +1 -1
- package/dist/schema/PropertyInfo.d.ts +31 -2
- package/dist/schema/SchemaDefinition.d.ts +23 -1
- package/dist/schema/builder.d.ts +35 -1
- package/dist/schema/communication/broadcast.d.ts +17 -1
- package/dist/schema/index.cjs +6911 -0
- package/dist/schema/index.cjs.map +1 -0
- package/dist/schema/index.d.ts +2 -0
- package/dist/schema/index.js +5330 -4541
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/property/base/SchemaBase.d.ts +48 -2
- package/dist/schema/property/modifiers/SchemaNullable.d.ts +10 -0
- package/dist/schema/property/modifiers/SchemaOptional.d.ts +19 -0
- package/dist/schema/property/modifiers/SchemaSearchable.d.ts +34 -0
- package/dist/schema/property/modifiers/index.d.ts +1 -0
- package/dist/schema/property/types/SchemaFile.d.ts +60 -0
- package/dist/schema/property/types/SchemaString.d.ts +21 -1
- package/dist/schema/property/types/SchemaVector.d.ts +61 -0
- package/dist/schema/property/types/index.d.ts +2 -0
- package/dist/schema/table/SchemaTransform.d.ts +40 -0
- package/dist/schema/table/index.d.ts +1 -0
- package/dist/schema/types.d.ts +166 -8
- package/dist/schema/utils/propertyKind.d.ts +4 -0
- package/dist/types/index.cjs +23 -0
- package/dist/types/index.cjs.map +1 -0
- package/dist/types/index.js +0 -14
- package/dist/types/index.js.map +1 -1
- package/dist/utilities/index.cjs +1013 -0
- package/dist/utilities/index.cjs.map +1 -0
- package/dist/utilities/index.js +541 -379
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/logger.d.ts +48 -0
- package/package.json +156 -98
- package/dist/codegen/SlotPath.test.d.ts +0 -1
- package/dist/codegen/blocks.test.d.ts +0 -1
- package/dist/codegen/utils.test.d.ts +0 -1
- package/dist/collections/Changes.test.d.ts +0 -1
- package/dist/collections/IdSet.test.d.ts +0 -1
- package/dist/collections/MemoryDataCollection.test.d.ts +0 -1
- package/dist/collections/TagCollection.contract.test.d.ts +0 -1
- package/dist/collections/TagCollection.test.d.ts +0 -1
- package/dist/expressions/parser.test.d.ts +0 -1
- package/dist/expressions/sql.d.ts +0 -28
- package/dist/expressions/sql.test.d.ts +0 -1
- package/dist/expressions/utils.test.d.ts +0 -1
- package/dist/pipeline/SyncronousQueue.test.d.ts +0 -1
- package/dist/plugins/EphemeralDataPlugin.test.d.ts +0 -1
- package/dist/plugins/query/Query.test.d.ts +0 -1
- package/dist/plugins/query/QueryOptionsCollection.test.d.ts +0 -1
- package/dist/plugins/translators/JsonTranslator.test.d.ts +0 -1
- package/dist/plugins/translators/SqlTranslator.test.d.ts +0 -1
- package/dist/plugins/translators/TranslatedValues.test.d.ts +0 -1
- package/dist/results/Result.test.d.ts +0 -1
- package/dist/results/utils.test.d.ts +0 -1
- package/dist/schema/PropertyInfo.test.d.ts +0 -1
- package/dist/schema/communication/broadcast.test.d.ts +0 -1
- package/dist/schema/schemaGeneration.test.d.ts +0 -1
- package/dist/schema/utils/standardJsonSchema.test.d.ts +0 -1
- package/dist/utilities/arrays.test.d.ts +0 -1
- package/dist/utilities/dates.test.d.ts +0 -1
- package/dist/utilities/runtime.test.d.ts +0 -1
- package/dist/utilities/strings.test.d.ts +0 -1
- package/dist/utilities/uuid.test.d.ts +0 -1
package/dist/utilities/index.js
CHANGED
|
@@ -1,27 +1,12 @@
|
|
|
1
1
|
var __webpack_modules__ = ({
|
|
2
|
-
|
|
3
|
-
__webpack_require__.r(__webpack_exports__);
|
|
2
|
+
126(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
4
3
|
__webpack_require__.d(__webpack_exports__, {
|
|
5
|
-
|
|
6
|
-
assertInstanceOf: () => (assertInstanceOf),
|
|
7
|
-
assertIsArray: () => (assertIsArray),
|
|
8
|
-
assertIsNotNull: () => (assertIsNotNull),
|
|
9
|
-
assertIsNumber: () => (assertIsNumber),
|
|
10
|
-
assertString: () => (assertString),
|
|
11
|
-
isComparatorExpression: () => (isComparatorExpression),
|
|
12
|
-
isEmptyExpression: () => (isEmptyExpression),
|
|
13
|
-
isExpression: () => (isExpression),
|
|
14
|
-
isNotParsableExpression: () => (isNotParsableExpression),
|
|
15
|
-
isOperatorExpression: () => (isOperatorExpression),
|
|
16
|
-
isPropertyExpression: () => (isPropertyExpression),
|
|
17
|
-
isValueExpression: () => (isValueExpression)
|
|
4
|
+
e3: () => (isPropertyExpression)
|
|
18
5
|
});
|
|
19
|
-
/* import */ var _expressions_constants__rspack_import_1 = __webpack_require__("./src/expressions/constants.ts");
|
|
20
|
-
/* import */ var _utilities__rspack_import_0 = __webpack_require__("./src/utilities/dates.ts");
|
|
21
6
|
|
|
22
7
|
|
|
23
8
|
function assertDate(data) {
|
|
24
|
-
if (
|
|
9
|
+
if (isDate(data) === false) {
|
|
25
10
|
throw new TypeError('Value is not a Date');
|
|
26
11
|
}
|
|
27
12
|
}
|
|
@@ -65,77 +50,51 @@ function isObjectWithType(value) {
|
|
|
65
50
|
}
|
|
66
51
|
/**
|
|
67
52
|
* Type guard: narrows `value` to `Expression` when it is an object with a valid `type` property.
|
|
68
|
-
*/
|
|
69
|
-
|
|
70
|
-
return isObjectWithType(value) && _expressions_constants__rspack_import_1.EXPRESSION_TYPES.includes(value.type);
|
|
53
|
+
*/ function isExpression(value) {
|
|
54
|
+
return isObjectWithType(value) && EXPRESSION_TYPES.includes(value.type);
|
|
71
55
|
}
|
|
72
56
|
/**
|
|
73
57
|
* Type guard: narrows `value` to `OperatorExpression` when it is an object with `type === "operator"`.
|
|
74
|
-
*/
|
|
75
|
-
function isOperatorExpression(value) {
|
|
58
|
+
*/ function isOperatorExpression(value) {
|
|
76
59
|
return isObjectWithType(value) && value.type === "operator";
|
|
77
60
|
}
|
|
78
61
|
/**
|
|
79
62
|
* Type guard: narrows `value` to `ComparatorExpression` when it is an object with `type === "comparator"`.
|
|
80
|
-
*/
|
|
81
|
-
function isComparatorExpression(value) {
|
|
63
|
+
*/ function isComparatorExpression(value) {
|
|
82
64
|
return isObjectWithType(value) && value.type === "comparator";
|
|
83
65
|
}
|
|
84
66
|
/**
|
|
85
67
|
* Type guard: narrows `value` to `PropertyExpression` when it is an object with `type === "property"`.
|
|
86
|
-
*/
|
|
87
|
-
function isPropertyExpression(value) {
|
|
68
|
+
*/ function isPropertyExpression(value) {
|
|
88
69
|
return isObjectWithType(value) && value.type === "property";
|
|
89
70
|
}
|
|
90
71
|
/**
|
|
91
72
|
* Type guard: narrows `value` to `ValueExpression` when it is an object with `type === "value"`.
|
|
92
|
-
*/
|
|
93
|
-
function isValueExpression(value) {
|
|
73
|
+
*/ function isValueExpression(value) {
|
|
94
74
|
return isObjectWithType(value) && value.type === "value";
|
|
95
75
|
}
|
|
96
76
|
/**
|
|
97
77
|
* Type guard: narrows `value` to `EmptyExpression` when it is an object with `type === "empty"`.
|
|
98
|
-
*/
|
|
99
|
-
function isEmptyExpression(value) {
|
|
78
|
+
*/ function isEmptyExpression(value) {
|
|
100
79
|
return isObjectWithType(value) && value.type === "empty";
|
|
101
80
|
}
|
|
102
81
|
/**
|
|
103
82
|
* Type guard: narrows `value` to `NotParsableExpression` when it is an object with `type === "not-parsable"`.
|
|
104
|
-
*/
|
|
105
|
-
function isNotParsableExpression(value) {
|
|
83
|
+
*/ function isNotParsableExpression(value) {
|
|
106
84
|
return isObjectWithType(value) && value.type === "not-parsable";
|
|
107
85
|
}
|
|
108
86
|
|
|
109
87
|
|
|
110
88
|
},
|
|
111
|
-
|
|
112
|
-
__webpack_require__.r(__webpack_exports__);
|
|
89
|
+
63(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
113
90
|
__webpack_require__.d(__webpack_exports__, {
|
|
114
|
-
|
|
115
|
-
});
|
|
116
|
-
const EXPRESSION_TYPES = [
|
|
117
|
-
"operator",
|
|
118
|
-
"comparator",
|
|
119
|
-
"property",
|
|
120
|
-
"value",
|
|
121
|
-
"empty",
|
|
122
|
-
"not-parsable",
|
|
123
|
-
];
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
},
|
|
127
|
-
"./src/expressions/utils.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
128
|
-
__webpack_require__.r(__webpack_exports__);
|
|
129
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
130
|
-
forEach: () => (forEach),
|
|
131
|
-
getProperties: () => (getProperties)
|
|
91
|
+
j: () => (forEach)
|
|
132
92
|
});
|
|
133
93
|
/**
|
|
134
94
|
* Extracts all properties referenced in an expression
|
|
135
95
|
* @param expression The expression to analyze
|
|
136
96
|
* @returns Array of PropertyInfo objects referenced in the expression
|
|
137
|
-
*/
|
|
138
|
-
function getProperties(expression) {
|
|
97
|
+
*/ function getProperties(expression) {
|
|
139
98
|
const properties = [];
|
|
140
99
|
function traverse(expr) {
|
|
141
100
|
// If this is a property expression, add it to our collection
|
|
@@ -178,20 +137,37 @@ function forEach(expression, callback) {
|
|
|
178
137
|
|
|
179
138
|
|
|
180
139
|
},
|
|
181
|
-
|
|
182
|
-
__webpack_require__.r(__webpack_exports__);
|
|
140
|
+
198(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
183
141
|
__webpack_require__.d(__webpack_exports__, {
|
|
184
|
-
|
|
142
|
+
H: () => (QueryOptionsCollection)
|
|
185
143
|
});
|
|
186
|
-
/* import */ var _assertions__rspack_import_1 = __webpack_require__(
|
|
187
|
-
/* import */ var _expressions_utils__rspack_import_0 = __webpack_require__(
|
|
144
|
+
/* import */ var _assertions__rspack_import_1 = __webpack_require__(126);
|
|
145
|
+
/* import */ var _expressions_utils__rspack_import_0 = __webpack_require__(63);
|
|
188
146
|
|
|
189
147
|
|
|
190
148
|
class QueryOptionsCollection {
|
|
191
149
|
options = new Map();
|
|
192
150
|
nextExecutionTarget = "database";
|
|
151
|
+
nextExecutionReason = null;
|
|
193
152
|
nextIndex = 0;
|
|
194
153
|
enumeratedItems = [];
|
|
154
|
+
/** Cuts over to memory execution, keeping the first cause. See `MemoryExecutionReason`. */ cutOverToMemory(reason) {
|
|
155
|
+
this.nextExecutionTarget = "memory";
|
|
156
|
+
if (this.nextExecutionReason == null) {
|
|
157
|
+
this.nextExecutionReason = reason;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* True when `split()` or `splitAt()` produced this collection.
|
|
162
|
+
*
|
|
163
|
+
* Those rebuild each half by re-adding its options, which re-derives execution targets
|
|
164
|
+
* without the options that caused them — a post-join filter alone in the memory half
|
|
165
|
+
* derives back to `"database"`. Anything reading `target` as a report of where work runs
|
|
166
|
+
* has to reject a derived collection; see `explainQuery`.
|
|
167
|
+
*/ derived = false;
|
|
168
|
+
get isDerived() {
|
|
169
|
+
return this.derived;
|
|
170
|
+
}
|
|
195
171
|
get items() {
|
|
196
172
|
return this.options;
|
|
197
173
|
}
|
|
@@ -209,48 +185,187 @@ class QueryOptionsCollection {
|
|
|
209
185
|
const mapValue = value;
|
|
210
186
|
// Evaluate the map value to see if we are renaming properties,
|
|
211
187
|
// if we are we need to perform everything after in memory
|
|
212
|
-
if (mapValue.fields.some(x
|
|
188
|
+
if (mapValue.fields.some((x)=>x.isRename === true) || mapValue.fields.some((x)=>x.property?.isUnmapped === true)) {
|
|
213
189
|
// Cut over to memory execution since we are renaming a property with .map
|
|
214
190
|
// We do not want to figure out how the new name flows through the entire query
|
|
215
|
-
this.
|
|
191
|
+
this.cutOverToMemory("map-rename");
|
|
216
192
|
}
|
|
217
193
|
}
|
|
218
194
|
if (name === "filter") {
|
|
219
|
-
// Need to check for unmapped properties
|
|
195
|
+
// Need to check for unmapped and renamed properties
|
|
220
196
|
const filterValue = value;
|
|
221
|
-
|
|
222
|
-
|
|
197
|
+
// A tautology (`x => true`) filters nothing — skip it entirely so
|
|
198
|
+
// plugins never see it
|
|
199
|
+
if (filterValue.expression.type === "empty") {
|
|
200
|
+
return;
|
|
223
201
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
202
|
+
if (filterValue.expression.type === "not-parsable") {
|
|
203
|
+
this.cutOverToMemory("not-parsable");
|
|
204
|
+
} else {
|
|
205
|
+
(0,_expressions_utils__rspack_import_0/* .forEach */.j)(filterValue.expression, (expression)=>{
|
|
206
|
+
if ((0,_assertions__rspack_import_1/* .isPropertyExpression */.e3)(expression) && expression.property.isUnmapped) {
|
|
227
207
|
// Cut over to memory execution, unmapped properties are not in the database and
|
|
228
208
|
// cannot be queried
|
|
229
|
-
this.
|
|
209
|
+
this.cutOverToMemory("unmapped-property");
|
|
210
|
+
return false;
|
|
211
|
+
}
|
|
212
|
+
if ((0,_assertions__rspack_import_1/* .isPropertyExpression */.e3)(expression) && expression.property.hasRenamedSegments) {
|
|
213
|
+
// Cut over to memory execution: the plugin stores data under the
|
|
214
|
+
// `from` (storage) names, but filter selectors reference the
|
|
215
|
+
// in-memory names. Memory execution runs after deserialization,
|
|
216
|
+
// where the in-memory names exist
|
|
217
|
+
this.cutOverToMemory("renamed-property");
|
|
230
218
|
return false;
|
|
231
219
|
}
|
|
232
220
|
return true;
|
|
233
221
|
});
|
|
234
222
|
}
|
|
235
223
|
}
|
|
224
|
+
if (name === "sort") {
|
|
225
|
+
const sortValue = value;
|
|
226
|
+
// Same rule as filters: sort selectors reference in-memory names, which
|
|
227
|
+
// only exist after deserialization when the property is renamed or unmapped
|
|
228
|
+
if (sortValue.property != null && sortValue.property.isUnmapped) {
|
|
229
|
+
this.cutOverToMemory("unmapped-property");
|
|
230
|
+
} else if (sortValue.property != null && sortValue.property.hasRenamedSegments) {
|
|
231
|
+
this.cutOverToMemory("renamed-property");
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
if (name === "nearest") {
|
|
235
|
+
const nearestValue = value;
|
|
236
|
+
// Same rule as sort, and for the same reason: the plugin stores the vector under
|
|
237
|
+
// the `from` name, and an unmapped property is not stored at all. Both are only
|
|
238
|
+
// readable after deserialization, which is where memory execution runs.
|
|
239
|
+
//
|
|
240
|
+
// This is also what lets every translator's in-memory fallback read the column by
|
|
241
|
+
// its resolved name — anything whose storage name differs never reaches them.
|
|
242
|
+
if (nearestValue.property != null && nearestValue.property.isUnmapped) {
|
|
243
|
+
this.cutOverToMemory("unmapped-property");
|
|
244
|
+
} else if (nearestValue.property != null && nearestValue.property.hasRenamedSegments) {
|
|
245
|
+
this.cutOverToMemory("renamed-property");
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
if (name === "join") {
|
|
249
|
+
const joinValue = value;
|
|
250
|
+
// A join whose two sides live on different plugins cannot be sent to EITHER of
|
|
251
|
+
// them — neither can read the other's rows — so the option itself belongs to the
|
|
252
|
+
// memory half, where the datastore interprets it.
|
|
253
|
+
//
|
|
254
|
+
// Set BEFORE the item is created, unlike `nearest`'s ratchet below, because this
|
|
255
|
+
// moves the join option itself rather than everything after it.
|
|
256
|
+
if (joinValue.crossPlugin === true) {
|
|
257
|
+
this.cutOverToMemory("cross-plugin-join");
|
|
258
|
+
}
|
|
259
|
+
}
|
|
236
260
|
const item = {
|
|
237
261
|
index: this.nextIndex,
|
|
238
262
|
option: {
|
|
239
263
|
name,
|
|
240
264
|
target: this.nextExecutionTarget,
|
|
241
|
-
value
|
|
265
|
+
value,
|
|
266
|
+
...this.nextExecutionReason == null ? {} : {
|
|
267
|
+
reason: this.nextExecutionReason
|
|
268
|
+
}
|
|
242
269
|
}
|
|
243
270
|
};
|
|
244
271
|
this.nextIndex++;
|
|
245
272
|
const found = this.options.get(name);
|
|
246
|
-
this.options.set(name, [
|
|
273
|
+
this.options.set(name, [
|
|
274
|
+
...found ?? [],
|
|
275
|
+
item
|
|
276
|
+
]);
|
|
277
|
+
if (name === "nearest") {
|
|
278
|
+
// Everything AFTER a similarity search runs in memory, whatever the backend.
|
|
279
|
+
//
|
|
280
|
+
// Whether the search was pushed down is a fact about the plugin, which this
|
|
281
|
+
// collection cannot see — so a later option is only safe if it runs after the
|
|
282
|
+
// scoring definitely happened, and in memory is the only place that is true of.
|
|
283
|
+
//
|
|
284
|
+
// The failure this prevents is silent. `.nearest(x => x.embedding, v, 10).take(3)`
|
|
285
|
+
// sends `LIMIT 3` to a backend that ignored the ordering, so three arbitrary rows
|
|
286
|
+
// come back and get scored — three real rows, in a plausible order, and not the
|
|
287
|
+
// three nearest. Nothing errors.
|
|
288
|
+
//
|
|
289
|
+
// A plugin that DID push the search down loses nothing but the chance to also
|
|
290
|
+
// push down what follows it, which is a limit over ten rows.
|
|
291
|
+
this.cutOverToMemory("after-nearest");
|
|
292
|
+
}
|
|
293
|
+
if (name === "join") {
|
|
294
|
+
// Everything AFTER a join runs in memory, for the same reason as `nearest`: this
|
|
295
|
+
// collection cannot see HOW the plugin executed the join, and the rows it produced
|
|
296
|
+
// are TUPLES rather than entities of the root schema.
|
|
297
|
+
//
|
|
298
|
+
// A `take` sent to a backend that hash-joined in its translator would limit the
|
|
299
|
+
// OUTER rows read, not the pairs produced — a plausible-looking result with the
|
|
300
|
+
// wrong number of rows in it. Conjuncts that can safely run earlier are split off
|
|
301
|
+
// by the query builder BEFORE dispatch, which is the only exception.
|
|
302
|
+
this.cutOverToMemory("after-join");
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Splits the collection around the FIRST occurrence of `name`, preserving order.
|
|
307
|
+
*
|
|
308
|
+
* For a join: the options recorded before it operate on entity rows, the option itself
|
|
309
|
+
* produces tuples, and the ones after it operate on tuples. Three different shapes, so the
|
|
310
|
+
* caller has to run them in three steps rather than one pass.
|
|
311
|
+
*/ splitAt(name) {
|
|
312
|
+
this.resolveEnumeration();
|
|
313
|
+
const sortedItems = this.enumeratedItems.toSorted((a, b)=>a.index - b.index);
|
|
314
|
+
const before = new QueryOptionsCollection();
|
|
315
|
+
const after = new QueryOptionsCollection();
|
|
316
|
+
before.derived = true;
|
|
317
|
+
after.derived = true;
|
|
318
|
+
let at = null;
|
|
319
|
+
for(let i = 0, length = sortedItems.length; i < length; i++){
|
|
320
|
+
const { option } = sortedItems[i];
|
|
321
|
+
if (at == null && option.name === name) {
|
|
322
|
+
at = option;
|
|
323
|
+
continue;
|
|
324
|
+
}
|
|
325
|
+
const destination = at == null ? before : after;
|
|
326
|
+
destination.add(option.name, option.value);
|
|
327
|
+
}
|
|
328
|
+
return {
|
|
329
|
+
before,
|
|
330
|
+
at,
|
|
331
|
+
after
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Captures the collection's current state and returns a function that restores it.
|
|
336
|
+
*
|
|
337
|
+
* Terminal queryable operations (count, first, aggregates, …) record their option on
|
|
338
|
+
* the shared collection before executing. Without restoring, a re-executed terminal —
|
|
339
|
+
* the whole point of a subscribed queryable — stacks its option a second time and
|
|
340
|
+
* runs it over the first execution's scalar result.
|
|
341
|
+
*/ snapshot() {
|
|
342
|
+
const options = new Map([
|
|
343
|
+
...this.options.entries()
|
|
344
|
+
].map(([key, items])=>[
|
|
345
|
+
key,
|
|
346
|
+
[
|
|
347
|
+
...items
|
|
348
|
+
]
|
|
349
|
+
]));
|
|
350
|
+
const nextExecutionTarget = this.nextExecutionTarget;
|
|
351
|
+
const nextExecutionReason = this.nextExecutionReason;
|
|
352
|
+
const nextIndex = this.nextIndex;
|
|
353
|
+
return ()=>{
|
|
354
|
+
this.options = new Map(options);
|
|
355
|
+
this.nextExecutionTarget = nextExecutionTarget;
|
|
356
|
+
this.nextExecutionReason = nextExecutionReason;
|
|
357
|
+
this.nextIndex = nextIndex;
|
|
358
|
+
this.enumeratedItems = [];
|
|
359
|
+
};
|
|
247
360
|
}
|
|
248
361
|
split() {
|
|
249
362
|
this.resolveEnumeration();
|
|
250
|
-
const sortedItems = this.enumeratedItems.toSorted((a, b)
|
|
363
|
+
const sortedItems = this.enumeratedItems.toSorted((a, b)=>a.index - b.index);
|
|
251
364
|
const memoryQueryOptionsCollection = new QueryOptionsCollection();
|
|
252
365
|
const databaseQueryOptionsCollection = new QueryOptionsCollection();
|
|
253
|
-
|
|
366
|
+
memoryQueryOptionsCollection.derived = true;
|
|
367
|
+
databaseQueryOptionsCollection.derived = true;
|
|
368
|
+
for(let i = 0, length = sortedItems.length; i < length; i++){
|
|
254
369
|
const sortedItem = sortedItems[i];
|
|
255
370
|
if (sortedItem.option.target === "database") {
|
|
256
371
|
databaseQueryOptionsCollection.add(sortedItem.option.name, sortedItem.option.value);
|
|
@@ -264,8 +379,15 @@ class QueryOptionsCollection {
|
|
|
264
379
|
};
|
|
265
380
|
}
|
|
266
381
|
hasTransformations() {
|
|
267
|
-
const transformationOptions = [
|
|
268
|
-
|
|
382
|
+
const transformationOptions = [
|
|
383
|
+
"map",
|
|
384
|
+
"group",
|
|
385
|
+
"min",
|
|
386
|
+
"max",
|
|
387
|
+
"count",
|
|
388
|
+
"sum"
|
|
389
|
+
];
|
|
390
|
+
return transformationOptions.some((name)=>this.options.has(name));
|
|
269
391
|
}
|
|
270
392
|
has(name) {
|
|
271
393
|
return this.options.has(name);
|
|
@@ -275,7 +397,7 @@ class QueryOptionsCollection {
|
|
|
275
397
|
}
|
|
276
398
|
getLast(name) {
|
|
277
399
|
this.resolveEnumeration();
|
|
278
|
-
for
|
|
400
|
+
for(let i = this.enumeratedItems.length - 1; i >= 0; i--){
|
|
279
401
|
const item = this.enumeratedItems[i];
|
|
280
402
|
if (item.option.name === name) {
|
|
281
403
|
return item.option;
|
|
@@ -288,10 +410,12 @@ class QueryOptionsCollection {
|
|
|
288
410
|
if (found == null) {
|
|
289
411
|
return [];
|
|
290
412
|
}
|
|
291
|
-
return found.map(w
|
|
413
|
+
return found.map((w)=>w.option.value);
|
|
292
414
|
}
|
|
293
415
|
getEnumeration() {
|
|
294
|
-
return [
|
|
416
|
+
return [
|
|
417
|
+
...this.options.values()
|
|
418
|
+
].flat().toSorted((a, b)=>a.index - b.index);
|
|
295
419
|
}
|
|
296
420
|
resolveEnumeration() {
|
|
297
421
|
if (this.enumeratedItems.length != this.nextIndex) {
|
|
@@ -300,7 +424,7 @@ class QueryOptionsCollection {
|
|
|
300
424
|
}
|
|
301
425
|
forEach(iterator) {
|
|
302
426
|
this.resolveEnumeration();
|
|
303
|
-
for
|
|
427
|
+
for(let i = 0, length = this.enumeratedItems.length; i < length; i++){
|
|
304
428
|
iterator(this.enumeratedItems[i].option);
|
|
305
429
|
}
|
|
306
430
|
}
|
|
@@ -308,29 +432,11 @@ class QueryOptionsCollection {
|
|
|
308
432
|
|
|
309
433
|
|
|
310
434
|
},
|
|
311
|
-
|
|
312
|
-
__webpack_require__.r(__webpack_exports__);
|
|
435
|
+
76(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
313
436
|
__webpack_require__.d(__webpack_exports__, {
|
|
314
|
-
|
|
437
|
+
$: () => (isDate)
|
|
315
438
|
});
|
|
316
|
-
const
|
|
317
|
-
const result = new Map();
|
|
318
|
-
for (let i = 0; i < data.length; i++) {
|
|
319
|
-
const item = data[i];
|
|
320
|
-
const key = keySelector(item);
|
|
321
|
-
result.set(key, item);
|
|
322
|
-
}
|
|
323
|
-
return result;
|
|
324
|
-
};
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
},
|
|
328
|
-
"./src/utilities/dates.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
329
|
-
__webpack_require__.r(__webpack_exports__);
|
|
330
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
331
|
-
isDate: () => (isDate)
|
|
332
|
-
});
|
|
333
|
-
const isDate = (data) => {
|
|
439
|
+
const isDate = (data)=>{
|
|
334
440
|
if (data == null) {
|
|
335
441
|
return false;
|
|
336
442
|
}
|
|
@@ -342,211 +448,178 @@ const isDate = (data) => {
|
|
|
342
448
|
|
|
343
449
|
|
|
344
450
|
},
|
|
345
|
-
|
|
346
|
-
__webpack_require__.r(__webpack_exports__);
|
|
451
|
+
581(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
347
452
|
__webpack_require__.d(__webpack_exports__, {
|
|
348
|
-
|
|
453
|
+
Cg: () => (resetLogLevel),
|
|
454
|
+
He: () => (setLogLevel),
|
|
455
|
+
Mi: () => (isLogLevelEnabled),
|
|
456
|
+
XM: () => (getLogLevel),
|
|
457
|
+
p_: () => (LOG_LEVELS),
|
|
458
|
+
vF: () => (logger)
|
|
349
459
|
});
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
460
|
+
/**
|
|
461
|
+
* Levelled logging, resolved once.
|
|
462
|
+
*
|
|
463
|
+
* Three things about the previous implementation drove this shape:
|
|
464
|
+
*
|
|
465
|
+
* - **There was no way to turn logging off.** `globalThis.__ROUTIER_DEBUG__` was only ever
|
|
466
|
+
* compared against `true`, so setting it to `false` did nothing — while
|
|
467
|
+
* `docs/how-to/debug-logging.md` documented exactly that as the way to force logging off.
|
|
468
|
+
* A documented switch that silently does nothing is worse than no switch.
|
|
469
|
+
* - **`NODE_ENV === 'test'` enabled it.** Every Jest run therefore logged, because Jest always
|
|
470
|
+
* sets `NODE_ENV=test`. Measured on the S7 stress scenario, which drives ~2,000 saves through
|
|
471
|
+
* a plugin that logs three lines per query: 12.4s with logging, ~6s without. Test runners also
|
|
472
|
+
* capture console output by snapshotting a stack trace per call, so the cost is far above what
|
|
473
|
+
* writing to a terminal would suggest — and the output buries whatever the failure was.
|
|
474
|
+
* - **It was all-or-nothing, and re-resolved per call.** An error could not be kept while debug
|
|
475
|
+
* was dropped, and every one of the ~97 call sites re-read `globalThis` and `process.env`.
|
|
476
|
+
*
|
|
477
|
+
* Levels are compared numerically against a value cached at module load. Measured against a
|
|
478
|
+
* no-op console at 200k calls: an enabled call costs ~70ns, a call rejected by the gate ~3ns.
|
|
479
|
+
* Building the arguments the call site passes in accounts for ~0.2ns of that 3ns, which is why
|
|
480
|
+
* this keeps the ordinary `logger.debug(msg, payload)` signature instead of taking a thunk —
|
|
481
|
+
* a lazy API would recover 0.3% of an enabled call's cost and would have to change every call
|
|
482
|
+
* site to do it.
|
|
483
|
+
*/ /** Ordered from most severe to most verbose. `silent` discards everything. */ const LOG_LEVELS = [
|
|
484
|
+
'silent',
|
|
485
|
+
'error',
|
|
486
|
+
'warn',
|
|
487
|
+
'info',
|
|
488
|
+
'debug'
|
|
489
|
+
];
|
|
490
|
+
/** Numeric rank, so a gate is one integer comparison. */ const RANK = {
|
|
491
|
+
silent: 0,
|
|
492
|
+
error: 1,
|
|
493
|
+
warn: 2,
|
|
494
|
+
info: 3,
|
|
495
|
+
debug: 4
|
|
373
496
|
};
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
},
|
|
377
|
-
"./src/utilities/functions.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
378
|
-
__webpack_require__.r(__webpack_exports__);
|
|
379
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
380
|
-
noop: () => (noop)
|
|
381
|
-
});
|
|
382
|
-
const noop = (..._args) => { };
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
},
|
|
386
|
-
"./src/utilities/logger.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
387
|
-
__webpack_require__.r(__webpack_exports__);
|
|
388
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
389
|
-
logger: () => (logger)
|
|
390
|
-
});
|
|
497
|
+
const isLogLevel = (value)=>typeof value === 'string' && LOG_LEVELS.includes(value);
|
|
391
498
|
/**
|
|
392
|
-
*
|
|
393
|
-
|
|
394
|
-
|
|
499
|
+
* Resolves the configured level, in precedence order.
|
|
500
|
+
*
|
|
501
|
+
* Ordered most specific first: an explicit level beats a boolean flag, a boolean flag beats an
|
|
502
|
+
* environment variable, and an environment variable beats an inference from `NODE_ENV`. Anything
|
|
503
|
+
* unrecognised is ignored rather than treated as an error — a typo'd level should not take down
|
|
504
|
+
* an application, and `silent` is the safe direction to fall back to.
|
|
505
|
+
*/ const resolveLevel = ()=>{
|
|
395
506
|
if (typeof globalThis !== 'undefined') {
|
|
396
507
|
const g = globalThis;
|
|
397
|
-
if (g.
|
|
398
|
-
return
|
|
399
|
-
|
|
508
|
+
if (isLogLevel(g.__ROUTIER_LOG_LEVEL__)) {
|
|
509
|
+
return g.__ROUTIER_LOG_LEVEL__;
|
|
510
|
+
}
|
|
511
|
+
// Both directions honoured. `=== false` used to fall through to the NODE_ENV checks
|
|
512
|
+
// below and re-enable the logging it was asked to suppress.
|
|
513
|
+
if (g.__ROUTIER_DEBUG__ === true) return 'debug';
|
|
514
|
+
if (g.__ROUTIER_DEBUG__ === false) return 'silent';
|
|
515
|
+
}
|
|
516
|
+
// There is deliberately no `import.meta.env` branch, although the documentation used to
|
|
517
|
+
// promise one. It could never work: this package is bundled with rspack, which replaces
|
|
518
|
+
// `import.meta` with `undefined`, so the check would read the *library's* build-time
|
|
519
|
+
// environment rather than the application's — and referencing `import.meta` at all is a parse
|
|
520
|
+
// error under a CommonJS build target, which is how the test suite loads this file. Vite and
|
|
521
|
+
// similar apps set `__ROUTIER_LOG_LEVEL__` or `__ROUTIER_DEBUG__` from their own
|
|
522
|
+
// `import.meta.env`, which is what the docs now describe.
|
|
400
523
|
if (typeof process !== 'undefined' && process.env != null) {
|
|
524
|
+
if (isLogLevel(process.env.ROUTIER_LOG_LEVEL)) {
|
|
525
|
+
return process.env.ROUTIER_LOG_LEVEL;
|
|
526
|
+
}
|
|
401
527
|
const debug = process.env.DEBUG;
|
|
402
|
-
if (debug === 'routier' || debug === '*')
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
const tryLog = (type, ...args) => {
|
|
411
|
-
if (shouldLog()) {
|
|
412
|
-
console[type](...args);
|
|
413
|
-
}
|
|
528
|
+
if (debug === 'routier' || debug === '*') return 'debug';
|
|
529
|
+
const env = "production"?.toLowerCase();
|
|
530
|
+
// `test` is deliberately absent. It used to be here, which meant no test suite anywhere
|
|
531
|
+
// could run Routier quietly. Opt in with DEBUG=routier or ROUTIER_LOG_LEVEL when a test
|
|
532
|
+
// needs the output.
|
|
533
|
+
if (env === 'dev' || env === 'development') return 'debug';
|
|
534
|
+
}
|
|
535
|
+
return 'silent';
|
|
414
536
|
};
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
tryLog("debug", ...args);
|
|
430
|
-
},
|
|
431
|
-
table: (...args) => {
|
|
432
|
-
tryLog("table", ...args);
|
|
433
|
-
},
|
|
537
|
+
let level = resolveLevel();
|
|
538
|
+
let rank = RANK[level];
|
|
539
|
+
/**
|
|
540
|
+
* Overrides the level for the rest of the process.
|
|
541
|
+
*
|
|
542
|
+
* The configuration above is read once, at import, which is what makes the gate cheap — but it
|
|
543
|
+
* also means an application that decides its verbosity after startup, or a test that wants to
|
|
544
|
+
* assert on output, has no way in. This is that way in.
|
|
545
|
+
*/ const setLogLevel = (next)=>{
|
|
546
|
+
if (isLogLevel(next) === false) {
|
|
547
|
+
throw new Error(`Unknown log level "${next}". Expected one of: ${LOG_LEVELS.join(', ')}`);
|
|
548
|
+
}
|
|
549
|
+
level = next;
|
|
550
|
+
rank = RANK[next];
|
|
434
551
|
};
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
__webpack_require__.r(__webpack_exports__);
|
|
440
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
441
|
-
cast: () => (cast),
|
|
442
|
-
clone: () => (clone)
|
|
443
|
-
});
|
|
444
|
-
const cast = (item) => {
|
|
445
|
-
return item;
|
|
552
|
+
const getLogLevel = ()=>level;
|
|
553
|
+
/** Re-reads the environment. For tests that change it after this module was imported. */ const resetLogLevel = ()=>{
|
|
554
|
+
level = resolveLevel();
|
|
555
|
+
rank = RANK[level];
|
|
446
556
|
};
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
});
|
|
458
|
-
/* import */ var _plugins_query__rspack_import_0 = __webpack_require__("./src/plugins/query/QueryOptionsCollection.ts");
|
|
459
|
-
|
|
460
|
-
const combineQueryOptionsCollections = (...collections) => {
|
|
461
|
-
const result = new _plugins_query__rspack_import_0.QueryOptionsCollection();
|
|
462
|
-
for (let i = 0, length = collections.length; i < length; i++) {
|
|
463
|
-
const collection = collections[i];
|
|
464
|
-
// Add scoped items first
|
|
465
|
-
collection.forEach(item => {
|
|
466
|
-
result.add(item.name, item.value);
|
|
467
|
-
});
|
|
557
|
+
/**
|
|
558
|
+
* Whether a message at this level would be emitted.
|
|
559
|
+
*
|
|
560
|
+
* For the rare call site whose *arguments* are expensive to build — a serialization, a deep
|
|
561
|
+
* clone, a join over a large collection. An ordinary payload object is not worth guarding; see
|
|
562
|
+
* the measurement in the header.
|
|
563
|
+
*/ const isLogLevelEnabled = (at)=>rank >= RANK[at];
|
|
564
|
+
const emit = (at, method, args)=>{
|
|
565
|
+
if (rank < RANK[at]) {
|
|
566
|
+
return;
|
|
468
567
|
}
|
|
469
|
-
|
|
568
|
+
// Resolved at call time rather than captured once: test harnesses and browser devtools both
|
|
569
|
+
// replace console methods after modules have loaded, and a captured reference would keep
|
|
570
|
+
// writing past the replacement.
|
|
571
|
+
console[method](...args);
|
|
470
572
|
};
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
});
|
|
479
|
-
const resolveBulkPersistChanges = (event, result, bulkPersistChanges) => {
|
|
480
|
-
// make sure we swap the adds here, that way we can make sure other persist events
|
|
481
|
-
// don't take their additions and try to change subsequent calls
|
|
482
|
-
for (const [schemaId, changes] of event.operation) {
|
|
483
|
-
const schemmaBulkPersistResult = result.get(schemaId);
|
|
484
|
-
const schemaBulkPersistChanges = bulkPersistChanges.resolve(schemaId);
|
|
485
|
-
// Set the original removes
|
|
486
|
-
schemaBulkPersistChanges.removes = changes.removes;
|
|
487
|
-
// Set the original updates
|
|
488
|
-
schemaBulkPersistChanges.updates = changes.updates;
|
|
489
|
-
// Take the adds from the result and set them to be persisted
|
|
490
|
-
// in the replicated plugins because the id's are set in the
|
|
491
|
-
// memory data store
|
|
492
|
-
schemaBulkPersistChanges.adds = schemmaBulkPersistResult.adds;
|
|
493
|
-
}
|
|
573
|
+
const logger = {
|
|
574
|
+
/** General-purpose output. Carried at `info`, since `log` names a console method, not a level. */ log: (...args)=>emit('info', 'log', args),
|
|
575
|
+
info: (...args)=>emit('info', 'info', args),
|
|
576
|
+
warn: (...args)=>emit('warn', 'warn', args),
|
|
577
|
+
error: (...args)=>emit('error', 'error', args),
|
|
578
|
+
debug: (...args)=>emit('debug', 'debug', args),
|
|
579
|
+
/** Diagnostic tabular output; verbose by nature, so it sits at `debug`. */ table: (...args)=>emit('debug', 'table', args)
|
|
494
580
|
};
|
|
495
581
|
|
|
496
582
|
|
|
497
583
|
},
|
|
498
|
-
|
|
499
|
-
__webpack_require__.r(__webpack_exports__);
|
|
584
|
+
615(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
500
585
|
__webpack_require__.d(__webpack_exports__, {
|
|
501
|
-
|
|
586
|
+
Nr: () => (fastHash),
|
|
587
|
+
Zm: () => (stringifyObject),
|
|
588
|
+
tW: () => (hash)
|
|
502
589
|
});
|
|
503
|
-
const
|
|
504
|
-
process.versions != null &&
|
|
505
|
-
process.versions.node != null;
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
},
|
|
509
|
-
"./src/utilities/strings.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
510
|
-
__webpack_require__.r(__webpack_exports__);
|
|
511
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
512
|
-
fastHash: () => (fastHash),
|
|
513
|
-
hash: () => (hash),
|
|
514
|
-
stringifyObject: () => (stringifyObject)
|
|
515
|
-
});
|
|
516
|
-
const hash = (value, seed = 0) => {
|
|
590
|
+
const hash = (value, seed = 0)=>{
|
|
517
591
|
// From Stack Overflow
|
|
518
592
|
// https://stackoverflow.com/a/52171480/3329760
|
|
519
593
|
let h1 = 0xdeadbeef ^ seed, h2 = 0x41c6ce57 ^ seed;
|
|
520
|
-
for
|
|
594
|
+
for(let i = 0, ch; i < value.length; i++){
|
|
521
595
|
ch = value.charCodeAt(i);
|
|
522
596
|
h1 = Math.imul(h1 ^ ch, 2654435761);
|
|
523
597
|
h2 = Math.imul(h2 ^ ch, 1597334677);
|
|
524
598
|
}
|
|
525
|
-
h1 = Math.imul(h1 ^
|
|
526
|
-
h1 ^= Math.imul(h2 ^
|
|
527
|
-
h2 = Math.imul(h2 ^
|
|
528
|
-
h2 ^= Math.imul(h1 ^
|
|
599
|
+
h1 = Math.imul(h1 ^ h1 >>> 16, 2246822507);
|
|
600
|
+
h1 ^= Math.imul(h2 ^ h2 >>> 13, 3266489909);
|
|
601
|
+
h2 = Math.imul(h2 ^ h2 >>> 16, 2246822507);
|
|
602
|
+
h2 ^= Math.imul(h1 ^ h1 >>> 13, 3266489909);
|
|
529
603
|
return 4294967296 * (2097151 & h2) + (h1 >>> 0);
|
|
530
604
|
};
|
|
531
605
|
/**
|
|
532
606
|
* Fast string hash optimized for comparisons.
|
|
533
607
|
* Uses djb2 algorithm - very fast and good distribution for short to medium strings.
|
|
534
608
|
* Same input always produces same output (deterministic).
|
|
535
|
-
*
|
|
609
|
+
*
|
|
536
610
|
* @param value - The string to hash
|
|
537
611
|
* @param seed - Optional seed value (default: 5381)
|
|
538
612
|
* @returns A positive 32-bit integer hash value
|
|
539
|
-
*
|
|
613
|
+
*
|
|
540
614
|
* @example
|
|
541
615
|
* ```ts
|
|
542
616
|
* fastHash("test") === fastHash("test") // true
|
|
543
617
|
* fastHash("test") !== fastHash("test2") // true
|
|
544
618
|
* ```
|
|
545
|
-
*/
|
|
546
|
-
const fastHash = (value, seed = 5381) => {
|
|
619
|
+
*/ const fastHash = (value, seed = 5381)=>{
|
|
547
620
|
let hash = seed;
|
|
548
|
-
for
|
|
549
|
-
hash = (
|
|
621
|
+
for(let i = 0; i < value.length; i++){
|
|
622
|
+
hash = (hash << 5) + hash + value.charCodeAt(i);
|
|
550
623
|
}
|
|
551
624
|
return hash >>> 0; // Convert to unsigned 32-bit integer
|
|
552
625
|
};
|
|
@@ -554,26 +627,23 @@ const fastHash = (value, seed = 5381) => {
|
|
|
554
627
|
* Converts any value to a readable string representation.
|
|
555
628
|
* Handles primitives, objects, arrays, classes, dates, errors, and functions.
|
|
556
629
|
* Supports depth limiting to prevent infinite recursion on circular references.
|
|
557
|
-
*
|
|
630
|
+
*
|
|
558
631
|
* @param obj - The value to stringify
|
|
559
632
|
* @param maxDepth - Maximum depth for nested objects (default: 3)
|
|
560
633
|
* @param currentDepth - Current recursion depth (default: 0)
|
|
561
634
|
* @returns String representation of the value
|
|
562
|
-
*
|
|
635
|
+
*
|
|
563
636
|
* @example
|
|
564
637
|
* ```ts
|
|
565
638
|
* stringifyObject({ name: "test", count: 5 }) // '{ name: "test", count: 5 }'
|
|
566
639
|
* stringifyObject([1, 2, 3]) // '[1, 2, 3]'
|
|
567
640
|
* stringifyObject(new Date()) // 'Date(2024-01-01T00:00:00.000Z)'
|
|
568
641
|
* ```
|
|
569
|
-
*/
|
|
570
|
-
|
|
571
|
-
if (obj ===
|
|
572
|
-
return 'null';
|
|
573
|
-
if (obj === undefined)
|
|
574
|
-
return 'undefined';
|
|
642
|
+
*/ function stringifyObject(obj, maxDepth = 3, currentDepth = 0) {
|
|
643
|
+
if (obj === null) return 'null';
|
|
644
|
+
if (obj === undefined) return 'undefined';
|
|
575
645
|
const type = typeof obj;
|
|
576
|
-
switch
|
|
646
|
+
switch(type){
|
|
577
647
|
case 'string':
|
|
578
648
|
return `"${obj}"`;
|
|
579
649
|
case 'number':
|
|
@@ -596,7 +666,7 @@ function getFunctionName(fn) {
|
|
|
596
666
|
}
|
|
597
667
|
function getObjectProperties(obj) {
|
|
598
668
|
const properties = {};
|
|
599
|
-
for
|
|
669
|
+
for(const key in obj){
|
|
600
670
|
if (obj.hasOwnProperty(key)) {
|
|
601
671
|
properties[key] = obj[key];
|
|
602
672
|
}
|
|
@@ -604,8 +674,7 @@ function getObjectProperties(obj) {
|
|
|
604
674
|
return properties;
|
|
605
675
|
}
|
|
606
676
|
function stringifyObjectValue(obj, maxDepth, currentDepth) {
|
|
607
|
-
if (obj === null)
|
|
608
|
-
return 'null';
|
|
677
|
+
if (obj === null) return 'null';
|
|
609
678
|
if (obj instanceof Date) {
|
|
610
679
|
return `Date(${obj.toISOString()})`;
|
|
611
680
|
}
|
|
@@ -624,9 +693,8 @@ function stringifyObjectValue(obj, maxDepth, currentDepth) {
|
|
|
624
693
|
return stringifyPlainObject(obj, maxDepth, currentDepth);
|
|
625
694
|
}
|
|
626
695
|
function stringifyArray(arr, maxDepth, currentDepth) {
|
|
627
|
-
if (arr.length === 0)
|
|
628
|
-
|
|
629
|
-
const items = arr.slice(0, 5).map(item => stringifyObject(item, maxDepth, currentDepth + 1));
|
|
696
|
+
if (arr.length === 0) return '[]';
|
|
697
|
+
const items = arr.slice(0, 5).map((item)=>stringifyObject(item, maxDepth, currentDepth + 1));
|
|
630
698
|
const suffix = arr.length > 5 ? `... (+${arr.length - 5} more)` : '';
|
|
631
699
|
return `[${items.join(', ')}${suffix}]`;
|
|
632
700
|
}
|
|
@@ -636,16 +704,12 @@ function stringifyClassInstance(obj, maxDepth, currentDepth) {
|
|
|
636
704
|
if (Object.keys(properties).length === 0) {
|
|
637
705
|
return `${className} {}`;
|
|
638
706
|
}
|
|
639
|
-
const props = Object.entries(properties)
|
|
640
|
-
|
|
641
|
-
.map(([key, value]) => {
|
|
642
|
-
const isPrimitive = value === null || value === undefined ||
|
|
643
|
-
(typeof value !== 'object' && typeof value !== 'function');
|
|
707
|
+
const props = Object.entries(properties).slice(0, 5).map(([key, value])=>{
|
|
708
|
+
const isPrimitive = value === null || value === undefined || typeof value !== 'object' && typeof value !== 'function';
|
|
644
709
|
const depth = isPrimitive ? currentDepth : currentDepth + 1;
|
|
645
710
|
return `${key}: ${stringifyObject(value, maxDepth, depth)}`;
|
|
646
711
|
});
|
|
647
|
-
const suffix = Object.keys(properties).length > 5 ?
|
|
648
|
-
`... (+${Object.keys(properties).length - 5} more)` : '';
|
|
712
|
+
const suffix = Object.keys(properties).length > 5 ? `... (+${Object.keys(properties).length - 5} more)` : '';
|
|
649
713
|
return `${className} { ${props.join(', ')}${suffix} }`;
|
|
650
714
|
}
|
|
651
715
|
function stringifyPlainObject(obj, maxDepth, currentDepth) {
|
|
@@ -653,43 +717,27 @@ function stringifyPlainObject(obj, maxDepth, currentDepth) {
|
|
|
653
717
|
if (Object.keys(properties).length === 0) {
|
|
654
718
|
return '{}';
|
|
655
719
|
}
|
|
656
|
-
const props = Object.entries(properties)
|
|
657
|
-
|
|
658
|
-
.map(([key, value]) => {
|
|
659
|
-
const isPrimitive = value === null || value === undefined ||
|
|
660
|
-
(typeof value !== 'object' && typeof value !== 'function');
|
|
720
|
+
const props = Object.entries(properties).slice(0, 5).map(([key, value])=>{
|
|
721
|
+
const isPrimitive = value === null || value === undefined || typeof value !== 'object' && typeof value !== 'function';
|
|
661
722
|
const depth = isPrimitive ? currentDepth : currentDepth + 1;
|
|
662
723
|
return `${key}: ${stringifyObject(value, maxDepth, depth)}`;
|
|
663
724
|
});
|
|
664
|
-
const suffix = Object.keys(properties).length > 5 ?
|
|
665
|
-
`... (+${Object.keys(properties).length - 5} more)` : '';
|
|
725
|
+
const suffix = Object.keys(properties).length > 5 ? `... (+${Object.keys(properties).length - 5} more)` : '';
|
|
666
726
|
return `{ ${props.join(', ')}${suffix} }`;
|
|
667
727
|
}
|
|
668
728
|
|
|
669
729
|
|
|
670
730
|
},
|
|
671
|
-
|
|
672
|
-
__webpack_require__.r(__webpack_exports__);
|
|
731
|
+
618(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
673
732
|
__webpack_require__.d(__webpack_exports__, {
|
|
674
|
-
|
|
733
|
+
g: () => (uuidv4),
|
|
734
|
+
u: () => (uuid)
|
|
675
735
|
});
|
|
676
|
-
const
|
|
677
|
-
return value;
|
|
678
|
-
};
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
},
|
|
682
|
-
"./src/utilities/uuid.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
683
|
-
__webpack_require__.r(__webpack_exports__);
|
|
684
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
685
|
-
uuid: () => (uuid),
|
|
686
|
-
uuidv4: () => (uuidv4)
|
|
687
|
-
});
|
|
688
|
-
const uuid = (length = 16) => {
|
|
736
|
+
const uuid = (length = 16)=>{
|
|
689
737
|
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
690
738
|
const charLength = chars.length;
|
|
691
739
|
let result = '';
|
|
692
|
-
for
|
|
740
|
+
for(let i = 0; i < length; i++){
|
|
693
741
|
result += chars[Math.random() * charLength | 0];
|
|
694
742
|
}
|
|
695
743
|
return result;
|
|
@@ -697,14 +745,21 @@ const uuid = (length = 16) => {
|
|
|
697
745
|
const HEX_CHARS = '0123456789abcdef';
|
|
698
746
|
const UUID_TEMPLATE = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';
|
|
699
747
|
const hasCrypto = typeof crypto !== 'undefined' && typeof crypto.getRandomValues === 'function';
|
|
700
|
-
const
|
|
748
|
+
const hasRandomUUID = typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function';
|
|
749
|
+
const uuidv4 = ()=>{
|
|
750
|
+
if (hasRandomUUID) {
|
|
751
|
+
return crypto.randomUUID();
|
|
752
|
+
}
|
|
753
|
+
return uuidv4Fallback();
|
|
754
|
+
};
|
|
755
|
+
const uuidv4Fallback = ()=>{
|
|
701
756
|
let randomBytes = null;
|
|
702
757
|
if (hasCrypto) {
|
|
703
758
|
randomBytes = crypto.getRandomValues(new Uint8Array(16));
|
|
704
759
|
}
|
|
705
760
|
let byteIndex = 0;
|
|
706
761
|
let uuid = '';
|
|
707
|
-
for
|
|
762
|
+
for(let i = 0; i < UUID_TEMPLATE.length; i++){
|
|
708
763
|
const c = UUID_TEMPLATE[i];
|
|
709
764
|
if (c === '-') {
|
|
710
765
|
uuid += '-';
|
|
@@ -713,22 +768,16 @@ const uuidv4 = () => {
|
|
|
713
768
|
let r;
|
|
714
769
|
if (hasCrypto && randomBytes) {
|
|
715
770
|
// Each byte gives two hex digits (nibbles)
|
|
716
|
-
r =
|
|
717
|
-
|
|
718
|
-
? randomBytes[byteIndex] >> 4
|
|
719
|
-
: randomBytes[byteIndex++] & 0x0f);
|
|
720
|
-
}
|
|
721
|
-
else {
|
|
771
|
+
r = i % 2 === 0 ? randomBytes[byteIndex] >> 4 : randomBytes[byteIndex++] & 0x0f;
|
|
772
|
+
} else {
|
|
722
773
|
r = Math.floor(Math.random() * 16);
|
|
723
774
|
}
|
|
724
775
|
if (c === 'x') {
|
|
725
776
|
uuid += HEX_CHARS[r];
|
|
726
|
-
}
|
|
727
|
-
else if (c === 'y') {
|
|
777
|
+
} else if (c === 'y') {
|
|
728
778
|
// Variant bits: 8, 9, A, or B
|
|
729
|
-
uuid += HEX_CHARS[
|
|
730
|
-
}
|
|
731
|
-
else if (c === '4') {
|
|
779
|
+
uuid += HEX_CHARS[r & 0x3 | 0x8];
|
|
780
|
+
} else if (c === '4') {
|
|
732
781
|
uuid += '4';
|
|
733
782
|
}
|
|
734
783
|
}
|
|
@@ -776,50 +825,158 @@ __webpack_require__.d = (exports, definition) => {
|
|
|
776
825
|
(() => {
|
|
777
826
|
__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
778
827
|
})();
|
|
779
|
-
// webpack/runtime/make_namespace_object
|
|
780
|
-
(() => {
|
|
781
|
-
// define __esModule on exports
|
|
782
|
-
__webpack_require__.r = (exports) => {
|
|
783
|
-
if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
784
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
785
|
-
}
|
|
786
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
787
|
-
};
|
|
788
|
-
})();
|
|
789
828
|
var __webpack_exports__ = {};
|
|
790
829
|
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
|
|
791
830
|
(() => {
|
|
792
|
-
|
|
831
|
+
|
|
832
|
+
// EXPORTS
|
|
793
833
|
__webpack_require__.d(__webpack_exports__, {
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
834
|
+
N8: () => (/* reexport */ combineQueryOptionsCollections),
|
|
835
|
+
tW: () => (/* reexport */ strings/* .hash */.tW),
|
|
836
|
+
vF: () => (/* reexport */ logger/* .logger */.vF),
|
|
837
|
+
lQ: () => (/* reexport */ noop),
|
|
838
|
+
He: () => (/* reexport */ logger/* .setLogLevel */.He),
|
|
839
|
+
Nr: () => (/* reexport */ strings/* .fastHash */.Nr),
|
|
840
|
+
uR: () => (/* reexport */ uuid/* .uuid */.u),
|
|
841
|
+
p_: () => (/* reexport */ logger/* .LOG_LEVELS */.p_),
|
|
842
|
+
XM: () => (/* reexport */ logger/* .getLogLevel */.XM),
|
|
843
|
+
Cg: () => (/* reexport */ logger/* .resetLogLevel */.Cg),
|
|
844
|
+
Zm: () => (/* reexport */ strings/* .stringifyObject */.Zm),
|
|
845
|
+
av: () => (/* reexport */ toMap),
|
|
846
|
+
wg: () => (/* reexport */ cast),
|
|
847
|
+
$P: () => (/* reexport */ dates/* .isDate */.$),
|
|
848
|
+
Vg: () => (/* reexport */ toEventArray),
|
|
849
|
+
sz: () => (/* reexport */ unsafeCast),
|
|
850
|
+
Mi: () => (/* reexport */ logger/* .isLogLevelEnabled */.Mi),
|
|
851
|
+
ap: () => (/* reexport */ resolveBulkPersistChanges),
|
|
852
|
+
tX: () => (/* reexport */ isNodeRuntime),
|
|
853
|
+
gZ: () => (/* reexport */ uuid/* .uuidv4 */.g),
|
|
854
|
+
o8: () => (/* reexport */ clone)
|
|
810
855
|
});
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
856
|
+
|
|
857
|
+
;// CONCATENATED MODULE: ./src/utilities/arrays.ts
|
|
858
|
+
const toMap = (data, keySelector)=>{
|
|
859
|
+
const result = new Map();
|
|
860
|
+
for(let i = 0; i < data.length; i++){
|
|
861
|
+
const item = data[i];
|
|
862
|
+
const key = keySelector(item);
|
|
863
|
+
result.set(key, item);
|
|
864
|
+
}
|
|
865
|
+
return result;
|
|
866
|
+
};
|
|
867
|
+
|
|
868
|
+
// EXTERNAL MODULE: ./src/utilities/strings.ts
|
|
869
|
+
var strings = __webpack_require__(615);
|
|
870
|
+
// EXTERNAL MODULE: ./src/utilities/dates.ts
|
|
871
|
+
var dates = __webpack_require__(76);
|
|
872
|
+
;// CONCATENATED MODULE: ./src/utilities/objects.ts
|
|
873
|
+
const cast = (item)=>{
|
|
874
|
+
return item;
|
|
875
|
+
};
|
|
876
|
+
function clone(data) {
|
|
877
|
+
return JSON.parse(JSON.stringify(data));
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
;// CONCATENATED MODULE: ./src/utilities/runtime.ts
|
|
881
|
+
const isNodeRuntime = ()=>typeof process !== 'undefined' && process.versions != null && process.versions.node != null;
|
|
882
|
+
|
|
883
|
+
// EXTERNAL MODULE: ./src/utilities/uuid.ts
|
|
884
|
+
var uuid = __webpack_require__(618);
|
|
885
|
+
;// CONCATENATED MODULE: ./src/utilities/replication.ts
|
|
886
|
+
const resolveBulkPersistChanges = (event, result, bulkPersistChanges)=>{
|
|
887
|
+
// make sure we swap the adds here, that way we can make sure other persist events
|
|
888
|
+
// don't take their additions and try to change subsequent calls
|
|
889
|
+
for (const [schemaId, changes] of event.operation){
|
|
890
|
+
const schemmaBulkPersistResult = result.get(schemaId);
|
|
891
|
+
const schemaBulkPersistChanges = bulkPersistChanges.resolve(schemaId);
|
|
892
|
+
// Set the original removes
|
|
893
|
+
schemaBulkPersistChanges.removes = changes.removes;
|
|
894
|
+
// Set the original updates
|
|
895
|
+
schemaBulkPersistChanges.updates = changes.updates;
|
|
896
|
+
// Take the adds from the result and set them to be persisted
|
|
897
|
+
// in the replicated plugins because the id's are set in the
|
|
898
|
+
// memory data store
|
|
899
|
+
schemaBulkPersistChanges.adds = schemmaBulkPersistResult.adds;
|
|
900
|
+
}
|
|
901
|
+
};
|
|
902
|
+
|
|
903
|
+
// EXTERNAL MODULE: ./src/plugins/query/QueryOptionsCollection.ts
|
|
904
|
+
var QueryOptionsCollection = __webpack_require__(198);
|
|
905
|
+
;// CONCATENATED MODULE: ./src/utilities/queryOptionsCollection.ts
|
|
906
|
+
|
|
907
|
+
const combineQueryOptionsCollections = (...collections)=>{
|
|
908
|
+
const result = new QueryOptionsCollection/* .QueryOptionsCollection */.H();
|
|
909
|
+
for(let i = 0, length = collections.length; i < length; i++){
|
|
910
|
+
const collection = collections[i];
|
|
911
|
+
// Add scoped items first
|
|
912
|
+
collection.forEach((item)=>{
|
|
913
|
+
result.add(item.name, item.value);
|
|
914
|
+
});
|
|
915
|
+
}
|
|
916
|
+
return result;
|
|
917
|
+
};
|
|
918
|
+
|
|
919
|
+
;// CONCATENATED MODULE: ./src/utilities/dbPluginEventUtils.ts
|
|
920
|
+
const toEventArray = (event)=>{
|
|
921
|
+
const result = [];
|
|
922
|
+
for (const [schemaId, changes] of event.operation){
|
|
923
|
+
if (changes.hasItems === false) {
|
|
924
|
+
continue;
|
|
925
|
+
}
|
|
926
|
+
if (changes.adds.length > 0) {
|
|
927
|
+
result.push(...changes.adds.map((add)=>{
|
|
928
|
+
return [
|
|
929
|
+
schemaId,
|
|
930
|
+
{
|
|
931
|
+
data: {
|
|
932
|
+
...add
|
|
933
|
+
},
|
|
934
|
+
type: "add"
|
|
935
|
+
}
|
|
936
|
+
];
|
|
937
|
+
}));
|
|
938
|
+
}
|
|
939
|
+
if (changes.updates.length > 0) {
|
|
940
|
+
result.push(...changes.updates.map((update)=>{
|
|
941
|
+
return [
|
|
942
|
+
schemaId,
|
|
943
|
+
{
|
|
944
|
+
data: {
|
|
945
|
+
...update
|
|
946
|
+
},
|
|
947
|
+
type: "update"
|
|
948
|
+
}
|
|
949
|
+
];
|
|
950
|
+
}));
|
|
951
|
+
}
|
|
952
|
+
if (changes.removes.length > 0) {
|
|
953
|
+
result.push(...changes.removes.map((remove)=>{
|
|
954
|
+
return [
|
|
955
|
+
schemaId,
|
|
956
|
+
{
|
|
957
|
+
data: {
|
|
958
|
+
...remove
|
|
959
|
+
},
|
|
960
|
+
type: "remove"
|
|
961
|
+
}
|
|
962
|
+
];
|
|
963
|
+
}));
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
return result;
|
|
967
|
+
};
|
|
968
|
+
|
|
969
|
+
;// CONCATENATED MODULE: ./src/utilities/functions.ts
|
|
970
|
+
const noop = (..._args)=>{};
|
|
971
|
+
|
|
972
|
+
;// CONCATENATED MODULE: ./src/utilities/unsafeCast.ts
|
|
973
|
+
const unsafeCast = (value)=>{
|
|
974
|
+
return value;
|
|
975
|
+
};
|
|
976
|
+
|
|
977
|
+
// EXTERNAL MODULE: ./src/utilities/logger.ts
|
|
978
|
+
var logger = __webpack_require__(581);
|
|
979
|
+
;// CONCATENATED MODULE: ./src/utilities/index.ts
|
|
823
980
|
|
|
824
981
|
|
|
825
982
|
|
|
@@ -836,22 +993,27 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
836
993
|
|
|
837
994
|
})();
|
|
838
995
|
|
|
839
|
-
var
|
|
840
|
-
var
|
|
841
|
-
var
|
|
842
|
-
var
|
|
843
|
-
var
|
|
844
|
-
var
|
|
845
|
-
var
|
|
846
|
-
var
|
|
847
|
-
var
|
|
848
|
-
var
|
|
849
|
-
var
|
|
850
|
-
var
|
|
851
|
-
var
|
|
852
|
-
var
|
|
853
|
-
var
|
|
854
|
-
var
|
|
855
|
-
|
|
996
|
+
var __webpack_exports__LOG_LEVELS = __webpack_exports__.p_;
|
|
997
|
+
var __webpack_exports__cast = __webpack_exports__.wg;
|
|
998
|
+
var __webpack_exports__clone = __webpack_exports__.o8;
|
|
999
|
+
var __webpack_exports__combineQueryOptionsCollections = __webpack_exports__.N8;
|
|
1000
|
+
var __webpack_exports__fastHash = __webpack_exports__.Nr;
|
|
1001
|
+
var __webpack_exports__getLogLevel = __webpack_exports__.XM;
|
|
1002
|
+
var __webpack_exports__hash = __webpack_exports__.tW;
|
|
1003
|
+
var __webpack_exports__isDate = __webpack_exports__.$P;
|
|
1004
|
+
var __webpack_exports__isLogLevelEnabled = __webpack_exports__.Mi;
|
|
1005
|
+
var __webpack_exports__isNodeRuntime = __webpack_exports__.tX;
|
|
1006
|
+
var __webpack_exports__logger = __webpack_exports__.vF;
|
|
1007
|
+
var __webpack_exports__noop = __webpack_exports__.lQ;
|
|
1008
|
+
var __webpack_exports__resetLogLevel = __webpack_exports__.Cg;
|
|
1009
|
+
var __webpack_exports__resolveBulkPersistChanges = __webpack_exports__.ap;
|
|
1010
|
+
var __webpack_exports__setLogLevel = __webpack_exports__.He;
|
|
1011
|
+
var __webpack_exports__stringifyObject = __webpack_exports__.Zm;
|
|
1012
|
+
var __webpack_exports__toEventArray = __webpack_exports__.Vg;
|
|
1013
|
+
var __webpack_exports__toMap = __webpack_exports__.av;
|
|
1014
|
+
var __webpack_exports__unsafeCast = __webpack_exports__.sz;
|
|
1015
|
+
var __webpack_exports__uuid = __webpack_exports__.uR;
|
|
1016
|
+
var __webpack_exports__uuidv4 = __webpack_exports__.gZ;
|
|
1017
|
+
export { __webpack_exports__LOG_LEVELS as LOG_LEVELS, __webpack_exports__cast as cast, __webpack_exports__clone as clone, __webpack_exports__combineQueryOptionsCollections as combineQueryOptionsCollections, __webpack_exports__fastHash as fastHash, __webpack_exports__getLogLevel as getLogLevel, __webpack_exports__hash as hash, __webpack_exports__isDate as isDate, __webpack_exports__isLogLevelEnabled as isLogLevelEnabled, __webpack_exports__isNodeRuntime as isNodeRuntime, __webpack_exports__logger as logger, __webpack_exports__noop as noop, __webpack_exports__resetLogLevel as resetLogLevel, __webpack_exports__resolveBulkPersistChanges as resolveBulkPersistChanges, __webpack_exports__setLogLevel as setLogLevel, __webpack_exports__stringifyObject as stringifyObject, __webpack_exports__toEventArray as toEventArray, __webpack_exports__toMap as toMap, __webpack_exports__unsafeCast as unsafeCast, __webpack_exports__uuid as uuid, __webpack_exports__uuidv4 as uuidv4 };
|
|
856
1018
|
|
|
857
1019
|
//# sourceMappingURL=index.js.map
|