UNPKG

kubemq-js

Version:

kubemq js/ts library for KubeMQ Message Broker

81 lines 2.46 kB
import { BaseMessage } from '../client/KubeMQClient'; import * as pb from '../protos'; import * as grpc from '@grpc/grpc-js'; import { CQClient } from './CQClient'; export interface QueriesMessage extends BaseMessage { timeout?: number; cacheKey?: string; cacheTTL?: number; } export declare class QueryMessageReceived { /** * Unique identifier for the received query message. */ id: string; /** * The client ID from which the query message was sent. */ fromClientId: string; /** * The timestamp when the query message was received. */ timestamp: Date; /** * The channel from which the query message was received. */ channel: string; /** * Metadata associated with the received query message. */ metadata: string; /** * Body of the received query message in bytes. */ body: Uint8Array | string; /** * Reply channel associated with the received query message. */ replyChannel: string; /** * Tags associated with the received query message as key-value pairs. */ tags: Map<string, string>; /** * Constructor to initialize the fields with default values. */ constructor(); /** * Decodes a protocol buffer request into a QueryMessageReceived instance. * * @param queryReceive The protocol buffer request to decode. * @return The decoded QueryMessageReceived instance. */ static decode(queryReceive: pb.kubemq.Request): QueryMessageReceived; } export declare class QueriesSubscriptionRequest { channel: string; group?: string; onReceiveEventCallback?: (event: QueryMessageReceived) => void; onErrorCallback?: (error: string) => void; observer?: grpc.ClientReadableStream<pb.kubemq.Request>; isReconnecting: boolean; constructor(channel: string, group?: string); validate(): void; encode(cqClient: CQClient): pb.kubemq.Subscribe; raiseOnReceiveMessage(event: QueryMessageReceived): void; raiseOnError(errorMsg: string): void; cancel(): void; reconnect(cqClient: CQClient, reconnectIntervalSeconds: number): void; } export interface QueriesResponse { id: string; replyChannel?: string; clientId: string; timestamp: number; executed: boolean; error: string; metadata?: string; body?: Uint8Array | string; tags?: Map<string, string>; } //# sourceMappingURL=queryTypes.d.ts.map