Skip to content

Commit 1a985a5

Browse files
authored
Merge pull request #544 from kuzzleio/7.4.0-proposal
# [7.4.0](https://github.com/kuzzleio/sdk-javascript/releases/tag/7.4.0) (2020-08-18) #### New features - [ [#542](#542) ] Finalize typescript support ([Aschen](https://github.com/Aschen)) - [ [#529](#529) ] Add typescript support for protocols ([Aschen](https://github.com/Aschen)) #### Enhancements - [ [#541](#541) ] Add meaningful stacktrace ([Aschen](https://github.com/Aschen)) - [ [#537](#537) ] Add typescript support realtime ([Aschen](https://github.com/Aschen)) - [ [#531](#531) ] Add typescript support for Index and Collection controllers ([Aschen](https://github.com/Aschen)) - [ [#530](#530) ] Add typescript support for search results ([Aschen](https://github.com/Aschen)) - [ [#523](#523) ] Add support for the collection:delete API action ([morgandruesne](https://github.com/morgandruesne)) ---
2 parents 3b9d209 + 3401e54 commit 1a985a5

File tree

102 files changed

+2638
-1803
lines changed

Some content is hidden

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

102 files changed

+2638
-1803
lines changed

.eslintignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,26 @@ src/**/*.d.ts
33
src/**/*.js.map
44

55
src/Kuzzle.js
6+
src/KuzzleError.js
67
src/controllers/Auth.js
78
src/controllers/Document.js
9+
src/controllers/Realtime.js
10+
src/controllers/Index.js
11+
src/controllers/Collection.js
812
src/controllers/Base.js
913
src/core/security/User.js
1014
src/core/security/Profile.js
1115
src/core/security/Role.js
16+
src/protocols/abstract/Base.js
17+
src/protocols/abstract/Realtime.js
18+
src/protocols/Http.js
19+
src/protocols/WebSocket.js
20+
src/protocols/index.js
1221
src/utils/interfaces.js
22+
src/core/KuzzleEventEmitter.js
1323
src/core/searchResult/SearchResultBase.js
1424
src/core/searchResult/Document.js
25+
src/core/searchResult/Profile.js
26+
src/core/searchResult/Role.js
27+
src/core/searchResult/Specifications.js
28+
src/core/searchResult/User.js
File renamed without changes.

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,26 @@ test-*.js
3131
*.js.map
3232
index.js
3333
src/Kuzzle.js
34+
src/KuzzleError.js
3435
src/controllers/Auth.js
3536
src/controllers/Document.js
37+
src/controllers/Index.js
38+
src/controllers/Collection.js
3639
src/controllers/Base.js
40+
src/controllers/Realtime.js
3741
src/core/security/User.js
3842
src/core/security/Profile.js
3943
src/core/security/Role.js
44+
src/protocols/abstract/Base.js
45+
src/protocols/abstract/Realtime.js
46+
src/protocols/Http.js
47+
src/protocols/WebSocket.js
48+
src/protocols/index.js
4049
src/utils/interfaces.js
50+
src/core/KuzzleEventEmitter.js
4151
src/core/searchResult/SearchResultBase.js
4252
src/core/searchResult/Document.js
53+
src/core/searchResult/Profile.js
54+
src/core/searchResult/Role.js
55+
src/core/searchResult/Specifications.js
56+
src/core/searchResult/User.js

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232

3333
install:
3434
- npm install
35+
- npm run build
3536

3637
script:
3738
- npm run test:lint
@@ -78,7 +79,7 @@ jobs:
7879
- npm install
7980
- npm run build
8081
script:
81-
- npm run doc-testing
82+
- travis_retry npm run doc-testing
8283

8384
- stage: Tests
8485
name: Dead link check
@@ -93,7 +94,7 @@ jobs:
9394
- $(npm bin)/kuzdoc framework:link -d /sdk/js/7/ -v 7
9495
script:
9596
- gem install typhoeus
96-
- cd doc/framework/ && HYDRA_MAX_CONCURRENCY=20 ruby .ci/dead-links.rb -p src/sdk/js/7/
97+
- cd doc/framework/ && HYDRA_MAX_CONCURRENCY=20 travis_retry ruby .ci/dead-links.rb -p src/sdk/js/7/
9798

9899
- stage: Deployment Doc Dev
99100
name: Deploy next-docs.kuzzle.io

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> | Expiration date in UNIX micro-timestamp format (`-1` if the token never expires) |
59+
| `expiresAt` | <pre>number</pre> | Expiration date in Epoch-millis 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/create-api-key/snippets/create-api-key.test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: auth#createApiKey
22
description: Creates a new API key for the currently loggued user.
33
hooks:
44
before: >
5-
curl -H "Content-type: application/json" -d '{
5+
curl --fail -H "Content-type: application/json" -d '{
66
"content": {
77
"profileIds": ["default"]
88
},

doc/7/controllers/auth/delete-api-key/snippets/delete-api-key.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
try {
2-
await kuzzle.auth.login('local', { username: 'john.doe', password: 'password' });
2+
await kuzzle.auth.login('local', { username: 'jane.doe', password: 'password' });
33

44
await kuzzle.auth.deleteApiKey('fQRa28BsidO6V_wmOcL');
55

doc/7/controllers/auth/delete-api-key/snippets/delete-api-key.test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@ name: auth#deleteApiKey
22
description: Deletes an API key for the currently loggued user
33
hooks:
44
before: >
5-
curl -H "Content-type: application/json" -d '{
5+
curl --fail -H "Content-type: application/json" -d '{
66
"content": {
77
"profileIds": ["default"]
88
},
99
"credentials": {
1010
"local": {
11-
"username": "john.doe",
11+
"username": "jane.doe",
1212
"password": "password"
1313
}
1414
}
15-
}' "kuzzle:7512/users/john.doe/_create?refresh=wait_for"
15+
}' "kuzzle:7512/users/jane.doe/_create?refresh=wait_for"
1616
&&
1717
curl -XPOST -H "Content-type: application/json" -d '{
1818
"description": "Sigfox API key"
19-
}' "kuzzle:7512/users/john.doe/api-keys/_create?_id=fQRa28BsidO6V_wmOcL&refresh=wait_for"
19+
}' "kuzzle:7512/users/jane.doe/api-keys/_create?_id=fQRa28BsidO6V_wmOcL&refresh=wait_for"
2020
after:
21-
curl -XDELETE kuzzle:7512/users/john.doe
21+
curl -XDELETE kuzzle:7512/users/jane.doe
2222
template: default
2323
expected:
2424
- API key successfully deleted

doc/7/controllers/auth/search-api-keys/snippets/search-api-keys.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
try {
22
const promises = [];
33

4-
// Create some API keys for user "john.doe"
4+
// Create some API keys for user "jared.doe"
55
promises.push(
6-
kuzzle.security.createApiKey('john.doe', 'Sigfox API key'));
6+
kuzzle.security.createApiKey('jared.doe', 'Sigfox API key'));
77
promises.push(
8-
kuzzle.security.createApiKey('john.doe', 'LoRa 6 month API key', {
8+
kuzzle.security.createApiKey('jared.doe', 'LoRa 6 month API key', {
99
expiresIn: '6m'
1010
}));
1111
promises.push(
12-
kuzzle.security.createApiKey('john.doe', 'LoRa permanent API key', {
12+
kuzzle.security.createApiKey('jared.doe', 'LoRa permanent API key', {
1313
refresh: 'wait_for'
1414
}));
1515

1616
await Promise.all(promises);
1717

18-
// Log as "john.doe"
19-
await kuzzle.auth.login('local', { username: 'john.doe', password: 'password' });
18+
// Log as "jared.doe"
19+
await kuzzle.auth.login('local', { username: 'jared.doe', password: 'password' });
2020

2121
const results = await kuzzle.auth.searchApiKeys({
2222
match: {
@@ -33,7 +33,7 @@ try {
3333
"_id": "znEwbG8BJASM_0-bWU-q",
3434
"_source": {
3535
"description": "LoRa permanent API key",
36-
"userId": "john.doe",
36+
"userId": "jared.doe",
3737
"expiresAt": -1,
3838
"ttl": -1
3939
}
@@ -42,7 +42,7 @@ try {
4242
"_id": "zXEwbG8BJASM_0-bWU-q",
4343
"_source": {
4444
"description": "LoRa 1 year API key",
45-
"userId": "john.doe",
45+
"userId": "jared.doe",
4646
"expiresAt": 31557600000,
4747
"ttl": 360000
4848
}

doc/7/controllers/auth/search-api-keys/snippets/search-api-keys.test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ name: auth#searchApiKeys
22
description: Searches API keys for the currently loggued user.
33
hooks:
44
before: >
5-
curl -H "Content-type: application/json" -d '{
5+
curl --fail -H "Content-type: application/json" -d '{
66
"content": {
77
"profileIds": ["default"]
88
},
99
"credentials": {
1010
"local": {
11-
"username": "john.doe",
11+
"username": "jared.doe",
1212
"password": "password"
1313
}
1414
}
15-
}' "kuzzle:7512/users/john.doe/_create?refresh=wait_for"
15+
}' "kuzzle:7512/users/jared.doe/_create?refresh=wait_for"
1616
after:
17-
curl -XDELETE kuzzle:7512/users/john.doe
17+
curl -XDELETE kuzzle:7512/users/jared.doe
1818
template: default
1919
expected:
2020
- Found 2 API keys matching "LoRa"

0 commit comments

Comments
 (0)