emilsoftware-utilities 1.4.0-dev.2 → 1.4.0-dev.21

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.
Files changed (27) hide show
  1. package/README.MD +24 -22
  2. package/dist/Utilities.d.ts +1 -0
  3. package/dist/Utilities.js +8 -0
  4. package/dist/accessi-module/AccessiModule.d.ts +11 -2
  5. package/dist/accessi-module/Controllers/AuthController.js +18 -0
  6. package/dist/accessi-module/Controllers/EmailController.d.ts +0 -1
  7. package/dist/accessi-module/Controllers/EmailController.js +27 -15
  8. package/dist/accessi-module/Controllers/UserController.d.ts +2 -0
  9. package/dist/accessi-module/Controllers/UserController.js +132 -30
  10. package/dist/accessi-module/Dtos/FiltriUtente.d.ts +3 -2
  11. package/dist/accessi-module/Dtos/FiltriUtente.js +10 -6
  12. package/dist/accessi-module/Dtos/RegisterRequest.d.ts +7 -5
  13. package/dist/accessi-module/Dtos/RegisterRequest.js +90 -21
  14. package/dist/accessi-module/Dtos/SetStatoRegistrazione.d.ts +5 -0
  15. package/dist/accessi-module/Dtos/SetStatoRegistrazione.js +32 -0
  16. package/dist/accessi-module/Dtos/StatoRegistrazione.d.ts +1 -0
  17. package/dist/accessi-module/Dtos/StatoRegistrazione.js +2 -1
  18. package/dist/accessi-module/Dtos/UserDto.d.ts +5 -4
  19. package/dist/accessi-module/Dtos/UserDto.js +85 -34
  20. package/dist/accessi-module/Services/AuthService/AuthService.js +17 -9
  21. package/dist/accessi-module/Services/EmailService/EmailService.d.ts +1 -1
  22. package/dist/accessi-module/Services/EmailService/EmailService.js +62 -33
  23. package/dist/accessi-module/Services/UserService/UserService.d.ts +10 -7
  24. package/dist/accessi-module/Services/UserService/UserService.js +125 -39
  25. package/dist/emilsoftware-utilities-1.4.0-dev.21.tgz +0 -0
  26. package/package.json +1 -1
  27. package/dist/emilsoftware-utilities-1.4.0-dev.2.tgz +0 -0
@@ -17,11 +17,17 @@ class RegisterRequest {
17
17
  }
18
18
  exports.RegisterRequest = RegisterRequest;
19
19
  __decorate([
20
- (0, swagger_1.ApiProperty)({ description: "Email dell'utente.", example: "mario.rossi@dev.it" }),
20
+ (0, swagger_1.ApiProperty)({
21
+ description: "Email dell'utente.",
22
+ example: "mario.rossi@dev.it",
23
+ }),
21
24
  __metadata("design:type", String)
22
25
  ], RegisterRequest.prototype, "email", void 0);
23
26
  __decorate([
24
- (0, swagger_1.ApiPropertyOptional)({ description: "Cognome dell'utente.", example: "Rossi" }),
27
+ (0, swagger_1.ApiPropertyOptional)({
28
+ description: "Cognome dell'utente.",
29
+ example: "Rossi",
30
+ }),
25
31
  __metadata("design:type", String)
26
32
  ], RegisterRequest.prototype, "cognome", void 0);
27
33
  __decorate([
@@ -29,7 +35,11 @@ __decorate([
29
35
  __metadata("design:type", String)
30
36
  ], RegisterRequest.prototype, "nome", void 0);
31
37
  __decorate([
32
- (0, swagger_1.ApiPropertyOptional)({ description: "Numero di cellulare.", example: "+393401234567", nullable: true }),
38
+ (0, swagger_1.ApiPropertyOptional)({
39
+ description: "Numero di cellulare.",
40
+ example: "+393401234567",
41
+ nullable: true,
42
+ }),
33
43
  __metadata("design:type", String)
34
44
  ], RegisterRequest.prototype, "cellulare", void 0);
35
45
  __decorate([
@@ -37,54 +47,113 @@ __decorate([
37
47
  __metadata("design:type", Boolean)
38
48
  ], RegisterRequest.prototype, "flagSuper", void 0);
39
49
  __decorate([
40
- (0, swagger_1.ApiPropertyOptional)({ description: "Ruoli assegnati all'utente.", example: ["admin", "editor"] }),
50
+ (0, swagger_1.ApiPropertyOptional)({
51
+ description: "Ruoli assegnati all'utente.",
52
+ example: ["admin", "editor"],
53
+ }),
41
54
  __metadata("design:type", Array)
42
55
  ], RegisterRequest.prototype, "roles", void 0);
43
56
  __decorate([
44
- (0, swagger_1.ApiPropertyOptional)({ description: "Permessi assegnati all'utente.", type: [Permission_1.Permission], example: [{ codiceMenu: "MNUOFFICINA", tipoAbilitazione: TipoAbilitazione_1.TipoAbilitazione.SCRITTURA }] }),
57
+ (0, swagger_1.ApiPropertyOptional)({
58
+ description: "Permessi assegnati all'utente.",
59
+ type: [Permission_1.Permission],
60
+ example: [
61
+ {
62
+ codiceMenu: "MNUOFFICINA",
63
+ tipoAbilitazione: TipoAbilitazione_1.TipoAbilitazione.SCRITTURA,
64
+ },
65
+ ],
66
+ }),
45
67
  __metadata("design:type", Array)
46
68
  ], RegisterRequest.prototype, "permissions", void 0);
47
69
  __decorate([
48
- (0, swagger_1.ApiPropertyOptional)({ description: "Numero del report associato.", example: 1002 }),
70
+ (0, swagger_1.ApiPropertyOptional)({
71
+ description: "Numero del report associato.",
72
+ example: 1002,
73
+ }),
49
74
  __metadata("design:type", Number)
50
75
  ], RegisterRequest.prototype, "numeroReport", void 0);
51
76
  __decorate([
52
- (0, swagger_1.ApiPropertyOptional)({ description: "Indice personale dell'utente.", example: 15 }),
77
+ (0, swagger_1.ApiPropertyOptional)({
78
+ description: "Indice personale dell'utente.",
79
+ example: 15,
80
+ }),
53
81
  __metadata("design:type", Number)
54
82
  ], RegisterRequest.prototype, "indicePersonale", void 0);
55
83
  __decorate([
56
- (0, swagger_1.ApiPropertyOptional)({ description: "Codice del cliente principale (super).", example: "CLT_SUP_1234" }),
57
- __metadata("design:type", String)
84
+ (0, swagger_1.ApiPropertyOptional)({
85
+ description: "Codice del cliente principale (super).",
86
+ example: 123,
87
+ }),
88
+ __metadata("design:type", Number)
58
89
  ], RegisterRequest.prototype, "codiceClienteSuper", void 0);
59
90
  __decorate([
60
- (0, swagger_1.ApiPropertyOptional)({ description: "Codice dell'agenzia associata.", example: "AGZ_5678" }),
61
- __metadata("design:type", String)
62
- ], RegisterRequest.prototype, "codiceAgenzia", void 0);
91
+ (0, swagger_1.ApiPropertyOptional)({
92
+ description: "Codice dell'agen te associato.",
93
+ example: 123,
94
+ }),
95
+ __metadata("design:type", Number)
96
+ ], RegisterRequest.prototype, "codAge", void 0);
63
97
  __decorate([
64
- (0, swagger_1.ApiPropertyOptional)({ description: "Codice del cliente collegato.", example: "CLT_COL_8765" }),
65
- __metadata("design:type", String)
98
+ (0, swagger_1.ApiPropertyOptional)({
99
+ description: "Codice del cliente collegato.",
100
+ example: "123",
101
+ }),
102
+ __metadata("design:type", Number)
66
103
  ], RegisterRequest.prototype, "codiceClienteCollegato", void 0);
67
104
  __decorate([
68
- (0, swagger_1.ApiPropertyOptional)({ description: "Lista di codici clienti separati da virgola.", example: "CLT_123,CLT_456,CLT_789" }),
105
+ (0, swagger_1.ApiPropertyOptional)({
106
+ description: "Lista di codici clienti separati da virgola.",
107
+ example: "CLT_123,CLT_456,CLT_789",
108
+ }),
69
109
  __metadata("design:type", String)
70
110
  ], RegisterRequest.prototype, "codiceClienti", void 0);
71
111
  __decorate([
72
- (0, swagger_1.ApiPropertyOptional)({ description: "Tipo di filtro applicato.", example: "esclusivo" }),
73
- __metadata("design:type", String)
112
+ (0, swagger_1.ApiPropertyOptional)({
113
+ description: "Tipo di filtro applicato.",
114
+ example: "esclusivo",
115
+ }),
116
+ __metadata("design:type", Number)
74
117
  ], RegisterRequest.prototype, "tipoFiltro", void 0);
75
118
  __decorate([
76
- (0, swagger_1.ApiPropertyOptional)({ description: "Avatar dell'utente.", example: "user.svg" }),
119
+ (0, swagger_1.ApiPropertyOptional)({
120
+ description: "Avatar dell'utente.",
121
+ example: "user.svg",
122
+ }),
77
123
  __metadata("design:type", String)
78
124
  ], RegisterRequest.prototype, "avatar", void 0);
79
125
  __decorate([
80
- (0, swagger_1.ApiPropertyOptional)({ description: "Flag autenticazione a due fattori.", example: false }),
126
+ (0, swagger_1.ApiPropertyOptional)({
127
+ description: "Flag autenticazione a due fattori.",
128
+ example: false,
129
+ }),
81
130
  __metadata("design:type", Boolean)
82
131
  ], RegisterRequest.prototype, "flagDueFattori", void 0);
83
132
  __decorate([
84
- (0, swagger_1.ApiPropertyOptional)({ description: "Pagina di default dell'utente.", example: "/dashboard" }),
133
+ (0, swagger_1.ApiPropertyOptional)({
134
+ description: "Pagina di default dell'utente.",
135
+ example: "/dashboard",
136
+ }),
85
137
  __metadata("design:type", String)
86
138
  ], RegisterRequest.prototype, "paginaDefault", void 0);
87
139
  __decorate([
88
- (0, swagger_1.ApiPropertyOptional)({ description: "Ragione sociale cliente.", example: "ALIVAL STOCK" }),
140
+ (0, swagger_1.ApiPropertyOptional)({
141
+ description: "Ragione sociale cliente.",
142
+ example: "ALIVAL STOCK",
143
+ }),
89
144
  __metadata("design:type", String)
90
145
  ], RegisterRequest.prototype, "ragSocCli", void 0);
146
+ __decorate([
147
+ (0, swagger_1.ApiPropertyOptional)({
148
+ description: "HTML mail personalizzato",
149
+ example: "<html></html>",
150
+ }),
151
+ __metadata("design:type", String)
152
+ ], RegisterRequest.prototype, "htmlMail", void 0);
153
+ __decorate([
154
+ (0, swagger_1.ApiPropertyOptional)({
155
+ description: 'idx della postazione nella tabella ANTENNE_POS di PROLAV',
156
+ example: '12',
157
+ }),
158
+ __metadata("design:type", Number)
159
+ ], RegisterRequest.prototype, "idxPostazione", void 0);
@@ -0,0 +1,5 @@
1
+ import { StatoRegistrazione } from './StatoRegistrazione';
2
+ export declare class SetStatoRegistrazioneDto {
3
+ codiceUtente: number;
4
+ statoRegistrazione: StatoRegistrazione;
5
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SetStatoRegistrazioneDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const StatoRegistrazione_1 = require("./StatoRegistrazione");
15
+ class SetStatoRegistrazioneDto {
16
+ }
17
+ exports.SetStatoRegistrazioneDto = SetStatoRegistrazioneDto;
18
+ __decorate([
19
+ (0, swagger_1.ApiProperty)({
20
+ description: "Codice identificativo dell'utente",
21
+ example: 123,
22
+ }),
23
+ __metadata("design:type", Number)
24
+ ], SetStatoRegistrazioneDto.prototype, "codiceUtente", void 0);
25
+ __decorate([
26
+ (0, swagger_1.ApiProperty)({
27
+ description: 'Nuovo stato di registrazione',
28
+ enum: StatoRegistrazione_1.StatoRegistrazione,
29
+ example: StatoRegistrazione_1.StatoRegistrazione.DELETE,
30
+ }),
31
+ __metadata("design:type", Number)
32
+ ], SetStatoRegistrazioneDto.prototype, "statoRegistrazione", void 0);
@@ -6,3 +6,4 @@ export declare enum StatoRegistrazione {
6
6
  DELETE = 50,
7
7
  BLOCC = 99
8
8
  }
9
+ export declare const StatoRegistrazioneValues: readonly [0, 5, 10, 20, 50, 99];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StatoRegistrazione = void 0;
3
+ exports.StatoRegistrazioneValues = exports.StatoRegistrazione = void 0;
4
4
  var StatoRegistrazione;
5
5
  (function (StatoRegistrazione) {
6
6
  StatoRegistrazione[StatoRegistrazione["NULL"] = 0] = "NULL";
@@ -10,3 +10,4 @@ var StatoRegistrazione;
10
10
  StatoRegistrazione[StatoRegistrazione["DELETE"] = 50] = "DELETE";
11
11
  StatoRegistrazione[StatoRegistrazione["BLOCC"] = 99] = "BLOCC";
12
12
  })(StatoRegistrazione || (exports.StatoRegistrazione = StatoRegistrazione = {}));
13
+ exports.StatoRegistrazioneValues = [0, 5, 10, 20, 50, 99];
@@ -25,9 +25,10 @@ export declare class UserDto {
25
25
  prog?: number;
26
26
  numRep?: number;
27
27
  idxPers?: number;
28
- codiceClienteSuper?: string;
29
- codiceAge?: string;
30
- codiceClienteCol?: string;
28
+ codiceClienteSuper?: number;
29
+ codAge?: number;
30
+ codiceClienteCol?: number;
31
31
  codiceClienti?: string;
32
- tipoFil?: string;
32
+ tipoFiltro?: number;
33
+ idxPostazione?: number;
33
34
  }
@@ -18,11 +18,11 @@ class UserDto {
18
18
  }
19
19
  exports.UserDto = UserDto;
20
20
  __decorate([
21
- (0, swagger_1.ApiProperty)({ description: "Codice identificativo univoco dell'utente.", example: "USR123" }),
21
+ (0, swagger_1.ApiProperty)({ description: "Codice identificativo univoco dell'utente.", example: 'USR123' }),
22
22
  __metadata("design:type", Number)
23
23
  ], UserDto.prototype, "codiceUtente", void 0);
24
24
  __decorate([
25
- (0, swagger_1.ApiProperty)({ description: "Email dell'utente.", example: "mario.rossi@dev.it" }),
25
+ (0, swagger_1.ApiProperty)({ description: "Email dell'utente.", example: 'mario.rossi@dev.it' }),
26
26
  __metadata("design:type", String)
27
27
  ], UserDto.prototype, "email", void 0);
28
28
  __decorate([
@@ -30,106 +30,157 @@ __decorate([
30
30
  __metadata("design:type", Boolean)
31
31
  ], UserDto.prototype, "flagGdpr", void 0);
32
32
  __decorate([
33
- (0, swagger_1.ApiPropertyOptional)({ description: "Data di accettazione del GDPR.", format: "date-time", example: "2024-03-18T12:34:56Z" }),
33
+ (0, swagger_1.ApiPropertyOptional)({
34
+ description: 'Data di accettazione del GDPR.',
35
+ format: 'date-time',
36
+ example: '2024-03-18T12:34:56Z',
37
+ }),
34
38
  __metadata("design:type", String)
35
39
  ], UserDto.prototype, "dataGdpr", void 0);
36
40
  __decorate([
37
- (0, swagger_1.ApiPropertyOptional)({ description: "Data di inserimento dell'utente nel sistema.", format: "date-time", example: "2023-01-01T08:30:00Z" }),
41
+ (0, swagger_1.ApiPropertyOptional)({
42
+ description: "Data di inserimento dell'utente nel sistema.",
43
+ format: 'date-time',
44
+ example: '2023-01-01T08:30:00Z',
45
+ }),
38
46
  __metadata("design:type", String)
39
47
  ], UserDto.prototype, "dataInserimento", void 0);
40
48
  __decorate([
41
- (0, swagger_1.ApiPropertyOptional)({ description: "Data scadenza password.", format: "date-time", example: "2025-06-01" }),
49
+ (0, swagger_1.ApiPropertyOptional)({
50
+ description: 'Data scadenza password.',
51
+ format: 'date-time',
52
+ example: '2025-06-01',
53
+ }),
42
54
  __metadata("design:type", String)
43
55
  ], UserDto.prototype, "dataScadenzaPassword", void 0);
44
56
  __decorate([
45
- (0, swagger_1.ApiPropertyOptional)({ description: "Ultima data di accesso dell'utente.", format: "date-time", example: "2024-03-15T14:45:00Z" }),
57
+ (0, swagger_1.ApiPropertyOptional)({
58
+ description: "Ultima data di accesso dell'utente.",
59
+ format: 'date-time',
60
+ example: '2024-03-15T14:45:00Z',
61
+ }),
46
62
  __metadata("design:type", String)
47
63
  ], UserDto.prototype, "dataLastLogin", void 0);
48
64
  __decorate([
49
- (0, swagger_1.ApiPropertyOptional)({ description: "Stato della registrazione dell'utente.", enum: StatoRegistrazione_1.StatoRegistrazione, example: StatoRegistrazione_1.StatoRegistrazione.CONF }),
65
+ (0, swagger_1.ApiPropertyOptional)({
66
+ description: "Stato della registrazione dell'utente.",
67
+ enum: StatoRegistrazione_1.StatoRegistrazione,
68
+ example: StatoRegistrazione_1.StatoRegistrazione.CONF,
69
+ }),
50
70
  __metadata("design:type", Number)
51
71
  ], UserDto.prototype, "statoRegistrazione", void 0);
52
72
  __decorate([
53
- (0, swagger_1.ApiPropertyOptional)({ description: "Chiave di registrazione dell'utente.", example: "abc123xyz" }),
73
+ (0, swagger_1.ApiPropertyOptional)({
74
+ description: "Chiave di registrazione dell'utente.",
75
+ example: 'abc123xyz',
76
+ }),
54
77
  __metadata("design:type", String)
55
78
  ], UserDto.prototype, "keyRegistrazione", void 0);
56
79
  __decorate([
57
- (0, swagger_1.ApiPropertyOptional)({ description: "Cognome dell'utente.", example: "Rossi" }),
80
+ (0, swagger_1.ApiPropertyOptional)({ description: "Cognome dell'utente.", example: 'Rossi' }),
58
81
  __metadata("design:type", String)
59
82
  ], UserDto.prototype, "cognome", void 0);
60
83
  __decorate([
61
- (0, swagger_1.ApiPropertyOptional)({ description: "Nome dell'utente.", example: "Mario" }),
84
+ (0, swagger_1.ApiPropertyOptional)({ description: "Nome dell'utente.", example: 'Mario' }),
62
85
  __metadata("design:type", String)
63
86
  ], UserDto.prototype, "nome", void 0);
64
87
  __decorate([
65
- (0, swagger_1.ApiPropertyOptional)({ description: "Avatar (URL o base64).", example: "https://example.com/avatar.jpg", nullable: true }),
88
+ (0, swagger_1.ApiPropertyOptional)({
89
+ description: 'Avatar (URL o base64).',
90
+ example: 'https://example.com/avatar.jpg',
91
+ nullable: true,
92
+ }),
66
93
  __metadata("design:type", String)
67
94
  ], UserDto.prototype, "avatar", void 0);
68
95
  __decorate([
69
- (0, swagger_1.ApiPropertyOptional)({ description: "Flag che indica se l'autenticazione a due fattori è attivata.", example: true }),
96
+ (0, swagger_1.ApiPropertyOptional)({
97
+ description: "Flag che indica se l'autenticazione a due fattori è attivata.",
98
+ example: true,
99
+ }),
70
100
  __metadata("design:type", Boolean)
71
101
  ], UserDto.prototype, "flagDueFattori", void 0);
72
102
  __decorate([
73
- (0, swagger_1.ApiPropertyOptional)({ description: "Codice lingua preferito.", example: "it" }),
103
+ (0, swagger_1.ApiPropertyOptional)({ description: 'Codice lingua preferito.', example: 'it' }),
74
104
  __metadata("design:type", String)
75
105
  ], UserDto.prototype, "codiceLingua", void 0);
76
106
  __decorate([
77
- (0, swagger_1.ApiPropertyOptional)({ description: "Numero di cellulare.", example: "+393401234567", nullable: true }),
107
+ (0, swagger_1.ApiPropertyOptional)({
108
+ description: 'Numero di cellulare.',
109
+ example: '+393401234567',
110
+ nullable: true,
111
+ }),
78
112
  __metadata("design:type", String)
79
113
  ], UserDto.prototype, "cellulare", void 0);
80
114
  __decorate([
81
- (0, swagger_1.ApiPropertyOptional)({ description: "Flag superutente.", example: false }),
115
+ (0, swagger_1.ApiPropertyOptional)({ description: 'Flag superutente.', example: false }),
82
116
  __metadata("design:type", Boolean)
83
117
  ], UserDto.prototype, "flagSuper", void 0);
84
118
  __decorate([
85
- (0, swagger_1.ApiPropertyOptional)({ description: "Pagina di default dell'utente all'accesso.", example: "/dashboard" }),
119
+ (0, swagger_1.ApiPropertyOptional)({
120
+ description: "Pagina di default dell'utente all'accesso.",
121
+ example: '/dashboard',
122
+ }),
86
123
  __metadata("design:type", String)
87
124
  ], UserDto.prototype, "paginaDefault", void 0);
88
125
  __decorate([
89
- (0, swagger_1.ApiPropertyOptional)({ description: "Metadata JSON personalizzato.", example: "{\"theme\": \"dark\"}" }),
126
+ (0, swagger_1.ApiPropertyOptional)({
127
+ description: 'Metadata JSON personalizzato.',
128
+ example: '{"theme": "dark"}',
129
+ }),
90
130
  __metadata("design:type", String)
91
131
  ], UserDto.prototype, "jsonMetadata", void 0);
92
132
  __decorate([
93
- (0, swagger_1.ApiPropertyOptional)({ description: "Ragione sociale cliente.", example: "ACME Corp SpA" }),
133
+ (0, swagger_1.ApiPropertyOptional)({ description: 'Ragione sociale cliente.', example: 'ACME Corp SpA' }),
94
134
  __metadata("design:type", String)
95
135
  ], UserDto.prototype, "ragSocCli", void 0);
96
136
  __decorate([
97
- (0, swagger_1.ApiPropertyOptional)({ description: "Ruoli assegnati all'utente.", example: ["admin", "editor"] }),
137
+ (0, swagger_1.ApiPropertyOptional)({ description: "Ruoli assegnati all'utente.", example: ['admin', 'editor'] }),
98
138
  __metadata("design:type", Array)
99
139
  ], UserDto.prototype, "roles", void 0);
100
140
  __decorate([
101
- (0, swagger_1.ApiPropertyOptional)({ description: "Permessi assegnati all'utente.", type: [Permission_1.Permission], example: [{ codiceMenu: "MNUOFFICINA", tipoAbilitazione: TipoAbilitazione_1.TipoAbilitazione.SCRITTURA }] }),
141
+ (0, swagger_1.ApiPropertyOptional)({
142
+ description: "Permessi assegnati all'utente.",
143
+ type: [Permission_1.Permission],
144
+ example: [{ codiceMenu: 'MNUOFFICINA', tipoAbilitazione: TipoAbilitazione_1.TipoAbilitazione.SCRITTURA }],
145
+ }),
102
146
  __metadata("design:type", Array)
103
147
  ], UserDto.prototype, "permissions", void 0);
104
148
  __decorate([
105
- (0, swagger_1.ApiPropertyOptional)({ description: "Progressivo interno.", example: 1001 }),
149
+ (0, swagger_1.ApiPropertyOptional)({ description: 'Progressivo interno.', example: 1001 }),
106
150
  __metadata("design:type", Number)
107
151
  ], UserDto.prototype, "prog", void 0);
108
152
  __decorate([
109
- (0, swagger_1.ApiPropertyOptional)({ description: "Numero di report.", example: 5 }),
153
+ (0, swagger_1.ApiPropertyOptional)({ description: 'Numero di report.', example: 5 }),
110
154
  __metadata("design:type", Number)
111
155
  ], UserDto.prototype, "numRep", void 0);
112
156
  __decorate([
113
- (0, swagger_1.ApiPropertyOptional)({ description: "Indice personalizzato.", example: 200 }),
157
+ (0, swagger_1.ApiPropertyOptional)({ description: 'Indice personalizzato.', example: 200 }),
114
158
  __metadata("design:type", Number)
115
159
  ], UserDto.prototype, "idxPers", void 0);
116
160
  __decorate([
117
- (0, swagger_1.ApiPropertyOptional)({ description: "Codice cliente super.", example: "CLI001" }),
118
- __metadata("design:type", String)
161
+ (0, swagger_1.ApiPropertyOptional)({ description: 'Codice cliente super.', example: 123 }),
162
+ __metadata("design:type", Number)
119
163
  ], UserDto.prototype, "codiceClienteSuper", void 0);
120
164
  __decorate([
121
- (0, swagger_1.ApiPropertyOptional)({ description: "Codice agente.", example: "AGT456" }),
122
- __metadata("design:type", String)
123
- ], UserDto.prototype, "codiceAge", void 0);
165
+ (0, swagger_1.ApiPropertyOptional)({ description: 'Codice agente.', example: 123 }),
166
+ __metadata("design:type", Number)
167
+ ], UserDto.prototype, "codAge", void 0);
124
168
  __decorate([
125
- (0, swagger_1.ApiPropertyOptional)({ description: "Codice cliente collettivo.", example: "CLCOL789" }),
126
- __metadata("design:type", String)
169
+ (0, swagger_1.ApiPropertyOptional)({ description: 'Codice cliente collettivo.', example: 123 }),
170
+ __metadata("design:type", Number)
127
171
  ], UserDto.prototype, "codiceClienteCol", void 0);
128
172
  __decorate([
129
- (0, swagger_1.ApiPropertyOptional)({ description: "Codici multipli clienti.", example: "CLI001, CLI002" }),
173
+ (0, swagger_1.ApiPropertyOptional)({ description: 'Codici multipli clienti.', example: 'CLI001, CLI002' }),
130
174
  __metadata("design:type", String)
131
175
  ], UserDto.prototype, "codiceClienti", void 0);
132
176
  __decorate([
133
- (0, swagger_1.ApiPropertyOptional)({ description: "Tipo di filiale.", example: "HQ" }),
134
- __metadata("design:type", String)
135
- ], UserDto.prototype, "tipoFil", void 0);
177
+ (0, swagger_1.ApiPropertyOptional)({ description: 'Tipo di filtro.', example: 'HQ' }),
178
+ __metadata("design:type", Number)
179
+ ], UserDto.prototype, "tipoFiltro", void 0);
180
+ __decorate([
181
+ (0, swagger_1.ApiPropertyOptional)({
182
+ description: 'idx della postazione nella tabella ANTENNE_POS di PROLAV',
183
+ example: '12',
184
+ }),
185
+ __metadata("design:type", Number)
186
+ ], UserDto.prototype, "idxPostazione", void 0);
@@ -36,9 +36,11 @@ let AuthService = class AuthService {
36
36
  }
37
37
  login(request) {
38
38
  return __awaiter(this, void 0, void 0, function* () {
39
- if (this.accessiOptions.mockDemoUser && request.email.toLowerCase() === "demo")
39
+ if (this.accessiOptions.mockDemoUser &&
40
+ request.email.toLowerCase() === "demo")
40
41
  return this.getDemoUser();
41
- if (this.accessiOptions.mockDemoUser && request.email.toLowerCase() === "admin")
42
+ if (this.accessiOptions.mockDemoUser &&
43
+ request.email.toLowerCase() === "admin")
42
44
  return this.getAdminUser();
43
45
  const passwordCifrata = Utilities_1.CryptUtilities.encrypt(request.password, this.accessiOptions.encryptionKey);
44
46
  const utente = yield this.userService.getUserByEmail(request.email.toLowerCase());
@@ -61,10 +63,13 @@ let AuthService = class AuthService {
61
63
  const isPasswordValid = yield this.verifyPassword(utente.codiceUtente, passwordCifrata);
62
64
  if (!isPasswordValid)
63
65
  throw new Error("Nome utente o password errata!");
64
- const today = new Date();
65
- const targetDate = new Date(utente.dataScadenzaPassword);
66
- if (today >= targetDate) {
67
- throw new Error("Password scaduta!");
66
+ if (this.accessiOptions.passwordExpiration &&
67
+ this.accessiOptions.passwordExpiration == true) {
68
+ const today = new Date();
69
+ const targetDate = new Date(utente.dataScadenzaPassword);
70
+ if (today >= targetDate) {
71
+ throw new Error("PASSWORD_EXPIRED");
72
+ }
68
73
  }
69
74
  // Recupera i grants
70
75
  const userGrants = yield this.permissionService.getUserRolesAndGrants(utente.codiceUtente);
@@ -73,9 +78,12 @@ let AuthService = class AuthService {
73
78
  const updateLastAccessDateQuery = "UPDATE UTENTI SET DATLASTLOGIN = CURRENT_TIMESTAMP WHERE CODUTE = ?";
74
79
  yield Orm_1.Orm.query(this.accessiOptions.databaseOptions, updateLastAccessDateQuery, [utente.codiceUtente]);
75
80
  let extensionFields = {};
76
- for (const ext of this.accessiOptions.extensionFieldsOptions) {
77
- const values = (yield Orm_1.Orm.query(ext.databaseOptions, `SELECT ${ext.tableFields.join(",")} FROM ${ext.tableName} WHERE ${ext.tableJoinFieldName} = ?`, [utente.codiceUtente])).map(Utilities_1.RestUtilities.convertKeysToCamelCase);
78
- extensionFields[ext.objectKey] = values;
81
+ if (this.accessiOptions.extensionFieldsOptions &&
82
+ this.accessiOptions.extensionFieldsOptions.length > 0) {
83
+ for (const ext of this.accessiOptions.extensionFieldsOptions) {
84
+ const values = (yield Orm_1.Orm.query(ext.databaseOptions, `SELECT ${ext.tableFields.join(",")} FROM ${ext.tableName} WHERE ${ext.tableJoinFieldName} = ?`, [utente.codiceUtente])).map(Utilities_1.RestUtilities.convertKeysToCamelCase);
85
+ extensionFields[ext.objectKey] = values;
86
+ }
79
87
  }
80
88
  return { utente, filtri, userGrants, extensionFields };
81
89
  });
@@ -4,6 +4,6 @@ export declare class EmailService {
4
4
  constructor(accessiOptions: AccessiOptions);
5
5
  sendAccountUpdateEmail(email: string, message: string): Promise<void>;
6
6
  private transporter;
7
- sendPasswordResetEmail(email: string, resetUrlCustom?: string, htmlMail?: string): Promise<void>;
7
+ sendPasswordResetEmail(email: string, htmlMail?: string): Promise<void>;
8
8
  private GetHtmlMail;
9
9
  }