emilsoftware-utilities 2.0.0-dev.4 → 2.0.0-dev.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.MD +199 -38
- package/dist/ContractGenerator.d.ts +4 -3
- package/dist/ContractGenerator.js +15 -5
- package/dist/ContractGenerator.js.map +1 -1
- package/dist/DailyFileTransport.d.ts +21 -0
- package/dist/DailyFileTransport.js +74 -0
- package/dist/DailyFileTransport.js.map +1 -0
- package/dist/DatabaseUpdater.d.ts +1 -1
- package/dist/DatabaseUpdater.js +32 -29
- package/dist/DatabaseUpdater.js.map +1 -1
- package/dist/EmilsoftwareModule.js.map +1 -1
- package/dist/ExecutionTimeLogger.d.ts +2 -2
- package/dist/ExecutionTimeLogger.js +5 -4
- package/dist/ExecutionTimeLogger.js.map +1 -1
- package/dist/Logger.d.ts +22 -11
- package/dist/Logger.js +132 -119
- package/dist/Logger.js.map +1 -1
- package/dist/Orm.d.ts +28 -12
- package/dist/Orm.js +194 -153
- package/dist/Orm.js.map +1 -1
- package/dist/RoutesLoggerMiddleware.js.map +1 -1
- package/dist/Utilities.d.ts +18 -8
- package/dist/Utilities.js +117 -38
- package/dist/Utilities.js.map +1 -1
- package/dist/accessi-module/AccessiModule.d.ts +116 -2
- package/dist/accessi-module/AccessiModule.js +36 -5
- package/dist/accessi-module/AccessiModule.js.map +1 -1
- package/dist/accessi-module/Console/accessiFetch.d.ts +16 -0
- package/dist/accessi-module/Console/accessiFetch.js +87 -0
- package/dist/accessi-module/Console/accessiFetch.js.map +1 -0
- package/dist/accessi-module/Console/console.css +681 -0
- package/dist/accessi-module/Console/console.d.ts +1 -0
- package/dist/accessi-module/Console/console.js +3414 -0
- package/dist/accessi-module/Console/console.js.map +1 -0
- package/dist/accessi-module/Console/generated/accessiApi.d.ts +582 -0
- package/dist/accessi-module/Console/generated/accessiApi.js +549 -0
- package/dist/accessi-module/Console/generated/accessiApi.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/abilitazioneMenu.d.ts +39 -0
- package/dist/accessi-module/Console/generated/model/abilitazioneMenu.js +3 -0
- package/dist/accessi-module/Console/generated/model/abilitazioneMenu.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/abilitazioneMenuTipoAbilitazione.d.ts +16 -0
- package/dist/accessi-module/Console/generated/model/abilitazioneMenuTipoAbilitazione.js +17 -0
- package/dist/accessi-module/Console/generated/model/abilitazioneMenuTipoAbilitazione.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/actionResponse.d.ts +12 -0
- package/dist/accessi-module/Console/generated/model/actionResponse.js +9 -0
- package/dist/accessi-module/Console/generated/model/actionResponse.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/assignPermissionsToUserRequest.d.ts +11 -0
- package/dist/accessi-module/Console/generated/model/assignPermissionsToUserRequest.js +3 -0
- package/dist/accessi-module/Console/generated/model/assignPermissionsToUserRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/assignRolesToUserRequest.d.ts +10 -0
- package/dist/accessi-module/Console/generated/model/assignRolesToUserRequest.js +9 -0
- package/dist/accessi-module/Console/generated/model/assignRolesToUserRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/authenticatedTokenPayloadDto.d.ts +10 -0
- package/dist/accessi-module/Console/generated/model/authenticatedTokenPayloadDto.js +3 -0
- package/dist/accessi-module/Console/generated/model/authenticatedTokenPayloadDto.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/authenticatedUserPayloadDto.d.ts +19 -0
- package/dist/accessi-module/Console/generated/model/authenticatedUserPayloadDto.js +9 -0
- package/dist/accessi-module/Console/generated/model/authenticatedUserPayloadDto.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/bootstrapAdminRequest.d.ts +17 -0
- package/dist/accessi-module/Console/generated/model/bootstrapAdminRequest.js +9 -0
- package/dist/accessi-module/Console/generated/model/bootstrapAdminRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/bootstrapAdminResponse.d.ts +14 -0
- package/dist/accessi-module/Console/generated/model/bootstrapAdminResponse.js +3 -0
- package/dist/accessi-module/Console/generated/model/bootstrapAdminResponse.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/bootstrapAdminResultDto.d.ts +13 -0
- package/dist/accessi-module/Console/generated/model/bootstrapAdminResultDto.js +9 -0
- package/dist/accessi-module/Console/generated/model/bootstrapAdminResultDto.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/confirmResetPasswordRequest.d.ts +14 -0
- package/dist/accessi-module/Console/generated/model/confirmResetPasswordRequest.js +9 -0
- package/dist/accessi-module/Console/generated/model/confirmResetPasswordRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/createFederatedIdentityRequest.d.ts +13 -0
- package/dist/accessi-module/Console/generated/model/createFederatedIdentityRequest.js +9 -0
- package/dist/accessi-module/Console/generated/model/createFederatedIdentityRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/createFederatedProviderRequest.d.ts +13 -0
- package/dist/accessi-module/Console/generated/model/createFederatedProviderRequest.js +9 -0
- package/dist/accessi-module/Console/generated/model/createFederatedProviderRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/createFederatedUserRequest.d.ts +18 -0
- package/dist/accessi-module/Console/generated/model/createFederatedUserRequest.js +3 -0
- package/dist/accessi-module/Console/generated/model/createFederatedUserRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/createFilterTypeRequest.d.ts +23 -0
- package/dist/accessi-module/Console/generated/model/createFilterTypeRequest.js +3 -0
- package/dist/accessi-module/Console/generated/model/createFilterTypeRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/createFilterTypeRequestFlgEnabled.d.ts +14 -0
- package/dist/accessi-module/Console/generated/model/createFilterTypeRequestFlgEnabled.js +15 -0
- package/dist/accessi-module/Console/generated/model/createFilterTypeRequestFlgEnabled.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/createMenuGroupRequest.d.ts +22 -0
- package/dist/accessi-module/Console/generated/model/createMenuGroupRequest.js +9 -0
- package/dist/accessi-module/Console/generated/model/createMenuGroupRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/createMenuRequest.d.ts +52 -0
- package/dist/accessi-module/Console/generated/model/createMenuRequest.js +9 -0
- package/dist/accessi-module/Console/generated/model/createMenuRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/createMenuTypeRequest.d.ts +18 -0
- package/dist/accessi-module/Console/generated/model/createMenuTypeRequest.js +9 -0
- package/dist/accessi-module/Console/generated/model/createMenuTypeRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/createServiceTokenRequest.d.ts +16 -0
- package/dist/accessi-module/Console/generated/model/createServiceTokenRequest.js +9 -0
- package/dist/accessi-module/Console/generated/model/createServiceTokenRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/createServiceTokenResponse.d.ts +14 -0
- package/dist/accessi-module/Console/generated/model/createServiceTokenResponse.js +3 -0
- package/dist/accessi-module/Console/generated/model/createServiceTokenResponse.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/errorResponse.d.ts +18 -0
- package/dist/accessi-module/Console/generated/model/errorResponse.js +9 -0
- package/dist/accessi-module/Console/generated/model/errorResponse.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/federatedIdentityListResponse.d.ts +14 -0
- package/dist/accessi-module/Console/generated/model/federatedIdentityListResponse.js +3 -0
- package/dist/accessi-module/Console/generated/model/federatedIdentityListResponse.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/federatedIdentityResponse.d.ts +14 -0
- package/dist/accessi-module/Console/generated/model/federatedIdentityResponse.js +3 -0
- package/dist/accessi-module/Console/generated/model/federatedIdentityResponse.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/federatedIdentityResponseDto.d.ts +23 -0
- package/dist/accessi-module/Console/generated/model/federatedIdentityResponseDto.js +9 -0
- package/dist/accessi-module/Console/generated/model/federatedIdentityResponseDto.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/federatedProviderListResponse.d.ts +14 -0
- package/dist/accessi-module/Console/generated/model/federatedProviderListResponse.js +3 -0
- package/dist/accessi-module/Console/generated/model/federatedProviderListResponse.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/federatedProviderResponse.d.ts +14 -0
- package/dist/accessi-module/Console/generated/model/federatedProviderResponse.js +3 -0
- package/dist/accessi-module/Console/generated/model/federatedProviderResponse.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/federatedProviderResponseDto.d.ts +13 -0
- package/dist/accessi-module/Console/generated/model/federatedProviderResponseDto.js +9 -0
- package/dist/accessi-module/Console/generated/model/federatedProviderResponseDto.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/filtriUtente.d.ts +32 -0
- package/dist/accessi-module/Console/generated/model/filtriUtente.js +9 -0
- package/dist/accessi-module/Console/generated/model/filtriUtente.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/getFiltriResponse.d.ts +14 -0
- package/dist/accessi-module/Console/generated/model/getFiltriResponse.js +3 -0
- package/dist/accessi-module/Console/generated/model/getFiltriResponse.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/getFiltriUtenteParams.d.ts +12 -0
- package/dist/accessi-module/Console/generated/model/getFiltriUtenteParams.js +9 -0
- package/dist/accessi-module/Console/generated/model/getFiltriUtenteParams.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/getFiltriUtenteResponse.d.ts +14 -0
- package/dist/accessi-module/Console/generated/model/getFiltriUtenteResponse.js +3 -0
- package/dist/accessi-module/Console/generated/model/getFiltriUtenteResponse.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/getGroupsWithMenusParams.d.ts +12 -0
- package/dist/accessi-module/Console/generated/model/getGroupsWithMenusParams.js +9 -0
- package/dist/accessi-module/Console/generated/model/getGroupsWithMenusParams.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/getGroupsWithMenusResponse.d.ts +14 -0
- package/dist/accessi-module/Console/generated/model/getGroupsWithMenusResponse.js +3 -0
- package/dist/accessi-module/Console/generated/model/getGroupsWithMenusResponse.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/getMenuTypesResponse.d.ts +14 -0
- package/dist/accessi-module/Console/generated/model/getMenuTypesResponse.js +3 -0
- package/dist/accessi-module/Console/generated/model/getMenuTypesResponse.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/getMenusResponse.d.ts +14 -0
- package/dist/accessi-module/Console/generated/model/getMenusResponse.js +3 -0
- package/dist/accessi-module/Console/generated/model/getMenusResponse.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/getRolesResponse.d.ts +14 -0
- package/dist/accessi-module/Console/generated/model/getRolesResponse.js +3 -0
- package/dist/accessi-module/Console/generated/model/getRolesResponse.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/getSchemaResponse.d.ts +14 -0
- package/dist/accessi-module/Console/generated/model/getSchemaResponse.js +3 -0
- package/dist/accessi-module/Console/generated/model/getSchemaResponse.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/getServiceTokensParams.d.ts +12 -0
- package/dist/accessi-module/Console/generated/model/getServiceTokensParams.js +9 -0
- package/dist/accessi-module/Console/generated/model/getServiceTokensParams.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/getServiceTokensResponse.d.ts +14 -0
- package/dist/accessi-module/Console/generated/model/getServiceTokensResponse.js +3 -0
- package/dist/accessi-module/Console/generated/model/getServiceTokensResponse.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/getUserByTokenRequest.d.ts +10 -0
- package/dist/accessi-module/Console/generated/model/getUserByTokenRequest.js +9 -0
- package/dist/accessi-module/Console/generated/model/getUserByTokenRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/getUserByTokenResponse.d.ts +14 -0
- package/dist/accessi-module/Console/generated/model/getUserByTokenResponse.js +3 -0
- package/dist/accessi-module/Console/generated/model/getUserByTokenResponse.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/getUsersParams.d.ts +32 -0
- package/dist/accessi-module/Console/generated/model/getUsersParams.js +9 -0
- package/dist/accessi-module/Console/generated/model/getUsersParams.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/getUsersResponse.d.ts +14 -0
- package/dist/accessi-module/Console/generated/model/getUsersResponse.js +3 -0
- package/dist/accessi-module/Console/generated/model/getUsersResponse.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/getUsersResult.d.ts +17 -0
- package/dist/accessi-module/Console/generated/model/getUsersResult.js +3 -0
- package/dist/accessi-module/Console/generated/model/getUsersResult.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/getUsersResultExtensionFields.d.ts +12 -0
- package/dist/accessi-module/Console/generated/model/getUsersResultExtensionFields.js +9 -0
- package/dist/accessi-module/Console/generated/model/getUsersResultExtensionFields.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/groupWithMenusEntity.d.ts +19 -0
- package/dist/accessi-module/Console/generated/model/groupWithMenusEntity.js +3 -0
- package/dist/accessi-module/Console/generated/model/groupWithMenusEntity.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/index.d.ts +99 -0
- package/dist/accessi-module/Console/generated/model/index.js +116 -0
- package/dist/accessi-module/Console/generated/model/index.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/issuedServiceTokenDto.d.ts +30 -0
- package/dist/accessi-module/Console/generated/model/issuedServiceTokenDto.js +9 -0
- package/dist/accessi-module/Console/generated/model/issuedServiceTokenDto.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/loginRequest.d.ts +12 -0
- package/dist/accessi-module/Console/generated/model/loginRequest.js +9 -0
- package/dist/accessi-module/Console/generated/model/loginRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/loginResponse.d.ts +14 -0
- package/dist/accessi-module/Console/generated/model/loginResponse.js +3 -0
- package/dist/accessi-module/Console/generated/model/loginResponse.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/loginResult.d.ts +32 -0
- package/dist/accessi-module/Console/generated/model/loginResult.js +3 -0
- package/dist/accessi-module/Console/generated/model/loginResult.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/loginResultExtensionFields.d.ts +12 -0
- package/dist/accessi-module/Console/generated/model/loginResultExtensionFields.js +9 -0
- package/dist/accessi-module/Console/generated/model/loginResultExtensionFields.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/loginResultPasswordRequired.d.ts +13 -0
- package/dist/accessi-module/Console/generated/model/loginResultPasswordRequired.js +14 -0
- package/dist/accessi-module/Console/generated/model/loginResultPasswordRequired.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/menuEntity.d.ts +32 -0
- package/dist/accessi-module/Console/generated/model/menuEntity.js +9 -0
- package/dist/accessi-module/Console/generated/model/menuEntity.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/menuTypeEntity.d.ts +12 -0
- package/dist/accessi-module/Console/generated/model/menuTypeEntity.js +9 -0
- package/dist/accessi-module/Console/generated/model/menuTypeEntity.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/passwordExpiredResponse.d.ts +12 -0
- package/dist/accessi-module/Console/generated/model/passwordExpiredResponse.js +9 -0
- package/dist/accessi-module/Console/generated/model/passwordExpiredResponse.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/permission.d.ts +12 -0
- package/dist/accessi-module/Console/generated/model/permission.js +9 -0
- package/dist/accessi-module/Console/generated/model/permission.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/publicRegisterRequest.d.ts +51 -0
- package/dist/accessi-module/Console/generated/model/publicRegisterRequest.js +9 -0
- package/dist/accessi-module/Console/generated/model/publicRegisterRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/registerRequest.d.ts +62 -0
- package/dist/accessi-module/Console/generated/model/registerRequest.js +3 -0
- package/dist/accessi-module/Console/generated/model/registerRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/registerResponse.d.ts +14 -0
- package/dist/accessi-module/Console/generated/model/registerResponse.js +3 -0
- package/dist/accessi-module/Console/generated/model/registerResponse.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/resendTwoFactorRequest.d.ts +13 -0
- package/dist/accessi-module/Console/generated/model/resendTwoFactorRequest.js +9 -0
- package/dist/accessi-module/Console/generated/model/resendTwoFactorRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/role.d.ts +15 -0
- package/dist/accessi-module/Console/generated/model/role.js +3 -0
- package/dist/accessi-module/Console/generated/model/role.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/ruoliMenu.d.ts +15 -0
- package/dist/accessi-module/Console/generated/model/ruoliMenu.js +3 -0
- package/dist/accessi-module/Console/generated/model/ruoliMenu.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/ruoliMenuTipoAbilitazione.d.ts +16 -0
- package/dist/accessi-module/Console/generated/model/ruoliMenuTipoAbilitazione.js +17 -0
- package/dist/accessi-module/Console/generated/model/ruoliMenuTipoAbilitazione.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/schemaDdlResult.d.ts +20 -0
- package/dist/accessi-module/Console/generated/model/schemaDdlResult.js +3 -0
- package/dist/accessi-module/Console/generated/model/schemaDdlResult.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/schemaDdlSection.d.ts +12 -0
- package/dist/accessi-module/Console/generated/model/schemaDdlSection.js +9 -0
- package/dist/accessi-module/Console/generated/model/schemaDdlSection.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/sendResetPasswordEmailRequest.d.ts +12 -0
- package/dist/accessi-module/Console/generated/model/sendResetPasswordEmailRequest.js +9 -0
- package/dist/accessi-module/Console/generated/model/sendResetPasswordEmailRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/serveResetPasswordPageParams.d.ts +12 -0
- package/dist/accessi-module/Console/generated/model/serveResetPasswordPageParams.js +9 -0
- package/dist/accessi-module/Console/generated/model/serveResetPasswordPageParams.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/serviceTokenDto.d.ts +28 -0
- package/dist/accessi-module/Console/generated/model/serviceTokenDto.js +9 -0
- package/dist/accessi-module/Console/generated/model/serviceTokenDto.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/setPasswordLoginPolicyRequest.d.ts +10 -0
- package/dist/accessi-module/Console/generated/model/setPasswordLoginPolicyRequest.js +9 -0
- package/dist/accessi-module/Console/generated/model/setPasswordLoginPolicyRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/setStatoRegistrazioneDto.d.ts +13 -0
- package/dist/accessi-module/Console/generated/model/setStatoRegistrazioneDto.js +3 -0
- package/dist/accessi-module/Console/generated/model/setStatoRegistrazioneDto.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/setStatoRegistrazioneDtoStatoRegistrazione.d.ts +18 -0
- package/dist/accessi-module/Console/generated/model/setStatoRegistrazioneDtoStatoRegistrazione.js +19 -0
- package/dist/accessi-module/Console/generated/model/setStatoRegistrazioneDtoStatoRegistrazione.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/status.d.ts +12 -0
- package/dist/accessi-module/Console/generated/model/status.js +9 -0
- package/dist/accessi-module/Console/generated/model/status.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/tipoFiltro.d.ts +23 -0
- package/dist/accessi-module/Console/generated/model/tipoFiltro.js +3 -0
- package/dist/accessi-module/Console/generated/model/tipoFiltro.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/tipoFiltroFlgEnabled.d.ts +14 -0
- package/dist/accessi-module/Console/generated/model/tipoFiltroFlgEnabled.js +15 -0
- package/dist/accessi-module/Console/generated/model/tipoFiltroFlgEnabled.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/tokenResult.d.ts +15 -0
- package/dist/accessi-module/Console/generated/model/tokenResult.js +3 -0
- package/dist/accessi-module/Console/generated/model/tokenResult.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/tokenResultType.d.ts +14 -0
- package/dist/accessi-module/Console/generated/model/tokenResultType.js +15 -0
- package/dist/accessi-module/Console/generated/model/tokenResultType.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/twoFactorChallengeDto.d.ts +18 -0
- package/dist/accessi-module/Console/generated/model/twoFactorChallengeDto.js +3 -0
- package/dist/accessi-module/Console/generated/model/twoFactorChallengeDto.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/twoFactorChallengeDtoMethod.d.ts +10 -0
- package/dist/accessi-module/Console/generated/model/twoFactorChallengeDtoMethod.js +14 -0
- package/dist/accessi-module/Console/generated/model/twoFactorChallengeDtoMethod.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/twoFactorChallengeDtoTwoFactorRequired.d.ts +13 -0
- package/dist/accessi-module/Console/generated/model/twoFactorChallengeDtoTwoFactorRequired.js +14 -0
- package/dist/accessi-module/Console/generated/model/twoFactorChallengeDtoTwoFactorRequired.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/updateEnabledStatusRequest.d.ts +10 -0
- package/dist/accessi-module/Console/generated/model/updateEnabledStatusRequest.js +9 -0
- package/dist/accessi-module/Console/generated/model/updateEnabledStatusRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/updateFederatedIdentityRequest.d.ts +11 -0
- package/dist/accessi-module/Console/generated/model/updateFederatedIdentityRequest.js +9 -0
- package/dist/accessi-module/Console/generated/model/updateFederatedIdentityRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/updateFederatedProviderRequest.d.ts +12 -0
- package/dist/accessi-module/Console/generated/model/updateFederatedProviderRequest.js +9 -0
- package/dist/accessi-module/Console/generated/model/updateFederatedProviderRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/updateFilterTypeRequest.d.ts +21 -0
- package/dist/accessi-module/Console/generated/model/updateFilterTypeRequest.js +3 -0
- package/dist/accessi-module/Console/generated/model/updateFilterTypeRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/updateFilterTypeRequestFlgEnabled.d.ts +14 -0
- package/dist/accessi-module/Console/generated/model/updateFilterTypeRequestFlgEnabled.js +15 -0
- package/dist/accessi-module/Console/generated/model/updateFilterTypeRequestFlgEnabled.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/updateMenuGroupRequest.d.ts +17 -0
- package/dist/accessi-module/Console/generated/model/updateMenuGroupRequest.js +9 -0
- package/dist/accessi-module/Console/generated/model/updateMenuGroupRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/updateMenuRequest.d.ts +47 -0
- package/dist/accessi-module/Console/generated/model/updateMenuRequest.js +9 -0
- package/dist/accessi-module/Console/generated/model/updateMenuRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/updateMenuTypeRequest.d.ts +13 -0
- package/dist/accessi-module/Console/generated/model/updateMenuTypeRequest.js +9 -0
- package/dist/accessi-module/Console/generated/model/updateMenuTypeRequest.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/userDto.d.ts +88 -0
- package/dist/accessi-module/Console/generated/model/userDto.js +3 -0
- package/dist/accessi-module/Console/generated/model/userDto.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/userDtoStatoRegistrazione.d.ts +18 -0
- package/dist/accessi-module/Console/generated/model/userDtoStatoRegistrazione.js +19 -0
- package/dist/accessi-module/Console/generated/model/userDtoStatoRegistrazione.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/userGrantsDto.d.ts +16 -0
- package/dist/accessi-module/Console/generated/model/userGrantsDto.js +3 -0
- package/dist/accessi-module/Console/generated/model/userGrantsDto.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/userGrantsResponse.d.ts +14 -0
- package/dist/accessi-module/Console/generated/model/userGrantsResponse.js +3 -0
- package/dist/accessi-module/Console/generated/model/userGrantsResponse.js.map +1 -0
- package/dist/accessi-module/Console/generated/model/verifyTwoFactorRequest.d.ts +18 -0
- package/dist/accessi-module/Console/generated/model/verifyTwoFactorRequest.js +9 -0
- package/dist/accessi-module/Console/generated/model/verifyTwoFactorRequest.js.map +1 -0
- package/dist/accessi-module/Console/help.d.ts +13 -0
- package/dist/accessi-module/Console/help.js +355 -0
- package/dist/accessi-module/Console/help.js.map +1 -0
- package/dist/accessi-module/Console/index.html +153 -0
- package/dist/accessi-module/Console/wiki.d.ts +52 -0
- package/dist/accessi-module/Console/wiki.js +731 -0
- package/dist/accessi-module/Console/wiki.js.map +1 -0
- package/dist/accessi-module/Controllers/AccessiConsoleController.d.ts +18 -0
- package/dist/accessi-module/Controllers/AccessiConsoleController.js +111 -0
- package/dist/accessi-module/Controllers/AccessiConsoleController.js.map +1 -0
- package/dist/accessi-module/Controllers/AuthController.d.ts +12 -6
- package/dist/accessi-module/Controllers/AuthController.js +167 -82
- package/dist/accessi-module/Controllers/AuthController.js.map +1 -1
- package/dist/accessi-module/Controllers/ConfiguratorController.d.ts +1 -5
- package/dist/accessi-module/Controllers/ConfiguratorController.js +26 -44
- package/dist/accessi-module/Controllers/ConfiguratorController.js.map +1 -1
- package/dist/accessi-module/Controllers/EmailController.d.ts +4 -6
- package/dist/accessi-module/Controllers/EmailController.js +12 -14
- package/dist/accessi-module/Controllers/EmailController.js.map +1 -1
- package/dist/accessi-module/Controllers/FiltriController.d.ts +5 -4
- package/dist/accessi-module/Controllers/FiltriController.js +125 -6
- package/dist/accessi-module/Controllers/FiltriController.js.map +1 -1
- package/dist/accessi-module/Controllers/PermissionController.d.ts +12 -1
- package/dist/accessi-module/Controllers/PermissionController.js +322 -51
- package/dist/accessi-module/Controllers/PermissionController.js.map +1 -1
- package/dist/accessi-module/Controllers/SchemaController.d.ts +9 -0
- package/dist/accessi-module/Controllers/SchemaController.js +79 -0
- package/dist/accessi-module/Controllers/SchemaController.js.map +1 -0
- package/dist/accessi-module/Controllers/ServiceTokenController.d.ts +23 -0
- package/dist/accessi-module/Controllers/ServiceTokenController.js +176 -0
- package/dist/accessi-module/Controllers/ServiceTokenController.js.map +1 -0
- package/dist/accessi-module/Controllers/UserController.d.ts +8 -4
- package/dist/accessi-module/Controllers/UserController.js +161 -28
- package/dist/accessi-module/Controllers/UserController.js.map +1 -1
- package/dist/accessi-module/Dtos/Abilitazione.js.map +1 -1
- package/dist/accessi-module/Dtos/AbilitazioneMenu.js +16 -8
- package/dist/accessi-module/Dtos/AbilitazioneMenu.js.map +1 -1
- package/dist/accessi-module/Dtos/AdminBootstrapDtos.d.ts +19 -0
- package/dist/accessi-module/Dtos/AdminBootstrapDtos.js +83 -0
- package/dist/accessi-module/Dtos/AdminBootstrapDtos.js.map +1 -0
- package/dist/accessi-module/Dtos/AssignPermissionsToUserRequest.js +0 -1
- package/dist/accessi-module/Dtos/AssignPermissionsToUserRequest.js.map +1 -1
- package/dist/accessi-module/Dtos/AssignRolesToUserRequest.js +1 -2
- package/dist/accessi-module/Dtos/AssignRolesToUserRequest.js.map +1 -1
- package/dist/accessi-module/Dtos/AuthenticatedUserPayloadDto.d.ts +13 -0
- package/dist/accessi-module/Dtos/AuthenticatedUserPayloadDto.js +70 -0
- package/dist/accessi-module/Dtos/AuthenticatedUserPayloadDto.js.map +1 -0
- package/dist/accessi-module/Dtos/BaseResponse.d.ts +22 -0
- package/dist/accessi-module/Dtos/BaseResponse.js +106 -1
- package/dist/accessi-module/Dtos/BaseResponse.js.map +1 -1
- package/dist/accessi-module/Dtos/CatalogDtos.d.ts +64 -0
- package/dist/accessi-module/Dtos/CatalogDtos.js +322 -0
- package/dist/accessi-module/Dtos/CatalogDtos.js.map +1 -0
- package/dist/accessi-module/Dtos/ConfirmResetPasswordRequest.d.ts +3 -0
- package/dist/accessi-module/Dtos/ConfirmResetPasswordRequest.js +31 -0
- package/dist/accessi-module/Dtos/ConfirmResetPasswordRequest.js.map +1 -0
- package/dist/accessi-module/Dtos/FederatedIdentityDtos.d.ts +69 -0
- package/dist/accessi-module/Dtos/FederatedIdentityDtos.js +236 -0
- package/dist/accessi-module/Dtos/FederatedIdentityDtos.js.map +1 -0
- package/dist/accessi-module/Dtos/FiltriUtente.js +5 -1
- package/dist/accessi-module/Dtos/FiltriUtente.js.map +1 -1
- package/dist/accessi-module/Dtos/GetGroupsWithMenusResponse.js +1 -1
- package/dist/accessi-module/Dtos/GetGroupsWithMenusResponse.js.map +1 -1
- package/dist/accessi-module/Dtos/GetMenusResponse.js +1 -1
- package/dist/accessi-module/Dtos/GetMenusResponse.js.map +1 -1
- package/dist/accessi-module/Dtos/GetRolesResponse.js.map +1 -1
- package/dist/accessi-module/Dtos/GetUserByTokenRequest.d.ts +3 -0
- package/dist/accessi-module/Dtos/GetUserByTokenRequest.js +26 -0
- package/dist/accessi-module/Dtos/GetUserByTokenRequest.js.map +1 -0
- package/dist/accessi-module/Dtos/GetUserByTokenResponse.d.ts +5 -0
- package/dist/accessi-module/Dtos/GetUserByTokenResponse.js +27 -0
- package/dist/accessi-module/Dtos/GetUserByTokenResponse.js.map +1 -0
- package/dist/accessi-module/Dtos/GetUsersResponse.d.ts +1 -1
- package/dist/accessi-module/Dtos/GetUsersResponse.js.map +1 -1
- package/dist/accessi-module/Dtos/LoginRequest.d.ts +1 -1
- package/dist/accessi-module/Dtos/LoginRequest.js +3 -2
- package/dist/accessi-module/Dtos/LoginRequest.js.map +1 -1
- package/dist/accessi-module/Dtos/LoginResponse.d.ts +6 -2
- package/dist/accessi-module/Dtos/LoginResponse.js +20 -7
- package/dist/accessi-module/Dtos/LoginResponse.js.map +1 -1
- package/dist/accessi-module/Dtos/MenuItem.js +1 -0
- package/dist/accessi-module/Dtos/Permission.d.ts +1 -0
- package/dist/accessi-module/Dtos/Permission.js +1 -0
- package/dist/accessi-module/Dtos/Permission.js.map +1 -1
- package/dist/accessi-module/Dtos/PublicRegisterRequest.d.ts +5 -0
- package/dist/accessi-module/Dtos/PublicRegisterRequest.js +15 -0
- package/dist/accessi-module/Dtos/PublicRegisterRequest.js.map +1 -0
- package/dist/accessi-module/Dtos/RegisterRequest.d.ts +2 -4
- package/dist/accessi-module/Dtos/RegisterRequest.js +18 -28
- package/dist/accessi-module/Dtos/RegisterRequest.js.map +1 -1
- package/dist/accessi-module/Dtos/RegisterResponse.d.ts +1 -1
- package/dist/accessi-module/Dtos/RegisterResponse.js +3 -3
- package/dist/accessi-module/Dtos/RegisterResponse.js.map +1 -1
- package/dist/accessi-module/Dtos/Role.d.ts +4 -0
- package/dist/accessi-module/Dtos/Role.js +4 -0
- package/dist/accessi-module/Dtos/Role.js.map +1 -1
- package/dist/accessi-module/Dtos/RuoliMenu.js.map +1 -1
- package/dist/accessi-module/Dtos/SchemaDtos.d.ts +19 -0
- package/dist/accessi-module/Dtos/SchemaDtos.js +84 -0
- package/dist/accessi-module/Dtos/SchemaDtos.js.map +1 -0
- package/dist/accessi-module/Dtos/SendResetPasswordEmailRequest.d.ts +4 -0
- package/dist/accessi-module/Dtos/SendResetPasswordEmailRequest.js +36 -0
- package/dist/accessi-module/Dtos/SendResetPasswordEmailRequest.js.map +1 -0
- package/dist/accessi-module/Dtos/ServiceToken.d.ts +34 -0
- package/dist/accessi-module/Dtos/ServiceToken.js +128 -0
- package/dist/accessi-module/Dtos/ServiceToken.js.map +1 -0
- package/dist/accessi-module/Dtos/SetStatoRegistrazione.js.map +1 -1
- package/dist/accessi-module/Dtos/StatoRegistrazione.js.map +1 -1
- package/dist/accessi-module/Dtos/TipoAbilitazione.d.ts +4 -0
- package/dist/accessi-module/Dtos/TipoAbilitazione.js +4 -0
- package/dist/accessi-module/Dtos/TipoAbilitazione.js.map +1 -1
- package/dist/accessi-module/Dtos/TipoFiltro.js.map +1 -1
- package/dist/accessi-module/Dtos/TokenResult.js.map +1 -1
- package/dist/accessi-module/Dtos/TwoFactorDtos.d.ts +13 -0
- package/dist/accessi-module/Dtos/TwoFactorDtos.js +60 -0
- package/dist/accessi-module/Dtos/TwoFactorDtos.js.map +1 -0
- package/dist/accessi-module/Dtos/UpdateEnabledStatusRequest.js.map +1 -1
- package/dist/accessi-module/Dtos/UserDto.d.ts +9 -4
- package/dist/accessi-module/Dtos/UserDto.js +39 -24
- package/dist/accessi-module/Dtos/UserDto.js.map +1 -1
- package/dist/accessi-module/Dtos/UserGrantsDto.js.map +1 -1
- package/dist/accessi-module/Dtos/UserGrantsResponse.d.ts +5 -0
- package/dist/accessi-module/Dtos/UserGrantsResponse.js +27 -0
- package/dist/accessi-module/Dtos/UserGrantsResponse.js.map +1 -0
- package/dist/accessi-module/Dtos/index.d.ts +13 -0
- package/dist/accessi-module/Dtos/index.js +13 -0
- package/dist/accessi-module/Dtos/index.js.map +1 -1
- package/dist/accessi-module/Services/AdminBootstrapService/AdminBootstrapService.d.ts +33 -0
- package/dist/accessi-module/Services/AdminBootstrapService/AdminBootstrapService.js +106 -0
- package/dist/accessi-module/Services/AdminBootstrapService/AdminBootstrapService.js.map +1 -0
- package/dist/accessi-module/Services/AuthService/AuthService.d.ts +40 -5
- package/dist/accessi-module/Services/AuthService/AuthService.js +192 -42
- package/dist/accessi-module/Services/AuthService/AuthService.js.map +1 -1
- package/dist/accessi-module/Services/ConfiguratorService/ConfiguratorService.d.ts +3 -1
- package/dist/accessi-module/Services/ConfiguratorService/ConfiguratorService.js +5 -1
- package/dist/accessi-module/Services/ConfiguratorService/ConfiguratorService.js.map +1 -1
- package/dist/accessi-module/Services/EmailService/EmailService.d.ts +9 -2
- package/dist/accessi-module/Services/EmailService/EmailService.js +47 -22
- package/dist/accessi-module/Services/EmailService/EmailService.js.map +1 -1
- package/dist/accessi-module/Services/FiltriService/FiltriService.d.ts +18 -3
- package/dist/accessi-module/Services/FiltriService/FiltriService.js +92 -16
- package/dist/accessi-module/Services/FiltriService/FiltriService.js.map +1 -1
- package/dist/accessi-module/Services/PermissionService/PermissionService.d.ts +77 -2
- package/dist/accessi-module/Services/PermissionService/PermissionService.js +603 -206
- package/dist/accessi-module/Services/PermissionService/PermissionService.js.map +1 -1
- package/dist/accessi-module/Services/SchemaExportService/SchemaExportService.d.ts +36 -0
- package/dist/accessi-module/Services/SchemaExportService/SchemaExportService.js +125 -0
- package/dist/accessi-module/Services/SchemaExportService/SchemaExportService.js.map +1 -0
- package/dist/accessi-module/Services/ServiceTokenService/ServiceTokenService.d.ts +75 -0
- package/dist/accessi-module/Services/ServiceTokenService/ServiceTokenService.js +265 -0
- package/dist/accessi-module/Services/ServiceTokenService/ServiceTokenService.js.map +1 -0
- package/dist/accessi-module/Services/TwoFactorService/TwoFactorService.d.ts +27 -0
- package/dist/accessi-module/Services/TwoFactorService/TwoFactorService.js +175 -0
- package/dist/accessi-module/Services/TwoFactorService/TwoFactorService.js.map +1 -0
- package/dist/accessi-module/Services/UserService/UserService.d.ts +51 -5
- package/dist/accessi-module/Services/UserService/UserService.js +396 -294
- package/dist/accessi-module/Services/UserService/UserService.js.map +1 -1
- package/dist/accessi-module/Views/reset-password.html +213 -213
- package/dist/accessi-module/accessiRuntime.d.ts +45 -0
- package/dist/accessi-module/accessiRuntime.js +39 -0
- package/dist/accessi-module/accessiRuntime.js.map +1 -0
- package/dist/accessi-module/database-updates/AccessiCatalogMigrator.d.ts +83 -0
- package/dist/accessi-module/database-updates/AccessiCatalogMigrator.js +360 -0
- package/dist/accessi-module/database-updates/AccessiCatalogMigrator.js.map +1 -0
- package/dist/accessi-module/database-updates/AccessiDatabaseUpdater.d.ts +58 -10
- package/dist/accessi-module/database-updates/AccessiDatabaseUpdater.js +506 -179
- package/dist/accessi-module/database-updates/AccessiDatabaseUpdater.js.map +1 -1
- package/dist/accessi-module/database-updates/accessiOptionsFromEnv.d.ts +5 -0
- package/dist/accessi-module/database-updates/accessiOptionsFromEnv.js +79 -0
- package/dist/accessi-module/database-updates/accessiOptionsFromEnv.js.map +1 -0
- package/dist/accessi-module/database-updates/accessiSchema.d.ts +67 -0
- package/dist/accessi-module/database-updates/accessiSchema.js +124 -0
- package/dist/accessi-module/database-updates/accessiSchema.js.map +1 -0
- package/dist/accessi-module/database-updates/optionalColumns.d.ts +7 -0
- package/dist/accessi-module/database-updates/optionalColumns.js +58 -0
- package/dist/accessi-module/database-updates/optionalColumns.js.map +1 -0
- package/dist/accessi-module/database-updates/runAccessiCatalogMigrations.d.ts +1 -0
- package/dist/accessi-module/database-updates/runAccessiCatalogMigrations.js +69 -0
- package/dist/accessi-module/database-updates/runAccessiCatalogMigrations.js.map +1 -0
- package/dist/accessi-module/database-updates/runAccessiDbUpdate.js +15 -53
- package/dist/accessi-module/database-updates/runAccessiDbUpdate.js.map +1 -1
- package/dist/accessi-module/federated-auth/FederatedAuthController.d.ts +24 -0
- package/dist/accessi-module/federated-auth/FederatedAuthController.js +333 -0
- package/dist/accessi-module/federated-auth/FederatedAuthController.js.map +1 -0
- package/dist/accessi-module/federated-auth/FederatedAuthService.d.ts +100 -0
- package/dist/accessi-module/federated-auth/FederatedAuthService.js +451 -0
- package/dist/accessi-module/federated-auth/FederatedAuthService.js.map +1 -0
- package/dist/accessi-module/federated-auth/FederatedAuthTypes.d.ts +53 -0
- package/dist/accessi-module/federated-auth/FederatedAuthTypes.js +3 -0
- package/dist/accessi-module/federated-auth/FederatedAuthTypes.js.map +1 -0
- package/dist/accessi-module/index.d.ts +29 -0
- package/dist/accessi-module/index.js +89 -19
- package/dist/accessi-module/index.js.map +1 -1
- package/dist/accessi-module/jwt/jwt.strategy.d.ts +1 -1
- package/dist/accessi-module/jwt/jwt.strategy.js +16 -7
- package/dist/accessi-module/jwt/jwt.strategy.js.map +1 -1
- package/dist/accessi-module/middleware/accessiRequirements.d.ts +23 -1
- package/dist/accessi-module/middleware/accessiRequirements.js +7 -0
- package/dist/accessi-module/middleware/accessiRequirements.js.map +1 -1
- package/dist/accessi-module/middleware/authenticateGen.d.ts +16 -1
- package/dist/accessi-module/middleware/authenticateGen.js +63 -25
- package/dist/accessi-module/middleware/authenticateGen.js.map +1 -1
- package/dist/accessi-module/security/AccessiHttpExceptionFilter.d.ts +12 -0
- package/dist/accessi-module/security/AccessiHttpExceptionFilter.js +74 -0
- package/dist/accessi-module/security/AccessiHttpExceptionFilter.js.map +1 -0
- package/dist/accessi-module/security/accessControl.d.ts +22 -2
- package/dist/accessi-module/security/accessControl.js +47 -8
- package/dist/accessi-module/security/accessControl.js.map +1 -1
- package/dist/accessi-module/security/accessiValidation.d.ts +9 -0
- package/dist/accessi-module/security/accessiValidation.js +41 -0
- package/dist/accessi-module/security/accessiValidation.js.map +1 -0
- package/dist/accessi-module/security/adminBootstrap.d.ts +8 -0
- package/dist/accessi-module/security/adminBootstrap.js +41 -0
- package/dist/accessi-module/security/adminBootstrap.js.map +1 -0
- package/dist/accessi-module/security/authenticatedToken.d.ts +16 -2
- package/dist/accessi-module/security/authenticatedToken.js +31 -4
- package/dist/accessi-module/security/authenticatedToken.js.map +1 -1
- package/dist/accessi-module/security/emailConfiguration.d.ts +20 -0
- package/dist/accessi-module/security/emailConfiguration.js +41 -0
- package/dist/accessi-module/security/emailConfiguration.js.map +1 -0
- package/dist/accessi-module/security/passwordResetToken.d.ts +13 -3
- package/dist/accessi-module/security/passwordResetToken.js +13 -5
- package/dist/accessi-module/security/passwordResetToken.js.map +1 -1
- package/dist/accessi-module/security/publicAuthRateLimit.d.ts +3 -3
- package/dist/accessi-module/security/publicAuthRateLimit.js +31 -8
- package/dist/accessi-module/security/publicAuthRateLimit.js.map +1 -1
- package/dist/accessi-module/security/serviceTokenGuard.d.ts +25 -0
- package/dist/accessi-module/security/serviceTokenGuard.js +85 -0
- package/dist/accessi-module/security/serviceTokenGuard.js.map +1 -0
- package/dist/accessi-module/security/serviceTokenRateLimit.d.ts +8 -0
- package/dist/accessi-module/security/serviceTokenRateLimit.js +49 -0
- package/dist/accessi-module/security/serviceTokenRateLimit.js.map +1 -0
- package/dist/accessi-module/startupLog.d.ts +6 -0
- package/dist/accessi-module/startupLog.js +25 -0
- package/dist/accessi-module/startupLog.js.map +1 -0
- package/dist/allegati-module/AllegatiModule.d.ts +12 -1
- package/dist/allegati-module/AllegatiModule.js +11 -1
- package/dist/allegati-module/AllegatiModule.js.map +1 -1
- package/dist/allegati-module/Controllers/AllegatiController.d.ts +2 -1
- package/dist/allegati-module/Controllers/AllegatiController.js +23 -15
- package/dist/allegati-module/Controllers/AllegatiController.js.map +1 -1
- package/dist/allegati-module/Dtos/AllegatoDto.js.map +1 -1
- package/dist/allegati-module/Dtos/BaseResponse.js.map +1 -1
- package/dist/allegati-module/Dtos/UploadSingleFileRequest.js.map +1 -1
- package/dist/allegati-module/Dtos/index.js.map +1 -1
- package/dist/allegati-module/Dtos/responses/DownloadAllegatoResponseDto.js.map +1 -1
- package/dist/allegati-module/Dtos/responses/GetListResponse.js.map +1 -1
- package/dist/allegati-module/Dtos/responses/UploadAllegatoResponseDto.js.map +1 -1
- package/dist/allegati-module/Services/AllegatiService/AllegatiService.d.ts +10 -3
- package/dist/allegati-module/Services/AllegatiService/AllegatiService.js +150 -101
- package/dist/allegati-module/Services/AllegatiService/AllegatiService.js.map +1 -1
- package/dist/allegati-module/index.js.map +1 -1
- package/dist/allegati-module/security/allegatiAuthorizationGuard.d.ts +14 -0
- package/dist/allegati-module/security/allegatiAuthorizationGuard.js +70 -0
- package/dist/allegati-module/security/allegatiAuthorizationGuard.js.map +1 -0
- package/dist/autobind.d.ts +10 -3
- package/dist/autobind.js +24 -9
- package/dist/autobind.js.map +1 -1
- package/dist/emilsoftware-utilities-2.0.0-dev.41.tgz +0 -0
- package/dist/firebird-compat.d.ts +27 -6
- package/dist/firebird-compat.js +150 -135
- package/dist/firebird-compat.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/initEmilsoftwareModule.js +13 -3
- package/dist/initEmilsoftwareModule.js.map +1 -1
- package/dist/scripts/generateAccessiOpenApi.d.ts +1 -0
- package/dist/scripts/generateAccessiOpenApi.js +57 -0
- package/dist/scripts/generateAccessiOpenApi.js.map +1 -0
- package/dist/scripts/generateAccessiWiki.d.ts +1 -0
- package/dist/scripts/generateAccessiWiki.js +131 -0
- package/dist/scripts/generateAccessiWiki.js.map +1 -0
- package/dist/swagger/SwaggerConfig.d.ts +7 -1
- package/dist/swagger/SwaggerConfig.js +22 -8
- package/dist/swagger/SwaggerConfig.js.map +1 -1
- package/package.json +105 -83
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.AllegatiAuthorizationGuard = void 0;
|
|
25
|
+
const common_1 = require("@nestjs/common");
|
|
26
|
+
/**
|
|
27
|
+
* Guard opt-in per i controller Allegati.
|
|
28
|
+
*
|
|
29
|
+
* Senza `authorize` configurato nelle `AllegatiOptions` il guard e un no-op, cosi da
|
|
30
|
+
* preservare la retrocompatibilita. Quando configurato, delega la decisione
|
|
31
|
+
* all'applicazione host (tipicamente il controllo di autenticazione/ownership).
|
|
32
|
+
*/
|
|
33
|
+
let AllegatiAuthorizationGuard = class AllegatiAuthorizationGuard {
|
|
34
|
+
constructor(options) {
|
|
35
|
+
this.options = options;
|
|
36
|
+
}
|
|
37
|
+
canActivate(context) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
// Opt-out esplicito: ripristina il comportamento storico (endpoint aperti).
|
|
41
|
+
if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.requireAuthorization) === false) {
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
const authorize = (_b = this.options) === null || _b === void 0 ? void 0 : _b.authorize;
|
|
45
|
+
if (!authorize) {
|
|
46
|
+
// Secure by default: senza un controllo configurato l'accesso e negato.
|
|
47
|
+
throw new common_1.ForbiddenException({
|
|
48
|
+
code: 'ALLEGATI_AUTHORIZATION_NOT_CONFIGURED',
|
|
49
|
+
message: 'Allegati: nessun controllo di autorizzazione configurato. Definire allegatiOptions.authorize oppure impostare requireAuthorization: false per il comportamento storico.',
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
const request = context.switchToHttp().getRequest();
|
|
53
|
+
const allowed = yield authorize(request);
|
|
54
|
+
if (!allowed) {
|
|
55
|
+
throw new common_1.ForbiddenException({
|
|
56
|
+
code: 'ALLEGATI_FORBIDDEN',
|
|
57
|
+
message: 'Operazione non autorizzata.',
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return true;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
exports.AllegatiAuthorizationGuard = AllegatiAuthorizationGuard;
|
|
65
|
+
exports.AllegatiAuthorizationGuard = AllegatiAuthorizationGuard = __decorate([
|
|
66
|
+
(0, common_1.Injectable)(),
|
|
67
|
+
__param(0, (0, common_1.Inject)('ALLEGATI_OPTIONS')),
|
|
68
|
+
__metadata("design:paramtypes", [Object])
|
|
69
|
+
], AllegatiAuthorizationGuard);
|
|
70
|
+
//# sourceMappingURL=allegatiAuthorizationGuard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allegatiAuthorizationGuard.js","sourceRoot":"","sources":["../../../src/allegati-module/security/allegatiAuthorizationGuard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAuG;AAIvG;;;;;;GAMG;AAEI,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IACnC,YAAyD,OAAwB;QAAxB,YAAO,GAAP,OAAO,CAAiB;IAAG,CAAC;IAE/E,WAAW,CAAC,OAAyB;;;YACvC,4EAA4E;YAC5E,IAAI,CAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,oBAAoB,MAAK,KAAK,EAAE,CAAC;gBAC/C,OAAO,IAAI,CAAC;YAChB,CAAC;YAED,MAAM,SAAS,GAAG,MAAA,IAAI,CAAC,OAAO,0CAAE,SAAS,CAAC;YAC1C,IAAI,CAAC,SAAS,EAAE,CAAC;gBACb,wEAAwE;gBACxE,MAAM,IAAI,2BAAkB,CAAC;oBACzB,IAAI,EAAE,uCAAuC;oBAC7C,OAAO,EAAE,yKAAyK;iBACrL,CAAC,CAAC;YACP,CAAC;YAED,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAW,CAAC;YAC7D,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,CAAC;YACzC,IAAI,CAAC,OAAO,EAAE,CAAC;gBACX,MAAM,IAAI,2BAAkB,CAAC;oBACzB,IAAI,EAAE,oBAAoB;oBAC1B,OAAO,EAAE,6BAA6B;iBACzC,CAAC,CAAC;YACP,CAAC;YAED,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;CACJ,CAAA;AA7BY,gEAA0B;qCAA1B,0BAA0B;IADtC,IAAA,mBAAU,GAAE;IAEI,WAAA,IAAA,eAAM,EAAC,kBAAkB,CAAC,CAAA;;GAD9B,0BAA0B,CA6BtC","sourcesContent":["import { CanActivate, ExecutionContext, ForbiddenException, Inject, Injectable } from \"@nestjs/common\";\nimport type { Request } from \"express\";\nimport type { AllegatiOptions } from \"../AllegatiModule\";\n\n/**\n * Guard opt-in per i controller Allegati.\n *\n * Senza `authorize` configurato nelle `AllegatiOptions` il guard e un no-op, cosi da\n * preservare la retrocompatibilita. Quando configurato, delega la decisione\n * all'applicazione host (tipicamente il controllo di autenticazione/ownership).\n */\n@Injectable()\nexport class AllegatiAuthorizationGuard implements CanActivate {\n constructor(@Inject('ALLEGATI_OPTIONS') private readonly options: AllegatiOptions) {}\n\n async canActivate(context: ExecutionContext): Promise<boolean> {\n // Opt-out esplicito: ripristina il comportamento storico (endpoint aperti).\n if (this.options?.requireAuthorization === false) {\n return true;\n }\n\n const authorize = this.options?.authorize;\n if (!authorize) {\n // Secure by default: senza un controllo configurato l'accesso e negato.\n throw new ForbiddenException({\n code: 'ALLEGATI_AUTHORIZATION_NOT_CONFIGURED',\n message: 'Allegati: nessun controllo di autorizzazione configurato. Definire allegatiOptions.authorize oppure impostare requireAuthorization: false per il comportamento storico.',\n });\n }\n\n const request = context.switchToHttp().getRequest<Request>();\n const allowed = await authorize(request);\n if (!allowed) {\n throw new ForbiddenException({\n code: 'ALLEGATI_FORBIDDEN',\n message: 'Operazione non autorizzata.',\n });\n }\n\n return true;\n }\n}\n"]}
|
package/dist/autobind.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
type AutobindConstructor = new (...args: never[]) => object;
|
|
2
|
+
/**
|
|
3
|
+
* Class decorator that binds every prototype method to the instance.
|
|
4
|
+
*
|
|
5
|
+
* Uses `Reflect.construct` instead of a class-expression mixin because
|
|
6
|
+
* TypeScript requires mixin constructors to use `any[]`, which this codebase
|
|
7
|
+
* avoids.
|
|
8
|
+
*/
|
|
9
|
+
export declare function autobind<T extends AutobindConstructor>(constructor: T): T;
|
|
10
|
+
export {};
|
package/dist/autobind.js
CHANGED
|
@@ -1,17 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.autobind = autobind;
|
|
4
|
+
/**
|
|
5
|
+
* Class decorator that binds every prototype method to the instance.
|
|
6
|
+
*
|
|
7
|
+
* Uses `Reflect.construct` instead of a class-expression mixin because
|
|
8
|
+
* TypeScript requires mixin constructors to use `any[]`, which this codebase
|
|
9
|
+
* avoids.
|
|
10
|
+
*/
|
|
4
11
|
function autobind(constructor) {
|
|
5
|
-
|
|
6
|
-
constructor
|
|
7
|
-
|
|
8
|
-
Object.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
const boundConstructor = function (...args) {
|
|
13
|
+
const instance = Reflect.construct(constructor, args);
|
|
14
|
+
Object.getOwnPropertyNames(constructor.prototype).forEach(key => {
|
|
15
|
+
const descriptor = Object.getOwnPropertyDescriptor(constructor.prototype, key);
|
|
16
|
+
if (descriptor && typeof descriptor.value === 'function' && key !== 'constructor') {
|
|
17
|
+
const method = instance[key];
|
|
18
|
+
if (typeof method === 'function') {
|
|
19
|
+
instance[key] = method.bind(instance);
|
|
12
20
|
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
return instance;
|
|
15
24
|
};
|
|
25
|
+
// Mirror `class extends`: the constructor's prototype chain must point at the
|
|
26
|
+
// original class so reflect-metadata (design:paramtypes) stays reachable and
|
|
27
|
+
// NestJS dependency injection keeps working.
|
|
28
|
+
Object.setPrototypeOf(boundConstructor, constructor);
|
|
29
|
+
boundConstructor.prototype = constructor.prototype;
|
|
30
|
+
return boundConstructor;
|
|
16
31
|
}
|
|
17
32
|
//# sourceMappingURL=autobind.js.map
|
package/dist/autobind.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autobind.js","sourceRoot":"","sources":["../src/autobind.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"autobind.js","sourceRoot":"","sources":["../src/autobind.ts"],"names":[],"mappings":";;AASA,4BAuBC;AA9BD;;;;;;GAMG;AACH,SAAgB,QAAQ,CAAgC,WAAc;IAClE,MAAM,gBAAgB,GAAG,UAAyB,GAAG,IAAe;QAChE,MAAM,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,CAA4B,CAAC;QAEjF,MAAM,CAAC,mBAAmB,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC5D,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,WAAW,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;YAC/E,IAAI,UAAU,IAAI,OAAO,UAAU,CAAC,KAAK,KAAK,UAAU,IAAI,GAAG,KAAK,aAAa,EAAE,CAAC;gBAChF,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;gBAC7B,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE,CAAC;oBAC/B,QAAQ,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBAC1C,CAAC;YACL,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;IACpB,CAAC,CAAC;IAEF,8EAA8E;IAC9E,6EAA6E;IAC7E,6CAA6C;IAC7C,MAAM,CAAC,cAAc,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC;IACrD,gBAAgB,CAAC,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC;IACnD,OAAO,gBAAgC,CAAC;AAC5C,CAAC","sourcesContent":["type AutobindConstructor = new (...args: never[]) => object;\n\n/**\n * Class decorator that binds every prototype method to the instance.\n *\n * Uses `Reflect.construct` instead of a class-expression mixin because\n * TypeScript requires mixin constructors to use `any[]`, which this codebase\n * avoids.\n */\nexport function autobind<T extends AutobindConstructor>(constructor: T): T {\n const boundConstructor = function (this: unknown, ...args: unknown[]): object {\n const instance = Reflect.construct(constructor, args) as Record<string, unknown>;\n\n Object.getOwnPropertyNames(constructor.prototype).forEach(key => {\n const descriptor = Object.getOwnPropertyDescriptor(constructor.prototype, key);\n if (descriptor && typeof descriptor.value === 'function' && key !== 'constructor') {\n const method = instance[key];\n if (typeof method === 'function') {\n instance[key] = method.bind(instance);\n }\n }\n });\n\n return instance;\n };\n\n // Mirror `class extends`: the constructor's prototype chain must point at the\n // original class so reflect-metadata (design:paramtypes) stays reachable and\n // NestJS dependency injection keeps working.\n Object.setPrototypeOf(boundConstructor, constructor);\n boundConstructor.prototype = constructor.prototype;\n return boundConstructor as unknown as T;\n}\n"]}
|
|
Binary file
|
|
@@ -1,17 +1,38 @@
|
|
|
1
|
-
import { Options } from "
|
|
1
|
+
import type { Options } from "node-firebird";
|
|
2
2
|
export type FirebirdWireCryptMode = "disabled" | "enabled" | "required";
|
|
3
|
-
export type FirebirdAuthPlugin = "Legacy_Auth" | "Srp" | "Srp256";
|
|
3
|
+
export type FirebirdAuthPlugin = "Legacy_Auth" | "Srp" | "Srp256" | "Srp384" | "Srp512";
|
|
4
|
+
export type FirebirdDriverStrategy = "modern";
|
|
4
5
|
export type FirebirdOptions = Options & {
|
|
5
|
-
wireCrypt?: FirebirdWireCryptMode;
|
|
6
|
+
wireCrypt?: FirebirdWireCryptMode | number;
|
|
6
7
|
pluginName?: FirebirdAuthPlugin;
|
|
7
8
|
authPlugins?: FirebirdAuthPlugin[];
|
|
8
9
|
connectTimeoutMs?: number;
|
|
9
|
-
connectTimeout?: number;
|
|
10
10
|
compatibilityProbeTimeoutMs?: number;
|
|
11
11
|
compatibilityTotalTimeoutMs?: number;
|
|
12
|
+
firebirdDriver?: FirebirdDriverStrategy;
|
|
13
|
+
trimStringResults?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* When `true`, query parameters are interpolated into the logged SQL. Off by
|
|
16
|
+
* default so that secrets, credentials and personal data are not written to
|
|
17
|
+
* the console or to the daily log files.
|
|
18
|
+
*/
|
|
19
|
+
logQueryParameters?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* When greater than zero, enables an opt-in connection pool of the given
|
|
22
|
+
* maximum size for this connection target instead of attaching/detaching a
|
|
23
|
+
* physical connection for every query. Default `0` keeps the historic
|
|
24
|
+
* one-connection-per-query behaviour.
|
|
25
|
+
*/
|
|
26
|
+
poolSize?: number;
|
|
27
|
+
};
|
|
28
|
+
type FirebirdErrorContext = {
|
|
29
|
+
stage: "attach" | "query" | "execute" | "transaction";
|
|
30
|
+
sql?: string;
|
|
12
31
|
};
|
|
13
32
|
export declare function normalizeFirebirdOptions(options: Options): FirebirdOptions;
|
|
14
|
-
export declare function buildFirebirdCompatibilityCandidates(options: Options): FirebirdOptions[];
|
|
15
|
-
export declare function shouldRetryFirebirdCompatibility(error: unknown): boolean;
|
|
16
33
|
export declare function describeFirebirdCompatibilityOptions(options: Options): string;
|
|
34
|
+
export declare function enhanceFirebirdError(error: unknown, options: Options, context: FirebirdErrorContext): Error;
|
|
35
|
+
export declare function buildFirebirdCompatibilityCandidates(options: Options): FirebirdOptions[];
|
|
36
|
+
export declare function shouldRetryFirebirdCompatibility(): boolean;
|
|
17
37
|
export declare function ensureEsNodeFirebirdCompatibilityPatch(): void;
|
|
38
|
+
export {};
|
package/dist/firebird-compat.js
CHANGED
|
@@ -32,173 +32,188 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
36
|
+
var t = {};
|
|
37
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
38
|
+
t[p] = s[p];
|
|
39
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
40
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
41
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
42
|
+
t[p[i]] = s[p[i]];
|
|
43
|
+
}
|
|
44
|
+
return t;
|
|
45
|
+
};
|
|
35
46
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
47
|
exports.normalizeFirebirdOptions = normalizeFirebirdOptions;
|
|
48
|
+
exports.describeFirebirdCompatibilityOptions = describeFirebirdCompatibilityOptions;
|
|
49
|
+
exports.enhanceFirebirdError = enhanceFirebirdError;
|
|
37
50
|
exports.buildFirebirdCompatibilityCandidates = buildFirebirdCompatibilityCandidates;
|
|
38
51
|
exports.shouldRetryFirebirdCompatibility = shouldRetryFirebirdCompatibility;
|
|
39
|
-
exports.describeFirebirdCompatibilityOptions = describeFirebirdCompatibilityOptions;
|
|
40
52
|
exports.ensureEsNodeFirebirdCompatibilityPatch = ensureEsNodeFirebirdCompatibilityPatch;
|
|
41
|
-
const Firebird = __importStar(require("
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const WIRE_CRYPT_DISABLE = 0;
|
|
46
|
-
const WIRE_CRYPT_ENABLE = 1;
|
|
47
|
-
const WIRE_CRYPT_REQUIRED = 2;
|
|
48
|
-
const DEFAULT_AUTH_PLUGIN_LIST = ["Srp256", "Srp", "Legacy_Auth"];
|
|
53
|
+
const Firebird = __importStar(require("node-firebird"));
|
|
54
|
+
function isBlank(value) {
|
|
55
|
+
return value === undefined || value === null || (typeof value === "string" && value.trim() === "");
|
|
56
|
+
}
|
|
49
57
|
function normalizeWireCryptMode(value) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
return "required";
|
|
58
|
+
if (isBlank(value)) {
|
|
59
|
+
return undefined;
|
|
53
60
|
}
|
|
61
|
+
if (typeof value === "number") {
|
|
62
|
+
return value;
|
|
63
|
+
}
|
|
64
|
+
const normalized = String(value).trim().toLowerCase();
|
|
54
65
|
if (normalized === "disabled") {
|
|
55
|
-
return
|
|
66
|
+
return Firebird.WIRE_CRYPT_DISABLE;
|
|
56
67
|
}
|
|
57
|
-
return
|
|
68
|
+
return Firebird.WIRE_CRYPT_ENABLE;
|
|
58
69
|
}
|
|
59
70
|
function normalizeAuthPlugin(value) {
|
|
60
|
-
|
|
61
|
-
|
|
71
|
+
if (isBlank(value)) {
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
const normalized = String(value).trim().toLowerCase();
|
|
75
|
+
if (normalized === "legacy" || normalized === "legacy_auth") {
|
|
62
76
|
return "Legacy_Auth";
|
|
63
77
|
}
|
|
64
78
|
if (normalized === "srp256") {
|
|
65
79
|
return "Srp256";
|
|
66
80
|
}
|
|
81
|
+
if (normalized === "srp384") {
|
|
82
|
+
return "Srp384";
|
|
83
|
+
}
|
|
84
|
+
if (normalized === "srp512") {
|
|
85
|
+
return "Srp512";
|
|
86
|
+
}
|
|
67
87
|
return "Srp";
|
|
68
88
|
}
|
|
69
|
-
function
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
89
|
+
function formatWireCryptValue(value) {
|
|
90
|
+
if (isBlank(value)) {
|
|
91
|
+
return "auto";
|
|
92
|
+
}
|
|
93
|
+
if (typeof value === "number") {
|
|
94
|
+
if (value === Firebird.WIRE_CRYPT_DISABLE) {
|
|
95
|
+
return "disabled";
|
|
96
|
+
}
|
|
97
|
+
if (value === Firebird.WIRE_CRYPT_ENABLE) {
|
|
98
|
+
return "enabled";
|
|
99
|
+
}
|
|
100
|
+
return String(value);
|
|
77
101
|
}
|
|
102
|
+
return String(value);
|
|
78
103
|
}
|
|
79
|
-
function
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
const normalized = value
|
|
84
|
-
.map((entry) => normalizeAuthPlugin(entry))
|
|
85
|
-
.filter((entry, index, source) => source.indexOf(entry) === index);
|
|
86
|
-
return normalized.length > 0 ? normalized : [...DEFAULT_AUTH_PLUGIN_LIST];
|
|
104
|
+
function formatTarget(options) {
|
|
105
|
+
var _a, _b, _c;
|
|
106
|
+
return `${(_a = options.host) !== null && _a !== void 0 ? _a : "?"}:${(_b = options.port) !== null && _b !== void 0 ? _b : "?"} -> ${(_c = options.database) !== null && _c !== void 0 ? _c : "?"}`;
|
|
87
107
|
}
|
|
88
|
-
function
|
|
89
|
-
|
|
90
|
-
return Object.assign(Object.assign({}, options), { wireCrypt: normalizeWireCryptMode(compatibilityOptions.wireCrypt), pluginName: normalizeAuthPlugin(compatibilityOptions.pluginName), authPlugins: normalizeAuthPluginList(compatibilityOptions.authPlugins) });
|
|
108
|
+
function uniqueDiagnostics(values) {
|
|
109
|
+
return values.filter((value, index) => values.indexOf(value) === index);
|
|
91
110
|
}
|
|
92
|
-
function
|
|
93
|
-
var _a, _b;
|
|
94
|
-
const message = String((_b = (_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error) !== null && _b !== void 0 ? _b : "").toLowerCase();
|
|
95
|
-
return message.includes("incompatible wire encryption")
|
|
96
|
-
|| message.includes("no matching plugins on server")
|
|
97
|
-
|| message.includes("unknown auth plugin")
|
|
98
|
-
|| message.includes("unknow auth plugin")
|
|
99
|
-
|| message.includes("timeout during firebird attach");
|
|
100
|
-
}
|
|
101
|
-
function pushUniqueCandidate(target, candidate) {
|
|
111
|
+
function buildDiagnostics(message, options) {
|
|
102
112
|
var _a;
|
|
103
|
-
const
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
113
|
+
const diagnostics = [];
|
|
114
|
+
const pluginMismatch = message.match(/Server don't accept plugin\s*:\s*([^,]+),\s*but support\s*:\s*(.+)$/i);
|
|
115
|
+
if (pluginMismatch) {
|
|
116
|
+
const supportedPlugins = ((_a = pluginMismatch[2]) !== null && _a !== void 0 ? _a : "")
|
|
117
|
+
.split(",")
|
|
118
|
+
.map((plugin) => plugin.trim())
|
|
119
|
+
.filter((plugin) => plugin.length > 0);
|
|
120
|
+
const supportedMessage = supportedPlugins.length === 1
|
|
121
|
+
? `The server explicitly reported that only the "${supportedPlugins[0]}" authentication plugin is supported.`
|
|
122
|
+
: `The server explicitly reported the supported authentication plugins: ${supportedPlugins.join(", ")}.`;
|
|
123
|
+
diagnostics.push(supportedMessage);
|
|
124
|
+
}
|
|
125
|
+
if (/Incompatible wire encryption levels requested on client and server/i.test(message)) {
|
|
126
|
+
diagnostics.push("The server rejected the requested wire encryption mode. Keep wire encryption auto-enabled unless the server is known to allow disabled encryption.");
|
|
127
|
+
}
|
|
128
|
+
if (/No matching plugins on server/i.test(message)) {
|
|
129
|
+
diagnostics.push("The server did not find a common authentication plugin with the client configuration.");
|
|
130
|
+
}
|
|
131
|
+
if (/Connection timeout after \d+ms/i.test(message) || /Timeout during Firebird attach after \d+ ms/i.test(message)) {
|
|
132
|
+
diagnostics.push("The TCP connection was accepted but the Firebird wire-protocol attach did not complete in time.");
|
|
112
133
|
}
|
|
134
|
+
if (options.pluginName) {
|
|
135
|
+
diagnostics.push(`Client authentication plugin was forced to "${options.pluginName}". Leave pluginName empty to let the driver auto-negotiate when possible.`);
|
|
136
|
+
}
|
|
137
|
+
if (!isBlank(options.wireCrypt)) {
|
|
138
|
+
diagnostics.push(`Client wire encryption was forced to "${formatWireCryptValue(options.wireCrypt)}".`);
|
|
139
|
+
}
|
|
140
|
+
return uniqueDiagnostics(diagnostics);
|
|
113
141
|
}
|
|
114
|
-
function
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
142
|
+
function copyFirebirdMetadata(target, source) {
|
|
143
|
+
if (!source || typeof source !== "object") {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
const firebirdSource = source;
|
|
147
|
+
if ("gdscode" in firebirdSource) {
|
|
148
|
+
target.gdscode = firebirdSource.gdscode;
|
|
149
|
+
}
|
|
150
|
+
if ("gdsparams" in firebirdSource) {
|
|
151
|
+
target.gdsparams = firebirdSource.gdsparams;
|
|
152
|
+
}
|
|
118
153
|
}
|
|
119
|
-
function
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
const
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
appendPluginCandidates(candidates, normalized, "Srp256", [normalized.wireCrypt]);
|
|
138
|
-
appendPluginCandidates(candidates, normalized, "Srp", [normalized.wireCrypt]);
|
|
139
|
-
appendPluginCandidates(candidates, normalized, "Legacy_Auth", [normalized.wireCrypt]);
|
|
140
|
-
return candidates;
|
|
141
|
-
}
|
|
142
|
-
appendPluginCandidates(candidates, normalized, "Srp256", ["enabled", "required", "disabled"]);
|
|
143
|
-
appendPluginCandidates(candidates, normalized, "Srp", ["enabled", "required", "disabled"]);
|
|
144
|
-
appendPluginCandidates(candidates, normalized, "Legacy_Auth", ["disabled", "enabled"]);
|
|
145
|
-
return candidates;
|
|
154
|
+
function formatFirebirdMetadata(source) {
|
|
155
|
+
if (!source || typeof source !== "object") {
|
|
156
|
+
return "";
|
|
157
|
+
}
|
|
158
|
+
const firebirdSource = source;
|
|
159
|
+
const metadata = [];
|
|
160
|
+
if (typeof firebirdSource.gdscode === "number") {
|
|
161
|
+
metadata.push(`gdscode=${firebirdSource.gdscode}`);
|
|
162
|
+
}
|
|
163
|
+
if (firebirdSource.gdsparams !== undefined) {
|
|
164
|
+
try {
|
|
165
|
+
metadata.push(`gdsparams=${JSON.stringify(firebirdSource.gdsparams)}`);
|
|
166
|
+
}
|
|
167
|
+
catch (_a) {
|
|
168
|
+
metadata.push(`gdsparams=${String(firebirdSource.gdsparams)}`);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return metadata.length > 0 ? ` Metadata: ${metadata.join(", ")}.` : "";
|
|
146
172
|
}
|
|
147
|
-
function
|
|
148
|
-
|
|
173
|
+
function normalizeFirebirdOptions(options) {
|
|
174
|
+
var _a, _b;
|
|
175
|
+
const compatibilityOptions = options;
|
|
176
|
+
const { authPlugins: _authPlugins, compatibilityProbeTimeoutMs: _compatibilityProbeTimeoutMs, compatibilityTotalTimeoutMs, connectTimeoutMs, firebirdDriver: _firebirdDriver, logQueryParameters: _logQueryParameters, poolSize: _poolSize, trimStringResults } = compatibilityOptions, baseOptions = __rest(compatibilityOptions, ["authPlugins", "compatibilityProbeTimeoutMs", "compatibilityTotalTimeoutMs", "connectTimeoutMs", "firebirdDriver", "logQueryParameters", "poolSize", "trimStringResults"]);
|
|
177
|
+
const normalizedOptions = Object.assign(Object.assign({}, baseOptions), { pluginName: normalizeAuthPlugin(compatibilityOptions.pluginName), trimStringResults, wireCrypt: normalizeWireCryptMode(compatibilityOptions.wireCrypt) });
|
|
178
|
+
const timeoutCandidate = (_b = (_a = compatibilityOptions.connectTimeout) !== null && _a !== void 0 ? _a : connectTimeoutMs) !== null && _b !== void 0 ? _b : compatibilityTotalTimeoutMs;
|
|
179
|
+
if (Number.isFinite(timeoutCandidate) && Number(timeoutCandidate) > 0) {
|
|
180
|
+
normalizedOptions.connectTimeout = Math.trunc(Number(timeoutCandidate));
|
|
181
|
+
}
|
|
182
|
+
return normalizedOptions;
|
|
149
183
|
}
|
|
150
184
|
function describeFirebirdCompatibilityOptions(options) {
|
|
151
|
-
var _a;
|
|
185
|
+
var _a, _b;
|
|
152
186
|
const normalized = normalizeFirebirdOptions(options);
|
|
153
|
-
return `plugin=${normalized.pluginName}, wireCrypt=${normalized.wireCrypt},
|
|
187
|
+
return `plugin=${(_a = normalized.pluginName) !== null && _a !== void 0 ? _a : "auto"}, wireCrypt=${formatWireCryptValue(normalized.wireCrypt)}, connectTimeout=${(_b = normalized.connectTimeout) !== null && _b !== void 0 ? _b : "default"}`;
|
|
154
188
|
}
|
|
155
|
-
function
|
|
189
|
+
function enhanceFirebirdError(error, options, context) {
|
|
156
190
|
var _a;
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
if (!(connectionPrototype === null || connectionPrototype === void 0 ? void 0 : connectionPrototype.connect) || connectionPrototype.__emilsoftwareWireCryptPatched) {
|
|
160
|
-
return;
|
|
191
|
+
if (error instanceof Error && error.__emilsoftwareFirebirdEnhanced) {
|
|
192
|
+
return error;
|
|
161
193
|
}
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
return originalAddString.call(this, code, authPlugin, encoding);
|
|
187
|
-
}
|
|
188
|
-
if (code === CNCT_PLUGIN_LIST) {
|
|
189
|
-
return originalAddString.call(this, code, authPlugins.join(","), encoding);
|
|
190
|
-
}
|
|
191
|
-
return originalAddString.call(this, code, value, encoding);
|
|
192
|
-
};
|
|
193
|
-
try {
|
|
194
|
-
return originalConnect.call(this, patchedOptions, callback);
|
|
195
|
-
}
|
|
196
|
-
finally {
|
|
197
|
-
blr.addBytes = originalAddBytes;
|
|
198
|
-
blr.addString = originalAddString;
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
connectionPrototype.__emilsoftwareWireCryptPatched = true;
|
|
194
|
+
const normalizedOptions = normalizeFirebirdOptions(options);
|
|
195
|
+
const target = formatTarget(normalizedOptions);
|
|
196
|
+
const original = error instanceof Error ? error : new Error(String(error));
|
|
197
|
+
const diagnostics = buildDiagnostics(original.message, normalizedOptions);
|
|
198
|
+
const sqlSuffix = context.sql ? ` SQL: ${context.sql.replace(/\s+/g, " ").trim()}` : "";
|
|
199
|
+
const diagnosticsSuffix = diagnostics.length > 0 ? ` Diagnostics: ${diagnostics.join(" ")}` : "";
|
|
200
|
+
const metadataSuffix = formatFirebirdMetadata(original);
|
|
201
|
+
const enhanced = new Error(`Firebird ${context.stage} failed on ${target}: ${original.message}.${diagnosticsSuffix}${metadataSuffix}${sqlSuffix}`);
|
|
202
|
+
enhanced.cause = original;
|
|
203
|
+
enhanced.__emilsoftwareFirebirdEnhanced = true;
|
|
204
|
+
copyFirebirdMetadata(enhanced, original);
|
|
205
|
+
enhanced.stack = `${enhanced.name}: ${enhanced.message}\nCaused by: ${(_a = original.stack) !== null && _a !== void 0 ? _a : original.message}`;
|
|
206
|
+
return enhanced;
|
|
207
|
+
}
|
|
208
|
+
function buildFirebirdCompatibilityCandidates(options) {
|
|
209
|
+
return [normalizeFirebirdOptions(options)];
|
|
210
|
+
}
|
|
211
|
+
function shouldRetryFirebirdCompatibility() {
|
|
212
|
+
return false;
|
|
213
|
+
}
|
|
214
|
+
function ensureEsNodeFirebirdCompatibilityPatch() {
|
|
215
|
+
// No-op kept for backward compatibility. The library now relies on the
|
|
216
|
+
// official node-firebird driver, which handles Firebird 2.5+ protocol
|
|
217
|
+
// negotiation natively.
|
|
202
218
|
}
|
|
203
|
-
ensureEsNodeFirebirdCompatibilityPatch();
|
|
204
219
|
//# sourceMappingURL=firebird-compat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firebird-compat.js","sourceRoot":"","sources":["../src/firebird-compat.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgGA,4DAQC;AAmCD,oFAiCC;AAED,4EAEC;AAED,oFAGC;AAED,wFA+DC;AAtPD,2DAA6C;AAgB7C,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAC5B,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAC7B,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAC7B,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAC5B,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAC9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CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;QAC/D,CAAC,CAAC;QAEF,IAAI,CAAC;YACD,OAAO,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC;QAChE,CAAC;gBAAS,CAAC;YACP,GAAG,CAAC,QAAQ,GAAG,gBAAgB,CAAC;YAChC,GAAG,CAAC,SAAS,GAAG,iBAAiB,CAAC;QACtC,CAAC;IACL,CAAC,CAAC;IAEF,mBAAmB,CAAC,8BAA8B,GAAG,IAAI,CAAC;AAC9D,CAAC;AAED,sCAAsC,EAAE,CAAC","sourcesContent":["import * as Firebird from \"es-node-firebird\";\nimport { Options } from \"es-node-firebird\";\n\nexport type FirebirdWireCryptMode = \"disabled\" | \"enabled\" | \"required\";\nexport type FirebirdAuthPlugin = \"Legacy_Auth\" | \"Srp\" | \"Srp256\";\n\nexport type FirebirdOptions = Options & {\n wireCrypt?: FirebirdWireCryptMode;\n pluginName?: FirebirdAuthPlugin;\n authPlugins?: FirebirdAuthPlugin[];\n connectTimeoutMs?: number;\n connectTimeout?: number;\n compatibilityProbeTimeoutMs?: number;\n compatibilityTotalTimeoutMs?: number;\n};\n\nconst CNCT_PLUGIN_NAME = 8;\nconst CNCT_PLUGIN_LIST = 10;\nconst CNCT_CLIENT_CRYPT = 11;\nconst WIRE_CRYPT_DISABLE = 0;\nconst WIRE_CRYPT_ENABLE = 1;\nconst WIRE_CRYPT_REQUIRED = 2;\nconst DEFAULT_AUTH_PLUGIN_LIST: FirebirdAuthPlugin[] = [\"Srp256\", \"Srp\", \"Legacy_Auth\"];\n\ntype BlrWriterLike = {\n addBytes: (bytes: number[], ...args: unknown[]) => unknown;\n addString: (code: number, value: string, encoding?: string) => unknown;\n};\n\ntype ConnectionLike = {\n _blr?: BlrWriterLike;\n accept?: {\n protocolMinimumType?: number;\n pluginName?: string;\n };\n};\n\ntype FirebirdModuleLike = {\n Connection?: {\n prototype?: {\n connect?: (this: ConnectionLike, options: FirebirdOptions, callback: unknown) => unknown;\n __emilsoftwareWireCryptPatched?: boolean;\n };\n };\n};\n\nfunction normalizeWireCryptMode(value: unknown): FirebirdWireCryptMode {\n const normalized = String(value ?? \"\").trim().toLowerCase();\n if (normalized === \"required\") {\n return \"required\";\n }\n\n if (normalized === \"disabled\") {\n return \"disabled\";\n }\n\n return \"enabled\";\n}\n\nfunction normalizeAuthPlugin(value: unknown): FirebirdAuthPlugin {\n const normalized = String(value ?? \"\").trim().toLowerCase();\n\n if (normalized === \"legacy_auth\" || normalized === \"legacy\") {\n return \"Legacy_Auth\";\n }\n\n if (normalized === \"srp256\") {\n return \"Srp256\";\n }\n\n return \"Srp\";\n}\n\nfunction toWireCryptFlag(mode: FirebirdWireCryptMode): number {\n switch (mode) {\n case \"required\":\n return WIRE_CRYPT_REQUIRED;\n case \"disabled\":\n return WIRE_CRYPT_DISABLE;\n default:\n return WIRE_CRYPT_ENABLE;\n }\n}\n\nfunction normalizeAuthPluginList(value: unknown): FirebirdAuthPlugin[] {\n if (!Array.isArray(value) || value.length === 0) {\n return [...DEFAULT_AUTH_PLUGIN_LIST];\n }\n\n const normalized = value\n .map((entry: unknown) => normalizeAuthPlugin(entry))\n .filter((entry: FirebirdAuthPlugin, index: number, source: FirebirdAuthPlugin[]) => source.indexOf(entry) === index);\n\n return normalized.length > 0 ? normalized : [...DEFAULT_AUTH_PLUGIN_LIST];\n}\n\nexport function normalizeFirebirdOptions(options: Options): FirebirdOptions {\n const compatibilityOptions = options as FirebirdOptions;\n return {\n ...options,\n wireCrypt: normalizeWireCryptMode(compatibilityOptions.wireCrypt),\n pluginName: normalizeAuthPlugin(compatibilityOptions.pluginName),\n authPlugins: normalizeAuthPluginList(compatibilityOptions.authPlugins),\n };\n}\n\nfunction isRetryableCompatibilityError(error: unknown): boolean {\n const message = String((error as { message?: unknown })?.message ?? error ?? \"\").toLowerCase();\n return message.includes(\"incompatible wire encryption\")\n || message.includes(\"no matching plugins on server\")\n || message.includes(\"unknown auth plugin\")\n || message.includes(\"unknow auth plugin\")\n || message.includes(\"timeout during firebird attach\");\n}\n\nfunction pushUniqueCandidate(target: FirebirdOptions[], candidate: FirebirdOptions): void {\n const normalized = normalizeFirebirdOptions(candidate);\n const key = `${normalized.pluginName}|${normalized.wireCrypt}|${(normalized.authPlugins ?? []).join(\",\")}`;\n const alreadyPresent = target.some((entry) => {\n const normalizedEntry = normalizeFirebirdOptions(entry);\n return `${normalizedEntry.pluginName}|${normalizedEntry.wireCrypt}|${(normalizedEntry.authPlugins ?? []).join(\",\")}` === key;\n });\n\n if (!alreadyPresent) {\n target.push(normalized);\n }\n}\n\nfunction appendPluginCandidates(\n target: FirebirdOptions[],\n base: FirebirdOptions,\n pluginName: FirebirdAuthPlugin,\n wireCryptModes: FirebirdWireCryptMode[],\n): void {\n wireCryptModes.forEach((wireCrypt) => {\n pushUniqueCandidate(target, { ...base, pluginName, wireCrypt });\n });\n}\n\nexport function buildFirebirdCompatibilityCandidates(options: Options): FirebirdOptions[] {\n const normalized = normalizeFirebirdOptions(options);\n const compatibilityOptions = options as FirebirdOptions;\n const hasExplicitPlugin = compatibilityOptions.pluginName !== undefined;\n const hasExplicitWireCrypt = compatibilityOptions.wireCrypt !== undefined;\n const candidates: FirebirdOptions[] = [];\n\n pushUniqueCandidate(candidates, normalized);\n\n if (hasExplicitPlugin && hasExplicitWireCrypt) {\n return candidates;\n }\n\n if (hasExplicitPlugin) {\n const wireCryptModes = normalized.pluginName === \"Legacy_Auth\"\n ? [\"disabled\", \"enabled\"] as FirebirdWireCryptMode[]\n : [\"enabled\", \"required\", \"disabled\"] as FirebirdWireCryptMode[];\n\n appendPluginCandidates(candidates, normalized, normalized.pluginName!, wireCryptModes);\n return candidates;\n }\n\n if (hasExplicitWireCrypt) {\n appendPluginCandidates(candidates, normalized, \"Srp256\", [normalized.wireCrypt!]);\n appendPluginCandidates(candidates, normalized, \"Srp\", [normalized.wireCrypt!]);\n appendPluginCandidates(candidates, normalized, \"Legacy_Auth\", [normalized.wireCrypt!]);\n return candidates;\n }\n\n appendPluginCandidates(candidates, normalized, \"Srp256\", [\"enabled\", \"required\", \"disabled\"]);\n appendPluginCandidates(candidates, normalized, \"Srp\", [\"enabled\", \"required\", \"disabled\"]);\n appendPluginCandidates(candidates, normalized, \"Legacy_Auth\", [\"disabled\", \"enabled\"]);\n return candidates;\n}\n\nexport function shouldRetryFirebirdCompatibility(error: unknown): boolean {\n return isRetryableCompatibilityError(error);\n}\n\nexport function describeFirebirdCompatibilityOptions(options: Options): string {\n const normalized = normalizeFirebirdOptions(options);\n return `plugin=${normalized.pluginName}, wireCrypt=${normalized.wireCrypt}, authPlugins=${(normalized.authPlugins ?? []).join(\"/\")}`;\n}\n\nexport function ensureEsNodeFirebirdCompatibilityPatch(): void {\n const firebird = Firebird as FirebirdModuleLike;\n const connectionPrototype = firebird.Connection?.prototype;\n\n if (!connectionPrototype?.connect || connectionPrototype.__emilsoftwareWireCryptPatched) {\n return;\n }\n\n const originalConnect = connectionPrototype.connect;\n\n connectionPrototype.connect = function patchedConnect(\n this: ConnectionLike,\n options: FirebirdOptions,\n callback: unknown,\n ) {\n const normalizedOptions = normalizeFirebirdOptions(options);\n const wireCryptFlag = toWireCryptFlag(normalizedOptions.wireCrypt);\n const authPlugin = normalizedOptions.pluginName;\n const authPlugins = normalizedOptions.authPlugins ?? DEFAULT_AUTH_PLUGIN_LIST;\n\n this.accept ??= { protocolMinimumType: 0, pluginName: authPlugin };\n\n const blr = this._blr;\n const originalAddBytes = blr?.addBytes;\n const originalAddString = blr?.addString;\n\n if (!blr || !originalAddBytes || !originalAddString) {\n return originalConnect.call(this, normalizedOptions, callback);\n }\n\n const patchedOptions = authPlugin === \"Srp256\"\n ? { ...normalizedOptions, pluginName: \"Srp\" as FirebirdAuthPlugin }\n : normalizedOptions;\n\n blr.addBytes = function patchedAddBytes(bytes: number[], ...args: unknown[]) {\n if (Array.isArray(bytes) && bytes.length === 6 && bytes[0] === CNCT_CLIENT_CRYPT && bytes[1] === 4) {\n return originalAddBytes.call(this, [bytes[0], bytes[1], wireCryptFlag, 0, 0, 0], ...args);\n }\n\n return originalAddBytes.call(this, bytes, ...args);\n };\n\n blr.addString = function patchedAddString(code: number, value: string, encoding?: string) {\n if (code === CNCT_PLUGIN_NAME) {\n return originalAddString.call(this, code, authPlugin, encoding);\n }\n\n if (code === CNCT_PLUGIN_LIST) {\n return originalAddString.call(this, code, authPlugins.join(\",\"), encoding);\n }\n\n return originalAddString.call(this, code, value, encoding);\n };\n\n try {\n return originalConnect.call(this, patchedOptions, callback);\n } finally {\n blr.addBytes = originalAddBytes;\n blr.addString = originalAddString;\n }\n };\n\n connectionPrototype.__emilsoftwareWireCryptPatched = true;\n}\n\nensureEsNodeFirebirdCompatibilityPatch();\n"]}
|
|
1
|
+
{"version":3,"file":"firebird-compat.js","sourceRoot":"","sources":["../src/firebird-compat.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiMA,4DA8BC;AAED,oFAGC;AAED,oDAqBC;AAED,oFAEC;AAED,4EAEC;AAED,wFAIC;AAzQD,wDAA0C;AA2C1C,SAAS,OAAO,CAAC,KAAc;IAC3B,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;AACvG,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAmC;IAC/D,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACjB,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACtD,IAAI,UAA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AAC,CAAC,CAAC,CAAC,iBAAiB,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACjG,MAAM,cAAc,GAAG,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IACxD,MAAM,QAAQ,GAAG,IAAI,KAAK,CACtB,YAAY,OAAO,CAAC,KAAK,cAAc,MAAM,KAAK,QAAQ,CAAC,OAAO,IAAI,iBAAiB,GAAG,cAAc,GAAG,SAAS,EAAE,CAChG,CAAC;IAE3B,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC;IAC1B,QAAQ,CAAC,8BAA8B,GAAG,IAAI,CAAC;IAC/C,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACzC,QAAQ,CAAC,KAAK,GAAG,GAAG,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,OAAO,gBAAgB,MAAA,QAAQ,CAAC,KAAK,mCAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;IAC3G,OAAO,QAAQ,CAAC;AACpB,CAAC;AAED,SAAgB,oCAAoC,CAAC,OAAgB;IACjE,OAAO,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC,CAAC;AAC/C,CAAC;AAED,SAAgB,gCAAgC;IAC5C,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,SAAgB,sCAAsC;IAClD,uEAAuE;IACvE,sEAAsE;IACtE,wBAAwB;AAC5B,CAAC","sourcesContent":["import * as Firebird from \"node-firebird\";\nimport type { Options } from \"node-firebird\";\n\nexport type FirebirdWireCryptMode = \"disabled\" | \"enabled\" | \"required\";\nexport type FirebirdAuthPlugin = \"Legacy_Auth\" | \"Srp\" | \"Srp256\" | \"Srp384\" | \"Srp512\";\nexport type FirebirdDriverStrategy = \"modern\";\n\nexport type FirebirdOptions = Options & {\n wireCrypt?: FirebirdWireCryptMode | number;\n pluginName?: FirebirdAuthPlugin;\n authPlugins?: FirebirdAuthPlugin[];\n connectTimeoutMs?: number;\n compatibilityProbeTimeoutMs?: number;\n compatibilityTotalTimeoutMs?: number;\n firebirdDriver?: FirebirdDriverStrategy;\n trimStringResults?: boolean;\n /**\n * When `true`, query parameters are interpolated into the logged SQL. Off by\n * default so that secrets, credentials and personal data are not written to\n * the console or to the daily log files.\n */\n logQueryParameters?: boolean;\n /**\n * When greater than zero, enables an opt-in connection pool of the given\n * maximum size for this connection target instead of attaching/detaching a\n * physical connection for every query. Default `0` keeps the historic\n * one-connection-per-query behaviour.\n */\n poolSize?: number;\n};\n\ntype FirebirdErrorContext = {\n stage: \"attach\" | \"query\" | \"execute\" | \"transaction\";\n sql?: string;\n};\n\ntype EnhancedFirebirdError = Error & {\n cause?: unknown;\n gdscode?: number;\n gdsparams?: unknown;\n __emilsoftwareFirebirdEnhanced?: boolean;\n};\n\nfunction isBlank(value: unknown): boolean {\n return value === undefined || value === null || (typeof value === \"string\" && value.trim() === \"\");\n}\n\nfunction normalizeWireCryptMode(value: FirebirdOptions[\"wireCrypt\"]): number | undefined {\n if (isBlank(value)) {\n return undefined;\n }\n\n if (typeof value === \"number\") {\n return value;\n }\n\n const normalized = String(value).trim().toLowerCase();\n if (normalized === \"disabled\") {\n return Firebird.WIRE_CRYPT_DISABLE;\n }\n\n return Firebird.WIRE_CRYPT_ENABLE;\n}\n\nfunction normalizeAuthPlugin(value: unknown): FirebirdAuthPlugin | undefined {\n if (isBlank(value)) {\n return undefined;\n }\n\n const normalized = String(value).trim().toLowerCase();\n if (normalized === \"legacy\" || normalized === \"legacy_auth\") {\n return \"Legacy_Auth\";\n }\n\n if (normalized === \"srp256\") {\n return \"Srp256\";\n }\n\n if (normalized === \"srp384\") {\n return \"Srp384\";\n }\n\n if (normalized === \"srp512\") {\n return \"Srp512\";\n }\n\n return \"Srp\";\n}\n\nfunction formatWireCryptValue(value: FirebirdOptions[\"wireCrypt\"]): string {\n if (isBlank(value)) {\n return \"auto\";\n }\n\n if (typeof value === \"number\") {\n if (value === Firebird.WIRE_CRYPT_DISABLE) {\n return \"disabled\";\n }\n\n if (value === Firebird.WIRE_CRYPT_ENABLE) {\n return \"enabled\";\n }\n\n return String(value);\n }\n\n return String(value);\n}\n\nfunction formatTarget(options: Options): string {\n return `${options.host ?? \"?\"}:${options.port ?? \"?\"} -> ${options.database ?? \"?\"}`;\n}\n\nfunction uniqueDiagnostics(values: string[]): string[] {\n return values.filter((value, index) => values.indexOf(value) === index);\n}\n\nfunction buildDiagnostics(message: string, options: FirebirdOptions): string[] {\n const diagnostics: string[] = [];\n const pluginMismatch = message.match(/Server don't accept plugin\\s*:\\s*([^,]+),\\s*but support\\s*:\\s*(.+)$/i);\n\n if (pluginMismatch) {\n const supportedPlugins = (pluginMismatch[2] ?? \"\")\n .split(\",\")\n .map((plugin) => plugin.trim())\n .filter((plugin) => plugin.length > 0);\n const supportedMessage = supportedPlugins.length === 1\n ? `The server explicitly reported that only the \"${supportedPlugins[0]}\" authentication plugin is supported.`\n : `The server explicitly reported the supported authentication plugins: ${supportedPlugins.join(\", \")}.`;\n diagnostics.push(supportedMessage);\n }\n\n if (/Incompatible wire encryption levels requested on client and server/i.test(message)) {\n diagnostics.push(\"The server rejected the requested wire encryption mode. Keep wire encryption auto-enabled unless the server is known to allow disabled encryption.\");\n }\n\n if (/No matching plugins on server/i.test(message)) {\n diagnostics.push(\"The server did not find a common authentication plugin with the client configuration.\");\n }\n\n if (/Connection timeout after \\d+ms/i.test(message) || /Timeout during Firebird attach after \\d+ ms/i.test(message)) {\n diagnostics.push(\"The TCP connection was accepted but the Firebird wire-protocol attach did not complete in time.\");\n }\n\n if (options.pluginName) {\n diagnostics.push(`Client authentication plugin was forced to \"${options.pluginName}\". Leave pluginName empty to let the driver auto-negotiate when possible.`);\n }\n\n if (!isBlank(options.wireCrypt)) {\n diagnostics.push(`Client wire encryption was forced to \"${formatWireCryptValue(options.wireCrypt)}\".`);\n }\n\n return uniqueDiagnostics(diagnostics);\n}\n\nfunction copyFirebirdMetadata(target: EnhancedFirebirdError, source: unknown): void {\n if (!source || typeof source !== \"object\") {\n return;\n }\n\n const firebirdSource = source as Record<string, unknown>;\n if (\"gdscode\" in firebirdSource) {\n target.gdscode = firebirdSource.gdscode as number;\n }\n\n if (\"gdsparams\" in firebirdSource) {\n target.gdsparams = firebirdSource.gdsparams;\n }\n}\n\nfunction formatFirebirdMetadata(source: unknown): string {\n if (!source || typeof source !== \"object\") {\n return \"\";\n }\n\n const firebirdSource = source as Record<string, unknown>;\n const metadata: string[] = [];\n\n if (typeof firebirdSource.gdscode === \"number\") {\n metadata.push(`gdscode=${firebirdSource.gdscode}`);\n }\n\n if (firebirdSource.gdsparams !== undefined) {\n try {\n metadata.push(`gdsparams=${JSON.stringify(firebirdSource.gdsparams)}`);\n } catch {\n metadata.push(`gdsparams=${String(firebirdSource.gdsparams)}`);\n }\n }\n\n return metadata.length > 0 ? ` Metadata: ${metadata.join(\", \")}.` : \"\";\n}\n\nexport function normalizeFirebirdOptions(options: Options): FirebirdOptions {\n const compatibilityOptions = options as FirebirdOptions;\n const {\n authPlugins: _authPlugins,\n compatibilityProbeTimeoutMs: _compatibilityProbeTimeoutMs,\n compatibilityTotalTimeoutMs,\n connectTimeoutMs,\n firebirdDriver: _firebirdDriver,\n logQueryParameters: _logQueryParameters,\n poolSize: _poolSize,\n trimStringResults,\n ...baseOptions\n } = compatibilityOptions;\n\n const normalizedOptions: FirebirdOptions = {\n ...baseOptions,\n pluginName: normalizeAuthPlugin(compatibilityOptions.pluginName),\n trimStringResults,\n wireCrypt: normalizeWireCryptMode(compatibilityOptions.wireCrypt),\n };\n\n const timeoutCandidate = compatibilityOptions.connectTimeout\n ?? connectTimeoutMs\n ?? compatibilityTotalTimeoutMs;\n\n if (Number.isFinite(timeoutCandidate) && Number(timeoutCandidate) > 0) {\n normalizedOptions.connectTimeout = Math.trunc(Number(timeoutCandidate));\n }\n\n return normalizedOptions;\n}\n\nexport function describeFirebirdCompatibilityOptions(options: Options): string {\n const normalized = normalizeFirebirdOptions(options);\n return `plugin=${normalized.pluginName ?? \"auto\"}, wireCrypt=${formatWireCryptValue(normalized.wireCrypt)}, connectTimeout=${normalized.connectTimeout ?? \"default\"}`;\n}\n\nexport function enhanceFirebirdError(error: unknown, options: Options, context: FirebirdErrorContext): Error {\n if (error instanceof Error && (error as EnhancedFirebirdError).__emilsoftwareFirebirdEnhanced) {\n return error;\n }\n\n const normalizedOptions = normalizeFirebirdOptions(options);\n const target = formatTarget(normalizedOptions);\n const original = error instanceof Error ? error : new Error(String(error));\n const diagnostics = buildDiagnostics(original.message, normalizedOptions);\n const sqlSuffix = context.sql ? ` SQL: ${context.sql.replace(/\\s+/g, \" \").trim()}` : \"\";\n const diagnosticsSuffix = diagnostics.length > 0 ? ` Diagnostics: ${diagnostics.join(\" \")}` : \"\";\n const metadataSuffix = formatFirebirdMetadata(original);\n const enhanced = new Error(\n `Firebird ${context.stage} failed on ${target}: ${original.message}.${diagnosticsSuffix}${metadataSuffix}${sqlSuffix}`\n ) as EnhancedFirebirdError;\n\n enhanced.cause = original;\n enhanced.__emilsoftwareFirebirdEnhanced = true;\n copyFirebirdMetadata(enhanced, original);\n enhanced.stack = `${enhanced.name}: ${enhanced.message}\\nCaused by: ${original.stack ?? original.message}`;\n return enhanced;\n}\n\nexport function buildFirebirdCompatibilityCandidates(options: Options): FirebirdOptions[] {\n return [normalizeFirebirdOptions(options)];\n}\n\nexport function shouldRetryFirebirdCompatibility(): boolean {\n return false;\n}\n\nexport function ensureEsNodeFirebirdCompatibilityPatch(): void {\n // No-op kept for backward compatibility. The library now relies on the\n // official node-firebird driver, which handles Firebird 2.5+ protocol\n // negotiation natively.\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DatabaseUpdater } from "./DatabaseUpdater";
|
|
2
2
|
import { ExecutionTimeLogger } from "./ExecutionTimeLogger";
|
|
3
|
-
import * as Firebird from "
|
|
3
|
+
import * as Firebird from "node-firebird";
|
|
4
4
|
import { LogLevels, Logger } from "./Logger";
|
|
5
5
|
import { Orm } from "./Orm";
|
|
6
6
|
import { DateUtilities, RestUtilities, DatabaseUtilities, StatusCode } from "./Utilities";
|
|
@@ -18,7 +18,7 @@ export * from "./DatabaseUpdater";
|
|
|
18
18
|
export * from "./firebird-compat";
|
|
19
19
|
export * from "./accessi-module";
|
|
20
20
|
export * from "./allegati-module";
|
|
21
|
-
export * from "
|
|
21
|
+
export * from "node-firebird";
|
|
22
22
|
export { autobind, ExecutionTimeLogger, Logger, LogLevels, Orm, DateUtilities, RestUtilities, DatabaseUtilities, DatabaseUpdater, StatusCode, DocumentGenerator, Firebird };
|
|
23
23
|
export * from "./swagger/SwaggerConfig";
|
|
24
24
|
export * from "./initEmilsoftwareModule";
|