@rotorsoft/act 2.1.12 → 2.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/@types/act.d.ts.map +1 -1
- package/dist/@types/builders/act-builder.d.ts.map +1 -1
- package/dist/@types/builders/event-builder.d.ts +7 -3
- package/dist/@types/builders/event-builder.d.ts.map +1 -1
- package/dist/@types/builders/merge.d.ts.map +1 -1
- package/dist/@types/deprecated.d.ts +10 -0
- package/dist/@types/deprecated.d.ts.map +1 -1
- package/dist/@types/index.d.ts +2 -3
- package/dist/@types/index.d.ts.map +1 -1
- package/dist/@types/internal/audit.d.ts +2 -0
- package/dist/@types/internal/audit.d.ts.map +1 -1
- package/dist/@types/internal/config.d.ts +9 -0
- package/dist/@types/internal/config.d.ts.map +1 -1
- package/dist/@types/internal/pii.d.ts +1 -1
- package/dist/@types/{sensitive.d.ts → internal/sensitive.d.ts} +0 -24
- package/dist/@types/internal/sensitive.d.ts.map +1 -0
- package/dist/@types/ports.d.ts +0 -5
- package/dist/@types/ports.d.ts.map +1 -1
- package/dist/@types/types/action-rules.d.ts +177 -0
- package/dist/@types/types/action-rules.d.ts.map +1 -0
- package/dist/@types/types/builders.d.ts +15 -311
- package/dist/@types/types/builders.d.ts.map +1 -1
- package/dist/@types/types/ports.d.ts +1 -1
- package/dist/@types/types/projection.d.ts +135 -0
- package/dist/@types/types/projection.d.ts.map +1 -0
- package/dist/@types/types/registry.d.ts +7 -4
- package/dist/@types/types/registry.d.ts.map +1 -1
- package/dist/@types/types/schemas.d.ts +0 -1
- package/dist/@types/types/schemas.d.ts.map +1 -1
- package/dist/adapter.cjs +3 -3
- package/dist/adapter.js +2 -2
- package/dist/{chunk-SC6TY4P2.cjs → chunk-DCWPJFXR.cjs} +12 -4
- package/dist/chunk-DCWPJFXR.cjs.map +1 -0
- package/dist/{chunk-RV34EYSN.js → chunk-EIGZVFT7.js} +11 -3
- package/dist/{chunk-RV34EYSN.js.map → chunk-EIGZVFT7.js.map} +1 -1
- package/dist/{chunk-BQUOIHOR.js → chunk-GDPBPAML.js} +31 -87
- package/dist/chunk-GDPBPAML.js.map +1 -0
- package/dist/{chunk-Y2ISPWQL.js → chunk-SCH4GLWM.js} +78 -42
- package/dist/{chunk-Y2ISPWQL.js.map → chunk-SCH4GLWM.js.map} +1 -1
- package/dist/chunk-UEGKXCSQ.cjs +247 -0
- package/dist/chunk-UEGKXCSQ.cjs.map +1 -0
- package/dist/{chunk-N74AN6L5.cjs → chunk-WDIBO6AW.cjs} +91 -55
- package/dist/chunk-WDIBO6AW.cjs.map +1 -0
- package/dist/index.cjs +685 -454
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +428 -197
- package/dist/index.js.map +1 -1
- package/dist/test/index.cjs +13 -9
- package/dist/test/index.cjs.map +1 -1
- package/dist/test/index.js +11 -7
- package/dist/test/index.js.map +1 -1
- package/dist/types/index.cjs +2 -6
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.js +3 -7
- package/package.json +1 -1
- package/dist/@types/sensitive.d.ts.map +0 -1
- package/dist/chunk-BQUOIHOR.js.map +0 -1
- package/dist/chunk-N74AN6L5.cjs.map +0 -1
- package/dist/chunk-SC6TY4P2.cjs.map +0 -1
- package/dist/chunk-ZTHGF62O.cjs +0 -303
- package/dist/chunk-ZTHGF62O.cjs.map +0 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkDCWPJFXRcjs = require('./chunk-DCWPJFXR.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -11,7 +11,8 @@ var _chunkSC6TY4P2cjs = require('./chunk-SC6TY4P2.cjs');
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
var _chunkUEGKXCSQcjs = require('./chunk-UEGKXCSQ.cjs');
|
|
15
16
|
|
|
16
17
|
// src/adapters/console-logger.ts
|
|
17
18
|
var LEVEL_VALUES = {
|
|
@@ -37,9 +38,12 @@ var LEVEL_COLORS = {
|
|
|
37
38
|
// gray
|
|
38
39
|
};
|
|
39
40
|
var RESET = "\x1B[0m";
|
|
40
|
-
var noop = () => {
|
|
41
|
-
};
|
|
41
|
+
var noop = /* @__PURE__ */ _chunkUEGKXCSQcjs.__name.call(void 0, () => {
|
|
42
|
+
}, "noop");
|
|
42
43
|
var ConsoleLogger = class _ConsoleLogger {
|
|
44
|
+
static {
|
|
45
|
+
_chunkUEGKXCSQcjs.__name.call(void 0, this, "ConsoleLogger");
|
|
46
|
+
}
|
|
43
47
|
|
|
44
48
|
|
|
45
49
|
|
|
@@ -139,6 +143,9 @@ var ConsoleLogger = class _ConsoleLogger {
|
|
|
139
143
|
|
|
140
144
|
// src/internal/lru-map.ts
|
|
141
145
|
var LruMap = (_class = class {
|
|
146
|
+
static {
|
|
147
|
+
_chunkUEGKXCSQcjs.__name.call(void 0, this, "LruMap");
|
|
148
|
+
}
|
|
142
149
|
__init() {this._entries = /* @__PURE__ */ new Map()}
|
|
143
150
|
|
|
144
151
|
constructor(maxSize) {;_class.prototype.__init.call(this);
|
|
@@ -175,6 +182,9 @@ var LruMap = (_class = class {
|
|
|
175
182
|
|
|
176
183
|
// src/adapters/in-memory-cache.ts
|
|
177
184
|
var InMemoryCache = class {
|
|
185
|
+
static {
|
|
186
|
+
_chunkUEGKXCSQcjs.__name.call(void 0, this, "InMemoryCache");
|
|
187
|
+
}
|
|
178
188
|
// CacheEntry<any> lets `get<TState>` and `set<TState>` flow without casts:
|
|
179
189
|
// any is bidirectionally compatible with the per-call TState binding, while
|
|
180
190
|
// the public Cache interface still presents a typed surface to callers.
|
|
@@ -214,22 +224,26 @@ var _zod = require('zod');
|
|
|
214
224
|
|
|
215
225
|
// src/utils.ts
|
|
216
226
|
|
|
217
|
-
var validate = (target, payload, schema) => {
|
|
227
|
+
var validate = /* @__PURE__ */ _chunkUEGKXCSQcjs.__name.call(void 0, (target, payload, schema) => {
|
|
218
228
|
try {
|
|
219
229
|
return schema ? schema.parse(payload) : payload;
|
|
220
230
|
} catch (error) {
|
|
221
231
|
if (error instanceof _zod.ZodError) {
|
|
222
|
-
throw new (0,
|
|
232
|
+
throw new (0, _chunkUEGKXCSQcjs.ValidationError)(target, payload, _zod.prettifyError.call(void 0, error));
|
|
223
233
|
}
|
|
224
|
-
throw new (0,
|
|
234
|
+
throw new (0, _chunkUEGKXCSQcjs.ValidationError)(target, payload, error);
|
|
225
235
|
}
|
|
226
|
-
};
|
|
236
|
+
}, "validate");
|
|
227
237
|
async function sleep(ms) {
|
|
228
238
|
return new Promise((resolve) => setTimeout(resolve, _nullishCoalesce(ms, () => ( config().sleepMs))));
|
|
229
239
|
}
|
|
240
|
+
_chunkUEGKXCSQcjs.__name.call(void 0, sleep, "sleep");
|
|
230
241
|
|
|
231
242
|
// src/adapters/in-memory-store.ts
|
|
232
243
|
var InMemoryStream = (_class2 = class {
|
|
244
|
+
static {
|
|
245
|
+
_chunkUEGKXCSQcjs.__name.call(void 0, this, "InMemoryStream");
|
|
246
|
+
}
|
|
233
247
|
|
|
234
248
|
|
|
235
249
|
__init2() {this._at = -1}
|
|
@@ -244,7 +258,7 @@ var InMemoryStream = (_class2 = class {
|
|
|
244
258
|
__init8() {this._deferred_at = void 0}
|
|
245
259
|
// Work mark; `undefined` = never correlated, so `claim` skips it.
|
|
246
260
|
__init9() {this._correlated_at = void 0}
|
|
247
|
-
constructor(stream, source, priority = 0, lane =
|
|
261
|
+
constructor(stream, source, priority = 0, lane = _chunkUEGKXCSQcjs.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);
|
|
248
262
|
this.stream = stream;
|
|
249
263
|
this.source = source;
|
|
250
264
|
this._priority = priority;
|
|
@@ -371,12 +385,15 @@ var InMemoryStream = (_class2 = class {
|
|
|
371
385
|
return true;
|
|
372
386
|
}
|
|
373
387
|
}, _class2);
|
|
374
|
-
var name_test = (pattern, exact) => {
|
|
388
|
+
var name_test = /* @__PURE__ */ _chunkUEGKXCSQcjs.__name.call(void 0, (pattern, exact) => {
|
|
375
389
|
if (exact) return (name) => name === pattern;
|
|
376
390
|
const re = new RegExp(pattern);
|
|
377
391
|
return (name) => re.test(name);
|
|
378
|
-
};
|
|
392
|
+
}, "name_test");
|
|
379
393
|
var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10.call(this);_class3.prototype.__init11.call(this);_class3.prototype.__init12.call(this);_class3.prototype.__init13.call(this);_class3.prototype.__init14.call(this);_class3.prototype.__init15.call(this);_class3.prototype.__init16.call(this); }
|
|
394
|
+
static {
|
|
395
|
+
_chunkUEGKXCSQcjs.__name.call(void 0, this, "InMemoryStore");
|
|
396
|
+
}
|
|
380
397
|
__init10() {this._events = []}
|
|
381
398
|
// Never reused. Deletions punch holes, so ids are not array indexes.
|
|
382
399
|
__init11() {this._next_id = 0}
|
|
@@ -441,7 +458,7 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
|
|
|
441
458
|
if (query.names && !query.names.includes(e.name)) return false;
|
|
442
459
|
if (query.correlation && _optionalChain([e, 'access', _7 => _7.meta, 'optionalAccess', _8 => _8.correlation]) !== query.correlation)
|
|
443
460
|
return false;
|
|
444
|
-
if (e.name ===
|
|
461
|
+
if (e.name === _chunkUEGKXCSQcjs.SNAP_EVENT && !query.with_snaps) return false;
|
|
445
462
|
if (query.created_after && e.created <= query.created_after) return false;
|
|
446
463
|
if (query.created_before && e.created >= query.created_before)
|
|
447
464
|
return false;
|
|
@@ -454,7 +471,7 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
|
|
|
454
471
|
return -1;
|
|
455
472
|
for (let j = this._events.length - 1; j >= 0; j--) {
|
|
456
473
|
const e = this._events[j];
|
|
457
|
-
if (e.stream === query.stream && e.name ===
|
|
474
|
+
if (e.stream === query.stream && e.name === _chunkUEGKXCSQcjs.SNAP_EVENT) return j;
|
|
458
475
|
}
|
|
459
476
|
return -1;
|
|
460
477
|
}
|
|
@@ -479,9 +496,9 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
|
|
|
479
496
|
}
|
|
480
497
|
async commit(appends, meta) {
|
|
481
498
|
await sleep();
|
|
482
|
-
|
|
499
|
+
_chunkDCWPJFXRcjs.checkAppends.call(void 0, appends);
|
|
483
500
|
for (const append of appends)
|
|
484
|
-
|
|
501
|
+
_chunkDCWPJFXRcjs.checkVersion.call(void 0, append, _nullishCoalesce(this._stream_versions.get(append.stream), () => ( -1)));
|
|
485
502
|
const created = /* @__PURE__ */ new Date();
|
|
486
503
|
return appends.flatMap(({ stream, msgs }) => {
|
|
487
504
|
let version = _nullishCoalesce(this._stream_versions.get(stream), () => ( -1));
|
|
@@ -505,11 +522,11 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
|
|
|
505
522
|
}
|
|
506
523
|
async claim(lagging, leading, by, millis, lane) {
|
|
507
524
|
await sleep();
|
|
508
|
-
const has_work = (s) => s.correlated_at !== void 0 && s.at < s.correlated_at;
|
|
525
|
+
const has_work = /* @__PURE__ */ _chunkUEGKXCSQcjs.__name.call(void 0, (s) => s.correlated_at !== void 0 && s.at < s.correlated_at, "has_work");
|
|
509
526
|
const available = [...this._streams.values()].filter(
|
|
510
527
|
(s) => s.is_available && has_work(s) && (lane === void 0 || s.lane === lane)
|
|
511
528
|
);
|
|
512
|
-
const fair =
|
|
529
|
+
const fair = _chunkDCWPJFXRcjs.fairSlots.call(void 0, lagging);
|
|
513
530
|
const by_priority = [...available].sort(
|
|
514
531
|
(a, b) => b.priority - a.priority || a.at - b.at
|
|
515
532
|
);
|
|
@@ -568,7 +585,7 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
|
|
|
568
585
|
stream,
|
|
569
586
|
source,
|
|
570
587
|
priority = 0,
|
|
571
|
-
lane =
|
|
588
|
+
lane = _chunkUEGKXCSQcjs.DEFAULT_LANE,
|
|
572
589
|
correlated_at: correlated_at2
|
|
573
590
|
} of streams) {
|
|
574
591
|
const existing = this._streams.get(stream);
|
|
@@ -653,14 +670,14 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
|
|
|
653
670
|
}
|
|
654
671
|
async query_streams(callback, query) {
|
|
655
672
|
await sleep();
|
|
656
|
-
const limit = _nullishCoalesce(_optionalChain([query, 'optionalAccess', _35 => _35.limit]), () => (
|
|
673
|
+
const limit = _nullishCoalesce(_optionalChain([query, 'optionalAccess', _35 => _35.limit]), () => ( _chunkUEGKXCSQcjs.DEFAULT_QUERY_STREAMS_LIMIT));
|
|
657
674
|
const after = _optionalChain([query, 'optionalAccess', _36 => _36.after]);
|
|
658
675
|
const source_matches = _optionalChain([query, 'optionalAccess', _37 => _37.source_matches]);
|
|
659
676
|
const matches = this._filter_predicate(_nullishCoalesce(query, () => ( {})));
|
|
660
|
-
const reverse_match = (source) => {
|
|
677
|
+
const reverse_match = /* @__PURE__ */ _chunkUEGKXCSQcjs.__name.call(void 0, (source) => {
|
|
661
678
|
const re = new RegExp(source);
|
|
662
679
|
return source_matches.some((name) => re.test(name));
|
|
663
|
-
};
|
|
680
|
+
}, "reverse_match");
|
|
664
681
|
const sorted = [...this._streams.keys()].sort().map((stream) => this._streams.get(stream));
|
|
665
682
|
let count = 0;
|
|
666
683
|
for (const s of sorted) {
|
|
@@ -700,13 +717,13 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
|
|
|
700
717
|
const array_targets = Array.isArray(input) ? new Set(input) : null;
|
|
701
718
|
const stream_ok = !Array.isArray(input) && input.stream !== void 0 ? name_test(input.stream, input.stream_exact) : void 0;
|
|
702
719
|
const scope_cache = /* @__PURE__ */ new Map();
|
|
703
|
-
const in_scope = (stream) => {
|
|
720
|
+
const in_scope = /* @__PURE__ */ _chunkUEGKXCSQcjs.__name.call(void 0, (stream) => {
|
|
704
721
|
const cached = scope_cache.get(stream);
|
|
705
722
|
if (cached !== void 0) return cached;
|
|
706
723
|
const ok = array_targets ? array_targets.has(stream) : _nullishCoalesce(_optionalChain([stream_ok, 'optionalCall', _49 => _49(stream)]), () => ( true));
|
|
707
724
|
scope_cache.set(stream, ok);
|
|
708
725
|
return ok;
|
|
709
|
-
};
|
|
726
|
+
}, "in_scope");
|
|
710
727
|
const acc = /* @__PURE__ */ new Map();
|
|
711
728
|
for (const e of this._events) {
|
|
712
729
|
if (before !== void 0 && e.id >= before) continue;
|
|
@@ -747,7 +764,7 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
|
|
|
747
764
|
for (const { stream, before, max_id } of windowed) {
|
|
748
765
|
let boundary;
|
|
749
766
|
for (const e of this._events) {
|
|
750
|
-
if (e.stream === stream && e.name ===
|
|
767
|
+
if (e.stream === stream && e.name === _chunkUEGKXCSQcjs.SNAP_EVENT && e.created < before && (max_id === void 0 || e.id <= max_id) && (!boundary || e.id > boundary.id))
|
|
751
768
|
boundary = e;
|
|
752
769
|
}
|
|
753
770
|
if (!boundary) continue;
|
|
@@ -776,7 +793,7 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
|
|
|
776
793
|
stream,
|
|
777
794
|
version: 0,
|
|
778
795
|
created: /* @__PURE__ */ new Date(),
|
|
779
|
-
...
|
|
796
|
+
..._chunkDCWPJFXRcjs.seedEvent.call(void 0, snapshot, meta)
|
|
780
797
|
};
|
|
781
798
|
this._events.push(event);
|
|
782
799
|
this._stream_versions.set(stream, 0);
|
|
@@ -828,24 +845,24 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
|
|
|
828
845
|
|
|
829
846
|
// src/disposers.ts
|
|
830
847
|
var entries = [];
|
|
831
|
-
var prune = () => {
|
|
848
|
+
var prune = /* @__PURE__ */ _chunkUEGKXCSQcjs.__name.call(void 0, () => {
|
|
832
849
|
for (let i = entries.length - 1; i >= 0; i--) {
|
|
833
850
|
const { ref } = entries[i];
|
|
834
851
|
if (ref && !ref.deref()) entries.splice(i, 1);
|
|
835
852
|
}
|
|
836
|
-
};
|
|
837
|
-
var register_disposer = (run) => {
|
|
853
|
+
}, "prune");
|
|
854
|
+
var register_disposer = /* @__PURE__ */ _chunkUEGKXCSQcjs.__name.call(void 0, (run) => {
|
|
838
855
|
prune();
|
|
839
856
|
entries.push({ run });
|
|
840
|
-
};
|
|
841
|
-
var register_weak_disposer = (ref, run) => {
|
|
857
|
+
}, "register_disposer");
|
|
858
|
+
var register_weak_disposer = /* @__PURE__ */ _chunkUEGKXCSQcjs.__name.call(void 0, (ref, run) => {
|
|
842
859
|
prune();
|
|
843
860
|
entries.push({
|
|
844
861
|
run,
|
|
845
862
|
ref
|
|
846
863
|
});
|
|
847
|
-
};
|
|
848
|
-
var run_disposers = async () => {
|
|
864
|
+
}, "register_weak_disposer");
|
|
865
|
+
var run_disposers = /* @__PURE__ */ _chunkUEGKXCSQcjs.__name.call(void 0, async () => {
|
|
849
866
|
for (const { run, ref } of [...entries].reverse()) {
|
|
850
867
|
if (!ref) {
|
|
851
868
|
await run();
|
|
@@ -854,7 +871,7 @@ var run_disposers = async () => {
|
|
|
854
871
|
const target = ref.deref();
|
|
855
872
|
if (target) await run(target);
|
|
856
873
|
}
|
|
857
|
-
};
|
|
874
|
+
}, "run_disposers");
|
|
858
875
|
|
|
859
876
|
// src/internal/config.ts
|
|
860
877
|
|
|
@@ -899,6 +916,11 @@ var LaneConfigSchema = _zod.z.object({
|
|
|
899
916
|
streamLimit: _zod.z.number().int().min(0).optional(),
|
|
900
917
|
cycleMs: _zod.z.number().min(0).optional()
|
|
901
918
|
});
|
|
919
|
+
var LimitSchema = _zod.z.number().int().min(0).optional();
|
|
920
|
+
var PageOptionsSchema = _zod.z.object({ limit: LimitSchema });
|
|
921
|
+
var PollOptionsSchema = _zod.z.object({
|
|
922
|
+
frequency: _zod.z.number().min(0).max(2147483647)
|
|
923
|
+
});
|
|
902
924
|
var DEFAULT_STREAM_LIMIT = 10;
|
|
903
925
|
var DEFAULT_EVENT_LIMIT = 10;
|
|
904
926
|
var DEFAULT_LEASE_MILLIS = 1e4;
|
|
@@ -909,6 +931,7 @@ var DrainOptionsSchema = _zod.z.object({
|
|
|
909
931
|
});
|
|
910
932
|
var SettleOptionsSchema = DrainOptionsSchema.extend({
|
|
911
933
|
debounceMs: _zod.z.number().min(0).optional(),
|
|
934
|
+
correlate: PageOptionsSchema.optional(),
|
|
912
935
|
// `0` runs no passes; `Infinity` is the documented default (no cap), which
|
|
913
936
|
// an integer check alone would refuse.
|
|
914
937
|
maxPasses: _zod.z.union([_zod.z.number().int().min(0), _zod.z.literal(Number.POSITIVE_INFINITY)]).optional()
|
|
@@ -930,9 +953,10 @@ function is_time_zone(tz) {
|
|
|
930
953
|
return false;
|
|
931
954
|
}
|
|
932
955
|
}
|
|
933
|
-
|
|
956
|
+
_chunkUEGKXCSQcjs.__name.call(void 0, is_time_zone, "is_time_zone");
|
|
957
|
+
var hour = /* @__PURE__ */ _chunkUEGKXCSQcjs.__name.call(void 0, (field) => _zod.z.number().int().min(0).max(23, {
|
|
934
958
|
message: `autocloseWindow.${field} must be an hour in [0, 23]`
|
|
935
|
-
});
|
|
959
|
+
}), "hour");
|
|
936
960
|
var AutocloseOptionsSchema = _zod.z.object({
|
|
937
961
|
autocloseWindow: _zod.z.object({
|
|
938
962
|
start: hour("start"),
|
|
@@ -964,11 +988,11 @@ var DeferWhenSchema = _zod.z.object({
|
|
|
964
988
|
}).strict().refine((w) => w.after === void 0 !== (w.at === void 0), {
|
|
965
989
|
message: "defer: specify exactly one of `after` or `at`"
|
|
966
990
|
});
|
|
967
|
-
var window_schema = (field, min_days, floor) => _zod.z.object({
|
|
991
|
+
var window_schema = /* @__PURE__ */ _chunkUEGKXCSQcjs.__name.call(void 0, (field, min_days, floor) => _zod.z.object({
|
|
968
992
|
days: _zod.z.number({ message: `autocloses: ${field}.days must be a number` }).positive(`autocloses: ${field}.days must be > 0`)
|
|
969
993
|
}).refine((o) => o.days >= min_days, {
|
|
970
994
|
message: `autocloses: ${field} resolves to < ${floor}, which is too short to be a meaningful retention window`
|
|
971
|
-
});
|
|
995
|
+
}), "window_schema");
|
|
972
996
|
var AfterSchema = window_schema("after", 1 / 1440, "one minute");
|
|
973
997
|
var IsSchema = _zod.z.union([
|
|
974
998
|
_zod.z.string().min(1, "autocloses: is must be a non-empty event name"),
|
|
@@ -1018,6 +1042,8 @@ var SCHEMAS = {
|
|
|
1018
1042
|
drain: DrainOptionsSchema,
|
|
1019
1043
|
fold: FoldOptionsSchema,
|
|
1020
1044
|
lane: LaneConfigSchema,
|
|
1045
|
+
page: PageOptionsSchema,
|
|
1046
|
+
poll: PollOptionsSchema,
|
|
1021
1047
|
reaction: ReactionOptionsSchema,
|
|
1022
1048
|
scan: ScanOptionsSchema,
|
|
1023
1049
|
settle: SettleOptionsSchema,
|
|
@@ -1028,6 +1054,7 @@ var SCHEMAS = {
|
|
|
1028
1054
|
function check(kind, options) {
|
|
1029
1055
|
return SCHEMAS[kind].parse(options);
|
|
1030
1056
|
}
|
|
1057
|
+
_chunkUEGKXCSQcjs.__name.call(void 0, check, "check");
|
|
1031
1058
|
|
|
1032
1059
|
// src/scoped.ts
|
|
1033
1060
|
var _async_hooks = require('async_hooks');
|
|
@@ -1036,12 +1063,15 @@ var reacting = new (0, _async_hooks.AsyncLocalStorage)();
|
|
|
1036
1063
|
function make_run_scoped(bag) {
|
|
1037
1064
|
return (fn) => scoped.run(bag, fn);
|
|
1038
1065
|
}
|
|
1066
|
+
_chunkUEGKXCSQcjs.__name.call(void 0, make_run_scoped, "make_run_scoped");
|
|
1039
1067
|
function current_autoclose_window() {
|
|
1040
1068
|
return _optionalChain([scoped, 'access', _55 => _55.getStore, 'call', _56 => _56(), 'optionalAccess', _57 => _57.autoclose_window]);
|
|
1041
1069
|
}
|
|
1070
|
+
_chunkUEGKXCSQcjs.__name.call(void 0, current_autoclose_window, "current_autoclose_window");
|
|
1042
1071
|
function current_ports() {
|
|
1043
1072
|
return scoped.getStore();
|
|
1044
1073
|
}
|
|
1074
|
+
_chunkUEGKXCSQcjs.__name.call(void 0, current_ports, "current_ports");
|
|
1045
1075
|
function run_reacting(event, fn) {
|
|
1046
1076
|
const box = { event };
|
|
1047
1077
|
return reacting.run(box, async () => {
|
|
@@ -1052,12 +1082,15 @@ function run_reacting(event, fn) {
|
|
|
1052
1082
|
}
|
|
1053
1083
|
});
|
|
1054
1084
|
}
|
|
1085
|
+
_chunkUEGKXCSQcjs.__name.call(void 0, run_reacting, "run_reacting");
|
|
1055
1086
|
function current_reacting() {
|
|
1056
1087
|
return _optionalChain([reacting, 'access', _58 => _58.getStore, 'call', _59 => _59(), 'optionalAccess', _60 => _60.event]);
|
|
1057
1088
|
}
|
|
1089
|
+
_chunkUEGKXCSQcjs.__name.call(void 0, current_reacting, "current_reacting");
|
|
1058
1090
|
function make_reaction_scope(app) {
|
|
1059
1091
|
return { app, run: run_reacting };
|
|
1060
1092
|
}
|
|
1093
|
+
_chunkUEGKXCSQcjs.__name.call(void 0, make_reaction_scope, "make_reaction_scope");
|
|
1061
1094
|
|
|
1062
1095
|
// src/ports.ts
|
|
1063
1096
|
var adapters = /* @__PURE__ */ new Map();
|
|
@@ -1071,27 +1104,28 @@ function port(injector) {
|
|
|
1071
1104
|
return adapters.get(injector.name);
|
|
1072
1105
|
};
|
|
1073
1106
|
}
|
|
1074
|
-
|
|
1107
|
+
_chunkUEGKXCSQcjs.__name.call(void 0, port, "port");
|
|
1108
|
+
var log = port(/* @__PURE__ */ _chunkUEGKXCSQcjs.__name.call(void 0, function log2(adapter) {
|
|
1075
1109
|
const cfg = config();
|
|
1076
1110
|
return adapter || new ConsoleLogger({
|
|
1077
1111
|
level: cfg.logLevel,
|
|
1078
1112
|
pretty: cfg.env !== "production"
|
|
1079
1113
|
});
|
|
1080
|
-
});
|
|
1081
|
-
var _store = port(function store(adapter) {
|
|
1114
|
+
}, "log"));
|
|
1115
|
+
var _store = port(/* @__PURE__ */ _chunkUEGKXCSQcjs.__name.call(void 0, function store(adapter) {
|
|
1082
1116
|
if (adapter) check("store", adapter);
|
|
1083
1117
|
return _nullishCoalesce(adapter, () => ( new InMemoryStore()));
|
|
1084
|
-
});
|
|
1085
|
-
var store2 = ((adapter) => {
|
|
1118
|
+
}, "store"));
|
|
1119
|
+
var store2 = /* @__PURE__ */ _chunkUEGKXCSQcjs.__name.call(void 0, ((adapter) => {
|
|
1086
1120
|
return _nullishCoalesce(_optionalChain([current_ports, 'call', _61 => _61(), 'optionalAccess', _62 => _62.store]), () => ( _store(adapter)));
|
|
1087
|
-
});
|
|
1088
|
-
var _cache = port(function cache(adapter) {
|
|
1121
|
+
}), "store");
|
|
1122
|
+
var _cache = port(/* @__PURE__ */ _chunkUEGKXCSQcjs.__name.call(void 0, function cache(adapter) {
|
|
1089
1123
|
return _nullishCoalesce(adapter, () => ( new InMemoryCache()));
|
|
1090
|
-
});
|
|
1091
|
-
var cache2 = ((adapter) => {
|
|
1124
|
+
}, "cache"));
|
|
1125
|
+
var cache2 = /* @__PURE__ */ _chunkUEGKXCSQcjs.__name.call(void 0, ((adapter) => {
|
|
1092
1126
|
return _nullishCoalesce(_optionalChain([current_ports, 'call', _63 => _63(), 'optionalAccess', _64 => _64.cache]), () => ( _cache(adapter)));
|
|
1093
|
-
});
|
|
1094
|
-
var unscoped_ports = () => DEFAULT_SCOPE;
|
|
1127
|
+
}), "cache");
|
|
1128
|
+
var unscoped_ports = /* @__PURE__ */ _chunkUEGKXCSQcjs.__name.call(void 0, () => DEFAULT_SCOPE, "unscoped_ports");
|
|
1095
1129
|
var DEFAULT_SCOPE = {
|
|
1096
1130
|
get store() {
|
|
1097
1131
|
return _store();
|
|
@@ -1115,10 +1149,12 @@ async function disposeAndExit(code = "EXIT") {
|
|
|
1115
1149
|
adapters.clear();
|
|
1116
1150
|
config().env !== "test" && process.exit(code === "ERROR" ? 1 : 0);
|
|
1117
1151
|
}
|
|
1152
|
+
_chunkUEGKXCSQcjs.__name.call(void 0, disposeAndExit, "disposeAndExit");
|
|
1118
1153
|
function dispose(disposer) {
|
|
1119
1154
|
disposer && register_disposer(disposer);
|
|
1120
1155
|
return disposeAndExit;
|
|
1121
1156
|
}
|
|
1157
|
+
_chunkUEGKXCSQcjs.__name.call(void 0, dispose, "dispose");
|
|
1122
1158
|
|
|
1123
1159
|
// src/config.ts
|
|
1124
1160
|
var package_schema = _zod.z.object({
|
|
@@ -1134,7 +1170,7 @@ var FALLBACK_PACKAGE = {
|
|
|
1134
1170
|
version: "0.0.0-fallback",
|
|
1135
1171
|
description: "Synthetic fallback \u2014 package.json could not be loaded"
|
|
1136
1172
|
};
|
|
1137
|
-
var get_package = () => {
|
|
1173
|
+
var get_package = /* @__PURE__ */ _chunkUEGKXCSQcjs.__name.call(void 0, () => {
|
|
1138
1174
|
try {
|
|
1139
1175
|
const raw = JSON.parse(fs.readFileSync("package.json").toString());
|
|
1140
1176
|
const pkg2 = {
|
|
@@ -1150,11 +1186,11 @@ var get_package = () => {
|
|
|
1150
1186
|
pkg_load_error = err;
|
|
1151
1187
|
return FALLBACK_PACKAGE;
|
|
1152
1188
|
}
|
|
1153
|
-
};
|
|
1189
|
+
}, "get_package");
|
|
1154
1190
|
var pkg_load_error;
|
|
1155
1191
|
var BaseSchema = package_schema.extend({
|
|
1156
|
-
env: _zod.z.enum(
|
|
1157
|
-
logLevel: _zod.z.enum(
|
|
1192
|
+
env: _zod.z.enum(_chunkUEGKXCSQcjs.Environments),
|
|
1193
|
+
logLevel: _zod.z.enum(_chunkUEGKXCSQcjs.LogLevels),
|
|
1158
1194
|
logSingleLine: _zod.z.boolean(),
|
|
1159
1195
|
sleepMs: _zod.z.number().int().min(0).max(5e3)
|
|
1160
1196
|
});
|
|
@@ -1165,7 +1201,7 @@ var logSingleLine = (LOG_SINGLE_LINE || "true") === "true";
|
|
|
1165
1201
|
var sleepMs = parseInt(NODE_ENV === "test" ? "0" : _nullishCoalesce(SLEEP_MS, () => ( "100")), 10);
|
|
1166
1202
|
var pkg = get_package();
|
|
1167
1203
|
var _validated;
|
|
1168
|
-
var config = () => {
|
|
1204
|
+
var config = /* @__PURE__ */ _chunkUEGKXCSQcjs.__name.call(void 0, () => {
|
|
1169
1205
|
if (!_validated) {
|
|
1170
1206
|
_validated = validate(
|
|
1171
1207
|
"config",
|
|
@@ -1181,7 +1217,7 @@ var config = () => {
|
|
|
1181
1217
|
}
|
|
1182
1218
|
}
|
|
1183
1219
|
return _validated;
|
|
1184
|
-
};
|
|
1220
|
+
}, "config");
|
|
1185
1221
|
|
|
1186
1222
|
|
|
1187
1223
|
|
|
@@ -1213,4 +1249,4 @@ var config = () => {
|
|
|
1213
1249
|
|
|
1214
1250
|
|
|
1215
1251
|
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.DEFAULT_STREAM_LIMIT = DEFAULT_STREAM_LIMIT; exports.DEFAULT_EVENT_LIMIT = DEFAULT_EVENT_LIMIT; exports.DEFAULT_LEASE_MILLIS = DEFAULT_LEASE_MILLIS; exports.MAX_SHUTDOWN_GRACE_MS = MAX_SHUTDOWN_GRACE_MS; exports.check = check; 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;
|
|
1216
|
-
//# sourceMappingURL=chunk-
|
|
1252
|
+
//# sourceMappingURL=chunk-WDIBO6AW.cjs.map
|