@tmlmobilidade/types 20260605.28.48 → 20260605.142.19
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/hub/api/index.d.ts +1 -0
- package/dist/hub/api/index.js +1 -0
- package/dist/hub/api/plans/plan.d.ts +3 -0
- package/dist/hub/api/plans/plan.js +1 -0
- package/dist/hub/api/realtime/index.d.ts +1 -0
- package/dist/hub/api/realtime/index.js +1 -0
- package/dist/hub/api/realtime/vehicle-position.d.ts +57 -0
- package/dist/hub/api/realtime/vehicle-position.js +31 -0
- package/package.json +1 -1
package/dist/hub/api/index.d.ts
CHANGED
package/dist/hub/api/index.js
CHANGED
|
@@ -63,6 +63,7 @@ export declare const HubPlanSchema: z.ZodObject<{
|
|
|
63
63
|
feed_publisher_url?: string | null | undefined;
|
|
64
64
|
}>;
|
|
65
65
|
hash: z.ZodString;
|
|
66
|
+
is_active: z.ZodDefault<z.ZodBoolean>;
|
|
66
67
|
operation_file_id: z.ZodString;
|
|
67
68
|
operation_file_url: z.ZodString;
|
|
68
69
|
updated_at: z.ZodEffects<z.ZodNumber, import("../../../_common/unix-timestamp.js").UnixTimestamp, number>;
|
|
@@ -97,6 +98,7 @@ export declare const HubPlanSchema: z.ZodObject<{
|
|
|
97
98
|
feed_publisher_url?: string | null | undefined;
|
|
98
99
|
};
|
|
99
100
|
hash: string;
|
|
101
|
+
is_active: boolean;
|
|
100
102
|
operation_file_id: string;
|
|
101
103
|
operation_file_url: string;
|
|
102
104
|
}, {
|
|
@@ -128,6 +130,7 @@ export declare const HubPlanSchema: z.ZodObject<{
|
|
|
128
130
|
hash: string;
|
|
129
131
|
operation_file_id: string;
|
|
130
132
|
operation_file_url: string;
|
|
133
|
+
is_active?: boolean | undefined;
|
|
131
134
|
}>;
|
|
132
135
|
/**
|
|
133
136
|
* Publishable plan data for the Hub Plans API.
|
|
@@ -11,6 +11,7 @@ export const HubPlanSchema = z.object({
|
|
|
11
11
|
gtfs_agency: GtfsAgencySchema,
|
|
12
12
|
gtfs_feed_info: GtfsFeedInfoSchema,
|
|
13
13
|
hash: z.string(),
|
|
14
|
+
is_active: z.boolean().default(false),
|
|
14
15
|
operation_file_id: z.string(),
|
|
15
16
|
operation_file_url: z.string(),
|
|
16
17
|
updated_at: UnixTimestampSchema,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './vehicle-position.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './vehicle-position.js';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const HubVehiclePositionSchema: z.ZodObject<{
|
|
3
|
+
_id: z.ZodString;
|
|
4
|
+
agency_id: z.ZodString;
|
|
5
|
+
calendar_date: z.ZodEffects<z.ZodString, import("../../../index.js").OperationalDate, string>;
|
|
6
|
+
created_at: z.ZodEffects<z.ZodNumber, import("../../../index.js").UnixTimestamp, number>;
|
|
7
|
+
geohash: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8
|
+
latitude: z.ZodEffects<z.ZodNumber, number, number>;
|
|
9
|
+
longitude: z.ZodEffects<z.ZodNumber, number, number>;
|
|
10
|
+
received_at: z.ZodEffects<z.ZodNumber, import("../../../index.js").UnixTimestamp, number>;
|
|
11
|
+
trip_id: z.ZodString;
|
|
12
|
+
vehicle_id: z.ZodString;
|
|
13
|
+
bearing: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
14
|
+
current_status: z.ZodDefault<z.ZodNullable<z.ZodEnum<["INCOMING_AT", "STOPPED_AT", "IN_TRANSIT_TO"]>>>;
|
|
15
|
+
speed: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
16
|
+
stop_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
_id: string;
|
|
19
|
+
created_at: number & {
|
|
20
|
+
__brand: "UnixTimestamp";
|
|
21
|
+
};
|
|
22
|
+
latitude: number;
|
|
23
|
+
longitude: number;
|
|
24
|
+
agency_id: string;
|
|
25
|
+
received_at: number & {
|
|
26
|
+
__brand: "UnixTimestamp";
|
|
27
|
+
};
|
|
28
|
+
stop_id: string | null;
|
|
29
|
+
trip_id: string;
|
|
30
|
+
vehicle_id: string;
|
|
31
|
+
bearing: number | null;
|
|
32
|
+
speed: number | null;
|
|
33
|
+
current_status: "INCOMING_AT" | "STOPPED_AT" | "IN_TRANSIT_TO" | null;
|
|
34
|
+
calendar_date: string & {
|
|
35
|
+
__brand: "OperationalDate";
|
|
36
|
+
};
|
|
37
|
+
geohash?: string | null | undefined;
|
|
38
|
+
}, {
|
|
39
|
+
_id: string;
|
|
40
|
+
created_at: number;
|
|
41
|
+
latitude: number;
|
|
42
|
+
longitude: number;
|
|
43
|
+
agency_id: string;
|
|
44
|
+
received_at: number;
|
|
45
|
+
trip_id: string;
|
|
46
|
+
vehicle_id: string;
|
|
47
|
+
calendar_date: string;
|
|
48
|
+
geohash?: string | null | undefined;
|
|
49
|
+
stop_id?: string | null | undefined;
|
|
50
|
+
bearing?: number | null | undefined;
|
|
51
|
+
speed?: number | null | undefined;
|
|
52
|
+
current_status?: "INCOMING_AT" | "STOPPED_AT" | "IN_TRANSIT_TO" | null | undefined;
|
|
53
|
+
}>;
|
|
54
|
+
/**
|
|
55
|
+
* Publishable plan data for the Hub Plans API.
|
|
56
|
+
*/
|
|
57
|
+
export type HubVehiclePosition = z.infer<typeof HubVehiclePositionSchema>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { UnixTimestampSchema } from '../../../_common/unix-timestamp.js';
|
|
3
|
+
import { OperationalDateSchema } from '../../../index.js';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
/* * */
|
|
6
|
+
export const HubVehiclePositionSchema = z.object({
|
|
7
|
+
//
|
|
8
|
+
// Required Fields
|
|
9
|
+
_id: z.string(),
|
|
10
|
+
agency_id: z.string(),
|
|
11
|
+
calendar_date: OperationalDateSchema,
|
|
12
|
+
created_at: UnixTimestampSchema,
|
|
13
|
+
geohash: z.string().nullish(),
|
|
14
|
+
latitude: z.number()
|
|
15
|
+
.min(-90)
|
|
16
|
+
.max(90)
|
|
17
|
+
.refine(value => value.toFixed(6) === value.toString()),
|
|
18
|
+
longitude: z.number()
|
|
19
|
+
.min(-180)
|
|
20
|
+
.max(180)
|
|
21
|
+
.refine(value => value.toFixed(6) === value.toString()),
|
|
22
|
+
received_at: UnixTimestampSchema,
|
|
23
|
+
trip_id: z.string(),
|
|
24
|
+
vehicle_id: z.string(),
|
|
25
|
+
//
|
|
26
|
+
// Optional Fields
|
|
27
|
+
bearing: z.number().nullable().default(null),
|
|
28
|
+
current_status: z.enum(['INCOMING_AT', 'STOPPED_AT', 'IN_TRANSIT_TO']).nullable().default(null),
|
|
29
|
+
speed: z.number().nullable().default(null),
|
|
30
|
+
stop_id: z.string().nullable().default(null),
|
|
31
|
+
});
|