{
  "version": 3,
  "sources": ["../src/main.ts", "../src/api-server.ts", "../src/api-client-request.ts", "../src/api-server-response.ts", "../src/const.ts", "../src/url.ts"],
  "sourcesContent": ["export * from './api-server.js';\nexport * from './type.js';\nexport * from './const.js';\n\nexport type {NanotronClientRequest} from './api-client-request.js';\nexport type {NanotronServerResponse} from './api-server-response.js';\nexport type {NanotronUrl} from './url.js';\n", "import {createServer} from 'node:http';\n\nimport {createLogger} from '@alwatr/logger';\n\nimport {NanotronClientRequest} from './api-client-request.js';\nimport {HttpStatusCodes, HttpStatusMessages} from './const.js';\nimport {NanotronUrl} from './url.js';\n\nimport type {DefineRouteOption, MatchType, NativeClientRequest, NativeServerResponse} from './type.js';\nimport type {Duplex} from 'node:stream';\n\n/**\n * Configuration options for the NanotronApiServer.\n */\nexport interface NanotronApiServerConfig {\n  /**\n   * The port number to listen on.\n   *\n   * @default 80\n   */\n  port?: number;\n\n  /**\n   * The hostname to listen on.\n   *\n   * @default '0.0.0.0'\n   */\n  host?: string;\n\n  /**\n   * Sets the timeout (ms) for receiving the entire request from the client.\n   *\n   * @default 10_000 ms\n   */\n  requestTimeout?: number;\n\n  /**\n   * Sets the timeout (ms) for receiving the complete HTTP headers from the client.\n   *\n   * This should be bigger than `keepAliveTimeout + your server's expected response time`.\n   *\n   * @default 130_000 ms\n   */\n  headersTimeout?: number;\n\n  /**\n   * Sets the timeout (ms) for receiving the complete HTTP headers from the client.\n   *\n   * @default 120_000 ms\n   */\n  keepAliveTimeout?: number;\n\n  /**\n   * Add /health route.\n   *\n   * @default true\n   */\n  healthRoute?: boolean;\n\n  /**\n   * Add OPTIONS route for preflight requests to allow access origins.\n   *\n   * @default {enable: false, origin: '*', methods: '*', headers: '*', maxAge: 86_400}\n   */\n  crossOrigin?: {\n    enable: boolean;\n    origin: string;\n    methods: string;\n    headers: string;\n    maxAge: string | number;\n  };\n\n  /**\n   * A prefix to be added to the beginning of the `url` of all defined routes.\n   *\n   * @default '/api/'\n   */\n  prefix?: `/${string}/` | '/';\n\n  /**\n   * The maximum size of the request body in bytes.\n   *\n   * @default `1_048_576` (1MiB)\n   */\n  bodyLimit?: number;\n}\n\nexport class NanotronApiServer {\n  protected static readonly defaultConfig_: Readonly<Required<NanotronApiServerConfig>> = {\n    host: '0.0.0.0',\n    port: 80,\n    requestTimeout: 10_000,\n    headersTimeout: 130_000,\n    keepAliveTimeout: 120_000,\n    healthRoute: true,\n    crossOrigin: {\n      enable: false,\n      origin: '*',\n      methods: '*',\n      headers: '*',\n      maxAge: 86_400, // 24h\n    },\n    prefix: '/api/',\n    bodyLimit: 1_048_576, // 1MiB\n  };\n\n  public readonly config_: Required<NanotronApiServerConfig>;\n  protected readonly logger_;\n\n  public readonly httpServer;\n\n  protected readonly routeHandlerList__: Record<MatchType, DictionaryOpt<DictionaryOpt<Required<DefineRouteOption>>>>;\n\n  constructor(config?: Partial<NanotronApiServerConfig>) {\n    // Merge the config with the default config.\n    this.config_ = {\n      ...NanotronApiServer.defaultConfig_,\n      ...config,\n    };\n\n    // Create logger.\n    this.logger_ = createLogger('nt-api-server' + (this.config_.port !== 80 ? ':' + this.config_.port : ''));\n    this.logger_.logMethodArgs?.('new', {config: this.config_});\n\n    // Bind methods.\n    this.handleClientRequest_ = this.handleClientRequest_.bind(this);\n    this.handleServerError_ = this.handleServerError_.bind(this);\n    this.handleClientError_ = this.handleClientError_.bind(this);\n\n    // Initialize route handler list.\n    this.routeHandlerList__ = {\n      exact: {},\n      startsWith: {},\n    };\n\n    // Create the HTTP server.\n    this.httpServer = createServer(\n      {\n        keepAlive: true,\n        keepAliveInitialDelay: 0,\n        noDelay: true,\n      },\n      this.handleClientRequest_,\n    );\n\n    // Configure the server.\n    this.httpServer.requestTimeout = this.config_.requestTimeout;\n    this.httpServer.keepAliveTimeout = this.config_.keepAliveTimeout;\n    this.httpServer.headersTimeout = this.config_.headersTimeout;\n\n    // Start the server.\n    this.httpServer.listen(this.config_.port, this.config_.host, () => {\n      this.logger_.logOther?.(`listening on ${this.config_.host}:${this.config_.port}`);\n    });\n\n    // Handle server errors.\n    this.httpServer.on('error', this.handleServerError_);\n    this.httpServer.on('clientError', this.handleClientError_);\n\n    this.defineCorsRoute_();\n\n    if (this.config_.healthRoute) {\n      this.defineHealthRoute_();\n    }\n  }\n\n  public close(): void {\n    this.logger_.logMethod?.('close');\n    this.httpServer.close();\n  }\n\n  protected getRouteOption_(url: NanotronUrl): Required<DefineRouteOption> | null {\n    this.logger_.logMethod?.('getRouteOption_');\n\n    if (\n      Object.hasOwn(this.routeHandlerList__.exact, url.method) &&\n      Object.hasOwn(this.routeHandlerList__.exact[url.method]!, url.pathname)\n    ) {\n      return this.routeHandlerList__.exact[url.method]![url.pathname]!;\n    }\n\n    if (Object.hasOwn(this.routeHandlerList__.startsWith, url.method)) {\n      const routeList = this.routeHandlerList__.startsWith[url.method];\n      for (const pathname in routeList) {\n        if (url.pathname.indexOf(pathname) === 0) {\n          return routeList[pathname]!;\n        }\n      }\n    }\n\n    this.logger_.incident?.('getRouteOption_', 'route_not_found', {method: url.method, url: url.pathname});\n    return null;\n  }\n\n  protected setRouteOption_(option: Required<DefineRouteOption>): void {\n    this.logger_.logMethodArgs?.('setRouteOption_', option);\n\n    const routeHandlerList = this.routeHandlerList__[option.matchType];\n\n    routeHandlerList[option.method] ??= {};\n\n    if (Object.hasOwn(routeHandlerList[option.method]!, option.url)) {\n      this.logger_.error('defineRoute', 'route_already_exists', option);\n      throw new Error('route_already_exists');\n    }\n\n    routeHandlerList[option.method]![option.url] = option;\n  }\n\n  public defineRoute<TSharedMeta extends DictionaryOpt = DictionaryOpt>(option: DefineRouteOption<TSharedMeta>): void {\n    const option_: Required<DefineRouteOption<TSharedMeta>> = {\n      matchType: 'exact',\n      preHandlers: [],\n      postHandlers: [],\n      bodyLimit: this.config_.bodyLimit,\n      crossOrigin: this.config_.crossOrigin,\n      ...option,\n    };\n    this.logger_.logMethodArgs?.('defineRoute', option_);\n    this.setRouteOption_(option_ as Required<DefineRouteOption>);\n  }\n\n  protected handleServerError_(error: NodeJS.ErrnoException): void {\n    if (error.code === 'EADDRINUSE') {\n      this.logger_.error('handleServerError_', 'address_in_use', error);\n    }\n    else {\n      this.logger_.error('handleServerError_', 'http_server_error', error);\n    }\n  }\n\n  protected handleClientError_(err: NodeJS.ErrnoException, socket: Duplex): void {\n    this.logger_.accident('handleClientError_', 'http_server_client_error', {\n      errCode: err.code,\n      errMessage: err.message,\n    });\n\n    const errorCode = err.code?.toLowerCase() ?? `error_${HttpStatusCodes.Error_Client_400_Bad_Request}`;\n    const errorMessage = err.message ?? HttpStatusMessages[HttpStatusCodes.Error_Client_400_Bad_Request];\n    const errorResponse = `{\"ok\":false,\"errorCode\":\"${errorCode}\",\"errorMessage\":\"${errorMessage}\"}`;\n\n    const responseHeaders = [\n      `HTTP/1.1 ${HttpStatusCodes.Error_Client_400_Bad_Request} ${HttpStatusMessages[HttpStatusCodes.Error_Client_400_Bad_Request]}`,\n      'content-type: application/json',\n      `content-length: ${Buffer.byteLength(errorResponse)}`,\n      '\\r\\n',\n    ].join('\\r\\n');\n\n    socket.end(responseHeaders + errorResponse);\n  }\n\n  protected async handleClientRequest_(\n    nativeClientRequest: NativeClientRequest,\n    nativeServerResponse: NativeServerResponse,\n  ): Promise<void> {\n    this.logger_.logMethod?.('handleClientRequest_');\n\n    if (nativeClientRequest.url === undefined) {\n      this.logger_.accident('handleClientRequest_', 'http_server_url_undefined');\n      return;\n    }\n\n    const url = new NanotronUrl(nativeClientRequest, this.config_.prefix);\n\n    const routeOption = this.getRouteOption_(url);\n\n    const connection = new NanotronClientRequest(url, nativeClientRequest, nativeServerResponse, routeOption);\n\n    if (routeOption === null) {\n      connection.serverResponse.statusCode = HttpStatusCodes.Error_Client_404_Not_Found;\n      connection.serverResponse.replyError();\n      return;\n    }\n\n    try {\n      for (const handler of routeOption.preHandlers) {\n        await handler.call(connection, connection, connection.serverResponse, connection.sharedMeta);\n        if (connection.terminatedHandlers === true) return; // must check after each pre-handler.\n      }\n\n      await routeOption.handler.call(connection, connection, connection.serverResponse, connection.sharedMeta);\n\n      for (const handler of routeOption.postHandlers) {\n        if (connection.terminatedHandlers === true) return; // must check before each post-handler.\n        await handler.call(connection, connection, connection.serverResponse, connection.sharedMeta);\n      }\n    }\n    catch (error) {\n      this.logger_.error('handleClientRequest_', 'route_handler_error', error, url.debugId);\n\n      if (connection.serverResponse.statusCode < HttpStatusCodes.Error_Client_400_Bad_Request) {\n        connection.serverResponse.statusCode = HttpStatusCodes.Error_Server_500_Internal_Server_Error;\n      }\n      connection.serverResponse.replyError(error);\n    }\n\n    // TODO: handled open remained connections.\n  }\n\n  protected defineHealthRoute_(): void {\n    this.logger_.logMethod?.('defineHealthRoute_');\n\n    this.defineRoute({\n      method: 'GET',\n      url: '/health',\n      handler: function () {\n        const res = this.serverResponse.raw_;\n        res.statusCode = HttpStatusCodes.Success_200_OK;\n        res.setHeader('server', 'Alwatr Nanotron');\n        res.setHeader('content-type', 'application/json');\n        res.end('{\"ok\":true}');\n      },\n    });\n  }\n\n  protected defineCorsRoute_(): void {\n    this.logger_.logMethod?.('defineCorsRoute_');\n    const crossOrigin = this.config_.crossOrigin;\n    if (crossOrigin?.enable !== true) return;\n    this.defineRoute({\n      method: 'OPTIONS',\n      matchType: 'startsWith',\n      url: '/',\n      handler: function () {\n        const res = this.serverResponse.raw_;\n        res.writeHead(HttpStatusCodes.Success_204_No_Content, {\n          'access-control-allow-origin': crossOrigin.origin,\n          'access-control-allow-methods': crossOrigin.methods,\n          'access-control-allow-headers': crossOrigin.headers,\n          'access-control-max-age': crossOrigin.maxAge + '',\n          'content-length': 0,\n        });\n        res.end();\n      },\n    });\n  }\n}\n", "import {createLogger} from '@alwatr/logger';\n\nimport {NanotronServerResponse} from './api-server-response.js';\nimport {HttpStatusCodes} from './const.js';\n\nimport type {DefineRouteOption, HttpRequestHeaders, NativeClientRequest, NativeServerResponse} from './type.js';\nimport type {NanotronUrl} from './url.js';\n\nexport class NanotronClientRequest<TSharedMeta extends DictionaryOpt = DictionaryOpt> {\n  public readonly url: NanotronUrl;\n\n  public readonly serverResponse: NanotronServerResponse;\n\n  public readonly routeOption: Required<DefineRouteOption> | null;\n\n  /**\n   * A flag to indicate if the running handlers queue has been terminated.\n   * This can occur due to an error being thrown or by explicitly calling the `replyError` method.\n   *\n   * When `terminatedHandlers` is set to `true`, it signifies that the execution of the current\n   * sequence of handlers (including pre, main, and post handlers) has been halted and no further\n   * handlers in the queue will be executed.\n   *\n   * Usage:\n   * - Check this flag to determine if the handlers queue has been interrupted.\n   * - Set this flag to `true` to manually stop the execution of subsequent handlers.\n   */\n  public terminatedHandlers?: true;\n\n  public readonly sharedMeta: TSharedMeta = {} as TSharedMeta;\n\n  public readonly raw_: NativeClientRequest;\n\n  protected readonly logger_;\n\n  public readonly remoteAddress: string | null;\n\n  public get headers(): HttpRequestHeaders {\n    return this.raw_.headers;\n  }\n\n  private queryParams__?: DictionaryOpt<string>;\n  public get queryParams(): DictionaryOpt<string> {\n    if (this.queryParams__ === undefined) {\n      this.queryParams__ = {};\n      for (const [key, value] of this.url.searchParams.entries()) {\n        this.queryParams__[key] = value;\n      }\n    }\n    return this.queryParams__;\n  }\n\n  constructor(\n    url: NanotronUrl,\n    nativeClientRequest: NativeClientRequest,\n    nativeServerResponse: NativeServerResponse,\n    routeOption: Required<DefineRouteOption> | null,\n  ) {\n    // Store public properties.\n    this.raw_ = nativeClientRequest;\n    this.url = url;\n    this.routeOption = routeOption;\n\n    // Get and store remote address.\n    this.remoteAddress = this.getRemoteAddress__();\n\n    // Create logger.\n    this.logger_ = createLogger(`nt-client-request(${this.remoteAddress})`);\n    this.logger_.logMethodArgs?.('new', url.debugId);\n\n    // Create server response.\n    this.serverResponse = new NanotronServerResponse(this, nativeServerResponse);\n  }\n\n  public getBodyRaw(): Promise<Buffer> {\n    return new Promise((resolve, reject) => {\n      // method must be POST or PUT or PATCH\n      const method = this.url.method;\n      if (!(method === 'POST' || method === 'PUT' || method === 'PATCH')) {\n        this.serverResponse.headers.connection = 'close';\n        this.serverResponse.statusCode = HttpStatusCodes.Error_Client_405_Method_Not_Allowed;\n        return reject(new Error('body_not_allowed'));\n      }\n\n      const contentLength = +this.raw_.headers['content-length']!;\n\n      if (Number.isNaN(contentLength) || contentLength === 0) {\n        this.serverResponse.headers.connection = 'close';\n        this.serverResponse.statusCode = HttpStatusCodes.Error_Client_411_Length_Required;\n        return reject(new Error('body_length_required'));\n      }\n\n      if (contentLength > this.routeOption!.bodyLimit) {\n        // TODO: routeOption when null?!\n        this.serverResponse.headers.connection = 'close';\n        this.serverResponse.statusCode = HttpStatusCodes.Error_Client_413_Payload_Too_Large;\n        return reject(new Error('body_too_large'));\n      }\n\n      const dataChunks: Uint8Array[] = [];\n      let receivedLength = 0;\n\n      const onData = (chunk: Uint8Array) => {\n        receivedLength += chunk.length;\n        dataChunks.push(chunk);\n\n        if (receivedLength > this.routeOption!.bodyLimit) {\n          this.raw_.removeListener('data', onData);\n          this.raw_.removeListener('end', onEnd);\n          this.raw_.removeListener('error', onEnd);\n          dataChunks.length = 0; // free memory\n          this.serverResponse.headers.connection = 'close';\n          this.serverResponse.statusCode = HttpStatusCodes.Error_Client_413_Payload_Too_Large;\n          return reject(new Error('body_too_large'));\n        }\n      };\n\n      const onEnd = (err?: Error) => {\n        this.raw_.removeListener('data', onData);\n        this.raw_.removeListener('end', onEnd);\n        this.raw_.removeListener('error', onEnd);\n\n        if (err !== undefined) {\n          dataChunks.length = 0; // free memory\n          this.serverResponse.statusCode = HttpStatusCodes.Error_Client_400_Bad_Request;\n          return reject(err);\n        }\n\n        if (receivedLength !== contentLength) {\n          dataChunks.length = 0; // free memory\n          this.serverResponse.statusCode = HttpStatusCodes.Error_Client_413_Payload_Too_Large;\n          return reject(new Error('body_too_large'));\n        }\n\n        const body = Buffer.concat(dataChunks);\n\n        resolve(body);\n      };\n\n      this.raw_.on('data', onData);\n      this.raw_.on('end', onEnd);\n      this.raw_.on('error', onEnd);\n      this.raw_.resume();\n    });\n  }\n\n  private getRemoteAddress__(): string | null {\n    return this.raw_.headers['x-forwarded-for']?.split(',').pop()?.trim() || this.raw_.socket.remoteAddress || null;\n  }\n}\n", "import {createLogger} from '@alwatr/logger';\n\nimport {type HttpStatusCode, HttpStatusCodes, HttpStatusMessages} from './const.js';\n\nimport type {NanotronClientRequest} from './api-client-request.js';\nimport type {HttpResponseHeaders, ErrorResponse, NativeServerResponse} from './type.js';\n\n/**\n * Configuration options for the Nanotron Api Server Response.\n */\nexport interface NanotronServerResponseConfig {\n  clientRequest: NanotronClientRequest;\n}\n\nexport class NanotronServerResponse {\n  public readonly clientRequest: NanotronClientRequest;\n\n  public readonly raw_: NativeServerResponse;\n\n  public readonly headers: HttpResponseHeaders;\n\n  protected readonly logger_;\n\n  protected hasBeenSent_ = false;\n  public get hasBeenSent(): boolean {\n    return this.hasBeenSent_;\n  }\n\n  constructor(nanotronClientRequest: NanotronClientRequest, nativeServerResponse: NativeServerResponse) {\n    // Store public properties.\n    this.clientRequest = nanotronClientRequest;\n    this.raw_ = nativeServerResponse;\n\n    // Create logger.\n    this.logger_ = createLogger(`nt-server-response(${this.clientRequest.remoteAddress})`);\n    this.logger_.logMethodArgs?.('new', this.clientRequest.url.debugId);\n\n    // Set default reply headers.\n    this.headers = {\n      server: 'Alwatr Nanotron',\n      'content-type': 'text/plain charset=UTF-8',\n    };\n\n    const crossOrigin = this.clientRequest.routeOption?.crossOrigin;\n    if (crossOrigin?.enable === true) {\n      this.headers['access-control-allow-origin'] = crossOrigin.origin;\n      this.headers['access-control-allow-methods'] = crossOrigin.methods;\n      this.headers['access-control-allow-headers'] = crossOrigin.headers;\n      this.headers['access-control-max-age'] = crossOrigin.maxAge;\n    }\n  }\n\n  public get statusCode(): HttpStatusCode {\n    return this.raw_.statusCode as HttpStatusCode;\n  }\n\n  public set statusCode(value: HttpStatusCode) {\n    this.raw_.statusCode = value;\n  }\n\n  protected applyHeaders_() {\n    this.logger_.logMethodArgs?.('applyHeaders_', this.headers);\n    for (const key in this.headers) {\n      this.raw_.setHeader(key, this.headers[key as Lowercase<string>]!);\n    }\n  }\n\n  public replyErrorResponse(errorResponse: ErrorResponse): void {\n    this.logger_.logMethod?.('replyErrorResponse');\n    this.clientRequest.terminatedHandlers = true;\n    this.headers['content-type'] = 'application/json';\n    let meta = '';\n    if (errorResponse.meta !== undefined) {\n      const metaType = typeof errorResponse.meta;\n      if (metaType === 'string' || metaType === 'number' || metaType === 'boolean' || errorResponse.meta === null) {\n        meta = `,\"meta\":\"${errorResponse.meta}\"`;\n      }\n      else if (metaType === 'object') {\n        meta = `,\"meta\":${JSON.stringify(errorResponse.meta)}`;\n      }\n    }\n    const responseString = `{\"ok\":false,\"errorCode\":\"${errorResponse.errorCode}\",\"errorMessage\":\"${errorResponse.errorMessage}\"${meta}}`;\n    this.reply(responseString);\n  }\n\n  public replyError(error?: Error | string | JsonObject | unknown): void {\n    this.logger_.logMethodArgs?.('replyError', {error});\n\n    this.clientRequest.terminatedHandlers = true;\n    let statusCode = this.statusCode;\n\n    if (statusCode < HttpStatusCodes.Error_Client_400_Bad_Request) {\n      this.statusCode = statusCode = 500;\n    }\n\n    if (error instanceof Error) {\n      this.replyErrorResponse({\n        ok: false,\n        errorCode: (error.name === 'Error' ? 'error_' + statusCode : (error.name + '').toLowerCase()) as Lowercase<string>,\n        errorMessage: error.message,\n      });\n    }\n    else if (typeof error === 'string') {\n      this.replyErrorResponse({\n        ok: false,\n        errorCode: ('error_' + statusCode) as Lowercase<string>,\n        errorMessage: error,\n      });\n    }\n    else if (typeof error === 'object' && error !== null) {\n      this.replyJson(error as JsonObject);\n    }\n    else {\n      this.replyErrorResponse({\n        ok: false,\n        errorCode: ('error_' + statusCode) as Lowercase<string>,\n        errorMessage: HttpStatusMessages[statusCode],\n      });\n    }\n  }\n\n  public replyJson(responseJson: JsonObject): void {\n    this.logger_.logMethodArgs?.('replyJson', {responseJson});\n\n    let responseString: string;\n    try {\n      responseString = JSON.stringify(responseJson);\n    }\n    catch (error) {\n      this.logger_.error('replyJson', 'reply_json_stringify_failed', error, this.clientRequest.url.debugId);\n      this.statusCode = HttpStatusCodes.Error_Server_500_Internal_Server_Error;\n      this.replyErrorResponse({\n        ok: false,\n        errorCode: 'reply_json_stringify_failed',\n        errorMessage: 'Failed to stringify response JSON.',\n      });\n      return;\n    }\n\n    this.headers['content-type'] = 'application/json';\n    this.reply(responseString);\n  }\n\n  public reply(context: string | Buffer): void {\n    this.logger_.logMethodArgs?.('reply', this.clientRequest.url.debugId);\n\n    if (this.raw_.writableFinished && this.hasBeenSent_ === false) {\n      // The response has already been sent by direct access to the server api.\n      this.logger_.accident('reply', 'server_response_writable_finished_directly');\n      this.hasBeenSent_ = true;\n    }\n\n    if (this.hasBeenSent_) {\n      this.logger_.accident('reply', 'reply_already_sent', {\n        url: this.clientRequest.url.debugId,\n        replySent: this.hasBeenSent_,\n        writableFinished: this.raw_.writableFinished,\n      });\n      return;\n    }\n\n    this.hasBeenSent_ = true;\n\n    try {\n      if (typeof context === 'string') {\n        context = Buffer.from(context);\n      }\n\n      this.headers['content-length'] = context.byteLength;\n\n      this.applyHeaders_();\n      this.raw_.end(context, 'binary');\n    }\n    catch (error) {\n      this.logger_.error('reply', 'server_response_error', error, this.clientRequest.url.debugId);\n      this.hasBeenSent_ = false;\n    }\n  }\n}\n", "/**\n * Object representing standard HTTP methods.\n */\nexport const HttpMethods = {\n  /**\n   * GET: Requests a representation of the specified resource.\n   */\n  GET: 'GET',\n\n  /**\n   * HEAD: Asks for a response identical to that of a GET request, but without the response body.\n   */\n  HEAD: 'HEAD',\n\n  /**\n   * POST: Submits data to be processed (e.g., from an HTML form) to the identified resource.\n   */\n  POST: 'POST',\n\n  /**\n   * PUT: Uploads a representation of the specified URI.\n   */\n  PUT: 'PUT',\n\n  /**\n   * DELETE: Deletes the specified resource.\n   */\n  DELETE: 'DELETE',\n\n  /**\n   * CONNECT: Establishes a tunnel to the server identified by the target resource.\n   */\n  CONNECT: 'CONNECT',\n\n  /**\n   * OPTIONS: Describes the communication options for the target resource.\n   */\n  OPTIONS: 'OPTIONS',\n\n  /**\n   * TRACE: Performs a message loop-back test along the path to the target resource.\n   */\n  TRACE: 'TRACE',\n\n  /**\n   * PATCH: Applies partial modifications to a resource.\n   */\n  PATCH: 'PATCH',\n} as const;\n\n/**\n * Object representing standard HTTP status codes.\n */\nexport const HttpStatusCodes = {\n  /**\n   * 100 Continue: The server has received the request headers and the client should proceed to send the request body.\n   */\n  Info_100_Continue: 100,\n\n  /**\n   * 101 Switching Protocols: The server understands and is willing to comply with the clients request to switch protocols.\n   */\n  Info_101_Switching_Protocols: 101,\n\n  /**\n   * 102 Processing: The server has received and is processing the request, but no response is available yet.\n   */\n  Info_102_Processing: 102,\n\n  /**\n   * 103 Early Hints: The server is sending some response headers before the final HTTP message.\n   */\n  Info_103_Early_Hints: 103,\n\n  /**\n   * 200 OK: The request has succeeded.\n   */\n  Success_200_OK: 200,\n\n  /**\n   * 201 Created: The request has been fulfilled and resulted in a new resource being created.\n   */\n  Success_201_Created: 201,\n\n  /**\n   * 202 Accepted: The request has been accepted for processing, but the processing has not been completed.\n   */\n  Success_202_Accepted: 202,\n\n  /**\n   * 203 Non-Authoritative Information: The server is a transforming proxy that received a 200 OK\n   * from the origin server but is returning a modified version of the origins response.\n   */\n  Success_203_Non_Authoritative_Information: 203,\n\n  /**\n   * 204 No Content: The server successfully processed the request and is not returning any content.\n   */\n  Success_204_No_Content: 204,\n\n  /**\n   * 205 Reset Content: The server successfully processed the request,\n   * asks that the client reset its document view, and is not returning any content.\n   */\n  Success_205_Reset_Content: 205,\n\n  /**\n   * 206 Partial Content: The server is delivering only part of the resource due to a range header sent by the client.\n   */\n  Success_206_Partial_Content: 206,\n\n  /**\n   * 207 Multi-Status: The message body that follows is an XML message\n   * and can contain a number of separate response codes, depending on how many sub-requests were made.\n   */\n  Success_207_Multi_Status: 207,\n\n  /**\n   * 208 Already Reported: The members of a DAV binding have already been enumerated\n   * in a preceding part of the (multi-status) response, and are not being included again.\n   */\n  Success_208_Already_Reported: 208,\n\n  /**\n   * 226 IM Used: The server has fulfilled a request for the resource, and the response is a representation\n   * of the result of one or more instance-manipulations applied to the current instance.\n   */\n  Success_226_IM_Used: 226,\n\n  /**\n   * 300 Multiple Choices: The request has more than one possible response.\n   */\n  Redirect_300_Multiple_Choices: 300,\n\n  /**\n   * 301 Moved Permanently: The URL of the requested resource has been changed permanently.\n   */\n  Redirect_301_Moved_Permanently: 301,\n\n  /**\n   * 302 Found: The URL of the requested resource has been changed temporarily.\n   */\n  Redirect_302_Found: 302,\n\n  /**\n   * 303 See Other: The response to the request can be found under another URI using a GET method.\n   */\n  Redirect_303_See_Other: 303,\n\n  /**\n   * 304 Not Modified: The resource has not been modified since the version specified\n   * by the request headers If-Modified-Since or If-None-Match.\n   */\n  Redirect_304_Not_Modified: 304,\n\n  /**\n   * 305 Use Proxy: The requested resource is only available through a proxy, the address for which is provided in the response.\n   */\n  Redirect_305_Use_Proxy: 305,\n\n  /**\n   * 306 Switch Proxy: No longer used. Originally meant \"Subsequent requests should use the specified proxy.\"\n   */\n  Redirect_306_Switch_Proxy: 306,\n\n  /**\n   * 307 Temporary Redirect: The server sends this response to direct the client\n   * to get the requested resource at another URI with the same method that was used in the prior request.\n   */\n  Redirect_307_Temporary_Redirect: 307,\n\n  /**\n   * 308 Permanent Redirect: This means that the resource is now permanently located at another URI,\n   * specified by the Location: HTTP Response header.\n   */\n  Redirect_308_Permanent_Redirect: 308,\n\n  /**\n   * 400 Bad Request: The server cannot or will not process the request due to something that is perceived to be a client error.\n   */\n  Error_Client_400_Bad_Request: 400,\n\n  /**\n   * 401 Unauthorized: The request has not been applied because it lacks valid authentication credentials for the target resource.\n   */\n  Error_Client_401_Unauthorized: 401,\n\n  /**\n   * 402 Payment Required: Reserved for future use.\n   */\n  Error_Client_402_Payment_Required: 402,\n\n  /**\n   * 403 Forbidden: The client does not have access rights to the content, so the server is refusing to give the requested resource.\n   */\n  Error_Client_403_Forbidden: 403,\n\n  /**\n   * 404 Not Found: The server can not find the requested resource.\n   */\n  Error_Client_404_Not_Found: 404,\n\n  /**\n   * 405 Method Not Allowed: The request method is known by the server but is not supported by the target resource.\n   */\n  Error_Client_405_Method_Not_Allowed: 405,\n\n  /**\n   * 406 Not Acceptable: The target resource does not have a current representation that would be acceptable\n   * to the user agent, according to the proactive negotiation header fields received in the request,\n   * and the server is unwilling to supply a default representation.\n   */\n  Error_Client_406_Not_Acceptable: 406,\n\n  /**\n   * 407 Proxy Authentication Required: Similar to 401 Unauthorized,\n   * but it indicates that the client needs to authenticate itself in order to use a proxy.\n   */\n  Error_Client_407_Proxy_Authentication_Required: 407,\n\n  /**\n   * 408 Request Timeout: The server timed out waiting for the request.\n   */\n  Error_Client_408_Request_Timeout: 408,\n\n  /**\n   * 409 Conflict: The request could not be processed because of conflict in the request, such as an edit conflict.\n   */\n  Error_Client_409_Conflict: 409,\n\n  /**\n   * 410 Gone: The requested resource is no longer available and will not be available again.\n   */\n  Error_Client_410_Gone: 410,\n\n  /**\n   * 411 Length Required: The server refuses to accept the request without a defined Content-Length header.\n   */\n  Error_Client_411_Length_Required: 411,\n\n  /**\n   * 412 Precondition Failed: One or more conditions given in the request header fields evaluated to false when tested on the server.\n   */\n  Error_Client_412_Precondition_Failed: 412,\n\n  /**\n   * 413 Payload Too Large: The server is refusing to process a request because the request payload is larger\n   * than the server is willing or able to process.\n   */\n  Error_Client_413_Payload_Too_Large: 413,\n\n  /**\n   * 414 URI Too Long: The server is refusing to service the request because the URI is longer than the server is willing to interpret.\n   */\n  Error_Client_414_URI_Too_Long: 414,\n\n  /**\n   * 415 Unsupported Media Type: The server is refusing to service the request\n   * because the entity of the request is in a format not supported by the requested resource for the requested method.\n   */\n  Error_Client_415_Unsupported_Media_Type: 415,\n\n  /**\n   * 416 Range Not Satisfiable: The client has asked for a portion of the file, but the server cannot supply that portion.\n   */\n  Error_Client_416_Range_Not_Satisfiable: 416,\n\n  /**\n   * 417 Expectation Failed: The server cannot meet the requirements of the Expect request-header field.\n   */\n  Error_Client_417_Expectation_Failed: 417,\n\n  /**\n   * 421 Misdirected Request: The request was directed at a server that is not able to produce a response.\n   */\n  Error_Client_421_Misdirected_Request: 421,\n\n  /**\n   * 422 Unprocessable Entity: The request was well-formed but was unable to be followed due to semantic errors.\n   */\n  Error_Client_422_Unprocessable_Entity: 422,\n\n  /**\n   * 423 Locked: The resource that is being accessed is locked.\n   */\n  Error_Client_423_Locked: 423,\n\n  /**\n   * 424 Failed Dependency: The request failed due to a failure of a previous request.\n   */\n  Error_Client_424_Failed_Dependency: 424,\n\n  /**\n   * 425 Too Early: The server is unwilling to risk processing a request that might be replayed.\n   */\n  Error_Client_425_Too_Early: 425,\n\n  /**\n   * 426 Upgrade Required: The server refuses to perform the request using the current protocol\n   * but might be willing to do so after the client upgrades to a different protocol.\n   */\n  Error_Client_426_Upgrade_Required: 426,\n\n  /**\n   * 428 Precondition Required: The origin server requires the request to be conditional.\n   */\n  Error_Client_428_Precondition_Required: 428,\n\n  /**\n   * 429 Too Many Requests: The user has sent too many requests in a given amount of time (\"rate limiting\").\n   */\n  Error_Client_429_Too_Many_Requests: 429,\n\n  /**\n   * 431 Request Header Fields Too Large: The server is unwilling to process the request because its header fields are too large.\n   */\n  Error_Client_431_Request_Header_Fields_Too_Large: 431,\n\n  /**\n   * 451 Unavailable For Legal Reasons: The user requests an illegal resource, such as a web page censored by a government.\n   */\n  Error_Client_451_Unavailable_For_Legal_Reasons: 451,\n\n  /**\n   * 500 Internal Server Error: A generic error message, given when no more specific message is suitable.\n   */\n  Error_Server_500_Internal_Server_Error: 500,\n\n  /**\n   * 501 Not Implemented: The server either does not recognize the request method, or it lacks the ability to fulfill the request.\n   */\n  Error_Server_501_Not_Implemented: 501,\n\n  /**\n   * 502 Bad Gateway: The server was acting as a gateway or proxy and received an invalid response from the upstream server.\n   */\n  Error_Server_502_Bad_Gateway: 502,\n\n  /**\n   * 503 Service Unavailable: The server is currently unavailable (because it is overloaded or down for maintenance).\n   */\n  Error_Server_503_Service_Unavailable: 503,\n\n  /**\n   * 504 Gateway Timeout: The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.\n   */\n  Error_Server_504_Gateway_Timeout: 504,\n\n  /**\n   * 505 HTTP Version Not Supported: The server does not support the HTTP protocol version used in the request.\n   */\n  Error_Server_505_HTTP_Version_Not_Supported: 505,\n\n  /**\n   * 506 Variant Also Negotiates: Transparent content negotiation for the request results in a circular reference.\n   */\n  Error_Server_506_Variant_Also_Negotiates: 506,\n\n  /**\n   * 507 Insufficient Storage: The server is unable to store the representation needed to complete the request.\n   */\n  Error_Server_507_Insufficient_Storage: 507,\n\n  /**\n   * 508 Loop Detected: The server detected an infinite loop while processing the request.\n   */\n  Error_Server_508_Loop_Detected: 508,\n\n  /**\n   * 510 Not Extended: Further extensions to the request are required for the server to fulfill it.\n   */\n  Error_Server_510_Not_Extended: 510,\n\n  /**\n   * 511 Network Authentication Required: The client needs to authenticate to gain network access.\n   */\n  Error_Server_511_Network_Authentication_Required: 511,\n} as const;\n\nexport const HttpStatusMessages = {\n  100: 'Continue',\n  101: 'Switching Protocols',\n  102: 'Processing',\n  103: 'Early Hints',\n  200: 'OK',\n  201: 'Created',\n  202: 'Accepted',\n  203: 'Non-Authoritative Information',\n  204: 'No Content',\n  205: 'Reset Content',\n  206: 'Partial Content',\n  207: 'Multi-Status',\n  208: 'Already Reported',\n  226: 'IM Used',\n  300: 'Multiple Choices',\n  301: 'Moved Permanently',\n  302: 'Found',\n  303: 'See Other',\n  304: 'Not Modified',\n  305: 'Use Proxy',\n  307: 'Temporary Redirect',\n  308: 'Permanent Redirect',\n  400: 'Bad Request',\n  401: 'Unauthorized',\n  402: 'Payment Required',\n  403: 'Forbidden',\n  404: 'Not Found',\n  405: 'Method Not Allowed',\n  406: 'Not Acceptable',\n  407: 'Proxy Authentication Required',\n  408: 'Request Timeout',\n  409: 'Conflict',\n  410: 'Gone',\n  411: 'Length Required',\n  412: 'Precondition Failed',\n  413: 'Payload Too Large',\n  414: 'URI Too Long',\n  415: 'Unsupported Media Type',\n  416: 'Range Not Satisfiable',\n  417: 'Expectation Failed',\n  418: \"I'm a Teapot\",\n  421: 'Misdirected Request',\n  422: 'Unprocessable Entity',\n  423: 'Locked',\n  424: 'Failed Dependency',\n  425: 'Too Early',\n  426: 'Upgrade Required',\n  428: 'Precondition Required',\n  429: 'Too Many Requests',\n  431: 'Request Header Fields Too Large',\n  451: 'Unavailable For Legal Reasons',\n  500: 'Internal Server Error',\n  501: 'Not Implemented',\n  502: 'Bad Gateway',\n  503: 'Service Unavailable',\n  504: 'Gateway Timeout',\n  505: 'HTTP Version Not Supported',\n  506: 'Variant Also Negotiates',\n  507: 'Insufficient Storage',\n  508: 'Loop Detected',\n  509: 'Bandwidth Limit Exceeded',\n  510: 'Not Extended',\n  511: 'Network Authentication Required',\n};\n\nexport type HttpStatusCode = keyof typeof HttpStatusMessages;\n", "import {URL} from 'node:url';\n\nimport type {HttpMethod, NativeClientRequest} from './type.js';\n\nexport class NanotronUrl extends URL {\n  protected static versionPattern_ = new RegExp('^/v[0-9]+/');\n\n  public readonly method: HttpMethod;\n  public readonly debugId: string;\n\n  constructor(clientRequest: NativeClientRequest, prefix: `/${string}/` | '/') {\n    let url = clientRequest.url ?? '';\n    if (prefix !== '/' && url.indexOf(prefix) === 0) {\n      url = url.slice(prefix.length - 1); // include `/`\n    }\n    url = url.replace(NanotronUrl.versionPattern_, '/');\n\n    super(url, 'http://hostname/');\n\n    this.method = (clientRequest.method ?? 'GET').toUpperCase() as HttpMethod;\n\n    this.debugId = `[${this.method}]${this.pathname}`;\n  }\n}\n"],
  "mappings": ";;qqBAAA,yOCAA,qBAA2B,qBAE3B,IAAAA,eAA2B,0BCF3B,IAAAC,eAA2B,0BCA3B,kBAA2B,0BCGpB,IAAM,YAAc,CAIzB,IAAK,MAKL,KAAM,OAKN,KAAM,OAKN,IAAK,MAKL,OAAQ,SAKR,QAAS,UAKT,QAAS,UAKT,MAAO,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