@assemblis/contracts 0.0.11 → 0.0.13
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.d.ts +127 -124
- package/package.json +1 -1
- package/src/schemas.ts +64 -60
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"zod";const t=e=>e.nullish().transform(e=>e??null),
|
|
1
|
+
import e from"zod";const t=e=>e.nullish().transform(e=>e??null),r=e.object({label:e.string(),value:e.coerce.number().int()}),a={payload:e.undefined(),response:e.object({id:e.uuid(),created_at:e.coerce.date().transform(e=>e.toISOString()),updated_at:e.coerce.date().transform(e=>e.toISOString()),sub:e.string(),is_mutirao:e.boolean()})},o=e.object({id:e.uuid(),text:e.string()}),n={payload:e.undefined(),response:e.object({id:e.uuid(),created_at:e.coerce.date().transform(e=>e.toISOString()),updated_at:e.coerce.date().transform(e=>e.toISOString()),name:e.string(),sections:e.object({primary:o,secondary:o.array(),options:r.array()}).array()})},i={payload:e.object({answers:e.object({question_id:e.uuid(),answer_value:e.coerce.number().int()}).array()}),response:e.object({total:e.number().int()})},s=e.object({visible_on_profile:e.boolean(),description:t(e.string())}),d=e.object({text:e.string(),agreed:t(e.coerce.number().int()),against:t(e.coerce.number().int()),abstained:t(e.coerce.number().int()),include_in_action_plan:e.boolean().default(!0),assembly_id:e.uuid()}),c=e.object({text:e.string(),complete:e.boolean().default(!1),action_id:e.uuid(),assembly_id:e.uuid()}),u=e.object({published_at:t(e.coerce.date().transform(e=>e.toISOString())),name:e.string(),about:t(e.string()),topics:e.string().array(),country:t(e.string()),hide:e.boolean().default(!1)}),p={payload:u,response:u.extend({id:e.uuid(),created_at:e.coerce.date().transform(e=>e.toISOString()),updated_at:e.coerce.date().transform(e=>e.toISOString()),image_src:t(e.string()),has_image:e.boolean().meta({deprecated:!0}),user_id:e.uuid().meta({deprecated:!0})})},l={payload:e.undefined(),response:e.object({assemblies:p.response.array()})},g=e.object({visible_on_profile:e.boolean(),name:t(e.string()),description:t(e.string()),type:t(e.string())}),_=e.object({visible_on_profile:e.boolean(),registration_link:t(e.string()),start_date:t(e.coerce.date().transform(e=>e.toISOString()))}),S=e.object({visible_on_profile:e.boolean(),background:t(e.string())}),b=e.object({visible_on_profile:e.boolean(),organisation_types:e.string().array(),description:t(e.string())}),m=e.object({visible_on_profile:e.boolean(),organisation_types:e.string().array(),description:t(e.string())}),f=e.object({visible_on_profile:e.boolean(),decision_method:t(e.string())}),y=e.object({visible_on_profile:e.boolean(),recruitment_method:t(e.string()),community:t(e.string())}),I=e.object({visible_on_profile:e.boolean(),support_options:e.string().array()}),O=e.object({visible_on_profile:e.boolean()}),j={payload:p.payload.extend({organisation:t(g.extend({id:e.uuid().optional()})),event_details:t(_),story:t(S),supporters:t(b),funders:t(m),facilitation:t(f),participants:t(y),support:t(I),action_plan:t(s.extend({actions:d.omit({assembly_id:!0}).extend({id:e.uuid().optional(),tasks:c.omit({action_id:!0,assembly_id:!0}).extend({id:e.uuid().optional()}).array(),updates:e.unknown().array()}).array(),updates:e.unknown().array()})),surveys:t(O)}),response:p.response.omit({user_id:!0}).extend({is_own:e.boolean(),organisation:t(g.extend({id:e.uuid(),created_at:e.coerce.date().transform(e=>e.toISOString()),updated_at:e.coerce.date().transform(e=>e.toISOString())})),event_details:t(_.extend({created_at:e.coerce.date().transform(e=>e.toISOString()),updated_at:e.coerce.date().transform(e=>e.toISOString())})),story:t(S.extend({created_at:e.coerce.date().transform(e=>e.toISOString()),updated_at:e.coerce.date().transform(e=>e.toISOString())})),supporters:t(b.extend({created_at:e.coerce.date().transform(e=>e.toISOString()),updated_at:e.coerce.date().transform(e=>e.toISOString())})),funders:t(m.extend({created_at:e.coerce.date().transform(e=>e.toISOString()),updated_at:e.coerce.date().transform(e=>e.toISOString())})),facilitation:t(f.extend({created_at:e.coerce.date().transform(e=>e.toISOString()),updated_at:e.coerce.date().transform(e=>e.toISOString())})),participants:t(y.extend({created_at:e.coerce.date().transform(e=>e.toISOString()),updated_at:e.coerce.date().transform(e=>e.toISOString())})),support:t(I.extend({created_at:e.coerce.date().transform(e=>e.toISOString()),updated_at:e.coerce.date().transform(e=>e.toISOString())})),action_plan:t(s.extend({actions:d.omit({assembly_id:!0}).extend({id:e.uuid(),created_at:e.coerce.date().transform(e=>e.toISOString()),updated_at:e.coerce.date().transform(e=>e.toISOString()),tasks:c.omit({action_id:!0,assembly_id:!0}).extend({id:e.uuid(),created_at:e.coerce.date().transform(e=>e.toISOString()),updated_at:e.coerce.date().transform(e=>e.toISOString())}).array(),updates:e.unknown().array()}).extend({created_at:e.coerce.date().transform(e=>e.toISOString()),updated_at:e.coerce.date().transform(e=>e.toISOString())}).array(),updates:e.unknown().array()}).and(e.object({created_at:e.coerce.date().transform(e=>e.toISOString()),updated_at:e.coerce.date().transform(e=>e.toISOString())}))),surveys:t(O.extend({created_at:e.coerce.date().transform(e=>e.toISOString()),updated_at:e.coerce.date().transform(e=>e.toISOString())}).extend({data:e.record(e.string(),e.object({total:e.number().int(),responses:e.record(e.string(),r.array())}))}))})},x={payload:e.object({route:e.string(),text:e.string(),metadata:e.unknown()}),response:e.string()},E={payload:e.object({message:e.string().optional(),data:e.record(e.string(),e.string().optional()).optional(),metadata:e.object({origin:e.string(),route:e.string(),status:e.number()})}),response:e.string()},v={payload:e.object({type:e.literal("user.created"),object:e.literal("event"),data:e.object({id:e.string(),email_addresses:e.object({email_address:e.string()}).array()})}),response:e.string()},T={payload:e.object({country:e.string(),email:e.string(),text:t(e.string())}),response:e.object({id:e.uuid(),created_at:e.coerce.date().transform(e=>e.toISOString()),updated_at:e.coerce.date().transform(e=>e.toISOString()),country:e.string(),text:t(e.string()),hide:e.boolean(),image_src:t(e.string()),has_image:e.boolean().meta({deprecated:!0})})},A={payload:e.undefined(),response:e.object({assemblies:p.response.array(),pins:T.response.array()})};var P,k,h,M;!function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.PATCH="PATCH"}(P||(P={})),function(e){e.ID=":ID",e.NAME=":NAME"}(k||(k={})),function(e){e.ASSEMBLIES="/assemblies",e.FEEDBACK="/feedback",e.INTEREST_ASSEMBLIS="/interest/assemblis",e.INTEREST_MUTIRAO="/interest/mutirao",e.LOGS="/logs",e.PINS="/pins",e.SURVEYS="/surveys",e.SURVEY_RESPONSES="/assemblies/:ID/survey-responses/:NAME"}(h||(h={})),function(e){e.DELIBERATION="deliberation",e.DEMOGRAPHIC_DATA="demographic-data",e.PRE_ASSEMBLY="pre-assembly",e.POST_ASSEMBLY="post-assembly"}(M||(M={}));export{h as ApiEndpoint,P as ApiRestMethod,k as ApiRouteParameter,l as AssembliesListSchema,j as AssemblyDetailSchema,p as AssemblyOverviewSchema,x as FeedbackSchema,E as LogSchema,A as PinListSchema,T as PinSchema,v as RegisterSchema,M as SurveyName,i as SurveyResponseSchema,n as SurveySchema,a as UserSchema};
|
package/dist/schemas.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import z from
|
|
1
|
+
import z from 'zod';
|
|
2
2
|
export declare const UserSchema: {
|
|
3
3
|
payload: z.ZodUndefined;
|
|
4
4
|
response: z.ZodObject<{
|
|
5
|
-
id: z.
|
|
6
|
-
created_at: z.ZodCoercedDate<unknown
|
|
7
|
-
updated_at: z.ZodCoercedDate<unknown
|
|
5
|
+
id: z.ZodUUID;
|
|
6
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
7
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
8
8
|
sub: z.ZodString;
|
|
9
9
|
is_mutirao: z.ZodBoolean;
|
|
10
10
|
}, z.core.$strip>;
|
|
@@ -12,17 +12,17 @@ export declare const UserSchema: {
|
|
|
12
12
|
export declare const SurveySchema: {
|
|
13
13
|
payload: z.ZodUndefined;
|
|
14
14
|
response: z.ZodObject<{
|
|
15
|
-
id: z.
|
|
16
|
-
created_at: z.ZodCoercedDate<unknown
|
|
17
|
-
updated_at: z.ZodCoercedDate<unknown
|
|
15
|
+
id: z.ZodUUID;
|
|
16
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
17
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
18
18
|
name: z.ZodString;
|
|
19
19
|
sections: z.ZodArray<z.ZodObject<{
|
|
20
20
|
primary: z.ZodObject<{
|
|
21
|
-
id: z.
|
|
21
|
+
id: z.ZodUUID;
|
|
22
22
|
text: z.ZodString;
|
|
23
23
|
}, z.core.$strip>;
|
|
24
24
|
secondary: z.ZodArray<z.ZodObject<{
|
|
25
|
-
id: z.
|
|
25
|
+
id: z.ZodUUID;
|
|
26
26
|
text: z.ZodString;
|
|
27
27
|
}, z.core.$strip>>;
|
|
28
28
|
options: z.ZodArray<z.ZodObject<{
|
|
@@ -35,7 +35,7 @@ export declare const SurveySchema: {
|
|
|
35
35
|
export declare const SurveyResponseSchema: {
|
|
36
36
|
payload: z.ZodObject<{
|
|
37
37
|
answers: z.ZodArray<z.ZodObject<{
|
|
38
|
-
question_id: z.
|
|
38
|
+
question_id: z.ZodUUID;
|
|
39
39
|
answer_value: z.ZodCoercedNumber<unknown>;
|
|
40
40
|
}, z.core.$strip>>;
|
|
41
41
|
}, z.core.$strip>;
|
|
@@ -45,7 +45,7 @@ export declare const SurveyResponseSchema: {
|
|
|
45
45
|
};
|
|
46
46
|
export declare const AssemblyOverviewSchema: {
|
|
47
47
|
payload: z.ZodObject<{
|
|
48
|
-
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown
|
|
48
|
+
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
49
49
|
name: z.ZodString;
|
|
50
50
|
about: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
51
51
|
topics: z.ZodArray<z.ZodString>;
|
|
@@ -53,40 +53,42 @@ export declare const AssemblyOverviewSchema: {
|
|
|
53
53
|
hide: z.ZodDefault<z.ZodBoolean>;
|
|
54
54
|
}, z.core.$strip>;
|
|
55
55
|
response: z.ZodObject<{
|
|
56
|
-
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown
|
|
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>>;
|
|
57
57
|
name: z.ZodString;
|
|
58
58
|
about: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
59
59
|
topics: z.ZodArray<z.ZodString>;
|
|
60
60
|
country: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
61
61
|
hide: z.ZodDefault<z.ZodBoolean>;
|
|
62
|
-
id: z.
|
|
63
|
-
created_at: z.ZodCoercedDate<unknown
|
|
64
|
-
updated_at: z.ZodCoercedDate<unknown
|
|
65
|
-
has_image: z.ZodBoolean;
|
|
62
|
+
id: z.ZodUUID;
|
|
63
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
64
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
66
65
|
image_src: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
66
|
+
has_image: z.ZodBoolean;
|
|
67
|
+
user_id: z.ZodUUID;
|
|
67
68
|
}, z.core.$strip>;
|
|
68
69
|
};
|
|
69
70
|
export declare const AssembliesListSchema: {
|
|
70
71
|
payload: z.ZodUndefined;
|
|
71
72
|
response: z.ZodObject<{
|
|
72
73
|
assemblies: z.ZodArray<z.ZodObject<{
|
|
73
|
-
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown
|
|
74
|
+
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
74
75
|
name: z.ZodString;
|
|
75
76
|
about: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
76
77
|
topics: z.ZodArray<z.ZodString>;
|
|
77
78
|
country: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
78
79
|
hide: z.ZodDefault<z.ZodBoolean>;
|
|
79
|
-
id: z.
|
|
80
|
-
created_at: z.ZodCoercedDate<unknown
|
|
81
|
-
updated_at: z.ZodCoercedDate<unknown
|
|
82
|
-
has_image: z.ZodBoolean;
|
|
80
|
+
id: z.ZodUUID;
|
|
81
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
82
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
83
83
|
image_src: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
84
|
+
has_image: z.ZodBoolean;
|
|
85
|
+
user_id: z.ZodUUID;
|
|
84
86
|
}, z.core.$strip>>;
|
|
85
87
|
}, z.core.$strip>;
|
|
86
88
|
};
|
|
87
89
|
export declare const AssemblyDetailSchema: {
|
|
88
90
|
payload: z.ZodObject<{
|
|
89
|
-
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown
|
|
91
|
+
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
90
92
|
name: z.ZodString;
|
|
91
93
|
about: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
92
94
|
topics: z.ZodArray<z.ZodString>;
|
|
@@ -97,7 +99,7 @@ export declare const AssemblyDetailSchema: {
|
|
|
97
99
|
name: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
98
100
|
description: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
99
101
|
type: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
100
|
-
id: z.ZodOptional<z.
|
|
102
|
+
id: z.ZodOptional<z.ZodUUID>;
|
|
101
103
|
}, z.core.$strip>>>, z.ZodTransform<{
|
|
102
104
|
visible_on_profile: boolean;
|
|
103
105
|
name: string | null;
|
|
@@ -114,15 +116,15 @@ export declare const AssemblyDetailSchema: {
|
|
|
114
116
|
event_details: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
115
117
|
visible_on_profile: z.ZodBoolean;
|
|
116
118
|
registration_link: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
117
|
-
start_date: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown
|
|
119
|
+
start_date: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
118
120
|
}, z.core.$strip>>>, z.ZodTransform<{
|
|
119
121
|
visible_on_profile: boolean;
|
|
120
122
|
registration_link: string | null;
|
|
121
|
-
start_date:
|
|
123
|
+
start_date: string | null;
|
|
122
124
|
} | null, {
|
|
123
125
|
visible_on_profile: boolean;
|
|
124
126
|
registration_link: string | null;
|
|
125
|
-
start_date:
|
|
127
|
+
start_date: string | null;
|
|
126
128
|
} | null | undefined>>;
|
|
127
129
|
story: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
128
130
|
visible_on_profile: z.ZodBoolean;
|
|
@@ -202,11 +204,11 @@ export declare const AssemblyDetailSchema: {
|
|
|
202
204
|
against: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodCoercedNumber<unknown>>>, z.ZodTransform<number | null, number | null | undefined>>;
|
|
203
205
|
abstained: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodCoercedNumber<unknown>>>, z.ZodTransform<number | null, number | null | undefined>>;
|
|
204
206
|
include_in_action_plan: z.ZodDefault<z.ZodBoolean>;
|
|
205
|
-
id: z.ZodOptional<z.
|
|
207
|
+
id: z.ZodOptional<z.ZodUUID>;
|
|
206
208
|
tasks: z.ZodArray<z.ZodObject<{
|
|
207
209
|
text: z.ZodString;
|
|
208
210
|
complete: z.ZodDefault<z.ZodBoolean>;
|
|
209
|
-
id: z.ZodOptional<z.
|
|
211
|
+
id: z.ZodOptional<z.ZodUUID>;
|
|
210
212
|
}, z.core.$strip>>;
|
|
211
213
|
updates: z.ZodArray<z.ZodUnknown>;
|
|
212
214
|
}, z.core.$strip>>;
|
|
@@ -257,166 +259,166 @@ export declare const AssemblyDetailSchema: {
|
|
|
257
259
|
} | null | undefined>>;
|
|
258
260
|
}, z.core.$strip>;
|
|
259
261
|
response: z.ZodObject<{
|
|
260
|
-
|
|
262
|
+
id: z.ZodUUID;
|
|
263
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
264
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
261
265
|
name: z.ZodString;
|
|
266
|
+
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
262
267
|
about: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
263
268
|
topics: z.ZodArray<z.ZodString>;
|
|
264
269
|
country: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
265
270
|
hide: z.ZodDefault<z.ZodBoolean>;
|
|
266
|
-
id: z.ZodString;
|
|
267
|
-
created_at: z.ZodCoercedDate<unknown>;
|
|
268
|
-
updated_at: z.ZodCoercedDate<unknown>;
|
|
269
|
-
has_image: z.ZodBoolean;
|
|
270
271
|
image_src: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
272
|
+
has_image: z.ZodBoolean;
|
|
271
273
|
is_own: z.ZodBoolean;
|
|
272
274
|
organisation: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
273
275
|
visible_on_profile: z.ZodBoolean;
|
|
274
276
|
name: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
275
277
|
description: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
276
278
|
type: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
277
|
-
id: z.
|
|
278
|
-
created_at: z.ZodCoercedDate<unknown
|
|
279
|
-
updated_at: z.ZodCoercedDate<unknown
|
|
279
|
+
id: z.ZodUUID;
|
|
280
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
281
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
280
282
|
}, z.core.$strip>>>, z.ZodTransform<{
|
|
281
283
|
visible_on_profile: boolean;
|
|
282
284
|
name: string | null;
|
|
283
285
|
description: string | null;
|
|
284
286
|
type: string | null;
|
|
285
287
|
id: string;
|
|
286
|
-
created_at:
|
|
287
|
-
updated_at:
|
|
288
|
+
created_at: string;
|
|
289
|
+
updated_at: string;
|
|
288
290
|
} | null, {
|
|
289
291
|
visible_on_profile: boolean;
|
|
290
292
|
name: string | null;
|
|
291
293
|
description: string | null;
|
|
292
294
|
type: string | null;
|
|
293
295
|
id: string;
|
|
294
|
-
created_at:
|
|
295
|
-
updated_at:
|
|
296
|
+
created_at: string;
|
|
297
|
+
updated_at: string;
|
|
296
298
|
} | null | undefined>>;
|
|
297
299
|
event_details: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
298
300
|
visible_on_profile: z.ZodBoolean;
|
|
299
301
|
registration_link: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
300
|
-
start_date: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown
|
|
301
|
-
created_at: z.ZodCoercedDate<unknown
|
|
302
|
-
updated_at: z.ZodCoercedDate<unknown
|
|
302
|
+
start_date: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
303
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
304
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
303
305
|
}, z.core.$strip>>>, z.ZodTransform<{
|
|
304
306
|
visible_on_profile: boolean;
|
|
305
307
|
registration_link: string | null;
|
|
306
|
-
start_date:
|
|
307
|
-
created_at:
|
|
308
|
-
updated_at:
|
|
308
|
+
start_date: string | null;
|
|
309
|
+
created_at: string;
|
|
310
|
+
updated_at: string;
|
|
309
311
|
} | null, {
|
|
310
312
|
visible_on_profile: boolean;
|
|
311
313
|
registration_link: string | null;
|
|
312
|
-
start_date:
|
|
313
|
-
created_at:
|
|
314
|
-
updated_at:
|
|
314
|
+
start_date: string | null;
|
|
315
|
+
created_at: string;
|
|
316
|
+
updated_at: string;
|
|
315
317
|
} | null | undefined>>;
|
|
316
318
|
story: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
317
319
|
visible_on_profile: z.ZodBoolean;
|
|
318
320
|
background: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
319
|
-
created_at: z.ZodCoercedDate<unknown
|
|
320
|
-
updated_at: z.ZodCoercedDate<unknown
|
|
321
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
322
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
321
323
|
}, z.core.$strip>>>, z.ZodTransform<{
|
|
322
324
|
visible_on_profile: boolean;
|
|
323
325
|
background: string | null;
|
|
324
|
-
created_at:
|
|
325
|
-
updated_at:
|
|
326
|
+
created_at: string;
|
|
327
|
+
updated_at: string;
|
|
326
328
|
} | null, {
|
|
327
329
|
visible_on_profile: boolean;
|
|
328
330
|
background: string | null;
|
|
329
|
-
created_at:
|
|
330
|
-
updated_at:
|
|
331
|
+
created_at: string;
|
|
332
|
+
updated_at: string;
|
|
331
333
|
} | null | undefined>>;
|
|
332
334
|
supporters: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
333
335
|
visible_on_profile: z.ZodBoolean;
|
|
334
336
|
organisation_types: z.ZodArray<z.ZodString>;
|
|
335
337
|
description: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
336
|
-
created_at: z.ZodCoercedDate<unknown
|
|
337
|
-
updated_at: z.ZodCoercedDate<unknown
|
|
338
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
339
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
338
340
|
}, z.core.$strip>>>, z.ZodTransform<{
|
|
339
341
|
visible_on_profile: boolean;
|
|
340
342
|
organisation_types: string[];
|
|
341
343
|
description: string | null;
|
|
342
|
-
created_at:
|
|
343
|
-
updated_at:
|
|
344
|
+
created_at: string;
|
|
345
|
+
updated_at: string;
|
|
344
346
|
} | null, {
|
|
345
347
|
visible_on_profile: boolean;
|
|
346
348
|
organisation_types: string[];
|
|
347
349
|
description: string | null;
|
|
348
|
-
created_at:
|
|
349
|
-
updated_at:
|
|
350
|
+
created_at: string;
|
|
351
|
+
updated_at: string;
|
|
350
352
|
} | null | undefined>>;
|
|
351
353
|
funders: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
352
354
|
visible_on_profile: z.ZodBoolean;
|
|
353
355
|
organisation_types: z.ZodArray<z.ZodString>;
|
|
354
356
|
description: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
355
|
-
created_at: z.ZodCoercedDate<unknown
|
|
356
|
-
updated_at: z.ZodCoercedDate<unknown
|
|
357
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
358
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
357
359
|
}, z.core.$strip>>>, z.ZodTransform<{
|
|
358
360
|
visible_on_profile: boolean;
|
|
359
361
|
organisation_types: string[];
|
|
360
362
|
description: string | null;
|
|
361
|
-
created_at:
|
|
362
|
-
updated_at:
|
|
363
|
+
created_at: string;
|
|
364
|
+
updated_at: string;
|
|
363
365
|
} | null, {
|
|
364
366
|
visible_on_profile: boolean;
|
|
365
367
|
organisation_types: string[];
|
|
366
368
|
description: string | null;
|
|
367
|
-
created_at:
|
|
368
|
-
updated_at:
|
|
369
|
+
created_at: string;
|
|
370
|
+
updated_at: string;
|
|
369
371
|
} | null | undefined>>;
|
|
370
372
|
facilitation: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
371
373
|
visible_on_profile: z.ZodBoolean;
|
|
372
374
|
decision_method: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
373
|
-
created_at: z.ZodCoercedDate<unknown
|
|
374
|
-
updated_at: z.ZodCoercedDate<unknown
|
|
375
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
376
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
375
377
|
}, z.core.$strip>>>, z.ZodTransform<{
|
|
376
378
|
visible_on_profile: boolean;
|
|
377
379
|
decision_method: string | null;
|
|
378
|
-
created_at:
|
|
379
|
-
updated_at:
|
|
380
|
+
created_at: string;
|
|
381
|
+
updated_at: string;
|
|
380
382
|
} | null, {
|
|
381
383
|
visible_on_profile: boolean;
|
|
382
384
|
decision_method: string | null;
|
|
383
|
-
created_at:
|
|
384
|
-
updated_at:
|
|
385
|
+
created_at: string;
|
|
386
|
+
updated_at: string;
|
|
385
387
|
} | null | undefined>>;
|
|
386
388
|
participants: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
387
389
|
visible_on_profile: z.ZodBoolean;
|
|
388
390
|
recruitment_method: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
389
391
|
community: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
390
|
-
created_at: z.ZodCoercedDate<unknown
|
|
391
|
-
updated_at: z.ZodCoercedDate<unknown
|
|
392
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
393
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
392
394
|
}, z.core.$strip>>>, z.ZodTransform<{
|
|
393
395
|
visible_on_profile: boolean;
|
|
394
396
|
recruitment_method: string | null;
|
|
395
397
|
community: string | null;
|
|
396
|
-
created_at:
|
|
397
|
-
updated_at:
|
|
398
|
+
created_at: string;
|
|
399
|
+
updated_at: string;
|
|
398
400
|
} | null, {
|
|
399
401
|
visible_on_profile: boolean;
|
|
400
402
|
recruitment_method: string | null;
|
|
401
403
|
community: string | null;
|
|
402
|
-
created_at:
|
|
403
|
-
updated_at:
|
|
404
|
+
created_at: string;
|
|
405
|
+
updated_at: string;
|
|
404
406
|
} | null | undefined>>;
|
|
405
407
|
support: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
406
408
|
visible_on_profile: z.ZodBoolean;
|
|
407
409
|
support_options: z.ZodArray<z.ZodString>;
|
|
408
|
-
created_at: z.ZodCoercedDate<unknown
|
|
409
|
-
updated_at: z.ZodCoercedDate<unknown
|
|
410
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
411
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
410
412
|
}, z.core.$strip>>>, z.ZodTransform<{
|
|
411
413
|
visible_on_profile: boolean;
|
|
412
414
|
support_options: string[];
|
|
413
|
-
created_at:
|
|
414
|
-
updated_at:
|
|
415
|
+
created_at: string;
|
|
416
|
+
updated_at: string;
|
|
415
417
|
} | null, {
|
|
416
418
|
visible_on_profile: boolean;
|
|
417
419
|
support_options: string[];
|
|
418
|
-
created_at:
|
|
419
|
-
updated_at:
|
|
420
|
+
created_at: string;
|
|
421
|
+
updated_at: string;
|
|
420
422
|
} | null | undefined>>;
|
|
421
423
|
action_plan: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodIntersection<z.ZodObject<{
|
|
422
424
|
visible_on_profile: z.ZodBoolean;
|
|
@@ -427,22 +429,22 @@ export declare const AssemblyDetailSchema: {
|
|
|
427
429
|
against: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodCoercedNumber<unknown>>>, z.ZodTransform<number | null, number | null | undefined>>;
|
|
428
430
|
abstained: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodCoercedNumber<unknown>>>, z.ZodTransform<number | null, number | null | undefined>>;
|
|
429
431
|
include_in_action_plan: z.ZodDefault<z.ZodBoolean>;
|
|
430
|
-
id: z.
|
|
432
|
+
id: z.ZodUUID;
|
|
431
433
|
tasks: z.ZodArray<z.ZodObject<{
|
|
432
434
|
text: z.ZodString;
|
|
433
435
|
complete: z.ZodDefault<z.ZodBoolean>;
|
|
434
|
-
id: z.
|
|
435
|
-
created_at: z.ZodCoercedDate<unknown
|
|
436
|
-
updated_at: z.ZodCoercedDate<unknown
|
|
436
|
+
id: z.ZodUUID;
|
|
437
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
438
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
437
439
|
}, z.core.$strip>>;
|
|
438
440
|
updates: z.ZodArray<z.ZodUnknown>;
|
|
439
|
-
created_at: z.ZodCoercedDate<unknown
|
|
440
|
-
updated_at: z.ZodCoercedDate<unknown
|
|
441
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
442
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
441
443
|
}, z.core.$strip>>;
|
|
442
444
|
updates: z.ZodArray<z.ZodUnknown>;
|
|
443
445
|
}, z.core.$strip>, z.ZodObject<{
|
|
444
|
-
created_at: z.ZodCoercedDate<unknown
|
|
445
|
-
updated_at: z.ZodCoercedDate<unknown
|
|
446
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
447
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
446
448
|
}, z.core.$strip>>>>, z.ZodTransform<NonNullable<{
|
|
447
449
|
visible_on_profile: boolean;
|
|
448
450
|
description: string | null;
|
|
@@ -457,17 +459,17 @@ export declare const AssemblyDetailSchema: {
|
|
|
457
459
|
text: string;
|
|
458
460
|
complete: boolean;
|
|
459
461
|
id: string;
|
|
460
|
-
created_at:
|
|
461
|
-
updated_at:
|
|
462
|
+
created_at: string;
|
|
463
|
+
updated_at: string;
|
|
462
464
|
}[];
|
|
463
465
|
updates: unknown[];
|
|
464
|
-
created_at:
|
|
465
|
-
updated_at:
|
|
466
|
+
created_at: string;
|
|
467
|
+
updated_at: string;
|
|
466
468
|
}[];
|
|
467
469
|
updates: unknown[];
|
|
468
470
|
} & {
|
|
469
|
-
created_at:
|
|
470
|
-
updated_at:
|
|
471
|
+
created_at: string;
|
|
472
|
+
updated_at: string;
|
|
471
473
|
}> | null, ({
|
|
472
474
|
visible_on_profile: boolean;
|
|
473
475
|
description: string | null;
|
|
@@ -482,22 +484,22 @@ export declare const AssemblyDetailSchema: {
|
|
|
482
484
|
text: string;
|
|
483
485
|
complete: boolean;
|
|
484
486
|
id: string;
|
|
485
|
-
created_at:
|
|
486
|
-
updated_at:
|
|
487
|
+
created_at: string;
|
|
488
|
+
updated_at: string;
|
|
487
489
|
}[];
|
|
488
490
|
updates: unknown[];
|
|
489
|
-
created_at:
|
|
490
|
-
updated_at:
|
|
491
|
+
created_at: string;
|
|
492
|
+
updated_at: string;
|
|
491
493
|
}[];
|
|
492
494
|
updates: unknown[];
|
|
493
495
|
} & {
|
|
494
|
-
created_at:
|
|
495
|
-
updated_at:
|
|
496
|
+
created_at: string;
|
|
497
|
+
updated_at: string;
|
|
496
498
|
}) | null | undefined>>;
|
|
497
499
|
surveys: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
498
500
|
visible_on_profile: z.ZodBoolean;
|
|
499
|
-
created_at: z.ZodCoercedDate<unknown
|
|
500
|
-
updated_at: z.ZodCoercedDate<unknown
|
|
501
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
502
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
501
503
|
data: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
502
504
|
total: z.ZodNumber;
|
|
503
505
|
responses: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
|
|
@@ -507,8 +509,8 @@ export declare const AssemblyDetailSchema: {
|
|
|
507
509
|
}, z.core.$strip>>;
|
|
508
510
|
}, z.core.$strip>>>, z.ZodTransform<{
|
|
509
511
|
visible_on_profile: boolean;
|
|
510
|
-
created_at:
|
|
511
|
-
updated_at:
|
|
512
|
+
created_at: string;
|
|
513
|
+
updated_at: string;
|
|
512
514
|
data: Record<string, {
|
|
513
515
|
total: number;
|
|
514
516
|
responses: Record<string, {
|
|
@@ -518,8 +520,8 @@ export declare const AssemblyDetailSchema: {
|
|
|
518
520
|
}>;
|
|
519
521
|
} | null, {
|
|
520
522
|
visible_on_profile: boolean;
|
|
521
|
-
created_at:
|
|
522
|
-
updated_at:
|
|
523
|
+
created_at: string;
|
|
524
|
+
updated_at: string;
|
|
523
525
|
data: Record<string, {
|
|
524
526
|
total: number;
|
|
525
527
|
responses: Record<string, {
|
|
@@ -570,41 +572,42 @@ export declare const PinSchema: {
|
|
|
570
572
|
text: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
571
573
|
}, z.core.$strip>;
|
|
572
574
|
response: z.ZodObject<{
|
|
573
|
-
id: z.
|
|
574
|
-
created_at: z.ZodCoercedDate<unknown
|
|
575
|
-
updated_at: z.ZodCoercedDate<unknown
|
|
575
|
+
id: z.ZodUUID;
|
|
576
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
577
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
576
578
|
country: z.ZodString;
|
|
577
579
|
text: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
578
580
|
hide: z.ZodBoolean;
|
|
579
|
-
has_image: z.ZodBoolean;
|
|
580
581
|
image_src: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
582
|
+
has_image: z.ZodBoolean;
|
|
581
583
|
}, z.core.$strip>;
|
|
582
584
|
};
|
|
583
585
|
export declare const PinListSchema: {
|
|
584
586
|
payload: z.ZodUndefined;
|
|
585
587
|
response: z.ZodObject<{
|
|
586
588
|
assemblies: z.ZodArray<z.ZodObject<{
|
|
587
|
-
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown
|
|
589
|
+
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
590
|
name: z.ZodString;
|
|
589
591
|
about: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
590
592
|
topics: z.ZodArray<z.ZodString>;
|
|
591
593
|
country: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
592
594
|
hide: z.ZodDefault<z.ZodBoolean>;
|
|
593
|
-
id: z.
|
|
594
|
-
created_at: z.ZodCoercedDate<unknown
|
|
595
|
-
updated_at: z.ZodCoercedDate<unknown
|
|
596
|
-
has_image: z.ZodBoolean;
|
|
595
|
+
id: z.ZodUUID;
|
|
596
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
597
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
597
598
|
image_src: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
599
|
+
has_image: z.ZodBoolean;
|
|
600
|
+
user_id: z.ZodUUID;
|
|
598
601
|
}, z.core.$strip>>;
|
|
599
602
|
pins: z.ZodArray<z.ZodObject<{
|
|
600
|
-
id: z.
|
|
601
|
-
created_at: z.ZodCoercedDate<unknown
|
|
602
|
-
updated_at: z.ZodCoercedDate<unknown
|
|
603
|
+
id: z.ZodUUID;
|
|
604
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
605
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
603
606
|
country: z.ZodString;
|
|
604
607
|
text: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
605
608
|
hide: z.ZodBoolean;
|
|
606
|
-
has_image: z.ZodBoolean;
|
|
607
609
|
image_src: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
610
|
+
has_image: z.ZodBoolean;
|
|
608
611
|
}, z.core.$strip>>;
|
|
609
612
|
}, z.core.$strip>;
|
|
610
613
|
};
|
package/package.json
CHANGED
package/src/schemas.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import z, {type ZodType} from
|
|
1
|
+
import z, { type ZodType } from 'zod';
|
|
2
2
|
|
|
3
3
|
const maybe = <T extends ZodType<unknown>>(_: T) =>
|
|
4
4
|
_.nullish().transform((_) => _ ?? null);
|
|
@@ -11,9 +11,9 @@ const OptionSchema = z.object({
|
|
|
11
11
|
export const UserSchema = {
|
|
12
12
|
payload: z.undefined(),
|
|
13
13
|
response: z.object({
|
|
14
|
-
id: z.
|
|
15
|
-
created_at: z.coerce.date(),
|
|
16
|
-
updated_at: z.coerce.date(),
|
|
14
|
+
id: z.uuid(),
|
|
15
|
+
created_at: z.coerce.date().transform((_) => _.toISOString()),
|
|
16
|
+
updated_at: z.coerce.date().transform((_) => _.toISOString()),
|
|
17
17
|
sub: z.string(),
|
|
18
18
|
is_mutirao: z.boolean()
|
|
19
19
|
})
|
|
@@ -21,18 +21,19 @@ export const UserSchema = {
|
|
|
21
21
|
|
|
22
22
|
// Surveys
|
|
23
23
|
const SurveyQuestionSchema = z.object({
|
|
24
|
-
id: z.
|
|
24
|
+
id: z.uuid(),
|
|
25
25
|
text: z.string()
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
export const SurveySchema = {
|
|
29
29
|
payload: z.undefined(),
|
|
30
30
|
response: z.object({
|
|
31
|
-
id: z.
|
|
32
|
-
created_at: z.coerce.date(),
|
|
33
|
-
updated_at: z.coerce.date(),
|
|
31
|
+
id: z.uuid(),
|
|
32
|
+
created_at: z.coerce.date().transform((_) => _.toISOString()),
|
|
33
|
+
updated_at: z.coerce.date().transform((_) => _.toISOString()),
|
|
34
34
|
name: z.string(),
|
|
35
|
-
sections: z
|
|
35
|
+
sections: z
|
|
36
|
+
.object({
|
|
36
37
|
primary: SurveyQuestionSchema,
|
|
37
38
|
secondary: SurveyQuestionSchema.array(),
|
|
38
39
|
options: OptionSchema.array()
|
|
@@ -43,8 +44,9 @@ export const SurveySchema = {
|
|
|
43
44
|
|
|
44
45
|
export const SurveyResponseSchema = {
|
|
45
46
|
payload: z.object({
|
|
46
|
-
answers: z
|
|
47
|
-
|
|
47
|
+
answers: z
|
|
48
|
+
.object({
|
|
49
|
+
question_id: z.uuid(),
|
|
48
50
|
answer_value: z.coerce.number().int()
|
|
49
51
|
})
|
|
50
52
|
.array()
|
|
@@ -66,19 +68,19 @@ const ActionSchema = z.object({
|
|
|
66
68
|
against: maybe(z.coerce.number().int()),
|
|
67
69
|
abstained: maybe(z.coerce.number().int()),
|
|
68
70
|
include_in_action_plan: z.boolean().default(true),
|
|
69
|
-
assembly_id: z.
|
|
71
|
+
assembly_id: z.uuid()
|
|
70
72
|
});
|
|
71
73
|
|
|
72
74
|
const TaskSchema = z.object({
|
|
73
75
|
text: z.string(),
|
|
74
76
|
complete: z.boolean().default(false),
|
|
75
|
-
action_id: z.
|
|
76
|
-
assembly_id: z.
|
|
77
|
+
action_id: z.uuid(),
|
|
78
|
+
assembly_id: z.uuid()
|
|
77
79
|
});
|
|
78
80
|
|
|
79
81
|
// Assembly Overviews
|
|
80
82
|
const BaseAssemblyOverviewSchema = z.object({
|
|
81
|
-
published_at: maybe(z.coerce.date()),
|
|
83
|
+
published_at: maybe(z.coerce.date().transform((_) => _.toISOString())),
|
|
82
84
|
name: z.string(),
|
|
83
85
|
about: maybe(z.string()),
|
|
84
86
|
topics: z.string().array(),
|
|
@@ -88,11 +90,12 @@ const BaseAssemblyOverviewSchema = z.object({
|
|
|
88
90
|
export const AssemblyOverviewSchema = {
|
|
89
91
|
payload: BaseAssemblyOverviewSchema,
|
|
90
92
|
response: BaseAssemblyOverviewSchema.extend({
|
|
91
|
-
id: z.
|
|
92
|
-
created_at: z.coerce.date(),
|
|
93
|
-
updated_at: z.coerce.date(),
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
id: z.uuid(),
|
|
94
|
+
created_at: z.coerce.date().transform((_) => _.toISOString()),
|
|
95
|
+
updated_at: z.coerce.date().transform((_) => _.toISOString()),
|
|
96
|
+
image_src: maybe(z.string()),
|
|
97
|
+
has_image: z.boolean().meta({ deprecated: true }),
|
|
98
|
+
user_id: z.uuid().meta({ deprecated: true })
|
|
96
99
|
})
|
|
97
100
|
};
|
|
98
101
|
export const AssembliesListSchema = {
|
|
@@ -112,7 +115,7 @@ const OrganisationSchema = z.object({
|
|
|
112
115
|
const EventDetailsSchema = z.object({
|
|
113
116
|
visible_on_profile: z.boolean(),
|
|
114
117
|
registration_link: maybe(z.string()),
|
|
115
|
-
start_date: maybe(z.coerce.date())
|
|
118
|
+
start_date: maybe(z.coerce.date().transform((_) => _.toISOString()))
|
|
116
119
|
});
|
|
117
120
|
const StorySchema = z.object({
|
|
118
121
|
visible_on_profile: z.boolean(),
|
|
@@ -148,7 +151,7 @@ export const AssemblyDetailSchema = {
|
|
|
148
151
|
payload: AssemblyOverviewSchema.payload.extend({
|
|
149
152
|
organisation: maybe(
|
|
150
153
|
OrganisationSchema.extend({
|
|
151
|
-
id: z.
|
|
154
|
+
id: z.uuid().optional()
|
|
152
155
|
})
|
|
153
156
|
),
|
|
154
157
|
event_details: maybe(EventDetailsSchema),
|
|
@@ -162,13 +165,13 @@ export const AssemblyDetailSchema = {
|
|
|
162
165
|
ActionPlanSchema.extend({
|
|
163
166
|
actions: ActionSchema.omit({ assembly_id: true })
|
|
164
167
|
.extend({
|
|
165
|
-
id: z.
|
|
168
|
+
id: z.uuid().optional(),
|
|
166
169
|
tasks: TaskSchema.omit({
|
|
167
170
|
action_id: true,
|
|
168
171
|
assembly_id: true
|
|
169
172
|
})
|
|
170
173
|
.extend({
|
|
171
|
-
id: z.
|
|
174
|
+
id: z.uuid().optional()
|
|
172
175
|
})
|
|
173
176
|
.array(),
|
|
174
177
|
updates: z.unknown().array()
|
|
@@ -179,93 +182,93 @@ export const AssemblyDetailSchema = {
|
|
|
179
182
|
),
|
|
180
183
|
surveys: maybe(SurveyDetailsSchema)
|
|
181
184
|
}),
|
|
182
|
-
response: AssemblyOverviewSchema.response.extend({
|
|
185
|
+
response: AssemblyOverviewSchema.response.omit({ user_id: true }).extend({
|
|
183
186
|
is_own: z.boolean(),
|
|
184
187
|
organisation: maybe(
|
|
185
188
|
OrganisationSchema.extend({
|
|
186
|
-
id: z.
|
|
187
|
-
created_at: z.coerce.date(),
|
|
188
|
-
updated_at: z.coerce.date()
|
|
189
|
+
id: z.uuid(),
|
|
190
|
+
created_at: z.coerce.date().transform((_) => _.toISOString()),
|
|
191
|
+
updated_at: z.coerce.date().transform((_) => _.toISOString())
|
|
189
192
|
})
|
|
190
193
|
),
|
|
191
194
|
event_details: maybe(
|
|
192
195
|
EventDetailsSchema.extend({
|
|
193
|
-
created_at: z.coerce.date(),
|
|
194
|
-
updated_at: z.coerce.date()
|
|
196
|
+
created_at: z.coerce.date().transform((_) => _.toISOString()),
|
|
197
|
+
updated_at: z.coerce.date().transform((_) => _.toISOString())
|
|
195
198
|
})
|
|
196
199
|
),
|
|
197
200
|
story: maybe(
|
|
198
201
|
StorySchema.extend({
|
|
199
|
-
created_at: z.coerce.date(),
|
|
200
|
-
updated_at: z.coerce.date()
|
|
202
|
+
created_at: z.coerce.date().transform((_) => _.toISOString()),
|
|
203
|
+
updated_at: z.coerce.date().transform((_) => _.toISOString())
|
|
201
204
|
})
|
|
202
205
|
),
|
|
203
206
|
supporters: maybe(
|
|
204
207
|
SupportersSchema.extend({
|
|
205
|
-
created_at: z.coerce.date(),
|
|
206
|
-
updated_at: z.coerce.date()
|
|
208
|
+
created_at: z.coerce.date().transform((_) => _.toISOString()),
|
|
209
|
+
updated_at: z.coerce.date().transform((_) => _.toISOString())
|
|
207
210
|
})
|
|
208
211
|
),
|
|
209
212
|
funders: maybe(
|
|
210
213
|
FundersSchema.extend({
|
|
211
|
-
created_at: z.coerce.date(),
|
|
212
|
-
updated_at: z.coerce.date()
|
|
214
|
+
created_at: z.coerce.date().transform((_) => _.toISOString()),
|
|
215
|
+
updated_at: z.coerce.date().transform((_) => _.toISOString())
|
|
213
216
|
})
|
|
214
217
|
),
|
|
215
218
|
facilitation: maybe(
|
|
216
219
|
FacilitationSchema.extend({
|
|
217
|
-
created_at: z.coerce.date(),
|
|
218
|
-
updated_at: z.coerce.date()
|
|
220
|
+
created_at: z.coerce.date().transform((_) => _.toISOString()),
|
|
221
|
+
updated_at: z.coerce.date().transform((_) => _.toISOString())
|
|
219
222
|
})
|
|
220
223
|
),
|
|
221
224
|
participants: maybe(
|
|
222
225
|
ParticipantsSchema.extend({
|
|
223
|
-
created_at: z.coerce.date(),
|
|
224
|
-
updated_at: z.coerce.date()
|
|
226
|
+
created_at: z.coerce.date().transform((_) => _.toISOString()),
|
|
227
|
+
updated_at: z.coerce.date().transform((_) => _.toISOString())
|
|
225
228
|
})
|
|
226
229
|
),
|
|
227
230
|
support: maybe(
|
|
228
231
|
SupportSchema.extend({
|
|
229
|
-
created_at: z.coerce.date(),
|
|
230
|
-
updated_at: z.coerce.date()
|
|
232
|
+
created_at: z.coerce.date().transform((_) => _.toISOString()),
|
|
233
|
+
updated_at: z.coerce.date().transform((_) => _.toISOString())
|
|
231
234
|
})
|
|
232
235
|
),
|
|
233
236
|
action_plan: maybe(
|
|
234
237
|
ActionPlanSchema.extend({
|
|
235
238
|
actions: ActionSchema.omit({ assembly_id: true })
|
|
236
239
|
.extend({
|
|
237
|
-
id: z.
|
|
238
|
-
created_at: z.coerce.date(),
|
|
239
|
-
updated_at: z.coerce.date(),
|
|
240
|
+
id: z.uuid(),
|
|
241
|
+
created_at: z.coerce.date().transform((_) => _.toISOString()),
|
|
242
|
+
updated_at: z.coerce.date().transform((_) => _.toISOString()),
|
|
240
243
|
tasks: TaskSchema.omit({
|
|
241
244
|
action_id: true,
|
|
242
245
|
assembly_id: true
|
|
243
246
|
})
|
|
244
247
|
.extend({
|
|
245
|
-
id: z.
|
|
246
|
-
created_at: z.coerce.date(),
|
|
247
|
-
updated_at: z.coerce.date()
|
|
248
|
+
id: z.uuid(),
|
|
249
|
+
created_at: z.coerce.date().transform((_) => _.toISOString()),
|
|
250
|
+
updated_at: z.coerce.date().transform((_) => _.toISOString())
|
|
248
251
|
})
|
|
249
252
|
.array(),
|
|
250
253
|
updates: z.unknown().array()
|
|
251
254
|
})
|
|
252
255
|
.extend({
|
|
253
|
-
created_at: z.coerce.date(),
|
|
254
|
-
updated_at: z.coerce.date()
|
|
256
|
+
created_at: z.coerce.date().transform((_) => _.toISOString()),
|
|
257
|
+
updated_at: z.coerce.date().transform((_) => _.toISOString())
|
|
255
258
|
})
|
|
256
259
|
.array(),
|
|
257
260
|
updates: z.unknown().array()
|
|
258
261
|
}).and(
|
|
259
262
|
z.object({
|
|
260
|
-
created_at: z.coerce.date(),
|
|
261
|
-
updated_at: z.coerce.date()
|
|
263
|
+
created_at: z.coerce.date().transform((_) => _.toISOString()),
|
|
264
|
+
updated_at: z.coerce.date().transform((_) => _.toISOString())
|
|
262
265
|
})
|
|
263
266
|
)
|
|
264
267
|
),
|
|
265
268
|
surveys: maybe(
|
|
266
269
|
SurveyDetailsSchema.extend({
|
|
267
|
-
created_at: z.coerce.date(),
|
|
268
|
-
updated_at: z.coerce.date()
|
|
270
|
+
created_at: z.coerce.date().transform((_) => _.toISOString()),
|
|
271
|
+
updated_at: z.coerce.date().transform((_) => _.toISOString())
|
|
269
272
|
}).extend({
|
|
270
273
|
data: z.record(
|
|
271
274
|
z.string(),
|
|
@@ -307,7 +310,8 @@ export const RegisterSchema = {
|
|
|
307
310
|
object: z.literal('event'),
|
|
308
311
|
data: z.object({
|
|
309
312
|
id: z.string(),
|
|
310
|
-
email_addresses: z
|
|
313
|
+
email_addresses: z
|
|
314
|
+
.object({
|
|
311
315
|
email_address: z.string()
|
|
312
316
|
})
|
|
313
317
|
.array()
|
|
@@ -323,14 +327,14 @@ export const PinSchema = {
|
|
|
323
327
|
text: maybe(z.string())
|
|
324
328
|
}),
|
|
325
329
|
response: z.object({
|
|
326
|
-
id: z.
|
|
327
|
-
created_at: z.coerce.date(),
|
|
328
|
-
updated_at: z.coerce.date(),
|
|
330
|
+
id: z.uuid(),
|
|
331
|
+
created_at: z.coerce.date().transform((_) => _.toISOString()),
|
|
332
|
+
updated_at: z.coerce.date().transform((_) => _.toISOString()),
|
|
329
333
|
country: z.string(),
|
|
330
334
|
text: maybe(z.string()),
|
|
331
335
|
hide: z.boolean(),
|
|
332
|
-
|
|
333
|
-
|
|
336
|
+
image_src: maybe(z.string()),
|
|
337
|
+
has_image: z.boolean().meta({ deprecated: true })
|
|
334
338
|
})
|
|
335
339
|
};
|
|
336
340
|
export const PinListSchema = {
|