Skip to content
Merged
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ src/**/*.js.map

src/Kuzzle.js
src/controllers/Auth.js
src/controllers/Document.js
src/controllers/Base.js
src/core/security/User.js
src/core/security/Profile.js
src/core/security/Role.js
src/utils/interfaces.js
src/core/searchResult/SearchResultBase.js
src/core/searchResult/Document.js
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ test-*.js
index.js
src/Kuzzle.js
src/controllers/Auth.js
src/controllers/Document.js
src/controllers/Base.js
src/core/security/User.js
src/core/security/Profile.js
src/core/security/Role.js
src/utils/interfaces.js
src/core/searchResult/SearchResultBase.js
src/core/searchResult/Document.js
2 changes: 1 addition & 1 deletion doc/7/controllers/document/validate/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: Validate a document

# validate

Validates data against existing validation rules.
Validates a document against existing validation rules.

Note that if no validation specifications are set for the `<index>`/`<collection>`, the document will always be valid.

Expand Down
8 changes: 4 additions & 4 deletions src/Kuzzle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { MemoryStorageController } from './controllers/MemoryStorage';

import { uuidv4 } from './utils/uuidv4';
import { proxify } from './utils/proxify';
import { JSONObject } from './utils/interfaces';
import { JSONObject, KuzzleRequest } from './utils/interfaces';

// Defined by webpack plugin
declare const SDKVERSION: any;
Expand Down Expand Up @@ -59,7 +59,7 @@ export class Kuzzle extends KuzzleEventEmitter {
public auth: AuthController;
public bulk: any;
public collection: any;
public document: any;
public document: DocumentController;
public index: any;
public ms: any;
public realtime: any;
Expand Down Expand Up @@ -332,7 +332,7 @@ export class Kuzzle extends KuzzleEventEmitter {
* Connects to a Kuzzle instance using the provided host name
* @returns {Promise<Object>}
*/
connect () {
connect (): Promise<void> {
if (this.protocol.isReady()) {
return Promise.resolve();
}
Expand Down Expand Up @@ -455,7 +455,7 @@ export class Kuzzle extends KuzzleEventEmitter {
* @param {object} [options] - Optional arguments
* @returns {Promise<object>}
*/
query (request: any = {}, options: any = {}) {
query (request: KuzzleRequest = {}, options: JSONObject = {}): Promise<JSONObject> {
if (typeof request !== 'object' || Array.isArray(request)) {
throw new Error(`Kuzzle.query: Invalid request: ${JSON.stringify(request)}`);
}
Expand Down
36 changes: 18 additions & 18 deletions src/controllers/Auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ export class AuthController extends BaseController {
*
* @param description API key description
* @param options Additional options
* - "_id" API key unique ID
* - "refresh" If set to `wait_for`, Kuzzle will not respond until the API key is indexed
* - "expiresIn" Expiration duration
* - `_id` API key unique ID
* - `refresh` If set to `wait_for`, Kuzzle will not respond until the API key is indexed
* - `expiresIn` Expiration duration
*
* @returns The created API key
*/
Expand Down Expand Up @@ -98,7 +98,7 @@ export class AuthController extends BaseController {
*
* @param id API key ID
* @param options Additional options
* - "refresh" If set to `wait_for`, Kuzzle will not respond until the API key is indexed
* - `refresh` If set to `wait_for`, Kuzzle will not respond until the API key is indexed
*/
deleteApiKey(id: string, options: { refresh?: string } = {}): Promise<null> {
const request = {
Expand All @@ -118,8 +118,8 @@ export class AuthController extends BaseController {
*
* @param query Search query
* @param options Additional options
* - "from" Offset of the first document to fetch
* - "size" Maximum number of documents to retrieve per page
* - `from` Offset of the first document to fetch
* - `size` Maximum number of documents to retrieve per page
*
* @returns A search result object
*/
Expand Down Expand Up @@ -189,7 +189,7 @@ export class AuthController extends BaseController {
* @param strategy New credentials
* @param credentials Name of the strategy to use
* @param options Additional options
* - "queuable" If true, queues the request during downtime, until connected to Kuzzle again
* - `queuable` If true, queues the request during downtime, until connected to Kuzzle again
*
* @returns An object representing the new credentials.
* The content depends on the authentication strategy
Expand All @@ -214,7 +214,7 @@ export class AuthController extends BaseController {
*
* @param strategy Name of the strategy to use
* @param options Additional options
* - "queuable" If true, queues the request during downtime, until connected to Kuzzle again
* - `queuable` If true, queues the request during downtime, until connected to Kuzzle again
*
* @returns A boolean indicating if the credentials exists
*/
Expand All @@ -236,7 +236,7 @@ export class AuthController extends BaseController {
*
* @param strategy Name of the strategy to use
* @param options Additional options
* - "queuable" If true, queues the request during downtime, until connected to Kuzzle again
* - `queuable` If true, queues the request during downtime, until connected to Kuzzle again
*/
deleteMyCredentials (
strategy: string,
Expand All @@ -255,7 +255,7 @@ export class AuthController extends BaseController {
* @see https://docs.kuzzle.io/sdk/js/7/controllers/auth/get-current-user
*
* @param options Additional options
* - "queuable" If true, queues the request during downtime, until connected to Kuzzle again
* - `queuable` If true, queues the request during downtime, until connected to Kuzzle again
*
* @returns Currently loggued User
*/
Expand All @@ -276,7 +276,7 @@ export class AuthController extends BaseController {
*
* @param strategy Name of the strategy to use
* @param options Additional options
* - "queuable" If true, queues the request during downtime, until connected to Kuzzle again
* - `queuable` If true, queues the request during downtime, until connected to Kuzzle again
*
* @returns An object representing the credentials for the provided authentication strategy.
* Its content depends on the authentication strategy.
Expand All @@ -298,7 +298,7 @@ export class AuthController extends BaseController {
* @see https://docs.kuzzle.io/sdk/js/7/controllers/auth/get-my-rights
*
* @param options Additional options
* - "queuable" If true, queues the request during downtime, until connected to Kuzzle again
* - `queuable` If true, queues the request during downtime, until connected to Kuzzle again
*
* @returns An array containing user rights objects
*/
Expand Down Expand Up @@ -338,7 +338,7 @@ export class AuthController extends BaseController {
* @see https://docs.kuzzle.io/sdk/js/7/controllers/auth/get-strategies
*
* @param options Additional options
* - "queuable" If true, queues the request during downtime, until connected to Kuzzle again
* - `queuable` If true, queues the request during downtime, until connected to Kuzzle again
*
* @returns An array of available strategies names
*/
Expand Down Expand Up @@ -409,7 +409,7 @@ export class AuthController extends BaseController {
* @param strategy Name of the strategy to use
* @param credentials Updated credentials
* @param options Additional options
* - "queuable" If true, queues the request during downtime, until connected to Kuzzle again
* - `queuable` If true, queues the request during downtime, until connected to Kuzzle again
*
* @returns An object representing the updated credentials.
* The content depends on the authentication strategy
Expand All @@ -435,7 +435,7 @@ export class AuthController extends BaseController {
*
* @param {object} content - User custom information
* @param options Additional options
* - "queuable" If true, queues the request during downtime, until connected to Kuzzle again
* - `queuable` If true, queues the request during downtime, until connected to Kuzzle again
*
* @returns Currently loggued User
*/
Expand All @@ -461,7 +461,7 @@ export class AuthController extends BaseController {
* @param strategy Name of the strategy to use
* @param credentials Credentials to validate
* @param options Additional options
* - "queuable" If true, queues the request during downtime, until connected to Kuzzle again
* - `queuable` If true, queues the request during downtime, until connected to Kuzzle again
*/
validateMyCredentials (
strategy: string,
Expand All @@ -482,8 +482,8 @@ export class AuthController extends BaseController {
* @see https://docs.kuzzle.io/sdk/js/7/controllers/auth/refresh-token
*
* @param options Additional options
* - "queuable" If true, queues the request during downtime, until connected to Kuzzle again
* - "expiresIn" Expiration duration
* - `queuable` If true, queues the request during downtime, until connected to Kuzzle again
* - `expiresIn` Expiration duration
*
* @returns The refreshed token
*/
Expand Down
Loading