mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-20 02:08:33 -05:00
* Initial * CSS lint * Test CI * Add 1v1, 2v2, and 3v3 Tags (#1771) * Initial * CSS lint * Test CI * Rename step --------- Co-authored-by: xi <104683822+ximk@users.noreply.github.com>
70 lines
1.3 KiB
TypeScript
70 lines
1.3 KiB
TypeScript
import { z } from "zod";
|
|
import {
|
|
TIER_1_ID,
|
|
TIER_2_ID,
|
|
TIER_3_ID,
|
|
TIER_4_ID,
|
|
UNKNOWN_TIER_ID,
|
|
} from "./constants";
|
|
|
|
export const patronResponseSchema = z.object({
|
|
data: z.array(
|
|
z.object({
|
|
attributes: z.object({}),
|
|
id: z.string(),
|
|
relationships: z.object({
|
|
currently_entitled_tiers: z.object({
|
|
data: z.array(
|
|
z.object({
|
|
id: z.enum([
|
|
TIER_1_ID,
|
|
TIER_2_ID,
|
|
TIER_3_ID,
|
|
TIER_4_ID,
|
|
UNKNOWN_TIER_ID,
|
|
]),
|
|
type: z.string(),
|
|
attributes: z
|
|
.object({
|
|
created_at: z.string(),
|
|
})
|
|
.nullish(),
|
|
}),
|
|
),
|
|
}),
|
|
user: z.object({
|
|
data: z.object({ id: z.string(), type: z.string() }),
|
|
links: z.object({ related: z.string() }),
|
|
}),
|
|
}),
|
|
type: z.string(),
|
|
}),
|
|
),
|
|
included: z
|
|
.array(
|
|
z.object({
|
|
attributes: z.object({
|
|
social_connections: z
|
|
.object({
|
|
discord: z
|
|
.object({
|
|
user_id: z.string(),
|
|
})
|
|
.nullish(),
|
|
})
|
|
.nullish(),
|
|
}),
|
|
id: z.string(),
|
|
type: z.string(),
|
|
}),
|
|
)
|
|
.nullish(),
|
|
links: z.object({ next: z.string() }).nullish(),
|
|
meta: z.object({
|
|
pagination: z.object({
|
|
cursors: z.object({ next: z.string().nullish() }),
|
|
total: z.number(),
|
|
}),
|
|
}),
|
|
});
|