glitch-javascript-sdk 0.4.4 → 0.4.6

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/dist/cjs/index.js CHANGED
@@ -526,7 +526,7 @@ var isTypedArray = (function(TypedArray) {
526
526
  };
527
527
  })(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array));
528
528
 
529
- var utils$a = {
529
+ var utils$b = {
530
530
  isArray: isArray,
531
531
  isArrayBuffer: isArrayBuffer,
532
532
  isBuffer: isBuffer,
@@ -559,7 +559,7 @@ var utils$a = {
559
559
  isFileList: isFileList
560
560
  };
561
561
 
562
- var utils$9 = utils$a;
562
+ var utils$a = utils$b;
563
563
 
564
564
  function encode(val) {
565
565
  return encodeURIComponent(val).
@@ -587,26 +587,26 @@ var buildURL$1 = function buildURL(url, params, paramsSerializer) {
587
587
  var serializedParams;
588
588
  if (paramsSerializer) {
589
589
  serializedParams = paramsSerializer(params);
590
- } else if (utils$9.isURLSearchParams(params)) {
590
+ } else if (utils$a.isURLSearchParams(params)) {
591
591
  serializedParams = params.toString();
592
592
  } else {
593
593
  var parts = [];
594
594
 
595
- utils$9.forEach(params, function serialize(val, key) {
595
+ utils$a.forEach(params, function serialize(val, key) {
596
596
  if (val === null || typeof val === 'undefined') {
597
597
  return;
598
598
  }
599
599
 
600
- if (utils$9.isArray(val)) {
600
+ if (utils$a.isArray(val)) {
601
601
  key = key + '[]';
602
602
  } else {
603
603
  val = [val];
604
604
  }
605
605
 
606
- utils$9.forEach(val, function parseValue(v) {
607
- if (utils$9.isDate(v)) {
606
+ utils$a.forEach(val, function parseValue(v) {
607
+ if (utils$a.isDate(v)) {
608
608
  v = v.toISOString();
609
- } else if (utils$9.isObject(v)) {
609
+ } else if (utils$a.isObject(v)) {
610
610
  v = JSON.stringify(v);
611
611
  }
612
612
  parts.push(encode(key) + '=' + encode(v));
@@ -628,7 +628,7 @@ var buildURL$1 = function buildURL(url, params, paramsSerializer) {
628
628
  return url;
629
629
  };
630
630
 
631
- var utils$8 = utils$a;
631
+ var utils$9 = utils$b;
632
632
 
633
633
  function InterceptorManager$1() {
634
634
  this.handlers = [];
@@ -672,7 +672,7 @@ InterceptorManager$1.prototype.eject = function eject(id) {
672
672
  * @param {Function} fn The function to call for each interceptor
673
673
  */
674
674
  InterceptorManager$1.prototype.forEach = function forEach(fn) {
675
- utils$8.forEach(this.handlers, function forEachHandler(h) {
675
+ utils$9.forEach(this.handlers, function forEachHandler(h) {
676
676
  if (h !== null) {
677
677
  fn(h);
678
678
  }
@@ -681,10 +681,10 @@ InterceptorManager$1.prototype.forEach = function forEach(fn) {
681
681
 
682
682
  var InterceptorManager_1 = InterceptorManager$1;
683
683
 
684
- var utils$7 = utils$a;
684
+ var utils$8 = utils$b;
685
685
 
686
686
  var normalizeHeaderName$1 = function normalizeHeaderName(headers, normalizedName) {
687
- utils$7.forEach(headers, function processHeader(value, name) {
687
+ utils$8.forEach(headers, function processHeader(value, name) {
688
688
  if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
689
689
  headers[normalizedName] = value;
690
690
  delete headers[name];
@@ -692,99 +692,90 @@ var normalizeHeaderName$1 = function normalizeHeaderName(headers, normalizedName
692
692
  });
693
693
  };
694
694
 
695
- var AxiosError_1;
696
- var hasRequiredAxiosError;
695
+ var utils$7 = utils$b;
697
696
 
698
- function requireAxiosError () {
699
- if (hasRequiredAxiosError) return AxiosError_1;
700
- hasRequiredAxiosError = 1;
701
-
702
- var utils = utils$a;
703
-
704
- /**
705
- * Create an Error with the specified message, config, error code, request and response.
706
- *
707
- * @param {string} message The error message.
708
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
709
- * @param {Object} [config] The config.
710
- * @param {Object} [request] The request.
711
- * @param {Object} [response] The response.
712
- * @returns {Error} The created error.
713
- */
714
- function AxiosError(message, code, config, request, response) {
715
- Error.call(this);
716
- this.message = message;
717
- this.name = 'AxiosError';
718
- code && (this.code = code);
719
- config && (this.config = config);
720
- request && (this.request = request);
721
- response && (this.response = response);
722
- }
723
-
724
- utils.inherits(AxiosError, Error, {
725
- toJSON: function toJSON() {
726
- return {
727
- // Standard
728
- message: this.message,
729
- name: this.name,
730
- // Microsoft
731
- description: this.description,
732
- number: this.number,
733
- // Mozilla
734
- fileName: this.fileName,
735
- lineNumber: this.lineNumber,
736
- columnNumber: this.columnNumber,
737
- stack: this.stack,
738
- // Axios
739
- config: this.config,
740
- code: this.code,
741
- status: this.response && this.response.status ? this.response.status : null
742
- };
743
- }
744
- });
697
+ /**
698
+ * Create an Error with the specified message, config, error code, request and response.
699
+ *
700
+ * @param {string} message The error message.
701
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
702
+ * @param {Object} [config] The config.
703
+ * @param {Object} [request] The request.
704
+ * @param {Object} [response] The response.
705
+ * @returns {Error} The created error.
706
+ */
707
+ function AxiosError$2(message, code, config, request, response) {
708
+ Error.call(this);
709
+ this.message = message;
710
+ this.name = 'AxiosError';
711
+ code && (this.code = code);
712
+ config && (this.config = config);
713
+ request && (this.request = request);
714
+ response && (this.response = response);
715
+ }
745
716
 
746
- var prototype = AxiosError.prototype;
747
- var descriptors = {};
717
+ utils$7.inherits(AxiosError$2, Error, {
718
+ toJSON: function toJSON() {
719
+ return {
720
+ // Standard
721
+ message: this.message,
722
+ name: this.name,
723
+ // Microsoft
724
+ description: this.description,
725
+ number: this.number,
726
+ // Mozilla
727
+ fileName: this.fileName,
728
+ lineNumber: this.lineNumber,
729
+ columnNumber: this.columnNumber,
730
+ stack: this.stack,
731
+ // Axios
732
+ config: this.config,
733
+ code: this.code,
734
+ status: this.response && this.response.status ? this.response.status : null
735
+ };
736
+ }
737
+ });
748
738
 
749
- [
750
- 'ERR_BAD_OPTION_VALUE',
751
- 'ERR_BAD_OPTION',
752
- 'ECONNABORTED',
753
- 'ETIMEDOUT',
754
- 'ERR_NETWORK',
755
- 'ERR_FR_TOO_MANY_REDIRECTS',
756
- 'ERR_DEPRECATED',
757
- 'ERR_BAD_RESPONSE',
758
- 'ERR_BAD_REQUEST',
759
- 'ERR_CANCELED'
760
- // eslint-disable-next-line func-names
761
- ].forEach(function(code) {
762
- descriptors[code] = {value: code};
763
- });
739
+ var prototype = AxiosError$2.prototype;
740
+ var descriptors = {};
741
+
742
+ [
743
+ 'ERR_BAD_OPTION_VALUE',
744
+ 'ERR_BAD_OPTION',
745
+ 'ECONNABORTED',
746
+ 'ETIMEDOUT',
747
+ 'ERR_NETWORK',
748
+ 'ERR_FR_TOO_MANY_REDIRECTS',
749
+ 'ERR_DEPRECATED',
750
+ 'ERR_BAD_RESPONSE',
751
+ 'ERR_BAD_REQUEST',
752
+ 'ERR_CANCELED'
753
+ // eslint-disable-next-line func-names
754
+ ].forEach(function(code) {
755
+ descriptors[code] = {value: code};
756
+ });
764
757
 
765
- Object.defineProperties(AxiosError, descriptors);
766
- Object.defineProperty(prototype, 'isAxiosError', {value: true});
758
+ Object.defineProperties(AxiosError$2, descriptors);
759
+ Object.defineProperty(prototype, 'isAxiosError', {value: true});
767
760
 
768
- // eslint-disable-next-line func-names
769
- AxiosError.from = function(error, code, config, request, response, customProps) {
770
- var axiosError = Object.create(prototype);
761
+ // eslint-disable-next-line func-names
762
+ AxiosError$2.from = function(error, code, config, request, response, customProps) {
763
+ var axiosError = Object.create(prototype);
771
764
 
772
- utils.toFlatObject(error, axiosError, function filter(obj) {
773
- return obj !== Error.prototype;
774
- });
765
+ utils$7.toFlatObject(error, axiosError, function filter(obj) {
766
+ return obj !== Error.prototype;
767
+ });
775
768
 
776
- AxiosError.call(axiosError, error.message, code, config, request, response);
769
+ AxiosError$2.call(axiosError, error.message, code, config, request, response);
777
770
 
778
- axiosError.name = error.name;
771
+ axiosError.name = error.name;
779
772
 
780
- customProps && Object.assign(axiosError, customProps);
773
+ customProps && Object.assign(axiosError, customProps);
781
774
 
782
- return axiosError;
783
- };
775
+ return axiosError;
776
+ };
784
777
 
785
- AxiosError_1 = AxiosError;
786
- return AxiosError_1;
787
- }
778
+ var AxiosError_1 = AxiosError$2;
788
779
 
789
780
  var transitional = {
790
781
  silentJSONParsing: true,
@@ -792,7 +783,7 @@ var transitional = {
792
783
  clarifyTimeoutError: false
793
784
  };
794
785
 
795
- var utils$6 = utils$a;
786
+ var utils$6 = utils$b;
796
787
 
797
788
  /**
798
789
  * Convert a data object to FormData
@@ -870,7 +861,7 @@ function requireSettle () {
870
861
  if (hasRequiredSettle) return settle;
871
862
  hasRequiredSettle = 1;
872
863
 
873
- var AxiosError = requireAxiosError();
864
+ var AxiosError = AxiosError_1;
874
865
 
875
866
  /**
876
867
  * Resolve or reject a Promise based on response status.
@@ -903,7 +894,7 @@ function requireCookies () {
903
894
  if (hasRequiredCookies) return cookies;
904
895
  hasRequiredCookies = 1;
905
896
 
906
- var utils = utils$a;
897
+ var utils = utils$b;
907
898
 
908
899
  cookies = (
909
900
  utils.isStandardBrowserEnv() ?
@@ -1009,7 +1000,7 @@ function requireParseHeaders () {
1009
1000
  if (hasRequiredParseHeaders) return parseHeaders;
1010
1001
  hasRequiredParseHeaders = 1;
1011
1002
 
1012
- var utils = utils$a;
1003
+ var utils = utils$b;
1013
1004
 
1014
1005
  // Headers whose duplicates are ignored by node
1015
1006
  // c.f. https://nodejs.org/api/http.html#http_message_headers
@@ -1070,7 +1061,7 @@ function requireIsURLSameOrigin () {
1070
1061
  if (hasRequiredIsURLSameOrigin) return isURLSameOrigin;
1071
1062
  hasRequiredIsURLSameOrigin = 1;
1072
1063
 
1073
- var utils = utils$a;
1064
+ var utils = utils$b;
1074
1065
 
1075
1066
  isURLSameOrigin = (
1076
1067
  utils.isStandardBrowserEnv() ?
@@ -1146,8 +1137,8 @@ function requireCanceledError () {
1146
1137
  if (hasRequiredCanceledError) return CanceledError_1;
1147
1138
  hasRequiredCanceledError = 1;
1148
1139
 
1149
- var AxiosError = requireAxiosError();
1150
- var utils = utils$a;
1140
+ var AxiosError = AxiosError_1;
1141
+ var utils = utils$b;
1151
1142
 
1152
1143
  /**
1153
1144
  * A `CanceledError` is an object that is thrown when an operation is canceled.
@@ -1190,7 +1181,7 @@ function requireXhr () {
1190
1181
  if (hasRequiredXhr) return xhr;
1191
1182
  hasRequiredXhr = 1;
1192
1183
 
1193
- var utils = utils$a;
1184
+ var utils = utils$b;
1194
1185
  var settle = requireSettle();
1195
1186
  var cookies = requireCookies();
1196
1187
  var buildURL = buildURL$1;
@@ -1198,7 +1189,7 @@ function requireXhr () {
1198
1189
  var parseHeaders = requireParseHeaders();
1199
1190
  var isURLSameOrigin = requireIsURLSameOrigin();
1200
1191
  var transitionalDefaults = transitional;
1201
- var AxiosError = requireAxiosError();
1192
+ var AxiosError = AxiosError_1;
1202
1193
  var CanceledError = requireCanceledError();
1203
1194
  var parseProtocol = requireParseProtocol();
1204
1195
 
@@ -2091,7 +2082,7 @@ function requireHttp () {
2091
2082
  if (hasRequiredHttp) return http_1;
2092
2083
  hasRequiredHttp = 1;
2093
2084
 
2094
- var utils = utils$a;
2085
+ var utils = utils$b;
2095
2086
  var settle = requireSettle();
2096
2087
  var buildFullPath = buildFullPath$1;
2097
2088
  var buildURL = buildURL$1;
@@ -2103,7 +2094,7 @@ function requireHttp () {
2103
2094
  var zlib = require$$8;
2104
2095
  var VERSION = requireData().version;
2105
2096
  var transitionalDefaults = transitional;
2106
- var AxiosError = requireAxiosError();
2097
+ var AxiosError = AxiosError_1;
2107
2098
  var CanceledError = requireCanceledError();
2108
2099
 
2109
2100
  var isHttps = /https:?/;
@@ -14790,9 +14781,9 @@ function requireFormData () {
14790
14781
  return FormDataExports;
14791
14782
  }
14792
14783
 
14793
- var utils$5 = utils$a;
14784
+ var utils$5 = utils$b;
14794
14785
  var normalizeHeaderName = normalizeHeaderName$1;
14795
- var AxiosError$1 = requireAxiosError();
14786
+ var AxiosError$1 = AxiosError_1;
14796
14787
  var transitionalDefaults = transitional;
14797
14788
  var toFormData = toFormData_1;
14798
14789
 
@@ -14935,7 +14926,7 @@ utils$5.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method)
14935
14926
 
14936
14927
  var defaults_1 = defaults$3;
14937
14928
 
14938
- var utils$4 = utils$a;
14929
+ var utils$4 = utils$b;
14939
14930
  var defaults$2 = defaults_1;
14940
14931
 
14941
14932
  /**
@@ -14969,7 +14960,7 @@ function requireIsCancel () {
14969
14960
  return isCancel$1;
14970
14961
  }
14971
14962
 
14972
- var utils$3 = utils$a;
14963
+ var utils$3 = utils$b;
14973
14964
  var transformData = transformData$1;
14974
14965
  var isCancel = requireIsCancel();
14975
14966
  var defaults$1 = defaults_1;
@@ -15055,7 +15046,7 @@ var dispatchRequest$1 = function dispatchRequest(config) {
15055
15046
  });
15056
15047
  };
15057
15048
 
15058
- var utils$2 = utils$a;
15049
+ var utils$2 = utils$b;
15059
15050
 
15060
15051
  /**
15061
15052
  * Config-specific merge-function which creates a new config-object
@@ -15155,7 +15146,7 @@ var mergeConfig$2 = function mergeConfig(config1, config2) {
15155
15146
  };
15156
15147
 
15157
15148
  var VERSION = requireData().version;
15158
- var AxiosError = requireAxiosError();
15149
+ var AxiosError = AxiosError_1;
15159
15150
 
15160
15151
  var validators$1 = {};
15161
15152
 
@@ -15239,7 +15230,7 @@ var validator$1 = {
15239
15230
  validators: validators$1
15240
15231
  };
15241
15232
 
15242
- var utils$1 = utils$a;
15233
+ var utils$1 = utils$b;
15243
15234
  var buildURL = buildURL$1;
15244
15235
  var InterceptorManager = InterceptorManager_1;
15245
15236
  var dispatchRequest = dispatchRequest$1;
@@ -15567,7 +15558,7 @@ function requireIsAxiosError () {
15567
15558
  if (hasRequiredIsAxiosError) return isAxiosError;
15568
15559
  hasRequiredIsAxiosError = 1;
15569
15560
 
15570
- var utils = utils$a;
15561
+ var utils = utils$b;
15571
15562
 
15572
15563
  /**
15573
15564
  * Determines whether the payload is an error thrown by Axios
@@ -15581,7 +15572,7 @@ function requireIsAxiosError () {
15581
15572
  return isAxiosError;
15582
15573
  }
15583
15574
 
15584
- var utils = utils$a;
15575
+ var utils = utils$b;
15585
15576
  var bind = bind$2;
15586
15577
  var Axios = Axios_1;
15587
15578
  var mergeConfig = mergeConfig$2;
@@ -15625,7 +15616,7 @@ axios$1.VERSION = requireData().version;
15625
15616
  axios$1.toFormData = toFormData_1;
15626
15617
 
15627
15618
  // Expose AxiosError class
15628
- axios$1.AxiosError = requireAxiosError();
15619
+ axios$1.AxiosError = AxiosError_1;
15629
15620
 
15630
15621
  // alias for CanceledError for backward compatibility
15631
15622
  axios$1.Cancel = axios$1.CanceledError;
@@ -15659,60 +15650,42 @@ var HTTP_METHODS = {
15659
15650
 
15660
15651
  var Requests = /** @class */ (function () {
15661
15652
  function Requests(config) {
15662
- this.config = config;
15653
+ Requests.config = config;
15654
+ Requests.axiosInstance = axios.create({
15655
+ baseURL: Requests.baseUrl,
15656
+ headers: { 'Content-Type': 'application/json' },
15657
+ });
15663
15658
  }
15664
- /**
15665
- * Sets the base url of the API.
15666
- *
15667
- * @param url The url to of the API.
15668
- */
15669
15659
  Requests.setBaseUrl = function (url) {
15670
- this.baseUrl = url;
15660
+ Requests.baseUrl = url;
15661
+ Requests.axiosInstance.defaults.baseURL = url;
15671
15662
  };
15672
- /**
15673
- * Sets the JSON Web token
15674
- *
15675
- * @param token
15676
- */
15677
15663
  Requests.setAuthToken = function (token) {
15678
- this.authToken = token;
15664
+ Requests.authToken = token;
15679
15665
  };
15680
- /**
15681
- * Sets the community id that will be associated with all requests
15682
- *
15683
- * @param token
15684
- */
15685
15666
  Requests.setCommunityID = function (community_id) {
15686
- this.community_id = community_id;
15667
+ Requests.community_id = community_id;
15687
15668
  };
15688
15669
  Requests.request = function (method, url, data, fileData) {
15689
15670
  var headers = {
15690
15671
  'Content-Type': 'application/json',
15691
15672
  };
15692
- if (this.authToken) {
15693
- headers['Authorization'] = "Bearer ".concat(this.authToken);
15673
+ if (Requests.authToken) {
15674
+ headers['Authorization'] = "Bearer ".concat(Requests.authToken);
15694
15675
  }
15695
15676
  if (fileData) {
15696
15677
  headers['Content-Type'] = 'multipart/form-data';
15697
15678
  }
15698
- //Remove double slashes
15699
15679
  url = url.replace(/\/\//g, '/');
15700
- var uri = "".concat(this.baseUrl).concat(url);
15701
- var axiosPromise = axios({
15680
+ var uri = "".concat(Requests.baseUrl).concat(url);
15681
+ var axiosPromise = Requests.axiosInstance({
15702
15682
  method: method,
15703
15683
  url: uri,
15704
- baseURL: this.baseUrl,
15705
15684
  data: fileData || data,
15706
15685
  headers: headers,
15707
15686
  });
15708
15687
  return axiosPromise;
15709
15688
  };
15710
- /**
15711
- * Calls a GET request to the url endpoint.
15712
- *
15713
- * @param url
15714
- * @returns
15715
- */
15716
15689
  Requests.get = function (url, params) {
15717
15690
  if (params && Object.keys(params).length > 0) {
15718
15691
  var queryString = Object.entries(params)
@@ -15726,13 +15699,11 @@ var Requests = /** @class */ (function () {
15726
15699
  .join('&');
15727
15700
  url = "".concat(url, "?").concat(queryString);
15728
15701
  }
15729
- if (this.community_id) {
15730
- // Check if the URL already contains query parameters
15702
+ if (Requests.community_id) {
15731
15703
  var separator = url.includes('?') ? '&' : '?';
15732
- // Append the community_id query parameter
15733
- url = "".concat(url).concat(separator, "community_id=").concat(this.community_id);
15704
+ url = "".concat(url).concat(separator, "community_id=").concat(Requests.community_id);
15734
15705
  }
15735
- return this.request('GET', url);
15706
+ return Requests.request('GET', url);
15736
15707
  };
15737
15708
  Requests.post = function (url, data, params) {
15738
15709
  if (params && Object.keys(params).length > 0) {
@@ -15744,11 +15715,10 @@ var Requests = /** @class */ (function () {
15744
15715
  .join('&');
15745
15716
  url = "".concat(url, "?").concat(queryString);
15746
15717
  }
15747
- if (this.community_id) {
15748
- // Add the community_id to the request body
15749
- data = __assign(__assign({}, data), { communities: [this.community_id] });
15718
+ if (Requests.community_id) {
15719
+ data = __assign(__assign({}, data), { communities: [Requests.community_id] });
15750
15720
  }
15751
- return this.request('POST', url, data);
15721
+ return Requests.request('POST', url, data);
15752
15722
  };
15753
15723
  Requests.put = function (url, data, params) {
15754
15724
  if (params && Object.keys(params).length > 0) {
@@ -15760,11 +15730,10 @@ var Requests = /** @class */ (function () {
15760
15730
  .join('&');
15761
15731
  url = "".concat(url, "?").concat(queryString);
15762
15732
  }
15763
- if (this.community_id) {
15764
- // Add the community_id to the request body
15765
- data = __assign(__assign({}, data), { community_id: this.community_id });
15733
+ if (Requests.community_id) {
15734
+ data = __assign(__assign({}, data), { community_id: Requests.community_id });
15766
15735
  }
15767
- return this.request('PUT', url, data);
15736
+ return Requests.request('PUT', url, data);
15768
15737
  };
15769
15738
  Requests.delete = function (url, params) {
15770
15739
  if (params && Object.keys(params).length > 0) {
@@ -15776,13 +15745,11 @@ var Requests = /** @class */ (function () {
15776
15745
  .join('&');
15777
15746
  url = "".concat(url, "?").concat(queryString);
15778
15747
  }
15779
- if (this.community_id) {
15780
- // Check if the URL already contains query parameters
15748
+ if (Requests.community_id) {
15781
15749
  var separator = url.includes('?') ? '&' : '?';
15782
- // Append the community_id query parameter
15783
- url = "".concat(url).concat(separator, "community_id=").concat(this.community_id);
15750
+ url = "".concat(url).concat(separator, "community_id=").concat(Requests.community_id);
15784
15751
  }
15785
- return this.request('DELETE', url);
15752
+ return Requests.request('DELETE', url);
15786
15753
  };
15787
15754
  Requests.uploadFile = function (url, filename, file, data, params) {
15788
15755
  if (params && Object.keys(params).length > 0) {
@@ -15796,14 +15763,13 @@ var Requests = /** @class */ (function () {
15796
15763
  }
15797
15764
  var formData = new FormData();
15798
15765
  formData.append(filename, file);
15799
- if (this.community_id) {
15800
- // Add the community_id to the request body
15801
- data = __assign(__assign({}, data), { communities: [this.community_id] });
15766
+ if (Requests.community_id) {
15767
+ data = __assign(__assign({}, data), { communities: [Requests.community_id] });
15802
15768
  }
15803
15769
  for (var key in data) {
15804
15770
  formData.append(key, data[key]);
15805
15771
  }
15806
- return this.request('POST', url, data, formData);
15772
+ return Requests.request('POST', url, data, formData);
15807
15773
  };
15808
15774
  Requests.uploadBlob = function (url, filename, blob, data, params) {
15809
15775
  if (params && Object.keys(params).length > 0) {
@@ -15817,23 +15783,14 @@ var Requests = /** @class */ (function () {
15817
15783
  }
15818
15784
  var formData = new FormData();
15819
15785
  formData.append(filename, blob);
15820
- if (this.community_id) {
15821
- // Add the community_id to the request body
15822
- data = __assign(__assign({}, data), { communities: [this.community_id] });
15786
+ if (Requests.community_id) {
15787
+ data = __assign(__assign({}, data), { communities: [Requests.community_id] });
15823
15788
  }
15824
15789
  for (var key in data) {
15825
15790
  formData.append(key, data[key]);
15826
15791
  }
15827
- return this.request('POST', url, data, formData);
15792
+ return Requests.request('POST', url, data, formData);
15828
15793
  };
15829
- /**
15830
- * The Route class contains the method and url, thereforce items can be
15831
- * automatically routed depending on the configuration.
15832
- *
15833
- * @param route
15834
- * @param data
15835
- * @returns
15836
- */
15837
15794
  Requests.processRoute = function (route, data, routeReplace, params) {
15838
15795
  var url = route.url;
15839
15796
  if (routeReplace) {
@@ -15842,24 +15799,21 @@ var Requests = /** @class */ (function () {
15842
15799
  }
15843
15800
  }
15844
15801
  if (route.method == HTTP_METHODS.GET) {
15845
- return this.get(url, params);
15802
+ return Requests.get(url, params);
15846
15803
  }
15847
15804
  else if (route.method == HTTP_METHODS.POST) {
15848
- return this.post(url, data, params);
15805
+ return Requests.post(url, data, params);
15849
15806
  }
15850
15807
  else if (route.method == HTTP_METHODS.PUT) {
15851
- return this.put(url, data, params);
15808
+ return Requests.put(url, data, params);
15852
15809
  }
15853
15810
  else if (route.method == HTTP_METHODS.DELETE) {
15854
- return this.delete(url, params);
15811
+ return Requests.delete(url, params);
15855
15812
  }
15856
- return this.get(url);
15813
+ return Requests.get(url);
15857
15814
  };
15858
- //The base url of the API.
15859
15815
  Requests.baseUrl = "";
15860
- //The Json Web Token to send in the header
15861
15816
  Requests.authToken = "";
15862
- //The ID of the community that will be added to request
15863
15817
  Requests.community_id = "";
15864
15818
  return Requests;
15865
15819
  }());
@@ -16156,7 +16110,7 @@ var Auth = /** @class */ (function () {
16156
16110
  * @returns promise
16157
16111
  */
16158
16112
  Auth.resetPassword = function (data) {
16159
- return Requests.processRoute(AuthRoutes.routes.forgot_password, data);
16113
+ return Requests.processRoute(AuthRoutes.routes.reset_password, data);
16160
16114
  };
16161
16115
  return Auth;
16162
16116
  }());