"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const actions_core_1 = require("@segment/actions-core");
const insiderAudiences_1 = __importDefault(require("./insiderAudiences"));
const destination = {
    name: 'Insider Audiences',
    slug: 'actions-insider-audiences',
    mode: 'cloud',
    authentication: {
        scheme: 'custom',
        fields: {
            account_name: {
                label: 'Account Name',
                description: 'You can get your Account Name via Insider Inone Panel > Settings > Inone Settings > Account Preferences.',
                type: 'string',
                required: true
            },
            ucd_key: {
                label: 'API Key',
                description: 'You can get your API Key via Insider Inone Panel > Settings > Preferences > Integration Settings',
                type: 'password',
                required: true
            }
        }
    },
    extendRequest: ({ settings }) => {
        return {
            headers: { 'X-PARTNER-NAME': settings.account_name, 'X-REQUEST-TOKEN': settings.ucd_key }
        };
    },
    actions: {
        insiderAudiences: insiderAudiences_1.default
    },
    presets: [
        {
            name: 'Sync Engage Audience to Insider',
            subscribe: 'type = "track" or type = "identify"',
            partnerAction: 'insiderAudiences',
            mapping: (0, actions_core_1.defaultValues)(insiderAudiences_1.default.fields),
            type: 'automatic'
        }
    ]
};
exports.default = destination;
//# sourceMappingURL=index.js.map