@@ -1331,12 +1331,17 @@ export class Controller {
1331
1331
if ( ! providerConfig ) {
1332
1332
throw new ServerError ( 400 , 'Missing parameters' ) ;
1333
1333
}
1334
+
1334
1335
if ( ! this . adapter . getAccountId ) {
1335
1336
throw new ServerError ( 501 , 'Fetching account id is not implemented' ) ;
1336
1337
}
1338
+
1339
+ infoLogger ( 'getAccountId' , 'START' , providerConfig . apiKey ) ;
1340
+
1337
1341
try {
1338
1342
const accountId = await this . adapter . getAccountId ( providerConfig ) ;
1339
- console . log ( 'accountId' , accountId ) ;
1343
+
1344
+ infoLogger ( 'getAccountId' , 'END' , providerConfig . apiKey ) ;
1340
1345
res . status ( 200 ) . send ( accountId . toString ( ) ) ;
1341
1346
} catch ( error : any ) {
1342
1347
errorLogger (
@@ -1363,13 +1368,21 @@ export class Controller {
1363
1368
throw new ServerError ( 403 , 'Webhook verification failed' ) ;
1364
1369
}
1365
1370
1371
+ infoLogger ( 'handleWebhook' , 'START' , '' ) ;
1372
+
1366
1373
try {
1367
1374
const contactsChangedData : ContactsChangedData =
1368
1375
await this . adapter . handleWebhook ( req ) ;
1369
1376
1370
- console . log ( 'sending webhook to pubsub' , contactsChangedData ) ;
1377
+ infoLogger (
1378
+ 'handleWebhook' ,
1379
+ `Got ${ contactsChangedData . data . length } changed contacts` ,
1380
+ '' ,
1381
+ ) ;
1382
+
1371
1383
this . pubSubContactsChangedClient ?. publishMessage ( contactsChangedData ) ;
1372
1384
1385
+ infoLogger ( 'handleWebhook' , 'END' , '' ) ;
1373
1386
res . sendStatus ( 200 ) ;
1374
1387
} catch ( error ) {
1375
1388
errorLogger (
0 commit comments