UNPKG

@glowlabs-org/events-sdk

Version:

Typed event SDK for Glow, powered by RabbitMQ and Zod.

28 lines (27 loc) 1.07 kB
import type { EventVersion } from "./types"; /** * Validates that the zoneName matches the zoneId using the zoneMap. * Throws an error if the values are inconsistent. */ export declare function validateZoneNameAndId(zoneId: number, zoneName: string): void; /** * Validates the event payload against the schema for the given eventType and schemaVersion. * Throws an error if the schema does not exist or the payload is invalid. */ export declare function validateEventPayload(eventType: string, schemaVersion: EventVersion, payload: any): void; /** * Processes a message object as the listener would, validating zone and schema. * Throws if validation fails, returns the parsed event otherwise. */ export declare function processEventMessage(msg: { content: Buffer; fields: { routingKey: string; }; }): any; export declare function validateName(name: string, type: "exchange" | "queue"): void; export declare function buildAmqpUrl({ username, password, host, }: { username: string; password: string; host: string; }): string;