@opengeoweb/api 16.0.0 → 17.0.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 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;
@@ -292,6 +292,7 @@ var withJsonFormat = function withJsonFormat(url) {
292
292
  urlObj.searchParams.set('f', 'json');
293
293
  return urlObj.toString();
294
294
  };
295
+
295
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
296
297
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
297
298
  var handleResponse = /*#__PURE__*/function () {
@@ -464,37 +465,70 @@ var makeMockApiCall = function makeMockApiCall(response, responseInit, delayDura
464
465
  * Copyright 2024 - Finnish Meteorological Institute (FMI)
465
466
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
466
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
+
467
483
  /**
468
484
  * ProductStatus is returned by the backend. The backend fills in this property.
469
485
  * For the backend, it should only need to store 'DRAFT' | 'PUBLISHED' | 'CANCELLED' in its DB.
470
486
  * The backend should derive and return the status 'EXPIRED' from the product properties.
471
487
  *
472
488
  * Note: ProductStatus from the backend should be refreshed regularly to display status updates. */
473
- var ProductStatus;
474
- (function (ProductStatus) {
489
+ var ProductStatus = /*#__PURE__*/function (ProductStatus) {
475
490
  ProductStatus["DRAFT"] = "DRAFT";
476
491
  ProductStatus["PUBLISHED"] = "PUBLISHED";
477
492
  ProductStatus["RENEWED"] = "RENEWED";
478
493
  ProductStatus["CANCELLED"] = "CANCELLED";
479
494
  ProductStatus["EXPIRED"] = "EXPIRED";
480
495
  ProductStatus["DISCARDED"] = "DISCARDED";
481
- })(ProductStatus || (ProductStatus = {}));
482
- var LevelUnits;
483
- (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) {
484
512
  LevelUnits["FT"] = "ft";
485
513
  LevelUnits["M"] = "m";
486
514
  LevelUnits["FL"] = "FL";
487
- })(LevelUnits || (LevelUnits = {}));
488
- var CloudLevelUnits;
489
- (function (CloudLevelUnits) {
515
+ return LevelUnits;
516
+ }({});
517
+ var CloudLevelUnits = /*#__PURE__*/function (CloudLevelUnits) {
490
518
  CloudLevelUnits["FT"] = "ft";
491
519
  CloudLevelUnits["M"] = "m";
492
- })(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
+
493
528
  /**
494
529
  * The possible phenomena for the sigmet
495
530
  */
496
- var SigmetPhenomena;
497
- (function (SigmetPhenomena) {
531
+ var SigmetPhenomena = /*#__PURE__*/function (SigmetPhenomena) {
498
532
  SigmetPhenomena["EMBD_TS"] = "Embedded thunderstorm(s)";
499
533
  SigmetPhenomena["EMBD_TSGR"] = "Embedded thunderstorm(s) with hail";
500
534
  SigmetPhenomena["FRQ_TS"] = "Frequent thunderstorm(s)";
@@ -510,14 +544,14 @@ var SigmetPhenomena;
510
544
  SigmetPhenomena["SEV_TURB"] = "Severe turbulence";
511
545
  SigmetPhenomena["SQL_TS"] = "Squall line thunderstorm(s)";
512
546
  SigmetPhenomena["SQL_TSGR"] = "Squall line thunderstorm(s) with hail";
513
- // 'TC' = 'Tropical cyclone', // Don't show this option in the list because it will be not used by KNMI.
514
547
  SigmetPhenomena["VA_CLD"] = "Volcanic ash cloud";
515
- })(SigmetPhenomena || (SigmetPhenomena = {}));
548
+ return SigmetPhenomena;
549
+ }({});
550
+
516
551
  /**
517
552
  * The possible phenomena for the airmet
518
553
  */
519
- var AirmetPhenomena;
520
- (function (AirmetPhenomena) {
554
+ var AirmetPhenomena = /*#__PURE__*/function (AirmetPhenomena) {
521
555
  AirmetPhenomena["SFC_VIS"] = "Surface visibility";
522
556
  AirmetPhenomena["SFC_WIND"] = "Surface wind";
523
557
  AirmetPhenomena["OVC_CLD"] = "Overcast cloud";
@@ -536,21 +570,30 @@ var AirmetPhenomena;
536
570
  AirmetPhenomena["MOD_MTW"] = "Moderate mountain wave";
537
571
  AirmetPhenomena["MOD_TURB"] = "Moderate turbulence";
538
572
  AirmetPhenomena["MT_OBSC"] = "Mountains obscured";
539
- })(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
+
540
584
  /* Speed unit, e.g. 'KT', 'KMH' */
541
- var MovementUnit;
542
- (function (MovementUnit) {
585
+ var MovementUnit = /*#__PURE__*/function (MovementUnit) {
543
586
  MovementUnit["KT"] = "kt";
544
587
  MovementUnit["KMH"] = "kmh";
545
- })(MovementUnit || (MovementUnit = {}));
588
+ return MovementUnit;
589
+ }({});
546
590
  // can these be unified as SpeedUnit?
547
- var WindUnit;
548
- (function (WindUnit) {
591
+ var WindUnit = /*#__PURE__*/function (WindUnit) {
549
592
  WindUnit["KT"] = "kt";
550
593
  WindUnit["MPS"] = "mps";
551
- })(WindUnit || (WindUnit = {}));
552
- var Direction;
553
- (function (Direction) {
594
+ return WindUnit;
595
+ }({});
596
+ var Direction = /*#__PURE__*/function (Direction) {
554
597
  Direction["N"] = "N";
555
598
  Direction["NNE"] = "NNE";
556
599
  Direction["NE"] = "NE";
@@ -567,9 +610,9 @@ var Direction;
567
610
  Direction["WNW"] = "WNW";
568
611
  Direction["NW"] = "NW";
569
612
  Direction["NNW"] = "NNW";
570
- })(Direction || (Direction = {}));
571
- var VisibilityCause;
572
- (function (VisibilityCause) {
613
+ return Direction;
614
+ }({});
615
+ var VisibilityCause = /*#__PURE__*/function (VisibilityCause) {
573
616
  VisibilityCause["DZ"] = "Drizzle";
574
617
  VisibilityCause["DU"] = "Dust";
575
618
  VisibilityCause["PO"] = "Dust or sand devil";
@@ -589,7 +632,8 @@ var VisibilityCause;
589
632
  VisibilityCause["GS"] = "Soft hail";
590
633
  VisibilityCause["SQ"] = "Squalls";
591
634
  VisibilityCause["VA"] = "Volcanic Ash";
592
- })(VisibilityCause || (VisibilityCause = {}));
635
+ return VisibilityCause;
636
+ }({});
593
637
 
594
638
  /* *
595
639
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -608,6 +652,7 @@ var VisibilityCause;
608
652
  * Copyright 2025 - Finnish Meteorological Institute (FMI)
609
653
  * Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
610
654
  * */
655
+
611
656
  var queryClientInstance = null;
612
657
  var getQueryClient = function getQueryClient() {
613
658
  var _queryClientInstance;
@@ -659,6 +704,24 @@ var resetQueryClient = function resetQueryClient() {
659
704
  queryClientInstance = null;
660
705
  };
661
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
+
662
725
  var QueryClientProviderWrapper = function QueryClientProviderWrapper(_ref) {
663
726
  var client = _ref.client,
664
727
  children = _ref.children,
@@ -671,9 +734,9 @@ var QueryClientProviderWrapper = function QueryClientProviderWrapper(_ref) {
671
734
  }
672
735
  return mode === 'test' ? createTestQueryClient() : getQueryClient();
673
736
  }, [client, mode]);
674
- return jsxs(QueryClientProvider, {
737
+ return /*#__PURE__*/jsxs(QueryClientProvider, {
675
738
  client: queryClient,
676
- children: [children, jsx(ReactQueryDevtools, {
739
+ children: [children, /*#__PURE__*/jsx(ReactQueryDevtools, {
677
740
  initialIsOpen: false
678
741
  })]
679
742
  });
@@ -696,7 +759,9 @@ var QueryClientProviderWrapper = function QueryClientProviderWrapper(_ref) {
696
759
  * Copyright 2024 - Finnish Meteorological Institute (FMI)
697
760
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
698
761
  * */
762
+
699
763
  var API_NAMESPACE = 'api';
764
+
700
765
  // Initialize and create provider if needed
701
766
 
702
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": "16.0.0",
3
+ "version": "17.0.1",
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": "16.0.0",
12
- "@opengeoweb/store": "16.0.0",
11
+ "@opengeoweb/authentication": "17.0.1",
12
+ "@opengeoweb/store": "17.0.1",
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,13 +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 withJsonFormat: (url: string) => string;
5
- export declare const handleResponse: (response: Response) => Promise<any>;
6
- export declare const useAuthQuery: <T>(queryKey: string[], queryFn: (auth: Credentials) => Promise<T>, disabled?: boolean, refetchInterval?: number | false) => UseQueryResult<T>;
7
- export declare const optimisticUpdate: <U extends {
8
- id?: string;
9
- }, T extends {
10
- id?: string;
11
- }>(updatedQueryKey: string[], queryClient: QueryClient, optimisticUpdate: (oldValue: U, variables: T) => U, errorCallback?: (err: Error) => void) => MutationOptions<Headers | null, Error, T, {
12
- oldData: U[] | undefined;
13
- }>;
@@ -1 +0,0 @@
1
- export {};