fix(platformclient): Refactor debug mode checks in SzPlatformClient connectors

This commit is contained in:
2024-10-05 07:54:09 +02:00
parent edc54f4fc1
commit 854f1f73dc
8 changed files with 65 additions and 8 deletions

View File

@@ -10,13 +10,17 @@ export class SzSmsConnector {
}
public async sendSms(messageArg: plugins.servezoneInterfaces.platformservice.sms.IRequest_SendSms['request']) {
if (process.env.SERVEZONE_PLATFORMCLIENT_DEBUG) {
if (this.platformClientRef.debugMode) {
logger.log('info', `sent sms to ${messageArg.toNumber}}
body:
${messageArg.messageText.split('\n').map(line => ` ${line}`).join('\n')}
`);
}
if (this.platformClientRef.debugMode) {
return;
}
const typedrequest = this.platformClientRef.typedsocket.createTypedRequest<plugins.servezoneInterfaces.platformservice.sms.IRequest_SendSms>(
'sendSms'