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