@tmlmobilidade/types 20260519.16.41 → 20260519.1741.30
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/dist/operation/hashed-lines/hashed-line.d.ts +56 -0
- package/dist/operation/hashed-lines/hashed-line.js +19 -0
- package/dist/operation/hashed-lines/index.d.ts +1 -0
- package/dist/operation/hashed-lines/index.js +1 -0
- package/dist/operation/index.d.ts +1 -0
- package/dist/operation/index.js +1 -0
- package/dist/operation/lines/operational-line.d.ts +3 -17
- package/dist/operation/lines/operational-line.js +2 -2
- package/dist/operation/stops/operational-stop.d.ts +3 -17
- package/dist/operation/stops/operational-stop.js +2 -2
- package/dist/vehicle-events/raw/cp/index.d.ts +1 -0
- package/dist/vehicle-events/raw/cp/index.js +1 -0
- package/dist/vehicle-events/raw/cp/v1.d.ts +330 -0
- package/dist/vehicle-events/raw/cp/v1.js +34 -0
- package/dist/vehicle-events/raw/index.d.ts +1 -0
- package/dist/vehicle-events/raw/index.js +1 -0
- package/dist/vehicle-events/raw/raw-vehicle-event.d.ts +200 -0
- package/dist/vehicle-events/raw/raw-vehicle-event.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const HashedLineSchema: z.ZodObject<Omit<{
|
|
3
|
+
_id: z.ZodString;
|
|
4
|
+
created_at: z.ZodEffects<z.ZodNumber, import("../../index.js").UnixTimestamp, number>;
|
|
5
|
+
created_by: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
6
|
+
is_locked: z.ZodDefault<z.ZodBoolean>;
|
|
7
|
+
updated_at: z.ZodEffects<z.ZodNumber, import("../../index.js").UnixTimestamp, number>;
|
|
8
|
+
updated_by: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}, "created_by" | "is_locked" | "updated_by"> & {
|
|
10
|
+
agency_id: z.ZodString;
|
|
11
|
+
line_id: z.ZodNumber;
|
|
12
|
+
line_long_name: z.ZodString;
|
|
13
|
+
line_short_name: z.ZodString;
|
|
14
|
+
pattern_id: z.ZodString;
|
|
15
|
+
route_color: z.ZodString;
|
|
16
|
+
route_id: z.ZodString;
|
|
17
|
+
route_long_name: z.ZodString;
|
|
18
|
+
route_short_name: z.ZodString;
|
|
19
|
+
route_text_color: z.ZodString;
|
|
20
|
+
trip_headsign: z.ZodString;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
_id: string;
|
|
23
|
+
created_at: number & {
|
|
24
|
+
__brand: "UnixTimestamp";
|
|
25
|
+
};
|
|
26
|
+
updated_at: number & {
|
|
27
|
+
__brand: "UnixTimestamp";
|
|
28
|
+
};
|
|
29
|
+
agency_id: string;
|
|
30
|
+
line_id: number;
|
|
31
|
+
pattern_id: string;
|
|
32
|
+
route_id: string;
|
|
33
|
+
route_color: string;
|
|
34
|
+
route_long_name: string;
|
|
35
|
+
route_short_name: string;
|
|
36
|
+
route_text_color: string;
|
|
37
|
+
trip_headsign: string;
|
|
38
|
+
line_long_name: string;
|
|
39
|
+
line_short_name: string;
|
|
40
|
+
}, {
|
|
41
|
+
_id: string;
|
|
42
|
+
created_at: number;
|
|
43
|
+
updated_at: number;
|
|
44
|
+
agency_id: string;
|
|
45
|
+
line_id: number;
|
|
46
|
+
pattern_id: string;
|
|
47
|
+
route_id: string;
|
|
48
|
+
route_color: string;
|
|
49
|
+
route_long_name: string;
|
|
50
|
+
route_short_name: string;
|
|
51
|
+
route_text_color: string;
|
|
52
|
+
trip_headsign: string;
|
|
53
|
+
line_long_name: string;
|
|
54
|
+
line_short_name: string;
|
|
55
|
+
}>;
|
|
56
|
+
export type HashedLine = z.infer<typeof HashedLineSchema>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { DocumentSchema } from '../../_common/document.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
/* * */
|
|
5
|
+
export const HashedLineSchema = DocumentSchema
|
|
6
|
+
.omit({ created_by: true, is_locked: true, updated_by: true })
|
|
7
|
+
.extend({
|
|
8
|
+
agency_id: z.string(),
|
|
9
|
+
line_id: z.number(),
|
|
10
|
+
line_long_name: z.string(),
|
|
11
|
+
line_short_name: z.string(),
|
|
12
|
+
pattern_id: z.string(),
|
|
13
|
+
route_color: z.string(),
|
|
14
|
+
route_id: z.string(),
|
|
15
|
+
route_long_name: z.string(),
|
|
16
|
+
route_short_name: z.string(),
|
|
17
|
+
route_text_color: z.string(),
|
|
18
|
+
trip_headsign: z.string(),
|
|
19
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './hashed-line.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './hashed-line.js';
|
package/dist/operation/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const OperationalLineSchema: z.ZodObject<{
|
|
3
3
|
agency_id: z.ZodString;
|
|
4
|
-
|
|
4
|
+
hashed_patterns: z.ZodDefault<z.ZodArray<z.ZodObject<Omit<{
|
|
5
5
|
_id: z.ZodString;
|
|
6
6
|
created_at: z.ZodEffects<z.ZodNumber, import("../../index.js").UnixTimestamp, number>;
|
|
7
7
|
created_by: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
@@ -14,8 +14,6 @@ export declare const OperationalLineSchema: z.ZodObject<{
|
|
|
14
14
|
line_long_name: z.ZodString;
|
|
15
15
|
line_short_name: z.ZodString;
|
|
16
16
|
path: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
17
|
-
arrival_time: z.ZodString;
|
|
18
|
-
departure_time: z.ZodString;
|
|
19
17
|
drop_off_type: z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
|
|
20
18
|
pickup_type: z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
|
|
21
19
|
shape_dist_traveled: z.ZodNumber;
|
|
@@ -27,8 +25,6 @@ export declare const OperationalLineSchema: z.ZodObject<{
|
|
|
27
25
|
timepoint: z.ZodNumber;
|
|
28
26
|
}, "strip", z.ZodTypeAny, {
|
|
29
27
|
stop_id: string;
|
|
30
|
-
arrival_time: string;
|
|
31
|
-
departure_time: string;
|
|
32
28
|
drop_off_type: 0 | 1 | 2 | 3;
|
|
33
29
|
pickup_type: 0 | 1 | 2 | 3;
|
|
34
30
|
shape_dist_traveled: number;
|
|
@@ -39,8 +35,6 @@ export declare const OperationalLineSchema: z.ZodObject<{
|
|
|
39
35
|
stop_name: string;
|
|
40
36
|
}, {
|
|
41
37
|
stop_id: string;
|
|
42
|
-
arrival_time: string;
|
|
43
|
-
departure_time: string;
|
|
44
38
|
drop_off_type: 0 | 1 | 2 | 3;
|
|
45
39
|
pickup_type: 0 | 1 | 2 | 3;
|
|
46
40
|
shape_dist_traveled: number;
|
|
@@ -67,8 +61,6 @@ export declare const OperationalLineSchema: z.ZodObject<{
|
|
|
67
61
|
};
|
|
68
62
|
path: {
|
|
69
63
|
stop_id: string;
|
|
70
|
-
arrival_time: string;
|
|
71
|
-
departure_time: string;
|
|
72
64
|
drop_off_type: 0 | 1 | 2 | 3;
|
|
73
65
|
pickup_type: 0 | 1 | 2 | 3;
|
|
74
66
|
shape_dist_traveled: number;
|
|
@@ -106,8 +98,6 @@ export declare const OperationalLineSchema: z.ZodObject<{
|
|
|
106
98
|
line_short_name: string;
|
|
107
99
|
path?: {
|
|
108
100
|
stop_id: string;
|
|
109
|
-
arrival_time: string;
|
|
110
|
-
departure_time: string;
|
|
111
101
|
drop_off_type: 0 | 1 | 2 | 3;
|
|
112
102
|
pickup_type: 0 | 1 | 2 | 3;
|
|
113
103
|
shape_dist_traveled: number;
|
|
@@ -134,7 +124,7 @@ export declare const OperationalLineSchema: z.ZodObject<{
|
|
|
134
124
|
route_color: string;
|
|
135
125
|
line_long_name: string;
|
|
136
126
|
line_short_name: string;
|
|
137
|
-
|
|
127
|
+
hashed_patterns: {
|
|
138
128
|
_id: string;
|
|
139
129
|
created_at: number & {
|
|
140
130
|
__brand: "UnixTimestamp";
|
|
@@ -144,8 +134,6 @@ export declare const OperationalLineSchema: z.ZodObject<{
|
|
|
144
134
|
};
|
|
145
135
|
path: {
|
|
146
136
|
stop_id: string;
|
|
147
|
-
arrival_time: string;
|
|
148
|
-
departure_time: string;
|
|
149
137
|
drop_off_type: 0 | 1 | 2 | 3;
|
|
150
138
|
pickup_type: 0 | 1 | 2 | 3;
|
|
151
139
|
shape_dist_traveled: number;
|
|
@@ -182,7 +170,7 @@ export declare const OperationalLineSchema: z.ZodObject<{
|
|
|
182
170
|
last_operational_date: string;
|
|
183
171
|
last_plan_id: string;
|
|
184
172
|
stop_ids?: string[] | undefined;
|
|
185
|
-
|
|
173
|
+
hashed_patterns?: {
|
|
186
174
|
_id: string;
|
|
187
175
|
created_at: number;
|
|
188
176
|
updated_at: number;
|
|
@@ -199,8 +187,6 @@ export declare const OperationalLineSchema: z.ZodObject<{
|
|
|
199
187
|
line_short_name: string;
|
|
200
188
|
path?: {
|
|
201
189
|
stop_id: string;
|
|
202
|
-
arrival_time: string;
|
|
203
|
-
departure_time: string;
|
|
204
190
|
drop_off_type: 0 | 1 | 2 | 3;
|
|
205
191
|
pickup_type: 0 | 1 | 2 | 3;
|
|
206
192
|
shape_dist_traveled: number;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* * */
|
|
2
2
|
import { OperationalDateSchema } from '../../_common/operational-date.js';
|
|
3
|
-
import {
|
|
3
|
+
import { HashedPatternSchema } from '../hashed-patterns/hashed-pattern.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
/* * */
|
|
6
6
|
export const OperationalLineSchema = z.object({
|
|
7
7
|
agency_id: z.string(),
|
|
8
|
-
|
|
8
|
+
hashed_patterns: z.array(HashedPatternSchema).default([]),
|
|
9
9
|
last_operational_date: OperationalDateSchema,
|
|
10
10
|
last_plan_id: z.string(),
|
|
11
11
|
line_id: z.number(),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const OperationalStopSchema: z.ZodObject<{
|
|
3
3
|
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
4
|
-
|
|
4
|
+
hashed_patterns: z.ZodDefault<z.ZodArray<z.ZodObject<Omit<{
|
|
5
5
|
_id: z.ZodString;
|
|
6
6
|
created_at: z.ZodEffects<z.ZodNumber, import("../../index.js").UnixTimestamp, number>;
|
|
7
7
|
created_by: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
@@ -14,8 +14,6 @@ export declare const OperationalStopSchema: z.ZodObject<{
|
|
|
14
14
|
line_long_name: z.ZodString;
|
|
15
15
|
line_short_name: z.ZodString;
|
|
16
16
|
path: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
17
|
-
arrival_time: z.ZodString;
|
|
18
|
-
departure_time: z.ZodString;
|
|
19
17
|
drop_off_type: z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
|
|
20
18
|
pickup_type: z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
|
|
21
19
|
shape_dist_traveled: z.ZodNumber;
|
|
@@ -27,8 +25,6 @@ export declare const OperationalStopSchema: z.ZodObject<{
|
|
|
27
25
|
timepoint: z.ZodNumber;
|
|
28
26
|
}, "strip", z.ZodTypeAny, {
|
|
29
27
|
stop_id: string;
|
|
30
|
-
arrival_time: string;
|
|
31
|
-
departure_time: string;
|
|
32
28
|
drop_off_type: 0 | 1 | 2 | 3;
|
|
33
29
|
pickup_type: 0 | 1 | 2 | 3;
|
|
34
30
|
shape_dist_traveled: number;
|
|
@@ -39,8 +35,6 @@ export declare const OperationalStopSchema: z.ZodObject<{
|
|
|
39
35
|
stop_name: string;
|
|
40
36
|
}, {
|
|
41
37
|
stop_id: string;
|
|
42
|
-
arrival_time: string;
|
|
43
|
-
departure_time: string;
|
|
44
38
|
drop_off_type: 0 | 1 | 2 | 3;
|
|
45
39
|
pickup_type: 0 | 1 | 2 | 3;
|
|
46
40
|
shape_dist_traveled: number;
|
|
@@ -67,8 +61,6 @@ export declare const OperationalStopSchema: z.ZodObject<{
|
|
|
67
61
|
};
|
|
68
62
|
path: {
|
|
69
63
|
stop_id: string;
|
|
70
|
-
arrival_time: string;
|
|
71
|
-
departure_time: string;
|
|
72
64
|
drop_off_type: 0 | 1 | 2 | 3;
|
|
73
65
|
pickup_type: 0 | 1 | 2 | 3;
|
|
74
66
|
shape_dist_traveled: number;
|
|
@@ -106,8 +98,6 @@ export declare const OperationalStopSchema: z.ZodObject<{
|
|
|
106
98
|
line_short_name: string;
|
|
107
99
|
path?: {
|
|
108
100
|
stop_id: string;
|
|
109
|
-
arrival_time: string;
|
|
110
|
-
departure_time: string;
|
|
111
101
|
drop_off_type: 0 | 1 | 2 | 3;
|
|
112
102
|
pickup_type: 0 | 1 | 2 | 3;
|
|
113
103
|
shape_dist_traveled: number;
|
|
@@ -130,7 +120,7 @@ export declare const OperationalStopSchema: z.ZodObject<{
|
|
|
130
120
|
agency_ids: string[];
|
|
131
121
|
line_ids: number[];
|
|
132
122
|
stop_name: string;
|
|
133
|
-
|
|
123
|
+
hashed_patterns: {
|
|
134
124
|
_id: string;
|
|
135
125
|
created_at: number & {
|
|
136
126
|
__brand: "UnixTimestamp";
|
|
@@ -140,8 +130,6 @@ export declare const OperationalStopSchema: z.ZodObject<{
|
|
|
140
130
|
};
|
|
141
131
|
path: {
|
|
142
132
|
stop_id: string;
|
|
143
|
-
arrival_time: string;
|
|
144
|
-
departure_time: string;
|
|
145
133
|
drop_off_type: 0 | 1 | 2 | 3;
|
|
146
134
|
pickup_type: 0 | 1 | 2 | 3;
|
|
147
135
|
shape_dist_traveled: number;
|
|
@@ -176,7 +164,7 @@ export declare const OperationalStopSchema: z.ZodObject<{
|
|
|
176
164
|
last_plan_id: string;
|
|
177
165
|
agency_ids?: string[] | undefined;
|
|
178
166
|
line_ids?: number[] | undefined;
|
|
179
|
-
|
|
167
|
+
hashed_patterns?: {
|
|
180
168
|
_id: string;
|
|
181
169
|
created_at: number;
|
|
182
170
|
updated_at: number;
|
|
@@ -193,8 +181,6 @@ export declare const OperationalStopSchema: z.ZodObject<{
|
|
|
193
181
|
line_short_name: string;
|
|
194
182
|
path?: {
|
|
195
183
|
stop_id: string;
|
|
196
|
-
arrival_time: string;
|
|
197
|
-
departure_time: string;
|
|
198
184
|
drop_off_type: 0 | 1 | 2 | 3;
|
|
199
185
|
pickup_type: 0 | 1 | 2 | 3;
|
|
200
186
|
shape_dist_traveled: number;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* * */
|
|
2
2
|
import { OperationalDateSchema } from '../../_common/operational-date.js';
|
|
3
|
-
import {
|
|
3
|
+
import { HashedPatternSchema } from '../hashed-patterns/hashed-pattern.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
/* * */
|
|
6
6
|
export const OperationalStopSchema = z.object({
|
|
7
7
|
agency_ids: z.array(z.string()).default([]),
|
|
8
|
-
|
|
8
|
+
hashed_patterns: z.array(HashedPatternSchema).default([]),
|
|
9
9
|
last_operational_date: OperationalDateSchema,
|
|
10
10
|
last_plan_id: z.string(),
|
|
11
11
|
line_ids: z.array(z.number()).default([]),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './v1.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './v1.js';
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const RawVehicleEventCpV1PayloadSchema: z.ZodObject<{
|
|
3
|
+
header: z.ZodObject<{
|
|
4
|
+
feed_version: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
5
|
+
gtfs_realtime_version: z.ZodString;
|
|
6
|
+
incrementality: z.ZodLiteral<"FULL_DATASET">;
|
|
7
|
+
timestamp: z.ZodNumber;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
timestamp: number;
|
|
10
|
+
gtfs_realtime_version: string;
|
|
11
|
+
incrementality: "FULL_DATASET";
|
|
12
|
+
feed_version?: string | null | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
timestamp: number;
|
|
15
|
+
gtfs_realtime_version: string;
|
|
16
|
+
incrementality: "FULL_DATASET";
|
|
17
|
+
feed_version?: string | null | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
vehicle: z.ZodObject<{
|
|
20
|
+
current_status: z.ZodOptional<z.ZodNullable<z.ZodEnum<["INCOMING_AT", "STOPPED_AT", "IN_TRANSIT_TO"]>>>;
|
|
21
|
+
occupancy_status: z.ZodOptional<z.ZodNullable<z.ZodEnum<["EMPTY", "MANY_SEATS_AVAILABLE", "FEW_SEATS_AVAILABLE", "STANDING_ROOM_ONLY", "CRUSHED_STANDING_ROOM_ONLY", "FULL", "NOT_ACCEPTING_PASSENGERS", "NO_DATA_AVAILABLE", "NOT_BOARDABLE"]>>>;
|
|
22
|
+
position: z.ZodObject<{
|
|
23
|
+
latitude: z.ZodNumber;
|
|
24
|
+
longitude: z.ZodNumber;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
latitude: number;
|
|
27
|
+
longitude: number;
|
|
28
|
+
}, {
|
|
29
|
+
latitude: number;
|
|
30
|
+
longitude: number;
|
|
31
|
+
}>;
|
|
32
|
+
timestamp: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
33
|
+
trip: z.ZodObject<{
|
|
34
|
+
schedule_relationship: z.ZodOptional<z.ZodNullable<z.ZodEnum<["SCHEDULED", "NOT_SCHEDULED"]>>>;
|
|
35
|
+
trip_id: z.ZodString;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
trip_id: string;
|
|
38
|
+
schedule_relationship?: "SCHEDULED" | "NOT_SCHEDULED" | null | undefined;
|
|
39
|
+
}, {
|
|
40
|
+
trip_id: string;
|
|
41
|
+
schedule_relationship?: "SCHEDULED" | "NOT_SCHEDULED" | null | undefined;
|
|
42
|
+
}>;
|
|
43
|
+
vehicle: z.ZodObject<{
|
|
44
|
+
id: z.ZodString;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
id: string;
|
|
47
|
+
}, {
|
|
48
|
+
id: string;
|
|
49
|
+
}>;
|
|
50
|
+
}, "strip", z.ZodTypeAny, {
|
|
51
|
+
trip: {
|
|
52
|
+
trip_id: string;
|
|
53
|
+
schedule_relationship?: "SCHEDULED" | "NOT_SCHEDULED" | null | undefined;
|
|
54
|
+
};
|
|
55
|
+
position: {
|
|
56
|
+
latitude: number;
|
|
57
|
+
longitude: number;
|
|
58
|
+
};
|
|
59
|
+
vehicle: {
|
|
60
|
+
id: string;
|
|
61
|
+
};
|
|
62
|
+
occupancy_status?: "EMPTY" | "MANY_SEATS_AVAILABLE" | "FEW_SEATS_AVAILABLE" | "STANDING_ROOM_ONLY" | "CRUSHED_STANDING_ROOM_ONLY" | "FULL" | "NOT_ACCEPTING_PASSENGERS" | "NO_DATA_AVAILABLE" | "NOT_BOARDABLE" | null | undefined;
|
|
63
|
+
current_status?: "INCOMING_AT" | "STOPPED_AT" | "IN_TRANSIT_TO" | null | undefined;
|
|
64
|
+
timestamp?: number | null | undefined;
|
|
65
|
+
}, {
|
|
66
|
+
trip: {
|
|
67
|
+
trip_id: string;
|
|
68
|
+
schedule_relationship?: "SCHEDULED" | "NOT_SCHEDULED" | null | undefined;
|
|
69
|
+
};
|
|
70
|
+
position: {
|
|
71
|
+
latitude: number;
|
|
72
|
+
longitude: number;
|
|
73
|
+
};
|
|
74
|
+
vehicle: {
|
|
75
|
+
id: string;
|
|
76
|
+
};
|
|
77
|
+
occupancy_status?: "EMPTY" | "MANY_SEATS_AVAILABLE" | "FEW_SEATS_AVAILABLE" | "STANDING_ROOM_ONLY" | "CRUSHED_STANDING_ROOM_ONLY" | "FULL" | "NOT_ACCEPTING_PASSENGERS" | "NO_DATA_AVAILABLE" | "NOT_BOARDABLE" | null | undefined;
|
|
78
|
+
current_status?: "INCOMING_AT" | "STOPPED_AT" | "IN_TRANSIT_TO" | null | undefined;
|
|
79
|
+
timestamp?: number | null | undefined;
|
|
80
|
+
}>;
|
|
81
|
+
}, "strip", z.ZodTypeAny, {
|
|
82
|
+
vehicle: {
|
|
83
|
+
trip: {
|
|
84
|
+
trip_id: string;
|
|
85
|
+
schedule_relationship?: "SCHEDULED" | "NOT_SCHEDULED" | null | undefined;
|
|
86
|
+
};
|
|
87
|
+
position: {
|
|
88
|
+
latitude: number;
|
|
89
|
+
longitude: number;
|
|
90
|
+
};
|
|
91
|
+
vehicle: {
|
|
92
|
+
id: string;
|
|
93
|
+
};
|
|
94
|
+
occupancy_status?: "EMPTY" | "MANY_SEATS_AVAILABLE" | "FEW_SEATS_AVAILABLE" | "STANDING_ROOM_ONLY" | "CRUSHED_STANDING_ROOM_ONLY" | "FULL" | "NOT_ACCEPTING_PASSENGERS" | "NO_DATA_AVAILABLE" | "NOT_BOARDABLE" | null | undefined;
|
|
95
|
+
current_status?: "INCOMING_AT" | "STOPPED_AT" | "IN_TRANSIT_TO" | null | undefined;
|
|
96
|
+
timestamp?: number | null | undefined;
|
|
97
|
+
};
|
|
98
|
+
header: {
|
|
99
|
+
timestamp: number;
|
|
100
|
+
gtfs_realtime_version: string;
|
|
101
|
+
incrementality: "FULL_DATASET";
|
|
102
|
+
feed_version?: string | null | undefined;
|
|
103
|
+
};
|
|
104
|
+
}, {
|
|
105
|
+
vehicle: {
|
|
106
|
+
trip: {
|
|
107
|
+
trip_id: string;
|
|
108
|
+
schedule_relationship?: "SCHEDULED" | "NOT_SCHEDULED" | null | undefined;
|
|
109
|
+
};
|
|
110
|
+
position: {
|
|
111
|
+
latitude: number;
|
|
112
|
+
longitude: number;
|
|
113
|
+
};
|
|
114
|
+
vehicle: {
|
|
115
|
+
id: string;
|
|
116
|
+
};
|
|
117
|
+
occupancy_status?: "EMPTY" | "MANY_SEATS_AVAILABLE" | "FEW_SEATS_AVAILABLE" | "STANDING_ROOM_ONLY" | "CRUSHED_STANDING_ROOM_ONLY" | "FULL" | "NOT_ACCEPTING_PASSENGERS" | "NO_DATA_AVAILABLE" | "NOT_BOARDABLE" | null | undefined;
|
|
118
|
+
current_status?: "INCOMING_AT" | "STOPPED_AT" | "IN_TRANSIT_TO" | null | undefined;
|
|
119
|
+
timestamp?: number | null | undefined;
|
|
120
|
+
};
|
|
121
|
+
header: {
|
|
122
|
+
timestamp: number;
|
|
123
|
+
gtfs_realtime_version: string;
|
|
124
|
+
incrementality: "FULL_DATASET";
|
|
125
|
+
feed_version?: string | null | undefined;
|
|
126
|
+
};
|
|
127
|
+
}>;
|
|
128
|
+
export type RawVehicleEventCpV1Payload = z.infer<typeof RawVehicleEventCpV1PayloadSchema>;
|
|
129
|
+
export declare const RawVehicleEventCpV1Schema: z.ZodObject<{
|
|
130
|
+
_id: z.ZodString;
|
|
131
|
+
agency_id: z.ZodString;
|
|
132
|
+
created_at: z.ZodEffects<z.ZodNumber, import("../../../index.js").UnixTimestamp, number>;
|
|
133
|
+
entity_id: z.ZodString;
|
|
134
|
+
received_at: z.ZodEffects<z.ZodNumber, import("../../../index.js").UnixTimestamp, number>;
|
|
135
|
+
} & {
|
|
136
|
+
payload: z.ZodObject<{
|
|
137
|
+
header: z.ZodObject<{
|
|
138
|
+
feed_version: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
139
|
+
gtfs_realtime_version: z.ZodString;
|
|
140
|
+
incrementality: z.ZodLiteral<"FULL_DATASET">;
|
|
141
|
+
timestamp: z.ZodNumber;
|
|
142
|
+
}, "strip", z.ZodTypeAny, {
|
|
143
|
+
timestamp: number;
|
|
144
|
+
gtfs_realtime_version: string;
|
|
145
|
+
incrementality: "FULL_DATASET";
|
|
146
|
+
feed_version?: string | null | undefined;
|
|
147
|
+
}, {
|
|
148
|
+
timestamp: number;
|
|
149
|
+
gtfs_realtime_version: string;
|
|
150
|
+
incrementality: "FULL_DATASET";
|
|
151
|
+
feed_version?: string | null | undefined;
|
|
152
|
+
}>;
|
|
153
|
+
vehicle: z.ZodObject<{
|
|
154
|
+
current_status: z.ZodOptional<z.ZodNullable<z.ZodEnum<["INCOMING_AT", "STOPPED_AT", "IN_TRANSIT_TO"]>>>;
|
|
155
|
+
occupancy_status: z.ZodOptional<z.ZodNullable<z.ZodEnum<["EMPTY", "MANY_SEATS_AVAILABLE", "FEW_SEATS_AVAILABLE", "STANDING_ROOM_ONLY", "CRUSHED_STANDING_ROOM_ONLY", "FULL", "NOT_ACCEPTING_PASSENGERS", "NO_DATA_AVAILABLE", "NOT_BOARDABLE"]>>>;
|
|
156
|
+
position: z.ZodObject<{
|
|
157
|
+
latitude: z.ZodNumber;
|
|
158
|
+
longitude: z.ZodNumber;
|
|
159
|
+
}, "strip", z.ZodTypeAny, {
|
|
160
|
+
latitude: number;
|
|
161
|
+
longitude: number;
|
|
162
|
+
}, {
|
|
163
|
+
latitude: number;
|
|
164
|
+
longitude: number;
|
|
165
|
+
}>;
|
|
166
|
+
timestamp: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
167
|
+
trip: z.ZodObject<{
|
|
168
|
+
schedule_relationship: z.ZodOptional<z.ZodNullable<z.ZodEnum<["SCHEDULED", "NOT_SCHEDULED"]>>>;
|
|
169
|
+
trip_id: z.ZodString;
|
|
170
|
+
}, "strip", z.ZodTypeAny, {
|
|
171
|
+
trip_id: string;
|
|
172
|
+
schedule_relationship?: "SCHEDULED" | "NOT_SCHEDULED" | null | undefined;
|
|
173
|
+
}, {
|
|
174
|
+
trip_id: string;
|
|
175
|
+
schedule_relationship?: "SCHEDULED" | "NOT_SCHEDULED" | null | undefined;
|
|
176
|
+
}>;
|
|
177
|
+
vehicle: z.ZodObject<{
|
|
178
|
+
id: z.ZodString;
|
|
179
|
+
}, "strip", z.ZodTypeAny, {
|
|
180
|
+
id: string;
|
|
181
|
+
}, {
|
|
182
|
+
id: string;
|
|
183
|
+
}>;
|
|
184
|
+
}, "strip", z.ZodTypeAny, {
|
|
185
|
+
trip: {
|
|
186
|
+
trip_id: string;
|
|
187
|
+
schedule_relationship?: "SCHEDULED" | "NOT_SCHEDULED" | null | undefined;
|
|
188
|
+
};
|
|
189
|
+
position: {
|
|
190
|
+
latitude: number;
|
|
191
|
+
longitude: number;
|
|
192
|
+
};
|
|
193
|
+
vehicle: {
|
|
194
|
+
id: string;
|
|
195
|
+
};
|
|
196
|
+
occupancy_status?: "EMPTY" | "MANY_SEATS_AVAILABLE" | "FEW_SEATS_AVAILABLE" | "STANDING_ROOM_ONLY" | "CRUSHED_STANDING_ROOM_ONLY" | "FULL" | "NOT_ACCEPTING_PASSENGERS" | "NO_DATA_AVAILABLE" | "NOT_BOARDABLE" | null | undefined;
|
|
197
|
+
current_status?: "INCOMING_AT" | "STOPPED_AT" | "IN_TRANSIT_TO" | null | undefined;
|
|
198
|
+
timestamp?: number | null | undefined;
|
|
199
|
+
}, {
|
|
200
|
+
trip: {
|
|
201
|
+
trip_id: string;
|
|
202
|
+
schedule_relationship?: "SCHEDULED" | "NOT_SCHEDULED" | null | undefined;
|
|
203
|
+
};
|
|
204
|
+
position: {
|
|
205
|
+
latitude: number;
|
|
206
|
+
longitude: number;
|
|
207
|
+
};
|
|
208
|
+
vehicle: {
|
|
209
|
+
id: string;
|
|
210
|
+
};
|
|
211
|
+
occupancy_status?: "EMPTY" | "MANY_SEATS_AVAILABLE" | "FEW_SEATS_AVAILABLE" | "STANDING_ROOM_ONLY" | "CRUSHED_STANDING_ROOM_ONLY" | "FULL" | "NOT_ACCEPTING_PASSENGERS" | "NO_DATA_AVAILABLE" | "NOT_BOARDABLE" | null | undefined;
|
|
212
|
+
current_status?: "INCOMING_AT" | "STOPPED_AT" | "IN_TRANSIT_TO" | null | undefined;
|
|
213
|
+
timestamp?: number | null | undefined;
|
|
214
|
+
}>;
|
|
215
|
+
}, "strip", z.ZodTypeAny, {
|
|
216
|
+
vehicle: {
|
|
217
|
+
trip: {
|
|
218
|
+
trip_id: string;
|
|
219
|
+
schedule_relationship?: "SCHEDULED" | "NOT_SCHEDULED" | null | undefined;
|
|
220
|
+
};
|
|
221
|
+
position: {
|
|
222
|
+
latitude: number;
|
|
223
|
+
longitude: number;
|
|
224
|
+
};
|
|
225
|
+
vehicle: {
|
|
226
|
+
id: string;
|
|
227
|
+
};
|
|
228
|
+
occupancy_status?: "EMPTY" | "MANY_SEATS_AVAILABLE" | "FEW_SEATS_AVAILABLE" | "STANDING_ROOM_ONLY" | "CRUSHED_STANDING_ROOM_ONLY" | "FULL" | "NOT_ACCEPTING_PASSENGERS" | "NO_DATA_AVAILABLE" | "NOT_BOARDABLE" | null | undefined;
|
|
229
|
+
current_status?: "INCOMING_AT" | "STOPPED_AT" | "IN_TRANSIT_TO" | null | undefined;
|
|
230
|
+
timestamp?: number | null | undefined;
|
|
231
|
+
};
|
|
232
|
+
header: {
|
|
233
|
+
timestamp: number;
|
|
234
|
+
gtfs_realtime_version: string;
|
|
235
|
+
incrementality: "FULL_DATASET";
|
|
236
|
+
feed_version?: string | null | undefined;
|
|
237
|
+
};
|
|
238
|
+
}, {
|
|
239
|
+
vehicle: {
|
|
240
|
+
trip: {
|
|
241
|
+
trip_id: string;
|
|
242
|
+
schedule_relationship?: "SCHEDULED" | "NOT_SCHEDULED" | null | undefined;
|
|
243
|
+
};
|
|
244
|
+
position: {
|
|
245
|
+
latitude: number;
|
|
246
|
+
longitude: number;
|
|
247
|
+
};
|
|
248
|
+
vehicle: {
|
|
249
|
+
id: string;
|
|
250
|
+
};
|
|
251
|
+
occupancy_status?: "EMPTY" | "MANY_SEATS_AVAILABLE" | "FEW_SEATS_AVAILABLE" | "STANDING_ROOM_ONLY" | "CRUSHED_STANDING_ROOM_ONLY" | "FULL" | "NOT_ACCEPTING_PASSENGERS" | "NO_DATA_AVAILABLE" | "NOT_BOARDABLE" | null | undefined;
|
|
252
|
+
current_status?: "INCOMING_AT" | "STOPPED_AT" | "IN_TRANSIT_TO" | null | undefined;
|
|
253
|
+
timestamp?: number | null | undefined;
|
|
254
|
+
};
|
|
255
|
+
header: {
|
|
256
|
+
timestamp: number;
|
|
257
|
+
gtfs_realtime_version: string;
|
|
258
|
+
incrementality: "FULL_DATASET";
|
|
259
|
+
feed_version?: string | null | undefined;
|
|
260
|
+
};
|
|
261
|
+
}>;
|
|
262
|
+
version: z.ZodLiteral<"cp-v1">;
|
|
263
|
+
}, "strip", z.ZodTypeAny, {
|
|
264
|
+
_id: string;
|
|
265
|
+
created_at: number & {
|
|
266
|
+
__brand: "UnixTimestamp";
|
|
267
|
+
};
|
|
268
|
+
agency_id: string;
|
|
269
|
+
received_at: number & {
|
|
270
|
+
__brand: "UnixTimestamp";
|
|
271
|
+
};
|
|
272
|
+
version: "cp-v1";
|
|
273
|
+
payload: {
|
|
274
|
+
vehicle: {
|
|
275
|
+
trip: {
|
|
276
|
+
trip_id: string;
|
|
277
|
+
schedule_relationship?: "SCHEDULED" | "NOT_SCHEDULED" | null | undefined;
|
|
278
|
+
};
|
|
279
|
+
position: {
|
|
280
|
+
latitude: number;
|
|
281
|
+
longitude: number;
|
|
282
|
+
};
|
|
283
|
+
vehicle: {
|
|
284
|
+
id: string;
|
|
285
|
+
};
|
|
286
|
+
occupancy_status?: "EMPTY" | "MANY_SEATS_AVAILABLE" | "FEW_SEATS_AVAILABLE" | "STANDING_ROOM_ONLY" | "CRUSHED_STANDING_ROOM_ONLY" | "FULL" | "NOT_ACCEPTING_PASSENGERS" | "NO_DATA_AVAILABLE" | "NOT_BOARDABLE" | null | undefined;
|
|
287
|
+
current_status?: "INCOMING_AT" | "STOPPED_AT" | "IN_TRANSIT_TO" | null | undefined;
|
|
288
|
+
timestamp?: number | null | undefined;
|
|
289
|
+
};
|
|
290
|
+
header: {
|
|
291
|
+
timestamp: number;
|
|
292
|
+
gtfs_realtime_version: string;
|
|
293
|
+
incrementality: "FULL_DATASET";
|
|
294
|
+
feed_version?: string | null | undefined;
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
entity_id: string;
|
|
298
|
+
}, {
|
|
299
|
+
_id: string;
|
|
300
|
+
created_at: number;
|
|
301
|
+
agency_id: string;
|
|
302
|
+
received_at: number;
|
|
303
|
+
version: "cp-v1";
|
|
304
|
+
payload: {
|
|
305
|
+
vehicle: {
|
|
306
|
+
trip: {
|
|
307
|
+
trip_id: string;
|
|
308
|
+
schedule_relationship?: "SCHEDULED" | "NOT_SCHEDULED" | null | undefined;
|
|
309
|
+
};
|
|
310
|
+
position: {
|
|
311
|
+
latitude: number;
|
|
312
|
+
longitude: number;
|
|
313
|
+
};
|
|
314
|
+
vehicle: {
|
|
315
|
+
id: string;
|
|
316
|
+
};
|
|
317
|
+
occupancy_status?: "EMPTY" | "MANY_SEATS_AVAILABLE" | "FEW_SEATS_AVAILABLE" | "STANDING_ROOM_ONLY" | "CRUSHED_STANDING_ROOM_ONLY" | "FULL" | "NOT_ACCEPTING_PASSENGERS" | "NO_DATA_AVAILABLE" | "NOT_BOARDABLE" | null | undefined;
|
|
318
|
+
current_status?: "INCOMING_AT" | "STOPPED_AT" | "IN_TRANSIT_TO" | null | undefined;
|
|
319
|
+
timestamp?: number | null | undefined;
|
|
320
|
+
};
|
|
321
|
+
header: {
|
|
322
|
+
timestamp: number;
|
|
323
|
+
gtfs_realtime_version: string;
|
|
324
|
+
incrementality: "FULL_DATASET";
|
|
325
|
+
feed_version?: string | null | undefined;
|
|
326
|
+
};
|
|
327
|
+
};
|
|
328
|
+
entity_id: string;
|
|
329
|
+
}>;
|
|
330
|
+
export type RawVehicleEventCpV1 = z.infer<typeof RawVehicleEventCpV1Schema>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { GtfsRtOccupancyStatusSchema } from '../../../gtfs-rt/occupancy-status.js';
|
|
3
|
+
import { RawVehicleEventBaseSchema } from '../raw-vehicle-event-base.js';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
/* * */
|
|
6
|
+
export const RawVehicleEventCpV1PayloadSchema = z.object({
|
|
7
|
+
header: z.object({
|
|
8
|
+
feed_version: z.string().nullish(),
|
|
9
|
+
gtfs_realtime_version: z.string(),
|
|
10
|
+
incrementality: z.literal('FULL_DATASET'),
|
|
11
|
+
timestamp: z.number(),
|
|
12
|
+
}),
|
|
13
|
+
vehicle: z.object({
|
|
14
|
+
current_status: z.enum(['INCOMING_AT', 'STOPPED_AT', 'IN_TRANSIT_TO']).nullish(),
|
|
15
|
+
occupancy_status: GtfsRtOccupancyStatusSchema.nullish(),
|
|
16
|
+
position: z.object({
|
|
17
|
+
latitude: z.number(),
|
|
18
|
+
longitude: z.number(),
|
|
19
|
+
}),
|
|
20
|
+
timestamp: z.number().nullish(),
|
|
21
|
+
trip: z.object({
|
|
22
|
+
schedule_relationship: z.enum(['SCHEDULED', 'NOT_SCHEDULED']).nullish(),
|
|
23
|
+
trip_id: z.string(),
|
|
24
|
+
}),
|
|
25
|
+
vehicle: z.object({
|
|
26
|
+
id: z.string(),
|
|
27
|
+
}),
|
|
28
|
+
}),
|
|
29
|
+
});
|
|
30
|
+
/* * */
|
|
31
|
+
export const RawVehicleEventCpV1Schema = RawVehicleEventBaseSchema.extend({
|
|
32
|
+
payload: RawVehicleEventCpV1PayloadSchema,
|
|
33
|
+
version: z.literal('cp-v1'),
|
|
34
|
+
});
|
|
@@ -1368,6 +1368,206 @@ export declare const RawVehicleEventSchema: z.ZodDiscriminatedUnion<"version", [
|
|
|
1368
1368
|
};
|
|
1369
1369
|
};
|
|
1370
1370
|
entity_id: string;
|
|
1371
|
+
}>, z.ZodObject<{
|
|
1372
|
+
_id: z.ZodString;
|
|
1373
|
+
agency_id: z.ZodString;
|
|
1374
|
+
created_at: z.ZodEffects<z.ZodNumber, import("../../index.js").UnixTimestamp, number>;
|
|
1375
|
+
entity_id: z.ZodString;
|
|
1376
|
+
received_at: z.ZodEffects<z.ZodNumber, import("../../index.js").UnixTimestamp, number>;
|
|
1377
|
+
} & {
|
|
1378
|
+
payload: z.ZodObject<{
|
|
1379
|
+
header: z.ZodObject<{
|
|
1380
|
+
feed_version: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1381
|
+
gtfs_realtime_version: z.ZodString;
|
|
1382
|
+
incrementality: z.ZodLiteral<"FULL_DATASET">;
|
|
1383
|
+
timestamp: z.ZodNumber;
|
|
1384
|
+
}, "strip", z.ZodTypeAny, {
|
|
1385
|
+
timestamp: number;
|
|
1386
|
+
gtfs_realtime_version: string;
|
|
1387
|
+
incrementality: "FULL_DATASET";
|
|
1388
|
+
feed_version?: string | null | undefined;
|
|
1389
|
+
}, {
|
|
1390
|
+
timestamp: number;
|
|
1391
|
+
gtfs_realtime_version: string;
|
|
1392
|
+
incrementality: "FULL_DATASET";
|
|
1393
|
+
feed_version?: string | null | undefined;
|
|
1394
|
+
}>;
|
|
1395
|
+
vehicle: z.ZodObject<{
|
|
1396
|
+
current_status: z.ZodOptional<z.ZodNullable<z.ZodEnum<["INCOMING_AT", "STOPPED_AT", "IN_TRANSIT_TO"]>>>;
|
|
1397
|
+
occupancy_status: z.ZodOptional<z.ZodNullable<z.ZodEnum<["EMPTY", "MANY_SEATS_AVAILABLE", "FEW_SEATS_AVAILABLE", "STANDING_ROOM_ONLY", "CRUSHED_STANDING_ROOM_ONLY", "FULL", "NOT_ACCEPTING_PASSENGERS", "NO_DATA_AVAILABLE", "NOT_BOARDABLE"]>>>;
|
|
1398
|
+
position: z.ZodObject<{
|
|
1399
|
+
latitude: z.ZodNumber;
|
|
1400
|
+
longitude: z.ZodNumber;
|
|
1401
|
+
}, "strip", z.ZodTypeAny, {
|
|
1402
|
+
latitude: number;
|
|
1403
|
+
longitude: number;
|
|
1404
|
+
}, {
|
|
1405
|
+
latitude: number;
|
|
1406
|
+
longitude: number;
|
|
1407
|
+
}>;
|
|
1408
|
+
timestamp: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1409
|
+
trip: z.ZodObject<{
|
|
1410
|
+
schedule_relationship: z.ZodOptional<z.ZodNullable<z.ZodEnum<["SCHEDULED", "NOT_SCHEDULED"]>>>;
|
|
1411
|
+
trip_id: z.ZodString;
|
|
1412
|
+
}, "strip", z.ZodTypeAny, {
|
|
1413
|
+
trip_id: string;
|
|
1414
|
+
schedule_relationship?: "SCHEDULED" | "NOT_SCHEDULED" | null | undefined;
|
|
1415
|
+
}, {
|
|
1416
|
+
trip_id: string;
|
|
1417
|
+
schedule_relationship?: "SCHEDULED" | "NOT_SCHEDULED" | null | undefined;
|
|
1418
|
+
}>;
|
|
1419
|
+
vehicle: z.ZodObject<{
|
|
1420
|
+
id: z.ZodString;
|
|
1421
|
+
}, "strip", z.ZodTypeAny, {
|
|
1422
|
+
id: string;
|
|
1423
|
+
}, {
|
|
1424
|
+
id: string;
|
|
1425
|
+
}>;
|
|
1426
|
+
}, "strip", z.ZodTypeAny, {
|
|
1427
|
+
trip: {
|
|
1428
|
+
trip_id: string;
|
|
1429
|
+
schedule_relationship?: "SCHEDULED" | "NOT_SCHEDULED" | null | undefined;
|
|
1430
|
+
};
|
|
1431
|
+
position: {
|
|
1432
|
+
latitude: number;
|
|
1433
|
+
longitude: number;
|
|
1434
|
+
};
|
|
1435
|
+
vehicle: {
|
|
1436
|
+
id: string;
|
|
1437
|
+
};
|
|
1438
|
+
occupancy_status?: "EMPTY" | "MANY_SEATS_AVAILABLE" | "FEW_SEATS_AVAILABLE" | "STANDING_ROOM_ONLY" | "CRUSHED_STANDING_ROOM_ONLY" | "FULL" | "NOT_ACCEPTING_PASSENGERS" | "NO_DATA_AVAILABLE" | "NOT_BOARDABLE" | null | undefined;
|
|
1439
|
+
current_status?: "INCOMING_AT" | "STOPPED_AT" | "IN_TRANSIT_TO" | null | undefined;
|
|
1440
|
+
timestamp?: number | null | undefined;
|
|
1441
|
+
}, {
|
|
1442
|
+
trip: {
|
|
1443
|
+
trip_id: string;
|
|
1444
|
+
schedule_relationship?: "SCHEDULED" | "NOT_SCHEDULED" | null | undefined;
|
|
1445
|
+
};
|
|
1446
|
+
position: {
|
|
1447
|
+
latitude: number;
|
|
1448
|
+
longitude: number;
|
|
1449
|
+
};
|
|
1450
|
+
vehicle: {
|
|
1451
|
+
id: string;
|
|
1452
|
+
};
|
|
1453
|
+
occupancy_status?: "EMPTY" | "MANY_SEATS_AVAILABLE" | "FEW_SEATS_AVAILABLE" | "STANDING_ROOM_ONLY" | "CRUSHED_STANDING_ROOM_ONLY" | "FULL" | "NOT_ACCEPTING_PASSENGERS" | "NO_DATA_AVAILABLE" | "NOT_BOARDABLE" | null | undefined;
|
|
1454
|
+
current_status?: "INCOMING_AT" | "STOPPED_AT" | "IN_TRANSIT_TO" | null | undefined;
|
|
1455
|
+
timestamp?: number | null | undefined;
|
|
1456
|
+
}>;
|
|
1457
|
+
}, "strip", z.ZodTypeAny, {
|
|
1458
|
+
vehicle: {
|
|
1459
|
+
trip: {
|
|
1460
|
+
trip_id: string;
|
|
1461
|
+
schedule_relationship?: "SCHEDULED" | "NOT_SCHEDULED" | null | undefined;
|
|
1462
|
+
};
|
|
1463
|
+
position: {
|
|
1464
|
+
latitude: number;
|
|
1465
|
+
longitude: number;
|
|
1466
|
+
};
|
|
1467
|
+
vehicle: {
|
|
1468
|
+
id: string;
|
|
1469
|
+
};
|
|
1470
|
+
occupancy_status?: "EMPTY" | "MANY_SEATS_AVAILABLE" | "FEW_SEATS_AVAILABLE" | "STANDING_ROOM_ONLY" | "CRUSHED_STANDING_ROOM_ONLY" | "FULL" | "NOT_ACCEPTING_PASSENGERS" | "NO_DATA_AVAILABLE" | "NOT_BOARDABLE" | null | undefined;
|
|
1471
|
+
current_status?: "INCOMING_AT" | "STOPPED_AT" | "IN_TRANSIT_TO" | null | undefined;
|
|
1472
|
+
timestamp?: number | null | undefined;
|
|
1473
|
+
};
|
|
1474
|
+
header: {
|
|
1475
|
+
timestamp: number;
|
|
1476
|
+
gtfs_realtime_version: string;
|
|
1477
|
+
incrementality: "FULL_DATASET";
|
|
1478
|
+
feed_version?: string | null | undefined;
|
|
1479
|
+
};
|
|
1480
|
+
}, {
|
|
1481
|
+
vehicle: {
|
|
1482
|
+
trip: {
|
|
1483
|
+
trip_id: string;
|
|
1484
|
+
schedule_relationship?: "SCHEDULED" | "NOT_SCHEDULED" | null | undefined;
|
|
1485
|
+
};
|
|
1486
|
+
position: {
|
|
1487
|
+
latitude: number;
|
|
1488
|
+
longitude: number;
|
|
1489
|
+
};
|
|
1490
|
+
vehicle: {
|
|
1491
|
+
id: string;
|
|
1492
|
+
};
|
|
1493
|
+
occupancy_status?: "EMPTY" | "MANY_SEATS_AVAILABLE" | "FEW_SEATS_AVAILABLE" | "STANDING_ROOM_ONLY" | "CRUSHED_STANDING_ROOM_ONLY" | "FULL" | "NOT_ACCEPTING_PASSENGERS" | "NO_DATA_AVAILABLE" | "NOT_BOARDABLE" | null | undefined;
|
|
1494
|
+
current_status?: "INCOMING_AT" | "STOPPED_AT" | "IN_TRANSIT_TO" | null | undefined;
|
|
1495
|
+
timestamp?: number | null | undefined;
|
|
1496
|
+
};
|
|
1497
|
+
header: {
|
|
1498
|
+
timestamp: number;
|
|
1499
|
+
gtfs_realtime_version: string;
|
|
1500
|
+
incrementality: "FULL_DATASET";
|
|
1501
|
+
feed_version?: string | null | undefined;
|
|
1502
|
+
};
|
|
1503
|
+
}>;
|
|
1504
|
+
version: z.ZodLiteral<"cp-v1">;
|
|
1505
|
+
}, "strip", z.ZodTypeAny, {
|
|
1506
|
+
_id: string;
|
|
1507
|
+
created_at: number & {
|
|
1508
|
+
__brand: "UnixTimestamp";
|
|
1509
|
+
};
|
|
1510
|
+
agency_id: string;
|
|
1511
|
+
received_at: number & {
|
|
1512
|
+
__brand: "UnixTimestamp";
|
|
1513
|
+
};
|
|
1514
|
+
version: "cp-v1";
|
|
1515
|
+
payload: {
|
|
1516
|
+
vehicle: {
|
|
1517
|
+
trip: {
|
|
1518
|
+
trip_id: string;
|
|
1519
|
+
schedule_relationship?: "SCHEDULED" | "NOT_SCHEDULED" | null | undefined;
|
|
1520
|
+
};
|
|
1521
|
+
position: {
|
|
1522
|
+
latitude: number;
|
|
1523
|
+
longitude: number;
|
|
1524
|
+
};
|
|
1525
|
+
vehicle: {
|
|
1526
|
+
id: string;
|
|
1527
|
+
};
|
|
1528
|
+
occupancy_status?: "EMPTY" | "MANY_SEATS_AVAILABLE" | "FEW_SEATS_AVAILABLE" | "STANDING_ROOM_ONLY" | "CRUSHED_STANDING_ROOM_ONLY" | "FULL" | "NOT_ACCEPTING_PASSENGERS" | "NO_DATA_AVAILABLE" | "NOT_BOARDABLE" | null | undefined;
|
|
1529
|
+
current_status?: "INCOMING_AT" | "STOPPED_AT" | "IN_TRANSIT_TO" | null | undefined;
|
|
1530
|
+
timestamp?: number | null | undefined;
|
|
1531
|
+
};
|
|
1532
|
+
header: {
|
|
1533
|
+
timestamp: number;
|
|
1534
|
+
gtfs_realtime_version: string;
|
|
1535
|
+
incrementality: "FULL_DATASET";
|
|
1536
|
+
feed_version?: string | null | undefined;
|
|
1537
|
+
};
|
|
1538
|
+
};
|
|
1539
|
+
entity_id: string;
|
|
1540
|
+
}, {
|
|
1541
|
+
_id: string;
|
|
1542
|
+
created_at: number;
|
|
1543
|
+
agency_id: string;
|
|
1544
|
+
received_at: number;
|
|
1545
|
+
version: "cp-v1";
|
|
1546
|
+
payload: {
|
|
1547
|
+
vehicle: {
|
|
1548
|
+
trip: {
|
|
1549
|
+
trip_id: string;
|
|
1550
|
+
schedule_relationship?: "SCHEDULED" | "NOT_SCHEDULED" | null | undefined;
|
|
1551
|
+
};
|
|
1552
|
+
position: {
|
|
1553
|
+
latitude: number;
|
|
1554
|
+
longitude: number;
|
|
1555
|
+
};
|
|
1556
|
+
vehicle: {
|
|
1557
|
+
id: string;
|
|
1558
|
+
};
|
|
1559
|
+
occupancy_status?: "EMPTY" | "MANY_SEATS_AVAILABLE" | "FEW_SEATS_AVAILABLE" | "STANDING_ROOM_ONLY" | "CRUSHED_STANDING_ROOM_ONLY" | "FULL" | "NOT_ACCEPTING_PASSENGERS" | "NO_DATA_AVAILABLE" | "NOT_BOARDABLE" | null | undefined;
|
|
1560
|
+
current_status?: "INCOMING_AT" | "STOPPED_AT" | "IN_TRANSIT_TO" | null | undefined;
|
|
1561
|
+
timestamp?: number | null | undefined;
|
|
1562
|
+
};
|
|
1563
|
+
header: {
|
|
1564
|
+
timestamp: number;
|
|
1565
|
+
gtfs_realtime_version: string;
|
|
1566
|
+
incrementality: "FULL_DATASET";
|
|
1567
|
+
feed_version?: string | null | undefined;
|
|
1568
|
+
};
|
|
1569
|
+
};
|
|
1570
|
+
entity_id: string;
|
|
1371
1571
|
}>]>;
|
|
1372
1572
|
/**
|
|
1373
1573
|
* This type represents the raw vehicle event as it is received from
|
|
@@ -3,6 +3,7 @@ import { RawVehicleEventCapV1Schema } from './cap/v1.js';
|
|
|
3
3
|
import { RawVehicleEventCcflV1Schema } from './ccfl/v1.js';
|
|
4
4
|
import { RawVehicleEventCmetV1CoreSchema } from './cmet/v1-core.js';
|
|
5
5
|
import { RawVehicleEventCmetV1LogSchema } from './cmet/v1-log.js';
|
|
6
|
+
import { RawVehicleEventCpV1Schema } from './cp/v1.js';
|
|
6
7
|
import { RawVehicleEventTtslV1Schema } from './ttsl/v1.js';
|
|
7
8
|
import { z } from 'zod';
|
|
8
9
|
/* * */
|
|
@@ -12,4 +13,5 @@ export const RawVehicleEventSchema = z.discriminatedUnion('version', [
|
|
|
12
13
|
RawVehicleEventCmetV1CoreSchema,
|
|
13
14
|
RawVehicleEventCmetV1LogSchema,
|
|
14
15
|
RawVehicleEventTtslV1Schema,
|
|
16
|
+
RawVehicleEventCpV1Schema,
|
|
15
17
|
]);
|