Comparing version 0.11.0 to 1.0.0
@@ -57,7 +57,2 @@ const xmlBuilder = require('xmlbuilder') | ||
case 'undefined': | ||
values = _.assign(xsi, xmlns, { | ||
'key': changeCase.constantCase(key), | ||
'value': secure(value) | ||
}) | ||
break | ||
case 'string': | ||
@@ -71,3 +66,3 @@ case 'number': | ||
break | ||
default: | ||
default: // object, Array, Date | ||
if (value === null) { | ||
@@ -88,17 +83,3 @@ return null | ||
.concat(Object.keys(value).map(function (key) { | ||
let val = value[key] | ||
let typ | ||
if (val.type) { | ||
typ = dto.getType(val.type) | ||
val = val.value | ||
} else { | ||
typ = dto.getType(val) | ||
} | ||
return { | ||
'value': { | ||
'@xsi:type': 'q' + (index + 1) + ':' + typ, | ||
'key': changeCase.constantCase(key), | ||
'value': secure(val) | ||
} | ||
} | ||
return buildValue(key, value[key], index, true) | ||
})) | ||
@@ -105,0 +86,0 @@ } |
{ | ||
"name": "cdrator", | ||
"version": "0.11.0", | ||
"version": "1.0.0", | ||
"description": "Call CDRator SOAP WebServices using node.js", | ||
@@ -34,2 +34,3 @@ "main": "lib/cdrator", | ||
"chai": "^3.0.0", | ||
"chai-xml": "^0.3.2", | ||
"eslint-config-standard": "^5.3.5", | ||
@@ -36,0 +37,0 @@ "eslint-plugin-import": "^2.7.0", |
@@ -0,5 +1,9 @@ | ||
const chai = require('chai') | ||
const { expect } = require('chai') | ||
const chaiXml = require('chai-xml') | ||
const helper = require('../../helper') | ||
const soaper = require(process.cwd() + '/lib/soaper') | ||
chai.use(chaiXml) | ||
describe('soaper - subscribeProductOptions', function () { | ||
@@ -27,2 +31,27 @@ let context | ||
}) | ||
it('succeeds with parameters', function () { | ||
const hookpointKey = 'SOAP_SUBSCRIBE_PRODUCT_OPTIONS' | ||
const args = { | ||
subscriptionId: '201612222222222222', | ||
productOptions: [{ | ||
id: '201703333333333333', | ||
productOptionParameters: [ | ||
{ | ||
KEY: 'VOICE_CF_NUM_NO_COND', | ||
VALUE: '46700000000' | ||
}, | ||
{ | ||
KEY: 'VOICE_CF_NUM_UNREACHABLE', | ||
VALUE: '47444444444' | ||
} | ||
] | ||
}], | ||
context: context | ||
} | ||
const result = soaper.buildEnvelope(hookpointKey, args) | ||
const expected = helper.getXml('subscribeProductOptions-request-with-params') | ||
expect(result).xml.to.deep.equal(expected) | ||
}) | ||
}) | ||
@@ -29,0 +58,0 @@ describe('#parse', function () { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
769051
85
2482
1
15