"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const syncAudiences_1 = __importDefault(require("./syncAudiences"));
const const_1 = require("./const");
const destination = {
    name: 'Postscript',
    slug: 'actions-postscript',
    description: 'Postscript data destination for Segment',
    mode: 'cloud',
    authentication: {
        scheme: 'custom',
        fields: {
            secret_key: {
                label: 'Secret Key',
                description: 'Your Postscript API secret key',
                type: 'password',
                required: true
            }
        },
        testAuthentication: (request) => {
            return request(const_1.PS_BASE_URL + '/api/v2/me', {
                method: 'get'
            });
        }
    },
    extendRequest: ({ settings }) => {
        return {
            headers: {
                Authorization: `Bearer ${settings.secret_key}`,
                'Content-Type': 'application/json'
            }
        };
    },
    actions: {
        syncAudiences: syncAudiences_1.default
    }
};
exports.default = destination;
//# sourceMappingURL=index.js.map