import { a as NotificationMessage } from "../packem_shared/notification.d-D0ado_cy.js"; import { Q as QueueJob, N as NotificationQueue } from "../packem_shared/types.d-r8K0ICyx.js"; import "../packem_shared/types.d-CRs03TYV.js"; import "../packem_shared/types.d-C7l7qdMG.js"; import "../packem_shared/provider.d-Dh32nRm9.js"; /** * A single SQS message, narrowed to the members this adapter reads. */ interface SqsMessageLike { Attributes?: Record; Body?: string; ReceiptHandle?: string; } /** * The subset of the high-level `@aws-sdk/client-sqs` `SQS` operations this adapter uses. The `SQS` * class exposes these operation methods directly (unlike the command-based `SQSClient.send`), keeping * the adapter mockable with plain method stubs and avoiding an import of the optional peer. */ interface SqsClientLike { changeMessageVisibility: (input: { QueueUrl: string; ReceiptHandle: string; VisibilityTimeout: number; }) => Promise; deleteMessage: (input: { QueueUrl: string; ReceiptHandle: string; }) => Promise; getQueueAttributes: (input: { AttributeNames: string[]; QueueUrl: string; }) => Promise<{ Attributes?: Record; }>; receiveMessage: (input: { AttributeNames?: string[]; MaxNumberOfMessages?: number; QueueUrl: string; VisibilityTimeout?: number; WaitTimeSeconds?: number; }) => Promise<{ Messages?: SqsMessageLike[]; }>; sendMessage: (input: { DelaySeconds?: number; MessageBody: string; QueueUrl: string; }) => Promise<{ MessageId?: string; }>; } /** * Options for {@link createSqsQueue}. */ interface SqsQueueOptions { /** The SQS queue URL. */ queueUrl: string; /** Visibility timeout (seconds) applied when reserving a message (default 30). */ visibilityTimeout?: number; /** Long-poll wait time (seconds) for `reserve` (default 0). */ waitTimeSeconds?: number; } /** * A {@link NotificationQueue} backed by Amazon SQS, which maps natively onto the reserve/ack/retry * model (ReceiveMessage / DeleteMessage / ChangeMessageVisibility). * * Pass an `@aws-sdk/client-sqs` `SQS` instance — it is an optional peer dependency and is never * constructed here. The reserved job `id` is the SQS `ReceiptHandle`. `scheduledAt` is honored up to * the SQS 15-minute delay limit. * * Runtime: NODE ONLY (depends on the AWS SDK). Not Cloudflare Workers compatible. */ declare class SqsQueue implements NotificationQueue { #private; constructor(client: SqsClientLike, options: SqsQueueOptions); enqueue(message: NotificationMessage, options?: { scheduledAt?: number; }): Promise; reserve(): Promise; ack(id: string): Promise; retry(id: string, delayMs?: number): Promise; size(): Promise; } /** * Convenience factory for {@link SqsQueue}. * @param client An `@aws-sdk/client-sqs` `SQS` instance (optional peer). * @param options Queue options. See {@link SqsQueueOptions}. * @returns A new {@link SqsQueue}. */ declare const createSqsQueue: (client: SqsClientLike, options: SqsQueueOptions) => SqsQueue; export { type SqsClientLike, type SqsMessageLike, SqsQueue, SqsQueueOptions, createSqsQueue };