@cellaware/utils 5.0.0 → 5.0.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/azure/function.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Readable } from "stream";
|
|
|
2
2
|
export declare const AZURE_HEADER_FUNCTION_KEY = "x-functions-key";
|
|
3
3
|
export declare const AZURE_HEADER_PRINCIPAL = "x-ms-client-principal";
|
|
4
4
|
export declare function functionFetchJson(url: string, method: string, key: string, principal: string, body?: any): Promise<any>;
|
|
5
|
+
export declare function functionFetchJsonWithText(url: string, method: string, key: string, principal: string, text: string): Promise<any>;
|
|
5
6
|
export declare function functionFetchText(url: string, method: string, key: string, principal: string, body?: any): Promise<any>;
|
|
6
7
|
export declare function functionStreamJson(url: string, method: string, key: string, principal: string, body: any, errorBody: any): Promise<{
|
|
7
8
|
headers: {
|
package/dist/azure/function.js
CHANGED
|
@@ -78,6 +78,20 @@ export async function functionFetchJson(url, method, key, principal, body) {
|
|
|
78
78
|
}
|
|
79
79
|
return functionFetch(url, req);
|
|
80
80
|
}
|
|
81
|
+
export async function functionFetchJsonWithText(url, method, key, principal, text) {
|
|
82
|
+
const headers = {
|
|
83
|
+
'Content-Type': 'application/json',
|
|
84
|
+
'Accept': 'application/json',
|
|
85
|
+
'x-functions-key': key,
|
|
86
|
+
'x-ms-client-principal': principal
|
|
87
|
+
};
|
|
88
|
+
let req = {
|
|
89
|
+
method,
|
|
90
|
+
headers,
|
|
91
|
+
body: text
|
|
92
|
+
};
|
|
93
|
+
return functionFetch(url, req);
|
|
94
|
+
}
|
|
81
95
|
export async function functionFetchText(url, method, key, principal, body) {
|
|
82
96
|
const headers = {
|
|
83
97
|
'Content-Type': 'application/json',
|
|
@@ -9,6 +9,7 @@ export declare function chatwmsFunctionStream(path: string, method: string, prin
|
|
|
9
9
|
body: import("stream").Readable;
|
|
10
10
|
}>;
|
|
11
11
|
export declare function chatwmsGatewayFunctionFetch(url: string, method: string, key: string, principal: string, body?: any): Promise<any>;
|
|
12
|
+
export declare function chatwmsGatewayFunctionFetchWithText(url: string, method: string, key: string, principal: string, text: string): Promise<any>;
|
|
12
13
|
export declare function chatwmsGatewayFunctionFetchText(url: string, method: string, key: string, principal: string, body?: any): Promise<any>;
|
|
13
14
|
export declare function chatwmsGatewayFunctionStream(url: string, method: string, key: string, principal: string, body?: any): Promise<{
|
|
14
15
|
headers: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { functionFetchJson, functionFetchText, functionStreamJson } from "../../azure/function.js";
|
|
1
|
+
import { functionFetchJson, functionFetchJsonWithText, functionFetchText, functionStreamJson } from "../../azure/function.js";
|
|
2
2
|
const STREAM_ERROR_BODY = {
|
|
3
3
|
answer: 'chatwms-unavailable-error',
|
|
4
4
|
error: 'chatwms-unavailable-error'
|
|
@@ -18,6 +18,9 @@ export function chatwmsFunctionStream(path, method, principal, body) {
|
|
|
18
18
|
export function chatwmsGatewayFunctionFetch(url, method, key, principal, body) {
|
|
19
19
|
return functionFetchJson(url, method, key, principal, body);
|
|
20
20
|
}
|
|
21
|
+
export function chatwmsGatewayFunctionFetchWithText(url, method, key, principal, text) {
|
|
22
|
+
return functionFetchJsonWithText(url, method, key, principal, text);
|
|
23
|
+
}
|
|
21
24
|
export function chatwmsGatewayFunctionFetchText(url, method, key, principal, body) {
|
|
22
25
|
return functionFetchText(url, method, key, principal, body);
|
|
23
26
|
}
|