ngx-rendering-service-lib 0.0.66973 → 0.0.66974

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.
@@ -56,7 +56,7 @@ class RenderingModule {
56
56
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
57
57
 
58
58
  __webpack_require__.r(__webpack_exports__);
59
- /* harmony import */ var _home_marian_development_edu_sharing_community_services_rendering2_frontend_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 9204);
59
+ /* harmony import */ var _home_torsten_git_edu_sharing_community_services_rendering2_frontend_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 9204);
60
60
  /* harmony import */ var zone_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! zone.js */ 4124);
61
61
  /* harmony import */ var zone_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(zone_js__WEBPACK_IMPORTED_MODULE_1__);
62
62
  /* harmony import */ var _angular_platform_browser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/platform-browser */ 2085);
@@ -75,7 +75,7 @@ __webpack_require__.r(__webpack_exports__);
75
75
 
76
76
 
77
77
 
78
- void (0,_home_marian_development_edu_sharing_community_services_rendering2_frontend_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () {
78
+ void (0,_home_torsten_git_edu_sharing_community_services_rendering2_frontend_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () {
79
79
  const app = yield (0,_angular_platform_browser__WEBPACK_IMPORTED_MODULE_3__.createApplication)({
80
80
  providers: [ngx_edu_sharing_api__WEBPACK_IMPORTED_MODULE_4__.ApiHelpersService, (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.importProvidersFrom)(ngx_rendering_service_api__WEBPACK_IMPORTED_MODULE_6__.RenderingServiceApiModule.forRoot()), (0,_angular_common_http__WEBPACK_IMPORTED_MODULE_7__.provideHttpClient)((0,_angular_common_http__WEBPACK_IMPORTED_MODULE_7__.withInterceptorsFromDi)())]
81
81
  });
@@ -197,7 +197,7 @@ function getConfigProvider(params) {
197
197
 
198
198
  __webpack_require__.r(__webpack_exports__);
199
199
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
200
- /* harmony export */ AppModule: () => (/* binding */ AppModule),
200
+ /* harmony export */ API_INTERCEPTOR_PROVIDER: () => (/* binding */ API_INTERCEPTOR_PROVIDER),
201
201
  /* harmony export */ AssetControllerService: () => (/* binding */ AssetControllerService),
202
202
  /* harmony export */ EduTrackingControllerService: () => (/* binding */ EduTrackingControllerService),
203
203
  /* harmony export */ EduTrackingControllerWrapperService: () => (/* binding */ EduTrackingControllerWrapperService),
@@ -212,9 +212,9 @@ __webpack_require__.r(__webpack_exports__);
212
212
  /* harmony export */ trackObject: () => (/* binding */ trackObject)
213
213
  /* harmony export */ });
214
214
  /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 7580);
215
+ /* harmony import */ var _angular_common_http__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/common/http */ 9648);
215
216
  /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/operators */ 1567);
216
217
  /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ 271);
217
- /* harmony import */ var _angular_common_http__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/common/http */ 9648);
218
218
  /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs */ 6042);
219
219
  /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs */ 8764);
220
220
  /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs */ 6647);
@@ -301,6 +301,60 @@ function getConfigProvider(params) {
301
301
  useFactory: configParams => RenderingServiceApiConfiguration.create(configParams)
302
302
  }];
303
303
  }
304
+ class RenderingServiceApiInterceptor {
305
+ constructor(configuration) {
306
+ this.configuration = configuration;
307
+ }
308
+ /** Set to session key */
309
+ bearer(token) {
310
+ this.nextAuthHeader = 'Authorization';
311
+ this.nextAuthValue = 'Bearer ' + token;
312
+ }
313
+ /** Clear any authentication headers (to be called after logout) */
314
+ clear() {
315
+ this.nextAuthHeader = undefined;
316
+ this.nextAuthValue = undefined;
317
+ }
318
+ /** Apply the current authorization headers to the given request */
319
+ intercept(req, next) {
320
+ const headers = {};
321
+ // We filter for requests that actually target the API since this interceptor will be called
322
+ // on all HTTP requests by the application, not limited to this library. (See notes in
323
+ // `edu-sharing-api.module.ts`.)
324
+ const isApiRequest = req.url.startsWith(this.configuration.rootUrl);
325
+ if (isApiRequest) {
326
+ if (this.nextAuthHeader) {
327
+ headers[this.nextAuthHeader] = this.nextAuthValue;
328
+ }
329
+ } else {
330
+ return next.handle(req);
331
+ }
332
+ // Apply the headers to the request
333
+ return next.handle(req.clone({
334
+ setHeaders: headers,
335
+ // rs requires cookies
336
+ withCredentials: true
337
+ }));
338
+ }
339
+ static {
340
+ this.ɵfac = function RenderingServiceApiInterceptor_Factory(__ngFactoryType__) {
341
+ return new (__ngFactoryType__ || RenderingServiceApiInterceptor)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](ApiConfiguration));
342
+ };
343
+ }
344
+ static {
345
+ this.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({
346
+ token: RenderingServiceApiInterceptor,
347
+ factory: RenderingServiceApiInterceptor.ɵfac
348
+ });
349
+ }
350
+ }
351
+ (() => {
352
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](RenderingServiceApiInterceptor, [{
353
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable
354
+ }], () => [{
355
+ type: ApiConfiguration
356
+ }], null);
357
+ })();
304
358
 
305
359
  /* tslint:disable */
306
360
  /* eslint-disable */
@@ -1579,10 +1633,10 @@ class PingControllerService extends BaseService {
1579
1633
  /**
1580
1634
  * Module that provides all services and configuration.
1581
1635
  */
1582
- class ApiModule {
1636
+ class RenderingServiceModule {
1583
1637
  static forRoot(params) {
1584
1638
  return {
1585
- ngModule: ApiModule,
1639
+ ngModule: RenderingServiceModule,
1586
1640
  providers: [{
1587
1641
  provide: ApiConfiguration,
1588
1642
  useValue: params
@@ -1591,20 +1645,20 @@ class ApiModule {
1591
1645
  }
1592
1646
  constructor(parentModule, http) {
1593
1647
  if (parentModule) {
1594
- throw new Error('ApiModule is already loaded. Import in your base AppModule only.');
1648
+ throw new Error('RenderingServiceModule is already loaded. Import in your base AppModule only.');
1595
1649
  }
1596
1650
  if (!http) {
1597
1651
  throw new Error('You need to import the HttpClientModule in your AppModule! \n' + 'See also https://github.com/angular/angular/issues/20575');
1598
1652
  }
1599
1653
  }
1600
1654
  static {
1601
- this.ɵfac = function ApiModule_Factory(__ngFactoryType__) {
1602
- return new (__ngFactoryType__ || ApiModule)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](ApiModule, 12), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_common_http__WEBPACK_IMPORTED_MODULE_1__.HttpClient, 8));
1655
+ this.ɵfac = function RenderingServiceModule_Factory(__ngFactoryType__) {
1656
+ return new (__ngFactoryType__ || RenderingServiceModule)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](RenderingServiceModule, 12), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_common_http__WEBPACK_IMPORTED_MODULE_1__.HttpClient, 8));
1603
1657
  };
1604
1658
  }
1605
1659
  static {
1606
1660
  this.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
1607
- type: ApiModule
1661
+ type: RenderingServiceModule
1608
1662
  });
1609
1663
  }
1610
1664
  static {
@@ -1614,7 +1668,7 @@ class ApiModule {
1614
1668
  }
1615
1669
  }
1616
1670
  (() => {
1617
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](ApiModule, [{
1671
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](RenderingServiceModule, [{
1618
1672
  type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
1619
1673
  args: [{
1620
1674
  imports: [],
@@ -1623,7 +1677,7 @@ class ApiModule {
1623
1677
  providers: [EduTrackingControllerService, AdminControllerService, RenderControllerService, ModuleInfoControllerService, JobInfoControllerService, LumiProxyControllerService, AssetControllerService, PingControllerService, ApiConfiguration]
1624
1678
  }]
1625
1679
  }], () => [{
1626
- type: ApiModule,
1680
+ type: RenderingServiceModule,
1627
1681
  decorators: [{
1628
1682
  type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
1629
1683
  }, {
@@ -1636,19 +1690,16 @@ class ApiModule {
1636
1690
  }]
1637
1691
  }], null);
1638
1692
  })();
1639
- class AppModule {}
1693
+ const API_INTERCEPTOR_PROVIDER = {
1694
+ provide: _angular_common_http__WEBPACK_IMPORTED_MODULE_1__.HTTP_INTERCEPTORS,
1695
+ useExisting: (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(() => RenderingServiceApiInterceptor),
1696
+ multi: true
1697
+ };
1640
1698
  class RenderingServiceApiModule {
1641
1699
  static forRoot(params) {
1642
1700
  return {
1643
1701
  ngModule: RenderingServiceApiModule,
1644
- providers: [
1645
- /*{
1646
- provide: HTTP_INTERCEPTORS,
1647
- useClass: RenderingServiceApiInterceptor,
1648
- multi: true
1649
- },
1650
- provideHttpClient(withInterceptorsFromDi()),*/
1651
- ...getConfigProvider(params)]
1702
+ providers: [RenderingServiceApiInterceptor, API_INTERCEPTOR_PROVIDER, ...getConfigProvider(params)]
1652
1703
  };
1653
1704
  }
1654
1705
  static {
@@ -1663,7 +1714,7 @@ class RenderingServiceApiModule {
1663
1714
  }
1664
1715
  static {
1665
1716
  this.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({
1666
- imports: [ApiModule.forRoot({})]
1717
+ imports: [RenderingServiceModule.forRoot({})]
1667
1718
  });
1668
1719
  }
1669
1720
  }
@@ -1672,7 +1723,7 @@ class RenderingServiceApiModule {
1672
1723
  type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
1673
1724
  args: [{
1674
1725
  declarations: [],
1675
- imports: [ApiModule.forRoot({})],
1726
+ imports: [RenderingServiceModule.forRoot({})],
1676
1727
  exports: []
1677
1728
  }]
1678
1729
  }], null, null);
@@ -1804,7 +1855,7 @@ __webpack_require__.r(__webpack_exports__);
1804
1855
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1805
1856
  /* harmony export */ PdfComponent: () => (/* binding */ PdfComponent)
1806
1857
  /* harmony export */ });
1807
- /* harmony import */ var _home_marian_development_edu_sharing_community_services_rendering2_frontend_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 9204);
1858
+ /* harmony import */ var _home_torsten_git_edu_sharing_community_services_rendering2_frontend_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 9204);
1808
1859
  /* harmony import */ var _rendering_module__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../rendering.module */ 168);
1809
1860
  /* harmony import */ var _angular_material_icon__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/material/icon */ 3840);
1810
1861
  /* harmony import */ var _angular_material_button__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/material/button */ 4175);
@@ -1877,7 +1928,7 @@ class PdfComponent {
1877
1928
  assetParams: assetParams
1878
1929
  };
1879
1930
  this.assetControllerService.getAsset$Response(params).subscribe(/*#__PURE__*/function () {
1880
- var _ref = (0,_home_marian_development_edu_sharing_community_services_rendering2_frontend_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (response) {
1931
+ var _ref = (0,_home_torsten_git_edu_sharing_community_services_rendering2_frontend_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (response) {
1881
1932
  if (response.headers.get('content-type') !== 'application/octet-stream') {
1882
1933
  return;
1883
1934
  }