Skip to content

Commit

Permalink
Release 2.16.9
Browse files Browse the repository at this point in the history
Release 2.16.9
  • Loading branch information
alexandrebouthinon authored Jan 25, 2022
2 parents 67a6d40 + 48c507c commit 9088c55
Show file tree
Hide file tree
Showing 28 changed files with 625 additions and 10,995 deletions.
15 changes: 15 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,18 @@ lib/api/openapi/document/index.js
lib/api/openapi/tools.js
lib/api/openapi/index.js
lib/util/readYamlFile.js
lib/config/default.config.js
lib/types/PasswordPolicy.js
lib/types/ProfileDefinition.js
lib/types/RoleDefinition.js
lib/types/config/DumpConfiguration.js
lib/types/config/HttpConfiguration.js
lib/types/config/KuzzleConfiguration.js
lib/types/config/LimitsConfiguration.js
lib/types/config/PluginsConfiguration.js
lib/types/config/SecurityConfiguration.js
lib/types/config/ServerConfiguration.js
lib/types/config/ServicesConfiguration.js
lib/types/config/StorageService/StorageServiceElasticsearchConfiguration.js
lib/types/config/internalCache/InternalCacheRedisConfiguration.js
lib/types/config/publicCache/PublicCacheRedisConfiguration.js
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,18 @@ lib/api/openapi/document/index.js
lib/api/openapi/tools.js
lib/api/openapi/index.js
lib/util/readYamlFile.js
lib/config/default.config.js
lib/types/PasswordPolicy.js
lib/types/ProfileDefinition.js
lib/types/RoleDefinition.js
lib/types/config/DumpConfiguration.js
lib/types/config/HttpConfiguration.js
lib/types/config/KuzzleConfiguration.js
lib/types/config/LimitsConfiguration.js
lib/types/config/PluginsConfiguration.js
lib/types/config/SecurityConfiguration.js
lib/types/config/ServerConfiguration.js
lib/types/config/ServicesConfiguration.js
lib/types/config/StorageService/StorageServiceElasticsearchConfiguration.js
lib/types/config/internalCache/InternalCacheRedisConfiguration.js
lib/types/config/publicCache/PublicCacheRedisConfiguration.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ description: KuzzleRequest class getBodyArray() method

# getBodyArray

<SinceBadge version="2.11.0" />
<SinceBadge version="2.16.9" />

Gets a parameter from the request body and checks that it is an array.
We also support lodash syntax. [(`relations.lebron[0]`)](https://lodash.com/docs/4.17.15#get)

### Arguments

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ description: KuzzleRequest class getBodyBoolean() method

# getBodyBoolean

<SinceBadge version="2.11.0" />
<SinceBadge version="2.16.9" />

Gets a parameter from the request body and checks that it is a boolean.
We also support lodash syntax. [(`relations.lebron[0]`)](https://lodash.com/docs/4.17.15#get)

Contrary to other parameter types, an unset boolean does not trigger an
error, instead it's considered as `false`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ description: KuzzleRequest class getBodyInteger() method

# getBodyInteger

<SinceBadge version="2.11.0" />
<SinceBadge version="2.16.9" />

Gets a parameter from the request body and checks that it is an integer.
We also support lodash syntax. [(`relations.lebron[0]`)](https://lodash.com/docs/4.17.15#get)

### Arguments

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ description: KuzzleRequest class getBodyNumber() method

# getBodyNumber

<SinceBadge version="2.11.0" />
<SinceBadge version="2.16.9" />

Gets a parameter from the request body and checks that it is a number.
We also support lodash syntax. [(`relations.lebron[0]`)](https://lodash.com/docs/4.17.15#get)

### Arguments

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ description: KuzzleRequest class getBodyObject() method

# getBodyObject

<SinceBadge version="2.11.0" />
<SinceBadge version="2.16.9" />

Gets a parameter from the request body and checks that it is an object.
We also support lodash syntax. [(`relations.lebron[0]`)](https://lodash.com/docs/4.17.15#get)

### Arguments

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ description: KuzzleRequest class getBodyString() method

# getBodyString

<SinceBadge version="2.11.0" />
<SinceBadge version="2.16.9" />

Gets a parameter from the request body and checks that it is a string.
We also support lodash syntax. [(`relations.lebron[0]`)](https://lodash.com/docs/4.17.15#get)

### Arguments

Expand Down
3 changes: 2 additions & 1 deletion doc/2/framework/classes/kuzzle-request/get-boolean/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ description: KuzzleRequest class getBoolean() method

# getBoolean

<SinceBadge version="2.11.0" />
<SinceBadge version="2.16.9" />

Gets a parameter from the request arguments and checks that it is a boolean.
We also support lodash syntax. [(`relations.lebron[0]`)](https://lodash.com/docs/4.17.15#get)

Contrary to other parameter types, an unset boolean does not trigger an
error, instead it's considered as `false`
Expand Down
3 changes: 2 additions & 1 deletion doc/2/framework/classes/kuzzle-request/get-integer/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ description: KuzzleRequest class getInteger() method

# getInteger

<SinceBadge version="2.11.0" />
<SinceBadge version="2.16.9" />

Gets a parameter from a request arguments and checks that it is an integer.
We also support lodash syntax. [(`relations.lebron[0]`)](https://lodash.com/docs/4.17.15#get)

### Arguments

Expand Down
3 changes: 2 additions & 1 deletion doc/2/framework/classes/kuzzle-request/get-number/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ description: KuzzleRequest class getNumber() method

# getNumber

<SinceBadge version="2.11.0" />
<SinceBadge version="2.16.9" />

Gets a parameter from the request arguments and checks that it is a number.
We also support lodash syntax. [(`relations.lebron[0]`)](https://lodash.com/docs/4.17.15#get)

### Arguments

Expand Down
3 changes: 2 additions & 1 deletion doc/2/framework/classes/kuzzle-request/get-object/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ description: KuzzleRequest class getObject() method

# getObject

<SinceBadge version="2.11.0" />
<SinceBadge version="2.16.9" />

Gets a parameter from the request arguments and checks that it is an object.
We also support lodash syntax. [(`relations.lebron[0]`)](https://lodash.com/docs/4.17.15#get)

### Arguments

Expand Down
3 changes: 2 additions & 1 deletion doc/2/framework/classes/kuzzle-request/get-string/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ description: KuzzleRequest class getString() method

# getString

<SinceBadge version="2.11.0" />
<SinceBadge version="2.16.9" />

Gets a parameter from the request arguments and checks that it is a string.
We also support lodash syntax. [(`relations.lebron[0]`)](https://lodash.com/docs/4.17.15#get)

### Arguments

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,26 @@ It contains various instantiated classes and methods that allow to interact with

This property is an instance of the [BackendCluster](/core/2/framework/classes/backend-cluster) class, handling interactions with cluster nodes.

| Type | Description |
|----------|------------------------|
| Type | Description |
| ---------------------------------------------------------------------- | ----------------------- |
| <pre>[BackendCluster](/core/2/framework/classes/backend-cluster)</pre> | BackendCluster instance |

## `nodeId`

<SinceBadge version="auto-version" />

This property is the current Kuzzle node unique identifier.

| Type | Description |
| ----------------- | ------------------------------------- |
| <pre>string</pre> | Current Kuzzle node unique identifier |

## `sdk`

This property is an instance of the [EmbeddedSDK](/core/2/framework/classes/embedded-sdk) class.

| Type | Description |
|----------|------------------------|
| Type | Description |
| ---------------------------------------------------------------- | -------------------- |
| <pre>[EmbeddedSDK](/core/2/framework/classes/embedded-sdk)</pre> | EmbeddedSDK instance |

See also the [Embedded SDK](/core/2/guides/develop-on-kuzzle/embedded-sdk) guide.
Expand All @@ -34,22 +43,22 @@ See also the [Embedded SDK](/core/2/guides/develop-on-kuzzle/embedded-sdk) guide

This property is an instance of the [PluginStorage](/core/2/framework/classes/plugin-storage) class that allows to interact with the Plugin Private Storage.

| Type | Description |
|----------|------------------------|
| Type | Description |
| -------------------------------------------------------------------- | ---------------------- |
| <pre>[PluginStorage](/core/2/framework/classes/plugin-storage)</pre> | PluginStorage instance |

## `strategies`

This property is an instance of the [PluginStrategy](/core/2/framework/classes/plugin-strategy) class that allows to dynamically add and remove [Authentication Strategies](/core/2/guides/write-plugins/integrate-authentication-strategy).

| Type | Description |
|----------|------------------------|
| Type | Description |
| ---------------------------------------------------------------------- | ----------------------- |
| <pre>[PluginStrategy](/core/2/framework/classes/plugin-strategy)</pre> | PluginStrategy instance |

## `subscription`

This property is an instance of the [Subscription](/core/2/framework/classes/subscription) class that allows to add and remove [realtime subscriptions](/core/2/guides/main-concepts/realtime-engine) from the backend.

| Type | Description |
|----------|------------------------|
| Type | Description |
| ----------------------------------------------------------------- | --------------------- |
| <pre>[Subscription](/core/2/framework/classes/subscription)</pre> | Subscription instance |
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ See [Elasticsearch official documentation](https://www.elastic.co/guide/en/elast

This class constructor takes no argument.

## Usage
### Usage

```js
const esRequest = {
Expand Down Expand Up @@ -81,7 +81,7 @@ KuzzleRequest(originalRequest: KuzzleRequest, requestPayload: RequestPayload, op
| `options` | <pre>JSONObject</pre> | Additional options passed to the [RequestContext](/core/2/framework/classes/request-context) constructor |


## Usage
### Usage

```js
const req = new context.constructors.KuzzleRequest(request, {
Expand All @@ -92,23 +92,9 @@ const req = new context.constructors.KuzzleRequest(request, {
const user = await context.accessors.execute(req)
```

## `StorageClient`

Constructor for [Elasticsearch SDK Client](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html).
## `Mutex`
<SinceBadge version="auto-version" />

## Usage
Instantiates a new mutex, allowing to lock a resource. Works both with single-node and cluster environments.

```js
const esRequest = {
body: {
name: 'Aschen',
age: 27
},
index: '&nyc-open-data.yellow-taxi',
op_type: 'create'
}

// Instantiate and use a new client
const storageClient = new app.storage.Client()
await storageClient.index(esRequest)
```
See [Mutex documentation](/core/2/framework/classes/mutex) for more information.
7 changes: 4 additions & 3 deletions lib/api/controllers/adminController.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,15 @@ class AdminController extends NativeController {
const fixtures = request.getBody();

return this._waitForAction(
request.getRefresh('true'),
request.getRefresh('wait_for'),
global.kuzzle.ask('core:storage:public:document:import', fixtures));
}

loadMappings (request) {
const mappings = request.getBody();

return this._waitForAction(
request.getRefresh('true'),
request.getRefresh('wait_for'),
global.kuzzle.ask(
'core:storage:public:mappings:import',
mappings,
Expand All @@ -176,11 +176,12 @@ class AdminController extends NativeController {
const user = request.getUser();
const onExistingUsers = request.input.args.onExistingUsers;
const force = request.getBoolean('force');
const waitForRefresh = request.getRefresh('true');
const waitForRefresh = request.getRefresh('wait_for');

const promise = this.ask('core:security:load', permissions, {
force,
onExistingUsers,
refresh: waitForRefresh,
user,
});

Expand Down
Loading

0 comments on commit 9088c55

Please sign in to comment.