ngx-techlify-core 11.4.5-beta.2 → 11.4.5-beta.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/bundles/ngx-techlify-core.umd.js +25 -21
- package/bundles/ngx-techlify-core.umd.js.map +1 -1
- package/bundles/ngx-techlify-core.umd.min.js +1 -1
- package/bundles/ngx-techlify-core.umd.min.js.map +1 -1
- package/esm2015/lib/core/config.service.js +1 -1
- package/esm2015/lib/core/error-handler.service.js +4 -13
- package/esm2015/lib/core/techlify-config.model.js +24 -11
- package/fesm2015/ngx-techlify-core.js +25 -21
- package/fesm2015/ngx-techlify-core.js.map +1 -1
- package/lib/core/config.service.d.ts +5 -5
- package/lib/core/error-handler.service.d.ts +1 -3
- package/lib/core/techlify-config.model.d.ts +2 -1
- package/ngx-techlify-core.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -742,26 +742,37 @@
|
|
|
742
742
|
*/
|
|
743
743
|
var TechlifyConfig = /** @class */ (function () {
|
|
744
744
|
function TechlifyConfig(data) {
|
|
745
|
+
this.data = data;
|
|
745
746
|
this.projectKey = '';
|
|
746
747
|
this.environment = '';
|
|
747
748
|
this.authClientSecret = '';
|
|
748
749
|
this.authGrantType = '';
|
|
749
750
|
this.apiUrl = '';
|
|
750
751
|
this.isLogoutWhileApiGetsFailed = false;
|
|
751
|
-
this.loadFromMap(
|
|
752
|
-
}
|
|
753
|
-
TechlifyConfig.prototype.loadFromMap = function (
|
|
754
|
-
|
|
755
|
-
this.
|
|
756
|
-
this.
|
|
757
|
-
this.
|
|
758
|
-
this.
|
|
759
|
-
this.
|
|
760
|
-
this.
|
|
761
|
-
this.
|
|
752
|
+
this.loadFromMap();
|
|
753
|
+
}
|
|
754
|
+
TechlifyConfig.prototype.loadFromMap = function () {
|
|
755
|
+
var _a, _b;
|
|
756
|
+
this.projectKey = this.data.projectKey;
|
|
757
|
+
this.environment = this.data.environment;
|
|
758
|
+
this.authClientSecret = this.data.authClientSecret;
|
|
759
|
+
this.authGrantType = this.data.authGrantType;
|
|
760
|
+
this.apiUrl = this.data.apiUrl;
|
|
761
|
+
this.storage = (_a = this.data) === null || _a === void 0 ? void 0 : _a.storage;
|
|
762
|
+
this.rawConfigs = this.data;
|
|
763
|
+
this.isLogoutWhileApiGetsFailed = (_b = this.data) === null || _b === void 0 ? void 0 : _b.isLogoutWhileApiGetsFailed;
|
|
762
764
|
};
|
|
763
765
|
return TechlifyConfig;
|
|
764
766
|
}());
|
|
767
|
+
TechlifyConfig.ɵprov = i0.ɵɵdefineInjectable({ factory: function TechlifyConfig_Factory() { return new TechlifyConfig(i0.ɵɵinject("data")); }, token: TechlifyConfig, providedIn: "root" });
|
|
768
|
+
TechlifyConfig.decorators = [
|
|
769
|
+
{ type: i0.Injectable, args: [{
|
|
770
|
+
providedIn: 'root'
|
|
771
|
+
},] }
|
|
772
|
+
];
|
|
773
|
+
TechlifyConfig.ctorParameters = function () { return [
|
|
774
|
+
{ type: undefined, decorators: [{ type: i0.Inject, args: ['data',] }] }
|
|
775
|
+
]; };
|
|
765
776
|
|
|
766
777
|
/**
|
|
767
778
|
* Service that provides settings for all other services
|
|
@@ -884,9 +895,8 @@
|
|
|
884
895
|
* @since 20171202
|
|
885
896
|
*/
|
|
886
897
|
var ErrorHandlerService = /** @class */ (function () {
|
|
887
|
-
function ErrorHandlerService(alerter
|
|
898
|
+
function ErrorHandlerService(alerter) {
|
|
888
899
|
this.alerter = alerter;
|
|
889
|
-
this.config = config;
|
|
890
900
|
}
|
|
891
901
|
ErrorHandlerService.prototype.handleError = function (errorResponse, msg) {
|
|
892
902
|
if (msg === void 0) { msg = ''; }
|
|
@@ -914,23 +924,17 @@
|
|
|
914
924
|
}
|
|
915
925
|
var errMessage = errors.length ? errors[0] : msg;
|
|
916
926
|
this.alerter.addAlert("Error: " + errMessage, "warning");
|
|
917
|
-
if (errorResponse.status == 403 && this.config.isLogoutWhileApiGetsFailed) {
|
|
918
|
-
sessionStorage.clear();
|
|
919
|
-
localStorage.clear();
|
|
920
|
-
location.reload();
|
|
921
|
-
}
|
|
922
927
|
};
|
|
923
928
|
return ErrorHandlerService;
|
|
924
929
|
}());
|
|
925
|
-
ErrorHandlerService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ErrorHandlerService_Factory() { return new ErrorHandlerService(i0.ɵɵinject(AlertService)
|
|
930
|
+
ErrorHandlerService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ErrorHandlerService_Factory() { return new ErrorHandlerService(i0.ɵɵinject(AlertService)); }, token: ErrorHandlerService, providedIn: "root" });
|
|
926
931
|
ErrorHandlerService.decorators = [
|
|
927
932
|
{ type: i0.Injectable, args: [{
|
|
928
933
|
providedIn: 'root'
|
|
929
934
|
},] }
|
|
930
935
|
];
|
|
931
936
|
ErrorHandlerService.ctorParameters = function () { return [
|
|
932
|
-
{ type: AlertService }
|
|
933
|
-
{ type: TechlifyConfig }
|
|
937
|
+
{ type: AlertService }
|
|
934
938
|
]; };
|
|
935
939
|
|
|
936
940
|
var log = new Logger('ErrorHandlerInterceptor');
|