Repository: bbc/sqs-consumer (TypeScript)

Issue:
[Bug]: RetrieveMessage is missing the MessageSystemAttributeNames parameter
### Describe the bug

AWS SDK v3 client-sqs's ReceiveMessageCommandInput takes a "MessageSystemAttributeNames" parameter. 
See
https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-sqs/Interface/ReceiveMessageCommandInput/

This option is currently not available in SQSConsumer [](url)

### Your minimal, reproducible example

3.592.0

### Steps to reproduce

AWS doc 
https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html#API_ReceiveMessage_RequestSyntax

[AttributeNames]
This parameter has been deprecated but will be supported for backward compatibility. To provide attribute names, you are encouraged to use MessageSystemAttributeNames.

SQSConsumer should provide an option to pass in MessageSystemAttributeNames to client/sqs to be forward compatible.

### Expected behavior

Consumer.create() should have an option to pass in MessageSystemAttributeNames

### How often does this bug happen?

Every time

### Screenshots or Videos

_No response_

### Platform

NodeJS 18

### Package version

v11.0.2

### AWS SDK version

3.633.0

### Additional context

N/A


Discussion:
Sorry, I didn't spot this, been working on the day to day, this makes sense, if you want to open a PR, I'll happily take a look through, otherwise, I'll take a look this Friday.
:tada: This issue has been resolved in version 11.1.0-canary.1 :tada:

The release is available on:
- [GitHub release](https://github.com/bbc/sqs-consumer/releases/tag/v11.1.0-canary.1)
- [npm package (@canary dist-tag)](https://www.npmjs.com/package/sqs-consumer/v/11.1.0-canary.1)
- [JSR.io](https://jsr.io/@bbc/sqs-consumer@11.1.0-canary.1)

Your **[semantic-release](https://github.com/semantic-release/semantic-release)** bot :package::rocket:
:tada: This issue has been resolved in version 11.1.0 :tada:

The release is available on:
- [GitHub release](https://github.com/bbc/sqs-consumer/releases/tag/v11.1.0)
- [npm package (@latest dist-tag)](https://www.npmjs.com/package/sqs-consumer/v/11.1.0)
- [JSR.io](https://jsr.io/@bbc/sqs-consumer@11.1.0)

Your **[semantic-release](https://github.com/semantic-release/semantic-release)** bot :package::rocket:
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.



Patch:
diff --git a/src/consumer.ts b/src/consumer.ts
index 4fce2675..c70a5c9f 100644
--- a/src/consumer.ts
+++ b/src/consumer.ts
@@ -15,6 +15,7 @@ import {
   ReceiveMessageCommandInput,
   ReceiveMessageCommandOutput,
   QueueAttributeName,
+  MessageSystemAttributeName,
 } from "@aws-sdk/client-sqs";
 
 import { ConsumerOptions, StopOptions, UpdatableOptions } from "./types.js";
@@ -45,6 +46,7 @@ export class Consumer extends TypedEventEmitter {
   private handleMessageTimeout: number;
   private attributeNames: QueueAttributeName[];
   private messageAttributeNames: string[];
+  private messageSystemAttributeNames: MessageSystemAttributeName[];
   private shouldDeleteMessages: boolean;
   private alwaysAcknowledge: boolean;
   private batchSize: number;
@@ -71,6 +73,8 @@ export class Consumer extends TypedEventEmitter {
     this.handleMessageTimeout = options.handleMessageTimeout;
     this.attributeNames = options.attributeNames || [];
     this.messageAttributeNames = options.messageAttributeNames || [];
+    this.messageSystemAttributeNames =
+      options.messageSystemAttributeNames || [];
     this.batchSize = options.batchSize || 1;
     this.visibilityTimeout = options.visibilityTimeout;
     this.terminateVisibilityTimeout =
@@ -242,6 +246,7 @@ export class Consumer extends TypedEventEmitter {
       QueueUrl: this.queueUrl,
       AttributeNames: this.attributeNames,
       MessageAttributeNames: this.messageAttributeNames,
+      MessageSystemAttributeNames: this.messageSystemAttributeNames,
       MaxNumberOfMessages: this.batchSize,
       WaitTimeSeconds: this.waitTimeSeconds,
       VisibilityTimeout: this.visibilityTimeout,
diff --git a/src/types.ts b/src/types.ts
index 075407ee..aeec5c81 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -1,4 +1,9 @@
-import { SQSClient, Message, QueueAttributeName } from "@aws-sdk/client-sqs";
+import {
+  SQSClient,
+  Message,
+  QueueAttributeName,
+  MessageSystemAttributeName,
+} from "@aws-sdk/client-sqs";
 
 /**
  * The options for the consumer.
@@ -18,6 +23,11 @@ export interface ConsumerOptions {
    * @defaultvalue `[]`
    */
   messageAttributeNames?: string[];
+  /**
+   * A list of attributes that need to be returned along with each message.
+   * @defaultvalue `[]`
+   */
+  messageSystemAttributeNames?: MessageSystemAttributeName[];
   /** @hidden */
   stopped?: boolean;
   /**


Test patch:
diff --git a/test/tests/consumer.test.ts b/test/tests/consumer.test.ts
index d70219e8..df818455 100644
--- a/test/tests/consumer.test.ts
+++ b/test/tests/consumer.test.ts
@@ -926,6 +926,7 @@ describe("Consumer", () => {
       consumer = new Consumer({
         queueUrl: QUEUE_URL,
         messageAttributeNames: ["attribute-1", "attribute-2"],
+        messageSystemAttributeNames: ["All"],
         region: REGION,
         handleMessage,
         batchSize: 3,
@@ -944,6 +945,7 @@ describe("Consumer", () => {
           QueueUrl: QUEUE_URL,
           AttributeNames: [],
           MessageAttributeNames: ["attribute-1", "attribute-2"],
+          MessageSystemAttributeNames: ["All"],
           MaxNumberOfMessages: 3,
           WaitTimeSeconds: AUTHENTICATION_ERROR_TIMEOUT,
           VisibilityTimeout: undefined,
@@ -988,6 +990,7 @@ describe("Consumer", () => {
           QueueUrl: QUEUE_URL,
           AttributeNames: ["ApproximateReceiveCount"],
           MessageAttributeNames: [],
+          MessageSystemAttributeNames: [],
           MaxNumberOfMessages: 1,
           WaitTimeSeconds: AUTHENTICATION_ERROR_TIMEOUT,
           VisibilityTimeout: undefined,