@tmlmobilidade/go-types-core 20261105.106.56 → 20261105.1522.39
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/banners/banner.d.ts +389 -0
- package/dist/banners/banner.js +27 -0
- package/dist/banners/index.d.ts +4 -0
- package/dist/banners/index.js +4 -0
- package/dist/banners/kind.d.ts +4 -0
- package/dist/banners/kind.js +5 -0
- package/dist/banners/link.d.ts +12 -0
- package/dist/banners/link.js +7 -0
- package/dist/banners/severity.d.ts +4 -0
- package/dist/banners/severity.js +5 -0
- package/dist/changelogs/changelog.d.ts +270 -0
- package/dist/changelogs/changelog.js +14 -0
- package/dist/changelogs/index.d.ts +3 -0
- package/dist/changelogs/index.js +3 -0
- package/dist/changelogs/item-category.d.ts +4 -0
- package/dist/changelogs/item-category.js +5 -0
- package/dist/changelogs/item.d.ts +18 -0
- package/dist/changelogs/item.js +10 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/platform/banners/banner-dismiss-platform-request.d.ts +12 -0
- package/dist/platform/banners/banner-dismiss-platform-request.js +8 -0
- package/dist/platform/banners/banner-dismiss-platform-response.d.ts +9 -0
- package/dist/platform/banners/banner-dismiss-platform-response.js +4 -0
- package/dist/platform/banners/banner-platform-response.d.ts +86 -0
- package/dist/platform/banners/banner-platform-response.js +6 -0
- package/dist/platform/banners/banners-platform-request.d.ts +9 -0
- package/dist/platform/banners/banners-platform-request.js +5 -0
- package/dist/platform/banners/index.d.ts +4 -0
- package/dist/platform/banners/index.js +4 -0
- package/dist/platform/changelogs/changelog-category-counts-platform-response.d.ts +15 -0
- package/dist/platform/changelogs/changelog-category-counts-platform-response.js +8 -0
- package/dist/platform/changelogs/changelog-platform-response.d.ts +92 -0
- package/dist/platform/changelogs/changelog-platform-response.js +7 -0
- package/dist/platform/changelogs/changelog-seen-platform-request.d.ts +9 -0
- package/dist/platform/changelogs/changelog-seen-platform-request.js +6 -0
- package/dist/platform/changelogs/changelog-seen-platform-response.d.ts +9 -0
- package/dist/platform/changelogs/changelog-seen-platform-response.js +4 -0
- package/dist/platform/changelogs/changelog-summary-platform-response.d.ts +104 -0
- package/dist/platform/changelogs/changelog-summary-platform-response.js +7 -0
- package/dist/platform/changelogs/changelogs-platform-request.d.ts +9 -0
- package/dist/platform/changelogs/changelogs-platform-request.js +7 -0
- package/dist/platform/changelogs/index.d.ts +6 -0
- package/dist/platform/changelogs/index.js +6 -0
- package/dist/platform/index.d.ts +2 -0
- package/dist/platform/index.js +2 -0
- package/dist/roles/role.d.ts +90 -0
- package/dist/users/banner-dismissal.d.ts +17 -0
- package/dist/users/banner-dismissal.js +9 -0
- package/dist/users/changelog-seen.d.ts +14 -0
- package/dist/users/changelog-seen.js +8 -0
- package/dist/users/index.d.ts +2 -0
- package/dist/users/index.js +2 -0
- package/dist/users/simplified-user.d.ts +45 -0
- package/dist/users/user.d.ts +212 -1
- package/dist/users/user.js +5 -1
- package/package.json +1 -1
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const BannerSchema: z.ZodEffects<z.ZodObject<{
|
|
3
|
+
_id: z.ZodString;
|
|
4
|
+
created_at: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("@tmlmobilidade/go-types-shared").UnixMilliseconds, string | number>;
|
|
5
|
+
created_by: z.ZodString;
|
|
6
|
+
is_locked: z.ZodDefault<z.ZodBoolean>;
|
|
7
|
+
updated_at: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("@tmlmobilidade/go-types-shared").UnixMilliseconds, string | number>;
|
|
8
|
+
updated_by: z.ZodOptional<z.ZodString>;
|
|
9
|
+
} & {
|
|
10
|
+
dismissal_version: z.ZodDefault<z.ZodNumber>;
|
|
11
|
+
dismissible: z.ZodDefault<z.ZodBoolean>;
|
|
12
|
+
ends_at: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("@tmlmobilidade/go-types-shared").UnixMilliseconds, string | number>>>;
|
|
13
|
+
kind: z.ZodEnum<["maintenance", "incident", "announcement"]>;
|
|
14
|
+
link: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
15
|
+
label: z.ZodString;
|
|
16
|
+
url: z.ZodString;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
url: string;
|
|
19
|
+
label: string;
|
|
20
|
+
}, {
|
|
21
|
+
url: string;
|
|
22
|
+
label: string;
|
|
23
|
+
}>>>;
|
|
24
|
+
message: z.ZodString;
|
|
25
|
+
publish_status: z.ZodDefault<z.ZodPipeline<z.ZodEffects<z.ZodString, string, string>, z.ZodEnum<["published", "archived", "draft"]>>>;
|
|
26
|
+
scope: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
27
|
+
type: z.ZodLiteral<"platform">;
|
|
28
|
+
}, "strict", z.ZodTypeAny, {
|
|
29
|
+
type: "platform";
|
|
30
|
+
}, {
|
|
31
|
+
type: "platform";
|
|
32
|
+
}>, z.ZodObject<{
|
|
33
|
+
module_ids: z.ZodEffects<z.ZodArray<z.ZodEnum<["apex", "core", "dates", "exporter", "hub", "infrastructure", "offer", "operation", "performance", "tracker"]>, "atleastone">, ["apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker", ...("apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker")[]], ["apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker", ...("apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker")[]]>;
|
|
34
|
+
type: z.ZodLiteral<"modules">;
|
|
35
|
+
}, "strict", z.ZodTypeAny, {
|
|
36
|
+
type: "modules";
|
|
37
|
+
module_ids: ["apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker", ...("apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker")[]];
|
|
38
|
+
}, {
|
|
39
|
+
type: "modules";
|
|
40
|
+
module_ids: ["apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker", ...("apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker")[]];
|
|
41
|
+
}>]>;
|
|
42
|
+
severity: z.ZodDefault<z.ZodEnum<["info", "warning", "critical"]>>;
|
|
43
|
+
starts_at: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("@tmlmobilidade/go-types-shared").UnixMilliseconds, string | number>>>;
|
|
44
|
+
title: z.ZodString;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
message: string;
|
|
47
|
+
_id: string;
|
|
48
|
+
created_at: number & {
|
|
49
|
+
__brand: "UnixMilliseconds";
|
|
50
|
+
};
|
|
51
|
+
created_by: string;
|
|
52
|
+
is_locked: boolean;
|
|
53
|
+
updated_at: number & {
|
|
54
|
+
__brand: "UnixMilliseconds";
|
|
55
|
+
};
|
|
56
|
+
title: string;
|
|
57
|
+
scope: {
|
|
58
|
+
type: "platform";
|
|
59
|
+
} | {
|
|
60
|
+
type: "modules";
|
|
61
|
+
module_ids: ["apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker", ...("apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker")[]];
|
|
62
|
+
};
|
|
63
|
+
ends_at: import("@tmlmobilidade/go-types-shared").UnixMilliseconds | null;
|
|
64
|
+
dismissal_version: number;
|
|
65
|
+
dismissible: boolean;
|
|
66
|
+
kind: "maintenance" | "incident" | "announcement";
|
|
67
|
+
link: {
|
|
68
|
+
url: string;
|
|
69
|
+
label: string;
|
|
70
|
+
} | null;
|
|
71
|
+
publish_status: "published" | "archived" | "draft";
|
|
72
|
+
severity: "info" | "warning" | "critical";
|
|
73
|
+
starts_at: import("@tmlmobilidade/go-types-shared").UnixMilliseconds | null;
|
|
74
|
+
updated_by?: string | undefined;
|
|
75
|
+
}, {
|
|
76
|
+
message: string;
|
|
77
|
+
_id: string;
|
|
78
|
+
created_at: string | number;
|
|
79
|
+
created_by: string;
|
|
80
|
+
updated_at: string | number;
|
|
81
|
+
title: string;
|
|
82
|
+
scope: {
|
|
83
|
+
type: "platform";
|
|
84
|
+
} | {
|
|
85
|
+
type: "modules";
|
|
86
|
+
module_ids: ["apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker", ...("apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker")[]];
|
|
87
|
+
};
|
|
88
|
+
kind: "maintenance" | "incident" | "announcement";
|
|
89
|
+
is_locked?: boolean | undefined;
|
|
90
|
+
updated_by?: string | undefined;
|
|
91
|
+
ends_at?: string | number | null | undefined;
|
|
92
|
+
dismissal_version?: number | undefined;
|
|
93
|
+
dismissible?: boolean | undefined;
|
|
94
|
+
link?: {
|
|
95
|
+
url: string;
|
|
96
|
+
label: string;
|
|
97
|
+
} | null | undefined;
|
|
98
|
+
publish_status?: string | undefined;
|
|
99
|
+
severity?: "info" | "warning" | "critical" | undefined;
|
|
100
|
+
starts_at?: string | number | null | undefined;
|
|
101
|
+
}>, {
|
|
102
|
+
message: string;
|
|
103
|
+
_id: string;
|
|
104
|
+
created_at: number & {
|
|
105
|
+
__brand: "UnixMilliseconds";
|
|
106
|
+
};
|
|
107
|
+
created_by: string;
|
|
108
|
+
is_locked: boolean;
|
|
109
|
+
updated_at: number & {
|
|
110
|
+
__brand: "UnixMilliseconds";
|
|
111
|
+
};
|
|
112
|
+
title: string;
|
|
113
|
+
scope: {
|
|
114
|
+
type: "platform";
|
|
115
|
+
} | {
|
|
116
|
+
type: "modules";
|
|
117
|
+
module_ids: ["apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker", ...("apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker")[]];
|
|
118
|
+
};
|
|
119
|
+
ends_at: import("@tmlmobilidade/go-types-shared").UnixMilliseconds | null;
|
|
120
|
+
dismissal_version: number;
|
|
121
|
+
dismissible: boolean;
|
|
122
|
+
kind: "maintenance" | "incident" | "announcement";
|
|
123
|
+
link: {
|
|
124
|
+
url: string;
|
|
125
|
+
label: string;
|
|
126
|
+
} | null;
|
|
127
|
+
publish_status: "published" | "archived" | "draft";
|
|
128
|
+
severity: "info" | "warning" | "critical";
|
|
129
|
+
starts_at: import("@tmlmobilidade/go-types-shared").UnixMilliseconds | null;
|
|
130
|
+
updated_by?: string | undefined;
|
|
131
|
+
}, {
|
|
132
|
+
message: string;
|
|
133
|
+
_id: string;
|
|
134
|
+
created_at: string | number;
|
|
135
|
+
created_by: string;
|
|
136
|
+
updated_at: string | number;
|
|
137
|
+
title: string;
|
|
138
|
+
scope: {
|
|
139
|
+
type: "platform";
|
|
140
|
+
} | {
|
|
141
|
+
type: "modules";
|
|
142
|
+
module_ids: ["apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker", ...("apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker")[]];
|
|
143
|
+
};
|
|
144
|
+
kind: "maintenance" | "incident" | "announcement";
|
|
145
|
+
is_locked?: boolean | undefined;
|
|
146
|
+
updated_by?: string | undefined;
|
|
147
|
+
ends_at?: string | number | null | undefined;
|
|
148
|
+
dismissal_version?: number | undefined;
|
|
149
|
+
dismissible?: boolean | undefined;
|
|
150
|
+
link?: {
|
|
151
|
+
url: string;
|
|
152
|
+
label: string;
|
|
153
|
+
} | null | undefined;
|
|
154
|
+
publish_status?: string | undefined;
|
|
155
|
+
severity?: "info" | "warning" | "critical" | undefined;
|
|
156
|
+
starts_at?: string | number | null | undefined;
|
|
157
|
+
}>;
|
|
158
|
+
export declare const CreateBannerSchema: z.ZodEffects<z.ZodObject<Omit<{
|
|
159
|
+
_id: z.ZodString;
|
|
160
|
+
created_at: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("@tmlmobilidade/go-types-shared").UnixMilliseconds, string | number>;
|
|
161
|
+
created_by: z.ZodString;
|
|
162
|
+
is_locked: z.ZodDefault<z.ZodBoolean>;
|
|
163
|
+
updated_at: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("@tmlmobilidade/go-types-shared").UnixMilliseconds, string | number>;
|
|
164
|
+
updated_by: z.ZodOptional<z.ZodString>;
|
|
165
|
+
} & {
|
|
166
|
+
dismissal_version: z.ZodDefault<z.ZodNumber>;
|
|
167
|
+
dismissible: z.ZodDefault<z.ZodBoolean>;
|
|
168
|
+
ends_at: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("@tmlmobilidade/go-types-shared").UnixMilliseconds, string | number>>>;
|
|
169
|
+
kind: z.ZodEnum<["maintenance", "incident", "announcement"]>;
|
|
170
|
+
link: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
171
|
+
label: z.ZodString;
|
|
172
|
+
url: z.ZodString;
|
|
173
|
+
}, "strip", z.ZodTypeAny, {
|
|
174
|
+
url: string;
|
|
175
|
+
label: string;
|
|
176
|
+
}, {
|
|
177
|
+
url: string;
|
|
178
|
+
label: string;
|
|
179
|
+
}>>>;
|
|
180
|
+
message: z.ZodString;
|
|
181
|
+
publish_status: z.ZodDefault<z.ZodPipeline<z.ZodEffects<z.ZodString, string, string>, z.ZodEnum<["published", "archived", "draft"]>>>;
|
|
182
|
+
scope: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
183
|
+
type: z.ZodLiteral<"platform">;
|
|
184
|
+
}, "strict", z.ZodTypeAny, {
|
|
185
|
+
type: "platform";
|
|
186
|
+
}, {
|
|
187
|
+
type: "platform";
|
|
188
|
+
}>, z.ZodObject<{
|
|
189
|
+
module_ids: z.ZodEffects<z.ZodArray<z.ZodEnum<["apex", "core", "dates", "exporter", "hub", "infrastructure", "offer", "operation", "performance", "tracker"]>, "atleastone">, ["apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker", ...("apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker")[]], ["apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker", ...("apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker")[]]>;
|
|
190
|
+
type: z.ZodLiteral<"modules">;
|
|
191
|
+
}, "strict", z.ZodTypeAny, {
|
|
192
|
+
type: "modules";
|
|
193
|
+
module_ids: ["apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker", ...("apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker")[]];
|
|
194
|
+
}, {
|
|
195
|
+
type: "modules";
|
|
196
|
+
module_ids: ["apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker", ...("apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker")[]];
|
|
197
|
+
}>]>;
|
|
198
|
+
severity: z.ZodDefault<z.ZodEnum<["info", "warning", "critical"]>>;
|
|
199
|
+
starts_at: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("@tmlmobilidade/go-types-shared").UnixMilliseconds, string | number>>>;
|
|
200
|
+
title: z.ZodString;
|
|
201
|
+
}, "_id" | "created_at" | "created_by" | "is_locked" | "updated_at" | "updated_by" | "dismissal_version" | "publish_status">, "strip", z.ZodTypeAny, {
|
|
202
|
+
message: string;
|
|
203
|
+
title: string;
|
|
204
|
+
scope: {
|
|
205
|
+
type: "platform";
|
|
206
|
+
} | {
|
|
207
|
+
type: "modules";
|
|
208
|
+
module_ids: ["apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker", ...("apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker")[]];
|
|
209
|
+
};
|
|
210
|
+
ends_at: import("@tmlmobilidade/go-types-shared").UnixMilliseconds | null;
|
|
211
|
+
dismissible: boolean;
|
|
212
|
+
kind: "maintenance" | "incident" | "announcement";
|
|
213
|
+
link: {
|
|
214
|
+
url: string;
|
|
215
|
+
label: string;
|
|
216
|
+
} | null;
|
|
217
|
+
severity: "info" | "warning" | "critical";
|
|
218
|
+
starts_at: import("@tmlmobilidade/go-types-shared").UnixMilliseconds | null;
|
|
219
|
+
}, {
|
|
220
|
+
message: string;
|
|
221
|
+
title: string;
|
|
222
|
+
scope: {
|
|
223
|
+
type: "platform";
|
|
224
|
+
} | {
|
|
225
|
+
type: "modules";
|
|
226
|
+
module_ids: ["apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker", ...("apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker")[]];
|
|
227
|
+
};
|
|
228
|
+
kind: "maintenance" | "incident" | "announcement";
|
|
229
|
+
ends_at?: string | number | null | undefined;
|
|
230
|
+
dismissible?: boolean | undefined;
|
|
231
|
+
link?: {
|
|
232
|
+
url: string;
|
|
233
|
+
label: string;
|
|
234
|
+
} | null | undefined;
|
|
235
|
+
severity?: "info" | "warning" | "critical" | undefined;
|
|
236
|
+
starts_at?: string | number | null | undefined;
|
|
237
|
+
}>, {
|
|
238
|
+
message: string;
|
|
239
|
+
title: string;
|
|
240
|
+
scope: {
|
|
241
|
+
type: "platform";
|
|
242
|
+
} | {
|
|
243
|
+
type: "modules";
|
|
244
|
+
module_ids: ["apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker", ...("apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker")[]];
|
|
245
|
+
};
|
|
246
|
+
ends_at: import("@tmlmobilidade/go-types-shared").UnixMilliseconds | null;
|
|
247
|
+
dismissible: boolean;
|
|
248
|
+
kind: "maintenance" | "incident" | "announcement";
|
|
249
|
+
link: {
|
|
250
|
+
url: string;
|
|
251
|
+
label: string;
|
|
252
|
+
} | null;
|
|
253
|
+
severity: "info" | "warning" | "critical";
|
|
254
|
+
starts_at: import("@tmlmobilidade/go-types-shared").UnixMilliseconds | null;
|
|
255
|
+
}, {
|
|
256
|
+
message: string;
|
|
257
|
+
title: string;
|
|
258
|
+
scope: {
|
|
259
|
+
type: "platform";
|
|
260
|
+
} | {
|
|
261
|
+
type: "modules";
|
|
262
|
+
module_ids: ["apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker", ...("apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker")[]];
|
|
263
|
+
};
|
|
264
|
+
kind: "maintenance" | "incident" | "announcement";
|
|
265
|
+
ends_at?: string | number | null | undefined;
|
|
266
|
+
dismissible?: boolean | undefined;
|
|
267
|
+
link?: {
|
|
268
|
+
url: string;
|
|
269
|
+
label: string;
|
|
270
|
+
} | null | undefined;
|
|
271
|
+
severity?: "info" | "warning" | "critical" | undefined;
|
|
272
|
+
starts_at?: string | number | null | undefined;
|
|
273
|
+
}>;
|
|
274
|
+
export declare const UpdateBannerSchema: z.ZodEffects<z.ZodObject<{
|
|
275
|
+
message: z.ZodOptional<z.ZodString>;
|
|
276
|
+
title: z.ZodOptional<z.ZodString>;
|
|
277
|
+
scope: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
278
|
+
type: z.ZodLiteral<"platform">;
|
|
279
|
+
}, "strict", z.ZodTypeAny, {
|
|
280
|
+
type: "platform";
|
|
281
|
+
}, {
|
|
282
|
+
type: "platform";
|
|
283
|
+
}>, z.ZodObject<{
|
|
284
|
+
module_ids: z.ZodEffects<z.ZodArray<z.ZodEnum<["apex", "core", "dates", "exporter", "hub", "infrastructure", "offer", "operation", "performance", "tracker"]>, "atleastone">, ["apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker", ...("apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker")[]], ["apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker", ...("apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker")[]]>;
|
|
285
|
+
type: z.ZodLiteral<"modules">;
|
|
286
|
+
}, "strict", z.ZodTypeAny, {
|
|
287
|
+
type: "modules";
|
|
288
|
+
module_ids: ["apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker", ...("apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker")[]];
|
|
289
|
+
}, {
|
|
290
|
+
type: "modules";
|
|
291
|
+
module_ids: ["apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker", ...("apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker")[]];
|
|
292
|
+
}>]>>;
|
|
293
|
+
ends_at: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("@tmlmobilidade/go-types-shared").UnixMilliseconds, string | number>>>>;
|
|
294
|
+
dismissible: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
295
|
+
kind: z.ZodOptional<z.ZodEnum<["maintenance", "incident", "announcement"]>>;
|
|
296
|
+
link: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
297
|
+
label: z.ZodString;
|
|
298
|
+
url: z.ZodString;
|
|
299
|
+
}, "strip", z.ZodTypeAny, {
|
|
300
|
+
url: string;
|
|
301
|
+
label: string;
|
|
302
|
+
}, {
|
|
303
|
+
url: string;
|
|
304
|
+
label: string;
|
|
305
|
+
}>>>>;
|
|
306
|
+
severity: z.ZodOptional<z.ZodDefault<z.ZodEnum<["info", "warning", "critical"]>>>;
|
|
307
|
+
starts_at: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("@tmlmobilidade/go-types-shared").UnixMilliseconds, string | number>>>>;
|
|
308
|
+
} & {
|
|
309
|
+
publish_status: z.ZodOptional<z.ZodPipeline<z.ZodEffects<z.ZodString, string, string>, z.ZodEnum<["published", "archived", "draft"]>>>;
|
|
310
|
+
}, "strip", z.ZodTypeAny, {
|
|
311
|
+
message?: string | undefined;
|
|
312
|
+
title?: string | undefined;
|
|
313
|
+
scope?: {
|
|
314
|
+
type: "platform";
|
|
315
|
+
} | {
|
|
316
|
+
type: "modules";
|
|
317
|
+
module_ids: ["apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker", ...("apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker")[]];
|
|
318
|
+
} | undefined;
|
|
319
|
+
ends_at?: import("@tmlmobilidade/go-types-shared").UnixMilliseconds | null | undefined;
|
|
320
|
+
dismissible?: boolean | undefined;
|
|
321
|
+
kind?: "maintenance" | "incident" | "announcement" | undefined;
|
|
322
|
+
link?: {
|
|
323
|
+
url: string;
|
|
324
|
+
label: string;
|
|
325
|
+
} | null | undefined;
|
|
326
|
+
publish_status?: "published" | "archived" | "draft" | undefined;
|
|
327
|
+
severity?: "info" | "warning" | "critical" | undefined;
|
|
328
|
+
starts_at?: import("@tmlmobilidade/go-types-shared").UnixMilliseconds | null | undefined;
|
|
329
|
+
}, {
|
|
330
|
+
message?: string | undefined;
|
|
331
|
+
title?: string | undefined;
|
|
332
|
+
scope?: {
|
|
333
|
+
type: "platform";
|
|
334
|
+
} | {
|
|
335
|
+
type: "modules";
|
|
336
|
+
module_ids: ["apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker", ...("apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker")[]];
|
|
337
|
+
} | undefined;
|
|
338
|
+
ends_at?: string | number | null | undefined;
|
|
339
|
+
dismissible?: boolean | undefined;
|
|
340
|
+
kind?: "maintenance" | "incident" | "announcement" | undefined;
|
|
341
|
+
link?: {
|
|
342
|
+
url: string;
|
|
343
|
+
label: string;
|
|
344
|
+
} | null | undefined;
|
|
345
|
+
publish_status?: string | undefined;
|
|
346
|
+
severity?: "info" | "warning" | "critical" | undefined;
|
|
347
|
+
starts_at?: string | number | null | undefined;
|
|
348
|
+
}>, {
|
|
349
|
+
message?: string | undefined;
|
|
350
|
+
title?: string | undefined;
|
|
351
|
+
scope?: {
|
|
352
|
+
type: "platform";
|
|
353
|
+
} | {
|
|
354
|
+
type: "modules";
|
|
355
|
+
module_ids: ["apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker", ...("apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker")[]];
|
|
356
|
+
} | undefined;
|
|
357
|
+
ends_at?: import("@tmlmobilidade/go-types-shared").UnixMilliseconds | null | undefined;
|
|
358
|
+
dismissible?: boolean | undefined;
|
|
359
|
+
kind?: "maintenance" | "incident" | "announcement" | undefined;
|
|
360
|
+
link?: {
|
|
361
|
+
url: string;
|
|
362
|
+
label: string;
|
|
363
|
+
} | null | undefined;
|
|
364
|
+
publish_status?: "published" | "archived" | "draft" | undefined;
|
|
365
|
+
severity?: "info" | "warning" | "critical" | undefined;
|
|
366
|
+
starts_at?: import("@tmlmobilidade/go-types-shared").UnixMilliseconds | null | undefined;
|
|
367
|
+
}, {
|
|
368
|
+
message?: string | undefined;
|
|
369
|
+
title?: string | undefined;
|
|
370
|
+
scope?: {
|
|
371
|
+
type: "platform";
|
|
372
|
+
} | {
|
|
373
|
+
type: "modules";
|
|
374
|
+
module_ids: ["apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker", ...("apex" | "core" | "dates" | "exporter" | "hub" | "infrastructure" | "offer" | "operation" | "performance" | "tracker")[]];
|
|
375
|
+
} | undefined;
|
|
376
|
+
ends_at?: string | number | null | undefined;
|
|
377
|
+
dismissible?: boolean | undefined;
|
|
378
|
+
kind?: "maintenance" | "incident" | "announcement" | undefined;
|
|
379
|
+
link?: {
|
|
380
|
+
url: string;
|
|
381
|
+
label: string;
|
|
382
|
+
} | null | undefined;
|
|
383
|
+
publish_status?: string | undefined;
|
|
384
|
+
severity?: "info" | "warning" | "critical" | undefined;
|
|
385
|
+
starts_at?: string | number | null | undefined;
|
|
386
|
+
}>;
|
|
387
|
+
export type Banner = z.infer<typeof BannerSchema>;
|
|
388
|
+
export type CreateBannerDto = z.infer<typeof CreateBannerSchema>;
|
|
389
|
+
export type UpdateBannerDto = z.infer<typeof UpdateBannerSchema>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { BaseDocumentSchema, ModuleScopeSchema, PublishStatusSchema, UnixMillisecondsSchema } from '@tmlmobilidade/go-types-shared';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { BannerKindSchema } from './kind.js';
|
|
5
|
+
import { BannerLinkSchema } from './link.js';
|
|
6
|
+
import { BannerSeveritySchema } from './severity.js';
|
|
7
|
+
/* * */
|
|
8
|
+
function validateBannerSchedule(document, context) {
|
|
9
|
+
if (document.starts_at != null && document.ends_at != null && document.ends_at <= document.starts_at) {
|
|
10
|
+
context.addIssue({ code: z.ZodIssueCode.custom, message: 'The end must be after the start', path: ['ends_at'] });
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export const BannerSchema = BaseDocumentSchema.extend({
|
|
14
|
+
dismissal_version: z.number().int().positive().default(1),
|
|
15
|
+
dismissible: z.boolean().default(false),
|
|
16
|
+
ends_at: UnixMillisecondsSchema.nullable().default(null),
|
|
17
|
+
kind: BannerKindSchema,
|
|
18
|
+
link: BannerLinkSchema.nullable().default(null),
|
|
19
|
+
message: z.string().trim().min(1),
|
|
20
|
+
publish_status: PublishStatusSchema.default('draft'),
|
|
21
|
+
scope: ModuleScopeSchema,
|
|
22
|
+
severity: BannerSeveritySchema.default('info'),
|
|
23
|
+
starts_at: UnixMillisecondsSchema.nullable().default(null),
|
|
24
|
+
title: z.string().trim().min(1),
|
|
25
|
+
}).superRefine(validateBannerSchedule);
|
|
26
|
+
export const CreateBannerSchema = BannerSchema.innerType().omit({ _id: true, created_at: true, created_by: true, dismissal_version: true, is_locked: true, publish_status: true, updated_at: true, updated_by: true }).superRefine(validateBannerSchedule);
|
|
27
|
+
export const UpdateBannerSchema = CreateBannerSchema.innerType().partial().extend({ publish_status: PublishStatusSchema.optional() }).superRefine(validateBannerSchedule);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const BannerKindValues: readonly ["maintenance", "incident", "announcement"];
|
|
3
|
+
export declare const BannerKindSchema: z.ZodEnum<["maintenance", "incident", "announcement"]>;
|
|
4
|
+
export type BannerKind = z.infer<typeof BannerKindSchema>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const BannerLinkSchema: z.ZodObject<{
|
|
3
|
+
label: z.ZodString;
|
|
4
|
+
url: z.ZodString;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
url: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}, {
|
|
9
|
+
url: string;
|
|
10
|
+
label: string;
|
|
11
|
+
}>;
|
|
12
|
+
export type BannerLink = z.infer<typeof BannerLinkSchema>;
|