@cellaware/utils 3.2.21 → 3.2.22

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,9 +1,19 @@
1
1
  import { Readable } from "stream";
2
2
  export declare function functionStream(url: string, req: any, errorBody: any): Promise<{
3
+ headers: {
4
+ "Content-Type": string;
5
+ "Cache-Control": string;
6
+ "Transfer-Encoding": string;
7
+ };
3
8
  body: Readable;
4
9
  }>;
5
10
  export declare function functionFetchJson(url: string, method: string, key: string, body?: any): Promise<any>;
6
11
  export declare function functionFetchText(url: string, method: string, key: string, text: string): Promise<any>;
7
12
  export declare function functionStreamJson(url: string, method: string, key: string, body: any, errorBody: any): Promise<{
13
+ headers: {
14
+ "Content-Type": string;
15
+ "Cache-Control": string;
16
+ "Transfer-Encoding": string;
17
+ };
8
18
  body: Readable;
9
19
  }>;
@@ -51,7 +51,14 @@ export async function functionStream(url, req, errorBody) {
51
51
  stream.push(JSON.stringify(errorBody));
52
52
  stream.push(null);
53
53
  });
54
- return { body: stream };
54
+ return {
55
+ headers: {
56
+ "Content-Type": "text/event-stream",
57
+ "Cache-Control": "no-cache",
58
+ "Transfer-Encoding": "chunked"
59
+ },
60
+ body: stream
61
+ };
55
62
  }
56
63
  export async function functionFetchJson(url, method, key, body) {
57
64
  const headers = {
@@ -84,7 +91,7 @@ export async function functionFetchText(url, method, key, text) {
84
91
  export async function functionStreamJson(url, method, key, body, errorBody) {
85
92
  const headers = {
86
93
  'Content-Type': 'application/json',
87
- 'Accept': 'application/json',
94
+ 'Accept': 'text/event-stream',
88
95
  'x-functions-key': key
89
96
  };
90
97
  let req = {
@@ -1,5 +1,10 @@
1
1
  export declare function chatwmsFunctionFetch(path: string, method: string, body?: any): Promise<any>;
2
2
  export declare function chatwmsFunctionQuery(path: string, method: string, query: string): Promise<any>;
3
3
  export declare function chatwmsFunctionStream(path: string, method: string, body?: any): Promise<{
4
+ headers: {
5
+ "Content-Type": string;
6
+ "Cache-Control": string;
7
+ "Transfer-Encoding": string;
8
+ };
4
9
  body: import("stream").Readable;
5
10
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cellaware/utils",
3
- "version": "3.2.21",
3
+ "version": "3.2.22",
4
4
  "description": "Cellaware Utilities for Node.js",
5
5
  "author": "Cellaware Technologies",
6
6
  "type": "module",