Skip to content

Commit

Permalink
bug fix: url validation
Browse files Browse the repository at this point in the history
  • Loading branch information
jrCleber committed Nov 1, 2024
1 parent 3925ffb commit c2f96e2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 27 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
"@types/jsonwebtoken": "^9.0.5",
"@types/mime-types": "^2.1.4",
"@types/multer": "^1.4.12",
"@types/node": "^22.8.6",
"@types/qrcode": "^1.5.5",
"@types/qrcode-terminal": "^0.12.2",
"@types/swagger-ui-express": "^4.1.6",
Expand Down
26 changes: 0 additions & 26 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ model Instance {
Chat Chat[]
Contact Contact[]
Webhook Webhook?
Typebot Typebot?
ActivityLogs ActivityLogs[]
Message Message[]
}
Expand Down Expand Up @@ -101,8 +100,6 @@ model Message {
isGroup Boolean? @db.Boolean
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId Int
TypebotSession TypebotSession? @relation(fields: [typebotSessionId], references: [id], onDelete: Cascade)
typebotSessionId Int?
MessageUpdate MessageUpdate[]
Media Media?
Expand Down Expand Up @@ -158,35 +155,12 @@ model Webhook {
instanceId Int @unique
}

model Typebot {
id Int @id @default(autoincrement())
publicId String @db.VarChar(200)
typebotUrl String @db.VarChar(500)
enabled Boolean? @default(true) @db.Boolean
enableGroup Boolean? @default(false) @db.Boolean
createdAt DateTime? @default(now())
updatedAt DateTime? @updatedAt
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
instanceId Int @unique
TypebotSession TypebotSession[]
}

enum TypebotSessionStatus {
open
closed
paused
}

model TypebotSession {
id Int @id @default(autoincrement())
sessionId String @db.VarChar(200)
remoteJid String @db.VarChar(100)
status TypebotSessionStatus @default(open)
Typebot Typebot @relation(fields: [typebotId], references: [id], onDelete: Cascade)
typebotId Int
Message Message[]
}

enum StartConversationAs {
open
pending
Expand Down
2 changes: 1 addition & 1 deletion src/whatsapp/services/whatsapp.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1453,7 +1453,7 @@ export class WAStartupService {

let ext = mediaMessage.extension;

if (isURL(mediaMessage.media as string)) {
if (['http', 'https'].includes(mediaMessage.media as string)) {
const response = await axios.get(mediaMessage.media as string, {
responseType: 'arraybuffer',
});
Expand Down

0 comments on commit c2f96e2

Please sign in to comment.