feat: add medusa-react (#913)
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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>>
|
||||
|
||||
Reference in New Issue
Block a user