quidproquo-core 0.0.55 → 0.0.56
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.
|
@@ -2,11 +2,13 @@ export declare enum NetworkActionType {
|
|
|
2
2
|
Request = "@quidproquo-core/Network/Request"
|
|
3
3
|
}
|
|
4
4
|
export type HTTPMethod = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'PATCH';
|
|
5
|
+
export type ResponseTypes = 'arraybuffer' | 'base64' | 'json';
|
|
5
6
|
export interface HTTPRequestOptions<T> {
|
|
6
7
|
basePath?: string;
|
|
7
8
|
params?: Record<string, string>;
|
|
8
9
|
headers?: Record<string, string>;
|
|
9
10
|
body?: T;
|
|
11
|
+
responseType: ResponseTypes;
|
|
10
12
|
}
|
|
11
13
|
export interface HTTPNetworkResponse<T> {
|
|
12
14
|
data: T;
|
|
@@ -12,6 +12,7 @@ function* askNetworkRequest(method, url, httpRequestOptions) {
|
|
|
12
12
|
headers: httpRequestOptions === null || httpRequestOptions === void 0 ? void 0 : httpRequestOptions.headers,
|
|
13
13
|
basePath: httpRequestOptions === null || httpRequestOptions === void 0 ? void 0 : httpRequestOptions.basePath,
|
|
14
14
|
params: httpRequestOptions === null || httpRequestOptions === void 0 ? void 0 : httpRequestOptions.params,
|
|
15
|
+
responseType: (httpRequestOptions === null || httpRequestOptions === void 0 ? void 0 : httpRequestOptions.responseType) || 'json',
|
|
15
16
|
},
|
|
16
17
|
};
|
|
17
18
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
|
-
import { NetworkActionType, HTTPNetworkResponse, HTTPMethod } from './NetworkActionType';
|
|
2
|
+
import { NetworkActionType, HTTPNetworkResponse, HTTPMethod, ResponseTypes } from './NetworkActionType';
|
|
3
3
|
export interface NetworkRequestActionPayload<T> {
|
|
4
4
|
url: string;
|
|
5
5
|
method: HTTPMethod;
|
|
@@ -7,6 +7,7 @@ export interface NetworkRequestActionPayload<T> {
|
|
|
7
7
|
basePath?: string;
|
|
8
8
|
params?: Record<string, string>;
|
|
9
9
|
headers?: Record<string, string>;
|
|
10
|
+
responseType: ResponseTypes;
|
|
10
11
|
}
|
|
11
12
|
export interface NetworkRequestAction<T> extends Action<NetworkRequestActionPayload<T>> {
|
|
12
13
|
type: NetworkActionType.Request;
|