@kronos-integration/service-mqtt 2.0.1 → 2.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kronos-integration/service-mqtt",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -113,7 +113,7 @@ export class ServiceMQTT extends Service {
113
113
  client.on("message", (topic, message) => {
114
114
  const ep = this.endpoints[topic];
115
115
  if (ep) {
116
- ep.receive(message);
116
+ ep.send(message);
117
117
  }
118
118
  });
119
119
  }
@@ -1,6 +1,6 @@
1
- import { SendReceiveEndpoint } from "@kronos-integration/endpoint";
1
+ import { SendEndpoint } from "@kronos-integration/endpoint";
2
2
 
3
- export class TopicEndpoint extends SendReceiveEndpoint {
3
+ export class TopicEndpoint extends SendEndpoint {
4
4
  constructor(name, owner, options) {
5
5
  super(name, owner, options);
6
6
 
@@ -27,7 +27,10 @@ test("start / stop", async t => {
27
27
  const sp = new StandaloneServiceProvider();
28
28
 
29
29
  const r1 = new ReceiveEndpoint("r1", sp);
30
- r1.receive = async () => "OK R1";
30
+
31
+ const received = [];
32
+
33
+ r1.receive = async (message) => received.push(message);
31
34
 
32
35
  const mqtt = await sp.declareService({
33
36
  type: ServiceMQTT,
@@ -1,6 +1,6 @@
1
- export class TopicEndpoint extends SendReceiveEndpoint {
1
+ export class TopicEndpoint extends SendEndpoint {
2
2
  constructor(name: any, owner: any, options: any);
3
3
  _topic: any;
4
4
  get topic(): any;
5
5
  }
6
- import { SendReceiveEndpoint } from "@kronos-integration/endpoint";
6
+ import { SendEndpoint } from "@kronos-integration/endpoint";