UNPKG

@tawk.to/nestjs-google-pubsub-microservice

Version:
47 lines (46 loc) 2.29 kB
/// <reference types="node" /> import { ClientConfig, CreateSubscriptionOptions, PubSub, Subscription, Topic } from '@google-cloud/pubsub'; import { PublishOptions } from '@google-cloud/pubsub/build/src/publisher'; import { SubscriberOptions } from '@google-cloud/pubsub/build/src/subscriber'; import { Logger } from '@nestjs/common'; import { ClientProxy, ReadPacket, WritePacket } from '@nestjs/microservices'; import { GCPubSubClientOptions } from './gc-pubsub.interface'; import { IGCPubSubParser } from './gc-pubsub.parser'; import { GCPubSubEvents } from './gc-pubsub.events'; export declare class GCPubSubClient extends ClientProxy<GCPubSubEvents> { protected readonly options: GCPubSubClientOptions; readonly clientId: string; protected readonly logger: Logger; protected readonly topicName: string; protected readonly publisherConfig: PublishOptions; protected readonly replyTopicName?: string; protected readonly replySubscriptionName?: string; protected readonly clientConfig: ClientConfig; protected readonly subscriberConfig: SubscriberOptions; protected readonly noAck: boolean; protected readonly autoResume: boolean; protected readonly createSubscriptionOptions: CreateSubscriptionOptions; protected readonly autoDeleteSubscriptionOnShutdown: boolean; protected readonly autoDeleteReplyTopicOnShutdown: boolean; protected readonly clientIdFilter: boolean; protected readonly parser: IGCPubSubParser; client: PubSub | null; replySubscription: Subscription | null; topic: Topic | null; protected init: boolean; protected readonly checkExistence: boolean; constructor(options: GCPubSubClientOptions); getRequestPattern(pattern: string): string; close(): Promise<void>; connect(): Promise<PubSub>; createClient(): PubSub; protected dispatchEvent(packet: ReadPacket): Promise<any>; protected publish(partialPacket: ReadPacket, callback: (packet: WritePacket) => void): () => boolean; protected initializeSerializer(options: GCPubSubClientOptions): void; handleResponse(message: { data: Buffer; attributes: Record<string, string>; }): Promise<boolean>; createIfNotExists(create: () => Promise<any>): Promise<void>; unwrap<T>(): T; }