sim-node-lib 0.2.2 → 0.2.3

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": "sim-node-lib",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Library from SIMLabs",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,7 +0,0 @@
1
- import { PubSubActionEnum } from '../../Enums/PubSubActionEnum';
2
- import { PubSubTableEnum } from '../../Enums/PubSubTableEnum';
3
- export declare class GooglePubSubPublish {
4
- constructor(topicName: string);
5
- private _topicName;
6
- createMessages<T>(message: T, action: PubSubActionEnum, table: PubSubTableEnum): Promise<void>;
7
- }
@@ -1,30 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.GooglePubSubPublish = void 0;
13
- const pubsub_1 = require("@google-cloud/pubsub");
14
- const PubSubModel_1 = require("../../Models/v2/PubSubModel");
15
- class GooglePubSubPublish {
16
- constructor(topicName) {
17
- this._topicName = topicName;
18
- }
19
- createMessages(message, action, table) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- const pubSubClient = new pubsub_1.PubSub();
22
- const send = new PubSubModel_1.PubSubModel(message, action, table);
23
- const topic = pubSubClient.topic(this._topicName);
24
- const dataSend = JSON.stringify(send);
25
- const data = Buffer.from(dataSend);
26
- yield topic.publishMessage({ data });
27
- });
28
- }
29
- }
30
- exports.GooglePubSubPublish = GooglePubSubPublish;
@@ -1 +0,0 @@
1
- export * from './NotificacaoTipo';
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./NotificacaoTipo"), exports);