@midwayjs/core 3.20.3 → 3.20.11

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.
@@ -112,6 +112,12 @@ export declare class UnsupportedMediaTypeError extends MidwayHttpError {
112
112
  export declare class UnprocessableEntityError extends MidwayHttpError {
113
113
  constructor(resOrMessage?: ResOrMessage);
114
114
  }
115
+ /**
116
+ * 429 http error, Means that client has sent too many requests in a given amount of time and that's why the server won't accept the request.
117
+ */
118
+ export declare class TooManyRequestsError extends MidwayHttpError {
119
+ constructor(resOrMessage?: ResOrMessage);
120
+ }
115
121
  /**
116
122
  * 500 http error, Is a generic error and users receive this error message when there is no more suitable specific message.
117
123
  */
@@ -154,6 +160,7 @@ export declare const httpError: {
154
160
  PayloadTooLargeError: typeof PayloadTooLargeError;
155
161
  UnsupportedMediaTypeError: typeof UnsupportedMediaTypeError;
156
162
  UnprocessableEntityError: typeof UnprocessableEntityError;
163
+ TooManyRequestsError: typeof TooManyRequestsError;
157
164
  InternalServerErrorError: typeof InternalServerErrorError;
158
165
  NotImplementedError: typeof NotImplementedError;
159
166
  BadGatewayError: typeof BadGatewayError;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.httpError = exports.GatewayTimeoutError = exports.ServiceUnavailableError = exports.BadGatewayError = exports.NotImplementedError = exports.InternalServerErrorError = exports.UnprocessableEntityError = exports.UnsupportedMediaTypeError = exports.PayloadTooLargeError = exports.GoneError = exports.ConflictError = exports.RequestTimeoutError = exports.NotAcceptableError = exports.ForbiddenError = exports.NotFoundError = exports.UnauthorizedError = exports.BadRequestError = exports.HttpStatus = void 0;
3
+ exports.httpError = exports.GatewayTimeoutError = exports.ServiceUnavailableError = exports.BadGatewayError = exports.NotImplementedError = exports.InternalServerErrorError = exports.TooManyRequestsError = exports.UnprocessableEntityError = exports.UnsupportedMediaTypeError = exports.PayloadTooLargeError = exports.GoneError = exports.ConflictError = exports.RequestTimeoutError = exports.NotAcceptableError = exports.ForbiddenError = exports.NotFoundError = exports.UnauthorizedError = exports.BadRequestError = exports.HttpStatus = void 0;
4
4
  const base_1 = require("./base");
5
5
  var HttpStatus;
6
6
  (function (HttpStatus) {
@@ -149,6 +149,15 @@ class UnprocessableEntityError extends base_1.MidwayHttpError {
149
149
  }
150
150
  }
151
151
  exports.UnprocessableEntityError = UnprocessableEntityError;
152
+ /**
153
+ * 429 http error, Means that client has sent too many requests in a given amount of time and that's why the server won't accept the request.
154
+ */
155
+ class TooManyRequestsError extends base_1.MidwayHttpError {
156
+ constructor(resOrMessage) {
157
+ super(resOrMessage, HttpStatus.TOO_MANY_REQUESTS);
158
+ }
159
+ }
160
+ exports.TooManyRequestsError = TooManyRequestsError;
152
161
  /**
153
162
  * 500 http error, Is a generic error and users receive this error message when there is no more suitable specific message.
154
163
  */
@@ -206,6 +215,7 @@ exports.httpError = {
206
215
  PayloadTooLargeError,
207
216
  UnsupportedMediaTypeError,
208
217
  UnprocessableEntityError,
218
+ TooManyRequestsError,
209
219
  InternalServerErrorError,
210
220
  NotImplementedError,
211
221
  BadGatewayError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/core",
3
- "version": "3.20.3",
3
+ "version": "3.20.11",
4
4
  "description": "midway core",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "devDependencies": {
25
25
  "@midwayjs/logger": "^3.0.0",
26
26
  "eventsource": "2.0.2",
27
- "koa": "2.15.3",
27
+ "koa": "2.16.2",
28
28
  "mm": "3.4.0",
29
29
  "raw-body": "2.5.2",
30
30
  "sinon": "17.0.2"
@@ -43,5 +43,5 @@
43
43
  "engines": {
44
44
  "node": ">=12"
45
45
  },
46
- "gitHead": "a0918e46838e220fd000997796dbc8d669d28746"
46
+ "gitHead": "741e5e2cd200d44182bf893f348f58fb5c4e5404"
47
47
  }