{"version":3,"file":"http.mjs","sources":["../../../src/lib/services/http.ts"],"sourcesContent":["/**\n * @file HTTP Client (Legacy)\n * @description Centralized HTTP client with interceptors and error handling\n *\n * @deprecated This module is deprecated in favor of the more feature-rich API client\n * from `@/lib/api`. The `@/lib/api` module provides:\n * - Automatic retry with exponential backoff\n * - Request deduplication\n * - Token refresh with request queuing\n * - Configurable token provider\n * - Request/response interceptor chains\n * - Comprehensive error normalization\n *\n * Migration guide:\n * ```typescript\n * // Before (deprecated)\n * import { httpClient } from '@/lib/services';\n * const response = await httpClient.get('/users');\n *\n * // After (recommended)\n * import { apiClient } from '@/lib/api';\n * const response = await apiClient.get<User[]>('/users');\n * ```\n *\n * @see {@link @/lib/api} for the recommended API client\n */\n\nimport { getEnvConfig, TIMING } from '@/config';\n\n/**\n * HTTP request configuration\n */\nexport interface HttpRequestConfig {\n  /** Request URL */\n  url: string;\n  \n  /** HTTP method */\n  method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';\n  \n  /** Request headers */\n  headers?: Record<string, string>;\n  \n  /** Query parameters */\n  params?: Record<string, string | number | boolean | undefined>;\n  \n  /** Request body */\n  body?: unknown;\n  \n  /** Request timeout (ms) */\n  timeout?: number;\n  \n  /** Abort signal */\n  signal?: AbortSignal;\n  \n  /** Skip authentication */\n  skipAuth?: boolean;\n  \n  /** Skip error handling */\n  skipErrorHandling?: boolean;\n  \n  /** Response type */\n  responseType?: 'json' | 'text' | 'blob' | 'arrayBuffer';\n  \n  /** Custom metadata */\n  meta?: Record<string, unknown>;\n}\n\n/**\n * HTTP response wrapper\n */\nexport interface HttpResponse<T = unknown> {\n  /** Response data */\n  data: T;\n  \n  /** HTTP status code */\n  status: number;\n  \n  /** Status text */\n  statusText: string;\n  \n  /** Response headers */\n  headers: Headers;\n  \n  /** Original request config */\n  config: HttpRequestConfig;\n}\n\n/**\n * Error category types (compatible with ApiError from @/lib/api)\n */\nexport type HttpErrorCategory =\n  | 'network'\n  | 'authentication'\n  | 'authorization'\n  | 'validation'\n  | 'not_found'\n  | 'conflict'\n  | 'rate_limit'\n  | 'server'\n  | 'timeout'\n  | 'cancelled'\n  | 'unknown';\n\n/**\n * Error severity levels (compatible with ApiError from @/lib/api)\n */\nexport type HttpErrorSeverity = 'critical' | 'error' | 'warning' | 'info';\n\n/**\n * Map HTTP status to error category\n */\nfunction getHttpErrorCategory(status: number): HttpErrorCategory {\n  if (status === 0) return 'network';\n  if (status === 401) return 'authentication';\n  if (status === 403) return 'authorization';\n  if (status === 404) return 'not_found';\n  if (status === 409) return 'conflict';\n  if (status === 422 || status === 400) return 'validation';\n  if (status === 429) return 'rate_limit';\n  if (status === 408) return 'timeout';\n  if (status >= 500) return 'server';\n  return 'unknown';\n}\n\n/**\n * Map error category to severity\n */\nfunction getHttpErrorSeverity(category: HttpErrorCategory): HttpErrorSeverity {\n  switch (category) {\n    case 'authentication':\n    case 'authorization':\n    case 'server':\n      return 'error';\n    case 'validation':\n    case 'conflict':\n    case 'not_found':\n      return 'warning';\n    case 'rate_limit':\n    case 'timeout':\n      return 'info';\n    default:\n      return 'error';\n  }\n}\n\n/**\n * HTTP error\n *\n * @deprecated Use error handling from `@/lib/api` instead.\n * The `ApiError` type from `@/lib/api/types` provides more detailed\n * error information including category, severity, and field-level errors.\n *\n * This class implements partial compatibility with `ApiError` for migration purposes.\n * The following properties are compatible with `ApiError`:\n * - `status` - HTTP status code\n * - `code` - Error code (e.g., 'HTTP_404')\n * - `category` - Error category for classification\n * - `severity` - Error severity level\n * - `response` - Response data (alias for `data`)\n * - `timestamp` - Error creation timestamp\n * - `retryable` - Whether the error is retryable\n *\n * @see {@link ApiError} from `@/lib/api/types` for the recommended error type\n */\nexport class HttpError extends Error {\n  readonly status: number;\n  readonly statusText: string;\n  readonly data: unknown;\n  readonly config: HttpRequestConfig;\n  readonly isHttpError = true;\n\n  // ApiError-compatible properties\n  /** Error code compatible with ApiError */\n  readonly code: string;\n  /** Error category compatible with ApiError */\n  readonly category: HttpErrorCategory;\n  /** Error severity compatible with ApiError */\n  readonly severity: HttpErrorSeverity;\n  /** Response data alias (compatible with ApiError.response) */\n  readonly response: unknown;\n  /** Error creation timestamp (compatible with ApiError.timestamp) */\n  readonly timestamp: number;\n  /** Whether error is retryable (compatible with ApiError.retryable) */\n  readonly retryable: boolean;\n\n  constructor(\n    message: string,\n    status: number,\n    statusText: string,\n    data: unknown,\n    config: HttpRequestConfig\n  ) {\n    super(message);\n    this.name = 'HttpError';\n    this.status = status;\n    this.statusText = statusText;\n    this.data = data;\n    this.config = config;\n\n    // ApiError-compatible properties\n    this.code = `HTTP_${status}`;\n    this.category = getHttpErrorCategory(status);\n    this.severity = getHttpErrorSeverity(this.category);\n    this.response = data;\n    this.timestamp = Date.now();\n    this.retryable = [408, 429, 500, 502, 503, 504].includes(status);\n  }\n\n  /**\n   * Convert to a plain object compatible with ApiError structure\n   *\n   * @returns Object with properties matching ApiError interface\n   */\n  toApiError(): {\n    name: string;\n    status: number;\n    code: string;\n    message: string;\n    category: HttpErrorCategory;\n    severity: HttpErrorSeverity;\n    response: unknown;\n    timestamp: number;\n    retryable: boolean;\n  } {\n    return {\n      name: 'ApiError',\n      status: this.status,\n      code: this.code,\n      message: this.message,\n      category: this.category,\n      severity: this.severity,\n      response: this.response,\n      timestamp: this.timestamp,\n      retryable: this.retryable,\n    };\n  }\n}\n\n/**\n * Request interceptor\n */\nexport type RequestInterceptor = (\n  config: HttpRequestConfig\n) => HttpRequestConfig | Promise<HttpRequestConfig>;\n\n/**\n * Response interceptor\n */\nexport type ResponseInterceptor<T = unknown> = (\n  response: HttpResponse<T>\n) => HttpResponse<T> | Promise<HttpResponse<T>>;\n\n/**\n * Error interceptor\n */\nexport type ErrorInterceptor = (\n  error: HttpError\n) => HttpError | Promise<HttpError>;\n\n/**\n * Error interceptor with recovery support\n *\n * This type allows error interceptors to recover from errors by retrying\n * the request and returning a successful response. The response is returned\n * as an HttpError for type compatibility with the interceptor chain, but\n * the HTTP client will extract the successful response when processing.\n *\n * @remarks\n * When an interceptor successfully recovers (e.g., retry succeeds, token refresh works),\n * it can return the HttpResponse. The type uses a discriminated approach where\n * HttpError has status >= 400 and HttpResponse has status < 400.\n */\nexport type RecoveryErrorInterceptor<T = unknown> = (\n  error: HttpError\n) => HttpError | HttpResponse<T> | Promise<HttpError | HttpResponse<T>>;\n\n/**\n * HTTP client configuration\n */\nexport interface HttpClientConfig {\n  /** Base URL for all requests */\n  baseUrl?: string;\n  \n  /** Default timeout (ms) */\n  timeout?: number;\n  \n  /** Default headers */\n  headers?: Record<string, string>;\n}\n\n/**\n * HTTP client class\n *\n * @deprecated Use `ApiClient` from `@/lib/api` instead.\n * The `ApiClient` provides more features including retry logic,\n * request deduplication, and configurable token management.\n *\n * @example Migration\n * ```typescript\n * // Before\n * import { HttpClient } from '@/lib/services';\n * const client = new HttpClient({ baseUrl: 'https://api.example.com' });\n *\n * // After\n * import { createApiClient } from '@/lib/api';\n * const client = createApiClient({ baseUrl: 'https://api.example.com' });\n * ```\n */\nexport class HttpClient {\n  private config: HttpClientConfig;\n  private requestInterceptors: RequestInterceptor[] = [];\n  private responseInterceptors: ResponseInterceptor[] = [];\n  private errorInterceptors: ErrorInterceptor[] = [];\n  \n  constructor(config: HttpClientConfig = {}) {\n    this.config = {\n      baseUrl: config.baseUrl ?? getEnvConfig().apiBaseUrl,\n      timeout: config.timeout ?? TIMING.API.TIMEOUT,\n      headers: {\n        'Content-Type': 'application/json',\n        ...config.headers,\n      },\n    };\n  }\n  \n  /**\n   * Add request interceptor\n   */\n  addRequestInterceptor(interceptor: RequestInterceptor): () => void {\n    this.requestInterceptors.push(interceptor);\n    return () => {\n      const index = this.requestInterceptors.indexOf(interceptor);\n      if (index !== -1) {\n        this.requestInterceptors.splice(index, 1);\n      }\n    };\n  }\n  \n  /**\n   * Add response interceptor\n   */\n  addResponseInterceptor(interceptor: ResponseInterceptor): () => void {\n    this.responseInterceptors.push(interceptor);\n    return () => {\n      const index = this.responseInterceptors.indexOf(interceptor);\n      if (index !== -1) {\n        this.responseInterceptors.splice(index, 1);\n      }\n    };\n  }\n  \n  /**\n   * Add error interceptor\n   */\n  addErrorInterceptor(interceptor: ErrorInterceptor): () => void {\n    this.errorInterceptors.push(interceptor);\n    return () => {\n      const index = this.errorInterceptors.indexOf(interceptor);\n      if (index !== -1) {\n        this.errorInterceptors.splice(index, 1);\n      }\n    };\n  }\n  \n  /**\n   * Execute request\n   */\n  async request<T = unknown>(config: HttpRequestConfig): Promise<HttpResponse<T>> {\n    // Apply request interceptors\n    let processedConfig = { ...config };\n    for (const interceptor of this.requestInterceptors) {\n      processedConfig = await interceptor(processedConfig);\n    }\n\n    const {\n      url,\n      method = 'GET',\n      headers,\n      body,\n      timeout = this.config.timeout,\n      signal,\n      responseType = 'json',\n    } = processedConfig;\n\n    // Create abort controller for timeout\n    const controller = new AbortController();\n    const timeoutId = timeout !== undefined && timeout > 0\n      ? setTimeout(() => controller.abort(), timeout)\n      : null;\n\n    try {\n      const fetchUrl = this.buildUrl(url, processedConfig.params);\n\n      const response = await fetch(fetchUrl, {\n        method,\n        headers: {\n          ...this.config.headers,\n          ...headers,\n        },\n        body: body !== undefined ? JSON.stringify(body) : undefined,\n        signal: signal ?? controller.signal,\n      });\n\n      // Parse response\n      let data: T;\n      switch (responseType) {\n        case 'text':\n          data = (await response.text()) as unknown as T;\n          break;\n        case 'blob':\n          data = (await response.blob()) as unknown as T;\n          break;\n        case 'arrayBuffer':\n          data = (await response.arrayBuffer()) as unknown as T;\n          break;\n        default:\n          data = (await response.json()) as T;\n      }\n\n      // Handle error responses\n      if (!response.ok) {\n\n\n        // Apply error interceptors\n        let processedError = new HttpError(\n          `Request failed with status ${response.status}`,\n          response.status,\n          response.statusText,\n          data,\n          processedConfig\n        );\n        for (const interceptor of this.errorInterceptors) {\n          processedError = await interceptor(processedError);\n        }\n\n        throw processedError;\n      }\n\n      // Build response\n      let httpResponse: HttpResponse<T> = {\n        data,\n        status: response.status,\n        statusText: response.statusText,\n        headers: response.headers,\n        config: processedConfig,\n      };\n\n      // Apply response interceptors\n      for (const interceptor of this.responseInterceptors) {\n        httpResponse = (await interceptor(httpResponse)) as HttpResponse<T>;\n      }\n\n      return httpResponse;\n    } catch (error) {\n      if (error instanceof HttpError) {\n        throw error;\n      }\n\n      // Handle network errors\n\n\n      // Apply error interceptors\n      let processedError = new HttpError(\n        error instanceof Error ? error.message : 'Network error',\n        0,\n        'Network Error',\n        null,\n        processedConfig\n      );\n      for (const interceptor of this.errorInterceptors) {\n        processedError = await interceptor(processedError);\n      }\n\n      throw processedError;\n    } finally {\n      if (timeoutId !== null) {\n        clearTimeout(timeoutId);\n      }\n    }\n  }\n  \n  /**\n   * GET request\n   */\n  async get<T = unknown>(\n    url: string,\n    config?: Omit<HttpRequestConfig, 'url' | 'method' | 'body'>\n  ): Promise<HttpResponse<T>> {\n    return this.request<T>({ ...config, url, method: 'GET' });\n  }\n  \n  /**\n   * POST request\n   */\n  async post<T = unknown>(\n    url: string,\n    body?: unknown,\n    config?: Omit<HttpRequestConfig, 'url' | 'method' | 'body'>\n  ): Promise<HttpResponse<T>> {\n    return this.request<T>({ ...config, url, method: 'POST', body });\n  }\n  \n  /**\n   * PUT request\n   */\n  async put<T = unknown>(\n    url: string,\n    body?: unknown,\n    config?: Omit<HttpRequestConfig, 'url' | 'method' | 'body'>\n  ): Promise<HttpResponse<T>> {\n    return this.request<T>({ ...config, url, method: 'PUT', body });\n  }\n  \n  /**\n   * PATCH request\n   */\n  async patch<T = unknown>(\n    url: string,\n    body?: unknown,\n    config?: Omit<HttpRequestConfig, 'url' | 'method' | 'body'>\n  ): Promise<HttpResponse<T>> {\n    return this.request<T>({ ...config, url, method: 'PATCH', body });\n  }\n  \n  /**\n   * DELETE request\n   */\n  async delete<T = unknown>(\n    url: string,\n    config?: Omit<HttpRequestConfig, 'url' | 'method'>\n  ): Promise<HttpResponse<T>> {\n    return this.request<T>({ ...config, url, method: 'DELETE' });\n  }\n  \n  /**\n   * Build URL with query parameters\n   */\n  private buildUrl(url: string, params?: HttpRequestConfig['params']): string {\n    const baseUrl = url.startsWith('http') ? '' : this.config.baseUrl;\n    const fullUrl = new URL(url, baseUrl);\n\n    if (params !== undefined) {\n      Object.entries(params).forEach(([key, value]) => {\n        if (value !== undefined) {\n          fullUrl.searchParams.append(key, String(value));\n        }\n      });\n    }\n\n    return fullUrl.toString();\n  }\n}\n\n/**\n * Default HTTP client instance\n *\n * @deprecated Use `apiClient` from `@/lib/api` instead.\n *\n * @example Migration\n * ```typescript\n * // Before (deprecated)\n * import { httpClient } from '@/lib/services';\n * const response = await httpClient.get('/users');\n *\n * // After (recommended)\n * import { apiClient } from '@/lib/api';\n * const response = await apiClient.get<User[]>('/users');\n * ```\n */\nexport const httpClient = new HttpClient();\n"],"names":["getHttpErrorCategory","status","getHttpErrorSeverity","category","HttpError","message","statusText","data","config","HttpClient","getEnvConfig","TIMING","interceptor","index","processedConfig","url","method","headers","body","timeout","signal","responseType","controller","timeoutId","fetchUrl","response","processedError","httpResponse","error","params","baseUrl","fullUrl","key","value","httpClient"],"mappings":";;;;AA+GA,SAASA,EAAqBC,GAAmC;AAC/D,SAAIA,MAAW,IAAU,YACrBA,MAAW,MAAY,mBACvBA,MAAW,MAAY,kBACvBA,MAAW,MAAY,cACvBA,MAAW,MAAY,aACvBA,MAAW,OAAOA,MAAW,MAAY,eACzCA,MAAW,MAAY,eACvBA,MAAW,MAAY,YACvBA,KAAU,MAAY,WACnB;AACT;AAKA,SAASC,EAAqBC,GAAgD;AAC5E,UAAQA,GAAA;AAAA,IACN,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EAAA;AAEb;AAqBO,MAAMC,UAAkB,MAAM;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,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