dce-reactkit 3.9.0 → 3.9.1
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.
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/helpers/visitEndpointOnAnotherServer/index.d.ts +2 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/helpers/visitEndpointOnAnotherServer/index.d.ts +2 -0
- package/dist/index.d.ts +2 -0
- package/package.json +1 -1
- package/src/helpers/visitEndpointOnAnotherServer/index.ts +3 -0
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* dce-reactkit [for server only]
|
|
4
4
|
* @author Gabe Abrams
|
|
5
5
|
* @param opts object containing all arguments
|
|
6
|
+
* @param opts.host - the host of the other server
|
|
6
7
|
* @param opts.path - the path of the other server's endpoint
|
|
7
8
|
* @param [opts.method=GET] - the method of the endpoint
|
|
8
9
|
* @param [opts.params] - query/body parameters to include
|
|
@@ -10,6 +11,7 @@
|
|
|
10
11
|
* @returns response from server
|
|
11
12
|
*/
|
|
12
13
|
declare const visitEndpointOnAnotherServer: (opts: {
|
|
14
|
+
host: string;
|
|
13
15
|
path: string;
|
|
14
16
|
method?: "GET" | "POST" | "DELETE" | "PUT" | undefined;
|
|
15
17
|
params?: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1608,6 +1608,7 @@ declare const shuffleArray: <T>(arr: T[]) => T[];
|
|
|
1608
1608
|
* dce-reactkit [for server only]
|
|
1609
1609
|
* @author Gabe Abrams
|
|
1610
1610
|
* @param opts object containing all arguments
|
|
1611
|
+
* @param opts.host - the host of the other server
|
|
1611
1612
|
* @param opts.path - the path of the other server's endpoint
|
|
1612
1613
|
* @param [opts.method=GET] - the method of the endpoint
|
|
1613
1614
|
* @param [opts.params] - query/body parameters to include
|
|
@@ -1615,6 +1616,7 @@ declare const shuffleArray: <T>(arr: T[]) => T[];
|
|
|
1615
1616
|
* @returns response from server
|
|
1616
1617
|
*/
|
|
1617
1618
|
declare const visitEndpointOnAnotherServer: (opts: {
|
|
1619
|
+
host: string;
|
|
1618
1620
|
path: string;
|
|
1619
1621
|
method?: "GET" | "POST" | "DELETE" | "PUT" | undefined;
|
|
1620
1622
|
params?: {
|
package/package.json
CHANGED
|
@@ -12,6 +12,7 @@ import sendServerToServerRequest from './sendServerToServerRequest';
|
|
|
12
12
|
* dce-reactkit [for server only]
|
|
13
13
|
* @author Gabe Abrams
|
|
14
14
|
* @param opts object containing all arguments
|
|
15
|
+
* @param opts.host - the host of the other server
|
|
15
16
|
* @param opts.path - the path of the other server's endpoint
|
|
16
17
|
* @param [opts.method=GET] - the method of the endpoint
|
|
17
18
|
* @param [opts.params] - query/body parameters to include
|
|
@@ -20,6 +21,7 @@ import sendServerToServerRequest from './sendServerToServerRequest';
|
|
|
20
21
|
*/
|
|
21
22
|
const visitEndpointOnAnotherServer = async (
|
|
22
23
|
opts: {
|
|
24
|
+
host: string,
|
|
23
25
|
path: string,
|
|
24
26
|
method?: ('GET' | 'POST' | 'DELETE' | 'PUT'),
|
|
25
27
|
params?: { [key in string]: any },
|
|
@@ -54,6 +56,7 @@ const visitEndpointOnAnotherServer = async (
|
|
|
54
56
|
|
|
55
57
|
// Send the request
|
|
56
58
|
const response = await sendServerToServerRequest({
|
|
59
|
+
host: opts.host,
|
|
57
60
|
path: opts.path,
|
|
58
61
|
method: opts.method ?? 'GET',
|
|
59
62
|
params,
|