"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const trackLead_1 = __importDefault(require("./trackLead"));
const trackSale_1 = __importDefault(require("./trackSale"));
const destination = {
    name: 'Dub (Actions)',
    slug: 'actions-dub',
    mode: 'cloud',
    description: 'Track Lead and Sale conversion events on Dub.',
    authentication: {
        scheme: 'custom',
        fields: {
            apiKey: {
                label: 'API Key',
                description: 'The API Key is available via Dub Dashboard: https://app.dub.co/settings/tokens',
                type: 'password',
                required: true
            }
        }
    },
    extendRequest({ settings }) {
        return {
            headers: {
                Authorization: `Bearer ${settings.apiKey}`,
                'Content-Type': 'application/json'
            }
        };
    },
    presets: [
        {
            name: 'Dub Browser Plugin',
            subscribe: 'type = "track" or type = "identify" or type = "group" or type = "page" or type = "alias"',
            partnerAction: 'dubPlugin',
            mapping: {},
            type: 'automatic'
        }
    ],
    actions: {
        trackLead: trackLead_1.default,
        trackSale: trackSale_1.default
    }
};
exports.default = destination;
//# sourceMappingURL=index.js.map