@rotorsoft/act 1.37.4 → 1.37.6

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 (39) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/@types/builders/act-builder.d.ts +2 -1
  3. package/dist/@types/builders/act-builder.d.ts.map +1 -1
  4. package/dist/@types/builders/event-builder.d.ts +0 -1
  5. package/dist/@types/builders/event-builder.d.ts.map +1 -1
  6. package/dist/@types/builders/merge.d.ts.map +1 -1
  7. package/dist/@types/builders/slice-builder.d.ts +2 -1
  8. package/dist/@types/builders/slice-builder.d.ts.map +1 -1
  9. package/dist/@types/builders/state-builder.d.ts.map +1 -1
  10. package/dist/@types/internal/autoclose-policy.d.ts +8 -7
  11. package/dist/@types/internal/autoclose-policy.d.ts.map +1 -1
  12. package/dist/@types/internal/date-reviver.d.ts.map +1 -1
  13. package/dist/@types/internal/zod.d.ts +6 -3
  14. package/dist/@types/internal/zod.d.ts.map +1 -1
  15. package/dist/@types/sensitive.d.ts +1 -2
  16. package/dist/@types/sensitive.d.ts.map +1 -1
  17. package/dist/@types/types/action.d.ts +7 -3
  18. package/dist/@types/types/action.d.ts.map +1 -1
  19. package/dist/@types/types/ports.d.ts +5 -7
  20. package/dist/@types/types/ports.d.ts.map +1 -1
  21. package/dist/{chunk-PN5GNW6E.cjs → chunk-H6KVPVP4.cjs} +18 -7
  22. package/dist/chunk-H6KVPVP4.cjs.map +1 -0
  23. package/dist/{chunk-FBZY2F5W.js → chunk-HXW3TPP6.js} +2 -2
  24. package/dist/{chunk-UPKDCTS2.cjs → chunk-PRDX3HP6.cjs} +13 -13
  25. package/dist/{chunk-UPKDCTS2.cjs.map → chunk-PRDX3HP6.cjs.map} +1 -1
  26. package/dist/{chunk-CB2OLGJK.js → chunk-V5ZB54DC.js} +17 -6
  27. package/dist/chunk-V5ZB54DC.js.map +1 -0
  28. package/dist/index.cjs +168 -168
  29. package/dist/index.cjs.map +1 -1
  30. package/dist/index.js +14 -14
  31. package/dist/index.js.map +1 -1
  32. package/dist/test/index.cjs +4 -4
  33. package/dist/test/index.js +2 -2
  34. package/dist/types/index.cjs +2 -2
  35. package/dist/types/index.js +1 -1
  36. package/package.json +1 -1
  37. package/dist/chunk-CB2OLGJK.js.map +0 -1
  38. package/dist/chunk-PN5GNW6E.cjs.map +0 -1
  39. /package/dist/{chunk-FBZY2F5W.js.map → chunk-HXW3TPP6.js.map} +0 -0
package/dist/index.js CHANGED
@@ -40,7 +40,7 @@ import {
40
40
  sleep,
41
41
  store,
42
42
  validate
43
- } from "./chunk-FBZY2F5W.js";
43
+ } from "./chunk-HXW3TPP6.js";
44
44
  import {
45
45
  ActorSchema,
46
46
  CausationEventSchema,
@@ -69,11 +69,12 @@ import {
69
69
  ValidationError,
70
70
  ZodEmpty,
71
71
  def_of,
72
+ inner_of,
72
73
  output_of,
73
74
  pii_fields,
74
75
  pii_schemas,
75
76
  sensitive
76
- } from "./chunk-CB2OLGJK.js";
77
+ } from "./chunk-V5ZB54DC.js";
77
78
 
78
79
  // src/signals.ts
79
80
  process.once("SIGINT", async (arg) => {
@@ -1457,7 +1458,7 @@ var CorrelateCycle = class {
1457
1458
  });
1458
1459
  } catch (error) {
1459
1460
  log().warn(
1460
- `Could not hand back the correlation lease during shutdown; it expires on its own within ${CORRELATION_LEASE_MS}ms and correlation resumes normally after that. On a single-writer store this usually means another connection holds the database. Cause: ${String(error)}`
1461
+ `Could not hand back the correlation lease during shutdown; it expires on its own within ${CORRELATION_LEASE_MS}ms and correlation resumes normally after that. On a single-writer store this usually means another connection holds the database. Cause: ${String(error.cause ?? error)}`
1461
1462
  );
1462
1463
  }
1463
1464
  }
@@ -4018,6 +4019,10 @@ function policy_min_after_days(options) {
4018
4019
  if (parsed.or?.after) windows.push(parsed.or.after.days);
4019
4020
  return windows.length ? Math.min(...windows) : void 0;
4020
4021
  }
4022
+ function policy_after_windows(options) {
4023
+ const parsed = AutoclosePolicySchema.parse(options);
4024
+ return [parsed.after, parsed.or?.after].flatMap((w) => w ? [w.days] : []);
4025
+ }
4021
4026
  function policy_keep_days(options) {
4022
4027
  const parsed = AutoclosePolicySchema.parse(options);
4023
4028
  return parsed.keep?.days;
@@ -4089,7 +4094,7 @@ function synthesize_autoclose_reactions(registry, states, read_window) {
4089
4094
  for (const st of states.values()) {
4090
4095
  const predicate = st.autoclose;
4091
4096
  if (!predicate) continue;
4092
- const after_days = st.autoclose_after_days;
4097
+ const after_windows = st.autoclose_after_windows;
4093
4098
  const keep_days = st.autoclose_keep_days;
4094
4099
  const archiver = st.archive;
4095
4100
  const reaction = {
@@ -4139,8 +4144,8 @@ function synthesize_autoclose_reactions(registry, states, read_window) {
4139
4144
  });
4140
4145
  }
4141
4146
  const dues = [];
4142
- if (after_days !== void 0)
4143
- dues.push(days_after(head.created, after_days));
4147
+ for (const days of after_windows)
4148
+ dues.push(days_after(head.created, days));
4144
4149
  if (keep_days !== void 0)
4145
4150
  dues.push(days_after(entry.tail.created, keep_days));
4146
4151
  const future = dues.map((d) => d.getTime()).filter((t) => t > Date.now());
@@ -4230,6 +4235,7 @@ function autoclose_of(existing, state2) {
4230
4235
  return {
4231
4236
  autoclose: owner.autoclose,
4232
4237
  autoclose_after_days: owner.autoclose_after_days,
4238
+ autoclose_after_windows: owner.autoclose_after_windows,
4233
4239
  autoclose_keep_days: owner.autoclose_keep_days
4234
4240
  };
4235
4241
  }
@@ -4468,15 +4474,8 @@ function date_reviver_schema(schema) {
4468
4474
  return inner()?.nullable();
4469
4475
  case "pipe":
4470
4476
  return date_reviver_schema(def.out);
4471
- case "optional":
4472
- case "nonoptional":
4473
- case "readonly":
4474
- case "default":
4475
- case "prefault":
4476
- case "catch":
4477
- return inner();
4478
4477
  default:
4479
- return void 0;
4478
+ return inner_of(def) ? inner() : void 0;
4480
4479
  }
4481
4480
  }
4482
4481
 
@@ -5091,6 +5090,7 @@ function action_builder(state2) {
5091
5090
  policy
5092
5091
  );
5093
5092
  internal.autoclose_after_days = policy_min_after_days(policy);
5093
+ internal.autoclose_after_windows = policy_after_windows(policy);
5094
5094
  internal.autoclose_keep_days = policy_keep_days(policy);
5095
5095
  return builder;
5096
5096
  },