@webex/http-core 3.0.0-beta.8 → 3.0.0-beta.80
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/README.md +0 -1
- package/dist/http-error-subtypes.js +2 -147
- package/dist/http-error-subtypes.js.map +1 -1
- package/dist/http-error.js +9 -38
- package/dist/http-error.js.map +1 -1
- package/dist/index.js +5 -29
- package/dist/index.js.map +1 -1
- package/dist/interceptors/http-status.js +7 -30
- package/dist/interceptors/http-status.js.map +1 -1
- package/dist/lib/detect.js +28 -48
- package/dist/lib/detect.js.map +1 -1
- package/dist/lib/interceptor.js +7 -23
- package/dist/lib/interceptor.js.map +1 -1
- package/dist/lib/xhr.js +44 -93
- package/dist/lib/xhr.js.map +1 -1
- package/dist/progress-event.js +0 -7
- package/dist/progress-event.js.map +1 -1
- package/dist/request/index.js +1 -15
- package/dist/request/index.js.map +1 -1
- package/dist/request/request.js +5 -23
- package/dist/request/request.js.map +1 -1
- package/dist/request/request.shim.js +38 -90
- package/dist/request/request.shim.js.map +1 -1
- package/package.json +10 -10
- package/src/http-error-subtypes.js +1 -1
- package/src/http-error.js +15 -23
- package/src/index.js +4 -9
- package/src/interceptors/http-status.js +7 -5
- package/src/lib/detect.js +0 -1
- package/src/lib/interceptor.js +2 -4
- package/src/lib/xhr.js +197 -194
- package/src/progress-event.js +10 -5
- package/src/request/request.js +16 -14
- package/src/request/request.shim.js +47 -38
- package/test/integration/spec/http-error.js +11 -11
- package/test/integration/spec/interceptor.js +20 -13
- package/test/integration/spec/progress-event.js +8 -8
- package/test/integration/spec/request.js +135 -127
- package/test/unit/spec/interceptors/http-status.js +14 -11
package/README.md
CHANGED
|
@@ -51,7 +51,6 @@ Curried version of `request()` that produces an http client with overridden defa
|
|
|
51
51
|
|
|
52
52
|
Child of `Error` (by way of `Exception` from `@webex/common`). Has subclassed errors for each [official HTTP status code](https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html) (and 429 Too Man Requests).
|
|
53
53
|
|
|
54
|
-
|
|
55
54
|
## Maintainers
|
|
56
55
|
|
|
57
56
|
This package is maintained by [Cisco Webex for Developers](https://developer.webex.com/).
|
|
@@ -1,35 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _Reflect$construct = require("@babel/runtime-corejs2/core-js/reflect/construct");
|
|
4
|
-
|
|
5
4
|
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
6
|
-
|
|
7
5
|
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
8
|
-
|
|
9
6
|
_Object$defineProperty(exports, "__esModule", {
|
|
10
7
|
value: true
|
|
11
8
|
});
|
|
12
|
-
|
|
13
9
|
exports.default = makeSubTypes;
|
|
14
|
-
|
|
15
10
|
var _assign = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/assign"));
|
|
16
|
-
|
|
17
11
|
var _parseInt2 = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/parse-int"));
|
|
18
|
-
|
|
19
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
|
|
20
|
-
|
|
21
13
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
|
|
22
|
-
|
|
23
14
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
|
|
24
|
-
|
|
25
15
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
|
|
26
|
-
|
|
27
16
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
|
|
28
|
-
|
|
29
17
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
30
|
-
|
|
31
18
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
32
|
-
|
|
33
19
|
/*!
|
|
34
20
|
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
35
21
|
*/
|
|
@@ -44,442 +30,313 @@ function makeSubTypes(Base) {
|
|
|
44
30
|
*/
|
|
45
31
|
var NetworkOrCORSError = /*#__PURE__*/function (_Base) {
|
|
46
32
|
(0, _inherits2.default)(NetworkOrCORSError, _Base);
|
|
47
|
-
|
|
48
33
|
var _super = _createSuper(NetworkOrCORSError);
|
|
49
|
-
|
|
50
34
|
function NetworkOrCORSError() {
|
|
51
35
|
(0, _classCallCheck2.default)(this, NetworkOrCORSError);
|
|
52
36
|
return _super.apply(this, arguments);
|
|
53
37
|
}
|
|
54
|
-
|
|
55
38
|
return (0, _createClass2.default)(NetworkOrCORSError);
|
|
56
39
|
}(Base);
|
|
57
40
|
/**
|
|
58
41
|
* BadRequest
|
|
59
42
|
*/
|
|
60
|
-
|
|
61
|
-
|
|
62
43
|
var BadRequest = /*#__PURE__*/function (_Base2) {
|
|
63
44
|
(0, _inherits2.default)(BadRequest, _Base2);
|
|
64
|
-
|
|
65
45
|
var _super2 = _createSuper(BadRequest);
|
|
66
|
-
|
|
67
46
|
function BadRequest() {
|
|
68
47
|
(0, _classCallCheck2.default)(this, BadRequest);
|
|
69
48
|
return _super2.apply(this, arguments);
|
|
70
49
|
}
|
|
71
|
-
|
|
72
50
|
return (0, _createClass2.default)(BadRequest);
|
|
73
51
|
}(Base);
|
|
74
52
|
/**
|
|
75
53
|
* Unauthorized
|
|
76
54
|
*/
|
|
77
|
-
|
|
78
|
-
|
|
79
55
|
var Unauthorized = /*#__PURE__*/function (_BadRequest) {
|
|
80
56
|
(0, _inherits2.default)(Unauthorized, _BadRequest);
|
|
81
|
-
|
|
82
57
|
var _super3 = _createSuper(Unauthorized);
|
|
83
|
-
|
|
84
58
|
function Unauthorized() {
|
|
85
59
|
(0, _classCallCheck2.default)(this, Unauthorized);
|
|
86
60
|
return _super3.apply(this, arguments);
|
|
87
61
|
}
|
|
88
|
-
|
|
89
62
|
return (0, _createClass2.default)(Unauthorized);
|
|
90
63
|
}(BadRequest);
|
|
91
64
|
/**
|
|
92
65
|
* PaymentRequired
|
|
93
66
|
*/
|
|
94
|
-
|
|
95
|
-
|
|
96
67
|
var PaymentRequired = /*#__PURE__*/function (_BadRequest2) {
|
|
97
68
|
(0, _inherits2.default)(PaymentRequired, _BadRequest2);
|
|
98
|
-
|
|
99
69
|
var _super4 = _createSuper(PaymentRequired);
|
|
100
|
-
|
|
101
70
|
function PaymentRequired() {
|
|
102
71
|
(0, _classCallCheck2.default)(this, PaymentRequired);
|
|
103
72
|
return _super4.apply(this, arguments);
|
|
104
73
|
}
|
|
105
|
-
|
|
106
74
|
return (0, _createClass2.default)(PaymentRequired);
|
|
107
75
|
}(BadRequest);
|
|
108
76
|
/**
|
|
109
77
|
* Forbidden
|
|
110
78
|
*/
|
|
111
|
-
|
|
112
|
-
|
|
113
79
|
var Forbidden = /*#__PURE__*/function (_BadRequest3) {
|
|
114
80
|
(0, _inherits2.default)(Forbidden, _BadRequest3);
|
|
115
|
-
|
|
116
81
|
var _super5 = _createSuper(Forbidden);
|
|
117
|
-
|
|
118
82
|
function Forbidden() {
|
|
119
83
|
(0, _classCallCheck2.default)(this, Forbidden);
|
|
120
84
|
return _super5.apply(this, arguments);
|
|
121
85
|
}
|
|
122
|
-
|
|
123
86
|
return (0, _createClass2.default)(Forbidden);
|
|
124
87
|
}(BadRequest);
|
|
125
88
|
/**
|
|
126
89
|
* NotFound
|
|
127
90
|
*/
|
|
128
|
-
|
|
129
|
-
|
|
130
91
|
var NotFound = /*#__PURE__*/function (_BadRequest4) {
|
|
131
92
|
(0, _inherits2.default)(NotFound, _BadRequest4);
|
|
132
|
-
|
|
133
93
|
var _super6 = _createSuper(NotFound);
|
|
134
|
-
|
|
135
94
|
function NotFound() {
|
|
136
95
|
(0, _classCallCheck2.default)(this, NotFound);
|
|
137
96
|
return _super6.apply(this, arguments);
|
|
138
97
|
}
|
|
139
|
-
|
|
140
98
|
return (0, _createClass2.default)(NotFound);
|
|
141
99
|
}(BadRequest);
|
|
142
100
|
/**
|
|
143
101
|
* MethodNotAllowed
|
|
144
102
|
*/
|
|
145
|
-
|
|
146
|
-
|
|
147
103
|
var MethodNotAllowed = /*#__PURE__*/function (_BadRequest5) {
|
|
148
104
|
(0, _inherits2.default)(MethodNotAllowed, _BadRequest5);
|
|
149
|
-
|
|
150
105
|
var _super7 = _createSuper(MethodNotAllowed);
|
|
151
|
-
|
|
152
106
|
function MethodNotAllowed() {
|
|
153
107
|
(0, _classCallCheck2.default)(this, MethodNotAllowed);
|
|
154
108
|
return _super7.apply(this, arguments);
|
|
155
109
|
}
|
|
156
|
-
|
|
157
110
|
return (0, _createClass2.default)(MethodNotAllowed);
|
|
158
111
|
}(BadRequest);
|
|
159
112
|
/**
|
|
160
113
|
* NotAcceptable
|
|
161
114
|
*/
|
|
162
|
-
|
|
163
|
-
|
|
164
115
|
var NotAcceptable = /*#__PURE__*/function (_BadRequest6) {
|
|
165
116
|
(0, _inherits2.default)(NotAcceptable, _BadRequest6);
|
|
166
|
-
|
|
167
117
|
var _super8 = _createSuper(NotAcceptable);
|
|
168
|
-
|
|
169
118
|
function NotAcceptable() {
|
|
170
119
|
(0, _classCallCheck2.default)(this, NotAcceptable);
|
|
171
120
|
return _super8.apply(this, arguments);
|
|
172
121
|
}
|
|
173
|
-
|
|
174
122
|
return (0, _createClass2.default)(NotAcceptable);
|
|
175
123
|
}(BadRequest);
|
|
176
124
|
/**
|
|
177
125
|
* ProxyAuthenticationRequired
|
|
178
126
|
*/
|
|
179
|
-
|
|
180
|
-
|
|
181
127
|
var ProxyAuthenticationRequired = /*#__PURE__*/function (_BadRequest7) {
|
|
182
128
|
(0, _inherits2.default)(ProxyAuthenticationRequired, _BadRequest7);
|
|
183
|
-
|
|
184
129
|
var _super9 = _createSuper(ProxyAuthenticationRequired);
|
|
185
|
-
|
|
186
130
|
function ProxyAuthenticationRequired() {
|
|
187
131
|
(0, _classCallCheck2.default)(this, ProxyAuthenticationRequired);
|
|
188
132
|
return _super9.apply(this, arguments);
|
|
189
133
|
}
|
|
190
|
-
|
|
191
134
|
return (0, _createClass2.default)(ProxyAuthenticationRequired);
|
|
192
135
|
}(BadRequest);
|
|
193
136
|
/**
|
|
194
137
|
* RequestTimeout
|
|
195
138
|
*/
|
|
196
|
-
|
|
197
|
-
|
|
198
139
|
var RequestTimeout = /*#__PURE__*/function (_BadRequest8) {
|
|
199
140
|
(0, _inherits2.default)(RequestTimeout, _BadRequest8);
|
|
200
|
-
|
|
201
141
|
var _super10 = _createSuper(RequestTimeout);
|
|
202
|
-
|
|
203
142
|
function RequestTimeout() {
|
|
204
143
|
(0, _classCallCheck2.default)(this, RequestTimeout);
|
|
205
144
|
return _super10.apply(this, arguments);
|
|
206
145
|
}
|
|
207
|
-
|
|
208
146
|
return (0, _createClass2.default)(RequestTimeout);
|
|
209
147
|
}(BadRequest);
|
|
210
148
|
/**
|
|
211
149
|
* Conflict
|
|
212
150
|
*/
|
|
213
|
-
|
|
214
|
-
|
|
215
151
|
var Conflict = /*#__PURE__*/function (_BadRequest9) {
|
|
216
152
|
(0, _inherits2.default)(Conflict, _BadRequest9);
|
|
217
|
-
|
|
218
153
|
var _super11 = _createSuper(Conflict);
|
|
219
|
-
|
|
220
154
|
function Conflict() {
|
|
221
155
|
(0, _classCallCheck2.default)(this, Conflict);
|
|
222
156
|
return _super11.apply(this, arguments);
|
|
223
157
|
}
|
|
224
|
-
|
|
225
158
|
return (0, _createClass2.default)(Conflict);
|
|
226
159
|
}(BadRequest);
|
|
227
160
|
/**
|
|
228
161
|
* Gone
|
|
229
162
|
*/
|
|
230
|
-
|
|
231
|
-
|
|
232
163
|
var Gone = /*#__PURE__*/function (_BadRequest10) {
|
|
233
164
|
(0, _inherits2.default)(Gone, _BadRequest10);
|
|
234
|
-
|
|
235
165
|
var _super12 = _createSuper(Gone);
|
|
236
|
-
|
|
237
166
|
function Gone() {
|
|
238
167
|
(0, _classCallCheck2.default)(this, Gone);
|
|
239
168
|
return _super12.apply(this, arguments);
|
|
240
169
|
}
|
|
241
|
-
|
|
242
170
|
return (0, _createClass2.default)(Gone);
|
|
243
171
|
}(BadRequest);
|
|
244
172
|
/**
|
|
245
173
|
* LengthRequired
|
|
246
174
|
*/
|
|
247
|
-
|
|
248
|
-
|
|
249
175
|
var LengthRequired = /*#__PURE__*/function (_BadRequest11) {
|
|
250
176
|
(0, _inherits2.default)(LengthRequired, _BadRequest11);
|
|
251
|
-
|
|
252
177
|
var _super13 = _createSuper(LengthRequired);
|
|
253
|
-
|
|
254
178
|
function LengthRequired() {
|
|
255
179
|
(0, _classCallCheck2.default)(this, LengthRequired);
|
|
256
180
|
return _super13.apply(this, arguments);
|
|
257
181
|
}
|
|
258
|
-
|
|
259
182
|
return (0, _createClass2.default)(LengthRequired);
|
|
260
183
|
}(BadRequest);
|
|
261
184
|
/**
|
|
262
185
|
* PreconditionFailed
|
|
263
186
|
*/
|
|
264
|
-
|
|
265
|
-
|
|
266
187
|
var PreconditionFailed = /*#__PURE__*/function (_BadRequest12) {
|
|
267
188
|
(0, _inherits2.default)(PreconditionFailed, _BadRequest12);
|
|
268
|
-
|
|
269
189
|
var _super14 = _createSuper(PreconditionFailed);
|
|
270
|
-
|
|
271
190
|
function PreconditionFailed() {
|
|
272
191
|
(0, _classCallCheck2.default)(this, PreconditionFailed);
|
|
273
192
|
return _super14.apply(this, arguments);
|
|
274
193
|
}
|
|
275
|
-
|
|
276
194
|
return (0, _createClass2.default)(PreconditionFailed);
|
|
277
195
|
}(BadRequest);
|
|
278
196
|
/**
|
|
279
197
|
* RequestEntityTooLarge
|
|
280
198
|
*/
|
|
281
|
-
|
|
282
|
-
|
|
283
199
|
var RequestEntityTooLarge = /*#__PURE__*/function (_BadRequest13) {
|
|
284
200
|
(0, _inherits2.default)(RequestEntityTooLarge, _BadRequest13);
|
|
285
|
-
|
|
286
201
|
var _super15 = _createSuper(RequestEntityTooLarge);
|
|
287
|
-
|
|
288
202
|
function RequestEntityTooLarge() {
|
|
289
203
|
(0, _classCallCheck2.default)(this, RequestEntityTooLarge);
|
|
290
204
|
return _super15.apply(this, arguments);
|
|
291
205
|
}
|
|
292
|
-
|
|
293
206
|
return (0, _createClass2.default)(RequestEntityTooLarge);
|
|
294
207
|
}(BadRequest);
|
|
295
208
|
/**
|
|
296
209
|
* RequestUriTooLong
|
|
297
210
|
*/
|
|
298
|
-
|
|
299
|
-
|
|
300
211
|
var RequestUriTooLong = /*#__PURE__*/function (_BadRequest14) {
|
|
301
212
|
(0, _inherits2.default)(RequestUriTooLong, _BadRequest14);
|
|
302
|
-
|
|
303
213
|
var _super16 = _createSuper(RequestUriTooLong);
|
|
304
|
-
|
|
305
214
|
function RequestUriTooLong() {
|
|
306
215
|
(0, _classCallCheck2.default)(this, RequestUriTooLong);
|
|
307
216
|
return _super16.apply(this, arguments);
|
|
308
217
|
}
|
|
309
|
-
|
|
310
218
|
return (0, _createClass2.default)(RequestUriTooLong);
|
|
311
219
|
}(BadRequest);
|
|
312
220
|
/**
|
|
313
221
|
* UnsupportedMediaType
|
|
314
222
|
*/
|
|
315
|
-
|
|
316
|
-
|
|
317
223
|
var UnsupportedMediaType = /*#__PURE__*/function (_BadRequest15) {
|
|
318
224
|
(0, _inherits2.default)(UnsupportedMediaType, _BadRequest15);
|
|
319
|
-
|
|
320
225
|
var _super17 = _createSuper(UnsupportedMediaType);
|
|
321
|
-
|
|
322
226
|
function UnsupportedMediaType() {
|
|
323
227
|
(0, _classCallCheck2.default)(this, UnsupportedMediaType);
|
|
324
228
|
return _super17.apply(this, arguments);
|
|
325
229
|
}
|
|
326
|
-
|
|
327
230
|
return (0, _createClass2.default)(UnsupportedMediaType);
|
|
328
231
|
}(BadRequest);
|
|
329
232
|
/**
|
|
330
233
|
* RequestRangeNotSatisfiable
|
|
331
234
|
*/
|
|
332
|
-
|
|
333
|
-
|
|
334
235
|
var RequestRangeNotSatisfiable = /*#__PURE__*/function (_BadRequest16) {
|
|
335
236
|
(0, _inherits2.default)(RequestRangeNotSatisfiable, _BadRequest16);
|
|
336
|
-
|
|
337
237
|
var _super18 = _createSuper(RequestRangeNotSatisfiable);
|
|
338
|
-
|
|
339
238
|
function RequestRangeNotSatisfiable() {
|
|
340
239
|
(0, _classCallCheck2.default)(this, RequestRangeNotSatisfiable);
|
|
341
240
|
return _super18.apply(this, arguments);
|
|
342
241
|
}
|
|
343
|
-
|
|
344
242
|
return (0, _createClass2.default)(RequestRangeNotSatisfiable);
|
|
345
243
|
}(BadRequest);
|
|
346
244
|
/**
|
|
347
245
|
* ExpectationFailed
|
|
348
246
|
*/
|
|
349
|
-
|
|
350
|
-
|
|
351
247
|
var ExpectationFailed = /*#__PURE__*/function (_BadRequest17) {
|
|
352
248
|
(0, _inherits2.default)(ExpectationFailed, _BadRequest17);
|
|
353
|
-
|
|
354
249
|
var _super19 = _createSuper(ExpectationFailed);
|
|
355
|
-
|
|
356
250
|
function ExpectationFailed() {
|
|
357
251
|
(0, _classCallCheck2.default)(this, ExpectationFailed);
|
|
358
252
|
return _super19.apply(this, arguments);
|
|
359
253
|
}
|
|
360
|
-
|
|
361
254
|
return (0, _createClass2.default)(ExpectationFailed);
|
|
362
255
|
}(BadRequest);
|
|
363
256
|
/**
|
|
364
257
|
* TooManyRequests
|
|
365
258
|
*/
|
|
366
|
-
|
|
367
|
-
|
|
368
259
|
var TooManyRequests = /*#__PURE__*/function (_BadRequest18) {
|
|
369
260
|
(0, _inherits2.default)(TooManyRequests, _BadRequest18);
|
|
370
|
-
|
|
371
261
|
var _super20 = _createSuper(TooManyRequests);
|
|
372
|
-
|
|
373
262
|
function TooManyRequests() {
|
|
374
263
|
(0, _classCallCheck2.default)(this, TooManyRequests);
|
|
375
264
|
return _super20.apply(this, arguments);
|
|
376
265
|
}
|
|
377
|
-
|
|
378
266
|
return (0, _createClass2.default)(TooManyRequests);
|
|
379
267
|
}(BadRequest);
|
|
380
268
|
/**
|
|
381
269
|
* InternalServerError
|
|
382
270
|
*/
|
|
383
|
-
|
|
384
|
-
|
|
385
271
|
var InternalServerError = /*#__PURE__*/function (_Base3) {
|
|
386
272
|
(0, _inherits2.default)(InternalServerError, _Base3);
|
|
387
|
-
|
|
388
273
|
var _super21 = _createSuper(InternalServerError);
|
|
389
|
-
|
|
390
274
|
function InternalServerError() {
|
|
391
275
|
(0, _classCallCheck2.default)(this, InternalServerError);
|
|
392
276
|
return _super21.apply(this, arguments);
|
|
393
277
|
}
|
|
394
|
-
|
|
395
278
|
return (0, _createClass2.default)(InternalServerError);
|
|
396
279
|
}(Base);
|
|
397
280
|
/**
|
|
398
281
|
* NotImplemented
|
|
399
282
|
*/
|
|
400
|
-
|
|
401
|
-
|
|
402
283
|
var NotImplemented = /*#__PURE__*/function (_InternalServerError) {
|
|
403
284
|
(0, _inherits2.default)(NotImplemented, _InternalServerError);
|
|
404
|
-
|
|
405
285
|
var _super22 = _createSuper(NotImplemented);
|
|
406
|
-
|
|
407
286
|
function NotImplemented() {
|
|
408
287
|
(0, _classCallCheck2.default)(this, NotImplemented);
|
|
409
288
|
return _super22.apply(this, arguments);
|
|
410
289
|
}
|
|
411
|
-
|
|
412
290
|
return (0, _createClass2.default)(NotImplemented);
|
|
413
291
|
}(InternalServerError);
|
|
414
292
|
/**
|
|
415
293
|
* BadGateway
|
|
416
294
|
*/
|
|
417
|
-
|
|
418
|
-
|
|
419
295
|
var BadGateway = /*#__PURE__*/function (_InternalServerError2) {
|
|
420
296
|
(0, _inherits2.default)(BadGateway, _InternalServerError2);
|
|
421
|
-
|
|
422
297
|
var _super23 = _createSuper(BadGateway);
|
|
423
|
-
|
|
424
298
|
function BadGateway() {
|
|
425
299
|
(0, _classCallCheck2.default)(this, BadGateway);
|
|
426
300
|
return _super23.apply(this, arguments);
|
|
427
301
|
}
|
|
428
|
-
|
|
429
302
|
return (0, _createClass2.default)(BadGateway);
|
|
430
303
|
}(InternalServerError);
|
|
431
304
|
/**
|
|
432
305
|
* ServiceUnavailable
|
|
433
306
|
*/
|
|
434
|
-
|
|
435
|
-
|
|
436
307
|
var ServiceUnavailable = /*#__PURE__*/function (_InternalServerError3) {
|
|
437
308
|
(0, _inherits2.default)(ServiceUnavailable, _InternalServerError3);
|
|
438
|
-
|
|
439
309
|
var _super24 = _createSuper(ServiceUnavailable);
|
|
440
|
-
|
|
441
310
|
function ServiceUnavailable() {
|
|
442
311
|
(0, _classCallCheck2.default)(this, ServiceUnavailable);
|
|
443
312
|
return _super24.apply(this, arguments);
|
|
444
313
|
}
|
|
445
|
-
|
|
446
314
|
return (0, _createClass2.default)(ServiceUnavailable);
|
|
447
315
|
}(InternalServerError);
|
|
448
316
|
/**
|
|
449
317
|
* GatewayTimeout
|
|
450
318
|
*/
|
|
451
|
-
|
|
452
|
-
|
|
453
319
|
var GatewayTimeout = /*#__PURE__*/function (_InternalServerError4) {
|
|
454
320
|
(0, _inherits2.default)(GatewayTimeout, _InternalServerError4);
|
|
455
|
-
|
|
456
321
|
var _super25 = _createSuper(GatewayTimeout);
|
|
457
|
-
|
|
458
322
|
function GatewayTimeout() {
|
|
459
323
|
(0, _classCallCheck2.default)(this, GatewayTimeout);
|
|
460
324
|
return _super25.apply(this, arguments);
|
|
461
325
|
}
|
|
462
|
-
|
|
463
326
|
return (0, _createClass2.default)(GatewayTimeout);
|
|
464
327
|
}(InternalServerError);
|
|
465
328
|
/**
|
|
466
329
|
* HttpVersionNotSupported
|
|
467
330
|
*/
|
|
468
|
-
|
|
469
|
-
|
|
470
331
|
var HttpVersionNotSupported = /*#__PURE__*/function (_InternalServerError5) {
|
|
471
332
|
(0, _inherits2.default)(HttpVersionNotSupported, _InternalServerError5);
|
|
472
|
-
|
|
473
333
|
var _super26 = _createSuper(HttpVersionNotSupported);
|
|
474
|
-
|
|
475
334
|
function HttpVersionNotSupported() {
|
|
476
335
|
(0, _classCallCheck2.default)(this, HttpVersionNotSupported);
|
|
477
336
|
return _super26.apply(this, arguments);
|
|
478
337
|
}
|
|
479
|
-
|
|
480
338
|
return (0, _createClass2.default)(HttpVersionNotSupported);
|
|
481
339
|
}(InternalServerError);
|
|
482
|
-
|
|
483
340
|
(0, _assign.default)(Base, {
|
|
484
341
|
0: NetworkOrCORSError,
|
|
485
342
|
NetworkOrCORSError: NetworkOrCORSError,
|
|
@@ -537,15 +394,13 @@ function makeSubTypes(Base) {
|
|
|
537
394
|
if (typeof statusCode === 'undefined' || statusCode === null) {
|
|
538
395
|
return Base;
|
|
539
396
|
}
|
|
540
|
-
|
|
541
397
|
statusCode = statusCode.statusCode || statusCode;
|
|
542
398
|
var E = Base[statusCode];
|
|
543
|
-
|
|
544
399
|
if (E) {
|
|
545
400
|
return E;
|
|
546
|
-
}
|
|
547
|
-
|
|
401
|
+
}
|
|
548
402
|
|
|
403
|
+
// Fallback to the default for the category (e.g. BadRequest for 429)
|
|
549
404
|
statusCode = "".concat(statusCode.toString().split('').shift(), "00");
|
|
550
405
|
statusCode = (0, _parseInt2.default)(statusCode, 10);
|
|
551
406
|
return Base[statusCode] || Base;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["makeSubTypes","Base","NetworkOrCORSError","BadRequest","Unauthorized","PaymentRequired","Forbidden","NotFound","MethodNotAllowed","NotAcceptable","ProxyAuthenticationRequired","RequestTimeout","Conflict","Gone","LengthRequired","PreconditionFailed","RequestEntityTooLarge","RequestUriTooLong","UnsupportedMediaType","RequestRangeNotSatisfiable","ExpectationFailed","TooManyRequests","InternalServerError","NotImplemented","BadGateway","ServiceUnavailable","GatewayTimeout","HttpVersionNotSupported","select","statusCode","E","toString","split","shift"],"sources":["http-error-subtypes.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/**\n * @param {Error} Base\n * @returns {undefined}\n */\nexport default function makeSubTypes(Base) {\n /**\n * NetworkOrCORSError\n */\n class NetworkOrCORSError extends Base {}\n /**\n * BadRequest\n */\n class BadRequest extends Base {}\n /**\n * Unauthorized\n */\n class Unauthorized extends BadRequest {}\n /**\n * PaymentRequired\n */\n class PaymentRequired extends BadRequest {}\n /**\n * Forbidden\n */\n class Forbidden extends BadRequest {}\n /**\n * NotFound\n */\n class NotFound extends BadRequest {}\n /**\n * MethodNotAllowed\n */\n class MethodNotAllowed extends BadRequest {}\n /**\n * NotAcceptable\n */\n class NotAcceptable extends BadRequest {}\n /**\n * ProxyAuthenticationRequired\n */\n class ProxyAuthenticationRequired extends BadRequest {}\n /**\n * RequestTimeout\n */\n class RequestTimeout extends BadRequest {}\n /**\n * Conflict\n */\n class Conflict extends BadRequest {}\n /**\n * Gone\n */\n class Gone extends BadRequest {}\n /**\n * LengthRequired\n */\n class LengthRequired extends BadRequest {}\n /**\n * PreconditionFailed\n */\n class PreconditionFailed extends BadRequest {}\n /**\n * RequestEntityTooLarge\n */\n class RequestEntityTooLarge extends BadRequest {}\n /**\n * RequestUriTooLong\n */\n class RequestUriTooLong extends BadRequest {}\n /**\n * UnsupportedMediaType\n */\n class UnsupportedMediaType extends BadRequest {}\n /**\n * RequestRangeNotSatisfiable\n */\n class RequestRangeNotSatisfiable extends BadRequest {}\n /**\n * ExpectationFailed\n */\n class ExpectationFailed extends BadRequest {}\n /**\n * TooManyRequests\n */\n class TooManyRequests extends BadRequest {}\n /**\n * InternalServerError\n */\n class InternalServerError extends Base {}\n /**\n * NotImplemented\n */\n class NotImplemented extends InternalServerError {}\n /**\n * BadGateway\n */\n class BadGateway extends InternalServerError {}\n /**\n * ServiceUnavailable\n */\n class ServiceUnavailable extends InternalServerError {}\n /**\n * GatewayTimeout\n */\n class GatewayTimeout extends InternalServerError {}\n /**\n * HttpVersionNotSupported\n */\n class HttpVersionNotSupported extends InternalServerError {}\n\n Object.assign(Base, {\n 0: NetworkOrCORSError,\n NetworkOrCORSError,\n 400: BadRequest,\n BadRequest,\n 401: Unauthorized,\n Unauthorized,\n 402: PaymentRequired,\n PaymentRequired,\n 403: Forbidden,\n Forbidden,\n 404: NotFound,\n NotFound,\n 405: MethodNotAllowed,\n MethodNotAllowed,\n 406: NotAcceptable,\n NotAcceptable,\n 407: ProxyAuthenticationRequired,\n ProxyAuthenticationRequired,\n 408: RequestTimeout,\n RequestTimeout,\n 409: Conflict,\n Conflict,\n 410: Gone,\n Gone,\n 411: LengthRequired,\n LengthRequired,\n 412: PreconditionFailed,\n PreconditionFailed,\n 413: RequestEntityTooLarge,\n RequestEntityTooLarge,\n 414: RequestUriTooLong,\n RequestUriTooLong,\n 415: UnsupportedMediaType,\n UnsupportedMediaType,\n 416: RequestRangeNotSatisfiable,\n RequestRangeNotSatisfiable,\n 417: ExpectationFailed,\n ExpectationFailed,\n 429: TooManyRequests,\n TooManyRequests,\n 500: InternalServerError,\n InternalServerError,\n 501: NotImplemented,\n NotImplemented,\n 502: BadGateway,\n BadGateway,\n 503: ServiceUnavailable,\n ServiceUnavailable,\n 504: GatewayTimeout,\n GatewayTimeout,\n 505: HttpVersionNotSupported,\n HttpVersionNotSupported,\n select(statusCode) {\n if (typeof statusCode === 'undefined' || statusCode === null) {\n return Base;\n }\n\n statusCode = statusCode.statusCode || statusCode;\n const E = Base[statusCode];\n\n if (E) {\n return E;\n }\n\n // Fallback to the default for the category (e.g. BadRequest for 429)\n statusCode = `${statusCode.toString().split('').shift()}00`;\n statusCode = parseInt(statusCode, 10);\n\n return Base[statusCode] || Base;\n }
|
|
1
|
+
{"version":3,"names":["makeSubTypes","Base","NetworkOrCORSError","BadRequest","Unauthorized","PaymentRequired","Forbidden","NotFound","MethodNotAllowed","NotAcceptable","ProxyAuthenticationRequired","RequestTimeout","Conflict","Gone","LengthRequired","PreconditionFailed","RequestEntityTooLarge","RequestUriTooLong","UnsupportedMediaType","RequestRangeNotSatisfiable","ExpectationFailed","TooManyRequests","InternalServerError","NotImplemented","BadGateway","ServiceUnavailable","GatewayTimeout","HttpVersionNotSupported","select","statusCode","E","toString","split","shift"],"sources":["http-error-subtypes.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/**\n * @param {Error} Base\n * @returns {undefined}\n */\nexport default function makeSubTypes(Base) {\n /**\n * NetworkOrCORSError\n */\n class NetworkOrCORSError extends Base {}\n /**\n * BadRequest\n */\n class BadRequest extends Base {}\n /**\n * Unauthorized\n */\n class Unauthorized extends BadRequest {}\n /**\n * PaymentRequired\n */\n class PaymentRequired extends BadRequest {}\n /**\n * Forbidden\n */\n class Forbidden extends BadRequest {}\n /**\n * NotFound\n */\n class NotFound extends BadRequest {}\n /**\n * MethodNotAllowed\n */\n class MethodNotAllowed extends BadRequest {}\n /**\n * NotAcceptable\n */\n class NotAcceptable extends BadRequest {}\n /**\n * ProxyAuthenticationRequired\n */\n class ProxyAuthenticationRequired extends BadRequest {}\n /**\n * RequestTimeout\n */\n class RequestTimeout extends BadRequest {}\n /**\n * Conflict\n */\n class Conflict extends BadRequest {}\n /**\n * Gone\n */\n class Gone extends BadRequest {}\n /**\n * LengthRequired\n */\n class LengthRequired extends BadRequest {}\n /**\n * PreconditionFailed\n */\n class PreconditionFailed extends BadRequest {}\n /**\n * RequestEntityTooLarge\n */\n class RequestEntityTooLarge extends BadRequest {}\n /**\n * RequestUriTooLong\n */\n class RequestUriTooLong extends BadRequest {}\n /**\n * UnsupportedMediaType\n */\n class UnsupportedMediaType extends BadRequest {}\n /**\n * RequestRangeNotSatisfiable\n */\n class RequestRangeNotSatisfiable extends BadRequest {}\n /**\n * ExpectationFailed\n */\n class ExpectationFailed extends BadRequest {}\n /**\n * TooManyRequests\n */\n class TooManyRequests extends BadRequest {}\n /**\n * InternalServerError\n */\n class InternalServerError extends Base {}\n /**\n * NotImplemented\n */\n class NotImplemented extends InternalServerError {}\n /**\n * BadGateway\n */\n class BadGateway extends InternalServerError {}\n /**\n * ServiceUnavailable\n */\n class ServiceUnavailable extends InternalServerError {}\n /**\n * GatewayTimeout\n */\n class GatewayTimeout extends InternalServerError {}\n /**\n * HttpVersionNotSupported\n */\n class HttpVersionNotSupported extends InternalServerError {}\n\n Object.assign(Base, {\n 0: NetworkOrCORSError,\n NetworkOrCORSError,\n 400: BadRequest,\n BadRequest,\n 401: Unauthorized,\n Unauthorized,\n 402: PaymentRequired,\n PaymentRequired,\n 403: Forbidden,\n Forbidden,\n 404: NotFound,\n NotFound,\n 405: MethodNotAllowed,\n MethodNotAllowed,\n 406: NotAcceptable,\n NotAcceptable,\n 407: ProxyAuthenticationRequired,\n ProxyAuthenticationRequired,\n 408: RequestTimeout,\n RequestTimeout,\n 409: Conflict,\n Conflict,\n 410: Gone,\n Gone,\n 411: LengthRequired,\n LengthRequired,\n 412: PreconditionFailed,\n PreconditionFailed,\n 413: RequestEntityTooLarge,\n RequestEntityTooLarge,\n 414: RequestUriTooLong,\n RequestUriTooLong,\n 415: UnsupportedMediaType,\n UnsupportedMediaType,\n 416: RequestRangeNotSatisfiable,\n RequestRangeNotSatisfiable,\n 417: ExpectationFailed,\n ExpectationFailed,\n 429: TooManyRequests,\n TooManyRequests,\n 500: InternalServerError,\n InternalServerError,\n 501: NotImplemented,\n NotImplemented,\n 502: BadGateway,\n BadGateway,\n 503: ServiceUnavailable,\n ServiceUnavailable,\n 504: GatewayTimeout,\n GatewayTimeout,\n 505: HttpVersionNotSupported,\n HttpVersionNotSupported,\n select(statusCode) {\n if (typeof statusCode === 'undefined' || statusCode === null) {\n return Base;\n }\n\n statusCode = statusCode.statusCode || statusCode;\n const E = Base[statusCode];\n\n if (E) {\n return E;\n }\n\n // Fallback to the default for the category (e.g. BadRequest for 429)\n statusCode = `${statusCode.toString().split('').shift()}00`;\n statusCode = parseInt(statusCode, 10);\n\n return Base[statusCode] || Base;\n },\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACe,SAASA,YAAY,CAACC,IAAI,EAAE;EACzC;AACF;AACA;EAFE,IAGMC,kBAAkB;IAAA;IAAA;IAAA;MAAA;MAAA;IAAA;IAAA;EAAA,EAASD,IAAI;EACrC;AACF;AACA;EAFE,IAGME,UAAU;IAAA;IAAA;IAAA;MAAA;MAAA;IAAA;IAAA;EAAA,EAASF,IAAI;EAC7B;AACF;AACA;EAFE,IAGMG,YAAY;IAAA;IAAA;IAAA;MAAA;MAAA;IAAA;IAAA;EAAA,EAASD,UAAU;EACrC;AACF;AACA;EAFE,IAGME,eAAe;IAAA;IAAA;IAAA;MAAA;MAAA;IAAA;IAAA;EAAA,EAASF,UAAU;EACxC;AACF;AACA;EAFE,IAGMG,SAAS;IAAA;IAAA;IAAA;MAAA;MAAA;IAAA;IAAA;EAAA,EAASH,UAAU;EAClC;AACF;AACA;EAFE,IAGMI,QAAQ;IAAA;IAAA;IAAA;MAAA;MAAA;IAAA;IAAA;EAAA,EAASJ,UAAU;EACjC;AACF;AACA;EAFE,IAGMK,gBAAgB;IAAA;IAAA;IAAA;MAAA;MAAA;IAAA;IAAA;EAAA,EAASL,UAAU;EACzC;AACF;AACA;EAFE,IAGMM,aAAa;IAAA;IAAA;IAAA;MAAA;MAAA;IAAA;IAAA;EAAA,EAASN,UAAU;EACtC;AACF;AACA;EAFE,IAGMO,2BAA2B;IAAA;IAAA;IAAA;MAAA;MAAA;IAAA;IAAA;EAAA,EAASP,UAAU;EACpD;AACF;AACA;EAFE,IAGMQ,cAAc;IAAA;IAAA;IAAA;MAAA;MAAA;IAAA;IAAA;EAAA,EAASR,UAAU;EACvC;AACF;AACA;EAFE,IAGMS,QAAQ;IAAA;IAAA;IAAA;MAAA;MAAA;IAAA;IAAA;EAAA,EAAST,UAAU;EACjC;AACF;A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