(
req: FastifyRequest<{ Params: { projectId?: string; profileId: string }; Querystring: z.infer<typeof zGetProfileQuery> }>,
reply: FastifyReply
)
| 532 | export const zGetProfileQuery = z.object({ eventLimit: z.number().int().min(1).max(100).default(20) }); |
| 533 | |
| 534 | export async function getProfile( |
| 535 | req: FastifyRequest<{ Params: { projectId?: string; profileId: string }; Querystring: z.infer<typeof zGetProfileQuery> }>, |
| 536 | reply: FastifyReply |
| 537 | ) { |
| 538 | const projectId = await getProjectId(req as RequestWithProjectParam); |
| 539 | const result = await getProfileWithEvents(projectId, req.params.profileId, req.query.eventLimit); |
| 540 | if (!result.profile) { |
| 541 | return reply.status(404).send({ error: 'Profile not found', profileId: req.params.profileId }); |
| 542 | } |
| 543 | return reply.send({ profile: result.profile, recentEvents: result.recent_events }); |
| 544 | } |
| 545 | |
| 546 | export const zProfileSessionsQuery = z.object({ limit: z.number().int().min(1).max(100).default(20) }); |
| 547 |
nothing calls this directly
no test coverage detected