quidproquo-dev-server 0.0.254 → 0.0.255
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/express/api/getEventAutoRespondActionProcessor.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/event/express/api/getEventAutoRespondActionProcessor.js +31 -31
- package/lib/commonjs/actionProcessor/core/event/express/api/getEventGetRecordsActionProcessor.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/event/express/api/getEventGetRecordsActionProcessor.js +34 -34
- package/lib/commonjs/actionProcessor/core/event/express/api/getEventGetStorySessionActionProcessor.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/event/express/api/getEventGetStorySessionActionProcessor.js +46 -46
- package/lib/commonjs/actionProcessor/core/event/express/api/getEventMatchStoryActionProcessor.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/event/express/api/getEventMatchStoryActionProcessor.js +53 -53
- package/lib/commonjs/actionProcessor/core/event/express/api/getEventTransformResponseResultActionProcessor.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/event/express/api/getEventTransformResponseResultActionProcessor.js +58 -58
- package/lib/commonjs/actionProcessor/core/event/express/api/index.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/event/express/api/index.js +21 -21
- package/lib/commonjs/actionProcessor/core/event/express/api/types.d.ts +8 -8
- package/lib/commonjs/actionProcessor/core/event/express/api/types.js +2 -2
- package/lib/commonjs/actionProcessor/core/event/express/index.d.ts +1 -1
- package/lib/commonjs/actionProcessor/core/event/express/index.js +17 -17
- package/lib/commonjs/actionProcessor/core/event/index.d.ts +4 -4
- package/lib/commonjs/actionProcessor/core/event/index.js +20 -20
- package/lib/commonjs/actionProcessor/core/event/node/index.d.ts +1 -1
- package/lib/commonjs/actionProcessor/core/event/node/index.js +17 -17
- package/lib/commonjs/actionProcessor/core/event/node/serviceFunction/getEventAutoRespondActionProcessor.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/event/node/serviceFunction/getEventAutoRespondActionProcessor.js +24 -24
- package/lib/commonjs/actionProcessor/core/event/node/serviceFunction/getEventGetRecordsActionProcessor.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/event/node/serviceFunction/getEventGetRecordsActionProcessor.js +28 -28
- package/lib/commonjs/actionProcessor/core/event/node/serviceFunction/getEventGetStorySessionActionProcessor.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/event/node/serviceFunction/getEventGetStorySessionActionProcessor.js +24 -24
- package/lib/commonjs/actionProcessor/core/event/node/serviceFunction/getEventMatchStoryActionProcessor.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/event/node/serviceFunction/getEventMatchStoryActionProcessor.js +33 -33
- package/lib/commonjs/actionProcessor/core/event/node/serviceFunction/getEventTransformResponseResultActionProcessor.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/event/node/serviceFunction/getEventTransformResponseResultActionProcessor.js +30 -30
- package/lib/commonjs/actionProcessor/core/event/node/serviceFunction/index.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/event/node/serviceFunction/index.js +21 -21
- package/lib/commonjs/actionProcessor/core/event/node/serviceFunction/types.d.ts +11 -11
- package/lib/commonjs/actionProcessor/core/event/node/serviceFunction/types.js +2 -2
- package/lib/commonjs/actionProcessor/core/event/queue/getEventAutoRespondActionProcessor.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/event/queue/getEventAutoRespondActionProcessor.js +29 -29
- package/lib/commonjs/actionProcessor/core/event/queue/getEventGetRecordsActionProcessor.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/event/queue/getEventGetRecordsActionProcessor.js +31 -31
- package/lib/commonjs/actionProcessor/core/event/queue/getEventGetStorySessionActionProcessor.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/event/queue/getEventGetStorySessionActionProcessor.js +24 -24
- package/lib/commonjs/actionProcessor/core/event/queue/getEventMatchStoryActionProcessor.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/event/queue/getEventMatchStoryActionProcessor.js +42 -42
- package/lib/commonjs/actionProcessor/core/event/queue/getEventTransformResponseResultActionProcessor.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/event/queue/getEventTransformResponseResultActionProcessor.js +26 -26
- package/lib/commonjs/actionProcessor/core/event/queue/index.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/event/queue/index.js +21 -21
- package/lib/commonjs/actionProcessor/core/event/queue/types.d.ts +15 -15
- package/lib/commonjs/actionProcessor/core/event/queue/types.js +2 -2
- package/lib/commonjs/actionProcessor/core/event/ws/index.d.ts +1 -1
- package/lib/commonjs/actionProcessor/core/event/ws/index.js +17 -17
- package/lib/commonjs/actionProcessor/core/event/ws/websocket/getEventAutoRespondActionProcessor.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/event/ws/websocket/getEventAutoRespondActionProcessor.js +24 -24
- package/lib/commonjs/actionProcessor/core/event/ws/websocket/getEventGetRecordsActionProcessor.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/event/ws/websocket/getEventGetRecordsActionProcessor.js +53 -53
- package/lib/commonjs/actionProcessor/core/event/ws/websocket/getEventGetStorySessionActionProcessor.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/event/ws/websocket/getEventGetStorySessionActionProcessor.js +24 -24
- package/lib/commonjs/actionProcessor/core/event/ws/websocket/getEventMatchStoryActionProcessor.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/event/ws/websocket/getEventMatchStoryActionProcessor.js +41 -41
- package/lib/commonjs/actionProcessor/core/event/ws/websocket/getEventTransformResponseResultActionProcessor.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/event/ws/websocket/getEventTransformResponseResultActionProcessor.js +29 -29
- package/lib/commonjs/actionProcessor/core/event/ws/websocket/index.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/event/ws/websocket/index.js +21 -21
- package/lib/commonjs/actionProcessor/core/event/ws/websocket/types.d.ts +8 -8
- package/lib/commonjs/actionProcessor/core/event/ws/websocket/types.js +2 -2
- package/lib/commonjs/actionProcessor/core/eventBus/getEventBusSendMessagesActionProcessor.d.ts +10 -10
- package/lib/commonjs/actionProcessor/core/eventBus/getEventBusSendMessagesActionProcessor.js +43 -43
- package/lib/commonjs/actionProcessor/core/eventBus/index.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/eventBus/index.js +17 -17
- package/lib/commonjs/actionProcessor/core/getCoreActionProcessor.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/getCoreActionProcessor.js +20 -20
- package/lib/commonjs/actionProcessor/core/graphDatabaseOverride/getGraphDatabaseExecuteOpenCypherQueryActionProcessor.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/graphDatabaseOverride/getGraphDatabaseExecuteOpenCypherQueryActionProcessor.js +38 -38
- package/lib/commonjs/actionProcessor/core/graphDatabaseOverride/index.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/graphDatabaseOverride/index.js +17 -17
- package/lib/commonjs/actionProcessor/core/index.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/index.js +18 -18
- package/lib/commonjs/actionProcessor/core/log/getLogCreateActionProcessor.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/log/getLogCreateActionProcessor.js +44 -44
- package/lib/commonjs/actionProcessor/core/log/getLogDisableEventHistoryActionProcessor.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/log/getLogDisableEventHistoryActionProcessor.js +25 -25
- package/lib/commonjs/actionProcessor/core/log/getLogTemplateLiteralActionProcessor.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/log/getLogTemplateLiteralActionProcessor.js +30 -30
- package/lib/commonjs/actionProcessor/core/log/index.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/log/index.js +19 -19
- package/lib/commonjs/actionProcessor/core/queue/getQueueSendMessageActionProcessor.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/queue/getQueueSendMessageActionProcessor.js +46 -46
- package/lib/commonjs/actionProcessor/core/queue/index.d.ts +2 -2
- package/lib/commonjs/actionProcessor/core/queue/index.js +17 -17
- package/lib/commonjs/actionProcessor/index.d.ts +4 -4
- package/lib/commonjs/actionProcessor/index.js +37 -37
- package/lib/commonjs/actionProcessor/webserver/index.d.ts +2 -2
- package/lib/commonjs/actionProcessor/webserver/index.js +18 -18
- package/lib/commonjs/actionProcessor/webserver/serviceFunctionOverride/getServiceFunctionExecuteActionProcessor.d.ts +2 -2
- package/lib/commonjs/actionProcessor/webserver/serviceFunctionOverride/getServiceFunctionExecuteActionProcessor.js +41 -41
- package/lib/commonjs/actionProcessor/webserver/serviceFunctionOverride/index.d.ts +2 -2
- package/lib/commonjs/actionProcessor/webserver/serviceFunctionOverride/index.js +17 -17
- package/lib/commonjs/actionProcessor/webserver/websocket/getWebsocketSendMessageActionProcessor.d.ts +2 -2
- package/lib/commonjs/actionProcessor/webserver/websocket/getWebsocketSendMessageActionProcessor.js +35 -35
- package/lib/commonjs/actionProcessor/webserver/websocket/index.d.ts +2 -2
- package/lib/commonjs/actionProcessor/webserver/websocket/index.js +17 -17
- package/lib/commonjs/allServiceConfig.d.ts +3 -3
- package/lib/commonjs/allServiceConfig.js +42 -43
- package/lib/commonjs/config/index.d.ts +1 -1
- package/lib/commonjs/config/index.js +17 -17
- package/lib/commonjs/config/settings/defineDevServerConfig.d.ts +6 -6
- package/lib/commonjs/config/settings/defineDevServerConfig.js +21 -21
- package/lib/commonjs/config/settings/index.d.ts +1 -1
- package/lib/commonjs/config/settings/index.js +17 -17
- package/lib/commonjs/entry/serviceFunction/runCypherQuery.d.ts +3 -3
- package/lib/commonjs/entry/serviceFunction/runCypherQuery.js +8 -9
- package/lib/commonjs/implementations/apiImplementation.d.ts +2 -2
- package/lib/commonjs/implementations/apiImplementation.js +145 -145
- package/lib/commonjs/implementations/eventBusImplementation.d.ts +2 -2
- package/lib/commonjs/implementations/eventBusImplementation.js +73 -73
- package/lib/commonjs/implementations/index.d.ts +5 -5
- package/lib/commonjs/implementations/index.js +21 -21
- package/lib/commonjs/implementations/queueImplementation.d.ts +2 -2
- package/lib/commonjs/implementations/queueImplementation.js +95 -95
- package/lib/commonjs/implementations/serviceFunctionImplementation.d.ts +2 -2
- package/lib/commonjs/implementations/serviceFunctionImplementation.js +34 -34
- package/lib/commonjs/implementations/webSocket/index.d.ts +2 -2
- package/lib/commonjs/implementations/webSocket/index.js +18 -18
- package/lib/commonjs/implementations/webSocket/types/WsEvent.d.ts +12 -13
- package/lib/commonjs/implementations/webSocket/types/WsEvent.js +2 -2
- package/lib/commonjs/implementations/webSocket/types/index.d.ts +1 -1
- package/lib/commonjs/implementations/webSocket/types/index.js +17 -17
- package/lib/commonjs/implementations/webSocket/webSocketImplementation.d.ts +3 -3
- package/lib/commonjs/implementations/webSocket/webSocketImplementation.js +136 -136
- package/lib/commonjs/index.d.ts +3 -3
- package/lib/commonjs/index.js +19 -19
- package/lib/commonjs/logic/eventBus.d.ts +10 -11
- package/lib/commonjs/logic/eventBus.js +49 -49
- package/lib/commonjs/logic/index.d.ts +2 -2
- package/lib/commonjs/logic/index.js +18 -18
- package/lib/commonjs/logic/processEvent.d.ts +2 -2
- package/lib/commonjs/logic/processEvent.js +30 -30
- package/lib/commonjs/main.d.ts +5 -5
- package/lib/commonjs/main.js +55 -55
- package/lib/commonjs/types/DevServerConfig.d.ts +14 -14
- package/lib/commonjs/types/DevServerConfig.js +2 -2
- package/lib/commonjs/types/ExpressEvent.d.ts +26 -26
- package/lib/commonjs/types/ExpressEvent.js +2 -2
- package/lib/commonjs/types/index.d.ts +2 -2
- package/lib/commonjs/types/index.js +18 -18
- package/lib/esm/actionProcessor/core/event/express/api/getEventAutoRespondActionProcessor.d.ts +2 -2
- package/lib/esm/actionProcessor/core/event/express/api/getEventAutoRespondActionProcessor.js +16 -16
- package/lib/esm/actionProcessor/core/event/express/api/getEventGetRecordsActionProcessor.d.ts +2 -2
- package/lib/esm/actionProcessor/core/event/express/api/getEventGetRecordsActionProcessor.js +19 -19
- package/lib/esm/actionProcessor/core/event/express/api/getEventGetStorySessionActionProcessor.d.ts +2 -2
- package/lib/esm/actionProcessor/core/event/express/api/getEventGetStorySessionActionProcessor.js +36 -36
- package/lib/esm/actionProcessor/core/event/express/api/getEventMatchStoryActionProcessor.d.ts +2 -2
- package/lib/esm/actionProcessor/core/event/express/api/getEventMatchStoryActionProcessor.js +38 -38
- package/lib/esm/actionProcessor/core/event/express/api/getEventTransformResponseResultActionProcessor.d.ts +2 -2
- package/lib/esm/actionProcessor/core/event/express/api/getEventTransformResponseResultActionProcessor.js +46 -46
- package/lib/esm/actionProcessor/core/event/express/api/index.d.ts +2 -2
- package/lib/esm/actionProcessor/core/event/express/api/index.js +12 -12
- package/lib/esm/actionProcessor/core/event/express/api/types.d.ts +8 -8
- package/lib/esm/actionProcessor/core/event/express/api/types.js +1 -1
- package/lib/esm/actionProcessor/core/event/express/index.d.ts +1 -1
- package/lib/esm/actionProcessor/core/event/express/index.js +1 -1
- package/lib/esm/actionProcessor/core/event/index.d.ts +4 -4
- package/lib/esm/actionProcessor/core/event/index.js +4 -4
- package/lib/esm/actionProcessor/core/event/node/index.d.ts +1 -1
- package/lib/esm/actionProcessor/core/event/node/index.js +1 -1
- package/lib/esm/actionProcessor/core/event/node/serviceFunction/getEventAutoRespondActionProcessor.d.ts +2 -2
- package/lib/esm/actionProcessor/core/event/node/serviceFunction/getEventAutoRespondActionProcessor.js +9 -9
- package/lib/esm/actionProcessor/core/event/node/serviceFunction/getEventGetRecordsActionProcessor.d.ts +2 -2
- package/lib/esm/actionProcessor/core/event/node/serviceFunction/getEventGetRecordsActionProcessor.js +13 -13
- package/lib/esm/actionProcessor/core/event/node/serviceFunction/getEventGetStorySessionActionProcessor.d.ts +2 -2
- package/lib/esm/actionProcessor/core/event/node/serviceFunction/getEventGetStorySessionActionProcessor.js +9 -9
- package/lib/esm/actionProcessor/core/event/node/serviceFunction/getEventMatchStoryActionProcessor.d.ts +2 -2
- package/lib/esm/actionProcessor/core/event/node/serviceFunction/getEventMatchStoryActionProcessor.js +18 -18
- package/lib/esm/actionProcessor/core/event/node/serviceFunction/getEventTransformResponseResultActionProcessor.d.ts +2 -2
- package/lib/esm/actionProcessor/core/event/node/serviceFunction/getEventTransformResponseResultActionProcessor.js +15 -15
- package/lib/esm/actionProcessor/core/event/node/serviceFunction/index.d.ts +2 -2
- package/lib/esm/actionProcessor/core/event/node/serviceFunction/index.js +12 -12
- package/lib/esm/actionProcessor/core/event/node/serviceFunction/types.d.ts +11 -11
- package/lib/esm/actionProcessor/core/event/node/serviceFunction/types.js +1 -1
- package/lib/esm/actionProcessor/core/event/queue/getEventAutoRespondActionProcessor.d.ts +2 -2
- package/lib/esm/actionProcessor/core/event/queue/getEventAutoRespondActionProcessor.js +14 -14
- package/lib/esm/actionProcessor/core/event/queue/getEventGetRecordsActionProcessor.d.ts +2 -2
- package/lib/esm/actionProcessor/core/event/queue/getEventGetRecordsActionProcessor.js +16 -16
- package/lib/esm/actionProcessor/core/event/queue/getEventGetStorySessionActionProcessor.d.ts +2 -2
- package/lib/esm/actionProcessor/core/event/queue/getEventGetStorySessionActionProcessor.js +9 -9
- package/lib/esm/actionProcessor/core/event/queue/getEventMatchStoryActionProcessor.d.ts +2 -2
- package/lib/esm/actionProcessor/core/event/queue/getEventMatchStoryActionProcessor.js +27 -27
- package/lib/esm/actionProcessor/core/event/queue/getEventTransformResponseResultActionProcessor.d.ts +2 -2
- package/lib/esm/actionProcessor/core/event/queue/getEventTransformResponseResultActionProcessor.js +11 -11
- package/lib/esm/actionProcessor/core/event/queue/index.d.ts +2 -2
- package/lib/esm/actionProcessor/core/event/queue/index.js +12 -12
- package/lib/esm/actionProcessor/core/event/queue/types.d.ts +15 -15
- package/lib/esm/actionProcessor/core/event/queue/types.js +1 -1
- package/lib/esm/actionProcessor/core/event/ws/index.d.ts +1 -1
- package/lib/esm/actionProcessor/core/event/ws/index.js +1 -1
- package/lib/esm/actionProcessor/core/event/ws/websocket/getEventAutoRespondActionProcessor.d.ts +2 -2
- package/lib/esm/actionProcessor/core/event/ws/websocket/getEventAutoRespondActionProcessor.js +9 -9
- package/lib/esm/actionProcessor/core/event/ws/websocket/getEventGetRecordsActionProcessor.d.ts +2 -2
- package/lib/esm/actionProcessor/core/event/ws/websocket/getEventGetRecordsActionProcessor.js +38 -38
- package/lib/esm/actionProcessor/core/event/ws/websocket/getEventGetStorySessionActionProcessor.d.ts +2 -2
- package/lib/esm/actionProcessor/core/event/ws/websocket/getEventGetStorySessionActionProcessor.js +9 -9
- package/lib/esm/actionProcessor/core/event/ws/websocket/getEventMatchStoryActionProcessor.d.ts +2 -2
- package/lib/esm/actionProcessor/core/event/ws/websocket/getEventMatchStoryActionProcessor.js +26 -26
- package/lib/esm/actionProcessor/core/event/ws/websocket/getEventTransformResponseResultActionProcessor.d.ts +2 -2
- package/lib/esm/actionProcessor/core/event/ws/websocket/getEventTransformResponseResultActionProcessor.js +14 -14
- package/lib/esm/actionProcessor/core/event/ws/websocket/index.d.ts +2 -2
- package/lib/esm/actionProcessor/core/event/ws/websocket/index.js +12 -12
- package/lib/esm/actionProcessor/core/event/ws/websocket/types.d.ts +8 -8
- package/lib/esm/actionProcessor/core/event/ws/websocket/types.js +1 -1
- package/lib/esm/actionProcessor/core/eventBus/getEventBusSendMessagesActionProcessor.d.ts +10 -10
- package/lib/esm/actionProcessor/core/eventBus/getEventBusSendMessagesActionProcessor.js +30 -30
- package/lib/esm/actionProcessor/core/eventBus/index.d.ts +2 -2
- package/lib/esm/actionProcessor/core/eventBus/index.js +4 -4
- package/lib/esm/actionProcessor/core/getCoreActionProcessor.d.ts +2 -2
- package/lib/esm/actionProcessor/core/getCoreActionProcessor.js +10 -10
- package/lib/esm/actionProcessor/core/graphDatabaseOverride/getGraphDatabaseExecuteOpenCypherQueryActionProcessor.d.ts +2 -2
- package/lib/esm/actionProcessor/core/graphDatabaseOverride/getGraphDatabaseExecuteOpenCypherQueryActionProcessor.js +25 -25
- package/lib/esm/actionProcessor/core/graphDatabaseOverride/index.d.ts +2 -2
- package/lib/esm/actionProcessor/core/graphDatabaseOverride/index.js +4 -4
- package/lib/esm/actionProcessor/core/index.d.ts +2 -2
- package/lib/esm/actionProcessor/core/index.js +2 -2
- package/lib/esm/actionProcessor/core/log/getLogCreateActionProcessor.d.ts +2 -2
- package/lib/esm/actionProcessor/core/log/getLogCreateActionProcessor.js +26 -26
- package/lib/esm/actionProcessor/core/log/getLogDisableEventHistoryActionProcessor.d.ts +2 -2
- package/lib/esm/actionProcessor/core/log/getLogDisableEventHistoryActionProcessor.js +10 -10
- package/lib/esm/actionProcessor/core/log/getLogTemplateLiteralActionProcessor.d.ts +2 -2
- package/lib/esm/actionProcessor/core/log/getLogTemplateLiteralActionProcessor.js +12 -12
- package/lib/esm/actionProcessor/core/log/index.d.ts +2 -2
- package/lib/esm/actionProcessor/core/log/index.js +8 -8
- package/lib/esm/actionProcessor/core/queue/getQueueSendMessageActionProcessor.d.ts +2 -2
- package/lib/esm/actionProcessor/core/queue/getQueueSendMessageActionProcessor.js +33 -33
- package/lib/esm/actionProcessor/core/queue/index.d.ts +2 -2
- package/lib/esm/actionProcessor/core/queue/index.js +4 -4
- package/lib/esm/actionProcessor/index.d.ts +4 -4
- package/lib/esm/actionProcessor/index.js +18 -18
- package/lib/esm/actionProcessor/webserver/index.d.ts +2 -2
- package/lib/esm/actionProcessor/webserver/index.js +6 -6
- package/lib/esm/actionProcessor/webserver/serviceFunctionOverride/getServiceFunctionExecuteActionProcessor.d.ts +2 -2
- package/lib/esm/actionProcessor/webserver/serviceFunctionOverride/getServiceFunctionExecuteActionProcessor.js +29 -29
- package/lib/esm/actionProcessor/webserver/serviceFunctionOverride/index.d.ts +2 -2
- package/lib/esm/actionProcessor/webserver/serviceFunctionOverride/index.js +4 -4
- package/lib/esm/actionProcessor/webserver/websocket/getWebsocketSendMessageActionProcessor.d.ts +2 -2
- package/lib/esm/actionProcessor/webserver/websocket/getWebsocketSendMessageActionProcessor.js +19 -19
- package/lib/esm/actionProcessor/webserver/websocket/index.d.ts +2 -2
- package/lib/esm/actionProcessor/webserver/websocket/index.js +4 -4
- package/lib/esm/allServiceConfig.d.ts +3 -3
- package/lib/esm/allServiceConfig.js +39 -39
- package/lib/esm/config/index.d.ts +1 -1
- package/lib/esm/config/index.js +1 -1
- package/lib/esm/config/settings/defineDevServerConfig.d.ts +6 -6
- package/lib/esm/config/settings/defineDevServerConfig.js +16 -16
- package/lib/esm/config/settings/index.d.ts +1 -1
- package/lib/esm/config/settings/index.js +1 -1
- package/lib/esm/entry/serviceFunction/runCypherQuery.d.ts +3 -3
- package/lib/esm/entry/serviceFunction/runCypherQuery.js +5 -5
- package/lib/esm/implementations/apiImplementation.d.ts +2 -2
- package/lib/esm/implementations/apiImplementation.js +129 -129
- package/lib/esm/implementations/eventBusImplementation.d.ts +2 -2
- package/lib/esm/implementations/eventBusImplementation.js +60 -60
- package/lib/esm/implementations/index.d.ts +5 -5
- package/lib/esm/implementations/index.js +5 -5
- package/lib/esm/implementations/queueImplementation.d.ts +2 -2
- package/lib/esm/implementations/queueImplementation.js +78 -78
- package/lib/esm/implementations/serviceFunctionImplementation.d.ts +2 -2
- package/lib/esm/implementations/serviceFunctionImplementation.js +21 -21
- package/lib/esm/implementations/webSocket/index.d.ts +2 -2
- package/lib/esm/implementations/webSocket/index.js +2 -2
- package/lib/esm/implementations/webSocket/types/WsEvent.d.ts +12 -13
- package/lib/esm/implementations/webSocket/types/WsEvent.js +1 -1
- package/lib/esm/implementations/webSocket/types/index.d.ts +1 -1
- package/lib/esm/implementations/webSocket/types/index.js +1 -1
- package/lib/esm/implementations/webSocket/webSocketImplementation.d.ts +3 -3
- package/lib/esm/implementations/webSocket/webSocketImplementation.js +125 -125
- package/lib/esm/index.d.ts +3 -3
- package/lib/esm/index.js +3 -3
- package/lib/esm/logic/eventBus.d.ts +10 -11
- package/lib/esm/logic/eventBus.js +34 -34
- package/lib/esm/logic/index.d.ts +2 -2
- package/lib/esm/logic/index.js +2 -2
- package/lib/esm/logic/processEvent.d.ts +2 -2
- package/lib/esm/logic/processEvent.js +20 -20
- package/lib/esm/main.d.ts +5 -5
- package/lib/esm/main.js +30 -30
- package/lib/esm/types/DevServerConfig.d.ts +14 -14
- package/lib/esm/types/DevServerConfig.js +1 -1
- package/lib/esm/types/ExpressEvent.d.ts +26 -26
- package/lib/esm/types/ExpressEvent.js +1 -1
- package/lib/esm/types/index.d.ts +2 -2
- package/lib/esm/types/index.js +2 -2
- package/package.json +7 -7
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './types';
|
|
2
|
-
export * from './webSocketImplementation';
|
|
1
|
+
export * from './types';
|
|
2
|
+
export * from './webSocketImplementation';
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
1
|
+
import { WebSocketEventType } from 'quidproquo-webserver';
|
|
2
|
+
export type WsEvent = {
|
|
3
|
+
apiName: string;
|
|
4
|
+
service: string;
|
|
5
|
+
eventType: WebSocketEventType;
|
|
6
|
+
body?: ArrayBuffer | Buffer | Buffer[];
|
|
7
|
+
messageId: string;
|
|
8
|
+
connectionId: string;
|
|
9
|
+
requestTimeEpoch: number;
|
|
10
|
+
sourceIp: string;
|
|
11
|
+
userAgent: string;
|
|
12
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './WsEvent';
|
|
1
|
+
export * from './WsEvent';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './WsEvent';
|
|
1
|
+
export * from './WsEvent';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DevServerConfig } from '../../types';
|
|
2
|
-
export declare const sendMessageToWebSocketConnection: (service: string, websocketApiName: string, connectionId: string, payload: any) => Promise<void>;
|
|
3
|
-
export declare const webSocketImplementation: (devServerConfig: DevServerConfig) => Promise<void>;
|
|
1
|
+
import { DevServerConfig } from '../../types';
|
|
2
|
+
export declare const sendMessageToWebSocketConnection: (service: string, websocketApiName: string, connectionId: string, payload: any) => Promise<void>;
|
|
3
|
+
export declare const webSocketImplementation: (devServerConfig: DevServerConfig) => Promise<void>;
|
|
@@ -1,125 +1,125 @@
|
|
|
1
|
-
import { qpqCoreUtils, QpqRuntimeType } from 'quidproquo-core';
|
|
2
|
-
import { qpqWebServerUtils, WebSocketEventType } from 'quidproquo-webserver';
|
|
3
|
-
import { createServer } from 'http';
|
|
4
|
-
import { WebSocketServer } from 'ws';
|
|
5
|
-
import { getWsWebsocketEventEventProcessor } from '../../actionProcessor';
|
|
6
|
-
import { processEvent } from '../../logic';
|
|
7
|
-
const getDynamicModuleLoader = (qpqConfig, devServerConfig) => {
|
|
8
|
-
const serviceName = qpqCoreUtils.getApplicationModuleName(qpqConfig);
|
|
9
|
-
return async (runtime) => devServerConfig.dynamicModuleLoader(serviceName, runtime);
|
|
10
|
-
};
|
|
11
|
-
const globals = {
|
|
12
|
-
allServers: [],
|
|
13
|
-
};
|
|
14
|
-
const findConnection = (service, apiName) => {
|
|
15
|
-
const serverInfo = globals.allServers.find((s) => s.service === service && s.apiName === apiName);
|
|
16
|
-
return serverInfo;
|
|
17
|
-
};
|
|
18
|
-
export const sendMessageToWebSocketConnection = async (service, websocketApiName, connectionId, payload) => {
|
|
19
|
-
const wsConnection = findConnection(service, websocketApiName)?.connections?.[connectionId];
|
|
20
|
-
if (!wsConnection) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
wsConnection.send(JSON.stringify(payload));
|
|
24
|
-
};
|
|
25
|
-
const startServer = (settingsMap, devServerConfig) => {
|
|
26
|
-
const webSocketServer = new WebSocketServer({ noServer: true });
|
|
27
|
-
console.log(`WebSocket: ws://${devServerConfig.serverDomain}:${devServerConfig.webSocketPort}/${settingsMap.service}/${settingsMap.apiName}`);
|
|
28
|
-
webSocketServer.on('connection', (ws, req) => {
|
|
29
|
-
const connectionId = req.headers['sec-websocket-key'] || crypto.randomUUID();
|
|
30
|
-
const sourceIp = req.socket.remoteAddress === '::1' || !req.socket.remoteAddress ? '127.0.0.1' : req.socket.remoteAddress;
|
|
31
|
-
const userAgent = req.headers['user-agent'] || 'unknown agent';
|
|
32
|
-
const server = findConnection(settingsMap.service, settingsMap.apiName);
|
|
33
|
-
server.connections[connectionId] = ws;
|
|
34
|
-
const processWsEvent = (wsEvent) => processEvent(wsEvent, settingsMap.qpqConfig, getDynamicModuleLoader(settingsMap.qpqConfig, devServerConfig), getWsWebsocketEventEventProcessor, QpqRuntimeType.WEBSOCKET_EVENT, () => ({
|
|
35
|
-
depth: 0,
|
|
36
|
-
context: {},
|
|
37
|
-
}));
|
|
38
|
-
const onConnectEvent = {
|
|
39
|
-
apiName: settingsMap.apiName,
|
|
40
|
-
service: settingsMap.service,
|
|
41
|
-
eventType: WebSocketEventType.Connect,
|
|
42
|
-
body: undefined,
|
|
43
|
-
messageId: crypto.randomUUID(),
|
|
44
|
-
connectionId: connectionId,
|
|
45
|
-
requestTimeEpoch: Date.now(),
|
|
46
|
-
sourceIp: sourceIp,
|
|
47
|
-
userAgent: userAgent,
|
|
48
|
-
};
|
|
49
|
-
processWsEvent(onConnectEvent);
|
|
50
|
-
ws.on('error', console.error);
|
|
51
|
-
ws.on('message', (data, isBinary) => {
|
|
52
|
-
const onMessageEvent = {
|
|
53
|
-
apiName: settingsMap.apiName,
|
|
54
|
-
service: settingsMap.service,
|
|
55
|
-
eventType: WebSocketEventType.Message,
|
|
56
|
-
body: data,
|
|
57
|
-
messageId: crypto.randomUUID(),
|
|
58
|
-
connectionId: connectionId,
|
|
59
|
-
requestTimeEpoch: Date.now(),
|
|
60
|
-
sourceIp: sourceIp,
|
|
61
|
-
userAgent: userAgent,
|
|
62
|
-
};
|
|
63
|
-
processWsEvent(onMessageEvent);
|
|
64
|
-
});
|
|
65
|
-
ws.on('close', () => {
|
|
66
|
-
delete server.connections[connectionId];
|
|
67
|
-
const onCloseEvent = {
|
|
68
|
-
apiName: settingsMap.apiName,
|
|
69
|
-
service: settingsMap.service,
|
|
70
|
-
eventType: WebSocketEventType.Disconnect,
|
|
71
|
-
body: undefined,
|
|
72
|
-
messageId: crypto.randomUUID(),
|
|
73
|
-
connectionId: connectionId,
|
|
74
|
-
requestTimeEpoch: Date.now(),
|
|
75
|
-
sourceIp: sourceIp,
|
|
76
|
-
userAgent: userAgent,
|
|
77
|
-
};
|
|
78
|
-
processWsEvent(onCloseEvent);
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
return {
|
|
82
|
-
...settingsMap,
|
|
83
|
-
server: webSocketServer,
|
|
84
|
-
connections: {},
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
const getWebSocketQPQWebServerConfigSettingMaps = (qpqConfigs) => {
|
|
88
|
-
return qpqConfigs
|
|
89
|
-
.flatMap((qpqConfig) => {
|
|
90
|
-
const service = qpqCoreUtils.getApplicationModuleName(qpqConfig);
|
|
91
|
-
return qpqWebServerUtils.getWebsocketSettings(qpqConfig).flatMap((wsc) => {
|
|
92
|
-
const item = {
|
|
93
|
-
apiName: wsc.apiName,
|
|
94
|
-
service,
|
|
95
|
-
setting: wsc,
|
|
96
|
-
qpqConfig,
|
|
97
|
-
};
|
|
98
|
-
return item;
|
|
99
|
-
});
|
|
100
|
-
})
|
|
101
|
-
.filter((item, index, arr) => arr[index].apiName !== item.apiName || !item.setting.owner?.module || arr[index].service === item.setting.owner?.module);
|
|
102
|
-
};
|
|
103
|
-
export const webSocketImplementation = async (devServerConfig) => {
|
|
104
|
-
if (!devServerConfig.webSocketPort) {
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
const webSocketQPQWebServerConfigSettingMaps = getWebSocketQPQWebServerConfigSettingMaps(devServerConfig.qpqConfigs);
|
|
108
|
-
const server = createServer();
|
|
109
|
-
globals.allServers = webSocketQPQWebServerConfigSettingMaps.map((x) => startServer(x, devServerConfig));
|
|
110
|
-
server.on('upgrade', (request, socket, head) => {
|
|
111
|
-
const { pathname } = new URL(request.url || '', 'wss://base.url');
|
|
112
|
-
const serverInfo = globals.allServers.find((s) => pathname === `/${s.service}/${s.apiName}`);
|
|
113
|
-
if (serverInfo) {
|
|
114
|
-
serverInfo.server.handleUpgrade(request, socket, head, (ws) => {
|
|
115
|
-
serverInfo.server.emit('connection', ws, request);
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
socket.destroy();
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
server.listen(devServerConfig.webSocketPort, 'localhost');
|
|
123
|
-
// Never ends
|
|
124
|
-
await new Promise(() => { });
|
|
125
|
-
};
|
|
1
|
+
import { qpqCoreUtils, QpqRuntimeType } from 'quidproquo-core';
|
|
2
|
+
import { qpqWebServerUtils, WebSocketEventType } from 'quidproquo-webserver';
|
|
3
|
+
import { createServer } from 'http';
|
|
4
|
+
import { WebSocketServer } from 'ws';
|
|
5
|
+
import { getWsWebsocketEventEventProcessor } from '../../actionProcessor';
|
|
6
|
+
import { processEvent } from '../../logic';
|
|
7
|
+
const getDynamicModuleLoader = (qpqConfig, devServerConfig) => {
|
|
8
|
+
const serviceName = qpqCoreUtils.getApplicationModuleName(qpqConfig);
|
|
9
|
+
return async (runtime) => devServerConfig.dynamicModuleLoader(serviceName, runtime);
|
|
10
|
+
};
|
|
11
|
+
const globals = {
|
|
12
|
+
allServers: [],
|
|
13
|
+
};
|
|
14
|
+
const findConnection = (service, apiName) => {
|
|
15
|
+
const serverInfo = globals.allServers.find((s) => s.service === service && s.apiName === apiName);
|
|
16
|
+
return serverInfo;
|
|
17
|
+
};
|
|
18
|
+
export const sendMessageToWebSocketConnection = async (service, websocketApiName, connectionId, payload) => {
|
|
19
|
+
const wsConnection = findConnection(service, websocketApiName)?.connections?.[connectionId];
|
|
20
|
+
if (!wsConnection) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
wsConnection.send(JSON.stringify(payload));
|
|
24
|
+
};
|
|
25
|
+
const startServer = (settingsMap, devServerConfig) => {
|
|
26
|
+
const webSocketServer = new WebSocketServer({ noServer: true });
|
|
27
|
+
console.log(`WebSocket: ws://${devServerConfig.serverDomain}:${devServerConfig.webSocketPort}/${settingsMap.service}/${settingsMap.apiName}`);
|
|
28
|
+
webSocketServer.on('connection', (ws, req) => {
|
|
29
|
+
const connectionId = req.headers['sec-websocket-key'] || crypto.randomUUID();
|
|
30
|
+
const sourceIp = req.socket.remoteAddress === '::1' || !req.socket.remoteAddress ? '127.0.0.1' : req.socket.remoteAddress;
|
|
31
|
+
const userAgent = req.headers['user-agent'] || 'unknown agent';
|
|
32
|
+
const server = findConnection(settingsMap.service, settingsMap.apiName);
|
|
33
|
+
server.connections[connectionId] = ws;
|
|
34
|
+
const processWsEvent = (wsEvent) => processEvent(wsEvent, settingsMap.qpqConfig, getDynamicModuleLoader(settingsMap.qpqConfig, devServerConfig), getWsWebsocketEventEventProcessor, QpqRuntimeType.WEBSOCKET_EVENT, () => ({
|
|
35
|
+
depth: 0,
|
|
36
|
+
context: {},
|
|
37
|
+
}));
|
|
38
|
+
const onConnectEvent = {
|
|
39
|
+
apiName: settingsMap.apiName,
|
|
40
|
+
service: settingsMap.service,
|
|
41
|
+
eventType: WebSocketEventType.Connect,
|
|
42
|
+
body: undefined,
|
|
43
|
+
messageId: crypto.randomUUID(),
|
|
44
|
+
connectionId: connectionId,
|
|
45
|
+
requestTimeEpoch: Date.now(),
|
|
46
|
+
sourceIp: sourceIp,
|
|
47
|
+
userAgent: userAgent,
|
|
48
|
+
};
|
|
49
|
+
processWsEvent(onConnectEvent);
|
|
50
|
+
ws.on('error', console.error);
|
|
51
|
+
ws.on('message', (data, isBinary) => {
|
|
52
|
+
const onMessageEvent = {
|
|
53
|
+
apiName: settingsMap.apiName,
|
|
54
|
+
service: settingsMap.service,
|
|
55
|
+
eventType: WebSocketEventType.Message,
|
|
56
|
+
body: data,
|
|
57
|
+
messageId: crypto.randomUUID(),
|
|
58
|
+
connectionId: connectionId,
|
|
59
|
+
requestTimeEpoch: Date.now(),
|
|
60
|
+
sourceIp: sourceIp,
|
|
61
|
+
userAgent: userAgent,
|
|
62
|
+
};
|
|
63
|
+
processWsEvent(onMessageEvent);
|
|
64
|
+
});
|
|
65
|
+
ws.on('close', () => {
|
|
66
|
+
delete server.connections[connectionId];
|
|
67
|
+
const onCloseEvent = {
|
|
68
|
+
apiName: settingsMap.apiName,
|
|
69
|
+
service: settingsMap.service,
|
|
70
|
+
eventType: WebSocketEventType.Disconnect,
|
|
71
|
+
body: undefined,
|
|
72
|
+
messageId: crypto.randomUUID(),
|
|
73
|
+
connectionId: connectionId,
|
|
74
|
+
requestTimeEpoch: Date.now(),
|
|
75
|
+
sourceIp: sourceIp,
|
|
76
|
+
userAgent: userAgent,
|
|
77
|
+
};
|
|
78
|
+
processWsEvent(onCloseEvent);
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
return {
|
|
82
|
+
...settingsMap,
|
|
83
|
+
server: webSocketServer,
|
|
84
|
+
connections: {},
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
const getWebSocketQPQWebServerConfigSettingMaps = (qpqConfigs) => {
|
|
88
|
+
return qpqConfigs
|
|
89
|
+
.flatMap((qpqConfig) => {
|
|
90
|
+
const service = qpqCoreUtils.getApplicationModuleName(qpqConfig);
|
|
91
|
+
return qpqWebServerUtils.getWebsocketSettings(qpqConfig).flatMap((wsc) => {
|
|
92
|
+
const item = {
|
|
93
|
+
apiName: wsc.apiName,
|
|
94
|
+
service,
|
|
95
|
+
setting: wsc,
|
|
96
|
+
qpqConfig,
|
|
97
|
+
};
|
|
98
|
+
return item;
|
|
99
|
+
});
|
|
100
|
+
})
|
|
101
|
+
.filter((item, index, arr) => arr[index].apiName !== item.apiName || !item.setting.owner?.module || arr[index].service === item.setting.owner?.module);
|
|
102
|
+
};
|
|
103
|
+
export const webSocketImplementation = async (devServerConfig) => {
|
|
104
|
+
if (!devServerConfig.webSocketPort) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const webSocketQPQWebServerConfigSettingMaps = getWebSocketQPQWebServerConfigSettingMaps(devServerConfig.qpqConfigs);
|
|
108
|
+
const server = createServer();
|
|
109
|
+
globals.allServers = webSocketQPQWebServerConfigSettingMaps.map((x) => startServer(x, devServerConfig));
|
|
110
|
+
server.on('upgrade', (request, socket, head) => {
|
|
111
|
+
const { pathname } = new URL(request.url || '', 'wss://base.url');
|
|
112
|
+
const serverInfo = globals.allServers.find((s) => pathname === `/${s.service}/${s.apiName}`);
|
|
113
|
+
if (serverInfo) {
|
|
114
|
+
serverInfo.server.handleUpgrade(request, socket, head, (ws) => {
|
|
115
|
+
serverInfo.server.emit('connection', ws, request);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
socket.destroy();
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
server.listen(devServerConfig.webSocketPort, 'localhost');
|
|
123
|
+
// Never ends
|
|
124
|
+
await new Promise(() => { });
|
|
125
|
+
};
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './config';
|
|
2
|
-
export * from './main';
|
|
3
|
-
export * from './types';
|
|
1
|
+
export * from './config';
|
|
2
|
+
export * from './main';
|
|
3
|
+
export * from './types';
|
package/lib/esm/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './config';
|
|
2
|
-
export * from './main';
|
|
3
|
-
export * from './types';
|
|
1
|
+
export * from './config';
|
|
2
|
+
export * from './main';
|
|
3
|
+
export * from './types';
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
private
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
export {};
|
|
1
|
+
import { EventEmitter } from 'events';
|
|
2
|
+
declare class EventBus extends EventEmitter {
|
|
3
|
+
private static instance;
|
|
4
|
+
private constructor();
|
|
5
|
+
static getInstance(): EventBus;
|
|
6
|
+
publishAndWaitForResponse(eventType: string, payload: any): Promise<any>;
|
|
7
|
+
publish(eventType: string, payload: any): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export declare const eventBus: EventBus;
|
|
10
|
+
export {};
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
// EventBus.ts
|
|
2
|
-
import { EventEmitter } from 'events';
|
|
3
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
4
|
-
class EventBus extends EventEmitter {
|
|
5
|
-
static instance;
|
|
6
|
-
constructor() {
|
|
7
|
-
super();
|
|
8
|
-
}
|
|
9
|
-
static getInstance() {
|
|
10
|
-
if (!EventBus.instance) {
|
|
11
|
-
EventBus.instance = new EventBus();
|
|
12
|
-
}
|
|
13
|
-
return EventBus.instance;
|
|
14
|
-
}
|
|
15
|
-
async publishAndWaitForResponse(eventType, payload) {
|
|
16
|
-
return new Promise((resolve) => {
|
|
17
|
-
const responseCorrelation = uuidv4();
|
|
18
|
-
// Listen for the response once
|
|
19
|
-
this.once(responseCorrelation, (response) => {
|
|
20
|
-
resolve(response);
|
|
21
|
-
});
|
|
22
|
-
// Emit the event along with the response event name
|
|
23
|
-
this.emit(eventType, payload, responseCorrelation);
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
async publish(eventType, payload) {
|
|
27
|
-
// console.log('------------------------------------------------------------');
|
|
28
|
-
// console.log('\n\nEventBus - publish: [', eventType, ']', '[', payload?.type, ']');
|
|
29
|
-
// console.log('------------------------------------------------------------');
|
|
30
|
-
this.emit(eventType, payload);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
// Exporting a singleton instance of EventBus
|
|
34
|
-
export const eventBus = EventBus.getInstance();
|
|
1
|
+
// EventBus.ts
|
|
2
|
+
import { EventEmitter } from 'events';
|
|
3
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
4
|
+
class EventBus extends EventEmitter {
|
|
5
|
+
static instance;
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
}
|
|
9
|
+
static getInstance() {
|
|
10
|
+
if (!EventBus.instance) {
|
|
11
|
+
EventBus.instance = new EventBus();
|
|
12
|
+
}
|
|
13
|
+
return EventBus.instance;
|
|
14
|
+
}
|
|
15
|
+
async publishAndWaitForResponse(eventType, payload) {
|
|
16
|
+
return new Promise((resolve) => {
|
|
17
|
+
const responseCorrelation = uuidv4();
|
|
18
|
+
// Listen for the response once
|
|
19
|
+
this.once(responseCorrelation, (response) => {
|
|
20
|
+
resolve(response);
|
|
21
|
+
});
|
|
22
|
+
// Emit the event along with the response event name
|
|
23
|
+
this.emit(eventType, payload, responseCorrelation);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
async publish(eventType, payload) {
|
|
27
|
+
// console.log('------------------------------------------------------------');
|
|
28
|
+
// console.log('\n\nEventBus - publish: [', eventType, ']', '[', payload?.type, ']');
|
|
29
|
+
// console.log('------------------------------------------------------------');
|
|
30
|
+
this.emit(eventType, payload);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
// Exporting a singleton instance of EventBus
|
|
34
|
+
export const eventBus = EventBus.getInstance();
|
package/lib/esm/logic/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './eventBus';
|
|
2
|
-
export * from './processEvent';
|
|
1
|
+
export * from './eventBus';
|
|
2
|
+
export * from './processEvent';
|
package/lib/esm/logic/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './eventBus';
|
|
2
|
-
export * from './processEvent';
|
|
1
|
+
export * from './eventBus';
|
|
2
|
+
export * from './processEvent';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ActionProcessorListResolver, DynamicModuleLoader, QPQConfig, QpqRuntimeType, StoryResult, StorySession } from 'quidproquo-core';
|
|
2
|
-
export declare const processEvent: <E, ER>(expressEvent: E, qpqConfig: QPQConfig, dynamicModuleLoader: DynamicModuleLoader, getActionProcessors: ActionProcessorListResolver, qpqRuntimeType: QpqRuntimeType, getStorySession: (event: E) => StorySession) => Promise<StoryResult<[E], ER>>;
|
|
1
|
+
import { ActionProcessorListResolver, DynamicModuleLoader, QPQConfig, QpqRuntimeType, StoryResult, StorySession } from 'quidproquo-core';
|
|
2
|
+
export declare const processEvent: <E, ER>(expressEvent: E, qpqConfig: QPQConfig, dynamicModuleLoader: DynamicModuleLoader, getActionProcessors: ActionProcessorListResolver, qpqRuntimeType: QpqRuntimeType, getStorySession: (event: E) => StorySession) => Promise<StoryResult<[E], ER>>;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { getLogger } from 'quidproquo-actionprocessor-awslambda';
|
|
2
|
-
import { getCustomActionActionProcessor } from 'quidproquo-actionprocessor-node';
|
|
3
|
-
import { askProcessEvent, createRuntime, qpqCoreUtils, } from 'quidproquo-core';
|
|
4
|
-
import { randomUUID } from 'crypto';
|
|
5
|
-
import { getDevServerActionProcessors } from '../actionProcessor';
|
|
6
|
-
// TODO: Make this a util or something based on server time or something..
|
|
7
|
-
const getDateNow = () => new Date().toISOString();
|
|
8
|
-
export const processEvent = async (expressEvent, qpqConfig, dynamicModuleLoader, getActionProcessors, qpqRuntimeType, getStorySession) => {
|
|
9
|
-
const serviceName = qpqCoreUtils.getApplicationModuleName(qpqConfig);
|
|
10
|
-
const logger = getLogger(qpqConfig);
|
|
11
|
-
const resolveStory = createRuntime(qpqConfig, getStorySession(expressEvent), async () => ({
|
|
12
|
-
...(await getDevServerActionProcessors(qpqConfig, dynamicModuleLoader)),
|
|
13
|
-
...(await getActionProcessors(qpqConfig, dynamicModuleLoader)),
|
|
14
|
-
// Always done last, so they can ovveride the default ones if the user wants.
|
|
15
|
-
...(await getCustomActionActionProcessor(qpqConfig, dynamicModuleLoader)),
|
|
16
|
-
}), getDateNow, logger, `${serviceName}::${randomUUID()}`, qpqRuntimeType, dynamicModuleLoader, undefined, []);
|
|
17
|
-
const result = await resolveStory(askProcessEvent, [expressEvent]);
|
|
18
|
-
await logger.waitToFinishWriting();
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
1
|
+
import { getLogger } from 'quidproquo-actionprocessor-awslambda';
|
|
2
|
+
import { getCustomActionActionProcessor } from 'quidproquo-actionprocessor-node';
|
|
3
|
+
import { askProcessEvent, createRuntime, qpqCoreUtils, } from 'quidproquo-core';
|
|
4
|
+
import { randomUUID } from 'crypto';
|
|
5
|
+
import { getDevServerActionProcessors } from '../actionProcessor';
|
|
6
|
+
// TODO: Make this a util or something based on server time or something..
|
|
7
|
+
const getDateNow = () => new Date().toISOString();
|
|
8
|
+
export const processEvent = async (expressEvent, qpqConfig, dynamicModuleLoader, getActionProcessors, qpqRuntimeType, getStorySession) => {
|
|
9
|
+
const serviceName = qpqCoreUtils.getApplicationModuleName(qpqConfig);
|
|
10
|
+
const logger = getLogger(qpqConfig);
|
|
11
|
+
const resolveStory = createRuntime(qpqConfig, getStorySession(expressEvent), async () => ({
|
|
12
|
+
...(await getDevServerActionProcessors(qpqConfig, dynamicModuleLoader)),
|
|
13
|
+
...(await getActionProcessors(qpqConfig, dynamicModuleLoader)),
|
|
14
|
+
// Always done last, so they can ovveride the default ones if the user wants.
|
|
15
|
+
...(await getCustomActionActionProcessor(qpqConfig, dynamicModuleLoader)),
|
|
16
|
+
}), getDateNow, logger, `${serviceName}::${randomUUID()}`, qpqRuntimeType, dynamicModuleLoader, undefined, []);
|
|
17
|
+
const result = await resolveStory(askProcessEvent, [expressEvent]);
|
|
18
|
+
await logger.waitToFinishWriting();
|
|
19
|
+
return result;
|
|
20
|
+
};
|
package/lib/esm/main.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { QPQConfig } from 'quidproquo-core';
|
|
2
|
-
import { DevServerConfig, DevServerConfigOverrides } from './types';
|
|
3
|
-
export * from './implementations';
|
|
4
|
-
export declare const getDevConfigs: (qpqConfigs: QPQConfig[], devServerConfigOverrides?: DevServerConfigOverrides) => QPQConfig[];
|
|
5
|
-
export declare const startDevServer: (devServerConfig: DevServerConfig, devServerConfigOverrides?: DevServerConfigOverrides) => Promise<void>;
|
|
1
|
+
import { QPQConfig } from 'quidproquo-core';
|
|
2
|
+
import { DevServerConfig, DevServerConfigOverrides } from './types';
|
|
3
|
+
export * from './implementations';
|
|
4
|
+
export declare const getDevConfigs: (qpqConfigs: QPQConfig[], devServerConfigOverrides?: DevServerConfigOverrides) => QPQConfig[];
|
|
5
|
+
export declare const startDevServer: (devServerConfig: DevServerConfig, devServerConfigOverrides?: DevServerConfigOverrides) => Promise<void>;
|
package/lib/esm/main.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { qpqCoreUtils } from 'quidproquo-core';
|
|
2
|
-
import { apiImplementation, eventBusImplementation, queueImplementation, serviceFunctionImplementation, webSocketImplementation, } from './implementations';
|
|
3
|
-
export * from './implementations';
|
|
4
|
-
export const getDevConfigs = (qpqConfigs, devServerConfigOverrides) => {
|
|
5
|
-
return qpqConfigs.map((qpqConfig) => {
|
|
6
|
-
return [
|
|
7
|
-
// Base config
|
|
8
|
-
...qpqConfig,
|
|
9
|
-
// all service override
|
|
10
|
-
...(devServerConfigOverrides?.allServices || []),
|
|
11
|
-
// specific service override
|
|
12
|
-
...((devServerConfigOverrides?.byService || {})[qpqCoreUtils.getApplicationModuleName(qpqConfig)] || []),
|
|
13
|
-
];
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
export const startDevServer = async (devServerConfig, devServerConfigOverrides) => {
|
|
17
|
-
console.log('Starting QPQ Dev Server!!!');
|
|
18
|
-
// Add ovverrides for dev server
|
|
19
|
-
const updatedDevServerConfig = {
|
|
20
|
-
...devServerConfig,
|
|
21
|
-
qpqConfigs: getDevConfigs(devServerConfig.qpqConfigs),
|
|
22
|
-
};
|
|
23
|
-
await Promise.all([
|
|
24
|
-
apiImplementation(updatedDevServerConfig),
|
|
25
|
-
serviceFunctionImplementation(updatedDevServerConfig),
|
|
26
|
-
eventBusImplementation(updatedDevServerConfig),
|
|
27
|
-
queueImplementation(updatedDevServerConfig),
|
|
28
|
-
webSocketImplementation(updatedDevServerConfig),
|
|
29
|
-
]);
|
|
30
|
-
};
|
|
1
|
+
import { qpqCoreUtils } from 'quidproquo-core';
|
|
2
|
+
import { apiImplementation, eventBusImplementation, queueImplementation, serviceFunctionImplementation, webSocketImplementation, } from './implementations';
|
|
3
|
+
export * from './implementations';
|
|
4
|
+
export const getDevConfigs = (qpqConfigs, devServerConfigOverrides) => {
|
|
5
|
+
return qpqConfigs.map((qpqConfig) => {
|
|
6
|
+
return [
|
|
7
|
+
// Base config
|
|
8
|
+
...qpqConfig,
|
|
9
|
+
// all service override
|
|
10
|
+
...(devServerConfigOverrides?.allServices || []),
|
|
11
|
+
// specific service override
|
|
12
|
+
...((devServerConfigOverrides?.byService || {})[qpqCoreUtils.getApplicationModuleName(qpqConfig)] || []),
|
|
13
|
+
];
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
export const startDevServer = async (devServerConfig, devServerConfigOverrides) => {
|
|
17
|
+
console.log('Starting QPQ Dev Server!!!');
|
|
18
|
+
// Add ovverrides for dev server
|
|
19
|
+
const updatedDevServerConfig = {
|
|
20
|
+
...devServerConfig,
|
|
21
|
+
qpqConfigs: getDevConfigs(devServerConfig.qpqConfigs),
|
|
22
|
+
};
|
|
23
|
+
await Promise.all([
|
|
24
|
+
apiImplementation(updatedDevServerConfig),
|
|
25
|
+
serviceFunctionImplementation(updatedDevServerConfig),
|
|
26
|
+
eventBusImplementation(updatedDevServerConfig),
|
|
27
|
+
queueImplementation(updatedDevServerConfig),
|
|
28
|
+
webSocketImplementation(updatedDevServerConfig),
|
|
29
|
+
]);
|
|
30
|
+
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { QPQConfig, QpqFunctionRuntime } from 'quidproquo-core';
|
|
2
|
-
export type DevServerConfig = {
|
|
3
|
-
serverDomain: 'localhost';
|
|
4
|
-
serverPort: number;
|
|
5
|
-
webSocketPort?: number;
|
|
6
|
-
dynamicModuleLoader: <T = any>(serviceName: string, modulePath: QpqFunctionRuntime) => Promise<T>;
|
|
7
|
-
qpqConfigs: QPQConfig[];
|
|
8
|
-
};
|
|
9
|
-
export type DevServerConfigOverrides = {
|
|
10
|
-
allServices?: QPQConfig;
|
|
11
|
-
byService?: {
|
|
12
|
-
[key: string]: QPQConfig;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
1
|
+
import { QPQConfig, QpqFunctionRuntime } from 'quidproquo-core';
|
|
2
|
+
export type DevServerConfig = {
|
|
3
|
+
serverDomain: 'localhost';
|
|
4
|
+
serverPort: number;
|
|
5
|
+
webSocketPort?: number;
|
|
6
|
+
dynamicModuleLoader: <T = any>(serviceName: string, modulePath: QpqFunctionRuntime) => Promise<T>;
|
|
7
|
+
qpqConfigs: QPQConfig[];
|
|
8
|
+
};
|
|
9
|
+
export type DevServerConfigOverrides = {
|
|
10
|
+
allServices?: QPQConfig;
|
|
11
|
+
byService?: {
|
|
12
|
+
[key: string]: QPQConfig;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { QPQBinaryData } from 'quidproquo-core';
|
|
2
|
-
export interface ExpressEvent {
|
|
3
|
-
protocol: string;
|
|
4
|
-
host: string;
|
|
5
|
-
path: string;
|
|
6
|
-
ip: string;
|
|
7
|
-
method: string;
|
|
8
|
-
query: {
|
|
9
|
-
[key: string]: undefined | string | string[];
|
|
10
|
-
};
|
|
11
|
-
correlation: string;
|
|
12
|
-
isBase64Encoded: boolean;
|
|
13
|
-
body: any;
|
|
14
|
-
headers: {
|
|
15
|
-
[key: string]: undefined | string;
|
|
16
|
-
};
|
|
17
|
-
files?: QPQBinaryData[];
|
|
18
|
-
}
|
|
19
|
-
export interface ExpressEventResponse {
|
|
20
|
-
statusCode: number;
|
|
21
|
-
body: string;
|
|
22
|
-
headers: {
|
|
23
|
-
[key: string]: undefined | string;
|
|
24
|
-
};
|
|
25
|
-
isBase64Encoded: boolean;
|
|
26
|
-
}
|
|
1
|
+
import { QPQBinaryData } from 'quidproquo-core';
|
|
2
|
+
export interface ExpressEvent {
|
|
3
|
+
protocol: string;
|
|
4
|
+
host: string;
|
|
5
|
+
path: string;
|
|
6
|
+
ip: string;
|
|
7
|
+
method: string;
|
|
8
|
+
query: {
|
|
9
|
+
[key: string]: undefined | string | string[];
|
|
10
|
+
};
|
|
11
|
+
correlation: string;
|
|
12
|
+
isBase64Encoded: boolean;
|
|
13
|
+
body: any;
|
|
14
|
+
headers: {
|
|
15
|
+
[key: string]: undefined | string;
|
|
16
|
+
};
|
|
17
|
+
files?: QPQBinaryData[];
|
|
18
|
+
}
|
|
19
|
+
export interface ExpressEventResponse {
|
|
20
|
+
statusCode: number;
|
|
21
|
+
body: string;
|
|
22
|
+
headers: {
|
|
23
|
+
[key: string]: undefined | string;
|
|
24
|
+
};
|
|
25
|
+
isBase64Encoded: boolean;
|
|
26
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|