emilsoftware-utilities 2.0.0-dev.32 → 2.0.0-dev.33
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/dist/accessi-module/Console/console.js +3 -10
- package/dist/accessi-module/Console/console.js.map +1 -1
- package/dist/accessi-module/Console/generated/model/createMenuGroupRequest.d.ts +0 -5
- package/dist/accessi-module/Console/generated/model/createMenuGroupRequest.js.map +1 -1
- package/dist/accessi-module/Console/generated/model/groupWithMenusEntity.d.ts +0 -2
- package/dist/accessi-module/Console/generated/model/groupWithMenusEntity.js.map +1 -1
- package/dist/accessi-module/Console/generated/model/menuEntity.d.ts +0 -2
- package/dist/accessi-module/Console/generated/model/menuEntity.js.map +1 -1
- package/dist/accessi-module/Console/generated/model/publicRegisterRequest.d.ts +0 -2
- package/dist/accessi-module/Console/generated/model/publicRegisterRequest.js.map +1 -1
- package/dist/accessi-module/Console/generated/model/registerRequest.d.ts +0 -2
- package/dist/accessi-module/Console/generated/model/registerRequest.js.map +1 -1
- package/dist/accessi-module/Console/generated/model/updateMenuGroupRequest.d.ts +0 -5
- package/dist/accessi-module/Console/generated/model/updateMenuGroupRequest.js.map +1 -1
- package/dist/accessi-module/Console/generated/model/userDto.d.ts +0 -4
- package/dist/accessi-module/Console/generated/model/userDto.js.map +1 -1
- package/dist/accessi-module/Console/wiki.js +2 -2
- package/dist/accessi-module/Console/wiki.js.map +1 -1
- package/dist/accessi-module/Dtos/CatalogDtos.d.ts +0 -2
- package/dist/accessi-module/Dtos/CatalogDtos.js +0 -14
- package/dist/accessi-module/Dtos/CatalogDtos.js.map +1 -1
- package/dist/accessi-module/Dtos/GetGroupsWithMenusResponse.d.ts +0 -1
- package/dist/accessi-module/Dtos/GetGroupsWithMenusResponse.js +0 -8
- package/dist/accessi-module/Dtos/GetGroupsWithMenusResponse.js.map +1 -1
- package/dist/accessi-module/Dtos/GetMenusResponse.d.ts +0 -1
- package/dist/accessi-module/Dtos/GetMenusResponse.js +0 -8
- package/dist/accessi-module/Dtos/GetMenusResponse.js.map +1 -1
- package/dist/accessi-module/Dtos/RegisterRequest.d.ts +0 -1
- package/dist/accessi-module/Dtos/RegisterRequest.js +0 -9
- package/dist/accessi-module/Dtos/RegisterRequest.js.map +1 -1
- package/dist/accessi-module/Dtos/UserDto.d.ts +0 -2
- package/dist/accessi-module/Dtos/UserDto.js +0 -16
- package/dist/accessi-module/Dtos/UserDto.js.map +1 -1
- package/dist/accessi-module/Services/AuthService/AuthService.js +0 -2
- package/dist/accessi-module/Services/AuthService/AuthService.js.map +1 -1
- package/dist/accessi-module/Services/PermissionService/PermissionService.js +5 -13
- package/dist/accessi-module/Services/PermissionService/PermissionService.js.map +1 -1
- package/dist/accessi-module/Services/UserService/UserService.d.ts +0 -1
- package/dist/accessi-module/Services/UserService/UserService.js +2 -25
- package/dist/accessi-module/Services/UserService/UserService.js.map +1 -1
- package/dist/accessi-module/database-updates/AccessiDatabaseUpdater.js +7 -0
- package/dist/accessi-module/database-updates/AccessiDatabaseUpdater.js.map +1 -1
- package/dist/accessi-module/database-updates/accessiSchema.d.ts +13 -2
- package/dist/accessi-module/database-updates/accessiSchema.js +15 -7
- package/dist/accessi-module/database-updates/accessiSchema.js.map +1 -1
- package/dist/emilsoftware-utilities-2.0.0-dev.33.tgz +0 -0
- package/package.json +1 -1
- package/dist/emilsoftware-utilities-2.0.0-dev.32.tgz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CatalogDtos.js","sourceRoot":"","sources":["../../../src/accessi-module/Dtos/CatalogDtos.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmE;AACnE,yDAAyC;AACzC,qDASyB;AACzB,iDAA8C;AAE9C;;;GAGG;AAEH,8EAA8E;AAC9E,wBAAwB;AACxB,8EAA8E;AAE9E,MAAa,cAAc;CAM1B;AAND,wCAMC;AAJC;IADC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,qCAAqC,EAAE,OAAO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,CAAC;IAC1G,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,yCAAyC,EAAE,CAAC;IAChE,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,+CAA+C,EAAE,CAAC;;uDAC5D;AAMhB;IAJC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;IACpG,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,mCAAmC,EAAE,CAAC;IAC1D,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,yCAAyC,EAAE,CAAC;;uDACtD;AAKhB;IAHC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,mBAAmB,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IAC/F,IAAA,sBAAI,EAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,sCAAsC,EAAE,CAAC;IACjE,IAAA,4BAAU,GAAE;;2DACM","sourcesContent":["import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';\nimport { Type } from 'class-transformer';\nimport {\n IsBoolean,\n IsIn,\n IsInt,\n IsNotEmpty,\n IsOptional,\n IsString,\n MaxLength,\n ValidateNested,\n} from 'class-validator';\nimport { BaseResponse } from './BaseResponse';\n\n/**\n * DTO di gestione dei cataloghi di configurazione (menu, gruppi, tipi menu, tipi filtro).\n * I codici sono chiavi primarie immutabili: vengono valorizzati in creazione e passati come path in modifica.\n */\n\n// ---------------------------------------------------------------------------\n// Tipi menu (MENU_TIPI)\n// ---------------------------------------------------------------------------\n\nexport class MenuTypeEntity {\n @ApiProperty({ description: 'Codice del tipo menu (1 carattere).', example: 'A' })\n codiceTipo!: string;\n\n @ApiPropertyOptional({ description: 'Descrizione del tipo menu.', example: 'Amministrazione' })\n descrizioneTipo?: string;\n}\n\nexport class GetMenuTypesResponse extends BaseResponse {\n @ApiProperty({ type: [MenuTypeEntity] })\n @ValidateNested({ each: true })\n @Type(() => MenuTypeEntity)\n Result!: MenuTypeEntity[];\n}\n\nexport class CreateMenuTypeRequest {\n @ApiProperty({ description: 'Codice del tipo menu (1 carattere).', example: 'A', maxLength: 1 })\n @IsString({ message: 'Il codice tipo deve essere una stringa.' })\n @IsNotEmpty({ message: 'Il codice tipo e obbligatorio.' })\n @MaxLength(1, { message: 'Il codice tipo non puo superare 1 carattere.' })\n codiceTipo!: string;\n\n @ApiPropertyOptional({ description: 'Descrizione del tipo menu.', example: 'Amministrazione', maxLength: 20 })\n @IsString({ message: 'La descrizione deve essere una stringa.' })\n @IsOptional()\n @MaxLength(20, { message: 'La descrizione non puo superare 20 caratteri.' })\n descrizioneTipo?: string;\n}\n\nexport class UpdateMenuTypeRequest {\n @ApiPropertyOptional({ description: 'Descrizione del tipo menu.', example: 'Amministrazione', maxLength: 20 })\n @IsString({ message: 'La descrizione deve essere una stringa.' })\n @IsOptional()\n @MaxLength(20, { message: 'La descrizione non puo superare 20 caratteri.' })\n descrizioneTipo?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Gruppi menu (MENU_GRP)\n// ---------------------------------------------------------------------------\n\nexport class CreateMenuGroupRequest {\n @ApiProperty({ description: 'Codice del gruppo (1 carattere).', example: 'A', maxLength: 1 })\n @IsString({ message: 'Il codice gruppo deve essere una stringa.' })\n @IsNotEmpty({ message: 'Il codice gruppo e obbligatorio.' })\n @MaxLength(1, { message: 'Il codice gruppo non puo superare 1 carattere.' })\n codiceGruppo!: string;\n\n @ApiPropertyOptional({ description: 'Descrizione del gruppo.', example: 'Gestione Accessi', maxLength: 100 })\n @IsString({ message: 'La descrizione deve essere una stringa.' })\n @IsOptional()\n @MaxLength(100, { message: 'La descrizione non puo superare 100 caratteri.' })\n descrizioneGruppo?: string;\n\n @ApiPropertyOptional({ description: 'Ordine di visualizzazione del gruppo.', example: 1, type: Number })\n @IsInt({ message: \"L'ordine deve essere un intero.\" })\n @IsOptional()\n @Type(() => Number)\n ordineGruppo?: number;\n\n @ApiPropertyOptional({ description: 'Gruppo abilitato.', example: true, type: Boolean })\n @IsBoolean({ message: 'Il flag enabled deve essere booleano.' })\n @IsOptional()\n enabled?: boolean;\n\n @ApiPropertyOptional({ description: 'Nome del campo applicativo associato al gruppo.', example: 'REPARTO', maxLength: 20 })\n @IsString({ message: 'Il nome campo deve essere una stringa.' })\n @IsOptional()\n @MaxLength(20, { message: 'Il nome campo non puo superare 20 caratteri.' })\n nomeCampo?: string;\n}\n\nexport class UpdateMenuGroupRequest {\n @ApiPropertyOptional({ description: 'Descrizione del gruppo.', example: 'Gestione Accessi', maxLength: 100 })\n @IsString({ message: 'La descrizione deve essere una stringa.' })\n @IsOptional()\n @MaxLength(100, { message: 'La descrizione non puo superare 100 caratteri.' })\n descrizioneGruppo?: string;\n\n @ApiPropertyOptional({ description: 'Ordine di visualizzazione del gruppo.', example: 1, type: Number })\n @IsInt({ message: \"L'ordine deve essere un intero.\" })\n @IsOptional()\n @Type(() => Number)\n ordineGruppo?: number;\n\n @ApiPropertyOptional({ description: 'Gruppo abilitato.', example: true, type: Boolean })\n @IsBoolean({ message: 'Il flag enabled deve essere booleano.' })\n @IsOptional()\n enabled?: boolean;\n\n @ApiPropertyOptional({ description: 'Nome del campo applicativo associato al gruppo.', example: 'REPARTO', maxLength: 20 })\n @IsString({ message: 'Il nome campo deve essere una stringa.' })\n @IsOptional()\n @MaxLength(20, { message: 'Il nome campo non puo superare 20 caratteri.' })\n nomeCampo?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Menu (MENU)\n// ---------------------------------------------------------------------------\n\nexport class CreateMenuRequest {\n @ApiProperty({ description: 'Codice univoco del menu.', example: 'MNU001', maxLength: 20 })\n @IsString({ message: 'Il codice menu deve essere una stringa.' })\n @IsNotEmpty({ message: 'Il codice menu e obbligatorio.' })\n @MaxLength(20, { message: 'Il codice menu non puo superare 20 caratteri.' })\n codiceMenu!: string;\n\n @ApiPropertyOptional({ description: 'Descrizione del menu.', example: 'Gestione Utenti', maxLength: 100 })\n @IsString({ message: 'La descrizione deve essere una stringa.' })\n @IsOptional()\n @MaxLength(100, { message: 'La descrizione non puo superare 100 caratteri.' })\n descrizioneMenu?: string;\n\n @ApiProperty({ description: 'Codice del gruppo di appartenenza.', example: 'A', maxLength: 1 })\n @IsString({ message: 'Il codice gruppo deve essere una stringa.' })\n @IsNotEmpty({ message: 'Il codice gruppo e obbligatorio.' })\n @MaxLength(1, { message: 'Il codice gruppo non puo superare 1 carattere.' })\n codiceGruppo!: string;\n\n @ApiPropertyOptional({ description: 'Codice del tipo menu.', example: 'A', maxLength: 1 })\n @IsString({ message: 'Il tipo menu deve essere una stringa.' })\n @IsOptional()\n @MaxLength(1, { message: 'Il tipo menu non puo superare 1 carattere.' })\n tipo?: string;\n\n @ApiPropertyOptional({ description: \"Percorso dell'icona.\", example: 'fa-users', maxLength: 50 })\n @IsString({ message: \"L'icona deve essere una stringa.\" })\n @IsOptional()\n @MaxLength(50, { message: \"L'icona non puo superare 50 caratteri.\" })\n icona?: string;\n\n @ApiPropertyOptional({ description: 'Pagina associata al menu.', example: '/accessi/gestione-utenti', maxLength: 50 })\n @IsString({ message: 'La pagina deve essere una stringa.' })\n @IsOptional()\n @MaxLength(50, { message: 'La pagina non puo superare 50 caratteri.' })\n pagina?: string;\n\n @ApiPropertyOptional({ description: 'Ordine di visualizzazione del menu.', example: 1, type: Number })\n @IsInt({ message: \"L'ordine deve essere un intero.\" })\n @IsOptional()\n @Type(() => Number)\n ordineMenu?: number;\n\n @ApiPropertyOptional({ description: 'Menu abilitato.', example: true, type: Boolean })\n @IsBoolean({ message: 'Il flag enabled deve essere booleano.' })\n @IsOptional()\n enabled?: boolean;\n\n @ApiPropertyOptional({ description: 'Menu di riferimento (gerarchia).', example: 'MNU000', maxLength: 20 })\n @IsString({ message: 'Il menu di riferimento deve essere una stringa.' })\n @IsOptional()\n @MaxLength(20, { message: 'Il menu di riferimento non puo superare 20 caratteri.' })\n rifMenu?: string;\n\n @ApiPropertyOptional({ description: 'Nota informativa associata al menu.', example: 'Visibile solo agli amministratori', maxLength: 1000 })\n @IsString({ message: 'La nota deve essere una stringa.' })\n @IsOptional()\n @MaxLength(1000, { message: 'La nota non puo superare 1000 caratteri.' })\n note?: string;\n}\n\nexport class UpdateMenuRequest {\n @ApiPropertyOptional({ description: 'Descrizione del menu.', example: 'Gestione Utenti', maxLength: 100 })\n @IsString({ message: 'La descrizione deve essere una stringa.' })\n @IsOptional()\n @MaxLength(100, { message: 'La descrizione non puo superare 100 caratteri.' })\n descrizioneMenu?: string;\n\n @ApiPropertyOptional({ description: 'Codice del gruppo di appartenenza.', example: 'A', maxLength: 1 })\n @IsString({ message: 'Il codice gruppo deve essere una stringa.' })\n @IsOptional()\n @MaxLength(1, { message: 'Il codice gruppo non puo superare 1 carattere.' })\n codiceGruppo?: string;\n\n @ApiPropertyOptional({ description: 'Codice del tipo menu.', example: 'A', maxLength: 1 })\n @IsString({ message: 'Il tipo menu deve essere una stringa.' })\n @IsOptional()\n @MaxLength(1, { message: 'Il tipo menu non puo superare 1 carattere.' })\n tipo?: string;\n\n @ApiPropertyOptional({ description: \"Percorso dell'icona.\", example: 'fa-users', maxLength: 50 })\n @IsString({ message: \"L'icona deve essere una stringa.\" })\n @IsOptional()\n @MaxLength(50, { message: \"L'icona non puo superare 50 caratteri.\" })\n icona?: string;\n\n @ApiPropertyOptional({ description: 'Pagina associata al menu.', example: '/accessi/gestione-utenti', maxLength: 50 })\n @IsString({ message: 'La pagina deve essere una stringa.' })\n @IsOptional()\n @MaxLength(50, { message: 'La pagina non puo superare 50 caratteri.' })\n pagina?: string;\n\n @ApiPropertyOptional({ description: 'Ordine di visualizzazione del menu.', example: 1, type: Number })\n @IsInt({ message: \"L'ordine deve essere un intero.\" })\n @IsOptional()\n @Type(() => Number)\n ordineMenu?: number;\n\n @ApiPropertyOptional({ description: 'Menu abilitato.', example: true, type: Boolean })\n @IsBoolean({ message: 'Il flag enabled deve essere booleano.' })\n @IsOptional()\n enabled?: boolean;\n\n @ApiPropertyOptional({ description: 'Menu di riferimento (gerarchia).', example: 'MNU000', maxLength: 20 })\n @IsString({ message: 'Il menu di riferimento deve essere una stringa.' })\n @IsOptional()\n @MaxLength(20, { message: 'Il menu di riferimento non puo superare 20 caratteri.' })\n rifMenu?: string;\n\n @ApiPropertyOptional({ description: 'Nota informativa associata al menu.', example: 'Visibile solo agli amministratori', maxLength: 1000 })\n @IsString({ message: 'La nota deve essere una stringa.' })\n @IsOptional()\n @MaxLength(1000, { message: 'La nota non puo superare 1000 caratteri.' })\n note?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Tipi filtro (FILTRI_TIPO)\n// ---------------------------------------------------------------------------\n\nexport class CreateFilterTypeRequest {\n @ApiProperty({ description: 'Identificativo del tipo di filtro.', example: 1, type: Number })\n @IsInt({ message: 'Il codice tipo filtro deve essere un intero.' })\n @Type(() => Number)\n tipFil!: number;\n\n @ApiPropertyOptional({ description: 'Descrizione del filtro.', example: 'Filtro standard', maxLength: 20 })\n @IsString({ message: 'La descrizione deve essere una stringa.' })\n @IsOptional()\n @MaxLength(20, { message: 'La descrizione non puo superare 20 caratteri.' })\n desFil?: string;\n\n @ApiPropertyOptional({ description: 'Campo associato al filtro.', example: 'CODCLI', maxLength: 20 })\n @IsString({ message: 'Il campo deve essere una stringa.' })\n @IsOptional()\n @MaxLength(20, { message: 'Il campo non puo superare 20 caratteri.' })\n fldFil?: string;\n\n @ApiPropertyOptional({ description: 'Filtro abilitato.', example: 1, enum: [0, 1], default: 1 })\n @IsIn([0, 1], { message: 'Il flag abilitato deve essere 0 o 1.' })\n @IsOptional()\n flgEnabled?: 0 | 1;\n}\n\nexport class UpdateFilterTypeRequest {\n @ApiPropertyOptional({ description: 'Descrizione del filtro.', example: 'Filtro standard', maxLength: 20 })\n @IsString({ message: 'La descrizione deve essere una stringa.' })\n @IsOptional()\n @MaxLength(20, { message: 'La descrizione non puo superare 20 caratteri.' })\n desFil?: string;\n\n @ApiPropertyOptional({ description: 'Campo associato al filtro.', example: 'CODCLI', maxLength: 20 })\n @IsString({ message: 'Il campo deve essere una stringa.' })\n @IsOptional()\n @MaxLength(20, { message: 'Il campo non puo superare 20 caratteri.' })\n fldFil?: string;\n\n @ApiPropertyOptional({ description: 'Filtro abilitato.', example: 1, enum: [0, 1], default: 1 })\n @IsIn([0, 1], { message: 'Il flag abilitato deve essere 0 o 1.' })\n @IsOptional()\n flgEnabled?: 0 | 1;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"CatalogDtos.js","sourceRoot":"","sources":["../../../src/accessi-module/Dtos/CatalogDtos.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmE;AACnE,yDAAyC;AACzC,qDASyB;AACzB,iDAA8C;AAE9C;;;GAGG;AAEH,8EAA8E;AAC9E,wBAAwB;AACxB,8EAA8E;AAE9E,MAAa,cAAc;CAM1B;AAND,wCAMC;AAJC;IADC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,qCAAqC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;;kDAC9D;AAGpB;IADC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;;uDACtE;AAG3B,MAAa,oBAAqB,SAAQ,2BAAY;CAKrD;AALD,oDAKC;AADC;IAHC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,CAAC,cAAc,CAAC,EAAE,CAAC;IACvC,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,cAAc,CAAC;;oDACD;AAG5B,MAAa,qBAAqB;CAYjC;AAZD,sDAYC;AAPC;IAJC,IAAA,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AU,GAAE;;2DACM;AAGrB,MAAa,uBAAuB;CAiBnC;AAjBD,0DAiBC;AAZC;IAJC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,yBAAyB,EAAE,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;IAC1G,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,yCAAyC,EAAE,CAAC;IAChE,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,+CAA+C,EAAE,CAAC;;uDAC5D;AAMhB;IAJC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;IACpG,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,mCAAmC,EAAE,CAAC;IAC1D,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,yCAAyC,EAAE,CAAC;;uDACtD;AAKhB;IAHC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,mBAAmB,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IAC/F,IAAA,sBAAI,EAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,sCAAsC,EAAE,CAAC;IACjE,IAAA,4BAAU,GAAE;;2DACM","sourcesContent":["import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';\nimport { Type } from 'class-transformer';\nimport {\n IsBoolean,\n IsIn,\n IsInt,\n IsNotEmpty,\n IsOptional,\n IsString,\n MaxLength,\n ValidateNested,\n} from 'class-validator';\nimport { BaseResponse } from './BaseResponse';\n\n/**\n * DTO di gestione dei cataloghi di configurazione (menu, gruppi, tipi menu, tipi filtro).\n * I codici sono chiavi primarie immutabili: vengono valorizzati in creazione e passati come path in modifica.\n */\n\n// ---------------------------------------------------------------------------\n// Tipi menu (MENU_TIPI)\n// ---------------------------------------------------------------------------\n\nexport class MenuTypeEntity {\n @ApiProperty({ description: 'Codice del tipo menu (1 carattere).', example: 'A' })\n codiceTipo!: string;\n\n @ApiPropertyOptional({ description: 'Descrizione del tipo menu.', example: 'Amministrazione' })\n descrizioneTipo?: string;\n}\n\nexport class GetMenuTypesResponse extends BaseResponse {\n @ApiProperty({ type: [MenuTypeEntity] })\n @ValidateNested({ each: true })\n @Type(() => MenuTypeEntity)\n Result!: MenuTypeEntity[];\n}\n\nexport class CreateMenuTypeRequest {\n @ApiProperty({ description: 'Codice del tipo menu (1 carattere).', example: 'A', maxLength: 1 })\n @IsString({ message: 'Il codice tipo deve essere una stringa.' })\n @IsNotEmpty({ message: 'Il codice tipo e obbligatorio.' })\n @MaxLength(1, { message: 'Il codice tipo non puo superare 1 carattere.' })\n codiceTipo!: string;\n\n @ApiPropertyOptional({ description: 'Descrizione del tipo menu.', example: 'Amministrazione', maxLength: 20 })\n @IsString({ message: 'La descrizione deve essere una stringa.' })\n @IsOptional()\n @MaxLength(20, { message: 'La descrizione non puo superare 20 caratteri.' })\n descrizioneTipo?: string;\n}\n\nexport class UpdateMenuTypeRequest {\n @ApiPropertyOptional({ description: 'Descrizione del tipo menu.', example: 'Amministrazione', maxLength: 20 })\n @IsString({ message: 'La descrizione deve essere una stringa.' })\n @IsOptional()\n @MaxLength(20, { message: 'La descrizione non puo superare 20 caratteri.' })\n descrizioneTipo?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Gruppi menu (MENU_GRP)\n// ---------------------------------------------------------------------------\n\nexport class CreateMenuGroupRequest {\n @ApiProperty({ description: 'Codice del gruppo (1 carattere).', example: 'A', maxLength: 1 })\n @IsString({ message: 'Il codice gruppo deve essere una stringa.' })\n @IsNotEmpty({ message: 'Il codice gruppo e obbligatorio.' })\n @MaxLength(1, { message: 'Il codice gruppo non puo superare 1 carattere.' })\n codiceGruppo!: string;\n\n @ApiPropertyOptional({ description: 'Descrizione del gruppo.', example: 'Gestione Accessi', maxLength: 100 })\n @IsString({ message: 'La descrizione deve essere una stringa.' })\n @IsOptional()\n @MaxLength(100, { message: 'La descrizione non puo superare 100 caratteri.' })\n descrizioneGruppo?: string;\n\n @ApiPropertyOptional({ description: 'Ordine di visualizzazione del gruppo.', example: 1, type: Number })\n @IsInt({ message: \"L'ordine deve essere un intero.\" })\n @IsOptional()\n @Type(() => Number)\n ordineGruppo?: number;\n\n @ApiPropertyOptional({ description: 'Gruppo abilitato.', example: true, type: Boolean })\n @IsBoolean({ message: 'Il flag enabled deve essere booleano.' })\n @IsOptional()\n enabled?: boolean;\n}\n\nexport class UpdateMenuGroupRequest {\n @ApiPropertyOptional({ description: 'Descrizione del gruppo.', example: 'Gestione Accessi', maxLength: 100 })\n @IsString({ message: 'La descrizione deve essere una stringa.' })\n @IsOptional()\n @MaxLength(100, { message: 'La descrizione non puo superare 100 caratteri.' })\n descrizioneGruppo?: string;\n\n @ApiPropertyOptional({ description: 'Ordine di visualizzazione del gruppo.', example: 1, type: Number })\n @IsInt({ message: \"L'ordine deve essere un intero.\" })\n @IsOptional()\n @Type(() => Number)\n ordineGruppo?: number;\n\n @ApiPropertyOptional({ description: 'Gruppo abilitato.', example: true, type: Boolean })\n @IsBoolean({ message: 'Il flag enabled deve essere booleano.' })\n @IsOptional()\n enabled?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Menu (MENU)\n// ---------------------------------------------------------------------------\n\nexport class CreateMenuRequest {\n @ApiProperty({ description: 'Codice univoco del menu.', example: 'MNU001', maxLength: 20 })\n @IsString({ message: 'Il codice menu deve essere una stringa.' })\n @IsNotEmpty({ message: 'Il codice menu e obbligatorio.' })\n @MaxLength(20, { message: 'Il codice menu non puo superare 20 caratteri.' })\n codiceMenu!: string;\n\n @ApiPropertyOptional({ description: 'Descrizione del menu.', example: 'Gestione Utenti', maxLength: 100 })\n @IsString({ message: 'La descrizione deve essere una stringa.' })\n @IsOptional()\n @MaxLength(100, { message: 'La descrizione non puo superare 100 caratteri.' })\n descrizioneMenu?: string;\n\n @ApiProperty({ description: 'Codice del gruppo di appartenenza.', example: 'A', maxLength: 1 })\n @IsString({ message: 'Il codice gruppo deve essere una stringa.' })\n @IsNotEmpty({ message: 'Il codice gruppo e obbligatorio.' })\n @MaxLength(1, { message: 'Il codice gruppo non puo superare 1 carattere.' })\n codiceGruppo!: string;\n\n @ApiPropertyOptional({ description: 'Codice del tipo menu.', example: 'A', maxLength: 1 })\n @IsString({ message: 'Il tipo menu deve essere una stringa.' })\n @IsOptional()\n @MaxLength(1, { message: 'Il tipo menu non puo superare 1 carattere.' })\n tipo?: string;\n\n @ApiPropertyOptional({ description: \"Percorso dell'icona.\", example: 'fa-users', maxLength: 50 })\n @IsString({ message: \"L'icona deve essere una stringa.\" })\n @IsOptional()\n @MaxLength(50, { message: \"L'icona non puo superare 50 caratteri.\" })\n icona?: string;\n\n @ApiPropertyOptional({ description: 'Pagina associata al menu.', example: '/accessi/gestione-utenti', maxLength: 50 })\n @IsString({ message: 'La pagina deve essere una stringa.' })\n @IsOptional()\n @MaxLength(50, { message: 'La pagina non puo superare 50 caratteri.' })\n pagina?: string;\n\n @ApiPropertyOptional({ description: 'Ordine di visualizzazione del menu.', example: 1, type: Number })\n @IsInt({ message: \"L'ordine deve essere un intero.\" })\n @IsOptional()\n @Type(() => Number)\n ordineMenu?: number;\n\n @ApiPropertyOptional({ description: 'Menu abilitato.', example: true, type: Boolean })\n @IsBoolean({ message: 'Il flag enabled deve essere booleano.' })\n @IsOptional()\n enabled?: boolean;\n\n @ApiPropertyOptional({ description: 'Menu di riferimento (gerarchia).', example: 'MNU000', maxLength: 20 })\n @IsString({ message: 'Il menu di riferimento deve essere una stringa.' })\n @IsOptional()\n @MaxLength(20, { message: 'Il menu di riferimento non puo superare 20 caratteri.' })\n rifMenu?: string;\n\n @ApiPropertyOptional({ description: 'Nota informativa associata al menu.', example: 'Visibile solo agli amministratori', maxLength: 1000 })\n @IsString({ message: 'La nota deve essere una stringa.' })\n @IsOptional()\n @MaxLength(1000, { message: 'La nota non puo superare 1000 caratteri.' })\n note?: string;\n}\n\nexport class UpdateMenuRequest {\n @ApiPropertyOptional({ description: 'Descrizione del menu.', example: 'Gestione Utenti', maxLength: 100 })\n @IsString({ message: 'La descrizione deve essere una stringa.' })\n @IsOptional()\n @MaxLength(100, { message: 'La descrizione non puo superare 100 caratteri.' })\n descrizioneMenu?: string;\n\n @ApiPropertyOptional({ description: 'Codice del gruppo di appartenenza.', example: 'A', maxLength: 1 })\n @IsString({ message: 'Il codice gruppo deve essere una stringa.' })\n @IsOptional()\n @MaxLength(1, { message: 'Il codice gruppo non puo superare 1 carattere.' })\n codiceGruppo?: string;\n\n @ApiPropertyOptional({ description: 'Codice del tipo menu.', example: 'A', maxLength: 1 })\n @IsString({ message: 'Il tipo menu deve essere una stringa.' })\n @IsOptional()\n @MaxLength(1, { message: 'Il tipo menu non puo superare 1 carattere.' })\n tipo?: string;\n\n @ApiPropertyOptional({ description: \"Percorso dell'icona.\", example: 'fa-users', maxLength: 50 })\n @IsString({ message: \"L'icona deve essere una stringa.\" })\n @IsOptional()\n @MaxLength(50, { message: \"L'icona non puo superare 50 caratteri.\" })\n icona?: string;\n\n @ApiPropertyOptional({ description: 'Pagina associata al menu.', example: '/accessi/gestione-utenti', maxLength: 50 })\n @IsString({ message: 'La pagina deve essere una stringa.' })\n @IsOptional()\n @MaxLength(50, { message: 'La pagina non puo superare 50 caratteri.' })\n pagina?: string;\n\n @ApiPropertyOptional({ description: 'Ordine di visualizzazione del menu.', example: 1, type: Number })\n @IsInt({ message: \"L'ordine deve essere un intero.\" })\n @IsOptional()\n @Type(() => Number)\n ordineMenu?: number;\n\n @ApiPropertyOptional({ description: 'Menu abilitato.', example: true, type: Boolean })\n @IsBoolean({ message: 'Il flag enabled deve essere booleano.' })\n @IsOptional()\n enabled?: boolean;\n\n @ApiPropertyOptional({ description: 'Menu di riferimento (gerarchia).', example: 'MNU000', maxLength: 20 })\n @IsString({ message: 'Il menu di riferimento deve essere una stringa.' })\n @IsOptional()\n @MaxLength(20, { message: 'Il menu di riferimento non puo superare 20 caratteri.' })\n rifMenu?: string;\n\n @ApiPropertyOptional({ description: 'Nota informativa associata al menu.', example: 'Visibile solo agli amministratori', maxLength: 1000 })\n @IsString({ message: 'La nota deve essere una stringa.' })\n @IsOptional()\n @MaxLength(1000, { message: 'La nota non puo superare 1000 caratteri.' })\n note?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Tipi filtro (FILTRI_TIPO)\n// ---------------------------------------------------------------------------\n\nexport class CreateFilterTypeRequest {\n @ApiProperty({ description: 'Identificativo del tipo di filtro.', example: 1, type: Number })\n @IsInt({ message: 'Il codice tipo filtro deve essere un intero.' })\n @Type(() => Number)\n tipFil!: number;\n\n @ApiPropertyOptional({ description: 'Descrizione del filtro.', example: 'Filtro standard', maxLength: 20 })\n @IsString({ message: 'La descrizione deve essere una stringa.' })\n @IsOptional()\n @MaxLength(20, { message: 'La descrizione non puo superare 20 caratteri.' })\n desFil?: string;\n\n @ApiPropertyOptional({ description: 'Campo associato al filtro.', example: 'CODCLI', maxLength: 20 })\n @IsString({ message: 'Il campo deve essere una stringa.' })\n @IsOptional()\n @MaxLength(20, { message: 'Il campo non puo superare 20 caratteri.' })\n fldFil?: string;\n\n @ApiPropertyOptional({ description: 'Filtro abilitato.', example: 1, enum: [0, 1], default: 1 })\n @IsIn([0, 1], { message: 'Il flag abilitato deve essere 0 o 1.' })\n @IsOptional()\n flgEnabled?: 0 | 1;\n}\n\nexport class UpdateFilterTypeRequest {\n @ApiPropertyOptional({ description: 'Descrizione del filtro.', example: 'Filtro standard', maxLength: 20 })\n @IsString({ message: 'La descrizione deve essere una stringa.' })\n @IsOptional()\n @MaxLength(20, { message: 'La descrizione non puo superare 20 caratteri.' })\n desFil?: string;\n\n @ApiPropertyOptional({ description: 'Campo associato al filtro.', example: 'CODCLI', maxLength: 20 })\n @IsString({ message: 'Il campo deve essere una stringa.' })\n @IsOptional()\n @MaxLength(20, { message: 'Il campo non puo superare 20 caratteri.' })\n fldFil?: string;\n\n @ApiPropertyOptional({ description: 'Filtro abilitato.', example: 1, enum: [0, 1], default: 1 })\n @IsIn([0, 1], { message: 'Il flag abilitato deve essere 0 o 1.' })\n @IsOptional()\n flgEnabled?: 0 | 1;\n}\n"]}
|
|
@@ -50,14 +50,6 @@ __decorate([
|
|
|
50
50
|
}),
|
|
51
51
|
__metadata("design:type", Boolean)
|
|
52
52
|
], GroupWithMenusEntity.prototype, "enabled", void 0);
|
|
53
|
-
__decorate([
|
|
54
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
55
|
-
description: "Colonna UTENTI_CONFIG che regola l'abilitazione del gruppo.",
|
|
56
|
-
type: String,
|
|
57
|
-
example: "FLGDIPENDENTI"
|
|
58
|
-
}),
|
|
59
|
-
__metadata("design:type", Object)
|
|
60
|
-
], GroupWithMenusEntity.prototype, "nomeCampo", void 0);
|
|
61
53
|
__decorate([
|
|
62
54
|
(0, swagger_1.ApiProperty)({
|
|
63
55
|
description: "Lista dei men�� associati al gruppo.",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GetGroupsWithMenusResponse.js","sourceRoot":"","sources":["../../../src/accessi-module/Dtos/GetGroupsWithMenusResponse.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmE;AACnE,iDAA8C;AAC9C,qDAA0D;AAC1D,yDAAyC;AACzC,yDAAgD;AAIhD,MAAa,oBAAoB;
|
|
1
|
+
{"version":3,"file":"GetGroupsWithMenusResponse.js","sourceRoot":"","sources":["../../../src/accessi-module/Dtos/GetGroupsWithMenusResponse.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmE;AACnE,iDAA8C;AAC9C,qDAA0D;AAC1D,yDAAyC;AACzC,yDAAgD;AAIhD,MAAa,oBAAoB;CAqChC;AArCD,oDAqCC;AA/BG;IALC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,4BAA4B;QACzC,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,OAAO;KACnB,CAAC;;0DACoB;AAOtB;IALC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,yBAAyB;QACtC,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,kBAAkB;KAC9B,CAAC;;+DACyB;AAO3B;IALC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,oBAAoB;QACjC,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,CAAC;KACb,CAAC;;0DACoB;AAOtB;IALC,IAAA,6BAAmB,EAAC;QACjB,WAAW,EAAE,2CAA2C;QACxD,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,IAAI;KAChB,CAAC;;qDACgB;AASlB;IAPC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,sCAAsC;QACnD,IAAI,EAAE,CAAC,6BAAU,CAAC;KACrB,CAAC;IACD,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,6BAAU,CAAC;IACtB,IAAA,yBAAO,GAAE;;mDACW;AAGzB,MAAa,0BAA2B,SAAQ,2BAAY;CAK3D;AALD,gEAKC;AADG;IAHC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,CAAC,oBAAoB,CAAC,EAAE,CAAC;IAC7C,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,oBAAoB,CAAC;;0DACD","sourcesContent":["import { ApiProperty, ApiPropertyOptional } from \"@nestjs/swagger\";\nimport { BaseResponse } from \"./BaseResponse\";\nimport { IsArray, ValidateNested } from \"class-validator\";\nimport { Type } from \"class-transformer\";\nimport { MenuEntity } from \"./GetMenusResponse\";\n\n\n\nexport class GroupWithMenusEntity {\n @ApiProperty({\n description: \"Codice univoco del gruppo.\",\n type: String,\n example: \"GRP01\"\n })\n codiceGruppo!: string;\n\n @ApiProperty({\n description: \"Descrizione del gruppo.\",\n type: String,\n example: \"Gestione Accessi\"\n })\n descrizioneGruppo!: string;\n\n @ApiProperty({\n description: \"Ordine del gruppo.\",\n type: Number,\n example: 1\n })\n ordineGruppo!: number;\n\n @ApiPropertyOptional({\n description: \"Flag che indica se il gruppo e abilitato.\",\n type: Boolean,\n example: true\n })\n enabled?: boolean;\n\n @ApiProperty({\n description: \"Lista dei men�� associati al gruppo.\",\n type: [MenuEntity]\n })\n @ValidateNested({ each: true })\n @Type(() => MenuEntity)\n @IsArray()\n menus!: MenuEntity[];\n}\n\nexport class GetGroupsWithMenusResponse extends BaseResponse {\n @ApiProperty({ type: [GroupWithMenusEntity] })\n @ValidateNested({ each: true })\n @Type(() => GroupWithMenusEntity)\n Result!: GroupWithMenusEntity[];\n}\n"]}
|
|
@@ -118,14 +118,6 @@ __decorate([
|
|
|
118
118
|
}),
|
|
119
119
|
__metadata("design:type", Object)
|
|
120
120
|
], MenuEntity.prototype, "note", void 0);
|
|
121
|
-
__decorate([
|
|
122
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
123
|
-
description: "Colonna UTENTI_CONFIG che regola l'abilitazione del gruppo del menu.",
|
|
124
|
-
type: String,
|
|
125
|
-
example: "FLGDIPENDENTI"
|
|
126
|
-
}),
|
|
127
|
-
__metadata("design:type", Object)
|
|
128
|
-
], MenuEntity.prototype, "nomeCampo", void 0);
|
|
129
121
|
class GetMenusResponse extends BaseResponse_1.BaseResponse {
|
|
130
122
|
}
|
|
131
123
|
exports.GetMenusResponse = GetMenusResponse;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GetMenusResponse.js","sourceRoot":"","sources":["../../../src/accessi-module/Dtos/GetMenusResponse.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmE;AACnE,iDAA8C;AAC9C,qDAAiD;AACjD,yDAAyC;AAMzC,MAAa,UAAU;
|
|
1
|
+
{"version":3,"file":"GetMenusResponse.js","sourceRoot":"","sources":["../../../src/accessi-module/Dtos/GetMenusResponse.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmE;AACnE,iDAA8C;AAC9C,qDAAiD;AACjD,yDAAyC;AAMzC,MAAa,UAAU;CA4FtB;AA5FD,gCA4FC;AArFG;IALC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,0BAA0B;QACvC,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,QAAQ;KACpB,CAAC;;8CACkB;AAOpB;IALC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,uBAAuB;QACpC,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,iBAAiB;KAC7B,CAAC;;mDACuB;AAQzB;IANC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,6CAA6C;QAC1D,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,OAAO;QAChB,QAAQ,EAAE,KAAK;KAClB,CAAC;;gDACoB;AAQtB;IANC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,kDAAkD;QAC/D,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,kBAAkB;QAC3B,QAAQ,EAAE,KAAK;KAClB,CAAC;;qDACyB;AAQ3B;IANC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,wCAAwC;QACrD,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,UAAU;QACnB,QAAQ,EAAE,KAAK;KAClB,CAAC;;yCACa;AAQf;IANC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,eAAe;QAC5B,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,OAAO;QAChB,QAAQ,EAAE,KAAK;KAClB,CAAC;;wCACY;AAQd;IANC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,0CAA0C;QACvD,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,0BAA0B;QACnC,QAAQ,EAAE,KAAK;KAClB,CAAC;;0CACc;AAQhB;IALC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,kBAAkB;QAC/B,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,CAAC;KACb,CAAC;;8CACkB;AAQpB;IALC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,oBAAoB;QACjC,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,CAAC;KACb,CAAC;;gDACoB;AAOtB;IALC,IAAA,6BAAmB,EAAC;QACjB,WAAW,EAAE,yCAAyC;QACtD,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,IAAI;KAChB,CAAC;;2CACgB;AAOlB;IALC,IAAA,6BAAmB,EAAC;QACjB,WAAW,EAAE,6BAA6B;QAC1C,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,CAAC;KACb,CAAC;;oDACwB;AAO1B;IALC,IAAA,6BAAmB,EAAC;QACjB,WAAW,EAAE,qCAAqC;QAClD,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,mCAAmC;KAC/C,CAAC;;wCACmB;AAGzB,MAAa,gBAAiB,SAAQ,2BAAY;CAKjD;AALD,4CAKC;AADG;IAHC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC;IACnC,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,UAAU,CAAC;;gDACD","sourcesContent":["import { ApiProperty, ApiPropertyOptional } from \"@nestjs/swagger\";\nimport { BaseResponse } from \"./BaseResponse\";\nimport { ValidateNested } from \"class-validator\";\nimport { Type } from \"class-transformer\";\n\n\n\n\n\nexport class MenuEntity {\n\n @ApiProperty({\n description: \"Codice univoco del menù.\",\n type: String,\n example: \"MNU001\"\n })\n codiceMenu!: string;\n\n @ApiProperty({\n description: \"Descrizione del menù.\",\n type: String,\n example: \"Gestione Utenti\"\n })\n descrizioneMenu!: string;\n\n @ApiProperty({\n description: \"Codice del gruppo a cui appartiene il menù.\",\n type: String,\n example: \"GRP01\",\n required: false\n })\n codiceGruppo?: string;\n\n @ApiProperty({\n description: \"Descrizione del gruppo a cui appartiene il menù.\",\n type: String,\n example: \"Gestione Accessi\",\n required: false\n })\n descrizioneGruppo?: string;\n\n @ApiProperty({\n description: \"Percorso dell'icona associata al menù.\",\n type: String,\n example: \"fa-users\",\n required: false\n })\n icona?: string;\n\n @ApiProperty({\n description: \"Tipo di menù.\",\n type: String,\n example: \"admin\",\n required: false\n })\n tipo?: string;\n\n @ApiProperty({\n description: \"Percorso della pagina associata al menù.\",\n type: String,\n example: \"/accessi/gestione-utenti\",\n required: false\n })\n pagina?: string;\n\n\n @ApiProperty({\n description: \"Ordine del menu.\",\n type: Number,\n example: 1\n })\n ordineMenu!: number;\n\n\n @ApiProperty({\n description: \"Ordine del gruppo.\",\n type: Number,\n example: 1\n })\n ordineGruppo!: number;\n\n @ApiPropertyOptional({\n description: \"Flag che indica se il menu e abilitato.\",\n type: Boolean,\n example: true\n })\n enabled?: boolean;\n\n @ApiPropertyOptional({\n description: \"Tipo abilitazione opzionale\",\n type: Number,\n example: 1\n })\n tipoAbilitazione?: number;\n\n @ApiPropertyOptional({\n description: \"Nota informativa associata al menu.\",\n type: String,\n example: \"Visibile solo agli amministratori\"\n })\n note?: string | null;\n}\n\nexport class GetMenusResponse extends BaseResponse {\n @ApiProperty({ type: [MenuEntity] })\n @ValidateNested({ each: true })\n @Type(() => MenuEntity)\n Result!: MenuEntity[];\n}\n"]}
|
|
@@ -120,15 +120,6 @@ __decorate([
|
|
|
120
120
|
(0, class_transformer_1.Transform)(({ obj, key }) => obj[key]),
|
|
121
121
|
__metadata("design:type", Boolean)
|
|
122
122
|
], RegisterRequest.prototype, "flagDueFattori", void 0);
|
|
123
|
-
__decorate([
|
|
124
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
125
|
-
description: "Pagina di default dell'utente.",
|
|
126
|
-
example: "/dashboard",
|
|
127
|
-
}),
|
|
128
|
-
(0, class_validator_1.IsOptional)(),
|
|
129
|
-
(0, class_validator_1.IsString)({ message: "La pagina di default deve essere una stringa." }),
|
|
130
|
-
__metadata("design:type", String)
|
|
131
|
-
], RegisterRequest.prototype, "paginaDefault", void 0);
|
|
132
123
|
__decorate([
|
|
133
124
|
(0, swagger_1.ApiPropertyOptional)({
|
|
134
125
|
description: "HTML mail personalizzato",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RegisterRequest.js","sourceRoot":"","sources":["../../../src/accessi-module/Dtos/RegisterRequest.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA6E;AAC7E,yDAAoD;AACpD,qDASyB;AACzB,6CAA0C;AAC1C,yDAAsD;AACtD,iDAA8C;AAE9C,MAAa,eAAgB,SAAQ,IAAA,kBAAQ,EAAC,2BAAY,EAAE,CAAC,QAAQ,CAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"RegisterRequest.js","sourceRoot":"","sources":["../../../src/accessi-module/Dtos/RegisterRequest.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA6E;AAC7E,yDAAoD;AACpD,qDASyB;AACzB,6CAA0C;AAC1C,yDAAsD;AACtD,iDAA8C;AAE9C,MAAa,eAAgB,SAAQ,IAAA,kBAAQ,EAAC,2BAAY,EAAE,CAAC,QAAQ,CAAU,CAAC;CAmG/E;AAnGD,0CAmGC;AA5FC;IANC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,oBAAoB;QACjC,OAAO,EAAE,oBAAoB;KAC9B,CAAC;IACD,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,kCAAkC,EAAE,CAAC;IACzD,IAAA,wBAAM,EAAC,CAAC,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,qDAAqD,EAAE,CAAC;;8CACpE;AASf;IAPC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,sBAAsB;QACnC,OAAO,EAAE,OAAO;KACjB,CAAC;IACD,IAAA,4B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E,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;;uDACb;AAQzB;IANC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,0BAA0B;QACvC,OAAO,EAAE,eAAe;KACzB,CAAC;IACD,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,4CAA4C,EAAE,CAAC;;iDAClD","sourcesContent":["import { ApiProperty, ApiPropertyOptional, OmitType } from \"@nestjs/swagger\";\nimport { Transform, Type } from \"class-transformer\";\nimport {\n ArrayUnique,\n IsArray,\n IsBoolean,\n IsInt,\n IsOptional,\n IsString,\n Length,\n ValidateNested,\n} from \"class-validator\";\nimport { Permission } from \"./Permission\";\nimport { TipoAbilitazione } from \"./TipoAbilitazione\";\nimport { FiltriUtente } from \"./FiltriUtente\";\n\nexport class RegisterRequest extends OmitType(FiltriUtente, ['codUte'] as const) {\n @ApiProperty({\n description: \"Email dell'utente.\",\n example: \"mario.rossi@dev.it\",\n })\n @IsString({ message: \"L'email deve essere una stringa.\" })\n @Length(3, 254, { message: \"L'email deve essere compresa tra 3 e 254 caratteri.\" })\n email!: string;\n\n @ApiPropertyOptional({\n description: \"Cognome dell'utente.\",\n example: \"Rossi\",\n })\n @IsOptional()\n @IsString({ message: \"Il cognome deve essere una stringa.\" })\n @Length(1, 255, { message: \"Il cognome deve essere compreso tra 1 e 255 caratteri.\" })\n cognome?: string;\n\n @ApiPropertyOptional({ description: \"Nome dell'utente.\", example: \"Mario\" })\n @IsOptional()\n @IsString({ message: \"Il nome deve essere una stringa.\" })\n @Length(1, 255, { message: \"Il nome deve essere compreso tra 1 e 255 caratteri.\" })\n nome?: string;\n\n @ApiPropertyOptional({\n description: \"Numero di cellulare.\",\n type: String,\n example: \"+393401234567\",\n nullable: true,\n })\n @IsOptional()\n @IsString({ message: \"Il cellulare deve essere una stringa.\" })\n @Length(1, 50, { message: \"Il cellulare deve essere compreso tra 1 e 50 caratteri.\" })\n cellulare?: string | null;\n\n @ApiPropertyOptional({ description: \"Flag superutente.\", example: false })\n @IsOptional()\n @IsBoolean({ message: \"Il flag superutente deve essere booleano.\" })\n flagSuper?: boolean;\n\n @ApiPropertyOptional({\n description: \"Flag che indica se l'utente è configuratore\",\n example: false,\n })\n @IsOptional()\n @IsBoolean({ message: \"Il flag configuratore deve essere booleano.\" })\n flagAdmin?: boolean;\n\n @ApiPropertyOptional({\n description: \"Ruoli assegnati all'utente.\",\n example: [1, 2],\n })\n @IsOptional()\n @IsArray({ message: \"I ruoli devono essere un array.\" })\n @ArrayUnique({ message: \"I ruoli non possono contenere duplicati.\" })\n @Type(() => Number)\n @IsInt({ each: true, message: \"Ogni ruolo deve essere un intero.\" })\n roles?: number[];\n\n @ApiPropertyOptional({\n description: \"Permessi assegnati all'utente.\",\n type: [Permission],\n example: [\n {\n codiceMenu: \"MNUOFFICINA\",\n tipoAbilitazione: TipoAbilitazione.SCRITTURA,\n },\n ],\n })\n @IsOptional()\n @IsArray({ message: \"I permessi devono essere un array.\" })\n @ValidateNested({ each: true })\n @Type(() => Permission)\n permissions?: Permission[];\n\n @ApiPropertyOptional({\n description: \"Avatar dell'utente.\",\n example: \"user.svg\",\n })\n @IsOptional()\n @IsString({ message: \"L'avatar deve essere una stringa.\" })\n avatar?: string;\n\n @ApiPropertyOptional({\n description: \"Flag autenticazione a due fattori.\",\n example: false,\n })\n @IsOptional()\n @IsBoolean({ message: \"Il flag due fattori deve essere booleano.\" })\n @Transform(({ obj, key }) => obj[key])\n flagDueFattori?: boolean;\n\n @ApiPropertyOptional({\n description: \"HTML mail personalizzato\",\n example: \"<html></html>\",\n })\n @IsOptional()\n @IsString({ message: \"L'HTML della mail deve essere una stringa.\" })\n htmlMail?: string;\n}\n"]}
|
|
@@ -27,9 +27,7 @@ export declare class UserDto extends UserDto_base {
|
|
|
27
27
|
flagSuper?: boolean;
|
|
28
28
|
flagAdmin?: boolean;
|
|
29
29
|
passwordLoginEnabled?: boolean;
|
|
30
|
-
paginaDefault?: string;
|
|
31
30
|
jsonMetadata?: string;
|
|
32
|
-
enableIa?: boolean;
|
|
33
31
|
roles?: number[];
|
|
34
32
|
permissions?: Permission[];
|
|
35
33
|
}
|
|
@@ -190,15 +190,6 @@ __decorate([
|
|
|
190
190
|
(0, class_validator_1.IsBoolean)({ message: 'Il flag login password deve essere booleano.' }),
|
|
191
191
|
__metadata("design:type", Boolean)
|
|
192
192
|
], UserDto.prototype, "passwordLoginEnabled", void 0);
|
|
193
|
-
__decorate([
|
|
194
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
195
|
-
description: "Pagina di default dell'utente all'accesso.",
|
|
196
|
-
example: '/dashboard',
|
|
197
|
-
}),
|
|
198
|
-
(0, class_validator_1.IsOptional)(),
|
|
199
|
-
(0, class_validator_1.IsString)({ message: 'La pagina di default deve essere una stringa.' }),
|
|
200
|
-
__metadata("design:type", String)
|
|
201
|
-
], UserDto.prototype, "paginaDefault", void 0);
|
|
202
193
|
__decorate([
|
|
203
194
|
(0, swagger_1.ApiPropertyOptional)({
|
|
204
195
|
description: 'Metadata JSON personalizzato.',
|
|
@@ -208,13 +199,6 @@ __decorate([
|
|
|
208
199
|
(0, class_validator_1.IsString)({ message: 'I metadata JSON devono essere una stringa.' }),
|
|
209
200
|
__metadata("design:type", String)
|
|
210
201
|
], UserDto.prototype, "jsonMetadata", void 0);
|
|
211
|
-
__decorate([
|
|
212
|
-
(0, swagger_1.ApiPropertyOptional)({ description: 'Abilita l\'utente all\'uso dell\'assistente IA.', default: false }),
|
|
213
|
-
(0, class_validator_1.IsOptional)(),
|
|
214
|
-
(0, class_validator_1.IsBoolean)({ message: 'Il flag IA deve essere booleano.' }),
|
|
215
|
-
(0, class_transformer_1.Transform)(({ obj, key }) => obj[key]),
|
|
216
|
-
__metadata("design:type", Boolean)
|
|
217
|
-
], UserDto.prototype, "enableIa", void 0);
|
|
218
202
|
__decorate([
|
|
219
203
|
(0, swagger_1.ApiPropertyOptional)({ description: "Ruoli assegnati all'utente.", example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EAAE,OAAO,EAAE,mCAAmC,EAAE,CAAC;;sCACnD;AAWjB;IATC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,gCAAgC;QAC7C,IAAI,EAAE,CAAC,uBAAU,CAAC;QAClB,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,gBAAgB,EAAE,mCAAgB,CAAC,SAAS,EAAE,CAAC;KACvF,CAAC;IACD,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,EAAC,EAAE,OAAO,EAAE,oCAAoC,EAAE,CAAC;IAC1D,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,uBAAU,CAAC;;4CACI","sourcesContent":["import { ApiProperty, ApiPropertyOptional, OmitType } from '@nestjs/swagger';\nimport { Transform, Type } from 'class-transformer';\nimport {\n ArrayUnique,\n IsArray,\n IsBoolean,\n IsEnum,\n IsInt,\n IsOptional,\n IsString,\n Length,\n Min,\n ValidateNested,\n} from 'class-validator';\nimport { StatoRegistrazione } from './StatoRegistrazione';\nimport { Permission } from './Permission';\nimport { TipoAbilitazione } from './TipoAbilitazione';\nimport { FiltriUtente } from './FiltriUtente';\n\n/**\n * Profilo Accessi con dati anagrafici, policy di accesso e filtri legacy.\n * I campi amministrativi (`flagSuper`, `flagAdmin`, ruoli, grant e policy password) devono essere\n * accettati soltanto da endpoint e flussi backend esplicitamente privilegiati.\n */\nexport class UserDto extends OmitType(FiltriUtente, ['codUte'] as const) {\n @ApiProperty({ description: \"Codice identificativo univoco dell'utente.\", example: 123 })\n @IsOptional()\n @Type(() => Number)\n @IsInt({ message: 'Il codice utente deve essere un intero.' })\n @Min(1, { message: 'Il codice utente deve essere maggiore di zero.' })\n codiceUtente!: number;\n\n @ApiProperty({ description: \"Email dell'utente.\", example: 'mario.rossi@dev.it' })\n @IsOptional()\n @IsString({ message: \"L'email deve essere una stringa.\" })\n @Length(3, 254, { message: \"L'email deve essere compresa tra 3 e 254 caratteri.\" })\n email!: string;\n\n @ApiPropertyOptional({ description: \"Flag per l'accettazione del GDPR.\", example: true })\n @IsOptional()\n @IsBoolean({ message: 'Il flag GDPR deve essere booleano.' })\n flagGdpr?: boolean;\n\n @ApiPropertyOptional({\n description: 'Data di accettazione del GDPR.',\n format: 'date-time',\n example: '2024-03-18T12:34:56Z',\n })\n @IsOptional()\n @IsString({ message: 'La data GDPR deve essere una stringa.' })\n dataGdpr?: string;\n\n @ApiPropertyOptional({\n description: \"Data di inserimento dell'utente nel sistema.\",\n format: 'date-time',\n example: '2023-01-01T08:30:00Z',\n })\n @IsOptional()\n @IsString({ message: 'La data di inserimento deve essere una stringa.' })\n dataInserimento?: string;\n\n @ApiPropertyOptional({\n description: 'Data scadenza password.',\n format: 'date-time',\n example: '2025-06-01',\n })\n @IsOptional()\n @IsString({ message: 'La data scadenza password deve essere una stringa.' })\n dataScadenzaPassword?: string;\n\n @ApiPropertyOptional({\n description: \"Ultima data di accesso dell'utente.\",\n format: 'date-time',\n example: '2024-03-15T14:45:00Z',\n })\n @IsOptional()\n @IsString({ message: 'La data ultimo accesso deve essere una stringa.' })\n dataLastLogin?: string;\n\n @ApiPropertyOptional({\n description: \"Stato della registrazione dell'utente.\",\n enum: StatoRegistrazione,\n example: StatoRegistrazione.CONF,\n })\n @IsOptional()\n @IsEnum(StatoRegistrazione, { message: 'Lo stato di registrazione non e valido.' })\n statoRegistrazione?: StatoRegistrazione;\n\n @ApiPropertyOptional({\n description: \"Chiave di registrazione dell'utente.\",\n example: 'abc123xyz',\n })\n @IsOptional()\n @IsString({ message: 'La chiave registrazione deve essere una stringa.' })\n keyRegistrazione?: string;\n\n @ApiPropertyOptional({ description: \"Cognome dell'utente.\", example: 'Rossi' })\n @IsOptional()\n @IsString({ message: 'Il cognome deve essere una stringa.' })\n @Length(1, 255, { message: 'Il cognome deve essere compreso tra 1 e 255 caratteri.' })\n cognome?: string;\n\n @ApiPropertyOptional({ description: \"Nome dell'utente.\", example: 'Mario' })\n @IsOptional()\n @IsString({ message: 'Il nome deve essere una stringa.' })\n @Length(1, 255, { message: 'Il nome deve essere compreso tra 1 e 255 caratteri.' })\n nome?: string;\n\n @ApiPropertyOptional({\n description: 'Avatar (URL o base64).',\n type: String,\n example: 'https://example.com/avatar.jpg',\n nullable: true,\n })\n @IsOptional()\n @IsString({ message: \"L'avatar deve essere una stringa.\" })\n avatar?: string | null;\n\n @ApiPropertyOptional({\n description: \"Flag che indica se l'autenticazione a due fattori è attivata.\",\n example: true,\n })\n @IsOptional()\n @IsBoolean({ message: 'Il flag due fattori deve essere booleano.' })\n @Transform(({ obj, key }) => obj[key])\n flagDueFattori?: boolean;\n\n @ApiPropertyOptional({ description: 'Consente accesso con il solo codice email. Richiede flagDueFattori e viene gestito dagli amministratori.', default: false })\n @IsOptional()\n @IsBoolean()\n @Transform(({ obj, key }) => obj[key])\n passwordlessLoginEnabled?: boolean;\n\n @ApiPropertyOptional({ description: 'Codice lingua preferito.', example: 'it' })\n @IsOptional()\n @IsString({ message: 'Il codice lingua deve essere una stringa.' })\n @Length(1, 20, { message: 'Il codice lingua deve essere compreso tra 1 e 20 caratteri.' })\n codiceLingua?: string;\n\n @ApiPropertyOptional({\n description: 'Numero di cellulare.',\n type: String,\n example: '+393401234567',\n nullable: true,\n })\n @IsOptional()\n @IsString({ message: 'Il cellulare deve essere una stringa.' })\n @Length(1, 50, { message: 'Il cellulare deve essere compreso tra 1 e 50 caratteri.' })\n cellulare?: string | null;\n\n @ApiPropertyOptional({ description: 'Flag superutente.', example: false })\n @IsOptional()\n @IsBoolean({ message: 'Il flag superutente deve essere booleano.' })\n flagSuper?: boolean;\n\n @ApiPropertyOptional({\n description: \"Flag che indica se l'utente è configuratore\",\n example: false,\n })\n @IsOptional()\n @IsBoolean({ message: 'Il flag configuratore deve essere booleano.' })\n flagAdmin?: boolean;\n\n @ApiPropertyOptional({\n description: 'Abilita il login locale con password. Se false, l utente puo autenticarsi solo tramite identita SSO attive.',\n example: false,\n })\n @IsOptional()\n @IsBoolean({ message: 'Il flag login password deve essere booleano.' })\n passwordLoginEnabled?: boolean;\n\n @ApiPropertyOptional({\n description: \"Pagina di default dell'utente all'accesso.\",\n example: '/dashboard',\n })\n @IsOptional()\n @IsString({ message: 'La pagina di default deve essere una stringa.' })\n paginaDefault?: string;\n\n @ApiPropertyOptional({\n description: 'Metadata JSON personalizzato.',\n example: '{\"theme\": \"dark\"}',\n })\n @IsOptional()\n @IsString({ message: 'I metadata JSON devono essere una stringa.' })\n jsonMetadata?: string;\n\n @ApiPropertyOptional({ description: 'Abilita l\\'utente all\\'uso dell\\'assistente IA.', default: false })\n @IsOptional()\n @IsBoolean({ message: 'Il flag IA deve essere booleano.' })\n @Transform(({ obj, key }) => obj[key])\n enableIa?: boolean;\n\n @ApiPropertyOptional({ description: \"Ruoli assegnati all'utente.\", example: [1, 2] })\n @IsOptional()\n @IsArray({ message: 'I ruoli devono essere un array.' })\n @ArrayUnique({ message: 'I ruoli non possono contenere duplicati.' })\n @Type(() => Number)\n @IsInt({ each: true, message: 'Ogni ruolo deve essere un intero.' })\n roles?: number[];\n\n @ApiPropertyOptional({\n description: \"Permessi assegnati all'utente.\",\n type: [Permission],\n example: [{ codiceMenu: 'MNUOFFICINA', tipoAbilitazione: TipoAbilitazione.SCRITTURA }],\n })\n @IsOptional()\n @IsArray({ message: 'I permessi devono essere un array.' })\n @ValidateNested({ each: true })\n @Type(() => Permission)\n permissions?: Permission[];\n}\n"]}
|
|
1
|
+
{"version":3,"file":"UserDto.js","sourceRoot":"","sources":["../../../src/accessi-module/Dtos/UserDto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA6E;AAC7E,yDAAoD;AACpD,qDAWyB;AACzB,6DAA0D;AAC1D,6CAA0C;AAC1C,yDAAsD;AACtD,iDAA8C;AAE9C;;;;GAIG;AACH,MAAa,OAAQ,SAAQ,IAAA,kBAAQ,EAAC,2BAAY,EAAE,CAAC,QAAQ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;IANC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,6BAA6B,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;IACpF,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,EAAC,EAAE,OAAO,EAAE,iCAAiC,EAAE,CAAC;IACvD,IAAA,6BAAW,EAAC,EAAE,OAAO,EAAE,0CAA0C,EAAE,CAAC;IACpE,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IAClB,IAAA,uBAAK,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,mCAAmC,EAAE,CAAC;;sCACnD;AAWjB;IATC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,gCAAgC;QAC7C,IAAI,EAAE,CAAC,uBAAU,CAAC;QAClB,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,gBAAgB,EAAE,mCAAgB,CAAC,SAAS,EAAE,CAAC;KACvF,CAAC;IACD,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,EAAC,EAAE,OAAO,EAAE,oCAAoC,EAAE,CAAC;IAC1D,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,uBAAU,CAAC;;4CACI","sourcesContent":["import { ApiProperty, ApiPropertyOptional, OmitType } from '@nestjs/swagger';\nimport { Transform, Type } from 'class-transformer';\nimport {\n ArrayUnique,\n IsArray,\n IsBoolean,\n IsEnum,\n IsInt,\n IsOptional,\n IsString,\n Length,\n Min,\n ValidateNested,\n} from 'class-validator';\nimport { StatoRegistrazione } from './StatoRegistrazione';\nimport { Permission } from './Permission';\nimport { TipoAbilitazione } from './TipoAbilitazione';\nimport { FiltriUtente } from './FiltriUtente';\n\n/**\n * Profilo Accessi con dati anagrafici, policy di accesso e filtri legacy.\n * I campi amministrativi (`flagSuper`, `flagAdmin`, ruoli, grant e policy password) devono essere\n * accettati soltanto da endpoint e flussi backend esplicitamente privilegiati.\n */\nexport class UserDto extends OmitType(FiltriUtente, ['codUte'] as const) {\n @ApiProperty({ description: \"Codice identificativo univoco dell'utente.\", example: 123 })\n @IsOptional()\n @Type(() => Number)\n @IsInt({ message: 'Il codice utente deve essere un intero.' })\n @Min(1, { message: 'Il codice utente deve essere maggiore di zero.' })\n codiceUtente!: number;\n\n @ApiProperty({ description: \"Email dell'utente.\", example: 'mario.rossi@dev.it' })\n @IsOptional()\n @IsString({ message: \"L'email deve essere una stringa.\" })\n @Length(3, 254, { message: \"L'email deve essere compresa tra 3 e 254 caratteri.\" })\n email!: string;\n\n @ApiPropertyOptional({ description: \"Flag per l'accettazione del GDPR.\", example: true })\n @IsOptional()\n @IsBoolean({ message: 'Il flag GDPR deve essere booleano.' })\n flagGdpr?: boolean;\n\n @ApiPropertyOptional({\n description: 'Data di accettazione del GDPR.',\n format: 'date-time',\n example: '2024-03-18T12:34:56Z',\n })\n @IsOptional()\n @IsString({ message: 'La data GDPR deve essere una stringa.' })\n dataGdpr?: string;\n\n @ApiPropertyOptional({\n description: \"Data di inserimento dell'utente nel sistema.\",\n format: 'date-time',\n example: '2023-01-01T08:30:00Z',\n })\n @IsOptional()\n @IsString({ message: 'La data di inserimento deve essere una stringa.' })\n dataInserimento?: string;\n\n @ApiPropertyOptional({\n description: 'Data scadenza password.',\n format: 'date-time',\n example: '2025-06-01',\n })\n @IsOptional()\n @IsString({ message: 'La data scadenza password deve essere una stringa.' })\n dataScadenzaPassword?: string;\n\n @ApiPropertyOptional({\n description: \"Ultima data di accesso dell'utente.\",\n format: 'date-time',\n example: '2024-03-15T14:45:00Z',\n })\n @IsOptional()\n @IsString({ message: 'La data ultimo accesso deve essere una stringa.' })\n dataLastLogin?: string;\n\n @ApiPropertyOptional({\n description: \"Stato della registrazione dell'utente.\",\n enum: StatoRegistrazione,\n example: StatoRegistrazione.CONF,\n })\n @IsOptional()\n @IsEnum(StatoRegistrazione, { message: 'Lo stato di registrazione non e valido.' })\n statoRegistrazione?: StatoRegistrazione;\n\n @ApiPropertyOptional({\n description: \"Chiave di registrazione dell'utente.\",\n example: 'abc123xyz',\n })\n @IsOptional()\n @IsString({ message: 'La chiave registrazione deve essere una stringa.' })\n keyRegistrazione?: string;\n\n @ApiPropertyOptional({ description: \"Cognome dell'utente.\", example: 'Rossi' })\n @IsOptional()\n @IsString({ message: 'Il cognome deve essere una stringa.' })\n @Length(1, 255, { message: 'Il cognome deve essere compreso tra 1 e 255 caratteri.' })\n cognome?: string;\n\n @ApiPropertyOptional({ description: \"Nome dell'utente.\", example: 'Mario' })\n @IsOptional()\n @IsString({ message: 'Il nome deve essere una stringa.' })\n @Length(1, 255, { message: 'Il nome deve essere compreso tra 1 e 255 caratteri.' })\n nome?: string;\n\n @ApiPropertyOptional({\n description: 'Avatar (URL o base64).',\n type: String,\n example: 'https://example.com/avatar.jpg',\n nullable: true,\n })\n @IsOptional()\n @IsString({ message: \"L'avatar deve essere una stringa.\" })\n avatar?: string | null;\n\n @ApiPropertyOptional({\n description: \"Flag che indica se l'autenticazione a due fattori è attivata.\",\n example: true,\n })\n @IsOptional()\n @IsBoolean({ message: 'Il flag due fattori deve essere booleano.' })\n @Transform(({ obj, key }) => obj[key])\n flagDueFattori?: boolean;\n\n @ApiPropertyOptional({ description: 'Consente accesso con il solo codice email. Richiede flagDueFattori e viene gestito dagli amministratori.', default: false })\n @IsOptional()\n @IsBoolean()\n @Transform(({ obj, key }) => obj[key])\n passwordlessLoginEnabled?: boolean;\n\n @ApiPropertyOptional({ description: 'Codice lingua preferito.', example: 'it' })\n @IsOptional()\n @IsString({ message: 'Il codice lingua deve essere una stringa.' })\n @Length(1, 20, { message: 'Il codice lingua deve essere compreso tra 1 e 20 caratteri.' })\n codiceLingua?: string;\n\n @ApiPropertyOptional({\n description: 'Numero di cellulare.',\n type: String,\n example: '+393401234567',\n nullable: true,\n })\n @IsOptional()\n @IsString({ message: 'Il cellulare deve essere una stringa.' })\n @Length(1, 50, { message: 'Il cellulare deve essere compreso tra 1 e 50 caratteri.' })\n cellulare?: string | null;\n\n @ApiPropertyOptional({ description: 'Flag superutente.', example: false })\n @IsOptional()\n @IsBoolean({ message: 'Il flag superutente deve essere booleano.' })\n flagSuper?: boolean;\n\n @ApiPropertyOptional({\n description: \"Flag che indica se l'utente è configuratore\",\n example: false,\n })\n @IsOptional()\n @IsBoolean({ message: 'Il flag configuratore deve essere booleano.' })\n flagAdmin?: boolean;\n\n @ApiPropertyOptional({\n description: 'Abilita il login locale con password. Se false, l utente puo autenticarsi solo tramite identita SSO attive.',\n example: false,\n })\n @IsOptional()\n @IsBoolean({ message: 'Il flag login password deve essere booleano.' })\n passwordLoginEnabled?: boolean;\n\n @ApiPropertyOptional({\n description: 'Metadata JSON personalizzato.',\n example: '{\"theme\": \"dark\"}',\n })\n @IsOptional()\n @IsString({ message: 'I metadata JSON devono essere una stringa.' })\n jsonMetadata?: string;\n\n @ApiPropertyOptional({ description: \"Ruoli assegnati all'utente.\", example: [1, 2] })\n @IsOptional()\n @IsArray({ message: 'I ruoli devono essere un array.' })\n @ArrayUnique({ message: 'I ruoli non possono contenere duplicati.' })\n @Type(() => Number)\n @IsInt({ each: true, message: 'Ogni ruolo deve essere un intero.' })\n roles?: number[];\n\n @ApiPropertyOptional({\n description: \"Permessi assegnati all'utente.\",\n type: [Permission],\n example: [{ codiceMenu: 'MNUOFFICINA', tipoAbilitazione: TipoAbilitazione.SCRITTURA }],\n })\n @IsOptional()\n @IsArray({ message: 'I permessi devono essere un array.' })\n @ValidateNested({ each: true })\n @Type(() => Permission)\n permissions?: Permission[];\n}\n"]}
|
|
@@ -391,7 +391,6 @@ let AuthService = AuthService_1 = class AuthService {
|
|
|
391
391
|
codiceLingua: "IT",
|
|
392
392
|
cellulare: "+391234567890",
|
|
393
393
|
flagSuper: true,
|
|
394
|
-
paginaDefault: "/home",
|
|
395
394
|
roles: [],
|
|
396
395
|
permissions: [],
|
|
397
396
|
},
|
|
@@ -419,7 +418,6 @@ let AuthService = AuthService_1 = class AuthService {
|
|
|
419
418
|
codiceLingua: "IT",
|
|
420
419
|
cellulare: "+391234567890",
|
|
421
420
|
flagSuper: false,
|
|
422
|
-
paginaDefault: "/home",
|
|
423
421
|
roles: [],
|
|
424
422
|
permissions: [],
|
|
425
423
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthService.js","sourceRoot":"","sources":["../../../../src/accessi-module/Services/AuthService/AuthService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA2E;AAC3E,2EAAwF;AACxF,kDAAoC;AACpC,sCAAmC;AACnC,kDAAsF;AAItF,sEAAmE;AACnE,4DAAyD;AACzD,kEAA+D;AAC/D,0EAK2C;AAC3C,0EAG2C;AAC3C,4CAAyC;AAGzC,8EAA8E;AACjE,QAAA,uBAAuB,GAAG,yBAAyB,CAAC;AAG1D,IAAM,WAAW,mBAAjB,MAAM,WAAW;IAGtB,YACU,WAAwB,EACxB,aAA4B,EACT,cAA+C,EACzD,gBAAkC;QAH3C,gBAAW,GAAX,WAAW,CAAa;QACxB,kBAAa,GAAb,aAAa,CAAe;QACQ,mBAAc,GAAd,cAAc,CAAgB;QACzD,qBAAgB,GAAhB,gBAAgB,CAAkB;QANpC,WAAM,GAAG,IAAI,eAAM,CAAC,aAAW,CAAC,IAAI,CAAC,CAAC;IAOpD,CAAC;IAEU,yBAAyB,CAAC,YAAoB;;YAC1D,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,kBAAkB,EAAE,CAAC;gBAC5C,OAAO;YACT,CAAC;YAED,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;YAC1E,MAAM,cAAc,GAClB,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,cAAc,GAAG,CAAC;gBACnD,CAAC,CA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MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,MAAM,mCAAI,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,MAAM,CAAC,KAAK,YAAY,EAAE,CAAC;wBACxD,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;oBAC3E,CAAC;oBAED,MAAM,SAAG,CAAC,gBAAgB,CACxB,WAAW,EACX,gFAAgF,EAChF,CAAC,YAAY,EAAE,cAAc,CAAC,CAC/B,CAAC;oBAEF,IAAI,IAAI,CAAC,cAAc,CAAC,kBAAkB,EAAE,CAAC;wBAC3C,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;wBAChE,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;wBACjF,MAAM,SAAG,CAAC,gBAAgB,CACxB,WAAW,EACX,yCAAyC,cAAc,6CAA6C,EACpG,CAAC,YAAY,CAAC,CACf,CAAC;oBACJ,CAAC;gBACH,CAAC,CAAA,CAAC,CAAC;YACL,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;KAAA;CACF,CAAA;AAzfY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;IAOR,WAAA,IAAA,eAAM,EAAC,iBAAiB,CAAC,CAAA;qCAFL,yBAAW;QACT,6BAAa,UAED,mCAAgB;GAP1C,WAAW,CAyfvB","sourcesContent":["import { Inject, Injectable, UnauthorizedException } from \"@nestjs/common\";\nimport { TwoFactorService, TwoFactorProof } from '../TwoFactorService/TwoFactorService';\nimport * as jwt from \"jsonwebtoken\";\nimport { Orm } from \"../../../Orm\";\nimport { CryptUtilities, PasswordUtilities, RestUtilities } from \"../../../Utilities\";\nimport type { AccessiOptions } from \"../../AccessiModule\";\nimport { LoginRequest } from \"../../Dtos/LoginRequest\";\nimport { LoginResult } from \"../../Dtos/LoginResponse\";\nimport { StatoRegistrazione } from \"../../Dtos/StatoRegistrazione\";\nimport { UserService } from \"../UserService/UserService\";\nimport { FiltriService } from \"../FiltriService/FiltriService\";\nimport {\n buildAuthenticatedTokenPayload,\n isAuthenticatedUserEnabledForJwt,\n isAccessiTokenAllowedForUser,\n resolveCodiceUtenteFromTokenPayload,\n} from \"../../security/authenticatedToken\";\nimport {\n getAccessiJwtSecret,\n verifyPasswordResetToken,\n} from \"../../security/passwordResetToken\";\nimport { Logger } from \"../../../Logger\";\nimport { TokenResult } from '../../Dtos/TokenResult';\n\n/** Error code deliberately returned when a user is configured as SSO-only. */\nexport const PASSWORD_LOGIN_DISABLED = 'PASSWORD_LOGIN_DISABLED';\n\n@Injectable()\nexport class AuthService {\n private readonly logger = new Logger(AuthService.name);\n\n constructor(\n private userService: UserService,\n private filtriService: FiltriService,\n @Inject(\"ACCESSI_OPTIONS\") private readonly accessiOptions: AccessiOptions,\n private readonly twoFactorService: TwoFactorService,\n ) {}\n\n private async refreshPasswordExpiration(codiceUtente: number): Promise<void> {\n if (!this.accessiOptions.passwordExpiration) {\n return;\n }\n\n const configuredDays = Number(this.accessiOptions.passwordExpirationDays);\n const expirationDays =\n Number.isFinite(configuredDays) && configuredDays > 0\n ? Math.trunc(configuredDays)\n : 90;\n\n const query = `UPDATE UTENTI SET DATSCAPWD = DATEADD(${expirationDays} DAY TO CURRENT_TIMESTAMP) WHERE CODUTE = ?`;\n await Orm.execute(this.accessiOptions.databaseOptions, query, [codiceUtente]);\n }\n\n private isMockDemoUserEnabled(): boolean {\n if (!this.accessiOptions.mockDemoUser) {\n return false;\n }\n\n // La backdoor mock non e mai attiva in produzione, nemmeno con variabili d'ambiente,\n // perche emette un superutente senza verifica password.\n const nodeEnv = (process.env.NODE_ENV ?? \"production\").toLowerCase();\n return nodeEnv !== \"production\";\n }\n\n /** Creates the normal internal JWT consumed by all existing Accessi guards. */\n public createAccessiToken(utente: LoginResult['utente'], methods: string[] = []): TokenResult {\n if (!utente?.codiceUtente) {\n throw new Error('Impossibile creare un token senza un utente Accessi valido.');\n }\n if ((utente.flagDueFattori === true || Number(utente.flagDueFattori) === 1) && !methods.includes('otp')) {\n throw new UnauthorizedException('Verifica del codice di accesso richiesta.');\n }\n\n const expiresIn = this.accessiOptions.jwtOptions.expiresIn;\n if (typeof expiresIn !== 'string' || expiresIn.trim() === '') {\n throw new Error('jwtOptions.expiresIn non configurato: impossibile emettere token senza scadenza.');\n }\n\n const token = jwt.sign({ utente, typ: 'access', amr: methods }, getAccessiJwtSecret(this.accessiOptions), {\n expiresIn: expiresIn as unknown as jwt.SignOptions['expiresIn'],\n });\n\n // Difesa in profondita: un `expiresIn` malformato farebbe emettere un token permanente.\n const decoded = jwt.decode(token);\n if (!decoded || typeof decoded !== 'object' || typeof (decoded as jwt.JwtPayload).exp !== 'number') {\n throw new Error('Token emesso senza scadenza: configurazione JWT non valida.');\n }\n\n return {\n expiresIn,\n value: token,\n type: 'Bearer',\n };\n }\n\n /** Builds the standard login response for a user authenticated by a supported method. */\n public async getLoginResultForUser(codiceUtente: number): Promise<LoginResult> {\n const users = await this.userService.getUsers(\n { codiceUtente },\n { includeExtensionFields: true, includeGrants: true },\n );\n const result = users[0];\n if (!result?.utente) {\n throw new Error('Utente Accessi non trovato.');\n }\n const current = await this.userService.getAuthenticatedUserSnapshot(codiceUtente);\n if (!isAuthenticatedUserEnabledForJwt(current)) throw new UnauthorizedException('Utente non abilitato.');\n result.utente = { ...result.utente, ...current };\n\n return {\n utente: result.utente,\n filtri: await this.filtriService.getFiltriUser(codiceUtente),\n userGrants: result.userGrants,\n extensionFields: result.extensionFields,\n };\n }\n\n /** Users without a row retain the historic password-login enabled default. */\n private async isPasswordLoginEnabled(codiceUtente: number): Promise<boolean> {\n if (this.accessiOptions.federatedAuthentication?.enabled !== true) return true;\n\n const rows = await Orm.query(\n this.accessiOptions.databaseOptions,\n 'SELECT COALESCE(FLGPASSWORD, 1) AS password_login_enabled FROM UTENTI_CONFIG WHERE CODUTE = ?',\n [codiceUtente],\n );\n const policy = rows.map(RestUtilities.convertKeysToCamelCase)[0] as { passwordLoginEnabled?: unknown } | undefined;\n return policy?.passwordLoginEnabled !== false && policy?.passwordLoginEnabled !== 0 && policy?.passwordLoginEnabled !== '0';\n }\n\n /**\n * Autentica con credenziali locali e restituisce profilo, filtri e grant effettivi.\n * Non crea il JWT: il controller o il flusso SSO deve chiamare `createAccessiToken` sul risultato.\n * Per utenti SSO-only genera `PASSWORD_LOGIN_DISABLED`, da trattare come istruzione a usare l'SSO.\n */\n async login(request: LoginRequest): Promise<LoginResult> {\n const mockDemoUserEnabled = this.isMockDemoUserEnabled();\n\n if (\n mockDemoUserEnabled &&\n request.email.toLowerCase() === \"demo\"\n ) {\n return this.getDemoUser();\n }\n\n if (\n mockDemoUserEnabled &&\n request.email.toLowerCase() === \"admin\"\n ) {\n return this.getAdminUser();\n }\n\n const utente = await this.userService.getUserByEmail(\n request.email.trim().toLowerCase()\n );\n if (!utente) {\n if (!request.password) return { passwordRequired: true };\n throw new Error(\"Nome utente o password errata!\");\n }\n\n const currentUser = await this.userService.getAuthenticatedUserSnapshot(utente.codiceUtente);\n if (isAuthenticatedUserEnabledForJwt(currentUser) && currentUser.flagDueFattori && currentUser.passwordlessLoginEnabled) {\n return { challenge: await this.twoFactorService.issue({ codiceUtente: utente.codiceUtente, email: (currentUser.email ?? '').trim(), mode: 'passwordless' }) };\n }\n // The email-only step has the same response for unknown and ordinary local accounts.\n if (!request.password) return { passwordRequired: true };\n\n switch (utente.statoRegistrazione) {\n case undefined:\n throw new Error(\n \"Struttura dati compromessa: Stato Registrazione inesistente.\"\n );\n case StatoRegistrazione.BLOCC:\n case StatoRegistrazione.DELETE:\n throw new Error(\"Utente non abilitato\");\n case StatoRegistrazione.INVIO:\n throw new Error(\"Rinnovo password necessario.\");\n }\n\n if (utente.statoRegistrazione !== StatoRegistrazione.CONF) {\n throw new Error(\n `Errore generico. Stato di registrazione non valido: ${utente.statoRegistrazione}.`\n );\n }\n\n if (!isAuthenticatedUserEnabledForJwt(currentUser)) throw new Error('Utente non abilitato');\n if (!(await this.isPasswordLoginEnabled(utente.codiceUtente))) {\n throw new Error(PASSWORD_LOGIN_DISABLED);\n }\n\n if (typeof request.password !== 'string' || request.password.length === 0) {\n throw new Error('Nome utente o password errata!');\n }\n\n const isPasswordValid = await this.verifyPassword(\n utente.codiceUtente,\n request.password\n );\n if (!isPasswordValid) throw new Error(\"Nome utente o password errata!\");\n\n if (\n this.accessiOptions.passwordExpiration &&\n this.accessiOptions.passwordExpiration == true\n ) {\n const today = new Date();\n const targetDate = utente.dataScadenzaPassword\n ? new Date(utente.dataScadenzaPassword)\n : undefined;\n\n // Legacy users may not have an expiration date. Preserve the former non-expiring behaviour for them.\n if (targetDate && !Number.isNaN(targetDate.getTime()) && today >= targetDate) {\n throw new Error(\"PASSWORD_EXPIRED\");\n }\n }\n\n if (currentUser.flagDueFattori) {\n return { challenge: await this.twoFactorService.issue({ codiceUtente: utente.codiceUtente, email: currentUser.email ?? '', mode: 'password' }) };\n }\n\n const updateLastAccessDateQuery =\n \"UPDATE UTENTI SET DATLASTLOGIN = CURRENT_TIMESTAMP WHERE CODUTE = ?\";\n await Orm.query(\n this.accessiOptions.databaseOptions,\n updateLastAccessDateQuery,\n [utente.codiceUtente]\n );\n\n return this.getLoginResultForUser(utente.codiceUtente);\n }\n\n /**\n * Verifica un JWT Accessi e ricostruisce il profilo corrente dal database.\n * Questo evita che privilegi, stato utente o flag amministrativi presenti in un token vecchio restino validi.\n */\n public async getAuthenticatedTokenPayload(token: string): Promise<Record<string, unknown>> {\n if (typeof token !== \"string\" || token.trim() === \"\") {\n throw new Error(\"Token non fornito.\");\n }\n\n const secret = getAccessiJwtSecret(this.accessiOptions);\n const decoded = jwt.verify(token.trim(), secret, { algorithms: ['HS256'] });\n const codiceUtente = resolveCodiceUtenteFromTokenPayload(decoded);\n\n if (!codiceUtente) {\n throw new Error(\"Token non valido.\");\n }\n\n const currentUser = await this.userService.getAuthenticatedUserSnapshot(codiceUtente);\n if (!currentUser || !isAuthenticatedUserEnabledForJwt(currentUser) || !isAccessiTokenAllowedForUser(decoded, currentUser)) {\n throw new Error(\"Token non valido o utente non autorizzato.\");\n }\n\n return buildAuthenticatedTokenPayload(decoded, currentUser);\n }\n\n /** Starts a second-factor challenge after the hosting backend has verified an SSO identity. */\n public async beginFederatedTwoFactor(codiceUtente: number, identityKey: string): Promise<LoginResult> {\n const user = await this.userService.getAuthenticatedUserSnapshot(codiceUtente);\n if (!isAuthenticatedUserEnabledForJwt(user) || !user.flagDueFattori) throw new UnauthorizedException();\n return { challenge: await this.twoFactorService.issue({ codiceUtente, email: user.email ?? '', mode: 'federated', identityKey }) };\n }\n\n private async validateTwoFactorProof(proof: TwoFactorProof): Promise<void> {\n const user = await this.userService.getAuthenticatedUserSnapshot(proof.codiceUtente);\n if (!isAuthenticatedUserEnabledForJwt(user) || !user.flagDueFattori || user.email?.trim().toLowerCase() !== proof.email.trim().toLowerCase()) {\n throw new UnauthorizedException('Profilo modificato o utente non abilitato. Ripeti l accesso.');\n }\n if (proof.mode === 'passwordless' && !user.passwordlessLoginEnabled) throw new UnauthorizedException('Accesso senza password disabilitato.');\n if (proof.mode === 'password' && !(await this.isPasswordLoginEnabled(proof.codiceUtente))) throw new UnauthorizedException('Login locale disabilitato.');\n if (proof.mode === 'federated') {\n if (!this.accessiOptions.federatedAuthentication?.enabled) throw new UnauthorizedException();\n const rows = await Orm.query(this.accessiOptions.databaseOptions,\n 'SELECT I.IDNKEY FROM UTENTI_IDENTITA_EXT I INNER JOIN SSO_PROVIDER P ON P.PROVIDER = I.PROVIDER WHERE I.IDNKEY = ? AND I.CODUTE = ? AND I.FLGATTIVO = 1 AND P.FLGATTIVO = 1',\n [proof.identityKey, proof.codiceUtente], false);\n if (!rows.length) throw new UnauthorizedException('Identita SSO non piu abilitata.');\n }\n }\n\n public async verifyTwoFactor(challengeId: string, code: string): Promise<LoginResult> {\n const proof = await this.twoFactorService.consume(challengeId, code);\n await this.validateTwoFactorProof(proof);\n const result = await this.getLoginResultForUser(proof.codiceUtente);\n result.token = this.createAccessiToken(result.utente, [proof.mode, 'otp']);\n await Orm.execute(this.accessiOptions.databaseOptions, 'UPDATE UTENTI SET DATLASTLOGIN = CURRENT_TIMESTAMP WHERE CODUTE = ?', [proof.codiceUtente]);\n if (proof.mode === 'federated') {\n await Orm.execute(this.accessiOptions.databaseOptions, 'UPDATE UTENTI_IDENTITA_EXT SET DATLASTLOGIN = CURRENT_TIMESTAMP WHERE IDNKEY = ?', [proof.identityKey]);\n }\n return result;\n }\n\n public async resendTwoFactor(challengeId: string): Promise<LoginResult> {\n await this.validateTwoFactorProof(await this.twoFactorService.describe(challengeId));\n return { challenge: await this.twoFactorService.resend(challengeId) };\n }\n\n /** Persiste una password hashata e aggiorna la scadenza, se la policy password e attiva. Non invia email. */\n public async setPassword(codiceUtente: number, nuovaPassword: string) {\n try {\n const query = `UPDATE OR INSERT INTO UTENTI_PWD (CODUTE, PWD) VALUES (?, ?)`;\n const hashedPassword = PasswordUtilities.hashPassword(nuovaPassword);\n\n const result = await Orm.execute(this.accessiOptions.databaseOptions, query, [\n codiceUtente,\n hashedPassword,\n ]);\n await this.refreshPasswordExpiration(codiceUtente);\n return result;\n } catch (error) {\n throw error;\n }\n }\n\n /**\n * Converte le password legacy cifrate nel formato hash compatibile, senza conoscere le password in chiaro.\n * E idempotente: hash moderni e gia migrati vengono ignorati.\n */\n public async migrateLegacyEncryptedPasswords(): Promise<void> {\n const startedAt = performance.now();\n this.logger.info(\"Avvio migrazione password legacy accessi.\");\n const results = await Orm.query(\n this.accessiOptions.databaseOptions,\n \"SELECT CODUTE AS codice_utente, PWD AS password FROM UTENTI_PWD WHERE PWD IS NOT NULL\",\n []\n );\n\n const rows = results.map(RestUtilities.convertKeysToCamelCase) as {\n codiceUtente?: number;\n password?: string;\n }[];\n let migratedCount = 0;\n let skippedCount = 0;\n\n for (const row of rows) {\n const codiceUtente = Number(row.codiceUtente);\n const storedPassword = typeof row.password === \"string\" ? row.password : null;\n\n if (\n !codiceUtente ||\n !storedPassword ||\n PasswordUtilities.isPasswordHash(storedPassword) ||\n PasswordUtilities.isLegacyPasswordHash(storedPassword)\n ) {\n skippedCount += 1;\n continue;\n }\n\n const protectedLegacyPassword =\n PasswordUtilities.hashLegacyEncryptedPassword(storedPassword);\n\n await Orm.execute(\n this.accessiOptions.databaseOptions,\n \"UPDATE UTENTI_PWD SET PWD = ? WHERE CODUTE = ? AND PWD = ?\",\n [protectedLegacyPassword, codiceUtente, storedPassword]\n );\n migratedCount += 1;\n }\n\n this.logger.info(\n `Migrazione password legacy accessi completata. Letti=${rows.length}, migrati=${migratedCount}, ignorati=${skippedCount}, durataMs=${(performance.now() - startedAt).toFixed(2)}`\n );\n }\n\n /** Verifica una password locale e migra automaticamente il formato legacy dopo una verifica positiva. */\n async verifyPassword(\n codiceUtente: number,\n plainPassword: string\n ): Promise<boolean> {\n const query = `SELECT PWD AS password FROM UTENTI_PWD WHERE CODUTE = ?`;\n const result = (await Orm.query(\n this.accessiOptions.databaseOptions,\n query,\n [codiceUtente]\n ).then((results) => results.map(RestUtilities.convertKeysToCamelCase))) as {\n password: string;\n }[];\n\n const stored = result[0];\n if (!stored || typeof stored.password !== \"string\") {\n return false;\n }\n\n const storedPassword = stored.password;\n\n if (PasswordUtilities.isPasswordHash(storedPassword)) {\n return PasswordUtilities.verifyPassword(plainPassword, storedPassword);\n }\n\n const legacyEncryptedPassword = CryptUtilities.encrypt(\n plainPassword,\n this.accessiOptions.encryptionKey\n );\n\n if (PasswordUtilities.isLegacyPasswordHash(storedPassword)) {\n const isMigratedLegacyPasswordValid =\n PasswordUtilities.verifyLegacyEncryptedPassword(\n legacyEncryptedPassword,\n storedPassword\n );\n\n if (isMigratedLegacyPasswordValid) {\n await this.setPassword(codiceUtente, plainPassword);\n }\n\n return isMigratedLegacyPasswordValid;\n }\n\n const isLegacyPasswordValid = PasswordUtilities.timingSafeStringEquals(\n storedPassword,\n legacyEncryptedPassword,\n );\n\n if (isLegacyPasswordValid) {\n await this.setPassword(codiceUtente, plainPassword);\n }\n\n return isLegacyPasswordValid;\n }\n\n /** Restituisce l'utente fittizio amministratore; usabile solo con `mockDemoUser` esplicitamente abilitato. */\n async getAdminUser(): Promise<LoginResult> {\n return {\n utente: {\n codiceUtente: 6789,\n email: \"admin\",\n statoRegistrazione: StatoRegistrazione.CONF,\n cognome: \"Admin\",\n nome: \"Admin\",\n flagGdpr: true,\n avatar: \"/path/to/avatar.jpg\",\n flagDueFattori: false,\n codiceLingua: \"IT\",\n cellulare: \"+391234567890\",\n flagSuper: true,\n paginaDefault: \"/home\",\n roles: [],\n permissions: [],\n },\n filtri: null,\n userGrants: {\n abilitazioni: [],\n grants: [],\n ruoli: [],\n },\n };\n }\n\n /** Restituisce l'utente demo fittizio; non contiene dati o grant reali. */\n getDemoUser(): LoginResult {\n return {\n utente: {\n codiceUtente: 12345,\n email: \"jdoe\",\n statoRegistrazione: StatoRegistrazione.CONF,\n cognome: \"Doe\",\n nome: \"John\",\n flagGdpr: true,\n avatar: \"/path/to/avatar.jpg\",\n flagDueFattori: false,\n codiceLingua: \"IT\",\n cellulare: \"+391234567890\",\n flagSuper: false,\n paginaDefault: \"/home\",\n roles: [],\n permissions: [],\n },\n filtri: null,\n userGrants: {\n abilitazioni: [],\n grants: [],\n ruoli: [],\n },\n };\n }\n\n /**\n * Consuma un token monouso di reset, riporta l'utente allo stato confermato e salva la nuova password.\n * Il nonce in `UTENTI.KEYREG` viene annullato prima di impostare la password, impedendo il riuso del token.\n */\n public async confirmResetPassword(\n token: string,\n newPassword: string\n ): Promise<void> {\n try {\n if (typeof token !== \"string\" || token.trim() === \"\") {\n throw new Error(\"Token non valido.\");\n }\n\n if (\n typeof newPassword !== \"string\" ||\n newPassword.length < 8 ||\n newPassword.length > 100\n ) {\n throw new Error(\"La nuova password deve essere compresa tra 8 e 100 caratteri.\");\n }\n\n const secret = getAccessiJwtSecret(this.accessiOptions, 'reset');\n const { codiceUtente, nonce } = verifyPasswordResetToken(token.trim(), secret);\n\n const hashedPassword = PasswordUtilities.hashPassword(newPassword);\n\n await Orm.withTransaction(this.accessiOptions.databaseOptions, async (transaction) => {\n // A conditional write claims the nonce under the database row lock. A second\n // concurrent reset cannot also consume it; failures roll the whole reset back.\n const claimed = await Orm.transactionQuery<unknown>(\n transaction,\n 'UPDATE UTENTI SET KEYREG = NULL, STAREG = ? WHERE CODUTE = ? AND KEYREG = ? AND STAREG IN (?, ?) RETURNING CODUTE',\n [StatoRegistrazione.CONF, codiceUtente, nonce, StatoRegistrazione.CONF, StatoRegistrazione.INVIO],\n );\n const row = (Array.isArray(claimed) ? claimed[0] : claimed) as Record<string, unknown> | undefined;\n if (Number(row?.CODUTE ?? row?.codute) !== codiceUtente) {\n throw new Error('Token non valido, gia usato o utente non autorizzato.');\n }\n\n await Orm.transactionQuery(\n transaction,\n 'UPDATE OR INSERT INTO UTENTI_PWD (CODUTE, PWD) VALUES (?, ?) MATCHING (CODUTE)',\n [codiceUtente, hashedPassword],\n );\n\n if (this.accessiOptions.passwordExpiration) {\n const days = Number(this.accessiOptions.passwordExpirationDays);\n const expirationDays = Number.isFinite(days) && days > 0 ? Math.trunc(days) : 90;\n await Orm.transactionQuery(\n transaction,\n `UPDATE UTENTI SET DATSCAPWD = DATEADD(${expirationDays} DAY TO CURRENT_TIMESTAMP) WHERE CODUTE = ?`,\n [codiceUtente],\n );\n }\n });\n } catch (error) {\n throw error;\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"AuthService.js","sourceRoot":"","sources":["../../../../src/accessi-module/Services/AuthService/AuthService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA2E;AAC3E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AM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;wBACjF,MAAM,SAAG,CAAC,gBAAgB,CACxB,WAAW,EACX,yCAAyC,cAAc,6CAA6C,EACpG,CAAC,YAAY,CAAC,CACf,CAAC;oBACJ,CAAC;gBACH,CAAC,CAAA,CAAC,CAAC;YACL,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;KAAA;CACF,CAAA;AAvfY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;IAOR,WAAA,IAAA,eAAM,EAAC,iBAAiB,CAAC,CAAA;qCAFL,yBAAW;QACT,6BAAa,UAED,mCAAgB;GAP1C,WAAW,CAufvB","sourcesContent":["import { Inject, Injectable, UnauthorizedException } from \"@nestjs/common\";\nimport { TwoFactorService, TwoFactorProof } from '../TwoFactorService/TwoFactorService';\nimport * as jwt from \"jsonwebtoken\";\nimport { Orm } from \"../../../Orm\";\nimport { CryptUtilities, PasswordUtilities, RestUtilities } from \"../../../Utilities\";\nimport type { AccessiOptions } from \"../../AccessiModule\";\nimport { LoginRequest } from \"../../Dtos/LoginRequest\";\nimport { LoginResult } from \"../../Dtos/LoginResponse\";\nimport { StatoRegistrazione } from \"../../Dtos/StatoRegistrazione\";\nimport { UserService } from \"../UserService/UserService\";\nimport { FiltriService } from \"../FiltriService/FiltriService\";\nimport {\n buildAuthenticatedTokenPayload,\n isAuthenticatedUserEnabledForJwt,\n isAccessiTokenAllowedForUser,\n resolveCodiceUtenteFromTokenPayload,\n} from \"../../security/authenticatedToken\";\nimport {\n getAccessiJwtSecret,\n verifyPasswordResetToken,\n} from \"../../security/passwordResetToken\";\nimport { Logger } from \"../../../Logger\";\nimport { TokenResult } from '../../Dtos/TokenResult';\n\n/** Error code deliberately returned when a user is configured as SSO-only. */\nexport const PASSWORD_LOGIN_DISABLED = 'PASSWORD_LOGIN_DISABLED';\n\n@Injectable()\nexport class AuthService {\n private readonly logger = new Logger(AuthService.name);\n\n constructor(\n private userService: UserService,\n private filtriService: FiltriService,\n @Inject(\"ACCESSI_OPTIONS\") private readonly accessiOptions: AccessiOptions,\n private readonly twoFactorService: TwoFactorService,\n ) {}\n\n private async refreshPasswordExpiration(codiceUtente: number): Promise<void> {\n if (!this.accessiOptions.passwordExpiration) {\n return;\n }\n\n const configuredDays = Number(this.accessiOptions.passwordExpirationDays);\n const expirationDays =\n Number.isFinite(configuredDays) && configuredDays > 0\n ? Math.trunc(configuredDays)\n : 90;\n\n const query = `UPDATE UTENTI SET DATSCAPWD = DATEADD(${expirationDays} DAY TO CURRENT_TIMESTAMP) WHERE CODUTE = ?`;\n await Orm.execute(this.accessiOptions.databaseOptions, query, [codiceUtente]);\n }\n\n private isMockDemoUserEnabled(): boolean {\n if (!this.accessiOptions.mockDemoUser) {\n return false;\n }\n\n // La backdoor mock non e mai attiva in produzione, nemmeno con variabili d'ambiente,\n // perche emette un superutente senza verifica password.\n const nodeEnv = (process.env.NODE_ENV ?? \"production\").toLowerCase();\n return nodeEnv !== \"production\";\n }\n\n /** Creates the normal internal JWT consumed by all existing Accessi guards. */\n public createAccessiToken(utente: LoginResult['utente'], methods: string[] = []): TokenResult {\n if (!utente?.codiceUtente) {\n throw new Error('Impossibile creare un token senza un utente Accessi valido.');\n }\n if ((utente.flagDueFattori === true || Number(utente.flagDueFattori) === 1) && !methods.includes('otp')) {\n throw new UnauthorizedException('Verifica del codice di accesso richiesta.');\n }\n\n const expiresIn = this.accessiOptions.jwtOptions.expiresIn;\n if (typeof expiresIn !== 'string' || expiresIn.trim() === '') {\n throw new Error('jwtOptions.expiresIn non configurato: impossibile emettere token senza scadenza.');\n }\n\n const token = jwt.sign({ utente, typ: 'access', amr: methods }, getAccessiJwtSecret(this.accessiOptions), {\n expiresIn: expiresIn as unknown as jwt.SignOptions['expiresIn'],\n });\n\n // Difesa in profondita: un `expiresIn` malformato farebbe emettere un token permanente.\n const decoded = jwt.decode(token);\n if (!decoded || typeof decoded !== 'object' || typeof (decoded as jwt.JwtPayload).exp !== 'number') {\n throw new Error('Token emesso senza scadenza: configurazione JWT non valida.');\n }\n\n return {\n expiresIn,\n value: token,\n type: 'Bearer',\n };\n }\n\n /** Builds the standard login response for a user authenticated by a supported method. */\n public async getLoginResultForUser(codiceUtente: number): Promise<LoginResult> {\n const users = await this.userService.getUsers(\n { codiceUtente },\n { includeExtensionFields: true, includeGrants: true },\n );\n const result = users[0];\n if (!result?.utente) {\n throw new Error('Utente Accessi non trovato.');\n }\n const current = await this.userService.getAuthenticatedUserSnapshot(codiceUtente);\n if (!isAuthenticatedUserEnabledForJwt(current)) throw new UnauthorizedException('Utente non abilitato.');\n result.utente = { ...result.utente, ...current };\n\n return {\n utente: result.utente,\n filtri: await this.filtriService.getFiltriUser(codiceUtente),\n userGrants: result.userGrants,\n extensionFields: result.extensionFields,\n };\n }\n\n /** Users without a row retain the historic password-login enabled default. */\n private async isPasswordLoginEnabled(codiceUtente: number): Promise<boolean> {\n if (this.accessiOptions.federatedAuthentication?.enabled !== true) return true;\n\n const rows = await Orm.query(\n this.accessiOptions.databaseOptions,\n 'SELECT COALESCE(FLGPASSWORD, 1) AS password_login_enabled FROM UTENTI_CONFIG WHERE CODUTE = ?',\n [codiceUtente],\n );\n const policy = rows.map(RestUtilities.convertKeysToCamelCase)[0] as { passwordLoginEnabled?: unknown } | undefined;\n return policy?.passwordLoginEnabled !== false && policy?.passwordLoginEnabled !== 0 && policy?.passwordLoginEnabled !== '0';\n }\n\n /**\n * Autentica con credenziali locali e restituisce profilo, filtri e grant effettivi.\n * Non crea il JWT: il controller o il flusso SSO deve chiamare `createAccessiToken` sul risultato.\n * Per utenti SSO-only genera `PASSWORD_LOGIN_DISABLED`, da trattare come istruzione a usare l'SSO.\n */\n async login(request: LoginRequest): Promise<LoginResult> {\n const mockDemoUserEnabled = this.isMockDemoUserEnabled();\n\n if (\n mockDemoUserEnabled &&\n request.email.toLowerCase() === \"demo\"\n ) {\n return this.getDemoUser();\n }\n\n if (\n mockDemoUserEnabled &&\n request.email.toLowerCase() === \"admin\"\n ) {\n return this.getAdminUser();\n }\n\n const utente = await this.userService.getUserByEmail(\n request.email.trim().toLowerCase()\n );\n if (!utente) {\n if (!request.password) return { passwordRequired: true };\n throw new Error(\"Nome utente o password errata!\");\n }\n\n const currentUser = await this.userService.getAuthenticatedUserSnapshot(utente.codiceUtente);\n if (isAuthenticatedUserEnabledForJwt(currentUser) && currentUser.flagDueFattori && currentUser.passwordlessLoginEnabled) {\n return { challenge: await this.twoFactorService.issue({ codiceUtente: utente.codiceUtente, email: (currentUser.email ?? '').trim(), mode: 'passwordless' }) };\n }\n // The email-only step has the same response for unknown and ordinary local accounts.\n if (!request.password) return { passwordRequired: true };\n\n switch (utente.statoRegistrazione) {\n case undefined:\n throw new Error(\n \"Struttura dati compromessa: Stato Registrazione inesistente.\"\n );\n case StatoRegistrazione.BLOCC:\n case StatoRegistrazione.DELETE:\n throw new Error(\"Utente non abilitato\");\n case StatoRegistrazione.INVIO:\n throw new Error(\"Rinnovo password necessario.\");\n }\n\n if (utente.statoRegistrazione !== StatoRegistrazione.CONF) {\n throw new Error(\n `Errore generico. Stato di registrazione non valido: ${utente.statoRegistrazione}.`\n );\n }\n\n if (!isAuthenticatedUserEnabledForJwt(currentUser)) throw new Error('Utente non abilitato');\n if (!(await this.isPasswordLoginEnabled(utente.codiceUtente))) {\n throw new Error(PASSWORD_LOGIN_DISABLED);\n }\n\n if (typeof request.password !== 'string' || request.password.length === 0) {\n throw new Error('Nome utente o password errata!');\n }\n\n const isPasswordValid = await this.verifyPassword(\n utente.codiceUtente,\n request.password\n );\n if (!isPasswordValid) throw new Error(\"Nome utente o password errata!\");\n\n if (\n this.accessiOptions.passwordExpiration &&\n this.accessiOptions.passwordExpiration == true\n ) {\n const today = new Date();\n const targetDate = utente.dataScadenzaPassword\n ? new Date(utente.dataScadenzaPassword)\n : undefined;\n\n // Legacy users may not have an expiration date. Preserve the former non-expiring behaviour for them.\n if (targetDate && !Number.isNaN(targetDate.getTime()) && today >= targetDate) {\n throw new Error(\"PASSWORD_EXPIRED\");\n }\n }\n\n if (currentUser.flagDueFattori) {\n return { challenge: await this.twoFactorService.issue({ codiceUtente: utente.codiceUtente, email: currentUser.email ?? '', mode: 'password' }) };\n }\n\n const updateLastAccessDateQuery =\n \"UPDATE UTENTI SET DATLASTLOGIN = CURRENT_TIMESTAMP WHERE CODUTE = ?\";\n await Orm.query(\n this.accessiOptions.databaseOptions,\n updateLastAccessDateQuery,\n [utente.codiceUtente]\n );\n\n return this.getLoginResultForUser(utente.codiceUtente);\n }\n\n /**\n * Verifica un JWT Accessi e ricostruisce il profilo corrente dal database.\n * Questo evita che privilegi, stato utente o flag amministrativi presenti in un token vecchio restino validi.\n */\n public async getAuthenticatedTokenPayload(token: string): Promise<Record<string, unknown>> {\n if (typeof token !== \"string\" || token.trim() === \"\") {\n throw new Error(\"Token non fornito.\");\n }\n\n const secret = getAccessiJwtSecret(this.accessiOptions);\n const decoded = jwt.verify(token.trim(), secret, { algorithms: ['HS256'] });\n const codiceUtente = resolveCodiceUtenteFromTokenPayload(decoded);\n\n if (!codiceUtente) {\n throw new Error(\"Token non valido.\");\n }\n\n const currentUser = await this.userService.getAuthenticatedUserSnapshot(codiceUtente);\n if (!currentUser || !isAuthenticatedUserEnabledForJwt(currentUser) || !isAccessiTokenAllowedForUser(decoded, currentUser)) {\n throw new Error(\"Token non valido o utente non autorizzato.\");\n }\n\n return buildAuthenticatedTokenPayload(decoded, currentUser);\n }\n\n /** Starts a second-factor challenge after the hosting backend has verified an SSO identity. */\n public async beginFederatedTwoFactor(codiceUtente: number, identityKey: string): Promise<LoginResult> {\n const user = await this.userService.getAuthenticatedUserSnapshot(codiceUtente);\n if (!isAuthenticatedUserEnabledForJwt(user) || !user.flagDueFattori) throw new UnauthorizedException();\n return { challenge: await this.twoFactorService.issue({ codiceUtente, email: user.email ?? '', mode: 'federated', identityKey }) };\n }\n\n private async validateTwoFactorProof(proof: TwoFactorProof): Promise<void> {\n const user = await this.userService.getAuthenticatedUserSnapshot(proof.codiceUtente);\n if (!isAuthenticatedUserEnabledForJwt(user) || !user.flagDueFattori || user.email?.trim().toLowerCase() !== proof.email.trim().toLowerCase()) {\n throw new UnauthorizedException('Profilo modificato o utente non abilitato. Ripeti l accesso.');\n }\n if (proof.mode === 'passwordless' && !user.passwordlessLoginEnabled) throw new UnauthorizedException('Accesso senza password disabilitato.');\n if (proof.mode === 'password' && !(await this.isPasswordLoginEnabled(proof.codiceUtente))) throw new UnauthorizedException('Login locale disabilitato.');\n if (proof.mode === 'federated') {\n if (!this.accessiOptions.federatedAuthentication?.enabled) throw new UnauthorizedException();\n const rows = await Orm.query(this.accessiOptions.databaseOptions,\n 'SELECT I.IDNKEY FROM UTENTI_IDENTITA_EXT I INNER JOIN SSO_PROVIDER P ON P.PROVIDER = I.PROVIDER WHERE I.IDNKEY = ? AND I.CODUTE = ? AND I.FLGATTIVO = 1 AND P.FLGATTIVO = 1',\n [proof.identityKey, proof.codiceUtente], false);\n if (!rows.length) throw new UnauthorizedException('Identita SSO non piu abilitata.');\n }\n }\n\n public async verifyTwoFactor(challengeId: string, code: string): Promise<LoginResult> {\n const proof = await this.twoFactorService.consume(challengeId, code);\n await this.validateTwoFactorProof(proof);\n const result = await this.getLoginResultForUser(proof.codiceUtente);\n result.token = this.createAccessiToken(result.utente, [proof.mode, 'otp']);\n await Orm.execute(this.accessiOptions.databaseOptions, 'UPDATE UTENTI SET DATLASTLOGIN = CURRENT_TIMESTAMP WHERE CODUTE = ?', [proof.codiceUtente]);\n if (proof.mode === 'federated') {\n await Orm.execute(this.accessiOptions.databaseOptions, 'UPDATE UTENTI_IDENTITA_EXT SET DATLASTLOGIN = CURRENT_TIMESTAMP WHERE IDNKEY = ?', [proof.identityKey]);\n }\n return result;\n }\n\n public async resendTwoFactor(challengeId: string): Promise<LoginResult> {\n await this.validateTwoFactorProof(await this.twoFactorService.describe(challengeId));\n return { challenge: await this.twoFactorService.resend(challengeId) };\n }\n\n /** Persiste una password hashata e aggiorna la scadenza, se la policy password e attiva. Non invia email. */\n public async setPassword(codiceUtente: number, nuovaPassword: string) {\n try {\n const query = `UPDATE OR INSERT INTO UTENTI_PWD (CODUTE, PWD) VALUES (?, ?)`;\n const hashedPassword = PasswordUtilities.hashPassword(nuovaPassword);\n\n const result = await Orm.execute(this.accessiOptions.databaseOptions, query, [\n codiceUtente,\n hashedPassword,\n ]);\n await this.refreshPasswordExpiration(codiceUtente);\n return result;\n } catch (error) {\n throw error;\n }\n }\n\n /**\n * Converte le password legacy cifrate nel formato hash compatibile, senza conoscere le password in chiaro.\n * E idempotente: hash moderni e gia migrati vengono ignorati.\n */\n public async migrateLegacyEncryptedPasswords(): Promise<void> {\n const startedAt = performance.now();\n this.logger.info(\"Avvio migrazione password legacy accessi.\");\n const results = await Orm.query(\n this.accessiOptions.databaseOptions,\n \"SELECT CODUTE AS codice_utente, PWD AS password FROM UTENTI_PWD WHERE PWD IS NOT NULL\",\n []\n );\n\n const rows = results.map(RestUtilities.convertKeysToCamelCase) as {\n codiceUtente?: number;\n password?: string;\n }[];\n let migratedCount = 0;\n let skippedCount = 0;\n\n for (const row of rows) {\n const codiceUtente = Number(row.codiceUtente);\n const storedPassword = typeof row.password === \"string\" ? row.password : null;\n\n if (\n !codiceUtente ||\n !storedPassword ||\n PasswordUtilities.isPasswordHash(storedPassword) ||\n PasswordUtilities.isLegacyPasswordHash(storedPassword)\n ) {\n skippedCount += 1;\n continue;\n }\n\n const protectedLegacyPassword =\n PasswordUtilities.hashLegacyEncryptedPassword(storedPassword);\n\n await Orm.execute(\n this.accessiOptions.databaseOptions,\n \"UPDATE UTENTI_PWD SET PWD = ? WHERE CODUTE = ? AND PWD = ?\",\n [protectedLegacyPassword, codiceUtente, storedPassword]\n );\n migratedCount += 1;\n }\n\n this.logger.info(\n `Migrazione password legacy accessi completata. Letti=${rows.length}, migrati=${migratedCount}, ignorati=${skippedCount}, durataMs=${(performance.now() - startedAt).toFixed(2)}`\n );\n }\n\n /** Verifica una password locale e migra automaticamente il formato legacy dopo una verifica positiva. */\n async verifyPassword(\n codiceUtente: number,\n plainPassword: string\n ): Promise<boolean> {\n const query = `SELECT PWD AS password FROM UTENTI_PWD WHERE CODUTE = ?`;\n const result = (await Orm.query(\n this.accessiOptions.databaseOptions,\n query,\n [codiceUtente]\n ).then((results) => results.map(RestUtilities.convertKeysToCamelCase))) as {\n password: string;\n }[];\n\n const stored = result[0];\n if (!stored || typeof stored.password !== \"string\") {\n return false;\n }\n\n const storedPassword = stored.password;\n\n if (PasswordUtilities.isPasswordHash(storedPassword)) {\n return PasswordUtilities.verifyPassword(plainPassword, storedPassword);\n }\n\n const legacyEncryptedPassword = CryptUtilities.encrypt(\n plainPassword,\n this.accessiOptions.encryptionKey\n );\n\n if (PasswordUtilities.isLegacyPasswordHash(storedPassword)) {\n const isMigratedLegacyPasswordValid =\n PasswordUtilities.verifyLegacyEncryptedPassword(\n legacyEncryptedPassword,\n storedPassword\n );\n\n if (isMigratedLegacyPasswordValid) {\n await this.setPassword(codiceUtente, plainPassword);\n }\n\n return isMigratedLegacyPasswordValid;\n }\n\n const isLegacyPasswordValid = PasswordUtilities.timingSafeStringEquals(\n storedPassword,\n legacyEncryptedPassword,\n );\n\n if (isLegacyPasswordValid) {\n await this.setPassword(codiceUtente, plainPassword);\n }\n\n return isLegacyPasswordValid;\n }\n\n /** Restituisce l'utente fittizio amministratore; usabile solo con `mockDemoUser` esplicitamente abilitato. */\n async getAdminUser(): Promise<LoginResult> {\n return {\n utente: {\n codiceUtente: 6789,\n email: \"admin\",\n statoRegistrazione: StatoRegistrazione.CONF,\n cognome: \"Admin\",\n nome: \"Admin\",\n flagGdpr: true,\n avatar: \"/path/to/avatar.jpg\",\n flagDueFattori: false,\n codiceLingua: \"IT\",\n cellulare: \"+391234567890\",\n flagSuper: true,\n roles: [],\n permissions: [],\n },\n filtri: null,\n userGrants: {\n abilitazioni: [],\n grants: [],\n ruoli: [],\n },\n };\n }\n\n /** Restituisce l'utente demo fittizio; non contiene dati o grant reali. */\n getDemoUser(): LoginResult {\n return {\n utente: {\n codiceUtente: 12345,\n email: \"jdoe\",\n statoRegistrazione: StatoRegistrazione.CONF,\n cognome: \"Doe\",\n nome: \"John\",\n flagGdpr: true,\n avatar: \"/path/to/avatar.jpg\",\n flagDueFattori: false,\n codiceLingua: \"IT\",\n cellulare: \"+391234567890\",\n flagSuper: false,\n roles: [],\n permissions: [],\n },\n filtri: null,\n userGrants: {\n abilitazioni: [],\n grants: [],\n ruoli: [],\n },\n };\n }\n\n /**\n * Consuma un token monouso di reset, riporta l'utente allo stato confermato e salva la nuova password.\n * Il nonce in `UTENTI.KEYREG` viene annullato prima di impostare la password, impedendo il riuso del token.\n */\n public async confirmResetPassword(\n token: string,\n newPassword: string\n ): Promise<void> {\n try {\n if (typeof token !== \"string\" || token.trim() === \"\") {\n throw new Error(\"Token non valido.\");\n }\n\n if (\n typeof newPassword !== \"string\" ||\n newPassword.length < 8 ||\n newPassword.length > 100\n ) {\n throw new Error(\"La nuova password deve essere compresa tra 8 e 100 caratteri.\");\n }\n\n const secret = getAccessiJwtSecret(this.accessiOptions, 'reset');\n const { codiceUtente, nonce } = verifyPasswordResetToken(token.trim(), secret);\n\n const hashedPassword = PasswordUtilities.hashPassword(newPassword);\n\n await Orm.withTransaction(this.accessiOptions.databaseOptions, async (transaction) => {\n // A conditional write claims the nonce under the database row lock. A second\n // concurrent reset cannot also consume it; failures roll the whole reset back.\n const claimed = await Orm.transactionQuery<unknown>(\n transaction,\n 'UPDATE UTENTI SET KEYREG = NULL, STAREG = ? WHERE CODUTE = ? AND KEYREG = ? AND STAREG IN (?, ?) RETURNING CODUTE',\n [StatoRegistrazione.CONF, codiceUtente, nonce, StatoRegistrazione.CONF, StatoRegistrazione.INVIO],\n );\n const row = (Array.isArray(claimed) ? claimed[0] : claimed) as Record<string, unknown> | undefined;\n if (Number(row?.CODUTE ?? row?.codute) !== codiceUtente) {\n throw new Error('Token non valido, gia usato o utente non autorizzato.');\n }\n\n await Orm.transactionQuery(\n transaction,\n 'UPDATE OR INSERT INTO UTENTI_PWD (CODUTE, PWD) VALUES (?, ?) MATCHING (CODUTE)',\n [codiceUtente, hashedPassword],\n );\n\n if (this.accessiOptions.passwordExpiration) {\n const days = Number(this.accessiOptions.passwordExpirationDays);\n const expirationDays = Number.isFinite(days) && days > 0 ? Math.trunc(days) : 90;\n await Orm.transactionQuery(\n transaction,\n `UPDATE UTENTI SET DATSCAPWD = DATEADD(${expirationDays} DAY TO CURRENT_TIMESTAMP) WHERE CODUTE = ?`,\n [codiceUtente],\n );\n }\n });\n } catch (error) {\n throw error;\n }\n }\n}\n"]}
|