@cellaware/utils 4.2.0 → 4.4.0
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.
|
@@ -8,3 +8,13 @@ export declare function chatwmsFunctionStream(path: string, method: string, prin
|
|
|
8
8
|
};
|
|
9
9
|
body: import("stream").Readable;
|
|
10
10
|
}>;
|
|
11
|
+
export declare function chatwmsGatewayFunctionFetch(url: string, method: string, key: string, principal: string, body?: any): Promise<any>;
|
|
12
|
+
export declare function chatwmsGatewayFunctionFetchText(url: string, method: string, key: string, principal: string, body?: any): Promise<any>;
|
|
13
|
+
export declare function chatwmsGatewayFunctionStream(url: string, method: string, key: string, principal: string, body?: any): Promise<{
|
|
14
|
+
headers: {
|
|
15
|
+
"Content-Type": string;
|
|
16
|
+
"Cache-Control": string;
|
|
17
|
+
"Transfer-Encoding": string;
|
|
18
|
+
};
|
|
19
|
+
body: import("stream").Readable;
|
|
20
|
+
}>;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { functionFetchJson, functionFetchText, functionStreamJson } from "../../azure/function.js";
|
|
2
|
+
const STREAM_ERROR_BODY = {
|
|
3
|
+
answer: 'chatwms-unavailable-error',
|
|
4
|
+
error: 'chatwms-unavailable-error'
|
|
5
|
+
};
|
|
2
6
|
export function chatwmsFunctionFetch(path, method, principal, body) {
|
|
3
7
|
const url = `${process.env['CHATWMS_URL']}/${path}`;
|
|
4
8
|
return functionFetchJson(url, method, process.env['CHATWMS_KEY'] ?? '', principal, body);
|
|
@@ -9,9 +13,14 @@ export function chatwmsFunctionFetchText(path, method, principal, body) {
|
|
|
9
13
|
}
|
|
10
14
|
export function chatwmsFunctionStream(path, method, principal, body) {
|
|
11
15
|
const url = `${process.env['CHATWMS_URL']}/${path}`;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
return functionStreamJson(url, method, process.env['CHATWMS_KEY'] ?? '', principal, body, STREAM_ERROR_BODY);
|
|
17
|
+
}
|
|
18
|
+
export function chatwmsGatewayFunctionFetch(url, method, key, principal, body) {
|
|
19
|
+
return functionFetchJson(url, method, key, principal, body);
|
|
20
|
+
}
|
|
21
|
+
export function chatwmsGatewayFunctionFetchText(url, method, key, principal, body) {
|
|
22
|
+
return functionFetchText(url, method, key, principal, body);
|
|
23
|
+
}
|
|
24
|
+
export function chatwmsGatewayFunctionStream(url, method, key, principal, body) {
|
|
25
|
+
return functionStreamJson(url, method, key, principal, body, STREAM_ERROR_BODY);
|
|
17
26
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface ChatWMSInstance {
|
|
2
|
+
id: string;
|
|
3
|
+
clientId: string;
|
|
4
|
+
customer: string;
|
|
5
|
+
description: string;
|
|
6
|
+
url: string;
|
|
7
|
+
key: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function initChatWMSInstance(): ChatWMSInstance;
|
|
10
|
+
export interface ChatWMSInstanceWarehouse {
|
|
11
|
+
clientId: string;
|
|
12
|
+
customer: string;
|
|
13
|
+
warehouse: string;
|
|
14
|
+
instanceId: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function initChatWMSInstanceWarehouse(): ChatWMSInstanceWarehouse;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function initChatWMSInstance() {
|
|
2
|
+
return {
|
|
3
|
+
id: '',
|
|
4
|
+
clientId: '',
|
|
5
|
+
customer: '',
|
|
6
|
+
description: '',
|
|
7
|
+
url: '',
|
|
8
|
+
key: ''
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export function initChatWMSInstanceWarehouse() {
|
|
12
|
+
return {
|
|
13
|
+
clientId: '',
|
|
14
|
+
customer: '',
|
|
15
|
+
warehouse: '',
|
|
16
|
+
instanceId: ''
|
|
17
|
+
};
|
|
18
|
+
}
|