Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cce-unified-config

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cce-unified-config - npm Package Compare versions

Comparing version 0.9.0 to 0.9.1

test/test.js

44

index.js

@@ -0,1 +1,2 @@

const request = require('request-promise-native')
const axios = require('axios')

@@ -77,18 +78,23 @@ const parseXmlString = require('./parse-xml')

async get(type, id, q) {
// pass params from input
const params = {q}
try {
return await axios.get(`${this.url}${type.toLowerCase()}/${id}`, body, {auth: this.auth, params})
} catch (e) {
throw e
}
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
})
}
async modify(type, body, q) {
// pass params from input
const params = {q}
async modify(type, id, body) {
try {
const response = await axios.put(`https://${this.host}${body.refURL}`, body, {auth: this.auth, params})
return response
const url = `${this.url}${type.toLowerCase()}/${id}`
console.log('trying to PUT url', url)
const response = await axios.put(url, body, {auth: this.auth})
// console.log(response)
return response.data
} catch (e) {

@@ -99,8 +105,8 @@ throw e

async create(type, body, q) {
// pass params from input
const params = {q}
async create(type, body) {
try {
const response = await axios.post(this.url + type.toLowerCase(), body, {auth: this.auth, params})
return response
const url = this.url + type.toLowerCase()
const response = await axios.post(url, body, {auth: this.auth})
// console.log('cce-unified-config create success response:', response)
return response.headers.location
} catch (e) {

@@ -120,2 +126,4 @@ throw e

// 'Content-Type'
// don't change this to application/json because some types like precisionqueue
// will return a 406
'Accept': 'application/xml'

@@ -122,0 +130,0 @@ }

{
"name": "cce-unified-config",
"version": "0.9.0",
"version": "0.9.1",
"description": "JavaScript library for Cisco Contact Center Enterprise APIs",
"main": "index.js",
"scripts": {
"start": "node index",
"start": "NODE_TLS_REJECT_UNAUTHORIZED=0 node index",
"test": "NODE_TLS_REJECT_UNAUTHORIZED=0 mocha"

@@ -27,4 +27,6 @@ },

"axios": "^0.16.2",
"request": "^2.87.0",
"request-promise-native": "^1.0.5",
"xml2js": "^0.4.19"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc