@graffy/client 0.15.19-alpha.2 → 0.15.20
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/index.cjs +6 -2
- package/index.mjs +6 -2
- package/package.json +3 -3
- package/types/httpClient.d.ts +13 -3
package/index.cjs
CHANGED
|
@@ -60,8 +60,12 @@ function makeQuery(url, query) {
|
|
|
60
60
|
aggregateQueries[url] = new AggregateQuery(url);
|
|
61
61
|
return aggregateQueries[url].add(query);
|
|
62
62
|
}
|
|
63
|
-
const httpClient = (baseUrl, {
|
|
64
|
-
|
|
63
|
+
const httpClient = (baseUrl, {
|
|
64
|
+
getOptions = async () => {
|
|
65
|
+
},
|
|
66
|
+
watch = "sse",
|
|
67
|
+
connInfoPath = "connection"
|
|
68
|
+
} = {}) => (store) => {
|
|
65
69
|
store.onWrite(connInfoPath, ({ url }) => {
|
|
66
70
|
baseUrl = url;
|
|
67
71
|
return { url };
|
package/index.mjs
CHANGED
|
@@ -55,8 +55,12 @@ function makeQuery(url, query) {
|
|
|
55
55
|
aggregateQueries[url] = new AggregateQuery(url);
|
|
56
56
|
return aggregateQueries[url].add(query);
|
|
57
57
|
}
|
|
58
|
-
const httpClient = (baseUrl, {
|
|
59
|
-
|
|
58
|
+
const httpClient = (baseUrl, {
|
|
59
|
+
getOptions = async () => {
|
|
60
|
+
},
|
|
61
|
+
watch = "sse",
|
|
62
|
+
connInfoPath = "connection"
|
|
63
|
+
} = {}) => (store) => {
|
|
60
64
|
store.onWrite(connInfoPath, ({ url }) => {
|
|
61
65
|
baseUrl = url;
|
|
62
66
|
return { url };
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graffy/client",
|
|
3
3
|
"description": "Graffy client library for the browser, usin the `fetch()` or `WebSocket` APIs. This module is intended to be used with a Node.js server running Graffy Server.",
|
|
4
4
|
"author": "aravind (https://github.com/aravindet)",
|
|
5
|
-
"version": "0.15.
|
|
5
|
+
"version": "0.15.20",
|
|
6
6
|
"main": "./index.cjs",
|
|
7
7
|
"exports": {
|
|
8
8
|
"import": "./index.mjs",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
},
|
|
17
17
|
"license": "Apache-2.0",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@graffy/
|
|
20
|
-
"@graffy/
|
|
19
|
+
"@graffy/common": "0.15.20",
|
|
20
|
+
"@graffy/stream": "0.15.20",
|
|
21
21
|
"debug": "^4.3.3"
|
|
22
22
|
}
|
|
23
23
|
}
|
package/types/httpClient.d.ts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
export default httpClient;
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param {string} baseUrl
|
|
5
|
+
* @param {{
|
|
6
|
+
* getOptions?: () => Promise<void>,
|
|
7
|
+
* watch?: 'sse' | 'none' | 'hang',
|
|
8
|
+
* connInfoPath?: string,
|
|
9
|
+
* } | undefined} options
|
|
10
|
+
* @returns {(store: any) => void}
|
|
11
|
+
*/
|
|
12
|
+
declare function httpClient(baseUrl: string, { getOptions, watch, connInfoPath, }?: {
|
|
3
13
|
getOptions?: () => Promise<void>;
|
|
4
|
-
watch
|
|
14
|
+
watch?: 'sse' | 'none' | 'hang';
|
|
5
15
|
connInfoPath?: string;
|
|
6
|
-
}): (store: any) => void;
|
|
16
|
+
} | undefined): (store: any) => void;
|