@tmlmobilidade/types 20260421.1115.34 → 20260424.1050.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.
@@ -131,6 +131,25 @@ export declare const EventSchema: z.ZodObject<{
131
131
  same_weekday?: boolean | undefined;
132
132
  }>]>, "many">>;
133
133
  title: z.ZodString;
134
+ associated_patterns: z.ZodDefault<z.ZodArray<z.ZodObject<{
135
+ _id: z.ZodString;
136
+ code: z.ZodString;
137
+ headsign: z.ZodString;
138
+ line_id: z.ZodString;
139
+ route_id: z.ZodString;
140
+ }, "strip", z.ZodTypeAny, {
141
+ _id: string;
142
+ code: string;
143
+ line_id: string;
144
+ headsign: string;
145
+ route_id: string;
146
+ }, {
147
+ _id: string;
148
+ code: string;
149
+ line_id: string;
150
+ headsign: string;
151
+ route_id: string;
152
+ }>, "many">>;
134
153
  }, "strip", z.ZodTypeAny, {
135
154
  _id: string;
136
155
  created_at: number & {
@@ -179,6 +198,13 @@ export declare const EventSchema: z.ZodObject<{
179
198
  lines_to_include?: string[] | undefined;
180
199
  same_weekday?: boolean | undefined;
181
200
  })[];
201
+ associated_patterns: {
202
+ _id: string;
203
+ code: string;
204
+ line_id: string;
205
+ headsign: string;
206
+ route_id: string;
207
+ }[];
182
208
  updated_by?: string | undefined;
183
209
  }, {
184
210
  _id: string;
@@ -225,6 +251,13 @@ export declare const EventSchema: z.ZodObject<{
225
251
  lines_to_include?: string[] | undefined;
226
252
  same_weekday?: boolean | undefined;
227
253
  })[] | undefined;
254
+ associated_patterns?: {
255
+ _id: string;
256
+ code: string;
257
+ line_id: string;
258
+ headsign: string;
259
+ route_id: string;
260
+ }[] | undefined;
228
261
  }>;
229
262
  export declare const CreateEventSchema: z.ZodObject<Omit<{
230
263
  _id: z.ZodString;
@@ -358,7 +391,26 @@ export declare const CreateEventSchema: z.ZodObject<Omit<{
358
391
  same_weekday?: boolean | undefined;
359
392
  }>]>, "many">>;
360
393
  title: z.ZodString;
361
- }, "_id" | "created_at" | "updated_at">, "strip", z.ZodTypeAny, {
394
+ associated_patterns: z.ZodDefault<z.ZodArray<z.ZodObject<{
395
+ _id: z.ZodString;
396
+ code: z.ZodString;
397
+ headsign: z.ZodString;
398
+ line_id: z.ZodString;
399
+ route_id: z.ZodString;
400
+ }, "strip", z.ZodTypeAny, {
401
+ _id: string;
402
+ code: string;
403
+ line_id: string;
404
+ headsign: string;
405
+ route_id: string;
406
+ }, {
407
+ _id: string;
408
+ code: string;
409
+ line_id: string;
410
+ headsign: string;
411
+ route_id: string;
412
+ }>, "many">>;
413
+ }, "_id" | "created_at" | "updated_at" | "associated_patterns">, "strip", z.ZodTypeAny, {
362
414
  created_by: string | null;
363
415
  is_locked: boolean;
364
416
  code: string;
@@ -15,6 +15,14 @@ export const EventSchema = DocumentSchema.extend({
15
15
  is_locked: z.boolean().default(false),
16
16
  rules: z.array(EventRuleSchema).default([]),
17
17
  title: z.string().min(1),
18
+ // This field is not sent by the backend, but is useful to have in the frontend for easier access to the associated patterns of an event
19
+ associated_patterns: z.array(z.object({
20
+ _id: z.string(),
21
+ code: z.string(),
22
+ headsign: z.string(),
23
+ line_id: z.string(),
24
+ route_id: z.string(),
25
+ })).default([]),
18
26
  });
19
- export const CreateEventSchema = EventSchema.omit({ _id: true, created_at: true, updated_at: true });
27
+ export const CreateEventSchema = EventSchema.omit({ _id: true, associated_patterns: true, created_at: true, updated_at: true });
20
28
  export const UpdateEventSchema = CreateEventSchema.omit({ created_by: true }).partial();
@@ -73,10 +73,10 @@ export declare const FlatRideSchema: z.ZodObject<{
73
73
  pattern_id: string | null;
74
74
  trip_id: string | null;
75
75
  seen_last_at: string | null;
76
- driver_ids: string | null;
77
76
  headsign: string | null;
78
- plan_id: string | null;
79
77
  route_id: string | null;
78
+ driver_ids: string | null;
79
+ plan_id: string | null;
80
80
  vehicle_ids: string | null;
81
81
  operational_date: string | null;
82
82
  operational_status: string | null;
@@ -140,10 +140,10 @@ export declare const FlatRideSchema: z.ZodObject<{
140
140
  pattern_id: string | null;
141
141
  trip_id: string | null;
142
142
  seen_last_at: string | null;
143
- driver_ids: string | null;
144
143
  headsign: string | null;
145
- plan_id: string | null;
146
144
  route_id: string | null;
145
+ driver_ids: string | null;
146
+ plan_id: string | null;
147
147
  vehicle_ids: string | null;
148
148
  operational_date: string | null;
149
149
  operational_status: string | null;
@@ -2098,6 +2098,8 @@ export declare const PatternSchema: z.ZodObject<{
2098
2098
  lines_to_include?: string[] | undefined;
2099
2099
  same_weekday?: boolean | undefined;
2100
2100
  })[];
2101
+ headsign: string;
2102
+ route_id: string;
2101
2103
  comments: ({
2102
2104
  created_at: number & {
2103
2105
  __brand: "UnixTimestamp";
@@ -2144,8 +2146,6 @@ export declare const PatternSchema: z.ZodObject<{
2144
2146
  _id?: string | undefined;
2145
2147
  updated_by?: string | undefined;
2146
2148
  })[];
2147
- headsign: string;
2148
- route_id: string;
2149
2149
  destination: string;
2150
2150
  direction: "outbound" | "inbound";
2151
2151
  origin: string;
@@ -3880,6 +3880,8 @@ export declare const CreatePatternSchema: z.ZodObject<Omit<{
3880
3880
  lines_to_include?: string[] | undefined;
3881
3881
  same_weekday?: boolean | undefined;
3882
3882
  })[];
3883
+ headsign: string;
3884
+ route_id: string;
3883
3885
  comments: ({
3884
3886
  created_at: number & {
3885
3887
  __brand: "UnixTimestamp";
@@ -3926,8 +3928,6 @@ export declare const CreatePatternSchema: z.ZodObject<Omit<{
3926
3928
  _id?: string | undefined;
3927
3929
  updated_by?: string | undefined;
3928
3930
  })[];
3929
- headsign: string;
3930
- route_id: string;
3931
3931
  destination: string;
3932
3932
  direction: "outbound" | "inbound";
3933
3933
  origin: string;
@@ -5060,6 +5060,8 @@ export declare const UpdatePatternSchema: z.ZodObject<{
5060
5060
  extension: number;
5061
5061
  }>>>;
5062
5062
  line_id: z.ZodOptional<z.ZodString>;
5063
+ headsign: z.ZodOptional<z.ZodString>;
5064
+ route_id: z.ZodOptional<z.ZodString>;
5063
5065
  comments: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
5064
5066
  _id: z.ZodOptional<z.ZodString>;
5065
5067
  created_at: z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>;
@@ -5270,8 +5272,6 @@ export declare const UpdatePatternSchema: z.ZodObject<{
5270
5272
  created_by?: string | null | undefined;
5271
5273
  updated_by?: string | undefined;
5272
5274
  }>, "many">>>>;
5273
- headsign: z.ZodOptional<z.ZodString>;
5274
- route_id: z.ZodOptional<z.ZodString>;
5275
5275
  destination: z.ZodOptional<z.ZodString>;
5276
5276
  direction: z.ZodOptional<z.ZodDefault<z.ZodEnum<["outbound", "inbound"]>>>;
5277
5277
  origin: z.ZodOptional<z.ZodString>;
@@ -5628,6 +5628,8 @@ export declare const UpdatePatternSchema: z.ZodObject<{
5628
5628
  months?: (1 | 2 | 12 | 4 | 3 | 5 | 6 | 11 | 10 | 8 | 7 | 9)[] | undefined;
5629
5629
  weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
5630
5630
  }[] | undefined;
5631
+ headsign?: string | undefined;
5632
+ route_id?: string | undefined;
5631
5633
  comments?: ({
5632
5634
  created_at: number & {
5633
5635
  __brand: "UnixTimestamp";
@@ -5674,8 +5676,6 @@ export declare const UpdatePatternSchema: z.ZodObject<{
5674
5676
  _id?: string | undefined;
5675
5677
  updated_by?: string | undefined;
5676
5678
  })[] | undefined;
5677
- headsign?: string | undefined;
5678
- route_id?: string | undefined;
5679
5679
  destination?: string | undefined;
5680
5680
  direction?: "outbound" | "inbound" | undefined;
5681
5681
  origin?: string | undefined;
@@ -5829,6 +5829,8 @@ export declare const UpdatePatternSchema: z.ZodObject<{
5829
5829
  months?: (1 | 2 | 12 | 4 | 3 | 5 | 6 | 11 | 10 | 8 | 7 | 9)[] | undefined;
5830
5830
  weekdays?: (1 | 2 | 4 | 3 | 5 | 6 | 7)[] | undefined;
5831
5831
  }[] | undefined;
5832
+ headsign?: string | undefined;
5833
+ route_id?: string | undefined;
5832
5834
  comments?: ({
5833
5835
  created_at: number;
5834
5836
  updated_at: number;
@@ -5863,8 +5865,6 @@ export declare const UpdatePatternSchema: z.ZodObject<{
5863
5865
  created_by?: string | null | undefined;
5864
5866
  updated_by?: string | undefined;
5865
5867
  })[] | undefined;
5866
- headsign?: string | undefined;
5867
- route_id?: string | undefined;
5868
5868
  destination?: string | undefined;
5869
5869
  direction?: "outbound" | "inbound" | undefined;
5870
5870
  origin?: string | undefined;
@@ -518,11 +518,11 @@ export declare const RideNormalizedSchema: z.ZodObject<Omit<{
518
518
  pattern_id: string;
519
519
  trip_id: string;
520
520
  seen_last_at: import("../index.js").UnixTimestamp | null;
521
+ headsign: string;
522
+ route_id: string;
521
523
  acceptance_status: "none" | "rejected" | "justification_required" | "under_review" | "accepted";
522
524
  driver_ids: string[];
523
- headsign: string;
524
525
  plan_id: string;
525
- route_id: string;
526
526
  vehicle_ids: number[];
527
527
  operational_date: string & {
528
528
  __brand: "OperationalDate";
@@ -672,11 +672,11 @@ export declare const RideNormalizedSchema: z.ZodObject<Omit<{
672
672
  pattern_id: string;
673
673
  trip_id: string;
674
674
  seen_last_at: number | null;
675
+ headsign: string;
676
+ route_id: string;
675
677
  acceptance_status: "none" | "rejected" | "justification_required" | "under_review" | "accepted";
676
678
  driver_ids: string[];
677
- headsign: string;
678
679
  plan_id: string;
679
- route_id: string;
680
680
  vehicle_ids: number[];
681
681
  operational_date: string;
682
682
  operational_status: "ended" | "missed" | "running" | "scheduled";
@@ -494,10 +494,10 @@ export declare const RideSchema: z.ZodObject<Omit<{
494
494
  pattern_id: string;
495
495
  trip_id: string;
496
496
  seen_last_at: import("../_common/unix-timestamp.js").UnixTimestamp | null;
497
- driver_ids: string[];
498
497
  headsign: string;
499
- plan_id: string;
500
498
  route_id: string;
499
+ driver_ids: string[];
500
+ plan_id: string;
501
501
  vehicle_ids: number[];
502
502
  operational_date: string & {
503
503
  __brand: "OperationalDate";
@@ -631,10 +631,10 @@ export declare const RideSchema: z.ZodObject<Omit<{
631
631
  pattern_id: string;
632
632
  trip_id: string;
633
633
  seen_last_at: number | null;
634
- driver_ids: string[];
635
634
  headsign: string;
636
- plan_id: string;
637
635
  route_id: string;
636
+ driver_ids: string[];
637
+ plan_id: string;
638
638
  vehicle_ids: number[];
639
639
  operational_date: string;
640
640
  start_time_observed: number | null;
@@ -766,10 +766,10 @@ export declare const CreateRideSchema: z.ZodObject<Omit<{
766
766
  pattern_id: z.ZodString;
767
767
  trip_id: z.ZodString;
768
768
  seen_last_at: z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
769
- driver_ids: z.ZodArray<z.ZodString, "many">;
770
769
  headsign: z.ZodString;
771
- plan_id: z.ZodString;
772
770
  route_id: z.ZodString;
771
+ driver_ids: z.ZodArray<z.ZodString, "many">;
772
+ plan_id: z.ZodString;
773
773
  vehicle_ids: z.ZodArray<z.ZodNumber, "many">;
774
774
  operational_date: z.ZodEffects<z.ZodString, import("../_common/operational-date.js").OperationalDate, string>;
775
775
  start_time_observed: z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
@@ -1241,10 +1241,10 @@ export declare const CreateRideSchema: z.ZodObject<Omit<{
1241
1241
  pattern_id: string;
1242
1242
  trip_id: string;
1243
1243
  seen_last_at: import("../_common/unix-timestamp.js").UnixTimestamp | null;
1244
- driver_ids: string[];
1245
1244
  headsign: string;
1246
- plan_id: string;
1247
1245
  route_id: string;
1246
+ driver_ids: string[];
1247
+ plan_id: string;
1248
1248
  vehicle_ids: number[];
1249
1249
  operational_date: string & {
1250
1250
  __brand: "OperationalDate";
@@ -1376,10 +1376,10 @@ export declare const CreateRideSchema: z.ZodObject<Omit<{
1376
1376
  pattern_id: string;
1377
1377
  trip_id: string;
1378
1378
  seen_last_at: number | null;
1379
- driver_ids: string[];
1380
1379
  headsign: string;
1381
- plan_id: string;
1382
1380
  route_id: string;
1381
+ driver_ids: string[];
1382
+ plan_id: string;
1383
1383
  vehicle_ids: number[];
1384
1384
  operational_date: string;
1385
1385
  start_time_observed: number | null;
@@ -1509,10 +1509,10 @@ export declare const UpdateRideSchema: z.ZodObject<{
1509
1509
  pattern_id: z.ZodOptional<z.ZodString>;
1510
1510
  trip_id: z.ZodOptional<z.ZodString>;
1511
1511
  seen_last_at: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>>;
1512
- driver_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1513
1512
  headsign: z.ZodOptional<z.ZodString>;
1514
- plan_id: z.ZodOptional<z.ZodString>;
1515
1513
  route_id: z.ZodOptional<z.ZodString>;
1514
+ driver_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1515
+ plan_id: z.ZodOptional<z.ZodString>;
1516
1516
  vehicle_ids: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
1517
1517
  operational_date: z.ZodOptional<z.ZodEffects<z.ZodString, import("../_common/operational-date.js").OperationalDate, string>>;
1518
1518
  start_time_observed: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>>;
@@ -1985,10 +1985,10 @@ export declare const UpdateRideSchema: z.ZodObject<{
1985
1985
  pattern_id?: string | undefined;
1986
1986
  trip_id?: string | undefined;
1987
1987
  seen_last_at?: import("../_common/unix-timestamp.js").UnixTimestamp | null | undefined;
1988
- driver_ids?: string[] | undefined;
1989
1988
  headsign?: string | undefined;
1990
- plan_id?: string | undefined;
1991
1989
  route_id?: string | undefined;
1990
+ driver_ids?: string[] | undefined;
1991
+ plan_id?: string | undefined;
1992
1992
  vehicle_ids?: number[] | undefined;
1993
1993
  operational_date?: import("../_common/operational-date.js").OperationalDate | undefined;
1994
1994
  start_time_observed?: import("../_common/unix-timestamp.js").UnixTimestamp | null | undefined;
@@ -2114,10 +2114,10 @@ export declare const UpdateRideSchema: z.ZodObject<{
2114
2114
  pattern_id?: string | undefined;
2115
2115
  trip_id?: string | undefined;
2116
2116
  seen_last_at?: number | null | undefined;
2117
- driver_ids?: string[] | undefined;
2118
2117
  headsign?: string | undefined;
2119
- plan_id?: string | undefined;
2120
2118
  route_id?: string | undefined;
2119
+ driver_ids?: string[] | undefined;
2120
+ plan_id?: string | undefined;
2121
2121
  vehicle_ids?: number[] | undefined;
2122
2122
  operational_date?: string | undefined;
2123
2123
  start_time_observed?: number | null | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/types",
3
- "version": "20260421.1115.34",
3
+ "version": "20260424.1050.20",
4
4
  "author": {
5
5
  "email": "iso@tmlmobilidade.pt",
6
6
  "name": "TML-ISO"