@rotorsoft/act 2.0.0 → 2.0.2

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/index.js CHANGED
@@ -15,6 +15,7 @@ import {
15
15
  cache,
16
16
  check_appends,
17
17
  check_store,
18
+ concurrency_error,
18
19
  config,
19
20
  current_autoclose_window,
20
21
  current_reacting,
@@ -41,10 +42,12 @@ import {
41
42
  resolveReactionConfig,
42
43
  resolveSettleConfig,
43
44
  resolveShutdownConfig,
45
+ seed_event,
44
46
  sleep,
45
47
  store,
48
+ throw_if_stale,
46
49
  validate
47
- } from "./chunk-MWHTNPUY.js";
50
+ } from "./chunk-ONPSBHE2.js";
48
51
  import {
49
52
  ActorSchema,
50
53
  CausationEventSchema,
@@ -77,7 +80,7 @@ import {
77
80
  pii_fields,
78
81
  pii_schemas,
79
82
  sensitive
80
- } from "./chunk-SNPEQW6Z.js";
83
+ } from "./chunk-ESFICIG2.js";
81
84
 
82
85
  // src/signals.ts
83
86
  process.once("SIGINT", async (arg) => {
@@ -862,13 +865,6 @@ function compile_is(is) {
862
865
  function compile_reaches(reaches) {
863
866
  return (_stream, _head, count) => count >= reaches;
864
867
  }
865
- function policy_min_after_days(options) {
866
- const parsed = AutoclosePolicySchema.parse(options);
867
- const windows = [];
868
- if (parsed.after) windows.push(parsed.after.days);
869
- if (parsed.or?.after) windows.push(parsed.or.after.days);
870
- return windows.length ? Math.min(...windows) : void 0;
871
- }
872
868
  function policy_after_windows(options) {
873
869
  const parsed = AutoclosePolicySchema.parse(options);
874
870
  return [parsed.after, parsed.or?.after].flatMap((w) => w ? [w.days] : []);
@@ -4302,12 +4298,11 @@ var Act = class {
4302
4298
 
4303
4299
  // src/builders/merge.ts
4304
4300
  import { ZodObject } from "zod";
4305
- function base_type_name(zodType) {
4306
- let t = zodType;
4307
- while (typeof t.unwrap === "function") {
4308
- t = t.unwrap();
4309
- }
4310
- return t.constructor.name;
4301
+ function base_type_name(schema) {
4302
+ let def = def_of(schema);
4303
+ for (let inner = inner_of(def); inner; inner = inner_of(def))
4304
+ def = def_of(inner);
4305
+ return def.type === "array" ? `array of ${base_type_name(def.element)}` : def.type;
4311
4306
  }
4312
4307
  function merge_schemas(existing, incoming, state_name) {
4313
4308
  if (existing === incoming) return existing;
@@ -5305,8 +5300,9 @@ function action_builder(state2) {
5305
5300
  internal.autoclose = compile_autoclose_policy(
5306
5301
  policy
5307
5302
  );
5308
- internal.autoclose_after_days = policy_min_after_days(policy);
5309
- internal.autoclose_after_windows = policy_after_windows(policy);
5303
+ const windows = policy_after_windows(policy);
5304
+ internal.autoclose_after_windows = windows;
5305
+ internal.autoclose_after_days = windows.length ? Math.min(...windows) : void 0;
5310
5306
  internal.autoclose_keep_days = policy_keep_days(policy);
5311
5307
  return builder;
5312
5308
  },
@@ -5526,6 +5522,7 @@ export {
5526
5522
  act,
5527
5523
  cache,
5528
5524
  check_appends,
5525
+ concurrency_error,
5529
5526
  config,
5530
5527
  dateReviver,
5531
5528
  default_scope,
@@ -5539,11 +5536,13 @@ export {
5539
5536
  port,
5540
5537
  projection,
5541
5538
  resolveAutocloseConfig2 as resolveAutocloseConfig,
5539
+ seed_event,
5542
5540
  sensitive,
5543
5541
  sleep,
5544
5542
  slice,
5545
5543
  state,
5546
5544
  store,
5545
+ throw_if_stale,
5547
5546
  validate
5548
5547
  };
5549
5548
  //# sourceMappingURL=index.js.map