"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const addContactToXmd_1 = __importDefault(require("./addContactToXmd"));
const upsertContactTransaction_1 = __importDefault(require("./upsertContactTransaction"));
const triggerXflowWorkflow_1 = __importDefault(require("./triggerXflowWorkflow"));
const qualtricsApiClient_1 = __importDefault(require("./qualtricsApiClient"));
const destination = {
    name: 'Qualtrics',
    slug: 'actions-qualtrics',
    mode: 'cloud',
    authentication: {
        scheme: 'custom',
        fields: {
            apiToken: {
                label: 'API Token',
                description: 'Qualtrics API token found in your Qualtrics account under "Account settings" -> "Qualtrics IDs."',
                type: 'password',
                required: true
            },
            datacenter: {
                label: 'Datacenter ID',
                description: 'Qualtrics datacenter id that identifies where your qualtrics instance is located. Found under "Account settings" -> "Qualtrics IDs".',
                type: 'string',
                required: true,
                default: 'iad1'
            }
        },
        testAuthentication: async (request, input) => {
            const apiClient = new qualtricsApiClient_1.default(input.settings.datacenter, input.settings.apiToken, request);
            const response = await apiClient.whoaAmI();
            return response.userName !== undefined;
        }
    },
    actions: {
        addContactToXmd: addContactToXmd_1.default,
        upsertContactTransaction: upsertContactTransaction_1.default,
        triggerXflowWorkflow: triggerXflowWorkflow_1.default
    }
};
exports.default = destination;
//# sourceMappingURL=index.js.map