@@ -3,6 +3,7 @@ import { sha256 } from '../lib/hashing.js';
33import  type  {  DbCalculation  }  from  '../models/directbilling/service/db.calculation.js' ; 
44import  type  {  DbService  }  from  '../models/directbilling/service/db.service.js' ; 
55import  type  {  PartialDbService  }  from  '../models/directbilling/service/partial.db.service.js' ; 
6+ import  type  {  DirectBillingServicePaginatedResponse  }  from  '../models/directbilling/service/service-paginated.response.js' ; 
67import  type  {  DbGenerationResponse  }  from  '../models/directbilling/transaction/db.generation.response.js' ; 
78import  type  {  DbNotificationRequest  }  from  '../models/directbilling/transaction/db.notifications.request.js' ; 
89import  type  {  DbTransaction  }  from  '../models/directbilling/transaction/db.transaction.js' ; 
@@ -25,7 +26,7 @@ export class DirectBilling {
2526            headers : { 
2627                'X-SIM-KEY' : this . key , 
2728                'X-SIM-PASSWORD' : this . password , 
28-                 'X-SIM-VERSION' : '3.0.3 ' , 
29+                 'X-SIM-VERSION' : '3.1.0 ' , 
2930                'X-SIM-PLATFORM' : 'TYPESCRIPT' , 
3031            } , 
3132        } ) ; 
@@ -60,17 +61,17 @@ export class DirectBilling {
6061        page ?: number , 
6162        pageSize ?: number , 
6263    ) : Promise < PaginatedResponse < PartialDbService > >  { 
63-         const  query : any  =  { } ; 
64+         const  query : Record < string ,   string >  =  { } ; 
6465
6566        if  ( page )  query . page  =  `${ page }  ; 
6667        if  ( pageSize )  query . limit  =  `${ pageSize }  ; 
6768
6869        const  url  =  `/?${ new  URLSearchParams ( query ) . toString ( ) }  ; 
6970
70-         const  response  =  ( await  this . client . get ( url ) ) . data ; 
71+         const  response  =  ( await  this . client . get < DirectBillingServicePaginatedResponse > ( url ) ) . data ; 
7172
72-         response . data  =  response . data . map ( ( e :  any )  =>  { 
73-             e . created_at  =  new  Date ( e . created_at . replace ( ' ' ,  'T' ) ) ; 
73+         response . data  =  response . data . map ( ( e )  =>  { 
74+             e . created_at  =  new  Date ( e . created_at . toString ( ) . replace ( ' ' ,  'T' ) ) ; 
7475
7576            return  e ; 
7677        } ) ; 
@@ -134,7 +135,7 @@ export class DirectBilling {
134135        page ?: number , 
135136        pageSize ?: number , 
136137    ) : Promise < PaginatedResponse < PartialDbTransaction > >  { 
137-         const  query : any  =  { } ; 
138+         const  query : Record < string ,   string >  =  { } ; 
138139
139140        if  ( page )  query . page  =  `${ page }  ; 
140141        if  ( pageSize )  query . limit  =  `${ pageSize }  ; 
@@ -185,12 +186,12 @@ export class DirectBilling {
185186    /* 
186187        https://docs.simpay.pl/shell/?shell#directbilling-generowanie-transakcji 
187188     */ 
188-     checkNotification ( key : string ,  body : any )  { 
189+     checkNotification ( key : string ,  body : DbNotificationRequest )  { 
189190        const  signature  =  this . generateSignatureNotification ( key ,  body ) ; 
190191
191192        if  ( body . signature  !==  signature )  return  undefined ; 
192193
193-         return  < DbNotificationRequest > body ; 
194+         return  body   as   DbNotificationRequest ; 
194195    } 
195196
196197    /* 
0 commit comments