@rotorsoft/act 0.33.2 → 0.33.3
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/builders/state-builder.d.ts +35 -19
- package/dist/@types/builders/state-builder.d.ts.map +1 -1
- package/dist/@types/internal/correlate-cycle.d.ts +2 -2
- package/dist/@types/internal/tracing.d.ts +2 -2
- package/dist/@types/internal/tracing.d.ts.map +1 -1
- package/dist/@types/types/action.d.ts +2 -2
- package/dist/@types/types/action.d.ts.map +1 -1
- package/dist/@types/types/registry.d.ts +1 -1
- package/dist/@types/types/registry.d.ts.map +1 -1
- package/dist/@types/types/schemas.d.ts +1 -1
- package/dist/@types/types/schemas.d.ts.map +1 -1
- package/dist/{chunk-AWT7TU22.js → chunk-AGWZY6YT.js} +1 -1
- package/dist/{chunk-AWT7TU22.js.map → chunk-AGWZY6YT.js.map} +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.js +1 -1
- package/package.json +4 -2
package/dist/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
TargetSchema,
|
|
14
14
|
ValidationError,
|
|
15
15
|
ZodEmpty
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-AGWZY6YT.js";
|
|
17
17
|
|
|
18
18
|
// src/adapters/console-logger.ts
|
|
19
19
|
var LEVEL_VALUES = {
|
|
@@ -1091,8 +1091,8 @@ var CorrelateCycle = class {
|
|
|
1091
1091
|
}
|
|
1092
1092
|
/**
|
|
1093
1093
|
* Start a periodic correlation worker. Returns false if one is already
|
|
1094
|
-
* running. Errors from `correlate()` are
|
|
1095
|
-
*
|
|
1094
|
+
* running. Errors from `correlate()` are routed through `log()` so they
|
|
1095
|
+
* land in the configured logger (the timer keeps running on failure).
|
|
1096
1096
|
*/
|
|
1097
1097
|
startPolling(query = {}, frequency = 1e4, callback) {
|
|
1098
1098
|
if (this._timer) return false;
|
|
@@ -1100,7 +1100,7 @@ var CorrelateCycle = class {
|
|
|
1100
1100
|
this._timer = setInterval(
|
|
1101
1101
|
() => this.correlate({ ...query, after: this._checkpoint, limit }).then((result) => {
|
|
1102
1102
|
if (callback && result.subscribed) callback(result.subscribed);
|
|
1103
|
-
}).catch(
|
|
1103
|
+
}).catch((err) => log().error(err)),
|
|
1104
1104
|
frequency
|
|
1105
1105
|
);
|
|
1106
1106
|
return true;
|
|
@@ -1629,7 +1629,7 @@ async function load(me, stream, callback, asOf) {
|
|
|
1629
1629
|
async function action(me, action2, target, payload, reactingTo, skipValidation = false) {
|
|
1630
1630
|
const { stream, expectedVersion, actor } = target;
|
|
1631
1631
|
if (!stream) throw new Error("Missing target stream");
|
|
1632
|
-
|
|
1632
|
+
const validated = skipValidation ? payload : validate(action2, payload, me.actions[action2]);
|
|
1633
1633
|
const snapshot = await load(me, stream);
|
|
1634
1634
|
if (snapshot.event?.name === TOMBSTONE_EVENT)
|
|
1635
1635
|
throw new StreamClosedError(stream);
|
|
@@ -1640,14 +1640,14 @@ async function action(me, action2, target, payload, reactingTo, skipValidation =
|
|
|
1640
1640
|
if (!valid(snapshot.state, actor))
|
|
1641
1641
|
throw new InvariantError(
|
|
1642
1642
|
action2,
|
|
1643
|
-
|
|
1643
|
+
validated,
|
|
1644
1644
|
target,
|
|
1645
1645
|
snapshot,
|
|
1646
1646
|
description
|
|
1647
1647
|
);
|
|
1648
1648
|
});
|
|
1649
1649
|
}
|
|
1650
|
-
const result = me.on[action2](
|
|
1650
|
+
const result = me.on[action2](validated, snapshot, target);
|
|
1651
1651
|
if (!result) return [snapshot];
|
|
1652
1652
|
if (Array.isArray(result) && result.length === 0) {
|
|
1653
1653
|
return [snapshot];
|