@event-driven-io/emmett 0.1.4 → 0.1.6
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/index.d.mts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -0
- package/dist/index.mjs.map +1 -1
- package/dist/serialization/index.d.mts +1 -0
- package/dist/serialization/index.d.ts +1 -0
- package/dist/serialization/index.js +2 -0
- package/dist/serialization/index.js.map +1 -0
- package/dist/serialization/index.mjs +2 -0
- package/dist/serialization/index.mjs.map +1 -0
- package/dist/testing/index.d.mts +1 -2
- package/dist/testing/index.d.ts +1 -2
- package/dist/testing/index.js +2 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/index.mjs +1 -0
- package/dist/testing/index.mjs.map +1 -1
- package/dist/typing/index.d.mts +11 -11
- package/dist/typing/index.d.ts +11 -11
- package/dist/utils/index.d.mts +4 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +4 -0
- package/dist/utils/index.mjs.map +1 -1
- package/dist/utils/iterators.d.mts +1 -1
- package/dist/utils/iterators.d.ts +1 -1
- package/dist/utils/iterators.js.map +1 -1
- package/dist/utils/iterators.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
+
export { CommandHandler } from './commandHandling/handleCommand.mjs';
|
|
2
|
+
export { DeciderCommandHandler } from './commandHandling/handleCommandWithDecider.mjs';
|
|
3
|
+
export { EventStore } from './eventStore/eventStore.mjs';
|
|
4
|
+
export { JSONParser, Mapper, MapperArgs, ParseError, ParseOptions, StringifyOptions } from './serialization/json/JSONParser.mjs';
|
|
5
|
+
export { DeciderSpecfication, DeciderSpecification } from './testing/deciderSpecification.mjs';
|
|
1
6
|
export { Brand, Command, Decider, DefaultCommandMetadata, Event, Flavour, Workflow, WorkflowCommand, WorkflowEvent, WorkflowOutput, accept, complete, error, ignore, publish, reply, schedule, send } from './typing/index.mjs';
|
|
7
|
+
export { sum } from './utils/iterators.mjs';
|
|
8
|
+
export { merge } from './utils/merge.mjs';
|
|
9
|
+
export { ValidationErrors, assertNotEmptyString, assertPositiveNumber, assertUnsignedBigInt } from './validation/index.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
+
export { CommandHandler } from './commandHandling/handleCommand.js';
|
|
2
|
+
export { DeciderCommandHandler } from './commandHandling/handleCommandWithDecider.js';
|
|
3
|
+
export { EventStore } from './eventStore/eventStore.js';
|
|
4
|
+
export { JSONParser, Mapper, MapperArgs, ParseError, ParseOptions, StringifyOptions } from './serialization/json/JSONParser.js';
|
|
5
|
+
export { DeciderSpecfication, DeciderSpecification } from './testing/deciderSpecification.js';
|
|
1
6
|
export { Brand, Command, Decider, DefaultCommandMetadata, Event, Flavour, Workflow, WorkflowCommand, WorkflowEvent, WorkflowOutput, accept, complete, error, ignore, publish, reply, schedule, send } from './typing/index.js';
|
|
7
|
+
export { sum } from './utils/iterators.js';
|
|
8
|
+
export { merge } from './utils/merge.js';
|
|
9
|
+
export { ValidationErrors, assertNotEmptyString, assertPositiveNumber, assertUnsignedBigInt } from './validation/index.js';
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); }var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); }var _commandHandling = require('./commandHandling'); _createStarExport(_commandHandling);
|
|
2
|
+
var _eventStore = require('./eventStore'); _createStarExport(_eventStore);
|
|
3
|
+
var _serialization = require('./serialization'); _createStarExport(_serialization);
|
|
4
|
+
var _testing = require('./testing'); _createStarExport(_testing);
|
|
5
|
+
var _typing = require('./typing'); _createStarExport(_typing);
|
|
6
|
+
var _utils = require('./utils'); _createStarExport(_utils);
|
|
7
|
+
var _validation = require('./validation'); _createStarExport(_validation);
|
|
2
8
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc","sourcesContent":["export * from './typing';\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc","sourcesContent":["export * from './commandHandling';\nexport * from './eventStore';\nexport * from './serialization';\nexport * from './testing';\nexport * from './typing';\nexport * from './utils';\nexport * from './validation';\n"]}
|
package/dist/index.mjs
CHANGED
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './typing';\n"],"mappings":"AAAA,cAAc;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './commandHandling';\nexport * from './eventStore';\nexport * from './serialization';\nexport * from './testing';\nexport * from './typing';\nexport * from './utils';\nexport * from './validation';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { JSONParser, Mapper, MapperArgs, ParseError, ParseOptions, StringifyOptions } from './json/JSONParser.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { JSONParser, Mapper, MapperArgs, ParseError, ParseOptions, StringifyOptions } from './json/JSONParser.js';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); }var _json = require('./json'); _createStarExport(_json);
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/serialization/index.ts"],"names":[],"mappings":"AAAA,cAAc","sourcesContent":["export * from './json';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/serialization/index.ts"],"sourcesContent":["export * from './json';\n"],"mappings":"AAAA,cAAc;","names":[]}
|
package/dist/testing/index.d.mts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { }
|
|
1
|
+
export { DeciderSpecfication, DeciderSpecification } from './deciderSpecification.mjs';
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { }
|
|
1
|
+
export { DeciderSpecfication, DeciderSpecification } from './deciderSpecification.js';
|
package/dist/testing/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
"use strict"
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); }var _deciderSpecification = require('./deciderSpecification'); _createStarExport(_deciderSpecification);
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA,cAAc","sourcesContent":["export * from './deciderSpecification';\n"]}
|
package/dist/testing/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/testing/index.ts"],"sourcesContent":["export * from './deciderSpecification';\n"],"mappings":"AAAA,cAAc;","names":[]}
|
package/dist/typing/index.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
type DefaultCommandMetadata = {
|
|
2
|
-
now: Date;
|
|
3
|
-
};
|
|
4
1
|
type Command<CommandType extends string = string, CommandData extends Record<string, unknown> = Record<string, unknown>, CommandMetaData extends Record<string, unknown> = DefaultCommandMetadata> = Flavour<Readonly<{
|
|
5
2
|
type: CommandType;
|
|
6
3
|
data: Readonly<CommandData>;
|
|
7
4
|
metadata?: CommandMetaData | undefined;
|
|
8
5
|
}>, 'Command'>;
|
|
6
|
+
type DefaultCommandMetadata = {
|
|
7
|
+
now: Date;
|
|
8
|
+
};
|
|
9
9
|
|
|
10
10
|
type Event<EventType extends string = string, EventData extends Record<string, unknown> = Record<string, unknown>, EventMetaData extends Record<string, unknown> = Record<string, unknown>> = Flavour<Readonly<{
|
|
11
11
|
type: EventType;
|
|
@@ -58,22 +58,22 @@ type WorkflowOutput<TOutput extends Command | Event> = {
|
|
|
58
58
|
kind: 'Error';
|
|
59
59
|
reason: string;
|
|
60
60
|
};
|
|
61
|
-
declare const reply: <TOutput extends
|
|
62
|
-
declare const send: <TOutput extends
|
|
61
|
+
declare const reply: <TOutput extends Event | Command>(message: TOutput) => WorkflowOutput<TOutput>;
|
|
62
|
+
declare const send: <TOutput extends Event | Command>(message: Extract<TOutput, {
|
|
63
63
|
__brand?: "Command" | undefined;
|
|
64
64
|
}>) => WorkflowOutput<TOutput>;
|
|
65
|
-
declare const publish: <TOutput extends
|
|
65
|
+
declare const publish: <TOutput extends Event | Command>(message: Extract<TOutput, {
|
|
66
66
|
__brand?: "Event" | undefined;
|
|
67
67
|
}>) => WorkflowOutput<TOutput>;
|
|
68
|
-
declare const schedule: <TOutput extends
|
|
68
|
+
declare const schedule: <TOutput extends Event | Command>(message: TOutput, when: {
|
|
69
69
|
afterInMs: number;
|
|
70
70
|
} | {
|
|
71
71
|
at: Date;
|
|
72
72
|
}) => WorkflowOutput<TOutput>;
|
|
73
|
-
declare const complete: <TOutput extends
|
|
74
|
-
declare const ignore: <TOutput extends
|
|
75
|
-
declare const error: <TOutput extends
|
|
76
|
-
declare const accept: <TOutput extends
|
|
73
|
+
declare const complete: <TOutput extends Event | Command>() => WorkflowOutput<TOutput>;
|
|
74
|
+
declare const ignore: <TOutput extends Event | Command>(reason: string) => WorkflowOutput<TOutput>;
|
|
75
|
+
declare const error: <TOutput extends Event | Command>(reason: string) => WorkflowOutput<TOutput>;
|
|
76
|
+
declare const accept: <TOutput extends Event | Command>() => WorkflowOutput<TOutput>;
|
|
77
77
|
|
|
78
78
|
type Brand<K, T> = K & {
|
|
79
79
|
readonly __brand: T;
|
package/dist/typing/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
type DefaultCommandMetadata = {
|
|
2
|
-
now: Date;
|
|
3
|
-
};
|
|
4
1
|
type Command<CommandType extends string = string, CommandData extends Record<string, unknown> = Record<string, unknown>, CommandMetaData extends Record<string, unknown> = DefaultCommandMetadata> = Flavour<Readonly<{
|
|
5
2
|
type: CommandType;
|
|
6
3
|
data: Readonly<CommandData>;
|
|
7
4
|
metadata?: CommandMetaData | undefined;
|
|
8
5
|
}>, 'Command'>;
|
|
6
|
+
type DefaultCommandMetadata = {
|
|
7
|
+
now: Date;
|
|
8
|
+
};
|
|
9
9
|
|
|
10
10
|
type Event<EventType extends string = string, EventData extends Record<string, unknown> = Record<string, unknown>, EventMetaData extends Record<string, unknown> = Record<string, unknown>> = Flavour<Readonly<{
|
|
11
11
|
type: EventType;
|
|
@@ -58,22 +58,22 @@ type WorkflowOutput<TOutput extends Command | Event> = {
|
|
|
58
58
|
kind: 'Error';
|
|
59
59
|
reason: string;
|
|
60
60
|
};
|
|
61
|
-
declare const reply: <TOutput extends
|
|
62
|
-
declare const send: <TOutput extends
|
|
61
|
+
declare const reply: <TOutput extends Event | Command>(message: TOutput) => WorkflowOutput<TOutput>;
|
|
62
|
+
declare const send: <TOutput extends Event | Command>(message: Extract<TOutput, {
|
|
63
63
|
__brand?: "Command" | undefined;
|
|
64
64
|
}>) => WorkflowOutput<TOutput>;
|
|
65
|
-
declare const publish: <TOutput extends
|
|
65
|
+
declare const publish: <TOutput extends Event | Command>(message: Extract<TOutput, {
|
|
66
66
|
__brand?: "Event" | undefined;
|
|
67
67
|
}>) => WorkflowOutput<TOutput>;
|
|
68
|
-
declare const schedule: <TOutput extends
|
|
68
|
+
declare const schedule: <TOutput extends Event | Command>(message: TOutput, when: {
|
|
69
69
|
afterInMs: number;
|
|
70
70
|
} | {
|
|
71
71
|
at: Date;
|
|
72
72
|
}) => WorkflowOutput<TOutput>;
|
|
73
|
-
declare const complete: <TOutput extends
|
|
74
|
-
declare const ignore: <TOutput extends
|
|
75
|
-
declare const error: <TOutput extends
|
|
76
|
-
declare const accept: <TOutput extends
|
|
73
|
+
declare const complete: <TOutput extends Event | Command>() => WorkflowOutput<TOutput>;
|
|
74
|
+
declare const ignore: <TOutput extends Event | Command>(reason: string) => WorkflowOutput<TOutput>;
|
|
75
|
+
declare const error: <TOutput extends Event | Command>(reason: string) => WorkflowOutput<TOutput>;
|
|
76
|
+
declare const accept: <TOutput extends Event | Command>() => WorkflowOutput<TOutput>;
|
|
77
77
|
|
|
78
78
|
type Brand<K, T> = K & {
|
|
79
79
|
readonly __brand: T;
|
package/dist/utils/index.d.mts
CHANGED
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); }var _iterators = require('./iterators'); _createStarExport(_iterators);
|
|
2
2
|
var _merge = require('./merge'); _createStarExport(_merge);
|
|
3
|
+
var utils_default = {};
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
exports.default = utils_default;
|
|
3
7
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,cAAc","sourcesContent":["export * from './iterators';\nexport * from './merge';\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,cAAc;AAEd,IAAO,gBAAQ,CAAC","sourcesContent":["export * from './iterators';\nexport * from './merge';\n\nexport default {};\n"]}
|
package/dist/utils/index.mjs
CHANGED
package/dist/utils/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["export * from './iterators';\nexport * from './merge';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["export * from './iterators';\nexport * from './merge';\n\nexport default {};\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AAEd,IAAO,gBAAQ,CAAC;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/iterators.ts"],"names":["sum"],"mappings":"AAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"sources":["../../src/utils/iterators.ts"],"names":["sum"],"mappings":"AAAO,MAAM,MAAM,CACjB,aACG;AACH,MAAI,OACF,MACAA,OAAM;AACR,KAAG;AACD,KAAC,EAAE,OAAO,KAAK,IAAI,SAAS,KAAK;AACjC,IAAAA,QAAO,SAAS;AAAA,EAClB,SAAS,CAAC;AACV,SAAOA;AACT","sourcesContent":["export const sum = (\n iterator: Iterator<number, number, number> | Iterator<number>,\n) => {\n let value,\n done,\n sum = 0;\n do {\n ({ value, done } = iterator.next());\n sum += value || 0;\n } while (!done);\n return sum;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/iterators.ts"],"sourcesContent":["export const sum = (iterator: Iterator<number, number, number>) => {\n let value,\n done,\n sum = 0;\n do {\n ({ value, done } = iterator.next());\n sum += value || 0;\n } while (!done);\n return sum;\n};\n"],"mappings":"AAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"sources":["../../src/utils/iterators.ts"],"sourcesContent":["export const sum = (\n iterator: Iterator<number, number, number> | Iterator<number>,\n) => {\n let value,\n done,\n sum = 0;\n do {\n ({ value, done } = iterator.next());\n sum += value || 0;\n } while (!done);\n return sum;\n};\n"],"mappings":"AAAO,MAAM,MAAM,CACjB,aACG;AACH,MAAI,OACF,MACAA,OAAM;AACR,KAAG;AACD,KAAC,EAAE,OAAO,KAAK,IAAI,SAAS,KAAK;AACjC,IAAAA,QAAO,SAAS;AAAA,EAClB,SAAS,CAAC;AACV,SAAOA;AACT;","names":["sum"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@event-driven-io/emmett",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Emmett - Event Sourcing development made simple",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"setup": "cat .nvmrc | nvm install; nvm use",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"express-async-errors": "3.1.1"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@event-driven-io/emmett": "0.1.
|
|
52
|
+
"@event-driven-io/emmett": "0.1.5",
|
|
53
53
|
"@faker-js/faker": "8.4.1",
|
|
54
54
|
"@types/jest": "29.5.0",
|
|
55
55
|
"@types/node": "20.11.17",
|