@graphrefly/graphrefly 0.5.0 → 0.7.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/README.md +30 -14
- package/dist/{chunk-5X3LAO3B.js → chunk-3EVXOI5C.js} +50 -5
- package/dist/chunk-3EVXOI5C.js.map +1 -0
- package/dist/chunk-47YJEZUJ.js +106 -0
- package/dist/chunk-47YJEZUJ.js.map +1 -0
- package/dist/{chunk-6W5SGIGB.js → chunk-BLCXEMAD.js} +129 -25
- package/dist/chunk-BLCXEMAD.js.map +1 -0
- package/dist/{chunk-QW7H3ICI.js → chunk-FGLZ5QID.js} +4 -4
- package/dist/{chunk-CP6MNKAA.js → chunk-ISGMZ2T3.js} +10 -4
- package/dist/{chunk-CP6MNKAA.js.map → chunk-ISGMZ2T3.js.map} +1 -1
- package/dist/{chunk-HP7OKEOE.js → chunk-L4J2K2RT.js} +3 -3
- package/dist/chunk-L4J2K2RT.js.map +1 -0
- package/dist/{chunk-ZERWUCGK.js → chunk-ONLYF6GA.js} +866 -206
- package/dist/chunk-ONLYF6GA.js.map +1 -0
- package/dist/{chunk-Z4Y4FMQN.js → chunk-OSR3G3DP.js} +7 -7
- package/dist/{chunk-KWXPDASV.js → chunk-PEBORXRA.js} +2 -2
- package/dist/chunk-WZ2Z2CRV.js +32 -0
- package/dist/chunk-WZ2Z2CRV.js.map +1 -0
- package/dist/compat/nestjs/index.cjs +226 -41
- package/dist/compat/nestjs/index.cjs.map +1 -1
- package/dist/compat/nestjs/index.d.cts +4 -4
- package/dist/compat/nestjs/index.d.ts +4 -4
- package/dist/compat/nestjs/index.js +8 -7
- package/dist/core/index.cjs +134 -20
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +10 -4
- package/dist/extra/index.cjs +939 -209
- package/dist/extra/index.cjs.map +1 -1
- package/dist/extra/index.d.cts +4 -4
- package/dist/extra/index.d.ts +4 -4
- package/dist/extra/index.js +26 -3
- package/dist/graph/index.cjs +226 -41
- package/dist/graph/index.cjs.map +1 -1
- package/dist/graph/index.d.cts +3 -3
- package/dist/graph/index.d.ts +3 -3
- package/dist/graph/index.js +4 -4
- package/dist/{graph-CL_ZDAj9.d.cts → graph-B3BoJjcb.d.cts} +58 -7
- package/dist/{graph-D18qmsNm.d.ts → graph-CmiUuhaN.d.ts} +58 -7
- package/dist/{index-B7eOdgEx.d.ts → index-Bf2X1YSI.d.ts} +3 -3
- package/dist/{index-BvhgZRHK.d.cts → index-Bl7hJcc3.d.cts} +4 -2
- package/dist/{index-Bvy_6CaN.d.ts → index-BrgtEG-C.d.ts} +47 -4
- package/dist/{index-D_geH2Bm.d.cts → index-BsuKSs4L.d.cts} +3 -3
- package/dist/{index-BtK55IE2.d.ts → index-CsUq2rrK.d.ts} +4 -2
- package/dist/{index-C3BMRmmp.d.cts → index-D0cx-Yht.d.cts} +3 -3
- package/dist/{index-Cz8og7-L.d.cts → index-D1hgSTzr.d.cts} +488 -60
- package/dist/{index-C5mqLhMX.d.cts → index-D8NIq6om.d.cts} +47 -4
- package/dist/{index-CP_QvbWu.d.ts → index-DFFNKYig.d.ts} +3 -3
- package/dist/{index-C3LRU4jB.d.ts → index-Pm68AYPh.d.ts} +488 -60
- package/dist/index.cjs +3005 -1776
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +112 -14
- package/dist/index.d.ts +112 -14
- package/dist/index.js +396 -27
- package/dist/index.js.map +1 -1
- package/dist/{meta-BsF6Sag9.d.cts → meta-BJEU8fYz.d.cts} +31 -4
- package/dist/{meta-BsF6Sag9.d.ts → meta-BJEU8fYz.d.ts} +31 -4
- package/dist/patterns/reactive-layout/index.cjs +226 -41
- package/dist/patterns/reactive-layout/index.cjs.map +1 -1
- package/dist/patterns/reactive-layout/index.d.cts +3 -3
- package/dist/patterns/reactive-layout/index.d.ts +3 -3
- package/dist/patterns/reactive-layout/index.js +4 -4
- package/dist/{reactive-log-BfvfNWQh.d.cts → reactive-log-CAXzJ7hw.d.cts} +2 -2
- package/dist/{reactive-log-ohLmTXoZ.d.ts → reactive-log-DwNhOe0g.d.ts} +2 -2
- package/package.json +29 -18
- package/dist/chunk-5X3LAO3B.js.map +0 -1
- package/dist/chunk-6W5SGIGB.js.map +0 -1
- package/dist/chunk-HP7OKEOE.js.map +0 -1
- package/dist/chunk-O3PI7W45.js +0 -68
- package/dist/chunk-O3PI7W45.js.map +0 -1
- package/dist/chunk-ZERWUCGK.js.map +0 -1
- /package/dist/{chunk-QW7H3ICI.js.map → chunk-FGLZ5QID.js.map} +0 -0
- /package/dist/{chunk-Z4Y4FMQN.js.map → chunk-OSR3G3DP.js.map} +0 -0
- /package/dist/{chunk-KWXPDASV.js.map → chunk-PEBORXRA.js.map} +0 -0
|
@@ -32,7 +32,10 @@ import {
|
|
|
32
32
|
toArray,
|
|
33
33
|
toMessages$,
|
|
34
34
|
toObservable
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-PEBORXRA.js";
|
|
36
|
+
import {
|
|
37
|
+
ResettableTimer
|
|
38
|
+
} from "./chunk-WZ2Z2CRV.js";
|
|
36
39
|
import {
|
|
37
40
|
COMPLETE,
|
|
38
41
|
DATA,
|
|
@@ -56,7 +59,7 @@ import {
|
|
|
56
59
|
producer,
|
|
57
60
|
state,
|
|
58
61
|
wallClockNs
|
|
59
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-3EVXOI5C.js";
|
|
60
63
|
|
|
61
64
|
// src/extra/index.ts
|
|
62
65
|
var extra_exports = {};
|
|
@@ -68,11 +71,14 @@ __export(extra_exports, {
|
|
|
68
71
|
NS_PER_MS: () => NS_PER_MS,
|
|
69
72
|
NS_PER_SEC: () => NS_PER_SEC,
|
|
70
73
|
SqliteCheckpointAdapter: () => SqliteCheckpointAdapter,
|
|
74
|
+
TimeoutError: () => TimeoutError,
|
|
71
75
|
audit: () => audit,
|
|
72
76
|
buffer: () => buffer,
|
|
73
77
|
bufferCount: () => bufferCount,
|
|
74
78
|
bufferTime: () => bufferTime,
|
|
79
|
+
cache: () => cache,
|
|
75
80
|
cached: () => cached,
|
|
81
|
+
cascadingCache: () => cascadingCache,
|
|
76
82
|
catchError: () => catchError,
|
|
77
83
|
checkpointNodeValue: () => checkpointNodeValue,
|
|
78
84
|
checkpointToRedis: () => checkpointToRedis,
|
|
@@ -97,6 +103,7 @@ __export(extra_exports, {
|
|
|
97
103
|
escapeRegexChar: () => escapeRegexChar,
|
|
98
104
|
exhaustMap: () => exhaustMap,
|
|
99
105
|
exponential: () => exponential,
|
|
106
|
+
fallback: () => fallback,
|
|
100
107
|
fibonacci: () => fibonacci,
|
|
101
108
|
filter: () => filter,
|
|
102
109
|
find: () => find,
|
|
@@ -109,6 +116,7 @@ __export(extra_exports, {
|
|
|
109
116
|
fromCSV: () => fromCSV,
|
|
110
117
|
fromClickHouseWatch: () => fromClickHouseWatch,
|
|
111
118
|
fromCron: () => fromCron,
|
|
119
|
+
fromDrizzle: () => fromDrizzle,
|
|
112
120
|
fromEvent: () => fromEvent,
|
|
113
121
|
fromFSWatch: () => fromFSWatch,
|
|
114
122
|
fromGitHook: () => fromGitHook,
|
|
@@ -117,15 +125,18 @@ __export(extra_exports, {
|
|
|
117
125
|
fromIDBTransaction: () => fromIDBTransaction,
|
|
118
126
|
fromIter: () => fromIter,
|
|
119
127
|
fromKafka: () => fromKafka,
|
|
128
|
+
fromKysely: () => fromKysely,
|
|
120
129
|
fromMCP: () => fromMCP,
|
|
121
130
|
fromNATS: () => fromNATS,
|
|
122
131
|
fromNDJSON: () => fromNDJSON,
|
|
123
132
|
fromOTel: () => fromOTel,
|
|
133
|
+
fromPrisma: () => fromPrisma,
|
|
124
134
|
fromPrometheus: () => fromPrometheus,
|
|
125
135
|
fromPromise: () => fromPromise,
|
|
126
136
|
fromPulsar: () => fromPulsar,
|
|
127
137
|
fromRabbitMQ: () => fromRabbitMQ,
|
|
128
138
|
fromRedisStream: () => fromRedisStream,
|
|
139
|
+
fromSqlite: () => fromSqlite,
|
|
129
140
|
fromStatsD: () => fromStatsD,
|
|
130
141
|
fromSyslog: () => fromSyslog,
|
|
131
142
|
fromTimer: () => fromTimer,
|
|
@@ -137,6 +148,7 @@ __export(extra_exports, {
|
|
|
137
148
|
last: () => last,
|
|
138
149
|
linear: () => linear,
|
|
139
150
|
logSlice: () => logSlice,
|
|
151
|
+
lru: () => lru,
|
|
140
152
|
map: () => map,
|
|
141
153
|
matchesAnyPattern: () => matchesAnyPattern,
|
|
142
154
|
matchesCron: () => matchesCron,
|
|
@@ -186,6 +198,7 @@ __export(extra_exports, {
|
|
|
186
198
|
throttle: () => throttle,
|
|
187
199
|
throttleTime: () => throttleTime,
|
|
188
200
|
throwError: () => throwError,
|
|
201
|
+
tieredStorage: () => tieredStorage,
|
|
189
202
|
timeout: () => timeout,
|
|
190
203
|
toArray: () => toArray,
|
|
191
204
|
toCSV: () => toCSV,
|
|
@@ -203,6 +216,7 @@ __export(extra_exports, {
|
|
|
203
216
|
toRedisStream: () => toRedisStream,
|
|
204
217
|
toS3: () => toS3,
|
|
205
218
|
toSSE: () => toSSE,
|
|
219
|
+
toSqlite: () => toSqlite,
|
|
206
220
|
toTempo: () => toTempo,
|
|
207
221
|
toWebSocket: () => toWebSocket,
|
|
208
222
|
tokenBucket: () => tokenBucket,
|
|
@@ -342,14 +356,7 @@ function retry(source, opts) {
|
|
|
342
356
|
let stopped = false;
|
|
343
357
|
let prevDelay = null;
|
|
344
358
|
let unsub;
|
|
345
|
-
|
|
346
|
-
let timerGen = 0;
|
|
347
|
-
function cancelTimer() {
|
|
348
|
-
if (timer !== void 0) {
|
|
349
|
-
clearTimeout(timer);
|
|
350
|
-
timer = void 0;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
359
|
+
const timer = new ResettableTimer();
|
|
353
360
|
function disconnectUpstream() {
|
|
354
361
|
unsub?.();
|
|
355
362
|
unsub = void 0;
|
|
@@ -365,20 +372,18 @@ function retry(source, opts) {
|
|
|
365
372
|
const delayNs = coerceDelayNs(raw === void 0 ? null : raw);
|
|
366
373
|
prevDelay = delayNs;
|
|
367
374
|
attempt += 1;
|
|
368
|
-
timerGen += 1;
|
|
369
|
-
const gen = timerGen;
|
|
370
375
|
disconnectUpstream();
|
|
371
376
|
const delayMs = delayNs > 0 ? delayNs / NS_PER_MS : 1;
|
|
372
|
-
timer
|
|
373
|
-
|
|
374
|
-
if (stopped || gen !== timerGen) return;
|
|
377
|
+
timer.start(delayMs, () => {
|
|
378
|
+
if (stopped) return;
|
|
375
379
|
connect();
|
|
376
|
-
}
|
|
380
|
+
});
|
|
377
381
|
}
|
|
378
382
|
function connect() {
|
|
379
|
-
|
|
383
|
+
timer.cancel();
|
|
380
384
|
disconnectUpstream();
|
|
381
385
|
unsub = source.subscribe((msgs) => {
|
|
386
|
+
if (stopped) return;
|
|
382
387
|
for (const m of msgs) {
|
|
383
388
|
const t = m[0];
|
|
384
389
|
if (t === DIRTY) a.down([[DIRTY]]);
|
|
@@ -400,8 +405,7 @@ function retry(source, opts) {
|
|
|
400
405
|
connect();
|
|
401
406
|
return () => {
|
|
402
407
|
stopped = true;
|
|
403
|
-
|
|
404
|
-
cancelTimer();
|
|
408
|
+
timer.cancel();
|
|
405
409
|
disconnectUpstream();
|
|
406
410
|
};
|
|
407
411
|
},
|
|
@@ -581,14 +585,7 @@ function rateLimiter(source, maxEvents, windowNs) {
|
|
|
581
585
|
(_d, a) => {
|
|
582
586
|
const times = [];
|
|
583
587
|
const pending = [];
|
|
584
|
-
|
|
585
|
-
let timerGen = 0;
|
|
586
|
-
function cancelTimer() {
|
|
587
|
-
if (timer !== void 0) {
|
|
588
|
-
clearTimeout(timer);
|
|
589
|
-
timer = void 0;
|
|
590
|
-
}
|
|
591
|
-
}
|
|
588
|
+
const timer = new ResettableTimer();
|
|
592
589
|
function prune(now) {
|
|
593
590
|
const boundary = now - windowNs;
|
|
594
591
|
while (times.length > 0 && times[0] <= boundary) times.shift();
|
|
@@ -602,15 +599,10 @@ function rateLimiter(source, maxEvents, windowNs) {
|
|
|
602
599
|
a.emit(pending.shift());
|
|
603
600
|
} else {
|
|
604
601
|
const oldest = times[0];
|
|
605
|
-
cancelTimer();
|
|
606
|
-
timerGen += 1;
|
|
607
|
-
const gen = timerGen;
|
|
608
602
|
const delayNs = Math.max(0, oldest + windowNs - monotonicNs());
|
|
609
|
-
timer
|
|
610
|
-
timer = void 0;
|
|
611
|
-
if (gen !== timerGen) return;
|
|
603
|
+
timer.start(delayNs / NS_PER_MS, () => {
|
|
612
604
|
tryEmit();
|
|
613
|
-
}
|
|
605
|
+
});
|
|
614
606
|
return;
|
|
615
607
|
}
|
|
616
608
|
}
|
|
@@ -624,14 +616,12 @@ function rateLimiter(source, maxEvents, windowNs) {
|
|
|
624
616
|
tryEmit();
|
|
625
617
|
} else if (t === RESOLVED) a.down([[RESOLVED]]);
|
|
626
618
|
else if (t === COMPLETE) {
|
|
627
|
-
|
|
628
|
-
cancelTimer();
|
|
619
|
+
timer.cancel();
|
|
629
620
|
pending.length = 0;
|
|
630
621
|
times.length = 0;
|
|
631
622
|
a.down([[COMPLETE]]);
|
|
632
623
|
} else if (t === ERROR) {
|
|
633
|
-
|
|
634
|
-
cancelTimer();
|
|
624
|
+
timer.cancel();
|
|
635
625
|
pending.length = 0;
|
|
636
626
|
times.length = 0;
|
|
637
627
|
a.down([m]);
|
|
@@ -639,8 +629,7 @@ function rateLimiter(source, maxEvents, windowNs) {
|
|
|
639
629
|
}
|
|
640
630
|
});
|
|
641
631
|
return () => {
|
|
642
|
-
|
|
643
|
-
cancelTimer();
|
|
632
|
+
timer.cancel();
|
|
644
633
|
unsub();
|
|
645
634
|
};
|
|
646
635
|
},
|
|
@@ -701,8 +690,160 @@ function withStatus(src, options) {
|
|
|
701
690
|
error: out.meta.error
|
|
702
691
|
};
|
|
703
692
|
}
|
|
693
|
+
var TimeoutError = class extends Error {
|
|
694
|
+
name = "TimeoutError";
|
|
695
|
+
constructor(ns) {
|
|
696
|
+
super(`Timed out after ${ns / NS_PER_MS}ms`);
|
|
697
|
+
}
|
|
698
|
+
};
|
|
699
|
+
function isNode(x) {
|
|
700
|
+
return x != null && typeof x.subscribe === "function" && typeof x.get === "function";
|
|
701
|
+
}
|
|
702
|
+
function fallback(source, fb) {
|
|
703
|
+
return producer(
|
|
704
|
+
(_d, a) => {
|
|
705
|
+
let fallbackUnsub;
|
|
706
|
+
let sourceUnsub;
|
|
707
|
+
sourceUnsub = source.subscribe((msgs) => {
|
|
708
|
+
for (const m of msgs) {
|
|
709
|
+
const t = m[0];
|
|
710
|
+
if (t === DIRTY) a.down([[DIRTY]]);
|
|
711
|
+
else if (t === DATA) a.emit(m[1]);
|
|
712
|
+
else if (t === RESOLVED) a.down([[RESOLVED]]);
|
|
713
|
+
else if (t === COMPLETE) a.down([[COMPLETE]]);
|
|
714
|
+
else if (t === ERROR) {
|
|
715
|
+
sourceUnsub?.();
|
|
716
|
+
if (isNode(fb)) {
|
|
717
|
+
fallbackUnsub = fb.subscribe((fMsgs) => {
|
|
718
|
+
a.down(fMsgs);
|
|
719
|
+
});
|
|
720
|
+
const cur = fb.get();
|
|
721
|
+
if (cur !== void 0) a.down([[DATA, cur]]);
|
|
722
|
+
} else {
|
|
723
|
+
a.emit(fb);
|
|
724
|
+
a.down([[COMPLETE]]);
|
|
725
|
+
}
|
|
726
|
+
return;
|
|
727
|
+
} else if (t === TEARDOWN) {
|
|
728
|
+
fallbackUnsub?.();
|
|
729
|
+
a.down([m]);
|
|
730
|
+
return;
|
|
731
|
+
} else a.down([m]);
|
|
732
|
+
}
|
|
733
|
+
});
|
|
734
|
+
return () => {
|
|
735
|
+
sourceUnsub?.();
|
|
736
|
+
fallbackUnsub?.();
|
|
737
|
+
};
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
...operatorOpts(),
|
|
741
|
+
initial: source.get()
|
|
742
|
+
}
|
|
743
|
+
);
|
|
744
|
+
}
|
|
745
|
+
function timeout(source, timeoutNs) {
|
|
746
|
+
if (timeoutNs <= 0) throw new RangeError("timeoutNs must be > 0");
|
|
747
|
+
return producer(
|
|
748
|
+
(_d, a) => {
|
|
749
|
+
let stopped = false;
|
|
750
|
+
const timer = new ResettableTimer();
|
|
751
|
+
function startTimer() {
|
|
752
|
+
const delayMs = timeoutNs / NS_PER_MS;
|
|
753
|
+
timer.start(delayMs, () => {
|
|
754
|
+
if (stopped) return;
|
|
755
|
+
stopped = true;
|
|
756
|
+
unsub();
|
|
757
|
+
a.down([[ERROR, new TimeoutError(timeoutNs)]]);
|
|
758
|
+
});
|
|
759
|
+
}
|
|
760
|
+
const unsub = source.subscribe((msgs) => {
|
|
761
|
+
for (const m of msgs) {
|
|
762
|
+
if (stopped) return;
|
|
763
|
+
const t = m[0];
|
|
764
|
+
if (t === DIRTY) a.down([[DIRTY]]);
|
|
765
|
+
else if (t === DATA) {
|
|
766
|
+
startTimer();
|
|
767
|
+
a.emit(m[1]);
|
|
768
|
+
} else if (t === RESOLVED) a.down([[RESOLVED]]);
|
|
769
|
+
else if (t === COMPLETE) {
|
|
770
|
+
timer.cancel();
|
|
771
|
+
stopped = true;
|
|
772
|
+
a.down([[COMPLETE]]);
|
|
773
|
+
return;
|
|
774
|
+
} else if (t === ERROR) {
|
|
775
|
+
timer.cancel();
|
|
776
|
+
stopped = true;
|
|
777
|
+
a.down([m]);
|
|
778
|
+
return;
|
|
779
|
+
} else if (t === TEARDOWN) {
|
|
780
|
+
timer.cancel();
|
|
781
|
+
stopped = true;
|
|
782
|
+
a.down([m]);
|
|
783
|
+
return;
|
|
784
|
+
} else a.down([m]);
|
|
785
|
+
}
|
|
786
|
+
});
|
|
787
|
+
startTimer();
|
|
788
|
+
return () => {
|
|
789
|
+
stopped = true;
|
|
790
|
+
timer.cancel();
|
|
791
|
+
unsub();
|
|
792
|
+
};
|
|
793
|
+
},
|
|
794
|
+
{
|
|
795
|
+
...operatorOpts(),
|
|
796
|
+
initial: source.get()
|
|
797
|
+
}
|
|
798
|
+
);
|
|
799
|
+
}
|
|
800
|
+
function cache(source, ttlNs) {
|
|
801
|
+
if (ttlNs <= 0) throw new RangeError("ttlNs must be > 0");
|
|
802
|
+
let cachedValue;
|
|
803
|
+
let cachedAt = 0;
|
|
804
|
+
let hasCached = false;
|
|
805
|
+
return producer(
|
|
806
|
+
(_d, a) => {
|
|
807
|
+
if (hasCached && monotonicNs() - cachedAt < ttlNs) {
|
|
808
|
+
a.down([[DATA, cachedValue]]);
|
|
809
|
+
}
|
|
810
|
+
const unsub = source.subscribe((msgs) => {
|
|
811
|
+
for (const m of msgs) {
|
|
812
|
+
const t = m[0];
|
|
813
|
+
if (t === DATA) {
|
|
814
|
+
cachedValue = m[1];
|
|
815
|
+
cachedAt = monotonicNs();
|
|
816
|
+
hasCached = true;
|
|
817
|
+
a.emit(cachedValue);
|
|
818
|
+
} else if (t === DIRTY) a.down([[DIRTY]]);
|
|
819
|
+
else if (t === RESOLVED) a.down([[RESOLVED]]);
|
|
820
|
+
else if (t === COMPLETE) a.down([[COMPLETE]]);
|
|
821
|
+
else if (t === ERROR) a.down([m]);
|
|
822
|
+
else a.down([m]);
|
|
823
|
+
}
|
|
824
|
+
});
|
|
825
|
+
return unsub;
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
...operatorOpts(),
|
|
829
|
+
resubscribable: true,
|
|
830
|
+
initial: source.get()
|
|
831
|
+
}
|
|
832
|
+
);
|
|
833
|
+
}
|
|
704
834
|
|
|
705
835
|
// src/extra/adapters.ts
|
|
836
|
+
function createSinkErrorHandler(userHandler) {
|
|
837
|
+
const errorsNode = state(null);
|
|
838
|
+
const handler = (err) => {
|
|
839
|
+
userHandler?.(err);
|
|
840
|
+
try {
|
|
841
|
+
errorsNode.down([[DATA, err]]);
|
|
842
|
+
} catch {
|
|
843
|
+
}
|
|
844
|
+
};
|
|
845
|
+
return { errorsNode, handler };
|
|
846
|
+
}
|
|
706
847
|
function sourceOpts(opts) {
|
|
707
848
|
return { describeKind: "producer", ...opts };
|
|
708
849
|
}
|
|
@@ -1005,7 +1146,7 @@ function toWebSocket(source, socket, opts) {
|
|
|
1005
1146
|
};
|
|
1006
1147
|
const inner = node([source], () => void 0, {
|
|
1007
1148
|
describeKind: "effect",
|
|
1008
|
-
onMessage(msg) {
|
|
1149
|
+
onMessage(msg, _depIndex, _actions) {
|
|
1009
1150
|
if (msg[0] === DATA) {
|
|
1010
1151
|
let serialized;
|
|
1011
1152
|
try {
|
|
@@ -1453,10 +1594,11 @@ function toKafka(source, kafkaProducer, topic, opts) {
|
|
|
1453
1594
|
onTransportError,
|
|
1454
1595
|
...rest
|
|
1455
1596
|
} = opts ?? {};
|
|
1597
|
+
const { errorsNode, handler } = createSinkErrorHandler(onTransportError);
|
|
1456
1598
|
const inner = node([source], () => void 0, {
|
|
1457
1599
|
describeKind: "effect",
|
|
1458
1600
|
...rest,
|
|
1459
|
-
onMessage(msg) {
|
|
1601
|
+
onMessage(msg, _depIndex, _actions) {
|
|
1460
1602
|
if (msg[0] === DATA) {
|
|
1461
1603
|
const value = msg[1];
|
|
1462
1604
|
const key = keyExtractor?.(value) ?? null;
|
|
@@ -1464,7 +1606,7 @@ function toKafka(source, kafkaProducer, topic, opts) {
|
|
|
1464
1606
|
try {
|
|
1465
1607
|
serialized = serialize(value);
|
|
1466
1608
|
} catch (err) {
|
|
1467
|
-
|
|
1609
|
+
handler({
|
|
1468
1610
|
stage: "serialize",
|
|
1469
1611
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
1470
1612
|
value
|
|
@@ -1475,7 +1617,7 @@ function toKafka(source, kafkaProducer, topic, opts) {
|
|
|
1475
1617
|
topic,
|
|
1476
1618
|
messages: [{ key, value: Buffer.from(serialized) }]
|
|
1477
1619
|
}).catch((err) => {
|
|
1478
|
-
|
|
1620
|
+
handler({
|
|
1479
1621
|
stage: "send",
|
|
1480
1622
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
1481
1623
|
value
|
|
@@ -1486,8 +1628,15 @@ function toKafka(source, kafkaProducer, topic, opts) {
|
|
|
1486
1628
|
return false;
|
|
1487
1629
|
}
|
|
1488
1630
|
});
|
|
1489
|
-
|
|
1631
|
+
const unsub = inner.subscribe(() => {
|
|
1490
1632
|
});
|
|
1633
|
+
return {
|
|
1634
|
+
dispose: () => {
|
|
1635
|
+
unsub();
|
|
1636
|
+
errorsNode.down([[TEARDOWN]]);
|
|
1637
|
+
},
|
|
1638
|
+
errors: errorsNode
|
|
1639
|
+
};
|
|
1491
1640
|
}
|
|
1492
1641
|
function fromRedisStream(client, key, opts) {
|
|
1493
1642
|
const {
|
|
@@ -1552,17 +1701,18 @@ function toRedisStream(source, client, key, opts) {
|
|
|
1552
1701
|
onTransportError,
|
|
1553
1702
|
...rest
|
|
1554
1703
|
} = opts ?? {};
|
|
1704
|
+
const { errorsNode, handler } = createSinkErrorHandler(onTransportError);
|
|
1555
1705
|
const inner = node([source], () => void 0, {
|
|
1556
1706
|
describeKind: "effect",
|
|
1557
1707
|
...rest,
|
|
1558
|
-
onMessage(msg) {
|
|
1708
|
+
onMessage(msg, _depIndex, _actions) {
|
|
1559
1709
|
if (msg[0] === DATA) {
|
|
1560
1710
|
const value = msg[1];
|
|
1561
1711
|
let fields;
|
|
1562
1712
|
try {
|
|
1563
1713
|
fields = serialize(value);
|
|
1564
1714
|
} catch (err) {
|
|
1565
|
-
|
|
1715
|
+
handler({
|
|
1566
1716
|
stage: "serialize",
|
|
1567
1717
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
1568
1718
|
value
|
|
@@ -1571,7 +1721,7 @@ function toRedisStream(source, client, key, opts) {
|
|
|
1571
1721
|
}
|
|
1572
1722
|
const send = maxLen !== void 0 ? client.xadd(key, "MAXLEN", "~", String(maxLen), "*", ...fields) : client.xadd(key, "*", ...fields);
|
|
1573
1723
|
void send.catch((err) => {
|
|
1574
|
-
|
|
1724
|
+
handler({
|
|
1575
1725
|
stage: "send",
|
|
1576
1726
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
1577
1727
|
value
|
|
@@ -1582,8 +1732,15 @@ function toRedisStream(source, client, key, opts) {
|
|
|
1582
1732
|
return false;
|
|
1583
1733
|
}
|
|
1584
1734
|
});
|
|
1585
|
-
|
|
1735
|
+
const unsub = inner.subscribe(() => {
|
|
1586
1736
|
});
|
|
1737
|
+
return {
|
|
1738
|
+
dispose: () => {
|
|
1739
|
+
unsub();
|
|
1740
|
+
errorsNode.down([[TEARDOWN]]);
|
|
1741
|
+
},
|
|
1742
|
+
errors: errorsNode
|
|
1743
|
+
};
|
|
1587
1744
|
}
|
|
1588
1745
|
function fromCSV(source, opts) {
|
|
1589
1746
|
const {
|
|
@@ -1810,17 +1967,18 @@ function toPulsar(source, pulsarProducer, opts) {
|
|
|
1810
1967
|
onTransportError,
|
|
1811
1968
|
...rest
|
|
1812
1969
|
} = opts ?? {};
|
|
1970
|
+
const { errorsNode, handler } = createSinkErrorHandler(onTransportError);
|
|
1813
1971
|
const inner = node([source], () => void 0, {
|
|
1814
1972
|
describeKind: "effect",
|
|
1815
1973
|
...rest,
|
|
1816
|
-
onMessage(msg) {
|
|
1974
|
+
onMessage(msg, _depIndex, _actions) {
|
|
1817
1975
|
if (msg[0] === DATA) {
|
|
1818
1976
|
const value = msg[1];
|
|
1819
1977
|
let data;
|
|
1820
1978
|
try {
|
|
1821
1979
|
data = serialize(value);
|
|
1822
1980
|
} catch (err) {
|
|
1823
|
-
|
|
1981
|
+
handler({
|
|
1824
1982
|
stage: "serialize",
|
|
1825
1983
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
1826
1984
|
value
|
|
@@ -1832,7 +1990,7 @@ function toPulsar(source, pulsarProducer, opts) {
|
|
|
1832
1990
|
partitionKey: keyExtractor?.(value),
|
|
1833
1991
|
properties: propertiesExtractor?.(value)
|
|
1834
1992
|
}).catch((err) => {
|
|
1835
|
-
|
|
1993
|
+
handler({
|
|
1836
1994
|
stage: "send",
|
|
1837
1995
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
1838
1996
|
value
|
|
@@ -1843,8 +2001,15 @@ function toPulsar(source, pulsarProducer, opts) {
|
|
|
1843
2001
|
return false;
|
|
1844
2002
|
}
|
|
1845
2003
|
});
|
|
1846
|
-
|
|
2004
|
+
const unsub = inner.subscribe(() => {
|
|
1847
2005
|
});
|
|
2006
|
+
return {
|
|
2007
|
+
dispose: () => {
|
|
2008
|
+
unsub();
|
|
2009
|
+
errorsNode.down([[TEARDOWN]]);
|
|
2010
|
+
},
|
|
2011
|
+
errors: errorsNode
|
|
2012
|
+
};
|
|
1848
2013
|
}
|
|
1849
2014
|
function fromNATS(client, subject, opts) {
|
|
1850
2015
|
const decoder = new TextDecoder();
|
|
@@ -1900,17 +2065,18 @@ function toNATS(source, client, subject, opts) {
|
|
|
1900
2065
|
onTransportError,
|
|
1901
2066
|
...rest
|
|
1902
2067
|
} = opts ?? {};
|
|
2068
|
+
const { errorsNode, handler } = createSinkErrorHandler(onTransportError);
|
|
1903
2069
|
const inner = node([source], () => void 0, {
|
|
1904
2070
|
describeKind: "effect",
|
|
1905
2071
|
...rest,
|
|
1906
|
-
onMessage(msg) {
|
|
2072
|
+
onMessage(msg, _depIndex, _actions) {
|
|
1907
2073
|
if (msg[0] === DATA) {
|
|
1908
2074
|
const value = msg[1];
|
|
1909
2075
|
let data;
|
|
1910
2076
|
try {
|
|
1911
2077
|
data = serialize(value);
|
|
1912
2078
|
} catch (err) {
|
|
1913
|
-
|
|
2079
|
+
handler({
|
|
1914
2080
|
stage: "serialize",
|
|
1915
2081
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
1916
2082
|
value
|
|
@@ -1920,7 +2086,7 @@ function toNATS(source, client, subject, opts) {
|
|
|
1920
2086
|
try {
|
|
1921
2087
|
client.publish(subject, data);
|
|
1922
2088
|
} catch (err) {
|
|
1923
|
-
|
|
2089
|
+
handler({
|
|
1924
2090
|
stage: "send",
|
|
1925
2091
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
1926
2092
|
value
|
|
@@ -1931,8 +2097,15 @@ function toNATS(source, client, subject, opts) {
|
|
|
1931
2097
|
return false;
|
|
1932
2098
|
}
|
|
1933
2099
|
});
|
|
1934
|
-
|
|
2100
|
+
const unsub = inner.subscribe(() => {
|
|
1935
2101
|
});
|
|
2102
|
+
return {
|
|
2103
|
+
dispose: () => {
|
|
2104
|
+
unsub();
|
|
2105
|
+
errorsNode.down([[TEARDOWN]]);
|
|
2106
|
+
},
|
|
2107
|
+
errors: errorsNode
|
|
2108
|
+
};
|
|
1936
2109
|
}
|
|
1937
2110
|
function fromRabbitMQ(channel, queue, opts) {
|
|
1938
2111
|
const {
|
|
@@ -1994,17 +2167,18 @@ function toRabbitMQ(source, channel, exchange, opts) {
|
|
|
1994
2167
|
onTransportError,
|
|
1995
2168
|
...rest
|
|
1996
2169
|
} = opts ?? {};
|
|
2170
|
+
const { errorsNode, handler } = createSinkErrorHandler(onTransportError);
|
|
1997
2171
|
const inner = node([source], () => void 0, {
|
|
1998
2172
|
describeKind: "effect",
|
|
1999
2173
|
...rest,
|
|
2000
|
-
onMessage(msg) {
|
|
2174
|
+
onMessage(msg, _depIndex, _actions) {
|
|
2001
2175
|
if (msg[0] === DATA) {
|
|
2002
2176
|
const value = msg[1];
|
|
2003
2177
|
let routingKey;
|
|
2004
2178
|
try {
|
|
2005
2179
|
routingKey = routingKeyExtractor(value);
|
|
2006
2180
|
} catch (err) {
|
|
2007
|
-
|
|
2181
|
+
handler({
|
|
2008
2182
|
stage: "routing_key",
|
|
2009
2183
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
2010
2184
|
value
|
|
@@ -2015,7 +2189,7 @@ function toRabbitMQ(source, channel, exchange, opts) {
|
|
|
2015
2189
|
try {
|
|
2016
2190
|
content = serialize(value);
|
|
2017
2191
|
} catch (err) {
|
|
2018
|
-
|
|
2192
|
+
handler({
|
|
2019
2193
|
stage: "serialize",
|
|
2020
2194
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
2021
2195
|
value
|
|
@@ -2025,7 +2199,7 @@ function toRabbitMQ(source, channel, exchange, opts) {
|
|
|
2025
2199
|
try {
|
|
2026
2200
|
channel.publish(exchange, routingKey, content);
|
|
2027
2201
|
} catch (err) {
|
|
2028
|
-
|
|
2202
|
+
handler({
|
|
2029
2203
|
stage: "send",
|
|
2030
2204
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
2031
2205
|
value
|
|
@@ -2036,8 +2210,15 @@ function toRabbitMQ(source, channel, exchange, opts) {
|
|
|
2036
2210
|
return false;
|
|
2037
2211
|
}
|
|
2038
2212
|
});
|
|
2039
|
-
|
|
2213
|
+
const unsub = inner.subscribe(() => {
|
|
2040
2214
|
});
|
|
2215
|
+
return {
|
|
2216
|
+
dispose: () => {
|
|
2217
|
+
unsub();
|
|
2218
|
+
errorsNode.down([[TEARDOWN]]);
|
|
2219
|
+
},
|
|
2220
|
+
errors: errorsNode
|
|
2221
|
+
};
|
|
2041
2222
|
}
|
|
2042
2223
|
function toFile(source, writer, opts) {
|
|
2043
2224
|
const {
|
|
@@ -2049,8 +2230,10 @@ function toFile(source, writer, opts) {
|
|
|
2049
2230
|
mode: _mode,
|
|
2050
2231
|
...rest
|
|
2051
2232
|
} = opts ?? {};
|
|
2233
|
+
const { errorsNode, handler } = createSinkErrorHandler(onTransportError);
|
|
2052
2234
|
let buffer2 = [];
|
|
2053
2235
|
let timer;
|
|
2236
|
+
let disposed = false;
|
|
2054
2237
|
const doFlush = () => {
|
|
2055
2238
|
if (buffer2.length === 0) return;
|
|
2056
2239
|
const chunk = buffer2.join("");
|
|
@@ -2058,7 +2241,7 @@ function toFile(source, writer, opts) {
|
|
|
2058
2241
|
try {
|
|
2059
2242
|
writer.write(chunk);
|
|
2060
2243
|
} catch (err) {
|
|
2061
|
-
|
|
2244
|
+
handler({
|
|
2062
2245
|
stage: "send",
|
|
2063
2246
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
2064
2247
|
value: chunk
|
|
@@ -2066,7 +2249,7 @@ function toFile(source, writer, opts) {
|
|
|
2066
2249
|
}
|
|
2067
2250
|
};
|
|
2068
2251
|
const scheduleFlush = () => {
|
|
2069
|
-
if (flushIntervalMs > 0 && timer === void 0) {
|
|
2252
|
+
if (flushIntervalMs > 0 && timer === void 0 && !disposed) {
|
|
2070
2253
|
timer = setTimeout(() => {
|
|
2071
2254
|
timer = void 0;
|
|
2072
2255
|
doFlush();
|
|
@@ -2077,14 +2260,14 @@ function toFile(source, writer, opts) {
|
|
|
2077
2260
|
const inner = node([source], () => void 0, {
|
|
2078
2261
|
describeKind: "effect",
|
|
2079
2262
|
...rest,
|
|
2080
|
-
onMessage(msg) {
|
|
2263
|
+
onMessage(msg, _depIndex, _actions) {
|
|
2081
2264
|
if (msg[0] === DATA) {
|
|
2082
2265
|
const value = msg[1];
|
|
2083
2266
|
let line;
|
|
2084
2267
|
try {
|
|
2085
2268
|
line = serialize(value);
|
|
2086
2269
|
} catch (err) {
|
|
2087
|
-
|
|
2270
|
+
handler({
|
|
2088
2271
|
stage: "serialize",
|
|
2089
2272
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
2090
2273
|
value
|
|
@@ -2099,7 +2282,7 @@ function toFile(source, writer, opts) {
|
|
|
2099
2282
|
try {
|
|
2100
2283
|
writer.write(line);
|
|
2101
2284
|
} catch (err) {
|
|
2102
|
-
|
|
2285
|
+
handler({
|
|
2103
2286
|
stage: "send",
|
|
2104
2287
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
2105
2288
|
value
|
|
@@ -2108,7 +2291,7 @@ function toFile(source, writer, opts) {
|
|
|
2108
2291
|
}
|
|
2109
2292
|
return true;
|
|
2110
2293
|
}
|
|
2111
|
-
if (msg[0]
|
|
2294
|
+
if (messageTier(msg[0]) >= 3) {
|
|
2112
2295
|
doFlush();
|
|
2113
2296
|
}
|
|
2114
2297
|
return false;
|
|
@@ -2117,18 +2300,25 @@ function toFile(source, writer, opts) {
|
|
|
2117
2300
|
const unsub = inner.subscribe(() => {
|
|
2118
2301
|
});
|
|
2119
2302
|
const dispose = () => {
|
|
2303
|
+
if (disposed) return;
|
|
2304
|
+
disposed = true;
|
|
2120
2305
|
if (timer !== void 0) {
|
|
2121
2306
|
clearTimeout(timer);
|
|
2122
2307
|
timer = void 0;
|
|
2123
2308
|
}
|
|
2124
2309
|
doFlush();
|
|
2125
|
-
|
|
2310
|
+
try {
|
|
2311
|
+
writer.end();
|
|
2312
|
+
} catch {
|
|
2313
|
+
}
|
|
2126
2314
|
unsub();
|
|
2315
|
+
errorsNode.down([[TEARDOWN]]);
|
|
2127
2316
|
};
|
|
2128
2317
|
return {
|
|
2129
2318
|
dispose,
|
|
2319
|
+
errors: errorsNode,
|
|
2130
2320
|
flush: async () => {
|
|
2131
|
-
doFlush();
|
|
2321
|
+
if (!disposed) doFlush();
|
|
2132
2322
|
}
|
|
2133
2323
|
};
|
|
2134
2324
|
}
|
|
@@ -2179,25 +2369,29 @@ function toClickHouse(source, client, table, opts) {
|
|
|
2179
2369
|
onTransportError,
|
|
2180
2370
|
...rest
|
|
2181
2371
|
} = opts ?? {};
|
|
2372
|
+
const { errorsNode, handler } = createSinkErrorHandler(onTransportError);
|
|
2182
2373
|
let buffer2 = [];
|
|
2183
2374
|
let timer;
|
|
2184
|
-
let
|
|
2375
|
+
let disposed = false;
|
|
2376
|
+
const inFlight = /* @__PURE__ */ new Set();
|
|
2185
2377
|
const doFlush = () => {
|
|
2186
2378
|
if (buffer2.length === 0) return Promise.resolve();
|
|
2187
2379
|
const batch2 = buffer2;
|
|
2188
2380
|
buffer2 = [];
|
|
2189
2381
|
try {
|
|
2190
2382
|
const p = client.insert({ table, values: batch2, format }).catch((err) => {
|
|
2191
|
-
|
|
2383
|
+
handler({
|
|
2192
2384
|
stage: "send",
|
|
2193
2385
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
2194
2386
|
value: batch2
|
|
2195
2387
|
});
|
|
2388
|
+
}).finally(() => {
|
|
2389
|
+
inFlight.delete(p);
|
|
2196
2390
|
});
|
|
2197
|
-
|
|
2391
|
+
inFlight.add(p);
|
|
2198
2392
|
return p;
|
|
2199
2393
|
} catch (err) {
|
|
2200
|
-
|
|
2394
|
+
handler({
|
|
2201
2395
|
stage: "send",
|
|
2202
2396
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
2203
2397
|
value: batch2
|
|
@@ -2206,7 +2400,7 @@ function toClickHouse(source, client, table, opts) {
|
|
|
2206
2400
|
}
|
|
2207
2401
|
};
|
|
2208
2402
|
const scheduleFlush = () => {
|
|
2209
|
-
if (timer === void 0) {
|
|
2403
|
+
if (timer === void 0 && !disposed) {
|
|
2210
2404
|
timer = setTimeout(() => {
|
|
2211
2405
|
timer = void 0;
|
|
2212
2406
|
doFlush();
|
|
@@ -2216,13 +2410,13 @@ function toClickHouse(source, client, table, opts) {
|
|
|
2216
2410
|
const inner = node([source], () => void 0, {
|
|
2217
2411
|
describeKind: "effect",
|
|
2218
2412
|
...rest,
|
|
2219
|
-
onMessage(msg) {
|
|
2413
|
+
onMessage(msg, _depIndex, _actions) {
|
|
2220
2414
|
if (msg[0] === DATA) {
|
|
2221
2415
|
const value = msg[1];
|
|
2222
2416
|
try {
|
|
2223
2417
|
buffer2.push(transform(value));
|
|
2224
2418
|
} catch (err) {
|
|
2225
|
-
|
|
2419
|
+
handler({
|
|
2226
2420
|
stage: "serialize",
|
|
2227
2421
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
2228
2422
|
value
|
|
@@ -2233,7 +2427,7 @@ function toClickHouse(source, client, table, opts) {
|
|
|
2233
2427
|
else scheduleFlush();
|
|
2234
2428
|
return true;
|
|
2235
2429
|
}
|
|
2236
|
-
if (msg[0]
|
|
2430
|
+
if (messageTier(msg[0]) >= 3) {
|
|
2237
2431
|
doFlush();
|
|
2238
2432
|
}
|
|
2239
2433
|
return false;
|
|
@@ -2242,16 +2436,24 @@ function toClickHouse(source, client, table, opts) {
|
|
|
2242
2436
|
const unsub = inner.subscribe(() => {
|
|
2243
2437
|
});
|
|
2244
2438
|
const dispose = () => {
|
|
2439
|
+
if (disposed) return;
|
|
2440
|
+
disposed = true;
|
|
2245
2441
|
if (timer !== void 0) {
|
|
2246
2442
|
clearTimeout(timer);
|
|
2247
2443
|
timer = void 0;
|
|
2248
2444
|
}
|
|
2249
2445
|
doFlush();
|
|
2250
2446
|
unsub();
|
|
2447
|
+
errorsNode.down([[TEARDOWN]]);
|
|
2251
2448
|
};
|
|
2252
2449
|
return {
|
|
2253
2450
|
dispose,
|
|
2254
|
-
|
|
2451
|
+
errors: errorsNode,
|
|
2452
|
+
flush: () => {
|
|
2453
|
+
const p = disposed ? Promise.resolve() : doFlush();
|
|
2454
|
+
return p.then(() => Promise.all(inFlight)).then(() => {
|
|
2455
|
+
});
|
|
2456
|
+
}
|
|
2255
2457
|
};
|
|
2256
2458
|
}
|
|
2257
2459
|
function toS3(source, client, bucket, opts) {
|
|
@@ -2268,10 +2470,12 @@ function toS3(source, client, bucket, opts) {
|
|
|
2268
2470
|
onTransportError,
|
|
2269
2471
|
...rest
|
|
2270
2472
|
} = opts ?? {};
|
|
2473
|
+
const { errorsNode, handler } = createSinkErrorHandler(onTransportError);
|
|
2271
2474
|
let buffer2 = [];
|
|
2272
2475
|
let timer;
|
|
2273
2476
|
let seq = 0;
|
|
2274
|
-
let
|
|
2477
|
+
let disposed = false;
|
|
2478
|
+
const inFlight = /* @__PURE__ */ new Set();
|
|
2275
2479
|
const doFlush = () => {
|
|
2276
2480
|
if (buffer2.length === 0) return Promise.resolve();
|
|
2277
2481
|
const batch2 = buffer2;
|
|
@@ -2284,16 +2488,18 @@ function toS3(source, client, bucket, opts) {
|
|
|
2284
2488
|
try {
|
|
2285
2489
|
const p = client.putObject({ Bucket: bucket, Key: key, Body: body, ContentType: contentType }).then(() => {
|
|
2286
2490
|
}).catch((err) => {
|
|
2287
|
-
|
|
2491
|
+
handler({
|
|
2288
2492
|
stage: "send",
|
|
2289
2493
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
2290
2494
|
value: batch2
|
|
2291
2495
|
});
|
|
2496
|
+
}).finally(() => {
|
|
2497
|
+
inFlight.delete(p);
|
|
2292
2498
|
});
|
|
2293
|
-
|
|
2499
|
+
inFlight.add(p);
|
|
2294
2500
|
return p;
|
|
2295
2501
|
} catch (err) {
|
|
2296
|
-
|
|
2502
|
+
handler({
|
|
2297
2503
|
stage: "send",
|
|
2298
2504
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
2299
2505
|
value: batch2
|
|
@@ -2302,7 +2508,7 @@ function toS3(source, client, bucket, opts) {
|
|
|
2302
2508
|
}
|
|
2303
2509
|
};
|
|
2304
2510
|
const scheduleFlush = () => {
|
|
2305
|
-
if (timer === void 0) {
|
|
2511
|
+
if (timer === void 0 && !disposed) {
|
|
2306
2512
|
timer = setTimeout(() => {
|
|
2307
2513
|
timer = void 0;
|
|
2308
2514
|
doFlush();
|
|
@@ -2312,13 +2518,13 @@ function toS3(source, client, bucket, opts) {
|
|
|
2312
2518
|
const inner = node([source], () => void 0, {
|
|
2313
2519
|
describeKind: "effect",
|
|
2314
2520
|
...rest,
|
|
2315
|
-
onMessage(msg) {
|
|
2521
|
+
onMessage(msg, _depIndex, _actions) {
|
|
2316
2522
|
if (msg[0] === DATA) {
|
|
2317
2523
|
const value = msg[1];
|
|
2318
2524
|
try {
|
|
2319
2525
|
buffer2.push(transform(value));
|
|
2320
2526
|
} catch (err) {
|
|
2321
|
-
|
|
2527
|
+
handler({
|
|
2322
2528
|
stage: "serialize",
|
|
2323
2529
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
2324
2530
|
value
|
|
@@ -2329,7 +2535,7 @@ function toS3(source, client, bucket, opts) {
|
|
|
2329
2535
|
else scheduleFlush();
|
|
2330
2536
|
return true;
|
|
2331
2537
|
}
|
|
2332
|
-
if (msg[0]
|
|
2538
|
+
if (messageTier(msg[0]) >= 3) {
|
|
2333
2539
|
doFlush();
|
|
2334
2540
|
}
|
|
2335
2541
|
return false;
|
|
@@ -2338,16 +2544,24 @@ function toS3(source, client, bucket, opts) {
|
|
|
2338
2544
|
const unsub = inner.subscribe(() => {
|
|
2339
2545
|
});
|
|
2340
2546
|
const dispose = () => {
|
|
2547
|
+
if (disposed) return;
|
|
2548
|
+
disposed = true;
|
|
2341
2549
|
if (timer !== void 0) {
|
|
2342
2550
|
clearTimeout(timer);
|
|
2343
2551
|
timer = void 0;
|
|
2344
2552
|
}
|
|
2345
2553
|
doFlush();
|
|
2346
2554
|
unsub();
|
|
2555
|
+
errorsNode.down([[TEARDOWN]]);
|
|
2347
2556
|
};
|
|
2348
2557
|
return {
|
|
2349
2558
|
dispose,
|
|
2350
|
-
|
|
2559
|
+
errors: errorsNode,
|
|
2560
|
+
flush: () => {
|
|
2561
|
+
const p = disposed ? Promise.resolve() : doFlush();
|
|
2562
|
+
return p.then(() => Promise.all(inFlight)).then(() => {
|
|
2563
|
+
});
|
|
2564
|
+
}
|
|
2351
2565
|
};
|
|
2352
2566
|
}
|
|
2353
2567
|
function toPostgres(source, client, table, opts) {
|
|
@@ -2359,17 +2573,18 @@ function toPostgres(source, client, table, opts) {
|
|
|
2359
2573
|
onTransportError,
|
|
2360
2574
|
...rest
|
|
2361
2575
|
} = opts ?? {};
|
|
2576
|
+
const { errorsNode, handler } = createSinkErrorHandler(onTransportError);
|
|
2362
2577
|
const inner = node([source], () => void 0, {
|
|
2363
2578
|
describeKind: "effect",
|
|
2364
2579
|
...rest,
|
|
2365
|
-
onMessage(msg) {
|
|
2580
|
+
onMessage(msg, _depIndex, _actions) {
|
|
2366
2581
|
if (msg[0] === DATA) {
|
|
2367
2582
|
const value = msg[1];
|
|
2368
2583
|
let query;
|
|
2369
2584
|
try {
|
|
2370
2585
|
query = toSQL(value, table);
|
|
2371
2586
|
} catch (err) {
|
|
2372
|
-
|
|
2587
|
+
handler({
|
|
2373
2588
|
stage: "serialize",
|
|
2374
2589
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
2375
2590
|
value
|
|
@@ -2377,7 +2592,7 @@ function toPostgres(source, client, table, opts) {
|
|
|
2377
2592
|
return true;
|
|
2378
2593
|
}
|
|
2379
2594
|
void client.query(query.sql, query.params).catch((err) => {
|
|
2380
|
-
|
|
2595
|
+
handler({
|
|
2381
2596
|
stage: "send",
|
|
2382
2597
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
2383
2598
|
value
|
|
@@ -2388,22 +2603,30 @@ function toPostgres(source, client, table, opts) {
|
|
|
2388
2603
|
return false;
|
|
2389
2604
|
}
|
|
2390
2605
|
});
|
|
2391
|
-
|
|
2606
|
+
const unsub = inner.subscribe(() => {
|
|
2392
2607
|
});
|
|
2608
|
+
return {
|
|
2609
|
+
dispose: () => {
|
|
2610
|
+
unsub();
|
|
2611
|
+
errorsNode.down([[TEARDOWN]]);
|
|
2612
|
+
},
|
|
2613
|
+
errors: errorsNode
|
|
2614
|
+
};
|
|
2393
2615
|
}
|
|
2394
2616
|
function toMongo(source, collection, opts) {
|
|
2395
2617
|
const { toDocument = (v) => v, onTransportError, ...rest } = opts ?? {};
|
|
2618
|
+
const { errorsNode, handler } = createSinkErrorHandler(onTransportError);
|
|
2396
2619
|
const inner = node([source], () => void 0, {
|
|
2397
2620
|
describeKind: "effect",
|
|
2398
2621
|
...rest,
|
|
2399
|
-
onMessage(msg) {
|
|
2622
|
+
onMessage(msg, _depIndex, _actions) {
|
|
2400
2623
|
if (msg[0] === DATA) {
|
|
2401
2624
|
const value = msg[1];
|
|
2402
2625
|
let doc;
|
|
2403
2626
|
try {
|
|
2404
2627
|
doc = toDocument(value);
|
|
2405
2628
|
} catch (err) {
|
|
2406
|
-
|
|
2629
|
+
handler({
|
|
2407
2630
|
stage: "serialize",
|
|
2408
2631
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
2409
2632
|
value
|
|
@@ -2411,7 +2634,7 @@ function toMongo(source, collection, opts) {
|
|
|
2411
2634
|
return true;
|
|
2412
2635
|
}
|
|
2413
2636
|
void collection.insertOne(doc).catch((err) => {
|
|
2414
|
-
|
|
2637
|
+
handler({
|
|
2415
2638
|
stage: "send",
|
|
2416
2639
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
2417
2640
|
value
|
|
@@ -2422,8 +2645,15 @@ function toMongo(source, collection, opts) {
|
|
|
2422
2645
|
return false;
|
|
2423
2646
|
}
|
|
2424
2647
|
});
|
|
2425
|
-
|
|
2648
|
+
const unsub = inner.subscribe(() => {
|
|
2426
2649
|
});
|
|
2650
|
+
return {
|
|
2651
|
+
dispose: () => {
|
|
2652
|
+
unsub();
|
|
2653
|
+
errorsNode.down([[TEARDOWN]]);
|
|
2654
|
+
},
|
|
2655
|
+
errors: errorsNode
|
|
2656
|
+
};
|
|
2427
2657
|
}
|
|
2428
2658
|
function toLoki(source, client, opts) {
|
|
2429
2659
|
const {
|
|
@@ -2433,17 +2663,18 @@ function toLoki(source, client, opts) {
|
|
|
2433
2663
|
onTransportError,
|
|
2434
2664
|
...rest
|
|
2435
2665
|
} = opts ?? {};
|
|
2666
|
+
const { errorsNode, handler } = createSinkErrorHandler(onTransportError);
|
|
2436
2667
|
const inner = node([source], () => void 0, {
|
|
2437
2668
|
describeKind: "effect",
|
|
2438
2669
|
...rest,
|
|
2439
|
-
onMessage(msg) {
|
|
2670
|
+
onMessage(msg, _depIndex, _actions) {
|
|
2440
2671
|
if (msg[0] === DATA) {
|
|
2441
2672
|
const value = msg[1];
|
|
2442
2673
|
let line;
|
|
2443
2674
|
try {
|
|
2444
2675
|
line = toLine(value);
|
|
2445
2676
|
} catch (err) {
|
|
2446
|
-
|
|
2677
|
+
handler({
|
|
2447
2678
|
stage: "serialize",
|
|
2448
2679
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
2449
2680
|
value
|
|
@@ -2454,7 +2685,7 @@ function toLoki(source, client, opts) {
|
|
|
2454
2685
|
try {
|
|
2455
2686
|
streamLabels = toLabels ? { ...labels, ...toLabels(value) } : labels;
|
|
2456
2687
|
} catch (err) {
|
|
2457
|
-
|
|
2688
|
+
handler({
|
|
2458
2689
|
stage: "serialize",
|
|
2459
2690
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
2460
2691
|
value
|
|
@@ -2463,7 +2694,7 @@ function toLoki(source, client, opts) {
|
|
|
2463
2694
|
}
|
|
2464
2695
|
const ts = `${wallClockNs()}`;
|
|
2465
2696
|
void client.push({ streams: [{ stream: streamLabels, values: [[ts, line]] }] }).catch((err) => {
|
|
2466
|
-
|
|
2697
|
+
handler({
|
|
2467
2698
|
stage: "send",
|
|
2468
2699
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
2469
2700
|
value
|
|
@@ -2474,22 +2705,30 @@ function toLoki(source, client, opts) {
|
|
|
2474
2705
|
return false;
|
|
2475
2706
|
}
|
|
2476
2707
|
});
|
|
2477
|
-
|
|
2708
|
+
const unsub = inner.subscribe(() => {
|
|
2478
2709
|
});
|
|
2710
|
+
return {
|
|
2711
|
+
dispose: () => {
|
|
2712
|
+
unsub();
|
|
2713
|
+
errorsNode.down([[TEARDOWN]]);
|
|
2714
|
+
},
|
|
2715
|
+
errors: errorsNode
|
|
2716
|
+
};
|
|
2479
2717
|
}
|
|
2480
2718
|
function toTempo(source, client, opts) {
|
|
2481
2719
|
const { toResourceSpans = (v) => [v], onTransportError, ...rest } = opts ?? {};
|
|
2720
|
+
const { errorsNode, handler } = createSinkErrorHandler(onTransportError);
|
|
2482
2721
|
const inner = node([source], () => void 0, {
|
|
2483
2722
|
describeKind: "effect",
|
|
2484
2723
|
...rest,
|
|
2485
|
-
onMessage(msg) {
|
|
2724
|
+
onMessage(msg, _depIndex, _actions) {
|
|
2486
2725
|
if (msg[0] === DATA) {
|
|
2487
2726
|
const value = msg[1];
|
|
2488
2727
|
let spans;
|
|
2489
2728
|
try {
|
|
2490
2729
|
spans = toResourceSpans(value);
|
|
2491
2730
|
} catch (err) {
|
|
2492
|
-
|
|
2731
|
+
handler({
|
|
2493
2732
|
stage: "serialize",
|
|
2494
2733
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
2495
2734
|
value
|
|
@@ -2497,7 +2736,7 @@ function toTempo(source, client, opts) {
|
|
|
2497
2736
|
return true;
|
|
2498
2737
|
}
|
|
2499
2738
|
void client.push({ resourceSpans: spans }).catch((err) => {
|
|
2500
|
-
|
|
2739
|
+
handler({
|
|
2501
2740
|
stage: "send",
|
|
2502
2741
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
2503
2742
|
value
|
|
@@ -2508,15 +2747,22 @@ function toTempo(source, client, opts) {
|
|
|
2508
2747
|
return false;
|
|
2509
2748
|
}
|
|
2510
2749
|
});
|
|
2511
|
-
|
|
2750
|
+
const unsub = inner.subscribe(() => {
|
|
2512
2751
|
});
|
|
2752
|
+
return {
|
|
2753
|
+
dispose: () => {
|
|
2754
|
+
unsub();
|
|
2755
|
+
errorsNode.down([[TEARDOWN]]);
|
|
2756
|
+
},
|
|
2757
|
+
errors: errorsNode
|
|
2758
|
+
};
|
|
2513
2759
|
}
|
|
2514
2760
|
function checkpointToS3(graph, client, bucket, opts) {
|
|
2515
2761
|
const { prefix = "checkpoints/", debounceMs, compactEvery, onError } = opts ?? {};
|
|
2516
2762
|
const adapter = {
|
|
2517
|
-
save(data) {
|
|
2763
|
+
save(_key, data) {
|
|
2518
2764
|
const ms = Math.floor(wallClockNs() / 1e6);
|
|
2519
|
-
const
|
|
2765
|
+
const s3Key = `${prefix}${graph.name}/checkpoint-${ms}.json`;
|
|
2520
2766
|
let body;
|
|
2521
2767
|
try {
|
|
2522
2768
|
body = JSON.stringify(data);
|
|
@@ -2526,7 +2772,7 @@ function checkpointToS3(graph, client, bucket, opts) {
|
|
|
2526
2772
|
}
|
|
2527
2773
|
void client.putObject({
|
|
2528
2774
|
Bucket: bucket,
|
|
2529
|
-
Key:
|
|
2775
|
+
Key: s3Key,
|
|
2530
2776
|
Body: body,
|
|
2531
2777
|
ContentType: "application/json"
|
|
2532
2778
|
}).catch((err) => onError?.(err));
|
|
@@ -2536,9 +2782,9 @@ function checkpointToS3(graph, client, bucket, opts) {
|
|
|
2536
2782
|
}
|
|
2537
2783
|
function checkpointToRedis(graph, client, opts) {
|
|
2538
2784
|
const { prefix = "graphrefly:checkpoint:", debounceMs, compactEvery, onError } = opts ?? {};
|
|
2539
|
-
const
|
|
2785
|
+
const redisKey = `${prefix}${graph.name}`;
|
|
2540
2786
|
const adapter = {
|
|
2541
|
-
save(data) {
|
|
2787
|
+
save(_key, data) {
|
|
2542
2788
|
let body;
|
|
2543
2789
|
try {
|
|
2544
2790
|
body = JSON.stringify(data);
|
|
@@ -2546,11 +2792,449 @@ function checkpointToRedis(graph, client, opts) {
|
|
|
2546
2792
|
onError?.(err);
|
|
2547
2793
|
return;
|
|
2548
2794
|
}
|
|
2549
|
-
void client.set(
|
|
2795
|
+
void client.set(redisKey, body).catch((err) => onError?.(err));
|
|
2550
2796
|
}
|
|
2551
2797
|
};
|
|
2552
2798
|
return graph.autoCheckpoint(adapter, { debounceMs, compactEvery, onError });
|
|
2553
2799
|
}
|
|
2800
|
+
function fromSqlite(db, query, opts) {
|
|
2801
|
+
const { mapRow = (r) => r, params, ...rest } = opts ?? {};
|
|
2802
|
+
return producer(
|
|
2803
|
+
(_d, a) => {
|
|
2804
|
+
let mapped;
|
|
2805
|
+
try {
|
|
2806
|
+
const rows = db.query(query, params);
|
|
2807
|
+
mapped = rows.map(mapRow);
|
|
2808
|
+
} catch (err) {
|
|
2809
|
+
a.down([[ERROR, err instanceof Error ? err : new Error(String(err))]]);
|
|
2810
|
+
return void 0;
|
|
2811
|
+
}
|
|
2812
|
+
batch(() => {
|
|
2813
|
+
for (const item of mapped) {
|
|
2814
|
+
a.down([[DATA, item]]);
|
|
2815
|
+
}
|
|
2816
|
+
a.down([[COMPLETE]]);
|
|
2817
|
+
});
|
|
2818
|
+
return void 0;
|
|
2819
|
+
},
|
|
2820
|
+
{ describeKind: "producer", completeWhenDepsComplete: false, ...rest }
|
|
2821
|
+
);
|
|
2822
|
+
}
|
|
2823
|
+
function toSqlite(source, db, table, opts) {
|
|
2824
|
+
if (table.includes("\0") || table.length === 0) {
|
|
2825
|
+
throw new Error(`toSqlite: invalid table name: ${JSON.stringify(table)}`);
|
|
2826
|
+
}
|
|
2827
|
+
const {
|
|
2828
|
+
toSQL = (v, t) => ({
|
|
2829
|
+
sql: `INSERT INTO "${t.replace(/"/g, '""')}" (data) VALUES (?)`,
|
|
2830
|
+
params: [JSON.stringify(v)]
|
|
2831
|
+
}),
|
|
2832
|
+
onTransportError,
|
|
2833
|
+
batchInsert = false,
|
|
2834
|
+
maxBatchSize = 1e3,
|
|
2835
|
+
flushIntervalMs = 0,
|
|
2836
|
+
...rest
|
|
2837
|
+
} = opts ?? {};
|
|
2838
|
+
const { errorsNode, handler } = createSinkErrorHandler(onTransportError);
|
|
2839
|
+
const pendingInserts = [];
|
|
2840
|
+
let flushing = false;
|
|
2841
|
+
let disposed = false;
|
|
2842
|
+
let timer;
|
|
2843
|
+
function flushTransaction() {
|
|
2844
|
+
if (pendingInserts.length === 0 || flushing) return;
|
|
2845
|
+
flushing = true;
|
|
2846
|
+
try {
|
|
2847
|
+
db.query("BEGIN", []);
|
|
2848
|
+
} catch (err) {
|
|
2849
|
+
flushing = false;
|
|
2850
|
+
handler({
|
|
2851
|
+
stage: "send",
|
|
2852
|
+
error: err instanceof Error ? err : new Error(String(err)),
|
|
2853
|
+
value: void 0
|
|
2854
|
+
});
|
|
2855
|
+
return;
|
|
2856
|
+
}
|
|
2857
|
+
const batch2 = pendingInserts.splice(0);
|
|
2858
|
+
let firstError;
|
|
2859
|
+
for (const q of batch2) {
|
|
2860
|
+
try {
|
|
2861
|
+
db.query(q.sql, q.params);
|
|
2862
|
+
} catch (err) {
|
|
2863
|
+
firstError = err instanceof Error ? err : new Error(String(err));
|
|
2864
|
+
break;
|
|
2865
|
+
}
|
|
2866
|
+
}
|
|
2867
|
+
if (firstError) {
|
|
2868
|
+
try {
|
|
2869
|
+
db.query("ROLLBACK", []);
|
|
2870
|
+
} catch {
|
|
2871
|
+
}
|
|
2872
|
+
handler({ stage: "send", error: firstError, value: void 0 });
|
|
2873
|
+
} else {
|
|
2874
|
+
try {
|
|
2875
|
+
db.query("COMMIT", []);
|
|
2876
|
+
} catch (err) {
|
|
2877
|
+
handler({
|
|
2878
|
+
stage: "send",
|
|
2879
|
+
error: err instanceof Error ? err : new Error(String(err)),
|
|
2880
|
+
value: void 0
|
|
2881
|
+
});
|
|
2882
|
+
}
|
|
2883
|
+
}
|
|
2884
|
+
flushing = false;
|
|
2885
|
+
}
|
|
2886
|
+
const scheduleFlush = () => {
|
|
2887
|
+
if (batchInsert && flushIntervalMs > 0 && timer === void 0 && !disposed) {
|
|
2888
|
+
timer = setTimeout(() => {
|
|
2889
|
+
timer = void 0;
|
|
2890
|
+
flushTransaction();
|
|
2891
|
+
}, flushIntervalMs);
|
|
2892
|
+
}
|
|
2893
|
+
};
|
|
2894
|
+
const inner = node([source], () => void 0, {
|
|
2895
|
+
describeKind: "effect",
|
|
2896
|
+
...rest,
|
|
2897
|
+
onMessage(msg, _depIndex, _actions) {
|
|
2898
|
+
if (msg[0] === DATA) {
|
|
2899
|
+
const value = msg[1];
|
|
2900
|
+
let query;
|
|
2901
|
+
try {
|
|
2902
|
+
query = toSQL(value, table);
|
|
2903
|
+
} catch (err) {
|
|
2904
|
+
handler({
|
|
2905
|
+
stage: "serialize",
|
|
2906
|
+
error: err instanceof Error ? err : new Error(String(err)),
|
|
2907
|
+
value
|
|
2908
|
+
});
|
|
2909
|
+
return true;
|
|
2910
|
+
}
|
|
2911
|
+
if (batchInsert) {
|
|
2912
|
+
pendingInserts.push(query);
|
|
2913
|
+
if (pendingInserts.length >= maxBatchSize) flushTransaction();
|
|
2914
|
+
else scheduleFlush();
|
|
2915
|
+
} else {
|
|
2916
|
+
try {
|
|
2917
|
+
db.query(query.sql, query.params);
|
|
2918
|
+
} catch (err) {
|
|
2919
|
+
handler({
|
|
2920
|
+
stage: "send",
|
|
2921
|
+
error: err instanceof Error ? err : new Error(String(err)),
|
|
2922
|
+
value
|
|
2923
|
+
});
|
|
2924
|
+
}
|
|
2925
|
+
}
|
|
2926
|
+
return true;
|
|
2927
|
+
}
|
|
2928
|
+
if (batchInsert && messageTier(msg[0]) >= 3) {
|
|
2929
|
+
flushTransaction();
|
|
2930
|
+
}
|
|
2931
|
+
return false;
|
|
2932
|
+
}
|
|
2933
|
+
});
|
|
2934
|
+
const unsub = inner.subscribe(() => {
|
|
2935
|
+
});
|
|
2936
|
+
const dispose = () => {
|
|
2937
|
+
if (disposed) return;
|
|
2938
|
+
disposed = true;
|
|
2939
|
+
if (timer !== void 0) {
|
|
2940
|
+
clearTimeout(timer);
|
|
2941
|
+
timer = void 0;
|
|
2942
|
+
}
|
|
2943
|
+
if (batchInsert) flushTransaction();
|
|
2944
|
+
unsub();
|
|
2945
|
+
errorsNode.down([[TEARDOWN]]);
|
|
2946
|
+
};
|
|
2947
|
+
return {
|
|
2948
|
+
dispose,
|
|
2949
|
+
errors: errorsNode,
|
|
2950
|
+
flush: batchInsert ? async () => {
|
|
2951
|
+
if (!disposed) flushTransaction();
|
|
2952
|
+
} : void 0
|
|
2953
|
+
};
|
|
2954
|
+
}
|
|
2955
|
+
function fromPrisma(model, opts) {
|
|
2956
|
+
const { args, mapRow = (r) => r, ...rest } = opts ?? {};
|
|
2957
|
+
return producer(
|
|
2958
|
+
(_d, a) => {
|
|
2959
|
+
let active = true;
|
|
2960
|
+
void model.findMany(args).then((rows) => {
|
|
2961
|
+
if (!active) return;
|
|
2962
|
+
const mapped = rows.map(mapRow);
|
|
2963
|
+
batch(() => {
|
|
2964
|
+
for (const item of mapped) {
|
|
2965
|
+
a.emit(item);
|
|
2966
|
+
}
|
|
2967
|
+
});
|
|
2968
|
+
a.down([[COMPLETE]]);
|
|
2969
|
+
}).catch((err) => {
|
|
2970
|
+
if (!active) return;
|
|
2971
|
+
try {
|
|
2972
|
+
a.down([[ERROR, err instanceof Error ? err : new Error(String(err))]]);
|
|
2973
|
+
} catch {
|
|
2974
|
+
}
|
|
2975
|
+
});
|
|
2976
|
+
return () => {
|
|
2977
|
+
active = false;
|
|
2978
|
+
};
|
|
2979
|
+
},
|
|
2980
|
+
{ ...rest, describeKind: "producer", completeWhenDepsComplete: false }
|
|
2981
|
+
);
|
|
2982
|
+
}
|
|
2983
|
+
function fromDrizzle(query, opts) {
|
|
2984
|
+
const { mapRow = (r) => r, ...rest } = opts ?? {};
|
|
2985
|
+
return producer(
|
|
2986
|
+
(_d, a) => {
|
|
2987
|
+
let active = true;
|
|
2988
|
+
void query.execute().then((rows) => {
|
|
2989
|
+
if (!active) return;
|
|
2990
|
+
const mapped = rows.map(mapRow);
|
|
2991
|
+
batch(() => {
|
|
2992
|
+
for (const item of mapped) {
|
|
2993
|
+
a.emit(item);
|
|
2994
|
+
}
|
|
2995
|
+
});
|
|
2996
|
+
a.down([[COMPLETE]]);
|
|
2997
|
+
}).catch((err) => {
|
|
2998
|
+
if (!active) return;
|
|
2999
|
+
try {
|
|
3000
|
+
a.down([[ERROR, err instanceof Error ? err : new Error(String(err))]]);
|
|
3001
|
+
} catch {
|
|
3002
|
+
}
|
|
3003
|
+
});
|
|
3004
|
+
return () => {
|
|
3005
|
+
active = false;
|
|
3006
|
+
};
|
|
3007
|
+
},
|
|
3008
|
+
{ ...rest, describeKind: "producer", completeWhenDepsComplete: false }
|
|
3009
|
+
);
|
|
3010
|
+
}
|
|
3011
|
+
function fromKysely(query, opts) {
|
|
3012
|
+
const { mapRow = (r) => r, ...rest } = opts ?? {};
|
|
3013
|
+
return producer(
|
|
3014
|
+
(_d, a) => {
|
|
3015
|
+
let active = true;
|
|
3016
|
+
void query.execute().then((rows) => {
|
|
3017
|
+
if (!active) return;
|
|
3018
|
+
const mapped = rows.map(mapRow);
|
|
3019
|
+
batch(() => {
|
|
3020
|
+
for (const item of mapped) {
|
|
3021
|
+
a.emit(item);
|
|
3022
|
+
}
|
|
3023
|
+
});
|
|
3024
|
+
a.down([[COMPLETE]]);
|
|
3025
|
+
}).catch((err) => {
|
|
3026
|
+
if (!active) return;
|
|
3027
|
+
try {
|
|
3028
|
+
a.down([[ERROR, err instanceof Error ? err : new Error(String(err))]]);
|
|
3029
|
+
} catch {
|
|
3030
|
+
}
|
|
3031
|
+
});
|
|
3032
|
+
return () => {
|
|
3033
|
+
active = false;
|
|
3034
|
+
};
|
|
3035
|
+
},
|
|
3036
|
+
{ ...rest, describeKind: "producer", completeWhenDepsComplete: false }
|
|
3037
|
+
);
|
|
3038
|
+
}
|
|
3039
|
+
|
|
3040
|
+
// src/extra/cascading-cache.ts
|
|
3041
|
+
function lru() {
|
|
3042
|
+
const map2 = /* @__PURE__ */ new Map();
|
|
3043
|
+
let head = null;
|
|
3044
|
+
let tail = null;
|
|
3045
|
+
function unlink(n) {
|
|
3046
|
+
if (n.prev) n.prev.next = n.next;
|
|
3047
|
+
else head = n.next;
|
|
3048
|
+
if (n.next) n.next.prev = n.prev;
|
|
3049
|
+
else tail = n.prev;
|
|
3050
|
+
n.prev = null;
|
|
3051
|
+
n.next = null;
|
|
3052
|
+
}
|
|
3053
|
+
function pushFront(n) {
|
|
3054
|
+
n.next = head;
|
|
3055
|
+
n.prev = null;
|
|
3056
|
+
if (head) head.prev = n;
|
|
3057
|
+
head = n;
|
|
3058
|
+
if (tail === null) tail = n;
|
|
3059
|
+
}
|
|
3060
|
+
return {
|
|
3061
|
+
insert(key) {
|
|
3062
|
+
if (map2.has(key)) {
|
|
3063
|
+
this.touch(key);
|
|
3064
|
+
return;
|
|
3065
|
+
}
|
|
3066
|
+
const n = { key, prev: null, next: null };
|
|
3067
|
+
map2.set(key, n);
|
|
3068
|
+
pushFront(n);
|
|
3069
|
+
},
|
|
3070
|
+
touch(key) {
|
|
3071
|
+
const n = map2.get(key);
|
|
3072
|
+
if (!n) return;
|
|
3073
|
+
unlink(n);
|
|
3074
|
+
pushFront(n);
|
|
3075
|
+
},
|
|
3076
|
+
delete(key) {
|
|
3077
|
+
const n = map2.get(key);
|
|
3078
|
+
if (!n) return;
|
|
3079
|
+
unlink(n);
|
|
3080
|
+
map2.delete(key);
|
|
3081
|
+
},
|
|
3082
|
+
evict(count) {
|
|
3083
|
+
const victims = [];
|
|
3084
|
+
for (let i = 0; i < count && tail !== null; i++) {
|
|
3085
|
+
const n = tail;
|
|
3086
|
+
victims.push(n.key);
|
|
3087
|
+
unlink(n);
|
|
3088
|
+
map2.delete(n.key);
|
|
3089
|
+
}
|
|
3090
|
+
return victims;
|
|
3091
|
+
},
|
|
3092
|
+
size() {
|
|
3093
|
+
return map2.size;
|
|
3094
|
+
}
|
|
3095
|
+
};
|
|
3096
|
+
}
|
|
3097
|
+
function cascadingCache(tiers, opts) {
|
|
3098
|
+
const entries = /* @__PURE__ */ new Map();
|
|
3099
|
+
const maxSize = opts?.maxSize ?? 0;
|
|
3100
|
+
const policy = maxSize > 0 ? opts?.eviction ?? lru() : null;
|
|
3101
|
+
const writeThrough = opts?.writeThrough ?? false;
|
|
3102
|
+
function promote(key, value, hitTierIndex) {
|
|
3103
|
+
for (let i = 0; i < hitTierIndex; i++) {
|
|
3104
|
+
const tier = tiers[i];
|
|
3105
|
+
if (tier.save) tier.save(key, value);
|
|
3106
|
+
}
|
|
3107
|
+
}
|
|
3108
|
+
function cascade(key, nd) {
|
|
3109
|
+
for (let tierIndex = 0; tierIndex < tiers.length; tierIndex++) {
|
|
3110
|
+
let result;
|
|
3111
|
+
try {
|
|
3112
|
+
result = tiers[tierIndex].load(key);
|
|
3113
|
+
} catch {
|
|
3114
|
+
continue;
|
|
3115
|
+
}
|
|
3116
|
+
if (result != null) {
|
|
3117
|
+
nd.down([[DATA, result]]);
|
|
3118
|
+
promote(key, result, tierIndex);
|
|
3119
|
+
return;
|
|
3120
|
+
}
|
|
3121
|
+
}
|
|
3122
|
+
}
|
|
3123
|
+
function evictIfNeeded() {
|
|
3124
|
+
if (!policy || maxSize <= 0) return;
|
|
3125
|
+
while (policy.size() >= maxSize) {
|
|
3126
|
+
const victims = policy.evict(1);
|
|
3127
|
+
if (victims.length === 0) break;
|
|
3128
|
+
for (const key of victims) {
|
|
3129
|
+
const nd = entries.get(key);
|
|
3130
|
+
if (nd) {
|
|
3131
|
+
const value = nd.get();
|
|
3132
|
+
if (value !== void 0) {
|
|
3133
|
+
for (let i = tiers.length - 1; i >= 0; i--) {
|
|
3134
|
+
if (tiers[i].save) {
|
|
3135
|
+
tiers[i].save(key, value);
|
|
3136
|
+
for (let j = 0; j < i; j++) {
|
|
3137
|
+
if (tiers[j].clear) tiers[j].clear(key);
|
|
3138
|
+
}
|
|
3139
|
+
break;
|
|
3140
|
+
}
|
|
3141
|
+
}
|
|
3142
|
+
}
|
|
3143
|
+
nd.down([[TEARDOWN]]);
|
|
3144
|
+
}
|
|
3145
|
+
entries.delete(key);
|
|
3146
|
+
}
|
|
3147
|
+
}
|
|
3148
|
+
}
|
|
3149
|
+
return {
|
|
3150
|
+
load(key) {
|
|
3151
|
+
const existing = entries.get(key);
|
|
3152
|
+
if (existing) {
|
|
3153
|
+
policy?.touch(key);
|
|
3154
|
+
return existing;
|
|
3155
|
+
}
|
|
3156
|
+
if (policy && maxSize > 0 && policy.size() >= maxSize) {
|
|
3157
|
+
evictIfNeeded();
|
|
3158
|
+
}
|
|
3159
|
+
const nd = state(void 0);
|
|
3160
|
+
entries.set(key, nd);
|
|
3161
|
+
if (policy) {
|
|
3162
|
+
policy.insert(key);
|
|
3163
|
+
}
|
|
3164
|
+
cascade(key, nd);
|
|
3165
|
+
return nd;
|
|
3166
|
+
},
|
|
3167
|
+
save(key, value) {
|
|
3168
|
+
if (writeThrough) {
|
|
3169
|
+
for (const tier of tiers) {
|
|
3170
|
+
if (tier.save) tier.save(key, value);
|
|
3171
|
+
}
|
|
3172
|
+
} else if (tiers[0]?.save) {
|
|
3173
|
+
tiers[0].save(key, value);
|
|
3174
|
+
}
|
|
3175
|
+
const existing = entries.get(key);
|
|
3176
|
+
if (existing) {
|
|
3177
|
+
existing.down([[DATA, value]]);
|
|
3178
|
+
policy?.touch(key);
|
|
3179
|
+
} else {
|
|
3180
|
+
if (policy && maxSize > 0 && policy.size() >= maxSize) {
|
|
3181
|
+
evictIfNeeded();
|
|
3182
|
+
}
|
|
3183
|
+
const nd = state(value);
|
|
3184
|
+
entries.set(key, nd);
|
|
3185
|
+
if (policy) {
|
|
3186
|
+
policy.insert(key);
|
|
3187
|
+
}
|
|
3188
|
+
}
|
|
3189
|
+
},
|
|
3190
|
+
invalidate(key) {
|
|
3191
|
+
const existing = entries.get(key);
|
|
3192
|
+
if (existing) {
|
|
3193
|
+
cascade(key, existing);
|
|
3194
|
+
}
|
|
3195
|
+
},
|
|
3196
|
+
delete(key) {
|
|
3197
|
+
policy?.delete(key);
|
|
3198
|
+
const nd = entries.get(key);
|
|
3199
|
+
if (nd) nd.down([[TEARDOWN]]);
|
|
3200
|
+
entries.delete(key);
|
|
3201
|
+
for (const tier of tiers) {
|
|
3202
|
+
if (tier.clear) tier.clear(key);
|
|
3203
|
+
}
|
|
3204
|
+
},
|
|
3205
|
+
has(key) {
|
|
3206
|
+
return entries.has(key);
|
|
3207
|
+
},
|
|
3208
|
+
get size() {
|
|
3209
|
+
return entries.size;
|
|
3210
|
+
}
|
|
3211
|
+
};
|
|
3212
|
+
}
|
|
3213
|
+
function adapterToTier(adapter) {
|
|
3214
|
+
return {
|
|
3215
|
+
load: (key) => adapter.load(key),
|
|
3216
|
+
save: (key, value) => adapter.save(key, value),
|
|
3217
|
+
clear: (key) => adapter.clear(key)
|
|
3218
|
+
};
|
|
3219
|
+
}
|
|
3220
|
+
function tieredStorage(adapters, opts) {
|
|
3221
|
+
const inner = cascadingCache(adapters.map(adapterToTier), {
|
|
3222
|
+
maxSize: opts?.maxSize,
|
|
3223
|
+
eviction: opts?.eviction,
|
|
3224
|
+
writeThrough: true
|
|
3225
|
+
});
|
|
3226
|
+
return {
|
|
3227
|
+
load: (key) => inner.load(key),
|
|
3228
|
+
save: (key, value) => inner.save(key, value),
|
|
3229
|
+
invalidate: (key) => inner.invalidate(key),
|
|
3230
|
+
delete: (key) => inner.delete(key),
|
|
3231
|
+
has: (key) => inner.has(key),
|
|
3232
|
+
get size() {
|
|
3233
|
+
return inner.size;
|
|
3234
|
+
},
|
|
3235
|
+
cache: inner
|
|
3236
|
+
};
|
|
3237
|
+
}
|
|
2554
3238
|
|
|
2555
3239
|
// src/extra/checkpoint.ts
|
|
2556
3240
|
import { randomBytes } from "crypto";
|
|
@@ -2572,60 +3256,61 @@ function sortJsonValue(value) {
|
|
|
2572
3256
|
}
|
|
2573
3257
|
return out;
|
|
2574
3258
|
}
|
|
2575
|
-
function
|
|
2576
|
-
for (const [path, node2] of Object.entries(data.nodes)) {
|
|
2577
|
-
const v = node2.value;
|
|
2578
|
-
if (v === void 0 || v === null) continue;
|
|
2579
|
-
if (typeof v === "function" || typeof v === "symbol" || typeof v === "bigint") {
|
|
2580
|
-
console.warn(
|
|
2581
|
-
`checkpoint: node "${path}" has non-JSON-serializable value (${typeof v}); it will be lost on round-trip`
|
|
2582
|
-
);
|
|
2583
|
-
}
|
|
2584
|
-
}
|
|
2585
|
-
}
|
|
2586
|
-
function stableSnapshotJson(data) {
|
|
2587
|
-
warnNonJsonValues(data);
|
|
3259
|
+
function stableJsonString(data) {
|
|
2588
3260
|
return `${JSON.stringify(sortJsonValue(data), void 0, 0)}
|
|
2589
3261
|
`;
|
|
2590
3262
|
}
|
|
2591
3263
|
var MemoryCheckpointAdapter = class {
|
|
2592
|
-
#data =
|
|
2593
|
-
save(data) {
|
|
2594
|
-
this.#data
|
|
3264
|
+
#data = /* @__PURE__ */ new Map();
|
|
3265
|
+
save(key, data) {
|
|
3266
|
+
this.#data.set(key, JSON.parse(JSON.stringify(data)));
|
|
3267
|
+
}
|
|
3268
|
+
load(key) {
|
|
3269
|
+
const v = this.#data.get(key);
|
|
3270
|
+
return v === void 0 ? null : JSON.parse(JSON.stringify(v));
|
|
2595
3271
|
}
|
|
2596
|
-
|
|
2597
|
-
|
|
3272
|
+
clear(key) {
|
|
3273
|
+
this.#data.delete(key);
|
|
2598
3274
|
}
|
|
2599
3275
|
};
|
|
2600
3276
|
var DictCheckpointAdapter = class {
|
|
2601
3277
|
#storage;
|
|
2602
|
-
|
|
2603
|
-
constructor(storage, key = "graphrefly_checkpoint") {
|
|
3278
|
+
constructor(storage) {
|
|
2604
3279
|
this.#storage = storage;
|
|
2605
|
-
this.#key = key;
|
|
2606
3280
|
}
|
|
2607
|
-
save(data) {
|
|
2608
|
-
this.#storage[
|
|
3281
|
+
save(key, data) {
|
|
3282
|
+
this.#storage[key] = JSON.parse(JSON.stringify(data));
|
|
3283
|
+
}
|
|
3284
|
+
load(key) {
|
|
3285
|
+
const raw = this.#storage[key];
|
|
3286
|
+
return raw === void 0 ? null : JSON.parse(JSON.stringify(raw));
|
|
2609
3287
|
}
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
return raw !== null && typeof raw === "object" && !Array.isArray(raw) ? JSON.parse(JSON.stringify(raw)) : null;
|
|
3288
|
+
clear(key) {
|
|
3289
|
+
delete this.#storage[key];
|
|
2613
3290
|
}
|
|
2614
3291
|
};
|
|
2615
3292
|
var FileCheckpointAdapter = class {
|
|
2616
|
-
#
|
|
2617
|
-
constructor(
|
|
2618
|
-
this.#
|
|
3293
|
+
#dir;
|
|
3294
|
+
constructor(dir) {
|
|
3295
|
+
this.#dir = dir;
|
|
3296
|
+
}
|
|
3297
|
+
#pathFor(key) {
|
|
3298
|
+
const safeName = key.replace(
|
|
3299
|
+
/[^a-zA-Z0-9_-]/g,
|
|
3300
|
+
(c) => `%${c.charCodeAt(0).toString(16).padStart(2, "0")}`
|
|
3301
|
+
);
|
|
3302
|
+
return join(this.#dir, `${safeName}.json`);
|
|
2619
3303
|
}
|
|
2620
|
-
save(data) {
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
const payload =
|
|
2624
|
-
const base = basename(
|
|
3304
|
+
save(key, data) {
|
|
3305
|
+
mkdirSync(this.#dir, { recursive: true });
|
|
3306
|
+
const filePath = this.#pathFor(key);
|
|
3307
|
+
const payload = stableJsonString(data);
|
|
3308
|
+
const base = basename(filePath);
|
|
3309
|
+
const dir = dirname(filePath);
|
|
2625
3310
|
const tmp = join(dir, `.${base}.${randomBytes(8).toString("hex")}.tmp`);
|
|
2626
3311
|
try {
|
|
2627
3312
|
writeFileSync(tmp, payload, "utf8");
|
|
2628
|
-
renameSync(tmp,
|
|
3313
|
+
renameSync(tmp, filePath);
|
|
2629
3314
|
} catch (e) {
|
|
2630
3315
|
try {
|
|
2631
3316
|
unlinkSync(tmp);
|
|
@@ -2634,36 +3319,42 @@ var FileCheckpointAdapter = class {
|
|
|
2634
3319
|
throw e;
|
|
2635
3320
|
}
|
|
2636
3321
|
}
|
|
2637
|
-
load() {
|
|
3322
|
+
load(key) {
|
|
2638
3323
|
try {
|
|
2639
|
-
const text = readFileSync(this.#
|
|
3324
|
+
const text = readFileSync(this.#pathFor(key), "utf8").trim();
|
|
2640
3325
|
if (!text) return null;
|
|
2641
|
-
|
|
2642
|
-
return data !== null && typeof data === "object" && !Array.isArray(data) ? data : null;
|
|
3326
|
+
return JSON.parse(text);
|
|
2643
3327
|
} catch {
|
|
2644
3328
|
return null;
|
|
2645
3329
|
}
|
|
2646
3330
|
}
|
|
3331
|
+
clear(key) {
|
|
3332
|
+
try {
|
|
3333
|
+
unlinkSync(this.#pathFor(key));
|
|
3334
|
+
} catch (e) {
|
|
3335
|
+
if (e.code !== "ENOENT") throw e;
|
|
3336
|
+
}
|
|
3337
|
+
}
|
|
2647
3338
|
};
|
|
2648
3339
|
var SqliteCheckpointAdapter = class {
|
|
2649
3340
|
#db;
|
|
2650
|
-
|
|
2651
|
-
constructor(path, key = "graphrefly_checkpoint") {
|
|
3341
|
+
constructor(path) {
|
|
2652
3342
|
this.#db = new DatabaseSync(path);
|
|
2653
|
-
this.#key = key;
|
|
2654
3343
|
this.#db.exec(
|
|
2655
3344
|
`CREATE TABLE IF NOT EXISTS graphrefly_checkpoint (k TEXT PRIMARY KEY, v TEXT NOT NULL)`
|
|
2656
3345
|
);
|
|
2657
3346
|
}
|
|
2658
|
-
save(data) {
|
|
2659
|
-
const payload =
|
|
2660
|
-
this.#db.prepare(`INSERT OR REPLACE INTO graphrefly_checkpoint (k, v) VALUES (?, ?)`).run(
|
|
3347
|
+
save(key, data) {
|
|
3348
|
+
const payload = stableJsonString(data).trimEnd();
|
|
3349
|
+
this.#db.prepare(`INSERT OR REPLACE INTO graphrefly_checkpoint (k, v) VALUES (?, ?)`).run(key, payload);
|
|
2661
3350
|
}
|
|
2662
|
-
load() {
|
|
2663
|
-
const row = this.#db.prepare(`SELECT v FROM graphrefly_checkpoint WHERE k = ?`).get(
|
|
3351
|
+
load(key) {
|
|
3352
|
+
const row = this.#db.prepare(`SELECT v FROM graphrefly_checkpoint WHERE k = ?`).get(key);
|
|
2664
3353
|
if (row === void 0 || typeof row.v !== "string" || row.v.trim() === "") return null;
|
|
2665
|
-
|
|
2666
|
-
|
|
3354
|
+
return JSON.parse(row.v);
|
|
3355
|
+
}
|
|
3356
|
+
clear(key) {
|
|
3357
|
+
this.#db.prepare(`DELETE FROM graphrefly_checkpoint WHERE k = ?`).run(key);
|
|
2667
3358
|
}
|
|
2668
3359
|
/** Close the underlying SQLite connection (safe to call more than once). */
|
|
2669
3360
|
close() {
|
|
@@ -2674,10 +3365,10 @@ var SqliteCheckpointAdapter = class {
|
|
|
2674
3365
|
}
|
|
2675
3366
|
};
|
|
2676
3367
|
function saveGraphCheckpoint(graph, adapter) {
|
|
2677
|
-
adapter.save(graph.snapshot());
|
|
3368
|
+
adapter.save(graph.name, graph.snapshot());
|
|
2678
3369
|
}
|
|
2679
3370
|
function restoreGraphCheckpoint(graph, adapter) {
|
|
2680
|
-
const data = adapter.load();
|
|
3371
|
+
const data = adapter.load(graph.name);
|
|
2681
3372
|
if (data === null) return false;
|
|
2682
3373
|
graph.restore(data);
|
|
2683
3374
|
return true;
|
|
@@ -4083,48 +4774,6 @@ function audit(source, ms, opts) {
|
|
|
4083
4774
|
}
|
|
4084
4775
|
});
|
|
4085
4776
|
}
|
|
4086
|
-
function timeout(source, ms, opts) {
|
|
4087
|
-
const { with: withPayload, ...timeoutNodeOpts } = opts ?? {};
|
|
4088
|
-
let timer;
|
|
4089
|
-
const err = withPayload ?? new Error("timeout");
|
|
4090
|
-
function arm(a) {
|
|
4091
|
-
clearTimeout(timer);
|
|
4092
|
-
timer = setTimeout(() => {
|
|
4093
|
-
timer = void 0;
|
|
4094
|
-
a.down([[ERROR, err]]);
|
|
4095
|
-
}, ms);
|
|
4096
|
-
}
|
|
4097
|
-
return node(
|
|
4098
|
-
[source],
|
|
4099
|
-
([_v], a) => {
|
|
4100
|
-
arm(a);
|
|
4101
|
-
return () => clearTimeout(timer);
|
|
4102
|
-
},
|
|
4103
|
-
{
|
|
4104
|
-
...operatorOpts2(timeoutNodeOpts),
|
|
4105
|
-
completeWhenDepsComplete: false,
|
|
4106
|
-
onMessage(msg, _i, a) {
|
|
4107
|
-
const t = msg[0];
|
|
4108
|
-
if (t === DATA) {
|
|
4109
|
-
arm(a);
|
|
4110
|
-
a.down([msg]);
|
|
4111
|
-
return true;
|
|
4112
|
-
}
|
|
4113
|
-
if (t === COMPLETE || t === ERROR) {
|
|
4114
|
-
clearTimeout(timer);
|
|
4115
|
-
a.down([msg]);
|
|
4116
|
-
return true;
|
|
4117
|
-
}
|
|
4118
|
-
if (t === DIRTY || t === RESOLVED) {
|
|
4119
|
-
a.down([msg]);
|
|
4120
|
-
return true;
|
|
4121
|
-
}
|
|
4122
|
-
a.down([msg]);
|
|
4123
|
-
return true;
|
|
4124
|
-
}
|
|
4125
|
-
}
|
|
4126
|
-
);
|
|
4127
|
-
}
|
|
4128
4777
|
function buffer(source, notifier, opts) {
|
|
4129
4778
|
const buf = [];
|
|
4130
4779
|
return node([source, notifier], () => void 0, {
|
|
@@ -5494,6 +6143,10 @@ export {
|
|
|
5494
6143
|
tokenTracker,
|
|
5495
6144
|
rateLimiter,
|
|
5496
6145
|
withStatus,
|
|
6146
|
+
TimeoutError,
|
|
6147
|
+
fallback,
|
|
6148
|
+
timeout,
|
|
6149
|
+
cache,
|
|
5497
6150
|
fromWebSocket,
|
|
5498
6151
|
fromWebhook,
|
|
5499
6152
|
fromHTTP,
|
|
@@ -5531,6 +6184,14 @@ export {
|
|
|
5531
6184
|
toTempo,
|
|
5532
6185
|
checkpointToS3,
|
|
5533
6186
|
checkpointToRedis,
|
|
6187
|
+
fromSqlite,
|
|
6188
|
+
toSqlite,
|
|
6189
|
+
fromPrisma,
|
|
6190
|
+
fromDrizzle,
|
|
6191
|
+
fromKysely,
|
|
6192
|
+
lru,
|
|
6193
|
+
cascadingCache,
|
|
6194
|
+
tieredStorage,
|
|
5534
6195
|
MemoryCheckpointAdapter,
|
|
5535
6196
|
DictCheckpointAdapter,
|
|
5536
6197
|
FileCheckpointAdapter,
|
|
@@ -5574,7 +6235,6 @@ export {
|
|
|
5574
6235
|
throttle,
|
|
5575
6236
|
sample,
|
|
5576
6237
|
audit,
|
|
5577
|
-
timeout,
|
|
5578
6238
|
buffer,
|
|
5579
6239
|
bufferCount,
|
|
5580
6240
|
windowCount,
|
|
@@ -5605,4 +6265,4 @@ export {
|
|
|
5605
6265
|
workerSelf,
|
|
5606
6266
|
extra_exports
|
|
5607
6267
|
};
|
|
5608
|
-
//# sourceMappingURL=chunk-
|
|
6268
|
+
//# sourceMappingURL=chunk-ONLYF6GA.js.map
|