@rotorsoft/act 2.1.9 → 2.1.10
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/.tsbuildinfo +1 -1
- package/dist/@types/act.d.ts.map +1 -1
- package/dist/@types/builders/builder-utils.d.ts.map +1 -1
- package/dist/@types/deprecated.d.ts +0 -3
- package/dist/@types/deprecated.d.ts.map +1 -1
- package/dist/@types/index.d.ts +1 -1
- package/dist/@types/index.d.ts.map +1 -1
- package/dist/@types/internal/autoclose-policy.d.ts +1 -1
- package/dist/@types/internal/autoclose-policy.d.ts.map +1 -1
- package/dist/@types/internal/config.d.ts +128 -95
- package/dist/@types/internal/config.d.ts.map +1 -1
- package/dist/@types/internal/correlate-cycle.d.ts.map +1 -1
- package/dist/@types/internal/defer-config.d.ts +2 -9
- package/dist/@types/internal/defer-config.d.ts.map +1 -1
- package/dist/@types/types/act.d.ts +2 -2
- package/dist/adapter.cjs +3 -3
- package/dist/adapter.js +2 -2
- package/dist/{chunk-C35J3SNT.js → chunk-BQUOIHOR.js} +1 -1
- package/dist/chunk-BQUOIHOR.js.map +1 -0
- package/dist/{chunk-YXP6WASH.cjs → chunk-N74AN6L5.cjs} +132 -139
- package/dist/chunk-N74AN6L5.cjs.map +1 -0
- package/dist/{chunk-TUALNYW2.js → chunk-RV34EYSN.js} +2 -2
- package/dist/{chunk-D7LQNOEV.cjs → chunk-SC6TY4P2.cjs} +4 -4
- package/dist/{chunk-D7LQNOEV.cjs.map → chunk-SC6TY4P2.cjs.map} +1 -1
- package/dist/{chunk-NYDHZSYZ.js → chunk-Y2ISPWQL.js} +113 -120
- package/dist/chunk-Y2ISPWQL.js.map +1 -0
- package/dist/{chunk-QFYPSI6P.cjs → chunk-ZTHGF62O.cjs} +1 -1
- package/dist/chunk-ZTHGF62O.cjs.map +1 -0
- package/dist/index.cjs +204 -274
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +47 -117
- package/dist/index.js.map +1 -1
- package/dist/test/index.cjs +5 -5
- package/dist/test/index.js +3 -3
- package/dist/types/index.cjs +2 -2
- package/dist/types/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-C35J3SNT.js.map +0 -1
- package/dist/chunk-NYDHZSYZ.js.map +0 -1
- package/dist/chunk-QFYPSI6P.cjs.map +0 -1
- package/dist/chunk-YXP6WASH.cjs.map +0 -1
- /package/dist/{chunk-TUALNYW2.js.map → chunk-RV34EYSN.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
+
var _chunkN74AN6L5cjs = require('./chunk-N74AN6L5.cjs');
|
|
30
31
|
|
|
31
32
|
|
|
32
33
|
|
|
@@ -35,13 +36,13 @@
|
|
|
35
36
|
|
|
36
37
|
|
|
37
38
|
|
|
39
|
+
var _chunkSC6TY4P2cjs = require('./chunk-SC6TY4P2.cjs');
|
|
38
40
|
|
|
39
41
|
|
|
40
42
|
|
|
41
43
|
|
|
42
44
|
|
|
43
45
|
|
|
44
|
-
var _chunkYXP6WASHcjs = require('./chunk-YXP6WASH.cjs');
|
|
45
46
|
|
|
46
47
|
|
|
47
48
|
|
|
@@ -50,7 +51,6 @@ var _chunkYXP6WASHcjs = require('./chunk-YXP6WASH.cjs');
|
|
|
50
51
|
|
|
51
52
|
|
|
52
53
|
|
|
53
|
-
var _chunkD7LQNOEVcjs = require('./chunk-D7LQNOEV.cjs');
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
|
|
@@ -71,38 +71,24 @@ var _chunkD7LQNOEVcjs = require('./chunk-D7LQNOEV.cjs');
|
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
var _chunkQFYPSI6Pcjs = require('./chunk-QFYPSI6P.cjs');
|
|
74
|
+
var _chunkZTHGF62Ocjs = require('./chunk-ZTHGF62O.cjs');
|
|
89
75
|
|
|
90
76
|
// src/signals.ts
|
|
91
77
|
process.once("SIGINT", async (arg) => {
|
|
92
|
-
|
|
93
|
-
await
|
|
78
|
+
_chunkN74AN6L5cjs.log.call(void 0, ).info(arg, "SIGINT");
|
|
79
|
+
await _chunkN74AN6L5cjs.disposeAndExit.call(void 0, "EXIT");
|
|
94
80
|
});
|
|
95
81
|
process.once("SIGTERM", async (arg) => {
|
|
96
|
-
|
|
97
|
-
await
|
|
82
|
+
_chunkN74AN6L5cjs.log.call(void 0, ).info(arg, "SIGTERM");
|
|
83
|
+
await _chunkN74AN6L5cjs.disposeAndExit.call(void 0, "EXIT");
|
|
98
84
|
});
|
|
99
85
|
process.once("uncaughtException", async (arg) => {
|
|
100
|
-
|
|
101
|
-
await
|
|
86
|
+
_chunkN74AN6L5cjs.log.call(void 0, ).error(arg, "Uncaught Exception");
|
|
87
|
+
await _chunkN74AN6L5cjs.disposeAndExit.call(void 0, "ERROR");
|
|
102
88
|
});
|
|
103
89
|
process.once("unhandledRejection", async (arg) => {
|
|
104
|
-
|
|
105
|
-
await
|
|
90
|
+
_chunkN74AN6L5cjs.log.call(void 0, ).error(arg, "Unhandled Rejection");
|
|
91
|
+
await _chunkN74AN6L5cjs.disposeAndExit.call(void 0, "ERROR");
|
|
106
92
|
});
|
|
107
93
|
|
|
108
94
|
// src/act.ts
|
|
@@ -210,7 +196,7 @@ async function* audit(deps, categories, options = {}) {
|
|
|
210
196
|
if (need_stats) {
|
|
211
197
|
const stats = await deps.store().query_stats(
|
|
212
198
|
{},
|
|
213
|
-
{ count: true, names: true, exclude: [
|
|
199
|
+
{ count: true, names: true, exclude: [_chunkZTHGF62Ocjs.SNAP_EVENT] }
|
|
214
200
|
);
|
|
215
201
|
for (const [stream, s] of stats) {
|
|
216
202
|
for (const p of passes) _optionalChain([p, 'access', _4 => _4.on_stat, 'optionalCall', _5 => _5(stream, s)]);
|
|
@@ -292,7 +278,7 @@ var make_schema_pass = (deps) => {
|
|
|
292
278
|
return;
|
|
293
279
|
}
|
|
294
280
|
const schema = state2.events[name];
|
|
295
|
-
const sensitive2 =
|
|
281
|
+
const sensitive2 = _chunkZTHGF62Ocjs.sensitiveFields.call(void 0, schema);
|
|
296
282
|
let parse_schema = schema;
|
|
297
283
|
if (sensitive2.length > 0) {
|
|
298
284
|
const omitter = schema.omit;
|
|
@@ -426,7 +412,7 @@ var make_restart_candidate_pass = (deps, options) => {
|
|
|
426
412
|
{
|
|
427
413
|
stream,
|
|
428
414
|
stream_exact: true,
|
|
429
|
-
names: [
|
|
415
|
+
names: [_chunkZTHGF62Ocjs.SNAP_EVENT],
|
|
430
416
|
with_snaps: true,
|
|
431
417
|
// From the start: on its own, `with_snaps` resumes at the latest.
|
|
432
418
|
after: -1
|
|
@@ -586,7 +572,7 @@ var make_correlation_gaps_pass = () => {
|
|
|
586
572
|
seen_ids.add(e.id);
|
|
587
573
|
const causation = _optionalChain([e, 'access', _31 => _31.meta, 'optionalAccess', _32 => _32.causation]);
|
|
588
574
|
const parent_id = _optionalChain([causation, 'optionalAccess', _33 => _33.event, 'optionalAccess', _34 => _34.id]);
|
|
589
|
-
if (parent_id !== void 0 && e.name !==
|
|
575
|
+
if (parent_id !== void 0 && e.name !== _chunkZTHGF62Ocjs.TOMBSTONE_EVENT) {
|
|
590
576
|
checks.push({ stream: e.stream, id: e.id, parent_id });
|
|
591
577
|
}
|
|
592
578
|
},
|
|
@@ -814,52 +800,13 @@ function classify_registry(registry, states) {
|
|
|
814
800
|
}
|
|
815
801
|
|
|
816
802
|
// src/internal/autoclose-policy.ts
|
|
817
|
-
var _zod = require('zod');
|
|
818
803
|
var DAY_MS = 864e5;
|
|
819
|
-
var MIN_AFTER_DAYS = 1 / 1440;
|
|
820
|
-
var MIN_KEEP_DAYS = 1;
|
|
821
804
|
function days_after(date, days) {
|
|
822
805
|
return new Date(date.getTime() + days * DAY_MS);
|
|
823
806
|
}
|
|
824
807
|
function days_before_now(days) {
|
|
825
808
|
return new Date(Date.now() - days * DAY_MS);
|
|
826
809
|
}
|
|
827
|
-
var window_schema = (field, min_days, floor) => _zod.z.object({
|
|
828
|
-
days: _zod.z.number({ message: `autocloses: ${field}.days must be a number` }).positive(`autocloses: ${field}.days must be > 0`)
|
|
829
|
-
}).refine((o) => o.days >= min_days, {
|
|
830
|
-
message: `autocloses: ${field} resolves to < ${floor}, which is too short to be a meaningful retention window`
|
|
831
|
-
});
|
|
832
|
-
var AfterSchema = window_schema("after", MIN_AFTER_DAYS, "one minute");
|
|
833
|
-
var KeepSchema = window_schema("keep", MIN_KEEP_DAYS, "one day");
|
|
834
|
-
var IsSchema = _zod.z.union([
|
|
835
|
-
_zod.z.string().min(1, "autocloses: is must be a non-empty event name"),
|
|
836
|
-
_zod.z.array(
|
|
837
|
-
_zod.z.string().min(1, "autocloses: is entries must be non-empty event names")
|
|
838
|
-
).min(1, "autocloses: is must include at least one event name").readonly()
|
|
839
|
-
]);
|
|
840
|
-
var ReachesSchema = _zod.z.number({ message: "autocloses: reaches must be a number" }).int("autocloses: reaches must be an integer").min(1, "autocloses: reaches must be >= 1");
|
|
841
|
-
var OrBlockSchema = _zod.z.object({
|
|
842
|
-
after: AfterSchema.optional(),
|
|
843
|
-
is: IsSchema.optional(),
|
|
844
|
-
reaches: ReachesSchema.optional()
|
|
845
|
-
}).strict().refine(
|
|
846
|
-
(o) => o.after !== void 0 || o.is !== void 0 || o.reaches !== void 0,
|
|
847
|
-
{
|
|
848
|
-
message: "autocloses: `or` block must include at least one of after / is / reaches"
|
|
849
|
-
}
|
|
850
|
-
);
|
|
851
|
-
var AutoclosePolicySchema = _zod.z.object({
|
|
852
|
-
after: AfterSchema.optional(),
|
|
853
|
-
is: IsSchema.optional(),
|
|
854
|
-
reaches: ReachesSchema.optional(),
|
|
855
|
-
or: OrBlockSchema.optional(),
|
|
856
|
-
keep: KeepSchema.optional()
|
|
857
|
-
}).strict().refine(
|
|
858
|
-
(o) => o.after !== void 0 || o.is !== void 0 || o.reaches !== void 0 || o.or !== void 0 || o.keep !== void 0,
|
|
859
|
-
{
|
|
860
|
-
message: "autocloses: at least one of after / is / reaches / or / keep must be specified \u2014 empty `{}` is a misconfiguration"
|
|
861
|
-
}
|
|
862
|
-
);
|
|
863
810
|
function compile_after(after) {
|
|
864
811
|
return (_stream, head) => days_after(head.created, after.days) <= /* @__PURE__ */ new Date();
|
|
865
812
|
}
|
|
@@ -871,15 +818,15 @@ function compile_reaches(reaches) {
|
|
|
871
818
|
return (_stream, _head, count) => count >= reaches;
|
|
872
819
|
}
|
|
873
820
|
function policy_after_windows(options) {
|
|
874
|
-
const parsed =
|
|
821
|
+
const parsed = _chunkN74AN6L5cjs.check.call(void 0, "autoclose_policy", options);
|
|
875
822
|
return [parsed.after, _optionalChain([parsed, 'access', _42 => _42.or, 'optionalAccess', _43 => _43.after])].flatMap((w) => w ? [w.days] : []);
|
|
876
823
|
}
|
|
877
824
|
function policy_keep_days(options) {
|
|
878
|
-
const parsed =
|
|
825
|
+
const parsed = _chunkN74AN6L5cjs.check.call(void 0, "autoclose_policy", options);
|
|
879
826
|
return _optionalChain([parsed, 'access', _44 => _44.keep, 'optionalAccess', _45 => _45.days]);
|
|
880
827
|
}
|
|
881
828
|
function compile_autoclose_policy(options) {
|
|
882
|
-
const parsed =
|
|
829
|
+
const parsed = _chunkN74AN6L5cjs.check.call(void 0, "autoclose_policy", options);
|
|
883
830
|
const and_preds = [];
|
|
884
831
|
if (parsed.after) and_preds.push(compile_after(parsed.after));
|
|
885
832
|
if (parsed.is) and_preds.push(compile_is(parsed.is));
|
|
@@ -940,36 +887,19 @@ function next_window_open(window, now) {
|
|
|
940
887
|
}
|
|
941
888
|
|
|
942
889
|
// src/internal/defer-config.ts
|
|
943
|
-
|
|
944
|
-
var DeferDurationSchema = _zod.z.object({
|
|
945
|
-
days: _zod.z.number().positive().optional(),
|
|
946
|
-
hours: _zod.z.number().positive().optional(),
|
|
947
|
-
minutes: _zod.z.number().positive().optional()
|
|
948
|
-
}).strict().refine((d) => d.days != null || d.hours != null || d.minutes != null, {
|
|
949
|
-
message: "defer: a duration needs at least one of days, hours, or minutes"
|
|
950
|
-
});
|
|
951
|
-
var DeferWhenSchema = _zod.z.object({
|
|
952
|
-
after: DeferDurationSchema.optional(),
|
|
953
|
-
at: _zod.z.date().optional()
|
|
954
|
-
}).strict().refine((w) => w.after === void 0 !== (w.at === void 0), {
|
|
955
|
-
message: "defer: specify exactly one of `after` or `at`"
|
|
956
|
-
});
|
|
957
890
|
function duration_ms(d) {
|
|
958
891
|
return (_nullishCoalesce(d.days, () => ( 0))) * 864e5 + (_nullishCoalesce(d.hours, () => ( 0))) * 36e5 + (_nullishCoalesce(d.minutes, () => ( 0))) * 6e4;
|
|
959
892
|
}
|
|
960
893
|
function resolve_defer_at(when, event) {
|
|
961
|
-
const parsed =
|
|
894
|
+
const parsed = _chunkN74AN6L5cjs.check.call(void 0, "defer", when);
|
|
962
895
|
if (parsed.after) return event.created.getTime() + duration_ms(parsed.after);
|
|
963
896
|
return parsed.at.getTime();
|
|
964
897
|
}
|
|
965
|
-
function assert_defer_when(when) {
|
|
966
|
-
DeferWhenSchema.parse(when);
|
|
967
|
-
}
|
|
968
898
|
function make_deferred(handler, schedule) {
|
|
969
899
|
const call = handler;
|
|
970
900
|
const deferred = async (event, stream, app) => {
|
|
971
901
|
const when = typeof schedule === "function" ? schedule(event) : schedule;
|
|
972
|
-
if (Date.now() < resolve_defer_at(when, event)) throw new (0,
|
|
902
|
+
if (Date.now() < resolve_defer_at(when, event)) throw new (0, _chunkZTHGF62Ocjs.DeferSignal)(when);
|
|
973
903
|
return call(event, stream, app);
|
|
974
904
|
};
|
|
975
905
|
Object.defineProperty(deferred, "name", { value: handler.name });
|
|
@@ -1101,7 +1031,7 @@ function compute_lag_lead_ratio(handled, lagging, leading) {
|
|
|
1101
1031
|
function report_once(seen, key, message) {
|
|
1102
1032
|
if (seen.has(key)) return;
|
|
1103
1033
|
seen.add(key);
|
|
1104
|
-
|
|
1034
|
+
_chunkN74AN6L5cjs.log.call(void 0, ).error(new Error(message));
|
|
1105
1035
|
}
|
|
1106
1036
|
|
|
1107
1037
|
// src/internal/correlation-id.ts
|
|
@@ -1129,14 +1059,14 @@ function close_correlation(correlator, actor) {
|
|
|
1129
1059
|
}
|
|
1130
1060
|
|
|
1131
1061
|
// src/internal/drain-ops.ts
|
|
1132
|
-
var claim = (lagging, leading, by, millis, lane) =>
|
|
1062
|
+
var claim = (lagging, leading, by, millis, lane) => _chunkN74AN6L5cjs.store.call(void 0, ).claim(lagging, leading, by, millis, lane);
|
|
1133
1063
|
async function fetch(leased, eventLimit) {
|
|
1134
1064
|
return Promise.all(
|
|
1135
1065
|
leased.map(async ({ stream, source, at, lagging }) => {
|
|
1136
1066
|
const events = [];
|
|
1137
|
-
const stream_exact = source !== void 0 &&
|
|
1067
|
+
const stream_exact = source !== void 0 && _chunkSC6TY4P2cjs.isStreamName.call(void 0, source, stream) ? true : void 0;
|
|
1138
1068
|
try {
|
|
1139
|
-
await
|
|
1069
|
+
await _chunkN74AN6L5cjs.store.call(void 0, ).query((e) => events.push(e), {
|
|
1140
1070
|
stream: source,
|
|
1141
1071
|
stream_exact,
|
|
1142
1072
|
after: at,
|
|
@@ -1156,18 +1086,18 @@ async function fetch(leased, eventLimit) {
|
|
|
1156
1086
|
})
|
|
1157
1087
|
);
|
|
1158
1088
|
}
|
|
1159
|
-
var ack = (leases) =>
|
|
1160
|
-
var block = (leases) =>
|
|
1161
|
-
var subscribe = (streams, correlated_at, correlator) =>
|
|
1089
|
+
var ack = (leases) => _chunkN74AN6L5cjs.store.call(void 0, ).ack(leases);
|
|
1090
|
+
var block = (leases) => _chunkN74AN6L5cjs.store.call(void 0, ).block(leases);
|
|
1091
|
+
var subscribe = (streams, correlated_at, correlator) => _chunkN74AN6L5cjs.store.call(void 0, ).subscribe(streams, correlated_at, correlator);
|
|
1162
1092
|
|
|
1163
1093
|
// src/internal/event-sourcing.ts
|
|
1164
1094
|
var _actpatch = require('@rotorsoft/act-patch');
|
|
1165
|
-
|
|
1095
|
+
var _zod = require('zod');
|
|
1166
1096
|
|
|
1167
1097
|
// src/internal/date-reviver.ts
|
|
1168
1098
|
|
|
1169
1099
|
function variant_schema(schema, walk) {
|
|
1170
|
-
const shape = _optionalChain([
|
|
1100
|
+
const shape = _optionalChain([_chunkZTHGF62Ocjs.def_of.call(void 0, schema), 'optionalAccess', _50 => _50.shape]);
|
|
1171
1101
|
if (!shape) {
|
|
1172
1102
|
const dates = walk(schema);
|
|
1173
1103
|
return { schema: _nullishCoalesce(dates, () => ( schema)), dated: !!dates };
|
|
@@ -1204,7 +1134,7 @@ function date_reviver_schema(schema) {
|
|
|
1204
1134
|
return first && recursive ? pass(true) : first;
|
|
1205
1135
|
}
|
|
1206
1136
|
function build(schema, walk) {
|
|
1207
|
-
const def =
|
|
1137
|
+
const def = _chunkZTHGF62Ocjs.def_of.call(void 0, schema);
|
|
1208
1138
|
if (!def) return void 0;
|
|
1209
1139
|
const inner = () => walk(def.innerType);
|
|
1210
1140
|
switch (def.type) {
|
|
@@ -1250,7 +1180,7 @@ function build(schema, walk) {
|
|
|
1250
1180
|
return left && right ? left.pipe(right) : _nullishCoalesce(left, () => ( right));
|
|
1251
1181
|
}
|
|
1252
1182
|
default:
|
|
1253
|
-
return
|
|
1183
|
+
return _chunkZTHGF62Ocjs.inner_of.call(void 0, def) ? inner() : void 0;
|
|
1254
1184
|
}
|
|
1255
1185
|
}
|
|
1256
1186
|
|
|
@@ -1265,29 +1195,29 @@ var check_invariants = (target, state2, schema, pii_aware) => {
|
|
|
1265
1195
|
try {
|
|
1266
1196
|
result = schema.safeParse(state2);
|
|
1267
1197
|
} catch (error) {
|
|
1268
|
-
throw new (0,
|
|
1198
|
+
throw new (0, _chunkZTHGF62Ocjs.ValidationError)(target, state2, error);
|
|
1269
1199
|
}
|
|
1270
1200
|
if (result.success) return;
|
|
1271
1201
|
const issues = pii_aware ? result.error.issues.filter((issue) => {
|
|
1272
1202
|
const value = value_at(state2, issue.path);
|
|
1273
|
-
return value !==
|
|
1203
|
+
return value !== _chunkZTHGF62Ocjs.REDACTED && value !== _chunkZTHGF62Ocjs.SHREDDED;
|
|
1274
1204
|
}) : result.error.issues;
|
|
1275
1205
|
if (issues.length)
|
|
1276
|
-
throw new (0,
|
|
1206
|
+
throw new (0, _chunkZTHGF62Ocjs.ValidationError)(
|
|
1277
1207
|
target,
|
|
1278
1208
|
state2,
|
|
1279
1209
|
_zod.prettifyError.call(void 0, new (0, _zod.ZodError)(issues))
|
|
1280
1210
|
);
|
|
1281
1211
|
};
|
|
1282
1212
|
var DEFAULT_BATCH = 500;
|
|
1283
|
-
var cache_put = (stream, entry) =>
|
|
1284
|
-
(err) =>
|
|
1213
|
+
var cache_put = (stream, entry) => _chunkN74AN6L5cjs.cache.call(void 0, ).set(stream, entry).catch(
|
|
1214
|
+
(err) => _chunkN74AN6L5cjs.log.call(void 0, ).warn(
|
|
1285
1215
|
err,
|
|
1286
1216
|
"cache set skipped; the next load re-folds from the store"
|
|
1287
1217
|
)
|
|
1288
1218
|
);
|
|
1289
|
-
var cache_drop = (stream) =>
|
|
1290
|
-
(err) =>
|
|
1219
|
+
var cache_drop = (stream) => _chunkN74AN6L5cjs.cache.call(void 0, ).invalidate(stream).catch(
|
|
1220
|
+
(err) => _chunkN74AN6L5cjs.log.call(void 0, ).warn(
|
|
1291
1221
|
err,
|
|
1292
1222
|
"cache invalidate skipped; a stale checkpoint re-folds from its event_id"
|
|
1293
1223
|
)
|
|
@@ -1295,11 +1225,11 @@ var cache_drop = (stream) => _chunkYXP6WASHcjs.cache.call(void 0, ).invalidate(s
|
|
|
1295
1225
|
async function snap(snapshot) {
|
|
1296
1226
|
const { id, stream, name, meta, version } = snapshot.event;
|
|
1297
1227
|
try {
|
|
1298
|
-
const [committed] = await
|
|
1228
|
+
const [committed] = await _chunkN74AN6L5cjs.store.call(void 0, ).commit(
|
|
1299
1229
|
[
|
|
1300
1230
|
{
|
|
1301
1231
|
stream,
|
|
1302
|
-
msgs: [{ name:
|
|
1232
|
+
msgs: [{ name: _chunkZTHGF62Ocjs.SNAP_EVENT, data: snapshot.state }],
|
|
1303
1233
|
// IMPORTANT! - state events are committed right after the snapshot event
|
|
1304
1234
|
expectedVersion: version
|
|
1305
1235
|
}
|
|
@@ -1312,18 +1242,18 @@ async function snap(snapshot) {
|
|
|
1312
1242
|
return committed;
|
|
1313
1243
|
} catch (error) {
|
|
1314
1244
|
const reason = error instanceof Error ? error.message : String(error);
|
|
1315
|
-
|
|
1245
|
+
_chunkN74AN6L5cjs.log.call(void 0, ).warn(
|
|
1316
1246
|
`Snapshot write failed on stream "${stream}": ${reason} \u2014 cold starts will replay full history until snapshots succeed.`
|
|
1317
1247
|
);
|
|
1318
1248
|
}
|
|
1319
1249
|
}
|
|
1320
1250
|
async function tombstone(stream, expectedVersion, correlation) {
|
|
1321
1251
|
try {
|
|
1322
|
-
const [committed] = await
|
|
1252
|
+
const [committed] = await _chunkN74AN6L5cjs.store.call(void 0, ).commit(
|
|
1323
1253
|
[
|
|
1324
1254
|
{
|
|
1325
1255
|
stream,
|
|
1326
|
-
msgs: [{ name:
|
|
1256
|
+
msgs: [{ name: _chunkZTHGF62Ocjs.TOMBSTONE_EVENT, data: {} }],
|
|
1327
1257
|
expectedVersion
|
|
1328
1258
|
}
|
|
1329
1259
|
],
|
|
@@ -1331,7 +1261,7 @@ async function tombstone(stream, expectedVersion, correlation) {
|
|
|
1331
1261
|
);
|
|
1332
1262
|
return committed;
|
|
1333
1263
|
} catch (error) {
|
|
1334
|
-
if (error instanceof
|
|
1264
|
+
if (error instanceof _chunkZTHGF62Ocjs.ConcurrencyError) return void 0;
|
|
1335
1265
|
throw error;
|
|
1336
1266
|
}
|
|
1337
1267
|
}
|
|
@@ -1368,9 +1298,9 @@ async function scan(source, opts = {}, callback) {
|
|
|
1368
1298
|
if (drop_closed_streams) {
|
|
1369
1299
|
await source.query(
|
|
1370
1300
|
(e) => {
|
|
1371
|
-
if (e.name ===
|
|
1301
|
+
if (e.name === _chunkZTHGF62Ocjs.TOMBSTONE_EVENT) closed_streams.add(e.stream);
|
|
1372
1302
|
},
|
|
1373
|
-
{ names: [
|
|
1303
|
+
{ names: [_chunkZTHGF62Ocjs.TOMBSTONE_EVENT] }
|
|
1374
1304
|
);
|
|
1375
1305
|
}
|
|
1376
1306
|
let max_id;
|
|
@@ -1395,11 +1325,11 @@ async function scan(source, opts = {}, callback) {
|
|
|
1395
1325
|
if (on_progress) on_progress({ processed, id: event.id, max_id });
|
|
1396
1326
|
const has_history = started.has(event.stream);
|
|
1397
1327
|
started.add(event.stream);
|
|
1398
|
-
if (drop_snapshots && event.name ===
|
|
1328
|
+
if (drop_snapshots && event.name === _chunkZTHGF62Ocjs.SNAP_EVENT && has_history) {
|
|
1399
1329
|
dropped_snaps++;
|
|
1400
1330
|
return;
|
|
1401
1331
|
}
|
|
1402
|
-
if (closed_streams.has(event.stream) && event.name !==
|
|
1332
|
+
if (closed_streams.has(event.stream) && event.name !== _chunkZTHGF62Ocjs.TOMBSTONE_EVENT) {
|
|
1403
1333
|
dropped_closed++;
|
|
1404
1334
|
return;
|
|
1405
1335
|
}
|
|
@@ -1476,18 +1406,18 @@ async function load(me, target, callback, patch_fn = bare_patch) {
|
|
|
1476
1406
|
const { stream, actor, asOf } = target;
|
|
1477
1407
|
const time_travel = !!asOf && Object.values(asOf).some((v) => v !== void 0);
|
|
1478
1408
|
const seeded = time_travel && asOf.limit === void 0 && !asOf.created_after;
|
|
1479
|
-
const cached = time_travel ? void 0 : await
|
|
1409
|
+
const cached = time_travel ? void 0 : await _chunkN74AN6L5cjs.cache.call(void 0, ).get(stream);
|
|
1480
1410
|
const cache_hit = !!cached;
|
|
1481
1411
|
let state2 = _nullishCoalesce(_optionalChain([cached, 'optionalAccess', _63 => _63.state]), () => ( (me.init ? me.init() : {})));
|
|
1482
1412
|
let patches = _nullishCoalesce(_optionalChain([cached, 'optionalAccess', _64 => _64.patches]), () => ( 0));
|
|
1483
1413
|
let snaps = _nullishCoalesce(_optionalChain([cached, 'optionalAccess', _65 => _65.snaps]), () => ( 0));
|
|
1484
1414
|
let replayed = 0;
|
|
1485
1415
|
let event;
|
|
1486
|
-
await
|
|
1416
|
+
await _chunkN74AN6L5cjs.store.call(void 0, ).query(
|
|
1487
1417
|
(raw) => {
|
|
1488
|
-
if (seeded && raw.name ===
|
|
1418
|
+
if (seeded && raw.name === _chunkZTHGF62Ocjs.SNAP_EVENT && replayed > 0) return;
|
|
1489
1419
|
event = me.view(raw, actor);
|
|
1490
|
-
if (event.name ===
|
|
1420
|
+
if (event.name === _chunkZTHGF62Ocjs.SNAP_EVENT) {
|
|
1491
1421
|
state2 = event.data;
|
|
1492
1422
|
snaps++;
|
|
1493
1423
|
patches = 0;
|
|
@@ -1496,8 +1426,8 @@ async function load(me, target, callback, patch_fn = bare_patch) {
|
|
|
1496
1426
|
state2 = patch_fn(me, state2, me.patch[event.name](event, state2), event);
|
|
1497
1427
|
patches++;
|
|
1498
1428
|
replayed++;
|
|
1499
|
-
} else if (event.name !==
|
|
1500
|
-
|
|
1429
|
+
} else if (event.name !== _chunkZTHGF62Ocjs.TOMBSTONE_EVENT) {
|
|
1430
|
+
_chunkN74AN6L5cjs.log.call(void 0, ).warn(
|
|
1501
1431
|
`Skipping unknown event "${String(event.name)}" on stream "${stream}" (id=${event.id}) \u2014 no reducer in state "${me.name}"`
|
|
1502
1432
|
);
|
|
1503
1433
|
}
|
|
@@ -1525,7 +1455,7 @@ async function load(me, target, callback, patch_fn = bare_patch) {
|
|
|
1525
1455
|
) : time_travel ? asOf : { with_snaps: true }
|
|
1526
1456
|
}
|
|
1527
1457
|
);
|
|
1528
|
-
const head_is_tombstone = _optionalChain([event, 'optionalAccess', _67 => _67.name]) ===
|
|
1458
|
+
const head_is_tombstone = _optionalChain([event, 'optionalAccess', _67 => _67.name]) === _chunkZTHGF62Ocjs.TOMBSTONE_EVENT;
|
|
1529
1459
|
if (replayed > 0 && !time_travel && event && !me.pii_aware && !head_is_tombstone) {
|
|
1530
1460
|
await cache_put(stream, {
|
|
1531
1461
|
stream,
|
|
@@ -1568,8 +1498,8 @@ async function load_others(loads, payload, own, actor, patch_fn, refuse) {
|
|
|
1568
1498
|
void 0,
|
|
1569
1499
|
patch_fn
|
|
1570
1500
|
);
|
|
1571
|
-
if (_optionalChain([snapshot, 'access', _72 => _72.event, 'optionalAccess', _73 => _73.name]) ===
|
|
1572
|
-
throw new (0,
|
|
1501
|
+
if (_optionalChain([snapshot, 'access', _72 => _72.event, 'optionalAccess', _73 => _73.name]) === _chunkZTHGF62Ocjs.TOMBSTONE_EVENT)
|
|
1502
|
+
throw new (0, _chunkZTHGF62Ocjs.StreamClosedError)(stream);
|
|
1573
1503
|
return {
|
|
1574
1504
|
state: l.state,
|
|
1575
1505
|
stream,
|
|
@@ -1585,7 +1515,7 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
|
|
|
1585
1515
|
if (!stream) throw new Error("Missing target stream");
|
|
1586
1516
|
const reactingTo = _optionalChain([options, 'optionalAccess', _74 => _74.reactingTo]);
|
|
1587
1517
|
const correlator = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _75 => _75.correlator]), () => ( default_correlator));
|
|
1588
|
-
const validated =
|
|
1518
|
+
const validated = _chunkN74AN6L5cjs.validate.call(void 0, action2, payload, me.actions[action2]);
|
|
1589
1519
|
const opts = _optionalChain([me, 'access', _76 => _76.options, 'optionalAccess', _77 => _77[action2]]);
|
|
1590
1520
|
const max_retries = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _78 => _78.maxRetries]), () => ( 0));
|
|
1591
1521
|
const loads = _nullishCoalesce(_optionalChain([me, 'access', _79 => _79.loads, 'optionalAccess', _80 => _80[action2]]), () => ( []));
|
|
@@ -1597,8 +1527,8 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
|
|
|
1597
1527
|
void 0,
|
|
1598
1528
|
patch_fn
|
|
1599
1529
|
);
|
|
1600
|
-
if (_optionalChain([snapshot, 'access', _81 => _81.event, 'optionalAccess', _82 => _82.name]) ===
|
|
1601
|
-
throw new (0,
|
|
1530
|
+
if (_optionalChain([snapshot, 'access', _81 => _81.event, 'optionalAccess', _82 => _82.name]) === _chunkZTHGF62Ocjs.TOMBSTONE_EVENT)
|
|
1531
|
+
throw new (0, _chunkZTHGF62Ocjs.StreamClosedError)(stream);
|
|
1602
1532
|
const own = {
|
|
1603
1533
|
state: me,
|
|
1604
1534
|
stream,
|
|
@@ -1612,7 +1542,7 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
|
|
|
1612
1542
|
{ stream, state: snapshot.state },
|
|
1613
1543
|
target.actor,
|
|
1614
1544
|
patch_fn,
|
|
1615
|
-
(description) => new (0,
|
|
1545
|
+
(description) => new (0, _chunkZTHGF62Ocjs.PreconditionError)(
|
|
1616
1546
|
action2,
|
|
1617
1547
|
validated,
|
|
1618
1548
|
target,
|
|
@@ -1625,7 +1555,7 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
|
|
|
1625
1555
|
);
|
|
1626
1556
|
for (const { holds, description } of _nullishCoalesce(_optionalChain([me, 'access', _85 => _85.requires, 'optionalAccess', _86 => _86[action2]]), () => ( [])))
|
|
1627
1557
|
if (!holds(validated, snapshot.state, actor, loaded))
|
|
1628
|
-
throw new (0,
|
|
1558
|
+
throw new (0, _chunkZTHGF62Ocjs.PreconditionError)(
|
|
1629
1559
|
action2,
|
|
1630
1560
|
validated,
|
|
1631
1561
|
target,
|
|
@@ -1647,7 +1577,7 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
|
|
|
1647
1577
|
);
|
|
1648
1578
|
to.events.push({
|
|
1649
1579
|
name: event,
|
|
1650
|
-
data:
|
|
1580
|
+
data: _chunkN74AN6L5cjs.validate.call(void 0, event, data, to.state.events[event])
|
|
1651
1581
|
});
|
|
1652
1582
|
}
|
|
1653
1583
|
if (!own.events.length)
|
|
@@ -1704,7 +1634,7 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
|
|
|
1704
1634
|
});
|
|
1705
1635
|
let committed;
|
|
1706
1636
|
try {
|
|
1707
|
-
committed = await
|
|
1637
|
+
committed = await _chunkN74AN6L5cjs.store.call(void 0, ).commit(
|
|
1708
1638
|
appends.map((p) => ({
|
|
1709
1639
|
stream: p.stream,
|
|
1710
1640
|
msgs: p.events.map((e) => p.state.message(e)),
|
|
@@ -1713,7 +1643,7 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
|
|
|
1713
1643
|
meta
|
|
1714
1644
|
);
|
|
1715
1645
|
} catch (error) {
|
|
1716
|
-
if (error instanceof
|
|
1646
|
+
if (error instanceof _chunkZTHGF62Ocjs.ConcurrencyError) void cache_drop(error.stream);
|
|
1717
1647
|
throw error;
|
|
1718
1648
|
}
|
|
1719
1649
|
let row = 0;
|
|
@@ -1755,19 +1685,19 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
|
|
|
1755
1685
|
}
|
|
1756
1686
|
return snapshots;
|
|
1757
1687
|
} catch (error) {
|
|
1758
|
-
if (!(error instanceof
|
|
1688
|
+
if (!(error instanceof _chunkZTHGF62Ocjs.ConcurrencyError)) throw error;
|
|
1759
1689
|
if (expectedVersion !== void 0 && error.stream === stream) throw error;
|
|
1760
1690
|
if (attempt >= max_retries) throw error;
|
|
1761
1691
|
if (_optionalChain([opts, 'optionalAccess', _95 => _95.backoff])) {
|
|
1762
1692
|
const delay_ms = compute_backoff_delay(attempt, opts.backoff);
|
|
1763
|
-
if (delay_ms > 0) await
|
|
1693
|
+
if (delay_ms > 0) await _chunkN74AN6L5cjs.sleep.call(void 0, delay_ms);
|
|
1764
1694
|
}
|
|
1765
1695
|
}
|
|
1766
1696
|
}
|
|
1767
1697
|
}
|
|
1768
1698
|
|
|
1769
1699
|
// src/internal/tracing.ts
|
|
1770
|
-
var PRETTY =
|
|
1700
|
+
var PRETTY = _chunkN74AN6L5cjs.config.call(void 0, ).env !== "production";
|
|
1771
1701
|
var C_BLUE = "\x1B[38;5;39m";
|
|
1772
1702
|
var C_ORANGE = "\x1B[38;5;208m";
|
|
1773
1703
|
var C_GREEN = "\x1B[38;5;42m";
|
|
@@ -1951,7 +1881,7 @@ function budget_exhausted(lease, options, store_failing) {
|
|
|
1951
1881
|
if (store_failing || !_optionalChain([options, 'optionalAccess', _106 => _106.blockOnError]) || lease.retry <= options.maxRetries)
|
|
1952
1882
|
return void 0;
|
|
1953
1883
|
const error = `Blocking ${lease.stream} after ${lease.retry} claims with no acknowledged progress \u2014 the retry budget (${options.maxRetries}) was spent without the handler ever reporting an error. That means every attempt lost its lease before it could ack: move the reaction to a lane whose leaseMillis covers the handler, then unblock the stream.`;
|
|
1954
|
-
|
|
1884
|
+
_chunkN74AN6L5cjs.log.call(void 0, ).error(error);
|
|
1955
1885
|
return { lease, handled: 0, acked_at: lease.at, error, block: true };
|
|
1956
1886
|
}
|
|
1957
1887
|
function fetch_failure_policy(registry) {
|
|
@@ -1967,13 +1897,13 @@ function fetch_failure_policy(registry) {
|
|
|
1967
1897
|
function finalize(lease, handled, at, error, options, logger, failed_at) {
|
|
1968
1898
|
if (!error) return { lease, handled, acked_at: at };
|
|
1969
1899
|
logger.error(error);
|
|
1970
|
-
const non_retryable = error instanceof
|
|
1900
|
+
const non_retryable = error instanceof _chunkZTHGF62Ocjs.NonRetryableError;
|
|
1971
1901
|
const block2 = options.blockOnError && (non_retryable || lease.retry >= options.maxRetries);
|
|
1972
1902
|
if (block2)
|
|
1973
1903
|
logger.error(
|
|
1974
1904
|
non_retryable ? `Blocking ${lease.stream} on non-retryable error.` : `Blocking ${lease.stream} after ${lease.retry} retries.`
|
|
1975
1905
|
);
|
|
1976
|
-
const next_attempt_at = block2 ? void 0 : Date.now() + compute_backoff_delay(lease.retry, _nullishCoalesce(options.backoff, () => (
|
|
1906
|
+
const next_attempt_at = block2 ? void 0 : Date.now() + compute_backoff_delay(lease.retry, _nullishCoalesce(options.backoff, () => ( _chunkN74AN6L5cjs.DEFAULT_BACKOFF)));
|
|
1977
1907
|
return {
|
|
1978
1908
|
lease,
|
|
1979
1909
|
handled,
|
|
@@ -2101,7 +2031,7 @@ async function run_drain_cycle(deps, cycle) {
|
|
|
2101
2031
|
const acked = submitted.length ? await ops.ack(submitted) : [];
|
|
2102
2032
|
const expected = submitted.filter((l) => l.due === void 0).length;
|
|
2103
2033
|
if (acked.length < expected)
|
|
2104
|
-
|
|
2034
|
+
_chunkN74AN6L5cjs.log.call(void 0, ).warn(
|
|
2105
2035
|
`drain: ${expected - acked.length} of ${expected} acks were dropped \u2014 the lease was taken by another worker mid-handler. That work will be redelivered (at-least-once), but persistent drops mean leaseMillis is too short for this handler.`
|
|
2106
2036
|
);
|
|
2107
2037
|
const closeable = handled.filter((h) => h.close !== void 0).map((h) => h.close);
|
|
@@ -2197,9 +2127,9 @@ var DrainController = (_class3 = class {
|
|
|
2197
2127
|
if (!this.armed || this._stopped || this._inflight)
|
|
2198
2128
|
return EMPTY_DRAIN;
|
|
2199
2129
|
const d = _nullishCoalesce(this._deps.defaults, () => ( {}));
|
|
2200
|
-
const streamLimit = _nullishCoalesce(_nullishCoalesce(d.streamLimit, () => ( options.streamLimit)), () => (
|
|
2201
|
-
const eventLimit = _nullishCoalesce(options.eventLimit, () => (
|
|
2202
|
-
const leaseMillis = _nullishCoalesce(_nullishCoalesce(d.leaseMillis, () => ( options.leaseMillis)), () => (
|
|
2130
|
+
const streamLimit = _nullishCoalesce(_nullishCoalesce(d.streamLimit, () => ( options.streamLimit)), () => ( _chunkN74AN6L5cjs.DEFAULT_STREAM_LIMIT));
|
|
2131
|
+
const eventLimit = _nullishCoalesce(options.eventLimit, () => ( _chunkN74AN6L5cjs.DEFAULT_EVENT_LIMIT));
|
|
2132
|
+
const leaseMillis = _nullishCoalesce(_nullishCoalesce(d.leaseMillis, () => ( options.leaseMillis)), () => ( _chunkN74AN6L5cjs.DEFAULT_LEASE_MILLIS));
|
|
2203
2133
|
if (this._deps.breaker.state(Date.now()) === "open")
|
|
2204
2134
|
return EMPTY_DRAIN;
|
|
2205
2135
|
const pass = this._pass(streamLimit, eventLimit, leaseMillis).finally(
|
|
@@ -2325,7 +2255,7 @@ function build_handle(deps) {
|
|
|
2325
2255
|
handled++;
|
|
2326
2256
|
}
|
|
2327
2257
|
} catch (error) {
|
|
2328
|
-
if (error instanceof
|
|
2258
|
+
if (error instanceof _chunkZTHGF62Ocjs.DeferSignal) {
|
|
2329
2259
|
let defer;
|
|
2330
2260
|
try {
|
|
2331
2261
|
defer = resolve_defer_at(error.when, event);
|
|
@@ -2422,22 +2352,22 @@ function synthesize_autoclose_reactions(registry, states, read_window) {
|
|
|
2422
2352
|
// An anchored stream name would read as a pattern, and a store may refuse
|
|
2423
2353
|
// it at subscribe, stopping every reaction. Such a stream has no
|
|
2424
2354
|
// autoclose: `app.close` still closes it.
|
|
2425
|
-
resolver: (e) =>
|
|
2355
|
+
resolver: (e) => _chunkSC6TY4P2cjs.isStreamName.call(void 0, e.stream) ? {
|
|
2426
2356
|
target: `${AUTOCLOSE_TARGET_PREFIX}${e.stream}`,
|
|
2427
2357
|
source: e.stream
|
|
2428
2358
|
} : void 0,
|
|
2429
2359
|
// Never block on autoclose: a transient query/store error should retry,
|
|
2430
2360
|
// not quarantine the synthetic stream.
|
|
2431
|
-
options: { blockOnError: false, maxRetries:
|
|
2361
|
+
options: { blockOnError: false, maxRetries: _chunkN74AN6L5cjs.DEFAULT_MAX_RETRIES },
|
|
2432
2362
|
handler: async (event) => {
|
|
2433
2363
|
const aggregate = event.stream;
|
|
2434
2364
|
const window = read_window();
|
|
2435
2365
|
if (!in_autoclose_window(window, /* @__PURE__ */ new Date()))
|
|
2436
|
-
throw new (0,
|
|
2437
|
-
const stats = await
|
|
2366
|
+
throw new (0, _chunkZTHGF62Ocjs.DeferSignal)({ at: next_window_open(window, /* @__PURE__ */ new Date()) });
|
|
2367
|
+
const stats = await _chunkN74AN6L5cjs.store.call(void 0, ).query_stats([aggregate], {
|
|
2438
2368
|
count: true,
|
|
2439
2369
|
tail: keep_days !== void 0 ? true : void 0,
|
|
2440
|
-
exclude: [
|
|
2370
|
+
exclude: [_chunkZTHGF62Ocjs.TOMBSTONE_EVENT, _chunkZTHGF62Ocjs.SNAP_EVENT]
|
|
2441
2371
|
});
|
|
2442
2372
|
const entry = stats.get(aggregate);
|
|
2443
2373
|
if (!entry) return;
|
|
@@ -2475,7 +2405,7 @@ function synthesize_autoclose_reactions(registry, states, read_window) {
|
|
|
2475
2405
|
dues.push(days_after(entry.tail.created, keep_days));
|
|
2476
2406
|
const future = dues.map((d) => d.getTime()).filter((t) => t > Date.now());
|
|
2477
2407
|
if (future.length)
|
|
2478
|
-
throw new (0,
|
|
2408
|
+
throw new (0, _chunkZTHGF62Ocjs.DeferSignal)({ at: new Date(Math.min(...future)) });
|
|
2479
2409
|
}
|
|
2480
2410
|
};
|
|
2481
2411
|
const key = `__autoclose_${st.name}`;
|
|
@@ -2535,7 +2465,7 @@ async function run_close_cycle(targets, deps) {
|
|
|
2535
2465
|
deps,
|
|
2536
2466
|
() => run_full_closes(full, target_map, deps, skipped)
|
|
2537
2467
|
);
|
|
2538
|
-
const retired = [...truncated.entries()].filter(([, r]) => r.committed.name ===
|
|
2468
|
+
const retired = [...truncated.entries()].filter(([, r]) => r.committed.name === _chunkZTHGF62Ocjs.TOMBSTONE_EVENT).map(([stream]) => stream);
|
|
2539
2469
|
if (retired.length) _optionalChain([deps, 'access', _133 => _133.forget_subscribed, 'optionalCall', _134 => _134(retired)]);
|
|
2540
2470
|
for (const [stream, entry] of windowed_result) truncated.set(stream, entry);
|
|
2541
2471
|
return { truncated, skipped };
|
|
@@ -2617,7 +2547,7 @@ async function run_windowed_closes(windowed, deps, skipped) {
|
|
|
2617
2547
|
if (!await windowed_prune_pending(t.stream, t.before, max_id))
|
|
2618
2548
|
return void 0;
|
|
2619
2549
|
if (t.archive) await t.archive();
|
|
2620
|
-
const result = await
|
|
2550
|
+
const result = await _chunkN74AN6L5cjs.store.call(void 0, ).truncate([
|
|
2621
2551
|
{ stream: t.stream, before: t.before, max_id }
|
|
2622
2552
|
]);
|
|
2623
2553
|
return result.get(t.stream);
|
|
@@ -2630,10 +2560,10 @@ async function run_windowed_closes(windowed, deps, skipped) {
|
|
|
2630
2560
|
async function windowed_prune_pending(stream, before, max_id) {
|
|
2631
2561
|
let boundary_id;
|
|
2632
2562
|
let min_id;
|
|
2633
|
-
await
|
|
2563
|
+
await _chunkN74AN6L5cjs.store.call(void 0, ).query(
|
|
2634
2564
|
(event) => {
|
|
2635
2565
|
if (min_id === void 0 || event.id < min_id) min_id = event.id;
|
|
2636
|
-
if (event.name ===
|
|
2566
|
+
if (event.name === _chunkZTHGF62Ocjs.SNAP_EVENT && event.created < before && (max_id === void 0 || event.id <= max_id) && (boundary_id === void 0 || event.id > boundary_id))
|
|
2637
2567
|
boundary_id = event.id;
|
|
2638
2568
|
},
|
|
2639
2569
|
{ stream, stream_exact: true, with_snaps: true, after: -1 }
|
|
@@ -2644,7 +2574,7 @@ async function probe_min_watermarks(streams, page_size, checkpoint) {
|
|
|
2644
2574
|
const min_at = /* @__PURE__ */ new Map();
|
|
2645
2575
|
const matches = source_matcher();
|
|
2646
2576
|
await walk_streams(
|
|
2647
|
-
|
|
2577
|
+
_chunkN74AN6L5cjs.store.call(void 0, ),
|
|
2648
2578
|
(position) => {
|
|
2649
2579
|
const pending = position.correlated_at === void 0 || position.at < position.correlated_at;
|
|
2650
2580
|
const cap = pending ? position.at : Math.max(position.at, checkpoint);
|
|
@@ -2663,7 +2593,7 @@ function source_matcher() {
|
|
|
2663
2593
|
const compiled = /* @__PURE__ */ new Map();
|
|
2664
2594
|
return (source, target, stream) => {
|
|
2665
2595
|
if (!source) return true;
|
|
2666
|
-
if (
|
|
2596
|
+
if (_chunkSC6TY4P2cjs.isStreamName.call(void 0, source, target)) return source === stream;
|
|
2667
2597
|
let re = compiled.get(source);
|
|
2668
2598
|
if (!re) {
|
|
2669
2599
|
re = new RegExp(source);
|
|
@@ -2673,17 +2603,17 @@ function source_matcher() {
|
|
|
2673
2603
|
};
|
|
2674
2604
|
}
|
|
2675
2605
|
async function scan_stream_heads(streams) {
|
|
2676
|
-
const stats = await
|
|
2677
|
-
exclude: [
|
|
2606
|
+
const stats = await _chunkN74AN6L5cjs.store.call(void 0, ).query_stats(streams, {
|
|
2607
|
+
exclude: [_chunkZTHGF62Ocjs.SNAP_EVENT]
|
|
2678
2608
|
});
|
|
2679
|
-
const domain_heads = await
|
|
2680
|
-
exclude: [
|
|
2609
|
+
const domain_heads = await _chunkN74AN6L5cjs.store.call(void 0, ).query_stats(streams, {
|
|
2610
|
+
exclude: [_chunkZTHGF62Ocjs.SNAP_EVENT, _chunkZTHGF62Ocjs.TOMBSTONE_EVENT]
|
|
2681
2611
|
});
|
|
2682
|
-
const true_heads = await
|
|
2612
|
+
const true_heads = await _chunkN74AN6L5cjs.store.call(void 0, ).query_stats(streams, {});
|
|
2683
2613
|
const out = /* @__PURE__ */ new Map();
|
|
2684
2614
|
for (const [stream, { head }] of domain_heads) {
|
|
2685
2615
|
const marker_head = _optionalChain([stats, 'access', _136 => _136.get, 'call', _137 => _137(stream), 'optionalAccess', _138 => _138.head]);
|
|
2686
|
-
const interrupted = _optionalChain([marker_head, 'optionalAccess', _139 => _139.name]) ===
|
|
2616
|
+
const interrupted = _optionalChain([marker_head, 'optionalAccess', _139 => _139.name]) === _chunkZTHGF62Ocjs.TOMBSTONE_EVENT;
|
|
2687
2617
|
out.set(stream, {
|
|
2688
2618
|
max_id: head.id,
|
|
2689
2619
|
version: true_heads.get(stream).head.version,
|
|
@@ -2706,7 +2636,7 @@ async function partition_by_safety(stream_info, reactive, skipped, page_size, ca
|
|
|
2706
2636
|
const pending_set = /* @__PURE__ */ new Set();
|
|
2707
2637
|
const matches = source_matcher();
|
|
2708
2638
|
await walk_streams(
|
|
2709
|
-
|
|
2639
|
+
_chunkN74AN6L5cjs.store.call(void 0, ),
|
|
2710
2640
|
(position) => {
|
|
2711
2641
|
const has_work = position.correlated_at !== void 0 && position.at < position.correlated_at;
|
|
2712
2642
|
if (!has_work) return;
|
|
@@ -2773,7 +2703,7 @@ async function run_archive_callbacks(guarded, target_map) {
|
|
|
2773
2703
|
}
|
|
2774
2704
|
}
|
|
2775
2705
|
async function heads_still_guarded(guarded, guard_events, skipped) {
|
|
2776
|
-
const heads = await
|
|
2706
|
+
const heads = await _chunkN74AN6L5cjs.store.call(void 0, ).query_stats(guarded, {});
|
|
2777
2707
|
return guarded.filter((stream) => {
|
|
2778
2708
|
if (_optionalChain([heads, 'access', _146 => _146.get, 'call', _147 => _147(stream), 'optionalAccess', _148 => _148.head, 'access', _149 => _149.id]) === guard_events.get(stream).id)
|
|
2779
2709
|
return true;
|
|
@@ -2791,18 +2721,18 @@ async function truncate_and_warm_cache(guarded, seed_states, guard_events, corre
|
|
|
2791
2721
|
meta: {
|
|
2792
2722
|
correlation,
|
|
2793
2723
|
causation: {
|
|
2794
|
-
event: { id: guard.id, name:
|
|
2724
|
+
event: { id: guard.id, name: _chunkZTHGF62Ocjs.TOMBSTONE_EVENT, stream: guard.stream }
|
|
2795
2725
|
}
|
|
2796
2726
|
}
|
|
2797
2727
|
};
|
|
2798
2728
|
});
|
|
2799
|
-
const truncated = await
|
|
2729
|
+
const truncated = await _chunkN74AN6L5cjs.store.call(void 0, ).truncate(trunc_targets);
|
|
2800
2730
|
await Promise.all(
|
|
2801
2731
|
guarded.map(async (stream) => {
|
|
2802
2732
|
const entry = truncated.get(stream);
|
|
2803
2733
|
const state2 = seed_states.get(stream);
|
|
2804
2734
|
if (state2 && entry) {
|
|
2805
|
-
await
|
|
2735
|
+
await _chunkN74AN6L5cjs.cache.call(void 0, ).set(stream, {
|
|
2806
2736
|
stream,
|
|
2807
2737
|
state: state2,
|
|
2808
2738
|
version: entry.committed.version,
|
|
@@ -2811,7 +2741,7 @@ async function truncate_and_warm_cache(guarded, seed_states, guard_events, corre
|
|
|
2811
2741
|
snaps: 1
|
|
2812
2742
|
});
|
|
2813
2743
|
} else {
|
|
2814
|
-
await
|
|
2744
|
+
await _chunkN74AN6L5cjs.cache.call(void 0, ).invalidate(stream);
|
|
2815
2745
|
}
|
|
2816
2746
|
})
|
|
2817
2747
|
);
|
|
@@ -2870,7 +2800,7 @@ var CorrelateCycle = (_class5 = class {
|
|
|
2870
2800
|
// never lets a resolution re-lane them.
|
|
2871
2801
|
|
|
2872
2802
|
__init18() {this._static_subscriptions = /* @__PURE__ */ new Map()}
|
|
2873
|
-
__init19() {this._patterns = new (0,
|
|
2803
|
+
__init19() {this._patterns = new (0, _chunkN74AN6L5cjs.LruMap)(PATTERN_CACHE_SIZE)}
|
|
2874
2804
|
|
|
2875
2805
|
|
|
2876
2806
|
|
|
@@ -2888,7 +2818,7 @@ var CorrelateCycle = (_class5 = class {
|
|
|
2888
2818
|
on_init
|
|
2889
2819
|
}) {;_class5.prototype.__init10.call(this);_class5.prototype.__init11.call(this);_class5.prototype.__init12.call(this);_class5.prototype.__init13.call(this);_class5.prototype.__init14.call(this);_class5.prototype.__init15.call(this);_class5.prototype.__init16.call(this);_class5.prototype.__init17.call(this);_class5.prototype.__init18.call(this);_class5.prototype.__init19.call(this);_class5.prototype.__init20.call(this);
|
|
2890
2820
|
this._key = shard ? `${registry_key(registry.events)}:${[...shard].sort().join(",")}` : registry_key(registry.events);
|
|
2891
|
-
this._dynamic_subscriptions = new (0,
|
|
2821
|
+
this._dynamic_subscriptions = new (0, _chunkN74AN6L5cjs.LruMap)(max_subscribed_streams);
|
|
2892
2822
|
this._registry = registry;
|
|
2893
2823
|
this._declared_lanes = declared_lanes;
|
|
2894
2824
|
this._static_targets = static_targets;
|
|
@@ -2946,7 +2876,7 @@ var CorrelateCycle = (_class5 = class {
|
|
|
2946
2876
|
// Would the target's own `fetch` (filtered by `source`) return this event?
|
|
2947
2877
|
_in_fetch_window(source, stream) {
|
|
2948
2878
|
if (source === void 0 || source === stream) return true;
|
|
2949
|
-
if (
|
|
2879
|
+
if (_chunkSC6TY4P2cjs.isStreamName.call(void 0, source)) return false;
|
|
2950
2880
|
let pattern = this._patterns.get(source);
|
|
2951
2881
|
if (!pattern) {
|
|
2952
2882
|
pattern = new RegExp(source);
|
|
@@ -2989,7 +2919,7 @@ var CorrelateCycle = (_class5 = class {
|
|
|
2989
2919
|
const correlated = /* @__PURE__ */ new Map();
|
|
2990
2920
|
let last_id = after;
|
|
2991
2921
|
let stopped = false;
|
|
2992
|
-
const found = await
|
|
2922
|
+
const found = await _chunkN74AN6L5cjs.store.call(void 0, ).query(
|
|
2993
2923
|
(event) => {
|
|
2994
2924
|
if (stopped) return;
|
|
2995
2925
|
const register = this._registry.events[event.name];
|
|
@@ -3008,7 +2938,9 @@ var CorrelateCycle = (_class5 = class {
|
|
|
3008
2938
|
return;
|
|
3009
2939
|
}
|
|
3010
2940
|
if (!resolved) continue;
|
|
3011
|
-
|
|
2941
|
+
try {
|
|
2942
|
+
_chunkN74AN6L5cjs.check.call(void 0, "target", resolved);
|
|
2943
|
+
} catch (e2) {
|
|
3012
2944
|
report_bad_priority(
|
|
3013
2945
|
this._reported,
|
|
3014
2946
|
reaction.handler.name,
|
|
@@ -3043,9 +2975,9 @@ var CorrelateCycle = (_class5 = class {
|
|
|
3043
2975
|
correlated_at: void 0
|
|
3044
2976
|
};
|
|
3045
2977
|
const seen_in_scan = correlated.has(resolved.target);
|
|
3046
|
-
const held_lane = _nullishCoalesce((seen_in_scan ? entry.lane : _optionalChain([recorded, 'optionalAccess', _152 => _152.lane])), () => (
|
|
2978
|
+
const held_lane = _nullishCoalesce((seen_in_scan ? entry.lane : _optionalChain([recorded, 'optionalAccess', _152 => _152.lane])), () => ( _chunkZTHGF62Ocjs.DEFAULT_LANE));
|
|
3047
2979
|
const held_priority = seen_in_scan ? entry.priority : _optionalChain([recorded, 'optionalAccess', _153 => _153.priority]);
|
|
3048
|
-
const resolved_lane = _nullishCoalesce(lane, () => (
|
|
2980
|
+
const resolved_lane = _nullishCoalesce(lane, () => ( _chunkZTHGF62Ocjs.DEFAULT_LANE));
|
|
3049
2981
|
if (held_priority === priority && held_lane !== resolved_lane)
|
|
3050
2982
|
report_lane_conflict(
|
|
3051
2983
|
this._reported,
|
|
@@ -3119,7 +3051,7 @@ var CorrelateCycle = (_class5 = class {
|
|
|
3119
3051
|
await Promise.all(
|
|
3120
3052
|
missed.map(async ([stream, entry]) => {
|
|
3121
3053
|
let row;
|
|
3122
|
-
await
|
|
3054
|
+
await _chunkN74AN6L5cjs.store.call(void 0, ).query_streams(
|
|
3123
3055
|
(position) => {
|
|
3124
3056
|
row = position;
|
|
3125
3057
|
},
|
|
@@ -3131,8 +3063,8 @@ var CorrelateCycle = (_class5 = class {
|
|
|
3131
3063
|
lane: row.lane
|
|
3132
3064
|
});
|
|
3133
3065
|
if (entry.priority > row.priority) return;
|
|
3134
|
-
const held_lane = _nullishCoalesce(row.lane, () => (
|
|
3135
|
-
const resolved_lane = _nullishCoalesce(entry.lane, () => (
|
|
3066
|
+
const held_lane = _nullishCoalesce(row.lane, () => ( _chunkZTHGF62Ocjs.DEFAULT_LANE));
|
|
3067
|
+
const resolved_lane = _nullishCoalesce(entry.lane, () => ( _chunkZTHGF62Ocjs.DEFAULT_LANE));
|
|
3136
3068
|
if (entry.priority === row.priority && held_lane !== resolved_lane)
|
|
3137
3069
|
report_lane_conflict(
|
|
3138
3070
|
this._reported,
|
|
@@ -3158,7 +3090,7 @@ var CorrelateCycle = (_class5 = class {
|
|
|
3158
3090
|
millis: 0
|
|
3159
3091
|
});
|
|
3160
3092
|
} catch (error) {
|
|
3161
|
-
|
|
3093
|
+
_chunkN74AN6L5cjs.log.call(void 0, ).warn(
|
|
3162
3094
|
`Could not hand back the correlation lease during shutdown; it expires on its own within ${CORRELATION_LEASE_MS}ms and correlation resumes normally after that. On a single-writer store this usually means another connection holds the database. Cause: ${String(_nullishCoalesce(error.cause, () => ( error)))}`
|
|
3163
3095
|
);
|
|
3164
3096
|
}
|
|
@@ -3182,7 +3114,7 @@ function pii_gate(event, fields, predicate, actor) {
|
|
|
3182
3114
|
const { pii, ...rest } = event;
|
|
3183
3115
|
if (pii == null) {
|
|
3184
3116
|
const shredded = { ...data };
|
|
3185
|
-
for (const f of fields) shredded[f] =
|
|
3117
|
+
for (const f of fields) shredded[f] = _chunkZTHGF62Ocjs.SHREDDED;
|
|
3186
3118
|
return { ...rest, data: shredded };
|
|
3187
3119
|
}
|
|
3188
3120
|
const allowed = !!actor && !!predicate && predicate(event, actor);
|
|
@@ -3193,7 +3125,7 @@ function pii_gate(event, fields, predicate, actor) {
|
|
|
3193
3125
|
};
|
|
3194
3126
|
}
|
|
3195
3127
|
const redacted = { ...data };
|
|
3196
|
-
for (const f of fields) redacted[f] =
|
|
3128
|
+
for (const f of fields) redacted[f] = _chunkZTHGF62Ocjs.REDACTED;
|
|
3197
3129
|
return { ...rest, data: redacted };
|
|
3198
3130
|
}
|
|
3199
3131
|
var IDENTITY_GATE = (event) => event;
|
|
@@ -3401,13 +3333,6 @@ var SettleLoop = (_class6 = class {
|
|
|
3401
3333
|
}, _class6);
|
|
3402
3334
|
|
|
3403
3335
|
// src/act.ts
|
|
3404
|
-
function validate_only_lanes(only, declared) {
|
|
3405
|
-
const unknown = (_nullishCoalesce(only, () => ( []))).filter((l) => !declared.includes(l));
|
|
3406
|
-
if (unknown.length > 0)
|
|
3407
|
-
throw new Error(
|
|
3408
|
-
`ActOptions.onlyLanes references undeclared lane(s): ${unknown.map((l) => `"${l}"`).join(", ")}`
|
|
3409
|
-
);
|
|
3410
|
-
}
|
|
3411
3336
|
var Act = (_class7 = class {
|
|
3412
3337
|
__init26() {this._emitter = new (0, _events2.default)()}
|
|
3413
3338
|
|
|
@@ -3495,7 +3420,7 @@ var Act = (_class7 = class {
|
|
|
3495
3420
|
// Lanes to arm per event; `"all"` when a dynamic resolver hides the lane.
|
|
3496
3421
|
|
|
3497
3422
|
|
|
3498
|
-
__init27() {this._logger =
|
|
3423
|
+
__init27() {this._logger = _chunkN74AN6L5cjs.log.call(void 0, )}
|
|
3499
3424
|
// This Act's ports: its own bag, or the singleton adapters.
|
|
3500
3425
|
|
|
3501
3426
|
// Runs a body so internal `store()`/`cache()` calls resolve to `_ports`.
|
|
@@ -3515,12 +3440,19 @@ var Act = (_class7 = class {
|
|
|
3515
3440
|
this._states = states;
|
|
3516
3441
|
this._batch_handlers = batch_handlers;
|
|
3517
3442
|
this._lanes = lanes;
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3443
|
+
const declared = ["default", ...lanes.map((l) => l.name)];
|
|
3444
|
+
this._declared_lanes = declared;
|
|
3445
|
+
const undeclared = (_nullishCoalesce(options.onlyLanes, () => ( []))).filter(
|
|
3446
|
+
(l) => !declared.includes(l)
|
|
3447
|
+
);
|
|
3448
|
+
if (undeclared.length > 0)
|
|
3449
|
+
throw new Error(
|
|
3450
|
+
`ActOptions.onlyLanes references undeclared lane(s): ${undeclared.map((l) => `"${l}"`).join(", ")}`
|
|
3451
|
+
);
|
|
3452
|
+
if (options.scoped) _chunkN74AN6L5cjs.check.call(void 0, "store", options.scoped.store);
|
|
3453
|
+
this._ports = _nullishCoalesce(options.scoped, () => ( _chunkN74AN6L5cjs.unscoped_ports.call(void 0, )));
|
|
3522
3454
|
const ports = this._ports;
|
|
3523
|
-
this._scoped =
|
|
3455
|
+
this._scoped = _chunkN74AN6L5cjs.make_run_scoped.call(void 0, {
|
|
3524
3456
|
// Getters, not a spread: the singletons resolve lazily, so a later
|
|
3525
3457
|
// `store(...)` / `cache(...)` still takes effect.
|
|
3526
3458
|
get store() {
|
|
@@ -3530,14 +3462,14 @@ var Act = (_class7 = class {
|
|
|
3530
3462
|
return ports.cache;
|
|
3531
3463
|
},
|
|
3532
3464
|
// Parsed per build, so a bad window throws on every build.
|
|
3533
|
-
autoclose_window:
|
|
3465
|
+
autoclose_window: _chunkN74AN6L5cjs.check.call(void 0, "autoclose", options).autocloseWindow
|
|
3534
3466
|
});
|
|
3535
3467
|
this._correlator = _nullishCoalesce(options.correlator, () => ( default_correlator));
|
|
3536
3468
|
this._es = build_es(this._logger, this._correlator, patch_fn);
|
|
3537
3469
|
this._cd = build_drain(this._logger);
|
|
3538
3470
|
const handle = build_handle({
|
|
3539
3471
|
logger: this._logger,
|
|
3540
|
-
reaction_scope:
|
|
3472
|
+
reaction_scope: _chunkN74AN6L5cjs.make_reaction_scope.call(void 0, {
|
|
3541
3473
|
do: this.do.bind(this),
|
|
3542
3474
|
load: this.load.bind(this),
|
|
3543
3475
|
query: this.query.bind(this),
|
|
@@ -3567,12 +3499,12 @@ var Act = (_class7 = class {
|
|
|
3567
3499
|
this._ports.store,
|
|
3568
3500
|
options.listen !== false
|
|
3569
3501
|
);
|
|
3570
|
-
|
|
3502
|
+
_chunkN74AN6L5cjs.register_weak_disposer.call(void 0, new WeakRef(this), (self) => self.shutdown());
|
|
3571
3503
|
}
|
|
3572
3504
|
// Shared by drain, settle and autoclose; bad knobs throw at build.
|
|
3573
3505
|
_build_breaker(options) {
|
|
3574
3506
|
return new CircuitBreaker(
|
|
3575
|
-
|
|
3507
|
+
_chunkN74AN6L5cjs.check.call(void 0, "circuit_breaker", _nullishCoalesce(options.circuitBreaker, () => ( {}))),
|
|
3576
3508
|
{
|
|
3577
3509
|
on_error: (error, circuit) => this._emit_error(error, circuit),
|
|
3578
3510
|
// When the cooldown elapses, settle once: its scan or claim is the
|
|
@@ -3606,7 +3538,7 @@ var Act = (_class7 = class {
|
|
|
3606
3538
|
try {
|
|
3607
3539
|
await this._run_close(targets);
|
|
3608
3540
|
} catch (error) {
|
|
3609
|
-
if (error instanceof
|
|
3541
|
+
if (error instanceof _chunkZTHGF62Ocjs.StoreError) throw error;
|
|
3610
3542
|
this._logger.error(
|
|
3611
3543
|
error,
|
|
3612
3544
|
`Reaction-requested close of ${targets.map((t) => `"${t.stream}"`).join(", ")} failed; the policy retries it (a full close the next day, a prune on the stream's next commit), or close it now with app.close(...) once the cause is fixed.`
|
|
@@ -3640,7 +3572,7 @@ var Act = (_class7 = class {
|
|
|
3640
3572
|
// Audit deps, built after the controllers so the lane set is final.
|
|
3641
3573
|
_build_audit_deps() {
|
|
3642
3574
|
return {
|
|
3643
|
-
store:
|
|
3575
|
+
store: _chunkN74AN6L5cjs.store,
|
|
3644
3576
|
event_to_state: this._event_to_state,
|
|
3645
3577
|
// Declared lanes, not this process's controllers: a lane another
|
|
3646
3578
|
// worker drains is not `unknown-lane`.
|
|
@@ -3653,7 +3585,7 @@ var Act = (_class7 = class {
|
|
|
3653
3585
|
registry: this.registry,
|
|
3654
3586
|
static_targets: classification.static_targets,
|
|
3655
3587
|
cd: this._cd,
|
|
3656
|
-
max_subscribed_streams: _nullishCoalesce(options.maxSubscribedStreams, () => (
|
|
3588
|
+
max_subscribed_streams: _nullishCoalesce(options.maxSubscribedStreams, () => ( _chunkZTHGF62Ocjs.DEFAULT_MAX_SUBSCRIBED_STREAMS)),
|
|
3657
3589
|
// Declared lanes (not active ones): a lane another process claims is
|
|
3658
3590
|
// still a valid destination.
|
|
3659
3591
|
declared_lanes: new Set(this._declared_lanes),
|
|
@@ -3669,7 +3601,7 @@ var Act = (_class7 = class {
|
|
|
3669
3601
|
// Cold start: an idle deferred stream still fires on time after a restart.
|
|
3670
3602
|
async _seed_persisted_defers() {
|
|
3671
3603
|
const now = Date.now();
|
|
3672
|
-
await walk_streams(
|
|
3604
|
+
await walk_streams(_chunkN74AN6L5cjs.store.call(void 0, ), (pos) => {
|
|
3673
3605
|
if (pos.deferred_at === void 0 || pos.deferred_at <= now) return;
|
|
3674
3606
|
const controller = this._drain_controllers.get(_nullishCoalesce(pos.lane, () => ( "default")));
|
|
3675
3607
|
_optionalChain([controller, 'optionalAccess', _161 => _161.seed_defer, 'call', _162 => _162(pos.stream, pos.deferred_at)]);
|
|
@@ -3685,7 +3617,7 @@ var Act = (_class7 = class {
|
|
|
3685
3617
|
on_settled: (drain) => this.emit("settled", drain),
|
|
3686
3618
|
breaker: this._breaker
|
|
3687
3619
|
},
|
|
3688
|
-
_nullishCoalesce(options.settleDebounceMs, () => (
|
|
3620
|
+
_nullishCoalesce(options.settleDebounceMs, () => ( _chunkZTHGF62Ocjs.DEFAULT_SETTLE_DEBOUNCE_MS))
|
|
3689
3621
|
);
|
|
3690
3622
|
}
|
|
3691
3623
|
|
|
@@ -3705,7 +3637,7 @@ var Act = (_class7 = class {
|
|
|
3705
3637
|
*/
|
|
3706
3638
|
shutdown(options) {
|
|
3707
3639
|
if (!this._shutdown_promise) {
|
|
3708
|
-
|
|
3640
|
+
_chunkN74AN6L5cjs.check.call(void 0, "shutdown", _nullishCoalesce(options, () => ( {})));
|
|
3709
3641
|
this._shutdown_promise = (async () => {
|
|
3710
3642
|
this.stop_correlations();
|
|
3711
3643
|
this._settle.stop(true);
|
|
@@ -3723,10 +3655,10 @@ var Act = (_class7 = class {
|
|
|
3723
3655
|
// The largest `leaseMillis` among lanes with a cycle in flight (the
|
|
3724
3656
|
// default for none or 0, and for a running settle), capped.
|
|
3725
3657
|
_derive_grace_ms(running, settling) {
|
|
3726
|
-
let max = settling ?
|
|
3658
|
+
let max = settling ? _chunkN74AN6L5cjs.DEFAULT_LEASE_MILLIS : 0;
|
|
3727
3659
|
for (const c of running)
|
|
3728
|
-
max = Math.max(max, c.lease_millis ||
|
|
3729
|
-
return Math.min(max,
|
|
3660
|
+
max = Math.max(max, c.lease_millis || _chunkN74AN6L5cjs.DEFAULT_LEASE_MILLIS);
|
|
3661
|
+
return Math.min(max, _chunkN74AN6L5cjs.MAX_SHUTDOWN_GRACE_MS);
|
|
3730
3662
|
}
|
|
3731
3663
|
async _await_inflight(grace_ms) {
|
|
3732
3664
|
const running = [...this._drain_controllers.values()].filter(
|
|
@@ -3810,7 +3742,7 @@ var Act = (_class7 = class {
|
|
|
3810
3742
|
* @see {@link ValidationError}, {@link PreconditionError}, {@link ConcurrencyError}
|
|
3811
3743
|
*/
|
|
3812
3744
|
async do(action2, target, payload, options) {
|
|
3813
|
-
const reacting_to = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _164 => _164.reactingTo]), () => (
|
|
3745
|
+
const reacting_to = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _164 => _164.reactingTo]), () => ( _chunkN74AN6L5cjs.current_reacting.call(void 0, )));
|
|
3814
3746
|
const do_options = reacting_to === _optionalChain([options, 'optionalAccess', _165 => _165.reactingTo]) ? options : { ...options, reactingTo: reacting_to };
|
|
3815
3747
|
return this._scoped(async () => {
|
|
3816
3748
|
const snapshots = await this._es.action(
|
|
@@ -3884,7 +3816,7 @@ var Act = (_class7 = class {
|
|
|
3884
3816
|
return this._scoped(async () => {
|
|
3885
3817
|
let first;
|
|
3886
3818
|
let last;
|
|
3887
|
-
const count = await
|
|
3819
|
+
const count = await _chunkN74AN6L5cjs.store.call(void 0, ).query((e) => {
|
|
3888
3820
|
const gated = this.registry.query_gate(e.name)(e);
|
|
3889
3821
|
if (!first) first = gated;
|
|
3890
3822
|
last = gated;
|
|
@@ -3930,14 +3862,14 @@ var Act = (_class7 = class {
|
|
|
3930
3862
|
*/
|
|
3931
3863
|
async forget(stream) {
|
|
3932
3864
|
return this._scoped(async () => {
|
|
3933
|
-
const s =
|
|
3865
|
+
const s = _chunkN74AN6L5cjs.store.call(void 0, );
|
|
3934
3866
|
if (!s.forget_pii) {
|
|
3935
3867
|
throw new Error(
|
|
3936
3868
|
`Store does not implement forget_pii \u2014 adapter cannot comply with sensitive-data erasure. Use an adapter that declares pii_isolation: true (e.g. @rotorsoft/act on the in-memory store).`
|
|
3937
3869
|
);
|
|
3938
3870
|
}
|
|
3939
3871
|
const eventCount = await s.forget_pii(stream);
|
|
3940
|
-
await
|
|
3872
|
+
await _chunkN74AN6L5cjs.cache.call(void 0, ).invalidate(stream);
|
|
3941
3873
|
if (eventCount > 0) {
|
|
3942
3874
|
this.emit("forgotten", { stream, at: /* @__PURE__ */ new Date(), eventCount });
|
|
3943
3875
|
}
|
|
@@ -3971,7 +3903,7 @@ var Act = (_class7 = class {
|
|
|
3971
3903
|
* @see {@link correlate} for dynamic stream discovery
|
|
3972
3904
|
*/
|
|
3973
3905
|
async drain(options = {}) {
|
|
3974
|
-
|
|
3906
|
+
_chunkN74AN6L5cjs.check.call(void 0, "drain", options);
|
|
3975
3907
|
if (!this._drain)
|
|
3976
3908
|
return { fetched: [], leased: [], acked: [], blocked: [] };
|
|
3977
3909
|
return this._scoped(() => this._drain_all(options));
|
|
@@ -4151,7 +4083,7 @@ var Act = (_class7 = class {
|
|
|
4151
4083
|
*/
|
|
4152
4084
|
async reset(input) {
|
|
4153
4085
|
return this._scoped(async () => {
|
|
4154
|
-
const count = await
|
|
4086
|
+
const count = await _chunkN74AN6L5cjs.store.call(void 0, ).reset(input);
|
|
4155
4087
|
for (const handler of this._batch_handlers.values())
|
|
4156
4088
|
_optionalChain([handler, 'access', _172 => _172[FOLD_RESET], 'optionalCall', _173 => _173()]);
|
|
4157
4089
|
if (count > 0) {
|
|
@@ -4187,7 +4119,7 @@ var Act = (_class7 = class {
|
|
|
4187
4119
|
*/
|
|
4188
4120
|
async unblock(input) {
|
|
4189
4121
|
return this._scoped(async () => {
|
|
4190
|
-
const count = await
|
|
4122
|
+
const count = await _chunkN74AN6L5cjs.store.call(void 0, ).unblock(input);
|
|
4191
4123
|
if (count > 0) {
|
|
4192
4124
|
this._wake();
|
|
4193
4125
|
}
|
|
@@ -4235,7 +4167,7 @@ var Act = (_class7 = class {
|
|
|
4235
4167
|
* @see {@link Store.restore} for the underlying driver-pattern primitive.
|
|
4236
4168
|
*/
|
|
4237
4169
|
async restore(source, opts = {}, sink) {
|
|
4238
|
-
|
|
4170
|
+
_chunkN74AN6L5cjs.check.call(void 0, "scan", opts);
|
|
4239
4171
|
return this._scoped(async () => {
|
|
4240
4172
|
const started = Date.now();
|
|
4241
4173
|
if (opts.dry_run) {
|
|
@@ -4243,7 +4175,7 @@ var Act = (_class7 = class {
|
|
|
4243
4175
|
return { ...partial, duration_ms: Date.now() - started };
|
|
4244
4176
|
}
|
|
4245
4177
|
const target = _nullishCoalesce(sink, () => ( (() => {
|
|
4246
|
-
const s =
|
|
4178
|
+
const s = _chunkN74AN6L5cjs.store.call(void 0, );
|
|
4247
4179
|
if (!s.restore) throw new Error("adapter has no restore capability");
|
|
4248
4180
|
return s;
|
|
4249
4181
|
})()));
|
|
@@ -4289,7 +4221,7 @@ var Act = (_class7 = class {
|
|
|
4289
4221
|
async blocked_streams(options) {
|
|
4290
4222
|
return this._scoped(async () => {
|
|
4291
4223
|
const positions = [];
|
|
4292
|
-
await
|
|
4224
|
+
await _chunkN74AN6L5cjs.store.call(void 0, ).query_streams(
|
|
4293
4225
|
(p) => {
|
|
4294
4226
|
positions.push(p);
|
|
4295
4227
|
},
|
|
@@ -4315,7 +4247,7 @@ var Act = (_class7 = class {
|
|
|
4315
4247
|
* ```
|
|
4316
4248
|
*/
|
|
4317
4249
|
async *audit(categories, options) {
|
|
4318
|
-
|
|
4250
|
+
_chunkN74AN6L5cjs.check.call(void 0, "audit", _nullishCoalesce(options, () => ( {})));
|
|
4319
4251
|
const it = audit(this._audit_deps, categories, options)[Symbol.asyncIterator]();
|
|
4320
4252
|
while (true) {
|
|
4321
4253
|
const { value, done } = await this._scoped(() => it.next());
|
|
@@ -4343,8 +4275,8 @@ var Act = (_class7 = class {
|
|
|
4343
4275
|
* @see {@link Store.prioritize} for the underlying primitive
|
|
4344
4276
|
*/
|
|
4345
4277
|
async prioritize(filter, priority) {
|
|
4346
|
-
|
|
4347
|
-
return this._scoped(() =>
|
|
4278
|
+
_chunkN74AN6L5cjs.check.call(void 0, "target", { priority });
|
|
4279
|
+
return this._scoped(() => _chunkN74AN6L5cjs.store.call(void 0, ).prioritize(filter, priority));
|
|
4348
4280
|
}
|
|
4349
4281
|
// Shared by `close()` and reaction-requested closes.
|
|
4350
4282
|
async _run_close(targets) {
|
|
@@ -4424,7 +4356,7 @@ var Act = (_class7 = class {
|
|
|
4424
4356
|
* @see {@link correlate} for manual correlation
|
|
4425
4357
|
*/
|
|
4426
4358
|
settle(options) {
|
|
4427
|
-
|
|
4359
|
+
_chunkN74AN6L5cjs.check.call(void 0, "settle", _nullishCoalesce(options, () => ( {})));
|
|
4428
4360
|
this._schedule(options);
|
|
4429
4361
|
}
|
|
4430
4362
|
}, _class7);
|
|
@@ -4432,9 +4364,9 @@ var Act = (_class7 = class {
|
|
|
4432
4364
|
// src/builders/merge.ts
|
|
4433
4365
|
|
|
4434
4366
|
function base_type_name(schema) {
|
|
4435
|
-
let def =
|
|
4436
|
-
for (let inner =
|
|
4437
|
-
def =
|
|
4367
|
+
let def = _chunkZTHGF62Ocjs.def_of.call(void 0, schema);
|
|
4368
|
+
for (let inner = _chunkZTHGF62Ocjs.inner_of.call(void 0, def); inner; inner = _chunkZTHGF62Ocjs.inner_of.call(void 0, def))
|
|
4369
|
+
def = _chunkZTHGF62Ocjs.def_of.call(void 0, inner);
|
|
4438
4370
|
return def.type === "array" ? `array of ${base_type_name(def.element)}` : def.type;
|
|
4439
4371
|
}
|
|
4440
4372
|
function merge_schemas(existing, incoming, state_name) {
|
|
@@ -4621,9 +4553,9 @@ var _this_ = ({ stream }) => ({
|
|
|
4621
4553
|
|
|
4622
4554
|
// src/builders/builder-utils.ts
|
|
4623
4555
|
function register_lane(config2, lanes) {
|
|
4624
|
-
|
|
4625
|
-
if (config2.name ===
|
|
4626
|
-
throw new Error(`Lane "${
|
|
4556
|
+
_chunkN74AN6L5cjs.check.call(void 0, "lane", config2);
|
|
4557
|
+
if (config2.name === _chunkZTHGF62Ocjs.DEFAULT_LANE)
|
|
4558
|
+
throw new Error(`Lane "${_chunkZTHGF62Ocjs.DEFAULT_LANE}" is reserved`);
|
|
4627
4559
|
const existing = lanes.find((l) => l.name === config2.name);
|
|
4628
4560
|
if (!existing) return void lanes.push(config2);
|
|
4629
4561
|
if (existing.leaseMillis !== config2.leaseMillis || existing.streamLimit !== config2.streamLimit || existing.cycleMs !== config2.cycleMs)
|
|
@@ -4645,7 +4577,7 @@ function add_reaction(events, event, name, kind, make, builder) {
|
|
|
4645
4577
|
events[event].reactions.set(name, reaction);
|
|
4646
4578
|
return Object.assign(builder, {
|
|
4647
4579
|
to(resolver) {
|
|
4648
|
-
if (typeof resolver === "object")
|
|
4580
|
+
if (typeof resolver === "object") _chunkN74AN6L5cjs.check.call(void 0, "target", resolver);
|
|
4649
4581
|
reaction.resolver = typeof resolver === "string" ? { target: resolver } : resolver;
|
|
4650
4582
|
return builder;
|
|
4651
4583
|
}
|
|
@@ -4659,16 +4591,16 @@ function reaction_on(event, events, builder) {
|
|
|
4659
4591
|
"Reaction",
|
|
4660
4592
|
() => {
|
|
4661
4593
|
if (schedule && typeof schedule !== "function")
|
|
4662
|
-
|
|
4594
|
+
_chunkN74AN6L5cjs.check.call(void 0, "defer", schedule);
|
|
4663
4595
|
return {
|
|
4664
4596
|
handler: schedule ? make_deferred(handler, schedule) : handler,
|
|
4665
4597
|
resolver: _this_,
|
|
4666
4598
|
// Validate the whole bag at the declaration site so a bad
|
|
4667
4599
|
// `maxRetries`/`backoff`/`blockOnError` throws ZodError at build,
|
|
4668
4600
|
// not a NaN gate on the first retry.
|
|
4669
|
-
options:
|
|
4670
|
-
blockOnError: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _176 => _176.blockOnError]), () => (
|
|
4671
|
-
maxRetries: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _177 => _177.maxRetries]), () => (
|
|
4601
|
+
options: _chunkN74AN6L5cjs.check.call(void 0, "reaction", {
|
|
4602
|
+
blockOnError: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _176 => _176.blockOnError]), () => ( _chunkN74AN6L5cjs.DEFAULT_BLOCK_ON_ERROR)),
|
|
4603
|
+
maxRetries: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _177 => _177.maxRetries]), () => ( _chunkN74AN6L5cjs.DEFAULT_MAX_RETRIES)),
|
|
4672
4604
|
backoff: _optionalChain([options, 'optionalAccess', _178 => _178.backoff])
|
|
4673
4605
|
})
|
|
4674
4606
|
};
|
|
@@ -4686,7 +4618,7 @@ function reaction_on(event, events, builder) {
|
|
|
4686
4618
|
// src/builders/event-builder.ts
|
|
4687
4619
|
|
|
4688
4620
|
function event_tags(schema) {
|
|
4689
|
-
const pii =
|
|
4621
|
+
const pii = _chunkZTHGF62Ocjs.pii_schemas.call(void 0, schema);
|
|
4690
4622
|
const pii_dates = {};
|
|
4691
4623
|
for (const [key, field] of Object.entries(pii)) {
|
|
4692
4624
|
const dates = date_reviver_schema(field);
|
|
@@ -4724,7 +4656,7 @@ function make_event_reader(tags, disclosure, predicate = null) {
|
|
|
4724
4656
|
});
|
|
4725
4657
|
}
|
|
4726
4658
|
function build_events(registry, states, lanes, owners) {
|
|
4727
|
-
const declared = /* @__PURE__ */ new Set([
|
|
4659
|
+
const declared = /* @__PURE__ */ new Set([_chunkZTHGF62Ocjs.DEFAULT_LANE, ...lanes.map((l) => l.name)]);
|
|
4728
4660
|
const lane_errors = [];
|
|
4729
4661
|
const tags = /* @__PURE__ */ new Map();
|
|
4730
4662
|
const sensitive2 = /* @__PURE__ */ new Map();
|
|
@@ -4799,7 +4731,7 @@ function build_events(registry, states, lanes, owners) {
|
|
|
4799
4731
|
if (reader) readers.set(event_name, reader);
|
|
4800
4732
|
}
|
|
4801
4733
|
const snap2 = make_event_reader(event_tags(state2.state), "redact", null);
|
|
4802
|
-
if (snap2) readers.set(
|
|
4734
|
+
if (snap2) readers.set(_chunkZTHGF62Ocjs.SNAP_EVENT, snap2);
|
|
4803
4735
|
if (readers.size === 0) continue;
|
|
4804
4736
|
state2.view = (event, actor) => (_nullishCoalesce(readers.get(event.name), () => ( IDENTITY_GATE)))(event, actor);
|
|
4805
4737
|
}
|
|
@@ -4807,7 +4739,7 @@ function build_events(registry, states, lanes, owners) {
|
|
|
4807
4739
|
return { sensitive: sensitive2, advisory, query_readers, handler_readers };
|
|
4808
4740
|
}
|
|
4809
4741
|
function reads_as_string(schema) {
|
|
4810
|
-
const type = _optionalChain([
|
|
4742
|
+
const type = _optionalChain([_chunkZTHGF62Ocjs.def_of.call(void 0, _chunkZTHGF62Ocjs.output_of.call(void 0, schema)), 'optionalAccess', _179 => _179.type]);
|
|
4811
4743
|
return type === "string" || type === "transform";
|
|
4812
4744
|
}
|
|
4813
4745
|
|
|
@@ -4919,7 +4851,7 @@ function act() {
|
|
|
4919
4851
|
const list = deprecation_summary.map(
|
|
4920
4852
|
(d) => `"${d.deprecated}" (current: "${d.current}", state: "${d.state_name}")`
|
|
4921
4853
|
).join(", ");
|
|
4922
|
-
|
|
4854
|
+
_chunkN74AN6L5cjs.log.call(void 0, ).info(
|
|
4923
4855
|
`Act registered ${deprecation_summary.length} deprecated event(s): ${list}. These are legacy versions kept for the read path. Consider truncating closed streams via app.close() when feasible to reduce historical event load. See docs/docs/architecture/event-schema-evolution.md.`
|
|
4924
4856
|
);
|
|
4925
4857
|
}
|
|
@@ -4961,7 +4893,7 @@ function act() {
|
|
|
4961
4893
|
return reaction_on(event, registry.events, builder);
|
|
4962
4894
|
},
|
|
4963
4895
|
build: (options) => {
|
|
4964
|
-
|
|
4896
|
+
_chunkN74AN6L5cjs.check.call(void 0, "act", _nullishCoalesce(options, () => ( {})));
|
|
4965
4897
|
if (!_built) {
|
|
4966
4898
|
for (const proj of pending_projections) add_projection(proj);
|
|
4967
4899
|
for (const proj of fold_projections) {
|
|
@@ -5001,7 +4933,7 @@ function act() {
|
|
|
5001
4933
|
for (const [name, gate] of built.query_readers) _qg.set(name, gate);
|
|
5002
4934
|
for (const [name, gate] of built.handler_readers) _hr.set(name, gate);
|
|
5003
4935
|
finalize_deprecations();
|
|
5004
|
-
if (built.advisory)
|
|
4936
|
+
if (built.advisory) _chunkN74AN6L5cjs.log.call(void 0, ).warn(built.advisory);
|
|
5005
4937
|
for (const [name, state2] of states) {
|
|
5006
4938
|
if (!state2.loads) continue;
|
|
5007
4939
|
const resolved = {};
|
|
@@ -5045,7 +4977,7 @@ function act() {
|
|
|
5045
4977
|
synthesize_autoclose_reactions(
|
|
5046
4978
|
registry,
|
|
5047
4979
|
states,
|
|
5048
|
-
|
|
4980
|
+
_chunkN74AN6L5cjs.current_autoclose_window
|
|
5049
4981
|
);
|
|
5050
4982
|
Object.freeze(registry.actions);
|
|
5051
4983
|
Object.freeze(registry.events);
|
|
@@ -5093,8 +5025,8 @@ function _projection(target) {
|
|
|
5093
5025
|
handler,
|
|
5094
5026
|
resolver: _nullishCoalesce(default_resolver, () => ( _this_)),
|
|
5095
5027
|
options: {
|
|
5096
|
-
blockOnError:
|
|
5097
|
-
maxRetries:
|
|
5028
|
+
blockOnError: _chunkN74AN6L5cjs.DEFAULT_BLOCK_ON_ERROR,
|
|
5029
|
+
maxRetries: _chunkN74AN6L5cjs.DEFAULT_MAX_RETRIES
|
|
5098
5030
|
}
|
|
5099
5031
|
}),
|
|
5100
5032
|
widened
|
|
@@ -5135,7 +5067,7 @@ function _projection(target) {
|
|
|
5135
5067
|
throw new Error(
|
|
5136
5068
|
`Projection "${target}" .of() partials must share one state name \u2014 got "${name}" and "${partial.name}"`
|
|
5137
5069
|
);
|
|
5138
|
-
const config2 =
|
|
5070
|
+
const config2 = _chunkN74AN6L5cjs.check.call(void 0, "fold", options);
|
|
5139
5071
|
const fold_events = {};
|
|
5140
5072
|
for (const partial of partials)
|
|
5141
5073
|
for (const [event_name, schema] of Object.entries(partial.events)) {
|
|
@@ -5153,8 +5085,8 @@ function _projection(target) {
|
|
|
5153
5085
|
handler: noop,
|
|
5154
5086
|
resolver: { target },
|
|
5155
5087
|
options: {
|
|
5156
|
-
blockOnError:
|
|
5157
|
-
maxRetries:
|
|
5088
|
+
blockOnError: _chunkN74AN6L5cjs.DEFAULT_BLOCK_ON_ERROR,
|
|
5089
|
+
maxRetries: _chunkN74AN6L5cjs.DEFAULT_MAX_RETRIES
|
|
5158
5090
|
}
|
|
5159
5091
|
}
|
|
5160
5092
|
]
|
|
@@ -5270,7 +5202,7 @@ function action_builder(state2) {
|
|
|
5270
5202
|
throw new Error(`Duplicate action "${action2}"`);
|
|
5271
5203
|
internal.actions[action2] = schema;
|
|
5272
5204
|
if (options) {
|
|
5273
|
-
|
|
5205
|
+
_chunkN74AN6L5cjs.check.call(void 0, "action", options);
|
|
5274
5206
|
internal.options ??= {};
|
|
5275
5207
|
internal.options[action2] = options;
|
|
5276
5208
|
}
|
|
@@ -5528,30 +5460,29 @@ function write_line(writer, line) {
|
|
|
5528
5460
|
}
|
|
5529
5461
|
|
|
5530
5462
|
// src/deprecated.ts
|
|
5531
|
-
var check_appends =
|
|
5532
|
-
var throw_if_stale =
|
|
5533
|
-
var concurrency_error =
|
|
5534
|
-
var seed_event =
|
|
5535
|
-
var fair_slots =
|
|
5536
|
-
var is_literal_source =
|
|
5537
|
-
var notification_of =
|
|
5538
|
-
var DEFAULT_QUERY_STREAMS_LIMIT2 =
|
|
5539
|
-
var ActorSchema2 =
|
|
5540
|
-
var TargetSchema2 =
|
|
5541
|
-
var EventMetaSchema2 =
|
|
5542
|
-
var CausationEventSchema2 =
|
|
5543
|
-
var CommittedMetaSchema2 =
|
|
5544
|
-
var QuerySchema2 =
|
|
5545
|
-
var Environments2 =
|
|
5546
|
-
var LogLevels2 =
|
|
5547
|
-
var ExitCodes2 =
|
|
5548
|
-
var DEFAULT_LANE2 =
|
|
5549
|
-
var DEFAULT_MAX_SUBSCRIBED_STREAMS2 =
|
|
5550
|
-
var DEFAULT_SETTLE_DEBOUNCE_MS2 =
|
|
5551
|
-
var PackageSchema =
|
|
5552
|
-
var default_scope =
|
|
5553
|
-
var
|
|
5554
|
-
var extend = (source, schema, target) => ({ ...target, ..._chunkYXP6WASHcjs.validate.call(void 0, "config", source, schema) });
|
|
5463
|
+
var check_appends = _chunkSC6TY4P2cjs.checkAppends;
|
|
5464
|
+
var throw_if_stale = _chunkSC6TY4P2cjs.checkVersion;
|
|
5465
|
+
var concurrency_error = _chunkSC6TY4P2cjs.concurrencyError;
|
|
5466
|
+
var seed_event = _chunkSC6TY4P2cjs.seedEvent;
|
|
5467
|
+
var fair_slots = _chunkSC6TY4P2cjs.fairSlots;
|
|
5468
|
+
var is_literal_source = _chunkSC6TY4P2cjs.isStreamName;
|
|
5469
|
+
var notification_of = _chunkSC6TY4P2cjs.parseNotification;
|
|
5470
|
+
var DEFAULT_QUERY_STREAMS_LIMIT2 = _chunkZTHGF62Ocjs.DEFAULT_QUERY_STREAMS_LIMIT;
|
|
5471
|
+
var ActorSchema2 = _chunkZTHGF62Ocjs.ActorSchema;
|
|
5472
|
+
var TargetSchema2 = _chunkZTHGF62Ocjs.TargetSchema;
|
|
5473
|
+
var EventMetaSchema2 = _chunkZTHGF62Ocjs.EventMetaSchema;
|
|
5474
|
+
var CausationEventSchema2 = _chunkZTHGF62Ocjs.CausationEventSchema;
|
|
5475
|
+
var CommittedMetaSchema2 = _chunkZTHGF62Ocjs.CommittedMetaSchema;
|
|
5476
|
+
var QuerySchema2 = _chunkZTHGF62Ocjs.QuerySchema;
|
|
5477
|
+
var Environments2 = _chunkZTHGF62Ocjs.Environments;
|
|
5478
|
+
var LogLevels2 = _chunkZTHGF62Ocjs.LogLevels;
|
|
5479
|
+
var ExitCodes2 = _chunkZTHGF62Ocjs.ExitCodes;
|
|
5480
|
+
var DEFAULT_LANE2 = _chunkZTHGF62Ocjs.DEFAULT_LANE;
|
|
5481
|
+
var DEFAULT_MAX_SUBSCRIBED_STREAMS2 = _chunkZTHGF62Ocjs.DEFAULT_MAX_SUBSCRIBED_STREAMS;
|
|
5482
|
+
var DEFAULT_SETTLE_DEBOUNCE_MS2 = _chunkZTHGF62Ocjs.DEFAULT_SETTLE_DEBOUNCE_MS;
|
|
5483
|
+
var PackageSchema = _chunkN74AN6L5cjs.package_schema;
|
|
5484
|
+
var default_scope = _chunkN74AN6L5cjs.unscoped_ports;
|
|
5485
|
+
var extend = (source, schema, target) => ({ ...target, ..._chunkN74AN6L5cjs.validate.call(void 0, "config", source, schema) });
|
|
5555
5486
|
var ISO_8601 = /^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])(\.\d+)?(Z|[+-][0-2][0-9]:[0-5][0-9])?$/;
|
|
5556
5487
|
var dateReviver = (_key, value) => typeof value === "string" && ISO_8601.test(value) ? new Date(value) : value;
|
|
5557
5488
|
|
|
@@ -5613,6 +5544,5 @@ var dateReviver = (_key, value) => typeof value === "string" && ISO_8601.test(va
|
|
|
5613
5544
|
|
|
5614
5545
|
|
|
5615
5546
|
|
|
5616
|
-
|
|
5617
|
-
exports.Act = Act; exports.ActorSchema = ActorSchema2; exports.CausationEventSchema = CausationEventSchema2; exports.CommittedMetaSchema = CommittedMetaSchema2; exports.ConcurrencyError = _chunkQFYPSI6Pcjs.ConcurrencyError; exports.ConsoleLogger = _chunkYXP6WASHcjs.ConsoleLogger; exports.CsvFile = CsvFile; exports.DEFAULT_LANE = DEFAULT_LANE2; exports.DEFAULT_MAX_SUBSCRIBED_STREAMS = DEFAULT_MAX_SUBSCRIBED_STREAMS2; exports.DEFAULT_QUERY_STREAMS_LIMIT = DEFAULT_QUERY_STREAMS_LIMIT2; exports.DEFAULT_SETTLE_DEBOUNCE_MS = DEFAULT_SETTLE_DEBOUNCE_MS2; exports.DeferSignal = _chunkQFYPSI6Pcjs.DeferSignal; exports.Environments = Environments2; exports.Errors = _chunkQFYPSI6Pcjs.Errors; exports.EventMetaSchema = EventMetaSchema2; exports.ExitCodes = ExitCodes2; exports.InMemoryCache = _chunkYXP6WASHcjs.InMemoryCache; exports.InMemoryStore = _chunkYXP6WASHcjs.InMemoryStore; exports.LogLevels = LogLevels2; exports.NonRetryableError = _chunkQFYPSI6Pcjs.NonRetryableError; exports.PackageSchema = PackageSchema; exports.PreconditionError = _chunkQFYPSI6Pcjs.PreconditionError; exports.QuerySchema = QuerySchema2; exports.REDACTED = _chunkQFYPSI6Pcjs.REDACTED; exports.SHREDDED = _chunkQFYPSI6Pcjs.SHREDDED; exports.SNAP_EVENT = _chunkQFYPSI6Pcjs.SNAP_EVENT; exports.StoreError = _chunkQFYPSI6Pcjs.StoreError; exports.StreamClosedError = _chunkQFYPSI6Pcjs.StreamClosedError; exports.TOMBSTONE_EVENT = _chunkQFYPSI6Pcjs.TOMBSTONE_EVENT; exports.TargetSchema = TargetSchema2; exports.ValidationError = _chunkQFYPSI6Pcjs.ValidationError; exports.ZodEmpty = _chunkQFYPSI6Pcjs.ZodEmpty; exports.act = act; exports.cache = _chunkYXP6WASHcjs.cache; exports.check_appends = check_appends; exports.concurrency_error = concurrency_error; exports.config = _chunkYXP6WASHcjs.config; exports.dateReviver = dateReviver; exports.default_scope = default_scope; exports.dispose = _chunkYXP6WASHcjs.dispose; exports.disposeAndExit = _chunkYXP6WASHcjs.disposeAndExit; exports.extend = extend; exports.fair_slots = fair_slots; exports.is_literal_source = is_literal_source; exports.log = _chunkYXP6WASHcjs.log; exports.notification_of = notification_of; exports.pii_fields = _chunkQFYPSI6Pcjs.pii_fields; exports.port = _chunkYXP6WASHcjs.port; exports.projection = projection; exports.resolveAutocloseConfig = resolveAutocloseConfig2; exports.seed_event = seed_event; exports.sensitive = _chunkQFYPSI6Pcjs.sensitive; exports.sensitiveFields = _chunkQFYPSI6Pcjs.sensitiveFields; exports.sleep = _chunkYXP6WASHcjs.sleep; exports.slice = slice; exports.state = state; exports.store = _chunkYXP6WASHcjs.store; exports.throw_if_stale = throw_if_stale; exports.validate = _chunkYXP6WASHcjs.validate;
|
|
5547
|
+
exports.Act = Act; exports.ActorSchema = ActorSchema2; exports.CausationEventSchema = CausationEventSchema2; exports.CommittedMetaSchema = CommittedMetaSchema2; exports.ConcurrencyError = _chunkZTHGF62Ocjs.ConcurrencyError; exports.ConsoleLogger = _chunkN74AN6L5cjs.ConsoleLogger; exports.CsvFile = CsvFile; exports.DEFAULT_LANE = DEFAULT_LANE2; exports.DEFAULT_MAX_SUBSCRIBED_STREAMS = DEFAULT_MAX_SUBSCRIBED_STREAMS2; exports.DEFAULT_QUERY_STREAMS_LIMIT = DEFAULT_QUERY_STREAMS_LIMIT2; exports.DEFAULT_SETTLE_DEBOUNCE_MS = DEFAULT_SETTLE_DEBOUNCE_MS2; exports.DeferSignal = _chunkZTHGF62Ocjs.DeferSignal; exports.Environments = Environments2; exports.Errors = _chunkZTHGF62Ocjs.Errors; exports.EventMetaSchema = EventMetaSchema2; exports.ExitCodes = ExitCodes2; exports.InMemoryCache = _chunkN74AN6L5cjs.InMemoryCache; exports.InMemoryStore = _chunkN74AN6L5cjs.InMemoryStore; exports.LogLevels = LogLevels2; exports.NonRetryableError = _chunkZTHGF62Ocjs.NonRetryableError; exports.PackageSchema = PackageSchema; exports.PreconditionError = _chunkZTHGF62Ocjs.PreconditionError; exports.QuerySchema = QuerySchema2; exports.REDACTED = _chunkZTHGF62Ocjs.REDACTED; exports.SHREDDED = _chunkZTHGF62Ocjs.SHREDDED; exports.SNAP_EVENT = _chunkZTHGF62Ocjs.SNAP_EVENT; exports.StoreError = _chunkZTHGF62Ocjs.StoreError; exports.StreamClosedError = _chunkZTHGF62Ocjs.StreamClosedError; exports.TOMBSTONE_EVENT = _chunkZTHGF62Ocjs.TOMBSTONE_EVENT; exports.TargetSchema = TargetSchema2; exports.ValidationError = _chunkZTHGF62Ocjs.ValidationError; exports.ZodEmpty = _chunkZTHGF62Ocjs.ZodEmpty; exports.act = act; exports.cache = _chunkN74AN6L5cjs.cache; exports.check_appends = check_appends; exports.concurrency_error = concurrency_error; exports.config = _chunkN74AN6L5cjs.config; exports.dateReviver = dateReviver; exports.default_scope = default_scope; exports.dispose = _chunkN74AN6L5cjs.dispose; exports.disposeAndExit = _chunkN74AN6L5cjs.disposeAndExit; exports.extend = extend; exports.fair_slots = fair_slots; exports.is_literal_source = is_literal_source; exports.log = _chunkN74AN6L5cjs.log; exports.notification_of = notification_of; exports.pii_fields = _chunkZTHGF62Ocjs.pii_fields; exports.port = _chunkN74AN6L5cjs.port; exports.projection = projection; exports.seed_event = seed_event; exports.sensitive = _chunkZTHGF62Ocjs.sensitive; exports.sensitiveFields = _chunkZTHGF62Ocjs.sensitiveFields; exports.sleep = _chunkN74AN6L5cjs.sleep; exports.slice = slice; exports.state = state; exports.store = _chunkN74AN6L5cjs.store; exports.throw_if_stale = throw_if_stale; exports.validate = _chunkN74AN6L5cjs.validate;
|
|
5618
5548
|
//# sourceMappingURL=index.cjs.map
|