mirror of
https://github.com/supabase/supabase.git
synced 2026-07-01 12:56:42 -04:00
be5e8b289e
* refactor * fix schema, add validation, add tests, remove old code * remove debugging tag * fix imports * prettier * fix prettier * move query to its own file
23 lines
757 B
TypeScript
23 lines
757 B
TypeScript
import { z } from 'zod'
|
|
|
|
export const AuthMetricsPeriodSchema = z.enum(['current', 'previous'])
|
|
|
|
export const RawAuthMetricsRowSchema = z.object({
|
|
period: AuthMetricsPeriodSchema,
|
|
active_users: z.number().min(0),
|
|
api_error_requests: z.number().min(0),
|
|
api_total_requests: z.number().min(0),
|
|
auth_total_errors: z.number().min(0),
|
|
auth_total_requests: z.number().min(0),
|
|
password_reset_requests: z.number().min(0),
|
|
sign_up_count: z.number().min(0),
|
|
})
|
|
|
|
export const RawAuthMetricsResponseSchema = z.object({
|
|
result: z.array(RawAuthMetricsRowSchema),
|
|
error: z.unknown().nullable(),
|
|
})
|
|
|
|
export type RawAuthMetricsRow = z.infer<typeof RawAuthMetricsRowSchema>
|
|
export type RawAuthMetricsResponse = z.infer<typeof RawAuthMetricsResponseSchema>
|