@hubs101/js-api-skd-client 1.0.10558 → 1.0.10560

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.
@@ -107,7 +107,7 @@ export declare const _createOffer: (basePath: string, token: string, accountId:
107
107
  name: string;
108
108
  value: File;
109
109
  }[]) => Promise<OfferServerResponse>;
110
- export declare const _fetchOffers: (basePath: string, token: string, accountId: string) => Promise<OfferServerResponse[]>;
110
+ export declare const _fetchOffers: (basePath: string, token: string, accountId: string, params?: string) => Promise<OfferServerResponse[]>;
111
111
  export declare const _fetchOfferDetails: (basePath: string, token: string, accountId: string, offerId: string) => Promise<OfferServerResponse>;
112
112
  export declare const _updateOffer: (basePath: string, token: string, accountId: string, offerId: string, data: CreateOfferInput, files?: {
113
113
  name: string;
@@ -595,9 +595,12 @@ const _createOffer = (basePath_1, token_1, accountId_1, data_1, ...args_1) => __
595
595
  return createdOffer;
596
596
  });
597
597
  exports._createOffer = _createOffer;
598
- const _fetchOffers = (basePath, token, accountId) => __awaiter(void 0, void 0, void 0, function* () {
598
+ const _fetchOffers = (basePath, token, accountId, params) => __awaiter(void 0, void 0, void 0, function* () {
599
599
  const base = (0, base_1.getBasePath)(basePath);
600
- const { data: offers } = yield (0, api_1.getRequest)(`${base.ACCOUNTS}/${accountId}/offers`, token);
600
+ const url = params
601
+ ? `${base.ACCOUNTS}/${accountId}/offers?${params}`
602
+ : `${base.ACCOUNTS}/${accountId}/offers`;
603
+ const { data: offers } = yield (0, api_1.getRequest)(url, token);
601
604
  return (offers === null || offers === void 0 ? void 0 : offers.data) || offers;
602
605
  });
603
606
  exports._fetchOffers = _fetchOffers;
@@ -1033,11 +1033,19 @@ export type CreateOfferInput = {
1033
1033
  currency?: "eur" | "usd";
1034
1034
  tickets: TicketPackageInput[];
1035
1035
  };
1036
+ export type OfferData = {
1037
+ offer_date: string;
1038
+ date_of_payment: string;
1039
+ availability_date: string;
1040
+ language: string;
1041
+ further_agreements: string;
1042
+ currency: string;
1043
+ };
1036
1044
  export type OfferServerResponse = {
1037
1045
  id: string;
1038
1046
  customer_contact_data: Record<string, any>;
1039
1047
  sales_person_data: Record<string, any>;
1040
- offer_data: Record<string, any>;
1048
+ offer_data: OfferData;
1041
1049
  ticket_packeges_data: any[];
1042
1050
  sales_person_signature_data?: Record<string, any>;
1043
1051
  customer_company_logo_data?: Record<string, any>;
package/lib/index.js CHANGED
@@ -204,9 +204,9 @@ function EventAPIProvider(props) {
204
204
  (0, api_1.validateConfig)(config);
205
205
  return (0, event_1._createOffer)(config.baseUrl, config.token, accountId, body, files);
206
206
  }), [config, config.baseUrl, config.token]);
207
- const fetchOffers = (0, react_1.useCallback)((accountId) => __awaiter(this, void 0, void 0, function* () {
207
+ const fetchOffers = (0, react_1.useCallback)((accountId, params) => __awaiter(this, void 0, void 0, function* () {
208
208
  (0, api_1.validateConfig)(config);
209
- return (0, event_1._fetchOffers)(config.baseUrl, config.token, accountId);
209
+ return (0, event_1._fetchOffers)(config.baseUrl, config.token, accountId, params);
210
210
  }), [config, config.baseUrl, config.token]);
211
211
  const fetchOfferDetails = (0, react_1.useCallback)((accountId, offerId) => __awaiter(this, void 0, void 0, function* () {
212
212
  (0, api_1.validateConfig)(config);
@@ -76,7 +76,7 @@ export type ClientBase = {
76
76
  };
77
77
  export type BaseAPIType = {
78
78
  createOffer: (basePath: string, token: string, accountId: string, body: CreateOfferInput, files: any[]) => Promise<OfferServerResponse>;
79
- fetchOffers: (basePath: string, token: string, accountId: string) => Promise<OfferServerResponse[]>;
79
+ fetchOffers: (basePath: string, token: string, accountId: string, params?: string) => Promise<OfferServerResponse[]>;
80
80
  fetchOfferDetails: (basePath: string, token: string, accountId: string, offerId: string) => Promise<OfferServerResponse>;
81
81
  updateOffer: (basePath: string, token: string, accountId: string, offerId: string, body: CreateOfferInput, files: any[]) => Promise<OfferServerResponse>;
82
82
  fetchEventRegistrations: (basePath: string, token: string, eventId: string) => Promise<EventRegistration[]>;
@@ -638,7 +638,7 @@ export type EventAPIType = {
638
638
  updateFeed: (accountId: string, feedId: string, data: FeedInputType, files: any[]) => Promise<FeedType>;
639
639
  deleteFeed: (accountId: string, feedId: string) => Promise<any>;
640
640
  createOffer: (accountId: string, body: CreateOfferInput, files: any[]) => Promise<OfferServerResponse>;
641
- fetchOffers: (accountId: string) => Promise<OfferServerResponse[]>;
641
+ fetchOffers: (accountId: string, params?: string) => Promise<OfferServerResponse[]>;
642
642
  fetchOfferDetails: (accountId: string, offerId: string) => Promise<OfferServerResponse>;
643
643
  updateOffer: (accountId: string, offerId: string, body: CreateOfferInput, files: any[]) => Promise<OfferServerResponse>;
644
644
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubs101/js-api-skd-client",
3
- "version": "1.0.10558",
3
+ "version": "1.0.10560",
4
4
  "author": "Liveware",
5
5
  "scripts": {
6
6
  "test": "jest --config jestconfig.json",