Skip to content

Conversation

scottinet
Copy link
Contributor

7.3.0 (2020-07-23)

Bug fixes

New features

Enhancements

  • [ #517 ] Add collection:update and deprecate collection:updateMapping (Yoann-Abbes)
  • [ #514 ] Able to execute document search as GET http method (Yoann-Abbes)

Yoann-Abbes and others added 15 commits May 22, 2020 11:09
Fix a bug while constructing query strings.
The string interpolation ${key}:${value} gave as value [Object object] as string for nested objects instead of stringifying the whole object.

How should this be manually tested?
unit tests

Other changes
Refresh collection before execution of deleteByQuery snippet code
Rename the tests scripts in package.json to make them match the kuzzle ones
Fix eslint version for the documentation CI
## What does this PR do?

This PR adds `document:updateByQuery` to the sdk

Issue #518
## What does this PR do?
[Jira ticket](https://jira.kaliop.net/browse/KZL-1493)


This PR provides the possibility to execute a `document:search` with the GET http verb

### How should this be manually tested?

Create a `nyc-open-data' index` and `yellow-taxi` collection.
Create some files with 2 containing field `{name:"ok"}`
Execute this code

Remove the `verb` option and/or change it to `POST` and re-execute the code

By default, `document:search` is still POST

```js
const { Kuzzle, Http } = require('kuzzle-sdk');

const kuzzle = new Kuzzle(
  new Http(`localhost`, { port: 7512})
);

async function main () {

  try {
  	await kuzzle.connect();

        const response = await kuzzle.document.search(
      'nyc-open-data',
      'yellow-taxi',
      {
        query:{
            term: {
              name: 'ok'
            }
          }
        },{verb: 'GET'}
    );

    console.log(`Successfully get ${response.total} documents`);
  } catch (error) {
    console.error(error);
  }
}

main()
```
### Other changes

update Mocha to [7.2.0](https://github.com/mochajs/mocha/releases/tag/v7.2.0)
update codecov to 3.7.0

### Boyscout

Removes an unused url who was in conflict with `collection:update` url
Fix eslint version for the documentation CI
## What does this PR do?

This PR adds `collection:update` to the sdk and deprecates the older `collection:updateMapping`.

### How should this be manually tested?

Create an index/collection and update its mapping by calling the `collection:update` method
Tests
Co-authored-by: Adrien Maret <amaret93@gmail.com>
## What does this PR do?

Use `Reflect` to hide the kuzzle object from log

### Other changes

 - Get ride of every `delete` keyword and use `Map` for RAM caches
 - Do not throw custom error when unsubscribing from unknown room (let Kuzzle trigger it's own documented error)
 - Allows to pass `_id` to `realtime.publish`
## What does this PR do?
Implements support for the newly added **ms:mexecute**

### How should this be manually tested?

```
const actions = [
    { 'action': 'set', 'args': { '_id': 'list:a', 'body': { 'value': 1, 'ex': 100, 'nx': true } } },
    { 'action': 'get', 'args': { '_id': 'list:a' } },
    { 'action': 'del', 'args': { 'body': { 'keys': ['list:a'] } } }];

  // Should Print : "[ [ null, 'OK' ], [ null, '1' ], [ null, 1 ] ]"
  console.log(await kuzzle.ms.mexecute(actions));
```


### Boyscout

- Applied _one-var_ esrule in the memoryStorage file.
Adds Typescript support for the AuthController.

I took the descriptions from the documentation.

How should this be manually tested?
Build and pack the SDK: npm run build && npm pack

Then init a Node project and add this dependency:

{
  ...
  "dependencies": {
    "kuzzle-sdk": "file:kuzzle-sdk-7.2.0.tgz"
  }
}
Then create a test.ts file with the following and try to use the controller (just for the auto-completion)
# Description

When using the HTTP protocol, URI parameters are sent as-is by the SDK, which leads to invalid URLs sent when parameters contain reserved or unicode characters.

# Changes

* Encode URI keys and values when adding them in the URI
* Encode values when replacing URI placeholders

# Other changes

* Fix an incorrect module exports (e.g. "KuzzleEventEmitter" and other modules were exposed as subobjects)
* The `npm run test` script was outdated: it now uses the renamed npm scripts (i.e. test:* scripts)
* The `DocumentSearchResult` class was renamed `DocumentsSearchResult`, which _might_ be considered a breaking change (and is inconsistent with other *SearchResult object names anyway)
@codecov
Copy link

codecov bot commented Jul 23, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@bec2608). Click here to learn what that means.
The diff coverage is 85.86%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #533   +/-   ##
=========================================
  Coverage          ?   91.14%           
=========================================
  Files             ?       32           
  Lines             ?     1389           
  Branches          ?      129           
=========================================
  Hits              ?     1266           
  Misses            ?       98           
  Partials          ?       25           
Impacted Files Coverage Δ
src/controllers/Document.ts 71.11% <71.11%> (ø)
src/core/security/Role.ts 71.42% <71.42%> (ø)
src/core/searchResult/SearchResultBase.ts 77.58% <72.72%> (ø)
src/controllers/Auth.ts 75.94% <75.94%> (ø)
src/protocols/abstract/Base.js 92.30% <80.00%> (ø)
src/controllers/Base.ts 88.88% <88.88%> (ø)
src/Kuzzle.ts 87.55% <100.00%> (ø)
src/controllers/Bulk.js 100.00% <100.00%> (ø)
src/controllers/Collection.js 100.00% <100.00%> (ø)
src/controllers/Index.js 100.00% <100.00%> (ø)
... and 51 more

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 bec2608...56b744e. Read the comment docs.

@scottinet scottinet merged commit 176b7f8 into master Jul 23, 2020
@scottinet scottinet deleted the 7.3.0-proposal branch July 23, 2020 14:57
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