sim-node-lib 0.0.15 → 0.0.18
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/dist/google-pub-sub.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
3
|
export declare class PubSubModel {
|
|
4
|
-
readonly value:
|
|
5
|
-
readonly action:
|
|
6
|
-
readonly table:
|
|
4
|
+
readonly value: any;
|
|
5
|
+
readonly action: PubSubActionEnum;
|
|
6
|
+
readonly table: PubSubTableEnum;
|
|
7
7
|
constructor(value: object, action: PubSubActionEnum, table: PubSubTableEnum);
|
|
8
8
|
}
|
|
9
9
|
export declare class GooglePubSubSubscription {
|
package/dist/google-pub-sub.js
CHANGED
|
@@ -13,8 +13,8 @@ const pubsub_1 = require("@google-cloud/pubsub");
|
|
|
13
13
|
class PubSubModel {
|
|
14
14
|
constructor(value, action, table) {
|
|
15
15
|
this.value = value;
|
|
16
|
-
this.action = action
|
|
17
|
-
this.table = table
|
|
16
|
+
this.action = action;
|
|
17
|
+
this.table = table;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
exports.PubSubModel = PubSubModel;
|
|
@@ -28,7 +28,8 @@ class GooglePubSubSubscription {
|
|
|
28
28
|
try {
|
|
29
29
|
const data = JSON.parse(message.data.toString());
|
|
30
30
|
const pubSubModel = new PubSubModel(data.value, data.action, data.table);
|
|
31
|
-
eventEmitter.emit('event',
|
|
31
|
+
eventEmitter.emit('event', pubSubModel);
|
|
32
|
+
message.ack();
|
|
32
33
|
}
|
|
33
34
|
catch (error) {
|
|
34
35
|
console.error(error);
|
|
@@ -73,7 +74,7 @@ class PubSubHandelerAction {
|
|
|
73
74
|
return this.insert();
|
|
74
75
|
case 'update':
|
|
75
76
|
return this.update();
|
|
76
|
-
case '
|
|
77
|
+
case 'remove':
|
|
77
78
|
return this.remove();
|
|
78
79
|
default:
|
|
79
80
|
throw new Error('PubSub handler action not implemented.');
|