mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-18 21:16:29 -06:00
Conexão com o banco feita
This commit is contained in:
parent
39606240da
commit
67e8ab0488
77
package-lock.json
generated
77
package-lock.json
generated
@ -43,7 +43,7 @@
|
|||||||
"mime": "^4.0.0",
|
"mime": "^4.0.0",
|
||||||
"mime-types": "^2.1.35",
|
"mime-types": "^2.1.35",
|
||||||
"minio": "^8.0.3",
|
"minio": "^8.0.3",
|
||||||
"multer": "^1.4.5-lts.1",
|
"multer": "^2.0.1",
|
||||||
"nats": "^2.29.1",
|
"nats": "^2.29.1",
|
||||||
"node-cache": "^5.1.2",
|
"node-cache": "^5.1.2",
|
||||||
"node-cron": "^3.0.3",
|
"node-cron": "^3.0.3",
|
||||||
@ -5421,51 +5421,20 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/concat-stream": {
|
"node_modules/concat-stream": {
|
||||||
"version": "1.6.2",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
|
"resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz",
|
||||||
"integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
|
"integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==",
|
||||||
"engines": [
|
"engines": [
|
||||||
"node >= 0.8"
|
"node >= 6.0"
|
||||||
],
|
],
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"buffer-from": "^1.0.0",
|
"buffer-from": "^1.0.0",
|
||||||
"inherits": "^2.0.3",
|
"inherits": "^2.0.3",
|
||||||
"readable-stream": "^2.2.2",
|
"readable-stream": "^3.0.2",
|
||||||
"typedarray": "^0.0.6"
|
"typedarray": "^0.0.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/concat-stream/node_modules/isarray": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
|
||||||
"integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ=="
|
|
||||||
},
|
|
||||||
"node_modules/concat-stream/node_modules/readable-stream": {
|
|
||||||
"version": "2.3.8",
|
|
||||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
|
|
||||||
"integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
|
|
||||||
"dependencies": {
|
|
||||||
"core-util-is": "~1.0.0",
|
|
||||||
"inherits": "~2.0.3",
|
|
||||||
"isarray": "~1.0.0",
|
|
||||||
"process-nextick-args": "~2.0.0",
|
|
||||||
"safe-buffer": "~5.1.1",
|
|
||||||
"string_decoder": "~1.1.1",
|
|
||||||
"util-deprecate": "~1.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/concat-stream/node_modules/safe-buffer": {
|
|
||||||
"version": "5.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
|
||||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
|
||||||
},
|
|
||||||
"node_modules/concat-stream/node_modules/string_decoder": {
|
|
||||||
"version": "1.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
|
||||||
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
|
|
||||||
"dependencies": {
|
|
||||||
"safe-buffer": "~5.1.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/consola": {
|
"node_modules/consola": {
|
||||||
"version": "3.4.2",
|
"version": "3.4.2",
|
||||||
"resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz",
|
"resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz",
|
||||||
@ -5506,11 +5475,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
|
||||||
"integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ=="
|
"integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ=="
|
||||||
},
|
},
|
||||||
"node_modules/core-util-is": {
|
|
||||||
"version": "1.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
|
|
||||||
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
|
|
||||||
},
|
|
||||||
"node_modules/cors": {
|
"node_modules/cors": {
|
||||||
"version": "2.8.5",
|
"version": "2.8.5",
|
||||||
"resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz",
|
"resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz",
|
||||||
@ -8662,20 +8626,21 @@
|
|||||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
|
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
|
||||||
},
|
},
|
||||||
"node_modules/multer": {
|
"node_modules/multer": {
|
||||||
"version": "1.4.5-lts.2",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.2.tgz",
|
"resolved": "https://registry.npmjs.org/multer/-/multer-2.0.1.tgz",
|
||||||
"integrity": "sha512-VzGiVigcG9zUAoCNU+xShztrlr1auZOlurXynNvO9GiWD1/mTBbUljOKY+qMeazBqXgRnjzeEgJI/wyjJUHg9A==",
|
"integrity": "sha512-Ug8bXeTIUlxurg8xLTEskKShvcKDZALo1THEX5E41pYCD2sCVub5/kIRIGqWNoqV6szyLyQKV6mD4QUrWE5GCQ==",
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"append-field": "^1.0.0",
|
"append-field": "^1.0.0",
|
||||||
"busboy": "^1.0.0",
|
"busboy": "^1.6.0",
|
||||||
"concat-stream": "^1.5.2",
|
"concat-stream": "^2.0.0",
|
||||||
"mkdirp": "^0.5.4",
|
"mkdirp": "^0.5.6",
|
||||||
"object-assign": "^4.1.1",
|
"object-assign": "^4.1.1",
|
||||||
"type-is": "^1.6.4",
|
"type-is": "^1.6.18",
|
||||||
"xtend": "^4.0.0"
|
"xtend": "^4.0.2"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 6.0.0"
|
"node": ">= 10.16.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/music-metadata": {
|
"node_modules/music-metadata": {
|
||||||
@ -9722,11 +9687,6 @@
|
|||||||
"node": ">= 0.6.0"
|
"node": ">= 0.6.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/process-nextick-args": {
|
|
||||||
"version": "2.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
|
||||||
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
|
|
||||||
},
|
|
||||||
"node_modules/process-warning": {
|
"node_modules/process-warning": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/process-warning/-/process-warning-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/process-warning/-/process-warning-3.0.0.tgz",
|
||||||
@ -11867,7 +11827,8 @@
|
|||||||
"node_modules/typedarray": {
|
"node_modules/typedarray": {
|
||||||
"version": "0.0.6",
|
"version": "0.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
|
||||||
"integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA=="
|
"integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==",
|
||||||
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/typescript": {
|
"node_modules/typescript": {
|
||||||
"version": "5.8.3",
|
"version": "5.8.3",
|
||||||
|
@ -83,7 +83,7 @@
|
|||||||
"mime": "^4.0.0",
|
"mime": "^4.0.0",
|
||||||
"mime-types": "^2.1.35",
|
"mime-types": "^2.1.35",
|
||||||
"minio": "^8.0.3",
|
"minio": "^8.0.3",
|
||||||
"multer": "^1.4.5-lts.1",
|
"multer": "^2.0.1",
|
||||||
"nats": "^2.29.1",
|
"nats": "^2.29.1",
|
||||||
"node-cache": "^5.1.2",
|
"node-cache": "^5.1.2",
|
||||||
"node-cron": "^3.0.3",
|
"node-cron": "^3.0.3",
|
||||||
|
751
prisma/schema.prisma
Normal file
751
prisma/schema.prisma
Normal file
@ -0,0 +1,751 @@
|
|||||||
|
// This is your Prisma schema file,
|
||||||
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
||||||
|
|
||||||
|
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
|
||||||
|
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
|
||||||
|
|
||||||
|
generator client {
|
||||||
|
provider = "prisma-client-js"
|
||||||
|
}
|
||||||
|
|
||||||
|
datasource db {
|
||||||
|
provider = "postgresql"
|
||||||
|
url = env("DATABASE_CONNECTION_URI")
|
||||||
|
}
|
||||||
|
|
||||||
|
enum InstanceConnectionStatus {
|
||||||
|
open
|
||||||
|
close
|
||||||
|
connecting
|
||||||
|
}
|
||||||
|
|
||||||
|
enum DeviceMessage {
|
||||||
|
ios
|
||||||
|
android
|
||||||
|
web
|
||||||
|
unknown
|
||||||
|
desktop
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SessionStatus {
|
||||||
|
opened
|
||||||
|
closed
|
||||||
|
paused
|
||||||
|
}
|
||||||
|
|
||||||
|
enum TriggerType {
|
||||||
|
all
|
||||||
|
keyword
|
||||||
|
none
|
||||||
|
advanced
|
||||||
|
}
|
||||||
|
|
||||||
|
enum TriggerOperator {
|
||||||
|
contains
|
||||||
|
equals
|
||||||
|
startsWith
|
||||||
|
endsWith
|
||||||
|
regex
|
||||||
|
}
|
||||||
|
|
||||||
|
enum OpenaiBotType {
|
||||||
|
assistant
|
||||||
|
chatCompletion
|
||||||
|
}
|
||||||
|
|
||||||
|
enum DifyBotType {
|
||||||
|
chatBot
|
||||||
|
textGenerator
|
||||||
|
agent
|
||||||
|
workflow
|
||||||
|
}
|
||||||
|
|
||||||
|
model Instance {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
name String @unique @db.VarChar(255)
|
||||||
|
connectionStatus InstanceConnectionStatus @default(open)
|
||||||
|
ownerJid String? @db.VarChar(100)
|
||||||
|
profileName String? @db.VarChar(100)
|
||||||
|
profilePicUrl String? @db.VarChar(500)
|
||||||
|
integration String? @db.VarChar(100)
|
||||||
|
number String? @db.VarChar(100)
|
||||||
|
businessId String? @db.VarChar(100)
|
||||||
|
token String? @db.VarChar(255)
|
||||||
|
clientName String? @db.VarChar(100)
|
||||||
|
disconnectionReasonCode Int? @db.Integer
|
||||||
|
disconnectionObject Json? @db.JsonB
|
||||||
|
disconnectionAt DateTime? @db.Timestamp
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime? @updatedAt @db.Timestamp
|
||||||
|
Chat Chat[]
|
||||||
|
Contact Contact[]
|
||||||
|
Message Message[]
|
||||||
|
Webhook Webhook?
|
||||||
|
Chatwoot Chatwoot?
|
||||||
|
Label Label[]
|
||||||
|
Proxy Proxy?
|
||||||
|
Setting Setting?
|
||||||
|
Rabbitmq Rabbitmq?
|
||||||
|
Nats Nats?
|
||||||
|
Sqs Sqs?
|
||||||
|
Websocket Websocket?
|
||||||
|
Typebot Typebot[]
|
||||||
|
Session Session?
|
||||||
|
MessageUpdate MessageUpdate[]
|
||||||
|
TypebotSetting TypebotSetting?
|
||||||
|
Media Media[]
|
||||||
|
OpenaiCreds OpenaiCreds[]
|
||||||
|
OpenaiBot OpenaiBot[]
|
||||||
|
OpenaiSetting OpenaiSetting?
|
||||||
|
Template Template[]
|
||||||
|
Dify Dify[]
|
||||||
|
DifySetting DifySetting?
|
||||||
|
IntegrationSession IntegrationSession[]
|
||||||
|
EvolutionBot EvolutionBot[]
|
||||||
|
EvolutionBotSetting EvolutionBotSetting?
|
||||||
|
Flowise Flowise[]
|
||||||
|
FlowiseSetting FlowiseSetting?
|
||||||
|
Pusher Pusher?
|
||||||
|
N8n N8n[]
|
||||||
|
N8nSetting N8nSetting[]
|
||||||
|
Evoai Evoai[]
|
||||||
|
EvoaiSetting EvoaiSetting?
|
||||||
|
}
|
||||||
|
|
||||||
|
model Session {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
sessionId String @unique
|
||||||
|
creds String? @db.Text
|
||||||
|
createdAt DateTime @default(now()) @db.Timestamp
|
||||||
|
Instance Instance @relation(fields: [sessionId], references: [id], onDelete: Cascade)
|
||||||
|
}
|
||||||
|
|
||||||
|
model Chat {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
remoteJid String @db.VarChar(100)
|
||||||
|
name String? @db.VarChar(100)
|
||||||
|
labels Json? @db.JsonB
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime? @updatedAt @db.Timestamp
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String
|
||||||
|
unreadMessages Int @default(0)
|
||||||
|
|
||||||
|
@@index([instanceId])
|
||||||
|
@@index([remoteJid])
|
||||||
|
}
|
||||||
|
|
||||||
|
model Contact {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
remoteJid String @db.VarChar(100)
|
||||||
|
pushName String? @db.VarChar(100)
|
||||||
|
profilePicUrl String? @db.VarChar(500)
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime? @updatedAt @db.Timestamp
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String
|
||||||
|
|
||||||
|
@@unique([remoteJid, instanceId])
|
||||||
|
@@index([remoteJid])
|
||||||
|
@@index([instanceId])
|
||||||
|
}
|
||||||
|
|
||||||
|
model Message {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
key Json @db.JsonB
|
||||||
|
pushName String? @db.VarChar(100)
|
||||||
|
participant String? @db.VarChar(100)
|
||||||
|
messageType String @db.VarChar(100)
|
||||||
|
message Json @db.JsonB
|
||||||
|
contextInfo Json? @db.JsonB
|
||||||
|
source DeviceMessage
|
||||||
|
messageTimestamp Int @db.Integer
|
||||||
|
chatwootMessageId Int? @db.Integer
|
||||||
|
chatwootInboxId Int? @db.Integer
|
||||||
|
chatwootConversationId Int? @db.Integer
|
||||||
|
chatwootContactInboxSourceId String? @db.VarChar(100)
|
||||||
|
chatwootIsRead Boolean? @db.Boolean
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String
|
||||||
|
MessageUpdate MessageUpdate[]
|
||||||
|
Media Media?
|
||||||
|
webhookUrl String? @db.VarChar(500)
|
||||||
|
status String? @db.VarChar(30)
|
||||||
|
|
||||||
|
sessionId String?
|
||||||
|
session IntegrationSession? @relation(fields: [sessionId], references: [id])
|
||||||
|
|
||||||
|
@@index([instanceId])
|
||||||
|
}
|
||||||
|
|
||||||
|
model MessageUpdate {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
keyId String @db.VarChar(100)
|
||||||
|
remoteJid String @db.VarChar(100)
|
||||||
|
fromMe Boolean @db.Boolean
|
||||||
|
participant String? @db.VarChar(100)
|
||||||
|
pollUpdates Json? @db.JsonB
|
||||||
|
status String @db.VarChar(30)
|
||||||
|
Message Message @relation(fields: [messageId], references: [id], onDelete: Cascade)
|
||||||
|
messageId String
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String
|
||||||
|
|
||||||
|
@@index([instanceId])
|
||||||
|
@@index([messageId])
|
||||||
|
}
|
||||||
|
|
||||||
|
model Webhook {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
url String @db.VarChar(500)
|
||||||
|
headers Json? @db.JsonB
|
||||||
|
enabled Boolean? @default(true) @db.Boolean
|
||||||
|
events Json? @db.JsonB
|
||||||
|
webhookByEvents Boolean? @default(false) @db.Boolean
|
||||||
|
webhookBase64 Boolean? @default(false) @db.Boolean
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String @unique
|
||||||
|
|
||||||
|
@@index([instanceId])
|
||||||
|
}
|
||||||
|
|
||||||
|
model Chatwoot {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
enabled Boolean? @default(true) @db.Boolean
|
||||||
|
accountId String? @db.VarChar(100)
|
||||||
|
token String? @db.VarChar(100)
|
||||||
|
url String? @db.VarChar(500)
|
||||||
|
nameInbox String? @db.VarChar(100)
|
||||||
|
signMsg Boolean? @default(false) @db.Boolean
|
||||||
|
signDelimiter String? @db.VarChar(100)
|
||||||
|
number String? @db.VarChar(100)
|
||||||
|
reopenConversation Boolean? @default(false) @db.Boolean
|
||||||
|
conversationPending Boolean? @default(false) @db.Boolean
|
||||||
|
mergeBrazilContacts Boolean? @default(false) @db.Boolean
|
||||||
|
importContacts Boolean? @default(false) @db.Boolean
|
||||||
|
importMessages Boolean? @default(false) @db.Boolean
|
||||||
|
daysLimitImportMessages Int? @db.Integer
|
||||||
|
organization String? @db.VarChar(100)
|
||||||
|
logo String? @db.VarChar(500)
|
||||||
|
ignoreJids Json?
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String @unique
|
||||||
|
}
|
||||||
|
|
||||||
|
model Label {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
labelId String? @db.VarChar(100)
|
||||||
|
name String @db.VarChar(100)
|
||||||
|
color String @db.VarChar(100)
|
||||||
|
predefinedId String? @db.VarChar(100)
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String
|
||||||
|
|
||||||
|
@@unique([labelId, instanceId])
|
||||||
|
}
|
||||||
|
|
||||||
|
model Proxy {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
enabled Boolean @default(false) @db.Boolean
|
||||||
|
host String @db.VarChar(100)
|
||||||
|
port String @db.VarChar(100)
|
||||||
|
protocol String @db.VarChar(100)
|
||||||
|
username String @db.VarChar(100)
|
||||||
|
password String @db.VarChar(100)
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String @unique
|
||||||
|
}
|
||||||
|
|
||||||
|
model Setting {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
rejectCall Boolean @default(false) @db.Boolean
|
||||||
|
msgCall String? @db.VarChar(100)
|
||||||
|
groupsIgnore Boolean @default(false) @db.Boolean
|
||||||
|
alwaysOnline Boolean @default(false) @db.Boolean
|
||||||
|
readMessages Boolean @default(false) @db.Boolean
|
||||||
|
readStatus Boolean @default(false) @db.Boolean
|
||||||
|
syncFullHistory Boolean @default(false) @db.Boolean
|
||||||
|
wavoipToken String? @db.VarChar(100)
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String @unique
|
||||||
|
|
||||||
|
@@index([instanceId])
|
||||||
|
}
|
||||||
|
|
||||||
|
model Rabbitmq {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
enabled Boolean @default(false) @db.Boolean
|
||||||
|
events Json @db.JsonB
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String @unique
|
||||||
|
}
|
||||||
|
|
||||||
|
model Nats {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
enabled Boolean @default(false) @db.Boolean
|
||||||
|
events Json @db.JsonB
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String @unique
|
||||||
|
}
|
||||||
|
|
||||||
|
model Sqs {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
enabled Boolean @default(false) @db.Boolean
|
||||||
|
events Json @db.JsonB
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String @unique
|
||||||
|
}
|
||||||
|
|
||||||
|
model Websocket {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
enabled Boolean @default(false) @db.Boolean
|
||||||
|
events Json @db.JsonB
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String @unique
|
||||||
|
}
|
||||||
|
|
||||||
|
model Pusher {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
enabled Boolean @default(false) @db.Boolean
|
||||||
|
appId String @db.VarChar(100)
|
||||||
|
key String @db.VarChar(100)
|
||||||
|
secret String @db.VarChar(100)
|
||||||
|
cluster String @db.VarChar(100)
|
||||||
|
useTLS Boolean @default(false) @db.Boolean
|
||||||
|
events Json @db.JsonB
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String @unique
|
||||||
|
}
|
||||||
|
|
||||||
|
model Typebot {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
enabled Boolean @default(true) @db.Boolean
|
||||||
|
description String? @db.VarChar(255)
|
||||||
|
url String @db.VarChar(500)
|
||||||
|
typebot String @db.VarChar(100)
|
||||||
|
expire Int? @default(0) @db.Integer
|
||||||
|
keywordFinish String? @db.VarChar(100)
|
||||||
|
delayMessage Int? @db.Integer
|
||||||
|
unknownMessage String? @db.VarChar(100)
|
||||||
|
listeningFromMe Boolean? @default(false) @db.Boolean
|
||||||
|
stopBotFromMe Boolean? @default(false) @db.Boolean
|
||||||
|
keepOpen Boolean? @default(false) @db.Boolean
|
||||||
|
debounceTime Int? @db.Integer
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime? @updatedAt @db.Timestamp
|
||||||
|
ignoreJids Json?
|
||||||
|
triggerType TriggerType?
|
||||||
|
triggerOperator TriggerOperator?
|
||||||
|
triggerValue String?
|
||||||
|
splitMessages Boolean? @default(false) @db.Boolean
|
||||||
|
timePerChar Int? @default(50) @db.Integer
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String
|
||||||
|
TypebotSetting TypebotSetting[]
|
||||||
|
}
|
||||||
|
|
||||||
|
model TypebotSetting {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
expire Int? @default(0) @db.Integer
|
||||||
|
keywordFinish String? @db.VarChar(100)
|
||||||
|
delayMessage Int? @db.Integer
|
||||||
|
unknownMessage String? @db.VarChar(100)
|
||||||
|
listeningFromMe Boolean? @default(false) @db.Boolean
|
||||||
|
stopBotFromMe Boolean? @default(false) @db.Boolean
|
||||||
|
keepOpen Boolean? @default(false) @db.Boolean
|
||||||
|
debounceTime Int? @db.Integer
|
||||||
|
typebotIdFallback String? @db.VarChar(100)
|
||||||
|
ignoreJids Json?
|
||||||
|
splitMessages Boolean? @default(false) @db.Boolean
|
||||||
|
timePerChar Int? @default(50) @db.Integer
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
|
Fallback Typebot? @relation(fields: [typebotIdFallback], references: [id])
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String @unique
|
||||||
|
}
|
||||||
|
|
||||||
|
model Media {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
fileName String @db.VarChar(500)
|
||||||
|
type String @db.VarChar(100)
|
||||||
|
mimetype String @db.VarChar(100)
|
||||||
|
createdAt DateTime? @default(now()) @db.Date
|
||||||
|
Message Message @relation(fields: [messageId], references: [id], onDelete: Cascade)
|
||||||
|
messageId String @unique
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String
|
||||||
|
}
|
||||||
|
|
||||||
|
model OpenaiCreds {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
name String? @unique @db.VarChar(255)
|
||||||
|
apiKey String? @unique @db.VarChar(255)
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String
|
||||||
|
OpenaiAssistant OpenaiBot[]
|
||||||
|
OpenaiSetting OpenaiSetting?
|
||||||
|
}
|
||||||
|
|
||||||
|
model OpenaiBot {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
enabled Boolean @default(true) @db.Boolean
|
||||||
|
description String? @db.VarChar(255)
|
||||||
|
botType OpenaiBotType
|
||||||
|
assistantId String? @db.VarChar(255)
|
||||||
|
functionUrl String? @db.VarChar(500)
|
||||||
|
model String? @db.VarChar(100)
|
||||||
|
systemMessages Json? @db.JsonB
|
||||||
|
assistantMessages Json? @db.JsonB
|
||||||
|
userMessages Json? @db.JsonB
|
||||||
|
maxTokens Int? @db.Integer
|
||||||
|
expire Int? @default(0) @db.Integer
|
||||||
|
keywordFinish String? @db.VarChar(100)
|
||||||
|
delayMessage Int? @db.Integer
|
||||||
|
unknownMessage String? @db.VarChar(100)
|
||||||
|
listeningFromMe Boolean? @default(false) @db.Boolean
|
||||||
|
stopBotFromMe Boolean? @default(false) @db.Boolean
|
||||||
|
keepOpen Boolean? @default(false) @db.Boolean
|
||||||
|
debounceTime Int? @db.Integer
|
||||||
|
splitMessages Boolean? @default(false) @db.Boolean
|
||||||
|
timePerChar Int? @default(50) @db.Integer
|
||||||
|
ignoreJids Json?
|
||||||
|
triggerType TriggerType?
|
||||||
|
triggerOperator TriggerOperator?
|
||||||
|
triggerValue String?
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
|
OpenaiCreds OpenaiCreds @relation(fields: [openaiCredsId], references: [id], onDelete: Cascade)
|
||||||
|
openaiCredsId String
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String
|
||||||
|
OpenaiSetting OpenaiSetting[]
|
||||||
|
}
|
||||||
|
|
||||||
|
model IntegrationSession {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
sessionId String @db.VarChar(255)
|
||||||
|
remoteJid String @db.VarChar(100)
|
||||||
|
pushName String?
|
||||||
|
status SessionStatus
|
||||||
|
awaitUser Boolean @default(false) @db.Boolean
|
||||||
|
context Json?
|
||||||
|
type String? @db.VarChar(100)
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
|
Message Message[]
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String
|
||||||
|
parameters Json? @db.JsonB
|
||||||
|
|
||||||
|
botId String?
|
||||||
|
}
|
||||||
|
|
||||||
|
model OpenaiSetting {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
expire Int? @default(0) @db.Integer
|
||||||
|
keywordFinish String? @db.VarChar(100)
|
||||||
|
delayMessage Int? @db.Integer
|
||||||
|
unknownMessage String? @db.VarChar(100)
|
||||||
|
listeningFromMe Boolean? @default(false) @db.Boolean
|
||||||
|
stopBotFromMe Boolean? @default(false) @db.Boolean
|
||||||
|
keepOpen Boolean? @default(false) @db.Boolean
|
||||||
|
debounceTime Int? @db.Integer
|
||||||
|
ignoreJids Json?
|
||||||
|
splitMessages Boolean? @default(false) @db.Boolean
|
||||||
|
timePerChar Int? @default(50) @db.Integer
|
||||||
|
speechToText Boolean? @default(false) @db.Boolean
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
|
OpenaiCreds OpenaiCreds? @relation(fields: [openaiCredsId], references: [id])
|
||||||
|
openaiCredsId String @unique
|
||||||
|
Fallback OpenaiBot? @relation(fields: [openaiIdFallback], references: [id])
|
||||||
|
openaiIdFallback String? @db.VarChar(100)
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String @unique
|
||||||
|
}
|
||||||
|
|
||||||
|
model Template {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
templateId String @unique @db.VarChar(255)
|
||||||
|
name String @unique @db.VarChar(255)
|
||||||
|
template Json @db.JsonB
|
||||||
|
webhookUrl String? @db.VarChar(500)
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String
|
||||||
|
}
|
||||||
|
|
||||||
|
model Dify {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
enabled Boolean @default(true) @db.Boolean
|
||||||
|
description String? @db.VarChar(255)
|
||||||
|
botType DifyBotType
|
||||||
|
apiUrl String? @db.VarChar(255)
|
||||||
|
apiKey String? @db.VarChar(255)
|
||||||
|
expire Int? @default(0) @db.Integer
|
||||||
|
keywordFinish String? @db.VarChar(100)
|
||||||
|
delayMessage Int? @db.Integer
|
||||||
|
unknownMessage String? @db.VarChar(100)
|
||||||
|
listeningFromMe Boolean? @default(false) @db.Boolean
|
||||||
|
stopBotFromMe Boolean? @default(false) @db.Boolean
|
||||||
|
keepOpen Boolean? @default(false) @db.Boolean
|
||||||
|
debounceTime Int? @db.Integer
|
||||||
|
ignoreJids Json?
|
||||||
|
splitMessages Boolean? @default(false) @db.Boolean
|
||||||
|
timePerChar Int? @default(50) @db.Integer
|
||||||
|
triggerType TriggerType?
|
||||||
|
triggerOperator TriggerOperator?
|
||||||
|
triggerValue String?
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String
|
||||||
|
DifySetting DifySetting[]
|
||||||
|
}
|
||||||
|
|
||||||
|
model DifySetting {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
expire Int? @default(0) @db.Integer
|
||||||
|
keywordFinish String? @db.VarChar(100)
|
||||||
|
delayMessage Int? @db.Integer
|
||||||
|
unknownMessage String? @db.VarChar(100)
|
||||||
|
listeningFromMe Boolean? @default(false) @db.Boolean
|
||||||
|
stopBotFromMe Boolean? @default(false) @db.Boolean
|
||||||
|
keepOpen Boolean? @default(false) @db.Boolean
|
||||||
|
debounceTime Int? @db.Integer
|
||||||
|
ignoreJids Json?
|
||||||
|
splitMessages Boolean? @default(false) @db.Boolean
|
||||||
|
timePerChar Int? @default(50) @db.Integer
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
|
Fallback Dify? @relation(fields: [difyIdFallback], references: [id])
|
||||||
|
difyIdFallback String? @db.VarChar(100)
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String @unique
|
||||||
|
}
|
||||||
|
|
||||||
|
model EvolutionBot {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
enabled Boolean @default(true) @db.Boolean
|
||||||
|
description String? @db.VarChar(255)
|
||||||
|
apiUrl String? @db.VarChar(255)
|
||||||
|
apiKey String? @db.VarChar(255)
|
||||||
|
expire Int? @default(0) @db.Integer
|
||||||
|
keywordFinish String? @db.VarChar(100)
|
||||||
|
delayMessage Int? @db.Integer
|
||||||
|
unknownMessage String? @db.VarChar(100)
|
||||||
|
listeningFromMe Boolean? @default(false) @db.Boolean
|
||||||
|
stopBotFromMe Boolean? @default(false) @db.Boolean
|
||||||
|
keepOpen Boolean? @default(false) @db.Boolean
|
||||||
|
debounceTime Int? @db.Integer
|
||||||
|
ignoreJids Json?
|
||||||
|
splitMessages Boolean? @default(false) @db.Boolean
|
||||||
|
timePerChar Int? @default(50) @db.Integer
|
||||||
|
triggerType TriggerType?
|
||||||
|
triggerOperator TriggerOperator?
|
||||||
|
triggerValue String?
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String
|
||||||
|
EvolutionBotSetting EvolutionBotSetting[]
|
||||||
|
}
|
||||||
|
|
||||||
|
model EvolutionBotSetting {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
expire Int? @default(0) @db.Integer
|
||||||
|
keywordFinish String? @db.VarChar(100)
|
||||||
|
delayMessage Int? @db.Integer
|
||||||
|
unknownMessage String? @db.VarChar(100)
|
||||||
|
listeningFromMe Boolean? @default(false) @db.Boolean
|
||||||
|
stopBotFromMe Boolean? @default(false) @db.Boolean
|
||||||
|
keepOpen Boolean? @default(false) @db.Boolean
|
||||||
|
debounceTime Int? @db.Integer
|
||||||
|
ignoreJids Json?
|
||||||
|
splitMessages Boolean? @default(false) @db.Boolean
|
||||||
|
timePerChar Int? @default(50) @db.Integer
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
|
Fallback EvolutionBot? @relation(fields: [botIdFallback], references: [id])
|
||||||
|
botIdFallback String? @db.VarChar(100)
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String @unique
|
||||||
|
}
|
||||||
|
|
||||||
|
model Flowise {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
enabled Boolean @default(true) @db.Boolean
|
||||||
|
description String? @db.VarChar(255)
|
||||||
|
apiUrl String? @db.VarChar(255)
|
||||||
|
apiKey String? @db.VarChar(255)
|
||||||
|
expire Int? @default(0) @db.Integer
|
||||||
|
keywordFinish String? @db.VarChar(100)
|
||||||
|
delayMessage Int? @db.Integer
|
||||||
|
unknownMessage String? @db.VarChar(100)
|
||||||
|
listeningFromMe Boolean? @default(false) @db.Boolean
|
||||||
|
stopBotFromMe Boolean? @default(false) @db.Boolean
|
||||||
|
keepOpen Boolean? @default(false) @db.Boolean
|
||||||
|
debounceTime Int? @db.Integer
|
||||||
|
ignoreJids Json?
|
||||||
|
splitMessages Boolean? @default(false) @db.Boolean
|
||||||
|
timePerChar Int? @default(50) @db.Integer
|
||||||
|
triggerType TriggerType?
|
||||||
|
triggerOperator TriggerOperator?
|
||||||
|
triggerValue String?
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String
|
||||||
|
FlowiseSetting FlowiseSetting[]
|
||||||
|
}
|
||||||
|
|
||||||
|
model FlowiseSetting {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
expire Int? @default(0) @db.Integer
|
||||||
|
keywordFinish String? @db.VarChar(100)
|
||||||
|
delayMessage Int? @db.Integer
|
||||||
|
unknownMessage String? @db.VarChar(100)
|
||||||
|
listeningFromMe Boolean? @default(false) @db.Boolean
|
||||||
|
stopBotFromMe Boolean? @default(false) @db.Boolean
|
||||||
|
keepOpen Boolean? @default(false) @db.Boolean
|
||||||
|
debounceTime Int? @db.Integer
|
||||||
|
ignoreJids Json?
|
||||||
|
splitMessages Boolean? @default(false) @db.Boolean
|
||||||
|
timePerChar Int? @default(50) @db.Integer
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
|
Fallback Flowise? @relation(fields: [flowiseIdFallback], references: [id])
|
||||||
|
flowiseIdFallback String? @db.VarChar(100)
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String @unique
|
||||||
|
}
|
||||||
|
|
||||||
|
model IsOnWhatsapp {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
remoteJid String @unique @db.VarChar(100)
|
||||||
|
jidOptions String
|
||||||
|
lid String? @db.VarChar(100)
|
||||||
|
createdAt DateTime @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
|
}
|
||||||
|
|
||||||
|
model N8n {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
enabled Boolean @default(true) @db.Boolean
|
||||||
|
description String? @db.VarChar(255)
|
||||||
|
webhookUrl String? @db.VarChar(255)
|
||||||
|
basicAuthUser String? @db.VarChar(255)
|
||||||
|
basicAuthPass String? @db.VarChar(255)
|
||||||
|
expire Int? @default(0) @db.Integer
|
||||||
|
keywordFinish String? @db.VarChar(100)
|
||||||
|
delayMessage Int? @db.Integer
|
||||||
|
unknownMessage String? @db.VarChar(100)
|
||||||
|
listeningFromMe Boolean? @default(false) @db.Boolean
|
||||||
|
stopBotFromMe Boolean? @default(false) @db.Boolean
|
||||||
|
keepOpen Boolean? @default(false) @db.Boolean
|
||||||
|
debounceTime Int? @db.Integer
|
||||||
|
ignoreJids Json?
|
||||||
|
splitMessages Boolean? @default(false) @db.Boolean
|
||||||
|
timePerChar Int? @default(50) @db.Integer
|
||||||
|
triggerType TriggerType?
|
||||||
|
triggerOperator TriggerOperator?
|
||||||
|
triggerValue String?
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String
|
||||||
|
N8nSetting N8nSetting[]
|
||||||
|
}
|
||||||
|
|
||||||
|
model N8nSetting {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
expire Int? @default(0) @db.Integer
|
||||||
|
keywordFinish String? @db.VarChar(100)
|
||||||
|
delayMessage Int? @db.Integer
|
||||||
|
unknownMessage String? @db.VarChar(100)
|
||||||
|
listeningFromMe Boolean? @default(false) @db.Boolean
|
||||||
|
stopBotFromMe Boolean? @default(false) @db.Boolean
|
||||||
|
keepOpen Boolean? @default(false) @db.Boolean
|
||||||
|
debounceTime Int? @db.Integer
|
||||||
|
ignoreJids Json?
|
||||||
|
splitMessages Boolean? @default(false) @db.Boolean
|
||||||
|
timePerChar Int? @default(50) @db.Integer
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
|
Fallback N8n? @relation(fields: [n8nIdFallback], references: [id])
|
||||||
|
n8nIdFallback String? @db.VarChar(100)
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String @unique
|
||||||
|
}
|
||||||
|
|
||||||
|
model Evoai {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
enabled Boolean @default(true) @db.Boolean
|
||||||
|
description String? @db.VarChar(255)
|
||||||
|
agentUrl String? @db.VarChar(255)
|
||||||
|
apiKey String? @db.VarChar(255)
|
||||||
|
expire Int? @default(0) @db.Integer
|
||||||
|
keywordFinish String? @db.VarChar(100)
|
||||||
|
delayMessage Int? @db.Integer
|
||||||
|
unknownMessage String? @db.VarChar(100)
|
||||||
|
listeningFromMe Boolean? @default(false) @db.Boolean
|
||||||
|
stopBotFromMe Boolean? @default(false) @db.Boolean
|
||||||
|
keepOpen Boolean? @default(false) @db.Boolean
|
||||||
|
debounceTime Int? @db.Integer
|
||||||
|
ignoreJids Json?
|
||||||
|
splitMessages Boolean? @default(false) @db.Boolean
|
||||||
|
timePerChar Int? @default(50) @db.Integer
|
||||||
|
triggerType TriggerType?
|
||||||
|
triggerOperator TriggerOperator?
|
||||||
|
triggerValue String?
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String
|
||||||
|
EvoaiSetting EvoaiSetting[]
|
||||||
|
}
|
||||||
|
|
||||||
|
model EvoaiSetting {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
expire Int? @default(0) @db.Integer
|
||||||
|
keywordFinish String? @db.VarChar(100)
|
||||||
|
delayMessage Int? @db.Integer
|
||||||
|
unknownMessage String? @db.VarChar(100)
|
||||||
|
listeningFromMe Boolean? @default(false) @db.Boolean
|
||||||
|
stopBotFromMe Boolean? @default(false) @db.Boolean
|
||||||
|
keepOpen Boolean? @default(false) @db.Boolean
|
||||||
|
debounceTime Int? @db.Integer
|
||||||
|
ignoreJids Json?
|
||||||
|
splitMessages Boolean? @default(false) @db.Boolean
|
||||||
|
timePerChar Int? @default(50) @db.Integer
|
||||||
|
createdAt DateTime? @default(now()) @db.Timestamp
|
||||||
|
updatedAt DateTime @updatedAt @db.Timestamp
|
||||||
|
Fallback Evoai? @relation(fields: [evoaiIdFallback], references: [id])
|
||||||
|
evoaiIdFallback String? @db.VarChar(100)
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
instanceId String @unique
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user