@rotorsoft/act 2.0.4 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/@types/act.d.ts.map +1 -1
- package/dist/@types/adapter.d.ts +85 -0
- package/dist/@types/adapter.d.ts.map +1 -0
- package/dist/@types/adapters/in-memory-store.d.ts.map +1 -1
- package/dist/@types/config.d.ts +3 -9
- package/dist/@types/config.d.ts.map +1 -1
- package/dist/@types/deprecated.d.ts +57 -0
- package/dist/@types/deprecated.d.ts.map +1 -0
- package/dist/@types/index.d.ts +12 -9
- package/dist/@types/index.d.ts.map +1 -1
- package/dist/@types/internal/autoclose-reaction.d.ts.map +1 -1
- package/dist/@types/internal/close-cycle.d.ts.map +1 -1
- package/dist/@types/internal/correlate-cycle.d.ts.map +1 -1
- package/dist/@types/internal/drain-ops.d.ts.map +1 -1
- package/dist/@types/ports.d.ts +1 -3
- package/dist/@types/ports.d.ts.map +1 -1
- package/dist/@types/scoped.d.ts +1 -1
- package/dist/@types/sensitive.d.ts +6 -2
- package/dist/@types/sensitive.d.ts.map +1 -1
- package/dist/@types/types/index.d.ts +1 -1
- package/dist/@types/types/index.d.ts.map +1 -1
- package/dist/@types/types/ports.d.ts +4 -0
- package/dist/@types/types/ports.d.ts.map +1 -1
- package/dist/@types/types/schemas.d.ts +1 -1
- package/dist/@types/types/schemas.d.ts.map +1 -1
- package/dist/@types/utils.d.ts +0 -105
- package/dist/@types/utils.d.ts.map +1 -1
- package/dist/adapter.cjs +20 -0
- package/dist/adapter.cjs.map +1 -0
- package/dist/adapter.js +20 -0
- package/dist/adapter.js.map +1 -0
- package/dist/{chunk-VD4BLAY4.cjs → chunk-2377SSHX.cjs} +7 -3
- package/dist/chunk-2377SSHX.cjs.map +1 -0
- package/dist/{chunk-ESFICIG2.js → chunk-GWFLHWZV.js} +6 -2
- package/dist/{chunk-ESFICIG2.js.map → chunk-GWFLHWZV.js.map} +1 -1
- package/dist/chunk-HACJYR7Z.cjs +62 -0
- package/dist/chunk-HACJYR7Z.cjs.map +1 -0
- package/dist/{chunk-3JULRYQO.js → chunk-KXC4ILVY.js} +168 -227
- package/dist/chunk-KXC4ILVY.js.map +1 -0
- package/dist/chunk-SRZIVZIA.js +62 -0
- package/dist/chunk-SRZIVZIA.js.map +1 -0
- package/dist/{chunk-XW4EAUS6.cjs → chunk-VOVHDDET.cjs} +195 -254
- package/dist/chunk-VOVHDDET.cjs.map +1 -0
- package/dist/index.cjs +193 -165
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +68 -40
- package/dist/index.js.map +1 -1
- package/dist/test/index.cjs +5 -4
- package/dist/test/index.cjs.map +1 -1
- package/dist/test/index.js +3 -2
- package/dist/test/index.js.map +1 -1
- package/dist/types/index.cjs +6 -2
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.js +7 -3
- package/package.json +6 -1
- package/dist/chunk-3JULRYQO.js.map +0 -1
- package/dist/chunk-VD4BLAY4.cjs.map +0 -1
- package/dist/chunk-XW4EAUS6.cjs.map +0 -1
|
@@ -3,10 +3,15 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
var _chunkHACJYR7Zcjs = require('./chunk-HACJYR7Z.cjs');
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
var _chunk2377SSHXcjs = require('./chunk-2377SSHX.cjs');
|
|
10
15
|
|
|
11
16
|
// src/adapters/console-logger.ts
|
|
12
17
|
var LEVEL_VALUES = {
|
|
@@ -207,148 +212,6 @@ var InMemoryCache = class {
|
|
|
207
212
|
var _fs = require('fs'); var fs = _interopRequireWildcard(_fs);
|
|
208
213
|
var _zod = require('zod');
|
|
209
214
|
|
|
210
|
-
// src/internal/config.ts
|
|
211
|
-
|
|
212
|
-
var BackoffOptionsSchema = _zod.z.object({
|
|
213
|
-
strategy: _zod.z.enum(["fixed", "linear", "exponential"]),
|
|
214
|
-
baseMs: _zod.z.number().min(0),
|
|
215
|
-
maxMs: _zod.z.number().gt(0).optional(),
|
|
216
|
-
jitter: _zod.z.boolean().optional()
|
|
217
|
-
});
|
|
218
|
-
var DEFAULT_BACKOFF = {
|
|
219
|
-
strategy: "fixed",
|
|
220
|
-
baseMs: 1e4
|
|
221
|
-
};
|
|
222
|
-
var DEFAULT_MAX_RETRIES = 3;
|
|
223
|
-
var DEFAULT_BLOCK_ON_ERROR = true;
|
|
224
|
-
var ReactionOptionsSchema = _zod.z.object({
|
|
225
|
-
blockOnError: _zod.z.boolean(),
|
|
226
|
-
maxRetries: _zod.z.number().int().min(0),
|
|
227
|
-
backoff: BackoffOptionsSchema.optional()
|
|
228
|
-
});
|
|
229
|
-
function resolveReactionConfig(options) {
|
|
230
|
-
return ReactionOptionsSchema.parse(options);
|
|
231
|
-
}
|
|
232
|
-
var ActionOptionsSchema = _zod.z.object({
|
|
233
|
-
maxRetries: _zod.z.number().int().min(0).optional(),
|
|
234
|
-
backoff: BackoffOptionsSchema.optional()
|
|
235
|
-
});
|
|
236
|
-
function resolveActionConfig(options) {
|
|
237
|
-
return ActionOptionsSchema.parse(options);
|
|
238
|
-
}
|
|
239
|
-
var LaneConfigSchema = _zod.z.object({
|
|
240
|
-
name: _zod.z.string().min(1),
|
|
241
|
-
leaseMillis: _zod.z.number().min(0).optional(),
|
|
242
|
-
streamLimit: _zod.z.number().int().min(0).optional(),
|
|
243
|
-
cycleMs: _zod.z.number().min(0).optional()
|
|
244
|
-
});
|
|
245
|
-
function resolveLaneConfig(options) {
|
|
246
|
-
LaneConfigSchema.parse(options);
|
|
247
|
-
return options;
|
|
248
|
-
}
|
|
249
|
-
var DEFAULT_STREAM_LIMIT = 10;
|
|
250
|
-
var DEFAULT_EVENT_LIMIT = 10;
|
|
251
|
-
var DEFAULT_LEASE_MILLIS = 1e4;
|
|
252
|
-
var DrainOptionsSchema = _zod.z.object({
|
|
253
|
-
streamLimit: _zod.z.number().int().min(0).optional(),
|
|
254
|
-
eventLimit: _zod.z.number().int().min(0).optional(),
|
|
255
|
-
leaseMillis: _zod.z.number().min(0).optional()
|
|
256
|
-
});
|
|
257
|
-
function resolveDrainConfig(options) {
|
|
258
|
-
if (options === void 0) return void 0;
|
|
259
|
-
DrainOptionsSchema.parse(options);
|
|
260
|
-
return options;
|
|
261
|
-
}
|
|
262
|
-
var SettleOptionsSchema = DrainOptionsSchema.extend({
|
|
263
|
-
debounceMs: _zod.z.number().min(0).optional(),
|
|
264
|
-
// `maxPasses` defaults to Infinity (no cap) when omitted; a present value is
|
|
265
|
-
// a non-negative integer — `0` is legal and means "run no passes".
|
|
266
|
-
//
|
|
267
|
-
// `Infinity` is accepted explicitly. It is the documented default
|
|
268
|
-
// (`Act.settle`'s doc-comment and `SettleOptions.maxPasses` both name it),
|
|
269
|
-
// and `settle.ts` destructures `maxPasses = Infinity`, so the one value the
|
|
270
|
-
// docs advertise was the one value `z.number().int()` refused — Zod 4
|
|
271
|
-
// rejects `±Infinity`, and an integer check cannot pass it either. Wrapper
|
|
272
|
-
// code normalizing an optional cap (`maxPasses: opts.maxPasses ?? Infinity`)
|
|
273
|
-
// is the natural way to hit it. Accepting it also honors this module's own
|
|
274
|
-
// rule that a value which works today is never newly rejected.
|
|
275
|
-
maxPasses: _zod.z.union([_zod.z.number().int().min(0), _zod.z.literal(Number.POSITIVE_INFINITY)]).optional()
|
|
276
|
-
}).loose();
|
|
277
|
-
function resolveSettleConfig(options) {
|
|
278
|
-
if (options === void 0) return void 0;
|
|
279
|
-
SettleOptionsSchema.parse(options);
|
|
280
|
-
return options;
|
|
281
|
-
}
|
|
282
|
-
var MAX_SHUTDOWN_GRACE_MS = 3e4;
|
|
283
|
-
var ShutdownOptionsSchema = _zod.z.object({
|
|
284
|
-
// `0` is legal and is exactly today's behavior: stop scheduling and
|
|
285
|
-
// return without waiting.
|
|
286
|
-
graceMs: _zod.z.number().min(0).optional()
|
|
287
|
-
}).loose();
|
|
288
|
-
function resolveShutdownConfig(options) {
|
|
289
|
-
if (options === void 0) return void 0;
|
|
290
|
-
ShutdownOptionsSchema.parse(options);
|
|
291
|
-
return options;
|
|
292
|
-
}
|
|
293
|
-
var ActOptionsSchema = _zod.z.object({
|
|
294
|
-
maxSubscribedStreams: _zod.z.number().int().min(1).optional(),
|
|
295
|
-
settleDebounceMs: _zod.z.number().int().min(0).optional(),
|
|
296
|
-
autoSettle: _zod.z.boolean().optional()
|
|
297
|
-
}).loose();
|
|
298
|
-
function resolveActConfig(options) {
|
|
299
|
-
if (options === void 0) return void 0;
|
|
300
|
-
ActOptionsSchema.parse(options);
|
|
301
|
-
return options;
|
|
302
|
-
}
|
|
303
|
-
var DEFAULT_AUTOCLOSE_WINDOW_TZ = "UTC";
|
|
304
|
-
function is_valid_time_zone(tz) {
|
|
305
|
-
try {
|
|
306
|
-
new Intl.DateTimeFormat("en-US", { timeZone: tz });
|
|
307
|
-
return true;
|
|
308
|
-
} catch (e4) {
|
|
309
|
-
return false;
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
var AutocloseWindowSchema = _zod.z.object({
|
|
313
|
-
start: _zod.z.number().int().min(0).max(23, { message: "autocloseWindow.start must be an hour in [0, 23]" }),
|
|
314
|
-
end: _zod.z.number().int().min(0).max(23, { message: "autocloseWindow.end must be an hour in [0, 23]" }),
|
|
315
|
-
timeZone: _zod.z.string().refine(is_valid_time_zone, {
|
|
316
|
-
message: "autocloseWindow.timeZone must be a valid IANA time zone"
|
|
317
|
-
}).default(DEFAULT_AUTOCLOSE_WINDOW_TZ)
|
|
318
|
-
}).refine((w) => w.start !== w.end, {
|
|
319
|
-
message: "autocloseWindow.start and end must differ \u2014 an empty window disables autoclose"
|
|
320
|
-
});
|
|
321
|
-
var AutocloseOptionsSchema = _zod.z.object({
|
|
322
|
-
autocloseWindow: AutocloseWindowSchema.optional()
|
|
323
|
-
});
|
|
324
|
-
function resolveAutocloseConfig(options) {
|
|
325
|
-
return AutocloseOptionsSchema.parse({
|
|
326
|
-
autocloseWindow: _optionalChain([options, 'optionalAccess', _2 => _2.autocloseWindow])
|
|
327
|
-
});
|
|
328
|
-
}
|
|
329
|
-
var DEFAULT_CIRCUIT_FAILURE_THRESHOLD = 5;
|
|
330
|
-
var DEFAULT_CIRCUIT_COOLDOWN_MS = 3e4;
|
|
331
|
-
var CircuitBreakerOptionsSchema = _zod.z.object({
|
|
332
|
-
failureThreshold: _zod.z.number().int().min(1).default(DEFAULT_CIRCUIT_FAILURE_THRESHOLD),
|
|
333
|
-
cooldownMs: _zod.z.number().int().min(100).max(36e5).default(DEFAULT_CIRCUIT_COOLDOWN_MS)
|
|
334
|
-
});
|
|
335
|
-
var resolveCircuitBreakerConfig = (options) => CircuitBreakerOptionsSchema.parse(_nullishCoalesce(options, () => ( {})));
|
|
336
|
-
var DEFAULT_FOLD_FLUSH_EVERY = 1e3;
|
|
337
|
-
var DEFAULT_MAX_CACHED_STATES = 1e4;
|
|
338
|
-
var FoldOptionsSchema = _zod.z.object({
|
|
339
|
-
flushEvery: _zod.z.number().int().min(1).default(DEFAULT_FOLD_FLUSH_EVERY),
|
|
340
|
-
maxCachedStates: _zod.z.number().int().min(1).default(DEFAULT_MAX_CACHED_STATES)
|
|
341
|
-
});
|
|
342
|
-
function resolveFoldConfig(options) {
|
|
343
|
-
return FoldOptionsSchema.parse(options);
|
|
344
|
-
}
|
|
345
|
-
function check_store(store3) {
|
|
346
|
-
if (store3.commit.length === 4)
|
|
347
|
-
throw new Error(
|
|
348
|
-
"This store's commit takes (stream, msgs, meta, expectedVersion), the shape before @rotorsoft/act 2.0. Upgrade it, and every @rotorsoft/act-* package, together: https://rotorsoft.github.io/act-root/docs/guides/migrating-to-2.x"
|
|
349
|
-
);
|
|
350
|
-
}
|
|
351
|
-
|
|
352
215
|
// src/utils.ts
|
|
353
216
|
|
|
354
217
|
var validate = (target, payload, schema) => {
|
|
@@ -356,65 +219,14 @@ var validate = (target, payload, schema) => {
|
|
|
356
219
|
return schema ? schema.parse(payload) : payload;
|
|
357
220
|
} catch (error) {
|
|
358
221
|
if (error instanceof _zod.ZodError) {
|
|
359
|
-
throw new (0,
|
|
222
|
+
throw new (0, _chunk2377SSHXcjs.ValidationError)(target, payload, _zod.prettifyError.call(void 0, error));
|
|
360
223
|
}
|
|
361
|
-
throw new (0,
|
|
224
|
+
throw new (0, _chunk2377SSHXcjs.ValidationError)(target, payload, error);
|
|
362
225
|
}
|
|
363
226
|
};
|
|
364
|
-
var extend = (source, schema, target) => {
|
|
365
|
-
const value = validate("config", source, schema);
|
|
366
|
-
return { ...target, ...value };
|
|
367
|
-
};
|
|
368
227
|
async function sleep(ms) {
|
|
369
228
|
return new Promise((resolve) => setTimeout(resolve, _nullishCoalesce(ms, () => ( config().sleepMs))));
|
|
370
229
|
}
|
|
371
|
-
function is_literal_source(source, target) {
|
|
372
|
-
return source === target || !source.startsWith("^") && !source.endsWith("$");
|
|
373
|
-
}
|
|
374
|
-
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])?$/;
|
|
375
|
-
var dateReviver = (_key, value) => typeof value === "string" && ISO_8601.test(value) ? new Date(value) : value;
|
|
376
|
-
function check_appends(appends) {
|
|
377
|
-
const seen = /* @__PURE__ */ new Set();
|
|
378
|
-
for (const { stream, msgs } of appends) {
|
|
379
|
-
if (!msgs.length)
|
|
380
|
-
throw new Error(`commit: the append to "${stream}" has no events`);
|
|
381
|
-
if (seen.has(stream))
|
|
382
|
-
throw new Error(`commit: stream "${stream}" is named twice`);
|
|
383
|
-
seen.add(stream);
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
function concurrency_error(append, head) {
|
|
387
|
-
return new (0, _chunkVD4BLAY4cjs.ConcurrencyError)(
|
|
388
|
-
append.stream,
|
|
389
|
-
head,
|
|
390
|
-
append.msgs,
|
|
391
|
-
_nullishCoalesce(append.expectedVersion, () => ( -1))
|
|
392
|
-
);
|
|
393
|
-
}
|
|
394
|
-
function throw_if_stale(append, head) {
|
|
395
|
-
if (typeof append.expectedVersion === "number" && head !== append.expectedVersion)
|
|
396
|
-
throw concurrency_error(append, head);
|
|
397
|
-
}
|
|
398
|
-
function seed_event(snapshot, meta) {
|
|
399
|
-
return {
|
|
400
|
-
name: snapshot !== void 0 ? _chunkVD4BLAY4cjs.SNAP_EVENT : _chunkVD4BLAY4cjs.TOMBSTONE_EVENT,
|
|
401
|
-
data: _nullishCoalesce(snapshot, () => ( {})),
|
|
402
|
-
meta: _nullishCoalesce(meta, () => ( { correlation: "", causation: {} }))
|
|
403
|
-
};
|
|
404
|
-
}
|
|
405
|
-
function fair_slots(lagging) {
|
|
406
|
-
return lagging >= 2 ? Math.max(1, Math.floor(lagging / 4)) : 0;
|
|
407
|
-
}
|
|
408
|
-
function notification_of(raw) {
|
|
409
|
-
if (!raw || typeof raw !== "object") return void 0;
|
|
410
|
-
const { stream, events } = raw;
|
|
411
|
-
if (typeof stream !== "string" || !Array.isArray(events)) return void 0;
|
|
412
|
-
const kept = events.filter(
|
|
413
|
-
(e) => !!e && typeof e === "object" && typeof e.id === "number" && typeof e.name === "string"
|
|
414
|
-
);
|
|
415
|
-
return kept.length ? { stream, events: kept.map(({ id, name }) => ({ id, name })) } : void 0;
|
|
416
|
-
}
|
|
417
|
-
var DEFAULT_QUERY_STREAMS_LIMIT = 100;
|
|
418
230
|
|
|
419
231
|
// src/adapters/in-memory-store.ts
|
|
420
232
|
var InMemoryStream = (_class2 = class {
|
|
@@ -432,7 +244,7 @@ var InMemoryStream = (_class2 = class {
|
|
|
432
244
|
__init8() {this._deferred_at = void 0}
|
|
433
245
|
// Work mark; `undefined` = never correlated, so `claim` skips it.
|
|
434
246
|
__init9() {this._correlated_at = void 0}
|
|
435
|
-
constructor(stream, source, priority = 0, lane =
|
|
247
|
+
constructor(stream, source, priority = 0, lane = _chunk2377SSHXcjs.DEFAULT_LANE) {;_class2.prototype.__init2.call(this);_class2.prototype.__init3.call(this);_class2.prototype.__init4.call(this);_class2.prototype.__init5.call(this);_class2.prototype.__init6.call(this);_class2.prototype.__init7.call(this);_class2.prototype.__init8.call(this);_class2.prototype.__init9.call(this);
|
|
436
248
|
this.stream = stream;
|
|
437
249
|
this.source = source;
|
|
438
250
|
this._priority = priority;
|
|
@@ -607,7 +419,7 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
|
|
|
607
419
|
// Allocation-free for events without PII, the common case.
|
|
608
420
|
_with_pii(e, wanted = true) {
|
|
609
421
|
if (!wanted) return e;
|
|
610
|
-
const pii = _optionalChain([this, 'access',
|
|
422
|
+
const pii = _optionalChain([this, 'access', _2 => _2._pii, 'access', _3 => _3.get, 'call', _4 => _4(e.stream), 'optionalAccess', _5 => _5.get, 'call', _6 => _6(e.id)]);
|
|
611
423
|
return pii ? { ...e, pii } : e;
|
|
612
424
|
}
|
|
613
425
|
async dispose() {
|
|
@@ -627,9 +439,9 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
|
|
|
627
439
|
return (e) => {
|
|
628
440
|
if (stream_ok && !stream_ok(e.stream)) return false;
|
|
629
441
|
if (query.names && !query.names.includes(e.name)) return false;
|
|
630
|
-
if (query.correlation && _optionalChain([e, 'access',
|
|
442
|
+
if (query.correlation && _optionalChain([e, 'access', _7 => _7.meta, 'optionalAccess', _8 => _8.correlation]) !== query.correlation)
|
|
631
443
|
return false;
|
|
632
|
-
if (e.name ===
|
|
444
|
+
if (e.name === _chunk2377SSHXcjs.SNAP_EVENT && !query.with_snaps) return false;
|
|
633
445
|
if (query.created_after && e.created <= query.created_after) return false;
|
|
634
446
|
if (query.created_before && e.created >= query.created_before)
|
|
635
447
|
return false;
|
|
@@ -638,38 +450,38 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
|
|
|
638
450
|
}
|
|
639
451
|
// Index of the stream's latest snapshot, or -1; an explicit `after` wins.
|
|
640
452
|
_snap_floor(query) {
|
|
641
|
-
if (!_optionalChain([query, 'optionalAccess',
|
|
453
|
+
if (!_optionalChain([query, 'optionalAccess', _9 => _9.with_snaps]) || !query.stream_exact || query.stream === void 0 || query.after !== void 0)
|
|
642
454
|
return -1;
|
|
643
455
|
for (let j = this._events.length - 1; j >= 0; j--) {
|
|
644
456
|
const e = this._events[j];
|
|
645
|
-
if (e.stream === query.stream && e.name ===
|
|
457
|
+
if (e.stream === query.stream && e.name === _chunk2377SSHXcjs.SNAP_EVENT) return j;
|
|
646
458
|
}
|
|
647
459
|
return -1;
|
|
648
460
|
}
|
|
649
461
|
async query(callback, query) {
|
|
650
462
|
await sleep();
|
|
651
463
|
const floor = this._snap_floor(query);
|
|
652
|
-
const lo = floor >= 0 ? floor : this._first_index_after(_nullishCoalesce(_optionalChain([query, 'optionalAccess',
|
|
653
|
-
const hi = _optionalChain([query, 'optionalAccess',
|
|
654
|
-
const with_pii = _optionalChain([query, 'optionalAccess',
|
|
464
|
+
const lo = floor >= 0 ? floor : this._first_index_after(_nullishCoalesce(_optionalChain([query, 'optionalAccess', _10 => _10.after]), () => ( -1)));
|
|
465
|
+
const hi = _optionalChain([query, 'optionalAccess', _11 => _11.before]) !== void 0 ? this._first_index_after(query.before - 1) : this._events.length;
|
|
466
|
+
const with_pii = _optionalChain([query, 'optionalAccess', _12 => _12.with_pii]) !== false;
|
|
655
467
|
const in_query = this._in_query(_nullishCoalesce(query, () => ( {})));
|
|
656
468
|
let count = 0;
|
|
657
469
|
for (let k = 0; k < hi - lo; k++) {
|
|
658
|
-
const e = this._events[_optionalChain([query, 'optionalAccess',
|
|
470
|
+
const e = this._events[_optionalChain([query, 'optionalAccess', _13 => _13.backward]) ? hi - 1 - k : lo + k];
|
|
659
471
|
if (!in_query(e)) continue;
|
|
660
472
|
await Promise.resolve(
|
|
661
473
|
callback(this._with_pii(e, with_pii))
|
|
662
474
|
);
|
|
663
475
|
count++;
|
|
664
|
-
if (_optionalChain([query, 'optionalAccess',
|
|
476
|
+
if (_optionalChain([query, 'optionalAccess', _14 => _14.limit]) && count >= query.limit) break;
|
|
665
477
|
}
|
|
666
478
|
return count;
|
|
667
479
|
}
|
|
668
480
|
async commit(appends, meta) {
|
|
669
481
|
await sleep();
|
|
670
|
-
|
|
482
|
+
_chunkHACJYR7Zcjs.checkAppends.call(void 0, appends);
|
|
671
483
|
for (const append of appends)
|
|
672
|
-
|
|
484
|
+
_chunkHACJYR7Zcjs.checkVersion.call(void 0, append, _nullishCoalesce(this._stream_versions.get(append.stream), () => ( -1)));
|
|
673
485
|
const created = /* @__PURE__ */ new Date();
|
|
674
486
|
return appends.flatMap(({ stream, msgs }) => {
|
|
675
487
|
let version = _nullishCoalesce(this._stream_versions.get(stream), () => ( -1));
|
|
@@ -697,7 +509,7 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
|
|
|
697
509
|
const available = [...this._streams.values()].filter(
|
|
698
510
|
(s) => s.is_available && has_work(s) && (lane === void 0 || s.lane === lane)
|
|
699
511
|
);
|
|
700
|
-
const fair =
|
|
512
|
+
const fair = _chunkHACJYR7Zcjs.fairSlots.call(void 0, lagging);
|
|
701
513
|
const by_priority = [...available].sort(
|
|
702
514
|
(a, b) => b.priority - a.priority || a.at - b.at
|
|
703
515
|
);
|
|
@@ -723,7 +535,7 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
|
|
|
723
535
|
return true;
|
|
724
536
|
});
|
|
725
537
|
return combined.map(
|
|
726
|
-
(p) => _optionalChain([this, 'access',
|
|
538
|
+
(p) => _optionalChain([this, 'access', _15 => _15._streams, 'access', _16 => _16.get, 'call', _17 => _17(p.stream), 'optionalAccess', _18 => _18.lease, 'call', _19 => _19({ ...p, by, retry: 0 }, millis)])
|
|
727
539
|
).filter((l) => !!l);
|
|
728
540
|
}
|
|
729
541
|
async subscribe(streams, correlated_at, correlator) {
|
|
@@ -733,7 +545,7 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
|
|
|
733
545
|
if (correlator) {
|
|
734
546
|
const now = Date.now();
|
|
735
547
|
const held = this._correlators.get(correlator.key);
|
|
736
|
-
const at = Math.max(_nullishCoalesce(_optionalChain([held, 'optionalAccess',
|
|
548
|
+
const at = Math.max(_nullishCoalesce(_optionalChain([held, 'optionalAccess', _20 => _20.at]), () => ( this._correlated_at)), _nullishCoalesce(correlated_at, () => ( -1)));
|
|
737
549
|
keyed_at = at;
|
|
738
550
|
if (!held || held.until < now || held.by === correlator.by) {
|
|
739
551
|
correlating = true;
|
|
@@ -756,7 +568,7 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
|
|
|
756
568
|
stream,
|
|
757
569
|
source,
|
|
758
570
|
priority = 0,
|
|
759
|
-
lane =
|
|
571
|
+
lane = _chunk2377SSHXcjs.DEFAULT_LANE,
|
|
760
572
|
correlated_at: correlated_at2
|
|
761
573
|
} of streams) {
|
|
762
574
|
const existing = this._streams.get(stream);
|
|
@@ -783,11 +595,11 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
|
|
|
783
595
|
}
|
|
784
596
|
async ack(leases) {
|
|
785
597
|
await sleep();
|
|
786
|
-
return leases.map((l) => _optionalChain([this, 'access',
|
|
598
|
+
return leases.map((l) => _optionalChain([this, 'access', _21 => _21._streams, 'access', _22 => _22.get, 'call', _23 => _23(l.stream), 'optionalAccess', _24 => _24.ack, 'call', _25 => _25(l)])).filter((l) => !!l);
|
|
787
599
|
}
|
|
788
600
|
async block(leases) {
|
|
789
601
|
await sleep();
|
|
790
|
-
return leases.map((l) => _optionalChain([this, 'access',
|
|
602
|
+
return leases.map((l) => _optionalChain([this, 'access', _26 => _26._streams, 'access', _27 => _27.get, 'call', _28 => _28(l.stream), 'optionalAccess', _29 => _29.block, 'call', _30 => _30(l, l.error)])).filter((l) => !!l);
|
|
791
603
|
}
|
|
792
604
|
async defer(input, deferred_at) {
|
|
793
605
|
await sleep();
|
|
@@ -822,7 +634,7 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
|
|
|
822
634
|
}
|
|
823
635
|
async forget_pii(stream) {
|
|
824
636
|
await sleep();
|
|
825
|
-
const count = _nullishCoalesce(_optionalChain([this, 'access',
|
|
637
|
+
const count = _nullishCoalesce(_optionalChain([this, 'access', _31 => _31._pii, 'access', _32 => _32.get, 'call', _33 => _33(stream), 'optionalAccess', _34 => _34.size]), () => ( 0));
|
|
826
638
|
this._pii.delete(stream);
|
|
827
639
|
return count;
|
|
828
640
|
}
|
|
@@ -841,9 +653,9 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
|
|
|
841
653
|
}
|
|
842
654
|
async query_streams(callback, query) {
|
|
843
655
|
await sleep();
|
|
844
|
-
const limit = _nullishCoalesce(_optionalChain([query, 'optionalAccess',
|
|
845
|
-
const after = _optionalChain([query, 'optionalAccess',
|
|
846
|
-
const source_matches = _optionalChain([query, 'optionalAccess',
|
|
656
|
+
const limit = _nullishCoalesce(_optionalChain([query, 'optionalAccess', _35 => _35.limit]), () => ( _chunk2377SSHXcjs.DEFAULT_QUERY_STREAMS_LIMIT));
|
|
657
|
+
const after = _optionalChain([query, 'optionalAccess', _36 => _36.after]);
|
|
658
|
+
const source_matches = _optionalChain([query, 'optionalAccess', _37 => _37.source_matches]);
|
|
847
659
|
const matches = this._filter_predicate(_nullishCoalesce(query, () => ( {})));
|
|
848
660
|
const reverse_match = (source) => {
|
|
849
661
|
const re = new RegExp(source);
|
|
@@ -874,24 +686,24 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
|
|
|
874
686
|
});
|
|
875
687
|
count++;
|
|
876
688
|
}
|
|
877
|
-
return { maxEventId: _nullishCoalesce(_optionalChain([this, 'access',
|
|
689
|
+
return { maxEventId: _nullishCoalesce(_optionalChain([this, 'access', _38 => _38._events, 'access', _39 => _39.at, 'call', _40 => _40(-1), 'optionalAccess', _41 => _41.id]), () => ( -1)), count };
|
|
878
690
|
}
|
|
879
691
|
async query_stats(input, options) {
|
|
880
692
|
await sleep();
|
|
881
|
-
const exclude = new Set(_nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
882
|
-
const want_tail = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
883
|
-
const want_count = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
884
|
-
const want_names = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
885
|
-
const before = _optionalChain([options, 'optionalAccess',
|
|
886
|
-
const after = _optionalChain([options, 'optionalAccess',
|
|
887
|
-
const limit = _optionalChain([options, 'optionalAccess',
|
|
693
|
+
const exclude = new Set(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _42 => _42.exclude]), () => ( [])));
|
|
694
|
+
const want_tail = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _43 => _43.tail]), () => ( false));
|
|
695
|
+
const want_count = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _44 => _44.count]), () => ( false));
|
|
696
|
+
const want_names = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _45 => _45.names]), () => ( false));
|
|
697
|
+
const before = _optionalChain([options, 'optionalAccess', _46 => _46.before]);
|
|
698
|
+
const after = _optionalChain([options, 'optionalAccess', _47 => _47.after]);
|
|
699
|
+
const limit = _optionalChain([options, 'optionalAccess', _48 => _48.limit]);
|
|
888
700
|
const array_targets = Array.isArray(input) ? new Set(input) : null;
|
|
889
701
|
const stream_ok = !Array.isArray(input) && input.stream !== void 0 ? name_test(input.stream, input.stream_exact) : void 0;
|
|
890
702
|
const scope_cache = /* @__PURE__ */ new Map();
|
|
891
703
|
const in_scope = (stream) => {
|
|
892
704
|
const cached = scope_cache.get(stream);
|
|
893
705
|
if (cached !== void 0) return cached;
|
|
894
|
-
const ok = array_targets ? array_targets.has(stream) : _nullishCoalesce(_optionalChain([stream_ok, 'optionalCall',
|
|
706
|
+
const ok = array_targets ? array_targets.has(stream) : _nullishCoalesce(_optionalChain([stream_ok, 'optionalCall', _49 => _49(stream)]), () => ( true));
|
|
895
707
|
scope_cache.set(stream, ok);
|
|
896
708
|
return ok;
|
|
897
709
|
};
|
|
@@ -935,7 +747,7 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
|
|
|
935
747
|
for (const { stream, before, max_id } of windowed) {
|
|
936
748
|
let boundary;
|
|
937
749
|
for (const e of this._events) {
|
|
938
|
-
if (e.stream === stream && e.name ===
|
|
750
|
+
if (e.stream === stream && e.name === _chunk2377SSHXcjs.SNAP_EVENT && e.created < before && (max_id === void 0 || e.id <= max_id) && (!boundary || e.id > boundary.id))
|
|
939
751
|
boundary = e;
|
|
940
752
|
}
|
|
941
753
|
if (!boundary) continue;
|
|
@@ -943,7 +755,7 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
|
|
|
943
755
|
let deleted = 0;
|
|
944
756
|
this._events = this._events.filter((e) => {
|
|
945
757
|
if (e.stream !== stream || e.id >= below) return true;
|
|
946
|
-
_optionalChain([this, 'access',
|
|
758
|
+
_optionalChain([this, 'access', _50 => _50._pii, 'access', _51 => _51.get, 'call', _52 => _52(stream), 'optionalAccess', _53 => _53.delete, 'call', _54 => _54(e.id)]);
|
|
947
759
|
deleted++;
|
|
948
760
|
return false;
|
|
949
761
|
});
|
|
@@ -964,7 +776,7 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
|
|
|
964
776
|
stream,
|
|
965
777
|
version: 0,
|
|
966
778
|
created: /* @__PURE__ */ new Date(),
|
|
967
|
-
...
|
|
779
|
+
..._chunkHACJYR7Zcjs.seedEvent.call(void 0, snapshot, meta)
|
|
968
780
|
};
|
|
969
781
|
this._events.push(event);
|
|
970
782
|
this._stream_versions.set(stream, 0);
|
|
@@ -1044,6 +856,148 @@ var run_disposers = async () => {
|
|
|
1044
856
|
}
|
|
1045
857
|
};
|
|
1046
858
|
|
|
859
|
+
// src/internal/config.ts
|
|
860
|
+
|
|
861
|
+
var BackoffOptionsSchema = _zod.z.object({
|
|
862
|
+
strategy: _zod.z.enum(["fixed", "linear", "exponential"]),
|
|
863
|
+
baseMs: _zod.z.number().min(0),
|
|
864
|
+
maxMs: _zod.z.number().gt(0).optional(),
|
|
865
|
+
jitter: _zod.z.boolean().optional()
|
|
866
|
+
});
|
|
867
|
+
var DEFAULT_BACKOFF = {
|
|
868
|
+
strategy: "fixed",
|
|
869
|
+
baseMs: 1e4
|
|
870
|
+
};
|
|
871
|
+
var DEFAULT_MAX_RETRIES = 3;
|
|
872
|
+
var DEFAULT_BLOCK_ON_ERROR = true;
|
|
873
|
+
var ReactionOptionsSchema = _zod.z.object({
|
|
874
|
+
blockOnError: _zod.z.boolean(),
|
|
875
|
+
maxRetries: _zod.z.number().int().min(0),
|
|
876
|
+
backoff: BackoffOptionsSchema.optional()
|
|
877
|
+
});
|
|
878
|
+
function resolveReactionConfig(options) {
|
|
879
|
+
return ReactionOptionsSchema.parse(options);
|
|
880
|
+
}
|
|
881
|
+
var ActionOptionsSchema = _zod.z.object({
|
|
882
|
+
maxRetries: _zod.z.number().int().min(0).optional(),
|
|
883
|
+
backoff: BackoffOptionsSchema.optional()
|
|
884
|
+
});
|
|
885
|
+
function resolveActionConfig(options) {
|
|
886
|
+
return ActionOptionsSchema.parse(options);
|
|
887
|
+
}
|
|
888
|
+
var LaneConfigSchema = _zod.z.object({
|
|
889
|
+
name: _zod.z.string().min(1),
|
|
890
|
+
leaseMillis: _zod.z.number().min(0).optional(),
|
|
891
|
+
streamLimit: _zod.z.number().int().min(0).optional(),
|
|
892
|
+
cycleMs: _zod.z.number().min(0).optional()
|
|
893
|
+
});
|
|
894
|
+
function resolveLaneConfig(options) {
|
|
895
|
+
LaneConfigSchema.parse(options);
|
|
896
|
+
return options;
|
|
897
|
+
}
|
|
898
|
+
var DEFAULT_STREAM_LIMIT = 10;
|
|
899
|
+
var DEFAULT_EVENT_LIMIT = 10;
|
|
900
|
+
var DEFAULT_LEASE_MILLIS = 1e4;
|
|
901
|
+
var DrainOptionsSchema = _zod.z.object({
|
|
902
|
+
streamLimit: _zod.z.number().int().min(0).optional(),
|
|
903
|
+
eventLimit: _zod.z.number().int().min(0).optional(),
|
|
904
|
+
leaseMillis: _zod.z.number().min(0).optional()
|
|
905
|
+
});
|
|
906
|
+
function resolveDrainConfig(options) {
|
|
907
|
+
if (options === void 0) return void 0;
|
|
908
|
+
DrainOptionsSchema.parse(options);
|
|
909
|
+
return options;
|
|
910
|
+
}
|
|
911
|
+
var SettleOptionsSchema = DrainOptionsSchema.extend({
|
|
912
|
+
debounceMs: _zod.z.number().min(0).optional(),
|
|
913
|
+
// `maxPasses` defaults to Infinity (no cap) when omitted; a present value is
|
|
914
|
+
// a non-negative integer — `0` is legal and means "run no passes".
|
|
915
|
+
//
|
|
916
|
+
// `Infinity` is accepted explicitly. It is the documented default
|
|
917
|
+
// (`Act.settle`'s doc-comment and `SettleOptions.maxPasses` both name it),
|
|
918
|
+
// and `settle.ts` destructures `maxPasses = Infinity`, so the one value the
|
|
919
|
+
// docs advertise was the one value `z.number().int()` refused — Zod 4
|
|
920
|
+
// rejects `±Infinity`, and an integer check cannot pass it either. Wrapper
|
|
921
|
+
// code normalizing an optional cap (`maxPasses: opts.maxPasses ?? Infinity`)
|
|
922
|
+
// is the natural way to hit it. Accepting it also honors this module's own
|
|
923
|
+
// rule that a value which works today is never newly rejected.
|
|
924
|
+
maxPasses: _zod.z.union([_zod.z.number().int().min(0), _zod.z.literal(Number.POSITIVE_INFINITY)]).optional()
|
|
925
|
+
}).loose();
|
|
926
|
+
function resolveSettleConfig(options) {
|
|
927
|
+
if (options === void 0) return void 0;
|
|
928
|
+
SettleOptionsSchema.parse(options);
|
|
929
|
+
return options;
|
|
930
|
+
}
|
|
931
|
+
var MAX_SHUTDOWN_GRACE_MS = 3e4;
|
|
932
|
+
var ShutdownOptionsSchema = _zod.z.object({
|
|
933
|
+
// `0` is legal and is exactly today's behavior: stop scheduling and
|
|
934
|
+
// return without waiting.
|
|
935
|
+
graceMs: _zod.z.number().min(0).optional()
|
|
936
|
+
}).loose();
|
|
937
|
+
function resolveShutdownConfig(options) {
|
|
938
|
+
if (options === void 0) return void 0;
|
|
939
|
+
ShutdownOptionsSchema.parse(options);
|
|
940
|
+
return options;
|
|
941
|
+
}
|
|
942
|
+
var ActOptionsSchema = _zod.z.object({
|
|
943
|
+
maxSubscribedStreams: _zod.z.number().int().min(1).optional(),
|
|
944
|
+
settleDebounceMs: _zod.z.number().int().min(0).optional(),
|
|
945
|
+
autoSettle: _zod.z.boolean().optional()
|
|
946
|
+
}).loose();
|
|
947
|
+
function resolveActConfig(options) {
|
|
948
|
+
if (options === void 0) return void 0;
|
|
949
|
+
ActOptionsSchema.parse(options);
|
|
950
|
+
return options;
|
|
951
|
+
}
|
|
952
|
+
var DEFAULT_AUTOCLOSE_WINDOW_TZ = "UTC";
|
|
953
|
+
function is_valid_time_zone(tz) {
|
|
954
|
+
try {
|
|
955
|
+
new Intl.DateTimeFormat("en-US", { timeZone: tz });
|
|
956
|
+
return true;
|
|
957
|
+
} catch (e4) {
|
|
958
|
+
return false;
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
var AutocloseWindowSchema = _zod.z.object({
|
|
962
|
+
start: _zod.z.number().int().min(0).max(23, { message: "autocloseWindow.start must be an hour in [0, 23]" }),
|
|
963
|
+
end: _zod.z.number().int().min(0).max(23, { message: "autocloseWindow.end must be an hour in [0, 23]" }),
|
|
964
|
+
timeZone: _zod.z.string().refine(is_valid_time_zone, {
|
|
965
|
+
message: "autocloseWindow.timeZone must be a valid IANA time zone"
|
|
966
|
+
}).default(DEFAULT_AUTOCLOSE_WINDOW_TZ)
|
|
967
|
+
}).refine((w) => w.start !== w.end, {
|
|
968
|
+
message: "autocloseWindow.start and end must differ \u2014 an empty window disables autoclose"
|
|
969
|
+
});
|
|
970
|
+
var AutocloseOptionsSchema = _zod.z.object({
|
|
971
|
+
autocloseWindow: AutocloseWindowSchema.optional()
|
|
972
|
+
});
|
|
973
|
+
function resolveAutocloseConfig(options) {
|
|
974
|
+
return AutocloseOptionsSchema.parse({
|
|
975
|
+
autocloseWindow: _optionalChain([options, 'optionalAccess', _55 => _55.autocloseWindow])
|
|
976
|
+
});
|
|
977
|
+
}
|
|
978
|
+
var DEFAULT_CIRCUIT_FAILURE_THRESHOLD = 5;
|
|
979
|
+
var DEFAULT_CIRCUIT_COOLDOWN_MS = 3e4;
|
|
980
|
+
var CircuitBreakerOptionsSchema = _zod.z.object({
|
|
981
|
+
failureThreshold: _zod.z.number().int().min(1).default(DEFAULT_CIRCUIT_FAILURE_THRESHOLD),
|
|
982
|
+
cooldownMs: _zod.z.number().int().min(100).max(36e5).default(DEFAULT_CIRCUIT_COOLDOWN_MS)
|
|
983
|
+
});
|
|
984
|
+
var resolveCircuitBreakerConfig = (options) => CircuitBreakerOptionsSchema.parse(_nullishCoalesce(options, () => ( {})));
|
|
985
|
+
var DEFAULT_FOLD_FLUSH_EVERY = 1e3;
|
|
986
|
+
var DEFAULT_MAX_CACHED_STATES = 1e4;
|
|
987
|
+
var FoldOptionsSchema = _zod.z.object({
|
|
988
|
+
flushEvery: _zod.z.number().int().min(1).default(DEFAULT_FOLD_FLUSH_EVERY),
|
|
989
|
+
maxCachedStates: _zod.z.number().int().min(1).default(DEFAULT_MAX_CACHED_STATES)
|
|
990
|
+
});
|
|
991
|
+
function resolveFoldConfig(options) {
|
|
992
|
+
return FoldOptionsSchema.parse(options);
|
|
993
|
+
}
|
|
994
|
+
function check_store(store3) {
|
|
995
|
+
if (store3.commit.length === 4)
|
|
996
|
+
throw new Error(
|
|
997
|
+
"This store's commit takes (stream, msgs, meta, expectedVersion), the shape before @rotorsoft/act 2.0. Upgrade it, and every @rotorsoft/act-* package, together: https://rotorsoft.github.io/act-root/docs/guides/migrating-to-2.x"
|
|
998
|
+
);
|
|
999
|
+
}
|
|
1000
|
+
|
|
1047
1001
|
// src/scoped.ts
|
|
1048
1002
|
var _async_hooks = require('async_hooks');
|
|
1049
1003
|
var scoped = new (0, _async_hooks.AsyncLocalStorage)();
|
|
@@ -1106,7 +1060,7 @@ var _cache = port(function cache(adapter) {
|
|
|
1106
1060
|
var cache2 = ((adapter) => {
|
|
1107
1061
|
return _nullishCoalesce(_optionalChain([current_ports, 'call', _64 => _64(), 'optionalAccess', _65 => _65.cache]), () => ( _cache(adapter)));
|
|
1108
1062
|
});
|
|
1109
|
-
var
|
|
1063
|
+
var unscoped_ports = () => DEFAULT_SCOPE;
|
|
1110
1064
|
var DEFAULT_SCOPE = {
|
|
1111
1065
|
get store() {
|
|
1112
1066
|
return _store();
|
|
@@ -1136,7 +1090,7 @@ function dispose(disposer) {
|
|
|
1136
1090
|
}
|
|
1137
1091
|
|
|
1138
1092
|
// src/config.ts
|
|
1139
|
-
var
|
|
1093
|
+
var package_schema = _zod.z.object({
|
|
1140
1094
|
name: _zod.z.string().min(1),
|
|
1141
1095
|
version: _zod.z.string().min(1),
|
|
1142
1096
|
description: _zod.z.string().min(1).optional(),
|
|
@@ -1156,7 +1110,7 @@ var get_package = () => {
|
|
|
1156
1110
|
name: FALLBACK_PACKAGE.name,
|
|
1157
1111
|
version: FALLBACK_PACKAGE.version
|
|
1158
1112
|
};
|
|
1159
|
-
for (const [key, schema] of Object.entries(
|
|
1113
|
+
for (const [key, schema] of Object.entries(package_schema.shape)) {
|
|
1160
1114
|
const field = schema.safeParse(_optionalChain([raw, 'optionalAccess', _66 => _66[key]]));
|
|
1161
1115
|
if (field.success && field.data !== void 0) pkg2[key] = field.data;
|
|
1162
1116
|
}
|
|
@@ -1167,9 +1121,9 @@ var get_package = () => {
|
|
|
1167
1121
|
}
|
|
1168
1122
|
};
|
|
1169
1123
|
var pkg_load_error;
|
|
1170
|
-
var BaseSchema =
|
|
1171
|
-
env: _zod.z.enum(
|
|
1172
|
-
logLevel: _zod.z.enum(
|
|
1124
|
+
var BaseSchema = package_schema.extend({
|
|
1125
|
+
env: _zod.z.enum(_chunk2377SSHXcjs.Environments),
|
|
1126
|
+
logLevel: _zod.z.enum(_chunk2377SSHXcjs.LogLevels),
|
|
1173
1127
|
logSingleLine: _zod.z.boolean(),
|
|
1174
1128
|
sleepMs: _zod.z.number().int().min(0).max(5e3)
|
|
1175
1129
|
});
|
|
@@ -1182,7 +1136,8 @@ var pkg = get_package();
|
|
|
1182
1136
|
var _validated;
|
|
1183
1137
|
var config = () => {
|
|
1184
1138
|
if (!_validated) {
|
|
1185
|
-
_validated =
|
|
1139
|
+
_validated = validate(
|
|
1140
|
+
"config",
|
|
1186
1141
|
{ ...pkg, env, logLevel, logSingleLine, sleepMs },
|
|
1187
1142
|
BaseSchema
|
|
1188
1143
|
);
|
|
@@ -1196,20 +1151,6 @@ var config = () => {
|
|
|
1196
1151
|
}
|
|
1197
1152
|
return _validated;
|
|
1198
1153
|
};
|
|
1199
|
-
function resolveAutocloseConfig2(options) {
|
|
1200
|
-
return resolveAutocloseConfig(options);
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
1154
|
|
|
1214
1155
|
|
|
1215
1156
|
|
|
@@ -1250,5 +1191,5 @@ function resolveAutocloseConfig2(options) {
|
|
|
1250
1191
|
|
|
1251
1192
|
|
|
1252
1193
|
|
|
1253
|
-
exports.ConsoleLogger = ConsoleLogger; exports.LruMap = LruMap; exports.InMemoryCache = InMemoryCache; exports.
|
|
1254
|
-
//# sourceMappingURL=chunk-
|
|
1194
|
+
exports.ConsoleLogger = ConsoleLogger; exports.LruMap = LruMap; exports.InMemoryCache = InMemoryCache; exports.package_schema = package_schema; exports.config = config; exports.validate = validate; exports.sleep = sleep; exports.InMemoryStore = InMemoryStore; exports.register_weak_disposer = register_weak_disposer; exports.DEFAULT_BACKOFF = DEFAULT_BACKOFF; exports.DEFAULT_MAX_RETRIES = DEFAULT_MAX_RETRIES; exports.DEFAULT_BLOCK_ON_ERROR = DEFAULT_BLOCK_ON_ERROR; exports.resolveReactionConfig = resolveReactionConfig; exports.resolveActionConfig = resolveActionConfig; exports.resolveLaneConfig = resolveLaneConfig; exports.DEFAULT_STREAM_LIMIT = DEFAULT_STREAM_LIMIT; exports.DEFAULT_EVENT_LIMIT = DEFAULT_EVENT_LIMIT; exports.DEFAULT_LEASE_MILLIS = DEFAULT_LEASE_MILLIS; exports.resolveDrainConfig = resolveDrainConfig; exports.resolveSettleConfig = resolveSettleConfig; exports.MAX_SHUTDOWN_GRACE_MS = MAX_SHUTDOWN_GRACE_MS; exports.resolveShutdownConfig = resolveShutdownConfig; exports.resolveActConfig = resolveActConfig; exports.resolveAutocloseConfig = resolveAutocloseConfig; exports.resolveCircuitBreakerConfig = resolveCircuitBreakerConfig; exports.resolveFoldConfig = resolveFoldConfig; exports.check_store = check_store; exports.make_run_scoped = make_run_scoped; exports.current_autoclose_window = current_autoclose_window; exports.current_reacting = current_reacting; exports.make_reaction_scope = make_reaction_scope; exports.port = port; exports.log = log; exports.store = store2; exports.cache = cache2; exports.unscoped_ports = unscoped_ports; exports.disposeAndExit = disposeAndExit; exports.dispose = dispose;
|
|
1195
|
+
//# sourceMappingURL=chunk-VOVHDDET.cjs.map
|