import SendgridClient from '@sendgrid/client' import { HttpMethod } from '@sendgrid/helpers/classes/request' SendgridClient.setApiKey(process.env.SENDGRID_API_KEY) export const supressionType = { invalidEmail: 'invalid_emails', blocked: 'blocks', spam: 'spam_reports', bounces: 'bounces', } export const getSuppressionListForType = async (type) => { const request: { method: HttpMethod; url: string } = { method: 'GET', url: `/v3/suppression/${type}`, } const [, list] = await SendgridClient.request(request) return list }