@tmlmobilidade/types 20260604.2324.46 → 20260605.101.50

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,14 +1,14 @@
1
1
  import { z } from 'zod';
2
2
  export declare const HubAlertSchema: z.ZodObject<Omit<{
3
3
  _id: z.ZodString;
4
- created_at: z.ZodEffects<z.ZodNumber, import("../../index.js").UnixTimestamp, number>;
4
+ created_at: z.ZodEffects<z.ZodNumber, import("../../../index.js").UnixTimestamp, number>;
5
5
  created_by: z.ZodDefault<z.ZodNullable<z.ZodString>>;
6
6
  is_locked: z.ZodDefault<z.ZodBoolean>;
7
- updated_at: z.ZodEffects<z.ZodNumber, import("../../index.js").UnixTimestamp, number>;
7
+ updated_at: z.ZodEffects<z.ZodNumber, import("../../../index.js").UnixTimestamp, number>;
8
8
  updated_by: z.ZodOptional<z.ZodString>;
9
9
  } & {
10
- active_period_end_date: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../../index.js").UnixTimestamp, number>>>;
11
- active_period_start_date: z.ZodEffects<z.ZodNumber, import("../../index.js").UnixTimestamp, number>;
10
+ active_period_end_date: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../../../index.js").UnixTimestamp, number>>>;
11
+ active_period_start_date: z.ZodEffects<z.ZodNumber, import("../../../index.js").UnixTimestamp, number>;
12
12
  agency_id: z.ZodString;
13
13
  auto_texts: z.ZodDefault<z.ZodBoolean>;
14
14
  cause: z.ZodEnum<["ACCIDENT", "CONSTRUCTION", "DEMONSTRATION", "MEDICAL_EMERGENCY", "POLICE_ACTIVITY", "STRIKE", "TECHNICAL_ISSUE", "WEATHER", "ABUSIVE_PARKING", "DRIVER_ABSENCE", "DRIVER_ISSUE", "HIGH_PASSENGER_LOAD", "NETWORK_UPDATE", "ROAD_ISSUE", "TRAFFIC_JAM", "PUBLIC_DISORDER", "VEHICLE_ISSUE"]>;
@@ -19,8 +19,8 @@ export declare const HubAlertSchema: z.ZodObject<Omit<{
19
19
  file_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
20
20
  info_url: z.ZodDefault<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>>>;
21
21
  municipality_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
22
- publish_end_date: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../../index.js").UnixTimestamp, number>>>;
23
- publish_start_date: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../../index.js").UnixTimestamp, number>>>;
22
+ publish_end_date: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../../../index.js").UnixTimestamp, number>>>;
23
+ publish_start_date: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../../../index.js").UnixTimestamp, number>>>;
24
24
  publish_status: z.ZodDefault<z.ZodEnum<["published", "archived", "draft"]>>;
25
25
  reference_type: z.ZodEnum<["agency", "lines", "stops", "rides"]>;
26
26
  references: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -40,7 +40,7 @@ export declare const HubAlertSchema: z.ZodObject<Omit<{
40
40
  }, "strip", z.ZodTypeAny, {
41
41
  _id: string;
42
42
  description: string;
43
- active_period_end_date: import("../../index.js").UnixTimestamp | null;
43
+ active_period_end_date: import("../../../index.js").UnixTimestamp | null;
44
44
  active_period_start_date: number & {
45
45
  __brand: "UnixTimestamp";
46
46
  };
@@ -1,5 +1,5 @@
1
1
  /* * */
2
- import { AlertSchema } from '../../alerts/alert.js';
2
+ import { AlertSchema } from '../../../alerts/alert.js';
3
3
  import { z } from 'zod';
4
4
  /* * */
5
5
  export const HubAlertSchema = AlertSchema.omit({
@@ -0,0 +1 @@
1
+ export * from './alert.js';
@@ -0,0 +1 @@
1
+ export * from './alert.js';
@@ -1,6 +1,8 @@
1
- export * from './alerts.js';
1
+ export * from './alerts/index.js';
2
2
  export * from './lines.js';
3
3
  export * from './patterns.js';
4
+ export * from './plans/index.js';
5
+ export * from './realtime/index.js';
4
6
  export * from './shapes.js';
5
7
  export * from './stop.js';
6
8
  export * from './timetables.js';
@@ -1,6 +1,8 @@
1
- export * from './alerts.js';
1
+ export * from './alerts/index.js';
2
2
  export * from './lines.js';
3
3
  export * from './patterns.js';
4
+ export * from './plans/index.js';
5
+ export * from './realtime/index.js';
4
6
  export * from './shapes.js';
5
7
  export * from './stop.js';
6
8
  export * from './timetables.js';
@@ -0,0 +1 @@
1
+ export * from './plan.js';
@@ -0,0 +1 @@
1
+ export * from './plan.js';
@@ -0,0 +1,138 @@
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.ZodNumber, import("../../../_common/unix-timestamp.js").UnixTimestamp, number>;
6
+ gtfs_agency: z.ZodObject<{
7
+ agency_email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8
+ agency_fare_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
9
+ agency_id: z.ZodString;
10
+ agency_lang: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
+ agency_name: z.ZodString;
12
+ agency_phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
13
+ agency_timezone: z.ZodString;
14
+ agency_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
15
+ }, "strip", z.ZodTypeAny, {
16
+ agency_id: string;
17
+ agency_name: string;
18
+ agency_timezone: string;
19
+ agency_email?: string | null | undefined;
20
+ agency_fare_url?: string | null | undefined;
21
+ agency_lang?: string | null | undefined;
22
+ agency_phone?: string | null | undefined;
23
+ agency_url?: string | null | undefined;
24
+ }, {
25
+ agency_id: string;
26
+ agency_name: string;
27
+ agency_timezone: string;
28
+ agency_email?: string | null | undefined;
29
+ agency_fare_url?: string | null | undefined;
30
+ agency_lang?: string | null | undefined;
31
+ agency_phone?: string | null | undefined;
32
+ agency_url?: string | null | undefined;
33
+ }>;
34
+ gtfs_feed_info: z.ZodObject<{
35
+ default_lang: z.ZodOptional<z.ZodNullable<z.ZodString>>;
36
+ feed_contact_email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
37
+ feed_contact_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
38
+ feed_end_date: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodString, import("../../../index.js").OperationalDate, string>>>;
39
+ feed_lang: z.ZodString;
40
+ feed_publisher_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
41
+ feed_publisher_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
42
+ feed_start_date: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodString, import("../../../index.js").OperationalDate, string>>>;
43
+ feed_version: z.ZodOptional<z.ZodNullable<z.ZodString>>;
44
+ }, "strip", z.ZodTypeAny, {
45
+ feed_lang: string;
46
+ feed_end_date?: import("../../../index.js").OperationalDate | null | undefined;
47
+ feed_start_date?: import("../../../index.js").OperationalDate | null | undefined;
48
+ feed_version?: string | null | undefined;
49
+ default_lang?: string | null | undefined;
50
+ feed_contact_email?: string | null | undefined;
51
+ feed_contact_url?: string | null | undefined;
52
+ feed_publisher_name?: string | null | undefined;
53
+ feed_publisher_url?: string | null | undefined;
54
+ }, {
55
+ feed_lang: string;
56
+ feed_end_date?: string | null | undefined;
57
+ feed_start_date?: string | null | undefined;
58
+ feed_version?: string | null | undefined;
59
+ default_lang?: string | null | undefined;
60
+ feed_contact_email?: string | null | undefined;
61
+ feed_contact_url?: string | null | undefined;
62
+ feed_publisher_name?: string | null | undefined;
63
+ feed_publisher_url?: string | null | undefined;
64
+ }>;
65
+ hash: z.ZodString;
66
+ is_active: z.ZodDefault<z.ZodBoolean>;
67
+ operation_file_id: z.ZodString;
68
+ operation_file_url: z.ZodString;
69
+ updated_at: z.ZodEffects<z.ZodNumber, import("../../../_common/unix-timestamp.js").UnixTimestamp, number>;
70
+ }, "strip", z.ZodTypeAny, {
71
+ _id: string;
72
+ created_at: number & {
73
+ __brand: "UnixTimestamp";
74
+ };
75
+ updated_at: number & {
76
+ __brand: "UnixTimestamp";
77
+ };
78
+ agency_id: string;
79
+ gtfs_agency: {
80
+ agency_id: string;
81
+ agency_name: string;
82
+ agency_timezone: string;
83
+ agency_email?: string | null | undefined;
84
+ agency_fare_url?: string | null | undefined;
85
+ agency_lang?: string | null | undefined;
86
+ agency_phone?: string | null | undefined;
87
+ agency_url?: string | null | undefined;
88
+ };
89
+ gtfs_feed_info: {
90
+ feed_lang: string;
91
+ feed_end_date?: import("../../../index.js").OperationalDate | null | undefined;
92
+ feed_start_date?: import("../../../index.js").OperationalDate | null | undefined;
93
+ feed_version?: string | null | undefined;
94
+ default_lang?: string | null | undefined;
95
+ feed_contact_email?: string | null | undefined;
96
+ feed_contact_url?: string | null | undefined;
97
+ feed_publisher_name?: string | null | undefined;
98
+ feed_publisher_url?: string | null | undefined;
99
+ };
100
+ hash: string;
101
+ is_active: boolean;
102
+ operation_file_id: string;
103
+ operation_file_url: string;
104
+ }, {
105
+ _id: string;
106
+ created_at: number;
107
+ updated_at: number;
108
+ agency_id: string;
109
+ gtfs_agency: {
110
+ agency_id: string;
111
+ agency_name: string;
112
+ agency_timezone: string;
113
+ agency_email?: string | null | undefined;
114
+ agency_fare_url?: string | null | undefined;
115
+ agency_lang?: string | null | undefined;
116
+ agency_phone?: string | null | undefined;
117
+ agency_url?: string | null | undefined;
118
+ };
119
+ gtfs_feed_info: {
120
+ feed_lang: string;
121
+ feed_end_date?: string | null | undefined;
122
+ feed_start_date?: string | null | undefined;
123
+ feed_version?: string | null | undefined;
124
+ default_lang?: string | null | undefined;
125
+ feed_contact_email?: string | null | undefined;
126
+ feed_contact_url?: string | null | undefined;
127
+ feed_publisher_name?: string | null | undefined;
128
+ feed_publisher_url?: string | null | undefined;
129
+ };
130
+ hash: string;
131
+ operation_file_id: string;
132
+ operation_file_url: string;
133
+ is_active?: boolean | undefined;
134
+ }>;
135
+ /**
136
+ * Publishable plan data for the Hub Plans API.
137
+ */
138
+ export type HubPlan = z.infer<typeof HubPlanSchema>;
@@ -0,0 +1,18 @@
1
+ /* * */
2
+ import { UnixTimestampSchema } from '../../../_common/unix-timestamp.js';
3
+ import { GtfsAgencySchema } from '../../../gtfs/agency.js';
4
+ import { GtfsFeedInfoSchema } from '../../../gtfs/feed-info.js';
5
+ import { z } from 'zod';
6
+ /* * */
7
+ export const HubPlanSchema = z.object({
8
+ _id: z.string(),
9
+ agency_id: z.string(),
10
+ created_at: UnixTimestampSchema,
11
+ gtfs_agency: GtfsAgencySchema,
12
+ gtfs_feed_info: GtfsFeedInfoSchema,
13
+ hash: z.string(),
14
+ is_active: z.boolean().default(false),
15
+ operation_file_id: z.string(),
16
+ operation_file_url: z.string(),
17
+ updated_at: UnixTimestampSchema,
18
+ });
@@ -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
+ });
@@ -202,6 +202,8 @@ export declare const PlanSchema: z.ZodObject<{
202
202
  feed_publisher_name?: string | null | undefined;
203
203
  feed_publisher_url?: string | null | undefined;
204
204
  };
205
+ hash: string;
206
+ operation_file_id: string;
205
207
  apps: {
206
208
  controller: {
207
209
  status: "waiting" | "processing" | "complete" | "error" | "skipped";
@@ -224,8 +226,6 @@ export declare const PlanSchema: z.ZodObject<{
224
226
  last_hash: string | null;
225
227
  };
226
228
  };
227
- hash: string;
228
- operation_file_id: string;
229
229
  pcgi_legacy: {
230
230
  operation_plan_id: string | null;
231
231
  };
@@ -482,6 +482,8 @@ export declare const CreatePlanSchema: z.ZodObject<Omit<{
482
482
  feed_publisher_name?: string | null | undefined;
483
483
  feed_publisher_url?: string | null | undefined;
484
484
  };
485
+ hash: string;
486
+ operation_file_id: string;
485
487
  apps: {
486
488
  controller: {
487
489
  status: "waiting" | "processing" | "complete" | "error" | "skipped";
@@ -504,8 +506,6 @@ export declare const CreatePlanSchema: z.ZodObject<Omit<{
504
506
  last_hash: string | null;
505
507
  };
506
508
  };
507
- hash: string;
508
- operation_file_id: string;
509
509
  pcgi_legacy: {
510
510
  operation_plan_id: string | null;
511
511
  };
@@ -625,6 +625,8 @@ export declare const UpdatePlanSchema: z.ZodObject<{
625
625
  feed_publisher_name?: string | null | undefined;
626
626
  feed_publisher_url?: string | null | undefined;
627
627
  }>>;
628
+ hash: z.ZodOptional<z.ZodString>;
629
+ operation_file_id: z.ZodOptional<z.ZodString>;
628
630
  apps: z.ZodOptional<z.ZodDefault<z.ZodObject<{
629
631
  controller: z.ZodDefault<z.ZodObject<{
630
632
  last_hash: z.ZodDefault<z.ZodNullable<z.ZodString>>;
@@ -721,8 +723,6 @@ export declare const UpdatePlanSchema: z.ZodObject<{
721
723
  last_hash?: string | null | undefined;
722
724
  } | undefined;
723
725
  }>>>;
724
- hash: z.ZodOptional<z.ZodString>;
725
- operation_file_id: z.ZodOptional<z.ZodString>;
726
726
  pcgi_legacy: z.ZodOptional<z.ZodObject<{
727
727
  operation_plan_id: z.ZodNullable<z.ZodString>;
728
728
  }, "strip", z.ZodTypeAny, {
@@ -754,6 +754,8 @@ export declare const UpdatePlanSchema: z.ZodObject<{
754
754
  feed_publisher_name?: string | null | undefined;
755
755
  feed_publisher_url?: string | null | undefined;
756
756
  } | undefined;
757
+ hash?: string | undefined;
758
+ operation_file_id?: string | undefined;
757
759
  apps?: {
758
760
  controller: {
759
761
  status: "waiting" | "processing" | "complete" | "error" | "skipped";
@@ -776,8 +778,6 @@ export declare const UpdatePlanSchema: z.ZodObject<{
776
778
  last_hash: string | null;
777
779
  };
778
780
  } | undefined;
779
- hash?: string | undefined;
780
- operation_file_id?: string | undefined;
781
781
  pcgi_legacy?: {
782
782
  operation_plan_id: string | null;
783
783
  } | undefined;
@@ -805,6 +805,8 @@ export declare const UpdatePlanSchema: z.ZodObject<{
805
805
  feed_publisher_name?: string | null | undefined;
806
806
  feed_publisher_url?: string | null | undefined;
807
807
  } | undefined;
808
+ hash?: string | undefined;
809
+ operation_file_id?: string | undefined;
808
810
  apps?: {
809
811
  controller?: {
810
812
  status?: "waiting" | "processing" | "complete" | "error" | "skipped" | undefined;
@@ -827,8 +829,6 @@ export declare const UpdatePlanSchema: z.ZodObject<{
827
829
  last_hash?: string | null | undefined;
828
830
  } | undefined;
829
831
  } | undefined;
830
- hash?: string | undefined;
831
- operation_file_id?: string | undefined;
832
832
  pcgi_legacy?: {
833
833
  operation_plan_id: string | null;
834
834
  } | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/types",
3
- "version": "20260604.2324.46",
3
+ "version": "20260605.101.50",
4
4
  "author": {
5
5
  "email": "iso@tmlmobilidade.pt",
6
6
  "name": "TML-ISO"