"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const upsertProfile_1 = __importDefault(require("./upsertProfile"));
const versioning_info_1 = require("./versioning-info");
const constants_1 = require("./constants");
const destination = {
    name: 'Memora',
    slug: 'actions-memora',
    mode: 'cloud',
    authentication: {
        scheme: 'basic',
        fields: {
            username: {
                label: 'API Key',
                description: 'Your Twilio API Key. You can find this in your [Twilio Console](https://console.twilio.com/) under Account > API Keys & Tokens.',
                type: 'string',
                required: true
            },
            password: {
                label: 'API Secret',
                description: 'Your Twilio API Secret. This is provided when you create an API Key in your [Twilio Console](https://console.twilio.com/) under Account > API Keys & Tokens.',
                type: 'password',
                required: true
            },
            twilioAccount: {
                label: 'Twilio Account ID',
                description: 'Your Twilio Account ID. This can be found at the top of your [Twilio Console Dashboard](https://console.twilio.com/).',
                type: 'string',
                required: true
            }
        },
        testAuthentication: (request, { settings }) => {
            return request(`${constants_1.BASE_URL}/${versioning_info_1.API_VERSION}/ControlPlane/Stores?pageSize=1`, {
                method: 'GET',
                username: settings.username,
                password: settings.password,
                headers: {
                    'X-Pre-Auth-Context': settings.twilioAccount
                }
            });
        }
    },
    actions: {
        upsertProfile: upsertProfile_1.default
    }
};
exports.default = destination;
//# sourceMappingURL=index.js.map