"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 destination = {
    name: 'Memora',
    slug: 'actions-memora',
    mode: 'cloud',
    authentication: {
        scheme: 'basic',
        fields: {
            username: {
                label: 'API Key',
                description: 'API Key for Basic Authentication',
                type: 'string',
                required: true
            },
            password: {
                label: 'API Secret',
                description: 'API Secret for Basic Authentication',
                type: 'password',
                required: true
            },
            twilioAccount: {
                label: 'Twilio Account ID',
                description: 'Twilio Account ID for X-Pre-Auth-Context header (optional)',
                type: 'string',
                required: false
            }
        },
        testAuthentication: (request, { settings }) => {
            return request(`${versioning_info_1.BASE_URL}/${versioning_info_1.API_VERSION}/ControlPlane/Stores?pageSize=1`, {
                method: 'GET',
                username: settings.username,
                password: settings.password,
                headers: {
                    ...(settings.twilioAccount && { 'X-Pre-Auth-Context': settings.twilioAccount })
                }
            });
        }
    },
    actions: {
        upsertProfile: upsertProfile_1.default
    }
};
exports.default = destination;
//# sourceMappingURL=index.js.map