quidproquo-dev-server 0.0.255 → 0.0.256
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/lib/commonjs/actionProcessor/core/event/queue/getEventGetStorySessionActionProcessor.js +3 -2
- package/lib/commonjs/implementations/queueImplementation.js +22 -1
- package/lib/esm/actionProcessor/core/event/queue/getEventGetStorySessionActionProcessor.js +6 -2
- package/lib/esm/implementations/queueImplementation.js +22 -1
- package/package.json +6 -6
package/lib/commonjs/actionProcessor/core/event/queue/getEventGetStorySessionActionProcessor.js
CHANGED
|
@@ -12,8 +12,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.getEventGetStorySessionActionProcessor = void 0;
|
|
13
13
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
14
|
const getProcessGetStorySession = (qpqConfig) => {
|
|
15
|
-
return (_a) => __awaiter(void 0, [_a], void 0, function* ({ eventParams: [event] }) {
|
|
16
|
-
|
|
15
|
+
return (_a, session_1) => __awaiter(void 0, [_a, session_1], void 0, function* ({ eventParams: [event] }, session) {
|
|
16
|
+
const res = Object.assign(Object.assign({}, event.storySession), { correlation: session.correlation || event.storySession.correlation });
|
|
17
|
+
return (0, quidproquo_core_1.actionResult)(res);
|
|
17
18
|
});
|
|
18
19
|
};
|
|
19
20
|
const getEventGetStorySessionActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -37,6 +37,9 @@ const processQueueMessages = (qpqConfig, payload, devServerConfig) => __awaiter(
|
|
|
37
37
|
const processQueueEventBusSubscriptions = (qpqConfig, ebMessage) => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
38
|
var _a, _b, _c, _d;
|
|
39
39
|
const thisServiceName = quidproquo_core_1.qpqCoreUtils.getApplicationModuleName(qpqConfig);
|
|
40
|
+
// console.log('------------------------');
|
|
41
|
+
// console.log(`Service trying to process message [${thisServiceName}]`);
|
|
42
|
+
// console.log('Processing event bus message', ebMessage.type);
|
|
40
43
|
const allEventBuses = quidproquo_core_1.qpqCoreUtils.getAllEventBusConfigs(qpqConfig).filter((ebc) => {
|
|
41
44
|
var _a, _b, _c, _d;
|
|
42
45
|
const srcApplication = ((_a = ebc.owner) === null || _a === void 0 ? void 0 : _a.application) || quidproquo_core_1.qpqCoreUtils.getApplicationName(qpqConfig);
|
|
@@ -48,9 +51,17 @@ const processQueueEventBusSubscriptions = (qpqConfig, ebMessage) => __awaiter(vo
|
|
|
48
51
|
srcModule === ebMessage.targetModule &&
|
|
49
52
|
((!srcFeature && !ebMessage.targetFeature) || srcFeature === ebMessage.targetFeature));
|
|
50
53
|
});
|
|
54
|
+
// console.log(
|
|
55
|
+
// 'All event buses',
|
|
56
|
+
// JSON.stringify(
|
|
57
|
+
// allEventBuses.map((eb) => eb.name),
|
|
58
|
+
// null,
|
|
59
|
+
// 2,
|
|
60
|
+
// ),
|
|
61
|
+
// );
|
|
51
62
|
// All the queues that we should publish to
|
|
52
63
|
const queues = quidproquo_core_1.qpqCoreUtils
|
|
53
|
-
.
|
|
64
|
+
.getOwnedQueues(qpqConfig)
|
|
54
65
|
.filter((q) => {
|
|
55
66
|
return !!q.eventBusSubscriptions.find((ebsub) => {
|
|
56
67
|
return allEventBuses.some((eb) => ebsub === eb.name);
|
|
@@ -63,6 +74,14 @@ const processQueueEventBusSubscriptions = (qpqConfig, ebMessage) => __awaiter(vo
|
|
|
63
74
|
// And we are subed to the message that its trying to get to
|
|
64
75
|
q.eventBusSubscriptions.includes(ebMessage.eventBusName);
|
|
65
76
|
});
|
|
77
|
+
// console.log(
|
|
78
|
+
// 'All queues',
|
|
79
|
+
// JSON.stringify(
|
|
80
|
+
// queues.map((eb) => eb.name),
|
|
81
|
+
// null,
|
|
82
|
+
// 2,
|
|
83
|
+
// ),
|
|
84
|
+
// );
|
|
66
85
|
for (const queue of queues) {
|
|
67
86
|
const queueMessage = {
|
|
68
87
|
payload: ebMessage.payload,
|
|
@@ -75,8 +94,10 @@ const processQueueEventBusSubscriptions = (qpqConfig, ebMessage) => __awaiter(vo
|
|
|
75
94
|
targetModule: ((_d = queue.owner) === null || _d === void 0 ? void 0 : _d.module) || quidproquo_core_1.qpqCoreUtils.getApplicationModuleName(qpqConfig),
|
|
76
95
|
messageId: (0, uuid_1.v4)(),
|
|
77
96
|
};
|
|
97
|
+
// console.log(JSON.stringify(queueMessage, null, 2));
|
|
78
98
|
logic_1.eventBus.publish(quidproquo_core_1.QueueActionType.SendMessages, queueMessage);
|
|
79
99
|
}
|
|
100
|
+
// console.log('------------------------');
|
|
80
101
|
});
|
|
81
102
|
const queueImplementation = (devServerConfig) => __awaiter(void 0, void 0, void 0, function* () {
|
|
82
103
|
logic_1.eventBus.on(quidproquo_core_1.QueueActionType.SendMessages, (payload, correlation) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { actionResult, EventActionType, } from 'quidproquo-core';
|
|
2
2
|
const getProcessGetStorySession = (qpqConfig) => {
|
|
3
|
-
return async ({ eventParams: [event] }) => {
|
|
4
|
-
|
|
3
|
+
return async ({ eventParams: [event] }, session) => {
|
|
4
|
+
const res = {
|
|
5
|
+
...event.storySession,
|
|
6
|
+
correlation: session.correlation || event.storySession.correlation,
|
|
7
|
+
};
|
|
8
|
+
return actionResult(res);
|
|
5
9
|
};
|
|
6
10
|
};
|
|
7
11
|
export const getEventGetStorySessionActionProcessor = async (qpqConfig) => ({
|
|
@@ -24,6 +24,9 @@ const processQueueMessages = async (qpqConfig, payload, devServerConfig) => {
|
|
|
24
24
|
};
|
|
25
25
|
const processQueueEventBusSubscriptions = async (qpqConfig, ebMessage) => {
|
|
26
26
|
const thisServiceName = qpqCoreUtils.getApplicationModuleName(qpqConfig);
|
|
27
|
+
// console.log('------------------------');
|
|
28
|
+
// console.log(`Service trying to process message [${thisServiceName}]`);
|
|
29
|
+
// console.log('Processing event bus message', ebMessage.type);
|
|
27
30
|
const allEventBuses = qpqCoreUtils.getAllEventBusConfigs(qpqConfig).filter((ebc) => {
|
|
28
31
|
const srcApplication = ebc.owner?.application || qpqCoreUtils.getApplicationName(qpqConfig);
|
|
29
32
|
const srcEnvironment = ebc.owner?.environment || qpqCoreUtils.getApplicationModuleEnvironment(qpqConfig);
|
|
@@ -34,9 +37,17 @@ const processQueueEventBusSubscriptions = async (qpqConfig, ebMessage) => {
|
|
|
34
37
|
srcModule === ebMessage.targetModule &&
|
|
35
38
|
((!srcFeature && !ebMessage.targetFeature) || srcFeature === ebMessage.targetFeature));
|
|
36
39
|
});
|
|
40
|
+
// console.log(
|
|
41
|
+
// 'All event buses',
|
|
42
|
+
// JSON.stringify(
|
|
43
|
+
// allEventBuses.map((eb) => eb.name),
|
|
44
|
+
// null,
|
|
45
|
+
// 2,
|
|
46
|
+
// ),
|
|
47
|
+
// );
|
|
37
48
|
// All the queues that we should publish to
|
|
38
49
|
const queues = qpqCoreUtils
|
|
39
|
-
.
|
|
50
|
+
.getOwnedQueues(qpqConfig)
|
|
40
51
|
.filter((q) => {
|
|
41
52
|
return !!q.eventBusSubscriptions.find((ebsub) => {
|
|
42
53
|
return allEventBuses.some((eb) => ebsub === eb.name);
|
|
@@ -47,6 +58,14 @@ const processQueueEventBusSubscriptions = async (qpqConfig, ebMessage) => {
|
|
|
47
58
|
(!q.owner?.module || q.owner?.module === thisServiceName) &&
|
|
48
59
|
// And we are subed to the message that its trying to get to
|
|
49
60
|
q.eventBusSubscriptions.includes(ebMessage.eventBusName));
|
|
61
|
+
// console.log(
|
|
62
|
+
// 'All queues',
|
|
63
|
+
// JSON.stringify(
|
|
64
|
+
// queues.map((eb) => eb.name),
|
|
65
|
+
// null,
|
|
66
|
+
// 2,
|
|
67
|
+
// ),
|
|
68
|
+
// );
|
|
50
69
|
for (const queue of queues) {
|
|
51
70
|
const queueMessage = {
|
|
52
71
|
payload: ebMessage.payload,
|
|
@@ -59,8 +78,10 @@ const processQueueEventBusSubscriptions = async (qpqConfig, ebMessage) => {
|
|
|
59
78
|
targetModule: queue.owner?.module || qpqCoreUtils.getApplicationModuleName(qpqConfig),
|
|
60
79
|
messageId: uuidV4(),
|
|
61
80
|
};
|
|
81
|
+
// console.log(JSON.stringify(queueMessage, null, 2));
|
|
62
82
|
eventBus.publish(QueueActionType.SendMessages, queueMessage);
|
|
63
83
|
}
|
|
84
|
+
// console.log('------------------------');
|
|
64
85
|
};
|
|
65
86
|
export const queueImplementation = async (devServerConfig) => {
|
|
66
87
|
eventBus.on(QueueActionType.SendMessages, async (payload, correlation) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quidproquo-dev-server",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.256",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"chalk": "^4.1.2",
|
|
36
36
|
"multer": "^1.4.5-lts.1",
|
|
37
|
-
"quidproquo-actionprocessor-awslambda": "0.0.
|
|
38
|
-
"quidproquo-actionprocessor-node": "0.0.
|
|
39
|
-
"quidproquo-core": "0.0.
|
|
40
|
-
"quidproquo-webserver": "0.0.
|
|
37
|
+
"quidproquo-actionprocessor-awslambda": "0.0.256",
|
|
38
|
+
"quidproquo-actionprocessor-node": "0.0.256",
|
|
39
|
+
"quidproquo-core": "0.0.256",
|
|
40
|
+
"quidproquo-webserver": "0.0.256",
|
|
41
41
|
"ws": "^8.18.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/multer": "^1.4.12",
|
|
45
|
-
"quidproquo-tsconfig": "0.0.
|
|
45
|
+
"quidproquo-tsconfig": "0.0.256",
|
|
46
46
|
"typescript": "^5.8.2"
|
|
47
47
|
}
|
|
48
48
|
}
|