@tmlmobilidade/types 20250909.1559.44 → 20250910.1526.7
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 +247 -16
- package/dist/src/_common/comment.js +36 -5
- package/dist/src/_common/document.d.ts +14 -8
- package/dist/src/_common/document.js +5 -3
- package/dist/src/_common/proposed-change.d.ts +37 -19
- package/dist/src/_common/unix-timestamp.d.ts +1 -1
- package/dist/src/_common/unix-timestamp.js +1 -2
- package/dist/src/agency.d.ts +30 -12
- package/dist/src/alert.d.ts +52 -59
- package/dist/src/auth/role.d.ts +30 -12
- package/dist/src/auth/session.d.ts +30 -12
- package/dist/src/auth/user.d.ts +30 -12
- package/dist/src/auth/verification-token.d.ts +30 -12
- package/dist/src/file.d.ts +23 -23
- package/dist/src/organization.d.ts +30 -12
- package/dist/src/plans/gtfs-validation.d.ts +30 -12
- package/dist/src/plans/plan.d.ts +30 -12
- package/dist/src/rides/index.d.ts +2 -1
- package/dist/src/rides/index.js +2 -1
- package/dist/src/rides/ride-audit.d.ts +729 -0
- package/dist/src/rides/ride-audit.js +12 -0
- package/dist/src/rides/ride-justification.d.ts +959 -0
- package/dist/src/rides/ride-justification.js +64 -0
- package/dist/src/rides/ride-overrides.d.ts +9 -0
- package/dist/src/rides/ride-overrides.js +6 -0
- package/dist/src/rides/ride.d.ts +38 -20
- package/dist/src/sams/sam.d.ts +30 -12
- package/dist/src/simplified-apex/simplified-apex-location.d.ts +32 -24
- package/dist/src/simplified-apex/simplified-apex-on-board-refund.d.ts +32 -24
- package/dist/src/simplified-apex/simplified-apex-on-board-sale.d.ts +32 -24
- package/dist/src/simplified-apex/simplified-apex-validation.d.ts +36 -28
- package/dist/src/stop.d.ts +713 -188
- package/dist/src/vehicle-event.d.ts +18 -12
- package/dist/src/zone.d.ts +24 -6
- package/package.json +1 -1
- package/dist/src/rides/ride-annotation.d.ts +0 -579
- package/dist/src/rides/ride-annotation.js +0 -34
|
@@ -1,25 +1,256 @@
|
|
|
1
|
+
import { type UnixTimestamp } from './unix-timestamp.js';
|
|
1
2
|
import { z } from 'zod';
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
export declare const CommentTypeSchema: z.ZodEnum<["statusChanged", "note", "system_info"]>;
|
|
4
|
+
export type CommentType = z.infer<typeof CommentTypeSchema>;
|
|
5
|
+
export declare const NoteCommentSchema: z.ZodObject<{
|
|
6
|
+
_id: z.ZodString;
|
|
7
|
+
created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
8
|
+
created_by: z.ZodDefault<z.ZodString>;
|
|
9
|
+
updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
10
|
+
updated_by: z.ZodDefault<z.ZodString>;
|
|
11
|
+
} & {
|
|
12
|
+
message: z.ZodString;
|
|
13
|
+
type: z.ZodLiteral<"note">;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
_id: string;
|
|
16
|
+
created_at: number & {
|
|
17
|
+
__brand: "UnixTimestamp";
|
|
18
|
+
};
|
|
19
|
+
created_by: string;
|
|
20
|
+
updated_at: number & {
|
|
21
|
+
__brand: "UnixTimestamp";
|
|
22
|
+
};
|
|
23
|
+
updated_by: string;
|
|
24
|
+
message: string;
|
|
25
|
+
type: "note";
|
|
26
|
+
}, {
|
|
27
|
+
_id: string;
|
|
28
|
+
created_at: number;
|
|
29
|
+
updated_at: number;
|
|
30
|
+
message: string;
|
|
31
|
+
type: "note";
|
|
32
|
+
created_by?: string | undefined;
|
|
33
|
+
updated_by?: string | undefined;
|
|
34
|
+
}>;
|
|
35
|
+
export declare const SystemInfoCommentSchema: z.ZodObject<{
|
|
36
|
+
_id: z.ZodString;
|
|
37
|
+
created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
38
|
+
updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
39
|
+
} & {
|
|
40
|
+
created_by: z.ZodLiteral<"system">;
|
|
41
|
+
message: z.ZodString;
|
|
42
|
+
type: z.ZodLiteral<"system_info">;
|
|
43
|
+
updated_by: z.ZodLiteral<"system">;
|
|
44
|
+
}, "strip", z.ZodTypeAny, {
|
|
45
|
+
_id: string;
|
|
46
|
+
created_at: number & {
|
|
47
|
+
__brand: "UnixTimestamp";
|
|
48
|
+
};
|
|
49
|
+
created_by: "system";
|
|
50
|
+
updated_at: number & {
|
|
51
|
+
__brand: "UnixTimestamp";
|
|
52
|
+
};
|
|
53
|
+
updated_by: "system";
|
|
54
|
+
message: string;
|
|
55
|
+
type: "system_info";
|
|
56
|
+
}, {
|
|
57
|
+
_id: string;
|
|
58
|
+
created_at: number;
|
|
59
|
+
created_by: "system";
|
|
60
|
+
updated_at: number;
|
|
61
|
+
updated_by: "system";
|
|
62
|
+
message: string;
|
|
63
|
+
type: "system_info";
|
|
64
|
+
}>;
|
|
65
|
+
export declare const StatusChangedCommentSchema: z.ZodObject<{
|
|
66
|
+
_id: z.ZodString;
|
|
67
|
+
created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
68
|
+
created_by: z.ZodDefault<z.ZodString>;
|
|
69
|
+
updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
70
|
+
updated_by: z.ZodDefault<z.ZodString>;
|
|
5
71
|
} & {
|
|
72
|
+
curr_status: z.ZodString;
|
|
73
|
+
prev_status: z.ZodString;
|
|
74
|
+
type: z.ZodLiteral<"statusChanged">;
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
_id: string;
|
|
77
|
+
created_at: number & {
|
|
78
|
+
__brand: "UnixTimestamp";
|
|
79
|
+
};
|
|
80
|
+
created_by: string;
|
|
81
|
+
updated_at: number & {
|
|
82
|
+
__brand: "UnixTimestamp";
|
|
83
|
+
};
|
|
84
|
+
updated_by: string;
|
|
85
|
+
type: "statusChanged";
|
|
86
|
+
curr_status: string;
|
|
87
|
+
prev_status: string;
|
|
88
|
+
}, {
|
|
89
|
+
_id: string;
|
|
90
|
+
created_at: number;
|
|
91
|
+
updated_at: number;
|
|
92
|
+
type: "statusChanged";
|
|
93
|
+
curr_status: string;
|
|
94
|
+
prev_status: string;
|
|
95
|
+
created_by?: string | undefined;
|
|
96
|
+
updated_by?: string | undefined;
|
|
97
|
+
}>;
|
|
98
|
+
export declare const CommentSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
6
99
|
_id: z.ZodString;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
100
|
+
created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
101
|
+
created_by: z.ZodDefault<z.ZodString>;
|
|
102
|
+
updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
103
|
+
updated_by: z.ZodDefault<z.ZodString>;
|
|
104
|
+
} & {
|
|
105
|
+
message: z.ZodString;
|
|
106
|
+
type: z.ZodLiteral<"note">;
|
|
107
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
108
|
_id: string;
|
|
11
|
-
|
|
12
|
-
user_id: string;
|
|
13
|
-
created_at?: (number & {
|
|
109
|
+
created_at: number & {
|
|
14
110
|
__brand: "UnixTimestamp";
|
|
15
|
-
}
|
|
16
|
-
|
|
111
|
+
};
|
|
112
|
+
created_by: string;
|
|
113
|
+
updated_at: number & {
|
|
17
114
|
__brand: "UnixTimestamp";
|
|
18
|
-
}
|
|
115
|
+
};
|
|
116
|
+
updated_by: string;
|
|
117
|
+
message: string;
|
|
118
|
+
type: "note";
|
|
19
119
|
}, {
|
|
20
120
|
_id: string;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
121
|
+
created_at: number;
|
|
122
|
+
updated_at: number;
|
|
123
|
+
message: string;
|
|
124
|
+
type: "note";
|
|
125
|
+
created_by?: string | undefined;
|
|
126
|
+
updated_by?: string | undefined;
|
|
127
|
+
}>, z.ZodObject<{
|
|
128
|
+
_id: z.ZodString;
|
|
129
|
+
created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
130
|
+
updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
131
|
+
} & {
|
|
132
|
+
created_by: z.ZodLiteral<"system">;
|
|
133
|
+
message: z.ZodString;
|
|
134
|
+
type: z.ZodLiteral<"system_info">;
|
|
135
|
+
updated_by: z.ZodLiteral<"system">;
|
|
136
|
+
}, "strip", z.ZodTypeAny, {
|
|
137
|
+
_id: string;
|
|
138
|
+
created_at: number & {
|
|
139
|
+
__brand: "UnixTimestamp";
|
|
140
|
+
};
|
|
141
|
+
created_by: "system";
|
|
142
|
+
updated_at: number & {
|
|
143
|
+
__brand: "UnixTimestamp";
|
|
144
|
+
};
|
|
145
|
+
updated_by: "system";
|
|
146
|
+
message: string;
|
|
147
|
+
type: "system_info";
|
|
148
|
+
}, {
|
|
149
|
+
_id: string;
|
|
150
|
+
created_at: number;
|
|
151
|
+
created_by: "system";
|
|
152
|
+
updated_at: number;
|
|
153
|
+
updated_by: "system";
|
|
154
|
+
message: string;
|
|
155
|
+
type: "system_info";
|
|
156
|
+
}>, z.ZodObject<{
|
|
157
|
+
_id: z.ZodString;
|
|
158
|
+
created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
159
|
+
created_by: z.ZodDefault<z.ZodString>;
|
|
160
|
+
updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
161
|
+
updated_by: z.ZodDefault<z.ZodString>;
|
|
162
|
+
} & {
|
|
163
|
+
curr_status: z.ZodString;
|
|
164
|
+
prev_status: z.ZodString;
|
|
165
|
+
type: z.ZodLiteral<"statusChanged">;
|
|
166
|
+
}, "strip", z.ZodTypeAny, {
|
|
167
|
+
_id: string;
|
|
168
|
+
created_at: number & {
|
|
169
|
+
__brand: "UnixTimestamp";
|
|
170
|
+
};
|
|
171
|
+
created_by: string;
|
|
172
|
+
updated_at: number & {
|
|
173
|
+
__brand: "UnixTimestamp";
|
|
174
|
+
};
|
|
175
|
+
updated_by: string;
|
|
176
|
+
type: "statusChanged";
|
|
177
|
+
curr_status: string;
|
|
178
|
+
prev_status: string;
|
|
179
|
+
}, {
|
|
180
|
+
_id: string;
|
|
181
|
+
created_at: number;
|
|
182
|
+
updated_at: number;
|
|
183
|
+
type: "statusChanged";
|
|
184
|
+
curr_status: string;
|
|
185
|
+
prev_status: string;
|
|
186
|
+
created_by?: string | undefined;
|
|
187
|
+
updated_by?: string | undefined;
|
|
188
|
+
}>]>, {
|
|
189
|
+
_id: string;
|
|
190
|
+
created_at: number & {
|
|
191
|
+
__brand: "UnixTimestamp";
|
|
192
|
+
};
|
|
193
|
+
created_by: string;
|
|
194
|
+
updated_at: number & {
|
|
195
|
+
__brand: "UnixTimestamp";
|
|
196
|
+
};
|
|
197
|
+
updated_by: string;
|
|
198
|
+
message: string;
|
|
199
|
+
type: "note";
|
|
200
|
+
} | {
|
|
201
|
+
_id: string;
|
|
202
|
+
created_at: number & {
|
|
203
|
+
__brand: "UnixTimestamp";
|
|
204
|
+
};
|
|
205
|
+
created_by: "system";
|
|
206
|
+
updated_at: number & {
|
|
207
|
+
__brand: "UnixTimestamp";
|
|
208
|
+
};
|
|
209
|
+
updated_by: "system";
|
|
210
|
+
message: string;
|
|
211
|
+
type: "system_info";
|
|
212
|
+
} | {
|
|
213
|
+
_id: string;
|
|
214
|
+
created_at: number & {
|
|
215
|
+
__brand: "UnixTimestamp";
|
|
216
|
+
};
|
|
217
|
+
created_by: string;
|
|
218
|
+
updated_at: number & {
|
|
219
|
+
__brand: "UnixTimestamp";
|
|
220
|
+
};
|
|
221
|
+
updated_by: string;
|
|
222
|
+
type: "statusChanged";
|
|
223
|
+
curr_status: string;
|
|
224
|
+
prev_status: string;
|
|
225
|
+
}, {
|
|
226
|
+
_id: string;
|
|
227
|
+
created_at: number;
|
|
228
|
+
updated_at: number;
|
|
229
|
+
message: string;
|
|
230
|
+
type: "note";
|
|
231
|
+
created_by?: string | undefined;
|
|
232
|
+
updated_by?: string | undefined;
|
|
233
|
+
} | {
|
|
234
|
+
_id: string;
|
|
235
|
+
created_at: number;
|
|
236
|
+
created_by: "system";
|
|
237
|
+
updated_at: number;
|
|
238
|
+
updated_by: "system";
|
|
239
|
+
message: string;
|
|
240
|
+
type: "system_info";
|
|
241
|
+
} | {
|
|
242
|
+
_id: string;
|
|
243
|
+
created_at: number;
|
|
244
|
+
updated_at: number;
|
|
245
|
+
type: "statusChanged";
|
|
246
|
+
curr_status: string;
|
|
247
|
+
prev_status: string;
|
|
248
|
+
created_by?: string | undefined;
|
|
249
|
+
updated_by?: string | undefined;
|
|
25
250
|
}>;
|
|
251
|
+
export interface Comment extends Omit<z.infer<typeof CommentSchema>, 'created_at' | 'updated_at'> {
|
|
252
|
+
created_at: UnixTimestamp;
|
|
253
|
+
updated_at: UnixTimestamp;
|
|
254
|
+
}
|
|
255
|
+
export type CreateCommentDto = Omit<z.infer<typeof CommentSchema>, 'created_at' | 'updated_at'>;
|
|
256
|
+
export type UpdateCommentDto = Partial<Omit<CreateCommentDto, 'created_by'>>;
|
|
@@ -2,8 +2,39 @@
|
|
|
2
2
|
import { DocumentSchema } from './document.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
/* * */
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
const COMMENT_TYPE_OPTIONS = ['statusChanged', 'note', 'system_info'];
|
|
6
|
+
export const CommentTypeSchema = z.enum(COMMENT_TYPE_OPTIONS);
|
|
7
|
+
/* * */
|
|
8
|
+
export const NoteCommentSchema = DocumentSchema.extend({
|
|
9
|
+
message: z.string(),
|
|
10
|
+
type: z.literal(CommentTypeSchema.enum.note),
|
|
11
|
+
});
|
|
12
|
+
export const SystemInfoCommentSchema = DocumentSchema.extend({
|
|
13
|
+
created_by: z.literal('system'),
|
|
14
|
+
message: z.string(),
|
|
15
|
+
type: z.literal(CommentTypeSchema.enum.system_info),
|
|
16
|
+
updated_by: z.literal('system'),
|
|
17
|
+
});
|
|
18
|
+
export const StatusChangedCommentSchema = DocumentSchema.extend({
|
|
19
|
+
curr_status: z.string(),
|
|
20
|
+
prev_status: z.string(),
|
|
21
|
+
type: z.literal(CommentTypeSchema.enum.statusChanged),
|
|
22
|
+
});
|
|
23
|
+
export const CommentSchema = z
|
|
24
|
+
.discriminatedUnion('type', [
|
|
25
|
+
NoteCommentSchema,
|
|
26
|
+
SystemInfoCommentSchema,
|
|
27
|
+
StatusChangedCommentSchema,
|
|
28
|
+
])
|
|
29
|
+
.superRefine((data, ctx) => {
|
|
30
|
+
if (data.type === CommentTypeSchema.enum.statusChanged) {
|
|
31
|
+
const d = data;
|
|
32
|
+
if (d.curr_status === d.prev_status) {
|
|
33
|
+
ctx.addIssue({
|
|
34
|
+
code: z.ZodIssueCode.custom,
|
|
35
|
+
message: 'curr_status and prev_status must differ',
|
|
36
|
+
path: ['curr_status'],
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
});
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const DocumentSchema: z.ZodObject<{
|
|
3
3
|
_id: z.ZodString;
|
|
4
|
-
created_at: z.
|
|
5
|
-
|
|
4
|
+
created_at: z.ZodEffects<z.ZodNumber, import("./unix-timestamp.js").UnixTimestamp, number>;
|
|
5
|
+
created_by: z.ZodDefault<z.ZodString>;
|
|
6
|
+
updated_at: z.ZodEffects<z.ZodNumber, import("./unix-timestamp.js").UnixTimestamp, number>;
|
|
7
|
+
updated_by: z.ZodDefault<z.ZodString>;
|
|
6
8
|
}, "strip", z.ZodTypeAny, {
|
|
7
9
|
_id: string;
|
|
8
|
-
created_at
|
|
10
|
+
created_at: number & {
|
|
9
11
|
__brand: "UnixTimestamp";
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
+
};
|
|
13
|
+
created_by: string;
|
|
14
|
+
updated_at: number & {
|
|
12
15
|
__brand: "UnixTimestamp";
|
|
13
|
-
}
|
|
16
|
+
};
|
|
17
|
+
updated_by: string;
|
|
14
18
|
}, {
|
|
15
19
|
_id: string;
|
|
16
|
-
created_at
|
|
17
|
-
updated_at
|
|
20
|
+
created_at: number;
|
|
21
|
+
updated_at: number;
|
|
22
|
+
created_by?: string | undefined;
|
|
23
|
+
updated_by?: string | undefined;
|
|
18
24
|
}>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/* * */
|
|
2
|
-
import {
|
|
2
|
+
import { unixTimeStampSchema } from './unix-timestamp.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
/* * */
|
|
5
5
|
export const DocumentSchema = z.object({
|
|
6
6
|
_id: z.string(),
|
|
7
|
-
created_at:
|
|
8
|
-
|
|
7
|
+
created_at: unixTimeStampSchema,
|
|
8
|
+
created_by: z.string().default('system'),
|
|
9
|
+
updated_at: unixTimeStampSchema,
|
|
10
|
+
updated_by: z.string().default('system'),
|
|
9
11
|
});
|
|
@@ -4,8 +4,10 @@ export declare const scopeSchema: z.ZodEnum<["stop", "lines"]>;
|
|
|
4
4
|
export declare const statusSchema: z.ZodDefault<z.ZodEnum<["pending", "accepted", "declined"]>>;
|
|
5
5
|
export declare const ProposedChangeSchema: z.ZodObject<{
|
|
6
6
|
_id: z.ZodString;
|
|
7
|
-
created_at: z.
|
|
8
|
-
|
|
7
|
+
created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
8
|
+
created_by: z.ZodDefault<z.ZodString>;
|
|
9
|
+
updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
10
|
+
updated_by: z.ZodDefault<z.ZodString>;
|
|
9
11
|
} & {
|
|
10
12
|
field_path: z.ZodString;
|
|
11
13
|
field_value: z.ZodAny;
|
|
@@ -15,33 +17,39 @@ export declare const ProposedChangeSchema: z.ZodObject<{
|
|
|
15
17
|
user_id: z.ZodString;
|
|
16
18
|
}, "strict", z.ZodTypeAny, {
|
|
17
19
|
_id: string;
|
|
20
|
+
created_at: number & {
|
|
21
|
+
__brand: "UnixTimestamp";
|
|
22
|
+
};
|
|
23
|
+
created_by: string;
|
|
24
|
+
updated_at: number & {
|
|
25
|
+
__brand: "UnixTimestamp";
|
|
26
|
+
};
|
|
27
|
+
updated_by: string;
|
|
18
28
|
status: "pending" | "accepted" | "declined";
|
|
19
|
-
user_id: string;
|
|
20
29
|
field_path: string;
|
|
21
30
|
scope: "stop" | "lines";
|
|
22
31
|
target_id: string;
|
|
23
|
-
|
|
24
|
-
__brand: "UnixTimestamp";
|
|
25
|
-
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
26
|
-
updated_at?: (number & {
|
|
27
|
-
__brand: "UnixTimestamp";
|
|
28
|
-
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
32
|
+
user_id: string;
|
|
29
33
|
field_value?: any;
|
|
30
34
|
}, {
|
|
31
35
|
_id: string;
|
|
32
|
-
|
|
36
|
+
created_at: number;
|
|
37
|
+
updated_at: number;
|
|
33
38
|
field_path: string;
|
|
34
39
|
scope: "stop" | "lines";
|
|
35
40
|
target_id: string;
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
user_id: string;
|
|
42
|
+
created_by?: string | undefined;
|
|
43
|
+
updated_by?: string | undefined;
|
|
38
44
|
status?: "pending" | "accepted" | "declined" | undefined;
|
|
39
45
|
field_value?: any;
|
|
40
46
|
}>;
|
|
41
47
|
export declare const CreateProposedChangeSchema: z.ZodObject<Omit<{
|
|
42
48
|
_id: z.ZodString;
|
|
43
|
-
created_at: z.
|
|
44
|
-
|
|
49
|
+
created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
50
|
+
created_by: z.ZodDefault<z.ZodString>;
|
|
51
|
+
updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
52
|
+
updated_by: z.ZodDefault<z.ZodString>;
|
|
45
53
|
} & {
|
|
46
54
|
field_path: z.ZodString;
|
|
47
55
|
field_value: z.ZodAny;
|
|
@@ -50,41 +58,51 @@ export declare const CreateProposedChangeSchema: z.ZodObject<Omit<{
|
|
|
50
58
|
target_id: z.ZodString;
|
|
51
59
|
user_id: z.ZodString;
|
|
52
60
|
}, "_id" | "created_at" | "updated_at">, "strict", z.ZodTypeAny, {
|
|
61
|
+
created_by: string;
|
|
62
|
+
updated_by: string;
|
|
53
63
|
status: "pending" | "accepted" | "declined";
|
|
54
|
-
user_id: string;
|
|
55
64
|
field_path: string;
|
|
56
65
|
scope: "stop" | "lines";
|
|
57
66
|
target_id: string;
|
|
67
|
+
user_id: string;
|
|
58
68
|
field_value?: any;
|
|
59
69
|
}, {
|
|
60
|
-
user_id: string;
|
|
61
70
|
field_path: string;
|
|
62
71
|
scope: "stop" | "lines";
|
|
63
72
|
target_id: string;
|
|
73
|
+
user_id: string;
|
|
74
|
+
created_by?: string | undefined;
|
|
75
|
+
updated_by?: string | undefined;
|
|
64
76
|
status?: "pending" | "accepted" | "declined" | undefined;
|
|
65
77
|
field_value?: any;
|
|
66
78
|
}>;
|
|
67
79
|
export declare const UpdateProposedChangeSchema: z.ZodObject<{
|
|
80
|
+
created_by: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
81
|
+
updated_by: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
68
82
|
status: z.ZodOptional<z.ZodDefault<z.ZodEnum<["pending", "accepted", "declined"]>>>;
|
|
69
|
-
user_id: z.ZodOptional<z.ZodString>;
|
|
70
83
|
field_path: z.ZodOptional<z.ZodString>;
|
|
71
84
|
field_value: z.ZodOptional<z.ZodAny>;
|
|
72
85
|
scope: z.ZodOptional<z.ZodEnum<["stop", "lines"]>>;
|
|
73
86
|
target_id: z.ZodOptional<z.ZodString>;
|
|
87
|
+
user_id: z.ZodOptional<z.ZodString>;
|
|
74
88
|
}, "strict", z.ZodTypeAny, {
|
|
89
|
+
created_by?: string | undefined;
|
|
90
|
+
updated_by?: string | undefined;
|
|
75
91
|
status?: "pending" | "accepted" | "declined" | undefined;
|
|
76
|
-
user_id?: string | undefined;
|
|
77
92
|
field_path?: string | undefined;
|
|
78
93
|
field_value?: any;
|
|
79
94
|
scope?: "stop" | "lines" | undefined;
|
|
80
95
|
target_id?: string | undefined;
|
|
96
|
+
user_id?: string | undefined;
|
|
81
97
|
}, {
|
|
98
|
+
created_by?: string | undefined;
|
|
99
|
+
updated_by?: string | undefined;
|
|
82
100
|
status?: "pending" | "accepted" | "declined" | undefined;
|
|
83
|
-
user_id?: string | undefined;
|
|
84
101
|
field_path?: string | undefined;
|
|
85
102
|
field_value?: any;
|
|
86
103
|
scope?: "stop" | "lines" | undefined;
|
|
87
104
|
target_id?: string | undefined;
|
|
105
|
+
user_id?: string | undefined;
|
|
88
106
|
}>;
|
|
89
107
|
export type Scope = z.infer<typeof scopeSchema>;
|
|
90
108
|
export type Status = z.infer<typeof statusSchema>;
|
|
@@ -6,7 +6,7 @@ import { z } from 'zod';
|
|
|
6
6
|
export type UnixTimestamp = number & {
|
|
7
7
|
__brand: 'UnixTimestamp';
|
|
8
8
|
};
|
|
9
|
-
export declare const unixTimeStampSchema: z.
|
|
9
|
+
export declare const unixTimeStampSchema: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
10
10
|
/**
|
|
11
11
|
* This function validates if a number is a valid Unix Timestamp, in milliseconds.
|
|
12
12
|
* It is assumed the number will always be greater than 10^10 (1e10) to ensure it is in milliseconds.
|
|
@@ -3,8 +3,7 @@ import { DateTime } from 'luxon';
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
export const unixTimeStampSchema = z
|
|
5
5
|
.number()
|
|
6
|
-
.transform(validateUnixTimestamp)
|
|
7
|
-
.brand('UnixTimestamp');
|
|
6
|
+
.transform(validateUnixTimestamp);
|
|
8
7
|
/**
|
|
9
8
|
* This function validates if a number is a valid Unix Timestamp, in milliseconds.
|
|
10
9
|
* It is assumed the number will always be greater than 10^10 (1e10) to ensure it is in milliseconds.
|
package/dist/src/agency.d.ts
CHANGED
|
@@ -3,8 +3,10 @@ import { type UnixTimestamp } from './_common/unix-timestamp.js';
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
export declare const AgencySchema: z.ZodObject<{
|
|
5
5
|
_id: z.ZodString;
|
|
6
|
-
created_at: z.
|
|
7
|
-
|
|
6
|
+
created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
7
|
+
created_by: z.ZodDefault<z.ZodString>;
|
|
8
|
+
updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
9
|
+
updated_by: z.ZodDefault<z.ZodString>;
|
|
8
10
|
} & {
|
|
9
11
|
contact_emails_pta: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
10
12
|
contact_emails_pto: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -28,6 +30,14 @@ export declare const AgencySchema: z.ZodObject<{
|
|
|
28
30
|
website_url: z.ZodString;
|
|
29
31
|
}, "strip", z.ZodTypeAny, {
|
|
30
32
|
_id: string;
|
|
33
|
+
created_at: number & {
|
|
34
|
+
__brand: "UnixTimestamp";
|
|
35
|
+
};
|
|
36
|
+
created_by: string;
|
|
37
|
+
updated_at: number & {
|
|
38
|
+
__brand: "UnixTimestamp";
|
|
39
|
+
};
|
|
40
|
+
updated_by: string;
|
|
31
41
|
contact_emails_pta: string[];
|
|
32
42
|
contact_emails_pto: string[];
|
|
33
43
|
fare_url: string;
|
|
@@ -44,14 +54,10 @@ export declare const AgencySchema: z.ZodObject<{
|
|
|
44
54
|
short_name: string;
|
|
45
55
|
timezone: string;
|
|
46
56
|
website_url: string;
|
|
47
|
-
created_at?: (number & {
|
|
48
|
-
__brand: "UnixTimestamp";
|
|
49
|
-
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
50
|
-
updated_at?: (number & {
|
|
51
|
-
__brand: "UnixTimestamp";
|
|
52
|
-
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
53
57
|
}, {
|
|
54
58
|
_id: string;
|
|
59
|
+
created_at: number;
|
|
60
|
+
updated_at: number;
|
|
55
61
|
fare_url: string;
|
|
56
62
|
financials: {
|
|
57
63
|
price_per_km: number;
|
|
@@ -63,16 +69,18 @@ export declare const AgencySchema: z.ZodObject<{
|
|
|
63
69
|
public_email: string;
|
|
64
70
|
short_name: string;
|
|
65
71
|
website_url: string;
|
|
66
|
-
|
|
67
|
-
|
|
72
|
+
created_by?: string | undefined;
|
|
73
|
+
updated_by?: string | undefined;
|
|
68
74
|
contact_emails_pta?: string[] | undefined;
|
|
69
75
|
contact_emails_pto?: string[] | undefined;
|
|
70
76
|
timezone?: string | undefined;
|
|
71
77
|
}>;
|
|
72
78
|
export declare const CreateAgencySchema: z.ZodObject<Omit<{
|
|
73
79
|
_id: z.ZodString;
|
|
74
|
-
created_at: z.
|
|
75
|
-
|
|
80
|
+
created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
81
|
+
created_by: z.ZodDefault<z.ZodString>;
|
|
82
|
+
updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
83
|
+
updated_by: z.ZodDefault<z.ZodString>;
|
|
76
84
|
} & {
|
|
77
85
|
contact_emails_pta: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
78
86
|
contact_emails_pto: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -96,6 +104,8 @@ export declare const CreateAgencySchema: z.ZodObject<Omit<{
|
|
|
96
104
|
website_url: z.ZodString;
|
|
97
105
|
}, "created_at" | "updated_at">, "strip", z.ZodTypeAny, {
|
|
98
106
|
_id: string;
|
|
107
|
+
created_by: string;
|
|
108
|
+
updated_by: string;
|
|
99
109
|
contact_emails_pta: string[];
|
|
100
110
|
contact_emails_pto: string[];
|
|
101
111
|
fare_url: string;
|
|
@@ -125,12 +135,16 @@ export declare const CreateAgencySchema: z.ZodObject<Omit<{
|
|
|
125
135
|
public_email: string;
|
|
126
136
|
short_name: string;
|
|
127
137
|
website_url: string;
|
|
138
|
+
created_by?: string | undefined;
|
|
139
|
+
updated_by?: string | undefined;
|
|
128
140
|
contact_emails_pta?: string[] | undefined;
|
|
129
141
|
contact_emails_pto?: string[] | undefined;
|
|
130
142
|
timezone?: string | undefined;
|
|
131
143
|
}>;
|
|
132
144
|
export declare const UpdateAgencySchema: z.ZodObject<{
|
|
133
145
|
_id: z.ZodOptional<z.ZodString>;
|
|
146
|
+
created_by: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
147
|
+
updated_by: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
134
148
|
contact_emails_pta: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
|
|
135
149
|
contact_emails_pto: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
|
|
136
150
|
fare_url: z.ZodOptional<z.ZodString>;
|
|
@@ -153,6 +167,8 @@ export declare const UpdateAgencySchema: z.ZodObject<{
|
|
|
153
167
|
website_url: z.ZodOptional<z.ZodString>;
|
|
154
168
|
}, "strip", z.ZodTypeAny, {
|
|
155
169
|
_id?: string | undefined;
|
|
170
|
+
created_by?: string | undefined;
|
|
171
|
+
updated_by?: string | undefined;
|
|
156
172
|
contact_emails_pta?: string[] | undefined;
|
|
157
173
|
contact_emails_pto?: string[] | undefined;
|
|
158
174
|
fare_url?: string | undefined;
|
|
@@ -171,6 +187,8 @@ export declare const UpdateAgencySchema: z.ZodObject<{
|
|
|
171
187
|
website_url?: string | undefined;
|
|
172
188
|
}, {
|
|
173
189
|
_id?: string | undefined;
|
|
190
|
+
created_by?: string | undefined;
|
|
191
|
+
updated_by?: string | undefined;
|
|
174
192
|
contact_emails_pta?: string[] | undefined;
|
|
175
193
|
contact_emails_pto?: string[] | undefined;
|
|
176
194
|
fare_url?: string | undefined;
|