2024-04-18 00:13:40 -04:00
|
|
|
// DB Types
|
|
|
|
|
|
|
|
export type User = {
|
2024-05-23 23:52:30 -07:00
|
|
|
id: string;
|
|
|
|
name: string;
|
|
|
|
email: string;
|
|
|
|
generations: number;
|
|
|
|
sandbox: Sandbox[];
|
|
|
|
usersToSandboxes: UsersToSandboxes[];
|
|
|
|
};
|
2024-04-18 00:13:40 -04:00
|
|
|
|
|
|
|
export type Sandbox = {
|
2024-05-23 23:52:30 -07:00
|
|
|
id: string;
|
|
|
|
name: string;
|
|
|
|
type: "react" | "node";
|
|
|
|
visibility: "public" | "private";
|
|
|
|
createdAt: Date;
|
|
|
|
userId: string;
|
|
|
|
usersToSandboxes: UsersToSandboxes[];
|
|
|
|
};
|
2024-05-01 01:53:49 -04:00
|
|
|
|
|
|
|
export type UsersToSandboxes = {
|
2024-05-23 23:52:30 -07:00
|
|
|
userId: string;
|
|
|
|
sandboxId: string;
|
|
|
|
sharedOn: Date;
|
|
|
|
};
|
2024-04-26 00:10:53 -04:00
|
|
|
|
|
|
|
export type R2Files = {
|
2024-05-23 23:52:30 -07:00
|
|
|
objects: R2FileData[];
|
|
|
|
truncated: boolean;
|
|
|
|
delimitedPrefixes: any[];
|
|
|
|
};
|
2024-04-26 00:10:53 -04:00
|
|
|
|
|
|
|
export type R2FileData = {
|
2024-05-23 23:52:30 -07: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-05-23 23:52:30 -07:00
|
|
|
id: string;
|
|
|
|
type: "folder";
|
|
|
|
name: string;
|
|
|
|
children: (TFile | TFolder)[];
|
|
|
|
};
|
2024-05-05 16:51:30 -07:00
|
|
|
|
|
|
|
export type TFile = {
|
2024-05-23 23:52:30 -07:00
|
|
|
id: string;
|
|
|
|
type: "file";
|
|
|
|
name: string;
|
|
|
|
};
|
2024-05-05 16:51:30 -07:00
|
|
|
|
|
|
|
export type TTab = TFile & {
|
2024-05-23 23:52:30 -07:00
|
|
|
saved: boolean;
|
|
|
|
};
|
2024-05-05 16:51:30 -07:00
|
|
|
|
|
|
|
export type TFileData = {
|
2024-05-23 23:52:30 -07:00
|
|
|
id: string;
|
|
|
|
data: string;
|
|
|
|
};
|