kashti-sdk
Version:
This npm package holds the code to support interactions between Kashti and Brigade
31 lines • 1.27 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EventsClient = void 0;
const rest_machinery_service_1 = require("../rest-machinery/rest-machinery-service");
const apiVersion = require('../../package.json').apiVersion;
class EventsClient {
constructor(baseUrl, authToken) {
this.setAuthToken = (newAuthToken) => {
this.rms.setAuthToken(newAuthToken);
};
this.getEvents = (callback) => {
this.rms.sendRequest('GET', '/v2/events', callback);
};
this.getEvent = (eventId, callback) => {
this.rms.sendRequest('GET', `/v2/events/${eventId}`, callback);
};
this.createEvent = (projectId, source, type, worker, eventId, callback) => {
this.rms.sendRequest('POST', '/v2/events', callback, undefined, {
projectID: projectId,
apiVersion: apiVersion,
kind: 'Event',
metadata: {},
source: source,
type: type
});
};
this.rms = new rest_machinery_service_1.RestMachineryService(baseUrl, authToken);
}
}
exports.EventsClient = EventsClient;
//# sourceMappingURL=events-client.js.map