@qite/tide-client 1.1.183 → 1.1.184

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/build/index.js CHANGED
@@ -155,16 +155,6 @@ var MetaDataType = {
155
155
  additionalServices: 7,
156
156
  };
157
157
 
158
- exports.NoteType = void 0;
159
- (function (NoteType) {
160
- NoteType[(NoteType["notification"] = 0)] = "notification";
161
- NoteType[(NoteType["task"] = 1)] = "task";
162
- NoteType[(NoteType["calendar"] = 2)] = "calendar";
163
- NoteType[(NoteType["callLog"] = 3)] = "callLog";
164
- NoteType[(NoteType["opportunity"] = 4)] = "opportunity";
165
- NoteType[(NoteType["email"] = 5)] = "email";
166
- })(exports.NoteType || (exports.NoteType = {}));
167
-
168
158
  var PaymentType = {
169
159
  other: 0,
170
160
  bancontact: 1,
@@ -306,48 +296,6 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
306
296
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
307
297
  PERFORMANCE OF THIS SOFTWARE.
308
298
  ***************************************************************************** */
309
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
310
-
311
- var extendStatics = function (d, b) {
312
- extendStatics =
313
- Object.setPrototypeOf ||
314
- ({ __proto__: [] } instanceof Array &&
315
- function (d, b) {
316
- d.__proto__ = b;
317
- }) ||
318
- function (d, b) {
319
- for (var p in b)
320
- if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
321
- };
322
- return extendStatics(d, b);
323
- };
324
-
325
- function __extends(d, b) {
326
- if (typeof b !== "function" && b !== null)
327
- throw new TypeError(
328
- "Class extends value " + String(b) + " is not a constructor or null"
329
- );
330
- extendStatics(d, b);
331
- function __() {
332
- this.constructor = d;
333
- }
334
- d.prototype =
335
- b === null ? Object.create(b) : ((__.prototype = b.prototype), new __());
336
- }
337
-
338
- var __assign = function () {
339
- __assign =
340
- Object.assign ||
341
- function __assign(t) {
342
- for (var s, i = 1, n = arguments.length; i < n; i++) {
343
- s = arguments[i];
344
- for (var p in s)
345
- if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
346
- }
347
- return t;
348
- };
349
- return __assign.apply(this, arguments);
350
- };
351
299
 
352
300
  function __awaiter(thisArg, _arguments, P, generator) {
353
301
  function adopt(value) {
@@ -496,300 +444,91 @@ typeof SuppressedError === "function"
496
444
  );
497
445
  };
498
446
 
499
- var SERVICE_TOKEN_ENDPOINT = "/api/auth/service-token";
500
- var STORAGE_KEY_PREFIX = "tide-client:service-token:";
501
- var EXPIRY_SAFETY_MARGIN_MS = 30000;
502
- var ServiceTokenError = /** @class */ (function (_super) {
503
- __extends(ServiceTokenError, _super);
504
- function ServiceTokenError(status) {
505
- var _this =
506
- _super.call(
507
- this,
508
- "Failed to obtain Tide service token (HTTP " + status + ")"
509
- ) || this;
510
- // Restores the prototype chain - required for `instanceof` to work when
511
- // extending a built-in like Error under an ES5 compilation target.
512
- Object.setPrototypeOf(_this, ServiceTokenError.prototype);
513
- _this.name = "ServiceTokenError";
514
- _this.status = status;
515
- return _this;
516
- }
517
- return ServiceTokenError;
518
- })(Error);
519
- // Disambiguates by host+apiKey - a single page can embed multiple
520
- // configs/tenants at once. JSON.stringify of the pair is injective over
521
- // arbitrary string content, so there's no delimiter-collision risk.
522
- var buildCacheKey = function (host, apiKey) {
523
- return JSON.stringify([host, apiKey]);
524
- };
525
- var buildStorageKey = function (cacheKey) {
526
- return "" + STORAGE_KEY_PREFIX + cacheKey;
527
- };
528
- // De-dupes concurrent refreshes for the same host+apiKey so parallel
529
- // requests await one exchange instead of each firing their own.
530
- var inFlightExchanges = new Map();
531
- var readStorageValue = function (storageKey) {
532
- try {
533
- if (typeof sessionStorage !== "undefined") {
534
- var value = sessionStorage.getItem(storageKey);
535
- if (value !== null) {
536
- return value;
537
- }
538
- }
539
- } catch (_a) {
540
- // sessionStorage may be disabled/inaccessible - fall through to localStorage
541
- }
542
- try {
543
- if (typeof localStorage !== "undefined") {
544
- return localStorage.getItem(storageKey);
545
- }
546
- } catch (_b) {
547
- // caching is best-effort only
548
- }
549
- return null;
550
- };
551
- var writeStorageValue = function (storageKey, value) {
552
- try {
553
- if (typeof sessionStorage !== "undefined") {
554
- sessionStorage.setItem(storageKey, value);
555
- return;
556
- }
557
- } catch (_a) {
558
- // fall through to localStorage
559
- }
560
- try {
561
- if (typeof localStorage !== "undefined") {
562
- localStorage.setItem(storageKey, value);
563
- }
564
- } catch (_b) {
565
- // caching is best-effort only - a failed write just means more exchanges
566
- }
567
- };
568
- var removeStorageValue = function (storageKey) {
569
- try {
570
- if (typeof sessionStorage !== "undefined") {
571
- sessionStorage.removeItem(storageKey);
572
- }
573
- } catch (_a) {
574
- // best-effort
575
- }
576
- try {
577
- if (typeof localStorage !== "undefined") {
578
- localStorage.removeItem(storageKey);
579
- }
580
- } catch (_b) {
581
- // best-effort
582
- }
583
- };
584
- var readCache = function (storageKey) {
585
- var raw = readStorageValue(storageKey);
586
- if (!raw) {
587
- return undefined;
588
- }
589
- try {
590
- var parsed = JSON.parse(raw);
591
- if (
592
- parsed &&
593
- typeof parsed.accessToken === "string" &&
594
- typeof parsed.expiresAt === "number"
595
- ) {
596
- return parsed;
597
- }
598
- } catch (_a) {
599
- // corrupt/foreign entry - treat as a cache miss
600
- }
601
- return undefined;
602
- };
603
- var isValid = function (info) {
604
- return (
605
- info !== undefined && info.expiresAt - EXPIRY_SAFETY_MARGIN_MS > Date.now()
606
- );
607
- };
608
- var exchangeToken = function (host, apiKey) {
447
+ var post$1 = function (url, apiKey, body, token, signal, languageCode) {
609
448
  return __awaiter(void 0, void 0, void 0, function () {
610
- var response, body, _a, _b;
611
- return __generator(this, function (_c) {
612
- switch (_c.label) {
449
+ var response;
450
+ return __generator(this, function (_a) {
451
+ switch (_a.label) {
613
452
  case 0:
614
453
  return [
615
454
  4 /*yield*/,
616
- fetch("" + host + SERVICE_TOKEN_ENDPOINT, {
455
+ fetch(url, {
617
456
  method: "POST",
618
- headers: { "Content-Type": "application/json" },
457
+ headers: {
458
+ "Content-Type": "application/json",
459
+ "Api-Key": apiKey,
460
+ Language: languageCode || "nl-BE",
461
+ Authorization: token ? "Bearer " + token : "",
462
+ },
619
463
  credentials: "include",
620
- body: JSON.stringify({ apiKey: apiKey }),
464
+ body: body,
465
+ signal: signal,
621
466
  }),
622
467
  ];
623
468
  case 1:
624
- response = _c.sent();
469
+ response = _a.sent();
625
470
  if (!response.ok) {
626
- throw new ServiceTokenError(response.status);
471
+ throw new Error(response.statusText);
627
472
  }
628
- _b = (_a = JSON).parse;
629
- return [4 /*yield*/, response.text()];
630
- case 2:
631
- body = _b.apply(_a, [_c.sent()]);
632
- return [
633
- 2 /*return*/,
634
- { accessToken: body.access_token, expiresAt: body.expires_at },
635
- ];
473
+ return [2 /*return*/, response];
636
474
  }
637
475
  });
638
476
  });
639
477
  };
640
- /**
641
- * Returns a valid, unexpired service access token for the given host+apiKey,
642
- * exchanging (and caching) a new one if there's no valid cached token.
643
- * Concurrent callers for the same host+apiKey share a single in-flight
644
- * exchange instead of each triggering their own.
645
- */
646
- var getServiceToken = function (host, apiKey, forceRefresh) {
647
- if (forceRefresh === void 0) {
648
- forceRefresh = false;
649
- }
478
+ var patch$1 = function (url, apiKey, body, token, signal, languageCode) {
650
479
  return __awaiter(void 0, void 0, void 0, function () {
651
- var cacheKey, storageKey, cached, inFlight, info;
480
+ var response;
652
481
  return __generator(this, function (_a) {
653
482
  switch (_a.label) {
654
483
  case 0:
655
- cacheKey = buildCacheKey(host, apiKey);
656
- storageKey = buildStorageKey(cacheKey);
657
- if (!forceRefresh) {
658
- cached = readCache(storageKey);
659
- if (isValid(cached)) {
660
- return [2 /*return*/, cached.accessToken];
661
- }
662
- }
663
- inFlight = inFlightExchanges.get(cacheKey);
664
- if (!inFlight) {
665
- inFlight = exchangeToken(host, apiKey).then(
666
- function (info) {
667
- inFlightExchanges.delete(cacheKey);
668
- writeStorageValue(storageKey, JSON.stringify(info));
669
- return info;
484
+ return [
485
+ 4 /*yield*/,
486
+ fetch(url, {
487
+ method: "PATCH",
488
+ headers: {
489
+ "Content-Type": "application/json",
490
+ "Api-Key": apiKey,
491
+ Language: languageCode || "nl-BE",
492
+ Authorization: token ? "Bearer " + token : "",
670
493
  },
671
- function (error) {
672
- inFlightExchanges.delete(cacheKey);
673
- throw error;
674
- }
675
- );
676
- inFlightExchanges.set(cacheKey, inFlight);
677
- }
678
- return [4 /*yield*/, inFlight];
494
+ credentials: "include",
495
+ body: body,
496
+ signal: signal,
497
+ }),
498
+ ];
679
499
  case 1:
680
- info = _a.sent();
681
- return [2 /*return*/, info.accessToken];
500
+ response = _a.sent();
501
+ if (!response.ok) {
502
+ throw new Error(response.statusText);
503
+ }
504
+ return [2 /*return*/, response];
682
505
  }
683
506
  });
684
507
  });
685
508
  };
686
- /**
687
- * Clears the cached service token for a given host+apiKey. Useful for
688
- * manual invalidation (e.g. a runtime key rotation) and test isolation.
689
- */
690
- var clearServiceTokenCache = function (host, apiKey) {
691
- removeStorageValue(buildStorageKey(buildCacheKey(host, apiKey)));
692
- };
693
-
694
- var buildAuthorizationHeader = function (
695
- url,
696
- apiKey,
697
- token,
698
- forceServiceTokenRefresh
699
- ) {
509
+ var get$1 = function (url, apiKey, token, signal, languageCode) {
700
510
  return __awaiter(void 0, void 0, void 0, function () {
701
- var host, accessToken;
511
+ var response;
702
512
  return __generator(this, function (_a) {
703
513
  switch (_a.label) {
704
514
  case 0:
705
- // A logged-in customer's own token always takes exclusive precedence -
706
- // it is never combined with the service access token on one request.
707
- if (token) {
708
- return [2 /*return*/, "Bearer " + token];
709
- }
710
- host = new URL(url).origin;
711
515
  return [
712
516
  4 /*yield*/,
713
- getServiceToken(host, apiKey, forceServiceTokenRefresh),
517
+ fetch(url, {
518
+ method: "GET",
519
+ headers: {
520
+ "Content-Type": "application/json",
521
+ "Api-Key": apiKey,
522
+ Language: languageCode || "nl-BE",
523
+ "Accept-Language": languageCode || "nl-BE",
524
+ Authorization: token ? "Bearer " + token : "",
525
+ },
526
+ credentials: "include",
527
+ signal: signal,
528
+ }),
714
529
  ];
715
530
  case 1:
716
- accessToken = _a.sent();
717
- return [2 /*return*/, "Bearer " + accessToken];
718
- }
719
- });
720
- });
721
- };
722
- var doRequest = function (
723
- method,
724
- url,
725
- apiKey,
726
- body,
727
- token,
728
- signal,
729
- languageCode,
730
- extraHeaders
731
- ) {
732
- return __awaiter(void 0, void 0, void 0, function () {
733
- var usingServiceToken, attempt, response;
734
- return __generator(this, function (_a) {
735
- switch (_a.label) {
736
- case 0:
737
- usingServiceToken = !token;
738
- attempt = function (forceRefresh) {
739
- return __awaiter(void 0, void 0, void 0, function () {
740
- var authorization;
741
- return __generator(this, function (_a) {
742
- switch (_a.label) {
743
- case 0:
744
- return [
745
- 4 /*yield*/,
746
- buildAuthorizationHeader(
747
- url,
748
- apiKey,
749
- token,
750
- forceRefresh
751
- ),
752
- ];
753
- case 1:
754
- authorization = _a.sent();
755
- return [
756
- 2 /*return*/,
757
- fetch(
758
- url,
759
- __assign(
760
- __assign(
761
- {
762
- method: method,
763
- headers: __assign(
764
- {
765
- "Content-Type": "application/json",
766
- Language: languageCode || "nl-BE",
767
- Authorization: authorization,
768
- },
769
- extraHeaders
770
- ),
771
- credentials: "include",
772
- },
773
- method === "GET" ? {} : { body: body }
774
- ),
775
- { signal: signal }
776
- )
777
- ),
778
- ];
779
- }
780
- });
781
- });
782
- };
783
- return [4 /*yield*/, attempt(false)];
784
- case 1:
785
- response = _a.sent();
786
- if (!(response.status === 401 && usingServiceToken))
787
- return [3 /*break*/, 3];
788
- return [4 /*yield*/, attempt(true)];
789
- case 2:
790
531
  response = _a.sent();
791
- _a.label = 3;
792
- case 3:
793
532
  if (!response.ok) {
794
533
  throw new Error(response.statusText);
795
534
  }
@@ -798,17 +537,6 @@ var doRequest = function (
798
537
  });
799
538
  });
800
539
  };
801
- var post$1 = function (url, apiKey, body, token, signal, languageCode) {
802
- return doRequest("POST", url, apiKey, body, token, signal, languageCode, {});
803
- };
804
- var patch$1 = function (url, apiKey, body, token, signal, languageCode) {
805
- return doRequest("PATCH", url, apiKey, body, token, signal, languageCode, {});
806
- };
807
- var get$1 = function (url, apiKey, token, signal, languageCode) {
808
- return doRequest("GET", url, apiKey, undefined, token, signal, languageCode, {
809
- "Accept-Language": languageCode || "nl-BE",
810
- });
811
- };
812
540
 
813
541
  var commonjsGlobal =
814
542
  typeof globalThis !== "undefined"
@@ -6588,71 +6316,58 @@ var get = function (url, apiKey, token, signal, skipReviver, languageCode) {
6588
6316
  });
6589
6317
  };
6590
6318
 
6591
- var ENDPOINT$a = "/api/web/booking/v2";
6592
- var ENDPOINT_AVAILABLE_FLIGHTS = ENDPOINT$a + "/available-flights";
6593
- var ENDPOINT_TRANSPORT_DATES = ENDPOINT$a + "/transport-dates";
6594
- var ENDPOINT_PRICES = ENDPOINT$a + "/prices";
6595
- var ENDPOINT_AVAILABLE_COUNTRIES = ENDPOINT$a + "/available-countries";
6596
- var ENDPOINT_SEARCH = ENDPOINT$a + "/search";
6319
+ var ENDPOINT$9 = "/api/web/booking/v2";
6320
+ var ENDPOINT_AVAILABLE_FLIGHTS = ENDPOINT$9 + "/available-flights";
6321
+ var ENDPOINT_TRANSPORT_DATES = ENDPOINT$9 + "/transport-dates";
6322
+ var ENDPOINT_PRICES = ENDPOINT$9 + "/prices";
6323
+ var ENDPOINT_AVAILABLE_COUNTRIES = ENDPOINT$9 + "/available-countries";
6324
+ var ENDPOINT_SEARCH = ENDPOINT$9 + "/search";
6597
6325
  var ENDPOINT_SEARCH_WITH_ERROR_MAPPING =
6598
- ENDPOINT$a + "/search-with-error-mapping";
6326
+ ENDPOINT$9 + "/search-with-error-mapping";
6599
6327
  // const ENDPOINT_ELASTIC = `${ENDPOINT}/elastic`; // TODO
6600
- var ENDPOINT_DETAILS = ENDPOINT$a + "/details";
6601
- var ENDPOINT_DETAILS_WL = ENDPOINT$a + "/details-wl";
6328
+ var ENDPOINT_DETAILS = ENDPOINT$9 + "/details";
6329
+ var ENDPOINT_DETAILS_WL = ENDPOINT$9 + "/details-wl";
6602
6330
  var ENDPOINT_ENTRYLIGHT = function (code) {
6603
- return ENDPOINT$a + "/entry-light/" + code;
6331
+ return ENDPOINT$9 + "/entry-light/" + code;
6604
6332
  };
6605
- var ENDPOINT_VALIDATE_VOUCHER = ENDPOINT$a + "/validate-voucher";
6333
+ var ENDPOINT_VALIDATE_VOUCHER = ENDPOINT$9 + "/validate-voucher";
6606
6334
  var ENDPOINT_ALTERNATE_HOTELS = function (transactionId, optionId) {
6607
6335
  return (
6608
- ENDPOINT$a + "/details/" + transactionId + "/alternate-hotels/" + optionId
6336
+ ENDPOINT$9 + "/details/" + transactionId + "/alternate-hotels/" + optionId
6609
6337
  );
6610
6338
  };
6611
6339
  var ENDPOINT_ALTERNATE_FLIGHTS = function (transactionId) {
6612
- return ENDPOINT$a + "/details/" + transactionId + "/alternate-flights";
6340
+ return ENDPOINT$9 + "/details/" + transactionId + "/alternate-flights";
6613
6341
  };
6614
- var ENDPOINT_BOOKABLE_DATES = ENDPOINT$a + "/bookable-dates";
6615
- var ENDPOINT_PRICE_DETAILS$1 = ENDPOINT$a + "/price-details";
6616
- var ENDPOINT_BOOK$1 = ENDPOINT$a + "/book";
6617
- var ENDPOINT_UPDATE = ENDPOINT$a + "/update";
6618
- var ENDPOINT_AGENTS = ENDPOINT$a + "/agents";
6342
+ var ENDPOINT_BOOKABLE_DATES = ENDPOINT$9 + "/bookable-dates";
6343
+ var ENDPOINT_PRICE_DETAILS$1 = ENDPOINT$9 + "/price-details";
6344
+ var ENDPOINT_BOOK$1 = ENDPOINT$9 + "/book";
6345
+ var ENDPOINT_UPDATE = ENDPOINT$9 + "/update";
6346
+ var ENDPOINT_AGENTS = ENDPOINT$9 + "/agents";
6619
6347
  var ENDPOINT_AVAILABLE_ALLOTMENTS = function (eventId, productCode) {
6620
6348
  return (
6621
- ENDPOINT$a + "/get-allotment-availability/" + eventId + "/" + productCode
6349
+ ENDPOINT$9 + "/get-allotment-availability/" + eventId + "/" + productCode
6622
6350
  );
6623
6351
  };
6624
- var ENDPOINT_FLIGHT_POOL = ENDPOINT$a + "/flight-pool";
6625
- var ENDPOINT_TOUR_CODES = ENDPOINT$a + "/tourcodes";
6352
+ var ENDPOINT_FLIGHT_POOL = ENDPOINT$9 + "/flight-pool";
6353
+ var ENDPOINT_TOUR_CODES = ENDPOINT$9 + "/tourcodes";
6626
6354
  var ENDPOINT_CUSTOM_ENTRY_STATUS$1 = function (
6627
6355
  dossierNumber,
6628
6356
  customEntryStatusId
6629
6357
  ) {
6630
6358
  return (
6631
- ENDPOINT$a +
6359
+ ENDPOINT$9 +
6632
6360
  "/custom-entry-status/" +
6633
6361
  dossierNumber +
6634
6362
  "/" +
6635
6363
  customEntryStatusId
6636
6364
  );
6637
6365
  };
6638
- var ENDPOINT_ENTRY_STATUS = function (
6639
- dossierNumber,
6640
- entryStatus,
6641
- customEntryStatusId
6642
- ) {
6643
- return (
6644
- ENDPOINT$a +
6645
- "/entry-status/" +
6646
- dossierNumber +
6647
- "/" +
6648
- entryStatus +
6649
- (customEntryStatusId !== undefined
6650
- ? "?customEntryStatusId=" + customEntryStatusId
6651
- : "")
6652
- );
6366
+ var ENDPOINT_ENTRY_STATUS = function (dossierNumber, entryStatus) {
6367
+ return ENDPOINT$9 + "/entry-status/" + dossierNumber + "/" + entryStatus;
6653
6368
  };
6654
- var ENDPOINT_ELASTIC = ENDPOINT$a + "/elastic";
6655
- var ENDPOINT_FLIGHT_LINES = ENDPOINT$a + "/flightlines";
6369
+ var ENDPOINT_ELASTIC = ENDPOINT$9 + "/elastic";
6370
+ var ENDPOINT_FLIGHT_LINES = ENDPOINT$9 + "/flightlines";
6656
6371
  var availableFlights = function (config, request, signal) {
6657
6372
  var url = "" + config.host + ENDPOINT_AVAILABLE_FLIGHTS;
6658
6373
  var apiKey = config.apiKey;
@@ -6790,17 +6505,9 @@ var setCustomEntryStatus = function (
6790
6505
  var apiKey = config.apiKey;
6791
6506
  return patch(url, apiKey, null, config.token, signal, true);
6792
6507
  };
6793
- var setEntryStatus = function (
6794
- config,
6795
- dossierNumber,
6796
- entryStatus,
6797
- customEntryStatusId,
6798
- signal
6799
- ) {
6508
+ var setEntryStatus = function (config, dossierNumber, entryStatus, signal) {
6800
6509
  var url =
6801
- "" +
6802
- config.host +
6803
- ENDPOINT_ENTRY_STATUS(dossierNumber, entryStatus, customEntryStatusId);
6510
+ "" + config.host + ENDPOINT_ENTRY_STATUS(dossierNumber, entryStatus);
6804
6511
  var apiKey = config.apiKey;
6805
6512
  return patch(url, apiKey, null, config.token, signal, true);
6806
6513
  };
@@ -6811,12 +6518,12 @@ var flightLines = function (config, request, signal) {
6811
6518
  return post(url, apiKey, body, config.token, signal, true);
6812
6519
  };
6813
6520
 
6814
- var ENDPOINT$9 = "/api/member";
6815
- var ENDPOINT_LOGIN = ENDPOINT$9 + "/login";
6816
- var ENDPOINT_LOGOUT = ENDPOINT$9 + "/logout";
6817
- var ENDPOINT_CONFIRM = ENDPOINT$9 + "/confirm";
6818
- var ENDPOINT_FORGOT_PASSWORD = ENDPOINT$9 + "/forgot-password";
6819
- var ENDPOINT_RESET_PASSWORD = ENDPOINT$9 + "/reset-password";
6521
+ var ENDPOINT$8 = "/api/member";
6522
+ var ENDPOINT_LOGIN = ENDPOINT$8 + "/login";
6523
+ var ENDPOINT_LOGOUT = ENDPOINT$8 + "/logout";
6524
+ var ENDPOINT_CONFIRM = ENDPOINT$8 + "/confirm";
6525
+ var ENDPOINT_FORGOT_PASSWORD = ENDPOINT$8 + "/forgot-password";
6526
+ var ENDPOINT_RESET_PASSWORD = ENDPOINT$8 + "/reset-password";
6820
6527
  var login = function (config, request, signal) {
6821
6528
  var url = "" + config.host + ENDPOINT_LOGIN;
6822
6529
  var apiKey = config.apiKey;
@@ -6848,8 +6555,8 @@ var resetPassword = function (config, request, signal) {
6848
6555
  return post$1(url, apiKey, body, config.token, signal);
6849
6556
  };
6850
6557
 
6851
- var ENDPOINT$8 = "/api/mollie";
6852
- var ENDPOINT_CREATE_PAYMENTS = ENDPOINT$8 + "/create-payment";
6558
+ var ENDPOINT$7 = "/api/mollie";
6559
+ var ENDPOINT_CREATE_PAYMENTS = ENDPOINT$7 + "/create-payment";
6853
6560
  /**
6854
6561
  * api/mollie/create-payment
6855
6562
  * @param request
@@ -6862,14 +6569,13 @@ var getMolliePayment = function (config, request, signal) {
6862
6569
  return post(url, apiKey, body, config.token, signal);
6863
6570
  };
6864
6571
 
6865
- var ENDPOINT$7 = "/api/web/search";
6866
- var ENDPOINT_COUNTRIES = ENDPOINT$7 + "/countries";
6867
- var ENDPOINT_REGIONS = ENDPOINT$7 + "/regions";
6868
- var ENDPOINT_OORDS = ENDPOINT$7 + "/oords";
6869
- var ENDPOINT_LOCATIONS$1 = ENDPOINT$7 + "/locations";
6870
- var ENDPOINT_GEOGRAPHICAL_REGIONS = ENDPOINT$7 + "/geographicalregions";
6572
+ var ENDPOINT$6 = "/api/web/search";
6573
+ var ENDPOINT_COUNTRIES = ENDPOINT$6 + "/countries";
6574
+ var ENDPOINT_REGIONS = ENDPOINT$6 + "/regions";
6575
+ var ENDPOINT_OORDS = ENDPOINT$6 + "/oords";
6576
+ var ENDPOINT_LOCATIONS$1 = ENDPOINT$6 + "/locations";
6871
6577
  var ENDPOINT_PORTAL = function (portalId) {
6872
- return ENDPOINT$7 + "/portal/" + portalId;
6578
+ return ENDPOINT$6 + "/portal/" + portalId;
6873
6579
  };
6874
6580
  var ENDPOINT_AIRPORT = "/api/web/entity/airport";
6875
6581
  /**
@@ -6924,18 +6630,6 @@ var searchLocations = function (config, searchTerm, signal) {
6924
6630
  var url = "" + config.host + ENDPOINT_LOCATIONS$1 + "?" + filter;
6925
6631
  return get(url, apiKey, config.token, signal, true);
6926
6632
  };
6927
- /**
6928
- * api/web/search/geographicalregions
6929
- * Gets all available Geographical Regions
6930
- * @param config
6931
- * @param signal
6932
- * @returns OK if succeeded.
6933
- */
6934
- var getAvailableGeographicalRegions = function (config, signal) {
6935
- var url = "" + config.host + ENDPOINT_GEOGRAPHICAL_REGIONS;
6936
- var apiKey = config.apiKey;
6937
- return get(url, apiKey, config.token, signal, true);
6938
- };
6939
6633
  var getPortal = function (config, portalId, signal) {
6940
6634
  var url = "" + config.host + ENDPOINT_PORTAL(portalId);
6941
6635
  var apiKey = config.apiKey;
@@ -7104,13 +6798,13 @@ var isValidDate = function (d) {
7104
6798
  return d instanceof Date && !isNaN(d.getTime());
7105
6799
  };
7106
6800
 
7107
- var ENDPOINT$6 = "/api/web/agent";
7108
- var ENDPOINT_GET_PRINT_ACTIONS = ENDPOINT$6 + "/print-action";
7109
- var ENDPOINT_PRINT = ENDPOINT$6 + "/print-action";
7110
- var ENDPOINT_CUSTOM_ENTRY_STATUS = ENDPOINT$6 + "/custom-entry-status";
7111
- var ENDPOINT_ENUM_ENTRY_STATUS = ENDPOINT$6 + "/enum/entry-status";
6801
+ var ENDPOINT$5 = "/api/web/agent";
6802
+ var ENDPOINT_GET_PRINT_ACTIONS = ENDPOINT$5 + "/print-action";
6803
+ var ENDPOINT_PRINT = ENDPOINT$5 + "/print-action";
6804
+ var ENDPOINT_CUSTOM_ENTRY_STATUS = ENDPOINT$5 + "/custom-entry-status";
6805
+ var ENDPOINT_ENUM_ENTRY_STATUS = ENDPOINT$5 + "/enum/entry-status";
7112
6806
  var ENDPOINT_CHANGE_ENTRY_AGENT_SURCHARGE =
7113
- ENDPOINT$6 + "/entry/change-agent-surcharge";
6807
+ ENDPOINT$5 + "/entry/change-agent-surcharge";
7114
6808
  /**
7115
6809
  * api/web/agent/print-action/{print-action-group}
7116
6810
  * @param config
@@ -7144,7 +6838,7 @@ var getEntryList = function (config, filterItem, gridColumns, signal) {
7144
6838
  return encodeURIComponent(key) + "=" + encodeURIComponent(params[key]);
7145
6839
  })
7146
6840
  .join("&");
7147
- var url = "" + config.host + ENDPOINT$6 + "/entry/list?" + queryString;
6841
+ var url = "" + config.host + ENDPOINT$5 + "/entry/list?" + queryString;
7148
6842
  var apiKey = config.apiKey;
7149
6843
  return get(url, apiKey, config.token, signal, true);
7150
6844
  };
@@ -7155,7 +6849,7 @@ var getEntryListv2 = function (config, filterItem, gridColumns, signal) {
7155
6849
  return encodeURIComponent(key) + "=" + encodeURIComponent(params[key]);
7156
6850
  })
7157
6851
  .join("&");
7158
- var url = "" + config.host + ENDPOINT$6 + "/v2/entry/list?" + queryString;
6852
+ var url = "" + config.host + ENDPOINT$5 + "/v2/entry/list?" + queryString;
7159
6853
  var apiKey = config.apiKey;
7160
6854
  return get(url, apiKey, config.token, signal, true);
7161
6855
  };
@@ -7166,12 +6860,12 @@ var getEntryTotals = function (config, filterItem, gridColumns, signal) {
7166
6860
  return encodeURIComponent(key) + "=" + encodeURIComponent(params[key]);
7167
6861
  })
7168
6862
  .join("&");
7169
- var url = "" + config.host + ENDPOINT$6 + "/entry/total?" + queryString;
6863
+ var url = "" + config.host + ENDPOINT$5 + "/entry/total?" + queryString;
7170
6864
  var apiKey = config.apiKey;
7171
6865
  return get(url, apiKey, config.token, signal, true);
7172
6866
  };
7173
6867
  var getEntryDetailv2 = function (config, entryId, signal) {
7174
- var url = "" + config.host + ENDPOINT$6 + "/v2/entry/detail/" + entryId;
6868
+ var url = "" + config.host + ENDPOINT$5 + "/v2/entry/detail/" + entryId;
7175
6869
  var apiKey = config.apiKey;
7176
6870
  return get(url, apiKey, config.token, signal, true);
7177
6871
  };
@@ -7182,7 +6876,7 @@ var getInvoiceList = function (config, filterItem, gridColumns, signal) {
7182
6876
  return encodeURIComponent(key) + "=" + encodeURIComponent(params[key]);
7183
6877
  })
7184
6878
  .join("&");
7185
- var url = "" + config.host + ENDPOINT$6 + "/invoice/list?" + queryString;
6879
+ var url = "" + config.host + ENDPOINT$5 + "/invoice/list?" + queryString;
7186
6880
  var apiKey = config.apiKey;
7187
6881
  return get(url, apiKey, config.token, signal, true);
7188
6882
  };
@@ -7209,48 +6903,28 @@ var getAllotmentList = function (config, filterItem, gridColumns, signal) {
7209
6903
  return encodeURIComponent(key) + "=" + encodeURIComponent(params[key]);
7210
6904
  })
7211
6905
  .join("&");
7212
- var url = "" + config.host + ENDPOINT$6 + "/allotment/list?" + queryString;
6906
+ var url = "" + config.host + ENDPOINT$5 + "/allotment/list?" + queryString;
7213
6907
  var apiKey = config.apiKey;
7214
6908
  return get(url, apiKey, config.token, signal, true);
7215
6909
  };
7216
6910
  var getAllotment = function (config, allotmentId, signal) {
7217
- var url = "" + config.host + ENDPOINT$6 + "/allotment/" + allotmentId;
6911
+ var url = "" + config.host + ENDPOINT$5 + "/allotment/" + allotmentId;
7218
6912
  var apiKey = config.apiKey;
7219
6913
  return get(url, apiKey, config.token, signal, true);
7220
6914
  };
7221
6915
 
7222
- var ENDPOINT$5 = "/api/web";
7223
- var ENDPOINT_MAIL = ENDPOINT$5 + "/mail";
7224
- var ENDPOINT_CREATE_CRM_CONTACT = ENDPOINT$5 + "/crmcontact";
7225
- var ENDPOINT_CONTACT_FORM$1 = ENDPOINT$5 + "/contactform";
7226
- var ENDPOINT_TRAVEL_AGENTS = ENDPOINT$5 + "/travelagents";
7227
- var ENDPOINT_CREATE_AFFILIATES = ENDPOINT$5 + "/affiliates";
7228
- var ENDPOINT_TRANSLATION_DICTIONARY = ENDPOINT$5 + "/translation-dictionary";
7229
- var ENDPOINT_BOOKING_ACCOMMODATION = ENDPOINT$5 + "/booking-accommodation";
7230
- var ENDPOINT_OPPORTUNITY = ENDPOINT$5 + "/opportunity";
7231
- var ENDPOINT_CALCULATE_DEPOSIT = function (entryId) {
7232
- return ENDPOINT$5 + "/entry/" + entryId + "/calculate-deposit";
7233
- };
7234
- var ENDPOINT_LOCATIONS = ENDPOINT$5 + "/entity/locations";
6916
+ var ENDPOINT$4 = "/api/web";
6917
+ var ENDPOINT_CREATE_CRM_CONTACT = ENDPOINT$4 + "/crmcontact";
6918
+ var ENDPOINT_CONTACT_FORM$1 = ENDPOINT$4 + "/contactform";
6919
+ var ENDPOINT_CREATE_AFFILIATES = ENDPOINT$4 + "/affiliates";
6920
+ var ENDPOINT_TRANSLATION_DICTIONARY = ENDPOINT$4 + "/translation-dictionary";
6921
+ var ENDPOINT_BOOKING_ACCOMMODATION = ENDPOINT$4 + "/booking-accommodation";
6922
+ var ENDPOINT_LOCATIONS = ENDPOINT$4 + "/entity/locations";
7235
6923
  var ENDPOINT_WEBSITE_CONFIGURATION = function (portalId) {
7236
- return ENDPOINT$5 + "/website/" + portalId + "/configuration";
6924
+ return ENDPOINT$4 + "/website/" + portalId + "/configuration";
7237
6925
  };
7238
6926
  var ENDPOINT_WEBSITE_STYLESHEET = function (styleSheetId) {
7239
- return ENDPOINT$5 + "/style-sheet/" + styleSheetId;
7240
- };
7241
- /**
7242
- * api/web/mail
7243
- * Adds the sender as a person and sends a mail.
7244
- * @param config
7245
- * @param request
7246
- * @param signal
7247
- * @returns OK if succeeded.
7248
- */
7249
- var sendMail = function (config, request, signal) {
7250
- var url = "" + config.host + ENDPOINT_MAIL;
7251
- var apiKey = config.apiKey;
7252
- var body = JSON.stringify(request);
7253
- return post(url, apiKey, body, config.token, signal);
6927
+ return ENDPOINT$4 + "/style-sheet/" + styleSheetId;
7254
6928
  };
7255
6929
  /**
7256
6930
  * api/web/crmcontact
@@ -7274,27 +6948,12 @@ var createCrmContact = function (config, request, signal) {
7274
6948
  * @param signal
7275
6949
  * @returns OK if succeeded.
7276
6950
  */
7277
- var sendContactForm = function (config, request, signal) {
6951
+ var ContactForm = function (config, request, signal) {
7278
6952
  var url = "" + config.host + ENDPOINT_CONTACT_FORM$1;
7279
6953
  var apiKey = config.apiKey;
7280
6954
  var body = JSON.stringify(request);
7281
6955
  return post(url, apiKey, body, config.token, signal, true);
7282
6956
  };
7283
- /**
7284
- * api/web/travelagents
7285
- * Searches travel agents (addresses of type Agent). Optionally pass a raw OData
7286
- * query string (without leading '?'), e.g. "$top=20&$filter=contains(name,'foo')".
7287
- * @param config
7288
- * @param odataQuery
7289
- * @param signal
7290
- * @returns OK if succeeded.
7291
- */
7292
- var getTravelAgents = function (config, odataQuery, signal) {
7293
- var query = odataQuery ? "?" + odataQuery : "";
7294
- var url = "" + config.host + ENDPOINT_TRAVEL_AGENTS + query;
7295
- var apiKey = config.apiKey;
7296
- return get(url, apiKey, config.token, signal, true);
7297
- };
7298
6957
  /**
7299
6958
  * api/web/affiliates
7300
6959
  * Gets all Affiliates
@@ -7319,33 +6978,6 @@ var generateBookingAccommodations = function (config, request, signal) {
7319
6978
  var body = JSON.stringify(request);
7320
6979
  return post(url, apiKey, body, config.token, signal);
7321
6980
  };
7322
- /**
7323
- * api/web/opportunity
7324
- * Creates a CRM opportunity from a web contact.
7325
- * @param config
7326
- * @param request
7327
- * @param signal
7328
- * @returns OK if succeeded.
7329
- */
7330
- var createOpportunity = function (config, request, signal) {
7331
- var url = "" + config.host + ENDPOINT_OPPORTUNITY;
7332
- var apiKey = config.apiKey;
7333
- var body = JSON.stringify(request);
7334
- return post(url, apiKey, body, config.token, signal);
7335
- };
7336
- /**
7337
- * api/web/entry/{entryId}/calculate-deposit
7338
- * Calculates the deposit amount for an entry.
7339
- * @param config
7340
- * @param entryId
7341
- * @param signal
7342
- * @returns The deposit amount.
7343
- */
7344
- var calculateDeposit = function (config, entryId, signal) {
7345
- var url = "" + config.host + ENDPOINT_CALCULATE_DEPOSIT(entryId);
7346
- var apiKey = config.apiKey;
7347
- return get(url, apiKey, config.token, signal, true);
7348
- };
7349
6981
  var getLocations = function (config, request, signal) {
7350
6982
  var url = "" + config.host + ENDPOINT_LOCATIONS;
7351
6983
  var apiKey = config.apiKey;
@@ -7363,9 +6995,9 @@ var getStyleSheet = function (config, id, signal) {
7363
6995
  return get(url, apiKey, config.token, signal, true);
7364
6996
  };
7365
6997
 
7366
- var ENDPOINT$4 = "/api/web/contact";
7367
- var ENDPOINT_CONTACT_FORM = ENDPOINT$4 + "/contact-form";
7368
- var ENDPOINT_CONTACT_HAS_TAG = ENDPOINT$4 + "/has-tag";
6998
+ var ENDPOINT$3 = "/api/web/contact";
6999
+ var ENDPOINT_CONTACT_FORM = ENDPOINT$3 + "/contact-form";
7000
+ var ENDPOINT_CONTACT_HAS_TAG = ENDPOINT$3 + "/has-tag";
7369
7001
  /**
7370
7002
  * api/web/contact/contact-form
7371
7003
  * Processes a contact form.
@@ -7387,118 +7019,6 @@ var contactHasTag = function (config, request, signal) {
7387
7019
  return post$1(url, apiKey, body, config.token, signal);
7388
7020
  };
7389
7021
 
7390
- var ENDPOINT$3 = "/api/web/content";
7391
- var ENDPOINT_LIVE = ENDPOINT$3 + "/live";
7392
- var ENDPOINT_DRAFT = ENDPOINT$3 + "/draft";
7393
- /**
7394
- * api/web/content/live
7395
- * Gets all Live content
7396
- * @param config
7397
- * @param signal
7398
- * @returns OK if succeeded.
7399
- */
7400
- var getContentLive = function (config, signal) {
7401
- var url = "" + config.host + ENDPOINT_LIVE;
7402
- var apiKey = config.apiKey;
7403
- return get(url, apiKey, config.token, signal, true);
7404
- };
7405
- /**
7406
- * api/web/content/draft
7407
- * Gets all Draft (Internal) content
7408
- * @param config
7409
- * @param signal
7410
- * @returns OK if succeeded.
7411
- */
7412
- var getContentDraft = function (config, signal) {
7413
- var url = "" + config.host + ENDPOINT_DRAFT;
7414
- var apiKey = config.apiKey;
7415
- return get(url, apiKey, config.token, signal, true);
7416
- };
7417
- /**
7418
- * api/web/content/live/by-property
7419
- * Gets Live content matching a property value (or values).
7420
- * @param config
7421
- * @param request
7422
- * @param signal
7423
- * @returns OK if succeeded.
7424
- */
7425
- var getContentLiveByProperty = function (config, request, signal) {
7426
- var url = "" + config.host + ENDPOINT_LIVE + "/by-property";
7427
- var apiKey = config.apiKey;
7428
- var body = JSON.stringify(request);
7429
- return post(url, apiKey, body, config.token, signal, true);
7430
- };
7431
- /**
7432
- * api/web/content/draft/by-property
7433
- * Gets Draft (Internal) content matching a property value (or values).
7434
- * @param config
7435
- * @param request
7436
- * @param signal
7437
- * @returns OK if succeeded.
7438
- */
7439
- var getContentDraftByProperty = function (config, request, signal) {
7440
- var url = "" + config.host + ENDPOINT_DRAFT + "/by-property";
7441
- var apiKey = config.apiKey;
7442
- var body = JSON.stringify(request);
7443
- return post(url, apiKey, body, config.token, signal, true);
7444
- };
7445
- /**
7446
- * api/web/content/live/by-template
7447
- * Gets Live content of a given template.
7448
- * @param config
7449
- * @param request
7450
- * @param signal
7451
- * @returns OK if succeeded.
7452
- */
7453
- var getContentLiveByTemplate = function (config, request, signal) {
7454
- var url = "" + config.host + ENDPOINT_LIVE + "/by-template";
7455
- var apiKey = config.apiKey;
7456
- var body = JSON.stringify(request);
7457
- return post(url, apiKey, body, config.token, signal, true);
7458
- };
7459
- /**
7460
- * api/web/content/draft/by-template
7461
- * Gets Draft (Internal) content of a given template.
7462
- * @param config
7463
- * @param request
7464
- * @param signal
7465
- * @returns OK if succeeded.
7466
- */
7467
- var getContentDraftByTemplate = function (config, request, signal) {
7468
- var url = "" + config.host + ENDPOINT_DRAFT + "/by-template";
7469
- var apiKey = config.apiKey;
7470
- var body = JSON.stringify(request);
7471
- return post(url, apiKey, body, config.token, signal, true);
7472
- };
7473
- /**
7474
- * api/web/content/live/children
7475
- * Gets the Live children of a parent item.
7476
- * @param config
7477
- * @param request
7478
- * @param signal
7479
- * @returns OK if succeeded.
7480
- */
7481
- var getContentLiveChildren = function (config, request, signal) {
7482
- var url = "" + config.host + ENDPOINT_LIVE + "/children";
7483
- var apiKey = config.apiKey;
7484
- var body = JSON.stringify(request);
7485
- return post(url, apiKey, body, config.token, signal, true);
7486
- };
7487
- /**
7488
- * api/web/content/draft/children
7489
- * Gets the Draft (Internal) children of a parent item.
7490
- * @param config
7491
- * @param request
7492
- * @param signal
7493
- * @returns OK if succeeded.
7494
- */
7495
- var getContentDraftChildren = function (config, request, signal) {
7496
- var url = "" + config.host + ENDPOINT_DRAFT + "/children";
7497
- var apiKey = config.apiKey;
7498
- var body = JSON.stringify(request);
7499
- return post(url, apiKey, body, config.token, signal, true);
7500
- };
7501
-
7502
7022
  var ENDPOINT$2 = "/api/web/file";
7503
7023
  var ENDPOINT_FEED = ENDPOINT$2 + "/feed";
7504
7024
  /**
@@ -7625,6 +7145,7 @@ var submitForm = function (config, id, request, signal) {
7625
7145
  };
7626
7146
 
7627
7147
  exports.AllotmentType = AllotmentType;
7148
+ exports.ContactForm = ContactForm;
7628
7149
  exports.DataType = DataType;
7629
7150
  exports.DossierType = DossierType;
7630
7151
  exports.EntryLineFlag = EntryLineFlag;
@@ -7640,7 +7161,6 @@ exports.PriceChartType = PriceChartType;
7640
7161
  exports.RequirementType = RequirementType;
7641
7162
  exports.RoomType = RoomType;
7642
7163
  exports.SaleType = SaleType;
7643
- exports.ServiceTokenError = ServiceTokenError;
7644
7164
  exports.ServiceType = ServiceType;
7645
7165
  exports.VendorType = VendorType;
7646
7166
  exports.agents = agents;
@@ -7651,14 +7171,11 @@ exports.availableFlights = availableFlights;
7651
7171
  exports.book = book;
7652
7172
  exports.bookPackagingEntry = bookPackagingEntry;
7653
7173
  exports.bookableDates = bookableDates;
7654
- exports.calculateDeposit = calculateDeposit;
7655
7174
  exports.changeEntryAgentSurcharge = changeEntryAgentSurcharge;
7656
- exports.clearServiceTokenCache = clearServiceTokenCache;
7657
7175
  exports.confirm = confirm;
7658
7176
  exports.contactForm = contactForm;
7659
7177
  exports.contactHasTag = contactHasTag;
7660
7178
  exports.createCrmContact = createCrmContact;
7661
- exports.createOpportunity = createOpportunity;
7662
7179
  exports.createParams = createParams;
7663
7180
  exports.details = details;
7664
7181
  exports.detailsWL = detailsWL;
@@ -7672,15 +7189,6 @@ exports.getAirports = getAirports;
7672
7189
  exports.getAllotment = getAllotment;
7673
7190
  exports.getAllotmentAvailability = getAllotmentAvailability;
7674
7191
  exports.getAllotmentList = getAllotmentList;
7675
- exports.getAvailableGeographicalRegions = getAvailableGeographicalRegions;
7676
- exports.getContentDraft = getContentDraft;
7677
- exports.getContentDraftByProperty = getContentDraftByProperty;
7678
- exports.getContentDraftByTemplate = getContentDraftByTemplate;
7679
- exports.getContentDraftChildren = getContentDraftChildren;
7680
- exports.getContentLive = getContentLive;
7681
- exports.getContentLiveByProperty = getContentLiveByProperty;
7682
- exports.getContentLiveByTemplate = getContentLiveByTemplate;
7683
- exports.getContentLiveChildren = getContentLiveChildren;
7684
7192
  exports.getCountries = getCountries;
7685
7193
  exports.getCustomEntryStatus = getCustomEntryStatus;
7686
7194
  exports.getEntry = getEntry;
@@ -7699,7 +7207,6 @@ exports.getPriceDetails = getPriceDetails;
7699
7207
  exports.getPrintActions = getPrintActions;
7700
7208
  exports.getStyleSheet = getStyleSheet;
7701
7209
  exports.getTranslationDictionary = getTranslationDictionary;
7702
- exports.getTravelAgents = getTravelAgents;
7703
7210
  exports.getWebsiteConfiguration = getWebsiteConfiguration;
7704
7211
  exports.login = login;
7705
7212
  exports.logout = logout;
@@ -7719,8 +7226,6 @@ exports.searchPackagingExcursions = searchPackagingExcursions;
7719
7226
  exports.searchPackagingFlights = searchPackagingFlights;
7720
7227
  exports.searchRegions = searchRegions;
7721
7228
  exports.searchWithErrorMapping = searchWithErrorMapping;
7722
- exports.sendContactForm = sendContactForm;
7723
- exports.sendMail = sendMail;
7724
7229
  exports.setCustomEntryStatus = setCustomEntryStatus;
7725
7230
  exports.setEntryStatus = setEntryStatus;
7726
7231
  exports.startTransaction = startTransaction;