"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const createContact_1 = __importDefault(require("./createContact"));
const triggerSurvey_1 = __importDefault(require("./triggerSurvey"));
const destination = {
    name: 'Surveysparrow',
    slug: 'actions-surveysparrow',
    mode: 'cloud',
    description: 'Trigger Surveys and Create Contacts in SurveySparrow',
    authentication: {
        scheme: 'custom',
        fields: {
            apiToken: {
                label: 'Access Token',
                description: 'SurveySparrow Access Token can be found in Settings > Apps and Integrations > Create a Custom app',
                type: 'password',
                required: true
            }
        },
        testAuthentication: (request) => {
            return request(`https://api.surveysparrow.com/v3/users`, {
                method: 'get'
            });
        }
    },
    extendRequest({ settings }) {
        return {
            headers: { Authorization: `Bearer ${settings.apiToken}` }
        };
    },
    actions: {
        createContact: createContact_1.default,
        triggerSurvey: triggerSurvey_1.default
    }
};
exports.default = destination;
//# sourceMappingURL=index.js.map