@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/.tsbuildinfo +1 -1
- package/dist/@types/adapters/in-memory-store.d.ts.map +1 -1
- package/dist/@types/builders/merge.d.ts.map +1 -1
- package/dist/@types/builders/state-builder.d.ts.map +1 -1
- package/dist/@types/internal/autoclose-policy.d.ts +0 -9
- package/dist/@types/internal/autoclose-policy.d.ts.map +1 -1
- package/dist/@types/internal/zod.d.ts +2 -2
- package/dist/@types/types/ports.d.ts +23 -26
- package/dist/@types/types/ports.d.ts.map +1 -1
- package/dist/@types/utils.d.ts +36 -0
- package/dist/@types/utils.d.ts.map +1 -1
- package/dist/{chunk-LUHPSF3C.cjs → chunk-EAFNHF5S.cjs} +37 -25
- package/dist/chunk-EAFNHF5S.cjs.map +1 -0
- package/dist/{chunk-SNPEQW6Z.js → chunk-ESFICIG2.js} +3 -3
- package/dist/chunk-ESFICIG2.js.map +1 -0
- package/dist/{chunk-MWHTNPUY.js → chunk-ONPSBHE2.js} +27 -15
- package/dist/chunk-ONPSBHE2.js.map +1 -0
- package/dist/{chunk-YFFWCVXW.cjs → chunk-VD4BLAY4.cjs} +2 -2
- package/dist/chunk-VD4BLAY4.cjs.map +1 -0
- package/dist/index.cjs +240 -241
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +16 -17
- package/dist/index.js.map +1 -1
- package/dist/test/index.cjs +4 -4
- package/dist/test/index.js +2 -2
- package/dist/types/index.cjs +2 -2
- package/dist/types/index.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-LUHPSF3C.cjs.map +0 -1
- package/dist/chunk-MWHTNPUY.js.map +0 -1
- package/dist/chunk-SNPEQW6Z.js.map +0 -1
- package/dist/chunk-YFFWCVXW.cjs.map +0 -1
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-
|
|
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-
|
|
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(
|
|
4306
|
-
let
|
|
4307
|
-
|
|
4308
|
-
|
|
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
|
-
|
|
5309
|
-
internal.autoclose_after_windows =
|
|
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
|