delivery-tracker icon indicating copy to clipboard operation
delivery-tracker copied to clipboard

Feature Request: Return raw response for custom parsing

Open dpacmittal opened this issue 6 years ago • 1 comments

First of all, thankyou for creating this package. It has helped me tons. I only require Fedex tracking and fedex docs are super confusing, so this has been a lifesaver.

I'd like to request a feature to return raw response for tracking. For eg; Fedex gives tons of data about shipment but the returned data is just an array of 'scans'. It'd be useful if we could set a flag to return all data.

dpacmittal avatar Sep 04 '18 07:09 dpacmittal

I'll thank about it, but I do not I can guarantee it. If you only need feature in Fedex, how about making by referring to the function below?

var trackingInfo = function (numbers) {
  var trackingInfoList = []
  if (numbers instanceof Array === false) {
    numbers = [numbers]
  }
  for (var i = 0; i < numbers.length; i++) {
    trackingInfoList.push({
      trackNumberInfo: {
        trackingNumber: numbers[i]
      }
    })
  }
  return {
    method: 'POST',
    url: 'https://www.fedex.com/trackingCal/track',
    data: {
      data: JSON.stringify({
        TrackPackagesRequest: {
          trackingInfoList: trackingInfoList
        }
      }),
      action: 'trackpackages'
    }
  }
}

egg- avatar Sep 19 '18 01:09 egg-