fix(mta): Expose HttpResponse.statusCode and add explicit generic type annotations in DNSManager cache retrieval

This commit is contained in:
Philipp Kunz 2025-03-15 14:13:02 +00:00
parent 983e6cb623
commit 4887ec9d93
4 changed files with 10 additions and 4 deletions

View File

@ -1,5 +1,11 @@
# Changelog
## 2025-03-15 - 1.1.2 - fix(mta)
Expose HttpResponse.statusCode and add explicit generic type annotations in DNSManager cache retrieval
- Changed HttpResponse.statusCode from private to public to allow external access and inspection
- Added explicit generic type parameters in getFromCache calls for lookupMx and lookupTxt to enhance type safety
## 2025-03-15 - 1.1.1 - fix(paths)
Update directory paths to use a dedicated 'data' directory and add ensureDirectories function for proper directory creation.

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@serve.zone/platformservice',
version: '1.1.1',
version: '1.1.2',
description: 'A multifaceted platform service handling mail, SMS, letter delivery, and AI services.'
}

View File

@ -141,7 +141,7 @@ class HttpResponse {
private headers: Record<string, string> = {
'Content-Type': 'application/json'
};
private statusCode: number = 200;
public statusCode: number = 200;
constructor(private res: any) {}

View File

@ -71,7 +71,7 @@ export class DNSManager {
const cacheKey = `mx:${domain}`;
// Check cache first
const cached = this.getFromCache(cacheKey);
const cached = this.getFromCache<plugins.dns.MxRecord[]>(cacheKey);
if (cached) {
return cached;
}
@ -103,7 +103,7 @@ export class DNSManager {
const cacheKey = `txt:${domain}`;
// Check cache first
const cached = this.getFromCache(cacheKey);
const cached = this.getFromCache<string[][]>(cacheKey);
if (cached) {
return cached;
}