cce-unified-config
Advanced tools
Comparing version 0.9.1 to 0.9.2
28
index.js
@@ -79,13 +79,19 @@ const request = require('request-promise-native') | ||
async get(type, id) { | ||
return request({ | ||
url: `${this.url}${type.toLowerCase()}/${id}`, | ||
headers: { | ||
'Accept': 'application/json' | ||
}, | ||
auth: { | ||
user: this.auth.username, | ||
pass: this.auth.password | ||
}, | ||
json: true | ||
}) | ||
try { | ||
const response = await request({ | ||
url: `${this.url}${type.toLowerCase()}/${id}`, | ||
headers: { | ||
'Accept': 'application/xml' | ||
}, | ||
auth: { | ||
user: this.auth.username, | ||
pass: this.auth.password | ||
} | ||
}) | ||
const jsonData = await parseXmlString(response) | ||
// console.log('jsonData', jsonData) | ||
return jsonData[type] | ||
} catch (e) { | ||
throw e | ||
} | ||
} | ||
@@ -92,0 +98,0 @@ |
{ | ||
"name": "cce-unified-config", | ||
"version": "0.9.1", | ||
"version": "0.9.2", | ||
"description": "JavaScript library for Cisco Contact Center Enterprise APIs", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
14281
433