@catbee/utils 0.0.1 → 0.0.3

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 (197) hide show
  1. package/README.md +303 -107
  2. package/build/esm/config.d.ts +13 -1
  3. package/build/esm/config.js +16 -4
  4. package/build/esm/config.js.map +1 -1
  5. package/build/esm/index.d.ts +20 -18
  6. package/build/esm/index.js +20 -18
  7. package/build/esm/index.js.map +1 -1
  8. package/build/esm/types/api-response.d.ts +83 -1
  9. package/build/esm/types/api-response.js.map +1 -1
  10. package/build/esm/utils/array.utils.d.ts +65 -2
  11. package/build/esm/utils/array.utils.js +147 -20
  12. package/build/esm/utils/array.utils.js.map +1 -1
  13. package/build/esm/utils/async.utils.d.ts +56 -1
  14. package/build/esm/utils/async.utils.js +166 -11
  15. package/build/esm/utils/async.utils.js.map +1 -1
  16. package/build/esm/utils/cache.utils.d.ts +67 -4
  17. package/build/esm/utils/cache.utils.js +210 -28
  18. package/build/esm/utils/cache.utils.js.map +1 -1
  19. package/build/esm/utils/context-store.utils.d.ts +102 -1
  20. package/build/esm/utils/context-store.utils.js +185 -3
  21. package/build/esm/utils/context-store.utils.js.map +1 -1
  22. package/build/esm/utils/crypto.utils.d.ts +110 -8
  23. package/build/esm/utils/crypto.utils.js +298 -23
  24. package/build/esm/utils/crypto.utils.js.map +1 -1
  25. package/build/esm/utils/decorators.utils.d.ts +40 -0
  26. package/build/esm/utils/decorators.utils.js +312 -0
  27. package/build/esm/utils/decorators.utils.js.map +1 -0
  28. package/build/esm/utils/dir.utils.d.ts +122 -1
  29. package/build/esm/utils/dir.utils.js +578 -3
  30. package/build/esm/utils/dir.utils.js.map +1 -1
  31. package/build/esm/utils/env.utils.d.ts +83 -0
  32. package/build/esm/utils/env.utils.js +235 -6
  33. package/build/esm/utils/env.utils.js.map +1 -1
  34. package/build/esm/utils/exception.utils.d.ts +117 -1
  35. package/build/esm/utils/exception.utils.js +331 -12
  36. package/build/esm/utils/exception.utils.js.map +1 -1
  37. package/build/esm/utils/fs.utils.d.ts +132 -0
  38. package/build/esm/utils/fs.utils.js +421 -4
  39. package/build/esm/utils/fs.utils.js.map +1 -1
  40. package/build/esm/utils/http-status-codes.d.ts +87 -178
  41. package/build/esm/utils/http-status-codes.js +92 -178
  42. package/build/esm/utils/http-status-codes.js.map +1 -1
  43. package/build/esm/utils/id.utils.d.ts +11 -10
  44. package/build/esm/utils/id.utils.js +30 -21
  45. package/build/esm/utils/id.utils.js.map +1 -1
  46. package/build/esm/utils/logger.utils.d.ts +35 -2
  47. package/build/esm/utils/logger.utils.js +68 -14
  48. package/build/esm/utils/logger.utils.js.map +1 -1
  49. package/build/esm/utils/middleware.utils.d.ts +73 -0
  50. package/build/esm/utils/middleware.utils.js +158 -0
  51. package/build/esm/utils/middleware.utils.js.map +1 -0
  52. package/build/esm/utils/obj.utils.d.ts +65 -3
  53. package/build/esm/utils/obj.utils.js +206 -18
  54. package/build/esm/utils/obj.utils.js.map +1 -1
  55. package/build/esm/utils/response.utils.d.ts +103 -2
  56. package/build/esm/utils/response.utils.js +156 -3
  57. package/build/esm/utils/response.utils.js.map +1 -1
  58. package/build/esm/utils/string.utils.d.ts +61 -5
  59. package/build/esm/utils/string.utils.js +109 -19
  60. package/build/esm/utils/string.utils.js.map +1 -1
  61. package/build/esm/utils/url.utils.d.ts +117 -0
  62. package/build/esm/utils/url.utils.js +287 -2
  63. package/build/esm/utils/url.utils.js.map +1 -1
  64. package/build/esm/utils/validate.utils.d.ts +110 -0
  65. package/build/esm/utils/validate.utils.js +190 -8
  66. package/build/esm/utils/validate.utils.js.map +1 -1
  67. package/build/esnext/config.d.ts +13 -1
  68. package/build/esnext/config.js +16 -4
  69. package/build/esnext/config.js.map +1 -1
  70. package/build/esnext/index.d.ts +20 -18
  71. package/build/esnext/index.js +20 -18
  72. package/build/esnext/index.js.map +1 -1
  73. package/build/esnext/types/api-response.d.ts +83 -1
  74. package/build/esnext/types/api-response.js.map +1 -1
  75. package/build/esnext/utils/array.utils.d.ts +65 -2
  76. package/build/esnext/utils/array.utils.js +140 -21
  77. package/build/esnext/utils/array.utils.js.map +1 -1
  78. package/build/esnext/utils/async.utils.d.ts +56 -1
  79. package/build/esnext/utils/async.utils.js +130 -14
  80. package/build/esnext/utils/async.utils.js.map +1 -1
  81. package/build/esnext/utils/cache.utils.d.ts +67 -4
  82. package/build/esnext/utils/cache.utils.js +137 -9
  83. package/build/esnext/utils/cache.utils.js.map +1 -1
  84. package/build/esnext/utils/context-store.utils.d.ts +102 -1
  85. package/build/esnext/utils/context-store.utils.js +171 -3
  86. package/build/esnext/utils/context-store.utils.js.map +1 -1
  87. package/build/esnext/utils/crypto.utils.d.ts +110 -8
  88. package/build/esnext/utils/crypto.utils.js +199 -19
  89. package/build/esnext/utils/crypto.utils.js.map +1 -1
  90. package/build/esnext/utils/decorators.utils.d.ts +40 -0
  91. package/build/esnext/utils/decorators.utils.js +155 -0
  92. package/build/esnext/utils/decorators.utils.js.map +1 -0
  93. package/build/esnext/utils/dir.utils.d.ts +122 -1
  94. package/build/esnext/utils/dir.utils.js +307 -3
  95. package/build/esnext/utils/dir.utils.js.map +1 -1
  96. package/build/esnext/utils/env.utils.d.ts +83 -0
  97. package/build/esnext/utils/env.utils.js +191 -8
  98. package/build/esnext/utils/env.utils.js.map +1 -1
  99. package/build/esnext/utils/exception.utils.d.ts +117 -1
  100. package/build/esnext/utils/exception.utils.js +222 -12
  101. package/build/esnext/utils/exception.utils.js.map +1 -1
  102. package/build/esnext/utils/fs.utils.d.ts +132 -0
  103. package/build/esnext/utils/fs.utils.js +268 -4
  104. package/build/esnext/utils/fs.utils.js.map +1 -1
  105. package/build/esnext/utils/http-status-codes.d.ts +87 -178
  106. package/build/esnext/utils/http-status-codes.js +92 -178
  107. package/build/esnext/utils/http-status-codes.js.map +1 -1
  108. package/build/esnext/utils/id.utils.d.ts +11 -10
  109. package/build/esnext/utils/id.utils.js +28 -20
  110. package/build/esnext/utils/id.utils.js.map +1 -1
  111. package/build/esnext/utils/logger.utils.d.ts +35 -2
  112. package/build/esnext/utils/logger.utils.js +56 -14
  113. package/build/esnext/utils/logger.utils.js.map +1 -1
  114. package/build/esnext/utils/middleware.utils.d.ts +73 -0
  115. package/build/esnext/utils/middleware.utils.js +157 -0
  116. package/build/esnext/utils/middleware.utils.js.map +1 -0
  117. package/build/esnext/utils/obj.utils.d.ts +65 -3
  118. package/build/esnext/utils/obj.utils.js +169 -14
  119. package/build/esnext/utils/obj.utils.js.map +1 -1
  120. package/build/esnext/utils/response.utils.d.ts +103 -2
  121. package/build/esnext/utils/response.utils.js +141 -3
  122. package/build/esnext/utils/response.utils.js.map +1 -1
  123. package/build/esnext/utils/string.utils.d.ts +61 -5
  124. package/build/esnext/utils/string.utils.js +110 -14
  125. package/build/esnext/utils/string.utils.js.map +1 -1
  126. package/build/esnext/utils/url.utils.d.ts +117 -0
  127. package/build/esnext/utils/url.utils.js +248 -2
  128. package/build/esnext/utils/url.utils.js.map +1 -1
  129. package/build/esnext/utils/validate.utils.d.ts +110 -0
  130. package/build/esnext/utils/validate.utils.js +190 -8
  131. package/build/esnext/utils/validate.utils.js.map +1 -1
  132. package/build/src/config.d.ts +13 -1
  133. package/build/src/config.js +15 -3
  134. package/build/src/config.js.map +1 -1
  135. package/build/src/index.d.ts +20 -18
  136. package/build/src/index.js +2 -0
  137. package/build/src/index.js.map +1 -1
  138. package/build/src/types/api-response.d.ts +83 -1
  139. package/build/src/types/api-response.js.map +1 -1
  140. package/build/src/utils/array.utils.d.ts +65 -2
  141. package/build/src/utils/array.utils.js +147 -22
  142. package/build/src/utils/array.utils.js.map +1 -1
  143. package/build/src/utils/async.utils.d.ts +56 -1
  144. package/build/src/utils/async.utils.js +137 -17
  145. package/build/src/utils/async.utils.js.map +1 -1
  146. package/build/src/utils/cache.utils.d.ts +67 -4
  147. package/build/src/utils/cache.utils.js +137 -9
  148. package/build/src/utils/cache.utils.js.map +1 -1
  149. package/build/src/utils/context-store.utils.d.ts +102 -1
  150. package/build/src/utils/context-store.utils.js +173 -3
  151. package/build/src/utils/context-store.utils.js.map +1 -1
  152. package/build/src/utils/crypto.utils.d.ts +110 -8
  153. package/build/src/utils/crypto.utils.js +214 -27
  154. package/build/src/utils/crypto.utils.js.map +1 -1
  155. package/build/src/utils/decorators.utils.d.ts +40 -0
  156. package/build/src/utils/decorators.utils.js +165 -0
  157. package/build/src/utils/decorators.utils.js.map +1 -0
  158. package/build/src/utils/dir.utils.d.ts +122 -1
  159. package/build/src/utils/dir.utils.js +314 -0
  160. package/build/src/utils/dir.utils.js.map +1 -1
  161. package/build/src/utils/env.utils.d.ts +83 -0
  162. package/build/src/utils/env.utils.js +192 -9
  163. package/build/src/utils/env.utils.js.map +1 -1
  164. package/build/src/utils/exception.utils.d.ts +117 -1
  165. package/build/src/utils/exception.utils.js +233 -11
  166. package/build/src/utils/exception.utils.js.map +1 -1
  167. package/build/src/utils/fs.utils.d.ts +132 -0
  168. package/build/src/utils/fs.utils.js +281 -3
  169. package/build/src/utils/fs.utils.js.map +1 -1
  170. package/build/src/utils/http-status-codes.d.ts +87 -178
  171. package/build/src/utils/http-status-codes.js +92 -178
  172. package/build/src/utils/http-status-codes.js.map +1 -1
  173. package/build/src/utils/id.utils.d.ts +11 -10
  174. package/build/src/utils/id.utils.js +28 -20
  175. package/build/src/utils/id.utils.js.map +1 -1
  176. package/build/src/utils/logger.utils.d.ts +35 -2
  177. package/build/src/utils/logger.utils.js +56 -11
  178. package/build/src/utils/logger.utils.js.map +1 -1
  179. package/build/src/utils/middleware.utils.d.ts +73 -0
  180. package/build/src/utils/middleware.utils.js +163 -0
  181. package/build/src/utils/middleware.utils.js.map +1 -0
  182. package/build/src/utils/obj.utils.d.ts +65 -3
  183. package/build/src/utils/obj.utils.js +179 -18
  184. package/build/src/utils/obj.utils.js.map +1 -1
  185. package/build/src/utils/response.utils.d.ts +103 -2
  186. package/build/src/utils/response.utils.js +147 -2
  187. package/build/src/utils/response.utils.js.map +1 -1
  188. package/build/src/utils/string.utils.d.ts +61 -5
  189. package/build/src/utils/string.utils.js +122 -20
  190. package/build/src/utils/string.utils.js.map +1 -1
  191. package/build/src/utils/url.utils.d.ts +117 -0
  192. package/build/src/utils/url.utils.js +256 -1
  193. package/build/src/utils/url.utils.js.map +1 -1
  194. package/build/src/utils/validate.utils.d.ts +110 -0
  195. package/build/src/utils/validate.utils.js +204 -8
  196. package/build/src/utils/validate.utils.js.map +1 -1
  197. package/package.json +20 -12
@@ -1,357 +1,271 @@
1
+ /**
2
+ * Complete HTTP status codes enum with descriptions.
3
+ * For use with API responses and error handling.
4
+ */
1
5
  export var HttpStatusCodes;
2
6
  (function (HttpStatusCodes) {
7
+ // 1xx Informational
3
8
  /**
4
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.2.1
5
- *
6
- * This interim response indicates that everything so far is OK and that the client should continue with the request or ignore it if it is already finished.
9
+ * The server has received the request headers and the client should proceed to send the request body.
7
10
  */
8
11
  HttpStatusCodes[HttpStatusCodes["CONTINUE"] = 100] = "CONTINUE";
9
12
  /**
10
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.2.2
11
- *
12
- * This code is sent in response to an Upgrade request header by the client, and indicates the protocol the server is switching too.
13
+ * The server is switching protocols according to the client's request.
13
14
  */
14
15
  HttpStatusCodes[HttpStatusCodes["SWITCHING_PROTOCOLS"] = 101] = "SWITCHING_PROTOCOLS";
15
16
  /**
16
- * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.1
17
- *
18
- * This code indicates that the server has received and is processing the request, but no response is available yet.
17
+ * Server has received the request and is still processing it.
19
18
  */
20
19
  HttpStatusCodes[HttpStatusCodes["PROCESSING"] = 102] = "PROCESSING";
21
20
  /**
22
- * Official Documentation @ https://www.rfc-editor.org/rfc/rfc8297#page-3
23
- *
24
- * This code indicates to the client that the server is likely to send a final response with the header fields included in the informational response.
21
+ * The server is sending preliminary headers while preparing the final response.
25
22
  */
26
23
  HttpStatusCodes[HttpStatusCodes["EARLY_HINTS"] = 103] = "EARLY_HINTS";
24
+ // 2xx Success
27
25
  /**
28
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.1
29
- *
30
- * The request has succeeded. The meaning of a success varies depending on the HTTP method:
31
- * GET: The resource has been fetched and is transmitted in the message body.
32
- * HEAD: The entity headers are in the message body.
33
- * POST: The resource describing the result of the action is transmitted in the message body.
34
- * TRACE: The message body contains the request message as received by the server
26
+ * The request succeeded. The result meaning depends on the HTTP method used.
35
27
  */
36
28
  HttpStatusCodes[HttpStatusCodes["OK"] = 200] = "OK";
37
29
  /**
38
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.2
39
- *
40
- * The request has succeeded and a new resource has been created as a result of it. This is typically the response sent after a PUT request.
30
+ * The request succeeded and a new resource was created as a result.
41
31
  */
42
32
  HttpStatusCodes[HttpStatusCodes["CREATED"] = 201] = "CREATED";
43
33
  /**
44
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.3
45
- *
46
- * The request has been received but not yet acted upon. It is non-committal, meaning that there is no way in HTTP to later send an asynchronous response indicating the outcome of processing the request. It is intended for cases where another process or server handles the request, or for batch processing.
34
+ * The request has been received but not yet acted upon.
47
35
  */
48
36
  HttpStatusCodes[HttpStatusCodes["ACCEPTED"] = 202] = "ACCEPTED";
49
37
  /**
50
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.4
51
- *
52
- * This response code means returned meta-information set is not exact set as available from the origin server, but collected from a local or a third party copy. Except this condition, 200 OK response should be preferred instead of this response.
38
+ * The returned information is from a third-party source, not the origin server.
53
39
  */
54
40
  HttpStatusCodes[HttpStatusCodes["NON_AUTHORITATIVE_INFORMATION"] = 203] = "NON_AUTHORITATIVE_INFORMATION";
55
41
  /**
56
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.5
57
- *
58
- * There is no content to send for this request, but the headers may be useful. The user-agent may update its cached headers for this resource with the new ones.
42
+ * The request succeeded but there's no content to send in the response.
59
43
  */
60
44
  HttpStatusCodes[HttpStatusCodes["NO_CONTENT"] = 204] = "NO_CONTENT";
61
45
  /**
62
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.6
63
- *
64
- * This response code is sent after accomplishing request to tell user agent reset document view which sent this request.
46
+ * The client should reset the document view that caused this request.
65
47
  */
66
48
  HttpStatusCodes[HttpStatusCodes["RESET_CONTENT"] = 205] = "RESET_CONTENT";
67
49
  /**
68
- * Official Documentation @ https://tools.ietf.org/html/rfc7233#section-4.1
69
- *
70
- * This response code is used because of range header sent by the client to separate download into multiple streams.
50
+ * The server is delivering only part of the resource due to a range header sent by the client.
71
51
  */
72
52
  HttpStatusCodes[HttpStatusCodes["PARTIAL_CONTENT"] = 206] = "PARTIAL_CONTENT";
73
53
  /**
74
- * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.2
75
- *
76
- * A Multi-Status response conveys information about multiple resources in situations where multiple status codes might be appropriate.
54
+ * Conveys information about multiple resources, for complex operations.
77
55
  */
78
56
  HttpStatusCodes[HttpStatusCodes["MULTI_STATUS"] = 207] = "MULTI_STATUS";
79
57
  /**
80
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.1
81
- *
82
- * The request has more than one possible responses. User-agent or user should choose one of them. There is no standardized way to choose one of the responses.
58
+ * The members of a DAV binding have already been enumerated and are not included in the response.
59
+ */
60
+ HttpStatusCodes[HttpStatusCodes["ALREADY_REPORTED"] = 208] = "ALREADY_REPORTED";
61
+ /**
62
+ * The server has fulfilled a request for the resource, and the response represents the result of one or more instance-manipulations.
63
+ */
64
+ HttpStatusCodes[HttpStatusCodes["IM_USED"] = 226] = "IM_USED";
65
+ // 3xx Redirection
66
+ /**
67
+ * The request has more than one possible response and the client should choose one.
83
68
  */
84
69
  HttpStatusCodes[HttpStatusCodes["MULTIPLE_CHOICES"] = 300] = "MULTIPLE_CHOICES";
85
70
  /**
86
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.2
87
- *
88
- * This response code means that URI of requested resource has been changed. Probably, new URI would be given in the response.
71
+ * The resource has been permanently moved to a new URL.
89
72
  */
90
73
  HttpStatusCodes[HttpStatusCodes["MOVED_PERMANENTLY"] = 301] = "MOVED_PERMANENTLY";
91
74
  /**
92
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.3
93
- *
94
- * This response code means that URI of requested resource has been changed temporarily. New changes in the URI might be made in the future. Therefore, this same URI should be used by the client in future requests.
75
+ * The resource has been temporarily moved to another URL.
95
76
  */
96
77
  HttpStatusCodes[HttpStatusCodes["MOVED_TEMPORARILY"] = 302] = "MOVED_TEMPORARILY";
97
78
  /**
98
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.4
99
- *
100
- * Server sent this response to directing client to get requested resource to another URI with an GET request.
79
+ * The response to the request can be found under another URI using the GET method.
101
80
  */
102
81
  HttpStatusCodes[HttpStatusCodes["SEE_OTHER"] = 303] = "SEE_OTHER";
103
82
  /**
104
- * Official Documentation @ https://tools.ietf.org/html/rfc7232#section-4.1
105
- *
106
- * This is used for caching purposes. It is telling to client that response has not been modified. So, client can continue to use same cached version of response.
83
+ * The resource hasn't been modified since the last request.
107
84
  */
108
85
  HttpStatusCodes[HttpStatusCodes["NOT_MODIFIED"] = 304] = "NOT_MODIFIED";
109
86
  /**
110
87
  * @deprecated
111
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.6
112
- *
113
- * Was defined in a previous version of the HTTP specification to indicate that a requested response must be accessed by a proxy. It has been deprecated due to security concerns regarding in-band configuration of a proxy.
88
+ * Response must be accessed through a proxy.
114
89
  */
115
90
  HttpStatusCodes[HttpStatusCodes["USE_PROXY"] = 305] = "USE_PROXY";
116
91
  /**
117
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.7
118
- *
119
- * Server sent this response to directing client to get requested resource to another URI with same method that used prior request. This has the same semantic than the 302 Found HTTP response code, with the exception that the user agent must not change the HTTP method used: if a POST was used in the first request, a POST must be used in the second request.
92
+ * The resource is temporarily available at a different URI, using the same HTTP method.
120
93
  */
121
94
  HttpStatusCodes[HttpStatusCodes["TEMPORARY_REDIRECT"] = 307] = "TEMPORARY_REDIRECT";
122
95
  /**
123
- * Official Documentation @ https://tools.ietf.org/html/rfc7538#section-3
124
- *
125
- * This means that the resource is now permanently located at another URI, specified by the Location: HTTP Response header. This has the same semantics as the 301 Moved Permanently HTTP response code, with the exception that the user agent must not change the HTTP method used: if a POST was used in the first request, a POST must be used in the second request.
96
+ * The resource has been permanently moved to another URL, using the same HTTP method.
126
97
  */
127
98
  HttpStatusCodes[HttpStatusCodes["PERMANENT_REDIRECT"] = 308] = "PERMANENT_REDIRECT";
99
+ // 4xx Client Error
128
100
  /**
129
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.1
130
- *
131
- * This response means that server could not understand the request due to invalid syntax.
101
+ * The server cannot process the request due to a client error (malformed request).
132
102
  */
133
103
  HttpStatusCodes[HttpStatusCodes["BAD_REQUEST"] = 400] = "BAD_REQUEST";
134
104
  /**
135
- * Official Documentation @ https://tools.ietf.org/html/rfc7235#section-3.1
136
- *
137
- * Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response.
105
+ * Authentication is required and has failed or not been provided.
138
106
  */
139
107
  HttpStatusCodes[HttpStatusCodes["UNAUTHORIZED"] = 401] = "UNAUTHORIZED";
140
108
  /**
141
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.2
142
- *
143
- * This response code is reserved for future use. Initial aim for creating this code was using it for digital payment systems however this is not used currently.
109
+ * Reserved for future use, originally intended for digital payment systems.
144
110
  */
145
111
  HttpStatusCodes[HttpStatusCodes["PAYMENT_REQUIRED"] = 402] = "PAYMENT_REQUIRED";
146
112
  /**
147
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.3
148
- *
149
- * The client does not have access rights to the content, i.e. they are unauthorized, so server is rejecting to give proper response. Unlike 401, the client's identity is known to the server.
113
+ * The client doesn't have permission to access the requested resource.
150
114
  */
151
115
  HttpStatusCodes[HttpStatusCodes["FORBIDDEN"] = 403] = "FORBIDDEN";
152
116
  /**
153
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.4
154
- *
155
- * The server can not find requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 to hide the existence of a resource from an unauthorized client. This response code is probably the most famous one due to its frequent occurence on the web.
117
+ * The requested resource could not be found on the server.
156
118
  */
157
119
  HttpStatusCodes[HttpStatusCodes["NOT_FOUND"] = 404] = "NOT_FOUND";
158
120
  /**
159
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.5
160
- *
161
- * The request method is known by the server but has been disabled and cannot be used. For example, an API may forbid DELETE-ing a resource. The two mandatory methods, GET and HEAD, must never be disabled and should not return this error code.
121
+ * The request method is not supported for the requested resource.
162
122
  */
163
123
  HttpStatusCodes[HttpStatusCodes["METHOD_NOT_ALLOWED"] = 405] = "METHOD_NOT_ALLOWED";
164
124
  /**
165
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.6
166
- *
167
- * This response is sent when the web server, after performing server-driven content negotiation, doesn't find any content following the criteria given by the user agent.
125
+ * The server can't provide a response matching the list of acceptable values in the client's headers.
168
126
  */
169
127
  HttpStatusCodes[HttpStatusCodes["NOT_ACCEPTABLE"] = 406] = "NOT_ACCEPTABLE";
170
128
  /**
171
- * Official Documentation @ https://tools.ietf.org/html/rfc7235#section-3.2
172
- *
173
- * This is similar to 401 but authentication is needed to be done by a proxy.
129
+ * Authentication by a proxy is required.
174
130
  */
175
131
  HttpStatusCodes[HttpStatusCodes["PROXY_AUTHENTICATION_REQUIRED"] = 407] = "PROXY_AUTHENTICATION_REQUIRED";
176
132
  /**
177
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.7
178
- *
179
- * This response is sent on an idle connection by some servers, even without any previous request by the client. It means that the server would like to shut down this unused connection. This response is used much more since some browsers, like Chrome, Firefox 27+, or IE9, use HTTP pre-connection mechanisms to speed up surfing. Also note that some servers merely shut down the connection without sending this message.
133
+ * The server timed out waiting for the request.
180
134
  */
181
135
  HttpStatusCodes[HttpStatusCodes["REQUEST_TIMEOUT"] = 408] = "REQUEST_TIMEOUT";
182
136
  /**
183
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.8
184
- *
185
- * This response is sent when a request conflicts with the current state of the server.
137
+ * The request conflicts with the current state of the server.
186
138
  */
187
139
  HttpStatusCodes[HttpStatusCodes["CONFLICT"] = 409] = "CONFLICT";
188
140
  /**
189
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.9
190
- *
191
- * This response would be sent when the requested content has been permenantly deleted from server, with no forwarding address. Clients are expected to remove their caches and links to the resource. The HTTP specification intends this status code to be used for "limited-time, promotional services". APIs should not feel compelled to indicate resources that have been deleted with this status code.
141
+ * The resource has been permanently deleted with no forwarding address.
192
142
  */
193
143
  HttpStatusCodes[HttpStatusCodes["GONE"] = 410] = "GONE";
194
144
  /**
195
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.10
196
- *
197
- * The server rejected the request because the Content-Length header field is not defined and the server requires it.
145
+ * The server requires a Content-Length header field.
198
146
  */
199
147
  HttpStatusCodes[HttpStatusCodes["LENGTH_REQUIRED"] = 411] = "LENGTH_REQUIRED";
200
148
  /**
201
- * Official Documentation @ https://tools.ietf.org/html/rfc7232#section-4.2
202
- *
203
- * The client has indicated preconditions in its headers which the server does not meet.
149
+ * Preconditions in the client's headers failed.
204
150
  */
205
151
  HttpStatusCodes[HttpStatusCodes["PRECONDITION_FAILED"] = 412] = "PRECONDITION_FAILED";
206
152
  /**
207
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.11
208
- *
209
- * Request entity is larger than limits defined by server; the server might close the connection or return an Retry-After header field.
153
+ * Request entity is larger than limits defined by server.
210
154
  */
211
155
  HttpStatusCodes[HttpStatusCodes["REQUEST_TOO_LONG"] = 413] = "REQUEST_TOO_LONG";
212
156
  /**
213
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.12
214
- *
215
- * The URI requested by the client is longer than the server is willing to interpret.
157
+ * The request payload exceeds server size limits.
158
+ * Modern equivalent of REQUEST_TOO_LONG.
159
+ */
160
+ HttpStatusCodes[HttpStatusCodes["PAYLOAD_TOO_LARGE"] = 413] = "PAYLOAD_TOO_LARGE";
161
+ /**
162
+ * The URI requested is too long for the server to interpret.
216
163
  */
217
164
  HttpStatusCodes[HttpStatusCodes["REQUEST_URI_TOO_LONG"] = 414] = "REQUEST_URI_TOO_LONG";
218
165
  /**
219
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.13
220
- *
221
- * The media format of the requested data is not supported by the server, so the server is rejecting the request.
166
+ * The server does not support the media type requested by the client.
222
167
  */
223
168
  HttpStatusCodes[HttpStatusCodes["UNSUPPORTED_MEDIA_TYPE"] = 415] = "UNSUPPORTED_MEDIA_TYPE";
224
169
  /**
225
- * Official Documentation @ https://tools.ietf.org/html/rfc7233#section-4.4
226
- *
227
- * The range specified by the Range header field in the request can't be fulfilled; it's possible that the range is outside the size of the target URI's data.
170
+ * The range specified by the Range header cannot be fulfilled.
228
171
  */
229
172
  HttpStatusCodes[HttpStatusCodes["REQUESTED_RANGE_NOT_SATISFIABLE"] = 416] = "REQUESTED_RANGE_NOT_SATISFIABLE";
230
173
  /**
231
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.14
232
- *
233
- * This response code means the expectation indicated by the Expect request header field can't be met by the server.
174
+ * The server cannot meet the expectations given in the Expect header.
234
175
  */
235
176
  HttpStatusCodes[HttpStatusCodes["EXPECTATION_FAILED"] = 417] = "EXPECTATION_FAILED";
236
177
  /**
237
- * Official Documentation @ https://tools.ietf.org/html/rfc2324#section-2.3.2
238
- *
239
- * Any attempt to brew coffee with a teapot should result in the error code "418 I'm a teapot". The resulting entity body MAY be short and stout.
178
+ * The server refuses to brew coffee because it is a teapot. (April Fools' joke)
240
179
  */
241
180
  HttpStatusCodes[HttpStatusCodes["IM_A_TEAPOT"] = 418] = "IM_A_TEAPOT";
242
181
  /**
243
- * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.6
244
- *
245
- * The 507 (Insufficient Storage) status code means the method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request. This condition is considered to be temporary. If the request which received this status code was the result of a user action, the request MUST NOT be repeated until it is requested by a separate user action.
182
+ * The server cannot store the representation needed to complete the request.
246
183
  */
247
184
  HttpStatusCodes[HttpStatusCodes["INSUFFICIENT_SPACE_ON_RESOURCE"] = 419] = "INSUFFICIENT_SPACE_ON_RESOURCE";
248
185
  /**
249
186
  * @deprecated
250
- * Official Documentation @ https://tools.ietf.org/rfcdiff?difftype=--hwdiff&url2=draft-ietf-webdav-protocol-06.txt
251
- *
252
- * A deprecated response used by the Spring Framework when a method has failed.
187
+ * A method has failed - specific to Spring Framework.
253
188
  */
254
189
  HttpStatusCodes[HttpStatusCodes["METHOD_FAILURE"] = 420] = "METHOD_FAILURE";
255
190
  /**
256
- * Official Documentation @ https://datatracker.ietf.org/doc/html/rfc7540#section-9.1.2
257
- *
258
- * Defined in the specification of HTTP/2 to indicate that a server is not able to produce a response for the combination of scheme and authority that are included in the request URI.
191
+ * The server cannot produce a response for the requested URI scheme and authority.
259
192
  */
260
193
  HttpStatusCodes[HttpStatusCodes["MISDIRECTED_REQUEST"] = 421] = "MISDIRECTED_REQUEST";
261
194
  /**
262
- * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.3
263
- *
264
- * The request was well-formed but was unable to be followed due to semantic errors.
195
+ * The request was well-formed but has semantic errors preventing processing.
265
196
  */
266
197
  HttpStatusCodes[HttpStatusCodes["UNPROCESSABLE_ENTITY"] = 422] = "UNPROCESSABLE_ENTITY";
267
198
  /**
268
- * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.4
269
- *
270
- * The resource that is being accessed is locked.
199
+ * The requested resource is locked against access.
271
200
  */
272
201
  HttpStatusCodes[HttpStatusCodes["LOCKED"] = 423] = "LOCKED";
273
202
  /**
274
- * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.5
275
- *
276
- * The request failed due to failure of a previous request.
203
+ * The request failed due to the failure of a previous request.
277
204
  */
278
205
  HttpStatusCodes[HttpStatusCodes["FAILED_DEPENDENCY"] = 424] = "FAILED_DEPENDENCY";
279
206
  /**
280
- * Official Documentation @ https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.15
281
- *
282
- * The server refuses to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol.
207
+ * The client should switch to a different protocol.
283
208
  */
284
209
  HttpStatusCodes[HttpStatusCodes["UPGRADE_REQUIRED"] = 426] = "UPGRADE_REQUIRED";
285
210
  /**
286
- * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-3
287
- *
288
- * The origin server requires the request to be conditional. Intended to prevent the 'lost update' problem, where a client GETs a resource's state, modifies it, and PUTs it back to the server, when meanwhile a third party has modified the state on the server, leading to a conflict.
211
+ * The server requires conditional requests to prevent lost updates.
289
212
  */
290
213
  HttpStatusCodes[HttpStatusCodes["PRECONDITION_REQUIRED"] = 428] = "PRECONDITION_REQUIRED";
291
214
  /**
292
- * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-4
293
- *
294
- * The user has sent too many requests in a given amount of time ("rate limiting").
215
+ * The client has sent too many requests in a given time period (rate limiting).
295
216
  */
296
217
  HttpStatusCodes[HttpStatusCodes["TOO_MANY_REQUESTS"] = 429] = "TOO_MANY_REQUESTS";
297
218
  /**
298
- * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-5
299
- *
300
- * The server is unwilling to process the request because its header fields are too large. The request MAY be resubmitted after reducing the size of the request header fields.
219
+ * Request headers are too large for the server to process.
301
220
  */
302
221
  HttpStatusCodes[HttpStatusCodes["REQUEST_HEADER_FIELDS_TOO_LARGE"] = 431] = "REQUEST_HEADER_FIELDS_TOO_LARGE";
303
222
  /**
304
- * Official Documentation @ https://tools.ietf.org/html/rfc7725
305
- *
306
- * The user-agent requested a resource that cannot legally be provided, such as a web page censored by a government.
223
+ * Resource cannot be legally provided (e.g., censored by government).
307
224
  */
308
225
  HttpStatusCodes[HttpStatusCodes["UNAVAILABLE_FOR_LEGAL_REASONS"] = 451] = "UNAVAILABLE_FOR_LEGAL_REASONS";
226
+ // 5xx Server Error
309
227
  /**
310
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.1
311
- *
312
- * The server encountered an unexpected condition that prevented it from fulfilling the request.
228
+ * The server encountered an unexpected error preventing it from fulfilling the request.
313
229
  */
314
230
  HttpStatusCodes[HttpStatusCodes["INTERNAL_SERVER_ERROR"] = 500] = "INTERNAL_SERVER_ERROR";
315
231
  /**
316
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.2
317
- *
318
- * The request method is not supported by the server and cannot be handled. The only methods that servers are required to support (and therefore that must not return this code) are GET and HEAD.
232
+ * The server does not support the functionality required to fulfill the request.
319
233
  */
320
234
  HttpStatusCodes[HttpStatusCodes["NOT_IMPLEMENTED"] = 501] = "NOT_IMPLEMENTED";
321
235
  /**
322
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.3
323
- *
324
- * This error response means that the server, while working as a gateway to get a response needed to handle the request, got an invalid response.
236
+ * The server, acting as a gateway, received an invalid response from an upstream server.
325
237
  */
326
238
  HttpStatusCodes[HttpStatusCodes["BAD_GATEWAY"] = 502] = "BAD_GATEWAY";
327
239
  /**
328
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.4
329
- *
330
- * The server is not ready to handle the request. Common causes are a server that is down for maintenance or that is overloaded. Note that together with this response, a user-friendly page explaining the problem should be sent. This responses should be used for temporary conditions and the Retry-After: HTTP header should, if possible, contain the estimated time before the recovery of the service. The webmaster must also take care about the caching-related headers that are sent along with this response, as these temporary condition responses should usually not be cached.
240
+ * The server is currently unable to handle the request due to temporary overload or maintenance.
331
241
  */
332
242
  HttpStatusCodes[HttpStatusCodes["SERVICE_UNAVAILABLE"] = 503] = "SERVICE_UNAVAILABLE";
333
243
  /**
334
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.5
335
- *
336
- * This error response is given when the server is acting as a gateway and cannot get a response in time.
244
+ * The server, acting as a gateway, did not receive a timely response from an upstream server.
337
245
  */
338
246
  HttpStatusCodes[HttpStatusCodes["GATEWAY_TIMEOUT"] = 504] = "GATEWAY_TIMEOUT";
339
247
  /**
340
- * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.6
341
- *
342
- * The HTTP version used in the request is not supported by the server.
248
+ * The server does not support the HTTP protocol version used in the request.
343
249
  */
344
250
  HttpStatusCodes[HttpStatusCodes["HTTP_VERSION_NOT_SUPPORTED"] = 505] = "HTTP_VERSION_NOT_SUPPORTED";
345
251
  /**
346
- * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.6
347
- *
348
- * The server has an internal configuration error: the chosen variant resource is configured to engage in transparent content negotiation itself, and is therefore not a proper end point in the negotiation process.
252
+ * Transparent content negotiation for the request resulted in circular reference.
253
+ */
254
+ HttpStatusCodes[HttpStatusCodes["VARIANT_ALSO_NEGOTIATES"] = 506] = "VARIANT_ALSO_NEGOTIATES";
255
+ /**
256
+ * The server cannot store the representation needed to complete the request.
349
257
  */
350
258
  HttpStatusCodes[HttpStatusCodes["INSUFFICIENT_STORAGE"] = 507] = "INSUFFICIENT_STORAGE";
351
259
  /**
352
- * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-6
353
- *
354
- * The 511 status code indicates that the client needs to authenticate to gain network access.
260
+ * The server detected an infinite loop while processing the request.
261
+ */
262
+ HttpStatusCodes[HttpStatusCodes["LOOP_DETECTED"] = 508] = "LOOP_DETECTED";
263
+ /**
264
+ * Further extensions to the request are required for the server to fulfill it.
265
+ */
266
+ HttpStatusCodes[HttpStatusCodes["NOT_EXTENDED"] = 510] = "NOT_EXTENDED";
267
+ /**
268
+ * The client needs to authenticate to gain network access.
355
269
  */
356
270
  HttpStatusCodes[HttpStatusCodes["NETWORK_AUTHENTICATION_REQUIRED"] = 511] = "NETWORK_AUTHENTICATION_REQUIRED";
357
271
  })(HttpStatusCodes || (HttpStatusCodes = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"http-status-codes.js","sourceRoot":"","sources":["../../../src/utils/http-status-codes.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,eAmWX;AAnWD,WAAY,eAAe;IACzB;;;;OAIG;IACH,+DAAc,CAAA;IACd;;;;OAIG;IACH,qFAAyB,CAAA;IACzB;;;;OAIG;IACH,mEAAgB,CAAA;IAChB;;;;OAIG;IACH,qEAAiB,CAAA;IACjB;;;;;;;;OAQG;IACH,mDAAQ,CAAA;IACR;;;;OAIG;IACH,6DAAa,CAAA;IACb;;;;OAIG;IACH,+DAAc,CAAA;IACd;;;;OAIG;IACH,yGAAmC,CAAA;IACnC;;;;OAIG;IACH,mEAAgB,CAAA;IAChB;;;;OAIG;IACH,yEAAmB,CAAA;IACnB;;;;OAIG;IACH,6EAAqB,CAAA;IACrB;;;;OAIG;IACH,uEAAkB,CAAA;IAClB;;;;OAIG;IACH,+EAAsB,CAAA;IACtB;;;;OAIG;IACH,iFAAuB,CAAA;IACvB;;;;OAIG;IACH,iFAAuB,CAAA;IACvB;;;;OAIG;IACH,iEAAe,CAAA;IACf;;;;OAIG;IACH,uEAAkB,CAAA;IAClB;;;;;OAKG;IACH,iEAAe,CAAA;IACf;;;;OAIG;IACH,mFAAwB,CAAA;IACxB;;;;OAIG;IACH,mFAAwB,CAAA;IACxB;;;;OAIG;IACH,qEAAiB,CAAA;IACjB;;;;OAIG;IACH,uEAAkB,CAAA;IAClB;;;;OAIG;IACH,+EAAsB,CAAA;IACtB;;;;OAIG;IACH,iEAAe,CAAA;IACf;;;;OAIG;IACH,iEAAe,CAAA;IACf;;;;OAIG;IACH,mFAAwB,CAAA;IACxB;;;;OAIG;IACH,2EAAoB,CAAA;IACpB;;;;OAIG;IACH,yGAAmC,CAAA;IACnC;;;;OAIG;IACH,6EAAqB,CAAA;IACrB;;;;OAIG;IACH,+DAAc,CAAA;IACd;;;;OAIG;IACH,uDAAU,CAAA;IACV;;;;OAIG;IACH,6EAAqB,CAAA;IACrB;;;;OAIG;IACH,qFAAyB,CAAA;IACzB;;;;OAIG;IACH,+EAAsB,CAAA;IACtB;;;;OAIG;IACH,uFAA0B,CAAA;IAC1B;;;;OAIG;IACH,2FAA4B,CAAA;IAC5B;;;;OAIG;IACH,6GAAqC,CAAA;IACrC;;;;OAIG;IACH,mFAAwB,CAAA;IACxB;;;;OAIG;IACH,qEAAiB,CAAA;IACjB;;;;OAIG;IACH,2GAAoC,CAAA;IACpC;;;;;OAKG;IACH,2EAAoB,CAAA;IACpB;;;;OAIG;IACH,qFAAyB,CAAA;IACzB;;;;OAIG;IACH,uFAA0B,CAAA;IAC1B;;;;OAIG;IACH,2DAAY,CAAA;IACZ;;;;OAIG;IACH,iFAAuB,CAAA;IACvB;;;;OAIG;IACH,+EAAsB,CAAA;IACtB;;;;OAIG;IACH,yFAA2B,CAAA;IAC3B;;;;OAIG;IACH,iFAAuB,CAAA;IACvB;;;;OAIG;IACH,6GAAqC,CAAA;IACrC;;;;OAIG;IACH,yGAAmC,CAAA;IACnC;;;;OAIG;IACH,yFAA2B,CAAA;IAC3B;;;;OAIG;IACH,6EAAqB,CAAA;IACrB;;;;OAIG;IACH,qEAAiB,CAAA;IACjB;;;;OAIG;IACH,qFAAyB,CAAA;IACzB;;;;OAIG;IACH,6EAAqB,CAAA;IACrB;;;;OAIG;IACH,mGAAgC,CAAA;IAChC;;;;OAIG;IACH,uFAA0B,CAAA;IAC1B;;;;OAIG;IACH,6GAAqC,CAAA;AACvC,CAAC,EAnWW,eAAe,KAAf,eAAe,QAmW1B","sourcesContent":["export enum HttpStatusCodes {\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.2.1\n *\n * This interim response indicates that everything so far is OK and that the client should continue with the request or ignore it if it is already finished.\n */\n CONTINUE = 100,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.2.2\n *\n * This code is sent in response to an Upgrade request header by the client, and indicates the protocol the server is switching too.\n */\n SWITCHING_PROTOCOLS = 101,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.1\n *\n * This code indicates that the server has received and is processing the request, but no response is available yet.\n */\n PROCESSING = 102,\n /**\n * Official Documentation @ https://www.rfc-editor.org/rfc/rfc8297#page-3\n *\n * This code indicates to the client that the server is likely to send a final response with the header fields included in the informational response.\n */\n EARLY_HINTS = 103,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.1\n *\n * The request has succeeded. The meaning of a success varies depending on the HTTP method:\n * GET: The resource has been fetched and is transmitted in the message body.\n * HEAD: The entity headers are in the message body.\n * POST: The resource describing the result of the action is transmitted in the message body.\n * TRACE: The message body contains the request message as received by the server\n */\n OK = 200,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.2\n *\n * The request has succeeded and a new resource has been created as a result of it. This is typically the response sent after a PUT request.\n */\n CREATED = 201,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.3\n *\n * The request has been received but not yet acted upon. It is non-committal, meaning that there is no way in HTTP to later send an asynchronous response indicating the outcome of processing the request. It is intended for cases where another process or server handles the request, or for batch processing.\n */\n ACCEPTED = 202,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.4\n *\n * This response code means returned meta-information set is not exact set as available from the origin server, but collected from a local or a third party copy. Except this condition, 200 OK response should be preferred instead of this response.\n */\n NON_AUTHORITATIVE_INFORMATION = 203,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.5\n *\n * There is no content to send for this request, but the headers may be useful. The user-agent may update its cached headers for this resource with the new ones.\n */\n NO_CONTENT = 204,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.6\n *\n * This response code is sent after accomplishing request to tell user agent reset document view which sent this request.\n */\n RESET_CONTENT = 205,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7233#section-4.1\n *\n * This response code is used because of range header sent by the client to separate download into multiple streams.\n */\n PARTIAL_CONTENT = 206,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.2\n *\n * A Multi-Status response conveys information about multiple resources in situations where multiple status codes might be appropriate.\n */\n MULTI_STATUS = 207,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.1\n *\n * The request has more than one possible responses. User-agent or user should choose one of them. There is no standardized way to choose one of the responses.\n */\n MULTIPLE_CHOICES = 300,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.2\n *\n * This response code means that URI of requested resource has been changed. Probably, new URI would be given in the response.\n */\n MOVED_PERMANENTLY = 301,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.3\n *\n * This response code means that URI of requested resource has been changed temporarily. New changes in the URI might be made in the future. Therefore, this same URI should be used by the client in future requests.\n */\n MOVED_TEMPORARILY = 302,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.4\n *\n * Server sent this response to directing client to get requested resource to another URI with an GET request.\n */\n SEE_OTHER = 303,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7232#section-4.1\n *\n * This is used for caching purposes. It is telling to client that response has not been modified. So, client can continue to use same cached version of response.\n */\n NOT_MODIFIED = 304,\n /**\n * @deprecated\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.6\n *\n * Was defined in a previous version of the HTTP specification to indicate that a requested response must be accessed by a proxy. It has been deprecated due to security concerns regarding in-band configuration of a proxy.\n */\n USE_PROXY = 305,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.7\n *\n * Server sent this response to directing client to get requested resource to another URI with same method that used prior request. This has the same semantic than the 302 Found HTTP response code, with the exception that the user agent must not change the HTTP method used: if a POST was used in the first request, a POST must be used in the second request.\n */\n TEMPORARY_REDIRECT = 307,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7538#section-3\n *\n * This means that the resource is now permanently located at another URI, specified by the Location: HTTP Response header. This has the same semantics as the 301 Moved Permanently HTTP response code, with the exception that the user agent must not change the HTTP method used: if a POST was used in the first request, a POST must be used in the second request.\n */\n PERMANENT_REDIRECT = 308,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.1\n *\n * This response means that server could not understand the request due to invalid syntax.\n */\n BAD_REQUEST = 400,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7235#section-3.1\n *\n * Although the HTTP standard specifies \"unauthorized\", semantically this response means \"unauthenticated\". That is, the client must authenticate itself to get the requested response.\n */\n UNAUTHORIZED = 401,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.2\n *\n * This response code is reserved for future use. Initial aim for creating this code was using it for digital payment systems however this is not used currently.\n */\n PAYMENT_REQUIRED = 402,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.3\n *\n * The client does not have access rights to the content, i.e. they are unauthorized, so server is rejecting to give proper response. Unlike 401, the client's identity is known to the server.\n */\n FORBIDDEN = 403,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.4\n *\n * The server can not find requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 to hide the existence of a resource from an unauthorized client. This response code is probably the most famous one due to its frequent occurence on the web.\n */\n NOT_FOUND = 404,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.5\n *\n * The request method is known by the server but has been disabled and cannot be used. For example, an API may forbid DELETE-ing a resource. The two mandatory methods, GET and HEAD, must never be disabled and should not return this error code.\n */\n METHOD_NOT_ALLOWED = 405,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.6\n *\n * This response is sent when the web server, after performing server-driven content negotiation, doesn't find any content following the criteria given by the user agent.\n */\n NOT_ACCEPTABLE = 406,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7235#section-3.2\n *\n * This is similar to 401 but authentication is needed to be done by a proxy.\n */\n PROXY_AUTHENTICATION_REQUIRED = 407,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.7\n *\n * This response is sent on an idle connection by some servers, even without any previous request by the client. It means that the server would like to shut down this unused connection. This response is used much more since some browsers, like Chrome, Firefox 27+, or IE9, use HTTP pre-connection mechanisms to speed up surfing. Also note that some servers merely shut down the connection without sending this message.\n */\n REQUEST_TIMEOUT = 408,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.8\n *\n * This response is sent when a request conflicts with the current state of the server.\n */\n CONFLICT = 409,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.9\n *\n * This response would be sent when the requested content has been permenantly deleted from server, with no forwarding address. Clients are expected to remove their caches and links to the resource. The HTTP specification intends this status code to be used for \"limited-time, promotional services\". APIs should not feel compelled to indicate resources that have been deleted with this status code.\n */\n GONE = 410,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.10\n *\n * The server rejected the request because the Content-Length header field is not defined and the server requires it.\n */\n LENGTH_REQUIRED = 411,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7232#section-4.2\n *\n * The client has indicated preconditions in its headers which the server does not meet.\n */\n PRECONDITION_FAILED = 412,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.11\n *\n * Request entity is larger than limits defined by server; the server might close the connection or return an Retry-After header field.\n */\n REQUEST_TOO_LONG = 413,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.12\n *\n * The URI requested by the client is longer than the server is willing to interpret.\n */\n REQUEST_URI_TOO_LONG = 414,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.13\n *\n * The media format of the requested data is not supported by the server, so the server is rejecting the request.\n */\n UNSUPPORTED_MEDIA_TYPE = 415,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7233#section-4.4\n *\n * The range specified by the Range header field in the request can't be fulfilled; it's possible that the range is outside the size of the target URI's data.\n */\n REQUESTED_RANGE_NOT_SATISFIABLE = 416,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.14\n *\n * This response code means the expectation indicated by the Expect request header field can't be met by the server.\n */\n EXPECTATION_FAILED = 417,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2324#section-2.3.2\n *\n * Any attempt to brew coffee with a teapot should result in the error code \"418 I'm a teapot\". The resulting entity body MAY be short and stout.\n */\n IM_A_TEAPOT = 418,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.6\n *\n * The 507 (Insufficient Storage) status code means the method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request. This condition is considered to be temporary. If the request which received this status code was the result of a user action, the request MUST NOT be repeated until it is requested by a separate user action.\n */\n INSUFFICIENT_SPACE_ON_RESOURCE = 419,\n /**\n * @deprecated\n * Official Documentation @ https://tools.ietf.org/rfcdiff?difftype=--hwdiff&url2=draft-ietf-webdav-protocol-06.txt\n *\n * A deprecated response used by the Spring Framework when a method has failed.\n */\n METHOD_FAILURE = 420,\n /**\n * Official Documentation @ https://datatracker.ietf.org/doc/html/rfc7540#section-9.1.2\n *\n * Defined in the specification of HTTP/2 to indicate that a server is not able to produce a response for the combination of scheme and authority that are included in the request URI.\n */\n MISDIRECTED_REQUEST = 421,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.3\n *\n * The request was well-formed but was unable to be followed due to semantic errors.\n */\n UNPROCESSABLE_ENTITY = 422,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.4\n *\n * The resource that is being accessed is locked.\n */\n LOCKED = 423,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.5\n *\n * The request failed due to failure of a previous request.\n */\n FAILED_DEPENDENCY = 424,\n /**\n * Official Documentation @ https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.15\n *\n * The server refuses to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol.\n */\n UPGRADE_REQUIRED = 426,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-3\n *\n * The origin server requires the request to be conditional. Intended to prevent the 'lost update' problem, where a client GETs a resource's state, modifies it, and PUTs it back to the server, when meanwhile a third party has modified the state on the server, leading to a conflict.\n */\n PRECONDITION_REQUIRED = 428,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-4\n *\n * The user has sent too many requests in a given amount of time (\"rate limiting\").\n */\n TOO_MANY_REQUESTS = 429,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-5\n *\n * The server is unwilling to process the request because its header fields are too large. The request MAY be resubmitted after reducing the size of the request header fields.\n */\n REQUEST_HEADER_FIELDS_TOO_LARGE = 431,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7725\n *\n * The user-agent requested a resource that cannot legally be provided, such as a web page censored by a government.\n */\n UNAVAILABLE_FOR_LEGAL_REASONS = 451,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.1\n *\n * The server encountered an unexpected condition that prevented it from fulfilling the request.\n */\n INTERNAL_SERVER_ERROR = 500,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.2\n *\n * The request method is not supported by the server and cannot be handled. The only methods that servers are required to support (and therefore that must not return this code) are GET and HEAD.\n */\n NOT_IMPLEMENTED = 501,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.3\n *\n * This error response means that the server, while working as a gateway to get a response needed to handle the request, got an invalid response.\n */\n BAD_GATEWAY = 502,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.4\n *\n * The server is not ready to handle the request. Common causes are a server that is down for maintenance or that is overloaded. Note that together with this response, a user-friendly page explaining the problem should be sent. This responses should be used for temporary conditions and the Retry-After: HTTP header should, if possible, contain the estimated time before the recovery of the service. The webmaster must also take care about the caching-related headers that are sent along with this response, as these temporary condition responses should usually not be cached.\n */\n SERVICE_UNAVAILABLE = 503,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.5\n *\n * This error response is given when the server is acting as a gateway and cannot get a response in time.\n */\n GATEWAY_TIMEOUT = 504,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.6\n *\n * The HTTP version used in the request is not supported by the server.\n */\n HTTP_VERSION_NOT_SUPPORTED = 505,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.6\n *\n * The server has an internal configuration error: the chosen variant resource is configured to engage in transparent content negotiation itself, and is therefore not a proper end point in the negotiation process.\n */\n INSUFFICIENT_STORAGE = 507,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-6\n *\n * The 511 status code indicates that the client needs to authenticate to gain network access.\n */\n NETWORK_AUTHENTICATION_REQUIRED = 511,\n}\n"]}
1
+ {"version":3,"file":"http-status-codes.js","sourceRoot":"","sources":["../../../src/utils/http-status-codes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAN,IAAY,eAwUX;AAxUD,WAAY,eAAe;IACzB,oBAAoB;IACpB;;OAEG;IACH,+DAAc,CAAA;IAEd;;OAEG;IACH,qFAAyB,CAAA;IAEzB;;OAEG;IACH,mEAAgB,CAAA;IAEhB;;OAEG;IACH,qEAAiB,CAAA;IAEjB,cAAc;IACd;;OAEG;IACH,mDAAQ,CAAA;IAER;;OAEG;IACH,6DAAa,CAAA;IAEb;;OAEG;IACH,+DAAc,CAAA;IAEd;;OAEG;IACH,yGAAmC,CAAA;IAEnC;;OAEG;IACH,mEAAgB,CAAA;IAEhB;;OAEG;IACH,yEAAmB,CAAA;IAEnB;;OAEG;IACH,6EAAqB,CAAA;IAErB;;OAEG;IACH,uEAAkB,CAAA;IAElB;;OAEG;IACH,+EAAsB,CAAA;IAEtB;;OAEG;IACH,6DAAa,CAAA;IAEb,kBAAkB;IAClB;;OAEG;IACH,+EAAsB,CAAA;IAEtB;;OAEG;IACH,iFAAuB,CAAA;IAEvB;;OAEG;IACH,iFAAuB,CAAA;IAEvB;;OAEG;IACH,iEAAe,CAAA;IAEf;;OAEG;IACH,uEAAkB,CAAA;IAElB;;;OAGG;IACH,iEAAe,CAAA;IAEf;;OAEG;IACH,mFAAwB,CAAA;IAExB;;OAEG;IACH,mFAAwB,CAAA;IAExB,mBAAmB;IACnB;;OAEG;IACH,qEAAiB,CAAA;IAEjB;;OAEG;IACH,uEAAkB,CAAA;IAElB;;OAEG;IACH,+EAAsB,CAAA;IAEtB;;OAEG;IACH,iEAAe,CAAA;IAEf;;OAEG;IACH,iEAAe,CAAA;IAEf;;OAEG;IACH,mFAAwB,CAAA;IAExB;;OAEG;IACH,2EAAoB,CAAA;IAEpB;;OAEG;IACH,yGAAmC,CAAA;IAEnC;;OAEG;IACH,6EAAqB,CAAA;IAErB;;OAEG;IACH,+DAAc,CAAA;IAEd;;OAEG;IACH,uDAAU,CAAA;IAEV;;OAEG;IACH,6EAAqB,CAAA;IAErB;;OAEG;IACH,qFAAyB,CAAA;IAEzB;;OAEG;IACH,+EAAsB,CAAA;IAEtB;;;OAGG;IACH,iFAAuB,CAAA;IAEvB;;OAEG;IACH,uFAA0B,CAAA;IAE1B;;OAEG;IACH,2FAA4B,CAAA;IAE5B;;OAEG;IACH,6GAAqC,CAAA;IAErC;;OAEG;IACH,mFAAwB,CAAA;IAExB;;OAEG;IACH,qEAAiB,CAAA;IAEjB;;OAEG;IACH,2GAAoC,CAAA;IAEpC;;;OAGG;IACH,2EAAoB,CAAA;IAEpB;;OAEG;IACH,qFAAyB,CAAA;IAEzB;;OAEG;IACH,uFAA0B,CAAA;IAE1B;;OAEG;IACH,2DAAY,CAAA;IAEZ;;OAEG;IACH,iFAAuB,CAAA;IAEvB;;OAEG;IACH,+EAAsB,CAAA;IAEtB;;OAEG;IACH,yFAA2B,CAAA;IAE3B;;OAEG;IACH,iFAAuB,CAAA;IAEvB;;OAEG;IACH,6GAAqC,CAAA;IAErC;;OAEG;IACH,yGAAmC,CAAA;IAEnC,mBAAmB;IACnB;;OAEG;IACH,yFAA2B,CAAA;IAE3B;;OAEG;IACH,6EAAqB,CAAA;IAErB;;OAEG;IACH,qEAAiB,CAAA;IAEjB;;OAEG;IACH,qFAAyB,CAAA;IAEzB;;OAEG;IACH,6EAAqB,CAAA;IAErB;;OAEG;IACH,mGAAgC,CAAA;IAEhC;;OAEG;IACH,6FAA6B,CAAA;IAE7B;;OAEG;IACH,uFAA0B,CAAA;IAE1B;;OAEG;IACH,yEAAmB,CAAA;IAEnB;;OAEG;IACH,uEAAkB,CAAA;IAElB;;OAEG;IACH,6GAAqC,CAAA;AACvC,CAAC,EAxUW,eAAe,KAAf,eAAe,QAwU1B","sourcesContent":["/**\n * Complete HTTP status codes enum with descriptions.\n * For use with API responses and error handling.\n */\nexport enum HttpStatusCodes {\n // 1xx Informational\n /**\n * The server has received the request headers and the client should proceed to send the request body.\n */\n CONTINUE = 100,\n\n /**\n * The server is switching protocols according to the client's request.\n */\n SWITCHING_PROTOCOLS = 101,\n\n /**\n * Server has received the request and is still processing it.\n */\n PROCESSING = 102,\n\n /**\n * The server is sending preliminary headers while preparing the final response.\n */\n EARLY_HINTS = 103,\n\n // 2xx Success\n /**\n * The request succeeded. The result meaning depends on the HTTP method used.\n */\n OK = 200,\n\n /**\n * The request succeeded and a new resource was created as a result.\n */\n CREATED = 201,\n\n /**\n * The request has been received but not yet acted upon.\n */\n ACCEPTED = 202,\n\n /**\n * The returned information is from a third-party source, not the origin server.\n */\n NON_AUTHORITATIVE_INFORMATION = 203,\n\n /**\n * The request succeeded but there's no content to send in the response.\n */\n NO_CONTENT = 204,\n\n /**\n * The client should reset the document view that caused this request.\n */\n RESET_CONTENT = 205,\n\n /**\n * The server is delivering only part of the resource due to a range header sent by the client.\n */\n PARTIAL_CONTENT = 206,\n\n /**\n * Conveys information about multiple resources, for complex operations.\n */\n MULTI_STATUS = 207,\n\n /**\n * The members of a DAV binding have already been enumerated and are not included in the response.\n */\n ALREADY_REPORTED = 208,\n\n /**\n * The server has fulfilled a request for the resource, and the response represents the result of one or more instance-manipulations.\n */\n IM_USED = 226,\n\n // 3xx Redirection\n /**\n * The request has more than one possible response and the client should choose one.\n */\n MULTIPLE_CHOICES = 300,\n\n /**\n * The resource has been permanently moved to a new URL.\n */\n MOVED_PERMANENTLY = 301,\n\n /**\n * The resource has been temporarily moved to another URL.\n */\n MOVED_TEMPORARILY = 302,\n\n /**\n * The response to the request can be found under another URI using the GET method.\n */\n SEE_OTHER = 303,\n\n /**\n * The resource hasn't been modified since the last request.\n */\n NOT_MODIFIED = 304,\n\n /**\n * @deprecated\n * Response must be accessed through a proxy.\n */\n USE_PROXY = 305,\n\n /**\n * The resource is temporarily available at a different URI, using the same HTTP method.\n */\n TEMPORARY_REDIRECT = 307,\n\n /**\n * The resource has been permanently moved to another URL, using the same HTTP method.\n */\n PERMANENT_REDIRECT = 308,\n\n // 4xx Client Error\n /**\n * The server cannot process the request due to a client error (malformed request).\n */\n BAD_REQUEST = 400,\n\n /**\n * Authentication is required and has failed or not been provided.\n */\n UNAUTHORIZED = 401,\n\n /**\n * Reserved for future use, originally intended for digital payment systems.\n */\n PAYMENT_REQUIRED = 402,\n\n /**\n * The client doesn't have permission to access the requested resource.\n */\n FORBIDDEN = 403,\n\n /**\n * The requested resource could not be found on the server.\n */\n NOT_FOUND = 404,\n\n /**\n * The request method is not supported for the requested resource.\n */\n METHOD_NOT_ALLOWED = 405,\n\n /**\n * The server can't provide a response matching the list of acceptable values in the client's headers.\n */\n NOT_ACCEPTABLE = 406,\n\n /**\n * Authentication by a proxy is required.\n */\n PROXY_AUTHENTICATION_REQUIRED = 407,\n\n /**\n * The server timed out waiting for the request.\n */\n REQUEST_TIMEOUT = 408,\n\n /**\n * The request conflicts with the current state of the server.\n */\n CONFLICT = 409,\n\n /**\n * The resource has been permanently deleted with no forwarding address.\n */\n GONE = 410,\n\n /**\n * The server requires a Content-Length header field.\n */\n LENGTH_REQUIRED = 411,\n\n /**\n * Preconditions in the client's headers failed.\n */\n PRECONDITION_FAILED = 412,\n\n /**\n * Request entity is larger than limits defined by server.\n */\n REQUEST_TOO_LONG = 413,\n\n /**\n * The request payload exceeds server size limits.\n * Modern equivalent of REQUEST_TOO_LONG.\n */\n PAYLOAD_TOO_LARGE = 413,\n\n /**\n * The URI requested is too long for the server to interpret.\n */\n REQUEST_URI_TOO_LONG = 414,\n\n /**\n * The server does not support the media type requested by the client.\n */\n UNSUPPORTED_MEDIA_TYPE = 415,\n\n /**\n * The range specified by the Range header cannot be fulfilled.\n */\n REQUESTED_RANGE_NOT_SATISFIABLE = 416,\n\n /**\n * The server cannot meet the expectations given in the Expect header.\n */\n EXPECTATION_FAILED = 417,\n\n /**\n * The server refuses to brew coffee because it is a teapot. (April Fools' joke)\n */\n IM_A_TEAPOT = 418,\n\n /**\n * The server cannot store the representation needed to complete the request.\n */\n INSUFFICIENT_SPACE_ON_RESOURCE = 419,\n\n /**\n * @deprecated\n * A method has failed - specific to Spring Framework.\n */\n METHOD_FAILURE = 420,\n\n /**\n * The server cannot produce a response for the requested URI scheme and authority.\n */\n MISDIRECTED_REQUEST = 421,\n\n /**\n * The request was well-formed but has semantic errors preventing processing.\n */\n UNPROCESSABLE_ENTITY = 422,\n\n /**\n * The requested resource is locked against access.\n */\n LOCKED = 423,\n\n /**\n * The request failed due to the failure of a previous request.\n */\n FAILED_DEPENDENCY = 424,\n\n /**\n * The client should switch to a different protocol.\n */\n UPGRADE_REQUIRED = 426,\n\n /**\n * The server requires conditional requests to prevent lost updates.\n */\n PRECONDITION_REQUIRED = 428,\n\n /**\n * The client has sent too many requests in a given time period (rate limiting).\n */\n TOO_MANY_REQUESTS = 429,\n\n /**\n * Request headers are too large for the server to process.\n */\n REQUEST_HEADER_FIELDS_TOO_LARGE = 431,\n\n /**\n * Resource cannot be legally provided (e.g., censored by government).\n */\n UNAVAILABLE_FOR_LEGAL_REASONS = 451,\n\n // 5xx Server Error\n /**\n * The server encountered an unexpected error preventing it from fulfilling the request.\n */\n INTERNAL_SERVER_ERROR = 500,\n\n /**\n * The server does not support the functionality required to fulfill the request.\n */\n NOT_IMPLEMENTED = 501,\n\n /**\n * The server, acting as a gateway, received an invalid response from an upstream server.\n */\n BAD_GATEWAY = 502,\n\n /**\n * The server is currently unable to handle the request due to temporary overload or maintenance.\n */\n SERVICE_UNAVAILABLE = 503,\n\n /**\n * The server, acting as a gateway, did not receive a timely response from an upstream server.\n */\n GATEWAY_TIMEOUT = 504,\n\n /**\n * The server does not support the HTTP protocol version used in the request.\n */\n HTTP_VERSION_NOT_SUPPORTED = 505,\n\n /**\n * Transparent content negotiation for the request resulted in circular reference.\n */\n VARIANT_ALSO_NEGOTIATES = 506,\n\n /**\n * The server cannot store the representation needed to complete the request.\n */\n INSUFFICIENT_STORAGE = 507,\n\n /**\n * The server detected an infinite loop while processing the request.\n */\n LOOP_DETECTED = 508,\n\n /**\n * Further extensions to the request are required for the server to fulfill it.\n */\n NOT_EXTENDED = 510,\n\n /**\n * The client needs to authenticate to gain network access.\n */\n NETWORK_AUTHENTICATION_REQUIRED = 511\n}\n"]}
@@ -5,18 +5,12 @@
5
5
  */
6
6
  export declare function uuid(): string;
7
7
  /**
8
- * Generates a ULID (Universally Unique Lexicographically Sortable Identifier).
8
+ * Generates a nanoid-style random ID (URL-safe, customizable length).
9
9
  *
10
- * @returns {string} ULID string (26 chars, Crockford Base32, e.g., '01H7ZXS9FJKPX06P1AYZKCGHQF').
10
+ * @param {number} length - Length of the ID (default: 21).
11
+ * @returns {string} Nanoid-style random string.
11
12
  */
12
- export declare function ulidString(): string;
13
- /**
14
- * Generates a nanoid string (URL-friendly, collision-resistant, customizable size).
15
- *
16
- * @param {number} [size=21] - Number of characters for the ID (default: 21).
17
- * @returns {string} nanoid string.
18
- */
19
- export declare function nanoId(size?: number): string;
13
+ export declare function nanoId(length?: number): string;
20
14
  /**
21
15
  * Generates a cryptographically strong random hex string.
22
16
  *
@@ -32,4 +26,11 @@ export declare function randomHex(byteLength?: number): string;
32
26
  * @returns {number} Random integer in range.
33
27
  */
34
28
  export declare function randomInt(min: number, max: number): number;
29
+ /**
30
+ * Generates a cryptographically strong random base64 string.
31
+ *
32
+ * @param {number} byteLength - Number of random bytes (default: 16).
33
+ * @returns {string} Random base64 string (URL-safe, no padding).
34
+ */
35
+ export declare function randomBase64(byteLength?: number): string;
35
36
  //# sourceMappingURL=id.utils.d.ts.map