@hubs101/js-api-skd-client 1.0.10556 → 1.0.10558
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/event/index.d.ts +11 -1
- package/lib/api/event/index.js +27 -2
- package/lib/api/event/types.d.ts +51 -0
- package/lib/index.js +24 -0
- package/lib/types/base.d.ts +9 -1
- package/package.json +1 -1
package/lib/api/event/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GenericResponseServerType, PublicAdResponse, ResponsePaginationType, ResponseServerType } from "../public/types";
|
|
2
2
|
import { ExhibitionReport, FetchCurrentEventAttendeesActionsResponse } from "../types";
|
|
3
|
-
import { Account, AccountInput, BlogPage, BlogPageInput, Booking, BookingDetails, Directory, DirectoryFiles, DiscountServerResponse, DocumentType, Event, EventLocation, EventRegistration, EventServerResponse, EventStream, Exhibition, ExhibitionInput, FileDetails, GroupServerResponse, OptionServerResponse, Portfolio, PortfolioInput, Stream, StreamInput, TicketServerResponse, UserRegistrationsEvent, ZoomParams } from "./types";
|
|
3
|
+
import { Account, AccountInput, BlogPage, BlogPageInput, Booking, BookingDetails, Directory, DirectoryFiles, DiscountServerResponse, DocumentType, Event, EventLocation, EventRegistration, EventServerResponse, EventStream, Exhibition, ExhibitionInput, FileDetails, GroupServerResponse, OptionServerResponse, Portfolio, PortfolioInput, Stream, StreamInput, TicketServerResponse, UserRegistrationsEvent, ZoomParams, CreateOfferInput, OfferServerResponse } from "./types";
|
|
4
4
|
import { APIResponse } from "../../types/base";
|
|
5
5
|
import { Attendee } from "../attendee/types";
|
|
6
6
|
import { Page } from "../pages/types";
|
|
@@ -103,6 +103,16 @@ export declare const _createExhibition: (basePath: string, token: string, files:
|
|
|
103
103
|
export declare const _importExhibition: (basePath: string, token: string, eventId: string, eventSource: string) => Promise<APIResponse>;
|
|
104
104
|
export declare const _updateExhibition: (basePath: string, token: string, exhibitionId: string, files: any, data: ExhibitionInput) => Promise<Exhibition>;
|
|
105
105
|
export declare const _deleteExhibition: (basePath: string, token: string, exhibitionId: string) => Promise<APIResponse>;
|
|
106
|
+
export declare const _createOffer: (basePath: string, token: string, accountId: string, data: CreateOfferInput, files?: {
|
|
107
|
+
name: string;
|
|
108
|
+
value: File;
|
|
109
|
+
}[]) => Promise<OfferServerResponse>;
|
|
110
|
+
export declare const _fetchOffers: (basePath: string, token: string, accountId: string) => Promise<OfferServerResponse[]>;
|
|
111
|
+
export declare const _fetchOfferDetails: (basePath: string, token: string, accountId: string, offerId: string) => Promise<OfferServerResponse>;
|
|
112
|
+
export declare const _updateOffer: (basePath: string, token: string, accountId: string, offerId: string, data: CreateOfferInput, files?: {
|
|
113
|
+
name: string;
|
|
114
|
+
value: File;
|
|
115
|
+
}[]) => Promise<OfferServerResponse>;
|
|
106
116
|
export declare const _fetchPortfolios: (basePath: string, token: string, accountId: string) => Promise<Portfolio[]>;
|
|
107
117
|
export declare const _deletePortfolio: (basePath: string, token: string, portfolioId: string) => Promise<any>;
|
|
108
118
|
export declare const _assignPortfolio: (basePath: string, token: string, eventId: string, portfolioId: string) => Promise<any>;
|
package/lib/api/event/index.js
CHANGED
|
@@ -10,8 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports._resendTicketEmail = 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 = void 0;
|
|
13
|
-
exports.
|
|
14
|
-
exports._fetchAccountDocuments = exports._deactivateDataManagers = exports._activateDataManagers = exports._fetchPublicEventAdvertisement = exports._importTickets = exports._updateEventWebsite = exports._addMediaFolder = exports._deleteMediaDirectoryFiles = exports._deleteMediaDirectories = exports._renameFolder = exports._uploadImageToFolder = exports._fetchMediaFileDetails = exports._fetchMediaDirectoryFiles = exports._fetchMediaDirectories = exports._deletePortfolioBlogPage = exports._updatePortfolioBlogPage = exports._createBlogPage = exports._fetchBlogPages = void 0;
|
|
13
|
+
exports._unassignPortfolio = exports._assignPortfolio = exports._deletePortfolio = exports._fetchPortfolios = exports._updateOffer = exports._fetchOfferDetails = exports._fetchOffers = exports._createOffer = 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._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 = void 0;
|
|
14
|
+
exports._fetchAccountDocuments = exports._deactivateDataManagers = exports._activateDataManagers = exports._fetchPublicEventAdvertisement = exports._importTickets = exports._updateEventWebsite = exports._addMediaFolder = exports._deleteMediaDirectoryFiles = exports._deleteMediaDirectories = exports._renameFolder = exports._uploadImageToFolder = exports._fetchMediaFileDetails = exports._fetchMediaDirectoryFiles = exports._fetchMediaDirectories = exports._deletePortfolioBlogPage = exports._updatePortfolioBlogPage = exports._createBlogPage = exports._fetchBlogPages = exports._fetchPortfolioEvents = exports._fetchPortfolioDetails = exports._updatePortfolio = exports._createPortfolio = void 0;
|
|
15
15
|
const api_1 = require("../../utils/api");
|
|
16
16
|
const base_1 = require("../../utils/base");
|
|
17
17
|
const _fetchEventRegistrations = (basePath, token, eventId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -588,6 +588,31 @@ const _deleteExhibition = (basePath, token, exhibitionId) => __awaiter(void 0, v
|
|
|
588
588
|
return result;
|
|
589
589
|
});
|
|
590
590
|
exports._deleteExhibition = _deleteExhibition;
|
|
591
|
+
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 = []) {
|
|
592
|
+
const base = (0, base_1.getBasePath)(basePath);
|
|
593
|
+
// The endpoint expects multipart/form-data, so use postFilesAndDataRequest
|
|
594
|
+
const { data: createdOffer } = yield (0, api_1.postFilesAndDataRequest)(`${base.ACCOUNTS}/${accountId}/offers`, data, files, token);
|
|
595
|
+
return createdOffer;
|
|
596
|
+
});
|
|
597
|
+
exports._createOffer = _createOffer;
|
|
598
|
+
const _fetchOffers = (basePath, token, accountId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
599
|
+
const base = (0, base_1.getBasePath)(basePath);
|
|
600
|
+
const { data: offers } = yield (0, api_1.getRequest)(`${base.ACCOUNTS}/${accountId}/offers`, token);
|
|
601
|
+
return (offers === null || offers === void 0 ? void 0 : offers.data) || offers;
|
|
602
|
+
});
|
|
603
|
+
exports._fetchOffers = _fetchOffers;
|
|
604
|
+
const _fetchOfferDetails = (basePath, token, accountId, offerId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
605
|
+
const base = (0, base_1.getBasePath)(basePath);
|
|
606
|
+
const { data: offerDetails } = yield (0, api_1.getRequest)(`${base.ACCOUNTS}/${accountId}/offers/${offerId}`, token);
|
|
607
|
+
return (offerDetails === null || offerDetails === void 0 ? void 0 : offerDetails.data) || offerDetails;
|
|
608
|
+
});
|
|
609
|
+
exports._fetchOfferDetails = _fetchOfferDetails;
|
|
610
|
+
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 = []) {
|
|
611
|
+
const base = (0, base_1.getBasePath)(basePath);
|
|
612
|
+
const { data: updatedOffer } = yield (0, api_1.postFilesAndDataRequest)(`${base.ACCOUNTS}/${accountId}/offers/${offerId}`, data, files, token, "put");
|
|
613
|
+
return updatedOffer;
|
|
614
|
+
});
|
|
615
|
+
exports._updateOffer = _updateOffer;
|
|
591
616
|
const _fetchPortfolios = (basePath, token, accountId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
592
617
|
const base = (0, base_1.getBasePath)(basePath);
|
|
593
618
|
const { data: accountPortfolios } = yield (0, api_1.getRequest)(`${base.ACCOUNTS}/${accountId}/portfolios`, token);
|
package/lib/api/event/types.d.ts
CHANGED
|
@@ -994,4 +994,55 @@ export type ResponseAPIType1 = {
|
|
|
994
994
|
data: Record<string, string>[];
|
|
995
995
|
};
|
|
996
996
|
};
|
|
997
|
+
export type TicketPackageInput = {
|
|
998
|
+
ticket_id: string;
|
|
999
|
+
ticket_standard_price: number;
|
|
1000
|
+
ticket_count: number;
|
|
1001
|
+
discount_percentage?: number;
|
|
1002
|
+
package_name?: string;
|
|
1003
|
+
package_type?: string;
|
|
1004
|
+
package_description?: string;
|
|
1005
|
+
};
|
|
1006
|
+
export type CreateOfferInput = {
|
|
1007
|
+
account: string;
|
|
1008
|
+
event_id: string;
|
|
1009
|
+
salutation?: string;
|
|
1010
|
+
first_name: string;
|
|
1011
|
+
last_name: string;
|
|
1012
|
+
email: string;
|
|
1013
|
+
job_title?: string;
|
|
1014
|
+
telephone_number?: string;
|
|
1015
|
+
company_name?: string;
|
|
1016
|
+
customer_company_logo?: File | string;
|
|
1017
|
+
address_street?: string;
|
|
1018
|
+
address_state?: string;
|
|
1019
|
+
address_country?: string;
|
|
1020
|
+
address_city?: string;
|
|
1021
|
+
address_postal_code?: string;
|
|
1022
|
+
sales_person_first_name: string;
|
|
1023
|
+
sales_person_last_name: string;
|
|
1024
|
+
sales_person_email: string;
|
|
1025
|
+
sales_person_job_title?: string;
|
|
1026
|
+
sales_person_telephone_number?: string;
|
|
1027
|
+
sales_person_signature?: File | string;
|
|
1028
|
+
offer_date?: string;
|
|
1029
|
+
date_of_payment?: string;
|
|
1030
|
+
availability_date?: string;
|
|
1031
|
+
language?: "de" | "en";
|
|
1032
|
+
further_agreements?: string;
|
|
1033
|
+
currency?: "eur" | "usd";
|
|
1034
|
+
tickets: TicketPackageInput[];
|
|
1035
|
+
};
|
|
1036
|
+
export type OfferServerResponse = {
|
|
1037
|
+
id: string;
|
|
1038
|
+
customer_contact_data: Record<string, any>;
|
|
1039
|
+
sales_person_data: Record<string, any>;
|
|
1040
|
+
offer_data: Record<string, any>;
|
|
1041
|
+
ticket_packeges_data: any[];
|
|
1042
|
+
sales_person_signature_data?: Record<string, any>;
|
|
1043
|
+
customer_company_logo_data?: Record<string, any>;
|
|
1044
|
+
event_id: string;
|
|
1045
|
+
created_at: string;
|
|
1046
|
+
updated_at: string;
|
|
1047
|
+
};
|
|
997
1048
|
export {};
|
package/lib/index.js
CHANGED
|
@@ -200,6 +200,22 @@ function EventAPIProvider(props) {
|
|
|
200
200
|
(0, api_1.validateConfig)(config);
|
|
201
201
|
return (0, event_1._fetchAccountDocuments)(config.baseUrl, config.token, accountId, params);
|
|
202
202
|
}), [config, config.baseUrl, config.token]);
|
|
203
|
+
const createOffer = (0, react_1.useCallback)((accountId, body, files) => __awaiter(this, void 0, void 0, function* () {
|
|
204
|
+
(0, api_1.validateConfig)(config);
|
|
205
|
+
return (0, event_1._createOffer)(config.baseUrl, config.token, accountId, body, files);
|
|
206
|
+
}), [config, config.baseUrl, config.token]);
|
|
207
|
+
const fetchOffers = (0, react_1.useCallback)((accountId) => __awaiter(this, void 0, void 0, function* () {
|
|
208
|
+
(0, api_1.validateConfig)(config);
|
|
209
|
+
return (0, event_1._fetchOffers)(config.baseUrl, config.token, accountId);
|
|
210
|
+
}), [config, config.baseUrl, config.token]);
|
|
211
|
+
const fetchOfferDetails = (0, react_1.useCallback)((accountId, offerId) => __awaiter(this, void 0, void 0, function* () {
|
|
212
|
+
(0, api_1.validateConfig)(config);
|
|
213
|
+
return (0, event_1._fetchOfferDetails)(config.baseUrl, config.token, accountId, offerId);
|
|
214
|
+
}), [config, config.baseUrl, config.token]);
|
|
215
|
+
const updateOffer = (0, react_1.useCallback)((accountId, offerId, body, files) => __awaiter(this, void 0, void 0, function* () {
|
|
216
|
+
(0, api_1.validateConfig)(config);
|
|
217
|
+
return (0, event_1._updateOffer)(config.baseUrl, config.token, accountId, offerId, body, files);
|
|
218
|
+
}), [config, config.baseUrl, config.token]);
|
|
203
219
|
const resendTicketEmail = react_1.default.useCallback((ticketId) => __awaiter(this, void 0, void 0, function* () {
|
|
204
220
|
(0, api_1.validateConfig)(config);
|
|
205
221
|
return (0, event_1._resendTicketEmail)(config.baseUrl, config.token, ticketId);
|
|
@@ -1326,6 +1342,10 @@ function EventAPIProvider(props) {
|
|
|
1326
1342
|
deactivateDataManagers,
|
|
1327
1343
|
updateSessionTypes,
|
|
1328
1344
|
fetchSessionTypes,
|
|
1345
|
+
createOffer,
|
|
1346
|
+
fetchOffers,
|
|
1347
|
+
fetchOfferDetails,
|
|
1348
|
+
updateOffer,
|
|
1329
1349
|
} }, props.children));
|
|
1330
1350
|
}
|
|
1331
1351
|
exports.BaseAPI = {
|
|
@@ -1577,5 +1597,9 @@ exports.BaseAPI = {
|
|
|
1577
1597
|
deactivateDataManagers: event_1._deactivateDataManagers,
|
|
1578
1598
|
updateSessionTypes: authentication_1._updateSessionTypes,
|
|
1579
1599
|
fetchSessionTypes: authentication_1._fetchSessionTypes,
|
|
1600
|
+
createOffer: event_1._createOffer,
|
|
1601
|
+
fetchOffers: event_1._fetchOffers,
|
|
1602
|
+
fetchOfferDetails: event_1._fetchOfferDetails,
|
|
1603
|
+
updateOffer: event_1._updateOffer,
|
|
1580
1604
|
};
|
|
1581
1605
|
exports.useAPIContext = EventAPIContext_1.useAPIContext;
|
package/lib/types/base.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Attendee, AttendeeInput, AttendeeProfile, Note, NoteUpdateInput, UserNotification } from "../api/attendee/types";
|
|
2
2
|
import { ColocatedEventDetailsResponse, ColocatedEventsGroupInputType, ColocatedEventsGroupType, GroupInputType, GroupResponseType, PackageType, PublicGroupResponseType, RegisterManagerInput, ResponseAccountEventsType, SessionType, FeedType, FeedInputType, FeedDetailsType } from "../api/authentication/types";
|
|
3
3
|
import { LoginResponse, SendResetPasswordBody } from "../api/context/types";
|
|
4
|
-
import { Account, AccountDetails, AccountInput, BlogPage, BlogPageInput, Booking, BookingDetails, Directory, DirectoryFiles, DiscountServerResponse, DocumentType, Event, EventLocation, EventRegistration, EventServerResponse, EventStream, Exhibition, ExhibitionInput, FileDetails, GroupServerResponse, GroupType, OptionServerResponse, Portfolio, PortfolioInput, Stream, StreamInput, TicketServerResponse, UserRegistrationsEvent, ZoomParams } from "../api/event/types";
|
|
4
|
+
import { Account, AccountDetails, AccountInput, BlogPage, BlogPageInput, Booking, BookingDetails, CreateOfferInput, Directory, DirectoryFiles, DiscountServerResponse, DocumentType, Event, EventLocation, EventRegistration, EventServerResponse, EventStream, Exhibition, ExhibitionInput, FileDetails, GroupServerResponse, GroupType, OfferServerResponse, OptionServerResponse, Portfolio, PortfolioInput, Stream, StreamInput, TicketServerResponse, UserRegistrationsEvent, ZoomParams } from "../api/event/types";
|
|
5
5
|
import { EventMeetingStatisticsItem, MeetingItem } from "../api/meetings/types";
|
|
6
6
|
import { CommentBody, Post, PostBody, UpdatePostBody } from "../api/posts/types";
|
|
7
7
|
import { GenericResponseServerType, PublicAdResponse, PublicEventItem, ResponsePaginationType, ResponseServerType } from "../api/public/types";
|
|
@@ -75,6 +75,10 @@ export type ClientBase = {
|
|
|
75
75
|
PORTFOLIOS: string;
|
|
76
76
|
};
|
|
77
77
|
export type BaseAPIType = {
|
|
78
|
+
createOffer: (basePath: string, token: string, accountId: string, body: CreateOfferInput, files: any[]) => Promise<OfferServerResponse>;
|
|
79
|
+
fetchOffers: (basePath: string, token: string, accountId: string) => Promise<OfferServerResponse[]>;
|
|
80
|
+
fetchOfferDetails: (basePath: string, token: string, accountId: string, offerId: string) => Promise<OfferServerResponse>;
|
|
81
|
+
updateOffer: (basePath: string, token: string, accountId: string, offerId: string, body: CreateOfferInput, files: any[]) => Promise<OfferServerResponse>;
|
|
78
82
|
fetchEventRegistrations: (basePath: string, token: string, eventId: string) => Promise<EventRegistration[]>;
|
|
79
83
|
fetchExhibitions: (basePath: string, token: string, eventId: string) => Promise<Exhibition[]>;
|
|
80
84
|
fetchEventDetails: (basePath: string, token: string, eventId: string) => Promise<Event>;
|
|
@@ -633,6 +637,10 @@ export type EventAPIType = {
|
|
|
633
637
|
createFeed: (accountId: string, data: FeedInputType, files: any[]) => Promise<FeedType>;
|
|
634
638
|
updateFeed: (accountId: string, feedId: string, data: FeedInputType, files: any[]) => Promise<FeedType>;
|
|
635
639
|
deleteFeed: (accountId: string, feedId: string) => Promise<any>;
|
|
640
|
+
createOffer: (accountId: string, body: CreateOfferInput, files: any[]) => Promise<OfferServerResponse>;
|
|
641
|
+
fetchOffers: (accountId: string) => Promise<OfferServerResponse[]>;
|
|
642
|
+
fetchOfferDetails: (accountId: string, offerId: string) => Promise<OfferServerResponse>;
|
|
643
|
+
updateOffer: (accountId: string, offerId: string, body: CreateOfferInput, files: any[]) => Promise<OfferServerResponse>;
|
|
636
644
|
};
|
|
637
645
|
export type BaseAPIConfigType = {
|
|
638
646
|
baseUrl?: string;
|