From 72721d2a8e61f19e72a445244b1413d5ad4501d3 Mon Sep 17 00:00:00 2001 From: CJ Quines Date: Wed, 18 Dec 2024 15:00:11 -0500 Subject: [PATCH] feat(hono): change server context --- packages/hono/package.json | 2 +- packages/hono/src/honoPlugin.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/hono/package.json b/packages/hono/package.json index 8788447e..a4811033 100644 --- a/packages/hono/package.json +++ b/packages/hono/package.json @@ -1,6 +1,6 @@ { "name": "@stl-api/hono", - "version": "0.1.0", + "version": "0.1.3", "license": "ISC", "description": "hono plugin for stainless api", "author": "dev@stainlessapi.com", diff --git a/packages/hono/src/honoPlugin.ts b/packages/hono/src/honoPlugin.ts index bc1e2316..dff8ff10 100644 --- a/packages/hono/src/honoPlugin.ts +++ b/packages/hono/src/honoPlugin.ts @@ -1,4 +1,4 @@ -import { HonoRequest } from "hono"; +import { Context } from "hono"; import { createMiddleware } from "hono/factory"; import { StatusCode } from "hono/utils/http-status"; import qs from "qs"; @@ -13,7 +13,7 @@ import { isValidRouteMatch, makeRouteMatcher } from "./routeMatcher"; export type HonoServerContext = { type: "hono"; - args: [HonoRequest, Response]; + args: [Context]; }; declare module "stainless" { @@ -65,7 +65,7 @@ function makeHandler(endpoints: AnyEndpoint[], options?: StlAppOptions) { const [endpoint, path] = match[0][0]; const server: HonoServerContext = { type: "hono", - args: [c.req, c.res], + args: [c], }; const context = stl.initContext({