@tc-libs/user 3.5.0 → 3.6.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 +41 -6
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,11 +1,46 @@
|
|
|
1
|
-
# user
|
|
1
|
+
# @tc-libs/user
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Package di contratti condivisi per il dominio utente.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
A differenza di altri package, qui non trovi un modulo Nest o un service concreto: espone interfacce, costanti e tipi da implementare nei servizi utente reali dell'applicazione.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Contenuto
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
- costanti come `USER_SERVICE`
|
|
10
|
+
- interfacce DTO e serialization
|
|
11
|
+
- interfacce service:
|
|
12
|
+
- `IUserService`
|
|
13
|
+
- `IUserAdminService`
|
|
14
|
+
- `IUserAuthService`
|
|
15
|
+
- `IUserConfirmService`
|
|
16
|
+
- `IUserResetPasswordService`
|
|
10
17
|
|
|
11
|
-
|
|
18
|
+
## Uso tipico
|
|
19
|
+
|
|
20
|
+
Viene usato come contratto DI:
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
{
|
|
24
|
+
provide: USER_SERVICE,
|
|
25
|
+
useExisting: UserService,
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Oppure come interfaccia implementata dal service reale:
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
export class UserService implements IUserService {
|
|
33
|
+
// implementazione applicativa
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Perche esiste
|
|
38
|
+
|
|
39
|
+
Serve a disaccoppiare i package condivisi dal concreto modulo utente dell'applicazione finale. Per esempio `api-key` puo dipendere da un token/provider utente senza conoscere l'implementazione reale.
|
|
40
|
+
|
|
41
|
+
## Sviluppo
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
nx build user
|
|
45
|
+
nx test user
|
|
46
|
+
```
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tc-libs/user",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.1",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@tc-libs/authentication": "3.
|
|
6
|
-
"@tc-libs/service": "3.
|
|
7
|
-
"@tc-libs/database": "3.
|
|
5
|
+
"@tc-libs/authentication": "3.6.1",
|
|
6
|
+
"@tc-libs/service": "3.6.1",
|
|
7
|
+
"@tc-libs/database": "3.6.1",
|
|
8
8
|
"tslib": "^2.8.1"
|
|
9
9
|
},
|
|
10
10
|
"type": "commonjs",
|