"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sendRequest = void 0;
const prepareJSON = (payload) => {
    return {
        user_id: payload.user_id,
        timestamp: payload.timestamp,
        anonymous_id: payload.anonymous_id,
        traits: payload.traits
    };
};
const sendRequest = async (request, settings, payload) => {
    const json = payload.map(prepareJSON);
    return await request(`https://${settings.url}/identify_segment_users`, {
        method: 'post',
        headers: {
            'x-api-key': settings.apiKey
        },
        json
    });
};
exports.sendRequest = sendRequest;
//# sourceMappingURL=utils.js.map