const easySoapRequest = require('easy-soap-request') const { userTechnicalData } = require('./request') async function soapAxios(url, headers, request) { return easySoapRequest({ url: url, headers: headers, xml: request, }).catch(err => { log('error', url) log('error', err) return err }) } async function getContractData(url, apiAuthKey, userLogin, pointId) { const sampleHeaders = { 'Content-Type': 'text/xml;charset=UTF-8', apikey: apiAuthKey, } return soapAxios( url, sampleHeaders, userTechnicalData(pointId, userLogin) ).catch(err => { return err }) } async function getDetailedData(url, apiAuthKey, template) { const sampleHeaders = { 'Content-Type': 'text/xml;charset=UTF-8', apikey: apiAuthKey, } return soapAxios( url, sampleHeaders, template ).catch(err => { return err }) } module.exports = { getContractData, getDetailedData }