Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
newMessageWithContent.id
}|${newMessageWithContent.fiscalCode}`
);
const messageStatusUpdater = getMessageStatusUpdater(
messageStatusModel,
newMessageWithContent.id
);
const eventName = "handler.message.process";
const appInsightsClient = getCustomTelemetryClient(
{
operationId: newMessageWithContent.id,
operationParentId: newMessageWithContent.id,
serviceId: NonEmptyString.is(newMessageWithContent.senderServiceId)
? newMessageWithContent.senderServiceId
: undefined
},
{
messageId: newMessageWithContent.id
}
);
// now we can trigger the notifications for the message
return handleMessage(
profileModel,
messageModel,
notificationModel,
senderServiceModel,
blobService,
defaultWebhookUrl,
const notificationStatusUpdater = getNotificationStatusUpdater(
notificationStatusModel,
NotificationChannelEnum.WEBHOOK,
webhookNotificationEvent.message.id,
webhookNotificationEvent.notificationId
);
const serviceId = webhookNotificationEvent.message.senderServiceId;
const eventName = "handler.notification.webhook";
const appInsightsClient = getCustomTelemetryClient(
{
operationId: webhookNotificationEvent.notificationId,
operationParentId: webhookNotificationEvent.message.id,
serviceId: NonEmptyString.is(serviceId) ? serviceId : undefined
},
{
messageId: webhookNotificationEvent.message.id,
notificationId: webhookNotificationEvent.notificationId
}
);
return handleNotification(
appInsightsClient,
notificationModel,
webhookNotificationEvent
)
.then(errorOrWebhookNotificationEvt =>
errorOrWebhookNotificationEvt.fold(
async error => {
if (isExpiredError(error)) {
creds: {
Secret: mailupSecret,
Username: mailupUsername
}
})
);
const serviceId = emailNotificationEvent.message.senderServiceId;
const eventName = "handler.notification.email";
const appInsightsClient = getCustomTelemetryClient(
{
operationId: emailNotificationEvent.notificationId,
operationParentId: emailNotificationEvent.message.id,
serviceId: NonEmptyString.is(serviceId) ? serviceId : undefined
},
{
messageId: emailNotificationEvent.message.id,
notificationId: emailNotificationEvent.notificationId
}
);
return handleNotification(
mailerTransporter,
appInsightsClient,
notificationModel,
emailNotificationEvent,
{
HTML_TO_TEXT_OPTIONS,
MAIL_FROM
}