@assemblis/contracts 0.1.20 → 0.2.1
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 +85 -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 +5 -2
- 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(),total:t.int()})},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>>;
|
|
@@ -134,6 +135,7 @@ export declare const GetAccountReportsSchema: {
|
|
|
134
135
|
}, z.core.$strip>>;
|
|
135
136
|
}, z.core.$strip>;
|
|
136
137
|
}, z.core.$strip>>;
|
|
138
|
+
total: z.ZodInt;
|
|
137
139
|
}, z.core.$strip>;
|
|
138
140
|
};
|
|
139
141
|
export declare const GetAccountReportsIdSchema: {
|
|
@@ -142,6 +144,7 @@ export declare const GetAccountReportsIdSchema: {
|
|
|
142
144
|
payload: z.ZodNever;
|
|
143
145
|
response: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
144
146
|
id: z.ZodUUID;
|
|
147
|
+
sequential_id: z.ZodInt;
|
|
145
148
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
146
149
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
147
150
|
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 +154,7 @@ export declare const GetAccountReportsIdSchema: {
|
|
|
151
154
|
PUBLISHED: "PUBLISHED";
|
|
152
155
|
CHANGED: "CHANGED";
|
|
153
156
|
}>;
|
|
154
|
-
|
|
157
|
+
slug: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
155
158
|
draft_content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
156
159
|
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
160
|
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -269,11 +272,12 @@ export declare const GetAccountReportsIdSchema: {
|
|
|
269
272
|
}, z.core.$strip>;
|
|
270
273
|
}, z.core.$strip>>>, z.ZodTransform<{
|
|
271
274
|
id: string;
|
|
275
|
+
sequential_id: number;
|
|
272
276
|
created_at: string;
|
|
273
277
|
updated_at: string;
|
|
274
278
|
published_at: string | null;
|
|
275
279
|
state: "DISCARDED" | "DRAFTED" | "PUBLISHED" | "CHANGED";
|
|
276
|
-
|
|
280
|
+
slug: string | null;
|
|
277
281
|
draft_content: {
|
|
278
282
|
published_at: string | null;
|
|
279
283
|
title: string | null;
|
|
@@ -323,11 +327,12 @@ export declare const GetAccountReportsIdSchema: {
|
|
|
323
327
|
};
|
|
324
328
|
} | null, {
|
|
325
329
|
id: string;
|
|
330
|
+
sequential_id: number;
|
|
326
331
|
created_at: string;
|
|
327
332
|
updated_at: string;
|
|
328
333
|
published_at: string | null;
|
|
329
334
|
state: "DISCARDED" | "DRAFTED" | "PUBLISHED" | "CHANGED";
|
|
330
|
-
|
|
335
|
+
slug: string | null;
|
|
331
336
|
draft_content: {
|
|
332
337
|
published_at: string | null;
|
|
333
338
|
title: string | null;
|
|
@@ -380,57 +385,61 @@ export declare const GetAccountReportsIdSchema: {
|
|
|
380
385
|
export declare const PostAccountReportsSchema: {
|
|
381
386
|
endpoint: () => AccountEndpoint;
|
|
382
387
|
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
|
-
|
|
388
|
+
payload: z.ZodObject<{
|
|
389
|
+
sequential_id: z.ZodInt;
|
|
390
|
+
content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
391
|
+
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
|
+
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
394
|
+
description: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
395
|
+
location: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
396
|
+
outputs: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[] | null, string[] | null | undefined>>;
|
|
397
|
+
initiation_type: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
398
|
+
recruitment_method: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
399
|
+
recruitment_description: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
400
|
+
participant_count: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodInt>>, z.ZodTransform<number | null, number | null | undefined>>;
|
|
401
|
+
organiser_reflections: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
402
|
+
organiser_report_url: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
403
|
+
location_details: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
404
|
+
duration: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodInt>>, z.ZodTransform<number | null, number | null | undefined>>;
|
|
405
|
+
contact_information_url: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
406
|
+
}, z.core.$strip>>>, z.ZodTransform<{
|
|
407
|
+
date: string | null;
|
|
408
|
+
published_at: string | null;
|
|
409
|
+
title: string | null;
|
|
410
|
+
description: string | null;
|
|
411
|
+
location: string | null;
|
|
412
|
+
outputs: string[] | null;
|
|
413
|
+
initiation_type: string | null;
|
|
414
|
+
recruitment_method: string | null;
|
|
415
|
+
recruitment_description: string | null;
|
|
416
|
+
participant_count: number | null;
|
|
417
|
+
organiser_reflections: string | null;
|
|
418
|
+
organiser_report_url: string | null;
|
|
419
|
+
location_details: string | null;
|
|
420
|
+
duration: number | null;
|
|
421
|
+
contact_information_url: string | null;
|
|
422
|
+
} | null, {
|
|
423
|
+
date: string | null;
|
|
424
|
+
published_at: string | null;
|
|
425
|
+
title: string | null;
|
|
426
|
+
description: string | null;
|
|
427
|
+
location: string | null;
|
|
428
|
+
outputs: string[] | null;
|
|
429
|
+
initiation_type: string | null;
|
|
430
|
+
recruitment_method: string | null;
|
|
431
|
+
recruitment_description: string | null;
|
|
432
|
+
participant_count: number | null;
|
|
433
|
+
organiser_reflections: string | null;
|
|
434
|
+
organiser_report_url: string | null;
|
|
435
|
+
location_details: string | null;
|
|
436
|
+
duration: number | null;
|
|
437
|
+
contact_information_url: string | null;
|
|
438
|
+
} | null | undefined>>;
|
|
439
|
+
}, z.core.$strip>;
|
|
432
440
|
response: z.ZodObject<{
|
|
433
441
|
id: z.ZodUUID;
|
|
442
|
+
sequential_id: z.ZodInt;
|
|
434
443
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
435
444
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
436
445
|
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 +449,7 @@ export declare const PostAccountReportsSchema: {
|
|
|
440
449
|
PUBLISHED: "PUBLISHED";
|
|
441
450
|
CHANGED: "CHANGED";
|
|
442
451
|
}>;
|
|
443
|
-
|
|
452
|
+
slug: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
444
453
|
draft_content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
445
454
|
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
455
|
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -579,6 +588,7 @@ export declare const PutAccountReportsIdContentSchema: {
|
|
|
579
588
|
}, z.core.$strip>;
|
|
580
589
|
response: z.ZodObject<{
|
|
581
590
|
id: z.ZodUUID;
|
|
591
|
+
sequential_id: z.ZodInt;
|
|
582
592
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
583
593
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
584
594
|
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 +598,7 @@ export declare const PutAccountReportsIdContentSchema: {
|
|
|
588
598
|
PUBLISHED: "PUBLISHED";
|
|
589
599
|
CHANGED: "CHANGED";
|
|
590
600
|
}>;
|
|
591
|
-
|
|
601
|
+
slug: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
592
602
|
draft_content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
593
603
|
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
604
|
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -712,6 +722,7 @@ export declare const PatchAccountReportsIdDiscardSchema: {
|
|
|
712
722
|
payload: z.ZodOptional<z.ZodNullable<z.ZodObject<{}, z.core.$strip>>>;
|
|
713
723
|
response: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
714
724
|
id: z.ZodUUID;
|
|
725
|
+
sequential_id: z.ZodInt;
|
|
715
726
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
716
727
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
717
728
|
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 +732,7 @@ export declare const PatchAccountReportsIdDiscardSchema: {
|
|
|
721
732
|
PUBLISHED: "PUBLISHED";
|
|
722
733
|
CHANGED: "CHANGED";
|
|
723
734
|
}>;
|
|
724
|
-
|
|
735
|
+
slug: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
725
736
|
draft_content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
726
737
|
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
738
|
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -839,11 +850,12 @@ export declare const PatchAccountReportsIdDiscardSchema: {
|
|
|
839
850
|
}, z.core.$strip>;
|
|
840
851
|
}, z.core.$strip>>>, z.ZodTransform<{
|
|
841
852
|
id: string;
|
|
853
|
+
sequential_id: number;
|
|
842
854
|
created_at: string;
|
|
843
855
|
updated_at: string;
|
|
844
856
|
published_at: string | null;
|
|
845
857
|
state: "DISCARDED" | "DRAFTED" | "PUBLISHED" | "CHANGED";
|
|
846
|
-
|
|
858
|
+
slug: string | null;
|
|
847
859
|
draft_content: {
|
|
848
860
|
published_at: string | null;
|
|
849
861
|
title: string | null;
|
|
@@ -893,11 +905,12 @@ export declare const PatchAccountReportsIdDiscardSchema: {
|
|
|
893
905
|
};
|
|
894
906
|
} | null, {
|
|
895
907
|
id: string;
|
|
908
|
+
sequential_id: number;
|
|
896
909
|
created_at: string;
|
|
897
910
|
updated_at: string;
|
|
898
911
|
published_at: string | null;
|
|
899
912
|
state: "DISCARDED" | "DRAFTED" | "PUBLISHED" | "CHANGED";
|
|
900
|
-
|
|
913
|
+
slug: string | null;
|
|
901
914
|
draft_content: {
|
|
902
915
|
published_at: string | null;
|
|
903
916
|
title: string | null;
|
|
@@ -955,6 +968,7 @@ export declare const PatchAccountReportsIdPublishSchema: {
|
|
|
955
968
|
}, z.core.$strip>;
|
|
956
969
|
response: z.ZodObject<{
|
|
957
970
|
id: z.ZodUUID;
|
|
971
|
+
sequential_id: z.ZodInt;
|
|
958
972
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
959
973
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
960
974
|
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 +978,7 @@ export declare const PatchAccountReportsIdPublishSchema: {
|
|
|
964
978
|
PUBLISHED: "PUBLISHED";
|
|
965
979
|
CHANGED: "CHANGED";
|
|
966
980
|
}>;
|
|
967
|
-
|
|
981
|
+
slug: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
968
982
|
draft_content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
969
983
|
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
984
|
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -1088,6 +1102,7 @@ export declare const PatchAccountReportsIdUnpublishSchema: {
|
|
|
1088
1102
|
payload: z.ZodOptional<z.ZodNullable<z.ZodObject<{}, z.core.$strip>>>;
|
|
1089
1103
|
response: z.ZodObject<{
|
|
1090
1104
|
id: z.ZodUUID;
|
|
1105
|
+
sequential_id: z.ZodInt;
|
|
1091
1106
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1092
1107
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1093
1108
|
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 +1112,7 @@ export declare const PatchAccountReportsIdUnpublishSchema: {
|
|
|
1097
1112
|
PUBLISHED: "PUBLISHED";
|
|
1098
1113
|
CHANGED: "CHANGED";
|
|
1099
1114
|
}>;
|
|
1100
|
-
|
|
1115
|
+
slug: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
1101
1116
|
draft_content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1102
1117
|
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
1118
|
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -1223,6 +1238,7 @@ export declare const PostAccountReportsIdCoverImageSchema: {
|
|
|
1223
1238
|
}, z.core.$strip>;
|
|
1224
1239
|
response: z.ZodObject<{
|
|
1225
1240
|
id: z.ZodUUID;
|
|
1241
|
+
sequential_id: z.ZodInt;
|
|
1226
1242
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1227
1243
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1228
1244
|
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 +1248,7 @@ export declare const PostAccountReportsIdCoverImageSchema: {
|
|
|
1232
1248
|
PUBLISHED: "PUBLISHED";
|
|
1233
1249
|
CHANGED: "CHANGED";
|
|
1234
1250
|
}>;
|
|
1235
|
-
|
|
1251
|
+
slug: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
1236
1252
|
draft_content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1237
1253
|
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
1254
|
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -1371,6 +1387,7 @@ export declare const GetReportsSchema: {
|
|
|
1371
1387
|
response: z.ZodObject<{
|
|
1372
1388
|
reports: z.ZodArray<z.ZodObject<{
|
|
1373
1389
|
id: z.ZodUUID;
|
|
1390
|
+
sequential_id: z.ZodInt;
|
|
1374
1391
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1375
1392
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1376
1393
|
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 +1397,7 @@ export declare const GetReportsSchema: {
|
|
|
1380
1397
|
PUBLISHED: "PUBLISHED";
|
|
1381
1398
|
CHANGED: "CHANGED";
|
|
1382
1399
|
}>;
|
|
1383
|
-
|
|
1400
|
+
slug: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
1384
1401
|
draft_content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1385
1402
|
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
1403
|
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -1505,6 +1522,7 @@ export declare const GetReportsIdSchema: {
|
|
|
1505
1522
|
payload: z.ZodNever;
|
|
1506
1523
|
response: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1507
1524
|
id: z.ZodUUID;
|
|
1525
|
+
sequential_id: z.ZodInt;
|
|
1508
1526
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1509
1527
|
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1510
1528
|
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 +1532,7 @@ export declare const GetReportsIdSchema: {
|
|
|
1514
1532
|
PUBLISHED: "PUBLISHED";
|
|
1515
1533
|
CHANGED: "CHANGED";
|
|
1516
1534
|
}>;
|
|
1517
|
-
|
|
1535
|
+
slug: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
1518
1536
|
draft_content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1519
1537
|
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
1538
|
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
@@ -1632,11 +1650,12 @@ export declare const GetReportsIdSchema: {
|
|
|
1632
1650
|
}, z.core.$strip>;
|
|
1633
1651
|
}, z.core.$strip>>>, z.ZodTransform<{
|
|
1634
1652
|
id: string;
|
|
1653
|
+
sequential_id: number;
|
|
1635
1654
|
created_at: string;
|
|
1636
1655
|
updated_at: string;
|
|
1637
1656
|
published_at: string | null;
|
|
1638
1657
|
state: "DISCARDED" | "DRAFTED" | "PUBLISHED" | "CHANGED";
|
|
1639
|
-
|
|
1658
|
+
slug: string | null;
|
|
1640
1659
|
draft_content: {
|
|
1641
1660
|
published_at: string | null;
|
|
1642
1661
|
title: string | null;
|
|
@@ -1686,11 +1705,12 @@ export declare const GetReportsIdSchema: {
|
|
|
1686
1705
|
};
|
|
1687
1706
|
} | null, {
|
|
1688
1707
|
id: string;
|
|
1708
|
+
sequential_id: number;
|
|
1689
1709
|
created_at: string;
|
|
1690
1710
|
updated_at: string;
|
|
1691
1711
|
published_at: string | null;
|
|
1692
1712
|
state: "DISCARDED" | "DRAFTED" | "PUBLISHED" | "CHANGED";
|
|
1693
|
-
|
|
1713
|
+
slug: string | null;
|
|
1694
1714
|
draft_content: {
|
|
1695
1715
|
published_at: string | null;
|
|
1696
1716
|
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
|
@@ -16,7 +16,7 @@ export const GetAccountReportsSchema = {
|
|
|
16
16
|
endpoint: (): AccountEndpoint => ApiEndpoint.ACCOUNT_REPORTS,
|
|
17
17
|
method: ApiRestMethod.GET,
|
|
18
18
|
payload: z.never(),
|
|
19
|
-
response: z.object({ reports: ReportSchema.array() })
|
|
19
|
+
response: z.object({ reports: ReportSchema.array(), total: z.int() })
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
export const GetAccountReportsIdSchema = {
|
|
@@ -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']
|