@opengeoweb/api 15.3.0 → 17.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 CHANGED
@@ -3,10 +3,10 @@ export * from '@opengeoweb/authentication';
3
3
  import { useQuery, QueryClientProvider } from '@tanstack/react-query';
4
4
  import { omit } from 'lodash';
5
5
  import { HttpResponse, delay } from 'msw';
6
- import { jsxs, jsx } from 'react/jsx-runtime';
7
6
  import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
8
7
  import React from 'react';
9
8
  import { QueryClient, keepPreviousData } from '@tanstack/query-core';
9
+ import { jsxs, jsx } from 'react/jsx-runtime';
10
10
 
11
11
  function _OverloadYield(e, d) {
12
12
  this.v = e, this.k = d;
@@ -287,6 +287,12 @@ 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
+ };
295
+
290
296
  // 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
297
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
292
298
  var handleResponse = /*#__PURE__*/function () {
@@ -459,37 +465,70 @@ var makeMockApiCall = function makeMockApiCall(response, responseInit, delayDura
459
465
  * Copyright 2024 - Finnish Meteorological Institute (FMI)
460
466
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
461
467
  * */
468
+
469
+ /* Date object, eg ISO8601 `2020-09-18T12:00:00Z` */
470
+
471
+ // International Civil Aviation Organization (ICAO) locations
472
+ // For example 'AMSTERDAM FIR';
473
+
474
+ // Meteorological Watch Office (MWO) locations
475
+ // For example 'EHDB'; Use getMWO() from utils to get the current MWO
476
+
477
+ /* Air Traffic Services Unit locations */
478
+ // For example 'EHAA';
479
+
480
+ /* Air Traffic Services Region locations */
481
+ // For example 'EHAA';
482
+
462
483
  /**
463
484
  * ProductStatus is returned by the backend. The backend fills in this property.
464
485
  * For the backend, it should only need to store 'DRAFT' | 'PUBLISHED' | 'CANCELLED' in its DB.
465
486
  * The backend should derive and return the status 'EXPIRED' from the product properties.
466
487
  *
467
488
  * Note: ProductStatus from the backend should be refreshed regularly to display status updates. */
468
- var ProductStatus;
469
- (function (ProductStatus) {
489
+ var ProductStatus = /*#__PURE__*/function (ProductStatus) {
470
490
  ProductStatus["DRAFT"] = "DRAFT";
471
491
  ProductStatus["PUBLISHED"] = "PUBLISHED";
472
492
  ProductStatus["RENEWED"] = "RENEWED";
473
493
  ProductStatus["CANCELLED"] = "CANCELLED";
474
494
  ProductStatus["EXPIRED"] = "EXPIRED";
475
495
  ProductStatus["DISCARDED"] = "DISCARDED";
476
- })(ProductStatus || (ProductStatus = {}));
477
- var LevelUnits;
478
- (function (LevelUnits) {
496
+ return ProductStatus;
497
+ }({});
498
+
499
+ /**
500
+ * ProductSequence is a sequence label with a counter of the SIGMETs/AIRMETs issued on a day (starting at with 1 01:00),
501
+ * max 3 characters long; first character should be a capital letter,
502
+ * others are numbers: A01-A99, 01-99 or 1-99 */
503
+
504
+ /**
505
+ * ProductCanbe lifecycle is determined by the backend. E.g. the backend fills in these properties:
506
+ * 'DRAFTED': product can be saved as draft
507
+ * 'DISCARDED': This product can be thrown away
508
+ * 'PUBLISHED': product can be PUBLISHED
509
+ * 'CANCELLED': product can be CANCELLED */
510
+
511
+ var LevelUnits = /*#__PURE__*/function (LevelUnits) {
479
512
  LevelUnits["FT"] = "ft";
480
513
  LevelUnits["M"] = "m";
481
514
  LevelUnits["FL"] = "FL";
482
- })(LevelUnits || (LevelUnits = {}));
483
- var CloudLevelUnits;
484
- (function (CloudLevelUnits) {
515
+ return LevelUnits;
516
+ }({});
517
+ var CloudLevelUnits = /*#__PURE__*/function (CloudLevelUnits) {
485
518
  CloudLevelUnits["FT"] = "ft";
486
519
  CloudLevelUnits["M"] = "m";
487
- })(CloudLevelUnits || (CloudLevelUnits = {}));
520
+ return CloudLevelUnits;
521
+ }({});
522
+
523
+ /** Change type of the Product, can be:
524
+ * INTSF:Intensifying
525
+ * WKN: Weakening
526
+ * NC: No change */
527
+
488
528
  /**
489
529
  * The possible phenomena for the sigmet
490
530
  */
491
- var SigmetPhenomena;
492
- (function (SigmetPhenomena) {
531
+ var SigmetPhenomena = /*#__PURE__*/function (SigmetPhenomena) {
493
532
  SigmetPhenomena["EMBD_TS"] = "Embedded thunderstorm(s)";
494
533
  SigmetPhenomena["EMBD_TSGR"] = "Embedded thunderstorm(s) with hail";
495
534
  SigmetPhenomena["FRQ_TS"] = "Frequent thunderstorm(s)";
@@ -505,14 +544,14 @@ var SigmetPhenomena;
505
544
  SigmetPhenomena["SEV_TURB"] = "Severe turbulence";
506
545
  SigmetPhenomena["SQL_TS"] = "Squall line thunderstorm(s)";
507
546
  SigmetPhenomena["SQL_TSGR"] = "Squall line thunderstorm(s) with hail";
508
- // 'TC' = 'Tropical cyclone', // Don't show this option in the list because it will be not used by KNMI.
509
547
  SigmetPhenomena["VA_CLD"] = "Volcanic ash cloud";
510
- })(SigmetPhenomena || (SigmetPhenomena = {}));
548
+ return SigmetPhenomena;
549
+ }({});
550
+
511
551
  /**
512
552
  * The possible phenomena for the airmet
513
553
  */
514
- var AirmetPhenomena;
515
- (function (AirmetPhenomena) {
554
+ var AirmetPhenomena = /*#__PURE__*/function (AirmetPhenomena) {
516
555
  AirmetPhenomena["SFC_VIS"] = "Surface visibility";
517
556
  AirmetPhenomena["SFC_WIND"] = "Surface wind";
518
557
  AirmetPhenomena["OVC_CLD"] = "Overcast cloud";
@@ -531,21 +570,30 @@ var AirmetPhenomena;
531
570
  AirmetPhenomena["MOD_MTW"] = "Moderate mountain wave";
532
571
  AirmetPhenomena["MOD_TURB"] = "Moderate turbulence";
533
572
  AirmetPhenomena["MT_OBSC"] = "Mountains obscured";
534
- })(AirmetPhenomena || (AirmetPhenomena = {}));
573
+ return AirmetPhenomena;
574
+ }({});
575
+
576
+ /* STATIONARY: not moving
577
+ * MOVEMENT: moving, specified by speed/direction, (If not STATIONARY and no end geometry is given)
578
+ * FORECAST_POSITION: moving, specified by end geometry
579
+ * NO_VA_EXP: no volcanic ash expected, option only available for phenomenon VA_CLD */
580
+
581
+ /* STATIONARY: not moving
582
+ * MOVEMENT: moving, specified by speed/direction */
583
+
535
584
  /* Speed unit, e.g. 'KT', 'KMH' */
536
- var MovementUnit;
537
- (function (MovementUnit) {
585
+ var MovementUnit = /*#__PURE__*/function (MovementUnit) {
538
586
  MovementUnit["KT"] = "kt";
539
587
  MovementUnit["KMH"] = "kmh";
540
- })(MovementUnit || (MovementUnit = {}));
588
+ return MovementUnit;
589
+ }({});
541
590
  // can these be unified as SpeedUnit?
542
- var WindUnit;
543
- (function (WindUnit) {
591
+ var WindUnit = /*#__PURE__*/function (WindUnit) {
544
592
  WindUnit["KT"] = "kt";
545
593
  WindUnit["MPS"] = "mps";
546
- })(WindUnit || (WindUnit = {}));
547
- var Direction;
548
- (function (Direction) {
594
+ return WindUnit;
595
+ }({});
596
+ var Direction = /*#__PURE__*/function (Direction) {
549
597
  Direction["N"] = "N";
550
598
  Direction["NNE"] = "NNE";
551
599
  Direction["NE"] = "NE";
@@ -562,9 +610,9 @@ var Direction;
562
610
  Direction["WNW"] = "WNW";
563
611
  Direction["NW"] = "NW";
564
612
  Direction["NNW"] = "NNW";
565
- })(Direction || (Direction = {}));
566
- var VisibilityCause;
567
- (function (VisibilityCause) {
613
+ return Direction;
614
+ }({});
615
+ var VisibilityCause = /*#__PURE__*/function (VisibilityCause) {
568
616
  VisibilityCause["DZ"] = "Drizzle";
569
617
  VisibilityCause["DU"] = "Dust";
570
618
  VisibilityCause["PO"] = "Dust or sand devil";
@@ -584,7 +632,8 @@ var VisibilityCause;
584
632
  VisibilityCause["GS"] = "Soft hail";
585
633
  VisibilityCause["SQ"] = "Squalls";
586
634
  VisibilityCause["VA"] = "Volcanic Ash";
587
- })(VisibilityCause || (VisibilityCause = {}));
635
+ return VisibilityCause;
636
+ }({});
588
637
 
589
638
  /* *
590
639
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -603,6 +652,7 @@ var VisibilityCause;
603
652
  * Copyright 2025 - Finnish Meteorological Institute (FMI)
604
653
  * Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
605
654
  * */
655
+
606
656
  var queryClientInstance = null;
607
657
  var getQueryClient = function getQueryClient() {
608
658
  var _queryClientInstance;
@@ -654,6 +704,24 @@ var resetQueryClient = function resetQueryClient() {
654
704
  queryClientInstance = null;
655
705
  };
656
706
 
707
+ /* *
708
+ * Licensed under the Apache License, Version 2.0 (the "License");
709
+ * you may not use this file except in compliance with the License.
710
+ * You may obtain a copy of the License at
711
+ *
712
+ * http://www.apache.org/licenses/LICENSE-2.0
713
+ *
714
+ * Unless required by applicable law or agreed to in writing, software
715
+ * distributed under the License is distributed on an "AS IS" BASIS,
716
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
717
+ * See the License for the specific language governing permissions and
718
+ * limitations under the License.
719
+ *
720
+ * Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
721
+ * Copyright 2025 - Finnish Meteorological Institute (FMI)
722
+ * Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
723
+ * */
724
+
657
725
  var QueryClientProviderWrapper = function QueryClientProviderWrapper(_ref) {
658
726
  var client = _ref.client,
659
727
  children = _ref.children,
@@ -666,9 +734,9 @@ var QueryClientProviderWrapper = function QueryClientProviderWrapper(_ref) {
666
734
  }
667
735
  return mode === 'test' ? createTestQueryClient() : getQueryClient();
668
736
  }, [client, mode]);
669
- return jsxs(QueryClientProvider, {
737
+ return /*#__PURE__*/jsxs(QueryClientProvider, {
670
738
  client: queryClient,
671
- children: [children, jsx(ReactQueryDevtools, {
739
+ children: [children, /*#__PURE__*/jsx(ReactQueryDevtools, {
672
740
  initialIsOpen: false
673
741
  })]
674
742
  });
@@ -691,7 +759,9 @@ var QueryClientProviderWrapper = function QueryClientProviderWrapper(_ref) {
691
759
  * Copyright 2024 - Finnish Meteorological Institute (FMI)
692
760
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
693
761
  * */
762
+
694
763
  var API_NAMESPACE = 'api';
764
+
695
765
  // Initialize and create provider if needed
696
766
 
697
- export { API_NAMESPACE, AirmetPhenomena, CloudLevelUnits, Direction, LevelUnits, MovementUnit, ProductStatus, QueryClientProviderWrapper, SigmetPhenomena, VisibilityCause, WindUnit, configureLibraryDefaults, createTestQueryClient, getHeaders, getQueryClient, handleResponse, makeMockApiCall, optimisticUpdate, resetQueryClient, setQueryClient, useAuthQuery };
767
+ 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": "15.3.0",
3
+ "version": "17.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": "15.3.0",
12
- "@opengeoweb/store": "15.3.0",
11
+ "@opengeoweb/authentication": "17.0.0",
12
+ "@opengeoweb/store": "17.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/fakeApi.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import type { HttpResponseInit, JsonBodyType } from 'msw';
2
- export declare const makeMockApiCall: (response: JsonBodyType, responseInit?: HttpResponseInit, delayDuration?: number) => jest.Mock;
package/src/i18n.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare const API_NAMESPACE = "api";
package/src/index.d.ts DELETED
@@ -1,8 +0,0 @@
1
- export * from '@opengeoweb/authentication';
2
- export * from './utils';
3
- export * from './fakeApi';
4
- export type * from './sigmet-airmet-api/types';
5
- export * from './sigmet-airmet-api/definitions';
6
- export type * from './sigmet-airmet-api/config-types';
7
- export * from './query-client';
8
- export { API_NAMESPACE } from './i18n';
@@ -1,9 +0,0 @@
1
- import type { QueryClient } from '@tanstack/query-core';
2
- import React from 'react';
3
- interface QueryClientProviderWrapperProps {
4
- client?: QueryClient;
5
- children: React.ReactNode;
6
- mode?: 'test' | 'production';
7
- }
8
- export declare const QueryClientProviderWrapper: ({ client, children, mode, }: QueryClientProviderWrapperProps) => React.ReactElement;
9
- export {};
@@ -1,2 +0,0 @@
1
- export * from './QueryClientProviderWrapper';
2
- export * from './queryClient';
@@ -1,10 +0,0 @@
1
- import type { DefaultOptions } from '@tanstack/query-core';
2
- import { QueryClient } from '@tanstack/query-core';
3
- export declare const getQueryClient: () => QueryClient;
4
- export declare const setQueryClient: (client: QueryClient) => void;
5
- export declare const configureLibraryDefaults: (queryKeyPrefix: string[], options: DefaultOptions["queries"]) => void;
6
- export declare const createTestQueryClient: (overrides?: {
7
- queries?: DefaultOptions["queries"];
8
- mutations?: DefaultOptions["mutations"];
9
- }) => QueryClient;
10
- export declare const resetQueryClient: () => void;
@@ -1 +0,0 @@
1
- export {};
@@ -1,87 +0,0 @@
1
- import type { MapPreset } from '@opengeoweb/store';
2
- export interface AllowedUnits {
3
- unit_type: string;
4
- allowed_units: string[];
5
- }
6
- export type FIRLocationGeoJson = GeoJSON.FeatureCollection<GeoJSON.Geometry, {
7
- selectionType?: string;
8
- }>;
9
- export interface LevelMinMaxType {
10
- FT?: number;
11
- FL?: number;
12
- M?: number;
13
- }
14
- export interface MovementMinMaxType {
15
- KT?: number;
16
- KMH?: number;
17
- }
18
- export interface CloudLevelMinMaxType {
19
- FT?: number;
20
- M?: number;
21
- }
22
- export interface SurfaceWindMinMaxType {
23
- KT?: number;
24
- MPS?: number;
25
- }
26
- export interface FIRArea {
27
- fir_name: string;
28
- fir_location: FIRLocationGeoJson;
29
- location_indicator_atsr: string;
30
- location_indicator_atsu: string;
31
- max_hours_of_validity: number;
32
- hours_before_validity: number;
33
- level_min?: LevelMinMaxType;
34
- level_max?: LevelMinMaxType;
35
- level_rounding_FL?: number;
36
- level_rounding_FT?: number;
37
- level_rounding_M?: number;
38
- movement_min?: MovementMinMaxType;
39
- movement_max?: MovementMinMaxType;
40
- movement_rounding_kt?: number;
41
- movement_rounding_kmh?: number;
42
- max_polygon_points?: number;
43
- units: AllowedUnits[];
44
- }
45
- export interface FIRConfigSigmet extends FIRArea {
46
- tc_max_hours_of_validity: number;
47
- tc_hours_before_validity: number;
48
- va_max_hours_of_validity: number;
49
- va_hours_before_validity: number;
50
- va_cld_degrees_minutes?: boolean;
51
- adjacent_firs: string[];
52
- }
53
- export interface FIRConfigAirmet extends FIRArea {
54
- cloud_level_min?: CloudLevelMinMaxType;
55
- cloud_level_max?: CloudLevelMinMaxType;
56
- cloud_lower_level_min?: CloudLevelMinMaxType;
57
- cloud_lower_level_max?: CloudLevelMinMaxType;
58
- cloud_level_rounding_ft?: number;
59
- cloud_level_rounding_m_below?: number;
60
- cloud_level_rounding_m_above?: number;
61
- wind_direction_rounding?: number;
62
- wind_speed_max?: SurfaceWindMinMaxType;
63
- wind_speed_min?: SurfaceWindMinMaxType;
64
- visibility_max?: number;
65
- visibility_min?: number;
66
- visibility_rounding_below?: number;
67
- visibility_rounding_above?: number;
68
- }
69
- type SigmetFIRArea = Record<string, FIRConfigSigmet>;
70
- type AirmetFIRArea = Record<string, FIRConfigAirmet>;
71
- export type Firareas = SigmetFIRArea | AirmetFIRArea;
72
- export interface ProductConfig {
73
- location_indicator_mwo: string;
74
- active_firs: string[];
75
- valid_from_delay_minutes: number;
76
- default_validity_minutes: number;
77
- fir_areas: Firareas;
78
- mapPreset?: MapPreset;
79
- omit_change_va_and_rdoact_cloud?: boolean;
80
- }
81
- export interface SigmetConfig extends ProductConfig {
82
- fir_areas: SigmetFIRArea;
83
- }
84
- export interface AirmetConfig extends ProductConfig {
85
- fir_areas: AirmetFIRArea;
86
- }
87
- export {};
@@ -1,142 +0,0 @@
1
- export type DateType = string;
2
- export type ICAOLocation = string;
3
- export type MWOLocation = string;
4
- export type ATSULocation = string;
5
- export type ATSRLocation = string;
6
- /**
7
- * ProductStatus is returned by the backend. The backend fills in this property.
8
- * For the backend, it should only need to store 'DRAFT' | 'PUBLISHED' | 'CANCELLED' in its DB.
9
- * The backend should derive and return the status 'EXPIRED' from the product properties.
10
- *
11
- * Note: ProductStatus from the backend should be refreshed regularly to display status updates. */
12
- export declare enum ProductStatus {
13
- DRAFT = "DRAFT",
14
- PUBLISHED = "PUBLISHED",
15
- RENEWED = "RENEWED",
16
- CANCELLED = "CANCELLED",
17
- EXPIRED = "EXPIRED",
18
- DISCARDED = "DISCARDED"
19
- }
20
- /**
21
- * ProductSequence is a sequence label with a counter of the SIGMETs/AIRMETs issued on a day (starting at with 1 01:00),
22
- * max 3 characters long; first character should be a capital letter,
23
- * others are numbers: A01-A99, 01-99 or 1-99 */
24
- export type ProductSequenceId = string;
25
- /**
26
- * ProductCanbe lifecycle is determined by the backend. E.g. the backend fills in these properties:
27
- * 'DRAFTED': product can be saved as draft
28
- * 'DISCARDED': This product can be thrown away
29
- * 'PUBLISHED': product can be PUBLISHED
30
- * 'CANCELLED': product can be CANCELLED */
31
- export type ProductCanbe = 'DRAFTED' | 'DISCARDED' | 'PUBLISHED' | 'RENEWED' | 'CANCELLED';
32
- export type ObservationOrForcast = 'OBS' | 'FCST';
33
- export declare enum LevelUnits {
34
- 'FT' = "ft",
35
- 'M' = "m",
36
- 'FL' = "FL"
37
- }
38
- export declare enum CloudLevelUnits {
39
- 'FT' = "ft",
40
- 'M' = "m"
41
- }
42
- /** Change type of the Product, can be:
43
- * INTSF:Intensifying
44
- * WKN: Weakening
45
- * NC: No change */
46
- export type Change = 'INTSF' | 'WKN' | 'NC';
47
- export type LevelInfoMode = 'AT' | 'BETW' | 'BETW_SFC' | 'TOPS' | 'TOPS_ABV' | 'TOPS_BLW' | 'ABV';
48
- /**
49
- * The possible phenomena for the sigmet
50
- */
51
- export declare enum SigmetPhenomena {
52
- 'EMBD_TS' = "Embedded thunderstorm(s)",
53
- 'EMBD_TSGR' = "Embedded thunderstorm(s) with hail",
54
- 'FRQ_TS' = "Frequent thunderstorm(s)",
55
- 'FRQ_TSGR' = "Frequent thunderstorm(s) with hail",
56
- 'HVY_DS' = "Heavy duststorm",
57
- 'HVY_SS' = "Heavy sandstorm",
58
- 'OBSC_TS' = "Obscured thunderstorm(s)",
59
- 'OBSC_TSGR' = "Obscured thunderstorm(s) with hail",
60
- 'RDOACT_CLD' = "Radioactive cloud",
61
- 'SEV_ICE' = "Severe icing",
62
- 'SEV_ICE_FRZ_RN' = "Severe icing due to freezing rain",
63
- 'SEV_MTW' = "Severe mountain wave",
64
- 'SEV_TURB' = "Severe turbulence",
65
- 'SQL_TS' = "Squall line thunderstorm(s)",
66
- 'SQL_TSGR' = "Squall line thunderstorm(s) with hail",
67
- 'VA_CLD' = "Volcanic ash cloud"
68
- }
69
- /**
70
- * The possible phenomena for the airmet
71
- */
72
- export declare enum AirmetPhenomena {
73
- 'SFC_VIS' = "Surface visibility",
74
- 'SFC_WIND' = "Surface wind",
75
- 'OVC_CLD' = "Overcast cloud",
76
- 'BKN_CLD' = "Broken cloud",
77
- 'ISOL_CB' = "Isolated cumulonimbus cloud",
78
- 'OCNL_CB' = "Occasional cumulonimbus cloud",
79
- 'FRQ_CB' = "Frequent cumulonimbus cloud",
80
- 'ISOL_TS' = "Isolated thunderstorm(s)",
81
- 'OCNL_TS' = "Occasional thunderstorm(s)",
82
- 'ISOL_TSGR' = "Isolated thunderstorm(s) with hail",
83
- 'OCNL_TSGR' = "Occasional thunderstorm(s) with hail",
84
- 'ISOL_TCU' = "Isolated towering cumulus cloud",
85
- 'OCNL_TCU' = "Occasional towering cumulus cloud",
86
- 'FRQ_TCU' = "Frequent towering cumulus cloud",
87
- 'MOD_ICE' = "Moderate icing",
88
- 'MOD_MTW' = "Moderate mountain wave",
89
- 'MOD_TURB' = "Moderate turbulence",
90
- 'MT_OBSC' = "Mountains obscured"
91
- }
92
- export type SigmetMovementType = 'STATIONARY' | 'MOVEMENT' | 'FORECAST_POSITION' | 'NO_VA_EXP';
93
- export type AirmetMovementType = 'STATIONARY' | 'MOVEMENT';
94
- export declare enum MovementUnit {
95
- 'KT' = "kt",
96
- 'KMH' = "kmh"
97
- }
98
- export declare enum WindUnit {
99
- 'KT' = "kt",
100
- 'MPS' = "mps"
101
- }
102
- export declare enum Direction {
103
- 'N' = "N",
104
- 'NNE' = "NNE",
105
- 'NE' = "NE",
106
- 'ENE' = "ENE",
107
- 'E' = "E",
108
- 'ESE' = "ESE",
109
- 'SE' = "SE",
110
- 'SSE' = "SSE",
111
- 'S' = "S",
112
- 'SSW' = "SSW",
113
- 'SW' = "SW",
114
- 'WSW' = "WSW",
115
- 'W' = "W",
116
- 'WNW' = "WNW",
117
- 'NW' = "NW",
118
- 'NNW' = "NNW"
119
- }
120
- export type VisibilityUnit = 'm';
121
- export declare enum VisibilityCause {
122
- 'DZ' = "Drizzle",
123
- 'DU' = "Dust",
124
- 'PO' = "Dust or sand devil",
125
- 'DS' = "Dust storm",
126
- 'FG' = "Fog",
127
- 'FC' = "Funnel clouds",
128
- 'GR' = "Hail",
129
- 'HZ' = "Haze",
130
- 'PL' = "Ice pellets",
131
- 'BR' = "Mist",
132
- 'RA' = "Rain",
133
- 'SA' = "Sand",
134
- 'SS' = "Sand storm",
135
- 'FU' = "Smoke",
136
- 'SN' = "Snow",
137
- 'SG' = "Snow grains",
138
- 'GS' = "Soft hail",
139
- 'SQ' = "Squalls",
140
- 'VA' = "Volcanic Ash"
141
- }
142
- export type CloudLevelInfoMode = 'BETW' | 'BETW_SFC' | 'BETW_SFC_ABV' | 'BETW_ABV';
@@ -1,101 +0,0 @@
1
- import type { AirmetMovementType, AirmetPhenomena, ATSRLocation, ATSULocation, Change, CloudLevelInfoMode, CloudLevelUnits, DateType, Direction, ICAOLocation, LevelInfoMode, LevelUnits, MovementUnit, MWOLocation, ObservationOrForcast, ProductCanbe, ProductSequenceId, ProductStatus, SigmetMovementType, SigmetPhenomena, VisibilityCause, VisibilityUnit, WindUnit } from './definitions';
2
- export interface LevelType {
3
- value: number;
4
- unit: LevelUnits;
5
- }
6
- export interface CloudLevelType {
7
- value: number;
8
- unit: CloudLevelUnits;
9
- }
10
- export interface Coordinate {
11
- latitude: number;
12
- longitude: number;
13
- }
14
- export interface BaseProduct {
15
- validDateStart: DateType;
16
- validDateEnd: DateType;
17
- firName: ICAOLocation;
18
- locationIndicatorMWO: MWOLocation;
19
- locationIndicatorATSU: ATSULocation;
20
- locationIndicatorATSR: ATSRLocation;
21
- uuid?: string;
22
- sequence?: ProductSequenceId;
23
- issueDate?: DateType;
24
- author?: string;
25
- }
26
- interface Product extends BaseProduct {
27
- status: ProductStatus;
28
- isObservationOrForecast?: ObservationOrForcast;
29
- observationOrForecastTime?: DateType;
30
- change?: Change;
31
- levelInfoMode?: LevelInfoMode;
32
- level?: LevelType;
33
- lowerLevel?: LevelType;
34
- firGeometry?: GeoJSON.FeatureCollection;
35
- startGeometry: GeoJSON.FeatureCollection;
36
- startGeometryIntersect: GeoJSON.FeatureCollection;
37
- movementSpeed?: number;
38
- movementUnit?: MovementUnit;
39
- movementDirection?: Direction;
40
- }
41
- export interface Sigmet extends Product {
42
- phenomenon: SigmetPhenomena;
43
- type: 'NORMAL' | 'TEST' | 'EXERCISE' | 'SHORT_TEST' | 'SHORT_VA_TEST';
44
- endGeometry?: GeoJSON.FeatureCollection;
45
- endGeometryIntersect?: GeoJSON.FeatureCollection;
46
- movementType?: SigmetMovementType;
47
- /** Extra properties in case of va SIGMET */
48
- vaSigmetVolcanoName?: string;
49
- vaSigmetVolcanoCoordinates?: Coordinate;
50
- /** Extra properties in case of cancel va SIGMET, if set to unknown, property not set */
51
- vaSigmetMoveToFIR?: ICAOLocation;
52
- }
53
- /**
54
- * To cancel a published sigmet
55
- * To cancel a published sigmet, we send a cancel sigmet with all the mandatory properties from the basesigmet. */
56
- export interface CancelSigmet extends BaseProduct {
57
- cancelsSigmetSequenceId: ProductSequenceId;
58
- validDateStartOfSigmetToCancel: DateType;
59
- validDateEndOfSigmetToCancel: DateType;
60
- status: ProductStatus.PUBLISHED;
61
- /** Extra properties in case of cancel va SIGMET, if set to unknown, property not set */
62
- vaSigmetMoveToFIR?: ICAOLocation;
63
- }
64
- export interface Airmet extends Product {
65
- phenomenon: AirmetPhenomena;
66
- status: ProductStatus;
67
- type: 'NORMAL' | 'TEST' | 'EXERCISE';
68
- movementType: AirmetMovementType;
69
- windSpeed?: number;
70
- windUnit?: WindUnit;
71
- windDirection?: number;
72
- visibilityValue?: number;
73
- visibilityCause?: VisibilityCause;
74
- visibilityUnit?: VisibilityUnit;
75
- cloudLevelInfoMode?: CloudLevelInfoMode;
76
- cloudLevel?: CloudLevelType;
77
- cloudLowerLevel?: CloudLevelType;
78
- }
79
- export interface CancelAirmet extends BaseProduct {
80
- cancelsAirmetSequenceId: ProductSequenceId;
81
- validDateStartOfAirmetToCancel: DateType;
82
- validDateEndOfAirmetToCancel: DateType;
83
- status: ProductStatus.PUBLISHED;
84
- }
85
- export interface SigmetFromBackend {
86
- sigmet: Sigmet | CancelSigmet;
87
- creationDate: DateType;
88
- lastUpdateDate: DateType;
89
- uuid: string;
90
- canbe: ProductCanbe[];
91
- author?: string;
92
- }
93
- export interface AirmetFromBackend {
94
- airmet: Airmet | CancelAirmet;
95
- creationDate: DateType;
96
- lastUpdateDate: DateType;
97
- uuid: string;
98
- canbe: ProductCanbe[];
99
- author?: string;
100
- }
101
- export {};
package/src/utils.d.ts DELETED
@@ -1,12 +0,0 @@
1
- import type { MutationOptions, QueryClient, UseQueryResult } from '@tanstack/react-query';
2
- import type { Credentials } from '@opengeoweb/authentication';
3
- export declare const getHeaders: (auth?: Credentials) => HeadersInit;
4
- export declare const handleResponse: (response: Response) => Promise<any>;
5
- export declare const useAuthQuery: <T>(queryKey: string[], queryFn: (auth: Credentials) => Promise<T>, disabled?: boolean, refetchInterval?: number | false) => UseQueryResult<T>;
6
- export declare const optimisticUpdate: <U extends {
7
- id?: string;
8
- }, T extends {
9
- id?: string;
10
- }>(updatedQueryKey: string[], queryClient: QueryClient, optimisticUpdate: (oldValue: U, variables: T) => U, errorCallback?: (err: Error) => void) => MutationOptions<Headers | null, Error, T, {
11
- oldData: U[] | undefined;
12
- }>;
@@ -1 +0,0 @@
1
- export {};