Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ try {
const options = {
size: 50,
offset: 0,
scroll: '10m'
scroll: '10s'
};

const searchResult = await kuzzle.collection.searchSpecifications(body, options);
Expand Down
2 changes: 1 addition & 1 deletion doc/7/core-classes/search-result/next/snippets/scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ try {
'nyc-open-data',
'yellow-taxi',
{ query: { match: { category: 'suv' } } },
{ scroll: '1m', size: 10 });
{ scroll: '10s', size: 10 });

// Fetch the matched items by advancing through the result pages
const matched = [];
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kuzzle-sdk",
"version": "7.1.2",
"version": "7.1.3",
"description": "Official Javascript SDK for Kuzzle",
"author": "The Kuzzle Team <[email protected]>",
"repository": {
Expand Down
5 changes: 0 additions & 5 deletions src/Kuzzle.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const
ServerController = require('./controllers/server'),
SecurityController = require('./controllers/security'),
MemoryStorageController = require('./controllers/memoryStorage'),
BaseController = require('./controllers/base'),
uuidv4 = require('./uuidv4'),
proxify = require('./proxify');

Expand Down Expand Up @@ -517,10 +516,6 @@ Discarded request: ${JSON.stringify(request)}`));
* @returns {Kuzzle}
*/
useController (ControllerClass, accessor) {
if (!(ControllerClass.prototype instanceof BaseController)) {
throw new Error('Controllers must inherits from the BaseController class.');
}

if (!(accessor && accessor.length > 0)) {
throw new Error('You must provide a valid accessor.');
}
Expand Down
4 changes: 2 additions & 2 deletions test/controllers/document.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ describe('Document Controller', () => {
};
kuzzle.query.resolves({result});

return kuzzle.document.search('index', 'collection', {foo: 'bar'}, {from: 1, size: 2, scroll: '1m'})
return kuzzle.document.search('index', 'collection', {foo: 'bar'}, {from: 1, size: 2, scroll: '10s'})
.then(res => {
should(kuzzle.query)
.be.calledOnce()
Expand All @@ -424,7 +424,7 @@ describe('Document Controller', () => {
body: {foo: 'bar'},
from: 1,
size: 2,
scroll: '1m'
scroll: '10s'
}, {});

should(res).be.an.instanceOf(DocumentSearchResult);
Expand Down
4 changes: 2 additions & 2 deletions test/controllers/searchResult/document.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe('DocumentSearchResult', () => {
};

beforeEach(() => {
request.scroll = '1m';
request.scroll = '10s';

response = {
scrollId: 'scroll-id',
Expand All @@ -130,7 +130,7 @@ describe('DocumentSearchResult', () => {
.be.calledWith({
controller: 'document',
action: 'scroll',
scroll: '1m',
scroll: '10s',
scrollId: 'scroll-id'
}, options);
should(nextSearchResult).not.be.equal(searchResult);
Expand Down
4 changes: 2 additions & 2 deletions test/controllers/searchResult/profile.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ describe('ProfileSearchResult', () => {
};

beforeEach(() => {
request.scroll = '1m';
request.scroll = '10s';

response = {
scrollId: 'scroll-id',
Expand All @@ -133,7 +133,7 @@ describe('ProfileSearchResult', () => {
.be.calledWith({
controller: 'security',
action: 'scrollProfiles',
scroll: '1m',
scroll: '10s',
scrollId: 'scroll-id'
}, options);
should(nextSearchResult).not.be.equal(searchResult);
Expand Down
2 changes: 1 addition & 1 deletion test/controllers/searchResult/role.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe('RoleSearchResult', () => {


it('should throw an error if scrollId parameters is set', () => {
request.scroll = '1m';
request.scroll = '10s';
searchResult = new RoleSearchResult(kuzzle, request, options, response);

should(function () {
Expand Down
4 changes: 2 additions & 2 deletions test/controllers/searchResult/specifications.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ describe('SpecificationsSearchResult', () => {
};

beforeEach(() => {
request.scroll = '1m';
request.scroll = '10s';

response = {
scrollId: 'scroll-id',
Expand All @@ -123,7 +123,7 @@ describe('SpecificationsSearchResult', () => {
.be.calledWith({
controller: 'collection',
action: 'scrollSpecifications',
scroll: '1m',
scroll: '10s',
scrollId: 'scroll-id'
}, options);
should(nextSearchResult).not.be.equal(searchResult);
Expand Down
4 changes: 2 additions & 2 deletions test/controllers/searchResult/user.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ describe('UserSearchResult', () => {
};

beforeEach(() => {
request.scroll = '1m';
request.scroll = '10s';

response = {
scrollId: 'scroll-id',
Expand All @@ -135,7 +135,7 @@ describe('UserSearchResult', () => {
.be.calledWith({
controller: 'security',
action: 'scrollUsers',
scroll: '1m',
scroll: '10s',
scrollId: 'scroll-id'
}, options);
should(nextSearchResult).not.be.equal(searchResult);
Expand Down
8 changes: 4 additions & 4 deletions test/controllers/security.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@ describe('Security Controller', () => {
};
kuzzle.query.resolves({result});

return kuzzle.security.searchProfiles({roles: ['foo', 'bar']}, {from: 1, size: 2, scroll: '1m'})
return kuzzle.security.searchProfiles({roles: ['foo', 'bar']}, {from: 1, size: 2, scroll: '10s'})
.then(res => {
should(kuzzle.query)
.be.calledOnce()
Expand All @@ -995,7 +995,7 @@ describe('Security Controller', () => {
body: {roles: ['foo', 'bar']},
from: 1,
size: 2,
scroll: '1m'
scroll: '10s'
}, {});

should(res).be.an.instanceOf(ProfileSearchResult);
Expand Down Expand Up @@ -1113,7 +1113,7 @@ describe('Security Controller', () => {
};
kuzzle.query.resolves({result});

return kuzzle.security.searchUsers({foo: 'bar'}, {from: 1, size: 2, scroll: '1m'})
return kuzzle.security.searchUsers({foo: 'bar'}, {from: 1, size: 2, scroll: '10s'})
.then(res => {
should(kuzzle.query)
.be.calledOnce()
Expand All @@ -1123,7 +1123,7 @@ describe('Security Controller', () => {
body: {foo: 'bar'},
from: 1,
size: 2,
scroll: '1m'
scroll: '10s'
}, {});

should(res).be.an.instanceOf(UserSearchResult);
Expand Down
12 changes: 0 additions & 12 deletions test/kuzzle/useController.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ class CustomController extends BaseController {
}
}

class NotInheritingController {
constructor (kuzzle) {
this._kuzzle = kuzzle;
}
}

class UnamedController extends BaseController {
constructor (kuzzle) {
super(kuzzle);
Expand Down Expand Up @@ -82,12 +76,6 @@ describe('Kuzzle custom controllers management', () => {
});
});

it('should throw if the controller does not inherits from BaseController', () => {
should(() => {
kuzzle.useController(NotInheritingController, 'wrong');
}).throw('Controllers must inherits from the BaseController class.');
});

it('should throw if the controller does not have a name', () => {
should(() => {
kuzzle.useController(UnamedController, 'unamed');
Expand Down