@osovitny/anatoly 2.0.33 → 2.0.35
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/bundles/osovitny-anatoly.umd.js +48 -35
- package/bundles/osovitny-anatoly.umd.js.map +1 -1
- package/bundles/osovitny-anatoly.umd.min.js +1 -1
- package/bundles/osovitny-anatoly.umd.min.js.map +1 -1
- package/esm2015/lib/core/services/loading.service.js +7 -1
- package/esm2015/lib/data/base/base-api.service.js +29 -18
- package/esm2015/lib/data/base/grid/base-grid-edit.service.js +9 -8
- package/esm2015/lib/data/base/grid/base-grid-read.service.js +5 -9
- package/esm2015/lib/data/data.module.js +3 -3
- package/esm2015/lib/data/services/billing-api.service.js +13 -13
- package/esm2015/public-api.js +2 -3
- package/fesm2015/osovitny-anatoly.js +60 -46
- package/fesm2015/osovitny-anatoly.js.map +1 -1
- package/lib/core/services/loading.service.d.ts +1 -0
- package/lib/data/base/base-api.service.d.ts +2 -0
- package/lib/data/base/grid/base-grid-edit.service.d.ts +1 -1
- package/lib/data/base/grid/base-grid-read.service.d.ts +1 -1
- package/osovitny-anatoly.metadata.json +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +0 -1
|
@@ -448,6 +448,12 @@
|
|
|
448
448
|
_this.isFreezed = false;
|
|
449
449
|
}, timeout);
|
|
450
450
|
};
|
|
451
|
+
LoadingService.prototype.reset = function () {
|
|
452
|
+
if (this.counter > 0) {
|
|
453
|
+
this.next(false);
|
|
454
|
+
}
|
|
455
|
+
this.counter = 0;
|
|
456
|
+
};
|
|
451
457
|
return LoadingService;
|
|
452
458
|
}(rxjs.BehaviorSubject));
|
|
453
459
|
LoadingService.ɵprov = i0.ɵɵdefineInjectable({ factory: function LoadingService_Factory() { return new LoadingService(); }, token: LoadingService, providedIn: "root" });
|
|
@@ -1388,20 +1394,17 @@
|
|
|
1388
1394
|
var BaseApiService = /** @class */ (function () {
|
|
1389
1395
|
function BaseApiService(http) {
|
|
1390
1396
|
this.http = http;
|
|
1391
|
-
this.baseUrl = '';
|
|
1392
1397
|
}
|
|
1393
1398
|
BaseApiService.prototype.serializeParams = function (data) {
|
|
1394
|
-
return data ? '?' + $.param(data) : '';
|
|
1399
|
+
return data ? ('?' + $.param(data)) : '';
|
|
1395
1400
|
};
|
|
1396
|
-
//
|
|
1401
|
+
//api
|
|
1397
1402
|
BaseApiService.prototype.get = function (action, data, responseType) {
|
|
1398
1403
|
if (!responseType) {
|
|
1399
1404
|
responseType = 'json';
|
|
1400
1405
|
}
|
|
1401
1406
|
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; }));
|
|
1407
|
+
return this.http.get(url, { responseType: responseType }).pipe(operators.map(function (res) { return res; }));
|
|
1405
1408
|
};
|
|
1406
1409
|
BaseApiService.prototype.post = function (action, data, responseType) {
|
|
1407
1410
|
if (!responseType) {
|
|
@@ -1424,17 +1427,31 @@
|
|
|
1424
1427
|
var url = this.baseUrl + "/" + action + this.serializeParams(data);
|
|
1425
1428
|
return this.http.delete(url, { responseType: responseType });
|
|
1426
1429
|
};
|
|
1427
|
-
//
|
|
1430
|
+
//gets
|
|
1428
1431
|
BaseApiService.prototype.getById = function (id) {
|
|
1429
1432
|
return this.get('getById', { id: id });
|
|
1430
1433
|
};
|
|
1431
1434
|
BaseApiService.prototype.getAll = function (data) {
|
|
1432
|
-
return this.get('
|
|
1435
|
+
return this.get('getAll', data).pipe(operators.map(function (res) { return res; }));
|
|
1436
|
+
};
|
|
1437
|
+
BaseApiService.prototype.getExternalTextFile = function (url) {
|
|
1438
|
+
return this.http.get(url);
|
|
1439
|
+
};
|
|
1440
|
+
BaseApiService.prototype.getExternalJsonFile = function (url) {
|
|
1441
|
+
return this.http.get(url);
|
|
1433
1442
|
};
|
|
1434
1443
|
BaseApiService.prototype.getJsonFile = function (fileName) {
|
|
1435
1444
|
var jsonsUrl = AppCoreSettings.jsonsUrl;
|
|
1436
1445
|
var jsonVersion = AppCoreSettings.jsonVersion;
|
|
1437
|
-
var
|
|
1446
|
+
var isCDNEnabled = AppCoreSettings.isCDNEnabled;
|
|
1447
|
+
var cdnSasToken = AppCoreSettings.cdnSasToken;
|
|
1448
|
+
var url = "";
|
|
1449
|
+
if (isCDNEnabled) {
|
|
1450
|
+
url = jsonsUrl + "/" + fileName + cdnSasToken;
|
|
1451
|
+
}
|
|
1452
|
+
else {
|
|
1453
|
+
url = jsonsUrl + "/" + fileName + '?' + jsonVersion;
|
|
1454
|
+
}
|
|
1438
1455
|
return this.http.get(url).pipe(operators.map(function (res) { return res; }));
|
|
1439
1456
|
};
|
|
1440
1457
|
return BaseApiService;
|
|
@@ -1747,12 +1764,11 @@
|
|
|
1747
1764
|
function BaseGridReadService(http) {
|
|
1748
1765
|
var _this = _super.call(this, []) || this;
|
|
1749
1766
|
_this.http = http;
|
|
1750
|
-
_this.baseReadUrl = "";
|
|
1751
1767
|
_this.data = [];
|
|
1752
1768
|
return _this;
|
|
1753
1769
|
}
|
|
1754
1770
|
BaseGridReadService.prototype.serializeParams = function (data) {
|
|
1755
|
-
return data ?
|
|
1771
|
+
return data ? ('?' + $.param(data)) : '';
|
|
1756
1772
|
};
|
|
1757
1773
|
BaseGridReadService.prototype.read = function (params, success, error) {
|
|
1758
1774
|
var _this = this;
|
|
@@ -1760,17 +1776,14 @@
|
|
|
1760
1776
|
return _super.prototype.next.call(this, this.data);
|
|
1761
1777
|
}
|
|
1762
1778
|
var url = this.baseReadUrl;
|
|
1763
|
-
if (typeof params ===
|
|
1779
|
+
if (typeof params === 'undefined') {
|
|
1764
1780
|
params = this.savedReadParams;
|
|
1765
1781
|
}
|
|
1766
1782
|
if (params) {
|
|
1767
1783
|
url = this.baseReadUrl + ("" + this.serializeParams(params));
|
|
1768
1784
|
this.savedReadParams = params;
|
|
1769
1785
|
}
|
|
1770
|
-
this.http
|
|
1771
|
-
.get(url)
|
|
1772
|
-
.pipe(operators.map(function (res) { return res; }))
|
|
1773
|
-
.subscribe(function (data) {
|
|
1786
|
+
this.http.get(url).pipe(operators.map(function (res) { return res; })).subscribe(function (data) {
|
|
1774
1787
|
_super.prototype.next.call(_this, data);
|
|
1775
1788
|
if (success)
|
|
1776
1789
|
success();
|
|
@@ -1793,7 +1806,6 @@
|
|
|
1793
1806
|
function BaseGridEditService(http) {
|
|
1794
1807
|
var _this = _super.call(this, http) || this;
|
|
1795
1808
|
_this.http = http;
|
|
1796
|
-
_this.baseUrl = "";
|
|
1797
1809
|
return _this;
|
|
1798
1810
|
}
|
|
1799
1811
|
BaseGridEditService.prototype.reset = function () {
|
|
@@ -1811,9 +1823,10 @@
|
|
|
1811
1823
|
};
|
|
1812
1824
|
BaseGridEditService.prototype.save = function (data, isNew, sucess) {
|
|
1813
1825
|
var _this = this;
|
|
1814
|
-
var action = isNew ?
|
|
1826
|
+
var action = isNew ? 'add' : 'update';
|
|
1815
1827
|
this.reset();
|
|
1816
|
-
this.post(action, data).subscribe(function () {
|
|
1828
|
+
this.post(action, data).subscribe(function () {
|
|
1829
|
+
}, function () {
|
|
1817
1830
|
_this.read();
|
|
1818
1831
|
}, function () {
|
|
1819
1832
|
_this.read();
|
|
@@ -1821,10 +1834,11 @@
|
|
|
1821
1834
|
sucess();
|
|
1822
1835
|
});
|
|
1823
1836
|
};
|
|
1824
|
-
BaseGridEditService.prototype.
|
|
1837
|
+
BaseGridEditService.prototype.delete = function (data, sucess) {
|
|
1825
1838
|
var _this = this;
|
|
1826
1839
|
this.reset();
|
|
1827
|
-
this.post(
|
|
1840
|
+
this.post('delete', data).subscribe(function () {
|
|
1841
|
+
}, function () {
|
|
1828
1842
|
_this.read();
|
|
1829
1843
|
}, function () {
|
|
1830
1844
|
_this.read();
|
|
@@ -1901,30 +1915,30 @@
|
|
|
1901
1915
|
return _this;
|
|
1902
1916
|
}
|
|
1903
1917
|
BillingApiService.prototype.requestNewSubscription = function (requestedPlan, success, error) {
|
|
1904
|
-
this.postQS("requestNewSubscription", { requestedPlan: requestedPlan }).subscribe(function (data) {
|
|
1905
|
-
if (error)
|
|
1906
|
-
error();
|
|
1907
|
-
}, function () {
|
|
1918
|
+
this.postQS("requestNewSubscription", { requestedPlan: requestedPlan }).subscribe(function (data) {
|
|
1908
1919
|
if (success)
|
|
1909
1920
|
success();
|
|
1921
|
+
}, function (e) {
|
|
1922
|
+
if (error)
|
|
1923
|
+
error();
|
|
1910
1924
|
});
|
|
1911
1925
|
};
|
|
1912
1926
|
BillingApiService.prototype.cancelRequestedSubscription = function (success, error) {
|
|
1913
|
-
this.postQS("cancelRequestedSubscription", null).subscribe(function (data) {
|
|
1914
|
-
if (error)
|
|
1915
|
-
error();
|
|
1916
|
-
}, function () {
|
|
1927
|
+
this.postQS("cancelRequestedSubscription", null).subscribe(function (data) {
|
|
1917
1928
|
if (success)
|
|
1918
1929
|
success();
|
|
1930
|
+
}, function (e) {
|
|
1931
|
+
if (error)
|
|
1932
|
+
error();
|
|
1919
1933
|
});
|
|
1920
1934
|
};
|
|
1921
1935
|
BillingApiService.prototype.buyAccess = function (requestedPlan, success, error) {
|
|
1922
|
-
this.postQS("buyAccess", { requestedPlan: requestedPlan }).subscribe(function (data) {
|
|
1923
|
-
if (error)
|
|
1924
|
-
error();
|
|
1925
|
-
}, function () {
|
|
1936
|
+
this.postQS("buyAccess", { requestedPlan: requestedPlan }).subscribe(function (data) {
|
|
1926
1937
|
if (success)
|
|
1927
1938
|
success();
|
|
1939
|
+
}, function (e) {
|
|
1940
|
+
if (error)
|
|
1941
|
+
error();
|
|
1928
1942
|
});
|
|
1929
1943
|
};
|
|
1930
1944
|
return BillingApiService;
|
|
@@ -3195,7 +3209,7 @@
|
|
|
3195
3209
|
];
|
|
3196
3210
|
|
|
3197
3211
|
/*
|
|
3198
|
-
* Public API
|
|
3212
|
+
* Public API
|
|
3199
3213
|
*/
|
|
3200
3214
|
|
|
3201
3215
|
/**
|
|
@@ -3257,7 +3271,6 @@
|
|
|
3257
3271
|
exports.Urls = Urls;
|
|
3258
3272
|
exports.Utils = Utils;
|
|
3259
3273
|
exports.ValidationSummaryComponent = ValidationSummaryComponent;
|
|
3260
|
-
exports.consts = consts;
|
|
3261
3274
|
exports.customTranslateLoaderFactory = customTranslateLoaderFactory;
|
|
3262
3275
|
exports.localizationInitializerFactory = localizationInitializerFactory;
|
|
3263
3276
|
exports.throwIfAlreadyLoaded = throwIfAlreadyLoaded;
|