@tmlmobilidade/types 20260126.1852.36 → 20260128.2320.17

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.
Files changed (150) hide show
  1. package/dist/_common/comment.d.ts +24 -24
  2. package/dist/_common/document.d.ts +3 -3
  3. package/dist/_common/document.js +1 -1
  4. package/dist/_common/status.d.ts +2 -2
  5. package/dist/_common/status.js +1 -1
  6. package/dist/_common/unix-timestamp.js +1 -0
  7. package/dist/agency.d.ts +6 -6
  8. package/dist/alerts/alert.d.ts +262 -0
  9. package/dist/alerts/alert.js +34 -0
  10. package/dist/alerts/cause-effect-map.d.ts +106 -0
  11. package/dist/alerts/cause-effect-map.js +94 -0
  12. package/dist/alerts/cause.d.ts +17 -0
  13. package/dist/alerts/cause.js +45 -0
  14. package/dist/alerts/effect.d.ts +17 -0
  15. package/dist/alerts/effect.js +35 -0
  16. package/dist/alerts/index.d.ts +6 -0
  17. package/dist/alerts/index.js +6 -0
  18. package/dist/alerts/query.d.ts +9 -0
  19. package/dist/alerts/query.js +6 -0
  20. package/dist/alerts/reference-type.d.ts +4 -0
  21. package/dist/alerts/reference-type.js +10 -0
  22. package/dist/apex/simplified-apex-location.d.ts +2 -12
  23. package/dist/apex/simplified-apex-location.js +1 -1
  24. package/dist/apex/simplified-apex-on-board-refund.d.ts +2 -12
  25. package/dist/apex/simplified-apex-on-board-refund.js +1 -1
  26. package/dist/apex/simplified-apex-on-board-sale.d.ts +12 -19
  27. package/dist/apex/simplified-apex-on-board-sale.js +2 -2
  28. package/dist/apex/simplified-apex-validation.d.ts +6 -16
  29. package/dist/apex/simplified-apex-validation.js +1 -1
  30. package/dist/auth/role.d.ts +718 -130
  31. package/dist/auth/session.d.ts +6 -6
  32. package/dist/auth/user.d.ts +1182 -270
  33. package/dist/auth/verification-token.d.ts +4 -4
  34. package/dist/calendar/event.d.ts +43 -0
  35. package/dist/calendar/event.js +16 -0
  36. package/dist/calendar/index.d.ts +1 -0
  37. package/dist/calendar/index.js +2 -0
  38. package/dist/dates/annotation.d.ts +6 -6
  39. package/dist/dates/date.d.ts +32 -0
  40. package/dist/dates/date.js +18 -0
  41. package/dist/dates/index.d.ts +2 -0
  42. package/dist/dates/index.js +2 -0
  43. package/dist/dates/period.d.ts +94 -0
  44. package/dist/dates/period.js +14 -0
  45. package/dist/file-exports/base.d.ts +9 -9
  46. package/dist/file-exports/file-exports.d.ts +7 -7
  47. package/dist/file-exports/ride-export.d.ts +14 -14
  48. package/dist/file-exports/ride-export.js +2 -2
  49. package/dist/gtfs/cause.d.ts +10 -0
  50. package/dist/gtfs/cause.js +18 -0
  51. package/dist/gtfs/effect.d.ts +10 -0
  52. package/dist/gtfs/effect.js +17 -0
  53. package/dist/gtfs/index.d.ts +2 -1
  54. package/dist/gtfs/index.js +2 -1
  55. package/dist/index.d.ts +5 -2
  56. package/dist/index.js +5 -2
  57. package/dist/locations/queries.d.ts +2 -2
  58. package/dist/metrics/demand/demand_by_agency.d.ts +8 -8
  59. package/dist/metrics/demand/demand_by_category.d.ts +12 -12
  60. package/dist/metrics/demand/demand_by_line.d.ts +4 -4
  61. package/dist/metrics/demand/demand_by_pattern.d.ts +8 -8
  62. package/dist/metrics/demand/demand_by_product.d.ts +12 -12
  63. package/dist/metrics/index.d.ts +93 -48
  64. package/dist/metrics/index.js +4 -1
  65. package/dist/metrics/passenger-impact/index.d.ts +1 -0
  66. package/dist/metrics/passenger-impact/index.js +1 -0
  67. package/dist/metrics/passenger-impact/passenger-impact.d.ts +97 -0
  68. package/dist/metrics/passenger-impact/passenger-impact.js +22 -0
  69. package/dist/metrics/supply/supply_by_agency.d.ts +4 -4
  70. package/dist/notification.d.ts +18 -18
  71. package/dist/offer/index.d.ts +5 -0
  72. package/dist/offer/index.js +5 -0
  73. package/dist/offer/line.d.ts +296 -0
  74. package/dist/offer/line.js +60 -0
  75. package/dist/offer/pattern.d.ts +3608 -0
  76. package/dist/offer/pattern.js +75 -0
  77. package/dist/offer/route.d.ts +187 -0
  78. package/dist/offer/route.js +33 -0
  79. package/dist/offer/scheduleRule.d.ts +80 -0
  80. package/dist/offer/scheduleRule.js +50 -0
  81. package/dist/offer/typology.d.ts +124 -0
  82. package/dist/offer/typology.js +30 -0
  83. package/dist/organization.d.ts +20 -20
  84. package/dist/permissions/alerts.d.ts +13 -19
  85. package/dist/permissions/alerts.js +8 -13
  86. package/dist/permissions/annotations.d.ts +25 -0
  87. package/dist/permissions/annotations.js +16 -0
  88. package/dist/permissions/fares.d.ts +25 -0
  89. package/dist/permissions/fares.js +16 -0
  90. package/dist/permissions/index.d.ts +196 -21
  91. package/dist/permissions/index.js +142 -6
  92. package/dist/permissions/lines.d.ts +25 -0
  93. package/dist/permissions/lines.js +16 -0
  94. package/dist/permissions/periods.d.ts +25 -0
  95. package/dist/permissions/periods.js +16 -0
  96. package/dist/permissions/typologies.d.ts +25 -0
  97. package/dist/permissions/typologies.js +16 -0
  98. package/dist/permissions/vehicles.d.ts +25 -0
  99. package/dist/permissions/vehicles.js +16 -0
  100. package/dist/permissions/zones.d.ts +25 -0
  101. package/dist/permissions/zones.js +16 -0
  102. package/dist/plans/gtfs-validation.d.ts +30 -30
  103. package/dist/plans/plan.d.ts +6 -6
  104. package/dist/proposed-change.d.ts +12 -12
  105. package/dist/rides/batch-query.d.ts +52 -0
  106. package/dist/rides/batch-query.js +54 -0
  107. package/dist/rides/index.d.ts +1 -0
  108. package/dist/rides/index.js +1 -0
  109. package/dist/rides/ride-acceptance.d.ts +105 -105
  110. package/dist/rides/ride-acceptance.js +2 -2
  111. package/dist/rides/ride-audit.d.ts +21 -21
  112. package/dist/rides/ride-normalized.d.ts +808 -21
  113. package/dist/rides/ride-normalized.js +31 -1
  114. package/dist/rides/ride.d.ts +6 -6
  115. package/dist/sams/sam.d.ts +0 -15
  116. package/dist/sams/sam.js +2 -2
  117. package/dist/stops/connections.d.ts +1 -0
  118. package/dist/stops/connections.js +1 -1
  119. package/dist/stops/equipment.d.ts +1 -0
  120. package/dist/stops/equipment.js +1 -1
  121. package/dist/stops/parent-station.d.ts +6 -6
  122. package/dist/stops/stop-area.d.ts +6 -6
  123. package/dist/stops/stop.d.ts +69 -69
  124. package/dist/ticketing/fare.d.ts +137 -0
  125. package/dist/ticketing/fare.js +44 -0
  126. package/dist/ticketing/index.d.ts +2 -0
  127. package/dist/ticketing/index.js +2 -0
  128. package/dist/ticketing/zone.d.ts +220 -0
  129. package/dist/ticketing/zone.js +34 -0
  130. package/dist/vehicle/emission.d.ts +3 -0
  131. package/dist/vehicle/emission.js +12 -0
  132. package/dist/vehicle/index.d.ts +4 -0
  133. package/dist/vehicle/index.js +4 -0
  134. package/dist/vehicle/propulsion.d.ts +3 -0
  135. package/dist/vehicle/propulsion.js +14 -0
  136. package/dist/vehicle/vehicle.d.ts +189 -0
  137. package/dist/vehicle/vehicle.js +27 -0
  138. package/dist/vehicle/wheelchair.d.ts +3 -0
  139. package/dist/vehicle/wheelchair.js +10 -0
  140. package/dist/vehicle-events/clickhouse-vehicle-event.d.ts +2 -6
  141. package/dist/vehicle-events/simplified-vehicle-event.d.ts +2 -6
  142. package/dist/vehicle-events/simplified-vehicle-event.js +1 -1
  143. package/dist/zone.d.ts +6 -6
  144. package/package.json +2 -2
  145. package/dist/alert.d.ts +0 -265
  146. package/dist/alert.js +0 -42
  147. package/dist/gtfs/cause-effetcs.d.ts +0 -86
  148. package/dist/gtfs/cause-effetcs.js +0 -31
  149. package/dist/permissions/dates.d.ts +0 -25
  150. package/dist/permissions/dates.js +0 -16
@@ -0,0 +1,34 @@
1
+ /* * */
2
+ import { DocumentSchema } from '../_common/document.js';
3
+ import { PublishStatusSchema } from '../_common/status.js';
4
+ import { UnixTimeStampSchema } from '../_common/unix-timestamp.js';
5
+ import { AlertCauseSchema } from './cause.js';
6
+ import { AlertEffectSchema } from './effect.js';
7
+ import { AlertReferenceTypeSchema } from './reference-type.js';
8
+ import { z } from 'zod';
9
+ /* * */
10
+ export const AlertSchema = DocumentSchema.extend({
11
+ active_period_end_date: UnixTimeStampSchema.nullable().default(null),
12
+ active_period_start_date: UnixTimeStampSchema,
13
+ agency_id: z.string(),
14
+ auto_texts: z.boolean().default(true),
15
+ cause: AlertCauseSchema,
16
+ coordinates: z.tuple([z.number(), z.number()]).nullable().default(null),
17
+ description: z.string(),
18
+ effect: AlertEffectSchema,
19
+ external_id: z.string().nullable().default(null),
20
+ file_id: z.string().nullable().default(null),
21
+ info_url: z.string().url().nullable().default(null),
22
+ municipality_ids: z.array(z.string()).default([]),
23
+ publish_end_date: UnixTimeStampSchema.nullable().default(null),
24
+ publish_start_date: UnixTimeStampSchema.nullable().default(null),
25
+ publish_status: PublishStatusSchema.default('draft'),
26
+ reference_type: AlertReferenceTypeSchema,
27
+ references: z.array(z.object({
28
+ child_ids: z.array(z.string()),
29
+ parent_id: z.string(),
30
+ })).default([]),
31
+ title: z.string(),
32
+ });
33
+ export const CreateAlertSchema = AlertSchema.omit({ _id: true, created_at: true, created_by: true, updated_at: true, updated_by: true });
34
+ export const UpdateAlertSchema = CreateAlertSchema.partial();
@@ -0,0 +1,106 @@
1
+ export declare const alertCauseEffectReferenceTypeMap: {
2
+ readonly ACCIDENT: {
3
+ readonly DETOUR: ["rides", "stops"];
4
+ readonly NO_SERVICE: ["rides", "lines"];
5
+ readonly REDUCED_SERVICE: ["rides", "lines"];
6
+ readonly SIGNIFICANT_DELAYS: ["rides", "agency", "lines"];
7
+ };
8
+ readonly CONSTRUCTION: {
9
+ readonly ACCESSIBILITY_ISSUE: ["rides", "lines", "stops"];
10
+ readonly DETOUR: ["rides", "lines", "stops"];
11
+ readonly NO_SERVICE: ["rides", "lines", "stops"];
12
+ readonly REDUCED_SERVICE: ["rides", "lines", "stops"];
13
+ readonly SIGNIFICANT_DELAYS: ["rides", "lines", "stops"];
14
+ readonly STOP_MOVED: ["stops"];
15
+ };
16
+ readonly DEMONSTRATION: {
17
+ readonly ACCESSIBILITY_ISSUE: ["rides"];
18
+ readonly ADDITIONAL_SERVICE: ["rides", "lines", "agency"];
19
+ readonly DETOUR: ["rides", "lines", "stops"];
20
+ readonly NO_SERVICE: ["rides", "lines", "stops"];
21
+ readonly REDUCED_SERVICE: ["rides", "lines", "stops"];
22
+ readonly SIGNIFICANT_DELAYS: ["rides", "lines", "stops", "agency"];
23
+ };
24
+ readonly DRIVER_ABSENCE: {
25
+ readonly NO_SERVICE: ["rides"];
26
+ readonly SIGNIFICANT_DELAYS: ["rides"];
27
+ };
28
+ readonly DRIVER_ISSUE: {
29
+ readonly DETOUR: ["rides"];
30
+ readonly NO_SERVICE: ["rides"];
31
+ readonly REDUCED_SERVICE: ["rides"];
32
+ readonly SIGNIFICANT_DELAYS: ["rides"];
33
+ };
34
+ readonly HIGH_PASSENGER_LOAD: {
35
+ readonly ACCESSIBILITY_ISSUE: ["rides"];
36
+ readonly ADDITIONAL_SERVICE: ["rides"];
37
+ readonly SIGNIFICANT_DELAYS: ["rides"];
38
+ };
39
+ readonly MEDICAL_EMERGENCY: {
40
+ readonly DETOUR: ["rides"];
41
+ readonly NO_SERVICE: ["rides"];
42
+ readonly REDUCED_SERVICE: ["rides"];
43
+ readonly SIGNIFICANT_DELAYS: ["rides"];
44
+ };
45
+ readonly POLICE_ACTIVITY: {
46
+ readonly DETOUR: ["rides", "lines"];
47
+ readonly NO_SERVICE: ["rides", "lines"];
48
+ readonly REDUCED_SERVICE: ["rides", "lines"];
49
+ readonly SIGNIFICANT_DELAYS: ["rides", "lines", "agency"];
50
+ };
51
+ readonly PUBLIC_DISORDER: {
52
+ readonly DETOUR: ["rides"];
53
+ readonly NO_SERVICE: ["rides"];
54
+ readonly REDUCED_SERVICE: ["rides"];
55
+ readonly SIGNIFICANT_DELAYS: ["rides"];
56
+ };
57
+ readonly ROAD_ISSUE: {
58
+ readonly ACCESSIBILITY_ISSUE: ["rides", "lines", "stops"];
59
+ readonly DETOUR: ["rides", "lines", "stops"];
60
+ readonly NO_SERVICE: ["rides", "lines", "stops"];
61
+ readonly REDUCED_SERVICE: ["rides", "lines", "stops"];
62
+ readonly SIGNIFICANT_DELAYS: ["rides", "lines", "stops"];
63
+ };
64
+ readonly STRIKE: {
65
+ readonly ADDITIONAL_SERVICE: ["lines", "stops", "agency"];
66
+ readonly DETOUR: ["rides", "lines", "stops"];
67
+ readonly NO_SERVICE: ["rides", "agency", "lines"];
68
+ readonly REDUCED_SERVICE: ["rides", "lines"];
69
+ readonly SIGNIFICANT_DELAYS: ["rides", "agency"];
70
+ };
71
+ readonly TECHNICAL_ISSUE: {
72
+ readonly ACCESSIBILITY_ISSUE: ["rides"];
73
+ readonly NO_SERVICE: ["rides"];
74
+ readonly ON_BOARD_SALE_ISSUE: ["rides"];
75
+ readonly REALTIME_INFO_ISSUE: ["rides", "agency"];
76
+ readonly REDUCED_SERVICE: ["rides"];
77
+ readonly SIGNIFICANT_DELAYS: ["rides", "agency"];
78
+ };
79
+ readonly TRAFFIC_JAM: {
80
+ readonly DETOUR: ["rides", "lines", "stops"];
81
+ readonly NO_SERVICE: ["rides"];
82
+ readonly REDUCED_SERVICE: ["rides"];
83
+ readonly SIGNIFICANT_DELAYS: ["rides", "agency", "lines", "stops"];
84
+ };
85
+ readonly WEATHER: {
86
+ readonly ACCESSIBILITY_ISSUE: ["rides", "lines", "stops"];
87
+ readonly DETOUR: ["rides", "lines", "stops"];
88
+ readonly NO_SERVICE: ["rides", "lines", "stops"];
89
+ readonly REDUCED_SERVICE: ["rides", "lines", "stops"];
90
+ readonly SIGNIFICANT_DELAYS: ["rides", "lines", "stops", "agency"];
91
+ };
92
+ };
93
+ type ReferenceTypes<C extends keyof typeof alertCauseEffectReferenceTypeMap, E extends keyof typeof alertCauseEffectReferenceTypeMap[C]> = (typeof alertCauseEffectReferenceTypeMap)[C][E] extends readonly (infer R)[] ? R & string : never;
94
+ type CauseEffectUnion<C extends keyof typeof alertCauseEffectReferenceTypeMap> = {
95
+ [E in keyof typeof alertCauseEffectReferenceTypeMap[C]]: `${C & string}:${E & string}:${ReferenceTypes<C, E>}`;
96
+ }[keyof typeof alertCauseEffectReferenceTypeMap[C]];
97
+ /**
98
+ * Type representing all valid combinations of alert causes with
99
+ * their corresponding effects and allowed reference types. Each combination
100
+ * is represented as a string in the format "CAUSE:EFFECT:REFERENCE_TYPE".
101
+ * This is useful for defining specific alert configurations based on cause-effect pairs.
102
+ */
103
+ export type AlertCauseEffectReference = {
104
+ [C in keyof typeof alertCauseEffectReferenceTypeMap]: CauseEffectUnion<C>;
105
+ }[keyof typeof alertCauseEffectReferenceTypeMap];
106
+ export {};
@@ -0,0 +1,94 @@
1
+ /* * */
2
+ /* * */
3
+ export const alertCauseEffectReferenceTypeMap = {
4
+ ACCIDENT: {
5
+ DETOUR: ['rides', 'stops'],
6
+ NO_SERVICE: ['rides', 'lines'],
7
+ REDUCED_SERVICE: ['rides', 'lines'],
8
+ SIGNIFICANT_DELAYS: ['rides', 'agency', 'lines'],
9
+ },
10
+ CONSTRUCTION: {
11
+ ACCESSIBILITY_ISSUE: ['rides', 'lines', 'stops'],
12
+ DETOUR: ['rides', 'lines', 'stops'],
13
+ NO_SERVICE: ['rides', 'lines', 'stops'],
14
+ REDUCED_SERVICE: ['rides', 'lines', 'stops'],
15
+ SIGNIFICANT_DELAYS: ['rides', 'lines', 'stops'],
16
+ STOP_MOVED: ['stops'],
17
+ },
18
+ DEMONSTRATION: {
19
+ ACCESSIBILITY_ISSUE: ['rides'],
20
+ ADDITIONAL_SERVICE: ['rides', 'lines', 'agency'],
21
+ DETOUR: ['rides', 'lines', 'stops'],
22
+ NO_SERVICE: ['rides', 'lines', 'stops'],
23
+ REDUCED_SERVICE: ['rides', 'lines', 'stops'],
24
+ SIGNIFICANT_DELAYS: ['rides', 'lines', 'stops', 'agency'],
25
+ },
26
+ DRIVER_ABSENCE: {
27
+ NO_SERVICE: ['rides'],
28
+ SIGNIFICANT_DELAYS: ['rides'],
29
+ },
30
+ DRIVER_ISSUE: {
31
+ DETOUR: ['rides'],
32
+ NO_SERVICE: ['rides'],
33
+ REDUCED_SERVICE: ['rides'],
34
+ SIGNIFICANT_DELAYS: ['rides'],
35
+ },
36
+ HIGH_PASSENGER_LOAD: {
37
+ ACCESSIBILITY_ISSUE: ['rides'],
38
+ ADDITIONAL_SERVICE: ['rides'],
39
+ SIGNIFICANT_DELAYS: ['rides'],
40
+ },
41
+ MEDICAL_EMERGENCY: {
42
+ DETOUR: ['rides'],
43
+ NO_SERVICE: ['rides'],
44
+ REDUCED_SERVICE: ['rides'],
45
+ SIGNIFICANT_DELAYS: ['rides'],
46
+ },
47
+ POLICE_ACTIVITY: {
48
+ DETOUR: ['rides', 'lines'],
49
+ NO_SERVICE: ['rides', 'lines'],
50
+ REDUCED_SERVICE: ['rides', 'lines'],
51
+ SIGNIFICANT_DELAYS: ['rides', 'lines', 'agency'],
52
+ },
53
+ PUBLIC_DISORDER: {
54
+ DETOUR: ['rides'],
55
+ NO_SERVICE: ['rides'],
56
+ REDUCED_SERVICE: ['rides'],
57
+ SIGNIFICANT_DELAYS: ['rides'],
58
+ },
59
+ ROAD_ISSUE: {
60
+ ACCESSIBILITY_ISSUE: ['rides', 'lines', 'stops'],
61
+ DETOUR: ['rides', 'lines', 'stops'],
62
+ NO_SERVICE: ['rides', 'lines', 'stops'],
63
+ REDUCED_SERVICE: ['rides', 'lines', 'stops'],
64
+ SIGNIFICANT_DELAYS: ['rides', 'lines', 'stops'],
65
+ },
66
+ STRIKE: {
67
+ ADDITIONAL_SERVICE: ['lines', 'stops', 'agency'],
68
+ DETOUR: ['rides', 'lines', 'stops'],
69
+ NO_SERVICE: ['rides', 'agency', 'lines'],
70
+ REDUCED_SERVICE: ['rides', 'lines'],
71
+ SIGNIFICANT_DELAYS: ['rides', 'agency'],
72
+ },
73
+ TECHNICAL_ISSUE: {
74
+ ACCESSIBILITY_ISSUE: ['rides'],
75
+ NO_SERVICE: ['rides'],
76
+ ON_BOARD_SALE_ISSUE: ['rides'],
77
+ REALTIME_INFO_ISSUE: ['rides', 'agency'],
78
+ REDUCED_SERVICE: ['rides'],
79
+ SIGNIFICANT_DELAYS: ['rides', 'agency'],
80
+ },
81
+ TRAFFIC_JAM: {
82
+ DETOUR: ['rides', 'lines', 'stops'],
83
+ NO_SERVICE: ['rides'],
84
+ REDUCED_SERVICE: ['rides'],
85
+ SIGNIFICANT_DELAYS: ['rides', 'agency', 'lines', 'stops'],
86
+ },
87
+ WEATHER: {
88
+ ACCESSIBILITY_ISSUE: ['rides', 'lines', 'stops'],
89
+ DETOUR: ['rides', 'lines', 'stops'],
90
+ NO_SERVICE: ['rides', 'lines', 'stops'],
91
+ REDUCED_SERVICE: ['rides', 'lines', 'stops'],
92
+ SIGNIFICANT_DELAYS: ['rides', 'lines', 'stops', 'agency'],
93
+ },
94
+ };
@@ -0,0 +1,17 @@
1
+ import { type GtfsCause } from '../gtfs/cause.js';
2
+ import z from 'zod';
3
+ export declare const AlertCauseValues: readonly ["ACCIDENT", "CONSTRUCTION", "DEMONSTRATION", "MEDICAL_EMERGENCY", "POLICE_ACTIVITY", "STRIKE", "TECHNICAL_ISSUE", "WEATHER", "DRIVER_ABSENCE", "DRIVER_ISSUE", "HIGH_PASSENGER_LOAD", "ROAD_ISSUE", "TRAFFIC_JAM", "PUBLIC_DISORDER"];
4
+ export declare const AlertCauseSchema: z.ZodEnum<["ACCIDENT", "CONSTRUCTION", "DEMONSTRATION", "MEDICAL_EMERGENCY", "POLICE_ACTIVITY", "STRIKE", "TECHNICAL_ISSUE", "WEATHER", "DRIVER_ABSENCE", "DRIVER_ISSUE", "HIGH_PASSENGER_LOAD", "ROAD_ISSUE", "TRAFFIC_JAM", "PUBLIC_DISORDER"]>;
5
+ /**
6
+ * The Alert extended cause types.
7
+ * This types represents the allowed values for the cause of a service alert
8
+ * in the application, which are a subset of the standard GTFS-RT causes and
9
+ * additional operational causes specific to the application's context.
10
+ */
11
+ export type AlertCause = z.infer<typeof AlertCauseSchema>;
12
+ /**
13
+ * Mapping from AlertCause to GtfsCause.
14
+ * This mapping is used to convert extended alert causes
15
+ * to their corresponding standard GTFS-RT cause types.
16
+ */
17
+ export declare const AlertCauseToGtfsCauseMap: Record<AlertCause, GtfsCause>;
@@ -0,0 +1,45 @@
1
+ /* * */
2
+ import z from 'zod';
3
+ /* * */
4
+ export const AlertCauseValues = [
5
+ //
6
+ // Standard
7
+ 'ACCIDENT',
8
+ 'CONSTRUCTION',
9
+ 'DEMONSTRATION',
10
+ 'MEDICAL_EMERGENCY',
11
+ 'POLICE_ACTIVITY',
12
+ 'STRIKE',
13
+ 'TECHNICAL_ISSUE',
14
+ 'WEATHER',
15
+ //
16
+ // Extended
17
+ 'DRIVER_ABSENCE',
18
+ 'DRIVER_ISSUE',
19
+ 'HIGH_PASSENGER_LOAD',
20
+ 'ROAD_ISSUE',
21
+ 'TRAFFIC_JAM',
22
+ 'PUBLIC_DISORDER',
23
+ ];
24
+ export const AlertCauseSchema = z.enum(AlertCauseValues);
25
+ /**
26
+ * Mapping from AlertCause to GtfsCause.
27
+ * This mapping is used to convert extended alert causes
28
+ * to their corresponding standard GTFS-RT cause types.
29
+ */
30
+ export const AlertCauseToGtfsCauseMap = {
31
+ ACCIDENT: 'ACCIDENT',
32
+ CONSTRUCTION: 'CONSTRUCTION',
33
+ DEMONSTRATION: 'DEMONSTRATION',
34
+ DRIVER_ABSENCE: 'OTHER_CAUSE',
35
+ DRIVER_ISSUE: 'OTHER_CAUSE',
36
+ HIGH_PASSENGER_LOAD: 'OTHER_CAUSE',
37
+ MEDICAL_EMERGENCY: 'MEDICAL_EMERGENCY',
38
+ POLICE_ACTIVITY: 'POLICE_ACTIVITY',
39
+ PUBLIC_DISORDER: 'OTHER_CAUSE',
40
+ ROAD_ISSUE: 'OTHER_CAUSE',
41
+ STRIKE: 'STRIKE',
42
+ TECHNICAL_ISSUE: 'TECHNICAL_ISSUE',
43
+ TRAFFIC_JAM: 'OTHER_CAUSE',
44
+ WEATHER: 'WEATHER',
45
+ };
@@ -0,0 +1,17 @@
1
+ import { type GtfsEffect } from '../gtfs/effect.js';
2
+ import z from 'zod';
3
+ export declare const AlertEffectValues: readonly ["ACCESSIBILITY_ISSUE", "ADDITIONAL_SERVICE", "DETOUR", "NO_SERVICE", "REDUCED_SERVICE", "SIGNIFICANT_DELAYS", "STOP_MOVED", "REALTIME_INFO_ISSUE", "ON_BOARD_SALE_ISSUE"];
4
+ export declare const AlertEffectSchema: z.ZodEnum<["ACCESSIBILITY_ISSUE", "ADDITIONAL_SERVICE", "DETOUR", "NO_SERVICE", "REDUCED_SERVICE", "SIGNIFICANT_DELAYS", "STOP_MOVED", "REALTIME_INFO_ISSUE", "ON_BOARD_SALE_ISSUE"]>;
5
+ /**
6
+ * The Alert extended effect types.
7
+ * This types represents the allowed values for the effect of a service alert
8
+ * in the application, which are a subset of the standard GTFS-RT effects and
9
+ * additional operational effects specific to the application's context.
10
+ */
11
+ export type AlertEffect = z.infer<typeof AlertEffectSchema>;
12
+ /**
13
+ * Mapping from AlertEffect to GtfsEffect.
14
+ * This mapping is used to convert extended alert effects
15
+ * to their corresponding standard GTFS-RT effect types.
16
+ */
17
+ export declare const AlertEffectToGtfsEffectMap: Record<AlertEffect, GtfsEffect>;
@@ -0,0 +1,35 @@
1
+ /* * */
2
+ import z from 'zod';
3
+ /* * */
4
+ export const AlertEffectValues = [
5
+ //
6
+ // Standard
7
+ 'ACCESSIBILITY_ISSUE',
8
+ 'ADDITIONAL_SERVICE',
9
+ 'DETOUR',
10
+ 'NO_SERVICE',
11
+ 'REDUCED_SERVICE',
12
+ 'SIGNIFICANT_DELAYS',
13
+ 'STOP_MOVED',
14
+ //
15
+ // Extended
16
+ 'REALTIME_INFO_ISSUE',
17
+ 'ON_BOARD_SALE_ISSUE',
18
+ ];
19
+ export const AlertEffectSchema = z.enum(AlertEffectValues);
20
+ /**
21
+ * Mapping from AlertEffect to GtfsEffect.
22
+ * This mapping is used to convert extended alert effects
23
+ * to their corresponding standard GTFS-RT effect types.
24
+ */
25
+ export const AlertEffectToGtfsEffectMap = {
26
+ ACCESSIBILITY_ISSUE: 'ACCESSIBILITY_ISSUE',
27
+ ADDITIONAL_SERVICE: 'ADDITIONAL_SERVICE',
28
+ DETOUR: 'DETOUR',
29
+ NO_SERVICE: 'NO_SERVICE',
30
+ ON_BOARD_SALE_ISSUE: 'OTHER_EFFECT',
31
+ REALTIME_INFO_ISSUE: 'OTHER_EFFECT',
32
+ REDUCED_SERVICE: 'REDUCED_SERVICE',
33
+ SIGNIFICANT_DELAYS: 'SIGNIFICANT_DELAYS',
34
+ STOP_MOVED: 'STOP_MOVED',
35
+ };
@@ -0,0 +1,6 @@
1
+ export * from './alert.js';
2
+ export * from './cause-effect-map.js';
3
+ export * from './cause.js';
4
+ export * from './effect.js';
5
+ export * from './query.js';
6
+ export * from './reference-type.js';
@@ -0,0 +1,6 @@
1
+ export * from './alert.js';
2
+ export * from './cause-effect-map.js';
3
+ export * from './cause.js';
4
+ export * from './effect.js';
5
+ export * from './query.js';
6
+ export * from './reference-type.js';
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+ export declare const GetAllAlertsQuerySchema: z.ZodObject<{
3
+ realtime: z.ZodEffects<z.ZodBoolean, boolean, unknown>;
4
+ }, "strip", z.ZodTypeAny, {
5
+ realtime: boolean;
6
+ }, {
7
+ realtime?: unknown;
8
+ }>;
9
+ export type GetAllAlertsQuery = z.infer<typeof GetAllAlertsQuerySchema>;
@@ -0,0 +1,6 @@
1
+ /* * */
2
+ import { z } from 'zod';
3
+ /* * */
4
+ export const GetAllAlertsQuerySchema = z.object({
5
+ realtime: z.preprocess((val) => val === 'true' || val === '1', z.boolean()),
6
+ });
@@ -0,0 +1,4 @@
1
+ import { z } from 'zod';
2
+ export declare const AlertReferenceTypeValues: readonly ["agency", "lines", "stops", "rides"];
3
+ export declare const AlertReferenceTypeSchema: z.ZodEnum<["agency", "lines", "stops", "rides"]>;
4
+ export type AlertReferenceType = z.infer<typeof AlertReferenceTypeSchema>;
@@ -0,0 +1,10 @@
1
+ /* * */
2
+ import { z } from 'zod';
3
+ /* * */
4
+ export const AlertReferenceTypeValues = [
5
+ 'agency',
6
+ 'lines',
7
+ 'stops',
8
+ 'rides',
9
+ ];
10
+ export const AlertReferenceTypeSchema = z.enum(AlertReferenceTypeValues);
@@ -2,11 +2,11 @@ import { z } from 'zod';
2
2
  export declare const SimplifiedApexLocationSchema: z.ZodObject<Omit<{
3
3
  _id: z.ZodString;
4
4
  created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
5
- created_by: z.ZodOptional<z.ZodString>;
5
+ created_by: z.ZodDefault<z.ZodNullable<z.ZodString>>;
6
6
  is_locked: z.ZodDefault<z.ZodBoolean>;
7
7
  updated_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
8
8
  updated_by: z.ZodOptional<z.ZodString>;
9
- }, "is_locked"> & {
9
+ }, "created_by" | "is_locked" | "updated_by"> & {
10
10
  agency_id: z.ZodString;
11
11
  apex_version: z.ZodString;
12
12
  device_id: z.ZodString;
@@ -39,8 +39,6 @@ export declare const SimplifiedApexLocationSchema: z.ZodObject<Omit<{
39
39
  stop_id: string;
40
40
  trip_id: string;
41
41
  vehicle_id: number;
42
- created_by?: string | undefined;
43
- updated_by?: string | undefined;
44
42
  }, {
45
43
  _id: string;
46
44
  created_at: number;
@@ -56,15 +54,11 @@ export declare const SimplifiedApexLocationSchema: z.ZodObject<Omit<{
56
54
  stop_id: string;
57
55
  trip_id: string;
58
56
  vehicle_id: number;
59
- created_by?: string | undefined;
60
- updated_by?: string | undefined;
61
57
  }>;
62
58
  export declare const UpdateSimplifiedApexLocationSchema: z.ZodObject<{
63
59
  _id: z.ZodOptional<z.ZodString>;
64
60
  created_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
65
- created_by: z.ZodOptional<z.ZodOptional<z.ZodString>>;
66
61
  updated_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
67
- updated_by: z.ZodOptional<z.ZodOptional<z.ZodString>>;
68
62
  agency_id: z.ZodOptional<z.ZodString>;
69
63
  apex_version: z.ZodOptional<z.ZodString>;
70
64
  device_id: z.ZodOptional<z.ZodString>;
@@ -79,9 +73,7 @@ export declare const UpdateSimplifiedApexLocationSchema: z.ZodObject<{
79
73
  }, "strip", z.ZodTypeAny, {
80
74
  _id?: string | undefined;
81
75
  created_at?: import("../_common/unix-timestamp.js").UnixTimestamp | undefined;
82
- created_by?: string | undefined;
83
76
  updated_at?: import("../_common/unix-timestamp.js").UnixTimestamp | undefined;
84
- updated_by?: string | undefined;
85
77
  agency_id?: string | undefined;
86
78
  apex_version?: string | undefined;
87
79
  device_id?: string | undefined;
@@ -96,9 +88,7 @@ export declare const UpdateSimplifiedApexLocationSchema: z.ZodObject<{
96
88
  }, {
97
89
  _id?: string | undefined;
98
90
  created_at?: number | undefined;
99
- created_by?: string | undefined;
100
91
  updated_at?: number | undefined;
101
- updated_by?: string | undefined;
102
92
  agency_id?: string | undefined;
103
93
  apex_version?: string | undefined;
104
94
  device_id?: string | undefined;
@@ -4,7 +4,7 @@ import { UnixTimeStampSchema } from '../_common/unix-timestamp.js';
4
4
  import { z } from 'zod';
5
5
  /* * */
6
6
  export const SimplifiedApexLocationSchema = DocumentSchema
7
- .omit({ is_locked: true })
7
+ .omit({ created_by: true, is_locked: true, updated_by: true })
8
8
  .extend({
9
9
  agency_id: z.string(),
10
10
  apex_version: z.string(),
@@ -2,11 +2,11 @@ import { z } from 'zod';
2
2
  export declare const SimplifiedApexOnBoardRefundSchema: z.ZodObject<Omit<{
3
3
  _id: z.ZodString;
4
4
  created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
5
- created_by: z.ZodOptional<z.ZodString>;
5
+ created_by: z.ZodDefault<z.ZodNullable<z.ZodString>>;
6
6
  is_locked: z.ZodDefault<z.ZodBoolean>;
7
7
  updated_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
8
8
  updated_by: z.ZodOptional<z.ZodString>;
9
- }, "is_locked"> & {
9
+ }, "created_by" | "is_locked" | "updated_by"> & {
10
10
  agency_id: z.ZodString;
11
11
  apex_version: z.ZodString;
12
12
  block_id: z.ZodNullable<z.ZodString>;
@@ -59,8 +59,6 @@ export declare const SimplifiedApexOnBoardRefundSchema: z.ZodObject<Omit<{
59
59
  product_long_id: string;
60
60
  product_quantity: number;
61
61
  validation_id: string | null;
62
- created_by?: string | undefined;
63
- updated_by?: string | undefined;
64
62
  }, {
65
63
  _id: string;
66
64
  created_at: number;
@@ -86,15 +84,11 @@ export declare const SimplifiedApexOnBoardRefundSchema: z.ZodObject<Omit<{
86
84
  product_long_id: string;
87
85
  product_quantity: number;
88
86
  validation_id: string | null;
89
- created_by?: string | undefined;
90
- updated_by?: string | undefined;
91
87
  }>;
92
88
  export declare const UpdateSimplifiedApexOnBoardRefundSchema: z.ZodObject<{
93
89
  _id: z.ZodOptional<z.ZodString>;
94
90
  created_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
95
- created_by: z.ZodOptional<z.ZodOptional<z.ZodString>>;
96
91
  updated_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
97
- updated_by: z.ZodOptional<z.ZodOptional<z.ZodString>>;
98
92
  agency_id: z.ZodOptional<z.ZodString>;
99
93
  apex_version: z.ZodOptional<z.ZodString>;
100
94
  block_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -119,9 +113,7 @@ export declare const UpdateSimplifiedApexOnBoardRefundSchema: z.ZodObject<{
119
113
  }, "strip", z.ZodTypeAny, {
120
114
  _id?: string | undefined;
121
115
  created_at?: import("../_common/unix-timestamp.js").UnixTimestamp | undefined;
122
- created_by?: string | undefined;
123
116
  updated_at?: import("../_common/unix-timestamp.js").UnixTimestamp | undefined;
124
- updated_by?: string | undefined;
125
117
  agency_id?: string | undefined;
126
118
  apex_version?: string | undefined;
127
119
  device_id?: string | undefined;
@@ -146,9 +138,7 @@ export declare const UpdateSimplifiedApexOnBoardRefundSchema: z.ZodObject<{
146
138
  }, {
147
139
  _id?: string | undefined;
148
140
  created_at?: number | undefined;
149
- created_by?: string | undefined;
150
141
  updated_at?: number | undefined;
151
- updated_by?: string | undefined;
152
142
  agency_id?: string | undefined;
153
143
  apex_version?: string | undefined;
154
144
  device_id?: string | undefined;
@@ -4,7 +4,7 @@ import { UnixTimeStampSchema } from '../_common/unix-timestamp.js';
4
4
  import { z } from 'zod';
5
5
  /* * */
6
6
  export const SimplifiedApexOnBoardRefundSchema = DocumentSchema
7
- .omit({ is_locked: true })
7
+ .omit({ created_by: true, is_locked: true, updated_by: true })
8
8
  .extend({
9
9
  agency_id: z.string(),
10
10
  apex_version: z.string(),
@@ -2,11 +2,11 @@ import { z } from 'zod';
2
2
  export declare const SimplifiedApexOnBoardSaleSchema: z.ZodObject<Omit<{
3
3
  _id: z.ZodString;
4
4
  created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
5
- created_by: z.ZodOptional<z.ZodString>;
5
+ created_by: z.ZodDefault<z.ZodNullable<z.ZodString>>;
6
6
  is_locked: z.ZodDefault<z.ZodBoolean>;
7
7
  updated_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
8
8
  updated_by: z.ZodOptional<z.ZodString>;
9
- }, "is_locked"> & {
9
+ }, "created_by" | "is_locked" | "updated_by"> & {
10
10
  agency_id: z.ZodString;
11
11
  apex_version: z.ZodString;
12
12
  block_id: z.ZodNullable<z.ZodString>;
@@ -61,8 +61,6 @@ export declare const SimplifiedApexOnBoardSaleSchema: z.ZodObject<Omit<{
61
61
  validation_id: string | null;
62
62
  is_passenger: boolean;
63
63
  on_board_refund_id: string | null;
64
- created_by?: string | undefined;
65
- updated_by?: string | undefined;
66
64
  }, {
67
65
  _id: string;
68
66
  created_at: number;
@@ -89,41 +87,37 @@ export declare const SimplifiedApexOnBoardSaleSchema: z.ZodObject<Omit<{
89
87
  validation_id: string | null;
90
88
  is_passenger: boolean;
91
89
  on_board_refund_id: string | null;
92
- created_by?: string | undefined;
93
- updated_by?: string | undefined;
94
90
  }>;
95
91
  export declare const UpdateSimplifiedApexOnBoardSaleSchema: z.ZodObject<{
96
92
  _id: z.ZodOptional<z.ZodString>;
97
93
  created_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
98
94
  updated_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
99
- updated_by: z.ZodOptional<z.ZodOptional<z.ZodString>>;
100
95
  agency_id: z.ZodOptional<z.ZodString>;
101
96
  apex_version: z.ZodOptional<z.ZodString>;
97
+ block_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
98
+ card_physical_type: z.ZodOptional<z.ZodNumber>;
99
+ card_serial_number: z.ZodOptional<z.ZodString>;
102
100
  device_id: z.ZodOptional<z.ZodString>;
101
+ duty_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
102
+ is_passenger: z.ZodOptional<z.ZodBoolean>;
103
103
  line_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
104
104
  mac_ase_counter_value: z.ZodOptional<z.ZodNumber>;
105
105
  mac_sam_serial_number: z.ZodOptional<z.ZodNumber>;
106
+ on_board_refund_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
106
107
  pattern_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
107
- received_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
108
- stop_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
109
- trip_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
110
- vehicle_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
111
- block_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
112
- card_physical_type: z.ZodOptional<z.ZodNumber>;
113
- card_serial_number: z.ZodOptional<z.ZodString>;
114
- duty_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
115
108
  payment_method: z.ZodOptional<z.ZodNumber>;
116
109
  price: z.ZodOptional<z.ZodNumber>;
117
110
  product_long_id: z.ZodOptional<z.ZodString>;
118
111
  product_quantity: z.ZodOptional<z.ZodNumber>;
112
+ received_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
113
+ stop_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
114
+ trip_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
119
115
  validation_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
120
- is_passenger: z.ZodOptional<z.ZodBoolean>;
121
- on_board_refund_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
116
+ vehicle_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
122
117
  }, "strip", z.ZodTypeAny, {
123
118
  _id?: string | undefined;
124
119
  created_at?: import("../_common/unix-timestamp.js").UnixTimestamp | undefined;
125
120
  updated_at?: import("../_common/unix-timestamp.js").UnixTimestamp | undefined;
126
- updated_by?: string | undefined;
127
121
  agency_id?: string | undefined;
128
122
  apex_version?: string | undefined;
129
123
  device_id?: string | undefined;
@@ -150,7 +144,6 @@ export declare const UpdateSimplifiedApexOnBoardSaleSchema: z.ZodObject<{
150
144
  _id?: string | undefined;
151
145
  created_at?: number | undefined;
152
146
  updated_at?: number | undefined;
153
- updated_by?: string | undefined;
154
147
  agency_id?: string | undefined;
155
148
  apex_version?: string | undefined;
156
149
  device_id?: string | undefined;
@@ -4,7 +4,7 @@ import { UnixTimeStampSchema } from '../_common/unix-timestamp.js';
4
4
  import { z } from 'zod';
5
5
  /* * */
6
6
  export const SimplifiedApexOnBoardSaleSchema = DocumentSchema
7
- .omit({ is_locked: true })
7
+ .omit({ created_by: true, is_locked: true, updated_by: true })
8
8
  .extend({
9
9
  agency_id: z.string(),
10
10
  apex_version: z.string(),
@@ -29,4 +29,4 @@ export const SimplifiedApexOnBoardSaleSchema = DocumentSchema
29
29
  validation_id: z.string().nullable(),
30
30
  vehicle_id: z.number().nullable(),
31
31
  });
32
- export const UpdateSimplifiedApexOnBoardSaleSchema = SimplifiedApexOnBoardSaleSchema.omit({ created_by: true }).partial();
32
+ export const UpdateSimplifiedApexOnBoardSaleSchema = SimplifiedApexOnBoardSaleSchema.partial();