emilsoftware-utilities 2.0.0-dev.3 → 2.0.0-dev.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (549) hide show
  1. package/README.MD +185 -38
  2. package/dist/ContractGenerator.d.ts +4 -3
  3. package/dist/ContractGenerator.js +15 -5
  4. package/dist/ContractGenerator.js.map +1 -1
  5. package/dist/DailyFileTransport.d.ts +21 -0
  6. package/dist/DailyFileTransport.js +74 -0
  7. package/dist/DailyFileTransport.js.map +1 -0
  8. package/dist/DatabaseUpdater.d.ts +1 -1
  9. package/dist/DatabaseUpdater.js +32 -29
  10. package/dist/DatabaseUpdater.js.map +1 -1
  11. package/dist/EmilsoftwareModule.js.map +1 -1
  12. package/dist/ExecutionTimeLogger.d.ts +2 -2
  13. package/dist/ExecutionTimeLogger.js +5 -4
  14. package/dist/ExecutionTimeLogger.js.map +1 -1
  15. package/dist/Logger.d.ts +22 -11
  16. package/dist/Logger.js +132 -119
  17. package/dist/Logger.js.map +1 -1
  18. package/dist/Orm.d.ts +28 -7
  19. package/dist/Orm.js +196 -90
  20. package/dist/Orm.js.map +1 -1
  21. package/dist/RoutesLoggerMiddleware.js.map +1 -1
  22. package/dist/Utilities.d.ts +18 -8
  23. package/dist/Utilities.js +117 -38
  24. package/dist/Utilities.js.map +1 -1
  25. package/dist/accessi-module/AccessiModule.d.ts +70 -1
  26. package/dist/accessi-module/AccessiModule.js +32 -5
  27. package/dist/accessi-module/AccessiModule.js.map +1 -1
  28. package/dist/accessi-module/Console/accessiFetch.d.ts +7 -0
  29. package/dist/accessi-module/Console/accessiFetch.js +59 -0
  30. package/dist/accessi-module/Console/accessiFetch.js.map +1 -0
  31. package/dist/accessi-module/Console/console.css +618 -0
  32. package/dist/accessi-module/Console/console.d.ts +1 -0
  33. package/dist/accessi-module/Console/console.js +3130 -0
  34. package/dist/accessi-module/Console/console.js.map +1 -0
  35. package/dist/accessi-module/Console/generated/accessiApi.d.ts +562 -0
  36. package/dist/accessi-module/Console/generated/accessiApi.js +533 -0
  37. package/dist/accessi-module/Console/generated/accessiApi.js.map +1 -0
  38. package/dist/accessi-module/Console/generated/model/abilitazioneMenu.d.ts +39 -0
  39. package/dist/accessi-module/Console/generated/model/abilitazioneMenu.js +3 -0
  40. package/dist/accessi-module/Console/generated/model/abilitazioneMenu.js.map +1 -0
  41. package/dist/accessi-module/Console/generated/model/abilitazioneMenuTipoAbilitazione.d.ts +16 -0
  42. package/dist/accessi-module/Console/generated/model/abilitazioneMenuTipoAbilitazione.js +17 -0
  43. package/dist/accessi-module/Console/generated/model/abilitazioneMenuTipoAbilitazione.js.map +1 -0
  44. package/dist/accessi-module/Console/generated/model/actionResponse.d.ts +12 -0
  45. package/dist/accessi-module/Console/generated/model/actionResponse.js +9 -0
  46. package/dist/accessi-module/Console/generated/model/actionResponse.js.map +1 -0
  47. package/dist/accessi-module/Console/generated/model/assignPermissionsToUserRequest.d.ts +11 -0
  48. package/dist/accessi-module/Console/generated/model/assignPermissionsToUserRequest.js +3 -0
  49. package/dist/accessi-module/Console/generated/model/assignPermissionsToUserRequest.js.map +1 -0
  50. package/dist/accessi-module/Console/generated/model/assignRolesToUserRequest.d.ts +10 -0
  51. package/dist/accessi-module/Console/generated/model/assignRolesToUserRequest.js +9 -0
  52. package/dist/accessi-module/Console/generated/model/assignRolesToUserRequest.js.map +1 -0
  53. package/dist/accessi-module/Console/generated/model/authenticatedTokenPayloadDto.d.ts +10 -0
  54. package/dist/accessi-module/Console/generated/model/authenticatedTokenPayloadDto.js +3 -0
  55. package/dist/accessi-module/Console/generated/model/authenticatedTokenPayloadDto.js.map +1 -0
  56. package/dist/accessi-module/Console/generated/model/authenticatedUserPayloadDto.d.ts +19 -0
  57. package/dist/accessi-module/Console/generated/model/authenticatedUserPayloadDto.js +9 -0
  58. package/dist/accessi-module/Console/generated/model/authenticatedUserPayloadDto.js.map +1 -0
  59. package/dist/accessi-module/Console/generated/model/confirmResetPasswordRequest.d.ts +14 -0
  60. package/dist/accessi-module/Console/generated/model/confirmResetPasswordRequest.js +9 -0
  61. package/dist/accessi-module/Console/generated/model/confirmResetPasswordRequest.js.map +1 -0
  62. package/dist/accessi-module/Console/generated/model/createFederatedIdentityRequest.d.ts +13 -0
  63. package/dist/accessi-module/Console/generated/model/createFederatedIdentityRequest.js +9 -0
  64. package/dist/accessi-module/Console/generated/model/createFederatedIdentityRequest.js.map +1 -0
  65. package/dist/accessi-module/Console/generated/model/createFederatedProviderRequest.d.ts +13 -0
  66. package/dist/accessi-module/Console/generated/model/createFederatedProviderRequest.js +9 -0
  67. package/dist/accessi-module/Console/generated/model/createFederatedProviderRequest.js.map +1 -0
  68. package/dist/accessi-module/Console/generated/model/createFederatedUserRequest.d.ts +18 -0
  69. package/dist/accessi-module/Console/generated/model/createFederatedUserRequest.js +3 -0
  70. package/dist/accessi-module/Console/generated/model/createFederatedUserRequest.js.map +1 -0
  71. package/dist/accessi-module/Console/generated/model/createFilterTypeRequest.d.ts +23 -0
  72. package/dist/accessi-module/Console/generated/model/createFilterTypeRequest.js +3 -0
  73. package/dist/accessi-module/Console/generated/model/createFilterTypeRequest.js.map +1 -0
  74. package/dist/accessi-module/Console/generated/model/createFilterTypeRequestFlgEnabled.d.ts +14 -0
  75. package/dist/accessi-module/Console/generated/model/createFilterTypeRequestFlgEnabled.js +15 -0
  76. package/dist/accessi-module/Console/generated/model/createFilterTypeRequestFlgEnabled.js.map +1 -0
  77. package/dist/accessi-module/Console/generated/model/createMenuGroupRequest.d.ts +27 -0
  78. package/dist/accessi-module/Console/generated/model/createMenuGroupRequest.js +9 -0
  79. package/dist/accessi-module/Console/generated/model/createMenuGroupRequest.js.map +1 -0
  80. package/dist/accessi-module/Console/generated/model/createMenuRequest.d.ts +52 -0
  81. package/dist/accessi-module/Console/generated/model/createMenuRequest.js +9 -0
  82. package/dist/accessi-module/Console/generated/model/createMenuRequest.js.map +1 -0
  83. package/dist/accessi-module/Console/generated/model/createMenuTypeRequest.d.ts +18 -0
  84. package/dist/accessi-module/Console/generated/model/createMenuTypeRequest.js +9 -0
  85. package/dist/accessi-module/Console/generated/model/createMenuTypeRequest.js.map +1 -0
  86. package/dist/accessi-module/Console/generated/model/createServiceTokenRequest.d.ts +16 -0
  87. package/dist/accessi-module/Console/generated/model/createServiceTokenRequest.js +9 -0
  88. package/dist/accessi-module/Console/generated/model/createServiceTokenRequest.js.map +1 -0
  89. package/dist/accessi-module/Console/generated/model/createServiceTokenResponse.d.ts +14 -0
  90. package/dist/accessi-module/Console/generated/model/createServiceTokenResponse.js +3 -0
  91. package/dist/accessi-module/Console/generated/model/createServiceTokenResponse.js.map +1 -0
  92. package/dist/accessi-module/Console/generated/model/errorResponse.d.ts +18 -0
  93. package/dist/accessi-module/Console/generated/model/errorResponse.js +9 -0
  94. package/dist/accessi-module/Console/generated/model/errorResponse.js.map +1 -0
  95. package/dist/accessi-module/Console/generated/model/federatedIdentityListResponse.d.ts +14 -0
  96. package/dist/accessi-module/Console/generated/model/federatedIdentityListResponse.js +3 -0
  97. package/dist/accessi-module/Console/generated/model/federatedIdentityListResponse.js.map +1 -0
  98. package/dist/accessi-module/Console/generated/model/federatedIdentityResponse.d.ts +14 -0
  99. package/dist/accessi-module/Console/generated/model/federatedIdentityResponse.js +3 -0
  100. package/dist/accessi-module/Console/generated/model/federatedIdentityResponse.js.map +1 -0
  101. package/dist/accessi-module/Console/generated/model/federatedIdentityResponseDto.d.ts +23 -0
  102. package/dist/accessi-module/Console/generated/model/federatedIdentityResponseDto.js +9 -0
  103. package/dist/accessi-module/Console/generated/model/federatedIdentityResponseDto.js.map +1 -0
  104. package/dist/accessi-module/Console/generated/model/federatedProviderListResponse.d.ts +14 -0
  105. package/dist/accessi-module/Console/generated/model/federatedProviderListResponse.js +3 -0
  106. package/dist/accessi-module/Console/generated/model/federatedProviderListResponse.js.map +1 -0
  107. package/dist/accessi-module/Console/generated/model/federatedProviderResponse.d.ts +14 -0
  108. package/dist/accessi-module/Console/generated/model/federatedProviderResponse.js +3 -0
  109. package/dist/accessi-module/Console/generated/model/federatedProviderResponse.js.map +1 -0
  110. package/dist/accessi-module/Console/generated/model/federatedProviderResponseDto.d.ts +13 -0
  111. package/dist/accessi-module/Console/generated/model/federatedProviderResponseDto.js +9 -0
  112. package/dist/accessi-module/Console/generated/model/federatedProviderResponseDto.js.map +1 -0
  113. package/dist/accessi-module/Console/generated/model/filtriUtente.d.ts +32 -0
  114. package/dist/accessi-module/Console/generated/model/filtriUtente.js +9 -0
  115. package/dist/accessi-module/Console/generated/model/filtriUtente.js.map +1 -0
  116. package/dist/accessi-module/Console/generated/model/getFiltriResponse.d.ts +14 -0
  117. package/dist/accessi-module/Console/generated/model/getFiltriResponse.js +3 -0
  118. package/dist/accessi-module/Console/generated/model/getFiltriResponse.js.map +1 -0
  119. package/dist/accessi-module/Console/generated/model/getFiltriUtenteParams.d.ts +12 -0
  120. package/dist/accessi-module/Console/generated/model/getFiltriUtenteParams.js +9 -0
  121. package/dist/accessi-module/Console/generated/model/getFiltriUtenteParams.js.map +1 -0
  122. package/dist/accessi-module/Console/generated/model/getFiltriUtenteResponse.d.ts +14 -0
  123. package/dist/accessi-module/Console/generated/model/getFiltriUtenteResponse.js +3 -0
  124. package/dist/accessi-module/Console/generated/model/getFiltriUtenteResponse.js.map +1 -0
  125. package/dist/accessi-module/Console/generated/model/getGroupsWithMenusParams.d.ts +12 -0
  126. package/dist/accessi-module/Console/generated/model/getGroupsWithMenusParams.js +9 -0
  127. package/dist/accessi-module/Console/generated/model/getGroupsWithMenusParams.js.map +1 -0
  128. package/dist/accessi-module/Console/generated/model/getGroupsWithMenusResponse.d.ts +14 -0
  129. package/dist/accessi-module/Console/generated/model/getGroupsWithMenusResponse.js +3 -0
  130. package/dist/accessi-module/Console/generated/model/getGroupsWithMenusResponse.js.map +1 -0
  131. package/dist/accessi-module/Console/generated/model/getMenuTypesResponse.d.ts +14 -0
  132. package/dist/accessi-module/Console/generated/model/getMenuTypesResponse.js +3 -0
  133. package/dist/accessi-module/Console/generated/model/getMenuTypesResponse.js.map +1 -0
  134. package/dist/accessi-module/Console/generated/model/getMenusResponse.d.ts +14 -0
  135. package/dist/accessi-module/Console/generated/model/getMenusResponse.js +3 -0
  136. package/dist/accessi-module/Console/generated/model/getMenusResponse.js.map +1 -0
  137. package/dist/accessi-module/Console/generated/model/getRolesResponse.d.ts +14 -0
  138. package/dist/accessi-module/Console/generated/model/getRolesResponse.js +3 -0
  139. package/dist/accessi-module/Console/generated/model/getRolesResponse.js.map +1 -0
  140. package/dist/accessi-module/Console/generated/model/getServiceTokensParams.d.ts +12 -0
  141. package/dist/accessi-module/Console/generated/model/getServiceTokensParams.js +9 -0
  142. package/dist/accessi-module/Console/generated/model/getServiceTokensParams.js.map +1 -0
  143. package/dist/accessi-module/Console/generated/model/getServiceTokensResponse.d.ts +14 -0
  144. package/dist/accessi-module/Console/generated/model/getServiceTokensResponse.js +3 -0
  145. package/dist/accessi-module/Console/generated/model/getServiceTokensResponse.js.map +1 -0
  146. package/dist/accessi-module/Console/generated/model/getUserByTokenRequest.d.ts +10 -0
  147. package/dist/accessi-module/Console/generated/model/getUserByTokenRequest.js +9 -0
  148. package/dist/accessi-module/Console/generated/model/getUserByTokenRequest.js.map +1 -0
  149. package/dist/accessi-module/Console/generated/model/getUserByTokenResponse.d.ts +14 -0
  150. package/dist/accessi-module/Console/generated/model/getUserByTokenResponse.js +3 -0
  151. package/dist/accessi-module/Console/generated/model/getUserByTokenResponse.js.map +1 -0
  152. package/dist/accessi-module/Console/generated/model/getUsersParams.d.ts +32 -0
  153. package/dist/accessi-module/Console/generated/model/getUsersParams.js +9 -0
  154. package/dist/accessi-module/Console/generated/model/getUsersParams.js.map +1 -0
  155. package/dist/accessi-module/Console/generated/model/getUsersResponse.d.ts +14 -0
  156. package/dist/accessi-module/Console/generated/model/getUsersResponse.js +3 -0
  157. package/dist/accessi-module/Console/generated/model/getUsersResponse.js.map +1 -0
  158. package/dist/accessi-module/Console/generated/model/getUsersResult.d.ts +17 -0
  159. package/dist/accessi-module/Console/generated/model/getUsersResult.js +3 -0
  160. package/dist/accessi-module/Console/generated/model/getUsersResult.js.map +1 -0
  161. package/dist/accessi-module/Console/generated/model/getUsersResultExtensionFields.d.ts +12 -0
  162. package/dist/accessi-module/Console/generated/model/getUsersResultExtensionFields.js +9 -0
  163. package/dist/accessi-module/Console/generated/model/getUsersResultExtensionFields.js.map +1 -0
  164. package/dist/accessi-module/Console/generated/model/groupWithMenusEntity.d.ts +21 -0
  165. package/dist/accessi-module/Console/generated/model/groupWithMenusEntity.js +3 -0
  166. package/dist/accessi-module/Console/generated/model/groupWithMenusEntity.js.map +1 -0
  167. package/dist/accessi-module/Console/generated/model/index.d.ts +93 -0
  168. package/dist/accessi-module/Console/generated/model/index.js +110 -0
  169. package/dist/accessi-module/Console/generated/model/index.js.map +1 -0
  170. package/dist/accessi-module/Console/generated/model/issuedServiceTokenDto.d.ts +30 -0
  171. package/dist/accessi-module/Console/generated/model/issuedServiceTokenDto.js +9 -0
  172. package/dist/accessi-module/Console/generated/model/issuedServiceTokenDto.js.map +1 -0
  173. package/dist/accessi-module/Console/generated/model/loginRequest.d.ts +12 -0
  174. package/dist/accessi-module/Console/generated/model/loginRequest.js +9 -0
  175. package/dist/accessi-module/Console/generated/model/loginRequest.js.map +1 -0
  176. package/dist/accessi-module/Console/generated/model/loginResponse.d.ts +14 -0
  177. package/dist/accessi-module/Console/generated/model/loginResponse.js +3 -0
  178. package/dist/accessi-module/Console/generated/model/loginResponse.js.map +1 -0
  179. package/dist/accessi-module/Console/generated/model/loginResult.d.ts +32 -0
  180. package/dist/accessi-module/Console/generated/model/loginResult.js +3 -0
  181. package/dist/accessi-module/Console/generated/model/loginResult.js.map +1 -0
  182. package/dist/accessi-module/Console/generated/model/loginResultExtensionFields.d.ts +12 -0
  183. package/dist/accessi-module/Console/generated/model/loginResultExtensionFields.js +9 -0
  184. package/dist/accessi-module/Console/generated/model/loginResultExtensionFields.js.map +1 -0
  185. package/dist/accessi-module/Console/generated/model/loginResultPasswordRequired.d.ts +13 -0
  186. package/dist/accessi-module/Console/generated/model/loginResultPasswordRequired.js +14 -0
  187. package/dist/accessi-module/Console/generated/model/loginResultPasswordRequired.js.map +1 -0
  188. package/dist/accessi-module/Console/generated/model/menuEntity.d.ts +34 -0
  189. package/dist/accessi-module/Console/generated/model/menuEntity.js +9 -0
  190. package/dist/accessi-module/Console/generated/model/menuEntity.js.map +1 -0
  191. package/dist/accessi-module/Console/generated/model/menuTypeEntity.d.ts +12 -0
  192. package/dist/accessi-module/Console/generated/model/menuTypeEntity.js +9 -0
  193. package/dist/accessi-module/Console/generated/model/menuTypeEntity.js.map +1 -0
  194. package/dist/accessi-module/Console/generated/model/passwordExpiredResponse.d.ts +12 -0
  195. package/dist/accessi-module/Console/generated/model/passwordExpiredResponse.js +9 -0
  196. package/dist/accessi-module/Console/generated/model/passwordExpiredResponse.js.map +1 -0
  197. package/dist/accessi-module/Console/generated/model/permission.d.ts +12 -0
  198. package/dist/accessi-module/Console/generated/model/permission.js +9 -0
  199. package/dist/accessi-module/Console/generated/model/permission.js.map +1 -0
  200. package/dist/accessi-module/Console/generated/model/publicRegisterRequest.d.ts +51 -0
  201. package/dist/accessi-module/Console/generated/model/publicRegisterRequest.js +9 -0
  202. package/dist/accessi-module/Console/generated/model/publicRegisterRequest.js.map +1 -0
  203. package/dist/accessi-module/Console/generated/model/registerRequest.d.ts +62 -0
  204. package/dist/accessi-module/Console/generated/model/registerRequest.js +3 -0
  205. package/dist/accessi-module/Console/generated/model/registerRequest.js.map +1 -0
  206. package/dist/accessi-module/Console/generated/model/registerResponse.d.ts +14 -0
  207. package/dist/accessi-module/Console/generated/model/registerResponse.js +3 -0
  208. package/dist/accessi-module/Console/generated/model/registerResponse.js.map +1 -0
  209. package/dist/accessi-module/Console/generated/model/resendTwoFactorRequest.d.ts +13 -0
  210. package/dist/accessi-module/Console/generated/model/resendTwoFactorRequest.js +9 -0
  211. package/dist/accessi-module/Console/generated/model/resendTwoFactorRequest.js.map +1 -0
  212. package/dist/accessi-module/Console/generated/model/role.d.ts +15 -0
  213. package/dist/accessi-module/Console/generated/model/role.js +3 -0
  214. package/dist/accessi-module/Console/generated/model/role.js.map +1 -0
  215. package/dist/accessi-module/Console/generated/model/ruoliMenu.d.ts +15 -0
  216. package/dist/accessi-module/Console/generated/model/ruoliMenu.js +3 -0
  217. package/dist/accessi-module/Console/generated/model/ruoliMenu.js.map +1 -0
  218. package/dist/accessi-module/Console/generated/model/ruoliMenuTipoAbilitazione.d.ts +16 -0
  219. package/dist/accessi-module/Console/generated/model/ruoliMenuTipoAbilitazione.js +17 -0
  220. package/dist/accessi-module/Console/generated/model/ruoliMenuTipoAbilitazione.js.map +1 -0
  221. package/dist/accessi-module/Console/generated/model/sendResetPasswordEmailRequest.d.ts +12 -0
  222. package/dist/accessi-module/Console/generated/model/sendResetPasswordEmailRequest.js +9 -0
  223. package/dist/accessi-module/Console/generated/model/sendResetPasswordEmailRequest.js.map +1 -0
  224. package/dist/accessi-module/Console/generated/model/serveResetPasswordPageParams.d.ts +12 -0
  225. package/dist/accessi-module/Console/generated/model/serveResetPasswordPageParams.js +9 -0
  226. package/dist/accessi-module/Console/generated/model/serveResetPasswordPageParams.js.map +1 -0
  227. package/dist/accessi-module/Console/generated/model/serviceTokenDto.d.ts +28 -0
  228. package/dist/accessi-module/Console/generated/model/serviceTokenDto.js +9 -0
  229. package/dist/accessi-module/Console/generated/model/serviceTokenDto.js.map +1 -0
  230. package/dist/accessi-module/Console/generated/model/setPasswordLoginPolicyRequest.d.ts +10 -0
  231. package/dist/accessi-module/Console/generated/model/setPasswordLoginPolicyRequest.js +9 -0
  232. package/dist/accessi-module/Console/generated/model/setPasswordLoginPolicyRequest.js.map +1 -0
  233. package/dist/accessi-module/Console/generated/model/setStatoRegistrazioneDto.d.ts +13 -0
  234. package/dist/accessi-module/Console/generated/model/setStatoRegistrazioneDto.js +3 -0
  235. package/dist/accessi-module/Console/generated/model/setStatoRegistrazioneDto.js.map +1 -0
  236. package/dist/accessi-module/Console/generated/model/setStatoRegistrazioneDtoStatoRegistrazione.d.ts +18 -0
  237. package/dist/accessi-module/Console/generated/model/setStatoRegistrazioneDtoStatoRegistrazione.js +19 -0
  238. package/dist/accessi-module/Console/generated/model/setStatoRegistrazioneDtoStatoRegistrazione.js.map +1 -0
  239. package/dist/accessi-module/Console/generated/model/status.d.ts +12 -0
  240. package/dist/accessi-module/Console/generated/model/status.js +9 -0
  241. package/dist/accessi-module/Console/generated/model/status.js.map +1 -0
  242. package/dist/accessi-module/Console/generated/model/tipoFiltro.d.ts +23 -0
  243. package/dist/accessi-module/Console/generated/model/tipoFiltro.js +3 -0
  244. package/dist/accessi-module/Console/generated/model/tipoFiltro.js.map +1 -0
  245. package/dist/accessi-module/Console/generated/model/tipoFiltroFlgEnabled.d.ts +14 -0
  246. package/dist/accessi-module/Console/generated/model/tipoFiltroFlgEnabled.js +15 -0
  247. package/dist/accessi-module/Console/generated/model/tipoFiltroFlgEnabled.js.map +1 -0
  248. package/dist/accessi-module/Console/generated/model/tokenResult.d.ts +15 -0
  249. package/dist/accessi-module/Console/generated/model/tokenResult.js +3 -0
  250. package/dist/accessi-module/Console/generated/model/tokenResult.js.map +1 -0
  251. package/dist/accessi-module/Console/generated/model/tokenResultType.d.ts +14 -0
  252. package/dist/accessi-module/Console/generated/model/tokenResultType.js +15 -0
  253. package/dist/accessi-module/Console/generated/model/tokenResultType.js.map +1 -0
  254. package/dist/accessi-module/Console/generated/model/twoFactorChallengeDto.d.ts +18 -0
  255. package/dist/accessi-module/Console/generated/model/twoFactorChallengeDto.js +3 -0
  256. package/dist/accessi-module/Console/generated/model/twoFactorChallengeDto.js.map +1 -0
  257. package/dist/accessi-module/Console/generated/model/twoFactorChallengeDtoMethod.d.ts +10 -0
  258. package/dist/accessi-module/Console/generated/model/twoFactorChallengeDtoMethod.js +14 -0
  259. package/dist/accessi-module/Console/generated/model/twoFactorChallengeDtoMethod.js.map +1 -0
  260. package/dist/accessi-module/Console/generated/model/twoFactorChallengeDtoTwoFactorRequired.d.ts +13 -0
  261. package/dist/accessi-module/Console/generated/model/twoFactorChallengeDtoTwoFactorRequired.js +14 -0
  262. package/dist/accessi-module/Console/generated/model/twoFactorChallengeDtoTwoFactorRequired.js.map +1 -0
  263. package/dist/accessi-module/Console/generated/model/updateEnabledStatusRequest.d.ts +10 -0
  264. package/dist/accessi-module/Console/generated/model/updateEnabledStatusRequest.js +9 -0
  265. package/dist/accessi-module/Console/generated/model/updateEnabledStatusRequest.js.map +1 -0
  266. package/dist/accessi-module/Console/generated/model/updateFederatedIdentityRequest.d.ts +11 -0
  267. package/dist/accessi-module/Console/generated/model/updateFederatedIdentityRequest.js +9 -0
  268. package/dist/accessi-module/Console/generated/model/updateFederatedIdentityRequest.js.map +1 -0
  269. package/dist/accessi-module/Console/generated/model/updateFederatedProviderRequest.d.ts +12 -0
  270. package/dist/accessi-module/Console/generated/model/updateFederatedProviderRequest.js +9 -0
  271. package/dist/accessi-module/Console/generated/model/updateFederatedProviderRequest.js.map +1 -0
  272. package/dist/accessi-module/Console/generated/model/updateFilterTypeRequest.d.ts +21 -0
  273. package/dist/accessi-module/Console/generated/model/updateFilterTypeRequest.js +3 -0
  274. package/dist/accessi-module/Console/generated/model/updateFilterTypeRequest.js.map +1 -0
  275. package/dist/accessi-module/Console/generated/model/updateFilterTypeRequestFlgEnabled.d.ts +14 -0
  276. package/dist/accessi-module/Console/generated/model/updateFilterTypeRequestFlgEnabled.js +15 -0
  277. package/dist/accessi-module/Console/generated/model/updateFilterTypeRequestFlgEnabled.js.map +1 -0
  278. package/dist/accessi-module/Console/generated/model/updateMenuGroupRequest.d.ts +22 -0
  279. package/dist/accessi-module/Console/generated/model/updateMenuGroupRequest.js +9 -0
  280. package/dist/accessi-module/Console/generated/model/updateMenuGroupRequest.js.map +1 -0
  281. package/dist/accessi-module/Console/generated/model/updateMenuRequest.d.ts +47 -0
  282. package/dist/accessi-module/Console/generated/model/updateMenuRequest.js +9 -0
  283. package/dist/accessi-module/Console/generated/model/updateMenuRequest.js.map +1 -0
  284. package/dist/accessi-module/Console/generated/model/updateMenuTypeRequest.d.ts +13 -0
  285. package/dist/accessi-module/Console/generated/model/updateMenuTypeRequest.js +9 -0
  286. package/dist/accessi-module/Console/generated/model/updateMenuTypeRequest.js.map +1 -0
  287. package/dist/accessi-module/Console/generated/model/userDto.d.ts +112 -0
  288. package/dist/accessi-module/Console/generated/model/userDto.js +3 -0
  289. package/dist/accessi-module/Console/generated/model/userDto.js.map +1 -0
  290. package/dist/accessi-module/Console/generated/model/userDtoStatoRegistrazione.d.ts +18 -0
  291. package/dist/accessi-module/Console/generated/model/userDtoStatoRegistrazione.js +19 -0
  292. package/dist/accessi-module/Console/generated/model/userDtoStatoRegistrazione.js.map +1 -0
  293. package/dist/accessi-module/Console/generated/model/userGrantsDto.d.ts +16 -0
  294. package/dist/accessi-module/Console/generated/model/userGrantsDto.js +3 -0
  295. package/dist/accessi-module/Console/generated/model/userGrantsDto.js.map +1 -0
  296. package/dist/accessi-module/Console/generated/model/userGrantsResponse.d.ts +14 -0
  297. package/dist/accessi-module/Console/generated/model/userGrantsResponse.js +3 -0
  298. package/dist/accessi-module/Console/generated/model/userGrantsResponse.js.map +1 -0
  299. package/dist/accessi-module/Console/generated/model/verifyTwoFactorRequest.d.ts +18 -0
  300. package/dist/accessi-module/Console/generated/model/verifyTwoFactorRequest.js +9 -0
  301. package/dist/accessi-module/Console/generated/model/verifyTwoFactorRequest.js.map +1 -0
  302. package/dist/accessi-module/Console/help.d.ts +13 -0
  303. package/dist/accessi-module/Console/help.js +348 -0
  304. package/dist/accessi-module/Console/help.js.map +1 -0
  305. package/dist/accessi-module/Console/index.html +127 -0
  306. package/dist/accessi-module/Console/wiki.d.ts +52 -0
  307. package/dist/accessi-module/Console/wiki.js +691 -0
  308. package/dist/accessi-module/Console/wiki.js.map +1 -0
  309. package/dist/accessi-module/Controllers/AccessiConsoleController.d.ts +18 -0
  310. package/dist/accessi-module/Controllers/AccessiConsoleController.js +111 -0
  311. package/dist/accessi-module/Controllers/AccessiConsoleController.js.map +1 -0
  312. package/dist/accessi-module/Controllers/AuthController.d.ts +8 -5
  313. package/dist/accessi-module/Controllers/AuthController.js +128 -79
  314. package/dist/accessi-module/Controllers/AuthController.js.map +1 -1
  315. package/dist/accessi-module/Controllers/ConfiguratorController.d.ts +1 -3
  316. package/dist/accessi-module/Controllers/ConfiguratorController.js +30 -35
  317. package/dist/accessi-module/Controllers/ConfiguratorController.js.map +1 -1
  318. package/dist/accessi-module/Controllers/EmailController.d.ts +4 -6
  319. package/dist/accessi-module/Controllers/EmailController.js +12 -14
  320. package/dist/accessi-module/Controllers/EmailController.js.map +1 -1
  321. package/dist/accessi-module/Controllers/FiltriController.d.ts +5 -4
  322. package/dist/accessi-module/Controllers/FiltriController.js +124 -5
  323. package/dist/accessi-module/Controllers/FiltriController.js.map +1 -1
  324. package/dist/accessi-module/Controllers/PermissionController.d.ts +12 -1
  325. package/dist/accessi-module/Controllers/PermissionController.js +317 -46
  326. package/dist/accessi-module/Controllers/PermissionController.js.map +1 -1
  327. package/dist/accessi-module/Controllers/ServiceTokenController.d.ts +23 -0
  328. package/dist/accessi-module/Controllers/ServiceTokenController.js +176 -0
  329. package/dist/accessi-module/Controllers/ServiceTokenController.js.map +1 -0
  330. package/dist/accessi-module/Controllers/UserController.d.ts +8 -4
  331. package/dist/accessi-module/Controllers/UserController.js +156 -23
  332. package/dist/accessi-module/Controllers/UserController.js.map +1 -1
  333. package/dist/accessi-module/Dtos/Abilitazione.js.map +1 -1
  334. package/dist/accessi-module/Dtos/AbilitazioneMenu.js +16 -8
  335. package/dist/accessi-module/Dtos/AbilitazioneMenu.js.map +1 -1
  336. package/dist/accessi-module/Dtos/AssignPermissionsToUserRequest.js +0 -1
  337. package/dist/accessi-module/Dtos/AssignPermissionsToUserRequest.js.map +1 -1
  338. package/dist/accessi-module/Dtos/AssignRolesToUserRequest.js +1 -2
  339. package/dist/accessi-module/Dtos/AssignRolesToUserRequest.js.map +1 -1
  340. package/dist/accessi-module/Dtos/AuthenticatedUserPayloadDto.d.ts +13 -0
  341. package/dist/accessi-module/Dtos/AuthenticatedUserPayloadDto.js +70 -0
  342. package/dist/accessi-module/Dtos/AuthenticatedUserPayloadDto.js.map +1 -0
  343. package/dist/accessi-module/Dtos/BaseResponse.d.ts +22 -0
  344. package/dist/accessi-module/Dtos/BaseResponse.js +106 -1
  345. package/dist/accessi-module/Dtos/BaseResponse.js.map +1 -1
  346. package/dist/accessi-module/Dtos/CatalogDtos.d.ts +66 -0
  347. package/dist/accessi-module/Dtos/CatalogDtos.js +336 -0
  348. package/dist/accessi-module/Dtos/CatalogDtos.js.map +1 -0
  349. package/dist/accessi-module/Dtos/ConfirmResetPasswordRequest.d.ts +3 -0
  350. package/dist/accessi-module/Dtos/ConfirmResetPasswordRequest.js +31 -0
  351. package/dist/accessi-module/Dtos/ConfirmResetPasswordRequest.js.map +1 -0
  352. package/dist/accessi-module/Dtos/FederatedIdentityDtos.d.ts +69 -0
  353. package/dist/accessi-module/Dtos/FederatedIdentityDtos.js +236 -0
  354. package/dist/accessi-module/Dtos/FederatedIdentityDtos.js.map +1 -0
  355. package/dist/accessi-module/Dtos/FiltriUtente.js +5 -1
  356. package/dist/accessi-module/Dtos/FiltriUtente.js.map +1 -1
  357. package/dist/accessi-module/Dtos/GetGroupsWithMenusResponse.d.ts +1 -0
  358. package/dist/accessi-module/Dtos/GetGroupsWithMenusResponse.js +9 -1
  359. package/dist/accessi-module/Dtos/GetGroupsWithMenusResponse.js.map +1 -1
  360. package/dist/accessi-module/Dtos/GetMenusResponse.d.ts +1 -0
  361. package/dist/accessi-module/Dtos/GetMenusResponse.js +9 -1
  362. package/dist/accessi-module/Dtos/GetMenusResponse.js.map +1 -1
  363. package/dist/accessi-module/Dtos/GetRolesResponse.js.map +1 -1
  364. package/dist/accessi-module/Dtos/GetUserByTokenRequest.d.ts +3 -0
  365. package/dist/accessi-module/Dtos/GetUserByTokenRequest.js +26 -0
  366. package/dist/accessi-module/Dtos/GetUserByTokenRequest.js.map +1 -0
  367. package/dist/accessi-module/Dtos/GetUserByTokenResponse.d.ts +5 -0
  368. package/dist/accessi-module/Dtos/GetUserByTokenResponse.js +27 -0
  369. package/dist/accessi-module/Dtos/GetUserByTokenResponse.js.map +1 -0
  370. package/dist/accessi-module/Dtos/GetUsersResponse.d.ts +1 -1
  371. package/dist/accessi-module/Dtos/GetUsersResponse.js.map +1 -1
  372. package/dist/accessi-module/Dtos/LoginRequest.d.ts +1 -1
  373. package/dist/accessi-module/Dtos/LoginRequest.js +3 -2
  374. package/dist/accessi-module/Dtos/LoginRequest.js.map +1 -1
  375. package/dist/accessi-module/Dtos/LoginResponse.d.ts +6 -2
  376. package/dist/accessi-module/Dtos/LoginResponse.js +20 -7
  377. package/dist/accessi-module/Dtos/LoginResponse.js.map +1 -1
  378. package/dist/accessi-module/Dtos/MenuItem.js +1 -0
  379. package/dist/accessi-module/Dtos/Permission.d.ts +1 -0
  380. package/dist/accessi-module/Dtos/Permission.js +1 -0
  381. package/dist/accessi-module/Dtos/Permission.js.map +1 -1
  382. package/dist/accessi-module/Dtos/PublicRegisterRequest.d.ts +5 -0
  383. package/dist/accessi-module/Dtos/PublicRegisterRequest.js +15 -0
  384. package/dist/accessi-module/Dtos/PublicRegisterRequest.js.map +1 -0
  385. package/dist/accessi-module/Dtos/RegisterRequest.js +7 -1
  386. package/dist/accessi-module/Dtos/RegisterRequest.js.map +1 -1
  387. package/dist/accessi-module/Dtos/RegisterResponse.d.ts +1 -1
  388. package/dist/accessi-module/Dtos/RegisterResponse.js +3 -3
  389. package/dist/accessi-module/Dtos/RegisterResponse.js.map +1 -1
  390. package/dist/accessi-module/Dtos/Role.d.ts +4 -0
  391. package/dist/accessi-module/Dtos/Role.js +4 -0
  392. package/dist/accessi-module/Dtos/Role.js.map +1 -1
  393. package/dist/accessi-module/Dtos/RuoliMenu.js.map +1 -1
  394. package/dist/accessi-module/Dtos/SendResetPasswordEmailRequest.d.ts +4 -0
  395. package/dist/accessi-module/Dtos/SendResetPasswordEmailRequest.js +36 -0
  396. package/dist/accessi-module/Dtos/SendResetPasswordEmailRequest.js.map +1 -0
  397. package/dist/accessi-module/Dtos/ServiceToken.d.ts +34 -0
  398. package/dist/accessi-module/Dtos/ServiceToken.js +128 -0
  399. package/dist/accessi-module/Dtos/ServiceToken.js.map +1 -0
  400. package/dist/accessi-module/Dtos/SetStatoRegistrazione.js.map +1 -1
  401. package/dist/accessi-module/Dtos/StatoRegistrazione.js.map +1 -1
  402. package/dist/accessi-module/Dtos/TipoAbilitazione.d.ts +4 -0
  403. package/dist/accessi-module/Dtos/TipoAbilitazione.js +4 -0
  404. package/dist/accessi-module/Dtos/TipoAbilitazione.js.map +1 -1
  405. package/dist/accessi-module/Dtos/TipoFiltro.js.map +1 -1
  406. package/dist/accessi-module/Dtos/TokenResult.js.map +1 -1
  407. package/dist/accessi-module/Dtos/TwoFactorDtos.d.ts +13 -0
  408. package/dist/accessi-module/Dtos/TwoFactorDtos.js +60 -0
  409. package/dist/accessi-module/Dtos/TwoFactorDtos.js.map +1 -0
  410. package/dist/accessi-module/Dtos/UpdateEnabledStatusRequest.js.map +1 -1
  411. package/dist/accessi-module/Dtos/UserDto.d.ts +19 -0
  412. package/dist/accessi-module/Dtos/UserDto.js +114 -3
  413. package/dist/accessi-module/Dtos/UserDto.js.map +1 -1
  414. package/dist/accessi-module/Dtos/UserGrantsDto.js.map +1 -1
  415. package/dist/accessi-module/Dtos/UserGrantsResponse.d.ts +5 -0
  416. package/dist/accessi-module/Dtos/UserGrantsResponse.js +27 -0
  417. package/dist/accessi-module/Dtos/UserGrantsResponse.js.map +1 -0
  418. package/dist/accessi-module/Dtos/index.d.ts +11 -0
  419. package/dist/accessi-module/Dtos/index.js +11 -0
  420. package/dist/accessi-module/Dtos/index.js.map +1 -1
  421. package/dist/accessi-module/Services/AuthService/AuthService.d.ts +40 -5
  422. package/dist/accessi-module/Services/AuthService/AuthService.js +192 -40
  423. package/dist/accessi-module/Services/AuthService/AuthService.js.map +1 -1
  424. package/dist/accessi-module/Services/ConfiguratorService/ConfiguratorService.d.ts +3 -1
  425. package/dist/accessi-module/Services/ConfiguratorService/ConfiguratorService.js +5 -1
  426. package/dist/accessi-module/Services/ConfiguratorService/ConfiguratorService.js.map +1 -1
  427. package/dist/accessi-module/Services/EmailService/EmailService.d.ts +9 -2
  428. package/dist/accessi-module/Services/EmailService/EmailService.js +47 -22
  429. package/dist/accessi-module/Services/EmailService/EmailService.js.map +1 -1
  430. package/dist/accessi-module/Services/FiltriService/FiltriService.d.ts +18 -3
  431. package/dist/accessi-module/Services/FiltriService/FiltriService.js +92 -16
  432. package/dist/accessi-module/Services/FiltriService/FiltriService.js.map +1 -1
  433. package/dist/accessi-module/Services/PermissionService/PermissionService.d.ts +77 -2
  434. package/dist/accessi-module/Services/PermissionService/PermissionService.js +611 -206
  435. package/dist/accessi-module/Services/PermissionService/PermissionService.js.map +1 -1
  436. package/dist/accessi-module/Services/ServiceTokenService/ServiceTokenService.d.ts +75 -0
  437. package/dist/accessi-module/Services/ServiceTokenService/ServiceTokenService.js +265 -0
  438. package/dist/accessi-module/Services/ServiceTokenService/ServiceTokenService.js.map +1 -0
  439. package/dist/accessi-module/Services/TwoFactorService/TwoFactorService.d.ts +27 -0
  440. package/dist/accessi-module/Services/TwoFactorService/TwoFactorService.js +175 -0
  441. package/dist/accessi-module/Services/TwoFactorService/TwoFactorService.js.map +1 -0
  442. package/dist/accessi-module/Services/UserService/UserService.d.ts +54 -4
  443. package/dist/accessi-module/Services/UserService/UserService.js +488 -269
  444. package/dist/accessi-module/Services/UserService/UserService.js.map +1 -1
  445. package/dist/accessi-module/Views/reset-password.html +213 -213
  446. package/dist/accessi-module/accessiRuntime.d.ts +45 -0
  447. package/dist/accessi-module/accessiRuntime.js +39 -0
  448. package/dist/accessi-module/accessiRuntime.js.map +1 -0
  449. package/dist/accessi-module/database-updates/AccessiDatabaseUpdater.d.ts +51 -10
  450. package/dist/accessi-module/database-updates/AccessiDatabaseUpdater.js +435 -181
  451. package/dist/accessi-module/database-updates/AccessiDatabaseUpdater.js.map +1 -1
  452. package/dist/accessi-module/database-updates/accessiSchema.d.ts +45 -0
  453. package/dist/accessi-module/database-updates/accessiSchema.js +98 -0
  454. package/dist/accessi-module/database-updates/accessiSchema.js.map +1 -0
  455. package/dist/accessi-module/database-updates/optionalColumns.d.ts +7 -0
  456. package/dist/accessi-module/database-updates/optionalColumns.js +58 -0
  457. package/dist/accessi-module/database-updates/optionalColumns.js.map +1 -0
  458. package/dist/accessi-module/database-updates/runAccessiDbUpdate.js +26 -8
  459. package/dist/accessi-module/database-updates/runAccessiDbUpdate.js.map +1 -1
  460. package/dist/accessi-module/federated-auth/FederatedAuthController.d.ts +24 -0
  461. package/dist/accessi-module/federated-auth/FederatedAuthController.js +333 -0
  462. package/dist/accessi-module/federated-auth/FederatedAuthController.js.map +1 -0
  463. package/dist/accessi-module/federated-auth/FederatedAuthService.d.ts +100 -0
  464. package/dist/accessi-module/federated-auth/FederatedAuthService.js +451 -0
  465. package/dist/accessi-module/federated-auth/FederatedAuthService.js.map +1 -0
  466. package/dist/accessi-module/federated-auth/FederatedAuthTypes.d.ts +53 -0
  467. package/dist/accessi-module/federated-auth/FederatedAuthTypes.js +3 -0
  468. package/dist/accessi-module/federated-auth/FederatedAuthTypes.js.map +1 -0
  469. package/dist/accessi-module/index.d.ts +21 -0
  470. package/dist/accessi-module/index.js +69 -19
  471. package/dist/accessi-module/index.js.map +1 -1
  472. package/dist/accessi-module/jwt/jwt.strategy.d.ts +1 -1
  473. package/dist/accessi-module/jwt/jwt.strategy.js +16 -7
  474. package/dist/accessi-module/jwt/jwt.strategy.js.map +1 -1
  475. package/dist/accessi-module/middleware/accessiRequirements.d.ts +23 -1
  476. package/dist/accessi-module/middleware/accessiRequirements.js +7 -0
  477. package/dist/accessi-module/middleware/accessiRequirements.js.map +1 -1
  478. package/dist/accessi-module/middleware/authenticateGen.d.ts +16 -1
  479. package/dist/accessi-module/middleware/authenticateGen.js +63 -25
  480. package/dist/accessi-module/middleware/authenticateGen.js.map +1 -1
  481. package/dist/accessi-module/security/AccessiHttpExceptionFilter.d.ts +12 -0
  482. package/dist/accessi-module/security/AccessiHttpExceptionFilter.js +74 -0
  483. package/dist/accessi-module/security/AccessiHttpExceptionFilter.js.map +1 -0
  484. package/dist/accessi-module/security/accessControl.d.ts +11 -0
  485. package/dist/accessi-module/security/accessControl.js +19 -4
  486. package/dist/accessi-module/security/accessControl.js.map +1 -1
  487. package/dist/accessi-module/security/accessiValidation.d.ts +9 -0
  488. package/dist/accessi-module/security/accessiValidation.js +41 -0
  489. package/dist/accessi-module/security/accessiValidation.js.map +1 -0
  490. package/dist/accessi-module/security/authenticatedToken.d.ts +15 -1
  491. package/dist/accessi-module/security/authenticatedToken.js +31 -4
  492. package/dist/accessi-module/security/authenticatedToken.js.map +1 -1
  493. package/dist/accessi-module/security/emailConfiguration.d.ts +20 -0
  494. package/dist/accessi-module/security/emailConfiguration.js +41 -0
  495. package/dist/accessi-module/security/emailConfiguration.js.map +1 -0
  496. package/dist/accessi-module/security/passwordResetToken.d.ts +13 -3
  497. package/dist/accessi-module/security/passwordResetToken.js +13 -5
  498. package/dist/accessi-module/security/passwordResetToken.js.map +1 -1
  499. package/dist/accessi-module/security/publicAuthRateLimit.d.ts +3 -3
  500. package/dist/accessi-module/security/publicAuthRateLimit.js +30 -8
  501. package/dist/accessi-module/security/publicAuthRateLimit.js.map +1 -1
  502. package/dist/accessi-module/security/serviceTokenGuard.d.ts +25 -0
  503. package/dist/accessi-module/security/serviceTokenGuard.js +85 -0
  504. package/dist/accessi-module/security/serviceTokenGuard.js.map +1 -0
  505. package/dist/accessi-module/security/serviceTokenRateLimit.d.ts +8 -0
  506. package/dist/accessi-module/security/serviceTokenRateLimit.js +49 -0
  507. package/dist/accessi-module/security/serviceTokenRateLimit.js.map +1 -0
  508. package/dist/allegati-module/AllegatiModule.d.ts +12 -1
  509. package/dist/allegati-module/AllegatiModule.js +11 -1
  510. package/dist/allegati-module/AllegatiModule.js.map +1 -1
  511. package/dist/allegati-module/Controllers/AllegatiController.d.ts +2 -1
  512. package/dist/allegati-module/Controllers/AllegatiController.js +23 -15
  513. package/dist/allegati-module/Controllers/AllegatiController.js.map +1 -1
  514. package/dist/allegati-module/Dtos/AllegatoDto.js.map +1 -1
  515. package/dist/allegati-module/Dtos/BaseResponse.js.map +1 -1
  516. package/dist/allegati-module/Dtos/UploadSingleFileRequest.js.map +1 -1
  517. package/dist/allegati-module/Dtos/index.js.map +1 -1
  518. package/dist/allegati-module/Dtos/responses/DownloadAllegatoResponseDto.js.map +1 -1
  519. package/dist/allegati-module/Dtos/responses/GetListResponse.js.map +1 -1
  520. package/dist/allegati-module/Dtos/responses/UploadAllegatoResponseDto.js.map +1 -1
  521. package/dist/allegati-module/Services/AllegatiService/AllegatiService.d.ts +10 -3
  522. package/dist/allegati-module/Services/AllegatiService/AllegatiService.js +150 -101
  523. package/dist/allegati-module/Services/AllegatiService/AllegatiService.js.map +1 -1
  524. package/dist/allegati-module/index.js.map +1 -1
  525. package/dist/allegati-module/security/allegatiAuthorizationGuard.d.ts +14 -0
  526. package/dist/allegati-module/security/allegatiAuthorizationGuard.js +70 -0
  527. package/dist/allegati-module/security/allegatiAuthorizationGuard.js.map +1 -0
  528. package/dist/autobind.d.ts +10 -3
  529. package/dist/autobind.js +24 -9
  530. package/dist/autobind.js.map +1 -1
  531. package/dist/emilsoftware-utilities-2.0.0-dev.31.tgz +0 -0
  532. package/dist/firebird-compat.d.ts +29 -6
  533. package/dist/firebird-compat.js +150 -129
  534. package/dist/firebird-compat.js.map +1 -1
  535. package/dist/index.d.ts +2 -2
  536. package/dist/index.js +2 -2
  537. package/dist/index.js.map +1 -1
  538. package/dist/initEmilsoftwareModule.js +11 -3
  539. package/dist/initEmilsoftwareModule.js.map +1 -1
  540. package/dist/scripts/generateAccessiOpenApi.d.ts +1 -0
  541. package/dist/scripts/generateAccessiOpenApi.js +57 -0
  542. package/dist/scripts/generateAccessiOpenApi.js.map +1 -0
  543. package/dist/scripts/generateAccessiWiki.d.ts +1 -0
  544. package/dist/scripts/generateAccessiWiki.js +131 -0
  545. package/dist/scripts/generateAccessiWiki.js.map +1 -0
  546. package/dist/swagger/SwaggerConfig.d.ts +7 -1
  547. package/dist/swagger/SwaggerConfig.js +22 -8
  548. package/dist/swagger/SwaggerConfig.js.map +1 -1
  549. package/package.json +103 -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"]}
@@ -1,3 +1,10 @@
1
- export declare function autobind<T extends {
2
- new (...args: any[]): any;
3
- }>(constructor: T): T;
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
- return class extends constructor {
6
- constructor(...args) {
7
- super(...args);
8
- Object.getOwnPropertyNames(constructor.prototype).forEach(key => {
9
- const descriptor = Object.getOwnPropertyDescriptor(constructor.prototype, key);
10
- if (descriptor && typeof descriptor.value === 'function' && key !== 'constructor') {
11
- this[key] = this[key].bind(this);
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
@@ -1 +1 @@
1
- {"version":3,"file":"autobind.js","sourceRoot":"","sources":["../src/autobind.ts"],"names":[],"mappings":";;AAAA,4BAYC;AAZD,SAAgB,QAAQ,CAA0C,WAAc;IAC5E,OAAO,KAAM,SAAQ,WAAW;QAC5B,YAAY,GAAG,IAAW;YACtB,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;YACf,MAAM,CAAC,mBAAmB,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;gBAC5D,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,WAAW,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;gBAC/E,IAAI,UAAU,IAAI,OAAO,UAAU,CAAC,KAAK,KAAK,UAAU,IAAI,GAAG,KAAK,aAAa,EAAE,CAAC;oBAChF,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACrC,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["export function autobind<T extends { new (...args: any[]): any }>(constructor: T): T {\r\n return class extends constructor {\r\n constructor(...args: any[]) {\r\n super(...args);\r\n Object.getOwnPropertyNames(constructor.prototype).forEach(key => {\r\n const descriptor = Object.getOwnPropertyDescriptor(constructor.prototype, key);\r\n if (descriptor && typeof descriptor.value === 'function' && key !== 'constructor') {\r\n this[key] = this[key].bind(this);\r\n }\r\n });\r\n }\r\n };\r\n}\r\n"]}
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"]}
@@ -1,15 +1,38 @@
1
- import { Options } from "es-node-firebird";
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
+ compatibilityProbeTimeoutMs?: number;
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;
10
31
  };
11
32
  export declare function normalizeFirebirdOptions(options: Options): FirebirdOptions;
12
- export declare function buildFirebirdCompatibilityCandidates(options: Options): FirebirdOptions[];
13
- export declare function shouldRetryFirebirdCompatibility(error: unknown): boolean;
14
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;
15
37
  export declare function ensureEsNodeFirebirdCompatibilityPatch(): void;
38
+ export {};
@@ -32,167 +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("es-node-firebird"));
42
- const CNCT_PLUGIN_NAME = 8;
43
- const CNCT_PLUGIN_LIST = 10;
44
- const CNCT_CLIENT_CRYPT = 11;
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
- const normalized = String(value !== null && value !== void 0 ? value : "").trim().toLowerCase();
51
- if (normalized === "required") {
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 "disabled";
66
+ return Firebird.WIRE_CRYPT_DISABLE;
56
67
  }
57
- return "enabled";
68
+ return Firebird.WIRE_CRYPT_ENABLE;
58
69
  }
59
70
  function normalizeAuthPlugin(value) {
60
- const normalized = String(value !== null && value !== void 0 ? value : "").trim().toLowerCase();
61
- if (normalized === "legacy_auth" || normalized === "legacy") {
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 toWireCryptFlag(mode) {
70
- switch (mode) {
71
- case "required":
72
- return WIRE_CRYPT_REQUIRED;
73
- case "disabled":
74
- return WIRE_CRYPT_DISABLE;
75
- default:
76
- return WIRE_CRYPT_ENABLE;
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);
101
+ }
102
+ return String(value);
103
+ }
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 : "?"}`;
107
+ }
108
+ function uniqueDiagnostics(values) {
109
+ return values.filter((value, index) => values.indexOf(value) === index);
110
+ }
111
+ function buildDiagnostics(message, options) {
112
+ var _a;
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.");
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);
141
+ }
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;
77
152
  }
78
153
  }
79
- function normalizeAuthPluginList(value) {
80
- if (!Array.isArray(value) || value.length === 0) {
81
- return [...DEFAULT_AUTH_PLUGIN_LIST];
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];
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(", ")}.` : "";
87
172
  }
88
173
  function normalizeFirebirdOptions(options) {
174
+ var _a, _b;
89
175
  const compatibilityOptions = options;
90
- return Object.assign(Object.assign({}, options), { wireCrypt: normalizeWireCryptMode(compatibilityOptions.wireCrypt), pluginName: normalizeAuthPlugin(compatibilityOptions.pluginName), authPlugins: normalizeAuthPluginList(compatibilityOptions.authPlugins) });
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;
91
183
  }
92
- function isRetryableCompatibilityError(error) {
184
+ function describeFirebirdCompatibilityOptions(options) {
93
185
  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");
186
+ const normalized = normalizeFirebirdOptions(options);
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"}`;
99
188
  }
100
- function pushUniqueCandidate(target, candidate) {
189
+ function enhanceFirebirdError(error, options, context) {
101
190
  var _a;
102
- const normalized = normalizeFirebirdOptions(candidate);
103
- const key = `${normalized.pluginName}|${normalized.wireCrypt}|${((_a = normalized.authPlugins) !== null && _a !== void 0 ? _a : []).join(",")}`;
104
- const alreadyPresent = target.some((entry) => {
105
- var _a;
106
- const normalizedEntry = normalizeFirebirdOptions(entry);
107
- return `${normalizedEntry.pluginName}|${normalizedEntry.wireCrypt}|${((_a = normalizedEntry.authPlugins) !== null && _a !== void 0 ? _a : []).join(",")}` === key;
108
- });
109
- if (!alreadyPresent) {
110
- target.push(normalized);
191
+ if (error instanceof Error && error.__emilsoftwareFirebirdEnhanced) {
192
+ return error;
111
193
  }
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;
112
207
  }
113
208
  function buildFirebirdCompatibilityCandidates(options) {
114
- const normalized = normalizeFirebirdOptions(options);
115
- const compatibilityOptions = options;
116
- const hasExplicitPlugin = compatibilityOptions.pluginName !== undefined;
117
- const hasExplicitWireCrypt = compatibilityOptions.wireCrypt !== undefined;
118
- const candidates = [];
119
- pushUniqueCandidate(candidates, normalized);
120
- if (hasExplicitPlugin && hasExplicitWireCrypt) {
121
- return candidates;
122
- }
123
- if (hasExplicitPlugin) {
124
- pushUniqueCandidate(candidates, Object.assign(Object.assign({}, normalized), { wireCrypt: "disabled" }));
125
- pushUniqueCandidate(candidates, Object.assign(Object.assign({}, normalized), { wireCrypt: "enabled" }));
126
- return candidates;
127
- }
128
- if (hasExplicitWireCrypt) {
129
- pushUniqueCandidate(candidates, Object.assign(Object.assign({}, normalized), { pluginName: "Srp256" }));
130
- pushUniqueCandidate(candidates, Object.assign(Object.assign({}, normalized), { pluginName: "Srp" }));
131
- pushUniqueCandidate(candidates, Object.assign(Object.assign({}, normalized), { pluginName: "Legacy_Auth" }));
132
- return candidates;
133
- }
134
- pushUniqueCandidate(candidates, Object.assign(Object.assign({}, normalized), { pluginName: "Srp256", wireCrypt: "enabled" }));
135
- pushUniqueCandidate(candidates, Object.assign(Object.assign({}, normalized), { pluginName: "Srp", wireCrypt: "enabled" }));
136
- pushUniqueCandidate(candidates, Object.assign(Object.assign({}, normalized), { pluginName: "Srp256", wireCrypt: "disabled" }));
137
- pushUniqueCandidate(candidates, Object.assign(Object.assign({}, normalized), { pluginName: "Srp", wireCrypt: "disabled" }));
138
- pushUniqueCandidate(candidates, Object.assign(Object.assign({}, normalized), { pluginName: "Legacy_Auth", wireCrypt: "disabled" }));
139
- return candidates;
140
- }
141
- function shouldRetryFirebirdCompatibility(error) {
142
- return isRetryableCompatibilityError(error);
209
+ return [normalizeFirebirdOptions(options)];
143
210
  }
144
- function describeFirebirdCompatibilityOptions(options) {
145
- var _a;
146
- const normalized = normalizeFirebirdOptions(options);
147
- return `plugin=${normalized.pluginName}, wireCrypt=${normalized.wireCrypt}, authPlugins=${((_a = normalized.authPlugins) !== null && _a !== void 0 ? _a : []).join("/")}`;
211
+ function shouldRetryFirebirdCompatibility() {
212
+ return false;
148
213
  }
149
214
  function ensureEsNodeFirebirdCompatibilityPatch() {
150
- var _a;
151
- const firebird = Firebird;
152
- const connectionPrototype = (_a = firebird.Connection) === null || _a === void 0 ? void 0 : _a.prototype;
153
- if (!(connectionPrototype === null || connectionPrototype === void 0 ? void 0 : connectionPrototype.connect) || connectionPrototype.__emilsoftwareWireCryptPatched) {
154
- return;
155
- }
156
- const originalConnect = connectionPrototype.connect;
157
- connectionPrototype.connect = function patchedConnect(options, callback) {
158
- var _a, _b;
159
- const normalizedOptions = normalizeFirebirdOptions(options);
160
- const wireCryptFlag = toWireCryptFlag(normalizedOptions.wireCrypt);
161
- const authPlugin = normalizedOptions.pluginName;
162
- const authPlugins = (_a = normalizedOptions.authPlugins) !== null && _a !== void 0 ? _a : DEFAULT_AUTH_PLUGIN_LIST;
163
- (_b = this.accept) !== null && _b !== void 0 ? _b : (this.accept = { protocolMinimumType: 0, pluginName: authPlugin });
164
- const blr = this._blr;
165
- const originalAddBytes = blr === null || blr === void 0 ? void 0 : blr.addBytes;
166
- const originalAddString = blr === null || blr === void 0 ? void 0 : blr.addString;
167
- if (!blr || !originalAddBytes || !originalAddString) {
168
- return originalConnect.call(this, normalizedOptions, callback);
169
- }
170
- const patchedOptions = authPlugin === "Srp256"
171
- ? Object.assign(Object.assign({}, normalizedOptions), { pluginName: "Srp" }) : normalizedOptions;
172
- blr.addBytes = function patchedAddBytes(bytes, ...args) {
173
- if (Array.isArray(bytes) && bytes.length === 6 && bytes[0] === CNCT_CLIENT_CRYPT && bytes[1] === 4) {
174
- return originalAddBytes.call(this, [bytes[0], bytes[1], wireCryptFlag, 0, 0, 0], ...args);
175
- }
176
- return originalAddBytes.call(this, bytes, ...args);
177
- };
178
- blr.addString = function patchedAddString(code, value, encoding) {
179
- if (code === CNCT_PLUGIN_NAME) {
180
- return originalAddString.call(this, code, authPlugin, encoding);
181
- }
182
- if (code === CNCT_PLUGIN_LIST) {
183
- return originalAddString.call(this, code, authPlugins.join(","), encoding);
184
- }
185
- return originalAddString.call(this, code, value, encoding);
186
- };
187
- try {
188
- return originalConnect.call(this, patchedOptions, callback);
189
- }
190
- finally {
191
- blr.addBytes = originalAddBytes;
192
- blr.addString = originalAddString;
193
- }
194
- };
195
- connectionPrototype.__emilsoftwareWireCryptPatched = true;
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.
196
218
  }
197
- ensureEsNodeFirebirdCompatibilityPatch();
198
219
  //# sourceMappingURL=firebird-compat.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"firebird-compat.js","sourceRoot":"","sources":["../src/firebird-compat.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8FA,4DAQC;AAuBD,oFAgCC;AAED,4EAEC;AAED,oFAGC;AAED,wFA+DC;AAvOD,2DAA6C;AAc7C,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,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,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};\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}\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\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 pushUniqueCandidate(candidates, { ...normalized, wireCrypt: \"disabled\" });\n pushUniqueCandidate(candidates, { ...normalized, wireCrypt: \"enabled\" });\n return candidates;\n }\n\n if (hasExplicitWireCrypt) {\n pushUniqueCandidate(candidates, { ...normalized, pluginName: \"Srp256\" });\n pushUniqueCandidate(candidates, { ...normalized, pluginName: \"Srp\" });\n pushUniqueCandidate(candidates, { ...normalized, pluginName: \"Legacy_Auth\" });\n return candidates;\n }\n\n pushUniqueCandidate(candidates, { ...normalized, pluginName: \"Srp256\", wireCrypt: \"enabled\" });\n pushUniqueCandidate(candidates, { ...normalized, pluginName: \"Srp\", wireCrypt: \"enabled\" });\n pushUniqueCandidate(candidates, { ...normalized, pluginName: \"Srp256\", wireCrypt: \"disabled\" });\n pushUniqueCandidate(candidates, { ...normalized, pluginName: \"Srp\", wireCrypt: \"disabled\" });\n pushUniqueCandidate(candidates, { ...normalized, pluginName: \"Legacy_Auth\", wireCrypt: \"disabled\" });\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\nensureEsN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AC,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 "es-node-firebird";
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 "es-node-firebird";
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";
package/dist/index.js CHANGED
@@ -41,7 +41,7 @@ const DatabaseUpdater_1 = require("./DatabaseUpdater");
41
41
  Object.defineProperty(exports, "DatabaseUpdater", { enumerable: true, get: function () { return DatabaseUpdater_1.DatabaseUpdater; } });
42
42
  const ExecutionTimeLogger_1 = require("./ExecutionTimeLogger");
43
43
  Object.defineProperty(exports, "ExecutionTimeLogger", { enumerable: true, get: function () { return ExecutionTimeLogger_1.ExecutionTimeLogger; } });
44
- const Firebird = __importStar(require("es-node-firebird"));
44
+ const Firebird = __importStar(require("node-firebird"));
45
45
  exports.Firebird = Firebird;
46
46
  const Logger_1 = require("./Logger");
47
47
  Object.defineProperty(exports, "LogLevels", { enumerable: true, get: function () { return Logger_1.LogLevels; } });
@@ -69,7 +69,7 @@ __exportStar(require("./DatabaseUpdater"), exports);
69
69
  __exportStar(require("./firebird-compat"), exports);
70
70
  __exportStar(require("./accessi-module"), exports);
71
71
  __exportStar(require("./allegati-module"), exports);
72
- __exportStar(require("es-node-firebird"), exports);
72
+ __exportStar(require("node-firebird"), exports);
73
73
  // Unified module exports
74
74
  __exportStar(require("./swagger/SwaggerConfig"), exports);
75
75
  __exportStar(require("./initEmilsoftwareModule"), exports);