File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,6 +9,13 @@ export interface ObjectStackHonoOptions {
99 prefix ?: string ;
1010}
1111
12+ /**
13+ * Auth service interface with handleRequest method
14+ */
15+ interface AuthService {
16+ handleRequest ( request : Request ) : Promise < Response > ;
17+ }
18+
1219/**
1320 * @deprecated Use `HonoServerPlugin` + `createRestApiPlugin()` + `createDispatcherPlugin()` instead.
1421 * This function bundles all routes into a single Hono app using the legacy HttpDispatcher.
@@ -68,7 +75,7 @@ export function createHonoApp(options: ObjectStackHonoOptions) {
6875 try {
6976 // Try AuthPlugin service first (preferred path)
7077 const authService = typeof options . kernel . getService === 'function'
71- ? options . kernel . getService ( 'auth' )
78+ ? options . kernel . getService < AuthService > ( 'auth' )
7279 : null ;
7380
7481 if ( authService && typeof authService . handleRequest === 'function' ) {
Original file line number Diff line number Diff line change @@ -12,6 +12,13 @@ export const ConnectReq = createParamDecorator(
1212 } ,
1313) ;
1414
15+ /**
16+ * Auth service interface with handleRequest method
17+ */
18+ interface AuthService {
19+ handleRequest ( request : Request ) : Promise < Response > ;
20+ }
21+
1522// --- Service ---
1623
1724@Injectable ( )
@@ -109,7 +116,7 @@ export class ObjectStackController {
109116 // Try AuthPlugin service first (preferred path)
110117 const kernel = this . service . getKernel ( ) ;
111118 const authService = typeof kernel . getService === 'function'
112- ? kernel . getService ( 'auth' )
119+ ? kernel . getService < AuthService > ( 'auth' )
113120 : null ;
114121
115122 if ( authService && typeof authService . handleRequest === 'function' ) {
Original file line number Diff line number Diff line change @@ -8,6 +8,13 @@ export interface NextAdapterOptions {
88 prefix ?: string ;
99}
1010
11+ /**
12+ * Auth service interface with handleRequest method
13+ */
14+ interface AuthService {
15+ handleRequest ( request : Request ) : Promise < Response > ;
16+ }
17+
1118/**
1219 * Creates a route handler for Next.js App Router
1320 * Handles /api/[...objectstack] pattern
@@ -63,7 +70,7 @@ export function createRouteHandler(options: NextAdapterOptions) {
6370 if ( segments [ 0 ] === 'auth' ) {
6471 // Try AuthPlugin service first (preferred path)
6572 const authService = typeof options . kernel . getService === 'function'
66- ? options . kernel . getService ( 'auth' )
73+ ? options . kernel . getService < AuthService > ( 'auth' )
6774 : null ;
6875
6976 if ( authService && typeof authService . handleRequest === 'function' ) {
You can’t perform that action at this time.
0 commit comments