@agnostack/requestd
Version:
Please contact agnoStack via info@agnostack.com for any questions
27 lines (26 loc) • 1.89 kB
TypeScript
import { Fetch, Headers, Options, InitOptions, ObjectType, AuthorizedRequestOptions, ResponseWrapper, RequestOptions, RequestClient, AuthenticateObjectType, CryptoImplementation, CryptoConfig } from './types';
export declare abstract class AbstractClient implements RequestClient {
private checkVerb;
private clientType;
private application;
private storageKey;
private sharedSecret;
private storage;
private highWaterMark;
fetch: Fetch;
crypto: CryptoImplementation;
options: Options;
constructor(options: InitOptions);
abstract authenticate(options: AuthenticateObjectType): Promise<ObjectType>;
initializeCrypto(config: CryptoConfig): Promise<CryptoImplementation>;
unAuthenticate(): void;
request({ path, wrapped, authorization, basePath: _basePath, method: _method, headers: requestHeaders, data: requestData, options: { uriType, }, }: AuthorizedRequestOptions): Promise<ResponseWrapper>;
authorizedRequest(requestOptions: RequestOptions): Promise<ResponseWrapper>;
head(path: string, wrapped?: boolean, headers?: Headers, options?: ObjectType): Promise<ResponseWrapper>;
get(path: string, wrapped?: boolean, headers?: Headers, options?: ObjectType): Promise<ResponseWrapper>;
put(path: string, data: ObjectType, wrapped?: boolean, headers?: Headers, options?: ObjectType): Promise<ResponseWrapper>;
post(path: string, data: ObjectType, wrapped?: boolean, headers?: Headers, options?: ObjectType): Promise<ResponseWrapper>;
patch(path: string, data: ObjectType, wrapped?: boolean, headers?: Headers, options?: ObjectType): Promise<ResponseWrapper>;
delete(path: string, data?: ObjectType, wrapped?: boolean, headers?: Headers, options?: ObjectType): Promise<ResponseWrapper>;
query(data: ObjectType, wrapped?: boolean, headers?: Headers, options?: ObjectType): Promise<ResponseWrapper>;
}