@opengeoweb/api 9.25.2 → 9.26.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 +2269 -1
- package/package.json +3 -2
- package/src/index.d.ts +2 -0
- package/src/sigmet-airmet-api/api.d.ts +8 -0
- package/src/sigmet-airmet-api/config-types.d.ts +87 -0
- package/src/sigmet-airmet-api/definitions.d.ts +141 -0
- package/src/sigmet-airmet-api/types.d.ts +98 -0
- package/src/utils.d.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/api",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.26.0",
|
|
4
4
|
"description": "GeoWeb API library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"url": "git@gitlab.com:opengeoweb/opengeoweb.git"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@opengeoweb/authentication": "*"
|
|
11
|
+
"@opengeoweb/authentication": "*",
|
|
12
|
+
"@opengeoweb/store": "*"
|
|
12
13
|
},
|
|
13
14
|
"peerDependencies": {},
|
|
14
15
|
"module": "./index.esm.js",
|
package/src/index.d.ts
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Credentials } from '@opengeoweb/authentication';
|
|
2
|
+
import { AirmetFromBackend, SigmetFromBackend } from './types';
|
|
3
|
+
import { AirmetConfig, SigmetConfig } from './config-types';
|
|
4
|
+
export declare const getAirmetList: (auth: Credentials) => Promise<AirmetFromBackend[]>;
|
|
5
|
+
export declare const getSigmetList: (auth: Credentials) => Promise<SigmetFromBackend[]>;
|
|
6
|
+
export declare const getlocalProductConfig: <T extends SigmetConfig | AirmetConfig>(configUrl: string) => Promise<T>;
|
|
7
|
+
export declare const getAirmetConfig: (auth: Credentials) => Promise<AirmetConfig>;
|
|
8
|
+
export declare const getSigmetConfig: (auth: Credentials) => Promise<SigmetConfig>;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { 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
|
+
adjacent_firs: string[];
|
|
51
|
+
area_preset: 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 {};
|
|
@@ -0,0 +1,141 @@
|
|
|
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
|
+
CANCELLED = "CANCELLED",
|
|
16
|
+
EXPIRED = "EXPIRED",
|
|
17
|
+
DISCARDED = "DISCARDED"
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* ProductSequence is a sequence label with a counter of the SIGMETs/AIRMETs issued on a day (starting at with 1 01:00),
|
|
21
|
+
* max 3 characters long; first character should be a capital letter,
|
|
22
|
+
* others are numbers: A01-A99, 01-99 or 1-99 */
|
|
23
|
+
export type ProductSequenceId = string;
|
|
24
|
+
/**
|
|
25
|
+
* ProductCanbe lifecycle is determined by the backend. E.g. the backend fills in these properties:
|
|
26
|
+
* 'DRAFTED': product can be saved as draft
|
|
27
|
+
* 'DISCARDED': This product can be thrown away
|
|
28
|
+
* 'PUBLISHED': product can be PUBLISHED
|
|
29
|
+
* 'CANCELLED': product can be CANCELLED */
|
|
30
|
+
export type ProductCanbe = 'DRAFTED' | 'DISCARDED' | 'PUBLISHED' | 'CANCELLED';
|
|
31
|
+
export type ObservationOrForcast = 'OBS' | 'FCST';
|
|
32
|
+
export declare enum LevelUnits {
|
|
33
|
+
'FT' = "ft",
|
|
34
|
+
'M' = "m",
|
|
35
|
+
'FL' = "FL"
|
|
36
|
+
}
|
|
37
|
+
export declare enum CloudLevelUnits {
|
|
38
|
+
'FT' = "ft",
|
|
39
|
+
'M' = "m"
|
|
40
|
+
}
|
|
41
|
+
/** Change type of the Product, can be:
|
|
42
|
+
* INTSF:Intensifying
|
|
43
|
+
* WKN: Weakening
|
|
44
|
+
* NC: No change */
|
|
45
|
+
export type Change = 'INTSF' | 'WKN' | 'NC';
|
|
46
|
+
export type LevelInfoMode = 'AT' | 'BETW' | 'BETW_SFC' | 'TOPS' | 'TOPS_ABV' | 'TOPS_BLW' | 'ABV';
|
|
47
|
+
/**
|
|
48
|
+
* The possible phenomena for the sigmet
|
|
49
|
+
*/
|
|
50
|
+
export declare enum SigmetPhenomena {
|
|
51
|
+
'EMBD_TS' = "Embedded thunderstorm(s)",
|
|
52
|
+
'EMBD_TSGR' = "Embedded thunderstorm(s) with hail",
|
|
53
|
+
'FRQ_TS' = "Frequent thunderstorm(s)",
|
|
54
|
+
'FRQ_TSGR' = "Frequent thunderstorm(s) with hail",
|
|
55
|
+
'HVY_DS' = "Heavy duststorm",
|
|
56
|
+
'HVY_SS' = "Heavy sandstorm",
|
|
57
|
+
'OBSC_TS' = "Obscured thunderstorm(s)",
|
|
58
|
+
'OBSC_TSGR' = "Obscured thunderstorm(s) with hail",
|
|
59
|
+
'RDOACT_CLD' = "Radioactive cloud",
|
|
60
|
+
'SEV_ICE' = "Severe icing",
|
|
61
|
+
'SEV_ICE_FRZ_RN' = "Severe icing due to freezing rain",
|
|
62
|
+
'SEV_MTW' = "Severe mountain wave",
|
|
63
|
+
'SEV_TURB' = "Severe turbulence",
|
|
64
|
+
'SQL_TS' = "Squall line",
|
|
65
|
+
'SQL_TSGR' = "Squall line thunderstorm(s) with hail",
|
|
66
|
+
'VA_CLD' = "Volcanic ash cloud"
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The possible phenomena for the airmet
|
|
70
|
+
*/
|
|
71
|
+
export declare enum AirmetPhenomena {
|
|
72
|
+
'SFC_VIS' = "Surface visibility",
|
|
73
|
+
'SFC_WIND' = "Surface wind",
|
|
74
|
+
'OVC_CLD' = "Overcast cloud",
|
|
75
|
+
'BKN_CLD' = "Broken cloud",
|
|
76
|
+
'ISOL_CB' = "Isolated cumulonimbus cloud",
|
|
77
|
+
'OCNL_CB' = "Occasional cumulonimbus cloud",
|
|
78
|
+
'FRQ_CB' = "Frequent cumulonimbus cloud",
|
|
79
|
+
'ISOL_TS' = "Isolated thunderstorm(s)",
|
|
80
|
+
'OCNL_TS' = "Occasional thunderstorm(s)",
|
|
81
|
+
'ISOL_TSGR' = "Isolated thunderstorm(s) with hail",
|
|
82
|
+
'OCNL_TSGR' = "Occasional thunderstorm(s) with hail",
|
|
83
|
+
'ISOL_TCU' = "Isolated towering cumulus cloud",
|
|
84
|
+
'OCNL_TCU' = "Occasional towering cumulus cloud",
|
|
85
|
+
'FRQ_TCU' = "Frequent towering cumulus cloud",
|
|
86
|
+
'MOD_ICE' = "Moderate icing",
|
|
87
|
+
'MOD_MTW' = "Moderate mountain wave",
|
|
88
|
+
'MOD_TURB' = "Moderate turbulence",
|
|
89
|
+
'MT_OBSC' = "Mountains obscured"
|
|
90
|
+
}
|
|
91
|
+
export type SigmetMovementType = 'STATIONARY' | 'MOVEMENT' | 'FORECAST_POSITION' | 'NO_VA_EXP';
|
|
92
|
+
export type AirmetMovementType = 'STATIONARY' | 'MOVEMENT';
|
|
93
|
+
export declare enum MovementUnit {
|
|
94
|
+
'KT' = "kt",
|
|
95
|
+
'KMH' = "kmh"
|
|
96
|
+
}
|
|
97
|
+
export declare enum WindUnit {
|
|
98
|
+
'KT' = "kt",
|
|
99
|
+
'MPS' = "mps"
|
|
100
|
+
}
|
|
101
|
+
export declare enum Direction {
|
|
102
|
+
'N' = "N",
|
|
103
|
+
'NNE' = "NNE",
|
|
104
|
+
'NE' = "NE",
|
|
105
|
+
'ENE' = "ENE",
|
|
106
|
+
'E' = "E",
|
|
107
|
+
'ESE' = "ESE",
|
|
108
|
+
'SE' = "SE",
|
|
109
|
+
'SSE' = "SSE",
|
|
110
|
+
'S' = "S",
|
|
111
|
+
'SSW' = "SSW",
|
|
112
|
+
'SW' = "SW",
|
|
113
|
+
'WSW' = "WSW",
|
|
114
|
+
'W' = "W",
|
|
115
|
+
'WNW' = "WNW",
|
|
116
|
+
'NW' = "NW",
|
|
117
|
+
'NNW' = "NNW"
|
|
118
|
+
}
|
|
119
|
+
export type VisibilityUnit = 'm';
|
|
120
|
+
export declare enum VisibilityCause {
|
|
121
|
+
'DZ' = "Drizzle",
|
|
122
|
+
'DU' = "Dust",
|
|
123
|
+
'PO' = "Dust or sand devil",
|
|
124
|
+
'DS' = "Dust storm",
|
|
125
|
+
'FG' = "Fog",
|
|
126
|
+
'FC' = "Funnel clouds",
|
|
127
|
+
'GR' = "Hail",
|
|
128
|
+
'HZ' = "Haze",
|
|
129
|
+
'PL' = "Ice pellets",
|
|
130
|
+
'BR' = "Mist",
|
|
131
|
+
'RA' = "Rain",
|
|
132
|
+
'SA' = "Sand",
|
|
133
|
+
'SS' = "Sand storm",
|
|
134
|
+
'FU' = "Smoke",
|
|
135
|
+
'SN' = "Snow",
|
|
136
|
+
'SG' = "Snow grains",
|
|
137
|
+
'GS' = "Soft hail",
|
|
138
|
+
'SQ' = "Squalls",
|
|
139
|
+
'VA' = "Volcanic Ash"
|
|
140
|
+
}
|
|
141
|
+
export type CloudLevelInfoMode = 'BETW' | 'BETW_SFC' | 'BETW_SFC_ABV' | 'BETW_ABV';
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { 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
|
+
}
|
|
25
|
+
interface Product extends BaseProduct {
|
|
26
|
+
status: ProductStatus;
|
|
27
|
+
isObservationOrForecast?: ObservationOrForcast;
|
|
28
|
+
observationOrForecastTime?: DateType;
|
|
29
|
+
change?: Change;
|
|
30
|
+
levelInfoMode?: LevelInfoMode;
|
|
31
|
+
level?: LevelType;
|
|
32
|
+
lowerLevel?: LevelType;
|
|
33
|
+
firGeometry?: GeoJSON.FeatureCollection;
|
|
34
|
+
startGeometry: GeoJSON.FeatureCollection;
|
|
35
|
+
startGeometryIntersect: GeoJSON.FeatureCollection;
|
|
36
|
+
movementSpeed?: number;
|
|
37
|
+
movementUnit?: MovementUnit;
|
|
38
|
+
movementDirection?: Direction;
|
|
39
|
+
}
|
|
40
|
+
export interface Sigmet extends Product {
|
|
41
|
+
phenomenon: SigmetPhenomena;
|
|
42
|
+
type: 'NORMAL' | 'TEST' | 'EXERCISE' | 'SHORT_TEST' | 'SHORT_VA_TEST';
|
|
43
|
+
endGeometry?: GeoJSON.FeatureCollection;
|
|
44
|
+
endGeometryIntersect?: GeoJSON.FeatureCollection;
|
|
45
|
+
movementType?: SigmetMovementType;
|
|
46
|
+
/** Extra properties in case of va SIGMET */
|
|
47
|
+
vaSigmetVolcanoName?: string;
|
|
48
|
+
vaSigmetVolcanoCoordinates?: Coordinate;
|
|
49
|
+
/** Extra properties in case of cancel va SIGMET, if set to unknown, property not set */
|
|
50
|
+
vaSigmetMoveToFIR?: ICAOLocation;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* To cancel a published sigmet
|
|
54
|
+
* To cancel a published sigmet, we send a cancel sigmet with all the mandatory properties from the basesigmet. */
|
|
55
|
+
export interface CancelSigmet extends BaseProduct {
|
|
56
|
+
cancelsSigmetSequenceId: ProductSequenceId;
|
|
57
|
+
validDateStartOfSigmetToCancel: DateType;
|
|
58
|
+
validDateEndOfSigmetToCancel: DateType;
|
|
59
|
+
status: ProductStatus.PUBLISHED;
|
|
60
|
+
/** Extra properties in case of cancel va SIGMET, if set to unknown, property not set */
|
|
61
|
+
vaSigmetMoveToFIR?: ICAOLocation;
|
|
62
|
+
}
|
|
63
|
+
export interface Airmet extends Product {
|
|
64
|
+
phenomenon: AirmetPhenomena;
|
|
65
|
+
status: ProductStatus;
|
|
66
|
+
type: 'NORMAL' | 'TEST' | 'EXERCISE';
|
|
67
|
+
movementType: AirmetMovementType;
|
|
68
|
+
windSpeed?: number;
|
|
69
|
+
windUnit?: WindUnit;
|
|
70
|
+
windDirection?: number;
|
|
71
|
+
visibilityValue?: number;
|
|
72
|
+
visibilityCause?: VisibilityCause;
|
|
73
|
+
visibilityUnit?: VisibilityUnit;
|
|
74
|
+
cloudLevelInfoMode?: CloudLevelInfoMode;
|
|
75
|
+
cloudLevel?: CloudLevelType;
|
|
76
|
+
cloudLowerLevel?: CloudLevelType;
|
|
77
|
+
}
|
|
78
|
+
export interface CancelAirmet extends BaseProduct {
|
|
79
|
+
cancelsAirmetSequenceId: ProductSequenceId;
|
|
80
|
+
validDateStartOfAirmetToCancel: DateType;
|
|
81
|
+
validDateEndOfAirmetToCancel: DateType;
|
|
82
|
+
status: ProductStatus.PUBLISHED;
|
|
83
|
+
}
|
|
84
|
+
export interface SigmetFromBackend {
|
|
85
|
+
sigmet: Sigmet | CancelSigmet;
|
|
86
|
+
creationDate: DateType;
|
|
87
|
+
lastUpdateDate: DateType;
|
|
88
|
+
uuid: string;
|
|
89
|
+
canbe: ProductCanbe[];
|
|
90
|
+
}
|
|
91
|
+
export interface AirmetFromBackend {
|
|
92
|
+
airmet: Airmet | CancelAirmet;
|
|
93
|
+
creationDate: DateType;
|
|
94
|
+
lastUpdateDate: DateType;
|
|
95
|
+
uuid: string;
|
|
96
|
+
canbe: ProductCanbe[];
|
|
97
|
+
}
|
|
98
|
+
export {};
|
package/src/utils.d.ts
ADDED