@assemblis/contracts 0.2.1 → 0.2.3
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 +58 -42
- package/dist/schemas/base.d.ts +61 -2
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/legacy.d.ts +5 -63
- package/dist/types/api.d.ts +2 -2
- package/package.json +1 -1
- package/src/schemas/api.ts +12 -12
- package/src/schemas/base.ts +43 -2
- package/src/schemas/index.ts +1 -0
- package/src/schemas/legacy.ts +0 -39
- package/src/types/api.ts +4 -4
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"zod";var e,n,i
|
|
1
|
+
import t from"zod";var e,a,n,r,i;!function(t){t.GET="GET",t.POST="POST",t.PUT="PUT",t.PATCH="PATCH"}(e||(e={})),function(t){t.ID=":ID",t.NAME=":NAME"}(a||(a={})),function(t){t.ACCOUNT_REPORTS="/account/reports",t.ASSEMBLIES="/assemblies",t.FEEDBACK="/feedback",t.INTEREST="/interest",t.INTEREST_ASSEMBLIS="/interest/assemblis",t.LOGS="/logs",t.PINS="/pins",t.REPORTS="/reports",t.SURVEYS="/surveys",t.SURVEY_RESPONSES="/assemblies/:ID/survey-responses/:NAME"}(n||(n={})),function(t){t.DISCARDED="DISCARDED",t.DRAFTED="DRAFT",t.PUBLISHED="PUBLISHED",t.CHANGED="CHANGED"}(r||(r={})),function(t){t.DELIBERATION="deliberation",t.DEMOGRAPHIC_DATA="demographic-data",t.PRE_ASSEMBLY="pre-assembly",t.POST_ASSEMBLY="post-assembly"}(i||(i={}));const o=t.coerce.date().transform(t=>t.toISOString()),s=t=>t.nullish().transform(t=>t??null);t.object({route:t.string(),text:t.string(),metadata:t.unknown()}),t.string(),t.object({type:t.literal("user.created"),object:t.literal("event"),data:t.object({id:t.string(),email_addresses:t.object({email_address:t.string()}).array()})}),t.string();const d=t.object({id:t.uuid(),text:t.string()});t.undefined(),t.object({id:t.uuid(),created_at:o,updated_at:o,name:t.string(),sections:t.object({primary:d,secondary:d.array(),options:P.array()}).array()}),t.object({answers:t.object({question_id:t.uuid(),answer_value:t.coerce.number().int()}).array()}),t.object({total:t.number().int()});const c=t.object({visible_on_profile:t.boolean(),description:s(t.string())}),p=t.object({text:t.string(),agreed:s(t.coerce.number().int()),against:s(t.coerce.number().int()),abstained:s(t.coerce.number().int()),include_in_action_plan:t.boolean().default(!0),assembly_id:t.uuid()}),u=t.object({text:t.string(),complete:t.boolean().default(!1),action_id:t.uuid(),assembly_id:t.uuid()}),l=t.object({published_at:s(o),name:t.string(),about:s(t.string()),topics:t.string().array(),country:s(t.string()),hide:t.boolean().default(!1)}),_={payload:l,response:l.extend({id:t.uuid(),created_at:o,updated_at:o,image_src:s(t.string()),has_image:t.boolean().meta({deprecated:!0}),user_id:t.uuid().meta({deprecated:!0})})};t.undefined(),t.object({assemblies:_.response.array()});const b=t.object({visible_on_profile:t.boolean(),name:s(t.string()),description:s(t.string()),type:s(t.string())}),g=t.object({visible_on_profile:t.boolean(),registration_link:s(t.string()),start_date:s(o)}),m=t.object({visible_on_profile:t.boolean(),background:s(t.string())}),y=t.object({visible_on_profile:t.boolean(),organisation_types:t.string().array(),description:s(t.string())}),S=t.object({visible_on_profile:t.boolean(),organisation_types:t.string().array(),description:s(t.string())}),E=t.object({visible_on_profile:t.boolean(),decision_method:s(t.string())}),T=t.object({visible_on_profile:t.boolean(),recruitment_method:s(t.string()),community:s(t.string())}),f=t.object({visible_on_profile:t.boolean(),support_options:t.string().array()}),j=t.object({visible_on_profile:t.boolean()});_.payload.extend({organisation:s(b.extend({id:t.uuid().optional()})),event_details:s(g),story:s(m),supporters:s(y),funders:s(S),facilitation:s(E),participants:s(T),support:s(f),action_plan:s(c.extend({actions:p.omit({assembly_id:!0}).extend({id:t.uuid().optional(),tasks:u.omit({action_id:!0,assembly_id:!0}).extend({id:t.uuid().optional()}).array(),updates:t.unknown().array()}).array(),updates:t.unknown().array()})),surveys:s(j)}),_.response.omit({user_id:!0}).extend({is_own:t.boolean(),organisation:s(b.extend({id:t.uuid(),created_at:o,updated_at:o})),event_details:s(g.extend({created_at:o,updated_at:o})),story:s(m.extend({created_at:o,updated_at:o})),supporters:s(y.extend({created_at:o,updated_at:o})),funders:s(S.extend({created_at:o,updated_at:o})),facilitation:s(E.extend({created_at:o,updated_at:o})),participants:s(T.extend({created_at:o,updated_at:o})),support:s(f.extend({created_at:o,updated_at:o})),action_plan:s(c.extend({actions:p.omit({assembly_id:!0}).extend({id:t.uuid(),created_at:o,updated_at:t.coerce.date().transform(t=>t.toISOString()),tasks:u.omit({action_id:!0,assembly_id:!0}).extend({id:t.uuid(),created_at:t.coerce.date().transform(t=>t.toISOString()),updated_at:t.coerce.date().transform(t=>t.toISOString())}).array(),updates:t.unknown().array()}).extend({created_at:t.coerce.date().transform(t=>t.toISOString()),updated_at:t.coerce.date().transform(t=>t.toISOString())}).array(),updates:t.unknown().array()}).and(t.object({created_at:t.coerce.date().transform(t=>t.toISOString()),updated_at:t.coerce.date().transform(t=>t.toISOString())}))),surveys:s(j.extend({created_at:t.coerce.date().transform(t=>t.toISOString()),updated_at:t.coerce.date().transform(t=>t.toISOString())}).extend({data:t.record(t.string(),t.object({total:t.number().int(),responses:t.record(t.string(),P.array())}))}))});const O={payload:t.object({country:t.string(),email:t.string(),text:s(t.string())}),response:t.object({id:t.uuid(),created_at:t.coerce.date().transform(t=>t.toISOString()),updated_at:t.coerce.date().transform(t=>t.toISOString()),country:t.string(),text:s(t.string()),hide:t.boolean(),image_src:s(t.string()),has_image:t.boolean().meta({deprecated:!0})})},R={payload:t.undefined(),response:t.object({assemblies:_.response.array(),pins:O.response.array()})},h={payload:t.object({message:t.string().optional(),data:t.record(t.string(),t.string().optional()).optional(),metadata:t.object({origin:t.string(),route:t.string(),status:t.number()})}),response:t.string()},A=t.object({id:t.uuid(),created_at:o,updated_at:o,alt:t.string(),srcset:t.string(),width:t.int(),height:t.int()}),v=t.object({recaptcha_token:t.string(),email:t.email().toLowerCase().trim(),listIds:t.int().array(),firstname:t.string().nullish().transform(t=>t??void 0),lastname:t.string().nullish().transform(t=>t??void 0),country:t.string().nullish().transform(t=>t??void 0),organisation:t.string().nullish().transform(t=>t??void 0)}),P=t.object({label:t.string(),value:t.coerce.number().int()}),C=t.object({published_at:s(o),title:s(t.string()),description:s(t.string()),location:s(t.string()),outputs:s(t.string().array()),initiation_type:s(t.string()),recruitment_method:s(t.string()),recruitment_description:s(t.string()),participant_count:s(t.int()),organiser_reflections:s(t.string()),organiser_report_url:s(t.string()),location_details:s(t.string()),date:s(t.string()),duration:s(t.int()),contact_information_url:s(t.string()),cover_image_id:s(t.string())}),I=t.object({server_id:t.uuid(),client_id:t.uuid(),display_seq:t.int(),created_at:o,updated_at:o,published_at:s(o),state:t.enum(["DISCARDED","DRAFTED","PUBLISHED","CHANGED"]),slug:s(t.string()),draft_content:s(C),published_content:s(C),media:t.object({images:A.array()})}),x=t.object({id:t.uuid(),created_at:o,updated_at:o,sub:t.string(),is_mutirao:t.boolean()}),D={endpoint:()=>n.ACCOUNT_REPORTS,method:e.GET,payload:t.never(),response:t.object({reports:I.array(),total:t.int()})},N={endpoint:t=>`${n.ACCOUNT_REPORTS}/${t}`,method:e.GET,payload:t.never(),response:s(I)},U={endpoint:()=>n.ACCOUNT_REPORTS,method:e.POST,payload:t.object({client_id:t.uuid(),content:s(C.omit({cover_image_id:!0}))}),response:I},$={endpoint:t=>`${n.ACCOUNT_REPORTS}/${t}/content`,method:e.PUT,payload:C.omit({published_at:!0,cover_image_id:!0}),response:I},k={endpoint:t=>`${n.ACCOUNT_REPORTS}/${t}/discard`,method:e.PATCH,payload:t.nullish(t.object()),response:s(I)},H={endpoint:t=>`${n.ACCOUNT_REPORTS}/${t}/publish`,method:e.PATCH,payload:t.object({published_at:o}),response:I},G={endpoint:t=>`${n.ACCOUNT_REPORTS}/${t}/unpublish`,method:e.PATCH,payload:t.nullish(t.object()),response:I},w={endpoint:t=>`${n.ACCOUNT_REPORTS}/${t}/cover-image`,method:e.POST,payload:A.pick({alt:!0}),response:I},L={endpoint:()=>n.INTEREST,method:e.POST,payload:v,response:t.string()},B={endpoint:()=>n.REPORTS,method:e.GET,payload:t.never(),response:t.object({reports:I.array()})},M={endpoint:t=>`${n.REPORTS}/${t}`,method:e.GET,payload:t.never(),response:s(I)};export{n as ApiEndpoint,e as ApiRestMethod,a as ApiRouteParameter,N as GetAccountReportsIdSchema,D as GetAccountReportsSchema,M as GetReportsIdSchema,B as GetReportsSchema,A as ImageSchema,v as InterestSchema,h as LogSchema,P as OptionSchema,k as PatchAccountReportsIdDiscardSchema,H as PatchAccountReportsIdPublishSchema,G as PatchAccountReportsIdUnpublishSchema,R as PinListSchema,O as PinSchema,w as PostAccountReportsIdCoverImageSchema,U as PostAccountReportsSchema,L as PostInterestSchema,$ as PutAccountReportsIdContentSchema,C as ReportContentSchema,I as ReportSchema,r as ReportState,i as SurveyName,x as UserSchema};
|
package/dist/schemas/api.d.ts
CHANGED
|
@@ -7,8 +7,9 @@ export declare const GetAccountReportsSchema: {
|
|
|
7
7
|
payload: z.ZodNever;
|
|
8
8
|
response: z.ZodObject<{
|
|
9
9
|
reports: z.ZodArray<z.ZodObject<{
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
server_id: z.ZodUUID;
|
|
11
|
+
client_id: z.ZodUUID;
|
|
12
|
+
display_seq: z.ZodInt;
|
|
12
13
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
13
14
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
14
15
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -143,8 +144,9 @@ export declare const GetAccountReportsIdSchema: {
|
|
|
143
144
|
method: ApiRestMethod;
|
|
144
145
|
payload: z.ZodNever;
|
|
145
146
|
response: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
146
|
-
|
|
147
|
-
|
|
147
|
+
server_id: z.ZodUUID;
|
|
148
|
+
client_id: z.ZodUUID;
|
|
149
|
+
display_seq: z.ZodInt;
|
|
148
150
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
149
151
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
150
152
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -271,8 +273,9 @@ export declare const GetAccountReportsIdSchema: {
|
|
|
271
273
|
}, z.core.$strip>>;
|
|
272
274
|
}, z.core.$strip>;
|
|
273
275
|
}, z.core.$strip>>>, z.ZodTransform<{
|
|
274
|
-
|
|
275
|
-
|
|
276
|
+
server_id: string;
|
|
277
|
+
client_id: string;
|
|
278
|
+
display_seq: number;
|
|
276
279
|
created_at: string;
|
|
277
280
|
updated_at: string;
|
|
278
281
|
published_at: string | null;
|
|
@@ -326,8 +329,9 @@ export declare const GetAccountReportsIdSchema: {
|
|
|
326
329
|
}[];
|
|
327
330
|
};
|
|
328
331
|
} | null, {
|
|
329
|
-
|
|
330
|
-
|
|
332
|
+
server_id: string;
|
|
333
|
+
client_id: string;
|
|
334
|
+
display_seq: number;
|
|
331
335
|
created_at: string;
|
|
332
336
|
updated_at: string;
|
|
333
337
|
published_at: string | null;
|
|
@@ -386,12 +390,12 @@ export declare const PostAccountReportsSchema: {
|
|
|
386
390
|
endpoint: () => AccountEndpoint;
|
|
387
391
|
method: ApiRestMethod;
|
|
388
392
|
payload: z.ZodObject<{
|
|
389
|
-
|
|
393
|
+
client_id: z.ZodUUID;
|
|
390
394
|
content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
391
395
|
date: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
392
|
-
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
393
396
|
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
394
397
|
description: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
398
|
+
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
395
399
|
location: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
396
400
|
outputs: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[] | null, string[] | null | undefined>>;
|
|
397
401
|
initiation_type: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -405,9 +409,9 @@ export declare const PostAccountReportsSchema: {
|
|
|
405
409
|
contact_information_url: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
406
410
|
}, z.core.$strip>>>, z.ZodTransform<{
|
|
407
411
|
date: string | null;
|
|
408
|
-
published_at: string | null;
|
|
409
412
|
title: string | null;
|
|
410
413
|
description: string | null;
|
|
414
|
+
published_at: string | null;
|
|
411
415
|
location: string | null;
|
|
412
416
|
outputs: string[] | null;
|
|
413
417
|
initiation_type: string | null;
|
|
@@ -421,9 +425,9 @@ export declare const PostAccountReportsSchema: {
|
|
|
421
425
|
contact_information_url: string | null;
|
|
422
426
|
} | null, {
|
|
423
427
|
date: string | null;
|
|
424
|
-
published_at: string | null;
|
|
425
428
|
title: string | null;
|
|
426
429
|
description: string | null;
|
|
430
|
+
published_at: string | null;
|
|
427
431
|
location: string | null;
|
|
428
432
|
outputs: string[] | null;
|
|
429
433
|
initiation_type: string | null;
|
|
@@ -438,8 +442,9 @@ export declare const PostAccountReportsSchema: {
|
|
|
438
442
|
} | null | undefined>>;
|
|
439
443
|
}, z.core.$strip>;
|
|
440
444
|
response: z.ZodObject<{
|
|
441
|
-
|
|
442
|
-
|
|
445
|
+
server_id: z.ZodUUID;
|
|
446
|
+
client_id: z.ZodUUID;
|
|
447
|
+
display_seq: z.ZodInt;
|
|
443
448
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
444
449
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
445
450
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -568,7 +573,7 @@ export declare const PostAccountReportsSchema: {
|
|
|
568
573
|
}, z.core.$strip>;
|
|
569
574
|
};
|
|
570
575
|
export declare const PutAccountReportsIdContentSchema: {
|
|
571
|
-
endpoint: (
|
|
576
|
+
endpoint: (clientId: string) => AccountEndpoint;
|
|
572
577
|
method: ApiRestMethod;
|
|
573
578
|
payload: z.ZodObject<{
|
|
574
579
|
date: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -587,8 +592,9 @@ export declare const PutAccountReportsIdContentSchema: {
|
|
|
587
592
|
contact_information_url: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
588
593
|
}, z.core.$strip>;
|
|
589
594
|
response: z.ZodObject<{
|
|
590
|
-
|
|
591
|
-
|
|
595
|
+
server_id: z.ZodUUID;
|
|
596
|
+
client_id: z.ZodUUID;
|
|
597
|
+
display_seq: z.ZodInt;
|
|
592
598
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
593
599
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
594
600
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -717,12 +723,13 @@ export declare const PutAccountReportsIdContentSchema: {
|
|
|
717
723
|
}, z.core.$strip>;
|
|
718
724
|
};
|
|
719
725
|
export declare const PatchAccountReportsIdDiscardSchema: {
|
|
720
|
-
endpoint: (
|
|
726
|
+
endpoint: (clientId: string) => AccountEndpoint;
|
|
721
727
|
method: ApiRestMethod;
|
|
722
728
|
payload: z.ZodOptional<z.ZodNullable<z.ZodObject<{}, z.core.$strip>>>;
|
|
723
729
|
response: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
724
|
-
|
|
725
|
-
|
|
730
|
+
server_id: z.ZodUUID;
|
|
731
|
+
client_id: z.ZodUUID;
|
|
732
|
+
display_seq: z.ZodInt;
|
|
726
733
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
727
734
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
728
735
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -849,8 +856,9 @@ export declare const PatchAccountReportsIdDiscardSchema: {
|
|
|
849
856
|
}, z.core.$strip>>;
|
|
850
857
|
}, z.core.$strip>;
|
|
851
858
|
}, z.core.$strip>>>, z.ZodTransform<{
|
|
852
|
-
|
|
853
|
-
|
|
859
|
+
server_id: string;
|
|
860
|
+
client_id: string;
|
|
861
|
+
display_seq: number;
|
|
854
862
|
created_at: string;
|
|
855
863
|
updated_at: string;
|
|
856
864
|
published_at: string | null;
|
|
@@ -904,8 +912,9 @@ export declare const PatchAccountReportsIdDiscardSchema: {
|
|
|
904
912
|
}[];
|
|
905
913
|
};
|
|
906
914
|
} | null, {
|
|
907
|
-
|
|
908
|
-
|
|
915
|
+
server_id: string;
|
|
916
|
+
client_id: string;
|
|
917
|
+
display_seq: number;
|
|
909
918
|
created_at: string;
|
|
910
919
|
updated_at: string;
|
|
911
920
|
published_at: string | null;
|
|
@@ -961,14 +970,15 @@ export declare const PatchAccountReportsIdDiscardSchema: {
|
|
|
961
970
|
} | null | undefined>>;
|
|
962
971
|
};
|
|
963
972
|
export declare const PatchAccountReportsIdPublishSchema: {
|
|
964
|
-
endpoint: (
|
|
973
|
+
endpoint: (clientId: string) => AccountEndpoint;
|
|
965
974
|
method: ApiRestMethod;
|
|
966
975
|
payload: z.ZodObject<{
|
|
967
976
|
published_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
968
977
|
}, z.core.$strip>;
|
|
969
978
|
response: z.ZodObject<{
|
|
970
|
-
|
|
971
|
-
|
|
979
|
+
server_id: z.ZodUUID;
|
|
980
|
+
client_id: z.ZodUUID;
|
|
981
|
+
display_seq: z.ZodInt;
|
|
972
982
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
973
983
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
974
984
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -1097,12 +1107,13 @@ export declare const PatchAccountReportsIdPublishSchema: {
|
|
|
1097
1107
|
}, z.core.$strip>;
|
|
1098
1108
|
};
|
|
1099
1109
|
export declare const PatchAccountReportsIdUnpublishSchema: {
|
|
1100
|
-
endpoint: (
|
|
1110
|
+
endpoint: (clientId: string) => AccountEndpoint;
|
|
1101
1111
|
method: ApiRestMethod;
|
|
1102
1112
|
payload: z.ZodOptional<z.ZodNullable<z.ZodObject<{}, z.core.$strip>>>;
|
|
1103
1113
|
response: z.ZodObject<{
|
|
1104
|
-
|
|
1105
|
-
|
|
1114
|
+
server_id: z.ZodUUID;
|
|
1115
|
+
client_id: z.ZodUUID;
|
|
1116
|
+
display_seq: z.ZodInt;
|
|
1106
1117
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1107
1118
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1108
1119
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -1231,14 +1242,15 @@ export declare const PatchAccountReportsIdUnpublishSchema: {
|
|
|
1231
1242
|
}, z.core.$strip>;
|
|
1232
1243
|
};
|
|
1233
1244
|
export declare const PostAccountReportsIdCoverImageSchema: {
|
|
1234
|
-
endpoint: (
|
|
1245
|
+
endpoint: (clientId: string) => AccountEndpoint;
|
|
1235
1246
|
method: ApiRestMethod;
|
|
1236
1247
|
payload: z.ZodObject<{
|
|
1237
1248
|
alt: z.ZodString;
|
|
1238
1249
|
}, z.core.$strip>;
|
|
1239
1250
|
response: z.ZodObject<{
|
|
1240
|
-
|
|
1241
|
-
|
|
1251
|
+
server_id: z.ZodUUID;
|
|
1252
|
+
client_id: z.ZodUUID;
|
|
1253
|
+
display_seq: z.ZodInt;
|
|
1242
1254
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1243
1255
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1244
1256
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -1386,8 +1398,9 @@ export declare const GetReportsSchema: {
|
|
|
1386
1398
|
payload: z.ZodNever;
|
|
1387
1399
|
response: z.ZodObject<{
|
|
1388
1400
|
reports: z.ZodArray<z.ZodObject<{
|
|
1389
|
-
|
|
1390
|
-
|
|
1401
|
+
server_id: z.ZodUUID;
|
|
1402
|
+
client_id: z.ZodUUID;
|
|
1403
|
+
display_seq: z.ZodInt;
|
|
1391
1404
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1392
1405
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1393
1406
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -1517,12 +1530,13 @@ export declare const GetReportsSchema: {
|
|
|
1517
1530
|
}, z.core.$strip>;
|
|
1518
1531
|
};
|
|
1519
1532
|
export declare const GetReportsIdSchema: {
|
|
1520
|
-
endpoint: (
|
|
1533
|
+
endpoint: (slug: string) => string;
|
|
1521
1534
|
method: ApiRestMethod;
|
|
1522
1535
|
payload: z.ZodNever;
|
|
1523
1536
|
response: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1524
|
-
|
|
1525
|
-
|
|
1537
|
+
server_id: z.ZodUUID;
|
|
1538
|
+
client_id: z.ZodUUID;
|
|
1539
|
+
display_seq: z.ZodInt;
|
|
1526
1540
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1527
1541
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1528
1542
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -1649,8 +1663,9 @@ export declare const GetReportsIdSchema: {
|
|
|
1649
1663
|
}, z.core.$strip>>;
|
|
1650
1664
|
}, z.core.$strip>;
|
|
1651
1665
|
}, z.core.$strip>>>, z.ZodTransform<{
|
|
1652
|
-
|
|
1653
|
-
|
|
1666
|
+
server_id: string;
|
|
1667
|
+
client_id: string;
|
|
1668
|
+
display_seq: number;
|
|
1654
1669
|
created_at: string;
|
|
1655
1670
|
updated_at: string;
|
|
1656
1671
|
published_at: string | null;
|
|
@@ -1704,8 +1719,9 @@ export declare const GetReportsIdSchema: {
|
|
|
1704
1719
|
}[];
|
|
1705
1720
|
};
|
|
1706
1721
|
} | null, {
|
|
1707
|
-
|
|
1708
|
-
|
|
1722
|
+
server_id: string;
|
|
1723
|
+
client_id: string;
|
|
1724
|
+
display_seq: number;
|
|
1709
1725
|
created_at: string;
|
|
1710
1726
|
updated_at: string;
|
|
1711
1727
|
published_at: string | null;
|
package/dist/schemas/base.d.ts
CHANGED
|
@@ -1,4 +1,62 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
+
export declare const PinSchema: {
|
|
3
|
+
payload: z.ZodObject<{
|
|
4
|
+
country: z.ZodString;
|
|
5
|
+
email: z.ZodString;
|
|
6
|
+
text: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
response: z.ZodObject<{
|
|
9
|
+
id: z.ZodUUID;
|
|
10
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
11
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
12
|
+
country: z.ZodString;
|
|
13
|
+
text: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
14
|
+
hide: z.ZodBoolean;
|
|
15
|
+
image_src: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
16
|
+
has_image: z.ZodBoolean;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
};
|
|
19
|
+
export declare const PinListSchema: {
|
|
20
|
+
payload: z.ZodUndefined;
|
|
21
|
+
response: z.ZodObject<{
|
|
22
|
+
assemblies: z.ZodArray<z.ZodObject<{
|
|
23
|
+
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
24
|
+
name: z.ZodString;
|
|
25
|
+
about: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
26
|
+
topics: z.ZodArray<z.ZodString>;
|
|
27
|
+
country: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
28
|
+
hide: z.ZodDefault<z.ZodBoolean>;
|
|
29
|
+
id: z.ZodUUID;
|
|
30
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
31
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
32
|
+
image_src: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
33
|
+
has_image: z.ZodBoolean;
|
|
34
|
+
user_id: z.ZodUUID;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
pins: z.ZodArray<z.ZodObject<{
|
|
37
|
+
id: z.ZodUUID;
|
|
38
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
39
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
40
|
+
country: z.ZodString;
|
|
41
|
+
text: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
42
|
+
hide: z.ZodBoolean;
|
|
43
|
+
image_src: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
44
|
+
has_image: z.ZodBoolean;
|
|
45
|
+
}, z.core.$strip>>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
};
|
|
48
|
+
export declare const LogSchema: {
|
|
49
|
+
payload: z.ZodObject<{
|
|
50
|
+
message: z.ZodOptional<z.ZodString>;
|
|
51
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>>;
|
|
52
|
+
metadata: z.ZodObject<{
|
|
53
|
+
origin: z.ZodString;
|
|
54
|
+
route: z.ZodString;
|
|
55
|
+
status: z.ZodNumber;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
response: z.ZodString;
|
|
59
|
+
};
|
|
2
60
|
export declare const ImageSchema: z.ZodObject<{
|
|
3
61
|
id: z.ZodUUID;
|
|
4
62
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
@@ -40,8 +98,9 @@ export declare const ReportContentSchema: z.ZodObject<{
|
|
|
40
98
|
cover_image_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
41
99
|
}, z.core.$strip>;
|
|
42
100
|
export declare const ReportSchema: z.ZodObject<{
|
|
43
|
-
|
|
44
|
-
|
|
101
|
+
server_id: z.ZodUUID;
|
|
102
|
+
client_id: z.ZodUUID;
|
|
103
|
+
display_seq: z.ZodInt;
|
|
45
104
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
46
105
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
47
106
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
package/dist/schemas/index.d.ts
CHANGED
package/dist/schemas/legacy.d.ts
CHANGED
|
@@ -7,18 +7,6 @@ export declare const FeedbackSchema: {
|
|
|
7
7
|
}, z.core.$strip>;
|
|
8
8
|
response: z.ZodString;
|
|
9
9
|
};
|
|
10
|
-
export declare const LogSchema: {
|
|
11
|
-
payload: z.ZodObject<{
|
|
12
|
-
message: z.ZodOptional<z.ZodString>;
|
|
13
|
-
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>>;
|
|
14
|
-
metadata: z.ZodObject<{
|
|
15
|
-
origin: z.ZodString;
|
|
16
|
-
route: z.ZodString;
|
|
17
|
-
status: z.ZodNumber;
|
|
18
|
-
}, z.core.$strip>;
|
|
19
|
-
}, z.core.$strip>;
|
|
20
|
-
response: z.ZodString;
|
|
21
|
-
};
|
|
22
10
|
export declare const RegisterSchema: {
|
|
23
11
|
payload: z.ZodObject<{
|
|
24
12
|
type: z.ZodLiteral<"user.created">;
|
|
@@ -282,17 +270,17 @@ export declare const AssemblyDetailSchema: {
|
|
|
282
270
|
} | null | undefined>>;
|
|
283
271
|
}, z.core.$strip>;
|
|
284
272
|
response: z.ZodObject<{
|
|
273
|
+
country: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
274
|
+
id: z.ZodUUID;
|
|
285
275
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
286
276
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
287
|
-
|
|
288
|
-
|
|
277
|
+
hide: z.ZodDefault<z.ZodBoolean>;
|
|
278
|
+
image_src: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
279
|
+
has_image: z.ZodBoolean;
|
|
289
280
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
290
281
|
name: z.ZodString;
|
|
291
282
|
about: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
292
283
|
topics: z.ZodArray<z.ZodString>;
|
|
293
|
-
hide: z.ZodDefault<z.ZodBoolean>;
|
|
294
|
-
image_src: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
295
|
-
has_image: z.ZodBoolean;
|
|
296
284
|
is_own: z.ZodBoolean;
|
|
297
285
|
organisation: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
298
286
|
visible_on_profile: z.ZodBoolean;
|
|
@@ -555,49 +543,3 @@ export declare const AssemblyDetailSchema: {
|
|
|
555
543
|
} | null | undefined>>;
|
|
556
544
|
}, z.core.$strip>;
|
|
557
545
|
};
|
|
558
|
-
export declare const PinSchema: {
|
|
559
|
-
payload: z.ZodObject<{
|
|
560
|
-
country: z.ZodString;
|
|
561
|
-
email: z.ZodString;
|
|
562
|
-
text: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
563
|
-
}, z.core.$strip>;
|
|
564
|
-
response: z.ZodObject<{
|
|
565
|
-
id: z.ZodUUID;
|
|
566
|
-
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
567
|
-
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
568
|
-
country: z.ZodString;
|
|
569
|
-
text: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
570
|
-
hide: z.ZodBoolean;
|
|
571
|
-
image_src: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
572
|
-
has_image: z.ZodBoolean;
|
|
573
|
-
}, z.core.$strip>;
|
|
574
|
-
};
|
|
575
|
-
export declare const PinListSchema: {
|
|
576
|
-
payload: z.ZodUndefined;
|
|
577
|
-
response: z.ZodObject<{
|
|
578
|
-
assemblies: z.ZodArray<z.ZodObject<{
|
|
579
|
-
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
580
|
-
name: z.ZodString;
|
|
581
|
-
about: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
582
|
-
topics: z.ZodArray<z.ZodString>;
|
|
583
|
-
country: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
584
|
-
hide: z.ZodDefault<z.ZodBoolean>;
|
|
585
|
-
id: z.ZodUUID;
|
|
586
|
-
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
587
|
-
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
588
|
-
image_src: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
589
|
-
has_image: z.ZodBoolean;
|
|
590
|
-
user_id: z.ZodUUID;
|
|
591
|
-
}, z.core.$strip>>;
|
|
592
|
-
pins: z.ZodArray<z.ZodObject<{
|
|
593
|
-
id: z.ZodUUID;
|
|
594
|
-
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
595
|
-
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
596
|
-
country: z.ZodString;
|
|
597
|
-
text: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
598
|
-
hide: z.ZodBoolean;
|
|
599
|
-
image_src: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
600
|
-
has_image: z.ZodBoolean;
|
|
601
|
-
}, z.core.$strip>>;
|
|
602
|
-
}, z.core.$strip>;
|
|
603
|
-
};
|
package/dist/types/api.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
-
import { PatchAccountReportsIdPublishSchema, PostAccountReportsIdCoverImageSchema, PutAccountReportsIdContentSchema } from '../schemas';
|
|
3
|
-
import { AssembliesListSchema, AssemblyDetailSchema, AssemblyOverviewSchema, FeedbackSchema,
|
|
2
|
+
import { PatchAccountReportsIdPublishSchema, PostAccountReportsIdCoverImageSchema, PutAccountReportsIdContentSchema, LogSchema, PinListSchema, PinSchema } from '../schemas';
|
|
3
|
+
import { AssembliesListSchema, AssemblyDetailSchema, AssemblyOverviewSchema, FeedbackSchema, RegisterSchema, SurveyResponseSchema, SurveySchema } from '../schemas/legacy';
|
|
4
4
|
export type PutAccountReportsIdContentPayload = z.infer<(typeof PutAccountReportsIdContentSchema)['payload']>;
|
|
5
5
|
export type PublishReportPayload = z.infer<(typeof PatchAccountReportsIdPublishSchema)['payload']>;
|
|
6
6
|
export type ImageMetadataPayload = z.infer<(typeof PostAccountReportsIdCoverImageSchema)['payload']>;
|
package/package.json
CHANGED
package/src/schemas/api.ts
CHANGED
|
@@ -31,15 +31,15 @@ export const PostAccountReportsSchema = {
|
|
|
31
31
|
endpoint: (): AccountEndpoint => ApiEndpoint.ACCOUNT_REPORTS,
|
|
32
32
|
method: ApiRestMethod.POST,
|
|
33
33
|
payload: z.object({
|
|
34
|
-
|
|
34
|
+
client_id: z.uuid(),
|
|
35
35
|
content: maybe(ReportContentSchema.omit({ cover_image_id: true }))
|
|
36
36
|
}),
|
|
37
37
|
response: ReportSchema
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
export const PutAccountReportsIdContentSchema = {
|
|
41
|
-
endpoint: (
|
|
42
|
-
`${ApiEndpoint.ACCOUNT_REPORTS}/${
|
|
41
|
+
endpoint: (clientId: string): AccountEndpoint =>
|
|
42
|
+
`${ApiEndpoint.ACCOUNT_REPORTS}/${clientId}/content`,
|
|
43
43
|
method: ApiRestMethod.PUT,
|
|
44
44
|
payload: ReportContentSchema.omit({
|
|
45
45
|
published_at: true,
|
|
@@ -49,32 +49,32 @@ export const PutAccountReportsIdContentSchema = {
|
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
export const PatchAccountReportsIdDiscardSchema = {
|
|
52
|
-
endpoint: (
|
|
53
|
-
`${ApiEndpoint.ACCOUNT_REPORTS}/${
|
|
52
|
+
endpoint: (clientId: string): AccountEndpoint =>
|
|
53
|
+
`${ApiEndpoint.ACCOUNT_REPORTS}/${clientId}/discard`,
|
|
54
54
|
method: ApiRestMethod.PATCH,
|
|
55
55
|
payload: z.nullish(z.object()),
|
|
56
56
|
response: maybe(ReportSchema)
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
export const PatchAccountReportsIdPublishSchema = {
|
|
60
|
-
endpoint: (
|
|
61
|
-
`${ApiEndpoint.ACCOUNT_REPORTS}/${
|
|
60
|
+
endpoint: (clientId: string): AccountEndpoint =>
|
|
61
|
+
`${ApiEndpoint.ACCOUNT_REPORTS}/${clientId}/publish`,
|
|
62
62
|
method: ApiRestMethod.PATCH,
|
|
63
63
|
payload: z.object({ published_at: isoDateString }),
|
|
64
64
|
response: ReportSchema
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
export const PatchAccountReportsIdUnpublishSchema = {
|
|
68
|
-
endpoint: (
|
|
69
|
-
`${ApiEndpoint.ACCOUNT_REPORTS}/${
|
|
68
|
+
endpoint: (clientId: string): AccountEndpoint =>
|
|
69
|
+
`${ApiEndpoint.ACCOUNT_REPORTS}/${clientId}/unpublish`,
|
|
70
70
|
method: ApiRestMethod.PATCH,
|
|
71
71
|
payload: z.nullish(z.object()),
|
|
72
72
|
response: ReportSchema
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
export const PostAccountReportsIdCoverImageSchema = {
|
|
76
|
-
endpoint: (
|
|
77
|
-
`${ApiEndpoint.ACCOUNT_REPORTS}/${
|
|
76
|
+
endpoint: (clientId: string): AccountEndpoint =>
|
|
77
|
+
`${ApiEndpoint.ACCOUNT_REPORTS}/${clientId}/cover-image`,
|
|
78
78
|
method: ApiRestMethod.POST,
|
|
79
79
|
payload: ImageSchema.pick({ alt: true }),
|
|
80
80
|
response: ReportSchema
|
|
@@ -95,7 +95,7 @@ export const GetReportsSchema = {
|
|
|
95
95
|
};
|
|
96
96
|
|
|
97
97
|
export const GetReportsIdSchema = {
|
|
98
|
-
endpoint: (
|
|
98
|
+
endpoint: (slug: string) => `${ApiEndpoint.REPORTS}/${slug}`,
|
|
99
99
|
method: ApiRestMethod.GET,
|
|
100
100
|
payload: z.never(),
|
|
101
101
|
response: maybe(ReportSchema)
|
package/src/schemas/base.ts
CHANGED
|
@@ -2,6 +2,46 @@
|
|
|
2
2
|
|
|
3
3
|
import z from 'zod';
|
|
4
4
|
import { isoDateString, maybe } from './utils';
|
|
5
|
+
import { AssemblyOverviewSchema } from './legacy';
|
|
6
|
+
|
|
7
|
+
// Pins
|
|
8
|
+
export const PinSchema = {
|
|
9
|
+
payload: z.object({
|
|
10
|
+
country: z.string(),
|
|
11
|
+
email: z.string(),
|
|
12
|
+
text: maybe(z.string())
|
|
13
|
+
}),
|
|
14
|
+
response: z.object({
|
|
15
|
+
id: z.uuid(),
|
|
16
|
+
created_at: z.coerce.date().transform((_) => _.toISOString()),
|
|
17
|
+
updated_at: z.coerce.date().transform((_) => _.toISOString()),
|
|
18
|
+
country: z.string(),
|
|
19
|
+
text: maybe(z.string()),
|
|
20
|
+
hide: z.boolean(),
|
|
21
|
+
image_src: maybe(z.string()),
|
|
22
|
+
has_image: z.boolean().meta({ deprecated: true })
|
|
23
|
+
})
|
|
24
|
+
};
|
|
25
|
+
export const PinListSchema = {
|
|
26
|
+
payload: z.undefined(),
|
|
27
|
+
response: z.object({
|
|
28
|
+
assemblies: AssemblyOverviewSchema.response.array(),
|
|
29
|
+
pins: PinSchema.response.array()
|
|
30
|
+
})
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const LogSchema = {
|
|
34
|
+
payload: z.object({
|
|
35
|
+
message: z.string().optional(),
|
|
36
|
+
data: z.record(z.string(), z.string().optional()).optional(),
|
|
37
|
+
metadata: z.object({
|
|
38
|
+
origin: z.string(),
|
|
39
|
+
route: z.string(),
|
|
40
|
+
status: z.number()
|
|
41
|
+
})
|
|
42
|
+
}),
|
|
43
|
+
response: z.string()
|
|
44
|
+
};
|
|
5
45
|
|
|
6
46
|
export const ImageSchema = z.object({
|
|
7
47
|
id: z.uuid(),
|
|
@@ -60,8 +100,9 @@ export const ReportContentSchema = z.object({
|
|
|
60
100
|
});
|
|
61
101
|
|
|
62
102
|
export const ReportSchema = z.object({
|
|
63
|
-
|
|
64
|
-
|
|
103
|
+
server_id: z.uuid(),
|
|
104
|
+
client_id: z.uuid(),
|
|
105
|
+
display_seq: z.int(),
|
|
65
106
|
created_at: isoDateString,
|
|
66
107
|
updated_at: isoDateString,
|
|
67
108
|
published_at: maybe(isoDateString),
|
package/src/schemas/index.ts
CHANGED
package/src/schemas/legacy.ts
CHANGED
|
@@ -11,19 +11,6 @@ export const FeedbackSchema = {
|
|
|
11
11
|
response: z.string()
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
export const LogSchema = {
|
|
15
|
-
payload: z.object({
|
|
16
|
-
message: z.string().optional(),
|
|
17
|
-
data: z.record(z.string(), z.string().optional()).optional(),
|
|
18
|
-
metadata: z.object({
|
|
19
|
-
origin: z.string(),
|
|
20
|
-
route: z.string(),
|
|
21
|
-
status: z.number()
|
|
22
|
-
})
|
|
23
|
-
}),
|
|
24
|
-
response: z.string()
|
|
25
|
-
};
|
|
26
|
-
|
|
27
14
|
export const RegisterSchema = {
|
|
28
15
|
payload: z.object({
|
|
29
16
|
type: z.literal('user.created'),
|
|
@@ -300,29 +287,3 @@ export const AssemblyDetailSchema = {
|
|
|
300
287
|
)
|
|
301
288
|
})
|
|
302
289
|
};
|
|
303
|
-
|
|
304
|
-
// Pins
|
|
305
|
-
export const PinSchema = {
|
|
306
|
-
payload: z.object({
|
|
307
|
-
country: z.string(),
|
|
308
|
-
email: z.string(),
|
|
309
|
-
text: maybe(z.string())
|
|
310
|
-
}),
|
|
311
|
-
response: z.object({
|
|
312
|
-
id: z.uuid(),
|
|
313
|
-
created_at: z.coerce.date().transform((_) => _.toISOString()),
|
|
314
|
-
updated_at: z.coerce.date().transform((_) => _.toISOString()),
|
|
315
|
-
country: z.string(),
|
|
316
|
-
text: maybe(z.string()),
|
|
317
|
-
hide: z.boolean(),
|
|
318
|
-
image_src: maybe(z.string()),
|
|
319
|
-
has_image: z.boolean().meta({ deprecated: true })
|
|
320
|
-
})
|
|
321
|
-
};
|
|
322
|
-
export const PinListSchema = {
|
|
323
|
-
payload: z.undefined(),
|
|
324
|
-
response: z.object({
|
|
325
|
-
assemblies: AssemblyOverviewSchema.response.array(),
|
|
326
|
-
pins: PinSchema.response.array()
|
|
327
|
-
})
|
|
328
|
-
};
|
package/src/types/api.ts
CHANGED
|
@@ -2,16 +2,16 @@ import z from 'zod';
|
|
|
2
2
|
import {
|
|
3
3
|
PatchAccountReportsIdPublishSchema,
|
|
4
4
|
PostAccountReportsIdCoverImageSchema,
|
|
5
|
-
PutAccountReportsIdContentSchema
|
|
5
|
+
PutAccountReportsIdContentSchema,
|
|
6
|
+
LogSchema,
|
|
7
|
+
PinListSchema,
|
|
8
|
+
PinSchema
|
|
6
9
|
} from '../schemas';
|
|
7
10
|
import {
|
|
8
11
|
AssembliesListSchema,
|
|
9
12
|
AssemblyDetailSchema,
|
|
10
13
|
AssemblyOverviewSchema,
|
|
11
14
|
FeedbackSchema,
|
|
12
|
-
LogSchema,
|
|
13
|
-
PinListSchema,
|
|
14
|
-
PinSchema,
|
|
15
15
|
RegisterSchema,
|
|
16
16
|
SurveyResponseSchema,
|
|
17
17
|
SurveySchema
|