@ffflorian/api-client
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [0.3.0](https://github.com/ffflorian/api-clients/tree/master/packages/api-client/compare/@ffflorian/api-client@0.2.0...@ffflorian/api-client@0.3.0) (2019-03-27) | ||
### Features | ||
* **api-client:** Add ability to send data ([#30](https://github.com/ffflorian/api-clients/tree/master/packages/api-client/issues/30)) ([318830b](https://github.com/ffflorian/api-clients/tree/master/packages/api-client/commit/318830b)) | ||
# [0.2.0](https://github.com/ffflorian/api-clients/tree/master/packages/api-client/compare/@ffflorian/api-client@0.1.0...@ffflorian/api-client@0.2.0) (2019-03-20) | ||
@@ -8,0 +19,0 @@ |
@@ -6,4 +6,4 @@ import { InjectorFn, RequestService } from './RequestService'; | ||
} | ||
export declare class APIClient { | ||
readonly requestService: RequestService; | ||
export declare class APIClient<T = any> { | ||
readonly requestService: RequestService<T>; | ||
constructor(apiUrl: string); | ||
@@ -10,0 +10,0 @@ constructor(options: ClientOptions); |
import { AxiosRequestConfig } from 'axios'; | ||
import { ClientOptions } from './APIClient'; | ||
export declare type InjectorFn = (baseConfig: AxiosRequestConfig) => AxiosRequestConfig; | ||
export declare class RequestService { | ||
export declare class RequestService<T> { | ||
private readonly config; | ||
constructor(config: ClientOptions); | ||
delete<T>(url: string, optionsOrInjector?: AxiosRequestConfig | InjectorFn): Promise<T>; | ||
get<T>(url: string, optionsOrInjector?: AxiosRequestConfig): Promise<T>; | ||
head<T>(url: string, optionsOrInjector?: AxiosRequestConfig): Promise<T>; | ||
options<T>(url: string, optionsOrInjector?: AxiosRequestConfig): Promise<T>; | ||
patch<T>(url: string, optionsOrInjector?: AxiosRequestConfig): Promise<T>; | ||
post<T>(url: string, optionsOrInjector?: AxiosRequestConfig): Promise<T>; | ||
put<T>(url: string, optionsOrInjector?: AxiosRequestConfig): Promise<T>; | ||
delete<U>(url: string, optionsOrInjector?: AxiosRequestConfig | InjectorFn): Promise<U>; | ||
get<U>(url: string, optionsOrInjector?: AxiosRequestConfig): Promise<U>; | ||
head<U>(url: string, optionsOrInjector?: AxiosRequestConfig): Promise<U>; | ||
options<U>(url: string, optionsOrInjector?: AxiosRequestConfig): Promise<U>; | ||
patch<U>(url: string, data: T, optionsOrInjector?: AxiosRequestConfig): Promise<U>; | ||
post<U>(url: string, data: T, optionsOrInjector?: AxiosRequestConfig): Promise<U>; | ||
put<U>(url: string, data: T, optionsOrInjector?: AxiosRequestConfig): Promise<U>; | ||
setApiUrl(apiUrl: string): void; | ||
@@ -15,0 +15,0 @@ private injectConfig; |
@@ -94,3 +94,3 @@ "use strict"; | ||
}; | ||
RequestService.prototype.patch = function (url, optionsOrInjector) { | ||
RequestService.prototype.patch = function (url, data, optionsOrInjector) { | ||
var config = this.injectConfig({ | ||
@@ -102,3 +102,3 @@ method: HttpMethod.PATCH, | ||
}; | ||
RequestService.prototype.post = function (url, optionsOrInjector) { | ||
RequestService.prototype.post = function (url, data, optionsOrInjector) { | ||
var config = this.injectConfig({ | ||
@@ -110,3 +110,3 @@ method: HttpMethod.POST, | ||
}; | ||
RequestService.prototype.put = function (url, optionsOrInjector) { | ||
RequestService.prototype.put = function (url, data, optionsOrInjector) { | ||
var config = this.injectConfig({ | ||
@@ -113,0 +113,0 @@ method: HttpMethod.PUT, |
@@ -29,4 +29,4 @@ { | ||
}, | ||
"version": "0.2.0", | ||
"gitHead": "9a7e982dd48c35085463807ee6ed88386c919836" | ||
"version": "0.3.0", | ||
"gitHead": "2212409acec60c1b61a1ccb558b9a89367e1314b" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25362