"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const addUserToAudience_1 = __importDefault(require("./addUserToAudience"));
const removeUserFromAudience_1 = __importDefault(require("./removeUserFromAudience"));
const criteo_audiences_1 = require("./criteo-audiences");
const destination = {
    name: 'Criteo Audiences',
    slug: 'actions-criteo-audiences',
    description: 'Add/remove users to/from Criteo Audiences using Criteo API',
    mode: 'cloud',
    authentication: {
        scheme: 'custom',
        fields: {
            client_id: {
                label: 'API Client ID',
                description: 'Your Criteo API client ID',
                type: 'string',
                required: true
            },
            client_secret: {
                label: 'API Client Secret',
                description: 'Your Criteo API client secret',
                type: 'password',
                required: true
            },
            advertiser_id: {
                label: 'Advertiser ID',
                description: 'Your Criteo Advertiser ID',
                type: 'string',
                required: true
            },
            enable_batching: {
                type: 'boolean',
                label: 'Enable Batching',
                description: 'Important: This setting should remain enabled!',
                required: false,
                default: true
            }
        },
        testAuthentication: async (request, { settings }) => {
            const credentials = await (0, criteo_audiences_1.criteoAuthenticate)(request, {
                client_id: settings.client_id,
                client_secret: settings.client_secret
            });
            return credentials.access_token;
        }
    },
    actions: {
        addUserToAudience: addUserToAudience_1.default,
        removeUserFromAudience: removeUserFromAudience_1.default
    }
};
exports.default = destination;
//# sourceMappingURL=index.js.map