@valtimo/bootstrap 0.0.0-test

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/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # Bootstrap
2
+
3
+ This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version
4
+ 9.1.11.
5
+
6
+ ## Code scaffolding
7
+
8
+ Run `ng generate component component-name --project bootstrap` to generate a new component. You can
9
+ also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project bootstrap`.
10
+
11
+ > Note: Don't forget to add `--project bootstrap` or else it will be added to the default project in
12
+ > your `angular.json` file.
13
+
14
+ ## Build
15
+
16
+ Run `ng build bootstrap` to build the project. The build artifacts will be stored in the `dist/`
17
+ directory.
18
+
19
+ ## Publishing
20
+
21
+ After building your library with `ng build bootstrap`, go to the dist folder `cd dist/bootstrap` and
22
+ run `npm publish`.
23
+
24
+ ## Running unit tests
25
+
26
+ Run `ng test bootstrap` to execute the unit tests via [Karma](https://karma-runner.github.io).
27
+
28
+ ## Further help
29
+
30
+ To get more help on the Angular CLI use `ng help` or go check out the
31
+ [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
@@ -0,0 +1,151 @@
1
+ import * as i0 from '@angular/core';
2
+ import { APP_INITIALIZER, Injector, NgModule } from '@angular/core';
3
+ import { NGXLogger } from 'ngx-logger';
4
+ import { accountInitializer } from '@valtimo/account';
5
+ import { menuInitializer } from '@valtimo/components';
6
+ import { INITIALIZERS, ConfigService } from '@valtimo/shared';
7
+ import { TranslateService } from '@ngx-translate/core';
8
+ import { initializeCsp } from '@valtimo/security';
9
+ import { DOCUMENT } from '@angular/common';
10
+ import { DomSanitizer } from '@angular/platform-browser';
11
+
12
+ /*
13
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
14
+ *
15
+ * Licensed under EUPL, Version 1.2 (the "License");
16
+ * you may not use this file except in compliance with the License.
17
+ * You may obtain a copy of the License at
18
+ *
19
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
20
+ *
21
+ * Unless required by applicable law or agreed to in writing, software
22
+ * distributed under the License is distributed on an "AS IS" basis,
23
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24
+ * See the License for the specific language governing permissions and
25
+ * limitations under the License.
26
+ */
27
+ function initialize(
28
+ // eslint-disable-next-line
29
+ initializers, logger) {
30
+ return () => new Promise(async (resolve, reject) => {
31
+ logger.debug('Initializing application');
32
+ try {
33
+ logger.debug('Running', initializers.length);
34
+ for (const [index, initializer] of initializers.entries()) {
35
+ logger.debug('Executing app initializer:', index, initializer.name);
36
+ await initializer();
37
+ logger.debug('Executed app initializer:', index, initializer.name);
38
+ }
39
+ logger.debug('Application initialized');
40
+ resolve();
41
+ }
42
+ catch (err) {
43
+ reject(err);
44
+ }
45
+ });
46
+ }
47
+ function initializerFactory(configService, injector, logger, translateService) {
48
+ logger.debug('Provided app initializers ', configService.initializers);
49
+ const initializersArray = [];
50
+ // Auth-initializer
51
+ initializersArray.push(configService.config.authentication.initializer(injector));
52
+ // Use environment config initializers to be used in app startup.
53
+ configService.initializers.forEach(initializer => {
54
+ initializersArray.push(initializer(injector));
55
+ });
56
+ initializersArray.push(menuInitializer(injector, logger));
57
+ initializersArray.push(accountInitializer(translateService, logger, configService));
58
+ return initializersArray;
59
+ }
60
+
61
+ /*
62
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
63
+ *
64
+ * Licensed under EUPL, Version 1.2 (the "License");
65
+ * you may not use this file except in compliance with the License.
66
+ * You may obtain a copy of the License at
67
+ *
68
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
69
+ *
70
+ * Unless required by applicable law or agreed to in writing, software
71
+ * distributed under the License is distributed on an "AS IS" basis,
72
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
73
+ * See the License for the specific language governing permissions and
74
+ * limitations under the License.
75
+ */
76
+ class BootstrapModule {
77
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BootstrapModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
78
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.20", ngImport: i0, type: BootstrapModule }); }
79
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BootstrapModule, providers: [
80
+ {
81
+ provide: APP_INITIALIZER,
82
+ useFactory: initialize,
83
+ multi: true,
84
+ deps: [INITIALIZERS, NGXLogger],
85
+ },
86
+ {
87
+ provide: INITIALIZERS,
88
+ useFactory: initializerFactory,
89
+ deps: [ConfigService, Injector, NGXLogger, TranslateService],
90
+ },
91
+ {
92
+ provide: APP_INITIALIZER,
93
+ useFactory: initializeCsp,
94
+ multi: true,
95
+ deps: [NGXLogger, ConfigService, DOCUMENT, DomSanitizer],
96
+ },
97
+ ] }); }
98
+ }
99
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BootstrapModule, decorators: [{
100
+ type: NgModule,
101
+ args: [{
102
+ declarations: [],
103
+ imports: [],
104
+ providers: [
105
+ {
106
+ provide: APP_INITIALIZER,
107
+ useFactory: initialize,
108
+ multi: true,
109
+ deps: [INITIALIZERS, NGXLogger],
110
+ },
111
+ {
112
+ provide: INITIALIZERS,
113
+ useFactory: initializerFactory,
114
+ deps: [ConfigService, Injector, NGXLogger, TranslateService],
115
+ },
116
+ {
117
+ provide: APP_INITIALIZER,
118
+ useFactory: initializeCsp,
119
+ multi: true,
120
+ deps: [NGXLogger, ConfigService, DOCUMENT, DomSanitizer],
121
+ },
122
+ ],
123
+ exports: [],
124
+ }]
125
+ }] });
126
+
127
+ /*
128
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
129
+ *
130
+ * Licensed under EUPL, Version 1.2 (the "License");
131
+ * you may not use this file except in compliance with the License.
132
+ * You may obtain a copy of the License at
133
+ *
134
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
135
+ *
136
+ * Unless required by applicable law or agreed to in writing, software
137
+ * distributed under the License is distributed on an "AS IS" basis,
138
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
139
+ * See the License for the specific language governing permissions and
140
+ * limitations under the License.
141
+ */
142
+ /*
143
+ * Public API Surface of bootstrap
144
+ */
145
+
146
+ /**
147
+ * Generated bundle index. Do not edit.
148
+ */
149
+
150
+ export { BootstrapModule };
151
+ //# sourceMappingURL=valtimo-bootstrap.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"valtimo-bootstrap.mjs","sources":["../../../../projects/valtimo/bootstrap/src/lib/init.ts","../../../../projects/valtimo/bootstrap/src/lib/bootstrap.module.ts","../../../../projects/valtimo/bootstrap/src/public-api.ts","../../../../projects/valtimo/bootstrap/src/valtimo-bootstrap.ts"],"sourcesContent":["/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NGXLogger} from 'ngx-logger';\nimport {TranslateService} from '@ngx-translate/core';\nimport {accountInitializer} from '@valtimo/account';\nimport {Injector} from '@angular/core';\nimport {ConfigService} from '@valtimo/shared';\nimport {menuInitializer} from '@valtimo/components';\n\nexport function initialize(\n // eslint-disable-next-line\n initializers: (() => Function)[],\n logger: NGXLogger\n): () => Promise<any> {\n return (): Promise<any> =>\n new Promise<void>(async (resolve, reject) => {\n logger.debug('Initializing application');\n try {\n logger.debug('Running', initializers.length);\n for (const [index, initializer] of initializers.entries()) {\n logger.debug('Executing app initializer:', index, initializer.name);\n await initializer();\n logger.debug('Executed app initializer:', index, initializer.name);\n }\n logger.debug('Application initialized');\n resolve();\n } catch (err) {\n reject(err);\n }\n });\n}\n\nexport function initializerFactory(\n configService: ConfigService,\n injector: Injector,\n logger: NGXLogger,\n translateService: TranslateService\n) {\n logger.debug('Provided app initializers ', configService.initializers);\n\n const initializersArray = [];\n\n // Auth-initializer\n initializersArray.push(configService.config.authentication.initializer(injector));\n\n // Use environment config initializers to be used in app startup.\n configService.initializers.forEach(initializer => {\n initializersArray.push(initializer(injector));\n });\n\n initializersArray.push(menuInitializer(injector, logger));\n initializersArray.push(accountInitializer(translateService, logger, configService));\n return initializersArray;\n}\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {APP_INITIALIZER, Injector, NgModule} from '@angular/core';\nimport {NGXLogger} from 'ngx-logger';\nimport {initialize, initializerFactory} from './init';\nimport {ConfigService, INITIALIZERS} from '@valtimo/shared';\nimport {TranslateService} from '@ngx-translate/core';\nimport {initializeCsp} from '@valtimo/security';\nimport {DOCUMENT} from '@angular/common';\nimport {DomSanitizer} from '@angular/platform-browser';\n\n@NgModule({\n declarations: [],\n imports: [],\n providers: [\n {\n provide: APP_INITIALIZER,\n useFactory: initialize,\n multi: true,\n deps: [INITIALIZERS, NGXLogger],\n },\n {\n provide: INITIALIZERS,\n useFactory: initializerFactory,\n deps: [ConfigService, Injector, NGXLogger, TranslateService],\n },\n {\n provide: APP_INITIALIZER,\n useFactory: initializeCsp,\n multi: true,\n deps: [NGXLogger, ConfigService, DOCUMENT, DomSanitizer],\n },\n ],\n exports: [],\n})\nexport class BootstrapModule {}\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * Public API Surface of bootstrap\n */\n\nexport * from './lib/bootstrap.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;;;;;AAcG;SASa,UAAU;AACxB;AACA,YAAgC,EAChC,MAAiB,EAAA;AAEjB,IAAA,OAAO,MACL,IAAI,OAAO,CAAO,OAAO,OAAO,EAAE,MAAM,KAAI;AAC1C,QAAA,MAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC;AACxC,QAAA,IAAI;YACF,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,YAAY,CAAC,MAAM,CAAC;AAC5C,YAAA,KAAK,MAAM,CAAC,KAAK,EAAE,WAAW,CAAC,IAAI,YAAY,CAAC,OAAO,EAAE,EAAE;gBACzD,MAAM,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC;gBACnE,MAAM,WAAW,EAAE;gBACnB,MAAM,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC;;AAEpE,YAAA,MAAM,CAAC,KAAK,CAAC,yBAAyB,CAAC;AACvC,YAAA,OAAO,EAAE;;QACT,OAAO,GAAG,EAAE;YACZ,MAAM,CAAC,GAAG,CAAC;;AAEf,KAAC,CAAC;AACN;AAEM,SA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d-module name="@valtimo/bootstrap" />
5
+ export * from './public-api';
@@ -0,0 +1,6 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class BootstrapModule {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<BootstrapModule, never>;
4
+ static ɵmod: i0.ɵɵNgModuleDeclaration<BootstrapModule, never, never, never>;
5
+ static ɵinj: i0.ɵɵInjectorDeclaration<BootstrapModule>;
6
+ }
package/lib/init.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import { NGXLogger } from 'ngx-logger';
2
+ import { TranslateService } from '@ngx-translate/core';
3
+ import { Injector } from '@angular/core';
4
+ import { ConfigService } from '@valtimo/shared';
5
+ export declare function initialize(initializers: (() => Function)[], logger: NGXLogger): () => Promise<any>;
6
+ export declare function initializerFactory(configService: ConfigService, injector: Injector, logger: NGXLogger, translateService: TranslateService): any[];
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "@valtimo/bootstrap",
3
+ "license": "EUPL-1.2",
4
+ "version": "0.0.0-test",
5
+ "peerDependencies": {
6
+ "@angular/common": "19.2.20",
7
+ "@angular/core": "19.2.20"
8
+ },
9
+ "dependencies": {
10
+ "tslib": "2.8.1"
11
+ },
12
+ "module": "fesm2022/valtimo-bootstrap.mjs",
13
+ "typings": "index.d.ts",
14
+ "exports": {
15
+ "./package.json": {
16
+ "default": "./package.json"
17
+ },
18
+ ".": {
19
+ "types": "./index.d.ts",
20
+ "default": "./fesm2022/valtimo-bootstrap.mjs"
21
+ }
22
+ },
23
+ "sideEffects": false
24
+ }
@@ -0,0 +1 @@
1
+ export * from './lib/bootstrap.module';