@@ -51,7 +51,7 @@ export class Controller {
51
51
}
52
52
53
53
public async getContacts (
54
- req : BridgeRequest ,
54
+ req : BridgeRequest < unknown > ,
55
55
res : Response ,
56
56
next : NextFunction
57
57
) : Promise < void > {
@@ -137,7 +137,7 @@ export class Controller {
137
137
}
138
138
139
139
public async createContact (
140
- req : BridgeRequest ,
140
+ req : BridgeRequest < ContactTemplate > ,
141
141
res : Response ,
142
142
next : NextFunction
143
143
) : Promise < void > {
@@ -155,7 +155,7 @@ export class Controller {
155
155
156
156
const contact : Contact = await this . adapter . createContact (
157
157
req . providerConfig ,
158
- req . body as ContactTemplate
158
+ req . body
159
159
) ;
160
160
161
161
const valid = validate ( this . ajv , contactsSchema , [ contact ] ) ;
@@ -201,7 +201,7 @@ export class Controller {
201
201
}
202
202
203
203
public async updateContact (
204
- req : BridgeRequest ,
204
+ req : BridgeRequest < ContactUpdate > ,
205
205
res : Response ,
206
206
next : NextFunction
207
207
) : Promise < void > {
@@ -220,7 +220,7 @@ export class Controller {
220
220
const contact : Contact = await this . adapter . updateContact (
221
221
req . providerConfig ,
222
222
req . params . id ,
223
- req . body as ContactUpdate
223
+ req . body
224
224
) ;
225
225
226
226
const valid = validate ( this . ajv , contactsSchema , [ contact ] ) ;
@@ -265,7 +265,7 @@ export class Controller {
265
265
}
266
266
267
267
public async deleteContact (
268
- req : BridgeRequest ,
268
+ req : BridgeRequest < unknown > ,
269
269
res : Response ,
270
270
next : NextFunction
271
271
) : Promise < void > {
@@ -315,7 +315,7 @@ export class Controller {
315
315
}
316
316
317
317
public async getCalendarEvents (
318
- req : BridgeRequest ,
318
+ req : BridgeRequest < unknown > ,
319
319
res : Response ,
320
320
next : NextFunction
321
321
) : Promise < void > {
@@ -372,7 +372,7 @@ export class Controller {
372
372
}
373
373
374
374
public async createCalendarEvent (
375
- req : BridgeRequest ,
375
+ req : BridgeRequest < CalendarEventTemplate > ,
376
376
res : Response ,
377
377
next : NextFunction
378
378
) : Promise < void > {
@@ -392,10 +392,7 @@ export class Controller {
392
392
console . log ( `[${ anonymizeKey ( apiKey ) } ] Creating calendar event` ) ;
393
393
394
394
const calendarEvent : CalendarEvent =
395
- await this . adapter . createCalendarEvent (
396
- req . providerConfig ,
397
- req . body as CalendarEventTemplate
398
- ) ;
395
+ await this . adapter . createCalendarEvent ( req . providerConfig , req . body ) ;
399
396
400
397
const valid = validate ( this . ajv , calendarEventsSchema , [ calendarEvent ] ) ;
401
398
if ( ! valid ) {
@@ -417,7 +414,7 @@ export class Controller {
417
414
}
418
415
419
416
public async updateCalendarEvent (
420
- req : BridgeRequest ,
417
+ req : BridgeRequest < CalendarEventTemplate > ,
421
418
res : Response ,
422
419
next : NextFunction
423
420
) : Promise < void > {
@@ -440,7 +437,7 @@ export class Controller {
440
437
await this . adapter . updateCalendarEvent (
441
438
req . providerConfig ,
442
439
req . params . id ,
443
- req . body as CalendarEventTemplate
440
+ req . body
444
441
) ;
445
442
446
443
const valid = validate ( this . ajv , calendarEventsSchema , [ calendarEvent ] ) ;
@@ -463,7 +460,7 @@ export class Controller {
463
460
}
464
461
465
462
public async deleteCalendarEvent (
466
- req : BridgeRequest ,
463
+ req : BridgeRequest < unknown > ,
467
464
res : Response ,
468
465
next : NextFunction
469
466
) : Promise < void > {
@@ -491,7 +488,7 @@ export class Controller {
491
488
}
492
489
493
490
public async handleCallEvent (
494
- req : BridgeRequest ,
491
+ req : BridgeRequest < CallEvent > ,
495
492
res : Response ,
496
493
next : NextFunction
497
494
) : Promise < void > {
@@ -506,7 +503,7 @@ export class Controller {
506
503
throw new ServerError ( 501 , "Handling call event is not implemented" ) ;
507
504
}
508
505
509
- if ( shouldSkipCallEvent ( req . body as CallEvent ) ) {
506
+ if ( shouldSkipCallEvent ( req . body ) ) {
510
507
infoLogger (
511
508
`Skipping call event for call id ${ req . body . id } ` ,
512
509
providerConfig
@@ -534,7 +531,7 @@ export class Controller {
534
531
}
535
532
536
533
public async handleConnectedEvent (
537
- req : BridgeRequest ,
534
+ req : BridgeRequest < unknown > ,
538
535
res : Response ,
539
536
next : NextFunction
540
537
) : Promise < void > {
@@ -563,7 +560,7 @@ export class Controller {
563
560
}
564
561
565
562
public async updateCallEvent (
566
- req : BridgeRequest ,
563
+ req : BridgeRequest < CallEvent > ,
567
564
res : Response ,
568
565
next : NextFunction
569
566
) : Promise < void > {
@@ -619,7 +616,7 @@ export class Controller {
619
616
}
620
617
621
618
public async getHealth (
622
- req : BridgeRequest ,
619
+ req : BridgeRequest < unknown > ,
623
620
res : Response ,
624
621
next : NextFunction
625
622
) : Promise < void > {
0 commit comments