mirror of
https://github.com/donl/plivo-node.git
synced 2026-05-26 06:12:28 -06:00
Add meta property to list responses
This commit is contained in:
parent
4f85b61e31
commit
bf5db4a5e6
4 changed files with 13 additions and 2 deletions
|
|
@ -113,6 +113,7 @@ export class PlivoResourceInterface {
|
|||
client('GET', action, params)
|
||||
.then(response => {
|
||||
let objects = [];
|
||||
Object.defineProperty(objects, 'meta', {value: response.body.meta});
|
||||
response.body.objects.forEach(item => {
|
||||
objects.push(new Klass(client, item));
|
||||
});
|
||||
|
|
@ -141,4 +142,3 @@ export class PlivoResourceInterface {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,10 @@ export function Request(config) {
|
|||
options.proxy = config.proxy;
|
||||
}
|
||||
|
||||
if (typeof config.timeout !== 'undefined') {
|
||||
options.timeout = config.timeout;
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
// LiveCall - needs to be at top
|
||||
if (method === 'GET' && action === 'Call/6653422-91b6-4716-9fad-9463daaeeec2/' && params.status === 'live') {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,13 @@ describe('Application', function () {
|
|||
})
|
||||
});
|
||||
|
||||
it('has meta information', function () {
|
||||
return client.applications.list()
|
||||
.then(function(applications) {
|
||||
assert.equal(applications.meta.total_count, 19)
|
||||
})
|
||||
});
|
||||
|
||||
it('should create application via interface', function () {
|
||||
return client.applications.create('appName')
|
||||
.then(function(application){
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ describe('calls', function () {
|
|||
it('should get a livecall', function () {
|
||||
return client.calls.getLiveCall('6653422-91b6-4716-9fad-9463daaeeec2')
|
||||
.then(function (resp) {
|
||||
console.log(resp);
|
||||
// console.log(resp);
|
||||
assert.equal(resp.callUuid, '6653422-91b6-4716-9fad-9463daaeeec2');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue