2024-04-18 00:13:40 -04:00
|
|
|
// DB Types
|
|
|
|
|
|
|
|
export type User = {
|
2024-10-21 13:57:45 -06:00
|
|
|
id: string
|
|
|
|
name: string
|
|
|
|
email: string
|
2024-11-10 21:52:52 -05:00
|
|
|
username: string
|
|
|
|
avatarUrl: string | null
|
|
|
|
createdAt: Date
|
2024-10-21 13:57:45 -06:00
|
|
|
generations: number
|
|
|
|
sandbox: Sandbox[]
|
|
|
|
usersToSandboxes: UsersToSandboxes[]
|
2024-11-23 20:31:24 -05:00
|
|
|
tier: "FREE" | "PRO" | "ENTERPRISE"
|
|
|
|
tierExpiresAt: Date
|
|
|
|
lastResetDate?: number
|
2024-10-21 13:57:45 -06:00
|
|
|
}
|
2024-04-18 00:13:40 -04:00
|
|
|
|
|
|
|
export type Sandbox = {
|
2024-10-21 13:57:45 -06:00
|
|
|
id: string
|
|
|
|
name: string
|
|
|
|
type: string
|
|
|
|
visibility: "public" | "private"
|
|
|
|
createdAt: Date
|
|
|
|
userId: string
|
|
|
|
usersToSandboxes: UsersToSandboxes[]
|
|
|
|
}
|
2024-05-01 01:53:49 -04:00
|
|
|
|
|
|
|
export type UsersToSandboxes = {
|
2024-10-21 13:57:45 -06:00
|
|
|
userId: string
|
|
|
|
sandboxId: string
|
|
|
|
sharedOn: Date
|
|
|
|
}
|
2024-04-26 00:10:53 -04:00
|
|
|
|
|
|
|
export type R2Files = {
|
2024-10-21 13:57:45 -06:00
|
|
|
objects: R2FileData[]
|
|
|
|
truncated: boolean
|
|
|
|
delimitedPrefixes: any[]
|
|
|
|
}
|
2024-04-26 00:10:53 -04:00
|
|
|
|
|
|
|
export type R2FileData = {
|
2024-10-21 13:57:45 -06:00
|
|
|
storageClass: string
|
|
|
|
uploaded: string
|
|
|
|
checksums: any
|
|
|
|
httpEtag: string
|
|
|
|
etag: string
|
|
|
|
size: number
|
|
|
|
version: string
|
|
|
|
key: string
|
|
|
|
}
|
2024-05-05 16:51:30 -07:00
|
|
|
|
|
|
|
export type TFolder = {
|
2024-10-21 13:57:45 -06:00
|
|
|
id: string
|
|
|
|
type: "folder"
|
|
|
|
name: string
|
|
|
|
children: (TFile | TFolder)[]
|
|
|
|
}
|
2024-05-05 16:51:30 -07:00
|
|
|
|
|
|
|
export type TFile = {
|
2024-10-21 13:57:45 -06:00
|
|
|
id: string
|
|
|
|
type: "file"
|
|
|
|
name: string
|
|
|
|
}
|
2024-05-05 16:51:30 -07:00
|
|
|
|
|
|
|
export type TTab = TFile & {
|
2024-10-21 13:57:45 -06:00
|
|
|
saved: boolean
|
|
|
|
}
|
2024-05-05 16:51:30 -07:00
|
|
|
|
|
|
|
export type TFileData = {
|
2024-10-21 13:57:45 -06:00
|
|
|
id: string
|
|
|
|
data: string
|
|
|
|
}
|