@tmlmobilidade/types 20250911.1034.51 → 20250911.1425.9
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/src/_common/comment.d.ts +20 -20
- package/dist/src/_common/document.d.ts +4 -4
- package/dist/src/_common/document.js +2 -2
- package/dist/src/_common/operational-date.d.ts +1 -1
- package/dist/src/_common/operational-date.js +1 -2
- package/dist/src/_common/proposed-change.d.ts +18 -40
- package/dist/src/_common/proposed-change.js +5 -14
- package/dist/src/agency.d.ts +19 -30
- package/dist/src/agency.js +1 -1
- package/dist/src/alert.d.ts +37 -63
- package/dist/src/alert.js +8 -48
- package/dist/src/auth/login.js +2 -8
- package/dist/src/auth/role.d.ts +15 -22
- package/dist/src/auth/role.js +1 -1
- package/dist/src/auth/session.d.ts +22 -38
- package/dist/src/auth/session.js +3 -3
- package/dist/src/auth/user.d.ts +22 -41
- package/dist/src/auth/user.js +3 -3
- package/dist/src/auth/verification-token.d.ts +22 -34
- package/dist/src/auth/verification-token.js +3 -3
- package/dist/src/gtfs.d.ts +6 -17
- package/dist/src/organization.d.ts +10 -13
- package/dist/src/organization.js +1 -1
- package/dist/src/plans/gtfs-validation.d.ts +34 -72
- package/dist/src/plans/gtfs-validation.js +2 -6
- package/dist/src/plans/plan-controller.d.ts +3 -8
- package/dist/src/plans/plan-controller.js +2 -2
- package/dist/src/plans/plan.d.ts +43 -95
- package/dist/src/plans/plan.js +2 -6
- package/dist/src/rides/ride-audit.d.ts +27 -30
- package/dist/src/rides/ride-audit.js +1 -1
- package/dist/src/rides/ride-justification.d.ts +69 -72
- package/dist/src/rides/ride-justification.js +1 -1
- package/dist/src/rides/ride.d.ts +55 -106
- package/dist/src/rides/ride.js +8 -8
- package/dist/src/sams/sam-analysis.d.ts +5 -13
- package/dist/src/sams/sam-analysis.js +3 -3
- package/dist/src/sams/sam.d.ts +46 -97
- package/dist/src/sams/sam.js +4 -4
- package/dist/src/simplified-apex/simplified-apex-location.d.ts +18 -25
- package/dist/src/simplified-apex/simplified-apex-location.js +2 -2
- package/dist/src/simplified-apex/simplified-apex-on-board-refund.d.ts +18 -25
- package/dist/src/simplified-apex/simplified-apex-on-board-refund.js +2 -2
- package/dist/src/simplified-apex/simplified-apex-on-board-sale.d.ts +28 -38
- package/dist/src/simplified-apex/simplified-apex-on-board-sale.js +3 -3
- package/dist/src/simplified-apex/simplified-apex-validation.d.ts +18 -25
- package/dist/src/simplified-apex/simplified-apex-validation.js +2 -2
- package/dist/src/stop.d.ts +133 -151
- package/dist/src/stop.js +11 -74
- package/dist/src/vehicle-event.d.ts +9 -14
- package/dist/src/vehicle-event.js +2 -2
- package/dist/src/zone.d.ts +9 -12
- package/dist/src/zone.js +1 -1
- package/package.json +1 -1
package/dist/src/stop.js
CHANGED
|
@@ -6,75 +6,15 @@ import { z } from 'zod';
|
|
|
6
6
|
/* * */
|
|
7
7
|
//
|
|
8
8
|
// Define constants for enum values for better maintainability
|
|
9
|
-
const JURISDICTION_VALUES = [
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
];
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
'provisional',
|
|
19
|
-
'seasonal',
|
|
20
|
-
'voided',
|
|
21
|
-
];
|
|
22
|
-
const ELECTRICITY_STATUS_VALUES = [
|
|
23
|
-
'available',
|
|
24
|
-
'unavailable',
|
|
25
|
-
'unknown',
|
|
26
|
-
];
|
|
27
|
-
const ROAD_TYPE_VALUES = [
|
|
28
|
-
'complementary_itinerary',
|
|
29
|
-
'highway',
|
|
30
|
-
'main_itinerary',
|
|
31
|
-
'national_road',
|
|
32
|
-
'regional_road',
|
|
33
|
-
'secondary_road',
|
|
34
|
-
'unknown',
|
|
35
|
-
];
|
|
36
|
-
const INFRASTRUCTURE_STATUS_VALUES = [
|
|
37
|
-
'not_applicable',
|
|
38
|
-
'unknown',
|
|
39
|
-
'missing',
|
|
40
|
-
'damaged',
|
|
41
|
-
'ok',
|
|
42
|
-
];
|
|
43
|
-
const CONNECTIONS_VALUES = [
|
|
44
|
-
'ferry',
|
|
45
|
-
'light_rail',
|
|
46
|
-
'subway',
|
|
47
|
-
'train',
|
|
48
|
-
'boat',
|
|
49
|
-
'airport',
|
|
50
|
-
'bike_sharing',
|
|
51
|
-
'bike_parking',
|
|
52
|
-
'car_parking',
|
|
53
|
-
];
|
|
54
|
-
const FACILITIES_VALUES = [
|
|
55
|
-
'fire_station',
|
|
56
|
-
'health_clinic',
|
|
57
|
-
'historic_building',
|
|
58
|
-
'hospital',
|
|
59
|
-
'police_station',
|
|
60
|
-
'school',
|
|
61
|
-
'shopping',
|
|
62
|
-
'transit_office',
|
|
63
|
-
'university',
|
|
64
|
-
'beach',
|
|
65
|
-
];
|
|
66
|
-
const HAS_ANY = [
|
|
67
|
-
'yes',
|
|
68
|
-
'no',
|
|
69
|
-
'unknown',
|
|
70
|
-
];
|
|
71
|
-
const EQUIPMENT_VALUES = [
|
|
72
|
-
'pip',
|
|
73
|
-
'mupi',
|
|
74
|
-
'mini_pip',
|
|
75
|
-
];
|
|
76
|
-
//
|
|
77
|
-
// Define schemas using constants
|
|
9
|
+
const JURISDICTION_VALUES = ['ip', 'municipality', 'other', 'unknown'];
|
|
10
|
+
const OPERATIONAL_STATUS_VALUES = ['active', 'inactive', 'provisional', 'seasonal', 'voided'];
|
|
11
|
+
const ELECTRICITY_STATUS_VALUES = ['available', 'unavailable', 'unknown'];
|
|
12
|
+
const ROAD_TYPE_VALUES = ['complementary_itinerary', 'highway', 'main_itinerary', 'national_road', 'regional_road', 'secondary_road', 'unknown'];
|
|
13
|
+
const INFRASTRUCTURE_STATUS_VALUES = ['not_applicable', 'unknown', 'missing', 'damaged', 'ok'];
|
|
14
|
+
const CONNECTIONS_VALUES = ['ferry', 'light_rail', 'subway', 'train', 'boat', 'airport', 'bike_sharing', 'bike_parking', 'car_parking'];
|
|
15
|
+
const FACILITIES_VALUES = ['fire_station', 'health_clinic', 'historic_building', 'hospital', 'police_station', 'school', 'shopping', 'transit_office', 'university', 'beach'];
|
|
16
|
+
const HAS_ANY = ['yes', 'no', 'unknown'];
|
|
17
|
+
const EQUIPMENT_VALUES = ['pip', 'mupi', 'mini_pip'];
|
|
78
18
|
export const jurisdictionSchema = z.enum(JURISDICTION_VALUES);
|
|
79
19
|
export const operationalStatusSchema = z.enum(OPERATIONAL_STATUS_VALUES);
|
|
80
20
|
export const electricityStatusSchema = z.enum(ELECTRICITY_STATUS_VALUES);
|
|
@@ -158,11 +98,8 @@ export const stopAreaSchema = DocumentSchema.extend({
|
|
|
158
98
|
_id: z.string(),
|
|
159
99
|
parent_station_ids: z.array(z.string()),
|
|
160
100
|
}).strict();
|
|
161
|
-
export const CreateStopSchema = StopSchema
|
|
162
|
-
|
|
163
|
-
export const UpdateStopSchema = StopSchema
|
|
164
|
-
.omit({ _id: true, created_at: true, updated_at: true })
|
|
165
|
-
.partial();
|
|
101
|
+
export const CreateStopSchema = StopSchema.omit({ _id: true, created_at: true, updated_at: true });
|
|
102
|
+
export const UpdateStopSchema = CreateStopSchema.omit({ created_by: true }).partial();
|
|
166
103
|
/* * */
|
|
167
104
|
export const StopPermissionSchema = z.object({
|
|
168
105
|
agency_ids: z.array(z.string()),
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { type UnixTimestamp } from './_common/unix-timestamp.js';
|
|
2
1
|
import { z } from 'zod';
|
|
3
2
|
export declare const VehicleEventSchema: z.ZodObject<{
|
|
4
3
|
_id: z.ZodString;
|
|
5
|
-
created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
6
|
-
created_by: z.
|
|
7
|
-
updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
8
|
-
updated_by: z.
|
|
4
|
+
created_at: z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>;
|
|
5
|
+
created_by: z.ZodOptional<z.ZodString>;
|
|
6
|
+
updated_at: z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>;
|
|
7
|
+
updated_by: z.ZodOptional<z.ZodString>;
|
|
9
8
|
} & {
|
|
10
9
|
agency_id: z.ZodString;
|
|
11
10
|
driver_id: z.ZodString;
|
|
@@ -15,7 +14,7 @@ export declare const VehicleEventSchema: z.ZodObject<{
|
|
|
15
14
|
longitude: z.ZodNumber;
|
|
16
15
|
odometer: z.ZodNumber;
|
|
17
16
|
pattern_id: z.ZodString;
|
|
18
|
-
received_at: z.
|
|
17
|
+
received_at: z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>;
|
|
19
18
|
stop_id: z.ZodString;
|
|
20
19
|
trigger_activity: z.ZodString;
|
|
21
20
|
trigger_door: z.ZodString;
|
|
@@ -26,18 +25,16 @@ export declare const VehicleEventSchema: z.ZodObject<{
|
|
|
26
25
|
created_at: number & {
|
|
27
26
|
__brand: "UnixTimestamp";
|
|
28
27
|
};
|
|
29
|
-
created_by: string;
|
|
30
28
|
updated_at: number & {
|
|
31
29
|
__brand: "UnixTimestamp";
|
|
32
30
|
};
|
|
33
|
-
updated_by: string;
|
|
34
31
|
agency_id: string;
|
|
35
32
|
trip_id: string;
|
|
36
33
|
pattern_id: string;
|
|
37
34
|
vehicle_id: string;
|
|
38
35
|
received_at: number & {
|
|
39
36
|
__brand: "UnixTimestamp";
|
|
40
|
-
}
|
|
37
|
+
};
|
|
41
38
|
stop_id: string;
|
|
42
39
|
latitude: number;
|
|
43
40
|
longitude: number;
|
|
@@ -46,6 +43,8 @@ export declare const VehicleEventSchema: z.ZodObject<{
|
|
|
46
43
|
odometer: number;
|
|
47
44
|
trigger_activity: string;
|
|
48
45
|
trigger_door: string;
|
|
46
|
+
created_by?: string | undefined;
|
|
47
|
+
updated_by?: string | undefined;
|
|
49
48
|
extra_trip_id?: string | null | undefined;
|
|
50
49
|
}, {
|
|
51
50
|
_id: string;
|
|
@@ -75,8 +74,4 @@ export declare const VehicleEventSchema: z.ZodObject<{
|
|
|
75
74
|
* These events are based on the GTFS-RT specification but extended with additional fields
|
|
76
75
|
* specific to TML's needs.
|
|
77
76
|
*/
|
|
78
|
-
export
|
|
79
|
-
created_at: UnixTimestamp;
|
|
80
|
-
received_at: UnixTimestamp;
|
|
81
|
-
updated_at: UnixTimestamp;
|
|
82
|
-
}
|
|
77
|
+
export type VehicleEvent = z.infer<typeof VehicleEventSchema>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* * */
|
|
2
2
|
import { DocumentSchema } from './_common/document.js';
|
|
3
|
-
import {
|
|
3
|
+
import { unixTimeStampSchema } from './_common/unix-timestamp.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
/* * */
|
|
6
6
|
export const VehicleEventSchema = DocumentSchema.extend({
|
|
@@ -12,7 +12,7 @@ export const VehicleEventSchema = DocumentSchema.extend({
|
|
|
12
12
|
longitude: z.number(),
|
|
13
13
|
odometer: z.number(),
|
|
14
14
|
pattern_id: z.string(),
|
|
15
|
-
received_at:
|
|
15
|
+
received_at: unixTimeStampSchema,
|
|
16
16
|
stop_id: z.string(),
|
|
17
17
|
trigger_activity: z.string(),
|
|
18
18
|
trigger_door: z.string(),
|
package/dist/src/zone.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { type GeoJSON } from 'geojson';
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
export declare const ZoneSchema: z.ZodObject<{
|
|
4
4
|
_id: z.ZodString;
|
|
5
|
-
created_by: z.
|
|
5
|
+
created_by: z.ZodOptional<z.ZodString>;
|
|
6
6
|
updated_at: z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>;
|
|
7
|
-
updated_by: z.
|
|
7
|
+
updated_by: z.ZodOptional<z.ZodString>;
|
|
8
8
|
} & {
|
|
9
9
|
border_color: z.ZodString;
|
|
10
10
|
border_opacity: z.ZodNumber;
|
|
@@ -19,11 +19,9 @@ export declare const ZoneSchema: z.ZodObject<{
|
|
|
19
19
|
}, "strict", z.ZodTypeAny, {
|
|
20
20
|
_id: string;
|
|
21
21
|
created_at: Date;
|
|
22
|
-
created_by: string;
|
|
23
22
|
updated_at: number & {
|
|
24
23
|
__brand: "UnixTimestamp";
|
|
25
24
|
};
|
|
26
|
-
updated_by: string;
|
|
27
25
|
code: string;
|
|
28
26
|
name: string;
|
|
29
27
|
geojson: Record<string, any>;
|
|
@@ -33,6 +31,8 @@ export declare const ZoneSchema: z.ZodObject<{
|
|
|
33
31
|
border_width: number;
|
|
34
32
|
fill_color: string;
|
|
35
33
|
fill_opacity: number;
|
|
34
|
+
created_by?: string | undefined;
|
|
35
|
+
updated_by?: string | undefined;
|
|
36
36
|
}, {
|
|
37
37
|
_id: string;
|
|
38
38
|
created_at: Date;
|
|
@@ -51,9 +51,9 @@ export declare const ZoneSchema: z.ZodObject<{
|
|
|
51
51
|
}>;
|
|
52
52
|
export declare const CreateZoneSchema: z.ZodObject<Omit<{
|
|
53
53
|
_id: z.ZodString;
|
|
54
|
-
created_by: z.
|
|
54
|
+
created_by: z.ZodOptional<z.ZodString>;
|
|
55
55
|
updated_at: z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>;
|
|
56
|
-
updated_by: z.
|
|
56
|
+
updated_by: z.ZodOptional<z.ZodString>;
|
|
57
57
|
} & {
|
|
58
58
|
border_color: z.ZodString;
|
|
59
59
|
border_opacity: z.ZodNumber;
|
|
@@ -66,8 +66,6 @@ export declare const CreateZoneSchema: z.ZodObject<Omit<{
|
|
|
66
66
|
is_locked: z.ZodBoolean;
|
|
67
67
|
name: z.ZodString;
|
|
68
68
|
}, "_id" | "created_at" | "updated_at">, "strict", z.ZodTypeAny, {
|
|
69
|
-
created_by: string;
|
|
70
|
-
updated_by: string;
|
|
71
69
|
code: string;
|
|
72
70
|
name: string;
|
|
73
71
|
geojson: Record<string, any>;
|
|
@@ -77,6 +75,8 @@ export declare const CreateZoneSchema: z.ZodObject<Omit<{
|
|
|
77
75
|
border_width: number;
|
|
78
76
|
fill_color: string;
|
|
79
77
|
fill_opacity: number;
|
|
78
|
+
created_by?: string | undefined;
|
|
79
|
+
updated_by?: string | undefined;
|
|
80
80
|
}, {
|
|
81
81
|
code: string;
|
|
82
82
|
name: string;
|
|
@@ -91,8 +91,7 @@ export declare const CreateZoneSchema: z.ZodObject<Omit<{
|
|
|
91
91
|
updated_by?: string | undefined;
|
|
92
92
|
}>;
|
|
93
93
|
export declare const UpdateZoneSchema: z.ZodObject<{
|
|
94
|
-
|
|
95
|
-
updated_by: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
94
|
+
updated_by: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
96
95
|
code: z.ZodOptional<z.ZodString>;
|
|
97
96
|
name: z.ZodOptional<z.ZodString>;
|
|
98
97
|
geojson: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
@@ -103,7 +102,6 @@ export declare const UpdateZoneSchema: z.ZodObject<{
|
|
|
103
102
|
fill_color: z.ZodOptional<z.ZodString>;
|
|
104
103
|
fill_opacity: z.ZodOptional<z.ZodNumber>;
|
|
105
104
|
}, "strict", z.ZodTypeAny, {
|
|
106
|
-
created_by?: string | undefined;
|
|
107
105
|
updated_by?: string | undefined;
|
|
108
106
|
code?: string | undefined;
|
|
109
107
|
name?: string | undefined;
|
|
@@ -115,7 +113,6 @@ export declare const UpdateZoneSchema: z.ZodObject<{
|
|
|
115
113
|
fill_color?: string | undefined;
|
|
116
114
|
fill_opacity?: number | undefined;
|
|
117
115
|
}, {
|
|
118
|
-
created_by?: string | undefined;
|
|
119
116
|
updated_by?: string | undefined;
|
|
120
117
|
code?: string | undefined;
|
|
121
118
|
name?: string | undefined;
|
package/dist/src/zone.js
CHANGED
|
@@ -15,7 +15,7 @@ export const ZoneSchema = DocumentSchema.extend({
|
|
|
15
15
|
name: z.string(),
|
|
16
16
|
}).strict();
|
|
17
17
|
export const CreateZoneSchema = ZoneSchema.omit({ _id: true, created_at: true, updated_at: true });
|
|
18
|
-
export const UpdateZoneSchema = CreateZoneSchema.partial();
|
|
18
|
+
export const UpdateZoneSchema = CreateZoneSchema.omit({ created_by: true }).partial();
|
|
19
19
|
/* * */
|
|
20
20
|
export const ZonePermissionSchema = z.object({
|
|
21
21
|
agency_ids: z.array(z.string()),
|
package/package.json
CHANGED