@tinybirdco/mockingbird
Version:
214 lines • 8.08 kB
TypeScript
import amqp from "amqplib";
import { z } from "zod";
import { Row } from "../types";
import { BaseGenerator } from "./BaseGenerator";
declare const rabbitmqConfigSchema: z.ZodObject<z.objectUtil.extendShape<{
schema: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{
type: z.ZodString;
params: z.ZodOptional<z.ZodAny>;
count: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
type: string;
count?: number | undefined;
params?: any;
}, {
type: string;
count?: number | undefined;
params?: any;
}>>, Record<string, {
type: string;
count?: number | undefined;
params?: any;
}>, Record<string, {
type: string;
count?: number | undefined;
params?: any;
}>>;
eps: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
logs: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
}, {
endpoint: z.ZodString;
queue: z.ZodString;
assertQueueOptions: z.ZodOptional<z.ZodObject<{
exclusive: z.ZodOptional<z.ZodBoolean>;
durable: z.ZodOptional<z.ZodBoolean>;
autoDelete: z.ZodOptional<z.ZodBoolean>;
arguments: z.ZodOptional<z.ZodAny>;
messageTtl: z.ZodOptional<z.ZodNumber>;
expires: z.ZodOptional<z.ZodNumber>;
deadLetterExchange: z.ZodOptional<z.ZodString>;
deadLetterRoutingKey: z.ZodOptional<z.ZodString>;
maxLength: z.ZodOptional<z.ZodNumber>;
maxPriority: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
exclusive?: boolean | undefined;
durable?: boolean | undefined;
autoDelete?: boolean | undefined;
arguments?: any;
messageTtl?: number | undefined;
expires?: number | undefined;
deadLetterExchange?: string | undefined;
deadLetterRoutingKey?: string | undefined;
maxLength?: number | undefined;
maxPriority?: number | undefined;
}, {
exclusive?: boolean | undefined;
durable?: boolean | undefined;
autoDelete?: boolean | undefined;
arguments?: any;
messageTtl?: number | undefined;
expires?: number | undefined;
deadLetterExchange?: string | undefined;
deadLetterRoutingKey?: string | undefined;
maxLength?: number | undefined;
maxPriority?: number | undefined;
}>>;
publishOptions: z.ZodOptional<z.ZodObject<{
expiration: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
userId: z.ZodOptional<z.ZodString>;
CC: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
mandatory: z.ZodOptional<z.ZodBoolean>;
persistent: z.ZodOptional<z.ZodBoolean>;
deliveryMode: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNumber]>>;
BCC: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
contentType: z.ZodOptional<z.ZodString>;
contentEncoding: z.ZodOptional<z.ZodString>;
headers: z.ZodOptional<z.ZodAny>;
priority: z.ZodOptional<z.ZodNumber>;
correlationId: z.ZodOptional<z.ZodString>;
replyTo: z.ZodOptional<z.ZodString>;
messageId: z.ZodOptional<z.ZodString>;
timestamp: z.ZodOptional<z.ZodNumber>;
type: z.ZodOptional<z.ZodString>;
appId: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
type?: string | undefined;
timestamp?: number | undefined;
userId?: string | undefined;
headers?: any;
expiration?: string | number | undefined;
CC?: string | string[] | undefined;
mandatory?: boolean | undefined;
persistent?: boolean | undefined;
deliveryMode?: number | boolean | undefined;
BCC?: string | string[] | undefined;
contentType?: string | undefined;
contentEncoding?: string | undefined;
priority?: number | undefined;
correlationId?: string | undefined;
replyTo?: string | undefined;
messageId?: string | undefined;
appId?: string | undefined;
}, {
type?: string | undefined;
timestamp?: number | undefined;
userId?: string | undefined;
headers?: any;
expiration?: string | number | undefined;
CC?: string | string[] | undefined;
mandatory?: boolean | undefined;
persistent?: boolean | undefined;
deliveryMode?: number | boolean | undefined;
BCC?: string | string[] | undefined;
contentType?: string | undefined;
contentEncoding?: string | undefined;
priority?: number | undefined;
correlationId?: string | undefined;
replyTo?: string | undefined;
messageId?: string | undefined;
appId?: string | undefined;
}>>;
}>, "strip", z.ZodTypeAny, {
schema: Record<string, {
type: string;
count?: number | undefined;
params?: any;
}>;
eps: number;
limit: number;
endpoint: string;
queue: string;
logs?: boolean | undefined;
assertQueueOptions?: {
exclusive?: boolean | undefined;
durable?: boolean | undefined;
autoDelete?: boolean | undefined;
arguments?: any;
messageTtl?: number | undefined;
expires?: number | undefined;
deadLetterExchange?: string | undefined;
deadLetterRoutingKey?: string | undefined;
maxLength?: number | undefined;
maxPriority?: number | undefined;
} | undefined;
publishOptions?: {
type?: string | undefined;
timestamp?: number | undefined;
userId?: string | undefined;
headers?: any;
expiration?: string | number | undefined;
CC?: string | string[] | undefined;
mandatory?: boolean | undefined;
persistent?: boolean | undefined;
deliveryMode?: number | boolean | undefined;
BCC?: string | string[] | undefined;
contentType?: string | undefined;
contentEncoding?: string | undefined;
priority?: number | undefined;
correlationId?: string | undefined;
replyTo?: string | undefined;
messageId?: string | undefined;
appId?: string | undefined;
} | undefined;
}, {
schema: Record<string, {
type: string;
count?: number | undefined;
params?: any;
}>;
endpoint: string;
queue: string;
eps?: number | undefined;
limit?: number | undefined;
logs?: boolean | undefined;
assertQueueOptions?: {
exclusive?: boolean | undefined;
durable?: boolean | undefined;
autoDelete?: boolean | undefined;
arguments?: any;
messageTtl?: number | undefined;
expires?: number | undefined;
deadLetterExchange?: string | undefined;
deadLetterRoutingKey?: string | undefined;
maxLength?: number | undefined;
maxPriority?: number | undefined;
} | undefined;
publishOptions?: {
type?: string | undefined;
timestamp?: number | undefined;
userId?: string | undefined;
headers?: any;
expiration?: string | number | undefined;
CC?: string | string[] | undefined;
mandatory?: boolean | undefined;
persistent?: boolean | undefined;
deliveryMode?: number | boolean | undefined;
BCC?: string | string[] | undefined;
contentType?: string | undefined;
contentEncoding?: string | undefined;
priority?: number | undefined;
correlationId?: string | undefined;
replyTo?: string | undefined;
messageId?: string | undefined;
appId?: string | undefined;
} | undefined;
}>;
export type RabbitMQConfig = z.infer<typeof rabbitmqConfigSchema>;
export declare class RabbitMQGenerator extends BaseGenerator<RabbitMQConfig> {
connection: amqp.Connection | undefined;
constructor(config: RabbitMQConfig);
sendData(rows: Row[]): Promise<void>;
}
export {};
//# sourceMappingURL=RabbitMQGenerator.d.ts.map