kinvey-flex-sdk
Advanced tools
Comparing version 2.0.9 to 2.1.0
## Changelog | ||
### 2.1.0 | ||
* Added role helper to kinveyEntity module (ronheiney) | ||
* FLEX-212 Disable proxy for push and email modules | ||
* FLEX-68 Disable proxy when using dataStore | ||
* FLEX-204 Fixed errors for null or empty entityIds for dataStore, groupStore, and userStore | ||
* Updated request module to 2.85.0 | ||
* Updated code-task-receiver to 2.2.3 to add response object parsing for FlexFunctions (FLEX-220) | ||
### 2.0.9 | ||
@@ -4,0 +12,0 @@ * FLEX-173 Fix for content.objectName undefined if request.collectionName passed |
@@ -66,3 +66,4 @@ /** | ||
headers, | ||
json: true | ||
json: true, | ||
proxy: false | ||
}; | ||
@@ -69,0 +70,0 @@ |
@@ -53,3 +53,3 @@ /** | ||
if (!entityId || typeof entityId === 'function') { | ||
callback = entityId; | ||
callback = typeof entityId === 'function' ? entityId : callback; | ||
const err = new Error('DataStoreError'); | ||
@@ -87,3 +87,3 @@ err.description = 'Bad Request'; | ||
if (!entityId || typeof entityId === 'function') { | ||
callback = entityId; | ||
callback = typeof entityId === 'function' ? entityId : callback; | ||
const err = new Error('DataStoreError'); | ||
@@ -90,0 +90,0 @@ err.description = 'Bad Request'; |
@@ -76,3 +76,4 @@ /** | ||
html: htmlBody | ||
} | ||
}, | ||
proxy: false | ||
}, (err, res, body) => { | ||
@@ -79,0 +80,0 @@ if (callback) { |
@@ -83,3 +83,3 @@ /** | ||
if (!groupId || typeof groupId === 'function') { | ||
callback = groupId; | ||
callback = typeof groupId === 'function' ? groupId : callback; | ||
const err = new Error('GroupStoreError'); | ||
@@ -100,3 +100,3 @@ err.description = 'Bad Request'; | ||
if (!groupId || typeof groupId === 'function') { | ||
callback = groupId; | ||
callback = typeof groupId === 'function' ? groupId : callback; | ||
const err = new Error('GroupStoreError'); | ||
@@ -103,0 +103,0 @@ err.description = 'Bad Request'; |
@@ -85,2 +85,14 @@ /** | ||
function getReaderRoles() { | ||
return getProp(_entity, ['_acl', 'roles', 'r'], []); | ||
} | ||
function getUpdateRoles() { | ||
return getProp(_entity, ['_acl', 'roles', 'u'], []); | ||
} | ||
function getDeleteRoles() { | ||
return getProp(_entity, ['_acl', 'roles', 'd'], []); | ||
} | ||
function addReader(userId) { | ||
@@ -112,2 +124,23 @@ if (!(getProp(_entity, ['_acl', 'r']))) _entity._acl.r = []; | ||
function addReaderRole(roleId) { | ||
if (!(getProp(_entity, ['_acl', 'roles']))) _entity._acl.roles = {}; | ||
if (!(getProp(_entity, ['_acl', 'roles', 'r']))) _entity._acl.roles.r = []; | ||
if (_entity._acl.roles.r.indexOf(roleId) === -1) _entity._acl.roles.r.push(roleId); | ||
return aclFunctions; | ||
} | ||
function addUpdateRole(roleId) { | ||
if (!(getProp(_entity, ['_acl', 'roles']))) _entity._acl.roles = {}; | ||
if (!(getProp(_entity, ['_acl', 'roles', 'u']))) _entity._acl.roles.u = []; | ||
if (_entity._acl.roles.u.indexOf(roleId) === -1) _entity._acl.roles.u.push(roleId); | ||
return aclFunctions; | ||
} | ||
function addDeleteRole(roleId) { | ||
if (!(getProp(_entity, ['_acl', 'roles']))) _entity._acl.roles = {}; | ||
if (!(getProp(_entity, ['_acl', 'roles', 'd']))) _entity._acl.roles.d = []; | ||
if (_entity._acl.roles.d.indexOf(roleId) === -1) _entity._acl.roles.d.push(roleId); | ||
return aclFunctions; | ||
} | ||
function removeReader(userId) { | ||
@@ -151,2 +184,33 @@ let userIx = (getProp(_entity, ['_acl', 'r'], [])).indexOf(userId); | ||
function removeReaderRole(roleId) { | ||
let roleIx = (getProp(_entity, ['_acl', 'roles', 'r'], [])).indexOf(roleId); | ||
while (roleIx !== -1) { | ||
_entity._acl.roles.r.splice(roleIx, 1); | ||
roleIx = _entity._acl.roles.r.indexOf(roleId); | ||
} | ||
return aclFunctions; | ||
} | ||
function removeUpdateRole(roleId) { | ||
let updates = getProp(_entity, ['_acl', 'roles', 'u'], []); | ||
let roleIx = updates.indexOf(roleId); | ||
while (roleIx !== -1) { | ||
_entity._acl.roles.u.splice(roleIx, 1); | ||
updates = getProp(_entity, ['_acl', 'roles', 'u'], []); | ||
roleIx = updates.indexOf(roleId); | ||
} | ||
return aclFunctions; | ||
} | ||
function removeDeleteRole(roleId) { | ||
let deletes = getProp(_entity, ['_acl', 'roles', 'd'], []); | ||
let roleIx = deletes.indexOf(roleId); | ||
while (roleIx !== -1) { | ||
_entity._acl.roles.d.splice(roleIx, 1); | ||
deletes = getProp(_entity, ['_acl', 'roles', 'd'], []); | ||
roleIx = deletes.indexOf(roleId); | ||
} | ||
return aclFunctions; | ||
} | ||
function getGloballyReadable() { | ||
@@ -178,2 +242,5 @@ if (typeof _entity._acl.gr === 'undefined') _entity._acl.gr = null; | ||
getWriterGroups, | ||
getReaderRoles, | ||
getUpdateRoles, | ||
getDeleteRoles, | ||
addReader, | ||
@@ -183,2 +250,5 @@ addWriter, | ||
addWriterGroup, | ||
addReaderRole, | ||
addUpdateRole, | ||
addDeleteRole, | ||
removeReader, | ||
@@ -188,2 +258,5 @@ removeWriter, | ||
removeWriterGroup, | ||
removeReaderRole, | ||
removeUpdateRole, | ||
removeDeleteRole, | ||
getGloballyReadable, | ||
@@ -190,0 +263,0 @@ getGloballyWritable, |
@@ -51,3 +51,4 @@ /** | ||
messageContent: message | ||
} | ||
}, | ||
proxy: false | ||
}, (err, res, body) => { | ||
@@ -54,0 +55,0 @@ if (!isNil(callback)) { |
@@ -83,3 +83,3 @@ /** | ||
if (!userId || typeof userId === 'function') { | ||
callback = userId; | ||
callback = typeof userId === 'function' ? userId : callback; | ||
const err = new Error('UserStoreError'); | ||
@@ -121,3 +121,3 @@ err.description = 'Bad Request'; | ||
if (!userId || typeof userId === 'function') { | ||
callback = userId; | ||
callback = typeof userId === 'function' ? userId : callback; | ||
const err = new Error('UserStoreError'); | ||
@@ -143,3 +143,3 @@ err.description = 'Bad Request'; | ||
if (!userId || typeof userId === 'function') { | ||
callback = userId; | ||
callback = typeof userId === 'function' ? userId : callback; | ||
const err = new Error('UserStoreError'); | ||
@@ -165,3 +165,3 @@ err.description = 'Bad Request'; | ||
if (!userId || typeof userId === 'function') { | ||
callback = userId; | ||
callback = typeof userId === 'function' ? userId : callback; | ||
const err = new Error('UserStoreError'); | ||
@@ -168,0 +168,0 @@ err.description = 'Bad Request'; |
{ | ||
"name": "kinvey-flex-sdk", | ||
"version": "2.0.9", | ||
"version": "2.1.0", | ||
"description": "SDK for creating Kinvey Flex Services", | ||
@@ -20,3 +20,3 @@ "engines": { | ||
"bson": "0.4.23", | ||
"kinvey-code-task-runner": "2.2.2", | ||
"kinvey-code-task-runner": "2.2.3", | ||
"kinvey-datalink-errors": "0.3.0", | ||
@@ -31,3 +31,3 @@ "lodash.forown": "4.2.0", | ||
"moment": "2.21.0", | ||
"request": "2.72.0", | ||
"request": "2.85.0", | ||
"sift": "3.2.6" | ||
@@ -34,0 +34,0 @@ }, |
@@ -508,2 +508,24 @@ /** | ||
}); | ||
it('should return an error if null entityId', (done) => { | ||
const collection = this.store().collection('myCollection'); | ||
collection.findById(null, (err, result) => { | ||
should.not.exist(result); | ||
err.message.should.eql('DataStoreError'); | ||
err.description.should.eql('Bad Request'); | ||
err.debug.should.eql('entityId is required'); | ||
return done(); | ||
}); | ||
}); | ||
it('should return an error if blank entityId', (done) => { | ||
const collection = this.store().collection('myCollection'); | ||
collection.findById('', (err, result) => { | ||
should.not.exist(result); | ||
err.message.should.eql('DataStoreError'); | ||
err.description.should.eql('Bad Request'); | ||
err.debug.should.eql('entityId is required'); | ||
return done(); | ||
}); | ||
}); | ||
}); | ||
@@ -1041,2 +1063,24 @@ describe('save', () => { | ||
}); | ||
it('should return an error if null entityId', (done) => { | ||
const collection = this.store().collection('myCollection'); | ||
collection.removeById(null, (err, result) => { | ||
should.not.exist(result); | ||
err.message.should.eql('DataStoreError'); | ||
err.description.should.eql('Bad Request'); | ||
err.debug.should.eql('entityId is required'); | ||
return done(); | ||
}); | ||
}); | ||
it('should return an error if blank entityId', (done) => { | ||
const collection = this.store().collection('myCollection'); | ||
collection.removeById('', (err, result) => { | ||
should.not.exist(result); | ||
err.message.should.eql('DataStoreError'); | ||
err.description.should.eql('Bad Request'); | ||
err.debug.should.eql('entityId is required'); | ||
return done(); | ||
}); | ||
}); | ||
}); | ||
@@ -1043,0 +1087,0 @@ |
@@ -150,3 +150,4 @@ /** | ||
'removeReader', | ||
'getWriters', 'addWriter', | ||
'getWriters', | ||
'addWriter', | ||
'removeWriter', | ||
@@ -162,3 +163,12 @@ 'getReaderGroups', | ||
'setGloballyReadable', | ||
'setGloballyWritable' | ||
'setGloballyWritable', | ||
'getReaderRoles', | ||
'getUpdateRoles', | ||
'getDeleteRoles', | ||
'addReaderRole', | ||
'addUpdateRole', | ||
'addDeleteRole', | ||
'removeReaderRole', | ||
'removeUpdateRole', | ||
'removeDeleteRole' | ||
]; | ||
@@ -630,2 +640,362 @@ kinveyInstance.entity(testObject); | ||
}); | ||
describe('getReaderRoles', () => { | ||
it('returns empty array when no role readers', (done) => { | ||
const ke = kinveyInstance.entity(); | ||
ke._acl.getReaderRoles().should.eql([]); | ||
return done(); | ||
}); | ||
return it('returns correct value for entity with readers', (done) => { | ||
const ke = kinveyInstance.entity({ | ||
_acl: { | ||
roles: { | ||
r: [1, 2, 3] | ||
} | ||
} | ||
}); | ||
ke._acl.getReaderRoles().should.eql([1, 2, 3]); | ||
return done(); | ||
}); | ||
}); | ||
describe('addReaderRole', () => { | ||
it('Adds a reader to an stub entity', (done) => { | ||
const ke = kinveyInstance.entity(); | ||
ke._acl.addReaderRole('1'); | ||
ke._acl.getReaderRoles().should.eql(['1']); | ||
return done(); | ||
}); | ||
it('wont add an existing reader id', (done) => { | ||
const ke = kinveyInstance.entity({ | ||
_acl: { | ||
roles: { | ||
r: [1, 2, 3] | ||
} | ||
} | ||
}); | ||
ke._acl.addReaderRole(1); | ||
ke._acl.getReaderRoles().should.eql([1, 2, 3]); | ||
return done(); | ||
}); | ||
it('appends a role ID to existing list', (done) => { | ||
const ke = kinveyInstance.entity({ | ||
_acl: { | ||
roles: { | ||
r: [1, 2, 3] | ||
} | ||
} | ||
}); | ||
ke._acl.addReaderRole(4); | ||
ke._acl.getReaderRoles().should.eql([1, 2, 3, 4]); | ||
return done(); | ||
}); | ||
return it('returns entity acls for method chaining', (done) => { | ||
const ke = kinveyInstance.entity({ | ||
_acl: { | ||
roles: { | ||
r: [1, 2, 3] | ||
} | ||
} | ||
}); | ||
ke._acl.addReaderRole(4).getReaderRoles().should.eql([1, 2, 3, 4]); | ||
return done(); | ||
}); | ||
}); | ||
describe('removeReaderRole', () => { | ||
it('removes a reader role when a match is found', (done) => { | ||
const ke = kinveyInstance.entity({ | ||
_acl: { | ||
roles: { | ||
r: [1, 2, 3] | ||
} | ||
} | ||
}); | ||
ke._acl.removeReaderRole(1); | ||
ke._acl.getReaderRoles().should.eql([2, 3]); | ||
return done(); | ||
}); | ||
it('does nothing when a match is not found', (done) => { | ||
const ke = kinveyInstance.entity({ | ||
_acl: { | ||
roles: { | ||
r: [1, 2, 3] | ||
} | ||
} | ||
}); | ||
ke._acl.removeReaderRole(4); | ||
ke._acl.getReaderRoles().should.eql([1, 2, 3]); | ||
return done(); | ||
}); | ||
it('does nothing when no reader roles are defined', (done) => { | ||
const ke = kinveyInstance.entity({ | ||
_acl: { | ||
roles: {} | ||
} | ||
}); | ||
ke._acl.removeReaderRole(1); | ||
ke._acl.getReaderRoles().should.eql([]); | ||
return done(); | ||
}); | ||
it('will remove all instances of a role id', (done) => { | ||
const ke = kinveyInstance.entity({ | ||
_acl: { | ||
roles: { | ||
r: [1, 2, 3, 1] | ||
} | ||
} | ||
}); | ||
ke._acl.removeReaderRole(1); | ||
ke._acl.getReaderRoles().should.eql([2, 3]); | ||
return done(); | ||
}); | ||
return it('returns entity acls for method chaining', (done) => { | ||
const ke = kinveyInstance.entity({ | ||
_acl: { | ||
roles: { | ||
r: [1, 2, 3, 1] | ||
} | ||
} | ||
}); | ||
ke._acl.removeReaderRole(1).getReaderRoles().should.eql([2, 3]); | ||
return done(); | ||
}); | ||
}); | ||
describe('getUpdateRoles', () => { | ||
it('returns empty array when no role updates', (done) => { | ||
const ke = kinveyInstance.entity(); | ||
ke._acl.getUpdateRoles().should.eql([]); | ||
return done(); | ||
}); | ||
return it('returns correct value for entity with updates', (done) => { | ||
const ke = kinveyInstance.entity({ | ||
_acl: { | ||
roles: { | ||
u: [1, 2, 3] | ||
} | ||
} | ||
}); | ||
ke._acl.getUpdateRoles().should.eql([1, 2, 3]); | ||
return done(); | ||
}); | ||
}); | ||
describe('addUpdateRole', () => { | ||
it('Adds a update to an stub entity', (done) => { | ||
const ke = kinveyInstance.entity(); | ||
ke._acl.addUpdateRole('1'); | ||
ke._acl.getUpdateRoles().should.eql(['1']); | ||
return done(); | ||
}); | ||
it('wont add an existing update id', (done) => { | ||
const ke = kinveyInstance.entity({ | ||
_acl: { | ||
roles: { | ||
u: [1, 2, 3] | ||
} | ||
} | ||
}); | ||
ke._acl.addUpdateRole(1); | ||
ke._acl.getUpdateRoles().should.eql([1, 2, 3]); | ||
return done(); | ||
}); | ||
it('appends a role ID to existing list', (done) => { | ||
const ke = kinveyInstance.entity({ | ||
_acl: { | ||
roles: { | ||
u: [1, 2, 3] | ||
} | ||
} | ||
}); | ||
ke._acl.addUpdateRole(4); | ||
ke._acl.getUpdateRoles().should.eql([1, 2, 3, 4]); | ||
return done(); | ||
}); | ||
return it('returns entity acls for method chaining', (done) => { | ||
const ke = kinveyInstance.entity({ | ||
_acl: { | ||
roles: { | ||
u: [1, 2, 3] | ||
} | ||
} | ||
}); | ||
ke._acl.addUpdateRole(4).getUpdateRoles().should.eql([1, 2, 3, 4]); | ||
return done(); | ||
}); | ||
}); | ||
describe('removeUpdateRole', () => { | ||
it('removes a update role when a match is found', (done) => { | ||
const ke = kinveyInstance.entity({ | ||
_acl: { | ||
roles: { | ||
u: [1, 2, 3] | ||
} | ||
} | ||
}); | ||
ke._acl.removeUpdateRole(1); | ||
ke._acl.getUpdateRoles().should.eql([2, 3]); | ||
return done(); | ||
}); | ||
it('does nothing when a match is not found', (done) => { | ||
const ke = kinveyInstance.entity({ | ||
_acl: { | ||
roles: { | ||
u: [1, 2, 3] | ||
} | ||
} | ||
}); | ||
ke._acl.removeUpdateRole(4); | ||
ke._acl.getUpdateRoles().should.eql([1, 2, 3]); | ||
return done(); | ||
}); | ||
it('does nothing when no update roles are defined', (done) => { | ||
const ke = kinveyInstance.entity({ | ||
_acl: { | ||
roles: {} | ||
} | ||
}); | ||
ke._acl.removeUpdateRole(1); | ||
ke._acl.getUpdateRoles().should.eql([]); | ||
return done(); | ||
}); | ||
it('will remove all instances of a role id', (done) => { | ||
const ke = kinveyInstance.entity({ | ||
_acl: { | ||
roles: { | ||
u: [1, 2, 3, 1] | ||
} | ||
} | ||
}); | ||
ke._acl.removeUpdateRole(1); | ||
ke._acl.getUpdateRoles().should.eql([2, 3]); | ||
return done(); | ||
}); | ||
return it('returns entity acls for method chaining', (done) => { | ||
const ke = kinveyInstance.entity({ | ||
_acl: { | ||
roles: { | ||
u: [1, 2, 3, 1] | ||
} | ||
} | ||
}); | ||
ke._acl.removeUpdateRole(1).getUpdateRoles().should.eql([2, 3]); | ||
return done(); | ||
}); | ||
}); | ||
describe('getDeleteRoles', () => { | ||
it('returns empty array when no role deletes', (done) => { | ||
const ke = kinveyInstance.entity(); | ||
ke._acl.getDeleteRoles().should.eql([]); | ||
return done(); | ||
}); | ||
return it('returns correct value for entity with deletes', (done) => { | ||
const ke = kinveyInstance.entity({ | ||
_acl: { | ||
roles: { | ||
d: [1, 2, 3] | ||
} | ||
} | ||
}); | ||
ke._acl.getDeleteRoles().should.eql([1, 2, 3]); | ||
return done(); | ||
}); | ||
}); | ||
describe('addDeleteRole', () => { | ||
it('Adds a delete to an stub entity', (done) => { | ||
const ke = kinveyInstance.entity(); | ||
ke._acl.addDeleteRole('1'); | ||
ke._acl.getDeleteRoles().should.eql(['1']); | ||
return done(); | ||
}); | ||
it('wont add an existing delete id', (done) => { | ||
const ke = kinveyInstance.entity({ | ||
_acl: { | ||
roles: { | ||
d: [1, 2, 3] | ||
} | ||
} | ||
}); | ||
ke._acl.addDeleteRole(1); | ||
ke._acl.getDeleteRoles().should.eql([1, 2, 3]); | ||
return done(); | ||
}); | ||
it('appends a role ID to existing list', (done) => { | ||
const ke = kinveyInstance.entity({ | ||
_acl: { | ||
roles: { | ||
d: [1, 2, 3] | ||
} | ||
} | ||
}); | ||
ke._acl.addDeleteRole(4); | ||
ke._acl.getDeleteRoles().should.eql([1, 2, 3, 4]); | ||
return done(); | ||
}); | ||
return it('returns entity acls for method chaining', (done) => { | ||
const ke = kinveyInstance.entity({ | ||
_acl: { | ||
roles: { | ||
d: [1, 2, 3] | ||
} | ||
} | ||
}); | ||
ke._acl.addDeleteRole(4).getDeleteRoles().should.eql([1, 2, 3, 4]); | ||
return done(); | ||
}); | ||
}); | ||
describe('removeDeleteRole', () => { | ||
it('removes a delete role when a match is found', (done) => { | ||
const ke = kinveyInstance.entity({ | ||
_acl: { | ||
roles: { | ||
d: [1, 2, 3] | ||
} | ||
} | ||
}); | ||
ke._acl.removeDeleteRole(1); | ||
ke._acl.getDeleteRoles().should.eql([2, 3]); | ||
return done(); | ||
}); | ||
it('does nothing when a match is not found', (done) => { | ||
const ke = kinveyInstance.entity({ | ||
_acl: { | ||
roles: { | ||
d: [1, 2, 3] | ||
} | ||
} | ||
}); | ||
ke._acl.removeDeleteRole(4); | ||
ke._acl.getDeleteRoles().should.eql([1, 2, 3]); | ||
return done(); | ||
}); | ||
it('does nothing when no delete roles are defined', (done) => { | ||
const ke = kinveyInstance.entity({ | ||
_acl: { | ||
roles: {} | ||
} | ||
}); | ||
ke._acl.removeDeleteRole(1); | ||
ke._acl.getDeleteRoles().should.eql([]); | ||
return done(); | ||
}); | ||
it('will remove all instances of a role id', (done) => { | ||
const ke = kinveyInstance.entity({ | ||
_acl: { | ||
roles: { | ||
d: [1, 2, 3, 1] | ||
} | ||
} | ||
}); | ||
ke._acl.removeDeleteRole(1); | ||
ke._acl.getDeleteRoles().should.eql([2, 3]); | ||
return done(); | ||
}); | ||
return it('returns entity acls for method chaining', (done) => { | ||
const ke = kinveyInstance.entity({ | ||
_acl: { | ||
roles: { | ||
d: [1, 2, 3, 1] | ||
} | ||
} | ||
}); | ||
ke._acl.removeDeleteRole(1).getDeleteRoles().should.eql([2, 3]); | ||
return done(); | ||
}); | ||
}); | ||
describe('get global readability', () => { | ||
@@ -632,0 +1002,0 @@ it('will return null when globally readable is not set', (done) => { |
@@ -304,2 +304,22 @@ /** | ||
}); | ||
it('should return an error if null group _id', (done) => { | ||
this.store().findById(null, (err, result) => { | ||
should.not.exist(result); | ||
err.message.should.eql('GroupStoreError'); | ||
err.description.should.eql('Bad Request'); | ||
err.debug.should.eql('groupId is required'); | ||
return done(); | ||
}); | ||
}); | ||
it('should return an error if blank group _id', (done) => { | ||
this.store().findById('', (err, result) => { | ||
should.not.exist(result); | ||
err.message.should.eql('GroupStoreError'); | ||
err.description.should.eql('Bad Request'); | ||
err.debug.should.eql('groupId is required'); | ||
return done(); | ||
}); | ||
}); | ||
}); | ||
@@ -716,3 +736,23 @@ | ||
}); | ||
it('should return an error if null groupId', (done) => { | ||
this.store().remove(null, (err, result) => { | ||
should.not.exist(result); | ||
err.message.should.eql('GroupStoreError'); | ||
err.description.should.eql('Bad Request'); | ||
err.debug.should.eql('groupId is required'); | ||
return done(); | ||
}); | ||
}); | ||
it('should return an error if blank groupId', (done) => { | ||
this.store().remove('', (err, result) => { | ||
should.not.exist(result); | ||
err.message.should.eql('GroupStoreError'); | ||
err.description.should.eql('Bad Request'); | ||
err.debug.should.eql('groupId is required'); | ||
return done(); | ||
}); | ||
}); | ||
}); | ||
}); |
@@ -451,3 +451,3 @@ /** | ||
it('should return an error if missing user _id', (done) => { | ||
this.store().findById((err, result) => { | ||
this.store().findById(null, (err, result) => { | ||
should.not.exist(result); | ||
@@ -460,2 +460,12 @@ err.message.should.eql('UserStoreError'); | ||
}); | ||
it('should return an error if blank user _id', (done) => { | ||
this.store().findById('', (err, result) => { | ||
should.not.exist(result); | ||
err.message.should.eql('UserStoreError'); | ||
err.description.should.eql('Bad Request'); | ||
err.debug.should.eql('userId is required'); | ||
return done(); | ||
}); | ||
}); | ||
}); | ||
@@ -1000,2 +1010,22 @@ | ||
}); | ||
it('should return an error if null userId', (done) => { | ||
this.store().remove(null, (err, result) => { | ||
should.not.exist(result); | ||
err.message.should.eql('UserStoreError'); | ||
err.description.should.eql('Bad Request'); | ||
err.debug.should.eql('userId is required'); | ||
return done(); | ||
}); | ||
}); | ||
it('should return an error if blank userId', (done) => { | ||
this.store().remove('', (err, result) => { | ||
should.not.exist(result); | ||
err.message.should.eql('UserStoreError'); | ||
err.description.should.eql('Bad Request'); | ||
err.debug.should.eql('userId is required'); | ||
return done(); | ||
}); | ||
}); | ||
}); | ||
@@ -1288,2 +1318,22 @@ | ||
}); | ||
it('should return an error if null userId', (done) => { | ||
this.store().suspend(null, (err, result) => { | ||
should.not.exist(result); | ||
err.message.should.eql('UserStoreError'); | ||
err.description.should.eql('Bad Request'); | ||
err.debug.should.eql('userId is required'); | ||
return done(); | ||
}); | ||
}); | ||
it('should return an error if blank userId', (done) => { | ||
this.store().suspend('', (err, result) => { | ||
should.not.exist(result); | ||
err.message.should.eql('UserStoreError'); | ||
err.description.should.eql('Bad Request'); | ||
err.debug.should.eql('userId is required'); | ||
return done(); | ||
}); | ||
}); | ||
}); | ||
@@ -1418,3 +1468,23 @@ | ||
}); | ||
it('should return an error if null userId', (done) => { | ||
this.store().suspend(null, (err, result) => { | ||
should.not.exist(result); | ||
err.message.should.eql('UserStoreError'); | ||
err.description.should.eql('Bad Request'); | ||
err.debug.should.eql('userId is required'); | ||
return done(); | ||
}); | ||
}); | ||
it('should return an error if blank userId', (done) => { | ||
this.store().suspend('', (err, result) => { | ||
should.not.exist(result); | ||
err.message.should.eql('UserStoreError'); | ||
err.description.should.eql('Bad Request'); | ||
err.debug.should.eql('userId is required'); | ||
return done(); | ||
}); | ||
}); | ||
}); | ||
}); |
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
507960
46
11285
+ Addedajv@5.5.2(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedboom@4.3.15.3.3(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedco@4.6.0(transitive)
+ Addedcryptiles@3.2.1(transitive)
+ Addedfast-deep-equal@1.1.0(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedform-data@2.3.3(transitive)
+ Addedhar-schema@2.0.0(transitive)
+ Addedhar-validator@5.0.3(transitive)
+ Addedhawk@6.0.2(transitive)
+ Addedhoek@4.3.1(transitive)
+ Addedhttp-signature@1.2.0(transitive)
+ Addedjson-schema-traverse@0.3.1(transitive)
+ Addedkinvey-code-task-runner@2.2.3(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedpunycode@1.4.1(transitive)
+ Addedqs@6.5.3(transitive)
+ Addedrequest@2.85.0(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsntp@2.1.0(transitive)
+ Addedtough-cookie@2.3.4(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addeduuid@3.4.0(transitive)
- Removedansi-regex@2.1.1(transitive)
- Removedansi-styles@2.2.1(transitive)
- Removedassert-plus@0.2.0(transitive)
- Removedasync@2.6.4(transitive)
- Removedaws-sign2@0.6.0(transitive)
- Removedbl@1.1.2(transitive)
- Removedboom@2.10.1(transitive)
- Removedcaseless@0.11.0(transitive)
- Removedchalk@1.1.3(transitive)
- Removedcommander@2.20.3(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedcryptiles@2.0.5(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedform-data@1.0.1(transitive)
- Removedgenerate-function@2.3.1(transitive)
- Removedgenerate-object-property@1.2.0(transitive)
- Removedhar-validator@2.0.6(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedhawk@3.1.3(transitive)
- Removedhoek@2.16.3(transitive)
- Removedhttp-signature@1.1.1(transitive)
- Removedis-my-ip-valid@1.0.1(transitive)
- Removedis-my-json-valid@2.20.6(transitive)
- Removedis-property@1.0.2(transitive)
- Removedisarray@1.0.0(transitive)
- Removedjsonpointer@5.0.1(transitive)
- Removedkinvey-code-task-runner@2.2.2(transitive)
- Removedlodash@4.17.21(transitive)
- Removednode-uuid@1.4.8(transitive)
- Removedpinkie@2.0.4(transitive)
- Removedpinkie-promise@2.0.1(transitive)
- Removedprocess-nextick-args@1.0.7(transitive)
- Removedreadable-stream@2.0.6(transitive)
- Removedrequest@2.72.0(transitive)
- Removedsntp@1.0.9(transitive)
- Removedstring_decoder@0.10.31(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedsupports-color@2.0.0(transitive)
- Removedtough-cookie@2.2.2(transitive)
- Removedtunnel-agent@0.4.3(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedxtend@4.0.2(transitive)
Updatedrequest@2.85.0