Skip to content

Commit

Permalink
feat: Fixes and implementation of regex and fallback in typebot
Browse files Browse the repository at this point in the history
  • Loading branch information
dgcode-tec committed Jul 12, 2024
1 parent a52a687 commit 480cc67
Show file tree
Hide file tree
Showing 6 changed files with 222 additions and 93 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
* Organization configuration and logo in chatwoot bot contact
* Added debounce time for typebot messages
* Tagging in chatwoot contact by instance
* Add support for managing WhatsApp templates via official API
* Fixes and implementation of regex and fallback in typebot

### Fixed

Expand All @@ -19,6 +21,8 @@
* Correction of audio sending, now we can speed it up and have the audio wireframe
* Reply with media message on Chatwoot
* improvements in sending status and groups
* Correction in response returns from buttons, lists and templates
* EvolutionAPI/Baileys implemented

### Break changes

Expand All @@ -35,6 +39,7 @@
- Session search by typebot or remoteJid
- KeepOpen configuration (keeps the session even when the bot ends, to run once per contact)
- StopBotFromMe configuration, allows me to stop the bot if I send a chat message.
* Changed the way the goal webhook is configured

# 1.8.2 (2024-07-03 13:50)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- AlterEnum
ALTER TYPE "TriggerOperator" ADD VALUE 'regex';

-- AlterTable
ALTER TABLE "TypebotSetting" ADD COLUMN "typebotIdFallback" VARCHAR(100);

-- AddForeignKey
ALTER TABLE "TypebotSetting" ADD CONSTRAINT "TypebotSetting_typebotIdFallback_fkey" FOREIGN KEY ("typebotIdFallback") REFERENCES "Typebot"("id") ON DELETE SET NULL ON UPDATE CASCADE;
30 changes: 17 additions & 13 deletions prisma/postgresql-schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ enum TriggerOperator {
equals
startsWith
endsWith
regex
}

model Instance {
Expand Down Expand Up @@ -271,6 +272,7 @@ model Typebot {
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String
sessions TypebotSession[]
TypebotSetting TypebotSetting[]
}

model TypebotSession {
Expand All @@ -291,17 +293,19 @@ model TypebotSession {
}

model TypebotSetting {
id String @id @default(cuid())
expire Int? @default(0) @db.Integer
keywordFinish String? @db.VarChar(100)
delayMessage Int? @db.Integer
unknownMessage String? @db.VarChar(100)
listeningFromMe Boolean? @default(false) @db.Boolean
stopBotFromMe Boolean? @default(false) @db.Boolean
keepOpen Boolean? @default(false) @db.Boolean
debounceTime Int? @db.Integer
createdAt DateTime? @default(now()) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String @unique
id String @id @default(cuid())
expire Int? @default(0) @db.Integer
keywordFinish String? @db.VarChar(100)
delayMessage Int? @db.Integer
unknownMessage String? @db.VarChar(100)
listeningFromMe Boolean? @default(false) @db.Boolean
stopBotFromMe Boolean? @default(false) @db.Boolean
keepOpen Boolean? @default(false) @db.Boolean
debounceTime Int? @db.Integer
typebotIdFallback String? @db.VarChar(100)
createdAt DateTime? @default(now()) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
Fallback Typebot? @relation(fields: [typebotIdFallback], references: [id])
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId String @unique
}
1 change: 1 addition & 0 deletions src/api/integrations/typebot/dto/typebot.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ export class TypebotSettingDto {
stopBotFromMe?: boolean;
keepOpen?: boolean;
debounceTime?: number;
typebotIdFallback?: string;
}
Loading

0 comments on commit 480cc67

Please sign in to comment.