8
8
CreateSubNotificationRequest ,
9
9
DeleteSubNotificationRequest ,
10
10
InAppNotificationPatchRequest ,
11
- LogQueryPostBody ,
11
+ queryLogsPostBody ,
12
12
PushProviders ,
13
13
SendRequest ,
14
14
SetUserPreferencesRequest ,
@@ -318,13 +318,13 @@ describe('send', () => {
318
318
) ;
319
319
} ) ;
320
320
} ) ;
321
- describe ( 'logQuery ' , ( ) => {
322
- const logQueryEndPointRegex = / .* \/ l o g s \/ q u e r y / ;
321
+ describe ( 'queryLogs ' , ( ) => {
322
+ const queryLogsEndPointRegex = / .* \/ l o g s \/ q u e r y / ;
323
323
const clientId = 'testClientId' ;
324
324
const clientSecret = 'testClientSecret' ;
325
325
326
326
test ( 'makes API calls to the correct end-point, non custom' , async ( ) => {
327
- const nonCostumeQuery : LogQueryPostBody = {
327
+ const nonCostumeQuery : queryLogsPostBody = {
328
328
dateRangeFilter : { startTime : 1715904000000 , endTime : 1718668799999 } ,
329
329
notificationFilter : [ 'test' ] ,
330
330
channelFilter : [ Channels . CALL ] ,
@@ -333,24 +333,24 @@ describe('logQuery', () => {
333
333
trackingIds : [ 'e2d6987f-52c' ] ,
334
334
envIdFilter : [ clientId ]
335
335
} ;
336
- axiosMock . onPost ( logQueryEndPointRegex ) . reply ( 200 ) ;
336
+ axiosMock . onPost ( queryLogsEndPointRegex ) . reply ( 200 ) ;
337
337
notificationapi . init ( clientId , clientSecret ) ;
338
- await notificationapi . logQuery ( nonCostumeQuery ) ;
338
+ await notificationapi . queryLogs ( nonCostumeQuery ) ;
339
339
expect ( axiosMock . history . post ) . toHaveLength ( 1 ) ;
340
340
expect ( axiosMock . history . post [ 0 ] . url ) . toEqual (
341
341
`https://api.notificationapi.com/${ clientId } /logs/query`
342
342
) ;
343
343
expect ( JSON . parse ( axiosMock . history . post [ 0 ] . data ) ) . toEqual ( nonCostumeQuery ) ;
344
344
} ) ;
345
345
test ( 'makes API calls to the correct end-point, custom' , async ( ) => {
346
- const nonCostumeQuery : LogQueryPostBody = {
346
+ const nonCostumeQuery : queryLogsPostBody = {
347
347
dateRangeFilter : { startTime : 1715904000000 , endTime : 1718668799999 } ,
348
348
customFilter :
349
349
'fields @message| filter @logStream like /NotificationsSummary/| sort @timestamp desc'
350
350
} ;
351
- axiosMock . onPost ( logQueryEndPointRegex ) . reply ( 200 ) ;
351
+ axiosMock . onPost ( queryLogsEndPointRegex ) . reply ( 200 ) ;
352
352
notificationapi . init ( clientId , clientSecret ) ;
353
- await notificationapi . logQuery ( nonCostumeQuery ) ;
353
+ await notificationapi . queryLogs ( nonCostumeQuery ) ;
354
354
expect ( axiosMock . history . post ) . toHaveLength ( 1 ) ;
355
355
expect ( axiosMock . history . post [ 0 ] . url ) . toEqual (
356
356
`https://api.notificationapi.com/${ clientId } /logs/query`
0 commit comments