@vercel/queue
Advanced tools
+68
-1
@@ -759,2 +759,69 @@ /** | ||
| /** | ||
| * Options for {@link registerDevConsumer}. | ||
| */ | ||
| interface RegisterDevConsumerOptions { | ||
| /** | ||
| * Topic name to subscribe to. Supports wildcard patterns (e.g. `"user-*"`). | ||
| */ | ||
| topic: string; | ||
| /** | ||
| * The QueueClient instance used for callback processing (visibility | ||
| * extensions, acks, etc.). Messages delivered to the handler are fetched | ||
| * via this client. | ||
| */ | ||
| client: QueueClient; | ||
| /** | ||
| * Function invoked with each message delivered to the topic. | ||
| */ | ||
| handler: MessageHandler; | ||
| /** | ||
| * Logical identifier for this consumer. Multiple consumers for the same | ||
| * topic must use distinct groups; re-registering with the same group | ||
| * replaces the previous handler (useful for HMR). | ||
| * | ||
| * @default "dev-consumer" | ||
| */ | ||
| consumerGroup?: string; | ||
| /** | ||
| * Lock duration for in-flight messages. Forwarded to `coreHandleCallback`. | ||
| */ | ||
| visibilityTimeoutSeconds?: number; | ||
| /** | ||
| * Called when the handler throws. Return `{ afterSeconds: N }` to schedule | ||
| * local re-delivery, or `{ acknowledge: true }` to drop the message. | ||
| */ | ||
| retry?: RetryHandler; | ||
| } | ||
| /** | ||
| * Register a consumer for a topic without relying on `vercel.json` route | ||
| * discovery or stack-trace-based caller detection. | ||
| * | ||
| * Intended for framework integrations (e.g. Nitro) where queue handlers are | ||
| * wired through a central dispatcher rather than per-file `handleCallback()` | ||
| * calls. The caller supplies the topic and a handler; `send()` in dev mode | ||
| * will route messages through it via the same retry/re-delivery machinery | ||
| * used for file-discovered handlers. | ||
| * | ||
| * Call only when `isDevMode()` is true. In production this has no effect on | ||
| * routing — messages are delivered by the Vercel Queue Service directly. | ||
| * | ||
| * @returns An unregister function. Calling it removes the handler that this | ||
| * call registered; if the entry was replaced (via re-registration with the | ||
| * same `consumerGroup`), the unregister is a no-op. | ||
| * | ||
| * @example | ||
| * ```ts | ||
| * const unregister = registerDevConsumer({ | ||
| * topic: "orders", | ||
| * client, | ||
| * handler: async (message, metadata) => { | ||
| * await dispatch(message, metadata); | ||
| * }, | ||
| * consumerGroup: "nitro-vercel-queue", | ||
| * }); | ||
| * ``` | ||
| */ | ||
| declare function registerDevConsumer(options: RegisterDevConsumerOptions): () => void; | ||
| /** | ||
| * Core queue callback utilities for handling incoming webhook payloads | ||
@@ -832,2 +899,2 @@ * from Vercel triggers using the CloudEvent specification. | ||
| export { BadRequestError, type BaseUrlResolver, BufferTransport, CLOUD_EVENT_TYPE_V1BETA, CLOUD_EVENT_TYPE_V2BETA, ConsumerDiscoveryError, ConsumerRegistryNotConfiguredError, DuplicateMessageError, ForbiddenError, InternalServerError, InvalidLimitError, JsonTransport, type Message, MessageAlreadyProcessedError, MessageCorruptedError, type MessageHandler, MessageLockedError, type MessageMetadata, MessageNotAvailableError, MessageNotFoundError, type ParsedCallbackRequest, type ParsedCallbackV1, type ParsedCallbackV2, PollingQueueClient, type PollingQueueClientOptions, QueueClient, type QueueClientOptions, QueueEmptyError, type ReceiveBatchOptions, type ReceiveByIdOptions, type ReceiveOptions, type ReceiveResult, type RetryDirective, type RetryHandler, type SendOptions, type SendResult, StreamTransport, type Transport, UnauthorizedError, type VercelRegion, handleCallback, parseCallback, parseRawCallback, send }; | ||
| export { BadRequestError, type BaseUrlResolver, BufferTransport, CLOUD_EVENT_TYPE_V1BETA, CLOUD_EVENT_TYPE_V2BETA, ConsumerDiscoveryError, ConsumerRegistryNotConfiguredError, DuplicateMessageError, ForbiddenError, InternalServerError, InvalidLimitError, JsonTransport, type Message, MessageAlreadyProcessedError, MessageCorruptedError, type MessageHandler, MessageLockedError, type MessageMetadata, MessageNotAvailableError, MessageNotFoundError, type ParsedCallbackRequest, type ParsedCallbackV1, type ParsedCallbackV2, PollingQueueClient, type PollingQueueClientOptions, QueueClient, type QueueClientOptions, QueueEmptyError, type ReceiveBatchOptions, type ReceiveByIdOptions, type ReceiveOptions, type ReceiveResult, type RegisterDevConsumerOptions, type RetryDirective, type RetryHandler, type SendOptions, type SendResult, StreamTransport, type Transport, UnauthorizedError, type VercelRegion, handleCallback, parseCallback, parseRawCallback, registerDevConsumer, send }; |
+68
-1
@@ -759,2 +759,69 @@ /** | ||
| /** | ||
| * Options for {@link registerDevConsumer}. | ||
| */ | ||
| interface RegisterDevConsumerOptions { | ||
| /** | ||
| * Topic name to subscribe to. Supports wildcard patterns (e.g. `"user-*"`). | ||
| */ | ||
| topic: string; | ||
| /** | ||
| * The QueueClient instance used for callback processing (visibility | ||
| * extensions, acks, etc.). Messages delivered to the handler are fetched | ||
| * via this client. | ||
| */ | ||
| client: QueueClient; | ||
| /** | ||
| * Function invoked with each message delivered to the topic. | ||
| */ | ||
| handler: MessageHandler; | ||
| /** | ||
| * Logical identifier for this consumer. Multiple consumers for the same | ||
| * topic must use distinct groups; re-registering with the same group | ||
| * replaces the previous handler (useful for HMR). | ||
| * | ||
| * @default "dev-consumer" | ||
| */ | ||
| consumerGroup?: string; | ||
| /** | ||
| * Lock duration for in-flight messages. Forwarded to `coreHandleCallback`. | ||
| */ | ||
| visibilityTimeoutSeconds?: number; | ||
| /** | ||
| * Called when the handler throws. Return `{ afterSeconds: N }` to schedule | ||
| * local re-delivery, or `{ acknowledge: true }` to drop the message. | ||
| */ | ||
| retry?: RetryHandler; | ||
| } | ||
| /** | ||
| * Register a consumer for a topic without relying on `vercel.json` route | ||
| * discovery or stack-trace-based caller detection. | ||
| * | ||
| * Intended for framework integrations (e.g. Nitro) where queue handlers are | ||
| * wired through a central dispatcher rather than per-file `handleCallback()` | ||
| * calls. The caller supplies the topic and a handler; `send()` in dev mode | ||
| * will route messages through it via the same retry/re-delivery machinery | ||
| * used for file-discovered handlers. | ||
| * | ||
| * Call only when `isDevMode()` is true. In production this has no effect on | ||
| * routing — messages are delivered by the Vercel Queue Service directly. | ||
| * | ||
| * @returns An unregister function. Calling it removes the handler that this | ||
| * call registered; if the entry was replaced (via re-registration with the | ||
| * same `consumerGroup`), the unregister is a no-op. | ||
| * | ||
| * @example | ||
| * ```ts | ||
| * const unregister = registerDevConsumer({ | ||
| * topic: "orders", | ||
| * client, | ||
| * handler: async (message, metadata) => { | ||
| * await dispatch(message, metadata); | ||
| * }, | ||
| * consumerGroup: "nitro-vercel-queue", | ||
| * }); | ||
| * ``` | ||
| */ | ||
| declare function registerDevConsumer(options: RegisterDevConsumerOptions): () => void; | ||
| /** | ||
| * Core queue callback utilities for handling incoming webhook payloads | ||
@@ -832,2 +899,2 @@ * from Vercel triggers using the CloudEvent specification. | ||
| export { BadRequestError, type BaseUrlResolver, BufferTransport, CLOUD_EVENT_TYPE_V1BETA, CLOUD_EVENT_TYPE_V2BETA, ConsumerDiscoveryError, ConsumerRegistryNotConfiguredError, DuplicateMessageError, ForbiddenError, InternalServerError, InvalidLimitError, JsonTransport, type Message, MessageAlreadyProcessedError, MessageCorruptedError, type MessageHandler, MessageLockedError, type MessageMetadata, MessageNotAvailableError, MessageNotFoundError, type ParsedCallbackRequest, type ParsedCallbackV1, type ParsedCallbackV2, PollingQueueClient, type PollingQueueClientOptions, QueueClient, type QueueClientOptions, QueueEmptyError, type ReceiveBatchOptions, type ReceiveByIdOptions, type ReceiveOptions, type ReceiveResult, type RetryDirective, type RetryHandler, type SendOptions, type SendResult, StreamTransport, type Transport, UnauthorizedError, type VercelRegion, handleCallback, parseCallback, parseRawCallback, send }; | ||
| export { BadRequestError, type BaseUrlResolver, BufferTransport, CLOUD_EVENT_TYPE_V1BETA, CLOUD_EVENT_TYPE_V2BETA, ConsumerDiscoveryError, ConsumerRegistryNotConfiguredError, DuplicateMessageError, ForbiddenError, InternalServerError, InvalidLimitError, JsonTransport, type Message, MessageAlreadyProcessedError, MessageCorruptedError, type MessageHandler, MessageLockedError, type MessageMetadata, MessageNotAvailableError, MessageNotFoundError, type ParsedCallbackRequest, type ParsedCallbackV1, type ParsedCallbackV2, PollingQueueClient, type PollingQueueClientOptions, QueueClient, type QueueClientOptions, QueueEmptyError, type ReceiveBatchOptions, type ReceiveByIdOptions, type ReceiveOptions, type ReceiveResult, type RegisterDevConsumerOptions, type RetryDirective, type RetryHandler, type SendOptions, type SendResult, StreamTransport, type Transport, UnauthorizedError, type VercelRegion, handleCallback, parseCallback, parseRawCallback, registerDevConsumer, send }; |
+1
-1
| { | ||
| "name": "@vercel/queue", | ||
| "version": "0.1.7", | ||
| "version": "0.2.0", | ||
| "publishConfig": { | ||
@@ -5,0 +5,0 @@ "access": "public" |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
615870
2.57%5552
2.68%