@authzed/authzed-node
Version:
authzed client for nodejs
43 lines (42 loc) • 2.6 kB
text/typescript
// @generated by protobuf-ts 2.9.1 with parameter generate_dependencies,long_type_string,client_grpc1
// @generated from protobuf file "authzed/api/v1/watch_service.proto" (package "authzed.api.v1", syntax proto3)
// tslint:disable
import { WatchService } from "./watch_service.js";
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
import type { WatchResponse } from "./watch_service.js";
import type { WatchRequest } from "./watch_service.js";
import * as grpc from "@grpc/grpc-js";
/**
* @generated from protobuf service authzed.api.v1.WatchService
*/
export interface IWatchServiceClient {
/**
* Watch returns a stream of events that occurred in the datastore in ascending timestamp order.
* The events can be relationship updates, schema updates, or checkpoints.
*
* @generated from protobuf rpc: Watch(authzed.api.v1.WatchRequest) returns (stream authzed.api.v1.WatchResponse);
*/
watch(input: WatchRequest, metadata?: grpc.Metadata, options?: grpc.CallOptions): grpc.ClientReadableStream<WatchResponse>;
watch(input: WatchRequest, options?: grpc.CallOptions): grpc.ClientReadableStream<WatchResponse>;
}
/**
* @generated from protobuf service authzed.api.v1.WatchService
*/
export class WatchServiceClient extends grpc.Client implements IWatchServiceClient {
private readonly _binaryOptions: Partial<BinaryReadOptions & BinaryWriteOptions>;
constructor(address: string, credentials: grpc.ChannelCredentials, options: grpc.ClientOptions = {}, binaryOptions: Partial<BinaryReadOptions & BinaryWriteOptions> = {}) {
super(address, credentials, options);
this._binaryOptions = binaryOptions;
}
/**
* Watch returns a stream of events that occurred in the datastore in ascending timestamp order.
* The events can be relationship updates, schema updates, or checkpoints.
*
* @generated from protobuf rpc: Watch(authzed.api.v1.WatchRequest) returns (stream authzed.api.v1.WatchResponse);
*/
watch(input: WatchRequest, metadata?: grpc.Metadata | grpc.CallOptions, options?: grpc.CallOptions): grpc.ClientReadableStream<WatchResponse> {
const method = WatchService.methods[0];
return this.makeServerStreamRequest<WatchRequest, WatchResponse>(`/${WatchService.typeName}/${method.name}`, (value: WatchRequest): Buffer => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value: Buffer): WatchResponse => method.O.fromBinary(value, this._binaryOptions), input, (metadata as any), options);
}
}