@marianmeres/http-utils 1.22.0 → 1.23.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/dist/error.d.ts CHANGED
@@ -44,6 +44,11 @@ declare class Gone extends HttpError {
44
44
  status: number;
45
45
  statusText: string;
46
46
  }
47
+ declare class LengthRequired extends HttpError {
48
+ name: string;
49
+ status: number;
50
+ statusText: string;
51
+ }
47
52
  declare class UnprocessableContent extends HttpError {
48
53
  name: string;
49
54
  status: number;
@@ -87,6 +92,7 @@ export declare const HTTP_ERROR: {
87
92
  RequestTimeout: typeof RequestTimeout;
88
93
  Conflict: typeof Conflict;
89
94
  Gone: typeof Gone;
95
+ LengthRequired: typeof LengthRequired;
90
96
  ImATeapot: typeof ImATeapot;
91
97
  UnprocessableContent: typeof UnprocessableContent;
92
98
  TooManyRequests: typeof TooManyRequests;
package/dist/index.cjs CHANGED
@@ -175,6 +175,11 @@ class Gone extends HttpError {
175
175
  status = HTTP_STATUS.ERROR_CLIENT.GONE.CODE;
176
176
  statusText = HTTP_STATUS.ERROR_CLIENT.GONE.TEXT;
177
177
  }
178
+ class LengthRequired extends HttpError {
179
+ name = 'HttpLengthRequiredError';
180
+ status = HTTP_STATUS.ERROR_CLIENT.LENGTH_REQUIRED.CODE;
181
+ statusText = HTTP_STATUS.ERROR_CLIENT.LENGTH_REQUIRED.TEXT;
182
+ }
178
183
  class UnprocessableContent extends HttpError {
179
184
  name = 'HttpUnprocessableContentError';
180
185
  status = HTTP_STATUS.ERROR_CLIENT.UNPROCESSABLE_CONTENT.CODE;
@@ -222,6 +227,7 @@ const HTTP_ERROR = {
222
227
  RequestTimeout,
223
228
  Conflict,
224
229
  Gone,
230
+ LengthRequired,
225
231
  ImATeapot,
226
232
  UnprocessableContent,
227
233
  TooManyRequests,
@@ -240,6 +246,7 @@ const _wellKnownCtorMap = {
240
246
  '408': RequestTimeout,
241
247
  '409': Conflict,
242
248
  '410': Gone,
249
+ '411': LengthRequired,
243
250
  '418': ImATeapot,
244
251
  '422': UnprocessableContent,
245
252
  '429': TooManyRequests,
package/dist/index.js CHANGED
@@ -173,6 +173,11 @@ class Gone extends HttpError {
173
173
  status = HTTP_STATUS.ERROR_CLIENT.GONE.CODE;
174
174
  statusText = HTTP_STATUS.ERROR_CLIENT.GONE.TEXT;
175
175
  }
176
+ class LengthRequired extends HttpError {
177
+ name = 'HttpLengthRequiredError';
178
+ status = HTTP_STATUS.ERROR_CLIENT.LENGTH_REQUIRED.CODE;
179
+ statusText = HTTP_STATUS.ERROR_CLIENT.LENGTH_REQUIRED.TEXT;
180
+ }
176
181
  class UnprocessableContent extends HttpError {
177
182
  name = 'HttpUnprocessableContentError';
178
183
  status = HTTP_STATUS.ERROR_CLIENT.UNPROCESSABLE_CONTENT.CODE;
@@ -220,6 +225,7 @@ const HTTP_ERROR = {
220
225
  RequestTimeout,
221
226
  Conflict,
222
227
  Gone,
228
+ LengthRequired,
223
229
  ImATeapot,
224
230
  UnprocessableContent,
225
231
  TooManyRequests,
@@ -238,6 +244,7 @@ const _wellKnownCtorMap = {
238
244
  '408': RequestTimeout,
239
245
  '409': Conflict,
240
246
  '410': Gone,
247
+ '411': LengthRequired,
241
248
  '418': ImATeapot,
242
249
  '422': UnprocessableContent,
243
250
  '429': TooManyRequests,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marianmeres/http-utils",
3
- "version": "1.22.0",
3
+ "version": "1.23.0",
4
4
  "description": "Misc DRY http fetch related helpers",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",