@osovitny/anatoly 2.0.33 → 2.0.34

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.
@@ -1388,20 +1388,17 @@
1388
1388
  var BaseApiService = /** @class */ (function () {
1389
1389
  function BaseApiService(http) {
1390
1390
  this.http = http;
1391
- this.baseUrl = '';
1392
1391
  }
1393
1392
  BaseApiService.prototype.serializeParams = function (data) {
1394
- return data ? '?' + $.param(data) : '';
1393
+ return data ? ('?' + $.param(data)) : '';
1395
1394
  };
1396
- // api
1395
+ //api
1397
1396
  BaseApiService.prototype.get = function (action, data, responseType) {
1398
1397
  if (!responseType) {
1399
1398
  responseType = 'json';
1400
1399
  }
1401
1400
  var url = this.baseUrl + "/" + action + this.serializeParams(data);
1402
- return this.http
1403
- .get(url, { responseType: responseType })
1404
- .pipe(operators.map(function (res) { return res; }));
1401
+ return this.http.get(url, { responseType: responseType }).pipe(operators.map(function (res) { return res; }));
1405
1402
  };
1406
1403
  BaseApiService.prototype.post = function (action, data, responseType) {
1407
1404
  if (!responseType) {
@@ -1424,17 +1421,25 @@
1424
1421
  var url = this.baseUrl + "/" + action + this.serializeParams(data);
1425
1422
  return this.http.delete(url, { responseType: responseType });
1426
1423
  };
1427
- // gets
1428
- BaseApiService.prototype.getById = function (id) {
1429
- return this.get('getById', { id: id });
1424
+ //gets
1425
+ BaseApiService.prototype.getExternalTextFile = function (url) {
1426
+ return this.http.get(url);
1430
1427
  };
1431
- BaseApiService.prototype.getAll = function (data) {
1432
- return this.get('getall', data).pipe(operators.map(function (res) { return res; }));
1428
+ BaseApiService.prototype.getExternalJsonFile = function (url) {
1429
+ return this.http.get(url);
1433
1430
  };
1434
1431
  BaseApiService.prototype.getJsonFile = function (fileName) {
1435
1432
  var jsonsUrl = AppCoreSettings.jsonsUrl;
1436
1433
  var jsonVersion = AppCoreSettings.jsonVersion;
1437
- var url = jsonsUrl + '/' + fileName + '?' + jsonVersion;
1434
+ var isCDNEnabled = AppCoreSettings.isCDNEnabled;
1435
+ var cdnSasToken = AppCoreSettings.cdnSasToken;
1436
+ var url = "";
1437
+ if (isCDNEnabled) {
1438
+ url = jsonsUrl + "/" + fileName + cdnSasToken;
1439
+ }
1440
+ else {
1441
+ url = jsonsUrl + "/" + fileName + '?' + jsonVersion;
1442
+ }
1438
1443
  return this.http.get(url).pipe(operators.map(function (res) { return res; }));
1439
1444
  };
1440
1445
  return BaseApiService;
@@ -1747,12 +1752,11 @@
1747
1752
  function BaseGridReadService(http) {
1748
1753
  var _this = _super.call(this, []) || this;
1749
1754
  _this.http = http;
1750
- _this.baseReadUrl = "";
1751
1755
  _this.data = [];
1752
1756
  return _this;
1753
1757
  }
1754
1758
  BaseGridReadService.prototype.serializeParams = function (data) {
1755
- return data ? "?" + $.param(data) : "";
1759
+ return data ? ('?' + $.param(data)) : '';
1756
1760
  };
1757
1761
  BaseGridReadService.prototype.read = function (params, success, error) {
1758
1762
  var _this = this;
@@ -1760,17 +1764,14 @@
1760
1764
  return _super.prototype.next.call(this, this.data);
1761
1765
  }
1762
1766
  var url = this.baseReadUrl;
1763
- if (typeof params === "undefined") {
1767
+ if (typeof params === 'undefined') {
1764
1768
  params = this.savedReadParams;
1765
1769
  }
1766
1770
  if (params) {
1767
1771
  url = this.baseReadUrl + ("" + this.serializeParams(params));
1768
1772
  this.savedReadParams = params;
1769
1773
  }
1770
- this.http
1771
- .get(url)
1772
- .pipe(operators.map(function (res) { return res; }))
1773
- .subscribe(function (data) {
1774
+ this.http.get(url).pipe(operators.map(function (res) { return res; })).subscribe(function (data) {
1774
1775
  _super.prototype.next.call(_this, data);
1775
1776
  if (success)
1776
1777
  success();
@@ -1793,7 +1794,6 @@
1793
1794
  function BaseGridEditService(http) {
1794
1795
  var _this = _super.call(this, http) || this;
1795
1796
  _this.http = http;
1796
- _this.baseUrl = "";
1797
1797
  return _this;
1798
1798
  }
1799
1799
  BaseGridEditService.prototype.reset = function () {
@@ -1811,9 +1811,10 @@
1811
1811
  };
1812
1812
  BaseGridEditService.prototype.save = function (data, isNew, sucess) {
1813
1813
  var _this = this;
1814
- var action = isNew ? "add" : "update";
1814
+ var action = isNew ? 'add' : 'update';
1815
1815
  this.reset();
1816
- this.post(action, data).subscribe(function () { }, function () {
1816
+ this.post(action, data).subscribe(function () {
1817
+ }, function () {
1817
1818
  _this.read();
1818
1819
  }, function () {
1819
1820
  _this.read();
@@ -1821,10 +1822,11 @@
1821
1822
  sucess();
1822
1823
  });
1823
1824
  };
1824
- BaseGridEditService.prototype.remove = function (data, sucess) {
1825
+ BaseGridEditService.prototype.delete = function (data, sucess) {
1825
1826
  var _this = this;
1826
1827
  this.reset();
1827
- this.post("remove", data).subscribe(function () { }, function () {
1828
+ this.post('delete', data).subscribe(function () {
1829
+ }, function () {
1828
1830
  _this.read();
1829
1831
  }, function () {
1830
1832
  _this.read();
@@ -1901,30 +1903,30 @@
1901
1903
  return _this;
1902
1904
  }
1903
1905
  BillingApiService.prototype.requestNewSubscription = function (requestedPlan, success, error) {
1904
- this.postQS("requestNewSubscription", { requestedPlan: requestedPlan }).subscribe(function (data) { }, function (e) {
1905
- if (error)
1906
- error();
1907
- }, function () {
1906
+ this.postQS("requestNewSubscription", { requestedPlan: requestedPlan }).subscribe(function (data) {
1908
1907
  if (success)
1909
1908
  success();
1909
+ }, function (e) {
1910
+ if (error)
1911
+ error();
1910
1912
  });
1911
1913
  };
1912
1914
  BillingApiService.prototype.cancelRequestedSubscription = function (success, error) {
1913
- this.postQS("cancelRequestedSubscription", null).subscribe(function (data) { }, function (e) {
1914
- if (error)
1915
- error();
1916
- }, function () {
1915
+ this.postQS("cancelRequestedSubscription", null).subscribe(function (data) {
1917
1916
  if (success)
1918
1917
  success();
1918
+ }, function (e) {
1919
+ if (error)
1920
+ error();
1919
1921
  });
1920
1922
  };
1921
1923
  BillingApiService.prototype.buyAccess = function (requestedPlan, success, error) {
1922
- this.postQS("buyAccess", { requestedPlan: requestedPlan }).subscribe(function (data) { }, function (e) {
1923
- if (error)
1924
- error();
1925
- }, function () {
1924
+ this.postQS("buyAccess", { requestedPlan: requestedPlan }).subscribe(function (data) {
1926
1925
  if (success)
1927
1926
  success();
1927
+ }, function (e) {
1928
+ if (error)
1929
+ error();
1928
1930
  });
1929
1931
  };
1930
1932
  return BillingApiService;
@@ -3195,7 +3197,7 @@
3195
3197
  ];
3196
3198
 
3197
3199
  /*
3198
- * Public API Surface of anatoly
3200
+ * Public API
3199
3201
  */
3200
3202
 
3201
3203
  /**
@@ -3257,7 +3259,6 @@
3257
3259
  exports.Urls = Urls;
3258
3260
  exports.Utils = Utils;
3259
3261
  exports.ValidationSummaryComponent = ValidationSummaryComponent;
3260
- exports.consts = consts;
3261
3262
  exports.customTranslateLoaderFactory = customTranslateLoaderFactory;
3262
3263
  exports.localizationInitializerFactory = localizationInitializerFactory;
3263
3264
  exports.throwIfAlreadyLoaded = throwIfAlreadyLoaded;