@opengeoweb/taf 3.0.0 → 4.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
@@ -9,9 +9,8 @@ import { getDeepProperty, ReactHookFormHiddenInput, ReactHookFormProvider } from
9
9
  import { useIsMounted, ToggleMenu, useDraftFormHelpers, ToolContainerDraggable, Avatar, getInitials, useConfirmationDialog, usePreventBrowserClose, ToolButton, ToolHeader, AlertBanner, getErrorMessage as getErrorMessage$1, getWarningMessage, ConfirmationServiceProvider, usePoller, ErrorBoundary } from '@opengeoweb/shared';
10
10
  import moment from 'moment';
11
11
  import { Add, Delete, Close, DragHandle as DragHandle$1, ThumbsUp, Clock, Cancel, Edit, Success, Export, ListItem, Cached } from '@opengeoweb/theme';
12
- import makeStyles from '@mui/styles/makeStyles';
13
12
  import ReactDOM from 'react-dom';
14
- import { useApiContext, createApiInstance, ApiProvider } from '@opengeoweb/api';
13
+ import { useApiContext, createApiInstance, createFakeApiInstance, ApiProvider } from '@opengeoweb/api';
15
14
  import LinearProgress from '@mui/material/LinearProgress';
16
15
  import Box$1 from '@mui/material/Box';
17
16
 
@@ -3518,19 +3517,6 @@ var TafFormButtons = function TafFormButtons(_ref2) {
3518
3517
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3519
3518
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
3520
3519
  * */
3521
- var useStyles = makeStyles(function () {
3522
- return {
3523
- dragHandle: {
3524
- backgroundColor: 'transparent',
3525
- '&:hover': {
3526
- backgroundColor: 'transparent'
3527
- },
3528
- cursor: function cursor(isSorting) {
3529
- return isSorting ? 'grabbing' : 'grab';
3530
- }
3531
- }
3532
- };
3533
- });
3534
3520
 
3535
3521
  var DragHandle = function DragHandle(_ref) {
3536
3522
  var _ref$isSorting = _ref.isSorting,
@@ -3538,13 +3524,21 @@ var DragHandle = function DragHandle(_ref) {
3538
3524
  _ref$isDisabled = _ref.isDisabled,
3539
3525
  isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
3540
3526
  index = _ref.index;
3541
- var classes = useStyles(isSorting);
3542
3527
  return /*#__PURE__*/React__default.createElement(IconButton, {
3543
- className: "".concat(classes.dragHandle, " handle"),
3528
+ className: "handle",
3544
3529
  "data-testid": "dragHandle-".concat(index),
3545
3530
  disableRipple: true,
3546
3531
  disabled: isDisabled,
3547
- size: "large"
3532
+ size: "large",
3533
+ sx: {
3534
+ backgroundColor: 'transparent',
3535
+ '&:hover': {
3536
+ backgroundColor: 'transparent'
3537
+ },
3538
+ cursor: function cursor() {
3539
+ return isSorting ? 'grabbing' : 'grab';
3540
+ }
3541
+ }
3548
3542
  }, /*#__PURE__*/React__default.createElement(DragHandle$1, null));
3549
3543
  };
3550
3544
 
@@ -4873,17 +4867,18 @@ var StatusIcon = function StatusIcon(_ref2) {
4873
4867
  * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
4874
4868
  * Copyright 2022 - Finnish Meteorological Institute (FMI)
4875
4869
  * */
4870
+ var TOOLTIP_TITLE = 'Import TAC';
4876
4871
 
4877
4872
  var ExportButton = function ExportButton(_ref) {
4878
4873
  var onClick = _ref.onClick,
4879
4874
  isHidden = _ref.isHidden;
4880
4875
  return isHidden ? null : /*#__PURE__*/React__default.createElement(Tooltip, {
4881
- title: "Import TAC",
4876
+ title: TOOLTIP_TITLE,
4882
4877
  placement: "left"
4883
- }, /*#__PURE__*/React__default.createElement("span", null, /*#__PURE__*/React__default.createElement(ToolButton, {
4878
+ }, /*#__PURE__*/React__default.createElement(ToolButton, {
4884
4879
  onClick: onClick,
4885
4880
  "data-testid": "export-tac-button"
4886
- }, /*#__PURE__*/React__default.createElement(Export, null))));
4881
+ }, /*#__PURE__*/React__default.createElement(Export, null)));
4887
4882
  };
4888
4883
 
4889
4884
  var TacContainer = function TacContainer(_ref) {
@@ -6179,10 +6174,8 @@ var Wrapper = function Wrapper(props) {
6179
6174
  return /*#__PURE__*/React.createElement(TafWrapper, Object.assign({}, props), /*#__PURE__*/React.createElement(TafModule, null));
6180
6175
  };
6181
6176
 
6182
- var createApi$1 = function createApi(url, appUrl, auth, setAuth, authTokenUrl, authClientId) {
6183
- var axiosInstance = createApiInstance(url, appUrl, auth, setAuth, authTokenUrl, authClientId);
6177
+ var getApiRoutes$1 = function getApiRoutes(axiosInstance) {
6184
6178
  return {
6185
- // api data
6186
6179
  getTafList: function getTafList() {
6187
6180
  return axiosInstance.get('/taflist');
6188
6181
  },
@@ -6200,6 +6193,11 @@ var createApi$1 = function createApi(url, appUrl, auth, setAuth, authTokenUrl, a
6200
6193
  };
6201
6194
  };
6202
6195
 
6196
+ var createApi$1 = function createApi(url, appUrl, auth, setAuth, authTokenUrl, authClientId) {
6197
+ var axiosInstance = createApiInstance(url, appUrl, auth, setAuth, authTokenUrl, authClientId);
6198
+ return getApiRoutes$1(axiosInstance);
6199
+ };
6200
+
6203
6201
  /* *
6204
6202
  * Licensed under the Apache License, Version 2.0 (the "License");
6205
6203
  * you may not use this file except in compliance with the License.
@@ -7162,21 +7160,6 @@ var fakeAmendmentTaf = {
7162
7160
 
7163
7161
  var fakeTafTac = 'TAF EHAM 0812/0918 20020G35KT 0500 SN BKN040\nBECMG 0814/0816 0700 BKN001=';
7164
7162
 
7165
- var fakePromise = function fakePromise(withRandomError) {
7166
- var signal = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
7167
- return new Promise(function (resolve, reject) {
7168
- var timer = setTimeout(function () {
7169
- if (!withRandomError) return resolve();
7170
- var randomError = Math.floor(Math.random() * 4) + 1;
7171
- return randomError === 4 ? reject(new Error('something went wrong')) : resolve();
7172
- }, 300);
7173
- signal === null || signal === void 0 ? void 0 : signal.signal.addEventListener('abort', function () {
7174
- clearTimeout(timer);
7175
- reject(new Error('canceled'));
7176
- });
7177
- });
7178
- };
7179
-
7180
7163
  var fakeUpdatedTafList = _toConsumableArray(fakeTafList);
7181
7164
 
7182
7165
  var setFakeUpdatedList = function setFakeUpdatedList(newList) {
@@ -7185,26 +7168,13 @@ var setFakeUpdatedList = function setFakeUpdatedList(newList) {
7185
7168
  var getFakeUpdatedList = function getFakeUpdatedList() {
7186
7169
  return fakeUpdatedTafList;
7187
7170
  };
7188
- var fakeAxiosInstance = {
7189
- // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars, @typescript-eslint/explicit-module-boundary-types
7190
- get: function get(_url, _params) {
7191
- return fakePromise(false);
7192
- },
7193
- // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars, @typescript-eslint/explicit-module-boundary-types
7194
- post: function post(_url, _params, _signal) {
7195
- return fakePromise(false, _signal);
7196
- },
7197
- // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars, @typescript-eslint/explicit-module-boundary-types
7198
- patch: function patch(_url, _params, _signal) {
7199
- return fakePromise(false, _signal);
7200
- }
7201
- };
7202
- var createApi = function createApi() {
7171
+
7172
+ var getApiRoutes = function getApiRoutes(axiosInstance) {
7203
7173
  return {
7204
7174
  getTafList: function getTafList() {
7205
7175
  // eslint-disable-next-line no-console
7206
7176
  console.log('Retrieving new TAF list');
7207
- return fakeAxiosInstance.get('/taflist').then(function () {
7177
+ return axiosInstance.get('/taflist').then(function () {
7208
7178
  return {
7209
7179
  data: getFakeUpdatedList()
7210
7180
  };
@@ -7215,10 +7185,10 @@ var createApi = function createApi() {
7215
7185
  console.log("The new status of the taf will be ".concat(_postTaf.changeStatusTo)); // eslint-disable-next-line no-console
7216
7186
 
7217
7187
  console.log('form has been posted with following values:', _postTaf.taf);
7218
- return fakeAxiosInstance.post('/taf', _postTaf);
7188
+ return axiosInstance.post('/taf', _postTaf);
7219
7189
  },
7220
- getTAC: function getTAC(tafData, signal) {
7221
- return fakeAxiosInstance.post.apply(fakeAxiosInstance, ['/taf2tac'].concat([Object.assign({}, tafData)].concat(_toConsumableArray(signal ? [{
7190
+ getTAC: function getTAC(taf, signal) {
7191
+ return axiosInstance.post.apply(axiosInstance, ['/taf2tac'].concat([Object.assign({}, taf)].concat(_toConsumableArray(signal ? [{
7222
7192
  signal: signal
7223
7193
  }] : [])))).then(function () {
7224
7194
  return {
@@ -7239,11 +7209,16 @@ var createApi = function createApi() {
7239
7209
  setFakeUpdatedList(updatedList); // eslint-disable-next-line no-console
7240
7210
 
7241
7211
  console.log("The new editor of the taf will be ".concat(_patchTaf.editor || 'empty'));
7242
- return fakeAxiosInstance.patch('/taf', _patchTaf);
7212
+ return axiosInstance.patch('/taf', _patchTaf);
7243
7213
  }
7244
7214
  };
7245
7215
  };
7246
7216
 
7217
+ var createApi = function createApi() {
7218
+ var instance = createFakeApiInstance();
7219
+ return getApiRoutes(instance);
7220
+ };
7221
+
7247
7222
  /* *
7248
7223
  * Licensed under the Apache License, Version 2.0 (the "License");
7249
7224
  * you may not use this file except in compliance with the License.
package/index.umd.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('@mui/material'), require('react-hook-form'), require('react-sortablejs'), require('lodash'), require('@opengeoweb/authentication'), require('@opengeoweb/form-fields'), require('@opengeoweb/shared'), require('moment'), require('@opengeoweb/theme'), require('@mui/styles/makeStyles'), require('react-dom'), require('@opengeoweb/api'), require('@mui/material/LinearProgress'), require('@mui/material/Box')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'react', '@mui/material', 'react-hook-form', 'react-sortablejs', 'lodash', '@opengeoweb/authentication', '@opengeoweb/form-fields', '@opengeoweb/shared', 'moment', '@opengeoweb/theme', '@mui/styles/makeStyles', 'react-dom', '@opengeoweb/api', '@mui/material/LinearProgress', '@mui/material/Box'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Taf = {}, global.React, global.material, global.reactHookForm, global.reactSortablejs, global.lodash, global.authentication, global.formFields, global.shared, global.moment, global.theme, global.makeStyles, global.ReactDOM, global.api, global.LinearProgress, global.Box));
5
- })(this, (function (exports, React, material, reactHookForm, reactSortablejs, lodash, authentication, formFields, shared, moment, theme, makeStyles, ReactDOM, api, LinearProgress, Box) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('@mui/material'), require('react-hook-form'), require('react-sortablejs'), require('lodash'), require('@opengeoweb/authentication'), require('@opengeoweb/form-fields'), require('@opengeoweb/shared'), require('moment'), require('@opengeoweb/theme'), require('react-dom'), require('@opengeoweb/api'), require('@mui/material/LinearProgress'), require('@mui/material/Box')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'react', '@mui/material', 'react-hook-form', 'react-sortablejs', 'lodash', '@opengeoweb/authentication', '@opengeoweb/form-fields', '@opengeoweb/shared', 'moment', '@opengeoweb/theme', 'react-dom', '@opengeoweb/api', '@mui/material/LinearProgress', '@mui/material/Box'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Taf = {}, global.React, global.material, global.reactHookForm, global.reactSortablejs, global.lodash, global.authentication, global.formFields, global.shared, global.moment, global.theme, global.ReactDOM, global.api, global.LinearProgress, global.Box));
5
+ })(this, (function (exports, React, material, reactHookForm, reactSortablejs, lodash, authentication, formFields, shared, moment, theme, ReactDOM, api, LinearProgress, Box) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -27,7 +27,6 @@
27
27
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
28
28
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
29
29
  var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
30
- var makeStyles__default = /*#__PURE__*/_interopDefaultLegacy(makeStyles);
31
30
  var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
32
31
  var LinearProgress__default = /*#__PURE__*/_interopDefaultLegacy(LinearProgress);
33
32
  var Box__default = /*#__PURE__*/_interopDefaultLegacy(Box);
@@ -3515,19 +3514,6 @@
3515
3514
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3516
3515
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
3517
3516
  * */
3518
- var useStyles = makeStyles__default["default"](function () {
3519
- return {
3520
- dragHandle: {
3521
- backgroundColor: 'transparent',
3522
- '&:hover': {
3523
- backgroundColor: 'transparent'
3524
- },
3525
- cursor: function cursor(isSorting) {
3526
- return isSorting ? 'grabbing' : 'grab';
3527
- }
3528
- }
3529
- };
3530
- });
3531
3517
 
3532
3518
  var DragHandle = function DragHandle(_a) {
3533
3519
  var _b = _a.isSorting,
@@ -3535,13 +3521,21 @@
3535
3521
  _c = _a.isDisabled,
3536
3522
  isDisabled = _c === void 0 ? false : _c,
3537
3523
  index = _a.index;
3538
- var classes = useStyles(isSorting);
3539
3524
  return /*#__PURE__*/React__default["default"].createElement(material.IconButton, {
3540
- className: classes.dragHandle + " handle",
3525
+ className: "handle",
3541
3526
  "data-testid": "dragHandle-" + index,
3542
3527
  disableRipple: true,
3543
3528
  disabled: isDisabled,
3544
- size: "large"
3529
+ size: "large",
3530
+ sx: {
3531
+ backgroundColor: 'transparent',
3532
+ '&:hover': {
3533
+ backgroundColor: 'transparent'
3534
+ },
3535
+ cursor: function cursor() {
3536
+ return isSorting ? 'grabbing' : 'grab';
3537
+ }
3538
+ }
3545
3539
  }, /*#__PURE__*/React__default["default"].createElement(theme.DragHandle, null));
3546
3540
  };
3547
3541
 
@@ -4845,17 +4839,18 @@
4845
4839
  * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
4846
4840
  * Copyright 2022 - Finnish Meteorological Institute (FMI)
4847
4841
  * */
4842
+ var TOOLTIP_TITLE = 'Import TAC';
4848
4843
 
4849
4844
  var ExportButton = function ExportButton(_a) {
4850
4845
  var onClick = _a.onClick,
4851
4846
  isHidden = _a.isHidden;
4852
4847
  return isHidden ? null : /*#__PURE__*/React__default["default"].createElement(material.Tooltip, {
4853
- title: "Import TAC",
4848
+ title: TOOLTIP_TITLE,
4854
4849
  placement: "left"
4855
- }, /*#__PURE__*/React__default["default"].createElement("span", null, /*#__PURE__*/React__default["default"].createElement(shared.ToolButton, {
4850
+ }, /*#__PURE__*/React__default["default"].createElement(shared.ToolButton, {
4856
4851
  onClick: onClick,
4857
4852
  "data-testid": "export-tac-button"
4858
- }, /*#__PURE__*/React__default["default"].createElement(theme.Export, null))));
4853
+ }, /*#__PURE__*/React__default["default"].createElement(theme.Export, null)));
4859
4854
  };
4860
4855
 
4861
4856
  /* *
@@ -6167,10 +6162,8 @@
6167
6162
  return /*#__PURE__*/React__namespace.createElement(TafWrapper, __assign({}, props), /*#__PURE__*/React__namespace.createElement(TafModule, null));
6168
6163
  };
6169
6164
 
6170
- var createApi$1 = function createApi(url, appUrl, auth, setAuth, authTokenUrl, authClientId) {
6171
- var axiosInstance = api.createApiInstance(url, appUrl, auth, setAuth, authTokenUrl, authClientId);
6165
+ var getApiRoutes$1 = function getApiRoutes(axiosInstance) {
6172
6166
  return {
6173
- // api data
6174
6167
  getTafList: function getTafList() {
6175
6168
  return axiosInstance.get('/taflist');
6176
6169
  },
@@ -6188,6 +6181,11 @@
6188
6181
  };
6189
6182
  };
6190
6183
 
6184
+ var createApi$1 = function createApi(url, appUrl, auth, setAuth, authTokenUrl, authClientId) {
6185
+ var axiosInstance = api.createApiInstance(url, appUrl, auth, setAuth, authTokenUrl, authClientId);
6186
+ return getApiRoutes$1(axiosInstance);
6187
+ };
6188
+
6191
6189
  /* *
6192
6190
  * Licensed under the Apache License, Version 2.0 (the "License");
6193
6191
  * you may not use this file except in compliance with the License.
@@ -7147,24 +7145,6 @@
7147
7145
 
7148
7146
  var fakeTafTac = 'TAF EHAM 0812/0918 20020G35KT 0500 SN BKN040\nBECMG 0814/0816 0700 BKN001=';
7149
7147
 
7150
- var fakePromise = function fakePromise(withRandomError, signal) {
7151
- if (signal === void 0) {
7152
- signal = null;
7153
- }
7154
-
7155
- return new Promise(function (resolve, reject) {
7156
- var timer = setTimeout(function () {
7157
- if (!withRandomError) return resolve();
7158
- var randomError = Math.floor(Math.random() * 4) + 1;
7159
- return randomError === 4 ? reject(new Error('something went wrong')) : resolve();
7160
- }, 300);
7161
- signal === null || signal === void 0 ? void 0 : signal.signal.addEventListener('abort', function () {
7162
- clearTimeout(timer);
7163
- reject(new Error('canceled'));
7164
- });
7165
- });
7166
- };
7167
-
7168
7148
  var fakeUpdatedTafList = __spreadArray([], __read(fakeTafList));
7169
7149
 
7170
7150
  var setFakeUpdatedList = function setFakeUpdatedList(newList) {
@@ -7173,26 +7153,13 @@
7173
7153
  var getFakeUpdatedList = function getFakeUpdatedList() {
7174
7154
  return fakeUpdatedTafList;
7175
7155
  };
7176
- var fakeAxiosInstance = {
7177
- // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars, @typescript-eslint/explicit-module-boundary-types
7178
- get: function get(_url, _params) {
7179
- return fakePromise(false);
7180
- },
7181
- // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars, @typescript-eslint/explicit-module-boundary-types
7182
- post: function post(_url, _params, _signal) {
7183
- return fakePromise(false, _signal);
7184
- },
7185
- // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars, @typescript-eslint/explicit-module-boundary-types
7186
- patch: function patch(_url, _params, _signal) {
7187
- return fakePromise(false, _signal);
7188
- }
7189
- };
7190
- var createApi = function createApi() {
7156
+
7157
+ var getApiRoutes = function getApiRoutes(axiosInstance) {
7191
7158
  return {
7192
7159
  getTafList: function getTafList() {
7193
7160
  // eslint-disable-next-line no-console
7194
7161
  console.log('Retrieving new TAF list');
7195
- return fakeAxiosInstance.get('/taflist').then(function () {
7162
+ return axiosInstance.get('/taflist').then(function () {
7196
7163
  return {
7197
7164
  data: getFakeUpdatedList()
7198
7165
  };
@@ -7203,10 +7170,10 @@
7203
7170
  console.log("The new status of the taf will be " + _postTaf.changeStatusTo); // eslint-disable-next-line no-console
7204
7171
 
7205
7172
  console.log('form has been posted with following values:', _postTaf.taf);
7206
- return fakeAxiosInstance.post('/taf', _postTaf);
7173
+ return axiosInstance.post('/taf', _postTaf);
7207
7174
  },
7208
- getTAC: function getTAC(tafData, signal) {
7209
- return fakeAxiosInstance.post.apply(fakeAxiosInstance, __spreadArray(['/taf2tac'], __read(__spreadArray([__assign({}, tafData)], __read(signal ? [{
7175
+ getTAC: function getTAC(taf, signal) {
7176
+ return axiosInstance.post.apply(axiosInstance, __spreadArray(['/taf2tac'], __read(__spreadArray([__assign({}, taf)], __read(signal ? [{
7210
7177
  signal: signal
7211
7178
  }] : []))))).then(function () {
7212
7179
  return {
@@ -7227,11 +7194,16 @@
7227
7194
  setFakeUpdatedList(updatedList); // eslint-disable-next-line no-console
7228
7195
 
7229
7196
  console.log("The new editor of the taf will be " + (_patchTaf.editor || 'empty'));
7230
- return fakeAxiosInstance.patch('/taf', _patchTaf);
7197
+ return axiosInstance.patch('/taf', _patchTaf);
7231
7198
  }
7232
7199
  };
7233
7200
  };
7234
7201
 
7202
+ var createApi = function createApi() {
7203
+ var instance = api.createFakeApiInstance();
7204
+ return getApiRoutes(instance);
7205
+ };
7206
+
7235
7207
  /* *
7236
7208
  * Licensed under the Apache License, Version 2.0 (the "License");
7237
7209
  * you may not use this file except in compliance with the License.
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- export declare const useStyles: (props?: any) => import("@mui/styles/withStyles").ClassNameMap<"dragHandle">;
3
- interface DragHandleProps {
2
+ export interface DragHandleProps {
4
3
  isSorting?: boolean;
5
4
  isDisabled?: boolean;
6
5
  index: number;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ export declare const TOOLTIP_TITLE = "Import TAC";
2
3
  interface ExportButtonProps {
3
4
  onClick: () => void;
4
5
  isHidden: boolean;
@@ -1,2 +1,13 @@
1
1
  import { Credentials } from '@opengeoweb/api';
2
- export declare const createApi: (url: string, appUrl: string, auth: Credentials, setAuth: (cred: Credentials) => void, authTokenUrl: string, authClientId: string) => any;
2
+ import { Taf, TafFromBackend, TafFromFrontEnd } from '../types';
3
+ export declare type TafApi = {
4
+ getTafList: () => Promise<{
5
+ data: TafFromBackend[];
6
+ }>;
7
+ postTaf: (formData: TafFromFrontEnd) => Promise<void>;
8
+ getTAC: (tafData: Taf, signal?: AbortSignal) => Promise<{
9
+ data: string;
10
+ }>;
11
+ patchTaf: (formData: TafFromFrontEnd) => Promise<void>;
12
+ };
13
+ export declare const createApi: (url: string, appUrl: string, auth: Credentials, setAuth: (cred: Credentials) => void, authTokenUrl: string, authClientId: string) => TafApi;
@@ -1,10 +1,6 @@
1
1
  import { TafFromBackend } from '../types';
2
+ import { TafApi } from './api';
2
3
  export declare const fakeTafTac = "TAF EHAM 0812/0918 20020G35KT 0500 SN BKN040\nBECMG 0814/0816 0700 BKN001=";
3
4
  export declare const setFakeUpdatedList: (newList: TafFromBackend[]) => void;
4
5
  export declare const getFakeUpdatedList: () => TafFromBackend[];
5
- export declare const fakeAxiosInstance: {
6
- get: (_url: any, _params?: any) => Promise<void>;
7
- post: (_url: any, _params?: any, _signal?: any) => Promise<void>;
8
- patch: (_url: any, _params?: any, _signal?: any) => Promise<void>;
9
- };
10
- export declare const createApi: () => any;
6
+ export declare const createApi: () => TafApi;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/taf",
3
- "version": "3.0.0",
3
+ "version": "4.0.0",
4
4
  "description": "GeoWeb TAF library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -13,22 +13,21 @@
13
13
  "dependencies": {},
14
14
  "peerDependencies": {
15
15
  "react": "^17.0.2",
16
- "@opengeoweb/api": "3.0.0",
16
+ "@opengeoweb/api": "4.0.0",
17
17
  "axios": "^0.25.0",
18
- "@opengeoweb/shared": "3.0.0",
18
+ "@opengeoweb/shared": "4.0.0",
19
19
  "@mui/material": "^5.2.8",
20
- "@opengeoweb/theme": "3.0.0",
21
- "@mui/styles": "^5.2.3",
20
+ "@opengeoweb/theme": "4.0.0",
22
21
  "react-draggable": "^4.4.3",
23
22
  "re-resizable": "^6.9.0",
24
23
  "lodash": "^4.17.20",
25
- "@opengeoweb/form-fields": "3.0.0",
24
+ "@opengeoweb/form-fields": "4.0.0",
26
25
  "react-hook-form": "^6.12.1",
27
26
  "moment": "^2.29.0",
28
27
  "moment-timezone": "^0.5.31",
29
28
  "@mui/lab": "^5.0.0-alpha.64",
30
29
  "react-dom": "^17.0.2",
31
- "@opengeoweb/authentication": "3.0.0",
30
+ "@opengeoweb/authentication": "4.0.0",
32
31
  "react-router-dom": "^5.2.0",
33
32
  "query-string": "^6.13.7",
34
33
  "react-sortablejs": "^6.0.0",