Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Merge branch 'master' into develop

Tomas Valenta1f71f7acbeb7
diff --cc components/Editor/index.tsx
index ce83af5bf,4abc2b12f..ec045bcaa
--- a/components/Editor/index.tsx
+++ b/components/Editor/index.tsx
@@@ -2,6 -2,6 +2,7 @@@ import { shallow } from 'zustand/shallo
import useSWRMutation from 'swr/mutation'
import { Fragment, useState } from 'react'
import Hotkeys from 'react-hot-keys'
++import { api_deployments } from '@prisma/client'
import { State, Block, methods, Method } from 'state/store'
import { getStoreContext } from 'state/StoreProvider'
diff --cc components/ItemList/Item.tsx
index f12a4ece3,000000000..78dd43959
mode 100644,000000..100644
--- a/components/ItemList/Item.tsx
+++ b/components/ItemList/Item.tsx
@@@ -1,150 -1,0 +1,150 @@@
+import clsx from 'clsx'
+import Link from 'next/link'
+import { MouseEvent, useEffect, useState } from 'react'
+
+import SpinnerIcon from 'components/icons/Spinner'
- import Text from 'components/typography/Text'
++import Text from 'components/Text'
+
+export interface ItemSetup {
+ id: string
+ title: string
+ created_at: Date
+ icon?: React.ReactNode
+ path: string
+ type: string
+}
+
+export interface Props {
+ item: ItemSetup
+ deleteItem?: () => Promise<void>
+}
+
+function Item({ item, deleteItem }: Props) {
+ const [confirmDelete, setConfirmDelete] = useState(false)
+ const [isDeleting, setIsDeleting] = useState(false)
+
+ useEffect(
+ function expireConfirm() {
+ if (confirmDelete) {
+ const cleanup = setTimeout(() => setConfirmDelete(false), 4000)
+ return () => {
+ clearTimeout(cleanup)
+ }
+ }
+ },
+ [confirmDelete],
+ )
+
+ async function handleDelete(
+ e: MouseEvent<HTMLButtonElement, globalThis.MouseEvent>,
+ ) {
+ if (!deleteItem) return
+
+ e.stopPropagation()
+ e.preventDefault()
+
+ if (confirmDelete && !isDeleting) {
+ setIsDeleting(true)
+ try {
+ await deleteItem()
+ } catch (err) {
+ const msg = err instanceof Error ? err.message : String(err)
+ console.error(`Error deleting item: ${msg}`)
+ } finally {
+ setIsDeleting(false)
+ }
+ } else {
+ setConfirmDelete(true)
+ }
+ }
+
+ return (
+ <Link
+ className="group flex items-center justify-between space-x-4 rounded"
+ href={{
+ pathname: item.path,
+ query: {
+ id: item.id,
+ },
+ }}
+ >
+ <div className="flex items-center space-x-4 truncate">
+ <div className="
+ m-1
+ flex
+ h-12
+ w-12
+ shrink-0
+ items-center
+ justify-center
+ rounded-lg border
+ border-slate-200
+ group-hover:border-green-800
+ text-slate-300
+ transition-all
+ group-hover:bg-green-400
+ group-hover:text-green-800
+ "
+ >
+ {item.icon}
+ </div>
+ <div
+ className="flex flex-col"
+ >
+ <Text
+ className="text-slate-600 transition-all group-hover:text-green-800"
+ size={Text.size.S2}
+ text={item.title}
+ />
+ <div className="flex space-x-1 text-slate-300 transition-all group-hover:text-slate-400">
+ <Text
+ size={Text.size.S3}
+ text={item.type}
+ />
+ <Text
+ size={Text.size.S3}
+ text="-"
+ />
+ <Text
+ size={Text.size.S3}
+ text={item.created_at.toLocaleString()}
+ suppressHydrationWarning
+ />
+ </div>
+ </div>
+ </div>
+ {deleteItem &&
+ <button
+ className={clsx(
+ 'flex items-center justify-center rounded border border-transparent px-3 py-1.5',
+ {
+ 'border-red-600 hover:bg-red-600/10': confirmDelete,
+ },
+ )}
+ onClick={handleDelete}
+ >
+ {isDeleting && (
+ <Text
+ className="whitespace-nowrap text-red-600"
+ icon={<SpinnerIcon className="text-red-600" />}
+ size={Text.size.S3}
+ text="Deleting..."
+ />
+ )}
+ {!isDeleting && (
+ <Text
+ size={Text.size.S3}
+ text={confirmDelete ? 'Confirm delete' : 'Delete'}
+ className={clsx('whitespace-nowrap hover:text-red-600', {
+ 'text-red-600': confirmDelete,
+ 'text-slate-300': !confirmDelete,
+ })}
+ />
+ )}
+ </button>
+ }
+ </Link>
+ )
+}
+
+export default Item
diff --cc db/supabase.ts
index 226d99f0e,ccfeb5e64..9151a2918
--- a/db/supabase.ts
+++ b/db/supabase.ts
@@@ -9,312 -9,306 +9,76 @@@ export type Json
export interface Database {
public: {
Tables: {
-- api_deployments: {
-- Row: {
- code: Json | null
-- created_at: string | null
-- data: Json
-- id: number
- logs: Json | null
-- team_id: string | null
-- }
-- Insert: {
- code?: Json | null
-- created_at?: string | null
-- data: Json
-- id?: number
- logs?: Json | null
-- team_id?: string | null
-- }
-- Update: {
- code?: Json | null
-- created_at?: string | null
-- data?: Json
-- id?: number
- logs?: Json | null
-- team_id?: string | null
-- }
-- }
-- api_keys: {
-- Row: {
-- api_key: string
-- owner_id: string
-- }
-- Insert: {
-- api_key: string
-- owner_id: string
-- }
-- Update: {
-- api_key?: string
-- owner_id?: string
-- }
-- }
-- apps: {
-- Row: {
-- created_at: string
-- id: string
-- repository_branch: string | null
-- repository_id: number | null
-- repository_path: string
-- subdomain: string | null
-- team_id: string | null
-- title: string | null
-- }
-- Insert: {
-- created_at?: string
-- id: string
-- repository_branch?: string | null
-- repository_id?: number | null
-- repository_path?: string
-- subdomain?: string | null
-- team_id?: string | null
-- title?: string | null
-- }
-- Update: {
-- created_at?: string
-- id?: string
-- repository_branch?: string | null
-- repository_id?: number | null
-- repository_path?: string
-- subdomain?: string | null
-- team_id?: string | null
-- title?: string | null
-- }
-- }
-- apps_content: {
-- Row: {
-- app_id: string
-- content: Json | null
-- created_at: string
-- updated_at: string
-- }
-- Insert: {
-- app_id: string
-- content?: Json | null
-- created_at?: string
-- updated_at?: string
-- }
-- Update: {
-- app_id?: string
-- content?: Json | null
-- created_at?: string
-- updated_at?: string
-- }
-- }
-- apps_feedback: {
-- Row: {
-- appId: string
-- created_at: string
-- feedback: string | null
-- id: number
-- properties: Json | null
-- }
-- Insert: {
-- appId: string
-- created_at?: string
-- feedback?: string | null
-- id?: number
-- properties?: Json | null
-- }
-- Update: {
-- appId?: string
-- created_at?: string
-- feedback?: string | null
-- id?: number
-- properties?: Json | null
-- }
-- }
-- code_snippets: {
++ deployments: {
Row: {
code: string | null
-- created_at: string
-- creator_id: string
-- env_vars: Json
++ created_at: string | null
id: string
-- template: string
-- title: string
++ logs: Json[] | null
}
Insert: {
code?: string | null
-- created_at?: string
-- creator_id: string
-- env_vars?: Json
-- id: string
-- template?: string
-- title?: string
-- }
-- Update: {
-- code?: string | null
-- created_at?: string
-- creator_id?: string
-- env_vars?: Json
++ created_at?: string | null
id?: string
-- template?: string
-- title?: string
-- }
-- }
-- envs: {
-- Row: {
-- code_snippet_id: string | null
-- deps: string[] | null
-- id: string
-- state: Database["public"]["Enums"]["env_state"] | null
-- template: string | null
-- }
-- Insert: {
-- code_snippet_id?: string | null
-- deps?: string[] | null
-- id: string
-- state?: Database["public"]["Enums"]["env_state"] | null
-- template?: string | null
++ logs?: Json[] | null
}
Update: {
-- code_snippet_id?: string | null
-- deps?: string[] | null
++ code?: string | null
++ created_at?: string | null
id?: string
-- state?: Database["public"]["Enums"]["env_state"] | null
-- template?: string | null
-- }
-- }
-- github_repositories: {
-- Row: {
-- installated_at: string
-- installation_id: number
-- repository_fullname: string
-- repository_id: number
-- }
-- Insert: {
-- installated_at?: string
-- installation_id: number
-- repository_fullname: string
-- repository_id?: number
-- }
-- Update: {
-- installated_at?: string
-- installation_id?: number
-- repository_fullname?: string
-- repository_id?: number
++ logs?: Json[] | null
}
}
-- published_code_snippets: {
++ projects: {
Row: {
-- code: string
-- code_snippet_id: string
-- env_vars: Json
++ created_at: string | null
++ data: Json | null
id: string
-- published_at: string | null
-- template: string
-- title: string
}
Insert: {
-- code?: string
-- code_snippet_id: string
-- env_vars?: Json
-- id?: string
-- published_at?: string | null
-- template?: string
-- title?: string
-- }
-- Update: {
-- code?: string
-- code_snippet_id?: string
-- env_vars?: Json
++ created_at?: string | null
++ data?: Json | null
id?: string
-- published_at?: string | null
-- template?: string
-- title?: string
-- }
-- }
-- slack_installations: {
-- Row: {
-- created_at: string
-- devbook_app_id: string
-- id: string
-- installation_data: Json
-- }
-- Insert: {
-- created_at?: string
-- devbook_app_id: string
-- id: string
-- installation_data: Json
}
Update: {
-- created_at?: string
-- devbook_app_id?: string
++ created_at?: string | null
++ data?: Json | null
id?: string
-- installation_data?: Json
}
}
teams: {
Row: {
-- created_at: string
++ created_at: string | null
id: string
-- is_default: boolean
++ is_default: boolean | null
name: string | null
}
Insert: {
-- created_at?: string
-- id?: string
-- is_default?: boolean
-- name?: string | null
-- }
-- Update: {
-- created_at?: string
++ created_at?: string | null
id?: string
-- is_default?: boolean
++ is_default?: boolean | null
name?: string | null
}
-- }
-- user_feedback: {
-- Row: {
-- created_at: string | null
-- feedback: string | null
-- id: number
-- user_id: string | null
-- }
-- Insert: {
-- created_at?: string | null
-- feedback?: string | null
-- id?: number
-- user_id?: string | null
-- }
-- Update: {
-- created_at?: string | null
-- feedback?: string | null
-- id?: number
-- user_id?: string | null
-- }
-- }
-- users: {
-- Row: {
-- created_at: string | null
-- email: string | null
-- id: string
-- }
-- Insert: {
-- created_at?: string | null
-- email?: string | null
-- id: string
-- }
Update: {
created_at?: string | null
-- email?: string | null
id?: string
++ is_default?: boolean | null
++ name?: string | null
}
}
users_teams: {
Row: {
-- created_at: string
++ created_at: string | null
team_id: string
user_id: string
}
Insert: {
-- created_at?: string
++ created_at?: string | null
team_id: string
user_id: string
}
Update: {
-- created_at?: string
++ created_at?: string | null
team_id?: string
user_id?: string
}
@@@ -327,28 -321,28 +91,7 @@@
[_ in never]: never
}
Enums: {
-- env_state: "Building" | "Failed" | "Done" | "None"
-- template:
-- | "Nodejs"
-- | "Go"
-- | "Bash"
-- | "Python3"
-- | "Java"
-- | "Rust"
-- | "Perl"
-- | "PHP"
-- | "Ansys"
-- | "Typescript"
-- template_old:
-- | "None"
-- | "Nodejs"
-- | "Go"
-- | "Bash"
-- | "Python"
-- | "Java"
-- | "Rust"
-- | "Perl"
-- | "PHP"
++ [_ in never]: never
}
CompositeTypes: {
[_ in never]: never
diff --cc db/tables.ts
index e72735b09,e72735b09..67cc0d5ef
--- a/db/tables.ts
+++ b/db/tables.ts
@@@ -1,1 -1,1 +1,2 @@@
--export const apiDeploymentsTable = 'api_deployments'
++export const projectsTable = 'projects'
++export const deploymentsTable = 'deployments'
diff --cc package.json
index 255af2883,255af2883..c719340d4
--- a/package.json
+++ b/package.json
@@@ -12,7 -12,7 +12,7 @@@
"dev:debug": "NODE_OPTIONS='--inspect' next dev",
"db:generate": "prisma generate",
"db:pull": "prisma db pull",
-- "supabase:generate": "supabase gen types typescript --project-id \"eazfkpnsvqrijiorxdbj\" --schema public > db/supabase.ts",
++ "supabase:generate": "supabase gen types typescript --project-id \"ntjfcwpzsxugrykskdgi\" --schema public > db/supabase.ts",
"postinstall": "yarn db:generate"
},
"dependencies": {
@@@ -59,4 -59,4 +59,4 @@@
"typescript": "^4.9.5",
"vercel": "^28.16.12"
}
--}
++}
diff --cc pages/[projectID].tsx
index 9802107fe,000000000..13ce79638
mode 100644,000000..100644
--- a/pages/[projectID].tsx
+++ b/pages/[projectID].tsx
@@@ -1,91 -1,0 +1,92 @@@
+import type { GetServerSideProps } from 'next'
+import { createServerSupabaseClient } from '@supabase/auth-helpers-nextjs'
+import { useSupabaseClient } from '@supabase/auth-helpers-react'
+import type { ParsedUrlQuery } from 'querystring'
+
+import { prisma, api_deployments } from 'db/prisma'
+import DeploymentEditor from 'components/Editor'
+import { StoreProvider } from 'state/StoreProvider'
++import Editor from 'components/Editor'
+
+interface PathProps extends ParsedUrlQuery {
+ deploymentID: string
+}
+
+export const getServerSideProps: GetServerSideProps<Props, PathProps> = async (ctx) => {
+ const deploymentID = parseInt(ctx.params?.deploymentID || '')
+
+ if (!deploymentID) {
+ return {
+ notFound: true,
+ }
+ }
+
+ const supabase = createServerSupabaseClient(ctx)
+ const {
+ data: { session },
+ } = await supabase.auth.getSession()
+
+ if (!session) {
+ return {
+ redirect: {
+ destination: '/sign',
+ permanent: false,
+ },
+ }
+ }
+
+ const user = await prisma.auth_users.findUnique({
+ where: {
+ id: session.user.id,
+ },
+ select: {
+ users_teams: {
+ select: {
+ teams: {
+ include: {
+ api_deployments: {
+ where: {
+ id: {
+ equals: deploymentID,
+ },
+ }
+ }
+ },
+ },
+ },
+ },
+ },
+ })
+
+ const deployment = user?.users_teams.flatMap(t => t.teams.api_deployments).find(d => d.id === BigInt(deploymentID))
+ if (!deployment) {
+ return {
+ notFound: true,
+ }
+ }
+
+ return {
+ props: {
+ deployment,
+ }
+ }
+}
+
+interface Props {
+ deployment: api_deployments
+}
+
+function EditorPage({ deployment }: Props) {
+ const client = useSupabaseClient()
+
+ return (
+ <StoreProvider
+ client={client}
+ deployment={deployment}
+ >
- <DeploymentEditor />
++ <Editor />
+ </StoreProvider>
+ )
+}
+
+export default EditorPage
diff --cc pages/index.tsx
index 539e844c1,287258f8a..06ab33932
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@@ -1,13 -1,11 +1,13 @@@
import type { GetServerSideProps } from 'next'
+import { LayoutGrid, Plus } from 'lucide-react'
import { createServerSupabaseClient } from '@supabase/auth-helpers-nextjs'
-import { useSupabaseClient } from '@supabase/auth-helpers-react'
+import useSWRMutation from 'swr/mutation'
+import { useRouter } from 'next/router'
-import { prisma, api_deployments } from 'db/prisma'
-import { notEmpty } from 'utils/notEmpty'
-import DeploymentEditor from 'components/Editor'
-import { StoreProvider } from 'state/StoreProvider'
+import ItemList from 'components/ItemList'
- import Text from 'components/typography/Text'
++import Text from 'components/Text'
+import { api_deployments, prisma } from 'db/prisma'
+import Button from 'components/Button'
export const getServerSideProps: GetServerSideProps<Props> = async (ctx) => {
const supabase = createServerSupabaseClient(ctx)
diff --cc prisma/schema.prisma
index 7c8fda030,afde3e011..09d518cca
--- a/prisma/schema.prisma
+++ b/prisma/schema.prisma
@@@ -98,7 -98,7 +98,6 @@@ model refresh_tokens
session_id String? @db.Uuid
sessions sessions? @relation(fields: [session_id], references: [id], onDelete: Cascade, onUpdate: NoAction)
-- @@index([session_id], map: "refresh_token_session_id")
@@index([instance_id])
@@index([instance_id, user_id])
@@index([parent])
@@@ -186,46 -186,46 +185,43 @@@ model sso_providers
}
model auth_users {
-- instance_id String? @db.Uuid
-- id String @id @db.Uuid
-- aud String? @db.VarChar(255)
-- role String? @db.VarChar(255)
-- email String? @db.VarChar(255)
-- encrypted_password String? @db.VarChar(255)
-- email_confirmed_at DateTime? @db.Timestamptz(6)
-- invited_at DateTime? @db.Timestamptz(6)
-- confirmation_token String? @db.VarChar(255)
-- confirmation_sent_at DateTime? @db.Timestamptz(6)
-- recovery_token String? @db.VarChar(255)
-- recovery_sent_at DateTime? @db.Timestamptz(6)
-- email_change_token_new String? @db.VarChar(255)
-- email_change String? @db.VarChar(255)
-- email_change_sent_at DateTime? @db.Timestamptz(6)
-- last_sign_in_at DateTime? @db.Timestamptz(6)
++ instance_id String? @db.Uuid
++ id String @id @db.Uuid
++ aud String? @db.VarChar(255)
++ role String? @db.VarChar(255)
++ email String? @db.VarChar(255)
++ encrypted_password String? @db.VarChar(255)
++ email_confirmed_at DateTime? @db.Timestamptz(6)
++ invited_at DateTime? @db.Timestamptz(6)
++ confirmation_token String? @db.VarChar(255)
++ confirmation_sent_at DateTime? @db.Timestamptz(6)
++ recovery_token String? @db.VarChar(255)
++ recovery_sent_at DateTime? @db.Timestamptz(6)
++ email_change_token_new String? @db.VarChar(255)
++ email_change String? @db.VarChar(255)
++ email_change_sent_at DateTime? @db.Timestamptz(6)
++ last_sign_in_at DateTime? @db.Timestamptz(6)
raw_app_meta_data Json?
raw_user_meta_data Json?
is_super_admin Boolean?
-- created_at DateTime? @db.Timestamptz(6)
-- updated_at DateTime? @db.Timestamptz(6)
-- phone String? @unique @db.VarChar(15)
-- phone_confirmed_at DateTime? @db.Timestamptz(6)
-- phone_change String? @default("") @db.VarChar(15)
-- phone_change_token String? @default("") @db.VarChar(255)
-- phone_change_sent_at DateTime? @db.Timestamptz(6)
-- confirmed_at DateTime? @default(dbgenerated("LEAST(email_confirmed_at, phone_confirmed_at)")) @db.Timestamptz(6)
-- email_change_token_current String? @default("") @db.VarChar(255)
-- email_change_confirm_status Int? @default(0) @db.SmallInt
-- banned_until DateTime? @db.Timestamptz(6)
-- reauthentication_token String? @default("") @db.VarChar(255)
-- reauthentication_sent_at DateTime? @db.Timestamptz(6)
-- is_sso_user Boolean @default(false)
++ created_at DateTime? @db.Timestamptz(6)
++ updated_at DateTime? @db.Timestamptz(6)
++ phone String? @unique
++ phone_confirmed_at DateTime? @db.Timestamptz(6)
++ phone_change String? @default("")
++ phone_change_token String? @default("") @db.VarChar(255)
++ phone_change_sent_at DateTime? @db.Timestamptz(6)
++ confirmed_at DateTime? @default(dbgenerated("LEAST(email_confirmed_at, phone_confirmed_at)")) @db.Timestamptz(6)
++ email_change_token_current String? @default("") @db.VarChar(255)
++ email_change_confirm_status Int? @default(0) @db.SmallInt
++ banned_until DateTime? @db.Timestamptz(6)
++ reauthentication_token String? @default("") @db.VarChar(255)
++ reauthentication_sent_at DateTime? @db.Timestamptz(6)
++ is_sso_user Boolean @default(false)
++ deleted_at DateTime? @db.Timestamptz(6)
identities identities[]
mfa_factors mfa_factors[]
sessions sessions[]
-- api_keys api_keys[]
-- code_snippets code_snippets[]
-- user_feedback user_feedback[]
-- users public_users?
users_teams users_teams[]
@@index([instance_id])
@@@ -233,134 -233,134 +229,19 @@@
@@schema("auth")
}
--model api_keys {
-- api_key String @id
-- owner_id String @db.Uuid
-- users auth_users @relation(fields: [owner_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
--
-- @@schema("public")
--}
--
--model apps {
-- id String @id
-- title String?
-- created_at DateTime @default(dbgenerated("timezone('utc'::text, now())")) @db.Timestamptz(6)
-- repository_id BigInt?
-- team_id String? @db.Uuid
-- repository_branch String?
-- repository_path String @default("./")
-- subdomain String? @unique
-- github_repositories github_repositories? @relation(fields: [repository_id], references: [repository_id], onDelete: NoAction, onUpdate: NoAction)
-- teams teams? @relation(fields: [team_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
-- apps_content apps_content?
--
-- @@schema("public")
--}
--
--model apps_content {
-- created_at DateTime @default(now()) @db.Timestamptz(6)
-- updated_at DateTime @default(now()) @db.Timestamptz(6)
-- content Json?
-- app_id String @id
-- apps apps @relation(fields: [app_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
--
-- @@schema("public")
--}
--
--model apps_feedback {
-- id BigInt @id @default(autoincrement())
-- created_at DateTime @default(now()) @db.Timestamptz(6)
-- appId String
-- feedback String?
-- properties Json? @db.Json
--
-- @@schema("public")
--}
--
--model code_snippets {
-- id String @id
-- creator_id String @db.Uuid
-- title String @default("\"\"")
-- code String?
-- created_at DateTime @default(dbgenerated("timezone('utc'::text, now())")) @db.Timestamptz(6)
-- env_vars Json @default("{}") @db.Json
-- template String @default("Nodejs")
-- users auth_users @relation(fields: [creator_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
-- envs envs[]
-- published_code_snippets published_code_snippets?
--
-- @@schema("public")
--}
--
--model envs {
-- id String @id
-- code_snippet_id String?
-- template String?
-- deps String[]
-- state env_state?
-- code_snippets code_snippets? @relation(fields: [code_snippet_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
--
-- @@schema("public")
--}
--
--model published_code_snippets {
-- code_snippet_id String @unique
-- title String @default("")
-- code String @default("")
-- published_at DateTime? @default(now()) @db.Timestamptz(6)
-- id String @id @default(dbgenerated("uuid_generate_v4()")) @db.Uuid
-- env_vars Json @default("{}") @db.Json
-- template String @default("Nodejs")
-- code_snippets code_snippets @relation(fields: [code_snippet_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
--
-- @@schema("public")
--}
--
--model slack_installations {
-- id String
-- created_at DateTime @default(now()) @db.Timestamptz(6)
-- devbook_app_id String
-- installation_data Json
--
-- @@id([id, devbook_app_id])
-- @@schema("public")
--}
--
model teams {
- id String @id @default(dbgenerated("uuid_generate_v4()")) @db.Uuid
- created_at DateTime @default(now()) @db.Timestamptz(6)
- id String @id @default(dbgenerated("uuid_generate_v4()")) @db.Uuid
- created_at DateTime @default(now()) @db.Timestamptz(6)
-- name String?
- is_default Boolean @default(false)
- api_deployments api_deployments[]
- is_default Boolean @default(false)
- api_deployments api_deployments?
-- apps apps[]
-- users_teams users_teams[]
--
-- @@schema("public")
--}
++ id String @id @default(dbgenerated("uuid_generate_v4()")) @db.Uuid
++ created_at DateTime? @default(now()) @db.Timestamptz(6)
++ is_default Boolean?
++ name String?
++ users_teams users_teams[]
--model user_feedback {
-- id BigInt @id @default(autoincrement())
-- created_at DateTime? @default(now()) @db.Timestamptz(6)
-- user_id String? @db.Uuid
-- feedback String?
-- users auth_users? @relation(fields: [user_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
--
-- @@schema("public")
--}
--
--model public_users {
-- id String @id @db.Uuid
-- created_at DateTime? @default(now()) @db.Timestamptz(6)
-- email String?
-- users auth_users @relation(fields: [id], references: [id], onDelete: NoAction, onUpdate: NoAction)
--
-- @@map("users")
@@schema("public")
}
model users_teams {
-- created_at DateTime @default(now()) @db.Timestamptz(6)
user_id String @db.Uuid
++ created_at DateTime? @default(now()) @db.Timestamptz(6)
team_id String @db.Uuid
teams teams @relation(fields: [team_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
users auth_users @relation(fields: [user_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
@@@ -369,24 -369,22 +250,19 @@@
@@schema("public")
}
--model github_repositories {
-- repository_id BigInt @id(map: "github_installations_pkey") @default(autoincrement())
-- installation_id BigInt
-- installated_at DateTime @default(now()) @db.Timestamptz(6)
-- repository_fullname String
-- apps apps[]
++model deployments {
++ id String @id @default(dbgenerated("uuid_generate_v4()")) @db.Uuid
++ created_at DateTime? @default(now()) @db.Timestamptz(6)
++ logs Json[]
++ code String?
@@schema("public")
}
--model api_deployments {
-- id BigInt @id(map: "deployments_pkey") @default(autoincrement())
++model projects {
++ id String @id(map: "ai_api_pkey") @default("")
created_at DateTime? @default(now()) @db.Timestamptz(6)
-- data Json
- team_id String? @db.Uuid
- code Json?
- logs Json?
- teams teams? @relation(fields: [team_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
- team_id String @unique @db.Uuid
- teams teams @relation(fields: [team_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
++ data Json?
@@schema("public")
}
@@@ -412,41 -410,41 +288,3 @@@ enum factor_type
@@schema("auth")
}
--
--enum env_state {
-- Building
-- Failed
-- Done
-- None
--
-- @@schema("public")
--}
--
--enum template {
-- Nodejs
-- Go
-- Bash
-- Python3
-- Java
-- Rust
-- Perl
-- PHP
-- Ansys
-- Typescript
--
-- @@schema("public")
--}
--
--enum template_old {
-- None
-- Nodejs
-- Go
-- Bash
-- Python
-- Java
-- Rust
-- Perl
-- PHP
--
-- @@schema("public")
--}