Skip to content

Conversation

kuzzle
Copy link
Contributor

@kuzzle kuzzle commented Apr 29, 2019

6.2.0 (2019-04-29)

Bug fixes

  • [ #384 ] [fix] search API: "sort" and "search_after" must be in the requests body (scottinet)

Enhancements

  • [ #388 ] Use BaseController class for controllers (Aschen)
  • [ #385 ] Add Realtime.createRestrictedUser method (Aschen)

Others

  • [ #387 ] SearchResult.next returns a new instance (Aschen)

scottinet and others added 4 commits April 8, 2019 12:03
* Add Realtime.createRestrictedUser method

* Use body param
Returns a new instance of `SearchResult` instead of mutating the existing object.
## What does this PR do?

*I'm not sure if this is a new feature or an enhancement* 

This PR intend to unify the way we add/use controllers with the SDK. In this way we can have the same API when using our core controllers (`document`, `collection`, etc.) and custom controllers made by users.  

All existing controllers are now inheriting from the `BaseController` class and they are added to the SDK with `Kuzzle.useController` instead of been manually instantiated.

Example of custom controller
```
class TaxiController extends BaseController {
  constructor (kuzzle) {
    super(kuzzle, 'my-plugin/taxi');
  }

  startDuty (driver) {
    return this.query({ driver, action: 'startDuty' });
  }
}

kuzzle.useController(TaxiController, 'taxi');

kuzzle.taxi.startDuty('Martin');
```

I know this look like a breaking change but since we never documented this feature by now it is not really one.

Documentation kuzzleio/documentation#284

### How should this be manually tested?

  - Step 1 : Run unit tests
@kuzzle kuzzle added the release label Apr 29, 2019
@alexandrebouthinon alexandrebouthinon deleted the 6.2.0-proposal branch April 29, 2019 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants