@d1g1tal/transportr 0.0.2

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