@qite/tide-booking-component 1.4.74 → 1.4.75

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.
@@ -6994,10 +6994,13 @@ var build = {};
6994
6994
  allotment: 2
6995
6995
  };
6996
6996
 
6997
- var AvailabilitySearchType = {
6998
- default: 0,
6999
- allotment: 1
7000
- };
6997
+ exports.AvailabilitySearchType = void 0;
6998
+ (function (AvailabilitySearchType) {
6999
+ AvailabilitySearchType[(AvailabilitySearchType['default'] = 0)] = 'default';
7000
+ AvailabilitySearchType[(AvailabilitySearchType['allotment'] = 1)] = 'allotment';
7001
+ AvailabilitySearchType[(AvailabilitySearchType['fixedDuration'] = 2)] = 'fixedDuration';
7002
+ AvailabilitySearchType[(AvailabilitySearchType['flight'] = 3)] = 'flight';
7003
+ })(exports.AvailabilitySearchType || (exports.AvailabilitySearchType = {}));
7001
7004
 
7002
7005
  var DataType = {
7003
7006
  text: 'text',
@@ -7199,6 +7202,27 @@ var build = {};
7199
7202
  sunnyCars: 20
7200
7203
  };
7201
7204
 
7205
+ exports.DateAmountType = void 0;
7206
+ (function (DateAmountType) {
7207
+ DateAmountType[(DateAmountType['days'] = 0)] = 'days';
7208
+ DateAmountType[(DateAmountType['months'] = 1)] = 'months';
7209
+ })(exports.DateAmountType || (exports.DateAmountType = {}));
7210
+
7211
+ exports.PortalQsmType = void 0;
7212
+ (function (PortalQsmType) {
7213
+ PortalQsmType[(PortalQsmType['Multidestination'] = 0)] = 'Multidestination';
7214
+ PortalQsmType[(PortalQsmType['Accommodation'] = 1)] = 'Accommodation';
7215
+ PortalQsmType[(PortalQsmType['AccommodationAndFlight'] = 2)] = 'AccommodationAndFlight';
7216
+ PortalQsmType[(PortalQsmType['Flight'] = 3)] = 'Flight';
7217
+ PortalQsmType[(PortalQsmType['RoundTrip'] = 4)] = 'RoundTrip';
7218
+ PortalQsmType[(PortalQsmType['GroupTour'] = 5)] = 'GroupTour';
7219
+ PortalQsmType[(PortalQsmType['Package'] = 6)] = 'Package';
7220
+ PortalQsmType[(PortalQsmType['Ticket'] = 7)] = 'Ticket';
7221
+ PortalQsmType[(PortalQsmType['Car'] = 8)] = 'Car';
7222
+ PortalQsmType[(PortalQsmType['Transfer'] = 9)] = 'Transfer';
7223
+ PortalQsmType[(PortalQsmType['Cruise'] = 10)] = 'Cruise';
7224
+ })(exports.PortalQsmType || (exports.PortalQsmType = {}));
7225
+
7202
7226
  /******************************************************************************
7203
7227
  Copyright (c) Microsoft Corporation.
7204
7228
 
@@ -13195,6 +13219,9 @@ PERFORMANCE OF THIS SOFTWARE.
13195
13219
  var ENDPOINT_TRANSLATION_DICTIONARY = ENDPOINT$2 + '/translation-dictionary';
13196
13220
  var ENDPOINT_BOOKING_ACCOMMODATION = ENDPOINT$2 + '/booking-accommodation';
13197
13221
  var ENDPOINT_LOCATIONS = ENDPOINT$2 + '/entity/locations';
13222
+ var ENDPOINT_WEBSITE_CONFIGURATION = function (portalId) {
13223
+ return ENDPOINT$2 + '/website/' + portalId + '/configuration';
13224
+ };
13198
13225
  /**
13199
13226
  * api/web/crmcontact
13200
13227
  * Creates a CRM contact.
@@ -13252,6 +13279,11 @@ PERFORMANCE OF THIS SOFTWARE.
13252
13279
  var body = JSON.stringify(request);
13253
13280
  return post(url, apiKey, body, config.token, signal);
13254
13281
  };
13282
+ var getWebsiteConfiguration = function (config, id, signal) {
13283
+ var url = '' + config.host + ENDPOINT_WEBSITE_CONFIGURATION(id);
13284
+ var apiKey = config.apiKey;
13285
+ return get(url, apiKey, config.token, signal, true);
13286
+ };
13255
13287
 
13256
13288
  var ENDPOINT$1 = '/api/web/contact';
13257
13289
  var ENDPOINT_CONTACT_FORM = ENDPOINT$1 + '/contact-form';
@@ -13308,7 +13340,6 @@ PERFORMANCE OF THIS SOFTWARE.
13308
13340
  };
13309
13341
 
13310
13342
  exports.AllotmentType = AllotmentType;
13311
- exports.AvailabilitySearchType = AvailabilitySearchType;
13312
13343
  exports.ContactForm = ContactForm;
13313
13344
  exports.DataType = DataType;
13314
13345
  exports.DossierType = DossierType;
@@ -13363,6 +13394,7 @@ PERFORMANCE OF THIS SOFTWARE.
13363
13394
  exports.getPortal = getPortal;
13364
13395
  exports.getPrintActions = getPrintActions;
13365
13396
  exports.getTranslationDictionary = getTranslationDictionary;
13397
+ exports.getWebsiteConfiguration = getWebsiteConfiguration;
13366
13398
  exports.login = login;
13367
13399
  exports.logout = logout;
13368
13400
  exports.priceDetails = priceDetails;
@@ -38618,7 +38650,8 @@ var enrichFiltersWithResults = function (results, filters, tags) {
38618
38650
  if (!results || results.length === 0 || !filters) {
38619
38651
  return filters !== null && filters !== void 0 ? filters : [];
38620
38652
  }
38621
- var _loop_1 = function (filter) {
38653
+ return filters.map(function (filter) {
38654
+ var updatedFilter = __assign({}, filter);
38622
38655
  if (filter.property === 'price' && (filter.min == null || filter.max == null)) {
38623
38656
  var prices = results
38624
38657
  .map(function (r) {
@@ -38629,8 +38662,8 @@ var enrichFiltersWithResults = function (results, filters, tags) {
38629
38662
  return p > 0;
38630
38663
  });
38631
38664
  if (prices.length > 0) {
38632
- filter.min = Math.floor(Math.min.apply(Math, prices));
38633
- filter.max = Math.ceil(Math.max.apply(Math, prices));
38665
+ updatedFilter.min = Math.floor(Math.min.apply(Math, prices));
38666
+ updatedFilter.max = Math.ceil(Math.max.apply(Math, prices));
38634
38667
  }
38635
38668
  }
38636
38669
  if (filter.property === 'accommodation') {
@@ -38643,8 +38676,7 @@ var enrichFiltersWithResults = function (results, filters, tags) {
38643
38676
  });
38644
38677
  }
38645
38678
  });
38646
- console.log('map', map_1);
38647
- filter.options = Array.from(map_1.values()).map(function (accommodation) {
38679
+ updatedFilter.options = Array.from(map_1.values()).map(function (accommodation) {
38648
38680
  var _a;
38649
38681
  return {
38650
38682
  label: (_a = accommodation.name) !== null && _a !== void 0 ? _a : accommodation.code,
@@ -38663,7 +38695,7 @@ var enrichFiltersWithResults = function (results, filters, tags) {
38663
38695
  });
38664
38696
  }
38665
38697
  });
38666
- filter.options = Array.from(map_2.values()).map(function (regime) {
38698
+ updatedFilter.options = Array.from(map_2.values()).map(function (regime) {
38667
38699
  var _a;
38668
38700
  return {
38669
38701
  label: (_a = regime.name) !== null && _a !== void 0 ? _a : regime.code,
@@ -38687,7 +38719,7 @@ var enrichFiltersWithResults = function (results, filters, tags) {
38687
38719
  }
38688
38720
  });
38689
38721
  });
38690
- filter.options = Array.from(map_3.values()).map(function (theme) {
38722
+ updatedFilter.options = Array.from(map_3.values()).map(function (theme) {
38691
38723
  return {
38692
38724
  label: theme.name,
38693
38725
  value: theme.id,
@@ -38695,12 +38727,8 @@ var enrichFiltersWithResults = function (results, filters, tags) {
38695
38727
  };
38696
38728
  });
38697
38729
  }
38698
- };
38699
- for (var _i = 0, filters_1 = filters; _i < filters_1.length; _i++) {
38700
- var filter = filters_1[_i];
38701
- _loop_1(filter);
38702
- }
38703
- return filters;
38730
+ return updatedFilter;
38731
+ });
38704
38732
  };
38705
38733
 
38706
38734
  var ticksToMinutes = function (ticks) {
@@ -7025,10 +7025,13 @@ var build = {};
7025
7025
  allotment: 2
7026
7026
  };
7027
7027
 
7028
- var AvailabilitySearchType = {
7029
- default: 0,
7030
- allotment: 1
7031
- };
7028
+ exports.AvailabilitySearchType = void 0;
7029
+ (function (AvailabilitySearchType) {
7030
+ AvailabilitySearchType[(AvailabilitySearchType['default'] = 0)] = 'default';
7031
+ AvailabilitySearchType[(AvailabilitySearchType['allotment'] = 1)] = 'allotment';
7032
+ AvailabilitySearchType[(AvailabilitySearchType['fixedDuration'] = 2)] = 'fixedDuration';
7033
+ AvailabilitySearchType[(AvailabilitySearchType['flight'] = 3)] = 'flight';
7034
+ })(exports.AvailabilitySearchType || (exports.AvailabilitySearchType = {}));
7032
7035
 
7033
7036
  var DataType = {
7034
7037
  text: 'text',
@@ -7230,6 +7233,27 @@ var build = {};
7230
7233
  sunnyCars: 20
7231
7234
  };
7232
7235
 
7236
+ exports.DateAmountType = void 0;
7237
+ (function (DateAmountType) {
7238
+ DateAmountType[(DateAmountType['days'] = 0)] = 'days';
7239
+ DateAmountType[(DateAmountType['months'] = 1)] = 'months';
7240
+ })(exports.DateAmountType || (exports.DateAmountType = {}));
7241
+
7242
+ exports.PortalQsmType = void 0;
7243
+ (function (PortalQsmType) {
7244
+ PortalQsmType[(PortalQsmType['Multidestination'] = 0)] = 'Multidestination';
7245
+ PortalQsmType[(PortalQsmType['Accommodation'] = 1)] = 'Accommodation';
7246
+ PortalQsmType[(PortalQsmType['AccommodationAndFlight'] = 2)] = 'AccommodationAndFlight';
7247
+ PortalQsmType[(PortalQsmType['Flight'] = 3)] = 'Flight';
7248
+ PortalQsmType[(PortalQsmType['RoundTrip'] = 4)] = 'RoundTrip';
7249
+ PortalQsmType[(PortalQsmType['GroupTour'] = 5)] = 'GroupTour';
7250
+ PortalQsmType[(PortalQsmType['Package'] = 6)] = 'Package';
7251
+ PortalQsmType[(PortalQsmType['Ticket'] = 7)] = 'Ticket';
7252
+ PortalQsmType[(PortalQsmType['Car'] = 8)] = 'Car';
7253
+ PortalQsmType[(PortalQsmType['Transfer'] = 9)] = 'Transfer';
7254
+ PortalQsmType[(PortalQsmType['Cruise'] = 10)] = 'Cruise';
7255
+ })(exports.PortalQsmType || (exports.PortalQsmType = {}));
7256
+
7233
7257
  /******************************************************************************
7234
7258
  Copyright (c) Microsoft Corporation.
7235
7259
 
@@ -13226,6 +13250,9 @@ PERFORMANCE OF THIS SOFTWARE.
13226
13250
  var ENDPOINT_TRANSLATION_DICTIONARY = ENDPOINT$2 + '/translation-dictionary';
13227
13251
  var ENDPOINT_BOOKING_ACCOMMODATION = ENDPOINT$2 + '/booking-accommodation';
13228
13252
  var ENDPOINT_LOCATIONS = ENDPOINT$2 + '/entity/locations';
13253
+ var ENDPOINT_WEBSITE_CONFIGURATION = function (portalId) {
13254
+ return ENDPOINT$2 + '/website/' + portalId + '/configuration';
13255
+ };
13229
13256
  /**
13230
13257
  * api/web/crmcontact
13231
13258
  * Creates a CRM contact.
@@ -13283,6 +13310,11 @@ PERFORMANCE OF THIS SOFTWARE.
13283
13310
  var body = JSON.stringify(request);
13284
13311
  return post(url, apiKey, body, config.token, signal);
13285
13312
  };
13313
+ var getWebsiteConfiguration = function (config, id, signal) {
13314
+ var url = '' + config.host + ENDPOINT_WEBSITE_CONFIGURATION(id);
13315
+ var apiKey = config.apiKey;
13316
+ return get(url, apiKey, config.token, signal, true);
13317
+ };
13286
13318
 
13287
13319
  var ENDPOINT$1 = '/api/web/contact';
13288
13320
  var ENDPOINT_CONTACT_FORM = ENDPOINT$1 + '/contact-form';
@@ -13339,7 +13371,6 @@ PERFORMANCE OF THIS SOFTWARE.
13339
13371
  };
13340
13372
 
13341
13373
  exports.AllotmentType = AllotmentType;
13342
- exports.AvailabilitySearchType = AvailabilitySearchType;
13343
13374
  exports.ContactForm = ContactForm;
13344
13375
  exports.DataType = DataType;
13345
13376
  exports.DossierType = DossierType;
@@ -13394,6 +13425,7 @@ PERFORMANCE OF THIS SOFTWARE.
13394
13425
  exports.getPortal = getPortal;
13395
13426
  exports.getPrintActions = getPrintActions;
13396
13427
  exports.getTranslationDictionary = getTranslationDictionary;
13428
+ exports.getWebsiteConfiguration = getWebsiteConfiguration;
13397
13429
  exports.login = login;
13398
13430
  exports.logout = logout;
13399
13431
  exports.priceDetails = priceDetails;
@@ -38376,7 +38408,8 @@ var enrichFiltersWithResults = function (results, filters, tags) {
38376
38408
  if (!results || results.length === 0 || !filters) {
38377
38409
  return filters !== null && filters !== void 0 ? filters : [];
38378
38410
  }
38379
- var _loop_1 = function (filter) {
38411
+ return filters.map(function (filter) {
38412
+ var updatedFilter = __assign({}, filter);
38380
38413
  if (filter.property === 'price' && (filter.min == null || filter.max == null)) {
38381
38414
  var prices = results
38382
38415
  .map(function (r) {
@@ -38387,8 +38420,8 @@ var enrichFiltersWithResults = function (results, filters, tags) {
38387
38420
  return p > 0;
38388
38421
  });
38389
38422
  if (prices.length > 0) {
38390
- filter.min = Math.floor(Math.min.apply(Math, prices));
38391
- filter.max = Math.ceil(Math.max.apply(Math, prices));
38423
+ updatedFilter.min = Math.floor(Math.min.apply(Math, prices));
38424
+ updatedFilter.max = Math.ceil(Math.max.apply(Math, prices));
38392
38425
  }
38393
38426
  }
38394
38427
  if (filter.property === 'accommodation') {
@@ -38401,8 +38434,7 @@ var enrichFiltersWithResults = function (results, filters, tags) {
38401
38434
  });
38402
38435
  }
38403
38436
  });
38404
- console.log('map', map_1);
38405
- filter.options = Array.from(map_1.values()).map(function (accommodation) {
38437
+ updatedFilter.options = Array.from(map_1.values()).map(function (accommodation) {
38406
38438
  var _a;
38407
38439
  return {
38408
38440
  label: (_a = accommodation.name) !== null && _a !== void 0 ? _a : accommodation.code,
@@ -38421,7 +38453,7 @@ var enrichFiltersWithResults = function (results, filters, tags) {
38421
38453
  });
38422
38454
  }
38423
38455
  });
38424
- filter.options = Array.from(map_2.values()).map(function (regime) {
38456
+ updatedFilter.options = Array.from(map_2.values()).map(function (regime) {
38425
38457
  var _a;
38426
38458
  return {
38427
38459
  label: (_a = regime.name) !== null && _a !== void 0 ? _a : regime.code,
@@ -38445,7 +38477,7 @@ var enrichFiltersWithResults = function (results, filters, tags) {
38445
38477
  }
38446
38478
  });
38447
38479
  });
38448
- filter.options = Array.from(map_3.values()).map(function (theme) {
38480
+ updatedFilter.options = Array.from(map_3.values()).map(function (theme) {
38449
38481
  return {
38450
38482
  label: theme.name,
38451
38483
  value: theme.id,
@@ -38453,12 +38485,8 @@ var enrichFiltersWithResults = function (results, filters, tags) {
38453
38485
  };
38454
38486
  });
38455
38487
  }
38456
- };
38457
- for (var _i = 0, filters_1 = filters; _i < filters_1.length; _i++) {
38458
- var filter = filters_1[_i];
38459
- _loop_1(filter);
38460
- }
38461
- return filters;
38488
+ return updatedFilter;
38489
+ });
38462
38490
  };
38463
38491
 
38464
38492
  var ticksToMinutes = function (ticks) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qite/tide-booking-component",
3
- "version": "1.4.74",
3
+ "version": "1.4.75",
4
4
  "description": "React Booking wizard & Booking product component for Tide",
5
5
  "main": "build/build-cjs/index.js",
6
6
  "types": "build/build-cjs/src/index.d.ts",
@@ -29,7 +29,7 @@
29
29
  "devDependencies": {
30
30
  "@jsonurl/jsonurl": "^1.1.4",
31
31
  "@popperjs/core": "^2.10.2",
32
- "@qite/tide-client": "^1.1.144",
32
+ "@qite/tide-client": "^1.1.145",
33
33
  "@reduxjs/toolkit": "^2.8.2",
34
34
  "@rollup/plugin-commonjs": "^19.0.1",
35
35
  "@rollup/plugin-json": "^4.1.0",
@@ -6,12 +6,14 @@ export const enrichFiltersWithResults = (results: BookingPackageItem[], filters:
6
6
  return filters ?? [];
7
7
  }
8
8
 
9
- for (const filter of filters) {
9
+ return filters.map((filter) => {
10
+ let updatedFilter = { ...filter };
11
+
10
12
  if (filter.property === 'price' && (filter.min == null || filter.max == null)) {
11
13
  const prices = results.map((r) => r.price ?? 0).filter((p) => p > 0);
12
14
  if (prices.length > 0) {
13
- filter.min = Math.floor(Math.min(...prices));
14
- filter.max = Math.ceil(Math.max(...prices));
15
+ updatedFilter.min = Math.floor(Math.min(...prices));
16
+ updatedFilter.max = Math.ceil(Math.max(...prices));
15
17
  }
16
18
  }
17
19
 
@@ -27,9 +29,7 @@ export const enrichFiltersWithResults = (results: BookingPackageItem[], filters:
27
29
  }
28
30
  });
29
31
 
30
- console.log('map', map);
31
-
32
- filter.options = Array.from(map.values()).map((accommodation) => ({
32
+ updatedFilter.options = Array.from(map.values()).map((accommodation) => ({
33
33
  label: accommodation.name ?? accommodation.code,
34
34
  value: accommodation.code,
35
35
  isChecked: false
@@ -48,7 +48,7 @@ export const enrichFiltersWithResults = (results: BookingPackageItem[], filters:
48
48
  }
49
49
  });
50
50
 
51
- filter.options = Array.from(map.values()).map((regime) => ({
51
+ updatedFilter.options = Array.from(map.values()).map((regime) => ({
52
52
  label: regime.name ?? regime.code,
53
53
  value: regime.code,
54
54
  isChecked: false
@@ -67,13 +67,13 @@ export const enrichFiltersWithResults = (results: BookingPackageItem[], filters:
67
67
  });
68
68
  });
69
69
 
70
- filter.options = Array.from(map.values()).map((theme) => ({
70
+ updatedFilter.options = Array.from(map.values()).map((theme) => ({
71
71
  label: theme.name,
72
72
  value: theme.id,
73
73
  isChecked: false
74
74
  }));
75
75
  }
76
- }
77
76
 
78
- return filters;
77
+ return updatedFilter;
78
+ });
79
79
  };