@authzed/authzed-node
Version:
authzed client for nodejs
29 lines (28 loc) • 1.26 kB
TypeScript
import * as grpc from "@grpc/grpc-js";
export declare enum ClientSecurity {
SECURE = 0,
INSECURE_LOCALHOST_ALLOWED = 1,
INSECURE_PLAINTEXT_CREDENTIALS = 2
}
export declare enum PreconnectServices {
NONE = 0,
PERMISSIONS_SERVICE = 1,
SCHEMA_SERVICE = 2,
WATCH_SERVICE = 4,
EXPERIMENTAL_SERVICE = 8,
WATCH_PERMISSIONS_SERVICE = 9,
WATCH_PERMISSIONSETS_SERVICE = 10
}
declare function createClientCreds(endpoint: string, token: string, security?: ClientSecurity): grpc.ChannelCredentials;
declare function createClientCredsWithCustomCert(token: string, certificate: Buffer): grpc.ChannelCredentials;
declare function promisifyStream<P1, P2, P3>(fn: (req: P1) => grpc.ClientReadableStream<P2>, bind: P3): (req: P1) => Promise<P2[]>;
export declare function deadlineInterceptor(timeoutInMS: number): grpc.Interceptor;
declare const authzedEndpoint = "grpc.authzed.com:443";
export { createClientCreds, createClientCredsWithCustomCert, authzedEndpoint, promisifyStream, };
declare const _default: {
createClientCreds: typeof createClientCreds;
createClientCredsWithCustomCert: typeof createClientCredsWithCustomCert;
authzedEndpoint: string;
promisifyStream: typeof promisifyStream;
};
export default _default;