@@ -12,11 +12,11 @@ export function api<T = any>(
1212 custom : ( props : ApiSignature < T > ) => any
1313) : ( event : APIGatewayEvent , context : Context , callback : Callback ) => any {
1414 return function handler ( event : APIGatewayEvent ) {
15- const { body, requestContext , path, query, auth, headers, testRequest } = new Request ( event ) . getProperties ( ) ;
15+ const { body, websocket , path, query, auth, headers, testRequest } = new Request ( event ) . getProperties ( ) ;
1616 const signature : ApiSignature < T > = {
1717 event,
1818 body,
19- requestContext ,
19+ websocket ,
2020 path,
2121 query,
2222 headers,
@@ -36,7 +36,7 @@ export function api<T = any>(
3636export interface ApiSignature < T = any > {
3737 event : APIGatewayEvent ; // original event
3838 body : T ; // JSON parsed body payload if exists (otherwise undefined)
39- requestContext : WebsocketRequestContext ; // websocket connection payload
39+ websocket : WebsocketRequest ; // websocket connection payload
4040 path : { [ name : string ] : string } ; // path param payload as key-value pairs if exists (otherwise undefined)
4141 query : { [ name : string ] : string } ; // query param payload as key-value pairs if exists (otherwise undefined)
4242 headers : { [ name : string ] : string } ; // header payload as key-value pairs if exists (otherwise undefined)
@@ -50,7 +50,7 @@ export interface ApiSignature<T = any> {
5050 error ( error ?: any ) : ApiResponse ; // returns 500 status code with optional error as body
5151}
5252
53- export interface WebsocketRequestContext {
53+ export interface WebsocketRequest {
5454 accountId : string ;
5555 apiId : string ;
5656 connectedAt ?: number ;
0 commit comments