UNPKG

@hubs101/js-api-skd-client

Version:
766 lines 65.7 kB
"use strict"; 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._fetchEventAttendeeActions = exports._fetchPublicEventGroups = exports._fetchEventGroups = exports._unpinExhibition = exports._pinExhibition = exports._unpinDocument = exports._pinDocument = exports._reportExhibitionAction = exports._deleteDocument = exports._updateDocument = exports._createExhibitionDocument = 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._deleteSpeakerRole = exports._updateSpeakerRole = 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._fetchTickets = exports._fetchAccounts = exports._fetchEventRegistrations = exports._fetchEventSpeakers = void 0; exports._sendOffer = exports._updateOffer = exports._fetchOfferDetails = exports._fetchOffers = exports._createOffer = exports._importOnboardingQuestions = exports._deleteExhibition = exports._bulkExhibitionsOrder = exports._updateExhibition = exports._importExhibition = exports._createExhibition = exports._fetchMyExhibitions = exports._fetchAllExhibitions = exports._deleteStream = exports._updateStream = exports._createStream = exports._fetchYoutubeContent = exports._fetchZoomContent = exports._createEvent = exports._unassignPaymentAccount = exports._assignPaymentAccount = exports._fetchEventOptions = exports._fetchEventTickets = exports._updateEvent = exports._deletePage = exports._updatePage = exports._createPage = exports._fetchEventPages = exports._updateAccountWithFiles = exports._fetchMySessions = exports._fetchEditableEvents = exports._fetchSpeakerById = exports._fetchSpeakers = exports._fetchAccountDetails = exports._eventInvitationRegistration = exports._createFreeTrialAccount = exports._fetchEventOrderedTickets = exports._confirmBooking = exports._fetchEventBookings = exports._acceptInternTicket = exports._acceptTicket = exports._postTicketDetails = exports._fetchTicketDetails = exports._assignTicket = exports._fetchAccountBookings = exports._fetchMyBookings = exports._createBooking = exports._checkBooking = exports._resendBookingEmail = exports._resendTicketEmail = void 0; exports._updateEventSpeakerAdverts = exports._updateEventFaqs = exports._updateEventTickets = exports._updateEventSurveys = exports._updateEventCitations = exports._updateEventTargetGroups = exports._fetchAccountProfiles = exports._fetchAccountDocuments = exports._deactivateDataManagers = exports._activateDataManagers = exports._fetchPublicEventAdvertisement = exports._importEventWebsiteContent = exports._importTickets = exports._updateKeyTopic = exports._createKeyTopic = exports._updateStatistic = exports._createStatistic = exports._updateTestimonial = exports._createTestimonial = exports._updateEventWebsite = exports._addMediaFolder = exports._deleteMediaDirectoryFiles = exports._deleteMediaDirectories = exports._renameFolder = exports._uploadFileToFolder = exports._fetchMediaFileDetails = exports._fetchMediaDirectoryFiles = exports._fetchMediaDirectories = exports._deletePortfolioBlogPage = exports._updatePortfolioBlogPage = exports._createBlogPage = exports._fetchBlogPages = exports._fetchBlogEventsBySlug = exports._fetchPortfolioEvents = exports._fetchBlogEvents = exports._fetchBlogDetails = exports._updateBlog = exports._createBlog = exports._unassignBlog = exports._assignBlog = exports._deleteBlog = exports._fetchBlogs = exports._fetchPortfolioDetails = exports._updatePortfolio = exports._createPortfolio = exports._unassignPortfolio = exports._assignPortfolio = exports._deletePortfolio = exports._fetchPortfolios = exports._approveOffer = void 0; exports._updateEventSessions = exports._updateEventOnsite = exports._updateEventExhibitions = void 0; const api_1 = require("../../utils/api"); const base_1 = require("../../utils/base"); const _fetchEventSpeakers = (basePath, token, eventId) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const { data: eventSpeakers } = yield (0, api_1.getRequest)(`${base.EVENTS}/${eventId}/speakers`, token); return eventSpeakers; }); exports._fetchEventSpeakers = _fetchEventSpeakers; 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 _fetchTickets = (basePath, token) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const data = yield (0, api_1.getRequest)(`${base.USERS}/tickets`, token); return data; }); exports._fetchTickets = _fetchTickets; 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 _a; const base = (0, base_1.getBasePath)(basePath); const eventDetails = yield (0, api_1.getRequest)(`${base.EVENTS}/${eventId}`, token); return ((_a = eventDetails === null || eventDetails === void 0 ? void 0 : eventDetails.data) === null || _a === void 0 ? void 0 : _a.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 _updateSpeakerRole = (basePath, token, attendeeId, data) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const response = yield (0, api_1.putRequest)(`${base.ATTENDEES}/${attendeeId}/speaker`, token, data); return response; }); exports._updateSpeakerRole = _updateSpeakerRole; const _deleteSpeakerRole = (basePath, token, attendeeId) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const response = yield (0, api_1.deleteRequestWE)(`${base.ATTENDEES}/${attendeeId}/speaker`, token); return response; }); exports._deleteSpeakerRole = _deleteSpeakerRole; 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.deleteRequest)(`${base.GROUPS}/${groupId}`, null, 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, false); 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 discounts = yield (0, api_1.getRequest)(`${base.EVENTS}/${eventId}/discounts?limit=2000`, 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 _a; const base = (0, base_1.getBasePath)(basePath); const exhibitionDetails = yield (0, api_1.getRequest)(`${base.EXHIBITIONS}/${exhibitionId}`, token); return (((_a = exhibitionDetails === null || exhibitionDetails === void 0 ? void 0 : exhibitionDetails.data) === null || _a === void 0 ? void 0 : _a.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, files) => __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, files !== null && files !== void 0 ? files : [], 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 _a; const base = (0, base_1.getBasePath)(basePath); const { data: eventLocations } = yield (0, api_1.getRequest)(`${base.EVENTS}/${eventId}/locations`, token); return ((_a = eventLocations === null || eventLocations === void 0 ? void 0 : eventLocations.data) === null || _a === void 0 ? void 0 : _a.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 _a; const base = (0, base_1.getBasePath)(basePath); const { data: userRegistrationsEvents } = yield (0, api_1.getRequest)(`${base.USERS}/registrations`, token); return (((_a = userRegistrationsEvents === null || userRegistrationsEvents === void 0 ? void 0 : userRegistrationsEvents.data) === null || _a === void 0 ? void 0 : _a.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 _a; const base = (0, base_1.getBasePath)(basePath); const { data: eventDocuments } = yield (0, api_1.getRequest)(`${base.EVENTS}/${eventId}/documents`, token); return ((_a = eventDocuments === null || eventDocuments === void 0 ? void 0 : eventDocuments.data) === null || _a === void 0 ? void 0 : _a.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 _createExhibitionDocument = (basePath, token, exhibitionId, 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.EXHIBITIONS}/${exhibitionId}/documents`, data, files, token); return response; }); exports._createExhibitionDocument = _createExhibitionDocument; const _updateDocument = (basePath, token, documentId, data) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const 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); const response = yield (0, api_1.postRequestWE)(`${base.ACTIONS_EXHIBITIONS}/${exhibitionId}`, requestData, token); return response; }); 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 _fetchPublicEventGroups = (basePath, 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.PUBLIC_EVENTS}/${eventId}/groups`); return groups; }); exports._fetchPublicEventGroups = _fetchPublicEventGroups; const _fetchEventAttendeeActions = (basePath, token, eventId) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const response = yield (0, api_1.getRequest)(`${base.ACTIONS_EVENTS}/${eventId}`, token); return response; }); exports._fetchEventAttendeeActions = _fetchEventAttendeeActions; const _resendTicketEmail = (basePath, token, ticketId) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const response = yield (0, api_1.getRequest)(`${base.TICKETS}/${ticketId}/resend-ticket-email`, token); return response; }); exports._resendTicketEmail = _resendTicketEmail; const _resendBookingEmail = (basePath, token, bookingId) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const response = yield (0, api_1.getRequest)(`${base.BOOKINGS}/${bookingId}/resend-booking-email`, token); return response; }); exports._resendBookingEmail = _resendBookingEmail; const _checkBooking = (basePath, body, lang) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const response = yield (0, api_1.postRequestJSON)(`${base.PUBLIC_BOOKINGS}/check?lang=${lang}`, body, null, { "Content-Type": "application/json" }); return response; }); exports._checkBooking = _checkBooking; const _createBooking = (basePath, body, lang) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const response = yield (0, api_1.postRequestJSON)(`${base.PUBLIC_BOOKINGS}?lang=${lang}`, body, null, { "Content-Type": "application/json" }); return response; }); exports._createBooking = _createBooking; const _fetchMyBookings = (basePath, token) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const response = yield (0, api_1.getRequest)(`${base.USERS}/bookings?limit=2000`, token); return response; }); exports._fetchMyBookings = _fetchMyBookings; const _fetchAccountBookings = (basePath, token, accountId, params) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const url = params ? `${base.ACCOUNTS}/${accountId}/bookings?limit=2000${params}` : `${base.ACCOUNTS}/${accountId}/bookings?limit=2000`; const response = yield (0, api_1.getRequest)(url, token); return response; }); exports._fetchAccountBookings = _fetchAccountBookings; const _assignTicket = (basePath, token, bookingId, ticketId, data) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const response = yield (0, api_1.postFilesAndDataRequest)(`${base.BOOKINGS}/${bookingId}/assign/${ticketId}`, data, [], token); return response; }); exports._assignTicket = _assignTicket; const _fetchTicketDetails = (basePath, eventId, profileId, access) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const data = yield (0, api_1.getRequest)(`${base.PUBLIC_INVITATIONS}/events/${eventId}/profiles/${profileId}/tickets?access=${access}`); return data; }); exports._fetchTicketDetails = _fetchTicketDetails; const _postTicketDetails = (basePath, eventId, profileId, access, body) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const data = yield (0, api_1.postRequestWE)(`${base.PUBLIC_INVITATIONS}/events/${eventId}/profiles/${profileId}/confirm?access=${access}`, body); return data; }); exports._postTicketDetails = _postTicketDetails; const _acceptTicket = (basePath, ticketId, access, body) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const response = yield (0, api_1.postRequestWE)(`${base.PUBLIC_INVITATIONS}/tickets/${ticketId}/accept?access=${access}`, body); return response; }); exports._acceptTicket = _acceptTicket; const _acceptInternTicket = (basePath, token, ticketId, body) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const response = yield (0, api_1.postRequestWE)(`${base.TICKETS}/${ticketId}/accept`, body, token); return response; }); exports._acceptInternTicket = _acceptInternTicket; 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=2000`, token); return bookings; }); exports._fetchEventBookings = _fetchEventBookings; const _confirmBooking = (basePath, token, bookingId) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); return yield (0, api_1.getRequest)(`${base.BOOKINGS}/${bookingId}/confirm`, token); }); exports._confirmBooking = _confirmBooking; const _fetchEventOrderedTickets = (basePath, token, eventId) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const orderedTickets = yield (0, api_1.getRequest)(`${base.EVENTS}/${eventId}/ordered-tickets?limit=2000`, token); return orderedTickets; }); exports._fetchEventOrderedTickets = _fetchEventOrderedTickets; 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 response = yield (0, api_1.getRequest)(url, token); return response; }); exports._fetchSpeakers = _fetchSpeakers; const _fetchSpeakerById = (basePath, eventId, id) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const response = yield (0, api_1.getRequest)(`${base.PUBLIC_EVENTS}/${eventId}/speakers/${id}`); return response; }); exports._fetchSpeakerById = _fetchSpeakerById; const _fetchEditableEvents = (basePath, token, url) => __awaiter(void 0, void 0, void 0, function* () { 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 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, nbPage, params) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const configUrl = () => { if (nbPage && params) return `${base.EVENTS}/${eventId}/pages?limit=2000&page=${nbPage}${params}`; else if (nbPage) return `${base.EVENTS}/${eventId}/pages?limit=2000&page=${nbPage}`; return `${base.EVENTS}/${eventId}/pages?limit=2000`; }; const eventPages = yield (0, api_1.getRequest)(configUrl(), token); return 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 _unassignPaymentAccount = (basePath, token, eventId, paymentAccountId) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); return yield (0, api_1.deleteRequestWE)(`${base.EVENTS}/${eventId}/payment-accounts/${paymentAccountId}`, token); }); exports._unassignPaymentAccount = _unassignPaymentAccount; 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, exhibitionsList) => __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`, { exhibitions_list: exhibitionsList, }, 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 _bulkExhibitionsOrder = (basePath, token, exhibitions) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const response = yield (0, api_1.postRequestJSON)(`${base.EXHIBITIONS}/bulk-order`, { exhibitions, }, token, { "Content-Type": "application/json" }); return (response === null || response === void 0 ? void 0 : response.data) || response; }); exports._bulkExhibitionsOrder = _bulkExhibitionsOrder; 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; const _importOnboardingQuestions = (basePath, token, eventId, eventSource, removeAnswers) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const body = Object.assign({ event_source: eventSource }, (removeAnswers !== undefined && { remove_answers: removeAnswers ? "1" : "0", })); const response = yield (0, api_1.postRequest)(`${base.EVENTS}/${eventId}/import/onboarding-questions`, body, token); return response; }); exports._importOnboardingQuestions = _importOnboardingQuestions; const _createOffer = (basePath_1, token_1, accountId_1, data_1, ...args_1) => __awaiter(void 0, [basePath_1, token_1, accountId_1, data_1, ...args_1], void 0, function* (basePath, token, accountId, data, files = []) { const base = (0, base_1.getBasePath)(basePath); // The endpoint expects multipart/form-data, so use postFilesAndDataRequest const { data: createdOffer } = yield (0, api_1.postFilesAndDataRequest)(`${base.ACCOUNTS}/${accountId}/offers`, data, files, token); return createdOffer; }); exports._createOffer = _createOffer; const _fetchOffers = (basePath, token, accountId, params) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const url = params ? `${base.ACCOUNTS}/${accountId}/offers?${params}` : `${base.ACCOUNTS}/${accountId}/offers`; const { data: offers } = yield (0, api_1.getRequest)(url, token); return (offers === null || offers === void 0 ? void 0 : offers.data) || offers; }); exports._fetchOffers = _fetchOffers; const _fetchOfferDetails = (basePath, token, accountId, offerId) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const { data: offerDetails } = yield (0, api_1.getRequest)(`${base.ACCOUNTS}/${accountId}/offers/${offerId}`, token); return (offerDetails === null || offerDetails === void 0 ? void 0 : offerDetails.data) || offerDetails; }); exports._fetchOfferDetails = _fetchOfferDetails; const _updateOffer = (basePath_1, token_1, accountId_1, offerId_1, data_1, ...args_1) => __awaiter(void 0, [basePath_1, token_1, accountId_1, offerId_1, data_1, ...args_1], void 0, function* (basePath, token, accountId, offerId, data, files = []) { const base = (0, base_1.getBasePath)(basePath); const { data: updatedOffer } = yield (0, api_1.postFilesAndDataRequest)(`${base.ACCOUNTS}/${accountId}/offers/${offerId}`, data, files, token, "put"); return updatedOffer; }); exports._updateOffer = _updateOffer; const _sendOffer = (basePath, token, accountId, offerId) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const { data: result } = yield (0, api_1.postRequest)(`${base.ACCOUNTS}/${accountId}/offers/${offerId}/send`, {}, token); return result; }); exports._sendOffer = _sendOffer; const _approveOffer = (basePath, token, accountId, offerId) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const response = yield (0, api_1.patchRequestDirect)(`${base.ACCOUNTS}/${accountId}/offers/${offerId}/approve`, token, {}); return (response === null || response === void 0 ? void 0 : response.data) || response; }); exports._approveOffer = _approveOffer; const _fetchPortfolios = (basePath, token, accountId) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const { data: accountPortfolios } = yield (0, api_1.getRequest)(`${base.ACCOUNTS}/${accountId}/portfolios`, token); return accountPortfolios; }); exports._fetchPortfolios = _fetchPortfolios; const _deletePortfolio = (basePath, token, portfolioId) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const response = yield (0, api_1.deleteRequestWE)(`${base.PORTFOLIOS}/${portfolioId}`, token); return response; }); exports._deletePortfolio = _deletePortfolio; const _assignPortfolio = (basePath, token, eventId, portfolioId) => __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}/portfolio`, { portfolio: portfolioId }, token); return response; }); exports._assignPortfolio = _assignPortfolio; const _unassignPortfolio = (basePath, token, eventId, portfolioId) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const response = yield (0, api_1.deleteRequestWE)(`${base.EVENTS}/${eventId}/portfolio/${portfolioId}`, token); return response; }); exports._unassignPortfolio = _unassignPortfolio; const _createPortfolio = (basePath, token, data, files) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const response = yield (0, api_1.postFilesAndDataRequest)(`${base.PORTFOLIOS}`, data, files, token); return response; }); exports._createPortfolio = _createPortfolio; const _updatePortfolio = (basePath, token, portfolioId, data, files) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const response = yield (0, api_1.postFilesAndDataRequest)(`${base.PORTFOLIOS}/${portfolioId}`, data, files, token, "put"); return response; }); exports._updatePortfolio = _updatePortfolio; const _fetchPortfolioDetails = (basePath, token, portfolioId) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const { data: portfolioDetails } = yield (0, api_1.getRequest)(`${base.PORTFOLIOS}/${portfolioId}`, token); return portfolioDetails; }); exports._fetchPortfolioDetails = _fetchPortfolioDetails; const _fetchBlogs = (basePath, token, accountId) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const { data: accountBlogs } = yield (0, api_1.getRequest)(`${base.ACCOUNTS}/${accountId}/blogs`, token); return accountBlogs; }); exports._fetchBlogs = _fetchBlogs; const _deleteBlog = (basePath, token, blogId) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const response = yield (0, api_1.deleteRequestWE)(`${base.BLOGS}/${blogId}`, token); return response; }); exports._deleteBlog = _deleteBlog; const _assignBlog = (basePath, token, eventId, blogId) => __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}/blog`, { blog: blogId }, token); return response; }); exports._assignBlog = _assignBlog; const _unassignBlog = (basePath, token, eventId, blogId) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const response = yield (0, api_1.deleteRequestWE)(`${base.EVENTS}/${eventId}/blog/${blogId}`, token); return response; }); exports._unassignBlog = _unassignBlog; const _createBlog = (basePath, token, data, files) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const response = yield (0, api_1.postFilesAndDataRequest)(`${base.BLOGS}`, data, files, token); return response; }); exports._createBlog = _createBlog; const _updateBlog = (basePath, token, blogId, data, files) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const response = yield (0, api_1.postFilesAndDataRequest)(`${base.BLOGS}/${blogId}`, data, files, token, "put"); return response; }); exports._updateBlog = _updateBlog; const _fetchBlogDetails = (basePath, token, blogId) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const { data: blogDetails } = yield (0, api_1.getRequest)(`${base.BLOGS}/${blogId}`, token); return blogDetails; }); exports._fetchBlogDetails = _fetchBlogDetails; const _fetchBlogEvents = (basePath, token, blogId) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const { data: blogEvents } = yield (0, api_1.getRequest)(`${base.BLOGS}/${blogId}/events`, token); return (blogEvents === null || blogEvents === void 0 ? void 0 : blogEvents.data) || blogEvents; }); exports._fetchBlogEvents = _fetchBlogEvents; const _fetchPortfolioEvents = (basePath, token, portfolioId) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const { data: portfolioEvents } = yield (0, api_1.getRequest)(`${base.PORTFOLIOS}/${portfolioId}/events`, token); return (portfolioEvents === null || portfolioEvents === void 0 ? void 0 : portfolioEvents.data) || portfolioEvents; }); exports._fetchPortfolioEvents = _fetchPortfolioEvents; const _fetchBlogEventsBySlug = (basePath, accountId, blogSlug) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const { data: blogEvents } = yield (0, api_1.getRequest)(`${base.PUBLIC_ACCOUNTS}/${accountId}/blogs/${blogSlug}/events`); return (blogEvents === null || blogEvents === void 0 ? void 0 : blogEvents.data) || blogEvents; }); exports._fetchBlogEventsBySlug = _fetchBlogEventsBySlug; const _fetchBlogPages = (basePath, token, accountId, portfolioId) => __awaiter(void 0, void 0, void 0, function* () { const base = (0, base_1.getBasePath)(basePath); const { data: portfolioPages } = yield (0, api_1.getRequest)(portfolioId ? `${base.ACCOUNTS}/${accountId}/pages?portfolio=${portfolioId}` : `${base.ACCOUNTS}/${accountId}/pages`, token); return (portfolioPages === null || portfolioPages === void 0 ? void 0 : portfolioPages.data) || portfolioPages; }); exports._fetchBlogPages = _fetchBlogPages; const _createBlogPage = (basePath, token, portfolioId, data, files) => __awaiter(void 0, void 0, void 0, function* () { c