@bandwidth/numbers
Advanced tools
Comparing version 1.6.0 to 1.7.0
@@ -15,3 +15,16 @@ var Client = require("./client"); | ||
}); | ||
}, | ||
getProducts: function(client, callback) { | ||
if(arguments.length === 1){ | ||
callback = client; | ||
client = new Client(); | ||
} | ||
client.makeRequest("get", client.concatAccountPath("products"), function(err,res) { | ||
if(err){ | ||
return callback(err); | ||
} | ||
callback(null, res.products); | ||
}); | ||
} | ||
} | ||
} |
{ | ||
"name": "@bandwidth/numbers", | ||
"version": "1.6.0", | ||
"version": "1.7.0", | ||
"description": "NodeJs Client library for Bandwidth Numbers API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -27,2 +27,3 @@ # node-numbers | ||
| 1.6.0 | Added create origination settings for sip peers | | ||
| 1.7.0 | Added get products to account | | ||
@@ -1389,1 +1390,7 @@ | ||
``` | ||
## Get Account Products | ||
```js | ||
console.log(await numbers.Account.getProductsAsync()); | ||
``` |
@@ -27,2 +27,15 @@ var lib = require("../"); | ||
}); | ||
describe("#getProducts", function(){ | ||
it("should get account product info", function(done){ | ||
helper.nock().get("/accounts/FakeAccountId/products").reply(200, helper.xml.accountProducts, {"Content-Type": "application/xml"}); | ||
Account.getProducts(helper.createClient(), function(err, accountProducts){ | ||
if(err) { | ||
return done(err); | ||
} | ||
accountProducts.product[0].name.should.eql("Termination"); | ||
accountProducts.product[1].name.should.eql("VirtualInventory"); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); |
@@ -69,3 +69,3 @@ { | ||
"csrResponse": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><CsrResponse><OrderId>218a295f-4f8a-4d1a-ba55-3e0aac6207cb</OrderId><Status>RECEIVED</Status></CsrResponse>", | ||
"originationSettings": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><SipPeerOriginationSettingsResponse> <SipPeerOriginationSettings> <VoiceProtocol>HTTP</VoiceProtocol> <HttpSettings> <HttpVoiceV2AppId>{{voice-applicationId}}</HttpVoiceV2AppId> </HttpSettings> </SipPeerOriginationSettings></SipPeerOriginationSettingsResponse>" | ||
} | ||
"originationSettings": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><SipPeerOriginationSettingsResponse> <SipPeerOriginationSettings> <VoiceProtocol>HTTP</VoiceProtocol> <HttpSettings> <HttpVoiceV2AppId>{{voice-applicationId}}</HttpVoiceV2AppId> </HttpSettings> </SipPeerOriginationSettings></SipPeerOriginationSettingsResponse>", | ||
"accountProducts": "<?xml version=\"1.0\"?><AccountProductsResponse> <Products> <Product><Name>Termination</Name><Features> <Feature>TermHttpVoice</Feature></Features> </Product> <Product><Name>VirtualInventory</Name> </Product></Products></AccountProductsResponse>"} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
387906
8638
1395