-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JS SDK: document class properties independently to the "introduction"…
… pages (#277) * [JS SDK] separate class properties from the "introduction" page * [JS SDK] document what the auth actions do to the jwt class property * Apply @xbill82's suggestions Co-Authored-By: scottinet <[email protected]>
- Loading branch information
Showing
20 changed files
with
221 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
layout: sdk.html.hbs | ||
title: Properties | ||
description: KuzzleError Properties | ||
--- | ||
|
||
# Properties | ||
|
||
| Property name | Type | Description | | ||
| -------------------- | -------- | --------------------------------------- | | ||
| `message` | <pre>string</pre> | Error message | | ||
| `status` | <pre>number</pre> | Error status code | | ||
| `stack` | <pre>string</pre> | Error stacktrace (only in development mode) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
--- | ||
layout: sdk.html.hbs | ||
title: Properties | ||
description: Kuzzle class properties | ||
order: 100 | ||
--- | ||
|
||
# Read-only properties | ||
|
||
| Property name | Type | Description | | ||
| -------------------- | -------- | ---------------------| | ||
| `offlineQueue` | <pre>object[]</pre> | Contains the queued requests during offline mode | | ||
| `protocol` | <pre>Protocol</pre> | Protocol used by the SDK | | ||
|
||
# Writable properties | ||
|
||
| Property name | Type | Description | | ||
| -------------------- | -------- | ---------------------| | ||
| `autoQueue` | <pre>boolean</pre> | If `true`, automatically queues all requests during offline mode | | ||
| `autoReplay` | <pre>boolean</pre> | If `true`, automatically replays queued requests on a `reconnected` event | | ||
| `autoResubscribe` | <pre>boolean</pre> | If `true`, automatically renews all subscriptions on a `reconnected` event | | ||
| `jwt` | <pre>string</pre> | Authentication token | | ||
| `offlineQueueLoader` | <pre>function</pre> | Called before dequeuing requests after exiting offline mode, to add items at the beginning of the offline queue | | ||
| `queueFilter` | <pre>function</pre> | Custom function called during offline mode to filter queued requests on-the-fly | | ||
| `queueMaxSize` | <pre>number</pre> | Number of maximum requests kept during offline mode| | ||
| `queueTTL` | <pre>number</pre> | Time a queued request is kept during offline mode, in milliseconds | | ||
| `replayInterval` | <pre>number</pre> | Delay between each replayed requests | | ||
| `volatile` | <pre>object</pre> | Common volatile data, will be sent to all future requests | | ||
|
||
### offlineQueueLoader | ||
|
||
The `offlineQueueLoader` property must be set with a function of one of the following formats: | ||
|
||
```js | ||
Object[] offlineQueueLoader() | ||
|
||
Promise<Object[]> offlineQueueLoader() | ||
``` | ||
|
||
The returned (or resolved) array must contain objects, each with the following properties: | ||
|
||
| Property | Type | Description | | ||
|---|---|---| | ||
| `query` | <pre>object</pre> | Object representing the request that is about to be sent to Kuzzle, following the [Kuzzle API]({{ site_base_path }}api/1/essentials/query-syntax) format | | ||
| `reject` | <pre>function</pre> | A [Promise.reject](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/reject) function | | ||
| `resolve` | <pre>function</pre> | A [Promise.resolve](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/resolve) function | | ||
|
||
### queueFilter | ||
|
||
The `queueFilter` property must be set with a function of the following form: | ||
|
||
```js | ||
boolean queueFilter(request) | ||
``` | ||
|
||
The `request` argument is an object representing the request that is about to be sent to Kuzzle, following the [Kuzzle API]({{ site_base_path }}api/1/essentials/query-syntax) format. | ||
|
||
### queueMaxSize | ||
|
||
This property defines the size of the offline buffer, which is a first-in first-out (FIFO) queue. | ||
|
||
This means that if the `queueMaxSize` limit is reached, older requests are discarded to make room for newer requests. | ||
|
||
If `queueMaxSize` is set to a number lower than, or equal to `0`, then an unlimited number of requests is kept in the offline buffer. | ||
Note that doing so may lead to a crash due to memory saturation, if there are too many requests held in memory. | ||
|
||
### queueTTL | ||
|
||
If the `queueTTL` property is set to a number lower than, or equal to `0`, then requests never expire and are kept indefinitely. | ||
|
||
### volatile | ||
|
||
Multiple methods allow passing specific `volatile` data. | ||
|
||
These `volatile` data will be merged with the global Kuzzle `volatile` object when sending the request, with the request specific `volatile` taking priority over the global ones. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
layout: sdk.html.hbs | ||
title: Properties | ||
description: Profile Properties | ||
order: 100 | ||
--- | ||
|
||
# Properties | ||
|
||
| Property | Type | Description | | ||
|--- |--- |--- | | ||
| `_id` | <pre>string</pre> | Profile ID | | ||
| `policies` | <pre>object[]</pre> | Array of policies for this profile | | ||
|
||
### policies | ||
|
||
Each policy object can contain the following properties: | ||
|
||
| Property | Type | Description | | ||
|--- |--- |--- | | ||
| `roleId` | <pre>string</pre> | Roles IDs for this user | | ||
| `restrictedTo` | <pre>object[]</pre> | Array of object containing indexes and collections which the profile is restricted to | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
layout: sdk.html.hbs | ||
title: Properties | ||
description: Role class properties | ||
order: 100 | ||
--- | ||
|
||
# Properties | ||
|
||
Available properties: | ||
|
||
| Property | Type | Description | | ||
|--- |--- |--- | | ||
| `_id` | <pre>string</pre> | Role unique identifier | | ||
| `controllers` | <pre>object</pre> | Object defining controller actions allowed by this role | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
layout: sdk.html.hbs | ||
title: Properties | ||
description: SearchResult class properties | ||
order: 1000 | ||
--- | ||
|
||
# Properties | ||
|
||
| Property | Type | Description | | ||
|--- |--- |--- | | ||
| `aggregations` | <pre>object</pre> | Search aggregations if any | | ||
| `hits` | <pre>object[]</pre> | Array containing the retrieved items for the current page | | ||
| `total` | <pre>number</pre> | Total number of items matching the given query in Kuzzle database | | ||
| `fetched` | <pre>number</pre> | Number of retrieved items so far | | ||
| `scroll_id` | <pre>string</pre> | Scroll identifier if the search was given a `scroll` parameter | | ||
|
||
### hits | ||
|
||
Each object of the `hits` array contain the following properties: | ||
|
||
| Property | Type | Description | | ||
|--- |--- |--- | | ||
| `_id` | <pre>string</pre> | Document ID | | ||
| `_score` | <pre>number</pre> | [Relevance score](https://www.elastic.co/guide/en/elasticsearch/guide/current/relevance-intro.html) | | ||
| `_source` | <pre>object</pre> | Document content | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
layout: sdk.html.hbs | ||
title: Properties | ||
description: SocketIO class properties | ||
order: 100 | ||
--- | ||
|
||
# Properties | ||
|
||
| Property name | Type | Description | | ||
| -------------------- | -------- | ---------------------| | ||
| `autoReconnect` | <pre>boolean</pre> | Automatically reconnect after a connection loss | | ||
| `reconnectionDelay` | <pre>number</pre> | Number of milliseconds between reconnection attempts | | ||
|
||
<div class="alert alert-info"> | ||
Updates to <code>autoReconnect</code> and <code>reconnectionDelay</code> properties will only take effect on the next `connect` call. | ||
</div> |
Oops, something went wrong.