@opengeoweb/api 21.2.0 → 21.3.0-nightly-20261128

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/README.md CHANGED
@@ -15,6 +15,7 @@
15
15
  - [Use api inside app for production (api.ts)](#use-api-inside-app-for-production--apits-)
16
16
  - [Use (fake)api inside libs for storybook](#use--fake-api-inside-libs-for-storybook)
17
17
  - [Use the `useApiContext` to access the api or fakeApi](#use-the--useapicontext--to-access-the-api-or-fakeapi)
18
+ - [EDR queries](#edr-queries)
18
19
 
19
20
  <small><i><a href='http://ecotrust-canada.github.io/markdown-toc/'>Table of contents generated with markdown-toc</a></i></small>
20
21
 
@@ -219,6 +220,36 @@ export const StoryBookExample = (): React.ReactElement => (
219
220
 
220
221
  ```
221
222
 
223
+ ## EDR queries
224
+
225
+ Clients for open standards live in `src/standards/`, one folder per standard: EDR now, possibly STAC, WMS and WMTS later. Every GeoWeb lib that reads data in one of these standards uses this one client instead of writing its own.
226
+
227
+ `edrQueries` holds the [OGC API - EDR](https://ogcapi.ogc.org/edr/) requests. A query fetches, validates and caches the raw CoverageJSON response. Each consumer then derives its own view in `select`:
228
+
229
+ ```ts
230
+ const { data: sectionGrid } = useQuery({
231
+ ...edrQueries.trajectory(request),
232
+ select: toSectionGrid,
233
+ });
234
+ ```
235
+
236
+ Rules, and why:
237
+
238
+ - **Keys describe only the request**, never plot IDs, units or other view state. Consumers asking for the same data then share one cache entry, and derived data cannot go stale.
239
+ - **Conversion to chart or map shapes stays in the consumer**, in `select`. This keeps `api` independent of the libs that use it.
240
+ - **Validate what we read and keep the rest.** The schemas in `standards/edr/schemas.ts` use Zod `looseObject` and allow `null` values, because servers add fields and send gaps, and neither should break a view.
241
+ - **A single `Coverage` is returned as a one-coverage collection.** CoverageJSON lets a server answer either way, so consumers only handle one shape.
242
+ - **An invalid response throws `EdrResponseError` and is not retried.** Retrying does not change the server's answer.
243
+ - **Types come from the schemas** (`z.infer`), so the type and the runtime check cannot drift apart.
244
+ - **Zod runs with `jitless: true`.** Otherwise Zod tries `eval` at startup, and our Content-Security-Policy blocks it.
245
+
246
+ To add a query type:
247
+
248
+ 1. Add its schema to `standards/edr/schemas.ts` and its inferred type to `standards/edr/types.ts`.
249
+ 2. Add the URL builder and fetcher to `standards/edr/api.ts`.
250
+ 3. Add its key and query to `standards/edr/queryOptions.ts`.
251
+ 4. Save a real server response in `standards/edr/mockdata`, and test the schema against it and against broken copies of it.
252
+
222
253
  ### TypeScript Documentation
223
254
 
224
255
  - [TypeScript Docs](https://opengeoweb.gitlab.io/opengeoweb/typescript-docs/api/)
package/dist/README.md CHANGED
@@ -15,6 +15,7 @@
15
15
  - [Use api inside app for production (api.ts)](#use-api-inside-app-for-production--apits-)
16
16
  - [Use (fake)api inside libs for storybook](#use--fake-api-inside-libs-for-storybook)
17
17
  - [Use the `useApiContext` to access the api or fakeApi](#use-the--useapicontext--to-access-the-api-or-fakeapi)
18
+ - [EDR queries](#edr-queries)
18
19
 
19
20
  <small><i><a href='http://ecotrust-canada.github.io/markdown-toc/'>Table of contents generated with markdown-toc</a></i></small>
20
21
 
@@ -219,6 +220,36 @@ export const StoryBookExample = (): React.ReactElement => (
219
220
 
220
221
  ```
221
222
 
223
+ ## EDR queries
224
+
225
+ Clients for open standards live in `src/standards/`, one folder per standard: EDR now, possibly STAC, WMS and WMTS later. Every GeoWeb lib that reads data in one of these standards uses this one client instead of writing its own.
226
+
227
+ `edrQueries` holds the [OGC API - EDR](https://ogcapi.ogc.org/edr/) requests. A query fetches, validates and caches the raw CoverageJSON response. Each consumer then derives its own view in `select`:
228
+
229
+ ```ts
230
+ const { data: sectionGrid } = useQuery({
231
+ ...edrQueries.trajectory(request),
232
+ select: toSectionGrid,
233
+ });
234
+ ```
235
+
236
+ Rules, and why:
237
+
238
+ - **Keys describe only the request**, never plot IDs, units or other view state. Consumers asking for the same data then share one cache entry, and derived data cannot go stale.
239
+ - **Conversion to chart or map shapes stays in the consumer**, in `select`. This keeps `api` independent of the libs that use it.
240
+ - **Validate what we read and keep the rest.** The schemas in `standards/edr/schemas.ts` use Zod `looseObject` and allow `null` values, because servers add fields and send gaps, and neither should break a view.
241
+ - **A single `Coverage` is returned as a one-coverage collection.** CoverageJSON lets a server answer either way, so consumers only handle one shape.
242
+ - **An invalid response throws `EdrResponseError` and is not retried.** Retrying does not change the server's answer.
243
+ - **Types come from the schemas** (`z.infer`), so the type and the runtime check cannot drift apart.
244
+ - **Zod runs with `jitless: true`.** Otherwise Zod tries `eval` at startup, and our Content-Security-Policy blocks it.
245
+
246
+ To add a query type:
247
+
248
+ 1. Add its schema to `standards/edr/schemas.ts` and its inferred type to `standards/edr/types.ts`.
249
+ 2. Add the URL builder and fetcher to `standards/edr/api.ts`.
250
+ 3. Add its key and query to `standards/edr/queryOptions.ts`.
251
+ 4. Save a real server response in `standards/edr/mockdata`, and test the schema against it and against broken copies of it.
252
+
222
253
  ### TypeScript Documentation
223
254
 
224
255
  - [TypeScript Docs](https://opengeoweb.gitlab.io/opengeoweb/typescript-docs/api/)
package/dist/index.esm.js CHANGED
@@ -1,11 +1,12 @@
1
- import { useAuthenticationContext } from '@opengeoweb/authentication';
1
+ import { useAuthenticationContext, authFetch } from '@opengeoweb/authentication';
2
2
  export * from '@opengeoweb/authentication';
3
- import { useQuery, QueryClientProvider } from '@tanstack/react-query';
3
+ import { useQuery, QueryClientProvider, queryOptions } from '@tanstack/react-query';
4
4
  import { omit } from 'lodash';
5
5
  import { jsxs, jsx } from 'react/jsx-runtime';
6
6
  import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
7
7
  import React from 'react';
8
8
  import { QueryClient, keepPreviousData } from '@tanstack/query-core';
9
+ import { z } from 'zod';
9
10
 
10
11
  function asyncGeneratorStep(n, t, e, r, o, a, c) {
11
12
  try {
@@ -32,6 +33,45 @@ function _asyncToGenerator(n) {
32
33
  });
33
34
  };
34
35
  }
36
+ function _construct(t, e, r) {
37
+ if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
38
+ var o = [null];
39
+ o.push.apply(o, e);
40
+ var p = new (t.bind.apply(t, o))();
41
+ return r && _setPrototypeOf(p, r.prototype), p;
42
+ }
43
+ function _getPrototypeOf(t) {
44
+ return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
45
+ return t.__proto__ || Object.getPrototypeOf(t);
46
+ }, _getPrototypeOf(t);
47
+ }
48
+ function _inheritsLoose(t, o) {
49
+ t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
50
+ }
51
+ function _isNativeFunction(t) {
52
+ try {
53
+ return -1 !== Function.toString.call(t).indexOf("[native code]");
54
+ } catch (n) {
55
+ return "function" == typeof t;
56
+ }
57
+ }
58
+ function _isNativeReflectConstruct() {
59
+ try {
60
+ var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
61
+ } catch (t) {}
62
+ return (_isNativeReflectConstruct = function () {
63
+ return !!t;
64
+ })();
65
+ }
66
+ function _objectWithoutPropertiesLoose(r, e) {
67
+ if (null == r) return {};
68
+ var t = {};
69
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
70
+ if (-1 !== e.indexOf(n)) continue;
71
+ t[n] = r[n];
72
+ }
73
+ return t;
74
+ }
35
75
  function _regenerator() {
36
76
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
37
77
  var e,
@@ -140,6 +180,33 @@ function _regeneratorDefine(e, r, n, t) {
140
180
  }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
141
181
  }, _regeneratorDefine(e, r, n, t);
142
182
  }
183
+ function _setPrototypeOf(t, e) {
184
+ return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
185
+ return t.__proto__ = e, t;
186
+ }, _setPrototypeOf(t, e);
187
+ }
188
+ function _wrapNativeSuper(t) {
189
+ var r = "function" == typeof Map ? new Map() : void 0;
190
+ return _wrapNativeSuper = function (t) {
191
+ if (null === t || !_isNativeFunction(t)) return t;
192
+ if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
193
+ if (void 0 !== r) {
194
+ if (r.has(t)) return r.get(t);
195
+ r.set(t, Wrapper);
196
+ }
197
+ function Wrapper() {
198
+ return _construct(t, arguments, _getPrototypeOf(this).constructor);
199
+ }
200
+ return Wrapper.prototype = Object.create(t.prototype, {
201
+ constructor: {
202
+ value: Wrapper,
203
+ enumerable: false,
204
+ writable: true,
205
+ configurable: true
206
+ }
207
+ }), _setPrototypeOf(Wrapper, t);
208
+ }, _wrapNativeSuper(t);
209
+ }
143
210
 
144
211
  var getHeaders = function getHeaders(auth) {
145
212
  return omit({
@@ -608,6 +675,435 @@ var QueryClientProviderWrapper = function QueryClientProviderWrapper(_ref) {
608
675
  });
609
676
  };
610
677
 
678
+ var _excluded = ["parameters"];
679
+ // Must run before any schema is created: Zod's eval probe breaks our CSP.
680
+ z.config({
681
+ jitless: true
682
+ });
683
+ var countValuesInShape = function countValuesInShape(shape) {
684
+ return shape.reduce(function (product, size) {
685
+ return product * size;
686
+ }, 1);
687
+ };
688
+ var hasValuesMatchingShape = function hasValuesMatchingShape(_ref) {
689
+ var shape = _ref.shape,
690
+ values = _ref.values;
691
+ return values.length === countValuesInShape(shape);
692
+ };
693
+ var hasPositionsMatchingCoordinates = function hasPositionsMatchingCoordinates(_ref2) {
694
+ var coordinates = _ref2.coordinates,
695
+ values = _ref2.values;
696
+ return values.every(function (position) {
697
+ return position.length === coordinates.length;
698
+ });
699
+ };
700
+ var hasRangesMatchingPositions = function hasRangesMatchingPositions(_ref3) {
701
+ var domain = _ref3.domain,
702
+ ranges = _ref3.ranges;
703
+ return Object.values(ranges).every(function (range) {
704
+ return range.values.length === domain.axes.composite.values.length;
705
+ });
706
+ };
707
+ var languageMapSchema = z.record(z.string(), z.string());
708
+ var ndArraySchema = z.looseObject({
709
+ type: z.literal('NdArray'),
710
+ dataType: z["enum"](['float', 'integer']),
711
+ axisNames: z.array(z.string()),
712
+ shape: z.array(z.number()["int"]().nonnegative()),
713
+ values: z.array(z.number().nullable())
714
+ }).refine(hasValuesMatchingShape, {
715
+ message: 'values length does not match shape',
716
+ path: ['values']
717
+ });
718
+ var parameterSchema = z.looseObject({
719
+ type: z.literal('Parameter'),
720
+ id: z.string().optional(),
721
+ label: languageMapSchema.optional(),
722
+ description: languageMapSchema.optional(),
723
+ observedProperty: z.looseObject({
724
+ id: z.string().optional(),
725
+ label: languageMapSchema
726
+ })
727
+ });
728
+ /** Time, longitude, latitude and, when the server sends it, the vertical level. */
729
+ var trajectoryPositionSchema = z.tuple([z.string(), z.number(), z.number(), z.number().optional()]);
730
+ var compositeAxisSchema = z.looseObject({
731
+ dataType: z.literal('tuple'),
732
+ coordinates: z.tuple([z.literal('t'), z.literal('x'), z.literal('y'), z.literal('z').optional()]),
733
+ values: z.array(trajectoryPositionSchema)
734
+ }).refine(hasPositionsMatchingCoordinates, {
735
+ message: 'position length does not match coordinates',
736
+ path: ['values']
737
+ });
738
+ var trajectoryDomainSchema = z.looseObject({
739
+ type: z.literal('Domain'),
740
+ domainType: z.literal('Trajectory').optional(),
741
+ axes: z.looseObject({
742
+ composite: compositeAxisSchema
743
+ })
744
+ });
745
+ var parametersSchema = z.record(z.string(), parameterSchema);
746
+ var trajectoryCoverageSchema = z.looseObject({
747
+ type: z.literal('Coverage'),
748
+ domain: trajectoryDomainSchema,
749
+ ranges: z.record(z.string(), ndArraySchema)
750
+ }).refine(hasRangesMatchingPositions, {
751
+ message: 'range length does not match the number of positions',
752
+ path: ['ranges']
753
+ });
754
+ var trajectoryCoverageCollectionSchema = z.looseObject({
755
+ type: z.literal('CoverageCollection'),
756
+ domainType: z.literal('Trajectory'),
757
+ parameters: parametersSchema,
758
+ coverages: z.array(trajectoryCoverageSchema)
759
+ });
760
+ var standaloneTrajectoryCoverageSchema = trajectoryCoverageSchema.safeExtend({
761
+ domain: trajectoryDomainSchema.extend({
762
+ domainType: z.literal('Trajectory')
763
+ }),
764
+ parameters: parametersSchema
765
+ });
766
+ var toSingleCoverageCollection = function toSingleCoverageCollection(_ref4) {
767
+ var parameters = _ref4.parameters,
768
+ coverage = _objectWithoutPropertiesLoose(_ref4, _excluded);
769
+ return {
770
+ type: 'CoverageCollection',
771
+ domainType: 'Trajectory',
772
+ parameters: parameters,
773
+ coverages: [coverage]
774
+ };
775
+ };
776
+ /** Servers may answer with a collection or a single coverage; consumers always get a collection. */
777
+ var trajectoryResponseSchema = z.discriminatedUnion('type', [trajectoryCoverageCollectionSchema, standaloneTrajectoryCoverageSchema.transform(toSingleCoverageCollection)]);
778
+
779
+ /** The server answered, but not in the shape we can use. Retrying will not help. */
780
+ var EdrResponseError = /*#__PURE__*/function (_Error) {
781
+ function EdrResponseError(url, details) {
782
+ var _this;
783
+ _this = _Error.call(this, "Invalid EDR response from " + url + "\n" + details) || this;
784
+ _this.name = 'EdrResponseError';
785
+ _this.url = url;
786
+ return _this;
787
+ }
788
+ _inheritsLoose(EdrResponseError, _Error);
789
+ return EdrResponseError;
790
+ }(/*#__PURE__*/_wrapNativeSuper(Error));
791
+ var toLineStringWkt = function toLineStringWkt(path) {
792
+ return "LINESTRING(" + path.map(function (_ref) {
793
+ var longitude = _ref[0],
794
+ latitude = _ref[1];
795
+ return longitude + " " + latitude;
796
+ }).join(',') + ")";
797
+ };
798
+ var appendPathPreservingQuery = function appendPathPreservingQuery(baseUrl, path) {
799
+ var url = new URL(baseUrl);
800
+ url.pathname = "" + url.pathname.replace(/\/+$/, '') + path;
801
+ return url;
802
+ };
803
+ var buildTrajectoryUrl = function buildTrajectoryUrl(_ref2) {
804
+ var baseUrl = _ref2.baseUrl,
805
+ collectionId = _ref2.collectionId,
806
+ instanceId = _ref2.instanceId,
807
+ path = _ref2.path,
808
+ parameterNames = _ref2.parameterNames,
809
+ datetime = _ref2.datetime,
810
+ verticalLevels = _ref2.verticalLevels;
811
+ var instancePath = instanceId ? "/instances/" + instanceId : '';
812
+ var url = appendPathPreservingQuery(baseUrl, "/collections/" + collectionId + instancePath + "/trajectory");
813
+ url.searchParams.set('coords', toLineStringWkt(path));
814
+ url.searchParams.set('parameter-name', parameterNames.join(','));
815
+ url.searchParams.set('datetime', datetime);
816
+ if (verticalLevels) {
817
+ url.searchParams.set('z', verticalLevels);
818
+ }
819
+ url.searchParams.set('f', 'CoverageJSON');
820
+ return url.toString();
821
+ };
822
+ var fetchTrajectory = /*#__PURE__*/function () {
823
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(request, signal) {
824
+ var url, response, result;
825
+ return _regenerator().w(function (_context) {
826
+ while (1) switch (_context.n) {
827
+ case 0:
828
+ url = buildTrajectoryUrl(request);
829
+ _context.n = 1;
830
+ return authFetch(url, {
831
+ headers: getHeaders(),
832
+ signal: signal
833
+ }).then(handleResponse);
834
+ case 1:
835
+ response = _context.v;
836
+ result = trajectoryResponseSchema.safeParse(response);
837
+ if (result.success) {
838
+ _context.n = 2;
839
+ break;
840
+ }
841
+ throw new EdrResponseError(url, z.prettifyError(result.error));
842
+ case 2:
843
+ return _context.a(2, result.data);
844
+ }
845
+ }, _callee);
846
+ }));
847
+ return function fetchTrajectory(_x, _x2) {
848
+ return _ref3.apply(this, arguments);
849
+ };
850
+ }();
851
+
852
+ var EDR_QUERY_KEY_ROOT = 'edr';
853
+ var MAX_RETRY_COUNT = 3;
854
+ var shouldRetryRequest = function shouldRetryRequest(failureCount, error) {
855
+ return !(error instanceof EdrResponseError) && failureCount < MAX_RETRY_COUNT;
856
+ };
857
+ /** Keys describe only what was requested, so every consumer shares one cache entry. */
858
+ var edrQueryKeys = {
859
+ all: [EDR_QUERY_KEY_ROOT],
860
+ trajectory: function trajectory(request) {
861
+ return [EDR_QUERY_KEY_ROOT, 'trajectory', request];
862
+ }
863
+ };
864
+ /** Consumers derive their own view of the raw response with `select`. */
865
+ var edrQueries = {
866
+ trajectory: function trajectory(request) {
867
+ return queryOptions({
868
+ queryKey: edrQueryKeys.trajectory(request),
869
+ queryFn: function () {
870
+ var _queryFn = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref) {
871
+ var signal;
872
+ return _regenerator().w(function (_context) {
873
+ while (1) switch (_context.n) {
874
+ case 0:
875
+ signal = _ref.signal;
876
+ return _context.a(2, fetchTrajectory(request, signal));
877
+ }
878
+ }, _callee);
879
+ }));
880
+ function queryFn(_x) {
881
+ return _queryFn.apply(this, arguments);
882
+ }
883
+ return queryFn;
884
+ }(),
885
+ retry: shouldRetryRequest,
886
+ structuralSharing: false
887
+ });
888
+ }
889
+ };
890
+
891
+ var coverages = [
892
+ {
893
+ type: "Coverage",
894
+ domain: {
895
+ type: "Domain",
896
+ axes: {
897
+ composite: {
898
+ coordinates: [
899
+ "t",
900
+ "x",
901
+ "y",
902
+ "z"
903
+ ],
904
+ dataType: "tuple",
905
+ values: [
906
+ [
907
+ "2026-11-24T12:00:00Z",
908
+ 24.94,
909
+ 60.17,
910
+ 400
911
+ ],
912
+ [
913
+ "2026-11-24T12:00:00Z",
914
+ 25,
915
+ 61,
916
+ 400
917
+ ],
918
+ [
919
+ "2026-11-24T12:00:00Z",
920
+ 25.1,
921
+ 62,
922
+ 400
923
+ ]
924
+ ]
925
+ }
926
+ }
927
+ },
928
+ ranges: {
929
+ temperature: {
930
+ axisNames: [
931
+ "composite"
932
+ ],
933
+ dataType: "float",
934
+ shape: [
935
+ 3
936
+ ],
937
+ type: "NdArray",
938
+ values: [
939
+ -41.1357,
940
+ -41.3261,
941
+ -41.6897
942
+ ]
943
+ },
944
+ windspeedms: {
945
+ axisNames: [
946
+ "composite"
947
+ ],
948
+ dataType: "float",
949
+ shape: [
950
+ 3
951
+ ],
952
+ type: "NdArray",
953
+ values: [
954
+ null,
955
+ null,
956
+ null
957
+ ]
958
+ }
959
+ }
960
+ },
961
+ {
962
+ type: "Coverage",
963
+ domain: {
964
+ type: "Domain",
965
+ axes: {
966
+ composite: {
967
+ coordinates: [
968
+ "t",
969
+ "x",
970
+ "y",
971
+ "z"
972
+ ],
973
+ dataType: "tuple",
974
+ values: [
975
+ [
976
+ "2026-11-24T12:00:00Z",
977
+ 24.94,
978
+ 60.17,
979
+ 850
980
+ ],
981
+ [
982
+ "2026-11-24T12:00:00Z",
983
+ 25,
984
+ 61,
985
+ 850
986
+ ],
987
+ [
988
+ "2026-11-24T12:00:00Z",
989
+ 25.1,
990
+ 62,
991
+ 850
992
+ ]
993
+ ]
994
+ }
995
+ }
996
+ },
997
+ ranges: {
998
+ temperature: {
999
+ axisNames: [
1000
+ "composite"
1001
+ ],
1002
+ dataType: "float",
1003
+ shape: [
1004
+ 3
1005
+ ],
1006
+ type: "NdArray",
1007
+ values: [
1008
+ -7.68589,
1009
+ -7.61997,
1010
+ -6.67112
1011
+ ]
1012
+ },
1013
+ windspeedms: {
1014
+ axisNames: [
1015
+ "composite"
1016
+ ],
1017
+ dataType: "float",
1018
+ shape: [
1019
+ 3
1020
+ ],
1021
+ type: "NdArray",
1022
+ values: [
1023
+ 8.80528,
1024
+ 10.2029,
1025
+ 14.019
1026
+ ]
1027
+ }
1028
+ }
1029
+ }
1030
+ ];
1031
+ var domainType = "Trajectory";
1032
+ var referencing = [
1033
+ {
1034
+ coordinates: [
1035
+ "x",
1036
+ "y"
1037
+ ],
1038
+ system: {
1039
+ id: "OGC:CRS84",
1040
+ type: "GeographicCRS"
1041
+ }
1042
+ },
1043
+ {
1044
+ coordinates: [
1045
+ "z"
1046
+ ],
1047
+ system: {
1048
+ type: "VerticalCRS",
1049
+ description: {
1050
+ en: "Pressure level in hPa"
1051
+ }
1052
+ }
1053
+ },
1054
+ {
1055
+ coordinates: [
1056
+ "t"
1057
+ ],
1058
+ system: {
1059
+ calendar: "Gregorian",
1060
+ type: "TemporalRS"
1061
+ }
1062
+ }
1063
+ ];
1064
+ var type = "CoverageCollection";
1065
+ var parameters = {
1066
+ temperature: {
1067
+ id: "Temperature",
1068
+ type: "Parameter",
1069
+ description: {
1070
+ en: "Temperature"
1071
+ },
1072
+ label: {
1073
+ en: "Temperature"
1074
+ },
1075
+ observedProperty: {
1076
+ id: "Temperature",
1077
+ label: {
1078
+ en: "Temperature"
1079
+ }
1080
+ }
1081
+ },
1082
+ windspeedms: {
1083
+ id: "WindSpeedMS",
1084
+ type: "Parameter",
1085
+ description: {
1086
+ en: "Wind speed"
1087
+ },
1088
+ label: {
1089
+ en: "WindSpeedMS"
1090
+ },
1091
+ observedProperty: {
1092
+ id: "WindSpeedMS",
1093
+ label: {
1094
+ en: "WindSpeedMS"
1095
+ }
1096
+ }
1097
+ }
1098
+ };
1099
+ var harmonieScandinaviaPressureTrajectory = {
1100
+ coverages: coverages,
1101
+ domainType: domainType,
1102
+ referencing: referencing,
1103
+ type: type,
1104
+ parameters: parameters
1105
+ };
1106
+
611
1107
  /* *
612
1108
  * Licensed under the Apache License, Version 2.0 (the "License");
613
1109
  * you may not use this file except in compliance with the License.
@@ -628,4 +1124,4 @@ var QueryClientProviderWrapper = function QueryClientProviderWrapper(_ref) {
628
1124
  var API_NAMESPACE = 'api';
629
1125
  // Initialize and create provider if needed
630
1126
 
631
- export { API_NAMESPACE, AirmetPhenomena, CloudLevelUnits, Direction, LevelUnits, MovementUnit, ProductStatus, QueryClientProviderWrapper, SigmetPhenomena, VisibilityCause, WindUnit, configureLibraryDefaults, createTestQueryClient, getHeaders, getQueryClient, handleResponse, makeMockApiCall, optimisticUpdate, resetQueryClient, setQueryClient, throwResponseError, useAuthQuery, withJsonFormat };
1127
+ export { API_NAMESPACE, AirmetPhenomena, CloudLevelUnits, Direction, EdrResponseError, LevelUnits, MovementUnit, ProductStatus, QueryClientProviderWrapper, SigmetPhenomena, VisibilityCause, WindUnit, buildTrajectoryUrl, configureLibraryDefaults, createTestQueryClient, edrQueries, edrQueryKeys, fetchTrajectory, getHeaders, getQueryClient, handleResponse, makeMockApiCall, harmonieScandinaviaPressureTrajectory as mockEdrTrajectoryResponse, optimisticUpdate, resetQueryClient, setQueryClient, throwResponseError, useAuthQuery, withJsonFormat };
@@ -3,6 +3,6 @@ export * from './utils';
3
3
  export * from './fakeApi';
4
4
  export type * from './sigmet-airmet-api/types';
5
5
  export * from './sigmet-airmet-api/definitions';
6
- export type * from './sigmet-airmet-api/config-types';
7
6
  export * from './query-client';
7
+ export * from './standards/edr';
8
8
  export { API_NAMESPACE } from './i18n';
@@ -0,0 +1,8 @@
1
+ import type { EdrTrajectoryCoverageCollection, EdrTrajectoryRequest } from './types';
2
+ /** The server answered, but not in the shape we can use. Retrying will not help. */
3
+ export declare class EdrResponseError extends Error {
4
+ readonly url: string;
5
+ constructor(url: string, details: string);
6
+ }
7
+ export declare const buildTrajectoryUrl: ({ baseUrl, collectionId, instanceId, path, parameterNames, datetime, verticalLevels, }: EdrTrajectoryRequest) => string;
8
+ export declare const fetchTrajectory: (request: EdrTrajectoryRequest, signal?: AbortSignal) => Promise<EdrTrajectoryCoverageCollection>;
@@ -0,0 +1,4 @@
1
+ export type * from './types';
2
+ export { EdrResponseError, buildTrajectoryUrl, fetchTrajectory } from './api';
3
+ export { edrQueries, edrQueryKeys } from './queryOptions';
4
+ export { default as mockEdrTrajectoryResponse } from './mockdata/harmonieScandinaviaPressureTrajectory.json';
@@ -0,0 +1,185 @@
1
+ import type { EdrTrajectoryRequest } from './types';
2
+ /** Keys describe only what was requested, so every consumer shares one cache entry. */
3
+ export declare const edrQueryKeys: {
4
+ all: readonly ["edr"];
5
+ trajectory: (request: EdrTrajectoryRequest) => readonly ["edr", "trajectory", EdrTrajectoryRequest];
6
+ };
7
+ /** Consumers derive their own view of the raw response with `select`. */
8
+ export declare const edrQueries: {
9
+ readonly trajectory: (request: EdrTrajectoryRequest) => import("@tanstack/query-core").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
10
+ [x: string]: unknown;
11
+ type: "CoverageCollection";
12
+ domainType: "Trajectory";
13
+ parameters: Record<string, {
14
+ [x: string]: unknown;
15
+ type: "Parameter";
16
+ observedProperty: {
17
+ [x: string]: unknown;
18
+ label: Record<string, string>;
19
+ id?: string | undefined;
20
+ };
21
+ id?: string | undefined;
22
+ label?: Record<string, string> | undefined;
23
+ description?: Record<string, string> | undefined;
24
+ }>;
25
+ coverages: {
26
+ [x: string]: unknown;
27
+ type: "Coverage";
28
+ domain: {
29
+ [x: string]: unknown;
30
+ type: "Domain";
31
+ axes: {
32
+ [x: string]: unknown;
33
+ composite: {
34
+ [x: string]: unknown;
35
+ dataType: "tuple";
36
+ coordinates: ["t", "x", "y", ("z" | undefined)?];
37
+ values: [string, number, number, (number | undefined)?][];
38
+ };
39
+ };
40
+ domainType?: "Trajectory" | undefined;
41
+ };
42
+ ranges: Record<string, {
43
+ [x: string]: unknown;
44
+ type: "NdArray";
45
+ dataType: "float" | "integer";
46
+ axisNames: string[];
47
+ shape: number[];
48
+ values: (number | null)[];
49
+ }>;
50
+ }[];
51
+ }, Error, {
52
+ [x: string]: unknown;
53
+ type: "CoverageCollection";
54
+ domainType: "Trajectory";
55
+ parameters: Record<string, {
56
+ [x: string]: unknown;
57
+ type: "Parameter";
58
+ observedProperty: {
59
+ [x: string]: unknown;
60
+ label: Record<string, string>;
61
+ id?: string | undefined;
62
+ };
63
+ id?: string | undefined;
64
+ label?: Record<string, string> | undefined;
65
+ description?: Record<string, string> | undefined;
66
+ }>;
67
+ coverages: {
68
+ [x: string]: unknown;
69
+ type: "Coverage";
70
+ domain: {
71
+ [x: string]: unknown;
72
+ type: "Domain";
73
+ axes: {
74
+ [x: string]: unknown;
75
+ composite: {
76
+ [x: string]: unknown;
77
+ dataType: "tuple";
78
+ coordinates: ["t", "x", "y", ("z" | undefined)?];
79
+ values: [string, number, number, (number | undefined)?][];
80
+ };
81
+ };
82
+ domainType?: "Trajectory" | undefined;
83
+ };
84
+ ranges: Record<string, {
85
+ [x: string]: unknown;
86
+ type: "NdArray";
87
+ dataType: "float" | "integer";
88
+ axisNames: string[];
89
+ shape: number[];
90
+ values: (number | null)[];
91
+ }>;
92
+ }[];
93
+ }, readonly ["edr", "trajectory", EdrTrajectoryRequest]>, "queryFn"> & {
94
+ queryFn?: import("@tanstack/query-core").QueryFunction<{
95
+ [x: string]: unknown;
96
+ type: "CoverageCollection";
97
+ domainType: "Trajectory";
98
+ parameters: Record<string, {
99
+ [x: string]: unknown;
100
+ type: "Parameter";
101
+ observedProperty: {
102
+ [x: string]: unknown;
103
+ label: Record<string, string>;
104
+ id?: string | undefined;
105
+ };
106
+ id?: string | undefined;
107
+ label?: Record<string, string> | undefined;
108
+ description?: Record<string, string> | undefined;
109
+ }>;
110
+ coverages: {
111
+ [x: string]: unknown;
112
+ type: "Coverage";
113
+ domain: {
114
+ [x: string]: unknown;
115
+ type: "Domain";
116
+ axes: {
117
+ [x: string]: unknown;
118
+ composite: {
119
+ [x: string]: unknown;
120
+ dataType: "tuple";
121
+ coordinates: ["t", "x", "y", ("z" | undefined)?];
122
+ values: [string, number, number, (number | undefined)?][];
123
+ };
124
+ };
125
+ domainType?: "Trajectory" | undefined;
126
+ };
127
+ ranges: Record<string, {
128
+ [x: string]: unknown;
129
+ type: "NdArray";
130
+ dataType: "float" | "integer";
131
+ axisNames: string[];
132
+ shape: number[];
133
+ values: (number | null)[];
134
+ }>;
135
+ }[];
136
+ }, readonly ["edr", "trajectory", EdrTrajectoryRequest], never> | undefined;
137
+ } & {
138
+ queryKey: readonly ["edr", "trajectory", EdrTrajectoryRequest] & {
139
+ [dataTagSymbol]: {
140
+ [x: string]: unknown;
141
+ type: "CoverageCollection";
142
+ domainType: "Trajectory";
143
+ parameters: Record<string, {
144
+ [x: string]: unknown;
145
+ type: "Parameter";
146
+ observedProperty: {
147
+ [x: string]: unknown;
148
+ label: Record<string, string>;
149
+ id?: string | undefined;
150
+ };
151
+ id?: string | undefined;
152
+ label?: Record<string, string> | undefined;
153
+ description?: Record<string, string> | undefined;
154
+ }>;
155
+ coverages: {
156
+ [x: string]: unknown;
157
+ type: "Coverage";
158
+ domain: {
159
+ [x: string]: unknown;
160
+ type: "Domain";
161
+ axes: {
162
+ [x: string]: unknown;
163
+ composite: {
164
+ [x: string]: unknown;
165
+ dataType: "tuple";
166
+ coordinates: ["t", "x", "y", ("z" | undefined)?];
167
+ values: [string, number, number, (number | undefined)?][];
168
+ };
169
+ };
170
+ domainType?: "Trajectory" | undefined;
171
+ };
172
+ ranges: Record<string, {
173
+ [x: string]: unknown;
174
+ type: "NdArray";
175
+ dataType: "float" | "integer";
176
+ axisNames: string[];
177
+ shape: number[];
178
+ values: (number | null)[];
179
+ }>;
180
+ }[];
181
+ };
182
+ [dataTagErrorSymbol]: Error;
183
+ };
184
+ };
185
+ };
@@ -0,0 +1,234 @@
1
+ import { z } from 'zod';
2
+ export declare const ndArraySchema: z.ZodObject<{
3
+ type: z.ZodLiteral<"NdArray">;
4
+ dataType: z.ZodEnum<{
5
+ float: "float";
6
+ integer: "integer";
7
+ }>;
8
+ axisNames: z.ZodArray<z.ZodString>;
9
+ shape: z.ZodArray<z.ZodNumber>;
10
+ values: z.ZodArray<z.ZodNullable<z.ZodNumber>>;
11
+ }, z.core.$loose>;
12
+ export declare const parameterSchema: z.ZodObject<{
13
+ type: z.ZodLiteral<"Parameter">;
14
+ id: z.ZodOptional<z.ZodString>;
15
+ label: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
16
+ description: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
17
+ observedProperty: z.ZodObject<{
18
+ id: z.ZodOptional<z.ZodString>;
19
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
20
+ }, z.core.$loose>;
21
+ }, z.core.$loose>;
22
+ export declare const trajectoryCoverageSchema: z.ZodObject<{
23
+ type: z.ZodLiteral<"Coverage">;
24
+ domain: z.ZodObject<{
25
+ type: z.ZodLiteral<"Domain">;
26
+ domainType: z.ZodOptional<z.ZodLiteral<"Trajectory">>;
27
+ axes: z.ZodObject<{
28
+ composite: z.ZodObject<{
29
+ dataType: z.ZodLiteral<"tuple">;
30
+ coordinates: z.ZodTuple<[z.ZodLiteral<"t">, z.ZodLiteral<"x">, z.ZodLiteral<"y">, z.ZodOptional<z.ZodLiteral<"z">>], null>;
31
+ values: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodNumber, z.ZodNumber, z.ZodOptional<z.ZodNumber>], null>>;
32
+ }, z.core.$loose>;
33
+ }, z.core.$loose>;
34
+ }, z.core.$loose>;
35
+ ranges: z.ZodRecord<z.ZodString, z.ZodObject<{
36
+ type: z.ZodLiteral<"NdArray">;
37
+ dataType: z.ZodEnum<{
38
+ float: "float";
39
+ integer: "integer";
40
+ }>;
41
+ axisNames: z.ZodArray<z.ZodString>;
42
+ shape: z.ZodArray<z.ZodNumber>;
43
+ values: z.ZodArray<z.ZodNullable<z.ZodNumber>>;
44
+ }, z.core.$loose>>;
45
+ }, z.core.$loose>;
46
+ export declare const trajectoryCoverageCollectionSchema: z.ZodObject<{
47
+ type: z.ZodLiteral<"CoverageCollection">;
48
+ domainType: z.ZodLiteral<"Trajectory">;
49
+ parameters: z.ZodRecord<z.ZodString, z.ZodObject<{
50
+ type: z.ZodLiteral<"Parameter">;
51
+ id: z.ZodOptional<z.ZodString>;
52
+ label: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
53
+ description: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
54
+ observedProperty: z.ZodObject<{
55
+ id: z.ZodOptional<z.ZodString>;
56
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
57
+ }, z.core.$loose>;
58
+ }, z.core.$loose>>;
59
+ coverages: z.ZodArray<z.ZodObject<{
60
+ type: z.ZodLiteral<"Coverage">;
61
+ domain: z.ZodObject<{
62
+ type: z.ZodLiteral<"Domain">;
63
+ domainType: z.ZodOptional<z.ZodLiteral<"Trajectory">>;
64
+ axes: z.ZodObject<{
65
+ composite: z.ZodObject<{
66
+ dataType: z.ZodLiteral<"tuple">;
67
+ coordinates: z.ZodTuple<[z.ZodLiteral<"t">, z.ZodLiteral<"x">, z.ZodLiteral<"y">, z.ZodOptional<z.ZodLiteral<"z">>], null>;
68
+ values: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodNumber, z.ZodNumber, z.ZodOptional<z.ZodNumber>], null>>;
69
+ }, z.core.$loose>;
70
+ }, z.core.$loose>;
71
+ }, z.core.$loose>;
72
+ ranges: z.ZodRecord<z.ZodString, z.ZodObject<{
73
+ type: z.ZodLiteral<"NdArray">;
74
+ dataType: z.ZodEnum<{
75
+ float: "float";
76
+ integer: "integer";
77
+ }>;
78
+ axisNames: z.ZodArray<z.ZodString>;
79
+ shape: z.ZodArray<z.ZodNumber>;
80
+ values: z.ZodArray<z.ZodNullable<z.ZodNumber>>;
81
+ }, z.core.$loose>>;
82
+ }, z.core.$loose>>;
83
+ }, z.core.$loose>;
84
+ /** Servers may answer with a collection or a single coverage; consumers always get a collection. */
85
+ export declare const trajectoryResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
86
+ type: z.ZodLiteral<"CoverageCollection">;
87
+ domainType: z.ZodLiteral<"Trajectory">;
88
+ parameters: z.ZodRecord<z.ZodString, z.ZodObject<{
89
+ type: z.ZodLiteral<"Parameter">;
90
+ id: z.ZodOptional<z.ZodString>;
91
+ label: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
92
+ description: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
93
+ observedProperty: z.ZodObject<{
94
+ id: z.ZodOptional<z.ZodString>;
95
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
96
+ }, z.core.$loose>;
97
+ }, z.core.$loose>>;
98
+ coverages: z.ZodArray<z.ZodObject<{
99
+ type: z.ZodLiteral<"Coverage">;
100
+ domain: z.ZodObject<{
101
+ type: z.ZodLiteral<"Domain">;
102
+ domainType: z.ZodOptional<z.ZodLiteral<"Trajectory">>;
103
+ axes: z.ZodObject<{
104
+ composite: z.ZodObject<{
105
+ dataType: z.ZodLiteral<"tuple">;
106
+ coordinates: z.ZodTuple<[z.ZodLiteral<"t">, z.ZodLiteral<"x">, z.ZodLiteral<"y">, z.ZodOptional<z.ZodLiteral<"z">>], null>;
107
+ values: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodNumber, z.ZodNumber, z.ZodOptional<z.ZodNumber>], null>>;
108
+ }, z.core.$loose>;
109
+ }, z.core.$loose>;
110
+ }, z.core.$loose>;
111
+ ranges: z.ZodRecord<z.ZodString, z.ZodObject<{
112
+ type: z.ZodLiteral<"NdArray">;
113
+ dataType: z.ZodEnum<{
114
+ float: "float";
115
+ integer: "integer";
116
+ }>;
117
+ axisNames: z.ZodArray<z.ZodString>;
118
+ shape: z.ZodArray<z.ZodNumber>;
119
+ values: z.ZodArray<z.ZodNullable<z.ZodNumber>>;
120
+ }, z.core.$loose>>;
121
+ }, z.core.$loose>>;
122
+ }, z.core.$loose>, z.ZodPipe<z.ZodObject<{
123
+ type: z.ZodLiteral<"Coverage">;
124
+ ranges: z.ZodRecord<z.ZodString, z.ZodObject<{
125
+ type: z.ZodLiteral<"NdArray">;
126
+ dataType: z.ZodEnum<{
127
+ float: "float";
128
+ integer: "integer";
129
+ }>;
130
+ axisNames: z.ZodArray<z.ZodString>;
131
+ shape: z.ZodArray<z.ZodNumber>;
132
+ values: z.ZodArray<z.ZodNullable<z.ZodNumber>>;
133
+ }, z.core.$loose>>;
134
+ domain: z.ZodObject<{
135
+ type: z.ZodLiteral<"Domain">;
136
+ axes: z.ZodObject<{
137
+ composite: z.ZodObject<{
138
+ dataType: z.ZodLiteral<"tuple">;
139
+ coordinates: z.ZodTuple<[z.ZodLiteral<"t">, z.ZodLiteral<"x">, z.ZodLiteral<"y">, z.ZodOptional<z.ZodLiteral<"z">>], null>;
140
+ values: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodNumber, z.ZodNumber, z.ZodOptional<z.ZodNumber>], null>>;
141
+ }, z.core.$loose>;
142
+ }, z.core.$loose>;
143
+ domainType: z.ZodLiteral<"Trajectory">;
144
+ }, z.core.$loose>;
145
+ parameters: z.ZodRecord<z.ZodString, z.ZodObject<{
146
+ type: z.ZodLiteral<"Parameter">;
147
+ id: z.ZodOptional<z.ZodString>;
148
+ label: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
149
+ description: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
150
+ observedProperty: z.ZodObject<{
151
+ id: z.ZodOptional<z.ZodString>;
152
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
153
+ }, z.core.$loose>;
154
+ }, z.core.$loose>>;
155
+ }, z.core.$loose>, z.ZodTransform<{
156
+ [x: string]: unknown;
157
+ type: "CoverageCollection";
158
+ domainType: "Trajectory";
159
+ parameters: Record<string, {
160
+ [x: string]: unknown;
161
+ type: "Parameter";
162
+ observedProperty: {
163
+ [x: string]: unknown;
164
+ label: Record<string, string>;
165
+ id?: string | undefined;
166
+ };
167
+ id?: string | undefined;
168
+ label?: Record<string, string> | undefined;
169
+ description?: Record<string, string> | undefined;
170
+ }>;
171
+ coverages: {
172
+ [x: string]: unknown;
173
+ type: "Coverage";
174
+ domain: {
175
+ [x: string]: unknown;
176
+ type: "Domain";
177
+ axes: {
178
+ [x: string]: unknown;
179
+ composite: {
180
+ [x: string]: unknown;
181
+ dataType: "tuple";
182
+ coordinates: ["t", "x", "y", ("z" | undefined)?];
183
+ values: [string, number, number, (number | undefined)?][];
184
+ };
185
+ };
186
+ domainType?: "Trajectory" | undefined;
187
+ };
188
+ ranges: Record<string, {
189
+ [x: string]: unknown;
190
+ type: "NdArray";
191
+ dataType: "float" | "integer";
192
+ axisNames: string[];
193
+ shape: number[];
194
+ values: (number | null)[];
195
+ }>;
196
+ }[];
197
+ }, {
198
+ [x: string]: unknown;
199
+ type: "Coverage";
200
+ ranges: Record<string, {
201
+ [x: string]: unknown;
202
+ type: "NdArray";
203
+ dataType: "float" | "integer";
204
+ axisNames: string[];
205
+ shape: number[];
206
+ values: (number | null)[];
207
+ }>;
208
+ domain: {
209
+ [x: string]: unknown;
210
+ type: "Domain";
211
+ axes: {
212
+ [x: string]: unknown;
213
+ composite: {
214
+ [x: string]: unknown;
215
+ dataType: "tuple";
216
+ coordinates: ["t", "x", "y", ("z" | undefined)?];
217
+ values: [string, number, number, (number | undefined)?][];
218
+ };
219
+ };
220
+ domainType: "Trajectory";
221
+ };
222
+ parameters: Record<string, {
223
+ [x: string]: unknown;
224
+ type: "Parameter";
225
+ observedProperty: {
226
+ [x: string]: unknown;
227
+ label: Record<string, string>;
228
+ id?: string | undefined;
229
+ };
230
+ id?: string | undefined;
231
+ label?: Record<string, string> | undefined;
232
+ description?: Record<string, string> | undefined;
233
+ }>;
234
+ }>>], "type">;
@@ -0,0 +1,19 @@
1
+ import type { z } from 'zod';
2
+ import type { ndArraySchema, parameterSchema, trajectoryCoverageCollectionSchema, trajectoryCoverageSchema } from './schemas';
3
+ export type EdrNdArray = z.infer<typeof ndArraySchema>;
4
+ export type EdrParameter = z.infer<typeof parameterSchema>;
5
+ export type EdrTrajectoryCoverage = z.infer<typeof trajectoryCoverageSchema>;
6
+ export type EdrTrajectoryCoverageCollection = z.infer<typeof trajectoryCoverageCollectionSchema>;
7
+ export type LongitudeLatitude = [longitude: number, latitude: number];
8
+ export interface EdrTrajectoryRequest {
9
+ baseUrl: string;
10
+ collectionId: string;
11
+ instanceId?: string;
12
+ /** The server returns data only at these points, so densify the path first. */
13
+ path: LongitudeLatitude[];
14
+ parameterNames: string[];
15
+ /** EDR `datetime`, for example `2026-11-24T12:00:00Z`. */
16
+ datetime: string;
17
+ /** EDR `z`, for example `850,500` or `1/65`. */
18
+ verticalLevels?: string;
19
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/api",
3
- "version": "21.2.0",
3
+ "version": "21.3.0-nightly-20261128",
4
4
  "description": "GeoWeb API library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -20,12 +20,12 @@
20
20
  }
21
21
  },
22
22
  "dependencies": {
23
- "@opengeoweb/authentication": "21.2.0",
24
- "@opengeoweb/store": "21.2.0",
23
+ "@opengeoweb/authentication": "21.3.0-nightly-20261128",
25
24
  "lodash": "^4.18.1",
26
25
  "@tanstack/react-query": "^5.85.5",
27
26
  "@tanstack/query-core": "^5.79.0",
28
- "@tanstack/react-query-devtools": "5.90.2"
27
+ "@tanstack/react-query-devtools": "5.90.2",
28
+ "zod": "^4.6.6"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "react": "19"
@@ -1,88 +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
- disable_amend_action?: boolean;
81
- }
82
- export interface SigmetConfig extends ProductConfig {
83
- fir_areas: SigmetFIRArea;
84
- }
85
- export interface AirmetConfig extends ProductConfig {
86
- fir_areas: AirmetFIRArea;
87
- }
88
- export {};