From 6e9b93d5cdcd4087baf7b9f03025be587bf7d645 Mon Sep 17 00:00:00 2001 From: Nicholas Griffin Date: Fri, 24 Nov 2023 12:47:00 +0000 Subject: [PATCH] chore: updating types --- src/consumer.ts | 4 ++-- src/types.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/consumer.ts b/src/consumer.ts index d793ca6..5351088 100644 --- a/src/consumer.ts +++ b/src/consumer.ts @@ -44,7 +44,7 @@ export class Consumer extends TypedEventEmitter { private postReceiveMessageCallback?: () => Promise; private sqs: SQSClient; private handleMessageTimeout: number; - private attributeNames: string[]; + private attributeNames: QueueAttributeName[]; private messageAttributeNames: string[]; private shouldDeleteMessages: boolean; private batchSize: number; @@ -199,7 +199,7 @@ export class Consumer extends TypedEventEmitter { let currentPollingTimeout = this.pollingWaitTimeMs; this.receiveMessage({ QueueUrl: this.queueUrl, - AttributeNames: this.attributeNames as QueueAttributeName[], + AttributeNames: this.attributeNames, MessageAttributeNames: this.messageAttributeNames, MaxNumberOfMessages: this.batchSize, WaitTimeSeconds: this.waitTimeSeconds, diff --git a/src/types.ts b/src/types.ts index c1fa5fe..3f7744f 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,4 +1,4 @@ -import { SQSClient, Message } from '@aws-sdk/client-sqs'; +import { SQSClient, Message, QueueAttributeName } from '@aws-sdk/client-sqs'; export interface ConsumerOptions { /** @@ -10,7 +10,7 @@ export interface ConsumerOptions { * `['All', 'ApproximateFirstReceiveTimestamp', 'ApproximateReceiveCount']`). * @defaultvalue `[]` */ - attributeNames?: string[]; + attributeNames?: QueueAttributeName[]; /** * List of message attributes to retrieve (i.e. `['name', 'address']`). * @defaultvalue `[]`