@tmlmobilidade/types 20260531.1435.46 → 20260601.2.32
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/alerts/alert.js +2 -4
- package/dist/alerts/index.d.ts +1 -1
- package/dist/alerts/index.js +1 -1
- package/dist/alerts/{references.d.ts → reference.d.ts} +3 -3
- package/dist/alerts/{references.js → reference.js} +2 -2
- package/dist/hub/alerts.d.ts +82 -0
- package/dist/hub/alerts.js +20 -0
- package/dist/hub/index.d.ts +2 -0
- package/dist/hub/index.js +2 -0
- package/dist/hub/stop.d.ts +351 -0
- package/dist/hub/stop.js +23 -0
- package/package.json +1 -1
package/dist/alerts/alert.js
CHANGED
|
@@ -5,6 +5,7 @@ import { UnixTimestampSchema } from '../_common/unix-timestamp.js';
|
|
|
5
5
|
import { AlertCauseSchema } from './cause.js';
|
|
6
6
|
import { AlertEffectSchema } from './effect.js';
|
|
7
7
|
import { AlertReferenceTypeSchema } from './reference-type.js';
|
|
8
|
+
import { AlertReferenceSchema } from './reference.js';
|
|
8
9
|
import { z } from 'zod';
|
|
9
10
|
/* * */
|
|
10
11
|
export const AlertSchema = DocumentSchema.extend({
|
|
@@ -24,10 +25,7 @@ export const AlertSchema = DocumentSchema.extend({
|
|
|
24
25
|
publish_start_date: UnixTimestampSchema.nullable().default(null),
|
|
25
26
|
publish_status: PublishStatusSchema.default('draft'),
|
|
26
27
|
reference_type: AlertReferenceTypeSchema,
|
|
27
|
-
references: z.array(
|
|
28
|
-
child_ids: z.array(z.string()),
|
|
29
|
-
parent_id: z.string(),
|
|
30
|
-
})).default([]),
|
|
28
|
+
references: z.array(AlertReferenceSchema).default([]),
|
|
31
29
|
title: z.string(),
|
|
32
30
|
user_instructions: z.string().default(''),
|
|
33
31
|
});
|
package/dist/alerts/index.d.ts
CHANGED
package/dist/alerts/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const AlertReferenceSchema: z.ZodObject<{
|
|
3
3
|
child_ids: z.ZodArray<z.ZodString, "many">;
|
|
4
4
|
parent_id: z.ZodString;
|
|
5
5
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -8,5 +8,5 @@ export declare const AlertReferencesSchema: z.ZodDefault<z.ZodArray<z.ZodObject<
|
|
|
8
8
|
}, {
|
|
9
9
|
child_ids: string[];
|
|
10
10
|
parent_id: string;
|
|
11
|
-
}
|
|
12
|
-
export type
|
|
11
|
+
}>;
|
|
12
|
+
export type AlertReference = z.infer<typeof AlertReferenceSchema>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const HubAlertSchema: z.ZodObject<Omit<{
|
|
3
|
+
_id: z.ZodString;
|
|
4
|
+
created_at: z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>;
|
|
5
|
+
created_by: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
6
|
+
is_locked: z.ZodDefault<z.ZodBoolean>;
|
|
7
|
+
updated_at: z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>;
|
|
8
|
+
updated_by: z.ZodOptional<z.ZodString>;
|
|
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>;
|
|
12
|
+
agency_id: z.ZodString;
|
|
13
|
+
auto_texts: z.ZodDefault<z.ZodBoolean>;
|
|
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"]>;
|
|
15
|
+
coordinates: z.ZodDefault<z.ZodNullable<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
|
|
16
|
+
description: z.ZodString;
|
|
17
|
+
effect: z.ZodEnum<["ACCESSIBILITY_ISSUE", "ADDITIONAL_SERVICE", "DETOUR", "MODIFIED_SERVICE", "NO_SERVICE", "REDUCED_SERVICE", "SIGNIFICANT_DELAYS", "STOP_MOVED", "REALTIME_INFO_ISSUE", "ON_BOARD_SALE_ISSUE"]>;
|
|
18
|
+
external_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
19
|
+
file_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
20
|
+
info_url: z.ZodDefault<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>>>;
|
|
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>>>;
|
|
24
|
+
publish_status: z.ZodDefault<z.ZodEnum<["published", "archived", "draft"]>>;
|
|
25
|
+
reference_type: z.ZodEnum<["agency", "lines", "stops", "rides"]>;
|
|
26
|
+
references: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
27
|
+
child_ids: z.ZodArray<z.ZodString, "many">;
|
|
28
|
+
parent_id: z.ZodString;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
child_ids: string[];
|
|
31
|
+
parent_id: string;
|
|
32
|
+
}, {
|
|
33
|
+
child_ids: string[];
|
|
34
|
+
parent_id: string;
|
|
35
|
+
}>, "many">>;
|
|
36
|
+
title: z.ZodString;
|
|
37
|
+
user_instructions: z.ZodDefault<z.ZodString>;
|
|
38
|
+
}, "created_at" | "created_by" | "is_locked" | "updated_at" | "updated_by" | "auto_texts" | "external_id" | "file_id" | "publish_end_date" | "publish_start_date" | "publish_status" | "user_instructions"> & {
|
|
39
|
+
image_url: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
40
|
+
}, "strip", z.ZodTypeAny, {
|
|
41
|
+
_id: string;
|
|
42
|
+
description: string;
|
|
43
|
+
active_period_end_date: import("../index.js").UnixTimestamp | null;
|
|
44
|
+
active_period_start_date: number & {
|
|
45
|
+
__brand: "UnixTimestamp";
|
|
46
|
+
};
|
|
47
|
+
agency_id: string;
|
|
48
|
+
cause: "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";
|
|
49
|
+
coordinates: [number, number] | null;
|
|
50
|
+
effect: "ACCESSIBILITY_ISSUE" | "ADDITIONAL_SERVICE" | "DETOUR" | "MODIFIED_SERVICE" | "NO_SERVICE" | "REDUCED_SERVICE" | "SIGNIFICANT_DELAYS" | "STOP_MOVED" | "REALTIME_INFO_ISSUE" | "ON_BOARD_SALE_ISSUE";
|
|
51
|
+
info_url: string | null;
|
|
52
|
+
municipality_ids: string[];
|
|
53
|
+
reference_type: "agency" | "lines" | "stops" | "rides";
|
|
54
|
+
references: {
|
|
55
|
+
child_ids: string[];
|
|
56
|
+
parent_id: string;
|
|
57
|
+
}[];
|
|
58
|
+
title: string;
|
|
59
|
+
image_url: string | null;
|
|
60
|
+
}, {
|
|
61
|
+
_id: string;
|
|
62
|
+
description: string;
|
|
63
|
+
active_period_start_date: number;
|
|
64
|
+
agency_id: string;
|
|
65
|
+
cause: "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";
|
|
66
|
+
effect: "ACCESSIBILITY_ISSUE" | "ADDITIONAL_SERVICE" | "DETOUR" | "MODIFIED_SERVICE" | "NO_SERVICE" | "REDUCED_SERVICE" | "SIGNIFICANT_DELAYS" | "STOP_MOVED" | "REALTIME_INFO_ISSUE" | "ON_BOARD_SALE_ISSUE";
|
|
67
|
+
reference_type: "agency" | "lines" | "stops" | "rides";
|
|
68
|
+
title: string;
|
|
69
|
+
active_period_end_date?: number | null | undefined;
|
|
70
|
+
coordinates?: [number, number] | null | undefined;
|
|
71
|
+
info_url?: string | null | undefined;
|
|
72
|
+
municipality_ids?: string[] | undefined;
|
|
73
|
+
references?: {
|
|
74
|
+
child_ids: string[];
|
|
75
|
+
parent_id: string;
|
|
76
|
+
}[] | undefined;
|
|
77
|
+
image_url?: string | null | undefined;
|
|
78
|
+
}>;
|
|
79
|
+
/**
|
|
80
|
+
* Publishable alert data for the Hub Alerts API.
|
|
81
|
+
*/
|
|
82
|
+
export type HubAlert = z.infer<typeof HubAlertSchema>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { AlertSchema } from '../alerts/alert.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
/* * */
|
|
5
|
+
export const HubAlertSchema = AlertSchema.omit({
|
|
6
|
+
auto_texts: true,
|
|
7
|
+
created_at: true,
|
|
8
|
+
created_by: true,
|
|
9
|
+
external_id: true,
|
|
10
|
+
file_id: true,
|
|
11
|
+
is_locked: true,
|
|
12
|
+
publish_end_date: true,
|
|
13
|
+
publish_start_date: true,
|
|
14
|
+
publish_status: true,
|
|
15
|
+
updated_at: true,
|
|
16
|
+
updated_by: true,
|
|
17
|
+
user_instructions: true,
|
|
18
|
+
}).extend({
|
|
19
|
+
image_url: z.string().nullable().default(null),
|
|
20
|
+
});
|
package/dist/hub/index.d.ts
CHANGED
package/dist/hub/index.js
CHANGED
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const HubStopSchema: z.ZodObject<Pick<{
|
|
3
|
+
created_at: z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>;
|
|
4
|
+
created_by: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
5
|
+
is_locked: z.ZodDefault<z.ZodBoolean>;
|
|
6
|
+
updated_at: z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>;
|
|
7
|
+
updated_by: z.ZodOptional<z.ZodString>;
|
|
8
|
+
} & {
|
|
9
|
+
_id: z.ZodNumber;
|
|
10
|
+
flags: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
11
|
+
agency_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
12
|
+
is_harmonized: z.ZodDefault<z.ZodBoolean>;
|
|
13
|
+
short_name: z.ZodString;
|
|
14
|
+
stop_id: z.ZodString;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
short_name: string;
|
|
17
|
+
stop_id: string;
|
|
18
|
+
agency_ids: string[];
|
|
19
|
+
is_harmonized: boolean;
|
|
20
|
+
}, {
|
|
21
|
+
short_name: string;
|
|
22
|
+
stop_id: string;
|
|
23
|
+
agency_ids?: string[] | undefined;
|
|
24
|
+
is_harmonized?: boolean | undefined;
|
|
25
|
+
}>, "many">>;
|
|
26
|
+
is_deleted: z.ZodDefault<z.ZodBoolean>;
|
|
27
|
+
jurisdiction: z.ZodDefault<z.ZodEnum<["ip", "municipality", "other", "unknown"]>>;
|
|
28
|
+
legacy_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
29
|
+
legacy_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
30
|
+
lifecycle_status: z.ZodDefault<z.ZodEnum<["draft", "active", "inactive", "provisional", "seasonal", "voided"]>>;
|
|
31
|
+
name: z.ZodString;
|
|
32
|
+
new_name: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
33
|
+
previous_go_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
34
|
+
short_name: z.ZodString;
|
|
35
|
+
tts_name: z.ZodString;
|
|
36
|
+
district_id: z.ZodString;
|
|
37
|
+
latitude: z.ZodNumber;
|
|
38
|
+
locality_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
39
|
+
longitude: z.ZodNumber;
|
|
40
|
+
municipality_id: z.ZodString;
|
|
41
|
+
parish_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
42
|
+
bench_status: z.ZodDefault<z.ZodEnum<["not_applicable", "unknown", "missing", "damaged", "ok"]>>;
|
|
43
|
+
electricity_status: z.ZodDefault<z.ZodEnum<["available", "unavailable", "unknown"]>>;
|
|
44
|
+
pole_status: z.ZodDefault<z.ZodEnum<["not_applicable", "unknown", "missing", "damaged", "ok"]>>;
|
|
45
|
+
road_type: z.ZodDefault<z.ZodEnum<["complementary_itinerary", "highway", "main_itinerary", "national_road", "regional_road", "secondary_road", "unknown"]>>;
|
|
46
|
+
shelter_code: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
47
|
+
shelter_frame_size: z.ZodDefault<z.ZodNullable<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
|
|
48
|
+
shelter_installation_date: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>>>;
|
|
49
|
+
shelter_maintainer: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
50
|
+
shelter_make: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
51
|
+
shelter_model: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
52
|
+
shelter_status: z.ZodDefault<z.ZodEnum<["not_applicable", "unknown", "missing", "damaged", "ok"]>>;
|
|
53
|
+
last_infrastructure_check: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>>>;
|
|
54
|
+
last_infrastructure_maintenance: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>>>;
|
|
55
|
+
last_schedules_check: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>>>;
|
|
56
|
+
last_schedules_maintenance: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>>>;
|
|
57
|
+
connections: z.ZodDefault<z.ZodArray<z.ZodEnum<["ferry", "light_rail", "subway", "train", "boat", "airport", "bike_sharing", "bike_parking", "car_parking"]>, "many">>;
|
|
58
|
+
facilities: z.ZodDefault<z.ZodArray<z.ZodEnum<["fire_station", "health_clinic", "historic_building", "hospital", "police_station", "school", "shopping", "transit_office", "university", "beach"]>, "many">>;
|
|
59
|
+
equipment: z.ZodDefault<z.ZodArray<z.ZodEnum<["pip", "mupi", "mini_pip"]>, "many">>;
|
|
60
|
+
has_bench: z.ZodDefault<z.ZodEnum<["available", "unavailable", "unknown"]>>;
|
|
61
|
+
has_mupi: z.ZodDefault<z.ZodEnum<["available", "unavailable", "unknown"]>>;
|
|
62
|
+
has_network_map: z.ZodDefault<z.ZodEnum<["available", "unavailable", "unknown"]>>;
|
|
63
|
+
has_schedules: z.ZodDefault<z.ZodEnum<["available", "unavailable", "unknown"]>>;
|
|
64
|
+
has_shelter: z.ZodDefault<z.ZodEnum<["available", "unavailable", "unknown"]>>;
|
|
65
|
+
has_stop_sign: z.ZodDefault<z.ZodEnum<["available", "unavailable", "unknown"]>>;
|
|
66
|
+
file_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
67
|
+
image_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
68
|
+
comments: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
69
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
70
|
+
created_at: z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>;
|
|
71
|
+
created_by: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
72
|
+
updated_at: z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>;
|
|
73
|
+
updated_by: z.ZodOptional<z.ZodString>;
|
|
74
|
+
message: z.ZodString;
|
|
75
|
+
type: z.ZodLiteral<"note">;
|
|
76
|
+
}, "strip", z.ZodTypeAny, {
|
|
77
|
+
created_at: number & {
|
|
78
|
+
__brand: "UnixTimestamp";
|
|
79
|
+
};
|
|
80
|
+
created_by: string | null;
|
|
81
|
+
updated_at: number & {
|
|
82
|
+
__brand: "UnixTimestamp";
|
|
83
|
+
};
|
|
84
|
+
message: string;
|
|
85
|
+
type: "note";
|
|
86
|
+
_id?: string | undefined;
|
|
87
|
+
updated_by?: string | undefined;
|
|
88
|
+
}, {
|
|
89
|
+
created_at: number;
|
|
90
|
+
updated_at: number;
|
|
91
|
+
message: string;
|
|
92
|
+
type: "note";
|
|
93
|
+
_id?: string | undefined;
|
|
94
|
+
created_by?: string | null | undefined;
|
|
95
|
+
updated_by?: string | undefined;
|
|
96
|
+
}>, z.ZodObject<{
|
|
97
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
98
|
+
created_at: z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>;
|
|
99
|
+
created_by: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
100
|
+
updated_at: z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>;
|
|
101
|
+
updated_by: z.ZodOptional<z.ZodString>;
|
|
102
|
+
type: z.ZodLiteral<"field_changed">;
|
|
103
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
104
|
+
changes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
105
|
+
curr_value: z.ZodAny;
|
|
106
|
+
field: z.ZodString;
|
|
107
|
+
prev_value: z.ZodAny;
|
|
108
|
+
}, "strip", z.ZodTypeAny, {
|
|
109
|
+
field: string;
|
|
110
|
+
curr_value?: any;
|
|
111
|
+
prev_value?: any;
|
|
112
|
+
}, {
|
|
113
|
+
field: string;
|
|
114
|
+
curr_value?: any;
|
|
115
|
+
prev_value?: any;
|
|
116
|
+
}>, "many">>;
|
|
117
|
+
}, "strip", z.ZodTypeAny, {
|
|
118
|
+
changes?: {
|
|
119
|
+
field: string;
|
|
120
|
+
curr_value?: any;
|
|
121
|
+
prev_value?: any;
|
|
122
|
+
}[] | undefined;
|
|
123
|
+
}, {
|
|
124
|
+
changes?: {
|
|
125
|
+
field: string;
|
|
126
|
+
curr_value?: any;
|
|
127
|
+
prev_value?: any;
|
|
128
|
+
}[] | undefined;
|
|
129
|
+
}>>>;
|
|
130
|
+
curr_value: z.ZodAny;
|
|
131
|
+
field: z.ZodString;
|
|
132
|
+
prev_value: z.ZodAny;
|
|
133
|
+
}, "strip", z.ZodTypeAny, {
|
|
134
|
+
created_at: number & {
|
|
135
|
+
__brand: "UnixTimestamp";
|
|
136
|
+
};
|
|
137
|
+
created_by: string | null;
|
|
138
|
+
updated_at: number & {
|
|
139
|
+
__brand: "UnixTimestamp";
|
|
140
|
+
};
|
|
141
|
+
type: "field_changed";
|
|
142
|
+
field: string;
|
|
143
|
+
_id?: string | undefined;
|
|
144
|
+
updated_by?: string | undefined;
|
|
145
|
+
metadata?: {
|
|
146
|
+
changes?: {
|
|
147
|
+
field: string;
|
|
148
|
+
curr_value?: any;
|
|
149
|
+
prev_value?: any;
|
|
150
|
+
}[] | undefined;
|
|
151
|
+
} | null | undefined;
|
|
152
|
+
curr_value?: any;
|
|
153
|
+
prev_value?: any;
|
|
154
|
+
}, {
|
|
155
|
+
created_at: number;
|
|
156
|
+
updated_at: number;
|
|
157
|
+
type: "field_changed";
|
|
158
|
+
field: string;
|
|
159
|
+
_id?: string | undefined;
|
|
160
|
+
created_by?: string | null | undefined;
|
|
161
|
+
updated_by?: string | undefined;
|
|
162
|
+
metadata?: {
|
|
163
|
+
changes?: {
|
|
164
|
+
field: string;
|
|
165
|
+
curr_value?: any;
|
|
166
|
+
prev_value?: any;
|
|
167
|
+
}[] | undefined;
|
|
168
|
+
} | null | undefined;
|
|
169
|
+
curr_value?: any;
|
|
170
|
+
prev_value?: any;
|
|
171
|
+
}>, z.ZodObject<{
|
|
172
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
173
|
+
created_at: z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>;
|
|
174
|
+
created_by: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
175
|
+
updated_at: z.ZodEffects<z.ZodNumber, import("../index.js").UnixTimestamp, number>;
|
|
176
|
+
updated_by: z.ZodOptional<z.ZodString>;
|
|
177
|
+
type: z.ZodLiteral<"crud">;
|
|
178
|
+
action: z.ZodEnum<["create", "update", "delete", "archive", "restore"]>;
|
|
179
|
+
}, "strip", z.ZodTypeAny, {
|
|
180
|
+
created_at: number & {
|
|
181
|
+
__brand: "UnixTimestamp";
|
|
182
|
+
};
|
|
183
|
+
created_by: string | null;
|
|
184
|
+
updated_at: number & {
|
|
185
|
+
__brand: "UnixTimestamp";
|
|
186
|
+
};
|
|
187
|
+
type: "crud";
|
|
188
|
+
action: "create" | "update" | "delete" | "archive" | "restore";
|
|
189
|
+
_id?: string | undefined;
|
|
190
|
+
updated_by?: string | undefined;
|
|
191
|
+
}, {
|
|
192
|
+
created_at: number;
|
|
193
|
+
updated_at: number;
|
|
194
|
+
type: "crud";
|
|
195
|
+
action: "create" | "update" | "delete" | "archive" | "restore";
|
|
196
|
+
_id?: string | undefined;
|
|
197
|
+
created_by?: string | null | undefined;
|
|
198
|
+
updated_by?: string | undefined;
|
|
199
|
+
}>]>, {
|
|
200
|
+
created_at: number & {
|
|
201
|
+
__brand: "UnixTimestamp";
|
|
202
|
+
};
|
|
203
|
+
created_by: string | null;
|
|
204
|
+
updated_at: number & {
|
|
205
|
+
__brand: "UnixTimestamp";
|
|
206
|
+
};
|
|
207
|
+
message: string;
|
|
208
|
+
type: "note";
|
|
209
|
+
_id?: string | undefined;
|
|
210
|
+
updated_by?: string | undefined;
|
|
211
|
+
} | {
|
|
212
|
+
created_at: number & {
|
|
213
|
+
__brand: "UnixTimestamp";
|
|
214
|
+
};
|
|
215
|
+
created_by: string | null;
|
|
216
|
+
updated_at: number & {
|
|
217
|
+
__brand: "UnixTimestamp";
|
|
218
|
+
};
|
|
219
|
+
type: "field_changed";
|
|
220
|
+
field: string;
|
|
221
|
+
_id?: string | undefined;
|
|
222
|
+
updated_by?: string | undefined;
|
|
223
|
+
metadata?: {
|
|
224
|
+
changes?: {
|
|
225
|
+
field: string;
|
|
226
|
+
curr_value?: any;
|
|
227
|
+
prev_value?: any;
|
|
228
|
+
}[] | undefined;
|
|
229
|
+
} | null | undefined;
|
|
230
|
+
curr_value?: any;
|
|
231
|
+
prev_value?: any;
|
|
232
|
+
} | {
|
|
233
|
+
created_at: number & {
|
|
234
|
+
__brand: "UnixTimestamp";
|
|
235
|
+
};
|
|
236
|
+
created_by: string | null;
|
|
237
|
+
updated_at: number & {
|
|
238
|
+
__brand: "UnixTimestamp";
|
|
239
|
+
};
|
|
240
|
+
type: "crud";
|
|
241
|
+
action: "create" | "update" | "delete" | "archive" | "restore";
|
|
242
|
+
_id?: string | undefined;
|
|
243
|
+
updated_by?: string | undefined;
|
|
244
|
+
}, {
|
|
245
|
+
created_at: number;
|
|
246
|
+
updated_at: number;
|
|
247
|
+
message: string;
|
|
248
|
+
type: "note";
|
|
249
|
+
_id?: string | undefined;
|
|
250
|
+
created_by?: string | null | undefined;
|
|
251
|
+
updated_by?: string | undefined;
|
|
252
|
+
} | {
|
|
253
|
+
created_at: number;
|
|
254
|
+
updated_at: number;
|
|
255
|
+
type: "field_changed";
|
|
256
|
+
field: string;
|
|
257
|
+
_id?: string | undefined;
|
|
258
|
+
created_by?: string | null | undefined;
|
|
259
|
+
updated_by?: string | undefined;
|
|
260
|
+
metadata?: {
|
|
261
|
+
changes?: {
|
|
262
|
+
field: string;
|
|
263
|
+
curr_value?: any;
|
|
264
|
+
prev_value?: any;
|
|
265
|
+
}[] | undefined;
|
|
266
|
+
} | null | undefined;
|
|
267
|
+
curr_value?: any;
|
|
268
|
+
prev_value?: any;
|
|
269
|
+
} | {
|
|
270
|
+
created_at: number;
|
|
271
|
+
updated_at: number;
|
|
272
|
+
type: "crud";
|
|
273
|
+
action: "create" | "update" | "delete" | "archive" | "restore";
|
|
274
|
+
_id?: string | undefined;
|
|
275
|
+
created_by?: string | null | undefined;
|
|
276
|
+
updated_by?: string | undefined;
|
|
277
|
+
}>, "many">>;
|
|
278
|
+
observations: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
279
|
+
associated_patterns: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
280
|
+
_id: z.ZodString;
|
|
281
|
+
code: z.ZodString;
|
|
282
|
+
headsign: z.ZodString;
|
|
283
|
+
line_id: z.ZodString;
|
|
284
|
+
route_id: z.ZodString;
|
|
285
|
+
}, "strip", z.ZodTypeAny, {
|
|
286
|
+
_id: string;
|
|
287
|
+
code: string;
|
|
288
|
+
line_id: string;
|
|
289
|
+
headsign: string;
|
|
290
|
+
route_id: string;
|
|
291
|
+
}, {
|
|
292
|
+
_id: string;
|
|
293
|
+
code: string;
|
|
294
|
+
line_id: string;
|
|
295
|
+
headsign: string;
|
|
296
|
+
route_id: string;
|
|
297
|
+
}>, "many">>;
|
|
298
|
+
}, "_id" | "name" | "latitude" | "longitude" | "short_name" | "flags" | "legacy_ids" | "lifecycle_status" | "tts_name" | "district_id" | "locality_id" | "municipality_id"> & {
|
|
299
|
+
district_name: z.ZodString;
|
|
300
|
+
locality_name: z.ZodString;
|
|
301
|
+
municipality_name: z.ZodString;
|
|
302
|
+
parish_name: z.ZodString;
|
|
303
|
+
}, "strip", z.ZodTypeAny, {
|
|
304
|
+
_id: number;
|
|
305
|
+
name: string;
|
|
306
|
+
latitude: number;
|
|
307
|
+
longitude: number;
|
|
308
|
+
short_name: string;
|
|
309
|
+
flags: {
|
|
310
|
+
short_name: string;
|
|
311
|
+
stop_id: string;
|
|
312
|
+
agency_ids: string[];
|
|
313
|
+
is_harmonized: boolean;
|
|
314
|
+
}[];
|
|
315
|
+
legacy_ids: string[];
|
|
316
|
+
lifecycle_status: "draft" | "active" | "inactive" | "provisional" | "seasonal" | "voided";
|
|
317
|
+
tts_name: string;
|
|
318
|
+
district_id: string;
|
|
319
|
+
locality_id: string | null;
|
|
320
|
+
municipality_id: string;
|
|
321
|
+
district_name: string;
|
|
322
|
+
locality_name: string;
|
|
323
|
+
municipality_name: string;
|
|
324
|
+
parish_name: string;
|
|
325
|
+
}, {
|
|
326
|
+
_id: number;
|
|
327
|
+
name: string;
|
|
328
|
+
latitude: number;
|
|
329
|
+
longitude: number;
|
|
330
|
+
short_name: string;
|
|
331
|
+
tts_name: string;
|
|
332
|
+
district_id: string;
|
|
333
|
+
municipality_id: string;
|
|
334
|
+
district_name: string;
|
|
335
|
+
locality_name: string;
|
|
336
|
+
municipality_name: string;
|
|
337
|
+
parish_name: string;
|
|
338
|
+
flags?: {
|
|
339
|
+
short_name: string;
|
|
340
|
+
stop_id: string;
|
|
341
|
+
agency_ids?: string[] | undefined;
|
|
342
|
+
is_harmonized?: boolean | undefined;
|
|
343
|
+
}[] | undefined;
|
|
344
|
+
legacy_ids?: string[] | undefined;
|
|
345
|
+
lifecycle_status?: "draft" | "active" | "inactive" | "provisional" | "seasonal" | "voided" | undefined;
|
|
346
|
+
locality_id?: string | null | undefined;
|
|
347
|
+
}>;
|
|
348
|
+
/**
|
|
349
|
+
* Publishable stop data for the Hub Stops API.
|
|
350
|
+
*/
|
|
351
|
+
export type HubStop = z.infer<typeof HubStopSchema>;
|
package/dist/hub/stop.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { StopSchema } from '../stops/stop.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
/* * */
|
|
5
|
+
export const HubStopSchema = StopSchema.pick({
|
|
6
|
+
_id: true,
|
|
7
|
+
district_id: true,
|
|
8
|
+
flags: true,
|
|
9
|
+
latitude: true,
|
|
10
|
+
legacy_ids: true,
|
|
11
|
+
lifecycle_status: true,
|
|
12
|
+
locality_id: true,
|
|
13
|
+
longitude: true,
|
|
14
|
+
municipality_id: true,
|
|
15
|
+
name: true,
|
|
16
|
+
short_name: true,
|
|
17
|
+
tts_name: true,
|
|
18
|
+
}).extend({
|
|
19
|
+
district_name: z.string(),
|
|
20
|
+
locality_name: z.string(),
|
|
21
|
+
municipality_name: z.string(),
|
|
22
|
+
parish_name: z.string(),
|
|
23
|
+
});
|