feat: add medusa-react (#913)

This commit is contained in:
Zakaria El Asri
2021-12-14 19:09:36 +01:00
committed by GitHub
parent 40f6e88875
commit d0d8dd7bf6
97 changed files with 22822 additions and 7595 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
import axios, { AxiosError, AxiosInstance } from "axios"
import axios, { AxiosError, AxiosInstance, AxiosRequestHeaders } from "axios"
import * as rax from "retry-axios"
import { v4 as uuidv4 } from "uuid"
@@ -108,7 +108,7 @@ class Client {
userHeaders: RequestOptions,
method: RequestMethod,
path: string
): object {
): AxiosRequestHeaders {
let defaultHeaders: object = {
Accept: "application/json",
"Content-Type": "application/json",
+10 -2
View File
@@ -1,7 +1,15 @@
import { AxiosResponse } from "axios"
export interface HTTPResponse {
status: number
statusText: string
headers: Record<string, string> & {
"set-cookie"?: string[]
}
config: any
request?: any
}
export type Response<T> = T & {
response: Omit<AxiosResponse<T>, "data">
response: HTTPResponse
}
export type ResponsePromise<T = any> = Promise<Response<T>>