@event-driven-io/emmett 0.5.1 → 0.5.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/chunk-2452BJTJ.js +1 -0
- package/dist/chunk-2452BJTJ.js.map +1 -0
- package/dist/chunk-32IWULJJ.mjs +2 -0
- package/dist/chunk-32IWULJJ.mjs.map +1 -0
- package/dist/chunk-3JE5DUJ2.js +2 -0
- package/dist/chunk-3JE5DUJ2.js.map +1 -0
- package/dist/chunk-3LYVXI5R.mjs +1 -0
- package/dist/chunk-3LYVXI5R.mjs.map +1 -0
- package/dist/chunk-45ODDXOQ.mjs +1 -0
- package/dist/chunk-45ODDXOQ.mjs.map +1 -0
- package/dist/chunk-46YIPCSN.js +2 -0
- package/dist/chunk-46YIPCSN.js.map +1 -0
- package/dist/chunk-7EZVPMJ6.js +2 -0
- package/dist/chunk-7EZVPMJ6.js.map +1 -0
- package/dist/chunk-7FJXUW3D.js +1 -0
- package/dist/chunk-7FJXUW3D.js.map +1 -0
- package/dist/chunk-7H3QW2YD.js +1 -0
- package/dist/chunk-7H3QW2YD.js.map +1 -0
- package/dist/chunk-7JLAVMM3.mjs +1 -0
- package/dist/chunk-7JLAVMM3.mjs.map +1 -0
- package/dist/chunk-AU2WZCER.js +1 -0
- package/dist/chunk-AU2WZCER.js.map +1 -0
- package/dist/chunk-BARLLX6S.js +1 -0
- package/dist/chunk-BARLLX6S.js.map +1 -0
- package/dist/chunk-BM2H4NCZ.js +2 -0
- package/dist/chunk-BM2H4NCZ.js.map +1 -0
- package/dist/chunk-C4CXU3PY.mjs +1 -0
- package/dist/chunk-C4CXU3PY.mjs.map +1 -0
- package/dist/chunk-CTCSK4FW.mjs +2 -0
- package/dist/chunk-CTCSK4FW.mjs.map +1 -0
- package/dist/chunk-D24KLTN5.mjs +1 -0
- package/dist/chunk-D24KLTN5.mjs.map +1 -0
- package/dist/chunk-DFPI5IXT.js +5 -0
- package/dist/chunk-DFPI5IXT.js.map +1 -0
- package/dist/chunk-DIW552TK.mjs +1 -0
- package/dist/chunk-DIW552TK.mjs.map +1 -0
- package/dist/chunk-ERDVHQZL.mjs +2 -0
- package/dist/chunk-ERDVHQZL.mjs.map +1 -0
- package/dist/chunk-F7QRI2VL.js +1 -0
- package/dist/chunk-F7QRI2VL.js.map +1 -0
- package/dist/chunk-FE73T2NS.js +2 -0
- package/dist/chunk-FE73T2NS.js.map +1 -0
- package/dist/chunk-HKEQAT6F.mjs +1 -0
- package/dist/chunk-HKEQAT6F.mjs.map +1 -0
- package/dist/chunk-IJGC6SHP.js +1 -0
- package/dist/chunk-IJGC6SHP.js.map +1 -0
- package/dist/chunk-IZWGWZ3P.mjs +1 -0
- package/dist/chunk-IZWGWZ3P.mjs.map +1 -0
- package/dist/chunk-JJHE2RKT.mjs +2 -0
- package/dist/chunk-JJHE2RKT.mjs.map +1 -0
- package/dist/chunk-LOJ6A4AJ.js +1 -0
- package/dist/chunk-LOJ6A4AJ.js.map +1 -0
- package/dist/chunk-LYKEARRW.js +2 -0
- package/dist/chunk-LYKEARRW.js.map +1 -0
- package/dist/chunk-O2ZUNWMO.mjs +2 -0
- package/dist/chunk-O2ZUNWMO.mjs.map +1 -0
- package/dist/chunk-O34VKX7R.js +2 -0
- package/dist/chunk-O34VKX7R.js.map +1 -0
- package/dist/chunk-OBA6MZMG.mjs +2 -0
- package/dist/chunk-OBA6MZMG.mjs.map +1 -0
- package/dist/chunk-OYAO7QEP.js +2 -0
- package/dist/chunk-OYAO7QEP.js.map +1 -0
- package/dist/chunk-PKL7KGJ3.mjs +2 -0
- package/dist/chunk-PKL7KGJ3.mjs.map +1 -0
- package/dist/chunk-PNOEBD4U.mjs +2 -0
- package/dist/chunk-PNOEBD4U.mjs.map +1 -0
- package/dist/chunk-QSAFGRYV.js +1 -0
- package/dist/chunk-QSAFGRYV.js.map +1 -0
- package/dist/chunk-RWKXC5FZ.mjs +5 -0
- package/dist/chunk-RWKXC5FZ.mjs.map +1 -0
- package/dist/chunk-U3WA3VIW.js +2 -0
- package/dist/chunk-U3WA3VIW.js.map +1 -0
- package/dist/chunk-UI6CV7VB.mjs +2 -0
- package/dist/chunk-UI6CV7VB.mjs.map +1 -0
- package/dist/chunk-UUCTMJK7.js +2 -0
- package/dist/chunk-UUCTMJK7.js.map +1 -0
- package/dist/chunk-WIMBG2PX.js +2 -0
- package/dist/chunk-WIMBG2PX.js.map +1 -0
- package/dist/chunk-XLZS42HB.mjs +1 -0
- package/dist/chunk-XLZS42HB.mjs.map +1 -0
- package/dist/chunk-YKFEDBH4.mjs +2 -0
- package/dist/chunk-YKFEDBH4.mjs.map +1 -0
- package/dist/chunk-YKICRTHH.mjs +1 -0
- package/dist/chunk-YKICRTHH.mjs.map +1 -0
- package/dist/chunk-YV6PB6LX.mjs +2 -0
- package/dist/chunk-YV6PB6LX.mjs.map +1 -0
- package/dist/chunk-Z7EDILIO.js +1 -0
- package/dist/chunk-Z7EDILIO.js.map +1 -0
- package/dist/commandHandling/handleCommand.js +1 -32
- package/dist/commandHandling/handleCommand.js.map +1 -1
- package/dist/commandHandling/handleCommand.mjs +1 -32
- package/dist/commandHandling/handleCommand.mjs.map +1 -1
- package/dist/commandHandling/handleCommandWithDecider.js +1 -13
- package/dist/commandHandling/handleCommandWithDecider.js.map +1 -1
- package/dist/commandHandling/handleCommandWithDecider.mjs +1 -13
- package/dist/commandHandling/handleCommandWithDecider.mjs.map +1 -1
- package/dist/commandHandling/index.js +1 -2
- package/dist/commandHandling/index.js.map +1 -1
- package/dist/commandHandling/index.mjs +1 -2
- package/dist/commandHandling/index.mjs.map +1 -1
- package/dist/errors/index.js +1 -56
- package/dist/errors/index.js.map +1 -1
- package/dist/errors/index.mjs +1 -56
- package/dist/errors/index.mjs.map +1 -1
- package/dist/eventStore/eventStore.js +2 -1
- package/dist/eventStore/eventStore.mjs +1 -0
- package/dist/eventStore/expectedVersion.js +1 -32
- package/dist/eventStore/expectedVersion.js.map +1 -1
- package/dist/eventStore/expectedVersion.mjs +1 -32
- package/dist/eventStore/expectedVersion.mjs.map +1 -1
- package/dist/eventStore/inMemoryEventStore.js +1 -70
- package/dist/eventStore/inMemoryEventStore.js.map +1 -1
- package/dist/eventStore/inMemoryEventStore.mjs +1 -70
- package/dist/eventStore/inMemoryEventStore.mjs.map +1 -1
- package/dist/eventStore/index.js +1 -3
- package/dist/eventStore/index.js.map +1 -1
- package/dist/eventStore/index.mjs +1 -3
- package/dist/eventStore/index.mjs.map +1 -1
- package/dist/index.js +1 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -8
- package/dist/index.mjs.map +1 -1
- package/dist/serialization/index.js +1 -1
- package/dist/serialization/index.js.map +1 -1
- package/dist/serialization/index.mjs +1 -1
- package/dist/serialization/index.mjs.map +1 -1
- package/dist/serialization/json/JSONParser.js +1 -22
- package/dist/serialization/json/JSONParser.js.map +1 -1
- package/dist/serialization/json/JSONParser.mjs +1 -22
- package/dist/serialization/json/JSONParser.mjs.map +1 -1
- package/dist/serialization/json/index.js +1 -1
- package/dist/serialization/json/index.js.map +1 -1
- package/dist/serialization/json/index.mjs +1 -1
- package/dist/serialization/json/index.mjs.map +1 -1
- package/dist/testing/assertions.js +1 -26
- package/dist/testing/assertions.js.map +1 -1
- package/dist/testing/assertions.mjs +1 -26
- package/dist/testing/assertions.mjs.map +1 -1
- package/dist/testing/deciderSpecification.js +1 -41
- package/dist/testing/deciderSpecification.js.map +1 -1
- package/dist/testing/deciderSpecification.mjs +1 -41
- package/dist/testing/deciderSpecification.mjs.map +1 -1
- package/dist/testing/index.js +1 -2
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/index.mjs +1 -2
- package/dist/testing/index.mjs.map +1 -1
- package/dist/typing/command.js +2 -1
- package/dist/typing/command.mjs +1 -0
- package/dist/typing/decider.js +2 -1
- package/dist/typing/decider.mjs +1 -0
- package/dist/typing/event.js +2 -1
- package/dist/typing/event.mjs +1 -0
- package/dist/typing/index.d.mts +8 -8
- package/dist/typing/index.d.ts +8 -8
- package/dist/typing/index.js +1 -4
- package/dist/typing/index.js.map +1 -1
- package/dist/typing/index.mjs +1 -4
- package/dist/typing/index.mjs.map +1 -1
- package/dist/typing/workflow.js +1 -55
- package/dist/typing/workflow.js.map +1 -1
- package/dist/typing/workflow.mjs +1 -55
- package/dist/typing/workflow.mjs.map +1 -1
- package/dist/utils/index.js +1 -6
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +1 -6
- package/dist/utils/index.mjs.map +1 -1
- package/dist/utils/iterators.js +1 -11
- package/dist/utils/iterators.js.map +1 -1
- package/dist/utils/iterators.mjs +1 -11
- package/dist/utils/iterators.mjs.map +1 -1
- package/dist/utils/merge.js +1 -22
- package/dist/utils/merge.js.map +1 -1
- package/dist/utils/merge.mjs +1 -22
- package/dist/utils/merge.mjs.map +1 -1
- package/dist/validation/index.js +1 -36
- package/dist/validation/index.js.map +1 -1
- package/dist/validation/index.mjs +1 -36
- package/dist/validation/index.mjs.map +1 -1
- package/package.json +13 -1
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export * from "./errors";
|
|
3
|
-
export * from "./eventStore";
|
|
4
|
-
export * from "./serialization";
|
|
5
|
-
export * from "./testing";
|
|
6
|
-
export * from "./typing";
|
|
7
|
-
export * from "./utils";
|
|
8
|
-
export * from "./validation";
|
|
1
|
+
import"./chunk-C4CXU3PY.mjs";import{a as z,b as A,c as B,d as C,e as D,f as E,g as F,h as G}from"./chunk-ERDVHQZL.mjs";import"./chunk-PNOEBD4U.mjs";import{a as H}from"./chunk-OBA6MZMG.mjs";import{a as I}from"./chunk-YKFEDBH4.mjs";import"./chunk-DIW552TK.mjs";import"./chunk-7JLAVMM3.mjs";import{a as s,b as u}from"./chunk-PKL7KGJ3.mjs";import"./chunk-HKEQAT6F.mjs";import{a as v,b as w}from"./chunk-RWKXC5FZ.mjs";import{a as y}from"./chunk-32IWULJJ.mjs";import"./chunk-IZWGWZ3P.mjs";import"./chunk-3LYVXI5R.mjs";import"./chunk-YKICRTHH.mjs";import"./chunk-XLZS42HB.mjs";import{a as q}from"./chunk-O2ZUNWMO.mjs";import{a as n}from"./chunk-JJHE2RKT.mjs";import"./chunk-45ODDXOQ.mjs";import{a as l}from"./chunk-CTCSK4FW.mjs";import"./chunk-D24KLTN5.mjs";import{a as d,b as g,c as h,d as i,e as j,f as k}from"./chunk-UI6CV7VB.mjs";import{a as o,b as r,c as e,d as f,e as m,f as p,g as t,h as x,i as a,j as b,k as c}from"./chunk-YV6PB6LX.mjs";export{n as CommandHandler,x as ConcurrencyError,q as DeciderCommandHandler,y as DeciderSpecification,t as EmmettError,k as ExpectedVersionConflictError,b as IllegalStateError,u as JSONParser,h as NO_CONCURRENCY_CHECK,c as NotFoundError,s as ParseError,g as STREAM_DOES_NOT_EXIST,d as STREAM_EXISTS,a as ValidationError,o as ValidationErrors,G as accept,j as assertExpectedVersionMatchesCurrent,w as assertMatches,f as assertNotEmptyString,m as assertPositiveNumber,p as assertUnsignedBigInt,D as complete,F as error,l as getInMemoryEventStore,E as ignore,r as isNumber,e as isString,v as isSubset,i as matchesExpectedVersion,I as merge,B as publish,z as reply,C as schedule,A as send,H as sum};
|
|
9
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-LOJ6A4AJ.js');require('../chunk-AU2WZCER.js');var _chunkLYKEARRWjs = require('../chunk-LYKEARRW.js');exports.JSONParser = _chunkLYKEARRWjs.b; exports.ParseError = _chunkLYKEARRWjs.a;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
import"../chunk-DIW552TK.mjs";import"../chunk-7JLAVMM3.mjs";import{a,b}from"../chunk-PKL7KGJ3.mjs";export{b as JSONParser,a as ParseError};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,23 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
constructor(text) {
|
|
3
|
-
super(`Cannot parse! ${text}`);
|
|
4
|
-
}
|
|
5
|
-
}
|
|
6
|
-
const JSONParser = {
|
|
7
|
-
stringify: (value, options) => {
|
|
8
|
-
return JSON.stringify(
|
|
9
|
-
_optionalChain([options, 'optionalAccess', _ => _.map]) ? options.map(value) : value
|
|
10
|
-
);
|
|
11
|
-
},
|
|
12
|
-
parse: (text, options) => {
|
|
13
|
-
const parsed = JSON.parse(text, _optionalChain([options, 'optionalAccess', _2 => _2.reviver]));
|
|
14
|
-
if (_optionalChain([options, 'optionalAccess', _3 => _3.typeCheck]) && !_optionalChain([options, 'optionalAccess', _4 => _4.typeCheck, 'call', _5 => _5(parsed)]))
|
|
15
|
-
throw new ParseError(text);
|
|
16
|
-
return _optionalChain([options, 'optionalAccess', _6 => _6.map]) ? options.map(parsed) : parsed;
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
exports.JSONParser = JSONParser; exports.ParseError = ParseError;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkLYKEARRWjs = require('../../chunk-LYKEARRW.js');exports.JSONParser = _chunkLYKEARRWjs.b; exports.ParseError = _chunkLYKEARRWjs.a;
|
|
23
2
|
//# sourceMappingURL=JSONParser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -1,23 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
constructor(text) {
|
|
3
|
-
super(`Cannot parse! ${text}`);
|
|
4
|
-
}
|
|
5
|
-
}
|
|
6
|
-
const JSONParser = {
|
|
7
|
-
stringify: (value, options) => {
|
|
8
|
-
return JSON.stringify(
|
|
9
|
-
options?.map ? options.map(value) : value
|
|
10
|
-
);
|
|
11
|
-
},
|
|
12
|
-
parse: (text, options) => {
|
|
13
|
-
const parsed = JSON.parse(text, options?.reviver);
|
|
14
|
-
if (options?.typeCheck && !options?.typeCheck(parsed))
|
|
15
|
-
throw new ParseError(text);
|
|
16
|
-
return options?.map ? options.map(parsed) : parsed;
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
export {
|
|
20
|
-
JSONParser,
|
|
21
|
-
ParseError
|
|
22
|
-
};
|
|
1
|
+
import{a,b}from"../../chunk-PKL7KGJ3.mjs";export{b as JSONParser,a as ParseError};
|
|
23
2
|
//# sourceMappingURL=JSONParser.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-AU2WZCER.js');var _chunkLYKEARRWjs = require('../../chunk-LYKEARRW.js');exports.JSONParser = _chunkLYKEARRWjs.b; exports.ParseError = _chunkLYKEARRWjs.a;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
import"../../chunk-7JLAVMM3.mjs";import{a,b}from"../../chunk-PKL7KGJ3.mjs";export{b as JSONParser,a as ParseError};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
const sup = superObj;
|
|
3
|
-
const sub = subObj;
|
|
4
|
-
return Object.keys(sub).every((ele) => {
|
|
5
|
-
if (typeof sub[ele] == "object") {
|
|
6
|
-
return isSubset(
|
|
7
|
-
sup[ele],
|
|
8
|
-
sub[ele]
|
|
9
|
-
);
|
|
10
|
-
}
|
|
11
|
-
return sub[ele] === sup[ele];
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
const assertMatches = (actual, expected) => {
|
|
15
|
-
if (!isSubset(actual, expected))
|
|
16
|
-
throw Error(
|
|
17
|
-
`subObj:
|
|
18
|
-
${JSON.stringify(expected)}
|
|
19
|
-
is not subset of
|
|
20
|
-
${JSON.stringify(actual)}`
|
|
21
|
-
);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
exports.assertMatches = assertMatches; exports.isSubset = isSubset;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkDFPI5IXTjs = require('../chunk-DFPI5IXT.js');exports.assertMatches = _chunkDFPI5IXTjs.b; exports.isSubset = _chunkDFPI5IXTjs.a;
|
|
27
2
|
//# sourceMappingURL=assertions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
const sup = superObj;
|
|
3
|
-
const sub = subObj;
|
|
4
|
-
return Object.keys(sub).every((ele) => {
|
|
5
|
-
if (typeof sub[ele] == "object") {
|
|
6
|
-
return isSubset(
|
|
7
|
-
sup[ele],
|
|
8
|
-
sub[ele]
|
|
9
|
-
);
|
|
10
|
-
}
|
|
11
|
-
return sub[ele] === sup[ele];
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
const assertMatches = (actual, expected) => {
|
|
15
|
-
if (!isSubset(actual, expected))
|
|
16
|
-
throw Error(
|
|
17
|
-
`subObj:
|
|
18
|
-
${JSON.stringify(expected)}
|
|
19
|
-
is not subset of
|
|
20
|
-
${JSON.stringify(actual)}`
|
|
21
|
-
);
|
|
22
|
-
};
|
|
23
|
-
export {
|
|
24
|
-
assertMatches,
|
|
25
|
-
isSubset
|
|
26
|
-
};
|
|
1
|
+
import{a,b}from"../chunk-RWKXC5FZ.mjs";export{b as assertMatches,a as isSubset};
|
|
27
2
|
//# sourceMappingURL=assertions.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,42 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
const DeciderSpecification = {
|
|
3
|
-
for: (decider) => {
|
|
4
|
-
{
|
|
5
|
-
return (givenEvents) => {
|
|
6
|
-
return {
|
|
7
|
-
when: (command) => {
|
|
8
|
-
const handle = () => {
|
|
9
|
-
const existingEvents = Array.isArray(givenEvents) ? givenEvents : [givenEvents];
|
|
10
|
-
const currentState = existingEvents.reduce(
|
|
11
|
-
decider.evolve,
|
|
12
|
-
decider.initialState()
|
|
13
|
-
);
|
|
14
|
-
return decider.decide(command, currentState);
|
|
15
|
-
};
|
|
16
|
-
return {
|
|
17
|
-
then: (expectedEvents) => {
|
|
18
|
-
const resultEvents = handle();
|
|
19
|
-
const resultEventsArray = Array.isArray(resultEvents) ? resultEvents : [resultEvents];
|
|
20
|
-
const expectedEventsArray = Array.isArray(expectedEvents) ? expectedEvents : [expectedEvents];
|
|
21
|
-
_assert2.default.deepEqual(resultEventsArray, expectedEventsArray);
|
|
22
|
-
},
|
|
23
|
-
thenThrows: (check) => {
|
|
24
|
-
try {
|
|
25
|
-
handle();
|
|
26
|
-
_assert2.default.fail("Handler did not fail as expected");
|
|
27
|
-
} catch (error) {
|
|
28
|
-
if (check)
|
|
29
|
-
_assert2.default.ok(check(error));
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
exports.DeciderSpecification = DeciderSpecification;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkO34VKX7Rjs = require('../chunk-O34VKX7R.js');exports.DeciderSpecification = _chunkO34VKX7Rjs.a;
|
|
42
2
|
//# sourceMappingURL=deciderSpecification.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -1,42 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
const DeciderSpecification = {
|
|
3
|
-
for: (decider) => {
|
|
4
|
-
{
|
|
5
|
-
return (givenEvents) => {
|
|
6
|
-
return {
|
|
7
|
-
when: (command) => {
|
|
8
|
-
const handle = () => {
|
|
9
|
-
const existingEvents = Array.isArray(givenEvents) ? givenEvents : [givenEvents];
|
|
10
|
-
const currentState = existingEvents.reduce(
|
|
11
|
-
decider.evolve,
|
|
12
|
-
decider.initialState()
|
|
13
|
-
);
|
|
14
|
-
return decider.decide(command, currentState);
|
|
15
|
-
};
|
|
16
|
-
return {
|
|
17
|
-
then: (expectedEvents) => {
|
|
18
|
-
const resultEvents = handle();
|
|
19
|
-
const resultEventsArray = Array.isArray(resultEvents) ? resultEvents : [resultEvents];
|
|
20
|
-
const expectedEventsArray = Array.isArray(expectedEvents) ? expectedEvents : [expectedEvents];
|
|
21
|
-
assert.deepEqual(resultEventsArray, expectedEventsArray);
|
|
22
|
-
},
|
|
23
|
-
thenThrows: (check) => {
|
|
24
|
-
try {
|
|
25
|
-
handle();
|
|
26
|
-
assert.fail("Handler did not fail as expected");
|
|
27
|
-
} catch (error) {
|
|
28
|
-
if (check)
|
|
29
|
-
assert.ok(check(error));
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
export {
|
|
40
|
-
DeciderSpecification
|
|
41
|
-
};
|
|
1
|
+
import{a}from"../chunk-32IWULJJ.mjs";export{a as DeciderSpecification};
|
|
42
2
|
//# sourceMappingURL=deciderSpecification.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/testing/index.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
var _deciderSpecification = require('./deciderSpecification'); _createStarExport(_deciderSpecification);
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-7H3QW2YD.js');var _chunkDFPI5IXTjs = require('../chunk-DFPI5IXT.js');var _chunkO34VKX7Rjs = require('../chunk-O34VKX7R.js');exports.DeciderSpecification = _chunkO34VKX7Rjs.a; exports.assertMatches = _chunkDFPI5IXTjs.b; exports.isSubset = _chunkDFPI5IXTjs.a;
|
|
3
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
package/dist/testing/index.mjs
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export * from "./deciderSpecification";
|
|
1
|
+
import"../chunk-HKEQAT6F.mjs";import{a,b}from"../chunk-RWKXC5FZ.mjs";import{a as c}from"../chunk-32IWULJJ.mjs";export{c as DeciderSpecification,b as assertMatches,a as isSubset};
|
|
3
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/typing/command.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
"use strict"
|
|
1
|
+
"use strict";require('../chunk-QSAFGRYV.js');
|
|
2
|
+
//# sourceMappingURL=command.js.map
|
package/dist/typing/command.mjs
CHANGED
package/dist/typing/decider.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
"use strict"
|
|
1
|
+
"use strict";require('../chunk-7FJXUW3D.js');
|
|
2
|
+
//# sourceMappingURL=decider.js.map
|
package/dist/typing/decider.mjs
CHANGED
package/dist/typing/event.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
"use strict"
|
|
1
|
+
"use strict";require('../chunk-BARLLX6S.js');
|
|
2
|
+
//# sourceMappingURL=event.js.map
|
package/dist/typing/event.mjs
CHANGED
package/dist/typing/index.d.mts
CHANGED
|
@@ -58,22 +58,22 @@ type WorkflowOutput<TOutput extends Command | Event> = {
|
|
|
58
58
|
kind: 'Error';
|
|
59
59
|
reason: string;
|
|
60
60
|
};
|
|
61
|
-
declare const reply: <TOutput extends
|
|
62
|
-
declare const send: <TOutput extends
|
|
61
|
+
declare const reply: <TOutput extends Command | Event>(message: TOutput) => WorkflowOutput<TOutput>;
|
|
62
|
+
declare const send: <TOutput extends Command | Event>(message: Extract<TOutput, {
|
|
63
63
|
__brand?: "Command" | undefined;
|
|
64
64
|
}>) => WorkflowOutput<TOutput>;
|
|
65
|
-
declare const publish: <TOutput extends
|
|
65
|
+
declare const publish: <TOutput extends Command | Event>(message: Extract<TOutput, {
|
|
66
66
|
__brand?: "Event" | undefined;
|
|
67
67
|
}>) => WorkflowOutput<TOutput>;
|
|
68
|
-
declare const schedule: <TOutput extends
|
|
68
|
+
declare const schedule: <TOutput extends Command | Event>(message: TOutput, when: {
|
|
69
69
|
afterInMs: number;
|
|
70
70
|
} | {
|
|
71
71
|
at: Date;
|
|
72
72
|
}) => WorkflowOutput<TOutput>;
|
|
73
|
-
declare const complete: <TOutput extends
|
|
74
|
-
declare const ignore: <TOutput extends
|
|
75
|
-
declare const error: <TOutput extends
|
|
76
|
-
declare const accept: <TOutput extends
|
|
73
|
+
declare const complete: <TOutput extends Command | Event>() => WorkflowOutput<TOutput>;
|
|
74
|
+
declare const ignore: <TOutput extends Command | Event>(reason: string) => WorkflowOutput<TOutput>;
|
|
75
|
+
declare const error: <TOutput extends Command | Event>(reason: string) => WorkflowOutput<TOutput>;
|
|
76
|
+
declare const accept: <TOutput extends Command | Event>() => WorkflowOutput<TOutput>;
|
|
77
77
|
|
|
78
78
|
type Brand<K, T> = K & {
|
|
79
79
|
readonly __brand: T;
|
package/dist/typing/index.d.ts
CHANGED
|
@@ -58,22 +58,22 @@ type WorkflowOutput<TOutput extends Command | Event> = {
|
|
|
58
58
|
kind: 'Error';
|
|
59
59
|
reason: string;
|
|
60
60
|
};
|
|
61
|
-
declare const reply: <TOutput extends
|
|
62
|
-
declare const send: <TOutput extends
|
|
61
|
+
declare const reply: <TOutput extends Command | Event>(message: TOutput) => WorkflowOutput<TOutput>;
|
|
62
|
+
declare const send: <TOutput extends Command | Event>(message: Extract<TOutput, {
|
|
63
63
|
__brand?: "Command" | undefined;
|
|
64
64
|
}>) => WorkflowOutput<TOutput>;
|
|
65
|
-
declare const publish: <TOutput extends
|
|
65
|
+
declare const publish: <TOutput extends Command | Event>(message: Extract<TOutput, {
|
|
66
66
|
__brand?: "Event" | undefined;
|
|
67
67
|
}>) => WorkflowOutput<TOutput>;
|
|
68
|
-
declare const schedule: <TOutput extends
|
|
68
|
+
declare const schedule: <TOutput extends Command | Event>(message: TOutput, when: {
|
|
69
69
|
afterInMs: number;
|
|
70
70
|
} | {
|
|
71
71
|
at: Date;
|
|
72
72
|
}) => WorkflowOutput<TOutput>;
|
|
73
|
-
declare const complete: <TOutput extends
|
|
74
|
-
declare const ignore: <TOutput extends
|
|
75
|
-
declare const error: <TOutput extends
|
|
76
|
-
declare const accept: <TOutput extends
|
|
73
|
+
declare const complete: <TOutput extends Command | Event>() => WorkflowOutput<TOutput>;
|
|
74
|
+
declare const ignore: <TOutput extends Command | Event>(reason: string) => WorkflowOutput<TOutput>;
|
|
75
|
+
declare const error: <TOutput extends Command | Event>(reason: string) => WorkflowOutput<TOutput>;
|
|
76
|
+
declare const accept: <TOutput extends Command | Event>() => WorkflowOutput<TOutput>;
|
|
77
77
|
|
|
78
78
|
type Brand<K, T> = K & {
|
|
79
79
|
readonly __brand: T;
|
package/dist/typing/index.js
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
var _event = require('./event'); _createStarExport(_event);
|
|
3
|
-
var _decider = require('./decider'); _createStarExport(_decider);
|
|
4
|
-
var _workflow = require('./workflow'); _createStarExport(_workflow);
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-Z7EDILIO.js');var _chunk7EZVPMJ6js = require('../chunk-7EZVPMJ6.js');require('../chunk-QSAFGRYV.js');require('../chunk-7FJXUW3D.js');require('../chunk-BARLLX6S.js');exports.accept = _chunk7EZVPMJ6js.h; exports.complete = _chunk7EZVPMJ6js.e; exports.error = _chunk7EZVPMJ6js.g; exports.ignore = _chunk7EZVPMJ6js.f; exports.publish = _chunk7EZVPMJ6js.c; exports.reply = _chunk7EZVPMJ6js.a; exports.schedule = _chunk7EZVPMJ6js.d; exports.send = _chunk7EZVPMJ6js.b;
|
|
5
2
|
//# sourceMappingURL=index.js.map
|
package/dist/typing/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
package/dist/typing/index.mjs
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export * from "./event";
|
|
3
|
-
export * from "./decider";
|
|
4
|
-
export * from "./workflow";
|
|
1
|
+
import"../chunk-C4CXU3PY.mjs";import{a,b,c,d,e,f,g,h}from"../chunk-ERDVHQZL.mjs";import"../chunk-IZWGWZ3P.mjs";import"../chunk-3LYVXI5R.mjs";import"../chunk-YKICRTHH.mjs";export{h as accept,e as complete,g as error,f as ignore,c as publish,a as reply,d as schedule,b as send};
|
|
5
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/typing/workflow.js
CHANGED
|
@@ -1,56 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
return {
|
|
3
|
-
kind: "Reply",
|
|
4
|
-
message
|
|
5
|
-
};
|
|
6
|
-
};
|
|
7
|
-
const send = (message) => {
|
|
8
|
-
return {
|
|
9
|
-
kind: "Send",
|
|
10
|
-
message
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
const publish = (message) => {
|
|
14
|
-
return {
|
|
15
|
-
kind: "Publish",
|
|
16
|
-
message
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
const schedule = (message, when) => {
|
|
20
|
-
return {
|
|
21
|
-
kind: "Schedule",
|
|
22
|
-
message,
|
|
23
|
-
when
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
const complete = () => {
|
|
27
|
-
return {
|
|
28
|
-
kind: "Complete"
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
const ignore = (reason) => {
|
|
32
|
-
return {
|
|
33
|
-
kind: "Ignore",
|
|
34
|
-
reason
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
const error = (reason) => {
|
|
38
|
-
return {
|
|
39
|
-
kind: "Error",
|
|
40
|
-
reason
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
const accept = () => {
|
|
44
|
-
return { kind: "Accept" };
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
exports.accept = accept; exports.complete = complete; exports.error = error; exports.ignore = ignore; exports.publish = publish; exports.reply = reply; exports.schedule = schedule; exports.send = send;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk7EZVPMJ6js = require('../chunk-7EZVPMJ6.js');exports.accept = _chunk7EZVPMJ6js.h; exports.complete = _chunk7EZVPMJ6js.e; exports.error = _chunk7EZVPMJ6js.g; exports.ignore = _chunk7EZVPMJ6js.f; exports.publish = _chunk7EZVPMJ6js.c; exports.reply = _chunk7EZVPMJ6js.a; exports.schedule = _chunk7EZVPMJ6js.d; exports.send = _chunk7EZVPMJ6js.b;
|
|
56
2
|
//# sourceMappingURL=workflow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
package/dist/typing/workflow.mjs
CHANGED
|
@@ -1,56 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
return {
|
|
3
|
-
kind: "Reply",
|
|
4
|
-
message
|
|
5
|
-
};
|
|
6
|
-
};
|
|
7
|
-
const send = (message) => {
|
|
8
|
-
return {
|
|
9
|
-
kind: "Send",
|
|
10
|
-
message
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
const publish = (message) => {
|
|
14
|
-
return {
|
|
15
|
-
kind: "Publish",
|
|
16
|
-
message
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
const schedule = (message, when) => {
|
|
20
|
-
return {
|
|
21
|
-
kind: "Schedule",
|
|
22
|
-
message,
|
|
23
|
-
when
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
const complete = () => {
|
|
27
|
-
return {
|
|
28
|
-
kind: "Complete"
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
const ignore = (reason) => {
|
|
32
|
-
return {
|
|
33
|
-
kind: "Ignore",
|
|
34
|
-
reason
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
const error = (reason) => {
|
|
38
|
-
return {
|
|
39
|
-
kind: "Error",
|
|
40
|
-
reason
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
const accept = () => {
|
|
44
|
-
return { kind: "Accept" };
|
|
45
|
-
};
|
|
46
|
-
export {
|
|
47
|
-
accept,
|
|
48
|
-
complete,
|
|
49
|
-
error,
|
|
50
|
-
ignore,
|
|
51
|
-
publish,
|
|
52
|
-
reply,
|
|
53
|
-
schedule,
|
|
54
|
-
send
|
|
55
|
-
};
|
|
1
|
+
import{a,b,c,d,e,f,g,h}from"../chunk-ERDVHQZL.mjs";export{h as accept,e as complete,g as error,f as ignore,c as publish,a as reply,d as schedule,b as send};
|
|
56
2
|
//# sourceMappingURL=workflow.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/utils/index.js
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
var _merge = require('./merge'); _createStarExport(_merge);
|
|
3
|
-
var utils_default = {};
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.default = utils_default;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWIMBG2PXjs = require('../chunk-WIMBG2PX.js');var _chunkFE73T2NSjs = require('../chunk-FE73T2NS.js');var _chunk3JE5DUJ2js = require('../chunk-3JE5DUJ2.js');exports.default = _chunkWIMBG2PXjs.a; exports.merge = _chunk3JE5DUJ2js.a; exports.sum = _chunkFE73T2NSjs.a;
|
|
7
2
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|