File
Blob: src/client/lib/types.ts
| 1 | import type { operations } from "@/client/lib/openapi-types"; |
| 2 | |
| 3 | type Json<T> = T extends { content: { "application/json": infer J } } ? J : never; |
| 4 | |
| 5 | export type Pat = Json<operations["getApiV1PatsByPatId"]["responses"][200]>; |
| 6 | export type PatListItem = Json<operations["getApiV1Pats"]["responses"][200]>[number]; |
| 7 | export type PatCreateResponse = Json<operations["postApiV1Pats"]["responses"][201]>; |
| 8 | export type Calendar = Json<operations["getApiV1CalendarsByCalendarId"]["responses"][200]>; |
| 9 | export type Addressbook = Json<operations["getApiV1AddressbooksByAddressbookId"]["responses"][200]>; |
| 10 | export type FileNode = Json<operations["getApiV1FilesMetadata"]["responses"][200]>; |
| 11 | export type FileListing = Json<operations["getApiV1FilesList"]["responses"][200]>; |
| 12 | |
| 13 | export type DavScope = |
| 14 | | "dav:files:read" |
| 15 | | "dav:files:write" |
| 16 | | "dav:caldav:read" |
| 17 | | "dav:caldav:write" |
| 18 | | "dav:carddav:read" |
| 19 | | "dav:carddav:write"; |
| 20 | |
| 21 | export const ALL_DAV_SCOPES: readonly DavScope[] = [ |
| 22 | "dav:files:read", |
| 23 | "dav:files:write", |
| 24 | "dav:caldav:read", |
| 25 | "dav:caldav:write", |
| 26 | "dav:carddav:read", |
| 27 | "dav:carddav:write", |
| 28 | ] as const; |