From aa141b6e9d0d6b8be4bc2a1324defb1b6e13b7cc Mon Sep 17 00:00:00 2001 From: PJ Cavanaugh Date: Fri, 29 Jun 2018 12:36:06 -0500 Subject: [PATCH 1/4] call my_admin_access --- package.json | 2 +- src/boss/organization.js | 3 ++- test/boss/organization_test.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index facdc17..ddb508f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ngin_client", - "version": "0.2.63", + "version": "0.2.64", "description": "Node client for interacting with the NGIN API services", "main": "./index.js", "dependencies": { diff --git a/src/boss/organization.js b/src/boss/organization.js index 3061385..e201c90 100644 --- a/src/boss/organization.js +++ b/src/boss/organization.js @@ -37,7 +37,8 @@ module.exports = function(ngin) { mine: function(options, callback) { if (typeof options == 'function') callback = options, options = {} - var url = Organization.urlRoot() + '/mine' + if(config.my_admin_access_roles) options.query = _.extend({}, options.query, {roles:config.my_admin_access_roles}) + var url = Organization.urlRoot() + '/my_admin_access' return Model.list.call(this, url, options, callback) } diff --git a/test/boss/organization_test.js b/test/boss/organization_test.js index bed38cc..1019354 100644 --- a/test/boss/organization_test.js +++ b/test/boss/organization_test.js @@ -45,7 +45,7 @@ describe('Organization Model', function() { assert(!err) assert(!!org) assert.equal(resp.req.method, 'GET') - assert.equal(JSON.parse(resp.body).metadata.url, '/organizations/mine') + assert.equal(JSON.parse(resp.body).metadata.url, '/organizations/my_admin_access') done() }) }) From fe8ba843e5d5d87bad3bbc61656e4a49c5bc4a04 Mon Sep 17 00:00:00 2001 From: PJ Cavanaugh Date: Fri, 29 Jun 2018 15:00:31 -0500 Subject: [PATCH 2/4] Use qsStringifyOptions for array params --- package.json | 2 +- src/boss/organization.js | 2 +- src/sync.js | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ddb508f..47cf5b8 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "dependencies": { "async": "0.2.x", "glob": "*", - "request": "2.16.6", + "request": "^2.72.0", "underscore": "*", "extendable": "git://github.com/mikefrey/extendable-1" }, diff --git a/src/boss/organization.js b/src/boss/organization.js index e201c90..ffb1d50 100644 --- a/src/boss/organization.js +++ b/src/boss/organization.js @@ -37,7 +37,7 @@ module.exports = function(ngin) { mine: function(options, callback) { if (typeof options == 'function') callback = options, options = {} - if(config.my_admin_access_roles) options.query = _.extend({}, options.query, {roles:config.my_admin_access_roles}) + if (config.my_admin_access_roles) options.query = _.extend({}, options.query, { roles: config.my_admin_access_roles }) var url = Organization.urlRoot() + '/my_admin_access' return Model.list.call(this, url, options, callback) } diff --git a/src/sync.js b/src/sync.js index 68807e7..859604d 100644 --- a/src/sync.js +++ b/src/sync.js @@ -62,6 +62,7 @@ module.exports = function(ngin) { // translate from query to qs for request if (params.query) { params.qs = _.extend({}, params.query) + params.qsStringifyOptions = { arrayFormat: 'brackets' } } // put the org id on the query string From 2ebbbd9dd33ff5b848020262088d4914b8643446 Mon Sep 17 00:00:00 2001 From: PJ Cavanaugh Date: Fri, 29 Jun 2018 15:05:27 -0500 Subject: [PATCH 3/4] Only set stringify options for my_admin_access --- src/boss/organization.js | 5 ++++- src/sync.js | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/boss/organization.js b/src/boss/organization.js index ffb1d50..ae510d7 100644 --- a/src/boss/organization.js +++ b/src/boss/organization.js @@ -37,7 +37,10 @@ module.exports = function(ngin) { mine: function(options, callback) { if (typeof options == 'function') callback = options, options = {} - if (config.my_admin_access_roles) options.query = _.extend({}, options.query, { roles: config.my_admin_access_roles }) + if (config.my_admin_access_roles) { + options.query = _.extend({}, options.query, { roles: config.my_admin_access_roles }) + options.qsStringifyOptions = _.extend({}, options.qsStringifyOptions, { arrayFormat: 'brackets' }) + } var url = Organization.urlRoot() + '/my_admin_access' return Model.list.call(this, url, options, callback) } diff --git a/src/sync.js b/src/sync.js index 859604d..68807e7 100644 --- a/src/sync.js +++ b/src/sync.js @@ -62,7 +62,6 @@ module.exports = function(ngin) { // translate from query to qs for request if (params.query) { params.qs = _.extend({}, params.query) - params.qsStringifyOptions = { arrayFormat: 'brackets' } } // put the org id on the query string From bf2b3cd35d87243cf42cd23b1441e7995b8ea98e Mon Sep 17 00:00:00 2001 From: PJ Cavanaugh Date: Fri, 29 Jun 2018 15:31:40 -0500 Subject: [PATCH 4/4] Set package versions to when it last passed travis --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 47cf5b8..a16c3a3 100644 --- a/package.json +++ b/package.json @@ -5,15 +5,15 @@ "main": "./index.js", "dependencies": { "async": "0.2.x", - "glob": "*", + "glob": "4.4.x", "request": "^2.72.0", - "underscore": "*", + "underscore": "1.8.x", "extendable": "git://github.com/mikefrey/extendable-1" }, "devDependencies": { - "mocha": "*", - "sinon": "*", - "blanket": "*" + "mocha": "2.1.x", + "sinon": "1.13.x", + "blanket": "1.1.x" }, "engines": { "node": ">=0.8.0 <0.11"