UNPKG

@sapphire/plugin-api

Version:

Plugin for @sapphire/framework to expose a REST API

1 lines • 19.7 kB
{"version":3,"sources":["../../../../../src/lib/structures/http/HttpCodes.ts"],"names":["HttpCodes"],"mappings":";;;AAAY,IAAA,SAAA,qBAAAA,UAAL,KAAA;AAQN,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,QAAK,GAAL,CAAA,GAAA,IAAA;AAMA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,aAAU,GAAV,CAAA,GAAA,SAAA;AAOA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,cAAW,GAAX,CAAA,GAAA,UAAA;AAOA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,iCAA8B,GAA9B,CAAA,GAAA,6BAAA;AAMA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,eAAY,GAAZ,CAAA,GAAA,WAAA;AAMA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,kBAAe,GAAf,CAAA,GAAA,cAAA;AAQA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,oBAAiB,GAAjB,CAAA,GAAA,gBAAA;AAOA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,iBAAc,GAAd,CAAA,GAAA,aAAA;AAOA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,qBAAkB,GAAlB,CAAA,GAAA,iBAAA;AAOA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,YAAS,GAAT,CAAA,GAAA,QAAA;AASA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,qBAAkB,GAAlB,CAAA,GAAA,iBAAA;AAKA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,sBAAmB,GAAnB,CAAA,GAAA,kBAAA;AAaA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,WAAQ,GAAR,CAAA,GAAA,OAAA;AAQA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,cAAW,GAAX,CAAA,GAAA,UAAA;AAQA,EAAAA,UAAAA,CAAAA,UAAAA,C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GAAA,6BAAA;AAQA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,gCAA6B,GAA7B,CAAA,GAAA,4BAAA;AAMA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,yBAAsB,GAAtB,CAAA,GAAA,qBAAA;AAOA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,oBAAiB,GAAjB,CAAA,GAAA,gBAAA;AAMA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,gBAAa,GAAb,CAAA,GAAA,YAAA;AAMA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,wBAAqB,GAArB,CAAA,GAAA,oBAAA;AAMA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,oBAAiB,GAAjB,CAAA,GAAA,gBAAA;AAKA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,6BAA0B,GAA1B,CAAA,GAAA,yBAAA;AAMA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,2BAAwB,GAAxB,CAAA,GAAA,uBAAA;AAMA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,yBAAsB,GAAtB,CAAA,GAAA,qBAAA;AAMA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,kBAAe,GAAf,CAAA,GAAA,cAAA;AAMA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,iBAAc,GAAd,CAAA,GAAA,aAAA;AAQA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,mCAAgC,GAAhC,CAAA,GAAA,+BAAA;AAjbW,EAAAA,OAAAA,UAAAA;AAAA,CAAA,EAAA,SAAA,IAAA,EAAA","file":"HttpCodes.cjs","sourcesContent":["export enum HttpCodes {\n\t/**\n\t * Standard response for successful HTTP requests. The actual response will\n\t * depend on the request method used. In a GET request, the response will\n\t * contain an entity corresponding to the requested resource. In a POST\n\t * request, the response will contain an entity describing or containing the\n\t * result of the action.\n\t */\n\tOK = 200,\n\n\t/**\n\t * The request has been fulfilled, resulting in the creation of a new\n\t * resource.\n\t */\n\tCreated = 201,\n\n\t/**\n\t * The request has been accepted for processing, but the processing has not\n\t * been completed. The request might or might not be eventually acted upon,\n\t * and may be disallowed when processing occurs.\n\t */\n\tAccepted = 202,\n\n\t/**\n\t * The server is a transforming proxy (e.g. a Web accelerator) that received\n\t * a 200 OK from its origin, but is returning a modified version of the\n\t * origin's response.\n\t */\n\tNonAuthoritativeInformation = 203,\n\n\t/**\n\t * The server successfully processed the request, and is not returning any\n\t * content.\n\t */\n\tNoContent = 204,\n\n\t/**\n\t * The server successfully processed the request, asks that the requester\n\t * reset its document view, and is not returning any content.\n\t */\n\tResetContent = 205,\n\n\t/**\n\t * (RFC 7233) The server is delivering only part of the resource (byte\n\t * serving) due to a range header sent by the client. The range header is\n\t * used by HTTP clients to enable resuming of interrupted downloads, or\n\t * split a download into multiple simultaneous streams.\n\t */\n\tPartialContent = 206,\n\n\t/**\n\t * (WebDAV; RFC 4918) The message body that follows is by default an XML\n\t * message and can contain a number of separate response codes, depending on\n\t * how many sub-requests were made.\n\t */\n\tMultiStatus = 207,\n\n\t/**\n\t * (WebDAV; RFC 5842) The members of a DAV binding have already been\n\t * enumerated in a preceding part of the (multistatus) response, and are not\n\t * being included again.\n\t */\n\tAlreadyReported = 208,\n\n\t/**\n\t * (RFC 3229) The server has fulfilled a request for the resource, and the\n\t * response is a representation of the result of one or more\n\t * instance-manipulations applied to the current instance.\n\t */\n\tIMUsed = 226,\n\n\t/**\n\t * Indicates multiple options for the resource from which the client may\n\t * choose (via agent-driven content negotiation). For example, this code\n\t * could be used to present multiple video format options, to list files\n\t * with different filename extensions, or to suggest word-sense\n\t * disambiguation.\n\t */\n\tMultipleChoices = 300,\n\n\t/**\n\t * This and all future requests should be directed to the given URI.\n\t */\n\tMovedPermanently = 301,\n\n\t/**\n\t * (Previously \"Moved temporarily\") Tells the client to look at (browse to)\n\t * another URL. 302 has been superseded by 303 and 307. This is an example\n\t * of industry practice contradicting the standard. The HTTP/1.0\n\t * specification (RFC 1945) required the client to perform a temporary\n\t * redirect (the original describing phrase was \"Moved Temporarily\"), but\n\t * popular browsers implemented 302 with the functionality of a 303 See\n\t * Other. Therefore, HTTP/1.1 added status codes 303 and 307 to distinguish\n\t * between the two behaviours. However, some Web applications and frameworks\n\t * use the 302 status code as if it were the 303.\n\t */\n\tFound = 302,\n\n\t/**\n\t * The response to the request can be found under another URI using the GET\n\t * method. When received in response to a POST (or PUT/DELETE), the client\n\t * should presume that the server has received the data and should issue a\n\t * new GET request to the given URI.\n\t */\n\tSeeOther = 303,\n\n\t/**\n\t * (RFC 7232) Indicates that the resource has not been modified since the\n\t * version specified by the request headers If-Modified-Since or\n\t * If-None-Match. In such case, there is no need to retransmit the resource\n\t * since the client still has a previously-downloaded copy.\n\t */\n\tNotModified = 304,\n\n\t/**\n\t * The requested resource is available only through a proxy, the address for\n\t * which is provided in the response. For security reasons, many HTTP\n\t * clients (such as Mozilla Firefox and Internet Explorer) do not obey this\n\t * status code.\n\t */\n\tUseProxy = 305,\n\t/**\n\t * No longer used. Originally meant \"Subsequent requests should use the\n\t * specified proxy.\".\n\t */\n\tSwitchProxy = 306,\n\n\t/**\n\t * In this case, the request should be repeated with another URI; however,\n\t * future requests should still use the original URI. In contrast to how 302\n\t * was historically implemented, the request method is not allowed to be\n\t * changed when reissuing the original request. For example, a POST request\n\t * should be repeated using another POST request.\n\t */\n\tTemporaryRedirect = 307,\n\n\t/**\n\t * (RFC 7538) The request and all future requests should be repeated using\n\t * another URI. 307 and 308 parallel the behaviors of 302 and 301, but do\n\t * not allow the HTTP method to change. So, for example, submitting a form\n\t * to a permanently redirected resource may continue smoothly.\n\t */\n\tPermanentRedirect = 308,\n\n\t/**\n\t * The server cannot or will not process the request due to an apparent\n\t * client error (e.g., malformed request syntax, size too large, invalid\n\t * request message framing, or deceptive request routing).\n\t */\n\tBadRequest = 400,\n\n\t/**\n\t * (RFC 7235) Similar to 403 Forbidden, but specifically for use when\n\t * authentication is required and has failed or has not yet been provided.\n\t * The response must include a WWW-Authenticate header field containing a\n\t * challenge applicable to the requested resource. See Basic access\n\t * authentication and Digest access authentication. 401 semantically means\n\t * \"unauthorised\", the user does not have valid authentication credentials\n\t * for the target resource.\n\t */\n\tUnauthorized = 401,\n\n\t/**\n\t * Reserved for future use. The original intention was that this code might\n\t * be used as part of some form of digital cash or micropayment scheme, as\n\t * proposed, for example, by GNU Taler, but that has not yet happened, and\n\t * this code is not widely used. Google Developers API uses this status if a\n\t * particular developer has exceeded the daily limit on requests. Sipgate\n\t * uses this code if an account does not have sufficient funds to start a\n\t * call. Shopify uses this code when the store has not paid their fees and\n\t * is temporarily disabled. Stripe uses this code for failed payments where\n\t * parameters were correct, for example blocked fraudulent payments.\n\t */\n\tPaymentRequired = 402,\n\n\t/**\n\t * The request contained valid data and was understood by the server, but\n\t * the server is refusing action. This may be due to the user not having the\n\t * necessary permissions for a resource or needing an account of some sort,\n\t * or attempting a prohibited action (e.g. creating a duplicate record\n\t * where only one is allowed). This code is also typically used if the\n\t * request provided authentication by answering the WWW-Authenticate header\n\t * field challenge, but the server did not accept that authentication. The\n\t * request should not be repeated.\n\t */\n\tForbidden = 403,\n\n\t/**\n\t * The requested resource could not be found but may be available in the\n\t * future. Subsequent requests by the client are permissible.\n\t */\n\tNotFound = 404,\n\n\t/**\n\t * A request method is not supported for the requested resource; for example,\n\t * a GET request on a form that requires data to be presented via POST, or a\n\t * PUT request on a read-only resource.\n\t */\n\tMethodNotAllowed = 405,\n\n\t/**\n\t * The requested resource is capable of generating only content not\n\t * acceptable according to the Accept headers sent in the request. See Content negotiation.\n\t */\n\tNotAcceptable = 406,\n\n\t/**\n\t * (RFC 7235) The client must first authenticate itself with the proxy.\n\t */\n\tProxyAuthenticationRequired = 407,\n\n\t/**\n\t * The server timed out waiting for the request. According to HTTP\n\t * specifications: \"The client did not produce a request within the time\n\t * that the server was prepared to wait. The client MAY repeat the request\n\t * without modifications at any later time.\"\n\t */\n\tRequestTimeout = 408,\n\n\t/**\n\t * Indicates that the request could not be processed because of conflict in\n\t * the current state of the resource, such as an edit conflict between\n\t * multiple simultaneous updates.\n\t */\n\tConflict = 409,\n\n\t/**\n\t * Indicates that the resource requested is no longer available and will not\n\t * be available again. This should be used when a resource has been\n\t * intentionally removed and the resource should be purged. Upon receiving a\n\t * 410 status code, the client should not request the resource in the future.\n\t * Clients such as search engines should remove the resource from their\n\t * indices. Most use cases do not require clients and search engines to\n\t * purge the resource, and a \"404 Not Found\" may be used instead.\n\t */\n\tGone = 410,\n\n\t/**\n\t * The request did not specify the length of its content, which is required\n\t * by the requested resource.\n\t */\n\tLengthRequired = 411,\n\n\t/**\n\t * (RFC 7232) The server does not meet one of the preconditions that the\n\t * requester put on the request header fields.\n\t */\n\tPreconditionFailed = 412,\n\n\t/**\n\t * (RFC 7231) The request is larger than the server is willing or able to\n\t * process. Previously called \"Request Entity Too Large\".\n\t */\n\tPayloadTooLarge = 413,\n\n\t/**\n\t * (RFC 7231) The URI provided was too long for the server to process. Often\n\t * the result of too much data being encoded as a query-string of a GET\n\t * request, in which case it should be converted to a POST request. Called\n\t * \"Request-URI Too Long\" previously.\n\t */\n\tURITooLong = 414,\n\n\t/**\n\t * (RFC 7231) The request entity has a media type which the server or\n\t * resource does not support. For example, the client uploads an image as\n\t * image/svg+xml, but the server requires that images use a different format.\n\t */\n\tUnsupportedMediaType = 415,\n\n\t/**\n\t * (RFC 7233) The client has asked for a portion of the file (byte serving),\n\t * but the server cannot supply that portion. For example, if the client\n\t * asked for a part of the file that lies beyond the end of the file. Called\n\t * \"Requested Range Not Satisfiable\" previously.\n\t */\n\tRangeNotSatisfiable = 416,\n\n\t/**\n\t * The server cannot meet the requirements of the Expect request-header\n\t * field.\n\t */\n\tExpectationFailed = 417,\n\n\t/**\n\t * (RFC 2324, RFC 7168) This code was defined in 1998 as one of the\n\t * traditional IETF April Fools' jokes, in RFC 2324, Hyper Text Coffee Pot\n\t * Control Protocol, and is not expected to be implemented by actual HTTP\n\t * servers. The RFC specifies this code should be returned by teapots\n\t * requested to brew coffee. This HTTP status is used as an Easter egg in\n\t * some websites, such as Google.com's I'm a teapot easter egg.\n\t */\n\tIAmATeapot = 418,\n\n\t/**\n\t * Returned by the Twitter Search and Trends API when the client is being rate limited.\n\t * The text is a quote from 'Demolition Man' and the '420' code is likely a reference\n\t * to this number's association with marijuana. Other services may wish to implement\n\t * the 429 Too Many Requests response code instead.\n\t */\n\tEnhanceYourCalm = 420,\n\n\t/**\n\t * (RFC 7540) The request was directed at a server that is not able to\n\t * produce a response (for example because of connection reuse).\n\t */\n\tMisdirectedRequest = 421,\n\n\t/**\n\t * (WebDAV; RFC 4918) The request was well-formed but was unable to be\n\t * followed due to semantic errors.\n\t */\n\tUnprocessableEntity = 422,\n\n\t/**\n\t * (WebDAV; RFC 4918) The resource that is being accessed is locked.\n\t */\n\tLocked = 423,\n\n\t/**\n\t * (WebDAV; RFC 4918) The request failed because it depended on another\n\t * request and that request failed (e.g., a PROPPATCH).\n\t */\n\tFailedDependency = 424,\n\n\t/**\n\t * (RFC 8470) Indicates that the server is unwilling to risk processing a\n\t * request that might be replayed.\n\t */\n\tTooEarly = 425,\n\n\t/**\n\t * The client should switch to a different protocol such as TLS/1.0, given\n\t * in the Upgrade header field.\n\t */\n\tUpgradeRequired = 426,\n\n\t/**\n\t * (RFC 6585) The origin server requires the request to be conditional.\n\t * Intended to prevent the 'lost update' problem, where a client GETs a\n\t * resource's state, modifies it, and PUTs it back to the server, when\n\t * meanwhile a third party has modified the state on the server, leading to\n\t * a conflict.\n\t */\n\tPreconditionRequired = 428,\n\n\t/**\n\t * (RFC 6585) The user has sent too many requests in a given amount of time.\n\t * Intended for use with rate-limiting schemes.\n\t */\n\tTooManyRequests = 429,\n\n\t/**\n\t * (RFC 6585) The server is unwilling to process the request because either\n\t * an individual header field, or all the header fields collectively, are\n\t * too large.\n\t */\n\tRequestHeaderFieldsTooLarge = 431,\n\n\t/**\n\t * (RFC 7725) A server operator has received a legal demand to deny access\n\t * to a resource or to a set of resources that includes the requested\n\t * resource. The code 451 was chosen as a reference to the novel Fahrenheit\n\t * 451 (see the Acknowledgements in the RFC).\n\t */\n\tUnavailableForLegalReasons = 451,\n\n\t/**\n\t * A generic error message, given when an unexpected condition was\n\t * encountered and no more specific message is suitable.\n\t */\n\tInternalServerError = 500,\n\n\t/**\n\t * The server either does not recognize the request method, or it lacks the\n\t * ability to fulfil the request. Usually this implies future availability\n\t * (e.g., a new feature of a web-service API).\n\t */\n\tNotImplemented = 501,\n\n\t/**\n\t * The server was acting as a gateway or proxy and received an invalid\n\t * response from the upstream server.\n\t */\n\tBadGateway = 502,\n\n\t/**\n\t * The server cannot handle the request (because it is overloaded or down\n\t * for maintenance). Generally, this is a temporary state.\n\t */\n\tServiceUnavailable = 503,\n\n\t/**\n\t * The server was acting as a gateway or proxy and did not receive a timely\n\t * response from the upstream server.\n\t */\n\tGatewayTimeout = 504,\n\n\t/**\n\t * The server does not support the HTTP protocol version used in the request.\n\t */\n\tHTTPVersionNotSupported = 505,\n\n\t/**\n\t * (RFC 2295) Transparent content negotiation for the request results in a\n\t * circular reference.\n\t */\n\tVariantAlsoNegotiates = 506,\n\n\t/**\n\t * (WebDAV; RFC 4918) The server is unable to store the representation\n\t * needed to complete the request.\n\t */\n\tInsufficientStorage = 507,\n\n\t/**\n\t * (WebDAV; RFC 5842) The server detected an infinite loop while processing\n\t * the request (sent instead of 208 Already Reported).\n\t */\n\tLoopDetected = 508,\n\n\t/**\n\t * (RFC 2774) Further extensions to the request are required for the server\n\t * to fulfil it.\n\t */\n\tNotExtended = 510,\n\n\t/**\n\t * (RFC 6585) The client needs to authenticate to gain network access.\n\t * Intended for use by intercepting proxies used to control access to the\n\t * network (e.g., \"captive portals\" used to require agreement to Terms of\n\t * Service before granting full Internet access via a Wi-Fi hotspot).\n\t */\n\tNetworkAuthenticationRequired = 511\n}\n"]}