@d1g1tal/transportr 1.4.4 → 2.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.
@@ -1,162 +0,0 @@
1
- /**
2
- * A constant object that contains all the media types that are supported by the browser.
3
- *
4
- * @module HttpMediaType
5
- * @constant {Object<string, string>}
6
- */
7
- const HttpMediaType = {
8
- /** Advanced Audio Coding (AAC) */
9
- AAC: 'audio/aac',
10
- /** AbiWord */
11
- ABW: 'application/x-abiword',
12
- /** Archive document (multiple files embedded) */
13
- ARC: 'application/x-freearc',
14
- /** AVIF image */
15
- AVIF: 'image/avif',
16
- /** Audio Video Interleave (AVI) */
17
- AVI: 'video/x-msvideo',
18
- /** Amazon Kindle eBook format */
19
- AZW: 'application/vnd.amazon.ebook',
20
- /** Binary Data */
21
- BIN: 'application/octet-stream',
22
- /** Windows OS/2 Bitmap Graphics */
23
- BMP: 'image/bmp',
24
- /** Bzip Archive */
25
- BZIP: 'application/x-bzip',
26
- /** Bzip2 Archive */
27
- BZIP2: 'application/x-bzip2',
28
- /** CD audio */
29
- CDA: 'application/x-cdf',
30
- /** C Shell Script */
31
- CSH: 'application/x-csh',
32
- /** Cascading Style Sheets (CSS) */
33
- CSS: 'text/css',
34
- /** Comma-Separated Values */
35
- CSV: 'text/csv',
36
- /** Microsoft Office Word Document */
37
- DOC: 'application/msword',
38
- /** Microsoft Office Word Document (OpenXML) */
39
- DOCX: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
40
- /** Microsoft Embedded OpenType */
41
- EOT: 'application/vnd.ms-fontobject',
42
- /** Electronic Publication (EPUB) */
43
- EPUB: 'application/epub+zip',
44
- /** GZip Compressed Archive */
45
- GZIP: 'application/gzip',
46
- /** Graphics Interchange Format */
47
- GIF: 'image/gif',
48
- /** HyperText Markup Language (HTML) */
49
- HTML: 'text/html',
50
- /** Icon Format */
51
- ICO: 'image/vnd.microsoft.icon',
52
- /** iCalendar Format */
53
- ICS: 'text/calendar',
54
- /** Java Archive (JAR) */
55
- JAR: 'application/java-archive',
56
- /** JPEG Image */
57
- JPEG: 'image/jpeg',
58
- /** JavaScript */
59
- JAVA_SCRIPT: 'text/javascript',
60
- /** JavaScript Object Notation Format (JSON) */
61
- JSON: 'application/json',
62
- /** JavaScript Object Notation LD Format */
63
- JSON_LD: 'application/ld+json',
64
- /** JavaScript Object Notation (JSON) Merge Patch */
65
- JSON_MERGE_PATCH: 'application/merge-patch+json',
66
- /** Musical Instrument Digital Interface (MIDI) */
67
- MID: 'audio/midi',
68
- /** Musical Instrument Digital Interface (MIDI) */
69
- X_MID: 'audio/x-midi',
70
- /** MP3 Audio */
71
- MP3: 'audio/mpeg',
72
- /** MPEG-4 Audio */
73
- MP4A: 'audio/mp4',
74
- /** MPEG-4 Video */
75
- MP4: 'video/mp4',
76
- /** MPEG Video */
77
- MPEG: 'video/mpeg',
78
- /** Apple Installer Package */
79
- MPKG: 'application/vnd.apple.installer+xml',
80
- /** OpenDocument Presentation Document */
81
- ODP: 'application/vnd.oasis.opendocument.presentation',
82
- /** OpenDocument Spreadsheet Document */
83
- ODS: 'application/vnd.oasis.opendocument.spreadsheet',
84
- /** OpenDocument Text Document */
85
- ODT: 'application/vnd.oasis.opendocument.text',
86
- /** Ogg Audio */
87
- OGA: 'audio/ogg',
88
- /** Ogg Video */
89
- OGV: 'video/ogg',
90
- /** Ogg */
91
- OGX: 'application/ogg',
92
- /** Opus audio */
93
- OPUS: 'audio/opus',
94
- /** OpenType Font File */
95
- OTF: 'font/otf',
96
- /** Portable Network Graphics (PNG) */
97
- PNG: 'image/png',
98
- /** Adobe Portable Document Format */
99
- PDF: 'application/pdf',
100
- /** Hypertext Preprocessor (Personal Home Page) */
101
- PHP: 'application/x-httpd-php',
102
- /** Microsoft PowerPoint */
103
- PPT: 'application/vnd.ms-powerpoint',
104
- /** Microsoft Office Presentation (OpenXML) */
105
- PPTX: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
106
- /** RAR Archive */
107
- RAR: 'application/vnd.rar',
108
- /** Rich Text Format */
109
- RTF: 'application/rtf',
110
- /** Bourne Shell Script */
111
- SH: 'application/x-sh',
112
- /** Scalable Vector Graphics (SVG) */
113
- SVG: 'image/svg+xml',
114
- /** Tape Archive (TAR) */
115
- TAR: 'application/x-tar',
116
- /** Tagged Image File Format (TIFF) */
117
- TIFF: 'image/tiff',
118
- /** MPEG transport stream */
119
- TRANSPORT_STREAM: 'video/mp2t',
120
- /** TrueType Font */
121
- TTF: 'font/ttf',
122
- /** Text, (generally ASCII or ISO 8859-n) */
123
- TEXT: 'text/plain',
124
- /** Microsoft Visio */
125
- VSD: 'application/vnd.visio',
126
- /** Waveform Audio Format (WAV) */
127
- WAV: 'audio/wav',
128
- /** Open Web Media Project - Audio */
129
- WEBA: 'audio/webm',
130
- /** Open Web Media Project - Video */
131
- WEBM: 'video/webm',
132
- /** WebP Image */
133
- WEBP: 'image/webp',
134
- /** Web Open Font Format */
135
- WOFF: 'font/woff',
136
- /** Web Open Font Format */
137
- WOFF2: 'font/woff2',
138
- /** Form - Encoded */
139
- FORM: 'application/x-www-form-urlencoded',
140
- /** Multipart FormData */
141
- MULTIPART_FORM_DATA: 'multipart/form-data',
142
- /** XHTML - The Extensible HyperText Markup Language */
143
- XHTML: 'application/xhtml+xml',
144
- /** Microsoft Excel Document */
145
- XLS: 'application/vnd.ms-excel',
146
- /** Microsoft Office Spreadsheet Document (OpenXML) */
147
- XLSX: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
148
- /** Extensible Markup Language (XML) */
149
- XML: 'application/xml',
150
- /** XML User Interface Language (XUL) */
151
- XUL: 'application/vnd.mozilla.xul+xml',
152
- /** Zip Archive */
153
- ZIP: 'application/zip',
154
- /** 3GPP audio/video container */
155
- '3GP': 'video/3gpp',
156
- /** 3GPP2 audio/video container */
157
- '3G2': 'video/3gpp2',
158
- /** 7-Zip Archive */
159
- '7Z': 'application/x-7z-compressed',
160
- };
161
-
162
- export default HttpMediaType;
@@ -1,312 +0,0 @@
1
- /**
2
- * Defining a constant object with all the HTTP request headers.
3
- *
4
- * @module HttpRequestHeader
5
- * @constant {Object<string, string>}
6
- */
7
- const HttpRequestHeader = {
8
- /**
9
- * Content-Types that are acceptable for the response. See Content negotiation. Permanent.
10
- *
11
- * @example
12
- * <code>Accept: text/plain</code>
13
- */
14
- ACCEPT: 'accept',
15
- /**
16
- * Character sets that are acceptable. Permanent.
17
- *
18
- * @example
19
- * <code>Accept-Charset: utf-8</code>
20
- */
21
- ACCEPT_CHARSET: 'accept-charset',
22
- /**
23
- * List of acceptable encodings. See HTTP compression. Permanent.
24
- *
25
- * @example
26
- * <code>Accept-Encoding: gzip, deflate</code>
27
- */
28
- ACCEPT_ENCODING: 'accept-encoding',
29
- /**
30
- * List of acceptable human languages for response. See Content negotiation. Permanent.
31
- *
32
- * @example
33
- * <code>Accept-Language: en-US</code>
34
- */
35
- ACCEPT_LANGUAGE: 'accept-language',
36
- /**
37
- * Authentication credentials for HTTP authentication. Permanent.
38
- *
39
- * @example
40
- * <code>Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==</code>
41
- */
42
- AUTHORIZATION: 'authorization',
43
- /**
44
- * Used to specify directives that must be obeyed by all caching mechanisms along the request-response chain.
45
- * Permanent.
46
- *
47
- * @example
48
- * <code>Cache-Control: no-cache</code>
49
- */
50
- CACHE_CONTROL: 'cache-control',
51
- /**
52
- * Control options for the current connection and list of hop-by-hop request fields. Permanent.
53
- *
54
- * @example
55
- * <code>Connection: keep-alive</code>
56
- * <code>Connection: Upgrade</code>
57
- */
58
- CONNECTION: 'connection',
59
- /**
60
- * An HTTP cookie previously sent by the server with Set-Cookie (below). Permanent: standard.
61
- *
62
- * @example
63
- * <code>Cookie: $Version=1, Skin=new,</code>
64
- */
65
- COOKIE: 'cookie',
66
- /**
67
- * The length of the request body in octets (8-bit bytes). Permanent.
68
- *
69
- * @example
70
- * <code>Content-Length: 348</code>
71
- */
72
- CONTENT_LENGTH: 'content-length',
73
- /**
74
- * A Base64-encoded binary MD5 sum of the content of the request body. Obsolete.
75
- *
76
- * @example
77
- * <code>Content-MD5: Q2hlY2sgSW50ZWdyaXR5IQ==</code>
78
- */
79
- CONTENT_MD5: 'content-md5',
80
- /**
81
- * The MIME type of the body of the request (used with POST and PUT requests). Permanent.
82
- * <code>Content-Type: application/x-www-form-urlencoded</code>
83
- */
84
- CONTENT_TYPE: 'content-type',
85
- /**
86
- * The date and time that the message was sent (in "HTTP-date" format as defined by RFC 7231 Date/Time Formats).
87
- * Permanent.
88
- *
89
- * @example
90
- * <code>Date: Tue, 15 Nov 1994 08:12:31 GMT</code>
91
- */
92
- DATE: 'date',
93
- /**
94
- * Indicates that particular server behaviors are required by the client. Permanent.
95
- *
96
- * @example
97
- * <code>Expect: 100-continue</code>
98
- */
99
- EXPECT: 'expect',
100
- /**
101
- * The email address of the user making the request. Permanent.
102
- *
103
- * @example
104
- * <code>From: user@example.com</code>
105
- */
106
- FROM: 'from',
107
- /**
108
- * The domain name of the server (for virtual hosting), and the TCP port number on which the server is listening. The
109
- * port number may be omitted if the port is the standard port for the service requested. Permanent. Mandatory since
110
- * HTTP/1.1.
111
- *
112
- * @example
113
- * <code>Host: en.wikipedia.org:80</code>
114
- * <code>Host: en.wikipedia.org</code>
115
- */
116
- HOST: 'host',
117
- /**
118
- * Only perform the action if the client supplied entity matches the same entity on the server. This is mainly for
119
- * methods like PUT to only update a resource if it has not been modified since the user last updated it. Permanent.
120
- *
121
- * @example
122
- * <code>If-Match: "737060cd8c284d8af7ad3082f209582d"</code>
123
- */
124
- IF_MATCH: 'if-match',
125
- /**
126
- * Allows a 304 Not Modified to be returned if content is unchanged. Permanent.
127
- *
128
- * @example
129
- * <code>If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT</code>
130
- */
131
- IF_MODIFIED_SINCE: 'if-modified-since',
132
- /**
133
- * Allows a 304 Not Modified to be returned if content is unchanged, see HTTP ETag. Permanent.
134
- *
135
- * @example
136
- * <code>If-None-Match: "737060cd8c284d8af7ad3082f209582d"</code>
137
- */
138
- IF_NONE_MATCH: 'if-none-match',
139
- /**
140
- * If the entity is unchanged, send me the part(s) that I am missing, otherwise, send me the entire new entity.
141
- * Permanent.
142
- *
143
- * @example
144
- * <code>If-Range: "737060cd8c284d8af7ad3082f209582d"</code>
145
- */
146
- IF_RANGE: 'if-range',
147
- /**
148
- * Only send the response if the entity has not been modified since a specific time. Permanent.
149
- *
150
- * @example
151
- * <code>If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT</code>
152
- */
153
- IF_UNMODIFIED_SINCE: 'if-unmodified-since',
154
- /**
155
- * Limit the number of times the message can be forwarded through proxies or gateways. Permanent.
156
- *
157
- * @example
158
- * <code>Max-Forwards: 10</code>
159
- */
160
- MAX_FORWARDS: 'max-forwards',
161
- /**
162
- * Initiates a request for cross-origin resource sharing (asks server for an 'Access-Control-Allow-Origin' response
163
- * field). Permanent: standard.
164
- *
165
- * @example
166
- * <code>Origin: http://www.example-social-network.com</code>
167
- */
168
- ORIGIN: 'origin',
169
- /**
170
- * Implementation-specific fields that may have various effects anywhere along the request-response chain. Permanent.
171
- *
172
- * @example
173
- * <code>Pragma: no-cache</code>
174
- */
175
- PRAGMA: 'pragma',
176
- /**
177
- * Authorization credentials for connecting to a proxy. Permanent.
178
- *
179
- * @example
180
- * <code>Proxy-Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==</code>
181
- */
182
- PROXY_AUTHORIZATION: 'proxy-authorization',
183
- /**
184
- * Request only part of an entity. Bytes are numbered from 0. See Byte serving. Permanent.
185
- *
186
- * @example
187
- * <code>Range: bytes=500-999</code>
188
- */
189
- RANGE: 'range',
190
- /**
191
- * This is the address of the previous web page from which a link to the currently requested page was followed. (The
192
- * word "referrer" has been misspelled in the RFC as well as in most implementations to the point that it has become
193
- * standard usage and is considered correct terminology). Permanent.
194
- *
195
- * @example
196
- * <code>Referer: http://en.wikipedia.org/wiki/Main_Page</code>
197
- */
198
- REFERER: 'referer',
199
- /**
200
- * The transfer encodings the user agent is willing to accept: the same values as for the response header field
201
- * Transfer-Encoding can be used, plus the "trailers" value (related to the "chunked" transfer method) to notify the
202
- * server it expects to receive additional fields in the trailer after the last, zero-sized, chunk. Permanent.
203
- *
204
- * @example
205
- * <code>TE: trailers, deflate</code>
206
- */
207
- TE: 'te',
208
- /**
209
- * The user agent string of the user agent. Permanent.
210
- *
211
- * @example
212
- * <code>User-Agent: Mozilla/5.0 (X11, Linux x86_64, rv:12.0) Gecko/20100101 Firefox/21.0</code>
213
- */
214
- USER_AGENT: 'user-agent',
215
- /**
216
- * Ask the server to upgrade to another protocol. Permanent.
217
- *
218
- * @example
219
- * <code>Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11</code>
220
- */
221
- UPGRADE: 'upgrade',
222
- /**
223
- * Informs the server of proxies through which the request was sent. Permanent.
224
- *
225
- * @example
226
- * <code>Via: 1.0 fred, 1.1 example.com (Apache/1.1)</code>
227
- */
228
- VIA: 'via',
229
- /**
230
- * A general warning about possible problems with the entity body. Permanent.
231
- *
232
- * @example
233
- * <code>Warning: 199 Miscellaneous warning</code>
234
- */
235
- WARNING: 'warning',
236
- /**
237
- * mainly used to identify Ajax requests. Most JavaScript frameworks send this field with value of XMLHttpRequest.
238
- *
239
- * @example
240
- * <code>X-Requested-With: XMLHttpRequest</code>
241
- */
242
- X_REQUESTED_WITH: 'x-requested-with',
243
- /**
244
- * Requests a web application to disable their tracking of a user. This is Mozilla's version of the X-Do-Not-Track
245
- * header field (since Firefox 4.0 Beta 11). Safari and IE9 also have support for this field. On March 7, 2011, a
246
- * draft proposal was submitted to IETF. The W3C Tracking Protection Working Group is producing a specification.
247
- *
248
- * @example
249
- * <code>DNT: 1 (Do Not Track Enabled)</code>
250
- * <code>DNT: 0 (Do Not Track Disabled)</code>
251
- */
252
- DNT: 'dnt',
253
- /**
254
- * A de facto standard for identifying the originating IP address of a client connecting to a web server through an
255
- * HTTP proxy or load balancer.
256
- *
257
- * @example
258
- * <code>X-Forwarded-For: client1, proxy1, proxy2</code>
259
- * <code>X-Forwarded-For: 129.78.138.66, 129.78.64.103</code>
260
- */
261
- X_FORWARDED_FOR: 'x-forwarded-for',
262
- /**
263
- * A de facto standard for identifying the original host requested by the client in the Host HTTP request header, since
264
- * the host name and/or port of the reverse proxy (load balancer) may differ from the origin server handling the
265
- * request.
266
- *
267
- * @example
268
- * <code>X-Forwarded-Host: en.wikipedia.org:80</code>
269
- * <code>X-Forwarded-Host: en.wikipedia.org</code>
270
- */
271
- X_FORWARDED_HOST: 'x-forwarded-host',
272
- /**
273
- * A de facto standard for identifying the originating protocol of an HTTP request, since a reverse proxy (load
274
- * balancer) may communicate with a web server using HTTP even if the request to the reverse proxy is HTTPS. An
275
- * alternative form of the header (X-ProxyUser-Ip) is used by Google clients talking to Google servers.
276
- *
277
- * @example
278
- * <code>X-Forwarded-Proto: https</code>
279
- */
280
- X_FORWARDED_PROTO: 'x-forwarded-proto',
281
- /**
282
- * Non-standard header field used by Microsoft applications and load-balancers.
283
- *
284
- * @example
285
- * <code>Front-End-Https: on</code>
286
- */
287
- FRONT_END_HTTPS: 'front-end-https',
288
- /**
289
- * Requests a web application override the method specified in the request (typically POST) with the method given in
290
- * the header field (typically PUT or DELETE). Can be used when a user agent or firewall prevents PUT or DELETE methods
291
- * from being sent directly (note that this either a bug in the software component, which ought to be fixed, or an
292
- * intentional configuration, in which case bypassing it may be the wrong thing to do).
293
- *
294
- * @example
295
- * <code>X-HTTP-Method-Override: DELETE</code>
296
- */
297
- X_HTTP_METHOD_OVERRIDE: 'x-http-method-override',
298
- /**
299
- * Allows easier parsing of the MakeModel/Firmware that is usually found in the User-Agent String of AT&T Devices.
300
- *
301
- * @example
302
- * <code>X-Att-Deviceid: GT-P7320/P7320XXLPG</code>
303
- */
304
- X_ATT_DEVICE_ID: 'x-att-deviceid',
305
- /**
306
- * Links to an XML file on the Internet with a full description and details about the device currently connecting. In the example to the right is an XML file for an AT&T Samsung Galaxy S2.
307
- * x-wap-profile: http://wap.samsungmobile.com/uaprof/SGH-I777.xml
308
- */
309
- X_WAP_PROFILE: 'x-wap-profile',
310
- };
311
-
312
- export default HttpRequestHeader;