@hubs101/js-api-skd-client 1.0.10330 → 1.0.10332

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.
@@ -1,6 +1,6 @@
1
1
  import { GenericResponseServerType, ResponsePaginationType, ResponseServerType } from "../public/types";
2
2
  import { ExhibitionReport, FetchCurrentEventAttendeesActionsResponse } from "../types";
3
- import { Account, AccountInput, Booking, BookingDetails, DiscountServerResponse, DocumentType, Event, EventLocation, EventRegistration, EventServerResponse, EventStream, Exhibition, ExhibitionInput, GroupServerResponse, OptionServerResponse, Stream, StreamInput, TicketServerResponse, UserRegistrationsEvent, ZoomParams } from "./types";
3
+ import { Account, AccountInput, Booking, BookingDetails, DiscountServerResponse, DocumentType, Event, EventLocation, EventRegistration, EventServerResponse, EventStream, Exhibition, ExhibitionInput, GroupServerResponse, OptionServerResponse, Portfolio, Stream, StreamInput, TicketServerResponse, UserRegistrationsEvent, ZoomParams } from "./types";
4
4
  export declare const _fetchEventRegistrations: (basePath: string, token: string, eventId: string) => Promise<EventRegistration[]>;
5
5
  export declare const _fetchAccounts: (basePath: string, token: string) => Promise<Account[]>;
6
6
  export declare const _fetchTickets: (basePath: string, token: string) => Promise<ResponsePaginationType<BookingDetails>>;
@@ -95,3 +95,4 @@ export declare const _createExhibition: (basePath: string, token: string, files:
95
95
  export declare const _importExhibition: (basePath: string, token: string, eventId: string, eventSource: string) => Promise<Response>;
96
96
  export declare const _updateExhibition: (basePath: string, token: string, exhibitionId: string, files: any, data: ExhibitionInput) => Promise<Exhibition>;
97
97
  export declare const _deleteExhibition: (basePath: string, token: string, exhibitionId: string) => Promise<Response>;
98
+ export declare const _fetchPortfolios: (basePath: string, token: string, accountId: string) => Promise<Portfolio[]>;
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports._fetchMyBookings = exports._createBooking = exports._checkBooking = exports._resendBookingEmail = exports._resendTicketEmail = exports._fetchEventAttendeeActions = 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._fetchTickets = exports._fetchAccounts = exports._fetchEventRegistrations = void 0;
13
- 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._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 = void 0;
13
+ exports._fetchPortfolios = 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._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 = void 0;
14
14
  const api_1 = require("../../utils/api");
15
15
  const base_1 = require("../../utils/base");
16
16
  const _fetchEventRegistrations = (basePath, token, eventId) => __awaiter(void 0, void 0, void 0, function* () {
@@ -551,3 +551,9 @@ const _deleteExhibition = (basePath, token, exhibitionId) => __awaiter(void 0, v
551
551
  return result;
552
552
  });
553
553
  exports._deleteExhibition = _deleteExhibition;
554
+ const _fetchPortfolios = (basePath, token, accountId) => __awaiter(void 0, void 0, void 0, function* () {
555
+ const base = (0, base_1.getBasePath)(basePath);
556
+ const { data: accountPortfolios } = yield (0, api_1.getRequest)(`${base.ACCOUNT}/${accountId}/portfolios`, token);
557
+ return accountPortfolios;
558
+ });
559
+ exports._fetchPortfolios = _fetchPortfolios;
@@ -756,4 +756,16 @@ export type DiscountServerResponse = {
756
756
  expire_at: null | string;
757
757
  updated_at: string;
758
758
  };
759
+ export type Portfolio = {
760
+ id: string;
761
+ account?: string;
762
+ name: string;
763
+ slug: string;
764
+ number_of_events: number;
765
+ published: boolean;
766
+ created_at: string;
767
+ updated_at: string;
768
+ created_by: string;
769
+ updated_by: string;
770
+ };
759
771
  export {};
@@ -56,6 +56,8 @@ export declare const API_PROD_PATH: Readonly<{
56
56
  DISCOUNTS: `${string}/discounts`;
57
57
  LOCATIONS: `${string}/locations`;
58
58
  PAGES: `${string}/pages`;
59
+ PORTFOLIOS: `${string}/portfolios`;
60
+ ACCOUNT: `${string}/account`;
59
61
  PAYMENT_ACCOUNTS: `${string}/payment-account`;
60
62
  ACCOUNT_TRIAL: `${string}/accounts/trial`;
61
63
  INVITATION: `${string}/invitation`;
@@ -109,6 +111,8 @@ export declare const API_STAGE_PATH: Readonly<{
109
111
  DISCOUNTS: `${string}/discounts`;
110
112
  LOCATIONS: `${string}/locations`;
111
113
  PAGES: `${string}/pages`;
114
+ PORTFOLIOS: `${string}/portfolios`;
115
+ ACCOUNT: `${string}/account`;
112
116
  PAYMENT_ACCOUNTS: `${string}/payment-account`;
113
117
  ACCOUNT_TRIAL: `${string}/accounts/trial`;
114
118
  INVITATION: `${string}/invitation`;
@@ -58,6 +58,8 @@ exports.API_PROD_PATH = Object.freeze({
58
58
  DISCOUNTS: `${exports.PRODUCTION_URL}/discounts`,
59
59
  LOCATIONS: `${exports.PRODUCTION_URL}/locations`,
60
60
  PAGES: `${exports.PRODUCTION_URL}/pages`,
61
+ PORTFOLIOS: `${exports.PRODUCTION_URL}/portfolios`,
62
+ ACCOUNT: `${exports.PRODUCTION_URL}/account`,
61
63
  PAYMENT_ACCOUNTS: `${exports.PRODUCTION_URL}/payment-account`,
62
64
  ACCOUNT_TRIAL: `${exports.UNAUTHORIZED_PRODUCTION_URL}/accounts/trial`,
63
65
  INVITATION: `${exports.UNAUTHORIZED_PRODUCTION_URL}/invitation`,
@@ -111,6 +113,8 @@ exports.API_STAGE_PATH = Object.freeze({
111
113
  DISCOUNTS: `${exports.STAGING_URL}/discounts`,
112
114
  LOCATIONS: `${exports.STAGING_URL}/locations`,
113
115
  PAGES: `${exports.STAGING_URL}/pages`,
116
+ PORTFOLIOS: `${exports.STAGING_URL}/portfolios`,
117
+ ACCOUNT: `${exports.STAGING_URL}/account`,
114
118
  PAYMENT_ACCOUNTS: `${exports.STAGING_URL}/payment-account`,
115
119
  ACCOUNT_TRIAL: `${exports.UNAUTHORIZED_STAGING_URL}/accounts/trial`,
116
120
  INVITATION: `${exports.UNAUTHORIZED_STAGING_URL}/invitation`,
package/lib/index.js CHANGED
@@ -33,6 +33,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
33
33
  };
34
34
  Object.defineProperty(exports, "__esModule", { value: true });
35
35
  exports.useAPIContext = exports.BaseAPI = exports.EventAPIProvider = void 0;
36
+ /* eslint-disable prefer-arrow/prefer-arrow-functions */
36
37
  const react_1 = __importStar(require("react"));
37
38
  // index.ts
38
39
  const attendee_1 = require("./api/attendee");
@@ -52,7 +53,7 @@ function EventAPIProvider(props) {
52
53
  const [config, setConfig] = (0, hooks_1.useSetState)({});
53
54
  const init = react_1.default.useCallback((baseUrl, email, password) => __awaiter(this, void 0, void 0, function* () {
54
55
  try {
55
- const { token, expires } = yield (0, authentication_1._login)(baseUrl, email, password);
56
+ const { token } = yield (0, authentication_1._login)(baseUrl, email, password);
56
57
  if (token) {
57
58
  setConfig({ token, baseUrl });
58
59
  }
@@ -62,20 +63,20 @@ function EventAPIProvider(props) {
62
63
  throw Error("Login Failed");
63
64
  }
64
65
  }), []);
65
- const initWithToken = react_1.default.useCallback((baseUrl, token) => __awaiter(this, void 0, void 0, function* () {
66
+ const initWithToken = react_1.default.useCallback((baseUrl, token) => {
66
67
  if (!token || !baseUrl) {
67
68
  return false;
68
69
  }
69
70
  setConfig({ token, baseUrl });
70
71
  return true;
71
- }), [config]);
72
- const initWithoutToken = react_1.default.useCallback((baseUrl) => __awaiter(this, void 0, void 0, function* () {
72
+ }, [config]);
73
+ const initWithoutToken = react_1.default.useCallback((baseUrl) => {
73
74
  if (!baseUrl) {
74
75
  return false;
75
76
  }
76
77
  setConfig({ baseUrl });
77
78
  return true;
78
- }), [config]);
79
+ }, [config]);
79
80
  const fetchEventRegistrations = react_1.default.useCallback((eventId) => __awaiter(this, void 0, void 0, function* () {
80
81
  (0, api_1.validateConfig)(config);
81
82
  const eventRegistrations = yield (0, event_1._fetchEventRegistrations)(config.baseUrl, config.token, eventId);
@@ -116,10 +117,10 @@ function EventAPIProvider(props) {
116
117
  const documents = yield (0, event_1._fetchEventDocuments)(config.baseUrl, config.token, eventId);
117
118
  return documents;
118
119
  }), [config, config.baseUrl, config.token]);
119
- const reportExhibitionAction = react_1.default.useCallback((exhibitionId, requestData) => __awaiter(this, void 0, void 0, function* () {
120
+ const reportExhibitionAction = react_1.default.useCallback((exhibitionId, requestData) => {
120
121
  (0, api_1.validateConfig)(config);
121
122
  void (0, event_1._reportExhibitionAction)(config.baseUrl, config.token, exhibitionId, requestData);
122
- }), [config, config.baseUrl, config.token]);
123
+ }, [config, config.baseUrl, config.token]);
123
124
  const pinDocument = react_1.default.useCallback((eventId, exhibitionId) => __awaiter(this, void 0, void 0, function* () {
124
125
  (0, api_1.validateConfig)(config);
125
126
  return (0, event_1._pinDocument)(config.baseUrl, config.token, eventId, exhibitionId);
@@ -463,10 +464,10 @@ function EventAPIProvider(props) {
463
464
  (0, api_1.validateConfig)(config);
464
465
  return (0, event_1._updateEvent)(config.baseUrl, config.token, eventId, data, files);
465
466
  }), [config, config.baseUrl, config.token]);
466
- const resendConfirmationEmail = (0, react_1.useCallback)((attendeeId) => __awaiter(this, void 0, void 0, function* () {
467
+ const resendConfirmationEmail = (0, react_1.useCallback)((attendeeId) => {
467
468
  (0, api_1.validateConfig)(config);
468
- (0, attendee_1._resendConfirmationEmail)(config.baseUrl, config.token, attendeeId);
469
- }), [config, config.baseUrl, config.token]);
469
+ void (0, attendee_1._resendConfirmationEmail)(config.baseUrl, config.token, attendeeId);
470
+ }, [config, config.baseUrl, config.token]);
470
471
  const createEvent = (0, react_1.useCallback)((data, files) => __awaiter(this, void 0, void 0, function* () {
471
472
  (0, api_1.validateConfig)(config);
472
473
  return (0, event_1._createEvent)(config.baseUrl, config.token, data, files);
@@ -507,11 +508,11 @@ function EventAPIProvider(props) {
507
508
  (0, api_1.validateConfig)(config);
508
509
  return (0, attendee_1._updateAttendee)(config.baseUrl, config.token, updatedAttendee, attendeeId);
509
510
  }), [config, config.baseUrl, config.token]);
510
- const updateGlobalAttendeeImage = react_1.default.useCallback((file, param, attendeeId) => __awaiter(this, void 0, void 0, function* () {
511
+ const updateGlobalAttendeeImage = react_1.default.useCallback((file, param) => __awaiter(this, void 0, void 0, function* () {
511
512
  (0, api_1.validateConfig)(config);
512
513
  return (0, attendee_1._updateGlobalAttendeeImage)(config.baseUrl, config.token, file, param);
513
514
  }), [config, config.baseUrl, config.token]);
514
- const updateGlobalAttendee = react_1.default.useCallback((updatedAttendee, attendeeId) => __awaiter(this, void 0, void 0, function* () {
515
+ const updateGlobalAttendee = react_1.default.useCallback((updatedAttendee) => __awaiter(this, void 0, void 0, function* () {
515
516
  (0, api_1.validateConfig)(config);
516
517
  return (0, attendee_1._updateGlobalAttendee)(config.baseUrl, config.token, updatedAttendee);
517
518
  }), [config, config.baseUrl, config.token]);
@@ -836,6 +837,10 @@ function EventAPIProvider(props) {
836
837
  (0, api_1.validateConfig)(config);
837
838
  return (0, meetings_1._fetchEventMeetingsStatistics)(config.baseUrl, config.token, eventId);
838
839
  }), [config, config.baseUrl, config.token]);
840
+ const fetchPortfolios = react_1.default.useCallback((accountId) => __awaiter(this, void 0, void 0, function* () {
841
+ (0, api_1.validateConfig)(config);
842
+ return (0, event_1._fetchPortfolios)(config.baseUrl, config.token, accountId);
843
+ }), [config, config.baseUrl, config.token]);
839
844
  return (react_1.default.createElement(EventAPIContext_1.default.Provider, { value: {
840
845
  config,
841
846
  init,
@@ -1030,6 +1035,7 @@ function EventAPIProvider(props) {
1030
1035
  promoteSession,
1031
1036
  editMeeting,
1032
1037
  fetchEventMeetingsStatistics,
1038
+ fetchPortfolios,
1033
1039
  } }, props.children));
1034
1040
  }
1035
1041
  exports.EventAPIProvider = EventAPIProvider;
@@ -1225,5 +1231,6 @@ exports.BaseAPI = {
1225
1231
  promoteSession: sessions_1._promoteSession,
1226
1232
  editMeeting: meetings_1._editMeeting,
1227
1233
  fetchEventMeetingsStatistics: meetings_1._fetchEventMeetingsStatistics,
1234
+ fetchPortfolios: event_1._fetchPortfolios,
1228
1235
  };
1229
1236
  exports.useAPIContext = EventAPIContext_1.useAPIContext;
@@ -2,7 +2,7 @@ import { Attendee, AttendeeInput, AttendeeProfile, Note, NoteUpdateInput, UserNo
2
2
  import { RegisterManagerInput, ResponseAccountEventsType } from "../api/authentication/types";
3
3
  import { CalendarEvent } from "../api/calendar/types";
4
4
  import { LoginResponse, SendResetPasswordBody } from "../api/context/types";
5
- import { Account, AccountInput, Answer, Booking, BookingDetails, DiscountServerResponse, DocumentType, Event, EventLocation, EventRegistration, EventServerResponse, EventStream, Exhibition, ExhibitionInput, GroupServerResponse, OptionServerResponse, Stream, StreamInput, TicketServerResponse, UserRegistrationsEvent, ZoomParams } from "../api/event/types";
5
+ import { Account, AccountInput, Answer, Booking, BookingDetails, DiscountServerResponse, DocumentType, Event, EventLocation, EventRegistration, EventServerResponse, EventStream, Exhibition, ExhibitionInput, GroupServerResponse, OptionServerResponse, Portfolio, Stream, StreamInput, TicketServerResponse, UserRegistrationsEvent, ZoomParams } from "../api/event/types";
6
6
  import { EventMeetingStatisticsItem, MeetingItem } from "../api/meetings/types";
7
7
  import { Page } from "../api/pages/types";
8
8
  import { CommentBody, Post, PostBody, UpdatePostBody } from "../api/posts/types";
@@ -70,6 +70,8 @@ export type ClientBase = {
70
70
  PUBLIC_BOOKINGS: string;
71
71
  ACTIONS_EVENTS: string;
72
72
  ACTIONS_ATTENDEE: string;
73
+ ACCOUNT: string;
74
+ PORTFOLIOS: string;
73
75
  };
74
76
  export type BaseAPIType = {
75
77
  fetchEventRegistrations: (basePath: string, token: string, eventId: string) => Promise<EventRegistration[]>;
@@ -277,6 +279,7 @@ export type BaseAPIType = {
277
279
  promoteSession: (basePath: string, token: string, sessionId: string, promotionDate: string) => Promise<Response>;
278
280
  editMeeting: (basePath: string, token: string, body: MeetingItem) => Promise<MeetingItem>;
279
281
  fetchEventMeetingsStatistics: (basePath: string, token: string, eventId: string) => Promise<EventMeetingStatisticsItem[]>;
282
+ fetchPortfolios: (basePath: string, token: string, accountId: string) => Promise<Portfolio[]>;
280
283
  };
281
284
  export type EventAPIType = {
282
285
  config: BaseAPIConfigType;
@@ -484,6 +487,7 @@ export type EventAPIType = {
484
487
  promoteSession: (sessionId: string, promotionDate: string) => Promise<Response>;
485
488
  editMeeting: (body: MeetingItem) => Promise<MeetingItem>;
486
489
  fetchEventMeetingsStatistics: (eventId: string) => Promise<EventMeetingStatisticsItem[]>;
490
+ fetchPortfolios: (accountId: string) => Promise<Portfolio[]>;
487
491
  };
488
492
  export type BaseAPIConfigType = {
489
493
  baseUrl?: string;
package/lib/utils/base.js CHANGED
@@ -7,6 +7,8 @@ const getBasePath = (basePath) => {
7
7
  const publicBasePath = `${basePath}/public`;
8
8
  return Object.freeze({
9
9
  ACCOUNTS: `${authorizedBasePath}/accounts`,
10
+ ACCOUNT: `${authorizedBasePath}/account`,
11
+ PORTFOLIOS: `${authorizedBasePath}/portfolios`,
10
12
  ADMIN: `${authorizedBasePath}/admin`,
11
13
  ATTENDEES: `${authorizedBasePath}/attendees`,
12
14
  AUTH: {
@@ -56,7 +58,7 @@ const getBasePath = (basePath) => {
56
58
  TICKETS: `${authorizedBasePath}/tickets`,
57
59
  DISCOUNTS: `${authorizedBasePath}/discounts`,
58
60
  PAYMENT_ACCOUNTS: `${authorizedBasePath}/payment-accounts`,
59
- PUBLIC_EVENTS: basePath ? `${basePath}/public/events` : "public/events",
61
+ PUBLIC_EVENTS: basePath ? `${basePath}/events` : "/events",
60
62
  STREAMS: `${authorizedBasePath}/streams`,
61
63
  ACCOUNT_TRIAL: `${unauthorizedBasePath}/accounts/trial`,
62
64
  INVITATION: `${unauthorizedBasePath}/invitation`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubs101/js-api-skd-client",
3
- "version": "1.0.10330",
3
+ "version": "1.0.10332",
4
4
  "author": "Liveware",
5
5
  "scripts": {
6
6
  "test": "jest --config jestconfig.json",