@pristine-ts/aws 0.0.390 → 0.0.391

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.
@@ -52,41 +52,49 @@ let SqsClient = class SqsClient {
52
52
  * Sends a message to the specified Queue URL.
53
53
  * @param queueUrl The queue url where to send the message.
54
54
  * @param body The body of the message to send in the queue.
55
- * @param messageGroupId The message group id for FIFO queues.
56
- * @param delaySeconds The length of time, in seconds, for which to delay a specific message.
57
- * @param messageDeduplicationId The unique id used by Amazon SQS in Fifo queues to avoid treating a message twice.
58
- * @param options
59
- * @param configs The configs for which the SQS client is created.
55
+ * @param options The options to customize the request.
60
56
  */
61
- send(queueUrl, body, messageGroupId, delaySeconds, messageDeduplicationId, options, configs) {
57
+ send(queueUrl, body, options) {
58
+ var _a;
62
59
  return __awaiter(this, void 0, void 0, function* () {
63
60
  try {
64
- const client = this.getClient(configs);
61
+ const client = this.getClient(options.clientConfigs);
62
+ const MessageAttributes = {};
63
+ if (options.eventGroupId) {
64
+ MessageAttributes["eventGroupId"] = {
65
+ DataType: "String",
66
+ StringValue: options.eventGroupId,
67
+ };
68
+ }
65
69
  const command = new client_sqs_1.SendMessageCommand({
66
70
  QueueUrl: queueUrl,
67
71
  MessageBody: body,
68
- MessageGroupId: messageGroupId,
69
- DelaySeconds: delaySeconds,
70
- MessageDeduplicationId: messageDeduplicationId,
72
+ MessageGroupId: options.messageGroupId,
73
+ DelaySeconds: options.delaySeconds,
74
+ MessageDeduplicationId: options.messageDeduplicationId,
75
+ MessageAttributes,
71
76
  });
72
77
  this.logHandler.debug("SqsClient: Sending a message to the queue.", {
73
- extra: {
78
+ highlights: {
74
79
  queueUrl,
75
80
  body,
76
- messageGroupId,
77
- delaySeconds,
78
- messageDeduplicationId,
81
+ },
82
+ eventId: options.eventId,
83
+ eventGroupId: options.eventGroupId,
84
+ extra: {
85
+ options
79
86
  }
80
87
  });
81
- const response = yield client.send(command, options);
88
+ const response = yield client.send(command, options.clientOptions);
82
89
  this.logHandler.debug("SqsClient: Message successfully sent to the queue.", {
83
- extra: {
90
+ highlights: {
84
91
  queueUrl,
85
92
  body,
86
- messageGroupId,
87
- delaySeconds,
88
- response,
89
- messageDeduplicationId
93
+ },
94
+ eventId: options.eventId,
95
+ eventGroupId: options.eventGroupId,
96
+ extra: {
97
+ options
90
98
  }
91
99
  });
92
100
  return {
@@ -95,16 +103,19 @@ let SqsClient = class SqsClient {
95
103
  }
96
104
  catch (error) {
97
105
  this.logHandler.error("SqsClient: There was an error sending the message to the queue.", {
98
- extra: {
99
- error,
106
+ highlights: {
100
107
  queueUrl,
101
108
  body,
102
- messageGroupId,
103
- delaySeconds,
104
- messageDeduplicationId,
109
+ errorMessage: (_a = error.message) !== null && _a !== void 0 ? _a : "Unknown error",
110
+ },
111
+ eventId: options.eventId,
112
+ eventGroupId: options.eventGroupId,
113
+ extra: {
114
+ options,
115
+ error,
105
116
  }
106
117
  });
107
- throw new sqs_send_message_error_1.SqsSendMessageError(error, queueUrl, body, messageGroupId, delaySeconds);
118
+ throw new sqs_send_message_error_1.SqsSendMessageError(error, queueUrl, body, options.messageGroupId, options.delaySeconds);
108
119
  }
109
120
  });
110
121
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sqs.client.js","sourceRoot":"","sources":["../../../../src/clients/sqs.client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA4C;AAE5C,oDAAmF;AAEnF,6EAAqE;AACrE,gDAAsD;AACtD,8DAAuD;AAIvD;;;GAGG;AAII,IAAM,SAAS,GAAf,MAAM,SAAS;IAElB;;;;OAIG;IACH,YACoD,UAA+B,EAC7B,MAAc;QADhB,eAAU,GAAV,UAAU,CAAqB;QAC7B,WAAM,GAAN,MAAM,CAAQ;IAEpE,CAAC;IAED;;;OAGG;IACI,SAAS,CAAC,OAAkC;QAC/C,OAAO,IAAI,sBAAS,iBAChB,MAAM,EAAE,IAAI,CAAC,MAAM,IAChB,OAAO,EACZ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,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,cAAc,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;YACvG,CAAC;;KACJ;CACJ,CAAA;AApGY,8BAAS;oBAAT,SAAS;IAHrB,IAAA,YAAG,EAAC,oBAAoB,CAAC;IACzB,IAAA,qBAAY,EAAC,qCAAgB,CAAC;IAC9B,IAAA,qBAAU,GAAE;IASJ,WAAA,IAAA,iBAAM,EAAC,qBAAqB,CAAC,CAAA;IAC7B,WAAA,IAAA,iBAAM,EAAC,uBAAuB,CAAC,CAAA;;GAT3B,SAAS,CAoGrB"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SqsClientOptions = void 0;
4
+ class SqsClientOptions {
5
+ }
6
+ exports.SqsClientOptions = SqsClientOptions;
7
+ //# sourceMappingURL=sqs-client.options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqs-client.options.js","sourceRoot":"","sources":["../../../../src/options/sqs-client.options.ts"],"names":[],"mappings":";;;AAGA,MAAa,gBAAgB;CAoC5B;AApCD,4CAoCC"}
@@ -49,41 +49,49 @@ let SqsClient = class SqsClient {
49
49
  * Sends a message to the specified Queue URL.
50
50
  * @param queueUrl The queue url where to send the message.
51
51
  * @param body The body of the message to send in the queue.
52
- * @param messageGroupId The message group id for FIFO queues.
53
- * @param delaySeconds The length of time, in seconds, for which to delay a specific message.
54
- * @param messageDeduplicationId The unique id used by Amazon SQS in Fifo queues to avoid treating a message twice.
55
- * @param options
56
- * @param configs The configs for which the SQS client is created.
52
+ * @param options The options to customize the request.
57
53
  */
58
- send(queueUrl, body, messageGroupId, delaySeconds, messageDeduplicationId, options, configs) {
54
+ send(queueUrl, body, options) {
55
+ var _a;
59
56
  return __awaiter(this, void 0, void 0, function* () {
60
57
  try {
61
- const client = this.getClient(configs);
58
+ const client = this.getClient(options.clientConfigs);
59
+ const MessageAttributes = {};
60
+ if (options.eventGroupId) {
61
+ MessageAttributes["eventGroupId"] = {
62
+ DataType: "String",
63
+ StringValue: options.eventGroupId,
64
+ };
65
+ }
62
66
  const command = new SendMessageCommand({
63
67
  QueueUrl: queueUrl,
64
68
  MessageBody: body,
65
- MessageGroupId: messageGroupId,
66
- DelaySeconds: delaySeconds,
67
- MessageDeduplicationId: messageDeduplicationId,
69
+ MessageGroupId: options.messageGroupId,
70
+ DelaySeconds: options.delaySeconds,
71
+ MessageDeduplicationId: options.messageDeduplicationId,
72
+ MessageAttributes,
68
73
  });
69
74
  this.logHandler.debug("SqsClient: Sending a message to the queue.", {
70
- extra: {
75
+ highlights: {
71
76
  queueUrl,
72
77
  body,
73
- messageGroupId,
74
- delaySeconds,
75
- messageDeduplicationId,
78
+ },
79
+ eventId: options.eventId,
80
+ eventGroupId: options.eventGroupId,
81
+ extra: {
82
+ options
76
83
  }
77
84
  });
78
- const response = yield client.send(command, options);
85
+ const response = yield client.send(command, options.clientOptions);
79
86
  this.logHandler.debug("SqsClient: Message successfully sent to the queue.", {
80
- extra: {
87
+ highlights: {
81
88
  queueUrl,
82
89
  body,
83
- messageGroupId,
84
- delaySeconds,
85
- response,
86
- messageDeduplicationId
90
+ },
91
+ eventId: options.eventId,
92
+ eventGroupId: options.eventGroupId,
93
+ extra: {
94
+ options
87
95
  }
88
96
  });
89
97
  return {
@@ -92,16 +100,19 @@ let SqsClient = class SqsClient {
92
100
  }
93
101
  catch (error) {
94
102
  this.logHandler.error("SqsClient: There was an error sending the message to the queue.", {
95
- extra: {
96
- error,
103
+ highlights: {
97
104
  queueUrl,
98
105
  body,
99
- messageGroupId,
100
- delaySeconds,
101
- messageDeduplicationId,
106
+ errorMessage: (_a = error.message) !== null && _a !== void 0 ? _a : "Unknown error",
107
+ },
108
+ eventId: options.eventId,
109
+ eventGroupId: options.eventGroupId,
110
+ extra: {
111
+ options,
112
+ error,
102
113
  }
103
114
  });
104
- throw new SqsSendMessageError(error, queueUrl, body, messageGroupId, delaySeconds);
115
+ throw new SqsSendMessageError(error, queueUrl, body, options.messageGroupId, options.delaySeconds);
105
116
  }
106
117
  });
107
118
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sqs.client.js","sourceRoot":"","sources":["../../../../src/clients/sqs.client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AAE5C,OAAO,EAAC,SAAS,EAAE,kBAAkB,EAAkB,MAAM,qBAAqB,CAAC;AAEnF,OAAO,EAAC,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAC,YAAY,EAAE,GAAG,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AAIvD;;;GAGG;AAII,IAAM,SAAS,GAAf,MAAM,SAAS;IAElB;;;;OAIG;IACH,YACoD,UAA+B,EAC7B,MAAc;QADhB,eAAU,GAAV,UAAU,CAAqB;QAC7B,WAAM,GAAN,MAAM,CAAQ;IAEpE,CAAC;IAED;;;OAGG;IACI,SAAS,CAAC,OAAkC;QAC/C,OAAO,IAAI,SAAS,iBAChB,MAAM,EAAE,IAAI,CAAC,MAAM,IAChB,OAAO,EACZ,CAAC;IACP,CAAC;IAED;;;;;;;;;OASG;IACG,IAAI,CAAC,QAAgB,EAAE,IAAY,EAAE,cAAuB,EAAE,YAAqB,EAAE,sBAA+B,EAAE,OAAyC,EAAE,OAAkC;;YACrM,IAAI,CAAC;gBACD,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;gBAEvC,MAAM,OAAO,GAAG,IAAI,kBAAkB,CAAC;oBACnC,QAAQ,EAAE,QAAQ;oBAClB,WAAW,EAAE,IAAI;oBACjB,cAAc,EAAE,cAAc;oBAC9B,YAAY,EAAE,YAAY;oBAC1B,sBAAsB,EAAE,sBAAsB;iBACjD,CAAC,CAAC;gBAEH,IAAI,CAAC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WAAA,MAAM,CAAC,uBAAuB,CAAC,CAAA;;GAT3B,SAAS,CAoGrB"}
@@ -0,0 +1,3 @@
1
+ export class SqsClientOptions {
2
+ }
3
+ //# sourceMappingURL=sqs-client.options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqs-client.options.js","sourceRoot":"","sources":["../../../../src/options/sqs-client.options.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,gBAAgB;CAoC5B"}
@@ -2,7 +2,7 @@ import { LogHandlerInterface } from "@pristine-ts/logging";
2
2
  import { SQSClient, SQSClientConfig } from "@aws-sdk/client-sqs";
3
3
  import { SqsMessageSentConfirmationModel } from "../models/sqs-message-sent-confirmation.model";
4
4
  import { SqsClientInterface } from "../interfaces/sqs-client.interface";
5
- import { ClientOptionsInterface } from "../interfaces/client-options.interface";
5
+ import { SqsClientOptions } from "../options/sqs-client.options";
6
6
  /**
7
7
  * The client to use to interact with AWS SQS. It is a wrapper around the SQSClient of @aws-sdk/client-sqs.
8
8
  * It is tagged so it can be injected using SqsClientInterface.
@@ -25,11 +25,7 @@ export declare class SqsClient implements SqsClientInterface {
25
25
  * Sends a message to the specified Queue URL.
26
26
  * @param queueUrl The queue url where to send the message.
27
27
  * @param body The body of the message to send in the queue.
28
- * @param messageGroupId The message group id for FIFO queues.
29
- * @param delaySeconds The length of time, in seconds, for which to delay a specific message.
30
- * @param messageDeduplicationId The unique id used by Amazon SQS in Fifo queues to avoid treating a message twice.
31
- * @param options
32
- * @param configs The configs for which the SQS client is created.
28
+ * @param options The options to customize the request.
33
29
  */
34
- send(queueUrl: string, body: string, messageGroupId?: string, delaySeconds?: number, messageDeduplicationId?: string, options?: Partial<ClientOptionsInterface>, configs?: Partial<SQSClientConfig>): Promise<SqsMessageSentConfirmationModel>;
30
+ send(queueUrl: string, body: string, options: SqsClientOptions): Promise<SqsMessageSentConfirmationModel>;
35
31
  }
@@ -1,6 +1,6 @@
1
1
  import { SqsMessageSentConfirmationModel } from "../models/sqs-message-sent-confirmation.model";
2
2
  import { SQSClient, SQSClientConfig } from "@aws-sdk/client-sqs";
3
- import { ClientOptionsInterface } from "./client-options.interface";
3
+ import { SqsClientOptions } from "../options/sqs-client.options";
4
4
  /**
5
5
  * The S3Client Interface defines the methods that an S3 client must implement.
6
6
  * When injecting the S3 client the 'S3ClientInterface' tag should be used.
@@ -15,12 +15,7 @@ export interface SqsClientInterface {
15
15
  * Sends a message to the specified Queue URL.
16
16
  * @param queueUrl The queue url where to send the message.
17
17
  * @param body The body of the message to send in the queue.
18
- * @param messageGroupId The message group id for FIFO queues.
19
- * @param delaySeconds The length of time, in seconds, for which to delay a specific message.
20
- * @param endpoint The endpoint for SQS.
21
- * @param messageDeduplicationId
22
- * @param options
23
- * @param configs The configs for which the SQS client is created.
18
+ * @param options The options to customize the request.
24
19
  */
25
- send(queueUrl: string, body: string, messageGroupId?: string, delaySeconds?: number, messageDeduplicationId?: string, options?: Partial<ClientOptionsInterface>, configs?: Partial<SQSClientConfig>): Promise<SqsMessageSentConfirmationModel>;
20
+ send(queueUrl: string, body: string, options: SqsClientOptions): Promise<SqsMessageSentConfirmationModel>;
26
21
  }
@@ -0,0 +1,33 @@
1
+ import { ClientOptionsInterface } from "../interfaces/client-options.interface";
2
+ import { SQSClientConfig } from "@aws-sdk/client-sqs";
3
+ export declare class SqsClientOptions {
4
+ /**
5
+ * The id of the Event this operation was triggered BY. Used for logging purposes.
6
+ * WARNING: It will NOT be added to the MessageAttributes.
7
+ */
8
+ eventId: string;
9
+ /**
10
+ * Event Group Id that groups all the events in a similar operation. Will be added to MessageAttributes.
11
+ */
12
+ eventGroupId?: string;
13
+ /**
14
+ * The message group id for FIFO queues.
15
+ */
16
+ messageGroupId?: string;
17
+ /**
18
+ * The length of time, in seconds, for which to delay a specific message.
19
+ */
20
+ delaySeconds?: number;
21
+ /**
22
+ * The unique id used by Amazon SQS in Fifo queues to avoid treating a message twice.
23
+ */
24
+ messageDeduplicationId?: string;
25
+ /**
26
+ * Client Options
27
+ */
28
+ clientOptions?: Partial<ClientOptionsInterface>;
29
+ /**
30
+ * The configs for which the SQS client is created, that can be overriden.
31
+ */
32
+ clientConfigs?: Partial<SQSClientConfig>;
33
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pristine-ts/aws",
3
- "version": "0.0.390",
3
+ "version": "0.0.391",
4
4
  "description": "",
5
5
  "module": "dist/lib/esm/aws.module.js",
6
6
  "main": "dist/lib/cjs/aws.module.js",
@@ -30,11 +30,11 @@
30
30
  "@awslabs-community-fork/dynamodb-data-mapper": "^0.7.13",
31
31
  "@awslabs-community-fork/dynamodb-data-marshaller": "^0.7.13",
32
32
  "@awslabs-community-fork/dynamodb-expressions": "^0.7.13",
33
- "@pristine-ts/common": "^0.0.390",
34
- "@pristine-ts/core": "^0.0.390",
35
- "@pristine-ts/logging": "^0.0.390",
36
- "@pristine-ts/networking": "^0.0.390",
37
- "@pristine-ts/security": "^0.0.390",
33
+ "@pristine-ts/common": "^0.0.391",
34
+ "@pristine-ts/core": "^0.0.391",
35
+ "@pristine-ts/logging": "^0.0.391",
36
+ "@pristine-ts/networking": "^0.0.391",
37
+ "@pristine-ts/security": "^0.0.391",
38
38
  "uuid": "^9.0.1"
39
39
  },
40
40
  "publishConfig": {
@@ -74,5 +74,5 @@
74
74
  "src/*.{js,ts}"
75
75
  ]
76
76
  },
77
- "gitHead": "ab8c129faea86ff21b48325870d0b2d81753e51d"
77
+ "gitHead": "ee9fbf48d0fedf614d8a567157a18507aa1ae385"
78
78
  }