nl_tokens: The main and only method of the client search . It takes searchQuery either VIN or registration number . Returns object in the following form : { results : [ ... ] count : 1 time : 2016 - 03 - 03T07 : 10 : 55 . 213Z }
pl_tokens: function ( searchQuery ) { return request ( constructSearchUrl ( searchQuery ) ) . then ( function ( body ) { let $ = cheerio . load ( body ) ; let <mask> = $ ( 'table#celacr tr' ) ; let promises = rows . filter ( idx => idx >= 1 ) // skip header row (index=0) . map ( ( idx , el ) => parseVehicleID ( $ , el ) ) . get ( ) // convert cheerio object to plain array . map ( getByID ) ; return Promise . all ( promises ) ; } ) . then ( formatDetails ) ; }