@hubs101/js-api-skd-client 1.0.10572 → 1.0.10574
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/attendee/index.js +1 -1
- package/lib/api/event/index.d.ts +1 -1
- package/lib/api/event/index.js +4 -4
- package/lib/api/public/index.d.ts +2 -1
- package/lib/api/public/index.js +8 -1
- package/lib/constants/api.d.ts +2 -0
- package/lib/constants/api.js +2 -0
- package/lib/index.js +10 -4
- package/lib/types/base.d.ts +5 -2
- package/lib/utils/api.d.ts +0 -1
- package/lib/utils/api.js +1 -23
- package/lib/utils/base.js +1 -0
- package/package.json +1 -1
|
@@ -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`,
|
|
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;
|
package/lib/api/event/index.d.ts
CHANGED
|
@@ -143,7 +143,7 @@ export declare const _deletePortfolioBlogPage: (basePath: string, token: string,
|
|
|
143
143
|
export declare const _fetchMediaDirectories: (basePath: string, token: string, accountId: string, path: string) => Promise<Directory>;
|
|
144
144
|
export declare const _fetchMediaDirectoryFiles: (basePath: string, token: string, accountId: string, path: string) => Promise<DirectoryFiles>;
|
|
145
145
|
export declare const _fetchMediaFileDetails: (basePath: string, token: string, accountId: string, filepath: string) => Promise<FileDetails>;
|
|
146
|
-
export declare const
|
|
146
|
+
export declare const _uploadFileToFolder: (basePath: string, token: string, accountId: string, folderPath: string, fileName: string, blob: Blob) => Promise<FileDetails>;
|
|
147
147
|
export declare const _renameFolder: (basePath: string, token: string, accountId: string, path: string, name_old: string, name_new: string) => Promise<APIResponse>;
|
|
148
148
|
export declare const _deleteMediaDirectories: (basePath: string, token: string, accountId: string, path: string, name: string) => Promise<APIResponse>;
|
|
149
149
|
export declare const _deleteMediaDirectoryFiles: (basePath: string, token: string, accountId: string, filepath: string) => Promise<APIResponse>;
|
package/lib/api/event/index.js
CHANGED
|
@@ -11,7 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
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
13
|
exports._assignPortfolio = exports._deletePortfolio = exports._fetchPortfolios = exports._sendOffer = 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.
|
|
14
|
+
exports._fetchAccountDocuments = exports._deactivateDataManagers = exports._activateDataManagers = exports._fetchPublicEventAdvertisement = exports._importTickets = 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._fetchPortfolioEvents = exports._fetchPortfolioDetails = exports._updatePortfolio = exports._createPortfolio = exports._unassignPortfolio = 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* () {
|
|
@@ -714,7 +714,7 @@ const _fetchMediaFileDetails = (basePath, token, accountId, filepath) => __await
|
|
|
714
714
|
return (data === null || data === void 0 ? void 0 : data.data) || data;
|
|
715
715
|
});
|
|
716
716
|
exports._fetchMediaFileDetails = _fetchMediaFileDetails;
|
|
717
|
-
const
|
|
717
|
+
const _uploadFileToFolder = (basePath, token, accountId, folderPath, fileName, blob) => __awaiter(void 0, void 0, void 0, function* () {
|
|
718
718
|
const base = (0, base_1.getBasePath)(basePath);
|
|
719
719
|
const f = new File([blob], fileName);
|
|
720
720
|
const formData = new FormData();
|
|
@@ -724,11 +724,11 @@ const _uploadImageToFolder = (basePath, token, accountId, folderPath, fileName,
|
|
|
724
724
|
type: f.type,
|
|
725
725
|
});
|
|
726
726
|
const { response } = yield (0, api_1.postFilesAndDataRequest)(`${base.ACCOUNTS}/media/${accountId}/file?path=${folderPath}`, {
|
|
727
|
-
|
|
727
|
+
file: f,
|
|
728
728
|
}, [formData], token);
|
|
729
729
|
return (response === null || response === void 0 ? void 0 : response.data) || response;
|
|
730
730
|
});
|
|
731
|
-
exports.
|
|
731
|
+
exports._uploadFileToFolder = _uploadFileToFolder;
|
|
732
732
|
const _renameFolder = (basePath, token, accountId, path, name_old, name_new) => __awaiter(void 0, void 0, void 0, function* () {
|
|
733
733
|
const base = (0, base_1.getBasePath)(basePath);
|
|
734
734
|
const { data } = yield (0, api_1.postFilesAndDataRequest)(`${base.ACCOUNTS}/media/${accountId}/directory`, {
|
|
@@ -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>;
|
package/lib/api/public/index.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._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;
|
package/lib/constants/api.d.ts
CHANGED
|
@@ -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
|
}>;
|
package/lib/constants/api.js
CHANGED
|
@@ -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);
|
|
@@ -1064,9 +1068,9 @@ function EventAPIProvider(props) {
|
|
|
1064
1068
|
(0, api_1.validateConfig)(config);
|
|
1065
1069
|
return (0, event_1._fetchMediaFileDetails)(config.baseUrl, config.token, accountId, path);
|
|
1066
1070
|
}), [config, config.baseUrl, config.token]);
|
|
1067
|
-
const
|
|
1071
|
+
const uploadFileToFolder = (0, react_1.useCallback)((accountId, folderPath, fileName, blob) => __awaiter(this, void 0, void 0, function* () {
|
|
1068
1072
|
(0, api_1.validateConfig)(config);
|
|
1069
|
-
return (0, event_1.
|
|
1073
|
+
return (0, event_1._uploadFileToFolder)(config.baseUrl, config.token, accountId, folderPath, fileName, blob);
|
|
1070
1074
|
}), [config, config.baseUrl, config.token]);
|
|
1071
1075
|
const renameFolder = (0, react_1.useCallback)((accountId, path, name_old, name_new) => __awaiter(this, void 0, void 0, function* () {
|
|
1072
1076
|
(0, api_1.validateConfig)(config);
|
|
@@ -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,
|
|
@@ -1355,7 +1360,7 @@ function EventAPIProvider(props) {
|
|
|
1355
1360
|
fetchMediaDirectories,
|
|
1356
1361
|
fetchMediaDirectoryFiles,
|
|
1357
1362
|
fetchMediaFileDetails,
|
|
1358
|
-
|
|
1363
|
+
uploadFileToFolder,
|
|
1359
1364
|
renameFolder,
|
|
1360
1365
|
fetchAttendeeDetails,
|
|
1361
1366
|
updatePackages,
|
|
@@ -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,
|
|
@@ -1617,7 +1623,7 @@ exports.BaseAPI = {
|
|
|
1617
1623
|
fetchMediaDirectories: event_1._fetchMediaDirectories,
|
|
1618
1624
|
fetchMediaDirectoryFiles: event_1._fetchMediaDirectoryFiles,
|
|
1619
1625
|
fetchMediaFileDetails: event_1._fetchMediaFileDetails,
|
|
1620
|
-
|
|
1626
|
+
uploadFileToFolder: event_1._uploadFileToFolder,
|
|
1621
1627
|
renameFolder: event_1._renameFolder,
|
|
1622
1628
|
fetchAttendeeDetails: attendee_1._fetchAttendeeDetails,
|
|
1623
1629
|
updatePackages: authentication_1._updatePackages,
|
package/lib/types/base.d.ts
CHANGED
|
@@ -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;
|
|
@@ -343,7 +344,7 @@ export type BaseAPIType = {
|
|
|
343
344
|
fetchMediaDirectories: (basePath: string, token: string, accountId: string, path: string) => Promise<Directory>;
|
|
344
345
|
fetchMediaDirectoryFiles: (basePath: string, token: string, accountId: string, path: string) => Promise<DirectoryFiles>;
|
|
345
346
|
fetchMediaFileDetails: (basePath: string, token: string, accountId: string, filepath: string) => Promise<FileDetails>;
|
|
346
|
-
|
|
347
|
+
uploadFileToFolder: (basePath: string, token: string, accountId: string, folderPath: string, fileName: string, blob: Blob) => Promise<FileDetails>;
|
|
347
348
|
renameFolder: (basePath: string, token: string, accountId: string, path: string, name_old: string, name_new: string) => Promise<APIResponse>;
|
|
348
349
|
fetchAttendeeDetails: (basePath: string, token: string, attendeeId: string) => Promise<AttendeeProfile>;
|
|
349
350
|
updatePackages: (basePath: string, token: string, accountId: string, data: {
|
|
@@ -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>;
|
|
@@ -627,7 +629,7 @@ export type EventAPIType = {
|
|
|
627
629
|
fetchMediaDirectories: (accountId: string, path: string) => Promise<Directory>;
|
|
628
630
|
fetchMediaDirectoryFiles: (accountId: string, path: string) => Promise<DirectoryFiles>;
|
|
629
631
|
fetchMediaFileDetails: (accountId: string, filepath: string) => Promise<FileDetails>;
|
|
630
|
-
|
|
632
|
+
uploadFileToFolder: (accountId: string, folderPath: string, fileName: string, blob: Blob) => Promise<FileDetails>;
|
|
631
633
|
renameFolder: (accountId: string, path: string, name_old: string, name_new: string) => Promise<APIResponse>;
|
|
632
634
|
fetchAttendeeDetails: (attendeeId: string) => Promise<AttendeeProfile>;
|
|
633
635
|
updatePackages: (accountId: string, data: {
|
|
@@ -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>;
|
package/lib/utils/api.d.ts
CHANGED
|
@@ -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.
|
|
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;
|