@tmlmobilidade/go-types-hub 20260829.23.20
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/api/alerts/alert.d.ts +65 -0
- package/dist/api/alerts/alert.js +21 -0
- package/dist/api/alerts/index.d.ts +1 -0
- package/dist/api/alerts/index.js +1 -0
- package/dist/api/index.d.ts +4 -0
- package/dist/api/index.js +4 -0
- package/dist/api/network/index.d.ts +8 -0
- package/dist/api/network/index.js +8 -0
- package/dist/api/network/line.d.ts +70 -0
- package/dist/api/network/line.js +25 -0
- package/dist/api/network/pattern.d.ts +188 -0
- package/dist/api/network/pattern.js +33 -0
- package/dist/api/network/route.d.ts +70 -0
- package/dist/api/network/route.js +25 -0
- package/dist/api/network/scheduled-arrival.d.ts +21 -0
- package/dist/api/network/scheduled-arrival.js +10 -0
- package/dist/api/network/shape.d.ts +21 -0
- package/dist/api/network/shape.js +10 -0
- package/dist/api/network/stop.d.ts +101 -0
- package/dist/api/network/stop.js +29 -0
- package/dist/api/network/trip.d.ts +49 -0
- package/dist/api/network/trip.js +12 -0
- package/dist/api/network/waypoint.d.ts +27 -0
- package/dist/api/network/waypoint.js +12 -0
- package/dist/api/plans/index.d.ts +1 -0
- package/dist/api/plans/index.js +1 -0
- package/dist/api/plans/plan.d.ts +151 -0
- package/dist/api/plans/plan.js +17 -0
- package/dist/api/realtime/index.d.ts +1 -0
- package/dist/api/realtime/index.js +1 -0
- package/dist/api/realtime/vehicle-position.d.ts +81 -0
- package/dist/api/realtime/vehicle-position.js +29 -0
- package/dist/api/timetables.d.ts +36 -0
- package/dist/api/timetables.js +2 -0
- package/dist/gtfs/agency.d.ts +44 -0
- package/dist/gtfs/agency.js +7 -0
- package/dist/gtfs/calendar-dates.d.ts +25 -0
- package/dist/gtfs/calendar-dates.js +7 -0
- package/dist/gtfs/feed-info.d.ts +44 -0
- package/dist/gtfs/feed-info.js +4 -0
- package/dist/gtfs/index.d.ts +9 -0
- package/dist/gtfs/index.js +9 -0
- package/dist/gtfs/plans.d.ts +29 -0
- package/dist/gtfs/plans.js +10 -0
- package/dist/gtfs/routes.d.ts +56 -0
- package/dist/gtfs/routes.js +4 -0
- package/dist/gtfs/shapes.d.ts +32 -0
- package/dist/gtfs/shapes.js +4 -0
- package/dist/gtfs/stop-times.d.ts +53 -0
- package/dist/gtfs/stop-times.js +4 -0
- package/dist/gtfs/stops.d.ts +96 -0
- package/dist/gtfs/stops.js +18 -0
- package/dist/gtfs/trips.d.ts +46 -0
- package/dist/gtfs/trips.js +4 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/package.json +56 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const HubStopSchema: z.ZodObject<{
|
|
3
|
+
_id: z.ZodNumber;
|
|
4
|
+
agency_ids: z.ZodArray<z.ZodString, "many">;
|
|
5
|
+
district_id: z.ZodString;
|
|
6
|
+
district_name: z.ZodString;
|
|
7
|
+
flags: z.ZodArray<z.ZodObject<{
|
|
8
|
+
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
9
|
+
is_harmonized: z.ZodDefault<z.ZodBoolean>;
|
|
10
|
+
short_name: z.ZodString;
|
|
11
|
+
stop_id: z.ZodString;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
agency_ids: string[];
|
|
14
|
+
is_harmonized: boolean;
|
|
15
|
+
short_name: string;
|
|
16
|
+
stop_id: string;
|
|
17
|
+
}, {
|
|
18
|
+
short_name: string;
|
|
19
|
+
stop_id: string;
|
|
20
|
+
agency_ids?: string[] | undefined;
|
|
21
|
+
is_harmonized?: boolean | undefined;
|
|
22
|
+
}>, "many">;
|
|
23
|
+
latitude: z.ZodEffects<z.ZodNumber, import("@tmlmobilidade/go-types-geo").Latitude, number>;
|
|
24
|
+
legacy_ids: z.ZodArray<z.ZodString, "many">;
|
|
25
|
+
lifecycle_status: z.ZodEnum<["draft", "active", "inactive", "provisional", "seasonal", "voided"]>;
|
|
26
|
+
line_ids: z.ZodArray<z.ZodString, "many">;
|
|
27
|
+
locality_id: z.ZodNullable<z.ZodString>;
|
|
28
|
+
locality_name: z.ZodNullable<z.ZodString>;
|
|
29
|
+
longitude: z.ZodEffects<z.ZodNumber, import("@tmlmobilidade/go-types-geo").Longitude, number>;
|
|
30
|
+
municipality_id: z.ZodString;
|
|
31
|
+
municipality_name: z.ZodString;
|
|
32
|
+
name: z.ZodString;
|
|
33
|
+
parish_id: z.ZodString;
|
|
34
|
+
parish_name: z.ZodString;
|
|
35
|
+
pattern_ids: z.ZodArray<z.ZodString, "many">;
|
|
36
|
+
route_ids: z.ZodArray<z.ZodString, "many">;
|
|
37
|
+
short_name: z.ZodString;
|
|
38
|
+
tts_name: z.ZodString;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
_id: number;
|
|
41
|
+
pattern_ids: string[];
|
|
42
|
+
route_ids: string[];
|
|
43
|
+
short_name: string;
|
|
44
|
+
tts_name: string;
|
|
45
|
+
agency_ids: string[];
|
|
46
|
+
district_id: string;
|
|
47
|
+
district_name: string;
|
|
48
|
+
flags: {
|
|
49
|
+
agency_ids: string[];
|
|
50
|
+
is_harmonized: boolean;
|
|
51
|
+
short_name: string;
|
|
52
|
+
stop_id: string;
|
|
53
|
+
}[];
|
|
54
|
+
latitude: number & {
|
|
55
|
+
__brand: "Latitude";
|
|
56
|
+
};
|
|
57
|
+
legacy_ids: string[];
|
|
58
|
+
lifecycle_status: "draft" | "active" | "inactive" | "provisional" | "seasonal" | "voided";
|
|
59
|
+
line_ids: string[];
|
|
60
|
+
locality_id: string | null;
|
|
61
|
+
locality_name: string | null;
|
|
62
|
+
longitude: number & {
|
|
63
|
+
__brand: "Longitude";
|
|
64
|
+
};
|
|
65
|
+
municipality_id: string;
|
|
66
|
+
municipality_name: string;
|
|
67
|
+
name: string;
|
|
68
|
+
parish_id: string;
|
|
69
|
+
parish_name: string;
|
|
70
|
+
}, {
|
|
71
|
+
_id: number;
|
|
72
|
+
pattern_ids: string[];
|
|
73
|
+
route_ids: string[];
|
|
74
|
+
short_name: string;
|
|
75
|
+
tts_name: string;
|
|
76
|
+
agency_ids: string[];
|
|
77
|
+
district_id: string;
|
|
78
|
+
district_name: string;
|
|
79
|
+
flags: {
|
|
80
|
+
short_name: string;
|
|
81
|
+
stop_id: string;
|
|
82
|
+
agency_ids?: string[] | undefined;
|
|
83
|
+
is_harmonized?: boolean | undefined;
|
|
84
|
+
}[];
|
|
85
|
+
latitude: number;
|
|
86
|
+
legacy_ids: string[];
|
|
87
|
+
lifecycle_status: "draft" | "active" | "inactive" | "provisional" | "seasonal" | "voided";
|
|
88
|
+
line_ids: string[];
|
|
89
|
+
locality_id: string | null;
|
|
90
|
+
locality_name: string | null;
|
|
91
|
+
longitude: number;
|
|
92
|
+
municipality_id: string;
|
|
93
|
+
municipality_name: string;
|
|
94
|
+
name: string;
|
|
95
|
+
parish_id: string;
|
|
96
|
+
parish_name: string;
|
|
97
|
+
}>;
|
|
98
|
+
/**
|
|
99
|
+
* Stop data for the Hub Network API.
|
|
100
|
+
*/
|
|
101
|
+
export type HubStop = z.infer<typeof HubStopSchema>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { LatitudeSchema, LongitudeSchema } from '@tmlmobilidade/go-types-geo';
|
|
3
|
+
import { StopFlagSchema, StopIdSchema } from '@tmlmobilidade/go-types-infrastructure';
|
|
4
|
+
import { LifecycleStatusSchema } from '@tmlmobilidade/go-types-shared';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
/* * */
|
|
7
|
+
export const HubStopSchema = z.object({
|
|
8
|
+
_id: StopIdSchema,
|
|
9
|
+
agency_ids: z.array(z.string()),
|
|
10
|
+
district_id: z.string(),
|
|
11
|
+
district_name: z.string(),
|
|
12
|
+
flags: z.array(StopFlagSchema),
|
|
13
|
+
latitude: LatitudeSchema,
|
|
14
|
+
legacy_ids: z.array(z.string()),
|
|
15
|
+
lifecycle_status: LifecycleStatusSchema,
|
|
16
|
+
line_ids: z.array(z.string()),
|
|
17
|
+
locality_id: z.string().nullable(),
|
|
18
|
+
locality_name: z.string().nullable(),
|
|
19
|
+
longitude: LongitudeSchema,
|
|
20
|
+
municipality_id: z.string(),
|
|
21
|
+
municipality_name: z.string(),
|
|
22
|
+
name: z.string(),
|
|
23
|
+
parish_id: z.string(),
|
|
24
|
+
parish_name: z.string(),
|
|
25
|
+
pattern_ids: z.array(z.string()),
|
|
26
|
+
route_ids: z.array(z.string()),
|
|
27
|
+
short_name: z.string(),
|
|
28
|
+
tts_name: z.string(),
|
|
29
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const HubTripSchema: z.ZodObject<{
|
|
3
|
+
schedule: z.ZodArray<z.ZodObject<{
|
|
4
|
+
arrival_time: z.ZodString;
|
|
5
|
+
arrival_time_24h: z.ZodString;
|
|
6
|
+
stop_id: z.ZodString;
|
|
7
|
+
stop_sequence: z.ZodPipeline<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>, z.ZodNumber>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
arrival_time: string;
|
|
10
|
+
arrival_time_24h: string;
|
|
11
|
+
stop_id: string;
|
|
12
|
+
stop_sequence: number;
|
|
13
|
+
}, {
|
|
14
|
+
arrival_time: string;
|
|
15
|
+
arrival_time_24h: string;
|
|
16
|
+
stop_id: string;
|
|
17
|
+
stop_sequence: string | number;
|
|
18
|
+
}>, "many">;
|
|
19
|
+
service_ids: z.ZodArray<z.ZodString, "many">;
|
|
20
|
+
trip_ids: z.ZodArray<z.ZodString, "many">;
|
|
21
|
+
valid_on: z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, string, string | number>, string, string | number>, import("@tmlmobilidade/go-types-shared").OperationalDateInt, string | number>, "many">;
|
|
22
|
+
version_id: z.ZodString;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
schedule: {
|
|
25
|
+
arrival_time: string;
|
|
26
|
+
arrival_time_24h: string;
|
|
27
|
+
stop_id: string;
|
|
28
|
+
stop_sequence: number;
|
|
29
|
+
}[];
|
|
30
|
+
service_ids: string[];
|
|
31
|
+
trip_ids: string[];
|
|
32
|
+
valid_on: import("@tmlmobilidade/go-types-shared").OperationalDateInt[];
|
|
33
|
+
version_id: string;
|
|
34
|
+
}, {
|
|
35
|
+
schedule: {
|
|
36
|
+
arrival_time: string;
|
|
37
|
+
arrival_time_24h: string;
|
|
38
|
+
stop_id: string;
|
|
39
|
+
stop_sequence: string | number;
|
|
40
|
+
}[];
|
|
41
|
+
service_ids: string[];
|
|
42
|
+
trip_ids: string[];
|
|
43
|
+
valid_on: (string | number)[];
|
|
44
|
+
version_id: string;
|
|
45
|
+
}>;
|
|
46
|
+
/**
|
|
47
|
+
* Trip data for the Hub Network API.
|
|
48
|
+
*/
|
|
49
|
+
export type HubTrip = z.infer<typeof HubTripSchema>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { HubScheduledArrivalSchema } from './scheduled-arrival.js';
|
|
3
|
+
import { OperationalDateIntSchema } from '@tmlmobilidade/go-types-shared';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
/* * */
|
|
6
|
+
export const HubTripSchema = z.object({
|
|
7
|
+
schedule: z.array(HubScheduledArrivalSchema),
|
|
8
|
+
service_ids: z.array(z.string()),
|
|
9
|
+
trip_ids: z.array(z.string()),
|
|
10
|
+
valid_on: z.array(OperationalDateIntSchema),
|
|
11
|
+
version_id: z.string(),
|
|
12
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const HubWaypointSchema: z.ZodObject<{
|
|
3
|
+
allow_drop_off: z.ZodBoolean;
|
|
4
|
+
allow_pickup: z.ZodBoolean;
|
|
5
|
+
distance: z.ZodPipeline<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>, z.ZodNumber>;
|
|
6
|
+
distance_delta: z.ZodPipeline<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>, z.ZodNumber>;
|
|
7
|
+
stop_id: z.ZodString;
|
|
8
|
+
stop_sequence: z.ZodPipeline<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>, z.ZodNumber>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
stop_id: string;
|
|
11
|
+
stop_sequence: number;
|
|
12
|
+
allow_drop_off: boolean;
|
|
13
|
+
allow_pickup: boolean;
|
|
14
|
+
distance: number;
|
|
15
|
+
distance_delta: number;
|
|
16
|
+
}, {
|
|
17
|
+
stop_id: string;
|
|
18
|
+
stop_sequence: string | number;
|
|
19
|
+
allow_drop_off: boolean;
|
|
20
|
+
allow_pickup: boolean;
|
|
21
|
+
distance: string | number;
|
|
22
|
+
distance_delta: string | number;
|
|
23
|
+
}>;
|
|
24
|
+
/**
|
|
25
|
+
* Waypoint data for the Hub Network API.
|
|
26
|
+
*/
|
|
27
|
+
export type HubWaypoint = z.infer<typeof HubWaypointSchema>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { NonNegativeIntegerSchema } from '@tmlmobilidade/go-types-shared';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
/* * */
|
|
5
|
+
export const HubWaypointSchema = z.object({
|
|
6
|
+
allow_drop_off: z.boolean(),
|
|
7
|
+
allow_pickup: z.boolean(),
|
|
8
|
+
distance: NonNegativeIntegerSchema,
|
|
9
|
+
distance_delta: NonNegativeIntegerSchema,
|
|
10
|
+
stop_id: z.string(),
|
|
11
|
+
stop_sequence: NonNegativeIntegerSchema,
|
|
12
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './plan.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './plan.js';
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const HubPlanSchema: z.ZodObject<{
|
|
3
|
+
_id: z.ZodString;
|
|
4
|
+
agency_id: z.ZodString;
|
|
5
|
+
created_at: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("@tmlmobilidade/go-types-shared").UnixMilliseconds, string | number>;
|
|
6
|
+
gtfs_agency: z.ZodObject<{
|
|
7
|
+
agency_email: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
8
|
+
agency_fare_url: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
9
|
+
agency_id: z.ZodString;
|
|
10
|
+
agency_lang: z.ZodDefault<z.ZodEnum<["pt", "es", "en"]>>;
|
|
11
|
+
agency_name: z.ZodString;
|
|
12
|
+
agency_phone: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
13
|
+
agency_timezone: z.ZodString;
|
|
14
|
+
agency_url: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
15
|
+
cemv_support: z.ZodDefault<z.ZodEnum<["0", "1", "2"]>>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
agency_email: string;
|
|
18
|
+
agency_fare_url: string;
|
|
19
|
+
agency_id: string;
|
|
20
|
+
agency_lang: "pt" | "es" | "en";
|
|
21
|
+
agency_name: string;
|
|
22
|
+
agency_phone: string;
|
|
23
|
+
agency_timezone: string;
|
|
24
|
+
agency_url: string;
|
|
25
|
+
cemv_support: "0" | "1" | "2";
|
|
26
|
+
}, {
|
|
27
|
+
agency_id: string;
|
|
28
|
+
agency_name: string;
|
|
29
|
+
agency_timezone: string;
|
|
30
|
+
agency_email?: string | undefined;
|
|
31
|
+
agency_fare_url?: string | undefined;
|
|
32
|
+
agency_lang?: "pt" | "es" | "en" | undefined;
|
|
33
|
+
agency_phone?: string | undefined;
|
|
34
|
+
agency_url?: string | undefined;
|
|
35
|
+
cemv_support?: "0" | "1" | "2" | undefined;
|
|
36
|
+
}>;
|
|
37
|
+
gtfs_feed_info: z.ZodObject<{
|
|
38
|
+
default_lang: z.ZodDefault<z.ZodEnum<["pt", "es", "en"]>>;
|
|
39
|
+
feed_contact_email: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
40
|
+
feed_contact_url: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
41
|
+
feed_end_date: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, string, string | number>, string, string | number>, import("@tmlmobilidade/go-types-shared").OperationalDateInt, string | number>;
|
|
42
|
+
feed_lang: z.ZodString;
|
|
43
|
+
feed_publisher_name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
44
|
+
feed_publisher_url: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
45
|
+
feed_start_date: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, string, string | number>, string, string | number>, import("@tmlmobilidade/go-types-shared").OperationalDateInt, string | number>;
|
|
46
|
+
feed_version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
default_lang: "pt" | "es" | "en";
|
|
49
|
+
feed_contact_email: string;
|
|
50
|
+
feed_contact_url: string;
|
|
51
|
+
feed_end_date: number & {
|
|
52
|
+
__brand: "OperationalDateInt";
|
|
53
|
+
};
|
|
54
|
+
feed_lang: string;
|
|
55
|
+
feed_publisher_name: string;
|
|
56
|
+
feed_publisher_url: string;
|
|
57
|
+
feed_start_date: number & {
|
|
58
|
+
__brand: "OperationalDateInt";
|
|
59
|
+
};
|
|
60
|
+
feed_version: string;
|
|
61
|
+
}, {
|
|
62
|
+
feed_end_date: string | number;
|
|
63
|
+
feed_lang: string;
|
|
64
|
+
feed_start_date: string | number;
|
|
65
|
+
default_lang?: "pt" | "es" | "en" | undefined;
|
|
66
|
+
feed_contact_email?: string | undefined;
|
|
67
|
+
feed_contact_url?: string | undefined;
|
|
68
|
+
feed_publisher_name?: string | undefined;
|
|
69
|
+
feed_publisher_url?: string | undefined;
|
|
70
|
+
feed_version?: string | undefined;
|
|
71
|
+
}>;
|
|
72
|
+
hash: z.ZodString;
|
|
73
|
+
is_active: z.ZodDefault<z.ZodBoolean>;
|
|
74
|
+
operation_file_id: z.ZodString;
|
|
75
|
+
operation_file_url: z.ZodString;
|
|
76
|
+
updated_at: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("@tmlmobilidade/go-types-shared").UnixMilliseconds, string | number>;
|
|
77
|
+
}, "strip", z.ZodTypeAny, {
|
|
78
|
+
agency_id: string;
|
|
79
|
+
_id: string;
|
|
80
|
+
created_at: number & {
|
|
81
|
+
__brand: "UnixMilliseconds";
|
|
82
|
+
};
|
|
83
|
+
gtfs_agency: {
|
|
84
|
+
agency_email: string;
|
|
85
|
+
agency_fare_url: string;
|
|
86
|
+
agency_id: string;
|
|
87
|
+
agency_lang: "pt" | "es" | "en";
|
|
88
|
+
agency_name: string;
|
|
89
|
+
agency_phone: string;
|
|
90
|
+
agency_timezone: string;
|
|
91
|
+
agency_url: string;
|
|
92
|
+
cemv_support: "0" | "1" | "2";
|
|
93
|
+
};
|
|
94
|
+
gtfs_feed_info: {
|
|
95
|
+
default_lang: "pt" | "es" | "en";
|
|
96
|
+
feed_contact_email: string;
|
|
97
|
+
feed_contact_url: string;
|
|
98
|
+
feed_end_date: number & {
|
|
99
|
+
__brand: "OperationalDateInt";
|
|
100
|
+
};
|
|
101
|
+
feed_lang: string;
|
|
102
|
+
feed_publisher_name: string;
|
|
103
|
+
feed_publisher_url: string;
|
|
104
|
+
feed_start_date: number & {
|
|
105
|
+
__brand: "OperationalDateInt";
|
|
106
|
+
};
|
|
107
|
+
feed_version: string;
|
|
108
|
+
};
|
|
109
|
+
hash: string;
|
|
110
|
+
is_active: boolean;
|
|
111
|
+
operation_file_id: string;
|
|
112
|
+
operation_file_url: string;
|
|
113
|
+
updated_at: number & {
|
|
114
|
+
__brand: "UnixMilliseconds";
|
|
115
|
+
};
|
|
116
|
+
}, {
|
|
117
|
+
agency_id: string;
|
|
118
|
+
_id: string;
|
|
119
|
+
created_at: string | number;
|
|
120
|
+
gtfs_agency: {
|
|
121
|
+
agency_id: string;
|
|
122
|
+
agency_name: string;
|
|
123
|
+
agency_timezone: string;
|
|
124
|
+
agency_email?: string | undefined;
|
|
125
|
+
agency_fare_url?: string | undefined;
|
|
126
|
+
agency_lang?: "pt" | "es" | "en" | undefined;
|
|
127
|
+
agency_phone?: string | undefined;
|
|
128
|
+
agency_url?: string | undefined;
|
|
129
|
+
cemv_support?: "0" | "1" | "2" | undefined;
|
|
130
|
+
};
|
|
131
|
+
gtfs_feed_info: {
|
|
132
|
+
feed_end_date: string | number;
|
|
133
|
+
feed_lang: string;
|
|
134
|
+
feed_start_date: string | number;
|
|
135
|
+
default_lang?: "pt" | "es" | "en" | undefined;
|
|
136
|
+
feed_contact_email?: string | undefined;
|
|
137
|
+
feed_contact_url?: string | undefined;
|
|
138
|
+
feed_publisher_name?: string | undefined;
|
|
139
|
+
feed_publisher_url?: string | undefined;
|
|
140
|
+
feed_version?: string | undefined;
|
|
141
|
+
};
|
|
142
|
+
hash: string;
|
|
143
|
+
operation_file_id: string;
|
|
144
|
+
operation_file_url: string;
|
|
145
|
+
updated_at: string | number;
|
|
146
|
+
is_active?: boolean | undefined;
|
|
147
|
+
}>;
|
|
148
|
+
/**
|
|
149
|
+
* Plan data for the Hub Plans API.
|
|
150
|
+
*/
|
|
151
|
+
export type HubPlan = z.infer<typeof HubPlanSchema>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { GtfsAgencySchema, GtfsFeedInfoSchema } from '@tmlmobilidade/go-types-gtfs';
|
|
3
|
+
import { UnixMillisecondsSchema } from '@tmlmobilidade/go-types-shared';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
/* * */
|
|
6
|
+
export const HubPlanSchema = z.object({
|
|
7
|
+
_id: z.string(),
|
|
8
|
+
agency_id: z.string(),
|
|
9
|
+
created_at: UnixMillisecondsSchema,
|
|
10
|
+
gtfs_agency: GtfsAgencySchema,
|
|
11
|
+
gtfs_feed_info: GtfsFeedInfoSchema,
|
|
12
|
+
hash: z.string(),
|
|
13
|
+
is_active: z.boolean().default(false),
|
|
14
|
+
operation_file_id: z.string(),
|
|
15
|
+
operation_file_url: z.string().url(),
|
|
16
|
+
updated_at: UnixMillisecondsSchema,
|
|
17
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './vehicle-position.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './vehicle-position.js';
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const HubVehiclePositionSchema: z.ZodObject<{
|
|
3
|
+
_id: z.ZodString;
|
|
4
|
+
agency_id: z.ZodString;
|
|
5
|
+
bearing: z.ZodDefault<z.ZodNullable<z.ZodPipeline<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>, z.ZodNumber>>>;
|
|
6
|
+
calendar_date: z.ZodEffects<z.ZodString, import("@tmlmobilidade/go-types-shared").CalendarDate, string>;
|
|
7
|
+
created_at: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("@tmlmobilidade/go-types-shared").UnixMilliseconds, string | number>;
|
|
8
|
+
current_status: z.ZodDefault<z.ZodNullable<z.ZodEnum<["INCOMING_AT", "STOPPED_AT", "IN_TRANSIT_TO"]>>>;
|
|
9
|
+
direction_id: z.ZodDefault<z.ZodNullable<z.ZodEnum<["0", "1"]>>>;
|
|
10
|
+
geohash: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
11
|
+
latitude: z.ZodEffects<z.ZodNumber, import("@tmlmobilidade/go-types-geo").Latitude, number>;
|
|
12
|
+
longitude: z.ZodEffects<z.ZodNumber, import("@tmlmobilidade/go-types-geo").Longitude, number>;
|
|
13
|
+
operational_date: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, string, string | number>, string, string | number>, import("@tmlmobilidade/go-types-shared").OperationalDateInt, string | number>;
|
|
14
|
+
received_at: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("@tmlmobilidade/go-types-shared").UnixMilliseconds, string | number>;
|
|
15
|
+
ride_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
16
|
+
route_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
17
|
+
route_short_name: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
18
|
+
shape_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
19
|
+
speed: z.ZodDefault<z.ZodNullable<z.ZodPipeline<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>, z.ZodNumber>>>;
|
|
20
|
+
stop_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
21
|
+
trip_id: z.ZodString;
|
|
22
|
+
vehicle_id: z.ZodString;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
agency_id: string;
|
|
25
|
+
_id: string;
|
|
26
|
+
stop_id: string | null;
|
|
27
|
+
direction_id: "0" | "1" | null;
|
|
28
|
+
route_id: string | null;
|
|
29
|
+
shape_id: string | null;
|
|
30
|
+
latitude: number & {
|
|
31
|
+
__brand: "Latitude";
|
|
32
|
+
};
|
|
33
|
+
longitude: number & {
|
|
34
|
+
__brand: "Longitude";
|
|
35
|
+
};
|
|
36
|
+
created_at: number & {
|
|
37
|
+
__brand: "UnixMilliseconds";
|
|
38
|
+
};
|
|
39
|
+
bearing: number | null;
|
|
40
|
+
calendar_date: string & {
|
|
41
|
+
__brand: "CalendarDate";
|
|
42
|
+
};
|
|
43
|
+
current_status: "INCOMING_AT" | "STOPPED_AT" | "IN_TRANSIT_TO" | null;
|
|
44
|
+
geohash: string | null;
|
|
45
|
+
operational_date: number & {
|
|
46
|
+
__brand: "OperationalDateInt";
|
|
47
|
+
};
|
|
48
|
+
received_at: number & {
|
|
49
|
+
__brand: "UnixMilliseconds";
|
|
50
|
+
};
|
|
51
|
+
ride_id: string | null;
|
|
52
|
+
route_short_name: string | null;
|
|
53
|
+
speed: number | null;
|
|
54
|
+
trip_id: string;
|
|
55
|
+
vehicle_id: string;
|
|
56
|
+
}, {
|
|
57
|
+
agency_id: string;
|
|
58
|
+
_id: string;
|
|
59
|
+
latitude: number;
|
|
60
|
+
longitude: number;
|
|
61
|
+
created_at: string | number;
|
|
62
|
+
calendar_date: string;
|
|
63
|
+
operational_date: string | number;
|
|
64
|
+
received_at: string | number;
|
|
65
|
+
trip_id: string;
|
|
66
|
+
vehicle_id: string;
|
|
67
|
+
stop_id?: string | null | undefined;
|
|
68
|
+
direction_id?: "0" | "1" | null | undefined;
|
|
69
|
+
route_id?: string | null | undefined;
|
|
70
|
+
shape_id?: string | null | undefined;
|
|
71
|
+
bearing?: string | number | null | undefined;
|
|
72
|
+
current_status?: "INCOMING_AT" | "STOPPED_AT" | "IN_TRANSIT_TO" | null | undefined;
|
|
73
|
+
geohash?: string | null | undefined;
|
|
74
|
+
ride_id?: string | null | undefined;
|
|
75
|
+
route_short_name?: string | null | undefined;
|
|
76
|
+
speed?: string | number | null | undefined;
|
|
77
|
+
}>;
|
|
78
|
+
/**
|
|
79
|
+
* Vehicle Position item for the Hub Realtime API.
|
|
80
|
+
*/
|
|
81
|
+
export type HubVehiclePosition = z.infer<typeof HubVehiclePositionSchema>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { LatitudeSchema, LongitudeSchema } from '@tmlmobilidade/go-types-geo';
|
|
3
|
+
import { GtfsTripDirectionSchema } from '@tmlmobilidade/go-types-gtfs';
|
|
4
|
+
import { GtfsRtVehicleStopStatusSchema } from '@tmlmobilidade/go-types-gtfs-rt';
|
|
5
|
+
import { CalendarDateSchema, NonNegativeIntegerSchema, OperationalDateIntSchema, UnixMillisecondsSchema } from '@tmlmobilidade/go-types-shared';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
/* * */
|
|
8
|
+
export const HubVehiclePositionSchema = z.object({
|
|
9
|
+
_id: z.string(),
|
|
10
|
+
agency_id: z.string(),
|
|
11
|
+
bearing: NonNegativeIntegerSchema.nullable().default(null),
|
|
12
|
+
calendar_date: CalendarDateSchema,
|
|
13
|
+
created_at: UnixMillisecondsSchema,
|
|
14
|
+
current_status: GtfsRtVehicleStopStatusSchema.nullable().default(null),
|
|
15
|
+
direction_id: GtfsTripDirectionSchema.nullable().default(null),
|
|
16
|
+
geohash: z.string().nullable().default(null),
|
|
17
|
+
latitude: LatitudeSchema,
|
|
18
|
+
longitude: LongitudeSchema,
|
|
19
|
+
operational_date: OperationalDateIntSchema,
|
|
20
|
+
received_at: UnixMillisecondsSchema,
|
|
21
|
+
ride_id: z.string().nullable().default(null),
|
|
22
|
+
route_id: z.string().nullable().default(null),
|
|
23
|
+
route_short_name: z.string().nullable().default(null),
|
|
24
|
+
shape_id: z.string().nullable().default(null),
|
|
25
|
+
speed: NonNegativeIntegerSchema.nullable().default(null),
|
|
26
|
+
stop_id: z.string().nullable().default(null),
|
|
27
|
+
trip_id: z.string(),
|
|
28
|
+
vehicle_id: z.string(),
|
|
29
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface Timetable {
|
|
2
|
+
exceptions: Exception[];
|
|
3
|
+
hours: Hour[];
|
|
4
|
+
}
|
|
5
|
+
export interface Hour {
|
|
6
|
+
hour_label: string;
|
|
7
|
+
hour_value: number;
|
|
8
|
+
minutes: Minute[];
|
|
9
|
+
}
|
|
10
|
+
export interface Minute {
|
|
11
|
+
exception_ids: string[];
|
|
12
|
+
minute_label: string;
|
|
13
|
+
minute_value: number;
|
|
14
|
+
trip_ids: string[];
|
|
15
|
+
}
|
|
16
|
+
interface ExceptionTemplate {
|
|
17
|
+
exception_id: string;
|
|
18
|
+
pattern_headsign: string;
|
|
19
|
+
pattern_id: string;
|
|
20
|
+
pattern_version_id: string;
|
|
21
|
+
route_long_name: string;
|
|
22
|
+
}
|
|
23
|
+
interface ExceptionExtensionSchedule {
|
|
24
|
+
calendar_desc: string;
|
|
25
|
+
type: 'schedule';
|
|
26
|
+
}
|
|
27
|
+
interface ExceptionExtensionVariant {
|
|
28
|
+
calendar_desc?: null;
|
|
29
|
+
type: 'variant';
|
|
30
|
+
}
|
|
31
|
+
export type Exception = ((ExceptionExtensionSchedule | ExceptionExtensionVariant) & ExceptionTemplate);
|
|
32
|
+
export interface NextArrival {
|
|
33
|
+
type: 'realtime' | 'scheduled';
|
|
34
|
+
unixTs: number;
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const HubGtfsExportAgencySchema: z.ZodObject<{
|
|
3
|
+
agency_email: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
4
|
+
agency_fare_url: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
5
|
+
agency_id: z.ZodString;
|
|
6
|
+
agency_lang: z.ZodDefault<z.ZodEnum<["pt", "es", "en"]>>;
|
|
7
|
+
agency_name: z.ZodString;
|
|
8
|
+
agency_phone: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
9
|
+
agency_timezone: z.ZodString;
|
|
10
|
+
agency_url: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
11
|
+
cemv_support: z.ZodDefault<z.ZodEnum<["0", "1", "2"]>>;
|
|
12
|
+
} & {
|
|
13
|
+
agency_code: z.ZodString;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
agency_id: string;
|
|
16
|
+
agency_code: string;
|
|
17
|
+
agency_email: string;
|
|
18
|
+
agency_fare_url: string;
|
|
19
|
+
agency_lang: "pt" | "es" | "en";
|
|
20
|
+
agency_name: string;
|
|
21
|
+
agency_phone: string;
|
|
22
|
+
agency_timezone: string;
|
|
23
|
+
agency_url: string;
|
|
24
|
+
cemv_support: "0" | "1" | "2";
|
|
25
|
+
}, {
|
|
26
|
+
agency_id: string;
|
|
27
|
+
agency_code: string;
|
|
28
|
+
agency_name: string;
|
|
29
|
+
agency_timezone: string;
|
|
30
|
+
agency_email?: string | undefined;
|
|
31
|
+
agency_fare_url?: string | undefined;
|
|
32
|
+
agency_lang?: "pt" | "es" | "en" | undefined;
|
|
33
|
+
agency_phone?: string | undefined;
|
|
34
|
+
agency_url?: string | undefined;
|
|
35
|
+
cemv_support?: "0" | "1" | "2" | undefined;
|
|
36
|
+
}>;
|
|
37
|
+
/**
|
|
38
|
+
* Representation of a GTFS agency for the Hub GTFS export that is being created.
|
|
39
|
+
*/
|
|
40
|
+
export type HubGtfsExportAgencyInput = z.input<typeof HubGtfsExportAgencySchema>;
|
|
41
|
+
/**
|
|
42
|
+
* Representation of a GTFS agency for the Hub GTFS export.
|
|
43
|
+
*/
|
|
44
|
+
export type HubGtfsExportAgency = z.output<typeof HubGtfsExportAgencySchema>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const HubGtfsExportCalendarDatesSchema: z.ZodObject<{
|
|
3
|
+
date: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, string, string | number>, string, string | number>, import("@tmlmobilidade/go-types-shared").OperationalDateInt, string | number>;
|
|
4
|
+
service_id: z.ZodString;
|
|
5
|
+
} & {
|
|
6
|
+
exception_type: z.ZodDefault<z.ZodLiteral<"1">>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
date: number & {
|
|
9
|
+
__brand: "OperationalDateInt";
|
|
10
|
+
};
|
|
11
|
+
exception_type: "1";
|
|
12
|
+
service_id: string;
|
|
13
|
+
}, {
|
|
14
|
+
date: string | number;
|
|
15
|
+
service_id: string;
|
|
16
|
+
exception_type?: "1" | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
/**
|
|
19
|
+
* Representation of a GTFS calendar date for the Hub GTFS export that is being created.
|
|
20
|
+
*/
|
|
21
|
+
export type HubGtfsExportCalendarDatesInput = z.input<typeof HubGtfsExportCalendarDatesSchema>;
|
|
22
|
+
/**
|
|
23
|
+
* Representation of a GTFS calendar date for the Hub GTFS export.
|
|
24
|
+
*/
|
|
25
|
+
export type HubGtfsExportCalendarDates = z.output<typeof HubGtfsExportCalendarDatesSchema>;
|