@eggslib/configuration 0.3.4 → 13.0.1

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.
@@ -1,4 +1,5 @@
1
1
  /**
2
2
  * Generated bundle index. Do not edit.
3
3
  */
4
+ /// <amd-module name="@eggslib/configuration" />
4
5
  export * from './public-api';
@@ -0,0 +1,52 @@
1
+ import { EventEmitter, Injectable } from '@angular/core';
2
+ import { forkJoin } from 'rxjs';
3
+ import { map } from 'rxjs/operators';
4
+ import * as i0 from "@angular/core";
5
+ import * as i1 from "@angular/common/http";
6
+ export class ConfigurationService {
7
+ constructor(http) {
8
+ this.http = http;
9
+ this.configChanged = new EventEmitter();
10
+ }
11
+ init(pathconfig, otherconfig, keycloakconfig) {
12
+ const calls = [];
13
+ calls.push(this.http.get(pathconfig));
14
+ if (otherconfig) {
15
+ calls.push(this.http.get(otherconfig));
16
+ }
17
+ if (keycloakconfig) {
18
+ calls.push(this.http.get(keycloakconfig));
19
+ }
20
+ return forkJoin(calls)
21
+ .pipe(map(res => {
22
+ this.pathconfig = res[0];
23
+ if (otherconfig) {
24
+ this.otherconfig = res[1];
25
+ }
26
+ if (keycloakconfig) {
27
+ this.keycloakconfig = res[2];
28
+ }
29
+ this.configChanged.emit();
30
+ }))
31
+ .toPromise();
32
+ }
33
+ get(key) {
34
+ let res = this.pathconfig ? this.pathconfig[key] : null;
35
+ if (!res) {
36
+ res = this.otherconfig ? this.otherconfig[key] : null;
37
+ }
38
+ if (!res) {
39
+ res = this.keycloakconfig ? this.keycloakconfig[key] : null;
40
+ }
41
+ return res;
42
+ }
43
+ }
44
+ /** @nocollapse */ ConfigurationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ConfigurationService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
45
+ /** @nocollapse */ ConfigurationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ConfigurationService, providedIn: 'root' });
46
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ConfigurationService, decorators: [{
47
+ type: Injectable,
48
+ args: [{
49
+ providedIn: 'root'
50
+ }]
51
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
52
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlndXJhdGlvbi5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvY29uZmlndXJhdGlvbi9zcmMvbGliL2NvbmZpZ3VyYXRpb24uc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsWUFBWSxFQUFFLFVBQVUsRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUV2RCxPQUFPLEVBQUMsUUFBUSxFQUFhLE1BQU0sTUFBTSxDQUFDO0FBQzFDLE9BQU8sRUFBQyxHQUFHLEVBQUMsTUFBTSxnQkFBZ0IsQ0FBQzs7O0FBS25DLE1BQU0sT0FBTyxvQkFBb0I7SUFRN0IsWUFBb0IsSUFBZ0I7UUFBaEIsU0FBSSxHQUFKLElBQUksQ0FBWTtRQUY3QixrQkFBYSxHQUF1QixJQUFJLFlBQVksRUFBUSxDQUFDO0lBR3BFLENBQUM7SUFFTSxJQUFJLENBQUMsVUFBa0IsRUFBRSxXQUFvQixFQUFFLGNBQXVCO1FBQ3pFLE1BQU0sS0FBSyxHQUFzQixFQUFFLENBQUM7UUFDcEMsS0FBSyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDO1FBQ3RDLElBQUksV0FBVyxFQUFFO1lBQ2IsS0FBSyxDQUFDLElBQUksQ0FBQyxJQUFJLEN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Zywgb3RoZXJjb25maWc/OiBzdHJpbmcsIGtleWNsb2FrY29uZmlnPzogc3RyaW5nKSB7XG4gICAgICAgIGNvbnN0IGNhbGxzOiBPYnNlcnZhYmxlPGFueT5bXSA9IFtdO1xuICAgICAgICBjYWxscy5wdXNoKHRoaXMuaHR0cC5nZXQocGF0aGNvbmZpZykpO1xuICAgICAgICBpZiAob3RoZXJjb25maWcpIHtcbiAgICAgICAgICAgIGNhbGxzLnB1c2godGhpcy5odHRwLmdldChvdGhlcmNvbmZpZykpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChrZXljbG9ha2NvbmZpZykge1xuICAgICAgICAgICAgY2FsbHMucHVzaCh0aGlzLmh0dHAuZ2V0KGtleWNsb2FrY29uZmlnKSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGZvcmtKb2luKGNhbGxzKVxuICAgICAgICAgICAgLnBpcGUoXG4gICAgICAgICAgICAgICAgbWFwKHJlcyA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucGF0aGNvbmZpZyA9IHJlc1swXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG90aGVyY29uZmlnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLm90aGVyY29uZmlnID0gcmVzWzFdO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChrZXljbG9ha2NvbmZpZykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5rZXljbG9ha2NvbmZpZyA9IHJlc1syXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbmZpZ0NoYW5nZWQuZW1pdCgpO1xuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICApXG4gICAgICAgICAgICAudG9Qcm9taXNlKCk7XG4gICAgfVxuXG4gICAgcHVibGljIGdldChrZXk6IHN0cmluZykge1xuICAgICAgICBsZXQgcmVzID0gdGhpcy5wYXRoY29uZmlnID8gdGhpcy5wYXRoY29uZmlnW2tleV0gOiBudWxsO1xuICAgICAgICBpZiAoIXJlcykge1xuICAgICAgICAgICAgcmVzID0gdGhpcy5vdGhlcmNvbmZpZyA/IHRoaXMub3RoZXJjb25maWdba2V5XSA6IG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFyZXMpIHtcbiAgICAgICAgICAgIHJlcyA9IHRoaXMua2V5Y2xvYWtjb25maWcgPyB0aGlzLmtleWNsb2FrY29uZmlnW2tleV0gOiBudWxsO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXM7XG4gICAgfVxufVxuIl19
@@ -1,7 +1,8 @@
1
- import { EventEmitter, ɵɵdefineInjectable, ɵɵinject, Injectable } from '@angular/core';
2
- import { HttpClient } from '@angular/common/http';
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, Injectable } from '@angular/core';
3
3
  import { forkJoin } from 'rxjs';
4
4
  import { map } from 'rxjs/operators';
5
+ import * as i1 from '@angular/common/http';
5
6
 
6
7
  class ConfigurationService {
7
8
  constructor(http) {
@@ -41,20 +42,18 @@ class ConfigurationService {
41
42
  return res;
42
43
  }
43
44
  }
44
- /** @nocollapse */ ConfigurationService.ɵprov = ɵɵdefineInjectable({ factory: function ConfigurationService_Factory() { return new ConfigurationService(ɵɵinject(HttpClient)); }, token: ConfigurationService, providedIn: "root" });
45
- ConfigurationService.decorators = [
46
- { type: Injectable, args: [{
47
- providedIn: 'root'
48
- },] }
49
- ];
50
- /** @nocollapse */
51
- ConfigurationService.ctorParameters = () => [
52
- { type: HttpClient }
53
- ];
45
+ /** @nocollapse */ ConfigurationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ConfigurationService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
46
+ /** @nocollapse */ ConfigurationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ConfigurationService, providedIn: 'root' });
47
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ConfigurationService, decorators: [{
48
+ type: Injectable,
49
+ args: [{
50
+ providedIn: 'root'
51
+ }]
52
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
54
53
 
55
54
  /**
56
55
  * Generated bundle index. Do not edit.
57
56
  */
58
57
 
59
58
  export { ConfigurationService };
60
- //# sourceMappingURL=eggslib-configuration.js.map
59
+ //# sourceMappingURL=eggslib-configuration.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eggslib-configuration.mjs","sources":["../../../projects/configuration/src/lib/configuration.service.ts","../../../projects/configuration/src/eggslib-configuration.ts"],"sourcesContent":["import {EventEmitter, Injectable} from '@angular/core';\nimport {HttpClient} from '@angular/common/http';\nimport {forkJoin, Observable} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ConfigurationService {\n\n private otherconfig: any;\n private pathconfig: any;\n private keycloakconfig: any;\n\n public configChanged: EventEmitter<void> = new EventEmitter<void>();\n\n constructor(private http: HttpClient) {\n }\n\n public init(pathconfig: string, otherconfig?: string, keycloakconfig?: string) {\n const calls: Observable<any>[] = [];\n calls.push(this.http.get(pathconfig));\n if (otherconfig) {\n calls.push(this.http.get(otherconfig));\n }\n if (keycloakconfig) {\n calls.push(this.http.get(keycloakconfig));\n }\n return forkJoin(calls)\n .pipe(\n map(res => {\n this.pathconfig = res[0];\n if (otherconfig) {\n this.otherconfig = res[1];\n }\n if (keycloakconfig) {\n this.keycloakconfig = res[2];\n }\n this.configChanged.emit();\n })\n )\n .toPromise();\n }\n\n public get(key: string) {\n let res = this.pathconfig ? this.pathconfig[key] : null;\n if (!res) {\n res = this.otherconfig ? this.otherconfig[key] : null;\n }\n if (!res) {\n res = this.keycloakconfig ? this.keycloakconfig[key] : null;\n }\n return res;\n }\n}\n","/**\n * Generated bundle index. Do not edit.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GAAG,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;QACxD,IAAI,CAAC,GAAG,EAAE;AACN,YAAA,GAAG,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;AACzD,SAAA;QACD,IAAI,CAAC,GAAG,EAAE;AACN,YAAA,GAAG,GAAG,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;AAC/D,SAAA;AACD,QAAA,OAAO,GAAG,CAAC;KACd;;qIA7CQ,oBAAoB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,UAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAApB,mBAAA,oBAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cAFjB,MAAM,EAAA,CAAA,CAAA;4FAET,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAHhC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE,MAAM;iBACrB,CAAA;;;ACPD;;AAEG;;;;"}
@@ -0,0 +1,59 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, Injectable } from '@angular/core';
3
+ import { forkJoin } from 'rxjs';
4
+ import { map } from 'rxjs/operators';
5
+ import * as i1 from '@angular/common/http';
6
+
7
+ class ConfigurationService {
8
+ constructor(http) {
9
+ this.http = http;
10
+ this.configChanged = new EventEmitter();
11
+ }
12
+ init(pathconfig, otherconfig, keycloakconfig) {
13
+ const calls = [];
14
+ calls.push(this.http.get(pathconfig));
15
+ if (otherconfig) {
16
+ calls.push(this.http.get(otherconfig));
17
+ }
18
+ if (keycloakconfig) {
19
+ calls.push(this.http.get(keycloakconfig));
20
+ }
21
+ return forkJoin(calls)
22
+ .pipe(map(res => {
23
+ this.pathconfig = res[0];
24
+ if (otherconfig) {
25
+ this.otherconfig = res[1];
26
+ }
27
+ if (keycloakconfig) {
28
+ this.keycloakconfig = res[2];
29
+ }
30
+ this.configChanged.emit();
31
+ }))
32
+ .toPromise();
33
+ }
34
+ get(key) {
35
+ let res = this.pathconfig ? this.pathconfig[key] : null;
36
+ if (!res) {
37
+ res = this.otherconfig ? this.otherconfig[key] : null;
38
+ }
39
+ if (!res) {
40
+ res = this.keycloakconfig ? this.keycloakconfig[key] : null;
41
+ }
42
+ return res;
43
+ }
44
+ }
45
+ /** @nocollapse */ ConfigurationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ConfigurationService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
46
+ /** @nocollapse */ ConfigurationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ConfigurationService, providedIn: 'root' });
47
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ConfigurationService, decorators: [{
48
+ type: Injectable,
49
+ args: [{
50
+ providedIn: 'root'
51
+ }]
52
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
53
+
54
+ /**
55
+ * Generated bundle index. Do not edit.
56
+ */
57
+
58
+ export { ConfigurationService };
59
+ //# sourceMappingURL=eggslib-configuration.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eggslib-configuration.mjs","sources":["../../../projects/configuration/src/lib/configuration.service.ts","../../../projects/configuration/src/eggslib-configuration.ts"],"sourcesContent":["import {EventEmitter, Injectable} from '@angular/core';\nimport {HttpClient} from '@angular/common/http';\nimport {forkJoin, Observable} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ConfigurationService {\n\n private otherconfig: any;\n private pathconfig: any;\n private keycloakconfig: any;\n\n public configChanged: EventEmitter<void> = new EventEmitter<void>();\n\n constructor(private http: HttpClient) {\n }\n\n public init(pathconfig: string, otherconfig?: string, keycloakconfig?: string) {\n const calls: Observable<any>[] = [];\n calls.push(this.http.get(pathconfig));\n if (otherconfig) {\n calls.push(this.http.get(otherconfig));\n }\n if (keycloakconfig) {\n calls.push(this.http.get(keycloakconfig));\n }\n return forkJoin(calls)\n .pipe(\n map(res => {\n this.pathconfig = res[0];\n if (otherconfig) {\n this.otherconfig = res[1];\n }\n if (keycloakconfig) {\n this.keycloakconfig = res[2];\n }\n this.configChanged.emit();\n })\n )\n .toPromise();\n }\n\n public get(key: string) {\n let res = this.pathconfig ? this.pathconfig[key] : null;\n if (!res) {\n res = this.otherconfig ? this.otherconfig[key] : null;\n }\n if (!res) {\n res = this.keycloakconfig ? this.keycloakconfig[key] : null;\n }\n return res;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAQa,oBAAoB,CAAA;AAQ7B,IAAA,WAAA,CAAoB,IAAgB,EAAA;QAAhB,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAY;AAF7B,QAAA,IAAA,CAAA,aAAa,GAAuB,IAAI,YAAY,EAAQ,CAAC;KAGnE;AAEM,IAAA,IAAI,CAAC,UAAkB,EAAE,WAAoB,EAAE,cAAuB,EAAA;QACzE,MAAM,KAAK,GAAsB,EAAE,CAAC;AACpC,QAAA,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;AACtC,QAAA,IAAI,WAAW,EAAE;AACb,YAAA,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;AAC1C,SAAA;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CAAA;AAApB,mBAAA,oBAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cAFjB,MAAM,EAAA,CAAA,CAAA;4FAET,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAHhC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE,MAAM;AACrB,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
@@ -1,5 +1,6 @@
1
1
  import { EventEmitter } from '@angular/core';
2
2
  import { HttpClient } from '@angular/common/http';
3
+ import * as i0 from "@angular/core";
3
4
  export declare class ConfigurationService {
4
5
  private http;
5
6
  private otherconfig;
@@ -9,4 +10,6 @@ export declare class ConfigurationService {
9
10
  constructor(http: HttpClient);
10
11
  init(pathconfig: string, otherconfig?: string, keycloakconfig?: string): Promise<void>;
11
12
  get(key: string): any;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<ConfigurationService, never>;
14
+ static ɵprov: i0.ɵɵInjectableDeclaration<ConfigurationService>;
12
15
  }
package/package.json CHANGED
@@ -1,21 +1,30 @@
1
1
  {
2
2
  "name": "@eggslib/configuration",
3
- "version": "0.3.4",
3
+ "version": "13.0.1",
4
4
  "description": "Configuration",
5
5
  "author": "Alessandro Prandini",
6
- "peerDependencies": {
7
- "@angular/common": "^11.2.8",
8
- "@angular/core": "^11.2.8"
9
- },
10
- "main": "bundles/eggslib-configuration.umd.js",
11
- "module": "fesm2015/eggslib-configuration.js",
12
- "es2015": "fesm2015/eggslib-configuration.js",
13
- "esm2015": "esm2015/eggslib-configuration.js",
14
- "fesm2015": "fesm2015/eggslib-configuration.js",
6
+ "peerDependencies": {},
7
+ "module": "fesm2015/eggslib-configuration.mjs",
8
+ "es2020": "fesm2020/eggslib-configuration.mjs",
9
+ "esm2020": "esm2020/eggslib-configuration.mjs",
10
+ "fesm2020": "fesm2020/eggslib-configuration.mjs",
11
+ "fesm2015": "fesm2015/eggslib-configuration.mjs",
15
12
  "typings": "eggslib-configuration.d.ts",
16
- "metadata": "eggslib-configuration.metadata.json",
13
+ "exports": {
14
+ "./package.json": {
15
+ "default": "./package.json"
16
+ },
17
+ ".": {
18
+ "types": "./eggslib-configuration.d.ts",
19
+ "esm2020": "./esm2020/eggslib-configuration.mjs",
20
+ "es2020": "./fesm2020/eggslib-configuration.mjs",
21
+ "es2015": "./fesm2015/eggslib-configuration.mjs",
22
+ "node": "./fesm2015/eggslib-configuration.mjs",
23
+ "default": "./fesm2020/eggslib-configuration.mjs"
24
+ }
25
+ },
17
26
  "sideEffects": false,
18
27
  "dependencies": {
19
- "tslib": "^2.0.0"
28
+ "tslib": "^2.3.0"
20
29
  }
21
30
  }
@@ -1,67 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http'), require('rxjs'), require('rxjs/operators')) :
3
- typeof define === 'function' && define.amd ? define('@eggslib/configuration', ['exports', '@angular/core', '@angular/common/http', 'rxjs', 'rxjs/operators'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.eggslib = global.eggslib || {}, global.eggslib.configuration = {}), global.ng.core, global.ng.common.http, global.rxjs, global.rxjs.operators));
5
- }(this, (function (exports, i0, i1, rxjs, operators) { 'use strict';
6
-
7
- var ConfigurationService = /** @class */ (function () {
8
- function ConfigurationService(http) {
9
- this.http = http;
10
- this.configChanged = new i0.EventEmitter();
11
- }
12
- ConfigurationService.prototype.init = function (pathconfig, otherconfig, keycloakconfig) {
13
- var _this = this;
14
- var calls = [];
15
- calls.push(this.http.get(pathconfig));
16
- if (otherconfig) {
17
- calls.push(this.http.get(otherconfig));
18
- }
19
- if (keycloakconfig) {
20
- calls.push(this.http.get(keycloakconfig));
21
- }
22
- return rxjs.forkJoin(calls)
23
- .pipe(operators.map(function (res) {
24
- _this.pathconfig = res[0];
25
- if (otherconfig) {
26
- _this.otherconfig = res[1];
27
- }
28
- if (keycloakconfig) {
29
- _this.keycloakconfig = res[2];
30
- }
31
- _this.configChanged.emit();
32
- }))
33
- .toPromise();
34
- };
35
- ConfigurationService.prototype.get = function (key) {
36
- var res = this.pathconfig ? this.pathconfig[key] : null;
37
- if (!res) {
38
- res = this.otherconfig ? this.otherconfig[key] : null;
39
- }
40
- if (!res) {
41
- res = this.keycloakconfig ? this.keycloakconfig[key] : null;
42
- }
43
- return res;
44
- };
45
- return ConfigurationService;
46
- }());
47
- /** @nocollapse */ ConfigurationService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ConfigurationService_Factory() { return new ConfigurationService(i0.ɵɵinject(i1.HttpClient)); }, token: ConfigurationService, providedIn: "root" });
48
- ConfigurationService.decorators = [
49
- { type: i0.Injectable, args: [{
50
- providedIn: 'root'
51
- },] }
52
- ];
53
- /** @nocollapse */
54
- ConfigurationService.ctorParameters = function () { return [
55
- { type: i1.HttpClient }
56
- ]; };
57
-
58
- /**
59
- * Generated bundle index. Do not edit.
60
- */
61
-
62
- exports.ConfigurationService = ConfigurationService;
63
-
64
- Object.defineProperty(exports, '__esModule', { value: true });
65
-
66
- })));
67
- //# sourceMappingURL=eggslib-configuration.umd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eggslib-configuration.umd.js","sources":["../../../projects/configuration/src/lib/configuration.service.ts","../../../projects/configuration/src/eggslib-configuration.ts"],"sourcesContent":["import {EventEmitter, Injectable} from '@angular/core';\nimport {HttpClient} from '@angular/common/http';\nimport {forkJoin, Observable} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ConfigurationService {\n\n private otherconfig: any;\n private pathconfig: any;\n private keycloakconfig: any;\n\n public configChanged: EventEmitter<void> = new EventEmitter<void>();\n\n constructor(private http: HttpClient) {\n }\n\n public init(pathconfig: string, otherconfig?: string, keycloakconfig?: string) {\n const calls: Observable<any>[] = [];\n calls.push(this.http.get(pathconfig));\n if (otherconfig) {\n calls.push(this.http.get(otherconfig));\n }\n if (keycloakconfig) {\n calls.push(this.http.get(keycloakconfig));\n }\n return forkJoin(calls)\n .pipe(\n map(res => {\n this.pathconfig = res[0];\n if (otherconfig) {\n this.otherconfig = res[1];\n }\n if (keycloakconfig) {\n this.keycloakconfig = res[2];\n }\n this.configChanged.emit();\n })\n )\n .toPromise();\n }\n\n public get(key: string) {\n let res = this.pathconfig ? this.pathconfig[key] : null;\n if (!res) {\n res = this.otherconfig ? this.otherconfig[key] : null;\n }\n if (!res) {\n res = this.keycloakconfig ? this.keycloakconfig[key] : null;\n }\n return res;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["EventEmitter","forkJoin","map","Injectable","HttpClient"],"mappings":";;;;;;;QAgBI,8BAAoB,IAAgB;YAAhB,SAAI,GAAJ,IAAI,CAAY;YAF7B,kBAAa,GAAuB,IAAIA,eAAY,EAAQ,CAAC;SAGnE;QAEM,mCAAI,GAAJ,UAAK,UAAkB,EAAE,WAAoB,EAAE,cAAuB;YAAtE,iBAuBN;YAtBG,IAAM,KAAK,GAAsB,EAAE,CAAC;YACpC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;YACtC,IAAI,WAAW,EAAE;gBACb,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;aAC1C;YACD,IAAI,cAAc,EAAE;gBAChB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC;aAC7C;YACD,OAAOC,aAAQ,CAAC,KAAK,CAAC;iBACjB,IAAI,CACDC,aAAG,CAAC,UAAA,GAAG;gBACH,KAAI,CAAC,UAAU,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;gBACzB,IAAI,WAAW,EAAE;oBACb,KAAI,CAAC,WAAW,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;iBAC7B;gBACD,IAAI,cAAc,EAAE;oBAChB,KAAI,CAAC,cAAc,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;iBAChC;gBACD,KAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;aAC7B,CAAC,CACL;iBACA,SAAS,EAAE,CAAC;SACpB;QAEM,kCAAG,GAAH,UAAI,GAAW;YAClB,IAAI,GAAG,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;YACxD,IAAI,CAAC,GAAG,EAAE;gBACN,GAAG,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;aACzD;YACD,IAAI,CAAC,GAAG,EAAE;gBACN,GAAG,GAAG,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;aAC/D;YACD,OAAO,GAAG,CAAC;SACd;;;;;gBAhDJC,aAAU,SAAC;oBACR,UAAU,EAAE,MAAM;iBACrB;;;;gBANOC,aAAU;;;ICDlB;;;;;;;;;;;;"}
@@ -1,2 +0,0 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common/http"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@eggslib/configuration",["exports","@angular/core","@angular/common/http","rxjs","rxjs/operators"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).eggslib=t.eggslib||{},t.eggslib.configuration={}),t.ng.core,t.ng.common.http,t.rxjs,t.rxjs.operators)}(this,(function(t,e,o,n,i){"use strict";var r=function(){function t(t){this.http=t,this.configChanged=new e.EventEmitter}return t.prototype.init=function(t,e,o){var r=this,c=[];return c.push(this.http.get(t)),e&&c.push(this.http.get(e)),o&&c.push(this.http.get(o)),n.forkJoin(c).pipe(i.map((function(t){r.pathconfig=t[0],e&&(r.otherconfig=t[1]),o&&(r.keycloakconfig=t[2]),r.configChanged.emit()}))).toPromise()},t.prototype.get=function(t){var e=this.pathconfig?this.pathconfig[t]:null;return e||(e=this.otherconfig?this.otherconfig[t]:null),e||(e=this.keycloakconfig?this.keycloakconfig[t]:null),e},t}();r.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new r(e.ɵɵinject(o.HttpClient))},token:r,providedIn:"root"}),r.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],r.ctorParameters=function(){return[{type:o.HttpClient}]},t.ConfigurationService=r,Object.defineProperty(t,"__esModule",{value:!0})}));
2
- //# sourceMappingURL=eggslib-configuration.umd.min.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../projects/configuration/src/lib/configuration.service.ts"],"names":["ConfigurationService","http","this","configChanged","EventEmitter","prototype","init","pathconfig","otherconfig","keycloakconfig","_this","calls","push","get","forkJoin","pipe","map","res","emit","toPromise","key","Injectable","args","providedIn","HttpClient"],"mappings":"8hBAgBI,SAAAA,EAAoBC,GAAAC,KAAAD,KAAAA,EAFbC,KAAAC,cAAoC,IAAIC,EAAAA,oBAKxCJ,EAAAK,UAAAC,KAAA,SAAKC,EAAoBC,EAAsBC,GAA/C,IAAAC,EAAAR,KACGS,EAA2B,GAQjC,OAPAA,EAAMC,KAAKV,KAAKD,KAAKY,IAAIN,IACrBC,GACAG,EAAMC,KAAKV,KAAKD,KAAKY,IAAIL,IAEzBC,GACAE,EAAMC,KAAKV,KAAKD,KAAKY,IAAIJ,IAEtBK,EAAAA,SAASH,GACXI,KACGC,EAAAA,KAAI,SAAAC,GACAP,EAAKH,WAAaU,EAAI,GAClBT,IACAE,EAAKF,YAAcS,EAAI,IAEvBR,IACAC,EAAKD,eAAiBQ,EAAI,IAE9BP,EAAKP,cAAce,WAG1BC,aAGFnB,EAAAK,UAAAQ,IAAA,SAAIO,GACP,IAAIH,EAAMf,KAAKK,WAAaL,KAAKK,WAAWa,GAAO,KAOnD,OANKH,IACDA,EAAMf,KAAKM,YAAcN,KAAKM,YAAYY,GAAO,MAEhDH,IACDA,EAAMf,KAAKO,eAAiBP,KAAKO,eAAeW,GAAO,MAEpDH,iJA/CdI,EAAAA,WAAUC,KAAA,CAAC,CACRC,WAAY,oDALRC,EAAAA","sourcesContent":["import {EventEmitter, Injectable} from '@angular/core';\nimport {HttpClient} from '@angular/common/http';\nimport {forkJoin, Observable} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ConfigurationService {\n\n private otherconfig: any;\n private pathconfig: any;\n private keycloakconfig: any;\n\n public configChanged: EventEmitter<void> = new EventEmitter<void>();\n\n constructor(private http: HttpClient) {\n }\n\n public init(pathconfig: string, otherconfig?: string, keycloakconfig?: string) {\n const calls: Observable<any>[] = [];\n calls.push(this.http.get(pathconfig));\n if (otherconfig) {\n calls.push(this.http.get(otherconfig));\n }\n if (keycloakconfig) {\n calls.push(this.http.get(keycloakconfig));\n }\n return forkJoin(calls)\n .pipe(\n map(res => {\n this.pathconfig = res[0];\n if (otherconfig) {\n this.otherconfig = res[1];\n }\n if (keycloakconfig) {\n this.keycloakconfig = res[2];\n }\n this.configChanged.emit();\n })\n )\n .toPromise();\n }\n\n public get(key: string) {\n let res = this.pathconfig ? this.pathconfig[key] : null;\n if (!res) {\n res = this.otherconfig ? this.otherconfig[key] : null;\n }\n if (!res) {\n res = this.keycloakconfig ? this.keycloakconfig[key] : null;\n }\n return res;\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"__symbolic":"module","version":4,"metadata":{"ConfigurationService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":5,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/common/http","name":"HttpClient","line":16,"character":30}]}],"init":[{"__symbolic":"method"}],"get":[{"__symbolic":"method"}]},"statics":{"ɵprov":{}}}},"origins":{"ConfigurationService":"./lib/configuration.service"},"importAs":"@eggslib/configuration"}
@@ -1,55 +0,0 @@
1
- import { EventEmitter, Injectable } from '@angular/core';
2
- import { HttpClient } from '@angular/common/http';
3
- import { forkJoin } from 'rxjs';
4
- import { map } from 'rxjs/operators';
5
- import * as i0 from "@angular/core";
6
- import * as i1 from "@angular/common/http";
7
- export class ConfigurationService {
8
- constructor(http) {
9
- this.http = http;
10
- this.configChanged = new EventEmitter();
11
- }
12
- init(pathconfig, otherconfig, keycloakconfig) {
13
- const calls = [];
14
- calls.push(this.http.get(pathconfig));
15
- if (otherconfig) {
16
- calls.push(this.http.get(otherconfig));
17
- }
18
- if (keycloakconfig) {
19
- calls.push(this.http.get(keycloakconfig));
20
- }
21
- return forkJoin(calls)
22
- .pipe(map(res => {
23
- this.pathconfig = res[0];
24
- if (otherconfig) {
25
- this.otherconfig = res[1];
26
- }
27
- if (keycloakconfig) {
28
- this.keycloakconfig = res[2];
29
- }
30
- this.configChanged.emit();
31
- }))
32
- .toPromise();
33
- }
34
- get(key) {
35
- let res = this.pathconfig ? this.pathconfig[key] : null;
36
- if (!res) {
37
- res = this.otherconfig ? this.otherconfig[key] : null;
38
- }
39
- if (!res) {
40
- res = this.keycloakconfig ? this.keycloakconfig[key] : null;
41
- }
42
- return res;
43
- }
44
- }
45
- /** @nocollapse */ ConfigurationService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ConfigurationService_Factory() { return new ConfigurationService(i0.ɵɵinject(i1.HttpClient)); }, token: ConfigurationService, providedIn: "root" });
46
- ConfigurationService.decorators = [
47
- { type: Injectable, args: [{
48
- providedIn: 'root'
49
- },] }
50
- ];
51
- /** @nocollapse */
52
- ConfigurationService.ctorParameters = () => [
53
- { type: HttpClient }
54
- ];
55
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlndXJhd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ZykpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChrZXljbG9ha2NvbmZpZykge1xuICAgICAgICAgICAgY2FsbHMucHVzaCh0aGlzLmh0dHAuZ2V0KGtleWNsb2FrY29uZmlnKSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGZvcmtKb2luKGNhbGxzKVxuICAgICAgICAgICAgLnBpcGUoXG4gICAgICAgICAgICAgICAgbWFwKHJlcyA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucGF0aGNvbmZpZyA9IHJlc1swXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG90aGVyY29uZmlnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLm90aGVyY29uZmlnID0gcmVzWzFdO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChrZXljbG9ha2NvbmZpZykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5rZXljbG9ha2NvbmZpZyA9IHJlc1syXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbmZpZ0NoYW5nZWQuZW1pdCgpO1xuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICApXG4gICAgICAgICAgICAudG9Qcm9taXNlKCk7XG4gICAgfVxuXG4gICAgcHVibGljIGdldChrZXk6IHN0cmluZykge1xuICAgICAgICBsZXQgcmVzID0gdGhpcy5wYXRoY29uZmlnID8gdGhpcy5wYXRoY29uZmlnW2tleV0gOiBudWxsO1xuICAgICAgICBpZiAoIXJlcykge1xuICAgICAgICAgICAgcmVzID0gdGhpcy5vdGhlcmNvbmZpZyA/IHRoaXMub3RoZXJjb25maWdba2V5XSA6IG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFyZXMpIHtcbiAgICAgICAgICAgIHJlcyA9IHRoaXMua2V5Y2xvYWtjb25maWcgPyB0aGlzLmtleWNsb2FrY29uZmlnW2tleV0gOiBudWxsO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXM7XG4gICAgfVxufVxuIl19
@@ -1 +0,0 @@
1
- {"version":3,"file":"eggslib-configuration.js","sources":["../../../projects/configuration/src/lib/configuration.service.ts","../../../projects/configuration/src/eggslib-configuration.ts"],"sourcesContent":["import {EventEmitter, Injectable} from '@angular/core';\nimport {HttpClient} from '@angular/common/http';\nimport {forkJoin, Observable} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ConfigurationService {\n\n private otherconfig: any;\n private pathconfig: any;\n private keycloakconfig: any;\n\n public configChanged: EventEmitter<void> = new EventEmitter<void>();\n\n constructor(private http: HttpClient) {\n }\n\n public init(pathconfig: string, otherconfig?: string, keycloakconfig?: string) {\n const calls: Observable<any>[] = [];\n calls.push(this.http.get(pathconfig));\n if (otherconfig) {\n calls.push(this.http.get(otherconfig));\n }\n if (keycloakconfig) {\n calls.push(this.http.get(keycloakconfig));\n }\n return forkJoin(calls)\n .pipe(\n map(res => {\n this.pathconfig = res[0];\n if (otherconfig) {\n this.otherconfig = res[1];\n }\n if (keycloakconfig) {\n this.keycloakconfig = res[2];\n }\n this.configChanged.emit();\n })\n )\n .toPromise();\n }\n\n public get(key: string) {\n let res = this.pathconfig ? this.pathconfig[key] : null;\n if (!res) {\n res = this.otherconfig ? this.otherconfig[key] : null;\n }\n if (!res) {\n res = this.keycloakconfig ? this.keycloakconfig[key] : null;\n }\n return res;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAQa,oBAAoB;IAQ7B,YAAoB,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;QAF7B,kBAAa,GAAuB,IAAI,YAAY,EAAQ,CAAC;KAGnE;IAEM,IAAI,CAAC,UAAkB,EAAE,WAAoB,EAAE,cAAuB;QACzE,MAAM,KAAK,GAAsB,EAAE,CAAC;QACpC,KAAK,CAAC,IAAI,CAAC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