"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getEventUrl = exports.getAuthUrl = void 0;
exports.perform = perform;
exports.performBatch = performBatch;
const getAuthUrl = () => `https://events.canvasapp.com/v1/auth`;
exports.getAuthUrl = getAuthUrl;
const getEventUrl = (eventType) => `https://events.canvasapp.com/v1/event/${eventType}`;
exports.getEventUrl = getEventUrl;
function perform(eventType) {
    return (request, data) => {
        return request((0, exports.getEventUrl)(eventType), {
            method: 'post',
            json: [data.payload],
            headers: { 'X-Auth-Token': data.settings.apiToken }
        });
    };
}
function performBatch(eventType) {
    return (request, data) => {
        return request((0, exports.getEventUrl)(eventType), {
            method: 'post',
            json: data.payload,
            headers: { 'X-Auth-Token': data.settings.apiToken }
        });
    };
}
//# sourceMappingURL=api.js.map