@vritti/api-sdk 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1299,32 +1299,6 @@ declare class CsrfGuard implements CanActivate {
1299
1299
  canActivate(context: ExecutionContext): Promise<boolean>;
1300
1300
  }
1301
1301
 
1302
- /**
1303
- * Global HTTP Exception Filter
1304
- *
1305
- * Standardizes all error responses in the format:
1306
- * {
1307
- * errors: [{ field: string, message: string }],
1308
- * message?: string,
1309
- * statusCode: number,
1310
- * timestamp: string,
1311
- * path: string
1312
- * }
1313
- *
1314
- * Handles:
1315
- * - Validation errors (class-validator) - Converts to field-specific errors
1316
- * - HTTP exceptions - Maps to standardized format
1317
- * - Unknown errors - Returns generic 500 error
1318
- */
1319
- declare class HttpExceptionFilter implements ExceptionFilter {
1320
- private readonly logger;
1321
- catch(exception: unknown, host: ArgumentsHost): void;
1322
- /**
1323
- * Parse class-validator error messages into field-specific errors
1324
- */
1325
- private parseValidationErrors;
1326
- }
1327
-
1328
1302
  /**
1329
1303
  * Converts an HTTP status code to its corresponding title string.
1330
1304
  * Uses the HttpStatus enum to map status codes to human-readable titles.
@@ -1338,6 +1312,27 @@ declare class HttpExceptionFilter implements ExceptionFilter {
1338
1312
  * getHttpStatusTitle(500) // Returns: "Internal Server Error"
1339
1313
  */
1340
1314
  declare function getHttpStatusTitle(status: number): string;
1315
+ /**
1316
+ * Global HTTP Exception Filter implementing RFC 7807 Problem Details
1317
+ *
1318
+ * Transforms all exceptions into a standardized RFC 7807 format:
1319
+ * {
1320
+ * title: string, // Human-readable status title
1321
+ * status: number, // HTTP status code
1322
+ * detail: string, // Detailed error description
1323
+ * errors: FieldError[] // Field-specific error messages
1324
+ * }
1325
+ *
1326
+ * Handles:
1327
+ * - Custom field exceptions from @vritti/api-sdk (BaseFieldException)
1328
+ * - Class-validator DTO validation errors
1329
+ * - Standard NestJS HTTP exceptions
1330
+ * - Unknown errors
1331
+ */
1332
+ declare class HttpExceptionFilter implements ExceptionFilter {
1333
+ private readonly logger;
1334
+ catch(exception: unknown, host: ArgumentsHost): void;
1335
+ }
1341
1336
 
1342
1337
  interface FieldError$1 {
1343
1338
  field?: string;
package/dist/index.d.ts CHANGED
@@ -1299,32 +1299,6 @@ declare class CsrfGuard implements CanActivate {
1299
1299
  canActivate(context: ExecutionContext): Promise<boolean>;
1300
1300
  }
1301
1301
 
1302
- /**
1303
- * Global HTTP Exception Filter
1304
- *
1305
- * Standardizes all error responses in the format:
1306
- * {
1307
- * errors: [{ field: string, message: string }],
1308
- * message?: string,
1309
- * statusCode: number,
1310
- * timestamp: string,
1311
- * path: string
1312
- * }
1313
- *
1314
- * Handles:
1315
- * - Validation errors (class-validator) - Converts to field-specific errors
1316
- * - HTTP exceptions - Maps to standardized format
1317
- * - Unknown errors - Returns generic 500 error
1318
- */
1319
- declare class HttpExceptionFilter implements ExceptionFilter {
1320
- private readonly logger;
1321
- catch(exception: unknown, host: ArgumentsHost): void;
1322
- /**
1323
- * Parse class-validator error messages into field-specific errors
1324
- */
1325
- private parseValidationErrors;
1326
- }
1327
-
1328
1302
  /**
1329
1303
  * Converts an HTTP status code to its corresponding title string.
1330
1304
  * Uses the HttpStatus enum to map status codes to human-readable titles.
@@ -1338,6 +1312,27 @@ declare class HttpExceptionFilter implements ExceptionFilter {
1338
1312
  * getHttpStatusTitle(500) // Returns: "Internal Server Error"
1339
1313
  */
1340
1314
  declare function getHttpStatusTitle(status: number): string;
1315
+ /**
1316
+ * Global HTTP Exception Filter implementing RFC 7807 Problem Details
1317
+ *
1318
+ * Transforms all exceptions into a standardized RFC 7807 format:
1319
+ * {
1320
+ * title: string, // Human-readable status title
1321
+ * status: number, // HTTP status code
1322
+ * detail: string, // Detailed error description
1323
+ * errors: FieldError[] // Field-specific error messages
1324
+ * }
1325
+ *
1326
+ * Handles:
1327
+ * - Custom field exceptions from @vritti/api-sdk (BaseFieldException)
1328
+ * - Class-validator DTO validation errors
1329
+ * - Standard NestJS HTTP exceptions
1330
+ * - Unknown errors
1331
+ */
1332
+ declare class HttpExceptionFilter implements ExceptionFilter {
1333
+ private readonly logger;
1334
+ catch(exception: unknown, host: ArgumentsHost): void;
1335
+ }
1341
1336
 
1342
1337
  interface FieldError$1 {
1343
1338
  field?: string;