atomservices 0.10.0-alpha.6 → 1.0.0-alpha.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/.eslintignore +0 -0
- package/.eslintrc.json +17 -0
- package/lib/Commands/combineCommandDispatchers.js +5 -4
- package/lib/Commands/combineCommandDispatchers.js.map +1 -1
- package/lib/Commands/composeCommandHandlers.js +3 -2
- package/lib/Commands/composeCommandHandlers.js.map +1 -1
- package/lib/Commands/index.js +1 -0
- package/lib/Commands/index.js.map +1 -1
- package/lib/Containers/composeContainerInitializer.js +34 -0
- package/lib/Containers/composeContainerInitializer.js.map +1 -0
- package/lib/Containers/createContainer.js +19 -20
- package/lib/Containers/createContainer.js.map +1 -1
- package/lib/Containers/index.js +3 -2
- package/lib/Containers/index.js.map +1 -1
- package/lib/Context/Factories/ServiceConfigurateFactory.js +3 -3
- package/lib/Context/Factories/ServiceConfigurateFactory.js.map +1 -1
- package/lib/Context/index.js +1 -0
- package/lib/Context/index.js.map +1 -1
- package/lib/Events/composeEventHandlers.js +3 -2
- package/lib/Events/composeEventHandlers.js.map +1 -1
- package/lib/Events/index.js +1 -0
- package/lib/Events/index.js.map +1 -1
- package/lib/Exceptions/Constants.js +7 -3
- package/lib/Exceptions/Constants.js.map +1 -1
- package/lib/Exceptions/Core.js +31 -12
- package/lib/Exceptions/Core.js.map +1 -1
- package/lib/Exceptions/ExtendException.js +2 -0
- package/lib/Exceptions/ExtendException.js.map +1 -1
- package/lib/Exceptions/createException.js +2 -1
- package/lib/Exceptions/createException.js.map +1 -1
- package/lib/Identifiers/UUIDIdentifier.js +3 -4
- package/lib/Identifiers/UUIDIdentifier.js.map +1 -1
- package/lib/Identifiers/index.js +1 -0
- package/lib/Identifiers/index.js.map +1 -1
- package/lib/Notifiers/NotifyLog.js +13 -0
- package/lib/Notifiers/NotifyLog.js.map +1 -1
- package/lib/Notifiers/NotifyObject.js +14 -0
- package/lib/Notifiers/NotifyObject.js.map +1 -1
- package/lib/Notifiers/composeNotifiers.js +2 -1
- package/lib/Notifiers/composeNotifiers.js.map +1 -1
- package/lib/Notifiers/data/ContainersNotifyData.js +2 -2
- package/lib/Notifiers/data/ContainersNotifyData.js.map +1 -1
- package/lib/Notifiers/data/ServicesNotifyData.js +12 -10
- package/lib/Notifiers/data/ServicesNotifyData.js.map +1 -1
- package/lib/Notifiers/data/common/ServicesData.js +10 -8
- package/lib/Notifiers/data/common/ServicesData.js.map +1 -1
- package/lib/Notifiers/data/common/composeNotifyData.js +3 -1
- package/lib/Notifiers/data/common/composeNotifyData.js.map +1 -1
- package/lib/Notifiers/data/common/index.js +1 -0
- package/lib/Notifiers/data/common/index.js.map +1 -1
- package/lib/Notifiers/data/index.js +1 -0
- package/lib/Notifiers/data/index.js.map +1 -1
- package/lib/Notifiers/index.js +1 -0
- package/lib/Notifiers/index.js.map +1 -1
- package/lib/Reactions/composeReactions.js +2 -1
- package/lib/Reactions/composeReactions.js.map +1 -1
- package/lib/Reactions/index.js +1 -0
- package/lib/Reactions/index.js.map +1 -1
- package/lib/SFComponents/common/ObjectRefiner.js +24 -0
- package/lib/SFComponents/common/ObjectRefiner.js.map +1 -0
- package/lib/SFComponents/common/typeOfValue.js +23 -0
- package/lib/SFComponents/common/typeOfValue.js.map +1 -0
- package/lib/SFComponents/createSFComponents.js +30 -11
- package/lib/SFComponents/createSFComponents.js.map +1 -1
- package/lib/SFComponents/index.js +1 -0
- package/lib/SFComponents/index.js.map +1 -1
- package/lib/Services/core/MetadataRefiner.js +13 -19
- package/lib/Services/core/MetadataRefiner.js.map +1 -1
- package/lib/Services/core/composeEventProcess.js +8 -7
- package/lib/Services/core/composeEventProcess.js.map +1 -1
- package/lib/Services/core/composeEventReactions.js +9 -10
- package/lib/Services/core/composeEventReactions.js.map +1 -1
- package/lib/Services/core/composeEventResulting.js +2 -1
- package/lib/Services/core/composeEventResulting.js.map +1 -1
- package/lib/Services/core/composeServiceContext.js +43 -35
- package/lib/Services/core/composeServiceContext.js.map +1 -1
- package/lib/Services/core/connectStream/connectStream.js +6 -5
- package/lib/Services/core/connectStream/connectStream.js.map +1 -1
- package/lib/Services/core/connectStream/index.js +1 -0
- package/lib/Services/core/connectStream/index.js.map +1 -1
- package/lib/Services/core/connectStream/mapHandlersEvents.js +2 -1
- package/lib/Services/core/connectStream/mapHandlersEvents.js.map +1 -1
- package/lib/Services/core/connectStream/mapReactionsEvents.js +2 -1
- package/lib/Services/core/connectStream/mapReactionsEvents.js.map +1 -1
- package/lib/Services/core/createCommandDispatcher.js +9 -5
- package/lib/Services/core/createCommandDispatcher.js.map +1 -1
- package/lib/Services/core/index.js +1 -0
- package/lib/Services/core/index.js.map +1 -1
- package/lib/Services/core/operateEventProcess.js +52 -20
- package/lib/Services/core/operateEventProcess.js.map +1 -1
- package/lib/Services/createService.js +12 -11
- package/lib/Services/createService.js.map +1 -1
- package/lib/Services/index.js +1 -0
- package/lib/Services/index.js.map +1 -1
- package/lib/States/composeStateApplier.js +3 -2
- package/lib/States/composeStateApplier.js.map +1 -1
- package/lib/States/composeStateHandlers.js +4 -3
- package/lib/States/composeStateHandlers.js.map +1 -1
- package/lib/States/index.js +1 -0
- package/lib/States/index.js.map +1 -1
- package/lib/Streams/LocalEventStream.js +9 -9
- package/lib/Streams/LocalEventStream.js.map +1 -1
- package/lib/Streams/index.js +1 -0
- package/lib/Streams/index.js.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/package.json +12 -11
- package/typings/Commands/ICommandDispatcher.d.ts +2 -2
- package/typings/Commands/ICommandDispatchers.d.ts +2 -2
- package/typings/Containers/composeContainerInitializer.d.ts +4 -0
- package/typings/Containers/createContainer.d.ts +2 -4
- package/typings/Containers/index.d.ts +1 -2
- package/typings/Exceptions/Constants.d.ts +12 -2
- package/typings/Exceptions/Core.d.ts +3 -1
- package/typings/Notifiers/NotifyLog.d.ts +4 -1
- package/typings/Notifiers/NotifyObject.d.ts +4 -1
- package/typings/Notifiers/data/ContainersNotifyData.d.ts +4 -0
- package/typings/Notifiers/data/ServicesNotifyData.d.ts +34 -0
- package/typings/Notifiers/data/common/ServicesData.d.ts +2 -0
- package/typings/Notifiers/data/common/composeNotifyData.d.ts +2 -0
- package/typings/SFComponents/common/ObjectRefiner.d.ts +7 -0
- package/typings/SFComponents/common/typeOfValue.d.ts +1 -0
- package/typings/SFComponents/createSFComponents.d.ts +5 -5
- package/typings/Services/core/MetadataRefiner.d.ts +2 -10
- package/typings/Services/core/composeServiceContext.d.ts +3 -2
- package/typings/States/IStateHandlers.d.ts +1 -1
- package/typings/index.d.ts +1 -1
- package/RELEASES.md +0 -1
- package/lib/Containers/Enhancement.js +0 -3
- package/lib/Containers/Enhancement.js.map +0 -1
- package/lib/Containers/IManagedServiceContainerResult.js +0 -4
- package/lib/Containers/IManagedServiceContainerResult.js.map +0 -1
- package/lib/Containers/createContainerCompose.js +0 -11
- package/lib/Containers/createContainerCompose.js.map +0 -1
- package/typings/Containers/Enhancement.d.ts +0 -3
- package/typings/Containers/IManagedServiceContainerResult.d.ts +0 -5
- package/typings/Containers/createContainerCompose.d.ts +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composeEventReactions.js","sourceRoot":"","sources":["../../../src/Services/core/composeEventReactions.ts"],"names":[],"mappings":";;;AACA,+CAAqD;AACrD,uEAAoE;AACpE,mEAAgE;AAChE,uDAAoD;
|
|
1
|
+
{"version":3,"file":"composeEventReactions.js","sourceRoot":"","sources":["../../../src/Services/core/composeEventReactions.ts"],"names":[],"mappings":";;;AACA,+CAAqD;AACrD,uEAAoE;AACpE,mEAAgE;AAChE,uDAAoD;AAE7C,MAAM,qBAAqB,GAAG,CAAC,UAA8B,EAAqC,EAAE,CAAC,CAAC,CAAC,UAAU,EAAqC,EAAE;IAC7J,MAAM,SAAS,GAAG,IAAA,mCAAgB,EAAC,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC7E,MAA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ED,KAAK,EAAE;wBACL,OAAO,EAAE,KAAK,CAAC,GAAG;wBAClB,KAAK;wBACL,IAAI,EAAE,KAAK,CAAC,IAAI;wBAEhB,IAAI,EAAE,KAAK,CAAC,IAAI;wBAChB,WAAW,EAAE,KAAK,CAAC,WAAW;wBAC9B,UAAU,EAAE,KAAK,CAAC,UAAU;wBAC5B,UAAU,EAAE,KAAK,CAAC,UAAU;wBAC5B,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;qBACxD;iBACF,EAAE;oBACD,KAAK;iBACN,EACC,IAAI,CAAC,CAAC,CAAC;aACV;YACD,MAAM,UAAU,EAAE,CAAC;QACrB,CAAC,CAAC;QAEF,MAAM,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC;QAE3B,OAAO,MAAM,CAAC;IAChB,CAAC,EAAE,EAAuC,CAAC,CAAC;AAC9C,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;AAvDF,QAAA,qBAAqB,yBAuDnB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.composeEventResulting = void 0;
|
|
4
|
-
|
|
4
|
+
const composeEventResulting = (ServiceContext, event) => (result) => ServiceContext.directTo(event._id, result);
|
|
5
|
+
exports.composeEventResulting = composeEventResulting;
|
|
5
6
|
//# sourceMappingURL=composeEventResulting.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composeEventResulting.js","sourceRoot":"","sources":["../../../src/Services/core/composeEventResulting.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"composeEventResulting.js","sourceRoot":"","sources":["../../../src/Services/core/composeEventResulting.ts"],"names":[],"mappings":";;;AAEO,MAAM,qBAAqB,GAAG,CAAC,cAA+B,EAAE,KAAa,EAAE,EAAE,CACtF,CAAC,MAAW,EAAE,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AADjD,QAAA,qBAAqB,yBAC4B"}
|
|
@@ -9,42 +9,46 @@ const LocalDirectStream_1 = require("../../Streams/LocalDirectStream");
|
|
|
9
9
|
const MetadataRefiner_1 = require("./MetadataRefiner");
|
|
10
10
|
const Core_1 = require("../../Exceptions/Core");
|
|
11
11
|
const operateEventProcess_1 = require("./operateEventProcess");
|
|
12
|
-
|
|
13
|
-
exports.
|
|
12
|
+
const isEventVersionDefined = (event) => (event._version && event._version > 0);
|
|
13
|
+
exports.isEventVersionDefined = isEventVersionDefined;
|
|
14
|
+
const composeServiceContext = (definition) => ((Definition) => {
|
|
14
15
|
const { EventStores, EventStream, Notifiers, ServiceConfigurate, ServiceIdentifier, scope, type, } = Definition;
|
|
15
|
-
const EventHandlers = composeEventHandlers_1.composeEventHandlers(...definition.EventHandlers)(type);
|
|
16
|
-
const StateHandlers = composeStateHandlers_1.composeStateHandlers(...definition.StateHandlers)(type);
|
|
17
|
-
const StateApplier = composeStateApplier_1.composeStateApplier({ StateHandlers });
|
|
18
|
-
return (
|
|
19
|
-
const isReplay = options.isReplay || false;
|
|
16
|
+
const EventHandlers = (0, composeEventHandlers_1.composeEventHandlers)(...definition.EventHandlers)(type);
|
|
17
|
+
const StateHandlers = (0, composeStateHandlers_1.composeStateHandlers)(...definition.StateHandlers)(type);
|
|
18
|
+
const StateApplier = (0, composeStateApplier_1.composeStateApplier)({ StateHandlers });
|
|
19
|
+
return (metadata) => {
|
|
20
20
|
const ServiceContext = {
|
|
21
21
|
AggregateID: () => ServiceIdentifier.AggregateID(),
|
|
22
22
|
EventID: () => ServiceIdentifier.EventID(),
|
|
23
23
|
directTo: (ref, data) => EventStream.directTo(ref, data),
|
|
24
24
|
dispatch: async (event) => {
|
|
25
25
|
const versioning = ServiceConfigurate.versioning(event.name);
|
|
26
|
-
let eventVersion;
|
|
27
|
-
if (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
let eventVersion = event._version;
|
|
27
|
+
if (EventStores && !metadata.isReplay) {
|
|
28
|
+
if (versioning === "none") {
|
|
29
|
+
if (event._version === undefined || event._version === null) {
|
|
30
|
+
await EventStores.storeEvent(scope, event);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
throw (0, Core_1.NotAllowedVersioningEventErrorException)(event, scope);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
33
37
|
let version;
|
|
34
38
|
try {
|
|
35
39
|
version = (await EventStores.queryCurrentVersion(scope, type, event.aggregateID)).version;
|
|
36
40
|
}
|
|
37
41
|
catch (error) {
|
|
38
|
-
throw Core_1.CurrentVersionQueryingErrorException(error, event.aggregateID, type, scope);
|
|
42
|
+
throw (0, Core_1.CurrentVersionQueryingErrorException)(error, event.aggregateID, type, scope);
|
|
39
43
|
}
|
|
40
44
|
const currentVersion = version;
|
|
41
|
-
if (!exports.isEventVersionDefined(event)) {
|
|
45
|
+
if (!(0, exports.isEventVersionDefined)(event)) {
|
|
42
46
|
if (versioning === "dynamic") {
|
|
43
47
|
eventVersion = currentVersion + 1;
|
|
44
48
|
event._version = eventVersion;
|
|
45
49
|
}
|
|
46
50
|
else {
|
|
47
|
-
throw Core_1.
|
|
51
|
+
throw (0, Core_1.NotAllowedDynamicVersionEventErrorException)(event, scope);
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
if (currentVersion + 1 === eventVersion) {
|
|
@@ -52,37 +56,37 @@ exports.composeServiceContext = (definition) => ((Definition) => {
|
|
|
52
56
|
await EventStores.storeEvent(scope, event);
|
|
53
57
|
}
|
|
54
58
|
catch (error) {
|
|
55
|
-
throw Core_1.EventStoringErrorException(error, event, scope);
|
|
59
|
+
throw (0, Core_1.EventStoringErrorException)(error, event, scope);
|
|
56
60
|
}
|
|
57
61
|
}
|
|
58
62
|
else {
|
|
59
|
-
throw Core_1.EventVersionConflictedConcurrentException(event, currentVersion, scope);
|
|
63
|
+
throw (0, Core_1.EventVersionConflictedConcurrentException)(event, currentVersion, scope);
|
|
60
64
|
}
|
|
61
65
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
if (!(0, exports.isEventVersionDefined)(event)) {
|
|
69
|
+
if (versioning === "static") {
|
|
70
|
+
throw (0, Core_1.NotAllowedDynamicVersionEventErrorException)(event, scope);
|
|
71
|
+
}
|
|
72
|
+
else if (versioning === "dynamic") {
|
|
73
|
+
eventVersion = -1;
|
|
74
|
+
event._version = eventVersion;
|
|
71
75
|
}
|
|
72
76
|
}
|
|
73
77
|
}
|
|
74
|
-
const
|
|
78
|
+
const meta = MetadataRefiner_1.MetadataRefiner.dispatch(metadata);
|
|
75
79
|
const processType = ServiceConfigurate.processType(event.name);
|
|
76
80
|
if (processType === "synchronous") {
|
|
77
81
|
const EventHandler = EventHandlers.resolve(event);
|
|
78
82
|
if (EventHandler) {
|
|
79
83
|
const resulting = (data) => LocalDirectStream_1.LocalDirectStream.directTo(event._id, data);
|
|
80
|
-
await operateEventProcess_1.operateEventProcess(EventHandler, StateApplier, ServiceContext, resulting, Notifiers)(Definition, event,
|
|
84
|
+
await (0, operateEventProcess_1.operateEventProcess)(EventHandler, StateApplier, ServiceContext, resulting, Notifiers)(Definition, event, meta);
|
|
81
85
|
}
|
|
82
86
|
}
|
|
83
87
|
try {
|
|
84
88
|
const on = { level: ServiceConfigurate.level(event.name), scope };
|
|
85
|
-
await EventStream.publish({ event, metadata, on });
|
|
89
|
+
await EventStream.publish({ event, metadata: meta, on });
|
|
86
90
|
Notifiers.emit(Notifiers_1.ServicesNotifyData.SERVICE_EVENT_DISPATCHED(type, {
|
|
87
91
|
eventID: event._id,
|
|
88
92
|
scope,
|
|
@@ -91,11 +95,13 @@ exports.composeServiceContext = (definition) => ((Definition) => {
|
|
|
91
95
|
aggregateID: event.aggregateID,
|
|
92
96
|
_createdAt: event._createdAt,
|
|
93
97
|
_createdBy: event._createdBy,
|
|
94
|
-
_version:
|
|
95
|
-
}, {
|
|
98
|
+
...((0, exports.isEventVersionDefined)(event) ? { _version: event._version } : {}),
|
|
99
|
+
}, {
|
|
100
|
+
event,
|
|
101
|
+
}, meta));
|
|
96
102
|
}
|
|
97
103
|
catch (error) {
|
|
98
|
-
throw Core_1.EventPublishingErrorException(error, event, scope);
|
|
104
|
+
throw (0, Core_1.EventPublishingErrorException)(error, event, scope);
|
|
99
105
|
}
|
|
100
106
|
},
|
|
101
107
|
listenTo: async (ref, listener) => EventStream.listenTo(ref, listener),
|
|
@@ -109,13 +115,14 @@ exports.composeServiceContext = (definition) => ((Definition) => {
|
|
|
109
115
|
level: data.level,
|
|
110
116
|
message: data.message,
|
|
111
117
|
obj: data.obj,
|
|
118
|
+
meta: data.meta,
|
|
112
119
|
}),
|
|
113
120
|
queryCurrentVersion: (aggregateID) => {
|
|
114
121
|
if (EventStores) {
|
|
115
122
|
return EventStores.queryCurrentVersion(scope, type, aggregateID);
|
|
116
123
|
}
|
|
117
124
|
else {
|
|
118
|
-
throw Core_1.NoEventStoresProvidedException();
|
|
125
|
+
throw (0, Core_1.NoEventStoresProvidedException)();
|
|
119
126
|
}
|
|
120
127
|
},
|
|
121
128
|
scope: () => scope,
|
|
@@ -124,4 +131,5 @@ exports.composeServiceContext = (definition) => ((Definition) => {
|
|
|
124
131
|
return ServiceContext;
|
|
125
132
|
};
|
|
126
133
|
})(definition);
|
|
134
|
+
exports.composeServiceContext = composeServiceContext;
|
|
127
135
|
//# sourceMappingURL=composeServiceContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composeServiceContext.js","sourceRoot":"","sources":["../../../src/Services/core/composeServiceContext.ts"],"names":[],"mappings":";;;AACA,4EAAyE;AACzE,0EAAuE;AACvE,4EAAyE;AAEzE,+CAAqD;AACrD,uEAAoE;AACpE,uDAAoD;AAEpD,
|
|
1
|
+
{"version":3,"file":"composeServiceContext.js","sourceRoot":"","sources":["../../../src/Services/core/composeServiceContext.ts"],"names":[],"mappings":";;;AACA,4EAAyE;AACzE,0EAAuE;AACvE,4EAAyE;AAEzE,+CAAqD;AACrD,uEAAoE;AACpE,uDAAoD;AAEpD,gDAQ+B;AAE/B,+DAA4D;AAErD,MAAM,qBAAqB,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;AAAlF,QAAA,qBAAqB,yBAA6D;AAExF,MAAM,qBAAqB,GAAG,CAAC,UAA8B,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,EAAE;IACvF,MAAM,EACJ,WAAW,EACX,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,iBAAiB,EACjB,KAAK,EACL,IAAI,GACL,GAAG,UAAU,CAAC;IAEf,MAAM,aAAa,GAAG,IAAA,2CAAoB,EAAC,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC;IAC9E,MAAM,aAAa,GAAG,IAAA,2CAAoB,EAAC,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC;IAC9E,MAAM,YAAY,GAAG,IAAA,yCAAmB,EAAC,EAAE,aAAa,EAAE,CAAC,CAAC;IAE5D,OAAO,CAAC,QAGP,EAAmB,EAAE;QACpB,MAAM,cAAc,GAAoB;YACtC,WAAW,EAAE,GAAG,EAAE,CAChB,iBAAiB,CAAC,WAAW,EAAE;YACjC,OAAO,EAAE,GAAG,EAAE,CACZ,iBAAiB,CAAC,OAAO,EAAE;YAC7B,QAAQ,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CACtB,WAAW,CAAC,QAAQ,CAAC,GAAG,EA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,EAAE,IAAI,CAAC,GAAG;gBACb,IAAI,EAAE,IAAI,CAAC,IAAI;aAChB,CAAC;YACJ,mBAAmB,EAAE,CAAC,WAAW,EAAE,EAAE;gBACnC,IAAI,WAAW,EAAE;oBACf,OAAO,WAAW,CAAC,mBAAmB,CAAC,KAAK,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;iBAClE;qBAAM;oBACL,MAAM,IAAA,qCAA8B,GAAE,CAAC;iBACxC;YACH,CAAC;YACD,KAAK,EAAE,GAAG,EAAE,CACV,KAAK;YACP,IAAI,EAAE,GAAG,EAAE,CACT,IAAI;SACP,CAAC;QAEF,OAAO,cAAc,CAAC;IACxB,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;AArJF,QAAA,qBAAqB,yBAqJnB"}
|
|
@@ -5,16 +5,16 @@ const composeEventProcess_1 = require("../composeEventProcess");
|
|
|
5
5
|
const composeEventReactions_1 = require("../composeEventReactions");
|
|
6
6
|
const mapHandlersEvents_1 = require("./mapHandlersEvents");
|
|
7
7
|
const mapReactionsEvents_1 = require("./mapReactionsEvents");
|
|
8
|
-
|
|
9
|
-
const EventProcess = composeEventProcess_1.composeEventProcess(Definition);
|
|
10
|
-
const EventReactions = composeEventReactions_1.composeEventReactions(Definition);
|
|
8
|
+
const connectStream = async (definition) => (async (Definition) => {
|
|
9
|
+
const EventProcess = (0, composeEventProcess_1.composeEventProcess)(Definition);
|
|
10
|
+
const EventReactions = (0, composeEventReactions_1.composeEventReactions)(Definition);
|
|
11
11
|
const StreamDefinition = Object.freeze({
|
|
12
12
|
handlers: {
|
|
13
|
-
events: mapHandlersEvents_1.mapHandlersEvents(Definition),
|
|
13
|
+
events: (0, mapHandlersEvents_1.mapHandlersEvents)(Definition),
|
|
14
14
|
processing: EventProcess,
|
|
15
15
|
},
|
|
16
16
|
reactions: {
|
|
17
|
-
events: mapReactionsEvents_1.mapReactionsEvents(Definition),
|
|
17
|
+
events: (0, mapReactionsEvents_1.mapReactionsEvents)(Definition),
|
|
18
18
|
processes: EventReactions,
|
|
19
19
|
},
|
|
20
20
|
scope: Definition.scope,
|
|
@@ -23,4 +23,5 @@ exports.connectStream = async (definition) => (async (Definition) => {
|
|
|
23
23
|
Definition.EventStream.subscribe(StreamDefinition);
|
|
24
24
|
await Definition.EventStream.connect();
|
|
25
25
|
})(definition);
|
|
26
|
+
exports.connectStream = connectStream;
|
|
26
27
|
//# sourceMappingURL=connectStream.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectStream.js","sourceRoot":"","sources":["../../../../src/Services/core/connectStream/connectStream.ts"],"names":[],"mappings":";;;AACA,gEAA6D;AAC7D,oEAAiE;AACjE,2DAAwD;AACxD,6DAA0D;
|
|
1
|
+
{"version":3,"file":"connectStream.js","sourceRoot":"","sources":["../../../../src/Services/core/connectStream/connectStream.ts"],"names":[],"mappings":";;;AACA,gEAA6D;AAC7D,oEAAiE;AACjE,2DAAwD;AACxD,6DAA0D;AAEnD,MAAM,aAAa,GAAG,KAAK,EAAE,UAA8B,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE;IAC3F,MAAM,YAAY,GAAG,IAAA,yCAAmB,EAAC,UAAU,CAAC,CAAC;IACrD,MAAM,cAAc,GAAG,IAAA,6CAAqB,EAAC,UAAU,CAAC,CAAC;IAEzD,MAAM,gBAAgB,GAA6B,MAAM,CAAC,MAAM,CAAC;QAC/D,QAAQ,EAAE;YACR,MAAM,EAAE,IAAA,qCAAiB,EAAC,UAAU,CAAC;YACrC,UAAU,EAAE,YAAY;SACzB;QACD,SAAS,EAAE;YACT,MAAM,EAAE,IAAA,uCAAkB,EAAC,UAAU,CAAC;YACtC,SAAS,EAAE,cAAc;SAC1B;QACD,KAAK,EAAE,UAAU,CAAC,KAAK;QACvB,IAAI,EAAE,UAAU,CAAC,IAAI;KACtB,CAAC,CAAC;IAEH,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAEnD,MAAM,UAAU,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;AACzC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;AApBF,QAAA,aAAa,iBAoBX"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.connectStream = void 0;
|
|
3
4
|
var connectStream_1 = require("./connectStream");
|
|
4
5
|
Object.defineProperty(exports, "connectStream", { enumerable: true, get: function () { return connectStream_1.connectStream; } });
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Services/core/connectStream/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Services/core/connectStream/index.ts"],"names":[],"mappings":";;;AAAA,iDAAgD;AAAvC,8GAAA,aAAa,OAAA"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mapHandlersEvents = void 0;
|
|
4
|
-
|
|
4
|
+
const mapHandlersEvents = (definition) => definition.EventHandlers.reduce((result, { name }) => {
|
|
5
5
|
const level = definition.ServiceConfigurate.level(name);
|
|
6
6
|
result.push({ name, level });
|
|
7
7
|
return result;
|
|
8
8
|
}, []);
|
|
9
|
+
exports.mapHandlersEvents = mapHandlersEvents;
|
|
9
10
|
//# sourceMappingURL=mapHandlersEvents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapHandlersEvents.js","sourceRoot":"","sources":["../../../../src/Services/core/connectStream/mapHandlersEvents.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"mapHandlersEvents.js","sourceRoot":"","sources":["../../../../src/Services/core/connectStream/mapHandlersEvents.ts"],"names":[],"mappings":";;;AAEO,MAAM,iBAAiB,GAAG,CAAC,UAA8B,EAAuD,EAAE,CACvH,UAAU,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;IACnD,MAAM,KAAK,GAAG,UAAU,CAAC,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAE7B,OAAO,MAAM,CAAC;AAChB,CAAC,EAAE,EAAyD,CAAC,CAAC;AANnD,QAAA,iBAAiB,qBAMkC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mapReactionsEvents = void 0;
|
|
4
|
-
|
|
4
|
+
const mapReactionsEvents = (definition) => definition.Reactions.map(({ scope, type, name }) => ({ scope, type, name }));
|
|
5
|
+
exports.mapReactionsEvents = mapReactionsEvents;
|
|
5
6
|
//# sourceMappingURL=mapReactionsEvents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapReactionsEvents.js","sourceRoot":"","sources":["../../../../src/Services/core/connectStream/mapReactionsEvents.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"mapReactionsEvents.js","sourceRoot":"","sources":["../../../../src/Services/core/connectStream/mapReactionsEvents.ts"],"names":[],"mappings":";;;AAEO,MAAM,kBAAkB,GAAG,CAAC,UAA8B,EAAoD,EAAE,CACrH,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AADlE,QAAA,kBAAkB,sBACgD"}
|
|
@@ -5,12 +5,12 @@ const composeCommandHandlers_1 = require("../../Commands/composeCommandHandlers"
|
|
|
5
5
|
const DispatchResult_1 = require("../../Commands/DispatchResult");
|
|
6
6
|
const Streams_1 = require("../../Streams");
|
|
7
7
|
const composeServiceContext_1 = require("./composeServiceContext");
|
|
8
|
-
|
|
8
|
+
const createCommandDispatcher = (definition) => ((Definition) => {
|
|
9
9
|
const { ServiceConfigurate, type } = Definition;
|
|
10
|
-
const CommandHandlers = composeCommandHandlers_1.composeCommandHandlers(...Definition.CommandHandlers)(type);
|
|
11
|
-
const ServiceContextComposing = composeServiceContext_1.composeServiceContext(Definition);
|
|
10
|
+
const CommandHandlers = (0, composeCommandHandlers_1.composeCommandHandlers)(...Definition.CommandHandlers)(type);
|
|
11
|
+
const ServiceContextComposing = (0, composeServiceContext_1.composeServiceContext)(Definition);
|
|
12
12
|
const CommandDispatcher = {
|
|
13
|
-
dispatch: async (command, listening) => {
|
|
13
|
+
dispatch: async (command, meta = {}, listening) => {
|
|
14
14
|
const { name } = command;
|
|
15
15
|
try {
|
|
16
16
|
const CommandHandler = CommandHandlers.resolve(command);
|
|
@@ -22,7 +22,10 @@ exports.createCommandDispatcher = (definition) => ((Definition) => {
|
|
|
22
22
|
if (!isValid) {
|
|
23
23
|
return DispatchResult_1.DispatchResult.invalid(invalidAttributes);
|
|
24
24
|
}
|
|
25
|
-
const ServiceContext = ServiceContextComposing({
|
|
25
|
+
const ServiceContext = ServiceContextComposing({
|
|
26
|
+
isReplay: false,
|
|
27
|
+
...meta,
|
|
28
|
+
});
|
|
26
29
|
const event = CommandHandler.transform(command, ServiceContext);
|
|
27
30
|
if (listening) {
|
|
28
31
|
const processType = ServiceConfigurate.processType(event.name);
|
|
@@ -53,4 +56,5 @@ exports.createCommandDispatcher = (definition) => ((Definition) => {
|
|
|
53
56
|
};
|
|
54
57
|
return CommandDispatcher;
|
|
55
58
|
})(definition);
|
|
59
|
+
exports.createCommandDispatcher = createCommandDispatcher;
|
|
56
60
|
//# sourceMappingURL=createCommandDispatcher.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCommandDispatcher.js","sourceRoot":"","sources":["../../../src/Services/core/createCommandDispatcher.ts"],"names":[],"mappings":";;;AACA,kFAA+E;AAC/E,kEAA+D;AAE/D,2CAAkD;AAClD,mEAAgE;
|
|
1
|
+
{"version":3,"file":"createCommandDispatcher.js","sourceRoot":"","sources":["../../../src/Services/core/createCommandDispatcher.ts"],"names":[],"mappings":";;;AACA,kFAA+E;AAC/E,kEAA+D;AAE/D,2CAAkD;AAClD,mEAAgE;AAEzD,MAAM,uBAAuB,GAAG,CAAC,UAA8B,EAAsB,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,EAAE;IAC7G,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC;IAChD,MAAM,eAAe,GAAG,IAAA,+CAAsB,EAAC,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,CAAC;IACpF,MAAM,uBAAuB,GAAG,IAAA,6CAAqB,EAAC,UAAU,CAAC,CAAC;IAElE,MAAM,iBAAiB,GAAuB;QAC5C,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE,SAAS,EAAE,EAAE;YAChD,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;YAEzB,IAAI;gBACF,MAAM,cAAc,GAAG,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBAExD,IAAI,cAAc,KAAK,SAAS,EAAE;oBAEhC,OAAO,+BAAc,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;iBAC7C;qBAAM;oBAEL,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,GAAG,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;oBAExE,IAAI,CAAC,OAAO,EAAE;wBACZ,OAAO,+BAAc,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;qBAClD;oBAED,MAAM,cAAc,GAAG,uBAAuB,CAAC;wBAC7C,QAAQ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{ value: true });
|
|
3
|
+
exports.composeServiceContext = exports.composeEventResulting = exports.composeEventReactions = exports.composeEventProcess = exports.connectStream = void 0;
|
|
3
4
|
var connectStream_1 = require("./connectStream");
|
|
4
5
|
Object.defineProperty(exports, "connectStream", { enumerable: true, get: function () { return connectStream_1.connectStream; } });
|
|
5
6
|
var composeEventProcess_1 = require("./composeEventProcess");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Services/core/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Services/core/index.ts"],"names":[],"mappings":";;;AAAA,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA;AAC9B,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA;AAC9B,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA"}
|
|
@@ -3,37 +3,69 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.operateEventProcess = void 0;
|
|
4
4
|
const Notifiers_1 = require("../../Notifiers");
|
|
5
5
|
const MetadataRefiner_1 = require("./MetadataRefiner");
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const operateEventProcess = (EventHandler, StateApplier, ServiceContext, resulting, Notifiers) => async (service, event, metadata) => {
|
|
7
|
+
const meta = MetadataRefiner_1.MetadataRefiner.consume(metadata);
|
|
8
|
+
let hasError = false;
|
|
9
|
+
let result;
|
|
8
10
|
try {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
Notifiers.emit(Notifiers_1.ServicesNotifyData.SERVICE_EVENT_HANDLED(event.type, {
|
|
11
|
+
result = await EventHandler.process(event, meta, StateApplier);
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
Notifiers.error(Notifiers_1.ServicesNotifyData.SERVICE_EVENT_PROCESS_ERROR(event.name, {
|
|
14
15
|
eventID: event._id,
|
|
15
|
-
metadata,
|
|
16
16
|
scope: service.scope,
|
|
17
17
|
type: service.type,
|
|
18
18
|
name: event.name,
|
|
19
19
|
aggregateID: event.aggregateID,
|
|
20
20
|
_createdAt: event._createdAt,
|
|
21
21
|
_createdBy: event._createdBy,
|
|
22
|
-
_version: event._version,
|
|
22
|
+
...(event._version ? { _version: event._version } : {}),
|
|
23
23
|
}, {
|
|
24
24
|
event,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
}, meta), error);
|
|
26
|
+
result = error;
|
|
27
|
+
hasError = true;
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
if (!hasError && EventHandler.processEffect) {
|
|
30
|
+
try {
|
|
31
|
+
await EventHandler.processEffect({ event, metadata: meta, result }, resulting, ServiceContext);
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
Notifiers.error(Notifiers_1.ServicesNotifyData.SERVICE_EVENT_PROCESS_EFFECT_ERROR(event.name, {
|
|
35
|
+
eventID: event._id,
|
|
36
|
+
scope: service.scope,
|
|
37
|
+
type: service.type,
|
|
38
|
+
name: event.name,
|
|
39
|
+
aggregateID: event.aggregateID,
|
|
40
|
+
_createdAt: event._createdAt,
|
|
41
|
+
_createdBy: event._createdBy,
|
|
42
|
+
...(event._version ? { _version: event._version } : {}),
|
|
43
|
+
}, {
|
|
44
|
+
event,
|
|
45
|
+
}, meta), error);
|
|
46
|
+
hasError = true;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
if (result) {
|
|
51
|
+
await resulting(result);
|
|
52
|
+
}
|
|
53
|
+
if (!hasError) {
|
|
54
|
+
Notifiers.emit(Notifiers_1.ServicesNotifyData.SERVICE_EVENT_HANDLED(event.type, {
|
|
55
|
+
eventID: event._id,
|
|
56
|
+
scope: service.scope,
|
|
57
|
+
type: service.type,
|
|
58
|
+
name: event.name,
|
|
59
|
+
aggregateID: event.aggregateID,
|
|
60
|
+
_createdAt: event._createdAt,
|
|
61
|
+
_createdBy: event._createdBy,
|
|
62
|
+
...(event._version ? { _version: event._version } : {}),
|
|
63
|
+
}, {
|
|
64
|
+
event,
|
|
65
|
+
result,
|
|
66
|
+
}, meta));
|
|
67
|
+
}
|
|
37
68
|
}
|
|
38
69
|
};
|
|
70
|
+
exports.operateEventProcess = operateEventProcess;
|
|
39
71
|
//# sourceMappingURL=operateEventProcess.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operateEventProcess.js","sourceRoot":"","sources":["../../../src/Services/core/operateEventProcess.ts"],"names":[],"mappings":";;;AACA,+CAAqD;AACrD,uDAAoD;
|
|
1
|
+
{"version":3,"file":"operateEventProcess.js","sourceRoot":"","sources":["../../../src/Services/core/operateEventProcess.ts"],"names":[],"mappings":";;;AACA,+CAAqD;AACrD,uDAAoD;AAE7C,MAAM,mBAAmB,GAAG,CACjC,YAA2B,EAC3B,YAA2B,EAC3B,cAA+B,EAC/B,SAAyC,EACzC,SAAqB,EACrB,EAAE,CACF,KAAK,EAAE,OAAyC,EAAE,KAAa,EAAE,QAAqC,EAAE,EAAE;IACxG,MAAM,IAAI,GAAG,iCAAe,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC/C,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,IAAI,MAAM,CAAC;IAEX,IAAI;QACF,MAAM,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;KAChE;IAAC,OAAO,KAAK,EAAE;QACd,SAAS,CAAC,KAAK,CAAC,8BAAkB,CAAC,2BAA2B,CAAC,KAAK,CAAC,IAAI,EAAE;YACzE,OAAO,EAAE,KAAK,CAAC,GAAG;YAClB,KAAK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K,CAAC,CAAC;YAChB,QAAQ,GAAG,IAAI,CAAC;SACjB;KACF;SAAM;QACL,IAAI,MAAM,EAAE;YACV,MAAM,SAAS,CAAC,MAAM,CAAC,CAAC;SACzB;QAED,IAAI,CAAC,QAAQ,EAAE;YACb,SAAS,CAAC,IAAI,CAAC,8BAAkB,CAAC,qBAAqB,CAAC,KAAK,CAAC,IAAI,EAAE;gBAClE,OAAO,EAAE,KAAK,CAAC,GAAG;gBAClB,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,IAAI,EAAE,OAAO,CAAC,IAAI;gBAElB,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,WAAW,EAAE,KAAK,CAAC,WAAW;gBAC9B,UAAU,EAAE,KAAK,CAAC,UAAU;gBAC5B,UAAU,EAAE,KAAK,CAAC,UAAU;gBAC5B,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACxD,EAAE;gBACD,KAAK;gBACL,MAAM;aACP,EACC,IAAI,CAAC,CAAC,CAAC;SACV;KACF;AACH,CAAC,CAAC;AA7ES,QAAA,mBAAmB,uBA6E5B"}
|
|
@@ -10,11 +10,11 @@ const Streams_1 = require("../Streams");
|
|
|
10
10
|
const composeServiceContext_1 = require("./core/composeServiceContext");
|
|
11
11
|
const connectStream_1 = require("./core/connectStream");
|
|
12
12
|
const createCommandDispatcher_1 = require("./core/createCommandDispatcher");
|
|
13
|
-
|
|
13
|
+
const createService = (service, container) => ((SERVICE, CONTAINER) => {
|
|
14
14
|
const { CommandHandlers = [], EventHandlers = [], SFC = {}, StateHandlers = [], Reactions = [], EventStores = (CONTAINER && CONTAINER.EventStores), EventStream = (CONTAINER && CONTAINER.EventStream) || Streams_1.LocalInMemoryEventStream, Identifier = (CONTAINER && CONTAINER.Identifier) || UUIDIdentifier_1.UUIDIdentifier, configs = {}, scope = (CONTAINER && CONTAINER.scope) || GlobalScope_1.GlobalScope, type, } = SERVICE;
|
|
15
15
|
const ContainerNotifiers = (CONTAINER && CONTAINER.Notifiers) || [];
|
|
16
16
|
const ServiceNotifiers = SERVICE.Notifiers || [];
|
|
17
|
-
const NOTIFIERS = Notifiers_1.composeNotifiers(...ServiceNotifiers, ...ContainerNotifiers);
|
|
17
|
+
const NOTIFIERS = (0, Notifiers_1.composeNotifiers)(...ServiceNotifiers, ...ContainerNotifiers);
|
|
18
18
|
let definition = {
|
|
19
19
|
CommandHandlers,
|
|
20
20
|
EventHandlers,
|
|
@@ -44,22 +44,22 @@ exports.createService = (service, container) => ((SERVICE, CONTAINER) => {
|
|
|
44
44
|
definition.StateHandlers.push(StateHandler);
|
|
45
45
|
return result;
|
|
46
46
|
}, definition);
|
|
47
|
-
const CommandDispatcher = createCommandDispatcher_1.createCommandDispatcher(definition);
|
|
47
|
+
const CommandDispatcher = (0, createCommandDispatcher_1.createCommandDispatcher)(definition);
|
|
48
48
|
const Service = {
|
|
49
49
|
connect: async () => {
|
|
50
|
-
connectStream_1.connectStream(definition);
|
|
50
|
+
(0, connectStream_1.connectStream)(definition);
|
|
51
51
|
NOTIFIERS.emit(Notifiers_1.ServicesNotifyData.SERVICE_CONNECTED(SERVICE.type));
|
|
52
52
|
},
|
|
53
|
-
context: (options) => composeServiceContext_1.composeServiceContext(definition)(options),
|
|
54
|
-
dispatch: async (command, listening) => {
|
|
53
|
+
context: (options) => (0, composeServiceContext_1.composeServiceContext)(definition)(options),
|
|
54
|
+
dispatch: async (command, meta, listening) => {
|
|
55
55
|
NOTIFIERS.emit(Notifiers_1.ServicesNotifyData.SERVICE_COMMAND_DISPATCHING(SERVICE.type, {
|
|
56
56
|
scope: SERVICE.scope,
|
|
57
57
|
type: SERVICE.type,
|
|
58
58
|
name: command.name,
|
|
59
59
|
}, {
|
|
60
60
|
command,
|
|
61
|
-
}));
|
|
62
|
-
const result = await CommandDispatcher.dispatch(command, listening);
|
|
61
|
+
}, meta));
|
|
62
|
+
const result = await CommandDispatcher.dispatch(command, meta, listening);
|
|
63
63
|
if (!result.accept) {
|
|
64
64
|
if (result.status === "error") {
|
|
65
65
|
NOTIFIERS.error(Notifiers_1.ServicesNotifyData.SERVICE_COMMAND_ERROR(SERVICE.type, {
|
|
@@ -68,7 +68,7 @@ exports.createService = (service, container) => ((SERVICE, CONTAINER) => {
|
|
|
68
68
|
name: command.name,
|
|
69
69
|
}, {
|
|
70
70
|
command,
|
|
71
|
-
}), result.error);
|
|
71
|
+
}, meta), result.error);
|
|
72
72
|
}
|
|
73
73
|
if (result.status === "invalid") {
|
|
74
74
|
NOTIFIERS.emit(Notifiers_1.ServicesNotifyData.SERVICE_COMMAND_INVALID(SERVICE.type, {
|
|
@@ -78,7 +78,7 @@ exports.createService = (service, container) => ((SERVICE, CONTAINER) => {
|
|
|
78
78
|
invalidAttributes: result.invalidAttributes,
|
|
79
79
|
}, {
|
|
80
80
|
command,
|
|
81
|
-
}));
|
|
81
|
+
}, meta));
|
|
82
82
|
}
|
|
83
83
|
if (result.status === "unhandled") {
|
|
84
84
|
NOTIFIERS.emit(Notifiers_1.ServicesNotifyData.SERVICE_COMMAND_UNHANDLED(SERVICE.type, {
|
|
@@ -87,7 +87,7 @@ exports.createService = (service, container) => ((SERVICE, CONTAINER) => {
|
|
|
87
87
|
name: command.name,
|
|
88
88
|
}, {
|
|
89
89
|
command,
|
|
90
|
-
}));
|
|
90
|
+
}, meta));
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
return result;
|
|
@@ -108,4 +108,5 @@ exports.createService = (service, container) => ((SERVICE, CONTAINER) => {
|
|
|
108
108
|
}));
|
|
109
109
|
return Service;
|
|
110
110
|
})(service, container);
|
|
111
|
+
exports.createService = createService;
|
|
111
112
|
//# sourceMappingURL=createService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createService.js","sourceRoot":"","sources":["../../src/Services/createService.ts"],"names":[],"mappings":";;;AACA,8FAA2F;AAC3F,4FAAyF;AACzF,gDAA6C;AAC7C,kEAA+D;AAC/D,4CAAoE;AACpE,wCAAsD;AACtD,wEAAqE;AACrE,wDAAqD;AACrD,4EAAyE;
|
|
1
|
+
{"version":3,"file":"createService.js","sourceRoot":"","sources":["../../src/Services/createService.ts"],"names":[],"mappings":";;;AACA,8FAA2F;AAC3F,4FAAyF;AACzF,gDAA6C;AAC7C,kEAA+D;AAC/D,4CAAoE;AACpE,wCAAsD;AACtD,wEAAqE;AACrE,wDAAqD;AACrD,4EAAyE;AAElE,MAAM,aAAa,GAAG,CAAC,OAAiB,EAAE,SAA8B,EAAmB,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,SAAS,EAAmB,EAAE;IAC5I,MAAM,EACJ,eAAe,GAAG,EAAE,EACpB,aAAa,GAAG,EAAE,EAClB,GAAG,GAAG,EAAE,EACR,aAAa,GAAG,EAAE,EAClB,SAAS,GAAG,EAAE,EACd,WAAW,GAAG,CAAC,SAAS,IAAI,SAAS,CAAC,WAAW,CAAC,EAClD,WAAW,GAAG,CAAC,SAAS,IAAI,SAAS,CAAC,WAAW,CAAC,IAAI,kCAAwB,EAC9E,UAAU,GAAG,CAAC,SAAS,IAAI,SAAS,CAAC,UAAU,CAAC,IAAI,+BAAc,EAClE,OAAO,GAAG,EAAE,EACZ,KAAK,GAAG,CAAC,SAAS,IAAI,SAAS,CAAC,KAAK,CAAC,IAAI,yBAAW,EACrD,IAAI,GACL,GAAG,OAAO,CAAC;IACZ,MAAM,kBAAkB,GAAG,CAAC,SAAS,IAAI,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;IACpE,MAAM,gBAAgB,GAAG,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;IACjD,MAAM,SAAS,GAAG,IAAA,4BAAgB,EAAC,GAAG,gBAAgB,EAAE,GAAG,kBAAkB,CAAC,CAAC;IAE/E,IAAI,UAAU,GAAuB;QACnC,eAAe;QACf,aAAa;QACb,WAAW;QACX,WAAW;QAC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BACV;gBAED,IAAI,MAAM,CAAC,MAAM,KAAK,WAAW,EAAE;oBACjC,SAAS,CAAC,IAAI,CAAC,8BAAkB,CAAC,yBAAyB,CAAC,OAAO,CAAC,IAAI,EAAE;wBACxE,KAAK,EAAE,OAAO,CAAC,KAAK;wBACpB,IAAI,EAAE,OAAO,CAAC,IAAI;wBAElB,IAAI,EAAE,OAAO,CAAC,IAAI;qBACnB,EAAE;wBACD,OAAO;qBACR,EACC,IAAI,CAAC,CAAC,CAAC;iBACV;aACF;YAED,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,KAAK,EAAE,GAAG,EAAE,CACV,KAAK;QACP,IAAI,EAAE,GAAG,EAAE,CACT,IAAI;KACP,CAAC;IAEF,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAEvB,SAAS,CAAC,IAAI,CAAC,8BAAkB,CAAC,eAAe,CAAC,IAAI,EAAE;QACtD,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,IAAI,EAAE,OAAO,CAAC,IAAI;QAElB,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,OAAO,EAAE;YACP,WAAW,EAAE,CAAC,OAAO,CAAC,WAAW,IAAI,IAAI,CAAC,IAAI,KAAK;YACnD,WAAW,EAAE,CAAC,OAAO,CAAC,WAAW,IAAI,IAAI,CAAC,IAAI,KAAK;YACnD,UAAU,EAAE,CAAC,OAAO,CAAC,UAAU,IAAI,IAAI,CAAC,IAAI,KAAK;SAClD;KACF,CAAC,CAAC,CAAC;IAEJ,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AAxIV,QAAA,aAAa,iBAwIH"}
|
package/lib/Services/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createService = void 0;
|
|
3
4
|
var createService_1 = require("./createService");
|
|
4
5
|
Object.defineProperty(exports, "createService", { enumerable: true, get: function () { return createService_1.createService; } });
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Services/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Services/index.ts"],"names":[],"mappings":";;;AAAA,iDAAgD;AAAvC,8GAAA,aAAa,OAAA"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.composeStateApplier = void 0;
|
|
4
|
-
|
|
4
|
+
const composeStateApplier = (props) => (({ StateHandlers }) => {
|
|
5
5
|
const Applier = {
|
|
6
6
|
apply: async (event) => {
|
|
7
|
-
StateHandlers.apply(event);
|
|
7
|
+
return StateHandlers.apply(event);
|
|
8
8
|
},
|
|
9
9
|
};
|
|
10
10
|
Object.freeze(Applier);
|
|
11
11
|
return Applier;
|
|
12
12
|
})(props);
|
|
13
|
+
exports.composeStateApplier = composeStateApplier;
|
|
13
14
|
Object.freeze(exports.composeStateApplier);
|
|
14
15
|
//# sourceMappingURL=composeStateApplier.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composeStateApplier.js","sourceRoot":"","sources":["../../src/States/composeStateApplier.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"composeStateApplier.js","sourceRoot":"","sources":["../../src/States/composeStateApplier.ts"],"names":[],"mappings":";;;AAGO,MAAM,mBAAmB,GAAG,CAAC,KAAyC,EAAE,EAAE,CAC/E,CAAC,CAAC,EAAE,aAAa,EAAE,EAAiB,EAAE;IACpC,MAAM,OAAO,GAAkB;QAC7B,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YACrB,OAAO,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC;KACF,CAAC;IAEF,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAEvB,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAXC,QAAA,mBAAmB,uBAWpB;AAEZ,MAAM,CAAC,MAAM,CAAC,2BAAmB,CAAC,CAAC"}
|