UNPKG

@cerbos/grpc

Version:

Client library for interacting with the Cerbos policy decision point service over gRPC from server-side Node.js applications

86 lines 4.77 kB
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { type CallOptions, type ChannelCredentials, Client, type ClientOptions, type ClientReadableStream, type ClientUnaryCall, type handleServerStreamingCall, type handleUnaryCall, type Metadata, type ServiceError, type UntypedServiceImplementation } from "@grpc/grpc-js"; export declare const protobufPackage = "grpc.health.v1"; export interface HealthCheckRequest { service: string; } export interface HealthCheckResponse { status: HealthCheckResponse_ServingStatus; } export declare enum HealthCheckResponse_ServingStatus { UNKNOWN = 0, SERVING = 1, NOT_SERVING = 2, SERVICE_UNKNOWN = 3 } export interface HealthListRequest { } export interface HealthListResponse { statuses: { [key: string]: HealthCheckResponse; }; } export interface HealthListResponse_StatusesEntry { key: string; value: HealthCheckResponse | undefined; } export declare const HealthCheckRequest: MessageFns<HealthCheckRequest>; export declare const HealthCheckResponse: MessageFns<HealthCheckResponse>; export declare const HealthListRequest: MessageFns<HealthListRequest>; export declare const HealthListResponse: MessageFns<HealthListResponse>; export declare const HealthListResponse_StatusesEntry: MessageFns<HealthListResponse_StatusesEntry>; export type HealthService = typeof HealthService; export declare const HealthService: { readonly check: { readonly path: "/grpc.health.v1.Health/Check"; readonly requestStream: false; readonly responseStream: false; readonly requestSerialize: (value: HealthCheckRequest) => Buffer; readonly requestDeserialize: (value: Buffer) => HealthCheckRequest; readonly responseSerialize: (value: HealthCheckResponse) => Buffer; readonly responseDeserialize: (value: Buffer) => HealthCheckResponse; }; readonly list: { readonly path: "/grpc.health.v1.Health/List"; readonly requestStream: false; readonly responseStream: false; readonly requestSerialize: (value: HealthListRequest) => Buffer; readonly requestDeserialize: (value: Buffer) => HealthListRequest; readonly responseSerialize: (value: HealthListResponse) => Buffer; readonly responseDeserialize: (value: Buffer) => HealthListResponse; }; readonly watch: { readonly path: "/grpc.health.v1.Health/Watch"; readonly requestStream: false; readonly responseStream: true; readonly requestSerialize: (value: HealthCheckRequest) => Buffer; readonly requestDeserialize: (value: Buffer) => HealthCheckRequest; readonly responseSerialize: (value: HealthCheckResponse) => Buffer; readonly responseDeserialize: (value: Buffer) => HealthCheckResponse; }; }; export interface HealthServer extends UntypedServiceImplementation { check: handleUnaryCall<HealthCheckRequest, HealthCheckResponse>; list: handleUnaryCall<HealthListRequest, HealthListResponse>; watch: handleServerStreamingCall<HealthCheckRequest, HealthCheckResponse>; } export interface HealthClient extends Client { check(request: HealthCheckRequest, callback: (error: ServiceError | null, response: HealthCheckResponse) => void): ClientUnaryCall; check(request: HealthCheckRequest, metadata: Metadata, callback: (error: ServiceError | null, response: HealthCheckResponse) => void): ClientUnaryCall; check(request: HealthCheckRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: HealthCheckResponse) => void): ClientUnaryCall; list(request: HealthListRequest, callback: (error: ServiceError | null, response: HealthListResponse) => void): ClientUnaryCall; list(request: HealthListRequest, metadata: Metadata, callback: (error: ServiceError | null, response: HealthListResponse) => void): ClientUnaryCall; list(request: HealthListRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: HealthListResponse) => void): ClientUnaryCall; watch(request: HealthCheckRequest, options?: Partial<CallOptions>): ClientReadableStream<HealthCheckResponse>; watch(request: HealthCheckRequest, metadata?: Metadata, options?: Partial<CallOptions>): ClientReadableStream<HealthCheckResponse>; } export declare const HealthClient: { new (address: string, credentials: ChannelCredentials, options?: Partial<ClientOptions>): HealthClient; service: typeof HealthService; serviceName: string; }; export interface MessageFns<T> { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; } //# sourceMappingURL=health.d.ts.map