@event-driven-io/emmett 0.15.0 → 0.16.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-3ZZHSAJG.js +13 -0
- package/dist/chunk-3ZZHSAJG.js.map +1 -0
- package/dist/{chunk-4WCXAVTA.mjs → chunk-BZ6ZVZAX.mjs} +2 -2
- package/dist/{chunk-2XFHDDFU.js → chunk-C2N3BJXW.js} +2 -2
- package/dist/chunk-OTLRRXEA.js +2 -0
- package/dist/chunk-OTLRRXEA.js.map +1 -0
- package/dist/{chunk-YGYVF7JI.mjs → chunk-QWM33AYY.mjs} +1 -1
- package/dist/chunk-QWM33AYY.mjs.map +1 -0
- package/dist/{chunk-KQAFRLJ2.js → chunk-QYDAYWBJ.js} +1 -1
- package/dist/chunk-QYDAYWBJ.js.map +1 -0
- package/dist/chunk-ZIFNLQ77.mjs +2 -0
- package/dist/chunk-ZIFNLQ77.mjs.map +1 -0
- package/dist/chunk-ZUHYOH4G.mjs +13 -0
- package/dist/chunk-ZUHYOH4G.mjs.map +1 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/messageBus/index.js +1 -1
- package/dist/messageBus/index.mjs +1 -1
- package/dist/projections/index.d.mts +21 -5
- package/dist/projections/index.d.ts +21 -5
- package/dist/projections/index.js +1 -1
- package/dist/projections/index.mjs +1 -1
- package/dist/testing/assertions.d.mts +3 -1
- package/dist/testing/assertions.d.ts +3 -1
- package/dist/testing/assertions.js +1 -1
- package/dist/testing/assertions.mjs +1 -1
- package/dist/testing/deciderSpecification.js +1 -1
- package/dist/testing/deciderSpecification.mjs +1 -1
- package/dist/testing/features.js +1 -1
- package/dist/testing/features.mjs +1 -1
- package/dist/testing/index.d.mts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/testing/index.mjs +1 -1
- package/dist/testing/shoppingCart.domain.js +1 -1
- package/dist/testing/shoppingCart.domain.mjs +1 -1
- package/dist/testing/wrapEventStore.js +1 -1
- package/dist/testing/wrapEventStore.mjs +1 -1
- package/dist/typing/event.d.mts +1 -1
- package/dist/typing/event.d.ts +1 -1
- package/dist/typing/event.js +1 -1
- package/dist/typing/event.mjs +1 -1
- package/dist/typing/index.d.mts +2 -1
- package/dist/typing/index.d.ts +2 -1
- package/dist/typing/index.js +1 -1
- package/dist/typing/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-JBAGEOUC.mjs +0 -10
- package/dist/chunk-JBAGEOUC.mjs.map +0 -1
- package/dist/chunk-KQAFRLJ2.js.map +0 -1
- package/dist/chunk-NUSDLV6U.js +0 -1
- package/dist/chunk-NUSDLV6U.js.map +0 -1
- package/dist/chunk-OFBLNL5K.js +0 -10
- package/dist/chunk-OFBLNL5K.js.map +0 -1
- package/dist/chunk-YGYVF7JI.mjs.map +0 -1
- package/dist/chunk-YWZW37IT.mjs +0 -1
- package/dist/chunk-YWZW37IT.mjs.map +0 -1
- /package/dist/{chunk-4WCXAVTA.mjs.map → chunk-BZ6ZVZAX.mjs.map} +0 -0
- /package/dist/{chunk-2XFHDDFU.js.map → chunk-C2N3BJXW.js.map} +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkPVFUNWT6js = require('./chunk-PVFUNWT6.js');var _chunkMKHK5TRMjs = require('./chunk-MKHK5TRM.js');var l=class extends Error{constructor(t){super(t)}},g= exports.b =(n,t)=>{let e=n,o=t;return a(e),a(o),Object.keys(o).every(u=>typeof o[u]=="object"?g(e[u],o[u]):o[u]===e[u])},p= exports.c =n=>{throw new l(_nullishCoalesce(n, () => ("That should not ever happened, right?")))},f= exports.d =async(n,t)=>{try{throw await n(),new l("Function didn't throw expected error")}catch(e){let o=e;return t&&s(t(o)),o}},w= exports.e =(n,t)=>{try{throw n(),new l("Function didn't throw expected error")}catch(e){let o=e;return t&&s(t(o)),o}},k= exports.f =(n,t,e)=>{if(!g(n,t))throw new l(_nullishCoalesce(e, () => (`subObj:
|
|
2
|
+
${_chunkMKHK5TRMjs.b.stringify(t)}
|
|
3
|
+
is not subset of
|
|
4
|
+
${_chunkMKHK5TRMjs.b.stringify(n)}`)))},x= exports.g =(n,t,e)=>{if(!_chunkPVFUNWT6js.a.call(void 0, n,t))throw new l(_nullishCoalesce(e, () => (`subObj:
|
|
5
|
+
${_chunkMKHK5TRMjs.b.stringify(t)}
|
|
6
|
+
is not equal to
|
|
7
|
+
${_chunkMKHK5TRMjs.b.stringify(n)}`)))},E= exports.h =(n,t,e)=>{if(_chunkPVFUNWT6js.a.call(void 0, n,t))throw new l(_nullishCoalesce(e, () => (`subObj:
|
|
8
|
+
${_chunkMKHK5TRMjs.b.stringify(t)}
|
|
9
|
+
is equals to
|
|
10
|
+
${_chunkMKHK5TRMjs.b.stringify(n)}`)))},b= exports.i =n=>({isEqualTo:t=>s(_chunkPVFUNWT6js.a.call(void 0, n,t))});function h(n,t){if(n)throw new l(_nullishCoalesce(t, () => ("Condition is false")))}function s(n,t){if(!n)throw new l(_nullishCoalesce(t, () => ("Condition is false")))}function a(n,t){if(!n)throw new l(_nullishCoalesce(t, () => ("Condition is not truthy")))}function c(n,t,e){if(n!==t)throw new l(_nullishCoalesce(e, () => (`Objects are not equal:
|
|
11
|
+
Expected: ${_chunkMKHK5TRMjs.b.stringify(n)}
|
|
12
|
+
Actual:${_chunkMKHK5TRMjs.b.stringify(t)}`)))}function m(n,t,e){if(n===t)throw new l(_nullishCoalesce(e, () => (`Objects are equal: ${_chunkMKHK5TRMjs.b.stringify(n)}`)))}function y(n){m(n,null),a(n)}function O(n){c(n,null)}var v=n=>t=>_chunkPVFUNWT6js.a.call(void 0, t,n),M= exports.r =n=>t=>n(t);function A(n){return{calledTimes:t=>{c(_optionalChain([n, 'access', _ => _.mock, 'optionalAccess', _2 => _2.calls, 'optionalAccess', _3 => _3.length]),t)},notCalled:()=>{c(_optionalChain([n, 'optionalAccess', _4 => _4.mock, 'optionalAccess', _5 => _5.calls, 'optionalAccess', _6 => _6.length]),0)},called:()=>{s(_optionalChain([n, 'access', _7 => _7.mock, 'optionalAccess', _8 => _8.calls, 'access', _9 => _9.length])!==void 0&&n.mock.calls.length>0)},calledWith:(...t)=>{s(_optionalChain([n, 'access', _10 => _10.mock, 'optionalAccess', _11 => _11.calls, 'access', _12 => _12.length])!==void 0&&n.mock.calls.length>=1&&n.mock.calls.some(e=>_chunkPVFUNWT6js.a.call(void 0, e.arguments,t)))},calledOnceWith:(...t)=>{s(_optionalChain([n, 'access', _13 => _13.mock, 'optionalAccess', _14 => _14.calls, 'access', _15 => _15.length])!==void 0&&n.mock.calls.length===1&&n.mock.calls.some(e=>_chunkPVFUNWT6js.a.call(void 0, e.arguments,t)))},calledWithArgumentMatching:(...t)=>{s(_optionalChain([n, 'access', _16 => _16.mock, 'optionalAccess', _17 => _17.calls, 'access', _18 => _18.length])!==void 0&&n.mock.calls.length>=1),s(_optionalChain([n, 'access', _19 => _19.mock, 'optionalAccess', _20 => _20.calls, 'access', _21 => _21.length])!==void 0&&n.mock.calls.length>=1&&n.mock.calls.some(e=>e.arguments&&e.arguments.length>=t.length&&t.every((o,u)=>o(e.arguments[u]))))},notCalledWithArgumentMatching:(...t)=>{h(_optionalChain([n, 'access', _22 => _22.mock, 'optionalAccess', _23 => _23.calls, 'access', _24 => _24.length])!==void 0&&n.mock.calls.length>=1&&n.mock.calls[0].arguments&&n.mock.calls[0].arguments.length>=t.length&&t.every((e,o)=>e(n.mock.calls[0].arguments[o])))}}}var q=n=>({isEmpty:()=>c(n.length,0),isNotEmpty:()=>m(n.length,0),hasSize:t=>c(n.length,t),containsElements:(...t)=>{s(t.every(e=>t.some(o=>_chunkPVFUNWT6js.a.call(void 0, e,o))))},containsExactlyInAnyOrder:(...t)=>{c(n.length,t.length),s(n.every(e=>t.some(o=>_chunkPVFUNWT6js.a.call(void 0, e,o))))},containsExactlyInAnyOrderElementsOf:t=>{c(n.length,t.length),s(n.every(e=>t.some(o=>_chunkPVFUNWT6js.a.call(void 0, e,o))))},containsExactlyElementsOf:t=>{c(n.length,t.length);for(let e=0;e<n.length;e++)s(_chunkPVFUNWT6js.a.call(void 0, n[e],t[e]))},containsExactly:t=>{c(n.length,1),s(_chunkPVFUNWT6js.a.call(void 0, n[0],t))},contains:t=>{s(n.some(e=>_chunkPVFUNWT6js.a.call(void 0, e,t)))},containsOnlyOnceElementsOf:t=>{s(t.map(e=>n.filter(o=>_chunkPVFUNWT6js.a.call(void 0, o,e)).length).filter(e=>e===1).length===t.length)},containsAnyOf:(...t)=>{s(n.some(e=>t.some(o=>_chunkPVFUNWT6js.a.call(void 0, e,o))))},allMatch:t=>{s(n.every(t))},anyMatches:t=>{s(n.some(t))},allMatchAsync:async t=>{for(let e of n)s(await t(e))}});exports.a = l; exports.b = g; exports.c = p; exports.d = f; exports.e = w; exports.f = k; exports.g = x; exports.h = E; exports.i = b; exports.j = h; exports.k = s; exports.l = a; exports.m = c; exports.n = m; exports.o = y; exports.p = O; exports.q = v; exports.r = M; exports.s = A; exports.t = q;
|
|
13
|
+
//# sourceMappingURL=chunk-3ZZHSAJG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/testing/assertions.ts"],"names":["AssertionError","message","isSubset","superObj","subObj","sup","sub","assertOk","ele","assertFails","assertThrowsAsync","fun","errorCheck","error","typedError","assertTrue","assertThrows","assertMatches","actual","expected","JSONParser","assertDeepEqual","deepEquals","assertNotDeepEqual","assertThat","item","other","assertFalse","condition","obj","assertEqual","assertNotEqual","assertIsNotNull","result","assertIsNull","argValue","value","arg","argMatches","matches","verifyThat","fn","times","args","call","match","index","assertThatArray","array","length","ts","i","elem","a","o"],"mappings":"gFAIO,IAAMA,EAAN,cAA6B,KAAM,CACxC,YAAYC,EAAiB,CAC3B,MAAMA,CAAO,CACf,CACF,EACaC,EAAW,CAACC,EAAmBC,IAA6B,CACvE,IAAMC,EAAMF,EACNG,EAAMF,EAEZ,OAAAG,EAASF,CAAG,EACZE,EAASD,CAAG,EAEL,OAAO,KAAKA,CAAG,EAAE,MAAOE,GACzB,OAAOF,EAAIE,CAAG,GAAK,SACdN,EAASG,EAAIG,CAAG,EAAGF,EAAIE,CAAG,CAAC,EAE7BF,EAAIE,CAAG,IAAMH,EAAIG,CAAG,CAC5B,CACH,EAEaC,EAAeR,GAAqB,CAC/C,MAAM,IAAID,EAAeC,GAAW,uCAAuC,CAC7E,EAEaS,EAAoB,MAC/BC,EACAC,IACoB,CACpB,GAAI,CACF,YAAMD,EAAI,EACJ,IAAIX,EAAe,sCAAsC,CACjE,OAASa,EAAO,CACd,IAAMC,EAAaD,EACnB,OAAID,GAAYG,EAAWH,EAAWE,CAAU,CAAC,EAC1CA,CACT,CACF,EAEaE,EAAe,CAC1BL,EACAC,IACW,CACX,GAAI,CACF,MAAAD,EAAI,EACE,IAAIX,EAAe,sCAAsC,CACjE,OAASa,EAAO,CACd,IAAMC,EAAaD,EACnB,OAAID,GAAYG,EAAWH,EAAWE,CAAU,CAAC,EAC1CA,CACT,CACF,EACaG,EAAgB,CAC3BC,EACAC,EACAlB,IACG,CACH,GAAI,CAACC,EAASgB,EAAQC,CAAQ,EAC5B,MAAM,IAAInB,EACRC,GACE;AAAA,EAAYmB,EAAW,UAAUD,CAAQ,CAAC;AAAA;AAAA,EAAuBC,EAAW,UAAUF,CAAM,C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EAAW+B,EAAGD,CAAI,CAAC,CAAC,CACnD,EACA,2BAA6B1B,GAAe,CAC1CX,EACEW,EACG,IAAK4B,GAAMN,EAAM,OAAQK,GAAM/B,EAAW+B,EAAGC,CAAC,CAAC,EAAE,MAAM,EACvD,OAAQD,GAAMA,IAAM,CAAC,EAAE,SAAW3B,EAAM,MAC7C,CACF,EACA,cAAe,IAAIA,IAAe,CAChCX,EAAWiC,EAAM,KAAMK,GAAM3B,EAAM,KAAM,GAAMJ,EAAW+B,EAAG,CAAC,CAAC,CAAC,CAAC,CACnE,EACA,SAAWd,GAAkC,CAC3CxB,EAAWiC,EAAM,MAAMT,CAAO,CAAC,CACjC,EACA,WAAaA,GAAkC,CAC7CxB,EAAWiC,EAAM,KAAKT,CAAO,CAAC,CAChC,EACA,cAAe,MACbA,GACkB,CAClB,QAAWd,KAAQuB,EACjBjC,EAAW,MAAMwB,EAAQd,CAAI,CAAC,CAElC,CACF","sourcesContent":["import { JSONParser } from '../serialization';\nimport type { DefaultRecord } from '../typing';\nimport { deepEquals } from '../utils';\n\nexport class AssertionError extends Error {\n constructor(message: string) {\n super(message);\n }\n}\nexport const isSubset = (superObj: unknown, subObj: unknown): boolean => {\n const sup = superObj as DefaultRecord;\n const sub = subObj as DefaultRecord;\n\n assertOk(sup);\n assertOk(sub);\n\n return Object.keys(sub).every((ele: string) => {\n if (typeof sub[ele] == 'object') {\n return isSubset(sup[ele], sub[ele]);\n }\n return sub[ele] === sup[ele];\n });\n};\n\nexport const assertFails = (message?: string) => {\n throw new AssertionError(message ?? 'That should not ever happened, right?');\n};\n\nexport const assertThrowsAsync = async <TError extends Error>(\n fun: () => Promise<void>,\n errorCheck?: (error: Error) => boolean,\n): Promise<TError> => {\n try {\n await fun();\n throw new AssertionError(\"Function didn't throw expected error\");\n } catch (error) {\n const typedError = error as TError;\n if (errorCheck) assertTrue(errorCheck(typedError));\n return typedError;\n }\n};\n\nexport const assertThrows = <TError extends Error>(\n fun: () => void,\n errorCheck?: (error: Error) => boolean,\n): TError => {\n try {\n fun();\n throw new AssertionError(\"Function didn't throw expected error\");\n } catch (error) {\n const typedError = error as TError;\n if (errorCheck) assertTrue(errorCheck(typedError));\n return typedError;\n }\n};\nexport const assertMatches = (\n actual: unknown,\n expected: unknown,\n message?: string,\n) => {\n if (!isSubset(actual, expected))\n throw new AssertionError(\n message ??\n `subObj:\\n${JSONParser.stringify(expected)}\\nis not subset of\\n${JSONParser.stringify(actual)}`,\n );\n};\n\nexport const assertDeepEqual = <T = unknown>(\n actual: T,\n expected: T,\n message?: string,\n) => {\n if (!deepEquals(actual, expected))\n throw new AssertionError(\n message ??\n `subObj:\\n${JSONParser.stringify(expected)}\\nis not equal to\\n${JSONParser.stringify(actual)}`,\n );\n};\n\nexport const assertNotDeepEqual = <T = unknown>(\n actual: T,\n expected: T,\n message?: string,\n) => {\n if (deepEquals(actual, expected))\n throw new AssertionError(\n message ??\n `subObj:\\n${JSONParser.stringify(expected)}\\nis equals to\\n${JSONParser.stringify(actual)}`,\n );\n};\n\nexport const assertThat = <T>(item: T) => {\n return {\n isEqualTo: (other: T) => assertTrue(deepEquals(item, other)),\n };\n};\n\nexport function assertFalse(\n condition: boolean,\n message?: string,\n): asserts condition is false {\n if (condition) throw new AssertionError(message ?? `Condition is false`);\n}\n\nexport function assertTrue(\n condition: boolean,\n message?: string,\n): asserts condition is true {\n if (!condition) throw new AssertionError(message ?? `Condition is false`);\n}\n\nexport function assertOk<T>(\n obj: T | null | undefined,\n message?: string,\n): asserts obj is T {\n if (!obj) throw new AssertionError(message ?? `Condition is not truthy`);\n}\n\nexport function assertEqual<T>(\n expected: T | null | undefined,\n actual: T | null | undefined,\n message?: string,\n): void {\n if (expected !== actual)\n throw new AssertionError(\n message ??\n `Objects are not equal:\\nExpected: ${JSONParser.stringify(expected)}\\nActual:${JSONParser.stringify(actual)}`,\n );\n}\n\nexport function assertNotEqual<T>(\n obj: T | null | undefined,\n other: T | null | undefined,\n message?: string,\n): void {\n if (obj === other)\n throw new AssertionError(\n message ?? `Objects are equal: ${JSONParser.stringify(obj)}`,\n );\n}\n\nexport function assertIsNotNull<T extends object | bigint>(\n result: T | null,\n): asserts result is T {\n assertNotEqual(result, null);\n assertOk(result);\n}\n\nexport function assertIsNull<T extends object>(\n result: T | null,\n): asserts result is null {\n assertEqual(result, null);\n}\n\ntype Call = {\n arguments: unknown[];\n result: unknown;\n target: unknown;\n this: unknown;\n};\n\nexport type ArgumentMatcher = (arg: unknown) => boolean;\n\nexport const argValue =\n <T>(value: T): ArgumentMatcher =>\n (arg) =>\n deepEquals(arg, value);\n\nexport const argMatches =\n <T>(matches: (arg: T) => boolean): ArgumentMatcher =>\n (arg) =>\n matches(arg as T);\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport type MockedFunction = Function & { mock?: { calls: Call[] } };\n\nexport function verifyThat(fn: MockedFunction) {\n return {\n calledTimes: (times: number) => {\n assertEqual(fn.mock?.calls?.length, times);\n },\n notCalled: () => {\n assertEqual(fn?.mock?.calls?.length, 0);\n },\n called: () => {\n assertTrue(\n fn.mock?.calls.length !== undefined && fn.mock.calls.length > 0,\n );\n },\n calledWith: (...args: unknown[]) => {\n assertTrue(\n fn.mock?.calls.length !== undefined &&\n fn.mock.calls.length >= 1 &&\n fn.mock.calls.some((call) => deepEquals(call.arguments, args)),\n );\n },\n calledOnceWith: (...args: unknown[]) => {\n assertTrue(\n fn.mock?.calls.length !== undefined &&\n fn.mock.calls.length === 1 &&\n fn.mock.calls.some((call) => deepEquals(call.arguments, args)),\n );\n },\n calledWithArgumentMatching: (...matches: ArgumentMatcher[]) => {\n assertTrue(\n fn.mock?.calls.length !== undefined && fn.mock.calls.length >= 1,\n );\n assertTrue(\n fn.mock?.calls.length !== undefined &&\n fn.mock.calls.length >= 1 &&\n fn.mock.calls.some(\n (call) =>\n call.arguments &&\n call.arguments.length >= matches.length &&\n matches.every((match, index) => match(call.arguments[index])),\n ),\n );\n },\n notCalledWithArgumentMatching: (...matches: ArgumentMatcher[]) => {\n assertFalse(\n fn.mock?.calls.length !== undefined &&\n fn.mock.calls.length >= 1 &&\n fn.mock.calls[0]!.arguments &&\n fn.mock.calls[0]!.arguments.length >= matches.length &&\n matches.every((match, index) =>\n match(fn.mock!.calls[0]!.arguments[index]),\n ),\n );\n },\n };\n}\n\nexport const assertThatArray = <T>(array: T[]) => {\n return {\n isEmpty: () => assertEqual(array.length, 0),\n isNotEmpty: () => assertNotEqual(array.length, 0),\n hasSize: (length: number) => assertEqual(array.length, length),\n containsElements: (...other: T[]) => {\n assertTrue(other.every((ts) => other.some((o) => deepEquals(ts, o))));\n },\n containsExactlyInAnyOrder: (...other: T[]) => {\n assertEqual(array.length, other.length);\n assertTrue(array.every((ts) => other.some((o) => deepEquals(ts, o))));\n },\n containsExactlyInAnyOrderElementsOf: (other: T[]) => {\n assertEqual(array.length, other.length);\n assertTrue(array.every((ts) => other.some((o) => deepEquals(ts, o))));\n },\n containsExactlyElementsOf: (other: T[]) => {\n assertEqual(array.length, other.length);\n for (let i = 0; i < array.length; i++) {\n assertTrue(deepEquals(array[i], other[i]));\n }\n },\n containsExactly: (elem: T) => {\n assertEqual(array.length, 1);\n assertTrue(deepEquals(array[0], elem));\n },\n contains: (elem: T) => {\n assertTrue(array.some((a) => deepEquals(a, elem)));\n },\n containsOnlyOnceElementsOf: (other: T[]) => {\n assertTrue(\n other\n .map((o) => array.filter((a) => deepEquals(a, o)).length)\n .filter((a) => a === 1).length === other.length,\n );\n },\n containsAnyOf: (...other: T[]) => {\n assertTrue(array.some((a) => other.some((o) => deepEquals(a, o))));\n },\n allMatch: (matches: (item: T) => boolean) => {\n assertTrue(array.every(matches));\n },\n anyMatches: (matches: (item: T) => boolean) => {\n assertTrue(array.some(matches));\n },\n allMatchAsync: async (\n matches: (item: T) => Promise<boolean>,\n ): Promise<void> => {\n for (const item of array) {\n assertTrue(await matches(item));\n }\n },\n };\n};\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i,f as E,
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i,f as E,k as t}from"./chunk-ZUHYOH4G.mjs";import{j as s}from"./chunk-KLLSLLHN.mjs";var y={for:o=>n=>({when:c=>{let a=()=>{let r=(Array.isArray(n)?n:[n]).reduce(o.evolve,o.initialState());return o.decide(c,r)};return{then:e=>{let r=a(),d=Array.isArray(r)?r:[r],h=Array.isArray(e)?e:[e];E(d,h)},thenThrows:(...e)=>{try{throw a(),new i("Handler did not fail as expected")}catch(r){if(r instanceof i)throw r;if(e.length===0)return;if(!s(e[0])){t(e[0](r),`Error didn't match the error condition: ${r?.toString()}`);return}t(r instanceof e[0],`Caught error is not an instance of the expected type: ${r?.toString()}`),e[1]&&t(e[1](r),`Error didn't match the error condition: ${r?.toString()}`)}}}}})};export{y as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BZ6ZVZAX.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunk3ZZHSAJGjs = require('./chunk-3ZZHSAJG.js');var _chunkE7KI3V22js = require('./chunk-E7KI3V22.js');var y={for:o=>n=>({when:c=>{let a=()=>{let r=(Array.isArray(n)?n:[n]).reduce(o.evolve,o.initialState());return o.decide(c,r)};return{then:e=>{let r=a(),d=Array.isArray(r)?r:[r],h=Array.isArray(e)?e:[e];_chunk3ZZHSAJGjs.f.call(void 0, d,h)},thenThrows:(...e)=>{try{throw a(),new (0, _chunk3ZZHSAJGjs.a)("Handler did not fail as expected")}catch(r){if(r instanceof _chunk3ZZHSAJGjs.a)throw r;if(e.length===0)return;if(!_chunkE7KI3V22js.j.call(void 0, e[0])){_chunk3ZZHSAJGjs.k.call(void 0, e[0](r),`Error didn't match the error condition: ${_optionalChain([r, 'optionalAccess', _ => _.toString, 'call', _2 => _2()])}`);return}_chunk3ZZHSAJGjs.k.call(void 0, r instanceof e[0],`Caught error is not an instance of the expected type: ${_optionalChain([r, 'optionalAccess', _3 => _3.toString, 'call', _4 => _4()])}`),e[1]&&_chunk3ZZHSAJGjs.k.call(void 0, e[1](r),`Error didn't match the error condition: ${_optionalChain([r, 'optionalAccess', _5 => _5.toString, 'call', _6 => _6()])}`)}}}}})};exports.a = y;
|
|
2
|
+
//# sourceMappingURL=chunk-C2N3BJXW.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var i=e=>e,t= exports.b =e=>e.map(n=>({type:"inline",projection:n})),o= exports.c =e=>e.map(n=>({type:"async",projection:n})),r= exports.d ={inline:t,async:o};exports.a = i; exports.b = t; exports.c = o; exports.d = r;
|
|
2
|
+
//# sourceMappingURL=chunk-OTLRRXEA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/projections/index.ts"],"names":["projection","definition","inlineProjections","definitions","asyncProjections","projections"],"mappings":"AAqCO,IAAMA,EAQXC,GAC4BA,EAEjBC,EAKXC,GAEAA,EAAY,IAAKH,IAAgB,CAAE,KAAM,SAAU,WAAAA,CAAW,EAAE,EAErDI,EAKXD,GAEAA,EAAY,IAAKH,IAAgB,CAAE,KAAM,QAAS,WAAAA,CAAW,EAAE,EAEpDK,EAAc,CACzB,OAAQH,EACR,MAAOE,CACT","sourcesContent":["import type { CanHandle, DefaultRecord, Event, ReadEvent } from '../typing';\n\nexport type ProjectionHandlingType = 'inline' | 'async';\n\nexport type ProjectionHandler<\n EventType extends Event = Event,\n ProjectionHandlerContext extends DefaultRecord = DefaultRecord,\n> = (\n events: ReadEvent<EventType>[],\n context: ProjectionHandlerContext,\n) => Promise<void> | void;\n\nexport interface ProjectionDefinition<\n ProjectionHandlerContext extends DefaultRecord = DefaultRecord,\n> {\n name?: string;\n canHandle: CanHandle<Event>;\n handle: ProjectionHandler<Event, ProjectionHandlerContext>;\n}\n\nexport interface TypedProjectionDefinition<\n EventType extends Event = Event,\n ProjectionHandlerContext extends DefaultRecord = DefaultRecord,\n> {\n name?: string;\n canHandle: CanHandle<EventType>;\n handle: ProjectionHandler<EventType, ProjectionHandlerContext>;\n}\n\nexport type ProjectionRegistration<\n HandlingType extends ProjectionHandlingType,\n ProjectionHandlerContext extends DefaultRecord = DefaultRecord,\n> = {\n type: HandlingType;\n projection: ProjectionDefinition<ProjectionHandlerContext>;\n};\n\nexport const projection = <\n EventType extends Event = Event,\n ProjectionHandlerContext extends DefaultRecord = DefaultRecord,\n ProjectionDefintionType extends TypedProjectionDefinition<\n EventType,\n ProjectionHandlerContext\n > = ProjectionDefinition<ProjectionHandlerContext>,\n>(\n definition: ProjectionDefintionType,\n): ProjectionDefintionType => definition;\n\nexport const inlineProjections = <\n ProjectionHandlerContext extends DefaultRecord = DefaultRecord,\n ProjectionDefintionType extends\n ProjectionDefinition<ProjectionHandlerContext> = ProjectionDefinition<ProjectionHandlerContext>,\n>(\n definitions: ProjectionDefintionType[],\n): ProjectionRegistration<'inline', ProjectionHandlerContext>[] =>\n definitions.map((projection) => ({ type: 'inline', projection }));\n\nexport const asyncProjections = <\n ProjectionHandlerContext extends DefaultRecord = DefaultRecord,\n ProjectionDefintionType extends\n ProjectionDefinition<ProjectionHandlerContext> = ProjectionDefinition<ProjectionHandlerContext>,\n>(\n definitions: ProjectionDefintionType[],\n): ProjectionRegistration<'async', ProjectionHandlerContext>[] =>\n definitions.map((projection) => ({ type: 'async', projection }));\n\nexport const projections = {\n inline: inlineProjections,\n async: asyncProjections,\n};\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
var n=(e,t,a)=>({type:e,data:t,metadata:a});export{n as a};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
//# sourceMappingURL=chunk-QWM33AYY.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/typing/event.ts"],"sourcesContent":["import type { DefaultRecord, Flavour } from './';\n\nexport type Event<\n EventType extends string = string,\n EventData extends DefaultRecord = DefaultRecord,\n EventMetaData extends DefaultRecord = DefaultRecord,\n> = Flavour<\n Readonly<{\n type: EventType;\n data: EventData;\n metadata?: EventMetaData;\n }>,\n 'Event'\n>;\n\nexport type EventTypeOf<T extends Event> = T['type'];\nexport type EventDataOf<T extends Event> = T['data'];\nexport type EventMetaDataOf<T extends Event> = T['metadata'];\n\nexport type CanHandle<T extends Event> = EventTypeOf<T>[];\n\nexport type CreateEventType<\n EventType extends string,\n EventData extends DefaultRecord,\n EventMetaData extends DefaultRecord | undefined,\n> = Readonly<{\n type: EventType;\n data: EventData;\n metadata?: EventMetaData;\n}>;\n\nexport const event = <EventType extends Event>(\n type: EventTypeOf<EventType>,\n data: EventDataOf<EventType>,\n metadata?: EventMetaDataOf<EventType>,\n): CreateEventType<\n EventTypeOf<EventType>,\n EventDataOf<EventType>,\n EventMetaDataOf<EventType>\n> => {\n return {\n type,\n data,\n metadata,\n };\n};\n\nexport type ReadEvent<\n EventType extends Event = Event,\n EventMetaDataType extends EventMetaDataOf<EventType> &\n ReadEventMetadata = EventMetaDataOf<EventType> & ReadEventMetadata,\n> = CreateEventType<\n EventTypeOf<EventType>,\n EventDataOf<EventType>,\n EventMetaDataType\n> &\n EventType & { metadata: EventMetaDataType };\n\nexport type ReadEventMetadata = Readonly<{\n eventId: string;\n streamPosition: bigint;\n streamName: string;\n}>;\n\nexport type ReadEventMetadataWithGlobalPosition = ReadEventMetadata & {\n globalPosition: bigint;\n};\n"],"mappings":"AA+BO,IAAMA,EAAQ,CACnBC,EACAC,EACAC,KAMO,CACL,KAAAF,EACA,KAAAC,EACA,SAAAC,CACF","names":["event","type","data","metadata"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var n=(e,t,a)=>({type:e,data:t,metadata:a});exports.a = n;
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
//# sourceMappingURL=chunk-QYDAYWBJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/typing/event.ts"],"names":["event","type","data","metadata"],"mappings":"AA+BO,IAAMA,EAAQ,CACnBC,EACAC,EACAC,KAMO,CACL,KAAAF,EACA,KAAAC,EACA,SAAAC,CACF","sourcesContent":["import type { DefaultRecord, Flavour } from './';\n\nexport type Event<\n EventType extends string = string,\n EventData extends DefaultRecord = DefaultRecord,\n EventMetaData extends DefaultRecord = DefaultRecord,\n> = Flavour<\n Readonly<{\n type: EventType;\n data: EventData;\n metadata?: EventMetaData;\n }>,\n 'Event'\n>;\n\nexport type EventTypeOf<T extends Event> = T['type'];\nexport type EventDataOf<T extends Event> = T['data'];\nexport type EventMetaDataOf<T extends Event> = T['metadata'];\n\nexport type CanHandle<T extends Event> = EventTypeOf<T>[];\n\nexport type CreateEventType<\n EventType extends string,\n EventData extends DefaultRecord,\n EventMetaData extends DefaultRecord | undefined,\n> = Readonly<{\n type: EventType;\n data: EventData;\n metadata?: EventMetaData;\n}>;\n\nexport const event = <EventType extends Event>(\n type: EventTypeOf<EventType>,\n data: EventDataOf<EventType>,\n metadata?: EventMetaDataOf<EventType>,\n): CreateEventType<\n EventTypeOf<EventType>,\n EventDataOf<EventType>,\n EventMetaDataOf<EventType>\n> => {\n return {\n type,\n data,\n metadata,\n };\n};\n\nexport type ReadEvent<\n EventType extends Event = Event,\n EventMetaDataType extends EventMetaDataOf<EventType> &\n ReadEventMetadata = EventMetaDataOf<EventType> & ReadEventMetadata,\n> = CreateEventType<\n EventTypeOf<EventType>,\n EventDataOf<EventType>,\n EventMetaDataType\n> &\n EventType & { metadata: EventMetaDataType };\n\nexport type ReadEventMetadata = Readonly<{\n eventId: string;\n streamPosition: bigint;\n streamName: string;\n}>;\n\nexport type ReadEventMetadataWithGlobalPosition = ReadEventMetadata & {\n globalPosition: bigint;\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/projections/index.ts"],"sourcesContent":["import type { CanHandle, DefaultRecord, Event, ReadEvent } from '../typing';\n\nexport type ProjectionHandlingType = 'inline' | 'async';\n\nexport type ProjectionHandler<\n EventType extends Event = Event,\n ProjectionHandlerContext extends DefaultRecord = DefaultRecord,\n> = (\n events: ReadEvent<EventType>[],\n context: ProjectionHandlerContext,\n) => Promise<void> | void;\n\nexport interface ProjectionDefinition<\n ProjectionHandlerContext extends DefaultRecord = DefaultRecord,\n> {\n name?: string;\n canHandle: CanHandle<Event>;\n handle: ProjectionHandler<Event, ProjectionHandlerContext>;\n}\n\nexport interface TypedProjectionDefinition<\n EventType extends Event = Event,\n ProjectionHandlerContext extends DefaultRecord = DefaultRecord,\n> {\n name?: string;\n canHandle: CanHandle<EventType>;\n handle: ProjectionHandler<EventType, ProjectionHandlerContext>;\n}\n\nexport type ProjectionRegistration<\n HandlingType extends ProjectionHandlingType,\n ProjectionHandlerContext extends DefaultRecord = DefaultRecord,\n> = {\n type: HandlingType;\n projection: ProjectionDefinition<ProjectionHandlerContext>;\n};\n\nexport const projection = <\n EventType extends Event = Event,\n ProjectionHandlerContext extends DefaultRecord = DefaultRecord,\n ProjectionDefintionType extends TypedProjectionDefinition<\n EventType,\n ProjectionHandlerContext\n > = ProjectionDefinition<ProjectionHandlerContext>,\n>(\n definition: ProjectionDefintionType,\n): ProjectionDefintionType => definition;\n\nexport const inlineProjections = <\n ProjectionHandlerContext extends DefaultRecord = DefaultRecord,\n ProjectionDefintionType extends\n ProjectionDefinition<ProjectionHandlerContext> = ProjectionDefinition<ProjectionHandlerContext>,\n>(\n definitions: ProjectionDefintionType[],\n): ProjectionRegistration<'inline', ProjectionHandlerContext>[] =>\n definitions.map((projection) => ({ type: 'inline', projection }));\n\nexport const asyncProjections = <\n ProjectionHandlerContext extends DefaultRecord = DefaultRecord,\n ProjectionDefintionType extends\n ProjectionDefinition<ProjectionHandlerContext> = ProjectionDefinition<ProjectionHandlerContext>,\n>(\n definitions: ProjectionDefintionType[],\n): ProjectionRegistration<'async', ProjectionHandlerContext>[] =>\n definitions.map((projection) => ({ type: 'async', projection }));\n\nexport const projections = {\n inline: inlineProjections,\n async: asyncProjections,\n};\n"],"mappings":"AAqCO,IAAMA,EAQXC,GAC4BA,EAEjBC,EAKXC,GAEAA,EAAY,IAAKH,IAAgB,CAAE,KAAM,SAAU,WAAAA,CAAW,EAAE,EAErDI,EAKXD,GAEAA,EAAY,IAAKH,IAAgB,CAAE,KAAM,QAAS,WAAAA,CAAW,EAAE,EAEpDK,EAAc,CACzB,OAAQH,EACR,MAAOE,CACT","names":["projection","definition","inlineProjections","definitions","asyncProjections","projections"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{a as r}from"./chunk-B7NWWHCY.mjs";import{b as i}from"./chunk-S33YM44M.mjs";var l=class extends Error{constructor(t){super(t)}},g=(n,t)=>{let e=n,o=t;return a(e),a(o),Object.keys(o).every(u=>typeof o[u]=="object"?g(e[u],o[u]):o[u]===e[u])},p=n=>{throw new l(n??"That should not ever happened, right?")},f=async(n,t)=>{try{throw await n(),new l("Function didn't throw expected error")}catch(e){let o=e;return t&&s(t(o)),o}},w=(n,t)=>{try{throw n(),new l("Function didn't throw expected error")}catch(e){let o=e;return t&&s(t(o)),o}},k=(n,t,e)=>{if(!g(n,t))throw new l(e??`subObj:
|
|
2
|
+
${i.stringify(t)}
|
|
3
|
+
is not subset of
|
|
4
|
+
${i.stringify(n)}`)},x=(n,t,e)=>{if(!r(n,t))throw new l(e??`subObj:
|
|
5
|
+
${i.stringify(t)}
|
|
6
|
+
is not equal to
|
|
7
|
+
${i.stringify(n)}`)},E=(n,t,e)=>{if(r(n,t))throw new l(e??`subObj:
|
|
8
|
+
${i.stringify(t)}
|
|
9
|
+
is equals to
|
|
10
|
+
${i.stringify(n)}`)},b=n=>({isEqualTo:t=>s(r(n,t))});function h(n,t){if(n)throw new l(t??"Condition is false")}function s(n,t){if(!n)throw new l(t??"Condition is false")}function a(n,t){if(!n)throw new l(t??"Condition is not truthy")}function c(n,t,e){if(n!==t)throw new l(e??`Objects are not equal:
|
|
11
|
+
Expected: ${i.stringify(n)}
|
|
12
|
+
Actual:${i.stringify(t)}`)}function m(n,t,e){if(n===t)throw new l(e??`Objects are equal: ${i.stringify(n)}`)}function y(n){m(n,null),a(n)}function O(n){c(n,null)}var v=n=>t=>r(t,n),M=n=>t=>n(t);function A(n){return{calledTimes:t=>{c(n.mock?.calls?.length,t)},notCalled:()=>{c(n?.mock?.calls?.length,0)},called:()=>{s(n.mock?.calls.length!==void 0&&n.mock.calls.length>0)},calledWith:(...t)=>{s(n.mock?.calls.length!==void 0&&n.mock.calls.length>=1&&n.mock.calls.some(e=>r(e.arguments,t)))},calledOnceWith:(...t)=>{s(n.mock?.calls.length!==void 0&&n.mock.calls.length===1&&n.mock.calls.some(e=>r(e.arguments,t)))},calledWithArgumentMatching:(...t)=>{s(n.mock?.calls.length!==void 0&&n.mock.calls.length>=1),s(n.mock?.calls.length!==void 0&&n.mock.calls.length>=1&&n.mock.calls.some(e=>e.arguments&&e.arguments.length>=t.length&&t.every((o,u)=>o(e.arguments[u]))))},notCalledWithArgumentMatching:(...t)=>{h(n.mock?.calls.length!==void 0&&n.mock.calls.length>=1&&n.mock.calls[0].arguments&&n.mock.calls[0].arguments.length>=t.length&&t.every((e,o)=>e(n.mock.calls[0].arguments[o])))}}}var q=n=>({isEmpty:()=>c(n.length,0),isNotEmpty:()=>m(n.length,0),hasSize:t=>c(n.length,t),containsElements:(...t)=>{s(t.every(e=>t.some(o=>r(e,o))))},containsExactlyInAnyOrder:(...t)=>{c(n.length,t.length),s(n.every(e=>t.some(o=>r(e,o))))},containsExactlyInAnyOrderElementsOf:t=>{c(n.length,t.length),s(n.every(e=>t.some(o=>r(e,o))))},containsExactlyElementsOf:t=>{c(n.length,t.length);for(let e=0;e<n.length;e++)s(r(n[e],t[e]))},containsExactly:t=>{c(n.length,1),s(r(n[0],t))},contains:t=>{s(n.some(e=>r(e,t)))},containsOnlyOnceElementsOf:t=>{s(t.map(e=>n.filter(o=>r(o,e)).length).filter(e=>e===1).length===t.length)},containsAnyOf:(...t)=>{s(n.some(e=>t.some(o=>r(e,o))))},allMatch:t=>{s(n.every(t))},anyMatches:t=>{s(n.some(t))},allMatchAsync:async t=>{for(let e of n)s(await t(e))}});export{l as a,g as b,p as c,f as d,w as e,k as f,x as g,E as h,b as i,h as j,s as k,a as l,c as m,m as n,y as o,O as p,v as q,M as r,A as s,q as t};
|
|
13
|
+
//# sourceMappingURL=chunk-ZUHYOH4G.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/testing/assertions.ts"],"sourcesContent":["import { JSONParser } from '../serialization';\nimport type { DefaultRecord } from '../typing';\nimport { deepEquals } from '../utils';\n\nexport class AssertionError extends Error {\n constructor(message: string) {\n super(message);\n }\n}\nexport const isSubset = (superObj: unknown, subObj: unknown): boolean => {\n const sup = superObj as DefaultRecord;\n const sub = subObj as DefaultRecord;\n\n assertOk(sup);\n assertOk(sub);\n\n return Object.keys(sub).every((ele: string) => {\n if (typeof sub[ele] == 'object') {\n return isSubset(sup[ele], sub[ele]);\n }\n return sub[ele] === sup[ele];\n });\n};\n\nexport const assertFails = (message?: string) => {\n throw new AssertionError(message ?? 'That should not ever happened, right?');\n};\n\nexport const assertThrowsAsync = async <TError extends Error>(\n fun: () => Promise<void>,\n errorCheck?: (error: Error) => boolean,\n): Promise<TError> => {\n try {\n await fun();\n throw new AssertionError(\"Function didn't throw expected error\");\n } catch (error) {\n const typedError = error as TError;\n if (errorCheck) assertTrue(errorCheck(typedError));\n return typedError;\n }\n};\n\nexport const assertThrows = <TError extends Error>(\n fun: () => void,\n errorCheck?: (error: Error) => boolean,\n): TError => {\n try {\n fun();\n throw new AssertionError(\"Function didn't throw expected error\");\n } catch (error) {\n const typedError = error as TError;\n if (errorCheck) assertTrue(errorCheck(typedError));\n return typedError;\n }\n};\nexport const assertMatches = (\n actual: unknown,\n expected: unknown,\n message?: string,\n) => {\n if (!isSubset(actual, expected))\n throw new AssertionError(\n message ??\n `subObj:\\n${JSONParser.stringify(expected)}\\nis not subset of\\n${JSONParser.stringify(actual)}`,\n );\n};\n\nexport const assertDeepEqual = <T = unknown>(\n actual: T,\n expected: T,\n message?: string,\n) => {\n if (!deepEquals(actual, expected))\n throw new AssertionError(\n message ??\n `subObj:\\n${JSONParser.stringify(expected)}\\nis not equal to\\n${JSONParser.stringify(actual)}`,\n );\n};\n\nexport const assertNotDeepEqual = <T = unknown>(\n actual: T,\n expected: T,\n message?: string,\n) => {\n if (deepEquals(actual, expected))\n throw new AssertionError(\n message ??\n `subObj:\\n${JSONParser.stringify(expected)}\\nis equals to\\n${JSONParser.stringify(actual)}`,\n );\n};\n\nexport const assertThat = <T>(item: T) => {\n return {\n isEqualTo: (other: T) => assertTrue(deepEquals(item, other)),\n };\n};\n\nexport function assertFalse(\n condition: boolean,\n message?: string,\n): asserts condition is false {\n if (condition) throw new AssertionError(message ?? `Condition is false`);\n}\n\nexport function assertTrue(\n condition: boolean,\n message?: string,\n): asserts condition is true {\n if (!condition) throw new AssertionError(message ?? `Condition is false`);\n}\n\nexport function assertOk<T>(\n obj: T | null | undefined,\n message?: string,\n): asserts obj is T {\n if (!obj) throw new AssertionError(message ?? `Condition is not truthy`);\n}\n\nexport function assertEqual<T>(\n expected: T | null | undefined,\n actual: T | null | undefined,\n message?: string,\n): void {\n if (expected !== actual)\n throw new AssertionError(\n message ??\n `Objects are not equal:\\nExpected: ${JSONParser.stringify(expected)}\\nActual:${JSONParser.stringify(actual)}`,\n );\n}\n\nexport function assertNotEqual<T>(\n obj: T | null | undefined,\n other: T | null | undefined,\n message?: string,\n): void {\n if (obj === other)\n throw new AssertionError(\n message ?? `Objects are equal: ${JSONParser.stringify(obj)}`,\n );\n}\n\nexport function assertIsNotNull<T extends object | bigint>(\n result: T | null,\n): asserts result is T {\n assertNotEqual(result, null);\n assertOk(result);\n}\n\nexport function assertIsNull<T extends object>(\n result: T | null,\n): asserts result is null {\n assertEqual(result, null);\n}\n\ntype Call = {\n arguments: unknown[];\n result: unknown;\n target: unknown;\n this: unknown;\n};\n\nexport type ArgumentMatcher = (arg: unknown) => boolean;\n\nexport const argValue =\n <T>(value: T): ArgumentMatcher =>\n (arg) =>\n deepEquals(arg, value);\n\nexport const argMatches =\n <T>(matches: (arg: T) => boolean): ArgumentMatcher =>\n (arg) =>\n matches(arg as T);\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport type MockedFunction = Function & { mock?: { calls: Call[] } };\n\nexport function verifyThat(fn: MockedFunction) {\n return {\n calledTimes: (times: number) => {\n assertEqual(fn.mock?.calls?.length, times);\n },\n notCalled: () => {\n assertEqual(fn?.mock?.calls?.length, 0);\n },\n called: () => {\n assertTrue(\n fn.mock?.calls.length !== undefined && fn.mock.calls.length > 0,\n );\n },\n calledWith: (...args: unknown[]) => {\n assertTrue(\n fn.mock?.calls.length !== undefined &&\n fn.mock.calls.length >= 1 &&\n fn.mock.calls.some((call) => deepEquals(call.arguments, args)),\n );\n },\n calledOnceWith: (...args: unknown[]) => {\n assertTrue(\n fn.mock?.calls.length !== undefined &&\n fn.mock.calls.length === 1 &&\n fn.mock.calls.some((call) => deepEquals(call.arguments, args)),\n );\n },\n calledWithArgumentMatching: (...matches: ArgumentMatcher[]) => {\n assertTrue(\n fn.mock?.calls.length !== undefined && fn.mock.calls.length >= 1,\n );\n assertTrue(\n fn.mock?.calls.length !== undefined &&\n fn.mock.calls.length >= 1 &&\n fn.mock.calls.some(\n (call) =>\n call.arguments &&\n call.arguments.length >= matches.length &&\n matches.every((match, index) => match(call.arguments[index])),\n ),\n );\n },\n notCalledWithArgumentMatching: (...matches: ArgumentMatcher[]) => {\n assertFalse(\n fn.mock?.calls.length !== undefined &&\n fn.mock.calls.length >= 1 &&\n fn.mock.calls[0]!.arguments &&\n fn.mock.calls[0]!.arguments.length >= matches.length &&\n matches.every((match, index) =>\n match(fn.mock!.calls[0]!.arguments[index]),\n ),\n );\n },\n };\n}\n\nexport const assertThatArray = <T>(array: T[]) => {\n return {\n isEmpty: () => assertEqual(array.length, 0),\n isNotEmpty: () => assertNotEqual(array.length, 0),\n hasSize: (length: number) => assertEqual(array.length, length),\n containsElements: (...other: T[]) => {\n assertTrue(other.every((ts) => other.some((o) => deepEquals(ts, o))));\n },\n containsExactlyInAnyOrder: (...other: T[]) => {\n assertEqual(array.length, other.length);\n assertTrue(array.every((ts) => other.some((o) => deepEquals(ts, o))));\n },\n containsExactlyInAnyOrderElementsOf: (other: T[]) => {\n assertEqual(array.length, other.length);\n assertTrue(array.every((ts) => other.some((o) => deepEquals(ts, o))));\n },\n containsExactlyElementsOf: (other: T[]) => {\n assertEqual(array.length, other.length);\n for (let i = 0; i < array.length; i++) {\n assertTrue(deepEquals(array[i], other[i]));\n }\n },\n containsExactly: (elem: T) => {\n assertEqual(array.length, 1);\n assertTrue(deepEquals(array[0], elem));\n },\n contains: (elem: T) => {\n assertTrue(array.some((a) => deepEquals(a, elem)));\n },\n containsOnlyOnceElementsOf: (other: T[]) => {\n assertTrue(\n other\n .map((o) => array.filter((a) => deepEquals(a, o)).length)\n .filter((a) => a === 1).length === other.length,\n );\n },\n containsAnyOf: (...other: T[]) => {\n assertTrue(array.some((a) => other.some((o) => deepEquals(a, o))));\n },\n allMatch: (matches: (item: T) => boolean) => {\n assertTrue(array.every(matches));\n },\n anyMatches: (matches: (item: T) => boolean) => {\n assertTrue(array.some(matches));\n },\n allMatchAsync: async (\n matches: (item: T) => Promise<boolean>,\n ): Promise<void> => {\n for (const item of array) {\n assertTrue(await matches(item));\n }\n },\n };\n};\n"],"mappings":"kFAIO,IAAMA,EAAN,cAA6B,KAAM,CACxC,YAAYC,EAAiB,CAC3B,MAAMA,CAAO,CACf,CACF,EACaC,EAAW,CAACC,EAAmBC,IAA6B,CACvE,IAAMC,EAAMF,EACNG,EAAMF,EAEZ,OAAAG,EAASF,CAAG,EACZE,EAASD,CAAG,EAEL,OAAO,KAAKA,CAAG,EAAE,MAAOE,GACzB,OAAOF,EAAIE,CAAG,GAAK,SACdN,EAASG,EAAIG,CAAG,EAAGF,EAAIE,CAAG,CAAC,EAE7BF,EAAIE,CAAG,IAAMH,EAAIG,CAAG,CAC5B,CACH,EAEaC,EAAeR,GAAqB,CAC/C,MAAM,IAAID,EAAeC,GAAW,uCAAuC,CAC7E,EAEaS,EAAoB,MAC/BC,EACAC,IACoB,CACpB,GAAI,CACF,YAAMD,EAAI,EACJ,IAAIX,EAAe,sCAAsC,CACjE,OAASa,EAAO,CACd,IAAMC,EAAaD,EACnB,OAAID,GAAYG,EAAWH,EAAWE,CAAU,CAAC,EAC1CA,CACT,CACF,EAEaE,EAAe,CAC1BL,EACAC,IACW,CACX,GAAI,CACF,MAAAD,EAAI,EACE,IAAIX,EAAe,sCAAsC,CACjE,OAASa,EAAO,CACd,IAAMC,EAAaD,EACnB,OAAID,GAAYG,EAAWH,EAAWE,CAAU,CAAC,EAC1CA,CACT,CACF,EACaG,EAAgB,CAC3BC,EACAC,EACAlB,IACG,CACH,GAAI,CAACC,EAASgB,EAAQC,CAAQ,EAC5B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AWO,EAAW0B,EAAM,CAAC,EAAGI,CAAI,CAAC,CACvC,EACA,SAAWA,GAAY,CACrBrC,EAAWiC,EAAM,KAAMK,GAAM/B,EAAW+B,EAAGD,CAAI,CAAC,CAAC,CACnD,EACA,2BAA6B1B,GAAe,CAC1CX,EACEW,EACG,IAAK4B,GAAMN,EAAM,OAAQK,GAAM/B,EAAW+B,EAAGC,CAAC,CAAC,EAAE,MAAM,EACvD,OAAQD,GAAMA,IAAM,CAAC,EAAE,SAAW3B,EAAM,MAC7C,CACF,EACA,cAAe,IAAIA,IAAe,CAChCX,EAAWiC,EAAM,KAAMK,GAAM3B,EAAM,KAAM,GAAMJ,EAAW+B,EAAG,CAAC,CAAC,CAAC,CAAC,CACnE,EACA,SAAWd,GAAkC,CAC3CxB,EAAWiC,EAAM,MAAMT,CAAO,CAAC,CACjC,EACA,WAAaA,GAAkC,CAC7CxB,EAAWiC,EAAM,KAAKT,CAAO,CAAC,CAChC,EACA,cAAe,MACbA,GACkB,CAClB,QAAWd,KAAQuB,EACjBjC,EAAW,MAAMwB,EAAQd,CAAI,CAAC,CAElC,CACF","names":["AssertionError","message","isSubset","superObj","subObj","sup","sub","assertOk","ele","assertFails","assertThrowsAsync","fun","errorCheck","error","typedError","assertTrue","assertThrows","assertMatches","actual","expected","JSONParser","assertDeepEqual","deepEquals","assertNotDeepEqual","assertThat","item","other","assertFalse","condition","obj","assertEqual","assertNotEqual","assertIsNotNull","result","assertIsNull","argValue","value","arg","argMatches","matches","verifyThat","fn","times","args","call","match","index","assertThatArray","array","length","ts","i","elem","a","o"]}
|
package/dist/index.d.mts
CHANGED
|
@@ -4,16 +4,16 @@ export { ConcurrencyError, EmmettError, ErrorConstructor, IllegalStateError, Not
|
|
|
4
4
|
export { A as AggregateStreamOptions, b as AggregateStreamResult, c as AppendToStreamOptions, d as AppendToStreamResult, D as DefaultStreamVersionType, E as EventStore, e as ExpectedStreamVersion, g as ExpectedStreamVersionGeneral, f as ExpectedStreamVersionWithValue, j as ExpectedVersionConflictError, N as NO_CONCURRENCY_CHECK, R as ReadStreamOptions, a as ReadStreamResult, h as STREAM_DOES_NOT_EXIST, S as STREAM_EXISTS, i as assertExpectedVersionMatchesCurrent, m as matchesExpectedVersion } from './eventStore-CdmvM2NC.mjs';
|
|
5
5
|
export { EventHandler, getInMemoryEventStore } from './eventStore/inMemoryEventStore.mjs';
|
|
6
6
|
export { CommandBus, CommandProcessor, CommandSender, EventBus, EventProcessor, EventsPublisher, MessageBus, MessageHandler, MessageProcessor, MessageScheduler, ScheduleOptions, ScheduledMessage, ScheduledMessageProcessor, getInMemoryMessageBus } from './messageBus/index.mjs';
|
|
7
|
-
export {
|
|
7
|
+
export { ProjectionDefinition, ProjectionHandler, ProjectionHandlingType, ProjectionRegistration, TypedProjectionDefinition, asyncProjections, inlineProjections, projection, projections } from './projections/index.mjs';
|
|
8
8
|
export { JSONParser, Mapper, MapperArgs, ParseError, ParseOptions, StringifyOptions } from './serialization/json/JSONParser.mjs';
|
|
9
9
|
export { concatUint8Arrays } from './streaming/binaryArrays.mjs';
|
|
10
10
|
export { collectStream } from './streaming/collect.mjs';
|
|
11
11
|
export { BinaryJsonDecoder, CompositeDecoder, Decoder, DefaultDecoder, JsonDecoder, ObjectDecoder, StringDecoder } from './streaming/decoders/index.mjs';
|
|
12
12
|
export { restream } from './streaming/restream.mjs';
|
|
13
|
-
export { ArgumentMatcher, AssertionError, MockedFunction, argMatches, argValue, assertDeepEqual, assertEqual, assertFails, assertFalse, assertIsNotNull, assertIsNull, assertMatches, assertNotEqual, assertOk, assertThat, assertThatArray, assertThrows, assertThrowsAsync, assertTrue, isSubset, verifyThat } from './testing/assertions.mjs';
|
|
13
|
+
export { ArgumentMatcher, AssertionError, MockedFunction, argMatches, argValue, assertDeepEqual, assertEqual, assertFails, assertFalse, assertIsNotNull, assertIsNull, assertMatches, assertNotDeepEqual, assertNotEqual, assertOk, assertThat, assertThatArray, assertThrows, assertThrowsAsync, assertTrue, isSubset, verifyThat } from './testing/assertions.mjs';
|
|
14
14
|
export { DeciderSpecfication, DeciderSpecification, ThenThrows } from './testing/deciderSpecification.mjs';
|
|
15
15
|
export { TestEventStream, WrapEventStore } from './testing/wrapEventStore.mjs';
|
|
16
|
-
export { Brand, Command, CommandDataOf, CommandMetaDataOf, CommandTypeOf, CreateCommandType, CreateEventType, Decider, DefaultCommandMetadata, DefaultRecord, Event, EventDataOf, EventMetaDataOf, EventTypeOf, Flavour, ReadEvent, ReadEventMetadata, ReadEventMetadataWithGlobalPosition, Workflow, WorkflowCommand, WorkflowEvent, WorkflowOutput, accept, command, complete, error, event, ignore, publish, reply, schedule, send } from './typing/index.mjs';
|
|
16
|
+
export { Brand, CanHandle, Command, CommandDataOf, CommandMetaDataOf, CommandTypeOf, CreateCommandType, CreateEventType, Decider, DefaultCommandMetadata, DefaultRecord, Event, EventDataOf, EventMetaDataOf, EventTypeOf, Flavour, ReadEvent, ReadEventMetadata, ReadEventMetadataWithGlobalPosition, Workflow, WorkflowCommand, WorkflowEvent, WorkflowOutput, accept, command, complete, error, event, ignore, publish, reply, schedule, send } from './typing/index.mjs';
|
|
17
17
|
export { Equatable, deepEquals, isEquatable } from './utils/deepEquals.mjs';
|
|
18
18
|
export { sum } from './utils/iterators.mjs';
|
|
19
19
|
export { merge } from './utils/merge.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -4,16 +4,16 @@ export { ConcurrencyError, EmmettError, ErrorConstructor, IllegalStateError, Not
|
|
|
4
4
|
export { A as AggregateStreamOptions, b as AggregateStreamResult, c as AppendToStreamOptions, d as AppendToStreamResult, D as DefaultStreamVersionType, E as EventStore, e as ExpectedStreamVersion, g as ExpectedStreamVersionGeneral, f as ExpectedStreamVersionWithValue, j as ExpectedVersionConflictError, N as NO_CONCURRENCY_CHECK, R as ReadStreamOptions, a as ReadStreamResult, h as STREAM_DOES_NOT_EXIST, S as STREAM_EXISTS, i as assertExpectedVersionMatchesCurrent, m as matchesExpectedVersion } from './eventStore-BovqZT1r.js';
|
|
5
5
|
export { EventHandler, getInMemoryEventStore } from './eventStore/inMemoryEventStore.js';
|
|
6
6
|
export { CommandBus, CommandProcessor, CommandSender, EventBus, EventProcessor, EventsPublisher, MessageBus, MessageHandler, MessageProcessor, MessageScheduler, ScheduleOptions, ScheduledMessage, ScheduledMessageProcessor, getInMemoryMessageBus } from './messageBus/index.js';
|
|
7
|
-
export {
|
|
7
|
+
export { ProjectionDefinition, ProjectionHandler, ProjectionHandlingType, ProjectionRegistration, TypedProjectionDefinition, asyncProjections, inlineProjections, projection, projections } from './projections/index.js';
|
|
8
8
|
export { JSONParser, Mapper, MapperArgs, ParseError, ParseOptions, StringifyOptions } from './serialization/json/JSONParser.js';
|
|
9
9
|
export { concatUint8Arrays } from './streaming/binaryArrays.js';
|
|
10
10
|
export { collectStream } from './streaming/collect.js';
|
|
11
11
|
export { BinaryJsonDecoder, CompositeDecoder, Decoder, DefaultDecoder, JsonDecoder, ObjectDecoder, StringDecoder } from './streaming/decoders/index.js';
|
|
12
12
|
export { restream } from './streaming/restream.js';
|
|
13
|
-
export { ArgumentMatcher, AssertionError, MockedFunction, argMatches, argValue, assertDeepEqual, assertEqual, assertFails, assertFalse, assertIsNotNull, assertIsNull, assertMatches, assertNotEqual, assertOk, assertThat, assertThatArray, assertThrows, assertThrowsAsync, assertTrue, isSubset, verifyThat } from './testing/assertions.js';
|
|
13
|
+
export { ArgumentMatcher, AssertionError, MockedFunction, argMatches, argValue, assertDeepEqual, assertEqual, assertFails, assertFalse, assertIsNotNull, assertIsNull, assertMatches, assertNotDeepEqual, assertNotEqual, assertOk, assertThat, assertThatArray, assertThrows, assertThrowsAsync, assertTrue, isSubset, verifyThat } from './testing/assertions.js';
|
|
14
14
|
export { DeciderSpecfication, DeciderSpecification, ThenThrows } from './testing/deciderSpecification.js';
|
|
15
15
|
export { TestEventStream, WrapEventStore } from './testing/wrapEventStore.js';
|
|
16
|
-
export { Brand, Command, CommandDataOf, CommandMetaDataOf, CommandTypeOf, CreateCommandType, CreateEventType, Decider, DefaultCommandMetadata, DefaultRecord, Event, EventDataOf, EventMetaDataOf, EventTypeOf, Flavour, ReadEvent, ReadEventMetadata, ReadEventMetadataWithGlobalPosition, Workflow, WorkflowCommand, WorkflowEvent, WorkflowOutput, accept, command, complete, error, event, ignore, publish, reply, schedule, send } from './typing/index.js';
|
|
16
|
+
export { Brand, CanHandle, Command, CommandDataOf, CommandMetaDataOf, CommandTypeOf, CreateCommandType, CreateEventType, Decider, DefaultCommandMetadata, DefaultRecord, Event, EventDataOf, EventMetaDataOf, EventTypeOf, Flavour, ReadEvent, ReadEventMetadata, ReadEventMetadataWithGlobalPosition, Workflow, WorkflowCommand, WorkflowEvent, WorkflowOutput, accept, command, complete, error, event, ignore, publish, reply, schedule, send } from './typing/index.js';
|
|
17
17
|
export { Equatable, deepEquals, isEquatable } from './utils/deepEquals.js';
|
|
18
18
|
export { sum } from './utils/iterators.js';
|
|
19
19
|
export { merge } from './utils/merge.js';
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-BNCTLP4B.js');var _chunkTNX525X5js = require('./chunk-TNX525X5.js');require('./chunk-7MFB6DXR.js');require('./chunk-BP5RXRGL.js');var _chunkUHJAD4TUjs = require('./chunk-UHJAD4TU.js');var _chunk7ZSJY377js = require('./chunk-7ZSJY377.js');var _chunkG6LPI3PAjs = require('./chunk-G6LPI3PA.js');var _chunk2E7KSKKIjs = require('./chunk-2E7KSKKI.js');var _chunk5JZKD7CBjs = require('./chunk-5JZKD7CB.js');var _chunkZIBX4FPGjs = require('./chunk-ZIBX4FPG.js');var _chunkFNYJ62ROjs = require('./chunk-FNYJ62RO.js');require('./chunk-YGTOG7JR.js');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-BNCTLP4B.js');var _chunkTNX525X5js = require('./chunk-TNX525X5.js');require('./chunk-7MFB6DXR.js');require('./chunk-BP5RXRGL.js');var _chunkUHJAD4TUjs = require('./chunk-UHJAD4TU.js');var _chunk7ZSJY377js = require('./chunk-7ZSJY377.js');var _chunkG6LPI3PAjs = require('./chunk-G6LPI3PA.js');var _chunk2E7KSKKIjs = require('./chunk-2E7KSKKI.js');var _chunk5JZKD7CBjs = require('./chunk-5JZKD7CB.js');var _chunkZIBX4FPGjs = require('./chunk-ZIBX4FPG.js');var _chunkFNYJ62ROjs = require('./chunk-FNYJ62RO.js');require('./chunk-YGTOG7JR.js');var _chunkC2N3BJXWjs = require('./chunk-C2N3BJXW.js');var _chunk3ZZHSAJGjs = require('./chunk-3ZZHSAJG.js');require('./chunk-6IATZUYD.js');var _chunkPVFUNWT6js = require('./chunk-PVFUNWT6.js');var _chunkFE73T2NSjs = require('./chunk-FE73T2NS.js');var _chunk3JE5DUJ2js = require('./chunk-3JE5DUJ2.js');var _chunkHCHELB23js = require('./chunk-HCHELB23.js');require('./chunk-ZLASBJGR.js');var _chunkUFUSYJWUjs = require('./chunk-UFUSYJWU.js');var _chunkMHB2JU4Ujs = require('./chunk-MHB2JU4U.js');require('./chunk-7FJXUW3D.js');require('./chunk-5BGN2FV4.js');var _chunkQYDAYWBJjs = require('./chunk-QYDAYWBJ.js');var _chunkOTLRRXEAjs = require('./chunk-OTLRRXEA.js');require('./chunk-LOJ6A4AJ.js');require('./chunk-AU2WZCER.js');var _chunkMKHK5TRMjs = require('./chunk-MKHK5TRM.js');var _chunk4K5I5WJGjs = require('./chunk-4K5I5WJG.js');require('./chunk-F7QRI2VL.js');var _chunkTNJCS5RVjs = require('./chunk-TNJCS5RV.js');var _chunkPRYQOCWYjs = require('./chunk-PRYQOCWY.js');require('./chunk-2452BJTJ.js');var _chunk74HCODMEjs = require('./chunk-74HCODME.js');require('./chunk-IJGC6SHP.js');var _chunkVY2C2KCWjs = require('./chunk-VY2C2KCW.js');var _chunkE7KI3V22js = require('./chunk-E7KI3V22.js');exports.AssertionError = _chunk3ZZHSAJGjs.a; exports.BinaryJsonDecoder = _chunk2E7KSKKIjs.a; exports.CommandHandler = _chunkPRYQOCWYjs.a; exports.CompositeDecoder = _chunkG6LPI3PAjs.a; exports.ConcurrencyError = _chunkE7KI3V22js.l; exports.DeciderCommandHandler = _chunkTNJCS5RVjs.a; exports.DeciderSpecification = _chunkC2N3BJXWjs.a; exports.DefaultDecoder = _chunkG6LPI3PAjs.b; exports.EmmettError = _chunkE7KI3V22js.k; exports.ExpectedVersionConflictError = _chunkVY2C2KCWjs.f; exports.IllegalStateError = _chunkE7KI3V22js.n; exports.JSONParser = _chunkMKHK5TRMjs.b; exports.JsonDecoder = _chunk5JZKD7CBjs.a; exports.NO_CONCURRENCY_CHECK = _chunkVY2C2KCWjs.c; exports.NotFoundError = _chunkE7KI3V22js.o; exports.ObjectDecoder = _chunkZIBX4FPGjs.a; exports.ParseError = _chunkMKHK5TRMjs.a; exports.STREAM_DOES_NOT_EXIST = _chunkVY2C2KCWjs.b; exports.STREAM_EXISTS = _chunkVY2C2KCWjs.a; exports.StringDecoder = _chunkFNYJ62ROjs.a; exports.ValidationError = _chunkE7KI3V22js.m; exports.ValidationErrors = _chunkE7KI3V22js.d; exports.WrapEventStore = _chunkTNX525X5js.a; exports.accept = _chunkUFUSYJWUjs.h; exports.argMatches = _chunk3ZZHSAJGjs.r; exports.argValue = _chunk3ZZHSAJGjs.q; exports.assertDeepEqual = _chunk3ZZHSAJGjs.g; exports.assertEqual = _chunk3ZZHSAJGjs.m; exports.assertExpectedVersionMatchesCurrent = _chunkVY2C2KCWjs.e; exports.assertFails = _chunk3ZZHSAJGjs.c; exports.assertFalse = _chunk3ZZHSAJGjs.j; exports.assertIsNotNull = _chunk3ZZHSAJGjs.o; exports.assertIsNull = _chunk3ZZHSAJGjs.p; exports.assertMatches = _chunk3ZZHSAJGjs.f; exports.assertNotDeepEqual = _chunk3ZZHSAJGjs.h; exports.assertNotEmptyString = _chunkE7KI3V22js.g; exports.assertNotEqual = _chunk3ZZHSAJGjs.n; exports.assertOk = _chunk3ZZHSAJGjs.l; exports.assertPositiveNumber = _chunkE7KI3V22js.h; exports.assertThat = _chunk3ZZHSAJGjs.i; exports.assertThatArray = _chunk3ZZHSAJGjs.t; exports.assertThrows = _chunk3ZZHSAJGjs.e; exports.assertThrowsAsync = _chunk3ZZHSAJGjs.d; exports.assertTrue = _chunk3ZZHSAJGjs.k; exports.assertUnsignedBigInt = _chunkE7KI3V22js.i; exports.asyncProjections = _chunkOTLRRXEAjs.c; exports.collectStream = _chunkUHJAD4TUjs.a; exports.command = _chunkMHB2JU4Ujs.a; exports.complete = _chunkUFUSYJWUjs.e; exports.concatUint8Arrays = _chunk4K5I5WJGjs.a; exports.deepEquals = _chunkPVFUNWT6js.a; exports.error = _chunkUFUSYJWUjs.g; exports.event = _chunkQYDAYWBJjs.a; exports.formatDateToUtcYYYYMMDD = _chunkE7KI3V22js.a; exports.getInMemoryEventStore = _chunk74HCODMEjs.a; exports.getInMemoryMessageBus = _chunkHCHELB23js.a; exports.ignore = _chunkUFUSYJWUjs.f; exports.inlineProjections = _chunkOTLRRXEAjs.b; exports.isEquatable = _chunkPVFUNWT6js.b; exports.isErrorConstructor = _chunkE7KI3V22js.j; exports.isNumber = _chunkE7KI3V22js.e; exports.isString = _chunkE7KI3V22js.f; exports.isSubset = _chunk3ZZHSAJGjs.b; exports.isValidYYYYMMDD = _chunkE7KI3V22js.b; exports.matchesExpectedVersion = _chunkVY2C2KCWjs.d; exports.merge = _chunk3JE5DUJ2js.a; exports.parseDateFromUtcYYYYMMDD = _chunkE7KI3V22js.c; exports.projection = _chunkOTLRRXEAjs.a; exports.projections = _chunkOTLRRXEAjs.d; exports.publish = _chunkUFUSYJWUjs.c; exports.reply = _chunkUFUSYJWUjs.a; exports.restream = _chunk7ZSJY377js.a; exports.schedule = _chunkUFUSYJWUjs.d; exports.send = _chunkUFUSYJWUjs.b; exports.sum = _chunkFE73T2NSjs.a; exports.verifyThat = _chunk3ZZHSAJGjs.s;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./chunk-AHXBZPOE.mjs";import{a as
|
|
1
|
+
import"./chunk-AHXBZPOE.mjs";import{a as vo}from"./chunk-N6X7QWHP.mjs";import"./chunk-F6WLSL2L.mjs";import"./chunk-FVA6ACSC.mjs";import{a as Q}from"./chunk-7LENV63T.mjs";import{a as X}from"./chunk-ZV7YVTI7.mjs";import{a as V,b as W}from"./chunk-TKIRQ76T.mjs";import{a as R}from"./chunk-HKNRGZN2.mjs";import{a as T}from"./chunk-MR2WVMFM.mjs";import{a as U}from"./chunk-S3C5CKD5.mjs";import{a as S}from"./chunk-VTWTSAHB.mjs";import"./chunk-QFEG5DNU.mjs";import{a as uo}from"./chunk-BZ6ZVZAX.mjs";import{a as oo,b as ro,c as eo,d as fo,e as mo,f as po,g as to,h as xo,i as ao,j as bo,k as co,l as go,m as ho,n as io,o as jo,p as ko,q as lo,r as no,s as qo,t as so}from"./chunk-ZUHYOH4G.mjs";import"./chunk-3DH3DSMC.mjs";import{a as Y,b as Z}from"./chunk-B7NWWHCY.mjs";import{a as _}from"./chunk-OBA6MZMG.mjs";import{a as $}from"./chunk-YKFEDBH4.mjs";import{a as I}from"./chunk-6PH3GSCE.mjs";import"./chunk-YWRV75GA.mjs";import{a as A,b as B,c as C,d as D,e as E,f as F,g as G,h as H}from"./chunk-GNUOGYD6.mjs";import{a as y}from"./chunk-JDYZZRJE.mjs";import"./chunk-3LYVXI5R.mjs";import"./chunk-DOHUIBZQ.mjs";import{a as z}from"./chunk-QWM33AYY.mjs";import{a as J,b as K,c as L,d as M}from"./chunk-ZIFNLQ77.mjs";import"./chunk-DIW552TK.mjs";import"./chunk-7JLAVMM3.mjs";import{a as N,b as O}from"./chunk-S33YM44M.mjs";import{a as P}from"./chunk-WCQF2QY4.mjs";import"./chunk-XLZS42HB.mjs";import{a as w}from"./chunk-NXFNVBXL.mjs";import{a as v}from"./chunk-POWQ3BZ6.mjs";import"./chunk-45ODDXOQ.mjs";import{a as u}from"./chunk-JVPAJ3FU.mjs";import"./chunk-D24KLTN5.mjs";import{a as j,b as k,c as l,d as n,e as q,f as s}from"./chunk-HKDMOB55.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,l as d,m as g,n as h,o as i}from"./chunk-KLLSLLHN.mjs";export{oo as AssertionError,R as BinaryJsonDecoder,v as CommandHandler,V as CompositeDecoder,d as ConcurrencyError,w as DeciderCommandHandler,uo as DeciderSpecification,W as DefaultDecoder,c as EmmettError,s as ExpectedVersionConflictError,h as IllegalStateError,O as JSONParser,T as JsonDecoder,l as NO_CONCURRENCY_CHECK,i as NotFoundError,U as ObjectDecoder,N as ParseError,k as STREAM_DOES_NOT_EXIST,j as STREAM_EXISTS,S as StringDecoder,g as ValidationError,f as ValidationErrors,vo as WrapEventStore,H as accept,no as argMatches,lo as argValue,to as assertDeepEqual,ho as assertEqual,q as assertExpectedVersionMatchesCurrent,eo as assertFails,bo as assertFalse,jo as assertIsNotNull,ko as assertIsNull,po as assertMatches,xo as assertNotDeepEqual,t as assertNotEmptyString,io as assertNotEqual,go as assertOk,x as assertPositiveNumber,ao as assertThat,so as assertThatArray,mo as assertThrows,fo as assertThrowsAsync,co as assertTrue,a as assertUnsignedBigInt,L as asyncProjections,Q as collectStream,y as command,E as complete,P as concatUint8Arrays,Y as deepEquals,G as error,z as event,o as formatDateToUtcYYYYMMDD,u as getInMemoryEventStore,I as getInMemoryMessageBus,F as ignore,K as inlineProjections,Z as isEquatable,b as isErrorConstructor,m as isNumber,p as isString,ro as isSubset,r as isValidYYYYMMDD,n as matchesExpectedVersion,$ as merge,e as parseDateFromUtcYYYYMMDD,J as projection,M as projections,C as publish,A as reply,X as restream,D as schedule,B as send,_ as sum,qo as verifyThat};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/messageBus/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHCHELB23js = require('../chunk-HCHELB23.js');require('../chunk-ZLASBJGR.js');require('../chunk-UFUSYJWU.js');require('../chunk-MHB2JU4U.js');require('../chunk-7FJXUW3D.js');require('../chunk-5BGN2FV4.js');require('../chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHCHELB23js = require('../chunk-HCHELB23.js');require('../chunk-ZLASBJGR.js');require('../chunk-UFUSYJWU.js');require('../chunk-MHB2JU4U.js');require('../chunk-7FJXUW3D.js');require('../chunk-5BGN2FV4.js');require('../chunk-QYDAYWBJ.js');require('../chunk-E7KI3V22.js');exports.getInMemoryMessageBus = _chunkHCHELB23js.a;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-6PH3GSCE.mjs";import"../chunk-YWRV75GA.mjs";import"../chunk-GNUOGYD6.mjs";import"../chunk-JDYZZRJE.mjs";import"../chunk-3LYVXI5R.mjs";import"../chunk-DOHUIBZQ.mjs";import"../chunk-
|
|
1
|
+
import{a}from"../chunk-6PH3GSCE.mjs";import"../chunk-YWRV75GA.mjs";import"../chunk-GNUOGYD6.mjs";import"../chunk-JDYZZRJE.mjs";import"../chunk-3LYVXI5R.mjs";import"../chunk-DOHUIBZQ.mjs";import"../chunk-QWM33AYY.mjs";import"../chunk-KLLSLLHN.mjs";export{a as getInMemoryMessageBus};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,12 +1,28 @@
|
|
|
1
|
-
import { Event, DefaultRecord, ReadEvent,
|
|
1
|
+
import { Event, DefaultRecord, ReadEvent, CanHandle } from '../typing/index.mjs';
|
|
2
2
|
import '../typing/deepReadonly.mjs';
|
|
3
3
|
|
|
4
|
+
type ProjectionHandlingType = 'inline' | 'async';
|
|
4
5
|
type ProjectionHandler<EventType extends Event = Event, ProjectionHandlerContext extends DefaultRecord = DefaultRecord> = (events: ReadEvent<EventType>[], context: ProjectionHandlerContext) => Promise<void> | void;
|
|
5
|
-
interface
|
|
6
|
-
type: ProjectionType;
|
|
6
|
+
interface ProjectionDefinition<ProjectionHandlerContext extends DefaultRecord = DefaultRecord> {
|
|
7
7
|
name?: string;
|
|
8
|
-
canHandle:
|
|
8
|
+
canHandle: CanHandle<Event>;
|
|
9
|
+
handle: ProjectionHandler<Event, ProjectionHandlerContext>;
|
|
10
|
+
}
|
|
11
|
+
interface TypedProjectionDefinition<EventType extends Event = Event, ProjectionHandlerContext extends DefaultRecord = DefaultRecord> {
|
|
12
|
+
name?: string;
|
|
13
|
+
canHandle: CanHandle<EventType>;
|
|
9
14
|
handle: ProjectionHandler<EventType, ProjectionHandlerContext>;
|
|
10
15
|
}
|
|
16
|
+
type ProjectionRegistration<HandlingType extends ProjectionHandlingType, ProjectionHandlerContext extends DefaultRecord = DefaultRecord> = {
|
|
17
|
+
type: HandlingType;
|
|
18
|
+
projection: ProjectionDefinition<ProjectionHandlerContext>;
|
|
19
|
+
};
|
|
20
|
+
declare const projection: <EventType extends Event = Event, ProjectionHandlerContext extends DefaultRecord = DefaultRecord, ProjectionDefintionType extends TypedProjectionDefinition<EventType, ProjectionHandlerContext> = ProjectionDefinition<ProjectionHandlerContext>>(definition: ProjectionDefintionType) => ProjectionDefintionType;
|
|
21
|
+
declare const inlineProjections: <ProjectionHandlerContext extends DefaultRecord = DefaultRecord, ProjectionDefintionType extends ProjectionDefinition<ProjectionHandlerContext> = ProjectionDefinition<ProjectionHandlerContext>>(definitions: ProjectionDefintionType[]) => ProjectionRegistration<'inline', ProjectionHandlerContext>[];
|
|
22
|
+
declare const asyncProjections: <ProjectionHandlerContext extends DefaultRecord = DefaultRecord, ProjectionDefintionType extends ProjectionDefinition<ProjectionHandlerContext> = ProjectionDefinition<ProjectionHandlerContext>>(definitions: ProjectionDefintionType[]) => ProjectionRegistration<'async', ProjectionHandlerContext>[];
|
|
23
|
+
declare const projections: {
|
|
24
|
+
inline: <ProjectionHandlerContext extends DefaultRecord = DefaultRecord, ProjectionDefintionType extends ProjectionDefinition<ProjectionHandlerContext> = ProjectionDefinition<ProjectionHandlerContext>>(definitions: ProjectionDefintionType[]) => ProjectionRegistration<'inline', ProjectionHandlerContext>[];
|
|
25
|
+
async: <ProjectionHandlerContext_1 extends DefaultRecord = DefaultRecord, ProjectionDefintionType_1 extends ProjectionDefinition<ProjectionHandlerContext_1> = ProjectionDefinition<ProjectionHandlerContext_1>>(definitions: ProjectionDefintionType_1[]) => ProjectionRegistration<"async", ProjectionHandlerContext_1>[];
|
|
26
|
+
};
|
|
11
27
|
|
|
12
|
-
export type
|
|
28
|
+
export { type ProjectionDefinition, type ProjectionHandler, type ProjectionHandlingType, type ProjectionRegistration, type TypedProjectionDefinition, asyncProjections, inlineProjections, projection, projections };
|
|
@@ -1,12 +1,28 @@
|
|
|
1
|
-
import { Event, DefaultRecord, ReadEvent,
|
|
1
|
+
import { Event, DefaultRecord, ReadEvent, CanHandle } from '../typing/index.js';
|
|
2
2
|
import '../typing/deepReadonly.js';
|
|
3
3
|
|
|
4
|
+
type ProjectionHandlingType = 'inline' | 'async';
|
|
4
5
|
type ProjectionHandler<EventType extends Event = Event, ProjectionHandlerContext extends DefaultRecord = DefaultRecord> = (events: ReadEvent<EventType>[], context: ProjectionHandlerContext) => Promise<void> | void;
|
|
5
|
-
interface
|
|
6
|
-
type: ProjectionType;
|
|
6
|
+
interface ProjectionDefinition<ProjectionHandlerContext extends DefaultRecord = DefaultRecord> {
|
|
7
7
|
name?: string;
|
|
8
|
-
canHandle:
|
|
8
|
+
canHandle: CanHandle<Event>;
|
|
9
|
+
handle: ProjectionHandler<Event, ProjectionHandlerContext>;
|
|
10
|
+
}
|
|
11
|
+
interface TypedProjectionDefinition<EventType extends Event = Event, ProjectionHandlerContext extends DefaultRecord = DefaultRecord> {
|
|
12
|
+
name?: string;
|
|
13
|
+
canHandle: CanHandle<EventType>;
|
|
9
14
|
handle: ProjectionHandler<EventType, ProjectionHandlerContext>;
|
|
10
15
|
}
|
|
16
|
+
type ProjectionRegistration<HandlingType extends ProjectionHandlingType, ProjectionHandlerContext extends DefaultRecord = DefaultRecord> = {
|
|
17
|
+
type: HandlingType;
|
|
18
|
+
projection: ProjectionDefinition<ProjectionHandlerContext>;
|
|
19
|
+
};
|
|
20
|
+
declare const projection: <EventType extends Event = Event, ProjectionHandlerContext extends DefaultRecord = DefaultRecord, ProjectionDefintionType extends TypedProjectionDefinition<EventType, ProjectionHandlerContext> = ProjectionDefinition<ProjectionHandlerContext>>(definition: ProjectionDefintionType) => ProjectionDefintionType;
|
|
21
|
+
declare const inlineProjections: <ProjectionHandlerContext extends DefaultRecord = DefaultRecord, ProjectionDefintionType extends ProjectionDefinition<ProjectionHandlerContext> = ProjectionDefinition<ProjectionHandlerContext>>(definitions: ProjectionDefintionType[]) => ProjectionRegistration<'inline', ProjectionHandlerContext>[];
|
|
22
|
+
declare const asyncProjections: <ProjectionHandlerContext extends DefaultRecord = DefaultRecord, ProjectionDefintionType extends ProjectionDefinition<ProjectionHandlerContext> = ProjectionDefinition<ProjectionHandlerContext>>(definitions: ProjectionDefintionType[]) => ProjectionRegistration<'async', ProjectionHandlerContext>[];
|
|
23
|
+
declare const projections: {
|
|
24
|
+
inline: <ProjectionHandlerContext extends DefaultRecord = DefaultRecord, ProjectionDefintionType extends ProjectionDefinition<ProjectionHandlerContext> = ProjectionDefinition<ProjectionHandlerContext>>(definitions: ProjectionDefintionType[]) => ProjectionRegistration<'inline', ProjectionHandlerContext>[];
|
|
25
|
+
async: <ProjectionHandlerContext_1 extends DefaultRecord = DefaultRecord, ProjectionDefintionType_1 extends ProjectionDefinition<ProjectionHandlerContext_1> = ProjectionDefinition<ProjectionHandlerContext_1>>(definitions: ProjectionDefintionType_1[]) => ProjectionRegistration<"async", ProjectionHandlerContext_1>[];
|
|
26
|
+
};
|
|
11
27
|
|
|
12
|
-
export type
|
|
28
|
+
export { type ProjectionDefinition, type ProjectionHandler, type ProjectionHandlingType, type ProjectionRegistration, type TypedProjectionDefinition, asyncProjections, inlineProjections, projection, projections };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";require('../chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkOTLRRXEAjs = require('../chunk-OTLRRXEA.js');exports.asyncProjections = _chunkOTLRRXEAjs.c; exports.inlineProjections = _chunkOTLRRXEAjs.b; exports.projection = _chunkOTLRRXEAjs.a; exports.projections = _chunkOTLRRXEAjs.d;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-
|
|
1
|
+
import{a,b,c,d}from"../chunk-ZIFNLQ77.mjs";export{c as asyncProjections,b as inlineProjections,a as projection,d as projections};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -7,6 +7,7 @@ declare const assertThrowsAsync: <TError extends Error>(fun: () => Promise<void>
|
|
|
7
7
|
declare const assertThrows: <TError extends Error>(fun: () => void, errorCheck?: ((error: Error) => boolean) | undefined) => TError;
|
|
8
8
|
declare const assertMatches: (actual: unknown, expected: unknown, message?: string) => void;
|
|
9
9
|
declare const assertDeepEqual: <T = unknown>(actual: T, expected: T, message?: string) => void;
|
|
10
|
+
declare const assertNotDeepEqual: <T = unknown>(actual: T, expected: T, message?: string) => void;
|
|
10
11
|
declare const assertThat: <T>(item: T) => {
|
|
11
12
|
isEqualTo: (other: T) => void;
|
|
12
13
|
};
|
|
@@ -42,6 +43,7 @@ declare function verifyThat(fn: MockedFunction): {
|
|
|
42
43
|
};
|
|
43
44
|
declare const assertThatArray: <T>(array: T[]) => {
|
|
44
45
|
isEmpty: () => void;
|
|
46
|
+
isNotEmpty: () => void;
|
|
45
47
|
hasSize: (length: number) => void;
|
|
46
48
|
containsElements: (...other: T[]) => void;
|
|
47
49
|
containsExactlyInAnyOrder: (...other: T[]) => void;
|
|
@@ -56,4 +58,4 @@ declare const assertThatArray: <T>(array: T[]) => {
|
|
|
56
58
|
allMatchAsync: (matches: (item: T) => Promise<boolean>) => Promise<void>;
|
|
57
59
|
};
|
|
58
60
|
|
|
59
|
-
export { type ArgumentMatcher, AssertionError, type MockedFunction, argMatches, argValue, assertDeepEqual, assertEqual, assertFails, assertFalse, assertIsNotNull, assertIsNull, assertMatches, assertNotEqual, assertOk, assertThat, assertThatArray, assertThrows, assertThrowsAsync, assertTrue, isSubset, verifyThat };
|
|
61
|
+
export { type ArgumentMatcher, AssertionError, type MockedFunction, argMatches, argValue, assertDeepEqual, assertEqual, assertFails, assertFalse, assertIsNotNull, assertIsNull, assertMatches, assertNotDeepEqual, assertNotEqual, assertOk, assertThat, assertThatArray, assertThrows, assertThrowsAsync, assertTrue, isSubset, verifyThat };
|
|
@@ -7,6 +7,7 @@ declare const assertThrowsAsync: <TError extends Error>(fun: () => Promise<void>
|
|
|
7
7
|
declare const assertThrows: <TError extends Error>(fun: () => void, errorCheck?: ((error: Error) => boolean) | undefined) => TError;
|
|
8
8
|
declare const assertMatches: (actual: unknown, expected: unknown, message?: string) => void;
|
|
9
9
|
declare const assertDeepEqual: <T = unknown>(actual: T, expected: T, message?: string) => void;
|
|
10
|
+
declare const assertNotDeepEqual: <T = unknown>(actual: T, expected: T, message?: string) => void;
|
|
10
11
|
declare const assertThat: <T>(item: T) => {
|
|
11
12
|
isEqualTo: (other: T) => void;
|
|
12
13
|
};
|
|
@@ -42,6 +43,7 @@ declare function verifyThat(fn: MockedFunction): {
|
|
|
42
43
|
};
|
|
43
44
|
declare const assertThatArray: <T>(array: T[]) => {
|
|
44
45
|
isEmpty: () => void;
|
|
46
|
+
isNotEmpty: () => void;
|
|
45
47
|
hasSize: (length: number) => void;
|
|
46
48
|
containsElements: (...other: T[]) => void;
|
|
47
49
|
containsExactlyInAnyOrder: (...other: T[]) => void;
|
|
@@ -56,4 +58,4 @@ declare const assertThatArray: <T>(array: T[]) => {
|
|
|
56
58
|
allMatchAsync: (matches: (item: T) => Promise<boolean>) => Promise<void>;
|
|
57
59
|
};
|
|
58
60
|
|
|
59
|
-
export { type ArgumentMatcher, AssertionError, type MockedFunction, argMatches, argValue, assertDeepEqual, assertEqual, assertFails, assertFalse, assertIsNotNull, assertIsNull, assertMatches, assertNotEqual, assertOk, assertThat, assertThatArray, assertThrows, assertThrowsAsync, assertTrue, isSubset, verifyThat };
|
|
61
|
+
export { type ArgumentMatcher, AssertionError, type MockedFunction, argMatches, argValue, assertDeepEqual, assertEqual, assertFails, assertFalse, assertIsNotNull, assertIsNull, assertMatches, assertNotDeepEqual, assertNotEqual, assertOk, assertThat, assertThatArray, assertThrows, assertThrowsAsync, assertTrue, isSubset, verifyThat };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3ZZHSAJGjs = require('../chunk-3ZZHSAJG.js');require('../chunk-6IATZUYD.js');require('../chunk-PVFUNWT6.js');require('../chunk-FE73T2NS.js');require('../chunk-3JE5DUJ2.js');require('../chunk-LOJ6A4AJ.js');require('../chunk-AU2WZCER.js');require('../chunk-MKHK5TRM.js');exports.AssertionError = _chunk3ZZHSAJGjs.a; exports.argMatches = _chunk3ZZHSAJGjs.r; exports.argValue = _chunk3ZZHSAJGjs.q; exports.assertDeepEqual = _chunk3ZZHSAJGjs.g; exports.assertEqual = _chunk3ZZHSAJGjs.m; exports.assertFails = _chunk3ZZHSAJGjs.c; exports.assertFalse = _chunk3ZZHSAJGjs.j; exports.assertIsNotNull = _chunk3ZZHSAJGjs.o; exports.assertIsNull = _chunk3ZZHSAJGjs.p; exports.assertMatches = _chunk3ZZHSAJGjs.f; exports.assertNotDeepEqual = _chunk3ZZHSAJGjs.h; exports.assertNotEqual = _chunk3ZZHSAJGjs.n; exports.assertOk = _chunk3ZZHSAJGjs.l; exports.assertThat = _chunk3ZZHSAJGjs.i; exports.assertThatArray = _chunk3ZZHSAJGjs.t; exports.assertThrows = _chunk3ZZHSAJGjs.e; exports.assertThrowsAsync = _chunk3ZZHSAJGjs.d; exports.assertTrue = _chunk3ZZHSAJGjs.k; exports.isSubset = _chunk3ZZHSAJGjs.b; exports.verifyThat = _chunk3ZZHSAJGjs.s;
|
|
2
2
|
//# sourceMappingURL=assertions.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t}from"../chunk-ZUHYOH4G.mjs";import"../chunk-3DH3DSMC.mjs";import"../chunk-B7NWWHCY.mjs";import"../chunk-OBA6MZMG.mjs";import"../chunk-YKFEDBH4.mjs";import"../chunk-DIW552TK.mjs";import"../chunk-7JLAVMM3.mjs";import"../chunk-S33YM44M.mjs";export{a as AssertionError,r as argMatches,q as argValue,g as assertDeepEqual,m as assertEqual,c as assertFails,j as assertFalse,o as assertIsNotNull,p as assertIsNull,f as assertMatches,h as assertNotDeepEqual,n as assertNotEqual,l as assertOk,i as assertThat,t as assertThatArray,e as assertThrows,d as assertThrowsAsync,k as assertTrue,b as isSubset,s as verifyThat};
|
|
2
2
|
//# sourceMappingURL=assertions.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkC2N3BJXWjs = require('../chunk-C2N3BJXW.js');require('../chunk-3ZZHSAJG.js');require('../chunk-6IATZUYD.js');require('../chunk-PVFUNWT6.js');require('../chunk-FE73T2NS.js');require('../chunk-3JE5DUJ2.js');require('../chunk-LOJ6A4AJ.js');require('../chunk-AU2WZCER.js');require('../chunk-MKHK5TRM.js');require('../chunk-E7KI3V22.js');exports.DeciderSpecification = _chunkC2N3BJXWjs.a;
|
|
2
2
|
//# sourceMappingURL=deciderSpecification.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-BZ6ZVZAX.mjs";import"../chunk-ZUHYOH4G.mjs";import"../chunk-3DH3DSMC.mjs";import"../chunk-B7NWWHCY.mjs";import"../chunk-OBA6MZMG.mjs";import"../chunk-YKFEDBH4.mjs";import"../chunk-DIW552TK.mjs";import"../chunk-7JLAVMM3.mjs";import"../chunk-S33YM44M.mjs";import"../chunk-KLLSLLHN.mjs";export{a as DeciderSpecification};
|
|
2
2
|
//# sourceMappingURL=deciderSpecification.mjs.map
|
package/dist/testing/features.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk7BR3VBVDjs = require('../chunk-7BR3VBVD.js');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk7BR3VBVDjs = require('../chunk-7BR3VBVD.js');var _chunk3ZZHSAJGjs = require('../chunk-3ZZHSAJG.js');require('../chunk-6IATZUYD.js');require('../chunk-PVFUNWT6.js');require('../chunk-FE73T2NS.js');require('../chunk-3JE5DUJ2.js');require('../chunk-ZLASBJGR.js');require('../chunk-UFUSYJWU.js');require('../chunk-MHB2JU4U.js');require('../chunk-7FJXUW3D.js');require('../chunk-5BGN2FV4.js');require('../chunk-QYDAYWBJ.js');require('../chunk-LOJ6A4AJ.js');require('../chunk-AU2WZCER.js');require('../chunk-MKHK5TRM.js');var _crypto = require('crypto');var _test = require('test');async function C(g,r={getInitialIndex:()=>1n}){return _test.describe.call(void 0, "aggregateStream",async()=>{let t,u=[{evolve:_chunk7BR3VBVDjs.a,info:"evolve with raw event"},{evolve:_chunk7BR3VBVDjs.b,info:"evolve with event and metadata"}];_test.before.call(void 0, async()=>{t=await g()}),_test.after.call(void 0, async()=>{let e=r.teardownHook;e&&await e()});for(let e of u)await _test.it.call(void 0, `When called with 'to' allows time traveling using ${e.info}`,async()=>{let a={productId:"123",quantity:10,price:3},S=10,o=_crypto.randomUUID.call(void 0, );await t.appendToStream(o,[{type:"ProductItemAdded",data:{productItem:a}}]),await t.appendToStream(o,[{type:"ProductItemAdded",data:{productItem:a}}]),await t.appendToStream(o,[{type:"DiscountApplied",data:{percent:S}}]);let p=await t.aggregateStream(o,{evolve:e.evolve,initialState:_chunk7BR3VBVDjs.c,read:{to:1n}}),v=await t.aggregateStream(o,{evolve:e.evolve,initialState:_chunk7BR3VBVDjs.c,read:{to:2n}}),c=await t.aggregateStream(o,{evolve:e.evolve,initialState:_chunk7BR3VBVDjs.c,read:{to:3n}});_chunk3ZZHSAJGjs.l.call(void 0, p),_chunk3ZZHSAJGjs.l.call(void 0, v),_chunk3ZZHSAJGjs.l.call(void 0, c),_chunk3ZZHSAJGjs.m.call(void 0, p.currentStreamVersion,r.getInitialIndex()),_chunk3ZZHSAJGjs.g.call(void 0, p.state,{productItems:[a],totalAmount:30}),_chunk3ZZHSAJGjs.m.call(void 0, v.currentStreamVersion,r.getInitialIndex()+1n),_chunk3ZZHSAJGjs.g.call(void 0, v.state,{productItems:[a,a],totalAmount:60}),_chunk3ZZHSAJGjs.m.call(void 0, c.currentStreamVersion,r.getInitialIndex()+2n),_chunk3ZZHSAJGjs.g.call(void 0, c.state,{productItems:[a,a],totalAmount:54})})})}exports.testAggregateStream = C;
|
|
2
2
|
//# sourceMappingURL=features.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as m,b as l,c as d}from"../chunk-WB5PNUKG.mjs";import{g as n,
|
|
1
|
+
import{a as m,b as l,c as d}from"../chunk-WB5PNUKG.mjs";import{g as n,l as i,m as s}from"../chunk-ZUHYOH4G.mjs";import"../chunk-3DH3DSMC.mjs";import"../chunk-B7NWWHCY.mjs";import"../chunk-OBA6MZMG.mjs";import"../chunk-YKFEDBH4.mjs";import"../chunk-YWRV75GA.mjs";import"../chunk-GNUOGYD6.mjs";import"../chunk-JDYZZRJE.mjs";import"../chunk-3LYVXI5R.mjs";import"../chunk-DOHUIBZQ.mjs";import"../chunk-QWM33AYY.mjs";import"../chunk-DIW552TK.mjs";import"../chunk-7JLAVMM3.mjs";import"../chunk-S33YM44M.mjs";import{randomUUID as I}from"node:crypto";import{after as w,before as y,describe as f,it as E}from"node:test";async function C(g,r={getInitialIndex:()=>1n}){return f("aggregateStream",async()=>{let t,u=[{evolve:m,info:"evolve with raw event"},{evolve:l,info:"evolve with event and metadata"}];y(async()=>{t=await g()}),w(async()=>{let e=r.teardownHook;e&&await e()});for(let e of u)await E(`When called with 'to' allows time traveling using ${e.info}`,async()=>{let a={productId:"123",quantity:10,price:3},S=10,o=I();await t.appendToStream(o,[{type:"ProductItemAdded",data:{productItem:a}}]),await t.appendToStream(o,[{type:"ProductItemAdded",data:{productItem:a}}]),await t.appendToStream(o,[{type:"DiscountApplied",data:{percent:S}}]);let p=await t.aggregateStream(o,{evolve:e.evolve,initialState:d,read:{to:1n}}),v=await t.aggregateStream(o,{evolve:e.evolve,initialState:d,read:{to:2n}}),c=await t.aggregateStream(o,{evolve:e.evolve,initialState:d,read:{to:3n}});i(p),i(v),i(c),s(p.currentStreamVersion,r.getInitialIndex()),n(p.state,{productItems:[a],totalAmount:30}),s(v.currentStreamVersion,r.getInitialIndex()+1n),n(v.state,{productItems:[a,a],totalAmount:60}),s(c.currentStreamVersion,r.getInitialIndex()+2n),n(c.state,{productItems:[a,a],totalAmount:54})})})}export{C as testAggregateStream};
|
|
2
2
|
//# sourceMappingURL=features.mjs.map
|
package/dist/testing/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ArgumentMatcher, AssertionError, MockedFunction, argMatches, argValue, assertDeepEqual, assertEqual, assertFails, assertFalse, assertIsNotNull, assertIsNull, assertMatches, assertNotEqual, assertOk, assertThat, assertThatArray, assertThrows, assertThrowsAsync, assertTrue, isSubset, verifyThat } from './assertions.mjs';
|
|
1
|
+
export { ArgumentMatcher, AssertionError, MockedFunction, argMatches, argValue, assertDeepEqual, assertEqual, assertFails, assertFalse, assertIsNotNull, assertIsNull, assertMatches, assertNotDeepEqual, assertNotEqual, assertOk, assertThat, assertThatArray, assertThrows, assertThrowsAsync, assertTrue, isSubset, verifyThat } from './assertions.mjs';
|
|
2
2
|
export { DeciderSpecfication, DeciderSpecification, ThenThrows } from './deciderSpecification.mjs';
|
|
3
3
|
export { TestEventStream, WrapEventStore } from './wrapEventStore.mjs';
|
|
4
4
|
import '../errors/index.mjs';
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ArgumentMatcher, AssertionError, MockedFunction, argMatches, argValue, assertDeepEqual, assertEqual, assertFails, assertFalse, assertIsNotNull, assertIsNull, assertMatches, assertNotEqual, assertOk, assertThat, assertThatArray, assertThrows, assertThrowsAsync, assertTrue, isSubset, verifyThat } from './assertions.js';
|
|
1
|
+
export { ArgumentMatcher, AssertionError, MockedFunction, argMatches, argValue, assertDeepEqual, assertEqual, assertFails, assertFalse, assertIsNotNull, assertIsNull, assertMatches, assertNotDeepEqual, assertNotEqual, assertOk, assertThat, assertThatArray, assertThrows, assertThrowsAsync, assertTrue, isSubset, verifyThat } from './assertions.js';
|
|
2
2
|
export { DeciderSpecfication, DeciderSpecification, ThenThrows } from './deciderSpecification.js';
|
|
3
3
|
export { TestEventStream, WrapEventStore } from './wrapEventStore.js';
|
|
4
4
|
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-BNCTLP4B.js');var _chunkTNX525X5js = require('../chunk-TNX525X5.js');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-BNCTLP4B.js');var _chunkTNX525X5js = require('../chunk-TNX525X5.js');var _chunkC2N3BJXWjs = require('../chunk-C2N3BJXW.js');var _chunk3ZZHSAJGjs = require('../chunk-3ZZHSAJG.js');require('../chunk-6IATZUYD.js');require('../chunk-PVFUNWT6.js');require('../chunk-FE73T2NS.js');require('../chunk-3JE5DUJ2.js');require('../chunk-ZLASBJGR.js');require('../chunk-UFUSYJWU.js');require('../chunk-MHB2JU4U.js');require('../chunk-7FJXUW3D.js');require('../chunk-5BGN2FV4.js');require('../chunk-QYDAYWBJ.js');require('../chunk-LOJ6A4AJ.js');require('../chunk-AU2WZCER.js');require('../chunk-MKHK5TRM.js');require('../chunk-E7KI3V22.js');exports.AssertionError = _chunk3ZZHSAJGjs.a; exports.DeciderSpecification = _chunkC2N3BJXWjs.a; exports.WrapEventStore = _chunkTNX525X5js.a; exports.argMatches = _chunk3ZZHSAJGjs.r; exports.argValue = _chunk3ZZHSAJGjs.q; exports.assertDeepEqual = _chunk3ZZHSAJGjs.g; exports.assertEqual = _chunk3ZZHSAJGjs.m; exports.assertFails = _chunk3ZZHSAJGjs.c; exports.assertFalse = _chunk3ZZHSAJGjs.j; exports.assertIsNotNull = _chunk3ZZHSAJGjs.o; exports.assertIsNull = _chunk3ZZHSAJGjs.p; exports.assertMatches = _chunk3ZZHSAJGjs.f; exports.assertNotDeepEqual = _chunk3ZZHSAJGjs.h; exports.assertNotEqual = _chunk3ZZHSAJGjs.n; exports.assertOk = _chunk3ZZHSAJGjs.l; exports.assertThat = _chunk3ZZHSAJGjs.i; exports.assertThatArray = _chunk3ZZHSAJGjs.t; exports.assertThrows = _chunk3ZZHSAJGjs.e; exports.assertThrowsAsync = _chunk3ZZHSAJGjs.d; exports.assertTrue = _chunk3ZZHSAJGjs.k; exports.isSubset = _chunk3ZZHSAJGjs.b; exports.verifyThat = _chunk3ZZHSAJGjs.s;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/testing/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-AHXBZPOE.mjs";import{a as
|
|
1
|
+
import"../chunk-AHXBZPOE.mjs";import{a as v}from"../chunk-N6X7QWHP.mjs";import{a as u}from"../chunk-BZ6ZVZAX.mjs";import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t}from"../chunk-ZUHYOH4G.mjs";import"../chunk-3DH3DSMC.mjs";import"../chunk-B7NWWHCY.mjs";import"../chunk-OBA6MZMG.mjs";import"../chunk-YKFEDBH4.mjs";import"../chunk-YWRV75GA.mjs";import"../chunk-GNUOGYD6.mjs";import"../chunk-JDYZZRJE.mjs";import"../chunk-3LYVXI5R.mjs";import"../chunk-DOHUIBZQ.mjs";import"../chunk-QWM33AYY.mjs";import"../chunk-DIW552TK.mjs";import"../chunk-7JLAVMM3.mjs";import"../chunk-S33YM44M.mjs";import"../chunk-KLLSLLHN.mjs";export{a as AssertionError,u as DeciderSpecification,v as WrapEventStore,r as argMatches,q as argValue,g as assertDeepEqual,m as assertEqual,c as assertFails,j as assertFalse,o as assertIsNotNull,p as assertIsNull,f as assertMatches,h as assertNotDeepEqual,n as assertNotEqual,l as assertOk,i as assertThat,t as assertThatArray,e as assertThrows,d as assertThrowsAsync,k as assertTrue,b as isSubset,s as verifyThat};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk7BR3VBVDjs = require('../chunk-7BR3VBVD.js');require('../chunk-ZLASBJGR.js');require('../chunk-UFUSYJWU.js');require('../chunk-MHB2JU4U.js');require('../chunk-7FJXUW3D.js');require('../chunk-5BGN2FV4.js');require('../chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk7BR3VBVDjs = require('../chunk-7BR3VBVD.js');require('../chunk-ZLASBJGR.js');require('../chunk-UFUSYJWU.js');require('../chunk-MHB2JU4U.js');require('../chunk-7FJXUW3D.js');require('../chunk-5BGN2FV4.js');require('../chunk-QYDAYWBJ.js');exports.evolve = _chunk7BR3VBVDjs.a; exports.evolveWithMetadata = _chunk7BR3VBVDjs.b; exports.initialState = _chunk7BR3VBVDjs.c;
|
|
2
2
|
//# sourceMappingURL=shoppingCart.domain.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c}from"../chunk-WB5PNUKG.mjs";import"../chunk-YWRV75GA.mjs";import"../chunk-GNUOGYD6.mjs";import"../chunk-JDYZZRJE.mjs";import"../chunk-3LYVXI5R.mjs";import"../chunk-DOHUIBZQ.mjs";import"../chunk-
|
|
1
|
+
import{a,b,c}from"../chunk-WB5PNUKG.mjs";import"../chunk-YWRV75GA.mjs";import"../chunk-GNUOGYD6.mjs";import"../chunk-JDYZZRJE.mjs";import"../chunk-3LYVXI5R.mjs";import"../chunk-DOHUIBZQ.mjs";import"../chunk-QWM33AYY.mjs";export{a as evolve,b as evolveWithMetadata,c as initialState};
|
|
2
2
|
//# sourceMappingURL=shoppingCart.domain.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkTNX525X5js = require('../chunk-TNX525X5.js');require('../chunk-ZLASBJGR.js');require('../chunk-UFUSYJWU.js');require('../chunk-MHB2JU4U.js');require('../chunk-7FJXUW3D.js');require('../chunk-5BGN2FV4.js');require('../chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkTNX525X5js = require('../chunk-TNX525X5.js');require('../chunk-ZLASBJGR.js');require('../chunk-UFUSYJWU.js');require('../chunk-MHB2JU4U.js');require('../chunk-7FJXUW3D.js');require('../chunk-5BGN2FV4.js');require('../chunk-QYDAYWBJ.js');exports.WrapEventStore = _chunkTNX525X5js.a;
|
|
2
2
|
//# sourceMappingURL=wrapEventStore.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-N6X7QWHP.mjs";import"../chunk-YWRV75GA.mjs";import"../chunk-GNUOGYD6.mjs";import"../chunk-JDYZZRJE.mjs";import"../chunk-3LYVXI5R.mjs";import"../chunk-DOHUIBZQ.mjs";import"../chunk-
|
|
1
|
+
import{a}from"../chunk-N6X7QWHP.mjs";import"../chunk-YWRV75GA.mjs";import"../chunk-GNUOGYD6.mjs";import"../chunk-JDYZZRJE.mjs";import"../chunk-3LYVXI5R.mjs";import"../chunk-DOHUIBZQ.mjs";import"../chunk-QWM33AYY.mjs";export{a as WrapEventStore};
|
|
2
2
|
//# sourceMappingURL=wrapEventStore.mjs.map
|
package/dist/typing/event.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { CreateEventType, Event, EventDataOf, EventMetaDataOf, EventTypeOf, ReadEvent, ReadEventMetadata, ReadEventMetadataWithGlobalPosition, event } from './index.mjs';
|
|
1
|
+
export { CanHandle, CreateEventType, Event, EventDataOf, EventMetaDataOf, EventTypeOf, ReadEvent, ReadEventMetadata, ReadEventMetadataWithGlobalPosition, event } from './index.mjs';
|
|
2
2
|
import './deepReadonly.mjs';
|
package/dist/typing/event.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { CreateEventType, Event, EventDataOf, EventMetaDataOf, EventTypeOf, ReadEvent, ReadEventMetadata, ReadEventMetadataWithGlobalPosition, event } from './index.js';
|
|
1
|
+
export { CanHandle, CreateEventType, Event, EventDataOf, EventMetaDataOf, EventTypeOf, ReadEvent, ReadEventMetadata, ReadEventMetadataWithGlobalPosition, event } from './index.js';
|
|
2
2
|
import './deepReadonly.js';
|
package/dist/typing/event.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQYDAYWBJjs = require('../chunk-QYDAYWBJ.js');exports.event = _chunkQYDAYWBJjs.a;
|
|
2
2
|
//# sourceMappingURL=event.js.map
|
package/dist/typing/event.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-QWM33AYY.mjs";export{a as event};
|
|
2
2
|
//# sourceMappingURL=event.mjs.map
|
package/dist/typing/index.d.mts
CHANGED
|
@@ -26,6 +26,7 @@ type Event<EventType extends string = string, EventData extends DefaultRecord =
|
|
|
26
26
|
type EventTypeOf<T extends Event> = T['type'];
|
|
27
27
|
type EventDataOf<T extends Event> = T['data'];
|
|
28
28
|
type EventMetaDataOf<T extends Event> = T['metadata'];
|
|
29
|
+
type CanHandle<T extends Event> = EventTypeOf<T>[];
|
|
29
30
|
type CreateEventType<EventType extends string, EventData extends DefaultRecord, EventMetaData extends DefaultRecord | undefined> = Readonly<{
|
|
30
31
|
type: EventType;
|
|
31
32
|
data: EventData;
|
|
@@ -110,4 +111,4 @@ type Flavour<K, T> = K & {
|
|
|
110
111
|
};
|
|
111
112
|
type DefaultRecord = Record<string, unknown>;
|
|
112
113
|
|
|
113
|
-
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 ReadEvent, type ReadEventMetadata, type ReadEventMetadataWithGlobalPosition, type Workflow, type WorkflowCommand, type WorkflowEvent, type WorkflowOutput, accept, command, complete, error, event, ignore, publish, reply, schedule, send };
|
|
114
|
+
export { type Brand, type CanHandle, 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 ReadEvent, type ReadEventMetadata, type ReadEventMetadataWithGlobalPosition, 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
|
@@ -26,6 +26,7 @@ type Event<EventType extends string = string, EventData extends DefaultRecord =
|
|
|
26
26
|
type EventTypeOf<T extends Event> = T['type'];
|
|
27
27
|
type EventDataOf<T extends Event> = T['data'];
|
|
28
28
|
type EventMetaDataOf<T extends Event> = T['metadata'];
|
|
29
|
+
type CanHandle<T extends Event> = EventTypeOf<T>[];
|
|
29
30
|
type CreateEventType<EventType extends string, EventData extends DefaultRecord, EventMetaData extends DefaultRecord | undefined> = Readonly<{
|
|
30
31
|
type: EventType;
|
|
31
32
|
data: EventData;
|
|
@@ -110,4 +111,4 @@ type Flavour<K, T> = K & {
|
|
|
110
111
|
};
|
|
111
112
|
type DefaultRecord = Record<string, unknown>;
|
|
112
113
|
|
|
113
|
-
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 ReadEvent, type ReadEventMetadata, type ReadEventMetadataWithGlobalPosition, type Workflow, type WorkflowCommand, type WorkflowEvent, type WorkflowOutput, accept, command, complete, error, event, ignore, publish, reply, schedule, send };
|
|
114
|
+
export { type Brand, type CanHandle, 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 ReadEvent, type ReadEventMetadata, type ReadEventMetadataWithGlobalPosition, 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-ZLASBJGR.js');var _chunkUFUSYJWUjs = require('../chunk-UFUSYJWU.js');var _chunkMHB2JU4Ujs = require('../chunk-MHB2JU4U.js');require('../chunk-7FJXUW3D.js');require('../chunk-5BGN2FV4.js');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-ZLASBJGR.js');var _chunkUFUSYJWUjs = require('../chunk-UFUSYJWU.js');var _chunkMHB2JU4Ujs = require('../chunk-MHB2JU4U.js');require('../chunk-7FJXUW3D.js');require('../chunk-5BGN2FV4.js');var _chunkQYDAYWBJjs = require('../chunk-QYDAYWBJ.js');exports.accept = _chunkUFUSYJWUjs.h; exports.command = _chunkMHB2JU4Ujs.a; exports.complete = _chunkUFUSYJWUjs.e; exports.error = _chunkUFUSYJWUjs.g; exports.event = _chunkQYDAYWBJjs.a; exports.ignore = _chunkUFUSYJWUjs.f; exports.publish = _chunkUFUSYJWUjs.c; exports.reply = _chunkUFUSYJWUjs.a; exports.schedule = _chunkUFUSYJWUjs.d; exports.send = _chunkUFUSYJWUjs.b;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/typing/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-YWRV75GA.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-GNUOGYD6.mjs";import{a}from"../chunk-JDYZZRJE.mjs";import"../chunk-3LYVXI5R.mjs";import"../chunk-DOHUIBZQ.mjs";import{a as b}from"../chunk-
|
|
1
|
+
import"../chunk-YWRV75GA.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-GNUOGYD6.mjs";import{a}from"../chunk-JDYZZRJE.mjs";import"../chunk-3LYVXI5R.mjs";import"../chunk-DOHUIBZQ.mjs";import{a as b}from"../chunk-QWM33AYY.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/package.json
CHANGED
package/dist/chunk-JBAGEOUC.mjs
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{a as r}from"./chunk-B7NWWHCY.mjs";import{b as c}from"./chunk-S33YM44M.mjs";var l=class extends Error{constructor(e){super(e)}},g=(n,e)=>{let t=n,o=e;return u(t),u(o),Object.keys(o).every(a=>typeof o[a]=="object"?g(t[a],o[a]):o[a]===t[a])},p=n=>{throw new l(n??"That should not ever happened, right?")},f=async(n,e)=>{try{throw await n(),new l("Function didn't throw expected error")}catch(t){let o=t;return e&&s(e(o)),o}},w=(n,e)=>{try{throw n(),new l("Function didn't throw expected error")}catch(t){let o=t;return e&&s(e(o)),o}},k=(n,e,t)=>{if(!g(n,e))throw new l(t??`subObj:
|
|
2
|
-
${c.stringify(e)}
|
|
3
|
-
is not subset of
|
|
4
|
-
${c.stringify(n)}`)},x=(n,e,t)=>{if(!r(n,e))throw new l(t??`subObj:
|
|
5
|
-
${c.stringify(e)}
|
|
6
|
-
is equals to
|
|
7
|
-
${c.stringify(n)}`)},E=n=>({isEqualTo:e=>s(r(n,e))});function m(n,e){if(n)throw new l(e??"Condition is false")}function s(n,e){if(!n)throw new l(e??"Condition is false")}function u(n,e){if(!n)throw new l(e??"Condition is not truthy")}function i(n,e,t){if(n!==e)throw new l(t??`Objects are not equal:
|
|
8
|
-
Expected: ${c.stringify(n)}
|
|
9
|
-
Actual:${c.stringify(e)}`)}function h(n,e,t){if(n===e)throw new l(t??`Objects are equal: ${c.stringify(n)}`)}function b(n){h(n,null),u(n)}function y(n){i(n,null)}var O=n=>e=>r(e,n),v=n=>e=>n(e);function M(n){return{calledTimes:e=>{i(n.mock?.calls?.length,e)},notCalled:()=>{i(n?.mock?.calls?.length,0)},called:()=>{s(n.mock?.calls.length!==void 0&&n.mock.calls.length>0)},calledWith:(...e)=>{s(n.mock?.calls.length!==void 0&&n.mock.calls.length>=1&&n.mock.calls.some(t=>r(t.arguments,e)))},calledOnceWith:(...e)=>{s(n.mock?.calls.length!==void 0&&n.mock.calls.length===1&&n.mock.calls.some(t=>r(t.arguments,e)))},calledWithArgumentMatching:(...e)=>{s(n.mock?.calls.length!==void 0&&n.mock.calls.length>=1),s(n.mock?.calls.length!==void 0&&n.mock.calls.length>=1&&n.mock.calls.some(t=>t.arguments&&t.arguments.length>=e.length&&e.every((o,a)=>o(t.arguments[a]))))},notCalledWithArgumentMatching:(...e)=>{m(n.mock?.calls.length!==void 0&&n.mock.calls.length>=1&&n.mock.calls[0].arguments&&n.mock.calls[0].arguments.length>=e.length&&e.every((t,o)=>t(n.mock.calls[0].arguments[o])))}}}var A=n=>({isEmpty:()=>i(n.length,0),hasSize:e=>i(n.length,e),containsElements:(...e)=>{s(e.every(t=>e.some(o=>r(t,o))))},containsExactlyInAnyOrder:(...e)=>{i(n.length,e.length),s(n.every(t=>e.some(o=>r(t,o))))},containsExactlyInAnyOrderElementsOf:e=>{i(n.length,e.length),s(n.every(t=>e.some(o=>r(t,o))))},containsExactlyElementsOf:e=>{i(n.length,e.length);for(let t=0;t<n.length;t++)s(r(n[t],e[t]))},containsExactly:e=>{i(n.length,1),s(r(n[0],e))},contains:e=>{s(n.some(t=>r(t,e)))},containsOnlyOnceElementsOf:e=>{s(e.map(t=>n.filter(o=>r(o,t)).length).filter(t=>t===1).length===e.length)},containsAnyOf:(...e)=>{s(n.some(t=>e.some(o=>r(t,o))))},allMatch:e=>{s(n.every(e))},anyMatches:e=>{s(n.some(e))},allMatchAsync:async e=>{for(let t of n)s(await e(t))}});export{l as a,g as b,p as c,f as d,w as e,k as f,x as g,E as h,m as i,s as j,u as k,i as l,h as m,b as n,y as o,O as p,v as q,M as r,A as s};
|
|
10
|
-
//# sourceMappingURL=chunk-JBAGEOUC.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/testing/assertions.ts"],"sourcesContent":["import { JSONParser } from '../serialization';\nimport type { DefaultRecord } from '../typing';\nimport { deepEquals } from '../utils';\n\nexport class AssertionError extends Error {\n constructor(message: string) {\n super(message);\n }\n}\nexport const isSubset = (superObj: unknown, subObj: unknown): boolean => {\n const sup = superObj as DefaultRecord;\n const sub = subObj as DefaultRecord;\n\n assertOk(sup);\n assertOk(sub);\n\n return Object.keys(sub).every((ele: string) => {\n if (typeof sub[ele] == 'object') {\n return isSubset(sup[ele], sub[ele]);\n }\n return sub[ele] === sup[ele];\n });\n};\n\nexport const assertFails = (message?: string) => {\n throw new AssertionError(message ?? 'That should not ever happened, right?');\n};\n\nexport const assertThrowsAsync = async <TError extends Error>(\n fun: () => Promise<void>,\n errorCheck?: (error: Error) => boolean,\n): Promise<TError> => {\n try {\n await fun();\n throw new AssertionError(\"Function didn't throw expected error\");\n } catch (error) {\n const typedError = error as TError;\n if (errorCheck) assertTrue(errorCheck(typedError));\n return typedError;\n }\n};\n\nexport const assertThrows = <TError extends Error>(\n fun: () => void,\n errorCheck?: (error: Error) => boolean,\n): TError => {\n try {\n fun();\n throw new AssertionError(\"Function didn't throw expected error\");\n } catch (error) {\n const typedError = error as TError;\n if (errorCheck) assertTrue(errorCheck(typedError));\n return typedError;\n }\n};\nexport const assertMatches = (\n actual: unknown,\n expected: unknown,\n message?: string,\n) => {\n if (!isSubset(actual, expected))\n throw new AssertionError(\n message ??\n `subObj:\\n${JSONParser.stringify(expected)}\\nis not subset of\\n${JSONParser.stringify(actual)}`,\n );\n};\n\nexport const assertDeepEqual = <T = unknown>(\n actual: T,\n expected: T,\n message?: string,\n) => {\n if (!deepEquals(actual, expected))\n throw new AssertionError(\n message ??\n `subObj:\\n${JSONParser.stringify(expected)}\\nis equals to\\n${JSONParser.stringify(actual)}`,\n );\n};\n\nexport const assertThat = <T>(item: T) => {\n return {\n isEqualTo: (other: T) => assertTrue(deepEquals(item, other)),\n };\n};\n\nexport function assertFalse(\n condition: boolean,\n message?: string,\n): asserts condition is false {\n if (condition) throw new AssertionError(message ?? `Condition is false`);\n}\n\nexport function assertTrue(\n condition: boolean,\n message?: string,\n): asserts condition is true {\n if (!condition) throw new AssertionError(message ?? `Condition is false`);\n}\n\nexport function assertOk<T>(\n obj: T | null | undefined,\n message?: string,\n): asserts obj is T {\n if (!obj) throw new AssertionError(message ?? `Condition is not truthy`);\n}\n\nexport function assertEqual<T>(\n expected: T | null | undefined,\n actual: T | null | undefined,\n message?: string,\n): void {\n if (expected !== actual)\n throw new AssertionError(\n message ??\n `Objects are not equal:\\nExpected: ${JSONParser.stringify(expected)}\\nActual:${JSONParser.stringify(actual)}`,\n );\n}\n\nexport function assertNotEqual<T>(\n obj: T | null | undefined,\n other: T | null | undefined,\n message?: string,\n): void {\n if (obj === other)\n throw new AssertionError(\n message ?? `Objects are equal: ${JSONParser.stringify(obj)}`,\n );\n}\n\nexport function assertIsNotNull<T extends object | bigint>(\n result: T | null,\n): asserts result is T {\n assertNotEqual(result, null);\n assertOk(result);\n}\n\nexport function assertIsNull<T extends object>(\n result: T | null,\n): asserts result is null {\n assertEqual(result, null);\n}\n\ntype Call = {\n arguments: unknown[];\n result: unknown;\n target: unknown;\n this: unknown;\n};\n\nexport type ArgumentMatcher = (arg: unknown) => boolean;\n\nexport const argValue =\n <T>(value: T): ArgumentMatcher =>\n (arg) =>\n deepEquals(arg, value);\n\nexport const argMatches =\n <T>(matches: (arg: T) => boolean): ArgumentMatcher =>\n (arg) =>\n matches(arg as T);\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport type MockedFunction = Function & { mock?: { calls: Call[] } };\n\nexport function verifyThat(fn: MockedFunction) {\n return {\n calledTimes: (times: number) => {\n assertEqual(fn.mock?.calls?.length, times);\n },\n notCalled: () => {\n assertEqual(fn?.mock?.calls?.length, 0);\n },\n called: () => {\n assertTrue(\n fn.mock?.calls.length !== undefined && fn.mock.calls.length > 0,\n );\n },\n calledWith: (...args: unknown[]) => {\n assertTrue(\n fn.mock?.calls.length !== undefined &&\n fn.mock.calls.length >= 1 &&\n fn.mock.calls.some((call) => deepEquals(call.arguments, args)),\n );\n },\n calledOnceWith: (...args: unknown[]) => {\n assertTrue(\n fn.mock?.calls.length !== undefined &&\n fn.mock.calls.length === 1 &&\n fn.mock.calls.some((call) => deepEquals(call.arguments, args)),\n );\n },\n calledWithArgumentMatching: (...matches: ArgumentMatcher[]) => {\n assertTrue(\n fn.mock?.calls.length !== undefined && fn.mock.calls.length >= 1,\n );\n assertTrue(\n fn.mock?.calls.length !== undefined &&\n fn.mock.calls.length >= 1 &&\n fn.mock.calls.some(\n (call) =>\n call.arguments &&\n call.arguments.length >= matches.length &&\n matches.every((match, index) => match(call.arguments[index])),\n ),\n );\n },\n notCalledWithArgumentMatching: (...matches: ArgumentMatcher[]) => {\n assertFalse(\n fn.mock?.calls.length !== undefined &&\n fn.mock.calls.length >= 1 &&\n fn.mock.calls[0]!.arguments &&\n fn.mock.calls[0]!.arguments.length >= matches.length &&\n matches.every((match, index) =>\n match(fn.mock!.calls[0]!.arguments[index]),\n ),\n );\n },\n };\n}\n\nexport const assertThatArray = <T>(array: T[]) => {\n return {\n isEmpty: () => assertEqual(array.length, 0),\n hasSize: (length: number) => assertEqual(array.length, length),\n containsElements: (...other: T[]) => {\n assertTrue(other.every((ts) => other.some((o) => deepEquals(ts, o))));\n },\n containsExactlyInAnyOrder: (...other: T[]) => {\n assertEqual(array.length, other.length);\n assertTrue(array.every((ts) => other.some((o) => deepEquals(ts, o))));\n },\n containsExactlyInAnyOrderElementsOf: (other: T[]) => {\n assertEqual(array.length, other.length);\n assertTrue(array.every((ts) => other.some((o) => deepEquals(ts, o))));\n },\n containsExactlyElementsOf: (other: T[]) => {\n assertEqual(array.length, other.length);\n for (let i = 0; i < array.length; i++) {\n assertTrue(deepEquals(array[i], other[i]));\n }\n },\n containsExactly: (elem: T) => {\n assertEqual(array.length, 1);\n assertTrue(deepEquals(array[0], elem));\n },\n contains: (elem: T) => {\n assertTrue(array.some((a) => deepEquals(a, elem)));\n },\n containsOnlyOnceElementsOf: (other: T[]) => {\n assertTrue(\n other\n .map((o) => array.filter((a) => deepEquals(a, o)).length)\n .filter((a) => a === 1).length === other.length,\n );\n },\n containsAnyOf: (...other: T[]) => {\n assertTrue(array.some((a) => other.some((o) => deepEquals(a, o))));\n },\n allMatch: (matches: (item: T) => boolean) => {\n assertTrue(array.every(matches));\n },\n anyMatches: (matches: (item: T) => boolean) => {\n assertTrue(array.some(matches));\n },\n allMatchAsync: async (\n matches: (item: T) => Promise<boolean>,\n ): Promise<void> => {\n for (const item of array) {\n assertTrue(await matches(item));\n }\n },\n };\n};\n"],"mappings":"kFAIO,IAAMA,EAAN,cAA6B,KAAM,CACxC,YAAYC,EAAiB,CAC3B,MAAMA,CAAO,CACf,CACF,EACaC,EAAW,CAACC,EAAmBC,IAA6B,CACvE,IAAMC,EAAMF,EACNG,EAAMF,EAEZ,OAAAG,EAASF,CAAG,EACZE,EAASD,CAAG,EAEL,OAAO,KAAKA,CAAG,EAAE,MAAOE,GACzB,OAAOF,EAAIE,CAAG,GAAK,SACdN,EAASG,EAAIG,CAAG,EAAGF,EAAIE,CAAG,CAAC,EAE7BF,EAAIE,CAAG,IAAMH,EAAIG,CAAG,CAC5B,CACH,EAEaC,EAAeR,GAAqB,CAC/C,MAAM,IAAID,EAAeC,GAAW,uCAAuC,CAC7E,EAEaS,EAAoB,MAC/BC,EACAC,IACoB,CACpB,GAAI,CACF,YAAMD,EAAI,EACJ,IAAIX,EAAe,sCAAsC,CACjE,OAASa,EAAO,CACd,IAAMC,EAAaD,EACnB,OAAID,GAAYG,EAAWH,EAAWE,CAAU,CAAC,EAC1CA,CACT,CACF,EAEaE,EAAe,CAC1BL,EACAC,IACW,CACX,GAAI,CACF,MAAAD,EAAI,EACE,IAAIX,EAAe,sCAAsC,CACjE,OAASa,EAAO,CACd,IAAMC,EAAaD,EACnB,OAAID,GAAYG,EAAWH,EAAWE,CAAU,CAAC,EAC1CA,CACT,CACF,EACaG,EAAgB,CAC3BC,EACAC,EACAlB,IACG,CACH,GAAI,CAACC,EAASgB,EAAQC,CAAQ,EAC5B,MAAM,IAAInB,EACRC,GACE;AAAA,EAAYmB,EAAW,UAAUD,CAAQ,CAAC;AAAA;AAAA,EAAuBC,EAAW,UAAUF,CAAM,CAAC,EACjG,CACJ,EAEaG,EAAkB,CAC7BH,EACAC,EACAlB,IACG,CACH,GAAI,CAACqB,EAAWJ,EAAQC,CAAQ,EAC9B,MAAM,IAAInB,EACRC,GACE;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AM,MAAMT,CAAO,CAAC,CACjC,EACA,WAAaA,GAAkC,CAC7CvB,EAAWgC,EAAM,KAAKT,CAAO,CAAC,CAChC,EACA,cAAe,MACbA,GACkB,CAClB,QAAWd,KAAQuB,EACjBhC,EAAW,MAAMuB,EAAQd,CAAI,CAAC,CAElC,CACF","names":["AssertionError","message","isSubset","superObj","subObj","sup","sub","assertOk","ele","assertFails","assertThrowsAsync","fun","errorCheck","error","typedError","assertTrue","assertThrows","assertMatches","actual","expected","JSONParser","assertDeepEqual","deepEquals","assertThat","item","other","assertFalse","condition","obj","assertEqual","assertNotEqual","assertIsNotNull","result","assertIsNull","argValue","value","arg","argMatches","matches","verifyThat","fn","times","args","call","match","index","assertThatArray","array","length","ts","i","elem","a","o"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/typing/event.ts"],"names":["event","type","data","metadata"],"mappings":"AA6BO,IAAMA,EAAQ,CACnBC,EACAC,EACAC,KAMO,CACL,KAAAF,EACA,KAAAC,EACA,SAAAC,CACF","sourcesContent":["import type { DefaultRecord, Flavour } from './';\n\nexport type Event<\n EventType extends string = string,\n EventData extends DefaultRecord = DefaultRecord,\n EventMetaData extends DefaultRecord = DefaultRecord,\n> = Flavour<\n Readonly<{\n type: EventType;\n data: EventData;\n metadata?: EventMetaData;\n }>,\n 'Event'\n>;\n\nexport type EventTypeOf<T extends Event> = T['type'];\nexport type EventDataOf<T extends Event> = T['data'];\nexport type EventMetaDataOf<T extends Event> = T['metadata'];\n\nexport type CreateEventType<\n EventType extends string,\n EventData extends DefaultRecord,\n EventMetaData extends DefaultRecord | undefined,\n> = Readonly<{\n type: EventType;\n data: EventData;\n metadata?: EventMetaData;\n}>;\n\nexport const event = <EventType extends Event>(\n type: EventTypeOf<EventType>,\n data: EventDataOf<EventType>,\n metadata?: EventMetaDataOf<EventType>,\n): CreateEventType<\n EventTypeOf<EventType>,\n EventDataOf<EventType>,\n EventMetaDataOf<EventType>\n> => {\n return {\n type,\n data,\n metadata,\n };\n};\n\nexport type ReadEvent<\n EventType extends Event = Event,\n EventMetaDataType extends EventMetaDataOf<EventType> &\n ReadEventMetadata = EventMetaDataOf<EventType> & ReadEventMetadata,\n> = CreateEventType<\n EventTypeOf<EventType>,\n EventDataOf<EventType>,\n EventMetaDataType\n> &\n EventType & { metadata: EventMetaDataType };\n\nexport type ReadEventMetadata = Readonly<{\n eventId: string;\n streamPosition: bigint;\n streamName: string;\n}>;\n\nexport type ReadEventMetadataWithGlobalPosition = ReadEventMetadata & {\n globalPosition: bigint;\n};\n"]}
|
package/dist/chunk-NUSDLV6U.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";//# sourceMappingURL=chunk-NUSDLV6U.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
package/dist/chunk-OFBLNL5K.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkPVFUNWT6js = require('./chunk-PVFUNWT6.js');var _chunkMKHK5TRMjs = require('./chunk-MKHK5TRM.js');var l=class extends Error{constructor(e){super(e)}},g= exports.b =(n,e)=>{let t=n,o=e;return u(t),u(o),Object.keys(o).every(a=>typeof o[a]=="object"?g(t[a],o[a]):o[a]===t[a])},p= exports.c =n=>{throw new l(_nullishCoalesce(n, () => ("That should not ever happened, right?")))},f= exports.d =async(n,e)=>{try{throw await n(),new l("Function didn't throw expected error")}catch(t){let o=t;return e&&s(e(o)),o}},w= exports.e =(n,e)=>{try{throw n(),new l("Function didn't throw expected error")}catch(t){let o=t;return e&&s(e(o)),o}},k= exports.f =(n,e,t)=>{if(!g(n,e))throw new l(_nullishCoalesce(t, () => (`subObj:
|
|
2
|
-
${_chunkMKHK5TRMjs.b.stringify(e)}
|
|
3
|
-
is not subset of
|
|
4
|
-
${_chunkMKHK5TRMjs.b.stringify(n)}`)))},x= exports.g =(n,e,t)=>{if(!_chunkPVFUNWT6js.a.call(void 0, n,e))throw new l(_nullishCoalesce(t, () => (`subObj:
|
|
5
|
-
${_chunkMKHK5TRMjs.b.stringify(e)}
|
|
6
|
-
is equals to
|
|
7
|
-
${_chunkMKHK5TRMjs.b.stringify(n)}`)))},E= exports.h =n=>({isEqualTo:e=>s(_chunkPVFUNWT6js.a.call(void 0, n,e))});function m(n,e){if(n)throw new l(_nullishCoalesce(e, () => ("Condition is false")))}function s(n,e){if(!n)throw new l(_nullishCoalesce(e, () => ("Condition is false")))}function u(n,e){if(!n)throw new l(_nullishCoalesce(e, () => ("Condition is not truthy")))}function i(n,e,t){if(n!==e)throw new l(_nullishCoalesce(t, () => (`Objects are not equal:
|
|
8
|
-
Expected: ${_chunkMKHK5TRMjs.b.stringify(n)}
|
|
9
|
-
Actual:${_chunkMKHK5TRMjs.b.stringify(e)}`)))}function h(n,e,t){if(n===e)throw new l(_nullishCoalesce(t, () => (`Objects are equal: ${_chunkMKHK5TRMjs.b.stringify(n)}`)))}function b(n){h(n,null),u(n)}function y(n){i(n,null)}var O=n=>e=>_chunkPVFUNWT6js.a.call(void 0, e,n),v= exports.q =n=>e=>n(e);function M(n){return{calledTimes:e=>{i(_optionalChain([n, 'access', _ => _.mock, 'optionalAccess', _2 => _2.calls, 'optionalAccess', _3 => _3.length]),e)},notCalled:()=>{i(_optionalChain([n, 'optionalAccess', _4 => _4.mock, 'optionalAccess', _5 => _5.calls, 'optionalAccess', _6 => _6.length]),0)},called:()=>{s(_optionalChain([n, 'access', _7 => _7.mock, 'optionalAccess', _8 => _8.calls, 'access', _9 => _9.length])!==void 0&&n.mock.calls.length>0)},calledWith:(...e)=>{s(_optionalChain([n, 'access', _10 => _10.mock, 'optionalAccess', _11 => _11.calls, 'access', _12 => _12.length])!==void 0&&n.mock.calls.length>=1&&n.mock.calls.some(t=>_chunkPVFUNWT6js.a.call(void 0, t.arguments,e)))},calledOnceWith:(...e)=>{s(_optionalChain([n, 'access', _13 => _13.mock, 'optionalAccess', _14 => _14.calls, 'access', _15 => _15.length])!==void 0&&n.mock.calls.length===1&&n.mock.calls.some(t=>_chunkPVFUNWT6js.a.call(void 0, t.arguments,e)))},calledWithArgumentMatching:(...e)=>{s(_optionalChain([n, 'access', _16 => _16.mock, 'optionalAccess', _17 => _17.calls, 'access', _18 => _18.length])!==void 0&&n.mock.calls.length>=1),s(_optionalChain([n, 'access', _19 => _19.mock, 'optionalAccess', _20 => _20.calls, 'access', _21 => _21.length])!==void 0&&n.mock.calls.length>=1&&n.mock.calls.some(t=>t.arguments&&t.arguments.length>=e.length&&e.every((o,a)=>o(t.arguments[a]))))},notCalledWithArgumentMatching:(...e)=>{m(_optionalChain([n, 'access', _22 => _22.mock, 'optionalAccess', _23 => _23.calls, 'access', _24 => _24.length])!==void 0&&n.mock.calls.length>=1&&n.mock.calls[0].arguments&&n.mock.calls[0].arguments.length>=e.length&&e.every((t,o)=>t(n.mock.calls[0].arguments[o])))}}}var A=n=>({isEmpty:()=>i(n.length,0),hasSize:e=>i(n.length,e),containsElements:(...e)=>{s(e.every(t=>e.some(o=>_chunkPVFUNWT6js.a.call(void 0, t,o))))},containsExactlyInAnyOrder:(...e)=>{i(n.length,e.length),s(n.every(t=>e.some(o=>_chunkPVFUNWT6js.a.call(void 0, t,o))))},containsExactlyInAnyOrderElementsOf:e=>{i(n.length,e.length),s(n.every(t=>e.some(o=>_chunkPVFUNWT6js.a.call(void 0, t,o))))},containsExactlyElementsOf:e=>{i(n.length,e.length);for(let t=0;t<n.length;t++)s(_chunkPVFUNWT6js.a.call(void 0, n[t],e[t]))},containsExactly:e=>{i(n.length,1),s(_chunkPVFUNWT6js.a.call(void 0, n[0],e))},contains:e=>{s(n.some(t=>_chunkPVFUNWT6js.a.call(void 0, t,e)))},containsOnlyOnceElementsOf:e=>{s(e.map(t=>n.filter(o=>_chunkPVFUNWT6js.a.call(void 0, o,t)).length).filter(t=>t===1).length===e.length)},containsAnyOf:(...e)=>{s(n.some(t=>e.some(o=>_chunkPVFUNWT6js.a.call(void 0, t,o))))},allMatch:e=>{s(n.every(e))},anyMatches:e=>{s(n.some(e))},allMatchAsync:async e=>{for(let t of n)s(await e(t))}});exports.a = l; exports.b = g; exports.c = p; exports.d = f; exports.e = w; exports.f = k; exports.g = x; exports.h = E; exports.i = m; exports.j = s; exports.k = u; exports.l = i; exports.m = h; exports.n = b; exports.o = y; exports.p = O; exports.q = v; exports.r = M; exports.s = A;
|
|
10
|
-
//# sourceMappingURL=chunk-OFBLNL5K.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/testing/assertions.ts"],"names":["AssertionError","message","isSubset","superObj","subObj","sup","sub","assertOk","ele","assertFails","assertThrowsAsync","fun","errorCheck","error","typedError","assertTrue","assertThrows","assertMatches","actual","expected","JSONParser","assertDeepEqual","deepEquals","assertThat","item","other","assertFalse","condition","obj","assertEqual","assertNotEqual","assertIsNotNull","result","assertIsNull","argValue","value","arg","argMatches","matches","verifyThat","fn","times","args","call","match","index","assertThatArray","array","length","ts","i","elem","a","o"],"mappings":"gFAIO,IAAMA,EAAN,cAA6B,KAAM,CACxC,YAAYC,EAAiB,CAC3B,MAAMA,CAAO,CACf,CACF,EACaC,EAAW,CAACC,EAAmBC,IAA6B,CACvE,IAAMC,EAAMF,EACNG,EAAMF,EAEZ,OAAAG,EAASF,CAAG,EACZE,EAASD,CAAG,EAEL,OAAO,KAAKA,CAAG,EAAE,MAAOE,GACzB,OAA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AAe,CACnDI,EAAYkB,EAAM,OAAQtB,EAAM,MAAM,EACtCV,EAAWgC,EAAM,MAAOE,GAAOxB,EAAM,KAAM,GAAMH,EAAW2B,EAAI,CAAC,CAAC,CAAC,CAAC,CACtE,EACA,0BAA4BxB,GAAe,CACzCI,EAAYkB,EAAM,OAAQtB,EAAM,MAAM,EACtC,QAASyB,EAAI,EAAGA,EAAIH,EAAM,OAAQG,IAChCnC,EAAWO,EAAWyB,EAAMG,CAAC,EAAGzB,EAAMyB,CAAC,CAAC,CAAC,CAE7C,EACA,gBAAkBC,GAAY,CAC5BtB,EAAYkB,EAAM,OAAQ,CAAC,EAC3BhC,EAAWO,EAAWyB,EAAM,CAAC,EAAGI,CAAI,CAAC,CACvC,EACA,SAAWA,GAAY,CACrBpC,EAAWgC,EAAM,KAAMK,GAAM9B,EAAW8B,EAAGD,CAAI,CAAC,CAAC,CACnD,EACA,2BAA6B1B,GAAe,CAC1CV,EACEU,EACG,IAAK4B,GAAMN,EAAM,OAAQK,GAAM9B,EAAW8B,EAAGC,CAAC,CAAC,EAAE,MAAM,EACvD,OAAQD,GAAMA,IAAM,CAAC,EAAE,SAAW3B,EAAM,MAC7C,CACF,EACA,cAAe,IAAIA,IAAe,CAChCV,EAAWgC,EAAM,KAAMK,GAAM3B,EAAM,KAAM,GAAMH,EAAW8B,EAAG,CAAC,CAAC,CAAC,CAAC,CACnE,EACA,SAAWd,GAAkC,CAC3CvB,EAAWgC,EAAM,MAAMT,CAAO,CAAC,CACjC,EACA,WAAaA,GAAkC,CAC7CvB,EAAWgC,EAAM,KAAKT,CAAO,CAAC,CAChC,EACA,cAAe,MACbA,GACkB,CAClB,QAAWd,KAAQuB,EACjBhC,EAAW,MAAMuB,EAAQd,CAAI,CAAC,CAElC,CACF","sourcesContent":["import { JSONParser } from '../serialization';\nimport type { DefaultRecord } from '../typing';\nimport { deepEquals } from '../utils';\n\nexport class AssertionError extends Error {\n constructor(message: string) {\n super(message);\n }\n}\nexport const isSubset = (superObj: unknown, subObj: unknown): boolean => {\n const sup = superObj as DefaultRecord;\n const sub = subObj as DefaultRecord;\n\n assertOk(sup);\n assertOk(sub);\n\n return Object.keys(sub).every((ele: string) => {\n if (typeof sub[ele] == 'object') {\n return isSubset(sup[ele], sub[ele]);\n }\n return sub[ele] === sup[ele];\n });\n};\n\nexport const assertFails = (message?: string) => {\n throw new AssertionError(message ?? 'That should not ever happened, right?');\n};\n\nexport const assertThrowsAsync = async <TError extends Error>(\n fun: () => Promise<void>,\n errorCheck?: (error: Error) => boolean,\n): Promise<TError> => {\n try {\n await fun();\n throw new AssertionError(\"Function didn't throw expected error\");\n } catch (error) {\n const typedError = error as TError;\n if (errorCheck) assertTrue(errorCheck(typedError));\n return typedError;\n }\n};\n\nexport const assertThrows = <TError extends Error>(\n fun: () => void,\n errorCheck?: (error: Error) => boolean,\n): TError => {\n try {\n fun();\n throw new AssertionError(\"Function didn't throw expected error\");\n } catch (error) {\n const typedError = error as TError;\n if (errorCheck) assertTrue(errorCheck(typedError));\n return typedError;\n }\n};\nexport const assertMatches = (\n actual: unknown,\n expected: unknown,\n message?: string,\n) => {\n if (!isSubset(actual, expected))\n throw new AssertionError(\n message ??\n `subObj:\\n${JSONParser.stringify(expected)}\\nis not subset of\\n${JSONParser.stringify(actual)}`,\n );\n};\n\nexport const assertDeepEqual = <T = unknown>(\n actual: T,\n expected: T,\n message?: string,\n) => {\n if (!deepEquals(actual, expected))\n throw new AssertionError(\n message ??\n `subObj:\\n${JSONParser.stringify(expected)}\\nis equals to\\n${JSONParser.stringify(actual)}`,\n );\n};\n\nexport const assertThat = <T>(item: T) => {\n return {\n isEqualTo: (other: T) => assertTrue(deepEquals(item, other)),\n };\n};\n\nexport function assertFalse(\n condition: boolean,\n message?: string,\n): asserts condition is false {\n if (condition) throw new AssertionError(message ?? `Condition is false`);\n}\n\nexport function assertTrue(\n condition: boolean,\n message?: string,\n): asserts condition is true {\n if (!condition) throw new AssertionError(message ?? `Condition is false`);\n}\n\nexport function assertOk<T>(\n obj: T | null | undefined,\n message?: string,\n): asserts obj is T {\n if (!obj) throw new AssertionError(message ?? `Condition is not truthy`);\n}\n\nexport function assertEqual<T>(\n expected: T | null | undefined,\n actual: T | null | undefined,\n message?: string,\n): void {\n if (expected !== actual)\n throw new AssertionError(\n message ??\n `Objects are not equal:\\nExpected: ${JSONParser.stringify(expected)}\\nActual:${JSONParser.stringify(actual)}`,\n );\n}\n\nexport function assertNotEqual<T>(\n obj: T | null | undefined,\n other: T | null | undefined,\n message?: string,\n): void {\n if (obj === other)\n throw new AssertionError(\n message ?? `Objects are equal: ${JSONParser.stringify(obj)}`,\n );\n}\n\nexport function assertIsNotNull<T extends object | bigint>(\n result: T | null,\n): asserts result is T {\n assertNotEqual(result, null);\n assertOk(result);\n}\n\nexport function assertIsNull<T extends object>(\n result: T | null,\n): asserts result is null {\n assertEqual(result, null);\n}\n\ntype Call = {\n arguments: unknown[];\n result: unknown;\n target: unknown;\n this: unknown;\n};\n\nexport type ArgumentMatcher = (arg: unknown) => boolean;\n\nexport const argValue =\n <T>(value: T): ArgumentMatcher =>\n (arg) =>\n deepEquals(arg, value);\n\nexport const argMatches =\n <T>(matches: (arg: T) => boolean): ArgumentMatcher =>\n (arg) =>\n matches(arg as T);\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport type MockedFunction = Function & { mock?: { calls: Call[] } };\n\nexport function verifyThat(fn: MockedFunction) {\n return {\n calledTimes: (times: number) => {\n assertEqual(fn.mock?.calls?.length, times);\n },\n notCalled: () => {\n assertEqual(fn?.mock?.calls?.length, 0);\n },\n called: () => {\n assertTrue(\n fn.mock?.calls.length !== undefined && fn.mock.calls.length > 0,\n );\n },\n calledWith: (...args: unknown[]) => {\n assertTrue(\n fn.mock?.calls.length !== undefined &&\n fn.mock.calls.length >= 1 &&\n fn.mock.calls.some((call) => deepEquals(call.arguments, args)),\n );\n },\n calledOnceWith: (...args: unknown[]) => {\n assertTrue(\n fn.mock?.calls.length !== undefined &&\n fn.mock.calls.length === 1 &&\n fn.mock.calls.some((call) => deepEquals(call.arguments, args)),\n );\n },\n calledWithArgumentMatching: (...matches: ArgumentMatcher[]) => {\n assertTrue(\n fn.mock?.calls.length !== undefined && fn.mock.calls.length >= 1,\n );\n assertTrue(\n fn.mock?.calls.length !== undefined &&\n fn.mock.calls.length >= 1 &&\n fn.mock.calls.some(\n (call) =>\n call.arguments &&\n call.arguments.length >= matches.length &&\n matches.every((match, index) => match(call.arguments[index])),\n ),\n );\n },\n notCalledWithArgumentMatching: (...matches: ArgumentMatcher[]) => {\n assertFalse(\n fn.mock?.calls.length !== undefined &&\n fn.mock.calls.length >= 1 &&\n fn.mock.calls[0]!.arguments &&\n fn.mock.calls[0]!.arguments.length >= matches.length &&\n matches.every((match, index) =>\n match(fn.mock!.calls[0]!.arguments[index]),\n ),\n );\n },\n };\n}\n\nexport const assertThatArray = <T>(array: T[]) => {\n return {\n isEmpty: () => assertEqual(array.length, 0),\n hasSize: (length: number) => assertEqual(array.length, length),\n containsElements: (...other: T[]) => {\n assertTrue(other.every((ts) => other.some((o) => deepEquals(ts, o))));\n },\n containsExactlyInAnyOrder: (...other: T[]) => {\n assertEqual(array.length, other.length);\n assertTrue(array.every((ts) => other.some((o) => deepEquals(ts, o))));\n },\n containsExactlyInAnyOrderElementsOf: (other: T[]) => {\n assertEqual(array.length, other.length);\n assertTrue(array.every((ts) => other.some((o) => deepEquals(ts, o))));\n },\n containsExactlyElementsOf: (other: T[]) => {\n assertEqual(array.length, other.length);\n for (let i = 0; i < array.length; i++) {\n assertTrue(deepEquals(array[i], other[i]));\n }\n },\n containsExactly: (elem: T) => {\n assertEqual(array.length, 1);\n assertTrue(deepEquals(array[0], elem));\n },\n contains: (elem: T) => {\n assertTrue(array.some((a) => deepEquals(a, elem)));\n },\n containsOnlyOnceElementsOf: (other: T[]) => {\n assertTrue(\n other\n .map((o) => array.filter((a) => deepEquals(a, o)).length)\n .filter((a) => a === 1).length === other.length,\n );\n },\n containsAnyOf: (...other: T[]) => {\n assertTrue(array.some((a) => other.some((o) => deepEquals(a, o))));\n },\n allMatch: (matches: (item: T) => boolean) => {\n assertTrue(array.every(matches));\n },\n anyMatches: (matches: (item: T) => boolean) => {\n assertTrue(array.some(matches));\n },\n allMatchAsync: async (\n matches: (item: T) => Promise<boolean>,\n ): Promise<void> => {\n for (const item of array) {\n assertTrue(await matches(item));\n }\n },\n };\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/typing/event.ts"],"sourcesContent":["import type { DefaultRecord, Flavour } from './';\n\nexport type Event<\n EventType extends string = string,\n EventData extends DefaultRecord = DefaultRecord,\n EventMetaData extends DefaultRecord = DefaultRecord,\n> = Flavour<\n Readonly<{\n type: EventType;\n data: EventData;\n metadata?: EventMetaData;\n }>,\n 'Event'\n>;\n\nexport type EventTypeOf<T extends Event> = T['type'];\nexport type EventDataOf<T extends Event> = T['data'];\nexport type EventMetaDataOf<T extends Event> = T['metadata'];\n\nexport type CreateEventType<\n EventType extends string,\n EventData extends DefaultRecord,\n EventMetaData extends DefaultRecord | undefined,\n> = Readonly<{\n type: EventType;\n data: EventData;\n metadata?: EventMetaData;\n}>;\n\nexport const event = <EventType extends Event>(\n type: EventTypeOf<EventType>,\n data: EventDataOf<EventType>,\n metadata?: EventMetaDataOf<EventType>,\n): CreateEventType<\n EventTypeOf<EventType>,\n EventDataOf<EventType>,\n EventMetaDataOf<EventType>\n> => {\n return {\n type,\n data,\n metadata,\n };\n};\n\nexport type ReadEvent<\n EventType extends Event = Event,\n EventMetaDataType extends EventMetaDataOf<EventType> &\n ReadEventMetadata = EventMetaDataOf<EventType> & ReadEventMetadata,\n> = CreateEventType<\n EventTypeOf<EventType>,\n EventDataOf<EventType>,\n EventMetaDataType\n> &\n EventType & { metadata: EventMetaDataType };\n\nexport type ReadEventMetadata = Readonly<{\n eventId: string;\n streamPosition: bigint;\n streamName: string;\n}>;\n\nexport type ReadEventMetadataWithGlobalPosition = ReadEventMetadata & {\n globalPosition: bigint;\n};\n"],"mappings":"AA6BO,IAAMA,EAAQ,CACnBC,EACAC,EACAC,KAMO,CACL,KAAAF,EACA,KAAAC,EACA,SAAAC,CACF","names":["event","type","data","metadata"]}
|
package/dist/chunk-YWZW37IT.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-YWZW37IT.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
File without changes
|
|
File without changes
|