@opengeoweb/api 9.33.0 → 9.34.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 +15 -12
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -19,18 +19,21 @@ import { useQuery } from '@tanstack/react-query';
|
|
|
19
19
|
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
20
20
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
21
21
|
* */
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
var getHeaders = function getHeaders(auth) {
|
|
23
|
+
return {
|
|
24
|
+
'Content-Type': 'application/json',
|
|
25
|
+
Authorization: "Bearer " + auth.token,
|
|
26
|
+
Accept: 'application/json'
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
var useAuthQuery = function useAuthQuery(queryKey, _queryFn) {
|
|
30
|
+
var _useAuthenticationCon = useAuthenticationContext(),
|
|
31
|
+
auth = _useAuthenticationCon.auth;
|
|
31
32
|
return useQuery({
|
|
32
|
-
queryKey,
|
|
33
|
-
queryFn:
|
|
33
|
+
queryKey: queryKey,
|
|
34
|
+
queryFn: function queryFn() {
|
|
35
|
+
return _queryFn(auth);
|
|
36
|
+
},
|
|
34
37
|
enabled: !!auth
|
|
35
38
|
});
|
|
36
39
|
};
|
|
@@ -195,7 +198,7 @@ var VisibilityCause;
|
|
|
195
198
|
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
196
199
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
197
200
|
* */
|
|
198
|
-
|
|
201
|
+
var API_NAMESPACE = 'api';
|
|
199
202
|
// Initialize and create provider if needed
|
|
200
203
|
|
|
201
204
|
export { API_NAMESPACE, AirmetPhenomena, CloudLevelUnits, Direction, LevelUnits, MovementUnit, ProductStatus, SigmetPhenomena, VisibilityCause, WindUnit, getHeaders, useAuthQuery };
|