{"version":3,"sources":["../src/middlewares/express.ts","../src/core/HttpError.ts","../src/core/problemDetails.ts","../src/middlewares/fastify.ts","../src/middlewares/koa.ts","../src/middlewares/nest.ts","../src/core/ClientError.ts","../src/core/ServerError.ts"],"names":[],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACYO,IAAM,gBAAN,cAA4B,MAA6B;AAAA,EAS9D,YAAY,SAAsJ;AAChK,UAAM;AATR,gBAAe;AACf,kBAAiB;AACjB,iBAAgB;AAChB,kBAAwB;AACxB,oBAA0B;AAC1B,sBAA6C;AAC7C,mBAAyC;AAIvC,SAAK,SAAS,SAAS,UAAU;AACjC,SAAK,WAAW,SAAS,YAAY;AACrC,SAAK,aAAa,SAAS,cAAc;AACzC,SAAK,UAAU,SAAS,WAAW;AAAA,EACrC;AACF;;;AC1BO,IAAM,yBAAyB;AAE/B,SAAS,qBAAqB,KAA4C;AAC/E,QAAM,UAAkC,CAAC;AACzC,MAAK,IAAY;AAAiB,YAAQ,kBAAkB,IAAI,OAAQ,IAAY,eAAe;AACnG,MAAK,IAAY,cAAc;AAAM,YAAQ,aAAa,IAAI,OAAQ,IAAY,UAAU;AAC5F,MAAI,MAAM,QAAS,IAAY,KAAK,KAAM,IAAY,MAAM,SAAS;AAAG,YAAQ,OAAO,IAAK,IAAY,MAAM,KAAK,IAAI;AACvH,SAAO;AACT;AAEO,SAAS,gBAAgB,KAAoB;AAClD,QAAM,SAAS,IAAI;AACnB,QAAM,OAAO,IAAI,QAAQ;AACzB,QAAM,QAAQ,IAAI;AAClB,QAAM,EAAE,QAAQ,SAAS,IAAI;AAE7B,QAAM,MAA+B,EAAE,MAAM,OAAO,OAAO;AAC3D,MAAI,UAAU;AAAM,QAAI,SAAS;AACjC,MAAI,YAAY;AAAM,QAAI,WAAW;AACrC,MAAI,IAAI,YAAY;AAClB,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,IAAI,UAAU,GAAG;AACzD,UAAI,QAAQ,UAAU,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;AAAA;AACL,kBAAiB;AACjB,iBAAgB;AAAA;AAClB;AAEO,IAAM,iBAAN,cAA6B,cAAc;AAAA,EAA3C;AAAA;AACL,kBAAiB;AACjB,iBAAgB;AAAA;AAClB;AAEO,IAAM,aAAN,cAAyB,cAAc;AAAA,EAAvC;AAAA;AACL,kBAAiB;AACjB,iBAAgB;AAAA;AAClB;AAEO,IAAM,qBAAN,cAAiC,cAAc;AAAA,EAKpD,YAAY,SAAkL;AAC5L,UAAM,OAAO;AALf,sBAA4B;AAC5B,kBAAiB;AACjB,iBAAgB;AAId,SAAK,aAAa,SAAS,cAAc;AAAA,EAC3C;AACF;AAEO,IAAM,iBAAN,cAA6B,cAAc;AAAA,EAA3C;AAAA;AACL,kBAAiB;AACjB,iBAAgB;AAAA;AAClB;AAEO,IAAM,0BAAN,cAAsC,cAAc;AAAA,EAApD;AAAA;AACL,kBAAiB;AACjB,iBAAgB;AAAA;AAClB;AAEO,IAAM,sBAAN,cAAkC,cAAc;AAAA,EAAhD;AAAA;AACL,kBAAiB;AACjB,iBAAgB;AAAA;AAClB;AAEO,IAAM,eAAN,cAA2B,cAAc;AAAA,EAAzC;AAAA;AACL,kBAAiB;AACjB,iBAAgB;AAAA;AAClB;AAEO,IAAM,cAAN,cAA0B,cAAc;AAAA,EAAxC;AAAA;AACL,kBAAiB;AACjB,iBAAgB;AAAA;AAClB;AAEO,IAAM,gCAAN,cAA4C,cAAc;AAAA,EAA1D;AAAA;AACL,kBAAiB;AACjB,iBAAgB;AAAA;AAClB","sourcesContent":["import type { Request, Response, NextFunction } from 'express';\nimport { HttpErrorBase } from '../core/HttpError';\nimport { contentTypeProblemJson, problemFromCore, buildHeadersFromCore } from '../core/problemDetails';\n\nexport function errorHandler() {\n  return function expressProblemErrorHandler(err: unknown, _req: Request, res: Response, _next: NextFunction) {\n    if (res.headersSent) return;\n\n    const core = err instanceof HttpErrorBase ? err : new HttpErrorBase((err as any)?.message ?? null);\n    res.status(core.status);\n    for (const [k, v] of Object.entries(buildHeadersFromCore(core))) res.setHeader(k, v);\n    res.setHeader('Content-Type', contentTypeProblemJson);\n    res.json(problemFromCore(core));\n  };\n}\n\nexport function notFoundHandler() {\n  return function expressNotFound(_req: Request, res: Response) {\n    res.status(404).setHeader('Content-Type', contentTypeProblemJson).json({ type: 'about:blank', title: 'Not Found', status: 404 });\n  };\n}\n\n\n","export interface HttpError extends Error {\n  status: number;\n}\n\nexport interface HttpProblem extends HttpError {\n  type: string;\n  title: string;\n  detail: string | null;\n  instance: string | null;\n  extensions: Record<string, unknown> | null;\n}\n\nexport class HttpErrorBase extends Error implements HttpProblem {\n  type: string = 'about:blank';\n  status: number = 500;\n  title: string = 'Internal Server Error';\n  detail: string | null = null;\n  instance: string | null = null;\n  extensions: Record<string, unknown> | null = null;\n  headers: Record<string, string> | null = null;\n\n  constructor(options?: { detail?: string | null; instance?: string | null; extensions?: Record<string, unknown> | null; headers?: Record<string, string> | null }) {\n    super();\n    this.detail = options?.detail ?? null;\n    this.instance = options?.instance ?? null;\n    this.extensions = options?.extensions ?? null;\n    this.headers = options?.headers ?? null;\n  }\n}\n\nexport function isHttpError(error: unknown): error is HttpError {\n  return error instanceof HttpErrorBase;\n}\n\nexport function isClientError(error: unknown): boolean {\n  return error instanceof HttpErrorBase && error.status >= 400 && error.status < 500;\n}\n\nexport function isServerError(error: unknown): boolean {\n  return error instanceof HttpErrorBase && error.status >= 500 && error.status < 600;\n}","import { HttpErrorBase } from './HttpError';\n\nexport const contentTypeProblemJson = 'application/problem+json';\n\nexport function buildHeadersFromCore(err: HttpErrorBase): Record<string, string> {\n  const headers: Record<string, string> = {};\n  if ((err as any).wwwAuthenticate) headers['WWW-Authenticate'] = String((err as any).wwwAuthenticate);\n  if ((err as any).retryAfter != null) headers['Retry-After'] = String((err as any).retryAfter);\n  if (Array.isArray((err as any).allow) && (err as any).allow.length > 0) headers['Allow'] = (err as any).allow.join(', ');\n  return headers;\n}\n\nexport function problemFromCore(err: HttpErrorBase) {\n  const status = err.status;\n  const type = err.type ?? 'about:blank';\n  const title = err.title;\n  const { detail, instance } = err;\n\n  const doc: Record<string, unknown> = { type, title, status };\n  if (detail != null) doc.detail = detail;\n  if (instance != null) doc.instance = instance;\n  if (err.extensions) {\n    for (const [key, value] of Object.entries(err.extensions)) {\n      if (key !== 'type' && key !== 'title' && key !== 'status' && key !== 'detail' && key !== 'instance') {\n        (doc as any)[key] = value;\n      }\n    }\n  }\n  return doc;\n}\n\n\n","import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';\nimport { contentTypeProblemJson, problemFromCore, buildHeadersFromCore } from '../core/problemDetails';\nimport { HttpErrorBase } from '../core/HttpError';\n\nexport function registerFastifyHandler(app: FastifyInstance) {\n  app.setErrorHandler((err: unknown, _req: FastifyRequest, reply: FastifyReply) => {\n    const core = err instanceof HttpErrorBase ? err : new HttpErrorBase((err as any)?.message ?? null);\n    for (const [k, v] of Object.entries(buildHeadersFromCore(core))) reply.header(k, v);\n    reply.code(core.status).header('Content-Type', contentTypeProblemJson).send(problemFromCore(core));\n  });\n\n  app.setNotFoundHandler((_req, reply) => {\n    reply.code(404).header('Content-Type', contentTypeProblemJson).send({ type: 'about:blank', title: 'Not Found', status: 404 });\n  });\n}\n\n\n","import type { Context, Next } from 'koa';\nimport { contentTypeProblemJson, problemFromCore, buildHeadersFromCore } from '../core/problemDetails';\nimport { HttpErrorBase } from '../core/HttpError';\n\nexport function errorMiddleware() {\n  return async function koaProblemError(ctx: Context, next: Next) {\n    try {\n      await next();\n      if (ctx.status === 404 && !ctx.body) {\n        ctx.status = 404;\n        ctx.set('Content-Type', contentTypeProblemJson);\n        ctx.body = { type: 'about:blank', title: 'Not Found', status: 404 };\n      }\n    } catch (err) {\n      const core = err instanceof HttpErrorBase ? err : new HttpErrorBase((err as any)?.message ?? null);\n      ctx.status = core.status;\n      for (const [k, v] of Object.entries(buildHeadersFromCore(core))) ctx.set(k, v);\n      ctx.set('Content-Type', contentTypeProblemJson);\n      ctx.body = problemFromCore(core);\n    }\n  };\n}\n\n\n","import type { ExceptionFilter, ArgumentsHost } from '@nestjs/common';\nimport { HttpErrorBase } from '../core/HttpError';\nimport { contentTypeProblemJson, problemFromCore, buildHeadersFromCore } from '../core/problemDetails';\n\n// Note: No decorator is used to keep build simple.\n// Register with Nest using: app.useGlobalFilters(new ProblemFilter())\nexport class ProblemFilter implements ExceptionFilter {\n  catch(exception: unknown, host: ArgumentsHost) {\n    const ctx = host.switchToHttp();\n    const response = ctx.getResponse();\n\n    const core = exception instanceof HttpErrorBase ? exception : new HttpErrorBase((exception as any)?.message ?? null);\n    for (const [k, v] of Object.entries(buildHeadersFromCore(core))) response.setHeader(k, v);\n    response.status(core.status).setHeader('Content-Type', contentTypeProblemJson).json(problemFromCore(core));\n  }\n}\n\n\n\n","import { HttpErrorBase } from \"./HttpError\";\n\nexport class BadRequest extends HttpErrorBase {\n  status: number = 400;\n  title: string = 'Bad Request';\n}\n\nexport class Unauthorized extends HttpErrorBase {\n  wwwAuthenticate: string | null = null;\n  status: number = 401;\n  title: string = 'Unauthorized';\n\n  constructor(options?: { detail?: string | null; instance?: string | null; extensions?: Record<string, unknown> | null; wwwAuthenticate?: string | null; headers?: Record<string, string> | null }) {\n    super(options);\n    this.wwwAuthenticate = options?.wwwAuthenticate ?? null;\n  }\n}\n\nexport class Forbidden extends HttpErrorBase {\n  status: number = 403;\n  title: string = 'Forbidden';\n}\n\nexport class NotFound extends HttpErrorBase {\n  status: number = 404;\n  title: string = 'Not Found';\n}\n\nexport class MethodNotAllowed extends HttpErrorBase {\n  allow: string[];\n  status: number = 405;\n  title: string = 'Method Not Allowed';\n\n  constructor(options?: { detail?: string | null; instance?: string | null; extensions?: Record<string, unknown> | null; allow?: string[]; headers?: Record<string, string> | null }) {\n    super(options);\n    this.allow = options?.allow ?? [];\n  }\n}\n\nexport class NotAcceptable extends HttpErrorBase {\n  status: number = 406;\n  title: string = 'Not Acceptable';\n}\n\nexport class ProxyAuthenticationRequired extends HttpErrorBase {\n  status: number = 407;\n  title: string = 'Proxy Authentication Required';\n}\n\nexport class RequestTimeout extends HttpErrorBase {\n  status: number = 408;\n  title: string = 'Request Timeout';\n}\n\nexport class Conflict extends HttpErrorBase {\n  retryAfter: number | null = null;\n  status: number = 409;\n  title: string = 'Conflict';\n\n  constructor(options?: { detail?: string | null; instance?: string | null; extensions?: Record<string, unknown> | null; retryAfter?: number | null; headers?: Record<string, string> | null }) {\n    super(options);\n    this.retryAfter = options?.retryAfter ?? null;\n  }\n}\n\nexport class Gone extends HttpErrorBase {\n  status: number = 410;\n  title: string = 'Gone';\n}\n\nexport class LengthRequired extends HttpErrorBase {\n  status: number = 411;\n  title: string = 'Length Required';\n}\n\nexport class PreconditionFailed extends HttpErrorBase {\n  status: number = 412;\n  title: string = 'Precondition Failed';\n}\n\nexport class PayloadTooLarge extends HttpErrorBase {\n  status: number = 413;\n  title: string = 'Payload Too Large';\n}\n\nexport class URITooLong extends HttpErrorBase {\n  status: number = 414;\n  title: string = 'URI Too Long';\n}\n\nexport class UnsupportedMediaType extends HttpErrorBase {\n  status: number = 415;\n  title: string = 'Unsupported Media Type';\n}\n\nexport class RangeNotSatisfiable extends HttpErrorBase {\n  status: number = 416;\n  title: string = 'Range Not Satisfiable';\n}\n\nexport class ExpectationFailed extends HttpErrorBase {\n  status: number = 417;\n  title: string = 'Expectation Failed';\n}\n\nexport class IAmATeapot extends HttpErrorBase {\n  status: number = 418;\n  title: string = \"I'm a Teapot\";\n}\n\nexport class UnprocessableContent extends HttpErrorBase {\n  status: number = 422;\n  title: string = 'Unprocessable Content';\n}\n\nexport class TooEarly extends HttpErrorBase {\n  status: number = 425;\n  title: string = 'Too Early';\n}\n\nexport class UpgradeRequired extends HttpErrorBase {\n  status: number = 426;\n  title: string = 'Upgrade Required';\n}\n\nexport class PreconditionRequired extends HttpErrorBase {\n  status: number = 428;\n  title: string = 'Precondition Required';\n}\n\nexport class TooManyRequests extends HttpErrorBase {\n  retryAfter: number | null = null;\n  status: number = 429;\n  title: string = 'Too Many Requests';\n\n  constructor(options?: { detail?: string | null; instance?: string | null; extensions?: Record<string, unknown> | null; retryAfter?: number | null; headers?: Record<string, string> | null }) {\n    super(options);\n    this.retryAfter = options?.retryAfter ?? null;\n  }\n}\n\nexport class RequestHeaderFieldsTooLarge extends HttpErrorBase {\n  status: number = 431;\n  title: string = 'Request Header Fields Too Large';\n}\n\nexport class UnavailableForLegalReasons extends HttpErrorBase {\n  status: number = 451;\n  title: string = 'Unavailable For Legal Reasons';\n}\n","import { HttpErrorBase } from \"./HttpError\";\n\nexport class InternalServerError extends HttpErrorBase {\n  status: number = 500;\n  title: string = 'Internal Server Error';\n}\n\nexport class NotImplemented extends HttpErrorBase {\n  status: number = 501;\n  title: string = 'Not Implemented';\n}\n\nexport class BadGateway extends HttpErrorBase {\n  status: number = 502;\n  title: string = 'Bad Gateway';\n}\n\nexport class ServiceUnavailable extends HttpErrorBase {\n  retryAfter: number | null = null;\n  status: number = 503;\n  title: string = 'Service Unavailable';\n\n  constructor(options?: { detail?: string | null; instance?: string | null; extensions?: Record<string, unknown> | null; retryAfter?: number | null; headers?: Record<string, string> | null }) {\n    super(options);\n    this.retryAfter = options?.retryAfter ?? null;\n  }\n}\n\nexport class GatewayTimeout extends HttpErrorBase {\n  status: number = 504;\n  title: string = 'Gateway Timeout';\n}\n\nexport class HTTPVersionNotSupported extends HttpErrorBase {\n  status: number = 505;\n  title: string = 'HTTP Version Not Supported';\n}\n\nexport class InsufficientStorage extends HttpErrorBase {\n  status: number = 507;\n  title: string = 'Insufficient Storage';\n}\n\nexport class LoopDetected extends HttpErrorBase {\n  status: number = 508;\n  title: string = 'Loop Detected';\n}\n\nexport class NotExtended extends HttpErrorBase {\n  status: number = 510;\n  title: string = 'Not Extended';\n}\n\nexport class NetworkAuthenticationRequired extends HttpErrorBase {\n  status: number = 511;\n  title: string = 'Network Authentication Required';\n}\n"]}