@assemblis/contracts 1.2.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 +17 -0
- package/dist/schemas/base.d.ts +139 -0
- package/dist/types/enums.d.ts +1 -0
- package/dist/types/types.d.ts +3 -1
- package/package.json +1 -1
- package/src/schemas/api.ts +13 -1
- package/src/schemas/base.ts +13 -0
- package/src/types/enums.ts +1 -0
- package/src/types/types.ts +4 -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.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
|
@@ -1975,6 +1975,23 @@ export declare const GetAdminReportsSchema: {
|
|
|
1975
1975
|
height: z.ZodInt;
|
|
1976
1976
|
}, z.core.$strip>>;
|
|
1977
1977
|
}, z.core.$strip>;
|
|
1978
|
+
creator_id: z.ZodUUID;
|
|
1979
|
+
}, z.core.$strip>>;
|
|
1980
|
+
total: z.ZodInt;
|
|
1981
|
+
}, z.core.$strip>;
|
|
1982
|
+
};
|
|
1983
|
+
export declare const GetAdminUsersSchema: {
|
|
1984
|
+
endpoint: ApiEndpoint.ADMIN_USERS;
|
|
1985
|
+
method: ApiRestMethod;
|
|
1986
|
+
payload: z.ZodNever;
|
|
1987
|
+
response: z.ZodObject<{
|
|
1988
|
+
users: z.ZodArray<z.ZodObject<{
|
|
1989
|
+
id: z.ZodUUID;
|
|
1990
|
+
sub: z.ZodString;
|
|
1991
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1992
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
1993
|
+
report_count: z.ZodInt;
|
|
1994
|
+
email: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
1978
1995
|
}, z.core.$strip>>;
|
|
1979
1996
|
total: z.ZodInt;
|
|
1980
1997
|
}, z.core.$strip>;
|
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>>;
|
|
@@ -173,6 +304,14 @@ export declare const UserSchema: z.ZodObject<{
|
|
|
173
304
|
sub: z.ZodString;
|
|
174
305
|
is_mutirao: z.ZodBoolean;
|
|
175
306
|
}, z.core.$strip>;
|
|
307
|
+
export declare const AdminUserSchema: z.ZodObject<{
|
|
308
|
+
id: z.ZodUUID;
|
|
309
|
+
sub: z.ZodString;
|
|
310
|
+
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
311
|
+
updated_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
312
|
+
report_count: z.ZodInt;
|
|
313
|
+
email: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
314
|
+
}, z.core.$strip>;
|
|
176
315
|
export declare const AssemblySchema: z.ZodObject<{
|
|
177
316
|
id: z.ZodUUID;
|
|
178
317
|
created_at: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
package/dist/types/enums.d.ts
CHANGED
package/dist/types/types.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
-
import { 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>;
|
|
4
|
+
export type AdminUser = z.infer<typeof AdminUserSchema>;
|
|
3
5
|
export type Image = z.infer<typeof ImageSchema>;
|
|
4
6
|
export type Pin = z.infer<typeof PinSchema>;
|
|
5
7
|
export type Report = z.infer<typeof ReportSchema>;
|
package/package.json
CHANGED
package/src/schemas/api.ts
CHANGED
|
@@ -3,6 +3,8 @@ import z from 'zod';
|
|
|
3
3
|
import { ApiEndpoint, ApiRestMethod } from '../types';
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
+
AdminReportSchema,
|
|
7
|
+
AdminUserSchema,
|
|
6
8
|
AssemblySchema,
|
|
7
9
|
ImageSchema,
|
|
8
10
|
InterestSchema,
|
|
@@ -133,7 +135,17 @@ export const GetAdminReportsSchema = {
|
|
|
133
135
|
method: ApiRestMethod.GET,
|
|
134
136
|
payload: z.never(),
|
|
135
137
|
response: z.object({
|
|
136
|
-
reports:
|
|
138
|
+
reports: AdminReportSchema.array(),
|
|
139
|
+
total: z.int()
|
|
140
|
+
})
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export const GetAdminUsersSchema = {
|
|
144
|
+
endpoint: ApiEndpoint.ADMIN_USERS as const,
|
|
145
|
+
method: ApiRestMethod.GET,
|
|
146
|
+
payload: z.never(),
|
|
147
|
+
response: z.object({
|
|
148
|
+
users: AdminUserSchema.array(),
|
|
137
149
|
total: z.int()
|
|
138
150
|
})
|
|
139
151
|
};
|
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,
|
|
@@ -81,6 +85,15 @@ export const UserSchema = z.object({
|
|
|
81
85
|
is_mutirao: z.boolean()
|
|
82
86
|
});
|
|
83
87
|
|
|
88
|
+
export const AdminUserSchema = z.object({
|
|
89
|
+
id: z.uuid(),
|
|
90
|
+
sub: z.string(),
|
|
91
|
+
created_at: isoDateString,
|
|
92
|
+
updated_at: isoDateString,
|
|
93
|
+
report_count: z.int(),
|
|
94
|
+
email: maybe(z.string())
|
|
95
|
+
});
|
|
96
|
+
|
|
84
97
|
// Pins
|
|
85
98
|
export const AssemblySchema = z.object({
|
|
86
99
|
id: z.uuid(),
|
package/src/types/enums.ts
CHANGED
package/src/types/types.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
+
AdminReportSchema,
|
|
5
|
+
AdminUserSchema,
|
|
4
6
|
ImageSchema,
|
|
5
7
|
PinSchema,
|
|
6
8
|
ReportContentSchema,
|
|
@@ -8,6 +10,8 @@ import {
|
|
|
8
10
|
UserSchema
|
|
9
11
|
} from '../schemas/base';
|
|
10
12
|
|
|
13
|
+
export type AdminReport = z.infer<typeof AdminReportSchema>;
|
|
14
|
+
export type AdminUser = z.infer<typeof AdminUserSchema>;
|
|
11
15
|
export type Image = z.infer<typeof ImageSchema>;
|
|
12
16
|
export type Pin = z.infer<typeof PinSchema>;
|
|
13
17
|
export type Report = z.infer<typeof ReportSchema>;
|