@tmlmobilidade/types 20260103.2047.14 → 20260105.1950.3

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.
@@ -4,6 +4,7 @@ export * from './environment.js';
4
4
  export * from './fastify.js';
5
5
  export * from './mongo.js';
6
6
  export * from './operational-date.js';
7
+ export * from './position.js';
7
8
  export * from './status.js';
8
9
  export * from './status.js';
9
10
  export * from './unix-timestamp.js';
@@ -4,6 +4,7 @@ export * from './environment.js';
4
4
  export * from './fastify.js';
5
5
  export * from './mongo.js';
6
6
  export * from './operational-date.js';
7
+ export * from './position.js';
7
8
  export * from './status.js';
8
9
  export * from './status.js';
9
10
  export * from './unix-timestamp.js';
@@ -0,0 +1,17 @@
1
+ import z from 'zod';
2
+ export declare const PositionSchema: z.ZodObject<{
3
+ geohash: z.ZodString;
4
+ h3: z.ZodString;
5
+ latitude: z.ZodNumber;
6
+ longitude: z.ZodNumber;
7
+ }, "strip", z.ZodTypeAny, {
8
+ geohash: string;
9
+ h3: string;
10
+ latitude: number;
11
+ longitude: number;
12
+ }, {
13
+ geohash: string;
14
+ h3: string;
15
+ latitude: number;
16
+ longitude: number;
17
+ }>;
@@ -0,0 +1,8 @@
1
+ import z from 'zod';
2
+ /* * */
3
+ export const PositionSchema = z.object({
4
+ geohash: z.string(),
5
+ h3: z.string(),
6
+ latitude: z.number(),
7
+ longitude: z.number(),
8
+ });
@@ -219,6 +219,8 @@ export declare const StopSchema: z.ZodObject<{
219
219
  };
220
220
  name: string;
221
221
  short_name: string;
222
+ latitude: number;
223
+ longitude: number;
222
224
  comments: ({
223
225
  created_at: number & {
224
226
  __brand: "UnixTimestamp";
@@ -275,9 +277,7 @@ export declare const StopSchema: z.ZodObject<{
275
277
  new_name: string | null;
276
278
  tts_name: string;
277
279
  district_id: string;
278
- latitude: number;
279
280
  locality_id: string | null;
280
- longitude: number;
281
281
  bench_status: "unknown" | "not_applicable" | "missing" | "damaged" | "ok";
282
282
  electricity_status: "unknown" | "available" | "unavailable";
283
283
  pole_status: "unknown" | "not_applicable" | "missing" | "damaged" | "ok";
@@ -306,11 +306,11 @@ export declare const StopSchema: z.ZodObject<{
306
306
  updated_at: number;
307
307
  name: string;
308
308
  short_name: string;
309
+ latitude: number;
310
+ longitude: number;
309
311
  municipality_id: string;
310
312
  tts_name: string;
311
313
  district_id: string;
312
- latitude: number;
313
- longitude: number;
314
314
  created_by?: string | undefined;
315
315
  is_locked?: boolean | undefined;
316
316
  updated_by?: string | undefined;
@@ -590,6 +590,8 @@ export declare const CreateStopSchema: z.ZodObject<Omit<{
590
590
  is_locked: boolean;
591
591
  name: string;
592
592
  short_name: string;
593
+ latitude: number;
594
+ longitude: number;
593
595
  comments: ({
594
596
  created_at: number & {
595
597
  __brand: "UnixTimestamp";
@@ -646,9 +648,7 @@ export declare const CreateStopSchema: z.ZodObject<Omit<{
646
648
  new_name: string | null;
647
649
  tts_name: string;
648
650
  district_id: string;
649
- latitude: number;
650
651
  locality_id: string | null;
651
- longitude: number;
652
652
  bench_status: "unknown" | "not_applicable" | "missing" | "damaged" | "ok";
653
653
  electricity_status: "unknown" | "available" | "unavailable";
654
654
  pole_status: "unknown" | "not_applicable" | "missing" | "damaged" | "ok";
@@ -674,11 +674,11 @@ export declare const CreateStopSchema: z.ZodObject<Omit<{
674
674
  }, {
675
675
  name: string;
676
676
  short_name: string;
677
+ latitude: number;
678
+ longitude: number;
677
679
  municipality_id: string;
678
680
  tts_name: string;
679
681
  district_id: string;
680
- latitude: number;
681
- longitude: number;
682
682
  created_by?: string | undefined;
683
683
  is_locked?: boolean | undefined;
684
684
  updated_by?: string | undefined;
@@ -750,6 +750,8 @@ export declare const UpdateStopSchema: z.ZodObject<{
750
750
  updated_by: z.ZodOptional<z.ZodOptional<z.ZodString>>;
751
751
  name: z.ZodOptional<z.ZodString>;
752
752
  short_name: z.ZodOptional<z.ZodString>;
753
+ latitude: z.ZodOptional<z.ZodNumber>;
754
+ longitude: z.ZodOptional<z.ZodNumber>;
753
755
  comments: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
754
756
  _id: z.ZodOptional<z.ZodString>;
755
757
  created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
@@ -926,9 +928,7 @@ export declare const UpdateStopSchema: z.ZodObject<{
926
928
  new_name: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
927
929
  tts_name: z.ZodOptional<z.ZodString>;
928
930
  district_id: z.ZodOptional<z.ZodString>;
929
- latitude: z.ZodOptional<z.ZodNumber>;
930
931
  locality_id: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
931
- longitude: z.ZodOptional<z.ZodNumber>;
932
932
  bench_status: z.ZodOptional<z.ZodDefault<z.ZodEnum<["not_applicable", "unknown", "missing", "damaged", "ok"]>>>;
933
933
  electricity_status: z.ZodOptional<z.ZodDefault<z.ZodEnum<["available", "unavailable", "unknown"]>>>;
934
934
  pole_status: z.ZodOptional<z.ZodDefault<z.ZodEnum<["not_applicable", "unknown", "missing", "damaged", "ok"]>>>;
@@ -954,6 +954,8 @@ export declare const UpdateStopSchema: z.ZodObject<{
954
954
  updated_by?: string | undefined;
955
955
  name?: string | undefined;
956
956
  short_name?: string | undefined;
957
+ latitude?: number | undefined;
958
+ longitude?: number | undefined;
957
959
  comments?: ({
958
960
  created_at: number & {
959
961
  __brand: "UnixTimestamp";
@@ -1010,9 +1012,7 @@ export declare const UpdateStopSchema: z.ZodObject<{
1010
1012
  new_name?: string | null | undefined;
1011
1013
  tts_name?: string | undefined;
1012
1014
  district_id?: string | undefined;
1013
- latitude?: number | undefined;
1014
1015
  locality_id?: string | null | undefined;
1015
- longitude?: number | undefined;
1016
1016
  bench_status?: "unknown" | "not_applicable" | "missing" | "damaged" | "ok" | undefined;
1017
1017
  electricity_status?: "unknown" | "available" | "unavailable" | undefined;
1018
1018
  pole_status?: "unknown" | "not_applicable" | "missing" | "damaged" | "ok" | undefined;
@@ -1038,6 +1038,8 @@ export declare const UpdateStopSchema: z.ZodObject<{
1038
1038
  updated_by?: string | undefined;
1039
1039
  name?: string | undefined;
1040
1040
  short_name?: string | undefined;
1041
+ latitude?: number | undefined;
1042
+ longitude?: number | undefined;
1041
1043
  comments?: ({
1042
1044
  created_at: number;
1043
1045
  updated_at: number;
@@ -1082,9 +1084,7 @@ export declare const UpdateStopSchema: z.ZodObject<{
1082
1084
  new_name?: string | null | undefined;
1083
1085
  tts_name?: string | undefined;
1084
1086
  district_id?: string | undefined;
1085
- latitude?: number | undefined;
1086
1087
  locality_id?: string | null | undefined;
1087
- longitude?: number | undefined;
1088
1088
  bench_status?: "unknown" | "not_applicable" | "missing" | "damaged" | "ok" | undefined;
1089
1089
  electricity_status?: "unknown" | "available" | "unavailable" | undefined;
1090
1090
  pole_status?: "unknown" | "not_applicable" | "missing" | "damaged" | "ok" | undefined;
@@ -15,6 +15,8 @@ export declare const GtfsRtVehicleEventExtendedSchema: z.ZodObject<{
15
15
  trip_id: z.ZodString;
16
16
  vehicle_id: z.ZodString;
17
17
  }, "strip", z.ZodTypeAny, {
18
+ latitude: number;
19
+ longitude: number;
18
20
  agency_id: string;
19
21
  pattern_id: string;
20
22
  received_at: number & {
@@ -23,8 +25,6 @@ export declare const GtfsRtVehicleEventExtendedSchema: z.ZodObject<{
23
25
  stop_id: string;
24
26
  trip_id: string;
25
27
  vehicle_id: string;
26
- latitude: number;
27
- longitude: number;
28
28
  driver_id: string;
29
29
  event_id: string;
30
30
  odometer: number;
@@ -32,14 +32,14 @@ export declare const GtfsRtVehicleEventExtendedSchema: z.ZodObject<{
32
32
  trigger_door: string;
33
33
  extra_trip_id?: string | null | undefined;
34
34
  }, {
35
+ latitude: number;
36
+ longitude: number;
35
37
  agency_id: string;
36
38
  pattern_id: string;
37
39
  received_at: number;
38
40
  stop_id: string;
39
41
  trip_id: string;
40
42
  vehicle_id: string;
41
- latitude: number;
42
- longitude: number;
43
43
  driver_id: string;
44
44
  event_id: string;
45
45
  odometer: number;
@@ -8,6 +8,7 @@ export declare const SimplifiedVehicleEventSchema: z.ZodObject<Omit<{
8
8
  updated_by: z.ZodOptional<z.ZodString>;
9
9
  }, "is_locked"> & {
10
10
  agency_id: z.ZodString;
11
+ current_status: z.ZodEnum<["INCOMING_AT", "STOPPED_AT", "IN_TRANSIT_TO"]>;
11
12
  driver_id: z.ZodString;
12
13
  event_id: z.ZodString;
13
14
  extra_trip_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -15,6 +16,22 @@ export declare const SimplifiedVehicleEventSchema: z.ZodObject<Omit<{
15
16
  longitude: z.ZodNumber;
16
17
  odometer: z.ZodNumber;
17
18
  pattern_id: z.ZodString;
19
+ position: z.ZodObject<{
20
+ geohash: z.ZodString;
21
+ h3: z.ZodString;
22
+ latitude: z.ZodNumber;
23
+ longitude: z.ZodNumber;
24
+ }, "strip", z.ZodTypeAny, {
25
+ geohash: string;
26
+ h3: string;
27
+ latitude: number;
28
+ longitude: number;
29
+ }, {
30
+ geohash: string;
31
+ h3: string;
32
+ latitude: number;
33
+ longitude: number;
34
+ }>;
18
35
  received_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
19
36
  stop_id: z.ZodString;
20
37
  trigger_activity: z.ZodString;
@@ -29,6 +46,8 @@ export declare const SimplifiedVehicleEventSchema: z.ZodObject<Omit<{
29
46
  updated_at: number & {
30
47
  __brand: "UnixTimestamp";
31
48
  };
49
+ latitude: number;
50
+ longitude: number;
32
51
  agency_id: string;
33
52
  pattern_id: string;
34
53
  received_at: number & {
@@ -37,13 +56,18 @@ export declare const SimplifiedVehicleEventSchema: z.ZodObject<Omit<{
37
56
  stop_id: string;
38
57
  trip_id: string;
39
58
  vehicle_id: string;
40
- latitude: number;
41
- longitude: number;
42
59
  driver_id: string;
43
60
  event_id: string;
44
61
  odometer: number;
45
62
  trigger_activity: string;
46
63
  trigger_door: string;
64
+ current_status: "INCOMING_AT" | "STOPPED_AT" | "IN_TRANSIT_TO";
65
+ position: {
66
+ geohash: string;
67
+ h3: string;
68
+ latitude: number;
69
+ longitude: number;
70
+ };
47
71
  created_by?: string | undefined;
48
72
  updated_by?: string | undefined;
49
73
  extra_trip_id?: string | null | undefined;
@@ -51,19 +75,26 @@ export declare const SimplifiedVehicleEventSchema: z.ZodObject<Omit<{
51
75
  _id: string;
52
76
  created_at: number;
53
77
  updated_at: number;
78
+ latitude: number;
79
+ longitude: number;
54
80
  agency_id: string;
55
81
  pattern_id: string;
56
82
  received_at: number;
57
83
  stop_id: string;
58
84
  trip_id: string;
59
85
  vehicle_id: string;
60
- latitude: number;
61
- longitude: number;
62
86
  driver_id: string;
63
87
  event_id: string;
64
88
  odometer: number;
65
89
  trigger_activity: string;
66
90
  trigger_door: string;
91
+ current_status: "INCOMING_AT" | "STOPPED_AT" | "IN_TRANSIT_TO";
92
+ position: {
93
+ geohash: string;
94
+ h3: string;
95
+ latitude: number;
96
+ longitude: number;
97
+ };
67
98
  created_by?: string | undefined;
68
99
  updated_by?: string | undefined;
69
100
  extra_trip_id?: string | null | undefined;
@@ -1,5 +1,6 @@
1
1
  /* * */
2
2
  import { DocumentSchema } from '../_common/document.js';
3
+ import { PositionSchema } from '../_common/position.js';
3
4
  import { UnixTimeStampSchema } from '../_common/unix-timestamp.js';
4
5
  import { z } from 'zod';
5
6
  /* * */
@@ -7,6 +8,7 @@ export const SimplifiedVehicleEventSchema = DocumentSchema
7
8
  .omit({ is_locked: true })
8
9
  .extend({
9
10
  agency_id: z.string(),
11
+ current_status: z.enum(['INCOMING_AT', 'STOPPED_AT', 'IN_TRANSIT_TO']),
10
12
  driver_id: z.string(),
11
13
  event_id: z.string(),
12
14
  extra_trip_id: z.string().nullish(),
@@ -14,6 +16,7 @@ export const SimplifiedVehicleEventSchema = DocumentSchema
14
16
  longitude: z.number(),
15
17
  odometer: z.number(),
16
18
  pattern_id: z.string(),
19
+ position: PositionSchema,
17
20
  received_at: UnixTimeStampSchema,
18
21
  stop_id: z.string(),
19
22
  trigger_activity: z.string(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/types",
3
- "version": "20260103.2047.14",
3
+ "version": "20260105.1950.3",
4
4
  "author": {
5
5
  "email": "iso@tmlmobilidade.pt",
6
6
  "name": "TML-ISO"