@4players/odin-common
Version:
A collection of commonly used type definitions and utility functions across ODIN web projects
59 lines (58 loc) • 2.43 kB
TypeScript
import { z } from 'zod';
export declare const TokenAudienceSchema: z.ZodEnum<["sfu", "gateway"]>;
export declare const TokenSubjectSchema: z.ZodEnum<["connect", "roomclose", "roomupdate", "roombanclient", "roomsendmessage"]>;
export declare const TokenClaimsSchema: z.ZodObject<{
uid: z.ZodString;
cid: z.ZodOptional<z.ZodString>;
rid: z.ZodEffects<z.ZodType<string[], z.ZodTypeDef, string[]>, string[], string[]>;
nsp: z.ZodOptional<z.ZodString>;
adr: z.ZodOptional<z.ZodString>;
aud: z.ZodOptional<z.ZodType<("sfu" | "gateway")[], z.ZodTypeDef, ("sfu" | "gateway")[]>>;
sub: z.ZodOptional<z.ZodType<("connect" | "roomclose" | "roomupdate" | "roombanclient" | "roomsendmessage")[], z.ZodTypeDef, ("connect" | "roomclose" | "roomupdate" | "roombanclient" | "roomsendmessage")[]>>;
exp: z.ZodOptional<z.ZodNumber>;
nbf: z.ZodOptional<z.ZodNumber>;
ups: z.ZodOptional<z.ZodString>;
tgs: z.ZodOptional<z.ZodType<string[], z.ZodTypeDef, string[]>>;
tsp: z.ZodOptional<z.ZodNumber>;
internal: z.ZodOptional<z.ZodObject<{
server: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
server?: string | undefined;
}, {
server?: string | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
uid: string;
rid: string[];
sub?: ("connect" | "roomclose" | "roomupdate" | "roombanclient" | "roomsendmessage")[] | undefined;
internal?: {
server?: string | undefined;
} | undefined;
cid?: string | undefined;
nsp?: string | undefined;
adr?: string | undefined;
aud?: ("sfu" | "gateway")[] | undefined;
exp?: number | undefined;
nbf?: number | undefined;
ups?: string | undefined;
tgs?: string[] | undefined;
tsp?: number | undefined;
}, {
uid: string;
rid: string[];
sub?: ("connect" | "roomclose" | "roomupdate" | "roombanclient" | "roomsendmessage")[] | undefined;
internal?: {
server?: string | undefined;
} | undefined;
cid?: string | undefined;
nsp?: string | undefined;
adr?: string | undefined;
aud?: ("sfu" | "gateway")[] | undefined;
exp?: number | undefined;
nbf?: number | undefined;
ups?: string | undefined;
tgs?: string[] | undefined;
tsp?: number | undefined;
}>;
export type TokenClaims = z.infer<typeof TokenClaimsSchema>;
export declare function oneOrMany<T extends z.ZodTypeAny>(type: T): z.ZodType<z.infer<T>[]>;