"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.destinationDefinition = void 0;
const sendEmail_1 = require("./sendEmail");
const previewApiLookup_1 = require("./previewApiLookup");
const versioning_info_1 = require("./versioning-info");
exports.destinationDefinition = {
    name: 'Engage Messaging SendGrid',
    slug: 'actions-personas-messaging-sendgrid',
    mode: 'cloud',
    description: 'This is an Engage specific action to send an email',
    authentication: {
        scheme: 'custom',
        fields: {
            unlayerApiKey: {
                label: 'Unlayer API Key',
                type: 'password',
                description: 'The API key for your Unlayer account'
            },
            sendGridApiKey: {
                label: 'API Key',
                type: 'password',
                description: 'The Api Key for your SendGrid account',
                required: true
            },
            profileApiEnvironment: {
                label: 'Profile API Environment',
                description: 'Profile API Environment',
                type: 'string',
                required: true
            },
            profileApiAccessToken: {
                label: 'Profile API Access Token',
                description: 'Profile API Access Token',
                type: 'password',
                required: true
            },
            spaceId: {
                label: 'Space ID',
                description: 'Space ID',
                type: 'string',
                required: true
            },
            sourceId: {
                label: 'Source ID',
                description: 'Source ID',
                type: 'string',
                required: true
            },
            region: {
                label: 'Region',
                description: 'The region where the email is originating from',
                type: 'string',
                choices: [
                    { value: 'us-west-2', label: 'US West 2' },
                    { value: 'eu-west-1', label: 'EU West 1' }
                ],
                default: 'us-west-2',
                required: false
            }
        },
        testAuthentication: (request) => {
            return request(`https://api.sendgrid.com/${versioning_info_1.ENGAGE_MESSAGING_SENDGRID_API_VERSION}/mail_settings`);
        }
    },
    actions: {
        sendEmail: sendEmail_1.actionDefinition,
        previewApiLookup: previewApiLookup_1.actionDefinition
    }
};
exports.default = exports.destinationDefinition;
//# sourceMappingURL=index.js.map