@assemblis/contracts 1.6.0 → 1.7.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 +90 -15
- package/dist/schemas/base.d.ts +88 -0
- package/package.json +1 -1
- package/src/schemas/api.ts +8 -8
- package/src/schemas/base.ts +3 -2
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"zod";var t,n,o;!function(e){e.ACCOUNT="/account",e.ACCOUNT_PROFILE="/account/profile",e.ACCOUNT_REPORTS="/account/reports",e.ADMIN="/admin",e.ADMIN_HEALTHCHECK="/admin/healthcheck",e.ADMIN_PINS="/admin/pins",e.ADMIN_REPORTS="/admin/reports",e.ADMIN_USERS="/admin/users",e.INTEREST="/interest",e.LOGS="/logs",e.PEOPLE="/people",e.PING="/ping",e.PINS="/pins",e.REGISTER="/register",e.REPORTS="/reports"}(t||(t={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.PATCH="PATCH"}(n||(n={})),function(e){e.DISCARDED="DISCARDED",e.DRAFTED="DRAFT",e.PUBLISHED="PUBLISHED",e.CHANGED="CHANGED"}(o||(o={}));const
|
|
1
|
+
import e from"zod";var t,n,o;!function(e){e.ACCOUNT="/account",e.ACCOUNT_PROFILE="/account/profile",e.ACCOUNT_REPORTS="/account/reports",e.ADMIN="/admin",e.ADMIN_HEALTHCHECK="/admin/healthcheck",e.ADMIN_PINS="/admin/pins",e.ADMIN_REPORTS="/admin/reports",e.ADMIN_USERS="/admin/users",e.INTEREST="/interest",e.LOGS="/logs",e.PEOPLE="/people",e.PING="/ping",e.PINS="/pins",e.REGISTER="/register",e.REPORTS="/reports"}(t||(t={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.PATCH="PATCH"}(n||(n={})),function(e){e.DISCARDED="DISCARDED",e.DRAFTED="DRAFT",e.PUBLISHED="PUBLISHED",e.CHANGED="CHANGED"}(o||(o={}));const r=e.coerce.date().transform(e=>e.toISOString()),i=e=>e.nullish().transform(e=>e??null);function a(e,t){return Object.keys(t).reduce((e,n)=>e.replace(`:${n}`,t[n]),e)}const s=e.object({id:e.uuid(),created_at:r,updated_at:r,alt:e.string(),srcset:e.string(),width:e.int(),height:e.int()}),d=e.object({recaptcha_token:e.string(),email:e.email().toLowerCase().trim(),listIds:e.int().array(),firstname:e.string().nullish().transform(e=>e??void 0),lastname:e.string().nullish().transform(e=>e??void 0),country:e.string().nullish().transform(e=>e??void 0),organisation:e.string().nullish().transform(e=>e??void 0),has_assemblis_account:e.boolean().nullish().transform(e=>e??!1)}),p=e.object({published_at:i(r),title:i(e.string()),description:i(e.string()),location:i(e.string()),outputs:i(e.string().array()),initiation_type:i(e.string()),recruitment_method:i(e.string()),recruitment_description:i(e.string()),participant_count:i(e.int()),organiser_reflections:i(e.string()),organiser_report_url:i(e.string()),location_details:i(e.string()),date:i(e.string()),duration:i(e.int()),contact_information_url:i(e.string()),language:i(e.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$/)),cover_image_id:i(e.string())}),l=e.object({server_id:e.uuid(),client_id:e.uuid(),display_seq:e.int(),created_at:r,updated_at:r,published_at:i(r),state:e.enum(["DISCARDED","DRAFTED","PUBLISHED","CHANGED"]),slug:i(e.string()),draft_content:i(p),published_content:i(p),media:e.object({images:s.array()})}),c=l.extend({creator_id:e.uuid()}),u=e.object({url:e.url({protocol:/^https?$/}),title:i(e.string()),platform:i(e.string())}),m=e.object({name:i(e.string()),country:i(e.string()),introduction:i(e.string()),organization:i(e.string()),links:u.array().default([]),show_on_map:e.boolean().default(!1),avatar_image_id:i(e.string())}),_=e.object({server_id:e.uuid(),slug:e.string(),created_at:r,updated_at:r,content:m,media:e.object({images:s.array()})}),g=_.extend({joined_at:r});e.object({id:e.uuid(),created_at:r,updated_at:r,sub:e.string(),is_mutirao:e.boolean()});const T=e.object({id:e.uuid(),sub:e.string(),created_at:r,updated_at:r,report_count:e.int(),email:i(e.string()),profile:i(_)}),E=e.object({id:e.uuid(),created_at:r,updated_at:r,image_src:i(e.string()),has_image:e.boolean().meta({deprecated:!0}),user_id:e.uuid().meta({deprecated:!0}),published_at:i(r),name:e.string(),about:i(e.string()),topics:e.string().array(),country:i(e.string()),hide:e.boolean().default(!1)}),h=e.object({id:e.uuid(),created_at:e.coerce.date().transform(e=>e.toISOString()),updated_at:e.coerce.date().transform(e=>e.toISOString()),country:e.string(),text:i(e.string()),hide:e.boolean(),image_src:i(e.string()),has_image:e.boolean().meta({deprecated:!0})}),b=e.object({message:e.string().optional(),data:e.record(e.string(),e.string().optional()).optional(),metadata:e.object({origin:e.string(),route:e.string(),status:e.number()})}),S=e.object({type:e.literal("user.created"),object:e.literal("event"),data:e.object({id:e.string(),email_addresses:e.object({email_address:e.string()}).array()})}),P={endpoint:t.ACCOUNT_REPORTS,method:n.GET,payload:e.never(),response:e.object({reports:l.array(),total:e.int()})},y={endpoint:`${t.ACCOUNT_REPORTS}/:client_id`,method:n.GET,payload:e.never(),response:i(l)},O={endpoint:t.ACCOUNT_REPORTS,method:n.POST,payload:e.object({client_id:e.uuid(),content:i(p.omit({cover_image_id:!0}))}),response:l},R={endpoint:`${t.ACCOUNT_REPORTS}/:client_id/content`,method:n.PUT,payload:p.omit({published_at:!0,cover_image_id:!0}),response:l},C={endpoint:`${t.ACCOUNT_REPORTS}/:client_id/discard`,method:n.PATCH,payload:e.nullish(e.object()),response:i(l)},A={endpoint:`${t.ACCOUNT_REPORTS}/:client_id/publish`,method:n.PATCH,payload:e.object({published_at:r}),response:l},I={endpoint:`${t.ACCOUNT_REPORTS}/:client_id/unpublish`,method:n.PATCH,payload:e.nullish(e.object()),response:l},N={endpoint:`${t.ACCOUNT_REPORTS}/:client_id/cover-image`,method:n.POST,payload:s.pick({alt:!0}),response:l},j=10,D={endpoint:t.ACCOUNT_PROFILE,method:n.GET,payload:e.never(),response:i(_)},v={endpoint:t.ACCOUNT_PROFILE,method:n.PUT,payload:m.omit({avatar_image_id:!0}).extend({links:u.pick({url:!0}).array().max(10).default([])}),response:_},f={endpoint:`${t.ACCOUNT_PROFILE}/avatar`,method:n.POST,payload:s.pick({alt:!0}),response:_},G={endpoint:`${t.PEOPLE}/:slug`,method:n.GET,payload:e.never(),response:i(g)},U={endpoint:t.INTEREST,method:n.POST,payload:d,response:e.string()},H={endpoint:`${t.INTEREST}/assemblis`,method:n.POST,payload:d.omit({listIds:!0}),response:e.string()},$={endpoint:t.REPORTS,method:n.GET,payload:e.never(),response:e.object({reports:l.array(),total:e.int()})},L={endpoint:`${t.REPORTS}/:slug`,method:n.GET,payload:e.never(),response:i(l)},k={endpoint:t.PINS,method:n.GET,payload:e.never(),response:e.object({assemblies:E.array(),pins:h.array()})},M={endpoint:t.PINS,method:n.POST,payload:e.object({country:e.string(),email:e.string(),text:i(e.string())}),response:h},x={endpoint:t.ADMIN_REPORTS,method:n.GET,payload:e.never(),response:e.object({reports:c.array(),total:e.int()})},F={endpoint:t.ADMIN_USERS,method:n.GET,payload:e.never(),response:e.object({users:T.array(),total:e.int()})},z={endpoint:t.ADMIN_PINS,method:n.GET,payload:e.never(),response:e.object({pins:h.array()})},w={endpoint:`${t.ADMIN_PINS}/:id/hide`,method:n.PATCH,payload:e.never(),response:h},B={endpoint:t.ADMIN_HEALTHCHECK,method:n.GET,payload:e.never(),response:e.object({commit_hash:e.string().nullable(),deployed_at:e.string().nullable(),uptime_ms:e.int().nullable(),checks:e.object({database:e.enum(["ok","error"]),clerk:e.enum(["ok","error"])})})},K={endpoint:t.PING,method:n.GET,payload:e.never(),response:e.never()},q={endpoint:`${t.LOGS}/info`,method:n.POST,payload:b,response:e.string()},Z={endpoint:`${t.LOGS}/error`,method:n.POST,payload:b,response:e.string()},J={endpoint:t.REGISTER,method:n.POST,payload:S,response:e.string()};export{t as ApiEndpoint,n as ApiRestMethod,D as GetAccountProfileSchema,y as GetAccountReportsIdSchema,P as GetAccountReportsSchema,B as GetAdminHealthcheckSchema,z as GetAdminPinsSchema,x as GetAdminReportsSchema,F as GetAdminUsersSchema,G as GetPeopleSlugSchema,K as GetPingSchema,k as GetPinsSchema,$ as GetReportsSchema,L as GetReportsSlugSchema,j as MAX_PROFILE_LINKS,C as PatchAccountReportsIdDiscardSchema,A as PatchAccountReportsIdPublishSchema,I as PatchAccountReportsIdUnpublishSchema,w as PatchAdminPinHideSchema,f as PostAccountProfileAvatarSchema,N as PostAccountReportsIdCoverImageSchema,O as PostAccountReportsSchema,H as PostInterestAssemblisSchema,U as PostInterestSchema,Z as PostLogsErrorSchema,q as PostLogsInfoSchema,M as PostPinSchema,J as PostRegisterSchema,v as PutAccountProfileSchema,R as PutAccountReportsIdContentSchema,o as ReportState,a as resolvePath};
|
package/dist/schemas/api.d.ts
CHANGED
|
@@ -1437,6 +1437,7 @@ export declare const PostAccountReportsIdCoverImageSchema: {
|
|
|
1437
1437
|
}, z.core.$strip>;
|
|
1438
1438
|
}, z.core.$strip>;
|
|
1439
1439
|
};
|
|
1440
|
+
export declare const MAX_PROFILE_LINKS = 10;
|
|
1440
1441
|
export declare const GetAccountProfileSchema: {
|
|
1441
1442
|
endpoint: ApiEndpoint.ACCOUNT_PROFILE;
|
|
1442
1443
|
method: ApiRestMethod;
|
|
@@ -1538,12 +1539,10 @@ export declare const PutAccountProfileSchema: {
|
|
|
1538
1539
|
name: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
1539
1540
|
introduction: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
1540
1541
|
organization: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
1542
|
+
show_on_map: z.ZodDefault<z.ZodBoolean>;
|
|
1541
1543
|
links: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
1542
1544
|
url: z.ZodURL;
|
|
1543
|
-
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
1544
|
-
platform: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
1545
1545
|
}, z.core.$strip>>>;
|
|
1546
|
-
show_on_map: z.ZodDefault<z.ZodBoolean>;
|
|
1547
1546
|
}, z.core.$strip>;
|
|
1548
1547
|
response: z.ZodObject<{
|
|
1549
1548
|
server_id: z.ZodUUID;
|
|
@@ -1613,18 +1612,6 @@ export declare const PostAccountProfileAvatarSchema: {
|
|
|
1613
1612
|
}, z.core.$strip>;
|
|
1614
1613
|
}, z.core.$strip>;
|
|
1615
1614
|
};
|
|
1616
|
-
export declare const PostAccountProfileLinksUnfurlSchema: {
|
|
1617
|
-
endpoint: "/account/profile/links/unfurl";
|
|
1618
|
-
method: ApiRestMethod;
|
|
1619
|
-
payload: z.ZodObject<{
|
|
1620
|
-
url: z.ZodURL;
|
|
1621
|
-
}, z.core.$strip>;
|
|
1622
|
-
response: z.ZodObject<{
|
|
1623
|
-
url: z.ZodURL;
|
|
1624
|
-
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
1625
|
-
platform: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
1626
|
-
}, z.core.$strip>;
|
|
1627
|
-
};
|
|
1628
1615
|
export declare const GetPeopleSlugSchema: {
|
|
1629
1616
|
endpoint: "/people/:slug";
|
|
1630
1617
|
method: ApiRestMethod;
|
|
@@ -2358,6 +2345,94 @@ export declare const GetAdminUsersSchema: {
|
|
|
2358
2345
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
2359
2346
|
report_count: z.ZodInt;
|
|
2360
2347
|
email: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
2348
|
+
profile: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
2349
|
+
server_id: z.ZodUUID;
|
|
2350
|
+
slug: z.ZodString;
|
|
2351
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
2352
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
2353
|
+
content: z.ZodObject<{
|
|
2354
|
+
name: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
2355
|
+
country: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
2356
|
+
introduction: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
2357
|
+
organization: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
2358
|
+
links: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
2359
|
+
url: z.ZodURL;
|
|
2360
|
+
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
2361
|
+
platform: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
2362
|
+
}, z.core.$strip>>>;
|
|
2363
|
+
show_on_map: z.ZodDefault<z.ZodBoolean>;
|
|
2364
|
+
avatar_image_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
2365
|
+
}, z.core.$strip>;
|
|
2366
|
+
media: z.ZodObject<{
|
|
2367
|
+
images: z.ZodArray<z.ZodObject<{
|
|
2368
|
+
id: z.ZodUUID;
|
|
2369
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
2370
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
2371
|
+
alt: z.ZodString;
|
|
2372
|
+
srcset: z.ZodString;
|
|
2373
|
+
width: z.ZodInt;
|
|
2374
|
+
height: z.ZodInt;
|
|
2375
|
+
}, z.core.$strip>>;
|
|
2376
|
+
}, z.core.$strip>;
|
|
2377
|
+
}, z.core.$strip>>>, z.ZodTransform<{
|
|
2378
|
+
server_id: string;
|
|
2379
|
+
slug: string;
|
|
2380
|
+
created_at: string;
|
|
2381
|
+
updated_at: string;
|
|
2382
|
+
content: {
|
|
2383
|
+
name: string | null;
|
|
2384
|
+
country: string | null;
|
|
2385
|
+
introduction: string | null;
|
|
2386
|
+
organization: string | null;
|
|
2387
|
+
links: {
|
|
2388
|
+
url: string;
|
|
2389
|
+
title: string | null;
|
|
2390
|
+
platform: string | null;
|
|
2391
|
+
}[];
|
|
2392
|
+
show_on_map: boolean;
|
|
2393
|
+
avatar_image_id: string | null;
|
|
2394
|
+
};
|
|
2395
|
+
media: {
|
|
2396
|
+
images: {
|
|
2397
|
+
id: string;
|
|
2398
|
+
created_at: string;
|
|
2399
|
+
updated_at: string;
|
|
2400
|
+
alt: string;
|
|
2401
|
+
srcset: string;
|
|
2402
|
+
width: number;
|
|
2403
|
+
height: number;
|
|
2404
|
+
}[];
|
|
2405
|
+
};
|
|
2406
|
+
} | null, {
|
|
2407
|
+
server_id: string;
|
|
2408
|
+
slug: string;
|
|
2409
|
+
created_at: string;
|
|
2410
|
+
updated_at: string;
|
|
2411
|
+
content: {
|
|
2412
|
+
name: string | null;
|
|
2413
|
+
country: string | null;
|
|
2414
|
+
introduction: string | null;
|
|
2415
|
+
organization: string | null;
|
|
2416
|
+
links: {
|
|
2417
|
+
url: string;
|
|
2418
|
+
title: string | null;
|
|
2419
|
+
platform: string | null;
|
|
2420
|
+
}[];
|
|
2421
|
+
show_on_map: boolean;
|
|
2422
|
+
avatar_image_id: string | null;
|
|
2423
|
+
};
|
|
2424
|
+
media: {
|
|
2425
|
+
images: {
|
|
2426
|
+
id: string;
|
|
2427
|
+
created_at: string;
|
|
2428
|
+
updated_at: string;
|
|
2429
|
+
alt: string;
|
|
2430
|
+
srcset: string;
|
|
2431
|
+
width: number;
|
|
2432
|
+
height: number;
|
|
2433
|
+
}[];
|
|
2434
|
+
};
|
|
2435
|
+
} | null | undefined>>;
|
|
2361
2436
|
}, z.core.$strip>>;
|
|
2362
2437
|
total: z.ZodInt;
|
|
2363
2438
|
}, z.core.$strip>;
|
package/dist/schemas/base.d.ts
CHANGED
|
@@ -403,6 +403,94 @@ export declare const AdminUserSchema: z.ZodObject<{
|
|
|
403
403
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
404
404
|
report_count: z.ZodInt;
|
|
405
405
|
email: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
406
|
+
profile: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
407
|
+
server_id: z.ZodUUID;
|
|
408
|
+
slug: z.ZodString;
|
|
409
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
410
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
411
|
+
content: z.ZodObject<{
|
|
412
|
+
name: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
413
|
+
country: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
414
|
+
introduction: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
415
|
+
organization: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
416
|
+
links: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
417
|
+
url: z.ZodURL;
|
|
418
|
+
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
419
|
+
platform: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
420
|
+
}, z.core.$strip>>>;
|
|
421
|
+
show_on_map: z.ZodDefault<z.ZodBoolean>;
|
|
422
|
+
avatar_image_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
423
|
+
}, z.core.$strip>;
|
|
424
|
+
media: z.ZodObject<{
|
|
425
|
+
images: z.ZodArray<z.ZodObject<{
|
|
426
|
+
id: z.ZodUUID;
|
|
427
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
428
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
429
|
+
alt: z.ZodString;
|
|
430
|
+
srcset: z.ZodString;
|
|
431
|
+
width: z.ZodInt;
|
|
432
|
+
height: z.ZodInt;
|
|
433
|
+
}, z.core.$strip>>;
|
|
434
|
+
}, z.core.$strip>;
|
|
435
|
+
}, z.core.$strip>>>, z.ZodTransform<{
|
|
436
|
+
server_id: string;
|
|
437
|
+
slug: string;
|
|
438
|
+
created_at: string;
|
|
439
|
+
updated_at: string;
|
|
440
|
+
content: {
|
|
441
|
+
name: string | null;
|
|
442
|
+
country: string | null;
|
|
443
|
+
introduction: string | null;
|
|
444
|
+
organization: string | null;
|
|
445
|
+
links: {
|
|
446
|
+
url: string;
|
|
447
|
+
title: string | null;
|
|
448
|
+
platform: string | null;
|
|
449
|
+
}[];
|
|
450
|
+
show_on_map: boolean;
|
|
451
|
+
avatar_image_id: string | null;
|
|
452
|
+
};
|
|
453
|
+
media: {
|
|
454
|
+
images: {
|
|
455
|
+
id: string;
|
|
456
|
+
created_at: string;
|
|
457
|
+
updated_at: string;
|
|
458
|
+
alt: string;
|
|
459
|
+
srcset: string;
|
|
460
|
+
width: number;
|
|
461
|
+
height: number;
|
|
462
|
+
}[];
|
|
463
|
+
};
|
|
464
|
+
} | null, {
|
|
465
|
+
server_id: string;
|
|
466
|
+
slug: string;
|
|
467
|
+
created_at: string;
|
|
468
|
+
updated_at: string;
|
|
469
|
+
content: {
|
|
470
|
+
name: string | null;
|
|
471
|
+
country: string | null;
|
|
472
|
+
introduction: string | null;
|
|
473
|
+
organization: string | null;
|
|
474
|
+
links: {
|
|
475
|
+
url: string;
|
|
476
|
+
title: string | null;
|
|
477
|
+
platform: string | null;
|
|
478
|
+
}[];
|
|
479
|
+
show_on_map: boolean;
|
|
480
|
+
avatar_image_id: string | null;
|
|
481
|
+
};
|
|
482
|
+
media: {
|
|
483
|
+
images: {
|
|
484
|
+
id: string;
|
|
485
|
+
created_at: string;
|
|
486
|
+
updated_at: string;
|
|
487
|
+
alt: string;
|
|
488
|
+
srcset: string;
|
|
489
|
+
width: number;
|
|
490
|
+
height: number;
|
|
491
|
+
}[];
|
|
492
|
+
};
|
|
493
|
+
} | null | undefined>>;
|
|
406
494
|
}, z.core.$strip>;
|
|
407
495
|
export declare const AssemblySchema: z.ZodObject<{
|
|
408
496
|
id: z.ZodUUID;
|
package/package.json
CHANGED
package/src/schemas/api.ts
CHANGED
|
@@ -82,6 +82,8 @@ export const PostAccountReportsIdCoverImageSchema = {
|
|
|
82
82
|
response: ReportSchema
|
|
83
83
|
};
|
|
84
84
|
|
|
85
|
+
export const MAX_PROFILE_LINKS = 10;
|
|
86
|
+
|
|
85
87
|
export const GetAccountProfileSchema = {
|
|
86
88
|
endpoint: ApiEndpoint.ACCOUNT_PROFILE as const,
|
|
87
89
|
method: ApiRestMethod.GET,
|
|
@@ -92,7 +94,12 @@ export const GetAccountProfileSchema = {
|
|
|
92
94
|
export const PutAccountProfileSchema = {
|
|
93
95
|
endpoint: ApiEndpoint.ACCOUNT_PROFILE as const,
|
|
94
96
|
method: ApiRestMethod.PUT,
|
|
95
|
-
payload: ProfileContentSchema.omit({ avatar_image_id: true })
|
|
97
|
+
payload: ProfileContentSchema.omit({ avatar_image_id: true }).extend({
|
|
98
|
+
links: ProfileLinkSchema.pick({ url: true })
|
|
99
|
+
.array()
|
|
100
|
+
.max(MAX_PROFILE_LINKS)
|
|
101
|
+
.default([])
|
|
102
|
+
}),
|
|
96
103
|
response: ProfileSchema
|
|
97
104
|
};
|
|
98
105
|
|
|
@@ -103,13 +110,6 @@ export const PostAccountProfileAvatarSchema = {
|
|
|
103
110
|
response: ProfileSchema
|
|
104
111
|
};
|
|
105
112
|
|
|
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
113
|
export const GetPeopleSlugSchema = {
|
|
114
114
|
endpoint: `${ApiEndpoint.PEOPLE}/:slug` as const,
|
|
115
115
|
method: ApiRestMethod.GET,
|
package/src/schemas/base.ts
CHANGED
|
@@ -90,7 +90,7 @@ export const ProfileContentSchema = z.object({
|
|
|
90
90
|
introduction: maybe(z.string()),
|
|
91
91
|
organization: maybe(z.string()),
|
|
92
92
|
links: ProfileLinkSchema.array().default([]),
|
|
93
|
-
show_on_map: z.boolean().default(
|
|
93
|
+
show_on_map: z.boolean().default(false),
|
|
94
94
|
avatar_image_id: maybe(z.string())
|
|
95
95
|
});
|
|
96
96
|
|
|
@@ -121,7 +121,8 @@ export const AdminUserSchema = z.object({
|
|
|
121
121
|
created_at: isoDateString,
|
|
122
122
|
updated_at: isoDateString,
|
|
123
123
|
report_count: z.int(),
|
|
124
|
-
email: maybe(z.string())
|
|
124
|
+
email: maybe(z.string()),
|
|
125
|
+
profile: maybe(ProfileSchema)
|
|
125
126
|
});
|
|
126
127
|
|
|
127
128
|
// Pins
|