@assemblis/contracts 1.6.0 → 1.8.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 +125 -11
- package/dist/schemas/base.d.ts +88 -0
- package/package.json +1 -1
- package/src/schemas/api.ts +16 -6
- 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()})}),P=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()})}),S={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,v={endpoint:t.ACCOUNT_PROFILE,method:n.GET,payload:e.never(),response:i(_)},D={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,method:n.GET,payload:e.never(),response:e.object({people:g.array(),total:e.int()})},U={endpoint:`${t.PEOPLE}/:slug`,method:n.GET,payload:e.never(),response:i(g)},H={endpoint:t.INTEREST,method:n.POST,payload:d,response:e.string()},L={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()})},k={endpoint:`${t.REPORTS}/:slug`,method:n.GET,payload:e.never(),response:i(l)},M={endpoint:t.PINS,method:n.GET,payload:e.never(),response:e.object({assemblies:E.array(),pins:h.array()})},x={endpoint:t.PINS,method:n.POST,payload:e.object({country:e.string(),email:e.string(),text:i(e.string())}),response:h},F={endpoint:t.ADMIN_REPORTS,method:n.GET,payload:e.never(),response:e.object({reports:c.array(),total:e.int()})},z={endpoint:t.ADMIN_USERS,method:n.GET,payload:e.never(),response:e.object({users:T.array(),total:e.int()})},w={endpoint:t.ADMIN_PINS,method:n.GET,payload:e.never(),response:e.object({pins:h.array()})},B={endpoint:`${t.ADMIN_PINS}/:id/hide`,method:n.PATCH,payload:e.never(),response:h},K={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"])})})},q={endpoint:t.PING,method:n.GET,payload:e.never(),response:e.never()},Z={endpoint:`${t.LOGS}/info`,method:n.POST,payload:b,response:e.string()},J={endpoint:`${t.LOGS}/error`,method:n.POST,payload:b,response:e.string()},Q={endpoint:t.REGISTER,method:n.POST,payload:P,response:e.string()};export{t as ApiEndpoint,n as ApiRestMethod,v as GetAccountProfileSchema,y as GetAccountReportsIdSchema,S as GetAccountReportsSchema,K as GetAdminHealthcheckSchema,w as GetAdminPinsSchema,F as GetAdminReportsSchema,z as GetAdminUsersSchema,G as GetPeopleSchema,U as GetPeopleSlugSchema,q as GetPingSchema,M as GetPinsSchema,$ as GetReportsSchema,k as GetReportsSlugSchema,j as MAX_PROFILE_LINKS,C as PatchAccountReportsIdDiscardSchema,A as PatchAccountReportsIdPublishSchema,I as PatchAccountReportsIdUnpublishSchema,B as PatchAdminPinHideSchema,f as PostAccountProfileAvatarSchema,N as PostAccountReportsIdCoverImageSchema,O as PostAccountReportsSchema,L as PostInterestAssemblisSchema,H as PostInterestSchema,J as PostLogsErrorSchema,Z as PostLogsInfoSchema,x as PostPinSchema,Q as PostRegisterSchema,D 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,16 +1612,43 @@ export declare const PostAccountProfileAvatarSchema: {
|
|
|
1613
1612
|
}, z.core.$strip>;
|
|
1614
1613
|
}, z.core.$strip>;
|
|
1615
1614
|
};
|
|
1616
|
-
export declare const
|
|
1617
|
-
endpoint:
|
|
1615
|
+
export declare const GetPeopleSchema: {
|
|
1616
|
+
endpoint: ApiEndpoint.PEOPLE;
|
|
1618
1617
|
method: ApiRestMethod;
|
|
1619
|
-
payload: z.
|
|
1620
|
-
url: z.ZodURL;
|
|
1621
|
-
}, z.core.$strip>;
|
|
1618
|
+
payload: z.ZodNever;
|
|
1622
1619
|
response: z.ZodObject<{
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1620
|
+
people: z.ZodArray<z.ZodObject<{
|
|
1621
|
+
server_id: z.ZodUUID;
|
|
1622
|
+
slug: z.ZodString;
|
|
1623
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1624
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1625
|
+
content: z.ZodObject<{
|
|
1626
|
+
name: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
1627
|
+
country: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
1628
|
+
introduction: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
1629
|
+
organization: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
1630
|
+
links: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
1631
|
+
url: z.ZodURL;
|
|
1632
|
+
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
1633
|
+
platform: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
1634
|
+
}, z.core.$strip>>>;
|
|
1635
|
+
show_on_map: z.ZodDefault<z.ZodBoolean>;
|
|
1636
|
+
avatar_image_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
1637
|
+
}, z.core.$strip>;
|
|
1638
|
+
media: z.ZodObject<{
|
|
1639
|
+
images: z.ZodArray<z.ZodObject<{
|
|
1640
|
+
id: z.ZodUUID;
|
|
1641
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1642
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1643
|
+
alt: z.ZodString;
|
|
1644
|
+
srcset: z.ZodString;
|
|
1645
|
+
width: z.ZodInt;
|
|
1646
|
+
height: z.ZodInt;
|
|
1647
|
+
}, z.core.$strip>>;
|
|
1648
|
+
}, z.core.$strip>;
|
|
1649
|
+
joined_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1650
|
+
}, z.core.$strip>>;
|
|
1651
|
+
total: z.ZodInt;
|
|
1626
1652
|
}, z.core.$strip>;
|
|
1627
1653
|
};
|
|
1628
1654
|
export declare const GetPeopleSlugSchema: {
|
|
@@ -2358,6 +2384,94 @@ export declare const GetAdminUsersSchema: {
|
|
|
2358
2384
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
2359
2385
|
report_count: z.ZodInt;
|
|
2360
2386
|
email: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
2387
|
+
profile: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
2388
|
+
server_id: z.ZodUUID;
|
|
2389
|
+
slug: z.ZodString;
|
|
2390
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
2391
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
2392
|
+
content: z.ZodObject<{
|
|
2393
|
+
name: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
2394
|
+
country: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
2395
|
+
introduction: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
2396
|
+
organization: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
2397
|
+
links: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
2398
|
+
url: z.ZodURL;
|
|
2399
|
+
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
2400
|
+
platform: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
2401
|
+
}, z.core.$strip>>>;
|
|
2402
|
+
show_on_map: z.ZodDefault<z.ZodBoolean>;
|
|
2403
|
+
avatar_image_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
2404
|
+
}, z.core.$strip>;
|
|
2405
|
+
media: z.ZodObject<{
|
|
2406
|
+
images: z.ZodArray<z.ZodObject<{
|
|
2407
|
+
id: z.ZodUUID;
|
|
2408
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
2409
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
2410
|
+
alt: z.ZodString;
|
|
2411
|
+
srcset: z.ZodString;
|
|
2412
|
+
width: z.ZodInt;
|
|
2413
|
+
height: z.ZodInt;
|
|
2414
|
+
}, z.core.$strip>>;
|
|
2415
|
+
}, z.core.$strip>;
|
|
2416
|
+
}, z.core.$strip>>>, z.ZodTransform<{
|
|
2417
|
+
server_id: string;
|
|
2418
|
+
slug: string;
|
|
2419
|
+
created_at: string;
|
|
2420
|
+
updated_at: string;
|
|
2421
|
+
content: {
|
|
2422
|
+
name: string | null;
|
|
2423
|
+
country: string | null;
|
|
2424
|
+
introduction: string | null;
|
|
2425
|
+
organization: string | null;
|
|
2426
|
+
links: {
|
|
2427
|
+
url: string;
|
|
2428
|
+
title: string | null;
|
|
2429
|
+
platform: string | null;
|
|
2430
|
+
}[];
|
|
2431
|
+
show_on_map: boolean;
|
|
2432
|
+
avatar_image_id: string | null;
|
|
2433
|
+
};
|
|
2434
|
+
media: {
|
|
2435
|
+
images: {
|
|
2436
|
+
id: string;
|
|
2437
|
+
created_at: string;
|
|
2438
|
+
updated_at: string;
|
|
2439
|
+
alt: string;
|
|
2440
|
+
srcset: string;
|
|
2441
|
+
width: number;
|
|
2442
|
+
height: number;
|
|
2443
|
+
}[];
|
|
2444
|
+
};
|
|
2445
|
+
} | null, {
|
|
2446
|
+
server_id: string;
|
|
2447
|
+
slug: string;
|
|
2448
|
+
created_at: string;
|
|
2449
|
+
updated_at: string;
|
|
2450
|
+
content: {
|
|
2451
|
+
name: string | null;
|
|
2452
|
+
country: string | null;
|
|
2453
|
+
introduction: string | null;
|
|
2454
|
+
organization: string | null;
|
|
2455
|
+
links: {
|
|
2456
|
+
url: string;
|
|
2457
|
+
title: string | null;
|
|
2458
|
+
platform: string | null;
|
|
2459
|
+
}[];
|
|
2460
|
+
show_on_map: boolean;
|
|
2461
|
+
avatar_image_id: string | null;
|
|
2462
|
+
};
|
|
2463
|
+
media: {
|
|
2464
|
+
images: {
|
|
2465
|
+
id: string;
|
|
2466
|
+
created_at: string;
|
|
2467
|
+
updated_at: string;
|
|
2468
|
+
alt: string;
|
|
2469
|
+
srcset: string;
|
|
2470
|
+
width: number;
|
|
2471
|
+
height: number;
|
|
2472
|
+
}[];
|
|
2473
|
+
};
|
|
2474
|
+
} | null | undefined>>;
|
|
2361
2475
|
}, z.core.$strip>>;
|
|
2362
2476
|
total: z.ZodInt;
|
|
2363
2477
|
}, 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,11 +110,14 @@ export const PostAccountProfileAvatarSchema = {
|
|
|
103
110
|
response: ProfileSchema
|
|
104
111
|
};
|
|
105
112
|
|
|
106
|
-
export const
|
|
107
|
-
endpoint:
|
|
108
|
-
method: ApiRestMethod.
|
|
109
|
-
payload:
|
|
110
|
-
response:
|
|
113
|
+
export const GetPeopleSchema = {
|
|
114
|
+
endpoint: ApiEndpoint.PEOPLE as const,
|
|
115
|
+
method: ApiRestMethod.GET,
|
|
116
|
+
payload: z.never(),
|
|
117
|
+
response: z.object({
|
|
118
|
+
people: PublicProfileSchema.array(),
|
|
119
|
+
total: z.int()
|
|
120
|
+
})
|
|
111
121
|
};
|
|
112
122
|
|
|
113
123
|
export const GetPeopleSlugSchema = {
|
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
|