@fiado/api-invoker 1.5.24 → 1.5.25

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.
@@ -8,9 +8,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
11
14
  Object.defineProperty(exports, "__esModule", { value: true });
12
15
  const client_sqs_1 = require("@aws-sdk/client-sqs");
13
16
  const inversify_1 = require("inversify");
17
+ const crypto_1 = __importDefault(require("crypto"));
14
18
  let NotificationWSMessagePublisher = class NotificationWSMessagePublisher {
15
19
  constructor() {
16
20
  this.NOTIFICATION_WS_MESSAGES_QUEUE = process.env.NOTIFICATION_WS_MESSAGES_QUEUE;
@@ -20,7 +24,9 @@ let NotificationWSMessagePublisher = class NotificationWSMessagePublisher {
20
24
  const client = new client_sqs_1.SQSClient();
21
25
  const sendMessageRequest = {
22
26
  QueueUrl: this.NOTIFICATION_WS_MESSAGES_QUEUE,
23
- MessageBody: JSON.stringify(message)
27
+ MessageBody: JSON.stringify(message),
28
+ MessageGroupId: "NotificationWSGroup",
29
+ MessageDeduplicationId: crypto_1.default.randomUUID()
24
30
  };
25
31
  const command = new client_sqs_1.SendMessageCommand(sendMessageRequest);
26
32
  await client.send(command);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "1.5.24",
3
+ "version": "1.5.25",
4
4
  "description": "Sirve como un puente entre diferentes funciones lambda, facilitando la comunicación entre ellas a través de invocaciones http",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -2,6 +2,7 @@ import {INotificationWSMessagesPublisher} from "./interfaces/INotificationWSMess
2
2
  import {NotificationWSQueueMessageRequest} from "@fiado/type-kit/bin/notificationWS";
3
3
  import {SendMessageCommand, SendMessageRequest, SQSClient} from "@aws-sdk/client-sqs";
4
4
  import {injectable} from "inversify";
5
+ import crypto from "crypto";
5
6
 
6
7
 
7
8
  @injectable()
@@ -16,7 +17,9 @@ export default class NotificationWSMessagePublisher implements INotificationWSMe
16
17
  const client: SQSClient = new SQSClient();
17
18
  const sendMessageRequest: SendMessageRequest = {
18
19
  QueueUrl: this.NOTIFICATION_WS_MESSAGES_QUEUE,
19
- MessageBody: JSON.stringify(message)
20
+ MessageBody: JSON.stringify(message),
21
+ MessageGroupId: "NotificationWSGroup",
22
+ MessageDeduplicationId: crypto.randomUUID()
20
23
  };
21
24
  const command: SendMessageCommand = new SendMessageCommand(sendMessageRequest);
22
25
  await client.send(command);