@qite/tide-client 1.0.47 → 1.0.48

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
@@ -237,6 +237,32 @@ var post$1 = function (url, apiKey, body, signal) {
237
237
  });
238
238
  });
239
239
  };
240
+ var get$1 = function (url, apiKey, signal) {
241
+ return __awaiter(void 0, void 0, void 0, function () {
242
+ var response;
243
+ return __generator(this, function (_a) {
244
+ switch (_a.label) {
245
+ case 0:
246
+ return [
247
+ 4 /*yield*/,
248
+ fetch(url, {
249
+ method: "GET",
250
+ headers: {
251
+ "Api-Key": apiKey,
252
+ },
253
+ signal: signal,
254
+ }),
255
+ ];
256
+ case 1:
257
+ response = _a.sent();
258
+ if (!response.ok) {
259
+ throw new Error(response.statusText);
260
+ }
261
+ return [2 /*return*/, response];
262
+ }
263
+ });
264
+ });
265
+ };
240
266
 
241
267
  var commonjsGlobal =
242
268
  typeof globalThis !== "undefined"
@@ -5961,6 +5987,26 @@ var post = function (url, apiKey, body, signal, skipReviver) {
5961
5987
  });
5962
5988
  });
5963
5989
  };
5990
+ var get = function (url, apiKey, signal, skipReviver) {
5991
+ return __awaiter(void 0, void 0, void 0, function () {
5992
+ var response, responseBody, result;
5993
+ return __generator(this, function (_a) {
5994
+ switch (_a.label) {
5995
+ case 0:
5996
+ return [4 /*yield*/, get$1(url, apiKey, signal)];
5997
+ case 1:
5998
+ response = _a.sent();
5999
+ return [4 /*yield*/, response.text()];
6000
+ case 2:
6001
+ responseBody = _a.sent();
6002
+ result = skipReviver
6003
+ ? JSON.parse(responseBody)
6004
+ : JSON.parse(responseBody, reviver);
6005
+ return [2 /*return*/, result];
6006
+ }
6007
+ });
6008
+ });
6009
+ };
5964
6010
 
5965
6011
  var ENDPOINT$4 = "/api/web/booking";
5966
6012
  var ENDPOINT_AVAILABLE_PRODUCTS = ENDPOINT$4 + "/available-products";
@@ -6208,6 +6254,7 @@ var getMolliePayment = function (config, request, signal) {
6208
6254
 
6209
6255
  var ENDPOINT$1 = "/api/web";
6210
6256
  var ENDPOINT_CREATE_CRM_CONTACT = ENDPOINT$1 + "/crmcontact";
6257
+ var ENDPOINT_CREATE_AFFILIATES = ENDPOINT$1 + "/affiliates";
6211
6258
  /**
6212
6259
  * api/web/crmcontact
6213
6260
  * Creates a CRM contact.
@@ -6222,6 +6269,18 @@ var createCrmContact = function (config, request, signal) {
6222
6269
  var body = JSON.stringify(request);
6223
6270
  return post$1(url, apiKey, body, signal);
6224
6271
  };
6272
+ /**
6273
+ * api/web/affiliates
6274
+ * Gets all Affiliates
6275
+ * @param config
6276
+ * @param signal
6277
+ * @returns OK if succeeded.
6278
+ */
6279
+ var getAffiliates = function (config, signal) {
6280
+ var url = "" + config.host + ENDPOINT_CREATE_AFFILIATES;
6281
+ var apiKey = config.apiKey;
6282
+ return get(url, apiKey, signal);
6283
+ };
6225
6284
 
6226
6285
  var ENDPOINT = "/api/web/contact";
6227
6286
  var ENDPOINT_CONTACT_FORM = ENDPOINT + "/contact-form";
@@ -6268,6 +6327,7 @@ exports.createPackageOffer = createPackageOffer;
6268
6327
  exports.createPackageOfferWithShortResponse =
6269
6328
  createPackageOfferWithShortResponse;
6270
6329
  exports.details = details;
6330
+ exports.getAffiliates = getAffiliates;
6271
6331
  exports.getAvailableProducts = getAvailableProducts;
6272
6332
  exports.getBasePrices = getBasePrices;
6273
6333
  exports.getBasePricesFromDate = getBasePricesFromDate;