@tmlmobilidade/types 20260609.2354.26 → 20260610.1553.25

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.
@@ -1,9 +1,7 @@
1
1
  export * from './alerts/index.js';
2
- export * from './lines.js';
3
- export * from './patterns.js';
2
+ export * from './network/index.js';
4
3
  export * from './plans/index.js';
5
4
  export * from './realtime-eta-gtfs.js';
6
5
  export * from './realtime/index.js';
7
6
  export * from './shapes.js';
8
- export * from './stop.js';
9
7
  export * from './timetables.js';
@@ -1,9 +1,7 @@
1
1
  export * from './alerts/index.js';
2
- export * from './lines.js';
3
- export * from './patterns.js';
2
+ export * from './network/index.js';
4
3
  export * from './plans/index.js';
5
4
  export * from './realtime-eta-gtfs.js';
6
5
  export * from './realtime/index.js';
7
6
  export * from './shapes.js';
8
- export * from './stop.js';
9
7
  export * from './timetables.js';
@@ -0,0 +1,7 @@
1
+ export * from './line.js';
2
+ export * from './pattern.js';
3
+ export * from './route.js';
4
+ export * from './scheduled-arrival.js';
5
+ export * from './stop.js';
6
+ export * from './trip.js';
7
+ export * from './waypoint.js';
@@ -0,0 +1,7 @@
1
+ export * from './line.js';
2
+ export * from './pattern.js';
3
+ export * from './route.js';
4
+ export * from './scheduled-arrival.js';
5
+ export * from './stop.js';
6
+ export * from './trip.js';
7
+ export * from './waypoint.js';
@@ -49,6 +49,6 @@ export declare const HubLineSchema: z.ZodObject<{
49
49
  route_ids?: string[] | undefined;
50
50
  }>;
51
51
  /**
52
- * Publishable line data for the Hub Lines API.
52
+ * Publishable line data for the Hub Network API.
53
53
  */
54
54
  export type HubLine = z.infer<typeof HubLineSchema>;
@@ -0,0 +1,172 @@
1
+ import { z } from 'zod';
2
+ export declare const HubPatternSchema: z.ZodObject<{
3
+ _id: z.ZodString;
4
+ agency_id: z.ZodString;
5
+ color: z.ZodString;
6
+ direction_id: z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>;
7
+ district_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
8
+ facilities: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
9
+ headsign: z.ZodString;
10
+ line_id: z.ZodString;
11
+ locality_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
12
+ long_name: z.ZodString;
13
+ municipality_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
14
+ path: z.ZodArray<z.ZodObject<{
15
+ allow_drop_off: z.ZodBoolean;
16
+ allow_pickup: z.ZodBoolean;
17
+ distance: z.ZodNumber;
18
+ distance_delta: z.ZodNumber;
19
+ stop_id: z.ZodString;
20
+ stop_sequence: z.ZodNumber;
21
+ }, "strip", z.ZodTypeAny, {
22
+ stop_id: string;
23
+ stop_sequence: number;
24
+ allow_drop_off: boolean;
25
+ allow_pickup: boolean;
26
+ distance: number;
27
+ distance_delta: number;
28
+ }, {
29
+ stop_id: string;
30
+ stop_sequence: number;
31
+ allow_drop_off: boolean;
32
+ allow_pickup: boolean;
33
+ distance: number;
34
+ distance_delta: number;
35
+ }>, "many">;
36
+ region_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
37
+ route_id: z.ZodString;
38
+ shape_id: z.ZodString;
39
+ short_name: z.ZodString;
40
+ text_color: z.ZodString;
41
+ trips: z.ZodArray<z.ZodObject<{
42
+ schedule: z.ZodArray<z.ZodObject<{
43
+ arrival_time: z.ZodString;
44
+ arrival_time_24h: z.ZodString;
45
+ stop_id: z.ZodString;
46
+ stop_sequence: z.ZodNumber;
47
+ }, "strip", z.ZodTypeAny, {
48
+ stop_id: string;
49
+ arrival_time: string;
50
+ stop_sequence: number;
51
+ arrival_time_24h: string;
52
+ }, {
53
+ stop_id: string;
54
+ arrival_time: string;
55
+ stop_sequence: number;
56
+ arrival_time_24h: string;
57
+ }>, "many">;
58
+ service_ids: z.ZodArray<z.ZodString, "many">;
59
+ trip_ids: z.ZodArray<z.ZodString, "many">;
60
+ valid_on: z.ZodArray<z.ZodString, "many">;
61
+ version_id: z.ZodString;
62
+ }, "strip", z.ZodTypeAny, {
63
+ schedule: {
64
+ stop_id: string;
65
+ arrival_time: string;
66
+ stop_sequence: number;
67
+ arrival_time_24h: string;
68
+ }[];
69
+ service_ids: string[];
70
+ trip_ids: string[];
71
+ valid_on: string[];
72
+ version_id: string;
73
+ }, {
74
+ schedule: {
75
+ stop_id: string;
76
+ arrival_time: string;
77
+ stop_sequence: number;
78
+ arrival_time_24h: string;
79
+ }[];
80
+ service_ids: string[];
81
+ trip_ids: string[];
82
+ valid_on: string[];
83
+ version_id: string;
84
+ }>, "many">;
85
+ tts_headsign: z.ZodString;
86
+ valid_on: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
87
+ version_id: z.ZodString;
88
+ }, "strip", z.ZodTypeAny, {
89
+ _id: string;
90
+ path: {
91
+ stop_id: string;
92
+ stop_sequence: number;
93
+ allow_drop_off: boolean;
94
+ allow_pickup: boolean;
95
+ distance: number;
96
+ distance_delta: number;
97
+ }[];
98
+ short_name: string;
99
+ agency_id: string;
100
+ municipality_ids: string[];
101
+ line_id: string;
102
+ color: string;
103
+ headsign: string;
104
+ route_id: string;
105
+ facilities: string[];
106
+ direction_id: 0 | 1;
107
+ shape_id: string;
108
+ district_ids: string[];
109
+ locality_ids: string[];
110
+ long_name: string;
111
+ region_ids: string[];
112
+ text_color: string;
113
+ valid_on: string[];
114
+ version_id: string;
115
+ trips: {
116
+ schedule: {
117
+ stop_id: string;
118
+ arrival_time: string;
119
+ stop_sequence: number;
120
+ arrival_time_24h: string;
121
+ }[];
122
+ service_ids: string[];
123
+ trip_ids: string[];
124
+ valid_on: string[];
125
+ version_id: string;
126
+ }[];
127
+ tts_headsign: string;
128
+ }, {
129
+ _id: string;
130
+ path: {
131
+ stop_id: string;
132
+ stop_sequence: number;
133
+ allow_drop_off: boolean;
134
+ allow_pickup: boolean;
135
+ distance: number;
136
+ distance_delta: number;
137
+ }[];
138
+ short_name: string;
139
+ agency_id: string;
140
+ line_id: string;
141
+ color: string;
142
+ headsign: string;
143
+ route_id: string;
144
+ direction_id: 0 | 1;
145
+ shape_id: string;
146
+ long_name: string;
147
+ text_color: string;
148
+ version_id: string;
149
+ trips: {
150
+ schedule: {
151
+ stop_id: string;
152
+ arrival_time: string;
153
+ stop_sequence: number;
154
+ arrival_time_24h: string;
155
+ }[];
156
+ service_ids: string[];
157
+ trip_ids: string[];
158
+ valid_on: string[];
159
+ version_id: string;
160
+ }[];
161
+ tts_headsign: string;
162
+ municipality_ids?: string[] | undefined;
163
+ facilities?: string[] | undefined;
164
+ district_ids?: string[] | undefined;
165
+ locality_ids?: string[] | undefined;
166
+ region_ids?: string[] | undefined;
167
+ valid_on?: string[] | undefined;
168
+ }>;
169
+ /**
170
+ * Publishable pattern data for the Hub Network API.
171
+ */
172
+ export type HubPattern = z.infer<typeof HubPatternSchema>;
@@ -0,0 +1,28 @@
1
+ /* * */
2
+ import { HubTripSchema } from './trip.js';
3
+ import { HubWaypointSchema } from './waypoint.js';
4
+ import { z } from 'zod';
5
+ /* * */
6
+ export const HubPatternSchema = z.object({
7
+ _id: z.string(),
8
+ agency_id: z.string(),
9
+ color: z.string(),
10
+ direction_id: z.union([z.literal(0), z.literal(1)]),
11
+ district_ids: z.array(z.string()).default([]),
12
+ facilities: z.array(z.string()).default([]),
13
+ headsign: z.string(),
14
+ line_id: z.string(),
15
+ locality_ids: z.array(z.string()).default([]),
16
+ long_name: z.string(),
17
+ municipality_ids: z.array(z.string()).default([]),
18
+ path: z.array(HubWaypointSchema),
19
+ region_ids: z.array(z.string()).default([]),
20
+ route_id: z.string(),
21
+ shape_id: z.string(),
22
+ short_name: z.string(),
23
+ text_color: z.string(),
24
+ trips: z.array(HubTripSchema),
25
+ tts_headsign: z.string(),
26
+ valid_on: z.array(z.string()).default([]),
27
+ version_id: z.string(),
28
+ });
@@ -0,0 +1,54 @@
1
+ import { z } from 'zod';
2
+ export declare const HubRouteSchema: z.ZodObject<{
3
+ _id: z.ZodString;
4
+ agency_id: z.ZodString;
5
+ color: z.ZodString;
6
+ district_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
7
+ facilities: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
8
+ line_id: z.ZodString;
9
+ locality_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
10
+ long_name: z.ZodString;
11
+ municipality_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
12
+ pattern_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
13
+ region_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
14
+ short_name: z.ZodString;
15
+ stop_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
16
+ text_color: z.ZodString;
17
+ tts_name: z.ZodString;
18
+ }, "strip", z.ZodTypeAny, {
19
+ _id: string;
20
+ short_name: string;
21
+ agency_id: string;
22
+ municipality_ids: string[];
23
+ line_id: string;
24
+ color: string;
25
+ stop_ids: string[];
26
+ tts_name: string;
27
+ facilities: string[];
28
+ district_ids: string[];
29
+ locality_ids: string[];
30
+ long_name: string;
31
+ pattern_ids: string[];
32
+ region_ids: string[];
33
+ text_color: string;
34
+ }, {
35
+ _id: string;
36
+ short_name: string;
37
+ agency_id: string;
38
+ line_id: string;
39
+ color: string;
40
+ tts_name: string;
41
+ long_name: string;
42
+ text_color: string;
43
+ municipality_ids?: string[] | undefined;
44
+ stop_ids?: string[] | undefined;
45
+ facilities?: string[] | undefined;
46
+ district_ids?: string[] | undefined;
47
+ locality_ids?: string[] | undefined;
48
+ pattern_ids?: string[] | undefined;
49
+ region_ids?: string[] | undefined;
50
+ }>;
51
+ /**
52
+ * Publishable route data for the Hub Network API.
53
+ */
54
+ export type HubRoute = z.infer<typeof HubRouteSchema>;
@@ -0,0 +1,20 @@
1
+ /* * */
2
+ import { z } from 'zod';
3
+ /* * */
4
+ export const HubRouteSchema = z.object({
5
+ _id: z.string(),
6
+ agency_id: z.string(),
7
+ color: z.string(),
8
+ district_ids: z.array(z.string()).default([]),
9
+ facilities: z.array(z.string()).default([]),
10
+ line_id: z.string(),
11
+ locality_ids: z.array(z.string()).default([]),
12
+ long_name: z.string(),
13
+ municipality_ids: z.array(z.string()).default([]),
14
+ pattern_ids: z.array(z.string()).default([]),
15
+ region_ids: z.array(z.string()).default([]),
16
+ short_name: z.string(),
17
+ stop_ids: z.array(z.string()).default([]),
18
+ text_color: z.string(),
19
+ tts_name: z.string(),
20
+ });
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+ export declare const HubScheduledArrivalSchema: z.ZodObject<{
3
+ arrival_time: z.ZodString;
4
+ arrival_time_24h: z.ZodString;
5
+ stop_id: z.ZodString;
6
+ stop_sequence: z.ZodNumber;
7
+ }, "strip", z.ZodTypeAny, {
8
+ stop_id: string;
9
+ arrival_time: string;
10
+ stop_sequence: number;
11
+ arrival_time_24h: string;
12
+ }, {
13
+ stop_id: string;
14
+ arrival_time: string;
15
+ stop_sequence: number;
16
+ arrival_time_24h: string;
17
+ }>;
18
+ /**
19
+ * Publishable scheduled arrival data for the Hub Network API.
20
+ */
21
+ export type HubScheduledArrival = z.infer<typeof HubScheduledArrivalSchema>;
@@ -0,0 +1,9 @@
1
+ /* * */
2
+ import { z } from 'zod';
3
+ /* * */
4
+ export const HubScheduledArrivalSchema = z.object({
5
+ arrival_time: z.string(),
6
+ arrival_time_24h: z.string(),
7
+ stop_id: z.string(),
8
+ stop_sequence: z.number(),
9
+ });
@@ -1,7 +1,7 @@
1
1
  /* * */
2
- import { LifecycleStatusSchema } from '../../_common/status.js';
3
- import { StopFlagSchema } from '../../stops/flag.js';
4
- import { StopIdSchema } from '../../stops/stop-id.js';
2
+ import { LifecycleStatusSchema } from '../../../_common/status.js';
3
+ import { StopFlagSchema } from '../../../stops/flag.js';
4
+ import { StopIdSchema } from '../../../stops/stop-id.js';
5
5
  import { z } from 'zod';
6
6
  /* * */
7
7
  export const HubStopSchema = z.object({
@@ -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.ZodNumber;
8
+ }, "strip", z.ZodTypeAny, {
9
+ stop_id: string;
10
+ arrival_time: string;
11
+ stop_sequence: number;
12
+ arrival_time_24h: string;
13
+ }, {
14
+ stop_id: string;
15
+ arrival_time: string;
16
+ stop_sequence: number;
17
+ arrival_time_24h: string;
18
+ }>, "many">;
19
+ service_ids: z.ZodArray<z.ZodString, "many">;
20
+ trip_ids: z.ZodArray<z.ZodString, "many">;
21
+ valid_on: z.ZodArray<z.ZodString, "many">;
22
+ version_id: z.ZodString;
23
+ }, "strip", z.ZodTypeAny, {
24
+ schedule: {
25
+ stop_id: string;
26
+ arrival_time: string;
27
+ stop_sequence: number;
28
+ arrival_time_24h: string;
29
+ }[];
30
+ service_ids: string[];
31
+ trip_ids: string[];
32
+ valid_on: string[];
33
+ version_id: string;
34
+ }, {
35
+ schedule: {
36
+ stop_id: string;
37
+ arrival_time: string;
38
+ stop_sequence: number;
39
+ arrival_time_24h: string;
40
+ }[];
41
+ service_ids: string[];
42
+ trip_ids: string[];
43
+ valid_on: string[];
44
+ version_id: string;
45
+ }>;
46
+ /**
47
+ * Publishable trip data for the Hub Network API.
48
+ */
49
+ export type HubTrip = z.infer<typeof HubTripSchema>;
@@ -0,0 +1,11 @@
1
+ /* * */
2
+ import { HubScheduledArrivalSchema } from './scheduled-arrival.js';
3
+ import { z } from 'zod';
4
+ /* * */
5
+ export const HubTripSchema = z.object({
6
+ schedule: z.array(HubScheduledArrivalSchema),
7
+ service_ids: z.array(z.string()),
8
+ trip_ids: z.array(z.string()),
9
+ valid_on: z.array(z.string()),
10
+ version_id: z.string(),
11
+ });
@@ -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.ZodNumber;
6
+ distance_delta: z.ZodNumber;
7
+ stop_id: z.ZodString;
8
+ stop_sequence: 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: number;
19
+ allow_drop_off: boolean;
20
+ allow_pickup: boolean;
21
+ distance: number;
22
+ distance_delta: number;
23
+ }>;
24
+ /**
25
+ * Publishable waypoint data for the Hub Network API.
26
+ */
27
+ export type HubWaypoint = z.infer<typeof HubWaypointSchema>;
@@ -0,0 +1,11 @@
1
+ /* * */
2
+ import { z } from 'zod';
3
+ /* * */
4
+ export const HubWaypointSchema = z.object({
5
+ allow_drop_off: z.boolean(),
6
+ allow_pickup: z.boolean(),
7
+ distance: z.number(),
8
+ distance_delta: z.number(),
9
+ stop_id: z.string(),
10
+ stop_sequence: z.number(),
11
+ });
@@ -1,50 +1,3 @@
1
- export interface HubPattern {
2
- color: string;
3
- direction_id: 0 | 1;
4
- district_ids: string[];
5
- facilities: string[];
6
- headsign: string;
7
- id: string;
8
- line_id: string;
9
- locality_ids: string[];
10
- long_name: string;
11
- municipality_ids: string[];
12
- path: HubWaypoint[];
13
- region_ids: string[];
14
- route_id: string;
15
- shape_id: string;
16
- short_name: string;
17
- text_color: string;
18
- trips: HubTrip[];
19
- tts_headsign: string;
20
- valid_on: string[];
21
- version_id: string;
22
- }
23
- export interface HubWaypoint {
24
- allow_drop_off: boolean;
25
- allow_pickup: boolean;
26
- distance: number;
27
- distance_delta: number;
28
- stop_id: string;
29
- stop_sequence: number;
30
- }
31
- export interface HubTrip {
32
- schedule: HubArrival[];
33
- service_ids: string[];
34
- trip_ids: string[];
35
- valid_on: string[];
36
- version_id: string;
37
- }
38
- export interface HubArrival {
39
- arrival_time: string;
40
- arrival_time_24h: string;
41
- is_realtime: boolean;
42
- line_id: string;
43
- pattern_id: string;
44
- stop_id: string;
45
- stop_sequence: number;
46
- trip_id: string;
47
- }
48
1
  export interface HubPatternRealtime {
49
2
  estimated_arrival: null | string;
50
3
  estimated_arrival_unix: null | number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/types",
3
- "version": "20260609.2354.26",
3
+ "version": "20260610.1553.25",
4
4
  "author": {
5
5
  "email": "iso@tmlmobilidade.pt",
6
6
  "name": "TML-ISO"
File without changes
File without changes