@assemblis/contracts 0.2.4 → 0.2.6

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,n,r,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"}(n||(n={})),function(e){e.DISCARDED="DISCARDED",e.DRAFTED="DRAFT",e.PUBLISHED="PUBLISHED",e.CHANGED="CHANGED"}(r||(r={})),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={payload:e.object({route:e.string(),text:e.string(),metadata:e.unknown()}),response:e.string()},c={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()},p=e.object({id:e.uuid(),text:e.string()}),l={payload:e.undefined(),response:e.object({id:e.uuid(),created_at:i,updated_at:i,name:e.string(),sections:e.object({primary:p,secondary:p.array(),options:U.array()}).array()})},u={payload:e.object({answers:e.object({question_id:e.uuid(),answer_value:e.coerce.number().int()}).array()}),response:e.object({total:e.number().int()})},_=e.object({visible_on_profile:e.boolean(),description:s(e.string())}),b=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()}),g=e.object({text:e.string(),complete:e.boolean().default(!1),action_id:e.uuid(),assembly_id:e.uuid()}),m=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)}),y={payload:m,response:m.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})})},S={payload:e.undefined(),response:e.object({assemblies:y.response.array()})},E=e.object({visible_on_profile:e.boolean(),name:s(e.string()),description:s(e.string()),type:s(e.string())}),T=e.object({visible_on_profile:e.boolean(),registration_link:s(e.string()),start_date:s(i)}),f=e.object({visible_on_profile:e.boolean(),background:s(e.string())}),j=e.object({visible_on_profile:e.boolean(),organisation_types:e.string().array(),description:s(e.string())}),O=e.object({visible_on_profile:e.boolean(),organisation_types:e.string().array(),description:s(e.string())}),R=e.object({visible_on_profile:e.boolean(),decision_method:s(e.string())}),h=e.object({visible_on_profile:e.boolean(),recruitment_method:s(e.string()),community:s(e.string())}),A=e.object({visible_on_profile:e.boolean(),support_options:e.string().array()}),v=e.object({visible_on_profile:e.boolean()}),P={payload:y.payload.extend({organisation:s(E.extend({id:e.uuid().optional()})),event_details:s(T),story:s(f),supporters:s(j),funders:s(O),facilitation:s(R),participants:s(h),support:s(A),action_plan:s(_.extend({actions:b.omit({assembly_id:!0}).extend({id:e.uuid().optional(),tasks:g.omit({action_id:!0,assembly_id:!0}).extend({id:e.uuid().optional()}).array(),updates:e.unknown().array()}).array(),updates:e.unknown().array()})),surveys:s(v)}),response:y.response.omit({user_id:!0}).extend({is_own:e.boolean(),organisation:s(E.extend({id:e.uuid(),created_at:i,updated_at:i})),event_details:s(T.extend({created_at:i,updated_at:i})),story:s(f.extend({created_at:i,updated_at:i})),supporters:s(j.extend({created_at:i,updated_at:i})),funders:s(O.extend({created_at:i,updated_at:i})),facilitation:s(R.extend({created_at:i,updated_at:i})),participants:s(h.extend({created_at:i,updated_at:i})),support:s(A.extend({created_at:i,updated_at:i})),action_plan:s(_.extend({actions:b.omit({assembly_id:!0}).extend({id:e.uuid(),created_at:i,updated_at:e.coerce.date().transform(e=>e.toISOString()),tasks:g.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(v.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(),U.array())}))}))})},C={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})})},I={payload:e.undefined(),response:e.object({assemblies:y.response.array(),pins:C.response.array()})},x={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()},D=e.object({id:e.uuid(),created_at:i,updated_at:i,alt:e.string(),srcset:e.string(),width:e.int(),height:e.int()}),N=e.object({recaptcha_token:e.string(),email:e.email().toLowerCase().trim(),listIds:e.int().array(),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)}),U=e.object({label:e.string(),value:e.coerce.number().int()}),$=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())}),k=e.object({server_id:e.uuid(),client_id:e.uuid(),display_seq:e.int(),created_at:i,updated_at:i,published_at:s(i),state:e.enum(["DISCARDED","DRAFTED","PUBLISHED","CHANGED"]),slug:s(e.string()),draft_content:s($),published_content:s($),media:e.object({images:D.array()})}),H=e.object({id:e.uuid(),created_at:i,updated_at:i,sub:e.string(),is_mutirao:e.boolean()}),G={endpoint:()=>n.ACCOUNT_REPORTS,method:t.GET,payload:e.never(),response:e.object({reports:k.array(),total:e.int()})},w={endpoint:e=>`${n.ACCOUNT_REPORTS}/${e}`,method:t.GET,payload:e.never(),response:s(k)},L={endpoint:()=>n.ACCOUNT_REPORTS,method:t.POST,payload:e.object({client_id:e.uuid(),content:s($.omit({cover_image_id:!0}))}),response:k},B={endpoint:e=>`${n.ACCOUNT_REPORTS}/${e}/content`,method:t.PUT,payload:$.omit({published_at:!0,cover_image_id:!0}),response:k},M={endpoint:e=>`${n.ACCOUNT_REPORTS}/${e}/discard`,method:t.PATCH,payload:e.nullish(e.object()),response:s(k)},F={endpoint:e=>`${n.ACCOUNT_REPORTS}/${e}/publish`,method:t.PATCH,payload:e.object({published_at:i}),response:k},Y={endpoint:e=>`${n.ACCOUNT_REPORTS}/${e}/unpublish`,method:t.PATCH,payload:e.nullish(e.object()),response:k},q={endpoint:e=>`${n.ACCOUNT_REPORTS}/${e}/cover-image`,method:t.POST,payload:D.pick({alt:!0}),response:k},V={endpoint:()=>n.INTEREST,method:t.POST,payload:N,response:e.string()},z={endpoint:()=>n.REPORTS,method:t.GET,payload:e.never(),response:e.object({reports:k.array()})},K={endpoint:e=>`${n.REPORTS}/${e}`,method:t.GET,payload:e.never(),response:s(k)};export{n as ApiEndpoint,t as ApiRestMethod,a as ApiRouteParameter,S as AssembliesListSchema,P as AssemblyDetailSchema,y as AssemblyOverviewSchema,d as FeedbackSchema,w as GetAccountReportsIdSchema,G as GetAccountReportsSchema,K as GetReportsIdSchema,z as GetReportsSchema,D as ImageSchema,N as InterestSchema,x as LogSchema,U as OptionSchema,M as PatchAccountReportsIdDiscardSchema,F as PatchAccountReportsIdPublishSchema,Y as PatchAccountReportsIdUnpublishSchema,I as PinListSchema,C as PinSchema,q as PostAccountReportsIdCoverImageSchema,L as PostAccountReportsSchema,V as PostInterestSchema,B as PutAccountReportsIdContentSchema,c as RegisterSchema,$ as ReportContentSchema,k as ReportSchema,r as ReportState,o as SurveyName,u as SurveyResponseSchema,l as SurveySchema,H as UserSchema};
1
+ import e from"zod";var t,a,n,r,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"}(n||(n={})),function(e){e.DISCARDED="DISCARDED",e.DRAFTED="DRAFT",e.PUBLISHED="PUBLISHED",e.CHANGED="CHANGED"}(r||(r={})),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(),listIds:e.int().array(),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({server_id:e.uuid(),client_id:e.uuid(),display_seq:e.int(),created_at:i,updated_at:i,published_at:s(i),state:e.enum(["DISCARDED","DRAFTED","PUBLISHED","CHANGED"]),slug:s(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:()=>n.ACCOUNT_REPORTS,method:t.GET,payload:e.never(),response:e.object({reports:u.array(),total:e.int()})},b={endpoint:e=>`${n.ACCOUNT_REPORTS}/${e}`,method:t.GET,payload:e.never(),response:s(u)},g={endpoint:()=>n.ACCOUNT_REPORTS,method:t.POST,payload:e.object({client_id:e.uuid(),content:s(l.omit({cover_image_id:!0}))}),response:u},m={endpoint:e=>`${n.ACCOUNT_REPORTS}/${e}/content`,method:t.PUT,payload:l.omit({published_at:!0,cover_image_id:!0}),response:u},y={endpoint:e=>`${n.ACCOUNT_REPORTS}/${e}/discard`,method:t.PATCH,payload:e.nullish(e.object()),response:s(u)},S={endpoint:e=>`${n.ACCOUNT_REPORTS}/${e}/publish`,method:t.PATCH,payload:e.object({published_at:i}),response:u},E={endpoint:e=>`${n.ACCOUNT_REPORTS}/${e}/unpublish`,method:t.PATCH,payload:e.nullish(e.object()),response:u},T={endpoint:e=>`${n.ACCOUNT_REPORTS}/${e}/cover-image`,method:t.POST,payload:d.pick({alt:!0}),response:u},f={endpoint:()=>n.INTEREST,method:t.POST,payload:c,response:e.string()},j={endpoint:()=>n.REPORTS,method:t.GET,payload:e.never(),response:e.object({reports:u.array()})},O={endpoint:e=>`${n.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())}),H=e.object({visible_on_profile:e.boolean(),registration_link:s(e.string()),start_date:s(i)}),G=e.object({visible_on_profile:e.boolean(),background:s(e.string())}),w=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()}),q={payload:U.payload.extend({organisation:s(k.extend({id:e.uuid().optional()})),event_details:s(H),story:s(G),supporters:s(w),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(H.extend({created_at:i,updated_at:i})),story:s(G.extend({created_at:i,updated_at:i})),supporters:s(w.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())}))}))})},V={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:V.response.array()})};export{n as ApiEndpoint,t as ApiRestMethod,a as ApiRouteParameter,$ as AssembliesListSchema,q 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,V as PinSchema,T as PostAccountReportsIdCoverImageSchema,g as PostAccountReportsSchema,f as PostInterestSchema,m as PutAccountReportsIdContentSchema,A as RegisterSchema,r as ReportState,o as SurveyName,C as SurveyResponseSchema,P as SurveySchema};
@@ -393,9 +393,9 @@ export declare const PostAccountReportsSchema: {
393
393
  client_id: z.ZodUUID;
394
394
  content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
395
395
  date: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
396
+ published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
396
397
  title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
397
398
  description: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
398
- published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
399
399
  location: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
400
400
  outputs: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[] | null, string[] | null | undefined>>;
401
401
  initiation_type: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
@@ -409,9 +409,9 @@ export declare const PostAccountReportsSchema: {
409
409
  contact_information_url: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
410
410
  }, z.core.$strip>>>, z.ZodTransform<{
411
411
  date: string | null;
412
+ published_at: string | null;
412
413
  title: string | null;
413
414
  description: string | null;
414
- published_at: string | null;
415
415
  location: string | null;
416
416
  outputs: string[] | null;
417
417
  initiation_type: string | null;
@@ -425,9 +425,9 @@ export declare const PostAccountReportsSchema: {
425
425
  contact_information_url: string | null;
426
426
  } | null, {
427
427
  date: string | null;
428
+ published_at: string | null;
428
429
  title: string | null;
429
430
  description: string | null;
430
- published_at: string | null;
431
431
  location: string | null;
432
432
  outputs: string[] | null;
433
433
  initiation_type: string | null;
@@ -1,62 +1,4 @@
1
1
  import z from 'zod';
2
- export declare const PinSchema: {
3
- payload: z.ZodObject<{
4
- country: z.ZodString;
5
- email: z.ZodString;
6
- text: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
7
- }, z.core.$strip>;
8
- response: z.ZodObject<{
9
- id: z.ZodUUID;
10
- created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
11
- updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
12
- country: z.ZodString;
13
- text: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
14
- hide: z.ZodBoolean;
15
- image_src: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
16
- has_image: z.ZodBoolean;
17
- }, z.core.$strip>;
18
- };
19
- export declare const PinListSchema: {
20
- payload: z.ZodUndefined;
21
- response: z.ZodObject<{
22
- assemblies: z.ZodArray<z.ZodObject<{
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>>;
24
- name: z.ZodString;
25
- about: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
26
- topics: z.ZodArray<z.ZodString>;
27
- country: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
28
- hide: z.ZodDefault<z.ZodBoolean>;
29
- id: z.ZodUUID;
30
- created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
31
- updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
32
- image_src: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
33
- has_image: z.ZodBoolean;
34
- user_id: z.ZodUUID;
35
- }, z.core.$strip>>;
36
- pins: z.ZodArray<z.ZodObject<{
37
- id: z.ZodUUID;
38
- created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
39
- updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
40
- country: z.ZodString;
41
- text: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
42
- hide: z.ZodBoolean;
43
- image_src: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
44
- has_image: z.ZodBoolean;
45
- }, z.core.$strip>>;
46
- }, z.core.$strip>;
47
- };
48
- export declare const LogSchema: {
49
- payload: z.ZodObject<{
50
- message: z.ZodOptional<z.ZodString>;
51
- data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>>;
52
- metadata: z.ZodObject<{
53
- origin: z.ZodString;
54
- route: z.ZodString;
55
- status: z.ZodNumber;
56
- }, z.core.$strip>;
57
- }, z.core.$strip>;
58
- response: z.ZodString;
59
- };
60
2
  export declare const ImageSchema: z.ZodObject<{
61
3
  id: z.ZodUUID;
62
4
  created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
@@ -1,3 +1,2 @@
1
1
  export * from './api';
2
- export * from './base';
3
2
  export * from './legacy';
@@ -7,6 +7,18 @@ export declare const FeedbackSchema: {
7
7
  }, z.core.$strip>;
8
8
  response: z.ZodString;
9
9
  };
10
+ export declare const LogSchema: {
11
+ payload: z.ZodObject<{
12
+ message: z.ZodOptional<z.ZodString>;
13
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>>;
14
+ metadata: z.ZodObject<{
15
+ origin: z.ZodString;
16
+ route: z.ZodString;
17
+ status: z.ZodNumber;
18
+ }, z.core.$strip>;
19
+ }, z.core.$strip>;
20
+ response: z.ZodString;
21
+ };
10
22
  export declare const RegisterSchema: {
11
23
  payload: z.ZodObject<{
12
24
  type: z.ZodLiteral<"user.created">;
@@ -270,17 +282,17 @@ export declare const AssemblyDetailSchema: {
270
282
  } | null | undefined>>;
271
283
  }, z.core.$strip>;
272
284
  response: z.ZodObject<{
273
- country: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
274
- id: z.ZodUUID;
275
285
  created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
276
286
  updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
277
- hide: z.ZodDefault<z.ZodBoolean>;
278
- image_src: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
279
- has_image: z.ZodBoolean;
287
+ id: z.ZodUUID;
288
+ country: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
280
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>>;
281
290
  name: z.ZodString;
282
291
  about: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
283
292
  topics: z.ZodArray<z.ZodString>;
293
+ hide: z.ZodDefault<z.ZodBoolean>;
294
+ image_src: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
295
+ has_image: z.ZodBoolean;
284
296
  is_own: z.ZodBoolean;
285
297
  organisation: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
286
298
  visible_on_profile: z.ZodBoolean;
@@ -543,3 +555,49 @@ export declare const AssemblyDetailSchema: {
543
555
  } | null | undefined>>;
544
556
  }, z.core.$strip>;
545
557
  };
558
+ export declare const PinSchema: {
559
+ payload: z.ZodObject<{
560
+ country: z.ZodString;
561
+ email: z.ZodString;
562
+ text: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
563
+ }, z.core.$strip>;
564
+ response: z.ZodObject<{
565
+ id: z.ZodUUID;
566
+ created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
567
+ updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
568
+ country: z.ZodString;
569
+ text: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
570
+ hide: z.ZodBoolean;
571
+ image_src: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
572
+ has_image: z.ZodBoolean;
573
+ }, z.core.$strip>;
574
+ };
575
+ export declare const PinListSchema: {
576
+ payload: z.ZodUndefined;
577
+ response: z.ZodObject<{
578
+ assemblies: z.ZodArray<z.ZodObject<{
579
+ published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
580
+ name: z.ZodString;
581
+ about: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
582
+ topics: z.ZodArray<z.ZodString>;
583
+ country: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
584
+ hide: z.ZodDefault<z.ZodBoolean>;
585
+ id: z.ZodUUID;
586
+ created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
587
+ updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
588
+ image_src: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
589
+ has_image: z.ZodBoolean;
590
+ user_id: z.ZodUUID;
591
+ }, z.core.$strip>>;
592
+ pins: z.ZodArray<z.ZodObject<{
593
+ id: z.ZodUUID;
594
+ created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
595
+ updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
596
+ country: z.ZodString;
597
+ text: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
598
+ hide: z.ZodBoolean;
599
+ image_src: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
600
+ has_image: z.ZodBoolean;
601
+ }, z.core.$strip>>;
602
+ }, z.core.$strip>;
603
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@assemblis/contracts",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -2,46 +2,6 @@
2
2
 
3
3
  import z from 'zod';
4
4
  import { isoDateString, maybe } from './utils';
5
- import { AssemblyOverviewSchema } from './legacy';
6
-
7
- // Pins
8
- export const PinSchema = {
9
- payload: z.object({
10
- country: z.string(),
11
- email: z.string(),
12
- text: maybe(z.string())
13
- }),
14
- response: z.object({
15
- id: z.uuid(),
16
- created_at: z.coerce.date().transform((_) => _.toISOString()),
17
- updated_at: z.coerce.date().transform((_) => _.toISOString()),
18
- country: z.string(),
19
- text: maybe(z.string()),
20
- hide: z.boolean(),
21
- image_src: maybe(z.string()),
22
- has_image: z.boolean().meta({ deprecated: true })
23
- })
24
- };
25
- export const PinListSchema = {
26
- payload: z.undefined(),
27
- response: z.object({
28
- assemblies: AssemblyOverviewSchema.response.array(),
29
- pins: PinSchema.response.array()
30
- })
31
- };
32
-
33
- export const LogSchema = {
34
- payload: z.object({
35
- message: z.string().optional(),
36
- data: z.record(z.string(), z.string().optional()).optional(),
37
- metadata: z.object({
38
- origin: z.string(),
39
- route: z.string(),
40
- status: z.number()
41
- })
42
- }),
43
- response: z.string()
44
- };
45
5
 
46
6
  export const ImageSchema = z.object({
47
7
  id: z.uuid(),
@@ -1,3 +1,2 @@
1
1
  export * from './api';
2
- export * from './base';
3
2
  export * from './legacy';
@@ -11,6 +11,19 @@ export const FeedbackSchema = {
11
11
  response: z.string()
12
12
  };
13
13
 
14
+ export const LogSchema = {
15
+ payload: z.object({
16
+ message: z.string().optional(),
17
+ data: z.record(z.string(), z.string().optional()).optional(),
18
+ metadata: z.object({
19
+ origin: z.string(),
20
+ route: z.string(),
21
+ status: z.number()
22
+ })
23
+ }),
24
+ response: z.string()
25
+ };
26
+
14
27
  export const RegisterSchema = {
15
28
  payload: z.object({
16
29
  type: z.literal('user.created'),
@@ -287,3 +300,29 @@ export const AssemblyDetailSchema = {
287
300
  )
288
301
  })
289
302
  };
303
+
304
+ // Pins
305
+ export const PinSchema = {
306
+ payload: z.object({
307
+ country: z.string(),
308
+ email: z.string(),
309
+ text: maybe(z.string())
310
+ }),
311
+ response: z.object({
312
+ id: z.uuid(),
313
+ created_at: z.coerce.date().transform((_) => _.toISOString()),
314
+ updated_at: z.coerce.date().transform((_) => _.toISOString()),
315
+ country: z.string(),
316
+ text: maybe(z.string()),
317
+ hide: z.boolean(),
318
+ image_src: maybe(z.string()),
319
+ has_image: z.boolean().meta({ deprecated: true })
320
+ })
321
+ };
322
+ export const PinListSchema = {
323
+ payload: z.undefined(),
324
+ response: z.object({
325
+ assemblies: AssemblyOverviewSchema.response.array(),
326
+ pins: PinSchema.response.array()
327
+ })
328
+ };