UNPKG

grpc-js-reflection-client

Version:

Package use Grpc reflection api to download grpc proto descriptor. Now you don't have to add proto file to each package. Simple direct download proto package from example microservice without any files.

24 lines (23 loc) 1.29 kB
import * as grpc from '@grpc/grpc-js'; import { Descriptor } from "./Descriptor"; import { GetAllExtensionNumbersOfType } from "./Types"; import { ListMethodsType } from "./Types/ListMethodsType"; export declare class GrpcReflection { private client; private version; private reflectionRequestConstructor; constructor(host: string, credentials: any, options?: grpc.ChannelOptions, version?: string); listServices(prefix?: string, options?: grpc.CallOptions): Promise<Array<string>>; listMethods(service: string, options?: grpc.CallOptions): Promise<Array<ListMethodsType>>; protected generateServicePath(service: string): Array<string>; getServiceMethods(descriptor: grpc.GrpcObject, service: string): Array<ListMethodsType>; getDescriptorByFileName(file_name: string, options?: grpc.CallOptions): Promise<Descriptor>; getDescriptorBySymbol(symbol: string, options?: grpc.CallOptions): Promise<Descriptor>; getAllExtensionNumbersOfType(package_type: string, options?: grpc.CallOptions): Promise<GetAllExtensionNumbersOfType>; private request; private resolveFileDescriptorSet; private resolveDescriptorRecursive; private getProtoDescriptorBySymbol; private getProtoDescriptorByFileName; private setProtoReflectionClient; }