@trustpayments/http-client 2.0.635 → 2.0.637

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,6 @@
1
+ export interface IHttpClientConfig {
2
+ headers?: Record<string, string>;
3
+ timeout?: number;
4
+ signal?: AbortSignal;
5
+ }
6
+ export type IHttpResponseHeader = Record<string, string>;
@@ -0,0 +1,8 @@
1
+ import { IHttpClientConfig, IHttpResponseHeader } from './IHttpClientConfig';
2
+ export interface IHttpClientResponse<T = unknown> {
3
+ data: T;
4
+ status: number;
5
+ statusText: string;
6
+ headers: IHttpResponseHeader;
7
+ config: IHttpClientConfig;
8
+ }
@@ -1,32 +1,15 @@
1
- import { Observable } from 'rxjs';
2
-
3
- declare class HttpClient {
4
- get$<T>(url: string, config?: IHttpClientConfig): Observable<IHttpClientResponse<T>>;
5
- post$<T, TD = undefined>(url: string, data?: TD, config?: IHttpClientConfig): Observable<IHttpClientResponse<T>>;
6
- put$<T, TD = undefined>(url: string, data?: TD, config?: IHttpClientConfig): Observable<IHttpClientResponse<T>>;
7
- patch$<T, TD = undefined>(url: string, data?: TD, config?: IHttpClientConfig): Observable<IHttpClientResponse<T>>;
8
- delete$<T>(url: string, config?: IHttpClientConfig): Observable<IHttpClientResponse<T>>;
9
- private fetchRequest;
10
- private mapFetchResponseToHttpClientResponse;
11
- private createAxiosLikeError;
12
- }
13
- export { HttpClient }
14
- export default HttpClient;
15
-
16
- export declare interface IHttpClientConfig {
17
- headers?: Record<string, string>;
18
- timeout?: number;
19
- signal?: AbortSignal;
20
- }
21
-
22
- export declare interface IHttpClientResponse<T = unknown> {
23
- data: T;
24
- status: number;
25
- statusText: string;
26
- headers: IHttpResponseHeader;
27
- config: IHttpClientConfig;
28
- }
29
-
30
- declare type IHttpResponseHeader = Record<string, string>;
31
-
32
- export { }
1
+ import { Observable } from 'rxjs';
2
+ import { IHttpClientConfig } from './IHttpClientConfig';
3
+ import { IHttpClientResponse } from './IHttpClientResponse';
4
+ declare class HttpClient {
5
+ get$<T>(url: string, config?: IHttpClientConfig): Observable<IHttpClientResponse<T>>;
6
+ post$<T, TD = undefined>(url: string, data?: TD, config?: IHttpClientConfig): Observable<IHttpClientResponse<T>>;
7
+ put$<T, TD = undefined>(url: string, data?: TD, config?: IHttpClientConfig): Observable<IHttpClientResponse<T>>;
8
+ patch$<T, TD = undefined>(url: string, data?: TD, config?: IHttpClientConfig): Observable<IHttpClientResponse<T>>;
9
+ delete$<T>(url: string, config?: IHttpClientConfig): Observable<IHttpClientResponse<T>>;
10
+ private fetchRequest;
11
+ private mapFetchResponseToHttpClientResponse;
12
+ private createAxiosLikeError;
13
+ }
14
+ export { HttpClient, IHttpClientConfig, IHttpClientResponse };
15
+ export default HttpClient;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trustpayments/http-client",
3
- "version": "2.0.635",
3
+ "version": "2.0.637",
4
4
  "description": "Generic http client",
5
5
  "author": "Trust Payments <support@trustpayments.com>",
6
6
  "homepage": "https://docs.trustpayments.com",
@@ -41,5 +41,5 @@
41
41
  "test": "vitest run",
42
42
  "type-check": "tsc --noEmit"
43
43
  },
44
- "gitHead": "9b07b760b1bee74cdf18aacbbb1c2480aa0ba733"
44
+ "gitHead": "c9b0df79c0a451ddf599a18cce1c31e95f8d9aff"
45
45
  }