Skip to content

Commit 176b7f8

Browse files
authored
Merge pull request #533 from kuzzleio/7.3.0-proposal
# [7.3.0](https://github.com/kuzzleio/sdk-javascript/releases/tag/7.3.0) (2020-07-23) #### Bug fixes - [ [#532](#532) ] Encode URI parameters when using the HTTTP protocol ([scottinet](https://github.com/scottinet)) - [ [#516](#516) ] Fix query string construction ([Yoann-Abbes](https://github.com/Yoann-Abbes)) #### New features - [ [#526](#526) ] Add typescript definitions for Auth controller ([Aschen](https://github.com/Aschen)) - [ [#524](#524) ] Support ms:mexecute ([Leodau](https://github.com/Leodau)) - [ [#522](#522) ] Add bulk:deleteByQuery ([Yoann-Abbes](https://github.com/Yoann-Abbes)) - [ [#519](#519) ] Add document:updateByQuery ([Yoann-Abbes](https://github.com/Yoann-Abbes)) #### Enhancements - [ [#517](#517) ] Add collection:update and deprecate collection:updateMapping ([Yoann-Abbes](https://github.com/Yoann-Abbes)) - [ [#514](#514) ] Able to execute document search as GET http method ([Yoann-Abbes](https://github.com/Yoann-Abbes)) ---
2 parents bec2608 + 56b744e commit 176b7f8

File tree

109 files changed

+4578
-2454
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+4578
-2454
lines changed

.ci/doc/docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ services:
4949
ash -c '
5050
mkdir -p /var/snippets/node;
5151
apk add --no-cache curl;
52-
npm install -g eslint;
52+
npm install -g eslint@6.8.0;
5353
cd /var/snippets/node;
5454
npm install \
5555
bluebird \
@@ -76,7 +76,7 @@ services:
7676
apt-get update;
7777
apt-get install -y curl;
7878
npm install -g \
79-
eslint;
79+
eslint@6.8.0;
8080
cd /mnt;
8181
npm install;
8282
cd /var/snippets/web;
@@ -105,7 +105,7 @@ services:
105105
apt-get update;
106106
apt-get install -y curl;
107107
npm install -g \
108-
eslint;
108+
eslint@6.8.0;
109109
cd /var/snippets/webpack;
110110
cp /mnt/.ci/doc/puppeteer.js /var/snippets/webpack/;
111111
cp /mnt/.ci/doc/webpackBuild.js /var/snippets/webpack/;
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Loads the Kuzzle SDK module and the websocket protocol
2+
const {
3+
Kuzzle,
4+
WebSocket
5+
} = require('kuzzle-sdk');
6+
7+
// Instantiates a Kuzzle client
8+
const
9+
kuzzle = new Kuzzle(
10+
new WebSocket('kuzzle', { autoReconnect: false })
11+
);
12+
13+
// Adds a listener to detect connection problems
14+
kuzzle.on('networkError', error => {
15+
console.error(`Network Error: ${error.message}`);
16+
});
17+
18+
(async () => {
19+
let result;
20+
try {
21+
await kuzzle.connect();
22+
} catch (error) {
23+
console.log(`Cannot connect to Kuzzle: ${error.message}`);
24+
}
25+
[snippet-code] finally {
26+
kuzzle.disconnect();
27+
}
28+
for (const elem of result.successes) {
29+
console.log(elem);
30+
}
31+
})();

.eslintc-ts.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"plugins": [
5+
"@typescript-eslint"
6+
],
7+
"extends": [
8+
"eslint:recommended",
9+
"plugin:@typescript-eslint/eslint-recommended",
10+
"plugin:@typescript-eslint/recommended"
11+
],
12+
"rules": {
13+
"@typescript-eslint/no-explicit-any": 0,
14+
"@typescript-eslint/explicit-module-boundary-types": 0
15+
}
16+
}

.eslintignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# JS generated files from TS
2+
src/**/*.d.ts
3+
src/**/*.js.map
4+
5+
src/Kuzzle.js
6+
src/controllers/Auth.js
7+
src/controllers/Document.js
8+
src/controllers/Base.js
9+
src/core/security/User.js
10+
src/core/security/Profile.js
11+
src/core/security/Role.js
12+
src/utils/interfaces.js
13+
src/core/searchResult/SearchResultBase.js
14+
src/core/searchResult/Document.js

.gitignore

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,19 @@ doc/7/getting-started/.vuejs/cypress/screenshots
2424
doc/7/getting-started/.vuejs/cypress/videos
2525

2626
# Debug snippets
27-
test-*.js
27+
test-*.js
28+
29+
# Typescript related files
30+
*.d.ts
31+
*.js.map
32+
index.js
33+
src/Kuzzle.js
34+
src/controllers/Auth.js
35+
src/controllers/Document.js
36+
src/controllers/Base.js
37+
src/core/security/User.js
38+
src/core/security/Profile.js
39+
src/core/security/Role.js
40+
src/utils/interfaces.js
41+
src/core/searchResult/SearchResultBase.js
42+
src/core/searchResult/Document.js

.mocharc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"recursive": true,
44
"slow": 2000,
55
"timeout": 10000,
6-
"require": ["should-sinon"]
6+
"require": ["should-sinon", "ts-node/register"]
77
}

.travis.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ jobs:
3434
- npm install
3535

3636
script:
37-
- npm run lint
38-
- npm run unit-testing
37+
- npm run test:lint
38+
- npm run test:unit
3939

4040
after_success:
4141
- cat ./coverage/lcov.info | ./node_modules/.bin/codecov
@@ -65,7 +65,7 @@ jobs:
6565
- npm run build
6666

6767
script:
68-
- npm run functional-testing
68+
- npm run test:functional
6969

7070
- stage: Tests
7171
name: Documentation Tests
@@ -103,6 +103,7 @@ jobs:
103103
env:
104104
- BRANCH=dev
105105
- NODE_ENV=production
106+
- NODE_OPTIONS="--max_old_space_size=4096"
106107
- S3_BUCKET=docs-next.kuzzle.io
107108
- CLOUDFRONT_DISTRIBUTION_ID=E2ZCCEK9GRB49U
108109
- AWS_DEFAULT_REGION=us-west-2
@@ -140,6 +141,7 @@ jobs:
140141
node_js: 10
141142
env:
142143
- NODE_ENV=production
144+
- NODE_OPTIONS="--max_old_space_size=4096"
143145
- S3_BUCKET=docs.kuzzle.io
144146
- CLOUDFRONT_DISTRIBUTION_ID=E3D6RP0POLCJMM
145147
- AWS_DEFAULT_REGION=us-west-2

doc/7/controllers/auth/check-token/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ An `object` representing the token validity status
3131
| ------------- | ------------------ | --------------------------------- |
3232
| `valid` | <pre>boolean</pre> | Tell if the token is valid or not |
3333
| `state` | <pre>string</pre> | Explain why the token is invalid |
34-
|  `expires_at` | <pre>number</pre> | Token expiration timestamp |
34+
|  `expiresAt` | <pre>number</pre> | Token expiration timestamp |
3535

3636
## Usage
3737

doc/7/controllers/auth/create-api-key/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ The API key content has the following properties:
5656
| Name | Type | Description |
5757
| --------- | ----------------- | ---------------- |
5858
| `userId` | <pre>string</pre> | User kuid |
59-
| `expiresAt` | <pre>number</pre> | Aexpiration date in UNIX micro-timestamp format (`-1` if the token never expires) |
59+
| `expiresAt` | <pre>number</pre> | Expiration date in UNIX micro-timestamp format (`-1` if the token never expires) |
6060
| `ttl` | <pre>number</pre> | Original TTL |
6161
| `description` | <pre>string</pre> | API key description |
6262
| `token` | <pre>string</pre> | Authentication token associated with this API key |

doc/7/controllers/auth/get-my-rights/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ Additional query options
3131

3232
## Resolves
3333

34-
An `object[]` containing:
34+
An array containing user rights objects.
35+
36+
Each user right object has the following properties:
3537

3638
| Property | Type | Description |
3739
| ------------- | ----------------- | ------------------------------------------- |

0 commit comments

Comments
 (0)