@event-driven-io/emmett 0.5.5 → 0.7.0
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-4PGUBQK3.js +2 -0
- package/dist/chunk-4PGUBQK3.js.map +1 -0
- package/dist/chunk-5BGN2FV4.js +1 -0
- package/dist/chunk-6WITJBGG.js +2 -0
- package/dist/chunk-6WITJBGG.js.map +1 -0
- package/dist/chunk-7D2LV2X5.js +5 -0
- package/dist/chunk-7D2LV2X5.js.map +1 -0
- package/dist/chunk-AMRL5G7K.mjs +2 -0
- package/dist/chunk-AMRL5G7K.mjs.map +1 -0
- package/dist/chunk-AWUWW7EJ.mjs +2 -0
- package/dist/chunk-AWUWW7EJ.mjs.map +1 -0
- package/dist/chunk-AYVR4VYR.mjs +2 -0
- package/dist/chunk-AYVR4VYR.mjs.map +1 -0
- package/dist/chunk-DOHUIBZQ.mjs +1 -0
- package/dist/chunk-HVU6UBXF.mjs +5 -0
- package/dist/chunk-HVU6UBXF.mjs.map +1 -0
- package/dist/chunk-JDYZZRJE.mjs +2 -0
- package/dist/chunk-JDYZZRJE.mjs.map +1 -0
- package/dist/chunk-MHB2JU4U.js +2 -0
- package/dist/chunk-MHB2JU4U.js.map +1 -0
- package/dist/chunk-S3PRXL2J.js +2 -0
- package/dist/chunk-S3PRXL2J.js.map +1 -0
- package/dist/chunk-TDCMNVXU.mjs +1 -0
- package/dist/chunk-YWRV75GA.mjs +1 -0
- package/dist/chunk-Z4Z6POJH.js +1 -0
- package/dist/chunk-ZLASBJGR.js +1 -0
- package/dist/commandHandling/handleCommand.d.mts +3 -2
- package/dist/commandHandling/handleCommand.d.ts +3 -2
- package/dist/commandHandling/handleCommandWithDecider.d.mts +3 -2
- package/dist/commandHandling/handleCommandWithDecider.d.ts +3 -2
- package/dist/commandHandling/index.d.mts +1 -0
- package/dist/commandHandling/index.d.ts +1 -0
- package/dist/eventStore/eventStore.d.mts +1 -0
- package/dist/eventStore/eventStore.d.ts +1 -0
- package/dist/eventStore/expectedVersion.d.mts +1 -0
- package/dist/eventStore/expectedVersion.d.ts +1 -0
- package/dist/eventStore/inMemoryEventStore.d.mts +1 -0
- package/dist/eventStore/inMemoryEventStore.d.ts +1 -0
- package/dist/eventStore/index.d.mts +1 -0
- package/dist/eventStore/index.d.ts +1 -0
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/messageBus/index.d.mts +44 -0
- package/dist/messageBus/index.d.ts +44 -0
- package/dist/messageBus/index.js +2 -0
- package/dist/messageBus/index.js.map +1 -0
- package/dist/messageBus/index.mjs +2 -0
- package/dist/messageBus/index.mjs.map +1 -0
- package/dist/serialization/json/JSONParser.d.mts +1 -1
- package/dist/serialization/json/JSONParser.d.ts +1 -1
- package/dist/testing/assertions.js +1 -1
- package/dist/testing/assertions.mjs +1 -1
- package/dist/testing/deciderSpecification.d.mts +4 -4
- package/dist/testing/deciderSpecification.d.ts +4 -4
- package/dist/testing/features.d.mts +13 -0
- package/dist/testing/features.d.ts +13 -0
- package/dist/testing/features.js +2 -0
- package/dist/testing/features.mjs +2 -0
- package/dist/testing/index.d.mts +6 -0
- package/dist/testing/index.d.ts +6 -0
- package/dist/testing/index.js +1 -1
- package/dist/testing/index.mjs +1 -1
- package/dist/testing/shoppingCart.domain.d.mts +23 -0
- package/dist/testing/shoppingCart.domain.d.ts +23 -0
- package/dist/testing/shoppingCart.domain.js +2 -0
- package/dist/testing/shoppingCart.domain.js.map +1 -0
- package/dist/testing/shoppingCart.domain.mjs +2 -0
- package/dist/testing/shoppingCart.domain.mjs.map +1 -0
- package/dist/typing/command.d.mts +2 -1
- package/dist/typing/command.d.ts +2 -1
- package/dist/typing/command.js +1 -1
- package/dist/typing/command.mjs +1 -1
- package/dist/typing/decider.d.mts +1 -0
- package/dist/typing/decider.d.ts +1 -0
- package/dist/typing/deepReadonly.d.mts +15 -0
- package/dist/typing/deepReadonly.d.ts +15 -0
- package/dist/typing/deepReadonly.js +2 -0
- package/dist/typing/deepReadonly.js.map +1 -0
- package/dist/typing/deepReadonly.mjs +2 -0
- package/dist/typing/deepReadonly.mjs.map +1 -0
- package/dist/typing/event.d.mts +2 -1
- package/dist/typing/event.d.ts +2 -1
- package/dist/typing/event.js +1 -1
- package/dist/typing/event.mjs +1 -1
- package/dist/typing/index.d.mts +28 -11
- package/dist/typing/index.d.ts +28 -11
- package/dist/typing/index.js +1 -1
- package/dist/typing/index.mjs +1 -1
- package/dist/typing/workflow.d.mts +1 -0
- package/dist/typing/workflow.d.ts +1 -0
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-7H3QW2YD.js +0 -1
- package/dist/chunk-BARLLX6S.js +0 -1
- package/dist/chunk-C4CXU3PY.mjs +0 -1
- package/dist/chunk-DFPI5IXT.js +0 -5
- package/dist/chunk-DFPI5IXT.js.map +0 -1
- package/dist/chunk-HKEQAT6F.mjs +0 -1
- package/dist/chunk-IZWGWZ3P.mjs +0 -1
- package/dist/chunk-QSAFGRYV.js +0 -1
- package/dist/chunk-RWKXC5FZ.mjs +0 -5
- package/dist/chunk-RWKXC5FZ.mjs.map +0 -1
- package/dist/chunk-YKICRTHH.mjs +0 -1
- package/dist/chunk-Z7EDILIO.js +0 -1
- /package/dist/{chunk-7H3QW2YD.js.map → chunk-5BGN2FV4.js.map} +0 -0
- /package/dist/{chunk-C4CXU3PY.mjs.map → chunk-DOHUIBZQ.mjs.map} +0 -0
- /package/dist/{chunk-HKEQAT6F.mjs.map → chunk-TDCMNVXU.mjs.map} +0 -0
- /package/dist/{chunk-IZWGWZ3P.mjs.map → chunk-YWRV75GA.mjs.map} +0 -0
- /package/dist/{chunk-BARLLX6S.js.map → chunk-Z4Z6POJH.js.map} +0 -0
- /package/dist/{chunk-QSAFGRYV.js.map → chunk-ZLASBJGR.js.map} +0 -0
- /package/dist/{chunk-Z7EDILIO.js.map → testing/features.js.map} +0 -0
- /package/dist/{chunk-YKICRTHH.mjs.map → testing/features.mjs.map} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk6WITJBGGjs = require('../chunk-6WITJBGG.js');require('../chunk-4PGUBQK3.js');require('../chunk-ZLASBJGR.js');require('../chunk-MHB2JU4U.js');require('../chunk-7FJXUW3D.js');require('../chunk-5BGN2FV4.js');require('../chunk-S3PRXL2J.js');require('../chunk-7EZVPMJ6.js');exports.testAggregateStream = _chunk6WITJBGGjs.a;
|
|
2
|
+
//# sourceMappingURL=features.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"../chunk-AMRL5G7K.mjs";import"../chunk-AYVR4VYR.mjs";import"../chunk-YWRV75GA.mjs";import"../chunk-JDYZZRJE.mjs";import"../chunk-3LYVXI5R.mjs";import"../chunk-DOHUIBZQ.mjs";import"../chunk-AWUWW7EJ.mjs";import"../chunk-ERDVHQZL.mjs";export{a as testAggregateStream};
|
|
2
|
+
//# sourceMappingURL=features.mjs.map
|
package/dist/testing/index.d.mts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
export { assertMatches, isSubset } from './assertions.mjs';
|
|
2
2
|
export { DeciderSpecfication, DeciderSpecification } from './deciderSpecification.mjs';
|
|
3
|
+
export { EventStoreFactory, testAggregateStream } from './features.mjs';
|
|
4
|
+
export { DiscountApplied, PricedProductItem, ProductItemAdded, ShoppingCart, ShoppingCartEvent, evolve, getInitialState } from './shoppingCart.domain.mjs';
|
|
5
|
+
import '../eventStore-DLezSgsV.mjs';
|
|
6
|
+
import '../typing/index.mjs';
|
|
7
|
+
import '../typing/deepReadonly.mjs';
|
|
8
|
+
import '../errors/index.mjs';
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
export { assertMatches, isSubset } from './assertions.js';
|
|
2
2
|
export { DeciderSpecfication, DeciderSpecification } from './deciderSpecification.js';
|
|
3
|
+
export { EventStoreFactory, testAggregateStream } from './features.js';
|
|
4
|
+
export { DiscountApplied, PricedProductItem, ProductItemAdded, ShoppingCart, ShoppingCartEvent, evolve, getInitialState } from './shoppingCart.domain.js';
|
|
5
|
+
import '../eventStore-N_YMFCDT.js';
|
|
6
|
+
import '../typing/index.js';
|
|
7
|
+
import '../typing/deepReadonly.js';
|
|
8
|
+
import '../errors/index.js';
|
package/dist/testing/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-Z4Z6POJH.js');var _chunk7D2LV2X5js = require('../chunk-7D2LV2X5.js');var _chunkO34VKX7Rjs = require('../chunk-O34VKX7R.js');var _chunk6WITJBGGjs = require('../chunk-6WITJBGG.js');var _chunk4PGUBQK3js = require('../chunk-4PGUBQK3.js');require('../chunk-ZLASBJGR.js');require('../chunk-MHB2JU4U.js');require('../chunk-7FJXUW3D.js');require('../chunk-5BGN2FV4.js');require('../chunk-S3PRXL2J.js');require('../chunk-7EZVPMJ6.js');exports.DeciderSpecification = _chunkO34VKX7Rjs.a; exports.assertMatches = _chunk7D2LV2X5js.b; exports.evolve = _chunk4PGUBQK3js.a; exports.getInitialState = _chunk4PGUBQK3js.b; exports.isSubset = _chunk7D2LV2X5js.a; exports.testAggregateStream = _chunk6WITJBGGjs.a;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/testing/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-
|
|
1
|
+
import"../chunk-TDCMNVXU.mjs";import{a,b}from"../chunk-HVU6UBXF.mjs";import{a as c}from"../chunk-32IWULJJ.mjs";import{a as f}from"../chunk-AMRL5G7K.mjs";import{a as d,b as e}from"../chunk-AYVR4VYR.mjs";import"../chunk-YWRV75GA.mjs";import"../chunk-JDYZZRJE.mjs";import"../chunk-3LYVXI5R.mjs";import"../chunk-DOHUIBZQ.mjs";import"../chunk-AWUWW7EJ.mjs";import"../chunk-ERDVHQZL.mjs";export{c as DeciderSpecification,b as assertMatches,d as evolve,e as getInitialState,a as isSubset,f as testAggregateStream};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Event } from '../typing/index.mjs';
|
|
2
|
+
import '../typing/deepReadonly.mjs';
|
|
3
|
+
|
|
4
|
+
type PricedProductItem = {
|
|
5
|
+
productId: string;
|
|
6
|
+
quantity: number;
|
|
7
|
+
price: number;
|
|
8
|
+
};
|
|
9
|
+
type ShoppingCart = {
|
|
10
|
+
productItems: PricedProductItem[];
|
|
11
|
+
totalAmount: number;
|
|
12
|
+
};
|
|
13
|
+
type ProductItemAdded = Event<'ProductItemAdded', {
|
|
14
|
+
productItem: PricedProductItem;
|
|
15
|
+
}>;
|
|
16
|
+
type DiscountApplied = Event<'DiscountApplied', {
|
|
17
|
+
percent: number;
|
|
18
|
+
}>;
|
|
19
|
+
type ShoppingCartEvent = ProductItemAdded | DiscountApplied;
|
|
20
|
+
declare const evolve: (state: ShoppingCart, { type, data }: ShoppingCartEvent) => ShoppingCart;
|
|
21
|
+
declare const getInitialState: () => ShoppingCart;
|
|
22
|
+
|
|
23
|
+
export { type DiscountApplied, type PricedProductItem, type ProductItemAdded, type ShoppingCart, type ShoppingCartEvent, evolve, getInitialState };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Event } from '../typing/index.js';
|
|
2
|
+
import '../typing/deepReadonly.js';
|
|
3
|
+
|
|
4
|
+
type PricedProductItem = {
|
|
5
|
+
productId: string;
|
|
6
|
+
quantity: number;
|
|
7
|
+
price: number;
|
|
8
|
+
};
|
|
9
|
+
type ShoppingCart = {
|
|
10
|
+
productItems: PricedProductItem[];
|
|
11
|
+
totalAmount: number;
|
|
12
|
+
};
|
|
13
|
+
type ProductItemAdded = Event<'ProductItemAdded', {
|
|
14
|
+
productItem: PricedProductItem;
|
|
15
|
+
}>;
|
|
16
|
+
type DiscountApplied = Event<'DiscountApplied', {
|
|
17
|
+
percent: number;
|
|
18
|
+
}>;
|
|
19
|
+
type ShoppingCartEvent = ProductItemAdded | DiscountApplied;
|
|
20
|
+
declare const evolve: (state: ShoppingCart, { type, data }: ShoppingCartEvent) => ShoppingCart;
|
|
21
|
+
declare const getInitialState: () => ShoppingCart;
|
|
22
|
+
|
|
23
|
+
export { type DiscountApplied, type PricedProductItem, type ProductItemAdded, type ShoppingCart, type ShoppingCartEvent, evolve, getInitialState };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk4PGUBQK3js = require('../chunk-4PGUBQK3.js');require('../chunk-ZLASBJGR.js');require('../chunk-MHB2JU4U.js');require('../chunk-7FJXUW3D.js');require('../chunk-5BGN2FV4.js');require('../chunk-S3PRXL2J.js');require('../chunk-7EZVPMJ6.js');exports.evolve = _chunk4PGUBQK3js.a; exports.getInitialState = _chunk4PGUBQK3js.b;
|
|
2
|
+
//# sourceMappingURL=shoppingCart.domain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b}from"../chunk-AYVR4VYR.mjs";import"../chunk-YWRV75GA.mjs";import"../chunk-JDYZZRJE.mjs";import"../chunk-3LYVXI5R.mjs";import"../chunk-DOHUIBZQ.mjs";import"../chunk-AWUWW7EJ.mjs";import"../chunk-ERDVHQZL.mjs";export{a as evolve,b as getInitialState};
|
|
2
|
+
//# sourceMappingURL=shoppingCart.domain.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { Command, DefaultCommandMetadata } from './index.mjs';
|
|
1
|
+
export { Command, CommandDataOf, CommandMetaDataOf, CommandTypeOf, CreateCommandType, DefaultCommandMetadata, command } from './index.mjs';
|
|
2
|
+
import './deepReadonly.mjs';
|
package/dist/typing/command.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { Command, DefaultCommandMetadata } from './index.js';
|
|
1
|
+
export { Command, CommandDataOf, CommandMetaDataOf, CommandTypeOf, CreateCommandType, DefaultCommandMetadata, command } from './index.js';
|
|
2
|
+
import './deepReadonly.js';
|
package/dist/typing/command.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";require('../chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkMHB2JU4Ujs = require('../chunk-MHB2JU4U.js');exports.command = _chunkMHB2JU4Ujs.a;
|
|
2
2
|
//# sourceMappingURL=command.js.map
|
package/dist/typing/command.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-
|
|
1
|
+
import{a}from"../chunk-JDYZZRJE.mjs";export{a as command};
|
|
2
2
|
//# sourceMappingURL=command.mjs.map
|
package/dist/typing/decider.d.ts
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type Primitive = undefined | null | boolean | string | number | bigint | symbol | Function;
|
|
2
|
+
type ImmutableTypes = Date | RegExp;
|
|
3
|
+
type DeepReadonly<T> = T extends Primitive | ImmutableTypes ? T : T extends Array<infer U> ? ReadonlyArray<DeepReadonly<U>> : T extends Map<infer K, infer V> ? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>> : T extends Set<infer M> ? ReadonlySet<DeepReadonly<M>> : T extends Promise<infer U> ? Promise<DeepReadonly<U>> : T extends object ? DeepReadonlyObject<T> : Readonly<T>;
|
|
4
|
+
type DeepReadonlyObject<T> = {
|
|
5
|
+
readonly [P in keyof T]: DeepReadonly<T[P]>;
|
|
6
|
+
};
|
|
7
|
+
type Mutable<T> = T extends Primitive ? T : T extends ReadonlyArray<infer U> ? MutableArray<U> : T extends ReadonlyMap<infer K, infer V> ? MutableMap<K, V> : T extends ReadonlySet<infer M> ? MutableSet<M> : T extends Function ? T : T extends object ? MutableObject<T> : unknown;
|
|
8
|
+
type MutableArray<T> = Array<Mutable<T>>;
|
|
9
|
+
type MutableMap<K, V> = Map<Mutable<K>, Mutable<V>>;
|
|
10
|
+
type MutableSet<T> = Set<Mutable<T>>;
|
|
11
|
+
type MutableObject<T> = {
|
|
12
|
+
-readonly [P in keyof T]: Mutable<T[P]>;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type { DeepReadonly, Mutable };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type Primitive = undefined | null | boolean | string | number | bigint | symbol | Function;
|
|
2
|
+
type ImmutableTypes = Date | RegExp;
|
|
3
|
+
type DeepReadonly<T> = T extends Primitive | ImmutableTypes ? T : T extends Array<infer U> ? ReadonlyArray<DeepReadonly<U>> : T extends Map<infer K, infer V> ? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>> : T extends Set<infer M> ? ReadonlySet<DeepReadonly<M>> : T extends Promise<infer U> ? Promise<DeepReadonly<U>> : T extends object ? DeepReadonlyObject<T> : Readonly<T>;
|
|
4
|
+
type DeepReadonlyObject<T> = {
|
|
5
|
+
readonly [P in keyof T]: DeepReadonly<T[P]>;
|
|
6
|
+
};
|
|
7
|
+
type Mutable<T> = T extends Primitive ? T : T extends ReadonlyArray<infer U> ? MutableArray<U> : T extends ReadonlyMap<infer K, infer V> ? MutableMap<K, V> : T extends ReadonlySet<infer M> ? MutableSet<M> : T extends Function ? T : T extends object ? MutableObject<T> : unknown;
|
|
8
|
+
type MutableArray<T> = Array<Mutable<T>>;
|
|
9
|
+
type MutableMap<K, V> = Map<Mutable<K>, Mutable<V>>;
|
|
10
|
+
type MutableSet<T> = Set<Mutable<T>>;
|
|
11
|
+
type MutableObject<T> = {
|
|
12
|
+
-readonly [P in keyof T]: Mutable<T[P]>;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type { DeepReadonly, Mutable };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/typing/event.d.mts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { Event } from './index.mjs';
|
|
1
|
+
export { CreateEventType, Event, EventDataOf, EventMetaDataOf, EventTypeOf, event } from './index.mjs';
|
|
2
|
+
import './deepReadonly.mjs';
|
package/dist/typing/event.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { Event } from './index.js';
|
|
1
|
+
export { CreateEventType, Event, EventDataOf, EventMetaDataOf, EventTypeOf, event } from './index.js';
|
|
2
|
+
import './deepReadonly.js';
|
package/dist/typing/event.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";require('../chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkS3PRXL2Jjs = require('../chunk-S3PRXL2J.js');exports.event = _chunkS3PRXL2Jjs.a;
|
|
2
2
|
//# sourceMappingURL=event.js.map
|
package/dist/typing/event.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-
|
|
1
|
+
import{a}from"../chunk-AWUWW7EJ.mjs";export{a as event};
|
|
2
2
|
//# sourceMappingURL=event.mjs.map
|
package/dist/typing/index.d.mts
CHANGED
|
@@ -1,17 +1,37 @@
|
|
|
1
|
-
|
|
1
|
+
export { DeepReadonly, Mutable } from './deepReadonly.mjs';
|
|
2
|
+
|
|
3
|
+
type Command<CommandType extends string = string, CommandData extends DefaultRecord = DefaultRecord, CommandMetaData extends DefaultRecord = DefaultCommandMetadata> = Flavour<Readonly<{
|
|
2
4
|
type: CommandType;
|
|
3
5
|
data: Readonly<CommandData>;
|
|
4
6
|
metadata?: CommandMetaData | undefined;
|
|
5
7
|
}>, 'Command'>;
|
|
8
|
+
type CommandTypeOf<T extends Command> = T['type'];
|
|
9
|
+
type CommandDataOf<T extends Command> = T['data'];
|
|
10
|
+
type CommandMetaDataOf<T extends Command> = T['metadata'];
|
|
11
|
+
type CreateCommandType<CommandType extends string, CommandData extends DefaultRecord, CommandMetaData extends DefaultRecord | undefined> = Readonly<{
|
|
12
|
+
type: CommandType;
|
|
13
|
+
data: CommandData;
|
|
14
|
+
metadata?: CommandMetaData;
|
|
15
|
+
}>;
|
|
16
|
+
declare const command: <CommandType extends Command<string, DefaultRecord, DefaultCommandMetadata>>(type: CommandTypeOf<CommandType>, data: CommandDataOf<CommandType>, metadata?: CommandMetaDataOf<CommandType>) => CreateCommandType<CommandTypeOf<CommandType>, CommandDataOf<CommandType>, CommandMetaDataOf<CommandType>>;
|
|
6
17
|
type DefaultCommandMetadata = {
|
|
7
18
|
now: Date;
|
|
8
19
|
};
|
|
9
20
|
|
|
10
|
-
type Event<EventType extends string = string, EventData extends
|
|
21
|
+
type Event<EventType extends string = string, EventData extends DefaultRecord = DefaultRecord, EventMetaData extends DefaultRecord = DefaultRecord> = Flavour<Readonly<{
|
|
11
22
|
type: EventType;
|
|
12
|
-
data:
|
|
13
|
-
metadata?: EventMetaData
|
|
23
|
+
data: EventData;
|
|
24
|
+
metadata?: EventMetaData;
|
|
14
25
|
}>, 'Event'>;
|
|
26
|
+
type EventTypeOf<T extends Event> = T['type'];
|
|
27
|
+
type EventDataOf<T extends Event> = T['data'];
|
|
28
|
+
type EventMetaDataOf<T extends Event> = T['metadata'];
|
|
29
|
+
type CreateEventType<EventType extends string, EventData extends DefaultRecord, EventMetaData extends DefaultRecord | undefined> = Readonly<{
|
|
30
|
+
type: EventType;
|
|
31
|
+
data: EventData;
|
|
32
|
+
metadata?: EventMetaData;
|
|
33
|
+
}>;
|
|
34
|
+
declare const event: <EventType extends Event<string, DefaultRecord, DefaultRecord>>(type: EventTypeOf<EventType>, data: EventDataOf<EventType>, metadata?: EventMetaDataOf<EventType>) => CreateEventType<EventTypeOf<EventType>, EventDataOf<EventType>, EventMetaDataOf<EventType>>;
|
|
15
35
|
|
|
16
36
|
type Decider<State, CommandType extends Command, StreamEvent extends Event> = {
|
|
17
37
|
decide: (command: CommandType, state: State) => StreamEvent | StreamEvent[];
|
|
@@ -59,12 +79,8 @@ type WorkflowOutput<TOutput extends Command | Event> = {
|
|
|
59
79
|
reason: string;
|
|
60
80
|
};
|
|
61
81
|
declare const reply: <TOutput extends Command | Event>(message: TOutput) => WorkflowOutput<TOutput>;
|
|
62
|
-
declare const send: <TOutput extends Command | Event>(message:
|
|
63
|
-
|
|
64
|
-
}>) => WorkflowOutput<TOutput>;
|
|
65
|
-
declare const publish: <TOutput extends Command | Event>(message: Extract<TOutput, {
|
|
66
|
-
__brand?: "Event" | undefined;
|
|
67
|
-
}>) => WorkflowOutput<TOutput>;
|
|
82
|
+
declare const send: <TOutput extends Command | Event>(message: WorkflowCommand<TOutput>) => WorkflowOutput<TOutput>;
|
|
83
|
+
declare const publish: <TOutput extends Command | Event>(message: WorkflowEvent<TOutput>) => WorkflowOutput<TOutput>;
|
|
68
84
|
declare const schedule: <TOutput extends Command | Event>(message: TOutput, when: {
|
|
69
85
|
afterInMs: number;
|
|
70
86
|
} | {
|
|
@@ -81,5 +97,6 @@ type Brand<K, T> = K & {
|
|
|
81
97
|
type Flavour<K, T> = K & {
|
|
82
98
|
readonly __brand?: T;
|
|
83
99
|
};
|
|
100
|
+
type DefaultRecord = Record<string, unknown>;
|
|
84
101
|
|
|
85
|
-
export { type Brand, type Command, type Decider, type DefaultCommandMetadata, type Event, type Flavour, type Workflow, type WorkflowCommand, type WorkflowEvent, type WorkflowOutput, accept, complete, error, ignore, publish, reply, schedule, send };
|
|
102
|
+
export { type Brand, type Command, type CommandDataOf, type CommandMetaDataOf, type CommandTypeOf, type CreateCommandType, type CreateEventType, type Decider, type DefaultCommandMetadata, type DefaultRecord, type Event, type EventDataOf, type EventMetaDataOf, type EventTypeOf, type Flavour, type Workflow, type WorkflowCommand, type WorkflowEvent, type WorkflowOutput, accept, command, complete, error, event, ignore, publish, reply, schedule, send };
|
package/dist/typing/index.d.ts
CHANGED
|
@@ -1,17 +1,37 @@
|
|
|
1
|
-
|
|
1
|
+
export { DeepReadonly, Mutable } from './deepReadonly.js';
|
|
2
|
+
|
|
3
|
+
type Command<CommandType extends string = string, CommandData extends DefaultRecord = DefaultRecord, CommandMetaData extends DefaultRecord = DefaultCommandMetadata> = Flavour<Readonly<{
|
|
2
4
|
type: CommandType;
|
|
3
5
|
data: Readonly<CommandData>;
|
|
4
6
|
metadata?: CommandMetaData | undefined;
|
|
5
7
|
}>, 'Command'>;
|
|
8
|
+
type CommandTypeOf<T extends Command> = T['type'];
|
|
9
|
+
type CommandDataOf<T extends Command> = T['data'];
|
|
10
|
+
type CommandMetaDataOf<T extends Command> = T['metadata'];
|
|
11
|
+
type CreateCommandType<CommandType extends string, CommandData extends DefaultRecord, CommandMetaData extends DefaultRecord | undefined> = Readonly<{
|
|
12
|
+
type: CommandType;
|
|
13
|
+
data: CommandData;
|
|
14
|
+
metadata?: CommandMetaData;
|
|
15
|
+
}>;
|
|
16
|
+
declare const command: <CommandType extends Command<string, DefaultRecord, DefaultCommandMetadata>>(type: CommandTypeOf<CommandType>, data: CommandDataOf<CommandType>, metadata?: CommandMetaDataOf<CommandType>) => CreateCommandType<CommandTypeOf<CommandType>, CommandDataOf<CommandType>, CommandMetaDataOf<CommandType>>;
|
|
6
17
|
type DefaultCommandMetadata = {
|
|
7
18
|
now: Date;
|
|
8
19
|
};
|
|
9
20
|
|
|
10
|
-
type Event<EventType extends string = string, EventData extends
|
|
21
|
+
type Event<EventType extends string = string, EventData extends DefaultRecord = DefaultRecord, EventMetaData extends DefaultRecord = DefaultRecord> = Flavour<Readonly<{
|
|
11
22
|
type: EventType;
|
|
12
|
-
data:
|
|
13
|
-
metadata?: EventMetaData
|
|
23
|
+
data: EventData;
|
|
24
|
+
metadata?: EventMetaData;
|
|
14
25
|
}>, 'Event'>;
|
|
26
|
+
type EventTypeOf<T extends Event> = T['type'];
|
|
27
|
+
type EventDataOf<T extends Event> = T['data'];
|
|
28
|
+
type EventMetaDataOf<T extends Event> = T['metadata'];
|
|
29
|
+
type CreateEventType<EventType extends string, EventData extends DefaultRecord, EventMetaData extends DefaultRecord | undefined> = Readonly<{
|
|
30
|
+
type: EventType;
|
|
31
|
+
data: EventData;
|
|
32
|
+
metadata?: EventMetaData;
|
|
33
|
+
}>;
|
|
34
|
+
declare const event: <EventType extends Event<string, DefaultRecord, DefaultRecord>>(type: EventTypeOf<EventType>, data: EventDataOf<EventType>, metadata?: EventMetaDataOf<EventType>) => CreateEventType<EventTypeOf<EventType>, EventDataOf<EventType>, EventMetaDataOf<EventType>>;
|
|
15
35
|
|
|
16
36
|
type Decider<State, CommandType extends Command, StreamEvent extends Event> = {
|
|
17
37
|
decide: (command: CommandType, state: State) => StreamEvent | StreamEvent[];
|
|
@@ -59,12 +79,8 @@ type WorkflowOutput<TOutput extends Command | Event> = {
|
|
|
59
79
|
reason: string;
|
|
60
80
|
};
|
|
61
81
|
declare const reply: <TOutput extends Command | Event>(message: TOutput) => WorkflowOutput<TOutput>;
|
|
62
|
-
declare const send: <TOutput extends Command | Event>(message:
|
|
63
|
-
|
|
64
|
-
}>) => WorkflowOutput<TOutput>;
|
|
65
|
-
declare const publish: <TOutput extends Command | Event>(message: Extract<TOutput, {
|
|
66
|
-
__brand?: "Event" | undefined;
|
|
67
|
-
}>) => WorkflowOutput<TOutput>;
|
|
82
|
+
declare const send: <TOutput extends Command | Event>(message: WorkflowCommand<TOutput>) => WorkflowOutput<TOutput>;
|
|
83
|
+
declare const publish: <TOutput extends Command | Event>(message: WorkflowEvent<TOutput>) => WorkflowOutput<TOutput>;
|
|
68
84
|
declare const schedule: <TOutput extends Command | Event>(message: TOutput, when: {
|
|
69
85
|
afterInMs: number;
|
|
70
86
|
} | {
|
|
@@ -81,5 +97,6 @@ type Brand<K, T> = K & {
|
|
|
81
97
|
type Flavour<K, T> = K & {
|
|
82
98
|
readonly __brand?: T;
|
|
83
99
|
};
|
|
100
|
+
type DefaultRecord = Record<string, unknown>;
|
|
84
101
|
|
|
85
|
-
export { type Brand, type Command, type Decider, type DefaultCommandMetadata, type Event, type Flavour, type Workflow, type WorkflowCommand, type WorkflowEvent, type WorkflowOutput, accept, complete, error, ignore, publish, reply, schedule, send };
|
|
102
|
+
export { type Brand, type Command, type CommandDataOf, type CommandMetaDataOf, type CommandTypeOf, type CreateCommandType, type CreateEventType, type Decider, type DefaultCommandMetadata, type DefaultRecord, type Event, type EventDataOf, type EventMetaDataOf, type EventTypeOf, type Flavour, type Workflow, type WorkflowCommand, type WorkflowEvent, type WorkflowOutput, accept, command, complete, error, event, ignore, publish, reply, schedule, send };
|
package/dist/typing/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-ZLASBJGR.js');var _chunkMHB2JU4Ujs = require('../chunk-MHB2JU4U.js');require('../chunk-7FJXUW3D.js');require('../chunk-5BGN2FV4.js');var _chunkS3PRXL2Jjs = require('../chunk-S3PRXL2J.js');var _chunk7EZVPMJ6js = require('../chunk-7EZVPMJ6.js');exports.accept = _chunk7EZVPMJ6js.h; exports.command = _chunkMHB2JU4Ujs.a; exports.complete = _chunk7EZVPMJ6js.e; exports.error = _chunk7EZVPMJ6js.g; exports.event = _chunkS3PRXL2Jjs.a; exports.ignore = _chunk7EZVPMJ6js.f; exports.publish = _chunk7EZVPMJ6js.c; exports.reply = _chunk7EZVPMJ6js.a; exports.schedule = _chunk7EZVPMJ6js.d; exports.send = _chunk7EZVPMJ6js.b;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/typing/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-
|
|
1
|
+
import"../chunk-YWRV75GA.mjs";import{a}from"../chunk-JDYZZRJE.mjs";import"../chunk-3LYVXI5R.mjs";import"../chunk-DOHUIBZQ.mjs";import{a as b}from"../chunk-AWUWW7EJ.mjs";import{a as c,b as d,c as e,d as f,e as g,f as h,g as i,h as j}from"../chunk-ERDVHQZL.mjs";export{j as accept,a as command,g as complete,i as error,b as event,h as ignore,e as publish,c as reply,f as schedule,d as send};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/utils/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWIMBG2PXjs = require('../chunk-WIMBG2PX.js');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWIMBG2PXjs = require('../chunk-WIMBG2PX.js');var _chunk3JE5DUJ2js = require('../chunk-3JE5DUJ2.js');var _chunkFE73T2NSjs = require('../chunk-FE73T2NS.js');exports.default = _chunkWIMBG2PXjs.a; exports.merge = _chunk3JE5DUJ2js.a; exports.sum = _chunkFE73T2NSjs.a;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as c}from"../chunk-PNOEBD4U.mjs";import{a}from"../chunk-
|
|
1
|
+
import{a as c}from"../chunk-PNOEBD4U.mjs";import{a as b}from"../chunk-YKFEDBH4.mjs";import{a}from"../chunk-OBA6MZMG.mjs";export{c as default,b as merge,a as sum};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/package.json
CHANGED
package/dist/chunk-7H3QW2YD.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";//# sourceMappingURL=chunk-7H3QW2YD.js.map
|
package/dist/chunk-BARLLX6S.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";//# sourceMappingURL=chunk-BARLLX6S.js.map
|
package/dist/chunk-C4CXU3PY.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-C4CXU3PY.mjs.map
|
package/dist/chunk-DFPI5IXT.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var u=(s,o)=>{let t=s,r=o;return Object.keys(r).every(n=>typeof r[n]=="object"?u(t[n],r[n]):r[n]===t[n])},i= exports.b =(s,o)=>{if(!u(s,o))throw Error(`subObj:
|
|
2
|
-
${JSON.stringify(o)}
|
|
3
|
-
is not subset of
|
|
4
|
-
${JSON.stringify(s)}`)};exports.a = u; exports.b = i;
|
|
5
|
-
//# sourceMappingURL=chunk-DFPI5IXT.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/testing/assertions.ts"],"names":["isSubset","superObj","subObj","sup","sub","ele","assertMatches","actual","expected"],"mappings":"AAAO,IAAMA,EAAW,CAACC,EAAmBC,IAA6B,CACvE,IAAMC,EAAMF,EACNG,EAAMF,EAEZ,OAAO,OAAO,KAAKE,CAAG,EAAE,MAAOC,GACzB,OAAOD,EAAIC,CAAG,GAAK,SACdL,EACLG,EAAIE,CAAG,EACPD,EAAIC,CAAG,CACT,EAEKD,EAAIC,CAAG,IAAMF,EAAIE,CAAG,CAC5B,CACH,EAEaC,EAAgB,CAACC,EAAiBC,IAAsB,CACnE,GAAI,CAACR,EAASO,EAAQC,CAAQ,EAC5B,MAAM,MACJ;AAAA,EAAY,KAAK,UAAUA,CAAQ,CAAC;AAAA;AAAA,EAAuB,KAAK,UAAUD,CAAM,CAAC,EACnF,CACJ","sourcesContent":["export const isSubset = (superObj: unknown, subObj: unknown): boolean => {\n const sup = superObj as Record<string, unknown>;\n const sub = subObj as Record<string, unknown>;\n\n return Object.keys(sub).every((ele: string) => {\n if (typeof sub[ele] == 'object') {\n return isSubset(\n sup[ele] as Record<string, unknown>,\n sub[ele] as Record<string, unknown>,\n );\n }\n return sub[ele] === sup[ele];\n });\n};\n\nexport const assertMatches = (actual: unknown, expected: unknown) => {\n if (!isSubset(actual, expected))\n throw Error(\n `subObj:\\n${JSON.stringify(expected)}\\nis not subset of\\n${JSON.stringify(actual)}`,\n );\n};\n"]}
|
package/dist/chunk-HKEQAT6F.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-HKEQAT6F.mjs.map
|
package/dist/chunk-IZWGWZ3P.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-IZWGWZ3P.mjs.map
|
package/dist/chunk-QSAFGRYV.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";//# sourceMappingURL=chunk-QSAFGRYV.js.map
|
package/dist/chunk-RWKXC5FZ.mjs
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
var u=(s,o)=>{let t=s,r=o;return Object.keys(r).every(n=>typeof r[n]=="object"?u(t[n],r[n]):r[n]===t[n])},i=(s,o)=>{if(!u(s,o))throw Error(`subObj:
|
|
2
|
-
${JSON.stringify(o)}
|
|
3
|
-
is not subset of
|
|
4
|
-
${JSON.stringify(s)}`)};export{u as a,i as b};
|
|
5
|
-
//# sourceMappingURL=chunk-RWKXC5FZ.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/testing/assertions.ts"],"sourcesContent":["export const isSubset = (superObj: unknown, subObj: unknown): boolean => {\n const sup = superObj as Record<string, unknown>;\n const sub = subObj as Record<string, unknown>;\n\n return Object.keys(sub).every((ele: string) => {\n if (typeof sub[ele] == 'object') {\n return isSubset(\n sup[ele] as Record<string, unknown>,\n sub[ele] as Record<string, unknown>,\n );\n }\n return sub[ele] === sup[ele];\n });\n};\n\nexport const assertMatches = (actual: unknown, expected: unknown) => {\n if (!isSubset(actual, expected))\n throw Error(\n `subObj:\\n${JSON.stringify(expected)}\\nis not subset of\\n${JSON.stringify(actual)}`,\n );\n};\n"],"mappings":"AAAO,IAAMA,EAAW,CAACC,EAAmBC,IAA6B,CACvE,IAAMC,EAAMF,EACNG,EAAMF,EAEZ,OAAO,OAAO,KAAKE,CAAG,EAAE,MAAOC,GACzB,OAAOD,EAAIC,CAAG,GAAK,SACdL,EACLG,EAAIE,CAAG,EACPD,EAAIC,CAAG,CACT,EAEKD,EAAIC,CAAG,IAAMF,EAAIE,CAAG,CAC5B,CACH,EAEaC,EAAgB,CAACC,EAAiBC,IAAsB,CACnE,GAAI,CAACR,EAASO,EAAQC,CAAQ,EAC5B,MAAM,MACJ;AAAA,EAAY,KAAK,UAAUA,CAAQ,CAAC;AAAA;AAAA,EAAuB,KAAK,UAAUD,CAAM,CAAC,EACnF,CACJ","names":["isSubset","superObj","subObj","sup","sub","ele","assertMatches","actual","expected"]}
|
package/dist/chunk-YKICRTHH.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-YKICRTHH.mjs.map
|
package/dist/chunk-Z7EDILIO.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";//# sourceMappingURL=chunk-Z7EDILIO.js.map
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|