@forklaunch/universal-sdk
Version:
Cross runtime fetch library for forklaunch router sdks
38 lines • 1.58 kB
TypeScript
import Ajv from 'ajv';
import { ResponseContentParserType } from './types/contentTypes.types';
import { RegistryOptions, RequestType, ResponseType } from './types/sdk.types';
/**
* A class representing the Forklaunch SDK.
*/
export declare class UniversalSdk {
private host;
private ajv;
private registryOptions;
private contentTypeParserMap;
private registryOpenApiJson;
private registryOpenApiHash;
private sdkPathMap;
constructor(host: string, ajv: Ajv, registryOptions: RegistryOptions, contentTypeParserMap: Record<string, ResponseContentParserType> | undefined);
/**
* Creates an instance of UniversalSdk.
*
* @param {string} host - The host URL for the SDK.
*/
static create(host: string, registryOptions: RegistryOptions, contentTypeParserMap?: Record<string, ResponseContentParserType>): Promise<UniversalSdk>;
executeFetchCall(path: string, request?: RequestType & {
method: 'get' | 'post' | 'put' | 'patch' | 'delete' | 'options' | 'head' | 'trace';
} & {
version?: string;
}): Promise<ResponseType>;
executeSdkCall(sdkPath: string, request?: RequestType): Promise<ResponseType>;
/**
* Executes an HTTP request.
*
* @param {string} route - The route path for the request.
* @param {'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'} method - The HTTP method.
* @param {RequestType} [request] - The request object.
* @returns {Promise<ResponseType>} - The response object.
*/
private execute;
}
//# sourceMappingURL=universalSdk.d.ts.map