@hubs101/js-api-skd-client 1.0.10572 → 1.0.10573

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.
@@ -130,7 +130,7 @@ const _checkIn = (basePath, token, attendeeId) => __awaiter(void 0, void 0, void
130
130
  exports._checkIn = _checkIn;
131
131
  const _checkout = (basePath, token, attendeeId) => __awaiter(void 0, void 0, void 0, function* () {
132
132
  const base = (0, base_1.getBasePath)(basePath);
133
- const response = yield (0, api_1.deleteRequest)(`${base.ATTENDEES}/${attendeeId}/check-in`, null, token);
133
+ const response = yield (0, api_1.deleteRequest)(`${base.ATTENDEES}/${attendeeId}/check-in`, {}, token);
134
134
  return response;
135
135
  });
136
136
  exports._checkout = _checkout;
@@ -1,6 +1,6 @@
1
1
  import { APIResponse } from "../../types/base";
2
2
  import { FeedType, PublicGroupResponseType } from "../authentication/types";
3
- import { Exhibition } from "../event/types";
3
+ import { Exhibition, OfferServerResponse } from "../event/types";
4
4
  import { Session } from "../sessions/types";
5
5
  import { PublicEventItem, ResponsePaginationType } from "./types";
6
6
  export declare const _fetchAllPublicEvents: (basePath: string, nbPage?: number, params?: string) => Promise<ResponsePaginationType<PublicEventItem>>;
@@ -10,3 +10,4 @@ export declare const _getPublicRegistrationForm: (basePath: string, eventId: str
10
10
  export declare const _getPublicGroupDetails: <T>(basePath: string, groupId: string) => Promise<PublicGroupResponseType<T>>;
11
11
  export declare const _fetchPublicEventStatistics: (basePath: string, eventId: string) => Promise<APIResponse>;
12
12
  export declare const _fetchPublicFeeds: (basePath: string, accountId: string, params?: string) => Promise<ResponsePaginationType<FeedType>>;
13
+ export declare const _fetchPublicOffer: (basePath: string, offerId: string, userId: string, access: string) => Promise<OfferServerResponse>;
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports._fetchPublicFeeds = exports._fetchPublicEventStatistics = exports._getPublicGroupDetails = exports._getPublicRegistrationForm = exports._fetchPublicAgenda = exports._fetchPublicExhibitions = exports._fetchAllPublicEvents = void 0;
12
+ exports._fetchPublicOffer = exports._fetchPublicFeeds = exports._fetchPublicEventStatistics = exports._getPublicGroupDetails = exports._getPublicRegistrationForm = exports._fetchPublicAgenda = exports._fetchPublicExhibitions = exports._fetchAllPublicEvents = void 0;
13
13
  const api_1 = require("../../utils/api");
14
14
  const base_1 = require("../../utils/base");
15
15
  const _fetchAllPublicEvents = (basePath, nbPage, params) => __awaiter(void 0, void 0, void 0, function* () {
@@ -81,3 +81,10 @@ const _fetchPublicFeeds = (basePath, accountId, params) => __awaiter(void 0, voi
81
81
  return feeds;
82
82
  });
83
83
  exports._fetchPublicFeeds = _fetchPublicFeeds;
84
+ const _fetchPublicOffer = (basePath, offerId, userId, access) => __awaiter(void 0, void 0, void 0, function* () {
85
+ const base = (0, base_1.getBasePath)(basePath);
86
+ const url = `${base.PUBLIC_OFFERS}/${offerId}?user=${userId}&access=${access}`;
87
+ const offer = yield (0, api_1.getRequest)(url);
88
+ return (offer === null || offer === void 0 ? void 0 : offer.data) || offer;
89
+ });
90
+ exports._fetchPublicOffer = _fetchPublicOffer;
@@ -62,6 +62,7 @@ export declare const API_PROD_PATH: Readonly<{
62
62
  INVITATION: "https://api.we-conect.com/v1/invitation";
63
63
  BOOKINGS: "https://api.we-conect.com/api/v1/bookings";
64
64
  PUBLIC_BOOKINGS: "https://api.we-conect.com/v1/bookings";
65
+ PUBLIC_OFFERS: "https://api.we-conect.com/v1/offers";
65
66
  }>;
66
67
  export declare const API_STAGE_PATH: Readonly<{
67
68
  ACCOUNTS: "https://api-staging.hubs101.com/api/v1/accounts";
@@ -116,6 +117,7 @@ export declare const API_STAGE_PATH: Readonly<{
116
117
  INVITATION: "https://api-staging.hubs101.com/v1/invitation";
117
118
  BOOKINGS: "https://api-staging.hubs101.com/api/v1/bookings";
118
119
  PUBLIC_BOOKINGS: "https://api-staging.hubs101.com/v1/bookings";
120
+ PUBLIC_OFFERS: "https://api-staging.hubs101.com/v1/offers";
119
121
  ACTIONS_EVENTS: "https://api-staging.hubs101.com/api/v1/actions/events";
120
122
  ACTIONS_ATTENDEE: "https://api-staging.hubs101.com/api/v1/actions/attendees";
121
123
  }>;
@@ -64,6 +64,7 @@ exports.API_PROD_PATH = Object.freeze({
64
64
  INVITATION: `${exports.UNAUTHORIZED_PRODUCTION_URL}/invitation`,
65
65
  BOOKINGS: `${exports.PRODUCTION_URL}/bookings`,
66
66
  PUBLIC_BOOKINGS: `${exports.UNAUTHORIZED_PRODUCTION_URL}/bookings`,
67
+ PUBLIC_OFFERS: `${exports.UNAUTHORIZED_PRODUCTION_URL}/offers`,
67
68
  });
68
69
  exports.API_STAGE_PATH = Object.freeze({
69
70
  ACCOUNTS: `${exports.STAGING_URL}/accounts`,
@@ -118,6 +119,7 @@ exports.API_STAGE_PATH = Object.freeze({
118
119
  INVITATION: `${exports.UNAUTHORIZED_STAGING_URL}/invitation`,
119
120
  BOOKINGS: `${exports.STAGING_URL}/bookings`,
120
121
  PUBLIC_BOOKINGS: `${exports.UNAUTHORIZED_STAGING_URL}/bookings`,
122
+ PUBLIC_OFFERS: `${exports.UNAUTHORIZED_STAGING_URL}/offers`,
121
123
  ACTIONS_EVENTS: `${exports.STAGING_URL}/actions/events`,
122
124
  ACTIONS_ATTENDEE: `${exports.STAGING_URL}/actions/attendees`,
123
125
  });
package/lib/index.js CHANGED
@@ -1024,6 +1024,10 @@ function EventAPIProvider(props) {
1024
1024
  (0, api_1.validateBaseUrl)(config);
1025
1025
  return (0, public_1._fetchPublicFeeds)(config.baseUrl, accountId, params);
1026
1026
  }), [config, config.baseUrl]);
1027
+ const fetchPublicOffer = (0, react_1.useCallback)((offerId, userId, access) => __awaiter(this, void 0, void 0, function* () {
1028
+ (0, api_1.validateBaseUrl)(config);
1029
+ return (0, public_1._fetchPublicOffer)(config.baseUrl, offerId, userId, access);
1030
+ }), [config, config.baseUrl]);
1027
1031
  const fetchFeed = (0, react_1.useCallback)((accountId, feedId) => __awaiter(this, void 0, void 0, function* () {
1028
1032
  (0, api_1.validateConfig)(config);
1029
1033
  return (0, authentication_1._fetchFeed)(config.baseUrl, config.token, accountId, feedId);
@@ -1344,6 +1348,7 @@ function EventAPIProvider(props) {
1344
1348
  fetchColocatedEvents,
1345
1349
  fetchFeeds,
1346
1350
  fetchPublicFeeds,
1351
+ fetchPublicOffer,
1347
1352
  fetchFeed,
1348
1353
  createFeed,
1349
1354
  updateFeed,
@@ -1606,6 +1611,7 @@ exports.BaseAPI = {
1606
1611
  fetchColocatedEvents: authentication_1._fetchColocatedEvents,
1607
1612
  fetchFeeds: authentication_1._fetchFeeds,
1608
1613
  fetchPublicFeeds: public_1._fetchPublicFeeds,
1614
+ fetchPublicOffer: public_1._fetchPublicOffer,
1609
1615
  fetchFeed: authentication_1._fetchFeed,
1610
1616
  createFeed: authentication_1._createFeed,
1611
1617
  updateFeed: authentication_1._updateFeed,
@@ -60,6 +60,7 @@ export type ClientBase = {
60
60
  PUBLIC_EVENTS: string;
61
61
  PUBLIC_ACCOUNTS: string;
62
62
  PUBLIC_GROUPS: string;
63
+ PUBLIC_OFFERS: string;
63
64
  LOCATIONS: string;
64
65
  PAGES: string;
65
66
  PAYMENT_ACCOUNTS: string;
@@ -361,6 +362,7 @@ export type BaseAPIType = {
361
362
  deactivateDataManagers: (basePath: string, token: string, eventId: string, attendeeIds: string[]) => Promise<Attendee[]>;
362
363
  fetchFeeds: (basePath: string, token: string, accountId: string, params?: string) => Promise<ResponsePaginationType<FeedType>>;
363
364
  fetchPublicFeeds: (basePath: string, accountId: string, params?: string) => Promise<ResponsePaginationType<FeedType>>;
365
+ fetchPublicOffer: (basePath: string, offerId: string, userId: string, access: string) => Promise<OfferServerResponse>;
364
366
  fetchFeed: (basePath: string, token: string, accountId: string, feedId: string) => Promise<FeedDetailsType>;
365
367
  createFeed: (basePath: string, token: string, accountId: string, data: FeedInputType, files: any[]) => Promise<FeedType>;
366
368
  updateFeed: (basePath: string, token: string, accountId: string, feedId: string, data: FeedInputType, files: any[]) => Promise<FeedType>;
@@ -645,6 +647,7 @@ export type EventAPIType = {
645
647
  deactivateDataManagers: (eventId: string, attendeeIds: string[]) => Promise<Attendee[]>;
646
648
  fetchFeeds: (accountId: string, params?: string) => Promise<ResponsePaginationType<FeedType>>;
647
649
  fetchPublicFeeds: (accountId: string, params?: string) => Promise<ResponsePaginationType<FeedType>>;
650
+ fetchPublicOffer: (offerId: string, userId: string, access: string) => Promise<OfferServerResponse>;
648
651
  fetchFeed: (accountId: string, feedId: string) => Promise<FeedDetailsType>;
649
652
  createFeed: (accountId: string, data: FeedInputType, files: any[]) => Promise<FeedType>;
650
653
  updateFeed: (accountId: string, feedId: string, data: FeedInputType, files: any[]) => Promise<FeedType>;
@@ -5,7 +5,6 @@ export declare const postRequest: (url: string, body?: any, token?: string, head
5
5
  export declare const postRequestSimple: (url: string, body?: any, headers?: any) => Promise<any>;
6
6
  export declare const getRequestSimple: (url: string, token?: string, headers?: any) => Promise<string>;
7
7
  export declare const deleteRequest: (url: string, body: any, token: string, headers?: any) => Promise<any>;
8
- export declare const deleteRequestSimple: (url: string, token: string) => Promise<any>;
9
8
  export declare const postFileRequest: (url: string, file: any, param: string, token: string) => Promise<any>;
10
9
  export declare const putRequest: (url: string, token: string, body: any, withoutStatus?: boolean) => Promise<any>;
11
10
  export declare const patchRequest: (url: string, token: string, body: any) => Promise<any>;
package/lib/utils/api.js CHANGED
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.putRequestDirect = exports.postWithAttachments = exports.patchRequestWe = exports.postRequestJSON = exports.postFileRequestWE = exports.deleteRequestWE = exports.postRequestWE = exports.postRequestWithRetry = exports.postFilesAndDataRequest = exports.validateBaseUrl = exports.validateConfig = exports.getFormRequest = exports.getRequest = exports.patchRequest = exports.putRequest = exports.postFileRequest = exports.deleteRequestSimple = exports.deleteRequest = exports.getRequestSimple = exports.postRequestSimple = exports.postRequest = exports.trimUndefined = exports.error400 = void 0;
12
+ exports.putRequestDirect = exports.postWithAttachments = exports.patchRequestWe = exports.postRequestJSON = exports.postFileRequestWE = exports.deleteRequestWE = exports.postRequestWE = exports.postRequestWithRetry = exports.postFilesAndDataRequest = exports.validateBaseUrl = exports.validateConfig = exports.getFormRequest = exports.getRequest = exports.patchRequest = exports.putRequest = exports.postFileRequest = exports.deleteRequest = exports.getRequestSimple = exports.postRequestSimple = exports.postRequest = exports.trimUndefined = exports.error400 = void 0;
13
13
  exports.error400 = '"status":400';
14
14
  const trimUndefined = (obj) => Object.keys(obj).reduce((result, key) => obj[key] === undefined ? result : ((result[key] = obj[key]), result), {});
15
15
  exports.trimUndefined = trimUndefined;
@@ -128,28 +128,6 @@ const deleteRequest = (url, body, token, headers) => __awaiter(void 0, void 0, v
128
128
  return data;
129
129
  });
130
130
  exports.deleteRequest = deleteRequest;
131
- const deleteRequestSimple = (url, token) => __awaiter(void 0, void 0, void 0, function* () {
132
- const response = yield fetch(url, {
133
- method: "DELETE",
134
- headers: {
135
- Authorization: `Bearer ${token}`,
136
- },
137
- });
138
- const data = yield response.json();
139
- if (String(data.status).startsWith("4")) {
140
- if (data === null || data === void 0 ? void 0 : data.message) {
141
- throw new Error(data.message);
142
- }
143
- if (data === null || data === void 0 ? void 0 : data.invalid_fields) {
144
- throw new Error(JSON.stringify(data.invalid_fields));
145
- }
146
- }
147
- if (data === null || data === void 0 ? void 0 : data.result) {
148
- return data === null || data === void 0 ? void 0 : data.result;
149
- }
150
- return data;
151
- });
152
- exports.deleteRequestSimple = deleteRequestSimple;
153
131
  const postFileRequest = (url, file, param, token) => __awaiter(void 0, void 0, void 0, function* () {
154
132
  var _a, _b;
155
133
  const formdata = new FormData();
package/lib/utils/base.js CHANGED
@@ -68,6 +68,7 @@ const getBasePath = (basePath) => {
68
68
  PUBLIC_GROUPS: `${publicBasePath}/groups`,
69
69
  PUBLIC_ACCOUNTS: `${publicBasePath}/accounts`,
70
70
  PUBLIC_EVENTS: basePath ? `${publicBasePath}/events` : "/events",
71
+ PUBLIC_OFFERS: `${publicBasePath}/offers`,
71
72
  });
72
73
  };
73
74
  exports.getBasePath = getBasePath;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubs101/js-api-skd-client",
3
- "version": "1.0.10572",
3
+ "version": "1.0.10573",
4
4
  "author": "Liveware",
5
5
  "scripts": {
6
6
  "test": "jest --config jestconfig.json",