@opengeoweb/api 10.2.1-spike-ol.3 → 11.1.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.
- package/index.esm.js +9 -5
- package/package.json +4 -35
- package/src/utils.d.ts +2 -2
package/index.esm.js
CHANGED
|
@@ -339,7 +339,9 @@ var getHeaders = function getHeaders(auth) {
|
|
|
339
339
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
340
340
|
var handleResponse = function handleResponse(response) {
|
|
341
341
|
if (response.status === 200) {
|
|
342
|
-
return response.json()
|
|
342
|
+
return response.json().then(function (json) {
|
|
343
|
+
return json || response.headers;
|
|
344
|
+
});
|
|
343
345
|
}
|
|
344
346
|
return response.json()["catch"](function () {
|
|
345
347
|
// Couldn't parse the JSON
|
|
@@ -381,11 +383,13 @@ var optimisticUpdate = function optimisticUpdate(updatedQueryKey, queryClient, _
|
|
|
381
383
|
queryKey: updatedQueryKey
|
|
382
384
|
});
|
|
383
385
|
oldData = queryClient.getQueryData(updatedQueryKey);
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
return
|
|
386
|
+
if (variables.id) {
|
|
387
|
+
queryClient.setQueryData(updatedQueryKey, function (old) {
|
|
388
|
+
return old == null ? void 0 : old.map(function (item) {
|
|
389
|
+
return item.id === variables.id ? _optimisticUpdate(item, variables) : item;
|
|
390
|
+
});
|
|
387
391
|
});
|
|
388
|
-
}
|
|
392
|
+
}
|
|
389
393
|
return _context.abrupt("return", {
|
|
390
394
|
oldData: oldData
|
|
391
395
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/api",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.1.0",
|
|
4
4
|
"description": "GeoWeb API library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -8,40 +8,9 @@
|
|
|
8
8
|
"url": "git@gitlab.com:opengeoweb/opengeoweb.git"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@
|
|
12
|
-
"@
|
|
13
|
-
"@
|
|
14
|
-
"@mui/system": "6.4.3",
|
|
15
|
-
"@mui/x-date-pickers": "7.26.0",
|
|
16
|
-
"@reduxjs/toolkit": "1.9.7",
|
|
17
|
-
"@sentry/react": "8.54.0",
|
|
18
|
-
"@storybook/core-events": "8.4.2",
|
|
19
|
-
"@storybook/preview-api": "8.4.2",
|
|
20
|
-
"@storybook/react": "8.4.2",
|
|
21
|
-
"@tanstack/query-core": "5.62.7",
|
|
22
|
-
"@tanstack/react-query": "^5.52.1",
|
|
23
|
-
"@testing-library/react": "16.0.1",
|
|
24
|
-
"@testing-library/user-event": "14.5.2",
|
|
25
|
-
"@turf/turf": "7.2.0",
|
|
26
|
-
"axios": "1.7.9",
|
|
27
|
-
"date-fns": "4.1.0",
|
|
28
|
-
"dompurify": "3.2.4",
|
|
29
|
-
"i18next": "23.11.5",
|
|
30
|
-
"immer": "10.1.1",
|
|
31
|
-
"jest-canvas-mock": "2.5.2",
|
|
32
|
-
"jest-date-mock": "1.0.10",
|
|
33
|
-
"lodash": "4.17.21",
|
|
34
|
-
"msw": "1.3.3",
|
|
35
|
-
"ol": "10.4.0",
|
|
36
|
-
"proj4": "2.15.0",
|
|
37
|
-
"re-resizable": "6.10.3",
|
|
38
|
-
"react": "18.3.1",
|
|
39
|
-
"react-draggable": "4.4.6",
|
|
40
|
-
"react-i18next": "15.1.1",
|
|
41
|
-
"react-redux": "8.1.3",
|
|
42
|
-
"react-resize-detector": "9.1.1",
|
|
43
|
-
"react-router-dom": "6.23.1",
|
|
44
|
-
"whatwg-fetch": "3.6.20"
|
|
11
|
+
"@opengeoweb/authentication": "*",
|
|
12
|
+
"@opengeoweb/store": "*",
|
|
13
|
+
"@tanstack/react-query": "^5.52.1"
|
|
45
14
|
},
|
|
46
15
|
"module": "./index.esm.js",
|
|
47
16
|
"type": "module",
|
package/src/utils.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare const useAuthQuery: <T>(queryKey: string[], queryFn: (auth: Crede
|
|
|
6
6
|
export declare const optimisticUpdate: <U extends {
|
|
7
7
|
id?: string | undefined;
|
|
8
8
|
}, T extends {
|
|
9
|
-
id
|
|
10
|
-
}>(updatedQueryKey: string[], queryClient: QueryClient, optimisticUpdate: (oldValue: U, variables: T) => U, errorCallback?: (err: Error) => void) => MutationOptions<
|
|
9
|
+
id?: string | undefined;
|
|
10
|
+
}>(updatedQueryKey: string[], queryClient: QueryClient, optimisticUpdate: (oldValue: U, variables: T) => U, errorCallback?: (err: Error) => void) => MutationOptions<Headers | null, Error, T, {
|
|
11
11
|
oldData: U[] | undefined;
|
|
12
12
|
}>;
|