@routier/core 0.1.0-rc.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assertions/index.js +4 -15
- package/dist/assertions/index.js.map +1 -1
- package/dist/capabilities/index.js +58 -97
- package/dist/capabilities/index.js.map +1 -1
- package/dist/codegen/index.js +21 -36
- package/dist/codegen/index.js.map +1 -1
- package/dist/collections/index.js +49 -92
- package/dist/collections/index.js.map +1 -1
- package/dist/errors/index.js +4 -15
- package/dist/errors/index.js.map +1 -1
- package/dist/expressions/index.js +62 -93
- package/dist/expressions/index.js.map +1 -1
- package/dist/index.js +1683 -2302
- package/dist/index.js.map +1 -1
- package/dist/performance/index.js +4 -15
- package/dist/performance/index.js.map +1 -1
- package/dist/pipeline/index.js +30 -53
- package/dist/pipeline/index.js.map +1 -1
- package/dist/plugins/index.js +260 -361
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/replication/OptimisticReplicationDbPlugin.d.ts +6 -5
- package/dist/plugins/replication/ReplicationDbPlugin.d.ts +5 -5
- package/dist/plugins/replication/types.d.ts +1 -0
- package/dist/plugins/types.d.ts +1 -1
- package/dist/results/index.js +11 -26
- package/dist/results/index.js.map +1 -1
- package/dist/schema/SchemaDefinition.d.ts +7 -6
- package/dist/schema/index.js +1073 -1490
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/testSchemas.test.d.ts +14 -14
- package/dist/schema/types.d.ts +5 -3
- package/dist/types/index.js +0 -6
- package/dist/types/index.js.map +1 -1
- package/dist/utilities/index.js +61 -124
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/types.d.ts +17 -2
- package/package.json +1 -1
- package/readme.md +1 -1
package/dist/plugins/index.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
var __webpack_modules__ = ({
|
|
2
|
-
"./src/assertions/index.ts"
|
|
3
|
-
/*!*********************************!*\
|
|
4
|
-
!*** ./src/assertions/index.ts ***!
|
|
5
|
-
\*********************************/
|
|
6
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2
|
+
"./src/assertions/index.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
7
3
|
__webpack_require__.r(__webpack_exports__);
|
|
8
4
|
__webpack_require__.d(__webpack_exports__, {
|
|
9
5
|
assertDate: () => (assertDate),
|
|
@@ -12,10 +8,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
12
8
|
assertIsNotNull: () => (assertIsNotNull),
|
|
13
9
|
assertString: () => (assertString)
|
|
14
10
|
});
|
|
15
|
-
/*
|
|
11
|
+
/* import */ var _utilities__rspack_import_0 = __webpack_require__("./src/utilities/dates.ts");
|
|
16
12
|
|
|
17
13
|
function assertDate(data) {
|
|
18
|
-
if ((0,
|
|
14
|
+
if ((0,_utilities__rspack_import_0.isDate)(data) === false) {
|
|
19
15
|
throw new TypeError('Value is not a Date');
|
|
20
16
|
}
|
|
21
17
|
}
|
|
@@ -51,12 +47,8 @@ function assertInstanceOf(value, Instance) {
|
|
|
51
47
|
}
|
|
52
48
|
|
|
53
49
|
|
|
54
|
-
}
|
|
55
|
-
"./src/collections/Changes.ts"
|
|
56
|
-
/*!************************************!*\
|
|
57
|
-
!*** ./src/collections/Changes.ts ***!
|
|
58
|
-
\************************************/
|
|
59
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
50
|
+
},
|
|
51
|
+
"./src/collections/Changes.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
60
52
|
__webpack_require__.r(__webpack_exports__);
|
|
61
53
|
__webpack_require__.d(__webpack_exports__, {
|
|
62
54
|
BulkPersistChanges: () => (BulkPersistChanges),
|
|
@@ -64,7 +56,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
64
56
|
SchemaPersistChanges: () => (SchemaPersistChanges),
|
|
65
57
|
SchemaPersistResult: () => (SchemaPersistResult)
|
|
66
58
|
});
|
|
67
|
-
/*
|
|
59
|
+
/* import */ var _TagCollection__rspack_import_0 = __webpack_require__("./src/collections/TagCollection.ts");
|
|
68
60
|
|
|
69
61
|
class BulkPersistResult extends Map {
|
|
70
62
|
resolve(schemaId) {
|
|
@@ -177,7 +169,7 @@ class SchemaPersistChanges {
|
|
|
177
169
|
adds = [];
|
|
178
170
|
updates = [];
|
|
179
171
|
removes = [];
|
|
180
|
-
tags = new
|
|
172
|
+
tags = new _TagCollection__rspack_import_0.TagCollection();
|
|
181
173
|
get hasItems() {
|
|
182
174
|
return this.total > 0;
|
|
183
175
|
}
|
|
@@ -198,12 +190,8 @@ class SchemaPersistResult {
|
|
|
198
190
|
}
|
|
199
191
|
|
|
200
192
|
|
|
201
|
-
}
|
|
202
|
-
"./src/collections/TagCollection.ts"
|
|
203
|
-
/*!******************************************!*\
|
|
204
|
-
!*** ./src/collections/TagCollection.ts ***!
|
|
205
|
-
\******************************************/
|
|
206
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
193
|
+
},
|
|
194
|
+
"./src/collections/TagCollection.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
207
195
|
__webpack_require__.r(__webpack_exports__);
|
|
208
196
|
__webpack_require__.d(__webpack_exports__, {
|
|
209
197
|
TagCollection: () => (TagCollection)
|
|
@@ -258,12 +246,8 @@ class TagCollection {
|
|
|
258
246
|
}
|
|
259
247
|
|
|
260
248
|
|
|
261
|
-
}
|
|
262
|
-
"./src/expressions/utils.ts"
|
|
263
|
-
/*!**********************************!*\
|
|
264
|
-
!*** ./src/expressions/utils.ts ***!
|
|
265
|
-
\**********************************/
|
|
266
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
249
|
+
},
|
|
250
|
+
"./src/expressions/utils.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
267
251
|
__webpack_require__.r(__webpack_exports__);
|
|
268
252
|
__webpack_require__.d(__webpack_exports__, {
|
|
269
253
|
forEach: () => (forEach),
|
|
@@ -320,18 +304,14 @@ function forEach(expression, callback) {
|
|
|
320
304
|
}
|
|
321
305
|
|
|
322
306
|
|
|
323
|
-
}
|
|
324
|
-
"./src/performance/index.ts"
|
|
325
|
-
/*!**********************************!*\
|
|
326
|
-
!*** ./src/performance/index.ts ***!
|
|
327
|
-
\**********************************/
|
|
328
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
307
|
+
},
|
|
308
|
+
"./src/performance/index.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
329
309
|
__webpack_require__.r(__webpack_exports__);
|
|
330
310
|
__webpack_require__.d(__webpack_exports__, {
|
|
331
311
|
measure: () => (measure),
|
|
332
312
|
now: () => (now)
|
|
333
313
|
});
|
|
334
|
-
/*
|
|
314
|
+
/* import */ var _utilities__rspack_import_0 = __webpack_require__("./src/utilities/logger.ts");
|
|
335
315
|
|
|
336
316
|
const measurements = {};
|
|
337
317
|
const now = () => {
|
|
@@ -350,24 +330,20 @@ const measure = {
|
|
|
350
330
|
const start = measurements[name];
|
|
351
331
|
delete measurements[name];
|
|
352
332
|
const delta = now() - start;
|
|
353
|
-
|
|
333
|
+
_utilities__rspack_import_0.logger.log(`[ROUTIER] - Performance: ${name} took ${delta}`);
|
|
354
334
|
}
|
|
355
335
|
};
|
|
356
336
|
|
|
357
337
|
|
|
358
|
-
}
|
|
359
|
-
"./src/pipeline/TrampolinePipeline.ts"
|
|
360
|
-
/*!********************************************!*\
|
|
361
|
-
!*** ./src/pipeline/TrampolinePipeline.ts ***!
|
|
362
|
-
\********************************************/
|
|
363
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
338
|
+
},
|
|
339
|
+
"./src/pipeline/TrampolinePipeline.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
364
340
|
__webpack_require__.r(__webpack_exports__);
|
|
365
341
|
__webpack_require__.d(__webpack_exports__, {
|
|
366
342
|
TrampolinePipeline: () => (TrampolinePipeline),
|
|
367
343
|
WorkPipeline: () => (WorkPipeline)
|
|
368
344
|
});
|
|
369
|
-
/*
|
|
370
|
-
/*
|
|
345
|
+
/* import */ var _utilities__rspack_import_0 = __webpack_require__("./src/utilities/logger.ts");
|
|
346
|
+
/* import */ var _results__rspack_import_1 = __webpack_require__("./src/results/Result.ts");
|
|
371
347
|
|
|
372
348
|
|
|
373
349
|
class TrampolinePipeline {
|
|
@@ -376,7 +352,7 @@ class TrampolinePipeline {
|
|
|
376
352
|
filter(initialData, done) {
|
|
377
353
|
this._hasErrored = false; // Reset error flag on new execution
|
|
378
354
|
if (this._list.length === 0) {
|
|
379
|
-
|
|
355
|
+
done(initialData);
|
|
380
356
|
return;
|
|
381
357
|
}
|
|
382
358
|
let index = 0;
|
|
@@ -387,7 +363,7 @@ class TrampolinePipeline {
|
|
|
387
363
|
const finalStepSentinel = () => {
|
|
388
364
|
// Only call done if no error has occurred
|
|
389
365
|
if (!this._hasErrored) {
|
|
390
|
-
|
|
366
|
+
done(currentData);
|
|
391
367
|
}
|
|
392
368
|
return null; // Stop the trampoline
|
|
393
369
|
};
|
|
@@ -406,7 +382,7 @@ class TrampolinePipeline {
|
|
|
406
382
|
processor(currentData, (result, error) => {
|
|
407
383
|
// --- Error Handling ---
|
|
408
384
|
if (error) {
|
|
409
|
-
|
|
385
|
+
_utilities__rspack_import_0.logger.error(`Error reported by processor at index ${idx}:`, error);
|
|
410
386
|
this._hasErrored = true; // Set flag
|
|
411
387
|
// Throw the error to be caught by outer try...catch blocks
|
|
412
388
|
throw error;
|
|
@@ -429,7 +405,7 @@ class TrampolinePipeline {
|
|
|
429
405
|
}
|
|
430
406
|
catch (error) {
|
|
431
407
|
if (!this._hasErrored) { // Check flag to avoid double logging if error was from callback
|
|
432
|
-
|
|
408
|
+
_utilities__rspack_import_0.logger.error(`Error thrown by processor at index ${idx} or its callback:`, error);
|
|
433
409
|
this._hasErrored = true;
|
|
434
410
|
}
|
|
435
411
|
// Rethrow to be caught by the trampoline's catch block
|
|
@@ -452,7 +428,7 @@ class TrampolinePipeline {
|
|
|
452
428
|
}
|
|
453
429
|
isRunning = true;
|
|
454
430
|
let currentStep = step;
|
|
455
|
-
while (
|
|
431
|
+
while (currentStep !== null) {
|
|
456
432
|
try {
|
|
457
433
|
// Stop immediately if an error was flagged elsewhere
|
|
458
434
|
if (this._hasErrored) {
|
|
@@ -464,7 +440,7 @@ class TrampolinePipeline {
|
|
|
464
440
|
catch (trampolineError) {
|
|
465
441
|
// Catch errors propagated from step execution (processor or callback errors)
|
|
466
442
|
if (!this._hasErrored) { // Avoid double logging
|
|
467
|
-
|
|
443
|
+
_utilities__rspack_import_0.logger.error("Error during trampoline step execution:", trampolineError);
|
|
468
444
|
this._hasErrored = true;
|
|
469
445
|
}
|
|
470
446
|
currentStep = null; // Stop the loop
|
|
@@ -493,7 +469,7 @@ class TrampolinePipeline {
|
|
|
493
469
|
pipeEach(items, fn, map) {
|
|
494
470
|
for (let i = 0, length = items.length; i < length; i++) {
|
|
495
471
|
this.pipe((previous, done) => {
|
|
496
|
-
fn(map(previous,
|
|
472
|
+
fn(map(previous, _results__rspack_import_1.Result.success(items[i])), done);
|
|
497
473
|
});
|
|
498
474
|
}
|
|
499
475
|
}
|
|
@@ -511,7 +487,7 @@ class WorkPipeline {
|
|
|
511
487
|
filter(done) {
|
|
512
488
|
this._hasErrored = false; // Reset error flag on new execution
|
|
513
489
|
if (this.unitsOfWork.length === 0) {
|
|
514
|
-
|
|
490
|
+
done(_results__rspack_import_1.Result.success());
|
|
515
491
|
return;
|
|
516
492
|
}
|
|
517
493
|
let index = 0;
|
|
@@ -521,7 +497,7 @@ class WorkPipeline {
|
|
|
521
497
|
const finalStepSentinel = () => {
|
|
522
498
|
// Only call done if no error has occurred
|
|
523
499
|
if (!this._hasErrored) {
|
|
524
|
-
|
|
500
|
+
done(_results__rspack_import_1.Result.success());
|
|
525
501
|
}
|
|
526
502
|
return null; // Stop the trampoline
|
|
527
503
|
};
|
|
@@ -539,8 +515,8 @@ class WorkPipeline {
|
|
|
539
515
|
try {
|
|
540
516
|
processor((result) => {
|
|
541
517
|
// --- Error Handling ---
|
|
542
|
-
if (result.ok ===
|
|
543
|
-
|
|
518
|
+
if (result.ok === _results__rspack_import_1.Result.ERROR) {
|
|
519
|
+
_utilities__rspack_import_0.logger.error(`Error reported by AsyncPipeline at index ${idx}:`, result.error);
|
|
544
520
|
this._hasErrored = true; // Set flag
|
|
545
521
|
// Throw the error to be caught by outer try...catch blocks
|
|
546
522
|
throw result.error;
|
|
@@ -562,7 +538,7 @@ class WorkPipeline {
|
|
|
562
538
|
}
|
|
563
539
|
catch (error) {
|
|
564
540
|
if (!this._hasErrored) { // Check flag to avoid double logging if error was from callback
|
|
565
|
-
|
|
541
|
+
_utilities__rspack_import_0.logger.error(`Error thrown by processor at index ${idx} or its callback:`, error);
|
|
566
542
|
this._hasErrored = true;
|
|
567
543
|
}
|
|
568
544
|
// Rethrow to be caught by the trampoline's catch block
|
|
@@ -585,7 +561,7 @@ class WorkPipeline {
|
|
|
585
561
|
}
|
|
586
562
|
isRunning = true;
|
|
587
563
|
let currentStep = step;
|
|
588
|
-
while (
|
|
564
|
+
while (currentStep !== null) {
|
|
589
565
|
try {
|
|
590
566
|
// Stop immediately if an error was flagged elsewhere
|
|
591
567
|
if (this._hasErrored) {
|
|
@@ -597,7 +573,7 @@ class WorkPipeline {
|
|
|
597
573
|
catch (trampolineError) {
|
|
598
574
|
// Catch errors propagated from step execution (processor or callback errors)
|
|
599
575
|
if (!this._hasErrored) { // Avoid double logging
|
|
600
|
-
|
|
576
|
+
_utilities__rspack_import_0.logger.error("Error during trampoline step execution:", trampolineError);
|
|
601
577
|
this._hasErrored = true;
|
|
602
578
|
}
|
|
603
579
|
currentStep = null; // Stop the loop
|
|
@@ -615,7 +591,7 @@ class WorkPipeline {
|
|
|
615
591
|
trampoline(createStepRevised(0)); // Start with the revised step creator
|
|
616
592
|
}
|
|
617
593
|
catch (error) {
|
|
618
|
-
done(
|
|
594
|
+
done(_results__rspack_import_1.Result.error(error));
|
|
619
595
|
}
|
|
620
596
|
}
|
|
621
597
|
pipe(work) {
|
|
@@ -624,20 +600,16 @@ class WorkPipeline {
|
|
|
624
600
|
}
|
|
625
601
|
|
|
626
602
|
|
|
627
|
-
}
|
|
628
|
-
"./src/plugins/EphemeralDataPlugin.ts"
|
|
629
|
-
/*!********************************************!*\
|
|
630
|
-
!*** ./src/plugins/EphemeralDataPlugin.ts ***!
|
|
631
|
-
\********************************************/
|
|
632
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
603
|
+
},
|
|
604
|
+
"./src/plugins/EphemeralDataPlugin.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
633
605
|
__webpack_require__.r(__webpack_exports__);
|
|
634
606
|
__webpack_require__.d(__webpack_exports__, {
|
|
635
607
|
EphemeralDataPlugin: () => (EphemeralDataPlugin)
|
|
636
608
|
});
|
|
637
|
-
/*
|
|
638
|
-
/*
|
|
639
|
-
/*
|
|
640
|
-
/*
|
|
609
|
+
/* import */ var _assertions__rspack_import_1 = __webpack_require__("./src/assertions/index.ts");
|
|
610
|
+
/* import */ var _pipeline__rspack_import_0 = __webpack_require__("./src/pipeline/TrampolinePipeline.ts");
|
|
611
|
+
/* import */ var ___rspack_import_3 = __webpack_require__("./src/plugins/translators/JsonTranslator.ts");
|
|
612
|
+
/* import */ var _results__rspack_import_2 = __webpack_require__("./src/results/Result.ts");
|
|
641
613
|
|
|
642
614
|
|
|
643
615
|
|
|
@@ -651,7 +623,7 @@ class EphemeralDataPlugin {
|
|
|
651
623
|
try {
|
|
652
624
|
const bulkPersistResult = event.operation.toResult();
|
|
653
625
|
const schemas = event.schemas;
|
|
654
|
-
const pipeline = new
|
|
626
|
+
const pipeline = new _pipeline__rspack_import_0.WorkPipeline();
|
|
655
627
|
let hasWork = false;
|
|
656
628
|
for (const [schemaId, changes] of event.operation) {
|
|
657
629
|
const { adds, hasItems, removes, updates } = changes;
|
|
@@ -661,18 +633,17 @@ class EphemeralDataPlugin {
|
|
|
661
633
|
hasWork = true;
|
|
662
634
|
const result = bulkPersistResult.get(schemaId);
|
|
663
635
|
const schema = schemas.get(schemaId);
|
|
664
|
-
(0,
|
|
636
|
+
(0,_assertions__rspack_import_1.assertIsNotNull)(schema);
|
|
665
637
|
pipeline.pipe((d) => {
|
|
666
638
|
try {
|
|
667
639
|
const collection = this.resolveCollection(schema);
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
const removesLength = removes.length;
|
|
640
|
+
const addsLength = adds.length;
|
|
641
|
+
const updatesLength = updates.length;
|
|
642
|
+
const removesLength = removes.length;
|
|
643
|
+
// Only need to load if we have updates or removes (need existing data)
|
|
644
|
+
// For adds-only operations, we can skip load for better performance
|
|
645
|
+
const needsLoad = updatesLength > 0 || removesLength > 0;
|
|
646
|
+
const processChanges = () => {
|
|
676
647
|
result.adds = new Array(addsLength);
|
|
677
648
|
result.updates = new Array(updatesLength);
|
|
678
649
|
result.removes = new Array(removesLength);
|
|
@@ -691,45 +662,58 @@ class EphemeralDataPlugin {
|
|
|
691
662
|
result.removes[j] = removes[j];
|
|
692
663
|
}
|
|
693
664
|
collection.save(saveResult => {
|
|
694
|
-
if (saveResult.ok ===
|
|
665
|
+
if (saveResult.ok === _results__rspack_import_2.Result.ERROR) {
|
|
695
666
|
d(saveResult);
|
|
696
667
|
return;
|
|
697
668
|
}
|
|
698
|
-
d(
|
|
669
|
+
d(_results__rspack_import_2.Result.success());
|
|
699
670
|
});
|
|
700
|
-
}
|
|
671
|
+
};
|
|
672
|
+
if (needsLoad) {
|
|
673
|
+
collection.load(readResult => {
|
|
674
|
+
if (readResult.ok === _results__rspack_import_2.Result.ERROR) {
|
|
675
|
+
d(readResult);
|
|
676
|
+
return;
|
|
677
|
+
}
|
|
678
|
+
processChanges();
|
|
679
|
+
});
|
|
680
|
+
}
|
|
681
|
+
else {
|
|
682
|
+
// Skip load for adds-only operations
|
|
683
|
+
processChanges();
|
|
684
|
+
}
|
|
701
685
|
}
|
|
702
686
|
catch (e) {
|
|
703
|
-
d(
|
|
687
|
+
d(_results__rspack_import_2.Result.error(e));
|
|
704
688
|
}
|
|
705
689
|
});
|
|
706
690
|
}
|
|
707
691
|
// If there is no work, just return the result
|
|
708
692
|
if (!hasWork) {
|
|
709
|
-
done(
|
|
693
|
+
done(_results__rspack_import_2.PluginEventResult.success(event.id, bulkPersistResult));
|
|
710
694
|
return;
|
|
711
695
|
}
|
|
712
696
|
pipeline.filter((result) => {
|
|
713
|
-
if (result.ok ===
|
|
714
|
-
done(
|
|
697
|
+
if (result.ok === _results__rspack_import_2.Result.ERROR) {
|
|
698
|
+
done(_results__rspack_import_2.PluginEventResult.error(event.id, result.error));
|
|
715
699
|
return;
|
|
716
700
|
}
|
|
717
|
-
done(
|
|
701
|
+
done(_results__rspack_import_2.PluginEventResult.success(event.id, bulkPersistResult));
|
|
718
702
|
});
|
|
719
703
|
}
|
|
720
704
|
catch (e) {
|
|
721
|
-
done(
|
|
705
|
+
done(_results__rspack_import_2.PluginEventResult.error(event.id, e));
|
|
722
706
|
}
|
|
723
707
|
}
|
|
724
708
|
query(event, done) {
|
|
725
709
|
try {
|
|
726
710
|
const operation = event.operation;
|
|
727
711
|
const schema = operation.schema;
|
|
728
|
-
const translator = new
|
|
712
|
+
const translator = new ___rspack_import_3.JsonTranslator(operation);
|
|
729
713
|
const collection = this.resolveCollection(schema);
|
|
730
714
|
collection.load(r => {
|
|
731
|
-
if (r.ok ===
|
|
732
|
-
done(
|
|
715
|
+
if (r.ok === _results__rspack_import_2.Result.ERROR) {
|
|
716
|
+
done(_results__rspack_import_2.PluginEventResult.error(event.id, r.error));
|
|
733
717
|
return;
|
|
734
718
|
}
|
|
735
719
|
const records = collection.records;
|
|
@@ -738,27 +722,23 @@ class EphemeralDataPlugin {
|
|
|
738
722
|
for (let i = 0; i < length; i++) {
|
|
739
723
|
cloned[i] = schema.clone(records[i]);
|
|
740
724
|
}
|
|
741
|
-
done(
|
|
725
|
+
done(_results__rspack_import_2.PluginEventResult.success(event.id, translator.translate(cloned)));
|
|
742
726
|
});
|
|
743
727
|
}
|
|
744
728
|
catch (e) {
|
|
745
|
-
done(
|
|
729
|
+
done(_results__rspack_import_2.PluginEventResult.error(event.id, e));
|
|
746
730
|
}
|
|
747
731
|
}
|
|
748
732
|
}
|
|
749
733
|
|
|
750
734
|
|
|
751
|
-
}
|
|
752
|
-
"./src/plugins/query/Query.ts"
|
|
753
|
-
/*!************************************!*\
|
|
754
|
-
!*** ./src/plugins/query/Query.ts ***!
|
|
755
|
-
\************************************/
|
|
756
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
735
|
+
},
|
|
736
|
+
"./src/plugins/query/Query.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
757
737
|
__webpack_require__.r(__webpack_exports__);
|
|
758
738
|
__webpack_require__.d(__webpack_exports__, {
|
|
759
739
|
Query: () => (Query)
|
|
760
740
|
});
|
|
761
|
-
/*
|
|
741
|
+
/* import */ var _QueryOptionsCollection__rspack_import_0 = __webpack_require__("./src/plugins/query/QueryOptionsCollection.ts");
|
|
762
742
|
|
|
763
743
|
class Query {
|
|
764
744
|
options;
|
|
@@ -791,10 +771,10 @@ class Query {
|
|
|
791
771
|
return true;
|
|
792
772
|
}
|
|
793
773
|
static EMPTY(schema) {
|
|
794
|
-
return new Query(
|
|
774
|
+
return new Query(_QueryOptionsCollection__rspack_import_0.QueryOptionsCollection.EMPTY(), schema);
|
|
795
775
|
}
|
|
796
776
|
static isEmpty(query) {
|
|
797
|
-
return
|
|
777
|
+
return _QueryOptionsCollection__rspack_import_0.QueryOptionsCollection.isEmpty(query.options);
|
|
798
778
|
}
|
|
799
779
|
static toString(query) {
|
|
800
780
|
return JSON.stringify({
|
|
@@ -809,17 +789,13 @@ class Query {
|
|
|
809
789
|
}
|
|
810
790
|
|
|
811
791
|
|
|
812
|
-
}
|
|
813
|
-
"./src/plugins/query/QueryOptionsCollection.ts"
|
|
814
|
-
/*!*****************************************************!*\
|
|
815
|
-
!*** ./src/plugins/query/QueryOptionsCollection.ts ***!
|
|
816
|
-
\*****************************************************/
|
|
817
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
792
|
+
},
|
|
793
|
+
"./src/plugins/query/QueryOptionsCollection.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
818
794
|
__webpack_require__.r(__webpack_exports__);
|
|
819
795
|
__webpack_require__.d(__webpack_exports__, {
|
|
820
796
|
QueryOptionsCollection: () => (QueryOptionsCollection)
|
|
821
797
|
});
|
|
822
|
-
/*
|
|
798
|
+
/* import */ var _expressions_utils__rspack_import_0 = __webpack_require__("./src/expressions/utils.ts");
|
|
823
799
|
|
|
824
800
|
class QueryOptionsCollection {
|
|
825
801
|
options = new Map();
|
|
@@ -856,8 +832,8 @@ class QueryOptionsCollection {
|
|
|
856
832
|
this.nextExecutionTarget = "memory";
|
|
857
833
|
}
|
|
858
834
|
else {
|
|
859
|
-
(0,
|
|
860
|
-
if ((0,
|
|
835
|
+
(0,_expressions_utils__rspack_import_0.forEach)(filterValue.expression, (expression) => {
|
|
836
|
+
if ((0,_expressions_utils__rspack_import_0.isPropertyExpression)(expression) && expression.property.isUnmapped) {
|
|
861
837
|
// Cut over to memory execution, unmapped properties are not in the database and
|
|
862
838
|
// cannot be queried
|
|
863
839
|
this.nextExecutionTarget = "memory";
|
|
@@ -937,32 +913,24 @@ class QueryOptionsCollection {
|
|
|
937
913
|
}
|
|
938
914
|
|
|
939
915
|
|
|
940
|
-
}
|
|
941
|
-
"./src/plugins/query/index.ts"
|
|
942
|
-
/*!************************************!*\
|
|
943
|
-
!*** ./src/plugins/query/index.ts ***!
|
|
944
|
-
\************************************/
|
|
945
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
916
|
+
},
|
|
917
|
+
"./src/plugins/query/index.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
946
918
|
__webpack_require__.r(__webpack_exports__);
|
|
947
919
|
__webpack_require__.d(__webpack_exports__, {
|
|
948
|
-
Query: () => (/* reexport safe */
|
|
949
|
-
QueryOptionsCollection: () => (/* reexport safe */
|
|
950
|
-
QueryOrdering: () => (/* reexport safe */
|
|
920
|
+
Query: () => (/* reexport safe */ _Query__rspack_import_0.Query),
|
|
921
|
+
QueryOptionsCollection: () => (/* reexport safe */ _QueryOptionsCollection__rspack_import_1.QueryOptionsCollection),
|
|
922
|
+
QueryOrdering: () => (/* reexport safe */ _types__rspack_import_2.QueryOrdering)
|
|
951
923
|
});
|
|
952
|
-
/*
|
|
953
|
-
/*
|
|
954
|
-
/*
|
|
924
|
+
/* import */ var _Query__rspack_import_0 = __webpack_require__("./src/plugins/query/Query.ts");
|
|
925
|
+
/* import */ var _QueryOptionsCollection__rspack_import_1 = __webpack_require__("./src/plugins/query/QueryOptionsCollection.ts");
|
|
926
|
+
/* import */ var _types__rspack_import_2 = __webpack_require__("./src/plugins/query/types.ts");
|
|
955
927
|
|
|
956
928
|
|
|
957
929
|
|
|
958
930
|
|
|
959
931
|
|
|
960
|
-
}
|
|
961
|
-
"./src/plugins/query/types.ts"
|
|
962
|
-
/*!************************************!*\
|
|
963
|
-
!*** ./src/plugins/query/types.ts ***!
|
|
964
|
-
\************************************/
|
|
965
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
932
|
+
},
|
|
933
|
+
"./src/plugins/query/types.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
966
934
|
__webpack_require__.r(__webpack_exports__);
|
|
967
935
|
__webpack_require__.d(__webpack_exports__, {
|
|
968
936
|
QueryOrdering: () => (QueryOrdering)
|
|
@@ -974,23 +942,19 @@ var QueryOrdering;
|
|
|
974
942
|
})(QueryOrdering || (QueryOrdering = {}));
|
|
975
943
|
|
|
976
944
|
|
|
977
|
-
}
|
|
978
|
-
"./src/plugins/replication/OptimisticReplicationDbPlugin.ts"
|
|
979
|
-
/*!******************************************************************!*\
|
|
980
|
-
!*** ./src/plugins/replication/OptimisticReplicationDbPlugin.ts ***!
|
|
981
|
-
\******************************************************************/
|
|
982
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
945
|
+
},
|
|
946
|
+
"./src/plugins/replication/OptimisticReplicationDbPlugin.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
983
947
|
__webpack_require__.r(__webpack_exports__);
|
|
984
948
|
__webpack_require__.d(__webpack_exports__, {
|
|
985
949
|
OptimisticReplicationDbPlugin: () => (OptimisticReplicationDbPlugin)
|
|
986
950
|
});
|
|
987
|
-
/*
|
|
988
|
-
/*
|
|
989
|
-
/*
|
|
990
|
-
/*
|
|
991
|
-
/*
|
|
992
|
-
/*
|
|
993
|
-
/*
|
|
951
|
+
/* import */ var _results__rspack_import_2 = __webpack_require__("./src/results/Result.ts");
|
|
952
|
+
/* import */ var _pipeline__rspack_import_5 = __webpack_require__("./src/pipeline/TrampolinePipeline.ts");
|
|
953
|
+
/* import */ var _query__rspack_import_1 = __webpack_require__("./src/plugins/query/Query.ts");
|
|
954
|
+
/* import */ var _utilities__rspack_import_0 = __webpack_require__("./src/utilities/uuid.ts");
|
|
955
|
+
/* import */ var _utilities__rspack_import_6 = __webpack_require__("./src/utilities/replication.ts");
|
|
956
|
+
/* import */ var _collections__rspack_import_3 = __webpack_require__("./src/collections/Changes.ts");
|
|
957
|
+
/* import */ var _performance__rspack_import_4 = __webpack_require__("./src/performance/index.ts");
|
|
994
958
|
|
|
995
959
|
|
|
996
960
|
7;
|
|
@@ -1006,21 +970,21 @@ const getMemoryPluginCollectionSize = (plugin, schema) => {
|
|
|
1006
970
|
};
|
|
1007
971
|
const MAX_HYDRATION_WAIT_MS = 60_000; // 60 seconds max wait
|
|
1008
972
|
const HYDRATION_POLL_INTERVAL_MS = 10; // Check ever 10 ms
|
|
1009
|
-
let hydrationStatus = "hydration-not-started";
|
|
1010
973
|
class OptimisticReplicationDbPlugin {
|
|
1011
974
|
plugins;
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
975
|
+
// Give more control over hydration, if the plugin is destroyed, so is the in memory data.
|
|
976
|
+
// It is up to the dev to control the lifecycle
|
|
977
|
+
collectionHydrationStatuses = new Map();
|
|
1015
978
|
/**
|
|
1016
979
|
* Creates a new OptimisticDbPluginReplicator that coordinates operations between a source database and its replicas.
|
|
1017
980
|
*
|
|
1018
|
-
* @param
|
|
1019
|
-
* @param
|
|
1020
|
-
* @
|
|
981
|
+
* @param plugins Configuration object containing the source, read, and replica database plugins
|
|
982
|
+
* @param plugins.source The primary database plugin that will receive all operations first
|
|
983
|
+
* @param plugins.read The read-optimized plugin (typically a memory plugin) used for fast queries
|
|
984
|
+
* @param plugins.replicas Additional database plugins that will replicate operations from the source
|
|
1021
985
|
*/
|
|
1022
|
-
|
|
1023
|
-
|
|
986
|
+
constructor(plugins) {
|
|
987
|
+
this.plugins = plugins;
|
|
1024
988
|
}
|
|
1025
989
|
/**
|
|
1026
990
|
* Will query the read plugin if there is one, otherwise the source plugin will be queried
|
|
@@ -1030,78 +994,78 @@ class OptimisticReplicationDbPlugin {
|
|
|
1030
994
|
const readPlugin = this.plugins.read;
|
|
1031
995
|
const sourcePlugin = this.plugins.source;
|
|
1032
996
|
const collectionSize = getMemoryPluginCollectionSize(this.plugins.read, event.operation.schema);
|
|
1033
|
-
if (collectionSize === 0 &&
|
|
997
|
+
if (collectionSize === 0 && this.collectionHydrationStatuses.get(event.operation.schema.collectionName) == null) {
|
|
1034
998
|
// Notify the cache that the db was hydrated right away
|
|
1035
|
-
|
|
999
|
+
this.collectionHydrationStatuses.set(event.operation.schema.collectionName, "pending");
|
|
1036
1000
|
// nothing is hydrated, let's try and hydrate before querying
|
|
1037
1001
|
// Memory plugin might not be hydrated, lets hydrate it for the targeted schema only,
|
|
1038
1002
|
// Other queries will do the same and hydrate if needed
|
|
1039
1003
|
// We want to select all data here
|
|
1040
1004
|
sourcePlugin.query({
|
|
1041
|
-
id: (0,
|
|
1005
|
+
id: (0,_utilities__rspack_import_0.uuid)(8),
|
|
1042
1006
|
schemas: event.schemas,
|
|
1043
1007
|
source: "collection",
|
|
1044
1008
|
// Select All Data
|
|
1045
|
-
operation:
|
|
1009
|
+
operation: _query__rspack_import_1.Query.EMPTY(event.operation.schema)
|
|
1046
1010
|
}, (sourceResult) => {
|
|
1047
|
-
if (sourceResult.ok ===
|
|
1011
|
+
if (sourceResult.ok === _results__rspack_import_2.Result.ERROR) {
|
|
1048
1012
|
// Notify that hydration failed
|
|
1049
|
-
|
|
1013
|
+
this.collectionHydrationStatuses.set(event.operation.schema.collectionName, "rejected");
|
|
1050
1014
|
done(sourceResult);
|
|
1051
1015
|
return;
|
|
1052
1016
|
}
|
|
1053
1017
|
// Source plugin can have no data, still should succeed
|
|
1054
1018
|
if (Array.isArray(sourceResult.data.value) === false) {
|
|
1055
1019
|
// Notify that hydration failed
|
|
1056
|
-
|
|
1057
|
-
done(
|
|
1020
|
+
this.collectionHydrationStatuses.set(event.operation.schema.collectionName, "rejected");
|
|
1021
|
+
done(_results__rspack_import_2.PluginEventResult.error(event.id, "Query result is not an array"));
|
|
1058
1022
|
return;
|
|
1059
1023
|
}
|
|
1060
|
-
const changesCollection = new
|
|
1024
|
+
const changesCollection = new _collections__rspack_import_3.BulkPersistChanges();
|
|
1061
1025
|
const schemaChanges = changesCollection.resolve(event.operation.schema.id);
|
|
1062
1026
|
// Add the existing items into the persist payload as adds
|
|
1063
1027
|
schemaChanges.adds = sourceResult.data.value;
|
|
1064
1028
|
readPlugin.bulkPersist({
|
|
1065
|
-
id: (0,
|
|
1029
|
+
id: (0,_utilities__rspack_import_0.uuid)(8),
|
|
1066
1030
|
schemas: event.schemas,
|
|
1067
1031
|
operation: changesCollection,
|
|
1068
1032
|
source: "collection",
|
|
1069
1033
|
}, (readPersistResult) => {
|
|
1070
|
-
if (readPersistResult.ok ===
|
|
1034
|
+
if (readPersistResult.ok === _results__rspack_import_2.Result.ERROR) {
|
|
1071
1035
|
// Notify that hydration failed
|
|
1072
|
-
|
|
1036
|
+
this.collectionHydrationStatuses.set(event.operation.schema.collectionName, "rejected");
|
|
1073
1037
|
done(readPersistResult);
|
|
1074
1038
|
return;
|
|
1075
1039
|
}
|
|
1076
|
-
|
|
1040
|
+
this.collectionHydrationStatuses.set(event.operation.schema.collectionName, "fulfilled");
|
|
1077
1041
|
// requery the read plugin
|
|
1078
1042
|
readPlugin.query(event, done);
|
|
1079
1043
|
});
|
|
1080
1044
|
});
|
|
1081
1045
|
return;
|
|
1082
1046
|
}
|
|
1083
|
-
if (
|
|
1084
|
-
done(
|
|
1047
|
+
if (this.collectionHydrationStatuses.get(event.operation.schema.collectionName) === "rejected") {
|
|
1048
|
+
done(_results__rspack_import_2.PluginEventResult.error(event.id, "Hydration failed, unable to query read plugin"));
|
|
1085
1049
|
return;
|
|
1086
1050
|
}
|
|
1087
1051
|
// If hydration is pending, do not query empty collection, wait for hydration
|
|
1088
|
-
if (
|
|
1089
|
-
const start = (0,
|
|
1052
|
+
if (this.collectionHydrationStatuses.get(event.operation.schema.collectionName) === "pending") {
|
|
1053
|
+
const start = (0,_performance__rspack_import_4.now)();
|
|
1090
1054
|
const pollHydrationStatus = () => {
|
|
1091
|
-
const delta = (0,
|
|
1055
|
+
const delta = (0,_performance__rspack_import_4.now)() - start;
|
|
1092
1056
|
if (delta > MAX_HYDRATION_WAIT_MS) {
|
|
1093
|
-
|
|
1094
|
-
done(
|
|
1057
|
+
this.collectionHydrationStatuses.set(event.operation.schema.collectionName, "rejected");
|
|
1058
|
+
done(_results__rspack_import_2.PluginEventResult.error(event.id, `Hydration timeout: exceeded maximum wait time of ${MAX_HYDRATION_WAIT_MS}ms`));
|
|
1095
1059
|
return;
|
|
1096
1060
|
}
|
|
1097
|
-
if (
|
|
1098
|
-
done(
|
|
1061
|
+
if (this.collectionHydrationStatuses.get(event.operation.schema.collectionName) === "rejected") {
|
|
1062
|
+
done(_results__rspack_import_2.PluginEventResult.error(event.id, "Hydration failed, unable to query read plugin"));
|
|
1099
1063
|
return;
|
|
1100
1064
|
}
|
|
1101
|
-
if (
|
|
1065
|
+
if (this.collectionHydrationStatuses.get(event.operation.schema.collectionName) === "fulfilled") {
|
|
1102
1066
|
// Hydration completed successfully, proceed with query
|
|
1103
1067
|
readPlugin.query(event, (readResult) => {
|
|
1104
|
-
if (readResult.ok ===
|
|
1068
|
+
if (readResult.ok === _results__rspack_import_2.Result.ERROR) {
|
|
1105
1069
|
done(readResult);
|
|
1106
1070
|
return;
|
|
1107
1071
|
}
|
|
@@ -1117,7 +1081,7 @@ class OptimisticReplicationDbPlugin {
|
|
|
1117
1081
|
}
|
|
1118
1082
|
// Collection is hydrated for the targeted collection and should be in sync
|
|
1119
1083
|
readPlugin.query(event, (readResult) => {
|
|
1120
|
-
if (readResult.ok ===
|
|
1084
|
+
if (readResult.ok === _results__rspack_import_2.Result.ERROR) {
|
|
1121
1085
|
done(readResult);
|
|
1122
1086
|
return;
|
|
1123
1087
|
}
|
|
@@ -1126,65 +1090,65 @@ class OptimisticReplicationDbPlugin {
|
|
|
1126
1090
|
});
|
|
1127
1091
|
}
|
|
1128
1092
|
catch (e) {
|
|
1129
|
-
done(
|
|
1093
|
+
done(_results__rspack_import_2.PluginEventResult.error(event.id, e));
|
|
1130
1094
|
}
|
|
1131
1095
|
}
|
|
1132
1096
|
destroy(event, done) {
|
|
1133
1097
|
try {
|
|
1134
|
-
const workPipeline = new
|
|
1098
|
+
const workPipeline = new _pipeline__rspack_import_5.WorkPipeline();
|
|
1135
1099
|
const plugins = [this.plugins.source, ...this.plugins.replicas];
|
|
1136
1100
|
for (let i = 0, length = plugins.length; i < length; i++) {
|
|
1137
1101
|
workPipeline.pipe((done) => plugins[i].destroy(event, done));
|
|
1138
1102
|
}
|
|
1139
1103
|
workPipeline.filter((result) => {
|
|
1140
|
-
if (result.ok ===
|
|
1141
|
-
done(
|
|
1104
|
+
if (result.ok === _results__rspack_import_2.Result.ERROR) {
|
|
1105
|
+
done(_results__rspack_import_2.PluginEventResult.error(event.id, result.error));
|
|
1142
1106
|
return;
|
|
1143
1107
|
}
|
|
1144
|
-
done(
|
|
1108
|
+
done(_results__rspack_import_2.PluginEventResult.success(event.id));
|
|
1145
1109
|
});
|
|
1146
1110
|
}
|
|
1147
1111
|
catch (e) {
|
|
1148
|
-
done(
|
|
1112
|
+
done(_results__rspack_import_2.PluginEventResult.error(event.id, e));
|
|
1149
1113
|
}
|
|
1150
1114
|
}
|
|
1151
1115
|
bulkPersist(event, done) {
|
|
1152
1116
|
try {
|
|
1153
|
-
const workPipeline = new
|
|
1117
|
+
const workPipeline = new _pipeline__rspack_import_5.WorkPipeline();
|
|
1154
1118
|
const deferredPlugins = [this.plugins.source, ...this.plugins.replicas];
|
|
1155
1119
|
// Since we are doing optimistic, we insert into the read plugin first and assume later plugins will succeed
|
|
1156
1120
|
// This means the read plugin will generate ids for the source plugin
|
|
1157
1121
|
this.plugins.read.bulkPersist({
|
|
1158
|
-
id: (0,
|
|
1122
|
+
id: (0,_utilities__rspack_import_0.uuid)(8),
|
|
1159
1123
|
operation: event.operation,
|
|
1160
1124
|
schemas: event.schemas,
|
|
1161
1125
|
source: "data-store",
|
|
1162
1126
|
}, (r) => {
|
|
1163
|
-
if (r.ok !==
|
|
1127
|
+
if (r.ok !== _results__rspack_import_2.Result.SUCCESS) {
|
|
1164
1128
|
done(r);
|
|
1165
1129
|
return;
|
|
1166
1130
|
}
|
|
1167
1131
|
// optimistically call done and still continue saving the rest of the data. We read from the memory
|
|
1168
1132
|
// db anyways
|
|
1169
1133
|
done(r);
|
|
1170
|
-
const optimisticBulkPersistChanges = new
|
|
1134
|
+
const optimisticBulkPersistChanges = new _collections__rspack_import_3.BulkPersistChanges();
|
|
1171
1135
|
// make sure we swap the adds here, that way we can make sure other persist events
|
|
1172
1136
|
// don't take their additions and try to change subsequent calls
|
|
1173
|
-
(0,
|
|
1137
|
+
(0,_utilities__rspack_import_6.resolveBulkPersistChanges)(event, r.data, optimisticBulkPersistChanges);
|
|
1174
1138
|
for (let i = 0, length = deferredPlugins.length; i < length; i++) {
|
|
1175
1139
|
workPipeline.pipe((d) => {
|
|
1176
1140
|
const plugin = deferredPlugins[i];
|
|
1177
1141
|
plugin.bulkPersist({
|
|
1178
|
-
id: (0,
|
|
1142
|
+
id: (0,_utilities__rspack_import_0.uuid)(8),
|
|
1179
1143
|
operation: optimisticBulkPersistChanges,
|
|
1180
1144
|
schemas: event.schemas,
|
|
1181
1145
|
source: "data-store",
|
|
1182
1146
|
}, (r) => {
|
|
1183
|
-
if (r.ok ===
|
|
1147
|
+
if (r.ok === _results__rspack_import_2.Result.ERROR) {
|
|
1184
1148
|
d(r);
|
|
1185
1149
|
return;
|
|
1186
1150
|
}
|
|
1187
|
-
d(
|
|
1151
|
+
d(_results__rspack_import_2.Result.success());
|
|
1188
1152
|
});
|
|
1189
1153
|
});
|
|
1190
1154
|
}
|
|
@@ -1196,44 +1160,38 @@ class OptimisticReplicationDbPlugin {
|
|
|
1196
1160
|
});
|
|
1197
1161
|
}
|
|
1198
1162
|
catch (e) {
|
|
1199
|
-
done(
|
|
1163
|
+
done(_results__rspack_import_2.PluginEventResult.error(event.id, e));
|
|
1200
1164
|
}
|
|
1201
1165
|
}
|
|
1202
1166
|
}
|
|
1203
1167
|
|
|
1204
1168
|
|
|
1205
|
-
}
|
|
1206
|
-
"./src/plugins/replication/ReplicationDbPlugin.ts"
|
|
1207
|
-
/*!********************************************************!*\
|
|
1208
|
-
!*** ./src/plugins/replication/ReplicationDbPlugin.ts ***!
|
|
1209
|
-
\********************************************************/
|
|
1210
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1169
|
+
},
|
|
1170
|
+
"./src/plugins/replication/ReplicationDbPlugin.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
1211
1171
|
__webpack_require__.r(__webpack_exports__);
|
|
1212
1172
|
__webpack_require__.d(__webpack_exports__, {
|
|
1213
1173
|
ReplicationDbPlugin: () => (ReplicationDbPlugin)
|
|
1214
1174
|
});
|
|
1215
|
-
/*
|
|
1216
|
-
/*
|
|
1217
|
-
/*
|
|
1218
|
-
/*
|
|
1175
|
+
/* import */ var _results__rspack_import_0 = __webpack_require__("./src/results/Result.ts");
|
|
1176
|
+
/* import */ var _pipeline__rspack_import_1 = __webpack_require__("./src/pipeline/TrampolinePipeline.ts");
|
|
1177
|
+
/* import */ var _collections__rspack_import_2 = __webpack_require__("./src/collections/Changes.ts");
|
|
1178
|
+
/* import */ var _utilities__rspack_import_3 = __webpack_require__("./src/utilities/replication.ts");
|
|
1219
1179
|
|
|
1220
1180
|
|
|
1221
1181
|
|
|
1222
1182
|
|
|
1223
1183
|
class ReplicationDbPlugin {
|
|
1224
1184
|
plugins;
|
|
1225
|
-
constructor(plugins) {
|
|
1226
|
-
this.plugins = plugins;
|
|
1227
|
-
}
|
|
1228
1185
|
/**
|
|
1229
1186
|
* Creates a new DbPluginReplicator that coordinates operations between a source database and its replicas.
|
|
1230
1187
|
*
|
|
1231
|
-
* @param
|
|
1232
|
-
* @param
|
|
1233
|
-
* @
|
|
1188
|
+
* @param plugins Configuration object containing the source, read (optional), and replica database plugins
|
|
1189
|
+
* @param plugins.source The primary database plugin that will receive all operations first
|
|
1190
|
+
* @param plugins.read Optional read-optimized plugin (typically a memory plugin) used for fast queries
|
|
1191
|
+
* @param plugins.replicas Additional database plugins that will replicate operations from the source
|
|
1234
1192
|
*/
|
|
1235
|
-
|
|
1236
|
-
|
|
1193
|
+
constructor(plugins) {
|
|
1194
|
+
this.plugins = plugins;
|
|
1237
1195
|
}
|
|
1238
1196
|
/**
|
|
1239
1197
|
* Will query the read plugin if there is one, otherwise the source plugin will be queried
|
|
@@ -1244,115 +1202,107 @@ class ReplicationDbPlugin {
|
|
|
1244
1202
|
plugin.query(event, done);
|
|
1245
1203
|
}
|
|
1246
1204
|
catch (e) {
|
|
1247
|
-
done(
|
|
1205
|
+
done(_results__rspack_import_0.PluginEventResult.error(event.id, e));
|
|
1248
1206
|
}
|
|
1249
1207
|
}
|
|
1250
1208
|
destroy(event, done) {
|
|
1251
1209
|
try {
|
|
1252
|
-
const pipeline = new
|
|
1210
|
+
const pipeline = new _pipeline__rspack_import_1.WorkPipeline();
|
|
1253
1211
|
const plugins = [this.plugins.source, ...this.plugins.replicas];
|
|
1254
1212
|
for (let i = 0, length = plugins.length; i < length; i++) {
|
|
1255
1213
|
pipeline.pipe((done) => plugins[i].destroy(event, done));
|
|
1256
1214
|
}
|
|
1257
1215
|
pipeline.filter((result) => {
|
|
1258
|
-
if (result.ok ===
|
|
1259
|
-
done(
|
|
1216
|
+
if (result.ok === _results__rspack_import_0.Result.ERROR) {
|
|
1217
|
+
done(_results__rspack_import_0.PluginEventResult.error(event.id, result.error));
|
|
1260
1218
|
return;
|
|
1261
1219
|
}
|
|
1262
|
-
done(
|
|
1220
|
+
done(_results__rspack_import_0.PluginEventResult.success(event.id));
|
|
1263
1221
|
});
|
|
1264
1222
|
}
|
|
1265
1223
|
catch (e) {
|
|
1266
|
-
done(
|
|
1224
|
+
done(_results__rspack_import_0.PluginEventResult.error(event.id, e));
|
|
1267
1225
|
}
|
|
1268
1226
|
}
|
|
1269
1227
|
bulkPersist(event, done) {
|
|
1270
1228
|
try {
|
|
1271
1229
|
// insert into the source first to generate any ids, then take the result and persist that into the replicas
|
|
1272
|
-
const pipeline = new
|
|
1230
|
+
const pipeline = new _pipeline__rspack_import_1.WorkPipeline();
|
|
1273
1231
|
const plugins = [this.plugins.source, ...this.plugins.replicas];
|
|
1274
1232
|
if (this.plugins.read != null) {
|
|
1275
1233
|
plugins.push(this.plugins.read);
|
|
1276
1234
|
}
|
|
1277
|
-
const result = new
|
|
1235
|
+
const result = new _collections__rspack_import_2.BulkPersistResult();
|
|
1278
1236
|
for (let i = 0, length = plugins.length; i < length; i++) {
|
|
1279
1237
|
pipeline.pipe((d) => {
|
|
1280
1238
|
const plugin = plugins[i];
|
|
1281
1239
|
// source is first
|
|
1282
1240
|
if (i === 0) {
|
|
1283
1241
|
plugin.bulkPersist(event, (r) => {
|
|
1284
|
-
if (r.ok ===
|
|
1242
|
+
if (r.ok === _results__rspack_import_0.Result.ERROR) {
|
|
1285
1243
|
d(r);
|
|
1286
1244
|
return;
|
|
1287
1245
|
}
|
|
1288
1246
|
// make sure we swap the adds here, that way we can make sure other persist events
|
|
1289
1247
|
// don't take their additions and try to change subsequent calls
|
|
1290
|
-
(0,
|
|
1291
|
-
d(
|
|
1248
|
+
(0,_utilities__rspack_import_3.resolveBulkPersistChanges)(event, r.data, event.operation);
|
|
1249
|
+
d(_results__rspack_import_0.Result.success());
|
|
1292
1250
|
});
|
|
1293
1251
|
return;
|
|
1294
1252
|
}
|
|
1295
1253
|
plugin.bulkPersist(event, (r) => {
|
|
1296
|
-
if (r.ok ===
|
|
1254
|
+
if (r.ok === _results__rspack_import_0.Result.ERROR) {
|
|
1297
1255
|
d(r);
|
|
1298
1256
|
return;
|
|
1299
1257
|
}
|
|
1300
|
-
d(
|
|
1258
|
+
d(_results__rspack_import_0.Result.success());
|
|
1301
1259
|
});
|
|
1302
1260
|
});
|
|
1303
1261
|
}
|
|
1304
1262
|
let successCount = 0;
|
|
1305
1263
|
pipeline.filter((r) => {
|
|
1306
|
-
if (r.ok ===
|
|
1264
|
+
if (r.ok === _results__rspack_import_0.Result.ERROR) {
|
|
1307
1265
|
if (successCount > 0) {
|
|
1308
|
-
done(
|
|
1266
|
+
done(_results__rspack_import_0.PluginEventResult.partial(event.id, result, r.error));
|
|
1309
1267
|
return;
|
|
1310
1268
|
}
|
|
1311
|
-
done(
|
|
1269
|
+
done(_results__rspack_import_0.PluginEventResult.error(event.id, r.error));
|
|
1312
1270
|
return;
|
|
1313
1271
|
}
|
|
1314
1272
|
successCount++;
|
|
1315
|
-
done(
|
|
1273
|
+
done(_results__rspack_import_0.PluginEventResult.success(event.id, result));
|
|
1316
1274
|
});
|
|
1317
1275
|
}
|
|
1318
1276
|
catch (e) {
|
|
1319
|
-
done(
|
|
1277
|
+
done(_results__rspack_import_0.PluginEventResult.error(event.id, e));
|
|
1320
1278
|
}
|
|
1321
1279
|
}
|
|
1322
1280
|
}
|
|
1323
1281
|
|
|
1324
1282
|
|
|
1325
|
-
}
|
|
1326
|
-
"./src/plugins/replication/index.ts"
|
|
1327
|
-
/*!******************************************!*\
|
|
1328
|
-
!*** ./src/plugins/replication/index.ts ***!
|
|
1329
|
-
\******************************************/
|
|
1330
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1283
|
+
},
|
|
1284
|
+
"./src/plugins/replication/index.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
1331
1285
|
__webpack_require__.r(__webpack_exports__);
|
|
1332
1286
|
__webpack_require__.d(__webpack_exports__, {
|
|
1333
|
-
OptimisticReplicationDbPlugin: () => (/* reexport safe */
|
|
1334
|
-
ReplicationDbPlugin: () => (/* reexport safe */
|
|
1287
|
+
OptimisticReplicationDbPlugin: () => (/* reexport safe */ _OptimisticReplicationDbPlugin__rspack_import_1.OptimisticReplicationDbPlugin),
|
|
1288
|
+
ReplicationDbPlugin: () => (/* reexport safe */ _ReplicationDbPlugin__rspack_import_0.ReplicationDbPlugin)
|
|
1335
1289
|
});
|
|
1336
|
-
/*
|
|
1337
|
-
/*
|
|
1290
|
+
/* import */ var _ReplicationDbPlugin__rspack_import_0 = __webpack_require__("./src/plugins/replication/ReplicationDbPlugin.ts");
|
|
1291
|
+
/* import */ var _OptimisticReplicationDbPlugin__rspack_import_1 = __webpack_require__("./src/plugins/replication/OptimisticReplicationDbPlugin.ts");
|
|
1338
1292
|
|
|
1339
1293
|
|
|
1340
1294
|
|
|
1341
1295
|
|
|
1342
1296
|
|
|
1343
|
-
}
|
|
1344
|
-
"./src/plugins/translators/DataTranslator.ts"
|
|
1345
|
-
/*!***************************************************!*\
|
|
1346
|
-
!*** ./src/plugins/translators/DataTranslator.ts ***!
|
|
1347
|
-
\***************************************************/
|
|
1348
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1297
|
+
},
|
|
1298
|
+
"./src/plugins/translators/DataTranslator.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
1349
1299
|
__webpack_require__.r(__webpack_exports__);
|
|
1350
1300
|
__webpack_require__.d(__webpack_exports__, {
|
|
1351
1301
|
DataTranslator: () => (DataTranslator)
|
|
1352
1302
|
});
|
|
1353
|
-
/*
|
|
1354
|
-
/*
|
|
1355
|
-
/*
|
|
1303
|
+
/* import */ var _TranslatedArrayValue__rspack_import_0 = __webpack_require__("./src/plugins/translators/TranslatedArrayValue.ts");
|
|
1304
|
+
/* import */ var _TranslatedGroupValue__rspack_import_1 = __webpack_require__("./src/plugins/translators/TranslatedGroupValue.ts");
|
|
1305
|
+
/* import */ var _TranslatedSingleValue__rspack_import_2 = __webpack_require__("./src/plugins/translators/TranslatedSingleValue.ts");
|
|
1356
1306
|
|
|
1357
1307
|
|
|
1358
1308
|
|
|
@@ -1379,35 +1329,31 @@ class DataTranslator {
|
|
|
1379
1329
|
data = this.functionMap[item.name](data, item);
|
|
1380
1330
|
});
|
|
1381
1331
|
if (Array.isArray(data)) {
|
|
1382
|
-
return new
|
|
1332
|
+
return new _TranslatedArrayValue__rspack_import_0.TranslatedArrayValue(data);
|
|
1383
1333
|
}
|
|
1384
1334
|
if (this.query.options.has("group")) {
|
|
1385
|
-
return new
|
|
1335
|
+
return new _TranslatedGroupValue__rspack_import_1.TranslatedGroupValue(data);
|
|
1386
1336
|
}
|
|
1387
|
-
return new
|
|
1337
|
+
return new _TranslatedSingleValue__rspack_import_2.TranslatedSingleValue(data);
|
|
1388
1338
|
}
|
|
1389
1339
|
}
|
|
1390
1340
|
|
|
1391
1341
|
|
|
1392
|
-
}
|
|
1393
|
-
"./src/plugins/translators/JsonTranslator.ts"
|
|
1394
|
-
/*!***************************************************!*\
|
|
1395
|
-
!*** ./src/plugins/translators/JsonTranslator.ts ***!
|
|
1396
|
-
\***************************************************/
|
|
1397
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1342
|
+
},
|
|
1343
|
+
"./src/plugins/translators/JsonTranslator.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
1398
1344
|
__webpack_require__.r(__webpack_exports__);
|
|
1399
1345
|
__webpack_require__.d(__webpack_exports__, {
|
|
1400
1346
|
JsonTranslator: () => (JsonTranslator)
|
|
1401
1347
|
});
|
|
1402
|
-
/*
|
|
1403
|
-
/*
|
|
1404
|
-
/*
|
|
1348
|
+
/* import */ var _DataTranslator__rspack_import_0 = __webpack_require__("./src/plugins/translators/DataTranslator.ts");
|
|
1349
|
+
/* import */ var _assertions__rspack_import_1 = __webpack_require__("./src/assertions/index.ts");
|
|
1350
|
+
/* import */ var _utilities__rspack_import_2 = __webpack_require__("./src/utilities/dates.ts");
|
|
1405
1351
|
|
|
1406
1352
|
|
|
1407
1353
|
|
|
1408
|
-
class JsonTranslator extends
|
|
1354
|
+
class JsonTranslator extends _DataTranslator__rspack_import_0.DataTranslator {
|
|
1409
1355
|
filter(data, option) {
|
|
1410
|
-
(0,
|
|
1356
|
+
(0,_assertions__rspack_import_1.assertIsArray)(data);
|
|
1411
1357
|
if (option.value.filter) {
|
|
1412
1358
|
if (option.value.params == null) {
|
|
1413
1359
|
// standard filtering
|
|
@@ -1495,7 +1441,7 @@ class JsonTranslator extends _DataTranslator__WEBPACK_IMPORTED_MODULE_0__.DataTr
|
|
|
1495
1441
|
return data;
|
|
1496
1442
|
}
|
|
1497
1443
|
sum(data, _) {
|
|
1498
|
-
(0,
|
|
1444
|
+
(0,_assertions__rspack_import_1.assertIsArray)(data, this._formatDataNotArrayError("sum"));
|
|
1499
1445
|
if (data.length === 0) {
|
|
1500
1446
|
throw new Error("Cannot perform operation on empty array, result query contains no data");
|
|
1501
1447
|
}
|
|
@@ -1512,7 +1458,7 @@ class JsonTranslator extends _DataTranslator__WEBPACK_IMPORTED_MODULE_0__.DataTr
|
|
|
1512
1458
|
return sum;
|
|
1513
1459
|
}
|
|
1514
1460
|
distinct(data, _) {
|
|
1515
|
-
(0,
|
|
1461
|
+
(0,_assertions__rspack_import_1.assertIsArray)(data, this._formatDataNotArrayError("distinct"));
|
|
1516
1462
|
const result = new Set();
|
|
1517
1463
|
// would be nice to have property info here for type detection
|
|
1518
1464
|
let needsDateConversion = false;
|
|
@@ -1522,7 +1468,7 @@ class JsonTranslator extends _DataTranslator__WEBPACK_IMPORTED_MODULE_0__.DataTr
|
|
|
1522
1468
|
result.add(value);
|
|
1523
1469
|
continue;
|
|
1524
1470
|
}
|
|
1525
|
-
if ((0,
|
|
1471
|
+
if ((0,_utilities__rspack_import_2.isDate)(value)) {
|
|
1526
1472
|
needsDateConversion = true;
|
|
1527
1473
|
result.add(value.toISOString());
|
|
1528
1474
|
continue;
|
|
@@ -1567,7 +1513,7 @@ class JsonTranslator extends _DataTranslator__WEBPACK_IMPORTED_MODULE_0__.DataTr
|
|
|
1567
1513
|
return mapOption.value.fields[0];
|
|
1568
1514
|
}
|
|
1569
1515
|
_minMax(data, name, sort) {
|
|
1570
|
-
(0,
|
|
1516
|
+
(0,_assertions__rspack_import_1.assertIsArray)(data, this._formatDataNotArrayError(name));
|
|
1571
1517
|
data.sort(sort);
|
|
1572
1518
|
if (data.length === 0) {
|
|
1573
1519
|
throw new Error("Cannot perform operation on empty array, result query contains no data");
|
|
@@ -1580,19 +1526,15 @@ class JsonTranslator extends _DataTranslator__WEBPACK_IMPORTED_MODULE_0__.DataTr
|
|
|
1580
1526
|
}
|
|
1581
1527
|
|
|
1582
1528
|
|
|
1583
|
-
}
|
|
1584
|
-
"./src/plugins/translators/SqlTranslator.ts"
|
|
1585
|
-
/*!**************************************************!*\
|
|
1586
|
-
!*** ./src/plugins/translators/SqlTranslator.ts ***!
|
|
1587
|
-
\**************************************************/
|
|
1588
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1529
|
+
},
|
|
1530
|
+
"./src/plugins/translators/SqlTranslator.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
1589
1531
|
__webpack_require__.r(__webpack_exports__);
|
|
1590
1532
|
__webpack_require__.d(__webpack_exports__, {
|
|
1591
1533
|
SqlTranslator: () => (SqlTranslator)
|
|
1592
1534
|
});
|
|
1593
|
-
/*
|
|
1535
|
+
/* import */ var _DataTranslator__rspack_import_0 = __webpack_require__("./src/plugins/translators/DataTranslator.ts");
|
|
1594
1536
|
|
|
1595
|
-
class SqlTranslator extends
|
|
1537
|
+
class SqlTranslator extends _DataTranslator__rspack_import_0.DataTranslator {
|
|
1596
1538
|
count(data, _) {
|
|
1597
1539
|
if (Array.isArray(data) && data.length > 0) {
|
|
1598
1540
|
// Count should be returned as the property alias on the query
|
|
@@ -1682,12 +1624,8 @@ class SqlTranslator extends _DataTranslator__WEBPACK_IMPORTED_MODULE_0__.DataTra
|
|
|
1682
1624
|
}
|
|
1683
1625
|
|
|
1684
1626
|
|
|
1685
|
-
}
|
|
1686
|
-
"./src/plugins/translators/TranslatedArrayValue.ts"
|
|
1687
|
-
/*!*********************************************************!*\
|
|
1688
|
-
!*** ./src/plugins/translators/TranslatedArrayValue.ts ***!
|
|
1689
|
-
\*********************************************************/
|
|
1690
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1627
|
+
},
|
|
1628
|
+
"./src/plugins/translators/TranslatedArrayValue.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
1691
1629
|
__webpack_require__.r(__webpack_exports__);
|
|
1692
1630
|
__webpack_require__.d(__webpack_exports__, {
|
|
1693
1631
|
TranslatedArrayValue: () => (TranslatedArrayValue)
|
|
@@ -1710,12 +1648,8 @@ class TranslatedArrayValue {
|
|
|
1710
1648
|
}
|
|
1711
1649
|
|
|
1712
1650
|
|
|
1713
|
-
}
|
|
1714
|
-
"./src/plugins/translators/TranslatedGroupValue.ts"
|
|
1715
|
-
/*!*********************************************************!*\
|
|
1716
|
-
!*** ./src/plugins/translators/TranslatedGroupValue.ts ***!
|
|
1717
|
-
\*********************************************************/
|
|
1718
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1651
|
+
},
|
|
1652
|
+
"./src/plugins/translators/TranslatedGroupValue.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
1719
1653
|
__webpack_require__.r(__webpack_exports__);
|
|
1720
1654
|
__webpack_require__.d(__webpack_exports__, {
|
|
1721
1655
|
TranslatedGroupValue: () => (TranslatedGroupValue)
|
|
@@ -1743,12 +1677,8 @@ class TranslatedGroupValue {
|
|
|
1743
1677
|
}
|
|
1744
1678
|
|
|
1745
1679
|
|
|
1746
|
-
}
|
|
1747
|
-
"./src/plugins/translators/TranslatedSingleValue.ts"
|
|
1748
|
-
/*!**********************************************************!*\
|
|
1749
|
-
!*** ./src/plugins/translators/TranslatedSingleValue.ts ***!
|
|
1750
|
-
\**********************************************************/
|
|
1751
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1680
|
+
},
|
|
1681
|
+
"./src/plugins/translators/TranslatedSingleValue.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
1752
1682
|
__webpack_require__.r(__webpack_exports__);
|
|
1753
1683
|
__webpack_require__.d(__webpack_exports__, {
|
|
1754
1684
|
TranslatedSingleValue: () => (TranslatedSingleValue)
|
|
@@ -1767,27 +1697,23 @@ class TranslatedSingleValue {
|
|
|
1767
1697
|
}
|
|
1768
1698
|
|
|
1769
1699
|
|
|
1770
|
-
}
|
|
1771
|
-
"./src/plugins/translators/index.ts"
|
|
1772
|
-
/*!******************************************!*\
|
|
1773
|
-
!*** ./src/plugins/translators/index.ts ***!
|
|
1774
|
-
\******************************************/
|
|
1775
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1700
|
+
},
|
|
1701
|
+
"./src/plugins/translators/index.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
1776
1702
|
__webpack_require__.r(__webpack_exports__);
|
|
1777
1703
|
__webpack_require__.d(__webpack_exports__, {
|
|
1778
|
-
DataTranslator: () => (/* reexport safe */
|
|
1779
|
-
JsonTranslator: () => (/* reexport safe */
|
|
1780
|
-
SqlTranslator: () => (/* reexport safe */
|
|
1781
|
-
TranslatedArrayValue: () => (/* reexport safe */
|
|
1782
|
-
TranslatedGroupValue: () => (/* reexport safe */
|
|
1783
|
-
TranslatedSingleValue: () => (/* reexport safe */
|
|
1704
|
+
DataTranslator: () => (/* reexport safe */ _DataTranslator__rspack_import_0.DataTranslator),
|
|
1705
|
+
JsonTranslator: () => (/* reexport safe */ _JsonTranslator__rspack_import_1.JsonTranslator),
|
|
1706
|
+
SqlTranslator: () => (/* reexport safe */ _SqlTranslator__rspack_import_2.SqlTranslator),
|
|
1707
|
+
TranslatedArrayValue: () => (/* reexport safe */ _TranslatedArrayValue__rspack_import_3.TranslatedArrayValue),
|
|
1708
|
+
TranslatedGroupValue: () => (/* reexport safe */ _TranslatedGroupValue__rspack_import_4.TranslatedGroupValue),
|
|
1709
|
+
TranslatedSingleValue: () => (/* reexport safe */ _TranslatedSingleValue__rspack_import_5.TranslatedSingleValue)
|
|
1784
1710
|
});
|
|
1785
|
-
/*
|
|
1786
|
-
/*
|
|
1787
|
-
/*
|
|
1788
|
-
/*
|
|
1789
|
-
/*
|
|
1790
|
-
/*
|
|
1711
|
+
/* import */ var _DataTranslator__rspack_import_0 = __webpack_require__("./src/plugins/translators/DataTranslator.ts");
|
|
1712
|
+
/* import */ var _JsonTranslator__rspack_import_1 = __webpack_require__("./src/plugins/translators/JsonTranslator.ts");
|
|
1713
|
+
/* import */ var _SqlTranslator__rspack_import_2 = __webpack_require__("./src/plugins/translators/SqlTranslator.ts");
|
|
1714
|
+
/* import */ var _TranslatedArrayValue__rspack_import_3 = __webpack_require__("./src/plugins/translators/TranslatedArrayValue.ts");
|
|
1715
|
+
/* import */ var _TranslatedGroupValue__rspack_import_4 = __webpack_require__("./src/plugins/translators/TranslatedGroupValue.ts");
|
|
1716
|
+
/* import */ var _TranslatedSingleValue__rspack_import_5 = __webpack_require__("./src/plugins/translators/TranslatedSingleValue.ts");
|
|
1791
1717
|
|
|
1792
1718
|
|
|
1793
1719
|
|
|
@@ -1797,12 +1723,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
1797
1723
|
|
|
1798
1724
|
|
|
1799
1725
|
|
|
1800
|
-
}
|
|
1801
|
-
"./src/results/Result.ts"
|
|
1802
|
-
/*!*******************************!*\
|
|
1803
|
-
!*** ./src/results/Result.ts ***!
|
|
1804
|
-
\*******************************/
|
|
1805
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1726
|
+
},
|
|
1727
|
+
"./src/results/Result.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
1806
1728
|
__webpack_require__.r(__webpack_exports__);
|
|
1807
1729
|
__webpack_require__.d(__webpack_exports__, {
|
|
1808
1730
|
PluginEventResult: () => (PluginEventResult),
|
|
@@ -1884,12 +1806,8 @@ class PluginEventResult extends BaseResult {
|
|
|
1884
1806
|
}
|
|
1885
1807
|
|
|
1886
1808
|
|
|
1887
|
-
}
|
|
1888
|
-
"./src/utilities/dates.ts"
|
|
1889
|
-
/*!********************************!*\
|
|
1890
|
-
!*** ./src/utilities/dates.ts ***!
|
|
1891
|
-
\********************************/
|
|
1892
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1809
|
+
},
|
|
1810
|
+
"./src/utilities/dates.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
1893
1811
|
__webpack_require__.r(__webpack_exports__);
|
|
1894
1812
|
__webpack_require__.d(__webpack_exports__, {
|
|
1895
1813
|
isDate: () => (isDate)
|
|
@@ -1905,12 +1823,8 @@ const isDate = (data) => {
|
|
|
1905
1823
|
};
|
|
1906
1824
|
|
|
1907
1825
|
|
|
1908
|
-
}
|
|
1909
|
-
"./src/utilities/logger.ts"
|
|
1910
|
-
/*!*********************************!*\
|
|
1911
|
-
!*** ./src/utilities/logger.ts ***!
|
|
1912
|
-
\*********************************/
|
|
1913
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1826
|
+
},
|
|
1827
|
+
"./src/utilities/logger.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
1914
1828
|
__webpack_require__.r(__webpack_exports__);
|
|
1915
1829
|
__webpack_require__.d(__webpack_exports__, {
|
|
1916
1830
|
logger: () => (logger)
|
|
@@ -1950,12 +1864,8 @@ const logger = {
|
|
|
1950
1864
|
};
|
|
1951
1865
|
|
|
1952
1866
|
|
|
1953
|
-
}
|
|
1954
|
-
"./src/utilities/replication.ts"
|
|
1955
|
-
/*!**************************************!*\
|
|
1956
|
-
!*** ./src/utilities/replication.ts ***!
|
|
1957
|
-
\**************************************/
|
|
1958
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1867
|
+
},
|
|
1868
|
+
"./src/utilities/replication.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
1959
1869
|
__webpack_require__.r(__webpack_exports__);
|
|
1960
1870
|
__webpack_require__.d(__webpack_exports__, {
|
|
1961
1871
|
resolveBulkPersistChanges: () => (resolveBulkPersistChanges)
|
|
@@ -1978,12 +1888,8 @@ const resolveBulkPersistChanges = (event, result, bulkPersistChanges) => {
|
|
|
1978
1888
|
};
|
|
1979
1889
|
|
|
1980
1890
|
|
|
1981
|
-
}
|
|
1982
|
-
"./src/utilities/uuid.ts"
|
|
1983
|
-
/*!*******************************!*\
|
|
1984
|
-
!*** ./src/utilities/uuid.ts ***!
|
|
1985
|
-
\*******************************/
|
|
1986
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1891
|
+
},
|
|
1892
|
+
"./src/utilities/uuid.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
1987
1893
|
__webpack_require__.r(__webpack_exports__);
|
|
1988
1894
|
__webpack_require__.d(__webpack_exports__, {
|
|
1989
1895
|
uuid: () => (uuid),
|
|
@@ -2040,10 +1946,9 @@ const uuidv4 = () => {
|
|
|
2040
1946
|
};
|
|
2041
1947
|
|
|
2042
1948
|
|
|
2043
|
-
}
|
|
1949
|
+
},
|
|
2044
1950
|
|
|
2045
1951
|
});
|
|
2046
|
-
/************************************************************************/
|
|
2047
1952
|
// The module cache
|
|
2048
1953
|
var __webpack_module_cache__ = {};
|
|
2049
1954
|
|
|
@@ -2067,7 +1972,6 @@ return module.exports;
|
|
|
2067
1972
|
|
|
2068
1973
|
}
|
|
2069
1974
|
|
|
2070
|
-
/************************************************************************/
|
|
2071
1975
|
// webpack/runtime/define_property_getters
|
|
2072
1976
|
(() => {
|
|
2073
1977
|
__webpack_require__.d = (exports, definition) => {
|
|
@@ -2092,33 +1996,28 @@ __webpack_require__.r = (exports) => {
|
|
|
2092
1996
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2093
1997
|
};
|
|
2094
1998
|
})();
|
|
2095
|
-
/************************************************************************/
|
|
2096
1999
|
var __webpack_exports__ = {};
|
|
2097
2000
|
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
|
|
2098
2001
|
(() => {
|
|
2099
|
-
|
|
2100
|
-
/*!******************************!*\
|
|
2101
|
-
!*** ./src/plugins/index.ts ***!
|
|
2102
|
-
\******************************/
|
|
2103
2002
|
__webpack_require__.r(__webpack_exports__);
|
|
2104
2003
|
__webpack_require__.d(__webpack_exports__, {
|
|
2105
|
-
DataTranslator: () => (/* reexport safe */
|
|
2106
|
-
EphemeralDataPlugin: () => (/* reexport safe */
|
|
2107
|
-
JsonTranslator: () => (/* reexport safe */
|
|
2108
|
-
OptimisticReplicationDbPlugin: () => (/* reexport safe */
|
|
2109
|
-
Query: () => (/* reexport safe */
|
|
2110
|
-
QueryOptionsCollection: () => (/* reexport safe */
|
|
2111
|
-
QueryOrdering: () => (/* reexport safe */
|
|
2112
|
-
ReplicationDbPlugin: () => (/* reexport safe */
|
|
2113
|
-
SqlTranslator: () => (/* reexport safe */
|
|
2114
|
-
TranslatedArrayValue: () => (/* reexport safe */
|
|
2115
|
-
TranslatedGroupValue: () => (/* reexport safe */
|
|
2116
|
-
TranslatedSingleValue: () => (/* reexport safe */
|
|
2004
|
+
DataTranslator: () => (/* reexport safe */ _translators__rspack_import_0.DataTranslator),
|
|
2005
|
+
EphemeralDataPlugin: () => (/* reexport safe */ _EphemeralDataPlugin__rspack_import_3.EphemeralDataPlugin),
|
|
2006
|
+
JsonTranslator: () => (/* reexport safe */ _translators__rspack_import_0.JsonTranslator),
|
|
2007
|
+
OptimisticReplicationDbPlugin: () => (/* reexport safe */ _replication__rspack_import_1.OptimisticReplicationDbPlugin),
|
|
2008
|
+
Query: () => (/* reexport safe */ _query__rspack_import_2.Query),
|
|
2009
|
+
QueryOptionsCollection: () => (/* reexport safe */ _query__rspack_import_2.QueryOptionsCollection),
|
|
2010
|
+
QueryOrdering: () => (/* reexport safe */ _query__rspack_import_2.QueryOrdering),
|
|
2011
|
+
ReplicationDbPlugin: () => (/* reexport safe */ _replication__rspack_import_1.ReplicationDbPlugin),
|
|
2012
|
+
SqlTranslator: () => (/* reexport safe */ _translators__rspack_import_0.SqlTranslator),
|
|
2013
|
+
TranslatedArrayValue: () => (/* reexport safe */ _translators__rspack_import_0.TranslatedArrayValue),
|
|
2014
|
+
TranslatedGroupValue: () => (/* reexport safe */ _translators__rspack_import_0.TranslatedGroupValue),
|
|
2015
|
+
TranslatedSingleValue: () => (/* reexport safe */ _translators__rspack_import_0.TranslatedSingleValue)
|
|
2117
2016
|
});
|
|
2118
|
-
/*
|
|
2119
|
-
/*
|
|
2120
|
-
/*
|
|
2121
|
-
/*
|
|
2017
|
+
/* import */ var _translators__rspack_import_0 = __webpack_require__("./src/plugins/translators/index.ts");
|
|
2018
|
+
/* import */ var _replication__rspack_import_1 = __webpack_require__("./src/plugins/replication/index.ts");
|
|
2019
|
+
/* import */ var _query__rspack_import_2 = __webpack_require__("./src/plugins/query/index.ts");
|
|
2020
|
+
/* import */ var _EphemeralDataPlugin__rspack_import_3 = __webpack_require__("./src/plugins/EphemeralDataPlugin.ts");
|
|
2122
2021
|
|
|
2123
2022
|
|
|
2124
2023
|
|