@qite/tide-booking-component 1.3.0 → 1.3.2

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.
@@ -7608,6 +7608,7 @@ var changeEntryAgentSurcharge = function (config, request, signal) {
7608
7608
 
7609
7609
  var ENDPOINT$2 = "/api/web";
7610
7610
  var ENDPOINT_CREATE_CRM_CONTACT = ENDPOINT$2 + "/crmcontact";
7611
+ var ENDPOINT_CONTACT_FORM$1 = ENDPOINT$2 + "/contactform";
7611
7612
  var ENDPOINT_CREATE_AFFILIATES = ENDPOINT$2 + "/affiliates";
7612
7613
  var ENDPOINT_TRANSLATION_DICTIONARY = ENDPOINT$2 + "/translation-dictionary";
7613
7614
  var ENDPOINT_BOOKING_ACCOMMODATION = ENDPOINT$2 + "/booking-accommodation";
@@ -7625,6 +7626,20 @@ var createCrmContact = function (config, request, signal) {
7625
7626
  var body = JSON.stringify(request);
7626
7627
  return post(url, apiKey, body, config.token, signal);
7627
7628
  };
7629
+ /**
7630
+ * api/web/contactform
7631
+ * Sends a contact request mail
7632
+ * @param config
7633
+ * @param request
7634
+ * @param signal
7635
+ * @returns OK if succeeded.
7636
+ */
7637
+ var ContactForm = function (config, request, signal) {
7638
+ var url = "" + config.host + ENDPOINT_CONTACT_FORM$1;
7639
+ var apiKey = config.apiKey;
7640
+ var body = JSON.stringify(request);
7641
+ return post(url, apiKey, body, config.token, signal);
7642
+ };
7628
7643
  /**
7629
7644
  * api/web/affiliates
7630
7645
  * Gets all Affiliates
@@ -7706,6 +7721,7 @@ var feedXmlFolder = function (config, slug, folder, signal) {
7706
7721
 
7707
7722
  build.AllotmentType = AllotmentType;
7708
7723
  build.AvailabilitySearchType = AvailabilitySearchType;
7724
+ build.ContactForm = ContactForm;
7709
7725
  var Gender_1 = build.Gender = Gender;
7710
7726
  build.MetaDataType = MetaDataType;
7711
7727
  build.RequirementType = RequirementType;
@@ -7756,6 +7772,8 @@ build.update = update;
7756
7772
  var validateVoucher_1 = build.validateVoucher = validateVoucher;
7757
7773
 
7758
7774
  function buildTideClientConfig(settings) {
7775
+ console.log("buildTideClientConfig called with settings:", settings);
7776
+ console.log("process.env.REACT_APP_BOOKING_HOST:", process.env.REACT_APP_BOOKING_HOST);
7759
7777
  var HOST = (settings === null || settings === void 0 ? void 0 : settings.apiUrl) || process.env.REACT_APP_BOOKING_HOST;
7760
7778
  var API_KEY = (settings === null || settings === void 0 ? void 0 : settings.apiKey) || process.env.REACT_APP_BOOKING_API_KEY;
7761
7779
  var token = selectAgentToken();
@@ -9792,6 +9810,7 @@ var fetchDetails = function (request, signal, languageCode, apiSettings) { retur
9792
9810
  switch (_a.label) {
9793
9811
  case 0:
9794
9812
  tideClientConfig = buildTideClientConfig(apiSettings);
9813
+ console.log("tideClientConfig", tideClientConfig);
9795
9814
  return [4 /*yield*/, details_1(tideClientConfig, request, signal, languageCode)];
9796
9815
  case 1: return [2 /*return*/, _a.sent()];
9797
9816
  }
@@ -10376,6 +10395,7 @@ var fetchPackageDetails = toolkit.createAsyncThunk("booking/details", function (
10376
10395
  agentId = selectAgentId(state);
10377
10396
  rooms = selectBookingRooms(state);
10378
10397
  languageCode = selectLanguageCode(state);
10398
+ console.log("fetchPackageDetails");
10379
10399
  if (lodash.isNil(productAttributes)) {
10380
10400
  throw Error("productAttributes could not be found");
10381
10401
  }
@@ -10439,6 +10459,8 @@ var fetchPackageDetails = toolkit.createAsyncThunk("booking/details", function (
10439
10459
  returnFlight: returnFlight,
10440
10460
  },
10441
10461
  };
10462
+ console.log("fetchPackageDetails request", request);
10463
+ console.log("apiSettings", state.apiSettings);
10442
10464
  return [4 /*yield*/, packageApi.fetchDetails(request, signal, languageCode, state.apiSettings)];
10443
10465
  case 1: return [2 /*return*/, _c.sent()];
10444
10466
  }
@@ -14851,6 +14873,7 @@ var Booking = function (_a) {
14851
14873
  React.useEffect(function () {
14852
14874
  var _a;
14853
14875
  var params = new URLSearchParams(location.search);
14876
+ console.log("params", params);
14854
14877
  var startDate = getDateFromParams(params, "startDate");
14855
14878
  var endDate = getDateFromParams(params, "endDate");
14856
14879
  var catalog = getNumberFromParams(params, "catalog");
@@ -14890,10 +14913,15 @@ var Booking = function (_a) {
14890
14913
  }
14891
14914
  }, [location.search, setBookingAttributes, setBookingNumber, includeFlights]);
14892
14915
  React.useEffect(function () {
14916
+ console.log("isRetry", isRetry);
14917
+ console.log("productAttributes", productAttributes);
14918
+ console.log("bookingAttributes", bookingAttributes);
14919
+ console.log("bookingNumber", lodash.isNil(bookingNumber));
14893
14920
  if (!productAttributes ||
14894
14921
  !bookingAttributes ||
14895
14922
  !lodash.isNil(bookingNumber) ||
14896
14923
  !isRetry) {
14924
+ console.log("return on retry");
14897
14925
  return;
14898
14926
  }
14899
14927
  // Retried
@@ -14976,14 +15004,21 @@ var Booking = function (_a) {
14976
15004
  accommodationViewId,
14977
15005
  ]);
14978
15006
  React.useEffect(function () {
15007
+ console.log("productAttributes", productAttributes);
15008
+ console.log("bookingAttributes", bookingAttributes);
15009
+ console.log("rooms", rooms);
15010
+ console.log("bookingNumber", lodash.isNil(bookingNumber));
15011
+ console.log("packageDetails", lodash.isNil(packageDetails));
14979
15012
  if (!productAttributes ||
14980
15013
  !bookingAttributes ||
14981
15014
  !(rooms === null || rooms === void 0 ? void 0 : rooms.length) ||
14982
15015
  !lodash.isNil(bookingNumber) ||
14983
15016
  !lodash.isNil(packageDetails)) {
15017
+ console.log("return on booking attributes change");
14984
15018
  return;
14985
15019
  }
14986
15020
  // Fetch data
15021
+ console.log("fetching package with attributes");
14987
15022
  var promise = dispatch(fetchPackage());
14988
15023
  return function () {
14989
15024
  promise.abort();
@@ -15024,6 +15059,7 @@ var Booking = function (_a) {
15024
15059
 
15025
15060
  var BookingWizard = function (_a) {
15026
15061
  var productCode = _a.productCode, productName = _a.productName, thumbnailUrl = _a.thumbnailUrl, settings = _a.settings;
15062
+ console.log("BookingWizard rendered with settings:", settings);
15027
15063
  return (React__default["default"].createElement(SettingsContext.Provider, { value: settings },
15028
15064
  React__default["default"].createElement(reactRedux.Provider, { store: store },
15029
15065
  React__default["default"].createElement(Booking, { productCode: productCode, productName: productName, thumbnailUrl: thumbnailUrl }))));
@@ -7597,6 +7597,7 @@ var changeEntryAgentSurcharge = function (config, request, signal) {
7597
7597
 
7598
7598
  var ENDPOINT$2 = "/api/web";
7599
7599
  var ENDPOINT_CREATE_CRM_CONTACT = ENDPOINT$2 + "/crmcontact";
7600
+ var ENDPOINT_CONTACT_FORM$1 = ENDPOINT$2 + "/contactform";
7600
7601
  var ENDPOINT_CREATE_AFFILIATES = ENDPOINT$2 + "/affiliates";
7601
7602
  var ENDPOINT_TRANSLATION_DICTIONARY = ENDPOINT$2 + "/translation-dictionary";
7602
7603
  var ENDPOINT_BOOKING_ACCOMMODATION = ENDPOINT$2 + "/booking-accommodation";
@@ -7614,6 +7615,20 @@ var createCrmContact = function (config, request, signal) {
7614
7615
  var body = JSON.stringify(request);
7615
7616
  return post(url, apiKey, body, config.token, signal);
7616
7617
  };
7618
+ /**
7619
+ * api/web/contactform
7620
+ * Sends a contact request mail
7621
+ * @param config
7622
+ * @param request
7623
+ * @param signal
7624
+ * @returns OK if succeeded.
7625
+ */
7626
+ var ContactForm = function (config, request, signal) {
7627
+ var url = "" + config.host + ENDPOINT_CONTACT_FORM$1;
7628
+ var apiKey = config.apiKey;
7629
+ var body = JSON.stringify(request);
7630
+ return post(url, apiKey, body, config.token, signal);
7631
+ };
7617
7632
  /**
7618
7633
  * api/web/affiliates
7619
7634
  * Gets all Affiliates
@@ -7695,6 +7710,7 @@ var feedXmlFolder = function (config, slug, folder, signal) {
7695
7710
 
7696
7711
  build.AllotmentType = AllotmentType;
7697
7712
  build.AvailabilitySearchType = AvailabilitySearchType;
7713
+ build.ContactForm = ContactForm;
7698
7714
  var Gender_1 = build.Gender = Gender;
7699
7715
  build.MetaDataType = MetaDataType;
7700
7716
  build.RequirementType = RequirementType;
@@ -7745,6 +7761,8 @@ build.update = update;
7745
7761
  var validateVoucher_1 = build.validateVoucher = validateVoucher;
7746
7762
 
7747
7763
  function buildTideClientConfig(settings) {
7764
+ console.log("buildTideClientConfig called with settings:", settings);
7765
+ console.log("process.env.REACT_APP_BOOKING_HOST:", process.env.REACT_APP_BOOKING_HOST);
7748
7766
  var HOST = (settings === null || settings === void 0 ? void 0 : settings.apiUrl) || process.env.REACT_APP_BOOKING_HOST;
7749
7767
  var API_KEY = (settings === null || settings === void 0 ? void 0 : settings.apiKey) || process.env.REACT_APP_BOOKING_API_KEY;
7750
7768
  var token = selectAgentToken();
@@ -9781,6 +9799,7 @@ var fetchDetails = function (request, signal, languageCode, apiSettings) { retur
9781
9799
  switch (_a.label) {
9782
9800
  case 0:
9783
9801
  tideClientConfig = buildTideClientConfig(apiSettings);
9802
+ console.log("tideClientConfig", tideClientConfig);
9784
9803
  return [4 /*yield*/, details_1(tideClientConfig, request, signal, languageCode)];
9785
9804
  case 1: return [2 /*return*/, _a.sent()];
9786
9805
  }
@@ -10365,6 +10384,7 @@ var fetchPackageDetails = createAsyncThunk("booking/details", function (_, _a) {
10365
10384
  agentId = selectAgentId(state);
10366
10385
  rooms = selectBookingRooms(state);
10367
10386
  languageCode = selectLanguageCode(state);
10387
+ console.log("fetchPackageDetails");
10368
10388
  if (isNil(productAttributes)) {
10369
10389
  throw Error("productAttributes could not be found");
10370
10390
  }
@@ -10428,6 +10448,8 @@ var fetchPackageDetails = createAsyncThunk("booking/details", function (_, _a) {
10428
10448
  returnFlight: returnFlight,
10429
10449
  },
10430
10450
  };
10451
+ console.log("fetchPackageDetails request", request);
10452
+ console.log("apiSettings", state.apiSettings);
10431
10453
  return [4 /*yield*/, packageApi.fetchDetails(request, signal, languageCode, state.apiSettings)];
10432
10454
  case 1: return [2 /*return*/, _c.sent()];
10433
10455
  }
@@ -14840,6 +14862,7 @@ var Booking = function (_a) {
14840
14862
  useEffect(function () {
14841
14863
  var _a;
14842
14864
  var params = new URLSearchParams(location.search);
14865
+ console.log("params", params);
14843
14866
  var startDate = getDateFromParams(params, "startDate");
14844
14867
  var endDate = getDateFromParams(params, "endDate");
14845
14868
  var catalog = getNumberFromParams(params, "catalog");
@@ -14879,10 +14902,15 @@ var Booking = function (_a) {
14879
14902
  }
14880
14903
  }, [location.search, setBookingAttributes, setBookingNumber, includeFlights]);
14881
14904
  useEffect(function () {
14905
+ console.log("isRetry", isRetry);
14906
+ console.log("productAttributes", productAttributes);
14907
+ console.log("bookingAttributes", bookingAttributes);
14908
+ console.log("bookingNumber", isNil(bookingNumber));
14882
14909
  if (!productAttributes ||
14883
14910
  !bookingAttributes ||
14884
14911
  !isNil(bookingNumber) ||
14885
14912
  !isRetry) {
14913
+ console.log("return on retry");
14886
14914
  return;
14887
14915
  }
14888
14916
  // Retried
@@ -14965,14 +14993,21 @@ var Booking = function (_a) {
14965
14993
  accommodationViewId,
14966
14994
  ]);
14967
14995
  useEffect(function () {
14996
+ console.log("productAttributes", productAttributes);
14997
+ console.log("bookingAttributes", bookingAttributes);
14998
+ console.log("rooms", rooms);
14999
+ console.log("bookingNumber", isNil(bookingNumber));
15000
+ console.log("packageDetails", isNil(packageDetails));
14968
15001
  if (!productAttributes ||
14969
15002
  !bookingAttributes ||
14970
15003
  !(rooms === null || rooms === void 0 ? void 0 : rooms.length) ||
14971
15004
  !isNil(bookingNumber) ||
14972
15005
  !isNil(packageDetails)) {
15006
+ console.log("return on booking attributes change");
14973
15007
  return;
14974
15008
  }
14975
15009
  // Fetch data
15010
+ console.log("fetching package with attributes");
14976
15011
  var promise = dispatch(fetchPackage());
14977
15012
  return function () {
14978
15013
  promise.abort();
@@ -15013,6 +15048,7 @@ var Booking = function (_a) {
15013
15048
 
15014
15049
  var BookingWizard = function (_a) {
15015
15050
  var productCode = _a.productCode, productName = _a.productName, thumbnailUrl = _a.thumbnailUrl, settings = _a.settings;
15051
+ console.log("BookingWizard rendered with settings:", settings);
15016
15052
  return (React.createElement(SettingsContext.Provider, { value: settings },
15017
15053
  React.createElement(Provider, { store: store },
15018
15054
  React.createElement(Booking, { productCode: productCode, productName: productName, thumbnailUrl: thumbnailUrl }))));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qite/tide-booking-component",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "React Booking wizard & Booking product component for Tide",
5
5
  "main": "build/build-cjs/index.js",
6
6
  "module": "build/build-esm/index.js",
@@ -125,6 +125,10 @@ const BookingSelfContained: React.FC<BookingProps> = ({
125
125
  const rooms = getRoomsFromParams(params, "rooms");
126
126
  const flight = getFlightsFromParams(params, "flight");
127
127
  const flightRouteId = getStringFromParams(params, "flightRouteId");
128
+ const vendorConfigurationId = getNumberFromParams(
129
+ params,
130
+ "vendorConfigurationId"
131
+ );
128
132
  const allotmentName = getStringFromParams(params, "allotmentName");
129
133
  const allotmentIds = getNumbersFromParams(params, "allotmentId");
130
134
  const tourCode = getStringFromParams(params, "tourCode");
@@ -161,6 +165,7 @@ const BookingSelfContained: React.FC<BookingProps> = ({
161
165
  allotmentIds,
162
166
  tourCode,
163
167
  flightRouteId,
168
+ vendorConfigurationId,
164
169
  })
165
170
  );
166
171
  } else {
@@ -210,6 +210,7 @@ const fetchPackageDetails = createAsyncThunk(
210
210
  routeId: bookingAttributes.flightRouteId,
211
211
  outwardFlight: outwardFlight,
212
212
  returnFlight: returnFlight,
213
+ vendorConfigurationId: bookingAttributes.vendorConfigurationId,
213
214
  } as BookingPackageDetailsRequest,
214
215
  } as BookingPackageRequest<BookingPackageDetailsRequest>;
215
216
 
@@ -112,6 +112,10 @@ const Booking: React.FC<BookingProps> = ({
112
112
  const rooms = getRoomsFromParams(params, "rooms");
113
113
  const flight = getFlightsFromParams(params, "flight");
114
114
  const flightRouteId = getStringFromParams(params, "flightRouteId");
115
+ const vendorConfigurationId = getNumberFromParams(
116
+ params,
117
+ "vendorConfigurationId"
118
+ );
115
119
  const allotmentName = getStringFromParams(params, "allotmentName");
116
120
  const allotmentIds = getNumbersFromParams(params, "allotmentId");
117
121
  const tourCode = getStringFromParams(params, "tourCode");
@@ -146,6 +150,7 @@ const Booking: React.FC<BookingProps> = ({
146
150
  allotmentIds,
147
151
  tourCode,
148
152
  flightRouteId,
153
+ vendorConfigurationId,
149
154
  })
150
155
  );
151
156
  } else {
@@ -17,11 +17,9 @@ const SettingsContext = React.createContext<WizardSettingsContextProps>({
17
17
  basePath: "/boeken",
18
18
  roomOptions: {
19
19
  pathSuffix: "/",
20
- reportPrintActionId: null,
21
20
  },
22
21
  flightOptions: {
23
22
  pathSuffix: "/vluchten",
24
- reportPrintActionId: null,
25
23
  },
26
24
  options: {
27
25
  pathSuffix: "/opties",
@@ -29,16 +27,13 @@ const SettingsContext = React.createContext<WizardSettingsContextProps>({
29
27
  },
30
28
  travellers: {
31
29
  pathSuffix: "/reizigers",
32
- reportPrintActionId: null,
33
30
  },
34
31
  summary: {
35
32
  pathSuffix: "/samenvatting",
36
33
  checkboxes: null,
37
- reportPrintActionId: null,
38
34
  },
39
35
  confirmation: {
40
36
  pathSuffix: "/bevestiging",
41
- reportPrintActionId: null,
42
37
  },
43
38
  error: {
44
39
  pathSuffix: "/mislukt",
@@ -2,19 +2,17 @@ import { BookingPackageFlight } from "@qite/tide-client/build/types";
2
2
 
3
3
  export interface Settings {
4
4
  officeId: number;
5
- token?: string ;
5
+ token?: string;
6
6
  bookingOptions: BookingOptions;
7
7
  productPath: string;
8
8
  basePath: string;
9
9
  roomOptions: {
10
10
  isHidden?: boolean | null;
11
11
  pathSuffix?: string | null;
12
- reportPrintActionId?: number | null;
13
12
  };
14
13
  flightOptions: {
15
14
  isHidden?: boolean | null;
16
15
  pathSuffix?: string | null;
17
- reportPrintActionId?: number | null;
18
16
  };
19
17
  options: {
20
18
  pathSuffix: string;
@@ -22,16 +20,13 @@ export interface Settings {
22
20
  };
23
21
  travellers: {
24
22
  pathSuffix: string;
25
- reportPrintActionId?: number | null;
26
23
  };
27
24
  summary: {
28
25
  pathSuffix: string;
29
26
  checkboxes?: SummaryCheckbox[] | null;
30
- reportPrintActionId?: number | null;
31
27
  };
32
28
  confirmation: {
33
29
  pathSuffix: string;
34
- reportPrintActionId?: number | null;
35
30
  };
36
31
  error: {
37
32
  pathSuffix: string;
@@ -154,6 +149,7 @@ export interface BookingAttributes {
154
149
  allotmentIds: number[];
155
150
  includeFlights?: boolean;
156
151
  flightRouteId?: string | null;
152
+ vendorConfigurationId?: number | null;
157
153
  }
158
154
 
159
155
  export interface FlightLine {