@openfga/sdk
Version:
JavaScript and Node.js SDK for OpenFGA
67 lines (66 loc) • 1.98 kB
TypeScript
/**
* 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 { AxiosInstance, AxiosRequestConfig, AxiosResponse } from "axios";
import { Configuration } from "./configuration";
import type { Credentials } from "./credentials";
/**
*
* @export
*/
export declare const DUMMY_BASE_URL = "https://example.com";
/**
*
* @export
* @interface RequestArgs
*/
export interface RequestArgs {
url: string;
options: any;
}
/**
*
* @export
*/
export declare const setBearerAuthToObject: (object: any, credentials: Credentials) => Promise<void>;
/**
*
* @export
*/
export declare const setSearchParams: (url: URL, ...objects: any[]) => void;
/**
*
* @export
*/
export declare const serializeDataIfNeeded: (value: any, requestOptions: any) => any;
/**
*
* @export
*/
export declare const toPathString: (url: URL) => string;
type ObjectOrVoid = object | void;
export type CallResult<T extends ObjectOrVoid> = T & {
$response: AxiosResponse<T>;
};
export type PromiseResult<T extends ObjectOrVoid> = Promise<CallResult<T>>;
interface WrappedAxiosResponse<R> {
response?: AxiosResponse<R>;
retries: number;
}
export declare function attemptHttpRequest<B, R>(request: AxiosRequestConfig<B>, config: {
maxRetry: number;
minWaitInMs: number;
}, axiosInstance: AxiosInstance): Promise<WrappedAxiosResponse<R> | undefined>;
/**
* creates an axios request function
*/
export declare const createRequestFunction: (axiosArgs: RequestArgs, axiosInstance: AxiosInstance, configuration: Configuration, credentials: Credentials, methodAttributes?: Record<string, string | number>) => (axios?: AxiosInstance) => PromiseResult<any>;
export {};