"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sendRequest = void 0;
const prepareJSON = (payload) => ({
    type: 'group',
    messageId: payload.messageId,
    groupId: payload.groupId,
    userId: payload.userId,
    traits: payload.traits,
    timestamp: payload.timestamp,
    context: payload.context
});
const sendRequest = async (request, settings, payload) => {
    return request(`${settings.apiEndpoint}/v1/batch`, {
        method: 'post',
        json: { batch: payload.map(prepareJSON) }
    });
};
exports.sendRequest = sendRequest;
//# sourceMappingURL=utils.js.map