github.com/pyroscope-io/pyroscope@v0.37.3-0.20230725203016-5f6947968bd0/webapp/javascript/models/apikeys.ts (about)

     1  import { z } from 'zod';
     2  
     3  const zDateTime = z.string().transform((value) => Date.parse(value));
     4  
     5  export const apikeyModel = z.object({
     6    id: z.number(),
     7    name: z.string(),
     8    role: z.string(),
     9    key: z.optional(z.string()),
    10    createdAt: zDateTime,
    11    expiresAt: z.optional(zDateTime),
    12  });
    13  
    14  export const apiKeysSchema = z.array(apikeyModel);
    15  
    16  export type APIKeys = z.infer<typeof apiKeysSchema>;
    17  export type APIKey = z.infer<typeof apikeyModel>;