-
Notifications
You must be signed in to change notification settings - Fork 254
Expand file tree
/
Copy pathtypes.ts
More file actions
30 lines (25 loc) · 911 Bytes
/
types.ts
File metadata and controls
30 lines (25 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { z } from "zod";
export const orgMetadataSchema = z.object({
anonymousAccessEnabled: z.boolean().optional(),
})
export const demoSearchScopeSchema = z.object({
id: z.number(),
displayName: z.string(),
value: z.string(),
type: z.enum(["repo", "reposet"]),
codeHostType: z.string().optional(),
})
export const demoSearchExampleSchema = z.object({
title: z.string(),
description: z.string(),
url: z.string(),
searchScopes: z.array(z.number())
})
export const demoExamplesSchema = z.object({
searchScopes: demoSearchScopeSchema.array(),
searchExamples: demoSearchExampleSchema.array(),
})
export type OrgMetadata = z.infer<typeof orgMetadataSchema>;
export type DemoExamples = z.infer<typeof demoExamplesSchema>;
export type DemoSearchScope = z.infer<typeof demoSearchScopeSchema>;
export type DemoSearchExample = z.infer<typeof demoSearchExampleSchema>;