@opengeoweb/api 15.2.0 → 16.0.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 +10 -3
- package/package.json +3 -3
- package/src/utils.d.ts +1 -0
package/index.esm.js
CHANGED
|
@@ -287,6 +287,11 @@ var getHeaders = function getHeaders(auth) {
|
|
|
287
287
|
Accept: 'application/json'
|
|
288
288
|
}, auth ? [] : ['Authorization']);
|
|
289
289
|
};
|
|
290
|
+
var withJsonFormat = function withJsonFormat(url) {
|
|
291
|
+
var urlObj = new URL(url);
|
|
292
|
+
urlObj.searchParams.set('f', 'json');
|
|
293
|
+
return urlObj.toString();
|
|
294
|
+
};
|
|
290
295
|
// This function has a copy in libs/webmap-react/src/lib/edr-layer-api/api.ts. This cannot be used there due to circular dependency
|
|
291
296
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
292
297
|
var handleResponse = /*#__PURE__*/function () {
|
|
@@ -633,6 +638,7 @@ var createTestQueryClient = function createTestQueryClient(overrides) {
|
|
|
633
638
|
queries: Object.assign({
|
|
634
639
|
retry: false,
|
|
635
640
|
staleTime: 0,
|
|
641
|
+
gcTime: 0,
|
|
636
642
|
refetchOnWindowFocus: false,
|
|
637
643
|
refetchOnMount: false,
|
|
638
644
|
refetchOnReconnect: false,
|
|
@@ -647,8 +653,9 @@ var createTestQueryClient = function createTestQueryClient(overrides) {
|
|
|
647
653
|
return client;
|
|
648
654
|
};
|
|
649
655
|
var resetQueryClient = function resetQueryClient() {
|
|
650
|
-
var _queryClientInstance2;
|
|
651
|
-
(_queryClientInstance2 = queryClientInstance) == null
|
|
656
|
+
var _queryClientInstance2, _queryClientInstance3;
|
|
657
|
+
void ((_queryClientInstance2 = queryClientInstance) == null ? void 0 : _queryClientInstance2.cancelQueries());
|
|
658
|
+
(_queryClientInstance3 = queryClientInstance) == null || _queryClientInstance3.clear();
|
|
652
659
|
queryClientInstance = null;
|
|
653
660
|
};
|
|
654
661
|
|
|
@@ -692,4 +699,4 @@ var QueryClientProviderWrapper = function QueryClientProviderWrapper(_ref) {
|
|
|
692
699
|
var API_NAMESPACE = 'api';
|
|
693
700
|
// Initialize and create provider if needed
|
|
694
701
|
|
|
695
|
-
export { API_NAMESPACE, AirmetPhenomena, CloudLevelUnits, Direction, LevelUnits, MovementUnit, ProductStatus, QueryClientProviderWrapper, SigmetPhenomena, VisibilityCause, WindUnit, configureLibraryDefaults, createTestQueryClient, getHeaders, getQueryClient, handleResponse, makeMockApiCall, optimisticUpdate, resetQueryClient, setQueryClient, useAuthQuery };
|
|
702
|
+
export { API_NAMESPACE, AirmetPhenomena, CloudLevelUnits, Direction, LevelUnits, MovementUnit, ProductStatus, QueryClientProviderWrapper, SigmetPhenomena, VisibilityCause, WindUnit, configureLibraryDefaults, createTestQueryClient, getHeaders, getQueryClient, handleResponse, makeMockApiCall, optimisticUpdate, resetQueryClient, setQueryClient, useAuthQuery, withJsonFormat };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/api",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.0.0",
|
|
4
4
|
"description": "GeoWeb API library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"url": "git@gitlab.com:opengeoweb/opengeoweb.git"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@opengeoweb/authentication": "
|
|
12
|
-
"@opengeoweb/store": "
|
|
11
|
+
"@opengeoweb/authentication": "16.0.0",
|
|
12
|
+
"@opengeoweb/store": "16.0.0",
|
|
13
13
|
"lodash": "^4.17.21",
|
|
14
14
|
"@tanstack/react-query": "^5.85.5",
|
|
15
15
|
"@tanstack/query-core": "^5.79.0",
|
package/src/utils.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { MutationOptions, QueryClient, UseQueryResult } from '@tanstack/react-query';
|
|
2
2
|
import type { Credentials } from '@opengeoweb/authentication';
|
|
3
3
|
export declare const getHeaders: (auth?: Credentials) => HeadersInit;
|
|
4
|
+
export declare const withJsonFormat: (url: string) => string;
|
|
4
5
|
export declare const handleResponse: (response: Response) => Promise<any>;
|
|
5
6
|
export declare const useAuthQuery: <T>(queryKey: string[], queryFn: (auth: Credentials) => Promise<T>, disabled?: boolean, refetchInterval?: number | false) => UseQueryResult<T>;
|
|
6
7
|
export declare const optimisticUpdate: <U extends {
|