mobility-toolbox-js 2.0.0-beta.34 → 2.0.0-beta.37
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 +14 -8
- package/api/RealtimeAPI.d.ts +6 -6
- package/api/RealtimeAPI.d.ts.map +1 -1
- package/api/RealtimeAPI.js +170 -197
- package/api/RealtimeAPI.test.d.ts +2 -0
- package/api/RealtimeAPI.test.d.ts.map +1 -0
- package/api/RealtimeAPI.test.js +67 -0
- package/api/RoutingAPI.d.ts +6 -2
- package/api/RoutingAPI.d.ts.map +1 -1
- package/api/RoutingAPI.js +8 -38
- package/api/RoutingAPI.test.d.ts +2 -0
- package/api/RoutingAPI.test.d.ts.map +1 -0
- package/api/RoutingAPI.test.js +29 -0
- package/api/StopsAPI.d.ts +1 -1
- package/api/StopsAPI.d.ts.map +1 -1
- package/api/StopsAPI.js +8 -40
- package/api/StopsAPI.test.d.ts +2 -0
- package/api/StopsAPI.test.d.ts.map +1 -0
- package/api/StopsAPI.test.js +26 -0
- package/api/index.d.ts +3 -4
- package/api/index.d.ts.map +1 -1
- package/api/index.js +3 -10
- package/api/typedefs.js +1 -0
- package/common/api/HttpAPI.d.ts +2 -2
- package/common/api/HttpAPI.d.ts.map +1 -1
- package/common/api/HttpAPI.js +21 -48
- package/common/api/HttpAPI.test.d.ts +2 -0
- package/common/api/HttpAPI.test.d.ts.map +1 -0
- package/common/api/HttpAPI.test.js +54 -0
- package/common/api/WebSocketAPI.d.ts +8 -4
- package/common/api/WebSocketAPI.d.ts.map +1 -1
- package/common/api/WebSocketAPI.js +125 -129
- package/common/api/WebSocketAPI.test.d.ts +2 -0
- package/common/api/WebSocketAPI.test.d.ts.map +1 -0
- package/common/api/WebSocketAPI.test.js +380 -0
- package/common/controls/Control.d.ts +5 -5
- package/common/controls/Control.d.ts.map +1 -1
- package/common/controls/Control.js +44 -77
- package/common/controls/Control.test.d.ts +2 -0
- package/common/controls/Control.test.d.ts.map +1 -0
- package/common/controls/Control.test.js +89 -0
- package/common/index.js +2 -18
- package/common/layers/Layer.d.ts +11 -11
- package/common/layers/Layer.d.ts.map +1 -1
- package/common/layers/Layer.js +70 -104
- package/common/layers/Layer.test.d.ts +2 -0
- package/common/layers/Layer.test.d.ts.map +1 -0
- package/common/layers/Layer.test.js +137 -0
- package/common/mixins/CopyrightMixin.js +23 -52
- package/common/mixins/MapboxLayerMixin.js +162 -204
- package/common/mixins/RealtimeLayerMixin.js +580 -635
- package/common/mixins/StopFinderMixin.d.ts +3 -3
- package/common/mixins/StopFinderMixin.d.ts.map +1 -1
- package/common/mixins/StopFinderMixin.js +115 -157
- package/common/mixins/UserInteractionsLayerMixin.js +142 -175
- package/common/mixins/UserInteractionsLayerMixin.test.d.ts +2 -0
- package/common/mixins/UserInteractionsLayerMixin.test.d.ts.map +1 -0
- package/common/mixins/UserInteractionsLayerMixin.test.js +214 -0
- package/common/styles/index.js +4 -24
- package/common/styles/realtimeDefaultStyle.d.ts.map +1 -1
- package/common/styles/realtimeDefaultStyle.js +67 -78
- package/common/styles/realtimeDelayStyle.js +4 -17
- package/common/styles/realtimeSimpleStyle.js +5 -7
- package/common/typedefs.js +1 -0
- package/common/utils/cleanStopTime.js +3 -5
- package/common/utils/compareDepartures.d.ts +1 -1
- package/common/utils/compareDepartures.d.ts.map +1 -1
- package/common/utils/compareDepartures.js +8 -11
- package/common/utils/createCanvas.js +3 -5
- package/common/utils/createTrackerFilters.d.ts +1 -1
- package/common/utils/createTrackerFilters.d.ts.map +1 -1
- package/common/utils/createTrackerFilters.js +22 -32
- package/common/utils/createTrackerFilters.test.d.ts +2 -0
- package/common/utils/createTrackerFilters.test.d.ts.map +1 -0
- package/common/utils/createTrackerFilters.test.js +79 -0
- package/common/utils/getLayersAsFlatArray.js +6 -8
- package/common/utils/getMapboxMapCopyrights.js +9 -11
- package/common/utils/getMapboxMapCopyrights.test.d.ts +2 -0
- package/common/utils/getMapboxMapCopyrights.test.d.ts.map +1 -0
- package/common/utils/getMapboxMapCopyrights.test.js +40 -0
- package/common/utils/getMapboxRender.js +12 -15
- package/common/utils/getMaplibreRender.js +10 -13
- package/common/utils/getRealtimeModeSuffix.js +2 -6
- package/common/utils/getUrlWithParams.js +5 -8
- package/common/utils/getVehiclePosition.js +20 -23
- package/common/utils/index.js +12 -37
- package/common/utils/removeDuplicate.d.ts +1 -1
- package/common/utils/removeDuplicate.d.ts.map +1 -1
- package/common/utils/removeDuplicate.js +6 -21
- package/common/utils/removeDuplicate.test.d.ts +2 -0
- package/common/utils/removeDuplicate.test.d.ts.map +1 -0
- package/common/utils/removeDuplicate.test.js +19 -0
- package/common/utils/renderTrajectories.js +31 -43
- package/common/utils/sortByDelay.js +4 -6
- package/common/utils/timeUtils.js +14 -24
- package/common/utils/timeUtils.test.d.ts +2 -0
- package/common/utils/timeUtils.test.d.ts.map +1 -0
- package/common/utils/timeUtils.test.js +10 -0
- package/common/utils/trackerConfig.js +27 -39
- package/common/utils/trackerConfig.test.d.ts +2 -0
- package/common/utils/trackerConfig.test.d.ts.map +1 -0
- package/common/utils/trackerConfig.test.js +23 -0
- package/iife.js +3 -5
- package/index.d.ts +4 -0
- package/index.js +9 -10
- package/mapbox/controls/CopyrightControl.d.ts +0 -1
- package/mapbox/controls/CopyrightControl.d.ts.map +1 -1
- package/mapbox/controls/CopyrightControl.js +18 -38
- package/mapbox/controls/index.js +1 -5
- package/mapbox/index.js +4 -20
- package/mapbox/layers/Layer.d.ts +1 -1
- package/mapbox/layers/Layer.d.ts.map +1 -1
- package/mapbox/layers/Layer.js +29 -71
- package/mapbox/layers/Layer.test.d.ts +2 -0
- package/mapbox/layers/Layer.test.d.ts.map +1 -0
- package/mapbox/layers/Layer.test.js +204 -0
- package/mapbox/layers/RealtimeLayer.d.ts +4 -4
- package/mapbox/layers/RealtimeLayer.d.ts.map +1 -1
- package/mapbox/layers/RealtimeLayer.js +83 -125
- package/mapbox/layers/RealtimeLayer.test.d.ts +2 -0
- package/mapbox/layers/RealtimeLayer.test.d.ts.map +1 -0
- package/mapbox/layers/RealtimeLayer.test.js +10 -0
- package/mapbox/layers/index.js +2 -7
- package/mapbox/utils.js +19 -33
- package/mbt.js +59 -37
- package/mbt.js.map +2 -2
- package/mbt.min.js +10 -10
- package/mbt.min.js.map +2 -2
- package/ol/controls/CopyrightControl.js +26 -47
- package/ol/controls/CopyrightControl.test.d.ts +2 -0
- package/ol/controls/CopyrightControl.test.d.ts.map +1 -0
- package/ol/controls/CopyrightControl.test.js +177 -0
- package/ol/controls/RoutingControl.d.ts +6 -5
- package/ol/controls/RoutingControl.d.ts.map +1 -1
- package/ol/controls/RoutingControl.js +209 -270
- package/ol/controls/RoutingControl.test.d.ts +2 -0
- package/ol/controls/RoutingControl.test.d.ts.map +1 -0
- package/ol/controls/RoutingControl.test.js +150 -0
- package/ol/controls/StopFinderControl.js +9 -32
- package/ol/controls/StopFinderControl.test.d.ts +2 -0
- package/ol/controls/StopFinderControl.test.d.ts.map +1 -0
- package/ol/controls/StopFinderControl.test.js +49 -0
- package/ol/controls/index.js +3 -9
- package/ol/index.js +5 -21
- package/ol/layers/Layer.d.ts +1 -1
- package/ol/layers/Layer.d.ts.map +1 -1
- package/ol/layers/Layer.js +40 -72
- package/ol/layers/Layer.test.d.ts +2 -0
- package/ol/layers/Layer.test.d.ts.map +1 -0
- package/ol/layers/Layer.test.js +196 -0
- package/ol/layers/MapboxLayer.d.ts +7 -7
- package/ol/layers/MapboxLayer.d.ts.map +1 -1
- package/ol/layers/MapboxLayer.js +30 -66
- package/ol/layers/MapboxLayer.test.d.ts +2 -0
- package/ol/layers/MapboxLayer.test.d.ts.map +1 -0
- package/ol/layers/MapboxLayer.test.js +164 -0
- package/ol/layers/MapboxStyleLayer.d.ts +3 -3
- package/ol/layers/MapboxStyleLayer.d.ts.map +1 -1
- package/ol/layers/MapboxStyleLayer.js +92 -135
- package/ol/layers/MapboxStyleLayer.test.d.ts +2 -0
- package/ol/layers/MapboxStyleLayer.test.d.ts.map +1 -0
- package/ol/layers/MapboxStyleLayer.test.js +232 -0
- package/ol/layers/MaplibreLayer.d.ts +1 -1
- package/ol/layers/MaplibreLayer.d.ts.map +1 -1
- package/ol/layers/MaplibreLayer.js +14 -48
- package/ol/layers/RealtimeLayer.d.ts +2 -2
- package/ol/layers/RealtimeLayer.d.ts.map +1 -1
- package/ol/layers/RealtimeLayer.js +111 -147
- package/ol/layers/RealtimeLayer.test.d.ts +2 -0
- package/ol/layers/RealtimeLayer.test.d.ts.map +1 -0
- package/ol/layers/RealtimeLayer.test.js +71 -0
- package/ol/layers/RoutingLayer.d.ts +2 -2
- package/ol/layers/RoutingLayer.d.ts.map +1 -1
- package/ol/layers/RoutingLayer.js +29 -61
- package/ol/layers/RoutingLayer.test.d.ts +2 -0
- package/ol/layers/RoutingLayer.test.d.ts.map +1 -0
- package/ol/layers/RoutingLayer.test.js +39 -0
- package/ol/layers/VectorLayer.d.ts +1 -1
- package/ol/layers/VectorLayer.d.ts.map +1 -1
- package/ol/layers/VectorLayer.js +14 -48
- package/ol/layers/VectorLayer.test.d.ts +2 -0
- package/ol/layers/VectorLayer.test.d.ts.map +1 -0
- package/ol/layers/VectorLayer.test.js +87 -0
- package/ol/layers/WMSLayer.d.ts +1 -1
- package/ol/layers/WMSLayer.d.ts.map +1 -1
- package/ol/layers/WMSLayer.js +34 -68
- package/ol/layers/WMSLayer.test.d.ts +2 -0
- package/ol/layers/WMSLayer.test.d.ts.map +1 -0
- package/ol/layers/WMSLayer.test.js +66 -0
- package/ol/layers/index.js +8 -19
- package/ol/styles/fullTrajectoryDelayStyle.js +11 -13
- package/ol/styles/fullTrajectoryStyle.js +16 -18
- package/ol/styles/index.js +2 -7
- package/package.json +5 -2
- package/setupTests.js +12 -14
package/api/RealtimeAPI.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var cleanStopTime_1 = require("../common/utils/cleanStopTime");
|
|
6
|
-
var getRealtimeModeSuffix_1 = require("../common/utils/getRealtimeModeSuffix");
|
|
7
|
-
var compareDepartures_1 = require("../common/utils/compareDepartures");
|
|
1
|
+
import WebSocketAPI from '../common/api/WebSocketAPI';
|
|
2
|
+
import cleanStopTime from '../common/utils/cleanStopTime';
|
|
3
|
+
import getModeSuffix from '../common/utils/getRealtimeModeSuffix';
|
|
4
|
+
import compareDepartures from '../common/utils/compareDepartures';
|
|
8
5
|
/**
|
|
9
6
|
* Enum for Realtime modes.
|
|
10
7
|
* @readonly
|
|
@@ -14,7 +11,7 @@ var compareDepartures_1 = require("../common/utils/compareDepartures");
|
|
|
14
11
|
* @property {string} TOPOGRAPHIC "topographic"
|
|
15
12
|
* @enum {RealtimeMode}
|
|
16
13
|
*/
|
|
17
|
-
|
|
14
|
+
export const RealtimeModes = {
|
|
18
15
|
RAW: 'raw',
|
|
19
16
|
TOPOGRAPHIC: 'topographic',
|
|
20
17
|
SCHEMATIC: 'schematic',
|
|
@@ -35,7 +32,7 @@ exports.RealtimeModes = {
|
|
|
35
32
|
*
|
|
36
33
|
* const api = new RealtimeAPI("yourUrl");
|
|
37
34
|
*/
|
|
38
|
-
|
|
35
|
+
class RealtimeAPI {
|
|
39
36
|
/**
|
|
40
37
|
* Constructor
|
|
41
38
|
*
|
|
@@ -46,8 +43,7 @@ var RealtimeAPI = /** @class */ (function () {
|
|
|
46
43
|
* @param {string} [options.projection] The epsg code of the projection for features. Default to EPSG:3857.
|
|
47
44
|
* @param {number[4]} [options.bbox=[minX, minY, maxX, maxY, zoom, tenant] The bounding box to receive data from.
|
|
48
45
|
*/
|
|
49
|
-
|
|
50
|
-
if (options === void 0) { options = {}; }
|
|
46
|
+
constructor(options = {}) {
|
|
51
47
|
this.defineProperties(options);
|
|
52
48
|
/** @ignore */
|
|
53
49
|
this.subscribedStationUic = null;
|
|
@@ -62,55 +58,54 @@ var RealtimeAPI = /** @class */ (function () {
|
|
|
62
58
|
/** @ignore */
|
|
63
59
|
this.onOpen = this.onOpen.bind(this);
|
|
64
60
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
var opt = options;
|
|
61
|
+
defineProperties(options) {
|
|
62
|
+
let opt = options;
|
|
68
63
|
if (typeof options === 'string') {
|
|
69
64
|
opt = { url: options };
|
|
70
65
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
66
|
+
const { apiKey } = opt;
|
|
67
|
+
let { url, projection, bbox, buffer = [100, 100] } = opt;
|
|
68
|
+
const wsApi = new WebSocketAPI();
|
|
74
69
|
if (apiKey) {
|
|
75
|
-
url =
|
|
70
|
+
url = `${url || 'wss://api.geops.io/tracker-ws/v1/'}?key=${apiKey}`;
|
|
76
71
|
}
|
|
77
72
|
Object.defineProperties(this, {
|
|
78
73
|
url: {
|
|
79
|
-
get:
|
|
80
|
-
set:
|
|
74
|
+
get: () => url,
|
|
75
|
+
set: (newUrl) => {
|
|
81
76
|
url = newUrl;
|
|
82
|
-
|
|
77
|
+
this.open();
|
|
83
78
|
},
|
|
84
79
|
},
|
|
85
80
|
projection: {
|
|
86
|
-
get:
|
|
87
|
-
set:
|
|
81
|
+
get: () => projection,
|
|
82
|
+
set: (newProjection) => {
|
|
88
83
|
if (newProjection !== projection) {
|
|
89
84
|
projection = newProjection;
|
|
90
|
-
if (
|
|
91
|
-
|
|
85
|
+
if (this.wsApi) {
|
|
86
|
+
this.wsApi.send(`PROJECTION ${projection}`);
|
|
92
87
|
}
|
|
93
88
|
}
|
|
94
89
|
},
|
|
95
90
|
},
|
|
96
91
|
bbox: {
|
|
97
|
-
get:
|
|
98
|
-
set:
|
|
92
|
+
get: () => bbox,
|
|
93
|
+
set: (newBbox) => {
|
|
99
94
|
if (JSON.stringify(newBbox) !== JSON.stringify(bbox)) {
|
|
100
95
|
bbox = newBbox;
|
|
101
|
-
if (
|
|
102
|
-
|
|
96
|
+
if (this.wsApi) {
|
|
97
|
+
this.wsApi.send(`BBOX ${bbox.join(' ')}`);
|
|
103
98
|
}
|
|
104
99
|
}
|
|
105
100
|
},
|
|
106
101
|
},
|
|
107
102
|
buffer: {
|
|
108
|
-
get:
|
|
109
|
-
set:
|
|
103
|
+
get: () => buffer,
|
|
104
|
+
set: (newBuffer) => {
|
|
110
105
|
if (JSON.stringify(newBuffer) !== JSON.stringify(buffer)) {
|
|
111
106
|
buffer = newBuffer;
|
|
112
|
-
if (
|
|
113
|
-
|
|
107
|
+
if (this.wsApi) {
|
|
108
|
+
this.wsApi.send(`BUFFER ${buffer.join(' ')}`);
|
|
114
109
|
}
|
|
115
110
|
}
|
|
116
111
|
},
|
|
@@ -143,44 +138,42 @@ var RealtimeAPI = /** @class */ (function () {
|
|
|
143
138
|
writable: true,
|
|
144
139
|
},
|
|
145
140
|
});
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
var _this = this;
|
|
141
|
+
}
|
|
142
|
+
open() {
|
|
149
143
|
this.close();
|
|
150
144
|
// Register BBOX and PROJECTION messages must be send before previous subscriptions.
|
|
151
145
|
this.wsApi.connect(this.url, this.onOpen);
|
|
152
146
|
// Register reconnection on close.
|
|
153
|
-
this.wsApi.websocket.onclose =
|
|
154
|
-
|
|
147
|
+
this.wsApi.websocket.onclose = () => {
|
|
148
|
+
this.onClose();
|
|
155
149
|
};
|
|
156
|
-
}
|
|
150
|
+
}
|
|
157
151
|
/**
|
|
158
152
|
* Close the websocket connection without reconnection.
|
|
159
153
|
*/
|
|
160
|
-
|
|
154
|
+
close() {
|
|
161
155
|
this.wsApi.close();
|
|
162
|
-
}
|
|
156
|
+
}
|
|
163
157
|
/**
|
|
164
158
|
* Unsubscribe trajectory and deleted_vehicles channels. To resubscribe you have to set a new BBOX.
|
|
165
159
|
*/
|
|
166
160
|
// eslint-disable-next-line class-methods-use-this
|
|
167
|
-
|
|
161
|
+
reset() {
|
|
168
162
|
this.wsApi.send('RESET');
|
|
169
|
-
}
|
|
163
|
+
}
|
|
170
164
|
/**
|
|
171
165
|
* Callback when the websocket is opened and ready.
|
|
172
166
|
* It applies the bbox and the projection.
|
|
173
167
|
*/
|
|
174
|
-
|
|
175
|
-
var _this = this;
|
|
168
|
+
onOpen() {
|
|
176
169
|
if (this.projection) {
|
|
177
|
-
this.wsApi.send(
|
|
170
|
+
this.wsApi.send(`PROJECTION ${this.projection}`);
|
|
178
171
|
}
|
|
179
172
|
if (this.bbox) {
|
|
180
|
-
this.wsApi.send(
|
|
173
|
+
this.wsApi.send(`BBOX ${this.bbox.join(' ')}`);
|
|
181
174
|
}
|
|
182
175
|
if (this.buffer) {
|
|
183
|
-
this.wsApi.send(
|
|
176
|
+
this.wsApi.send(`BUFFER ${this.buffer.join(' ')}`);
|
|
184
177
|
}
|
|
185
178
|
/**
|
|
186
179
|
* Keep websocket alive
|
|
@@ -188,24 +181,23 @@ var RealtimeAPI = /** @class */ (function () {
|
|
|
188
181
|
if (this.pingIntervalMs) {
|
|
189
182
|
window.clearInterval(this.pingInterval);
|
|
190
183
|
/** @ignore */
|
|
191
|
-
this.pingInterval = setInterval(
|
|
192
|
-
|
|
184
|
+
this.pingInterval = setInterval(() => {
|
|
185
|
+
this.wsApi.send('PING');
|
|
193
186
|
}, this.pingIntervalMs);
|
|
194
187
|
}
|
|
195
|
-
}
|
|
188
|
+
}
|
|
196
189
|
/**
|
|
197
190
|
* Callback when the websocket is closed by the server.
|
|
198
191
|
* It auto reconnects after a timeout.
|
|
199
192
|
*/
|
|
200
|
-
|
|
201
|
-
var _this = this;
|
|
193
|
+
onClose() {
|
|
202
194
|
window.clearTimeout(this.pingInterval);
|
|
203
195
|
window.clearTimeout(this.reconnectTimeout);
|
|
204
196
|
if (this.reconnectTimeoutMs) {
|
|
205
197
|
/** @ignore */
|
|
206
|
-
this.reconnectTimeout = window.setTimeout(
|
|
198
|
+
this.reconnectTimeout = window.setTimeout(() => this.open(), this.reconnectTimeoutMs);
|
|
207
199
|
}
|
|
208
|
-
}
|
|
200
|
+
}
|
|
209
201
|
/**
|
|
210
202
|
* Subscribe to a channel.
|
|
211
203
|
*
|
|
@@ -215,10 +207,9 @@ var RealtimeAPI = /** @class */ (function () {
|
|
|
215
207
|
* @param {boolean} [quiet=false] If true avoid to store the subscription in the subscriptions list.
|
|
216
208
|
* @private
|
|
217
209
|
*/
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
};
|
|
210
|
+
subscribe(channel, onSuccess, onError, quiet = false) {
|
|
211
|
+
this.wsApi.subscribe({ channel }, onSuccess, onError, quiet);
|
|
212
|
+
}
|
|
222
213
|
/**
|
|
223
214
|
* Unsubscribe both modes of a channel.
|
|
224
215
|
*
|
|
@@ -227,10 +218,10 @@ var RealtimeAPI = /** @class */ (function () {
|
|
|
227
218
|
* @param {function} cb Callback function to unsubscribe. If null all subscriptions for the channel will be unsubscribed.
|
|
228
219
|
* @private
|
|
229
220
|
*/
|
|
230
|
-
|
|
231
|
-
this.wsApi.unsubscribe(
|
|
232
|
-
this.wsApi.unsubscribe(
|
|
233
|
-
}
|
|
221
|
+
unsubscribe(channel, suffix, cb) {
|
|
222
|
+
this.wsApi.unsubscribe(`${channel}${getModeSuffix(RealtimeModes.SCHEMATIC, RealtimeModes)}${suffix}`, cb);
|
|
223
|
+
this.wsApi.unsubscribe(`${channel}${getModeSuffix(RealtimeModes.TOPOGRAPHIC, RealtimeModes)}${suffix || ''}`, cb);
|
|
224
|
+
}
|
|
234
225
|
/**
|
|
235
226
|
* Filter departures and return an array.
|
|
236
227
|
*
|
|
@@ -239,22 +230,21 @@ var RealtimeAPI = /** @class */ (function () {
|
|
|
239
230
|
* @return {Array<departure>} Return departures array.
|
|
240
231
|
* @private
|
|
241
232
|
*/
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
var future = new Date();
|
|
233
|
+
filterDepartures(depObject, sortByMinArrivalTime = false) {
|
|
234
|
+
const departures = Object.keys(depObject).map((k) => depObject[k]);
|
|
235
|
+
departures.sort((a, b) => compareDepartures(a, b, sortByMinArrivalTime));
|
|
236
|
+
let future = new Date();
|
|
247
237
|
future.setMinutes(future.getMinutes() + this.maxDepartureAge);
|
|
248
238
|
future = future.getTime();
|
|
249
|
-
|
|
239
|
+
let past = new Date();
|
|
250
240
|
past.setMinutes(past.getMinutes() - this.maxDepartureAge);
|
|
251
241
|
past = past.getTime();
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
for (
|
|
256
|
-
|
|
257
|
-
|
|
242
|
+
const departureArray = [];
|
|
243
|
+
const platformsBoarding = [];
|
|
244
|
+
let previousDeparture = null;
|
|
245
|
+
for (let i = departures.length - 1; i >= 0; i -= 1) {
|
|
246
|
+
const d = departures[i];
|
|
247
|
+
const t = new Date(d.time).getTime();
|
|
258
248
|
// Only show departures within the next 30 minutes
|
|
259
249
|
if (t > past && t < future) {
|
|
260
250
|
// If 2 trains are boarding at the same platform,
|
|
@@ -284,7 +274,7 @@ var RealtimeAPI = /** @class */ (function () {
|
|
|
284
274
|
}
|
|
285
275
|
}
|
|
286
276
|
return departureArray;
|
|
287
|
-
}
|
|
277
|
+
}
|
|
288
278
|
/**
|
|
289
279
|
* Subscribe to departures channel of a given station.
|
|
290
280
|
*
|
|
@@ -292,56 +282,55 @@ var RealtimeAPI = /** @class */ (function () {
|
|
|
292
282
|
* @param {Boolean} sortByMinArrivalTime Sort by minimum arrival time
|
|
293
283
|
* @param {function(departures:Departure[])} onMessage Function called on each message of the channel.
|
|
294
284
|
*/
|
|
295
|
-
|
|
296
|
-
var _this = this;
|
|
285
|
+
subscribeDepartures(stationId, sortByMinArrivalTime, onMessage) {
|
|
297
286
|
window.clearTimeout(this.departureUpdateTimeout);
|
|
298
287
|
this.unsubscribeDepartures();
|
|
299
288
|
this.subscribedStationUic = stationId;
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
this.subscribe(channel,
|
|
289
|
+
const channel = stationId ? `timetable_${stationId}` : null;
|
|
290
|
+
const departureObject = {};
|
|
291
|
+
this.subscribe(channel, (data) => {
|
|
303
292
|
if (data.source === channel) {
|
|
304
|
-
|
|
305
|
-
|
|
293
|
+
const content = data.content || {};
|
|
294
|
+
const tDiff = new Date(content.timestamp).getTime() - Date.now();
|
|
306
295
|
content.timediff = tDiff;
|
|
307
296
|
departureObject[content.call_id] = content;
|
|
308
|
-
window.clearTimeout(
|
|
309
|
-
|
|
310
|
-
|
|
297
|
+
window.clearTimeout(this.departureUpdateTimeout);
|
|
298
|
+
this.departureUpdateTimeout = window.setTimeout(() => {
|
|
299
|
+
const departures = this.filterDepartures(departureObject, sortByMinArrivalTime || false);
|
|
311
300
|
onMessage(departures);
|
|
312
301
|
}, 100);
|
|
313
302
|
}
|
|
314
|
-
},
|
|
303
|
+
}, () => {
|
|
315
304
|
onMessage([]);
|
|
316
305
|
});
|
|
317
|
-
}
|
|
306
|
+
}
|
|
318
307
|
/**
|
|
319
308
|
* Unsubscribe from current departures channel.
|
|
320
309
|
* @param {function} cb Callback function to unsubscribe. If null all subscriptions for the channel will be unsubscribed.
|
|
321
310
|
*/
|
|
322
|
-
|
|
311
|
+
unsubscribeDepartures(cb) {
|
|
323
312
|
if (this.subscribedStationUic) {
|
|
324
|
-
this.unsubscribe(
|
|
313
|
+
this.unsubscribe(`timetable_${this.subscribedStationUic}`, '', cb);
|
|
325
314
|
this.subscribedStationUic = null;
|
|
326
315
|
}
|
|
327
|
-
}
|
|
316
|
+
}
|
|
328
317
|
/**
|
|
329
318
|
* Subscribe to the disruptions channel for tenant.
|
|
330
319
|
*
|
|
331
320
|
* @param {function} onMessage Function called on each message of the channel.
|
|
332
321
|
*/
|
|
333
|
-
|
|
334
|
-
this.subscribe(
|
|
322
|
+
subscribeDisruptions(onMessage) {
|
|
323
|
+
this.subscribe(`${this.prefix}newsticker`, (data) => {
|
|
335
324
|
onMessage(data.content);
|
|
336
325
|
});
|
|
337
|
-
}
|
|
326
|
+
}
|
|
338
327
|
/**
|
|
339
328
|
* Unsubscribe disruptions.
|
|
340
329
|
* @param {function} cb Callback function to unsubscribe. If null all subscriptions for the channel will be unsubscribed.
|
|
341
330
|
*/
|
|
342
|
-
|
|
343
|
-
this.unsubscribe(
|
|
344
|
-
}
|
|
331
|
+
unsubscribeDisruptions(cb) {
|
|
332
|
+
this.unsubscribe(`${this.prefix}newsticker`, '', cb);
|
|
333
|
+
}
|
|
345
334
|
/**
|
|
346
335
|
* Return a station with a given uic number and a mode.
|
|
347
336
|
*
|
|
@@ -349,14 +338,13 @@ var RealtimeAPI = /** @class */ (function () {
|
|
|
349
338
|
* @param {RealtimeMode} mode Realtime mode.
|
|
350
339
|
* @return {Promise<Station>} A station.
|
|
351
340
|
*/
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
channel: "station".concat((0, getRealtimeModeSuffix_1.default)(mode, exports.RealtimeModes)),
|
|
341
|
+
getStation(uic, mode) {
|
|
342
|
+
const params = {
|
|
343
|
+
channel: `station${getModeSuffix(mode, RealtimeModes)}`,
|
|
356
344
|
args: uic,
|
|
357
345
|
};
|
|
358
|
-
return new Promise(
|
|
359
|
-
|
|
346
|
+
return new Promise((resolve, reject) => {
|
|
347
|
+
this.wsApi.get(params, (data) => {
|
|
360
348
|
if (data.content) {
|
|
361
349
|
resolve(data.content);
|
|
362
350
|
}
|
|
@@ -365,27 +353,26 @@ var RealtimeAPI = /** @class */ (function () {
|
|
|
365
353
|
}
|
|
366
354
|
});
|
|
367
355
|
});
|
|
368
|
-
}
|
|
356
|
+
}
|
|
369
357
|
/**
|
|
370
358
|
* Update the model's station list for a given mode and a bbox.
|
|
371
359
|
*
|
|
372
360
|
* @param {RealtimeMode} mode Realtime mode.
|
|
373
361
|
* @return {Promise<Array<Station>>} An array of stations.
|
|
374
362
|
*/
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
channel: "station".concat((0, getRealtimeModeSuffix_1.default)(mode, exports.RealtimeModes)),
|
|
363
|
+
getStations(mode) {
|
|
364
|
+
const stations = [];
|
|
365
|
+
const params = {
|
|
366
|
+
channel: `station${getModeSuffix(mode, RealtimeModes)}`,
|
|
380
367
|
};
|
|
381
368
|
window.clearTimeout(this.stationUpdateTimeout);
|
|
382
|
-
return new Promise(
|
|
383
|
-
|
|
369
|
+
return new Promise((resolve, reject) => {
|
|
370
|
+
this.wsApi.get(params, (data) => {
|
|
384
371
|
if (data.content) {
|
|
385
372
|
stations.push(data.content);
|
|
386
|
-
window.clearTimeout(
|
|
373
|
+
window.clearTimeout(this.stationUpdateTimeout);
|
|
387
374
|
/** @ignore */
|
|
388
|
-
|
|
375
|
+
this.stationUpdateTimeout = window.setTimeout(() => {
|
|
389
376
|
resolve(stations);
|
|
390
377
|
}, 50);
|
|
391
378
|
}
|
|
@@ -394,7 +381,7 @@ var RealtimeAPI = /** @class */ (function () {
|
|
|
394
381
|
}
|
|
395
382
|
});
|
|
396
383
|
});
|
|
397
|
-
}
|
|
384
|
+
}
|
|
398
385
|
/**
|
|
399
386
|
* Subscribe to stations channel.
|
|
400
387
|
* One message pro station.
|
|
@@ -402,50 +389,49 @@ var RealtimeAPI = /** @class */ (function () {
|
|
|
402
389
|
* @param {RealtimeMode} mode Realtime mode.
|
|
403
390
|
* @param {function(station: Station)} onMessage Function called on each message of the channel.
|
|
404
391
|
*/
|
|
405
|
-
|
|
392
|
+
subscribeStations(mode, onMessage) {
|
|
406
393
|
this.unsubscribeStations();
|
|
407
|
-
this.subscribe(
|
|
394
|
+
this.subscribe(`station${getModeSuffix(mode, RealtimeModes)}`, (data) => {
|
|
408
395
|
if (data.content) {
|
|
409
396
|
onMessage(data.content);
|
|
410
397
|
}
|
|
411
398
|
});
|
|
412
|
-
}
|
|
399
|
+
}
|
|
413
400
|
/**
|
|
414
401
|
* Unsubscribe to stations channel.
|
|
415
402
|
* @param {function} cb The listener callback function to unsubscribe. If null all subscriptions for the channel will be unsubscribe.
|
|
416
403
|
*/
|
|
417
|
-
|
|
404
|
+
unsubscribeStations(cb) {
|
|
418
405
|
window.clearTimeout(this.stationUpdateTimeout);
|
|
419
406
|
this.unsubscribe('station', '', cb);
|
|
420
|
-
}
|
|
407
|
+
}
|
|
421
408
|
/**
|
|
422
409
|
* Subscribe to extra_geoms channel.
|
|
423
410
|
*
|
|
424
411
|
* @param {function(extraGeoms: GeosJSONFeature[])} onMessage Function called on each message of the channel.
|
|
425
412
|
*/
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
var extraGeom = data.content;
|
|
413
|
+
subscribeExtraGeoms(onMessage) {
|
|
414
|
+
this.subscribe('extra_geoms', (data) => {
|
|
415
|
+
const extraGeom = data.content;
|
|
430
416
|
if (extraGeom) {
|
|
431
|
-
|
|
417
|
+
const { ref } = extraGeom.properties;
|
|
432
418
|
if (extraGeom.type === 'Feature') {
|
|
433
|
-
|
|
419
|
+
this.extraGeoms[ref] = extraGeom;
|
|
434
420
|
}
|
|
435
421
|
else {
|
|
436
|
-
delete
|
|
422
|
+
delete this.extraGeoms[ref];
|
|
437
423
|
}
|
|
438
|
-
onMessage(Object.keys(
|
|
424
|
+
onMessage(Object.keys(this.extraGeoms).map((key) => this.extraGeoms[key]));
|
|
439
425
|
}
|
|
440
426
|
});
|
|
441
|
-
}
|
|
427
|
+
}
|
|
442
428
|
/**
|
|
443
429
|
* Unsubscribe to extra_geoms channel.
|
|
444
430
|
* @param {function} cb Callback function to unsubscribe. If null all subscriptions for the channel will be unsubscribed.
|
|
445
431
|
*/
|
|
446
|
-
|
|
432
|
+
unsubscribeExtraGeoms(cb) {
|
|
447
433
|
this.unsubscribe('extra_geoms', '', cb);
|
|
448
|
-
}
|
|
434
|
+
}
|
|
449
435
|
/**
|
|
450
436
|
* Subscribe to trajectory channel.
|
|
451
437
|
*
|
|
@@ -453,18 +439,17 @@ var RealtimeAPI = /** @class */ (function () {
|
|
|
453
439
|
* @param {function(trajectory: RealtimeTrajectory)} onMessage Function called on each message of the channel.
|
|
454
440
|
* @param {boolean} quiet If true, the subscription will not send GET and SUB requests to the websocket.
|
|
455
441
|
*/
|
|
456
|
-
|
|
457
|
-
if (quiet === void 0) { quiet = false; }
|
|
442
|
+
subscribeTrajectory(mode, onMessage, quiet = false) {
|
|
458
443
|
this.unsubscribeTrajectory(onMessage);
|
|
459
|
-
this.subscribe(
|
|
460
|
-
}
|
|
444
|
+
this.subscribe(`trajectory${getModeSuffix(mode, RealtimeModes)}`, onMessage, null, quiet);
|
|
445
|
+
}
|
|
461
446
|
/**
|
|
462
447
|
* Unsubscribe to trajectory channels.
|
|
463
448
|
* @param {function} cb Callback function to unsubscribe. If null all subscriptions for the channel will be unsubscribed.
|
|
464
449
|
*/
|
|
465
|
-
|
|
466
|
-
this.unsubscribe(
|
|
467
|
-
}
|
|
450
|
+
unsubscribeTrajectory(cb) {
|
|
451
|
+
this.unsubscribe(`trajectory`, '', cb);
|
|
452
|
+
}
|
|
468
453
|
/**
|
|
469
454
|
* Subscribe to deleted_vhicles channel.
|
|
470
455
|
*
|
|
@@ -472,18 +457,17 @@ var RealtimeAPI = /** @class */ (function () {
|
|
|
472
457
|
* @param {function(response: { content: Vehicle })} onMessage Function called on each message of the channel.
|
|
473
458
|
* @param {boolean} quiet If true, the subscription will not send GET and SUB requests to the websocket.
|
|
474
459
|
*/
|
|
475
|
-
|
|
476
|
-
if (quiet === void 0) { quiet = false; }
|
|
460
|
+
subscribeDeletedVehicles(mode, onMessage, quiet = false) {
|
|
477
461
|
this.unsubscribeDeletedVehicles(onMessage);
|
|
478
|
-
this.subscribe(
|
|
479
|
-
}
|
|
462
|
+
this.subscribe(`deleted_vehicles${getModeSuffix(mode, RealtimeModes)}`, onMessage, null, quiet);
|
|
463
|
+
}
|
|
480
464
|
/**
|
|
481
465
|
* Unsubscribe to deleted_vhicles channels.
|
|
482
466
|
* @param {function} cb Callback function to unsubscribe. If null all subscriptions for the channel will be unsubscribed.
|
|
483
467
|
*/
|
|
484
|
-
|
|
468
|
+
unsubscribeDeletedVehicles(cb) {
|
|
485
469
|
this.unsubscribe('deleted_vehicles', '', cb);
|
|
486
|
-
}
|
|
470
|
+
}
|
|
487
471
|
/**
|
|
488
472
|
* Get a full trajectory of a vehicule .
|
|
489
473
|
*
|
|
@@ -492,26 +476,25 @@ var RealtimeAPI = /** @class */ (function () {
|
|
|
492
476
|
* @param {string} generalizationLevel The generalization level to request. Can be one of 5 (more generalized), 10, 30, 100, undefined (less generalized).
|
|
493
477
|
* @return {Promise<FullTrajectory>} Return a full trajectory.
|
|
494
478
|
*/
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
var channel = ["full_trajectory".concat((0, getRealtimeModeSuffix_1.default)(mode, exports.RealtimeModes))];
|
|
479
|
+
getFullTrajectory(id, mode, generalizationLevel) {
|
|
480
|
+
const channel = [`full_trajectory${getModeSuffix(mode, RealtimeModes)}`];
|
|
498
481
|
if (id) {
|
|
499
482
|
channel.push(id);
|
|
500
483
|
}
|
|
501
|
-
if ((!mode || mode ===
|
|
502
|
-
channel.push(
|
|
484
|
+
if ((!mode || mode === RealtimeModes.TOPOGRAPHIC) && generalizationLevel) {
|
|
485
|
+
channel.push(`gen${generalizationLevel}`);
|
|
503
486
|
}
|
|
504
|
-
|
|
487
|
+
const params = {
|
|
505
488
|
channel: channel.join('_'),
|
|
506
489
|
};
|
|
507
|
-
return new Promise(
|
|
508
|
-
|
|
490
|
+
return new Promise((resolve) => {
|
|
491
|
+
this.wsApi.get(params, (data) => {
|
|
509
492
|
if (data.content) {
|
|
510
493
|
resolve(data.content);
|
|
511
494
|
}
|
|
512
495
|
});
|
|
513
496
|
});
|
|
514
|
-
}
|
|
497
|
+
}
|
|
515
498
|
/**
|
|
516
499
|
* Get full trajectories of a vehicules .
|
|
517
500
|
*
|
|
@@ -520,121 +503,111 @@ var RealtimeAPI = /** @class */ (function () {
|
|
|
520
503
|
* @param {string} generalizationLevel The generalization level to request. Can be one of '', 'gen5', 'gen10', 'gen30', 'gen100'.
|
|
521
504
|
* @return {Promise<Array<FullTrajectory>>} Return an array of full trajectories.
|
|
522
505
|
*/
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
var promises = ids.map(function (id) {
|
|
526
|
-
return _this.getFullTrajectory(id, mode, generalizationLevel);
|
|
527
|
-
});
|
|
506
|
+
getFullTrajectories(ids, mode, generalizationLevel) {
|
|
507
|
+
const promises = ids.map((id) => this.getFullTrajectory(id, mode, generalizationLevel));
|
|
528
508
|
return Promise.all(promises);
|
|
529
|
-
}
|
|
509
|
+
}
|
|
530
510
|
/**
|
|
531
511
|
* Subscribe to full_trajectory channel of a given vehicle.
|
|
532
512
|
*
|
|
533
513
|
* @param {string} id A vehicle id.
|
|
534
514
|
* @param {RealtimeMode} mode Realtime mode.
|
|
535
515
|
*/
|
|
536
|
-
|
|
516
|
+
subscribeFullTrajectory(id, mode) {
|
|
537
517
|
// window.clearTimeout(this.fullTrajectoryUpdateTimeout);
|
|
538
518
|
this.unsubscribeFullTrajectory(id);
|
|
539
|
-
this.subscribe(
|
|
519
|
+
this.subscribe(`full_trajectory${getModeSuffix(mode, RealtimeModes)}_${id}`, (data) => {
|
|
540
520
|
// eslint-disable-next-line no-console
|
|
541
521
|
console.log('subscribe full_trajectory', data);
|
|
542
|
-
},
|
|
522
|
+
}, (err) => {
|
|
543
523
|
// eslint-disable-next-line no-console
|
|
544
524
|
console.log('subscribe full_trajectory error', err);
|
|
545
525
|
});
|
|
546
|
-
}
|
|
526
|
+
}
|
|
547
527
|
/**
|
|
548
528
|
* Unsubscribe from full_trajectory channel
|
|
549
529
|
*
|
|
550
530
|
* @param {string} id A vehicle id.
|
|
551
531
|
* @param {function} cb Callback function to unsubscribe. If null all subscriptions for the channel will be unsubscribed.
|
|
552
532
|
*/
|
|
553
|
-
|
|
554
|
-
this.unsubscribe('full_trajectory',
|
|
555
|
-
}
|
|
533
|
+
unsubscribeFullTrajectory(id, cb) {
|
|
534
|
+
this.unsubscribe('full_trajectory', `_${id}`, cb);
|
|
535
|
+
}
|
|
556
536
|
/**
|
|
557
537
|
* Get the list of stops for this vehicle.
|
|
558
538
|
*
|
|
559
539
|
* @param {string} id A vehicle id.
|
|
560
540
|
* @return {Promise<StopSequence>} Returns a stop sequence object.
|
|
561
541
|
*/
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
channel: "stopsequence_".concat(id),
|
|
542
|
+
getStopSequence(id) {
|
|
543
|
+
const params = {
|
|
544
|
+
channel: `stopsequence_${id}`,
|
|
566
545
|
};
|
|
567
|
-
return new Promise(
|
|
568
|
-
|
|
546
|
+
return new Promise((resolve, reject) => {
|
|
547
|
+
this.wsApi.get(params, (data) => {
|
|
569
548
|
if (data.content && data.content.length) {
|
|
570
|
-
|
|
571
|
-
return (0, cleanStopTime_1.default)(stopSequence);
|
|
572
|
-
});
|
|
549
|
+
const content = data.content.map((stopSequence) => cleanStopTime(stopSequence));
|
|
573
550
|
// Remove the delay from arrivalTime and departureTime
|
|
574
551
|
resolve(content);
|
|
575
552
|
}
|
|
576
553
|
resolve([]);
|
|
577
|
-
},
|
|
554
|
+
}, (err) => {
|
|
578
555
|
reject(err);
|
|
579
556
|
});
|
|
580
557
|
});
|
|
581
|
-
}
|
|
558
|
+
}
|
|
582
559
|
/**
|
|
583
560
|
* Get a list of stops for a list of vehicles.
|
|
584
561
|
*
|
|
585
562
|
* @param {string[]} ids List of vehicles ids.
|
|
586
563
|
* @return {Promise<Array<StopSequence>>} Return an array of stop sequences.
|
|
587
564
|
*/
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
var promises = ids.map(function (id) { return _this.getStopSequence(id); });
|
|
565
|
+
getStopSequences(ids) {
|
|
566
|
+
const promises = ids.map((id) => this.getStopSequence(id));
|
|
591
567
|
return Promise.all(promises);
|
|
592
|
-
}
|
|
568
|
+
}
|
|
593
569
|
/**
|
|
594
570
|
* Subscribe to stopsequence channel of a given vehicle.
|
|
595
571
|
*
|
|
596
572
|
* @param {string} id A vehicle id.
|
|
597
573
|
* @param {function(stopSequence: StopSequence)} onMessage Function called on each message of the channel.
|
|
598
574
|
*/
|
|
599
|
-
|
|
575
|
+
subscribeStopSequence(id, onMessage) {
|
|
600
576
|
window.clearTimeout(this.fullTrajectoryUpdateTimeout);
|
|
601
577
|
this.unsubscribeStopSequence(id);
|
|
602
|
-
this.subscribe(
|
|
578
|
+
this.subscribe(`stopsequence_${id}`, (data) => {
|
|
603
579
|
if (data.content && data.content.length) {
|
|
604
|
-
|
|
605
|
-
return (0, cleanStopTime_1.default)(stopSequence);
|
|
606
|
-
});
|
|
580
|
+
const content = data.content.map((stopSequence) => cleanStopTime(stopSequence));
|
|
607
581
|
// Remove the delay from arrivalTime and departureTime
|
|
608
582
|
onMessage(content);
|
|
609
583
|
}
|
|
610
|
-
},
|
|
584
|
+
}, (err) => {
|
|
611
585
|
// eslint-disable-next-line no-console
|
|
612
586
|
console.log('subscribe stopsequence error', err);
|
|
613
587
|
});
|
|
614
|
-
}
|
|
588
|
+
}
|
|
615
589
|
/**
|
|
616
590
|
* Unsubscribe from stopsequence channel
|
|
617
591
|
*
|
|
618
592
|
* @param {string} id A vehicle id.
|
|
619
593
|
* @param {function} cb Callback function to unsubscribe. If null all subscriptions for the channel will be unsubscribed.
|
|
620
594
|
*/
|
|
621
|
-
|
|
622
|
-
this.unsubscribe(
|
|
623
|
-
}
|
|
595
|
+
unsubscribeStopSequence(id, cb) {
|
|
596
|
+
this.unsubscribe(`stopsequence`, `_${id}`, cb);
|
|
597
|
+
}
|
|
624
598
|
/**
|
|
625
599
|
* Subscribe to healthcheck channel.
|
|
626
600
|
* @param {function} onMessage Callback when the subscribe to healthcheck channel succeeds.
|
|
627
601
|
*/
|
|
628
|
-
|
|
602
|
+
subscribeHealthCheck(onMessage) {
|
|
629
603
|
this.unsubscribeHealthCheck();
|
|
630
604
|
this.subscribe('healthcheck', onMessage);
|
|
631
|
-
}
|
|
605
|
+
}
|
|
632
606
|
/**
|
|
633
607
|
* Unsubscribe to healthcheck channel.
|
|
634
608
|
*/
|
|
635
|
-
|
|
609
|
+
unsubscribeHealthCheck() {
|
|
636
610
|
this.unsubscribe('healthcheck');
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
exports.default = RealtimeAPI;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
export default RealtimeAPI;
|