@assemblis/contracts 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/schemas/api.d.ts +1 -0
- package/dist/schemas/base.d.ts +131 -0
- package/dist/types/types.d.ts +2 -1
- package/package.json +1 -1
- package/src/schemas/api.ts +2 -1
- package/src/schemas/base.ts +4 -0
- package/src/types/types.ts +2 -0
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"zod";var t,n,o;!function(e){e.ACCOUNT="/account",e.ACCOUNT_REPORTS="/account/reports",e.ADMIN="/admin",e.ADMIN_HEALTHCHECK="/admin/healthcheck",e.ADMIN_PINS="/admin/pins",e.ADMIN_REPORTS="/admin/reports",e.ADMIN_USERS="/admin/users",e.INTEREST="/interest",e.LOGS="/logs",e.PING="/ping",e.PINS="/pins",e.REGISTER="/register",e.REPORTS="/reports"}(t||(t={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.PATCH="PATCH"}(n||(n={})),function(e){e.DISCARDED="DISCARDED",e.DRAFTED="DRAFT",e.PUBLISHED="PUBLISHED",e.CHANGED="CHANGED"}(o||(o={}));const i=e.coerce.date().transform(e=>e.toISOString()),r=e=>e.nullish().transform(e=>e??null);function a(e,t){return Object.keys(t).reduce((e,n)=>e.replace(`:${n}`,t[n]),e)}const s=e.object({id:e.uuid(),created_at:i,updated_at:i,alt:e.string(),srcset:e.string(),width:e.int(),height:e.int()}),d=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),has_assemblis_account:e.boolean().nullish().transform(e=>e??!1)}),p=e.object({published_at:r(i),title:r(e.string()),description:r(e.string()),location:r(e.string()),outputs:r(e.string().array()),initiation_type:r(e.string()),recruitment_method:r(e.string()),recruitment_description:r(e.string()),participant_count:r(e.int()),organiser_reflections:r(e.string()),organiser_report_url:r(e.string()),location_details:r(e.string()),date:r(e.string()),duration:r(e.int()),contact_information_url:r(e.string()),cover_image_id:r(e.string())}),l=e.object({server_id:e.uuid(),client_id:e.uuid(),display_seq:e.int(),created_at:i,updated_at:i,published_at:r(i),state:e.enum(["DISCARDED","DRAFTED","PUBLISHED","CHANGED"]),slug:r(e.string()),draft_content:r(p),published_content:r(p),media:e.object({images:s.array()})});e.object({id:e.uuid(),created_at:i,updated_at:i,sub:e.string(),is_mutirao:e.boolean()});const
|
|
1
|
+
import e from"zod";var t,n,o;!function(e){e.ACCOUNT="/account",e.ACCOUNT_REPORTS="/account/reports",e.ADMIN="/admin",e.ADMIN_HEALTHCHECK="/admin/healthcheck",e.ADMIN_PINS="/admin/pins",e.ADMIN_REPORTS="/admin/reports",e.ADMIN_USERS="/admin/users",e.INTEREST="/interest",e.LOGS="/logs",e.PING="/ping",e.PINS="/pins",e.REGISTER="/register",e.REPORTS="/reports"}(t||(t={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.PATCH="PATCH"}(n||(n={})),function(e){e.DISCARDED="DISCARDED",e.DRAFTED="DRAFT",e.PUBLISHED="PUBLISHED",e.CHANGED="CHANGED"}(o||(o={}));const i=e.coerce.date().transform(e=>e.toISOString()),r=e=>e.nullish().transform(e=>e??null);function a(e,t){return Object.keys(t).reduce((e,n)=>e.replace(`:${n}`,t[n]),e)}const s=e.object({id:e.uuid(),created_at:i,updated_at:i,alt:e.string(),srcset:e.string(),width:e.int(),height:e.int()}),d=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),has_assemblis_account:e.boolean().nullish().transform(e=>e??!1)}),p=e.object({published_at:r(i),title:r(e.string()),description:r(e.string()),location:r(e.string()),outputs:r(e.string().array()),initiation_type:r(e.string()),recruitment_method:r(e.string()),recruitment_description:r(e.string()),participant_count:r(e.int()),organiser_reflections:r(e.string()),organiser_report_url:r(e.string()),location_details:r(e.string()),date:r(e.string()),duration:r(e.int()),contact_information_url:r(e.string()),cover_image_id:r(e.string())}),l=e.object({server_id:e.uuid(),client_id:e.uuid(),display_seq:e.int(),created_at:i,updated_at:i,published_at:r(i),state:e.enum(["DISCARDED","DRAFTED","PUBLISHED","CHANGED"]),slug:r(e.string()),draft_content:r(p),published_content:r(p),media:e.object({images:s.array()})}),c=l.extend({creator_id:e.uuid()});e.object({id:e.uuid(),created_at:i,updated_at:i,sub:e.string(),is_mutirao:e.boolean()});const u=e.object({id:e.uuid(),sub:e.string(),created_at:i,updated_at:i,report_count:e.int(),email:r(e.string())}),m=e.object({id:e.uuid(),created_at:i,updated_at:i,image_src:r(e.string()),has_image:e.boolean().meta({deprecated:!0}),user_id:e.uuid().meta({deprecated:!0}),published_at:r(i),name:e.string(),about:r(e.string()),topics:e.string().array(),country:r(e.string()),hide:e.boolean().default(!1)}),_=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:r(e.string()),hide:e.boolean(),image_src:r(e.string()),has_image:e.boolean().meta({deprecated:!0})}),g=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()})}),T=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()})}),h={endpoint:t.ACCOUNT_REPORTS,method:n.GET,payload:e.never(),response:e.object({reports:l.array(),total:e.int()})},b={endpoint:`${t.ACCOUNT_REPORTS}/:client_id`,method:n.GET,payload:e.never(),response:r(l)},S={endpoint:t.ACCOUNT_REPORTS,method:n.POST,payload:e.object({client_id:e.uuid(),content:r(p.omit({cover_image_id:!0}))}),response:l},E={endpoint:`${t.ACCOUNT_REPORTS}/:client_id/content`,method:n.PUT,payload:p.omit({published_at:!0,cover_image_id:!0}),response:l},y={endpoint:`${t.ACCOUNT_REPORTS}/:client_id/discard`,method:n.PATCH,payload:e.nullish(e.object()),response:r(l)},P={endpoint:`${t.ACCOUNT_REPORTS}/:client_id/publish`,method:n.PATCH,payload:e.object({published_at:i}),response:l},R={endpoint:`${t.ACCOUNT_REPORTS}/:client_id/unpublish`,method:n.PATCH,payload:e.nullish(e.object()),response:l},O={endpoint:`${t.ACCOUNT_REPORTS}/:client_id/cover-image`,method:n.POST,payload:s.pick({alt:!0}),response:l},A={endpoint:t.INTEREST,method:n.POST,payload:d,response:e.string()},C={endpoint:`${t.INTEREST}/assemblis`,method:n.POST,payload:d.omit({listIds:!0}),response:e.string()},I={endpoint:t.REPORTS,method:n.GET,payload:e.never(),response:e.object({reports:l.array(),total:e.int()})},N={endpoint:`${t.REPORTS}/:slug`,method:n.GET,payload:e.never(),response:r(l)},D={endpoint:t.PINS,method:n.GET,payload:e.never(),response:e.object({assemblies:m.array(),pins:_.array()})},j={endpoint:t.PINS,method:n.POST,payload:e.object({country:e.string(),email:e.string(),text:r(e.string())}),response:_},v={endpoint:t.ADMIN_REPORTS,method:n.GET,payload:e.never(),response:e.object({reports:c.array(),total:e.int()})},G={endpoint:t.ADMIN_USERS,method:n.GET,payload:e.never(),response:e.object({users:u.array(),total:e.int()})},f={endpoint:t.ADMIN_PINS,method:n.GET,payload:e.never(),response:e.object({pins:_.array()})},H={endpoint:`${t.ADMIN_PINS}/:id/hide`,method:n.PATCH,payload:e.never(),response:_},U={endpoint:t.ADMIN_HEALTHCHECK,method:n.GET,payload:e.never(),response:e.object({commit_hash:e.string().nullable(),deployed_at:e.string().nullable(),uptime_ms:e.int().nullable(),checks:e.object({database:e.enum(["ok","error"]),clerk:e.enum(["ok","error"])})})},$={endpoint:t.PING,method:n.GET,payload:e.never(),response:e.never()},M={endpoint:`${t.LOGS}/info`,method:n.POST,payload:g,response:e.string()},L={endpoint:`${t.LOGS}/error`,method:n.POST,payload:g,response:e.string()},k={endpoint:t.REGISTER,method:n.POST,payload:T,response:e.string()};export{t as ApiEndpoint,n as ApiRestMethod,b as GetAccountReportsIdSchema,h as GetAccountReportsSchema,U as GetAdminHealthcheckSchema,f as GetAdminPinsSchema,v as GetAdminReportsSchema,G as GetAdminUsersSchema,$ as GetPingSchema,D as GetPinsSchema,I as GetReportsSchema,N as GetReportsSlugSchema,y as PatchAccountReportsIdDiscardSchema,P as PatchAccountReportsIdPublishSchema,R as PatchAccountReportsIdUnpublishSchema,H as PatchAdminPinHideSchema,O as PostAccountReportsIdCoverImageSchema,S as PostAccountReportsSchema,C as PostInterestAssemblisSchema,A as PostInterestSchema,L as PostLogsErrorSchema,M as PostLogsInfoSchema,j as PostPinSchema,k as PostRegisterSchema,E as PutAccountReportsIdContentSchema,o as ReportState,a as resolvePath};
|
package/dist/schemas/api.d.ts
CHANGED
package/dist/schemas/base.d.ts
CHANGED
|
@@ -166,6 +166,137 @@ export declare const ReportSchema: z.ZodObject<{
|
|
|
166
166
|
}, z.core.$strip>>;
|
|
167
167
|
}, z.core.$strip>;
|
|
168
168
|
}, z.core.$strip>;
|
|
169
|
+
export declare const AdminReportSchema: z.ZodObject<{
|
|
170
|
+
server_id: z.ZodUUID;
|
|
171
|
+
client_id: z.ZodUUID;
|
|
172
|
+
display_seq: z.ZodInt;
|
|
173
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
174
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
175
|
+
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
176
|
+
state: z.ZodEnum<{
|
|
177
|
+
DISCARDED: "DISCARDED";
|
|
178
|
+
PUBLISHED: "PUBLISHED";
|
|
179
|
+
CHANGED: "CHANGED";
|
|
180
|
+
DRAFTED: "DRAFTED";
|
|
181
|
+
}>;
|
|
182
|
+
slug: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
183
|
+
draft_content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
184
|
+
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
185
|
+
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
186
|
+
description: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
187
|
+
location: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
188
|
+
outputs: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[] | null, string[] | null | undefined>>;
|
|
189
|
+
initiation_type: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
190
|
+
recruitment_method: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
191
|
+
recruitment_description: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
192
|
+
participant_count: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodInt>>, z.ZodTransform<number | null, number | null | undefined>>;
|
|
193
|
+
organiser_reflections: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
194
|
+
organiser_report_url: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
195
|
+
location_details: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
196
|
+
date: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
197
|
+
duration: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodInt>>, z.ZodTransform<number | null, number | null | undefined>>;
|
|
198
|
+
contact_information_url: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
199
|
+
cover_image_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
200
|
+
}, z.core.$strip>>>, z.ZodTransform<{
|
|
201
|
+
published_at: string | null;
|
|
202
|
+
title: string | null;
|
|
203
|
+
description: string | null;
|
|
204
|
+
location: string | null;
|
|
205
|
+
outputs: string[] | null;
|
|
206
|
+
initiation_type: string | null;
|
|
207
|
+
recruitment_method: string | null;
|
|
208
|
+
recruitment_description: string | null;
|
|
209
|
+
participant_count: number | null;
|
|
210
|
+
organiser_reflections: string | null;
|
|
211
|
+
organiser_report_url: string | null;
|
|
212
|
+
location_details: string | null;
|
|
213
|
+
date: string | null;
|
|
214
|
+
duration: number | null;
|
|
215
|
+
contact_information_url: string | null;
|
|
216
|
+
cover_image_id: string | null;
|
|
217
|
+
} | null, {
|
|
218
|
+
published_at: string | null;
|
|
219
|
+
title: string | null;
|
|
220
|
+
description: string | null;
|
|
221
|
+
location: string | null;
|
|
222
|
+
outputs: string[] | null;
|
|
223
|
+
initiation_type: string | null;
|
|
224
|
+
recruitment_method: string | null;
|
|
225
|
+
recruitment_description: string | null;
|
|
226
|
+
participant_count: number | null;
|
|
227
|
+
organiser_reflections: string | null;
|
|
228
|
+
organiser_report_url: string | null;
|
|
229
|
+
location_details: string | null;
|
|
230
|
+
date: string | null;
|
|
231
|
+
duration: number | null;
|
|
232
|
+
contact_information_url: string | null;
|
|
233
|
+
cover_image_id: string | null;
|
|
234
|
+
} | null | undefined>>;
|
|
235
|
+
published_content: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
236
|
+
published_at: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
237
|
+
title: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
238
|
+
description: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
239
|
+
location: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
240
|
+
outputs: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[] | null, string[] | null | undefined>>;
|
|
241
|
+
initiation_type: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
242
|
+
recruitment_method: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
243
|
+
recruitment_description: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
244
|
+
participant_count: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodInt>>, z.ZodTransform<number | null, number | null | undefined>>;
|
|
245
|
+
organiser_reflections: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
246
|
+
organiser_report_url: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
247
|
+
location_details: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
248
|
+
date: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
249
|
+
duration: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodInt>>, z.ZodTransform<number | null, number | null | undefined>>;
|
|
250
|
+
contact_information_url: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
251
|
+
cover_image_id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
252
|
+
}, z.core.$strip>>>, z.ZodTransform<{
|
|
253
|
+
published_at: string | null;
|
|
254
|
+
title: string | null;
|
|
255
|
+
description: string | null;
|
|
256
|
+
location: string | null;
|
|
257
|
+
outputs: string[] | null;
|
|
258
|
+
initiation_type: string | null;
|
|
259
|
+
recruitment_method: string | null;
|
|
260
|
+
recruitment_description: string | null;
|
|
261
|
+
participant_count: number | null;
|
|
262
|
+
organiser_reflections: string | null;
|
|
263
|
+
organiser_report_url: string | null;
|
|
264
|
+
location_details: string | null;
|
|
265
|
+
date: string | null;
|
|
266
|
+
duration: number | null;
|
|
267
|
+
contact_information_url: string | null;
|
|
268
|
+
cover_image_id: string | null;
|
|
269
|
+
} | null, {
|
|
270
|
+
published_at: string | null;
|
|
271
|
+
title: string | null;
|
|
272
|
+
description: string | null;
|
|
273
|
+
location: string | null;
|
|
274
|
+
outputs: string[] | null;
|
|
275
|
+
initiation_type: string | null;
|
|
276
|
+
recruitment_method: string | null;
|
|
277
|
+
recruitment_description: string | null;
|
|
278
|
+
participant_count: number | null;
|
|
279
|
+
organiser_reflections: string | null;
|
|
280
|
+
organiser_report_url: string | null;
|
|
281
|
+
location_details: string | null;
|
|
282
|
+
date: string | null;
|
|
283
|
+
duration: number | null;
|
|
284
|
+
contact_information_url: string | null;
|
|
285
|
+
cover_image_id: string | null;
|
|
286
|
+
} | null | undefined>>;
|
|
287
|
+
media: z.ZodObject<{
|
|
288
|
+
images: z.ZodArray<z.ZodObject<{
|
|
289
|
+
id: z.ZodUUID;
|
|
290
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
291
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
292
|
+
alt: z.ZodString;
|
|
293
|
+
srcset: z.ZodString;
|
|
294
|
+
width: z.ZodInt;
|
|
295
|
+
height: z.ZodInt;
|
|
296
|
+
}, z.core.$strip>>;
|
|
297
|
+
}, z.core.$strip>;
|
|
298
|
+
creator_id: z.ZodUUID;
|
|
299
|
+
}, z.core.$strip>;
|
|
169
300
|
export declare const UserSchema: z.ZodObject<{
|
|
170
301
|
id: z.ZodUUID;
|
|
171
302
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
-
import { AdminUserSchema, ImageSchema, PinSchema, ReportContentSchema, ReportSchema, UserSchema } from '../schemas/base';
|
|
2
|
+
import { AdminReportSchema, AdminUserSchema, ImageSchema, PinSchema, ReportContentSchema, ReportSchema, UserSchema } from '../schemas/base';
|
|
3
|
+
export type AdminReport = z.infer<typeof AdminReportSchema>;
|
|
3
4
|
export type AdminUser = z.infer<typeof AdminUserSchema>;
|
|
4
5
|
export type Image = z.infer<typeof ImageSchema>;
|
|
5
6
|
export type Pin = z.infer<typeof PinSchema>;
|
package/package.json
CHANGED
package/src/schemas/api.ts
CHANGED
|
@@ -3,6 +3,7 @@ import z from 'zod';
|
|
|
3
3
|
import { ApiEndpoint, ApiRestMethod } from '../types';
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
+
AdminReportSchema,
|
|
6
7
|
AdminUserSchema,
|
|
7
8
|
AssemblySchema,
|
|
8
9
|
ImageSchema,
|
|
@@ -134,7 +135,7 @@ export const GetAdminReportsSchema = {
|
|
|
134
135
|
method: ApiRestMethod.GET,
|
|
135
136
|
payload: z.never(),
|
|
136
137
|
response: z.object({
|
|
137
|
-
reports:
|
|
138
|
+
reports: AdminReportSchema.array(),
|
|
138
139
|
total: z.int()
|
|
139
140
|
})
|
|
140
141
|
};
|
package/src/schemas/base.ts
CHANGED
|
@@ -73,6 +73,10 @@ export const ReportSchema = z.object({
|
|
|
73
73
|
media: z.object({ images: ImageSchema.array() })
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
+
export const AdminReportSchema = ReportSchema.extend({
|
|
77
|
+
creator_id: z.uuid()
|
|
78
|
+
});
|
|
79
|
+
|
|
76
80
|
export const UserSchema = z.object({
|
|
77
81
|
id: z.uuid(),
|
|
78
82
|
created_at: isoDateString,
|
package/src/types/types.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
+
AdminReportSchema,
|
|
4
5
|
AdminUserSchema,
|
|
5
6
|
ImageSchema,
|
|
6
7
|
PinSchema,
|
|
@@ -9,6 +10,7 @@ import {
|
|
|
9
10
|
UserSchema
|
|
10
11
|
} from '../schemas/base';
|
|
11
12
|
|
|
13
|
+
export type AdminReport = z.infer<typeof AdminReportSchema>;
|
|
12
14
|
export type AdminUser = z.infer<typeof AdminUserSchema>;
|
|
13
15
|
export type Image = z.infer<typeof ImageSchema>;
|
|
14
16
|
export type Pin = z.infer<typeof PinSchema>;
|