mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-14 01:41:24 -06:00
Merge pull request #862 from judsonjuniorr/v2-fix-chatwoot-reply-quote
V2 fix chatwoot reply quote
This commit is contained in:
commit
18ccccf344
@ -23,6 +23,7 @@ DEL_INSTANCE=false
|
|||||||
|
|
||||||
# Provider: postgresql | mysql
|
# Provider: postgresql | mysql
|
||||||
DATABASE_PROVIDER=postgresql
|
DATABASE_PROVIDER=postgresql
|
||||||
|
# DATABASE_DIRECT_URL='' # Direct connection to the database
|
||||||
DATABASE_CONNECTION_URI='postgresql://user:pass@localhost:5432/evolution?schema=public'
|
DATABASE_CONNECTION_URI='postgresql://user:pass@localhost:5432/evolution?schema=public'
|
||||||
# Client name for the database connection
|
# Client name for the database connection
|
||||||
# It is used to separate an API installation from another that uses the same database.
|
# It is used to separate an API installation from another that uses the same database.
|
||||||
|
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -12,5 +12,6 @@
|
|||||||
"prisma-smart-formatter.prisma.defaultFormatter": "Prisma.prisma",
|
"prisma-smart-formatter.prisma.defaultFormatter": "Prisma.prisma",
|
||||||
"i18n-ally.localesPaths": [
|
"i18n-ally.localesPaths": [
|
||||||
"store/messages"
|
"store/messages"
|
||||||
]
|
],
|
||||||
|
"typescript.tsdk": "node_modules/typescript/lib"
|
||||||
}
|
}
|
@ -1,23 +1,39 @@
|
|||||||
version: '3.3'
|
version: '3.3'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
api:
|
redis:
|
||||||
container_name: evolution_api
|
image: redis:latest
|
||||||
image: atendai/evolution-api:v2.0.9-rc
|
container_name: redis
|
||||||
restart: always
|
command: >
|
||||||
ports:
|
redis-server --port 6379 --appendonly yes
|
||||||
- 8080:8080
|
|
||||||
volumes:
|
|
||||||
- evolution_instances:/evolution/instances
|
|
||||||
networks:
|
networks:
|
||||||
- evolution-net
|
- evolution-net
|
||||||
env_file:
|
volumes:
|
||||||
- .env
|
- evolution_redis:/data
|
||||||
|
ports:
|
||||||
|
- 6379:6379
|
||||||
expose:
|
expose:
|
||||||
- 8080
|
- 6379
|
||||||
|
|
||||||
|
postgres:
|
||||||
|
container_name: postgres
|
||||||
|
image: postgres:15
|
||||||
|
networks:
|
||||||
|
- evolution-net
|
||||||
|
command: ["postgres", "-c", "max_connections=1000"]
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- 5432:5432
|
||||||
|
environment:
|
||||||
|
- POSTGRES_PASSWORD=PASSWORD
|
||||||
|
volumes:
|
||||||
|
- postgres_data:/var/lib/postgresql/data
|
||||||
|
expose:
|
||||||
|
- 5432
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
evolution_instances:
|
postgres_data:
|
||||||
|
evolution_redis:
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
evolution-net:
|
evolution-net:
|
||||||
|
@ -0,0 +1,929 @@
|
|||||||
|
/*
|
||||||
|
Warnings:
|
||||||
|
|
||||||
|
- You are about to drop the `Chat` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
- You are about to drop the `Chatwoot` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
- You are about to drop the `Contact` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
- You are about to drop the `Dify` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
- You are about to drop the `DifySetting` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
- You are about to drop the `EvolutionBot` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
- You are about to drop the `EvolutionBotSetting` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
- You are about to drop the `Flowise` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
- You are about to drop the `FlowiseSetting` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
- You are about to drop the `Instance` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
- You are about to drop the `IntegrationSession` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
- You are about to drop the `Label` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
- You are about to drop the `Media` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
- You are about to drop the `Message` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
- You are about to drop the `MessageUpdate` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
- You are about to drop the `OpenaiBot` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
- You are about to drop the `OpenaiCreds` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
- You are about to drop the `OpenaiSetting` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
- You are about to drop the `Proxy` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
- You are about to drop the `Rabbitmq` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
- You are about to drop the `Session` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
- You are about to drop the `Setting` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
- You are about to drop the `Sqs` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
- You are about to drop the `Template` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
- You are about to drop the `Typebot` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
- You are about to drop the `TypebotSetting` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
- You are about to drop the `Webhook` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
- You are about to drop the `Websocket` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
|
||||||
|
*/
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "Chat" DROP CONSTRAINT "Chat_instanceId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "Chatwoot" DROP CONSTRAINT "Chatwoot_instanceId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "Contact" DROP CONSTRAINT "Contact_instanceId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "Dify" DROP CONSTRAINT "Dify_instanceId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "DifySetting" DROP CONSTRAINT "DifySetting_difyIdFallback_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "DifySetting" DROP CONSTRAINT "DifySetting_instanceId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "EvolutionBot" DROP CONSTRAINT "EvolutionBot_instanceId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "EvolutionBotSetting" DROP CONSTRAINT "EvolutionBotSetting_botIdFallback_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "EvolutionBotSetting" DROP CONSTRAINT "EvolutionBotSetting_instanceId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "Flowise" DROP CONSTRAINT "Flowise_instanceId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "FlowiseSetting" DROP CONSTRAINT "FlowiseSetting_flowiseIdFallback_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "FlowiseSetting" DROP CONSTRAINT "FlowiseSetting_instanceId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "IntegrationSession" DROP CONSTRAINT "IntegrationSession_instanceId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "Label" DROP CONSTRAINT "Label_instanceId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "Media" DROP CONSTRAINT "Media_instanceId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "Media" DROP CONSTRAINT "Media_messageId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "Message" DROP CONSTRAINT "Message_instanceId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "Message" DROP CONSTRAINT "Message_sessionId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "MessageUpdate" DROP CONSTRAINT "MessageUpdate_instanceId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "MessageUpdate" DROP CONSTRAINT "MessageUpdate_messageId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "OpenaiBot" DROP CONSTRAINT "OpenaiBot_instanceId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "OpenaiBot" DROP CONSTRAINT "OpenaiBot_openaiCredsId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "OpenaiCreds" DROP CONSTRAINT "OpenaiCreds_instanceId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "OpenaiSetting" DROP CONSTRAINT "OpenaiSetting_instanceId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "OpenaiSetting" DROP CONSTRAINT "OpenaiSetting_openaiCredsId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "OpenaiSetting" DROP CONSTRAINT "OpenaiSetting_openaiIdFallback_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "Proxy" DROP CONSTRAINT "Proxy_instanceId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "Rabbitmq" DROP CONSTRAINT "Rabbitmq_instanceId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "Session" DROP CONSTRAINT "Session_sessionId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "Setting" DROP CONSTRAINT "Setting_instanceId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "Sqs" DROP CONSTRAINT "Sqs_instanceId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "Template" DROP CONSTRAINT "Template_instanceId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "Typebot" DROP CONSTRAINT "Typebot_instanceId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "TypebotSetting" DROP CONSTRAINT "TypebotSetting_instanceId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "TypebotSetting" DROP CONSTRAINT "TypebotSetting_typebotIdFallback_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "Webhook" DROP CONSTRAINT "Webhook_instanceId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "Websocket" DROP CONSTRAINT "Websocket_instanceId_fkey";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "Chat";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "Chatwoot";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "Contact";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "Dify";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "DifySetting";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "EvolutionBot";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "EvolutionBotSetting";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "Flowise";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "FlowiseSetting";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "Instance";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "IntegrationSession";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "Label";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "Media";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "Message";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "MessageUpdate";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "OpenaiBot";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "OpenaiCreds";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "OpenaiSetting";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "Proxy";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "Rabbitmq";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "Session";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "Setting";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "Sqs";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "Template";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "Typebot";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "TypebotSetting";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "Webhook";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "Websocket";
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "instances" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"name" VARCHAR(255) NOT NULL,
|
||||||
|
"connection_status" "InstanceConnectionStatus" NOT NULL DEFAULT 'open',
|
||||||
|
"owner_jid" VARCHAR(100),
|
||||||
|
"profile_name" VARCHAR(100),
|
||||||
|
"profile_pic_url" VARCHAR(500),
|
||||||
|
"integration" VARCHAR(100),
|
||||||
|
"number" VARCHAR(100),
|
||||||
|
"business_id" VARCHAR(100),
|
||||||
|
"token" VARCHAR(255),
|
||||||
|
"client_name" VARCHAR(100),
|
||||||
|
"disconnection_reason_code" INTEGER,
|
||||||
|
"disconnection_object" JSONB,
|
||||||
|
"disconnection_at" TIMESTAMPTZ,
|
||||||
|
"created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updated_at" TIMESTAMPTZ,
|
||||||
|
|
||||||
|
CONSTRAINT "instances_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "sessions" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"session_id" TEXT NOT NULL,
|
||||||
|
"creds" TEXT,
|
||||||
|
"created_at" TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
|
||||||
|
CONSTRAINT "sessions_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "chats" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"remote_jid" VARCHAR(100) NOT NULL,
|
||||||
|
"name" VARCHAR(100),
|
||||||
|
"labels" JSONB,
|
||||||
|
"created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updated_at" TIMESTAMPTZ,
|
||||||
|
"instance_id" TEXT NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT "chats_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "contacts" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"remote_jid" VARCHAR(100) NOT NULL,
|
||||||
|
"push_name" VARCHAR(100),
|
||||||
|
"profile_pic_url" VARCHAR(500),
|
||||||
|
"created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updated_at" TIMESTAMPTZ,
|
||||||
|
"instance_id" TEXT NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT "contacts_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "messages" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"key" JSONB NOT NULL,
|
||||||
|
"push_name" VARCHAR(100),
|
||||||
|
"participant" VARCHAR(100),
|
||||||
|
"message_type" VARCHAR(100) NOT NULL,
|
||||||
|
"message" JSONB NOT NULL,
|
||||||
|
"context_info" JSONB,
|
||||||
|
"message_timestamp" INTEGER NOT NULL,
|
||||||
|
"chatwoot_message_id" INTEGER,
|
||||||
|
"chatwoot_inbox_id" INTEGER,
|
||||||
|
"chatwoot_conversation_id" INTEGER,
|
||||||
|
"chatwoot_contact_inbox_source_id" VARCHAR(100),
|
||||||
|
"chatwoot_is_read" BOOLEAN,
|
||||||
|
"webhook_url" VARCHAR(500),
|
||||||
|
"source" "DeviceMessage" NOT NULL,
|
||||||
|
"instance_id" TEXT NOT NULL,
|
||||||
|
"session_id" TEXT,
|
||||||
|
|
||||||
|
CONSTRAINT "messages_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "message_updates" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"key_id" VARCHAR(100) NOT NULL,
|
||||||
|
"remote_jid" VARCHAR(100) NOT NULL,
|
||||||
|
"from_me" BOOLEAN NOT NULL,
|
||||||
|
"participant" VARCHAR(100),
|
||||||
|
"poll_updates" JSONB,
|
||||||
|
"status" VARCHAR(30) NOT NULL,
|
||||||
|
"message_id" TEXT NOT NULL,
|
||||||
|
"instance_id" TEXT NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT "message_updates_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "webhooks" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"url" VARCHAR(500) NOT NULL,
|
||||||
|
"enabled" BOOLEAN DEFAULT true,
|
||||||
|
"events" JSONB,
|
||||||
|
"webhook_by_events" BOOLEAN DEFAULT false,
|
||||||
|
"webhook_base64" BOOLEAN DEFAULT false,
|
||||||
|
"created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updated_at" TIMESTAMPTZ NOT NULL,
|
||||||
|
"instance_id" TEXT NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT "webhooks_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "chatwoots" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"enabled" BOOLEAN DEFAULT true,
|
||||||
|
"account_id" VARCHAR(100),
|
||||||
|
"token" VARCHAR(100),
|
||||||
|
"url" VARCHAR(500),
|
||||||
|
"name_inbox" VARCHAR(100),
|
||||||
|
"sign_msg" BOOLEAN DEFAULT false,
|
||||||
|
"sign_delimiter" VARCHAR(100),
|
||||||
|
"number" VARCHAR(100),
|
||||||
|
"reopen_conversation" BOOLEAN DEFAULT false,
|
||||||
|
"conversation_pending" BOOLEAN DEFAULT false,
|
||||||
|
"merge_brazil_contacts" BOOLEAN DEFAULT false,
|
||||||
|
"import_contacts" BOOLEAN DEFAULT false,
|
||||||
|
"import_messages" BOOLEAN DEFAULT false,
|
||||||
|
"days_limit_import_messages" INTEGER,
|
||||||
|
"organization" VARCHAR(100),
|
||||||
|
"logo" VARCHAR(500),
|
||||||
|
"ignore_jids" JSONB,
|
||||||
|
"created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updated_at" TIMESTAMPTZ NOT NULL,
|
||||||
|
"instance_id" TEXT NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT "chatwoots_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "labels" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"label_id" VARCHAR(100),
|
||||||
|
"name" VARCHAR(100) NOT NULL,
|
||||||
|
"color" VARCHAR(100) NOT NULL,
|
||||||
|
"predefined_id" VARCHAR(100),
|
||||||
|
"created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updated_at" TIMESTAMPTZ NOT NULL,
|
||||||
|
"instance_id" TEXT NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT "labels_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "proxies" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"enabled" BOOLEAN NOT NULL DEFAULT false,
|
||||||
|
"host" VARCHAR(100) NOT NULL,
|
||||||
|
"port" VARCHAR(100) NOT NULL,
|
||||||
|
"protocol" VARCHAR(100) NOT NULL,
|
||||||
|
"username" VARCHAR(100) NOT NULL,
|
||||||
|
"password" VARCHAR(100) NOT NULL,
|
||||||
|
"created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updated_at" TIMESTAMPTZ NOT NULL,
|
||||||
|
"instance_id" TEXT NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT "proxies_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "settings" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"reject_call" BOOLEAN NOT NULL DEFAULT false,
|
||||||
|
"msg_call" VARCHAR(100),
|
||||||
|
"groups_ignore" BOOLEAN NOT NULL DEFAULT false,
|
||||||
|
"always_online" BOOLEAN NOT NULL DEFAULT false,
|
||||||
|
"read_messages" BOOLEAN NOT NULL DEFAULT false,
|
||||||
|
"read_status" BOOLEAN NOT NULL DEFAULT false,
|
||||||
|
"sync_full_history" BOOLEAN NOT NULL DEFAULT false,
|
||||||
|
"created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updated_at" TIMESTAMPTZ NOT NULL,
|
||||||
|
"instance_id" TEXT NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT "settings_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "rabbitmqs" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"enabled" BOOLEAN NOT NULL DEFAULT false,
|
||||||
|
"events" JSONB NOT NULL,
|
||||||
|
"created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updated_at" TIMESTAMPTZ NOT NULL,
|
||||||
|
"instance_id" TEXT NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT "rabbitmqs_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "sqss" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"enabled" BOOLEAN NOT NULL DEFAULT false,
|
||||||
|
"events" JSONB NOT NULL,
|
||||||
|
"created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updated_at" TIMESTAMPTZ NOT NULL,
|
||||||
|
"instance_id" TEXT NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT "sqss_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "websockets" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"enabled" BOOLEAN NOT NULL DEFAULT false,
|
||||||
|
"events" JSONB NOT NULL,
|
||||||
|
"created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updated_at" TIMESTAMPTZ NOT NULL,
|
||||||
|
"instance_id" TEXT NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT "websockets_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "typebots" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"enabled" BOOLEAN NOT NULL DEFAULT true,
|
||||||
|
"description" VARCHAR(255),
|
||||||
|
"url" VARCHAR(500) NOT NULL,
|
||||||
|
"typebot" VARCHAR(100) NOT NULL,
|
||||||
|
"expire" INTEGER DEFAULT 0,
|
||||||
|
"keyword_finish" VARCHAR(100),
|
||||||
|
"delay_message" INTEGER,
|
||||||
|
"unknown_message" VARCHAR(100),
|
||||||
|
"listening_from_me" BOOLEAN DEFAULT false,
|
||||||
|
"stop_bot_from_me" BOOLEAN DEFAULT false,
|
||||||
|
"keep_open" BOOLEAN DEFAULT false,
|
||||||
|
"debounce_time" INTEGER,
|
||||||
|
"created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updated_at" TIMESTAMPTZ,
|
||||||
|
"ignore_jids" JSONB,
|
||||||
|
"trigger_type" "TriggerType",
|
||||||
|
"trigger_operator" "TriggerOperator",
|
||||||
|
"trigger_value" TEXT,
|
||||||
|
"instance_id" TEXT NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT "typebots_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "typebot_settings" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"expire" INTEGER DEFAULT 0,
|
||||||
|
"keyword_finish" VARCHAR(100),
|
||||||
|
"delay_message" INTEGER,
|
||||||
|
"unknown_message" VARCHAR(100),
|
||||||
|
"listening_from_me" BOOLEAN DEFAULT false,
|
||||||
|
"stop_bot_from_me" BOOLEAN DEFAULT false,
|
||||||
|
"keep_open" BOOLEAN DEFAULT false,
|
||||||
|
"debounce_time" INTEGER,
|
||||||
|
"ignore_jids" JSONB,
|
||||||
|
"created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updated_at" TIMESTAMPTZ NOT NULL,
|
||||||
|
"typebot_id_fallback" VARCHAR(100),
|
||||||
|
"instance_id" TEXT NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT "typebot_settings_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "medias" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"file_name" VARCHAR(500) NOT NULL,
|
||||||
|
"type" VARCHAR(100) NOT NULL,
|
||||||
|
"mime_type" VARCHAR(100) NOT NULL,
|
||||||
|
"created_at" DATE DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"message_id" TEXT NOT NULL,
|
||||||
|
"instance_id" TEXT NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT "medias_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "openai_creds" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"name" VARCHAR(255),
|
||||||
|
"api_key" VARCHAR(255),
|
||||||
|
"created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updated_at" TIMESTAMPTZ NOT NULL,
|
||||||
|
"instance_id" TEXT NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT "openai_creds_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "openai_bots" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"enabled" BOOLEAN NOT NULL DEFAULT true,
|
||||||
|
"description" VARCHAR(255),
|
||||||
|
"assistant_id" VARCHAR(255),
|
||||||
|
"function_url" VARCHAR(500),
|
||||||
|
"model" VARCHAR(100),
|
||||||
|
"system_messages" JSONB,
|
||||||
|
"assistant_messages" JSONB,
|
||||||
|
"user_messages" JSONB,
|
||||||
|
"max_tokens" INTEGER,
|
||||||
|
"expire" INTEGER DEFAULT 0,
|
||||||
|
"keyword_finish" VARCHAR(100),
|
||||||
|
"delay_message" INTEGER,
|
||||||
|
"unknown_message" VARCHAR(100),
|
||||||
|
"listening_from_me" BOOLEAN DEFAULT false,
|
||||||
|
"stop_bot_from_me" BOOLEAN DEFAULT false,
|
||||||
|
"keep_open" BOOLEAN DEFAULT false,
|
||||||
|
"debounce_time" INTEGER,
|
||||||
|
"ignore_jids" JSONB,
|
||||||
|
"trigger_type" "TriggerType",
|
||||||
|
"trigger_operator" "TriggerOperator",
|
||||||
|
"trigger_value" TEXT,
|
||||||
|
"created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updated_at" TIMESTAMPTZ NOT NULL,
|
||||||
|
"bot_type" "OpenaiBotType" NOT NULL,
|
||||||
|
"openai_creds_id" TEXT NOT NULL,
|
||||||
|
"instance_id" TEXT NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT "openai_bots_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "integration_sessions" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"session_id" VARCHAR(255) NOT NULL,
|
||||||
|
"remote_jid" VARCHAR(100) NOT NULL,
|
||||||
|
"push_name" TEXT,
|
||||||
|
"status" "SessionStatus" NOT NULL,
|
||||||
|
"await_user" BOOLEAN NOT NULL DEFAULT false,
|
||||||
|
"context" JSONB,
|
||||||
|
"type" VARCHAR(100),
|
||||||
|
"created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updated_at" TIMESTAMPTZ NOT NULL,
|
||||||
|
"parameters" JSONB,
|
||||||
|
"botId" TEXT,
|
||||||
|
"instance_id" TEXT NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT "integration_sessions_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "openai_settings" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"expire" INTEGER DEFAULT 0,
|
||||||
|
"keyword_finish" VARCHAR(100),
|
||||||
|
"delay_message" INTEGER,
|
||||||
|
"unknown_message" VARCHAR(100),
|
||||||
|
"listening_from_me" BOOLEAN DEFAULT false,
|
||||||
|
"stop_bot_from_me" BOOLEAN DEFAULT false,
|
||||||
|
"keep_open" BOOLEAN DEFAULT false,
|
||||||
|
"debounce_time" INTEGER,
|
||||||
|
"ignore_jids" JSONB,
|
||||||
|
"speech_to_text" BOOLEAN DEFAULT false,
|
||||||
|
"created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updated_at" TIMESTAMPTZ NOT NULL,
|
||||||
|
"openai_creds_id" TEXT NOT NULL,
|
||||||
|
"openai_id_fallback" VARCHAR(100),
|
||||||
|
"instance_id" TEXT NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT "openai_settings_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "templates" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"template_id" VARCHAR(255) NOT NULL,
|
||||||
|
"name" VARCHAR(255) NOT NULL,
|
||||||
|
"template" JSONB NOT NULL,
|
||||||
|
"webhook_url" VARCHAR(500),
|
||||||
|
"created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updated_at" TIMESTAMPTZ NOT NULL,
|
||||||
|
"instance_id" TEXT NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT "templates_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "difys" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"enabled" BOOLEAN NOT NULL DEFAULT true,
|
||||||
|
"description" VARCHAR(255),
|
||||||
|
"bot_type" "DifyBotType" NOT NULL,
|
||||||
|
"api_url" VARCHAR(255),
|
||||||
|
"api_key" VARCHAR(255),
|
||||||
|
"expire" INTEGER DEFAULT 0,
|
||||||
|
"keyword_finish" VARCHAR(100),
|
||||||
|
"delay_message" INTEGER,
|
||||||
|
"unknown_message" VARCHAR(100),
|
||||||
|
"listening_from_me" BOOLEAN DEFAULT false,
|
||||||
|
"stop_bot_from_me" BOOLEAN DEFAULT false,
|
||||||
|
"keep_open" BOOLEAN DEFAULT false,
|
||||||
|
"debounce_time" INTEGER,
|
||||||
|
"ignore_jids" JSONB,
|
||||||
|
"trigger_type" "TriggerType",
|
||||||
|
"trigger_operator" "TriggerOperator",
|
||||||
|
"trigger_value" TEXT,
|
||||||
|
"created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updated_at" TIMESTAMPTZ NOT NULL,
|
||||||
|
"instance_id" TEXT NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT "difys_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "dify_settings" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"expire" INTEGER DEFAULT 0,
|
||||||
|
"keyword_finish" VARCHAR(100),
|
||||||
|
"delay_message" INTEGER,
|
||||||
|
"unknown_message" VARCHAR(100),
|
||||||
|
"listening_from_me" BOOLEAN DEFAULT false,
|
||||||
|
"stop_bot_from_me" BOOLEAN DEFAULT false,
|
||||||
|
"keep_open" BOOLEAN DEFAULT false,
|
||||||
|
"debounce_time" INTEGER,
|
||||||
|
"ignore_jids" JSONB,
|
||||||
|
"created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updated_at" TIMESTAMPTZ NOT NULL,
|
||||||
|
"dify_id_fallback" VARCHAR(100),
|
||||||
|
"instance_id" TEXT NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT "dify_settings_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "evolution_bots" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"enabled" BOOLEAN NOT NULL DEFAULT true,
|
||||||
|
"description" VARCHAR(255),
|
||||||
|
"api_url" VARCHAR(255),
|
||||||
|
"api_key" VARCHAR(255),
|
||||||
|
"expire" INTEGER DEFAULT 0,
|
||||||
|
"keyword_finish" VARCHAR(100),
|
||||||
|
"delay_message" INTEGER,
|
||||||
|
"unknown_message" VARCHAR(100),
|
||||||
|
"listening_from_me" BOOLEAN DEFAULT false,
|
||||||
|
"stop_bot_from_me" BOOLEAN DEFAULT false,
|
||||||
|
"keep_open" BOOLEAN DEFAULT false,
|
||||||
|
"debounce_time" INTEGER,
|
||||||
|
"ignore_jids" JSONB,
|
||||||
|
"trigger_type" "TriggerType",
|
||||||
|
"trigger_operator" "TriggerOperator",
|
||||||
|
"trigger_value" TEXT,
|
||||||
|
"created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updated_at" TIMESTAMPTZ NOT NULL,
|
||||||
|
"instance_id" TEXT NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT "evolution_bots_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "evolution_bot_settings" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"expire" INTEGER DEFAULT 0,
|
||||||
|
"keyword_finish" VARCHAR(100),
|
||||||
|
"delay_message" INTEGER,
|
||||||
|
"unknown_message" VARCHAR(100),
|
||||||
|
"listening_from_me" BOOLEAN DEFAULT false,
|
||||||
|
"stop_bot_from_me" BOOLEAN DEFAULT false,
|
||||||
|
"keep_open" BOOLEAN DEFAULT false,
|
||||||
|
"debounce_time" INTEGER,
|
||||||
|
"ignore_jids" JSONB,
|
||||||
|
"created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updated_at" TIMESTAMPTZ NOT NULL,
|
||||||
|
"bot_id_fallback" VARCHAR(100),
|
||||||
|
"instance_id" TEXT NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT "evolution_bot_settings_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "flowises" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"enabled" BOOLEAN NOT NULL DEFAULT true,
|
||||||
|
"description" VARCHAR(255),
|
||||||
|
"api_url" VARCHAR(255),
|
||||||
|
"api_key" VARCHAR(255),
|
||||||
|
"expire" INTEGER DEFAULT 0,
|
||||||
|
"keyword_finish" VARCHAR(100),
|
||||||
|
"delay_message" INTEGER,
|
||||||
|
"unknown_message" VARCHAR(100),
|
||||||
|
"listening_from_me" BOOLEAN DEFAULT false,
|
||||||
|
"stop_bot_from_me" BOOLEAN DEFAULT false,
|
||||||
|
"keep_open" BOOLEAN DEFAULT false,
|
||||||
|
"debounce_time" INTEGER,
|
||||||
|
"ignore_jids" JSONB,
|
||||||
|
"trigger_type" "TriggerType",
|
||||||
|
"trigger_operator" "TriggerOperator",
|
||||||
|
"trigger_value" TEXT,
|
||||||
|
"created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updated_at" TIMESTAMPTZ NOT NULL,
|
||||||
|
"instance_id" TEXT NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT "flowises_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "flowise_settings" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"expire" INTEGER DEFAULT 0,
|
||||||
|
"keyword_finish" VARCHAR(100),
|
||||||
|
"delay_message" INTEGER,
|
||||||
|
"unknown_message" VARCHAR(100),
|
||||||
|
"listening_from_me" BOOLEAN DEFAULT false,
|
||||||
|
"stop_bot_from_me" BOOLEAN DEFAULT false,
|
||||||
|
"keep_open" BOOLEAN DEFAULT false,
|
||||||
|
"debounce_time" INTEGER,
|
||||||
|
"ignore_jids" JSONB,
|
||||||
|
"created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updated_at" TIMESTAMPTZ NOT NULL,
|
||||||
|
"flowise_id_fallback" VARCHAR(100),
|
||||||
|
"instance_id" TEXT NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT "flowise_settings_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "instances_name_key" ON "instances"("name");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "sessions_session_id_key" ON "sessions"("session_id");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "contacts_remote_jid_instance_id_key" ON "contacts"("remote_jid", "instance_id");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "webhooks_instance_id_key" ON "webhooks"("instance_id");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "chatwoots_instance_id_key" ON "chatwoots"("instance_id");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "labels_label_id_instance_id_key" ON "labels"("label_id", "instance_id");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "proxies_instance_id_key" ON "proxies"("instance_id");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "settings_instance_id_key" ON "settings"("instance_id");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "rabbitmqs_instance_id_key" ON "rabbitmqs"("instance_id");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "sqss_instance_id_key" ON "sqss"("instance_id");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "websockets_instance_id_key" ON "websockets"("instance_id");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "typebot_settings_instance_id_key" ON "typebot_settings"("instance_id");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "medias_file_name_key" ON "medias"("file_name");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "medias_message_id_key" ON "medias"("message_id");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "openai_creds_name_key" ON "openai_creds"("name");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "openai_creds_api_key_key" ON "openai_creds"("api_key");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "integration_sessions_session_id_key" ON "integration_sessions"("session_id");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "openai_settings_openai_creds_id_key" ON "openai_settings"("openai_creds_id");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "openai_settings_instance_id_key" ON "openai_settings"("instance_id");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "templates_template_id_key" ON "templates"("template_id");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "templates_name_key" ON "templates"("name");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "dify_settings_instance_id_key" ON "dify_settings"("instance_id");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "evolution_bot_settings_instance_id_key" ON "evolution_bot_settings"("instance_id");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "flowise_settings_instance_id_key" ON "flowise_settings"("instance_id");
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "sessions" ADD CONSTRAINT "sessions_session_id_fkey" FOREIGN KEY ("session_id") REFERENCES "instances"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "chats" ADD CONSTRAINT "chats_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "instances"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "contacts" ADD CONSTRAINT "contacts_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "instances"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "messages" ADD CONSTRAINT "messages_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "instances"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "messages" ADD CONSTRAINT "messages_session_id_fkey" FOREIGN KEY ("session_id") REFERENCES "integration_sessions"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "message_updates" ADD CONSTRAINT "message_updates_message_id_fkey" FOREIGN KEY ("message_id") REFERENCES "messages"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "message_updates" ADD CONSTRAINT "message_updates_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "instances"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "webhooks" ADD CONSTRAINT "webhooks_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "instances"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "chatwoots" ADD CONSTRAINT "chatwoots_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "instances"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "labels" ADD CONSTRAINT "labels_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "instances"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "proxies" ADD CONSTRAINT "proxies_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "instances"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "settings" ADD CONSTRAINT "settings_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "instances"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "rabbitmqs" ADD CONSTRAINT "rabbitmqs_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "instances"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "sqss" ADD CONSTRAINT "sqss_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "instances"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "websockets" ADD CONSTRAINT "websockets_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "instances"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "typebots" ADD CONSTRAINT "typebots_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "instances"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "typebot_settings" ADD CONSTRAINT "typebot_settings_typebot_id_fallback_fkey" FOREIGN KEY ("typebot_id_fallback") REFERENCES "typebots"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "typebot_settings" ADD CONSTRAINT "typebot_settings_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "instances"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "medias" ADD CONSTRAINT "medias_message_id_fkey" FOREIGN KEY ("message_id") REFERENCES "messages"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "medias" ADD CONSTRAINT "medias_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "instances"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "openai_creds" ADD CONSTRAINT "openai_creds_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "instances"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "openai_bots" ADD CONSTRAINT "openai_bots_openai_creds_id_fkey" FOREIGN KEY ("openai_creds_id") REFERENCES "openai_creds"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "openai_bots" ADD CONSTRAINT "openai_bots_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "instances"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "integration_sessions" ADD CONSTRAINT "integration_sessions_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "instances"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "openai_settings" ADD CONSTRAINT "openai_settings_openai_creds_id_fkey" FOREIGN KEY ("openai_creds_id") REFERENCES "openai_creds"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "openai_settings" ADD CONSTRAINT "openai_settings_openai_id_fallback_fkey" FOREIGN KEY ("openai_id_fallback") REFERENCES "openai_bots"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "openai_settings" ADD CONSTRAINT "openai_settings_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "instances"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "templates" ADD CONSTRAINT "templates_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "instances"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "difys" ADD CONSTRAINT "difys_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "instances"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "dify_settings" ADD CONSTRAINT "dify_settings_dify_id_fallback_fkey" FOREIGN KEY ("dify_id_fallback") REFERENCES "difys"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "dify_settings" ADD CONSTRAINT "dify_settings_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "instances"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "evolution_bots" ADD CONSTRAINT "evolution_bots_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "instances"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "evolution_bot_settings" ADD CONSTRAINT "evolution_bot_settings_bot_id_fallback_fkey" FOREIGN KEY ("bot_id_fallback") REFERENCES "evolution_bots"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "evolution_bot_settings" ADD CONSTRAINT "evolution_bot_settings_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "instances"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "flowises" ADD CONSTRAINT "flowises_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "instances"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "flowise_settings" ADD CONSTRAINT "flowise_settings_flowise_id_fallback_fkey" FOREIGN KEY ("flowise_id_fallback") REFERENCES "flowises"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "flowise_settings" ADD CONSTRAINT "flowise_settings_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "instances"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
@ -9,8 +9,9 @@ generator client {
|
|||||||
}
|
}
|
||||||
|
|
||||||
datasource db {
|
datasource db {
|
||||||
provider = "postgresql"
|
provider = "postgresql"
|
||||||
url = env("DATABASE_CONNECTION_URI")
|
url = env("DATABASE_CONNECTION_URI")
|
||||||
|
directUrl = env("DATABASE_DIRECT_URL")
|
||||||
}
|
}
|
||||||
|
|
||||||
enum InstanceConnectionStatus {
|
enum InstanceConnectionStatus {
|
||||||
@ -63,118 +64,137 @@ enum DifyBotType {
|
|||||||
model Instance {
|
model Instance {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
name String @unique @db.VarChar(255)
|
name String @unique @db.VarChar(255)
|
||||||
connectionStatus InstanceConnectionStatus @default(open)
|
connectionStatus InstanceConnectionStatus @default(open) @map("connection_status")
|
||||||
ownerJid String? @db.VarChar(100)
|
ownerJid String? @map("owner_jid") @db.VarChar(100)
|
||||||
profileName String? @db.VarChar(100)
|
profileName String? @map("profile_name") @db.VarChar(100)
|
||||||
profilePicUrl String? @db.VarChar(500)
|
profilePicUrl String? @map("profile_pic_url") @db.VarChar(500)
|
||||||
integration String? @db.VarChar(100)
|
integration String? @db.VarChar(100)
|
||||||
number String? @db.VarChar(100)
|
number String? @db.VarChar(100)
|
||||||
businessId String? @db.VarChar(100)
|
businessId String? @map("business_id") @db.VarChar(100)
|
||||||
token String? @db.VarChar(255)
|
token String? @db.VarChar(255)
|
||||||
clientName String? @db.VarChar(100)
|
clientName String? @map("client_name") @db.VarChar(100)
|
||||||
disconnectionReasonCode Int? @db.Integer
|
disconnectionReasonCode Int? @map("disconnection_reason_code") @db.Integer
|
||||||
disconnectionObject Json? @db.JsonB
|
disconnectionObject Json? @map("disconnection_object") @db.JsonB
|
||||||
disconnectionAt DateTime? @db.Timestamp
|
disconnectionAt DateTime? @map("disconnection_at") @db.Timestamptz()
|
||||||
createdAt DateTime? @default(now()) @db.Timestamp
|
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz()
|
||||||
updatedAt DateTime? @updatedAt @db.Timestamp
|
updatedAt DateTime? @updatedAt @map("updated_at") @db.Timestamptz()
|
||||||
Chat Chat[]
|
|
||||||
Contact Contact[]
|
Chat Chat[]
|
||||||
Message Message[]
|
Contact Contact[]
|
||||||
Webhook Webhook?
|
Message Message[]
|
||||||
Chatwoot Chatwoot?
|
Webhook Webhook?
|
||||||
Label Label[]
|
Chatwoot Chatwoot?
|
||||||
Proxy Proxy?
|
Label Label[]
|
||||||
Setting Setting?
|
Proxy Proxy?
|
||||||
Rabbitmq Rabbitmq?
|
Setting Setting?
|
||||||
Sqs Sqs?
|
Rabbitmq Rabbitmq?
|
||||||
Websocket Websocket?
|
Sqs Sqs?
|
||||||
Typebot Typebot[]
|
Websocket Websocket?
|
||||||
Session Session?
|
Typebot Typebot[]
|
||||||
MessageUpdate MessageUpdate[]
|
Session Session?
|
||||||
TypebotSetting TypebotSetting?
|
MessageUpdate MessageUpdate[]
|
||||||
Media Media[]
|
TypebotSetting TypebotSetting?
|
||||||
OpenaiCreds OpenaiCreds[]
|
Media Media[]
|
||||||
OpenaiBot OpenaiBot[]
|
OpenaiCreds OpenaiCreds[]
|
||||||
OpenaiSetting OpenaiSetting?
|
OpenaiBot OpenaiBot[]
|
||||||
Template Template[]
|
OpenaiSetting OpenaiSetting?
|
||||||
Dify Dify[]
|
Template Template[]
|
||||||
DifySetting DifySetting?
|
Dify Dify[]
|
||||||
integrationSessions IntegrationSession[]
|
DifySetting DifySetting?
|
||||||
EvolutionBot EvolutionBot[]
|
integrationSessions IntegrationSession[]
|
||||||
EvolutionBotSetting EvolutionBotSetting?
|
EvolutionBot EvolutionBot[]
|
||||||
Flowise Flowise[]
|
EvolutionBotSetting EvolutionBotSetting?
|
||||||
FlowiseSetting FlowiseSetting?
|
Flowise Flowise[]
|
||||||
|
FlowiseSetting FlowiseSetting?
|
||||||
|
|
||||||
|
@@map("instances")
|
||||||
}
|
}
|
||||||
|
|
||||||
model Session {
|
model Session {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
sessionId String @unique
|
sessionId String @unique @map("session_id")
|
||||||
creds String? @db.Text
|
creds String? @db.Text
|
||||||
createdAt DateTime @default(now()) @db.Timestamp
|
createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz()
|
||||||
Instance Instance @relation(fields: [sessionId], references: [id], onDelete: Cascade)
|
|
||||||
|
Instance Instance @relation(fields: [sessionId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
|
@@map("sessions")
|
||||||
}
|
}
|
||||||
|
|
||||||
model Chat {
|
model Chat {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
remoteJid String @db.VarChar(100)
|
remoteJid String @map("remote_jid") @db.VarChar(100)
|
||||||
name String? @db.VarChar(100)
|
name String? @db.VarChar(100)
|
||||||
labels Json? @db.JsonB
|
labels Json? @db.JsonB
|
||||||
createdAt DateTime? @default(now()) @db.Timestamp
|
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz()
|
||||||
updatedAt DateTime? @updatedAt @db.Timestamp
|
updatedAt DateTime? @updatedAt @map("updated_at") @db.Timestamptz()
|
||||||
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
|
||||||
instanceId String
|
instanceId String @map("instance_id")
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
|
@@map("chats")
|
||||||
}
|
}
|
||||||
|
|
||||||
model Contact {
|
model Contact {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
remoteJid String @db.VarChar(100)
|
remoteJid String @map("remote_jid") @db.VarChar(100)
|
||||||
pushName String? @db.VarChar(100)
|
pushName String? @map("push_name") @db.VarChar(100)
|
||||||
profilePicUrl String? @db.VarChar(500)
|
profilePicUrl String? @map("profile_pic_url") @db.VarChar(500)
|
||||||
createdAt DateTime? @default(now()) @db.Timestamp
|
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz()
|
||||||
updatedAt DateTime? @updatedAt @db.Timestamp
|
updatedAt DateTime? @updatedAt @map("updated_at") @db.Timestamptz()
|
||||||
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
|
||||||
instanceId String
|
instanceId String @map("instance_id")
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
@@unique([remoteJid, instanceId])
|
@@unique([remoteJid, instanceId])
|
||||||
|
@@map("contacts")
|
||||||
}
|
}
|
||||||
|
|
||||||
model Message {
|
model Message {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
key Json @db.JsonB
|
key Json @db.JsonB
|
||||||
pushName String? @db.VarChar(100)
|
pushName String? @map("push_name") @db.VarChar(100)
|
||||||
participant String? @db.VarChar(100)
|
participant String? @db.VarChar(100)
|
||||||
messageType String @db.VarChar(100)
|
messageType String @map("message_type") @db.VarChar(100)
|
||||||
message Json @db.JsonB
|
message Json @db.JsonB
|
||||||
contextInfo Json? @db.JsonB
|
contextInfo Json? @map("context_info") @db.JsonB
|
||||||
|
messageTimestamp Int @map("message_timestamp") @db.Integer
|
||||||
|
chatwootMessageId Int? @map("chatwoot_message_id") @db.Integer
|
||||||
|
chatwootInboxId Int? @map("chatwoot_inbox_id") @db.Integer
|
||||||
|
chatwootConversationId Int? @map("chatwoot_conversation_id") @db.Integer
|
||||||
|
chatwootContactInboxSourceId String? @map("chatwoot_contact_inbox_source_id") @db.VarChar(100)
|
||||||
|
chatwootIsRead Boolean? @map("chatwoot_is_read") @db.Boolean
|
||||||
|
webhookUrl String? @map("webhook_url") @db.VarChar(500)
|
||||||
source DeviceMessage
|
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)
|
|
||||||
|
|
||||||
sessionId String?
|
instanceId String @map("instance_id")
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
|
MessageUpdate MessageUpdate[]
|
||||||
|
Media Media?
|
||||||
|
|
||||||
|
sessionId String? @map("session_id")
|
||||||
session IntegrationSession? @relation(fields: [sessionId], references: [id])
|
session IntegrationSession? @relation(fields: [sessionId], references: [id])
|
||||||
|
|
||||||
|
@@map("messages")
|
||||||
}
|
}
|
||||||
|
|
||||||
model MessageUpdate {
|
model MessageUpdate {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
keyId String @db.VarChar(100)
|
keyId String @map("key_id") @db.VarChar(100)
|
||||||
remoteJid String @db.VarChar(100)
|
remoteJid String @map("remote_jid") @db.VarChar(100)
|
||||||
fromMe Boolean @db.Boolean
|
fromMe Boolean @map("from_me") @db.Boolean
|
||||||
participant String? @db.VarChar(100)
|
participant String? @db.VarChar(100)
|
||||||
pollUpdates Json? @db.JsonB
|
pollUpdates Json? @map("poll_updates") @db.JsonB
|
||||||
status String @db.VarChar(30)
|
status String @db.VarChar(30)
|
||||||
Message Message @relation(fields: [messageId], references: [id], onDelete: Cascade)
|
|
||||||
messageId String
|
messageId String @map("message_id")
|
||||||
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
Message Message @relation(fields: [messageId], references: [id], onDelete: Cascade)
|
||||||
instanceId String
|
|
||||||
|
instanceId String @map("instance_id")
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
|
@@map("message_updates")
|
||||||
}
|
}
|
||||||
|
|
||||||
model Webhook {
|
model Webhook {
|
||||||
@ -182,110 +202,133 @@ model Webhook {
|
|||||||
url String @db.VarChar(500)
|
url String @db.VarChar(500)
|
||||||
enabled Boolean? @default(true) @db.Boolean
|
enabled Boolean? @default(true) @db.Boolean
|
||||||
events Json? @db.JsonB
|
events Json? @db.JsonB
|
||||||
webhookByEvents Boolean? @default(false) @db.Boolean
|
webhookByEvents Boolean? @default(false) @map("webhook_by_events") @db.Boolean
|
||||||
webhookBase64 Boolean? @default(false) @db.Boolean
|
webhookBase64 Boolean? @default(false) @map("webhook_base64") @db.Boolean
|
||||||
createdAt DateTime? @default(now()) @db.Timestamp
|
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz()
|
||||||
updatedAt DateTime @updatedAt @db.Timestamp
|
updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz()
|
||||||
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
|
||||||
instanceId String @unique
|
instanceId String @unique @map("instance_id")
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
|
@@map("webhooks")
|
||||||
}
|
}
|
||||||
|
|
||||||
model Chatwoot {
|
model Chatwoot {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
enabled Boolean? @default(true) @db.Boolean
|
enabled Boolean? @default(true) @db.Boolean
|
||||||
accountId String? @db.VarChar(100)
|
accountId String? @map("account_id") @db.VarChar(100)
|
||||||
token String? @db.VarChar(100)
|
token String? @db.VarChar(100)
|
||||||
url String? @db.VarChar(500)
|
url String? @db.VarChar(500)
|
||||||
nameInbox String? @db.VarChar(100)
|
nameInbox String? @map("name_inbox") @db.VarChar(100)
|
||||||
signMsg Boolean? @default(false) @db.Boolean
|
signMsg Boolean? @default(false) @map("sign_msg") @db.Boolean
|
||||||
signDelimiter String? @db.VarChar(100)
|
signDelimiter String? @map("sign_delimiter") @db.VarChar(100)
|
||||||
number String? @db.VarChar(100)
|
number String? @db.VarChar(100)
|
||||||
reopenConversation Boolean? @default(false) @db.Boolean
|
reopenConversation Boolean? @default(false) @map("reopen_conversation") @db.Boolean
|
||||||
conversationPending Boolean? @default(false) @db.Boolean
|
conversationPending Boolean? @default(false) @map("conversation_pending") @db.Boolean
|
||||||
mergeBrazilContacts Boolean? @default(false) @db.Boolean
|
mergeBrazilContacts Boolean? @default(false) @map("merge_brazil_contacts") @db.Boolean
|
||||||
importContacts Boolean? @default(false) @db.Boolean
|
importContacts Boolean? @default(false) @map("import_contacts") @db.Boolean
|
||||||
importMessages Boolean? @default(false) @db.Boolean
|
importMessages Boolean? @default(false) @map("import_messages") @db.Boolean
|
||||||
daysLimitImportMessages Int? @db.Integer
|
daysLimitImportMessages Int? @map("days_limit_import_messages") @db.Integer
|
||||||
organization String? @db.VarChar(100)
|
organization String? @db.VarChar(100)
|
||||||
logo String? @db.VarChar(500)
|
logo String? @db.VarChar(500)
|
||||||
ignoreJids Json?
|
ignoreJids Json? @map("ignore_jids")
|
||||||
createdAt DateTime? @default(now()) @db.Timestamp
|
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz()
|
||||||
updatedAt DateTime @updatedAt @db.Timestamp
|
updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz()
|
||||||
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
|
||||||
instanceId String @unique
|
instanceId String @unique @map("instance_id")
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
|
@@map("chatwoots")
|
||||||
}
|
}
|
||||||
|
|
||||||
model Label {
|
model Label {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
labelId String? @db.VarChar(100)
|
labelId String? @map("label_id") @db.VarChar(100)
|
||||||
name String @db.VarChar(100)
|
name String @db.VarChar(100)
|
||||||
color String @db.VarChar(100)
|
color String @db.VarChar(100)
|
||||||
predefinedId String? @db.VarChar(100)
|
predefinedId String? @map("predefined_id") @db.VarChar(100)
|
||||||
createdAt DateTime? @default(now()) @db.Timestamp
|
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz()
|
||||||
updatedAt DateTime @updatedAt @db.Timestamp
|
updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz()
|
||||||
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
|
||||||
instanceId String
|
instanceId String @map("instance_id")
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
@@unique([labelId, instanceId])
|
@@unique([labelId, instanceId])
|
||||||
|
@@map("labels")
|
||||||
}
|
}
|
||||||
|
|
||||||
model Proxy {
|
model Proxy {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
enabled Boolean @default(false) @db.Boolean
|
enabled Boolean @default(false) @db.Boolean
|
||||||
host String @db.VarChar(100)
|
host String @db.VarChar(100)
|
||||||
port String @db.VarChar(100)
|
port String @db.VarChar(100)
|
||||||
protocol String @db.VarChar(100)
|
protocol String @db.VarChar(100)
|
||||||
username String @db.VarChar(100)
|
username String @db.VarChar(100)
|
||||||
password String @db.VarChar(100)
|
password String @db.VarChar(100)
|
||||||
createdAt DateTime? @default(now()) @db.Timestamp
|
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz()
|
||||||
updatedAt DateTime @updatedAt @db.Timestamp
|
updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz()
|
||||||
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
|
||||||
instanceId String @unique
|
instanceId String @unique @map("instance_id")
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
|
@@map("proxies")
|
||||||
}
|
}
|
||||||
|
|
||||||
model Setting {
|
model Setting {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
rejectCall Boolean @default(false) @db.Boolean
|
rejectCall Boolean @default(false) @map("reject_call") @db.Boolean
|
||||||
msgCall String? @db.VarChar(100)
|
msgCall String? @map("msg_call") @db.VarChar(100)
|
||||||
groupsIgnore Boolean @default(false) @db.Boolean
|
groupsIgnore Boolean @default(false) @map("groups_ignore") @db.Boolean
|
||||||
alwaysOnline Boolean @default(false) @db.Boolean
|
alwaysOnline Boolean @default(false) @map("always_online") @db.Boolean
|
||||||
readMessages Boolean @default(false) @db.Boolean
|
readMessages Boolean @default(false) @map("read_messages") @db.Boolean
|
||||||
readStatus Boolean @default(false) @db.Boolean
|
readStatus Boolean @default(false) @map("read_status") @db.Boolean
|
||||||
syncFullHistory Boolean @default(false) @db.Boolean
|
syncFullHistory Boolean @default(false) @map("sync_full_history") @db.Boolean
|
||||||
createdAt DateTime? @default(now()) @db.Timestamp
|
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz()
|
||||||
updatedAt DateTime @updatedAt @db.Timestamp
|
updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz()
|
||||||
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
|
||||||
instanceId String @unique
|
instanceId String @unique @map("instance_id")
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
|
@@map("settings")
|
||||||
}
|
}
|
||||||
|
|
||||||
model Rabbitmq {
|
model Rabbitmq {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
enabled Boolean @default(false) @db.Boolean
|
enabled Boolean @default(false) @db.Boolean
|
||||||
events Json @db.JsonB
|
events Json @db.JsonB
|
||||||
createdAt DateTime? @default(now()) @db.Timestamp
|
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz()
|
||||||
updatedAt DateTime @updatedAt @db.Timestamp
|
updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz()
|
||||||
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
|
||||||
instanceId String @unique
|
instanceId String @unique @map("instance_id")
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
|
@@map("rabbitmqs")
|
||||||
}
|
}
|
||||||
|
|
||||||
model Sqs {
|
model Sqs {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
enabled Boolean @default(false) @db.Boolean
|
enabled Boolean @default(false) @db.Boolean
|
||||||
events Json @db.JsonB
|
events Json @db.JsonB
|
||||||
createdAt DateTime? @default(now()) @db.Timestamp
|
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz()
|
||||||
updatedAt DateTime @updatedAt @db.Timestamp
|
updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz()
|
||||||
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
|
||||||
instanceId String @unique
|
instanceId String @unique @map("instance_id")
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
|
@@map("sqss")
|
||||||
}
|
}
|
||||||
|
|
||||||
model Websocket {
|
model Websocket {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
enabled Boolean @default(false) @db.Boolean
|
enabled Boolean @default(false) @db.Boolean
|
||||||
events Json @db.JsonB
|
events Json @db.JsonB
|
||||||
createdAt DateTime? @default(now()) @db.Timestamp
|
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz()
|
||||||
updatedAt DateTime @updatedAt @db.Timestamp
|
updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz()
|
||||||
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
|
||||||
instanceId String @unique
|
instanceId String @unique @map("instance_id")
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
|
@@map("websockets")
|
||||||
}
|
}
|
||||||
|
|
||||||
model Typebot {
|
model Typebot {
|
||||||
@ -295,284 +338,340 @@ model Typebot {
|
|||||||
url String @db.VarChar(500)
|
url String @db.VarChar(500)
|
||||||
typebot String @db.VarChar(100)
|
typebot String @db.VarChar(100)
|
||||||
expire Int? @default(0) @db.Integer
|
expire Int? @default(0) @db.Integer
|
||||||
keywordFinish String? @db.VarChar(100)
|
keywordFinish String? @map("keyword_finish") @db.VarChar(100)
|
||||||
delayMessage Int? @db.Integer
|
delayMessage Int? @map("delay_message") @db.Integer
|
||||||
unknownMessage String? @db.VarChar(100)
|
unknownMessage String? @map("unknown_message") @db.VarChar(100)
|
||||||
listeningFromMe Boolean? @default(false) @db.Boolean
|
listeningFromMe Boolean? @default(false) @map("listening_from_me") @db.Boolean
|
||||||
stopBotFromMe Boolean? @default(false) @db.Boolean
|
stopBotFromMe Boolean? @default(false) @map("stop_bot_from_me") @db.Boolean
|
||||||
keepOpen Boolean? @default(false) @db.Boolean
|
keepOpen Boolean? @default(false) @map("keep_open") @db.Boolean
|
||||||
debounceTime Int? @db.Integer
|
debounceTime Int? @map("debounce_time") @db.Integer
|
||||||
createdAt DateTime? @default(now()) @db.Timestamp
|
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz()
|
||||||
updatedAt DateTime? @updatedAt @db.Timestamp
|
updatedAt DateTime? @updatedAt @map("updated_at") @db.Timestamptz()
|
||||||
ignoreJids Json?
|
ignoreJids Json? @map("ignore_jids")
|
||||||
triggerType TriggerType?
|
triggerType TriggerType? @map("trigger_type")
|
||||||
triggerOperator TriggerOperator?
|
triggerOperator TriggerOperator? @map("trigger_operator")
|
||||||
triggerValue String?
|
triggerValue String? @map("trigger_value")
|
||||||
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
|
||||||
instanceId String
|
instanceId String @map("instance_id")
|
||||||
TypebotSetting TypebotSetting[]
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
|
TypebotSetting TypebotSetting[]
|
||||||
|
|
||||||
|
@@map("typebots")
|
||||||
}
|
}
|
||||||
|
|
||||||
model TypebotSetting {
|
model TypebotSetting {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
expire Int? @default(0) @db.Integer
|
expire Int? @default(0) @db.Integer
|
||||||
keywordFinish String? @db.VarChar(100)
|
keywordFinish String? @map("keyword_finish") @db.VarChar(100)
|
||||||
delayMessage Int? @db.Integer
|
delayMessage Int? @map("delay_message") @db.Integer
|
||||||
unknownMessage String? @db.VarChar(100)
|
unknownMessage String? @map("unknown_message") @db.VarChar(100)
|
||||||
listeningFromMe Boolean? @default(false) @db.Boolean
|
listeningFromMe Boolean? @default(false) @map("listening_from_me") @db.Boolean
|
||||||
stopBotFromMe Boolean? @default(false) @db.Boolean
|
stopBotFromMe Boolean? @default(false) @map("stop_bot_from_me") @db.Boolean
|
||||||
keepOpen Boolean? @default(false) @db.Boolean
|
keepOpen Boolean? @default(false) @map("keep_open") @db.Boolean
|
||||||
debounceTime Int? @db.Integer
|
debounceTime Int? @map("debounce_time") @db.Integer
|
||||||
typebotIdFallback String? @db.VarChar(100)
|
ignoreJids Json? @map("ignore_jids")
|
||||||
ignoreJids Json?
|
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz()
|
||||||
createdAt DateTime? @default(now()) @db.Timestamp
|
updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz()
|
||||||
updatedAt DateTime @updatedAt @db.Timestamp
|
|
||||||
Fallback Typebot? @relation(fields: [typebotIdFallback], references: [id])
|
typebotIdFallback String? @map("typebot_id_fallback") @db.VarChar(100)
|
||||||
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
Fallback Typebot? @relation(fields: [typebotIdFallback], references: [id])
|
||||||
instanceId String @unique
|
|
||||||
|
instanceId String @unique @map("instance_id")
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
|
@@map("typebot_settings")
|
||||||
}
|
}
|
||||||
|
|
||||||
model Media {
|
model Media {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
fileName String @unique @db.VarChar(500)
|
fileName String @unique @map("file_name") @db.VarChar(500)
|
||||||
type String @db.VarChar(100)
|
type String @db.VarChar(100)
|
||||||
mimetype String @db.VarChar(100)
|
mimetype String @map("mime_type") @db.VarChar(100)
|
||||||
createdAt DateTime? @default(now()) @db.Date
|
createdAt DateTime? @default(now()) @map("created_at") @db.Date
|
||||||
Message Message @relation(fields: [messageId], references: [id], onDelete: Cascade)
|
|
||||||
messageId String @unique
|
messageId String @unique @map("message_id")
|
||||||
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
Message Message @relation(fields: [messageId], references: [id], onDelete: Cascade)
|
||||||
instanceId String
|
|
||||||
|
instanceId String @map("instance_id")
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
|
@@map("medias")
|
||||||
}
|
}
|
||||||
|
|
||||||
model OpenaiCreds {
|
model OpenaiCreds {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
name String? @unique @db.VarChar(255)
|
name String? @unique @db.VarChar(255)
|
||||||
apiKey String? @unique @db.VarChar(255)
|
apiKey String? @unique @map("api_key") @db.VarChar(255)
|
||||||
createdAt DateTime? @default(now()) @db.Timestamp
|
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz()
|
||||||
updatedAt DateTime @updatedAt @db.Timestamp
|
updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz()
|
||||||
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
|
||||||
instanceId String
|
instanceId String @map("instance_id")
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
OpenaiAssistant OpenaiBot[]
|
OpenaiAssistant OpenaiBot[]
|
||||||
OpenaiSetting OpenaiSetting?
|
OpenaiSetting OpenaiSetting?
|
||||||
|
|
||||||
|
@@map("openai_creds")
|
||||||
}
|
}
|
||||||
|
|
||||||
model OpenaiBot {
|
model OpenaiBot {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
enabled Boolean @default(true) @db.Boolean
|
enabled Boolean @default(true) @db.Boolean
|
||||||
description String? @db.VarChar(255)
|
description String? @db.VarChar(255)
|
||||||
botType OpenaiBotType
|
assistantId String? @map("assistant_id") @db.VarChar(255)
|
||||||
assistantId String? @db.VarChar(255)
|
functionUrl String? @map("function_url") @db.VarChar(500)
|
||||||
functionUrl String? @db.VarChar(500)
|
|
||||||
model String? @db.VarChar(100)
|
model String? @db.VarChar(100)
|
||||||
systemMessages Json? @db.JsonB
|
systemMessages Json? @map("system_messages") @db.JsonB
|
||||||
assistantMessages Json? @db.JsonB
|
assistantMessages Json? @map("assistant_messages") @db.JsonB
|
||||||
userMessages Json? @db.JsonB
|
userMessages Json? @map("user_messages") @db.JsonB
|
||||||
maxTokens Int? @db.Integer
|
maxTokens Int? @map("max_tokens") @db.Integer
|
||||||
expire Int? @default(0) @db.Integer
|
expire Int? @default(0) @db.Integer
|
||||||
keywordFinish String? @db.VarChar(100)
|
keywordFinish String? @map("keyword_finish") @db.VarChar(100)
|
||||||
delayMessage Int? @db.Integer
|
delayMessage Int? @map("delay_message") @db.Integer
|
||||||
unknownMessage String? @db.VarChar(100)
|
unknownMessage String? @map("unknown_message") @db.VarChar(100)
|
||||||
listeningFromMe Boolean? @default(false) @db.Boolean
|
listeningFromMe Boolean? @default(false) @map("listening_from_me") @db.Boolean
|
||||||
stopBotFromMe Boolean? @default(false) @db.Boolean
|
stopBotFromMe Boolean? @default(false) @map("stop_bot_from_me") @db.Boolean
|
||||||
keepOpen Boolean? @default(false) @db.Boolean
|
keepOpen Boolean? @default(false) @map("keep_open") @db.Boolean
|
||||||
debounceTime Int? @db.Integer
|
debounceTime Int? @map("debounce_time") @db.Integer
|
||||||
ignoreJids Json?
|
ignoreJids Json? @map("ignore_jids")
|
||||||
triggerType TriggerType?
|
triggerType TriggerType? @map("trigger_type")
|
||||||
triggerOperator TriggerOperator?
|
triggerOperator TriggerOperator? @map("trigger_operator")
|
||||||
triggerValue String?
|
triggerValue String? @map("trigger_value")
|
||||||
createdAt DateTime? @default(now()) @db.Timestamp
|
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz()
|
||||||
updatedAt DateTime @updatedAt @db.Timestamp
|
updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz()
|
||||||
OpenaiCreds OpenaiCreds @relation(fields: [openaiCredsId], references: [id], onDelete: Cascade)
|
botType OpenaiBotType @map("bot_type")
|
||||||
openaiCredsId String
|
|
||||||
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
openaiCredsId String @map("openai_creds_id")
|
||||||
instanceId String
|
OpenaiCreds OpenaiCreds @relation(fields: [openaiCredsId], references: [id], onDelete: Cascade)
|
||||||
OpenaiSetting OpenaiSetting[]
|
|
||||||
|
instanceId String @map("instance_id")
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
|
OpenaiSetting OpenaiSetting[]
|
||||||
|
|
||||||
|
@@map("openai_bots")
|
||||||
}
|
}
|
||||||
|
|
||||||
model IntegrationSession {
|
model IntegrationSession {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
sessionId String @db.VarChar(255)
|
sessionId String @unique @map("session_id") @db.VarChar(255)
|
||||||
remoteJid String @db.VarChar(100)
|
remoteJid String @map("remote_jid") @db.VarChar(100)
|
||||||
pushName String?
|
pushName String? @map("push_name")
|
||||||
status SessionStatus
|
status SessionStatus
|
||||||
awaitUser Boolean @default(false) @db.Boolean
|
awaitUser Boolean @default(false) @map("await_user") @db.Boolean
|
||||||
context Json?
|
context Json?
|
||||||
type String? @db.VarChar(100)
|
type String? @db.VarChar(100)
|
||||||
createdAt DateTime? @default(now()) @db.Timestamp
|
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz()
|
||||||
updatedAt DateTime @updatedAt @db.Timestamp
|
updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz()
|
||||||
Message Message[]
|
|
||||||
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
|
||||||
instanceId String
|
|
||||||
parameters Json? @db.JsonB
|
parameters Json? @db.JsonB
|
||||||
|
botId String?
|
||||||
|
|
||||||
botId String?
|
instanceId String @map("instance_id")
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
|
Message Message[]
|
||||||
|
|
||||||
|
@@map("integration_sessions")
|
||||||
}
|
}
|
||||||
|
|
||||||
model OpenaiSetting {
|
model OpenaiSetting {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
expire Int? @default(0) @db.Integer
|
expire Int? @default(0) @db.Integer
|
||||||
keywordFinish String? @db.VarChar(100)
|
keywordFinish String? @map("keyword_finish") @db.VarChar(100)
|
||||||
delayMessage Int? @db.Integer
|
delayMessage Int? @map("delay_message") @db.Integer
|
||||||
unknownMessage String? @db.VarChar(100)
|
unknownMessage String? @map("unknown_message") @db.VarChar(100)
|
||||||
listeningFromMe Boolean? @default(false) @db.Boolean
|
listeningFromMe Boolean? @default(false) @map("listening_from_me") @db.Boolean
|
||||||
stopBotFromMe Boolean? @default(false) @db.Boolean
|
stopBotFromMe Boolean? @default(false) @map("stop_bot_from_me") @db.Boolean
|
||||||
keepOpen Boolean? @default(false) @db.Boolean
|
keepOpen Boolean? @default(false) @map("keep_open") @db.Boolean
|
||||||
debounceTime Int? @db.Integer
|
debounceTime Int? @map("debounce_time") @db.Integer
|
||||||
ignoreJids Json?
|
ignoreJids Json? @map("ignore_jids")
|
||||||
speechToText Boolean? @default(false) @db.Boolean
|
speechToText Boolean? @default(false) @map("speech_to_text") @db.Boolean
|
||||||
createdAt DateTime? @default(now()) @db.Timestamp
|
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz()
|
||||||
updatedAt DateTime @updatedAt @db.Timestamp
|
updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz()
|
||||||
OpenaiCreds OpenaiCreds? @relation(fields: [openaiCredsId], references: [id])
|
|
||||||
openaiCredsId String @unique
|
openaiCredsId String @unique @map("openai_creds_id")
|
||||||
Fallback OpenaiBot? @relation(fields: [openaiIdFallback], references: [id])
|
OpenaiCreds OpenaiCreds? @relation(fields: [openaiCredsId], references: [id])
|
||||||
openaiIdFallback String? @db.VarChar(100)
|
|
||||||
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
openaiIdFallback String? @map("openai_id_fallback") @db.VarChar(100)
|
||||||
instanceId String @unique
|
Fallback OpenaiBot? @relation(fields: [openaiIdFallback], references: [id])
|
||||||
|
|
||||||
|
instanceId String @unique @map("instance_id")
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
|
@@map("openai_settings")
|
||||||
}
|
}
|
||||||
|
|
||||||
model Template {
|
model Template {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
templateId String @unique @db.VarChar(255)
|
templateId String @unique @map("template_id") @db.VarChar(255)
|
||||||
name String @unique @db.VarChar(255)
|
name String @unique @db.VarChar(255)
|
||||||
template Json @db.JsonB
|
template Json @db.JsonB
|
||||||
webhookUrl String? @db.VarChar(500)
|
webhookUrl String? @map("webhook_url") @db.VarChar(500)
|
||||||
createdAt DateTime? @default(now()) @db.Timestamp
|
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz()
|
||||||
updatedAt DateTime @updatedAt @db.Timestamp
|
updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz()
|
||||||
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
|
||||||
instanceId String
|
instanceId String @map("instance_id")
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
|
@@map("templates")
|
||||||
}
|
}
|
||||||
|
|
||||||
model Dify {
|
model Dify {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
enabled Boolean @default(true) @db.Boolean
|
enabled Boolean @default(true) @db.Boolean
|
||||||
description String? @db.VarChar(255)
|
description String? @db.VarChar(255)
|
||||||
botType DifyBotType
|
botType DifyBotType @map("bot_type")
|
||||||
apiUrl String? @db.VarChar(255)
|
apiUrl String? @map("api_url") @db.VarChar(255)
|
||||||
apiKey String? @db.VarChar(255)
|
apiKey String? @map("api_key") @db.VarChar(255)
|
||||||
expire Int? @default(0) @db.Integer
|
expire Int? @default(0) @db.Integer
|
||||||
keywordFinish String? @db.VarChar(100)
|
keywordFinish String? @map("keyword_finish") @db.VarChar(100)
|
||||||
delayMessage Int? @db.Integer
|
delayMessage Int? @map("delay_message") @db.Integer
|
||||||
unknownMessage String? @db.VarChar(100)
|
unknownMessage String? @map("unknown_message") @db.VarChar(100)
|
||||||
listeningFromMe Boolean? @default(false) @db.Boolean
|
listeningFromMe Boolean? @default(false) @map("listening_from_me") @db.Boolean
|
||||||
stopBotFromMe Boolean? @default(false) @db.Boolean
|
stopBotFromMe Boolean? @default(false) @map("stop_bot_from_me") @db.Boolean
|
||||||
keepOpen Boolean? @default(false) @db.Boolean
|
keepOpen Boolean? @default(false) @map("keep_open") @db.Boolean
|
||||||
debounceTime Int? @db.Integer
|
debounceTime Int? @map("debounce_time") @db.Integer
|
||||||
ignoreJids Json?
|
ignoreJids Json? @map("ignore_jids")
|
||||||
triggerType TriggerType?
|
triggerType TriggerType? @map("trigger_type")
|
||||||
triggerOperator TriggerOperator?
|
triggerOperator TriggerOperator? @map("trigger_operator")
|
||||||
triggerValue String?
|
triggerValue String? @map("trigger_value")
|
||||||
createdAt DateTime? @default(now()) @db.Timestamp
|
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz()
|
||||||
updatedAt DateTime @updatedAt @db.Timestamp
|
updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz()
|
||||||
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
|
||||||
instanceId String
|
instanceId String @map("instance_id")
|
||||||
DifySetting DifySetting[]
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
|
DifySetting DifySetting[]
|
||||||
|
|
||||||
|
@@map("difys")
|
||||||
}
|
}
|
||||||
|
|
||||||
model DifySetting {
|
model DifySetting {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
expire Int? @default(0) @db.Integer
|
expire Int? @default(0) @db.Integer
|
||||||
keywordFinish String? @db.VarChar(100)
|
keywordFinish String? @map("keyword_finish") @db.VarChar(100)
|
||||||
delayMessage Int? @db.Integer
|
delayMessage Int? @map("delay_message") @db.Integer
|
||||||
unknownMessage String? @db.VarChar(100)
|
unknownMessage String? @map("unknown_message") @db.VarChar(100)
|
||||||
listeningFromMe Boolean? @default(false) @db.Boolean
|
listeningFromMe Boolean? @default(false) @map("listening_from_me") @db.Boolean
|
||||||
stopBotFromMe Boolean? @default(false) @db.Boolean
|
stopBotFromMe Boolean? @default(false) @map("stop_bot_from_me") @db.Boolean
|
||||||
keepOpen Boolean? @default(false) @db.Boolean
|
keepOpen Boolean? @default(false) @map("keep_open") @db.Boolean
|
||||||
debounceTime Int? @db.Integer
|
debounceTime Int? @map("debounce_time") @db.Integer
|
||||||
ignoreJids Json?
|
ignoreJids Json? @map("ignore_jids")
|
||||||
createdAt DateTime? @default(now()) @db.Timestamp
|
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz()
|
||||||
updatedAt DateTime @updatedAt @db.Timestamp
|
updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz()
|
||||||
Fallback Dify? @relation(fields: [difyIdFallback], references: [id])
|
|
||||||
difyIdFallback String? @db.VarChar(100)
|
difyIdFallback String? @map("dify_id_fallback") @db.VarChar(100)
|
||||||
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
Fallback Dify? @relation(fields: [difyIdFallback], references: [id])
|
||||||
instanceId String @unique
|
|
||||||
|
instanceId String @unique @map("instance_id")
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
|
@@map("dify_settings")
|
||||||
}
|
}
|
||||||
|
|
||||||
model EvolutionBot {
|
model EvolutionBot {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
enabled Boolean @default(true) @db.Boolean
|
enabled Boolean @default(true) @db.Boolean
|
||||||
description String? @db.VarChar(255)
|
description String? @db.VarChar(255)
|
||||||
apiUrl String? @db.VarChar(255)
|
apiUrl String? @map("api_url") @db.VarChar(255)
|
||||||
apiKey String? @db.VarChar(255)
|
apiKey String? @map("api_key") @db.VarChar(255)
|
||||||
expire Int? @default(0) @db.Integer
|
expire Int? @default(0) @db.Integer
|
||||||
keywordFinish String? @db.VarChar(100)
|
keywordFinish String? @map("keyword_finish") @db.VarChar(100)
|
||||||
delayMessage Int? @db.Integer
|
delayMessage Int? @map("delay_message") @db.Integer
|
||||||
unknownMessage String? @db.VarChar(100)
|
unknownMessage String? @map("unknown_message") @db.VarChar(100)
|
||||||
listeningFromMe Boolean? @default(false) @db.Boolean
|
listeningFromMe Boolean? @default(false) @map("listening_from_me") @db.Boolean
|
||||||
stopBotFromMe Boolean? @default(false) @db.Boolean
|
stopBotFromMe Boolean? @default(false) @map("stop_bot_from_me") @db.Boolean
|
||||||
keepOpen Boolean? @default(false) @db.Boolean
|
keepOpen Boolean? @default(false) @map("keep_open") @db.Boolean
|
||||||
debounceTime Int? @db.Integer
|
debounceTime Int? @map("debounce_time") @db.Integer
|
||||||
ignoreJids Json?
|
ignoreJids Json? @map("ignore_jids")
|
||||||
triggerType TriggerType?
|
triggerType TriggerType? @map("trigger_type")
|
||||||
triggerOperator TriggerOperator?
|
triggerOperator TriggerOperator? @map("trigger_operator")
|
||||||
triggerValue String?
|
triggerValue String? @map("trigger_value")
|
||||||
createdAt DateTime? @default(now()) @db.Timestamp
|
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz()
|
||||||
updatedAt DateTime @updatedAt @db.Timestamp
|
updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz()
|
||||||
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
|
||||||
instanceId String
|
instanceId String @map("instance_id")
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
EvolutionBotSetting EvolutionBotSetting[]
|
EvolutionBotSetting EvolutionBotSetting[]
|
||||||
|
|
||||||
|
@@map("evolution_bots")
|
||||||
}
|
}
|
||||||
|
|
||||||
model EvolutionBotSetting {
|
model EvolutionBotSetting {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
expire Int? @default(0) @db.Integer
|
expire Int? @default(0) @db.Integer
|
||||||
keywordFinish String? @db.VarChar(100)
|
keywordFinish String? @map("keyword_finish") @db.VarChar(100)
|
||||||
delayMessage Int? @db.Integer
|
delayMessage Int? @map("delay_message") @db.Integer
|
||||||
unknownMessage String? @db.VarChar(100)
|
unknownMessage String? @map("unknown_message") @db.VarChar(100)
|
||||||
listeningFromMe Boolean? @default(false) @db.Boolean
|
listeningFromMe Boolean? @default(false) @map("listening_from_me") @db.Boolean
|
||||||
stopBotFromMe Boolean? @default(false) @db.Boolean
|
stopBotFromMe Boolean? @default(false) @map("stop_bot_from_me") @db.Boolean
|
||||||
keepOpen Boolean? @default(false) @db.Boolean
|
keepOpen Boolean? @default(false) @map("keep_open") @db.Boolean
|
||||||
debounceTime Int? @db.Integer
|
debounceTime Int? @map("debounce_time") @db.Integer
|
||||||
ignoreJids Json?
|
ignoreJids Json? @map("ignore_jids")
|
||||||
createdAt DateTime? @default(now()) @db.Timestamp
|
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz()
|
||||||
updatedAt DateTime @updatedAt @db.Timestamp
|
updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz()
|
||||||
Fallback EvolutionBot? @relation(fields: [botIdFallback], references: [id])
|
|
||||||
botIdFallback String? @db.VarChar(100)
|
botIdFallback String? @map("bot_id_fallback") @db.VarChar(100)
|
||||||
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
Fallback EvolutionBot? @relation(fields: [botIdFallback], references: [id])
|
||||||
instanceId String @unique
|
|
||||||
|
instanceId String @unique @map("instance_id")
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
|
@@map("evolution_bot_settings")
|
||||||
}
|
}
|
||||||
|
|
||||||
model Flowise {
|
model Flowise {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
enabled Boolean @default(true) @db.Boolean
|
enabled Boolean @default(true) @db.Boolean
|
||||||
description String? @db.VarChar(255)
|
description String? @db.VarChar(255)
|
||||||
apiUrl String? @db.VarChar(255)
|
apiUrl String? @map("api_url") @db.VarChar(255)
|
||||||
apiKey String? @db.VarChar(255)
|
apiKey String? @map("api_key") @db.VarChar(255)
|
||||||
expire Int? @default(0) @db.Integer
|
expire Int? @default(0) @db.Integer
|
||||||
keywordFinish String? @db.VarChar(100)
|
keywordFinish String? @map("keyword_finish") @db.VarChar(100)
|
||||||
delayMessage Int? @db.Integer
|
delayMessage Int? @map("delay_message") @db.Integer
|
||||||
unknownMessage String? @db.VarChar(100)
|
unknownMessage String? @map("unknown_message") @db.VarChar(100)
|
||||||
listeningFromMe Boolean? @default(false) @db.Boolean
|
listeningFromMe Boolean? @default(false) @map("listening_from_me") @db.Boolean
|
||||||
stopBotFromMe Boolean? @default(false) @db.Boolean
|
stopBotFromMe Boolean? @default(false) @map("stop_bot_from_me") @db.Boolean
|
||||||
keepOpen Boolean? @default(false) @db.Boolean
|
keepOpen Boolean? @default(false) @map("keep_open") @db.Boolean
|
||||||
debounceTime Int? @db.Integer
|
debounceTime Int? @map("debounce_time") @db.Integer
|
||||||
ignoreJids Json?
|
ignoreJids Json? @map("ignore_jids")
|
||||||
triggerType TriggerType?
|
triggerType TriggerType? @map("trigger_type")
|
||||||
triggerOperator TriggerOperator?
|
triggerOperator TriggerOperator? @map("trigger_operator")
|
||||||
triggerValue String?
|
triggerValue String? @map("trigger_value")
|
||||||
createdAt DateTime? @default(now()) @db.Timestamp
|
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz()
|
||||||
updatedAt DateTime @updatedAt @db.Timestamp
|
updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz()
|
||||||
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
|
||||||
instanceId String
|
instanceId String @map("instance_id")
|
||||||
FlowiseSetting FlowiseSetting[]
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
|
FlowiseSetting FlowiseSetting[]
|
||||||
|
|
||||||
|
@@map("flowises")
|
||||||
}
|
}
|
||||||
|
|
||||||
model FlowiseSetting {
|
model FlowiseSetting {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
expire Int? @default(0) @db.Integer
|
expire Int? @default(0) @db.Integer
|
||||||
keywordFinish String? @db.VarChar(100)
|
keywordFinish String? @map("keyword_finish") @db.VarChar(100)
|
||||||
delayMessage Int? @db.Integer
|
delayMessage Int? @map("delay_message") @db.Integer
|
||||||
unknownMessage String? @db.VarChar(100)
|
unknownMessage String? @map("unknown_message") @db.VarChar(100)
|
||||||
listeningFromMe Boolean? @default(false) @db.Boolean
|
listeningFromMe Boolean? @default(false) @map("listening_from_me") @db.Boolean
|
||||||
stopBotFromMe Boolean? @default(false) @db.Boolean
|
stopBotFromMe Boolean? @default(false) @map("stop_bot_from_me") @db.Boolean
|
||||||
keepOpen Boolean? @default(false) @db.Boolean
|
keepOpen Boolean? @default(false) @map("keep_open") @db.Boolean
|
||||||
debounceTime Int? @db.Integer
|
debounceTime Int? @map("debounce_time") @db.Integer
|
||||||
ignoreJids Json?
|
ignoreJids Json? @map("ignore_jids")
|
||||||
createdAt DateTime? @default(now()) @db.Timestamp
|
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz()
|
||||||
updatedAt DateTime @updatedAt @db.Timestamp
|
updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz()
|
||||||
Fallback Flowise? @relation(fields: [flowiseIdFallback], references: [id])
|
|
||||||
flowiseIdFallback String? @db.VarChar(100)
|
flowiseIdFallback String? @map("flowise_id_fallback") @db.VarChar(100)
|
||||||
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
Fallback Flowise? @relation(fields: [flowiseIdFallback], references: [id])
|
||||||
instanceId String @unique
|
|
||||||
|
instanceId String @unique @map("instance_id")
|
||||||
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
|
@@map("flowise_settings")
|
||||||
}
|
}
|
||||||
|
|
||||||
model IsOnWhatsapp {
|
model IsOnWhatsapp {
|
||||||
|
@ -204,7 +204,7 @@ export class InstanceController {
|
|||||||
const urlServer = this.configService.get<HttpServer>('SERVER').URL;
|
const urlServer = this.configService.get<HttpServer>('SERVER').URL;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.chatwootService.create(instance, {
|
await this.chatwootService.create(instance, {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
accountId: instanceData.chatwootAccountId,
|
accountId: instanceData.chatwootAccountId,
|
||||||
token: instanceData.chatwootToken,
|
token: instanceData.chatwootToken,
|
||||||
@ -220,10 +220,10 @@ export class InstanceController {
|
|||||||
daysLimitImportMessages: instanceData.chatwootDaysLimitImportMessages ?? 60,
|
daysLimitImportMessages: instanceData.chatwootDaysLimitImportMessages ?? 60,
|
||||||
organization: instanceData.chatwootOrganization,
|
organization: instanceData.chatwootOrganization,
|
||||||
logo: instanceData.chatwootLogo,
|
logo: instanceData.chatwootLogo,
|
||||||
autoCreate: instanceData.chatwootAutoCreate !== false,
|
autoCreate: instanceData.chatwootAutoCreate ?? true,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.log(error);
|
this.logger.error(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -1477,7 +1477,7 @@ export class ChatwootService {
|
|||||||
let inReplyToExternalId = null;
|
let inReplyToExternalId = null;
|
||||||
|
|
||||||
if (msg) {
|
if (msg) {
|
||||||
inReplyToExternalId = msg.message?.extendedTextMessage?.contextInfo?.stanzaId;
|
inReplyToExternalId = msg.message?.extendedTextMessage?.contextInfo?.stanzaId ?? msg.contextInfo?.stanzaId;
|
||||||
if (inReplyToExternalId) {
|
if (inReplyToExternalId) {
|
||||||
const message = await this.getMessageByKeyId(instance, inReplyToExternalId);
|
const message = await this.getMessageByKeyId(instance, inReplyToExternalId);
|
||||||
if (message?.chatwootMessageId) {
|
if (message?.chatwootMessageId) {
|
||||||
|
2
src/cache/cacheengine.ts
vendored
2
src/cache/cacheengine.ts
vendored
@ -20,8 +20,6 @@ export class CacheEngine {
|
|||||||
logger.verbose(`LocalCache initialized for ${module}`);
|
logger.verbose(`LocalCache initialized for ${module}`);
|
||||||
this.engine = new LocalCache(configService, module);
|
this.engine = new LocalCache(configService, module);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public getEngine() {
|
public getEngine() {
|
||||||
|
Loading…
Reference in New Issue
Block a user