UNPKG

kubemq-js

Version:

kubemq js/ts library for KubeMQ Message Broker

76 lines 2.35 kB
import { BaseMessage } from '../client/KubeMQClient'; import * as pb from '../protos'; import * as grpc from '@grpc/grpc-js'; import { CQClient } from './CQClient'; export interface CommandsMessage extends BaseMessage { timeout?: number; } export declare class CommandMessageReceived { /** * Unique identifier for the received command message. */ id: string; /** * The client ID from which the command message was sent. */ fromClientId: string; /** * The timestamp when the command message was received. */ timestamp: Date; /** * The channel from which the command message was received. */ channel: string; /** * Metadata associated with the received command message. */ metadata: string; /** * Body of the received command message in bytes. */ body: Uint8Array | string; /** * Reply channel associated with the received command message. */ replyChannel: string; /** * Tags associated with the received command message as key-value pairs. */ tags: Map<string, string>; /** * Constructor to initialize the fields. */ constructor(); /** * Decodes a protocol buffer request into a CommandMessageReceived instance. * * @param commandReceive The protocol buffer request to decode. * @return The decoded CommandMessageReceived instance. */ static decode(commandReceive: pb.kubemq.Request): CommandMessageReceived; } export declare class CommandsSubscriptionRequest { channel: string; group?: string; onReceiveEventCallback?: (event: CommandMessageReceived) => 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: CommandMessageReceived): void; raiseOnError(errorMsg: string): void; cancel(): void; reconnect(cqClient: CQClient, reconnectIntervalSeconds: number): void; } export interface CommandsResponse { id: string; replyChannel?: string; clientId: string; timestamp: number; executed: boolean; error: string; } //# sourceMappingURL=commandTypes.d.ts.map