@opengeoweb/api 9.26.0 → 9.27.1
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 +186 -2
- package/package.json +3 -3
- package/src/index.d.ts +2 -0
- package/src/sigmet-airmet-api/hooks.d.ts +4 -0
package/index.esm.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { getConfig } from '@opengeoweb/authentication';
|
|
1
|
+
import { getConfig, useAuthenticationContext } from '@opengeoweb/authentication';
|
|
2
2
|
export * from '@opengeoweb/authentication';
|
|
3
|
+
import { useQuery } from '@tanstack/react-query';
|
|
3
4
|
|
|
4
5
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
5
6
|
|
|
@@ -2267,6 +2268,189 @@ const getSigmetConfig = auth => {
|
|
|
2267
2268
|
}).then(r => r.json());
|
|
2268
2269
|
};
|
|
2269
2270
|
|
|
2271
|
+
/* *
|
|
2272
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2273
|
+
* you may not use this file except in compliance with the License.
|
|
2274
|
+
* You may obtain a copy of the License at
|
|
2275
|
+
*
|
|
2276
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2277
|
+
*
|
|
2278
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2279
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2280
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2281
|
+
* See the License for the specific language governing permissions and
|
|
2282
|
+
* limitations under the License.
|
|
2283
|
+
*
|
|
2284
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2285
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
2286
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
2287
|
+
* */
|
|
2288
|
+
/**
|
|
2289
|
+
* ProductStatus is returned by the backend. The backend fills in this property.
|
|
2290
|
+
* For the backend, it should only need to store 'DRAFT' | 'PUBLISHED' | 'CANCELLED' in its DB.
|
|
2291
|
+
* The backend should derive and return the status 'EXPIRED' from the product properties.
|
|
2292
|
+
*
|
|
2293
|
+
* Note: ProductStatus from the backend should be refreshed regularly to display status updates. */
|
|
2294
|
+
var ProductStatus;
|
|
2295
|
+
(function (ProductStatus) {
|
|
2296
|
+
ProductStatus["DRAFT"] = "DRAFT";
|
|
2297
|
+
ProductStatus["PUBLISHED"] = "PUBLISHED";
|
|
2298
|
+
ProductStatus["CANCELLED"] = "CANCELLED";
|
|
2299
|
+
ProductStatus["EXPIRED"] = "EXPIRED";
|
|
2300
|
+
ProductStatus["DISCARDED"] = "DISCARDED";
|
|
2301
|
+
})(ProductStatus || (ProductStatus = {}));
|
|
2302
|
+
var LevelUnits;
|
|
2303
|
+
(function (LevelUnits) {
|
|
2304
|
+
LevelUnits["FT"] = "ft";
|
|
2305
|
+
LevelUnits["M"] = "m";
|
|
2306
|
+
LevelUnits["FL"] = "FL";
|
|
2307
|
+
})(LevelUnits || (LevelUnits = {}));
|
|
2308
|
+
var CloudLevelUnits;
|
|
2309
|
+
(function (CloudLevelUnits) {
|
|
2310
|
+
CloudLevelUnits["FT"] = "ft";
|
|
2311
|
+
CloudLevelUnits["M"] = "m";
|
|
2312
|
+
})(CloudLevelUnits || (CloudLevelUnits = {}));
|
|
2313
|
+
/**
|
|
2314
|
+
* The possible phenomena for the sigmet
|
|
2315
|
+
*/
|
|
2316
|
+
var SigmetPhenomena;
|
|
2317
|
+
(function (SigmetPhenomena) {
|
|
2318
|
+
SigmetPhenomena["EMBD_TS"] = "Embedded thunderstorm(s)";
|
|
2319
|
+
SigmetPhenomena["EMBD_TSGR"] = "Embedded thunderstorm(s) with hail";
|
|
2320
|
+
SigmetPhenomena["FRQ_TS"] = "Frequent thunderstorm(s)";
|
|
2321
|
+
SigmetPhenomena["FRQ_TSGR"] = "Frequent thunderstorm(s) with hail";
|
|
2322
|
+
SigmetPhenomena["HVY_DS"] = "Heavy duststorm";
|
|
2323
|
+
SigmetPhenomena["HVY_SS"] = "Heavy sandstorm";
|
|
2324
|
+
SigmetPhenomena["OBSC_TS"] = "Obscured thunderstorm(s)";
|
|
2325
|
+
SigmetPhenomena["OBSC_TSGR"] = "Obscured thunderstorm(s) with hail";
|
|
2326
|
+
SigmetPhenomena["RDOACT_CLD"] = "Radioactive cloud";
|
|
2327
|
+
SigmetPhenomena["SEV_ICE"] = "Severe icing";
|
|
2328
|
+
SigmetPhenomena["SEV_ICE_FRZ_RN"] = "Severe icing due to freezing rain";
|
|
2329
|
+
SigmetPhenomena["SEV_MTW"] = "Severe mountain wave";
|
|
2330
|
+
SigmetPhenomena["SEV_TURB"] = "Severe turbulence";
|
|
2331
|
+
SigmetPhenomena["SQL_TS"] = "Squall line";
|
|
2332
|
+
SigmetPhenomena["SQL_TSGR"] = "Squall line thunderstorm(s) with hail";
|
|
2333
|
+
// 'TC' = 'Tropical cyclone', // Don't show this option in the list because it will be not used by KNMI.
|
|
2334
|
+
SigmetPhenomena["VA_CLD"] = "Volcanic ash cloud";
|
|
2335
|
+
})(SigmetPhenomena || (SigmetPhenomena = {}));
|
|
2336
|
+
/**
|
|
2337
|
+
* The possible phenomena for the airmet
|
|
2338
|
+
*/
|
|
2339
|
+
var AirmetPhenomena;
|
|
2340
|
+
(function (AirmetPhenomena) {
|
|
2341
|
+
AirmetPhenomena["SFC_VIS"] = "Surface visibility";
|
|
2342
|
+
AirmetPhenomena["SFC_WIND"] = "Surface wind";
|
|
2343
|
+
AirmetPhenomena["OVC_CLD"] = "Overcast cloud";
|
|
2344
|
+
AirmetPhenomena["BKN_CLD"] = "Broken cloud";
|
|
2345
|
+
AirmetPhenomena["ISOL_CB"] = "Isolated cumulonimbus cloud";
|
|
2346
|
+
AirmetPhenomena["OCNL_CB"] = "Occasional cumulonimbus cloud";
|
|
2347
|
+
AirmetPhenomena["FRQ_CB"] = "Frequent cumulonimbus cloud";
|
|
2348
|
+
AirmetPhenomena["ISOL_TS"] = "Isolated thunderstorm(s)";
|
|
2349
|
+
AirmetPhenomena["OCNL_TS"] = "Occasional thunderstorm(s)";
|
|
2350
|
+
AirmetPhenomena["ISOL_TSGR"] = "Isolated thunderstorm(s) with hail";
|
|
2351
|
+
AirmetPhenomena["OCNL_TSGR"] = "Occasional thunderstorm(s) with hail";
|
|
2352
|
+
AirmetPhenomena["ISOL_TCU"] = "Isolated towering cumulus cloud";
|
|
2353
|
+
AirmetPhenomena["OCNL_TCU"] = "Occasional towering cumulus cloud";
|
|
2354
|
+
AirmetPhenomena["FRQ_TCU"] = "Frequent towering cumulus cloud";
|
|
2355
|
+
AirmetPhenomena["MOD_ICE"] = "Moderate icing";
|
|
2356
|
+
AirmetPhenomena["MOD_MTW"] = "Moderate mountain wave";
|
|
2357
|
+
AirmetPhenomena["MOD_TURB"] = "Moderate turbulence";
|
|
2358
|
+
AirmetPhenomena["MT_OBSC"] = "Mountains obscured";
|
|
2359
|
+
})(AirmetPhenomena || (AirmetPhenomena = {}));
|
|
2360
|
+
/* Speed unit, e.g. 'KT', 'KMH' */
|
|
2361
|
+
var MovementUnit;
|
|
2362
|
+
(function (MovementUnit) {
|
|
2363
|
+
MovementUnit["KT"] = "kt";
|
|
2364
|
+
MovementUnit["KMH"] = "kmh";
|
|
2365
|
+
})(MovementUnit || (MovementUnit = {}));
|
|
2366
|
+
// can these be unified as SpeedUnit?
|
|
2367
|
+
var WindUnit;
|
|
2368
|
+
(function (WindUnit) {
|
|
2369
|
+
WindUnit["KT"] = "kt";
|
|
2370
|
+
WindUnit["MPS"] = "mps";
|
|
2371
|
+
})(WindUnit || (WindUnit = {}));
|
|
2372
|
+
var Direction;
|
|
2373
|
+
(function (Direction) {
|
|
2374
|
+
Direction["N"] = "N";
|
|
2375
|
+
Direction["NNE"] = "NNE";
|
|
2376
|
+
Direction["NE"] = "NE";
|
|
2377
|
+
Direction["ENE"] = "ENE";
|
|
2378
|
+
Direction["E"] = "E";
|
|
2379
|
+
Direction["ESE"] = "ESE";
|
|
2380
|
+
Direction["SE"] = "SE";
|
|
2381
|
+
Direction["SSE"] = "SSE";
|
|
2382
|
+
Direction["S"] = "S";
|
|
2383
|
+
Direction["SSW"] = "SSW";
|
|
2384
|
+
Direction["SW"] = "SW";
|
|
2385
|
+
Direction["WSW"] = "WSW";
|
|
2386
|
+
Direction["W"] = "W";
|
|
2387
|
+
Direction["WNW"] = "WNW";
|
|
2388
|
+
Direction["NW"] = "NW";
|
|
2389
|
+
Direction["NNW"] = "NNW";
|
|
2390
|
+
})(Direction || (Direction = {}));
|
|
2391
|
+
var VisibilityCause;
|
|
2392
|
+
(function (VisibilityCause) {
|
|
2393
|
+
VisibilityCause["DZ"] = "Drizzle";
|
|
2394
|
+
VisibilityCause["DU"] = "Dust";
|
|
2395
|
+
VisibilityCause["PO"] = "Dust or sand devil";
|
|
2396
|
+
VisibilityCause["DS"] = "Dust storm";
|
|
2397
|
+
VisibilityCause["FG"] = "Fog";
|
|
2398
|
+
VisibilityCause["FC"] = "Funnel clouds";
|
|
2399
|
+
VisibilityCause["GR"] = "Hail";
|
|
2400
|
+
VisibilityCause["HZ"] = "Haze";
|
|
2401
|
+
VisibilityCause["PL"] = "Ice pellets";
|
|
2402
|
+
VisibilityCause["BR"] = "Mist";
|
|
2403
|
+
VisibilityCause["RA"] = "Rain";
|
|
2404
|
+
VisibilityCause["SA"] = "Sand";
|
|
2405
|
+
VisibilityCause["SS"] = "Sand storm";
|
|
2406
|
+
VisibilityCause["FU"] = "Smoke";
|
|
2407
|
+
VisibilityCause["SN"] = "Snow";
|
|
2408
|
+
VisibilityCause["SG"] = "Snow grains";
|
|
2409
|
+
VisibilityCause["GS"] = "Soft hail";
|
|
2410
|
+
VisibilityCause["SQ"] = "Squalls";
|
|
2411
|
+
VisibilityCause["VA"] = "Volcanic Ash";
|
|
2412
|
+
})(VisibilityCause || (VisibilityCause = {}));
|
|
2413
|
+
|
|
2414
|
+
/* *
|
|
2415
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2416
|
+
* you may not use this file except in compliance with the License.
|
|
2417
|
+
* You may obtain a copy of the License at
|
|
2418
|
+
*
|
|
2419
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2420
|
+
*
|
|
2421
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2422
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2423
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2424
|
+
* See the License for the specific language governing permissions and
|
|
2425
|
+
* limitations under the License.
|
|
2426
|
+
*
|
|
2427
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2428
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
2429
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
2430
|
+
* */
|
|
2431
|
+
const useAirmetList = () => {
|
|
2432
|
+
const {
|
|
2433
|
+
auth
|
|
2434
|
+
} = useAuthenticationContext();
|
|
2435
|
+
const data = useQuery({
|
|
2436
|
+
queryKey: ['airmet-list'],
|
|
2437
|
+
queryFn: () => getAirmetList(auth),
|
|
2438
|
+
enabled: !!auth
|
|
2439
|
+
});
|
|
2440
|
+
return data;
|
|
2441
|
+
};
|
|
2442
|
+
const useSigmetList = () => {
|
|
2443
|
+
const {
|
|
2444
|
+
auth
|
|
2445
|
+
} = useAuthenticationContext();
|
|
2446
|
+
const data = useQuery({
|
|
2447
|
+
queryKey: ['sigmet-list'],
|
|
2448
|
+
queryFn: () => getSigmetList(auth),
|
|
2449
|
+
enabled: !!auth
|
|
2450
|
+
});
|
|
2451
|
+
return data;
|
|
2452
|
+
};
|
|
2453
|
+
|
|
2270
2454
|
/* *
|
|
2271
2455
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2272
2456
|
* you may not use this file except in compliance with the License.
|
|
@@ -2287,4 +2471,4 @@ const getSigmetConfig = auth => {
|
|
|
2287
2471
|
const API_NAMESPACE = 'api';
|
|
2288
2472
|
// Initialize and create provider if needed
|
|
2289
2473
|
|
|
2290
|
-
export { API_NAMESPACE, getAirmetConfig, getAirmetList, getSigmetConfig, getSigmetList, getlocalProductConfig };
|
|
2474
|
+
export { API_NAMESPACE, AirmetPhenomena, CloudLevelUnits, Direction, LevelUnits, MovementUnit, ProductStatus, SigmetPhenomena, VisibilityCause, WindUnit, getAirmetConfig, getAirmetList, getSigmetConfig, getSigmetList, getlocalProductConfig, useAirmetList, useSigmetList };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/api",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.27.1",
|
|
4
4
|
"description": "GeoWeb API library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@opengeoweb/authentication": "*",
|
|
12
|
-
"@opengeoweb/store": "*"
|
|
12
|
+
"@opengeoweb/store": "*",
|
|
13
|
+
"@tanstack/react-query": "^5.52.1"
|
|
13
14
|
},
|
|
14
|
-
"peerDependencies": {},
|
|
15
15
|
"module": "./index.esm.js",
|
|
16
16
|
"type": "module",
|
|
17
17
|
"main": "./index.esm.js"
|
package/src/index.d.ts
CHANGED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import { AirmetFromBackend, SigmetFromBackend } from './types';
|
|
3
|
+
export declare const useAirmetList: () => UseQueryResult<AirmetFromBackend[]>;
|
|
4
|
+
export declare const useSigmetList: () => UseQueryResult<SigmetFromBackend[]>;
|