mobility-toolbox-js 2.0.0-beta.3 → 2.0.0-beta.33

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.
Files changed (220) hide show
  1. package/README.md +4 -1
  2. package/api/RealtimeAPI.d.ts +268 -0
  3. package/api/RealtimeAPI.d.ts.map +1 -0
  4. package/api/RoutingAPI.d.ts +33 -0
  5. package/api/RoutingAPI.d.ts.map +1 -0
  6. package/api/StopsAPI.d.ts +36 -0
  7. package/api/StopsAPI.d.ts.map +1 -0
  8. package/api/index.d.ts +5 -0
  9. package/api/index.d.ts.map +1 -0
  10. package/api/typedefs.d.ts +105 -0
  11. package/api/typedefs.d.ts.map +1 -0
  12. package/common/api/HttpAPI.d.ts +31 -0
  13. package/common/api/HttpAPI.d.ts.map +1 -0
  14. package/common/api/WebSocketAPI.d.ts +95 -0
  15. package/common/api/WebSocketAPI.d.ts.map +1 -0
  16. package/common/controls/Control.d.ts +74 -0
  17. package/common/controls/Control.d.ts.map +1 -0
  18. package/common/index.d.ts +3 -0
  19. package/common/index.d.ts.map +1 -0
  20. package/common/layers/Layer.d.ts +80 -0
  21. package/common/layers/Layer.d.ts.map +1 -0
  22. package/common/mixins/CopyrightMixin.d.ts +22 -0
  23. package/common/mixins/CopyrightMixin.d.ts.map +1 -0
  24. package/common/mixins/MapboxLayerMixin.d.ts +27 -0
  25. package/common/mixins/MapboxLayerMixin.d.ts.map +1 -0
  26. package/common/mixins/RealtimeLayerMixin.d.ts +58 -0
  27. package/common/mixins/RealtimeLayerMixin.d.ts.map +1 -0
  28. package/common/mixins/StopFinderMixin.d.ts +40 -0
  29. package/common/mixins/StopFinderMixin.d.ts.map +1 -0
  30. package/common/mixins/UserInteractionsLayerMixin.d.ts +42 -0
  31. package/common/mixins/UserInteractionsLayerMixin.d.ts.map +1 -0
  32. package/common/styles/index.d.ts +5 -0
  33. package/common/styles/index.d.ts.map +1 -0
  34. package/common/styles/realtimeDefaultStyle.d.ts +15 -0
  35. package/common/styles/realtimeDefaultStyle.d.ts.map +1 -0
  36. package/common/styles/{trackerDelayStyle.js → realtimeDelayStyle.d.ts} +3 -9
  37. package/common/styles/realtimeDelayStyle.d.ts.map +1 -0
  38. package/common/styles/realtimeSimpleStyle.d.ts +3 -0
  39. package/common/styles/realtimeSimpleStyle.d.ts.map +1 -0
  40. package/common/typedefs.d.ts +50 -0
  41. package/common/typedefs.d.ts.map +1 -0
  42. package/common/utils/cleanStopTime.d.ts +7 -0
  43. package/common/utils/cleanStopTime.d.ts.map +1 -0
  44. package/common/utils/compareDepartures.d.ts +9 -0
  45. package/common/utils/compareDepartures.d.ts.map +1 -0
  46. package/common/utils/createCanvas.d.ts +9 -0
  47. package/common/utils/createCanvas.d.ts.map +1 -0
  48. package/common/utils/createTrackerFilters.d.ts +12 -0
  49. package/common/utils/createTrackerFilters.d.ts.map +1 -0
  50. package/common/utils/getLayersAsFlatArray.d.ts +3 -0
  51. package/common/utils/getLayersAsFlatArray.d.ts.map +1 -0
  52. package/common/utils/getMapboxMapCopyrights.d.ts +8 -0
  53. package/common/utils/getMapboxMapCopyrights.d.ts.map +1 -0
  54. package/common/utils/getMapboxRender.d.ts +5 -0
  55. package/common/utils/getMapboxRender.d.ts.map +1 -0
  56. package/common/utils/getMaplibreRender.d.ts +5 -0
  57. package/common/utils/getMaplibreRender.d.ts.map +1 -0
  58. package/common/utils/getRealtimeModeSuffix.d.ts +8 -0
  59. package/common/utils/getRealtimeModeSuffix.d.ts.map +1 -0
  60. package/common/utils/getUrlWithParams.d.ts +9 -0
  61. package/common/utils/getUrlWithParams.d.ts.map +1 -0
  62. package/common/utils/getVehiclePosition.d.ts +14 -0
  63. package/common/utils/getVehiclePosition.d.ts.map +1 -0
  64. package/common/utils/index.d.ts +12 -0
  65. package/common/utils/index.d.ts.map +1 -0
  66. package/common/utils/removeDuplicate.d.ts +10 -0
  67. package/common/utils/removeDuplicate.d.ts.map +1 -0
  68. package/common/utils/renderTrajectories.d.ts +20 -0
  69. package/common/utils/renderTrajectories.d.ts.map +1 -0
  70. package/common/utils/sortByDelay.d.ts +3 -0
  71. package/common/utils/sortByDelay.d.ts.map +1 -0
  72. package/common/utils/timeUtils.d.ts +5 -0
  73. package/common/utils/timeUtils.d.ts.map +1 -0
  74. package/common/utils/trackerConfig.d.ts +24 -0
  75. package/common/utils/trackerConfig.d.ts.map +1 -0
  76. package/iife.d.ts +3 -0
  77. package/iife.d.ts.map +1 -0
  78. package/index.d.ts +6 -0
  79. package/index.d.ts.map +1 -0
  80. package/mapbox/controls/CopyrightControl.d.ts +32 -0
  81. package/mapbox/controls/CopyrightControl.d.ts.map +1 -0
  82. package/mapbox/controls/index.d.ts +2 -0
  83. package/mapbox/controls/index.d.ts.map +1 -0
  84. package/mapbox/index.d.ts +5 -0
  85. package/mapbox/index.d.ts.map +1 -0
  86. package/mapbox/layers/Layer.d.ts +47 -0
  87. package/mapbox/layers/Layer.d.ts.map +1 -0
  88. package/mapbox/layers/RealtimeLayer.d.ts +118 -0
  89. package/mapbox/layers/RealtimeLayer.d.ts.map +1 -0
  90. package/mapbox/layers/index.d.ts +3 -0
  91. package/mapbox/layers/index.d.ts.map +1 -0
  92. package/mapbox/utils.d.ts +8 -0
  93. package/mapbox/utils.d.ts.map +1 -0
  94. package/mbt.js +50042 -0
  95. package/mbt.js.map +7 -0
  96. package/mbt.min.js +1008 -0
  97. package/mbt.min.js.map +7 -0
  98. package/ol/controls/CopyrightControl.d.ts +31 -0
  99. package/ol/controls/CopyrightControl.d.ts.map +1 -0
  100. package/ol/controls/RoutingControl.d.ts +180 -0
  101. package/ol/controls/RoutingControl.d.ts.map +1 -0
  102. package/ol/controls/StopFinderControl.d.ts +32 -0
  103. package/ol/controls/StopFinderControl.d.ts.map +1 -0
  104. package/ol/controls/index.d.ts +4 -0
  105. package/ol/controls/index.d.ts.map +1 -0
  106. package/ol/index.d.ts +6 -0
  107. package/ol/index.d.ts.map +1 -0
  108. package/ol/layers/Layer.d.ts +49 -0
  109. package/ol/layers/Layer.d.ts.map +1 -0
  110. package/ol/layers/MapboxLayer.d.ts +42 -0
  111. package/ol/layers/MapboxLayer.d.ts.map +1 -0
  112. package/ol/layers/MapboxStyleLayer.d.ts +146 -0
  113. package/ol/layers/MapboxStyleLayer.d.ts.map +1 -0
  114. package/ol/layers/MaplibreLayer.d.ts +27 -0
  115. package/ol/layers/MaplibreLayer.d.ts.map +1 -0
  116. package/ol/layers/RealtimeLayer.d.ts +119 -0
  117. package/ol/layers/RealtimeLayer.d.ts.map +1 -0
  118. package/ol/layers/RoutingLayer.d.ts +24 -0
  119. package/ol/layers/RoutingLayer.d.ts.map +1 -0
  120. package/ol/layers/VectorLayer.d.ts +23 -0
  121. package/ol/layers/VectorLayer.d.ts.map +1 -0
  122. package/ol/layers/WMSLayer.d.ts +38 -0
  123. package/ol/layers/WMSLayer.d.ts.map +1 -0
  124. package/ol/layers/index.d.ts +9 -0
  125. package/ol/layers/index.d.ts.map +1 -0
  126. package/ol/styles/fullTrajectoryDelayStyle.d.ts +4 -0
  127. package/ol/styles/fullTrajectoryDelayStyle.d.ts.map +1 -0
  128. package/ol/styles/fullTrajectoryStyle.d.ts +4 -0
  129. package/ol/styles/fullTrajectoryStyle.d.ts.map +1 -0
  130. package/ol/styles/index.d.ts +3 -0
  131. package/ol/styles/index.d.ts.map +1 -0
  132. package/package.json +56 -95
  133. package/setupTests.d.ts +2 -0
  134. package/setupTests.d.ts.map +1 -0
  135. package/types/index.d.ts +10 -0
  136. package/types/realtime.d.ts +24 -0
  137. package/types/routing.d.ts +206 -0
  138. package/types/stops.d.ts +143 -0
  139. package/api/index.js +0 -3
  140. package/api/routing/RoutingAPI.js +0 -44
  141. package/api/routing/RoutingAPI.test.js +0 -41
  142. package/api/stops/StopsAPI.js +0 -41
  143. package/api/stops/StopsAPI.test.js +0 -34
  144. package/api/tralis/TralisAPI.js +0 -731
  145. package/api/tralis/TralisAPI.test.js +0 -75
  146. package/api/tralis/TralisAPIUtils.js +0 -73
  147. package/api/tralis/WebSocketConnector.js +0 -338
  148. package/api/tralis/WebSocketConnector.test.js +0 -356
  149. package/api/tralis/typedefs.js +0 -81
  150. package/common/Tracker.js +0 -197
  151. package/common/api/api.js +0 -64
  152. package/common/api/api.test.js +0 -68
  153. package/common/controls/Control.js +0 -146
  154. package/common/controls/Control.test.js +0 -98
  155. package/common/layers/Layer.js +0 -404
  156. package/common/layers/Layer.test.js +0 -585
  157. package/common/mixins/CopyrightMixin.js +0 -48
  158. package/common/mixins/SearchMixin.js +0 -176
  159. package/common/mixins/TralisLayerMixin.js +0 -930
  160. package/common/styles/index.js +0 -4
  161. package/common/styles/trackerDefaultStyle.js +0 -333
  162. package/common/styles/trackerSimpleStyle.js +0 -22
  163. package/common/trackerConfig.js +0 -190
  164. package/common/trackerConfig.test.js +0 -25
  165. package/common/typedefs.js +0 -23
  166. package/common/utils/createTrackerFilters.js +0 -87
  167. package/common/utils/createTrackerFilters.test.js +0 -95
  168. package/common/utils/getMapboxMapCopyrights.js +0 -32
  169. package/common/utils/getMapboxMapCopyrights.test.js +0 -47
  170. package/common/utils/getMapboxStyleUrl.js +0 -32
  171. package/common/utils/getVehiclePosition.js +0 -72
  172. package/common/utils/index.js +0 -6
  173. package/common/utils/removeDuplicate.js +0 -22
  174. package/common/utils/removeDuplicate.test.js +0 -22
  175. package/common/utils/sortByDelay.js +0 -23
  176. package/common/utils/timeUtils.js +0 -44
  177. package/common/utils/timeUtils.test.js +0 -16
  178. package/index.js +0 -2
  179. package/index.js.map +0 -1
  180. package/mapbox/controls/CopyrightControl.js +0 -58
  181. package/mapbox/index.js +0 -3
  182. package/mapbox/layers/Layer.js +0 -118
  183. package/mapbox/layers/Layer.test.js +0 -202
  184. package/mapbox/layers/TralisLayer.js +0 -329
  185. package/mapbox/layers/TralisLayer.test.js +0 -40
  186. package/mapbox/utils.js +0 -46
  187. package/module.js +0 -23
  188. package/ol/README.md +0 -0
  189. package/ol/controls/CopyrightControl.js +0 -80
  190. package/ol/controls/CopyrightControl.test.js +0 -211
  191. package/ol/controls/RoutingControl.js +0 -752
  192. package/ol/controls/RoutingControl.test.js +0 -216
  193. package/ol/controls/StopFinderControl.js +0 -38
  194. package/ol/controls/StopFinderControl.test.js +0 -59
  195. package/ol/controls/snapshots/RoutingControlRouteGen10.json +0 -58
  196. package/ol/controls/snapshots/RoutingControlRouteGen100.json +0 -292
  197. package/ol/controls/snapshots/RoutingControlRouteGen30.json +0 -69
  198. package/ol/controls/snapshots/RoutingControlRouteGen5.json +0 -58
  199. package/ol/controls/snapshots/RoutingControlRouteOSM.json +0 -759
  200. package/ol/controls/snapshots/RoutingControlStation1.json +0 -60
  201. package/ol/controls/snapshots/RoutingControlStation2.json +0 -49
  202. package/ol/index.js +0 -13
  203. package/ol/layers/Layer.js +0 -193
  204. package/ol/layers/Layer.test.js +0 -197
  205. package/ol/layers/MapboxLayer.js +0 -378
  206. package/ol/layers/MapboxLayer.test.js +0 -186
  207. package/ol/layers/MapboxStyleLayer.js +0 -417
  208. package/ol/layers/MapboxStyleLayer.test.js +0 -262
  209. package/ol/layers/MaplibreLayer.js +0 -280
  210. package/ol/layers/RoutingLayer.js +0 -91
  211. package/ol/layers/RoutingLayer.test.js +0 -49
  212. package/ol/layers/TralisLayer.js +0 -359
  213. package/ol/layers/TralisLayer.test.js +0 -97
  214. package/ol/layers/VectorLayer.js +0 -43
  215. package/ol/layers/VectorLayer.test.js +0 -98
  216. package/ol/layers/WMSLayer.js +0 -80
  217. package/ol/layers/WMSLayer.test.js +0 -84
  218. package/ol/styles/fullTrajectoryDelayStyle.js +0 -35
  219. package/ol/styles/fullTrajectoryStyle.js +0 -51
  220. package/ol/styles/index.js +0 -2
@@ -0,0 +1,24 @@
1
+ export default RoutingLayer;
2
+ /**
3
+ * A class use to display vector data.
4
+ *
5
+ * @classproperty {ol/Map~Map} map - The map where the layer is displayed.
6
+ * @extends {Layer}
7
+ */
8
+ declare class RoutingLayer extends Layer {
9
+ /**
10
+ * Constructor.
11
+ * @param {Object} [options]
12
+ * @param {ol/style/Style~StyleLike} [options.style] Style to be used for routes, uses (ol/StyleLike) [https://openlayers.org/en/latest/apidoc/module-ol_style_Style.html#~StyleLike] instances
13
+ */
14
+ constructor(options?: any);
15
+ olLayer: any;
16
+ /**
17
+ * Create a copy of the RoutingLayer.
18
+ * @param {Object} newOptions Options to override
19
+ * @return {RoutingLayer} A RoutingLayer
20
+ */
21
+ clone(newOptions: any): RoutingLayer;
22
+ }
23
+ import Layer from "./Layer";
24
+ //# sourceMappingURL=RoutingLayer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RoutingLayer.d.ts","sourceRoot":"","sources":["../../../src/ol/layers/RoutingLayer.js"],"names":[],"mappings":";AA8DA;;;;;GAKG;AACH;IACE;;;;OAIG;IACH,2BASC;IANC,aAKI;IAGN;;;;OAIG;IACH,wBAFY,YAAY,CAIvB;CACF"}
@@ -0,0 +1,23 @@
1
+ export default VectorLayer;
2
+ /**
3
+ * A class use to display vector data.
4
+ *
5
+ * @classproperty {ol/Map~Map} map - The map where the layer is displayed.
6
+ * @extends {Layer}
7
+ */
8
+ declare class VectorLayer extends Layer {
9
+ /**
10
+ * Request feature information for a given coordinate.
11
+ * @param {ol/coordinate~Coordinate} coordinate the coordinate to request the information at.
12
+ * @return {Promise<FeatureInfo>} Promise with features, layer and coordinate.
13
+ */
14
+ getFeatureInfoAtCoordinate(coordinate: any): Promise<FeatureInfo>;
15
+ /**
16
+ * Create a copy of the VectorLayer.
17
+ * @param {Object} newOptions Options to override
18
+ * @return {VectorLayer} A VectorLayer
19
+ */
20
+ clone(newOptions: any): VectorLayer;
21
+ }
22
+ import Layer from "./Layer";
23
+ //# sourceMappingURL=VectorLayer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VectorLayer.d.ts","sourceRoot":"","sources":["../../../src/ol/layers/VectorLayer.js"],"names":[],"mappings":";AAEA;;;;;GAKG;AACH;IACE;;;;OAIG;IACH,6CAFY,QAAQ,WAAW,CAAC,CAkB/B;IAED;;;;OAIG;IACH,wBAFY,WAAW,CAItB;CACF"}
@@ -0,0 +1,38 @@
1
+ export default WMSLayer;
2
+ /**
3
+ * Class use to display a WMS layer.
4
+ *
5
+ * @classproperty {ol/Map~Map} map - The map where the layer is displayed.
6
+ * @extends {Layer}
7
+ */
8
+ declare class WMSLayer extends Layer {
9
+ /**
10
+ * @override
11
+ */
12
+ constructor(options?: {});
13
+ /** @ignore */
14
+ abortController: AbortController;
15
+ /** @ignore */
16
+ format: GeoJSON;
17
+ /**
18
+ * Get features infos' Url.
19
+ * @param {ol/coordinate~Coordinate} coord
20
+ * @return {ol/layer/Layer~Layer}
21
+ */
22
+ getFeatureInfoUrl(coord: any): ol;
23
+ /**
24
+ * Request feature information for a given coordinate.
25
+ * @param {ol/coordinate~Coordinate} coordinate to request the information at.
26
+ * @return {Promise<FeatureInfo>} Promise with features, layer and coordinate.
27
+ */
28
+ getFeatureInfoAtCoordinate(coordinate: any): Promise<FeatureInfo>;
29
+ /**
30
+ * Create a copy of the WMSLayer.
31
+ * @param {Object} newOptions Options to override
32
+ * @return {WMSLayer} A WMSLayer
33
+ */
34
+ clone(newOptions: any): WMSLayer;
35
+ }
36
+ import Layer from "./Layer";
37
+ import GeoJSON from "ol/format/GeoJSON";
38
+ //# sourceMappingURL=WMSLayer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WMSLayer.d.ts","sourceRoot":"","sources":["../../../src/ol/layers/WMSLayer.js"],"names":[],"mappings":";AAGA;;;;;GAKG;AACH;IACE;;OAEG;IACH,0BAOC;IAJC,cAAc;IACd,iCAA4C;IAC5C,cAAc;IACd,gBAA2B;IAG7B;;;;OAIG;IACH,kCAaC;IAED;;;;OAIG;IACH,6CAFY,QAAQ,WAAW,CAAC,CAsB/B;IAED;;;;OAIG;IACH,wBAFY,QAAQ,CAInB;CACF"}
@@ -0,0 +1,9 @@
1
+ export { default as Layer } from "./Layer";
2
+ export { default as MapboxLayer } from "./MapboxLayer";
3
+ export { default as MaplibreLayer } from "./MaplibreLayer";
4
+ export { default as MapboxStyleLayer } from "./MapboxStyleLayer";
5
+ export { default as RoutingLayer } from "./RoutingLayer";
6
+ export { default as RealtimeLayer } from "./RealtimeLayer";
7
+ export { default as VectorLayer } from "./VectorLayer";
8
+ export { default as WMSLayer } from "./WMSLayer";
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ol/layers/index.js"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export default fullTrajectoryDelaystyle;
2
+ declare function fullTrajectoryDelaystyle(): Style[];
3
+ import { Style } from "ol/style";
4
+ //# sourceMappingURL=fullTrajectoryDelayStyle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fullTrajectoryDelayStyle.d.ts","sourceRoot":"","sources":["../../../src/ol/styles/fullTrajectoryDelayStyle.js"],"names":[],"mappings":";AAgCA,qDAEC"}
@@ -0,0 +1,4 @@
1
+ export default fullTrajectorystyle;
2
+ declare function fullTrajectorystyle(feature: any, resolution: any, options: any): Style[];
3
+ import { Style } from "ol/style";
4
+ //# sourceMappingURL=fullTrajectoryStyle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fullTrajectoryStyle.d.ts","sourceRoot":"","sources":["../../../src/ol/styles/fullTrajectoryStyle.js"],"names":[],"mappings":";AAiBA,2FAgCC"}
@@ -0,0 +1,3 @@
1
+ export { default as fullTrajectoryStyle } from "./fullTrajectoryStyle";
2
+ export { default as fullTrajectoryDelayStyle } from "./fullTrajectoryDelayStyle";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ol/styles/index.js"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -2,33 +2,22 @@
2
2
  "name": "mobility-toolbox-js",
3
3
  "license": "MIT",
4
4
  "description": "Toolbox for JavaScript applications in the domains of mobility and logistics.",
5
- "version": "2.0.0-beta.3",
5
+ "version": "2.0.0-beta.33",
6
6
  "main": "index.js",
7
- "module": "module.js",
7
+ "exports": {
8
+ ".": "./index.js",
9
+ "./api": "./api/index.js",
10
+ "./mapbox": "./mapbox/index.js",
11
+ "./ol": "./ol/index.js",
12
+ "./types": "./types/index.d.ts"
13
+ },
8
14
  "dependencies": {
9
- "@geops/geops-ui": "0.1.13",
10
- "@material-ui/core": "4.12.3",
11
- "@material-ui/icons": "4.11.2",
12
- "@material-ui/styles": "4.11.4",
13
15
  "@turf/helpers": "^6.5.0",
14
16
  "@turf/transform-rotate": "^6.5.0",
15
- "codesandbox": "2.2.3",
16
17
  "lodash.debounce": "4.0.8",
17
18
  "lodash.throttle": "4.1.1",
18
19
  "path": "^0.12.7",
19
- "prop-types": "15.8.1",
20
- "query-string": "7.1.0",
21
- "react": "18",
22
- "react-app-polyfill": "^1.0.6",
23
- "react-dom": "18",
24
- "react-icons": "4.3.1",
25
- "react-markdown": "8.0.0",
26
- "react-router-dom": "6",
27
- "react-scrollchor": "7.0.1",
28
- "react-syntax-highlighter": "15.4.5",
29
- "taffydb": "^2.7.3",
30
20
  "turf": "^3.0.14",
31
- "typeface-lato": "^0.0.75",
32
21
  "uuid": "8.3.2"
33
22
  },
34
23
  "peerDependencies": {
@@ -42,75 +31,94 @@
42
31
  "@babel/plugin-transform-runtime": "7.16.10",
43
32
  "@babel/preset-env": "^7.16.11",
44
33
  "@babel/preset-react": "7.16.7",
45
- "@neutrinojs/copy": "9.5.0",
46
- "@neutrinojs/jest": "^9.5.0",
47
- "@neutrinojs/library": "9.5.0",
48
- "@neutrinojs/react": "9.5.0",
34
+ "@commitlint/cli": "17.0.2",
35
+ "@commitlint/config-conventional": "17.0.2",
36
+ "@types/arcgis-js-api": "^4.24.0",
37
+ "@types/arcgis-rest-api": "^10.4.5",
38
+ "@types/geojson": "^7946.0.8",
39
+ "@types/topojson": "^3.2.3",
40
+ "@typescript-eslint/eslint-plugin": "^5.30.5",
41
+ "@typescript-eslint/parser": "^5.30.5",
49
42
  "autoprefixer": "9.7.6",
50
43
  "cypress": "9.4.1",
51
44
  "deepmerge": "4.2.2",
45
+ "esbuild": "^0.14.47",
46
+ "esbuild-jest": "^0.5.0",
52
47
  "esdoc": "1.1.0",
53
48
  "esdoc-ecmascript-proposal-plugin": "1.0.0",
54
49
  "esdoc-publish-html-plugin": "1.1.2",
55
50
  "esdoc-standard-plugin": "1.0.0",
51
+ "esdoc-typescript-plugin": "^1.0.1",
56
52
  "eslint": "8.8.0",
57
53
  "eslint-config-airbnb": "19.0.4",
54
+ "eslint-config-airbnb-typescript": "^17.0.0",
58
55
  "eslint-config-prettier": "8.3.0",
59
- "eslint-import-resolver-webpack": "0.13.2",
60
56
  "eslint-plugin-cypress": "2.12.1",
61
57
  "eslint-plugin-import": "2.25.4",
62
- "eslint-plugin-jsx-a11y": "6.5.1",
58
+ "eslint-plugin-jsx-a11y": "^6.6.0",
63
59
  "eslint-plugin-prettier": "4.0.0",
64
- "eslint-plugin-react": "7.28.0",
65
- "eslint-plugin-react-hooks": "4.3.0",
60
+ "eslint-plugin-react": "^7.30.1",
66
61
  "fixpack": "3.0.6",
67
- "husky": "7.0.4",
62
+ "husky": "8.0.1",
68
63
  "jest": "26.6.3",
69
64
  "jest-canvas-mock": "2.3.1",
70
65
  "jest-fetch-mock": "3.0.3",
71
66
  "jest-serializer-html": "7.1.0",
67
+ "jest-transformer-svg": "^2.0.0",
72
68
  "jest-websocket-mock": "2.3.0",
73
69
  "lint-staged": "12.3.3",
74
70
  "mapbox-gl": "1.13.2",
75
71
  "maplibre-gl": "2.1.9",
76
72
  "mock-socket": "9.1.2",
77
- "neutrino": "9.5.0",
78
- "ol": "6.12.0",
73
+ "ol": "6.14.1",
74
+ "openapi-typescript": "^5.4.0",
79
75
  "postcss": "8.3.3",
80
76
  "postcss-loader": "3.0.0",
81
77
  "prettier": "2.5.1",
82
78
  "sass": "1.52.2",
83
79
  "sass-loader": "8.0.2",
84
80
  "sort-json": "2.0.0",
81
+ "standard-version": "9.5.0",
85
82
  "start-server-and-test": "1.14.0",
86
83
  "stylelint": "14.3.0",
87
84
  "stylelint-config-recommended-scss": "5.0.2",
88
85
  "stylelint-config-standard": "24.0.0",
89
86
  "stylelint-scss": "4.1.0",
90
- "webpack": "4.43.0",
91
- "webpack-cli": "3.3.11",
92
- "webpack-dev-server": "3.11.0",
93
- "worker-loader": "3.0.8"
87
+ "typescript": "^4.7.4"
94
88
  },
95
89
  "scripts": {
96
- "apidoc": "esdoc",
97
- "build": "yarn lib",
90
+ "apidoc": "esdoc && cp apidoc/index.json doc/src/components/Esdoc",
91
+ "build": "rm -rf build && yarn tsc && yarn esbuild:iife && cp README.md build/ && cp package.json build/ && cp -R src/types build/",
98
92
  "coverage": "yarn test --watchAll=false --coverage --coverageDirectory=coverage",
99
93
  "cy:open": "cypress open",
100
- "cy:run": "cypress run",
101
- "cy:test": "start-server-and-test start http://localhost:5000 'cypress run'",
102
- "doc": "yarn apidoc && cp apidoc/index.json src/doc/components/Esdoc/ && webpack --mode production",
103
- "doc:dev": "yarn apidoc && webpack --mode development",
94
+ "cy:test": "start-server-and-test dev http://localhost:3000 'cypress run --browser chrome'",
95
+ "cy:test:chrome": "yarn build && start-server-and-test start http://localhost:3000 'cypress run --browser chrome'",
96
+ "cy:test:edge": "yarn build && start-server-and-test start http://localhost:3000 'cypress run --browser edge'",
97
+ "cy:test:firefox": "yarn build && start-server-and-test start http://localhost:3000 'cypress run --browser firefox'",
98
+ "dev": "yarn doc && yarn dev:examples",
99
+ "dev:examples": "cd doc && yarn dev",
100
+ "doc": "yarn apidoc && cd doc && yarn install --frozen-lockfile && yarn build",
101
+ "esbuild": "yarn esbuild:all && yarn esbuild:iife",
102
+ "esbuild:all": "esbuild src/index.js src/**/*.js src/**/*.ts src/**/**/*.js src/**/**/*.ts --target=chrome100 --outdir=build/ --loader:.js=jsx",
103
+ "esbuild:iife": "yarn esbuild:iife:unminify && yarn esbuild:iife:minify",
104
+ "esbuild:iife:base": "esbuild src/iife.js --bundle --sourcemap --target=chrome100",
105
+ "esbuild:iife:minify": "yarn esbuild:iife:base --minify --outfile=build/mbt.min.js",
106
+ "esbuild:iife:unminify": "yarn esbuild:iife:base --outfile=build/mbt.js",
104
107
  "format": "prettier --write 'src/**/*.js' && eslint 'src/**/*.js' --fix && stylelint 'src/**/*.css' 'src/**/*.scss' --fix",
105
108
  "lib": "REACT_APP_LIB_MODE=1 webpack --mode production",
106
109
  "lib:dev": "REACT_APP_LIB_MODE=1 webpack --mode development",
107
110
  "link2": "cmdToAdd=$(node ./scripts/read-pkg-json.js add) && $cmdToAdd && yarn build && cmdToRemove=$(node ./scripts/read-pkg-json.js remove) && $cmdToRemove && cd build && yarn link",
108
- "lint": "eslint 'src/**/*.js' && stylelint 'src/**/*.css' 'src/**/*.scss'",
109
- "publish:beta": "HUSKY=0 yarn version && git push origin HEAD && yarn build && cd build && HUSKY=0 yarn publish --tag beta",
110
- "start": "yarn doc && webpack-dev-server --mode development --open",
111
- "start:examples": "webpack-dev-server --mode development --open",
112
- "test": "REACT_APP_LIB_MODE=1 jest",
113
- "test:watch": "yarn test --watchAll"
111
+ "lint": "eslint src/**/*.js src/**/*.ts && stylelint src/**/*.css src/**/*.scss --allow-empty-input",
112
+ "publish:beta": "HUSKY=0 yarn release -- --prerelease beta --skip.changelog && git push origin HEAD && yarn run build && cd build && HUSKY=0 yarn publish --tag beta && git push --tags ",
113
+ "publish:beta:dryrun": "yarn release -- --prerelease beta --dry-run --skip.changelog",
114
+ "publish:public:dryrun": "yarn release --dry-run",
115
+ "release": "standard-version",
116
+ "start": "yarn doc && cd doc && yarn start",
117
+ "start:examples": "cd doc && yarn build && yarn start",
118
+ "test": "TZ='UTC' jest",
119
+ "test:watch": "yarn test --watchAll",
120
+ "tsc": "tsc",
121
+ "types:backend": "openapi-typescript https://developer.geops.io/swagger/routing.json --output types/routing.d.ts && openapi-typescript https://developer.geops.io/swagger/stops.json --output types/stops.d.ts"
114
122
  },
115
123
  "browserslist": {
116
124
  "production": [
@@ -125,53 +133,6 @@
125
133
  "last 1 ie version"
126
134
  ]
127
135
  },
128
- "eslintConfig": {
129
- "env": {
130
- "cypress/globals": true,
131
- "node": true,
132
- "browser": true,
133
- "es6": true,
134
- "jest": true
135
- },
136
- "parser": "@babel/eslint-parser",
137
- "extends": [
138
- "airbnb",
139
- "airbnb/hooks",
140
- "prettier"
141
- ],
142
- "plugins": [
143
- "cypress",
144
- "prettier"
145
- ],
146
- "rules": {
147
- "arrow-body-style": 0,
148
- "react/jsx-filename-extension": [
149
- 1,
150
- {
151
- "extensions": [
152
- ".js",
153
- ".jsx"
154
- ]
155
- }
156
- ],
157
- "prettier/prettier": "error"
158
- },
159
- "settings": {
160
- "import/resolver": "webpack",
161
- "react": {
162
- "version": "detect"
163
- }
164
- }
165
- },
166
- "exports": {
167
- ".": "./index.js",
168
- "./module": "./module.js",
169
- "./api": "./api/index.js",
170
- "./common/trackerConfig": "./common/trackerConfig.js",
171
- "./utils": "./common/utils/index.js",
172
- "./mapbox": "./mapbox/index.js",
173
- "./ol": "./ol/index.js"
174
- },
175
136
  "keywords": [
176
137
  "mobility",
177
138
  "toolbox"
@@ -184,10 +145,10 @@
184
145
  "yarn test --bail --findRelatedTests"
185
146
  ],
186
147
  "package.json": [
187
- "fixpack --sortToTop name --sortToTop license --sortToTop description --sortToTop version --sortToTop author --sortToTop main --sortToTop module --sortToTop files --sortToTop proxy --sortToTop dependencies --sortToTop peerDependencies --sortToTop devDependencies --sortToTop resolutions --sortToTop scripts"
148
+ "fixpack --sortToTop name --sortToTop license --sortToTop description --sortToTop version --sortToTop author --sortToTop main --sortToTop module --sortToTop files --sortToTop exports --sortToTop proxy --sortToTop dependencies --sortToTop peerDependencies --sortToTop devDependencies --sortToTop resolutions --sortToTop scripts"
188
149
  ],
189
150
  "src/**/*.{css,scss}": [
190
- "stylelint --fix"
151
+ "stylelint --fix --allow-empty-input"
191
152
  ]
192
153
  },
193
154
  "prettier": {
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=setupTests.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setupTests.d.ts","sourceRoot":"","sources":["../src/setupTests.js"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import { Paths as Routing } from './routing';
2
+ import { Paths as Stops } from './stops';
3
+
4
+ export * from './realtime';
5
+
6
+ export type RoutingParameters = Routing['/']['get']['parameters']['query'];
7
+ export type RoutingResponse = Routing['/']['get']['responses']['200']['schema'];
8
+
9
+ export type StopsParameters = Stops['/']['get']['parameters']['query'];
10
+ export type StopsResponse = Stops['/']['get']['responses']['200']['schema'];
@@ -0,0 +1,24 @@
1
+ import { Feature } from 'geojson';
2
+
3
+ export interface RealtimeTrajectory extends Feature {}
4
+
5
+ export interface RealtimeTrajectoryResponse {
6
+ train_id: 'trajectory';
7
+ timestamp: number;
8
+ client_reference: '';
9
+ content: [RealtimeTrajectory];
10
+ }
11
+
12
+ export interface RealtimeBufferResponse {
13
+ source: 'buffer';
14
+ timestamp: number;
15
+ client_reference: '';
16
+ content: [RealtimeTrajectoryResponse];
17
+ }
18
+
19
+ export interface RealtimeResponse {
20
+ source: string;
21
+ timestamp: number;
22
+ client_reference: 'None';
23
+ content: [RealtimeBufferResponse];
24
+ }
@@ -0,0 +1,206 @@
1
+ /**
2
+ * This file was auto-generated by openapi-typescript.
3
+ * Do not make direct changes to the file.
4
+ */
5
+
6
+ export interface Paths {
7
+ '/': {
8
+ /** Returns a route as GeoJSON */
9
+ get: {
10
+ parameters: {
11
+ query: {
12
+ /**
13
+ * A pipe separated list of hops. A hop describes a station with either
14
+ * - a name or abbreviation
15
+ * - a station id, prefixed with `!`
16
+ * - comma-seperated coordinates starting with geographic latitude followed by longitude, prefixed with `@`
17
+ * - an additional platform code, prefixed with `$`
18
+ *
19
+ * Station names do not need to match exactly the names in the
20
+ * database that is used for routing. The correct names are searched
21
+ * for by simple normalization, by lookup of synonyms or abbreviation
22
+ * as well as fuzzy algorithms.
23
+ *
24
+ * The usage of different schemes of IDs used by the transit agencies
25
+ * is handled to a large part. A station can be found by all IDs that
26
+ * we know for it. E.g. the station Basel Bad can be found with the ID
27
+ * 8500090 that is used by Swiss Federal Railways SBB and by 8518816,
28
+ * the number used by German Railways DB. Also the usage of numbers
29
+ * used by the UIC is supported for many stations. If you need an
30
+ * additional numbering scheme please contact us.
31
+ *
32
+ * Note on coordinates:
33
+ * If you do not prefix the coordinate pair with `@`, no snapping to
34
+ * the next station is performed. Instead the route will forcefully
35
+ * traverse the specified point.
36
+ *
37
+ * Note on mot's "foot" and "car":
38
+ * Some features might not be available, such as "line-from",
39
+ * "line-to", because they dont apply to those means of transport.
40
+ *
41
+ * Examples for a single hop:
42
+ * - `@47.37811,8.53935` a station at position 47.37811, 8.53935
43
+ * - `basel sbb` a station named "basel sbb"
44
+ * - `ZUE`, station "Zürich HB" by its common abbreviation
45
+ * - `Zürich Hauptbahnhof` or `HBF Zürich` are all valid synonyms für "Zürich HB"
46
+ * - `!8596126` a station with id 8596126
47
+ * - `basel sbb$4` track 4 in a station "Basel SBB"
48
+ * - `@47.37811,8.53935$4` track 4 in a station at position 47.37811, 8.53935
49
+ * - `zürich hb@47.37811,8.53935$8` track 8 in station "Zürich HB" at position 47.37811, 8.53935
50
+ *
51
+ * Example for a valid via with three hops:
52
+ * - `freiburg|basel%20sbb|bern` - from Freiburg (Breisgau) Hbf via Basel SBB to Bern
53
+ */
54
+ via: string;
55
+ /** Mode of transport */
56
+ mot:
57
+ | 'rail'
58
+ | 'bus'
59
+ | 'coach'
60
+ | 'foot'
61
+ | 'tram'
62
+ | 'subway'
63
+ | 'gondola'
64
+ | 'funicular'
65
+ | 'ferry'
66
+ | 'car';
67
+ /** Only for mot=rail. Default is a detailed network based on OpenStreetMap. gen1 to gen4 provide rail networks with increasing levels of generalization */
68
+ graph?: 'gen1' | 'gen2' | 'gen3' | 'gen4';
69
+ /** A line name that should be preferred */
70
+ line?: string;
71
+ /** Name of origin of the preferred line */
72
+ 'line-from'?: string;
73
+ /** Name of destination of the preferred line */
74
+ 'line-to'?: string;
75
+ /** Douglas-Peucker distance parameter for simplification. Default 0.5 in Mercator units */
76
+ simplify?: number;
77
+ /**
78
+ * Maximum allowed ratio of hops to skip if not found. Only non-start
79
+ * and non-end hops are counted in ratio numerator and denominator.
80
+ */
81
+ 'max-skip-hop-ratio'?: number;
82
+ /**
83
+ * Whether to include intermediate hops (stations/stops) found on the
84
+ * route to the response. "true", "on", "yes", "y", "1" will enable
85
+ * intermediate hops. Default: disabled
86
+ */
87
+ hops?: string;
88
+ /**
89
+ * Whether to use beelines (line strings with 2 points) between
90
+ * mutually unreachable hops as a fallback for "Route not found"
91
+ * errors. "true", "on", "yes", "y", "1" will enable the
92
+ * fallback. Default: enabled
93
+ */
94
+ 'beeline-fallback'?: string;
95
+ /**
96
+ * Search radius for candidate edges during snapping of coordinates
97
+ * (see "Note on coordinates" at the top) Default: -1.0
98
+ */
99
+ 'coord-radius'?: number;
100
+ /**
101
+ * Distance punishment factor for edge snapping of coordinates (see
102
+ * "Note on coordinates" at the top). Large: prefer close edge. Small:
103
+ * prefer short total route. Negative value: like worst edge
104
+ * category. Default: -1.0
105
+ */
106
+ 'coord-punish'?: number;
107
+ /**
108
+ * Whether to output OSM way ids in Feature properties.
109
+ * "true", "on", "yes", "y", "1" will enable output. Default: disabled
110
+ */
111
+ 'way-ids'?: string;
112
+ };
113
+ };
114
+ responses: {
115
+ /** A route */
116
+ 200: {
117
+ schema: {
118
+ features?: {
119
+ geometry?: {
120
+ /**
121
+ * @example [
122
+ * [
123
+ * 7.8958421,
124
+ * 47.9816362
125
+ * ],
126
+ * [
127
+ * 7.9048287,
128
+ * 47.9796056
129
+ * ]
130
+ * ]
131
+ */
132
+ coordinates?: number[][];
133
+ /** @enum {string} */
134
+ type?: 'LineString';
135
+ };
136
+ properties?: {
137
+ lines?: {
138
+ /** @example ICE */
139
+ name?: string;
140
+ /** @example 0.99 */
141
+ prop?: number;
142
+ }[];
143
+ };
144
+ station_from?: {
145
+ /**
146
+ * @description IBNR
147
+ * @example
148
+ */
149
+ id?: string;
150
+ /** @example Freiburg Littenweiler */
151
+ name?: string;
152
+ /** @example 1 */
153
+ platform?: string;
154
+ /** @description Latitude of the stop, in WGS84 */
155
+ latitude?: number;
156
+ /** @description Latitude of the stop, in WGS84 */
157
+ longitude?: number;
158
+ };
159
+ station_to?: {
160
+ /**
161
+ * @description IBNR
162
+ * @example 8004158
163
+ */
164
+ id?: string;
165
+ /** @example Muenchen Pasing */
166
+ name?: string;
167
+ /** @example 4 */
168
+ platform?: string;
169
+ /** @description Latitude of the stop, in WGS84 */
170
+ latitude?: number;
171
+ /** @description Latitude of the stop, in WGS84 */
172
+ longitude?: number;
173
+ };
174
+ /** @enum {string} */
175
+ type?: 'Feature';
176
+ };
177
+ properties?: {
178
+ lines?: {
179
+ /** @example ICE */
180
+ name?: string;
181
+ /** @example 0.99 */
182
+ prop?: number;
183
+ }[];
184
+ /**
185
+ * @description routing was done on this graph
186
+ * @example osm-eu-rail
187
+ */
188
+ network?: string;
189
+ /**
190
+ * @description via's you passed as a parameter but were
191
+ * skipped when routing (maybe because they were not found)
192
+ */
193
+ skippedVias?: string[];
194
+ };
195
+ /** @enum {string} */
196
+ type?: 'FeatureCollection';
197
+ };
198
+ };
199
+ };
200
+ };
201
+ };
202
+ }
203
+
204
+ export interface Operations {}
205
+
206
+ export interface External {}