event-app-api
Version:
Package for easy access to Event App API
459 lines (458 loc) • 29.1 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports._fetchMySessions = exports._fetchEditableEvents = exports._fetchSpeakers = exports._fetchAccountDetails = exports._eventInvitationRegistration = exports._createFreeTrialAccount = exports._fetchEventBookings = exports._fetchEventGroups = exports._unpinExhibition = exports._pinExhibition = exports._unpinDocument = exports._pinDocument = exports._reportExhibitionAction = exports._deleteDocument = exports._updateDocument = exports._createDocument = exports._assignDocumentToEvent = exports._fetchEventDocuments = exports._fetchUserRegistrationsEvents = exports._fetchEventStreams = exports._fetchEventLocations = exports._deleteLocation = exports._updateLocation = exports._createLocation = exports._fetchExhibitionDetails = exports._deleteDiscount = exports._updateDiscount = exports._createDiscount = exports._fetchEventDiscounts = exports._deleteTicket = exports._updateTicket = exports._createTicket = exports._deleteOption = exports._updateOption = exports._createOption = exports._deleteGroup = exports._updateGroup = exports._createGroup = exports._importAgenda = exports._fetchAttendeesAvailabilities = exports._updateEventTemplates = exports._fetchEventTemplates = exports._fetchEventNotifications = exports._sendSingleNotification = exports._sendNotification = exports._fetchEventDetails = exports._fetchExhibitions = exports._fetchEventsForAccount = exports._fetchAccounts = exports._fetchEventRegistrations = void 0;
exports._deleteExhibition = exports._updateExhibition = exports._importExhibition = exports._createExhibition = exports._fetchMyExhibitions = exports._fetchAllExhibitions = exports._deleteStream = exports._updateStream = exports._createStream = exports._fetchYoutubeContent = exports._fetchZoomContent = exports._createEvent = exports._assignPaymentAccount = exports._fetchEventOptions = exports._fetchEventTickets = exports._updateEvent = exports._deletePage = exports._updatePage = exports._createPage = exports._fetchEventPages = exports._updateAccountWithFiles = void 0;
const api_1 = require("../../utils/api");
const base_1 = require("../../utils/base");
const _fetchEventRegistrations = (basePath, token, eventId) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const { data: eventRegistrations } = yield (0, api_1.getRequest)(`${base.EVENTS}/${eventId}/registrations`, token);
return eventRegistrations;
});
exports._fetchEventRegistrations = _fetchEventRegistrations;
const _fetchAccounts = (basePath, token) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const { data: eventRegistrations } = yield (0, api_1.getRequest)(`${base.USERS}/accounts`, token);
return eventRegistrations;
});
exports._fetchAccounts = _fetchAccounts;
const _fetchEventsForAccount = (basePath, token, accountId) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const { data: eventRegistrations } = yield (0, api_1.getRequest)(`${base.ACCOUNTS}/${accountId}/events`, token);
return eventRegistrations;
});
exports._fetchEventsForAccount = _fetchEventsForAccount;
const _fetchExhibitions = (basePath, token, eventId) => __awaiter(void 0, void 0, void 0, function* () {
var _a;
const base = (0, base_1.getBasePath)(basePath);
const { data: exhibitions } = yield (0, api_1.getRequest)(`${base.EVENTS}/${eventId}/exhibitions`, token);
return ((_a = exhibitions === null || exhibitions === void 0 ? void 0 : exhibitions.data) === null || _a === void 0 ? void 0 : _a.data) || (exhibitions === null || exhibitions === void 0 ? void 0 : exhibitions.data) || exhibitions;
});
exports._fetchExhibitions = _fetchExhibitions;
const _fetchEventDetails = (basePath, token, eventId) => __awaiter(void 0, void 0, void 0, function* () {
var _b;
const base = (0, base_1.getBasePath)(basePath);
const eventDetails = yield (0, api_1.getRequest)(`${base.EVENTS}/${eventId}`, token);
return ((_b = eventDetails === null || eventDetails === void 0 ? void 0 : eventDetails.data) === null || _b === void 0 ? void 0 : _b.data) || (eventDetails === null || eventDetails === void 0 ? void 0 : eventDetails.data) || eventDetails;
});
exports._fetchEventDetails = _fetchEventDetails;
const _sendNotification = (basePath, token, eventId, message, date, url) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.postRequestWE)(`${base.NOTIFICATIONS}/message`, { date, message, url, event: eventId }, token);
return response;
});
exports._sendNotification = _sendNotification;
const _sendSingleNotification = (basePath, token, attendeeId, message, date, url) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.postRequestWE)(`${base.ATTENDEES}/${attendeeId}/message`, { date, message, url }, token);
return response;
});
exports._sendSingleNotification = _sendSingleNotification;
const _fetchEventNotifications = (basePath, token, eventId) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const { data: notifications } = yield (0, api_1.getRequest)(`${base.EVENTS}/${eventId}/notifications`, token);
return notifications;
});
exports._fetchEventNotifications = _fetchEventNotifications;
const _fetchEventTemplates = (basePath, token, eventId) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const { data: templates } = yield (0, api_1.getRequest)(`${base.EVENTS}/${eventId}/templates`, token);
return templates;
});
exports._fetchEventTemplates = _fetchEventTemplates;
const _updateEventTemplates = (basePath, token, templateId, eventId, data) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.putRequest)(`${base.EVENTS}/${eventId}/forms/${templateId}`, token, data);
return response === null || response === void 0 ? void 0 : response.result;
});
exports._updateEventTemplates = _updateEventTemplates;
const _fetchAttendeesAvailabilities = (basePath, token, eventId, date) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.getRequest)(`${base.EVENTS}/${eventId}/attendees/availability?date=${date}`, token);
return response;
});
exports._fetchAttendeesAvailabilities = _fetchAttendeesAvailabilities;
const _importAgenda = (basePath, token, eventId, eventSource) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.postRequestWE)(`${base.EVENTS}/${eventId}/import/agenda`, { event_source: eventSource }, token);
return response;
});
exports._importAgenda = _importAgenda;
const _createGroup = (basePath, token, data) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.postRequestWE)(base.GROUPS, data, token);
return response;
});
exports._createGroup = _createGroup;
const _updateGroup = (basePath, token, groupId, data) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.putRequest)(`${base.GROUPS}/${groupId}`, token, data);
return response;
});
exports._updateGroup = _updateGroup;
const _deleteGroup = (basePath, token, groupId) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.deleteRequestWE)(`${base.GROUPS}/${groupId}`, token);
return response;
});
exports._deleteGroup = _deleteGroup;
const _createOption = (basePath, token, data) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.postRequestWE)(base.OPTIONS, data, token);
return response;
});
exports._createOption = _createOption;
const _updateOption = (basePath, token, optionId, data) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.putRequest)(`${base.OPTIONS}/${optionId}`, token, data);
return response;
});
exports._updateOption = _updateOption;
const _deleteOption = (basePath, token, optionId) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.deleteRequestWE)(`${base.OPTIONS}/${optionId}`, token);
return response;
});
exports._deleteOption = _deleteOption;
const _createTicket = (basePath, token, data) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.postRequestWE)(base.TICKETS, data, token);
return response;
});
exports._createTicket = _createTicket;
const _updateTicket = (basePath, token, ticketId, data) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.putRequest)(`${base.TICKETS}/${ticketId}`, token, data);
return response;
});
exports._updateTicket = _updateTicket;
const _deleteTicket = (basePath, token, ticketId) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.deleteRequestWE)(`${base.TICKETS}/${ticketId}`, token);
return response;
});
exports._deleteTicket = _deleteTicket;
const _fetchEventDiscounts = (basePath, token, eventId) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const { data: discounts } = yield (0, api_1.getRequest)(`${base.EVENTS}/${eventId}/discounts`, token);
return discounts;
});
exports._fetchEventDiscounts = _fetchEventDiscounts;
const _createDiscount = (basePath, token, data) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.postRequestWE)(base.DISCOUNTS, data, token);
return response;
});
exports._createDiscount = _createDiscount;
const _updateDiscount = (basePath, token, discountId, data) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.putRequest)(`${base.DISCOUNTS}/${discountId}`, token, data);
return response;
});
exports._updateDiscount = _updateDiscount;
const _deleteDiscount = (basePath, token, discountId) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.deleteRequestWE)(`${base.DISCOUNTS}/${discountId}`, token);
return response;
});
exports._deleteDiscount = _deleteDiscount;
const _fetchExhibitionDetails = (basePath, token, exhibitionId) => __awaiter(void 0, void 0, void 0, function* () {
var _c;
const base = (0, base_1.getBasePath)(basePath);
const exhibitionDetails = yield (0, api_1.getRequest)(`${base.EXHIBITIONS}/${exhibitionId}`, token);
return (((_c = exhibitionDetails === null || exhibitionDetails === void 0 ? void 0 : exhibitionDetails.data) === null || _c === void 0 ? void 0 : _c.data) ||
(exhibitionDetails === null || exhibitionDetails === void 0 ? void 0 : exhibitionDetails.data) ||
exhibitionDetails);
});
exports._fetchExhibitionDetails = _fetchExhibitionDetails;
const _createLocation = (basePath, token, files, data) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.postFilesAndDataRequest)(base.LOCATIONS, data, files, token);
return response;
});
exports._createLocation = _createLocation;
const _updateLocation = (basePath, token, locationId, data) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.postFilesAndDataRequest)(`${base.LOCATIONS}/${locationId}`, data, [], token, "put");
return response;
});
exports._updateLocation = _updateLocation;
const _deleteLocation = (basePath, token, locationId) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.deleteRequestWE)(`${base.LOCATIONS}/${locationId}`, token);
return response;
});
exports._deleteLocation = _deleteLocation;
const _fetchEventLocations = (basePath, token, eventId) => __awaiter(void 0, void 0, void 0, function* () {
var _d;
const base = (0, base_1.getBasePath)(basePath);
const { data: eventLocations } = yield (0, api_1.getRequest)(`${base.EVENTS}/${eventId}/locations`, token);
return ((_d = eventLocations === null || eventLocations === void 0 ? void 0 : eventLocations.data) === null || _d === void 0 ? void 0 : _d.data) || (eventLocations === null || eventLocations === void 0 ? void 0 : eventLocations.data) || eventLocations;
});
exports._fetchEventLocations = _fetchEventLocations;
const _fetchEventStreams = (basePath, token, eventId) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const { data: eventStreams } = yield (0, api_1.getRequest)(`${base.EVENTS}/${eventId}/streams`, token);
return (eventStreams === null || eventStreams === void 0 ? void 0 : eventStreams.data) || eventStreams;
});
exports._fetchEventStreams = _fetchEventStreams;
const _fetchUserRegistrationsEvents = (basePath, token) => __awaiter(void 0, void 0, void 0, function* () {
var _e;
const base = (0, base_1.getBasePath)(basePath);
const { data: userRegistrationsEvents } = yield (0, api_1.getRequest)(`${base.USERS}/registrations`, token);
return (((_e = userRegistrationsEvents === null || userRegistrationsEvents === void 0 ? void 0 : userRegistrationsEvents.data) === null || _e === void 0 ? void 0 : _e.data) ||
(userRegistrationsEvents === null || userRegistrationsEvents === void 0 ? void 0 : userRegistrationsEvents.data) ||
userRegistrationsEvents);
});
exports._fetchUserRegistrationsEvents = _fetchUserRegistrationsEvents;
const _fetchEventDocuments = (basePath, token, eventId) => __awaiter(void 0, void 0, void 0, function* () {
var _f;
const base = (0, base_1.getBasePath)(basePath);
const { data: eventDocuments } = yield (0, api_1.getRequest)(`${base.EVENTS}/${eventId}/documents`, token);
return ((_f = eventDocuments === null || eventDocuments === void 0 ? void 0 : eventDocuments.data) === null || _f === void 0 ? void 0 : _f.data) || (eventDocuments === null || eventDocuments === void 0 ? void 0 : eventDocuments.data) || eventDocuments;
});
exports._fetchEventDocuments = _fetchEventDocuments;
const _assignDocumentToEvent = (basePath, token, eventId, documentId) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const { data: response } = yield (0, api_1.getRequest)(`${base.EVENTS}/${eventId}/documents/${documentId}/link`, token);
return response;
});
exports._assignDocumentToEvent = _assignDocumentToEvent;
const _createDocument = (basePath, token, files, data) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const { data: response } = yield (0, api_1.postFilesAndDataRequest)(base.DOCUMENTS, data, files, token);
return response;
});
exports._createDocument = _createDocument;
const _updateDocument = (basePath, token, documentId, data) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const { data: response } = yield (0, api_1.postFilesAndDataRequest)(`${base.DOCUMENTS}/${documentId}`, data, [], token, "put");
return response;
});
exports._updateDocument = _updateDocument;
const _deleteDocument = (basePath, token, documentId) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.deleteRequestWE)(`${base.DOCUMENTS}/${documentId}`, token);
return response;
});
exports._deleteDocument = _deleteDocument;
const _reportExhibitionAction = (basePath, token, exhibitionId, requestData) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
void (0, api_1.postRequestWE)(`${base.ACTIONS_EXHIBITIONS}/${exhibitionId}`, requestData, token);
});
exports._reportExhibitionAction = _reportExhibitionAction;
const _pinDocument = (basePath, token, eventId, documentId) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const requestData = {
event: eventId,
};
yield (0, api_1.postRequestWE)(`${base.DOCUMENTS}/${documentId}/pin`, requestData, token);
return true;
});
exports._pinDocument = _pinDocument;
const _unpinDocument = (basePath, token, eventId, documentId) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const requestData = {
event: eventId,
};
yield (0, api_1.postRequestWE)(`${base.DOCUMENTS}/${documentId}/unpin`, requestData, token);
return true;
});
exports._unpinDocument = _unpinDocument;
const _pinExhibition = (basePath, token, exhibitionId) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
yield (0, api_1.getRequest)(`${base.EXHIBITIONS}/${exhibitionId}/pin`, token);
return true;
});
exports._pinExhibition = _pinExhibition;
const _unpinExhibition = (basePath, token, exhibitionId) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
yield (0, api_1.getRequest)(`${base.EXHIBITIONS}/${exhibitionId}/unpin`, token);
return true;
});
exports._unpinExhibition = _unpinExhibition;
const _fetchEventGroups = (basePath, token, eventId) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const { data: groups } = yield (0, api_1.getRequest)(`${base.EVENTS}/${eventId}/groups`, token);
return groups;
});
exports._fetchEventGroups = _fetchEventGroups;
const _fetchEventBookings = (basePath, token, eventId) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const bookings = yield (0, api_1.getRequest)(`${base.EVENTS}/${eventId}/bookings?limit=1000`, token);
return bookings;
});
exports._fetchEventBookings = _fetchEventBookings;
const _createFreeTrialAccount = (basePath, token, data) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.postRequestWE)(base.ACCOUNT_TRIAL, data, token);
return response;
});
exports._createFreeTrialAccount = _createFreeTrialAccount;
const _eventInvitationRegistration = (basePath, token, userId, data) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.postRequestWE)(`${base.INVITATION}/${userId}`, data);
return response;
});
exports._eventInvitationRegistration = _eventInvitationRegistration;
const _fetchAccountDetails = (basePath, token, accountId) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.getRequest)(`${base.ACCOUNTS}/${accountId}`, token);
return response;
});
exports._fetchAccountDetails = _fetchAccountDetails;
const _fetchSpeakers = (basePath, token, url) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.getRequest)(url, token);
return response;
});
exports._fetchSpeakers = _fetchSpeakers;
const _fetchEditableEvents = (basePath, token, url) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.getRequest)(url, token);
return response;
});
exports._fetchEditableEvents = _fetchEditableEvents;
const _fetchMySessions = (basePath, token, url) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.getRequest)(url, token);
return response;
});
exports._fetchMySessions = _fetchMySessions;
const _updateAccountWithFiles = (basePath, token, accountId, updatedMyAccount, files) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.postFilesAndDataRequest)(`${base.ACCOUNTS}/${accountId}`, Object.assign({}, updatedMyAccount), files, token, "put");
return response;
});
exports._updateAccountWithFiles = _updateAccountWithFiles;
const _fetchEventPages = (basePath, token, eventId) => __awaiter(void 0, void 0, void 0, function* () {
var _g;
const base = (0, base_1.getBasePath)(basePath);
const { data: eventPages } = yield (0, api_1.getRequest)(`${base.EVENTS}/${eventId}/pages`, token);
return ((_g = eventPages === null || eventPages === void 0 ? void 0 : eventPages.data) === null || _g === void 0 ? void 0 : _g.data) || (eventPages === null || eventPages === void 0 ? void 0 : eventPages.data) || eventPages;
});
exports._fetchEventPages = _fetchEventPages;
const _createPage = (basePath, token, data) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const { data: response } = yield (0, api_1.postFilesAndDataRequest)(base.PAGES, data, [], token);
return response;
});
exports._createPage = _createPage;
const _updatePage = (basePath, token, pageId, data) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const { data: response } = yield (0, api_1.postFilesAndDataRequest)(`${base.PAGES}/${pageId}`, data, [], token, "put");
return response;
});
exports._updatePage = _updatePage;
const _deletePage = (basePath, token, eventId, pageId) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const { data: response } = yield (0, api_1.deleteRequestWE)(`${base.EVENTS}/${eventId}/pages/${pageId}`, token);
return response;
});
exports._deletePage = _deletePage;
const _updateEvent = (basePath, token, eventId, data, files) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const { data: result } = yield (0, api_1.postFilesAndDataRequest)(`${base.EVENTS}/${eventId}`, data, files, token, "put");
return result;
});
exports._updateEvent = _updateEvent;
const _fetchEventTickets = (basePath, token, eventId) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const { data: tickets } = yield (0, api_1.getRequest)(`${base.EVENTS}/${eventId}/tickets`, token);
return tickets;
});
exports._fetchEventTickets = _fetchEventTickets;
const _fetchEventOptions = (basePath, token, eventId) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const { data: options } = yield (0, api_1.getRequest)(`${base.EVENTS}/${eventId}/options`, token);
return options;
});
exports._fetchEventOptions = _fetchEventOptions;
const _assignPaymentAccount = (basePath, token, eventId, requestData) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
return yield (0, api_1.postRequestWE)(`${base.EVENTS}/${eventId}/payment-accounts`, requestData, token);
});
exports._assignPaymentAccount = _assignPaymentAccount;
const _createEvent = (basePath, token, data, files) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const { data: createdEvent } = yield (0, api_1.postFilesAndDataRequest)(base.EVENTS, data, files, token);
return createdEvent;
});
exports._createEvent = _createEvent;
const _fetchZoomContent = (basePath, token, body) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const zoomContent = yield (0, api_1.postRequestWithRetry)(base.ZOOM.CLIENT, body, token, {}, 5);
return zoomContent;
});
exports._fetchZoomContent = _fetchZoomContent;
const _fetchYoutubeContent = (basePath, token, reference) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const youtubeContent = yield (0, api_1.getRequestSimple)(`${base.YOUTUBE}/${reference}`, token);
return youtubeContent;
});
exports._fetchYoutubeContent = _fetchYoutubeContent;
const _createStream = (basePath, token, data) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const result = yield (0, api_1.postFilesAndDataRequest)(base.STREAMS, data, [], token);
return (result === null || result === void 0 ? void 0 : result.data) || result;
});
exports._createStream = _createStream;
const _updateStream = (basePath, token, streamId, data) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const result = yield (0, api_1.postFilesAndDataRequest)(`${base.STREAMS}/${streamId}`, data, [], token, "put");
return result;
});
exports._updateStream = _updateStream;
const _deleteStream = (basePath, token, streamId) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const result = yield (0, api_1.deleteRequest)(`${base.STREAMS}/${streamId}`, {}, token);
return result;
});
exports._deleteStream = _deleteStream;
const _fetchAllExhibitions = (basePath, token, eventId) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const exhibitions = yield (0, api_1.getRequest)(`${base.EVENTS}/${eventId}/exhibitions?not_published=1`, token);
return (exhibitions === null || exhibitions === void 0 ? void 0 : exhibitions.data) || exhibitions;
});
exports._fetchAllExhibitions = _fetchAllExhibitions;
const _fetchMyExhibitions = (basePath, token) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const myExhibitions = yield (0, api_1.getRequest)(`${base.USERS}/exhibitions`, token);
return (myExhibitions === null || myExhibitions === void 0 ? void 0 : myExhibitions.data) || myExhibitions;
});
exports._fetchMyExhibitions = _fetchMyExhibitions;
const _createExhibition = (basePath, token, files, data) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const exhibition = yield (0, api_1.postFilesAndDataRequest)(base.EXHIBITIONS, data, files, token);
return (exhibition === null || exhibition === void 0 ? void 0 : exhibition.data) || exhibition;
});
exports._createExhibition = _createExhibition;
const _importExhibition = (basePath, token, eventId, eventSource) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const response = yield (0, api_1.postRequest)(`${base.EVENTS}/${eventId}/import/exhibitions`, {
event_source: eventSource,
}, token);
return response;
});
exports._importExhibition = _importExhibition;
const _updateExhibition = (basePath, token, exhibitionId, files, data) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const exhibition = yield (0, api_1.postFilesAndDataRequest)(`${base.EXHIBITIONS}/${exhibitionId}`, data, files, token, "put");
return exhibition;
});
exports._updateExhibition = _updateExhibition;
const _deleteExhibition = (basePath, token, exhibitionId) => __awaiter(void 0, void 0, void 0, function* () {
const base = (0, base_1.getBasePath)(basePath);
const result = yield (0, api_1.deleteRequest)(`${base.EXHIBITIONS}/${exhibitionId}`, {}, token);
return result;
});
exports._deleteExhibition = _deleteExhibition;