function getDestinationDetails()

in scp-odata-proxy-api/odataproxyapi/start.js [174:199]


function getDestinationDetails(dest, token) {
  return new Promise((resolve, reject) => {
    try {
      const get_options = {
        url: dest.uri + '/destination-configuration/v1/destinations/' + abapDest,
        headers: {
          'Authorization': 'Bearer ' + token
        }
      }
      request(get_options, (err, res, data) => {
        if (res.statusCode === 200) {
          resolve(JSON.parse(data).destinationConfiguration)
        } else {
          if (err) {
            reject(err)
          } else {
            reject(data)
          }

        }
      })
    } catch (e) {
      reject(e)
    }
  })
}