@assemblis/contracts 0.2.2 → 0.2.4

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 t from"zod";var e,a,n,r,o;!function(t){t.GET="GET",t.POST="POST",t.PUT="PUT",t.PATCH="PATCH"}(e||(e={})),function(t){t.ID=":ID",t.NAME=":NAME"}(a||(a={})),function(t){t.ACCOUNT_REPORTS="/account/reports",t.ASSEMBLIES="/assemblies",t.FEEDBACK="/feedback",t.INTEREST="/interest",t.INTEREST_ASSEMBLIS="/interest/assemblis",t.LOGS="/logs",t.PINS="/pins",t.REPORTS="/reports",t.SURVEYS="/surveys",t.SURVEY_RESPONSES="/assemblies/:ID/survey-responses/:NAME"}(n||(n={})),function(t){t.DISCARDED="DISCARDED",t.DRAFTED="DRAFT",t.PUBLISHED="PUBLISHED",t.CHANGED="CHANGED"}(r||(r={})),function(t){t.DELIBERATION="deliberation",t.DEMOGRAPHIC_DATA="demographic-data",t.PRE_ASSEMBLY="pre-assembly",t.POST_ASSEMBLY="post-assembly"}(o||(o={}));const i=t.coerce.date().transform(t=>t.toISOString()),s=t=>t.nullish().transform(t=>t??null);t.object({route:t.string(),text:t.string(),metadata:t.unknown()}),t.string(),t.object({type:t.literal("user.created"),object:t.literal("event"),data:t.object({id:t.string(),email_addresses:t.object({email_address:t.string()}).array()})}),t.string();const d=t.object({id:t.uuid(),text:t.string()});t.undefined(),t.object({id:t.uuid(),created_at:i,updated_at:i,name:t.string(),sections:t.object({primary:d,secondary:d.array(),options:v.array()}).array()}),t.object({answers:t.object({question_id:t.uuid(),answer_value:t.coerce.number().int()}).array()}),t.object({total:t.number().int()});const c=t.object({visible_on_profile:t.boolean(),description:s(t.string())}),p=t.object({text:t.string(),agreed:s(t.coerce.number().int()),against:s(t.coerce.number().int()),abstained:s(t.coerce.number().int()),include_in_action_plan:t.boolean().default(!0),assembly_id:t.uuid()}),u=t.object({text:t.string(),complete:t.boolean().default(!1),action_id:t.uuid(),assembly_id:t.uuid()}),l=t.object({published_at:s(i),name:t.string(),about:s(t.string()),topics:t.string().array(),country:s(t.string()),hide:t.boolean().default(!1)}),_={payload:l,response:l.extend({id:t.uuid(),created_at:i,updated_at:i,image_src:s(t.string()),has_image:t.boolean().meta({deprecated:!0}),user_id:t.uuid().meta({deprecated:!0})})};t.undefined(),t.object({assemblies:_.response.array()});const b=t.object({visible_on_profile:t.boolean(),name:s(t.string()),description:s(t.string()),type:s(t.string())}),g=t.object({visible_on_profile:t.boolean(),registration_link:s(t.string()),start_date:s(i)}),m=t.object({visible_on_profile:t.boolean(),background:s(t.string())}),S=t.object({visible_on_profile:t.boolean(),organisation_types:t.string().array(),description:s(t.string())}),y=t.object({visible_on_profile:t.boolean(),organisation_types:t.string().array(),description:s(t.string())}),E=t.object({visible_on_profile:t.boolean(),decision_method:s(t.string())}),T=t.object({visible_on_profile:t.boolean(),recruitment_method:s(t.string()),community:s(t.string())}),f=t.object({visible_on_profile:t.boolean(),support_options:t.string().array()}),j=t.object({visible_on_profile:t.boolean()});_.payload.extend({organisation:s(b.extend({id:t.uuid().optional()})),event_details:s(g),story:s(m),supporters:s(S),funders:s(y),facilitation:s(E),participants:s(T),support:s(f),action_plan:s(c.extend({actions:p.omit({assembly_id:!0}).extend({id:t.uuid().optional(),tasks:u.omit({action_id:!0,assembly_id:!0}).extend({id:t.uuid().optional()}).array(),updates:t.unknown().array()}).array(),updates:t.unknown().array()})),surveys:s(j)}),_.response.omit({user_id:!0}).extend({is_own:t.boolean(),organisation:s(b.extend({id:t.uuid(),created_at:i,updated_at:i})),event_details:s(g.extend({created_at:i,updated_at:i})),story:s(m.extend({created_at:i,updated_at:i})),supporters:s(S.extend({created_at:i,updated_at:i})),funders:s(y.extend({created_at:i,updated_at:i})),facilitation:s(E.extend({created_at:i,updated_at:i})),participants:s(T.extend({created_at:i,updated_at:i})),support:s(f.extend({created_at:i,updated_at:i})),action_plan:s(c.extend({actions:p.omit({assembly_id:!0}).extend({id:t.uuid(),created_at:i,updated_at:t.coerce.date().transform(t=>t.toISOString()),tasks:u.omit({action_id:!0,assembly_id:!0}).extend({id:t.uuid(),created_at:t.coerce.date().transform(t=>t.toISOString()),updated_at:t.coerce.date().transform(t=>t.toISOString())}).array(),updates:t.unknown().array()}).extend({created_at:t.coerce.date().transform(t=>t.toISOString()),updated_at:t.coerce.date().transform(t=>t.toISOString())}).array(),updates:t.unknown().array()}).and(t.object({created_at:t.coerce.date().transform(t=>t.toISOString()),updated_at:t.coerce.date().transform(t=>t.toISOString())}))),surveys:s(j.extend({created_at:t.coerce.date().transform(t=>t.toISOString()),updated_at:t.coerce.date().transform(t=>t.toISOString())}).extend({data:t.record(t.string(),t.object({total:t.number().int(),responses:t.record(t.string(),v.array())}))}))});const O={payload:t.object({country:t.string(),email:t.string(),text:s(t.string())}),response:t.object({id:t.uuid(),created_at:t.coerce.date().transform(t=>t.toISOString()),updated_at:t.coerce.date().transform(t=>t.toISOString()),country:t.string(),text:s(t.string()),hide:t.boolean(),image_src:s(t.string()),has_image:t.boolean().meta({deprecated:!0})})},R={payload:t.undefined(),response:t.object({assemblies:_.response.array(),pins:O.response.array()})},h={payload:t.object({message:t.string().optional(),data:t.record(t.string(),t.string().optional()).optional(),metadata:t.object({origin:t.string(),route:t.string(),status:t.number()})}),response:t.string()},A=t.object({id:t.uuid(),created_at:i,updated_at:i,alt:t.string(),srcset:t.string(),width:t.int(),height:t.int()}),P=t.object({recaptcha_token:t.string(),email:t.email().toLowerCase().trim(),listIds:t.int().array(),firstname:t.string().nullish().transform(t=>t??void 0),lastname:t.string().nullish().transform(t=>t??void 0),country:t.string().nullish().transform(t=>t??void 0),organisation:t.string().nullish().transform(t=>t??void 0)}),v=t.object({label:t.string(),value:t.coerce.number().int()}),C=t.object({published_at:s(i),title:s(t.string()),description:s(t.string()),location:s(t.string()),outputs:s(t.string().array()),initiation_type:s(t.string()),recruitment_method:s(t.string()),recruitment_description:s(t.string()),participant_count:s(t.int()),organiser_reflections:s(t.string()),organiser_report_url:s(t.string()),location_details:s(t.string()),date:s(t.string()),duration:s(t.int()),contact_information_url:s(t.string()),cover_image_id:s(t.string())}),I=t.object({id:t.uuid(),sequential_id:t.int(),created_at:i,updated_at:i,published_at:s(i),state:t.enum(["DISCARDED","DRAFTED","PUBLISHED","CHANGED"]),slug:s(t.string()),draft_content:s(C),published_content:s(C),media:t.object({images:A.array()})}),x=t.object({id:t.uuid(),created_at:i,updated_at:i,sub:t.string(),is_mutirao:t.boolean()}),D={endpoint:()=>n.ACCOUNT_REPORTS,method:e.GET,payload:t.never(),response:t.object({reports:I.array(),total:t.int()})},N={endpoint:t=>`${n.ACCOUNT_REPORTS}/${t}`,method:e.GET,payload:t.never(),response:s(I)},U={endpoint:()=>n.ACCOUNT_REPORTS,method:e.POST,payload:t.object({sequential_id:t.int(),content:s(C.omit({cover_image_id:!0}))}),response:I},$={endpoint:t=>`${n.ACCOUNT_REPORTS}/${t}/content`,method:e.PUT,payload:C.omit({published_at:!0,cover_image_id:!0}),response:I},k={endpoint:t=>`${n.ACCOUNT_REPORTS}/${t}/discard`,method:e.PATCH,payload:t.nullish(t.object()),response:s(I)},H={endpoint:t=>`${n.ACCOUNT_REPORTS}/${t}/publish`,method:e.PATCH,payload:t.object({published_at:i}),response:I},G={endpoint:t=>`${n.ACCOUNT_REPORTS}/${t}/unpublish`,method:e.PATCH,payload:t.nullish(t.object()),response:I},w={endpoint:t=>`${n.ACCOUNT_REPORTS}/${t}/cover-image`,method:e.POST,payload:A.pick({alt:!0}),response:I},L={endpoint:()=>n.INTEREST,method:e.POST,payload:P,response:t.string()},B={endpoint:()=>n.REPORTS,method:e.GET,payload:t.never(),response:t.object({reports:I.array()})},M={endpoint:t=>`${n.REPORTS}/${t}`,method:e.GET,payload:t.never(),response:s(I)};export{n as ApiEndpoint,e as ApiRestMethod,a as ApiRouteParameter,N as GetAccountReportsIdSchema,D as GetAccountReportsSchema,M as GetReportsIdSchema,B as GetReportsSchema,A as ImageSchema,P as InterestSchema,h as LogSchema,v as OptionSchema,k as PatchAccountReportsIdDiscardSchema,H as PatchAccountReportsIdPublishSchema,G as PatchAccountReportsIdUnpublishSchema,R as PinListSchema,O as PinSchema,w as PostAccountReportsIdCoverImageSchema,U as PostAccountReportsSchema,L as PostInterestSchema,$ as PutAccountReportsIdContentSchema,C as ReportContentSchema,I as ReportSchema,r as ReportState,o as SurveyName,x 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={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};
@@ -7,8 +7,9 @@ export declare const GetAccountReportsSchema: {
7
7
  payload: z.ZodNever;
8
8
  response: z.ZodObject<{
9
9
  reports: z.ZodArray<z.ZodObject<{
10
- id: z.ZodUUID;
11
- sequential_id: z.ZodInt;
10
+ server_id: z.ZodUUID;
11
+ client_id: z.ZodUUID;
12
+ display_seq: z.ZodInt;
12
13
  created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
13
14
  updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
14
15
  published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
@@ -143,8 +144,9 @@ export declare const GetAccountReportsIdSchema: {
143
144
  method: ApiRestMethod;
144
145
  payload: z.ZodNever;
145
146
  response: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
146
- id: z.ZodUUID;
147
- sequential_id: z.ZodInt;
147
+ server_id: z.ZodUUID;
148
+ client_id: z.ZodUUID;
149
+ display_seq: z.ZodInt;
148
150
  created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
149
151
  updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
150
152
  published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
@@ -271,8 +273,9 @@ export declare const GetAccountReportsIdSchema: {
271
273
  }, z.core.$strip>>;
272
274
  }, z.core.$strip>;
273
275
  }, z.core.$strip>>>, z.ZodTransform<{
274
- id: string;
275
- sequential_id: number;
276
+ server_id: string;
277
+ client_id: string;
278
+ display_seq: number;
276
279
  created_at: string;
277
280
  updated_at: string;
278
281
  published_at: string | null;
@@ -326,8 +329,9 @@ export declare const GetAccountReportsIdSchema: {
326
329
  }[];
327
330
  };
328
331
  } | null, {
329
- id: string;
330
- sequential_id: number;
332
+ server_id: string;
333
+ client_id: string;
334
+ display_seq: number;
331
335
  created_at: string;
332
336
  updated_at: string;
333
337
  published_at: string | null;
@@ -386,7 +390,7 @@ export declare const PostAccountReportsSchema: {
386
390
  endpoint: () => AccountEndpoint;
387
391
  method: ApiRestMethod;
388
392
  payload: z.ZodObject<{
389
- sequential_id: z.ZodInt;
393
+ client_id: z.ZodUUID;
390
394
  content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
391
395
  date: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
392
396
  title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
@@ -438,8 +442,9 @@ export declare const PostAccountReportsSchema: {
438
442
  } | null | undefined>>;
439
443
  }, z.core.$strip>;
440
444
  response: z.ZodObject<{
441
- id: z.ZodUUID;
442
- sequential_id: z.ZodInt;
445
+ server_id: z.ZodUUID;
446
+ client_id: z.ZodUUID;
447
+ display_seq: z.ZodInt;
443
448
  created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
444
449
  updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
445
450
  published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
@@ -568,7 +573,7 @@ export declare const PostAccountReportsSchema: {
568
573
  }, z.core.$strip>;
569
574
  };
570
575
  export declare const PutAccountReportsIdContentSchema: {
571
- endpoint: (reportId: string) => AccountEndpoint;
576
+ endpoint: (clientId: string) => AccountEndpoint;
572
577
  method: ApiRestMethod;
573
578
  payload: z.ZodObject<{
574
579
  date: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
@@ -587,8 +592,9 @@ export declare const PutAccountReportsIdContentSchema: {
587
592
  contact_information_url: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
588
593
  }, z.core.$strip>;
589
594
  response: z.ZodObject<{
590
- id: z.ZodUUID;
591
- sequential_id: z.ZodInt;
595
+ server_id: z.ZodUUID;
596
+ client_id: z.ZodUUID;
597
+ display_seq: z.ZodInt;
592
598
  created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
593
599
  updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
594
600
  published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
@@ -717,12 +723,13 @@ export declare const PutAccountReportsIdContentSchema: {
717
723
  }, z.core.$strip>;
718
724
  };
719
725
  export declare const PatchAccountReportsIdDiscardSchema: {
720
- endpoint: (reportId: string) => AccountEndpoint;
726
+ endpoint: (clientId: string) => AccountEndpoint;
721
727
  method: ApiRestMethod;
722
728
  payload: z.ZodOptional<z.ZodNullable<z.ZodObject<{}, z.core.$strip>>>;
723
729
  response: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
724
- id: z.ZodUUID;
725
- sequential_id: z.ZodInt;
730
+ server_id: z.ZodUUID;
731
+ client_id: z.ZodUUID;
732
+ display_seq: z.ZodInt;
726
733
  created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
727
734
  updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
728
735
  published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
@@ -849,8 +856,9 @@ export declare const PatchAccountReportsIdDiscardSchema: {
849
856
  }, z.core.$strip>>;
850
857
  }, z.core.$strip>;
851
858
  }, z.core.$strip>>>, z.ZodTransform<{
852
- id: string;
853
- sequential_id: number;
859
+ server_id: string;
860
+ client_id: string;
861
+ display_seq: number;
854
862
  created_at: string;
855
863
  updated_at: string;
856
864
  published_at: string | null;
@@ -904,8 +912,9 @@ export declare const PatchAccountReportsIdDiscardSchema: {
904
912
  }[];
905
913
  };
906
914
  } | null, {
907
- id: string;
908
- sequential_id: number;
915
+ server_id: string;
916
+ client_id: string;
917
+ display_seq: number;
909
918
  created_at: string;
910
919
  updated_at: string;
911
920
  published_at: string | null;
@@ -961,14 +970,15 @@ export declare const PatchAccountReportsIdDiscardSchema: {
961
970
  } | null | undefined>>;
962
971
  };
963
972
  export declare const PatchAccountReportsIdPublishSchema: {
964
- endpoint: (reportId: string) => AccountEndpoint;
973
+ endpoint: (clientId: string) => AccountEndpoint;
965
974
  method: ApiRestMethod;
966
975
  payload: z.ZodObject<{
967
976
  published_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
968
977
  }, z.core.$strip>;
969
978
  response: z.ZodObject<{
970
- id: z.ZodUUID;
971
- sequential_id: z.ZodInt;
979
+ server_id: z.ZodUUID;
980
+ client_id: z.ZodUUID;
981
+ display_seq: z.ZodInt;
972
982
  created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
973
983
  updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
974
984
  published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
@@ -1097,12 +1107,13 @@ export declare const PatchAccountReportsIdPublishSchema: {
1097
1107
  }, z.core.$strip>;
1098
1108
  };
1099
1109
  export declare const PatchAccountReportsIdUnpublishSchema: {
1100
- endpoint: (reportId: string) => AccountEndpoint;
1110
+ endpoint: (clientId: string) => AccountEndpoint;
1101
1111
  method: ApiRestMethod;
1102
1112
  payload: z.ZodOptional<z.ZodNullable<z.ZodObject<{}, z.core.$strip>>>;
1103
1113
  response: z.ZodObject<{
1104
- id: z.ZodUUID;
1105
- sequential_id: z.ZodInt;
1114
+ server_id: z.ZodUUID;
1115
+ client_id: z.ZodUUID;
1116
+ display_seq: z.ZodInt;
1106
1117
  created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
1107
1118
  updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
1108
1119
  published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
@@ -1231,14 +1242,15 @@ export declare const PatchAccountReportsIdUnpublishSchema: {
1231
1242
  }, z.core.$strip>;
1232
1243
  };
1233
1244
  export declare const PostAccountReportsIdCoverImageSchema: {
1234
- endpoint: (reportId: string) => AccountEndpoint;
1245
+ endpoint: (clientId: string) => AccountEndpoint;
1235
1246
  method: ApiRestMethod;
1236
1247
  payload: z.ZodObject<{
1237
1248
  alt: z.ZodString;
1238
1249
  }, z.core.$strip>;
1239
1250
  response: z.ZodObject<{
1240
- id: z.ZodUUID;
1241
- sequential_id: z.ZodInt;
1251
+ server_id: z.ZodUUID;
1252
+ client_id: z.ZodUUID;
1253
+ display_seq: z.ZodInt;
1242
1254
  created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
1243
1255
  updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
1244
1256
  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,8 +1398,9 @@ export declare const GetReportsSchema: {
1386
1398
  payload: z.ZodNever;
1387
1399
  response: z.ZodObject<{
1388
1400
  reports: z.ZodArray<z.ZodObject<{
1389
- id: z.ZodUUID;
1390
- sequential_id: z.ZodInt;
1401
+ server_id: z.ZodUUID;
1402
+ client_id: z.ZodUUID;
1403
+ display_seq: z.ZodInt;
1391
1404
  created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
1392
1405
  updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
1393
1406
  published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
@@ -1521,8 +1534,9 @@ export declare const GetReportsIdSchema: {
1521
1534
  method: ApiRestMethod;
1522
1535
  payload: z.ZodNever;
1523
1536
  response: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
1524
- id: z.ZodUUID;
1525
- sequential_id: z.ZodInt;
1537
+ server_id: z.ZodUUID;
1538
+ client_id: z.ZodUUID;
1539
+ display_seq: z.ZodInt;
1526
1540
  created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
1527
1541
  updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
1528
1542
  published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
@@ -1649,8 +1663,9 @@ export declare const GetReportsIdSchema: {
1649
1663
  }, z.core.$strip>>;
1650
1664
  }, z.core.$strip>;
1651
1665
  }, z.core.$strip>>>, z.ZodTransform<{
1652
- id: string;
1653
- sequential_id: number;
1666
+ server_id: string;
1667
+ client_id: string;
1668
+ display_seq: number;
1654
1669
  created_at: string;
1655
1670
  updated_at: string;
1656
1671
  published_at: string | null;
@@ -1704,8 +1719,9 @@ export declare const GetReportsIdSchema: {
1704
1719
  }[];
1705
1720
  };
1706
1721
  } | null, {
1707
- id: string;
1708
- sequential_id: number;
1722
+ server_id: string;
1723
+ client_id: string;
1724
+ display_seq: number;
1709
1725
  created_at: string;
1710
1726
  updated_at: string;
1711
1727
  published_at: string | null;
@@ -98,8 +98,9 @@ export declare const ReportContentSchema: z.ZodObject<{
98
98
  cover_image_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
99
99
  }, z.core.$strip>;
100
100
  export declare const ReportSchema: z.ZodObject<{
101
- id: z.ZodUUID;
102
- sequential_id: z.ZodInt;
101
+ server_id: z.ZodUUID;
102
+ client_id: z.ZodUUID;
103
+ display_seq: z.ZodInt;
103
104
  created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
104
105
  updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
105
106
  published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
@@ -1,2 +1,3 @@
1
1
  export * from './api';
2
2
  export * from './base';
3
+ export * from './legacy';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@assemblis/contracts",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -31,15 +31,15 @@ export const PostAccountReportsSchema = {
31
31
  endpoint: (): AccountEndpoint => ApiEndpoint.ACCOUNT_REPORTS,
32
32
  method: ApiRestMethod.POST,
33
33
  payload: z.object({
34
- sequential_id: z.int(),
34
+ client_id: z.uuid(),
35
35
  content: maybe(ReportContentSchema.omit({ cover_image_id: true }))
36
36
  }),
37
37
  response: ReportSchema
38
38
  };
39
39
 
40
40
  export const PutAccountReportsIdContentSchema = {
41
- endpoint: (reportId: string): AccountEndpoint =>
42
- `${ApiEndpoint.ACCOUNT_REPORTS}/${reportId}/content`,
41
+ endpoint: (clientId: string): AccountEndpoint =>
42
+ `${ApiEndpoint.ACCOUNT_REPORTS}/${clientId}/content`,
43
43
  method: ApiRestMethod.PUT,
44
44
  payload: ReportContentSchema.omit({
45
45
  published_at: true,
@@ -49,32 +49,32 @@ export const PutAccountReportsIdContentSchema = {
49
49
  };
50
50
 
51
51
  export const PatchAccountReportsIdDiscardSchema = {
52
- endpoint: (reportId: string): AccountEndpoint =>
53
- `${ApiEndpoint.ACCOUNT_REPORTS}/${reportId}/discard`,
52
+ endpoint: (clientId: string): AccountEndpoint =>
53
+ `${ApiEndpoint.ACCOUNT_REPORTS}/${clientId}/discard`,
54
54
  method: ApiRestMethod.PATCH,
55
55
  payload: z.nullish(z.object()),
56
56
  response: maybe(ReportSchema)
57
57
  };
58
58
 
59
59
  export const PatchAccountReportsIdPublishSchema = {
60
- endpoint: (reportId: string): AccountEndpoint =>
61
- `${ApiEndpoint.ACCOUNT_REPORTS}/${reportId}/publish`,
60
+ endpoint: (clientId: string): AccountEndpoint =>
61
+ `${ApiEndpoint.ACCOUNT_REPORTS}/${clientId}/publish`,
62
62
  method: ApiRestMethod.PATCH,
63
63
  payload: z.object({ published_at: isoDateString }),
64
64
  response: ReportSchema
65
65
  };
66
66
 
67
67
  export const PatchAccountReportsIdUnpublishSchema = {
68
- endpoint: (reportId: string): AccountEndpoint =>
69
- `${ApiEndpoint.ACCOUNT_REPORTS}/${reportId}/unpublish`,
68
+ endpoint: (clientId: string): AccountEndpoint =>
69
+ `${ApiEndpoint.ACCOUNT_REPORTS}/${clientId}/unpublish`,
70
70
  method: ApiRestMethod.PATCH,
71
71
  payload: z.nullish(z.object()),
72
72
  response: ReportSchema
73
73
  };
74
74
 
75
75
  export const PostAccountReportsIdCoverImageSchema = {
76
- endpoint: (reportId: string): AccountEndpoint =>
77
- `${ApiEndpoint.ACCOUNT_REPORTS}/${reportId}/cover-image`,
76
+ endpoint: (clientId: string): AccountEndpoint =>
77
+ `${ApiEndpoint.ACCOUNT_REPORTS}/${clientId}/cover-image`,
78
78
  method: ApiRestMethod.POST,
79
79
  payload: ImageSchema.pick({ alt: true }),
80
80
  response: ReportSchema
@@ -100,8 +100,9 @@ export const ReportContentSchema = z.object({
100
100
  });
101
101
 
102
102
  export const ReportSchema = z.object({
103
- id: z.uuid(),
104
- sequential_id: z.int(),
103
+ server_id: z.uuid(),
104
+ client_id: z.uuid(),
105
+ display_seq: z.int(),
105
106
  created_at: isoDateString,
106
107
  updated_at: isoDateString,
107
108
  published_at: maybe(isoDateString),
@@ -1,2 +1,3 @@
1
1
  export * from './api';
2
2
  export * from './base';
3
+ export * from './legacy';