Comparing version 1.8.0-rc.2 to 1.8.0-rc.3
@@ -53,2 +53,4 @@ import { QueryObject } from 'ufo'; | ||
respondWith(response: Response | PromiseLike<Response>): Promise<void>; | ||
toString(): string; | ||
toJSON(): string; | ||
} | ||
@@ -58,4 +60,4 @@ declare function isEvent(input: any): input is H3Event; | ||
declare function defineEventHandler<Request extends EventHandlerRequest = EventHandlerRequest, Response = any>(handler: EventHandler<Request, Response>): EventHandler<Request, Response>; | ||
declare function defineEventHandler<Request = EventHandlerRequest, Response = EventHandlerResponse>(handler: EventHandler<Request extends EventHandlerRequest ? Request : any, Request extends EventHandlerRequest ? Response : Request>): EventHandler<Request extends EventHandlerRequest ? Request : any, Request extends EventHandlerRequest ? Response : Request>; | ||
declare function defineEventHandler<Request extends EventHandlerRequest = EventHandlerRequest, Response = EventHandlerResponse>(handler: EventHandler<Request, Response> | EventHandlerObject<Request, Response>): EventHandler<Request, Response>; | ||
declare function defineEventHandler<Request = EventHandlerRequest, Response = EventHandlerResponse>(handler: EventHandler<Request extends EventHandlerRequest ? Request : EventHandlerRequest, Request extends EventHandlerRequest ? Response : Request>): EventHandler<Request extends EventHandlerRequest ? Request : EventHandlerRequest, Request extends EventHandlerRequest ? Response : Request>; | ||
declare const eventHandler: typeof defineEventHandler; | ||
@@ -169,2 +171,9 @@ declare function isEventHandler(input: any): input is EventHandler; | ||
} | ||
type EventHandlerObject<Request extends EventHandlerRequest = EventHandlerRequest, Response extends EventHandlerResponse = EventHandlerResponse> = { | ||
handler: EventHandler<Request, Response>; | ||
before?: ((event: H3Event<Request>) => void | Promise<void>)[]; | ||
after?: ((event: H3Event<Request>, response: { | ||
body?: Response; | ||
}) => void | Promise<void>)[]; | ||
}; | ||
type LazyEventHandler = () => EventHandler | Promise<EventHandler>; | ||
@@ -411,3 +420,3 @@ type RequestHeaders = { | ||
/** | ||
* Set a cookie value by name. | ||
* Remove a cookie by name. | ||
* @param event {H3Event} H3 event or res passed by h3 handler | ||
@@ -571,2 +580,2 @@ * @param name Name of the cookie to delete | ||
export { AddRouteShortcuts, App, AppOptions, AppUse, CacheConditions, CreateRouterOptions, Duplex, DynamicEventHandler, Encoding, EventHandler, EventHandlerRequest, EventHandlerResponse, H3CorsOptions, H3Error, H3Event, H3EventContext, H3Headers, H3Response, HTTPMethod, InferEventInput, InputLayer, InputStack, Layer, LazyEventHandler, MIMES, Matcher, MultiPartData, NodeEventContext, NodeListener, NodeMiddleware, NodePromisifiedHandler, PlainHandler, PlainRequest, PlainResponse, ProxyOptions, RequestHeaders, Router, RouterMethod, RouterUse, ServeStaticOptions, Session, SessionConfig, SessionData, Stack, StaticAssetMeta, ValidateFunction, ValidateResult, WebHandler, appendCorsHeaders, appendCorsPreflightHeaders, appendHeader, appendHeaders, appendResponseHeader, appendResponseHeaders, assertMethod, callNodeListener, clearResponseHeaders, clearSession, createApp, createAppEventHandler, createError, createEvent, createRouter, defaultContentType, defineEventHandler, defineLazyEventHandler, defineNodeListener, defineNodeMiddleware, deleteCookie, dynamicEventHandler, eventHandler, fetchWithEvent, fromNodeMiddleware, getCookie, getHeader, getHeaders, getMethod, getProxyRequestHeaders, getQuery, getRequestHeader, getRequestHeaders, getRequestHost, getRequestPath, getRequestProtocol, getRequestURL, getResponseHeader, getResponseHeaders, getResponseStatus, getResponseStatusText, getRouterParam, getRouterParams, getSession, getValidatedQuery, handleCacheHeaders, handleCors, isCorsOriginAllowed, isError, isEvent, isEventHandler, isMethod, isPreflightRequest, isStream, isWebResponse, lazyEventHandler, parseCookies, promisifyNodeListener, proxyRequest, readBody, readFormData, readMultipartFormData, readRawBody, readValidatedBody, removeResponseHeader, sanitizeStatusCode, sanitizeStatusMessage, sealSession, send, sendError, sendNoContent, sendProxy, sendRedirect, sendStream, sendWebResponse, serveStatic, setCookie, setHeader, setHeaders, setResponseHeader, setResponseHeaders, setResponseStatus, splitCookiesString, toEventHandler, toNodeListener, toPlainHandler, toWebHandler, unsealSession, updateSession, use, useBase, useSession, writeEarlyHints }; | ||
export { AddRouteShortcuts, App, AppOptions, AppUse, CacheConditions, CreateRouterOptions, Duplex, DynamicEventHandler, Encoding, EventHandler, EventHandlerObject, EventHandlerRequest, EventHandlerResponse, H3CorsOptions, H3Error, H3Event, H3EventContext, H3Headers, H3Response, HTTPMethod, InferEventInput, InputLayer, InputStack, Layer, LazyEventHandler, MIMES, Matcher, MultiPartData, NodeEventContext, NodeListener, NodeMiddleware, NodePromisifiedHandler, PlainHandler, PlainRequest, PlainResponse, ProxyOptions, RequestHeaders, Router, RouterMethod, RouterUse, ServeStaticOptions, Session, SessionConfig, SessionData, Stack, StaticAssetMeta, ValidateFunction, ValidateResult, WebHandler, appendCorsHeaders, appendCorsPreflightHeaders, appendHeader, appendHeaders, appendResponseHeader, appendResponseHeaders, assertMethod, callNodeListener, clearResponseHeaders, clearSession, createApp, createAppEventHandler, createError, createEvent, createRouter, defaultContentType, defineEventHandler, defineLazyEventHandler, defineNodeListener, defineNodeMiddleware, deleteCookie, dynamicEventHandler, eventHandler, fetchWithEvent, fromNodeMiddleware, getCookie, getHeader, getHeaders, getMethod, getProxyRequestHeaders, getQuery, getRequestHeader, getRequestHeaders, getRequestHost, getRequestPath, getRequestProtocol, getRequestURL, getResponseHeader, getResponseHeaders, getResponseStatus, getResponseStatusText, getRouterParam, getRouterParams, getSession, getValidatedQuery, handleCacheHeaders, handleCors, isCorsOriginAllowed, isError, isEvent, isEventHandler, isMethod, isPreflightRequest, isStream, isWebResponse, lazyEventHandler, parseCookies, promisifyNodeListener, proxyRequest, readBody, readFormData, readMultipartFormData, readRawBody, readValidatedBody, removeResponseHeader, sanitizeStatusCode, sanitizeStatusMessage, sealSession, send, sendError, sendNoContent, sendProxy, sendRedirect, sendStream, sendWebResponse, serveStatic, setCookie, setHeader, setHeaders, setResponseHeader, setResponseHeaders, setResponseStatus, splitCookiesString, toEventHandler, toNodeListener, toPlainHandler, toWebHandler, unsealSession, updateSession, use, useBase, useSession, writeEarlyHints }; |
{ | ||
"name": "h3", | ||
"version": "1.8.0-rc.2", | ||
"version": "1.8.0-rc.3", | ||
"description": "Tiny JavaScript Server", | ||
@@ -27,3 +27,3 @@ "repository": "unjs/h3", | ||
"lint:fix": "eslint --cache --ext .ts,.js,.mjs,.cjs . --fix && prettier -c src test playground -w", | ||
"play": "listhen ./playground/app.ts", | ||
"play": "listhen -w ./playground/app.ts", | ||
"profile": "0x -o -D .profile -P 'autocannon -c 100 -p 10 -d 40 http://localhost:$PORT' ./playground/server.cjs", | ||
@@ -38,6 +38,6 @@ "release": "pnpm test && pnpm build && changelogen --release && pnpm publish && git push --follow-tags", | ||
"defu": "^6.1.2", | ||
"destr": "^2.0.0", | ||
"destr": "^2.0.1", | ||
"iron-webcrypto": "^0.8.0", | ||
"radix3": "^1.0.1", | ||
"ufo": "^1.1.2", | ||
"ufo": "^1.2.0", | ||
"uncrypto": "^0.1.3", | ||
@@ -47,11 +47,11 @@ "unenv": "^1.6.1" | ||
"devDependencies": { | ||
"0x": "^5.5.0", | ||
"0x": "^5.6.0", | ||
"@types/express": "^4.17.17", | ||
"@types/node": "^20.4.2", | ||
"@types/node": "^20.4.6", | ||
"@types/supertest": "^2.0.12", | ||
"@vitest/coverage-v8": "^0.33.0", | ||
"@vitest/coverage-v8": "^0.34.1", | ||
"autocannon": "^7.11.0", | ||
"changelogen": "^0.5.4", | ||
"connect": "^3.7.0", | ||
"eslint": "^8.45.0", | ||
"eslint": "^8.46.0", | ||
"eslint-config-unjs": "^0.2.1", | ||
@@ -61,9 +61,11 @@ "express": "^4.18.2", | ||
"jiti": "^1.19.1", | ||
"listhen": "^1.1.2", | ||
"listhen": "^1.2.2", | ||
"node-fetch-native": "^1.2.0", | ||
"prettier": "^2.8.8", | ||
"prettier": "^3.0.0", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"supertest": "^6.3.3", | ||
"typescript": "^5.1.6", | ||
"unbuild": "^1.2.1", | ||
"vitest": "^0.33.0", | ||
"vitest": "^0.34.1", | ||
"zod": "^3.21.4" | ||
@@ -70,0 +72,0 @@ }, |
@@ -311,3 +311,6 @@ # H3 | ||
- `useValidatedQuery(event, schema)` | ||
- [h3-valibot](https://github.com/intevel/h3-valibot) | ||
- `useValidateBody(event, schema)` | ||
- `useValidateParams(event, schema)` | ||
## License | ||
@@ -314,0 +317,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
158035
4644
333
23
Updateddestr@^2.0.1
Updatedufo@^1.2.0