@unshared/client 0.6.5 → 0.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/HttpHeaders.cjs +1 -1
  2. package/dist/HttpHeaders.cjs.map +1 -1
  3. package/dist/HttpHeaders.d.ts +10145 -1117
  4. package/dist/HttpHeaders.js +1 -1
  5. package/dist/HttpHeaders.js.map +1 -1
  6. package/dist/HttpMethods.cjs.map +1 -1
  7. package/dist/HttpMethods.d.ts +506 -20
  8. package/dist/HttpMethods.js.map +1 -1
  9. package/dist/HttpStatusCodes.cjs.map +1 -1
  10. package/dist/HttpStatusCodes.d.ts +2539 -83
  11. package/dist/HttpStatusCodes.js.map +1 -1
  12. package/dist/chunks/B6pUErTM.js.map +1 -1
  13. package/dist/chunks/BDxlAULu.cjs.map +1 -1
  14. package/dist/chunks/B_Gz6Yz8.js.map +1 -1
  15. package/dist/chunks/C83nLcQu.js.map +1 -1
  16. package/dist/chunks/{uqfvs89o.js → C_VzAX2X.js} +22 -35
  17. package/dist/chunks/{uqfvs89o.js.map → C_VzAX2X.js.map} +1 -1
  18. package/dist/chunks/{CThSMMCZ.cjs → CbXCpEzw.cjs} +22 -35
  19. package/dist/chunks/{CThSMMCZ.cjs.map → CbXCpEzw.cjs.map} +1 -1
  20. package/dist/chunks/{CQUndCW0.cjs → DCBEtS8k.cjs} +2 -2
  21. package/dist/chunks/DCBEtS8k.cjs.map +1 -0
  22. package/dist/chunks/DEyigyGy.cjs.map +1 -1
  23. package/dist/chunks/DJyo3R5b.cjs.map +1 -1
  24. package/dist/chunks/{xJaQKKe2.js → Dh-ZK9yy.js} +2 -2
  25. package/dist/chunks/Dh-ZK9yy.js.map +1 -0
  26. package/dist/chunks/{DAtM4FUl.d.ts → Dil0c6fd.d.ts} +1 -1
  27. package/dist/chunks/{BGG3bT7O.d.ts → rRfHSRNV.d.ts} +4 -2
  28. package/dist/createClient.cjs +2 -2
  29. package/dist/createClient.cjs.map +1 -1
  30. package/dist/createClient.d.ts +3 -2
  31. package/dist/createClient.js +2 -2
  32. package/dist/createClient.js.map +1 -1
  33. package/dist/createService.cjs +1 -1
  34. package/dist/createService.cjs.map +1 -1
  35. package/dist/createService.d.ts +3 -2
  36. package/dist/createService.js +1 -1
  37. package/dist/createService.js.map +1 -1
  38. package/dist/index.cjs +2 -2
  39. package/dist/index.d.ts +3 -2
  40. package/dist/index.js +2 -2
  41. package/dist/openapi.cjs.map +1 -1
  42. package/dist/openapi.d.ts +20 -2
  43. package/dist/openapi.js.map +1 -1
  44. package/dist/utils.cjs +1 -1
  45. package/dist/utils.cjs.map +1 -1
  46. package/dist/utils.d.ts +5 -5
  47. package/dist/utils.js +3 -3
  48. package/dist/utils.js.map +1 -1
  49. package/package.json +4 -4
  50. package/dist/chunks/CQUndCW0.cjs.map +0 -1
  51. package/dist/chunks/xJaQKKe2.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"HttpMethods.js","sources":["../HttpMethods.ts"],"sourcesContent":["export enum HttpMethod {\n\n /**\n * The **`CONNECT`** HTTP method requests that a [proxy](https://developer.mozilla.org/en-US/docs/Glossary/Proxy_server) establish a HTTP tunnel to a destination server, and if successful, blindly forward data in both directions until the tunnel is closed.\n *\n * The request target is unique to this method in that it consists of only the host and port number of the tunnel destination, separated by a colon (see [Syntax](#syntax) for details).\n * Any [2XX successful response status code](/en-US/docs/Web/HTTP/Status#successful_responses) means that the proxy will switch to 'tunnel mode' and any data in the success response body is from the server identified by the request target.\n *\n * If a website is behind a proxy and it's enforced via network rules that all external traffic must pass through the proxy, the `CONNECT` method allows you to establish a [TLS](https://developer.mozilla.org/en-US/docs/Glossary/TLS) ([HTTPS](https://developer.mozilla.org/en-US/docs/Glossary/HTTPS)) connection with that website:\n *\n * - The client asks the proxy to tunnel the [TCP](https://developer.mozilla.org/en-US/docs/Glossary/TCP) connection to the desired destination.\n * - The proxy server makes a secure connection to the server on behalf of the client.\n * - Once the connection is established, the proxy server continues to relay the TCP stream to and from the client.\n *\n * Aside from enabling secure access to websites behind proxies, a HTTP tunnel provides a way to allow traffic that would otherwise be restricted (SSH or FTP) over the HTTP(S) protocol.\n *\n * `CONNECT` is a hop-by-hop method, meaning proxies will only forward the `CONNECT` request if there is another inbound proxy in front of the origin server since most origin servers do not implement `CONNECT`.\n *\n * > [!WARNING]\n * > If you are running a proxy that supports `CONNECT`, restrict its use to a set of known ports or a configurable list of safe request targets.\n * > There are significant risks in establishing a tunnel to arbitrary servers, particularly when the destination is a well-known or reserved TCP port that is not intended for Web traffic.\n * > A loosely-configured proxy may be abused to forward traffic such as SMTP to relay spam email, for example.\n */\n CONNECT = 'CONNECT',\n\n /**\n * The **`DELETE`** HTTP method asks the server to delete a specified resource.\n *\n * The `DELETE` method has no defined semantics for the message body, so this should be empty.\n */\n DELETE = 'DELETE',\n\n /**\n * The **`GET`** HTTP method requests a representation of the specified resource.\n * Requests using `GET` should only be used to request data and shouldn't contain a body.\n *\n * > [!NOTE]\n * > The semantics of sending a message body in `GET` requests are undefined.\n * > Some servers may reject the request with a [4XX client error](/en-US/docs/Web/HTTP/Status#client_error_responses) response.\n */\n GET = 'GET',\n\n /**\n * The **`HEAD`** HTTP method requests the metadata of a resource in the form of [headers](/en-US/docs/Web/HTTP/Headers) that the server would have sent if the [GET](https://developer.mozilla.org/en-US/docs/Web/HTTP/Method/GET) method was used instead.\n * This method can be used in cases where a URL might produce a large download, for example, a `HEAD` request can read the [Content-Length](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Length) header to check the file size before downloading the file with a `GET`.\n *\n * If the response to a `HEAD` request shows that a cached URL response is now outdated, the cached copy is invalidated even if no `GET` request was made.\n *\n * > [!WARNING]\n * > If a response to a `HEAD` request has a body, the response body must be ignored.\n * > Any [representation headers](https://developer.mozilla.org/en-US/docs/glossary/Representation_header) that describe the erroneous body are assumed to describe the response body that a `GET` request would have received.\n */\n HEAD = 'HEAD',\n\n /**\n * The **`OPTIONS`** HTTP method requests permitted communication options for a given URL or server.\n * This can be used to test the allowed HTTP methods for a request, or to determine whether a request would succeed when making a CORS preflighted request.\n * A client can specify a URL with this method, or an asterisk (`*`) to refer to the entire server.\n */\n OPTIONS = 'OPTIONS',\n\n /**\n * The **`PATCH`** HTTP method applies partial modifications to a resource.\n *\n * `PATCH` is somewhat analogous to the \"update\" concept found in [CRUD](https://developer.mozilla.org/en-US/docs/Glossary/CRUD) (in general, HTTP is different than [CRUD](https://developer.mozilla.org/en-US/docs/Glossary/CRUD), and the two should not be confused).\n *\n * In comparison with [PUT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Method/PUT), a `PATCH` serves as a set of instructions for modifying a resource, whereas `PUT` represents a complete replacement of the resource.\n * A `PUT` request is always [idempotent](https://developer.mozilla.org/en-US/docs/Glossary/idempotent) (repeating the same request multiple times results in the resource remaining in the same state), whereas a `PATCH` request may not always be idempotent.\n * For instance, if a resource includes an auto-incrementing counter, a `PUT` request will overwrite the counter (since it replaces the entire resource), but a `PATCH` request may not.\n *\n * Like [POST](https://developer.mozilla.org/en-US/docs/Web/HTTP/Method/POST), a `PATCH` request can potentially have side effects on other resources.\n *\n * A server can advertise support for `PATCH` by adding it to the list in the [Allow](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Allow) or [Access-Control-Allow-Methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods) (for [CORS](/en-US/docs/Web/HTTP/CORS)) response headers.\n * Another implicit indication that `PATCH` is supported is the [Accept-Patch](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Patch) header (usually after an [OPTIONS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Method/OPTIONS) request on a resource), which lists the media-types the server is able to understand in a `PATCH` request for a resource.\n */\n PATCH = 'PATCH',\n\n /**\n * The **`POST`** HTTP method sends data to the server. The type of the body of the request is indicated by the [Content-Type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type) header.\n *\n * The difference between [PUT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Method/PUT) and `POST` is that `PUT` is [idempotent](https://developer.mozilla.org/en-US/docs/Glossary/idempotent): calling it once is no different from calling it several times successively (there are no _side_ effects).\n * Successive identical `POST` requests may have additional effects, such as creating the same order several times.\n *\n * [HTML forms](/en-US/docs/Learn/Forms) typically send data using `POST` and this usually results in a change on the server.\n * For HTML forms the format/encoding of the body content is determined by the [`enctype`](/en-US/docs/Web/HTML/Element/form#enctype) attribute of the [form](https://developer.mozilla.org/en-US/docs/HTMLElement/form) element or the [`formenctype`](/en-US/docs/Web/HTML/Element/input#formenctype) attribute of the [input\") }} or _or_{{HTMLElement(\"button) elements.\n * The encoding may be one of the following:\n *\n * - `application/x-www-form-urlencoded`: the keys and values are encoded in key-value tuples separated by an ampersand (`&`), with an equals symbol (`=`) between the key and the value (e.g., `first-name=Frida&last-name=Kahlo`).\n * Non-alphanumeric characters in both keys and values are [percent-encoded](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding): this is the reason why this type is not suitable to use with binary data and you should use `multipart/form-data` for this purpose instead.\n * - `multipart/form-data`: each value is sent as a block of data (\"body part\"), with a user agent-defined delimiter (for example, `boundary=\"delimiter12345\"`) separating each part.\n * The keys are described in the [Content-Disposition](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition) header of each part or block of data.\n * - `text/plain`\n *\n * When the `POST` request is sent following a [fetch()](https://developer.mozilla.org/en-US/docs/domxref/Window/fetch) call, or for any other reason than an HTML form, the body can be any type.\n * As described in the HTTP 1.1 specification, `POST` is designed to allow a uniform method to cover the following functions:\n *\n * - Annotation of existing resources\n * - Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles\n * - Adding a new user through a signup form\n * - Providing a block of data, such as the result of submitting a form, to a data-handling process\n * - Extending a database through an append operation\n */\n POST = 'POST',\n\n /**\n * The **`PUT`** HTTP method creates a new resource or replaces a representation of the target resource with the request [content](https://developer.mozilla.org/en-US/docs/Glossary/HTTP_Content).\n *\n * The difference between `PUT` and [POST](https://developer.mozilla.org/en-US/docs/Web/HTTP/Method/POST) is that `PUT` is [idempotent](https://developer.mozilla.org/en-US/docs/Glossary/idempotent): calling it once is no different from calling it several times successively (there are no _side_ effects).\n */\n PUT = 'PUT',\n\n /**\n * The **`TRACE`** HTTP method performs a message loop-back test along the path to the target resource.\n *\n * The final recipient of the request should reflect the message as received (excluding any fields that might include sensitive data) back to the client as the message body of a [200 OK](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200) response with a [Content-Type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type) of `message/http`.\n * The final recipient is either the origin server or the first server to receive a [Max-Forwards](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Max-Forwards) value of `0` in the request.\n *\n * The client must not send [content](https://developer.mozilla.org/en-US/docs/Glossary/HTTP_Content) in the request, or generate headers that might include sensitive data such as user credentials or cookies.\n * Not all servers implement the `TRACE` method, and some server owners have historically disallowed the use of the `TRACE` method due to security concerns.\n * In such cases, a [405 Method Not Allowed](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405) [client error response](/en-US/docs/Web/HTTP/Status#client_error_responses) will be sent.\n */\n TRACE = 'TRACE',\n}\n"],"names":["HttpMethod"],"mappings":"AAAO,IAAK,aAAL,kBAAKA,iBAuBVA,YAAA,UAAU,WAOVA,YAAA,SAAS,UAUTA,YAAA,MAAM,OAYNA,YAAA,OAAO,QAOPA,YAAA,UAAU,WAgBVA,YAAA,QAAQ,SA2BRA,YAAA,OAAO,QAOPA,YAAA,MAAM,OAYNA,YAAA,QAAQ,SAzHEA,cAAA,cAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"HttpMethods.js","sources":["../HttpMethods.ts"],"sourcesContent":["/* eslint-disable jsdoc/check-indentation */\nexport enum HttpMethod {\n\n /**\n * The **`CONNECT`** HTTP method requests that a [proxy](https://developer.mozilla.org/en-US/docs/Glossary/Proxy_server) establish a HTTP tunnel to a destination server, and if successful, blindly forward data in both directions until the tunnel is closed.\n *\n * The request target is unique to this method in that it consists of only the host and port number of the tunnel destination, separated by a colon (see [Syntax](#syntax) for details).\n * Any [2XX successful response status code](/en-US/docs/Web/HTTP/Reference/Status#successful_responses) means that the proxy will switch to 'tunnel mode' and any data in the success response body is from the server identified by the request target.\n *\n * If a website is behind a proxy and it's enforced via network rules that all external traffic must pass through the proxy, the `CONNECT` method allows you to establish a [TLS](https://developer.mozilla.org/en-US/docs/Glossary/TLS) ([HTTPS](https://developer.mozilla.org/en-US/docs/Glossary/HTTPS)) connection with that website:\n *\n * - The client asks the proxy to tunnel the [TCP](https://developer.mozilla.org/en-US/docs/Glossary/TCP) connection to the desired destination.\n * - The proxy server makes a secure connection to the server on behalf of the client.\n * - Once the connection is established, the proxy server continues to relay the TCP stream to and from the client.\n *\n * Aside from enabling secure access to websites behind proxies, a HTTP tunnel provides a way to allow traffic that would otherwise be restricted (SSH or FTP) over the HTTP(S) protocol.\n *\n * `CONNECT` is a hop-by-hop method, meaning proxies will only forward the `CONNECT` request if there is another inbound proxy in front of the origin server since most origin servers do not implement `CONNECT`.\n *\n * > [!WARNING]\n * > If you are running a proxy that supports `CONNECT`, restrict its use to a set of known ports or a configurable list of safe request targets.\n * > There are significant risks in establishing a tunnel to arbitrary servers, particularly when the destination is a well-known or reserved TCP port that is not intended for Web traffic.\n * > A loosely-configured proxy may be abused to forward traffic such as SMTP to relay spam email, for example.\n *\n *\n *\n * ## Syntax\n *\n * ```http\n * CONNECT <host>:<port> HTTP/1.1\n * ```\n *\n * - `<host>`\n * - : A host which may be a registered hostname (e.g., `example.com`) or an IP address (IPv4, IPv6).\n * - `<port>`\n * - : A port number in decimal (e.g., `80`, `443`). There is no default port, so a client **must** send one.\n *\n * ## Examples\n *\n * ### Proxy authorization\n *\n * A request for proxy servers that require authorization to create a tunnel looks as follows.\n * See the [Proxy-Authorization](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Proxy-Authorization) header for more information.\n *\n * ```http\n * CONNECT server.example.com:80 HTTP/1.1\n * Host: server.example.com:80\n * Proxy-Authorization: basic aGVsbG86d29ybGQ=\n * ```\n *\n * ## Specifications\n *\n * ## Browser compatibility\n *\n * ## See also\n *\n * - [HTTP request methods](/en-US/docs/Web/HTTP/Reference/Methods)\n * - [HTTP response status codes](/en-US/docs/Web/HTTP/Reference/Status)\n * - [HTTP headers](/en-US/docs/Web/HTTP/Reference/Headers)\n * - [Proxy server](https://developer.mozilla.org/en-US/docs/Glossary/Proxy_server) glossary entry\n * - [Proxy-Authorization](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Proxy-Authorization) header\n * - [How To Use SSH Over An HTTP Proxy](https://www.dimoulis.net/posts/ssh-over-proxy/) dimoulis.net (2023)\n */\n CONNECT = 'CONNECT',\n\n /**\n * The **`DELETE`** HTTP method asks the server to delete a specified resource.\n *\n * The `DELETE` method has no defined semantics for the message body, so this should be empty.\n *\n *\n * ```\n *\n * ## Specifications\n *\n * ## Browser compatibility\n *\n * The browser doesn't use the `DELETE` method for user-initiated actions, so \"browser compatibility\" doesn't apply.\n * Developers can set this request method using [`fetch()`](/en-US/docs/Web/API/Window/fetch).\n *\n * ## See also\n *\n * - HTTP statuses: [200](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200), [202](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/202), [204](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/204)\n * - [HTTP request methods](/en-US/docs/Web/HTTP/Reference/Methods)\n * - [HTTP response status codes](/en-US/docs/Web/HTTP/Reference/Status)\n * - [HTTP headers](/en-US/docs/Web/HTTP/Reference/Headers)\n */\n DELETE = 'DELETE',\n\n /**\n * The **`GET`** HTTP method requests a representation of the specified resource.\n * Requests using `GET` should only be used to request data and shouldn't contain a body.\n *\n * > [!NOTE]\n * > The semantics of sending a message body in `GET` requests are undefined.\n * > Some servers may reject the request with a [4XX client error](/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) response.\n *\n *\n *\n * ## Syntax\n *\n * ```http\n * GET <request-target>[\"?\"<query>] HTTP/1.1\n * ```\n *\n * - `<request-target>`\n * - : Identifies the target resource of the request when combined with the information provided in the [Host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Host) header.\n * This is an absolute path (e.g., `/path/to/file.html`) in requests to an origin server, and an absolute URL in requests to proxies (e.g., `http://www.example.com/path/to/file.html`).\n * - `<query>`\n * - : An optional query component preceded by a question-mark `?`.\n * Often used to carry identifying information in the form of `key=value` pairs.\n *\n * ## Examples\n *\n * ### Successfully retrieving a resource\n *\n * The following `GET` request asks for the resource at `example.com/contact`:\n *\n * ```http\n * GET /contact HTTP/1.1\n * Host: example.com\n * User-Agent: curl/8.6.0\n * Accept: * /*\n * ```\n *\n * The server sends back the resource with a [200 OK](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200) status code, indicating success:\n *\n * ```http\n * HTTP/1.1 200 OK\n * Content-Type: text/html; charset=UTF-8\n * Date: Fri, 21 Jun 2024 14:18:33 GMT\n * Last-Modified: Thu, 17 Oct 2019 07:18:26 GMT\n * Content-Length: 1234\n *\n * <!doctype html>\n * <!-- HTML content follows -->\n * ```\n *\n * ## Specifications\n *\n * ## Browser compatibility\n *\n * ## See also\n *\n * - [HTTP request methods](/en-US/docs/Web/HTTP/Reference/Methods)\n * - [HTTP response status codes](/en-US/docs/Web/HTTP/Reference/Status)\n * - [HTTP headers](/en-US/docs/Web/HTTP/Reference/Headers)\n * - [Range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range) header\n * - [POST](https://developer.mozilla.org/en-US/docs/Web/HTTP/Method/POST) method\n */\n GET = 'GET',\n\n /**\n * The **`HEAD`** HTTP method requests the metadata of a resource in the form of [headers](/en-US/docs/Web/HTTP/Reference/Headers) that the server would have sent if the [GET](https://developer.mozilla.org/en-US/docs/Web/HTTP/Method/GET) method was used instead.\n * This method can be used in cases where a URL might produce a large download, for example, a `HEAD` request can read the [Content-Length](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Length) header to check the file size before downloading the file with a `GET`.\n *\n * If the response to a `HEAD` request shows that a cached URL response is now outdated, the cached copy is invalidated even if no `GET` request was made.\n *\n * > [!WARNING]\n * > If a response to a `HEAD` request has a body, the response body must be ignored.\n * > Any [representation headers](https://developer.mozilla.org/en-US/docs/glossary/Representation_header) that describe the erroneous body are assumed to describe the response body that a `GET` request would have received.\n *\n *\n *\n * ## Syntax\n *\n * ```http\n * HEAD <request-target>[\"?\"<query>] HTTP/1.1\n * ```\n *\n * - `<request-target>`\n * - : Identifies the target resource of the request when combined with the information provided in the [Host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Host) header.\n * This is an absolute path (e.g., `/path/to/file.html`) in requests to an origin server, and an absolute URL in requests to proxies (e.g., `http://www.example.com/path/to/file.html`).\n * - `<query>`\n * - : An optional query component preceded by a question-mark `?`.\n * Often used to carry identifying information in the form of `key=value` pairs.\n *\n * ## Examples\n *\n * ### Successfully retrieving resource metadata\n *\n * The following `curl` command creates a `HEAD` request for `example.com`:\n *\n * ```bash\n * curl --head example.com\n * ```\n *\n * This is the equivalent to a `GET` request, except the server shouldn't include a message body in the response.\n * It creates an HTTP request that looks like this:\n *\n * ```http\n * HEAD / HTTP/1.1\n * Host: example.com\n * User-Agent: curl/8.6.0\n * Accept: * /*\n * ```\n *\n * The server sends back a [200 OK](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200) response comprised only of headers.\n * The response is effectively metadata that describes the resource instead of the resource itself (some [caching](/en-US/docs/Web/HTTP/Guides/Caching) headers are omitted in this example for brevity):\n *\n * ```http\n * HTTP/1.1 200 OK\n * Content-Type: text/html; charset=UTF-8\n * Date: Wed, 04 Sep 2024 10:33:11 GMT\n * Content-Length: 1234567\n * ```\n *\n * ## Specifications\n *\n * ## Browser compatibility\n *\n * ## See also\n *\n * - [HTTP request methods](/en-US/docs/Web/HTTP/Reference/Methods)\n * - [HTTP response status codes](/en-US/docs/Web/HTTP/Reference/Status)\n * - [HTTP headers](/en-US/docs/Web/HTTP/Reference/Headers)\n * - [GET](https://developer.mozilla.org/en-US/docs/Web/HTTP/Method/GET) method\n */\n HEAD = 'HEAD',\n\n /**\n * The **`OPTIONS`** HTTP method requests permitted communication options for a given URL or server.\n * This can be used to test the allowed HTTP methods for a request, or to determine whether a request would succeed when making a CORS preflighted request.\n * A client can specify a URL with this method, or an asterisk (`*`) to refer to the entire server.\n *\n *\n *\n * \\* Although an `OPTIONS` message with a request body is technically allowed, it has no defined semantics.\n * You may include a body in an `OPTIONS` message as long as you provide a valid [Content-Type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type) header, and when you know the server expects it, as behavior is implementation-specific.\n *\n * ## Syntax\n *\n * ```http\n * OPTIONS *|<request-target>[\"?\"<query>] HTTP/1.1\n * ```\n *\n * The request target may be either in 'asterisk form' `*` indicating the whole server, or a request target as is common with other methods:\n *\n * - `*`\n * - : Indicates that the client wishes to request `OPTIONS` for the server as a whole, as opposed to a specific named resource of that server.\n * - `<request-target>`\n * - : Identifies the target resource of the request when combined with the information provided in the [Host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Host) header.\n * This is an absolute path (e.g., `/path/to/file.html`) in requests to an origin server, and an absolute URL in requests to proxies (e.g., `http://www.example.com/path/to/file.html`).\n * - `<query>`\n * - : An optional query component preceded by a question-mark `?`.\n * Often used to carry identifying information in the form of `key=value` pairs.\n *\n * ## Examples\n *\n * ### Identifying allowed request methods\n *\n * To find out which request methods a server supports, one can use the `curl` command-line program to issue an `OPTIONS` request:\n *\n * ```bash\n * curl -X OPTIONS https://example.org -i\n * ```\n *\n * This creates the following HTTP request:\n *\n * ```http\n * OPTIONS / HTTP/2\n * Host: example.org\n * User-Agent: curl/8.7.1\n * Accept: * /*\n * ```\n *\n * The response contains an [Allow](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Allow) header that holds the allowed methods:\n *\n * ```http\n * HTTP/1.1 204 No Content\n * Allow: OPTIONS, GET, HEAD, POST\n * Cache-Control: max-age=604800\n * Date: Thu, 13 Oct 2016 11:45:00 GMT\n * Server: EOS (lax004/2813)\n * ```\n *\n * ### Preflighted requests in CORS\n *\n * In [CORS](/en-US/docs/Web/HTTP/Guides/CORS), a [preflight request](/en-US/docs/Glossary/Preflight_request) is sent with the `OPTIONS` method so that the server can respond if it is acceptable to send the request. In this example, we will request permission for these parameters:\n *\n * - The [Access-Control-Request-Method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Request-Method) header sent in the preflight request tells the server that when the actual request is sent, it will have a [POST](https://developer.mozilla.org/en-US/docs/Web/HTTP/Method/POST) request method.\n * - The [Access-Control-Request-Headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Request-Headers) header tells the server that when the actual request is sent, it will have the `X-PINGOTHER` and `Content-Type` headers.\n *\n * ```http\n * OPTIONS /resources/post-here/ HTTP/1.1\n * Host: bar.example\n * Accept: text/html,application/xhtml+xml,application/xml;q=0.9,* /*;q=0.8\n * Accept-Language: en-us,en;q=0.5\n * Accept-Encoding: gzip,deflate\n * Connection: keep-alive\n * Origin: https://foo.example\n * Access-Control-Request-Method: POST\n * Access-Control-Request-Headers: content-type,x-pingother\n * ```\n *\n * The server now can respond if it will accept a request under these circumstances. In this example, the server response says that:\n *\n * - [Access-Control-Allow-Origin](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)\n * - : The `https://foo.example` origin is permitted to request the `bar.example/resources/post-here/` URL via the following:\n * - [Access-Control-Allow-Methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods)\n * - : [POST](https://developer.mozilla.org/en-US/docs/Web/HTTP/Method/POST), [GET](https://developer.mozilla.org/en-US/docs/Web/HTTP/Method/GET), and `OPTIONS` are permitted methods for the URL. (This header is similar to the [Allow](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Allow) response header, but used only for [CORS](/en-US/docs/Web/HTTP/Guides/CORS).)\n * - [Access-Control-Allow-Headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers)\n * - : `X-PINGOTHER` and `Content-Type` are permitted request headers for the URL.\n * - [Access-Control-Max-Age](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Max-Age)\n * - : The above permissions may be cached for 86,400 seconds (1 day).\n *\n * ```http\n * HTTP/1.1 200 OK\n * Date: Mon, 01 Dec 2008 01:15:39 GMT\n * Server: Apache/2.0.61 (Unix)\n * Access-Control-Allow-Origin: https://foo.example\n * Access-Control-Allow-Methods: POST, GET, OPTIONS\n * Access-Control-Allow-Headers: X-PINGOTHER, Content-Type\n * Access-Control-Max-Age: 86400\n * Vary: Accept-Encoding, Origin\n * Keep-Alive: timeout=2, max=100\n * Connection: Keep-Alive\n * ```\n *\n * > [!NOTE]\n * > Both [200 OK](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200) and [204 No Content](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/204) are [permitted status codes](https://fetch.spec.whatwg.org/#ref-for-ok-status), but some browsers incorrectly believe `204 No Content` applies to the resource and do not send a subsequent request to fetch it.\n *\n * ## Specifications\n *\n * ## Browser compatibility\n *\n * ## See also\n *\n * - [HTTP request methods](/en-US/docs/Web/HTTP/Reference/Methods)\n * - [HTTP response status codes](/en-US/docs/Web/HTTP/Reference/Status)\n * - [HTTP headers](/en-US/docs/Web/HTTP/Reference/Headers)\n * - [Allow](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Allow) header\n * - [CORS](/en-US/docs/Web/HTTP/Guides/CORS)\n */\n OPTIONS = 'OPTIONS',\n\n /**\n * The **`PATCH`** HTTP method applies partial modifications to a resource.\n *\n * `PATCH` is somewhat analogous to the \"update\" concept found in [CRUD](https://developer.mozilla.org/en-US/docs/Glossary/CRUD) (in general, HTTP is different than [CRUD](https://developer.mozilla.org/en-US/docs/Glossary/CRUD), and the two should not be confused).\n *\n * In comparison with [PUT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Method/PUT), a `PATCH` serves as a set of instructions for modifying a resource, whereas `PUT` represents a complete replacement of the resource.\n * A `PUT` request is always [idempotent](https://developer.mozilla.org/en-US/docs/Glossary/idempotent) (repeating the same request multiple times results in the resource remaining in the same state), whereas a `PATCH` request may not always be idempotent.\n * For instance, if a resource includes an auto-incrementing counter, a `PUT` request will overwrite the counter (since it replaces the entire resource), but a `PATCH` request may not.\n *\n * Like [POST](https://developer.mozilla.org/en-US/docs/Web/HTTP/Method/POST), a `PATCH` request can potentially have side effects on other resources.\n *\n * A server can advertise support for `PATCH` by adding it to the list in the [Allow](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Allow) or [Access-Control-Allow-Methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods) (for [CORS](/en-US/docs/Web/HTTP/Guides/CORS)) response headers.\n * Another implicit indication that `PATCH` is supported is the [Accept-Patch](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Patch) header (usually after an [OPTIONS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Method/OPTIONS) request on a resource), which lists the media-types the server is able to understand in a `PATCH` request for a resource.\n *\n *\n *\n * ## Syntax\n *\n * ```http\n * PATCH <request-target>[\"?\"<query>] HTTP/1.1\n * ```\n *\n * - `<request-target>`\n * - : Identifies the target resource of the request when combined with the information provided in the [Host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Host) header.\n * This is an absolute path (e.g., `/path/to/file.html`) in requests to an origin server, and an absolute URL in requests to proxies (e.g., `http://www.example.com/path/to/file.html`).\n * - `<query>`\n * - : An optional query component preceded by a question-mark `?`.\n * Often used to carry identifying information in the form of `key=value` pairs.\n *\n * ## Examples\n *\n * ### Successfully modifying a resource\n *\n * Assume there is a resource on the server representing a user with a numeric ID of `123` in the following format:\n *\n * ```json\n * {\n * \"firstName\": \"Example\",\n * \"LastName\": \"User\",\n * \"userId\": 123,\n * \"signupDate\": \"2024-09-09T21:48:58Z\",\n * \"status\": \"active\",\n * \"registeredDevice\": {\n * \"id\": 1,\n * \"name\": \"personal\",\n * \"manufacturer\": {\n * \"name\": \"Hardware corp\"\n * }\n * }\n * }\n * ```\n *\n * Instead of sending a JSON object to fully overwrite a resource, a `PATCH` modifies only specific parts of the resource.\n * This request updates the `status` field:\n *\n * ```http\n * PATCH /users/123 HTTP/1.1\n * Host: example.com\n * Content-Type: application/json\n * Content-Length: 27\n * Authorization: Bearer ABC123\n *\n * {\n * \"status\": \"suspended\"\n * }\n * ```\n *\n * The interpretation and authentication of the `PATCH` request depend on the implementation.\n * Success can be indicated by any of the [successful response status codes](/en-US/docs/Web/HTTP/Reference/Status#successful_responses).\n * In this example, a [204 No Content](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/204) is used as there's no need to transmit a body with additional context about the operation.\n * An [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) is provided so the caller can perform a [conditional request](/en-US/docs/Web/HTTP/Guides/Conditional_requests) in future:\n *\n * ```http\n * HTTP/1.1 204 No Content\n * Content-Location: /users/123\n * ETag: \"e0023aa4f\"\n * ```\n *\n * ## Specifications\n *\n * ## Browser compatibility\n *\n * The browser doesn't use the `PATCH` method for user-initiated actions, so \"browser compatibility\" doesn't apply.\n * Developers can set this request method using [`fetch()`](/en-US/docs/Web/API/Window/fetch).\n *\n * ## See also\n *\n * - [HTTP request methods](/en-US/docs/Web/HTTP/Reference/Methods)\n * - [HTTP response status codes](/en-US/docs/Web/HTTP/Reference/Status)\n * - [HTTP headers](/en-US/docs/Web/HTTP/Reference/Headers)\n * - [204](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/204)\n * - [Allow](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Allow), [Access-Control-Allow-Methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods) headers\n * - [Accept-Patch](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Patch) – specifies the patch document formats accepted by the server\n * - [JSON Patch Generator](https://jsoning.com/jsonpatch/)\n */\n PATCH = 'PATCH',\n\n /**\n * The **`POST`** HTTP method sends data to the server. The type of the body of the request is indicated by the [Content-Type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type) header.\n *\n * The difference between [PUT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Method/PUT) and `POST` is that `PUT` is [idempotent](https://developer.mozilla.org/en-US/docs/Glossary/idempotent): calling it once is no different from calling it several times successively (there are no _side_ effects).\n * Successive identical `POST` requests may have additional effects, such as creating the same order several times.\n *\n * [HTML forms](/en-US/docs/Learn_web_development/Extensions/Forms) typically send data using `POST` and this usually results in a change on the server.\n * For HTML forms the format/encoding of the body content is determined by the [`enctype`](/en-US/docs/Web/HTML/Reference/Elements/form#enctype) attribute of the [form](https://developer.mozilla.org/en-US/docs/HTMLElement/form) element or the [`formenctype`](/en-US/docs/Web/HTML/Reference/Elements/input#formenctype) attribute of the [input\") }} or _or_\n * - : An optional query component preceded by a question-mark `?`.\n * Often used to carry identifying information in the form of `key=value` pairs.\n *\n * ## Examples\n *\n * ### URL-encoded form submission\n *\n * A form using `application/x-www-form-urlencoded` content encoding (the default) sends a request where the body contains the form data in `key=value` pairs, with each pair separated by an `&` symbol, as shown below:\n *\n * ```http\n * POST /test HTTP/1.1\n * Host: example.com\n * Content-Type: application/x-www-form-urlencoded\n * Content-Length: 27\n *\n * field1=value1&field2=value2\n * ```\n *\n * ### Multipart form submission\n *\n * The `multipart/form-data` encoding is used when a form includes files or a lot of data.\n * This request body delineates each part of the form using a boundary string.\n * An example of a request in this format:\n *\n * ```http\n * POST /test HTTP/1.1\n * Host: example.com\n * Content-Type: multipart/form-data;boundary=\"delimiter12345\"\n *\n * --delimiter12345\n * Content-Disposition: form-data; name=\"field1\"\n *\n * value1\n * --delimiter12345\n * Content-Disposition: form-data; name=\"field2\"; filename=\"example.txt\"\n *\n * value2\n * --delimiter12345--\n * ```\n *\n * The [Content-Disposition](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition) header indicates how the form data should be processed, specifying the field `name` and `filename`, if appropriate.\n *\n * ## Specifications\n *\n * ## Browser compatibility\n *\n * ## See also\n *\n * - [HTTP request methods](/en-US/docs/Web/HTTP/Reference/Methods)\n * - [HTTP response status codes](/en-US/docs/Web/HTTP/Reference/Status)\n * - [HTTP headers](/en-US/docs/Web/HTTP/Reference/Headers)\n * - [Content-Type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type) header\n * - [Content-Disposition](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition) header\n * - [GET](https://developer.mozilla.org/en-US/docs/Web/HTTP/Method/GET) method\n */\n POST = 'POST',\n\n /**\n * The **`PUT`** HTTP method creates a new resource or replaces a representation of the target resource with the request [content](https://developer.mozilla.org/en-US/docs/Glossary/HTTP_Content).\n *\n * The difference between `PUT` and [POST](https://developer.mozilla.org/en-US/docs/Web/HTTP/Method/POST) is that `PUT` is [idempotent](https://developer.mozilla.org/en-US/docs/Glossary/idempotent): calling it once is no different from calling it several times successively (there are no _side_ effects).\n *\n *\n * ```\n *\n * If the target resource **does not** have a current representation and the `PUT` request successfully creates one, then the origin server must send a [201 Created](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/201) response:\n *\n * ```http\n * HTTP/1.1 201 Created\n * Content-Location: /new.html\n * ```\n *\n * If the target resource **does** have a current representation and that representation is successfully modified with the state in the request, the origin server must send either a [200 OK](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200) or a [204 No Content](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/204) to indicate successful completion of the request:\n *\n * ```http\n * HTTP/1.1 204 No Content\n * Content-Location: /existing.html\n * ```\n *\n * ## Specifications\n *\n * ## Browser compatibility\n *\n * The browser doesn't use the `PUT` method for user-initiated actions, so \"browser compatibility\" doesn't apply.\n * Developers can set this request method using [`fetch()`](/en-US/docs/Web/API/Window/fetch).\n *\n * ## See also\n *\n * - [HTTP request methods](/en-US/docs/Web/HTTP/Reference/Methods)\n * - [HTTP response status codes](/en-US/docs/Web/HTTP/Reference/Status)\n * - [HTTP headers](/en-US/docs/Web/HTTP/Reference/Headers)\n * - [201 Created](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/201), [204 No Content](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/204) response statuses\n */\n PUT = 'PUT',\n\n /**\n * The **`TRACE`** HTTP method performs a message loop-back test along the path to the target resource.\n *\n * The final recipient of the request should reflect the message as received (excluding any fields that might include sensitive data) back to the client as the message body of a [200 OK](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200) response with a [Content-Type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type) of `message/http`.\n * The final recipient is either the origin server or the first server to receive a [Max-Forwards](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Max-Forwards) value of `0` in the request.\n *\n * The client must not send [content](https://developer.mozilla.org/en-US/docs/Glossary/HTTP_Content) in the request, or generate headers that might include sensitive data such as user credentials or cookies.\n * Not all servers implement the `TRACE` method, and some server owners have historically disallowed the use of the `TRACE` method due to security concerns.\n * In such cases, a [405 Method Not Allowed](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405) [client error response](/en-US/docs/Web/HTTP/Reference/Status#client_error_responses) will be sent.\n *\n *\n *\n * ## Syntax\n *\n * ```http\n * TRACE <request-target>[\"?\"<query>] HTTP/1.1\n * ```\n *\n * - `<request-target>`\n * - : Identifies the target resource of the request when combined with the information provided in the [Host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Host) header.\n * This is an absolute path (e.g., `/path/to/file.html`) in requests to an origin server, and an absolute URL in requests to proxies (e.g., `http://www.example.com/path/to/file.html`).\n * - `<query>`\n * - : An optional query component preceded by a question-mark `?`.\n * Often used to carry identifying information in the form of `key=value` pairs.\n *\n * ## Examples\n *\n * ### Successful TRACE request\n *\n * A `TRACE` request can be performed using `curl`:\n *\n * ```bash\n * curl -v -X TRACE example.com\n * ```\n *\n * This produces the following HTTP request:\n *\n * ```http\n * TRACE / HTTP/1.1\n * Host: example.com\n * User-Agent: curl/8.7.1\n * Accept: * /*\n * ```\n *\n * A [200 OK](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200) response with the request headers contained in response body is sent back to the client:\n *\n * ```http\n * HTTP/1.1 200 OK\n * Content-Length: 123\n * Date: Wed, 04 Sep 2024 11:50:24 GMT\n * Server: Apache/2.4.59 (Unix)\n * Content-Type: message/http\n *\n * TRACE / HTTP/1.1\n * Host: example.com\n * User-Agent: curl/8.7.1\n * Accept: * /*\n * ```\n *\n * ## Specifications\n *\n * ## Browser compatibility\n *\n * The browser doesn't use the `TRACE` method for user-initiated actions, so \"browser compatibility\" doesn't apply.\n *\n * ## See also\n *\n * - [HTTP request methods](/en-US/docs/Web/HTTP/Reference/Methods)\n * - [HTTP response status codes](/en-US/docs/Web/HTTP/Reference/Status)\n * - [HTTP headers](/en-US/docs/Web/HTTP/Reference/Headers)\n * - [Cross-Site Tracing (XST)](https://owasp.org/www-community/attacks/Cross_Site_Tracing)\n */\n TRACE = 'TRACE',\n}\n"],"names":["HttpMethod"],"mappings":"AACO,IAAK,aAAL,kBAAKA,iBA8DVA,YAAA,UAAU,WAwBVA,YAAA,SAAS,UA+DTA,YAAA,MAAM,OAoENA,YAAA,OAAO,QAoHPA,YAAA,UAAU,WAiGVA,YAAA,QAAQ,SAiERA,YAAA,OAAO,QAsCPA,YAAA,MAAM,OA0ENA,YAAA,QAAQ,SA/lBEA,cAAA,cAAA,CAAA,CAAA;"}