@seniorsistemas/platform-components 5.2.0 → 5.2.2
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/seniorsistemas-platform-components.umd.js +10 -38
- package/bundles/seniorsistemas-platform-components.umd.js.map +1 -1
- package/bundles/seniorsistemas-platform-components.umd.min.js +1 -1
- package/bundles/seniorsistemas-platform-components.umd.min.js.map +1 -1
- package/esm2015/modules/http-interceptor/http-interceptor.module.js +2 -3
- package/esm2015/modules/http-interceptor/http-interceptor.service.js +11 -21
- package/esm2015/modules/http-interceptor/index.js +1 -2
- package/esm5/modules/http-interceptor/http-interceptor.module.js +2 -3
- package/esm5/modules/http-interceptor/http-interceptor.service.js +11 -24
- package/esm5/modules/http-interceptor/index.js +1 -2
- package/fesm2015/seniorsistemas-platform-components.js +12 -33
- package/fesm2015/seniorsistemas-platform-components.js.map +1 -1
- package/fesm5/seniorsistemas-platform-components.js +12 -39
- package/fesm5/seniorsistemas-platform-components.js.map +1 -1
- package/modules/http-interceptor/http-interceptor.service.d.ts +2 -5
- package/modules/http-interceptor/index.d.ts +0 -1
- package/package.json +2 -2
- package/seniorsistemas-platform-components.metadata.json +1 -1
- package/esm2015/modules/http-interceptor/x-services-url.service.js +0 -17
- package/esm5/modules/http-interceptor/x-services-url.service.js +0 -20
- package/modules/http-interceptor/x-services-url.service.d.ts +0 -4
|
@@ -1853,54 +1853,27 @@
|
|
|
1853
1853
|
return RestUrl;
|
|
1854
1854
|
}());
|
|
1855
1855
|
|
|
1856
|
-
var XServicesUrl = /** @class */ (function () {
|
|
1857
|
-
function XServicesUrl() {
|
|
1858
|
-
}
|
|
1859
|
-
XServicesUrl.prototype.get = function () {
|
|
1860
|
-
return rxjs.defer(function () {
|
|
1861
|
-
var url = seniorPlatformData.service.getXServicesUrl();
|
|
1862
|
-
return rxjs.from(url);
|
|
1863
|
-
});
|
|
1864
|
-
};
|
|
1865
|
-
XServicesUrl = __decorate([
|
|
1866
|
-
core.Injectable()
|
|
1867
|
-
], XServicesUrl);
|
|
1868
|
-
return XServicesUrl;
|
|
1869
|
-
}());
|
|
1870
|
-
|
|
1871
1856
|
var HttpInterceptor = /** @class */ (function () {
|
|
1872
|
-
function HttpInterceptor(restUrl
|
|
1857
|
+
function HttpInterceptor(restUrl) {
|
|
1873
1858
|
this.restUrl = restUrl;
|
|
1874
|
-
this.xServicesUrl = xServicesUrl;
|
|
1875
1859
|
}
|
|
1876
1860
|
HttpInterceptor.prototype.intercept = function (originalReq, next) {
|
|
1877
|
-
var _this = this;
|
|
1878
1861
|
if (!originalReq.url.includes("://")) {
|
|
1879
|
-
var getAuthHeader = rxjs.defer(function () { return rxjs.from(seniorPlatformData.user.getAuthHeader()); });
|
|
1880
|
-
if (/^\/?[^\/]+\/[^\/]+\/api\/(?:latest|v\d+)\/.+$/g.test(originalReq.url)) {
|
|
1881
|
-
var xUrl = this.xServicesUrl.get();
|
|
1882
|
-
return rxjs.forkJoin({ xUrl: xUrl, getAuthHeader: getAuthHeader }).pipe(operators.mergeMap(function (values) {
|
|
1883
|
-
return _this.injectBaseUrl(originalReq, next, values.xUrl, values.getAuthHeader);
|
|
1884
|
-
}));
|
|
1885
|
-
}
|
|
1886
1862
|
var getRestUrl = this.restUrl.get();
|
|
1887
|
-
|
|
1863
|
+
var getAuthHeader = rxjs.defer(function () { return rxjs.from(seniorPlatformData.user.getAuthHeader()); });
|
|
1864
|
+
return rxjs.forkJoin(getRestUrl, getAuthHeader).pipe(operators.flatMap(function (values) {
|
|
1888
1865
|
var _a = __read(values, 2), bridgeUrl = _a[0], authHeader = _a[1];
|
|
1889
|
-
|
|
1866
|
+
var request = originalReq.clone({
|
|
1867
|
+
url: bridgeUrl + originalReq.url,
|
|
1868
|
+
headers: originalReq.headers.set("Authorization", authHeader)
|
|
1869
|
+
});
|
|
1870
|
+
return next.handle(request);
|
|
1890
1871
|
}));
|
|
1891
1872
|
}
|
|
1892
1873
|
return next.handle(originalReq);
|
|
1893
1874
|
};
|
|
1894
|
-
HttpInterceptor.prototype.injectBaseUrl = function (originalReq, next, baseUrl, authorization) {
|
|
1895
|
-
var request = originalReq.clone({
|
|
1896
|
-
url: baseUrl + originalReq.url,
|
|
1897
|
-
headers: originalReq.headers.set("Authorization", authorization)
|
|
1898
|
-
});
|
|
1899
|
-
return next.handle(request);
|
|
1900
|
-
};
|
|
1901
1875
|
HttpInterceptor.ctorParameters = function () { return [
|
|
1902
|
-
{ type: RestUrl }
|
|
1903
|
-
{ type: XServicesUrl }
|
|
1876
|
+
{ type: RestUrl }
|
|
1904
1877
|
]; };
|
|
1905
1878
|
HttpInterceptor = __decorate([
|
|
1906
1879
|
core.Injectable()
|
|
@@ -1914,7 +1887,7 @@
|
|
|
1914
1887
|
HttpInterceptorModule = __decorate([
|
|
1915
1888
|
core.NgModule({
|
|
1916
1889
|
imports: [http.HttpClientModule],
|
|
1917
|
-
providers: [RestUrl,
|
|
1890
|
+
providers: [RestUrl, { provide: http.HTTP_INTERCEPTORS, useClass: HttpInterceptor, multi: true }]
|
|
1918
1891
|
})
|
|
1919
1892
|
], HttpInterceptorModule);
|
|
1920
1893
|
return HttpInterceptorModule;
|
|
@@ -2674,7 +2647,6 @@
|
|
|
2674
2647
|
exports.TranslationsConfig = TranslationsConfig;
|
|
2675
2648
|
exports.TranslationsModule = TranslationsModule;
|
|
2676
2649
|
exports.USER_INFO = USER_INFO;
|
|
2677
|
-
exports.XServicesUrl = XServicesUrl;
|
|
2678
2650
|
exports.factory = factory;
|
|
2679
2651
|
exports.ɵa = fallback;
|
|
2680
2652
|
exports.ɵb = CalendarOptionsService;
|