UNPKG

@openfga/sdk

Version:

JavaScript and Node.js SDK for OpenFGA

122 lines (121 loc) 3.14 kB
/** * JavaScript and Node.js SDK for OpenFGA * * API version: 1.x * Website: https://openfga.dev * Documentation: https://openfga.dev/docs * Support: https://openfga.dev/community * License: [Apache-2.0](https://github.com/openfga/js-sdk/blob/main/LICENSE) * * NOTE: This file was auto generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT. */ import { ApiTokenConfig, AuthCredentialsConfig, ClientCredentialsConfig, CredentialsMethod } from "./credentials/types"; import { TelemetryConfig, TelemetryConfiguration } from "./telemetry/configuration"; export interface RetryParams { maxRetry?: number; minWaitInMs?: number; } export interface UserConfigurationParams { apiUrl?: string; /** * @deprecated Replace usage of `apiScheme` + `apiHost` with `apiUrl` */ apiScheme?: string; /** * @deprecated Replace usage of `apiScheme` + `apiHost` with `apiUrl` */ apiHost?: string; credentials?: CredentialsConfig; baseOptions?: any; retryParams?: RetryParams; telemetry?: TelemetryConfig; } export declare function GetDefaultRetryParams(maxRetry?: number, minWaitInMs?: number): { maxRetry: number; minWaitInMs: number; }; interface BaseOptions { headers: Record<string, string>; } type CredentialsConfig = { method: CredentialsMethod.None | undefined; } | { method: CredentialsMethod.ApiToken; config: Pick<ApiTokenConfig, "token">; } | { method: CredentialsMethod.ClientCredentials; config: ClientCredentialsConfig; } | undefined; export declare class Configuration { /** * Defines the version of the SDK * * @private * @type {string} * @memberof Configuration */ private static sdkVersion; /** * provide the full api URL (e.g. `https://api.fga.example`) * * @type {string} * @memberof Configuration */ apiUrl: string; /** * provide scheme (e.g. `https`) * * @type {string} * @memberof Configuration * @deprecated */ apiScheme: string; /** * provide server host (e.g. `api.fga.example`) * * @type {string} * @memberof Configuration * @deprecated */ apiHost: string; /** * base options for axios calls * * @type {any} * @memberof Configuration */ baseOptions?: BaseOptions; /** * credentials configuration * * @type {AuthCredentialsConfig} * @memberof Configuration */ credentials: AuthCredentialsConfig; /** * retry options in the case of too many requests * * @type {RetryParams} * @memberof Configuration */ retryParams?: RetryParams; /** * telemetry configuration * * @type {TelemetryConfiguration} * @memberof Configuration */ telemetry: TelemetryConfiguration; constructor(params?: UserConfigurationParams); /** * * @return {boolean} * @throws {FgaValidationError} */ isValid(): boolean; /** * Returns the API base path (apiScheme+apiHost) */ getBasePath: () => string; } export {};