astro-routify 1.2.1 → 1.2.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.
|
@@ -53,6 +53,10 @@ export declare const notFound: <T = string>(body?: T, headers?: HeadersInit) =>
|
|
|
53
53
|
* 405 Method Not Allowed
|
|
54
54
|
*/
|
|
55
55
|
export declare const methodNotAllowed: <T = string>(body?: T, headers?: HeadersInit) => ResultResponse<T>;
|
|
56
|
+
/**
|
|
57
|
+
* 429 Too Many Requests
|
|
58
|
+
*/
|
|
59
|
+
export declare const tooManyRequests: <T = string>(body?: T, headers?: HeadersInit) => ResultResponse<T>;
|
|
56
60
|
/**
|
|
57
61
|
* 500 Internal Server Error
|
|
58
62
|
*/
|
|
@@ -43,6 +43,10 @@ export const notFound = (body = 'Not Found', headers) => createResponse(404, bod
|
|
|
43
43
|
* 405 Method Not Allowed
|
|
44
44
|
*/
|
|
45
45
|
export const methodNotAllowed = (body = 'Method Not Allowed', headers) => createResponse(405, body, headers);
|
|
46
|
+
/**
|
|
47
|
+
* 429 Too Many Requests
|
|
48
|
+
*/
|
|
49
|
+
export const tooManyRequests = (body = 'Too Many Requests', headers) => createResponse(429, body, headers);
|
|
46
50
|
/**
|
|
47
51
|
* 500 Internal Server Error
|
|
48
52
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -70,6 +70,10 @@ declare const notFound: <T = string>(body?: T, headers?: HeadersInit) => ResultR
|
|
|
70
70
|
* 405 Method Not Allowed
|
|
71
71
|
*/
|
|
72
72
|
declare const methodNotAllowed: <T = string>(body?: T, headers?: HeadersInit) => ResultResponse<T>;
|
|
73
|
+
/**
|
|
74
|
+
* 429 Too Many Requests
|
|
75
|
+
*/
|
|
76
|
+
declare const tooManyRequests: <T = string>(body?: T, headers?: HeadersInit) => ResultResponse<T>;
|
|
73
77
|
/**
|
|
74
78
|
* 500 Internal Server Error
|
|
75
79
|
*/
|
|
@@ -575,5 +579,5 @@ declare function streamJsonArray(path: string, handler: (ctx: APIContext & {
|
|
|
575
579
|
method?: HttpMethod;
|
|
576
580
|
}): Route;
|
|
577
581
|
|
|
578
|
-
export { ALLOWED_HTTP_METHODS, HttpMethod, RouteGroup, RouteTrie, RouterBuilder, badRequest, created, defineGroup, defineHandler, defineRoute, defineRouter, fileResponse, forbidden, internalError, isReadableStream, methodNotAllowed, noContent, normalizeMethod, notFound, notModified, ok, stream, streamJsonArray, streamJsonND, toAstroResponse, unauthorized };
|
|
582
|
+
export { ALLOWED_HTTP_METHODS, HttpMethod, RouteGroup, RouteTrie, RouterBuilder, badRequest, created, defineGroup, defineHandler, defineRoute, defineRouter, fileResponse, forbidden, internalError, isReadableStream, methodNotAllowed, noContent, normalizeMethod, notFound, notModified, ok, stream, streamJsonArray, streamJsonND, toAstroResponse, tooManyRequests, unauthorized };
|
|
579
583
|
export type { Handler, JsonStreamWriter, ResultResponse, Route, RouterOptions, StreamOptions, StreamWriter };
|