blaizejs 0.5.2 → 0.6.0
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/{chunk-EB3TZGU4.js → chunk-5C4WI3A7.js} +3 -3
- package/dist/chunk-EOCNAQ76.js +11 -0
- package/dist/{chunk-DN5WHXRA.js.map → chunk-EOCNAQ76.js.map} +1 -1
- package/dist/{chunk-QYXAQD7H.js → chunk-GNLJMVOB.js} +3 -3
- package/dist/{chunk-RUCGYLJ6.js → chunk-WTCIDURS.js} +3 -3
- package/dist/{chunk-4QEX5ARZ.js → chunk-YE7LYWE6.js} +3 -3
- package/dist/index.cjs +14 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1663 -1467
- package/dist/index.d.ts +1663 -1467
- package/dist/index.js +14 -14
- package/dist/index.js.map +1 -1
- package/dist/{internal-server-error-I43ZDXIR.js → internal-server-error-MFDGHZTW.js} +3 -3
- package/dist/{payload-too-large-error-OQEOP3U2.js → payload-too-large-error-JESAYGED.js} +3 -3
- package/dist/{unsupported-media-type-error-7UF4VYIN.js → unsupported-media-type-error-ZDQCGXCO.js} +3 -3
- package/dist/{validation-error-ZPBPCFKL.js → validation-error-KGPRZ5X7.js} +3 -3
- package/package.json +2 -2
- package/dist/chunk-DN5WHXRA.js +0 -11
- /package/dist/{chunk-EB3TZGU4.js.map → chunk-5C4WI3A7.js.map} +0 -0
- /package/dist/{chunk-QYXAQD7H.js.map → chunk-GNLJMVOB.js.map} +0 -0
- /package/dist/{chunk-RUCGYLJ6.js.map → chunk-WTCIDURS.js.map} +0 -0
- /package/dist/{chunk-4QEX5ARZ.js.map → chunk-YE7LYWE6.js.map} +0 -0
- /package/dist/{internal-server-error-I43ZDXIR.js.map → internal-server-error-MFDGHZTW.js.map} +0 -0
- /package/dist/{payload-too-large-error-OQEOP3U2.js.map → payload-too-large-error-JESAYGED.js.map} +0 -0
- /package/dist/{unsupported-media-type-error-7UF4VYIN.js.map → unsupported-media-type-error-ZDQCGXCO.js.map} +0 -0
- /package/dist/{validation-error-ZPBPCFKL.js.map → validation-error-KGPRZ5X7.js.map} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* blaizejs v0.
|
|
3
|
+
* blaizejs v0.6.0
|
|
4
4
|
* A blazing-fast, TypeScript-first Node.js framework with HTTP/2 support, file-based routing, powerful middleware system, and end-to-end type safety for building modern APIs.
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) 2025 BlaizeJS Contributors
|
|
7
7
|
* @license MIT
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import{c as r,
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
10
|
+
import{c as r,f as e}from"./chunk-EOCNAQ76.js";var i=class extends r{constructor(o,t=void 0,n=void 0){super("VALIDATION_ERROR",o,400,n??e(),t)}};export{i as a};
|
|
11
|
+
//# sourceMappingURL=chunk-5C4WI3A7.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* blaizejs v0.6.0
|
|
4
|
+
* A blazing-fast, TypeScript-first Node.js framework with HTTP/2 support, file-based routing, powerful middleware system, and end-to-end type safety for building modern APIs.
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) 2025 BlaizeJS Contributors
|
|
7
|
+
* @license MIT
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var u=(e=>(e.VALIDATION_ERROR="VALIDATION_ERROR",e.NOT_FOUND="NOT_FOUND",e.UNAUTHORIZED="UNAUTHORIZED",e.FORBIDDEN="FORBIDDEN",e.SSE_NOT_ACCEPTABLE="SSE_NOT_ACCEPTABLE",e.CONFLICT="CONFLICT",e.RATE_LIMITED="RATE_LIMITED",e.INTERNAL_SERVER_ERROR="INTERNAL_SERVER_ERROR",e.PAYLOAD_TOO_LARGE="PAYLOAD_TOO_LARGE",e.UNSUPPORTED_MEDIA_TYPE="UNSUPPORTED_MEDIA_TYPE",e.UPLOAD_TIMEOUT="UPLOAD_TIMEOUT",e.UNPROCESSABLE_ENTITY="UNPROCESSABLE_ENTITY",e.NETWORK_ERROR="NETWORK_ERROR",e.TIMEOUT_ERROR="TIMEOUT_ERROR",e.PARSE_ERROR="PARSE_ERROR",e.HTTP_ERROR="HTTP_ERROR",e.SSE_CONNECTION_ERROR="SSE_CONNECTION_ERROR",e.SSE_BUFFER_OVERFLOW="SSE_BUFFER_OVERFLOW",e.SSE_STREAM_CLOSED="SSE_STREAM_CLOSED",e.SERVICE_UNAVAILABLE="SERVICE_UNAVAILABLE",e))(u||{}),d=(o=>(o.LOW="low",o.MEDIUM="medium",o.HIGH="high",o.CRITICAL="critical",o))(d||{}),c=class extends Error{type;title;status;correlationId;timestamp;details;constructor(r,n,i,o,l){super(n),this.name=this.constructor.name,this.type=r,this.title=n,this.status=i,this.correlationId=o,this.timestamp=new Date,this.details=l,Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toJSON(){let r={type:this.type,title:this.title,status:this.status,correlationId:this.correlationId,timestamp:this.timestamp.toISOString()};return this.details!==void 0?{...r,details:this.details}:r}toString(){return`${this.name}: ${this.title} [${this.correlationId}]`}};import{AsyncLocalStorage as m}from"node:async_hooks";var a={headerName:"x-correlation-id",generator:E},s={...a},g=new m;function E(){let t=Date.now().toString(36),r=Math.random().toString(36).substr(2,9);return`req_${t}_${r}`}function _(t,r){s={headerName:t||a.headerName,generator:r||a.generator}}function S(){return s.headerName}function p(){return s.generator()}function I(){let t=g.getStore();return t&&t.trim()?t:"unknown"}function C(t,r){return g.run(t,r)}function T(t){let r=s.headerName,n=t[r],i;return Array.isArray(n)?i=n[0]:typeof n=="string"&&(i=n),i&&i.trim()?i:p()}export{u as a,d as b,c,_ as d,S as e,I as f,C as g,T as h};
|
|
11
|
+
//# sourceMappingURL=chunk-EOCNAQ76.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../blaize-types/src/errors.ts","../src/tracing/correlation.ts"],"sourcesContent":["/**\n * Error type definitions and interfaces for the BlaizeJS framework\n *\n * This module contains all the type definitions used for error handling\n * across the BlaizeJS framework, including server-side errors, client-side\n * errors, and HTTP response formats.\n */\n\n/**\n * Structure of error responses sent over HTTP\n *\n * This interface defines the JSON format used for all error responses\n * from BlaizeJS servers. It matches the structure returned by BlaizeError.toJSON()\n *\n * @example\n * ```json\n * {\n * \"type\": \"VALIDATION_ERROR\",\n * \"title\": \"Request validation failed\",\n * \"status\": 400,\n * \"correlationId\": \"req_abc123\",\n * \"timestamp\": \"2024-01-15T10:30:00.000Z\",\n * \"details\": {\n * \"fields\": [\"email\", \"password\"]\n * }\n * }\n * ```\n */\nexport interface BlaizeErrorResponse {\n /** Error type from the ErrorType enum */\n type: ErrorType;\n\n /** Human-readable error message */\n title: string;\n\n /** HTTP status code */\n status: number;\n\n /** Correlation ID for request tracing */\n correlationId: string;\n\n /** ISO timestamp when error occurred */\n timestamp: string;\n\n /** Optional error-specific details */\n details?: unknown;\n}\n\n/**\n * Context information for network-related errors\n *\n * Used by client-side error classes to provide additional context\n * about network failures, timeouts, and connection issues.\n */\nexport interface NetworkErrorContext {\n /** The URL that failed */\n url: string;\n\n /** HTTP method being attempted */\n method: string;\n\n /** Correlation ID for tracing */\n correlationId: string;\n\n /** Timeout value if applicable */\n timeout?: number;\n\n /** The original error that caused the network failure */\n originalError: Error;\n\n /** Additional network-specific details */\n networkDetails?: {\n /** Whether this was a connection timeout */\n isTimeout?: boolean;\n\n /** Whether this was a DNS resolution failure */\n isDnsFailure?: boolean;\n\n /** Whether this was a connection refused error */\n isConnectionRefused?: boolean;\n\n /** HTTP status code if received before failure */\n statusCode?: number;\n };\n}\n\n/**\n * Context information for request timeout errors\n *\n * Specialized context for timeout-specific errors with timing information.\n */\nexport interface TimeoutErrorContext {\n /** The URL that timed out */\n url: string;\n\n /** HTTP method being attempted */\n method: string;\n\n /** Correlation ID for tracing */\n correlationId: string;\n\n /** Configured timeout value in milliseconds */\n timeoutMs: number;\n\n /** Actual duration before timeout in milliseconds */\n elapsedMs: number;\n\n /** Type of timeout (request, connection, etc.) */\n timeoutType: 'request' | 'connection' | 'response' | 'idle';\n}\n\n/**\n * Context information for response parsing errors\n *\n * Used when the client receives a response but cannot parse it properly.\n */\nexport interface ParseErrorContext {\n /** The URL that returned unparseable content */\n url: string;\n\n /** HTTP method used */\n method: string;\n\n /** Correlation ID for tracing */\n correlationId: string;\n\n /** HTTP status code received */\n statusCode: number;\n\n /** Content-Type header if available */\n contentType?: string;\n\n /** Expected response format */\n expectedFormat: 'json' | 'text' | 'binary';\n\n /** Sample of the actual response content (truncated for safety) */\n responseSample?: string;\n\n /** The original parsing error */\n originalError: Error;\n}\n\n/**\n * Validation error field details\n *\n * Structure for field-level validation errors with multiple error messages\n * per field.\n */\nexport interface ValidationFieldError {\n /** Field name or path (e.g., \"email\", \"user.profile.name\") */\n field: string;\n\n /** Array of error messages for this field */\n messages: string[];\n\n /** The invalid value that caused the error */\n rejectedValue?: unknown;\n\n /** Expected type or format */\n expectedType?: string;\n}\n\nexport interface ServiceNotAvailableDetails {\n /** Service that's unavailable */\n service?: string;\n\n /** Seconds to wait before retry */\n retryAfter?: number;\n\n /** Why service is unavailable */\n reason?: 'maintenance' | 'overload' | 'circuit_breaker' | 'dependency_down';\n\n /** Additional context */\n [key: string]: unknown;\n}\n\n/**\n * Validation error details structure\n *\n * Used by ValidationError to provide structured information about\n * what fields failed validation and why.\n */\nexport interface ValidationErrorDetails {\n /** Array of field-level errors */\n fields: ValidationFieldError[];\n\n /** Total number of validation errors */\n errorCount: number;\n\n /** The section that failed validation */\n section: 'params' | 'query' | 'body' | 'response';\n\n /** Schema name if available */\n schemaName?: string;\n}\n\n/**\n * All available error types in the BlaizeJS framework\n *\n * This enum provides both compile-time type safety and runtime values\n * for error type identification across server and client packages.\n *\n * @example Type-safe error handling:\n * ```typescript\n * function handleError(errorType: ErrorType) {\n * switch (errorType) {\n * case ErrorType.VALIDATION_ERROR:\n * // Handle validation error\n * break;\n * case ErrorType.NOT_FOUND:\n * // Handle not found error\n * break;\n * // TypeScript ensures all cases are covered\n * }\n * }\n * ```\n */\nexport enum ErrorType {\n // Server-side business logic errors\n /** Request validation failed (400) */\n VALIDATION_ERROR = 'VALIDATION_ERROR',\n\n /** Resource not found (404) */\n NOT_FOUND = 'NOT_FOUND',\n\n /** Authentication required (401) */\n UNAUTHORIZED = 'UNAUTHORIZED',\n\n /** Access forbidden (403) */\n FORBIDDEN = 'FORBIDDEN',\n\n /** SSE Not Acceptable (406) */\n SSE_NOT_ACCEPTABLE = 'SSE_NOT_ACCEPTABLE',\n\n /** Resource conflict (409) */\n CONFLICT = 'CONFLICT',\n\n /** Rate limit exceeded (429) */\n RATE_LIMITED = 'RATE_LIMITED',\n\n /** Internal server error (500) */\n INTERNAL_SERVER_ERROR = 'INTERNAL_SERVER_ERROR',\n\n /** File/Request Too Large (413) */\n PAYLOAD_TOO_LARGE = 'PAYLOAD_TOO_LARGE',\n\n /** Wrong Content Type (415) */\n UNSUPPORTED_MEDIA_TYPE = 'UNSUPPORTED_MEDIA_TYPE',\n\n /** Upload Timeout (408) */\n UPLOAD_TIMEOUT = 'UPLOAD_TIMEOUT',\n\n /** Valid Format Invalid Semantics (422) */\n UNPROCESSABLE_ENTITY = 'UNPROCESSABLE_ENTITY',\n\n // Client-side errors\n /** Network connectivity failure (0) */\n NETWORK_ERROR = 'NETWORK_ERROR',\n\n /** Request or response timeout (0) */\n TIMEOUT_ERROR = 'TIMEOUT_ERROR',\n\n /** Response parsing failure (0) */\n PARSE_ERROR = 'PARSE_ERROR',\n\n /** Generic HTTP error (varies) */\n HTTP_ERROR = 'HTTP_ERROR',\n\n // SSE-specific errors\n /** SSE connection failed (502) */\n SSE_CONNECTION_ERROR = 'SSE_CONNECTION_ERROR',\n\n /** SSE buffer overflow (503) */\n SSE_BUFFER_OVERFLOW = 'SSE_BUFFER_OVERFLOW',\n\n /** SSE stream closed (410) */\n SSE_STREAM_CLOSED = 'SSE_STREAM_CLOSED',\n\n /** Service temporarily unavailable (503) */\n SERVICE_UNAVAILABLE = 'SERVICE_UNAVAILABLE',\n}\n\n/**\n * Error severity levels for logging and monitoring\n *\n * Provides a way to categorize errors by their impact and urgency.\n */\nexport enum ErrorSeverity {\n /** Low impact, often user errors */\n LOW = 'low',\n\n /** Medium impact, application errors */\n MEDIUM = 'medium',\n\n /** High impact, system errors */\n HIGH = 'high',\n\n /** Critical impact, service disruption */\n CRITICAL = 'critical',\n}\n\n/**\n * Abstract base class for all BlaizeJS errors\n *\n * This class provides the foundation for all error types in the BlaizeJS framework.\n * It extends JavaScript's built-in Error class and adds framework-specific properties\n * for consistent error handling across server and client.\n *\n * @example\n * ```typescript\n * import { ErrorType } from './types';\n *\n * class NotFoundError extends BlaizeError<{ resourceId: string }> {\n * constructor(message = 'Resource not found', details?: { resourceId: string }) {\n * super(ErrorType.NOT_FOUND, message, 404, getCurrentCorrelationId(), details);\n * }\n * }\n * ```\n *\n * @template TDetails - Type for error-specific details object\n */\nexport abstract class BlaizeError<TDetails = unknown> extends Error {\n /**\n * Error type identifier from the ErrorType enum\n * Used for programmatic error handling and client-side error routing\n */\n readonly type: ErrorType;\n\n /**\n * Human-readable error title/message\n * Should be descriptive enough for debugging but safe for end users\n */\n readonly title: string;\n\n /**\n * HTTP status code associated with this error\n * Used by the error boundary to set appropriate response status\n */\n readonly status: number;\n\n /**\n * Correlation ID for request tracing\n * Links this error to the specific request that generated it\n */\n readonly correlationId: string;\n\n /**\n * Timestamp when the error occurred\n * Useful for debugging and log correlation\n */\n readonly timestamp: Date;\n\n /**\n * Additional error-specific details\n * Type-safe error context that varies by error type\n */\n readonly details?: TDetails | undefined;\n\n /**\n * Creates a new BlaizeError instance\n *\n * @param type - Error type from the ErrorType enum\n * @param title - Human-readable error message\n * @param status - HTTP status code\n * @param correlationId - Request correlation ID for tracing\n * @param details - Optional error-specific details\n */\n protected constructor(\n type: ErrorType,\n title: string,\n status: number,\n correlationId: string,\n details?: TDetails | undefined\n ) {\n super(title);\n\n // Set the error name to the class name for better stack traces\n this.name = this.constructor.name;\n\n // Framework-specific properties\n this.type = type;\n this.title = title;\n this.status = status;\n this.correlationId = correlationId;\n this.timestamp = new Date();\n this.details = details;\n\n // Maintain proper prototype chain for instanceof checks\n Object.setPrototypeOf(this, new.target.prototype);\n\n // Capture stack trace if available (V8 feature)\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n\n /**\n * Serializes the error to a plain object suitable for HTTP responses\n *\n * @returns Object representation of the error\n */\n toJSON() {\n const base = {\n type: this.type,\n title: this.title,\n status: this.status,\n correlationId: this.correlationId,\n timestamp: this.timestamp.toISOString(),\n };\n\n // Only include details if they are not undefined\n if (this.details !== undefined) {\n return { ...base, details: this.details };\n }\n\n return base;\n }\n\n /**\n * Returns a string representation of the error\n * Includes correlation ID for easier debugging\n */\n toString(): string {\n return `${this.name}: ${this.title} [${this.correlationId}]`;\n }\n}\n\n/**\n * Interface for payload too large error details\n */\nexport interface PayloadTooLargeErrorDetails {\n fileCount?: number;\n maxFiles?: number;\n filename?: string;\n field?: string;\n contentType?: string;\n currentSize?: number;\n maxSize?: number;\n}\n\n/**\n * Interface for unsupported media type error details\n */\nexport interface UnsupportedMediaTypeErrorDetails {\n receivedMimeType?: string;\n allowedMimeTypes?: string[];\n filename?: string;\n}\n\n/**\n * Interface for authentication error details\n */\nexport interface UnauthorizedErrorDetails {\n /** Reason for authentication failure */\n reason?:\n | 'missing_token'\n | 'invalid_token'\n | 'expired_token'\n | 'malformed_token'\n | 'insufficient_scope'\n | string;\n\n /** Authentication scheme (Bearer, Basic, etc.) */\n authScheme?: string;\n\n /** Authentication realm */\n realm?: string;\n\n /** Detailed error description */\n error_description?: string;\n\n /** Required scopes or permissions */\n requiredScopes?: string[];\n\n /** Login URL for interactive authentication */\n loginUrl?: string;\n\n /** Additional context */\n [key: string]: unknown;\n}\n\n/**\n * Interface for authorization/permission error details\n */\nexport interface ForbiddenErrorDetails {\n /** Required permission or role */\n requiredPermission?: string;\n\n /** User's current permissions */\n userPermissions?: string[];\n\n /** Resource being accessed */\n resource?: string;\n\n /** Action being attempted */\n action?: string;\n\n /** Reason for access denial */\n reason?:\n | 'insufficient_permissions'\n | 'account_suspended'\n | 'resource_locked'\n | 'origin_not_allowed'\n | string;\n\n /** Additional context */\n [key: string]: unknown;\n}\n\n/**\n * Interface for resource conflict error details\n */\nexport interface ConflictErrorDetails {\n /** Type of conflict */\n conflictType?:\n | 'duplicate_key'\n | 'version_mismatch'\n | 'concurrent_modification'\n | 'business_rule'\n | string;\n\n /** Field that caused the conflict */\n field?: string;\n\n /** Existing value that conflicts */\n existingValue?: unknown;\n\n /** Provided value that conflicts */\n providedValue?: unknown;\n\n /** Resource that has the conflicting value */\n conflictingResource?: string;\n\n /** Current version/etag of the resource */\n currentVersion?: string;\n\n /** Expected version/etag */\n expectedVersion?: string;\n\n /** Suggested resolution */\n resolution?: string;\n\n /** Additional context */\n [key: string]: unknown;\n}\n\n/**\n * Interface for rate limiting error details\n */\nexport interface RateLimitErrorDetails {\n /** Maximum requests allowed in the time window */\n limit?: number;\n\n /** Remaining requests in current window */\n remaining?: number;\n\n /** When the rate limit resets */\n resetTime?: Date;\n\n /** Seconds until the rate limit resets */\n retryAfter?: number;\n\n /** Time window for the rate limit */\n window?: string;\n\n /** Identifier used for rate limiting (IP, user ID, etc.) */\n identifier?: string;\n\n /** Type of rate limit hit */\n limitType?: 'global' | 'per_user' | 'per_ip' | 'per_endpoint' | string;\n\n /** Additional context */\n [key: string]: unknown;\n}\n\n/**\n * Interface for internal server error details\n */\nexport interface InternalServerErrorDetails {\n /** Original error message (for debugging) */\n originalError?: string;\n\n /** Stack trace (for debugging) */\n stackTrace?: string;\n\n /** Component where the error occurred */\n component?: string;\n\n /** Operation being performed */\n operation?: string;\n\n /** Internal error code */\n internalErrorCode?: string;\n\n /** When the error occurred */\n timestamp?: Date;\n\n /** Whether this error should be retryable */\n retryable?: boolean;\n\n /** Additional debugging context */\n [key: string]: unknown;\n}\n\n/**\n * Interface for NotFound error details\n * Provides context about the missing resource\n */\nexport interface NotFoundErrorDetails {\n /** Type of resource that was not found */\n resourceType?: string;\n\n /** ID or identifier of the resource */\n resourceId?: string;\n\n /** Collection or table where the resource was searched */\n collection?: string;\n\n /** Search criteria that was used */\n query?: Record<string, unknown>;\n\n /** Search criteria that was used (for backward compatibility) */\n searchCriteria?: Record<string, unknown>;\n\n /** The path that was attempted */\n path?: string;\n\n /** HTTP method used (for API endpoints) */\n method?: string;\n\n /** The path that was attempted (for backward compatibility) */\n attemptedPath?: string;\n\n /** Parent resource information for nested resources */\n parentResource?: {\n type: string;\n id: string;\n };\n\n /** Helpful suggestion for the user */\n suggestion?: string;\n\n /** Additional context */\n [key: string]: unknown;\n}\n\n// TODO: This can potentiall be removed\n/**\n * Interface for body parsing errors stored in context state\n */\nexport interface BodyParseError {\n /**\n * Type of parsing error that occurred\n */\n readonly type:\n | 'json_parse_error'\n | 'form_parse_error'\n | 'multipart_parse_error'\n | 'body_read_error';\n\n /**\n * Human-readable error message\n */\n readonly message: string;\n\n /**\n * Original error object or details\n */\n readonly error: unknown;\n}\n\n// TODO: Consider moving to blaize-core\n/**\n * Type guard to check if an object is a BodyParseError\n */\nexport function isBodyParseError(error: unknown): error is BodyParseError {\n return (\n typeof error === 'object' &&\n error !== null &&\n 'type' in error &&\n 'message' in error &&\n 'error' in error &&\n typeof (error as any).type === 'string' &&\n typeof (error as any).message === 'string'\n );\n}\n\n/**\n * Context information for error transformation\n */\nexport interface ErrorTransformContext {\n url: string;\n method: string;\n correlationId: string;\n timeoutMs?: number;\n elapsedMs?: number;\n statusCode?: number;\n contentType?: string;\n responseSample?: string;\n [key: string]: unknown;\n}\n\n/**\n * SSE-specific error detail interfaces for BlaizeJS framework\n *\n * These interfaces define the structure of details for SSE errors.\n * The actual error classes are implemented in blaize-core.\n */\n\n/**\n * Details for SSE connection errors\n */\nexport interface SSEConnectionErrorDetails {\n /** Client identifier if available */\n clientId?: string;\n\n /** Connection attempt number */\n attemptNumber?: number;\n\n /** Maximum retry attempts configured */\n maxRetries?: number;\n\n /** The underlying error that caused connection failure */\n cause?: string;\n\n /** Suggested resolution */\n suggestion?: string;\n}\n\n/**\n * Details for SSE buffer overflow errors\n */\nexport interface SSEBufferOverflowErrorDetails {\n /** Client identifier */\n clientId?: string;\n\n /** Current buffer size when overflow occurred */\n currentSize: number;\n\n /** Maximum buffer size configured */\n maxSize: number;\n\n /** Number of events dropped */\n eventsDropped?: number;\n\n /** Buffer strategy that was applied */\n strategy: 'drop-oldest' | 'drop-newest' | 'close';\n\n /** Event that triggered the overflow */\n triggeringEvent?: string;\n}\n\n/**\n * Details for SSE stream closed errors\n */\nexport interface SSEStreamClosedErrorDetails {\n /** Client identifier */\n clientId?: string;\n\n /** When the stream was closed */\n closedAt?: string;\n\n /** Reason for closure */\n closeReason?: 'client-disconnect' | 'server-close' | 'timeout' | 'error' | 'buffer-overflow';\n\n /** Whether reconnection is possible */\n canReconnect?: boolean;\n\n /** Suggested retry interval in milliseconds */\n retryAfter?: number;\n}\n\n/**\n * Context for SSE connection errors\n */\nexport interface SSEConnectionErrorContext {\n /** The SSE endpoint URL */\n url: string;\n\n /** Correlation ID for tracing */\n correlationId: string;\n\n /** Connection state when error occurred */\n state: 'connecting' | 'connected' | 'disconnected' | 'closed';\n\n /** Number of reconnection attempts made */\n reconnectAttempts?: number;\n\n /** The original error if available */\n originalError?: Error;\n\n /** Additional SSE-specific details */\n sseDetails?: {\n /** Whether credentials were included */\n withCredentials?: boolean;\n\n /** Last received event ID */\n lastEventId?: string;\n\n /** EventSource ready state */\n readyState?: number;\n };\n}\n\n/**\n * Context for SSE stream errors (server-sent errors)\n */\nexport interface SSEStreamErrorContext {\n /** The SSE endpoint URL */\n url: string;\n\n /** Correlation ID from server or client */\n correlationId: string;\n\n /** Error message from server */\n message: string;\n\n /** Error code if provided */\n code?: string;\n\n /** Error name/type from server */\n name?: string;\n\n /** Raw error data from server */\n rawData?: any;\n}\n\n/**\n * Context for SSE heartbeat timeout errors\n */\nexport interface SSEHeartbeatErrorContext {\n /** The SSE endpoint URL */\n url: string;\n\n /** Correlation ID for tracing */\n correlationId: string;\n\n /** Configured heartbeat timeout in ms */\n heartbeatTimeout: number;\n\n /** Time since last event in ms */\n timeSinceLastEvent?: number;\n\n /** Last event ID received */\n lastEventId?: string;\n}\n","/**\n * Correlation ID system for request tracing across async operations\n *\n * This module provides utilities for generating, storing, and accessing\n * correlation IDs that follow requests through the entire application stack.\n * Uses AsyncLocalStorage for automatic context propagation.\n */\n\nimport { AsyncLocalStorage } from 'node:async_hooks';\n\nimport type { CorrelationConfig } from '@blaize-types/tracing';\n\n/**\n * Default configuration values\n * @internal\n */\nconst DEFAULT_CONFIG: CorrelationConfig = {\n headerName: 'x-correlation-id',\n generator: defaultCorrelationIdGenerator,\n};\n\n/**\n * Current configuration (mutable for server customization)\n * @internal\n */\nlet currentConfig: CorrelationConfig = { ...DEFAULT_CONFIG };\n\n/**\n * AsyncLocalStorage instance for storing correlation IDs\n * Separate from the main context storage to allow independent lifecycle management\n */\nconst correlationStorage = new AsyncLocalStorage<string>();\n\n/**\n * Default correlation ID generator\n *\n * Format: req_[timestamp_base36]_[random_base36]\n * Example: req_k3x2m1_9z8y7w6v\n *\n * @internal\n */\nfunction defaultCorrelationIdGenerator(): string {\n const timestamp = Date.now().toString(36); // Base36 encoded timestamp\n const random = Math.random().toString(36).substr(2, 9); // Base36 random string\n return `req_${timestamp}_${random}`;\n}\n\n/**\n * Sets the correlation configuration (internal use only)\n *\n * This function is called by the server during initialization to configure\n * the correlation ID system. It should not be called directly by application code.\n *\n * @param headerName - The HTTP header name to use for correlation IDs\n * @param generator - Custom correlation ID generator function\n * @internal\n */\nexport function _setCorrelationConfig(headerName?: string, generator?: () => string): void {\n currentConfig = {\n headerName: headerName || DEFAULT_CONFIG.headerName,\n generator: generator || DEFAULT_CONFIG.generator,\n };\n}\n\n/**\n * Gets the configured correlation header name\n *\n * @returns The configured header name (defaults to 'x-correlation-id')\n * @internal\n */\nexport function getCorrelationHeaderName(): string {\n return currentConfig.headerName;\n}\n\n/**\n * Resets the correlation configuration to defaults\n *\n * Primarily used for testing to ensure clean state between tests\n *\n * @internal\n */\nexport function _resetCorrelationConfig(): void {\n currentConfig = { ...DEFAULT_CONFIG };\n}\n\n/**\n * Generates a new unique correlation ID\n *\n * Uses the configured generator function, which defaults to the format:\n * req_[timestamp_base36]_[random_base36]\n * Example: req_k3x2m1_9z8y7w6v\n *\n * @returns A unique correlation ID string\n */\nexport function generateCorrelationId(): string {\n return currentConfig.generator();\n}\n\n/**\n * Gets the current correlation ID from AsyncLocalStorage\n *\n * @returns The current correlation ID, or 'unknown' if none is set\n */\nexport function getCorrelationId(): string {\n const stored = correlationStorage.getStore();\n return stored && stored.trim() ? stored : 'unknown';\n}\n\n/**\n * Sets the correlation ID in the current AsyncLocalStorage context\n *\n * This will affect the current execution context and any subsequent\n * async operations that inherit from it.\n *\n * @param correlationId - The correlation ID to set\n */\nexport function setCorrelationId(correlationId: string): void {\n correlationStorage.enterWith(correlationId);\n}\n\n/**\n * Runs a function with a specific correlation ID\n *\n * Creates a new AsyncLocalStorage context with the provided correlation ID.\n * The correlation ID will be available to the function and any async operations\n * it spawns, but will not affect the parent context.\n *\n * @param correlationId - The correlation ID to use for this context\n * @param fn - The function to run with the correlation ID\n * @returns The result of the function\n *\n * @example\n * ```typescript\n * const result = await withCorrelationId('req_123', async () => {\n * console.log(getCurrentCorrelationId()); // 'req_123'\n * return await processRequest();\n * });\n * ```\n */\nexport function withCorrelationId<T>(\n correlationId: string,\n fn: () => T | Promise<T>\n): T | Promise<T> {\n return correlationStorage.run(correlationId, fn);\n}\n\n/**\n * Extracts correlation ID from headers or generates a new one\n *\n * Looks for the configured correlation header (default: 'x-correlation-id').\n * If not found, empty, or undefined, generates a new correlation ID.\n * Supports both string and string[] header values for compatibility.\n *\n * @param headers - HTTP headers object\n * @returns A correlation ID (either from headers or newly generated)\n *\n * @example\n * ```typescript\n * // From incoming request headers\n * const correlationId = getOrGenerateCorrelationId(request.headers);\n *\n * // Use in request processing\n * await withCorrelationId(correlationId, async () => {\n * // Process request with correlation tracking\n * });\n * ```\n */\nexport function createCorrelationIdFromHeaders(\n headers: Record<string, string | string[] | undefined>\n): string {\n const headerName = currentConfig.headerName;\n const headerValue = headers[headerName];\n\n // Handle both string and string[] header values\n let correlationId: string | undefined;\n\n if (Array.isArray(headerValue)) {\n // Take the first value if it's an array\n correlationId = headerValue[0];\n } else if (typeof headerValue === 'string') {\n correlationId = headerValue;\n }\n\n // Use header value if it exists and is not empty\n if (correlationId && correlationId.trim()) {\n return correlationId;\n }\n\n // Generate new correlation ID if header is missing or empty\n return generateCorrelationId();\n}\n\n// Note: Correlation middleware is not needed since we're integrating\n// at the request handler level (see Task T6). The request handler\n// will directly use getOrGenerateCorrelationId() and withCorrelationId()\n// to establish correlation context for the entire request lifecycle.\n\n/**\n * Type-safe wrapper for functions that need correlation ID context\n *\n * Ensures that a function always has access to a correlation ID,\n * either from the current context or by generating a new one.\n *\n * @param fn - Function that requires correlation ID context\n * @returns Wrapped function that guarantees correlation ID availability\n */\nexport function withEnsuredCorrelation<T extends any[], R>(\n fn: (...args: T) => R | Promise<R>\n): (...args: T) => R | Promise<R> {\n return (...args: T): R | Promise<R> => {\n const currentCorrelationId = getCorrelationId();\n\n // If we already have a correlation ID, just run the function\n if (currentCorrelationId !== 'unknown') {\n return fn(...args);\n }\n\n // Generate new correlation ID and run function in that context\n const newCorrelationId = generateCorrelationId();\n return withCorrelationId(newCorrelationId, () => fn(...args));\n };\n}\n\n/**\n * Debugging utility to get correlation storage information\n *\n * @internal This is for debugging purposes only\n */\nexport function _getCorrelationStorageInfo() {\n return {\n hasActiveStore: correlationStorage.getStore() !== undefined,\n currentCorrelationId: correlationStorage.getStore() ?? null,\n config: {\n headerName: currentConfig.headerName,\n generatorType:\n currentConfig.generator === defaultCorrelationIdGenerator ? 'default' : 'custom',\n },\n };\n}\n"],"mappings":";;;;;;;;;AAyNO,IAAKA,OAGVA,EAAA,iBAAmB,mBAGnBA,EAAA,UAAY,YAGZA,EAAA,aAAe,eAGfA,EAAA,UAAY,YAGZA,EAAA,mBAAqB,qBAGrBA,EAAA,SAAW,WAGXA,EAAA,aAAe,eAGfA,EAAA,sBAAwB,wBAGxBA,EAAA,kBAAoB,oBAGpBA,EAAA,uBAAyB,yBAGzBA,EAAA,eAAiB,iBAGjBA,EAAA,qBAAuB,uBAIvBA,EAAA,cAAgB,gBAGhBA,EAAA,cAAgB,gBAGhBA,EAAA,YAAc,cAGdA,EAAA,WAAa,aAIbA,EAAA,qBAAuB,uBAGvBA,EAAA,oBAAsB,sBAGtBA,EAAA,kBAAoB,oBAGpBA,EAAA,oBAAsB,sBA9DZA,OAAA,IAsEAC,OAEVA,EAAA,IAAM,MAGNA,EAAA,OAAS,SAGTA,EAAA,KAAO,OAGPA,EAAA,SAAW,WAXDA,OAAA,IAkCUC,EAAf,cAAuD,KAAM,CAKzD,KAMA,MAMA,OAMA,cAMA,UAMA,QAWC,YACRC,EACAC,EACAC,EACAC,EACAC,EACA,CACA,MAAMH,CAAK,EAGX,KAAK,KAAO,KAAK,YAAY,KAG7B,KAAK,KAAOD,EACZ,KAAK,MAAQC,EACb,KAAK,OAASC,EACd,KAAK,cAAgBC,EACrB,KAAK,UAAY,IAAI,KACrB,KAAK,QAAUC,EAGf,OAAO,eAAe,KAAM,WAAW,SAAS,EAG5C,MAAM,mBACR,MAAM,kBAAkB,KAAM,KAAK,WAAW,CAElD,CAOA,QAAS,CACP,IAAMC,EAAO,CACX,KAAM,KAAK,KACX,MAAO,KAAK,MACZ,OAAQ,KAAK,OACb,cAAe,KAAK,cACpB,UAAW,KAAK,UAAU,YAAY,CACxC,EAGA,OAAI,KAAK,UAAY,OACZ,CAAE,GAAGA,EAAM,QAAS,KAAK,OAAQ,EAGnCA,CACT,CAMA,UAAmB,CACjB,MAAO,GAAG,KAAK,IAAI,KAAK,KAAK,KAAK,KAAK,KAAK,aAAa,GAC3D,CACF,EA0PO,SAASC,EAAiBC,EAAyC,CACxE,OACE,OAAOA,GAAU,UACjBA,IAAU,MACV,SAAUA,GACV,YAAaA,GACb,UAAWA,GACX,OAAQA,EAAc,MAAS,UAC/B,OAAQA,EAAc,SAAY,QAEtC,CCrqBA,OAAS,qBAAAC,MAAyB,mBAQlC,IAAMC,EAAoC,CACxC,WAAY,mBACZ,UAAWC,CACb,EAMIC,EAAmC,CAAE,GAAGF,CAAe,EAMrDG,EAAqB,IAAIJ,EAU/B,SAASE,GAAwC,CAC/C,IAAMG,EAAY,KAAK,IAAI,EAAE,SAAS,EAAE,EAClCC,EAAS,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,OAAO,EAAG,CAAC,EACrD,MAAO,OAAOD,CAAS,IAAIC,CAAM,EACnC,CAYO,SAASC,EAAsBC,EAAqBC,EAAgC,CACzFN,EAAgB,CACd,WAAYK,GAAcP,EAAe,WACzC,UAAWQ,GAAaR,EAAe,SACzC,CACF,CAQO,SAASS,GAAmC,CACjD,OAAOP,EAAc,UACvB,CAsBO,SAASQ,GAAgC,CAC9C,OAAOC,EAAc,UAAU,CACjC,CAOO,SAASC,GAA2B,CACzC,IAAMC,EAASC,EAAmB,SAAS,EAC3C,OAAOD,GAAUA,EAAO,KAAK,EAAIA,EAAS,SAC5C,CAiCO,SAASE,EACdC,EACAC,EACgB,CAChB,OAAOC,EAAmB,IAAIF,EAAeC,CAAE,CACjD,CAuBO,SAASE,EACdC,EACQ,CACR,IAAMC,EAAaC,EAAc,WAC3BC,EAAcH,EAAQC,CAAU,EAGlCL,EAUJ,OARI,MAAM,QAAQO,CAAW,EAE3BP,EAAgBO,EAAY,CAAC,EACpB,OAAOA,GAAgB,WAChCP,EAAgBO,GAIdP,GAAiBA,EAAc,KAAK,EAC/BA,EAIFQ,EAAsB,CAC/B","names":["ErrorType","ErrorSeverity","BlaizeError","type","title","status","correlationId","details","base","isBodyParseError","error","AsyncLocalStorage","DEFAULT_CONFIG","defaultCorrelationIdGenerator","currentConfig","correlationStorage","timestamp","random","_setCorrelationConfig","headerName","generator","getCorrelationHeaderName","generateCorrelationId","currentConfig","getCorrelationId","stored","correlationStorage","withCorrelationId","correlationId","fn","correlationStorage","createCorrelationIdFromHeaders","headers","headerName","currentConfig","headerValue","generateCorrelationId"]}
|
|
1
|
+
{"version":3,"sources":["../../blaize-types/src/errors.ts","../src/tracing/correlation.ts"],"sourcesContent":["/**\n * Error type definitions and interfaces for the BlaizeJS framework\n *\n * This module contains all the type definitions used for error handling\n * across the BlaizeJS framework, including server-side errors, client-side\n * errors, and HTTP response formats.\n */\n\n/**\n * Structure of error responses sent over HTTP\n *\n * This interface defines the JSON format used for all error responses\n * from BlaizeJS servers. It matches the structure returned by BlaizeError.toJSON()\n *\n * @example\n * ```json\n * {\n * \"type\": \"VALIDATION_ERROR\",\n * \"title\": \"Request validation failed\",\n * \"status\": 400,\n * \"correlationId\": \"req_abc123\",\n * \"timestamp\": \"2024-01-15T10:30:00.000Z\",\n * \"details\": {\n * \"fields\": [\"email\", \"password\"]\n * }\n * }\n * ```\n */\nexport interface BlaizeErrorResponse {\n /** Error type from the ErrorType enum */\n type: ErrorType;\n\n /** Human-readable error message */\n title: string;\n\n /** HTTP status code */\n status: number;\n\n /** Correlation ID for request tracing */\n correlationId: string;\n\n /** ISO timestamp when error occurred */\n timestamp: string;\n\n /** Optional error-specific details */\n details?: unknown;\n}\n\n/**\n * Context information for network-related errors\n *\n * Used by client-side error classes to provide additional context\n * about network failures, timeouts, and connection issues.\n */\nexport interface NetworkErrorContext {\n /** The URL that failed */\n url: string;\n\n /** HTTP method being attempted */\n method: string;\n\n /** Correlation ID for tracing */\n correlationId: string;\n\n /** Timeout value if applicable */\n timeout?: number;\n\n /** The original error that caused the network failure */\n originalError: Error;\n\n /** Additional network-specific details */\n networkDetails?: {\n /** Whether this was a connection timeout */\n isTimeout?: boolean;\n\n /** Whether this was a DNS resolution failure */\n isDnsFailure?: boolean;\n\n /** Whether this was a connection refused error */\n isConnectionRefused?: boolean;\n\n /** HTTP status code if received before failure */\n statusCode?: number;\n };\n}\n\n/**\n * Context information for request timeout errors\n *\n * Specialized context for timeout-specific errors with timing information.\n */\nexport interface TimeoutErrorContext {\n /** The URL that timed out */\n url: string;\n\n /** HTTP method being attempted */\n method: string;\n\n /** Correlation ID for tracing */\n correlationId: string;\n\n /** Configured timeout value in milliseconds */\n timeoutMs: number;\n\n /** Actual duration before timeout in milliseconds */\n elapsedMs: number;\n\n /** Type of timeout (request, connection, etc.) */\n timeoutType: 'request' | 'connection' | 'response' | 'idle';\n}\n\n/**\n * Context information for response parsing errors\n *\n * Used when the client receives a response but cannot parse it properly.\n */\nexport interface ParseErrorContext {\n /** The URL that returned unparseable content */\n url: string;\n\n /** HTTP method used */\n method: string;\n\n /** Correlation ID for tracing */\n correlationId: string;\n\n /** HTTP status code received */\n statusCode: number;\n\n /** Content-Type header if available */\n contentType?: string;\n\n /** Expected response format */\n expectedFormat: 'json' | 'text' | 'binary';\n\n /** Sample of the actual response content (truncated for safety) */\n responseSample?: string;\n\n /** The original parsing error */\n originalError: Error;\n}\n\n/**\n * Validation error field details\n *\n * Structure for field-level validation errors with multiple error messages\n * per field.\n */\nexport interface ValidationFieldError {\n /** Field name or path (e.g., \"email\", \"user.profile.name\") */\n field: string;\n\n /** Array of error messages for this field */\n messages: string[];\n\n /** The invalid value that caused the error */\n rejectedValue?: unknown;\n\n /** Expected type or format */\n expectedType?: string;\n}\n\nexport interface ServiceNotAvailableDetails {\n /** Service that's unavailable */\n service?: string;\n\n /** Seconds to wait before retry */\n retryAfter?: number;\n\n /** Why service is unavailable */\n reason?: 'maintenance' | 'overload' | 'circuit_breaker' | 'dependency_down';\n\n /** Additional context */\n [key: string]: unknown;\n}\n\n/**\n * Validation error details structure\n *\n * Used by ValidationError to provide structured information about\n * what fields failed validation and why.\n */\nexport interface ValidationErrorDetails {\n /** Array of field-level errors */\n fields: ValidationFieldError[];\n\n /** Total number of validation errors */\n errorCount: number;\n\n /** The section that failed validation */\n section: 'params' | 'query' | 'body' | 'response';\n\n /** Schema name if available */\n schemaName?: string;\n}\n\n/**\n * All available error types in the BlaizeJS framework\n *\n * This enum provides both compile-time type safety and runtime values\n * for error type identification across server and client packages.\n *\n * @example Type-safe error handling:\n * ```typescript\n * function handleError(errorType: ErrorType) {\n * switch (errorType) {\n * case ErrorType.VALIDATION_ERROR:\n * // Handle validation error\n * break;\n * case ErrorType.NOT_FOUND:\n * // Handle not found error\n * break;\n * // TypeScript ensures all cases are covered\n * }\n * }\n * ```\n */\nexport enum ErrorType {\n // Server-side business logic errors\n /** Request validation failed (400) */\n VALIDATION_ERROR = 'VALIDATION_ERROR',\n\n /** Resource not found (404) */\n NOT_FOUND = 'NOT_FOUND',\n\n /** Authentication required (401) */\n UNAUTHORIZED = 'UNAUTHORIZED',\n\n /** Access forbidden (403) */\n FORBIDDEN = 'FORBIDDEN',\n\n /** SSE Not Acceptable (406) */\n SSE_NOT_ACCEPTABLE = 'SSE_NOT_ACCEPTABLE',\n\n /** Resource conflict (409) */\n CONFLICT = 'CONFLICT',\n\n /** Rate limit exceeded (429) */\n RATE_LIMITED = 'RATE_LIMITED',\n\n /** Internal server error (500) */\n INTERNAL_SERVER_ERROR = 'INTERNAL_SERVER_ERROR',\n\n /** File/Request Too Large (413) */\n PAYLOAD_TOO_LARGE = 'PAYLOAD_TOO_LARGE',\n\n /** Wrong Content Type (415) */\n UNSUPPORTED_MEDIA_TYPE = 'UNSUPPORTED_MEDIA_TYPE',\n\n /** Upload Timeout (408) */\n UPLOAD_TIMEOUT = 'UPLOAD_TIMEOUT',\n\n /** Valid Format Invalid Semantics (422) */\n UNPROCESSABLE_ENTITY = 'UNPROCESSABLE_ENTITY',\n\n // Client-side errors\n /** Network connectivity failure (0) */\n NETWORK_ERROR = 'NETWORK_ERROR',\n\n /** Request or response timeout (0) */\n TIMEOUT_ERROR = 'TIMEOUT_ERROR',\n\n /** Response parsing failure (0) */\n PARSE_ERROR = 'PARSE_ERROR',\n\n /** Generic HTTP error (varies) */\n HTTP_ERROR = 'HTTP_ERROR',\n\n // SSE-specific errors\n /** SSE connection failed (502) */\n SSE_CONNECTION_ERROR = 'SSE_CONNECTION_ERROR',\n\n /** SSE buffer overflow (503) */\n SSE_BUFFER_OVERFLOW = 'SSE_BUFFER_OVERFLOW',\n\n /** SSE stream closed (410) */\n SSE_STREAM_CLOSED = 'SSE_STREAM_CLOSED',\n\n /** Service temporarily unavailable (503) */\n SERVICE_UNAVAILABLE = 'SERVICE_UNAVAILABLE',\n}\n\n/**\n * Error severity levels for logging and monitoring\n *\n * Provides a way to categorize errors by their impact and urgency.\n */\nexport enum ErrorSeverity {\n /** Low impact, often user errors */\n LOW = 'low',\n\n /** Medium impact, application errors */\n MEDIUM = 'medium',\n\n /** High impact, system errors */\n HIGH = 'high',\n\n /** Critical impact, service disruption */\n CRITICAL = 'critical',\n}\n\n/**\n * Abstract base class for all BlaizeJS errors\n *\n * This class provides the foundation for all error types in the BlaizeJS framework.\n * It extends JavaScript's built-in Error class and adds framework-specific properties\n * for consistent error handling across server and client.\n *\n * @example\n * ```typescript\n * import { ErrorType } from './types';\n *\n * class NotFoundError extends BlaizeError<{ resourceId: string }> {\n * constructor(message = 'Resource not found', details?: { resourceId: string }) {\n * super(ErrorType.NOT_FOUND, message, 404, getCurrentCorrelationId(), details);\n * }\n * }\n * ```\n *\n * @template TDetails - Type for error-specific details object\n */\nexport abstract class BlaizeError<TDetails = unknown> extends Error {\n /**\n * Error type identifier from the ErrorType enum\n * Used for programmatic error handling and client-side error routing\n */\n readonly type: ErrorType;\n\n /**\n * Human-readable error title/message\n * Should be descriptive enough for debugging but safe for end users\n */\n readonly title: string;\n\n /**\n * HTTP status code associated with this error\n * Used by the error boundary to set appropriate response status\n */\n readonly status: number;\n\n /**\n * Correlation ID for request tracing\n * Links this error to the specific request that generated it\n */\n readonly correlationId: string;\n\n /**\n * Timestamp when the error occurred\n * Useful for debugging and log correlation\n */\n readonly timestamp: Date;\n\n /**\n * Additional error-specific details\n * Type-safe error context that varies by error type\n */\n readonly details?: TDetails | undefined;\n\n /**\n * Creates a new BlaizeError instance\n *\n * @param type - Error type from the ErrorType enum\n * @param title - Human-readable error message\n * @param status - HTTP status code\n * @param correlationId - Request correlation ID for tracing\n * @param details - Optional error-specific details\n */\n protected constructor(\n type: ErrorType,\n title: string,\n status: number,\n correlationId: string,\n details?: TDetails | undefined\n ) {\n super(title);\n\n // Set the error name to the class name for better stack traces\n this.name = this.constructor.name;\n\n // Framework-specific properties\n this.type = type;\n this.title = title;\n this.status = status;\n this.correlationId = correlationId;\n this.timestamp = new Date();\n this.details = details;\n\n // Maintain proper prototype chain for instanceof checks\n Object.setPrototypeOf(this, new.target.prototype);\n\n // Capture stack trace if available (V8 feature)\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n\n /**\n * Serializes the error to a plain object suitable for HTTP responses\n *\n * @returns Object representation of the error\n */\n toJSON() {\n const base = {\n type: this.type,\n title: this.title,\n status: this.status,\n correlationId: this.correlationId,\n timestamp: this.timestamp.toISOString(),\n };\n\n // Only include details if they are not undefined\n if (this.details !== undefined) {\n return { ...base, details: this.details };\n }\n\n return base;\n }\n\n /**\n * Returns a string representation of the error\n * Includes correlation ID for easier debugging\n */\n toString(): string {\n return `${this.name}: ${this.title} [${this.correlationId}]`;\n }\n}\n\n/**\n * Interface for payload too large error details\n */\nexport interface PayloadTooLargeErrorDetails {\n fileCount?: number;\n maxFiles?: number;\n filename?: string;\n field?: string;\n contentType?: string;\n currentSize?: number;\n maxSize?: number;\n}\n\n/**\n * Interface for unsupported media type error details\n */\nexport interface UnsupportedMediaTypeErrorDetails {\n receivedMimeType?: string;\n allowedMimeTypes?: string[];\n filename?: string;\n}\n\n/**\n * Interface for authentication error details\n */\nexport interface UnauthorizedErrorDetails {\n /** Reason for authentication failure */\n reason?:\n | 'missing_token'\n | 'invalid_token'\n | 'expired_token'\n | 'malformed_token'\n | 'insufficient_scope'\n | string;\n\n /** Authentication scheme (Bearer, Basic, etc.) */\n authScheme?: string;\n\n /** Authentication realm */\n realm?: string;\n\n /** Detailed error description */\n error_description?: string;\n\n /** Required scopes or permissions */\n requiredScopes?: string[];\n\n /** Login URL for interactive authentication */\n loginUrl?: string;\n\n /** Additional context */\n [key: string]: unknown;\n}\n\n/**\n * Interface for authorization/permission error details\n */\nexport interface ForbiddenErrorDetails {\n /** Required permission or role */\n requiredPermission?: string;\n\n /** User's current permissions */\n userPermissions?: string[];\n\n /** Resource being accessed */\n resource?: string;\n\n /** Action being attempted */\n action?: string;\n\n /** Reason for access denial */\n reason?:\n | 'insufficient_permissions'\n | 'account_suspended'\n | 'resource_locked'\n | 'origin_not_allowed'\n | string;\n\n /** Additional context */\n [key: string]: unknown;\n}\n\n/**\n * Interface for resource conflict error details\n */\nexport interface ConflictErrorDetails {\n /** Type of conflict */\n conflictType?:\n | 'duplicate_key'\n | 'version_mismatch'\n | 'concurrent_modification'\n | 'business_rule'\n | string;\n\n /** Field that caused the conflict */\n field?: string;\n\n /** Existing value that conflicts */\n existingValue?: unknown;\n\n /** Provided value that conflicts */\n providedValue?: unknown;\n\n /** Resource that has the conflicting value */\n conflictingResource?: string;\n\n /** Current version/etag of the resource */\n currentVersion?: string;\n\n /** Expected version/etag */\n expectedVersion?: string;\n\n /** Suggested resolution */\n resolution?: string;\n\n /** Additional context */\n [key: string]: unknown;\n}\n\n/**\n * Interface for rate limiting error details\n */\nexport interface RateLimitErrorDetails {\n /** Maximum requests allowed in the time window */\n limit?: number;\n\n /** Remaining requests in current window */\n remaining?: number;\n\n /** When the rate limit resets */\n resetTime?: Date;\n\n /** Seconds until the rate limit resets */\n retryAfter?: number;\n\n /** Time window for the rate limit */\n window?: string;\n\n /** Identifier used for rate limiting (IP, user ID, etc.) */\n identifier?: string;\n\n /** Type of rate limit hit */\n limitType?: 'global' | 'per_user' | 'per_ip' | 'per_endpoint' | string;\n\n /** Additional context */\n [key: string]: unknown;\n}\n\n/**\n * Interface for internal server error details\n */\nexport interface InternalServerErrorDetails {\n /** Original error message (for debugging) */\n originalError?: string;\n\n /** Stack trace (for debugging) */\n stackTrace?: string;\n\n /** Component where the error occurred */\n component?: string;\n\n /** Operation being performed */\n operation?: string;\n\n /** Internal error code */\n internalErrorCode?: string;\n\n /** When the error occurred */\n timestamp?: Date;\n\n /** Whether this error should be retryable */\n retryable?: boolean;\n\n /** Additional debugging context */\n [key: string]: unknown;\n}\n\n/**\n * Interface for NotFound error details\n * Provides context about the missing resource\n */\nexport interface NotFoundErrorDetails {\n /** Type of resource that was not found */\n resourceType?: string;\n\n /** ID or identifier of the resource */\n resourceId?: string;\n\n /** Collection or table where the resource was searched */\n collection?: string;\n\n /** Search criteria that was used */\n query?: Record<string, unknown>;\n\n /** Search criteria that was used (for backward compatibility) */\n searchCriteria?: Record<string, unknown>;\n\n /** The path that was attempted */\n path?: string;\n\n /** HTTP method used (for API endpoints) */\n method?: string;\n\n /** The path that was attempted (for backward compatibility) */\n attemptedPath?: string;\n\n /** Parent resource information for nested resources */\n parentResource?: {\n type: string;\n id: string;\n };\n\n /** Helpful suggestion for the user */\n suggestion?: string;\n\n /** Additional context */\n [key: string]: unknown;\n}\n\n/**\n * Context information for error transformation\n */\nexport interface ErrorTransformContext {\n url: string;\n method: string;\n correlationId: string;\n timeoutMs?: number;\n elapsedMs?: number;\n statusCode?: number;\n contentType?: string;\n responseSample?: string;\n [key: string]: unknown;\n}\n\n/**\n * SSE-specific error detail interfaces for BlaizeJS framework\n *\n * These interfaces define the structure of details for SSE errors.\n * The actual error classes are implemented in blaize-core.\n */\n\n/**\n * Details for SSE connection errors\n */\nexport interface SSEConnectionErrorDetails {\n /** Client identifier if available */\n clientId?: string;\n\n /** Connection attempt number */\n attemptNumber?: number;\n\n /** Maximum retry attempts configured */\n maxRetries?: number;\n\n /** The underlying error that caused connection failure */\n cause?: string;\n\n /** Suggested resolution */\n suggestion?: string;\n}\n\n/**\n * Details for SSE buffer overflow errors\n */\nexport interface SSEBufferOverflowErrorDetails {\n /** Client identifier */\n clientId?: string;\n\n /** Current buffer size when overflow occurred */\n currentSize: number;\n\n /** Maximum buffer size configured */\n maxSize: number;\n\n /** Number of events dropped */\n eventsDropped?: number;\n\n /** Buffer strategy that was applied */\n strategy: 'drop-oldest' | 'drop-newest' | 'close';\n\n /** Event that triggered the overflow */\n triggeringEvent?: string;\n}\n\n/**\n * Details for SSE stream closed errors\n */\nexport interface SSEStreamClosedErrorDetails {\n /** Client identifier */\n clientId?: string;\n\n /** When the stream was closed */\n closedAt?: string;\n\n /** Reason for closure */\n closeReason?: 'client-disconnect' | 'server-close' | 'timeout' | 'error' | 'buffer-overflow';\n\n /** Whether reconnection is possible */\n canReconnect?: boolean;\n\n /** Suggested retry interval in milliseconds */\n retryAfter?: number;\n}\n\n/**\n * Context for SSE connection errors\n */\nexport interface SSEConnectionErrorContext {\n /** The SSE endpoint URL */\n url: string;\n\n /** Correlation ID for tracing */\n correlationId: string;\n\n /** Connection state when error occurred */\n state: 'connecting' | 'connected' | 'disconnected' | 'closed';\n\n /** Number of reconnection attempts made */\n reconnectAttempts?: number;\n\n /** The original error if available */\n originalError?: Error;\n\n /** Additional SSE-specific details */\n sseDetails?: {\n /** Whether credentials were included */\n withCredentials?: boolean;\n\n /** Last received event ID */\n lastEventId?: string;\n\n /** EventSource ready state */\n readyState?: number;\n };\n}\n\n/**\n * Context for SSE stream errors (server-sent errors)\n */\nexport interface SSEStreamErrorContext {\n /** The SSE endpoint URL */\n url: string;\n\n /** Correlation ID from server or client */\n correlationId: string;\n\n /** Error message from server */\n message: string;\n\n /** Error code if provided */\n code?: string;\n\n /** Error name/type from server */\n name?: string;\n\n /** Raw error data from server */\n rawData?: any;\n}\n\n/**\n * Context for SSE heartbeat timeout errors\n */\nexport interface SSEHeartbeatErrorContext {\n /** The SSE endpoint URL */\n url: string;\n\n /** Correlation ID for tracing */\n correlationId: string;\n\n /** Configured heartbeat timeout in ms */\n heartbeatTimeout: number;\n\n /** Time since last event in ms */\n timeSinceLastEvent?: number;\n\n /** Last event ID received */\n lastEventId?: string;\n}\n","/**\n * Correlation ID system for request tracing across async operations\n *\n * This module provides utilities for generating, storing, and accessing\n * correlation IDs that follow requests through the entire application stack.\n * Uses AsyncLocalStorage for automatic context propagation.\n */\n\nimport { AsyncLocalStorage } from 'node:async_hooks';\n\nimport type { CorrelationConfig } from '@blaize-types/tracing';\n\n/**\n * Default configuration values\n * @internal\n */\nconst DEFAULT_CONFIG: CorrelationConfig = {\n headerName: 'x-correlation-id',\n generator: defaultCorrelationIdGenerator,\n};\n\n/**\n * Current configuration (mutable for server customization)\n * @internal\n */\nlet currentConfig: CorrelationConfig = { ...DEFAULT_CONFIG };\n\n/**\n * AsyncLocalStorage instance for storing correlation IDs\n * Separate from the main context storage to allow independent lifecycle management\n */\nconst correlationStorage = new AsyncLocalStorage<string>();\n\n/**\n * Default correlation ID generator\n *\n * Format: req_[timestamp_base36]_[random_base36]\n * Example: req_k3x2m1_9z8y7w6v\n *\n * @internal\n */\nfunction defaultCorrelationIdGenerator(): string {\n const timestamp = Date.now().toString(36); // Base36 encoded timestamp\n const random = Math.random().toString(36).substr(2, 9); // Base36 random string\n return `req_${timestamp}_${random}`;\n}\n\n/**\n * Sets the correlation configuration (internal use only)\n *\n * This function is called by the server during initialization to configure\n * the correlation ID system. It should not be called directly by application code.\n *\n * @param headerName - The HTTP header name to use for correlation IDs\n * @param generator - Custom correlation ID generator function\n * @internal\n */\nexport function _setCorrelationConfig(headerName?: string, generator?: () => string): void {\n currentConfig = {\n headerName: headerName || DEFAULT_CONFIG.headerName,\n generator: generator || DEFAULT_CONFIG.generator,\n };\n}\n\n/**\n * Gets the configured correlation header name\n *\n * @returns The configured header name (defaults to 'x-correlation-id')\n * @internal\n */\nexport function getCorrelationHeaderName(): string {\n return currentConfig.headerName;\n}\n\n/**\n * Resets the correlation configuration to defaults\n *\n * Primarily used for testing to ensure clean state between tests\n *\n * @internal\n */\nexport function _resetCorrelationConfig(): void {\n currentConfig = { ...DEFAULT_CONFIG };\n}\n\n/**\n * Generates a new unique correlation ID\n *\n * Uses the configured generator function, which defaults to the format:\n * req_[timestamp_base36]_[random_base36]\n * Example: req_k3x2m1_9z8y7w6v\n *\n * @returns A unique correlation ID string\n */\nexport function generateCorrelationId(): string {\n return currentConfig.generator();\n}\n\n/**\n * Gets the current correlation ID from AsyncLocalStorage\n *\n * @returns The current correlation ID, or 'unknown' if none is set\n */\nexport function getCorrelationId(): string {\n const stored = correlationStorage.getStore();\n return stored && stored.trim() ? stored : 'unknown';\n}\n\n/**\n * Sets the correlation ID in the current AsyncLocalStorage context\n *\n * This will affect the current execution context and any subsequent\n * async operations that inherit from it.\n *\n * @param correlationId - The correlation ID to set\n */\nexport function setCorrelationId(correlationId: string): void {\n correlationStorage.enterWith(correlationId);\n}\n\n/**\n * Runs a function with a specific correlation ID\n *\n * Creates a new AsyncLocalStorage context with the provided correlation ID.\n * The correlation ID will be available to the function and any async operations\n * it spawns, but will not affect the parent context.\n *\n * @param correlationId - The correlation ID to use for this context\n * @param fn - The function to run with the correlation ID\n * @returns The result of the function\n *\n * @example\n * ```typescript\n * const result = await withCorrelationId('req_123', async () => {\n * console.log(getCurrentCorrelationId()); // 'req_123'\n * return await processRequest();\n * });\n * ```\n */\nexport function withCorrelationId<T>(\n correlationId: string,\n fn: () => T | Promise<T>\n): T | Promise<T> {\n return correlationStorage.run(correlationId, fn);\n}\n\n/**\n * Extracts correlation ID from headers or generates a new one\n *\n * Looks for the configured correlation header (default: 'x-correlation-id').\n * If not found, empty, or undefined, generates a new correlation ID.\n * Supports both string and string[] header values for compatibility.\n *\n * @param headers - HTTP headers object\n * @returns A correlation ID (either from headers or newly generated)\n *\n * @example\n * ```typescript\n * // From incoming request headers\n * const correlationId = getOrGenerateCorrelationId(request.headers);\n *\n * // Use in request processing\n * await withCorrelationId(correlationId, async () => {\n * // Process request with correlation tracking\n * });\n * ```\n */\nexport function createCorrelationIdFromHeaders(\n headers: Record<string, string | string[] | undefined>\n): string {\n const headerName = currentConfig.headerName;\n const headerValue = headers[headerName];\n\n // Handle both string and string[] header values\n let correlationId: string | undefined;\n\n if (Array.isArray(headerValue)) {\n // Take the first value if it's an array\n correlationId = headerValue[0];\n } else if (typeof headerValue === 'string') {\n correlationId = headerValue;\n }\n\n // Use header value if it exists and is not empty\n if (correlationId && correlationId.trim()) {\n return correlationId;\n }\n\n // Generate new correlation ID if header is missing or empty\n return generateCorrelationId();\n}\n\n// Note: Correlation middleware is not needed since we're integrating\n// at the request handler level (see Task T6). The request handler\n// will directly use getOrGenerateCorrelationId() and withCorrelationId()\n// to establish correlation context for the entire request lifecycle.\n\n/**\n * Type-safe wrapper for functions that need correlation ID context\n *\n * Ensures that a function always has access to a correlation ID,\n * either from the current context or by generating a new one.\n *\n * @param fn - Function that requires correlation ID context\n * @returns Wrapped function that guarantees correlation ID availability\n */\nexport function withEnsuredCorrelation<T extends any[], R>(\n fn: (...args: T) => R | Promise<R>\n): (...args: T) => R | Promise<R> {\n return (...args: T): R | Promise<R> => {\n const currentCorrelationId = getCorrelationId();\n\n // If we already have a correlation ID, just run the function\n if (currentCorrelationId !== 'unknown') {\n return fn(...args);\n }\n\n // Generate new correlation ID and run function in that context\n const newCorrelationId = generateCorrelationId();\n return withCorrelationId(newCorrelationId, () => fn(...args));\n };\n}\n\n/**\n * Debugging utility to get correlation storage information\n *\n * @internal This is for debugging purposes only\n */\nexport function _getCorrelationStorageInfo() {\n return {\n hasActiveStore: correlationStorage.getStore() !== undefined,\n currentCorrelationId: correlationStorage.getStore() ?? null,\n config: {\n headerName: currentConfig.headerName,\n generatorType:\n currentConfig.generator === defaultCorrelationIdGenerator ? 'default' : 'custom',\n },\n };\n}\n"],"mappings":";;;;;;;;;AAyNO,IAAKA,OAGVA,EAAA,iBAAmB,mBAGnBA,EAAA,UAAY,YAGZA,EAAA,aAAe,eAGfA,EAAA,UAAY,YAGZA,EAAA,mBAAqB,qBAGrBA,EAAA,SAAW,WAGXA,EAAA,aAAe,eAGfA,EAAA,sBAAwB,wBAGxBA,EAAA,kBAAoB,oBAGpBA,EAAA,uBAAyB,yBAGzBA,EAAA,eAAiB,iBAGjBA,EAAA,qBAAuB,uBAIvBA,EAAA,cAAgB,gBAGhBA,EAAA,cAAgB,gBAGhBA,EAAA,YAAc,cAGdA,EAAA,WAAa,aAIbA,EAAA,qBAAuB,uBAGvBA,EAAA,oBAAsB,sBAGtBA,EAAA,kBAAoB,oBAGpBA,EAAA,oBAAsB,sBA9DZA,OAAA,IAsEAC,OAEVA,EAAA,IAAM,MAGNA,EAAA,OAAS,SAGTA,EAAA,KAAO,OAGPA,EAAA,SAAW,WAXDA,OAAA,IAkCUC,EAAf,cAAuD,KAAM,CAKzD,KAMA,MAMA,OAMA,cAMA,UAMA,QAWC,YACRC,EACAC,EACAC,EACAC,EACAC,EACA,CACA,MAAMH,CAAK,EAGX,KAAK,KAAO,KAAK,YAAY,KAG7B,KAAK,KAAOD,EACZ,KAAK,MAAQC,EACb,KAAK,OAASC,EACd,KAAK,cAAgBC,EACrB,KAAK,UAAY,IAAI,KACrB,KAAK,QAAUC,EAGf,OAAO,eAAe,KAAM,WAAW,SAAS,EAG5C,MAAM,mBACR,MAAM,kBAAkB,KAAM,KAAK,WAAW,CAElD,CAOA,QAAS,CACP,IAAMC,EAAO,CACX,KAAM,KAAK,KACX,MAAO,KAAK,MACZ,OAAQ,KAAK,OACb,cAAe,KAAK,cACpB,UAAW,KAAK,UAAU,YAAY,CACxC,EAGA,OAAI,KAAK,UAAY,OACZ,CAAE,GAAGA,EAAM,QAAS,KAAK,OAAQ,EAGnCA,CACT,CAMA,UAAmB,CACjB,MAAO,GAAG,KAAK,IAAI,KAAK,KAAK,KAAK,KAAK,KAAK,aAAa,GAC3D,CACF,ECjaA,OAAS,qBAAAC,MAAyB,mBAQlC,IAAMC,EAAoC,CACxC,WAAY,mBACZ,UAAWC,CACb,EAMIC,EAAmC,CAAE,GAAGF,CAAe,EAMrDG,EAAqB,IAAIJ,EAU/B,SAASE,GAAwC,CAC/C,IAAMG,EAAY,KAAK,IAAI,EAAE,SAAS,EAAE,EAClCC,EAAS,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,OAAO,EAAG,CAAC,EACrD,MAAO,OAAOD,CAAS,IAAIC,CAAM,EACnC,CAYO,SAASC,EAAsBC,EAAqBC,EAAgC,CACzFN,EAAgB,CACd,WAAYK,GAAcP,EAAe,WACzC,UAAWQ,GAAaR,EAAe,SACzC,CACF,CAQO,SAASS,GAAmC,CACjD,OAAOP,EAAc,UACvB,CAsBO,SAASQ,GAAgC,CAC9C,OAAOC,EAAc,UAAU,CACjC,CAOO,SAASC,GAA2B,CACzC,IAAMC,EAASC,EAAmB,SAAS,EAC3C,OAAOD,GAAUA,EAAO,KAAK,EAAIA,EAAS,SAC5C,CAiCO,SAASE,EACdC,EACAC,EACgB,CAChB,OAAOC,EAAmB,IAAIF,EAAeC,CAAE,CACjD,CAuBO,SAASE,EACdC,EACQ,CACR,IAAMC,EAAaC,EAAc,WAC3BC,EAAcH,EAAQC,CAAU,EAGlCL,EAUJ,OARI,MAAM,QAAQO,CAAW,EAE3BP,EAAgBO,EAAY,CAAC,EACpB,OAAOA,GAAgB,WAChCP,EAAgBO,GAIdP,GAAiBA,EAAc,KAAK,EAC/BA,EAIFQ,EAAsB,CAC/B","names":["ErrorType","ErrorSeverity","BlaizeError","type","title","status","correlationId","details","base","AsyncLocalStorage","DEFAULT_CONFIG","defaultCorrelationIdGenerator","currentConfig","correlationStorage","timestamp","random","_setCorrelationConfig","headerName","generator","getCorrelationHeaderName","generateCorrelationId","currentConfig","getCorrelationId","stored","correlationStorage","withCorrelationId","correlationId","fn","correlationStorage","createCorrelationIdFromHeaders","headers","headerName","currentConfig","headerValue","generateCorrelationId"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* blaizejs v0.
|
|
3
|
+
* blaizejs v0.6.0
|
|
4
4
|
* A blazing-fast, TypeScript-first Node.js framework with HTTP/2 support, file-based routing, powerful middleware system, and end-to-end type safety for building modern APIs.
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) 2025 BlaizeJS Contributors
|
|
7
7
|
* @license MIT
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import{c as r,
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
10
|
+
import{c as r,f as o}from"./chunk-EOCNAQ76.js";var e=class extends r{constructor(t,a,i){super("PAYLOAD_TOO_LARGE",t,413,i??o(),a)}};export{e as a};
|
|
11
|
+
//# sourceMappingURL=chunk-GNLJMVOB.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* blaizejs v0.
|
|
3
|
+
* blaizejs v0.6.0
|
|
4
4
|
* A blazing-fast, TypeScript-first Node.js framework with HTTP/2 support, file-based routing, powerful middleware system, and end-to-end type safety for building modern APIs.
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) 2025 BlaizeJS Contributors
|
|
7
7
|
* @license MIT
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import{c as r,
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
10
|
+
import{c as r,f as e}from"./chunk-EOCNAQ76.js";var t=class extends r{constructor(n,o=void 0,i=void 0){super("INTERNAL_SERVER_ERROR",n,500,i??e(),o)}};export{t as a};
|
|
11
|
+
//# sourceMappingURL=chunk-WTCIDURS.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* blaizejs v0.
|
|
3
|
+
* blaizejs v0.6.0
|
|
4
4
|
* A blazing-fast, TypeScript-first Node.js framework with HTTP/2 support, file-based routing, powerful middleware system, and end-to-end type safety for building modern APIs.
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) 2025 BlaizeJS Contributors
|
|
7
7
|
* @license MIT
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import{c as r,
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
10
|
+
import{c as r,f as o}from"./chunk-EOCNAQ76.js";var t=class extends r{constructor(n,s,e){super("UNSUPPORTED_MEDIA_TYPE",n,415,e??o(),s)}};export{t as a};
|
|
11
|
+
//# sourceMappingURL=chunk-YE7LYWE6.js.map
|