schema.prisma•3.51 kB
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("APISERVER_DATABASE_URL")
}
model Application {
ref String @id @default(uuid())
accessKeyId String @map("access_key_id")
name String @db.VarChar(255)
type ApplicationType
endpoint String @db.VarChar(255)
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @map("updated_at")
// Relations
textToSpeech TextToSpeech?
speechToText SpeechToText?
intelligence Intelligence?
// Indexes and maps
@@index([accessKeyId], type: Hash)
@@map("applications")
}
model TextToSpeech {
ref String @id @default(uuid())
config Json
credentials String? @map("credentials_hash") /// @encrypted
// Relations
application Application @relation(fields: [applicationRef], references: [ref], onDelete: Cascade)
applicationRef String @unique @map("application_ref")
product Product @relation(fields: [productRef], references: [ref], onDelete: Cascade)
productRef String @map("product_ref")
// Indexes and maps
@@index([applicationRef], type: Hash)
@@index([productRef], type: Hash)
@@map("tts_services")
}
model SpeechToText {
ref String @id @default(uuid())
config Json
credentials String? @map("credentials_hash") /// @encrypted
// Relations
application Application @relation(fields: [applicationRef], references: [ref], onDelete: Cascade)
applicationRef String @unique @map("application_ref")
product Product @relation(fields: [productRef], references: [ref], onDelete: Cascade)
productRef String @map("product_ref")
// Indexes and maps
@@index([applicationRef], type: Hash)
@@index([productRef], type: Hash)
@@map("stt_services")
}
model Intelligence {
ref String @id @default(uuid())
config Json
credentials String? @map("credentials_hash") /// @encrypted
// Relations
application Application @relation(fields: [applicationRef], references: [ref], onDelete: Cascade)
applicationRef String @unique @map("application_ref")
Product Product @relation(fields: [productRef], references: [ref], onDelete: Cascade)
productRef String @map("product_ref")
// Indexes and maps
@@index([applicationRef], type: Hash)
@@index([productRef], type: Hash)
@@map("intelligence_services")
}
model Product {
ref String @id
name String
vendor ProductVendor
type ProductType
// Relations
speechToText SpeechToText[]
sextToSpeech TextToSpeech[]
intelligence Intelligence[]
// Indexes and maps
@@map("products")
}
model Secret {
ref String @id @default(uuid())
accessKeyId String @map("access_key_id")
name String
secret String @map("secret_hash") /// @encrypted
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @map("updated_at")
// Indexes and maps
@@index([accessKeyId], type: Hash)
@@index([name], type: Hash)
@@map("secrets")
}
enum ApplicationType {
EXTERNAL
AUTOPILOT
// Maps
@@map("application_types")
}
enum ProductType {
TTS
STT
LLM
// Maps
@@map("product_types")
}
enum ProductVendor {
GOOGLE
MICROSOFT
AMAZON
DEEPGRAM
IBM
RASA
OPENAI
GROQ
ANTHROPIC
ELEVEN_LABS
GENERIC
// Maps
@@map("product_vendors")
}