@message-queue-toolkit/core
Version:
Useful utilities, interfaces and base classes for message queue handling. Supports AMQP and SQS with a common abstraction on top currently
33 lines (32 loc) • 1.45 kB
TypeScript
import { z } from 'zod/v4';
/**
* Multi-store payload reference schema.
* Contains information about where and how the payload was stored.
*/
export declare const PAYLOAD_REF_SCHEMA: z.ZodObject<{
id: z.ZodString;
store: z.ZodString;
size: z.ZodNumber;
}, z.core.$strip>;
export type PayloadRef = z.output<typeof PAYLOAD_REF_SCHEMA>;
/**
* When the payload is too large to be sent in a single message, it is offloaded to a storage service and a pointer to the offloaded payload is sent instead.
* This schema represents the reference to the payload that is sent in place of the original payload.
*
* The schema supports two formats:
* 1. New format, payloadRef object with id, store, and size
* 2. Old format, offloadedPayloadPointer and offloadedPayloadSize (for backward compatibility)
*
* At least one format must be present in the message.
*/
export declare const OFFLOADED_PAYLOAD_POINTER_PAYLOAD_SCHEMA: z.ZodObject<{
payloadRef: z.ZodOptional<z.ZodObject<{
id: z.ZodString;
store: z.ZodString;
size: z.ZodNumber;
}, z.core.$strip>>;
offloadedPayloadPointer: z.ZodOptional<z.ZodString>;
offloadedPayloadSize: z.ZodOptional<z.ZodNumber>;
}, z.core.$loose>;
export type OffloadedPayloadPointerPayload = z.output<typeof OFFLOADED_PAYLOAD_POINTER_PAYLOAD_SCHEMA>;
export declare function isOffloadedPayloadPointerPayload(value: unknown): value is OffloadedPayloadPointerPayload;