@rotorsoft/act 2.0.5 → 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.
Files changed (58) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/@types/adapter.d.ts +85 -0
  3. package/dist/@types/adapter.d.ts.map +1 -0
  4. package/dist/@types/adapters/in-memory-store.d.ts.map +1 -1
  5. package/dist/@types/config.d.ts +3 -9
  6. package/dist/@types/config.d.ts.map +1 -1
  7. package/dist/@types/deprecated.d.ts +57 -0
  8. package/dist/@types/deprecated.d.ts.map +1 -0
  9. package/dist/@types/index.d.ts +12 -9
  10. package/dist/@types/index.d.ts.map +1 -1
  11. package/dist/@types/internal/autoclose-reaction.d.ts.map +1 -1
  12. package/dist/@types/internal/close-cycle.d.ts.map +1 -1
  13. package/dist/@types/internal/correlate-cycle.d.ts.map +1 -1
  14. package/dist/@types/internal/drain-ops.d.ts.map +1 -1
  15. package/dist/@types/ports.d.ts +1 -3
  16. package/dist/@types/ports.d.ts.map +1 -1
  17. package/dist/@types/scoped.d.ts +1 -1
  18. package/dist/@types/sensitive.d.ts +6 -2
  19. package/dist/@types/sensitive.d.ts.map +1 -1
  20. package/dist/@types/types/index.d.ts +1 -1
  21. package/dist/@types/types/index.d.ts.map +1 -1
  22. package/dist/@types/types/ports.d.ts +4 -0
  23. package/dist/@types/types/ports.d.ts.map +1 -1
  24. package/dist/@types/types/schemas.d.ts +1 -1
  25. package/dist/@types/types/schemas.d.ts.map +1 -1
  26. package/dist/@types/utils.d.ts +0 -105
  27. package/dist/@types/utils.d.ts.map +1 -1
  28. package/dist/adapter.cjs +20 -0
  29. package/dist/adapter.cjs.map +1 -0
  30. package/dist/adapter.js +20 -0
  31. package/dist/adapter.js.map +1 -0
  32. package/dist/{chunk-VD4BLAY4.cjs → chunk-2377SSHX.cjs} +7 -3
  33. package/dist/chunk-2377SSHX.cjs.map +1 -0
  34. package/dist/{chunk-ESFICIG2.js → chunk-GWFLHWZV.js} +6 -2
  35. package/dist/{chunk-ESFICIG2.js.map → chunk-GWFLHWZV.js.map} +1 -1
  36. package/dist/chunk-HACJYR7Z.cjs +62 -0
  37. package/dist/chunk-HACJYR7Z.cjs.map +1 -0
  38. package/dist/{chunk-3JULRYQO.js → chunk-KXC4ILVY.js} +168 -227
  39. package/dist/chunk-KXC4ILVY.js.map +1 -0
  40. package/dist/chunk-SRZIVZIA.js +62 -0
  41. package/dist/chunk-SRZIVZIA.js.map +1 -0
  42. package/dist/{chunk-XW4EAUS6.cjs → chunk-VOVHDDET.cjs} +195 -254
  43. package/dist/chunk-VOVHDDET.cjs.map +1 -0
  44. package/dist/index.cjs +189 -160
  45. package/dist/index.cjs.map +1 -1
  46. package/dist/index.js +64 -35
  47. package/dist/index.js.map +1 -1
  48. package/dist/test/index.cjs +5 -4
  49. package/dist/test/index.cjs.map +1 -1
  50. package/dist/test/index.js +3 -2
  51. package/dist/test/index.js.map +1 -1
  52. package/dist/types/index.cjs +6 -2
  53. package/dist/types/index.cjs.map +1 -1
  54. package/dist/types/index.js +7 -3
  55. package/package.json +6 -1
  56. package/dist/chunk-3JULRYQO.js.map +0 -1
  57. package/dist/chunk-VD4BLAY4.cjs.map +0 -1
  58. package/dist/chunk-XW4EAUS6.cjs.map +0 -1
package/dist/index.js CHANGED
@@ -5,37 +5,27 @@ import {
5
5
  DEFAULT_EVENT_LIMIT,
6
6
  DEFAULT_LEASE_MILLIS,
7
7
  DEFAULT_MAX_RETRIES,
8
- DEFAULT_QUERY_STREAMS_LIMIT,
9
8
  DEFAULT_STREAM_LIMIT,
10
9
  InMemoryCache,
11
10
  InMemoryStore,
12
11
  LruMap,
13
12
  MAX_SHUTDOWN_GRACE_MS,
14
- PackageSchema,
15
13
  cache,
16
- check_appends,
17
14
  check_store,
18
- concurrency_error,
19
15
  config,
20
16
  current_autoclose_window,
21
17
  current_reacting,
22
- dateReviver,
23
- default_scope,
24
18
  dispose,
25
19
  disposeAndExit,
26
- extend,
27
- fair_slots,
28
- is_literal_source,
29
20
  log,
30
21
  make_reaction_scope,
31
22
  make_run_scoped,
32
- notification_of,
23
+ package_schema,
33
24
  port,
34
25
  register_weak_disposer,
35
26
  resolveActConfig,
36
27
  resolveActionConfig,
37
28
  resolveAutocloseConfig,
38
- resolveAutocloseConfig2,
39
29
  resolveCircuitBreakerConfig,
40
30
  resolveDrainConfig,
41
31
  resolveFoldConfig,
@@ -43,12 +33,20 @@ import {
43
33
  resolveReactionConfig,
44
34
  resolveSettleConfig,
45
35
  resolveShutdownConfig,
46
- seed_event,
47
36
  sleep,
48
37
  store,
49
- throw_if_stale,
38
+ unscoped_ports,
50
39
  validate
51
- } from "./chunk-3JULRYQO.js";
40
+ } from "./chunk-KXC4ILVY.js";
41
+ import {
42
+ checkAppends,
43
+ checkVersion,
44
+ concurrencyError,
45
+ fairSlots,
46
+ isStreamName,
47
+ parseNotification,
48
+ seedEvent
49
+ } from "./chunk-SRZIVZIA.js";
52
50
  import {
53
51
  ActorSchema,
54
52
  CausationEventSchema,
@@ -56,6 +54,7 @@ import {
56
54
  ConcurrencyError,
57
55
  DEFAULT_LANE,
58
56
  DEFAULT_MAX_SUBSCRIBED_STREAMS,
57
+ DEFAULT_QUERY_STREAMS_LIMIT,
59
58
  DEFAULT_SETTLE_DEBOUNCE_MS,
60
59
  DeferSignal,
61
60
  Environments,
@@ -80,8 +79,9 @@ import {
80
79
  output_of,
81
80
  pii_fields,
82
81
  pii_schemas,
83
- sensitive
84
- } from "./chunk-ESFICIG2.js";
82
+ sensitive,
83
+ sensitiveFields
84
+ } from "./chunk-GWFLHWZV.js";
85
85
 
86
86
  // src/signals.ts
87
87
  process.once("SIGINT", async (arg) => {
@@ -288,7 +288,7 @@ var make_schema_pass = (deps) => {
288
288
  return;
289
289
  }
290
290
  const schema = state2.events[name];
291
- const sensitive2 = pii_fields(schema);
291
+ const sensitive2 = sensitiveFields(schema);
292
292
  let parse_schema = schema;
293
293
  if (sensitive2.length > 0) {
294
294
  const omitter = schema.omit;
@@ -1130,7 +1130,7 @@ async function fetch(leased, eventLimit) {
1130
1130
  return Promise.all(
1131
1131
  leased.map(async ({ stream, source, at, lagging }) => {
1132
1132
  const events = [];
1133
- const stream_exact = source !== void 0 && is_literal_source(source, stream) ? true : void 0;
1133
+ const stream_exact = source !== void 0 && isStreamName(source, stream) ? true : void 0;
1134
1134
  try {
1135
1135
  await store().query((e) => events.push(e), {
1136
1136
  stream: source,
@@ -2307,7 +2307,7 @@ function synthesize_autoclose_reactions(registry, states, read_window) {
2307
2307
  // An anchored stream name would read as a pattern, and a store may refuse
2308
2308
  // it at subscribe, stopping every reaction. Such a stream has no
2309
2309
  // autoclose: `app.close` still closes it.
2310
- resolver: (e) => is_literal_source(e.stream) ? {
2310
+ resolver: (e) => isStreamName(e.stream) ? {
2311
2311
  target: `${AUTOCLOSE_TARGET_PREFIX}${e.stream}`,
2312
2312
  source: e.stream
2313
2313
  } : void 0,
@@ -2546,7 +2546,7 @@ function source_matcher() {
2546
2546
  const compiled = /* @__PURE__ */ new Map();
2547
2547
  return (source, target, stream) => {
2548
2548
  if (!source) return true;
2549
- if (is_literal_source(source, target)) return source === stream;
2549
+ if (isStreamName(source, target)) return source === stream;
2550
2550
  let re = compiled.get(source);
2551
2551
  if (!re) {
2552
2552
  re = new RegExp(source);
@@ -2822,7 +2822,7 @@ var CorrelateCycle = class {
2822
2822
  // Would the target's own `fetch` (filtered by `source`) return this event?
2823
2823
  _in_fetch_window(source, stream) {
2824
2824
  if (source === void 0 || source === stream) return true;
2825
- if (is_literal_source(source)) return false;
2825
+ if (isStreamName(source)) return false;
2826
2826
  let pattern = this._patterns.get(source);
2827
2827
  if (!pattern) {
2828
2828
  pattern = new RegExp(source);
@@ -3385,7 +3385,7 @@ var Act = class {
3385
3385
  this._declared_lanes = ["default", ...lanes.map((l) => l.name)];
3386
3386
  validate_only_lanes(options.onlyLanes, this._declared_lanes);
3387
3387
  if (options.scoped) check_store(options.scoped.store);
3388
- this._ports = options.scoped ?? default_scope();
3388
+ this._ports = options.scoped ?? unscoped_ports();
3389
3389
  const ports = this._ports;
3390
3390
  this._scoped = make_run_scoped({
3391
3391
  // Getters, not a spread: the singletons resolve lazily, so a later
@@ -5486,37 +5486,65 @@ function write_line(writer, line) {
5486
5486
  });
5487
5487
  });
5488
5488
  }
5489
+
5490
+ // src/deprecated.ts
5491
+ var check_appends = checkAppends;
5492
+ var throw_if_stale = checkVersion;
5493
+ var concurrency_error = concurrencyError;
5494
+ var seed_event = seedEvent;
5495
+ var fair_slots = fairSlots;
5496
+ var is_literal_source = isStreamName;
5497
+ var notification_of = parseNotification;
5498
+ var DEFAULT_QUERY_STREAMS_LIMIT2 = DEFAULT_QUERY_STREAMS_LIMIT;
5499
+ var ActorSchema2 = ActorSchema;
5500
+ var TargetSchema2 = TargetSchema;
5501
+ var EventMetaSchema2 = EventMetaSchema;
5502
+ var CausationEventSchema2 = CausationEventSchema;
5503
+ var CommittedMetaSchema2 = CommittedMetaSchema;
5504
+ var QuerySchema2 = QuerySchema;
5505
+ var Environments2 = Environments;
5506
+ var LogLevels2 = LogLevels;
5507
+ var ExitCodes2 = ExitCodes;
5508
+ var DEFAULT_LANE2 = DEFAULT_LANE;
5509
+ var DEFAULT_MAX_SUBSCRIBED_STREAMS2 = DEFAULT_MAX_SUBSCRIBED_STREAMS;
5510
+ var DEFAULT_SETTLE_DEBOUNCE_MS2 = DEFAULT_SETTLE_DEBOUNCE_MS;
5511
+ var PackageSchema = package_schema;
5512
+ var default_scope = unscoped_ports;
5513
+ var resolveAutocloseConfig2 = resolveAutocloseConfig;
5514
+ var extend = (source, schema, target) => ({ ...target, ...validate("config", source, schema) });
5515
+ 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
+ var dateReviver = (_key, value) => typeof value === "string" && ISO_8601.test(value) ? new Date(value) : value;
5489
5517
  export {
5490
5518
  Act,
5491
- ActorSchema,
5492
- CausationEventSchema,
5493
- CommittedMetaSchema,
5519
+ ActorSchema2 as ActorSchema,
5520
+ CausationEventSchema2 as CausationEventSchema,
5521
+ CommittedMetaSchema2 as CommittedMetaSchema,
5494
5522
  ConcurrencyError,
5495
5523
  ConsoleLogger,
5496
5524
  CsvFile,
5497
- DEFAULT_LANE,
5498
- DEFAULT_MAX_SUBSCRIBED_STREAMS,
5499
- DEFAULT_QUERY_STREAMS_LIMIT,
5500
- DEFAULT_SETTLE_DEBOUNCE_MS,
5525
+ DEFAULT_LANE2 as DEFAULT_LANE,
5526
+ DEFAULT_MAX_SUBSCRIBED_STREAMS2 as DEFAULT_MAX_SUBSCRIBED_STREAMS,
5527
+ DEFAULT_QUERY_STREAMS_LIMIT2 as DEFAULT_QUERY_STREAMS_LIMIT,
5528
+ DEFAULT_SETTLE_DEBOUNCE_MS2 as DEFAULT_SETTLE_DEBOUNCE_MS,
5501
5529
  DeferSignal,
5502
- Environments,
5530
+ Environments2 as Environments,
5503
5531
  Errors,
5504
- EventMetaSchema,
5505
- ExitCodes,
5532
+ EventMetaSchema2 as EventMetaSchema,
5533
+ ExitCodes2 as ExitCodes,
5506
5534
  InMemoryCache,
5507
5535
  InMemoryStore,
5508
- LogLevels,
5536
+ LogLevels2 as LogLevels,
5509
5537
  NonRetryableError,
5510
5538
  PackageSchema,
5511
5539
  PreconditionError,
5512
- QuerySchema,
5540
+ QuerySchema2 as QuerySchema,
5513
5541
  REDACTED,
5514
5542
  SHREDDED,
5515
5543
  SNAP_EVENT,
5516
5544
  StoreError,
5517
5545
  StreamClosedError,
5518
5546
  TOMBSTONE_EVENT,
5519
- TargetSchema,
5547
+ TargetSchema2 as TargetSchema,
5520
5548
  ValidationError,
5521
5549
  ZodEmpty,
5522
5550
  act,
@@ -5539,6 +5567,7 @@ export {
5539
5567
  resolveAutocloseConfig2 as resolveAutocloseConfig,
5540
5568
  seed_event,
5541
5569
  sensitive,
5570
+ sensitiveFields,
5542
5571
  sleep,
5543
5572
  slice,
5544
5573
  state,