"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const trackEvent_1 = __importDefault(require("./trackEvent"));
const identifyUser_1 = __importDefault(require("./identifyUser"));
const destination = {
    name: 'Rehook',
    slug: 'actions-rehook',
    mode: 'cloud',
    authentication: {
        scheme: 'basic',
        fields: {
            api_key: {
                label: 'Api Key',
                description: 'Your Rehook API Key',
                type: 'password',
                required: true
            },
            api_secret: {
                label: 'Api Secret',
                description: 'Your Rehook API Secret',
                type: 'password',
                required: true
            }
        },
        testAuthentication: (request) => {
            return request(`https://api.rehook.ai/events/segment/check-auth`);
        }
    },
    extendRequest({ settings }) {
        if (!settings.api_key || !settings.api_secret) {
            throw new Error('Missing API KEY or API SECRET');
        }
        return {
            username: settings.api_key,
            password: settings.api_secret
        };
    },
    actions: {
        trackEvent: trackEvent_1.default,
        identifyUser: identifyUser_1.default
    }
};
exports.default = destination;
//# sourceMappingURL=index.js.map