@assemblis/contracts 0.2.2 → 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 +54 -38
- package/dist/schemas/base.d.ts +3 -2
- package/package.json +1 -1
- package/src/schemas/api.ts +11 -11
- package/src/schemas/base.ts +3 -2
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"zod";var e,a,n,r,
|
|
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,7 +390,7 @@ 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
396
|
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -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>>;
|
|
@@ -1521,8 +1534,9 @@ export declare const GetReportsIdSchema: {
|
|
|
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
|
@@ -98,8 +98,9 @@ export declare const ReportContentSchema: z.ZodObject<{
|
|
|
98
98
|
cover_image_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
99
99
|
}, z.core.$strip>;
|
|
100
100
|
export declare const ReportSchema: z.ZodObject<{
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
server_id: z.ZodUUID;
|
|
102
|
+
client_id: z.ZodUUID;
|
|
103
|
+
display_seq: z.ZodInt;
|
|
103
104
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
104
105
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
105
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/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
|
package/src/schemas/base.ts
CHANGED
|
@@ -100,8 +100,9 @@ export const ReportContentSchema = z.object({
|
|
|
100
100
|
});
|
|
101
101
|
|
|
102
102
|
export const ReportSchema = z.object({
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
server_id: z.uuid(),
|
|
104
|
+
client_id: z.uuid(),
|
|
105
|
+
display_seq: z.int(),
|
|
105
106
|
created_at: isoDateString,
|
|
106
107
|
updated_at: isoDateString,
|
|
107
108
|
published_at: maybe(isoDateString),
|