# @probitas/client-sqs > Version: 0.5.0 AWS SQS client for [Probitas](https://github.com/probitas-test/probitas) scenario testing framework. This package provides an AWS SQS client designed for integration testing of message-driven applications using Amazon Simple Queue Service. ## Features - **Queue Management**: Create, delete, and purge queues - **Message Operations**: Send, receive, and delete messages (single and batch) - **Message Attributes**: Support for custom message attributes - **LocalStack Compatible**: Works with LocalStack for local development - **Resource Management**: Implements `AsyncDisposable` for proper cleanup ## Installation ```bash deno add jsr:@probitas/client-sqs ``` ## Quick Start ```ts import { createSqsClient } from "@probitas/client-sqs"; const client = await createSqsClient({ region: "us-east-1", url: "http://localhost:4566", // LocalStack credentials: { accessKeyId: "test", secretAccessKey: "test", }, }); // Ensure queue exists const queueResult = await client.ensureQueue("test-queue"); if (!queueResult.ok) throw new Error("Failed to ensure queue"); // Send a message const sendResult = await client.send("Hello, World!", { messageAttributes: { type: { dataType: "String", stringValue: "greeting" }, }, }); if (!sendResult.ok) throw new Error("Failed to send message"); console.log("Message ID:", sendResult.messageId); // Receive messages const receiveResult = await client.receive({ maxMessages: 10, waitTimeSeconds: 5, }); if (!receiveResult.ok) throw new Error("Failed to receive messages"); console.log("Received:", receiveResult.messages.length); // Delete message after processing for (const msg of receiveResult.messages) { await client.delete(msg.receiptHandle); } await client.close(); ``` ## Batch Operations ```ts import { createSqsClient } from "@probitas/client-sqs"; const client = await createSqsClient({ region: "us-east-1", url: "http://localhost:4566", credentials: { accessKeyId: "test", secretAccessKey: "test" }, }); const queueResult = await client.ensureQueue("test-queue"); if (!queueResult.ok) throw new Error("Failed to ensure queue"); // Send batch messages await client.sendBatch([ { body: "Message 1", id: "msg-1" }, { body: "Message 2", id: "msg-2" }, { body: "Message 3", id: "msg-3" }, ]); // Delete batch messages const receiveResult = await client.receive({ maxMessages: 10 }); if (!receiveResult.ok) throw new Error("Failed to receive messages"); const handles = receiveResult.messages.map((m) => m.receiptHandle); await client.deleteBatch(handles); await client.close(); ``` ## Using with `using` Statement ```ts import { createSqsClient } from "@probitas/client-sqs"; await using client = await createSqsClient({ region: "us-east-1", url: "http://localhost:4566", credentials: { accessKeyId: "test", secretAccessKey: "test" }, }); const queue = await client.ensureQueue("test"); console.log("Queue URL:", queue.queueUrl); // Client automatically closed when block exits ``` ## Related Packages | Package | Description | |---------|-------------| | [`@probitas/client`](https://jsr.io/@probitas/client) | Core utilities and types | | [`@probitas/client-rabbitmq`](https://jsr.io/@probitas/client-rabbitmq) | RabbitMQ client | ## Links - [GitHub Repository](https://github.com/probitas-test/probitas-client) - [Probitas Framework](https://github.com/probitas-test/probitas) - [AWS SQS](https://aws.amazon.com/sqs/) - [LocalStack](https://localstack.cloud/) ## Classes ### `SqsBatchError` ```typescript class SqsBatchError extends SqsError ``` Error thrown when a batch operation partially fails. **Constructor:** ```typescript new SqsBatchError( message: string, failedCount: number, options?: SqsErrorOptions, ) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"batch"` - [readonly] `failedCount`: `number` --- ### `SqsCommandError` ```typescript class SqsCommandError extends SqsError ``` Error thrown when an SQS command fails. **Constructor:** ```typescript new SqsCommandError(message: string, options: SqsCommandErrorOptions) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"command"` - [readonly] `operation`: `string` --- ### `SqsConnectionError` ```typescript class SqsConnectionError extends SqsError ``` Error thrown when an SQS connection cannot be established. **Constructor:** ```typescript new SqsConnectionError(message: string, options?: SqsErrorOptions) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"connection"` --- ### `SqsError` ```typescript class SqsError extends ClientError ``` Base error class for SQS client errors. **Constructor:** ```typescript new SqsError(message: string, _: unknown, options?: SqsErrorOptions) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `code?`: `string` --- ### `SqsMessageNotFoundError` ```typescript class SqsMessageNotFoundError extends SqsError ``` Error thrown when a message is not found or receipt handle is invalid. **Constructor:** ```typescript new SqsMessageNotFoundError(message: string, options?: SqsErrorOptions) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"message_not_found"` --- ### `SqsMessageTooLargeError` ```typescript class SqsMessageTooLargeError extends SqsError ``` Error thrown when a message exceeds the size limit. **Constructor:** ```typescript new SqsMessageTooLargeError( message: string, size: number, maxSize: number, options?: SqsErrorOptions, ) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"message_too_large"` - [readonly] `size`: `number` - [readonly] `maxSize`: `number` --- ### `SqsQueueNotFoundError` ```typescript class SqsQueueNotFoundError extends SqsError ``` Error thrown when a queue is not found. **Constructor:** ```typescript new SqsQueueNotFoundError( message: string, queueUrl: string, options?: SqsErrorOptions, ) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"queue_not_found"` - [readonly] `queueUrl`: `string` --- ## Interfaces ### `SqsOptions` ```typescript interface SqsOptions extends CommonOptions ``` Common options with throwOnError support. **Properties:** - [readonly] `throwOnError?`: `boolean` — If true, throws errors instead of returning them in the result. If false (default), errors are returned in the result object. --- ### `SqsConnectionConfig` ```typescript interface SqsConnectionConfig extends CommonConnectionConfig ``` SQS connection configuration. Extends CommonConnectionConfig with SQS-specific options. **Properties:** - [readonly] `protocol?`: `"http" | "https"` — Protocol to use. - [readonly] `path?`: `string` — Custom path (for LocalStack or custom endpoints). - [readonly] `region?`: `string` — AWS region (required for AWS, optional for LocalStack). --- ### `SqsClientConfig` ```typescript interface SqsClientConfig extends SqsOptions ``` SQS client configuration. **Properties:** - [readonly] `region`: `string` — AWS region - [readonly] `credentials?`: `{ accessKeyId: string; secretAccessKey: string }` — AWS credentials - [readonly] `queueUrl?`: `string` — SQS queue URL (optional - can be set later or used with ensureQueue) - [readonly] `url?`: `string | SqsConnectionConfig` — SQS endpoint URL (e.g., "http://localhost:4566" for LocalStack). Can be a string URL or a connection config object. Optional for real AWS (uses default endpoint), required for LocalStack. --- ### `SqsMessageAttribute` ```typescript interface SqsMessageAttribute ``` SQS message attributes. **Properties:** - [readonly] `dataType`: `"String" | "Number" | "Binary"` - [readonly] `stringValue?`: `string` - [readonly] `binaryValue?`: `Uint8Array` --- ### `SqsMessage` ```typescript interface SqsMessage ``` SQS message received from a queue. **Properties:** - [readonly] `messageId`: `string` - [readonly] `body`: `string` - [readonly] `receiptHandle`: `string` - [readonly] `attributes`: `Record` - [readonly] `messageAttributes?`: `Record` - [readonly] `md5OfBody`: `string` --- ### `SqsSendOptions` ```typescript interface SqsSendOptions extends SqsOptions ``` Options for sending a message. **Properties:** - [readonly] `delaySeconds?`: `number` — Delay in seconds before the message becomes visible (0-900) - [readonly] `messageAttributes?`: `Record` — Message attributes - [readonly] `messageGroupId?`: `string` — Message group ID (required for FIFO queues) - [readonly] `messageDeduplicationId?`: `string` — Message deduplication ID (required for FIFO queues without content-based deduplication) --- ### `SqsBatchMessage` ```typescript interface SqsBatchMessage ``` Batch message for sendBatch. **Properties:** - [readonly] `id`: `string` - [readonly] `body`: `string` - [readonly] `delaySeconds?`: `number` - [readonly] `messageAttributes?`: `Record` --- ### `SqsReceiveOptions` ```typescript interface SqsReceiveOptions extends SqsOptions ``` Options for receiving messages. **Properties:** - [readonly] `maxMessages?`: `number` — Maximum number of messages to receive (1-10, default: 1) - [readonly] `waitTimeSeconds?`: `number` — Wait time in seconds for long polling (0-20) - [readonly] `visibilityTimeout?`: `number` — Visibility timeout in seconds (0-43200) - [readonly] `attributeNames?`: `readonly string[]` — System attribute names to retrieve - [readonly] `messageAttributeNames?`: `readonly string[]` — Message attribute names to retrieve --- ### `SqsBatchSuccessEntry` ```typescript interface SqsBatchSuccessEntry ``` Successful batch send entry. **Properties:** - [readonly] `messageId`: `string` - [readonly] `id`: `string` --- ### `SqsBatchFailedEntry` ```typescript interface SqsBatchFailedEntry ``` Failed batch entry. **Properties:** - [readonly] `id`: `string` - [readonly] `code`: `string` - [readonly] `message`: `string` --- ### `SqsEnsureQueueOptions` ```typescript interface SqsEnsureQueueOptions extends SqsOptions ``` Options for ensuring a queue exists. **Properties:** - [readonly] `attributes?`: `Record` — Queue attributes (e.g., DelaySeconds, MessageRetentionPeriod) - [readonly] `tags?`: `Record` — Queue tags --- ### `SqsDeleteOptions` ```typescript interface SqsDeleteOptions extends SqsOptions ``` Options for deleting a message. --- ### `SqsBatchOptions` ```typescript interface SqsBatchOptions extends SqsOptions ``` Options for batch operations. --- ### `SqsDeleteQueueOptions` ```typescript interface SqsDeleteQueueOptions extends SqsOptions ``` Options for deleting a queue. --- ### `SqsClient` ```typescript interface SqsClient extends AsyncDisposable ``` SQS client interface. **Properties:** - [readonly] `config`: `SqsClientConfig` - [readonly] `queueUrl`: `string | undefined` — The current queue URL. Can be set via config, ensureQueue(), or setQueueUrl(). **Methods:** ```typescript setQueueUrl(queueUrl: string): void ``` Set the queue URL for subsequent operations. ```typescript ensureQueue( queueName: string, options?: SqsEnsureQueueOptions, ): Promise ``` Ensure a queue exists. Creates the queue if it doesn't exist. If the queue already exists with the same attributes, returns the existing queue URL. Also sets the queue URL for subsequent operations. ```typescript deleteQueue( queueUrl: string, options?: SqsDeleteQueueOptions, ): Promise ``` Delete a queue by URL. ```typescript send(body: string, options?: SqsSendOptions): Promise ``` Send a message to the queue. ```typescript sendBatch( messages: SqsBatchMessage[], options?: SqsBatchOptions, ): Promise ``` Send multiple messages to the queue in a single request. ```typescript receive(options?: SqsReceiveOptions): Promise ``` Receive messages from the queue. ```typescript delete( receiptHandle: string, options?: SqsDeleteOptions, ): Promise ``` Delete a message from the queue. ```typescript deleteBatch( receiptHandles: string[], options?: SqsBatchOptions, ): Promise ``` Delete multiple messages from the queue in a single request. ```typescript purge(options?: SqsOptions): Promise ``` Purge all messages from the queue. ```typescript close(): Promise ``` Close the client and release resources. --- ### `SqsErrorOptions` ```typescript interface SqsErrorOptions extends ErrorOptions ``` Options for SQS errors. **Properties:** - [readonly] `code?`: `string` --- ### `SqsCommandErrorOptions` ```typescript interface SqsCommandErrorOptions extends SqsErrorOptions ``` Options for SQS command errors. **Properties:** - [readonly] `operation`: `string` --- ### `SqsSendResultSuccess` ```typescript interface SqsSendResultSuccess extends SqsSendResultBase ``` Successful send result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `messageId`: `string` — Unique identifier for the sent message. - [readonly] `md5OfBody`: `string` — MD5 hash of the message body (for integrity verification). - [readonly] `sequenceNumber`: `string | null` — Sequence number for FIFO queues (present only for FIFO queues). --- ### `SqsSendResultError` ```typescript interface SqsSendResultError extends SqsSendResultBase ``` Send result with SQS error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `SqsError` - [readonly] `messageId`: `null` - [readonly] `md5OfBody`: `null` - [readonly] `sequenceNumber`: `null` --- ### `SqsSendResultFailure` ```typescript interface SqsSendResultFailure extends SqsSendResultBase ``` Send result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `SqsFailureError` - [readonly] `messageId`: `null` - [readonly] `md5OfBody`: `null` - [readonly] `sequenceNumber`: `null` --- ### `SqsSendBatchResultSuccess` ```typescript interface SqsSendBatchResultSuccess extends SqsSendBatchResultBase ``` Successful batch send result. Note: `ok: true` even if some messages failed (partial failure). Check `failed.length > 0` to detect partial failures. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `successful`: `readonly SqsBatchSuccessEntry[]` — Array of successfully sent messages. - [readonly] `failed`: `readonly SqsBatchFailedEntry[]` — Array of messages that failed to send (may be non-empty even with ok: true). --- ### `SqsSendBatchResultError` ```typescript interface SqsSendBatchResultError extends SqsSendBatchResultBase ``` Batch send result with SQS error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `SqsError` - [readonly] `successful`: `readonly []` - [readonly] `failed`: `readonly []` --- ### `SqsSendBatchResultFailure` ```typescript interface SqsSendBatchResultFailure extends SqsSendBatchResultBase ``` Batch send result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `SqsFailureError` - [readonly] `successful`: `null` - [readonly] `failed`: `null` --- ### `SqsReceiveResultSuccess` ```typescript interface SqsReceiveResultSuccess extends SqsReceiveResultBase ``` Successful receive result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `messages`: `readonly SqsMessage[]` — Array of received messages (may be empty). --- ### `SqsReceiveResultError` ```typescript interface SqsReceiveResultError extends SqsReceiveResultBase ``` Receive result with SQS error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `SqsError` - [readonly] `messages`: `readonly []` --- ### `SqsReceiveResultFailure` ```typescript interface SqsReceiveResultFailure extends SqsReceiveResultBase ``` Receive result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `SqsFailureError` - [readonly] `messages`: `null` --- ### `SqsDeleteResultSuccess` ```typescript interface SqsDeleteResultSuccess extends SqsDeleteResultBase ``` Successful delete result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` --- ### `SqsDeleteResultError` ```typescript interface SqsDeleteResultError extends SqsDeleteResultBase ``` Delete result with SQS error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `SqsError` --- ### `SqsDeleteResultFailure` ```typescript interface SqsDeleteResultFailure extends SqsDeleteResultBase ``` Delete result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `SqsFailureError` --- ### `SqsDeleteBatchResultSuccess` ```typescript interface SqsDeleteBatchResultSuccess extends SqsDeleteBatchResultBase ``` Successful batch delete result. Note: `ok: true` even if some messages failed (partial failure). Check `failed.length > 0` to detect partial failures. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `successful`: `readonly string[]` — Array of message IDs that were successfully deleted. - [readonly] `failed`: `readonly SqsBatchFailedEntry[]` — Array of messages that failed to delete (may be non-empty even with ok: true). --- ### `SqsDeleteBatchResultError` ```typescript interface SqsDeleteBatchResultError extends SqsDeleteBatchResultBase ``` Batch delete result with SQS error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `SqsError` - [readonly] `successful`: `readonly []` - [readonly] `failed`: `readonly []` --- ### `SqsDeleteBatchResultFailure` ```typescript interface SqsDeleteBatchResultFailure extends SqsDeleteBatchResultBase ``` Batch delete result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `SqsFailureError` - [readonly] `successful`: `null` - [readonly] `failed`: `null` --- ### `SqsEnsureQueueResultSuccess` ```typescript interface SqsEnsureQueueResultSuccess extends SqsEnsureQueueResultBase ``` Successful ensure queue result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `queueUrl`: `string` — URL of the queue (existing or newly created). --- ### `SqsEnsureQueueResultError` ```typescript interface SqsEnsureQueueResultError extends SqsEnsureQueueResultBase ``` Ensure queue result with SQS error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `SqsError` - [readonly] `queueUrl`: `null` --- ### `SqsEnsureQueueResultFailure` ```typescript interface SqsEnsureQueueResultFailure extends SqsEnsureQueueResultBase ``` Ensure queue result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `SqsFailureError` - [readonly] `queueUrl`: `null` --- ### `SqsDeleteQueueResultSuccess` ```typescript interface SqsDeleteQueueResultSuccess extends SqsDeleteQueueResultBase ``` Successful delete queue result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` --- ### `SqsDeleteQueueResultError` ```typescript interface SqsDeleteQueueResultError extends SqsDeleteQueueResultBase ``` Delete queue result with SQS error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `SqsError` --- ### `SqsDeleteQueueResultFailure` ```typescript interface SqsDeleteQueueResultFailure extends SqsDeleteQueueResultBase ``` Delete queue result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `SqsFailureError` --- ## Functions ### `createSqsClient` ```typescript function createSqsClient(config: SqsClientConfig): Promise ``` Create a new Amazon SQS client instance. The client provides queue management, message publishing and consumption, batch operations, and supports both standard and FIFO queues via AWS SDK. **Parameters:** - `config`: `SqsClientConfig` — - SQS client configuration **Returns:** `Promise` A promise resolving to a new SQS client instance **Example:** Basic usage with existing queue ```ts import { createSqsClient } from "@probitas/client-sqs"; async function example() { const sqs = await createSqsClient({ region: "ap-northeast-1", queueUrl: "https://sqs.ap-northeast-1.amazonaws.com/123456789/my-queue", credentials: { accessKeyId: "test", secretAccessKey: "test" }, }); // Send a message const sendResult = await sqs.send(JSON.stringify({ type: "ORDER", orderId: "123", })); if (sendResult.ok) { console.log("Message ID:", sendResult.messageId); } else { console.error("Error:", sendResult.error.message); } await sqs.close(); } ``` Using LocalStack for local development ```ts import { createSqsClient } from "@probitas/client-sqs"; async function example() { const sqs = await createSqsClient({ region: "us-east-1", url: "http://localhost:4566", credentials: { accessKeyId: "test", secretAccessKey: "test", }, }); // Create queue dynamically (also sets queueUrl) const result = await sqs.ensureQueue("test-queue"); if (result.ok) { console.log(result.queueUrl); // http://localhost:4566/000000000000/test-queue } await sqs.close(); } ``` Receiving messages with long polling ```ts import { createSqsClient } from "@probitas/client-sqs"; async function example() { const sqs = await createSqsClient({ region: "us-east-1", url: "http://localhost:4566", credentials: { accessKeyId: "test", secretAccessKey: "test" }, }); await sqs.ensureQueue("test-queue"); // Long polling waits up to 20 seconds for messages const receiveResult = await sqs.receive({ maxMessages: 10, waitTimeSeconds: 20, visibilityTimeout: 30, }); if (receiveResult.ok) { console.log("Received:", receiveResult.messages.length); // Process and acknowledge messages for (const msg of receiveResult.messages) { const data = JSON.parse(msg.body); console.log("Processing:", data); // Delete after successful processing await sqs.delete(msg.receiptHandle); } } await sqs.close(); } ``` Batch operations for high throughput ```ts import { createSqsClient } from "@probitas/client-sqs"; async function example() { const sqs = await createSqsClient({ region: "us-east-1", url: "http://localhost:4566", credentials: { accessKeyId: "test", secretAccessKey: "test" }, }); await sqs.ensureQueue("test-queue"); // Send multiple messages in a single API call const batchResult = await sqs.sendBatch([ { id: "1", body: JSON.stringify({ event: "user.created", userId: "a1" }) }, { id: "2", body: JSON.stringify({ event: "user.created", userId: "a2" }) }, { id: "3", body: JSON.stringify({ event: "user.updated", userId: "a3" }) }, ]); if (batchResult.ok) { console.log(`Sent: ${batchResult.successful.length}`); console.log(`Failed: ${batchResult.failed.length}`); } // Batch delete processed messages const receiveResult = await sqs.receive({ maxMessages: 10 }); if (receiveResult.ok) { const handles = receiveResult.messages.map((m) => m.receiptHandle); await sqs.deleteBatch(handles); } await sqs.close(); } ``` Using `await using` for automatic cleanup ```ts import { createSqsClient } from "@probitas/client-sqs"; async function example() { await using sqs = await createSqsClient({ region: "us-east-1", url: "http://localhost:4566", credentials: { accessKeyId: "test", secretAccessKey: "test" }, }); await sqs.ensureQueue("test-queue"); await sqs.send("Hello, SQS!"); // Client automatically closed when scope exits } ``` --- ## Types ### `SqsDeleteBatchResult` ```typescript type SqsDeleteBatchResult = SqsDeleteBatchResultSuccess | SqsDeleteBatchResultError | SqsDeleteBatchResultFailure ``` Result of batch deleting messages. --- ### `SqsDeleteQueueResult` ```typescript type SqsDeleteQueueResult = SqsDeleteQueueResultSuccess | SqsDeleteQueueResultError | SqsDeleteQueueResultFailure ``` Result of deleting a queue. --- ### `SqsDeleteResult` ```typescript type SqsDeleteResult = SqsDeleteResultSuccess | SqsDeleteResultError | SqsDeleteResultFailure ``` Result of deleting a message. --- ### `SqsEnsureQueueResult` ```typescript type SqsEnsureQueueResult = SqsEnsureQueueResultSuccess | SqsEnsureQueueResultError | SqsEnsureQueueResultFailure ``` Result of ensuring a queue exists. --- ### `SqsReceiveResult` ```typescript type SqsReceiveResult = SqsReceiveResultSuccess | SqsReceiveResultError | SqsReceiveResultFailure ``` Result of receiving messages. --- ### `SqsResult` ```typescript type SqsResult = SqsSendResult | SqsSendBatchResult | SqsReceiveResult | SqsDeleteResult | SqsDeleteBatchResult | SqsEnsureQueueResult | SqsDeleteQueueResult ``` Union type of all SQS result types. --- ### `SqsSendBatchResult` ```typescript type SqsSendBatchResult = SqsSendBatchResultSuccess | SqsSendBatchResultError | SqsSendBatchResultFailure ``` Result of batch sending messages. --- ### `SqsSendResult` ```typescript type SqsSendResult = SqsSendResultSuccess | SqsSendResultError | SqsSendResultFailure ``` Result of sending a message. --- ### `SqsOperationError` ```typescript type SqsOperationError = SqsCommandError | SqsQueueNotFoundError | SqsMessageTooLargeError | SqsBatchError | SqsMessageNotFoundError | SqsError ``` Error types that indicate an operation was processed by the server. These errors occur after the operation reaches the SQS service. --- ### `SqsFailureError` ```typescript type SqsFailureError = SqsConnectionError | AbortError | TimeoutError ``` Error types that indicate the operation was not processed. These are errors that occur before the operation reaches the SQS service. --- ## Related Links ### This Package - [`SqsBatchError`](https://probitas-test.github.io/documents/api/client-sqs#SqsBatchError) - [`SqsBatchFailedEntry`](https://probitas-test.github.io/documents/api/client-sqs#SqsBatchFailedEntry) - [`SqsBatchMessage`](https://probitas-test.github.io/documents/api/client-sqs#SqsBatchMessage) - [`SqsBatchOptions`](https://probitas-test.github.io/documents/api/client-sqs#SqsBatchOptions) - [`SqsBatchSuccessEntry`](https://probitas-test.github.io/documents/api/client-sqs#SqsBatchSuccessEntry) - [`SqsClient`](https://probitas-test.github.io/documents/api/client-sqs#SqsClient) - [`SqsClientConfig`](https://probitas-test.github.io/documents/api/client-sqs#SqsClientConfig) - [`SqsCommandError`](https://probitas-test.github.io/documents/api/client-sqs#SqsCommandError) - [`SqsCommandErrorOptions`](https://probitas-test.github.io/documents/api/client-sqs#SqsCommandErrorOptions) - [`SqsConnectionConfig`](https://probitas-test.github.io/documents/api/client-sqs#SqsConnectionConfig) - [`SqsConnectionError`](https://probitas-test.github.io/documents/api/client-sqs#SqsConnectionError) - [`SqsDeleteBatchResult`](https://probitas-test.github.io/documents/api/client-sqs#SqsDeleteBatchResult) - [`SqsDeleteBatchResultError`](https://probitas-test.github.io/documents/api/client-sqs#SqsDeleteBatchResultError) - [`SqsDeleteBatchResultFailure`](https://probitas-test.github.io/documents/api/client-sqs#SqsDeleteBatchResultFailure) - [`SqsDeleteBatchResultSuccess`](https://probitas-test.github.io/documents/api/client-sqs#SqsDeleteBatchResultSuccess) - [`SqsDeleteOptions`](https://probitas-test.github.io/documents/api/client-sqs#SqsDeleteOptions) - [`SqsDeleteQueueOptions`](https://probitas-test.github.io/documents/api/client-sqs#SqsDeleteQueueOptions) - [`SqsDeleteQueueResult`](https://probitas-test.github.io/documents/api/client-sqs#SqsDeleteQueueResult) - [`SqsDeleteQueueResultError`](https://probitas-test.github.io/documents/api/client-sqs#SqsDeleteQueueResultError) - [`SqsDeleteQueueResultFailure`](https://probitas-test.github.io/documents/api/client-sqs#SqsDeleteQueueResultFailure) - [`SqsDeleteQueueResultSuccess`](https://probitas-test.github.io/documents/api/client-sqs#SqsDeleteQueueResultSuccess) - [`SqsDeleteResult`](https://probitas-test.github.io/documents/api/client-sqs#SqsDeleteResult) - [`SqsDeleteResultError`](https://probitas-test.github.io/documents/api/client-sqs#SqsDeleteResultError) - [`SqsDeleteResultFailure`](https://probitas-test.github.io/documents/api/client-sqs#SqsDeleteResultFailure) - [`SqsDeleteResultSuccess`](https://probitas-test.github.io/documents/api/client-sqs#SqsDeleteResultSuccess) - [`SqsEnsureQueueOptions`](https://probitas-test.github.io/documents/api/client-sqs#SqsEnsureQueueOptions) - [`SqsEnsureQueueResult`](https://probitas-test.github.io/documents/api/client-sqs#SqsEnsureQueueResult) - [`SqsEnsureQueueResultError`](https://probitas-test.github.io/documents/api/client-sqs#SqsEnsureQueueResultError) - [`SqsEnsureQueueResultFailure`](https://probitas-test.github.io/documents/api/client-sqs#SqsEnsureQueueResultFailure) - [`SqsEnsureQueueResultSuccess`](https://probitas-test.github.io/documents/api/client-sqs#SqsEnsureQueueResultSuccess) - [`SqsError`](https://probitas-test.github.io/documents/api/client-sqs#SqsError) - [`SqsErrorOptions`](https://probitas-test.github.io/documents/api/client-sqs#SqsErrorOptions) - [`SqsFailureError`](https://probitas-test.github.io/documents/api/client-sqs#SqsFailureError) - [`SqsMessage`](https://probitas-test.github.io/documents/api/client-sqs#SqsMessage) - [`SqsMessageAttribute`](https://probitas-test.github.io/documents/api/client-sqs#SqsMessageAttribute) - [`SqsMessageNotFoundError`](https://probitas-test.github.io/documents/api/client-sqs#SqsMessageNotFoundError) - [`SqsMessageTooLargeError`](https://probitas-test.github.io/documents/api/client-sqs#SqsMessageTooLargeError) - [`SqsOptions`](https://probitas-test.github.io/documents/api/client-sqs#SqsOptions) - [`SqsQueueNotFoundError`](https://probitas-test.github.io/documents/api/client-sqs#SqsQueueNotFoundError) - [`SqsReceiveOptions`](https://probitas-test.github.io/documents/api/client-sqs#SqsReceiveOptions) - [`SqsReceiveResult`](https://probitas-test.github.io/documents/api/client-sqs#SqsReceiveResult) - [`SqsReceiveResultError`](https://probitas-test.github.io/documents/api/client-sqs#SqsReceiveResultError) - [`SqsReceiveResultFailure`](https://probitas-test.github.io/documents/api/client-sqs#SqsReceiveResultFailure) - [`SqsReceiveResultSuccess`](https://probitas-test.github.io/documents/api/client-sqs#SqsReceiveResultSuccess) - [`SqsSendBatchResult`](https://probitas-test.github.io/documents/api/client-sqs#SqsSendBatchResult) - [`SqsSendBatchResultError`](https://probitas-test.github.io/documents/api/client-sqs#SqsSendBatchResultError) - [`SqsSendBatchResultFailure`](https://probitas-test.github.io/documents/api/client-sqs#SqsSendBatchResultFailure) - [`SqsSendBatchResultSuccess`](https://probitas-test.github.io/documents/api/client-sqs#SqsSendBatchResultSuccess) - [`SqsSendOptions`](https://probitas-test.github.io/documents/api/client-sqs#SqsSendOptions) - [`SqsSendResult`](https://probitas-test.github.io/documents/api/client-sqs#SqsSendResult) - [`SqsSendResultError`](https://probitas-test.github.io/documents/api/client-sqs#SqsSendResultError) - [`SqsSendResultFailure`](https://probitas-test.github.io/documents/api/client-sqs#SqsSendResultFailure) - [`SqsSendResultSuccess`](https://probitas-test.github.io/documents/api/client-sqs#SqsSendResultSuccess) ### Other Packages - [`AbortError`](https://probitas-test.github.io/documents/api/client#AbortError) (@probitas/client) - [`CommonConnectionConfig`](https://probitas-test.github.io/documents/api/client#CommonConnectionConfig) (@probitas/client) - [`CommonOptions`](https://probitas-test.github.io/documents/api/client#CommonOptions) (@probitas/client) - [`TimeoutError`](https://probitas-test.github.io/documents/api/client#TimeoutError) (@probitas/client) ### Built-in Types - [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) - [`Record`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type) - [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) --- *Last updated: 2026-01-12*