@rotorsoft/act 2.1.0 → 2.1.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/README.md +1 -1
- package/dist/.tsbuildinfo +1 -1
- package/dist/@types/act.d.ts +2 -1
- package/dist/@types/act.d.ts.map +1 -1
- package/dist/@types/builders/builder-utils.d.ts.map +1 -1
- package/dist/@types/internal/config.d.ts +8 -0
- 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/event-sourcing.d.ts.map +1 -1
- package/dist/@types/types/action.d.ts +2 -2
- package/dist/@types/types/ports.d.ts +3 -3
- package/dist/@types/types/reaction.d.ts +2 -1
- package/dist/@types/types/reaction.d.ts.map +1 -1
- package/dist/adapter.cjs +3 -3
- package/dist/adapter.js +2 -2
- package/dist/{chunk-2377SSHX.cjs → chunk-7VYSJIXD.cjs} +1 -1
- package/dist/chunk-7VYSJIXD.cjs.map +1 -0
- package/dist/{chunk-VOVHDDET.cjs → chunk-LN3OP4OL.cjs} +27 -18
- package/dist/chunk-LN3OP4OL.cjs.map +1 -0
- package/dist/{chunk-HACJYR7Z.cjs → chunk-PZQXTGWF.cjs} +4 -4
- package/dist/{chunk-HACJYR7Z.cjs.map → chunk-PZQXTGWF.cjs.map} +1 -1
- package/dist/{chunk-KXC4ILVY.js → chunk-QPVUARKL.js} +12 -3
- package/dist/{chunk-KXC4ILVY.js.map → chunk-QPVUARKL.js.map} +1 -1
- package/dist/{chunk-SRZIVZIA.js → chunk-UXDNSZAD.js} +2 -2
- package/dist/{chunk-GWFLHWZV.js → chunk-W3PHEA5Q.js} +1 -1
- package/dist/chunk-W3PHEA5Q.js.map +1 -0
- package/dist/index.cjs +288 -262
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +44 -18
- 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-2377SSHX.cjs.map +0 -1
- package/dist/chunk-GWFLHWZV.js.map +0 -1
- package/dist/chunk-VOVHDDET.cjs.map +0 -1
- /package/dist/{chunk-SRZIVZIA.js.map → chunk-UXDNSZAD.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -37,18 +37,18 @@
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
var _chunkVOVHDDETcjs = require('./chunk-VOVHDDET.cjs');
|
|
41
40
|
|
|
42
41
|
|
|
42
|
+
var _chunkLN3OP4OLcjs = require('./chunk-LN3OP4OL.cjs');
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
var _chunkHACJYR7Zcjs = require('./chunk-HACJYR7Z.cjs');
|
|
50
49
|
|
|
51
50
|
|
|
51
|
+
var _chunkPZQXTGWFcjs = require('./chunk-PZQXTGWF.cjs');
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
|
|
@@ -81,24 +81,26 @@ var _chunkHACJYR7Zcjs = require('./chunk-HACJYR7Z.cjs');
|
|
|
81
81
|
|
|
82
82
|
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
var _chunk7VYSJIXDcjs = require('./chunk-7VYSJIXD.cjs');
|
|
85
87
|
|
|
86
88
|
// src/signals.ts
|
|
87
89
|
process.once("SIGINT", async (arg) => {
|
|
88
|
-
|
|
89
|
-
await
|
|
90
|
+
_chunkLN3OP4OLcjs.log.call(void 0, ).info(arg, "SIGINT");
|
|
91
|
+
await _chunkLN3OP4OLcjs.disposeAndExit.call(void 0, "EXIT");
|
|
90
92
|
});
|
|
91
93
|
process.once("SIGTERM", async (arg) => {
|
|
92
|
-
|
|
93
|
-
await
|
|
94
|
+
_chunkLN3OP4OLcjs.log.call(void 0, ).info(arg, "SIGTERM");
|
|
95
|
+
await _chunkLN3OP4OLcjs.disposeAndExit.call(void 0, "EXIT");
|
|
94
96
|
});
|
|
95
97
|
process.once("uncaughtException", async (arg) => {
|
|
96
|
-
|
|
97
|
-
await
|
|
98
|
+
_chunkLN3OP4OLcjs.log.call(void 0, ).error(arg, "Uncaught Exception");
|
|
99
|
+
await _chunkLN3OP4OLcjs.disposeAndExit.call(void 0, "ERROR");
|
|
98
100
|
});
|
|
99
101
|
process.once("unhandledRejection", async (arg) => {
|
|
100
|
-
|
|
101
|
-
await
|
|
102
|
+
_chunkLN3OP4OLcjs.log.call(void 0, ).error(arg, "Unhandled Rejection");
|
|
103
|
+
await _chunkLN3OP4OLcjs.disposeAndExit.call(void 0, "ERROR");
|
|
102
104
|
});
|
|
103
105
|
|
|
104
106
|
// src/act.ts
|
|
@@ -206,7 +208,7 @@ async function* audit(deps, categories, options = {}) {
|
|
|
206
208
|
if (need_stats) {
|
|
207
209
|
const stats = await deps.store().query_stats(
|
|
208
210
|
{},
|
|
209
|
-
{ count: true, names: true, exclude: [
|
|
211
|
+
{ count: true, names: true, exclude: [_chunk7VYSJIXDcjs.SNAP_EVENT] }
|
|
210
212
|
);
|
|
211
213
|
for (const [stream, s] of stats) {
|
|
212
214
|
for (const p of passes) _optionalChain([p, 'access', _4 => _4.on_stat, 'optionalCall', _5 => _5(stream, s)]);
|
|
@@ -288,7 +290,7 @@ var make_schema_pass = (deps) => {
|
|
|
288
290
|
return;
|
|
289
291
|
}
|
|
290
292
|
const schema = state2.events[name];
|
|
291
|
-
const sensitive2 =
|
|
293
|
+
const sensitive2 = _chunk7VYSJIXDcjs.sensitiveFields.call(void 0, schema);
|
|
292
294
|
let parse_schema = schema;
|
|
293
295
|
if (sensitive2.length > 0) {
|
|
294
296
|
const omitter = schema.omit;
|
|
@@ -422,7 +424,7 @@ var make_restart_candidate_pass = (deps, options) => {
|
|
|
422
424
|
{
|
|
423
425
|
stream,
|
|
424
426
|
stream_exact: true,
|
|
425
|
-
names: [
|
|
427
|
+
names: [_chunk7VYSJIXDcjs.SNAP_EVENT],
|
|
426
428
|
with_snaps: true,
|
|
427
429
|
// From the start: on its own, `with_snaps` resumes at the latest.
|
|
428
430
|
after: -1
|
|
@@ -582,7 +584,7 @@ var make_correlation_gaps_pass = () => {
|
|
|
582
584
|
seen_ids.add(e.id);
|
|
583
585
|
const causation = _optionalChain([e, 'access', _31 => _31.meta, 'optionalAccess', _32 => _32.causation]);
|
|
584
586
|
const parent_id = _optionalChain([causation, 'optionalAccess', _33 => _33.event, 'optionalAccess', _34 => _34.id]);
|
|
585
|
-
if (parent_id !== void 0 && e.name !==
|
|
587
|
+
if (parent_id !== void 0 && e.name !== _chunk7VYSJIXDcjs.TOMBSTONE_EVENT) {
|
|
586
588
|
checks.push({ stream: e.stream, id: e.id, parent_id });
|
|
587
589
|
}
|
|
588
590
|
},
|
|
@@ -965,7 +967,7 @@ function make_deferred(handler, schedule) {
|
|
|
965
967
|
const call = handler;
|
|
966
968
|
const deferred = async (event, stream, app) => {
|
|
967
969
|
const when = typeof schedule === "function" ? schedule(event) : schedule;
|
|
968
|
-
if (Date.now() < resolve_defer_at(when, event)) throw new (0,
|
|
970
|
+
if (Date.now() < resolve_defer_at(when, event)) throw new (0, _chunk7VYSJIXDcjs.DeferSignal)(when);
|
|
969
971
|
return call(event, stream, app);
|
|
970
972
|
};
|
|
971
973
|
Object.defineProperty(deferred, "name", { value: handler.name });
|
|
@@ -1097,7 +1099,7 @@ function compute_lag_lead_ratio(handled, lagging, leading) {
|
|
|
1097
1099
|
function report_once(seen, key, message) {
|
|
1098
1100
|
if (seen.has(key)) return;
|
|
1099
1101
|
seen.add(key);
|
|
1100
|
-
|
|
1102
|
+
_chunkLN3OP4OLcjs.log.call(void 0, ).error(new Error(message));
|
|
1101
1103
|
}
|
|
1102
1104
|
|
|
1103
1105
|
// src/internal/correlation-id.ts
|
|
@@ -1125,14 +1127,14 @@ function close_correlation(correlator, actor) {
|
|
|
1125
1127
|
}
|
|
1126
1128
|
|
|
1127
1129
|
// src/internal/drain-ops.ts
|
|
1128
|
-
var claim = (lagging, leading, by, millis, lane) =>
|
|
1130
|
+
var claim = (lagging, leading, by, millis, lane) => _chunkLN3OP4OLcjs.store.call(void 0, ).claim(lagging, leading, by, millis, lane);
|
|
1129
1131
|
async function fetch(leased, eventLimit) {
|
|
1130
1132
|
return Promise.all(
|
|
1131
1133
|
leased.map(async ({ stream, source, at, lagging }) => {
|
|
1132
1134
|
const events = [];
|
|
1133
|
-
const stream_exact = source !== void 0 &&
|
|
1135
|
+
const stream_exact = source !== void 0 && _chunkPZQXTGWFcjs.isStreamName.call(void 0, source, stream) ? true : void 0;
|
|
1134
1136
|
try {
|
|
1135
|
-
await
|
|
1137
|
+
await _chunkLN3OP4OLcjs.store.call(void 0, ).query((e) => events.push(e), {
|
|
1136
1138
|
stream: source,
|
|
1137
1139
|
stream_exact,
|
|
1138
1140
|
after: at,
|
|
@@ -1152,9 +1154,9 @@ async function fetch(leased, eventLimit) {
|
|
|
1152
1154
|
})
|
|
1153
1155
|
);
|
|
1154
1156
|
}
|
|
1155
|
-
var ack = (leases) =>
|
|
1156
|
-
var block = (leases) =>
|
|
1157
|
-
var subscribe = (streams, correlated_at, correlator) =>
|
|
1157
|
+
var ack = (leases) => _chunkLN3OP4OLcjs.store.call(void 0, ).ack(leases);
|
|
1158
|
+
var block = (leases) => _chunkLN3OP4OLcjs.store.call(void 0, ).block(leases);
|
|
1159
|
+
var subscribe = (streams, correlated_at, correlator) => _chunkLN3OP4OLcjs.store.call(void 0, ).subscribe(streams, correlated_at, correlator);
|
|
1158
1160
|
|
|
1159
1161
|
// src/internal/event-sourcing.ts
|
|
1160
1162
|
var _actpatch = require('@rotorsoft/act-patch');
|
|
@@ -1169,29 +1171,29 @@ var check_invariants = (target, state2, schema, pii_aware) => {
|
|
|
1169
1171
|
try {
|
|
1170
1172
|
result = schema.safeParse(state2);
|
|
1171
1173
|
} catch (error) {
|
|
1172
|
-
throw new (0,
|
|
1174
|
+
throw new (0, _chunk7VYSJIXDcjs.ValidationError)(target, state2, error);
|
|
1173
1175
|
}
|
|
1174
1176
|
if (result.success) return;
|
|
1175
1177
|
const issues = pii_aware ? result.error.issues.filter((issue) => {
|
|
1176
1178
|
const value = value_at(state2, issue.path);
|
|
1177
|
-
return value !==
|
|
1179
|
+
return value !== _chunk7VYSJIXDcjs.REDACTED && value !== _chunk7VYSJIXDcjs.SHREDDED;
|
|
1178
1180
|
}) : result.error.issues;
|
|
1179
1181
|
if (issues.length)
|
|
1180
|
-
throw new (0,
|
|
1182
|
+
throw new (0, _chunk7VYSJIXDcjs.ValidationError)(
|
|
1181
1183
|
target,
|
|
1182
1184
|
state2,
|
|
1183
1185
|
_zod.prettifyError.call(void 0, new (0, _zod.ZodError)(issues))
|
|
1184
1186
|
);
|
|
1185
1187
|
};
|
|
1186
1188
|
var DEFAULT_BATCH = 500;
|
|
1187
|
-
var cache_put = (stream, entry) =>
|
|
1188
|
-
(err) =>
|
|
1189
|
+
var cache_put = (stream, entry) => _chunkLN3OP4OLcjs.cache.call(void 0, ).set(stream, entry).catch(
|
|
1190
|
+
(err) => _chunkLN3OP4OLcjs.log.call(void 0, ).warn(
|
|
1189
1191
|
err,
|
|
1190
1192
|
"cache set skipped; the next load re-folds from the store"
|
|
1191
1193
|
)
|
|
1192
1194
|
);
|
|
1193
|
-
var cache_drop = (stream) =>
|
|
1194
|
-
(err) =>
|
|
1195
|
+
var cache_drop = (stream) => _chunkLN3OP4OLcjs.cache.call(void 0, ).invalidate(stream).catch(
|
|
1196
|
+
(err) => _chunkLN3OP4OLcjs.log.call(void 0, ).warn(
|
|
1195
1197
|
err,
|
|
1196
1198
|
"cache invalidate skipped; a stale checkpoint re-folds from its event_id"
|
|
1197
1199
|
)
|
|
@@ -1199,11 +1201,11 @@ var cache_drop = (stream) => _chunkVOVHDDETcjs.cache.call(void 0, ).invalidate(s
|
|
|
1199
1201
|
async function snap(snapshot) {
|
|
1200
1202
|
const { id, stream, name, meta, version } = snapshot.event;
|
|
1201
1203
|
try {
|
|
1202
|
-
const [committed] = await
|
|
1204
|
+
const [committed] = await _chunkLN3OP4OLcjs.store.call(void 0, ).commit(
|
|
1203
1205
|
[
|
|
1204
1206
|
{
|
|
1205
1207
|
stream,
|
|
1206
|
-
msgs: [{ name:
|
|
1208
|
+
msgs: [{ name: _chunk7VYSJIXDcjs.SNAP_EVENT, data: snapshot.state }],
|
|
1207
1209
|
// IMPORTANT! - state events are committed right after the snapshot event
|
|
1208
1210
|
expectedVersion: version
|
|
1209
1211
|
}
|
|
@@ -1216,18 +1218,18 @@ async function snap(snapshot) {
|
|
|
1216
1218
|
return committed;
|
|
1217
1219
|
} catch (error) {
|
|
1218
1220
|
const reason = error instanceof Error ? error.message : String(error);
|
|
1219
|
-
|
|
1221
|
+
_chunkLN3OP4OLcjs.log.call(void 0, ).warn(
|
|
1220
1222
|
`Snapshot write failed on stream "${stream}": ${reason} \u2014 cold starts will replay full history until snapshots succeed.`
|
|
1221
1223
|
);
|
|
1222
1224
|
}
|
|
1223
1225
|
}
|
|
1224
1226
|
async function tombstone(stream, expectedVersion, correlation) {
|
|
1225
1227
|
try {
|
|
1226
|
-
const [committed] = await
|
|
1228
|
+
const [committed] = await _chunkLN3OP4OLcjs.store.call(void 0, ).commit(
|
|
1227
1229
|
[
|
|
1228
1230
|
{
|
|
1229
1231
|
stream,
|
|
1230
|
-
msgs: [{ name:
|
|
1232
|
+
msgs: [{ name: _chunk7VYSJIXDcjs.TOMBSTONE_EVENT, data: {} }],
|
|
1231
1233
|
expectedVersion
|
|
1232
1234
|
}
|
|
1233
1235
|
],
|
|
@@ -1235,7 +1237,7 @@ async function tombstone(stream, expectedVersion, correlation) {
|
|
|
1235
1237
|
);
|
|
1236
1238
|
return committed;
|
|
1237
1239
|
} catch (error) {
|
|
1238
|
-
if (error instanceof
|
|
1240
|
+
if (error instanceof _chunk7VYSJIXDcjs.ConcurrencyError) return void 0;
|
|
1239
1241
|
throw error;
|
|
1240
1242
|
}
|
|
1241
1243
|
}
|
|
@@ -1265,9 +1267,9 @@ async function scan(source, opts = {}, callback) {
|
|
|
1265
1267
|
if (drop_closed_streams) {
|
|
1266
1268
|
await source.query(
|
|
1267
1269
|
(e) => {
|
|
1268
|
-
if (e.name ===
|
|
1270
|
+
if (e.name === _chunk7VYSJIXDcjs.TOMBSTONE_EVENT) closed_streams.add(e.stream);
|
|
1269
1271
|
},
|
|
1270
|
-
{ names: [
|
|
1272
|
+
{ names: [_chunk7VYSJIXDcjs.TOMBSTONE_EVENT] }
|
|
1271
1273
|
);
|
|
1272
1274
|
}
|
|
1273
1275
|
let max_id;
|
|
@@ -1289,11 +1291,11 @@ async function scan(source, opts = {}, callback) {
|
|
|
1289
1291
|
if (!is_valid(event))
|
|
1290
1292
|
throw new Error(`Invalid event at index ${processed}`);
|
|
1291
1293
|
if (on_progress) on_progress({ processed, id: event.id, max_id });
|
|
1292
|
-
if (drop_snapshots && event.name ===
|
|
1294
|
+
if (drop_snapshots && event.name === _chunk7VYSJIXDcjs.SNAP_EVENT) {
|
|
1293
1295
|
dropped_snaps++;
|
|
1294
1296
|
return;
|
|
1295
1297
|
}
|
|
1296
|
-
if (closed_streams.has(event.stream) && event.name !==
|
|
1298
|
+
if (closed_streams.has(event.stream) && event.name !== _chunk7VYSJIXDcjs.TOMBSTONE_EVENT) {
|
|
1297
1299
|
dropped_closed++;
|
|
1298
1300
|
return;
|
|
1299
1301
|
}
|
|
@@ -1320,24 +1322,29 @@ async function scan(source, opts = {}, callback) {
|
|
|
1320
1322
|
return;
|
|
1321
1323
|
}
|
|
1322
1324
|
let remapped = migrated;
|
|
1323
|
-
const
|
|
1324
|
-
if (
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
...migrated,
|
|
1329
|
-
|
|
1330
|
-
...migrated.meta,
|
|
1331
|
-
|
|
1332
|
-
...
|
|
1325
|
+
const { action: action2, event: cause } = migrated.meta.causation;
|
|
1326
|
+
if (cause || stream_rename && action2) {
|
|
1327
|
+
remapped = {
|
|
1328
|
+
...migrated,
|
|
1329
|
+
meta: {
|
|
1330
|
+
...migrated.meta,
|
|
1331
|
+
causation: {
|
|
1332
|
+
...migrated.meta.causation,
|
|
1333
|
+
...action2 && stream_rename && {
|
|
1334
|
+
action: { ...action2, stream: stream_rename(action2.stream) }
|
|
1335
|
+
},
|
|
1336
|
+
...cause && {
|
|
1333
1337
|
event: {
|
|
1334
|
-
...
|
|
1335
|
-
id
|
|
1338
|
+
...cause,
|
|
1339
|
+
// A cause missing from the source has no id in the new
|
|
1340
|
+
// log; its old id would name another event there.
|
|
1341
|
+
id: _nullishCoalesce(id_map.get(cause.id), () => ( -1)),
|
|
1342
|
+
stream: stream_rename ? stream_rename(cause.stream) : cause.stream
|
|
1336
1343
|
}
|
|
1337
1344
|
}
|
|
1338
1345
|
}
|
|
1339
|
-
}
|
|
1340
|
-
}
|
|
1346
|
+
}
|
|
1347
|
+
};
|
|
1341
1348
|
}
|
|
1342
1349
|
const new_id = await callback(remapped);
|
|
1343
1350
|
id_map.set(event.id, new_id);
|
|
@@ -1361,18 +1368,18 @@ async function load(me, target, callback, patch_fn = bare_patch) {
|
|
|
1361
1368
|
const { stream, actor, asOf } = target;
|
|
1362
1369
|
const time_travel = !!asOf && Object.values(asOf).some((v) => v !== void 0);
|
|
1363
1370
|
const seeded = time_travel && asOf.limit === void 0 && !asOf.created_after;
|
|
1364
|
-
const cached = time_travel ? void 0 : await
|
|
1371
|
+
const cached = time_travel ? void 0 : await _chunkLN3OP4OLcjs.cache.call(void 0, ).get(stream);
|
|
1365
1372
|
const cache_hit = !!cached;
|
|
1366
|
-
let state2 = _nullishCoalesce(_optionalChain([cached, 'optionalAccess',
|
|
1367
|
-
let patches = _nullishCoalesce(_optionalChain([cached, 'optionalAccess',
|
|
1368
|
-
let snaps = _nullishCoalesce(_optionalChain([cached, 'optionalAccess',
|
|
1373
|
+
let state2 = _nullishCoalesce(_optionalChain([cached, 'optionalAccess', _52 => _52.state]), () => ( (me.init ? me.init() : {})));
|
|
1374
|
+
let patches = _nullishCoalesce(_optionalChain([cached, 'optionalAccess', _53 => _53.patches]), () => ( 0));
|
|
1375
|
+
let snaps = _nullishCoalesce(_optionalChain([cached, 'optionalAccess', _54 => _54.snaps]), () => ( 0));
|
|
1369
1376
|
let replayed = 0;
|
|
1370
1377
|
let event;
|
|
1371
|
-
await
|
|
1378
|
+
await _chunkLN3OP4OLcjs.store.call(void 0, ).query(
|
|
1372
1379
|
(raw) => {
|
|
1373
|
-
if (seeded && raw.name ===
|
|
1380
|
+
if (seeded && raw.name === _chunk7VYSJIXDcjs.SNAP_EVENT && replayed > 0) return;
|
|
1374
1381
|
event = me.view(raw, actor);
|
|
1375
|
-
if (event.name ===
|
|
1382
|
+
if (event.name === _chunk7VYSJIXDcjs.SNAP_EVENT) {
|
|
1376
1383
|
state2 = event.data;
|
|
1377
1384
|
snaps++;
|
|
1378
1385
|
patches = 0;
|
|
@@ -1381,12 +1388,12 @@ async function load(me, target, callback, patch_fn = bare_patch) {
|
|
|
1381
1388
|
state2 = patch_fn(me, state2, me.patch[event.name](event, state2), event);
|
|
1382
1389
|
patches++;
|
|
1383
1390
|
replayed++;
|
|
1384
|
-
} else if (event.name !==
|
|
1385
|
-
|
|
1391
|
+
} else if (event.name !== _chunk7VYSJIXDcjs.TOMBSTONE_EVENT) {
|
|
1392
|
+
_chunkLN3OP4OLcjs.log.call(void 0, ).warn(
|
|
1386
1393
|
`Skipping unknown event "${String(event.name)}" on stream "${stream}" (id=${event.id}) \u2014 no reducer in state "${me.name}"`
|
|
1387
1394
|
);
|
|
1388
1395
|
}
|
|
1389
|
-
_optionalChain([callback, 'optionalCall',
|
|
1396
|
+
_optionalChain([callback, 'optionalCall', _55 => _55({
|
|
1390
1397
|
event,
|
|
1391
1398
|
state: state2,
|
|
1392
1399
|
version: event.version,
|
|
@@ -1410,7 +1417,7 @@ async function load(me, target, callback, patch_fn = bare_patch) {
|
|
|
1410
1417
|
) : time_travel ? asOf : { with_snaps: true }
|
|
1411
1418
|
}
|
|
1412
1419
|
);
|
|
1413
|
-
const head_is_tombstone = _optionalChain([event, 'optionalAccess',
|
|
1420
|
+
const head_is_tombstone = _optionalChain([event, 'optionalAccess', _56 => _56.name]) === _chunk7VYSJIXDcjs.TOMBSTONE_EVENT;
|
|
1414
1421
|
if (replayed > 0 && !time_travel && event && !me.pii_aware && !head_is_tombstone) {
|
|
1415
1422
|
await cache_put(stream, {
|
|
1416
1423
|
stream,
|
|
@@ -1424,9 +1431,9 @@ async function load(me, target, callback, patch_fn = bare_patch) {
|
|
|
1424
1431
|
return {
|
|
1425
1432
|
event,
|
|
1426
1433
|
state: state2,
|
|
1427
|
-
version: _nullishCoalesce(_nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
1434
|
+
version: _nullishCoalesce(_nullishCoalesce(_optionalChain([event, 'optionalAccess', _57 => _57.version]), () => ( _optionalChain([cached, 'optionalAccess', _58 => _58.version]))), () => ( -1)),
|
|
1428
1435
|
// Captured with `state`, so consumers never race a separate cache lookup.
|
|
1429
|
-
id: _nullishCoalesce(_nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
1436
|
+
id: _nullishCoalesce(_nullishCoalesce(_optionalChain([event, 'optionalAccess', _59 => _59.id]), () => ( _optionalChain([cached, 'optionalAccess', _60 => _60.event_id]))), () => ( -1)),
|
|
1430
1437
|
patches,
|
|
1431
1438
|
snaps,
|
|
1432
1439
|
cache_hit,
|
|
@@ -1453,8 +1460,8 @@ async function load_others(loads, payload, own, actor, patch_fn, refuse) {
|
|
|
1453
1460
|
void 0,
|
|
1454
1461
|
patch_fn
|
|
1455
1462
|
);
|
|
1456
|
-
if (_optionalChain([snapshot, 'access',
|
|
1457
|
-
throw new (0,
|
|
1463
|
+
if (_optionalChain([snapshot, 'access', _61 => _61.event, 'optionalAccess', _62 => _62.name]) === _chunk7VYSJIXDcjs.TOMBSTONE_EVENT)
|
|
1464
|
+
throw new (0, _chunk7VYSJIXDcjs.StreamClosedError)(stream);
|
|
1458
1465
|
return {
|
|
1459
1466
|
state: l.state,
|
|
1460
1467
|
stream,
|
|
@@ -1468,12 +1475,12 @@ async function load_others(loads, payload, own, actor, patch_fn, refuse) {
|
|
|
1468
1475
|
async function action(me, action2, target, payload, options, patch_fn = bare_patch) {
|
|
1469
1476
|
const { stream, expectedVersion, actor } = target;
|
|
1470
1477
|
if (!stream) throw new Error("Missing target stream");
|
|
1471
|
-
const reactingTo = _optionalChain([options, 'optionalAccess',
|
|
1472
|
-
const correlator = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1473
|
-
const validated =
|
|
1474
|
-
const opts = _optionalChain([me, 'access',
|
|
1475
|
-
const max_retries = _nullishCoalesce(_optionalChain([opts, 'optionalAccess',
|
|
1476
|
-
const loads = _nullishCoalesce(_optionalChain([me, 'access',
|
|
1478
|
+
const reactingTo = _optionalChain([options, 'optionalAccess', _63 => _63.reactingTo]);
|
|
1479
|
+
const correlator = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _64 => _64.correlator]), () => ( default_correlator));
|
|
1480
|
+
const validated = _chunkLN3OP4OLcjs.validate.call(void 0, action2, payload, me.actions[action2]);
|
|
1481
|
+
const opts = _optionalChain([me, 'access', _65 => _65.options, 'optionalAccess', _66 => _66[action2]]);
|
|
1482
|
+
const max_retries = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _67 => _67.maxRetries]), () => ( 0));
|
|
1483
|
+
const loads = _nullishCoalesce(_optionalChain([me, 'access', _68 => _68.loads, 'optionalAccess', _69 => _69[action2]]), () => ( []));
|
|
1477
1484
|
for (let attempt = 0; ; attempt++) {
|
|
1478
1485
|
try {
|
|
1479
1486
|
const snapshot = await load(
|
|
@@ -1482,8 +1489,8 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
|
|
|
1482
1489
|
void 0,
|
|
1483
1490
|
patch_fn
|
|
1484
1491
|
);
|
|
1485
|
-
if (_optionalChain([snapshot, 'access',
|
|
1486
|
-
throw new (0,
|
|
1492
|
+
if (_optionalChain([snapshot, 'access', _70 => _70.event, 'optionalAccess', _71 => _71.name]) === _chunk7VYSJIXDcjs.TOMBSTONE_EVENT)
|
|
1493
|
+
throw new (0, _chunk7VYSJIXDcjs.StreamClosedError)(stream);
|
|
1487
1494
|
const own = {
|
|
1488
1495
|
state: me,
|
|
1489
1496
|
stream,
|
|
@@ -1497,7 +1504,7 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
|
|
|
1497
1504
|
{ stream, state: snapshot.state },
|
|
1498
1505
|
target.actor,
|
|
1499
1506
|
patch_fn,
|
|
1500
|
-
(description) => new (0,
|
|
1507
|
+
(description) => new (0, _chunk7VYSJIXDcjs.PreconditionError)(
|
|
1501
1508
|
action2,
|
|
1502
1509
|
validated,
|
|
1503
1510
|
target,
|
|
@@ -1506,11 +1513,11 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
|
|
|
1506
1513
|
)
|
|
1507
1514
|
) : [];
|
|
1508
1515
|
const loaded = Object.fromEntries(
|
|
1509
|
-
others.map((p, i) => [loads[i].name, _optionalChain([p, 'optionalAccess',
|
|
1516
|
+
others.map((p, i) => [loads[i].name, _optionalChain([p, 'optionalAccess', _72 => _72.snapshot, 'access', _73 => _73.state])])
|
|
1510
1517
|
);
|
|
1511
|
-
for (const { holds, description } of _nullishCoalesce(_optionalChain([me, 'access',
|
|
1518
|
+
for (const { holds, description } of _nullishCoalesce(_optionalChain([me, 'access', _74 => _74.requires, 'optionalAccess', _75 => _75[action2]]), () => ( [])))
|
|
1512
1519
|
if (!holds(validated, snapshot.state, actor, loaded))
|
|
1513
|
-
throw new (0,
|
|
1520
|
+
throw new (0, _chunk7VYSJIXDcjs.PreconditionError)(
|
|
1514
1521
|
action2,
|
|
1515
1522
|
validated,
|
|
1516
1523
|
target,
|
|
@@ -1532,7 +1539,7 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
|
|
|
1532
1539
|
);
|
|
1533
1540
|
to.events.push({
|
|
1534
1541
|
name: event,
|
|
1535
|
-
data:
|
|
1542
|
+
data: _chunkLN3OP4OLcjs.validate.call(void 0, event, data, to.state.events[event])
|
|
1536
1543
|
});
|
|
1537
1544
|
}
|
|
1538
1545
|
if (!own.events.length)
|
|
@@ -1540,10 +1547,10 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
|
|
|
1540
1547
|
`Action "${action2}" appends only to the streams it loads; it must append an event to its own stream too`
|
|
1541
1548
|
);
|
|
1542
1549
|
const appends = [own, ...others].filter(
|
|
1543
|
-
(p) => !!_optionalChain([p, 'optionalAccess',
|
|
1550
|
+
(p) => !!_optionalChain([p, 'optionalAccess', _76 => _76.events, 'access', _77 => _77.length])
|
|
1544
1551
|
);
|
|
1545
1552
|
const meta = {
|
|
1546
|
-
correlation: _optionalChain([reactingTo, 'optionalAccess',
|
|
1553
|
+
correlation: _optionalChain([reactingTo, 'optionalAccess', _78 => _78.meta, 'access', _79 => _79.correlation]) || correlator({
|
|
1547
1554
|
action: action2,
|
|
1548
1555
|
state: me.name,
|
|
1549
1556
|
stream,
|
|
@@ -1589,7 +1596,7 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
|
|
|
1589
1596
|
});
|
|
1590
1597
|
let committed;
|
|
1591
1598
|
try {
|
|
1592
|
-
committed = await
|
|
1599
|
+
committed = await _chunkLN3OP4OLcjs.store.call(void 0, ).commit(
|
|
1593
1600
|
appends.map((p) => ({
|
|
1594
1601
|
stream: p.stream,
|
|
1595
1602
|
msgs: p.events.map((e) => p.state.message(e)),
|
|
@@ -1598,7 +1605,7 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
|
|
|
1598
1605
|
meta
|
|
1599
1606
|
);
|
|
1600
1607
|
} catch (error) {
|
|
1601
|
-
if (error instanceof
|
|
1608
|
+
if (error instanceof _chunk7VYSJIXDcjs.ConcurrencyError) void cache_drop(error.stream);
|
|
1602
1609
|
throw error;
|
|
1603
1610
|
}
|
|
1604
1611
|
let row = 0;
|
|
@@ -1621,13 +1628,13 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
|
|
|
1621
1628
|
};
|
|
1622
1629
|
});
|
|
1623
1630
|
const last = appended.at(-1);
|
|
1624
|
-
const snap_event = _optionalChain([owner, 'access',
|
|
1631
|
+
const snap_event = _optionalChain([owner, 'access', _80 => _80.snap, 'optionalCall', _81 => _81(last)]) ? await snap(last) : void 0;
|
|
1625
1632
|
if (!owner.pii_aware)
|
|
1626
1633
|
void cache_put(append.stream, {
|
|
1627
1634
|
stream: append.stream,
|
|
1628
1635
|
state: last.state,
|
|
1629
|
-
version: _nullishCoalesce(_optionalChain([snap_event, 'optionalAccess',
|
|
1630
|
-
event_id: _nullishCoalesce(_optionalChain([snap_event, 'optionalAccess',
|
|
1636
|
+
version: _nullishCoalesce(_optionalChain([snap_event, 'optionalAccess', _82 => _82.version]), () => ( last.event.version)),
|
|
1637
|
+
event_id: _nullishCoalesce(_optionalChain([snap_event, 'optionalAccess', _83 => _83.id]), () => ( last.event.id)),
|
|
1631
1638
|
patches: snap_event ? 0 : last.patches,
|
|
1632
1639
|
snaps: snap_event ? last.snaps + 1 : last.snaps
|
|
1633
1640
|
});
|
|
@@ -1640,19 +1647,19 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
|
|
|
1640
1647
|
}
|
|
1641
1648
|
return snapshots;
|
|
1642
1649
|
} catch (error) {
|
|
1643
|
-
if (!(error instanceof
|
|
1650
|
+
if (!(error instanceof _chunk7VYSJIXDcjs.ConcurrencyError)) throw error;
|
|
1644
1651
|
if (expectedVersion !== void 0 && error.stream === stream) throw error;
|
|
1645
1652
|
if (attempt >= max_retries) throw error;
|
|
1646
|
-
if (_optionalChain([opts, 'optionalAccess',
|
|
1653
|
+
if (_optionalChain([opts, 'optionalAccess', _84 => _84.backoff])) {
|
|
1647
1654
|
const delay_ms = compute_backoff_delay(attempt, opts.backoff);
|
|
1648
|
-
if (delay_ms > 0) await
|
|
1655
|
+
if (delay_ms > 0) await _chunkLN3OP4OLcjs.sleep.call(void 0, delay_ms);
|
|
1649
1656
|
}
|
|
1650
1657
|
}
|
|
1651
1658
|
}
|
|
1652
1659
|
}
|
|
1653
1660
|
|
|
1654
1661
|
// src/internal/tracing.ts
|
|
1655
|
-
var PRETTY =
|
|
1662
|
+
var PRETTY = _chunkLN3OP4OLcjs.config.call(void 0, ).env !== "production";
|
|
1656
1663
|
var C_BLUE = "\x1B[38;5;39m";
|
|
1657
1664
|
var C_ORANGE = "\x1B[38;5;208m";
|
|
1658
1665
|
var C_GREEN = "\x1B[38;5;42m";
|
|
@@ -1698,9 +1705,9 @@ var as_of_marker = (asOf) => {
|
|
|
1698
1705
|
return parts.length ? ` (as-of ${parts.join(" ")})` : " (as-of)";
|
|
1699
1706
|
};
|
|
1700
1707
|
var traced = (inner, exit, entry) => (async (...args) => {
|
|
1701
|
-
_optionalChain([entry, 'optionalCall',
|
|
1708
|
+
_optionalChain([entry, 'optionalCall', _85 => _85(...args)]);
|
|
1702
1709
|
const result = await inner(...args);
|
|
1703
|
-
_optionalChain([exit, 'optionalCall',
|
|
1710
|
+
_optionalChain([exit, 'optionalCall', _86 => _86(result, ...args)]);
|
|
1704
1711
|
return result;
|
|
1705
1712
|
});
|
|
1706
1713
|
function build_es(logger, correlator = default_correlator, patch_fn = bare_patch) {
|
|
@@ -1709,7 +1716,7 @@ function build_es(logger, correlator = default_correlator, patch_fn = bare_patch
|
|
|
1709
1716
|
action_name,
|
|
1710
1717
|
target,
|
|
1711
1718
|
payload,
|
|
1712
|
-
{ ...options, correlator: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1719
|
+
{ ...options, correlator: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _87 => _87.correlator]), () => ( correlator)) },
|
|
1713
1720
|
patch_fn
|
|
1714
1721
|
);
|
|
1715
1722
|
const bound_load = (me, target, callback) => load(me, target, callback, patch_fn);
|
|
@@ -1783,7 +1790,7 @@ function build_drain(logger) {
|
|
|
1783
1790
|
subscribe: logger.level !== "trace" ? subscribe : traced(subscribe, (result, streams) => {
|
|
1784
1791
|
if (!result.subscribed) return;
|
|
1785
1792
|
const lanes = new Set(streams.map((s) => _nullishCoalesce(s.lane, () => ( "default"))));
|
|
1786
|
-
const uniform_lane = lanes.size === 1 ? _optionalChain([streams, 'access',
|
|
1793
|
+
const uniform_lane = lanes.size === 1 ? _optionalChain([streams, 'access', _88 => _88[0], 'optionalAccess', _89 => _89.lane]) : void 0;
|
|
1787
1794
|
const data = streams.map(
|
|
1788
1795
|
({ stream, lane }) => uniform_lane || !lane || lane === "default" ? hue(C_STREAM, stream) : `${hue(C_STREAM, stream)}${dim(`[${lane}]`)}`
|
|
1789
1796
|
).join(" ");
|
|
@@ -1795,7 +1802,7 @@ function build_drain(logger) {
|
|
|
1795
1802
|
}
|
|
1796
1803
|
function trace_cycle(logger, leased, fetched, handled, acked, blocked) {
|
|
1797
1804
|
if (logger.level !== "trace" || !leased.length) return;
|
|
1798
|
-
const lane = _optionalChain([leased, 'access',
|
|
1805
|
+
const lane = _optionalChain([leased, 'access', _90 => _90[0], 'optionalAccess', _91 => _91.lane]);
|
|
1799
1806
|
const fetch_by_stream = new Map(fetched.map((f) => [f.stream, f]));
|
|
1800
1807
|
const acked_by_stream = new Map(acked.map((a) => [a.stream, a.at]));
|
|
1801
1808
|
const blocked_by_stream = new Map(blocked.map((b) => [b.stream, b.error]));
|
|
@@ -1804,8 +1811,8 @@ function trace_cycle(logger, leased, fetched, handled, acked, blocked) {
|
|
|
1804
1811
|
);
|
|
1805
1812
|
const detail = leased.map(({ stream, at, retry }) => {
|
|
1806
1813
|
const f = fetch_by_stream.get(stream);
|
|
1807
|
-
const key = _optionalChain([f, 'optionalAccess',
|
|
1808
|
-
const events = _optionalChain([f, 'optionalAccess',
|
|
1814
|
+
const key = _optionalChain([f, 'optionalAccess', _92 => _92.source]) ? `${hue(C_STREAM, stream)}${dim(`<-${f.source}`)}` : hue(C_STREAM, stream);
|
|
1815
|
+
const events = _optionalChain([f, 'optionalAccess', _93 => _93.events, 'access', _94 => _94.length]) ? ` ${dim(
|
|
1809
1816
|
`[${f.events.map(({ id, name }) => `#${id} ${String(name)}`).join(", ")}]`
|
|
1810
1817
|
)}` : "";
|
|
1811
1818
|
const acked_at = acked_by_stream.get(stream);
|
|
@@ -1833,10 +1840,10 @@ function trace_cycle(logger, leased, fetched, handled, acked, blocked) {
|
|
|
1833
1840
|
|
|
1834
1841
|
// src/internal/drain-cycle.ts
|
|
1835
1842
|
function budget_exhausted(lease, options, store_failing) {
|
|
1836
|
-
if (store_failing || !_optionalChain([options, 'optionalAccess',
|
|
1843
|
+
if (store_failing || !_optionalChain([options, 'optionalAccess', _95 => _95.blockOnError]) || lease.retry <= options.maxRetries)
|
|
1837
1844
|
return void 0;
|
|
1838
1845
|
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.`;
|
|
1839
|
-
|
|
1846
|
+
_chunkLN3OP4OLcjs.log.call(void 0, ).error(error);
|
|
1840
1847
|
return { lease, handled: 0, acked_at: lease.at, error, block: true };
|
|
1841
1848
|
}
|
|
1842
1849
|
function fetch_failure_policy(registry) {
|
|
@@ -1852,13 +1859,13 @@ function fetch_failure_policy(registry) {
|
|
|
1852
1859
|
function finalize(lease, handled, at, error, options, logger, failed_at) {
|
|
1853
1860
|
if (!error) return { lease, handled, acked_at: at };
|
|
1854
1861
|
logger.error(error);
|
|
1855
|
-
const non_retryable = error instanceof
|
|
1862
|
+
const non_retryable = error instanceof _chunk7VYSJIXDcjs.NonRetryableError;
|
|
1856
1863
|
const block2 = options.blockOnError && (non_retryable || lease.retry >= options.maxRetries);
|
|
1857
1864
|
if (block2)
|
|
1858
1865
|
logger.error(
|
|
1859
1866
|
non_retryable ? `Blocking ${lease.stream} on non-retryable error.` : `Blocking ${lease.stream} after ${lease.retry} retries.`
|
|
1860
1867
|
);
|
|
1861
|
-
const next_attempt_at = block2 ? void 0 : Date.now() + compute_backoff_delay(lease.retry, _nullishCoalesce(options.backoff, () => (
|
|
1868
|
+
const next_attempt_at = block2 ? void 0 : Date.now() + compute_backoff_delay(lease.retry, _nullishCoalesce(options.backoff, () => ( _chunkLN3OP4OLcjs.DEFAULT_BACKOFF)));
|
|
1862
1869
|
return {
|
|
1863
1870
|
lease,
|
|
1864
1871
|
handled,
|
|
@@ -1897,7 +1904,7 @@ async function run_drain_cycle(deps, cycle) {
|
|
|
1897
1904
|
const fetched = await ops.fetch(leased, eventLimit);
|
|
1898
1905
|
const fetch_map = /* @__PURE__ */ new Map();
|
|
1899
1906
|
const fetch_window_at = fetched.reduce(
|
|
1900
|
-
(max, { at, events }) => Math.max(max, _optionalChain([events, 'access',
|
|
1907
|
+
(max, { at, events }) => Math.max(max, _optionalChain([events, 'access', _96 => _96.at, 'call', _97 => _97(-1), 'optionalAccess', _98 => _98.id]) || at),
|
|
1901
1908
|
0
|
|
1902
1909
|
);
|
|
1903
1910
|
for (const f of fetched) {
|
|
@@ -1961,11 +1968,11 @@ async function run_drain_cycle(deps, cycle) {
|
|
|
1961
1968
|
deps.logger
|
|
1962
1969
|
)
|
|
1963
1970
|
);
|
|
1964
|
-
const at = _optionalChain([entry, 'access',
|
|
1971
|
+
const at = _optionalChain([entry, 'access', _99 => _99.fetch, 'access', _100 => _100.events, 'access', _101 => _101.at, 'call', _102 => _102(-1), 'optionalAccess', _103 => _103.id]) || fetch_window_at;
|
|
1965
1972
|
const { payloads } = entry;
|
|
1966
1973
|
const exhausted = budget_exhausted(
|
|
1967
1974
|
lease,
|
|
1968
|
-
_optionalChain([payloads, 'access',
|
|
1975
|
+
_optionalChain([payloads, 'access', _104 => _104[0], 'optionalAccess', _105 => _105.options]),
|
|
1969
1976
|
store_failing
|
|
1970
1977
|
);
|
|
1971
1978
|
if (exhausted) return Promise.resolve(exhausted);
|
|
@@ -1986,7 +1993,7 @@ async function run_drain_cycle(deps, cycle) {
|
|
|
1986
1993
|
const acked = submitted.length ? await ops.ack(submitted) : [];
|
|
1987
1994
|
const expected = submitted.filter((l) => l.due === void 0).length;
|
|
1988
1995
|
if (acked.length < expected)
|
|
1989
|
-
|
|
1996
|
+
_chunkLN3OP4OLcjs.log.call(void 0, ).warn(
|
|
1990
1997
|
`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.`
|
|
1991
1998
|
);
|
|
1992
1999
|
const closeable = handled.filter((h) => h.close !== void 0).map((h) => h.close);
|
|
@@ -2050,7 +2057,7 @@ var DrainController = (_class3 = class {
|
|
|
2050
2057
|
}
|
|
2051
2058
|
/** This lane's configured lease, or `undefined`; the shutdown grace basis. */
|
|
2052
2059
|
get lease_millis() {
|
|
2053
|
-
return _optionalChain([this, 'access',
|
|
2060
|
+
return _optionalChain([this, 'access', _106 => _106._deps, 'access', _107 => _107.defaults, 'optionalAccess', _108 => _108.leaseMillis]);
|
|
2054
2061
|
}
|
|
2055
2062
|
get lane() {
|
|
2056
2063
|
return this._deps.lane;
|
|
@@ -2082,9 +2089,9 @@ var DrainController = (_class3 = class {
|
|
|
2082
2089
|
if (!this.armed || this._stopped || this._inflight)
|
|
2083
2090
|
return EMPTY_DRAIN;
|
|
2084
2091
|
const d = _nullishCoalesce(this._deps.defaults, () => ( {}));
|
|
2085
|
-
const streamLimit = _nullishCoalesce(_nullishCoalesce(d.streamLimit, () => ( options.streamLimit)), () => (
|
|
2086
|
-
const eventLimit = _nullishCoalesce(options.eventLimit, () => (
|
|
2087
|
-
const leaseMillis = _nullishCoalesce(_nullishCoalesce(d.leaseMillis, () => ( options.leaseMillis)), () => (
|
|
2092
|
+
const streamLimit = _nullishCoalesce(_nullishCoalesce(d.streamLimit, () => ( options.streamLimit)), () => ( _chunkLN3OP4OLcjs.DEFAULT_STREAM_LIMIT));
|
|
2093
|
+
const eventLimit = _nullishCoalesce(options.eventLimit, () => ( _chunkLN3OP4OLcjs.DEFAULT_EVENT_LIMIT));
|
|
2094
|
+
const leaseMillis = _nullishCoalesce(_nullishCoalesce(d.leaseMillis, () => ( options.leaseMillis)), () => ( _chunkLN3OP4OLcjs.DEFAULT_LEASE_MILLIS));
|
|
2088
2095
|
if (this._deps.breaker.state(Date.now()) === "open")
|
|
2089
2096
|
return EMPTY_DRAIN;
|
|
2090
2097
|
const pass = this._pass(streamLimit, eventLimit, leaseMillis).finally(
|
|
@@ -2176,11 +2183,11 @@ var CloseSignal = class extends Error {
|
|
|
2176
2183
|
constructor(opts) {
|
|
2177
2184
|
super("reaction requested close");
|
|
2178
2185
|
this.name = "CloseSignal";
|
|
2179
|
-
this.stream = _optionalChain([opts, 'optionalAccess',
|
|
2180
|
-
this.archive = _optionalChain([opts, 'optionalAccess',
|
|
2181
|
-
this.at = _optionalChain([opts, 'optionalAccess',
|
|
2182
|
-
this.before = _optionalChain([opts, 'optionalAccess',
|
|
2183
|
-
this.defer = _optionalChain([opts, 'optionalAccess',
|
|
2186
|
+
this.stream = _optionalChain([opts, 'optionalAccess', _109 => _109.stream]);
|
|
2187
|
+
this.archive = _optionalChain([opts, 'optionalAccess', _110 => _110.archive]);
|
|
2188
|
+
this.at = _optionalChain([opts, 'optionalAccess', _111 => _111.at]);
|
|
2189
|
+
this.before = _optionalChain([opts, 'optionalAccess', _112 => _112.before]);
|
|
2190
|
+
this.defer = _optionalChain([opts, 'optionalAccess', _113 => _113.defer]);
|
|
2184
2191
|
}
|
|
2185
2192
|
};
|
|
2186
2193
|
function build_handle(deps) {
|
|
@@ -2210,7 +2217,7 @@ function build_handle(deps) {
|
|
|
2210
2217
|
handled++;
|
|
2211
2218
|
}
|
|
2212
2219
|
} catch (error) {
|
|
2213
|
-
if (error instanceof
|
|
2220
|
+
if (error instanceof _chunk7VYSJIXDcjs.DeferSignal) {
|
|
2214
2221
|
let defer;
|
|
2215
2222
|
try {
|
|
2216
2223
|
defer = resolve_defer_at(error.when, event);
|
|
@@ -2234,7 +2241,7 @@ function build_handle(deps) {
|
|
|
2234
2241
|
// Advance to the live head the handler evaluated against (when
|
|
2235
2242
|
// provided) so the close-cycle guard sees this reaction caught up.
|
|
2236
2243
|
acked_at: _nullishCoalesce(error.at, () => ( event.id)),
|
|
2237
|
-
defer: _optionalChain([error, 'access',
|
|
2244
|
+
defer: _optionalChain([error, 'access', _114 => _114.defer, 'optionalAccess', _115 => _115.getTime, 'call', _116 => _116()]),
|
|
2238
2245
|
// Close the signalled stream (the autoclose reaction's aggregate,
|
|
2239
2246
|
// which differs from its synthetic lease stream); a self-closing
|
|
2240
2247
|
// user reaction omits it and closes its own lease stream. A
|
|
@@ -2307,22 +2314,22 @@ function synthesize_autoclose_reactions(registry, states, read_window) {
|
|
|
2307
2314
|
// An anchored stream name would read as a pattern, and a store may refuse
|
|
2308
2315
|
// it at subscribe, stopping every reaction. Such a stream has no
|
|
2309
2316
|
// autoclose: `app.close` still closes it.
|
|
2310
|
-
resolver: (e) =>
|
|
2317
|
+
resolver: (e) => _chunkPZQXTGWFcjs.isStreamName.call(void 0, e.stream) ? {
|
|
2311
2318
|
target: `${AUTOCLOSE_TARGET_PREFIX}${e.stream}`,
|
|
2312
2319
|
source: e.stream
|
|
2313
2320
|
} : void 0,
|
|
2314
2321
|
// Never block on autoclose: a transient query/store error should retry,
|
|
2315
2322
|
// not quarantine the synthetic stream.
|
|
2316
|
-
options: { blockOnError: false, maxRetries:
|
|
2323
|
+
options: { blockOnError: false, maxRetries: _chunkLN3OP4OLcjs.DEFAULT_MAX_RETRIES },
|
|
2317
2324
|
handler: async (event) => {
|
|
2318
2325
|
const aggregate = event.stream;
|
|
2319
2326
|
const window = read_window();
|
|
2320
2327
|
if (!in_autoclose_window(window, /* @__PURE__ */ new Date()))
|
|
2321
|
-
throw new (0,
|
|
2322
|
-
const stats = await
|
|
2328
|
+
throw new (0, _chunk7VYSJIXDcjs.DeferSignal)({ at: next_window_open(window, /* @__PURE__ */ new Date()) });
|
|
2329
|
+
const stats = await _chunkLN3OP4OLcjs.store.call(void 0, ).query_stats([aggregate], {
|
|
2323
2330
|
count: true,
|
|
2324
2331
|
tail: keep_days !== void 0 ? true : void 0,
|
|
2325
|
-
exclude: [
|
|
2332
|
+
exclude: [_chunk7VYSJIXDcjs.TOMBSTONE_EVENT, _chunk7VYSJIXDcjs.SNAP_EVENT]
|
|
2326
2333
|
});
|
|
2327
2334
|
const entry = stats.get(aggregate);
|
|
2328
2335
|
if (!entry) return;
|
|
@@ -2358,12 +2365,12 @@ function synthesize_autoclose_reactions(registry, states, read_window) {
|
|
|
2358
2365
|
dues.push(days_after(entry.tail.created, keep_days));
|
|
2359
2366
|
const future = dues.map((d) => d.getTime()).filter((t) => t > Date.now());
|
|
2360
2367
|
if (future.length)
|
|
2361
|
-
throw new (0,
|
|
2368
|
+
throw new (0, _chunk7VYSJIXDcjs.DeferSignal)({ at: new Date(Math.min(...future)) });
|
|
2362
2369
|
}
|
|
2363
2370
|
};
|
|
2364
2371
|
const key = `__autoclose_${st.name}`;
|
|
2365
2372
|
for (const event_name of Object.keys(st.events)) {
|
|
2366
|
-
_optionalChain([registry, 'access',
|
|
2373
|
+
_optionalChain([registry, 'access', _117 => _117.events, 'access', _118 => _118[event_name], 'optionalAccess', _119 => _119.reactions, 'access', _120 => _120.set, 'call', _121 => _121(
|
|
2367
2374
|
key,
|
|
2368
2375
|
reaction
|
|
2369
2376
|
)]);
|
|
@@ -2418,8 +2425,8 @@ async function run_close_cycle(targets, deps) {
|
|
|
2418
2425
|
deps,
|
|
2419
2426
|
() => run_full_closes(full, target_map, deps, skipped)
|
|
2420
2427
|
);
|
|
2421
|
-
const retired = [...truncated.entries()].filter(([, r]) => r.committed.name ===
|
|
2422
|
-
if (retired.length) _optionalChain([deps, 'access',
|
|
2428
|
+
const retired = [...truncated.entries()].filter(([, r]) => r.committed.name === _chunk7VYSJIXDcjs.TOMBSTONE_EVENT).map(([stream]) => stream);
|
|
2429
|
+
if (retired.length) _optionalChain([deps, 'access', _122 => _122.forget_subscribed, 'optionalCall', _123 => _123(retired)]);
|
|
2423
2430
|
for (const [stream, entry] of windowed_result) truncated.set(stream, entry);
|
|
2424
2431
|
return { truncated, skipped };
|
|
2425
2432
|
}
|
|
@@ -2439,7 +2446,7 @@ async function run_full_closes(full, target_map, deps, skipped) {
|
|
|
2439
2446
|
const info = stream_info.get(target.stream);
|
|
2440
2447
|
if (!info) continue;
|
|
2441
2448
|
const owner = deps.event_to_state.get(info.last_event_name);
|
|
2442
|
-
if (_optionalChain([owner, 'optionalAccess',
|
|
2449
|
+
if (_optionalChain([owner, 'optionalAccess', _124 => _124.pii_aware])) {
|
|
2443
2450
|
deps.logger.error(
|
|
2444
2451
|
`Refusing to close "${target.stream}" with restart: state "${owner.name}" carries sensitive fields, so a restart seed would persist redacted values while deleting the originals. Close it without restart to retire the stream, or leave it open.`
|
|
2445
2452
|
);
|
|
@@ -2500,7 +2507,7 @@ async function run_windowed_closes(windowed, deps, skipped) {
|
|
|
2500
2507
|
if (!await windowed_prune_pending(t.stream, t.before, max_id))
|
|
2501
2508
|
return void 0;
|
|
2502
2509
|
if (t.archive) await t.archive();
|
|
2503
|
-
const result = await
|
|
2510
|
+
const result = await _chunkLN3OP4OLcjs.store.call(void 0, ).truncate([
|
|
2504
2511
|
{ stream: t.stream, before: t.before, max_id }
|
|
2505
2512
|
]);
|
|
2506
2513
|
return result.get(t.stream);
|
|
@@ -2513,10 +2520,10 @@ async function run_windowed_closes(windowed, deps, skipped) {
|
|
|
2513
2520
|
async function windowed_prune_pending(stream, before, max_id) {
|
|
2514
2521
|
let boundary_id;
|
|
2515
2522
|
let min_id;
|
|
2516
|
-
await
|
|
2523
|
+
await _chunkLN3OP4OLcjs.store.call(void 0, ).query(
|
|
2517
2524
|
(event) => {
|
|
2518
2525
|
if (min_id === void 0 || event.id < min_id) min_id = event.id;
|
|
2519
|
-
if (event.name ===
|
|
2526
|
+
if (event.name === _chunk7VYSJIXDcjs.SNAP_EVENT && event.created < before && (max_id === void 0 || event.id <= max_id) && (boundary_id === void 0 || event.id > boundary_id))
|
|
2520
2527
|
boundary_id = event.id;
|
|
2521
2528
|
},
|
|
2522
2529
|
{ stream, stream_exact: true, with_snaps: true, after: -1 }
|
|
@@ -2527,7 +2534,7 @@ async function probe_min_watermarks(streams, page_size, checkpoint) {
|
|
|
2527
2534
|
const min_at = /* @__PURE__ */ new Map();
|
|
2528
2535
|
const matches = source_matcher();
|
|
2529
2536
|
await walk_streams(
|
|
2530
|
-
|
|
2537
|
+
_chunkLN3OP4OLcjs.store.call(void 0, ),
|
|
2531
2538
|
(position) => {
|
|
2532
2539
|
const pending = position.correlated_at === void 0 || position.at < position.correlated_at;
|
|
2533
2540
|
const cap = pending ? position.at : Math.max(position.at, checkpoint);
|
|
@@ -2546,7 +2553,7 @@ function source_matcher() {
|
|
|
2546
2553
|
const compiled = /* @__PURE__ */ new Map();
|
|
2547
2554
|
return (source, target, stream) => {
|
|
2548
2555
|
if (!source) return true;
|
|
2549
|
-
if (
|
|
2556
|
+
if (_chunkPZQXTGWFcjs.isStreamName.call(void 0, source, target)) return source === stream;
|
|
2550
2557
|
let re = compiled.get(source);
|
|
2551
2558
|
if (!re) {
|
|
2552
2559
|
re = new RegExp(source);
|
|
@@ -2556,17 +2563,17 @@ function source_matcher() {
|
|
|
2556
2563
|
};
|
|
2557
2564
|
}
|
|
2558
2565
|
async function scan_stream_heads(streams) {
|
|
2559
|
-
const stats = await
|
|
2560
|
-
exclude: [
|
|
2566
|
+
const stats = await _chunkLN3OP4OLcjs.store.call(void 0, ).query_stats(streams, {
|
|
2567
|
+
exclude: [_chunk7VYSJIXDcjs.SNAP_EVENT]
|
|
2561
2568
|
});
|
|
2562
|
-
const domain_heads = await
|
|
2563
|
-
exclude: [
|
|
2569
|
+
const domain_heads = await _chunkLN3OP4OLcjs.store.call(void 0, ).query_stats(streams, {
|
|
2570
|
+
exclude: [_chunk7VYSJIXDcjs.SNAP_EVENT, _chunk7VYSJIXDcjs.TOMBSTONE_EVENT]
|
|
2564
2571
|
});
|
|
2565
|
-
const true_heads = await
|
|
2572
|
+
const true_heads = await _chunkLN3OP4OLcjs.store.call(void 0, ).query_stats(streams, {});
|
|
2566
2573
|
const out = /* @__PURE__ */ new Map();
|
|
2567
2574
|
for (const [stream, { head }] of domain_heads) {
|
|
2568
|
-
const marker_head = _optionalChain([stats, 'access',
|
|
2569
|
-
const interrupted = _optionalChain([marker_head, 'optionalAccess',
|
|
2575
|
+
const marker_head = _optionalChain([stats, 'access', _125 => _125.get, 'call', _126 => _126(stream), 'optionalAccess', _127 => _127.head]);
|
|
2576
|
+
const interrupted = _optionalChain([marker_head, 'optionalAccess', _128 => _128.name]) === _chunk7VYSJIXDcjs.TOMBSTONE_EVENT;
|
|
2570
2577
|
out.set(stream, {
|
|
2571
2578
|
max_id: head.id,
|
|
2572
2579
|
version: true_heads.get(stream).head.version,
|
|
@@ -2589,7 +2596,7 @@ async function partition_by_safety(stream_info, reactive, skipped, page_size, ca
|
|
|
2589
2596
|
const pending_set = /* @__PURE__ */ new Set();
|
|
2590
2597
|
const matches = source_matcher();
|
|
2591
2598
|
await walk_streams(
|
|
2592
|
-
|
|
2599
|
+
_chunkLN3OP4OLcjs.store.call(void 0, ),
|
|
2593
2600
|
(position) => {
|
|
2594
2601
|
const has_work = position.correlated_at !== void 0 && position.at < position.correlated_at;
|
|
2595
2602
|
if (!has_work) return;
|
|
@@ -2634,7 +2641,7 @@ async function guard_with_tombstones(safe, stream_info, correlation, tombstone2,
|
|
|
2634
2641
|
async function load_restart_seeds(guarded, target_map, stream_info, event_to_state, load2, logger) {
|
|
2635
2642
|
const seed_states = /* @__PURE__ */ new Map();
|
|
2636
2643
|
await Promise.all(
|
|
2637
|
-
guarded.filter((s) => _optionalChain([target_map, 'access',
|
|
2644
|
+
guarded.filter((s) => _optionalChain([target_map, 'access', _129 => _129.get, 'call', _130 => _130(s), 'optionalAccess', _131 => _131.restart])).map(async (stream) => {
|
|
2638
2645
|
const last_event_name = stream_info.get(stream).last_event_name;
|
|
2639
2646
|
const owner_state = event_to_state.get(last_event_name);
|
|
2640
2647
|
if (!owner_state) {
|
|
@@ -2651,14 +2658,14 @@ async function load_restart_seeds(guarded, target_map, stream_info, event_to_sta
|
|
|
2651
2658
|
}
|
|
2652
2659
|
async function run_archive_callbacks(guarded, target_map) {
|
|
2653
2660
|
for (const stream of guarded) {
|
|
2654
|
-
const archive_fn = _optionalChain([target_map, 'access',
|
|
2661
|
+
const archive_fn = _optionalChain([target_map, 'access', _132 => _132.get, 'call', _133 => _133(stream), 'optionalAccess', _134 => _134.archive]);
|
|
2655
2662
|
if (archive_fn) await archive_fn();
|
|
2656
2663
|
}
|
|
2657
2664
|
}
|
|
2658
2665
|
async function heads_still_guarded(guarded, guard_events, skipped) {
|
|
2659
|
-
const heads = await
|
|
2666
|
+
const heads = await _chunkLN3OP4OLcjs.store.call(void 0, ).query_stats(guarded, {});
|
|
2660
2667
|
return guarded.filter((stream) => {
|
|
2661
|
-
if (_optionalChain([heads, 'access',
|
|
2668
|
+
if (_optionalChain([heads, 'access', _135 => _135.get, 'call', _136 => _136(stream), 'optionalAccess', _137 => _137.head, 'access', _138 => _138.id]) === guard_events.get(stream).id)
|
|
2662
2669
|
return true;
|
|
2663
2670
|
skipped.push(stream);
|
|
2664
2671
|
return false;
|
|
@@ -2674,18 +2681,18 @@ async function truncate_and_warm_cache(guarded, seed_states, guard_events, corre
|
|
|
2674
2681
|
meta: {
|
|
2675
2682
|
correlation,
|
|
2676
2683
|
causation: {
|
|
2677
|
-
event: { id: guard.id, name:
|
|
2684
|
+
event: { id: guard.id, name: _chunk7VYSJIXDcjs.TOMBSTONE_EVENT, stream: guard.stream }
|
|
2678
2685
|
}
|
|
2679
2686
|
}
|
|
2680
2687
|
};
|
|
2681
2688
|
});
|
|
2682
|
-
const truncated = await
|
|
2689
|
+
const truncated = await _chunkLN3OP4OLcjs.store.call(void 0, ).truncate(trunc_targets);
|
|
2683
2690
|
await Promise.all(
|
|
2684
2691
|
guarded.map(async (stream) => {
|
|
2685
2692
|
const entry = truncated.get(stream);
|
|
2686
2693
|
const state2 = seed_states.get(stream);
|
|
2687
2694
|
if (state2 && entry) {
|
|
2688
|
-
await
|
|
2695
|
+
await _chunkLN3OP4OLcjs.cache.call(void 0, ).set(stream, {
|
|
2689
2696
|
stream,
|
|
2690
2697
|
state: state2,
|
|
2691
2698
|
version: entry.committed.version,
|
|
@@ -2694,7 +2701,7 @@ async function truncate_and_warm_cache(guarded, seed_states, guard_events, corre
|
|
|
2694
2701
|
snaps: 1
|
|
2695
2702
|
});
|
|
2696
2703
|
} else {
|
|
2697
|
-
await
|
|
2704
|
+
await _chunkLN3OP4OLcjs.cache.call(void 0, ).invalidate(stream);
|
|
2698
2705
|
}
|
|
2699
2706
|
})
|
|
2700
2707
|
);
|
|
@@ -2717,6 +2724,13 @@ function report_undeclared_lane(seen, handler, target, lane, declared) {
|
|
|
2717
2724
|
`Reaction "${handler}" resolved onto undeclared lane "${lane}" \u2014 for example target "${target}". Declared lanes: ${[...declared].map((l) => `"${l}"`).join(", ")}. No controller claims it, so the stream would never drain \u2014 running it on "default" instead. The equivalent static \`.to({ lane })\` is rejected at build; a dynamic resolver's lane is only knowable here.`
|
|
2718
2725
|
);
|
|
2719
2726
|
}
|
|
2727
|
+
function report_bad_priority(seen, handler, target, priority) {
|
|
2728
|
+
report_once(
|
|
2729
|
+
seen,
|
|
2730
|
+
`priority|${handler}|${String(priority)}`,
|
|
2731
|
+
`Reaction "${handler}" resolved priority ${String(priority)} for target "${target}", which isn't a 32-bit integer. Skipping that event for this reaction; other reactions keep running. The equivalent static \`.to({ priority })\` is rejected at build; a dynamic resolver's priority is only knowable here.`
|
|
2732
|
+
);
|
|
2733
|
+
}
|
|
2720
2734
|
function report_lane_conflict(seen, handler, target, kept, dropped) {
|
|
2721
2735
|
report_once(
|
|
2722
2736
|
seen,
|
|
@@ -2746,7 +2760,7 @@ var CorrelateCycle = (_class5 = class {
|
|
|
2746
2760
|
// never lets a resolution re-lane them.
|
|
2747
2761
|
|
|
2748
2762
|
__init18() {this._static_subscriptions = /* @__PURE__ */ new Map()}
|
|
2749
|
-
__init19() {this._patterns = new (0,
|
|
2763
|
+
__init19() {this._patterns = new (0, _chunkLN3OP4OLcjs.LruMap)(PATTERN_CACHE_SIZE)}
|
|
2750
2764
|
|
|
2751
2765
|
|
|
2752
2766
|
|
|
@@ -2764,7 +2778,7 @@ var CorrelateCycle = (_class5 = class {
|
|
|
2764
2778
|
on_init
|
|
2765
2779
|
}) {;_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);
|
|
2766
2780
|
this._key = shard ? `${registry_key(registry.events)}:${[...shard].sort().join(",")}` : registry_key(registry.events);
|
|
2767
|
-
this._dynamic_subscriptions = new (0,
|
|
2781
|
+
this._dynamic_subscriptions = new (0, _chunkLN3OP4OLcjs.LruMap)(max_subscribed_streams);
|
|
2768
2782
|
this._registry = registry;
|
|
2769
2783
|
this._declared_lanes = declared_lanes;
|
|
2770
2784
|
this._static_targets = static_targets;
|
|
@@ -2796,7 +2810,7 @@ var CorrelateCycle = (_class5 = class {
|
|
|
2796
2810
|
lane
|
|
2797
2811
|
});
|
|
2798
2812
|
}
|
|
2799
|
-
await _optionalChain([this, 'access',
|
|
2813
|
+
await _optionalChain([this, 'access', _139 => _139._on_init, 'optionalCall', _140 => _140()]);
|
|
2800
2814
|
}
|
|
2801
2815
|
/**
|
|
2802
2816
|
* Replace the log with no pass in flight, then cold-start: a pass that
|
|
@@ -2822,7 +2836,7 @@ var CorrelateCycle = (_class5 = class {
|
|
|
2822
2836
|
// Would the target's own `fetch` (filtered by `source`) return this event?
|
|
2823
2837
|
_in_fetch_window(source, stream) {
|
|
2824
2838
|
if (source === void 0 || source === stream) return true;
|
|
2825
|
-
if (
|
|
2839
|
+
if (_chunkPZQXTGWFcjs.isStreamName.call(void 0, source)) return false;
|
|
2826
2840
|
let pattern = this._patterns.get(source);
|
|
2827
2841
|
if (!pattern) {
|
|
2828
2842
|
pattern = new RegExp(source);
|
|
@@ -2865,7 +2879,7 @@ var CorrelateCycle = (_class5 = class {
|
|
|
2865
2879
|
const correlated = /* @__PURE__ */ new Map();
|
|
2866
2880
|
let last_id = after;
|
|
2867
2881
|
let stopped = false;
|
|
2868
|
-
const found = await
|
|
2882
|
+
const found = await _chunkLN3OP4OLcjs.store.call(void 0, ).query(
|
|
2869
2883
|
(event) => {
|
|
2870
2884
|
if (stopped) return;
|
|
2871
2885
|
const register = this._registry.events[event.name];
|
|
@@ -2884,6 +2898,15 @@ var CorrelateCycle = (_class5 = class {
|
|
|
2884
2898
|
return;
|
|
2885
2899
|
}
|
|
2886
2900
|
if (!resolved) continue;
|
|
2901
|
+
if (!_chunkLN3OP4OLcjs.is_valid_target.call(void 0, resolved)) {
|
|
2902
|
+
report_bad_priority(
|
|
2903
|
+
this._reported,
|
|
2904
|
+
reaction.handler.name,
|
|
2905
|
+
resolved.target,
|
|
2906
|
+
resolved.priority
|
|
2907
|
+
);
|
|
2908
|
+
continue;
|
|
2909
|
+
}
|
|
2887
2910
|
let lane = resolved.lane;
|
|
2888
2911
|
if (lane !== void 0 && !this._declared_lanes.has(lane)) {
|
|
2889
2912
|
report_undeclared_lane(
|
|
@@ -2910,9 +2933,9 @@ var CorrelateCycle = (_class5 = class {
|
|
|
2910
2933
|
correlated_at: void 0
|
|
2911
2934
|
};
|
|
2912
2935
|
const seen_in_scan = correlated.has(resolved.target);
|
|
2913
|
-
const held_lane = _nullishCoalesce((seen_in_scan ? entry.lane : _optionalChain([recorded, 'optionalAccess',
|
|
2914
|
-
const held_priority = seen_in_scan ? entry.priority : _optionalChain([recorded, 'optionalAccess',
|
|
2915
|
-
const resolved_lane = _nullishCoalesce(lane, () => (
|
|
2936
|
+
const held_lane = _nullishCoalesce((seen_in_scan ? entry.lane : _optionalChain([recorded, 'optionalAccess', _141 => _141.lane])), () => ( _chunk7VYSJIXDcjs.DEFAULT_LANE));
|
|
2937
|
+
const held_priority = seen_in_scan ? entry.priority : _optionalChain([recorded, 'optionalAccess', _142 => _142.priority]);
|
|
2938
|
+
const resolved_lane = _nullishCoalesce(lane, () => ( _chunk7VYSJIXDcjs.DEFAULT_LANE));
|
|
2916
2939
|
if (held_priority === priority && held_lane !== resolved_lane)
|
|
2917
2940
|
report_lane_conflict(
|
|
2918
2941
|
this._reported,
|
|
@@ -2966,7 +2989,7 @@ var CorrelateCycle = (_class5 = class {
|
|
|
2966
2989
|
).length;
|
|
2967
2990
|
this._checkpoint = last_id;
|
|
2968
2991
|
for (const { stream, priority, lane } of streams) {
|
|
2969
|
-
if (_optionalChain([correlated, 'access',
|
|
2992
|
+
if (_optionalChain([correlated, 'access', _143 => _143.get, 'call', _144 => _144(stream), 'optionalAccess', _145 => _145.upgraded]))
|
|
2970
2993
|
this._dynamic_subscriptions.set(stream, {
|
|
2971
2994
|
priority,
|
|
2972
2995
|
lane
|
|
@@ -2986,7 +3009,7 @@ var CorrelateCycle = (_class5 = class {
|
|
|
2986
3009
|
await Promise.all(
|
|
2987
3010
|
missed.map(async ([stream, entry]) => {
|
|
2988
3011
|
let row;
|
|
2989
|
-
await
|
|
3012
|
+
await _chunkLN3OP4OLcjs.store.call(void 0, ).query_streams(
|
|
2990
3013
|
(position) => {
|
|
2991
3014
|
row = position;
|
|
2992
3015
|
},
|
|
@@ -2998,8 +3021,8 @@ var CorrelateCycle = (_class5 = class {
|
|
|
2998
3021
|
lane: row.lane
|
|
2999
3022
|
});
|
|
3000
3023
|
if (entry.priority > row.priority) return;
|
|
3001
|
-
const held_lane = _nullishCoalesce(row.lane, () => (
|
|
3002
|
-
const resolved_lane = _nullishCoalesce(entry.lane, () => (
|
|
3024
|
+
const held_lane = _nullishCoalesce(row.lane, () => ( _chunk7VYSJIXDcjs.DEFAULT_LANE));
|
|
3025
|
+
const resolved_lane = _nullishCoalesce(entry.lane, () => ( _chunk7VYSJIXDcjs.DEFAULT_LANE));
|
|
3003
3026
|
if (entry.priority === row.priority && held_lane !== resolved_lane)
|
|
3004
3027
|
report_lane_conflict(
|
|
3005
3028
|
this._reported,
|
|
@@ -3025,7 +3048,7 @@ var CorrelateCycle = (_class5 = class {
|
|
|
3025
3048
|
millis: 0
|
|
3026
3049
|
});
|
|
3027
3050
|
} catch (error) {
|
|
3028
|
-
|
|
3051
|
+
_chunkLN3OP4OLcjs.log.call(void 0, ).warn(
|
|
3029
3052
|
`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)))}`
|
|
3030
3053
|
);
|
|
3031
3054
|
}
|
|
@@ -3049,7 +3072,7 @@ function pii_gate(event, fields, predicate, actor) {
|
|
|
3049
3072
|
const { pii, ...rest } = event;
|
|
3050
3073
|
if (pii == null) {
|
|
3051
3074
|
const shredded = { ...data };
|
|
3052
|
-
for (const f of fields) shredded[f] =
|
|
3075
|
+
for (const f of fields) shredded[f] = _chunk7VYSJIXDcjs.SHREDDED;
|
|
3053
3076
|
return { ...rest, data: shredded };
|
|
3054
3077
|
}
|
|
3055
3078
|
const allowed = !!actor && !!predicate && predicate(event, actor);
|
|
@@ -3060,7 +3083,7 @@ function pii_gate(event, fields, predicate, actor) {
|
|
|
3060
3083
|
};
|
|
3061
3084
|
}
|
|
3062
3085
|
const redacted = { ...data };
|
|
3063
|
-
for (const f of fields) redacted[f] =
|
|
3086
|
+
for (const f of fields) redacted[f] = _chunk7VYSJIXDcjs.REDACTED;
|
|
3064
3087
|
return { ...rest, data: redacted };
|
|
3065
3088
|
}
|
|
3066
3089
|
var IDENTITY_GATE = (event) => event;
|
|
@@ -3205,7 +3228,7 @@ var SettleLoop = (_class6 = class {
|
|
|
3205
3228
|
this._pending = true;
|
|
3206
3229
|
return;
|
|
3207
3230
|
}
|
|
3208
|
-
const delay = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
3231
|
+
const delay = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _146 => _146.debounceMs]), () => ( this._default_debounce_ms));
|
|
3209
3232
|
const due = Date.now() + delay;
|
|
3210
3233
|
if (this._timer) {
|
|
3211
3234
|
if (due >= this._due) return;
|
|
@@ -3362,7 +3385,7 @@ var Act = (_class7 = class {
|
|
|
3362
3385
|
// Lanes to arm per event; `"all"` when a dynamic resolver hides the lane.
|
|
3363
3386
|
|
|
3364
3387
|
|
|
3365
|
-
__init27() {this._logger =
|
|
3388
|
+
__init27() {this._logger = _chunkLN3OP4OLcjs.log.call(void 0, )}
|
|
3366
3389
|
// This Act's ports: its own bag, or the singleton adapters.
|
|
3367
3390
|
|
|
3368
3391
|
// Runs a body so internal `store()`/`cache()` calls resolve to `_ports`.
|
|
@@ -3384,10 +3407,10 @@ var Act = (_class7 = class {
|
|
|
3384
3407
|
this._lanes = lanes;
|
|
3385
3408
|
this._declared_lanes = ["default", ...lanes.map((l) => l.name)];
|
|
3386
3409
|
validate_only_lanes(options.onlyLanes, this._declared_lanes);
|
|
3387
|
-
if (options.scoped)
|
|
3388
|
-
this._ports = _nullishCoalesce(options.scoped, () => (
|
|
3410
|
+
if (options.scoped) _chunkLN3OP4OLcjs.check_store.call(void 0, options.scoped.store);
|
|
3411
|
+
this._ports = _nullishCoalesce(options.scoped, () => ( _chunkLN3OP4OLcjs.unscoped_ports.call(void 0, )));
|
|
3389
3412
|
const ports = this._ports;
|
|
3390
|
-
this._scoped =
|
|
3413
|
+
this._scoped = _chunkLN3OP4OLcjs.make_run_scoped.call(void 0, {
|
|
3391
3414
|
// Getters, not a spread: the singletons resolve lazily, so a later
|
|
3392
3415
|
// `store(...)` / `cache(...)` still takes effect.
|
|
3393
3416
|
get store() {
|
|
@@ -3397,14 +3420,14 @@ var Act = (_class7 = class {
|
|
|
3397
3420
|
return ports.cache;
|
|
3398
3421
|
},
|
|
3399
3422
|
// Parsed per build, so a bad window throws on every build.
|
|
3400
|
-
autoclose_window:
|
|
3423
|
+
autoclose_window: _chunkLN3OP4OLcjs.resolveAutocloseConfig.call(void 0, options).autocloseWindow
|
|
3401
3424
|
});
|
|
3402
3425
|
this._correlator = _nullishCoalesce(options.correlator, () => ( default_correlator));
|
|
3403
3426
|
this._es = build_es(this._logger, this._correlator, patch_fn);
|
|
3404
3427
|
this._cd = build_drain(this._logger);
|
|
3405
3428
|
const handle = build_handle({
|
|
3406
3429
|
logger: this._logger,
|
|
3407
|
-
reaction_scope:
|
|
3430
|
+
reaction_scope: _chunkLN3OP4OLcjs.make_reaction_scope.call(void 0, {
|
|
3408
3431
|
do: this.do.bind(this),
|
|
3409
3432
|
load: this.load.bind(this),
|
|
3410
3433
|
query: this.query.bind(this),
|
|
@@ -3434,12 +3457,12 @@ var Act = (_class7 = class {
|
|
|
3434
3457
|
this._ports.store,
|
|
3435
3458
|
options.listen !== false
|
|
3436
3459
|
);
|
|
3437
|
-
|
|
3460
|
+
_chunkLN3OP4OLcjs.register_weak_disposer.call(void 0, new WeakRef(this), (self) => self.shutdown());
|
|
3438
3461
|
}
|
|
3439
3462
|
// Shared by drain, settle and autoclose; bad knobs throw at build.
|
|
3440
3463
|
_build_breaker(options) {
|
|
3441
3464
|
return new CircuitBreaker(
|
|
3442
|
-
|
|
3465
|
+
_chunkLN3OP4OLcjs.resolveCircuitBreakerConfig.call(void 0, options.circuitBreaker),
|
|
3443
3466
|
{
|
|
3444
3467
|
on_error: (error, circuit) => this._emit_error(error, circuit),
|
|
3445
3468
|
// When the cooldown elapses, settle once: its scan or claim is the
|
|
@@ -3451,7 +3474,7 @@ var Act = (_class7 = class {
|
|
|
3451
3474
|
// Apps that declare no lanes pass no lane filter to `claim`.
|
|
3452
3475
|
_build_drain_controllers(options, lanes, handle, handle_batch) {
|
|
3453
3476
|
const all_lanes = this._declared_lanes;
|
|
3454
|
-
const only_set = _optionalChain([options, 'access',
|
|
3477
|
+
const only_set = _optionalChain([options, 'access', _147 => _147.onlyLanes, 'optionalAccess', _148 => _148.length]) ? new Set(options.onlyLanes) : void 0;
|
|
3455
3478
|
const active_lanes = only_set ? all_lanes.filter((n) => only_set.has(n)) : all_lanes;
|
|
3456
3479
|
const single_default_lane = lanes.length === 0;
|
|
3457
3480
|
const controllers = /* @__PURE__ */ new Map();
|
|
@@ -3473,7 +3496,7 @@ var Act = (_class7 = class {
|
|
|
3473
3496
|
try {
|
|
3474
3497
|
await this._run_close(targets);
|
|
3475
3498
|
} catch (error) {
|
|
3476
|
-
if (error instanceof
|
|
3499
|
+
if (error instanceof _chunk7VYSJIXDcjs.StoreError) throw error;
|
|
3477
3500
|
this._logger.error(
|
|
3478
3501
|
error,
|
|
3479
3502
|
`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.`
|
|
@@ -3488,7 +3511,7 @@ var Act = (_class7 = class {
|
|
|
3488
3511
|
leaseMillis: cfg.leaseMillis
|
|
3489
3512
|
}
|
|
3490
3513
|
});
|
|
3491
|
-
if (_optionalChain([cfg, 'optionalAccess',
|
|
3514
|
+
if (_optionalChain([cfg, 'optionalAccess', _149 => _149.cycleMs]) !== void 0 && this._drain)
|
|
3492
3515
|
controller.start(cfg.cycleMs);
|
|
3493
3516
|
controllers.set(name, controller);
|
|
3494
3517
|
}
|
|
@@ -3507,7 +3530,7 @@ var Act = (_class7 = class {
|
|
|
3507
3530
|
// Audit deps, built after the controllers so the lane set is final.
|
|
3508
3531
|
_build_audit_deps() {
|
|
3509
3532
|
return {
|
|
3510
|
-
store:
|
|
3533
|
+
store: _chunkLN3OP4OLcjs.store,
|
|
3511
3534
|
event_to_state: this._event_to_state,
|
|
3512
3535
|
// Declared lanes, not this process's controllers: a lane another
|
|
3513
3536
|
// worker drains is not `unknown-lane`.
|
|
@@ -3520,7 +3543,7 @@ var Act = (_class7 = class {
|
|
|
3520
3543
|
registry: this.registry,
|
|
3521
3544
|
static_targets: classification.static_targets,
|
|
3522
3545
|
cd: this._cd,
|
|
3523
|
-
max_subscribed_streams: _nullishCoalesce(options.maxSubscribedStreams, () => (
|
|
3546
|
+
max_subscribed_streams: _nullishCoalesce(options.maxSubscribedStreams, () => ( _chunk7VYSJIXDcjs.DEFAULT_MAX_SUBSCRIBED_STREAMS)),
|
|
3524
3547
|
// Declared lanes (not active ones): a lane another process claims is
|
|
3525
3548
|
// still a valid destination.
|
|
3526
3549
|
declared_lanes: new Set(this._declared_lanes),
|
|
@@ -3536,10 +3559,10 @@ var Act = (_class7 = class {
|
|
|
3536
3559
|
// Cold start: an idle deferred stream still fires on time after a restart.
|
|
3537
3560
|
async _seed_persisted_defers() {
|
|
3538
3561
|
const now = Date.now();
|
|
3539
|
-
await walk_streams(
|
|
3562
|
+
await walk_streams(_chunkLN3OP4OLcjs.store.call(void 0, ), (pos) => {
|
|
3540
3563
|
if (pos.deferred_at === void 0 || pos.deferred_at <= now) return;
|
|
3541
3564
|
const controller = this._drain_controllers.get(_nullishCoalesce(pos.lane, () => ( "default")));
|
|
3542
|
-
_optionalChain([controller, 'optionalAccess',
|
|
3565
|
+
_optionalChain([controller, 'optionalAccess', _150 => _150.seed_defer, 'call', _151 => _151(pos.stream, pos.deferred_at)]);
|
|
3543
3566
|
});
|
|
3544
3567
|
}
|
|
3545
3568
|
_build_settle(options) {
|
|
@@ -3552,7 +3575,7 @@ var Act = (_class7 = class {
|
|
|
3552
3575
|
on_settled: (drain) => this.emit("settled", drain),
|
|
3553
3576
|
breaker: this._breaker
|
|
3554
3577
|
},
|
|
3555
|
-
_nullishCoalesce(options.settleDebounceMs, () => (
|
|
3578
|
+
_nullishCoalesce(options.settleDebounceMs, () => ( _chunk7VYSJIXDcjs.DEFAULT_SETTLE_DEBOUNCE_MS))
|
|
3556
3579
|
);
|
|
3557
3580
|
}
|
|
3558
3581
|
|
|
@@ -3572,7 +3595,7 @@ var Act = (_class7 = class {
|
|
|
3572
3595
|
*/
|
|
3573
3596
|
shutdown(options) {
|
|
3574
3597
|
if (!this._shutdown_promise) {
|
|
3575
|
-
|
|
3598
|
+
_chunkLN3OP4OLcjs.resolveShutdownConfig.call(void 0, options);
|
|
3576
3599
|
this._shutdown_promise = (async () => {
|
|
3577
3600
|
this.stop_correlations();
|
|
3578
3601
|
this._settle.stop(true);
|
|
@@ -3580,7 +3603,7 @@ var Act = (_class7 = class {
|
|
|
3580
3603
|
for (const c of this._drain_controllers.values()) c.stop();
|
|
3581
3604
|
const disposer = await this._notify_disposer;
|
|
3582
3605
|
if (disposer) await disposer();
|
|
3583
|
-
await this._await_inflight(_optionalChain([options, 'optionalAccess',
|
|
3606
|
+
await this._await_inflight(_optionalChain([options, 'optionalAccess', _152 => _152.graceMs]));
|
|
3584
3607
|
await this._scoped(() => this._correlate.release_correlation());
|
|
3585
3608
|
this._emitter.removeAllListeners();
|
|
3586
3609
|
})();
|
|
@@ -3590,10 +3613,10 @@ var Act = (_class7 = class {
|
|
|
3590
3613
|
// The largest `leaseMillis` among lanes with a cycle in flight (the
|
|
3591
3614
|
// default for none or 0, and for a running settle), capped.
|
|
3592
3615
|
_derive_grace_ms(running, settling) {
|
|
3593
|
-
let max = settling ?
|
|
3616
|
+
let max = settling ? _chunkLN3OP4OLcjs.DEFAULT_LEASE_MILLIS : 0;
|
|
3594
3617
|
for (const c of running)
|
|
3595
|
-
max = Math.max(max, c.lease_millis ||
|
|
3596
|
-
return Math.min(max,
|
|
3618
|
+
max = Math.max(max, c.lease_millis || _chunkLN3OP4OLcjs.DEFAULT_LEASE_MILLIS);
|
|
3619
|
+
return Math.min(max, _chunkLN3OP4OLcjs.MAX_SHUTDOWN_GRACE_MS);
|
|
3597
3620
|
}
|
|
3598
3621
|
async _await_inflight(grace_ms) {
|
|
3599
3622
|
const running = [...this._drain_controllers.values()].filter(
|
|
@@ -3677,8 +3700,8 @@ var Act = (_class7 = class {
|
|
|
3677
3700
|
* @see {@link ValidationError}, {@link PreconditionError}, {@link ConcurrencyError}
|
|
3678
3701
|
*/
|
|
3679
3702
|
async do(action2, target, payload, options) {
|
|
3680
|
-
const reacting_to = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
3681
|
-
const do_options = reacting_to === _optionalChain([options, 'optionalAccess',
|
|
3703
|
+
const reacting_to = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _153 => _153.reactingTo]), () => ( _chunkLN3OP4OLcjs.current_reacting.call(void 0, )));
|
|
3704
|
+
const do_options = reacting_to === _optionalChain([options, 'optionalAccess', _154 => _154.reactingTo]) ? options : { ...options, reactingTo: reacting_to };
|
|
3682
3705
|
return this._scoped(async () => {
|
|
3683
3706
|
const snapshots = await this._es.action(
|
|
3684
3707
|
this.registry.actions[action2],
|
|
@@ -3751,11 +3774,11 @@ var Act = (_class7 = class {
|
|
|
3751
3774
|
return this._scoped(async () => {
|
|
3752
3775
|
let first;
|
|
3753
3776
|
let last;
|
|
3754
|
-
const count = await
|
|
3777
|
+
const count = await _chunkLN3OP4OLcjs.store.call(void 0, ).query((e) => {
|
|
3755
3778
|
const gated = this.registry.query_gate(e.name)(e);
|
|
3756
3779
|
if (!first) first = gated;
|
|
3757
3780
|
last = gated;
|
|
3758
|
-
_optionalChain([callback, 'optionalCall',
|
|
3781
|
+
_optionalChain([callback, 'optionalCall', _155 => _155(gated)]);
|
|
3759
3782
|
}, query);
|
|
3760
3783
|
return { first, last, count };
|
|
3761
3784
|
});
|
|
@@ -3781,7 +3804,7 @@ var Act = (_class7 = class {
|
|
|
3781
3804
|
async query_array(query) {
|
|
3782
3805
|
return this._scoped(async () => {
|
|
3783
3806
|
const events = [];
|
|
3784
|
-
await
|
|
3807
|
+
await _chunkLN3OP4OLcjs.store.call(void 0, ).query((e) => {
|
|
3785
3808
|
events.push(this.registry.query_gate(e.name)(e));
|
|
3786
3809
|
}, query);
|
|
3787
3810
|
return events;
|
|
@@ -3801,14 +3824,14 @@ var Act = (_class7 = class {
|
|
|
3801
3824
|
*/
|
|
3802
3825
|
async forget(stream) {
|
|
3803
3826
|
return this._scoped(async () => {
|
|
3804
|
-
const s =
|
|
3827
|
+
const s = _chunkLN3OP4OLcjs.store.call(void 0, );
|
|
3805
3828
|
if (!s.forget_pii) {
|
|
3806
3829
|
throw new Error(
|
|
3807
3830
|
`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).`
|
|
3808
3831
|
);
|
|
3809
3832
|
}
|
|
3810
3833
|
const eventCount = await s.forget_pii(stream);
|
|
3811
|
-
await
|
|
3834
|
+
await _chunkLN3OP4OLcjs.cache.call(void 0, ).invalidate(stream);
|
|
3812
3835
|
if (eventCount > 0) {
|
|
3813
3836
|
this.emit("forgotten", { stream, at: /* @__PURE__ */ new Date(), eventCount });
|
|
3814
3837
|
}
|
|
@@ -3842,7 +3865,7 @@ var Act = (_class7 = class {
|
|
|
3842
3865
|
* @see {@link correlate} for dynamic stream discovery
|
|
3843
3866
|
*/
|
|
3844
3867
|
async drain(options = {}) {
|
|
3845
|
-
|
|
3868
|
+
_chunkLN3OP4OLcjs.resolveDrainConfig.call(void 0, options);
|
|
3846
3869
|
if (!this._drain)
|
|
3847
3870
|
return { fetched: [], leased: [], acked: [], blocked: [] };
|
|
3848
3871
|
return this._scoped(() => this._drain_all(options));
|
|
@@ -3880,7 +3903,7 @@ var Act = (_class7 = class {
|
|
|
3880
3903
|
}
|
|
3881
3904
|
if (to_arm.size === 0) return false;
|
|
3882
3905
|
this._correlate.arm();
|
|
3883
|
-
for (const lane of to_arm) _optionalChain([this, 'access',
|
|
3906
|
+
for (const lane of to_arm) _optionalChain([this, 'access', _156 => _156._drain_controllers, 'access', _157 => _157.get, 'call', _158 => _158(lane), 'optionalAccess', _159 => _159.arm, 'call', _160 => _160()]);
|
|
3884
3907
|
return true;
|
|
3885
3908
|
}
|
|
3886
3909
|
// In parallel, so a slow lane never holds up a fast one.
|
|
@@ -4022,9 +4045,9 @@ var Act = (_class7 = class {
|
|
|
4022
4045
|
*/
|
|
4023
4046
|
async reset(input) {
|
|
4024
4047
|
return this._scoped(async () => {
|
|
4025
|
-
const count = await
|
|
4048
|
+
const count = await _chunkLN3OP4OLcjs.store.call(void 0, ).reset(input);
|
|
4026
4049
|
for (const handler of this._batch_handlers.values())
|
|
4027
|
-
_optionalChain([handler, 'access',
|
|
4050
|
+
_optionalChain([handler, 'access', _161 => _161[FOLD_RESET], 'optionalCall', _162 => _162()]);
|
|
4028
4051
|
if (count > 0) {
|
|
4029
4052
|
this._wake();
|
|
4030
4053
|
}
|
|
@@ -4058,7 +4081,7 @@ var Act = (_class7 = class {
|
|
|
4058
4081
|
*/
|
|
4059
4082
|
async unblock(input) {
|
|
4060
4083
|
return this._scoped(async () => {
|
|
4061
|
-
const count = await
|
|
4084
|
+
const count = await _chunkLN3OP4OLcjs.store.call(void 0, ).unblock(input);
|
|
4062
4085
|
if (count > 0) {
|
|
4063
4086
|
this._wake();
|
|
4064
4087
|
}
|
|
@@ -4113,7 +4136,7 @@ var Act = (_class7 = class {
|
|
|
4113
4136
|
return { ...partial, duration_ms: Date.now() - started };
|
|
4114
4137
|
}
|
|
4115
4138
|
const target = _nullishCoalesce(sink, () => ( (() => {
|
|
4116
|
-
const s =
|
|
4139
|
+
const s = _chunkLN3OP4OLcjs.store.call(void 0, );
|
|
4117
4140
|
if (!s.restore) throw new Error("adapter has no restore capability");
|
|
4118
4141
|
return s;
|
|
4119
4142
|
})()));
|
|
@@ -4159,11 +4182,11 @@ var Act = (_class7 = class {
|
|
|
4159
4182
|
async blocked_streams(options) {
|
|
4160
4183
|
return this._scoped(async () => {
|
|
4161
4184
|
const positions = [];
|
|
4162
|
-
await
|
|
4185
|
+
await _chunkLN3OP4OLcjs.store.call(void 0, ).query_streams(
|
|
4163
4186
|
(p) => {
|
|
4164
4187
|
positions.push(p);
|
|
4165
4188
|
},
|
|
4166
|
-
{ blocked: true, after: _optionalChain([options, 'optionalAccess',
|
|
4189
|
+
{ blocked: true, after: _optionalChain([options, 'optionalAccess', _163 => _163.after]), limit: _optionalChain([options, 'optionalAccess', _164 => _164.limit]) }
|
|
4167
4190
|
);
|
|
4168
4191
|
return positions;
|
|
4169
4192
|
});
|
|
@@ -4200,8 +4223,9 @@ var Act = (_class7 = class {
|
|
|
4200
4223
|
* registered stream.**
|
|
4201
4224
|
*
|
|
4202
4225
|
* @param filter - Selection criteria (regex by default, like {@link query}).
|
|
4203
|
-
* @param priority - New priority value. Set as-is — no clamp.
|
|
4226
|
+
* @param priority - New priority value, a 32-bit integer. Set as-is — no clamp.
|
|
4204
4227
|
* @returns Count of streams whose priority changed.
|
|
4228
|
+
* @throws ZodError when `priority` isn't a 32-bit integer.
|
|
4205
4229
|
*
|
|
4206
4230
|
* @example Boost a specific projection mid-replay
|
|
4207
4231
|
* ```typescript
|
|
@@ -4211,7 +4235,8 @@ var Act = (_class7 = class {
|
|
|
4211
4235
|
* @see {@link Store.prioritize} for the underlying primitive
|
|
4212
4236
|
*/
|
|
4213
4237
|
async prioritize(filter, priority) {
|
|
4214
|
-
|
|
4238
|
+
_chunkLN3OP4OLcjs.resolveTargetConfig.call(void 0, { priority });
|
|
4239
|
+
return this._scoped(() => _chunkLN3OP4OLcjs.store.call(void 0, ).prioritize(filter, priority));
|
|
4215
4240
|
}
|
|
4216
4241
|
// Shared by `close()` and reaction-requested closes.
|
|
4217
4242
|
async _run_close(targets) {
|
|
@@ -4291,7 +4316,7 @@ var Act = (_class7 = class {
|
|
|
4291
4316
|
* @see {@link correlate} for manual correlation
|
|
4292
4317
|
*/
|
|
4293
4318
|
settle(options) {
|
|
4294
|
-
|
|
4319
|
+
_chunkLN3OP4OLcjs.resolveSettleConfig.call(void 0, _nullishCoalesce(options, () => ( {})));
|
|
4295
4320
|
this._schedule(options);
|
|
4296
4321
|
}
|
|
4297
4322
|
}, _class7);
|
|
@@ -4299,9 +4324,9 @@ var Act = (_class7 = class {
|
|
|
4299
4324
|
// src/builders/merge.ts
|
|
4300
4325
|
|
|
4301
4326
|
function base_type_name(schema) {
|
|
4302
|
-
let def =
|
|
4303
|
-
for (let inner =
|
|
4304
|
-
def =
|
|
4327
|
+
let def = _chunk7VYSJIXDcjs.def_of.call(void 0, schema);
|
|
4328
|
+
for (let inner = _chunk7VYSJIXDcjs.inner_of.call(void 0, def); inner; inner = _chunk7VYSJIXDcjs.inner_of.call(void 0, def))
|
|
4329
|
+
def = _chunk7VYSJIXDcjs.def_of.call(void 0, inner);
|
|
4305
4330
|
return def.type === "array" ? `array of ${base_type_name(def.element)}` : def.type;
|
|
4306
4331
|
}
|
|
4307
4332
|
function merge_schemas(existing, incoming, state_name) {
|
|
@@ -4488,9 +4513,9 @@ var _this_ = ({ stream }) => ({
|
|
|
4488
4513
|
|
|
4489
4514
|
// src/builders/builder-utils.ts
|
|
4490
4515
|
function register_lane(config2, lanes) {
|
|
4491
|
-
|
|
4492
|
-
if (config2.name ===
|
|
4493
|
-
throw new Error(`Lane "${
|
|
4516
|
+
_chunkLN3OP4OLcjs.resolveLaneConfig.call(void 0, config2);
|
|
4517
|
+
if (config2.name === _chunk7VYSJIXDcjs.DEFAULT_LANE)
|
|
4518
|
+
throw new Error(`Lane "${_chunk7VYSJIXDcjs.DEFAULT_LANE}" is reserved`);
|
|
4494
4519
|
const existing = lanes.find((l) => l.name === config2.name);
|
|
4495
4520
|
if (!existing) return void lanes.push(config2);
|
|
4496
4521
|
if (existing.leaseMillis !== config2.leaseMillis || existing.streamLimit !== config2.streamLimit || existing.cycleMs !== config2.cycleMs)
|
|
@@ -4512,6 +4537,7 @@ function add_reaction(events, event, name, kind, make, builder) {
|
|
|
4512
4537
|
events[event].reactions.set(name, reaction);
|
|
4513
4538
|
return Object.assign(builder, {
|
|
4514
4539
|
to(resolver) {
|
|
4540
|
+
if (typeof resolver === "object") _chunkLN3OP4OLcjs.resolveTargetConfig.call(void 0, resolver);
|
|
4515
4541
|
reaction.resolver = typeof resolver === "string" ? { target: resolver } : resolver;
|
|
4516
4542
|
return builder;
|
|
4517
4543
|
}
|
|
@@ -4532,10 +4558,10 @@ function reaction_on(event, events, builder) {
|
|
|
4532
4558
|
// Validate the whole bag at the declaration site so a bad
|
|
4533
4559
|
// `maxRetries`/`backoff`/`blockOnError` throws ZodError at build,
|
|
4534
4560
|
// not a NaN gate on the first retry.
|
|
4535
|
-
options:
|
|
4536
|
-
blockOnError: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4537
|
-
maxRetries: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4538
|
-
backoff: _optionalChain([options, 'optionalAccess',
|
|
4561
|
+
options: _chunkLN3OP4OLcjs.resolveReactionConfig.call(void 0, {
|
|
4562
|
+
blockOnError: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _165 => _165.blockOnError]), () => ( _chunkLN3OP4OLcjs.DEFAULT_BLOCK_ON_ERROR)),
|
|
4563
|
+
maxRetries: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _166 => _166.maxRetries]), () => ( _chunkLN3OP4OLcjs.DEFAULT_MAX_RETRIES)),
|
|
4564
|
+
backoff: _optionalChain([options, 'optionalAccess', _167 => _167.backoff])
|
|
4539
4565
|
})
|
|
4540
4566
|
};
|
|
4541
4567
|
},
|
|
@@ -4555,7 +4581,7 @@ function reaction_on(event, events, builder) {
|
|
|
4555
4581
|
// src/internal/date-reviver.ts
|
|
4556
4582
|
|
|
4557
4583
|
function variant_schema(schema, walk) {
|
|
4558
|
-
const shape = _optionalChain([
|
|
4584
|
+
const shape = _optionalChain([_chunk7VYSJIXDcjs.def_of.call(void 0, schema), 'optionalAccess', _168 => _168.shape]);
|
|
4559
4585
|
if (!shape) {
|
|
4560
4586
|
const dates = walk(schema);
|
|
4561
4587
|
return { schema: _nullishCoalesce(dates, () => ( schema)), dated: !!dates };
|
|
@@ -4592,7 +4618,7 @@ function date_reviver_schema(schema) {
|
|
|
4592
4618
|
return first && recursive ? pass(true) : first;
|
|
4593
4619
|
}
|
|
4594
4620
|
function build(schema, walk) {
|
|
4595
|
-
const def =
|
|
4621
|
+
const def = _chunk7VYSJIXDcjs.def_of.call(void 0, schema);
|
|
4596
4622
|
if (!def) return void 0;
|
|
4597
4623
|
const inner = () => walk(def.innerType);
|
|
4598
4624
|
switch (def.type) {
|
|
@@ -4627,7 +4653,7 @@ function build(schema, walk) {
|
|
|
4627
4653
|
return variants.some((v) => v.dated) ? _zod.z.union(variants.map((v) => v.schema)) : void 0;
|
|
4628
4654
|
}
|
|
4629
4655
|
case "nullable":
|
|
4630
|
-
return _optionalChain([inner, 'call',
|
|
4656
|
+
return _optionalChain([inner, 'call', _169 => _169(), 'optionalAccess', _170 => _170.nullable, 'call', _171 => _171()]);
|
|
4631
4657
|
case "pipe":
|
|
4632
4658
|
return walk(def.out);
|
|
4633
4659
|
case "lazy":
|
|
@@ -4638,13 +4664,13 @@ function build(schema, walk) {
|
|
|
4638
4664
|
return left && right ? left.pipe(right) : _nullishCoalesce(left, () => ( right));
|
|
4639
4665
|
}
|
|
4640
4666
|
default:
|
|
4641
|
-
return
|
|
4667
|
+
return _chunk7VYSJIXDcjs.inner_of.call(void 0, def) ? inner() : void 0;
|
|
4642
4668
|
}
|
|
4643
4669
|
}
|
|
4644
4670
|
|
|
4645
4671
|
// src/builders/event-builder.ts
|
|
4646
4672
|
function event_tags(schema) {
|
|
4647
|
-
const pii =
|
|
4673
|
+
const pii = _chunk7VYSJIXDcjs.pii_schemas.call(void 0, schema);
|
|
4648
4674
|
const pii_dates = {};
|
|
4649
4675
|
for (const [key, field] of Object.entries(pii)) {
|
|
4650
4676
|
const dates = date_reviver_schema(field);
|
|
@@ -4682,7 +4708,7 @@ function make_event_reader(tags, disclosure, predicate = null) {
|
|
|
4682
4708
|
});
|
|
4683
4709
|
}
|
|
4684
4710
|
function build_events(registry, states, lanes, owners) {
|
|
4685
|
-
const declared = /* @__PURE__ */ new Set([
|
|
4711
|
+
const declared = /* @__PURE__ */ new Set([_chunk7VYSJIXDcjs.DEFAULT_LANE, ...lanes.map((l) => l.name)]);
|
|
4686
4712
|
const lane_errors = [];
|
|
4687
4713
|
const tags = /* @__PURE__ */ new Map();
|
|
4688
4714
|
const sensitive2 = /* @__PURE__ */ new Map();
|
|
@@ -4757,7 +4783,7 @@ function build_events(registry, states, lanes, owners) {
|
|
|
4757
4783
|
if (reader) readers.set(event_name, reader);
|
|
4758
4784
|
}
|
|
4759
4785
|
const snap2 = make_event_reader(event_tags(state2.state), "redact", null);
|
|
4760
|
-
if (snap2) readers.set(
|
|
4786
|
+
if (snap2) readers.set(_chunk7VYSJIXDcjs.SNAP_EVENT, snap2);
|
|
4761
4787
|
if (readers.size === 0) continue;
|
|
4762
4788
|
state2.view = (event, actor) => (_nullishCoalesce(readers.get(event.name), () => ( IDENTITY_GATE)))(event, actor);
|
|
4763
4789
|
}
|
|
@@ -4765,7 +4791,7 @@ function build_events(registry, states, lanes, owners) {
|
|
|
4765
4791
|
return { sensitive: sensitive2, advisory, query_readers, handler_readers };
|
|
4766
4792
|
}
|
|
4767
4793
|
function reads_as_string(schema) {
|
|
4768
|
-
const type = _optionalChain([
|
|
4794
|
+
const type = _optionalChain([_chunk7VYSJIXDcjs.def_of.call(void 0, _chunk7VYSJIXDcjs.output_of.call(void 0, schema)), 'optionalAccess', _172 => _172.type]);
|
|
4769
4795
|
return type === "string" || type === "transform";
|
|
4770
4796
|
}
|
|
4771
4797
|
|
|
@@ -4823,7 +4849,7 @@ function act() {
|
|
|
4823
4849
|
let _built = false;
|
|
4824
4850
|
const read_wrap = (original) => {
|
|
4825
4851
|
const wrapped = async (events, stream) => {
|
|
4826
|
-
const read = events.map((e) => _nullishCoalesce(_optionalChain([_hr, 'access',
|
|
4852
|
+
const read = events.map((e) => _nullishCoalesce(_optionalChain([_hr, 'access', _173 => _173.get, 'call', _174 => _174(e.name), 'optionalCall', _175 => _175(e)]), () => ( e)));
|
|
4827
4853
|
return original(read, stream);
|
|
4828
4854
|
};
|
|
4829
4855
|
const reset = original[FOLD_RESET];
|
|
@@ -4864,7 +4890,7 @@ function act() {
|
|
|
4864
4890
|
});
|
|
4865
4891
|
}
|
|
4866
4892
|
for (const [action_name, handler] of Object.entries(state2.on)) {
|
|
4867
|
-
const static_target = _optionalChain([handler, 'optionalAccess',
|
|
4893
|
+
const static_target = _optionalChain([handler, 'optionalAccess', _176 => _176._static_emit]);
|
|
4868
4894
|
if (static_target && deprecated.has(static_target)) {
|
|
4869
4895
|
const current = current_version_of(static_target, event_names);
|
|
4870
4896
|
throw new Error(
|
|
@@ -4877,7 +4903,7 @@ function act() {
|
|
|
4877
4903
|
const list = deprecation_summary.map(
|
|
4878
4904
|
(d) => `"${d.deprecated}" (current: "${d.current}", state: "${d.state_name}")`
|
|
4879
4905
|
).join(", ");
|
|
4880
|
-
|
|
4906
|
+
_chunkLN3OP4OLcjs.log.call(void 0, ).info(
|
|
4881
4907
|
`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.`
|
|
4882
4908
|
);
|
|
4883
4909
|
}
|
|
@@ -4919,7 +4945,7 @@ function act() {
|
|
|
4919
4945
|
return reaction_on(event, registry.events, builder);
|
|
4920
4946
|
},
|
|
4921
4947
|
build: (options) => {
|
|
4922
|
-
|
|
4948
|
+
_chunkLN3OP4OLcjs.resolveActConfig.call(void 0, options);
|
|
4923
4949
|
if (!_built) {
|
|
4924
4950
|
for (const proj of pending_projections) add_projection(proj);
|
|
4925
4951
|
for (const proj of fold_projections) {
|
|
@@ -4937,7 +4963,7 @@ function act() {
|
|
|
4937
4963
|
`State projection "${proj.target}" of "${fold.name}" is missing events ${missing.join(", ")} \u2014 pass every partial of the state to .of()`
|
|
4938
4964
|
);
|
|
4939
4965
|
const claimed = fold_specs.find((s) => s.target === proj.target);
|
|
4940
|
-
if (_optionalChain([claimed, 'optionalAccess',
|
|
4966
|
+
if (_optionalChain([claimed, 'optionalAccess', _177 => _177.projection]) === proj) continue;
|
|
4941
4967
|
if (batch_handlers.has(proj.target) || claimed)
|
|
4942
4968
|
throw new Error(
|
|
4943
4969
|
`Duplicate projection target "${proj.target}" \u2014 a target is served by one batch handler or one state projection, never both`
|
|
@@ -4959,7 +4985,7 @@ function act() {
|
|
|
4959
4985
|
for (const [name, gate] of built.query_readers) _qg.set(name, gate);
|
|
4960
4986
|
for (const [name, gate] of built.handler_readers) _hr.set(name, gate);
|
|
4961
4987
|
finalize_deprecations();
|
|
4962
|
-
if (built.advisory)
|
|
4988
|
+
if (built.advisory) _chunkLN3OP4OLcjs.log.call(void 0, ).warn(built.advisory);
|
|
4963
4989
|
for (const [name, state2] of states) {
|
|
4964
4990
|
if (!state2.loads) continue;
|
|
4965
4991
|
const resolved = {};
|
|
@@ -4971,7 +4997,7 @@ function act() {
|
|
|
4971
4997
|
`Action "${action2}" loads "${l.state.name}", which is not registered \u2014 add it via withState/withSlice before build()`
|
|
4972
4998
|
);
|
|
4973
4999
|
const deprecated = l.events.find(
|
|
4974
|
-
(e) => _optionalChain([_de, 'access',
|
|
5000
|
+
(e) => _optionalChain([_de, 'access', _178 => _178.get, 'call', _179 => _179(registered.name), 'optionalAccess', _180 => _180.has, 'call', _181 => _181(e)])
|
|
4975
5001
|
);
|
|
4976
5002
|
if (deprecated)
|
|
4977
5003
|
throw new Error(
|
|
@@ -5003,7 +5029,7 @@ function act() {
|
|
|
5003
5029
|
synthesize_autoclose_reactions(
|
|
5004
5030
|
registry,
|
|
5005
5031
|
states,
|
|
5006
|
-
|
|
5032
|
+
_chunkLN3OP4OLcjs.current_autoclose_window
|
|
5007
5033
|
);
|
|
5008
5034
|
Object.freeze(registry.actions);
|
|
5009
5035
|
Object.freeze(registry.events);
|
|
@@ -5051,8 +5077,8 @@ function _projection(target) {
|
|
|
5051
5077
|
handler,
|
|
5052
5078
|
resolver: _nullishCoalesce(default_resolver, () => ( _this_)),
|
|
5053
5079
|
options: {
|
|
5054
|
-
blockOnError:
|
|
5055
|
-
maxRetries:
|
|
5080
|
+
blockOnError: _chunkLN3OP4OLcjs.DEFAULT_BLOCK_ON_ERROR,
|
|
5081
|
+
maxRetries: _chunkLN3OP4OLcjs.DEFAULT_MAX_RETRIES
|
|
5056
5082
|
}
|
|
5057
5083
|
}),
|
|
5058
5084
|
widened
|
|
@@ -5093,7 +5119,7 @@ function _projection(target) {
|
|
|
5093
5119
|
throw new Error(
|
|
5094
5120
|
`Projection "${target}" .of() partials must share one state name \u2014 got "${name}" and "${partial.name}"`
|
|
5095
5121
|
);
|
|
5096
|
-
const config2 =
|
|
5122
|
+
const config2 = _chunkLN3OP4OLcjs.resolveFoldConfig.call(void 0, options);
|
|
5097
5123
|
const fold_events = {};
|
|
5098
5124
|
for (const partial of partials)
|
|
5099
5125
|
for (const [event_name, schema] of Object.entries(partial.events)) {
|
|
@@ -5111,8 +5137,8 @@ function _projection(target) {
|
|
|
5111
5137
|
handler: noop,
|
|
5112
5138
|
resolver: { target },
|
|
5113
5139
|
options: {
|
|
5114
|
-
blockOnError:
|
|
5115
|
-
maxRetries:
|
|
5140
|
+
blockOnError: _chunkLN3OP4OLcjs.DEFAULT_BLOCK_ON_ERROR,
|
|
5141
|
+
maxRetries: _chunkLN3OP4OLcjs.DEFAULT_MAX_RETRIES
|
|
5116
5142
|
}
|
|
5117
5143
|
}
|
|
5118
5144
|
]
|
|
@@ -5228,7 +5254,7 @@ function action_builder(state2) {
|
|
|
5228
5254
|
throw new Error(`Duplicate action "${action2}"`);
|
|
5229
5255
|
internal.actions[action2] = schema;
|
|
5230
5256
|
if (options) {
|
|
5231
|
-
|
|
5257
|
+
_chunkLN3OP4OLcjs.resolveActionConfig.call(void 0, options);
|
|
5232
5258
|
internal.options ??= {};
|
|
5233
5259
|
internal.options[action2] = options;
|
|
5234
5260
|
}
|
|
@@ -5488,30 +5514,30 @@ function write_line(writer, line) {
|
|
|
5488
5514
|
}
|
|
5489
5515
|
|
|
5490
5516
|
// src/deprecated.ts
|
|
5491
|
-
var check_appends =
|
|
5492
|
-
var throw_if_stale =
|
|
5493
|
-
var concurrency_error =
|
|
5494
|
-
var seed_event =
|
|
5495
|
-
var fair_slots =
|
|
5496
|
-
var is_literal_source =
|
|
5497
|
-
var notification_of =
|
|
5498
|
-
var DEFAULT_QUERY_STREAMS_LIMIT2 =
|
|
5499
|
-
var ActorSchema2 =
|
|
5500
|
-
var TargetSchema2 =
|
|
5501
|
-
var EventMetaSchema2 =
|
|
5502
|
-
var CausationEventSchema2 =
|
|
5503
|
-
var CommittedMetaSchema2 =
|
|
5504
|
-
var QuerySchema2 =
|
|
5505
|
-
var Environments2 =
|
|
5506
|
-
var LogLevels2 =
|
|
5507
|
-
var ExitCodes2 =
|
|
5508
|
-
var DEFAULT_LANE2 =
|
|
5509
|
-
var DEFAULT_MAX_SUBSCRIBED_STREAMS2 =
|
|
5510
|
-
var DEFAULT_SETTLE_DEBOUNCE_MS2 =
|
|
5511
|
-
var PackageSchema =
|
|
5512
|
-
var default_scope =
|
|
5513
|
-
var resolveAutocloseConfig2 =
|
|
5514
|
-
var extend = (source, schema, target) => ({ ...target, ...
|
|
5517
|
+
var check_appends = _chunkPZQXTGWFcjs.checkAppends;
|
|
5518
|
+
var throw_if_stale = _chunkPZQXTGWFcjs.checkVersion;
|
|
5519
|
+
var concurrency_error = _chunkPZQXTGWFcjs.concurrencyError;
|
|
5520
|
+
var seed_event = _chunkPZQXTGWFcjs.seedEvent;
|
|
5521
|
+
var fair_slots = _chunkPZQXTGWFcjs.fairSlots;
|
|
5522
|
+
var is_literal_source = _chunkPZQXTGWFcjs.isStreamName;
|
|
5523
|
+
var notification_of = _chunkPZQXTGWFcjs.parseNotification;
|
|
5524
|
+
var DEFAULT_QUERY_STREAMS_LIMIT2 = _chunk7VYSJIXDcjs.DEFAULT_QUERY_STREAMS_LIMIT;
|
|
5525
|
+
var ActorSchema2 = _chunk7VYSJIXDcjs.ActorSchema;
|
|
5526
|
+
var TargetSchema2 = _chunk7VYSJIXDcjs.TargetSchema;
|
|
5527
|
+
var EventMetaSchema2 = _chunk7VYSJIXDcjs.EventMetaSchema;
|
|
5528
|
+
var CausationEventSchema2 = _chunk7VYSJIXDcjs.CausationEventSchema;
|
|
5529
|
+
var CommittedMetaSchema2 = _chunk7VYSJIXDcjs.CommittedMetaSchema;
|
|
5530
|
+
var QuerySchema2 = _chunk7VYSJIXDcjs.QuerySchema;
|
|
5531
|
+
var Environments2 = _chunk7VYSJIXDcjs.Environments;
|
|
5532
|
+
var LogLevels2 = _chunk7VYSJIXDcjs.LogLevels;
|
|
5533
|
+
var ExitCodes2 = _chunk7VYSJIXDcjs.ExitCodes;
|
|
5534
|
+
var DEFAULT_LANE2 = _chunk7VYSJIXDcjs.DEFAULT_LANE;
|
|
5535
|
+
var DEFAULT_MAX_SUBSCRIBED_STREAMS2 = _chunk7VYSJIXDcjs.DEFAULT_MAX_SUBSCRIBED_STREAMS;
|
|
5536
|
+
var DEFAULT_SETTLE_DEBOUNCE_MS2 = _chunk7VYSJIXDcjs.DEFAULT_SETTLE_DEBOUNCE_MS;
|
|
5537
|
+
var PackageSchema = _chunkLN3OP4OLcjs.package_schema;
|
|
5538
|
+
var default_scope = _chunkLN3OP4OLcjs.unscoped_ports;
|
|
5539
|
+
var resolveAutocloseConfig2 = _chunkLN3OP4OLcjs.resolveAutocloseConfig;
|
|
5540
|
+
var extend = (source, schema, target) => ({ ...target, ..._chunkLN3OP4OLcjs.validate.call(void 0, "config", source, schema) });
|
|
5515
5541
|
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])?$/;
|
|
5516
5542
|
var dateReviver = (_key, value) => typeof value === "string" && ISO_8601.test(value) ? new Date(value) : value;
|
|
5517
5543
|
|
|
@@ -5574,5 +5600,5 @@ var dateReviver = (_key, value) => typeof value === "string" && ISO_8601.test(va
|
|
|
5574
5600
|
|
|
5575
5601
|
|
|
5576
5602
|
|
|
5577
|
-
exports.Act = Act; exports.ActorSchema = ActorSchema2; exports.CausationEventSchema = CausationEventSchema2; exports.CommittedMetaSchema = CommittedMetaSchema2; exports.ConcurrencyError =
|
|
5603
|
+
exports.Act = Act; exports.ActorSchema = ActorSchema2; exports.CausationEventSchema = CausationEventSchema2; exports.CommittedMetaSchema = CommittedMetaSchema2; exports.ConcurrencyError = _chunk7VYSJIXDcjs.ConcurrencyError; exports.ConsoleLogger = _chunkLN3OP4OLcjs.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 = _chunk7VYSJIXDcjs.DeferSignal; exports.Environments = Environments2; exports.Errors = _chunk7VYSJIXDcjs.Errors; exports.EventMetaSchema = EventMetaSchema2; exports.ExitCodes = ExitCodes2; exports.InMemoryCache = _chunkLN3OP4OLcjs.InMemoryCache; exports.InMemoryStore = _chunkLN3OP4OLcjs.InMemoryStore; exports.LogLevels = LogLevels2; exports.NonRetryableError = _chunk7VYSJIXDcjs.NonRetryableError; exports.PackageSchema = PackageSchema; exports.PreconditionError = _chunk7VYSJIXDcjs.PreconditionError; exports.QuerySchema = QuerySchema2; exports.REDACTED = _chunk7VYSJIXDcjs.REDACTED; exports.SHREDDED = _chunk7VYSJIXDcjs.SHREDDED; exports.SNAP_EVENT = _chunk7VYSJIXDcjs.SNAP_EVENT; exports.StoreError = _chunk7VYSJIXDcjs.StoreError; exports.StreamClosedError = _chunk7VYSJIXDcjs.StreamClosedError; exports.TOMBSTONE_EVENT = _chunk7VYSJIXDcjs.TOMBSTONE_EVENT; exports.TargetSchema = TargetSchema2; exports.ValidationError = _chunk7VYSJIXDcjs.ValidationError; exports.ZodEmpty = _chunk7VYSJIXDcjs.ZodEmpty; exports.act = act; exports.cache = _chunkLN3OP4OLcjs.cache; exports.check_appends = check_appends; exports.concurrency_error = concurrency_error; exports.config = _chunkLN3OP4OLcjs.config; exports.dateReviver = dateReviver; exports.default_scope = default_scope; exports.dispose = _chunkLN3OP4OLcjs.dispose; exports.disposeAndExit = _chunkLN3OP4OLcjs.disposeAndExit; exports.extend = extend; exports.fair_slots = fair_slots; exports.is_literal_source = is_literal_source; exports.log = _chunkLN3OP4OLcjs.log; exports.notification_of = notification_of; exports.pii_fields = _chunk7VYSJIXDcjs.pii_fields; exports.port = _chunkLN3OP4OLcjs.port; exports.projection = projection; exports.resolveAutocloseConfig = resolveAutocloseConfig2; exports.seed_event = seed_event; exports.sensitive = _chunk7VYSJIXDcjs.sensitive; exports.sensitiveFields = _chunk7VYSJIXDcjs.sensitiveFields; exports.sleep = _chunkLN3OP4OLcjs.sleep; exports.slice = slice; exports.state = state; exports.store = _chunkLN3OP4OLcjs.store; exports.throw_if_stale = throw_if_stale; exports.validate = _chunkLN3OP4OLcjs.validate;
|
|
5578
5604
|
//# sourceMappingURL=index.cjs.map
|