"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const send_1 = __importDefault(require("./send"));
const presets_1 = require("./presets");
const destination = {
    name: 'Appcues (Actions)',
    slug: 'actions-appcues',
    mode: 'cloud',
    description: 'Send events to Appcues.',
    authentication: {
        scheme: 'custom',
        fields: {
            apiKey: {
                label: 'API Key',
                description: 'Your Appcues API key.',
                type: 'password',
                required: true
            },
            apiSecret: {
                label: 'API Secret',
                description: 'Your Appcues API secret.',
                type: 'password',
                required: true
            },
            accountId: {
                label: 'Account ID',
                description: 'Your Appcues account ID.',
                type: 'number',
                required: true
            },
            region: {
                label: 'Region',
                description: 'Select the region for your Appcues account.',
                type: 'string',
                required: true,
                choices: [
                    { label: 'US', value: 'US' },
                    { label: 'EU', value: 'EU' }
                ],
                default: 'US'
            }
        }
    },
    extendRequest({ settings }) {
        const { apiKey, apiSecret } = settings;
        return {
            headers: {
                Authorization: `Basic ${Buffer.from(`${apiKey}:${apiSecret}`).toString('base64')}`,
                'Content-Type': 'application/json'
            }
        };
    },
    presets: presets_1.presets,
    actions: {
        send: send_1.default
    }
};
exports.default = destination;
//# sourceMappingURL=index.js.map