@routier/core 0.2.0 → 0.2.1
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 +30 -0
- package/dist/assertions/index.js +88 -4
- package/dist/assertions/index.js.map +1 -1
- package/dist/capabilities/index.js +25 -16
- package/dist/capabilities/index.js.map +1 -1
- package/dist/codegen/blocks.test.d.ts +1 -0
- package/dist/codegen/handlers/SetHandlerBuilder.d.ts +4 -0
- package/dist/codegen/handlers/index.d.ts +1 -0
- package/dist/codegen/handlers/serialize/SerializeComputedHandler.d.ts +6 -0
- package/dist/codegen/handlers/set/SetComplexHandler.d.ts +6 -0
- package/dist/codegen/index.js +1 -0
- package/dist/codegen/index.js.map +1 -1
- package/dist/codegen/utils.test.d.ts +1 -0
- package/dist/collections/Changes.d.ts +2 -2
- package/dist/collections/IdSet.test.d.ts +1 -0
- package/dist/collections/TagCollection.contract.test.d.ts +1 -0
- package/dist/collections/TagCollection.d.ts +7 -7
- package/dist/collections/index.js +1 -1
- package/dist/collections/index.js.map +1 -1
- package/dist/expressions/constants.d.ts +2 -0
- package/dist/expressions/index.d.ts +2 -0
- package/dist/expressions/index.js +401 -34
- package/dist/expressions/index.js.map +1 -1
- package/dist/expressions/sql.d.ts +28 -0
- package/dist/expressions/sql.test.d.ts +1 -0
- package/dist/expressions/utils.d.ts +1 -2
- package/dist/index.js +1669 -610
- package/dist/index.js.map +1 -1
- package/dist/performance/index.js +18 -7
- package/dist/performance/index.js.map +1 -1
- package/dist/pipeline/index.js +18 -7
- package/dist/pipeline/index.js.map +1 -1
- package/dist/plugins/index.d.ts +0 -1
- package/dist/plugins/index.js +126 -694
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/query/Query.test.d.ts +1 -0
- package/dist/plugins/query/QueryOptionsCollection.d.ts +1 -0
- package/dist/plugins/translators/SqlTranslator.test.d.ts +1 -0
- package/dist/plugins/translators/TranslatedArrayValue.d.ts +3 -1
- package/dist/plugins/translators/TranslatedGroupValue.d.ts +3 -1
- package/dist/plugins/translators/TranslatedSingleValue.d.ts +3 -1
- package/dist/plugins/translators/TranslatedValues.test.d.ts +1 -0
- package/dist/plugins/translators/types.d.ts +8 -1
- package/dist/plugins/types.d.ts +6 -10
- package/dist/results/Result.d.ts +2 -2
- package/dist/results/Result.test.d.ts +1 -0
- package/dist/results/index.js.map +1 -1
- package/dist/results/utils.test.d.ts +1 -0
- package/dist/schema/PropertyInfo.d.ts +5 -1
- package/dist/schema/SchemaDefinition.d.ts +29 -1
- package/dist/schema/communication/broadcast.test.d.ts +1 -0
- package/dist/schema/index.d.ts +2 -0
- package/dist/schema/index.js +1151 -132
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/property/base/SchemaBase.d.ts +3 -1
- package/dist/schema/property/modifiers/SchemaDeserialize.d.ts +5 -1
- package/dist/schema/property/modifiers/SchemaForeignKey.d.ts +15 -0
- package/dist/schema/property/modifiers/SchemaKey.d.ts +2 -0
- package/dist/schema/property/modifiers/SchemaNullable.d.ts +5 -1
- package/dist/schema/property/modifiers/SchemaOptional.d.ts +3 -1
- package/dist/schema/property/modifiers/SchemaTag.d.ts +27 -0
- package/dist/schema/property/modifiers/SchemaTracked.d.ts +5 -1
- package/dist/schema/property/modifiers/index.d.ts +2 -0
- package/dist/schema/property/types/SchemaArray.d.ts +2 -0
- package/dist/schema/property/types/SchemaBoolean.d.ts +2 -0
- package/dist/schema/property/types/SchemaDate.d.ts +2 -0
- package/dist/schema/property/types/SchemaNumber.d.ts +5 -1
- package/dist/schema/property/types/SchemaObject.d.ts +2 -0
- package/dist/schema/property/types/SchemaString.d.ts +5 -1
- package/dist/schema/types.d.ts +37 -27
- package/dist/schema/utils/standardJsonSchema.d.ts +90 -0
- package/dist/schema/utils/standardJsonSchema.test.d.ts +1 -0
- package/dist/utilities/functions.d.ts +1 -1
- package/dist/utilities/index.js +153 -15
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/runtime.test.d.ts +1 -0
- package/dist/utilities/uuid.test.d.ts +1 -0
- package/package.json +2 -2
- package/readme.md +1 -1
- package/dist/plugins/replication/OptimisticReplicationDbPlugin.d.ts +0 -23
- package/dist/plugins/replication/ReplicationDbPlugin.d.ts +0 -22
- package/dist/plugins/replication/index.d.ts +0 -3
- package/dist/plugins/replication/types.d.ts +0 -5
- package/dist/schema/testSchemas.test.d.ts +0 -314
- /package/dist/{pipeline/WorkPipeline.test.d.ts → codegen/SlotPath.test.d.ts} +0 -0
package/dist/index.js
CHANGED
|
@@ -6,10 +6,20 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
6
6
|
assertInstanceOf: () => (assertInstanceOf),
|
|
7
7
|
assertIsArray: () => (assertIsArray),
|
|
8
8
|
assertIsNotNull: () => (assertIsNotNull),
|
|
9
|
-
|
|
10
|
-
|
|
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)
|
|
18
|
+
});
|
|
19
|
+
/* import */ var _expressions_constants__rspack_import_1 = __webpack_require__("./src/expressions/constants.ts");
|
|
11
20
|
/* import */ var _utilities__rspack_import_0 = __webpack_require__("./src/utilities/dates.ts");
|
|
12
21
|
|
|
22
|
+
|
|
13
23
|
function assertDate(data) {
|
|
14
24
|
if ((0,_utilities__rspack_import_0.isDate)(data) === false) {
|
|
15
25
|
throw new TypeError('Value is not a Date');
|
|
@@ -41,9 +51,59 @@ function assertInstanceOf(value, Instance) {
|
|
|
41
51
|
return;
|
|
42
52
|
}
|
|
43
53
|
if (value != null && typeof value === "object" && "constructor" in value) {
|
|
44
|
-
throw new TypeError(`
|
|
54
|
+
throw new TypeError(`value is not instance of type. Type: ${value.constructor.name}`);
|
|
55
|
+
}
|
|
56
|
+
throw new TypeError(`value is not instance of type`);
|
|
57
|
+
}
|
|
58
|
+
function assertIsNumber(value) {
|
|
59
|
+
if (typeof value !== "number") {
|
|
60
|
+
throw new TypeError("value is not of type `number`");
|
|
45
61
|
}
|
|
46
|
-
|
|
62
|
+
}
|
|
63
|
+
function isObjectWithType(value) {
|
|
64
|
+
return typeof value === "object" && value !== null && "type" in value;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Type guard: narrows `value` to `Expression` when it is an object with a valid `type` property.
|
|
68
|
+
*/
|
|
69
|
+
function isExpression(value) {
|
|
70
|
+
return isObjectWithType(value) && _expressions_constants__rspack_import_1.EXPRESSION_TYPES.includes(value.type);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Type guard: narrows `value` to `OperatorExpression` when it is an object with `type === "operator"`.
|
|
74
|
+
*/
|
|
75
|
+
function isOperatorExpression(value) {
|
|
76
|
+
return isObjectWithType(value) && value.type === "operator";
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Type guard: narrows `value` to `ComparatorExpression` when it is an object with `type === "comparator"`.
|
|
80
|
+
*/
|
|
81
|
+
function isComparatorExpression(value) {
|
|
82
|
+
return isObjectWithType(value) && value.type === "comparator";
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Type guard: narrows `value` to `PropertyExpression` when it is an object with `type === "property"`.
|
|
86
|
+
*/
|
|
87
|
+
function isPropertyExpression(value) {
|
|
88
|
+
return isObjectWithType(value) && value.type === "property";
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Type guard: narrows `value` to `ValueExpression` when it is an object with `type === "value"`.
|
|
92
|
+
*/
|
|
93
|
+
function isValueExpression(value) {
|
|
94
|
+
return isObjectWithType(value) && value.type === "value";
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Type guard: narrows `value` to `EmptyExpression` when it is an object with `type === "empty"`.
|
|
98
|
+
*/
|
|
99
|
+
function isEmptyExpression(value) {
|
|
100
|
+
return isObjectWithType(value) && value.type === "empty";
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Type guard: narrows `value` to `NotParsableExpression` when it is an object with `type === "not-parsable"`.
|
|
104
|
+
*/
|
|
105
|
+
function isNotParsableExpression(value) {
|
|
106
|
+
return isObjectWithType(value) && value.type === "not-parsable";
|
|
47
107
|
}
|
|
48
108
|
|
|
49
109
|
|
|
@@ -303,9 +363,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
303
363
|
});
|
|
304
364
|
/* import */ var _Capability__rspack_import_0 = __webpack_require__("./src/capabilities/Capability.ts");
|
|
305
365
|
/* import */ var _tracing_CallTraceManager__rspack_import_1 = __webpack_require__("./src/capabilities/tracing/CallTraceManager.ts");
|
|
306
|
-
/* import */ var
|
|
307
|
-
/* import */ var _utilities__rspack_import_2 = __webpack_require__("./src/utilities/logger.ts");
|
|
308
|
-
|
|
366
|
+
/* import */ var _utilities_strings__rspack_import_2 = __webpack_require__("./src/utilities/strings.ts");
|
|
309
367
|
|
|
310
368
|
|
|
311
369
|
|
|
@@ -332,20 +390,20 @@ class TracingCapability extends _Capability__rspack_import_0.Capability {
|
|
|
332
390
|
operationId = this.callTraceManager.startNewOperation();
|
|
333
391
|
const callTrace = this.callTraceManager.addMethodToTrace(path);
|
|
334
392
|
const formattedCallTrace = this.callTraceManager.formatMethodPaths(callTrace);
|
|
335
|
-
|
|
336
|
-
|
|
393
|
+
console.log(`\n${'═'.repeat(60)}`);
|
|
394
|
+
console.log(`▶ ORIGIN [${operationId}] ${path}`);
|
|
337
395
|
if (args.length > 0) {
|
|
338
|
-
|
|
396
|
+
console.log(` Args:`, (0,_utilities_strings__rspack_import_2.stringifyObject)(args, 4, 0));
|
|
339
397
|
}
|
|
340
|
-
|
|
398
|
+
console.log(` Call Stack: ${formattedCallTrace.join(' → ')}`);
|
|
341
399
|
}
|
|
342
400
|
else {
|
|
343
401
|
operationId = this.callTraceManager.getActiveOperationId();
|
|
344
402
|
const callTrace = this.callTraceManager.addMethodToTrace(path);
|
|
345
403
|
const indent = ' '.repeat(Math.min(callTrace.length - 1, 4));
|
|
346
|
-
|
|
404
|
+
console.log(`${indent}└─ CHILD [${operationId}] ${path}`);
|
|
347
405
|
if (args.length > 0) {
|
|
348
|
-
|
|
406
|
+
console.log(`${indent} Args:`, (0,_utilities_strings__rspack_import_2.stringifyObject)(args, 4, 0));
|
|
349
407
|
}
|
|
350
408
|
}
|
|
351
409
|
try {
|
|
@@ -581,6 +639,7 @@ class Block {
|
|
|
581
639
|
return this._lines.find(w => typeof w !== "string" && w.name === name);
|
|
582
640
|
}
|
|
583
641
|
const split = name.match(/(\[[^\]]+\]|[^.]+)/g);
|
|
642
|
+
// oxlint-disable-next-line no-this-alias
|
|
584
643
|
let result = this;
|
|
585
644
|
for (const item of split) {
|
|
586
645
|
const found = result._lines.find(w => typeof w !== "string" && w.name === item);
|
|
@@ -1335,11 +1394,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1335
1394
|
__webpack_require__.d(__webpack_exports__, {
|
|
1336
1395
|
SerializeHandlerBuilder: () => (SerializeHandlerBuilder)
|
|
1337
1396
|
});
|
|
1338
|
-
/* import */ var
|
|
1339
|
-
/* import */ var
|
|
1340
|
-
/* import */ var
|
|
1397
|
+
/* import */ var _serialize_SerializeDateHandler__rspack_import_3 = __webpack_require__("./src/codegen/handlers/serialize/SerializeDateHandler.ts");
|
|
1398
|
+
/* import */ var _serialize_SerializeObjectHandler__rspack_import_5 = __webpack_require__("./src/codegen/handlers/serialize/SerializeObjectHandler.ts");
|
|
1399
|
+
/* import */ var _serialize_SerializeValueHandler__rspack_import_4 = __webpack_require__("./src/codegen/handlers/serialize/SerializeValueHandler.ts");
|
|
1341
1400
|
/* import */ var _serialize_SerializeSerializerHandler__rspack_import_0 = __webpack_require__("./src/codegen/handlers/serialize/SerializeSerializerHandler.ts");
|
|
1342
|
-
/* import */ var
|
|
1401
|
+
/* import */ var _serialize_SerializeFunctionHandler__rspack_import_2 = __webpack_require__("./src/codegen/handlers/serialize/SerializeFunctionHandler.ts");
|
|
1402
|
+
/* import */ var _serialize_SerializeComputedHandler__rspack_import_1 = __webpack_require__("./src/codegen/handlers/serialize/SerializeComputedHandler.ts");
|
|
1403
|
+
|
|
1343
1404
|
|
|
1344
1405
|
|
|
1345
1406
|
|
|
@@ -1350,10 +1411,27 @@ class SerializeHandlerBuilder {
|
|
|
1350
1411
|
build() {
|
|
1351
1412
|
const handler = new _serialize_SerializeSerializerHandler__rspack_import_0.SerializeSerializerHandler();
|
|
1352
1413
|
handler
|
|
1353
|
-
.setNext(new
|
|
1354
|
-
.setNext(new
|
|
1355
|
-
.setNext(new
|
|
1356
|
-
.setNext(new
|
|
1414
|
+
.setNext(new _serialize_SerializeComputedHandler__rspack_import_1.SerializeComputedHandler())
|
|
1415
|
+
.setNext(new _serialize_SerializeFunctionHandler__rspack_import_2.SerializeFunctionHandler())
|
|
1416
|
+
.setNext(new _serialize_SerializeDateHandler__rspack_import_3.SerializeDateHandler())
|
|
1417
|
+
.setNext(new _serialize_SerializeValueHandler__rspack_import_4.SerializeValueHandler())
|
|
1418
|
+
.setNext(new _serialize_SerializeObjectHandler__rspack_import_5.SerializeObjectHandler());
|
|
1419
|
+
return handler;
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
|
|
1424
|
+
},
|
|
1425
|
+
"./src/codegen/handlers/SetHandlerBuilder.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
1426
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1427
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
1428
|
+
SetHandlerBuilder: () => (SetHandlerBuilder)
|
|
1429
|
+
});
|
|
1430
|
+
/* import */ var _set_SetComplexHandler__rspack_import_0 = __webpack_require__("./src/codegen/handlers/set/SetComplexHandler.ts");
|
|
1431
|
+
|
|
1432
|
+
class SetHandlerBuilder {
|
|
1433
|
+
build() {
|
|
1434
|
+
const handler = new _set_SetComplexHandler__rspack_import_0.SetComplexHandler();
|
|
1357
1435
|
return handler;
|
|
1358
1436
|
}
|
|
1359
1437
|
}
|
|
@@ -2650,6 +2728,27 @@ class PrepareValueHandler extends _types__rspack_import_0.PropertyInfoHandler {
|
|
|
2650
2728
|
}
|
|
2651
2729
|
|
|
2652
2730
|
|
|
2731
|
+
},
|
|
2732
|
+
"./src/codegen/handlers/serialize/SerializeComputedHandler.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
2733
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2734
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
2735
|
+
SerializeComputedHandler: () => (SerializeComputedHandler)
|
|
2736
|
+
});
|
|
2737
|
+
/* import */ var _types__rspack_import_0 = __webpack_require__("./src/codegen/handlers/types.ts");
|
|
2738
|
+
/* import */ var _schema__rspack_import_1 = __webpack_require__("./src/schema/types.ts");
|
|
2739
|
+
|
|
2740
|
+
|
|
2741
|
+
class SerializeComputedHandler extends _types__rspack_import_0.PropertyInfoHandler {
|
|
2742
|
+
handle(property, builder) {
|
|
2743
|
+
if (property.type === _schema__rspack_import_1.SchemaTypes.Computed && property.isUnmapped === true) {
|
|
2744
|
+
// Do not serialize computed properties that are unmapped
|
|
2745
|
+
return builder;
|
|
2746
|
+
}
|
|
2747
|
+
return super.handle(property, builder);
|
|
2748
|
+
}
|
|
2749
|
+
}
|
|
2750
|
+
|
|
2751
|
+
|
|
2653
2752
|
},
|
|
2654
2753
|
"./src/codegen/handlers/serialize/SerializeDateHandler.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
2655
2754
|
__webpack_require__.r(__webpack_exports__);
|
|
@@ -2674,7 +2773,7 @@ class SerializeDateHandler extends _types__rspack_import_0.PropertyInfoHandler {
|
|
|
2674
2773
|
const entityAssignmentPath = property.getAssignmentPath({
|
|
2675
2774
|
parent: "result"
|
|
2676
2775
|
});
|
|
2677
|
-
const
|
|
2776
|
+
const _assignment = `${property.name}: ${entitySelectorPath} instanceof Date ? ${entitySelectorPath}.toISOString() : ${entitySelectorPath}`;
|
|
2678
2777
|
// if it is nullable or optional, assign in an if block, otherwise we
|
|
2679
2778
|
// could unintentionally assign null/undefined to a property that does not exist
|
|
2680
2779
|
if (property.isOptional || property.isNullable) {
|
|
@@ -2813,7 +2912,9 @@ class SerializeValueHandler extends _types__rspack_import_0.PropertyInfoHandler
|
|
|
2813
2912
|
}
|
|
2814
2913
|
const parentSelectPath = ["entity", ...property.getParentPathArray()].join(".");
|
|
2815
2914
|
const parentAssignPath = ["result", ...property.getParentPathArray()].join(".");
|
|
2816
|
-
|
|
2915
|
+
// We need to handle serializing delta changes in getChanges, there is the possibility that child objects are null
|
|
2916
|
+
// and we need to handle that scenario
|
|
2917
|
+
const ifSlot = slot.if(`${parentSelectPath} != null && Object.hasOwn(${parentSelectPath}, "${property.name}")`);
|
|
2817
2918
|
if (property.parent.isNullable || property.parent.isOptional) {
|
|
2818
2919
|
// Do this for nullable/optional parents. Parent will be null if its nullable/optional
|
|
2819
2920
|
const conditionallyCreateParent = new _blocks__rspack_import_2.IfBuilder(`${parentAssignPath} == null`).appendBody(`${parentAssignPath} = {}`);
|
|
@@ -2827,6 +2928,39 @@ class SerializeValueHandler extends _types__rspack_import_0.PropertyInfoHandler
|
|
|
2827
2928
|
}
|
|
2828
2929
|
|
|
2829
2930
|
|
|
2931
|
+
},
|
|
2932
|
+
"./src/codegen/handlers/set/SetComplexHandler.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
2933
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2934
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
2935
|
+
SetComplexHandler: () => (SetComplexHandler)
|
|
2936
|
+
});
|
|
2937
|
+
/* import */ var _types__rspack_import_1 = __webpack_require__("./src/codegen/handlers/types.ts");
|
|
2938
|
+
/* import */ var _schema_types__rspack_import_0 = __webpack_require__("./src/schema/types.ts");
|
|
2939
|
+
|
|
2940
|
+
|
|
2941
|
+
const allowedTypes = new Set([
|
|
2942
|
+
_schema_types__rspack_import_0.SchemaTypes.Array,
|
|
2943
|
+
_schema_types__rspack_import_0.SchemaTypes.Boolean,
|
|
2944
|
+
_schema_types__rspack_import_0.SchemaTypes.Date,
|
|
2945
|
+
_schema_types__rspack_import_0.SchemaTypes.Number,
|
|
2946
|
+
_schema_types__rspack_import_0.SchemaTypes.Object,
|
|
2947
|
+
_schema_types__rspack_import_0.SchemaTypes.String
|
|
2948
|
+
]);
|
|
2949
|
+
class SetComplexHandler extends _types__rspack_import_1.PropertyInfoHandler {
|
|
2950
|
+
handle(property, builder) {
|
|
2951
|
+
if (allowedTypes.has(property.type)) {
|
|
2952
|
+
const selectorPath = property.getSelectrorPath({ parent: "source", assignmentType: "FORCE_NULLABLE_OR_OPTIONAL" });
|
|
2953
|
+
const slot = builder.get("assignments");
|
|
2954
|
+
const entitySelectorPath = property.getAssignmentPath({ parent: "source" });
|
|
2955
|
+
const enrichedAssignmentPath = property.getAssignmentPath({ parent: "destination" });
|
|
2956
|
+
slot.if(`${selectorPath} != null`).appendBody(`${enrichedAssignmentPath} = ${entitySelectorPath}`);
|
|
2957
|
+
return builder;
|
|
2958
|
+
}
|
|
2959
|
+
return super.handle(property, builder);
|
|
2960
|
+
}
|
|
2961
|
+
}
|
|
2962
|
+
|
|
2963
|
+
|
|
2830
2964
|
},
|
|
2831
2965
|
"./src/codegen/handlers/strip/StripIdentityHandler.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
2832
2966
|
__webpack_require__.r(__webpack_exports__);
|
|
@@ -3393,7 +3527,7 @@ class MemoryDataCollection {
|
|
|
3393
3527
|
resolveIdSet(item) {
|
|
3394
3528
|
if (this.schema.hasIdentityKeys) {
|
|
3395
3529
|
const idProperties = this.schema.idProperties;
|
|
3396
|
-
const ids =
|
|
3530
|
+
const ids = Array.from({ length: idProperties.length });
|
|
3397
3531
|
// Need to make sure we allow for seeding the collection when we call add vs seed
|
|
3398
3532
|
// There will be an existing id, but the id type could still be identity
|
|
3399
3533
|
if (idProperties.length === 1) {
|
|
@@ -3618,26 +3752,48 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
3618
3752
|
|
|
3619
3753
|
|
|
3620
3754
|
|
|
3755
|
+
},
|
|
3756
|
+
"./src/expressions/constants.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
3757
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3758
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
3759
|
+
EXPRESSION_TYPES: () => (EXPRESSION_TYPES)
|
|
3760
|
+
});
|
|
3761
|
+
const EXPRESSION_TYPES = [
|
|
3762
|
+
"operator",
|
|
3763
|
+
"comparator",
|
|
3764
|
+
"property",
|
|
3765
|
+
"value",
|
|
3766
|
+
"empty",
|
|
3767
|
+
"not-parsable",
|
|
3768
|
+
];
|
|
3769
|
+
|
|
3770
|
+
|
|
3621
3771
|
},
|
|
3622
3772
|
"./src/expressions/index.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
3623
3773
|
__webpack_require__.r(__webpack_exports__);
|
|
3624
3774
|
__webpack_require__.d(__webpack_exports__, {
|
|
3625
|
-
ComparatorExpression: () => (/* reexport safe */
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3775
|
+
ComparatorExpression: () => (/* reexport safe */ _types__rspack_import_2.ComparatorExpression),
|
|
3776
|
+
EXPRESSION_TYPES: () => (/* reexport safe */ _constants__rspack_import_4.EXPRESSION_TYPES),
|
|
3777
|
+
EmptyExpression: () => (/* reexport safe */ _types__rspack_import_2.EmptyExpression),
|
|
3778
|
+
Expression: () => (/* reexport safe */ _types__rspack_import_2.Expression),
|
|
3779
|
+
NotParsableExpression: () => (/* reexport safe */ _types__rspack_import_2.NotParsableExpression),
|
|
3780
|
+
OperatorExpression: () => (/* reexport safe */ _types__rspack_import_2.OperatorExpression),
|
|
3781
|
+
PropertyExpression: () => (/* reexport safe */ _types__rspack_import_2.PropertyExpression),
|
|
3782
|
+
ValueExpression: () => (/* reexport safe */ _types__rspack_import_2.ValueExpression),
|
|
3632
3783
|
combineExpressions: () => (/* reexport safe */ _parser__rspack_import_0.combineExpressions),
|
|
3633
|
-
forEach: () => (/* reexport safe */
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
toExpression: () => (/* reexport safe */ _parser__rspack_import_0.toExpression)
|
|
3784
|
+
forEach: () => (/* reexport safe */ _utils__rspack_import_3.forEach),
|
|
3785
|
+
getDialect: () => (/* reexport safe */ _sql__rspack_import_1.getDialect),
|
|
3786
|
+
getProperties: () => (/* reexport safe */ _utils__rspack_import_3.getProperties),
|
|
3787
|
+
toExpression: () => (/* reexport safe */ _parser__rspack_import_0.toExpression),
|
|
3788
|
+
toSql: () => (/* reexport safe */ _sql__rspack_import_1.toSql)
|
|
3637
3789
|
});
|
|
3638
3790
|
/* import */ var _parser__rspack_import_0 = __webpack_require__("./src/expressions/parser.ts");
|
|
3639
|
-
/* import */ var
|
|
3640
|
-
/* import */ var
|
|
3791
|
+
/* import */ var _sql__rspack_import_1 = __webpack_require__("./src/expressions/sql.ts");
|
|
3792
|
+
/* import */ var _types__rspack_import_2 = __webpack_require__("./src/expressions/types.ts");
|
|
3793
|
+
/* import */ var _utils__rspack_import_3 = __webpack_require__("./src/expressions/utils.ts");
|
|
3794
|
+
/* import */ var _constants__rspack_import_4 = __webpack_require__("./src/expressions/constants.ts");
|
|
3795
|
+
|
|
3796
|
+
|
|
3641
3797
|
|
|
3642
3798
|
|
|
3643
3799
|
|
|
@@ -4196,9 +4352,9 @@ const getComparator = (value) => {
|
|
|
4196
4352
|
};
|
|
4197
4353
|
const getValue = (value, params) => {
|
|
4198
4354
|
// Early return for string literals
|
|
4199
|
-
if (value.startsWith("
|
|
4355
|
+
if (value.startsWith("'") || value.startsWith("\"")) {
|
|
4200
4356
|
return new _types__rspack_import_0.ValueExpression({
|
|
4201
|
-
value: value.replace(
|
|
4357
|
+
value: value.replace(/"|'/g, "")
|
|
4202
4358
|
});
|
|
4203
4359
|
}
|
|
4204
4360
|
// Early return for null/undefined
|
|
@@ -4231,7 +4387,7 @@ const getValue = (value, params) => {
|
|
|
4231
4387
|
const paramValue = getValueFromParams(`${params.name}.${potentialParamPath}`, params);
|
|
4232
4388
|
return new _types__rspack_import_0.ValueExpression({ value: paramValue });
|
|
4233
4389
|
}
|
|
4234
|
-
catch
|
|
4390
|
+
catch {
|
|
4235
4391
|
// Not a parameter path, continue with normal parsing
|
|
4236
4392
|
}
|
|
4237
4393
|
}
|
|
@@ -4318,7 +4474,7 @@ const getProperty = (schema, value, params) => {
|
|
|
4318
4474
|
throw new Error(ERROR_MESSAGES.PROPERTY_NOT_FOUND(value));
|
|
4319
4475
|
}
|
|
4320
4476
|
}
|
|
4321
|
-
catch
|
|
4477
|
+
catch {
|
|
4322
4478
|
// Not a valid parameter path, continue to error
|
|
4323
4479
|
throw new Error(ERROR_MESSAGES.PROPERTY_NOT_FOUND(value));
|
|
4324
4480
|
}
|
|
@@ -4356,6 +4512,282 @@ const getProperty = (schema, value, params) => {
|
|
|
4356
4512
|
};
|
|
4357
4513
|
|
|
4358
4514
|
|
|
4515
|
+
},
|
|
4516
|
+
"./src/expressions/sql.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
4517
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4518
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
4519
|
+
getDialect: () => (getDialect),
|
|
4520
|
+
toSql: () => (toSql)
|
|
4521
|
+
});
|
|
4522
|
+
/* import */ var _assertions__rspack_import_0 = __webpack_require__("./src/assertions/index.ts");
|
|
4523
|
+
|
|
4524
|
+
const DIALECTS = {
|
|
4525
|
+
sqlite: {
|
|
4526
|
+
quoteIdentifier(name) {
|
|
4527
|
+
return `"${name.replace(/"/g, '""')}"`;
|
|
4528
|
+
},
|
|
4529
|
+
getPlaceholder(_i) {
|
|
4530
|
+
return "?";
|
|
4531
|
+
},
|
|
4532
|
+
stringMatchKind: "GLOB",
|
|
4533
|
+
likeEscapeClause() {
|
|
4534
|
+
return "";
|
|
4535
|
+
},
|
|
4536
|
+
},
|
|
4537
|
+
postgresql: {
|
|
4538
|
+
quoteIdentifier(name) {
|
|
4539
|
+
return `"${name.replace(/"/g, '""')}"`;
|
|
4540
|
+
},
|
|
4541
|
+
getPlaceholder(i) {
|
|
4542
|
+
return `$${i + 1}`;
|
|
4543
|
+
},
|
|
4544
|
+
stringMatchKind: "LIKE",
|
|
4545
|
+
likeEscapeClause() {
|
|
4546
|
+
return " ESCAPE E'\\\\'";
|
|
4547
|
+
},
|
|
4548
|
+
},
|
|
4549
|
+
mysql: {
|
|
4550
|
+
quoteIdentifier(name) {
|
|
4551
|
+
return "`" + name.replace(/`/g, "``") + "`";
|
|
4552
|
+
},
|
|
4553
|
+
getPlaceholder(_i) {
|
|
4554
|
+
return "?";
|
|
4555
|
+
},
|
|
4556
|
+
stringMatchKind: "LIKE",
|
|
4557
|
+
likeEscapeClause() {
|
|
4558
|
+
return " ESCAPE '\\\\'";
|
|
4559
|
+
},
|
|
4560
|
+
},
|
|
4561
|
+
mssql: {
|
|
4562
|
+
quoteIdentifier(name) {
|
|
4563
|
+
return "[" + name.replace(/]/g, "]]") + "]";
|
|
4564
|
+
},
|
|
4565
|
+
getPlaceholder(i) {
|
|
4566
|
+
return `@p${i + 1}`;
|
|
4567
|
+
},
|
|
4568
|
+
stringMatchKind: "LIKE",
|
|
4569
|
+
likeEscapeClause() {
|
|
4570
|
+
return " ESCAPE '\\\\'";
|
|
4571
|
+
},
|
|
4572
|
+
},
|
|
4573
|
+
};
|
|
4574
|
+
function getDialect(name) {
|
|
4575
|
+
const d = DIALECTS[name];
|
|
4576
|
+
if (!d)
|
|
4577
|
+
throw new Error(`Unknown SQL dialect: ${name}`);
|
|
4578
|
+
return d;
|
|
4579
|
+
}
|
|
4580
|
+
function escapeLikeLiteral(value) {
|
|
4581
|
+
return value.replace(/\\/g, "\\\\").replace(/%/g, "\\%").replace(/_/g, "\\_");
|
|
4582
|
+
}
|
|
4583
|
+
function escapeGlobLiteral(value) {
|
|
4584
|
+
return value.replace(/\\/g, "\\\\").replace(/\*/g, "\\*").replace(/\?/g, "\\?");
|
|
4585
|
+
}
|
|
4586
|
+
function escapeForPattern(value, kind) {
|
|
4587
|
+
return kind === "LIKE" ? escapeLikeLiteral(value) : escapeGlobLiteral(value);
|
|
4588
|
+
}
|
|
4589
|
+
function buildPattern(escapedValue, match, kind) {
|
|
4590
|
+
if (kind === "LIKE") {
|
|
4591
|
+
switch (match) {
|
|
4592
|
+
case "contains":
|
|
4593
|
+
return `%${escapedValue}%`;
|
|
4594
|
+
case "starts-with":
|
|
4595
|
+
return `${escapedValue}%`;
|
|
4596
|
+
case "ends-with":
|
|
4597
|
+
return `%${escapedValue}`;
|
|
4598
|
+
}
|
|
4599
|
+
}
|
|
4600
|
+
switch (match) {
|
|
4601
|
+
case "contains":
|
|
4602
|
+
return `*${escapedValue}*`;
|
|
4603
|
+
case "starts-with":
|
|
4604
|
+
return `${escapedValue}*`;
|
|
4605
|
+
case "ends-with":
|
|
4606
|
+
return `*${escapedValue}`;
|
|
4607
|
+
}
|
|
4608
|
+
}
|
|
4609
|
+
function getPropertyValueSides(cmp) {
|
|
4610
|
+
const propLeft = cmp.left && (0,_assertions__rspack_import_0.isPropertyExpression)(cmp.left) ? cmp.left : null;
|
|
4611
|
+
const propRight = cmp.right && (0,_assertions__rspack_import_0.isPropertyExpression)(cmp.right) ? cmp.right : null;
|
|
4612
|
+
const valLeft = cmp.left && (0,_assertions__rspack_import_0.isValueExpression)(cmp.left) ? cmp.left.value : null;
|
|
4613
|
+
const valRight = cmp.right && (0,_assertions__rspack_import_0.isValueExpression)(cmp.right) ? cmp.right.value : null;
|
|
4614
|
+
return { propLeft, propRight, valLeft, valRight };
|
|
4615
|
+
}
|
|
4616
|
+
function getEqualsCase(value, columnOnLeft, columnOnRight) {
|
|
4617
|
+
if (value === null && columnOnLeft)
|
|
4618
|
+
return "null-column-left";
|
|
4619
|
+
if (value === null && columnOnRight)
|
|
4620
|
+
return "null-column-right";
|
|
4621
|
+
if (value !== null && columnOnLeft)
|
|
4622
|
+
return "value-column-left";
|
|
4623
|
+
if (value !== null && columnOnRight)
|
|
4624
|
+
return "value-column-right";
|
|
4625
|
+
return null;
|
|
4626
|
+
}
|
|
4627
|
+
function equalsNullColumnLeft(ctx) {
|
|
4628
|
+
return ctx.negated ? `${ctx.col} IS NOT NULL` : `${ctx.col} IS NULL`;
|
|
4629
|
+
}
|
|
4630
|
+
function equalsNullColumnRight(ctx) {
|
|
4631
|
+
ctx.params.push(null);
|
|
4632
|
+
const ph = ctx.placeholder();
|
|
4633
|
+
return ctx.negated ? `${ph} IS NOT NULL` : `${ph} IS NULL`;
|
|
4634
|
+
}
|
|
4635
|
+
function equalsValueColumnLeft(ctx) {
|
|
4636
|
+
ctx.params.push(ctx.value);
|
|
4637
|
+
const ph = ctx.placeholder();
|
|
4638
|
+
return ctx.negated ? `${ctx.col} != ${ph}` : `${ctx.col} = ${ph}`;
|
|
4639
|
+
}
|
|
4640
|
+
function equalsValueColumnRight(ctx) {
|
|
4641
|
+
ctx.params.push(ctx.value);
|
|
4642
|
+
const ph = ctx.placeholder();
|
|
4643
|
+
return ctx.negated ? `${ph} != ${ctx.col}` : `${ph} = ${ctx.col}`;
|
|
4644
|
+
}
|
|
4645
|
+
const EQUALS_STRATEGIES = {
|
|
4646
|
+
"null-column-left": equalsNullColumnLeft,
|
|
4647
|
+
"null-column-right": equalsNullColumnRight,
|
|
4648
|
+
"value-column-left": equalsValueColumnLeft,
|
|
4649
|
+
"value-column-right": equalsValueColumnRight,
|
|
4650
|
+
};
|
|
4651
|
+
// --- String-pattern comparison (includes / starts-with / ends-with) ---
|
|
4652
|
+
function renderStringPatternComparison(cmp, d, params, placeholder) {
|
|
4653
|
+
const { propLeft, propRight, valLeft, valRight } = getPropertyValueSides(cmp);
|
|
4654
|
+
const kind = d.stringMatchKind;
|
|
4655
|
+
if (cmp.comparator === "includes") {
|
|
4656
|
+
const col = propLeft && valRight !== null
|
|
4657
|
+
? d.quoteIdentifier(propLeft.property.name)
|
|
4658
|
+
: propRight && valLeft !== null
|
|
4659
|
+
? d.quoteIdentifier(propRight.property.name)
|
|
4660
|
+
: null;
|
|
4661
|
+
const value = valRight !== null ? valRight : valLeft;
|
|
4662
|
+
if (col === null) {
|
|
4663
|
+
throw new Error("Complex expressions not supported for includes operations");
|
|
4664
|
+
}
|
|
4665
|
+
if (Array.isArray(value)) {
|
|
4666
|
+
const placeholders = value.map(() => placeholder()).join(", ");
|
|
4667
|
+
params.push(...value);
|
|
4668
|
+
return cmp.negated ? `${col} NOT IN (${placeholders})` : `${col} IN (${placeholders})`;
|
|
4669
|
+
}
|
|
4670
|
+
const escaped = escapeForPattern(String(value), kind);
|
|
4671
|
+
const pattern = buildPattern(escaped, "contains", kind);
|
|
4672
|
+
params.push(pattern);
|
|
4673
|
+
const ph = placeholder();
|
|
4674
|
+
const op = kind === "GLOB" ? "GLOB" : "LIKE";
|
|
4675
|
+
const escape = kind === "LIKE" ? d.likeEscapeClause() : "";
|
|
4676
|
+
if (propLeft && valRight !== null) {
|
|
4677
|
+
return cmp.negated ? `${col} NOT ${op} ${ph}${escape}` : `${col} ${op} ${ph}${escape}`;
|
|
4678
|
+
}
|
|
4679
|
+
return cmp.negated ? `${ph} NOT ${op} ${col}${escape}` : `${ph} ${op} ${col}${escape}`;
|
|
4680
|
+
}
|
|
4681
|
+
const col = propLeft && valRight !== null
|
|
4682
|
+
? d.quoteIdentifier(propLeft.property.name)
|
|
4683
|
+
: propRight && valLeft !== null
|
|
4684
|
+
? d.quoteIdentifier(propRight.property.name)
|
|
4685
|
+
: null;
|
|
4686
|
+
const value = valRight !== null ? String(valRight) : valLeft !== null ? String(valLeft) : null;
|
|
4687
|
+
if (col === null || value === null) {
|
|
4688
|
+
throw new Error(`Complex expressions not supported for ${cmp.comparator} operations`);
|
|
4689
|
+
}
|
|
4690
|
+
const escaped = escapeForPattern(value, kind);
|
|
4691
|
+
const pattern = buildPattern(escaped, cmp.comparator === "starts-with" ? "starts-with" : "ends-with", kind);
|
|
4692
|
+
params.push(pattern);
|
|
4693
|
+
const ph = placeholder();
|
|
4694
|
+
const op = kind === "GLOB" ? "GLOB" : "LIKE";
|
|
4695
|
+
const escape = kind === "LIKE" ? d.likeEscapeClause() : "";
|
|
4696
|
+
if (propLeft && valRight !== null) {
|
|
4697
|
+
return cmp.negated ? `${col} NOT ${op} ${ph}${escape}` : `${col} ${op} ${ph}${escape}`;
|
|
4698
|
+
}
|
|
4699
|
+
return cmp.negated ? `${ph} NOT ${op} ${col}${escape}` : `${ph} ${op} ${col}${escape}`;
|
|
4700
|
+
}
|
|
4701
|
+
// --- Generic comparison ---
|
|
4702
|
+
function renderGenericComparison(cmp, walk) {
|
|
4703
|
+
const leftExpr = walk(cmp.left);
|
|
4704
|
+
const rightExpr = walk(cmp.right);
|
|
4705
|
+
switch (cmp.comparator) {
|
|
4706
|
+
case "equals":
|
|
4707
|
+
return cmp.negated ? `${leftExpr} != ${rightExpr}` : `${leftExpr} = ${rightExpr}`;
|
|
4708
|
+
case "greater-than":
|
|
4709
|
+
return cmp.negated ? `${leftExpr} <= ${rightExpr}` : `${leftExpr} > ${rightExpr}`;
|
|
4710
|
+
case "greater-than-equals":
|
|
4711
|
+
return cmp.negated ? `${leftExpr} < ${rightExpr}` : `${leftExpr} >= ${rightExpr}`;
|
|
4712
|
+
case "less-than":
|
|
4713
|
+
return cmp.negated ? `${leftExpr} >= ${rightExpr}` : `${leftExpr} < ${rightExpr}`;
|
|
4714
|
+
case "less-than-equals":
|
|
4715
|
+
return cmp.negated ? `${leftExpr} > ${rightExpr}` : `${leftExpr} <= ${rightExpr}`;
|
|
4716
|
+
default:
|
|
4717
|
+
throw new Error(`Unsupported comparator: ${cmp.comparator}`);
|
|
4718
|
+
}
|
|
4719
|
+
}
|
|
4720
|
+
/**
|
|
4721
|
+
* Converts an Expression to a SQL WHERE clause and bound parameters for the given dialect.
|
|
4722
|
+
*/
|
|
4723
|
+
function toSql(expr, dialect) {
|
|
4724
|
+
const d = typeof dialect === "string" ? getDialect(dialect) : dialect;
|
|
4725
|
+
const params = [];
|
|
4726
|
+
let paramIndex = 0;
|
|
4727
|
+
function placeholder() {
|
|
4728
|
+
const p = d.getPlaceholder(paramIndex);
|
|
4729
|
+
paramIndex += 1;
|
|
4730
|
+
return p;
|
|
4731
|
+
}
|
|
4732
|
+
/** Visitor: map each expression node type to a SQL fragment. */
|
|
4733
|
+
function walk(e) {
|
|
4734
|
+
if ((0,_assertions__rspack_import_0.isOperatorExpression)(e)) {
|
|
4735
|
+
const left = e.left ? walk(e.left) : "";
|
|
4736
|
+
const right = e.right ? walk(e.right) : "";
|
|
4737
|
+
const sqlOp = e.operator === "&&" ? "AND" : e.operator === "||" ? "OR" : e.operator;
|
|
4738
|
+
return `(${left} ${sqlOp} ${right})`;
|
|
4739
|
+
}
|
|
4740
|
+
if ((0,_assertions__rspack_import_0.isComparatorExpression)(e)) {
|
|
4741
|
+
const cmp = e;
|
|
4742
|
+
const isStringPattern = cmp.comparator === "starts-with" ||
|
|
4743
|
+
cmp.comparator === "ends-with" ||
|
|
4744
|
+
cmp.comparator === "includes";
|
|
4745
|
+
if (isStringPattern) {
|
|
4746
|
+
/* String pattern: includes / starts-with / ends-with → one renderer. */
|
|
4747
|
+
return renderStringPatternComparison(cmp, d, params, placeholder);
|
|
4748
|
+
}
|
|
4749
|
+
if (cmp.comparator === "equals") {
|
|
4750
|
+
/* Equals: Strategy per (column-side, null vs value) case. */
|
|
4751
|
+
const { propLeft, propRight, valLeft, valRight } = getPropertyValueSides(cmp);
|
|
4752
|
+
const col = propLeft && (valRight !== undefined || propRight)
|
|
4753
|
+
? d.quoteIdentifier(propLeft.property.name)
|
|
4754
|
+
: propRight && (valLeft !== undefined || propLeft)
|
|
4755
|
+
? d.quoteIdentifier(propRight.property.name)
|
|
4756
|
+
: null;
|
|
4757
|
+
const value = valRight !== undefined ? valRight : valLeft;
|
|
4758
|
+
const columnOnLeft = Boolean(propLeft && cmp.right && (0,_assertions__rspack_import_0.isValueExpression)(cmp.right));
|
|
4759
|
+
const columnOnRight = Boolean(propRight && cmp.left && (0,_assertions__rspack_import_0.isValueExpression)(cmp.left));
|
|
4760
|
+
if (col !== null && value !== undefined) {
|
|
4761
|
+
const caseKey = getEqualsCase(value, columnOnLeft, columnOnRight);
|
|
4762
|
+
if (caseKey !== null) {
|
|
4763
|
+
const strategy = EQUALS_STRATEGIES[caseKey];
|
|
4764
|
+
return strategy({
|
|
4765
|
+
col,
|
|
4766
|
+
value,
|
|
4767
|
+
negated: cmp.negated,
|
|
4768
|
+
params,
|
|
4769
|
+
placeholder,
|
|
4770
|
+
});
|
|
4771
|
+
}
|
|
4772
|
+
}
|
|
4773
|
+
}
|
|
4774
|
+
/* Generic: walk both sides and emit comparison operator. */
|
|
4775
|
+
return renderGenericComparison(cmp, walk);
|
|
4776
|
+
}
|
|
4777
|
+
if ((0,_assertions__rspack_import_0.isPropertyExpression)(e)) {
|
|
4778
|
+
return d.quoteIdentifier(e.property.name);
|
|
4779
|
+
}
|
|
4780
|
+
if ((0,_assertions__rspack_import_0.isValueExpression)(e)) {
|
|
4781
|
+
params.push(e.value);
|
|
4782
|
+
return placeholder();
|
|
4783
|
+
}
|
|
4784
|
+
throw new Error(`Unknown expression type: ${e.type}`);
|
|
4785
|
+
}
|
|
4786
|
+
const where = walk(expr);
|
|
4787
|
+
return { where, params };
|
|
4788
|
+
}
|
|
4789
|
+
|
|
4790
|
+
|
|
4359
4791
|
},
|
|
4360
4792
|
"./src/expressions/types.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
4361
4793
|
__webpack_require__.r(__webpack_exports__);
|
|
@@ -4468,8 +4900,7 @@ class ValueExpression extends Expression {
|
|
|
4468
4900
|
__webpack_require__.r(__webpack_exports__);
|
|
4469
4901
|
__webpack_require__.d(__webpack_exports__, {
|
|
4470
4902
|
forEach: () => (forEach),
|
|
4471
|
-
getProperties: () => (getProperties)
|
|
4472
|
-
isPropertyExpression: () => (isPropertyExpression)
|
|
4903
|
+
getProperties: () => (getProperties)
|
|
4473
4904
|
});
|
|
4474
4905
|
/**
|
|
4475
4906
|
* Extracts all properties referenced in an expression
|
|
@@ -4494,9 +4925,6 @@ function getProperties(expression) {
|
|
|
4494
4925
|
traverse(expression);
|
|
4495
4926
|
return properties;
|
|
4496
4927
|
}
|
|
4497
|
-
function isPropertyExpression(expression) {
|
|
4498
|
-
return expression.type === "property";
|
|
4499
|
-
}
|
|
4500
4928
|
function forEach(expression, callback) {
|
|
4501
4929
|
function traverse(expr) {
|
|
4502
4930
|
// Call the callback for this expression
|
|
@@ -4905,9 +5333,9 @@ class EphemeralDataPlugin {
|
|
|
4905
5333
|
// For adds-only operations, we can skip load for better performance
|
|
4906
5334
|
const needsLoad = updatesLength > 0 || removesLength > 0;
|
|
4907
5335
|
const processChanges = () => {
|
|
4908
|
-
result.adds =
|
|
4909
|
-
result.updates =
|
|
4910
|
-
result.removes =
|
|
5336
|
+
result.adds = Array.from({ length: addsLength });
|
|
5337
|
+
result.updates = Array.from({ length: updatesLength });
|
|
5338
|
+
result.removes = Array.from({ length: removesLength });
|
|
4911
5339
|
for (let j = 0; j < addsLength; j++) {
|
|
4912
5340
|
const item = adds[j];
|
|
4913
5341
|
collection.add(item);
|
|
@@ -4979,7 +5407,7 @@ class EphemeralDataPlugin {
|
|
|
4979
5407
|
}
|
|
4980
5408
|
const records = collection.records;
|
|
4981
5409
|
const length = records.length;
|
|
4982
|
-
const cloned =
|
|
5410
|
+
const cloned = Array.from({ length });
|
|
4983
5411
|
for (let i = 0; i < length; i++) {
|
|
4984
5412
|
cloned[i] = schema.clone(records[i]);
|
|
4985
5413
|
}
|
|
@@ -4998,23 +5426,19 @@ class EphemeralDataPlugin {
|
|
|
4998
5426
|
__webpack_require__.r(__webpack_exports__);
|
|
4999
5427
|
__webpack_require__.d(__webpack_exports__, {
|
|
5000
5428
|
DataTranslator: () => (/* reexport safe */ _translators__rspack_import_0.DataTranslator),
|
|
5001
|
-
EphemeralDataPlugin: () => (/* reexport safe */
|
|
5429
|
+
EphemeralDataPlugin: () => (/* reexport safe */ _EphemeralDataPlugin__rspack_import_2.EphemeralDataPlugin),
|
|
5002
5430
|
JsonTranslator: () => (/* reexport safe */ _translators__rspack_import_0.JsonTranslator),
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
QueryOrdering: () => (/* reexport safe */ _query__rspack_import_2.QueryOrdering),
|
|
5007
|
-
ReplicationDbPlugin: () => (/* reexport safe */ _replication__rspack_import_1.ReplicationDbPlugin),
|
|
5431
|
+
Query: () => (/* reexport safe */ _query__rspack_import_1.Query),
|
|
5432
|
+
QueryOptionsCollection: () => (/* reexport safe */ _query__rspack_import_1.QueryOptionsCollection),
|
|
5433
|
+
QueryOrdering: () => (/* reexport safe */ _query__rspack_import_1.QueryOrdering),
|
|
5008
5434
|
SqlTranslator: () => (/* reexport safe */ _translators__rspack_import_0.SqlTranslator),
|
|
5009
5435
|
TranslatedArrayValue: () => (/* reexport safe */ _translators__rspack_import_0.TranslatedArrayValue),
|
|
5010
5436
|
TranslatedGroupValue: () => (/* reexport safe */ _translators__rspack_import_0.TranslatedGroupValue),
|
|
5011
5437
|
TranslatedSingleValue: () => (/* reexport safe */ _translators__rspack_import_0.TranslatedSingleValue)
|
|
5012
5438
|
});
|
|
5013
5439
|
/* import */ var _translators__rspack_import_0 = __webpack_require__("./src/plugins/translators/index.ts");
|
|
5014
|
-
/* import */ var
|
|
5015
|
-
/* import */ var
|
|
5016
|
-
/* import */ var _EphemeralDataPlugin__rspack_import_3 = __webpack_require__("./src/plugins/EphemeralDataPlugin.ts");
|
|
5017
|
-
|
|
5440
|
+
/* import */ var _query__rspack_import_1 = __webpack_require__("./src/plugins/query/index.ts");
|
|
5441
|
+
/* import */ var _EphemeralDataPlugin__rspack_import_2 = __webpack_require__("./src/plugins/EphemeralDataPlugin.ts");
|
|
5018
5442
|
|
|
5019
5443
|
|
|
5020
5444
|
|
|
@@ -5084,8 +5508,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5084
5508
|
__webpack_require__.d(__webpack_exports__, {
|
|
5085
5509
|
QueryOptionsCollection: () => (QueryOptionsCollection)
|
|
5086
5510
|
});
|
|
5511
|
+
/* import */ var _assertions__rspack_import_1 = __webpack_require__("./src/assertions/index.ts");
|
|
5087
5512
|
/* import */ var _expressions_utils__rspack_import_0 = __webpack_require__("./src/expressions/utils.ts");
|
|
5088
5513
|
|
|
5514
|
+
|
|
5089
5515
|
class QueryOptionsCollection {
|
|
5090
5516
|
options = new Map();
|
|
5091
5517
|
nextExecutionTarget = "database";
|
|
@@ -5122,7 +5548,7 @@ class QueryOptionsCollection {
|
|
|
5122
5548
|
}
|
|
5123
5549
|
else {
|
|
5124
5550
|
(0,_expressions_utils__rspack_import_0.forEach)(filterValue.expression, (expression) => {
|
|
5125
|
-
if ((0,
|
|
5551
|
+
if ((0,_assertions__rspack_import_1.isPropertyExpression)(expression) && expression.property.isUnmapped) {
|
|
5126
5552
|
// Cut over to memory execution, unmapped properties are not in the database and
|
|
5127
5553
|
// cannot be queried
|
|
5128
5554
|
this.nextExecutionTarget = "memory";
|
|
@@ -5162,6 +5588,10 @@ class QueryOptionsCollection {
|
|
|
5162
5588
|
database: databaseQueryOptionsCollection
|
|
5163
5589
|
};
|
|
5164
5590
|
}
|
|
5591
|
+
hasTransformations() {
|
|
5592
|
+
const transformationOptions = ["map", "group", "min", "max", "count", "sum"];
|
|
5593
|
+
return transformationOptions.some((name) => this.options.has(name));
|
|
5594
|
+
}
|
|
5165
5595
|
has(name) {
|
|
5166
5596
|
return this.options.has(name);
|
|
5167
5597
|
}
|
|
@@ -5232,448 +5662,97 @@ var QueryOrdering;
|
|
|
5232
5662
|
|
|
5233
5663
|
|
|
5234
5664
|
},
|
|
5235
|
-
"./src/plugins/
|
|
5665
|
+
"./src/plugins/translators/DataTranslator.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
5236
5666
|
__webpack_require__.r(__webpack_exports__);
|
|
5237
5667
|
__webpack_require__.d(__webpack_exports__, {
|
|
5238
|
-
|
|
5668
|
+
DataTranslator: () => (DataTranslator)
|
|
5239
5669
|
});
|
|
5240
|
-
/* import */ var
|
|
5241
|
-
/* import */ var
|
|
5242
|
-
/* import */ var
|
|
5243
|
-
/* import */ var _utilities__rspack_import_0 = __webpack_require__("./src/utilities/uuid.ts");
|
|
5244
|
-
/* import */ var _utilities__rspack_import_6 = __webpack_require__("./src/utilities/replication.ts");
|
|
5245
|
-
/* import */ var _collections__rspack_import_3 = __webpack_require__("./src/collections/Changes.ts");
|
|
5246
|
-
/* import */ var _performance__rspack_import_4 = __webpack_require__("./src/performance/index.ts");
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
7;
|
|
5250
|
-
|
|
5670
|
+
/* import */ var _TranslatedArrayValue__rspack_import_0 = __webpack_require__("./src/plugins/translators/TranslatedArrayValue.ts");
|
|
5671
|
+
/* import */ var _TranslatedGroupValue__rspack_import_1 = __webpack_require__("./src/plugins/translators/TranslatedGroupValue.ts");
|
|
5672
|
+
/* import */ var _TranslatedSingleValue__rspack_import_2 = __webpack_require__("./src/plugins/translators/TranslatedSingleValue.ts");
|
|
5251
5673
|
|
|
5252
5674
|
|
|
5253
5675
|
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
* @param plugins.source The primary database plugin that will receive all operations first
|
|
5272
|
-
* @param plugins.read The read-optimized plugin (typically a memory plugin) used for fast queries
|
|
5273
|
-
* @param plugins.replicas Additional database plugins that will replicate operations from the source
|
|
5274
|
-
*/
|
|
5275
|
-
constructor(plugins) {
|
|
5276
|
-
this.plugins = plugins;
|
|
5277
|
-
}
|
|
5278
|
-
/**
|
|
5279
|
-
* Will query the read plugin if there is one, otherwise the source plugin will be queried
|
|
5280
|
-
*/
|
|
5281
|
-
query(event, done) {
|
|
5282
|
-
try {
|
|
5283
|
-
const readPlugin = this.plugins.read;
|
|
5284
|
-
const sourcePlugin = this.plugins.source;
|
|
5285
|
-
const collectionSize = getMemoryPluginCollectionSize(this.plugins.read, event.operation.schema);
|
|
5286
|
-
if (collectionSize === 0 && this.collectionHydrationStatuses.get(event.operation.schema.collectionName) == null) {
|
|
5287
|
-
// Notify the cache that the db was hydrated right away
|
|
5288
|
-
this.collectionHydrationStatuses.set(event.operation.schema.collectionName, "pending");
|
|
5289
|
-
// nothing is hydrated, let's try and hydrate before querying
|
|
5290
|
-
// Memory plugin might not be hydrated, lets hydrate it for the targeted schema only,
|
|
5291
|
-
// Other queries will do the same and hydrate if needed
|
|
5292
|
-
// We want to select all data here
|
|
5293
|
-
sourcePlugin.query({
|
|
5294
|
-
id: (0,_utilities__rspack_import_0.uuid)(8),
|
|
5295
|
-
schemas: event.schemas,
|
|
5296
|
-
source: "collection",
|
|
5297
|
-
// Select All Data
|
|
5298
|
-
operation: _query__rspack_import_1.Query.EMPTY(event.operation.schema)
|
|
5299
|
-
}, (sourceResult) => {
|
|
5300
|
-
if (sourceResult.ok === _results__rspack_import_2.Result.ERROR) {
|
|
5301
|
-
// Notify that hydration failed
|
|
5302
|
-
this.collectionHydrationStatuses.set(event.operation.schema.collectionName, "rejected");
|
|
5303
|
-
done(sourceResult);
|
|
5304
|
-
return;
|
|
5305
|
-
}
|
|
5306
|
-
// Source plugin can have no data, still should succeed
|
|
5307
|
-
if (Array.isArray(sourceResult.data.value) === false) {
|
|
5308
|
-
// Notify that hydration failed
|
|
5309
|
-
this.collectionHydrationStatuses.set(event.operation.schema.collectionName, "rejected");
|
|
5310
|
-
done(_results__rspack_import_2.PluginEventResult.error(event.id, "Query result is not an array"));
|
|
5311
|
-
return;
|
|
5312
|
-
}
|
|
5313
|
-
const changesCollection = new _collections__rspack_import_3.BulkPersistChanges();
|
|
5314
|
-
const schemaChanges = changesCollection.resolve(event.operation.schema.id);
|
|
5315
|
-
// Add the existing items into the persist payload as adds
|
|
5316
|
-
schemaChanges.adds = sourceResult.data.value;
|
|
5317
|
-
readPlugin.bulkPersist({
|
|
5318
|
-
id: (0,_utilities__rspack_import_0.uuid)(8),
|
|
5319
|
-
schemas: event.schemas,
|
|
5320
|
-
operation: changesCollection,
|
|
5321
|
-
source: "collection",
|
|
5322
|
-
}, (readPersistResult) => {
|
|
5323
|
-
if (readPersistResult.ok === _results__rspack_import_2.Result.ERROR) {
|
|
5324
|
-
// Notify that hydration failed
|
|
5325
|
-
this.collectionHydrationStatuses.set(event.operation.schema.collectionName, "rejected");
|
|
5326
|
-
done(readPersistResult);
|
|
5327
|
-
return;
|
|
5328
|
-
}
|
|
5329
|
-
this.collectionHydrationStatuses.set(event.operation.schema.collectionName, "fulfilled");
|
|
5330
|
-
// requery the read plugin
|
|
5331
|
-
readPlugin.query(event, done);
|
|
5332
|
-
});
|
|
5333
|
-
});
|
|
5334
|
-
return;
|
|
5335
|
-
}
|
|
5336
|
-
if (this.collectionHydrationStatuses.get(event.operation.schema.collectionName) === "rejected") {
|
|
5337
|
-
done(_results__rspack_import_2.PluginEventResult.error(event.id, "Hydration failed, unable to query read plugin"));
|
|
5338
|
-
return;
|
|
5339
|
-
}
|
|
5340
|
-
// If hydration is pending, do not query empty collection, wait for hydration
|
|
5341
|
-
if (this.collectionHydrationStatuses.get(event.operation.schema.collectionName) === "pending") {
|
|
5342
|
-
const start = (0,_performance__rspack_import_4.now)();
|
|
5343
|
-
const pollHydrationStatus = () => {
|
|
5344
|
-
const delta = (0,_performance__rspack_import_4.now)() - start;
|
|
5345
|
-
if (delta > MAX_HYDRATION_WAIT_MS) {
|
|
5346
|
-
this.collectionHydrationStatuses.set(event.operation.schema.collectionName, "rejected");
|
|
5347
|
-
done(_results__rspack_import_2.PluginEventResult.error(event.id, `Hydration timeout: exceeded maximum wait time of ${MAX_HYDRATION_WAIT_MS}ms`));
|
|
5348
|
-
return;
|
|
5349
|
-
}
|
|
5350
|
-
if (this.collectionHydrationStatuses.get(event.operation.schema.collectionName) === "rejected") {
|
|
5351
|
-
done(_results__rspack_import_2.PluginEventResult.error(event.id, "Hydration failed, unable to query read plugin"));
|
|
5352
|
-
return;
|
|
5353
|
-
}
|
|
5354
|
-
if (this.collectionHydrationStatuses.get(event.operation.schema.collectionName) === "fulfilled") {
|
|
5355
|
-
// Hydration completed successfully, proceed with query
|
|
5356
|
-
readPlugin.query(event, (readResult) => {
|
|
5357
|
-
if (readResult.ok === _results__rspack_import_2.Result.ERROR) {
|
|
5358
|
-
done(readResult);
|
|
5359
|
-
return;
|
|
5360
|
-
}
|
|
5361
|
-
done(readResult);
|
|
5362
|
-
});
|
|
5363
|
-
return;
|
|
5364
|
-
}
|
|
5365
|
-
// Still pending, check again after interval
|
|
5366
|
-
setTimeout(pollHydrationStatus, HYDRATION_POLL_INTERVAL_MS);
|
|
5367
|
-
};
|
|
5368
|
-
pollHydrationStatus();
|
|
5369
|
-
return;
|
|
5370
|
-
}
|
|
5371
|
-
// Collection is hydrated for the targeted collection and should be in sync
|
|
5372
|
-
readPlugin.query(event, (readResult) => {
|
|
5373
|
-
if (readResult.ok === _results__rspack_import_2.Result.ERROR) {
|
|
5374
|
-
done(readResult);
|
|
5375
|
-
return;
|
|
5376
|
-
}
|
|
5377
|
-
done(readResult);
|
|
5378
|
-
return;
|
|
5379
|
-
});
|
|
5380
|
-
}
|
|
5381
|
-
catch (e) {
|
|
5382
|
-
done(_results__rspack_import_2.PluginEventResult.error(event.id, e));
|
|
5383
|
-
}
|
|
5384
|
-
}
|
|
5385
|
-
destroy(event, done) {
|
|
5386
|
-
try {
|
|
5387
|
-
const workPipeline = new _pipeline__rspack_import_5.WorkPipeline();
|
|
5388
|
-
const plugins = [this.plugins.source, ...this.plugins.replicas];
|
|
5389
|
-
for (let i = 0, length = plugins.length; i < length; i++) {
|
|
5390
|
-
workPipeline.pipe((done) => plugins[i].destroy(event, done));
|
|
5391
|
-
}
|
|
5392
|
-
workPipeline.filter((result) => {
|
|
5393
|
-
if (result.ok === _results__rspack_import_2.Result.ERROR) {
|
|
5394
|
-
done(_results__rspack_import_2.PluginEventResult.error(event.id, result.error));
|
|
5395
|
-
return;
|
|
5396
|
-
}
|
|
5397
|
-
done(_results__rspack_import_2.PluginEventResult.success(event.id));
|
|
5398
|
-
});
|
|
5399
|
-
}
|
|
5400
|
-
catch (e) {
|
|
5401
|
-
done(_results__rspack_import_2.PluginEventResult.error(event.id, e));
|
|
5402
|
-
}
|
|
5676
|
+
class DataTranslator {
|
|
5677
|
+
query;
|
|
5678
|
+
functionMap = {
|
|
5679
|
+
count: (data, option) => this.count(data, option),
|
|
5680
|
+
distinct: (data, option) => this.distinct(data, option),
|
|
5681
|
+
filter: (data, option) => this.filter(data, option),
|
|
5682
|
+
map: (data, option) => this.map(data, option),
|
|
5683
|
+
max: (data, option) => this.max(data, option),
|
|
5684
|
+
min: (data, option) => this.min(data, option),
|
|
5685
|
+
skip: (data, option) => this.skip(data, option),
|
|
5686
|
+
sort: (data, option) => this.sort(data, option),
|
|
5687
|
+
sum: (data, option) => this.sum(data, option),
|
|
5688
|
+
take: (data, option) => this.take(data, option),
|
|
5689
|
+
group: (data, option) => this.group(data, option)
|
|
5690
|
+
};
|
|
5691
|
+
constructor(query) {
|
|
5692
|
+
this.query = query;
|
|
5403
5693
|
}
|
|
5404
|
-
|
|
5405
|
-
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
id: (0,_utilities__rspack_import_0.uuid)(8),
|
|
5412
|
-
operation: event.operation,
|
|
5413
|
-
schemas: event.schemas,
|
|
5414
|
-
source: "data-store",
|
|
5415
|
-
}, (r) => {
|
|
5416
|
-
if (r.ok !== _results__rspack_import_2.Result.SUCCESS) {
|
|
5417
|
-
done(r);
|
|
5418
|
-
return;
|
|
5419
|
-
}
|
|
5420
|
-
// optimistically call done and still continue saving the rest of the data. We read from the memory
|
|
5421
|
-
// db anyways
|
|
5422
|
-
done(r);
|
|
5423
|
-
const optimisticBulkPersistChanges = new _collections__rspack_import_3.BulkPersistChanges();
|
|
5424
|
-
// make sure we swap the adds here, that way we can make sure other persist events
|
|
5425
|
-
// don't take their additions and try to change subsequent calls
|
|
5426
|
-
(0,_utilities__rspack_import_6.resolveBulkPersistChanges)(event, r.data, optimisticBulkPersistChanges);
|
|
5427
|
-
for (let i = 0, length = deferredPlugins.length; i < length; i++) {
|
|
5428
|
-
workPipeline.pipe((d) => {
|
|
5429
|
-
const plugin = deferredPlugins[i];
|
|
5430
|
-
plugin.bulkPersist({
|
|
5431
|
-
id: (0,_utilities__rspack_import_0.uuid)(8),
|
|
5432
|
-
operation: optimisticBulkPersistChanges,
|
|
5433
|
-
schemas: event.schemas,
|
|
5434
|
-
source: "data-store",
|
|
5435
|
-
}, (r) => {
|
|
5436
|
-
if (r.ok === _results__rspack_import_2.Result.ERROR) {
|
|
5437
|
-
d(r);
|
|
5438
|
-
return;
|
|
5439
|
-
}
|
|
5440
|
-
d(_results__rspack_import_2.Result.success());
|
|
5441
|
-
});
|
|
5442
|
-
});
|
|
5443
|
-
}
|
|
5444
|
-
setTimeout(() => {
|
|
5445
|
-
workPipeline.filter((_) => {
|
|
5446
|
-
// no-op for now, maybe implement retries?
|
|
5447
|
-
});
|
|
5448
|
-
}, 5);
|
|
5449
|
-
});
|
|
5694
|
+
translate(data) {
|
|
5695
|
+
const isTransformed = this.query.options.hasTransformations();
|
|
5696
|
+
this.query.options.forEach(item => {
|
|
5697
|
+
data = this.functionMap[item.name](data, item);
|
|
5698
|
+
});
|
|
5699
|
+
if (Array.isArray(data)) {
|
|
5700
|
+
return new _TranslatedArrayValue__rspack_import_0.TranslatedArrayValue(data, isTransformed);
|
|
5450
5701
|
}
|
|
5451
|
-
|
|
5452
|
-
|
|
5702
|
+
if (this.query.options.has("group")) {
|
|
5703
|
+
return new _TranslatedGroupValue__rspack_import_1.TranslatedGroupValue(data, isTransformed);
|
|
5453
5704
|
}
|
|
5705
|
+
return new _TranslatedSingleValue__rspack_import_2.TranslatedSingleValue(data, isTransformed);
|
|
5454
5706
|
}
|
|
5455
5707
|
}
|
|
5456
5708
|
|
|
5457
5709
|
|
|
5458
5710
|
},
|
|
5459
|
-
"./src/plugins/
|
|
5711
|
+
"./src/plugins/translators/JsonTranslator.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
5460
5712
|
__webpack_require__.r(__webpack_exports__);
|
|
5461
5713
|
__webpack_require__.d(__webpack_exports__, {
|
|
5462
|
-
|
|
5714
|
+
JsonTranslator: () => (JsonTranslator)
|
|
5463
5715
|
});
|
|
5464
|
-
/* import */ var
|
|
5465
|
-
/* import */ var
|
|
5466
|
-
/* import */ var
|
|
5467
|
-
/* import */ var _utilities__rspack_import_3 = __webpack_require__("./src/utilities/replication.ts");
|
|
5468
|
-
|
|
5716
|
+
/* import */ var _DataTranslator__rspack_import_0 = __webpack_require__("./src/plugins/translators/DataTranslator.ts");
|
|
5717
|
+
/* import */ var _assertions__rspack_import_1 = __webpack_require__("./src/assertions/index.ts");
|
|
5718
|
+
/* import */ var _utilities__rspack_import_2 = __webpack_require__("./src/utilities/dates.ts");
|
|
5469
5719
|
|
|
5470
5720
|
|
|
5471
5721
|
|
|
5472
|
-
class
|
|
5473
|
-
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5722
|
+
class JsonTranslator extends _DataTranslator__rspack_import_0.DataTranslator {
|
|
5723
|
+
filter(data, option) {
|
|
5724
|
+
(0,_assertions__rspack_import_1.assertIsArray)(data);
|
|
5725
|
+
if (option.value.filter) {
|
|
5726
|
+
if (option.value.params == null) {
|
|
5727
|
+
// standard filtering
|
|
5728
|
+
return data.filter(option.value.filter);
|
|
5729
|
+
}
|
|
5730
|
+
// params filtering
|
|
5731
|
+
const selector = option.value.filter;
|
|
5732
|
+
return data.filter(w => selector([w, option.value.params]));
|
|
5733
|
+
}
|
|
5734
|
+
return data;
|
|
5484
5735
|
}
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
query(event, done) {
|
|
5489
|
-
try {
|
|
5490
|
-
const plugin = this.plugins.read != null ? this.plugins.read : this.plugins.source;
|
|
5491
|
-
plugin.query(event, done);
|
|
5736
|
+
map(data, option) {
|
|
5737
|
+
if (Array.isArray(data) == false) {
|
|
5738
|
+
throw new Error("Can only map an array of data");
|
|
5492
5739
|
}
|
|
5493
|
-
|
|
5494
|
-
|
|
5740
|
+
const response = Array.from({ length: data.length });
|
|
5741
|
+
for (let i = 0, length = data.length; i < length; i++) {
|
|
5742
|
+
for (let j = 0, l = option.value.fields.length; j < l; j++) {
|
|
5743
|
+
const field = option.value.fields[j];
|
|
5744
|
+
if (field.property != null) {
|
|
5745
|
+
const value = field.property.getValue(data[i]);
|
|
5746
|
+
if (value != null) {
|
|
5747
|
+
// Some types do not support deserialization (Array, Function, Computed, etc), just directly set the incoming value
|
|
5748
|
+
const resolvedValue = field.property.supportsDeserialization ? field.property.deserialize(value) : value;
|
|
5749
|
+
field.property.setValue(data[i], resolvedValue);
|
|
5750
|
+
}
|
|
5751
|
+
}
|
|
5752
|
+
}
|
|
5753
|
+
response[i] = option.value.selector(data[i]);
|
|
5495
5754
|
}
|
|
5496
|
-
|
|
5497
|
-
destroy(event, done) {
|
|
5498
|
-
try {
|
|
5499
|
-
const pipeline = new _pipeline__rspack_import_1.WorkPipeline();
|
|
5500
|
-
const plugins = [this.plugins.source, ...this.plugins.replicas];
|
|
5501
|
-
for (let i = 0, length = plugins.length; i < length; i++) {
|
|
5502
|
-
pipeline.pipe((done) => plugins[i].destroy(event, done));
|
|
5503
|
-
}
|
|
5504
|
-
pipeline.filter((result) => {
|
|
5505
|
-
if (result.ok === _results__rspack_import_0.Result.ERROR) {
|
|
5506
|
-
done(_results__rspack_import_0.PluginEventResult.error(event.id, result.error));
|
|
5507
|
-
return;
|
|
5508
|
-
}
|
|
5509
|
-
done(_results__rspack_import_0.PluginEventResult.success(event.id));
|
|
5510
|
-
});
|
|
5511
|
-
}
|
|
5512
|
-
catch (e) {
|
|
5513
|
-
done(_results__rspack_import_0.PluginEventResult.error(event.id, e));
|
|
5514
|
-
}
|
|
5515
|
-
}
|
|
5516
|
-
bulkPersist(event, done) {
|
|
5517
|
-
try {
|
|
5518
|
-
// insert into the source first to generate any ids, then take the result and persist that into the replicas
|
|
5519
|
-
const pipeline = new _pipeline__rspack_import_1.WorkPipeline();
|
|
5520
|
-
const plugins = [this.plugins.source, ...this.plugins.replicas];
|
|
5521
|
-
if (this.plugins.read != null) {
|
|
5522
|
-
plugins.push(this.plugins.read);
|
|
5523
|
-
}
|
|
5524
|
-
const result = new _collections__rspack_import_2.BulkPersistResult();
|
|
5525
|
-
for (let i = 0, length = plugins.length; i < length; i++) {
|
|
5526
|
-
pipeline.pipe((d) => {
|
|
5527
|
-
const plugin = plugins[i];
|
|
5528
|
-
// source is first
|
|
5529
|
-
if (i === 0) {
|
|
5530
|
-
plugin.bulkPersist(event, (r) => {
|
|
5531
|
-
if (r.ok === _results__rspack_import_0.Result.ERROR) {
|
|
5532
|
-
d(r);
|
|
5533
|
-
return;
|
|
5534
|
-
}
|
|
5535
|
-
// make sure we swap the adds here, that way we can make sure other persist events
|
|
5536
|
-
// don't take their additions and try to change subsequent calls
|
|
5537
|
-
(0,_utilities__rspack_import_3.resolveBulkPersistChanges)(event, r.data, event.operation);
|
|
5538
|
-
d(_results__rspack_import_0.Result.success());
|
|
5539
|
-
});
|
|
5540
|
-
return;
|
|
5541
|
-
}
|
|
5542
|
-
plugin.bulkPersist(event, (r) => {
|
|
5543
|
-
if (r.ok === _results__rspack_import_0.Result.ERROR) {
|
|
5544
|
-
d(r);
|
|
5545
|
-
return;
|
|
5546
|
-
}
|
|
5547
|
-
d(_results__rspack_import_0.Result.success());
|
|
5548
|
-
});
|
|
5549
|
-
});
|
|
5550
|
-
}
|
|
5551
|
-
let successCount = 0;
|
|
5552
|
-
pipeline.filter((r) => {
|
|
5553
|
-
if (r.ok === _results__rspack_import_0.Result.ERROR) {
|
|
5554
|
-
if (successCount > 0) {
|
|
5555
|
-
done(_results__rspack_import_0.PluginEventResult.partial(event.id, result, r.error));
|
|
5556
|
-
return;
|
|
5557
|
-
}
|
|
5558
|
-
done(_results__rspack_import_0.PluginEventResult.error(event.id, r.error));
|
|
5559
|
-
return;
|
|
5560
|
-
}
|
|
5561
|
-
successCount++;
|
|
5562
|
-
done(_results__rspack_import_0.PluginEventResult.success(event.id, result));
|
|
5563
|
-
});
|
|
5564
|
-
}
|
|
5565
|
-
catch (e) {
|
|
5566
|
-
done(_results__rspack_import_0.PluginEventResult.error(event.id, e));
|
|
5567
|
-
}
|
|
5568
|
-
}
|
|
5569
|
-
}
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
},
|
|
5573
|
-
"./src/plugins/replication/index.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
5574
|
-
__webpack_require__.r(__webpack_exports__);
|
|
5575
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
5576
|
-
OptimisticReplicationDbPlugin: () => (/* reexport safe */ _OptimisticReplicationDbPlugin__rspack_import_1.OptimisticReplicationDbPlugin),
|
|
5577
|
-
ReplicationDbPlugin: () => (/* reexport safe */ _ReplicationDbPlugin__rspack_import_0.ReplicationDbPlugin)
|
|
5578
|
-
});
|
|
5579
|
-
/* import */ var _ReplicationDbPlugin__rspack_import_0 = __webpack_require__("./src/plugins/replication/ReplicationDbPlugin.ts");
|
|
5580
|
-
/* import */ var _OptimisticReplicationDbPlugin__rspack_import_1 = __webpack_require__("./src/plugins/replication/OptimisticReplicationDbPlugin.ts");
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
},
|
|
5587
|
-
"./src/plugins/translators/DataTranslator.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
5588
|
-
__webpack_require__.r(__webpack_exports__);
|
|
5589
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
5590
|
-
DataTranslator: () => (DataTranslator)
|
|
5591
|
-
});
|
|
5592
|
-
/* import */ var _TranslatedArrayValue__rspack_import_0 = __webpack_require__("./src/plugins/translators/TranslatedArrayValue.ts");
|
|
5593
|
-
/* import */ var _TranslatedGroupValue__rspack_import_1 = __webpack_require__("./src/plugins/translators/TranslatedGroupValue.ts");
|
|
5594
|
-
/* import */ var _TranslatedSingleValue__rspack_import_2 = __webpack_require__("./src/plugins/translators/TranslatedSingleValue.ts");
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
class DataTranslator {
|
|
5599
|
-
query;
|
|
5600
|
-
functionMap = {
|
|
5601
|
-
count: (data, option) => this.count(data, option),
|
|
5602
|
-
distinct: (data, option) => this.distinct(data, option),
|
|
5603
|
-
filter: (data, option) => this.filter(data, option),
|
|
5604
|
-
map: (data, option) => this.map(data, option),
|
|
5605
|
-
max: (data, option) => this.max(data, option),
|
|
5606
|
-
min: (data, option) => this.min(data, option),
|
|
5607
|
-
skip: (data, option) => this.skip(data, option),
|
|
5608
|
-
sort: (data, option) => this.sort(data, option),
|
|
5609
|
-
sum: (data, option) => this.sum(data, option),
|
|
5610
|
-
take: (data, option) => this.take(data, option),
|
|
5611
|
-
group: (data, option) => this.group(data, option)
|
|
5612
|
-
};
|
|
5613
|
-
constructor(query) {
|
|
5614
|
-
this.query = query;
|
|
5615
|
-
}
|
|
5616
|
-
translate(data) {
|
|
5617
|
-
this.query.options.forEach(item => {
|
|
5618
|
-
data = this.functionMap[item.name](data, item);
|
|
5619
|
-
});
|
|
5620
|
-
if (Array.isArray(data)) {
|
|
5621
|
-
return new _TranslatedArrayValue__rspack_import_0.TranslatedArrayValue(data);
|
|
5622
|
-
}
|
|
5623
|
-
if (this.query.options.has("group")) {
|
|
5624
|
-
return new _TranslatedGroupValue__rspack_import_1.TranslatedGroupValue(data);
|
|
5625
|
-
}
|
|
5626
|
-
return new _TranslatedSingleValue__rspack_import_2.TranslatedSingleValue(data);
|
|
5627
|
-
}
|
|
5628
|
-
}
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
},
|
|
5632
|
-
"./src/plugins/translators/JsonTranslator.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
5633
|
-
__webpack_require__.r(__webpack_exports__);
|
|
5634
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
5635
|
-
JsonTranslator: () => (JsonTranslator)
|
|
5636
|
-
});
|
|
5637
|
-
/* import */ var _DataTranslator__rspack_import_0 = __webpack_require__("./src/plugins/translators/DataTranslator.ts");
|
|
5638
|
-
/* import */ var _assertions__rspack_import_1 = __webpack_require__("./src/assertions/index.ts");
|
|
5639
|
-
/* import */ var _utilities__rspack_import_2 = __webpack_require__("./src/utilities/dates.ts");
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
class JsonTranslator extends _DataTranslator__rspack_import_0.DataTranslator {
|
|
5644
|
-
filter(data, option) {
|
|
5645
|
-
(0,_assertions__rspack_import_1.assertIsArray)(data);
|
|
5646
|
-
if (option.value.filter) {
|
|
5647
|
-
if (option.value.params == null) {
|
|
5648
|
-
// standard filtering
|
|
5649
|
-
return data.filter(option.value.filter);
|
|
5650
|
-
}
|
|
5651
|
-
// params filtering
|
|
5652
|
-
const selector = option.value.filter;
|
|
5653
|
-
return data.filter(w => selector([w, option.value.params]));
|
|
5654
|
-
}
|
|
5655
|
-
return data;
|
|
5656
|
-
}
|
|
5657
|
-
map(data, option) {
|
|
5658
|
-
if (Array.isArray(data) == false) {
|
|
5659
|
-
throw new Error("Can only map an array of data");
|
|
5660
|
-
}
|
|
5661
|
-
const response = new Array(data.length);
|
|
5662
|
-
for (let i = 0, length = data.length; i < length; i++) {
|
|
5663
|
-
for (let j = 0, l = option.value.fields.length; j < l; j++) {
|
|
5664
|
-
const field = option.value.fields[j];
|
|
5665
|
-
if (field.property != null) {
|
|
5666
|
-
const value = field.property.getValue(data[i]);
|
|
5667
|
-
if (value != null) {
|
|
5668
|
-
// Some types do not support deserialization (Array, Function, Computed, etc), just directly set the incoming value
|
|
5669
|
-
const resolvedValue = field.property.supportsDeserialization ? field.property.deserialize(value) : value;
|
|
5670
|
-
field.property.setValue(data[i], resolvedValue);
|
|
5671
|
-
}
|
|
5672
|
-
}
|
|
5673
|
-
}
|
|
5674
|
-
response[i] = option.value.selector(data[i]);
|
|
5675
|
-
}
|
|
5676
|
-
return response;
|
|
5755
|
+
return response;
|
|
5677
5756
|
}
|
|
5678
5757
|
group(data, option) {
|
|
5679
5758
|
if (Array.isArray(data) == false) {
|
|
@@ -5921,8 +6000,12 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
5921
6000
|
});
|
|
5922
6001
|
class TranslatedArrayValue {
|
|
5923
6002
|
value;
|
|
5924
|
-
|
|
6003
|
+
isTransformed;
|
|
6004
|
+
isEmpty;
|
|
6005
|
+
constructor(value, isTransformed) {
|
|
5925
6006
|
this.value = value;
|
|
6007
|
+
this.isEmpty = value == null || (Array.isArray(value) && value.length === 0);
|
|
6008
|
+
this.isTransformed = isTransformed;
|
|
5926
6009
|
}
|
|
5927
6010
|
forEach(callback) {
|
|
5928
6011
|
const data = this.value;
|
|
@@ -5945,8 +6028,12 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
5945
6028
|
});
|
|
5946
6029
|
class TranslatedGroupValue {
|
|
5947
6030
|
value;
|
|
5948
|
-
|
|
6031
|
+
isTransformed;
|
|
6032
|
+
isEmpty;
|
|
6033
|
+
constructor(value, isTransformed) {
|
|
5949
6034
|
this.value = value;
|
|
6035
|
+
this.isEmpty = value == null;
|
|
6036
|
+
this.isTransformed = isTransformed;
|
|
5950
6037
|
}
|
|
5951
6038
|
forEach(callback) {
|
|
5952
6039
|
const group = this.value;
|
|
@@ -5974,8 +6061,12 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
5974
6061
|
});
|
|
5975
6062
|
class TranslatedSingleValue {
|
|
5976
6063
|
value;
|
|
5977
|
-
|
|
6064
|
+
isTransformed;
|
|
6065
|
+
isEmpty;
|
|
6066
|
+
constructor(value, isTransformed) {
|
|
5978
6067
|
this.value = value;
|
|
6068
|
+
this.isEmpty = value == null;
|
|
6069
|
+
this.isTransformed = isTransformed;
|
|
5979
6070
|
}
|
|
5980
6071
|
forEach(callback) {
|
|
5981
6072
|
const result = callback(this.value);
|
|
@@ -6170,6 +6261,8 @@ class PropertyInfo {
|
|
|
6170
6261
|
isOptional;
|
|
6171
6262
|
/** Whether the property is a key. */
|
|
6172
6263
|
isKey;
|
|
6264
|
+
/** Foreign key schema and property */
|
|
6265
|
+
foreignKeyDefinition;
|
|
6173
6266
|
/** Whether the property is an identity property. */
|
|
6174
6267
|
isIdentity;
|
|
6175
6268
|
/** Whether the property is readonly. */
|
|
@@ -6198,6 +6291,8 @@ class PropertyInfo {
|
|
|
6198
6291
|
innerSchema;
|
|
6199
6292
|
/** Literal values allowed for this property. */
|
|
6200
6293
|
literals;
|
|
6294
|
+
/** Tags passed from the schema */
|
|
6295
|
+
tags;
|
|
6201
6296
|
/** The parent property, if any. */
|
|
6202
6297
|
parent;
|
|
6203
6298
|
// Cached computed values for performance
|
|
@@ -6225,6 +6320,8 @@ class PropertyInfo {
|
|
|
6225
6320
|
this.isDistinct = schema.isDistict;
|
|
6226
6321
|
this.indexes = schema.indexes;
|
|
6227
6322
|
this.from = schema.fromPropertyName;
|
|
6323
|
+
this.tags = schema.tags;
|
|
6324
|
+
this.foreignKeyDefinition = schema.foreignKeyDefinition;
|
|
6228
6325
|
this.defaultValue = schema.defaultValue;
|
|
6229
6326
|
this.valueSerializer = schema.valueSerializer;
|
|
6230
6327
|
this.valueDeserializer = schema.valueDeserializer;
|
|
@@ -6244,6 +6341,7 @@ class PropertyInfo {
|
|
|
6244
6341
|
return this._levelCache;
|
|
6245
6342
|
}
|
|
6246
6343
|
let level = 0;
|
|
6344
|
+
// oxlint-disable-next-line no-this-alias
|
|
6247
6345
|
let current = this;
|
|
6248
6346
|
while (current) {
|
|
6249
6347
|
if (current.parent == null) {
|
|
@@ -6267,6 +6365,7 @@ class PropertyInfo {
|
|
|
6267
6365
|
return this._propertyChainCache;
|
|
6268
6366
|
}
|
|
6269
6367
|
const chain = [];
|
|
6368
|
+
// oxlint-disable-next-line no-this-alias
|
|
6270
6369
|
let current = this;
|
|
6271
6370
|
while (current) {
|
|
6272
6371
|
chain.unshift(current);
|
|
@@ -6484,30 +6583,34 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6484
6583
|
__webpack_require__.d(__webpack_exports__, {
|
|
6485
6584
|
SchemaDefinition: () => (SchemaDefinition)
|
|
6486
6585
|
});
|
|
6487
|
-
/* import */ var
|
|
6488
|
-
/* import */ var
|
|
6586
|
+
/* import */ var _table_SchemaFunction__rspack_import_4 = __webpack_require__("./src/schema/table/SchemaFunction.ts");
|
|
6587
|
+
/* import */ var _table_SchemaComputed__rspack_import_5 = __webpack_require__("./src/schema/table/SchemaComputed.ts");
|
|
6489
6588
|
/* import */ var _property_base_SchemaBase__rspack_import_0 = __webpack_require__("./src/schema/property/base/SchemaBase.ts");
|
|
6490
|
-
/* import */ var
|
|
6491
|
-
/* import */ var
|
|
6492
|
-
/* import */ var
|
|
6493
|
-
/* import */ var
|
|
6494
|
-
/* import */ var
|
|
6495
|
-
/* import */ var
|
|
6496
|
-
/* import */ var
|
|
6497
|
-
/* import */ var
|
|
6498
|
-
/* import */ var
|
|
6499
|
-
/* import */ var
|
|
6500
|
-
/* import */ var
|
|
6501
|
-
/* import */ var
|
|
6502
|
-
/* import */ var
|
|
6503
|
-
/* import */ var
|
|
6504
|
-
/* import */ var
|
|
6505
|
-
/* import */ var
|
|
6506
|
-
/* import */ var
|
|
6507
|
-
/* import */ var
|
|
6589
|
+
/* import */ var _PropertyInfo__rspack_import_6 = __webpack_require__("./src/schema/PropertyInfo.ts");
|
|
6590
|
+
/* import */ var _codegen__rspack_import_22 = __webpack_require__("./src/codegen/blocks.ts");
|
|
6591
|
+
/* import */ var _codegen_handlers_EnrichmentHandlerBuilder__rspack_import_7 = __webpack_require__("./src/codegen/handlers/EnrichmentHandlerBuilder.ts");
|
|
6592
|
+
/* import */ var _codegen_handlers_MergeHandlerBuilder__rspack_import_8 = __webpack_require__("./src/codegen/handlers/MergeHandlerBuilder.ts");
|
|
6593
|
+
/* import */ var _codegen_handlers_PrepareHandlerBuilder__rspack_import_9 = __webpack_require__("./src/codegen/handlers/PrepareHandlerBuilder.ts");
|
|
6594
|
+
/* import */ var _codegen_handlers_StripHandlerBuilder__rspack_import_10 = __webpack_require__("./src/codegen/handlers/StripHandlerBuilder.ts");
|
|
6595
|
+
/* import */ var _codegen_handlers_CloneHandlerBuilder__rspack_import_11 = __webpack_require__("./src/codegen/handlers/CloneHandlerBuilder.ts");
|
|
6596
|
+
/* import */ var _codegen_handlers_CompareHandlerBuilder__rspack_import_12 = __webpack_require__("./src/codegen/handlers/CompareHandlerBuilder.ts");
|
|
6597
|
+
/* import */ var _codegen_handlers_DeserializeHandlerBuilder__rspack_import_13 = __webpack_require__("./src/codegen/handlers/DeserializeHandlerBuilder.ts");
|
|
6598
|
+
/* import */ var _codegen_handlers_HashTypeHandlerBuilder__rspack_import_14 = __webpack_require__("./src/codegen/handlers/HashTypeHandlerBuilder.ts");
|
|
6599
|
+
/* import */ var _codegen_handlers_IdSelectorHandlerBuilder__rspack_import_15 = __webpack_require__("./src/codegen/handlers/IdSelectorHandlerBuilder.ts");
|
|
6600
|
+
/* import */ var _codegen_handlers_HashHandlerBuilder__rspack_import_16 = __webpack_require__("./src/codegen/handlers/HashHandlerBuilder.ts");
|
|
6601
|
+
/* import */ var _codegen_handlers_EnableChangeTrackingHandlerBuilder__rspack_import_17 = __webpack_require__("./src/codegen/handlers/EnableChangeTrackingHandlerBuilder.ts");
|
|
6602
|
+
/* import */ var _codegen_handlers_FreezeHandlerBuilder__rspack_import_18 = __webpack_require__("./src/codegen/handlers/FreezeHandlerBuilder.ts");
|
|
6603
|
+
/* import */ var _errors_SchemaError__rspack_import_25 = __webpack_require__("./src/errors/SchemaError.ts");
|
|
6604
|
+
/* import */ var _codegen_handlers_SerializeHandlerBuilder__rspack_import_19 = __webpack_require__("./src/codegen/handlers/SerializeHandlerBuilder.ts");
|
|
6605
|
+
/* import */ var _utilities__rspack_import_3 = __webpack_require__("./src/utilities/logger.ts");
|
|
6606
|
+
/* import */ var _utilities__rspack_import_23 = __webpack_require__("./src/utilities/strings.ts");
|
|
6508
6607
|
/* import */ var _types__rspack_import_1 = __webpack_require__("./src/schema/types.ts");
|
|
6509
|
-
/* import */ var
|
|
6510
|
-
/* import */ var
|
|
6608
|
+
/* import */ var _communication_broadcast__rspack_import_24 = __webpack_require__("./src/schema/communication/broadcast.ts");
|
|
6609
|
+
/* import */ var _codegen_handlers_CompareIdsHandlerBuilder__rspack_import_20 = __webpack_require__("./src/codegen/handlers/CompareIdsHandlerBuilder.ts");
|
|
6610
|
+
/* import */ var _utils_standardJsonSchema__rspack_import_2 = __webpack_require__("./src/schema/utils/standardJsonSchema.ts");
|
|
6611
|
+
/* import */ var _codegen_handlers__rspack_import_21 = __webpack_require__("./src/codegen/handlers/SetHandlerBuilder.ts");
|
|
6612
|
+
|
|
6613
|
+
|
|
6511
6614
|
|
|
6512
6615
|
|
|
6513
6616
|
|
|
@@ -6608,13 +6711,45 @@ class SchemaDefinition extends _property_base_SchemaBase__rspack_import_0.Schema
|
|
|
6608
6711
|
this.isNullable = false;
|
|
6609
6712
|
this.isOptional = false;
|
|
6610
6713
|
}
|
|
6714
|
+
/**
|
|
6715
|
+
* Creates a SchemaDefinition from a JSON string containing a JSON Schema.
|
|
6716
|
+
* Parses the JSON string, rehydrates the schema structure, and compiles it.
|
|
6717
|
+
*
|
|
6718
|
+
* @param jsonString - The JSON string containing the JSON Schema (typically from `schema['~standard'].jsonSchema.input()` or `output()`)
|
|
6719
|
+
* @param collectionName - Optional collection name override (if not present in JSON Schema metadata)
|
|
6720
|
+
* @returns A compiled schema ready to use
|
|
6721
|
+
* @throws Error if the JSON string is invalid or doesn't contain a valid JSON Schema
|
|
6722
|
+
*
|
|
6723
|
+
* @example
|
|
6724
|
+
* ```typescript
|
|
6725
|
+
* // Serialize a schema to JSON
|
|
6726
|
+
* const jsonSchema = mySchema['~standard'].jsonSchema.input({ target: 'draft-2020-12' });
|
|
6727
|
+
* const jsonString = JSON.stringify(jsonSchema);
|
|
6728
|
+
*
|
|
6729
|
+
* // Rehydrate from JSON string
|
|
6730
|
+
* const rehydratedSchema = SchemaDefinition.fromJson(jsonString);
|
|
6731
|
+
* // Schema is already compiled and ready to use
|
|
6732
|
+
* ```
|
|
6733
|
+
*/
|
|
6734
|
+
static fromJson(jsonString, collectionName) {
|
|
6735
|
+
const schemaDefinition = (0,_utils_standardJsonSchema__rspack_import_2.rehydrateSchemaFromJsonString)(jsonString, collectionName);
|
|
6736
|
+
return schemaDefinition.compile();
|
|
6737
|
+
}
|
|
6738
|
+
/**
|
|
6739
|
+
* Standard JSON Schema V1 implementation.
|
|
6740
|
+
* Provides JSON Schema conversion for Routier schemas.
|
|
6741
|
+
*/
|
|
6742
|
+
get '~standard'() {
|
|
6743
|
+
const schema = this.compile();
|
|
6744
|
+
return (0,_utils_standardJsonSchema__rspack_import_2.createStandardJsonSchemaProps)(schema);
|
|
6745
|
+
}
|
|
6611
6746
|
createReturnFunction(builder) {
|
|
6612
6747
|
const body = builder.toString();
|
|
6613
6748
|
try {
|
|
6614
6749
|
return Function(`return ${body}`);
|
|
6615
6750
|
}
|
|
6616
6751
|
catch (e) {
|
|
6617
|
-
|
|
6752
|
+
_utilities__rspack_import_3.logger.error(`Error compiling schema function. Function Body: ${body}`);
|
|
6618
6753
|
throw e;
|
|
6619
6754
|
}
|
|
6620
6755
|
}
|
|
@@ -6624,14 +6759,14 @@ class SchemaDefinition extends _property_base_SchemaBase__rspack_import_0.Schema
|
|
|
6624
6759
|
return Function(...fnArgs, body);
|
|
6625
6760
|
}
|
|
6626
6761
|
catch (e) {
|
|
6627
|
-
|
|
6762
|
+
_utilities__rspack_import_3.logger.error(`Error compiling schema function. Function Body: ${body}`);
|
|
6628
6763
|
throw e;
|
|
6629
6764
|
}
|
|
6630
6765
|
}
|
|
6631
6766
|
modify(builder) {
|
|
6632
6767
|
const b = {
|
|
6633
|
-
function: (fn, injected) => new
|
|
6634
|
-
computed: (fn, injected) => new
|
|
6768
|
+
function: (fn, injected) => new _table_SchemaFunction__rspack_import_4.SchemaFunction(fn, injected),
|
|
6769
|
+
computed: (fn, injected) => new _table_SchemaComputed__rspack_import_5.SchemaComputed(fn, injected)
|
|
6635
6770
|
};
|
|
6636
6771
|
const r = builder(b);
|
|
6637
6772
|
return new SchemaDefinition(this.collectionName, { ...this.instance, ...r });
|
|
@@ -6659,7 +6794,7 @@ class SchemaDefinition extends _property_base_SchemaBase__rspack_import_0.Schema
|
|
|
6659
6794
|
? null
|
|
6660
6795
|
: item.parents[item.parents.length - 1].propertyInfo;
|
|
6661
6796
|
if (propertyInstance.type === _types__rspack_import_1.SchemaTypes.Object) {
|
|
6662
|
-
const propertyInfo = new
|
|
6797
|
+
const propertyInfo = new _PropertyInfo__rspack_import_6.PropertyInfo(propertyInstance, key, previousParent);
|
|
6663
6798
|
explore.push({
|
|
6664
6799
|
path: [item.path, key].filter((w) => w != null).join("."),
|
|
6665
6800
|
instance: propertyInstance.instance,
|
|
@@ -6676,7 +6811,7 @@ class SchemaDefinition extends _property_base_SchemaBase__rspack_import_0.Schema
|
|
|
6676
6811
|
previousParent.children.push(propertyInfo);
|
|
6677
6812
|
continue;
|
|
6678
6813
|
}
|
|
6679
|
-
const childPrimitivePropertyInfo = new
|
|
6814
|
+
const childPrimitivePropertyInfo = new _PropertyInfo__rspack_import_6.PropertyInfo(item.instance[key], key, previousParent);
|
|
6680
6815
|
if (previousParent === null) {
|
|
6681
6816
|
properties.push(childPrimitivePropertyInfo);
|
|
6682
6817
|
continue;
|
|
@@ -6695,25 +6830,25 @@ class SchemaDefinition extends _property_base_SchemaBase__rspack_import_0.Schema
|
|
|
6695
6830
|
recursiveCallback(prop);
|
|
6696
6831
|
}
|
|
6697
6832
|
}
|
|
6698
|
-
compile() {
|
|
6833
|
+
compile(metadata) {
|
|
6699
6834
|
try {
|
|
6700
|
-
const schema = this;
|
|
6701
6835
|
const properties = [];
|
|
6702
6836
|
const propertyMap = new Map();
|
|
6703
|
-
const enrichmentHandlerBuilder = new
|
|
6704
|
-
const mergeHandlerFactory = new
|
|
6705
|
-
const prepareHandlerBuilder = new
|
|
6706
|
-
const stripHandlerBuilder = new
|
|
6707
|
-
const cloneHandlerBuilder = new
|
|
6708
|
-
const compareHandlerBuilder = new
|
|
6709
|
-
const deserializeHandlerBuilder = new
|
|
6710
|
-
const hashTypeHandlerBuilder = new
|
|
6711
|
-
const idSelectorHandlerBuilder = new
|
|
6712
|
-
const hashHandlerBuilder = new
|
|
6713
|
-
const enableChangeTrackingHandlerBuilder = new
|
|
6714
|
-
const freezeHandlerBuilder = new
|
|
6715
|
-
const serializeHandlerBuilder = new
|
|
6716
|
-
const compareIdsHandlerBuilder = new
|
|
6837
|
+
const enrichmentHandlerBuilder = new _codegen_handlers_EnrichmentHandlerBuilder__rspack_import_7.EnrichmentHandlerBuilder();
|
|
6838
|
+
const mergeHandlerFactory = new _codegen_handlers_MergeHandlerBuilder__rspack_import_8.MergeHandlerBuilder();
|
|
6839
|
+
const prepareHandlerBuilder = new _codegen_handlers_PrepareHandlerBuilder__rspack_import_9.PrepareHandlerBuilder();
|
|
6840
|
+
const stripHandlerBuilder = new _codegen_handlers_StripHandlerBuilder__rspack_import_10.StripHandlerBuilder();
|
|
6841
|
+
const cloneHandlerBuilder = new _codegen_handlers_CloneHandlerBuilder__rspack_import_11.CloneHandlerBuilder();
|
|
6842
|
+
const compareHandlerBuilder = new _codegen_handlers_CompareHandlerBuilder__rspack_import_12.CompareHandlerBuilder();
|
|
6843
|
+
const deserializeHandlerBuilder = new _codegen_handlers_DeserializeHandlerBuilder__rspack_import_13.DeserializeHandlerBuilder();
|
|
6844
|
+
const hashTypeHandlerBuilder = new _codegen_handlers_HashTypeHandlerBuilder__rspack_import_14.HashTypeHandlerBuilder();
|
|
6845
|
+
const idSelectorHandlerBuilder = new _codegen_handlers_IdSelectorHandlerBuilder__rspack_import_15.IdSelectorHandlerBuilder();
|
|
6846
|
+
const hashHandlerBuilder = new _codegen_handlers_HashHandlerBuilder__rspack_import_16.HashHandlerBuilder();
|
|
6847
|
+
const enableChangeTrackingHandlerBuilder = new _codegen_handlers_EnableChangeTrackingHandlerBuilder__rspack_import_17.EnableChangeTrackingHandlerBuilder();
|
|
6848
|
+
const freezeHandlerBuilder = new _codegen_handlers_FreezeHandlerBuilder__rspack_import_18.FreezeHandlerBuilder();
|
|
6849
|
+
const serializeHandlerBuilder = new _codegen_handlers_SerializeHandlerBuilder__rspack_import_19.SerializeHandlerBuilder();
|
|
6850
|
+
const compareIdsHandlerBuilder = new _codegen_handlers_CompareIdsHandlerBuilder__rspack_import_20.CompareIdsHandlerBuilder();
|
|
6851
|
+
const setHandlerBuilder = new _codegen_handlers__rspack_import_21.SetHandlerBuilder();
|
|
6717
6852
|
const enricher = enrichmentHandlerBuilder.build();
|
|
6718
6853
|
const merge = mergeHandlerFactory.build();
|
|
6719
6854
|
const prepare = prepareHandlerBuilder.build();
|
|
@@ -6728,15 +6863,16 @@ class SchemaDefinition extends _property_base_SchemaBase__rspack_import_0.Schema
|
|
|
6728
6863
|
const freezeHandler = freezeHandlerBuilder.build();
|
|
6729
6864
|
const serializeHandler = serializeHandlerBuilder.build();
|
|
6730
6865
|
const compareIdsHandler = compareIdsHandlerBuilder.build();
|
|
6731
|
-
const
|
|
6866
|
+
const setHandlerHanlder = setHandlerBuilder.build();
|
|
6867
|
+
const changeTrackingCodeBuilder = new _codegen__rspack_import_22.CodeBuilder();
|
|
6732
6868
|
changeTrackingCodeBuilder.raw(`${createChangeTracker.toString()}`);
|
|
6733
6869
|
changeTrackingCodeBuilder.slot("declarations").variable("enableChangeTracking").value('createChangeTracker()');
|
|
6734
6870
|
changeTrackingCodeBuilder.slot("assignment");
|
|
6735
6871
|
changeTrackingCodeBuilder.slot("return").raw('\treturn enableChangeTracking(entity);');
|
|
6736
|
-
const freezeCodeBuilder = new
|
|
6872
|
+
const freezeCodeBuilder = new _codegen__rspack_import_22.CodeBuilder();
|
|
6737
6873
|
freezeCodeBuilder.slot("assignment");
|
|
6738
6874
|
freezeCodeBuilder.slot("return").raw('\treturn Object.freeze(entity);');
|
|
6739
|
-
const enricherCodeBuilder = new
|
|
6875
|
+
const enricherCodeBuilder = new _codegen__rspack_import_22.CodeBuilder();
|
|
6740
6876
|
const enricherFunctionRoot = enricherCodeBuilder.factory("factory", { name: "factory" }).parameters({ name: "collectionName", value: this.collectionName });
|
|
6741
6877
|
enricherFunctionRoot.slot("changeTracker").raw(`${createChangeTracker.toString()}`);
|
|
6742
6878
|
enricherFunctionRoot.slot("changeTrackerFunction").raw(`\tconst changeTracker = createChangeTracker();`);
|
|
@@ -6751,13 +6887,16 @@ class SchemaDefinition extends _property_base_SchemaBase__rspack_import_0.Schema
|
|
|
6751
6887
|
enricherFunctionBody.slot("ifs");
|
|
6752
6888
|
enricherFunctionBody.slot("tracking").if('changeTrackingType === "immutable"', { name: "freeze" });
|
|
6753
6889
|
enricherFunctionBody.slot("return").raw('\treturn enableChangeTracking(enriched);');
|
|
6754
|
-
const preprocessCodeBuilder = new
|
|
6890
|
+
const preprocessCodeBuilder = new _codegen__rspack_import_22.CodeBuilder();
|
|
6755
6891
|
preprocessCodeBuilder.slot("main");
|
|
6756
6892
|
preprocessCodeBuilder.slot("return").raw(` return result;`);
|
|
6757
|
-
const postprocessCodeBuilder = new
|
|
6893
|
+
const postprocessCodeBuilder = new _codegen__rspack_import_22.CodeBuilder();
|
|
6758
6894
|
postprocessCodeBuilder.slot("main");
|
|
6759
6895
|
postprocessCodeBuilder.slot("return").raw(` return result;`);
|
|
6760
|
-
const
|
|
6896
|
+
const setCodeBuilder = new _codegen__rspack_import_22.CodeBuilder();
|
|
6897
|
+
setCodeBuilder.slot("assignments");
|
|
6898
|
+
setCodeBuilder.slot("ifs");
|
|
6899
|
+
const mergeCodeBuilder = new _codegen__rspack_import_22.CodeBuilder();
|
|
6761
6900
|
const mergeFunctionRoot = mergeCodeBuilder.factory("factory", { name: "factory" }).parameters({ name: "collectionName", value: this.collectionName });
|
|
6762
6901
|
const mergeFunctionBody = mergeFunctionRoot.function(undefined, { name: "function" }).parameters("destination", "source").return();
|
|
6763
6902
|
const pauseFunctionBody = mergeFunctionBody.function("pause")
|
|
@@ -6776,43 +6915,43 @@ class SchemaDefinition extends _property_base_SchemaBase__rspack_import_0.Schema
|
|
|
6776
6915
|
unpause();
|
|
6777
6916
|
|
|
6778
6917
|
return destination;`);
|
|
6779
|
-
const prepareCodeBuilder = new
|
|
6918
|
+
const prepareCodeBuilder = new _codegen__rspack_import_22.CodeBuilder();
|
|
6780
6919
|
prepareCodeBuilder.slot("result");
|
|
6781
6920
|
prepareCodeBuilder.slot("assignments");
|
|
6782
6921
|
prepareCodeBuilder.slot("return").raw(` return result;`);
|
|
6783
|
-
const stripCodeBuilder = new
|
|
6922
|
+
const stripCodeBuilder = new _codegen__rspack_import_22.CodeBuilder();
|
|
6784
6923
|
stripCodeBuilder.slot("result");
|
|
6785
6924
|
stripCodeBuilder.slot("return").raw(` return result;`);
|
|
6786
|
-
const cloneCodeBuilder = new
|
|
6925
|
+
const cloneCodeBuilder = new _codegen__rspack_import_22.CodeBuilder();
|
|
6787
6926
|
cloneCodeBuilder.slot("result").raw("const result = {};");
|
|
6788
6927
|
;
|
|
6789
6928
|
cloneCodeBuilder.slot("assignments");
|
|
6790
6929
|
cloneCodeBuilder.slot("if");
|
|
6791
6930
|
cloneCodeBuilder.slot("return").raw(` return result;`);
|
|
6792
|
-
const compareCodeBuilder = new
|
|
6931
|
+
const compareCodeBuilder = new _codegen__rspack_import_22.CodeBuilder();
|
|
6793
6932
|
compareCodeBuilder.slot("result");
|
|
6794
6933
|
compareCodeBuilder.slot("return").raw(` return result;`);
|
|
6795
|
-
const compareIdsCodeBuilder = new
|
|
6934
|
+
const compareIdsCodeBuilder = new _codegen__rspack_import_22.CodeBuilder();
|
|
6796
6935
|
compareIdsCodeBuilder.slot("ifs");
|
|
6797
6936
|
compareIdsCodeBuilder.slot("return").raw(` return true;`);
|
|
6798
|
-
const deserializeCodeBuilder = new
|
|
6937
|
+
const deserializeCodeBuilder = new _codegen__rspack_import_22.CodeBuilder();
|
|
6799
6938
|
deserializeCodeBuilder.slot("functions");
|
|
6800
6939
|
deserializeCodeBuilder.slot("result");
|
|
6801
6940
|
deserializeCodeBuilder.slot("if");
|
|
6802
6941
|
deserializeCodeBuilder.slot("return").raw(` return entity;`);
|
|
6803
|
-
const serializeCodeBuilder = new
|
|
6942
|
+
const serializeCodeBuilder = new _codegen__rspack_import_22.CodeBuilder();
|
|
6804
6943
|
serializeCodeBuilder.slot("result").raw("const result = {};");
|
|
6805
6944
|
serializeCodeBuilder.slot("assignments");
|
|
6806
6945
|
serializeCodeBuilder.slot("functions");
|
|
6807
6946
|
serializeCodeBuilder.slot("if");
|
|
6808
6947
|
serializeCodeBuilder.slot("return").raw(` return result;`);
|
|
6809
|
-
const idSelectorCodeBuilder = new
|
|
6948
|
+
const idSelectorCodeBuilder = new _codegen__rspack_import_22.CodeBuilder();
|
|
6810
6949
|
idSelectorCodeBuilder.slot("result");
|
|
6811
6950
|
idSelectorCodeBuilder.slot("return").raw(` return result;`);
|
|
6812
|
-
const hashTypeCodeBuilder = new
|
|
6951
|
+
const hashTypeCodeBuilder = new _codegen__rspack_import_22.CodeBuilder();
|
|
6813
6952
|
hashTypeCodeBuilder.slot("ifs");
|
|
6814
6953
|
hashTypeCodeBuilder.slot("return").raw(` return "Ids";`);
|
|
6815
|
-
const hashCodeBuilder = new
|
|
6954
|
+
const hashCodeBuilder = new _codegen__rspack_import_22.CodeBuilder();
|
|
6816
6955
|
hashCodeBuilder.slot("functions").raw(`
|
|
6817
6956
|
function stringifyDate(d) {
|
|
6818
6957
|
|
|
@@ -6841,7 +6980,7 @@ class SchemaDefinition extends _property_base_SchemaBase__rspack_import_0.Schema
|
|
|
6841
6980
|
let hashType = _types__rspack_import_1.HashType.Ids;
|
|
6842
6981
|
let hasIdentities = false;
|
|
6843
6982
|
let hasIdentityKeys = false;
|
|
6844
|
-
this._iterate(
|
|
6983
|
+
this._iterate(this, (property) => {
|
|
6845
6984
|
properties.push(property);
|
|
6846
6985
|
propertyMap.set(property.id, property);
|
|
6847
6986
|
allPropertyNamesAndPaths.push(property.getSelectrorPath({ parent: "entity" }));
|
|
@@ -6868,6 +7007,7 @@ class SchemaDefinition extends _property_base_SchemaBase__rspack_import_0.Schema
|
|
|
6868
7007
|
enableChangeTrackingHandler.handle(property, changeTrackingCodeBuilder);
|
|
6869
7008
|
freezeHandler.handle(property, freezeCodeBuilder);
|
|
6870
7009
|
compareIdsHandler.handle(property, compareIdsCodeBuilder);
|
|
7010
|
+
setHandlerHanlder.handle(property, setCodeBuilder);
|
|
6871
7011
|
});
|
|
6872
7012
|
if (idProperties.length === 0) {
|
|
6873
7013
|
throw new Error(`Schema must have a key. Use .key() to mark a property as a key. Collection Name: ${this.collectionName}`);
|
|
@@ -6880,7 +7020,7 @@ class SchemaDefinition extends _property_base_SchemaBase__rspack_import_0.Schema
|
|
|
6880
7020
|
enricherFunctionBody.get("append").insert(deserializeCodeBuilder.get("functions"));
|
|
6881
7021
|
enricherFunctionBody.get("append").insert(deserializeCodeBuilder.get("result"));
|
|
6882
7022
|
enricherFunctionBody.get("append").insert(deserializeCodeBuilder.get("if"));
|
|
6883
|
-
enricherFunctionRoot.replace("function", new
|
|
7023
|
+
enricherFunctionRoot.replace("function", new _codegen__rspack_import_22.FunctionBuilder(undefined).parameters("unserialized", "changeTrackingType").return());
|
|
6884
7024
|
const postProcessGenerator = this.createReturnFunction(enricherCodeBuilder);
|
|
6885
7025
|
const postProcessParams = enricherFunctionRoot.getParameters();
|
|
6886
7026
|
// Combine prepare and serialize
|
|
@@ -6902,6 +7042,7 @@ class SchemaDefinition extends _property_base_SchemaBase__rspack_import_0.Schema
|
|
|
6902
7042
|
const freezeFunction = this.createFunction(freezeCodeBuilder, "entity");
|
|
6903
7043
|
const compareIdsFunction = this.createFunction(compareIdsCodeBuilder, "a", "b");
|
|
6904
7044
|
const preprocessFunction = this.createFunction(preprocessCodeBuilder, "entity");
|
|
7045
|
+
const setFunction = this.createFunction(setCodeBuilder, "destination", "source");
|
|
6905
7046
|
const enricherFactoryFunction = enrichGenerator();
|
|
6906
7047
|
const postProcessFactoryFunction = postProcessGenerator();
|
|
6907
7048
|
const mergeFactoryFunction = mergeGenerator();
|
|
@@ -6916,7 +7057,7 @@ class SchemaDefinition extends _property_base_SchemaBase__rspack_import_0.Schema
|
|
|
6916
7057
|
return getIdsFunction(entity)[0];
|
|
6917
7058
|
};
|
|
6918
7059
|
const getProperty = (id) => propertyMap.get(id);
|
|
6919
|
-
const id = (0,
|
|
7060
|
+
const id = (0,_utilities__rspack_import_23.hash)([...allPropertyNamesAndPaths, this.collectionName].join(","));
|
|
6920
7061
|
// memoize this by the validProperties
|
|
6921
7062
|
// TODO: See if we can generate a function to do this and eliminate loops
|
|
6922
7063
|
const deserializePartial = (item, properties) => {
|
|
@@ -6934,6 +7075,7 @@ class SchemaDefinition extends _property_base_SchemaBase__rspack_import_0.Schema
|
|
|
6934
7075
|
const result = {
|
|
6935
7076
|
preprocess: preprocessFunction,
|
|
6936
7077
|
postprocess: postProcessFunction,
|
|
7078
|
+
set: setFunction,
|
|
6937
7079
|
getId,
|
|
6938
7080
|
getProperty,
|
|
6939
7081
|
properties,
|
|
@@ -7010,13 +7152,22 @@ class SchemaDefinition extends _property_base_SchemaBase__rspack_import_0.Schema
|
|
|
7010
7152
|
return indexes;
|
|
7011
7153
|
}
|
|
7012
7154
|
};
|
|
7013
|
-
|
|
7014
|
-
|
|
7155
|
+
if (metadata != null) {
|
|
7156
|
+
const compiledSchemaWithMetadata = {
|
|
7157
|
+
...result,
|
|
7158
|
+
createSubscription: (signal) => new _communication_broadcast__rspack_import_24.SchemaSubscription(result, signal),
|
|
7159
|
+
metadata
|
|
7160
|
+
};
|
|
7161
|
+
return compiledSchemaWithMetadata;
|
|
7162
|
+
}
|
|
7163
|
+
const compiledSchema = {
|
|
7164
|
+
createSubscription: (signal) => new _communication_broadcast__rspack_import_24.SchemaSubscription(result, signal),
|
|
7015
7165
|
...result
|
|
7016
7166
|
};
|
|
7167
|
+
return compiledSchema;
|
|
7017
7168
|
}
|
|
7018
7169
|
catch (e) {
|
|
7019
|
-
throw new
|
|
7170
|
+
throw new _errors_SchemaError__rspack_import_25.SchemaError(e, `Error compiling schema for collection: ${this.collectionName}`);
|
|
7020
7171
|
}
|
|
7021
7172
|
}
|
|
7022
7173
|
}
|
|
@@ -7049,7 +7200,7 @@ const s = {
|
|
|
7049
7200
|
date: () => new _property_types_SchemaDate__rspack_import_3.SchemaDate(),
|
|
7050
7201
|
array: (schema) => new _property_types_SchemaArray__rspack_import_4.SchemaArray(schema),
|
|
7051
7202
|
object: (schema) => new _property_types_SchemaObject__rspack_import_5.SchemaObject(schema),
|
|
7052
|
-
define: (collectionName, schema) => new _SchemaDefinition__rspack_import_6.SchemaDefinition(collectionName, schema)
|
|
7203
|
+
define: (collectionName, schema) => new _SchemaDefinition__rspack_import_6.SchemaDefinition(collectionName, schema),
|
|
7053
7204
|
};
|
|
7054
7205
|
|
|
7055
7206
|
|
|
@@ -7138,10 +7289,10 @@ class SchemaSubscription {
|
|
|
7138
7289
|
const regisry = getChannelRegistry(this.schema.id);
|
|
7139
7290
|
// cannot send raw data, needs to be preprocessed
|
|
7140
7291
|
const preprocessedChanges = {
|
|
7141
|
-
adds:
|
|
7142
|
-
removals:
|
|
7143
|
-
unknown:
|
|
7144
|
-
updates:
|
|
7292
|
+
adds: Array.from({ length: changes.adds.length }),
|
|
7293
|
+
removals: Array.from({ length: changes.removals.length }),
|
|
7294
|
+
unknown: Array.from({ length: changes.unknown.length }),
|
|
7295
|
+
updates: Array.from({ length: changes.updates.length }),
|
|
7145
7296
|
};
|
|
7146
7297
|
for (let i = 0, length = changes.adds.length; i < length; i++) {
|
|
7147
7298
|
preprocessedChanges.adds[i] = this.schema.preprocess(changes.adds[i]);
|
|
@@ -7174,10 +7325,10 @@ class SchemaSubscription {
|
|
|
7174
7325
|
}
|
|
7175
7326
|
// Changes were preprocessed before they were sent, need to postprocess them
|
|
7176
7327
|
const postProcessedChanges = {
|
|
7177
|
-
adds:
|
|
7178
|
-
removals:
|
|
7179
|
-
unknown:
|
|
7180
|
-
updates:
|
|
7328
|
+
adds: Array.from({ length: data.adds.length }),
|
|
7329
|
+
removals: Array.from({ length: data.removals.length }),
|
|
7330
|
+
unknown: Array.from({ length: data.unknown.length }),
|
|
7331
|
+
updates: Array.from({ length: data.updates.length }),
|
|
7181
7332
|
};
|
|
7182
7333
|
for (let i = 0, length = data.adds.length; i < length; i++) {
|
|
7183
7334
|
postProcessedChanges.adds[i] = this.schema.preprocess(data.adds[i]);
|
|
@@ -7217,8 +7368,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
7217
7368
|
SchemaComputed: () => (/* reexport safe */ _table__rspack_import_1.SchemaComputed),
|
|
7218
7369
|
SchemaDate: () => (/* reexport safe */ _property_types__rspack_import_4.SchemaDate),
|
|
7219
7370
|
SchemaDefault: () => (/* reexport safe */ _property_modifiers__rspack_import_3.SchemaDefault),
|
|
7371
|
+
SchemaDefinition: () => (/* reexport safe */ _SchemaDefinition__rspack_import_8.SchemaDefinition),
|
|
7220
7372
|
SchemaDeserialize: () => (/* reexport safe */ _property_modifiers__rspack_import_3.SchemaDeserialize),
|
|
7221
7373
|
SchemaDistinct: () => (/* reexport safe */ _property_modifiers__rspack_import_3.SchemaDistinct),
|
|
7374
|
+
SchemaForeignKey: () => (/* reexport safe */ _property_modifiers__rspack_import_3.SchemaForeignKey),
|
|
7222
7375
|
SchemaFrom: () => (/* reexport safe */ _property_modifiers__rspack_import_3.SchemaFrom),
|
|
7223
7376
|
SchemaFunction: () => (/* reexport safe */ _table__rspack_import_1.SchemaFunction),
|
|
7224
7377
|
SchemaIdentity: () => (/* reexport safe */ _property_modifiers__rspack_import_3.SchemaIdentity),
|
|
@@ -7231,8 +7384,15 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
7231
7384
|
SchemaReadonly: () => (/* reexport safe */ _property_modifiers__rspack_import_3.SchemaReadonly),
|
|
7232
7385
|
SchemaSerialize: () => (/* reexport safe */ _property_modifiers__rspack_import_3.SchemaSerialize),
|
|
7233
7386
|
SchemaString: () => (/* reexport safe */ _property_types__rspack_import_4.SchemaString),
|
|
7387
|
+
SchemaTag: () => (/* reexport safe */ _property_modifiers__rspack_import_3.SchemaTag),
|
|
7234
7388
|
SchemaTracked: () => (/* reexport safe */ _property_modifiers__rspack_import_3.SchemaTracked),
|
|
7235
7389
|
SchemaTypes: () => (/* reexport safe */ _types__rspack_import_6.SchemaTypes),
|
|
7390
|
+
compiledSchemaToJsonSchema: () => (/* reexport safe */ _utils_standardJsonSchema__rspack_import_7.compiledSchemaToJsonSchema),
|
|
7391
|
+
createStandardJsonSchemaProps: () => (/* reexport safe */ _utils_standardJsonSchema__rspack_import_7.createStandardJsonSchemaProps),
|
|
7392
|
+
extractTypeInfo: () => (/* reexport safe */ _utils_standardJsonSchema__rspack_import_7.extractTypeInfo),
|
|
7393
|
+
propertyInfoToJsonSchema: () => (/* reexport safe */ _utils_standardJsonSchema__rspack_import_7.propertyInfoToJsonSchema),
|
|
7394
|
+
rehydrateSchemaFromJsonSchema: () => (/* reexport safe */ _utils_standardJsonSchema__rspack_import_7.rehydrateSchemaFromJsonSchema),
|
|
7395
|
+
rehydrateSchemaFromJsonString: () => (/* reexport safe */ _utils_standardJsonSchema__rspack_import_7.rehydrateSchemaFromJsonString),
|
|
7236
7396
|
s: () => (/* reexport safe */ _builder__rspack_import_0.s)
|
|
7237
7397
|
});
|
|
7238
7398
|
/* import */ var _builder__rspack_import_0 = __webpack_require__("./src/schema/builder.ts");
|
|
@@ -7242,6 +7402,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
7242
7402
|
/* import */ var _property_types__rspack_import_4 = __webpack_require__("./src/schema/property/types/index.ts");
|
|
7243
7403
|
/* import */ var _PropertyInfo__rspack_import_5 = __webpack_require__("./src/schema/PropertyInfo.ts");
|
|
7244
7404
|
/* import */ var _types__rspack_import_6 = __webpack_require__("./src/schema/types.ts");
|
|
7405
|
+
/* import */ var _utils_standardJsonSchema__rspack_import_7 = __webpack_require__("./src/schema/utils/standardJsonSchema.ts");
|
|
7406
|
+
/* import */ var _SchemaDefinition__rspack_import_8 = __webpack_require__("./src/schema/SchemaDefinition.ts");
|
|
7407
|
+
|
|
7408
|
+
|
|
7245
7409
|
|
|
7246
7410
|
|
|
7247
7411
|
|
|
@@ -7268,6 +7432,8 @@ class SchemaBase {
|
|
|
7268
7432
|
isDistict = false;
|
|
7269
7433
|
indexes = [];
|
|
7270
7434
|
fromPropertyName = null;
|
|
7435
|
+
foreignKeyDefinition = null;
|
|
7436
|
+
tags = [];
|
|
7271
7437
|
injected = null;
|
|
7272
7438
|
defaultValue = null;
|
|
7273
7439
|
valueSerializer = null;
|
|
@@ -7291,6 +7457,7 @@ class SchemaBase {
|
|
|
7291
7457
|
this.injected = entity.injected;
|
|
7292
7458
|
this.indexes = entity.indexes;
|
|
7293
7459
|
this.fromPropertyName = entity.fromPropertyName;
|
|
7460
|
+
this.tags = entity.tags;
|
|
7294
7461
|
}
|
|
7295
7462
|
if (literals) {
|
|
7296
7463
|
this.literals = literals;
|
|
@@ -7315,10 +7482,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7315
7482
|
__webpack_require__.d(__webpack_exports__, {
|
|
7316
7483
|
SchemaDefault: () => (SchemaDefault)
|
|
7317
7484
|
});
|
|
7485
|
+
/* import */ var _utilities__rspack_import_1 = __webpack_require__("./src/utilities/logger.ts");
|
|
7318
7486
|
/* import */ var _base_SchemaBase__rspack_import_0 = __webpack_require__("./src/schema/property/base/SchemaBase.ts");
|
|
7319
|
-
/* import */ var
|
|
7320
|
-
/* import */ var
|
|
7321
|
-
/* import */ var
|
|
7487
|
+
/* import */ var _SchemaDeserialize__rspack_import_3 = __webpack_require__("./src/schema/property/modifiers/SchemaDeserialize.ts");
|
|
7488
|
+
/* import */ var _SchemaFrom__rspack_import_4 = __webpack_require__("./src/schema/property/modifiers/SchemaFrom.ts");
|
|
7489
|
+
/* import */ var _SchemaSerialize__rspack_import_2 = __webpack_require__("./src/schema/property/modifiers/SchemaSerialize.ts");
|
|
7490
|
+
|
|
7322
7491
|
|
|
7323
7492
|
|
|
7324
7493
|
|
|
@@ -7328,18 +7497,21 @@ class SchemaDefault extends _base_SchemaBase__rspack_import_0.SchemaBase {
|
|
|
7328
7497
|
_schemaDefault = true;
|
|
7329
7498
|
constructor(defaultValue, injected, current) {
|
|
7330
7499
|
super(current);
|
|
7500
|
+
if (defaultValue == null) {
|
|
7501
|
+
_utilities__rspack_import_1.logger.warn("Do not use `.default(null)` in your schema, please use `.default(() => null)`");
|
|
7502
|
+
}
|
|
7331
7503
|
this.instance = current.instance;
|
|
7332
7504
|
this.injected = injected;
|
|
7333
7505
|
this.defaultValue = defaultValue;
|
|
7334
7506
|
}
|
|
7335
7507
|
serialize(serializer) {
|
|
7336
|
-
return new
|
|
7508
|
+
return new _SchemaSerialize__rspack_import_2.SchemaSerialize(serializer, this);
|
|
7337
7509
|
}
|
|
7338
7510
|
deserialize(deserializer) {
|
|
7339
|
-
return new
|
|
7511
|
+
return new _SchemaDeserialize__rspack_import_3.SchemaDeserialize(deserializer, this);
|
|
7340
7512
|
}
|
|
7341
7513
|
from(propertyName) {
|
|
7342
|
-
return new
|
|
7514
|
+
return new _SchemaFrom__rspack_import_4.SchemaFrom(propertyName, this);
|
|
7343
7515
|
}
|
|
7344
7516
|
}
|
|
7345
7517
|
|
|
@@ -7351,11 +7523,15 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
7351
7523
|
SchemaDeserialize: () => (SchemaDeserialize)
|
|
7352
7524
|
});
|
|
7353
7525
|
/* import */ var _base_SchemaBase__rspack_import_0 = __webpack_require__("./src/schema/property/base/SchemaBase.ts");
|
|
7526
|
+
/* import */ var _SchemaDefault__rspack_import_4 = __webpack_require__("./src/schema/property/modifiers/SchemaDefault.ts");
|
|
7354
7527
|
/* import */ var _SchemaFrom__rspack_import_2 = __webpack_require__("./src/schema/property/modifiers/SchemaFrom.ts");
|
|
7528
|
+
/* import */ var _SchemaOptional__rspack_import_3 = __webpack_require__("./src/schema/property/modifiers/SchemaOptional.ts");
|
|
7355
7529
|
/* import */ var _SchemaSerialize__rspack_import_1 = __webpack_require__("./src/schema/property/modifiers/SchemaSerialize.ts");
|
|
7356
7530
|
|
|
7357
7531
|
|
|
7358
7532
|
|
|
7533
|
+
|
|
7534
|
+
|
|
7359
7535
|
class SchemaDeserialize extends _base_SchemaBase__rspack_import_0.SchemaBase {
|
|
7360
7536
|
instance;
|
|
7361
7537
|
_schemaDeserialize = true;
|
|
@@ -7370,6 +7546,12 @@ class SchemaDeserialize extends _base_SchemaBase__rspack_import_0.SchemaBase {
|
|
|
7370
7546
|
from(propertyName) {
|
|
7371
7547
|
return new _SchemaFrom__rspack_import_2.SchemaFrom(propertyName, this);
|
|
7372
7548
|
}
|
|
7549
|
+
optional() {
|
|
7550
|
+
return new _SchemaOptional__rspack_import_3.SchemaOptional(this);
|
|
7551
|
+
}
|
|
7552
|
+
default(value, injected) {
|
|
7553
|
+
return new _SchemaDefault__rspack_import_4.SchemaDefault(value, injected, this);
|
|
7554
|
+
}
|
|
7373
7555
|
}
|
|
7374
7556
|
|
|
7375
7557
|
|
|
@@ -7392,6 +7574,48 @@ class SchemaDistinct extends _base_SchemaBase__rspack_import_0.SchemaBase {
|
|
|
7392
7574
|
}
|
|
7393
7575
|
|
|
7394
7576
|
|
|
7577
|
+
},
|
|
7578
|
+
"./src/schema/property/modifiers/SchemaForeignKey.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
7579
|
+
__webpack_require__.r(__webpack_exports__);
|
|
7580
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
7581
|
+
SchemaForeignKey: () => (SchemaForeignKey)
|
|
7582
|
+
});
|
|
7583
|
+
/* import */ var _base_SchemaBase__rspack_import_0 = __webpack_require__("./src/schema/property/base/SchemaBase.ts");
|
|
7584
|
+
/* import */ var _SchemaIdentity__rspack_import_1 = __webpack_require__("./src/schema/property/modifiers/SchemaIdentity.ts");
|
|
7585
|
+
/* import */ var _SchemaDefault__rspack_import_2 = __webpack_require__("./src/schema/property/modifiers/SchemaDefault.ts");
|
|
7586
|
+
/* import */ var _SchemaFrom__rspack_import_3 = __webpack_require__("./src/schema/property/modifiers/SchemaFrom.ts");
|
|
7587
|
+
/* import */ var _SchemaTag__rspack_import_4 = __webpack_require__("./src/schema/property/modifiers/SchemaTag.ts");
|
|
7588
|
+
|
|
7589
|
+
|
|
7590
|
+
|
|
7591
|
+
|
|
7592
|
+
|
|
7593
|
+
class SchemaForeignKey extends _base_SchemaBase__rspack_import_0.SchemaBase {
|
|
7594
|
+
instance;
|
|
7595
|
+
_schemaForeignKey = true;
|
|
7596
|
+
constructor(current, relatingSchema, property) {
|
|
7597
|
+
super(current);
|
|
7598
|
+
this.instance = current.instance;
|
|
7599
|
+
this.foreignKeyDefinition = {
|
|
7600
|
+
schema: relatingSchema,
|
|
7601
|
+
property: relatingSchema.getProperty(String(property))
|
|
7602
|
+
};
|
|
7603
|
+
}
|
|
7604
|
+
identity() {
|
|
7605
|
+
return new _SchemaIdentity__rspack_import_1.SchemaIdentity(this);
|
|
7606
|
+
}
|
|
7607
|
+
default(value, injected) {
|
|
7608
|
+
return new _SchemaDefault__rspack_import_2.SchemaDefault(value, injected, this);
|
|
7609
|
+
}
|
|
7610
|
+
from(propertyName) {
|
|
7611
|
+
return new _SchemaFrom__rspack_import_3.SchemaFrom(propertyName, this);
|
|
7612
|
+
}
|
|
7613
|
+
tag(...tags) {
|
|
7614
|
+
return new _SchemaTag__rspack_import_4.SchemaTag(tags, this);
|
|
7615
|
+
}
|
|
7616
|
+
}
|
|
7617
|
+
|
|
7618
|
+
|
|
7395
7619
|
},
|
|
7396
7620
|
"./src/schema/property/modifiers/SchemaFrom.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
7397
7621
|
__webpack_require__.r(__webpack_exports__);
|
|
@@ -7544,6 +7768,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
7544
7768
|
/* import */ var _SchemaIdentity__rspack_import_1 = __webpack_require__("./src/schema/property/modifiers/SchemaIdentity.ts");
|
|
7545
7769
|
/* import */ var _SchemaDefault__rspack_import_2 = __webpack_require__("./src/schema/property/modifiers/SchemaDefault.ts");
|
|
7546
7770
|
/* import */ var _SchemaFrom__rspack_import_3 = __webpack_require__("./src/schema/property/modifiers/SchemaFrom.ts");
|
|
7771
|
+
/* import */ var _SchemaTag__rspack_import_4 = __webpack_require__("./src/schema/property/modifiers/SchemaTag.ts");
|
|
7772
|
+
|
|
7547
7773
|
|
|
7548
7774
|
|
|
7549
7775
|
|
|
@@ -7565,6 +7791,9 @@ class SchemaKey extends _base_SchemaBase__rspack_import_0.SchemaBase {
|
|
|
7565
7791
|
from(propertyName) {
|
|
7566
7792
|
return new _SchemaFrom__rspack_import_3.SchemaFrom(propertyName, this);
|
|
7567
7793
|
}
|
|
7794
|
+
tag(...tags) {
|
|
7795
|
+
return new _SchemaTag__rspack_import_4.SchemaTag(tags, this);
|
|
7796
|
+
}
|
|
7568
7797
|
}
|
|
7569
7798
|
|
|
7570
7799
|
|
|
@@ -7575,9 +7804,13 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
7575
7804
|
SchemaNullable: () => (SchemaNullable)
|
|
7576
7805
|
});
|
|
7577
7806
|
/* import */ var _base_SchemaBase__rspack_import_0 = __webpack_require__("./src/schema/property/base/SchemaBase.ts");
|
|
7807
|
+
/* import */ var _SchemaDefault__rspack_import_2 = __webpack_require__("./src/schema/property/modifiers/SchemaDefault.ts");
|
|
7808
|
+
/* import */ var _SchemaDeserialize__rspack_import_3 = __webpack_require__("./src/schema/property/modifiers/SchemaDeserialize.ts");
|
|
7578
7809
|
/* import */ var _SchemaOptional__rspack_import_1 = __webpack_require__("./src/schema/property/modifiers/SchemaOptional.ts");
|
|
7579
7810
|
|
|
7580
7811
|
|
|
7812
|
+
|
|
7813
|
+
|
|
7581
7814
|
class SchemaNullable extends _base_SchemaBase__rspack_import_0.SchemaBase {
|
|
7582
7815
|
instance;
|
|
7583
7816
|
_schemaNullable = true;
|
|
@@ -7589,6 +7822,12 @@ class SchemaNullable extends _base_SchemaBase__rspack_import_0.SchemaBase {
|
|
|
7589
7822
|
optional() {
|
|
7590
7823
|
return new _SchemaOptional__rspack_import_1.SchemaOptional(this);
|
|
7591
7824
|
}
|
|
7825
|
+
default(value, injected) {
|
|
7826
|
+
return new _SchemaDefault__rspack_import_2.SchemaDefault(value, injected, this);
|
|
7827
|
+
}
|
|
7828
|
+
deserialize(deserializer) {
|
|
7829
|
+
return new _SchemaDeserialize__rspack_import_3.SchemaDeserialize(deserializer, this);
|
|
7830
|
+
}
|
|
7592
7831
|
}
|
|
7593
7832
|
|
|
7594
7833
|
|
|
@@ -7599,9 +7838,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
7599
7838
|
SchemaOptional: () => (SchemaOptional)
|
|
7600
7839
|
});
|
|
7601
7840
|
/* import */ var _base_SchemaBase__rspack_import_0 = __webpack_require__("./src/schema/property/base/SchemaBase.ts");
|
|
7841
|
+
/* import */ var _SchemaDeserialize__rspack_import_2 = __webpack_require__("./src/schema/property/modifiers/SchemaDeserialize.ts");
|
|
7602
7842
|
/* import */ var _SchemaNullable__rspack_import_1 = __webpack_require__("./src/schema/property/modifiers/SchemaNullable.ts");
|
|
7603
7843
|
|
|
7604
7844
|
|
|
7845
|
+
|
|
7605
7846
|
class SchemaOptional extends _base_SchemaBase__rspack_import_0.SchemaBase {
|
|
7606
7847
|
instance;
|
|
7607
7848
|
_schemaOptional = true;
|
|
@@ -7613,6 +7854,9 @@ class SchemaOptional extends _base_SchemaBase__rspack_import_0.SchemaBase {
|
|
|
7613
7854
|
nullable() {
|
|
7614
7855
|
return new _SchemaNullable__rspack_import_1.SchemaNullable(this);
|
|
7615
7856
|
}
|
|
7857
|
+
deserialize(deserializer) {
|
|
7858
|
+
return new _SchemaDeserialize__rspack_import_2.SchemaDeserialize(deserializer, this);
|
|
7859
|
+
}
|
|
7616
7860
|
}
|
|
7617
7861
|
|
|
7618
7862
|
|
|
@@ -7679,6 +7923,75 @@ class SchemaSerialize extends _base_SchemaBase__rspack_import_0.SchemaBase {
|
|
|
7679
7923
|
}
|
|
7680
7924
|
|
|
7681
7925
|
|
|
7926
|
+
},
|
|
7927
|
+
"./src/schema/property/modifiers/SchemaTag.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
7928
|
+
__webpack_require__.r(__webpack_exports__);
|
|
7929
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
7930
|
+
SchemaTag: () => (SchemaTag)
|
|
7931
|
+
});
|
|
7932
|
+
/* import */ var _base_SchemaBase__rspack_import_0 = __webpack_require__("./src/schema/property/base/SchemaBase.ts");
|
|
7933
|
+
/* import */ var _types__rspack_import_8 = __webpack_require__("./src/schema/property/types/SchemaArray.ts");
|
|
7934
|
+
/* import */ var _SchemaDefault__rspack_import_4 = __webpack_require__("./src/schema/property/modifiers/SchemaDefault.ts");
|
|
7935
|
+
/* import */ var _SchemaDeserialize__rspack_import_6 = __webpack_require__("./src/schema/property/modifiers/SchemaDeserialize.ts");
|
|
7936
|
+
/* import */ var _SchemaDistinct__rspack_import_10 = __webpack_require__("./src/schema/property/modifiers/SchemaDistinct.ts");
|
|
7937
|
+
/* import */ var _SchemaFrom__rspack_import_1 = __webpack_require__("./src/schema/property/modifiers/SchemaFrom.ts");
|
|
7938
|
+
/* import */ var _SchemaIndex__rspack_import_9 = __webpack_require__("./src/schema/property/modifiers/SchemaIndex.ts");
|
|
7939
|
+
/* import */ var _SchemaNullable__rspack_import_3 = __webpack_require__("./src/schema/property/modifiers/SchemaNullable.ts");
|
|
7940
|
+
/* import */ var _SchemaOptional__rspack_import_2 = __webpack_require__("./src/schema/property/modifiers/SchemaOptional.ts");
|
|
7941
|
+
/* import */ var _SchemaReadonly__rspack_import_5 = __webpack_require__("./src/schema/property/modifiers/SchemaReadonly.ts");
|
|
7942
|
+
/* import */ var _SchemaSerialize__rspack_import_7 = __webpack_require__("./src/schema/property/modifiers/SchemaSerialize.ts");
|
|
7943
|
+
|
|
7944
|
+
|
|
7945
|
+
|
|
7946
|
+
|
|
7947
|
+
|
|
7948
|
+
|
|
7949
|
+
|
|
7950
|
+
|
|
7951
|
+
|
|
7952
|
+
|
|
7953
|
+
|
|
7954
|
+
class SchemaTag extends _base_SchemaBase__rspack_import_0.SchemaBase {
|
|
7955
|
+
instance;
|
|
7956
|
+
_schemaTag = true;
|
|
7957
|
+
constructor(tags, current) {
|
|
7958
|
+
super(current);
|
|
7959
|
+
this.tags = tags;
|
|
7960
|
+
this.instance = current.instance;
|
|
7961
|
+
}
|
|
7962
|
+
from(propertyName) {
|
|
7963
|
+
return new _SchemaFrom__rspack_import_1.SchemaFrom(propertyName, this);
|
|
7964
|
+
}
|
|
7965
|
+
optional() {
|
|
7966
|
+
return new _SchemaOptional__rspack_import_2.SchemaOptional(this);
|
|
7967
|
+
}
|
|
7968
|
+
nullable() {
|
|
7969
|
+
return new _SchemaNullable__rspack_import_3.SchemaNullable(this);
|
|
7970
|
+
}
|
|
7971
|
+
default(value, injected) {
|
|
7972
|
+
return new _SchemaDefault__rspack_import_4.SchemaDefault(value, injected, this);
|
|
7973
|
+
}
|
|
7974
|
+
readonly() {
|
|
7975
|
+
return new _SchemaReadonly__rspack_import_5.SchemaReadonly(this);
|
|
7976
|
+
}
|
|
7977
|
+
deserialize(deserializer) {
|
|
7978
|
+
return new _SchemaDeserialize__rspack_import_6.SchemaDeserialize(deserializer, this);
|
|
7979
|
+
}
|
|
7980
|
+
serialize(serializer) {
|
|
7981
|
+
return new _SchemaSerialize__rspack_import_7.SchemaSerialize(serializer, this);
|
|
7982
|
+
}
|
|
7983
|
+
array() {
|
|
7984
|
+
return new _types__rspack_import_8.SchemaArray(this);
|
|
7985
|
+
}
|
|
7986
|
+
index(...indexes) {
|
|
7987
|
+
return new _SchemaIndex__rspack_import_9.SchemaIndex(this, ...indexes);
|
|
7988
|
+
}
|
|
7989
|
+
distinct() {
|
|
7990
|
+
return new _SchemaDistinct__rspack_import_10.SchemaDistinct(this);
|
|
7991
|
+
}
|
|
7992
|
+
}
|
|
7993
|
+
|
|
7994
|
+
|
|
7682
7995
|
},
|
|
7683
7996
|
"./src/schema/property/modifiers/SchemaTracked.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
7684
7997
|
__webpack_require__.r(__webpack_exports__);
|
|
@@ -7686,7 +7999,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
7686
7999
|
SchemaTracked: () => (SchemaTracked)
|
|
7687
8000
|
});
|
|
7688
8001
|
/* import */ var _base_SchemaBase__rspack_import_0 = __webpack_require__("./src/schema/property/base/SchemaBase.ts");
|
|
8002
|
+
/* import */ var _SchemaForeignKey__rspack_import_2 = __webpack_require__("./src/schema/property/modifiers/SchemaForeignKey.ts");
|
|
7689
8003
|
/* import */ var _SchemaKey__rspack_import_1 = __webpack_require__("./src/schema/property/modifiers/SchemaKey.ts");
|
|
8004
|
+
/* import */ var _SchemaTag__rspack_import_3 = __webpack_require__("./src/schema/property/modifiers/SchemaTag.ts");
|
|
8005
|
+
|
|
8006
|
+
|
|
7690
8007
|
|
|
7691
8008
|
|
|
7692
8009
|
class SchemaTracked extends _base_SchemaBase__rspack_import_0.SchemaBase {
|
|
@@ -7700,6 +8017,12 @@ class SchemaTracked extends _base_SchemaBase__rspack_import_0.SchemaBase {
|
|
|
7700
8017
|
key() {
|
|
7701
8018
|
return new _SchemaKey__rspack_import_1.SchemaKey(this);
|
|
7702
8019
|
}
|
|
8020
|
+
foreignKey(relatingSchema, property) {
|
|
8021
|
+
return new _SchemaForeignKey__rspack_import_2.SchemaForeignKey(this, relatingSchema, property);
|
|
8022
|
+
}
|
|
8023
|
+
tag(...tags) {
|
|
8024
|
+
return new _SchemaTag__rspack_import_3.SchemaTag(tags, this);
|
|
8025
|
+
}
|
|
7703
8026
|
}
|
|
7704
8027
|
|
|
7705
8028
|
|
|
@@ -7710,6 +8033,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
7710
8033
|
SchemaDefault: () => (/* reexport safe */ _SchemaDefault__rspack_import_0.SchemaDefault),
|
|
7711
8034
|
SchemaDeserialize: () => (/* reexport safe */ _SchemaDeserialize__rspack_import_1.SchemaDeserialize),
|
|
7712
8035
|
SchemaDistinct: () => (/* reexport safe */ _SchemaDistinct__rspack_import_2.SchemaDistinct),
|
|
8036
|
+
SchemaForeignKey: () => (/* reexport safe */ _SchemaForeignKey__rspack_import_13.SchemaForeignKey),
|
|
7713
8037
|
SchemaFrom: () => (/* reexport safe */ _SchemaFrom__rspack_import_11.SchemaFrom),
|
|
7714
8038
|
SchemaIdentity: () => (/* reexport safe */ _SchemaIdentity__rspack_import_3.SchemaIdentity),
|
|
7715
8039
|
SchemaIndex: () => (/* reexport safe */ _SchemaIndex__rspack_import_4.SchemaIndex),
|
|
@@ -7718,6 +8042,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
7718
8042
|
SchemaOptional: () => (/* reexport safe */ _SchemaOptional__rspack_import_7.SchemaOptional),
|
|
7719
8043
|
SchemaReadonly: () => (/* reexport safe */ _SchemaReadonly__rspack_import_8.SchemaReadonly),
|
|
7720
8044
|
SchemaSerialize: () => (/* reexport safe */ _SchemaSerialize__rspack_import_9.SchemaSerialize),
|
|
8045
|
+
SchemaTag: () => (/* reexport safe */ _SchemaTag__rspack_import_12.SchemaTag),
|
|
7721
8046
|
SchemaTracked: () => (/* reexport safe */ _SchemaTracked__rspack_import_10.SchemaTracked)
|
|
7722
8047
|
});
|
|
7723
8048
|
/* import */ var _SchemaDefault__rspack_import_0 = __webpack_require__("./src/schema/property/modifiers/SchemaDefault.ts");
|
|
@@ -7732,6 +8057,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
7732
8057
|
/* import */ var _SchemaSerialize__rspack_import_9 = __webpack_require__("./src/schema/property/modifiers/SchemaSerialize.ts");
|
|
7733
8058
|
/* import */ var _SchemaTracked__rspack_import_10 = __webpack_require__("./src/schema/property/modifiers/SchemaTracked.ts");
|
|
7734
8059
|
/* import */ var _SchemaFrom__rspack_import_11 = __webpack_require__("./src/schema/property/modifiers/SchemaFrom.ts");
|
|
8060
|
+
/* import */ var _SchemaTag__rspack_import_12 = __webpack_require__("./src/schema/property/modifiers/SchemaTag.ts");
|
|
8061
|
+
/* import */ var _SchemaForeignKey__rspack_import_13 = __webpack_require__("./src/schema/property/modifiers/SchemaForeignKey.ts");
|
|
8062
|
+
|
|
8063
|
+
|
|
7735
8064
|
|
|
7736
8065
|
|
|
7737
8066
|
|
|
@@ -7761,6 +8090,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
7761
8090
|
/* import */ var _modifiers_SchemaIndex__rspack_import_8 = __webpack_require__("./src/schema/property/modifiers/SchemaIndex.ts");
|
|
7762
8091
|
/* import */ var _types__rspack_import_1 = __webpack_require__("./src/schema/types.ts");
|
|
7763
8092
|
/* import */ var _modifiers_SchemaFrom__rspack_import_2 = __webpack_require__("./src/schema/property/modifiers/SchemaFrom.ts");
|
|
8093
|
+
/* import */ var _modifiers_SchemaTag__rspack_import_9 = __webpack_require__("./src/schema/property/modifiers/SchemaTag.ts");
|
|
8094
|
+
|
|
7764
8095
|
|
|
7765
8096
|
|
|
7766
8097
|
|
|
@@ -7800,6 +8131,9 @@ class SchemaArray extends _base_SchemaBase__rspack_import_0.SchemaBase {
|
|
|
7800
8131
|
index(...indexes) {
|
|
7801
8132
|
return new _modifiers_SchemaIndex__rspack_import_8.SchemaIndex(this, ...indexes);
|
|
7802
8133
|
}
|
|
8134
|
+
tag(...tags) {
|
|
8135
|
+
return new _modifiers_SchemaTag__rspack_import_9.SchemaTag(tags, this);
|
|
8136
|
+
}
|
|
7803
8137
|
}
|
|
7804
8138
|
|
|
7805
8139
|
|
|
@@ -7820,6 +8154,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
7820
8154
|
/* import */ var _modifiers_SchemaOptional__rspack_import_3 = __webpack_require__("./src/schema/property/modifiers/SchemaOptional.ts");
|
|
7821
8155
|
/* import */ var _modifiers_SchemaReadonly__rspack_import_6 = __webpack_require__("./src/schema/property/modifiers/SchemaReadonly.ts");
|
|
7822
8156
|
/* import */ var _modifiers_SchemaSerialize__rspack_import_8 = __webpack_require__("./src/schema/property/modifiers/SchemaSerialize.ts");
|
|
8157
|
+
/* import */ var _modifiers_SchemaTag__rspack_import_12 = __webpack_require__("./src/schema/property/modifiers/SchemaTag.ts");
|
|
7823
8158
|
/* import */ var _SchemaArray__rspack_import_9 = __webpack_require__("./src/schema/property/types/SchemaArray.ts");
|
|
7824
8159
|
|
|
7825
8160
|
|
|
@@ -7833,6 +8168,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
7833
8168
|
|
|
7834
8169
|
|
|
7835
8170
|
|
|
8171
|
+
|
|
7836
8172
|
class SchemaBoolean extends _base_SchemaBase__rspack_import_0.SchemaBase {
|
|
7837
8173
|
instance;
|
|
7838
8174
|
type = _types__rspack_import_1.SchemaTypes.Boolean;
|
|
@@ -7867,6 +8203,9 @@ class SchemaBoolean extends _base_SchemaBase__rspack_import_0.SchemaBase {
|
|
|
7867
8203
|
distinct() {
|
|
7868
8204
|
return new _modifiers_SchemaDistinct__rspack_import_11.SchemaDistinct(this);
|
|
7869
8205
|
}
|
|
8206
|
+
tag(...tags) {
|
|
8207
|
+
return new _modifiers_SchemaTag__rspack_import_12.SchemaTag(tags, this);
|
|
8208
|
+
}
|
|
7870
8209
|
}
|
|
7871
8210
|
|
|
7872
8211
|
|
|
@@ -7887,6 +8226,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
7887
8226
|
/* import */ var _modifiers_SchemaOptional__rspack_import_3 = __webpack_require__("./src/schema/property/modifiers/SchemaOptional.ts");
|
|
7888
8227
|
/* import */ var _modifiers_SchemaReadonly__rspack_import_6 = __webpack_require__("./src/schema/property/modifiers/SchemaReadonly.ts");
|
|
7889
8228
|
/* import */ var _modifiers_SchemaSerialize__rspack_import_8 = __webpack_require__("./src/schema/property/modifiers/SchemaSerialize.ts");
|
|
8229
|
+
/* import */ var _modifiers_SchemaTag__rspack_import_12 = __webpack_require__("./src/schema/property/modifiers/SchemaTag.ts");
|
|
7890
8230
|
/* import */ var _SchemaArray__rspack_import_9 = __webpack_require__("./src/schema/property/types/SchemaArray.ts");
|
|
7891
8231
|
|
|
7892
8232
|
|
|
@@ -7900,6 +8240,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
7900
8240
|
|
|
7901
8241
|
|
|
7902
8242
|
|
|
8243
|
+
|
|
7903
8244
|
class SchemaDate extends _base_SchemaBase__rspack_import_0.SchemaBase {
|
|
7904
8245
|
instance;
|
|
7905
8246
|
type = _types__rspack_import_1.SchemaTypes.Date;
|
|
@@ -7934,6 +8275,9 @@ class SchemaDate extends _base_SchemaBase__rspack_import_0.SchemaBase {
|
|
|
7934
8275
|
distinct() {
|
|
7935
8276
|
return new _modifiers_SchemaDistinct__rspack_import_11.SchemaDistinct(this);
|
|
7936
8277
|
}
|
|
8278
|
+
tag(...tags) {
|
|
8279
|
+
return new _modifiers_SchemaTag__rspack_import_12.SchemaTag(tags, this);
|
|
8280
|
+
}
|
|
7937
8281
|
}
|
|
7938
8282
|
|
|
7939
8283
|
|
|
@@ -7945,18 +8289,22 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
7945
8289
|
});
|
|
7946
8290
|
/* import */ var _types__rspack_import_1 = __webpack_require__("./src/schema/types.ts");
|
|
7947
8291
|
/* import */ var _base_SchemaBase__rspack_import_0 = __webpack_require__("./src/schema/property/base/SchemaBase.ts");
|
|
7948
|
-
/* import */ var
|
|
7949
|
-
/* import */ var
|
|
7950
|
-
/* import */ var
|
|
8292
|
+
/* import */ var _modifiers_SchemaDefault__rspack_import_7 = __webpack_require__("./src/schema/property/modifiers/SchemaDefault.ts");
|
|
8293
|
+
/* import */ var _modifiers_SchemaDeserialize__rspack_import_9 = __webpack_require__("./src/schema/property/modifiers/SchemaDeserialize.ts");
|
|
8294
|
+
/* import */ var _modifiers_SchemaDistinct__rspack_import_14 = __webpack_require__("./src/schema/property/modifiers/SchemaDistinct.ts");
|
|
8295
|
+
/* import */ var _modifiers_SchemaForeignKey__rspack_import_6 = __webpack_require__("./src/schema/property/modifiers/SchemaForeignKey.ts");
|
|
7951
8296
|
/* import */ var _modifiers_SchemaFrom__rspack_import_2 = __webpack_require__("./src/schema/property/modifiers/SchemaFrom.ts");
|
|
7952
|
-
/* import */ var
|
|
7953
|
-
/* import */ var
|
|
8297
|
+
/* import */ var _modifiers_SchemaIdentity__rspack_import_11 = __webpack_require__("./src/schema/property/modifiers/SchemaIdentity.ts");
|
|
8298
|
+
/* import */ var _modifiers_SchemaIndex__rspack_import_13 = __webpack_require__("./src/schema/property/modifiers/SchemaIndex.ts");
|
|
7954
8299
|
/* import */ var _modifiers_SchemaKey__rspack_import_5 = __webpack_require__("./src/schema/property/modifiers/SchemaKey.ts");
|
|
7955
8300
|
/* import */ var _modifiers_SchemaNullable__rspack_import_4 = __webpack_require__("./src/schema/property/modifiers/SchemaNullable.ts");
|
|
7956
8301
|
/* import */ var _modifiers_SchemaOptional__rspack_import_3 = __webpack_require__("./src/schema/property/modifiers/SchemaOptional.ts");
|
|
7957
|
-
/* import */ var
|
|
7958
|
-
/* import */ var
|
|
7959
|
-
/* import */ var
|
|
8302
|
+
/* import */ var _modifiers_SchemaReadonly__rspack_import_8 = __webpack_require__("./src/schema/property/modifiers/SchemaReadonly.ts");
|
|
8303
|
+
/* import */ var _modifiers_SchemaSerialize__rspack_import_10 = __webpack_require__("./src/schema/property/modifiers/SchemaSerialize.ts");
|
|
8304
|
+
/* import */ var _modifiers_SchemaTag__rspack_import_15 = __webpack_require__("./src/schema/property/modifiers/SchemaTag.ts");
|
|
8305
|
+
/* import */ var _SchemaArray__rspack_import_12 = __webpack_require__("./src/schema/property/types/SchemaArray.ts");
|
|
8306
|
+
|
|
8307
|
+
|
|
7960
8308
|
|
|
7961
8309
|
|
|
7962
8310
|
|
|
@@ -7990,29 +8338,35 @@ class SchemaNumber extends _base_SchemaBase__rspack_import_0.SchemaBase {
|
|
|
7990
8338
|
key() {
|
|
7991
8339
|
return new _modifiers_SchemaKey__rspack_import_5.SchemaKey(this);
|
|
7992
8340
|
}
|
|
8341
|
+
foreignKey(relatingSchema, property) {
|
|
8342
|
+
return new _modifiers_SchemaForeignKey__rspack_import_6.SchemaForeignKey(this, relatingSchema, property);
|
|
8343
|
+
}
|
|
7993
8344
|
default(value, injected) {
|
|
7994
|
-
return new
|
|
8345
|
+
return new _modifiers_SchemaDefault__rspack_import_7.SchemaDefault(value, injected, this);
|
|
7995
8346
|
}
|
|
7996
8347
|
readonly() {
|
|
7997
|
-
return new
|
|
8348
|
+
return new _modifiers_SchemaReadonly__rspack_import_8.SchemaReadonly(this);
|
|
7998
8349
|
}
|
|
7999
8350
|
deserialize(deserializer) {
|
|
8000
|
-
return new
|
|
8351
|
+
return new _modifiers_SchemaDeserialize__rspack_import_9.SchemaDeserialize(deserializer, this);
|
|
8001
8352
|
}
|
|
8002
8353
|
serialize(serializer) {
|
|
8003
|
-
return new
|
|
8354
|
+
return new _modifiers_SchemaSerialize__rspack_import_10.SchemaSerialize(serializer, this);
|
|
8004
8355
|
}
|
|
8005
8356
|
identity() {
|
|
8006
|
-
return new
|
|
8357
|
+
return new _modifiers_SchemaIdentity__rspack_import_11.SchemaIdentity(this);
|
|
8007
8358
|
}
|
|
8008
8359
|
array() {
|
|
8009
|
-
return new
|
|
8360
|
+
return new _SchemaArray__rspack_import_12.SchemaArray(this);
|
|
8010
8361
|
}
|
|
8011
8362
|
index(...indexes) {
|
|
8012
|
-
return new
|
|
8363
|
+
return new _modifiers_SchemaIndex__rspack_import_13.SchemaIndex(this, ...indexes);
|
|
8013
8364
|
}
|
|
8014
8365
|
distinct() {
|
|
8015
|
-
return new
|
|
8366
|
+
return new _modifiers_SchemaDistinct__rspack_import_14.SchemaDistinct(this);
|
|
8367
|
+
}
|
|
8368
|
+
tag(...tags) {
|
|
8369
|
+
return new _modifiers_SchemaTag__rspack_import_15.SchemaTag(tags, this);
|
|
8016
8370
|
}
|
|
8017
8371
|
}
|
|
8018
8372
|
|
|
@@ -8030,6 +8384,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
8030
8384
|
/* import */ var _modifiers_SchemaIdentity__rspack_import_6 = __webpack_require__("./src/schema/property/modifiers/SchemaIdentity.ts");
|
|
8031
8385
|
/* import */ var _modifiers_SchemaNullable__rspack_import_4 = __webpack_require__("./src/schema/property/modifiers/SchemaNullable.ts");
|
|
8032
8386
|
/* import */ var _modifiers_SchemaOptional__rspack_import_3 = __webpack_require__("./src/schema/property/modifiers/SchemaOptional.ts");
|
|
8387
|
+
/* import */ var _modifiers_SchemaTag__rspack_import_8 = __webpack_require__("./src/schema/property/modifiers/SchemaTag.ts");
|
|
8033
8388
|
/* import */ var _SchemaArray__rspack_import_7 = __webpack_require__("./src/schema/property/types/SchemaArray.ts");
|
|
8034
8389
|
|
|
8035
8390
|
|
|
@@ -8039,6 +8394,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
8039
8394
|
|
|
8040
8395
|
|
|
8041
8396
|
|
|
8397
|
+
|
|
8042
8398
|
class SchemaObject extends _base_SchemaBase__rspack_import_0.SchemaBase {
|
|
8043
8399
|
instance;
|
|
8044
8400
|
type = _types__rspack_import_1.SchemaTypes.Object;
|
|
@@ -8065,6 +8421,9 @@ class SchemaObject extends _base_SchemaBase__rspack_import_0.SchemaBase {
|
|
|
8065
8421
|
array() {
|
|
8066
8422
|
return new _SchemaArray__rspack_import_7.SchemaArray(this);
|
|
8067
8423
|
}
|
|
8424
|
+
tag(...tags) {
|
|
8425
|
+
return new _modifiers_SchemaTag__rspack_import_8.SchemaTag(tags, this);
|
|
8426
|
+
}
|
|
8068
8427
|
}
|
|
8069
8428
|
|
|
8070
8429
|
|
|
@@ -8076,18 +8435,22 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
8076
8435
|
});
|
|
8077
8436
|
/* import */ var _types__rspack_import_1 = __webpack_require__("./src/schema/types.ts");
|
|
8078
8437
|
/* import */ var _base_SchemaBase__rspack_import_0 = __webpack_require__("./src/schema/property/base/SchemaBase.ts");
|
|
8079
|
-
/* import */ var
|
|
8080
|
-
/* import */ var
|
|
8081
|
-
/* import */ var
|
|
8438
|
+
/* import */ var _modifiers_SchemaDefault__rspack_import_7 = __webpack_require__("./src/schema/property/modifiers/SchemaDefault.ts");
|
|
8439
|
+
/* import */ var _modifiers_SchemaDeserialize__rspack_import_9 = __webpack_require__("./src/schema/property/modifiers/SchemaDeserialize.ts");
|
|
8440
|
+
/* import */ var _modifiers_SchemaDistinct__rspack_import_14 = __webpack_require__("./src/schema/property/modifiers/SchemaDistinct.ts");
|
|
8441
|
+
/* import */ var _modifiers_SchemaForeignKey__rspack_import_6 = __webpack_require__("./src/schema/property/modifiers/SchemaForeignKey.ts");
|
|
8082
8442
|
/* import */ var _modifiers_SchemaFrom__rspack_import_2 = __webpack_require__("./src/schema/property/modifiers/SchemaFrom.ts");
|
|
8083
|
-
/* import */ var
|
|
8084
|
-
/* import */ var
|
|
8443
|
+
/* import */ var _modifiers_SchemaIdentity__rspack_import_11 = __webpack_require__("./src/schema/property/modifiers/SchemaIdentity.ts");
|
|
8444
|
+
/* import */ var _modifiers_SchemaIndex__rspack_import_13 = __webpack_require__("./src/schema/property/modifiers/SchemaIndex.ts");
|
|
8085
8445
|
/* import */ var _modifiers_SchemaKey__rspack_import_5 = __webpack_require__("./src/schema/property/modifiers/SchemaKey.ts");
|
|
8086
8446
|
/* import */ var _modifiers_SchemaNullable__rspack_import_4 = __webpack_require__("./src/schema/property/modifiers/SchemaNullable.ts");
|
|
8087
8447
|
/* import */ var _modifiers_SchemaOptional__rspack_import_3 = __webpack_require__("./src/schema/property/modifiers/SchemaOptional.ts");
|
|
8088
|
-
/* import */ var
|
|
8089
|
-
/* import */ var
|
|
8090
|
-
/* import */ var
|
|
8448
|
+
/* import */ var _modifiers_SchemaReadonly__rspack_import_8 = __webpack_require__("./src/schema/property/modifiers/SchemaReadonly.ts");
|
|
8449
|
+
/* import */ var _modifiers_SchemaSerialize__rspack_import_10 = __webpack_require__("./src/schema/property/modifiers/SchemaSerialize.ts");
|
|
8450
|
+
/* import */ var _modifiers_SchemaTag__rspack_import_15 = __webpack_require__("./src/schema/property/modifiers/SchemaTag.ts");
|
|
8451
|
+
/* import */ var _SchemaArray__rspack_import_12 = __webpack_require__("./src/schema/property/types/SchemaArray.ts");
|
|
8452
|
+
|
|
8453
|
+
|
|
8091
8454
|
|
|
8092
8455
|
|
|
8093
8456
|
|
|
@@ -8121,29 +8484,35 @@ class SchemaString extends _base_SchemaBase__rspack_import_0.SchemaBase {
|
|
|
8121
8484
|
key() {
|
|
8122
8485
|
return new _modifiers_SchemaKey__rspack_import_5.SchemaKey(this);
|
|
8123
8486
|
}
|
|
8487
|
+
foreignKey(relatingSchema, property) {
|
|
8488
|
+
return new _modifiers_SchemaForeignKey__rspack_import_6.SchemaForeignKey(this, relatingSchema, property);
|
|
8489
|
+
}
|
|
8124
8490
|
default(value, injected) {
|
|
8125
|
-
return new
|
|
8491
|
+
return new _modifiers_SchemaDefault__rspack_import_7.SchemaDefault(value, injected, this);
|
|
8126
8492
|
}
|
|
8127
8493
|
readonly() {
|
|
8128
|
-
return new
|
|
8494
|
+
return new _modifiers_SchemaReadonly__rspack_import_8.SchemaReadonly(this);
|
|
8129
8495
|
}
|
|
8130
8496
|
deserialize(deserializer) {
|
|
8131
|
-
return new
|
|
8497
|
+
return new _modifiers_SchemaDeserialize__rspack_import_9.SchemaDeserialize(deserializer, this);
|
|
8132
8498
|
}
|
|
8133
8499
|
serialize(serializer) {
|
|
8134
|
-
return new
|
|
8500
|
+
return new _modifiers_SchemaSerialize__rspack_import_10.SchemaSerialize(serializer, this);
|
|
8135
8501
|
}
|
|
8136
8502
|
identity() {
|
|
8137
|
-
return new
|
|
8503
|
+
return new _modifiers_SchemaIdentity__rspack_import_11.SchemaIdentity(this);
|
|
8138
8504
|
}
|
|
8139
8505
|
array() {
|
|
8140
|
-
return new
|
|
8506
|
+
return new _SchemaArray__rspack_import_12.SchemaArray(this);
|
|
8141
8507
|
}
|
|
8142
8508
|
index(...indexes) {
|
|
8143
|
-
return new
|
|
8509
|
+
return new _modifiers_SchemaIndex__rspack_import_13.SchemaIndex(this, ...indexes);
|
|
8144
8510
|
}
|
|
8145
8511
|
distinct() {
|
|
8146
|
-
return new
|
|
8512
|
+
return new _modifiers_SchemaDistinct__rspack_import_14.SchemaDistinct(this);
|
|
8513
|
+
}
|
|
8514
|
+
tag(...tags) {
|
|
8515
|
+
return new _modifiers_SchemaTag__rspack_import_15.SchemaTag(tags, this);
|
|
8147
8516
|
}
|
|
8148
8517
|
}
|
|
8149
8518
|
|
|
@@ -8263,6 +8632,651 @@ var HashType;
|
|
|
8263
8632
|
})(HashType || (HashType = {}));
|
|
8264
8633
|
|
|
8265
8634
|
|
|
8635
|
+
},
|
|
8636
|
+
"./src/schema/utils/standardJsonSchema.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
8637
|
+
__webpack_require__.r(__webpack_exports__);
|
|
8638
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
8639
|
+
compiledSchemaToJsonSchema: () => (compiledSchemaToJsonSchema),
|
|
8640
|
+
createStandardJsonSchemaProps: () => (createStandardJsonSchemaProps),
|
|
8641
|
+
extractTypeInfo: () => (extractTypeInfo),
|
|
8642
|
+
propertyInfoToJsonSchema: () => (propertyInfoToJsonSchema),
|
|
8643
|
+
rehydrateSchemaFromJsonSchema: () => (rehydrateSchemaFromJsonSchema),
|
|
8644
|
+
rehydrateSchemaFromJsonString: () => (rehydrateSchemaFromJsonString)
|
|
8645
|
+
});
|
|
8646
|
+
/* import */ var _PropertyInfo__rspack_import_1 = __webpack_require__("./src/schema/PropertyInfo.ts");
|
|
8647
|
+
/* import */ var _types__rspack_import_0 = __webpack_require__("./src/schema/types.ts");
|
|
8648
|
+
/* import */ var _property_types_SchemaArray__rspack_import_2 = __webpack_require__("./src/schema/property/types/SchemaArray.ts");
|
|
8649
|
+
/* import */ var _builder__rspack_import_3 = __webpack_require__("./src/schema/builder.ts");
|
|
8650
|
+
|
|
8651
|
+
|
|
8652
|
+
|
|
8653
|
+
|
|
8654
|
+
/**
|
|
8655
|
+
* Converts a primitive property with optional enum/literals
|
|
8656
|
+
*/
|
|
8657
|
+
function createPrimitiveConverter(jsonType) {
|
|
8658
|
+
return (property, _context) => {
|
|
8659
|
+
const jsonSchema = { type: jsonType };
|
|
8660
|
+
if (property.literals && property.literals.length > 0) {
|
|
8661
|
+
jsonSchema.enum = property.literals;
|
|
8662
|
+
}
|
|
8663
|
+
return jsonSchema;
|
|
8664
|
+
};
|
|
8665
|
+
}
|
|
8666
|
+
/**
|
|
8667
|
+
* Converts a Date property to JSON Schema
|
|
8668
|
+
*/
|
|
8669
|
+
const dateConverter = (_property, _context) => {
|
|
8670
|
+
return {
|
|
8671
|
+
type: 'string',
|
|
8672
|
+
format: 'date-time'
|
|
8673
|
+
};
|
|
8674
|
+
};
|
|
8675
|
+
/**
|
|
8676
|
+
* Converts an Object property to JSON Schema
|
|
8677
|
+
*/
|
|
8678
|
+
const objectConverter = (property, context) => {
|
|
8679
|
+
const jsonSchema = { type: 'object' };
|
|
8680
|
+
if (property.children && property.children.length > 0) {
|
|
8681
|
+
const properties = {};
|
|
8682
|
+
const required = [];
|
|
8683
|
+
for (const child of property.children) {
|
|
8684
|
+
// Skip computed and function properties for input schemas
|
|
8685
|
+
// Include them in output schemas as they represent derived values
|
|
8686
|
+
if (!context.useOutputType && (child.type === _types__rspack_import_0.SchemaTypes.Computed || child.type === _types__rspack_import_0.SchemaTypes.Function)) {
|
|
8687
|
+
continue;
|
|
8688
|
+
}
|
|
8689
|
+
const childSchema = context.convertProperty(child);
|
|
8690
|
+
// Skip empty schemas (e.g., computed properties that return empty for input)
|
|
8691
|
+
if (Object.keys(childSchema).length === 0) {
|
|
8692
|
+
continue;
|
|
8693
|
+
}
|
|
8694
|
+
const propertyName = child.from || child.name;
|
|
8695
|
+
properties[propertyName] = childSchema;
|
|
8696
|
+
// Add to required if not optional and not nullable
|
|
8697
|
+
// Computed/function properties are never required in JSON Schema
|
|
8698
|
+
if (!child.isOptional && !child.isNullable &&
|
|
8699
|
+
child.type !== _types__rspack_import_0.SchemaTypes.Computed && child.type !== _types__rspack_import_0.SchemaTypes.Function) {
|
|
8700
|
+
required.push(propertyName);
|
|
8701
|
+
}
|
|
8702
|
+
}
|
|
8703
|
+
if (Object.keys(properties).length > 0) {
|
|
8704
|
+
jsonSchema.properties = properties;
|
|
8705
|
+
}
|
|
8706
|
+
if (required.length > 0) {
|
|
8707
|
+
jsonSchema.required = required;
|
|
8708
|
+
}
|
|
8709
|
+
}
|
|
8710
|
+
else {
|
|
8711
|
+
// Empty object or unknown structure
|
|
8712
|
+
jsonSchema.properties = {};
|
|
8713
|
+
}
|
|
8714
|
+
return jsonSchema;
|
|
8715
|
+
};
|
|
8716
|
+
/**
|
|
8717
|
+
* Converts array inner schema to JSON Schema items
|
|
8718
|
+
* Attempts to fully recurse into object schemas when possible
|
|
8719
|
+
*/
|
|
8720
|
+
function convertArrayItems(innerSchema, context) {
|
|
8721
|
+
const innerType = innerSchema.type;
|
|
8722
|
+
switch (innerType) {
|
|
8723
|
+
case _types__rspack_import_0.SchemaTypes.String:
|
|
8724
|
+
return { type: 'string' };
|
|
8725
|
+
case _types__rspack_import_0.SchemaTypes.Number:
|
|
8726
|
+
return { type: 'number' };
|
|
8727
|
+
case _types__rspack_import_0.SchemaTypes.Boolean:
|
|
8728
|
+
return { type: 'boolean' };
|
|
8729
|
+
case _types__rspack_import_0.SchemaTypes.Date:
|
|
8730
|
+
return { type: 'string', format: 'date-time' };
|
|
8731
|
+
case _types__rspack_import_0.SchemaTypes.Object:
|
|
8732
|
+
// Try to extract object structure from innerSchema.instance
|
|
8733
|
+
// For SchemaObject, instance contains the property definitions
|
|
8734
|
+
if (innerSchema.instance && typeof innerSchema.instance === 'object') {
|
|
8735
|
+
const properties = {};
|
|
8736
|
+
const required = [];
|
|
8737
|
+
// Iterate through the instance properties
|
|
8738
|
+
for (const [key, value] of Object.entries(innerSchema.instance)) {
|
|
8739
|
+
if (value && typeof value === 'object' && 'type' in value) {
|
|
8740
|
+
// This is a SchemaBase - try to convert it
|
|
8741
|
+
const schemaBase = value;
|
|
8742
|
+
const tempProperty = new _PropertyInfo__rspack_import_1.PropertyInfo(schemaBase, key);
|
|
8743
|
+
// Skip computed/function for input schemas
|
|
8744
|
+
if (!context.useOutputType &&
|
|
8745
|
+
(tempProperty.type === _types__rspack_import_0.SchemaTypes.Computed || tempProperty.type === _types__rspack_import_0.SchemaTypes.Function)) {
|
|
8746
|
+
continue;
|
|
8747
|
+
}
|
|
8748
|
+
const itemSchema = context.convertProperty(tempProperty);
|
|
8749
|
+
if (Object.keys(itemSchema).length > 0) {
|
|
8750
|
+
properties[key] = itemSchema;
|
|
8751
|
+
if (!tempProperty.isOptional && !tempProperty.isNullable &&
|
|
8752
|
+
tempProperty.type !== _types__rspack_import_0.SchemaTypes.Computed && tempProperty.type !== _types__rspack_import_0.SchemaTypes.Function) {
|
|
8753
|
+
required.push(key);
|
|
8754
|
+
}
|
|
8755
|
+
}
|
|
8756
|
+
}
|
|
8757
|
+
}
|
|
8758
|
+
if (Object.keys(properties).length > 0) {
|
|
8759
|
+
return {
|
|
8760
|
+
type: 'object',
|
|
8761
|
+
properties,
|
|
8762
|
+
...(required.length > 0 ? { required } : {})
|
|
8763
|
+
};
|
|
8764
|
+
}
|
|
8765
|
+
}
|
|
8766
|
+
// Fallback for unknown object structure
|
|
8767
|
+
return {
|
|
8768
|
+
type: 'object',
|
|
8769
|
+
properties: {},
|
|
8770
|
+
description: 'Array item object schema'
|
|
8771
|
+
};
|
|
8772
|
+
case _types__rspack_import_0.SchemaTypes.Array:
|
|
8773
|
+
// Nested arrays - recursively handle
|
|
8774
|
+
if (innerSchema instanceof _property_types_SchemaArray__rspack_import_2.SchemaArray && innerSchema.innerSchema) {
|
|
8775
|
+
return {
|
|
8776
|
+
type: 'array',
|
|
8777
|
+
items: convertArrayItems(innerSchema.innerSchema, context)
|
|
8778
|
+
};
|
|
8779
|
+
}
|
|
8780
|
+
return {
|
|
8781
|
+
type: 'array',
|
|
8782
|
+
items: { type: 'object' } // Simplified fallback
|
|
8783
|
+
};
|
|
8784
|
+
default:
|
|
8785
|
+
return { type: 'object' };
|
|
8786
|
+
}
|
|
8787
|
+
}
|
|
8788
|
+
/**
|
|
8789
|
+
* Converts an Array property to JSON Schema
|
|
8790
|
+
*/
|
|
8791
|
+
const arrayConverter = (property, context) => {
|
|
8792
|
+
const jsonSchema = { type: 'array' };
|
|
8793
|
+
if (property.innerSchema) {
|
|
8794
|
+
jsonSchema.items = convertArrayItems(property.innerSchema, context);
|
|
8795
|
+
}
|
|
8796
|
+
else {
|
|
8797
|
+
jsonSchema.items = { type: 'object' };
|
|
8798
|
+
}
|
|
8799
|
+
return jsonSchema;
|
|
8800
|
+
};
|
|
8801
|
+
/**
|
|
8802
|
+
* Converts computed/function properties to JSON Schema
|
|
8803
|
+
* For input schemas, these return empty (should be skipped)
|
|
8804
|
+
* For output schemas, we include them with a generic object type
|
|
8805
|
+
*/
|
|
8806
|
+
const computedConverter = (property, context) => {
|
|
8807
|
+
// For input schemas, computed/function properties are not part of the data shape
|
|
8808
|
+
if (!context.useOutputType) {
|
|
8809
|
+
return {};
|
|
8810
|
+
}
|
|
8811
|
+
// For output schemas, include computed properties
|
|
8812
|
+
// We can't know the exact return type without executing the function,
|
|
8813
|
+
// so we use a generic object type with a note
|
|
8814
|
+
const routierMeta = {
|
|
8815
|
+
isComputed: property.type === _types__rspack_import_0.SchemaTypes.Computed,
|
|
8816
|
+
isFunction: property.type === _types__rspack_import_0.SchemaTypes.Function
|
|
8817
|
+
};
|
|
8818
|
+
// Store function source code for rehydration
|
|
8819
|
+
if (property.functionBody) {
|
|
8820
|
+
try {
|
|
8821
|
+
routierMeta.functionSource = property.functionBody.toString();
|
|
8822
|
+
}
|
|
8823
|
+
catch {
|
|
8824
|
+
// If function can't be serialized, store a placeholder
|
|
8825
|
+
routierMeta.functionSource = null;
|
|
8826
|
+
}
|
|
8827
|
+
}
|
|
8828
|
+
// Store injected value if it's serializable
|
|
8829
|
+
if (property.injected !== null && property.injected !== undefined) {
|
|
8830
|
+
try {
|
|
8831
|
+
// Try to serialize the injected value
|
|
8832
|
+
JSON.stringify(property.injected);
|
|
8833
|
+
routierMeta.injected = property.injected;
|
|
8834
|
+
}
|
|
8835
|
+
catch {
|
|
8836
|
+
// If injected value can't be serialized, store null
|
|
8837
|
+
routierMeta.injected = null;
|
|
8838
|
+
}
|
|
8839
|
+
}
|
|
8840
|
+
else {
|
|
8841
|
+
routierMeta.injected = null;
|
|
8842
|
+
}
|
|
8843
|
+
return {
|
|
8844
|
+
type: 'object',
|
|
8845
|
+
description: property.type === _types__rspack_import_0.SchemaTypes.Computed
|
|
8846
|
+
? 'Computed property (derived value)'
|
|
8847
|
+
: 'Function property (derived value)',
|
|
8848
|
+
'x-routier': routierMeta
|
|
8849
|
+
};
|
|
8850
|
+
};
|
|
8851
|
+
/**
|
|
8852
|
+
* Default converter for unknown types
|
|
8853
|
+
*/
|
|
8854
|
+
const defaultConverter = () => {
|
|
8855
|
+
return { type: 'object' };
|
|
8856
|
+
};
|
|
8857
|
+
/**
|
|
8858
|
+
* Factory registry mapping SchemaTypes to converters
|
|
8859
|
+
*/
|
|
8860
|
+
const converterRegistry = new Map([
|
|
8861
|
+
[_types__rspack_import_0.SchemaTypes.String, createPrimitiveConverter('string')],
|
|
8862
|
+
[_types__rspack_import_0.SchemaTypes.Number, createPrimitiveConverter('number')],
|
|
8863
|
+
[_types__rspack_import_0.SchemaTypes.Boolean, createPrimitiveConverter('boolean')],
|
|
8864
|
+
[_types__rspack_import_0.SchemaTypes.Date, dateConverter],
|
|
8865
|
+
[_types__rspack_import_0.SchemaTypes.Object, objectConverter],
|
|
8866
|
+
[_types__rspack_import_0.SchemaTypes.Array, arrayConverter],
|
|
8867
|
+
[_types__rspack_import_0.SchemaTypes.Computed, computedConverter],
|
|
8868
|
+
[_types__rspack_import_0.SchemaTypes.Function, computedConverter],
|
|
8869
|
+
]);
|
|
8870
|
+
/**
|
|
8871
|
+
* Applies nullable handling to a JSON Schema based on the target draft version
|
|
8872
|
+
*/
|
|
8873
|
+
function applyNullable(jsonSchema, property, target) {
|
|
8874
|
+
if (!property.isNullable) {
|
|
8875
|
+
return;
|
|
8876
|
+
}
|
|
8877
|
+
if (target === 'draft-2020-12') {
|
|
8878
|
+
if (Array.isArray(jsonSchema.type)) {
|
|
8879
|
+
jsonSchema.type.push('null');
|
|
8880
|
+
}
|
|
8881
|
+
else {
|
|
8882
|
+
jsonSchema.type = [jsonSchema.type, 'null'];
|
|
8883
|
+
}
|
|
8884
|
+
}
|
|
8885
|
+
else {
|
|
8886
|
+
jsonSchema.nullable = true;
|
|
8887
|
+
}
|
|
8888
|
+
}
|
|
8889
|
+
/**
|
|
8890
|
+
* Applies Routier-specific metadata to a JSON Schema
|
|
8891
|
+
*/
|
|
8892
|
+
function applyRoutierMetadata(jsonSchema, property) {
|
|
8893
|
+
// Don't overwrite existing x-routier metadata (e.g., from computed properties)
|
|
8894
|
+
if (!jsonSchema['x-routier']) {
|
|
8895
|
+
jsonSchema['x-routier'] = {};
|
|
8896
|
+
}
|
|
8897
|
+
const routierMeta = jsonSchema['x-routier'];
|
|
8898
|
+
// Only add metadata if it doesn't already exist (to preserve computed property metadata)
|
|
8899
|
+
if (property.isKey && !routierMeta.isKey) {
|
|
8900
|
+
routierMeta.isKey = true;
|
|
8901
|
+
}
|
|
8902
|
+
if (property.isIdentity && !routierMeta.isIdentity) {
|
|
8903
|
+
routierMeta.isIdentity = true;
|
|
8904
|
+
}
|
|
8905
|
+
if (property.isReadonly && !routierMeta.isReadonly) {
|
|
8906
|
+
routierMeta.isReadonly = true;
|
|
8907
|
+
}
|
|
8908
|
+
if (property.isDistinct && !routierMeta.isDistinct) {
|
|
8909
|
+
routierMeta.isDistinct = true;
|
|
8910
|
+
}
|
|
8911
|
+
if (property.indexes && property.indexes.length > 0 && !routierMeta.indexes) {
|
|
8912
|
+
routierMeta.indexes = property.indexes;
|
|
8913
|
+
}
|
|
8914
|
+
if ((property.valueSerializer || property.valueDeserializer) && !routierMeta.hasCustomSerialization) {
|
|
8915
|
+
routierMeta.hasCustomSerialization = true;
|
|
8916
|
+
}
|
|
8917
|
+
if (property.defaultValue != null && !routierMeta.hasDefault) {
|
|
8918
|
+
routierMeta.hasDefault = true;
|
|
8919
|
+
// Note: We can't serialize function defaults, only note their presence
|
|
8920
|
+
if (typeof property.defaultValue === 'function') {
|
|
8921
|
+
routierMeta.defaultIsFunction = true;
|
|
8922
|
+
}
|
|
8923
|
+
else {
|
|
8924
|
+
// For static defaults, we can include the actual value
|
|
8925
|
+
// Note: This includes falsy values like 0, false, empty string, etc.
|
|
8926
|
+
routierMeta.defaultValue = property.defaultValue;
|
|
8927
|
+
}
|
|
8928
|
+
}
|
|
8929
|
+
// Store the Routier property name in metadata (may differ from JSON Schema key if from() is used)
|
|
8930
|
+
if (!routierMeta.propertyName) {
|
|
8931
|
+
routierMeta.propertyName = property.name;
|
|
8932
|
+
}
|
|
8933
|
+
if (property.from != null && !routierMeta.from) {
|
|
8934
|
+
routierMeta.from = property.from;
|
|
8935
|
+
}
|
|
8936
|
+
}
|
|
8937
|
+
/**
|
|
8938
|
+
* Converts a Routier PropertyInfo to a JSON Schema property definition.
|
|
8939
|
+
*/
|
|
8940
|
+
function propertyInfoToJsonSchema(property, target, visited = new Set(), useOutputType = false) {
|
|
8941
|
+
// Create conversion context with recursive converter
|
|
8942
|
+
const context = {
|
|
8943
|
+
target,
|
|
8944
|
+
visited,
|
|
8945
|
+
useOutputType,
|
|
8946
|
+
convertProperty: (prop) => propertyInfoToJsonSchema(prop, target, visited, useOutputType)
|
|
8947
|
+
};
|
|
8948
|
+
// Get converter from factory registry
|
|
8949
|
+
const converter = converterRegistry.get(property.type) ?? defaultConverter;
|
|
8950
|
+
// Convert the property
|
|
8951
|
+
const jsonSchema = converter(property, context);
|
|
8952
|
+
// Apply nullable handling
|
|
8953
|
+
applyNullable(jsonSchema, property, target);
|
|
8954
|
+
// Apply Routier-specific metadata
|
|
8955
|
+
applyRoutierMetadata(jsonSchema, property);
|
|
8956
|
+
return jsonSchema;
|
|
8957
|
+
}
|
|
8958
|
+
/**
|
|
8959
|
+
* Converts a CompiledSchema to a JSON Schema object schema.
|
|
8960
|
+
*/
|
|
8961
|
+
function compiledSchemaToJsonSchema(compiledSchema, target, useOutputType = false) {
|
|
8962
|
+
const jsonSchema = {
|
|
8963
|
+
$schema: target === 'draft-2020-12'
|
|
8964
|
+
? 'https://json-schema.org/draft/2020-12/schema'
|
|
8965
|
+
: target === 'draft-07'
|
|
8966
|
+
? 'http://json-schema.org/draft-07/schema#'
|
|
8967
|
+
: 'http://json-schema.org/draft-04/schema#',
|
|
8968
|
+
type: 'object',
|
|
8969
|
+
properties: {},
|
|
8970
|
+
required: []
|
|
8971
|
+
};
|
|
8972
|
+
const properties = {};
|
|
8973
|
+
const required = [];
|
|
8974
|
+
// Iterate through all properties
|
|
8975
|
+
for (const property of compiledSchema.properties) {
|
|
8976
|
+
// Skip computed and function properties for input schema
|
|
8977
|
+
// For output schema, we include computed properties
|
|
8978
|
+
if (!useOutputType && (property.type === _types__rspack_import_0.SchemaTypes.Computed || property.type === _types__rspack_import_0.SchemaTypes.Function)) {
|
|
8979
|
+
continue;
|
|
8980
|
+
}
|
|
8981
|
+
// Skip unmapped properties (except computed/function properties in output schema)
|
|
8982
|
+
if (property.isUnmapped && !(useOutputType && (property.type === _types__rspack_import_0.SchemaTypes.Computed || property.type === _types__rspack_import_0.SchemaTypes.Function))) {
|
|
8983
|
+
continue;
|
|
8984
|
+
}
|
|
8985
|
+
const propertySchema = propertyInfoToJsonSchema(property, target, new Set(), useOutputType);
|
|
8986
|
+
// Skip empty schemas (e.g., computed properties that return empty)
|
|
8987
|
+
if (Object.keys(propertySchema).length === 0) {
|
|
8988
|
+
continue;
|
|
8989
|
+
}
|
|
8990
|
+
const propertyName = property.from || property.name;
|
|
8991
|
+
properties[propertyName] = propertySchema;
|
|
8992
|
+
// Add to required if not optional and not nullable
|
|
8993
|
+
if (!property.isOptional && !property.isNullable) {
|
|
8994
|
+
required.push(propertyName);
|
|
8995
|
+
}
|
|
8996
|
+
}
|
|
8997
|
+
jsonSchema.properties = properties;
|
|
8998
|
+
if (required.length > 0) {
|
|
8999
|
+
jsonSchema.required = required;
|
|
9000
|
+
}
|
|
9001
|
+
// Add Routier-specific metadata
|
|
9002
|
+
jsonSchema['x-routier'] = {
|
|
9003
|
+
collectionName: compiledSchema.collectionName,
|
|
9004
|
+
idProperties: compiledSchema.idProperties.map(p => p.name),
|
|
9005
|
+
hasIdentities: compiledSchema.hasIdentities,
|
|
9006
|
+
hasIdentityKeys: compiledSchema.hasIdentityKeys
|
|
9007
|
+
};
|
|
9008
|
+
return jsonSchema;
|
|
9009
|
+
}
|
|
9010
|
+
/**
|
|
9011
|
+
* Creates Standard JSON Schema V1 props for a compiled schema.
|
|
9012
|
+
*/
|
|
9013
|
+
function createStandardJsonSchemaProps(compiledSchema) {
|
|
9014
|
+
return {
|
|
9015
|
+
version: 1,
|
|
9016
|
+
vendor: 'routier',
|
|
9017
|
+
types: {
|
|
9018
|
+
input: undefined,
|
|
9019
|
+
output: undefined
|
|
9020
|
+
},
|
|
9021
|
+
jsonSchema: {
|
|
9022
|
+
input: (options) => {
|
|
9023
|
+
return compiledSchemaToJsonSchema(compiledSchema, options.target, false);
|
|
9024
|
+
},
|
|
9025
|
+
output: (options) => {
|
|
9026
|
+
return compiledSchemaToJsonSchema(compiledSchema, options.target, true);
|
|
9027
|
+
}
|
|
9028
|
+
}
|
|
9029
|
+
};
|
|
9030
|
+
}
|
|
9031
|
+
/**
|
|
9032
|
+
* Parses a JSON string containing a JSON Schema and rehydrates it into a Routier SchemaDefinition.
|
|
9033
|
+
* This is a convenience wrapper around `rehydrateSchemaFromJsonSchema` that handles JSON parsing.
|
|
9034
|
+
*
|
|
9035
|
+
* @param jsonString - The JSON string containing the JSON Schema
|
|
9036
|
+
* @param collectionName - The collection name for the schema (if not in x-routier metadata)
|
|
9037
|
+
* @returns A SchemaDefinition that can be compiled
|
|
9038
|
+
* @throws Error if the JSON string is invalid or doesn't contain a valid JSON Schema
|
|
9039
|
+
*/
|
|
9040
|
+
function rehydrateSchemaFromJsonString(jsonString, collectionName) {
|
|
9041
|
+
try {
|
|
9042
|
+
const jsonSchema = JSON.parse(jsonString);
|
|
9043
|
+
return rehydrateSchemaFromJsonSchema(jsonSchema, collectionName);
|
|
9044
|
+
}
|
|
9045
|
+
catch (error) {
|
|
9046
|
+
if (error instanceof SyntaxError) {
|
|
9047
|
+
throw new Error(`Invalid JSON string: ${error.message}`);
|
|
9048
|
+
}
|
|
9049
|
+
throw error;
|
|
9050
|
+
}
|
|
9051
|
+
}
|
|
9052
|
+
/**
|
|
9053
|
+
* Rehydrates a JSON Schema back into a Routier SchemaDefinition.
|
|
9054
|
+
* This parses the JSON Schema structure and reconstructs the schema using Routier's builder API.
|
|
9055
|
+
*
|
|
9056
|
+
* @param jsonSchema - The JSON Schema object to rehydrate
|
|
9057
|
+
* @param collectionName - The collection name for the schema (if not in x-routier metadata)
|
|
9058
|
+
* @returns A SchemaDefinition that can be compiled
|
|
9059
|
+
*/
|
|
9060
|
+
function rehydrateSchemaFromJsonSchema(jsonSchema, collectionName) {
|
|
9061
|
+
// Extract collection name - provided collectionName takes precedence over metadata
|
|
9062
|
+
const routierMeta = jsonSchema['x-routier'];
|
|
9063
|
+
const finalCollectionName = collectionName || routierMeta?.collectionName || 'unknown';
|
|
9064
|
+
if (!jsonSchema.properties || typeof jsonSchema.properties !== 'object') {
|
|
9065
|
+
throw new Error('JSON Schema must have a properties object');
|
|
9066
|
+
}
|
|
9067
|
+
const properties = jsonSchema.properties;
|
|
9068
|
+
const required = jsonSchema.required || [];
|
|
9069
|
+
const schemaDefinition = {};
|
|
9070
|
+
const computedProperties = [];
|
|
9071
|
+
// Get idProperties from schema-level metadata as fallback
|
|
9072
|
+
const idProperties = routierMeta?.idProperties || [];
|
|
9073
|
+
for (const [propName, propSchema] of Object.entries(properties)) {
|
|
9074
|
+
const prop = propSchema;
|
|
9075
|
+
const isRequired = required.includes(propName);
|
|
9076
|
+
const routierPropMeta = prop['x-routier'];
|
|
9077
|
+
// Use Routier property name from metadata if available, otherwise use JSON Schema property name
|
|
9078
|
+
const routierPropName = routierPropMeta?.propertyName || propName;
|
|
9079
|
+
// Check if this is a computed or function property
|
|
9080
|
+
if (routierPropMeta?.isComputed || routierPropMeta?.isFunction) {
|
|
9081
|
+
computedProperties.push({
|
|
9082
|
+
name: routierPropName,
|
|
9083
|
+
isComputed: routierPropMeta.isComputed === true,
|
|
9084
|
+
functionSource: routierPropMeta.functionSource || null,
|
|
9085
|
+
injected: routierPropMeta.injected !== undefined ? routierPropMeta.injected : null
|
|
9086
|
+
});
|
|
9087
|
+
continue;
|
|
9088
|
+
}
|
|
9089
|
+
// Convert JSON Schema property to Routier schema
|
|
9090
|
+
let schemaBuilder = convertJsonSchemaPropertyToRoutier(prop);
|
|
9091
|
+
// Apply Routier-specific modifiers (using type assertion for method chaining)
|
|
9092
|
+
// Note: Apply key() first as it's required for schema compilation
|
|
9093
|
+
// Check both property-level metadata and schema-level idProperties list
|
|
9094
|
+
const isKey = routierPropMeta?.isKey === true || idProperties.includes(routierPropName);
|
|
9095
|
+
if (isKey && typeof schemaBuilder.key === 'function') {
|
|
9096
|
+
schemaBuilder = schemaBuilder.key();
|
|
9097
|
+
}
|
|
9098
|
+
// Apply from() mapping early, as it's a fundamental property mapping
|
|
9099
|
+
if (routierPropMeta?.from && typeof schemaBuilder.from === 'function') {
|
|
9100
|
+
schemaBuilder = schemaBuilder.from(routierPropMeta.from);
|
|
9101
|
+
}
|
|
9102
|
+
if (routierPropMeta?.isIdentity && typeof schemaBuilder.identity === 'function') {
|
|
9103
|
+
schemaBuilder = schemaBuilder.identity();
|
|
9104
|
+
}
|
|
9105
|
+
if (routierPropMeta?.isReadonly && typeof schemaBuilder.readonly === 'function') {
|
|
9106
|
+
schemaBuilder = schemaBuilder.readonly();
|
|
9107
|
+
}
|
|
9108
|
+
if (routierPropMeta?.isDistinct && typeof schemaBuilder.distinct === 'function') {
|
|
9109
|
+
schemaBuilder = schemaBuilder.distinct();
|
|
9110
|
+
}
|
|
9111
|
+
// Apply optional if property is not required (nullable and optional are independent)
|
|
9112
|
+
if (!isRequired && typeof schemaBuilder.optional === 'function') {
|
|
9113
|
+
schemaBuilder = schemaBuilder.optional();
|
|
9114
|
+
}
|
|
9115
|
+
// Apply nullable if property allows null (nullable and optional are independent)
|
|
9116
|
+
if (prop.nullable === true || (Array.isArray(prop.type) && prop.type.includes('null'))) {
|
|
9117
|
+
if (typeof schemaBuilder.nullable === 'function') {
|
|
9118
|
+
schemaBuilder = schemaBuilder.nullable();
|
|
9119
|
+
}
|
|
9120
|
+
}
|
|
9121
|
+
if (routierPropMeta?.indexes && Array.isArray(routierPropMeta.indexes)) {
|
|
9122
|
+
if (typeof schemaBuilder.index === 'function') {
|
|
9123
|
+
schemaBuilder = schemaBuilder.index(...routierPropMeta.indexes);
|
|
9124
|
+
}
|
|
9125
|
+
}
|
|
9126
|
+
// Apply default value if present (only static defaults, not function defaults)
|
|
9127
|
+
// hasDefault=true and defaultIsFunction=false means we have a static default value stored
|
|
9128
|
+
if (routierPropMeta?.hasDefault && !routierPropMeta.defaultIsFunction && routierPropMeta.hasOwnProperty('defaultValue')) {
|
|
9129
|
+
if (typeof schemaBuilder.default === 'function') {
|
|
9130
|
+
schemaBuilder = schemaBuilder.default(routierPropMeta.defaultValue);
|
|
9131
|
+
}
|
|
9132
|
+
}
|
|
9133
|
+
schemaDefinition[routierPropName] = schemaBuilder;
|
|
9134
|
+
}
|
|
9135
|
+
// Build base schema
|
|
9136
|
+
let schema = _builder__rspack_import_3.s.define(finalCollectionName, schemaDefinition);
|
|
9137
|
+
// Add computed properties via modify()
|
|
9138
|
+
if (computedProperties.length > 0) {
|
|
9139
|
+
schema = schema.modify(x => {
|
|
9140
|
+
const computedDefs = {};
|
|
9141
|
+
for (const computedProp of computedProperties) {
|
|
9142
|
+
if (computedProp.functionSource) {
|
|
9143
|
+
// Recreate the function from source code
|
|
9144
|
+
// The function signature is: (entity, collectionName, injected) => result
|
|
9145
|
+
// We use new Function() to create the function, but wrap it so toString() returns the arrow function
|
|
9146
|
+
let recreatedFn;
|
|
9147
|
+
try {
|
|
9148
|
+
const functionSource = computedProp.functionSource;
|
|
9149
|
+
// Parse the arrow function to extract parameters and body
|
|
9150
|
+
const arrowMatch = functionSource.match(/^\(([^)]*)\)\s*=>\s*(.+)$/s);
|
|
9151
|
+
if (!arrowMatch) {
|
|
9152
|
+
throw new Error('Function source is not an arrow function');
|
|
9153
|
+
}
|
|
9154
|
+
// Parse parameters
|
|
9155
|
+
const paramsStr = arrowMatch[1].trim();
|
|
9156
|
+
const params = paramsStr ? paramsStr.split(',').map(p => p.trim()).filter(p => p) : [];
|
|
9157
|
+
const body = arrowMatch[2].trim();
|
|
9158
|
+
// Create function body - if it's a block (starts with {), use as-is, otherwise wrap in return
|
|
9159
|
+
const functionBody = body.startsWith('{')
|
|
9160
|
+
? body.slice(1, -1) // Remove outer braces
|
|
9161
|
+
: `return ${body}`;
|
|
9162
|
+
// Create the function using new Function()
|
|
9163
|
+
// If no parameters, call with just the body; otherwise spread the params
|
|
9164
|
+
const fn = params.length > 0
|
|
9165
|
+
? new Function(...params, functionBody)
|
|
9166
|
+
: new Function(functionBody);
|
|
9167
|
+
// Wrap it so toString() returns the original arrow function string
|
|
9168
|
+
// This is needed because the schema system validates that functions are arrow functions
|
|
9169
|
+
recreatedFn = Object.assign(fn, {
|
|
9170
|
+
toString: () => functionSource
|
|
9171
|
+
});
|
|
9172
|
+
}
|
|
9173
|
+
catch (e) {
|
|
9174
|
+
// If we can't recreate the function, create a placeholder arrow function that throws
|
|
9175
|
+
recreatedFn = () => {
|
|
9176
|
+
throw new Error(`Cannot recreate computed property ${computedProp.name}: ${e instanceof Error ? e.message : 'unknown error'}`);
|
|
9177
|
+
};
|
|
9178
|
+
// Ensure toString returns an arrow function for validation
|
|
9179
|
+
Object.assign(recreatedFn, {
|
|
9180
|
+
toString: () => `() => { throw new Error("Cannot recreate computed property ${computedProp.name}"); }`
|
|
9181
|
+
});
|
|
9182
|
+
}
|
|
9183
|
+
// Add computed property with optional injected value
|
|
9184
|
+
if (computedProp.isComputed) {
|
|
9185
|
+
computedDefs[computedProp.name] = x.computed(recreatedFn, computedProp.injected);
|
|
9186
|
+
}
|
|
9187
|
+
else {
|
|
9188
|
+
computedDefs[computedProp.name] = x.function(recreatedFn, computedProp.injected);
|
|
9189
|
+
}
|
|
9190
|
+
}
|
|
9191
|
+
else {
|
|
9192
|
+
// No function source available - create a placeholder
|
|
9193
|
+
computedDefs[computedProp.name] = computedProp.isComputed
|
|
9194
|
+
? x.computed(() => {
|
|
9195
|
+
throw new Error(`Computed property ${computedProp.name} could not be rehydrated: function source not available`);
|
|
9196
|
+
})
|
|
9197
|
+
: x.function(() => {
|
|
9198
|
+
throw new Error(`Function property ${computedProp.name} could not be rehydrated: function source not available`);
|
|
9199
|
+
});
|
|
9200
|
+
}
|
|
9201
|
+
}
|
|
9202
|
+
return computedDefs;
|
|
9203
|
+
});
|
|
9204
|
+
}
|
|
9205
|
+
return schema;
|
|
9206
|
+
}
|
|
9207
|
+
/**
|
|
9208
|
+
* Converts a JSON Schema property definition to a Routier schema builder.
|
|
9209
|
+
*/
|
|
9210
|
+
function convertJsonSchemaPropertyToRoutier(prop) {
|
|
9211
|
+
const type = Array.isArray(prop.type)
|
|
9212
|
+
? prop.type.find(t => t !== 'null') || prop.type[0]
|
|
9213
|
+
: prop.type;
|
|
9214
|
+
// Check for date type - dates are serialized as string with format 'date-time'
|
|
9215
|
+
if (type === 'string' && prop.format === 'date-time') {
|
|
9216
|
+
return _builder__rspack_import_3.s.date();
|
|
9217
|
+
}
|
|
9218
|
+
switch (type) {
|
|
9219
|
+
case 'string':
|
|
9220
|
+
if (prop.enum && Array.isArray(prop.enum)) {
|
|
9221
|
+
return _builder__rspack_import_3.s.string(...prop.enum);
|
|
9222
|
+
}
|
|
9223
|
+
return _builder__rspack_import_3.s.string();
|
|
9224
|
+
case 'number':
|
|
9225
|
+
case 'integer':
|
|
9226
|
+
if (prop.enum && Array.isArray(prop.enum)) {
|
|
9227
|
+
return _builder__rspack_import_3.s.number(...prop.enum);
|
|
9228
|
+
}
|
|
9229
|
+
return _builder__rspack_import_3.s.number();
|
|
9230
|
+
case 'boolean':
|
|
9231
|
+
return _builder__rspack_import_3.s.boolean();
|
|
9232
|
+
case 'object':
|
|
9233
|
+
// Recurse into object properties
|
|
9234
|
+
if (prop.properties && typeof prop.properties === 'object') {
|
|
9235
|
+
const objectProps = prop.properties;
|
|
9236
|
+
const objectSchema = {};
|
|
9237
|
+
for (const [key, value] of Object.entries(objectProps)) {
|
|
9238
|
+
objectSchema[key] = convertJsonSchemaPropertyToRoutier(value);
|
|
9239
|
+
}
|
|
9240
|
+
return _builder__rspack_import_3.s.object(objectSchema);
|
|
9241
|
+
}
|
|
9242
|
+
return _builder__rspack_import_3.s.object({});
|
|
9243
|
+
case 'array':
|
|
9244
|
+
// Handle array items
|
|
9245
|
+
if (prop.items && typeof prop.items === 'object') {
|
|
9246
|
+
const itemsSchema = convertJsonSchemaPropertyToRoutier(prop.items);
|
|
9247
|
+
return _builder__rspack_import_3.s.array(itemsSchema);
|
|
9248
|
+
}
|
|
9249
|
+
return _builder__rspack_import_3.s.array(_builder__rspack_import_3.s.object({}));
|
|
9250
|
+
default:
|
|
9251
|
+
// Fallback to object for unknown types
|
|
9252
|
+
return _builder__rspack_import_3.s.object({});
|
|
9253
|
+
}
|
|
9254
|
+
}
|
|
9255
|
+
/**
|
|
9256
|
+
* Attempts to extract type information from a compiled schema for better type inference.
|
|
9257
|
+
*
|
|
9258
|
+
* Note: TypeScript types are compile-time only, so we can't extract actual type information at runtime.
|
|
9259
|
+
* The Standard JSON Schema spec allows libraries to advertise their inferred types via the `types` property,
|
|
9260
|
+
* but this requires compile-time type information that isn't available at runtime.
|
|
9261
|
+
*
|
|
9262
|
+
* For proper type inference, consumers should use TypeScript's type system:
|
|
9263
|
+
* ```typescript
|
|
9264
|
+
* const schema = s.define("users", { ... }).compile();
|
|
9265
|
+
* type User = InferType<typeof schema>;
|
|
9266
|
+
* type CreateUser = InferCreateType<typeof schema>;
|
|
9267
|
+
* ```
|
|
9268
|
+
*
|
|
9269
|
+
* @param compiledSchema - The compiled schema to extract type info from
|
|
9270
|
+
* @returns A description of the type names (for documentation purposes only)
|
|
9271
|
+
*/
|
|
9272
|
+
function extractTypeInfo(compiledSchema) {
|
|
9273
|
+
return {
|
|
9274
|
+
inputType: `InferCreateType<${compiledSchema.collectionName}>`,
|
|
9275
|
+
outputType: `InferType<${compiledSchema.collectionName}>`
|
|
9276
|
+
};
|
|
9277
|
+
}
|
|
9278
|
+
|
|
9279
|
+
|
|
8266
9280
|
},
|
|
8267
9281
|
"./src/utilities/arrays.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
8268
9282
|
__webpack_require__.r(__webpack_exports__);
|
|
@@ -8335,7 +9349,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8335
9349
|
__webpack_require__.d(__webpack_exports__, {
|
|
8336
9350
|
noop: () => (noop)
|
|
8337
9351
|
});
|
|
8338
|
-
const noop = (...
|
|
9352
|
+
const noop = (..._args) => { };
|
|
8339
9353
|
|
|
8340
9354
|
|
|
8341
9355
|
},
|
|
@@ -8392,16 +9406,27 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8392
9406
|
__webpack_require__.d(__webpack_exports__, {
|
|
8393
9407
|
logger: () => (logger)
|
|
8394
9408
|
});
|
|
8395
|
-
|
|
8396
|
-
|
|
8397
|
-
|
|
9409
|
+
/**
|
|
9410
|
+
* Enable logging by setting `globalThis.__ROUTIER_DEBUG__ = true` before any routier code runs.
|
|
9411
|
+
*/
|
|
9412
|
+
const shouldLog = () => {
|
|
9413
|
+
if (typeof globalThis !== 'undefined') {
|
|
9414
|
+
const g = globalThis;
|
|
9415
|
+
if (g.__ROUTIER_DEBUG__ === true)
|
|
9416
|
+
return true;
|
|
8398
9417
|
}
|
|
8399
|
-
|
|
8400
|
-
|
|
9418
|
+
if (typeof process !== 'undefined' && process.env != null) {
|
|
9419
|
+
const debug = process.env.DEBUG;
|
|
9420
|
+
if (debug === 'routier' || debug === '*')
|
|
9421
|
+
return true;
|
|
9422
|
+
const env = "development"?.toLowerCase();
|
|
9423
|
+
if (env === 'dev' || env === 'development' || env === 'test')
|
|
9424
|
+
return true;
|
|
9425
|
+
}
|
|
9426
|
+
return false;
|
|
8401
9427
|
};
|
|
8402
|
-
const shouldLog = isDevelopment();
|
|
8403
9428
|
const tryLog = (type, ...args) => {
|
|
8404
|
-
if (shouldLog) {
|
|
9429
|
+
if (shouldLog()) {
|
|
8405
9430
|
console[type](...args);
|
|
8406
9431
|
}
|
|
8407
9432
|
};
|
|
@@ -8795,6 +9820,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
8795
9820
|
ComparatorExpression: () => (/* reexport safe */ _expressions__rspack_import_4.ComparatorExpression),
|
|
8796
9821
|
ContainerBlock: () => (/* reexport safe */ _codegen__rspack_import_1.ContainerBlock),
|
|
8797
9822
|
DataTranslator: () => (/* reexport safe */ _plugins__rspack_import_7.DataTranslator),
|
|
9823
|
+
EXPRESSION_TYPES: () => (/* reexport safe */ _expressions__rspack_import_4.EXPRESSION_TYPES),
|
|
8798
9824
|
EmptyExpression: () => (/* reexport safe */ _expressions__rspack_import_4.EmptyExpression),
|
|
8799
9825
|
EphemeralDataPlugin: () => (/* reexport safe */ _plugins__rspack_import_7.EphemeralDataPlugin),
|
|
8800
9826
|
Expression: () => (/* reexport safe */ _expressions__rspack_import_4.Expression),
|
|
@@ -8808,7 +9834,6 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
8808
9834
|
NotParsableExpression: () => (/* reexport safe */ _expressions__rspack_import_4.NotParsableExpression),
|
|
8809
9835
|
ObjectBuilder: () => (/* reexport safe */ _codegen__rspack_import_1.ObjectBuilder),
|
|
8810
9836
|
OperatorExpression: () => (/* reexport safe */ _expressions__rspack_import_4.OperatorExpression),
|
|
8811
|
-
OptimisticReplicationDbPlugin: () => (/* reexport safe */ _plugins__rspack_import_7.OptimisticReplicationDbPlugin),
|
|
8812
9837
|
PerformanceCapability: () => (/* reexport safe */ _capabilities__rspack_import_11.PerformanceCapability),
|
|
8813
9838
|
PluginEventResult: () => (/* reexport safe */ _results__rspack_import_8.PluginEventResult),
|
|
8814
9839
|
PropertyExpression: () => (/* reexport safe */ _expressions__rspack_import_4.PropertyExpression),
|
|
@@ -8818,7 +9843,6 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
8818
9843
|
QueryOrdering: () => (/* reexport safe */ _plugins__rspack_import_7.QueryOrdering),
|
|
8819
9844
|
RawBuilder: () => (/* reexport safe */ _codegen__rspack_import_1.RawBuilder),
|
|
8820
9845
|
ReadonlySchemaCollection: () => (/* reexport safe */ _collections__rspack_import_2.ReadonlySchemaCollection),
|
|
8821
|
-
ReplicationDbPlugin: () => (/* reexport safe */ _plugins__rspack_import_7.ReplicationDbPlugin),
|
|
8822
9846
|
Result: () => (/* reexport safe */ _results__rspack_import_8.Result),
|
|
8823
9847
|
SchemaArray: () => (/* reexport safe */ _schema__rspack_import_9.SchemaArray),
|
|
8824
9848
|
SchemaBase: () => (/* reexport safe */ _schema__rspack_import_9.SchemaBase),
|
|
@@ -8827,9 +9851,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
8827
9851
|
SchemaComputed: () => (/* reexport safe */ _schema__rspack_import_9.SchemaComputed),
|
|
8828
9852
|
SchemaDate: () => (/* reexport safe */ _schema__rspack_import_9.SchemaDate),
|
|
8829
9853
|
SchemaDefault: () => (/* reexport safe */ _schema__rspack_import_9.SchemaDefault),
|
|
9854
|
+
SchemaDefinition: () => (/* reexport safe */ _schema__rspack_import_9.SchemaDefinition),
|
|
8830
9855
|
SchemaDeserialize: () => (/* reexport safe */ _schema__rspack_import_9.SchemaDeserialize),
|
|
8831
9856
|
SchemaDistinct: () => (/* reexport safe */ _schema__rspack_import_9.SchemaDistinct),
|
|
8832
9857
|
SchemaError: () => (/* reexport safe */ _errors__rspack_import_3.SchemaError),
|
|
9858
|
+
SchemaForeignKey: () => (/* reexport safe */ _schema__rspack_import_9.SchemaForeignKey),
|
|
8833
9859
|
SchemaFrom: () => (/* reexport safe */ _schema__rspack_import_9.SchemaFrom),
|
|
8834
9860
|
SchemaFunction: () => (/* reexport safe */ _schema__rspack_import_9.SchemaFunction),
|
|
8835
9861
|
SchemaIdentity: () => (/* reexport safe */ _schema__rspack_import_9.SchemaIdentity),
|
|
@@ -8844,6 +9870,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
8844
9870
|
SchemaReadonly: () => (/* reexport safe */ _schema__rspack_import_9.SchemaReadonly),
|
|
8845
9871
|
SchemaSerialize: () => (/* reexport safe */ _schema__rspack_import_9.SchemaSerialize),
|
|
8846
9872
|
SchemaString: () => (/* reexport safe */ _schema__rspack_import_9.SchemaString),
|
|
9873
|
+
SchemaTag: () => (/* reexport safe */ _schema__rspack_import_9.SchemaTag),
|
|
8847
9874
|
SchemaTracked: () => (/* reexport safe */ _schema__rspack_import_9.SchemaTracked),
|
|
8848
9875
|
SchemaTypes: () => (/* reexport safe */ _schema__rspack_import_9.SchemaTypes),
|
|
8849
9876
|
SlotBlock: () => (/* reexport safe */ _codegen__rspack_import_1.SlotBlock),
|
|
@@ -8863,22 +9890,36 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
8863
9890
|
assertInstanceOf: () => (/* reexport safe */ _assertions__rspack_import_0.assertInstanceOf),
|
|
8864
9891
|
assertIsArray: () => (/* reexport safe */ _assertions__rspack_import_0.assertIsArray),
|
|
8865
9892
|
assertIsNotNull: () => (/* reexport safe */ _assertions__rspack_import_0.assertIsNotNull),
|
|
9893
|
+
assertIsNumber: () => (/* reexport safe */ _assertions__rspack_import_0.assertIsNumber),
|
|
8866
9894
|
assertString: () => (/* reexport safe */ _assertions__rspack_import_0.assertString),
|
|
8867
9895
|
cast: () => (/* reexport safe */ _utilities__rspack_import_10.cast),
|
|
8868
9896
|
clone: () => (/* reexport safe */ _utilities__rspack_import_10.clone),
|
|
8869
9897
|
combineExpressions: () => (/* reexport safe */ _expressions__rspack_import_4.combineExpressions),
|
|
8870
9898
|
combineQueryOptionsCollections: () => (/* reexport safe */ _utilities__rspack_import_10.combineQueryOptionsCollections),
|
|
9899
|
+
compiledSchemaToJsonSchema: () => (/* reexport safe */ _schema__rspack_import_9.compiledSchemaToJsonSchema),
|
|
9900
|
+
createStandardJsonSchemaProps: () => (/* reexport safe */ _schema__rspack_import_9.createStandardJsonSchemaProps),
|
|
9901
|
+
extractTypeInfo: () => (/* reexport safe */ _schema__rspack_import_9.extractTypeInfo),
|
|
8871
9902
|
fastHash: () => (/* reexport safe */ _utilities__rspack_import_10.fastHash),
|
|
8872
9903
|
forEach: () => (/* reexport safe */ _expressions__rspack_import_4.forEach),
|
|
9904
|
+
getDialect: () => (/* reexport safe */ _expressions__rspack_import_4.getDialect),
|
|
8873
9905
|
getProperties: () => (/* reexport safe */ _expressions__rspack_import_4.getProperties),
|
|
8874
9906
|
hash: () => (/* reexport safe */ _utilities__rspack_import_10.hash),
|
|
9907
|
+
isComparatorExpression: () => (/* reexport safe */ _assertions__rspack_import_0.isComparatorExpression),
|
|
8875
9908
|
isDate: () => (/* reexport safe */ _utilities__rspack_import_10.isDate),
|
|
9909
|
+
isEmptyExpression: () => (/* reexport safe */ _assertions__rspack_import_0.isEmptyExpression),
|
|
9910
|
+
isExpression: () => (/* reexport safe */ _assertions__rspack_import_0.isExpression),
|
|
8876
9911
|
isNodeRuntime: () => (/* reexport safe */ _utilities__rspack_import_10.isNodeRuntime),
|
|
8877
|
-
|
|
9912
|
+
isNotParsableExpression: () => (/* reexport safe */ _assertions__rspack_import_0.isNotParsableExpression),
|
|
9913
|
+
isOperatorExpression: () => (/* reexport safe */ _assertions__rspack_import_0.isOperatorExpression),
|
|
9914
|
+
isPropertyExpression: () => (/* reexport safe */ _assertions__rspack_import_0.isPropertyExpression),
|
|
9915
|
+
isValueExpression: () => (/* reexport safe */ _assertions__rspack_import_0.isValueExpression),
|
|
8878
9916
|
logger: () => (/* reexport safe */ _utilities__rspack_import_10.logger),
|
|
8879
9917
|
measure: () => (/* reexport safe */ _performance__rspack_import_5.measure),
|
|
8880
9918
|
noop: () => (/* reexport safe */ _utilities__rspack_import_10.noop),
|
|
8881
9919
|
now: () => (/* reexport safe */ _performance__rspack_import_5.now),
|
|
9920
|
+
propertyInfoToJsonSchema: () => (/* reexport safe */ _schema__rspack_import_9.propertyInfoToJsonSchema),
|
|
9921
|
+
rehydrateSchemaFromJsonSchema: () => (/* reexport safe */ _schema__rspack_import_9.rehydrateSchemaFromJsonSchema),
|
|
9922
|
+
rehydrateSchemaFromJsonString: () => (/* reexport safe */ _schema__rspack_import_9.rehydrateSchemaFromJsonString),
|
|
8882
9923
|
resolveBulkPersistChanges: () => (/* reexport safe */ _utilities__rspack_import_10.resolveBulkPersistChanges),
|
|
8883
9924
|
s: () => (/* reexport safe */ _schema__rspack_import_9.s),
|
|
8884
9925
|
stringifyObject: () => (/* reexport safe */ _utilities__rspack_import_10.stringifyObject),
|
|
@@ -8886,6 +9927,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
8886
9927
|
toExpression: () => (/* reexport safe */ _expressions__rspack_import_4.toExpression),
|
|
8887
9928
|
toMap: () => (/* reexport safe */ _utilities__rspack_import_10.toMap),
|
|
8888
9929
|
toPromise: () => (/* reexport safe */ _results__rspack_import_8.toPromise),
|
|
9930
|
+
toSql: () => (/* reexport safe */ _expressions__rspack_import_4.toSql),
|
|
8889
9931
|
unsafeCast: () => (/* reexport safe */ _utilities__rspack_import_10.unsafeCast),
|
|
8890
9932
|
uuid: () => (/* reexport safe */ _utilities__rspack_import_10.uuid),
|
|
8891
9933
|
uuidv4: () => (/* reexport safe */ _utilities__rspack_import_10.uuidv4)
|
|
@@ -8929,6 +9971,7 @@ var __webpack_exports__CodeBuilder = __webpack_exports__.CodeBuilder;
|
|
|
8929
9971
|
var __webpack_exports__ComparatorExpression = __webpack_exports__.ComparatorExpression;
|
|
8930
9972
|
var __webpack_exports__ContainerBlock = __webpack_exports__.ContainerBlock;
|
|
8931
9973
|
var __webpack_exports__DataTranslator = __webpack_exports__.DataTranslator;
|
|
9974
|
+
var __webpack_exports__EXPRESSION_TYPES = __webpack_exports__.EXPRESSION_TYPES;
|
|
8932
9975
|
var __webpack_exports__EmptyExpression = __webpack_exports__.EmptyExpression;
|
|
8933
9976
|
var __webpack_exports__EphemeralDataPlugin = __webpack_exports__.EphemeralDataPlugin;
|
|
8934
9977
|
var __webpack_exports__Expression = __webpack_exports__.Expression;
|
|
@@ -8942,7 +9985,6 @@ var __webpack_exports__MemoryDataCollection = __webpack_exports__.MemoryDataColl
|
|
|
8942
9985
|
var __webpack_exports__NotParsableExpression = __webpack_exports__.NotParsableExpression;
|
|
8943
9986
|
var __webpack_exports__ObjectBuilder = __webpack_exports__.ObjectBuilder;
|
|
8944
9987
|
var __webpack_exports__OperatorExpression = __webpack_exports__.OperatorExpression;
|
|
8945
|
-
var __webpack_exports__OptimisticReplicationDbPlugin = __webpack_exports__.OptimisticReplicationDbPlugin;
|
|
8946
9988
|
var __webpack_exports__PerformanceCapability = __webpack_exports__.PerformanceCapability;
|
|
8947
9989
|
var __webpack_exports__PluginEventResult = __webpack_exports__.PluginEventResult;
|
|
8948
9990
|
var __webpack_exports__PropertyExpression = __webpack_exports__.PropertyExpression;
|
|
@@ -8952,7 +9994,6 @@ var __webpack_exports__QueryOptionsCollection = __webpack_exports__.QueryOptions
|
|
|
8952
9994
|
var __webpack_exports__QueryOrdering = __webpack_exports__.QueryOrdering;
|
|
8953
9995
|
var __webpack_exports__RawBuilder = __webpack_exports__.RawBuilder;
|
|
8954
9996
|
var __webpack_exports__ReadonlySchemaCollection = __webpack_exports__.ReadonlySchemaCollection;
|
|
8955
|
-
var __webpack_exports__ReplicationDbPlugin = __webpack_exports__.ReplicationDbPlugin;
|
|
8956
9997
|
var __webpack_exports__Result = __webpack_exports__.Result;
|
|
8957
9998
|
var __webpack_exports__SchemaArray = __webpack_exports__.SchemaArray;
|
|
8958
9999
|
var __webpack_exports__SchemaBase = __webpack_exports__.SchemaBase;
|
|
@@ -8961,9 +10002,11 @@ var __webpack_exports__SchemaCollection = __webpack_exports__.SchemaCollection;
|
|
|
8961
10002
|
var __webpack_exports__SchemaComputed = __webpack_exports__.SchemaComputed;
|
|
8962
10003
|
var __webpack_exports__SchemaDate = __webpack_exports__.SchemaDate;
|
|
8963
10004
|
var __webpack_exports__SchemaDefault = __webpack_exports__.SchemaDefault;
|
|
10005
|
+
var __webpack_exports__SchemaDefinition = __webpack_exports__.SchemaDefinition;
|
|
8964
10006
|
var __webpack_exports__SchemaDeserialize = __webpack_exports__.SchemaDeserialize;
|
|
8965
10007
|
var __webpack_exports__SchemaDistinct = __webpack_exports__.SchemaDistinct;
|
|
8966
10008
|
var __webpack_exports__SchemaError = __webpack_exports__.SchemaError;
|
|
10009
|
+
var __webpack_exports__SchemaForeignKey = __webpack_exports__.SchemaForeignKey;
|
|
8967
10010
|
var __webpack_exports__SchemaFrom = __webpack_exports__.SchemaFrom;
|
|
8968
10011
|
var __webpack_exports__SchemaFunction = __webpack_exports__.SchemaFunction;
|
|
8969
10012
|
var __webpack_exports__SchemaIdentity = __webpack_exports__.SchemaIdentity;
|
|
@@ -8978,6 +10021,7 @@ var __webpack_exports__SchemaPersistResult = __webpack_exports__.SchemaPersistRe
|
|
|
8978
10021
|
var __webpack_exports__SchemaReadonly = __webpack_exports__.SchemaReadonly;
|
|
8979
10022
|
var __webpack_exports__SchemaSerialize = __webpack_exports__.SchemaSerialize;
|
|
8980
10023
|
var __webpack_exports__SchemaString = __webpack_exports__.SchemaString;
|
|
10024
|
+
var __webpack_exports__SchemaTag = __webpack_exports__.SchemaTag;
|
|
8981
10025
|
var __webpack_exports__SchemaTracked = __webpack_exports__.SchemaTracked;
|
|
8982
10026
|
var __webpack_exports__SchemaTypes = __webpack_exports__.SchemaTypes;
|
|
8983
10027
|
var __webpack_exports__SlotBlock = __webpack_exports__.SlotBlock;
|
|
@@ -8997,22 +10041,36 @@ var __webpack_exports__assertDate = __webpack_exports__.assertDate;
|
|
|
8997
10041
|
var __webpack_exports__assertInstanceOf = __webpack_exports__.assertInstanceOf;
|
|
8998
10042
|
var __webpack_exports__assertIsArray = __webpack_exports__.assertIsArray;
|
|
8999
10043
|
var __webpack_exports__assertIsNotNull = __webpack_exports__.assertIsNotNull;
|
|
10044
|
+
var __webpack_exports__assertIsNumber = __webpack_exports__.assertIsNumber;
|
|
9000
10045
|
var __webpack_exports__assertString = __webpack_exports__.assertString;
|
|
9001
10046
|
var __webpack_exports__cast = __webpack_exports__.cast;
|
|
9002
10047
|
var __webpack_exports__clone = __webpack_exports__.clone;
|
|
9003
10048
|
var __webpack_exports__combineExpressions = __webpack_exports__.combineExpressions;
|
|
9004
10049
|
var __webpack_exports__combineQueryOptionsCollections = __webpack_exports__.combineQueryOptionsCollections;
|
|
10050
|
+
var __webpack_exports__compiledSchemaToJsonSchema = __webpack_exports__.compiledSchemaToJsonSchema;
|
|
10051
|
+
var __webpack_exports__createStandardJsonSchemaProps = __webpack_exports__.createStandardJsonSchemaProps;
|
|
10052
|
+
var __webpack_exports__extractTypeInfo = __webpack_exports__.extractTypeInfo;
|
|
9005
10053
|
var __webpack_exports__fastHash = __webpack_exports__.fastHash;
|
|
9006
10054
|
var __webpack_exports__forEach = __webpack_exports__.forEach;
|
|
10055
|
+
var __webpack_exports__getDialect = __webpack_exports__.getDialect;
|
|
9007
10056
|
var __webpack_exports__getProperties = __webpack_exports__.getProperties;
|
|
9008
10057
|
var __webpack_exports__hash = __webpack_exports__.hash;
|
|
10058
|
+
var __webpack_exports__isComparatorExpression = __webpack_exports__.isComparatorExpression;
|
|
9009
10059
|
var __webpack_exports__isDate = __webpack_exports__.isDate;
|
|
10060
|
+
var __webpack_exports__isEmptyExpression = __webpack_exports__.isEmptyExpression;
|
|
10061
|
+
var __webpack_exports__isExpression = __webpack_exports__.isExpression;
|
|
9010
10062
|
var __webpack_exports__isNodeRuntime = __webpack_exports__.isNodeRuntime;
|
|
10063
|
+
var __webpack_exports__isNotParsableExpression = __webpack_exports__.isNotParsableExpression;
|
|
10064
|
+
var __webpack_exports__isOperatorExpression = __webpack_exports__.isOperatorExpression;
|
|
9011
10065
|
var __webpack_exports__isPropertyExpression = __webpack_exports__.isPropertyExpression;
|
|
10066
|
+
var __webpack_exports__isValueExpression = __webpack_exports__.isValueExpression;
|
|
9012
10067
|
var __webpack_exports__logger = __webpack_exports__.logger;
|
|
9013
10068
|
var __webpack_exports__measure = __webpack_exports__.measure;
|
|
9014
10069
|
var __webpack_exports__noop = __webpack_exports__.noop;
|
|
9015
10070
|
var __webpack_exports__now = __webpack_exports__.now;
|
|
10071
|
+
var __webpack_exports__propertyInfoToJsonSchema = __webpack_exports__.propertyInfoToJsonSchema;
|
|
10072
|
+
var __webpack_exports__rehydrateSchemaFromJsonSchema = __webpack_exports__.rehydrateSchemaFromJsonSchema;
|
|
10073
|
+
var __webpack_exports__rehydrateSchemaFromJsonString = __webpack_exports__.rehydrateSchemaFromJsonString;
|
|
9016
10074
|
var __webpack_exports__resolveBulkPersistChanges = __webpack_exports__.resolveBulkPersistChanges;
|
|
9017
10075
|
var __webpack_exports__s = __webpack_exports__.s;
|
|
9018
10076
|
var __webpack_exports__stringifyObject = __webpack_exports__.stringifyObject;
|
|
@@ -9020,9 +10078,10 @@ var __webpack_exports__toEventArray = __webpack_exports__.toEventArray;
|
|
|
9020
10078
|
var __webpack_exports__toExpression = __webpack_exports__.toExpression;
|
|
9021
10079
|
var __webpack_exports__toMap = __webpack_exports__.toMap;
|
|
9022
10080
|
var __webpack_exports__toPromise = __webpack_exports__.toPromise;
|
|
10081
|
+
var __webpack_exports__toSql = __webpack_exports__.toSql;
|
|
9023
10082
|
var __webpack_exports__unsafeCast = __webpack_exports__.unsafeCast;
|
|
9024
10083
|
var __webpack_exports__uuid = __webpack_exports__.uuid;
|
|
9025
10084
|
var __webpack_exports__uuidv4 = __webpack_exports__.uuidv4;
|
|
9026
|
-
export { __webpack_exports__AndBuilder as AndBuilder, __webpack_exports__ArrayBuilder as ArrayBuilder, __webpack_exports__AssignmentBuilder as AssignmentBuilder, __webpack_exports__Block as Block, __webpack_exports__BulkPersistChanges as BulkPersistChanges, __webpack_exports__BulkPersistResult as BulkPersistResult, __webpack_exports__Capability as Capability, __webpack_exports__CodeBuilder as CodeBuilder, __webpack_exports__ComparatorExpression as ComparatorExpression, __webpack_exports__ContainerBlock as ContainerBlock, __webpack_exports__DataTranslator as DataTranslator, __webpack_exports__EmptyExpression as EmptyExpression, __webpack_exports__EphemeralDataPlugin as EphemeralDataPlugin, __webpack_exports__Expression as Expression, __webpack_exports__FunctionBuilder as FunctionBuilder, __webpack_exports__FunctionFactoryBuilder as FunctionFactoryBuilder, __webpack_exports__HashType as HashType, __webpack_exports__IdSet as IdSet, __webpack_exports__IfBuilder as IfBuilder, __webpack_exports__JsonTranslator as JsonTranslator, __webpack_exports__MemoryDataCollection as MemoryDataCollection, __webpack_exports__NotParsableExpression as NotParsableExpression, __webpack_exports__ObjectBuilder as ObjectBuilder, __webpack_exports__OperatorExpression as OperatorExpression,
|
|
10085
|
+
export { __webpack_exports__AndBuilder as AndBuilder, __webpack_exports__ArrayBuilder as ArrayBuilder, __webpack_exports__AssignmentBuilder as AssignmentBuilder, __webpack_exports__Block as Block, __webpack_exports__BulkPersistChanges as BulkPersistChanges, __webpack_exports__BulkPersistResult as BulkPersistResult, __webpack_exports__Capability as Capability, __webpack_exports__CodeBuilder as CodeBuilder, __webpack_exports__ComparatorExpression as ComparatorExpression, __webpack_exports__ContainerBlock as ContainerBlock, __webpack_exports__DataTranslator as DataTranslator, __webpack_exports__EXPRESSION_TYPES as EXPRESSION_TYPES, __webpack_exports__EmptyExpression as EmptyExpression, __webpack_exports__EphemeralDataPlugin as EphemeralDataPlugin, __webpack_exports__Expression as Expression, __webpack_exports__FunctionBuilder as FunctionBuilder, __webpack_exports__FunctionFactoryBuilder as FunctionFactoryBuilder, __webpack_exports__HashType as HashType, __webpack_exports__IdSet as IdSet, __webpack_exports__IfBuilder as IfBuilder, __webpack_exports__JsonTranslator as JsonTranslator, __webpack_exports__MemoryDataCollection as MemoryDataCollection, __webpack_exports__NotParsableExpression as NotParsableExpression, __webpack_exports__ObjectBuilder as ObjectBuilder, __webpack_exports__OperatorExpression as OperatorExpression, __webpack_exports__PerformanceCapability as PerformanceCapability, __webpack_exports__PluginEventResult as PluginEventResult, __webpack_exports__PropertyExpression as PropertyExpression, __webpack_exports__PropertyInfo as PropertyInfo, __webpack_exports__Query as Query, __webpack_exports__QueryOptionsCollection as QueryOptionsCollection, __webpack_exports__QueryOrdering as QueryOrdering, __webpack_exports__RawBuilder as RawBuilder, __webpack_exports__ReadonlySchemaCollection as ReadonlySchemaCollection, __webpack_exports__Result as Result, __webpack_exports__SchemaArray as SchemaArray, __webpack_exports__SchemaBase as SchemaBase, __webpack_exports__SchemaBoolean as SchemaBoolean, __webpack_exports__SchemaCollection as SchemaCollection, __webpack_exports__SchemaComputed as SchemaComputed, __webpack_exports__SchemaDate as SchemaDate, __webpack_exports__SchemaDefault as SchemaDefault, __webpack_exports__SchemaDefinition as SchemaDefinition, __webpack_exports__SchemaDeserialize as SchemaDeserialize, __webpack_exports__SchemaDistinct as SchemaDistinct, __webpack_exports__SchemaError as SchemaError, __webpack_exports__SchemaForeignKey as SchemaForeignKey, __webpack_exports__SchemaFrom as SchemaFrom, __webpack_exports__SchemaFunction as SchemaFunction, __webpack_exports__SchemaIdentity as SchemaIdentity, __webpack_exports__SchemaIndex as SchemaIndex, __webpack_exports__SchemaKey as SchemaKey, __webpack_exports__SchemaNullable as SchemaNullable, __webpack_exports__SchemaNumber as SchemaNumber, __webpack_exports__SchemaObject as SchemaObject, __webpack_exports__SchemaOptional as SchemaOptional, __webpack_exports__SchemaPersistChanges as SchemaPersistChanges, __webpack_exports__SchemaPersistResult as SchemaPersistResult, __webpack_exports__SchemaReadonly as SchemaReadonly, __webpack_exports__SchemaSerialize as SchemaSerialize, __webpack_exports__SchemaString as SchemaString, __webpack_exports__SchemaTag as SchemaTag, __webpack_exports__SchemaTracked as SchemaTracked, __webpack_exports__SchemaTypes as SchemaTypes, __webpack_exports__SlotBlock as SlotBlock, __webpack_exports__SqlTranslator as SqlTranslator, __webpack_exports__StringBuilder as StringBuilder, __webpack_exports__SyncronousQueue as SyncronousQueue, __webpack_exports__TagCollection as TagCollection, __webpack_exports__TracingCapability as TracingCapability, __webpack_exports__TrampolinePipeline as TrampolinePipeline, __webpack_exports__TranslatedArrayValue as TranslatedArrayValue, __webpack_exports__TranslatedGroupValue as TranslatedGroupValue, __webpack_exports__TranslatedSingleValue as TranslatedSingleValue, __webpack_exports__ValueExpression as ValueExpression, __webpack_exports__VariableBuilder as VariableBuilder, __webpack_exports__WorkPipeline as WorkPipeline, __webpack_exports__assertDate as assertDate, __webpack_exports__assertInstanceOf as assertInstanceOf, __webpack_exports__assertIsArray as assertIsArray, __webpack_exports__assertIsNotNull as assertIsNotNull, __webpack_exports__assertIsNumber as assertIsNumber, __webpack_exports__assertString as assertString, __webpack_exports__cast as cast, __webpack_exports__clone as clone, __webpack_exports__combineExpressions as combineExpressions, __webpack_exports__combineQueryOptionsCollections as combineQueryOptionsCollections, __webpack_exports__compiledSchemaToJsonSchema as compiledSchemaToJsonSchema, __webpack_exports__createStandardJsonSchemaProps as createStandardJsonSchemaProps, __webpack_exports__extractTypeInfo as extractTypeInfo, __webpack_exports__fastHash as fastHash, __webpack_exports__forEach as forEach, __webpack_exports__getDialect as getDialect, __webpack_exports__getProperties as getProperties, __webpack_exports__hash as hash, __webpack_exports__isComparatorExpression as isComparatorExpression, __webpack_exports__isDate as isDate, __webpack_exports__isEmptyExpression as isEmptyExpression, __webpack_exports__isExpression as isExpression, __webpack_exports__isNodeRuntime as isNodeRuntime, __webpack_exports__isNotParsableExpression as isNotParsableExpression, __webpack_exports__isOperatorExpression as isOperatorExpression, __webpack_exports__isPropertyExpression as isPropertyExpression, __webpack_exports__isValueExpression as isValueExpression, __webpack_exports__logger as logger, __webpack_exports__measure as measure, __webpack_exports__noop as noop, __webpack_exports__now as now, __webpack_exports__propertyInfoToJsonSchema as propertyInfoToJsonSchema, __webpack_exports__rehydrateSchemaFromJsonSchema as rehydrateSchemaFromJsonSchema, __webpack_exports__rehydrateSchemaFromJsonString as rehydrateSchemaFromJsonString, __webpack_exports__resolveBulkPersistChanges as resolveBulkPersistChanges, __webpack_exports__s as s, __webpack_exports__stringifyObject as stringifyObject, __webpack_exports__toEventArray as toEventArray, __webpack_exports__toExpression as toExpression, __webpack_exports__toMap as toMap, __webpack_exports__toPromise as toPromise, __webpack_exports__toSql as toSql, __webpack_exports__unsafeCast as unsafeCast, __webpack_exports__uuid as uuid, __webpack_exports__uuidv4 as uuidv4 };
|
|
9027
10086
|
|
|
9028
10087
|
//# sourceMappingURL=index.js.map
|