Skip to content

Commit 9aa2b1b

Browse files
committed
chore: Add apiKey and ServerUrl to prefilledVariables in typebot service
Update typebot.service.ts to add apiKey and ServerUrl to prefilledVariables. This change is necessary for the typebot service to correctly prefill variables with the required credentials. The deleted file .github/workflows/publish_docker_image_v2.yml was not related to this change. Note: This change does not affect the current functionality but provides a better way to handle credentials. Confidence: 90%
1 parent b907d85 commit 9aa2b1b

File tree

2 files changed

+10
-49
lines changed

2 files changed

+10
-49
lines changed

.github/workflows/publish_docker_image_v2.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

src/api/integrations/typebot/services/typebot.service.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { Message, Typebot as TypebotModel, TypebotSession } from '@prisma/client';
22
import axios from 'axios';
33

4-
import { ConfigService, S3, Typebot } from '../../../../config/env.config';
4+
import { Auth, ConfigService, HttpServer, S3, Typebot } from '../../../../config/env.config';
55
import { Logger } from '../../../../config/logger.config';
66
import { sendTelemetry } from '../../../../utils/sendTelemetry';
7+
import { ServerUP } from '../../../../utils/server-up';
78
import { InstanceDto } from '../../../dto/instance.dto';
89
import { PrismaRepository } from '../../../repository/repository.service';
910
import { WAMonitoringService } from '../../../services/monitor.service';
@@ -710,6 +711,8 @@ export class TypebotService {
710711
const prefilledVariables = {
711712
remoteJid: remoteJid,
712713
instanceName: instance.instanceName,
714+
serverUrl: this.configService.get<HttpServer>('SERVER').URL,
715+
apiKey: this.configService.get<Auth>('AUTHENTICATION').API_KEY.KEY,
713716
};
714717

715718
if (variables?.length) {
@@ -904,6 +907,8 @@ export class TypebotService {
904907
remoteJid: data.remoteJid,
905908
pushName: data.pushName || data.prefilledVariables?.pushName || '',
906909
instanceName: instance.instanceName,
910+
serverUrl: this.configService.get<HttpServer>('SERVER').URL,
911+
apiKey: this.configService.get<Auth>('AUTHENTICATION').API_KEY.KEY,
907912
},
908913
};
909914
} else {
@@ -917,6 +922,8 @@ export class TypebotService {
917922
remoteJid: data.remoteJid,
918923
pushName: data.pushName || data.prefilledVariables?.pushName || '',
919924
instanceName: instance.instanceName,
925+
serverUrl: this.configService.get<HttpServer>('SERVER').URL,
926+
apiKey: this.configService.get<Auth>('AUTHENTICATION').API_KEY.KEY,
920927
},
921928
},
922929
};
@@ -936,6 +943,8 @@ export class TypebotService {
936943
remoteJid: data.remoteJid,
937944
pushName: data.pushName || '',
938945
instanceName: instance.instanceName,
946+
serverUrl: this.configService.get<HttpServer>('SERVER').URL,
947+
apiKey: this.configService.get<Auth>('AUTHENTICATION').API_KEY.KEY,
939948
},
940949
awaitUser: false,
941950
typebotId: data.typebotId,

0 commit comments

Comments
 (0)