@assemblis/contracts 0.1.15 → 0.1.17

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 CHANGED
@@ -1 +1 @@
1
- import e from"zod";var t,a,r,n,o;!function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.PATCH="PATCH"}(t||(t={})),function(e){e.ID=":ID",e.NAME=":NAME"}(a||(a={})),function(e){e.ACCOUNT_REPORTS="/account/reports",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"}(r||(r={})),function(e){e.DISCARDED="DISCARDED",e.DRAFTED="DRAFT",e.PUBLISHED="PUBLISHED",e.CHANGED="CHANGED"}(n||(n={})),function(e){e.DELIBERATION="deliberation",e.DEMOGRAPHIC_DATA="demographic-data",e.PRE_ASSEMBLY="pre-assembly",e.POST_ASSEMBLY="post-assembly"}(o||(o={}));const i=e.coerce.date().transform(e=>e.toISOString()),s=e=>e.nullish().transform(e=>e??null),d=e.object({id:e.uuid(),created_at:i,updated_at:i,alt:e.string(),srcset:e.string(),width:e.int(),height:e.int()}),c=e.object({label:e.string(),value:e.coerce.number().int()}),p=e.object({published_at:s(i),title:s(e.string()),description:s(e.string()),location:s(e.string()),outputs:s(e.string().array()),initiation_type:s(e.string()),recruitment_method:s(e.string()),recruitment_description:s(e.string()),participant_count:s(e.int()),organiser_reflections:s(e.string()),organiser_report_url:s(e.string()),location_details:s(e.string()),date:s(e.string()),duration:s(e.int()),contact_information_url:s(e.string()),cover_image_id:s(e.string())}),u=e.object({id:e.uuid(),created_at:i,updated_at:i,published_at:s(i),state:e.enum(["DISCARDED","DRAFTED","PUBLISHED","CHANGED"]),viewer_password:e.string(),draft_content:s(p),published_content:s(p),media:e.object({images:d.array()})});e.object({id:e.uuid(),created_at:i,updated_at:i,sub:e.string(),is_mutirao:e.boolean()});const _={endpoint:()=>r.ACCOUNT_REPORTS,method:t.GET,payload:e.never(),response:e.object({reports:u.array()})},l={endpoint:e=>`${r.ACCOUNT_REPORTS}/${e}`,method:t.GET,payload:e.never(),response:s(u)},b={endpoint:()=>r.ACCOUNT_REPORTS,method:t.POST,payload:s(p.omit({cover_image_id:!0})),response:u},g={endpoint:e=>`${r.ACCOUNT_REPORTS}/${e}/content`,method:t.PUT,payload:p.omit({published_at:!0,cover_image_id:!0}),response:u},m={endpoint:e=>`${r.ACCOUNT_REPORTS}/${e}/discard`,method:t.PATCH,payload:e.nullish(e.object()),response:s(u)},y={endpoint:e=>`${r.ACCOUNT_REPORTS}/${e}/publish`,method:t.PATCH,payload:e.object({published_at:i}),response:u},S={endpoint:e=>`${r.ACCOUNT_REPORTS}/${e}/unpublish`,method:t.PATCH,payload:e.nullish(e.object()),response:u},E={endpoint:e=>`${r.ACCOUNT_REPORTS}/${e}/cover-image`,method:t.POST,payload:d.pick({alt:!0}),response:u},T={payload:e.object({route:e.string(),text:e.string(),metadata:e.unknown()}),response:e.string()},f={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()},j={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()},O=e.object({id:e.uuid(),text:e.string()}),A={payload:e.undefined(),response:e.object({id:e.uuid(),created_at:i,updated_at:i,name:e.string(),sections:e.object({primary:O,secondary:O.array(),options:c.array()}).array()})},R={payload:e.object({answers:e.object({question_id:e.uuid(),answer_value:e.coerce.number().int()}).array()}),response:e.object({total:e.number().int()})},C=e.object({visible_on_profile:e.boolean(),description:s(e.string())}),h=e.object({text:e.string(),agreed:s(e.coerce.number().int()),against:s(e.coerce.number().int()),abstained:s(e.coerce.number().int()),include_in_action_plan:e.boolean().default(!0),assembly_id:e.uuid()}),I=e.object({text:e.string(),complete:e.boolean().default(!1),action_id:e.uuid(),assembly_id:e.uuid()}),P=e.object({published_at:s(i),name:e.string(),about:s(e.string()),topics:e.string().array(),country:s(e.string()),hide:e.boolean().default(!1)}),x={payload:P,response:P.extend({id:e.uuid(),created_at:i,updated_at:i,image_src:s(e.string()),has_image:e.boolean().meta({deprecated:!0}),user_id:e.uuid().meta({deprecated:!0})})},v={payload:e.undefined(),response:e.object({assemblies:x.response.array()})},D=e.object({visible_on_profile:e.boolean(),name:s(e.string()),description:s(e.string()),type:s(e.string())}),N=e.object({visible_on_profile:e.boolean(),registration_link:s(e.string()),start_date:s(i)}),U=e.object({visible_on_profile:e.boolean(),background:s(e.string())}),H=e.object({visible_on_profile:e.boolean(),organisation_types:e.string().array(),description:s(e.string())}),$=e.object({visible_on_profile:e.boolean(),organisation_types:e.string().array(),description:s(e.string())}),k=e.object({visible_on_profile:e.boolean(),decision_method:s(e.string())}),w=e.object({visible_on_profile:e.boolean(),recruitment_method:s(e.string()),community:s(e.string())}),B=e.object({visible_on_profile:e.boolean(),support_options:e.string().array()}),G=e.object({visible_on_profile:e.boolean()}),L={payload:x.payload.extend({organisation:s(D.extend({id:e.uuid().optional()})),event_details:s(N),story:s(U),supporters:s(H),funders:s($),facilitation:s(k),participants:s(w),support:s(B),action_plan:s(C.extend({actions:h.omit({assembly_id:!0}).extend({id:e.uuid().optional(),tasks:I.omit({action_id:!0,assembly_id:!0}).extend({id:e.uuid().optional()}).array(),updates:e.unknown().array()}).array(),updates:e.unknown().array()})),surveys:s(G)}),response:x.response.omit({user_id:!0}).extend({is_own:e.boolean(),organisation:s(D.extend({id:e.uuid(),created_at:i,updated_at:i})),event_details:s(N.extend({created_at:i,updated_at:i})),story:s(U.extend({created_at:i,updated_at:i})),supporters:s(H.extend({created_at:i,updated_at:i})),funders:s($.extend({created_at:i,updated_at:i})),facilitation:s(k.extend({created_at:i,updated_at:i})),participants:s(w.extend({created_at:i,updated_at:i})),support:s(B.extend({created_at:i,updated_at:i})),action_plan:s(C.extend({actions:h.omit({assembly_id:!0}).extend({id:e.uuid(),created_at:i,updated_at:e.coerce.date().transform(e=>e.toISOString()),tasks:I.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:s(G.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(),c.array())}))}))})},M={payload:e.object({country:e.string(),email:e.string(),text:s(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:s(e.string()),hide:e.boolean(),image_src:s(e.string()),has_image:e.boolean().meta({deprecated:!0})})},F={payload:e.undefined(),response:e.object({assemblies:x.response.array(),pins:M.response.array()})};export{r as ApiEndpoint,t as ApiRestMethod,a as ApiRouteParameter,v as AssembliesListSchema,L as AssemblyDetailSchema,x as AssemblyOverviewSchema,T as FeedbackSchema,l as GetAccountReportsIdSchema,_ as GetAccountReportsSchema,f as LogSchema,m as PatchAccountReportsIdDiscardSchema,y as PatchAccountReportsIdPublishSchema,S as PatchAccountReportsIdUnpublishSchema,F as PinListSchema,M as PinSchema,E as PostAccountReportsIdCoverImageSchema,b as PostAccountReportsSchema,g as PutAccountReportsIdContentSchema,j as RegisterSchema,n as ReportState,o as SurveyName,R as SurveyResponseSchema,A as SurveySchema};
1
+ import e from"zod";var t,a,r,n,o;!function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.PATCH="PATCH"}(t||(t={})),function(e){e.ID=":ID",e.NAME=":NAME"}(a||(a={})),function(e){e.ACCOUNT_REPORTS="/account/reports",e.ASSEMBLIES="/assemblies",e.FEEDBACK="/feedback",e.INTEREST="/interest",e.INTEREST_ASSEMBLIS="/interest/assemblis",e.LOGS="/logs",e.PINS="/pins",e.REPORTS="/reports",e.SURVEYS="/surveys",e.SURVEY_RESPONSES="/assemblies/:ID/survey-responses/:NAME"}(r||(r={})),function(e){e.DISCARDED="DISCARDED",e.DRAFTED="DRAFT",e.PUBLISHED="PUBLISHED",e.CHANGED="CHANGED"}(n||(n={})),function(e){e.DELIBERATION="deliberation",e.DEMOGRAPHIC_DATA="demographic-data",e.PRE_ASSEMBLY="pre-assembly",e.POST_ASSEMBLY="post-assembly"}(o||(o={}));const i=e.coerce.date().transform(e=>e.toISOString()),s=e=>e.nullish().transform(e=>e??null),d=e.object({id:e.uuid(),created_at:i,updated_at:i,alt:e.string(),srcset:e.string(),width:e.int(),height:e.int()}),c=e.object({recaptcha_token:e.string(),email:e.email().toLowerCase().trim(),list:e.int(),firstname:e.string().nullish().transform(e=>e??void 0),lastname:e.string().nullish().transform(e=>e??void 0),country:e.string().nullish().transform(e=>e??void 0),organisation:e.string().nullish().transform(e=>e??void 0)}),p=e.object({label:e.string(),value:e.coerce.number().int()}),l=e.object({published_at:s(i),title:s(e.string()),description:s(e.string()),location:s(e.string()),outputs:s(e.string().array()),initiation_type:s(e.string()),recruitment_method:s(e.string()),recruitment_description:s(e.string()),participant_count:s(e.int()),organiser_reflections:s(e.string()),organiser_report_url:s(e.string()),location_details:s(e.string()),date:s(e.string()),duration:s(e.int()),contact_information_url:s(e.string()),cover_image_id:s(e.string())}),u=e.object({id:e.uuid(),created_at:i,updated_at:i,published_at:s(i),state:e.enum(["DISCARDED","DRAFTED","PUBLISHED","CHANGED"]),viewer_password:e.string(),draft_content:s(l),published_content:s(l),media:e.object({images:d.array()})});e.object({id:e.uuid(),created_at:i,updated_at:i,sub:e.string(),is_mutirao:e.boolean()});const _={endpoint:()=>r.ACCOUNT_REPORTS,method:t.GET,payload:e.never(),response:e.object({reports:u.array()})},b={endpoint:e=>`${r.ACCOUNT_REPORTS}/${e}`,method:t.GET,payload:e.never(),response:s(u)},g={endpoint:()=>r.ACCOUNT_REPORTS,method:t.POST,payload:s(l.omit({cover_image_id:!0})),response:u},m={endpoint:e=>`${r.ACCOUNT_REPORTS}/${e}/content`,method:t.PUT,payload:l.omit({published_at:!0,cover_image_id:!0}),response:u},y={endpoint:e=>`${r.ACCOUNT_REPORTS}/${e}/discard`,method:t.PATCH,payload:e.nullish(e.object()),response:s(u)},S={endpoint:e=>`${r.ACCOUNT_REPORTS}/${e}/publish`,method:t.PATCH,payload:e.object({published_at:i}),response:u},E={endpoint:e=>`${r.ACCOUNT_REPORTS}/${e}/unpublish`,method:t.PATCH,payload:e.nullish(e.object()),response:u},T={endpoint:e=>`${r.ACCOUNT_REPORTS}/${e}/cover-image`,method:t.POST,payload:d.pick({alt:!0}),response:u},f={endpoint:()=>r.INTEREST,method:t.POST,payload:c,response:e.string()},j={endpoint:()=>r.REPORTS,method:t.GET,payload:e.never(),response:e.object({reports:u.array()})},O={endpoint:e=>`${r.REPORTS}/${e}`,method:t.GET,payload:e.never(),response:s(u)},R={payload:e.object({route:e.string(),text:e.string(),metadata:e.unknown()}),response:e.string()},h={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()},A={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()},v=e.object({id:e.uuid(),text:e.string()}),P={payload:e.undefined(),response:e.object({id:e.uuid(),created_at:i,updated_at:i,name:e.string(),sections:e.object({primary:v,secondary:v.array(),options:p.array()}).array()})},C={payload:e.object({answers:e.object({question_id:e.uuid(),answer_value:e.coerce.number().int()}).array()}),response:e.object({total:e.number().int()})},I=e.object({visible_on_profile:e.boolean(),description:s(e.string())}),x=e.object({text:e.string(),agreed:s(e.coerce.number().int()),against:s(e.coerce.number().int()),abstained:s(e.coerce.number().int()),include_in_action_plan:e.boolean().default(!0),assembly_id:e.uuid()}),D=e.object({text:e.string(),complete:e.boolean().default(!1),action_id:e.uuid(),assembly_id:e.uuid()}),N=e.object({published_at:s(i),name:e.string(),about:s(e.string()),topics:e.string().array(),country:s(e.string()),hide:e.boolean().default(!1)}),U={payload:N,response:N.extend({id:e.uuid(),created_at:i,updated_at:i,image_src:s(e.string()),has_image:e.boolean().meta({deprecated:!0}),user_id:e.uuid().meta({deprecated:!0})})},$={payload:e.undefined(),response:e.object({assemblies:U.response.array()})},k=e.object({visible_on_profile:e.boolean(),name:s(e.string()),description:s(e.string()),type:s(e.string())}),w=e.object({visible_on_profile:e.boolean(),registration_link:s(e.string()),start_date:s(i)}),H=e.object({visible_on_profile:e.boolean(),background:s(e.string())}),G=e.object({visible_on_profile:e.boolean(),organisation_types:e.string().array(),description:s(e.string())}),L=e.object({visible_on_profile:e.boolean(),organisation_types:e.string().array(),description:s(e.string())}),B=e.object({visible_on_profile:e.boolean(),decision_method:s(e.string())}),M=e.object({visible_on_profile:e.boolean(),recruitment_method:s(e.string()),community:s(e.string())}),F=e.object({visible_on_profile:e.boolean(),support_options:e.string().array()}),Y=e.object({visible_on_profile:e.boolean()}),V={payload:U.payload.extend({organisation:s(k.extend({id:e.uuid().optional()})),event_details:s(w),story:s(H),supporters:s(G),funders:s(L),facilitation:s(B),participants:s(M),support:s(F),action_plan:s(I.extend({actions:x.omit({assembly_id:!0}).extend({id:e.uuid().optional(),tasks:D.omit({action_id:!0,assembly_id:!0}).extend({id:e.uuid().optional()}).array(),updates:e.unknown().array()}).array(),updates:e.unknown().array()})),surveys:s(Y)}),response:U.response.omit({user_id:!0}).extend({is_own:e.boolean(),organisation:s(k.extend({id:e.uuid(),created_at:i,updated_at:i})),event_details:s(w.extend({created_at:i,updated_at:i})),story:s(H.extend({created_at:i,updated_at:i})),supporters:s(G.extend({created_at:i,updated_at:i})),funders:s(L.extend({created_at:i,updated_at:i})),facilitation:s(B.extend({created_at:i,updated_at:i})),participants:s(M.extend({created_at:i,updated_at:i})),support:s(F.extend({created_at:i,updated_at:i})),action_plan:s(I.extend({actions:x.omit({assembly_id:!0}).extend({id:e.uuid(),created_at:i,updated_at:e.coerce.date().transform(e=>e.toISOString()),tasks:D.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:s(Y.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(),p.array())}))}))})},q={payload:e.object({country:e.string(),email:e.string(),text:s(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:s(e.string()),hide:e.boolean(),image_src:s(e.string()),has_image:e.boolean().meta({deprecated:!0})})},z={payload:e.undefined(),response:e.object({assemblies:U.response.array(),pins:q.response.array()})};export{r as ApiEndpoint,t as ApiRestMethod,a as ApiRouteParameter,$ as AssembliesListSchema,V as AssemblyDetailSchema,U as AssemblyOverviewSchema,R as FeedbackSchema,b as GetAccountReportsIdSchema,_ as GetAccountReportsSchema,O as GetReportsIdSchema,j as GetReportsSchema,h as LogSchema,y as PatchAccountReportsIdDiscardSchema,S as PatchAccountReportsIdPublishSchema,E as PatchAccountReportsIdUnpublishSchema,z as PinListSchema,q as PinSchema,T as PostAccountReportsIdCoverImageSchema,g as PostAccountReportsSchema,f as PostInterestSchema,m as PutAccountReportsIdContentSchema,A as RegisterSchema,n as ReportState,o as SurveyName,C as SurveyResponseSchema,P as SurveySchema};
@@ -1,5 +1,5 @@
1
1
  import z from 'zod';
2
- import { ApiRestMethod } from '../types';
2
+ import { ApiEndpoint, ApiRestMethod } from '../types';
3
3
  type AccountEndpoint = `/account/${string}`;
4
4
  export declare const GetAccountReportsSchema: {
5
5
  endpoint: () => AccountEndpoint;
@@ -1350,4 +1350,394 @@ export declare const PostAccountReportsIdCoverImageSchema: {
1350
1350
  }, z.core.$strip>;
1351
1351
  }, z.core.$strip>;
1352
1352
  };
1353
+ export declare const PostInterestSchema: {
1354
+ endpoint: () => ApiEndpoint;
1355
+ method: ApiRestMethod;
1356
+ payload: z.ZodObject<{
1357
+ recaptcha_token: z.ZodString;
1358
+ email: z.ZodEmail;
1359
+ list: z.ZodInt;
1360
+ firstname: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
1361
+ lastname: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
1362
+ country: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
1363
+ organisation: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
1364
+ }, z.core.$strip>;
1365
+ response: z.ZodString;
1366
+ };
1367
+ export declare const GetReportsSchema: {
1368
+ endpoint: () => ApiEndpoint;
1369
+ method: ApiRestMethod;
1370
+ payload: z.ZodNever;
1371
+ response: z.ZodObject<{
1372
+ reports: z.ZodArray<z.ZodObject<{
1373
+ id: z.ZodUUID;
1374
+ created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
1375
+ updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
1376
+ published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
1377
+ state: z.ZodEnum<{
1378
+ DISCARDED: "DISCARDED";
1379
+ DRAFTED: "DRAFTED";
1380
+ PUBLISHED: "PUBLISHED";
1381
+ CHANGED: "CHANGED";
1382
+ }>;
1383
+ viewer_password: z.ZodString;
1384
+ draft_content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
1385
+ 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
+ title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1387
+ description: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1388
+ location: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1389
+ outputs: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[] | null, string[] | null | undefined>>;
1390
+ initiation_type: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1391
+ recruitment_method: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1392
+ recruitment_description: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1393
+ participant_count: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodInt>>, z.ZodTransform<number | null, number | null | undefined>>;
1394
+ organiser_reflections: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1395
+ organiser_report_url: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1396
+ location_details: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1397
+ date: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1398
+ duration: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodInt>>, z.ZodTransform<number | null, number | null | undefined>>;
1399
+ contact_information_url: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1400
+ cover_image_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1401
+ }, z.core.$strip>>>, z.ZodTransform<{
1402
+ published_at: string | null;
1403
+ title: string | null;
1404
+ description: string | null;
1405
+ location: string | null;
1406
+ outputs: string[] | null;
1407
+ initiation_type: string | null;
1408
+ recruitment_method: string | null;
1409
+ recruitment_description: string | null;
1410
+ participant_count: number | null;
1411
+ organiser_reflections: string | null;
1412
+ organiser_report_url: string | null;
1413
+ location_details: string | null;
1414
+ date: string | null;
1415
+ duration: number | null;
1416
+ contact_information_url: string | null;
1417
+ cover_image_id: string | null;
1418
+ } | null, {
1419
+ published_at: string | null;
1420
+ title: string | null;
1421
+ description: string | null;
1422
+ location: string | null;
1423
+ outputs: string[] | null;
1424
+ initiation_type: string | null;
1425
+ recruitment_method: string | null;
1426
+ recruitment_description: string | null;
1427
+ participant_count: number | null;
1428
+ organiser_reflections: string | null;
1429
+ organiser_report_url: string | null;
1430
+ location_details: string | null;
1431
+ date: string | null;
1432
+ duration: number | null;
1433
+ contact_information_url: string | null;
1434
+ cover_image_id: string | null;
1435
+ } | null | undefined>>;
1436
+ published_content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
1437
+ published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
1438
+ title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1439
+ description: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1440
+ location: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1441
+ outputs: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[] | null, string[] | null | undefined>>;
1442
+ initiation_type: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1443
+ recruitment_method: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1444
+ recruitment_description: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1445
+ participant_count: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodInt>>, z.ZodTransform<number | null, number | null | undefined>>;
1446
+ organiser_reflections: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1447
+ organiser_report_url: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1448
+ location_details: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1449
+ date: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1450
+ duration: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodInt>>, z.ZodTransform<number | null, number | null | undefined>>;
1451
+ contact_information_url: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1452
+ cover_image_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1453
+ }, z.core.$strip>>>, z.ZodTransform<{
1454
+ published_at: string | null;
1455
+ title: string | null;
1456
+ description: string | null;
1457
+ location: string | null;
1458
+ outputs: string[] | null;
1459
+ initiation_type: string | null;
1460
+ recruitment_method: string | null;
1461
+ recruitment_description: string | null;
1462
+ participant_count: number | null;
1463
+ organiser_reflections: string | null;
1464
+ organiser_report_url: string | null;
1465
+ location_details: string | null;
1466
+ date: string | null;
1467
+ duration: number | null;
1468
+ contact_information_url: string | null;
1469
+ cover_image_id: string | null;
1470
+ } | null, {
1471
+ published_at: string | null;
1472
+ title: string | null;
1473
+ description: string | null;
1474
+ location: string | null;
1475
+ outputs: string[] | null;
1476
+ initiation_type: string | null;
1477
+ recruitment_method: string | null;
1478
+ recruitment_description: string | null;
1479
+ participant_count: number | null;
1480
+ organiser_reflections: string | null;
1481
+ organiser_report_url: string | null;
1482
+ location_details: string | null;
1483
+ date: string | null;
1484
+ duration: number | null;
1485
+ contact_information_url: string | null;
1486
+ cover_image_id: string | null;
1487
+ } | null | undefined>>;
1488
+ media: z.ZodObject<{
1489
+ images: z.ZodArray<z.ZodObject<{
1490
+ id: z.ZodUUID;
1491
+ created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
1492
+ updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
1493
+ alt: z.ZodString;
1494
+ srcset: z.ZodString;
1495
+ width: z.ZodInt;
1496
+ height: z.ZodInt;
1497
+ }, z.core.$strip>>;
1498
+ }, z.core.$strip>;
1499
+ }, z.core.$strip>>;
1500
+ }, z.core.$strip>;
1501
+ };
1502
+ export declare const GetReportsIdSchema: {
1503
+ endpoint: (reportId: string) => string;
1504
+ method: ApiRestMethod;
1505
+ payload: z.ZodNever;
1506
+ response: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
1507
+ id: z.ZodUUID;
1508
+ created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
1509
+ updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
1510
+ published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
1511
+ state: z.ZodEnum<{
1512
+ DISCARDED: "DISCARDED";
1513
+ DRAFTED: "DRAFTED";
1514
+ PUBLISHED: "PUBLISHED";
1515
+ CHANGED: "CHANGED";
1516
+ }>;
1517
+ viewer_password: z.ZodString;
1518
+ draft_content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
1519
+ 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
+ title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1521
+ description: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1522
+ location: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1523
+ outputs: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[] | null, string[] | null | undefined>>;
1524
+ initiation_type: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1525
+ recruitment_method: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1526
+ recruitment_description: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1527
+ participant_count: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodInt>>, z.ZodTransform<number | null, number | null | undefined>>;
1528
+ organiser_reflections: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1529
+ organiser_report_url: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1530
+ location_details: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1531
+ date: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1532
+ duration: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodInt>>, z.ZodTransform<number | null, number | null | undefined>>;
1533
+ contact_information_url: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1534
+ cover_image_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1535
+ }, z.core.$strip>>>, z.ZodTransform<{
1536
+ published_at: string | null;
1537
+ title: string | null;
1538
+ description: string | null;
1539
+ location: string | null;
1540
+ outputs: string[] | null;
1541
+ initiation_type: string | null;
1542
+ recruitment_method: string | null;
1543
+ recruitment_description: string | null;
1544
+ participant_count: number | null;
1545
+ organiser_reflections: string | null;
1546
+ organiser_report_url: string | null;
1547
+ location_details: string | null;
1548
+ date: string | null;
1549
+ duration: number | null;
1550
+ contact_information_url: string | null;
1551
+ cover_image_id: string | null;
1552
+ } | null, {
1553
+ published_at: string | null;
1554
+ title: string | null;
1555
+ description: string | null;
1556
+ location: string | null;
1557
+ outputs: string[] | null;
1558
+ initiation_type: string | null;
1559
+ recruitment_method: string | null;
1560
+ recruitment_description: string | null;
1561
+ participant_count: number | null;
1562
+ organiser_reflections: string | null;
1563
+ organiser_report_url: string | null;
1564
+ location_details: string | null;
1565
+ date: string | null;
1566
+ duration: number | null;
1567
+ contact_information_url: string | null;
1568
+ cover_image_id: string | null;
1569
+ } | null | undefined>>;
1570
+ published_content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
1571
+ published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
1572
+ title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1573
+ description: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1574
+ location: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1575
+ outputs: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[] | null, string[] | null | undefined>>;
1576
+ initiation_type: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1577
+ recruitment_method: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1578
+ recruitment_description: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1579
+ participant_count: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodInt>>, z.ZodTransform<number | null, number | null | undefined>>;
1580
+ organiser_reflections: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1581
+ organiser_report_url: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1582
+ location_details: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1583
+ date: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1584
+ duration: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodInt>>, z.ZodTransform<number | null, number | null | undefined>>;
1585
+ contact_information_url: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1586
+ cover_image_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
1587
+ }, z.core.$strip>>>, z.ZodTransform<{
1588
+ published_at: string | null;
1589
+ title: string | null;
1590
+ description: string | null;
1591
+ location: string | null;
1592
+ outputs: string[] | null;
1593
+ initiation_type: string | null;
1594
+ recruitment_method: string | null;
1595
+ recruitment_description: string | null;
1596
+ participant_count: number | null;
1597
+ organiser_reflections: string | null;
1598
+ organiser_report_url: string | null;
1599
+ location_details: string | null;
1600
+ date: string | null;
1601
+ duration: number | null;
1602
+ contact_information_url: string | null;
1603
+ cover_image_id: string | null;
1604
+ } | null, {
1605
+ published_at: string | null;
1606
+ title: string | null;
1607
+ description: string | null;
1608
+ location: string | null;
1609
+ outputs: string[] | null;
1610
+ initiation_type: string | null;
1611
+ recruitment_method: string | null;
1612
+ recruitment_description: string | null;
1613
+ participant_count: number | null;
1614
+ organiser_reflections: string | null;
1615
+ organiser_report_url: string | null;
1616
+ location_details: string | null;
1617
+ date: string | null;
1618
+ duration: number | null;
1619
+ contact_information_url: string | null;
1620
+ cover_image_id: string | null;
1621
+ } | null | undefined>>;
1622
+ media: z.ZodObject<{
1623
+ images: z.ZodArray<z.ZodObject<{
1624
+ id: z.ZodUUID;
1625
+ created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
1626
+ updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
1627
+ alt: z.ZodString;
1628
+ srcset: z.ZodString;
1629
+ width: z.ZodInt;
1630
+ height: z.ZodInt;
1631
+ }, z.core.$strip>>;
1632
+ }, z.core.$strip>;
1633
+ }, z.core.$strip>>>, z.ZodTransform<{
1634
+ id: string;
1635
+ created_at: string;
1636
+ updated_at: string;
1637
+ published_at: string | null;
1638
+ state: "DISCARDED" | "DRAFTED" | "PUBLISHED" | "CHANGED";
1639
+ viewer_password: string;
1640
+ draft_content: {
1641
+ published_at: string | null;
1642
+ title: string | null;
1643
+ description: string | null;
1644
+ location: string | null;
1645
+ outputs: string[] | null;
1646
+ initiation_type: string | null;
1647
+ recruitment_method: string | null;
1648
+ recruitment_description: string | null;
1649
+ participant_count: number | null;
1650
+ organiser_reflections: string | null;
1651
+ organiser_report_url: string | null;
1652
+ location_details: string | null;
1653
+ date: string | null;
1654
+ duration: number | null;
1655
+ contact_information_url: string | null;
1656
+ cover_image_id: string | null;
1657
+ } | null;
1658
+ published_content: {
1659
+ published_at: string | null;
1660
+ title: string | null;
1661
+ description: string | null;
1662
+ location: string | null;
1663
+ outputs: string[] | null;
1664
+ initiation_type: string | null;
1665
+ recruitment_method: string | null;
1666
+ recruitment_description: string | null;
1667
+ participant_count: number | null;
1668
+ organiser_reflections: string | null;
1669
+ organiser_report_url: string | null;
1670
+ location_details: string | null;
1671
+ date: string | null;
1672
+ duration: number | null;
1673
+ contact_information_url: string | null;
1674
+ cover_image_id: string | null;
1675
+ } | null;
1676
+ media: {
1677
+ images: {
1678
+ id: string;
1679
+ created_at: string;
1680
+ updated_at: string;
1681
+ alt: string;
1682
+ srcset: string;
1683
+ width: number;
1684
+ height: number;
1685
+ }[];
1686
+ };
1687
+ } | null, {
1688
+ id: string;
1689
+ created_at: string;
1690
+ updated_at: string;
1691
+ published_at: string | null;
1692
+ state: "DISCARDED" | "DRAFTED" | "PUBLISHED" | "CHANGED";
1693
+ viewer_password: string;
1694
+ draft_content: {
1695
+ published_at: string | null;
1696
+ title: string | null;
1697
+ description: string | null;
1698
+ location: string | null;
1699
+ outputs: string[] | null;
1700
+ initiation_type: string | null;
1701
+ recruitment_method: string | null;
1702
+ recruitment_description: string | null;
1703
+ participant_count: number | null;
1704
+ organiser_reflections: string | null;
1705
+ organiser_report_url: string | null;
1706
+ location_details: string | null;
1707
+ date: string | null;
1708
+ duration: number | null;
1709
+ contact_information_url: string | null;
1710
+ cover_image_id: string | null;
1711
+ } | null;
1712
+ published_content: {
1713
+ published_at: string | null;
1714
+ title: string | null;
1715
+ description: string | null;
1716
+ location: string | null;
1717
+ outputs: string[] | null;
1718
+ initiation_type: string | null;
1719
+ recruitment_method: string | null;
1720
+ recruitment_description: string | null;
1721
+ participant_count: number | null;
1722
+ organiser_reflections: string | null;
1723
+ organiser_report_url: string | null;
1724
+ location_details: string | null;
1725
+ date: string | null;
1726
+ duration: number | null;
1727
+ contact_information_url: string | null;
1728
+ cover_image_id: string | null;
1729
+ } | null;
1730
+ media: {
1731
+ images: {
1732
+ id: string;
1733
+ created_at: string;
1734
+ updated_at: string;
1735
+ alt: string;
1736
+ srcset: string;
1737
+ width: number;
1738
+ height: number;
1739
+ }[];
1740
+ };
1741
+ } | null | undefined>>;
1742
+ };
1353
1743
  export {};
@@ -8,6 +8,15 @@ export declare const ImageSchema: z.ZodObject<{
8
8
  width: z.ZodInt;
9
9
  height: z.ZodInt;
10
10
  }, z.core.$strip>;
11
+ export declare const InterestSchema: z.ZodObject<{
12
+ recaptcha_token: z.ZodString;
13
+ email: z.ZodEmail;
14
+ list: z.ZodInt;
15
+ firstname: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
16
+ lastname: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
17
+ country: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
18
+ organisation: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
19
+ }, z.core.$strip>;
11
20
  export declare const OptionSchema: z.ZodObject<{
12
21
  label: z.ZodString;
13
22
  value: z.ZodCoercedNumber<unknown>;
@@ -12,10 +12,11 @@ export declare enum ApiEndpoint {
12
12
  ACCOUNT_REPORTS = "/account/reports",
13
13
  ASSEMBLIES = "/assemblies",
14
14
  FEEDBACK = "/feedback",
15
+ INTEREST = "/interest",
15
16
  INTEREST_ASSEMBLIS = "/interest/assemblis",
16
- INTEREST_MUTIRAO = "/interest/mutirao",
17
17
  LOGS = "/logs",
18
18
  PINS = "/pins",
19
+ REPORTS = "/reports",
19
20
  SURVEYS = "/surveys",
20
21
  SURVEY_RESPONSES = "/assemblies/:ID/survey-responses/:NAME"
21
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@assemblis/contracts",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/rollup.config.ts CHANGED
@@ -2,9 +2,6 @@ import typescript from '@rollup/plugin-typescript';
2
2
  import terser from '@rollup/plugin-terser';
3
3
 
4
4
  export default {
5
- output: {
6
- format: 'es',
7
- compact: true
8
- },
5
+ output: { format: 'es', compact: true },
9
6
  plugins: [typescript(), terser()]
10
7
  };
@@ -2,7 +2,12 @@ import z from 'zod';
2
2
 
3
3
  import { ApiEndpoint, ApiRestMethod } from '../types';
4
4
 
5
- import { ImageSchema, ReportContentSchema, ReportSchema } from './base';
5
+ import {
6
+ ImageSchema,
7
+ InterestSchema,
8
+ ReportContentSchema,
9
+ ReportSchema
10
+ } from './base';
6
11
  import { isoDateString, maybe } from './utils';
7
12
 
8
13
  type AccountEndpoint = `/account/${string}`;
@@ -72,9 +77,23 @@ export const PostAccountReportsIdCoverImageSchema = {
72
77
  response: ReportSchema
73
78
  };
74
79
 
80
+ export const PostInterestSchema = {
81
+ endpoint: () => ApiEndpoint.INTEREST,
82
+ method: ApiRestMethod.POST,
83
+ payload: InterestSchema,
84
+ response: z.string()
85
+ };
86
+
75
87
  export const GetReportsSchema = {
76
- endpoint: () => '/reports',
88
+ endpoint: () => ApiEndpoint.REPORTS,
77
89
  method: ApiRestMethod.GET,
78
90
  payload: z.never(),
79
91
  response: z.object({ reports: ReportSchema.array() })
80
92
  };
93
+
94
+ export const GetReportsIdSchema = {
95
+ endpoint: (reportId: string) => `${ApiEndpoint.REPORTS}/${reportId}`,
96
+ method: ApiRestMethod.GET,
97
+ payload: z.never(),
98
+ response: maybe(ReportSchema)
99
+ };
@@ -13,6 +13,28 @@ export const ImageSchema = z.object({
13
13
  height: z.int()
14
14
  });
15
15
 
16
+ export const InterestSchema = z.object({
17
+ recaptcha_token: z.string(),
18
+ email: z.email().toLowerCase().trim(),
19
+ list: z.int(),
20
+ firstname: z
21
+ .string()
22
+ .nullish()
23
+ .transform((_) => _ ?? undefined),
24
+ lastname: z
25
+ .string()
26
+ .nullish()
27
+ .transform((_) => _ ?? undefined),
28
+ country: z
29
+ .string()
30
+ .nullish()
31
+ .transform((_) => _ ?? undefined),
32
+ organisation: z
33
+ .string()
34
+ .nullish()
35
+ .transform((_) => _ ?? undefined)
36
+ });
37
+
16
38
  export const OptionSchema = z.object({
17
39
  label: z.string(),
18
40
  value: z.coerce.number().int()
@@ -14,10 +14,11 @@ export enum ApiEndpoint {
14
14
  ACCOUNT_REPORTS = '/account/reports',
15
15
  ASSEMBLIES = '/assemblies',
16
16
  FEEDBACK = '/feedback',
17
+ INTEREST = '/interest',
17
18
  INTEREST_ASSEMBLIS = '/interest/assemblis',
18
- INTEREST_MUTIRAO = '/interest/mutirao',
19
19
  LOGS = '/logs',
20
20
  PINS = '/pins',
21
+ REPORTS = '/reports',
21
22
  SURVEYS = '/surveys',
22
23
  SURVEY_RESPONSES = '/assemblies/:ID/survey-responses/:NAME'
23
24
  }