@assemblis/contracts 0.1.20 → 0.2.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 +84 -65
- package/dist/schemas/base.d.ts +2 -1
- package/dist/schemas/index.d.ts +0 -1
- package/dist/schemas/legacy.d.ts +3 -3
- package/dist/types/api.d.ts +2 -1
- package/package.json +1 -1
- package/src/schemas/api.ts +4 -1
- package/src/schemas/base.ts +2 -1
- package/src/schemas/index.ts +0 -1
- package/src/types/api.ts +6 -4
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import t from"zod";var e,n,i,o,r;!function(t){t.GET="GET",t.POST="POST",t.PUT="PUT",t.PATCH="PATCH"}(e||(e={})),function(t){t.ID=":ID",t.NAME=":NAME"}(n||(n={})),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"}(i||(i={})),function(t){t.DISCARDED="DISCARDED",t.DRAFTED="DRAFT",t.PUBLISHED="PUBLISHED",t.CHANGED="CHANGED"}(o||(o={})),function(t){t.DELIBERATION="deliberation",t.DEMOGRAPHIC_DATA="demographic-data",t.PRE_ASSEMBLY="pre-assembly",t.POST_ASSEMBLY="post-assembly"}(r||(r={}));const s=t.coerce.date().transform(t=>t.toISOString()),a=t=>t.nullish().transform(t=>t??null),d=t.object({id:t.uuid(),created_at:s,updated_at:s,alt:t.string(),srcset:t.string(),width:t.int(),height:t.int()}),p=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)});t.object({label:t.string(),value:t.coerce.number().int()});const l=t.object({published_at:a(s),title:a(t.string()),description:a(t.string()),location:a(t.string()),outputs:a(t.string().array()),initiation_type:a(t.string()),recruitment_method:a(t.string()),recruitment_description:a(t.string()),participant_count:a(t.int()),organiser_reflections:a(t.string()),organiser_report_url:a(t.string()),location_details:a(t.string()),date:a(t.string()),duration:a(t.int()),contact_information_url:a(t.string()),cover_image_id:a(t.string())}),c=t.object({id:t.uuid(),sequential_id:t.int(),created_at:s,updated_at:s,published_at:a(s),state:t.enum(["DISCARDED","DRAFTED","PUBLISHED","CHANGED"]),slug:a(t.string()),draft_content:a(l),published_content:a(l),media:t.object({images:d.array()})});t.object({id:t.uuid(),created_at:s,updated_at:s,sub:t.string(),is_mutirao:t.boolean()});const E={endpoint:()=>i.ACCOUNT_REPORTS,method:e.GET,payload:t.never(),response:t.object({reports:c.array()})},T={endpoint:t=>`${i.ACCOUNT_REPORTS}/${t}`,method:e.GET,payload:t.never(),response:a(c)},u={endpoint:()=>i.ACCOUNT_REPORTS,method:e.POST,payload:t.object({sequential_id:t.int(),content:a(l.omit({cover_image_id:!0}))}),response:c},S={endpoint:t=>`${i.ACCOUNT_REPORTS}/${t}/content`,method:e.PUT,payload:l.omit({published_at:!0,cover_image_id:!0}),response:c},_={endpoint:t=>`${i.ACCOUNT_REPORTS}/${t}/discard`,method:e.PATCH,payload:t.nullish(t.object()),response:a(c)},m={endpoint:t=>`${i.ACCOUNT_REPORTS}/${t}/publish`,method:e.PATCH,payload:t.object({published_at:s}),response:c},R={endpoint:t=>`${i.ACCOUNT_REPORTS}/${t}/unpublish`,method:e.PATCH,payload:t.nullish(t.object()),response:c},g={endpoint:t=>`${i.ACCOUNT_REPORTS}/${t}/cover-image`,method:e.POST,payload:d.pick({alt:!0}),response:c},A={endpoint:()=>i.INTEREST,method:e.POST,payload:p,response:t.string()},P={endpoint:()=>i.REPORTS,method:e.GET,payload:t.never(),response:t.object({reports:c.array()})},C={endpoint:t=>`${i.REPORTS}/${t}`,method:e.GET,payload:t.never(),response:a(c)};export{i as ApiEndpoint,e as ApiRestMethod,n as ApiRouteParameter,T as GetAccountReportsIdSchema,E as GetAccountReportsSchema,C as GetReportsIdSchema,P as GetReportsSchema,_ as PatchAccountReportsIdDiscardSchema,m as PatchAccountReportsIdPublishSchema,R as PatchAccountReportsIdUnpublishSchema,g as PostAccountReportsIdCoverImageSchema,u as PostAccountReportsSchema,A as PostInterestSchema,S as PutAccountReportsIdContentSchema,o as ReportState,r as SurveyName};
|
package/dist/schemas/api.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare const GetAccountReportsSchema: {
|
|
|
8
8
|
response: z.ZodObject<{
|
|
9
9
|
reports: z.ZodArray<z.ZodObject<{
|
|
10
10
|
id: z.ZodUUID;
|
|
11
|
+
sequential_id: z.ZodInt;
|
|
11
12
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
12
13
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
13
14
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -17,7 +18,7 @@ export declare const GetAccountReportsSchema: {
|
|
|
17
18
|
PUBLISHED: "PUBLISHED";
|
|
18
19
|
CHANGED: "CHANGED";
|
|
19
20
|
}>;
|
|
20
|
-
|
|
21
|
+
slug: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
21
22
|
draft_content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
22
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>>;
|
|
23
24
|
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -142,6 +143,7 @@ export declare const GetAccountReportsIdSchema: {
|
|
|
142
143
|
payload: z.ZodNever;
|
|
143
144
|
response: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
144
145
|
id: z.ZodUUID;
|
|
146
|
+
sequential_id: z.ZodInt;
|
|
145
147
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
146
148
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
147
149
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -151,7 +153,7 @@ export declare const GetAccountReportsIdSchema: {
|
|
|
151
153
|
PUBLISHED: "PUBLISHED";
|
|
152
154
|
CHANGED: "CHANGED";
|
|
153
155
|
}>;
|
|
154
|
-
|
|
156
|
+
slug: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
155
157
|
draft_content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
156
158
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
157
159
|
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -269,11 +271,12 @@ export declare const GetAccountReportsIdSchema: {
|
|
|
269
271
|
}, z.core.$strip>;
|
|
270
272
|
}, z.core.$strip>>>, z.ZodTransform<{
|
|
271
273
|
id: string;
|
|
274
|
+
sequential_id: number;
|
|
272
275
|
created_at: string;
|
|
273
276
|
updated_at: string;
|
|
274
277
|
published_at: string | null;
|
|
275
278
|
state: "DISCARDED" | "DRAFTED" | "PUBLISHED" | "CHANGED";
|
|
276
|
-
|
|
279
|
+
slug: string | null;
|
|
277
280
|
draft_content: {
|
|
278
281
|
published_at: string | null;
|
|
279
282
|
title: string | null;
|
|
@@ -323,11 +326,12 @@ export declare const GetAccountReportsIdSchema: {
|
|
|
323
326
|
};
|
|
324
327
|
} | null, {
|
|
325
328
|
id: string;
|
|
329
|
+
sequential_id: number;
|
|
326
330
|
created_at: string;
|
|
327
331
|
updated_at: string;
|
|
328
332
|
published_at: string | null;
|
|
329
333
|
state: "DISCARDED" | "DRAFTED" | "PUBLISHED" | "CHANGED";
|
|
330
|
-
|
|
334
|
+
slug: string | null;
|
|
331
335
|
draft_content: {
|
|
332
336
|
published_at: string | null;
|
|
333
337
|
title: string | null;
|
|
@@ -380,57 +384,61 @@ export declare const GetAccountReportsIdSchema: {
|
|
|
380
384
|
export declare const PostAccountReportsSchema: {
|
|
381
385
|
endpoint: () => AccountEndpoint;
|
|
382
386
|
method: ApiRestMethod;
|
|
383
|
-
payload: z.
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
387
|
+
payload: z.ZodObject<{
|
|
388
|
+
sequential_id: z.ZodInt;
|
|
389
|
+
content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
390
|
+
date: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
391
|
+
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
392
|
+
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
393
|
+
description: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
394
|
+
location: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
395
|
+
outputs: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[] | null, string[] | null | undefined>>;
|
|
396
|
+
initiation_type: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
397
|
+
recruitment_method: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
398
|
+
recruitment_description: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
399
|
+
participant_count: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodInt>>, z.ZodTransform<number | null, number | null | undefined>>;
|
|
400
|
+
organiser_reflections: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
401
|
+
organiser_report_url: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
402
|
+
location_details: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
403
|
+
duration: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodInt>>, z.ZodTransform<number | null, number | null | undefined>>;
|
|
404
|
+
contact_information_url: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
405
|
+
}, z.core.$strip>>>, z.ZodTransform<{
|
|
406
|
+
date: string | null;
|
|
407
|
+
published_at: string | null;
|
|
408
|
+
title: string | null;
|
|
409
|
+
description: string | null;
|
|
410
|
+
location: string | null;
|
|
411
|
+
outputs: string[] | null;
|
|
412
|
+
initiation_type: string | null;
|
|
413
|
+
recruitment_method: string | null;
|
|
414
|
+
recruitment_description: string | null;
|
|
415
|
+
participant_count: number | null;
|
|
416
|
+
organiser_reflections: string | null;
|
|
417
|
+
organiser_report_url: string | null;
|
|
418
|
+
location_details: string | null;
|
|
419
|
+
duration: number | null;
|
|
420
|
+
contact_information_url: string | null;
|
|
421
|
+
} | null, {
|
|
422
|
+
date: string | null;
|
|
423
|
+
published_at: string | null;
|
|
424
|
+
title: string | null;
|
|
425
|
+
description: string | null;
|
|
426
|
+
location: string | null;
|
|
427
|
+
outputs: string[] | null;
|
|
428
|
+
initiation_type: string | null;
|
|
429
|
+
recruitment_method: string | null;
|
|
430
|
+
recruitment_description: string | null;
|
|
431
|
+
participant_count: number | null;
|
|
432
|
+
organiser_reflections: string | null;
|
|
433
|
+
organiser_report_url: string | null;
|
|
434
|
+
location_details: string | null;
|
|
435
|
+
duration: number | null;
|
|
436
|
+
contact_information_url: string | null;
|
|
437
|
+
} | null | undefined>>;
|
|
438
|
+
}, z.core.$strip>;
|
|
432
439
|
response: z.ZodObject<{
|
|
433
440
|
id: z.ZodUUID;
|
|
441
|
+
sequential_id: z.ZodInt;
|
|
434
442
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
435
443
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
436
444
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -440,7 +448,7 @@ export declare const PostAccountReportsSchema: {
|
|
|
440
448
|
PUBLISHED: "PUBLISHED";
|
|
441
449
|
CHANGED: "CHANGED";
|
|
442
450
|
}>;
|
|
443
|
-
|
|
451
|
+
slug: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
444
452
|
draft_content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
445
453
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
446
454
|
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -579,6 +587,7 @@ export declare const PutAccountReportsIdContentSchema: {
|
|
|
579
587
|
}, z.core.$strip>;
|
|
580
588
|
response: z.ZodObject<{
|
|
581
589
|
id: z.ZodUUID;
|
|
590
|
+
sequential_id: z.ZodInt;
|
|
582
591
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
583
592
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
584
593
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -588,7 +597,7 @@ export declare const PutAccountReportsIdContentSchema: {
|
|
|
588
597
|
PUBLISHED: "PUBLISHED";
|
|
589
598
|
CHANGED: "CHANGED";
|
|
590
599
|
}>;
|
|
591
|
-
|
|
600
|
+
slug: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
592
601
|
draft_content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
593
602
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
594
603
|
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -712,6 +721,7 @@ export declare const PatchAccountReportsIdDiscardSchema: {
|
|
|
712
721
|
payload: z.ZodOptional<z.ZodNullable<z.ZodObject<{}, z.core.$strip>>>;
|
|
713
722
|
response: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
714
723
|
id: z.ZodUUID;
|
|
724
|
+
sequential_id: z.ZodInt;
|
|
715
725
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
716
726
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
717
727
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -721,7 +731,7 @@ export declare const PatchAccountReportsIdDiscardSchema: {
|
|
|
721
731
|
PUBLISHED: "PUBLISHED";
|
|
722
732
|
CHANGED: "CHANGED";
|
|
723
733
|
}>;
|
|
724
|
-
|
|
734
|
+
slug: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
725
735
|
draft_content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
726
736
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
727
737
|
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -839,11 +849,12 @@ export declare const PatchAccountReportsIdDiscardSchema: {
|
|
|
839
849
|
}, z.core.$strip>;
|
|
840
850
|
}, z.core.$strip>>>, z.ZodTransform<{
|
|
841
851
|
id: string;
|
|
852
|
+
sequential_id: number;
|
|
842
853
|
created_at: string;
|
|
843
854
|
updated_at: string;
|
|
844
855
|
published_at: string | null;
|
|
845
856
|
state: "DISCARDED" | "DRAFTED" | "PUBLISHED" | "CHANGED";
|
|
846
|
-
|
|
857
|
+
slug: string | null;
|
|
847
858
|
draft_content: {
|
|
848
859
|
published_at: string | null;
|
|
849
860
|
title: string | null;
|
|
@@ -893,11 +904,12 @@ export declare const PatchAccountReportsIdDiscardSchema: {
|
|
|
893
904
|
};
|
|
894
905
|
} | null, {
|
|
895
906
|
id: string;
|
|
907
|
+
sequential_id: number;
|
|
896
908
|
created_at: string;
|
|
897
909
|
updated_at: string;
|
|
898
910
|
published_at: string | null;
|
|
899
911
|
state: "DISCARDED" | "DRAFTED" | "PUBLISHED" | "CHANGED";
|
|
900
|
-
|
|
912
|
+
slug: string | null;
|
|
901
913
|
draft_content: {
|
|
902
914
|
published_at: string | null;
|
|
903
915
|
title: string | null;
|
|
@@ -955,6 +967,7 @@ export declare const PatchAccountReportsIdPublishSchema: {
|
|
|
955
967
|
}, z.core.$strip>;
|
|
956
968
|
response: z.ZodObject<{
|
|
957
969
|
id: z.ZodUUID;
|
|
970
|
+
sequential_id: z.ZodInt;
|
|
958
971
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
959
972
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
960
973
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -964,7 +977,7 @@ export declare const PatchAccountReportsIdPublishSchema: {
|
|
|
964
977
|
PUBLISHED: "PUBLISHED";
|
|
965
978
|
CHANGED: "CHANGED";
|
|
966
979
|
}>;
|
|
967
|
-
|
|
980
|
+
slug: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
968
981
|
draft_content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
969
982
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
970
983
|
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -1088,6 +1101,7 @@ export declare const PatchAccountReportsIdUnpublishSchema: {
|
|
|
1088
1101
|
payload: z.ZodOptional<z.ZodNullable<z.ZodObject<{}, z.core.$strip>>>;
|
|
1089
1102
|
response: z.ZodObject<{
|
|
1090
1103
|
id: z.ZodUUID;
|
|
1104
|
+
sequential_id: z.ZodInt;
|
|
1091
1105
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1092
1106
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1093
1107
|
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,7 +1111,7 @@ export declare const PatchAccountReportsIdUnpublishSchema: {
|
|
|
1097
1111
|
PUBLISHED: "PUBLISHED";
|
|
1098
1112
|
CHANGED: "CHANGED";
|
|
1099
1113
|
}>;
|
|
1100
|
-
|
|
1114
|
+
slug: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
1101
1115
|
draft_content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1102
1116
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
1103
1117
|
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -1223,6 +1237,7 @@ export declare const PostAccountReportsIdCoverImageSchema: {
|
|
|
1223
1237
|
}, z.core.$strip>;
|
|
1224
1238
|
response: z.ZodObject<{
|
|
1225
1239
|
id: z.ZodUUID;
|
|
1240
|
+
sequential_id: z.ZodInt;
|
|
1226
1241
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1227
1242
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1228
1243
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -1232,7 +1247,7 @@ export declare const PostAccountReportsIdCoverImageSchema: {
|
|
|
1232
1247
|
PUBLISHED: "PUBLISHED";
|
|
1233
1248
|
CHANGED: "CHANGED";
|
|
1234
1249
|
}>;
|
|
1235
|
-
|
|
1250
|
+
slug: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
1236
1251
|
draft_content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1237
1252
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
1238
1253
|
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -1371,6 +1386,7 @@ export declare const GetReportsSchema: {
|
|
|
1371
1386
|
response: z.ZodObject<{
|
|
1372
1387
|
reports: z.ZodArray<z.ZodObject<{
|
|
1373
1388
|
id: z.ZodUUID;
|
|
1389
|
+
sequential_id: z.ZodInt;
|
|
1374
1390
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1375
1391
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1376
1392
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -1380,7 +1396,7 @@ export declare const GetReportsSchema: {
|
|
|
1380
1396
|
PUBLISHED: "PUBLISHED";
|
|
1381
1397
|
CHANGED: "CHANGED";
|
|
1382
1398
|
}>;
|
|
1383
|
-
|
|
1399
|
+
slug: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
1384
1400
|
draft_content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1385
1401
|
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
1402
|
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -1505,6 +1521,7 @@ export declare const GetReportsIdSchema: {
|
|
|
1505
1521
|
payload: z.ZodNever;
|
|
1506
1522
|
response: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1507
1523
|
id: z.ZodUUID;
|
|
1524
|
+
sequential_id: z.ZodInt;
|
|
1508
1525
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1509
1526
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1510
1527
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -1514,7 +1531,7 @@ export declare const GetReportsIdSchema: {
|
|
|
1514
1531
|
PUBLISHED: "PUBLISHED";
|
|
1515
1532
|
CHANGED: "CHANGED";
|
|
1516
1533
|
}>;
|
|
1517
|
-
|
|
1534
|
+
slug: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
1518
1535
|
draft_content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1519
1536
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
1520
1537
|
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -1632,11 +1649,12 @@ export declare const GetReportsIdSchema: {
|
|
|
1632
1649
|
}, z.core.$strip>;
|
|
1633
1650
|
}, z.core.$strip>>>, z.ZodTransform<{
|
|
1634
1651
|
id: string;
|
|
1652
|
+
sequential_id: number;
|
|
1635
1653
|
created_at: string;
|
|
1636
1654
|
updated_at: string;
|
|
1637
1655
|
published_at: string | null;
|
|
1638
1656
|
state: "DISCARDED" | "DRAFTED" | "PUBLISHED" | "CHANGED";
|
|
1639
|
-
|
|
1657
|
+
slug: string | null;
|
|
1640
1658
|
draft_content: {
|
|
1641
1659
|
published_at: string | null;
|
|
1642
1660
|
title: string | null;
|
|
@@ -1686,11 +1704,12 @@ export declare const GetReportsIdSchema: {
|
|
|
1686
1704
|
};
|
|
1687
1705
|
} | null, {
|
|
1688
1706
|
id: string;
|
|
1707
|
+
sequential_id: number;
|
|
1689
1708
|
created_at: string;
|
|
1690
1709
|
updated_at: string;
|
|
1691
1710
|
published_at: string | null;
|
|
1692
1711
|
state: "DISCARDED" | "DRAFTED" | "PUBLISHED" | "CHANGED";
|
|
1693
|
-
|
|
1712
|
+
slug: string | null;
|
|
1694
1713
|
draft_content: {
|
|
1695
1714
|
published_at: string | null;
|
|
1696
1715
|
title: string | null;
|
package/dist/schemas/base.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export declare const ReportContentSchema: z.ZodObject<{
|
|
|
41
41
|
}, z.core.$strip>;
|
|
42
42
|
export declare const ReportSchema: z.ZodObject<{
|
|
43
43
|
id: z.ZodUUID;
|
|
44
|
+
sequential_id: z.ZodInt;
|
|
44
45
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
45
46
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
46
47
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -50,7 +51,7 @@ export declare const ReportSchema: z.ZodObject<{
|
|
|
50
51
|
PUBLISHED: "PUBLISHED";
|
|
51
52
|
CHANGED: "CHANGED";
|
|
52
53
|
}>;
|
|
53
|
-
|
|
54
|
+
slug: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
54
55
|
draft_content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
55
56
|
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
56
57
|
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
package/dist/schemas/index.d.ts
CHANGED
package/dist/schemas/legacy.d.ts
CHANGED
|
@@ -282,14 +282,14 @@ export declare const AssemblyDetailSchema: {
|
|
|
282
282
|
} | null | undefined>>;
|
|
283
283
|
}, z.core.$strip>;
|
|
284
284
|
response: z.ZodObject<{
|
|
285
|
-
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
286
|
-
id: z.ZodUUID;
|
|
287
285
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
288
286
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
287
|
+
id: z.ZodUUID;
|
|
288
|
+
country: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
289
|
+
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
289
290
|
name: z.ZodString;
|
|
290
291
|
about: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
291
292
|
topics: z.ZodArray<z.ZodString>;
|
|
292
|
-
country: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
293
293
|
hide: z.ZodDefault<z.ZodBoolean>;
|
|
294
294
|
image_src: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
295
295
|
has_image: z.ZodBoolean;
|
package/dist/types/api.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { PatchAccountReportsIdPublishSchema, PostAccountReportsIdCoverImageSchema, PutAccountReportsIdContentSchema } from '../schemas';
|
|
3
|
+
import { AssembliesListSchema, AssemblyDetailSchema, AssemblyOverviewSchema, FeedbackSchema, LogSchema, PinListSchema, PinSchema, RegisterSchema, SurveyResponseSchema, SurveySchema } from '../schemas/legacy';
|
|
3
4
|
export type PutAccountReportsIdContentPayload = z.infer<(typeof PutAccountReportsIdContentSchema)['payload']>;
|
|
4
5
|
export type PublishReportPayload = z.infer<(typeof PatchAccountReportsIdPublishSchema)['payload']>;
|
|
5
6
|
export type ImageMetadataPayload = z.infer<(typeof PostAccountReportsIdCoverImageSchema)['payload']>;
|
package/package.json
CHANGED
package/src/schemas/api.ts
CHANGED
|
@@ -30,7 +30,10 @@ export const GetAccountReportsIdSchema = {
|
|
|
30
30
|
export const PostAccountReportsSchema = {
|
|
31
31
|
endpoint: (): AccountEndpoint => ApiEndpoint.ACCOUNT_REPORTS,
|
|
32
32
|
method: ApiRestMethod.POST,
|
|
33
|
-
payload:
|
|
33
|
+
payload: z.object({
|
|
34
|
+
sequential_id: z.int(),
|
|
35
|
+
content: maybe(ReportContentSchema.omit({ cover_image_id: true }))
|
|
36
|
+
}),
|
|
34
37
|
response: ReportSchema
|
|
35
38
|
};
|
|
36
39
|
|
package/src/schemas/base.ts
CHANGED
|
@@ -61,11 +61,12 @@ export const ReportContentSchema = z.object({
|
|
|
61
61
|
|
|
62
62
|
export const ReportSchema = z.object({
|
|
63
63
|
id: z.uuid(),
|
|
64
|
+
sequential_id: z.int(),
|
|
64
65
|
created_at: isoDateString,
|
|
65
66
|
updated_at: isoDateString,
|
|
66
67
|
published_at: maybe(isoDateString),
|
|
67
68
|
state: z.enum(['DISCARDED', 'DRAFTED', 'PUBLISHED', 'CHANGED']),
|
|
68
|
-
|
|
69
|
+
slug: maybe(z.string()),
|
|
69
70
|
draft_content: maybe(ReportContentSchema),
|
|
70
71
|
published_content: maybe(ReportContentSchema),
|
|
71
72
|
media: z.object({ images: ImageSchema.array() })
|
package/src/schemas/index.ts
CHANGED
package/src/types/api.ts
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
+
import {
|
|
3
|
+
PatchAccountReportsIdPublishSchema,
|
|
4
|
+
PostAccountReportsIdCoverImageSchema,
|
|
5
|
+
PutAccountReportsIdContentSchema
|
|
6
|
+
} from '../schemas';
|
|
2
7
|
import {
|
|
3
8
|
AssembliesListSchema,
|
|
4
9
|
AssemblyDetailSchema,
|
|
5
10
|
AssemblyOverviewSchema,
|
|
6
11
|
FeedbackSchema,
|
|
7
12
|
LogSchema,
|
|
8
|
-
PatchAccountReportsIdPublishSchema,
|
|
9
13
|
PinListSchema,
|
|
10
14
|
PinSchema,
|
|
11
|
-
PostAccountReportsIdCoverImageSchema,
|
|
12
|
-
PutAccountReportsIdContentSchema,
|
|
13
15
|
RegisterSchema,
|
|
14
16
|
SurveyResponseSchema,
|
|
15
17
|
SurveySchema
|
|
16
|
-
} from '../schemas';
|
|
18
|
+
} from '../schemas/legacy';
|
|
17
19
|
|
|
18
20
|
export type PutAccountReportsIdContentPayload = z.infer<
|
|
19
21
|
(typeof PutAccountReportsIdContentSchema)['payload']
|