"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const createWork_1 = __importDefault(require("./createWork"));
const createRevUser_1 = __importDefault(require("./createRevUser"));
const utils_1 = require("./utils");
const streamEvent_1 = __importDefault(require("./streamEvent"));
const destination = {
    name: 'DevRev',
    slug: 'actions-devrev',
    mode: 'cloud',
    description: 'Send Segment events via Cloud Mode to DevRev to create work items and RevUsers',
    extendRequest: ({ settings }) => {
        return {
            headers: { Authorization: `${settings.apiKey}` }
        };
    },
    authentication: {
        scheme: 'custom',
        fields: {
            apiKey: {
                label: 'DevRev API Key',
                description: 'Your DevRev API Key, generated from the setting page in your DevRev organization.',
                type: 'password',
                required: true
            },
            blacklistedDomains: {
                label: 'Blacklisted Domains',
                description: 'A comma separated list of email domains to blacklist from being used to search for/create Accounts.',
                type: 'string',
                required: false,
                default: 'gmail.com,hotmail.com,outlook.com,yahoo.com,aol.com,icloud.com,me.com,msn.com'
            }
        },
        testAuthentication: (request, { settings }) => {
            const url = `${(0, utils_1.getBaseUrl)(settings)}${utils_1.devrevApiPaths.authTest}`;
            return request(url);
        }
    },
    actions: {
        createWork: createWork_1.default,
        createRevUser: createRevUser_1.default,
        streamEvent: streamEvent_1.default
    }
};
exports.default = destination;
//# sourceMappingURL=index.js.map