mobility-toolbox-js 3.1.2 → 3.2.0-beta.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/api/HttpAPI.js +0 -1
- package/api/RealtimeAPI.d.ts +3 -3
- package/api/RealtimeAPI.js +3 -3
- package/api/WebSocketAPI.d.ts +21 -21
- package/api/WebSocketAPI.js +47 -23
- package/mbt.js +13612 -13604
- package/mbt.js.map +4 -4
- package/mbt.min.js +38 -38
- package/mbt.min.js.map +4 -4
- package/ol/layers/MaplibreLayer.d.ts +1 -1
- package/ol/layers/MaplibreLayer.js +4 -3
- package/ol/renderers/MaplibreLayerRenderer.js +1 -0
- package/package.json +4 -12
- package/types/index.d.ts +4 -4
- package/types/realtime.d.ts +224 -224
|
@@ -87,7 +87,7 @@ declare class MaplibreLayer extends MapLibreLayer {
|
|
|
87
87
|
createRenderer(): MaplibreLayerRenderer;
|
|
88
88
|
detachFromMap(): void;
|
|
89
89
|
disposeInternal(): void;
|
|
90
|
-
getStyle():
|
|
90
|
+
getStyle(): string | import("maplibre-gl").StyleSpecification;
|
|
91
91
|
setMapInternal(map: Map): void;
|
|
92
92
|
updateMaplibreMap(): void;
|
|
93
93
|
}
|
|
@@ -160,7 +160,7 @@ class MaplibreLayer extends MapLibreLayer {
|
|
|
160
160
|
this.setSource(source);
|
|
161
161
|
}
|
|
162
162
|
getStyle() {
|
|
163
|
-
var _a
|
|
163
|
+
var _a;
|
|
164
164
|
// If the style is a complete style object, use it directly.
|
|
165
165
|
if (this.style &&
|
|
166
166
|
typeof this.style === 'object' &&
|
|
@@ -173,8 +173,9 @@ class MaplibreLayer extends MapLibreLayer {
|
|
|
173
173
|
return this.url;
|
|
174
174
|
}
|
|
175
175
|
// If the user has defined the style by the maplibreOptions, we use it directly.
|
|
176
|
-
|
|
177
|
-
|
|
176
|
+
const opts = this.get('options');
|
|
177
|
+
if ((_a = opts === null || opts === void 0 ? void 0 : opts.mapLibreOptions) === null || _a === void 0 ? void 0 : _a.style) {
|
|
178
|
+
return opts.mapLibreOptions.style;
|
|
178
179
|
}
|
|
179
180
|
/// Otherwise build the complete style url.
|
|
180
181
|
return buildStyleUrl(this.url, this.style, this.apiKey, this.apiKeyName);
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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": "3.
|
|
5
|
+
"version": "3.2.0-beta.0",
|
|
6
6
|
"homepage": "https://mobility-toolbox-js.geops.io/",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@babel/preset-typescript": "^7.26.0",
|
|
29
29
|
"@commitlint/cli": "19.6.1",
|
|
30
30
|
"@commitlint/config-conventional": "19.6.0",
|
|
31
|
-
"@geops/eslint-config-react": "
|
|
31
|
+
"@geops/eslint-config-react": "1.5.0-beta.0",
|
|
32
32
|
"@types/geojson": "7946.0.16",
|
|
33
33
|
"@types/lodash": "^4.17.15",
|
|
34
34
|
"@types/lodash.debounce": "4.0.9",
|
|
@@ -47,14 +47,6 @@
|
|
|
47
47
|
"esdoc-standard-plugin": "1.0.0",
|
|
48
48
|
"esdoc-typescript-plugin": "1.0.1",
|
|
49
49
|
"eslint": "9.19.0",
|
|
50
|
-
"eslint-config-airbnb": "19.0.4",
|
|
51
|
-
"eslint-config-airbnb-typescript": "18.0.0",
|
|
52
|
-
"eslint-config-prettier": "10.0.1",
|
|
53
|
-
"eslint-plugin-cypress": "4.1.0",
|
|
54
|
-
"eslint-plugin-import": "2.31.0",
|
|
55
|
-
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
56
|
-
"eslint-plugin-prettier": "5.2.3",
|
|
57
|
-
"eslint-plugin-react": "7.37.4",
|
|
58
50
|
"fixpack": "4.0.0",
|
|
59
51
|
"husky": "9.1.7",
|
|
60
52
|
"is-ci": "4.1.0",
|
|
@@ -70,7 +62,7 @@
|
|
|
70
62
|
"mock-socket": "9.3.1",
|
|
71
63
|
"next": "15.1.6",
|
|
72
64
|
"next-transpile-modules": "10.0.1",
|
|
73
|
-
"ol": "10.
|
|
65
|
+
"ol": "10.4.0",
|
|
74
66
|
"openapi-typescript": "6.7.5",
|
|
75
67
|
"prettier": "3.4.2",
|
|
76
68
|
"raw-loader": "4.0.2",
|
|
@@ -80,7 +72,7 @@
|
|
|
80
72
|
"stylelint": "16.14.1",
|
|
81
73
|
"stylelint-config-recommended-scss": "14.1.0",
|
|
82
74
|
"stylelint-config-standard": "37.0.0",
|
|
83
|
-
"stylelint-scss": "6.
|
|
75
|
+
"stylelint-scss": "6.11.0",
|
|
84
76
|
"ts-jest": "^29.2.5",
|
|
85
77
|
"typescript": "5.7.3",
|
|
86
78
|
"vite": "^6.0.11"
|
package/types/index.d.ts
CHANGED
|
@@ -2,13 +2,13 @@ import { Paths as Routing } from './routing';
|
|
|
2
2
|
import { Paths as Stops } from './stops';
|
|
3
3
|
|
|
4
4
|
export * from './common';
|
|
5
|
-
export * from './realtime';
|
|
6
5
|
export * from './ol';
|
|
6
|
+
export * from './realtime';
|
|
7
7
|
|
|
8
|
+
export type RealtimeVersion = '1' | '2';
|
|
8
9
|
export type RoutingParameters = Routing['/']['get']['parameters']['query'];
|
|
9
|
-
export type RoutingResponse = Routing['/']['get']['responses']['200']['schema'];
|
|
10
10
|
|
|
11
|
+
export type RoutingResponse = Routing['/']['get']['responses']['200']['schema'];
|
|
11
12
|
export type StopsParameters = Stops['/']['get']['parameters']['query'];
|
|
12
|
-
export type StopsResponse = Stops['/']['get']['responses']['200']['schema'];
|
|
13
13
|
|
|
14
|
-
export type
|
|
14
|
+
export type StopsResponse = Stops['/']['get']['responses']['200']['schema'];
|
package/types/realtime.d.ts
CHANGED
|
@@ -1,64 +1,23 @@
|
|
|
1
1
|
import { Feature, FeatureCollection, Point } from 'geojson';
|
|
2
2
|
|
|
3
|
-
export declare type RealtimeMode = 'raw' | 'schematic' | 'topographic';
|
|
4
|
-
|
|
5
3
|
export declare type RealtimeChannelModeSuffix = '_schematic' | '';
|
|
6
4
|
|
|
7
|
-
export type
|
|
8
|
-
|
|
9
|
-
export type RealtimeStationId = number;
|
|
10
|
-
|
|
11
|
-
export type RealtimeService =
|
|
12
|
-
| 'redis_websocket_api'
|
|
13
|
-
| 'tralis_fzo'
|
|
14
|
-
| 'tralis_geofox'
|
|
15
|
-
| 'tralis_newsticker'
|
|
16
|
-
| 'tralis_stations'
|
|
17
|
-
| 'tralis_vdv'
|
|
18
|
-
| 'tralis_worker'
|
|
19
|
-
| string;
|
|
20
|
-
|
|
21
|
-
export type RealtimeTenant = '' | 'sbb' | 'sbh' | 'sbm' | string;
|
|
22
|
-
|
|
23
|
-
export type RealtimeElevatorState = 'ALL_OPERABLE' | string;
|
|
24
|
-
|
|
25
|
-
export type RealtimeStopState = 'BOARDING' | 'LEAVING' | string;
|
|
26
|
-
|
|
27
|
-
export type RealtimeTrajectoryState =
|
|
28
|
-
| 'BOARDING'
|
|
29
|
-
| 'HIDDEN'
|
|
30
|
-
| 'JOURNEY_CANCELLED'
|
|
31
|
-
| 'STOP_CANCELLED';
|
|
32
|
-
|
|
33
|
-
export type RealtimeGeneralizationLevel = 10 | 100 | 30 | 5;
|
|
34
|
-
|
|
35
|
-
export type RealtimeMot =
|
|
36
|
-
| 'bus'
|
|
37
|
-
| 'cablecar'
|
|
38
|
-
| 'coach'
|
|
39
|
-
| 'ferry'
|
|
40
|
-
| 'funicular'
|
|
41
|
-
| 'gondola'
|
|
42
|
-
| 'rail'
|
|
43
|
-
| 'subway'
|
|
44
|
-
| 'tram';
|
|
5
|
+
export declare type RealtimeMode = 'raw' | 'schematic' | 'topographic';
|
|
45
6
|
|
|
46
7
|
/**
|
|
47
8
|
* @type RealtimeBbox
|
|
48
9
|
*/
|
|
49
10
|
export type RealtimeBbox = (number | string)[];
|
|
50
|
-
// minX: number,
|
|
51
|
-
// minY: number,
|
|
52
|
-
// maxX: number,
|
|
53
|
-
// maxY: number,
|
|
54
|
-
// zoom: number,
|
|
55
|
-
// string?,
|
|
56
|
-
// `gen_level=${RealtimeGeneralizationLevel}`| undefined,
|
|
57
|
-
// `tenant=${UnionConcat<RealtimeTenant, ','>}`!,
|
|
58
|
-
// `mots=${UnionConcat<RealtimeMot, ','>}`!,
|
|
59
11
|
|
|
60
12
|
export type RealtimeBuffer = [number, number];
|
|
61
13
|
|
|
14
|
+
export interface RealtimeBufferResponse {
|
|
15
|
+
client_reference: '';
|
|
16
|
+
content: RealtimeTrajectoryResponse[];
|
|
17
|
+
source: 'buffer';
|
|
18
|
+
timestamp: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
62
21
|
export type RealtimeChannelName =
|
|
63
22
|
| 'buffer'
|
|
64
23
|
| 'extra_geoms'
|
|
@@ -71,54 +30,79 @@ export type RealtimeChannelName =
|
|
|
71
30
|
| `timetable_${RealtimeStationId}`
|
|
72
31
|
| `trajectory${RealtimeChannelModeSuffix}`;
|
|
73
32
|
|
|
74
|
-
export interface
|
|
75
|
-
|
|
76
|
-
|
|
33
|
+
export interface RealtimeDeletedVehiclesResponse {
|
|
34
|
+
client_reference: null;
|
|
35
|
+
content: string;
|
|
36
|
+
source: `deleted_vehicles${RealtimeChannelModeSuffix}`;
|
|
37
|
+
timestamp: number;
|
|
38
|
+
}
|
|
77
39
|
|
|
78
|
-
|
|
79
|
-
|
|
40
|
+
export interface RealtimeDeparture {
|
|
41
|
+
at_station_ds100: string;
|
|
42
|
+
call_id: number;
|
|
43
|
+
created_at: string;
|
|
44
|
+
formation: any;
|
|
45
|
+
fzo_estimated_time: number;
|
|
46
|
+
has_fzo: boolean;
|
|
47
|
+
line: RealtimeLine;
|
|
48
|
+
min_arrival_time: number;
|
|
49
|
+
new_to: boolean;
|
|
50
|
+
next_stoppoints: string[];
|
|
51
|
+
no_stop_between: boolean;
|
|
52
|
+
no_stop_till: any;
|
|
53
|
+
platform: string;
|
|
54
|
+
ris_aimed_time: number;
|
|
55
|
+
ris_estimated_time: number;
|
|
56
|
+
state: string; /// (BOARDING|STOP_CANCELLED|JOURNEY_CANCELLED|HIDDEN)/
|
|
57
|
+
time: number;
|
|
58
|
+
timediff: number; // This property seems to alawy been 0
|
|
59
|
+
timestamp: number; // This property seems to never exists
|
|
60
|
+
to: string[];
|
|
61
|
+
train_id: RealtimeTrainId;
|
|
62
|
+
train_number: number;
|
|
63
|
+
train_type: number;
|
|
64
|
+
updated_at: number;
|
|
65
|
+
}
|
|
80
66
|
|
|
81
|
-
|
|
67
|
+
export interface RealtimeDepartureExtended extends RealtimeDeparture {
|
|
68
|
+
cancelled?: boolean; // value generated by RealtimeAPI class
|
|
69
|
+
}
|
|
82
70
|
|
|
83
|
-
|
|
84
|
-
event?: string;
|
|
85
|
-
event_delay?: number;
|
|
86
|
-
event_timestamp: number;
|
|
87
|
-
event_timestamp?: number;
|
|
88
|
-
gen_level?: RealtimeGeneralizationLevel;
|
|
89
|
-
gen_range: [number, number];
|
|
90
|
-
has_journey: boolean;
|
|
91
|
-
has_realtime: boolean;
|
|
92
|
-
has_realtime_journey: boolean;
|
|
93
|
-
line?: RealtimeLine;
|
|
94
|
-
name?: string; // deprecated, name is an old property, use line.name instead.
|
|
95
|
-
operator?: string; // deprecated, operator is an old property, use tenant instead.
|
|
96
|
-
operator_provides_realtime_journey: 'no' | 'unknown' | 'yes';
|
|
97
|
-
original_line?: RealtimeLine;
|
|
98
|
-
original_rake?: string;
|
|
99
|
-
original_train_number?: number;
|
|
100
|
-
position_correction?: number;
|
|
101
|
-
rake?: string;
|
|
102
|
-
raw_coordinates?: [number, number];
|
|
71
|
+
export type RealtimeElevatorState = 'ALL_OPERABLE' | string;
|
|
103
72
|
|
|
104
|
-
|
|
105
|
-
|
|
73
|
+
export interface RealtimeExtraGeom extends Feature {
|
|
74
|
+
properties: RealtimeExtraGeomProperties;
|
|
75
|
+
}
|
|
106
76
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
77
|
+
export interface RealtimeExtraGeomDeleted {
|
|
78
|
+
properties: RealtimeExtraGeomProperties;
|
|
79
|
+
type: 'Deleted';
|
|
80
|
+
}
|
|
81
|
+
// minX: number,
|
|
82
|
+
// minY: number,
|
|
83
|
+
// maxX: number,
|
|
84
|
+
// maxY: number,
|
|
85
|
+
// zoom: number,
|
|
86
|
+
// string?,
|
|
87
|
+
// `gen_level=${RealtimeGeneralizationLevel}`| undefined,
|
|
88
|
+
// `tenant=${UnionConcat<RealtimeTenant, ','>}`!,
|
|
89
|
+
// `mots=${UnionConcat<RealtimeMot, ','>}`!,
|
|
90
|
+
|
|
91
|
+
export interface RealtimeExtraGeomProperties {
|
|
92
|
+
ref: number | string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export type RealtimeExtraGeoms = Record<string, Feature[]>;
|
|
96
|
+
|
|
97
|
+
export interface RealtimeExtraGeomsResponse {
|
|
98
|
+
client_reference: null;
|
|
99
|
+
content: RealtimeExtraGeom | RealtimeExtraGeomDeleted;
|
|
100
|
+
source: `extra_geoms`;
|
|
113
101
|
timestamp: number;
|
|
114
|
-
train_id?: RealtimeTrainId;
|
|
115
|
-
train_number?: number;
|
|
116
|
-
transmitting_vehicle?: string;
|
|
117
|
-
type: RealtimeMots;
|
|
118
102
|
}
|
|
119
103
|
|
|
120
|
-
export interface
|
|
121
|
-
properties:
|
|
104
|
+
export interface RealtimeFullTrajectory extends FeatureCollection {
|
|
105
|
+
properties: RealtimeFullTrajectoryProperties;
|
|
122
106
|
}
|
|
123
107
|
|
|
124
108
|
export interface RealtimeFullTrajectoryProperties {
|
|
@@ -135,8 +119,96 @@ export interface RealtimeFullTrajectoryProperties {
|
|
|
135
119
|
train_id: RealtimeTrainId;
|
|
136
120
|
}
|
|
137
121
|
|
|
138
|
-
export
|
|
139
|
-
|
|
122
|
+
export type RealtimeGeneralizationLevel = 10 | 100 | 30 | 5;
|
|
123
|
+
|
|
124
|
+
export interface RealtimeHealth {
|
|
125
|
+
heathly: boolean;
|
|
126
|
+
service: RealtimeService;
|
|
127
|
+
tenant: null | string;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface RealtimeHealthCheckResponse {
|
|
131
|
+
client_reference: null;
|
|
132
|
+
content: RealtimeHealth;
|
|
133
|
+
source: 'healthcheck';
|
|
134
|
+
timestamp: number;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export interface RealtimeLine {
|
|
138
|
+
color: string;
|
|
139
|
+
id: number;
|
|
140
|
+
name: string;
|
|
141
|
+
stroke: string;
|
|
142
|
+
text_color: string;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export type RealtimeMot =
|
|
146
|
+
| 'bus'
|
|
147
|
+
| 'cablecar'
|
|
148
|
+
| 'coach'
|
|
149
|
+
| 'ferry'
|
|
150
|
+
| 'funicular'
|
|
151
|
+
| 'gondola'
|
|
152
|
+
| 'rail'
|
|
153
|
+
| 'subway'
|
|
154
|
+
| 'tram';
|
|
155
|
+
|
|
156
|
+
export interface RealtimeNews {
|
|
157
|
+
incident_program: boolean;
|
|
158
|
+
messages: RealtimeNewsMessage[];
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export interface RealtimeNewsMessage {
|
|
162
|
+
content: string;
|
|
163
|
+
lines: RealtimeLine[];
|
|
164
|
+
title: string;
|
|
165
|
+
updated: string; // TODO: ISO string
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export interface RealtimeNewsTickerResponse {
|
|
169
|
+
client_reference: null;
|
|
170
|
+
content: RealtimeNews;
|
|
171
|
+
source: `${RealtimeTenant}_newsticker`;
|
|
172
|
+
timestamp: number;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export type RealtimeService =
|
|
176
|
+
| 'redis_websocket_api'
|
|
177
|
+
| 'tralis_fzo'
|
|
178
|
+
| 'tralis_geofox'
|
|
179
|
+
| 'tralis_newsticker'
|
|
180
|
+
| 'tralis_stations'
|
|
181
|
+
| 'tralis_vdv'
|
|
182
|
+
| 'tralis_worker'
|
|
183
|
+
| string;
|
|
184
|
+
|
|
185
|
+
export interface RealtimeStation extends Feature {
|
|
186
|
+
geometry: Point;
|
|
187
|
+
properties: RealtimeStationproperties;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export type RealtimeStationId = number;
|
|
191
|
+
|
|
192
|
+
export interface RealtimeStationproperties extends Feature {
|
|
193
|
+
elevatorOutOfOrder: boolean;
|
|
194
|
+
elevators: object;
|
|
195
|
+
elevatorState: RealtimeElevatorState;
|
|
196
|
+
hasAccessibility: boolean;
|
|
197
|
+
hasAirport: boolean;
|
|
198
|
+
hasElevator: boolean;
|
|
199
|
+
hasZOB: boolean;
|
|
200
|
+
name: string;
|
|
201
|
+
networkLines: RealtimeLine[];
|
|
202
|
+
tenant: RealtimeTenant;
|
|
203
|
+
transfers: RealtimeTransfer[];
|
|
204
|
+
uic: RealtimeStationId;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export interface RealtimeStationResponse {
|
|
208
|
+
client_reference: null;
|
|
209
|
+
content: RealtimeNews;
|
|
210
|
+
source: `station_${RealtimeStationId}`;
|
|
211
|
+
timestamp: number;
|
|
140
212
|
}
|
|
141
213
|
|
|
142
214
|
export interface RealtimeStop {
|
|
@@ -178,129 +250,74 @@ export interface RealtimeStopSequence {
|
|
|
178
250
|
vehicleType: number;
|
|
179
251
|
}
|
|
180
252
|
|
|
181
|
-
export interface
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
properties: RealtimeExtraGeomProperties;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
export interface RealtimeExtraGeomDeleted {
|
|
190
|
-
properties: RealtimeExtraGeomProperties;
|
|
191
|
-
type: 'Deleted';
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export type RealtimeExtraGeoms = Record<string, Feature[]>;
|
|
195
|
-
|
|
196
|
-
export interface RealtimeLine {
|
|
197
|
-
color: string;
|
|
198
|
-
id: number;
|
|
199
|
-
name: string;
|
|
200
|
-
stroke: string;
|
|
201
|
-
text_color: string;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
export interface RealtimeTransfer {
|
|
205
|
-
lines: string[];
|
|
206
|
-
mot: RealtimeMot;
|
|
253
|
+
export interface RealtimeStopSequenceResponse {
|
|
254
|
+
client_reference: '';
|
|
255
|
+
content: RealtimeStopSequence[];
|
|
256
|
+
source: `stopsequence_${RealtimeTenant}_${RealtimeTrainId}`;
|
|
257
|
+
timestamp: number;
|
|
207
258
|
}
|
|
208
259
|
|
|
209
|
-
export
|
|
210
|
-
elevatorOutOfOrder: boolean;
|
|
211
|
-
elevators: object;
|
|
212
|
-
elevatorState: RealtimeElevatorState;
|
|
213
|
-
hasAccessibility: boolean;
|
|
214
|
-
hasAirport: boolean;
|
|
215
|
-
hasElevator: boolean;
|
|
216
|
-
hasZOB: boolean;
|
|
217
|
-
name: string;
|
|
218
|
-
networkLines: RealtimeLine[];
|
|
219
|
-
tenant: RealtimeTenant;
|
|
220
|
-
transfers: RealtimeTransfer[];
|
|
221
|
-
uic: RealtimeStationId;
|
|
222
|
-
}
|
|
260
|
+
export type RealtimeStopState = 'BOARDING' | 'LEAVING' | string;
|
|
223
261
|
|
|
224
|
-
export
|
|
225
|
-
geometry: Point;
|
|
226
|
-
properties: RealtimeStationproperties;
|
|
227
|
-
}
|
|
262
|
+
export type RealtimeTenant = '' | 'sbb' | 'sbh' | 'sbm' | string;
|
|
228
263
|
|
|
229
|
-
export interface
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
fzo_estimated_time: number;
|
|
235
|
-
has_fzo: boolean;
|
|
236
|
-
line: RealtimeLine;
|
|
237
|
-
min_arrival_time: number;
|
|
238
|
-
new_to: boolean;
|
|
239
|
-
next_stoppoints: string[];
|
|
240
|
-
no_stop_between: boolean;
|
|
241
|
-
no_stop_till: any;
|
|
242
|
-
platform: string;
|
|
243
|
-
ris_aimed_time: number;
|
|
244
|
-
ris_estimated_time: number;
|
|
245
|
-
state: string; /// (BOARDING|STOP_CANCELLED|JOURNEY_CANCELLED|HIDDEN)/
|
|
246
|
-
time: number;
|
|
247
|
-
timediff: number; // This property seems to alawy been 0
|
|
248
|
-
timestamp: number; // This property seems to never exists
|
|
249
|
-
to: string[];
|
|
250
|
-
train_id: RealtimeTrainId;
|
|
251
|
-
train_number: number;
|
|
252
|
-
train_type: number;
|
|
253
|
-
updated_at: number;
|
|
264
|
+
export interface RealtimeTimetableResponse {
|
|
265
|
+
client_reference: null;
|
|
266
|
+
content: RealtimeDeparture;
|
|
267
|
+
source: `timetable_${RealtimeStationId}`;
|
|
268
|
+
timestamp: number;
|
|
254
269
|
}
|
|
255
270
|
|
|
256
|
-
export
|
|
257
|
-
cancelled?: boolean; // value generated by RealtimeAPI class
|
|
258
|
-
}
|
|
271
|
+
export type RealtimeTrainId = string;
|
|
259
272
|
|
|
260
|
-
export interface
|
|
261
|
-
|
|
262
|
-
lines: RealtimeLine[];
|
|
263
|
-
title: string;
|
|
264
|
-
updated: string; // TODO: ISO string
|
|
273
|
+
export interface RealtimeTrajectory extends Feature {
|
|
274
|
+
properties: RealtimeTrajectoryProperties;
|
|
265
275
|
}
|
|
266
276
|
|
|
267
|
-
export interface
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
}
|
|
277
|
+
export interface RealtimeTrajectoryProperties {
|
|
278
|
+
// Tralis and trafimage
|
|
279
|
+
bounds: [number, number, number, number];
|
|
271
280
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
service: RealtimeService;
|
|
275
|
-
tenant: null | string;
|
|
276
|
-
}
|
|
281
|
+
// Only after first rendering on a map
|
|
282
|
+
coordinate?: [number, number];
|
|
277
283
|
|
|
278
|
-
|
|
279
|
-
client_reference: null;
|
|
280
|
-
content: RealtimeExtraGeom | RealtimeExtraGeomDeleted;
|
|
281
|
-
source: `extra_geoms`;
|
|
282
|
-
timestamp: number;
|
|
283
|
-
}
|
|
284
|
+
delay: null | number;
|
|
284
285
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
286
|
+
// Tralis
|
|
287
|
+
event?: string;
|
|
288
|
+
event_delay?: number;
|
|
289
|
+
event_timestamp: number;
|
|
290
|
+
event_timestamp?: number;
|
|
291
|
+
gen_level?: RealtimeGeneralizationLevel;
|
|
292
|
+
gen_range: [number, number];
|
|
293
|
+
has_journey: boolean;
|
|
294
|
+
has_realtime: boolean;
|
|
295
|
+
has_realtime_journey: boolean;
|
|
296
|
+
line?: RealtimeLine;
|
|
297
|
+
name?: string; // deprecated, name is an old property, use line.name instead.
|
|
298
|
+
operator?: string; // deprecated, operator is an old property, use tenant instead.
|
|
299
|
+
operator_provides_realtime_journey: 'no' | 'unknown' | 'yes';
|
|
300
|
+
original_line?: RealtimeLine;
|
|
301
|
+
original_rake?: string;
|
|
302
|
+
original_train_number?: number;
|
|
303
|
+
position_correction?: number;
|
|
304
|
+
rake?: string;
|
|
305
|
+
raw_coordinates?: [number, number];
|
|
291
306
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
content: RealtimeNews;
|
|
295
|
-
source: `${RealtimeTenant}_newsticker`;
|
|
296
|
-
timestamp: number;
|
|
297
|
-
}
|
|
307
|
+
raw_time?: string;
|
|
308
|
+
ride_state?: string;
|
|
298
309
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
310
|
+
route_identifier: string;
|
|
311
|
+
routeIdentifier?: string;
|
|
312
|
+
state: RealtimeTrajectoryState;
|
|
313
|
+
tenant: string;
|
|
314
|
+
time_intervals?: number[][];
|
|
315
|
+
time_since_update?: string;
|
|
303
316
|
timestamp: number;
|
|
317
|
+
train_id?: RealtimeTrainId;
|
|
318
|
+
train_number?: number;
|
|
319
|
+
transmitting_vehicle?: string;
|
|
320
|
+
type: RealtimeMots;
|
|
304
321
|
}
|
|
305
322
|
|
|
306
323
|
export interface RealtimeTrajectoryResponse {
|
|
@@ -310,30 +327,13 @@ export interface RealtimeTrajectoryResponse {
|
|
|
310
327
|
timestamp: number;
|
|
311
328
|
}
|
|
312
329
|
|
|
313
|
-
export
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
export interface RealtimeBufferResponse {
|
|
321
|
-
client_reference: '';
|
|
322
|
-
content: RealtimeTrajectoryResponse[];
|
|
323
|
-
source: 'buffer';
|
|
324
|
-
timestamp: number;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
export interface RealtimeDeletedVehiclesResponse {
|
|
328
|
-
client_reference: null;
|
|
329
|
-
content: string;
|
|
330
|
-
source: `deleted_vehicles${RealtimeChannelModeSuffix}`;
|
|
331
|
-
timestamp: number;
|
|
332
|
-
}
|
|
330
|
+
export type RealtimeTrajectoryState =
|
|
331
|
+
| 'BOARDING'
|
|
332
|
+
| 'HIDDEN'
|
|
333
|
+
| 'JOURNEY_CANCELLED'
|
|
334
|
+
| 'STOP_CANCELLED';
|
|
333
335
|
|
|
334
|
-
export interface
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
source: 'healthcheck';
|
|
338
|
-
timestamp: number;
|
|
336
|
+
export interface RealtimeTransfer {
|
|
337
|
+
lines: string[];
|
|
338
|
+
mot: RealtimeMot;
|
|
339
339
|
}
|