How to use the italia-ts-commons/lib/strings.NonEmptyString.is function in italia-ts-commons

To help you get started, we’ve selected a few italia-ts-commons examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github teamdigitale / io-functions / lib / created_message_queue_handler.ts View on Github external
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,
github teamdigitale / io-functions / lib / webhook_queue_handler.ts View on Github external
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)) {
github teamdigitale / io-functions / lib / emailnotifications_queue_handler.ts View on Github external
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
    }