@spree/storefront-api-v2-sdk
Version:
Node module to easily integrate your JavaScript or TypeScript application with Spree API V2. You can create an entirely custom Storefront in JS/TS with this package including one page checkout, Single Page Apps, PWAs and so on
19 lines (18 loc) • 800 B
TypeScript
import { AxiosInstance, Method } from 'axios';
import { JsonApiResponse } from './interfaces/JsonApi';
import { ResultResponse } from './interfaces/ResultResponse';
import { IToken } from './interfaces/Token';
export default class Http {
host: string;
axios: AxiosInstance;
constructor(host?: string);
protected spreeResponse<ResponseType = JsonApiResponse>(method: Method, url: string, tokens?: IToken, params?: any): Promise<ResultResponse<ResponseType>>;
/**
* HTTP error code returned by Spree is not indicative of its response shape. This function attempts to figure out the
* information provided from Spree and use whatever is available.
*/
private classifyError;
private processError;
private processSpreeError;
private spreeOrderHeaders;
}