@opra/common 0.10.2 → 0.12.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.
Files changed (126) hide show
  1. package/cjs/filter/antlr/OpraFilterLexer.js +1 -1
  2. package/cjs/filter/antlr/OpraFilterListener.js +1 -1
  3. package/cjs/filter/antlr/OpraFilterParser.js +5 -5
  4. package/cjs/filter/antlr/OpraFilterVisitor.js +1 -1
  5. package/cjs/filter/filter-tree-visitor.js +8 -2
  6. package/cjs/filter/opra-error-listener.js +2 -2
  7. package/cjs/filter/parse.js +1 -1
  8. package/cjs/helpers/responsive-map.js +45 -28
  9. package/{esm/http/enums/http-headers.enum.js → cjs/http/enums/http-headers-codes.enum.js} +95 -92
  10. package/{esm/http/enums/http-status.enum.js → cjs/http/enums/http-status-codes.enum.js} +62 -59
  11. package/cjs/http/http-headers.js +213 -0
  12. package/cjs/http/http-param-codec.js +6 -0
  13. package/cjs/http/http-params.js +321 -0
  14. package/cjs/http/http-request-node.js +105 -0
  15. package/cjs/http/http-request.js +73 -88
  16. package/cjs/http/http-response.js +23 -0
  17. package/cjs/http/index.js +13 -2
  18. package/cjs/http/multipart/batch-multipart.js +12 -12
  19. package/cjs/http/param-codec/boolean-codec.js +25 -0
  20. package/cjs/http/param-codec/date-codec.js +44 -0
  21. package/cjs/http/param-codec/filter-codec.js +18 -0
  22. package/cjs/http/param-codec/integer-codec.js +19 -0
  23. package/cjs/http/param-codec/number-codec.js +26 -0
  24. package/cjs/http/param-codec/string-codec.js +25 -0
  25. package/cjs/http/utils/encodeURIParam.js +21 -0
  26. package/cjs/http/utils/normalize-headers.js +2 -2
  27. package/cjs/i18n/i18n.js +1 -4
  28. package/cjs/schema/implementation/opra-document.js +12 -11
  29. package/cjs/schema/implementation/resource/collection-resource-info.js +7 -0
  30. package/cjs/url/opra-url-path.js +96 -72
  31. package/cjs/url/opra-url-search-params.js +16 -234
  32. package/cjs/url/opra-url.js +201 -160
  33. package/esm/filter/antlr/OpraFilterLexer.d.ts +1 -1
  34. package/esm/filter/antlr/OpraFilterLexer.js +1 -1
  35. package/esm/filter/antlr/OpraFilterListener.d.ts +1 -1
  36. package/esm/filter/antlr/OpraFilterListener.js +1 -1
  37. package/esm/filter/antlr/OpraFilterParser.d.ts +1 -1
  38. package/esm/filter/antlr/OpraFilterParser.js +5 -5
  39. package/esm/filter/antlr/OpraFilterVisitor.d.ts +1 -1
  40. package/esm/filter/antlr/OpraFilterVisitor.js +1 -1
  41. package/esm/filter/ast/expressions/arithmetic-expression.d.ts +1 -1
  42. package/esm/filter/ast/expressions/comparison-expression.d.ts +1 -1
  43. package/esm/filter/ast/expressions/logical-expression.d.ts +1 -1
  44. package/esm/filter/build.d.ts +3 -3
  45. package/esm/filter/errors.d.ts +4 -2
  46. package/esm/filter/filter-tree-visitor.d.ts +2 -1
  47. package/esm/filter/filter-tree-visitor.js +8 -2
  48. package/esm/filter/opra-error-listener.d.ts +2 -2
  49. package/esm/filter/opra-error-listener.js +2 -2
  50. package/esm/filter/parse.d.ts +1 -1
  51. package/esm/filter/parse.js +1 -1
  52. package/esm/helpers/responsive-map.d.ts +19 -5
  53. package/esm/helpers/responsive-map.js +45 -28
  54. package/esm/http/enums/{http-headers.enum.d.ts → http-headers-codes.enum.d.ts} +1 -1
  55. package/{cjs/http/enums/http-headers.enum.js → esm/http/enums/http-headers-codes.enum.js} +92 -95
  56. package/esm/http/enums/{http-status.enum.d.ts → http-status-codes.enum.d.ts} +1 -1
  57. package/{cjs/http/enums/http-status.enum.js → esm/http/enums/http-status-codes.enum.js} +59 -62
  58. package/esm/http/http-headers.d.ts +70 -0
  59. package/esm/http/http-headers.js +209 -0
  60. package/esm/http/http-param-codec.d.ts +4 -0
  61. package/esm/http/http-param-codec.js +2 -0
  62. package/esm/http/http-params.d.ts +99 -0
  63. package/esm/http/http-params.js +317 -0
  64. package/esm/http/http-request-node.d.ts +34 -0
  65. package/esm/http/http-request-node.js +101 -0
  66. package/esm/http/http-request.d.ts +73 -31
  67. package/esm/http/http-request.js +72 -87
  68. package/esm/http/http-response.d.ts +41 -0
  69. package/esm/http/http-response.js +19 -0
  70. package/esm/http/index.d.ts +13 -2
  71. package/esm/http/index.js +13 -2
  72. package/esm/http/interfaces/client-http-headers.interface.d.ts +1 -1
  73. package/esm/http/interfaces/server-http-headers.interface.d.ts +1 -1
  74. package/esm/http/multipart/batch-multipart.d.ts +1 -1
  75. package/esm/http/multipart/batch-multipart.js +12 -12
  76. package/esm/http/multipart/http-request-content.d.ts +1 -1
  77. package/esm/http/multipart/http-response-content.d.ts +1 -1
  78. package/esm/http/param-codec/boolean-codec.d.ts +5 -0
  79. package/esm/http/param-codec/boolean-codec.js +21 -0
  80. package/esm/http/param-codec/date-codec.d.ts +16 -0
  81. package/esm/http/param-codec/date-codec.js +40 -0
  82. package/esm/http/param-codec/filter-codec.d.ts +6 -0
  83. package/esm/http/param-codec/filter-codec.js +14 -0
  84. package/esm/http/param-codec/integer-codec.d.ts +9 -0
  85. package/esm/http/param-codec/integer-codec.js +15 -0
  86. package/esm/http/param-codec/number-codec.d.ts +12 -0
  87. package/esm/http/param-codec/number-codec.js +22 -0
  88. package/esm/http/param-codec/string-codec.d.ts +14 -0
  89. package/esm/http/param-codec/string-codec.js +21 -0
  90. package/esm/http/utils/encodeURIParam.d.ts +1 -0
  91. package/esm/http/utils/encodeURIParam.js +17 -0
  92. package/esm/http/utils/normalize-headers.js +2 -2
  93. package/esm/i18n/i18n.d.ts +6 -6
  94. package/esm/i18n/i18n.js +1 -4
  95. package/esm/schema/decorators/opr-collection-resource.decorator.d.ts +1 -1
  96. package/esm/schema/decorators/opr-complex-type.decorator.d.ts +1 -1
  97. package/esm/schema/decorators/opr-simple-type.decorator.d.ts +1 -1
  98. package/esm/schema/decorators/opr-singleton-resource.decorator.d.ts +1 -1
  99. package/esm/schema/implementation/data-type/complex-type.d.ts +1 -1
  100. package/esm/schema/implementation/data-type/union-type.d.ts +1 -1
  101. package/esm/schema/implementation/document-builder.d.ts +1 -1
  102. package/esm/schema/implementation/opra-document.d.ts +2 -2
  103. package/esm/schema/implementation/opra-document.js +12 -11
  104. package/esm/schema/implementation/query/collection-count-query.d.ts +1 -1
  105. package/esm/schema/implementation/query/collection-create-query.d.ts +1 -1
  106. package/esm/schema/implementation/query/collection-delete-many-query.d.ts +1 -1
  107. package/esm/schema/implementation/query/collection-get-query.d.ts +1 -1
  108. package/esm/schema/implementation/query/collection-search-query.d.ts +1 -1
  109. package/esm/schema/implementation/query/collection-update-many-query.d.ts +1 -1
  110. package/esm/schema/implementation/query/collection-update-query.d.ts +1 -1
  111. package/esm/schema/implementation/query/field-get-query.d.ts +1 -1
  112. package/esm/schema/implementation/query/index.d.ts +4 -4
  113. package/esm/schema/implementation/query/singleton-get-query.d.ts +1 -1
  114. package/esm/schema/implementation/resource/collection-resource-info.d.ts +2 -0
  115. package/esm/schema/implementation/resource/collection-resource-info.js +7 -0
  116. package/esm/schema/interfaces/data-type.metadata.d.ts +4 -4
  117. package/esm/schema/interfaces/resource.metadata.d.ts +9 -9
  118. package/esm/schema/types.d.ts +8 -8
  119. package/esm/url/opra-url-path-component.d.ts +1 -1
  120. package/esm/url/opra-url-path.d.ts +24 -18
  121. package/esm/url/opra-url-path.js +96 -72
  122. package/esm/url/opra-url-search-params.d.ts +3 -42
  123. package/esm/url/opra-url-search-params.js +16 -234
  124. package/esm/url/opra-url.d.ts +38 -28
  125. package/esm/url/opra-url.js +201 -160
  126. package/package.json +12 -12
@@ -1,55 +1,52 @@
1
- "use strict";
2
1
  // noinspection JSUnusedGlobalSymbols
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.HttpHeaders = void 0;
5
2
  /**
6
3
  * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers#controls
7
4
  */
8
- var HttpHeaders;
9
- (function (HttpHeaders) {
5
+ export var HttpHeaderCodes;
6
+ (function (HttpHeaderCodes) {
10
7
  /* *** Custom Headers *** */
11
- HttpHeaders["X_Opra_Version"] = "X-Opra-Version";
12
- HttpHeaders["X_Opra_DataType"] = "X-Opra-DataType";
13
- HttpHeaders["X_Opra_Count"] = "X-Opra-Count";
8
+ HttpHeaderCodes["X_Opra_Version"] = "X-Opra-Version";
9
+ HttpHeaderCodes["X_Opra_DataType"] = "X-Opra-DataType";
10
+ HttpHeaderCodes["X_Opra_Count"] = "X-Opra-Count";
14
11
  /* *** Authentication *** */
15
12
  /**
16
13
  * Defines the authentication method that should be used to access a resource.
17
14
  */
18
- HttpHeaders["WWW_Authenticate"] = "WWW-Authenticate";
15
+ HttpHeaderCodes["WWW_Authenticate"] = "WWW-Authenticate";
19
16
  /**
20
17
  * Contains the credentials to authenticate a user-agent with a server.
21
18
  */
22
- HttpHeaders["Authorization"] = "Authorization";
19
+ HttpHeaderCodes["Authorization"] = "Authorization";
23
20
  /**
24
21
  * Defines the authentication method that should be used to access a resource behind a proxy server.
25
22
  */
26
- HttpHeaders["Proxy_Authenticate"] = "Proxy-Authenticate";
23
+ HttpHeaderCodes["Proxy_Authenticate"] = "Proxy-Authenticate";
27
24
  /**
28
25
  * Contains the credentials to authenticate a user agent with a proxy server.
29
26
  */
30
- HttpHeaders["Proxy_Authorization"] = "Proxy-Authorization";
27
+ HttpHeaderCodes["Proxy_Authorization"] = "Proxy-Authorization";
31
28
  /* *** Caching *** */
32
29
  /**
33
30
  * The time, in seconds, that the object has been in a proxy cache.
34
31
  */
35
- HttpHeaders["Age"] = "Age";
32
+ HttpHeaderCodes["Age"] = "Age";
36
33
  /**
37
34
  * Directives for caching mechanisms in both requests and responses.
38
35
  */
39
- HttpHeaders["Cache_Control"] = "Cache-Control";
36
+ HttpHeaderCodes["Cache_Control"] = "Cache-Control";
40
37
  /**
41
38
  * Clears browsing data (e.g. cookies, storage, cache) associated with the requesting website.
42
39
  */
43
- HttpHeaders["Clear_Site_Data"] = "Clear-Site-Data";
40
+ HttpHeaderCodes["Clear_Site_Data"] = "Clear-Site-Data";
44
41
  /**
45
42
  * The date/time after which the response is considered stale.
46
43
  */
47
- HttpHeaders["Expires"] = "Expires";
44
+ HttpHeaderCodes["Expires"] = "Expires";
48
45
  /**
49
46
  * Implementation-specific header that may have various effects anywhere along the request-response chain.
50
47
  * Used for backwards compatibility with HTTP/1.0 caches where the Cache-Control header is not yet present.
51
48
  */
52
- HttpHeaders["Pragma"] = "Pragma";
49
+ HttpHeaderCodes["Pragma"] = "Pragma";
53
50
  /* *** Conditionals *** */
54
51
  /**
55
52
  * The last modification date of the resource, used to compare several versions of the same resource.
@@ -57,294 +54,294 @@ var HttpHeaders;
57
54
  * Conditional requests using If-Modified-Since and If-Unmodified-Since
58
55
  * use this value to change the behavior of the request.
59
56
  */
60
- HttpHeaders["Last_Modified"] = "Last-Modified";
57
+ HttpHeaderCodes["Last_Modified"] = "Last-Modified";
61
58
  /**
62
59
  * A unique string identifying the version of the resource.
63
60
  * Conditional requests using If-Match and If-None-Match use this value to change the behavior of the request.
64
61
  */
65
- HttpHeaders["ETag"] = "ETag";
62
+ HttpHeaderCodes["ETag"] = "ETag";
66
63
  /**
67
64
  * Makes the request conditional, and applies the method only if the stored resource matches one of the given ETags.
68
65
  */
69
- HttpHeaders["If_Match"] = "If-Match";
66
+ HttpHeaderCodes["If_Match"] = "If-Match";
70
67
  /**
71
68
  * Makes the request conditional, and applies the method only if the stored resource doesn't match
72
69
  * any of the given ETags. This is used to update caches (for safe requests), or to prevent uploading
73
70
  * a new resource when one already exists.
74
71
  */
75
- HttpHeaders["If_None_Match"] = "If-None-Match";
72
+ HttpHeaderCodes["If_None_Match"] = "If-None-Match";
76
73
  /**
77
74
  * Makes the request conditional, and expects the resource to be transmitted only if it has been modified
78
75
  * after the given date. This is used to transmit data only when the cache is out of date.
79
76
  */
80
- HttpHeaders["If_Modified_Since"] = "If-Modified-Since";
77
+ HttpHeaderCodes["If_Modified_Since"] = "If-Modified-Since";
81
78
  /**
82
79
  * Makes the request conditional, and expects the resource to be transmitted only if
83
80
  * it has not been modified after the given date. This ensures the coherence of a new
84
81
  * fragment of a specific range with previous ones, or to implement an optimistic
85
82
  * concurrency control system when modifying existing documents.
86
83
  */
87
- HttpHeaders["If_Unmodified_Since"] = "If-Unmodified-Since";
84
+ HttpHeaderCodes["If_Unmodified_Since"] = "If-Unmodified-Since";
88
85
  /**
89
86
  * Determines how to match request headers to decide whether a cached response can be used
90
87
  * rather than requesting a fresh one from the origin server.
91
88
  */
92
- HttpHeaders["Vary"] = "Vary";
89
+ HttpHeaderCodes["Vary"] = "Vary";
93
90
  /* *** Connection management *** */
94
91
  /**
95
92
  * Controls whether the network connection stays open after the current transaction finishes.
96
93
  */
97
- HttpHeaders["Connection"] = "Connection";
94
+ HttpHeaderCodes["Connection"] = "Connection";
98
95
  /**
99
96
  * Controls how long a persistent connection should stay open.
100
97
  */
101
- HttpHeaders["Keep_Alive"] = "Keep-Alive";
98
+ HttpHeaderCodes["Keep_Alive"] = "Keep-Alive";
102
99
  // Content negotiation
103
100
  /**
104
101
  * Informs the server about the types of data that can be sent back.
105
102
  */
106
- HttpHeaders["Accept"] = "Accept";
103
+ HttpHeaderCodes["Accept"] = "Accept";
107
104
  /**
108
105
  * The encoding algorithm, usually a compression algorithm, that can be used on the resource sent back.
109
106
  */
110
- HttpHeaders["Accept_Encoding"] = "Accept-Encoding";
107
+ HttpHeaderCodes["Accept_Encoding"] = "Accept-Encoding";
111
108
  /**
112
109
  * Informs the server about the human language the server is expected to send back.
113
110
  * This is a hint and is not necessarily under the full control of the user:
114
111
  * the server should always pay attention not to override an explicit user choice
115
112
  * (like selecting a language from a dropdown).
116
113
  */
117
- HttpHeaders["Accept_Language"] = "Accept-Language";
114
+ HttpHeaderCodes["Accept_Language"] = "Accept-Language";
118
115
  /* *** Controls *** */
119
116
  /**
120
117
  * Indicates expectations that need to be fulfilled by the server to properly handle the request.
121
118
  */
122
- HttpHeaders["Expect"] = "Expect";
119
+ HttpHeaderCodes["Expect"] = "Expect";
123
120
  /* *** Cookies *** */
124
121
  /**
125
122
  * Contains stored HTTP cookies previously sent by the server with the Set-Cookie header.
126
123
  */
127
- HttpHeaders["Cookie"] = "Cookie";
124
+ HttpHeaderCodes["Cookie"] = "Cookie";
128
125
  /**
129
126
  * Send cookies from the server to the user-agent.
130
127
  */
131
- HttpHeaders["Set_Cookie"] = "Set-Cookie";
128
+ HttpHeaderCodes["Set_Cookie"] = "Set-Cookie";
132
129
  /* *** CORS *** */
133
130
  /**
134
131
  * Indicates whether the response can be shared.
135
132
  */
136
- HttpHeaders["Access_Control_Allow_Origin"] = "Access-Control-Allow-Origin";
133
+ HttpHeaderCodes["Access_Control_Allow_Origin"] = "Access-Control-Allow-Origin";
137
134
  /**
138
135
  * Indicates whether the response to the request can be exposed when the credentials flag is true.
139
136
  */
140
- HttpHeaders["Access_Control_Allow_Credentials"] = "Access-Control-Allow-Credentials";
137
+ HttpHeaderCodes["Access_Control_Allow_Credentials"] = "Access-Control-Allow-Credentials";
141
138
  /**
142
139
  * Used in response to a preflight request to indicate which HTTP headers can be used when making the actual request.
143
140
  */
144
- HttpHeaders["Access_Control_Allow_Headers"] = "Access-Control-Allow-Headers";
141
+ HttpHeaderCodes["Access_Control_Allow_Headers"] = "Access-Control-Allow-Headers";
145
142
  /**
146
143
  * Specifies the methods allowed when accessing the resource in response to a preflight request.
147
144
  */
148
- HttpHeaders["Access_Control_Allow_Methods"] = "Access-Control-Allow-Methods";
145
+ HttpHeaderCodes["Access_Control_Allow_Methods"] = "Access-Control-Allow-Methods";
149
146
  /**
150
147
  * Indicates which headers can be exposed as part of the response by listing their names.
151
148
  */
152
- HttpHeaders["Access_Control_Expose_Headers"] = "Access-Control-Expose-Headers";
149
+ HttpHeaderCodes["Access_Control_Expose_Headers"] = "Access-Control-Expose-Headers";
153
150
  /**
154
151
  * Indicates how long the results of a preflight request can be cached.
155
152
  */
156
- HttpHeaders["Access_Control_Max_Age"] = "Access-Control-Max-Age";
153
+ HttpHeaderCodes["Access_Control_Max_Age"] = "Access-Control-Max-Age";
157
154
  /**
158
155
  * Used when issuing a preflight request to let the server know which HTTP headers will be
159
156
  * used when the actual request is made.
160
157
  */
161
- HttpHeaders["Access_Control_Request_Headers"] = "Access-Control-Request-Headers";
158
+ HttpHeaderCodes["Access_Control_Request_Headers"] = "Access-Control-Request-Headers";
162
159
  /**
163
160
  * Used when issuing a preflight request to let the server know which HTTP method
164
161
  * will be used when the actual request is made.
165
162
  */
166
- HttpHeaders["Access_Control_Request_Method"] = "Access-Control-Request-Method";
163
+ HttpHeaderCodes["Access_Control_Request_Method"] = "Access-Control-Request-Method";
167
164
  /**
168
165
  * Indicates where a fetch originates from.
169
166
  */
170
- HttpHeaders["Origin"] = "Origin";
167
+ HttpHeaderCodes["Origin"] = "Origin";
171
168
  /**
172
169
  * Specifies origins that are allowed to see values of attributes retrieved via features of the Resource Timing API,
173
170
  * which would otherwise be reported as zero due to cross-origin restrictions.
174
171
  */
175
- HttpHeaders["Timing_Allow_Origin"] = "Timing-Allow-Origin";
172
+ HttpHeaderCodes["Timing_Allow_Origin"] = "Timing-Allow-Origin";
176
173
  /* *** Downloads *** */
177
174
  /**
178
175
  * Indicates if the resource transmitted should be displayed inline (default behavior without the header),
179
176
  * or if it should be handled like a download and the browser should present a "Save As" dialog.
180
177
  */
181
- HttpHeaders["Content_Disposition"] = "Content-Disposition";
178
+ HttpHeaderCodes["Content_Disposition"] = "Content-Disposition";
182
179
  /* *** Message body information *** */
183
180
  /**
184
181
  * Indicates to uniquely identifies MIME entities in several contexts.
185
182
  */
186
- HttpHeaders["Content_ID"] = "Content-ID";
183
+ HttpHeaderCodes["Content_ID"] = "Content-ID";
187
184
  /**
188
185
  * The size of the resource, in decimal number of bytes.
189
186
  */
190
- HttpHeaders["Content_Length"] = "Content-Length";
187
+ HttpHeaderCodes["Content_Length"] = "Content-Length";
191
188
  /**
192
189
  * Indicates the media type of the resource.
193
190
  */
194
- HttpHeaders["Content_Type"] = "Content-Type";
191
+ HttpHeaderCodes["Content_Type"] = "Content-Type";
195
192
  /**
196
193
  * Indicates to specify how a MIME message or body part has been encoded,
197
194
  * so that it can be decoded by its recipient.
198
195
  */
199
- HttpHeaders["Content_Transfer_Encoding"] = "Content-Transfer-Encoding";
196
+ HttpHeaderCodes["Content_Transfer_Encoding"] = "Content-Transfer-Encoding";
200
197
  /**
201
198
  * Used to specify the compression algorithm.
202
199
  */
203
- HttpHeaders["Content_Encoding"] = "Content-Encoding";
200
+ HttpHeaderCodes["Content_Encoding"] = "Content-Encoding";
204
201
  /**
205
202
  * Describes the human language(s) intended for the audience, so that it allows a user to
206
203
  * differentiate according to the users' own preferred language.
207
204
  */
208
- HttpHeaders["Content_Language"] = "Content-Language";
205
+ HttpHeaderCodes["Content_Language"] = "Content-Language";
209
206
  /**
210
207
  * Indicates an alternate location for the returned data.
211
208
  */
212
- HttpHeaders["Content_Location"] = "Content-Location";
209
+ HttpHeaderCodes["Content_Location"] = "Content-Location";
213
210
  // Proxies
214
211
  /**
215
212
  * Contains information from the client-facing side of proxy servers that is altered or
216
213
  * lost when a proxy is involved in the path of the request.
217
214
  */
218
- HttpHeaders["Forwarded"] = "Forwarded";
215
+ HttpHeaderCodes["Forwarded"] = "Forwarded";
219
216
  /**
220
217
  * Identifies the originating IP addresses of a client connecting to a web server
221
218
  * through an HTTP proxy or a load balancer.
222
219
  */
223
- HttpHeaders["X_Forwarded_For"] = "X-Forwarded-For";
220
+ HttpHeaderCodes["X_Forwarded_For"] = "X-Forwarded-For";
224
221
  /**
225
222
  * Identifies the original host requested that a client used to connect to your proxy or load balancer.
226
223
  */
227
- HttpHeaders["X_Forwarded_Host"] = "X-Forwarded-Host";
224
+ HttpHeaderCodes["X_Forwarded_Host"] = "X-Forwarded-Host";
228
225
  /**
229
226
  * Identifies the protocol (HTTP or HTTPS) that a client used to connect to your proxy or load balancer.
230
227
  */
231
- HttpHeaders["X_Forwarded_Proto"] = "X-Forwarded-Proto";
228
+ HttpHeaderCodes["X_Forwarded_Proto"] = "X-Forwarded-Proto";
232
229
  /**
233
230
  * Added by proxies, both forward and reverse proxies, and can appear in the request headers and the response headers.
234
231
  */
235
- HttpHeaders["Via"] = "Via";
232
+ HttpHeaderCodes["Via"] = "Via";
236
233
  /* *** Redirects *** */
237
234
  /**
238
235
  * Indicates the URL to redirect a page to.
239
236
  */
240
- HttpHeaders["Location"] = "Location";
237
+ HttpHeaderCodes["Location"] = "Location";
241
238
  /* *** Request context *** */
242
239
  /**
243
240
  * Contains an Internet email address for a human user who controls the requesting user agent.
244
241
  */
245
- HttpHeaders["From"] = "From";
242
+ HttpHeaderCodes["From"] = "From";
246
243
  /**
247
244
  * Specifies the domain name of the server (for virtual hosting), and (optionally)
248
245
  * the TCP port number on which the server is listening.
249
246
  */
250
- HttpHeaders["Host"] = "Host";
247
+ HttpHeaderCodes["Host"] = "Host";
251
248
  /**
252
249
  * The address of the previous web page from which a link to the currently requested page was followed.
253
250
  */
254
- HttpHeaders["Referer"] = "Referer";
251
+ HttpHeaderCodes["Referer"] = "Referer";
255
252
  /**
256
253
  * Governs which referrer information sent in the Referer header should be included with requests made.
257
254
  */
258
- HttpHeaders["Referrer_Policy"] = "Referrer-Policy";
255
+ HttpHeaderCodes["Referrer_Policy"] = "Referrer-Policy";
259
256
  /**
260
257
  * Contains a characteristic string that allows the network protocol peers to identify the application type,
261
258
  * operating system, software vendor or software version of the requesting software user agent.
262
259
  */
263
- HttpHeaders["User_Agent"] = "User-Agent";
260
+ HttpHeaderCodes["User_Agent"] = "User-Agent";
264
261
  /* *** Response context *** */
265
262
  /**
266
263
  * Lists the set of HTTP request methods supported by a resource.
267
264
  */
268
- HttpHeaders["Allow"] = "Allow";
265
+ HttpHeaderCodes["Allow"] = "Allow";
269
266
  /**
270
267
  * Contains information about the software used by the origin server to handle the request.
271
268
  */
272
- HttpHeaders["Server"] = "Server";
269
+ HttpHeaderCodes["Server"] = "Server";
273
270
  /* *** Range requests *** */
274
271
  /**
275
272
  * Indicates if the server supports range requests, and if so in which unit the range can be expressed.
276
273
  */
277
- HttpHeaders["Accept_Ranges"] = "Accept-Ranges";
274
+ HttpHeaderCodes["Accept_Ranges"] = "Accept-Ranges";
278
275
  /**
279
276
  * Indicates the part of a document that the server should return.
280
277
  */
281
- HttpHeaders["Range"] = "Range";
278
+ HttpHeaderCodes["Range"] = "Range";
282
279
  /**
283
280
  * Creates a conditional range request that is only fulfilled if the given etag or date matches
284
281
  * the remote resource. Used to prevent downloading two ranges from incompatible version of the resource.
285
282
  */
286
- HttpHeaders["If_Range"] = "If-Range";
283
+ HttpHeaderCodes["If_Range"] = "If-Range";
287
284
  /**
288
285
  * Indicates where in a full body message a partial message belongs.
289
286
  */
290
- HttpHeaders["Content_Range"] = "Content-Range";
287
+ HttpHeaderCodes["Content_Range"] = "Content-Range";
291
288
  /* *** Security *** */
292
289
  /**
293
290
  * Allows a server to declare an embedder policy for a given document.
294
291
  */
295
- HttpHeaders["Cross_Origin_Embedder_Policy"] = "Cross-Origin-Embedder-Policy";
292
+ HttpHeaderCodes["Cross_Origin_Embedder_Policy"] = "Cross-Origin-Embedder-Policy";
296
293
  /**
297
294
  * Prevents other domains from opening/controlling a window.
298
295
  */
299
- HttpHeaders["Cross_Origin_Opener_Policy"] = "Cross-Origin-Opener-Policy";
296
+ HttpHeaderCodes["Cross_Origin_Opener_Policy"] = "Cross-Origin-Opener-Policy";
300
297
  /**
301
298
  * Prevents other domains from reading the response of the resources to which this header is applied.
302
299
  */
303
- HttpHeaders["Cross_Origin_Resource_Policy"] = "Cross-Origin-Resource-Policy";
300
+ HttpHeaderCodes["Cross_Origin_Resource_Policy"] = "Cross-Origin-Resource-Policy";
304
301
  /**
305
302
  * Controls resources the user agent is allowed to load for a given page.
306
303
  */
307
- HttpHeaders["Content_Security_Policy"] = "Content-Security-Policy";
304
+ HttpHeaderCodes["Content_Security_Policy"] = "Content-Security-Policy";
308
305
  /**
309
306
  * Allows web developers to experiment with policies by monitoring, but not enforcing, their effects.
310
307
  * These violation reports consist of JSON documents sent via an HTTP POST request to the specified URI.
311
308
  */
312
- HttpHeaders["Content_Security_Policy_Report_Only"] = "Content-Security-Policy-Report-Only";
309
+ HttpHeaderCodes["Content_Security_Policy_Report_Only"] = "Content-Security-Policy-Report-Only";
313
310
  /**
314
311
  * Allows sites to opt in to reporting and/or enforcement of Certificate Transparency requirements,
315
312
  * which prevents the use of misissued certificates for that site from going unnoticed.
316
313
  * When a site enables the Expect-CT header, they are requesting that Chrome check that
317
314
  * any certificate for that site appears in public CT logs.
318
315
  */
319
- HttpHeaders["Expect_CT"] = "Expect-CT";
316
+ HttpHeaderCodes["Expect_CT"] = "Expect-CT";
320
317
  /**
321
318
  * Provides a mechanism to allow and deny the use of browser features in its own frame,
322
319
  * and in iframes that it embeds.
323
320
  */
324
- HttpHeaders["Feature_Policy"] = "Feature-Policy";
321
+ HttpHeaderCodes["Feature_Policy"] = "Feature-Policy";
325
322
  /**
326
323
  * Force communication using HTTPS instead of HTTP.
327
324
  */
328
- HttpHeaders["Strict_Transport_Security"] = "Strict-Transport-Security";
325
+ HttpHeaderCodes["Strict_Transport_Security"] = "Strict-Transport-Security";
329
326
  /**
330
327
  * Sends a signal to the server expressing the client's preference for an encrypted and authenticated response,
331
328
  * and that it can successfully handle the upgrade-insecure-requests directive.
332
329
  */
333
- HttpHeaders["Upgrade_Insecure_Requests"] = "Upgrade-Insecure-Requests";
330
+ HttpHeaderCodes["Upgrade_Insecure_Requests"] = "Upgrade-Insecure-Requests";
334
331
  /**
335
332
  * Disables MIME sniffing and forces browser to use the type given in Content-Type.
336
333
  */
337
- HttpHeaders["X_Content_Type_Options"] = "X-Content-Type-Options";
334
+ HttpHeaderCodes["X_Content_Type_Options"] = "X-Content-Type-Options";
338
335
  /**
339
336
  * The X-Download-Options HTTP header indicates that the browser (Internet Explorer)
340
337
  * should not display the option to "Open" a file that has been downloaded from an application,
341
338
  * to prevent phishing attacks as the file otherwise would gain access to execute in the context of the application.
342
339
  */
343
- HttpHeaders["X_Download_Options"] = "X-Download-Options";
340
+ HttpHeaderCodes["X_Download_Options"] = "X-Download-Options";
344
341
  /**
345
342
  * Indicates whether a browser should be allowed to render a page in a <frame>, <iframe>, <embed> or <object>.
346
343
  */
347
- HttpHeaders["X_Frame_Options"] = "X-Frame-Options";
344
+ HttpHeaderCodes["X_Frame_Options"] = "X-Frame-Options";
348
345
  /**
349
346
  * Specifies if a cross-domain policy file (crossdomain.xml) is allowed.
350
347
  * The file may define a policy to grant clients, such as Adobe's Flash Player (now obsolete),
@@ -352,53 +349,53 @@ var HttpHeaders;
352
349
  * permission to handle data across domains that would otherwise be restricted
353
350
  * due to the Same-Origin Policy. See the Cross-domain Policy File Specification for more information.
354
351
  */
355
- HttpHeaders["X_Permitted_Cross_Domain_Policies"] = "X-Permitted-Cross-Domain-Policies";
352
+ HttpHeaderCodes["X_Permitted_Cross_Domain_Policies"] = "X-Permitted-Cross-Domain-Policies";
356
353
  /**
357
354
  * May be set by hosting environments or other frameworks and contains information about
358
355
  * them while not providing any usefulness to the application or its visitors.
359
356
  * Unset this header to avoid exposing potential vulnerabilities.
360
357
  */
361
- HttpHeaders["X_Powered_By"] = "X-Powered-By";
358
+ HttpHeaderCodes["X_Powered_By"] = "X-Powered-By";
362
359
  /**
363
360
  * Enables cross-site scripting filtering.
364
361
  */
365
- HttpHeaders["X_XSS_Protection"] = "X-XSS-Protection";
362
+ HttpHeaderCodes["X_XSS_Protection"] = "X-XSS-Protection";
366
363
  /* *** Transfer coding *** */
367
364
  /**
368
365
  * Specifies the form of encoding used to safely transfer the resource to the user.
369
366
  */
370
- HttpHeaders["Transfer_Encoding"] = "Transfer-Encoding";
367
+ HttpHeaderCodes["Transfer_Encoding"] = "Transfer-Encoding";
371
368
  /**
372
369
  * Specifies the transfer encodings the user agent is willing to accept.
373
370
  */
374
- HttpHeaders["TE"] = "TE";
371
+ HttpHeaderCodes["TE"] = "TE";
375
372
  /**
376
373
  * Allows the sender to include additional fields at the end of chunked message.
377
374
  */
378
- HttpHeaders["Trailer"] = "Trailer";
375
+ HttpHeaderCodes["Trailer"] = "Trailer";
379
376
  /* *** WebSockets *** */
380
- HttpHeaders["Sec_WebSocket_Key"] = "Sec-WebSocket-Key";
381
- HttpHeaders["Sec_WebSocket_Extensions"] = "Sec-WebSocket-Extensions";
382
- HttpHeaders["Sec_WebSocket_Accept"] = "Sec-WebSocket-Accept";
383
- HttpHeaders["Sec_WebSocket_Protocol"] = "Sec-WebSocket-Protocol";
384
- HttpHeaders["Sec_WebSocket_Version"] = "Sec-WebSocket-Version";
377
+ HttpHeaderCodes["Sec_WebSocket_Key"] = "Sec-WebSocket-Key";
378
+ HttpHeaderCodes["Sec_WebSocket_Extensions"] = "Sec-WebSocket-Extensions";
379
+ HttpHeaderCodes["Sec_WebSocket_Accept"] = "Sec-WebSocket-Accept";
380
+ HttpHeaderCodes["Sec_WebSocket_Protocol"] = "Sec-WebSocket-Protocol";
381
+ HttpHeaderCodes["Sec_WebSocket_Version"] = "Sec-WebSocket-Version";
385
382
  /* *** Other *** */
386
383
  /**
387
384
  * Contains the date and time at which the message was originated.
388
385
  */
389
- HttpHeaders["Date"] = "Date";
386
+ HttpHeaderCodes["Date"] = "Date";
390
387
  /**
391
388
  * Indicates how long the user agent should wait before making a follow-up request.
392
389
  */
393
- HttpHeaders["Retry_After"] = "Retry-After";
390
+ HttpHeaderCodes["Retry_After"] = "Retry-After";
394
391
  /**
395
392
  * Communicates one or more metrics and descriptions for the given request-response cycle.
396
393
  */
397
- HttpHeaders["Server_Timing"] = "Server-Timing";
394
+ HttpHeaderCodes["Server_Timing"] = "Server-Timing";
398
395
  /**
399
396
  * Controls DNS prefetching, a feature by which browsers proactively perform domain name
400
397
  * resolution on both links that the user may choose to follow as well as URLs for items
401
398
  * referenced by the document, including images, CSS, JavaScript, and so forth.
402
399
  */
403
- HttpHeaders["X_DNS_Prefetch_Control"] = "X-DNS-Prefetch-Control";
404
- })(HttpHeaders = exports.HttpHeaders || (exports.HttpHeaders = {}));
400
+ HttpHeaderCodes["X_DNS_Prefetch_Control"] = "X-DNS-Prefetch-Control";
401
+ })(HttpHeaderCodes || (HttpHeaderCodes = {}));
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#successful_responses
3
3
  */
4
- export declare enum HttpStatus {
4
+ export declare enum HttpStatusCodes {
5
5
  /**
6
6
  * This interim response indicates that the client should continue the request or
7
7
  * ignore the response if the request is already finished.