@camunda8/sdk
Version:
[](https://www.npmjs.com/package/@camunda8/sdk)
74 lines (73 loc) • 2.2 kB
TypeScript
import { EventEmitter } from 'events';
import { Client, VerifyOptions } from '@grpc/grpc-js';
import { Options } from '@grpc/proto-loader';
import { MaybeTimeDuration } from 'typed-duration';
import { CamundaPlatform8Configuration } from '../../lib';
import { IHeadersProvider } from '../../oauth';
import { Loglevel, ZBCustomLogger } from './interfaces-published-contract';
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 {
config: CamundaPlatform8Configuration;
connectionTolerance: MaybeTimeDuration;
host: string;
loglevel: Loglevel;
oAuth?: IHeadersProvider;
options: Options & GrpcClientExtendedOptions;
packageName: string;
protoPath: string;
service: string;
namespace: string;
tasktype?: string;
useTLS: boolean;
stdout: ZBCustomLogger;
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 userAgentString;
private config;
private useTLS;
constructor({ config, connectionTolerance, host, oAuth, options, packageName, protoPath, service, useTLS, customSSL, }: GrpcClientCtor);
runService(fnName: any, data: any, fnAnswer: any): void;
listMethods(): string[];
close(timeout?: number): Promise<void>;
private getAuthToken;
private waitForGrpcChannelReconnect;
private setReady;
private setNotReady;
private interceptor;
}