@albi_scando/as-user-lib 0.0.1 → 1.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.
- package/README.md +12 -27
- package/{projects → dist}/as-user-lib/README.md +25 -24
- package/dist/as-user-lib/esm2022/albi_scando-as-user-lib.mjs +5 -0
- package/dist/as-user-lib/esm2022/lib/assets/jsons/default.json +6 -0
- package/dist/as-user-lib/esm2022/lib/constants/default.mjs +3 -0
- package/dist/as-user-lib/esm2022/lib/constants/user-levels.constant.mjs +7 -0
- package/dist/as-user-lib/esm2022/lib/models/setup.interface.mjs +2 -0
- package/dist/as-user-lib/esm2022/lib/services/user/user.service.interface.mjs +2 -0
- package/dist/as-user-lib/esm2022/lib/services/user/user.service.mjs +67 -0
- package/dist/as-user-lib/esm2022/lib/types/user-levels.type.mjs +2 -0
- package/dist/as-user-lib/esm2022/public-api.mjs +3 -0
- package/dist/as-user-lib/fesm2022/albi_scando-as-user-lib.mjs +89 -0
- package/dist/as-user-lib/fesm2022/albi_scando-as-user-lib.mjs.map +1 -0
- package/dist/as-user-lib/index.d.ts +5 -0
- package/dist/as-user-lib/lib/constants/default.d.ts +2 -0
- package/dist/as-user-lib/lib/constants/user-levels.constant.d.ts +6 -0
- package/dist/as-user-lib/lib/models/setup.interface.d.ts +12 -0
- package/dist/as-user-lib/lib/services/user/user.service.d.ts +38 -0
- package/dist/as-user-lib/lib/services/user/user.service.interface.d.ts +7 -0
- package/dist/as-user-lib/lib/types/user-levels.type.d.ts +5 -0
- package/dist/as-user-lib/public-api.d.ts +4 -0
- package/package.json +100 -23
- package/.editorconfig +0 -16
- package/.vscode/extensions.json +0 -4
- package/.vscode/launch.json +0 -20
- package/.vscode/tasks.json +0 -42
- package/angular.json +0 -40
- package/projects/as-user-lib/ng-package.json +0 -7
- package/projects/as-user-lib/package.json +0 -12
- package/projects/as-user-lib/src/lib/services/user/user.service.interface.ts +0 -8
- package/projects/as-user-lib/src/lib/services/user/user.service.spec.ts +0 -16
- package/projects/as-user-lib/src/lib/services/user/user.service.ts +0 -16
- package/projects/as-user-lib/src/public-api.ts +0 -5
- package/projects/as-user-lib/tsconfig.lib.json +0 -14
- package/projects/as-user-lib/tsconfig.lib.prod.json +0 -10
- package/projects/as-user-lib/tsconfig.spec.json +0 -14
- package/tsconfig.json +0 -38
package/README.md
CHANGED
|
@@ -1,27 +1,12 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
## Build
|
|
14
|
-
|
|
15
|
-
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
16
|
-
|
|
17
|
-
## Running unit tests
|
|
18
|
-
|
|
19
|
-
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
20
|
-
|
|
21
|
-
## Running end-to-end tests
|
|
22
|
-
|
|
23
|
-
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
|
|
24
|
-
|
|
25
|
-
## Further help
|
|
26
|
-
|
|
27
|
-
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
|
|
1
|
+
# `as-user-lib`
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
A lightweight, **fully typed Angular user session library** for Angular applications. `as-user-lib` provides a reactive `UserService` built on Angular Signals to manage user session state.
|
|
6
|
+
|
|
7
|
+
## Table of Contents
|
|
8
|
+
|
|
9
|
+
- [License](documentation/pages/LICENSE.md)
|
|
10
|
+
- [Installation](documentation/pages/INSTALLATION.md)
|
|
11
|
+
- [Contributing](documentation/pages/CONTRIBUTING.md)
|
|
12
|
+
- [Changelog](CHANGELOG.md)
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
# AsUserLib
|
|
2
|
-
|
|
3
|
-
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.2.0.
|
|
4
|
-
|
|
5
|
-
## Code scaffolding
|
|
6
|
-
|
|
7
|
-
Run `ng generate component component-name --project as-user-lib` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project as-user-lib`.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
# AsUserLib
|
|
2
|
+
|
|
3
|
+
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.2.0.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Run `ng generate component component-name --project as-user-lib` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project as-user-lib`.
|
|
8
|
+
|
|
9
|
+
> Note: Don't forget to add `--project as-user-lib` or else it will be added to the default project in your `angular.json` file.
|
|
10
|
+
|
|
11
|
+
## Build
|
|
12
|
+
|
|
13
|
+
Run `ng build as-user-lib` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
14
|
+
|
|
15
|
+
## Publishing
|
|
16
|
+
|
|
17
|
+
After building your library with `ng build as-user-lib`, go to the dist folder `cd dist/as-user-lib` and run `npm publish`.
|
|
18
|
+
|
|
19
|
+
## Running unit tests
|
|
20
|
+
|
|
21
|
+
Run `ng test as-user-lib` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
22
|
+
|
|
23
|
+
## Further help
|
|
24
|
+
|
|
25
|
+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
export * from './public-api';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWxiaV9zY2FuZG8tYXMtdXNlci1saWIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9wcm9qZWN0cy9hcy11c2VyLWxpYi9zcmMvYWxiaV9zY2FuZG8tYXMtdXNlci1saWIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ==
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const DEFAULT_USERNAME = 'guest';
|
|
2
|
+
export const DEFAULT_LEVEL = 'guest';
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVmYXVsdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2FzLXVzZXItbGliL3NyYy9saWIvY29uc3RhbnRzL2RlZmF1bHQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTSxDQUFDLE1BQU0sZ0JBQWdCLEdBQUcsT0FBTyxDQUFDO0FBQ3hDLE1BQU0sQ0FBQyxNQUFNLGFBQWEsR0FBRyxPQUFPLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgY29uc3QgREVGQVVMVF9VU0VSTkFNRSA9ICdndWVzdCc7XG5leHBvcnQgY29uc3QgREVGQVVMVF9MRVZFTCA9ICdndWVzdCc7XG4iXX0=
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User levels constants.
|
|
3
|
+
*/
|
|
4
|
+
export const USER_LEVELS = {
|
|
5
|
+
GUEST: 'guest',
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlci1sZXZlbHMuY29uc3RhbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9hcy11c2VyLWxpYi9zcmMvbGliL2NvbnN0YW50cy91c2VyLWxldmVscy5jb25zdGFudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUNILE1BQU0sQ0FBQyxNQUFNLFdBQVcsR0FBRztJQUN6QixLQUFLLEVBQUUsT0FBTztDQUNmLENBQUEiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIFVzZXIgbGV2ZWxzIGNvbnN0YW50cy5cbiAqL1xuZXhwb3J0IGNvbnN0IFVTRVJfTEVWRUxTID0ge1xuICBHVUVTVDogJ2d1ZXN0Jyxcbn1cbiJdfQ==
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2V0dXAuaW50ZXJmYWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvYXMtdXNlci1saWIvc3JjL2xpYi9tb2RlbHMvc2V0dXAuaW50ZXJmYWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBUeXBlc1xuaW1wb3J0IHR5cGUgeyBVc2VyTGV2ZWxzIH0gZnJvbSBcIi4uL3R5cGVzL3VzZXItbGV2ZWxzLnR5cGVcIjtcblxuLyoqXG4gKiBDb25maWd1cmF0aW9uIGludGVyZmFjZVxuICovXG5leHBvcnQgaW50ZXJmYWNlIElVc2VyTGliU2V0dXAge1xuICB1c2VybmFtZTogc3RyaW5nO1xuICBsZXZlbDogVXNlckxldmVscztcbiAgYXBpPzogQVBJO1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIEFQSSB7XG4gIHBhdGNoVXNlckRhdGFBUElVcmw6IHN0cmluZztcbn1cbiJdfQ==
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlci5zZXJ2aWNlLmludGVyZmFjZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2FzLXVzZXItbGliL3NyYy9saWIvc2VydmljZXMvdXNlci91c2VyLnNlcnZpY2UuaW50ZXJmYWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IFdyaXRhYmxlU2lnbmFsIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5cbmV4cG9ydCBpbnRlcmZhY2UgSVVzZXJTZXJ2aWNlIHtcbiAgLyoqXG4gICAqIFRva2VuIHNpZ25hbFxuICAgKi9cbiAgdG9rZW46IFdyaXRhYmxlU2lnbmFsPHN0cmluZyB8IHVuZGVmaW5lZD47XG59XG4iXX0=
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { STRING_EMPTY } from '@albi_scando/as-const-lib';
|
|
2
|
+
import { Injectable, signal } from '@angular/core';
|
|
3
|
+
import { of, take } from 'rxjs';
|
|
4
|
+
import defaultConfigJSON from '../../assets/jsons/default.json';
|
|
5
|
+
// Constants
|
|
6
|
+
import { DEFAULT_LEVEL, DEFAULT_USERNAME } from '../../constants/default';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export class UserService {
|
|
9
|
+
/**
|
|
10
|
+
* Constructor
|
|
11
|
+
* @constructor
|
|
12
|
+
* @ignore
|
|
13
|
+
*/
|
|
14
|
+
constructor() {
|
|
15
|
+
this.username = signal(undefined);
|
|
16
|
+
/**
|
|
17
|
+
* {@link IUserService.token}
|
|
18
|
+
*/
|
|
19
|
+
this.token = signal(undefined);
|
|
20
|
+
this._initialize();
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* {@link IUserService.setup$}
|
|
24
|
+
*/
|
|
25
|
+
setup$(setup) {
|
|
26
|
+
this.reset();
|
|
27
|
+
this.setUsername(setup.username);
|
|
28
|
+
return of(undefined);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* {@link IUserService.reset}
|
|
32
|
+
*/
|
|
33
|
+
reset() {
|
|
34
|
+
this._initialize();
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* {@link IUserService.setUsername}
|
|
38
|
+
*/
|
|
39
|
+
setUsername(username) {
|
|
40
|
+
this.username.set(username);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Initialization method
|
|
44
|
+
*
|
|
45
|
+
* @returns {void}
|
|
46
|
+
*/
|
|
47
|
+
_initialize() {
|
|
48
|
+
const config = defaultConfigJSON;
|
|
49
|
+
const setup = {
|
|
50
|
+
username: config.language?.username ?? DEFAULT_USERNAME,
|
|
51
|
+
level: DEFAULT_LEVEL,
|
|
52
|
+
api: {
|
|
53
|
+
patchUserDataAPIUrl: config.language?.updateAPI ?? STRING_EMPTY,
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
this.setup$(setup).pipe(take(1)).subscribe();
|
|
57
|
+
}
|
|
58
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: UserService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
59
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: UserService, providedIn: 'root' }); }
|
|
60
|
+
}
|
|
61
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: UserService, decorators: [{
|
|
62
|
+
type: Injectable,
|
|
63
|
+
args: [{
|
|
64
|
+
providedIn: 'root',
|
|
65
|
+
}]
|
|
66
|
+
}], ctorParameters: () => [] });
|
|
67
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlci5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvYXMtdXNlci1saWIvc3JjL2xpYi9zZXJ2aWNlcy91c2VyL3VzZXIuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFFekQsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFFbkQsT0FBTyxFQUFFLEVBQUUsRUFBRSxJQUFJLEVBQUUsTUFBTSxNQUFNLENBQUM7QUFJaEMsT0FBTyxpQkFBaUIsTUFBTSxpQ0FBaUMsQ0FBQztBQUNoRSxZQUFZO0FBQ1osT0FBTyxFQUFFLGFBQWEsRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHlCQUF5QixDQUFDOztBQU8xRSxNQUFNLE9BQU8sV0FBVztJQVF0Qjs7OztPQUlHO0lBQ0g7UUFaTyxhQUFRLEdBQXVDLE1BQU0sQ0FBQyxTQUFTLENBQUMsQ0FBQztRQUV4RTs7V0FFRztRQUNJLFVBQUssR0FBdUMsTUFBTSxDQUFDLFNBQVMsQ0FBQyxDQUFDO1FBUW5FLElBQUksQ0FBQyxXQUFXLEVBQUUsQ0FBQztJQUNyQixDQUFDO0lBRUQ7O09BRUc7SUFDSSxNQUFNLENB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
|
|
|
1
|
+
export { USER_LEVELS } from './lib/constants/user-levels.constant';
|
|
2
|
+
export { UserService } from './lib/services/user/user.service';
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL2FzLXVzZXItbGliL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxzQ0FBc0MsQ0FBQztBQUVuRSxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sa0NBQWtDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgeyBVU0VSX0xFVkVMUyB9IGZyb20gJy4vbGliL2NvbnN0YW50cy91c2VyLWxldmVscy5jb25zdGFudCc7XG5leHBvcnQgeyBJVXNlckxpYlNldHVwIH0gZnJvbSAnLi9saWIvbW9kZWxzL3NldHVwLmludGVyZmFjZSc7XG5leHBvcnQgeyBVc2VyU2VydmljZSB9IGZyb20gJy4vbGliL3NlcnZpY2VzL3VzZXIvdXNlci5zZXJ2aWNlJztcbmV4cG9ydCB7IFVzZXJMZXZlbHMgfSBmcm9tICcuL2xpYi90eXBlcy91c2VyLWxldmVscy50eXBlJztcbiJdfQ==
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { STRING_EMPTY } from '@albi_scando/as-const-lib';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { signal, Injectable } from '@angular/core';
|
|
4
|
+
import { of, take } from 'rxjs';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* User levels constants.
|
|
8
|
+
*/
|
|
9
|
+
const USER_LEVELS = {
|
|
10
|
+
GUEST: 'guest',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
var language = {
|
|
14
|
+
username: "user",
|
|
15
|
+
updateAPI: ""
|
|
16
|
+
};
|
|
17
|
+
var defaultConfigJSON = {
|
|
18
|
+
language: language
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const DEFAULT_USERNAME = 'guest';
|
|
22
|
+
const DEFAULT_LEVEL = 'guest';
|
|
23
|
+
|
|
24
|
+
class UserService {
|
|
25
|
+
/**
|
|
26
|
+
* Constructor
|
|
27
|
+
* @constructor
|
|
28
|
+
* @ignore
|
|
29
|
+
*/
|
|
30
|
+
constructor() {
|
|
31
|
+
this.username = signal(undefined);
|
|
32
|
+
/**
|
|
33
|
+
* {@link IUserService.token}
|
|
34
|
+
*/
|
|
35
|
+
this.token = signal(undefined);
|
|
36
|
+
this._initialize();
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* {@link IUserService.setup$}
|
|
40
|
+
*/
|
|
41
|
+
setup$(setup) {
|
|
42
|
+
this.reset();
|
|
43
|
+
this.setUsername(setup.username);
|
|
44
|
+
return of(undefined);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* {@link IUserService.reset}
|
|
48
|
+
*/
|
|
49
|
+
reset() {
|
|
50
|
+
this._initialize();
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* {@link IUserService.setUsername}
|
|
54
|
+
*/
|
|
55
|
+
setUsername(username) {
|
|
56
|
+
this.username.set(username);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Initialization method
|
|
60
|
+
*
|
|
61
|
+
* @returns {void}
|
|
62
|
+
*/
|
|
63
|
+
_initialize() {
|
|
64
|
+
const config = defaultConfigJSON;
|
|
65
|
+
const setup = {
|
|
66
|
+
username: config.language?.username ?? DEFAULT_USERNAME,
|
|
67
|
+
level: DEFAULT_LEVEL,
|
|
68
|
+
api: {
|
|
69
|
+
patchUserDataAPIUrl: config.language?.updateAPI ?? STRING_EMPTY,
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
this.setup$(setup).pipe(take(1)).subscribe();
|
|
73
|
+
}
|
|
74
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: UserService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
75
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: UserService, providedIn: 'root' }); }
|
|
76
|
+
}
|
|
77
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: UserService, decorators: [{
|
|
78
|
+
type: Injectable,
|
|
79
|
+
args: [{
|
|
80
|
+
providedIn: 'root',
|
|
81
|
+
}]
|
|
82
|
+
}], ctorParameters: () => [] });
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Generated bundle index. Do not edit.
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
export { USER_LEVELS, UserService };
|
|
89
|
+
//# sourceMappingURL=albi_scando-as-user-lib.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"albi_scando-as-user-lib.mjs","sources":["../../../projects/as-user-lib/src/lib/constants/user-levels.constant.ts","../../../projects/as-user-lib/src/lib/constants/default.ts","../../../projects/as-user-lib/src/lib/services/user/user.service.ts","../../../projects/as-user-lib/src/albi_scando-as-user-lib.ts"],"sourcesContent":["/**\n * User levels constants.\n */\nexport const USER_LEVELS = {\n GUEST: 'guest',\n}\n","export const DEFAULT_USERNAME = 'guest';\nexport const DEFAULT_LEVEL = 'guest';\n","import { STRING_EMPTY } from '@albi_scando/as-const-lib';\nimport type { WritableSignal} from '@angular/core';\nimport { Injectable, signal } from '@angular/core';\nimport type { Observable} from 'rxjs';\nimport { of, take } from 'rxjs';\n\n// Assets\nimport type { IUserService } from './user.service.interface';\nimport defaultConfigJSON from '../../assets/jsons/default.json';\n// Constants\nimport { DEFAULT_LEVEL, DEFAULT_USERNAME } from '../../constants/default';\n// Interfaces\nimport type { IUserLibSetup } from '../../models/setup.interface';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class UserService implements IUserService {\n public username: WritableSignal<string | undefined> = signal(undefined);\n\n /**\n * {@link IUserService.token}\n */\n public token: WritableSignal<string | undefined> = signal(undefined);\n\n /**\n * Constructor\n * @constructor\n * @ignore\n */\n constructor() {\n this._initialize();\n }\n\n /**\n * {@link IUserService.setup$}\n */\n public setup$(setup: IUserLibSetup): Observable<void> {\n this.reset();\n\n this.setUsername(setup.username);\n\n return of(undefined);\n }\n\n /**\n * {@link IUserService.reset}\n */\n public reset(): void {\n this._initialize();\n }\n\n /**\n * {@link IUserService.setUsername}\n */\n public setUsername(username: string): void {\n this.username.set(username);\n }\n\n /**\n * Initialization method\n * \n * @returns {void}\n */\n private _initialize(): void {\n const config = defaultConfigJSON as {\n language?: {\n username?: string;\n updateAPI?: string;\n };\n };\n\n const setup: IUserLibSetup = {\n username: config.language?.username ?? DEFAULT_USERNAME,\n level: DEFAULT_LEVEL as IUserLibSetup['level'],\n api: {\n patchUserDataAPIUrl: config.language?.updateAPI ?? STRING_EMPTY,\n },\n };\n\n this.setup$(setup).pipe(take(1)).subscribe();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;;AAEG;AACI,MAAM,WAAW,GAAG;AACzB,IAAA,KAAK,EAAE,OAAO;;;;;;;;;;;ACJT,MAAM,gBAAgB,GAAG,OAAO;AAChC,MAAM,aAAa,GAAG,OAAO;;MCgBvB,WAAW,CAAA;AAQtB;;;;AAIG;AACH,IAAA,WAAA,GAAA;AAZO,QAAA,IAAA,CAAA,QAAQ,GAAuC,MAAM,CAAC,SAAS,CAAC;AAEvE;;AAEG;AACI,QAAA,IAAA,CAAA,KAAK,GAAuC,MAAM,CAAC,SAAS,CAAC;QAQlE,IAAI,CAAC,WAAW,EAAE;IACpB;AAEA;;AAEG;AACI,IAAA,MAAM,CAAC,KAAoB,EAAA;QAChC,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|
+
import type { WritableSignal } from '@angular/core';
|
|
2
|
+
import type { Observable } from 'rxjs';
|
|
3
|
+
import type { IUserService } from './user.service.interface';
|
|
4
|
+
import type { IUserLibSetup } from '../../models/setup.interface';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class UserService implements IUserService {
|
|
7
|
+
username: WritableSignal<string | undefined>;
|
|
8
|
+
/**
|
|
9
|
+
* {@link IUserService.token}
|
|
10
|
+
*/
|
|
11
|
+
token: WritableSignal<string | undefined>;
|
|
12
|
+
/**
|
|
13
|
+
* Constructor
|
|
14
|
+
* @constructor
|
|
15
|
+
* @ignore
|
|
16
|
+
*/
|
|
17
|
+
constructor();
|
|
18
|
+
/**
|
|
19
|
+
* {@link IUserService.setup$}
|
|
20
|
+
*/
|
|
21
|
+
setup$(setup: IUserLibSetup): Observable<void>;
|
|
22
|
+
/**
|
|
23
|
+
* {@link IUserService.reset}
|
|
24
|
+
*/
|
|
25
|
+
reset(): void;
|
|
26
|
+
/**
|
|
27
|
+
* {@link IUserService.setUsername}
|
|
28
|
+
*/
|
|
29
|
+
setUsername(username: string): void;
|
|
30
|
+
/**
|
|
31
|
+
* Initialization method
|
|
32
|
+
*
|
|
33
|
+
* @returns {void}
|
|
34
|
+
*/
|
|
35
|
+
private _initialize;
|
|
36
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UserService, never>;
|
|
37
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<UserService>;
|
|
38
|
+
}
|
package/package.json
CHANGED
|
@@ -1,42 +1,119 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@albi_scando/as-user-lib",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "A library for managing languages in Angular applications, providing services and utilities to handle localization and internationalization.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/albertoscandolara/as-user-lib"
|
|
8
|
+
},
|
|
9
|
+
"author": "Alberto Scandolara",
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/albertoscandolara/as-user-lib/issues"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/albertoscandolara/as-user-lib#readme",
|
|
15
|
+
"main": "dist/as-user-lib/index.js",
|
|
16
|
+
"module": "dist/as-user-lib/index.esm2022.js",
|
|
17
|
+
"types": "dist/as-user-lib/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"import": "./dist/as-user-lib/index.esm2022.js",
|
|
21
|
+
"require": "./dist/as-user-lib/index.js",
|
|
22
|
+
"types": "./dist/as-user-lib/index.d.ts"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist/as-user-lib"
|
|
27
|
+
],
|
|
4
28
|
"scripts": {
|
|
5
29
|
"ng": "ng",
|
|
6
30
|
"start": "ng serve",
|
|
31
|
+
"commit": "cz",
|
|
7
32
|
"build": "ng build",
|
|
8
33
|
"watch": "ng build --watch --configuration development",
|
|
9
|
-
"test": "ng test"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"zone.js": "~0.14.3"
|
|
34
|
+
"test": "ng test",
|
|
35
|
+
"docs:build": "typedoc",
|
|
36
|
+
"docs:serve": "npx http-server docs -o",
|
|
37
|
+
"formatter": "npm run prettier && npm run lint",
|
|
38
|
+
"formatter:fix": "npm run prettier:fix && npm run lint:fix",
|
|
39
|
+
"lint": "eslint .",
|
|
40
|
+
"lint:fix": "eslint . --fix",
|
|
41
|
+
"prepare": "husky",
|
|
42
|
+
"preview": "vite preview",
|
|
43
|
+
"prettier": "prettier . --check",
|
|
44
|
+
"prettier:fix": "prettier . --write",
|
|
45
|
+
"release": "semantic-release",
|
|
46
|
+
"release:dry": "semantic-release --dry-run"
|
|
23
47
|
},
|
|
24
48
|
"devDependencies": {
|
|
25
|
-
"@
|
|
26
|
-
"@angular/
|
|
27
|
-
"@angular/
|
|
49
|
+
"@albi_scando/as-const-lib": "^1.10.1",
|
|
50
|
+
"@angular-devkit/build-angular": "^17.3.0",
|
|
51
|
+
"@angular/cli": "^17.3.0",
|
|
52
|
+
"@angular/compiler-cli": "^17.3.0",
|
|
53
|
+
"@commitlint/cli": "^20.4.1",
|
|
54
|
+
"@commitlint/config-conventional": "^20.4.1",
|
|
55
|
+
"@eslint/js": "^9.39.2",
|
|
56
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
57
|
+
"@semantic-release/git": "^10.0.1",
|
|
58
|
+
"@semantic-release/github": "^12.0.3",
|
|
59
|
+
"@semantic-release/npm": "^13.1.3",
|
|
28
60
|
"@types/jasmine": "~5.1.0",
|
|
61
|
+
"@types/node": "^25.2.1",
|
|
62
|
+
"@types/numeric": "^1.2.6",
|
|
63
|
+
"branch-name-lint": "^3.0.1",
|
|
64
|
+
"commitizen": "^4.3.1",
|
|
65
|
+
"cz-conventional-changelog": "^3.3.0",
|
|
66
|
+
"eslint": "^9.39.2",
|
|
67
|
+
"eslint-config-prettier": "^10.1.8",
|
|
68
|
+
"eslint-plugin-import-x": "^4.16.1",
|
|
69
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
70
|
+
"eslint-plugin-regexp": "^3.0.0",
|
|
71
|
+
"eslint-plugin-security": "^3.0.1",
|
|
72
|
+
"globals": "^17.3.0",
|
|
73
|
+
"husky": "^9.1.7",
|
|
29
74
|
"jasmine-core": "~5.1.0",
|
|
30
75
|
"karma": "~6.4.0",
|
|
31
76
|
"karma-chrome-launcher": "~3.2.0",
|
|
32
77
|
"karma-coverage": "~2.2.0",
|
|
33
78
|
"karma-jasmine": "~5.1.0",
|
|
34
79
|
"karma-jasmine-html-reporter": "~2.1.0",
|
|
80
|
+
"lint-staged": "^16.2.7",
|
|
35
81
|
"ng-packagr": "^17.2.0",
|
|
36
|
-
"
|
|
82
|
+
"prettier": "3.8.1",
|
|
83
|
+
"semantic-release": "^25.0.3",
|
|
84
|
+
"typedoc": "^0.28.16",
|
|
85
|
+
"typescript": "~5.3.2",
|
|
86
|
+
"typescript-eslint": "^8.54.0",
|
|
87
|
+
"validate-branch-name": "^1.3.2"
|
|
37
88
|
},
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
89
|
+
"dependencies": {
|
|
90
|
+
"@albi_scando/as-const-lib": "^1.10.1",
|
|
91
|
+
"@angular/animations": "^17.3.0",
|
|
92
|
+
"@angular/common": "^17.3.0",
|
|
93
|
+
"@angular/compiler": "^17.3.0",
|
|
94
|
+
"@angular/core": "^17.3.0",
|
|
95
|
+
"@angular/forms": "^17.3.0",
|
|
96
|
+
"@angular/platform-browser": "^17.3.0",
|
|
97
|
+
"@angular/platform-browser-dynamic": "^17.3.0",
|
|
98
|
+
"@angular/router": "^17.3.0",
|
|
99
|
+
"rxjs": "~7.8.0",
|
|
100
|
+
"tslib": "^2.3.0",
|
|
101
|
+
"zone.js": "~0.14.3"
|
|
102
|
+
},
|
|
103
|
+
"packageManager": "pnpm@10.28.2",
|
|
104
|
+
"engines": {
|
|
105
|
+
"node": ">=22.11.0"
|
|
106
|
+
},
|
|
107
|
+
"config": {
|
|
108
|
+
"commitizen": {
|
|
109
|
+
"path": "./node_modules/cz-conventional-changelog"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"lint-staged": {
|
|
113
|
+
"*.ts": "prettier --write",
|
|
114
|
+
"*.{js,scss,css,md}": [
|
|
115
|
+
"prettier --write",
|
|
116
|
+
"eslint --fix"
|
|
117
|
+
]
|
|
118
|
+
}
|
|
42
119
|
}
|
package/.editorconfig
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# Editor configuration, see https://editorconfig.org
|
|
2
|
-
root = true
|
|
3
|
-
|
|
4
|
-
[*]
|
|
5
|
-
charset = utf-8
|
|
6
|
-
indent_style = space
|
|
7
|
-
indent_size = 2
|
|
8
|
-
insert_final_newline = true
|
|
9
|
-
trim_trailing_whitespace = true
|
|
10
|
-
|
|
11
|
-
[*.ts]
|
|
12
|
-
quote_type = single
|
|
13
|
-
|
|
14
|
-
[*.md]
|
|
15
|
-
max_line_length = off
|
|
16
|
-
trim_trailing_whitespace = false
|
package/.vscode/extensions.json
DELETED
package/.vscode/launch.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
3
|
-
"version": "0.2.0",
|
|
4
|
-
"configurations": [
|
|
5
|
-
{
|
|
6
|
-
"name": "ng serve",
|
|
7
|
-
"type": "chrome",
|
|
8
|
-
"request": "launch",
|
|
9
|
-
"preLaunchTask": "npm: start",
|
|
10
|
-
"url": "http://localhost:4200/"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"name": "ng test",
|
|
14
|
-
"type": "chrome",
|
|
15
|
-
"request": "launch",
|
|
16
|
-
"preLaunchTask": "npm: test",
|
|
17
|
-
"url": "http://localhost:9876/debug.html"
|
|
18
|
-
}
|
|
19
|
-
]
|
|
20
|
-
}
|
package/.vscode/tasks.json
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
// For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558
|
|
3
|
-
"version": "2.0.0",
|
|
4
|
-
"tasks": [
|
|
5
|
-
{
|
|
6
|
-
"type": "npm",
|
|
7
|
-
"script": "start",
|
|
8
|
-
"isBackground": true,
|
|
9
|
-
"problemMatcher": {
|
|
10
|
-
"owner": "typescript",
|
|
11
|
-
"pattern": "$tsc",
|
|
12
|
-
"background": {
|
|
13
|
-
"activeOnStart": true,
|
|
14
|
-
"beginsPattern": {
|
|
15
|
-
"regexp": "(.*?)"
|
|
16
|
-
},
|
|
17
|
-
"endsPattern": {
|
|
18
|
-
"regexp": "bundle generation complete"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"type": "npm",
|
|
25
|
-
"script": "test",
|
|
26
|
-
"isBackground": true,
|
|
27
|
-
"problemMatcher": {
|
|
28
|
-
"owner": "typescript",
|
|
29
|
-
"pattern": "$tsc",
|
|
30
|
-
"background": {
|
|
31
|
-
"activeOnStart": true,
|
|
32
|
-
"beginsPattern": {
|
|
33
|
-
"regexp": "(.*?)"
|
|
34
|
-
},
|
|
35
|
-
"endsPattern": {
|
|
36
|
-
"regexp": "bundle generation complete"
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
]
|
|
42
|
-
}
|
package/angular.json
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
|
3
|
-
"version": 1,
|
|
4
|
-
"newProjectRoot": "projects",
|
|
5
|
-
"projects": {
|
|
6
|
-
"as-user-lib": {
|
|
7
|
-
"projectType": "library",
|
|
8
|
-
"root": "projects/as-user-lib",
|
|
9
|
-
"sourceRoot": "projects/as-user-lib/src",
|
|
10
|
-
"prefix": "lib",
|
|
11
|
-
"architect": {
|
|
12
|
-
"build": {
|
|
13
|
-
"builder": "@angular-devkit/build-angular:ng-packagr",
|
|
14
|
-
"options": {
|
|
15
|
-
"project": "projects/as-user-lib/ng-package.json"
|
|
16
|
-
},
|
|
17
|
-
"configurations": {
|
|
18
|
-
"production": {
|
|
19
|
-
"tsConfig": "projects/as-user-lib/tsconfig.lib.prod.json"
|
|
20
|
-
},
|
|
21
|
-
"development": {
|
|
22
|
-
"tsConfig": "projects/as-user-lib/tsconfig.lib.json"
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
"defaultConfiguration": "production"
|
|
26
|
-
},
|
|
27
|
-
"test": {
|
|
28
|
-
"builder": "@angular-devkit/build-angular:karma",
|
|
29
|
-
"options": {
|
|
30
|
-
"tsConfig": "projects/as-user-lib/tsconfig.spec.json",
|
|
31
|
-
"polyfills": [
|
|
32
|
-
"zone.js",
|
|
33
|
-
"zone.js/testing"
|
|
34
|
-
]
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { UserService } from './user.service';
|
|
4
|
-
|
|
5
|
-
describe('UserService', () => {
|
|
6
|
-
let service: UserService;
|
|
7
|
-
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
TestBed.configureTestingModule({});
|
|
10
|
-
service = TestBed.inject(UserService);
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it('should be created', () => {
|
|
14
|
-
expect(service).toBeTruthy();
|
|
15
|
-
});
|
|
16
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Injectable, WritableSignal, signal } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
import { IUserService } from './user.service.interface';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
@Injectable({
|
|
9
|
-
providedIn: 'root',
|
|
10
|
-
})
|
|
11
|
-
export class UserService implements IUserService {
|
|
12
|
-
/**
|
|
13
|
-
* {@link IUserService.token}
|
|
14
|
-
*/
|
|
15
|
-
public token: WritableSignal<string> = signal('');
|
|
16
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
-
{
|
|
3
|
-
"extends": "../../tsconfig.json",
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
"outDir": "../../out-tsc/lib",
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"declarationMap": true,
|
|
8
|
-
"inlineSources": true,
|
|
9
|
-
"types": []
|
|
10
|
-
},
|
|
11
|
-
"exclude": [
|
|
12
|
-
"**/*.spec.ts"
|
|
13
|
-
]
|
|
14
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
-
{
|
|
3
|
-
"extends": "../../tsconfig.json",
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
"outDir": "../../out-tsc/spec",
|
|
6
|
-
"types": [
|
|
7
|
-
"jasmine"
|
|
8
|
-
]
|
|
9
|
-
},
|
|
10
|
-
"include": [
|
|
11
|
-
"**/*.spec.ts",
|
|
12
|
-
"**/*.d.ts"
|
|
13
|
-
]
|
|
14
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
-
{
|
|
3
|
-
"compileOnSave": false,
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
"paths": {
|
|
6
|
-
"as-user-lib": [
|
|
7
|
-
"./dist/as-user-lib"
|
|
8
|
-
]
|
|
9
|
-
},
|
|
10
|
-
"outDir": "./dist/out-tsc",
|
|
11
|
-
"forceConsistentCasingInFileNames": true,
|
|
12
|
-
"strict": true,
|
|
13
|
-
"noImplicitOverride": true,
|
|
14
|
-
"noPropertyAccessFromIndexSignature": true,
|
|
15
|
-
"noImplicitReturns": true,
|
|
16
|
-
"noFallthroughCasesInSwitch": true,
|
|
17
|
-
"skipLibCheck": true,
|
|
18
|
-
"esModuleInterop": true,
|
|
19
|
-
"sourceMap": true,
|
|
20
|
-
"declaration": false,
|
|
21
|
-
"experimentalDecorators": true,
|
|
22
|
-
"moduleResolution": "node",
|
|
23
|
-
"importHelpers": true,
|
|
24
|
-
"target": "ES2022",
|
|
25
|
-
"module": "ES2022",
|
|
26
|
-
"useDefineForClassFields": false,
|
|
27
|
-
"lib": [
|
|
28
|
-
"ES2022",
|
|
29
|
-
"dom"
|
|
30
|
-
]
|
|
31
|
-
},
|
|
32
|
-
"angularCompilerOptions": {
|
|
33
|
-
"enableI18nLegacyMessageIdFormat": false,
|
|
34
|
-
"strictInjectionParameters": true,
|
|
35
|
-
"strictInputAccessModifiers": true,
|
|
36
|
-
"strictTemplates": true
|
|
37
|
-
}
|
|
38
|
-
}
|