@opra/core 0.3.0 → 0.5.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/cjs/adapter/adapter.js +318 -0
- package/cjs/{implementation → adapter}/express-adapter.js +3 -6
- package/cjs/adapter/http-adapter.js +241 -0
- package/cjs/adapter/metadata-resource.js +23 -0
- package/cjs/{implementation → adapter}/query-context.js +3 -3
- package/cjs/index.js +6 -6
- package/cjs/interfaces/resource.interface.js +2 -0
- package/cjs/services/json-collection-service.js +14 -14
- package/cjs/services/json-singleton-service.js +97 -0
- package/esm/{implementation → adapter}/adapter.d.ts +17 -9
- package/esm/adapter/adapter.js +314 -0
- package/esm/{implementation → adapter}/express-adapter.d.ts +2 -2
- package/esm/{implementation → adapter}/express-adapter.js +3 -6
- package/esm/{implementation → adapter}/http-adapter.d.ts +2 -3
- package/esm/adapter/http-adapter.js +237 -0
- package/esm/adapter/metadata-resource.d.ts +8 -0
- package/esm/adapter/metadata-resource.js +20 -0
- package/esm/{implementation → adapter}/query-context.d.ts +6 -7
- package/esm/{implementation → adapter}/query-context.js +1 -1
- package/esm/index.d.ts +6 -6
- package/esm/index.js +6 -6
- package/esm/interfaces/resource.interface.d.ts +22 -0
- package/esm/interfaces/resource.interface.js +1 -0
- package/esm/services/json-collection-service.d.ts +11 -12
- package/esm/services/json-collection-service.js +15 -15
- package/esm/services/json-singleton-service.d.ts +39 -0
- package/esm/services/json-singleton-service.js +92 -0
- package/esm/types.d.ts +2 -8
- package/esm/utils/create-i18n.d.ts +1 -1
- package/package.json +15 -13
- package/cjs/enums/http-headers.enum.js +0 -395
- package/cjs/enums/http-status.enum.js +0 -300
- package/cjs/enums/index.js +0 -5
- package/cjs/implementation/adapter-utils/entity-resource-execute.util.js +0 -86
- package/cjs/implementation/adapter-utils/resource-execute.util.js +0 -11
- package/cjs/implementation/adapter-utils/resource-prepare.util.js +0 -11
- package/cjs/implementation/adapter.js +0 -130
- package/cjs/implementation/headers-map.js +0 -18
- package/cjs/implementation/http-adapter.js +0 -253
- package/cjs/interfaces/entity-service.interface.js +0 -30
- package/esm/enums/http-headers.enum.d.ts +0 -370
- package/esm/enums/http-headers.enum.js +0 -392
- package/esm/enums/http-status.enum.d.ts +0 -290
- package/esm/enums/http-status.enum.js +0 -297
- package/esm/enums/index.d.ts +0 -2
- package/esm/enums/index.js +0 -2
- package/esm/implementation/adapter-utils/entity-resource-execute.util.d.ts +0 -3
- package/esm/implementation/adapter-utils/entity-resource-execute.util.js +0 -82
- package/esm/implementation/adapter-utils/resource-execute.util.d.ts +0 -3
- package/esm/implementation/adapter-utils/resource-execute.util.js +0 -7
- package/esm/implementation/adapter-utils/resource-prepare.util.d.ts +0 -3
- package/esm/implementation/adapter-utils/resource-prepare.util.js +0 -7
- package/esm/implementation/adapter.js +0 -126
- package/esm/implementation/headers-map.d.ts +0 -5
- package/esm/implementation/headers-map.js +0 -14
- package/esm/implementation/http-adapter.js +0 -249
- package/esm/interfaces/entity-service.interface.d.ts +0 -19
- package/esm/interfaces/entity-service.interface.js +0 -26
|
@@ -1,392 +0,0 @@
|
|
|
1
|
-
// noinspection JSUnusedGlobalSymbols
|
|
2
|
-
/**
|
|
3
|
-
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers#controls
|
|
4
|
-
*/
|
|
5
|
-
export var HttpHeaders;
|
|
6
|
-
(function (HttpHeaders) {
|
|
7
|
-
/* *** Custom Headers *** */
|
|
8
|
-
HttpHeaders["X_Opra_Version"] = "X-Opra-Version";
|
|
9
|
-
HttpHeaders["X_Opra_Schema"] = "X-Opra-Schema";
|
|
10
|
-
HttpHeaders["X_Opra_Count"] = "X-Opra-Count";
|
|
11
|
-
/* *** Authentication *** */
|
|
12
|
-
/**
|
|
13
|
-
* Defines the authentication method that should be used to access a resource.
|
|
14
|
-
*/
|
|
15
|
-
HttpHeaders["WWW_Authenticate"] = "WWW-Authenticate";
|
|
16
|
-
/**
|
|
17
|
-
* Contains the credentials to authenticate a user-agent with a server.
|
|
18
|
-
*/
|
|
19
|
-
HttpHeaders["Authorization"] = "Authorization";
|
|
20
|
-
/**
|
|
21
|
-
* Defines the authentication method that should be used to access a resource behind a proxy server.
|
|
22
|
-
*/
|
|
23
|
-
HttpHeaders["Proxy_Authenticate"] = "Proxy-Authenticate";
|
|
24
|
-
/**
|
|
25
|
-
* Contains the credentials to authenticate a user agent with a proxy server.
|
|
26
|
-
*/
|
|
27
|
-
HttpHeaders["Proxy_Authorization"] = "Proxy-Authorization";
|
|
28
|
-
/* *** Caching *** */
|
|
29
|
-
/**
|
|
30
|
-
* The time, in seconds, that the object has been in a proxy cache.
|
|
31
|
-
*/
|
|
32
|
-
HttpHeaders["Age"] = "Age";
|
|
33
|
-
/**
|
|
34
|
-
* Directives for caching mechanisms in both requests and responses.
|
|
35
|
-
*/
|
|
36
|
-
HttpHeaders["Cache_Control"] = "Cache-Control";
|
|
37
|
-
/**
|
|
38
|
-
* Clears browsing data (e.g. cookies, storage, cache) associated with the requesting website.
|
|
39
|
-
*/
|
|
40
|
-
HttpHeaders["Clear_Site_Data"] = "Clear-Site-Data";
|
|
41
|
-
/**
|
|
42
|
-
* The date/time after which the response is considered stale.
|
|
43
|
-
*/
|
|
44
|
-
HttpHeaders["Expires"] = "Expires";
|
|
45
|
-
/**
|
|
46
|
-
* Implementation-specific header that may have various effects anywhere along the request-response chain.
|
|
47
|
-
* Used for backwards compatibility with HTTP/1.0 caches where the Cache-Control header is not yet present.
|
|
48
|
-
*/
|
|
49
|
-
HttpHeaders["Pragma"] = "Pragma";
|
|
50
|
-
/* *** Conditionals *** */
|
|
51
|
-
/**
|
|
52
|
-
* The last modification date of the resource, used to compare several versions of the same resource.
|
|
53
|
-
* It is less accurate than ETag, but easier to calculate in some environments.
|
|
54
|
-
* Conditional requests using If-Modified-Since and If-Unmodified-Since
|
|
55
|
-
* use this value to change the behavior of the request.
|
|
56
|
-
*/
|
|
57
|
-
HttpHeaders["Last_Modified"] = "Last-Modified";
|
|
58
|
-
/**
|
|
59
|
-
* A unique string identifying the version of the resource.
|
|
60
|
-
* Conditional requests using If-Match and If-None-Match use this value to change the behavior of the request.
|
|
61
|
-
*/
|
|
62
|
-
HttpHeaders["ETag"] = "ETag";
|
|
63
|
-
/**
|
|
64
|
-
* Makes the request conditional, and applies the method only if the stored resource matches one of the given ETags.
|
|
65
|
-
*/
|
|
66
|
-
HttpHeaders["If_Match"] = "If-Match";
|
|
67
|
-
/**
|
|
68
|
-
* Makes the request conditional, and applies the method only if the stored resource doesn't match
|
|
69
|
-
* any of the given ETags. This is used to update caches (for safe requests), or to prevent uploading
|
|
70
|
-
* a new resource when one already exists.
|
|
71
|
-
*/
|
|
72
|
-
HttpHeaders["If_None_Match"] = "If-None-Match";
|
|
73
|
-
/**
|
|
74
|
-
* Makes the request conditional, and expects the resource to be transmitted only if it has been modified
|
|
75
|
-
* after the given date. This is used to transmit data only when the cache is out of date.
|
|
76
|
-
*/
|
|
77
|
-
HttpHeaders["If_Modified_Since"] = "If-Modified-Since";
|
|
78
|
-
/**
|
|
79
|
-
* Makes the request conditional, and expects the resource to be transmitted only if
|
|
80
|
-
* it has not been modified after the given date. This ensures the coherence of a new
|
|
81
|
-
* fragment of a specific range with previous ones, or to implement an optimistic
|
|
82
|
-
* concurrency control system when modifying existing documents.
|
|
83
|
-
*/
|
|
84
|
-
HttpHeaders["If_Unmodified_Since"] = "If-Unmodified-Since";
|
|
85
|
-
/**
|
|
86
|
-
* Determines how to match request headers to decide whether a cached response can be used
|
|
87
|
-
* rather than requesting a fresh one from the origin server.
|
|
88
|
-
*/
|
|
89
|
-
HttpHeaders["Vary"] = "Vary";
|
|
90
|
-
/* *** Connection management *** */
|
|
91
|
-
/**
|
|
92
|
-
* Controls whether the network connection stays open after the current transaction finishes.
|
|
93
|
-
*/
|
|
94
|
-
HttpHeaders["Connection"] = "Connection";
|
|
95
|
-
/**
|
|
96
|
-
* Controls how long a persistent connection should stay open.
|
|
97
|
-
*/
|
|
98
|
-
HttpHeaders["Keep_Alive"] = "Keep-Alive";
|
|
99
|
-
// Content negotiation
|
|
100
|
-
/**
|
|
101
|
-
* Informs the server about the types of data that can be sent back.
|
|
102
|
-
*/
|
|
103
|
-
HttpHeaders["Accept"] = "Accept";
|
|
104
|
-
/**
|
|
105
|
-
* The encoding algorithm, usually a compression algorithm, that can be used on the resource sent back.
|
|
106
|
-
*/
|
|
107
|
-
HttpHeaders["Accept_Encoding"] = "Accept-Encoding";
|
|
108
|
-
/**
|
|
109
|
-
* Informs the server about the human language the server is expected to send back.
|
|
110
|
-
* This is a hint and is not necessarily under the full control of the user:
|
|
111
|
-
* the server should always pay attention not to override an explicit user choice
|
|
112
|
-
* (like selecting a language from a dropdown).
|
|
113
|
-
*/
|
|
114
|
-
HttpHeaders["Accept_Language"] = "Accept-Language";
|
|
115
|
-
/* *** Controls *** */
|
|
116
|
-
/**
|
|
117
|
-
* Indicates expectations that need to be fulfilled by the server to properly handle the request.
|
|
118
|
-
*/
|
|
119
|
-
HttpHeaders["Expect"] = "Expect";
|
|
120
|
-
/* *** Cookies *** */
|
|
121
|
-
/**
|
|
122
|
-
* Contains stored HTTP cookies previously sent by the server with the Set-Cookie header.
|
|
123
|
-
*/
|
|
124
|
-
HttpHeaders["Cookie"] = "Cookie";
|
|
125
|
-
/**
|
|
126
|
-
* Send cookies from the server to the user-agent.
|
|
127
|
-
*/
|
|
128
|
-
HttpHeaders["Set_Cookie"] = "Set-Cookie";
|
|
129
|
-
/* *** CORS *** */
|
|
130
|
-
/**
|
|
131
|
-
* Indicates whether the response can be shared.
|
|
132
|
-
*/
|
|
133
|
-
HttpHeaders["Access_Control_Allow_Origin"] = "Access-Control-Allow-Origin";
|
|
134
|
-
/**
|
|
135
|
-
* Indicates whether the response to the request can be exposed when the credentials flag is true.
|
|
136
|
-
*/
|
|
137
|
-
HttpHeaders["Access_Control_Allow_Credentials"] = "Access-Control-Allow-Credentials";
|
|
138
|
-
/**
|
|
139
|
-
* Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request.
|
|
140
|
-
*/
|
|
141
|
-
HttpHeaders["Access_Control_Allow_Headers"] = "Access-Control-Allow-Headers";
|
|
142
|
-
/**
|
|
143
|
-
* Specifies the methods allowed when accessing the resource in response to a preflight request.
|
|
144
|
-
*/
|
|
145
|
-
HttpHeaders["Access_Control_Allow_Methods"] = "Access-Control-Allow-Methods";
|
|
146
|
-
/**
|
|
147
|
-
* Indicates which headers can be exposed as part of the response by listing their names.
|
|
148
|
-
*/
|
|
149
|
-
HttpHeaders["Access_Control_Expose_Headers"] = "Access-Control-Expose-Headers";
|
|
150
|
-
/**
|
|
151
|
-
* Indicates how long the results of a preflight request can be cached.
|
|
152
|
-
*/
|
|
153
|
-
HttpHeaders["Access_Control_Max_Age"] = "Access-Control-Max-Age";
|
|
154
|
-
/**
|
|
155
|
-
* Used when issuing a preflight request to let the server know which HTTP headers will be
|
|
156
|
-
* used when the actual request is made.
|
|
157
|
-
*/
|
|
158
|
-
HttpHeaders["Access_Control_Request_Headers"] = "Access-Control-Request-Headers";
|
|
159
|
-
/**
|
|
160
|
-
* Used when issuing a preflight request to let the server know which HTTP method
|
|
161
|
-
* will be used when the actual request is made.
|
|
162
|
-
*/
|
|
163
|
-
HttpHeaders["Access_Control_Request_Method"] = "Access-Control-Request-Method";
|
|
164
|
-
/**
|
|
165
|
-
* Indicates where a fetch originates from.
|
|
166
|
-
*/
|
|
167
|
-
HttpHeaders["Origin"] = "Origin";
|
|
168
|
-
/**
|
|
169
|
-
* Specifies origins that are allowed to see values of attributes retrieved via features of the Resource Timing API,
|
|
170
|
-
* which would otherwise be reported as zero due to cross-origin restrictions.
|
|
171
|
-
*/
|
|
172
|
-
HttpHeaders["Timing_Allow_Origin"] = "Timing-Allow-Origin";
|
|
173
|
-
/* *** Downloads *** */
|
|
174
|
-
/**
|
|
175
|
-
* Indicates if the resource transmitted should be displayed inline (default behavior without the header),
|
|
176
|
-
* or if it should be handled like a download and the browser should present a "Save As" dialog.
|
|
177
|
-
*/
|
|
178
|
-
HttpHeaders["Content_Disposition"] = "Content-Disposition";
|
|
179
|
-
/* *** Message body information *** */
|
|
180
|
-
/**
|
|
181
|
-
* The size of the resource, in decimal number of bytes.
|
|
182
|
-
*/
|
|
183
|
-
HttpHeaders["Content_Length"] = "Content-Length";
|
|
184
|
-
/**
|
|
185
|
-
* Indicates the media type of the resource.
|
|
186
|
-
*/
|
|
187
|
-
HttpHeaders["Content_Type"] = "Content-Type";
|
|
188
|
-
/**
|
|
189
|
-
* Used to specify the compression algorithm.
|
|
190
|
-
*/
|
|
191
|
-
HttpHeaders["Content_Encoding"] = "Content-Encoding";
|
|
192
|
-
/**
|
|
193
|
-
* Describes the human language(s) intended for the audience, so that it allows a user to
|
|
194
|
-
* differentiate according to the users' own preferred language.
|
|
195
|
-
*/
|
|
196
|
-
HttpHeaders["Content_Language"] = "Content-Language";
|
|
197
|
-
/**
|
|
198
|
-
* Indicates an alternate location for the returned data.
|
|
199
|
-
*/
|
|
200
|
-
HttpHeaders["Content_Location"] = "Content-Location";
|
|
201
|
-
// Proxies
|
|
202
|
-
/**
|
|
203
|
-
* Contains information from the client-facing side of proxy servers that is altered or
|
|
204
|
-
* lost when a proxy is involved in the path of the request.
|
|
205
|
-
*/
|
|
206
|
-
HttpHeaders["Forwarded"] = "Forwarded";
|
|
207
|
-
/**
|
|
208
|
-
* Identifies the originating IP addresses of a client connecting to a web server
|
|
209
|
-
* through an HTTP proxy or a load balancer.
|
|
210
|
-
*/
|
|
211
|
-
HttpHeaders["X_Forwarded_For"] = "X-Forwarded-For";
|
|
212
|
-
/**
|
|
213
|
-
* Identifies the original host requested that a client used to connect to your proxy or load balancer.
|
|
214
|
-
*/
|
|
215
|
-
HttpHeaders["X_Forwarded_Host"] = "X-Forwarded-Host";
|
|
216
|
-
/**
|
|
217
|
-
* Identifies the protocol (HTTP or HTTPS) that a client used to connect to your proxy or load balancer.
|
|
218
|
-
*/
|
|
219
|
-
HttpHeaders["X_Forwarded_Proto"] = "X-Forwarded-Proto";
|
|
220
|
-
/**
|
|
221
|
-
* Added by proxies, both forward and reverse proxies, and can appear in the request headers and the response headers.
|
|
222
|
-
*/
|
|
223
|
-
HttpHeaders["Via"] = "Via";
|
|
224
|
-
/* *** Redirects *** */
|
|
225
|
-
/**
|
|
226
|
-
* Indicates the URL to redirect a page to.
|
|
227
|
-
*/
|
|
228
|
-
HttpHeaders["Location"] = "Location";
|
|
229
|
-
/* *** Request context *** */
|
|
230
|
-
/**
|
|
231
|
-
* Contains an Internet email address for a human user who controls the requesting user agent.
|
|
232
|
-
*/
|
|
233
|
-
HttpHeaders["From"] = "From";
|
|
234
|
-
/**
|
|
235
|
-
* Specifies the domain name of the server (for virtual hosting), and (optionally)
|
|
236
|
-
* the TCP port number on which the server is listening.
|
|
237
|
-
*/
|
|
238
|
-
HttpHeaders["Host"] = "Host";
|
|
239
|
-
/**
|
|
240
|
-
* The address of the previous web page from which a link to the currently requested page was followed.
|
|
241
|
-
*/
|
|
242
|
-
HttpHeaders["Referer"] = "Referer";
|
|
243
|
-
/**
|
|
244
|
-
* Governs which referrer information sent in the Referer header should be included with requests made.
|
|
245
|
-
*/
|
|
246
|
-
HttpHeaders["Referrer_Policy"] = "Referrer-Policy";
|
|
247
|
-
/**
|
|
248
|
-
* Contains a characteristic string that allows the network protocol peers to identify the application type,
|
|
249
|
-
* operating system, software vendor or software version of the requesting software user agent.
|
|
250
|
-
*/
|
|
251
|
-
HttpHeaders["User_Agent"] = "User-Agent";
|
|
252
|
-
/* *** Response context *** */
|
|
253
|
-
/**
|
|
254
|
-
* Lists the set of HTTP request methods supported by a resource.
|
|
255
|
-
*/
|
|
256
|
-
HttpHeaders["Allow"] = "Allow";
|
|
257
|
-
/**
|
|
258
|
-
* Contains information about the software used by the origin server to handle the request.
|
|
259
|
-
*/
|
|
260
|
-
HttpHeaders["Server"] = "Server";
|
|
261
|
-
/* *** Range requests *** */
|
|
262
|
-
/**
|
|
263
|
-
* Indicates if the server supports range requests, and if so in which unit the range can be expressed.
|
|
264
|
-
*/
|
|
265
|
-
HttpHeaders["Accept_Ranges"] = "Accept-Ranges";
|
|
266
|
-
/**
|
|
267
|
-
* Indicates the part of a document that the server should return.
|
|
268
|
-
*/
|
|
269
|
-
HttpHeaders["Range"] = "Range";
|
|
270
|
-
/**
|
|
271
|
-
* Creates a conditional range request that is only fulfilled if the given etag or date matches
|
|
272
|
-
* the remote resource. Used to prevent downloading two ranges from incompatible version of the resource.
|
|
273
|
-
*/
|
|
274
|
-
HttpHeaders["If_Range"] = "If-Range";
|
|
275
|
-
/**
|
|
276
|
-
* Indicates where in a full body message a partial message belongs.
|
|
277
|
-
*/
|
|
278
|
-
HttpHeaders["Content_Range"] = "Content-Range";
|
|
279
|
-
/* *** Security *** */
|
|
280
|
-
/**
|
|
281
|
-
* Allows a server to declare an embedder policy for a given document.
|
|
282
|
-
*/
|
|
283
|
-
HttpHeaders["Cross_Origin_Embedder_Policy"] = "Cross-Origin-Embedder-Policy";
|
|
284
|
-
/**
|
|
285
|
-
* Prevents other domains from opening/controlling a window.
|
|
286
|
-
*/
|
|
287
|
-
HttpHeaders["Cross_Origin_Opener_Policy"] = "Cross-Origin-Opener-Policy";
|
|
288
|
-
/**
|
|
289
|
-
* Prevents other domains from reading the response of the resources to which this header is applied.
|
|
290
|
-
*/
|
|
291
|
-
HttpHeaders["Cross_Origin_Resource_Policy"] = "Cross-Origin-Resource-Policy";
|
|
292
|
-
/**
|
|
293
|
-
* Controls resources the user agent is allowed to load for a given page.
|
|
294
|
-
*/
|
|
295
|
-
HttpHeaders["Content_Security_Policy"] = "Content-Security-Policy";
|
|
296
|
-
/**
|
|
297
|
-
* Allows web developers to experiment with policies by monitoring, but not enforcing, their effects.
|
|
298
|
-
* These violation reports consist of JSON documents sent via an HTTP POST request to the specified URI.
|
|
299
|
-
*/
|
|
300
|
-
HttpHeaders["Content_Security_Policy_Report_Only"] = "Content-Security-Policy-Report-Only";
|
|
301
|
-
/**
|
|
302
|
-
* Allows sites to opt in to reporting and/or enforcement of Certificate Transparency requirements,
|
|
303
|
-
* which prevents the use of misissued certificates for that site from going unnoticed.
|
|
304
|
-
* When a site enables the Expect-CT header, they are requesting that Chrome check that
|
|
305
|
-
* any certificate for that site appears in public CT logs.
|
|
306
|
-
*/
|
|
307
|
-
HttpHeaders["Expect_CT"] = "Expect-CT";
|
|
308
|
-
/**
|
|
309
|
-
* Provides a mechanism to allow and deny the use of browser features in its own frame,
|
|
310
|
-
* and in iframes that it embeds.
|
|
311
|
-
*/
|
|
312
|
-
HttpHeaders["Feature_Policy"] = "Feature-Policy";
|
|
313
|
-
/**
|
|
314
|
-
* Force communication using HTTPS instead of HTTP.
|
|
315
|
-
*/
|
|
316
|
-
HttpHeaders["Strict_Transport_Security"] = "Strict-Transport-Security";
|
|
317
|
-
/**
|
|
318
|
-
* Sends a signal to the server expressing the client's preference for an encrypted and authenticated response,
|
|
319
|
-
* and that it can successfully handle the upgrade-insecure-requests directive.
|
|
320
|
-
*/
|
|
321
|
-
HttpHeaders["Upgrade_Insecure_Requests"] = "Upgrade-Insecure-Requests";
|
|
322
|
-
/**
|
|
323
|
-
* Disables MIME sniffing and forces browser to use the type given in Content-Type.
|
|
324
|
-
*/
|
|
325
|
-
HttpHeaders["X_Content_Type_Options"] = "X-Content-Type-Options";
|
|
326
|
-
/**
|
|
327
|
-
* The X-Download-Options HTTP header indicates that the browser (Internet Explorer)
|
|
328
|
-
* should not display the option to "Open" a file that has been downloaded from an application,
|
|
329
|
-
* to prevent phishing attacks as the file otherwise would gain access to execute in the context of the application.
|
|
330
|
-
*/
|
|
331
|
-
HttpHeaders["X_Download_Options"] = "X-Download-Options";
|
|
332
|
-
/**
|
|
333
|
-
* Indicates whether a browser should be allowed to render a page in a <frame>, <iframe>, <embed> or <object>.
|
|
334
|
-
*/
|
|
335
|
-
HttpHeaders["X_Frame_Options"] = "X-Frame-Options";
|
|
336
|
-
/**
|
|
337
|
-
* Specifies if a cross-domain policy file (crossdomain.xml) is allowed.
|
|
338
|
-
* The file may define a policy to grant clients, such as Adobe's Flash Player (now obsolete),
|
|
339
|
-
* Adobe Acrobat, Microsoft Silverlight (now obsolete), or Apache Flex,
|
|
340
|
-
* permission to handle data across domains that would otherwise be restricted
|
|
341
|
-
* due to the Same-Origin Policy. See the Cross-domain Policy File Specification for more information.
|
|
342
|
-
*/
|
|
343
|
-
HttpHeaders["X_Permitted_Cross_Domain_Policies"] = "X-Permitted-Cross-Domain-Policies";
|
|
344
|
-
/**
|
|
345
|
-
* May be set by hosting environments or other frameworks and contains information about
|
|
346
|
-
* them while not providing any usefulness to the application or its visitors.
|
|
347
|
-
* Unset this header to avoid exposing potential vulnerabilities.
|
|
348
|
-
*/
|
|
349
|
-
HttpHeaders["X_Powered_By"] = "X-Powered-By";
|
|
350
|
-
/**
|
|
351
|
-
* Enables cross-site scripting filtering.
|
|
352
|
-
*/
|
|
353
|
-
HttpHeaders["X_XSS_Protection"] = "X-XSS-Protection";
|
|
354
|
-
/* *** Transfer coding *** */
|
|
355
|
-
/**
|
|
356
|
-
* Specifies the form of encoding used to safely transfer the resource to the user.
|
|
357
|
-
*/
|
|
358
|
-
HttpHeaders["Transfer_Encoding"] = "Transfer-Encoding";
|
|
359
|
-
/**
|
|
360
|
-
* Specifies the transfer encodings the user agent is willing to accept.
|
|
361
|
-
*/
|
|
362
|
-
HttpHeaders["TE"] = "TE";
|
|
363
|
-
/**
|
|
364
|
-
* Allows the sender to include additional fields at the end of chunked message.
|
|
365
|
-
*/
|
|
366
|
-
HttpHeaders["Trailer"] = "Trailer";
|
|
367
|
-
/* *** WebSockets *** */
|
|
368
|
-
HttpHeaders["Sec_WebSocket_Key"] = "Sec-WebSocket-Key";
|
|
369
|
-
HttpHeaders["Sec_WebSocket_Extensions"] = "Sec-WebSocket-Extensions";
|
|
370
|
-
HttpHeaders["Sec_WebSocket_Accept"] = "Sec-WebSocket-Accept";
|
|
371
|
-
HttpHeaders["Sec_WebSocket_Protocol"] = "Sec-WebSocket-Protocol";
|
|
372
|
-
HttpHeaders["Sec_WebSocket_Version"] = "Sec-WebSocket-Version";
|
|
373
|
-
/* *** Other *** */
|
|
374
|
-
/**
|
|
375
|
-
* Contains the date and time at which the message was originated.
|
|
376
|
-
*/
|
|
377
|
-
HttpHeaders["Date"] = "Date";
|
|
378
|
-
/**
|
|
379
|
-
* Indicates how long the user agent should wait before making a follow-up request.
|
|
380
|
-
*/
|
|
381
|
-
HttpHeaders["Retry_After"] = "Retry-After";
|
|
382
|
-
/**
|
|
383
|
-
* Communicates one or more metrics and descriptions for the given request-response cycle.
|
|
384
|
-
*/
|
|
385
|
-
HttpHeaders["Server_Timing"] = "Server-Timing";
|
|
386
|
-
/**
|
|
387
|
-
* Controls DNS prefetching, a feature by which browsers proactively perform domain name
|
|
388
|
-
* resolution on both links that the user may choose to follow as well as URLs for items
|
|
389
|
-
* referenced by the document, including images, CSS, JavaScript, and so forth.
|
|
390
|
-
*/
|
|
391
|
-
HttpHeaders["X_DNS_Prefetch_Control"] = "X-DNS-Prefetch-Control";
|
|
392
|
-
})(HttpHeaders || (HttpHeaders = {}));
|
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#successful_responses
|
|
3
|
-
*/
|
|
4
|
-
export declare enum HttpStatus {
|
|
5
|
-
/**
|
|
6
|
-
* This interim response indicates that the client should continue the request or
|
|
7
|
-
* ignore the response if the request is already finished.
|
|
8
|
-
*/
|
|
9
|
-
CONTINUE = 100,
|
|
10
|
-
/**
|
|
11
|
-
* This code is sent in response to an Upgrade request header from the client and
|
|
12
|
-
* indicates the protocol the server is switching to.
|
|
13
|
-
*/
|
|
14
|
-
SWITCHING_PROTOCOLS = 101,
|
|
15
|
-
/**
|
|
16
|
-
* This code indicates that the server has received and is processing the request, but no response is available yet.
|
|
17
|
-
*/
|
|
18
|
-
PROCESSING = 102,
|
|
19
|
-
/**
|
|
20
|
-
* This status code is primarily intended to be used with the Link header, letting the user agent
|
|
21
|
-
* start preloading resources while the server prepares a response.
|
|
22
|
-
*/
|
|
23
|
-
EARLYHINTS = 103,
|
|
24
|
-
/**
|
|
25
|
-
* The request succeeded.
|
|
26
|
-
*/
|
|
27
|
-
OK = 200,
|
|
28
|
-
/**
|
|
29
|
-
* The request succeeded, and a new resource was created as a result.
|
|
30
|
-
* This is typically the response sent after POST requests, or some PUT requests.
|
|
31
|
-
*/
|
|
32
|
-
CREATED = 201,
|
|
33
|
-
/**
|
|
34
|
-
* The request has been received but not yet acted upon. It is noncommittal,
|
|
35
|
-
* since there is no way in HTTP to later send an asynchronous response indicating
|
|
36
|
-
* the outcome of the request. It is intended for cases where another process or
|
|
37
|
-
* server handles the request, or for batch processing.
|
|
38
|
-
*/
|
|
39
|
-
ACCEPTED = 202,
|
|
40
|
-
/**
|
|
41
|
-
* This response code means the returned metadata is not exactly the same as is available from
|
|
42
|
-
* the origin server, but is collected from a local or a third-party copy. This is mostly used
|
|
43
|
-
* for mirrors or backups of another resource. Except for that specific case, the 200 OK
|
|
44
|
-
* response is preferred to this status.
|
|
45
|
-
*/
|
|
46
|
-
NON_AUTHORITATIVE_INFORMATION = 203,
|
|
47
|
-
/**
|
|
48
|
-
* There is no content to send for this request, but the headers may be useful.
|
|
49
|
-
* The user agent may update its cached headers for this resource with the new ones.
|
|
50
|
-
*/
|
|
51
|
-
NO_CONTENT = 204,
|
|
52
|
-
/**
|
|
53
|
-
* Tells the user agent to reset the document which sent this request.
|
|
54
|
-
*/
|
|
55
|
-
RESET_CONTENT = 205,
|
|
56
|
-
/**
|
|
57
|
-
* This response code is used when the Range header is sent from the client to request only part of a resource.
|
|
58
|
-
*/
|
|
59
|
-
PARTIAL_CONTENT = 206,
|
|
60
|
-
/**
|
|
61
|
-
* The request has more than one possible response. The user agent or user should choose one of them.
|
|
62
|
-
* (There is no standardized way of choosing one of the responses, but HTML links to the possibilities
|
|
63
|
-
* are recommended so the user can pick.)
|
|
64
|
-
*/
|
|
65
|
-
AMBIGUOUS = 300,
|
|
66
|
-
/**
|
|
67
|
-
* The URL of the requested resource has been changed permanently. The new URL is given in the response.
|
|
68
|
-
*/
|
|
69
|
-
MOVED_PERMANENTLY = 301,
|
|
70
|
-
/**
|
|
71
|
-
* This response code means that the URI of requested resource has been changed temporarily.
|
|
72
|
-
* Further changes in the URI might be made in the future. Therefore, this same URI should
|
|
73
|
-
* be used by the client in future requests.
|
|
74
|
-
*/
|
|
75
|
-
FOUND = 302,
|
|
76
|
-
/**
|
|
77
|
-
* This is used for caching purposes. It tells the client that the response has not been modified,
|
|
78
|
-
* so the client can continue to use the same cached version of the response.
|
|
79
|
-
*/
|
|
80
|
-
SEE_OTHER = 303,
|
|
81
|
-
/**
|
|
82
|
-
*
|
|
83
|
-
*/
|
|
84
|
-
NOT_MODIFIED = 304,
|
|
85
|
-
/**
|
|
86
|
-
* The server sends this response to direct the client to get the requested resource at another
|
|
87
|
-
* URI with same method that was used in the prior request. This has the same semantics as
|
|
88
|
-
* the 302 Found HTTP response code, with the exception that the user agent must not change
|
|
89
|
-
* the HTTP method used: if a POST was used in the first request, a POST must be used in the second request.
|
|
90
|
-
*/
|
|
91
|
-
TEMPORARY_REDIRECT = 307,
|
|
92
|
-
/**
|
|
93
|
-
* This means that the resource is now permanently located at another URI, specified by the Location:
|
|
94
|
-
* HTTP Response header. This has the same semantics as the 301 Moved Permanently HTTP response code,
|
|
95
|
-
* with the exception that the user agent must not change the HTTP method used: if a POST was used
|
|
96
|
-
* in the first request, a POST must be used in the second request.
|
|
97
|
-
*/
|
|
98
|
-
PERMANENT_REDIRECT = 308,
|
|
99
|
-
/**
|
|
100
|
-
* The server cannot or will not process the request due to something that is perceived to be a client error
|
|
101
|
-
* (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
|
|
102
|
-
*/
|
|
103
|
-
BAD_REQUEST = 400,
|
|
104
|
-
/**
|
|
105
|
-
* Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated".
|
|
106
|
-
* That is, the client must authenticate itself to get the requested response.
|
|
107
|
-
*/
|
|
108
|
-
UNAUTHORIZED = 401,
|
|
109
|
-
/**
|
|
110
|
-
* This response code is reserved for future use. The initial aim for creating this code was using
|
|
111
|
-
* it for digital payment systems, however this status code is used very rarely and no standard convention exists.
|
|
112
|
-
*/
|
|
113
|
-
PAYMENT_REQUIRED = 402,
|
|
114
|
-
/**
|
|
115
|
-
* The client does not have access rights to the content; that is, it is unauthorized,
|
|
116
|
-
* so the server is refusing to give the requested resource. Unlike 401 Unauthorized,
|
|
117
|
-
* the client's identity is known to the server.
|
|
118
|
-
*/
|
|
119
|
-
FORBIDDEN = 403,
|
|
120
|
-
/**
|
|
121
|
-
* The server can not find the requested resource. In the browser, this means the URL is not recognized.
|
|
122
|
-
* In an API, this can also mean that the endpoint is valid but the resource itself does not exist.
|
|
123
|
-
* Servers may also send this response instead of 403 Forbidden to hide the existence of a resource
|
|
124
|
-
* from an unauthorized client. This response code is probably the most well known due to its
|
|
125
|
-
* frequent occurrence on the web.
|
|
126
|
-
*/
|
|
127
|
-
NOT_FOUND = 404,
|
|
128
|
-
/**
|
|
129
|
-
* The request method is known by the server but is not supported by the target resource.
|
|
130
|
-
* For example, an API may not allow calling DELETE to remove a resource.
|
|
131
|
-
*/
|
|
132
|
-
METHOD_NOT_ALLOWED = 405,
|
|
133
|
-
/**
|
|
134
|
-
* This response is sent when the web server, after performing server-driven content negotiation,
|
|
135
|
-
* doesn't find any content that conforms to the criteria given by the user agent.
|
|
136
|
-
*/
|
|
137
|
-
NOT_ACCEPTABLE = 406,
|
|
138
|
-
/**
|
|
139
|
-
* This is similar to 401 Unauthorized but authentication is needed to be done by a proxy.
|
|
140
|
-
*/
|
|
141
|
-
PROXY_AUTHENTICATION_REQUIRED = 407,
|
|
142
|
-
/**
|
|
143
|
-
* This response is sent on an idle connection by some servers, even without any previous request by the client.
|
|
144
|
-
* It means that the server would like to shut down this unused connection.
|
|
145
|
-
* This response is used much more since some browsers,
|
|
146
|
-
* like Chrome, Firefox 27+, or IE9, use HTTP pre-connection mechanisms to speed up surfing.
|
|
147
|
-
* Also note that some servers merely shut down the connection without sending this message.
|
|
148
|
-
*/
|
|
149
|
-
REQUEST_TIMEOUT = 408,
|
|
150
|
-
/**
|
|
151
|
-
* This response is sent when a request conflicts with the current state of the server.
|
|
152
|
-
*/
|
|
153
|
-
CONFLICT = 409,
|
|
154
|
-
/**
|
|
155
|
-
* This response is sent when the requested content has been permanently deleted from server,
|
|
156
|
-
* with no forwarding address. Clients are expected to remove their caches and links to the resource.
|
|
157
|
-
* The HTTP specification intends this status code to be used for "limited-time, promotional services".
|
|
158
|
-
* APIs should not feel compelled to indicate resources that have been deleted with this status code.
|
|
159
|
-
*/
|
|
160
|
-
GONE = 410,
|
|
161
|
-
/**
|
|
162
|
-
* Server rejected the request because the Content-Length header field is not defined and the server requires it.
|
|
163
|
-
*/
|
|
164
|
-
LENGTH_REQUIRED = 411,
|
|
165
|
-
/**
|
|
166
|
-
* The client has indicated preconditions in its headers which the server does not meet.
|
|
167
|
-
*/
|
|
168
|
-
PRECONDITION_FAILED = 412,
|
|
169
|
-
/**
|
|
170
|
-
* Request entity is larger than limits defined by server. The server might close the connection or
|
|
171
|
-
* return an Retry-After header field.
|
|
172
|
-
*/
|
|
173
|
-
PAYLOAD_TOO_LARGE = 413,
|
|
174
|
-
/**
|
|
175
|
-
* The URI requested by the client is longer than the server is willing to interpret.
|
|
176
|
-
*/
|
|
177
|
-
URI_TOO_LONG = 414,
|
|
178
|
-
/**
|
|
179
|
-
* The media format of the requested data is not supported by the server, so the server is rejecting the request.
|
|
180
|
-
*/
|
|
181
|
-
UNSUPPORTED_MEDIA_TYPE = 415,
|
|
182
|
-
/**
|
|
183
|
-
* The range specified by the Range header field in the request cannot be fulfilled.
|
|
184
|
-
* It's possible that the range is outside the size of the target URI's data.
|
|
185
|
-
*/
|
|
186
|
-
REQUESTED_RANGE_NOT_SATISFIABLE = 416,
|
|
187
|
-
/**
|
|
188
|
-
* This response code means the expectation indicated by the Expect request header field cannot be met by the server.
|
|
189
|
-
*/
|
|
190
|
-
EXPECTATION_FAILED = 417,
|
|
191
|
-
/**
|
|
192
|
-
* The server refuses the attempt to brew coffee with a teapot.
|
|
193
|
-
*/
|
|
194
|
-
I_AM_A_TEAPOT = 418,
|
|
195
|
-
/**
|
|
196
|
-
* The request was directed at a server that is not able to produce a response.
|
|
197
|
-
* This can be sent by a server that is not configured to produce responses for
|
|
198
|
-
* the combination of scheme and authority that are included in the request URI.
|
|
199
|
-
*/
|
|
200
|
-
MISDIRECTED_REQUEST = 421,
|
|
201
|
-
/**
|
|
202
|
-
* The request was well-formed but was unable to be followed due to semantic errors.
|
|
203
|
-
*/
|
|
204
|
-
UNPROCESSABLE_ENTITY = 422,
|
|
205
|
-
/**
|
|
206
|
-
* The resource that is being accessed is locked.
|
|
207
|
-
*/
|
|
208
|
-
LOCKED = 423,
|
|
209
|
-
/**
|
|
210
|
-
* The request failed due to failure of a previous request.
|
|
211
|
-
*/
|
|
212
|
-
FAILED_DEPENDENCY = 424,
|
|
213
|
-
/**
|
|
214
|
-
* Indicates that the server is unwilling to risk processing a request that might be replayed.
|
|
215
|
-
*/
|
|
216
|
-
TOO_EARLY = 425,
|
|
217
|
-
/**
|
|
218
|
-
* The server refuses to perform the request using the current protocol but might be willing
|
|
219
|
-
* to do so after the client upgrades to a different protocol. The server sends an Upgrade
|
|
220
|
-
* header in a 426 response to indicate the required protocol(s).
|
|
221
|
-
*/
|
|
222
|
-
UPGRADE_REQUIRED = 428,
|
|
223
|
-
/**
|
|
224
|
-
* The origin server requires the request to be conditional. This response is intended to prevent
|
|
225
|
-
* the 'lost update' problem, where a client GETs a resource's state, modifies it and PUTs
|
|
226
|
-
* it back to the server, when meanwhile a third party has modified the state on the server,
|
|
227
|
-
* leading to a conflict.
|
|
228
|
-
*/
|
|
229
|
-
PRECONDITION_REQUIRED = 428,
|
|
230
|
-
/**
|
|
231
|
-
* The user has sent too many requests in a given amount of time ("rate limiting").
|
|
232
|
-
*/
|
|
233
|
-
TOO_MANY_REQUESTS = 429,
|
|
234
|
-
/**
|
|
235
|
-
* The server has encountered a situation it does not know how to handle.
|
|
236
|
-
*/
|
|
237
|
-
INTERNAL_SERVER_ERROR = 500,
|
|
238
|
-
/**
|
|
239
|
-
* The request method is not supported by the server and cannot be handled.
|
|
240
|
-
* The only methods that servers are required to support (and therefore that must not return this code)
|
|
241
|
-
* are GET and HEAD.
|
|
242
|
-
*/
|
|
243
|
-
NOT_IMPLEMENTED = 501,
|
|
244
|
-
/**
|
|
245
|
-
* This error response means that the server, while working as a gateway to get
|
|
246
|
-
* a response needed to handle the request, got an invalid response.
|
|
247
|
-
*/
|
|
248
|
-
BAD_GATEWAY = 502,
|
|
249
|
-
/**
|
|
250
|
-
* The server is not ready to handle the request. Common causes are a server that is down for maintenance
|
|
251
|
-
* or that is overloaded. Note that together with this response, a user-friendly page explaining
|
|
252
|
-
* the problem should be sent. This response should be used for temporary conditions and the
|
|
253
|
-
* Retry-After HTTP header should, if possible, contain the estimated time before the
|
|
254
|
-
* recovery of the service. The webmaster must also take care about the caching-related
|
|
255
|
-
* headers that are sent along with this response, as these temporary condition responses
|
|
256
|
-
* should usually not be cached.
|
|
257
|
-
*/
|
|
258
|
-
SERVICE_UNAVAILABLE = 503,
|
|
259
|
-
/**
|
|
260
|
-
* This error response is given when the server is acting as a gateway and cannot get a response in time.
|
|
261
|
-
*/
|
|
262
|
-
GATEWAY_TIMEOUT = 504,
|
|
263
|
-
/**
|
|
264
|
-
* The HTTP version used in the request is not supported by the server.
|
|
265
|
-
*/
|
|
266
|
-
HTTP_VERSION_NOT_SUPPORTED = 505,
|
|
267
|
-
/**
|
|
268
|
-
* The server has an internal configuration error: the chosen variant resource is configured
|
|
269
|
-
* to engage in transparent content negotiation itself, and is therefore not a proper end
|
|
270
|
-
* point in the negotiation process.
|
|
271
|
-
*/
|
|
272
|
-
VARIANT_ALSO_NEGOTIATES = 506,
|
|
273
|
-
/**
|
|
274
|
-
* The method could not be performed on the resource because the server is unable to store
|
|
275
|
-
* the representation needed to successfully complete the request.
|
|
276
|
-
*/
|
|
277
|
-
INSUFFICIENT_STORAGE = 507,
|
|
278
|
-
/**
|
|
279
|
-
* The server detected an infinite loop while processing the request.
|
|
280
|
-
*/
|
|
281
|
-
LOOP_DETECTED = 508,
|
|
282
|
-
/**
|
|
283
|
-
* Further extensions to the request are required for the server to fulfill it.
|
|
284
|
-
*/
|
|
285
|
-
NOT_EXTENDED = 510,
|
|
286
|
-
/**
|
|
287
|
-
* Indicates that the client needs to authenticate to gain network access.
|
|
288
|
-
*/
|
|
289
|
-
NETWORK_AUTHENTICATION_REQUIRED = 511
|
|
290
|
-
}
|