@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
|
@@ -5,9 +5,9 @@ export type CommentType = z.infer<typeof CommentTypeSchema>;
|
|
|
5
5
|
export declare const NoteCommentSchema: z.ZodObject<{
|
|
6
6
|
_id: z.ZodString;
|
|
7
7
|
created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
8
|
-
created_by: z.
|
|
8
|
+
created_by: z.ZodOptional<z.ZodString>;
|
|
9
9
|
updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
10
|
-
updated_by: z.
|
|
10
|
+
updated_by: z.ZodOptional<z.ZodString>;
|
|
11
11
|
} & {
|
|
12
12
|
message: z.ZodString;
|
|
13
13
|
type: z.ZodLiteral<"note">;
|
|
@@ -16,13 +16,13 @@ export declare const NoteCommentSchema: z.ZodObject<{
|
|
|
16
16
|
created_at: number & {
|
|
17
17
|
__brand: "UnixTimestamp";
|
|
18
18
|
};
|
|
19
|
-
created_by: string;
|
|
20
19
|
updated_at: number & {
|
|
21
20
|
__brand: "UnixTimestamp";
|
|
22
21
|
};
|
|
23
|
-
updated_by: string;
|
|
24
22
|
message: string;
|
|
25
23
|
type: "note";
|
|
24
|
+
created_by?: string | undefined;
|
|
25
|
+
updated_by?: string | undefined;
|
|
26
26
|
}, {
|
|
27
27
|
_id: string;
|
|
28
28
|
created_at: number;
|
|
@@ -65,9 +65,9 @@ export declare const SystemInfoCommentSchema: z.ZodObject<{
|
|
|
65
65
|
export declare const StatusChangedCommentSchema: z.ZodObject<{
|
|
66
66
|
_id: z.ZodString;
|
|
67
67
|
created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
68
|
-
created_by: z.
|
|
68
|
+
created_by: z.ZodOptional<z.ZodString>;
|
|
69
69
|
updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
70
|
-
updated_by: z.
|
|
70
|
+
updated_by: z.ZodOptional<z.ZodString>;
|
|
71
71
|
} & {
|
|
72
72
|
curr_status: z.ZodString;
|
|
73
73
|
prev_status: z.ZodString;
|
|
@@ -77,14 +77,14 @@ export declare const StatusChangedCommentSchema: z.ZodObject<{
|
|
|
77
77
|
created_at: number & {
|
|
78
78
|
__brand: "UnixTimestamp";
|
|
79
79
|
};
|
|
80
|
-
created_by: string;
|
|
81
80
|
updated_at: number & {
|
|
82
81
|
__brand: "UnixTimestamp";
|
|
83
82
|
};
|
|
84
|
-
updated_by: string;
|
|
85
83
|
type: "statusChanged";
|
|
86
84
|
curr_status: string;
|
|
87
85
|
prev_status: string;
|
|
86
|
+
created_by?: string | undefined;
|
|
87
|
+
updated_by?: string | undefined;
|
|
88
88
|
}, {
|
|
89
89
|
_id: string;
|
|
90
90
|
created_at: number;
|
|
@@ -98,9 +98,9 @@ export declare const StatusChangedCommentSchema: z.ZodObject<{
|
|
|
98
98
|
export declare const CommentSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
99
99
|
_id: z.ZodString;
|
|
100
100
|
created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
101
|
-
created_by: z.
|
|
101
|
+
created_by: z.ZodOptional<z.ZodString>;
|
|
102
102
|
updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
103
|
-
updated_by: z.
|
|
103
|
+
updated_by: z.ZodOptional<z.ZodString>;
|
|
104
104
|
} & {
|
|
105
105
|
message: z.ZodString;
|
|
106
106
|
type: z.ZodLiteral<"note">;
|
|
@@ -109,13 +109,13 @@ export declare const CommentSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type",
|
|
|
109
109
|
created_at: number & {
|
|
110
110
|
__brand: "UnixTimestamp";
|
|
111
111
|
};
|
|
112
|
-
created_by: string;
|
|
113
112
|
updated_at: number & {
|
|
114
113
|
__brand: "UnixTimestamp";
|
|
115
114
|
};
|
|
116
|
-
updated_by: string;
|
|
117
115
|
message: string;
|
|
118
116
|
type: "note";
|
|
117
|
+
created_by?: string | undefined;
|
|
118
|
+
updated_by?: string | undefined;
|
|
119
119
|
}, {
|
|
120
120
|
_id: string;
|
|
121
121
|
created_at: number;
|
|
@@ -156,9 +156,9 @@ export declare const CommentSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type",
|
|
|
156
156
|
}>, z.ZodObject<{
|
|
157
157
|
_id: z.ZodString;
|
|
158
158
|
created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
159
|
-
created_by: z.
|
|
159
|
+
created_by: z.ZodOptional<z.ZodString>;
|
|
160
160
|
updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
161
|
-
updated_by: z.
|
|
161
|
+
updated_by: z.ZodOptional<z.ZodString>;
|
|
162
162
|
} & {
|
|
163
163
|
curr_status: z.ZodString;
|
|
164
164
|
prev_status: z.ZodString;
|
|
@@ -168,14 +168,14 @@ export declare const CommentSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type",
|
|
|
168
168
|
created_at: number & {
|
|
169
169
|
__brand: "UnixTimestamp";
|
|
170
170
|
};
|
|
171
|
-
created_by: string;
|
|
172
171
|
updated_at: number & {
|
|
173
172
|
__brand: "UnixTimestamp";
|
|
174
173
|
};
|
|
175
|
-
updated_by: string;
|
|
176
174
|
type: "statusChanged";
|
|
177
175
|
curr_status: string;
|
|
178
176
|
prev_status: string;
|
|
177
|
+
created_by?: string | undefined;
|
|
178
|
+
updated_by?: string | undefined;
|
|
179
179
|
}, {
|
|
180
180
|
_id: string;
|
|
181
181
|
created_at: number;
|
|
@@ -190,13 +190,13 @@ export declare const CommentSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type",
|
|
|
190
190
|
created_at: number & {
|
|
191
191
|
__brand: "UnixTimestamp";
|
|
192
192
|
};
|
|
193
|
-
created_by: string;
|
|
194
193
|
updated_at: number & {
|
|
195
194
|
__brand: "UnixTimestamp";
|
|
196
195
|
};
|
|
197
|
-
updated_by: string;
|
|
198
196
|
message: string;
|
|
199
197
|
type: "note";
|
|
198
|
+
created_by?: string | undefined;
|
|
199
|
+
updated_by?: string | undefined;
|
|
200
200
|
} | {
|
|
201
201
|
_id: string;
|
|
202
202
|
created_at: number & {
|
|
@@ -214,14 +214,14 @@ export declare const CommentSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type",
|
|
|
214
214
|
created_at: number & {
|
|
215
215
|
__brand: "UnixTimestamp";
|
|
216
216
|
};
|
|
217
|
-
created_by: string;
|
|
218
217
|
updated_at: number & {
|
|
219
218
|
__brand: "UnixTimestamp";
|
|
220
219
|
};
|
|
221
|
-
updated_by: string;
|
|
222
220
|
type: "statusChanged";
|
|
223
221
|
curr_status: string;
|
|
224
222
|
prev_status: string;
|
|
223
|
+
created_by?: string | undefined;
|
|
224
|
+
updated_by?: string | undefined;
|
|
225
225
|
}, {
|
|
226
226
|
_id: string;
|
|
227
227
|
created_at: number;
|
|
@@ -2,19 +2,19 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare const DocumentSchema: z.ZodObject<{
|
|
3
3
|
_id: z.ZodString;
|
|
4
4
|
created_at: z.ZodEffects<z.ZodNumber, import("./unix-timestamp.js").UnixTimestamp, number>;
|
|
5
|
-
created_by: z.
|
|
5
|
+
created_by: z.ZodOptional<z.ZodString>;
|
|
6
6
|
updated_at: z.ZodEffects<z.ZodNumber, import("./unix-timestamp.js").UnixTimestamp, number>;
|
|
7
|
-
updated_by: z.
|
|
7
|
+
updated_by: z.ZodOptional<z.ZodString>;
|
|
8
8
|
}, "strip", z.ZodTypeAny, {
|
|
9
9
|
_id: string;
|
|
10
10
|
created_at: number & {
|
|
11
11
|
__brand: "UnixTimestamp";
|
|
12
12
|
};
|
|
13
|
-
created_by: string;
|
|
14
13
|
updated_at: number & {
|
|
15
14
|
__brand: "UnixTimestamp";
|
|
16
15
|
};
|
|
17
|
-
|
|
16
|
+
created_by?: string | undefined;
|
|
17
|
+
updated_by?: string | undefined;
|
|
18
18
|
}, {
|
|
19
19
|
_id: string;
|
|
20
20
|
created_at: number;
|
|
@@ -5,7 +5,7 @@ import { z } from 'zod';
|
|
|
5
5
|
export const DocumentSchema = z.object({
|
|
6
6
|
_id: z.string(),
|
|
7
7
|
created_at: unixTimeStampSchema,
|
|
8
|
-
created_by: z.string().
|
|
8
|
+
created_by: z.string().optional(),
|
|
9
9
|
updated_at: unixTimeStampSchema,
|
|
10
|
-
updated_by: z.string().
|
|
10
|
+
updated_by: z.string().optional(),
|
|
11
11
|
});
|
|
@@ -3,7 +3,7 @@ export declare const OPERATIONAL_DATE_FORMAT = "yyyyMMdd";
|
|
|
3
3
|
export type OperationalDate = string & {
|
|
4
4
|
__brand: 'OperationalDate';
|
|
5
5
|
};
|
|
6
|
-
export declare const operationalDateSchema: z.
|
|
6
|
+
export declare const operationalDateSchema: z.ZodEffects<z.ZodString, OperationalDate, string>;
|
|
7
7
|
/**
|
|
8
8
|
* This function validates if a string is a valid operational date.
|
|
9
9
|
* Throws an error if the date is invalid.
|
|
@@ -5,8 +5,7 @@ import { z } from 'zod';
|
|
|
5
5
|
export const OPERATIONAL_DATE_FORMAT = 'yyyyMMdd';
|
|
6
6
|
export const operationalDateSchema = z
|
|
7
7
|
.string()
|
|
8
|
-
.transform(validateOperationalDate)
|
|
9
|
-
.brand('OperationalDate');
|
|
8
|
+
.transform(validateOperationalDate);
|
|
10
9
|
/**
|
|
11
10
|
* This function validates if a string is a valid operational date.
|
|
12
11
|
* Throws an error if the date is invalid.
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { type UnixTimestamp } from './unix-timestamp.js';
|
|
2
1
|
import { z } from 'zod';
|
|
3
2
|
export declare const scopeSchema: z.ZodEnum<["stop", "lines"]>;
|
|
4
3
|
export declare const statusSchema: z.ZodDefault<z.ZodEnum<["pending", "accepted", "declined"]>>;
|
|
4
|
+
export type Scope = z.infer<typeof scopeSchema>;
|
|
5
|
+
export type Status = z.infer<typeof statusSchema>;
|
|
5
6
|
export declare const ProposedChangeSchema: z.ZodObject<{
|
|
6
7
|
_id: z.ZodString;
|
|
7
|
-
created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
8
|
-
created_by: z.
|
|
9
|
-
updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
10
|
-
updated_by: z.
|
|
8
|
+
created_at: z.ZodEffects<z.ZodNumber, import("./unix-timestamp.js").UnixTimestamp, number>;
|
|
9
|
+
created_by: z.ZodOptional<z.ZodString>;
|
|
10
|
+
updated_at: z.ZodEffects<z.ZodNumber, import("./unix-timestamp.js").UnixTimestamp, number>;
|
|
11
|
+
updated_by: z.ZodOptional<z.ZodString>;
|
|
11
12
|
} & {
|
|
12
13
|
field_path: z.ZodString;
|
|
13
14
|
field_value: z.ZodAny;
|
|
@@ -20,16 +21,16 @@ export declare const ProposedChangeSchema: z.ZodObject<{
|
|
|
20
21
|
created_at: number & {
|
|
21
22
|
__brand: "UnixTimestamp";
|
|
22
23
|
};
|
|
23
|
-
created_by: string;
|
|
24
24
|
updated_at: number & {
|
|
25
25
|
__brand: "UnixTimestamp";
|
|
26
26
|
};
|
|
27
|
-
updated_by: string;
|
|
28
27
|
status: "pending" | "accepted" | "declined";
|
|
29
28
|
field_path: string;
|
|
30
29
|
scope: "stop" | "lines";
|
|
31
30
|
target_id: string;
|
|
32
31
|
user_id: string;
|
|
32
|
+
created_by?: string | undefined;
|
|
33
|
+
updated_by?: string | undefined;
|
|
33
34
|
field_value?: any;
|
|
34
35
|
}, {
|
|
35
36
|
_id: string;
|
|
@@ -46,10 +47,10 @@ export declare const ProposedChangeSchema: z.ZodObject<{
|
|
|
46
47
|
}>;
|
|
47
48
|
export declare const CreateProposedChangeSchema: z.ZodObject<Omit<{
|
|
48
49
|
_id: z.ZodString;
|
|
49
|
-
created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
50
|
-
created_by: z.
|
|
51
|
-
updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
52
|
-
updated_by: z.
|
|
50
|
+
created_at: z.ZodEffects<z.ZodNumber, import("./unix-timestamp.js").UnixTimestamp, number>;
|
|
51
|
+
created_by: z.ZodOptional<z.ZodString>;
|
|
52
|
+
updated_at: z.ZodEffects<z.ZodNumber, import("./unix-timestamp.js").UnixTimestamp, number>;
|
|
53
|
+
updated_by: z.ZodOptional<z.ZodString>;
|
|
53
54
|
} & {
|
|
54
55
|
field_path: z.ZodString;
|
|
55
56
|
field_value: z.ZodAny;
|
|
@@ -58,13 +59,13 @@ export declare const CreateProposedChangeSchema: z.ZodObject<Omit<{
|
|
|
58
59
|
target_id: z.ZodString;
|
|
59
60
|
user_id: z.ZodString;
|
|
60
61
|
}, "_id" | "created_at" | "updated_at">, "strict", z.ZodTypeAny, {
|
|
61
|
-
created_by: string;
|
|
62
|
-
updated_by: string;
|
|
63
62
|
status: "pending" | "accepted" | "declined";
|
|
64
63
|
field_path: string;
|
|
65
64
|
scope: "stop" | "lines";
|
|
66
65
|
target_id: string;
|
|
67
66
|
user_id: string;
|
|
67
|
+
created_by?: string | undefined;
|
|
68
|
+
updated_by?: string | undefined;
|
|
68
69
|
field_value?: any;
|
|
69
70
|
}, {
|
|
70
71
|
field_path: string;
|
|
@@ -77,8 +78,7 @@ export declare const CreateProposedChangeSchema: z.ZodObject<Omit<{
|
|
|
77
78
|
field_value?: any;
|
|
78
79
|
}>;
|
|
79
80
|
export declare const UpdateProposedChangeSchema: z.ZodObject<{
|
|
80
|
-
|
|
81
|
-
updated_by: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
81
|
+
updated_by: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
82
82
|
status: z.ZodOptional<z.ZodDefault<z.ZodEnum<["pending", "accepted", "declined"]>>>;
|
|
83
83
|
field_path: z.ZodOptional<z.ZodString>;
|
|
84
84
|
field_value: z.ZodOptional<z.ZodAny>;
|
|
@@ -86,7 +86,6 @@ export declare const UpdateProposedChangeSchema: z.ZodObject<{
|
|
|
86
86
|
target_id: z.ZodOptional<z.ZodString>;
|
|
87
87
|
user_id: z.ZodOptional<z.ZodString>;
|
|
88
88
|
}, "strict", z.ZodTypeAny, {
|
|
89
|
-
created_by?: string | undefined;
|
|
90
89
|
updated_by?: string | undefined;
|
|
91
90
|
status?: "pending" | "accepted" | "declined" | undefined;
|
|
92
91
|
field_path?: string | undefined;
|
|
@@ -95,7 +94,6 @@ export declare const UpdateProposedChangeSchema: z.ZodObject<{
|
|
|
95
94
|
target_id?: string | undefined;
|
|
96
95
|
user_id?: string | undefined;
|
|
97
96
|
}, {
|
|
98
|
-
created_by?: string | undefined;
|
|
99
97
|
updated_by?: string | undefined;
|
|
100
98
|
status?: "pending" | "accepted" | "declined" | undefined;
|
|
101
99
|
field_path?: string | undefined;
|
|
@@ -104,26 +102,6 @@ export declare const UpdateProposedChangeSchema: z.ZodObject<{
|
|
|
104
102
|
target_id?: string | undefined;
|
|
105
103
|
user_id?: string | undefined;
|
|
106
104
|
}>;
|
|
107
|
-
export type
|
|
108
|
-
export type
|
|
109
|
-
export
|
|
110
|
-
created_at: UnixTimestamp;
|
|
111
|
-
field_path: string;
|
|
112
|
-
field_value: unknown;
|
|
113
|
-
scope: Scope;
|
|
114
|
-
status: Status;
|
|
115
|
-
target_id: string;
|
|
116
|
-
updated_at: UnixTimestamp;
|
|
117
|
-
user_id: string;
|
|
118
|
-
}
|
|
119
|
-
export interface CreateProposedChangeDto extends Omit<z.infer<typeof CreateProposedChangeSchema>, 'created_at' | 'field_path' | 'field_value' | 'scope' | 'status' | 'target_id' | 'updated_at' | 'user_id'> {
|
|
120
|
-
created_at: UnixTimestamp;
|
|
121
|
-
field_path: string;
|
|
122
|
-
field_value: unknown;
|
|
123
|
-
scope: Scope;
|
|
124
|
-
status: Status;
|
|
125
|
-
target_id: string;
|
|
126
|
-
updated_at: UnixTimestamp;
|
|
127
|
-
user_id: string;
|
|
128
|
-
}
|
|
129
|
-
export type UpdateProposedChangeDto = Partial<Omit<CreateProposedChangeDto, 'created_by'>>;
|
|
105
|
+
export type ProposedChange = z.infer<typeof ProposedChangeSchema>;
|
|
106
|
+
export type CreateProposedChangeDto = z.infer<typeof CreateProposedChangeSchema>;
|
|
107
|
+
export type UpdateProposedChangeDto = z.infer<typeof UpdateProposedChangeSchema>;
|
|
@@ -4,17 +4,11 @@ import { z } from 'zod';
|
|
|
4
4
|
/* * */
|
|
5
5
|
//
|
|
6
6
|
// Define constants for enum values for better maintainability
|
|
7
|
-
const SCOPE_VALUES = [
|
|
8
|
-
|
|
9
|
-
'lines',
|
|
10
|
-
];
|
|
11
|
-
const STATUS_VALUES = [
|
|
12
|
-
'pending', 'accepted', 'declined',
|
|
13
|
-
];
|
|
14
|
-
//
|
|
15
|
-
// Define schemas using constants
|
|
7
|
+
const SCOPE_VALUES = ['stop', 'lines'];
|
|
8
|
+
const STATUS_VALUES = ['pending', 'accepted', 'declined'];
|
|
16
9
|
export const scopeSchema = z.enum(SCOPE_VALUES);
|
|
17
10
|
export const statusSchema = z.enum(STATUS_VALUES).default('pending');
|
|
11
|
+
// Define schemas using constants
|
|
18
12
|
export const ProposedChangeSchema = DocumentSchema.extend({
|
|
19
13
|
field_path: z.string(),
|
|
20
14
|
field_value: z.any(),
|
|
@@ -23,8 +17,5 @@ export const ProposedChangeSchema = DocumentSchema.extend({
|
|
|
23
17
|
target_id: z.string(),
|
|
24
18
|
user_id: z.string(),
|
|
25
19
|
}).strict();
|
|
26
|
-
export const CreateProposedChangeSchema = ProposedChangeSchema
|
|
27
|
-
|
|
28
|
-
export const UpdateProposedChangeSchema = ProposedChangeSchema
|
|
29
|
-
.omit({ _id: true, created_at: true, updated_at: true })
|
|
30
|
-
.partial();
|
|
20
|
+
export const CreateProposedChangeSchema = ProposedChangeSchema.omit({ _id: true, created_at: true, updated_at: true });
|
|
21
|
+
export const UpdateProposedChangeSchema = CreateProposedChangeSchema.omit({ created_by: true }).partial();
|
package/dist/src/agency.d.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { type OperationalDate } from './_common/operational-date.js';
|
|
2
|
-
import { type UnixTimestamp } from './_common/unix-timestamp.js';
|
|
3
1
|
import { z } from 'zod';
|
|
4
2
|
export declare const AgencySchema: z.ZodObject<{
|
|
5
3
|
_id: z.ZodString;
|
|
6
|
-
created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
7
|
-
created_by: z.
|
|
8
|
-
updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
9
|
-
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>;
|
|
10
8
|
} & {
|
|
11
9
|
contact_emails_pta: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
12
10
|
contact_emails_pto: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -22,7 +20,7 @@ export declare const AgencySchema: z.ZodObject<{
|
|
|
22
20
|
total_vkm_per_year: number;
|
|
23
21
|
}>;
|
|
24
22
|
name: z.ZodString;
|
|
25
|
-
operation_start_date: z.ZodBranded<z.ZodEffects<z.ZodString, OperationalDate, string>, "OperationalDate">;
|
|
23
|
+
operation_start_date: z.ZodBranded<z.ZodEffects<z.ZodString, import("./_common/operational-date.js").OperationalDate, string>, "OperationalDate">;
|
|
26
24
|
phone: z.ZodString;
|
|
27
25
|
public_email: z.ZodString;
|
|
28
26
|
short_name: z.ZodString;
|
|
@@ -33,11 +31,9 @@ export declare const AgencySchema: z.ZodObject<{
|
|
|
33
31
|
created_at: number & {
|
|
34
32
|
__brand: "UnixTimestamp";
|
|
35
33
|
};
|
|
36
|
-
created_by: string;
|
|
37
34
|
updated_at: number & {
|
|
38
35
|
__brand: "UnixTimestamp";
|
|
39
36
|
};
|
|
40
|
-
updated_by: string;
|
|
41
37
|
contact_emails_pta: string[];
|
|
42
38
|
contact_emails_pto: string[];
|
|
43
39
|
fare_url: string;
|
|
@@ -54,6 +50,8 @@ export declare const AgencySchema: z.ZodObject<{
|
|
|
54
50
|
short_name: string;
|
|
55
51
|
timezone: string;
|
|
56
52
|
website_url: string;
|
|
53
|
+
created_by?: string | undefined;
|
|
54
|
+
updated_by?: string | undefined;
|
|
57
55
|
}, {
|
|
58
56
|
_id: string;
|
|
59
57
|
created_at: number;
|
|
@@ -77,10 +75,10 @@ export declare const AgencySchema: z.ZodObject<{
|
|
|
77
75
|
}>;
|
|
78
76
|
export declare const CreateAgencySchema: z.ZodObject<Omit<{
|
|
79
77
|
_id: z.ZodString;
|
|
80
|
-
created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
81
|
-
created_by: z.
|
|
82
|
-
updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
83
|
-
updated_by: z.
|
|
78
|
+
created_at: z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>;
|
|
79
|
+
created_by: z.ZodOptional<z.ZodString>;
|
|
80
|
+
updated_at: z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>;
|
|
81
|
+
updated_by: z.ZodOptional<z.ZodString>;
|
|
84
82
|
} & {
|
|
85
83
|
contact_emails_pta: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
86
84
|
contact_emails_pto: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -96,7 +94,7 @@ export declare const CreateAgencySchema: z.ZodObject<Omit<{
|
|
|
96
94
|
total_vkm_per_year: number;
|
|
97
95
|
}>;
|
|
98
96
|
name: z.ZodString;
|
|
99
|
-
operation_start_date: z.ZodBranded<z.ZodEffects<z.ZodString, OperationalDate, string>, "OperationalDate">;
|
|
97
|
+
operation_start_date: z.ZodBranded<z.ZodEffects<z.ZodString, import("./_common/operational-date.js").OperationalDate, string>, "OperationalDate">;
|
|
100
98
|
phone: z.ZodString;
|
|
101
99
|
public_email: z.ZodString;
|
|
102
100
|
short_name: z.ZodString;
|
|
@@ -104,8 +102,6 @@ export declare const CreateAgencySchema: z.ZodObject<Omit<{
|
|
|
104
102
|
website_url: z.ZodString;
|
|
105
103
|
}, "created_at" | "updated_at">, "strip", z.ZodTypeAny, {
|
|
106
104
|
_id: string;
|
|
107
|
-
created_by: string;
|
|
108
|
-
updated_by: string;
|
|
109
105
|
contact_emails_pta: string[];
|
|
110
106
|
contact_emails_pto: string[];
|
|
111
107
|
fare_url: string;
|
|
@@ -122,6 +118,8 @@ export declare const CreateAgencySchema: z.ZodObject<Omit<{
|
|
|
122
118
|
short_name: string;
|
|
123
119
|
timezone: string;
|
|
124
120
|
website_url: string;
|
|
121
|
+
created_by?: string | undefined;
|
|
122
|
+
updated_by?: string | undefined;
|
|
125
123
|
}, {
|
|
126
124
|
_id: string;
|
|
127
125
|
fare_url: string;
|
|
@@ -143,8 +141,7 @@ export declare const CreateAgencySchema: z.ZodObject<Omit<{
|
|
|
143
141
|
}>;
|
|
144
142
|
export declare const UpdateAgencySchema: z.ZodObject<{
|
|
145
143
|
_id: z.ZodOptional<z.ZodString>;
|
|
146
|
-
|
|
147
|
-
updated_by: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
144
|
+
updated_by: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
148
145
|
contact_emails_pta: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
|
|
149
146
|
contact_emails_pto: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
|
|
150
147
|
fare_url: z.ZodOptional<z.ZodString>;
|
|
@@ -159,7 +156,7 @@ export declare const UpdateAgencySchema: z.ZodObject<{
|
|
|
159
156
|
total_vkm_per_year: number;
|
|
160
157
|
}>>;
|
|
161
158
|
name: z.ZodOptional<z.ZodString>;
|
|
162
|
-
operation_start_date: z.ZodOptional<z.ZodBranded<z.ZodEffects<z.ZodString, OperationalDate, string>, "OperationalDate">>;
|
|
159
|
+
operation_start_date: z.ZodOptional<z.ZodBranded<z.ZodEffects<z.ZodString, import("./_common/operational-date.js").OperationalDate, string>, "OperationalDate">>;
|
|
163
160
|
phone: z.ZodOptional<z.ZodString>;
|
|
164
161
|
public_email: z.ZodOptional<z.ZodString>;
|
|
165
162
|
short_name: z.ZodOptional<z.ZodString>;
|
|
@@ -167,7 +164,6 @@ export declare const UpdateAgencySchema: z.ZodObject<{
|
|
|
167
164
|
website_url: z.ZodOptional<z.ZodString>;
|
|
168
165
|
}, "strip", z.ZodTypeAny, {
|
|
169
166
|
_id?: string | undefined;
|
|
170
|
-
created_by?: string | undefined;
|
|
171
167
|
updated_by?: string | undefined;
|
|
172
168
|
contact_emails_pta?: string[] | undefined;
|
|
173
169
|
contact_emails_pto?: string[] | undefined;
|
|
@@ -187,7 +183,6 @@ export declare const UpdateAgencySchema: z.ZodObject<{
|
|
|
187
183
|
website_url?: string | undefined;
|
|
188
184
|
}, {
|
|
189
185
|
_id?: string | undefined;
|
|
190
|
-
created_by?: string | undefined;
|
|
191
186
|
updated_by?: string | undefined;
|
|
192
187
|
contact_emails_pta?: string[] | undefined;
|
|
193
188
|
contact_emails_pto?: string[] | undefined;
|
|
@@ -204,15 +199,9 @@ export declare const UpdateAgencySchema: z.ZodObject<{
|
|
|
204
199
|
timezone?: string | undefined;
|
|
205
200
|
website_url?: string | undefined;
|
|
206
201
|
}>;
|
|
207
|
-
export
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
updated_at: UnixTimestamp;
|
|
211
|
-
}
|
|
212
|
-
export interface CreateAgencyDto extends Omit<z.infer<typeof CreateAgencySchema>, 'operation_start_date'> {
|
|
213
|
-
operation_start_date: OperationalDate;
|
|
214
|
-
}
|
|
215
|
-
export type UpdateAgencyDto = Partial<CreateAgencyDto>;
|
|
202
|
+
export type Agency = z.infer<typeof AgencySchema>;
|
|
203
|
+
export type CreateAgencyDto = z.infer<typeof CreateAgencySchema>;
|
|
204
|
+
export type UpdateAgencyDto = z.infer<typeof UpdateAgencySchema>;
|
|
216
205
|
export declare const AgencyPermissionSchema: z.ZodObject<{
|
|
217
206
|
agency_ids: z.ZodArray<z.ZodString, "many">;
|
|
218
207
|
municipality_ids: z.ZodArray<z.ZodString, "many">;
|
package/dist/src/agency.js
CHANGED
|
@@ -20,7 +20,7 @@ export const AgencySchema = DocumentSchema.extend({
|
|
|
20
20
|
website_url: z.string().url(),
|
|
21
21
|
}).strip();
|
|
22
22
|
export const CreateAgencySchema = AgencySchema.omit({ created_at: true, updated_at: true });
|
|
23
|
-
export const UpdateAgencySchema = CreateAgencySchema.partial();
|
|
23
|
+
export const UpdateAgencySchema = CreateAgencySchema.omit({ created_by: true }).partial();
|
|
24
24
|
/* * */
|
|
25
25
|
export const AgencyPermissionSchema = z.object({
|
|
26
26
|
agency_ids: z.array(z.string()),
|