Skip to content

Conversation

Yoann-Abbes
Copy link
Contributor

7.1.0 (2020-02-19)

Bug fixes

  • [ #490 ] Throw an error when an URL param is missing in HTTP (Aschen)
  • [ #473 ] Fix search with size=0 (Aschen)

New features

Enhancements

  • [ #465 ] Choose GET route by default in case of double route (Yoann-Abbes)
  • [ #479 ] Add a "source" option for document:update to retrieve the updated document (Yoann-Abbes)
  • [ #476 ] Add a "force" option to create/update role (Yoann-Abbes)

Others


Aschen and others added 20 commits December 6, 2019 16:13
## What does this PR do?

Fix a bug that prevent user of setting a `size` of `0` on `document.search`.
Co-Authored-By: Sébastien Cottinet <scottinet@protonmail.com>
Co-Authored-By: Sébastien Cottinet <scottinet@protonmail.com>
Co-Authored-By: Sébastien Cottinet <scottinet@protonmail.com>
<!--
  This template is optional.
  It simply serves to provide a guide to allow a better review of pull requests.
-->

<!--
  IMPORTANT
  Don't forget to add the corresponding "changelog:xxx" label to your PR.
  This is part of our release process in order to generate the change log.
-->


## What does this PR do?

This PR adds a new `force` option to routes who write a role.
It permits not to throw in case you want to set rights about a plugin which is not available yet, or controllers/action that are not described yet in the plugin.

:warning:  This PR goes along with kuzzleio/kuzzle#1535
As you can see, this option is only effective if it concerns plugin rights. 
:warning: 
<!-- Please fulfill this section -->

<!--
  Please include a summary of the change and which issue is fixed.
  Please also include relevant motivation and context.
  List any dependencies that are required for this change.
-->

### How should this be manually tested?

:warning: you should test it with Kuzzle instantiated on this branch kuzzleio/kuzzle#1535 ⚠️

- Try creating this role
```
const body = { 
controller: {
    unavailable_plugin/test: {
            actions: {
                  create: true,
                  update: true
               }
          }
     }
}

this.sdk.security.createRole('newRole', body) will throw.
this.sdk.security.createRole('newRole', body, {force: true}) will work
```

<!--
  Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
  Please also list any relevant details for your test configuration
-->
  - Step 1 :
  - Step 2 :
  - Step 3 :  
  ...

### Other changes

<!--
  Please describe here all changes not directly linked to the main issue, but made because of it.
  For instance: issues spotted during this PR and fixed on-the-fly, dependencies update, and so on
-->

### Boyscout

<!--
  Describe here minor improvements in the code base and not directly linked to the main changes:
  typos fixes, better/new comments, small code simplification, new debug messages, and so on.
-->
…ument (#479)

This PR adds a source option. Set to true returns the updated document in a _source object.
## What does this PR do?
Gets rid of `doc/doc.sh` and uses KuzDoc to build the docs.

### How should this be manually tested?

Go take a look at the CI job for the dead-link check.

To test the build and deploy, you can follow the steps of the [Doc Dev Deploy in the `.travis.yml` file](https://github.com/kuzzleio/sdk-javascript/pull/482/files#diff-354f30a63fb0907d4ad57269548329e3L114) and test them locally.
## What does this PR do?

Allow to pass number as port option to protocols constructors so this will work instead of silently use port `7512`:
```
new WebSocket('localhost', { port: process.env.KUZZLE_PORT })
``
## What does this PR do?

When you send a request with arguments that are present in the URL (eg: `/:index/_create`), they are injected in the URL.  
If the user didn't put the required arguments, they are `undefined` and they end up in the url as the string `"undefined"` (eg: `/undefined/create`).    

This PR now discard the request if an URL param is missing.
This PR changes the way we get the correct route if there is several of them.

Before this PR:
The SDK checked the size of the url, and chose the shortest.
If they had the same size, it chose the POST route.
And you could not force the verb in your request.

Now:
Same thing, except it chooses the GET route.
Plus, you can force the verb with the option {verb: 'POST'}
@codecov
Copy link

codecov bot commented Feb 19, 2020

Codecov Report

Merging #491 into master will decrease coverage by 0.44%.
The diff coverage is 84.09%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #491      +/-   ##
==========================================
- Coverage   96.02%   95.57%   -0.45%     
==========================================
  Files          32       32              
  Lines        1282     1312      +30     
==========================================
+ Hits         1231     1254      +23     
- Misses         51       58       +7
Impacted Files Coverage Δ
src/protocols/abstract/common.js 94% <100%> (+0.12%) ⬆️
src/protocols/http.js 90.78% <100%> (+0.18%) ⬆️
src/controllers/auth.js 93.54% <100%> (+0.95%) ⬆️
src/controllers/document.js 95.45% <100%> (+0.29%) ⬆️
src/controllers/security/index.js 95% <57.14%> (-4.21%) ⬇️
src/Kuzzle.js 94.04% <66.66%> (-0.43%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f981efc...1775adb. Read the comment docs.

@Yoann-Abbes Yoann-Abbes merged commit cea8c93 into master Feb 19, 2020
@Yoann-Abbes Yoann-Abbes deleted the 7.1.0-proposal branch February 19, 2020 14:51
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.

5 participants