@alwatr/http-primer 1.0.0
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.
- package/CHANGELOG.md +19 -0
- package/LICENSE +661 -0
- package/README.md +65 -0
- package/dist/constant.d.ts +458 -0
- package/dist/constant.d.ts.map +1 -0
- package/dist/main.cjs +485 -0
- package/dist/main.cjs.LEGAL.txt +0 -0
- package/dist/main.cjs.map +7 -0
- package/dist/main.d.ts +3 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.mjs +458 -0
- package/dist/main.mjs.LEGAL.txt +0 -0
- package/dist/main.mjs.map +7 -0
- package/dist/type.d.ts +753 -0
- package/dist/type.d.ts.map +1 -0
- package/package.json +83 -0
package/README.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# HTTP Primer
|
|
2
|
+
|
|
3
|
+
Essential HTTP utilities for TypeScript, including types for HTTP methods, status codes, and headers.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @alwatr/http-primer
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### HTTP Methods
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import {HttpMethods} from '@alwatr/http-primer';
|
|
17
|
+
|
|
18
|
+
const method = HttpMethods.GET;
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### HTTP Status Codes
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import {HttpStatusCodes} from '@alwatr/http-primer';
|
|
25
|
+
|
|
26
|
+
const statusCode = HttpStatusCodes.Success_200_OK;
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### HTTP Headers
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
import {HttpRequestHeaders, HttpResponseHeaders} from '@alwatr/http-primer';
|
|
33
|
+
|
|
34
|
+
const requestHeaders: HttpRequestHeaders = {
|
|
35
|
+
accept: 'application/json',
|
|
36
|
+
authorization: 'Bearer my-token',
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const responseHeaders: HttpResponseHeaders = {
|
|
40
|
+
'content-type': 'application/json',
|
|
41
|
+
'content-length': 1234,
|
|
42
|
+
};
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### MIME Types
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
import {MimeTypes} from '@alwatr/http-essentials';
|
|
49
|
+
|
|
50
|
+
const contentType = MimeTypes.JSON; // 'application/json'
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Sponsors
|
|
54
|
+
|
|
55
|
+
The following companies, organizations, and individuals support Nanolib ongoing maintenance and development. Become a Sponsor to get your logo on our README and website.
|
|
56
|
+
|
|
57
|
+
[](https://exirstudio.com)
|
|
58
|
+
|
|
59
|
+
### Contributing
|
|
60
|
+
|
|
61
|
+
Contributions are welcome! Please read our [contribution guidelines](https://github.com/Alwatr/.github/blob/next/CONTRIBUTING.md) before submitting a pull request.
|
|
62
|
+
|
|
63
|
+
### License
|
|
64
|
+
|
|
65
|
+
This project is licensed under the [AGPL-3.0 License](LICENSE).
|
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Object representing standard HTTP methods.
|
|
3
|
+
*/
|
|
4
|
+
export declare const HttpMethods: {
|
|
5
|
+
/**
|
|
6
|
+
* GET: Requests a representation of the specified resource.
|
|
7
|
+
*/
|
|
8
|
+
readonly GET: "GET";
|
|
9
|
+
/**
|
|
10
|
+
* HEAD: Asks for a response identical to that of a GET request, but without the response body.
|
|
11
|
+
*/
|
|
12
|
+
readonly HEAD: "HEAD";
|
|
13
|
+
/**
|
|
14
|
+
* POST: Submits data to be processed (e.g., from an HTML form) to the identified resource.
|
|
15
|
+
*/
|
|
16
|
+
readonly POST: "POST";
|
|
17
|
+
/**
|
|
18
|
+
* PUT: Uploads a representation of the specified URI.
|
|
19
|
+
*/
|
|
20
|
+
readonly PUT: "PUT";
|
|
21
|
+
/**
|
|
22
|
+
* DELETE: Deletes the specified resource.
|
|
23
|
+
*/
|
|
24
|
+
readonly DELETE: "DELETE";
|
|
25
|
+
/**
|
|
26
|
+
* CONNECT: Establishes a tunnel to the server identified by the target resource.
|
|
27
|
+
*/
|
|
28
|
+
readonly CONNECT: "CONNECT";
|
|
29
|
+
/**
|
|
30
|
+
* OPTIONS: Describes the communication options for the target resource.
|
|
31
|
+
*/
|
|
32
|
+
readonly OPTIONS: "OPTIONS";
|
|
33
|
+
/**
|
|
34
|
+
* TRACE: Performs a message loop-back test along the path to the target resource.
|
|
35
|
+
*/
|
|
36
|
+
readonly TRACE: "TRACE";
|
|
37
|
+
/**
|
|
38
|
+
* PATCH: Applies partial modifications to a resource.
|
|
39
|
+
*/
|
|
40
|
+
readonly PATCH: "PATCH";
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Object representing standard HTTP status codes.
|
|
44
|
+
*/
|
|
45
|
+
export declare const HttpStatusCodes: {
|
|
46
|
+
/**
|
|
47
|
+
* 100 Continue: The server has received the request headers and the client should proceed to send the request body.
|
|
48
|
+
*/
|
|
49
|
+
readonly Info_100_Continue: 100;
|
|
50
|
+
/**
|
|
51
|
+
* 101 Switching Protocols: The server understands and is willing to comply with the clients request to switch protocols.
|
|
52
|
+
*/
|
|
53
|
+
readonly Info_101_Switching_Protocols: 101;
|
|
54
|
+
/**
|
|
55
|
+
* 102 Processing: The server has received and is processing the request, but no response is available yet.
|
|
56
|
+
*/
|
|
57
|
+
readonly Info_102_Processing: 102;
|
|
58
|
+
/**
|
|
59
|
+
* 103 Early Hints: The server is sending some response headers before the final HTTP message.
|
|
60
|
+
*/
|
|
61
|
+
readonly Info_103_Early_Hints: 103;
|
|
62
|
+
/**
|
|
63
|
+
* 200 OK: The request has succeeded.
|
|
64
|
+
*/
|
|
65
|
+
readonly Success_200_OK: 200;
|
|
66
|
+
/**
|
|
67
|
+
* 201 Created: The request has been fulfilled and resulted in a new resource being created.
|
|
68
|
+
*/
|
|
69
|
+
readonly Success_201_Created: 201;
|
|
70
|
+
/**
|
|
71
|
+
* 202 Accepted: The request has been accepted for processing, but the processing has not been completed.
|
|
72
|
+
*/
|
|
73
|
+
readonly Success_202_Accepted: 202;
|
|
74
|
+
/**
|
|
75
|
+
* 203 Non-Authoritative Information: The server is a transforming proxy that received a 200 OK
|
|
76
|
+
* from the origin server but is returning a modified version of the origins response.
|
|
77
|
+
*/
|
|
78
|
+
readonly Success_203_Non_Authoritative_Information: 203;
|
|
79
|
+
/**
|
|
80
|
+
* 204 No Content: The server successfully processed the request and is not returning any content.
|
|
81
|
+
*/
|
|
82
|
+
readonly Success_204_No_Content: 204;
|
|
83
|
+
/**
|
|
84
|
+
* 205 Reset Content: The server successfully processed the request,
|
|
85
|
+
* asks that the client reset its document view, and is not returning any content.
|
|
86
|
+
*/
|
|
87
|
+
readonly Success_205_Reset_Content: 205;
|
|
88
|
+
/**
|
|
89
|
+
* 206 Partial Content: The server is delivering only part of the resource due to a range header sent by the client.
|
|
90
|
+
*/
|
|
91
|
+
readonly Success_206_Partial_Content: 206;
|
|
92
|
+
/**
|
|
93
|
+
* 207 Multi-Status: The message body that follows is an XML message
|
|
94
|
+
* and can contain a number of separate response codes, depending on how many sub-requests were made.
|
|
95
|
+
*/
|
|
96
|
+
readonly Success_207_Multi_Status: 207;
|
|
97
|
+
/**
|
|
98
|
+
* 208 Already Reported: The members of a DAV binding have already been enumerated
|
|
99
|
+
* in a preceding part of the (multi-status) response, and are not being included again.
|
|
100
|
+
*/
|
|
101
|
+
readonly Success_208_Already_Reported: 208;
|
|
102
|
+
/**
|
|
103
|
+
* 226 IM Used: The server has fulfilled a request for the resource, and the response is a representation
|
|
104
|
+
* of the result of one or more instance-manipulations applied to the current instance.
|
|
105
|
+
*/
|
|
106
|
+
readonly Success_226_IM_Used: 226;
|
|
107
|
+
/**
|
|
108
|
+
* 300 Multiple Choices: The request has more than one possible response.
|
|
109
|
+
*/
|
|
110
|
+
readonly Redirect_300_Multiple_Choices: 300;
|
|
111
|
+
/**
|
|
112
|
+
* 301 Moved Permanently: The URL of the requested resource has been changed permanently.
|
|
113
|
+
*/
|
|
114
|
+
readonly Redirect_301_Moved_Permanently: 301;
|
|
115
|
+
/**
|
|
116
|
+
* 302 Found: The URL of the requested resource has been changed temporarily.
|
|
117
|
+
*/
|
|
118
|
+
readonly Redirect_302_Found: 302;
|
|
119
|
+
/**
|
|
120
|
+
* 303 See Other: The response to the request can be found under another URI using a GET method.
|
|
121
|
+
*/
|
|
122
|
+
readonly Redirect_303_See_Other: 303;
|
|
123
|
+
/**
|
|
124
|
+
* 304 Not Modified: The resource has not been modified since the version specified
|
|
125
|
+
* by the request headers If-Modified-Since or If-None-Match.
|
|
126
|
+
*/
|
|
127
|
+
readonly Redirect_304_Not_Modified: 304;
|
|
128
|
+
/**
|
|
129
|
+
* 305 Use Proxy: The requested resource is only available through a proxy, the address for which is provided in the response.
|
|
130
|
+
*/
|
|
131
|
+
readonly Redirect_305_Use_Proxy: 305;
|
|
132
|
+
/**
|
|
133
|
+
* 306 Switch Proxy: No longer used. Originally meant "Subsequent requests should use the specified proxy."
|
|
134
|
+
*/
|
|
135
|
+
readonly Redirect_306_Switch_Proxy: 306;
|
|
136
|
+
/**
|
|
137
|
+
* 307 Temporary Redirect: The server sends this response to direct the client
|
|
138
|
+
* to get the requested resource at another URI with the same method that was used in the prior request.
|
|
139
|
+
*/
|
|
140
|
+
readonly Redirect_307_Temporary_Redirect: 307;
|
|
141
|
+
/**
|
|
142
|
+
* 308 Permanent Redirect: This means that the resource is now permanently located at another URI,
|
|
143
|
+
* specified by the Location: HTTP Response header.
|
|
144
|
+
*/
|
|
145
|
+
readonly Redirect_308_Permanent_Redirect: 308;
|
|
146
|
+
/**
|
|
147
|
+
* 400 Bad Request: The server cannot or will not process the request due to something that is perceived to be a client error.
|
|
148
|
+
*/
|
|
149
|
+
readonly Error_Client_400_Bad_Request: 400;
|
|
150
|
+
/**
|
|
151
|
+
* 401 Unauthorized: The request has not been applied because it lacks valid authentication credentials for the target resource.
|
|
152
|
+
*/
|
|
153
|
+
readonly Error_Client_401_Unauthorized: 401;
|
|
154
|
+
/**
|
|
155
|
+
* 402 Payment Required: Reserved for future use.
|
|
156
|
+
*/
|
|
157
|
+
readonly Error_Client_402_Payment_Required: 402;
|
|
158
|
+
/**
|
|
159
|
+
* 403 Forbidden: The client does not have access rights to the content, so the server is refusing to give the requested resource.
|
|
160
|
+
*/
|
|
161
|
+
readonly Error_Client_403_Forbidden: 403;
|
|
162
|
+
/**
|
|
163
|
+
* 404 Not Found: The server can not find the requested resource.
|
|
164
|
+
*/
|
|
165
|
+
readonly Error_Client_404_Not_Found: 404;
|
|
166
|
+
/**
|
|
167
|
+
* 405 Method Not Allowed: The request method is known by the server but is not supported by the target resource.
|
|
168
|
+
*/
|
|
169
|
+
readonly Error_Client_405_Method_Not_Allowed: 405;
|
|
170
|
+
/**
|
|
171
|
+
* 406 Not Acceptable: The target resource does not have a current representation that would be acceptable
|
|
172
|
+
* to the user agent, according to the proactive negotiation header fields received in the request,
|
|
173
|
+
* and the server is unwilling to supply a default representation.
|
|
174
|
+
*/
|
|
175
|
+
readonly Error_Client_406_Not_Acceptable: 406;
|
|
176
|
+
/**
|
|
177
|
+
* 407 Proxy Authentication Required: Similar to 401 Unauthorized,
|
|
178
|
+
* but it indicates that the client needs to authenticate itself in order to use a proxy.
|
|
179
|
+
*/
|
|
180
|
+
readonly Error_Client_407_Proxy_Authentication_Required: 407;
|
|
181
|
+
/**
|
|
182
|
+
* 408 Request Timeout: The server timed out waiting for the request.
|
|
183
|
+
*/
|
|
184
|
+
readonly Error_Client_408_Request_Timeout: 408;
|
|
185
|
+
/**
|
|
186
|
+
* 409 Conflict: The request could not be processed because of conflict in the request, such as an edit conflict.
|
|
187
|
+
*/
|
|
188
|
+
readonly Error_Client_409_Conflict: 409;
|
|
189
|
+
/**
|
|
190
|
+
* 410 Gone: The requested resource is no longer available and will not be available again.
|
|
191
|
+
*/
|
|
192
|
+
readonly Error_Client_410_Gone: 410;
|
|
193
|
+
/**
|
|
194
|
+
* 411 Length Required: The server refuses to accept the request without a defined Content-Length header.
|
|
195
|
+
*/
|
|
196
|
+
readonly Error_Client_411_Length_Required: 411;
|
|
197
|
+
/**
|
|
198
|
+
* 412 Precondition Failed: One or more conditions given in the request header fields evaluated to false when tested on the server.
|
|
199
|
+
*/
|
|
200
|
+
readonly Error_Client_412_Precondition_Failed: 412;
|
|
201
|
+
/**
|
|
202
|
+
* 413 Payload Too Large: The server is refusing to process a request because the request payload is larger
|
|
203
|
+
* than the server is willing or able to process.
|
|
204
|
+
*/
|
|
205
|
+
readonly Error_Client_413_Payload_Too_Large: 413;
|
|
206
|
+
/**
|
|
207
|
+
* 414 URI Too Long: The server is refusing to service the request because the URI is longer than the server is willing to interpret.
|
|
208
|
+
*/
|
|
209
|
+
readonly Error_Client_414_URI_Too_Long: 414;
|
|
210
|
+
/**
|
|
211
|
+
* 415 Unsupported Media Type: The server is refusing to service the request
|
|
212
|
+
* because the entity of the request is in a format not supported by the requested resource for the requested method.
|
|
213
|
+
*/
|
|
214
|
+
readonly Error_Client_415_Unsupported_Media_Type: 415;
|
|
215
|
+
/**
|
|
216
|
+
* 416 Range Not Satisfiable: The client has asked for a portion of the file, but the server cannot supply that portion.
|
|
217
|
+
*/
|
|
218
|
+
readonly Error_Client_416_Range_Not_Satisfiable: 416;
|
|
219
|
+
/**
|
|
220
|
+
* 417 Expectation Failed: The server cannot meet the requirements of the Expect request-header field.
|
|
221
|
+
*/
|
|
222
|
+
readonly Error_Client_417_Expectation_Failed: 417;
|
|
223
|
+
/**
|
|
224
|
+
* 421 Misdirected Request: The request was directed at a server that is not able to produce a response.
|
|
225
|
+
*/
|
|
226
|
+
readonly Error_Client_421_Misdirected_Request: 421;
|
|
227
|
+
/**
|
|
228
|
+
* 422 Unprocessable Entity: The request was well-formed but was unable to be followed due to semantic errors.
|
|
229
|
+
*/
|
|
230
|
+
readonly Error_Client_422_Unprocessable_Entity: 422;
|
|
231
|
+
/**
|
|
232
|
+
* 423 Locked: The resource that is being accessed is locked.
|
|
233
|
+
*/
|
|
234
|
+
readonly Error_Client_423_Locked: 423;
|
|
235
|
+
/**
|
|
236
|
+
* 424 Failed Dependency: The request failed due to a failure of a previous request.
|
|
237
|
+
*/
|
|
238
|
+
readonly Error_Client_424_Failed_Dependency: 424;
|
|
239
|
+
/**
|
|
240
|
+
* 425 Too Early: The server is unwilling to risk processing a request that might be replayed.
|
|
241
|
+
*/
|
|
242
|
+
readonly Error_Client_425_Too_Early: 425;
|
|
243
|
+
/**
|
|
244
|
+
* 426 Upgrade Required: The server refuses to perform the request using the current protocol
|
|
245
|
+
* but might be willing to do so after the client upgrades to a different protocol.
|
|
246
|
+
*/
|
|
247
|
+
readonly Error_Client_426_Upgrade_Required: 426;
|
|
248
|
+
/**
|
|
249
|
+
* 428 Precondition Required: The origin server requires the request to be conditional.
|
|
250
|
+
*/
|
|
251
|
+
readonly Error_Client_428_Precondition_Required: 428;
|
|
252
|
+
/**
|
|
253
|
+
* 429 Too Many Requests: The user has sent too many requests in a given amount of time ("rate limiting").
|
|
254
|
+
*/
|
|
255
|
+
readonly Error_Client_429_Too_Many_Requests: 429;
|
|
256
|
+
/**
|
|
257
|
+
* 431 Request Header Fields Too Large: The server is unwilling to process the request because its header fields are too large.
|
|
258
|
+
*/
|
|
259
|
+
readonly Error_Client_431_Request_Header_Fields_Too_Large: 431;
|
|
260
|
+
/**
|
|
261
|
+
* 451 Unavailable For Legal Reasons: The user requests an illegal resource, such as a web page censored by a government.
|
|
262
|
+
*/
|
|
263
|
+
readonly Error_Client_451_Unavailable_For_Legal_Reasons: 451;
|
|
264
|
+
/**
|
|
265
|
+
* 500 Internal Server Error: A generic error message, given when no more specific message is suitable.
|
|
266
|
+
*/
|
|
267
|
+
readonly Error_Server_500_Internal_Server_Error: 500;
|
|
268
|
+
/**
|
|
269
|
+
* 501 Not Implemented: The server either does not recognize the request method, or it lacks the ability to fulfill the request.
|
|
270
|
+
*/
|
|
271
|
+
readonly Error_Server_501_Not_Implemented: 501;
|
|
272
|
+
/**
|
|
273
|
+
* 502 Bad Gateway: The server was acting as a gateway or proxy and received an invalid response from the upstream server.
|
|
274
|
+
*/
|
|
275
|
+
readonly Error_Server_502_Bad_Gateway: 502;
|
|
276
|
+
/**
|
|
277
|
+
* 503 Service Unavailable: The server is currently unavailable (because it is overloaded or down for maintenance).
|
|
278
|
+
*/
|
|
279
|
+
readonly Error_Server_503_Service_Unavailable: 503;
|
|
280
|
+
/**
|
|
281
|
+
* 504 Gateway Timeout: The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.
|
|
282
|
+
*/
|
|
283
|
+
readonly Error_Server_504_Gateway_Timeout: 504;
|
|
284
|
+
/**
|
|
285
|
+
* 505 HTTP Version Not Supported: The server does not support the HTTP protocol version used in the request.
|
|
286
|
+
*/
|
|
287
|
+
readonly Error_Server_505_HTTP_Version_Not_Supported: 505;
|
|
288
|
+
/**
|
|
289
|
+
* 506 Variant Also Negotiates: Transparent content negotiation for the request results in a circular reference.
|
|
290
|
+
*/
|
|
291
|
+
readonly Error_Server_506_Variant_Also_Negotiates: 506;
|
|
292
|
+
/**
|
|
293
|
+
* 507 Insufficient Storage: The server is unable to store the representation needed to complete the request.
|
|
294
|
+
*/
|
|
295
|
+
readonly Error_Server_507_Insufficient_Storage: 507;
|
|
296
|
+
/**
|
|
297
|
+
* 508 Loop Detected: The server detected an infinite loop while processing the request.
|
|
298
|
+
*/
|
|
299
|
+
readonly Error_Server_508_Loop_Detected: 508;
|
|
300
|
+
/**
|
|
301
|
+
* 510 Not Extended: Further extensions to the request are required for the server to fulfill it.
|
|
302
|
+
*/
|
|
303
|
+
readonly Error_Server_510_Not_Extended: 510;
|
|
304
|
+
/**
|
|
305
|
+
* 511 Network Authentication Required: The client needs to authenticate to gain network access.
|
|
306
|
+
*/
|
|
307
|
+
readonly Error_Server_511_Network_Authentication_Required: 511;
|
|
308
|
+
};
|
|
309
|
+
/**
|
|
310
|
+
* Object representing standard HTTP status messages.
|
|
311
|
+
*/
|
|
312
|
+
export declare const HttpStatusMessages: {
|
|
313
|
+
100: string;
|
|
314
|
+
101: string;
|
|
315
|
+
102: string;
|
|
316
|
+
103: string;
|
|
317
|
+
200: string;
|
|
318
|
+
201: string;
|
|
319
|
+
202: string;
|
|
320
|
+
203: string;
|
|
321
|
+
204: string;
|
|
322
|
+
205: string;
|
|
323
|
+
206: string;
|
|
324
|
+
207: string;
|
|
325
|
+
208: string;
|
|
326
|
+
226: string;
|
|
327
|
+
300: string;
|
|
328
|
+
301: string;
|
|
329
|
+
302: string;
|
|
330
|
+
303: string;
|
|
331
|
+
304: string;
|
|
332
|
+
305: string;
|
|
333
|
+
307: string;
|
|
334
|
+
308: string;
|
|
335
|
+
400: string;
|
|
336
|
+
401: string;
|
|
337
|
+
402: string;
|
|
338
|
+
403: string;
|
|
339
|
+
404: string;
|
|
340
|
+
405: string;
|
|
341
|
+
406: string;
|
|
342
|
+
407: string;
|
|
343
|
+
408: string;
|
|
344
|
+
409: string;
|
|
345
|
+
410: string;
|
|
346
|
+
411: string;
|
|
347
|
+
412: string;
|
|
348
|
+
413: string;
|
|
349
|
+
414: string;
|
|
350
|
+
415: string;
|
|
351
|
+
416: string;
|
|
352
|
+
417: string;
|
|
353
|
+
418: string;
|
|
354
|
+
421: string;
|
|
355
|
+
422: string;
|
|
356
|
+
423: string;
|
|
357
|
+
424: string;
|
|
358
|
+
425: string;
|
|
359
|
+
426: string;
|
|
360
|
+
428: string;
|
|
361
|
+
429: string;
|
|
362
|
+
431: string;
|
|
363
|
+
451: string;
|
|
364
|
+
500: string;
|
|
365
|
+
501: string;
|
|
366
|
+
502: string;
|
|
367
|
+
503: string;
|
|
368
|
+
504: string;
|
|
369
|
+
505: string;
|
|
370
|
+
506: string;
|
|
371
|
+
507: string;
|
|
372
|
+
508: string;
|
|
373
|
+
509: string;
|
|
374
|
+
510: string;
|
|
375
|
+
511: string;
|
|
376
|
+
};
|
|
377
|
+
/**
|
|
378
|
+
* Type representing standard HTTP status codes.
|
|
379
|
+
*/
|
|
380
|
+
export type HttpStatusCode = keyof typeof HttpStatusMessages;
|
|
381
|
+
/**
|
|
382
|
+
* Object representing standard MIME types.
|
|
383
|
+
*/
|
|
384
|
+
export declare const MimeTypes: {
|
|
385
|
+
readonly AAC: "audio/aac";
|
|
386
|
+
readonly ABW: "application/x-abiword";
|
|
387
|
+
readonly ARC: "application/x-freearc";
|
|
388
|
+
readonly AVI: "video/x-msvideo";
|
|
389
|
+
readonly AZW: "application/vnd.amazon.ebook";
|
|
390
|
+
readonly BIN: "application/octet-stream";
|
|
391
|
+
readonly BMP: "image/bmp";
|
|
392
|
+
readonly BZ: "application/x-bzip";
|
|
393
|
+
readonly BZ2: "application/x-bzip2";
|
|
394
|
+
readonly CSH: "application/x-csh";
|
|
395
|
+
readonly CSS: "text/css";
|
|
396
|
+
readonly CSV: "text/csv";
|
|
397
|
+
readonly DOC: "application/msword";
|
|
398
|
+
readonly DOCX: "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
399
|
+
readonly EOT: "application/vnd.ms-fontobject";
|
|
400
|
+
readonly EPUB: "application/epub+zip";
|
|
401
|
+
readonly GZ: "application/gzip";
|
|
402
|
+
readonly GIF: "image/gif";
|
|
403
|
+
readonly HTML: "text/html";
|
|
404
|
+
readonly ICO: "image/vnd.microsoft.icon";
|
|
405
|
+
readonly ICS: "text/calendar";
|
|
406
|
+
readonly JAR: "application/java-archive";
|
|
407
|
+
readonly JPEG: "image/jpeg";
|
|
408
|
+
readonly JS: "text/javascript";
|
|
409
|
+
readonly JSON: "application/json";
|
|
410
|
+
readonly JSONLD: "application/ld+json";
|
|
411
|
+
readonly MID: "audio/midi";
|
|
412
|
+
readonly MIDI: "audio/midi";
|
|
413
|
+
readonly MJS: "text/javascript";
|
|
414
|
+
readonly MP3: "audio/mpeg";
|
|
415
|
+
readonly MP4: "video/mp4";
|
|
416
|
+
readonly MPEG: "video/mpeg";
|
|
417
|
+
readonly MPKG: "application/vnd.apple.installer+xml";
|
|
418
|
+
readonly ODP: "application/vnd.oasis.opendocument.presentation";
|
|
419
|
+
readonly ODS: "application/vnd.oasis.opendocument.spreadsheet";
|
|
420
|
+
readonly ODT: "application/vnd.oasis.opendocument.text";
|
|
421
|
+
readonly OGA: "audio/ogg";
|
|
422
|
+
readonly OGV: "video/ogg";
|
|
423
|
+
readonly OGX: "application/ogg";
|
|
424
|
+
readonly OPUS: "audio/opus";
|
|
425
|
+
readonly OTF: "font/otf";
|
|
426
|
+
readonly PNG: "image/png";
|
|
427
|
+
readonly PDF: "application/pdf";
|
|
428
|
+
readonly PHP: "application/x-httpd-php";
|
|
429
|
+
readonly PPT: "application/vnd.ms-powerpoint";
|
|
430
|
+
readonly PPTX: "application/vnd.openxmlformats-officedocument.presentationml.presentation";
|
|
431
|
+
readonly RAR: "application/vnd.rar";
|
|
432
|
+
readonly RTF: "application/rtf";
|
|
433
|
+
readonly SH: "application/x-sh";
|
|
434
|
+
readonly SVG: "image/svg+xml";
|
|
435
|
+
readonly SWF: "application/x-shockwave-flash";
|
|
436
|
+
readonly TAR: "application/x-tar";
|
|
437
|
+
readonly TIFF: "image/tiff";
|
|
438
|
+
readonly TS: "video/mp2t";
|
|
439
|
+
readonly TTF: "font/ttf";
|
|
440
|
+
readonly TXT: "text/plain";
|
|
441
|
+
readonly VS: "application/x-sh";
|
|
442
|
+
readonly WAV: "audio/wav";
|
|
443
|
+
readonly WEBA: "audio/webm";
|
|
444
|
+
readonly WEBM: "video/webm";
|
|
445
|
+
readonly WEBP: "image/webp";
|
|
446
|
+
readonly WOFF: "font/woff";
|
|
447
|
+
readonly WOFF2: "font/woff2";
|
|
448
|
+
readonly XHTML: "application/xhtml+xml";
|
|
449
|
+
readonly XLS: "application/vnd.ms-excel";
|
|
450
|
+
readonly XLSX: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
451
|
+
readonly XML: "application/xml";
|
|
452
|
+
readonly XUL: "application/vnd.mozilla.xul+xml";
|
|
453
|
+
readonly ZIP: "application/zip";
|
|
454
|
+
readonly '3GP': "video/3gpp";
|
|
455
|
+
readonly '3G2': "video/3gpp2";
|
|
456
|
+
readonly '7Z': "application/x-7z-compressed";
|
|
457
|
+
};
|
|
458
|
+
//# sourceMappingURL=constant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constant.d.ts","sourceRoot":"","sources":["../src/constant.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,WAAW;IACtB;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAEK,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,eAAe;IAC1B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;;OAGG;;IAGH;;OAEG;;IAGH;;;OAGG;;IAGH;;OAEG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;;OAGG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;;;OAIG;;IAGH;;;OAGG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;;OAGG;;IAGH;;OAEG;;IAGH;;;OAGG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;;OAGG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAEK,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgE9B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,kBAAkB,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyEZ,CAAC"}
|