@assemblis/contracts 0.1.10 → 0.1.12

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;!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.DELIBERATION="deliberation",e.DEMOGRAPHIC_DATA="demographic-data",e.PRE_ASSEMBLY="pre-assembly",e.POST_ASSEMBLY="post-assembly"}(n||(n={}));const o=e.coerce.date().transform(e=>e.toISOString()),i=e=>e.nullish().transform(e=>e??null),s=e.object({id:e.uuid(),created_at:o,updated_at:o,uri:e.string(),alt:e.string(),src:e.string(),sizes:e.string(),srcset:e.string()}),d=e.object({label:e.string(),value:e.coerce.number().int()}),c=e.object({published_at:i(o),title:i(e.string()),description:i(e.string()),location:i(e.string()),outputs:i(e.string().array()),initiation_type:i(e.string()),recruitment_method:i(e.string()),recruitment_description:i(e.string()),participant_count:i(e.int()),organiser_reflections:i(e.string()),organiser_report_url:i(e.string()),location_details:i(e.string()),date:i(e.string()),duration:i(e.int()),contact_information_url:i(e.string()),cover_image_id:i(e.string())}),p=e.object({id:e.uuid(),created_at:o,updated_at:o,published_at:i(o),state:e.enum(["DISCARDED","DRAFTED","PUBLISHED","CHANGED"]),viewer_password:e.string(),draft_content:i(c),published_content:i(c),media:e.object({images:s.array()})});e.object({id:e.uuid(),created_at:o,updated_at:o,sub:e.string(),is_mutirao:e.boolean()});const u={endpoint:()=>r.ACCOUNT_REPORTS,method:t.GET,payload:e.never(),response:e.object({reports:p.array()})},_={endpoint:e=>`${r.ACCOUNT_REPORTS}/${e}`,method:t.GET,payload:e.never(),response:p},l={endpoint:()=>r.ACCOUNT_REPORTS,method:t.POST,payload:i(c.omit({cover_image_id:!0})),response:p},b={endpoint:e=>`${r.ACCOUNT_REPORTS}/${e}/content`,method:t.PUT,payload:c.omit({published_at:!0,cover_image_id:!0}),response:p},g={endpoint:e=>`${r.ACCOUNT_REPORTS}/${e}/discard`,method:t.PATCH,payload:e.nullish(e.object()),response:i(p)},m={endpoint:e=>`${r.ACCOUNT_REPORTS}/${e}/publish`,method:t.PATCH,payload:e.object({published_at:o}),response:p},y={endpoint:e=>`${r.ACCOUNT_REPORTS}/${e}/unpublish`,method:t.PATCH,payload:e.nullish(e.object()),response:p},S={endpoint:e=>`${r.ACCOUNT_REPORTS}/${e}/cover-image`,method:t.POST,payload:s.pick({alt:!0}),response:p},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()}),E={payload:e.undefined(),response:e.object({id:e.uuid(),created_at:o,updated_at:o,name:e.string(),sections:e.object({primary:O,secondary:O.array(),options:d.array()}).array()})},A={payload:e.object({answers:e.object({question_id:e.uuid(),answer_value:e.coerce.number().int()}).array()}),response:e.object({total:e.number().int()})},R=e.object({visible_on_profile:e.boolean(),description:i(e.string())}),x=e.object({text:e.string(),agreed:i(e.coerce.number().int()),against:i(e.coerce.number().int()),abstained:i(e.coerce.number().int()),include_in_action_plan:e.boolean().default(!0),assembly_id:e.uuid()}),h=e.object({text:e.string(),complete:e.boolean().default(!1),action_id:e.uuid(),assembly_id:e.uuid()}),v=e.object({published_at:i(o),name:e.string(),about:i(e.string()),topics:e.string().array(),country:i(e.string()),hide:e.boolean().default(!1)}),C={payload:v,response:v.extend({id:e.uuid(),created_at:o,updated_at:o,image_src:i(e.string()),has_image:e.boolean().meta({deprecated:!0}),user_id:e.uuid().meta({deprecated:!0})})},P={payload:e.undefined(),response:e.object({assemblies:C.response.array()})},I=e.object({visible_on_profile:e.boolean(),name:i(e.string()),description:i(e.string()),type:i(e.string())}),N=e.object({visible_on_profile:e.boolean(),registration_link:i(e.string()),start_date:i(o)}),U=e.object({visible_on_profile:e.boolean(),background:i(e.string())}),D=e.object({visible_on_profile:e.boolean(),organisation_types:e.string().array(),description:i(e.string())}),$=e.object({visible_on_profile:e.boolean(),organisation_types:e.string().array(),description:i(e.string())}),k=e.object({visible_on_profile:e.boolean(),decision_method:i(e.string())}),w=e.object({visible_on_profile:e.boolean(),recruitment_method:i(e.string()),community:i(e.string())}),M=e.object({visible_on_profile:e.boolean(),support_options:e.string().array()}),H=e.object({visible_on_profile:e.boolean()}),B={payload:C.payload.extend({organisation:i(I.extend({id:e.uuid().optional()})),event_details:i(N),story:i(U),supporters:i(D),funders:i($),facilitation:i(k),participants:i(w),support:i(M),action_plan:i(R.extend({actions:x.omit({assembly_id:!0}).extend({id:e.uuid().optional(),tasks:h.omit({action_id:!0,assembly_id:!0}).extend({id:e.uuid().optional()}).array(),updates:e.unknown().array()}).array(),updates:e.unknown().array()})),surveys:i(H)}),response:C.response.omit({user_id:!0}).extend({is_own:e.boolean(),organisation:i(I.extend({id:e.uuid(),created_at:o,updated_at:o})),event_details:i(N.extend({created_at:o,updated_at:o})),story:i(U.extend({created_at:o,updated_at:o})),supporters:i(D.extend({created_at:o,updated_at:o})),funders:i($.extend({created_at:o,updated_at:o})),facilitation:i(k.extend({created_at:o,updated_at:o})),participants:i(w.extend({created_at:o,updated_at:o})),support:i(M.extend({created_at:o,updated_at:o})),action_plan:i(R.extend({actions:x.omit({assembly_id:!0}).extend({id:e.uuid(),created_at:o,updated_at:e.coerce.date().transform(e=>e.toISOString()),tasks:h.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:i(H.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(),d.array())}))}))})},G={payload:e.object({country:e.string(),email:e.string(),text:i(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:i(e.string()),hide:e.boolean(),image_src:i(e.string()),has_image:e.boolean().meta({deprecated:!0})})},L={payload:e.undefined(),response:e.object({assemblies:C.response.array(),pins:G.response.array()})};export{r as ApiEndpoint,t as ApiRestMethod,a as ApiRouteParameter,P as AssembliesListSchema,B as AssemblyDetailSchema,C as AssemblyOverviewSchema,T as FeedbackSchema,_ as GetAccountReportsIdSchema,u as GetAccountReportsSchema,f as LogSchema,g as PatchAccountReportsIdDiscardSchema,m as PatchAccountReportsIdPublishSchema,y as PatchAccountReportsIdUnpublishSchema,L as PinListSchema,G as PinSchema,S as PostAccountReportsIdCoverImageSchema,l as PostAccountReportsSchema,b as PutAccountReportsIdContentSchema,j as RegisterSchema,n as SurveyName,A as SurveyResponseSchema,E as SurveySchema};
1
+ import e from"zod";var t,a,r,n;!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.DELIBERATION="deliberation",e.DEMOGRAPHIC_DATA="demographic-data",e.PRE_ASSEMBLY="pre-assembly",e.POST_ASSEMBLY="post-assembly"}(n||(n={}));const o=e.coerce.date().transform(e=>e.toISOString()),i=e=>e.nullish().transform(e=>e??null),s=e.object({id:e.uuid(),created_at:o,updated_at:o,uri:e.string(),alt:e.string(),src:e.string(),sizes:e.string(),srcset:e.string()}),d=e.object({label:e.string(),value:e.coerce.number().int()}),c=e.object({published_at:i(o),title:i(e.string()),description:i(e.string()),location:i(e.string()),outputs:i(e.string().array()),initiation_type:i(e.string()),recruitment_method:i(e.string()),recruitment_description:i(e.string()),participant_count:i(e.int()),organiser_reflections:i(e.string()),organiser_report_url:i(e.string()),location_details:i(e.string()),date:i(e.string()),duration:i(e.int()),contact_information_url:i(e.string()),cover_image_id:i(e.string())}),p=e.object({id:e.uuid(),created_at:o,updated_at:o,published_at:i(o),state:e.enum(["DISCARDED","DRAFTED","PUBLISHED","CHANGED"]),viewer_password:e.string(),draft_content:i(c),published_content:i(c),media:e.object({images:s.array()})});e.object({id:e.uuid(),created_at:o,updated_at:o,sub:e.string(),is_mutirao:e.boolean()});const u={endpoint:()=>r.ACCOUNT_REPORTS,method:t.GET,payload:e.never(),response:e.object({reports:p.array()})},_={endpoint:e=>`${r.ACCOUNT_REPORTS}/${e}`,method:t.GET,payload:e.never(),response:i(p)},l={endpoint:()=>r.ACCOUNT_REPORTS,method:t.POST,payload:i(c.omit({cover_image_id:!0})),response:p},b={endpoint:e=>`${r.ACCOUNT_REPORTS}/${e}/content`,method:t.PUT,payload:c.omit({published_at:!0,cover_image_id:!0}),response:p},g={endpoint:e=>`${r.ACCOUNT_REPORTS}/${e}/discard`,method:t.PATCH,payload:e.nullish(e.object()),response:i(p)},m={endpoint:e=>`${r.ACCOUNT_REPORTS}/${e}/publish`,method:t.PATCH,payload:e.object({published_at:o}),response:p},y={endpoint:e=>`${r.ACCOUNT_REPORTS}/${e}/unpublish`,method:t.PATCH,payload:e.nullish(e.object()),response:p},S={endpoint:e=>`${r.ACCOUNT_REPORTS}/${e}/cover-image`,method:t.POST,payload:s.pick({alt:!0}),response:p},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()}),E={payload:e.undefined(),response:e.object({id:e.uuid(),created_at:o,updated_at:o,name:e.string(),sections:e.object({primary:O,secondary:O.array(),options:d.array()}).array()})},A={payload:e.object({answers:e.object({question_id:e.uuid(),answer_value:e.coerce.number().int()}).array()}),response:e.object({total:e.number().int()})},R=e.object({visible_on_profile:e.boolean(),description:i(e.string())}),x=e.object({text:e.string(),agreed:i(e.coerce.number().int()),against:i(e.coerce.number().int()),abstained:i(e.coerce.number().int()),include_in_action_plan:e.boolean().default(!0),assembly_id:e.uuid()}),h=e.object({text:e.string(),complete:e.boolean().default(!1),action_id:e.uuid(),assembly_id:e.uuid()}),v=e.object({published_at:i(o),name:e.string(),about:i(e.string()),topics:e.string().array(),country:i(e.string()),hide:e.boolean().default(!1)}),C={payload:v,response:v.extend({id:e.uuid(),created_at:o,updated_at:o,image_src:i(e.string()),has_image:e.boolean().meta({deprecated:!0}),user_id:e.uuid().meta({deprecated:!0})})},P={payload:e.undefined(),response:e.object({assemblies:C.response.array()})},I=e.object({visible_on_profile:e.boolean(),name:i(e.string()),description:i(e.string()),type:i(e.string())}),N=e.object({visible_on_profile:e.boolean(),registration_link:i(e.string()),start_date:i(o)}),U=e.object({visible_on_profile:e.boolean(),background:i(e.string())}),D=e.object({visible_on_profile:e.boolean(),organisation_types:e.string().array(),description:i(e.string())}),$=e.object({visible_on_profile:e.boolean(),organisation_types:e.string().array(),description:i(e.string())}),k=e.object({visible_on_profile:e.boolean(),decision_method:i(e.string())}),w=e.object({visible_on_profile:e.boolean(),recruitment_method:i(e.string()),community:i(e.string())}),M=e.object({visible_on_profile:e.boolean(),support_options:e.string().array()}),H=e.object({visible_on_profile:e.boolean()}),B={payload:C.payload.extend({organisation:i(I.extend({id:e.uuid().optional()})),event_details:i(N),story:i(U),supporters:i(D),funders:i($),facilitation:i(k),participants:i(w),support:i(M),action_plan:i(R.extend({actions:x.omit({assembly_id:!0}).extend({id:e.uuid().optional(),tasks:h.omit({action_id:!0,assembly_id:!0}).extend({id:e.uuid().optional()}).array(),updates:e.unknown().array()}).array(),updates:e.unknown().array()})),surveys:i(H)}),response:C.response.omit({user_id:!0}).extend({is_own:e.boolean(),organisation:i(I.extend({id:e.uuid(),created_at:o,updated_at:o})),event_details:i(N.extend({created_at:o,updated_at:o})),story:i(U.extend({created_at:o,updated_at:o})),supporters:i(D.extend({created_at:o,updated_at:o})),funders:i($.extend({created_at:o,updated_at:o})),facilitation:i(k.extend({created_at:o,updated_at:o})),participants:i(w.extend({created_at:o,updated_at:o})),support:i(M.extend({created_at:o,updated_at:o})),action_plan:i(R.extend({actions:x.omit({assembly_id:!0}).extend({id:e.uuid(),created_at:o,updated_at:e.coerce.date().transform(e=>e.toISOString()),tasks:h.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:i(H.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(),d.array())}))}))})},G={payload:e.object({country:e.string(),email:e.string(),text:i(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:i(e.string()),hide:e.boolean(),image_src:i(e.string()),has_image:e.boolean().meta({deprecated:!0})})},L={payload:e.undefined(),response:e.object({assemblies:C.response.array(),pins:G.response.array()})};export{r as ApiEndpoint,t as ApiRestMethod,a as ApiRouteParameter,P as AssembliesListSchema,B as AssemblyDetailSchema,C as AssemblyOverviewSchema,T as FeedbackSchema,_ as GetAccountReportsIdSchema,u as GetAccountReportsSchema,f as LogSchema,g as PatchAccountReportsIdDiscardSchema,m as PatchAccountReportsIdPublishSchema,y as PatchAccountReportsIdUnpublishSchema,L as PinListSchema,G as PinSchema,S as PostAccountReportsIdCoverImageSchema,l as PostAccountReportsSchema,b as PutAccountReportsIdContentSchema,j as RegisterSchema,n as SurveyName,A as SurveyResponseSchema,E as SurveySchema};
@@ -141,7 +141,7 @@ export declare const GetAccountReportsIdSchema: {
141
141
  endpoint: (reportId: string) => AccountEndpoint;
142
142
  method: ApiRestMethod;
143
143
  payload: z.ZodNever;
144
- response: z.ZodObject<{
144
+ response: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
145
145
  id: z.ZodUUID;
146
146
  created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
147
147
  updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
@@ -269,7 +269,117 @@ export declare const GetAccountReportsIdSchema: {
269
269
  srcset: z.ZodString;
270
270
  }, z.core.$strip>>;
271
271
  }, z.core.$strip>;
272
- }, z.core.$strip>;
272
+ }, z.core.$strip>>>, z.ZodTransform<{
273
+ id: string;
274
+ created_at: string;
275
+ updated_at: string;
276
+ published_at: string | null;
277
+ state: "DISCARDED" | "DRAFTED" | "PUBLISHED" | "CHANGED";
278
+ viewer_password: string;
279
+ draft_content: {
280
+ published_at: string | null;
281
+ title: string | null;
282
+ description: string | null;
283
+ location: string | null;
284
+ outputs: string[] | null;
285
+ initiation_type: string | null;
286
+ recruitment_method: string | null;
287
+ recruitment_description: string | null;
288
+ participant_count: number | null;
289
+ organiser_reflections: string | null;
290
+ organiser_report_url: string | null;
291
+ location_details: string | null;
292
+ date: string | null;
293
+ duration: number | null;
294
+ contact_information_url: string | null;
295
+ cover_image_id: string | null;
296
+ } | null;
297
+ published_content: {
298
+ published_at: string | null;
299
+ title: string | null;
300
+ description: string | null;
301
+ location: string | null;
302
+ outputs: string[] | null;
303
+ initiation_type: string | null;
304
+ recruitment_method: string | null;
305
+ recruitment_description: string | null;
306
+ participant_count: number | null;
307
+ organiser_reflections: string | null;
308
+ organiser_report_url: string | null;
309
+ location_details: string | null;
310
+ date: string | null;
311
+ duration: number | null;
312
+ contact_information_url: string | null;
313
+ cover_image_id: string | null;
314
+ } | null;
315
+ media: {
316
+ images: {
317
+ id: string;
318
+ created_at: string;
319
+ updated_at: string;
320
+ uri: string;
321
+ alt: string;
322
+ src: string;
323
+ sizes: string;
324
+ srcset: string;
325
+ }[];
326
+ };
327
+ } | null, {
328
+ id: string;
329
+ created_at: string;
330
+ updated_at: string;
331
+ published_at: string | null;
332
+ state: "DISCARDED" | "DRAFTED" | "PUBLISHED" | "CHANGED";
333
+ viewer_password: string;
334
+ draft_content: {
335
+ published_at: string | null;
336
+ title: string | null;
337
+ description: string | null;
338
+ location: string | null;
339
+ outputs: string[] | null;
340
+ initiation_type: string | null;
341
+ recruitment_method: string | null;
342
+ recruitment_description: string | null;
343
+ participant_count: number | null;
344
+ organiser_reflections: string | null;
345
+ organiser_report_url: string | null;
346
+ location_details: string | null;
347
+ date: string | null;
348
+ duration: number | null;
349
+ contact_information_url: string | null;
350
+ cover_image_id: string | null;
351
+ } | null;
352
+ published_content: {
353
+ published_at: string | null;
354
+ title: string | null;
355
+ description: string | null;
356
+ location: string | null;
357
+ outputs: string[] | null;
358
+ initiation_type: string | null;
359
+ recruitment_method: string | null;
360
+ recruitment_description: string | null;
361
+ participant_count: number | null;
362
+ organiser_reflections: string | null;
363
+ organiser_report_url: string | null;
364
+ location_details: string | null;
365
+ date: string | null;
366
+ duration: number | null;
367
+ contact_information_url: string | null;
368
+ cover_image_id: string | null;
369
+ } | null;
370
+ media: {
371
+ images: {
372
+ id: string;
373
+ created_at: string;
374
+ updated_at: string;
375
+ uri: string;
376
+ alt: string;
377
+ src: string;
378
+ sizes: string;
379
+ srcset: string;
380
+ }[];
381
+ };
382
+ } | null | undefined>>;
273
383
  };
274
384
  export declare const PostAccountReportsSchema: {
275
385
  endpoint: () => AccountEndpoint;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@assemblis/contracts",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",