@azure-net/kit 0.6.6 → 0.6.7
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare enum AppLayers {
|
|
2
|
-
INFRASTRUCTURE = "
|
|
3
|
-
DOMAIN = "
|
|
4
|
-
APPLICATION = "
|
|
5
|
-
PRESENTATION = "
|
|
2
|
+
INFRASTRUCTURE = "Infrastructure",
|
|
3
|
+
DOMAIN = "Domain",
|
|
4
|
+
APPLICATION = "Application",
|
|
5
|
+
PRESENTATION = "Presentation"
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export var AppLayers;
|
|
2
2
|
(function (AppLayers) {
|
|
3
|
-
AppLayers["INFRASTRUCTURE"] = "
|
|
4
|
-
AppLayers["DOMAIN"] = "
|
|
5
|
-
AppLayers["APPLICATION"] = "
|
|
6
|
-
AppLayers["PRESENTATION"] = "
|
|
3
|
+
AppLayers["INFRASTRUCTURE"] = "Infrastructure";
|
|
4
|
+
AppLayers["DOMAIN"] = "Domain";
|
|
5
|
+
AppLayers["APPLICATION"] = "Application";
|
|
6
|
+
AppLayers["PRESENTATION"] = "Presentation";
|
|
7
7
|
})(AppLayers || (AppLayers = {}));
|
|
@@ -1,33 +1,35 @@
|
|
|
1
1
|
import { HttpService, HttpServiceResponse } from '../httpService/HttpService.js';
|
|
2
2
|
import { QueryBuilder } from '../query/index.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
export interface IDatasource {
|
|
4
|
+
/**
|
|
5
|
+
* Executes a wrapped HTTP request and handles the response.
|
|
6
|
+
*
|
|
7
|
+
* @param callback - A function that receives the HttpService and returns a Promise of a response.
|
|
8
|
+
* @returns A typed HTTP response wrapped in a Promise.
|
|
9
|
+
*/
|
|
10
|
+
createRequest<T>(callback: <J = T>(params: {
|
|
8
11
|
http: HttpService;
|
|
9
12
|
query: QueryBuilder;
|
|
10
|
-
}) => Promise<HttpServiceResponse<J>>): Promise<HttpServiceResponse<
|
|
13
|
+
}) => Promise<HttpServiceResponse<J>>): Promise<HttpServiceResponse<T>>;
|
|
11
14
|
createRawRequest<T>(callback: (params: {
|
|
12
15
|
http: HttpService;
|
|
13
16
|
query: QueryBuilder;
|
|
14
17
|
}) => Promise<HttpServiceResponse<T>>): Promise<HttpServiceResponse<T>>;
|
|
15
18
|
}
|
|
16
|
-
export declare class BaseHttpDatasource
|
|
19
|
+
export declare class BaseHttpDatasource implements IDatasource {
|
|
17
20
|
protected readonly httpClient: HttpService;
|
|
18
21
|
protected readonly query: QueryBuilder;
|
|
19
22
|
constructor(params: {
|
|
20
23
|
http?: HttpService;
|
|
21
24
|
query?: QueryBuilder;
|
|
22
25
|
});
|
|
23
|
-
createRequest<T>(callback: <J =
|
|
26
|
+
createRequest<T>(callback: <J = T>(params: {
|
|
24
27
|
http: HttpService;
|
|
25
28
|
query: QueryBuilder;
|
|
26
|
-
}) => Promise<HttpServiceResponse<J>>): Promise<HttpServiceResponse<
|
|
29
|
+
}) => Promise<HttpServiceResponse<J>>): Promise<HttpServiceResponse<T>>;
|
|
27
30
|
private _createRawRequest;
|
|
28
31
|
readonly createRawRequest: <T>(callback: (params: {
|
|
29
32
|
http: HttpService;
|
|
30
33
|
query: QueryBuilder;
|
|
31
34
|
}) => Promise<HttpServiceResponse<T>>) => Promise<HttpServiceResponse<T>>;
|
|
32
35
|
}
|
|
33
|
-
export {};
|