@lucaapp/service-utils 1.36.0 → 1.36.2
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/lib/api/send.d.ts
CHANGED
package/dist/lib/api/send.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.conflict = exports.notFound = exports.forbidden = exports.unauthorized = exports.badRequest = exports.noContent = exports.created = exports.ok = void 0;
|
|
3
|
+
exports.tooManyRequests = exports.conflict = exports.notFound = exports.forbidden = exports.unauthorized = exports.badRequest = exports.noContent = exports.created = exports.ok = void 0;
|
|
4
4
|
const http_1 = require("./types/http");
|
|
5
5
|
const ok = (body) => ({
|
|
6
6
|
status: 200,
|
|
@@ -57,3 +57,11 @@ const conflict = (message) => ({
|
|
|
57
57
|
},
|
|
58
58
|
});
|
|
59
59
|
exports.conflict = conflict;
|
|
60
|
+
const tooManyRequests = (message) => ({
|
|
61
|
+
status: 429,
|
|
62
|
+
body: {
|
|
63
|
+
error: http_1.HTTPStatus.TOO_MANY_REQUESTS,
|
|
64
|
+
message: message || 'Too many requests',
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
exports.tooManyRequests = tooManyRequests;
|