@rotorsoft/act 1.37.0 → 1.37.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/@types/sensitive.d.ts.map +1 -1
- package/dist/{chunk-A3XDAB7T.js → chunk-2H5MBVSQ.js} +3 -2
- package/dist/{chunk-A3XDAB7T.js.map → chunk-2H5MBVSQ.js.map} +1 -1
- package/dist/{chunk-C67XTW3W.cjs → chunk-5OU5CTJZ.cjs} +13 -13
- package/dist/{chunk-C67XTW3W.cjs.map → chunk-5OU5CTJZ.cjs.map} +1 -1
- package/dist/{chunk-NXURHBSB.cjs → chunk-J6G7UKZA.cjs} +4 -3
- package/dist/chunk-J6G7UKZA.cjs.map +1 -0
- package/dist/{chunk-BRJZQ4IY.js → chunk-SIOPY6HT.js} +2 -2
- package/dist/index.cjs +146 -146
- package/dist/index.js +2 -2
- package/dist/test/index.cjs +4 -4
- package/dist/test/index.js +2 -2
- package/dist/types/index.cjs +2 -2
- package/dist/types/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-NXURHBSB.cjs.map +0 -1
- /package/dist/{chunk-BRJZQ4IY.js.map → chunk-SIOPY6HT.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
var
|
|
43
|
+
var _chunk5OU5CTJZcjs = require('./chunk-5OU5CTJZ.cjs');
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
|
|
@@ -71,24 +71,24 @@ var _chunkC67XTW3Wcjs = require('./chunk-C67XTW3W.cjs');
|
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
|
|
74
|
-
var
|
|
74
|
+
var _chunkJ6G7UKZAcjs = require('./chunk-J6G7UKZA.cjs');
|
|
75
75
|
|
|
76
76
|
// src/signals.ts
|
|
77
77
|
process.once("SIGINT", async (arg) => {
|
|
78
|
-
|
|
79
|
-
await
|
|
78
|
+
_chunk5OU5CTJZcjs.log.call(void 0, ).info(arg, "SIGINT");
|
|
79
|
+
await _chunk5OU5CTJZcjs.disposeAndExit.call(void 0, "EXIT");
|
|
80
80
|
});
|
|
81
81
|
process.once("SIGTERM", async (arg) => {
|
|
82
|
-
|
|
83
|
-
await
|
|
82
|
+
_chunk5OU5CTJZcjs.log.call(void 0, ).info(arg, "SIGTERM");
|
|
83
|
+
await _chunk5OU5CTJZcjs.disposeAndExit.call(void 0, "EXIT");
|
|
84
84
|
});
|
|
85
85
|
process.once("uncaughtException", async (arg) => {
|
|
86
|
-
|
|
87
|
-
await
|
|
86
|
+
_chunk5OU5CTJZcjs.log.call(void 0, ).error(arg, "Uncaught Exception");
|
|
87
|
+
await _chunk5OU5CTJZcjs.disposeAndExit.call(void 0, "ERROR");
|
|
88
88
|
});
|
|
89
89
|
process.once("unhandledRejection", async (arg) => {
|
|
90
|
-
|
|
91
|
-
await
|
|
90
|
+
_chunk5OU5CTJZcjs.log.call(void 0, ).error(arg, "Unhandled Rejection");
|
|
91
|
+
await _chunk5OU5CTJZcjs.disposeAndExit.call(void 0, "ERROR");
|
|
92
92
|
});
|
|
93
93
|
|
|
94
94
|
// src/act.ts
|
|
@@ -196,7 +196,7 @@ async function* audit(deps, categories, options = {}) {
|
|
|
196
196
|
if (need_stats) {
|
|
197
197
|
const stats = await deps.store().query_stats(
|
|
198
198
|
{},
|
|
199
|
-
{ count: true, names: true, exclude: [
|
|
199
|
+
{ count: true, names: true, exclude: [_chunkJ6G7UKZAcjs.SNAP_EVENT] }
|
|
200
200
|
);
|
|
201
201
|
for (const [stream, s] of stats) {
|
|
202
202
|
for (const p of passes) _optionalChain([p, 'access', _4 => _4.on_stat, 'optionalCall', _5 => _5(stream, s)]);
|
|
@@ -278,7 +278,7 @@ var make_schema_pass = (deps) => {
|
|
|
278
278
|
return;
|
|
279
279
|
}
|
|
280
280
|
const schema = state2.events[name];
|
|
281
|
-
const sensitive2 =
|
|
281
|
+
const sensitive2 = _chunkJ6G7UKZAcjs.pii_fields.call(void 0, schema);
|
|
282
282
|
let parse_schema = schema;
|
|
283
283
|
if (sensitive2.length > 0) {
|
|
284
284
|
const omitter = schema.omit;
|
|
@@ -412,7 +412,7 @@ var make_restart_candidate_pass = (deps, options) => {
|
|
|
412
412
|
{
|
|
413
413
|
stream,
|
|
414
414
|
stream_exact: true,
|
|
415
|
-
names: [
|
|
415
|
+
names: [_chunkJ6G7UKZAcjs.SNAP_EVENT],
|
|
416
416
|
with_snaps: true
|
|
417
417
|
}
|
|
418
418
|
);
|
|
@@ -839,7 +839,7 @@ async function run_close_cycle(targets, deps) {
|
|
|
839
839
|
deps,
|
|
840
840
|
() => run_full_closes(full, target_map, deps, skipped)
|
|
841
841
|
);
|
|
842
|
-
const retired = [...truncated.entries()].filter(([, r]) => r.committed.name ===
|
|
842
|
+
const retired = [...truncated.entries()].filter(([, r]) => r.committed.name === _chunkJ6G7UKZAcjs.TOMBSTONE_EVENT).map(([stream]) => stream);
|
|
843
843
|
if (retired.length) _optionalChain([deps, 'access', _42 => _42.forget_subscribed, 'optionalCall', _43 => _43(retired)]);
|
|
844
844
|
for (const [stream, entry] of windowed_result) truncated.set(stream, entry);
|
|
845
845
|
return { truncated, skipped };
|
|
@@ -921,7 +921,7 @@ async function run_windowed_closes(windowed, deps, skipped) {
|
|
|
921
921
|
if (!await windowed_prune_pending(t.stream, t.before, max_id))
|
|
922
922
|
return void 0;
|
|
923
923
|
if (t.archive) await t.archive();
|
|
924
|
-
const result = await
|
|
924
|
+
const result = await _chunk5OU5CTJZcjs.store.call(void 0, ).truncate([
|
|
925
925
|
{ stream: t.stream, before: t.before, max_id }
|
|
926
926
|
]);
|
|
927
927
|
return result.get(t.stream);
|
|
@@ -934,10 +934,10 @@ async function run_windowed_closes(windowed, deps, skipped) {
|
|
|
934
934
|
async function windowed_prune_pending(stream, before, max_id) {
|
|
935
935
|
let boundary_id;
|
|
936
936
|
let min_id;
|
|
937
|
-
await
|
|
937
|
+
await _chunk5OU5CTJZcjs.store.call(void 0, ).query(
|
|
938
938
|
(event) => {
|
|
939
939
|
if (min_id === void 0 || event.id < min_id) min_id = event.id;
|
|
940
|
-
if (event.name ===
|
|
940
|
+
if (event.name === _chunkJ6G7UKZAcjs.SNAP_EVENT && event.created < before && (max_id === void 0 || event.id <= max_id) && (boundary_id === void 0 || event.id > boundary_id))
|
|
941
941
|
boundary_id = event.id;
|
|
942
942
|
},
|
|
943
943
|
{ stream, stream_exact: true, with_snaps: true, after: -1 }
|
|
@@ -948,7 +948,7 @@ async function probe_min_watermarks(streams, page_size, checkpoint) {
|
|
|
948
948
|
const min_at = /* @__PURE__ */ new Map();
|
|
949
949
|
const matches = source_matcher();
|
|
950
950
|
await walk_streams(
|
|
951
|
-
|
|
951
|
+
_chunk5OU5CTJZcjs.store.call(void 0, ),
|
|
952
952
|
(position) => {
|
|
953
953
|
const pending = position.correlated_at === void 0 || position.at < position.correlated_at;
|
|
954
954
|
const cap = pending ? position.at : Math.max(position.at, checkpoint);
|
|
@@ -976,17 +976,17 @@ function source_matcher() {
|
|
|
976
976
|
};
|
|
977
977
|
}
|
|
978
978
|
async function scan_stream_heads(streams) {
|
|
979
|
-
const stats = await
|
|
980
|
-
exclude: [
|
|
979
|
+
const stats = await _chunk5OU5CTJZcjs.store.call(void 0, ).query_stats(streams, {
|
|
980
|
+
exclude: [_chunkJ6G7UKZAcjs.SNAP_EVENT]
|
|
981
981
|
});
|
|
982
|
-
const domain_heads = await
|
|
983
|
-
exclude: [
|
|
982
|
+
const domain_heads = await _chunk5OU5CTJZcjs.store.call(void 0, ).query_stats(streams, {
|
|
983
|
+
exclude: [_chunkJ6G7UKZAcjs.SNAP_EVENT, _chunkJ6G7UKZAcjs.TOMBSTONE_EVENT]
|
|
984
984
|
});
|
|
985
|
-
const true_heads = await
|
|
985
|
+
const true_heads = await _chunk5OU5CTJZcjs.store.call(void 0, ).query_stats(streams, {});
|
|
986
986
|
const out = /* @__PURE__ */ new Map();
|
|
987
987
|
for (const [stream, { head }] of domain_heads) {
|
|
988
988
|
const marker_head = _optionalChain([stats, 'access', _45 => _45.get, 'call', _46 => _46(stream), 'optionalAccess', _47 => _47.head]);
|
|
989
|
-
const interrupted = _optionalChain([marker_head, 'optionalAccess', _48 => _48.name]) ===
|
|
989
|
+
const interrupted = _optionalChain([marker_head, 'optionalAccess', _48 => _48.name]) === _chunkJ6G7UKZAcjs.TOMBSTONE_EVENT;
|
|
990
990
|
out.set(stream, {
|
|
991
991
|
max_id: head.id,
|
|
992
992
|
version: true_heads.get(stream).head.version,
|
|
@@ -1010,7 +1010,7 @@ async function partition_by_safety(stream_info, reactive, skipped, page_size, ca
|
|
|
1010
1010
|
const matches = source_matcher();
|
|
1011
1011
|
const targets = [...stream_info.keys()];
|
|
1012
1012
|
await walk_streams(
|
|
1013
|
-
|
|
1013
|
+
_chunk5OU5CTJZcjs.store.call(void 0, ),
|
|
1014
1014
|
(position) => {
|
|
1015
1015
|
const has_work = position.correlated_at !== void 0 && position.at < position.correlated_at;
|
|
1016
1016
|
if (!has_work) return;
|
|
@@ -1076,7 +1076,7 @@ async function run_archive_callbacks(guarded, target_map) {
|
|
|
1076
1076
|
}
|
|
1077
1077
|
}
|
|
1078
1078
|
async function heads_still_guarded(guarded, guard_events, skipped) {
|
|
1079
|
-
const heads = await
|
|
1079
|
+
const heads = await _chunk5OU5CTJZcjs.store.call(void 0, ).query_stats(guarded, {});
|
|
1080
1080
|
return guarded.filter((stream) => {
|
|
1081
1081
|
if (_optionalChain([heads, 'access', _55 => _55.get, 'call', _56 => _56(stream), 'optionalAccess', _57 => _57.head, 'access', _58 => _58.id]) === guard_events.get(stream).id)
|
|
1082
1082
|
return true;
|
|
@@ -1094,18 +1094,18 @@ async function truncate_and_warm_cache(guarded, seed_states, guard_events, corre
|
|
|
1094
1094
|
meta: {
|
|
1095
1095
|
correlation,
|
|
1096
1096
|
causation: {
|
|
1097
|
-
event: { id: guard.id, name:
|
|
1097
|
+
event: { id: guard.id, name: _chunkJ6G7UKZAcjs.TOMBSTONE_EVENT, stream: guard.stream }
|
|
1098
1098
|
}
|
|
1099
1099
|
}
|
|
1100
1100
|
};
|
|
1101
1101
|
});
|
|
1102
|
-
const truncated = await
|
|
1102
|
+
const truncated = await _chunk5OU5CTJZcjs.store.call(void 0, ).truncate(trunc_targets);
|
|
1103
1103
|
await Promise.all(
|
|
1104
1104
|
guarded.map(async (stream) => {
|
|
1105
1105
|
const entry = truncated.get(stream);
|
|
1106
1106
|
const state2 = seed_states.get(stream);
|
|
1107
1107
|
if (state2 && entry) {
|
|
1108
|
-
await
|
|
1108
|
+
await _chunk5OU5CTJZcjs.cache.call(void 0, ).set(stream, {
|
|
1109
1109
|
stream,
|
|
1110
1110
|
state: state2,
|
|
1111
1111
|
version: entry.committed.version,
|
|
@@ -1114,7 +1114,7 @@ async function truncate_and_warm_cache(guarded, seed_states, guard_events, corre
|
|
|
1114
1114
|
snaps: 1
|
|
1115
1115
|
});
|
|
1116
1116
|
} else {
|
|
1117
|
-
await
|
|
1117
|
+
await _chunk5OU5CTJZcjs.cache.call(void 0, ).invalidate(stream);
|
|
1118
1118
|
}
|
|
1119
1119
|
})
|
|
1120
1120
|
);
|
|
@@ -1128,7 +1128,7 @@ var _crypto = require('crypto');
|
|
|
1128
1128
|
function report_once(seen, key, message) {
|
|
1129
1129
|
if (seen.has(key)) return;
|
|
1130
1130
|
seen.add(key);
|
|
1131
|
-
|
|
1131
|
+
_chunk5OU5CTJZcjs.log.call(void 0, ).error(new Error(message));
|
|
1132
1132
|
}
|
|
1133
1133
|
|
|
1134
1134
|
// src/internal/correlate-cycle.ts
|
|
@@ -1175,7 +1175,7 @@ var CorrelateCycle = (_class3 = class {
|
|
|
1175
1175
|
// never lets a resolution re-lane them.
|
|
1176
1176
|
|
|
1177
1177
|
__init11() {this._static_subscriptions = /* @__PURE__ */ new Map()}
|
|
1178
|
-
__init12() {this._patterns = new (0,
|
|
1178
|
+
__init12() {this._patterns = new (0, _chunk5OU5CTJZcjs.LruMap)(PATTERN_CACHE_SIZE)}
|
|
1179
1179
|
|
|
1180
1180
|
|
|
1181
1181
|
|
|
@@ -1193,7 +1193,7 @@ var CorrelateCycle = (_class3 = class {
|
|
|
1193
1193
|
on_init
|
|
1194
1194
|
}) {;_class3.prototype.__init3.call(this);_class3.prototype.__init4.call(this);_class3.prototype.__init5.call(this);_class3.prototype.__init6.call(this);_class3.prototype.__init7.call(this);_class3.prototype.__init8.call(this);_class3.prototype.__init9.call(this);_class3.prototype.__init10.call(this);_class3.prototype.__init11.call(this);_class3.prototype.__init12.call(this);_class3.prototype.__init13.call(this);
|
|
1195
1195
|
this._key = shard ? `${registry_key(registry.events)}:${[...shard].sort().join(",")}` : registry_key(registry.events);
|
|
1196
|
-
this._dynamic_subscriptions = new (0,
|
|
1196
|
+
this._dynamic_subscriptions = new (0, _chunk5OU5CTJZcjs.LruMap)(max_subscribed_streams);
|
|
1197
1197
|
this._registry = registry;
|
|
1198
1198
|
this._declared_lanes = declared_lanes;
|
|
1199
1199
|
this._static_targets = static_targets;
|
|
@@ -1251,7 +1251,7 @@ var CorrelateCycle = (_class3 = class {
|
|
|
1251
1251
|
// Would the target's own `fetch` (filtered by `source`) return this event?
|
|
1252
1252
|
_in_fetch_window(source, stream) {
|
|
1253
1253
|
if (source === void 0 || source === stream) return true;
|
|
1254
|
-
if (
|
|
1254
|
+
if (_chunk5OU5CTJZcjs.is_literal_source.call(void 0, source)) return false;
|
|
1255
1255
|
let pattern = this._patterns.get(source);
|
|
1256
1256
|
if (!pattern) {
|
|
1257
1257
|
pattern = new RegExp(source);
|
|
@@ -1294,7 +1294,7 @@ var CorrelateCycle = (_class3 = class {
|
|
|
1294
1294
|
const correlated = /* @__PURE__ */ new Map();
|
|
1295
1295
|
let last_id = after;
|
|
1296
1296
|
let stopped = false;
|
|
1297
|
-
const found = await
|
|
1297
|
+
const found = await _chunk5OU5CTJZcjs.store.call(void 0, ).query(
|
|
1298
1298
|
(event) => {
|
|
1299
1299
|
if (stopped) return;
|
|
1300
1300
|
const register = this._registry.events[event.name];
|
|
@@ -1339,9 +1339,9 @@ var CorrelateCycle = (_class3 = class {
|
|
|
1339
1339
|
correlated_at: void 0
|
|
1340
1340
|
};
|
|
1341
1341
|
const seen_in_scan = correlated.has(resolved.target);
|
|
1342
|
-
const held_lane = _nullishCoalesce((seen_in_scan ? entry.lane : _optionalChain([recorded, 'optionalAccess', _61 => _61.lane])), () => (
|
|
1342
|
+
const held_lane = _nullishCoalesce((seen_in_scan ? entry.lane : _optionalChain([recorded, 'optionalAccess', _61 => _61.lane])), () => ( _chunkJ6G7UKZAcjs.DEFAULT_LANE));
|
|
1343
1343
|
const held_priority = seen_in_scan ? entry.priority : _optionalChain([recorded, 'optionalAccess', _62 => _62.priority]);
|
|
1344
|
-
const resolved_lane = _nullishCoalesce(lane, () => (
|
|
1344
|
+
const resolved_lane = _nullishCoalesce(lane, () => ( _chunkJ6G7UKZAcjs.DEFAULT_LANE));
|
|
1345
1345
|
if (held_priority === priority && held_lane !== resolved_lane)
|
|
1346
1346
|
report_lane_conflict(
|
|
1347
1347
|
this._reported,
|
|
@@ -1415,7 +1415,7 @@ var CorrelateCycle = (_class3 = class {
|
|
|
1415
1415
|
await Promise.all(
|
|
1416
1416
|
missed.map(async ([stream, entry]) => {
|
|
1417
1417
|
let row;
|
|
1418
|
-
await
|
|
1418
|
+
await _chunk5OU5CTJZcjs.store.call(void 0, ).query_streams(
|
|
1419
1419
|
(position) => {
|
|
1420
1420
|
row = position;
|
|
1421
1421
|
},
|
|
@@ -1427,8 +1427,8 @@ var CorrelateCycle = (_class3 = class {
|
|
|
1427
1427
|
lane: row.lane
|
|
1428
1428
|
});
|
|
1429
1429
|
if (entry.priority > row.priority) return;
|
|
1430
|
-
const held_lane = _nullishCoalesce(row.lane, () => (
|
|
1431
|
-
const resolved_lane = _nullishCoalesce(entry.lane, () => (
|
|
1430
|
+
const held_lane = _nullishCoalesce(row.lane, () => ( _chunkJ6G7UKZAcjs.DEFAULT_LANE));
|
|
1431
|
+
const resolved_lane = _nullishCoalesce(entry.lane, () => ( _chunkJ6G7UKZAcjs.DEFAULT_LANE));
|
|
1432
1432
|
if (entry.priority === row.priority && held_lane !== resolved_lane)
|
|
1433
1433
|
report_lane_conflict(
|
|
1434
1434
|
this._reported,
|
|
@@ -1454,7 +1454,7 @@ var CorrelateCycle = (_class3 = class {
|
|
|
1454
1454
|
millis: 0
|
|
1455
1455
|
});
|
|
1456
1456
|
} catch (error) {
|
|
1457
|
-
|
|
1457
|
+
_chunk5OU5CTJZcjs.log.call(void 0, ).warn(
|
|
1458
1458
|
`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(error)}`
|
|
1459
1459
|
);
|
|
1460
1460
|
}
|
|
@@ -1607,14 +1607,14 @@ function compute_lag_lead_ratio(handled, lagging, leading) {
|
|
|
1607
1607
|
}
|
|
1608
1608
|
|
|
1609
1609
|
// src/internal/drain-ops.ts
|
|
1610
|
-
var claim = (lagging, leading, by, millis, lane) =>
|
|
1610
|
+
var claim = (lagging, leading, by, millis, lane) => _chunk5OU5CTJZcjs.store.call(void 0, ).claim(lagging, leading, by, millis, lane);
|
|
1611
1611
|
async function fetch(leased, eventLimit) {
|
|
1612
1612
|
return Promise.all(
|
|
1613
1613
|
leased.map(async ({ stream, source, at, lagging }) => {
|
|
1614
1614
|
const events = [];
|
|
1615
|
-
const stream_exact = source !== void 0 &&
|
|
1615
|
+
const stream_exact = source !== void 0 && _chunk5OU5CTJZcjs.is_literal_source.call(void 0, source) ? true : void 0;
|
|
1616
1616
|
try {
|
|
1617
|
-
await
|
|
1617
|
+
await _chunk5OU5CTJZcjs.store.call(void 0, ).query((e) => events.push(e), {
|
|
1618
1618
|
stream: source,
|
|
1619
1619
|
stream_exact,
|
|
1620
1620
|
after: at,
|
|
@@ -1634,9 +1634,9 @@ async function fetch(leased, eventLimit) {
|
|
|
1634
1634
|
})
|
|
1635
1635
|
);
|
|
1636
1636
|
}
|
|
1637
|
-
var ack = (leases) =>
|
|
1638
|
-
var block = (leases) =>
|
|
1639
|
-
var subscribe = (streams, correlated_at, correlator) =>
|
|
1637
|
+
var ack = (leases) => _chunk5OU5CTJZcjs.store.call(void 0, ).ack(leases);
|
|
1638
|
+
var block = (leases) => _chunk5OU5CTJZcjs.store.call(void 0, ).block(leases);
|
|
1639
|
+
var subscribe = (streams, correlated_at, correlator) => _chunk5OU5CTJZcjs.store.call(void 0, ).subscribe(streams, correlated_at, correlator);
|
|
1640
1640
|
|
|
1641
1641
|
// src/internal/event-sourcing.ts
|
|
1642
1642
|
var _actpatch = require('@rotorsoft/act-patch');
|
|
@@ -1651,29 +1651,29 @@ var check_invariants = (target, state2, schema, pii_aware) => {
|
|
|
1651
1651
|
try {
|
|
1652
1652
|
result = schema.safeParse(state2);
|
|
1653
1653
|
} catch (error) {
|
|
1654
|
-
throw new (0,
|
|
1654
|
+
throw new (0, _chunkJ6G7UKZAcjs.ValidationError)(target, state2, error);
|
|
1655
1655
|
}
|
|
1656
1656
|
if (result.success) return;
|
|
1657
1657
|
const issues = pii_aware ? result.error.issues.filter((issue) => {
|
|
1658
1658
|
const value = value_at(state2, issue.path);
|
|
1659
|
-
return value !==
|
|
1659
|
+
return value !== _chunkJ6G7UKZAcjs.REDACTED && value !== _chunkJ6G7UKZAcjs.SHREDDED;
|
|
1660
1660
|
}) : result.error.issues;
|
|
1661
1661
|
if (issues.length)
|
|
1662
|
-
throw new (0,
|
|
1662
|
+
throw new (0, _chunkJ6G7UKZAcjs.ValidationError)(
|
|
1663
1663
|
target,
|
|
1664
1664
|
state2,
|
|
1665
1665
|
_zod2.prettifyError.call(void 0, new (0, _zod2.ZodError)(issues))
|
|
1666
1666
|
);
|
|
1667
1667
|
};
|
|
1668
1668
|
var DEFAULT_BATCH = 500;
|
|
1669
|
-
var cache_put = (stream, entry) =>
|
|
1670
|
-
(err) =>
|
|
1669
|
+
var cache_put = (stream, entry) => _chunk5OU5CTJZcjs.cache.call(void 0, ).set(stream, entry).catch(
|
|
1670
|
+
(err) => _chunk5OU5CTJZcjs.log.call(void 0, ).warn(
|
|
1671
1671
|
err,
|
|
1672
1672
|
"cache set skipped; the next load re-folds from the store"
|
|
1673
1673
|
)
|
|
1674
1674
|
);
|
|
1675
|
-
var cache_drop = (stream) =>
|
|
1676
|
-
(err) =>
|
|
1675
|
+
var cache_drop = (stream) => _chunk5OU5CTJZcjs.cache.call(void 0, ).invalidate(stream).catch(
|
|
1676
|
+
(err) => _chunk5OU5CTJZcjs.log.call(void 0, ).warn(
|
|
1677
1677
|
err,
|
|
1678
1678
|
"cache invalidate skipped; a stale checkpoint re-folds from its event_id"
|
|
1679
1679
|
)
|
|
@@ -1681,9 +1681,9 @@ var cache_drop = (stream) => _chunkC67XTW3Wcjs.cache.call(void 0, ).invalidate(s
|
|
|
1681
1681
|
async function snap(snapshot) {
|
|
1682
1682
|
const { id, stream, name, meta, version } = snapshot.event;
|
|
1683
1683
|
try {
|
|
1684
|
-
const [committed] = await
|
|
1684
|
+
const [committed] = await _chunk5OU5CTJZcjs.store.call(void 0, ).commit(
|
|
1685
1685
|
stream,
|
|
1686
|
-
[{ name:
|
|
1686
|
+
[{ name: _chunkJ6G7UKZAcjs.SNAP_EVENT, data: snapshot.state }],
|
|
1687
1687
|
{
|
|
1688
1688
|
correlation: meta.correlation,
|
|
1689
1689
|
causation: { event: { id, name, stream } }
|
|
@@ -1694,22 +1694,22 @@ async function snap(snapshot) {
|
|
|
1694
1694
|
return committed;
|
|
1695
1695
|
} catch (error) {
|
|
1696
1696
|
const reason = error instanceof Error ? error.message : String(error);
|
|
1697
|
-
|
|
1697
|
+
_chunk5OU5CTJZcjs.log.call(void 0, ).warn(
|
|
1698
1698
|
`Snapshot write failed on stream "${stream}": ${reason} \u2014 cold starts will replay full history until snapshots succeed.`
|
|
1699
1699
|
);
|
|
1700
1700
|
}
|
|
1701
1701
|
}
|
|
1702
1702
|
async function tombstone(stream, expectedVersion, correlation) {
|
|
1703
1703
|
try {
|
|
1704
|
-
const [committed] = await
|
|
1704
|
+
const [committed] = await _chunk5OU5CTJZcjs.store.call(void 0, ).commit(
|
|
1705
1705
|
stream,
|
|
1706
|
-
[{ name:
|
|
1706
|
+
[{ name: _chunkJ6G7UKZAcjs.TOMBSTONE_EVENT, data: {} }],
|
|
1707
1707
|
{ correlation, causation: {} },
|
|
1708
1708
|
expectedVersion
|
|
1709
1709
|
);
|
|
1710
1710
|
return committed;
|
|
1711
1711
|
} catch (error) {
|
|
1712
|
-
if (error instanceof
|
|
1712
|
+
if (error instanceof _chunkJ6G7UKZAcjs.ConcurrencyError) return void 0;
|
|
1713
1713
|
throw error;
|
|
1714
1714
|
}
|
|
1715
1715
|
}
|
|
@@ -1739,9 +1739,9 @@ async function scan(source, opts = {}, callback) {
|
|
|
1739
1739
|
if (drop_closed_streams) {
|
|
1740
1740
|
await source.query(
|
|
1741
1741
|
(e) => {
|
|
1742
|
-
if (e.name ===
|
|
1742
|
+
if (e.name === _chunkJ6G7UKZAcjs.TOMBSTONE_EVENT) closed_streams.add(e.stream);
|
|
1743
1743
|
},
|
|
1744
|
-
{ names: [
|
|
1744
|
+
{ names: [_chunkJ6G7UKZAcjs.TOMBSTONE_EVENT] }
|
|
1745
1745
|
);
|
|
1746
1746
|
}
|
|
1747
1747
|
let max_id;
|
|
@@ -1763,11 +1763,11 @@ async function scan(source, opts = {}, callback) {
|
|
|
1763
1763
|
if (!is_valid(event))
|
|
1764
1764
|
throw new Error(`Invalid event at index ${processed}`);
|
|
1765
1765
|
if (on_progress) on_progress({ processed, id: event.id, max_id });
|
|
1766
|
-
if (drop_snapshots && event.name ===
|
|
1766
|
+
if (drop_snapshots && event.name === _chunkJ6G7UKZAcjs.SNAP_EVENT) {
|
|
1767
1767
|
dropped_snaps++;
|
|
1768
1768
|
return;
|
|
1769
1769
|
}
|
|
1770
|
-
if (closed_streams.has(event.stream) && event.name !==
|
|
1770
|
+
if (closed_streams.has(event.stream) && event.name !== _chunkJ6G7UKZAcjs.TOMBSTONE_EVENT) {
|
|
1771
1771
|
dropped_closed++;
|
|
1772
1772
|
return;
|
|
1773
1773
|
}
|
|
@@ -1834,17 +1834,17 @@ async function scan(source, opts = {}, callback) {
|
|
|
1834
1834
|
async function load(me, target, callback, patch_fn = bare_patch) {
|
|
1835
1835
|
const { stream, actor, asOf } = target;
|
|
1836
1836
|
const time_travel = !!asOf && Object.values(asOf).some((v) => v !== void 0);
|
|
1837
|
-
const cached = time_travel ? void 0 : await
|
|
1837
|
+
const cached = time_travel ? void 0 : await _chunk5OU5CTJZcjs.cache.call(void 0, ).get(stream);
|
|
1838
1838
|
const cache_hit = !!cached;
|
|
1839
1839
|
let state2 = _nullishCoalesce(_optionalChain([cached, 'optionalAccess', _73 => _73.state]), () => ( (me.init ? me.init() : {})));
|
|
1840
1840
|
let patches = _nullishCoalesce(_optionalChain([cached, 'optionalAccess', _74 => _74.patches]), () => ( 0));
|
|
1841
1841
|
let snaps = _nullishCoalesce(_optionalChain([cached, 'optionalAccess', _75 => _75.snaps]), () => ( 0));
|
|
1842
1842
|
let replayed = 0;
|
|
1843
1843
|
let event;
|
|
1844
|
-
await
|
|
1844
|
+
await _chunk5OU5CTJZcjs.store.call(void 0, ).query(
|
|
1845
1845
|
(raw) => {
|
|
1846
1846
|
event = me.view(raw, actor);
|
|
1847
|
-
if (event.name ===
|
|
1847
|
+
if (event.name === _chunkJ6G7UKZAcjs.SNAP_EVENT) {
|
|
1848
1848
|
state2 = event.data;
|
|
1849
1849
|
snaps++;
|
|
1850
1850
|
patches = 0;
|
|
@@ -1853,8 +1853,8 @@ async function load(me, target, callback, patch_fn = bare_patch) {
|
|
|
1853
1853
|
state2 = patch_fn(me, state2, me.patch[event.name](event, state2), event);
|
|
1854
1854
|
patches++;
|
|
1855
1855
|
replayed++;
|
|
1856
|
-
} else if (event.name !==
|
|
1857
|
-
|
|
1856
|
+
} else if (event.name !== _chunkJ6G7UKZAcjs.TOMBSTONE_EVENT) {
|
|
1857
|
+
_chunk5OU5CTJZcjs.log.call(void 0, ).warn(
|
|
1858
1858
|
`Skipping unknown event "${String(event.name)}" on stream "${stream}" (id=${event.id}) \u2014 no reducer in state "${me.name}"`
|
|
1859
1859
|
);
|
|
1860
1860
|
}
|
|
@@ -1878,7 +1878,7 @@ async function load(me, target, callback, patch_fn = bare_patch) {
|
|
|
1878
1878
|
...cached ? { after: cached.event_id, with_snaps: true } : { ...time_travel ? {} : { with_snaps: true }, ...asOf }
|
|
1879
1879
|
}
|
|
1880
1880
|
);
|
|
1881
|
-
const head_is_tombstone = _optionalChain([event, 'optionalAccess', _77 => _77.name]) ===
|
|
1881
|
+
const head_is_tombstone = _optionalChain([event, 'optionalAccess', _77 => _77.name]) === _chunkJ6G7UKZAcjs.TOMBSTONE_EVENT;
|
|
1882
1882
|
if (replayed > 0 && !time_travel && event && !me.pii_aware && !head_is_tombstone) {
|
|
1883
1883
|
await cache_put(stream, {
|
|
1884
1884
|
stream,
|
|
@@ -1906,7 +1906,7 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
|
|
|
1906
1906
|
if (!stream) throw new Error("Missing target stream");
|
|
1907
1907
|
const reactingTo = _optionalChain([options, 'optionalAccess', _82 => _82.reactingTo]);
|
|
1908
1908
|
const correlator = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _83 => _83.correlator]), () => ( default_correlator));
|
|
1909
|
-
const validated =
|
|
1909
|
+
const validated = _chunk5OU5CTJZcjs.validate.call(void 0, action2, payload, me.actions[action2]);
|
|
1910
1910
|
const opts = _optionalChain([me, 'access', _84 => _84.options, 'optionalAccess', _85 => _85[action2]]);
|
|
1911
1911
|
const max_retries = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _86 => _86.maxRetries]), () => ( 0));
|
|
1912
1912
|
for (let attempt = 0; ; attempt++) {
|
|
@@ -1917,12 +1917,12 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
|
|
|
1917
1917
|
void 0,
|
|
1918
1918
|
patch_fn
|
|
1919
1919
|
);
|
|
1920
|
-
if (_optionalChain([snapshot, 'access', _87 => _87.event, 'optionalAccess', _88 => _88.name]) ===
|
|
1921
|
-
throw new (0,
|
|
1920
|
+
if (_optionalChain([snapshot, 'access', _87 => _87.event, 'optionalAccess', _88 => _88.name]) === _chunkJ6G7UKZAcjs.TOMBSTONE_EVENT)
|
|
1921
|
+
throw new (0, _chunkJ6G7UKZAcjs.StreamClosedError)(stream);
|
|
1922
1922
|
const expected = _nullishCoalesce(expectedVersion, () => ( snapshot.version));
|
|
1923
1923
|
for (const { valid, description } of _nullishCoalesce(_optionalChain([me, 'access', _89 => _89.given, 'optionalAccess', _90 => _90[action2]]), () => ( [])))
|
|
1924
1924
|
if (!valid(snapshot.state, actor))
|
|
1925
|
-
throw new (0,
|
|
1925
|
+
throw new (0, _chunkJ6G7UKZAcjs.InvariantError)(
|
|
1926
1926
|
action2,
|
|
1927
1927
|
validated,
|
|
1928
1928
|
target,
|
|
@@ -1931,7 +1931,7 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
|
|
|
1931
1931
|
);
|
|
1932
1932
|
for (const { holds, description } of _nullishCoalesce(_optionalChain([me, 'access', _91 => _91.requires, 'optionalAccess', _92 => _92[action2]]), () => ( [])))
|
|
1933
1933
|
if (!holds(validated, snapshot.state, actor))
|
|
1934
|
-
throw new (0,
|
|
1934
|
+
throw new (0, _chunkJ6G7UKZAcjs.PreconditionError)(
|
|
1935
1935
|
action2,
|
|
1936
1936
|
validated,
|
|
1937
1937
|
target,
|
|
@@ -1944,7 +1944,7 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
|
|
|
1944
1944
|
const tuples = Array.isArray(result[0]) ? result : [result];
|
|
1945
1945
|
const events = tuples.map(([name, data]) => ({
|
|
1946
1946
|
name,
|
|
1947
|
-
data:
|
|
1947
|
+
data: _chunk5OU5CTJZcjs.validate.call(void 0, name, data, me.events[name])
|
|
1948
1948
|
}));
|
|
1949
1949
|
const emitted = events.map((e) => me.message(e));
|
|
1950
1950
|
const meta = {
|
|
@@ -1991,9 +1991,9 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
|
|
|
1991
1991
|
);
|
|
1992
1992
|
let committed;
|
|
1993
1993
|
try {
|
|
1994
|
-
committed = await
|
|
1994
|
+
committed = await _chunk5OU5CTJZcjs.store.call(void 0, ).commit(stream, emitted, meta, expected);
|
|
1995
1995
|
} catch (error) {
|
|
1996
|
-
if (error instanceof
|
|
1996
|
+
if (error instanceof _chunkJ6G7UKZAcjs.ConcurrencyError) void cache_drop(stream);
|
|
1997
1997
|
throw error;
|
|
1998
1998
|
}
|
|
1999
1999
|
const snapshots = committed.map((row, i) => ({
|
|
@@ -2020,19 +2020,19 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
|
|
|
2020
2020
|
});
|
|
2021
2021
|
return snapshots;
|
|
2022
2022
|
} catch (error) {
|
|
2023
|
-
if (!(error instanceof
|
|
2023
|
+
if (!(error instanceof _chunkJ6G7UKZAcjs.ConcurrencyError)) throw error;
|
|
2024
2024
|
if (expectedVersion !== void 0) throw error;
|
|
2025
2025
|
if (attempt >= max_retries) throw error;
|
|
2026
2026
|
if (_optionalChain([opts, 'optionalAccess', _99 => _99.backoff])) {
|
|
2027
2027
|
const delay_ms = compute_backoff_delay(attempt, opts.backoff);
|
|
2028
|
-
if (delay_ms > 0) await
|
|
2028
|
+
if (delay_ms > 0) await _chunk5OU5CTJZcjs.sleep.call(void 0, delay_ms);
|
|
2029
2029
|
}
|
|
2030
2030
|
}
|
|
2031
2031
|
}
|
|
2032
2032
|
}
|
|
2033
2033
|
|
|
2034
2034
|
// src/internal/tracing.ts
|
|
2035
|
-
var PRETTY =
|
|
2035
|
+
var PRETTY = _chunk5OU5CTJZcjs.config.call(void 0, ).env !== "production";
|
|
2036
2036
|
var C_BLUE = "\x1B[38;5;39m";
|
|
2037
2037
|
var C_ORANGE = "\x1B[38;5;208m";
|
|
2038
2038
|
var C_GREEN = "\x1B[38;5;42m";
|
|
@@ -2216,7 +2216,7 @@ function budget_exhausted(lease, options, store_failing) {
|
|
|
2216
2216
|
if (store_failing || !_optionalChain([options, 'optionalAccess', _110 => _110.blockOnError]) || lease.retry <= options.maxRetries)
|
|
2217
2217
|
return void 0;
|
|
2218
2218
|
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.`;
|
|
2219
|
-
|
|
2219
|
+
_chunk5OU5CTJZcjs.log.call(void 0, ).error(error);
|
|
2220
2220
|
return { lease, handled: 0, acked_at: lease.at, error, block: true };
|
|
2221
2221
|
}
|
|
2222
2222
|
function fetch_failure_policy(registry) {
|
|
@@ -2232,13 +2232,13 @@ function fetch_failure_policy(registry) {
|
|
|
2232
2232
|
function finalize(lease, handled, at, error, options, logger, failed_at) {
|
|
2233
2233
|
if (!error) return { lease, handled, acked_at: at };
|
|
2234
2234
|
logger.error(error);
|
|
2235
|
-
const non_retryable = error instanceof
|
|
2235
|
+
const non_retryable = error instanceof _chunkJ6G7UKZAcjs.NonRetryableError;
|
|
2236
2236
|
const block2 = options.blockOnError && (non_retryable || lease.retry >= options.maxRetries);
|
|
2237
2237
|
if (block2)
|
|
2238
2238
|
logger.error(
|
|
2239
2239
|
non_retryable ? `Blocking ${lease.stream} on non-retryable error.` : `Blocking ${lease.stream} after ${lease.retry} retries.`
|
|
2240
2240
|
);
|
|
2241
|
-
const next_attempt_at = block2 ? void 0 : Date.now() + compute_backoff_delay(lease.retry, _nullishCoalesce(options.backoff, () => (
|
|
2241
|
+
const next_attempt_at = block2 ? void 0 : Date.now() + compute_backoff_delay(lease.retry, _nullishCoalesce(options.backoff, () => ( _chunk5OU5CTJZcjs.DEFAULT_BACKOFF)));
|
|
2242
2242
|
return {
|
|
2243
2243
|
lease,
|
|
2244
2244
|
handled,
|
|
@@ -2366,7 +2366,7 @@ async function run_drain_cycle(deps, cycle) {
|
|
|
2366
2366
|
const acked = submitted.length ? await ops.ack(submitted) : [];
|
|
2367
2367
|
const expected = submitted.filter((l) => l.due === void 0).length;
|
|
2368
2368
|
if (acked.length < expected)
|
|
2369
|
-
|
|
2369
|
+
_chunk5OU5CTJZcjs.log.call(void 0, ).warn(
|
|
2370
2370
|
`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.`
|
|
2371
2371
|
);
|
|
2372
2372
|
const closeable = handled.filter((h) => h.close !== void 0).map((h) => h.close);
|
|
@@ -2462,9 +2462,9 @@ var DrainController = (_class5 = class {
|
|
|
2462
2462
|
if (!this.armed || this._stopped || this._inflight)
|
|
2463
2463
|
return EMPTY_DRAIN;
|
|
2464
2464
|
const d = _nullishCoalesce(this._deps.defaults, () => ( {}));
|
|
2465
|
-
const streamLimit = _nullishCoalesce(_nullishCoalesce(d.streamLimit, () => ( options.streamLimit)), () => (
|
|
2466
|
-
const eventLimit = _nullishCoalesce(options.eventLimit, () => (
|
|
2467
|
-
const leaseMillis = _nullishCoalesce(_nullishCoalesce(d.leaseMillis, () => ( options.leaseMillis)), () => (
|
|
2465
|
+
const streamLimit = _nullishCoalesce(_nullishCoalesce(d.streamLimit, () => ( options.streamLimit)), () => ( _chunk5OU5CTJZcjs.DEFAULT_STREAM_LIMIT));
|
|
2466
|
+
const eventLimit = _nullishCoalesce(options.eventLimit, () => ( _chunk5OU5CTJZcjs.DEFAULT_EVENT_LIMIT));
|
|
2467
|
+
const leaseMillis = _nullishCoalesce(_nullishCoalesce(d.leaseMillis, () => ( options.leaseMillis)), () => ( _chunk5OU5CTJZcjs.DEFAULT_LEASE_MILLIS));
|
|
2468
2468
|
if (this._deps.breaker.state(Date.now()) === "open")
|
|
2469
2469
|
return EMPTY_DRAIN;
|
|
2470
2470
|
const pass = this._pass(streamLimit, eventLimit, leaseMillis).finally(
|
|
@@ -2539,7 +2539,7 @@ function pii_gate(event, fields, predicate, actor) {
|
|
|
2539
2539
|
const { pii, ...rest } = event;
|
|
2540
2540
|
if (pii == null) {
|
|
2541
2541
|
const shredded = { ...data };
|
|
2542
|
-
for (const f of fields) shredded[f] =
|
|
2542
|
+
for (const f of fields) shredded[f] = _chunkJ6G7UKZAcjs.SHREDDED;
|
|
2543
2543
|
return { ...rest, data: shredded };
|
|
2544
2544
|
}
|
|
2545
2545
|
const allowed = !!actor && !!predicate && predicate(event, actor);
|
|
@@ -2550,7 +2550,7 @@ function pii_gate(event, fields, predicate, actor) {
|
|
|
2550
2550
|
};
|
|
2551
2551
|
}
|
|
2552
2552
|
const redacted = { ...data };
|
|
2553
|
-
for (const f of fields) redacted[f] =
|
|
2553
|
+
for (const f of fields) redacted[f] = _chunkJ6G7UKZAcjs.REDACTED;
|
|
2554
2554
|
return { ...rest, data: redacted };
|
|
2555
2555
|
}
|
|
2556
2556
|
var IDENTITY_GATE = (event) => event;
|
|
@@ -2687,7 +2687,7 @@ function make_deferred(handler, schedule) {
|
|
|
2687
2687
|
const call = handler;
|
|
2688
2688
|
const deferred = async (event, stream, app) => {
|
|
2689
2689
|
const when = typeof schedule === "function" ? schedule(event) : schedule;
|
|
2690
|
-
if (Date.now() < resolve_defer_at(when, event)) throw new (0,
|
|
2690
|
+
if (Date.now() < resolve_defer_at(when, event)) throw new (0, _chunkJ6G7UKZAcjs.DeferSignal)(when);
|
|
2691
2691
|
return call(event, stream, app);
|
|
2692
2692
|
};
|
|
2693
2693
|
Object.defineProperty(deferred, "name", { value: handler.name });
|
|
@@ -2756,7 +2756,7 @@ function build_handle(deps) {
|
|
|
2756
2756
|
handled++;
|
|
2757
2757
|
}
|
|
2758
2758
|
} catch (error) {
|
|
2759
|
-
if (error instanceof
|
|
2759
|
+
if (error instanceof _chunkJ6G7UKZAcjs.DeferSignal) {
|
|
2760
2760
|
let defer;
|
|
2761
2761
|
try {
|
|
2762
2762
|
defer = resolve_defer_at(error.when, event);
|
|
@@ -3028,7 +3028,7 @@ var Act = (_class7 = class {
|
|
|
3028
3028
|
// Lanes to arm per event; `"all"` when a dynamic resolver hides the lane.
|
|
3029
3029
|
|
|
3030
3030
|
|
|
3031
|
-
__init27() {this._logger =
|
|
3031
|
+
__init27() {this._logger = _chunk5OU5CTJZcjs.log.call(void 0, )}
|
|
3032
3032
|
// This Act's ports: its own bag, or the singleton adapters.
|
|
3033
3033
|
|
|
3034
3034
|
// Runs a body so internal `store()`/`cache()` calls resolve to `_ports`.
|
|
@@ -3050,9 +3050,9 @@ var Act = (_class7 = class {
|
|
|
3050
3050
|
this._lanes = lanes;
|
|
3051
3051
|
this._declared_lanes = ["default", ...lanes.map((l) => l.name)];
|
|
3052
3052
|
validate_only_lanes(options.onlyLanes, this._declared_lanes);
|
|
3053
|
-
this._ports = _nullishCoalesce(options.scoped, () => (
|
|
3053
|
+
this._ports = _nullishCoalesce(options.scoped, () => ( _chunk5OU5CTJZcjs.default_scope.call(void 0, )));
|
|
3054
3054
|
const ports = this._ports;
|
|
3055
|
-
this._scoped =
|
|
3055
|
+
this._scoped = _chunk5OU5CTJZcjs.make_run_scoped.call(void 0, {
|
|
3056
3056
|
// Getters, not a spread: the singletons resolve lazily, so a later
|
|
3057
3057
|
// `store(...)` / `cache(...)` still takes effect.
|
|
3058
3058
|
get store() {
|
|
@@ -3062,14 +3062,14 @@ var Act = (_class7 = class {
|
|
|
3062
3062
|
return ports.cache;
|
|
3063
3063
|
},
|
|
3064
3064
|
// Parsed per build, so a bad window throws on every build.
|
|
3065
|
-
autoclose_window:
|
|
3065
|
+
autoclose_window: _chunk5OU5CTJZcjs.resolveAutocloseConfig.call(void 0, options).autocloseWindow
|
|
3066
3066
|
});
|
|
3067
3067
|
this._correlator = _nullishCoalesce(options.correlator, () => ( default_correlator));
|
|
3068
3068
|
this._es = build_es(this._logger, this._correlator, patch_fn);
|
|
3069
3069
|
this._cd = build_drain(this._logger);
|
|
3070
3070
|
const handle = build_handle({
|
|
3071
3071
|
logger: this._logger,
|
|
3072
|
-
reaction_scope:
|
|
3072
|
+
reaction_scope: _chunk5OU5CTJZcjs.make_reaction_scope.call(void 0, {
|
|
3073
3073
|
do: this.do.bind(this),
|
|
3074
3074
|
load: this.load.bind(this),
|
|
3075
3075
|
query: this.query.bind(this),
|
|
@@ -3099,12 +3099,12 @@ var Act = (_class7 = class {
|
|
|
3099
3099
|
this._ports.store,
|
|
3100
3100
|
options.listen !== false
|
|
3101
3101
|
);
|
|
3102
|
-
|
|
3102
|
+
_chunk5OU5CTJZcjs.register_weak_disposer.call(void 0, new WeakRef(this), (self) => self.shutdown());
|
|
3103
3103
|
}
|
|
3104
3104
|
// Shared by drain, settle and autoclose; bad knobs throw at build.
|
|
3105
3105
|
_build_breaker(options) {
|
|
3106
3106
|
return new CircuitBreaker(
|
|
3107
|
-
|
|
3107
|
+
_chunk5OU5CTJZcjs.resolveCircuitBreakerConfig.call(void 0, options.circuitBreaker),
|
|
3108
3108
|
{
|
|
3109
3109
|
on_error: (error, circuit) => this._emit_error(error, circuit),
|
|
3110
3110
|
// When the cooldown elapses, settle once: its scan or claim is the
|
|
@@ -3138,7 +3138,7 @@ var Act = (_class7 = class {
|
|
|
3138
3138
|
try {
|
|
3139
3139
|
await this._run_close(targets);
|
|
3140
3140
|
} catch (error) {
|
|
3141
|
-
if (error instanceof
|
|
3141
|
+
if (error instanceof _chunkJ6G7UKZAcjs.StoreError) throw error;
|
|
3142
3142
|
this._logger.error(
|
|
3143
3143
|
error,
|
|
3144
3144
|
`Reaction-requested close of ${targets.map((t) => `"${t.stream}"`).join(", ")} failed and was not retried; close it with app.close(...) once the cause is fixed.`
|
|
@@ -3172,7 +3172,7 @@ var Act = (_class7 = class {
|
|
|
3172
3172
|
// Audit deps, built after the controllers so the lane set is final.
|
|
3173
3173
|
_build_audit_deps() {
|
|
3174
3174
|
return {
|
|
3175
|
-
store:
|
|
3175
|
+
store: _chunk5OU5CTJZcjs.store,
|
|
3176
3176
|
event_to_state: this._event_to_state,
|
|
3177
3177
|
// Declared lanes, not this process's controllers: a lane another
|
|
3178
3178
|
// worker drains is not `unknown-lane`.
|
|
@@ -3185,7 +3185,7 @@ var Act = (_class7 = class {
|
|
|
3185
3185
|
registry: this.registry,
|
|
3186
3186
|
static_targets: classification.static_targets,
|
|
3187
3187
|
cd: this._cd,
|
|
3188
|
-
max_subscribed_streams: _nullishCoalesce(options.maxSubscribedStreams, () => (
|
|
3188
|
+
max_subscribed_streams: _nullishCoalesce(options.maxSubscribedStreams, () => ( _chunkJ6G7UKZAcjs.DEFAULT_MAX_SUBSCRIBED_STREAMS)),
|
|
3189
3189
|
// Declared lanes (not active ones): a lane another process claims is
|
|
3190
3190
|
// still a valid destination.
|
|
3191
3191
|
declared_lanes: new Set(this._declared_lanes),
|
|
@@ -3201,7 +3201,7 @@ var Act = (_class7 = class {
|
|
|
3201
3201
|
// Cold start: an idle deferred stream still fires on time after a restart.
|
|
3202
3202
|
async _seed_persisted_defers() {
|
|
3203
3203
|
const now = Date.now();
|
|
3204
|
-
await walk_streams(
|
|
3204
|
+
await walk_streams(_chunk5OU5CTJZcjs.store.call(void 0, ), (pos) => {
|
|
3205
3205
|
if (pos.deferred_at === void 0 || pos.deferred_at <= now) return;
|
|
3206
3206
|
const controller = this._drain_controllers.get(_nullishCoalesce(pos.lane, () => ( "default")));
|
|
3207
3207
|
_optionalChain([controller, 'optionalAccess', _132 => _132.seed_defer, 'call', _133 => _133(pos.stream, pos.deferred_at)]);
|
|
@@ -3217,7 +3217,7 @@ var Act = (_class7 = class {
|
|
|
3217
3217
|
on_settled: (drain) => this.emit("settled", drain),
|
|
3218
3218
|
breaker: this._breaker
|
|
3219
3219
|
},
|
|
3220
|
-
_nullishCoalesce(options.settleDebounceMs, () => (
|
|
3220
|
+
_nullishCoalesce(options.settleDebounceMs, () => ( _chunkJ6G7UKZAcjs.DEFAULT_SETTLE_DEBOUNCE_MS))
|
|
3221
3221
|
);
|
|
3222
3222
|
}
|
|
3223
3223
|
|
|
@@ -3237,7 +3237,7 @@ var Act = (_class7 = class {
|
|
|
3237
3237
|
*/
|
|
3238
3238
|
shutdown(options) {
|
|
3239
3239
|
if (!this._shutdown_promise) {
|
|
3240
|
-
|
|
3240
|
+
_chunk5OU5CTJZcjs.resolveShutdownConfig.call(void 0, options);
|
|
3241
3241
|
this._shutdown_promise = (async () => {
|
|
3242
3242
|
this.stop_correlations();
|
|
3243
3243
|
this._settle.stop(true);
|
|
@@ -3255,10 +3255,10 @@ var Act = (_class7 = class {
|
|
|
3255
3255
|
// The largest `leaseMillis` among lanes with a cycle in flight (the
|
|
3256
3256
|
// default for none or 0, and for a running settle), capped.
|
|
3257
3257
|
_derive_grace_ms(running, settling) {
|
|
3258
|
-
let max = settling ?
|
|
3258
|
+
let max = settling ? _chunk5OU5CTJZcjs.DEFAULT_LEASE_MILLIS : 0;
|
|
3259
3259
|
for (const c of running)
|
|
3260
|
-
max = Math.max(max, c.lease_millis ||
|
|
3261
|
-
return Math.min(max,
|
|
3260
|
+
max = Math.max(max, c.lease_millis || _chunk5OU5CTJZcjs.DEFAULT_LEASE_MILLIS);
|
|
3261
|
+
return Math.min(max, _chunk5OU5CTJZcjs.MAX_SHUTDOWN_GRACE_MS);
|
|
3262
3262
|
}
|
|
3263
3263
|
async _await_inflight(grace_ms) {
|
|
3264
3264
|
const running = [...this._drain_controllers.values()].filter(
|
|
@@ -3341,7 +3341,7 @@ var Act = (_class7 = class {
|
|
|
3341
3341
|
* @see {@link ValidationError}, {@link PreconditionError}, {@link ConcurrencyError}
|
|
3342
3342
|
*/
|
|
3343
3343
|
async do(action2, target, payload, options) {
|
|
3344
|
-
const reacting_to = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _135 => _135.reactingTo]), () => (
|
|
3344
|
+
const reacting_to = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _135 => _135.reactingTo]), () => ( _chunk5OU5CTJZcjs.current_reacting.call(void 0, )));
|
|
3345
3345
|
const do_options = reacting_to === _optionalChain([options, 'optionalAccess', _136 => _136.reactingTo]) ? options : { ...options, reactingTo: reacting_to };
|
|
3346
3346
|
return this._scoped(async () => {
|
|
3347
3347
|
const snapshots = await this._es.action(
|
|
@@ -3407,7 +3407,7 @@ var Act = (_class7 = class {
|
|
|
3407
3407
|
return this._scoped(async () => {
|
|
3408
3408
|
let first;
|
|
3409
3409
|
let last;
|
|
3410
|
-
const count = await
|
|
3410
|
+
const count = await _chunk5OU5CTJZcjs.store.call(void 0, ).query((e) => {
|
|
3411
3411
|
const gated = this.registry.query_gate(e.name)(e);
|
|
3412
3412
|
if (!first) first = gated;
|
|
3413
3413
|
last = gated;
|
|
@@ -3437,7 +3437,7 @@ var Act = (_class7 = class {
|
|
|
3437
3437
|
async query_array(query) {
|
|
3438
3438
|
return this._scoped(async () => {
|
|
3439
3439
|
const events = [];
|
|
3440
|
-
await
|
|
3440
|
+
await _chunk5OU5CTJZcjs.store.call(void 0, ).query((e) => {
|
|
3441
3441
|
events.push(this.registry.query_gate(e.name)(e));
|
|
3442
3442
|
}, query);
|
|
3443
3443
|
return events;
|
|
@@ -3457,14 +3457,14 @@ var Act = (_class7 = class {
|
|
|
3457
3457
|
*/
|
|
3458
3458
|
async forget(stream) {
|
|
3459
3459
|
return this._scoped(async () => {
|
|
3460
|
-
const s =
|
|
3460
|
+
const s = _chunk5OU5CTJZcjs.store.call(void 0, );
|
|
3461
3461
|
if (!s.forget_pii) {
|
|
3462
3462
|
throw new Error(
|
|
3463
3463
|
`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).`
|
|
3464
3464
|
);
|
|
3465
3465
|
}
|
|
3466
3466
|
const eventCount = await s.forget_pii(stream);
|
|
3467
|
-
await
|
|
3467
|
+
await _chunk5OU5CTJZcjs.cache.call(void 0, ).invalidate(stream);
|
|
3468
3468
|
if (eventCount > 0) {
|
|
3469
3469
|
this.emit("forgotten", { stream, at: /* @__PURE__ */ new Date(), eventCount });
|
|
3470
3470
|
}
|
|
@@ -3498,7 +3498,7 @@ var Act = (_class7 = class {
|
|
|
3498
3498
|
* @see {@link correlate} for dynamic stream discovery
|
|
3499
3499
|
*/
|
|
3500
3500
|
async drain(options = {}) {
|
|
3501
|
-
|
|
3501
|
+
_chunk5OU5CTJZcjs.resolveDrainConfig.call(void 0, options);
|
|
3502
3502
|
if (!this._drain)
|
|
3503
3503
|
return { fetched: [], leased: [], acked: [], blocked: [] };
|
|
3504
3504
|
return this._scoped(() => this._drain_all(options));
|
|
@@ -3678,7 +3678,7 @@ var Act = (_class7 = class {
|
|
|
3678
3678
|
*/
|
|
3679
3679
|
async reset(input) {
|
|
3680
3680
|
return this._scoped(async () => {
|
|
3681
|
-
const count = await
|
|
3681
|
+
const count = await _chunk5OU5CTJZcjs.store.call(void 0, ).reset(input);
|
|
3682
3682
|
for (const handler of this._batch_handlers.values())
|
|
3683
3683
|
_optionalChain([handler, 'access', _143 => _143[FOLD_RESET], 'optionalCall', _144 => _144()]);
|
|
3684
3684
|
if (count > 0) {
|
|
@@ -3714,7 +3714,7 @@ var Act = (_class7 = class {
|
|
|
3714
3714
|
*/
|
|
3715
3715
|
async unblock(input) {
|
|
3716
3716
|
return this._scoped(async () => {
|
|
3717
|
-
const count = await
|
|
3717
|
+
const count = await _chunk5OU5CTJZcjs.store.call(void 0, ).unblock(input);
|
|
3718
3718
|
if (count > 0) {
|
|
3719
3719
|
this._wake();
|
|
3720
3720
|
}
|
|
@@ -3769,7 +3769,7 @@ var Act = (_class7 = class {
|
|
|
3769
3769
|
return { ...partial, duration_ms: Date.now() - started };
|
|
3770
3770
|
}
|
|
3771
3771
|
const target = _nullishCoalesce(sink, () => ( (() => {
|
|
3772
|
-
const s =
|
|
3772
|
+
const s = _chunk5OU5CTJZcjs.store.call(void 0, );
|
|
3773
3773
|
if (!s.restore) throw new Error("adapter has no restore capability");
|
|
3774
3774
|
return s;
|
|
3775
3775
|
})()));
|
|
@@ -3815,7 +3815,7 @@ var Act = (_class7 = class {
|
|
|
3815
3815
|
async blocked_streams(options) {
|
|
3816
3816
|
return this._scoped(async () => {
|
|
3817
3817
|
const positions = [];
|
|
3818
|
-
await
|
|
3818
|
+
await _chunk5OU5CTJZcjs.store.call(void 0, ).query_streams(
|
|
3819
3819
|
(p) => {
|
|
3820
3820
|
positions.push(p);
|
|
3821
3821
|
},
|
|
@@ -3867,7 +3867,7 @@ var Act = (_class7 = class {
|
|
|
3867
3867
|
* @see {@link Store.prioritize} for the underlying primitive
|
|
3868
3868
|
*/
|
|
3869
3869
|
async prioritize(filter, priority) {
|
|
3870
|
-
return this._scoped(() =>
|
|
3870
|
+
return this._scoped(() => _chunk5OU5CTJZcjs.store.call(void 0, ).prioritize(filter, priority));
|
|
3871
3871
|
}
|
|
3872
3872
|
// Shared by `close()` and reaction-requested closes.
|
|
3873
3873
|
async _run_close(targets) {
|
|
@@ -3947,7 +3947,7 @@ var Act = (_class7 = class {
|
|
|
3947
3947
|
* @see {@link correlate} for manual correlation
|
|
3948
3948
|
*/
|
|
3949
3949
|
settle(options) {
|
|
3950
|
-
|
|
3950
|
+
_chunk5OU5CTJZcjs.resolveSettleConfig.call(void 0, _nullishCoalesce(options, () => ( {})));
|
|
3951
3951
|
this._schedule(options);
|
|
3952
3952
|
}
|
|
3953
3953
|
}, _class7);
|
|
@@ -4103,16 +4103,16 @@ function synthesize_autoclose_reactions(registry, states, read_window) {
|
|
|
4103
4103
|
}),
|
|
4104
4104
|
// Never block on autoclose: a transient query/store error should retry,
|
|
4105
4105
|
// not quarantine the synthetic stream.
|
|
4106
|
-
options: { blockOnError: false, maxRetries:
|
|
4106
|
+
options: { blockOnError: false, maxRetries: _chunk5OU5CTJZcjs.DEFAULT_MAX_RETRIES },
|
|
4107
4107
|
handler: async (event) => {
|
|
4108
4108
|
const aggregate = event.stream;
|
|
4109
4109
|
const window = read_window();
|
|
4110
4110
|
if (!in_autoclose_window(window, /* @__PURE__ */ new Date()))
|
|
4111
|
-
throw new (0,
|
|
4112
|
-
const stats = await
|
|
4111
|
+
throw new (0, _chunkJ6G7UKZAcjs.DeferSignal)({ at: next_window_open(window, /* @__PURE__ */ new Date()) });
|
|
4112
|
+
const stats = await _chunk5OU5CTJZcjs.store.call(void 0, ).query_stats([aggregate], {
|
|
4113
4113
|
count: true,
|
|
4114
4114
|
tail: keep_days !== void 0 ? true : void 0,
|
|
4115
|
-
exclude: [
|
|
4115
|
+
exclude: [_chunkJ6G7UKZAcjs.TOMBSTONE_EVENT, _chunkJ6G7UKZAcjs.SNAP_EVENT]
|
|
4116
4116
|
});
|
|
4117
4117
|
const entry = stats.get(aggregate);
|
|
4118
4118
|
if (!entry) return;
|
|
@@ -4143,7 +4143,7 @@ function synthesize_autoclose_reactions(registry, states, read_window) {
|
|
|
4143
4143
|
dues.push(days_after(entry.tail.created, keep_days));
|
|
4144
4144
|
const future = dues.map((d) => d.getTime()).filter((t) => t > Date.now());
|
|
4145
4145
|
if (future.length)
|
|
4146
|
-
throw new (0,
|
|
4146
|
+
throw new (0, _chunkJ6G7UKZAcjs.DeferSignal)({ at: new Date(Math.min(...future)) });
|
|
4147
4147
|
}
|
|
4148
4148
|
};
|
|
4149
4149
|
const key = `__autoclose_${st.name}`;
|
|
@@ -4348,9 +4348,9 @@ var _this_ = ({ stream }) => ({
|
|
|
4348
4348
|
|
|
4349
4349
|
// src/builders/builder-utils.ts
|
|
4350
4350
|
function register_lane(config2, lanes) {
|
|
4351
|
-
|
|
4352
|
-
if (config2.name ===
|
|
4353
|
-
throw new Error(`Lane "${
|
|
4351
|
+
_chunk5OU5CTJZcjs.resolveLaneConfig.call(void 0, config2);
|
|
4352
|
+
if (config2.name === _chunkJ6G7UKZAcjs.DEFAULT_LANE)
|
|
4353
|
+
throw new Error(`Lane "${_chunkJ6G7UKZAcjs.DEFAULT_LANE}" is reserved`);
|
|
4354
4354
|
const existing = lanes.find((l) => l.name === config2.name);
|
|
4355
4355
|
if (!existing) return void lanes.push(config2);
|
|
4356
4356
|
if (existing.leaseMillis !== config2.leaseMillis || existing.streamLimit !== config2.streamLimit || existing.cycleMs !== config2.cycleMs)
|
|
@@ -4392,9 +4392,9 @@ function reaction_on(event, events, builder) {
|
|
|
4392
4392
|
// Validate the whole bag at the declaration site so a bad
|
|
4393
4393
|
// `maxRetries`/`backoff`/`blockOnError` throws ZodError at build,
|
|
4394
4394
|
// not a NaN gate on the first retry.
|
|
4395
|
-
options:
|
|
4396
|
-
blockOnError: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _159 => _159.blockOnError]), () => (
|
|
4397
|
-
maxRetries: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _160 => _160.maxRetries]), () => (
|
|
4395
|
+
options: _chunk5OU5CTJZcjs.resolveReactionConfig.call(void 0, {
|
|
4396
|
+
blockOnError: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _159 => _159.blockOnError]), () => ( _chunk5OU5CTJZcjs.DEFAULT_BLOCK_ON_ERROR)),
|
|
4397
|
+
maxRetries: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _160 => _160.maxRetries]), () => ( _chunk5OU5CTJZcjs.DEFAULT_MAX_RETRIES)),
|
|
4398
4398
|
backoff: _optionalChain([options, 'optionalAccess', _161 => _161.backoff])
|
|
4399
4399
|
})
|
|
4400
4400
|
};
|
|
@@ -4479,7 +4479,7 @@ function date_reviver_schema(schema) {
|
|
|
4479
4479
|
|
|
4480
4480
|
// src/builders/event-builder.ts
|
|
4481
4481
|
function event_tags(schema) {
|
|
4482
|
-
const pii =
|
|
4482
|
+
const pii = _chunkJ6G7UKZAcjs.pii_schemas.call(void 0, schema);
|
|
4483
4483
|
const pii_dates = {};
|
|
4484
4484
|
for (const [key, field] of Object.entries(pii)) {
|
|
4485
4485
|
const dates = date_reviver_schema(field);
|
|
@@ -4516,7 +4516,7 @@ function make_event_reader(tags, disclosure, predicate = null) {
|
|
|
4516
4516
|
});
|
|
4517
4517
|
}
|
|
4518
4518
|
function build_events(registry, states, lanes, owners) {
|
|
4519
|
-
const declared = /* @__PURE__ */ new Set([
|
|
4519
|
+
const declared = /* @__PURE__ */ new Set([_chunkJ6G7UKZAcjs.DEFAULT_LANE, ...lanes.map((l) => l.name)]);
|
|
4520
4520
|
const lane_errors = [];
|
|
4521
4521
|
const tags = /* @__PURE__ */ new Map();
|
|
4522
4522
|
const sensitive2 = /* @__PURE__ */ new Map();
|
|
@@ -4580,7 +4580,7 @@ function build_events(registry, states, lanes, owners) {
|
|
|
4580
4580
|
if (reader) readers.set(event_name, reader);
|
|
4581
4581
|
}
|
|
4582
4582
|
const snap2 = make_event_reader(event_tags(state2.state), "redact", null);
|
|
4583
|
-
if (snap2) readers.set(
|
|
4583
|
+
if (snap2) readers.set(_chunkJ6G7UKZAcjs.SNAP_EVENT, snap2);
|
|
4584
4584
|
if (readers.size === 0) continue;
|
|
4585
4585
|
state2.view = (event, actor) => (_nullishCoalesce(readers.get(event.name), () => ( IDENTITY_GATE)))(event, actor);
|
|
4586
4586
|
}
|
|
@@ -4645,7 +4645,7 @@ function act() {
|
|
|
4645
4645
|
const shape = _nullishCoalesce(state2.state.shape, () => ( {}));
|
|
4646
4646
|
for (const [event, schema] of Object.entries(state2.events))
|
|
4647
4647
|
for (const [field, field_schema] of Object.entries(
|
|
4648
|
-
|
|
4648
|
+
_chunkJ6G7UKZAcjs.pii_schemas.call(void 0, schema)
|
|
4649
4649
|
)) {
|
|
4650
4650
|
if (!reads_as_string(field_schema)) fields.add(`${event}.${field}`);
|
|
4651
4651
|
if (shape[field] && !reads_as_string(shape[field]))
|
|
@@ -4653,7 +4653,7 @@ function act() {
|
|
|
4653
4653
|
}
|
|
4654
4654
|
}
|
|
4655
4655
|
if (fields.size > 0)
|
|
4656
|
-
|
|
4656
|
+
_chunk5OU5CTJZcjs.log.call(void 0, ).warn(
|
|
4657
4657
|
`Act has ${fields.size} sensitive field(s) whose type isn't a string: ${[...fields].join(", ")}. A caller who may not see one reads "[REDACTED]" or "[SHREDDED]" there instead, which its type doesn't allow. Declare sensitive fields as strings. See docs/docs/guides/sensitive-data.md.`
|
|
4658
4658
|
);
|
|
4659
4659
|
};
|
|
@@ -4713,7 +4713,7 @@ function act() {
|
|
|
4713
4713
|
const list = deprecation_summary.map(
|
|
4714
4714
|
(d) => `"${d.deprecated}" (current: "${d.current}", state: "${d.state_name}")`
|
|
4715
4715
|
).join(", ");
|
|
4716
|
-
|
|
4716
|
+
_chunk5OU5CTJZcjs.log.call(void 0, ).info(
|
|
4717
4717
|
`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.`
|
|
4718
4718
|
);
|
|
4719
4719
|
}
|
|
@@ -4755,7 +4755,7 @@ function act() {
|
|
|
4755
4755
|
return reaction_on(event, registry.events, builder);
|
|
4756
4756
|
},
|
|
4757
4757
|
build: (options) => {
|
|
4758
|
-
|
|
4758
|
+
_chunk5OU5CTJZcjs.resolveActConfig.call(void 0, options);
|
|
4759
4759
|
if (!_built) {
|
|
4760
4760
|
for (const proj of pending_projections) add_projection(proj);
|
|
4761
4761
|
for (const proj of fold_projections) {
|
|
@@ -4807,7 +4807,7 @@ function act() {
|
|
|
4807
4807
|
synthesize_autoclose_reactions(
|
|
4808
4808
|
registry,
|
|
4809
4809
|
states,
|
|
4810
|
-
|
|
4810
|
+
_chunk5OU5CTJZcjs.current_autoclose_window
|
|
4811
4811
|
);
|
|
4812
4812
|
Object.freeze(registry.actions);
|
|
4813
4813
|
Object.freeze(registry.events);
|
|
@@ -4861,8 +4861,8 @@ function _projection(target) {
|
|
|
4861
4861
|
handler,
|
|
4862
4862
|
resolver: _nullishCoalesce(default_resolver, () => ( _this_)),
|
|
4863
4863
|
options: {
|
|
4864
|
-
blockOnError:
|
|
4865
|
-
maxRetries:
|
|
4864
|
+
blockOnError: _chunk5OU5CTJZcjs.DEFAULT_BLOCK_ON_ERROR,
|
|
4865
|
+
maxRetries: _chunk5OU5CTJZcjs.DEFAULT_MAX_RETRIES
|
|
4866
4866
|
}
|
|
4867
4867
|
}),
|
|
4868
4868
|
widened
|
|
@@ -4903,7 +4903,7 @@ function _projection(target) {
|
|
|
4903
4903
|
throw new Error(
|
|
4904
4904
|
`Projection "${target}" .of() partials must share one state name \u2014 got "${name}" and "${partial.name}"`
|
|
4905
4905
|
);
|
|
4906
|
-
const config2 =
|
|
4906
|
+
const config2 = _chunk5OU5CTJZcjs.resolveFoldConfig.call(void 0, options);
|
|
4907
4907
|
const fold_events = {};
|
|
4908
4908
|
for (const partial of partials)
|
|
4909
4909
|
for (const [event_name, schema] of Object.entries(partial.events)) {
|
|
@@ -4921,8 +4921,8 @@ function _projection(target) {
|
|
|
4921
4921
|
handler: noop,
|
|
4922
4922
|
resolver: { target },
|
|
4923
4923
|
options: {
|
|
4924
|
-
blockOnError:
|
|
4925
|
-
maxRetries:
|
|
4924
|
+
blockOnError: _chunk5OU5CTJZcjs.DEFAULT_BLOCK_ON_ERROR,
|
|
4925
|
+
maxRetries: _chunk5OU5CTJZcjs.DEFAULT_MAX_RETRIES
|
|
4926
4926
|
}
|
|
4927
4927
|
}
|
|
4928
4928
|
]
|
|
@@ -5038,7 +5038,7 @@ function action_builder(state2) {
|
|
|
5038
5038
|
throw new Error(`Duplicate action "${action2}"`);
|
|
5039
5039
|
internal.actions[action2] = schema;
|
|
5040
5040
|
if (options) {
|
|
5041
|
-
|
|
5041
|
+
_chunk5OU5CTJZcjs.resolveActionConfig.call(void 0, options);
|
|
5042
5042
|
internal.options ??= {};
|
|
5043
5043
|
internal.options[action2] = options;
|
|
5044
5044
|
}
|
|
@@ -5331,5 +5331,5 @@ function write_line(writer, line) {
|
|
|
5331
5331
|
|
|
5332
5332
|
|
|
5333
5333
|
|
|
5334
|
-
exports.Act = Act; exports.ActorSchema =
|
|
5334
|
+
exports.Act = Act; exports.ActorSchema = _chunkJ6G7UKZAcjs.ActorSchema; exports.CausationEventSchema = _chunkJ6G7UKZAcjs.CausationEventSchema; exports.CommittedMetaSchema = _chunkJ6G7UKZAcjs.CommittedMetaSchema; exports.ConcurrencyError = _chunkJ6G7UKZAcjs.ConcurrencyError; exports.ConsoleLogger = _chunk5OU5CTJZcjs.ConsoleLogger; exports.CsvFile = CsvFile; exports.DEFAULT_LANE = _chunkJ6G7UKZAcjs.DEFAULT_LANE; exports.DEFAULT_MAX_SUBSCRIBED_STREAMS = _chunkJ6G7UKZAcjs.DEFAULT_MAX_SUBSCRIBED_STREAMS; exports.DEFAULT_SETTLE_DEBOUNCE_MS = _chunkJ6G7UKZAcjs.DEFAULT_SETTLE_DEBOUNCE_MS; exports.DeferSignal = _chunkJ6G7UKZAcjs.DeferSignal; exports.Environments = _chunkJ6G7UKZAcjs.Environments; exports.Errors = _chunkJ6G7UKZAcjs.Errors; exports.EventMetaSchema = _chunkJ6G7UKZAcjs.EventMetaSchema; exports.ExitCodes = _chunkJ6G7UKZAcjs.ExitCodes; exports.InMemoryCache = _chunk5OU5CTJZcjs.InMemoryCache; exports.InMemoryStore = _chunk5OU5CTJZcjs.InMemoryStore; exports.InvariantError = _chunkJ6G7UKZAcjs.InvariantError; exports.LogLevels = _chunkJ6G7UKZAcjs.LogLevels; exports.NonRetryableError = _chunkJ6G7UKZAcjs.NonRetryableError; exports.PackageSchema = _chunk5OU5CTJZcjs.PackageSchema; exports.PreconditionError = _chunkJ6G7UKZAcjs.PreconditionError; exports.QuerySchema = _chunkJ6G7UKZAcjs.QuerySchema; exports.REDACTED = _chunkJ6G7UKZAcjs.REDACTED; exports.SHREDDED = _chunkJ6G7UKZAcjs.SHREDDED; exports.SNAP_EVENT = _chunkJ6G7UKZAcjs.SNAP_EVENT; exports.StoreError = _chunkJ6G7UKZAcjs.StoreError; exports.StreamClosedError = _chunkJ6G7UKZAcjs.StreamClosedError; exports.TOMBSTONE_EVENT = _chunkJ6G7UKZAcjs.TOMBSTONE_EVENT; exports.TargetSchema = _chunkJ6G7UKZAcjs.TargetSchema; exports.ValidationError = _chunkJ6G7UKZAcjs.ValidationError; exports.ZodEmpty = _chunkJ6G7UKZAcjs.ZodEmpty; exports.act = act; exports.cache = _chunk5OU5CTJZcjs.cache; exports.config = _chunk5OU5CTJZcjs.config; exports.dateReviver = _chunk5OU5CTJZcjs.dateReviver; exports.default_scope = _chunk5OU5CTJZcjs.default_scope; exports.dispose = _chunk5OU5CTJZcjs.dispose; exports.disposeAndExit = _chunk5OU5CTJZcjs.disposeAndExit; exports.extend = _chunk5OU5CTJZcjs.extend; exports.is_literal_source = _chunk5OU5CTJZcjs.is_literal_source; exports.log = _chunk5OU5CTJZcjs.log; exports.pii_fields = _chunkJ6G7UKZAcjs.pii_fields; exports.port = _chunk5OU5CTJZcjs.port; exports.projection = projection; exports.resolveAutocloseConfig = _chunk5OU5CTJZcjs.resolveAutocloseConfig2; exports.sensitive = _chunkJ6G7UKZAcjs.sensitive; exports.sleep = _chunk5OU5CTJZcjs.sleep; exports.slice = slice; exports.state = state; exports.store = _chunk5OU5CTJZcjs.store; exports.validate = _chunk5OU5CTJZcjs.validate;
|
|
5335
5335
|
//# sourceMappingURL=index.cjs.map
|