@assemblis/contracts 1.4.0 → 1.6.0
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/index.js +1 -1
- package/dist/schemas/api.d.ts +366 -0
- package/dist/schemas/base.d.ts +92 -0
- package/dist/types/enums.d.ts +2 -0
- package/dist/types/types.d.ts +5 -1
- package/package.json +1 -1
- package/src/schemas/api.ts +39 -0
- package/src/schemas/base.ts +30 -0
- package/src/types/enums.ts +2 -0
- package/src/types/types.ts +8 -0
package/dist/schemas/base.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export declare const ReportContentSchema: z.ZodObject<{
|
|
|
34
34
|
date: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
35
35
|
duration: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodInt>>, z.ZodTransform<number | null, number | null | undefined>>;
|
|
36
36
|
contact_information_url: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
37
|
+
language: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
37
38
|
cover_image_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
38
39
|
}, z.core.$strip>;
|
|
39
40
|
export declare const ReportSchema: z.ZodObject<{
|
|
@@ -66,6 +67,7 @@ export declare const ReportSchema: z.ZodObject<{
|
|
|
66
67
|
date: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
67
68
|
duration: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodInt>>, z.ZodTransform<number | null, number | null | undefined>>;
|
|
68
69
|
contact_information_url: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
70
|
+
language: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
69
71
|
cover_image_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
70
72
|
}, z.core.$strip>>>, z.ZodTransform<{
|
|
71
73
|
published_at: string | null;
|
|
@@ -83,6 +85,7 @@ export declare const ReportSchema: z.ZodObject<{
|
|
|
83
85
|
date: string | null;
|
|
84
86
|
duration: number | null;
|
|
85
87
|
contact_information_url: string | null;
|
|
88
|
+
language: string | null;
|
|
86
89
|
cover_image_id: string | null;
|
|
87
90
|
} | null, {
|
|
88
91
|
published_at: string | null;
|
|
@@ -100,6 +103,7 @@ export declare const ReportSchema: z.ZodObject<{
|
|
|
100
103
|
date: string | null;
|
|
101
104
|
duration: number | null;
|
|
102
105
|
contact_information_url: string | null;
|
|
106
|
+
language: string | null;
|
|
103
107
|
cover_image_id: string | null;
|
|
104
108
|
} | null | undefined>>;
|
|
105
109
|
published_content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
@@ -118,6 +122,7 @@ export declare const ReportSchema: z.ZodObject<{
|
|
|
118
122
|
date: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
119
123
|
duration: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodInt>>, z.ZodTransform<number | null, number | null | undefined>>;
|
|
120
124
|
contact_information_url: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
125
|
+
language: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
121
126
|
cover_image_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
122
127
|
}, z.core.$strip>>>, z.ZodTransform<{
|
|
123
128
|
published_at: string | null;
|
|
@@ -135,6 +140,7 @@ export declare const ReportSchema: z.ZodObject<{
|
|
|
135
140
|
date: string | null;
|
|
136
141
|
duration: number | null;
|
|
137
142
|
contact_information_url: string | null;
|
|
143
|
+
language: string | null;
|
|
138
144
|
cover_image_id: string | null;
|
|
139
145
|
} | null, {
|
|
140
146
|
published_at: string | null;
|
|
@@ -152,6 +158,7 @@ export declare const ReportSchema: z.ZodObject<{
|
|
|
152
158
|
date: string | null;
|
|
153
159
|
duration: number | null;
|
|
154
160
|
contact_information_url: string | null;
|
|
161
|
+
language: string | null;
|
|
155
162
|
cover_image_id: string | null;
|
|
156
163
|
} | null | undefined>>;
|
|
157
164
|
media: z.ZodObject<{
|
|
@@ -196,6 +203,7 @@ export declare const AdminReportSchema: z.ZodObject<{
|
|
|
196
203
|
date: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
197
204
|
duration: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodInt>>, z.ZodTransform<number | null, number | null | undefined>>;
|
|
198
205
|
contact_information_url: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
206
|
+
language: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
199
207
|
cover_image_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
200
208
|
}, z.core.$strip>>>, z.ZodTransform<{
|
|
201
209
|
published_at: string | null;
|
|
@@ -213,6 +221,7 @@ export declare const AdminReportSchema: z.ZodObject<{
|
|
|
213
221
|
date: string | null;
|
|
214
222
|
duration: number | null;
|
|
215
223
|
contact_information_url: string | null;
|
|
224
|
+
language: string | null;
|
|
216
225
|
cover_image_id: string | null;
|
|
217
226
|
} | null, {
|
|
218
227
|
published_at: string | null;
|
|
@@ -230,6 +239,7 @@ export declare const AdminReportSchema: z.ZodObject<{
|
|
|
230
239
|
date: string | null;
|
|
231
240
|
duration: number | null;
|
|
232
241
|
contact_information_url: string | null;
|
|
242
|
+
language: string | null;
|
|
233
243
|
cover_image_id: string | null;
|
|
234
244
|
} | null | undefined>>;
|
|
235
245
|
published_content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
@@ -248,6 +258,7 @@ export declare const AdminReportSchema: z.ZodObject<{
|
|
|
248
258
|
date: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
249
259
|
duration: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodInt>>, z.ZodTransform<number | null, number | null | undefined>>;
|
|
250
260
|
contact_information_url: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
261
|
+
language: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
251
262
|
cover_image_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
252
263
|
}, z.core.$strip>>>, z.ZodTransform<{
|
|
253
264
|
published_at: string | null;
|
|
@@ -265,6 +276,7 @@ export declare const AdminReportSchema: z.ZodObject<{
|
|
|
265
276
|
date: string | null;
|
|
266
277
|
duration: number | null;
|
|
267
278
|
contact_information_url: string | null;
|
|
279
|
+
language: string | null;
|
|
268
280
|
cover_image_id: string | null;
|
|
269
281
|
} | null, {
|
|
270
282
|
published_at: string | null;
|
|
@@ -282,6 +294,7 @@ export declare const AdminReportSchema: z.ZodObject<{
|
|
|
282
294
|
date: string | null;
|
|
283
295
|
duration: number | null;
|
|
284
296
|
contact_information_url: string | null;
|
|
297
|
+
language: string | null;
|
|
285
298
|
cover_image_id: string | null;
|
|
286
299
|
} | null | undefined>>;
|
|
287
300
|
media: z.ZodObject<{
|
|
@@ -297,6 +310,85 @@ export declare const AdminReportSchema: z.ZodObject<{
|
|
|
297
310
|
}, z.core.$strip>;
|
|
298
311
|
creator_id: z.ZodUUID;
|
|
299
312
|
}, z.core.$strip>;
|
|
313
|
+
export declare const ProfileLinkSchema: z.ZodObject<{
|
|
314
|
+
url: z.ZodURL;
|
|
315
|
+
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
316
|
+
platform: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
317
|
+
}, z.core.$strip>;
|
|
318
|
+
export declare const ProfileContentSchema: z.ZodObject<{
|
|
319
|
+
name: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
320
|
+
country: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
321
|
+
introduction: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
322
|
+
organization: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
323
|
+
links: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
324
|
+
url: z.ZodURL;
|
|
325
|
+
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
326
|
+
platform: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
327
|
+
}, z.core.$strip>>>;
|
|
328
|
+
show_on_map: z.ZodDefault<z.ZodBoolean>;
|
|
329
|
+
avatar_image_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
330
|
+
}, z.core.$strip>;
|
|
331
|
+
export declare const ProfileSchema: z.ZodObject<{
|
|
332
|
+
server_id: z.ZodUUID;
|
|
333
|
+
slug: z.ZodString;
|
|
334
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
335
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
336
|
+
content: z.ZodObject<{
|
|
337
|
+
name: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
338
|
+
country: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
339
|
+
introduction: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
340
|
+
organization: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
341
|
+
links: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
342
|
+
url: z.ZodURL;
|
|
343
|
+
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
344
|
+
platform: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
345
|
+
}, z.core.$strip>>>;
|
|
346
|
+
show_on_map: z.ZodDefault<z.ZodBoolean>;
|
|
347
|
+
avatar_image_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
348
|
+
}, z.core.$strip>;
|
|
349
|
+
media: z.ZodObject<{
|
|
350
|
+
images: z.ZodArray<z.ZodObject<{
|
|
351
|
+
id: z.ZodUUID;
|
|
352
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
353
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
354
|
+
alt: z.ZodString;
|
|
355
|
+
srcset: z.ZodString;
|
|
356
|
+
width: z.ZodInt;
|
|
357
|
+
height: z.ZodInt;
|
|
358
|
+
}, z.core.$strip>>;
|
|
359
|
+
}, z.core.$strip>;
|
|
360
|
+
}, z.core.$strip>;
|
|
361
|
+
export declare const PublicProfileSchema: z.ZodObject<{
|
|
362
|
+
server_id: z.ZodUUID;
|
|
363
|
+
slug: z.ZodString;
|
|
364
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
365
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
366
|
+
content: z.ZodObject<{
|
|
367
|
+
name: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
368
|
+
country: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
369
|
+
introduction: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
370
|
+
organization: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
371
|
+
links: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
372
|
+
url: z.ZodURL;
|
|
373
|
+
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
374
|
+
platform: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
375
|
+
}, z.core.$strip>>>;
|
|
376
|
+
show_on_map: z.ZodDefault<z.ZodBoolean>;
|
|
377
|
+
avatar_image_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
378
|
+
}, z.core.$strip>;
|
|
379
|
+
media: z.ZodObject<{
|
|
380
|
+
images: z.ZodArray<z.ZodObject<{
|
|
381
|
+
id: z.ZodUUID;
|
|
382
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
383
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
384
|
+
alt: z.ZodString;
|
|
385
|
+
srcset: z.ZodString;
|
|
386
|
+
width: z.ZodInt;
|
|
387
|
+
height: z.ZodInt;
|
|
388
|
+
}, z.core.$strip>>;
|
|
389
|
+
}, z.core.$strip>;
|
|
390
|
+
joined_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
391
|
+
}, z.core.$strip>;
|
|
300
392
|
export declare const UserSchema: z.ZodObject<{
|
|
301
393
|
id: z.ZodUUID;
|
|
302
394
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
package/dist/types/enums.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare enum ApiEndpoint {
|
|
2
2
|
ACCOUNT = "/account",
|
|
3
|
+
ACCOUNT_PROFILE = "/account/profile",
|
|
3
4
|
ACCOUNT_REPORTS = "/account/reports",
|
|
4
5
|
ADMIN = "/admin",
|
|
5
6
|
ADMIN_HEALTHCHECK = "/admin/healthcheck",
|
|
@@ -8,6 +9,7 @@ export declare enum ApiEndpoint {
|
|
|
8
9
|
ADMIN_USERS = "/admin/users",
|
|
9
10
|
INTEREST = "/interest",
|
|
10
11
|
LOGS = "/logs",
|
|
12
|
+
PEOPLE = "/people",
|
|
11
13
|
PING = "/ping",
|
|
12
14
|
PINS = "/pins",
|
|
13
15
|
REGISTER = "/register",
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
-
import { AdminReportSchema, AdminUserSchema, ImageSchema, PinSchema, ReportContentSchema, ReportSchema, UserSchema } from '../schemas/base';
|
|
2
|
+
import { AdminReportSchema, AdminUserSchema, ImageSchema, PinSchema, ProfileContentSchema, ProfileLinkSchema, ProfileSchema, PublicProfileSchema, ReportContentSchema, ReportSchema, UserSchema } from '../schemas/base';
|
|
3
3
|
export type AdminReport = z.infer<typeof AdminReportSchema>;
|
|
4
4
|
export type AdminUser = z.infer<typeof AdminUserSchema>;
|
|
5
5
|
export type Image = z.infer<typeof ImageSchema>;
|
|
6
6
|
export type Pin = z.infer<typeof PinSchema>;
|
|
7
|
+
export type Profile = z.infer<typeof ProfileSchema>;
|
|
8
|
+
export type ProfileContent = z.infer<typeof ProfileContentSchema>;
|
|
9
|
+
export type ProfileLink = z.infer<typeof ProfileLinkSchema>;
|
|
10
|
+
export type PublicProfile = z.infer<typeof PublicProfileSchema>;
|
|
7
11
|
export type Report = z.infer<typeof ReportSchema>;
|
|
8
12
|
export type ReportContent = z.infer<typeof ReportContentSchema>;
|
|
9
13
|
export type User = z.infer<typeof UserSchema>;
|
package/package.json
CHANGED
package/src/schemas/api.ts
CHANGED
|
@@ -10,6 +10,10 @@ import {
|
|
|
10
10
|
InterestSchema,
|
|
11
11
|
LogSchema,
|
|
12
12
|
PinSchema,
|
|
13
|
+
ProfileContentSchema,
|
|
14
|
+
ProfileLinkSchema,
|
|
15
|
+
ProfileSchema,
|
|
16
|
+
PublicProfileSchema,
|
|
13
17
|
RegisterSchema,
|
|
14
18
|
ReportContentSchema,
|
|
15
19
|
ReportSchema
|
|
@@ -78,6 +82,41 @@ export const PostAccountReportsIdCoverImageSchema = {
|
|
|
78
82
|
response: ReportSchema
|
|
79
83
|
};
|
|
80
84
|
|
|
85
|
+
export const GetAccountProfileSchema = {
|
|
86
|
+
endpoint: ApiEndpoint.ACCOUNT_PROFILE as const,
|
|
87
|
+
method: ApiRestMethod.GET,
|
|
88
|
+
payload: z.never(),
|
|
89
|
+
response: maybe(ProfileSchema)
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export const PutAccountProfileSchema = {
|
|
93
|
+
endpoint: ApiEndpoint.ACCOUNT_PROFILE as const,
|
|
94
|
+
method: ApiRestMethod.PUT,
|
|
95
|
+
payload: ProfileContentSchema.omit({ avatar_image_id: true }),
|
|
96
|
+
response: ProfileSchema
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export const PostAccountProfileAvatarSchema = {
|
|
100
|
+
endpoint: `${ApiEndpoint.ACCOUNT_PROFILE}/avatar` as const,
|
|
101
|
+
method: ApiRestMethod.POST,
|
|
102
|
+
payload: ImageSchema.pick({ alt: true }),
|
|
103
|
+
response: ProfileSchema
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const PostAccountProfileLinksUnfurlSchema = {
|
|
107
|
+
endpoint: `${ApiEndpoint.ACCOUNT_PROFILE}/links/unfurl` as const,
|
|
108
|
+
method: ApiRestMethod.POST,
|
|
109
|
+
payload: ProfileLinkSchema.pick({ url: true }),
|
|
110
|
+
response: ProfileLinkSchema
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export const GetPeopleSlugSchema = {
|
|
114
|
+
endpoint: `${ApiEndpoint.PEOPLE}/:slug` as const,
|
|
115
|
+
method: ApiRestMethod.GET,
|
|
116
|
+
payload: z.never(),
|
|
117
|
+
response: maybe(PublicProfileSchema)
|
|
118
|
+
};
|
|
119
|
+
|
|
81
120
|
export const PostInterestSchema = {
|
|
82
121
|
endpoint: ApiEndpoint.INTEREST as const,
|
|
83
122
|
method: ApiRestMethod.POST,
|
package/src/schemas/base.ts
CHANGED
|
@@ -56,6 +56,7 @@ export const ReportContentSchema = z.object({
|
|
|
56
56
|
date: maybe(z.string()),
|
|
57
57
|
duration: maybe(z.int()),
|
|
58
58
|
contact_information_url: maybe(z.string()),
|
|
59
|
+
language: maybe(z.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$/)),
|
|
59
60
|
cover_image_id: maybe(z.string())
|
|
60
61
|
});
|
|
61
62
|
|
|
@@ -77,6 +78,35 @@ export const AdminReportSchema = ReportSchema.extend({
|
|
|
77
78
|
creator_id: z.uuid()
|
|
78
79
|
});
|
|
79
80
|
|
|
81
|
+
export const ProfileLinkSchema = z.object({
|
|
82
|
+
url: z.url({ protocol: /^https?$/ }),
|
|
83
|
+
title: maybe(z.string()),
|
|
84
|
+
platform: maybe(z.string())
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
export const ProfileContentSchema = z.object({
|
|
88
|
+
name: maybe(z.string()),
|
|
89
|
+
country: maybe(z.string()),
|
|
90
|
+
introduction: maybe(z.string()),
|
|
91
|
+
organization: maybe(z.string()),
|
|
92
|
+
links: ProfileLinkSchema.array().default([]),
|
|
93
|
+
show_on_map: z.boolean().default(true),
|
|
94
|
+
avatar_image_id: maybe(z.string())
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
export const ProfileSchema = z.object({
|
|
98
|
+
server_id: z.uuid(),
|
|
99
|
+
slug: z.string(),
|
|
100
|
+
created_at: isoDateString,
|
|
101
|
+
updated_at: isoDateString,
|
|
102
|
+
content: ProfileContentSchema,
|
|
103
|
+
media: z.object({ images: ImageSchema.array() })
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
export const PublicProfileSchema = ProfileSchema.extend({
|
|
107
|
+
joined_at: isoDateString
|
|
108
|
+
});
|
|
109
|
+
|
|
80
110
|
export const UserSchema = z.object({
|
|
81
111
|
id: z.uuid(),
|
|
82
112
|
created_at: isoDateString,
|
package/src/types/enums.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export enum ApiEndpoint {
|
|
2
2
|
ACCOUNT = '/account',
|
|
3
|
+
ACCOUNT_PROFILE = '/account/profile',
|
|
3
4
|
ACCOUNT_REPORTS = '/account/reports',
|
|
4
5
|
ADMIN = '/admin',
|
|
5
6
|
ADMIN_HEALTHCHECK = '/admin/healthcheck',
|
|
@@ -8,6 +9,7 @@ export enum ApiEndpoint {
|
|
|
8
9
|
ADMIN_USERS = '/admin/users',
|
|
9
10
|
INTEREST = '/interest',
|
|
10
11
|
LOGS = '/logs',
|
|
12
|
+
PEOPLE = '/people',
|
|
11
13
|
PING = '/ping',
|
|
12
14
|
PINS = '/pins',
|
|
13
15
|
REGISTER = '/register',
|
package/src/types/types.ts
CHANGED
|
@@ -5,6 +5,10 @@ import {
|
|
|
5
5
|
AdminUserSchema,
|
|
6
6
|
ImageSchema,
|
|
7
7
|
PinSchema,
|
|
8
|
+
ProfileContentSchema,
|
|
9
|
+
ProfileLinkSchema,
|
|
10
|
+
ProfileSchema,
|
|
11
|
+
PublicProfileSchema,
|
|
8
12
|
ReportContentSchema,
|
|
9
13
|
ReportSchema,
|
|
10
14
|
UserSchema
|
|
@@ -14,6 +18,10 @@ export type AdminReport = z.infer<typeof AdminReportSchema>;
|
|
|
14
18
|
export type AdminUser = z.infer<typeof AdminUserSchema>;
|
|
15
19
|
export type Image = z.infer<typeof ImageSchema>;
|
|
16
20
|
export type Pin = z.infer<typeof PinSchema>;
|
|
21
|
+
export type Profile = z.infer<typeof ProfileSchema>;
|
|
22
|
+
export type ProfileContent = z.infer<typeof ProfileContentSchema>;
|
|
23
|
+
export type ProfileLink = z.infer<typeof ProfileLinkSchema>;
|
|
24
|
+
export type PublicProfile = z.infer<typeof PublicProfileSchema>;
|
|
17
25
|
export type Report = z.infer<typeof ReportSchema>;
|
|
18
26
|
export type ReportContent = z.infer<typeof ReportContentSchema>;
|
|
19
27
|
export type User = z.infer<typeof UserSchema>;
|