@@ -7,7 +7,10 @@ import snakeCase from 'lodash/snakeCase';
77
88import { BaseModule } from '../baseModule' ;
99import { SmsDetails } from '../sms/types/SmsDetails' ;
10- import { MessageResponse } from '../../types/MessageResponse' ;
10+ import {
11+ ApiMessageResponse ,
12+ MessageResponse ,
13+ } from '../../types/MessageResponse' ;
1114import {
1215 MessageError ,
1316 MessageErrorResponse ,
@@ -86,8 +89,8 @@ export class BaseMessageModule extends BaseModule {
8689 const formData = this . getFormDataForVmsLocalFile ( body , content ) ;
8790
8891 const data = await this . httpClient . post <
89- MessageResponse | MessageErrorResponse ,
90- MessageResponse | MessageErrorResponse
92+ ApiMessageResponse | MessageErrorResponse ,
93+ ApiMessageResponse | MessageErrorResponse
9194 > ( this . endpoint , formData . getBuffer ( ) , {
9295 headers : formData . getHeaders ( ) ,
9396 } ) ;
@@ -100,8 +103,8 @@ export class BaseMessageModule extends BaseModule {
100103 }
101104
102105 const data = await this . httpClient . post <
103- MessageResponse | MessageErrorResponse ,
104- MessageResponse | MessageErrorResponse
106+ ApiMessageResponse | MessageErrorResponse ,
107+ ApiMessageResponse | MessageErrorResponse
105108 > ( this . endpoint , body ) ;
106109
107110 if ( isMessageErrorResponseData ( data ) ) {
@@ -204,12 +207,12 @@ export class BaseMessageModule extends BaseModule {
204207 } ) ;
205208 }
206209
207- protected formatResponse ( response : MessageResponse ) : MessageResponse {
210+ protected formatResponse ( response : ApiMessageResponse ) : MessageResponse {
208211 return {
209212 ...response ,
210213 list : response . list . map ( ( sms ) => ( {
211214 ...sms ,
212- dateSent : new Date ( sms . dateSent ) ,
215+ dateSent : new Date ( sms . dateSent * 1000 ) ,
213216 points :
214217 typeof sms . points === 'string' ? parseFloat ( sms . points ) : sms . points ,
215218 } ) ) ,
0 commit comments