@@ -14,16 +14,16 @@ export type WebhookConfig<Event = AsyncWebhookEventType | SyncWebhookEventType>
1414 GenericWebhookConfig < WebApiHandlerInput , Event > ;
1515
1616/** Function type provided by consumer in `SaleorWebApiWebhook.createHandler` */
17- export type WebApiWebhookHandler < TPayload = unknown , TExtras = { } > = (
17+ export type WebApiWebhookHandler < TPayload = unknown > = (
1818 req : Request ,
19- ctx : WebhookContext < TPayload > & TExtras
19+ ctx : WebhookContext < TPayload > ,
2020) => Response | Promise < Response > ;
2121
22- export abstract class SaleorWebApiWebhook <
23- TPayload = unknown ,
24- TExtras extends Record < string , unknown > = { }
25- > extends GenericSaleorWebhook < WebApiHandlerInput , TPayload , TExtras > {
26- createHandler ( handlerFn : WebApiWebhookHandler < TPayload , TExtras > ) : WebApiHandler {
22+ export abstract class SaleorWebApiWebhook < TPayload = unknown > extends GenericSaleorWebhook <
23+ WebApiHandlerInput ,
24+ TPayload
25+ > {
26+ createHandler ( handlerFn : WebApiWebhookHandler < TPayload > ) : WebApiHandler {
2727 return async ( req ) => {
2828 const adapter = new WebApiAdapter ( req ) ;
2929 const prepareRequestResult = await super . prepareRequest < WebApiAdapter > ( adapter ) ;
@@ -34,7 +34,6 @@ export abstract class SaleorWebApiWebhook<
3434
3535 debug ( "Incoming request validated. Call handlerFn" ) ;
3636 return handlerFn ( req , {
37- ...( this . extraContext ?? ( { } as TExtras ) ) ,
3837 ...prepareRequestResult . context ,
3938 } ) ;
4039 } ;
0 commit comments