zeebe-node
Version:
The Node.js client library for the Zeebe Workflow Automation Engine.
74 lines (73 loc) • 2.21 kB
TypeScript
/// <reference types="node" />
import { Client } from '@grpc/grpc-js';
import { VerifyOptions } from '@grpc/grpc-js/build/src/channel-credentials';
import { Options } from '@grpc/proto-loader';
import { EventEmitter } from 'events';
import { MaybeTimeDuration } from 'typed-duration';
import { BasicAuthConfig } from './interfaces-1.0';
import { Loglevel } from './interfaces-published-contract';
import { OAuthProvider } from './OAuthProvider';
export interface GrpcClientExtendedOptions {
longPoll?: MaybeTimeDuration;
pollInterval?: MaybeTimeDuration;
}
export declare const MiddlewareSignals: {
Log: {
Error: string;
Info: string;
Debug: string;
};
Event: {
Error: string;
Ready: string;
GrpcInterceptError: string;
};
};
export interface GrpcClientCtor {
basicAuth?: BasicAuthConfig;
connectionTolerance: MaybeTimeDuration;
host: string;
loglevel: Loglevel;
oAuth?: OAuthProvider;
options: Options & GrpcClientExtendedOptions;
packageName: string;
protoPath: string;
service: string;
namespace: string;
tasktype?: string;
useTLS: boolean;
stdout: any;
customSSL?: CustomSSL;
}
export interface CustomSSL {
rootCerts?: Buffer;
privateKey?: Buffer;
certChain?: Buffer;
verifyOptions?: VerifyOptions;
}
export declare class GrpcClient extends EventEmitter {
channelClosed: boolean;
longPoll?: MaybeTimeDuration;
connected: boolean;
client: Client;
host: string;
private closing;
private channelState;
private packageDefinition;
private listNameMethods;
private gRPCRetryCount;
private oAuth?;
private readyTimer?;
private failTimer?;
private connectionTolerance;
private basicAuth?;
constructor({ basicAuth, connectionTolerance, host, oAuth, options, packageName, protoPath, service, useTLS, customSSL, }: GrpcClientCtor);
runService(fnName: any, data: any, fnAnswer: any): void;
listMethods(): string[];
close(timeout?: number): Promise<null>;
private getAuthToken;
private waitForGrpcChannelReconnect;
private setReady;
private setNotReady;
private interceptor;
}