Constructors
constructor
- new ApiClient(__namedParameters?: { adapter: AxiosAdapter; baseURL: string; dateAttrs: string[]; headers: {}; protectedAttrs: string[]; throttleThreshold: number; timeout: number; useCache: boolean; useThrottle: boolean; pagination: object }): ApiClient
-
Parameters
-
Default value __namedParameters: { adapter: AxiosAdapter; baseURL: string; dateAttrs: string[]; headers: {}; protectedAttrs: string[]; throttleThreshold: number; timeout: number; useCache: boolean; useThrottle: boolean; pagination: object } = {}
-
adapter: AxiosAdapter
-
baseURL: string
-
dateAttrs: string[]
-
headers: {}
-
protectedAttrs: string[]
-
throttleThreshold: number
-
timeout: number
-
useCache: boolean
-
useThrottle: boolean
-
pagination: object
-
size: number
-
totals: true
-
type: string
Properties
axios
axios: AxiosInstance
dateAttrs
dateAttrs: string[]
jsonPatchHeaders
jsonPatchHeaders: Object
protectedAttrs
protectedAttrs: string[]
Methods
createRelationship
- createRelationship(type: string, id: string, relationshipType: string, data: NormalizedResourceOrResources, headers?: undefined | object): Promise<AxiosResponse<any>>
-
Parameters
-
type: string
-
id: string
-
relationshipType: string
-
-
Optional headers: undefined | object
Returns Promise<AxiosResponse<any>>
delete
- delete(url: string, data?: undefined | object, headers?: undefined | object): Promise<any>
-
Parameters
-
url: string
-
Optional data: undefined | object
-
Optional headers: undefined | object
Returns Promise<any>
getHeaders
- getHeaders(headers?: undefined | object, jsonPatch?: undefined | false | true): Object & object
-
Parameters
-
Optional headers: undefined | object
-
Optional jsonPatch: undefined | false | true
Returns Object & object
getOptions
- getOptions(__namedParameters?: { dateAttrs: string[]; idRequired: boolean; protectedAttrs: string[] }): { dateAttrs: never[]; idRequired: boolean; protectedAttrs: never[] }
-
Parameters
-
Default value __namedParameters: { dateAttrs: string[]; idRequired: boolean; protectedAttrs: string[] } = {} as SerializeOptions
-
dateAttrs: string[]
-
idRequired: boolean
-
protectedAttrs: string[]
Returns { dateAttrs: never[]; idRequired: boolean; protectedAttrs: never[] }
-
dateAttrs: never[]
-
idRequired: boolean
-
protectedAttrs: never[]
mutate
- mutate(url: string, op: OperationType, path: string, data: NormalizedResource[], headers?: undefined | object): Promise<(null | { id: string; type: string } | { errors: Error[] })[]>
-
Parameters
-
url: string
-
-
path: string
-
-
Optional headers: undefined | object
Returns Promise<(null | { id: string; type: string } | { errors: Error[] })[]>
patch
- patch(url: string, data: object, headers?: undefined | object, jsonPatch?: undefined | false | true): Promise<AxiosResponse<any>>
-
Parameters
-
url: string
-
data: object
-
Optional headers: undefined | object
-
Optional jsonPatch: undefined | false | true
Returns Promise<AxiosResponse<any>>
post
- post(url: string, data: object, headers?: undefined | object): Promise<AxiosResponse<any>>
-
Parameters
-
url: string
-
data: object
-
Optional headers: undefined | object
Returns Promise<AxiosResponse<any>>
remove
- remove(type: string, id: string | number, headers?: undefined | object): Promise<any>
-
Parameters
-
type: string
-
id: string | number
-
Optional headers: undefined | object
Returns Promise<any>
removeRelationship
- removeRelationship(type: string, id: string, relationshipType: string, data: NormalizedResourceOrResources, headers?: undefined | object): Promise<any>
-
Parameters
-
type: string
-
id: string
-
relationshipType: string
-
-
Optional headers: undefined | object
Returns Promise<any>