configurapi-runner-ws 1.1.0 → 1.3.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/README.md CHANGED
@@ -8,4 +8,5 @@
8
8
  - The last chunk will have `X-Stream: done` header.
9
9
  - Check `X-Stream-ID: $id` header for the stream ID. A chunk belonging to the same stream will have the same stream ID.
10
10
  - connectionId is available at `event.request.headers.connectionId`
11
- - `on_connect` and `on_disconnect` will be called when a new connection is made or closed.
11
+ - `on_connect` and `on_disconnect` will be called when a new connection is made or closed.
12
+ - Use `Request.headers.pushFunction` to send an out-of-band message. The function is async and accepts an object to send back to the caller.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "configurapi-runner-ws",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "Websocket runner for configurapi.",
5
5
  "bin": {
6
6
  "configurapi-runner-ws": "src/app.mjs"
package/src/wsAdapter.js CHANGED
@@ -146,9 +146,11 @@ module.exports = {
146
146
  request.headers = data.headers || {};
147
147
  request.name = data.name || undefined;
148
148
  request.query = data.query || {};
149
+ request.params = data.params || {};
149
150
  request.payload = data.payload || undefined;
150
151
 
151
152
  request.headers['connectionId'] = ws.connectionId;
153
+ request.headers['pushFunction'] = async (data)=>await this.write(ws, data);
152
154
 
153
155
  return request;
154
156
  }