/** * HTTP Status Codes * * Standard HTTP response status codes as defined by RFC 7231 and RFC 6585. * Use these constants instead of magic numbers for better code readability. * * @example * ```typescript * import { HttpStatus } from '@tchil/business-codes'; * * res.status(HttpStatus.OK).json({ message: 'Success' }); * ``` */ export declare const HttpStatus: { /** 100 - The server has received the request headers */ readonly CONTINUE: 100; /** 101 - The requester has asked the server to switch protocols */ readonly SWITCHING_PROTOCOLS: 101; /** 102 - The server is processing the request (WebDAV) */ readonly PROCESSING: 102; /** 200 - The request has succeeded */ readonly OK: 200; /** 201 - The request has been fulfilled and a new resource has been created */ readonly CREATED: 201; /** 202 - The request has been accepted for processing, but processing has not been completed */ readonly ACCEPTED: 202; /** 203 - The request was successful but the enclosed payload has been modified */ readonly NON_AUTHORITATIVE_INFORMATION: 203; /** 204 - The server successfully processed the request and is not returning any content */ readonly NO_CONTENT: 204; /** 205 - The server successfully processed the request and is not returning any content */ readonly RESET_CONTENT: 205; /** 206 - The server is delivering only part of the resource due to a range header */ readonly PARTIAL_CONTENT: 206; /** 300 - Indicates multiple options for the resource */ readonly MULTIPLE_CHOICES: 300; /** 301 - The URL of the requested resource has been changed permanently */ readonly MOVED_PERMANENTLY: 301; /** 302 - The URI of the requested resource has been changed temporarily */ readonly FOUND: 302; /** 303 - The response to the request can be found under another URI */ readonly SEE_OTHER: 303; /** 304 - The resource has not been modified since the version specified by the request headers */ readonly NOT_MODIFIED: 304; /** 307 - The request should be repeated with another URI but future requests should use the original URI */ readonly TEMPORARY_REDIRECT: 307; /** 308 - The request and all future requests should be repeated using another URI */ readonly PERMANENT_REDIRECT: 308; /** 400 - The server cannot process the request due to a client error */ readonly BAD_REQUEST: 400; /** 401 - Authentication is required and has failed or has not been provided */ readonly UNAUTHORIZED: 401; /** 402 - Reserved for future use (Digital cash/micropayment) */ readonly PAYMENT_REQUIRED: 402; /** 403 - The client does not have permission to access the requested resource */ readonly FORBIDDEN: 403; /** 404 - The requested resource could not be found */ readonly NOT_FOUND: 404; /** 405 - The request method is not supported for the requested resource */ readonly METHOD_NOT_ALLOWED: 405; /** 406 - The requested resource cannot generate content acceptable according to Accept headers */ readonly NOT_ACCEPTABLE: 406; /** 407 - The client must first authenticate itself with the proxy */ readonly PROXY_AUTHENTICATION_REQUIRED: 407; /** 408 - The server timed out waiting for the request */ readonly REQUEST_TIMEOUT: 408; /** 409 - The request could not be processed because of conflict in the current state */ readonly CONFLICT: 409; /** 410 - The requested resource is no longer available and will not be available again */ readonly GONE: 410; /** 411 - The request did not specify the length of its content */ readonly LENGTH_REQUIRED: 411; /** 412 - The server does not meet one of the preconditions specified in the request */ readonly PRECONDITION_FAILED: 412; /** 413 - The request is larger than the server is willing or able to process */ readonly PAYLOAD_TOO_LARGE: 413; /** 414 - The URI provided was too long for the server to process */ readonly URI_TOO_LONG: 414; /** 415 - The request entity has a media type which the server does not support */ readonly UNSUPPORTED_MEDIA_TYPE: 415; /** 416 - The client has asked for a portion of the file that the server cannot supply */ readonly RANGE_NOT_SATISFIABLE: 416; /** 417 - The server cannot meet the requirements of the Expect request-header field */ readonly EXPECTATION_FAILED: 417; /** 418 - I'm a teapot (RFC 2324) */ readonly I_AM_A_TEAPOT: 418; /** 422 - The request was well-formed but unable to be followed due to semantic errors */ readonly UNPROCESSABLE_ENTITY: 422; /** 423 - The resource that is being accessed is locked */ readonly LOCKED: 423; /** 424 - The request failed because it depended on another request that failed */ readonly FAILED_DEPENDENCY: 424; /** 425 - The server is unwilling to risk processing a request that might be replayed */ readonly TOO_EARLY: 425; /** 426 - The client should switch to a different protocol */ readonly UPGRADE_REQUIRED: 426; /** 428 - The origin server requires the request to be conditional */ readonly PRECONDITION_REQUIRED: 428; /** 429 - The user has sent too many requests in a given amount of time */ readonly TOO_MANY_REQUESTS: 429; /** 431 - The server is unwilling to process the request because headers are too large */ readonly REQUEST_HEADER_FIELDS_TOO_LARGE: 431; /** 451 - The resource is unavailable for legal reasons */ readonly UNAVAILABLE_FOR_LEGAL_REASONS: 451; /** 500 - A generic error message when an unexpected condition was encountered */ readonly INTERNAL_SERVER_ERROR: 500; /** 501 - The server does not recognize the request method or lacks the ability to fulfill it */ readonly NOT_IMPLEMENTED: 501; /** 502 - The server received an invalid response from the upstream server */ readonly BAD_GATEWAY: 502; /** 503 - The server is currently unavailable (overloaded or down for maintenance) */ readonly SERVICE_UNAVAILABLE: 503; /** 504 - The gateway did not receive a timely response from the upstream server */ readonly GATEWAY_TIMEOUT: 504; /** 505 - The server does not support the HTTP protocol version used in the request */ readonly HTTP_VERSION_NOT_SUPPORTED: 505; /** 506 - Transparent content negotiation for the request results in a circular reference */ readonly VARIANT_ALSO_NEGOTIATES: 506; /** 507 - The server is unable to store the representation needed to complete the request */ readonly INSUFFICIENT_STORAGE: 507; /** 508 - The server detected an infinite loop while processing the request */ readonly LOOP_DETECTED: 508; /** 510 - Further extensions to the request are required for the server to fulfill it */ readonly NOT_EXTENDED: 510; /** 511 - The client needs to authenticate to gain network access */ readonly NETWORK_AUTHENTICATION_REQUIRED: 511; }; /** * Type representing all valid HTTP status code values */ export type HttpStatusCode = typeof HttpStatus[keyof typeof HttpStatus]; /** * Get HTTP status message by status code * * @param statusCode - The HTTP status code * @returns The human-readable status message * * @example * ```typescript * getHttpStatusMessage(200); // 'OK' * getHttpStatusMessage(404); // 'Not Found' * ``` */ export declare function getHttpStatusMessage(statusCode: number): string; /** * Check if a status code indicates success (2xx) */ export declare function isSuccessStatus(statusCode: number): boolean; /** * Check if a status code indicates a client error (4xx) */ export declare function isClientError(statusCode: number): boolean; /** * Check if a status code indicates a server error (5xx) */ export declare function isServerError(statusCode: number): boolean; /** * Check if a status code indicates a redirect (3xx) */ export declare function isRedirect(statusCode: number): boolean; //# sourceMappingURL=http-status.d.ts.map