///
import { ChannelCredentials, ChannelOptions, Client, ServiceDefinition } from '@grpc/grpc-js';
import { RawClient } from 'nice-grpc';
import { NormalizedServiceDefinition } from 'nice-grpc/lib/service-definitions';
import { ClientCallArgs } from './utils/client-factory';
export { ClientCallArgs } from './utils/client-factory';
export interface TokenService {
getToken: () => Promise;
}
export interface GeneratedServiceClientCtor {
service: T;
new (address: string, credentials: ChannelCredentials, options?: Partial): Client;
}
export interface IIAmCredentials {
serviceAccountId: string;
accessKeyId: string;
privateKey: Buffer | string;
}
export interface ISslCredentials {
rootCertificates?: Buffer;
clientPrivateKey?: Buffer;
clientCertChain?: Buffer;
}
export interface ChannelSslOptions {
rootCerts?: Buffer;
privateKey?: Buffer;
certChain?: Buffer;
}
export interface GenericCredentialsConfig {
pollInterval?: number;
ssl?: ChannelSslOptions;
headers?: Record;
}
/**
* @deprecated By the end of 2026, the use of oauth tokens in the Yandex cloud will be discontinued.
* Please consider to use another credentials provider.
*/
export interface OAuthCredentialsConfig extends GenericCredentialsConfig {
oauthToken: string;
}
export interface IamTokenCredentialsConfig extends GenericCredentialsConfig {
iamToken: string;
}
export interface ServiceAccountCredentialsConfig extends GenericCredentialsConfig {
serviceAccountJson: IIAmCredentials;
}
export type SessionConfig = OAuthCredentialsConfig | IamTokenCredentialsConfig | ServiceAccountCredentialsConfig | GenericCredentialsConfig;
export type WrappedServiceClientType = RawClient, ClientCallArgs>;