kuzzle 2.19.5 → 2.19.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -7
- package/lib/core/shared/sdk/embeddedSdk.d.ts +3 -4
- package/lib/core/shared/sdk/embeddedSdk.js +1 -0
- package/lib/kerror/index.js +1 -1
- package/lib/service/storage/esWrapper.js +4 -0
- package/lib/types/index.d.ts +0 -1
- package/lib/types/index.js +0 -1
- package/package.json +6 -9
- package/lib/types/RequestPayload.d.ts +0 -45
- package/lib/types/RequestPayload.js +0 -23
- package/lib/types/ResponsePayload.d.ts +0 -74
- package/lib/types/ResponsePayload.js +0 -23
package/README.md
CHANGED
|
@@ -37,9 +37,9 @@ Learn how Kuzzle will accelerate your developments :point_right: https://docs.ku
|
|
|
37
37
|
|
|
38
38
|
## Kuzzle in production
|
|
39
39
|
|
|
40
|
-
Kuzzle is production-proof, and can be [deployed anywhere](https://kuzzle.io/products/by-features/on-premises/).
|
|
40
|
+
Kuzzle is production-proof, and can be [deployed anywhere](https://kuzzle.io/products/by-features/on-premises/).
|
|
41
41
|
|
|
42
|
-
With Kuzzle, it is possible to deploy applications that can serve tens of thousands of users with very good performances.
|
|
42
|
+
With Kuzzle, it is possible to deploy applications that can serve tens of thousands of users with very good performances.
|
|
43
43
|
|
|
44
44
|
Check out our [support plans](https://kuzzle.io/pricing/).
|
|
45
45
|
|
|
@@ -51,7 +51,7 @@ The easiest way to start a Kuzzle application is to use [Kourou](https://github.
|
|
|
51
51
|
npx kourou app:scaffold playground
|
|
52
52
|
|
|
53
53
|
🚀 Kourou - Scaffolds a new Kuzzle application
|
|
54
|
-
|
|
54
|
+
|
|
55
55
|
✔ Creating playground/ directory
|
|
56
56
|
✔ Creating and rendering application files
|
|
57
57
|
✔ Installing latest Kuzzle version via NPM and Docker (this can take some time)
|
|
@@ -78,7 +78,7 @@ const app = new Backend('playground');
|
|
|
78
78
|
app.controller.register('greeting', {
|
|
79
79
|
actions: {
|
|
80
80
|
sayHello: {
|
|
81
|
-
handler: async request => `Hello, ${request.input.args.name}`
|
|
81
|
+
handler: async request => `Hello, ${request.input.args.name}`
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
});
|
|
@@ -110,13 +110,13 @@ Learn how to [Write an Application](https://docs.kuzzle.io/core/2/guides/getting
|
|
|
110
110
|
|
|
111
111
|
## Get trained by the creators of Kuzzle :zap:
|
|
112
112
|
|
|
113
|
-
Train yourself and your teams to use Kuzzle to maximize its potential and accelerate the development of your projects.
|
|
114
|
-
Our teams will be able to meet your needs in terms of expertise and multi-technology support for IoT, mobile/web, backend/frontend, devops.
|
|
113
|
+
Train yourself and your teams to use Kuzzle to maximize its potential and accelerate the development of your projects.
|
|
114
|
+
Our teams will be able to meet your needs in terms of expertise and multi-technology support for IoT, mobile/web, backend/frontend, devops.
|
|
115
115
|
:point_right: [Get a quote](https://hubs.ly/H0jkfJ_0)
|
|
116
116
|
|
|
117
117
|
## Public Roadmap
|
|
118
118
|
|
|
119
|
-
You can consult the public roadmap on Trello. Come and vote for the features you need!
|
|
119
|
+
You can consult the public roadmap on Trello. Come and vote for the features you need!
|
|
120
120
|
:point_right: [Kuzzle Public Roadmap](https://trello.com/b/za9vOgRh/kuzzle-public-roadmap)
|
|
121
121
|
|
|
122
122
|
## Contributing to Kuzzle
|
|
@@ -149,3 +149,4 @@ npm run docker:install
|
|
|
149
149
|
```
|
|
150
150
|
|
|
151
151
|
finally run the command `docker-compose up` to launch your kuzzle stack.
|
|
152
|
+
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { RealtimeController, Notification, JSONObject, ScopeOption, UserOption, Kuzzle,
|
|
2
|
-
import { ResponsePayload } from "../../../types";
|
|
1
|
+
import { RealtimeController, Notification, JSONObject, ScopeOption, UserOption, Kuzzle, ResponsePayload, BaseRequest } from "kuzzle-sdk";
|
|
3
2
|
interface EmbeddedRealtime extends RealtimeController {
|
|
4
3
|
/**
|
|
5
4
|
* Subscribes by providing a set of filters: messages, document changes
|
|
@@ -70,8 +69,8 @@ export declare class EmbeddedSDK extends Kuzzle {
|
|
|
70
69
|
* @param request - API request (https://docs.kuzzle.io/core/2/guides/main-concepts/1-api#other-protocols)
|
|
71
70
|
* @param options - Optional arguments
|
|
72
71
|
*/
|
|
73
|
-
query(request:
|
|
72
|
+
query<TRequest extends BaseRequest = BaseRequest, TResult extends JSONObject = JSONObject>(request: TRequest, options?: {
|
|
74
73
|
propagate?: boolean;
|
|
75
|
-
}): Promise<ResponsePayload
|
|
74
|
+
}): Promise<ResponsePayload<TResult>>;
|
|
76
75
|
}
|
|
77
76
|
export {};
|
|
@@ -112,6 +112,7 @@ class EmbeddedSDK extends kuzzle_sdk_1.Kuzzle {
|
|
|
112
112
|
if ((0, safeObject_1.isPlainObject)(request) &&
|
|
113
113
|
request.controller === "realtime" &&
|
|
114
114
|
request.action === "subscribe") {
|
|
115
|
+
// @ts-expect-error
|
|
115
116
|
request.propagate =
|
|
116
117
|
options.propagate === undefined || options.propagate === null
|
|
117
118
|
? false
|
package/lib/kerror/index.js
CHANGED
|
@@ -169,7 +169,7 @@ function rawGetFrom(domains, source, domain, subdomain, error, ...placeholders)
|
|
|
169
169
|
const derivedError = rawGet(domains, domain, subdomain, error, ...placeholders);
|
|
170
170
|
// If a stacktrace is present, we need to modify the first line because it
|
|
171
171
|
// still contains the original error message
|
|
172
|
-
if (derivedError.stack && derivedError.stack.length) {
|
|
172
|
+
if (derivedError.stack && derivedError.stack.length && source.stack) {
|
|
173
173
|
const stackArray = source.stack.split("\n");
|
|
174
174
|
stackArray.shift();
|
|
175
175
|
derivedError.stack = [
|
|
@@ -232,6 +232,10 @@ class ESWrapper {
|
|
|
232
232
|
_handleNotFoundError(error, message) {
|
|
233
233
|
let errorMessage = message;
|
|
234
234
|
|
|
235
|
+
if (!error.body._index) {
|
|
236
|
+
return kerror.get("unexpected_not_found", errorMessage);
|
|
237
|
+
}
|
|
238
|
+
|
|
235
239
|
// _index= "&nyc-open-data.yellow-taxi"
|
|
236
240
|
const index = error.body._index.split(".")[0].slice(1);
|
|
237
241
|
const collection = error.body._index.split(".")[1];
|
package/lib/types/index.d.ts
CHANGED
package/lib/types/index.js
CHANGED
|
@@ -38,7 +38,6 @@ __exportStar(require("./Plugin"), exports);
|
|
|
38
38
|
__exportStar(require("./Controller"), exports);
|
|
39
39
|
__exportStar(require("./ControllerDefinition"), exports);
|
|
40
40
|
__exportStar(require("./ControllerRights"), exports);
|
|
41
|
-
__exportStar(require("./ResponsePayload"), exports);
|
|
42
41
|
__exportStar(require("./Deprecation"), exports);
|
|
43
42
|
__exportStar(require("./EventHandler"), exports);
|
|
44
43
|
__exportStar(require("./Policy"), exports);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kuzzle",
|
|
3
3
|
"author": "The Kuzzle Team <support@kuzzle.io>",
|
|
4
|
-
"version": "2.19.
|
|
4
|
+
"version": "2.19.7",
|
|
5
5
|
"description": "Kuzzle is an open-source solution that handles all the data management through a secured API, with a large choice of protocols.",
|
|
6
6
|
"bin": "bin/start-kuzzle-server",
|
|
7
7
|
"scripts": {
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"test:functional:legacy:mqtt": "npx cucumber-js --format progress-bar --profile mqtt ./features-legacy",
|
|
27
27
|
"cucumber": "cucumber.js --fail-fast",
|
|
28
28
|
"codecov": "codecov",
|
|
29
|
+
"prettier": "npx prettier ./lib ./test ./bin ./features ./plugins/available/functional-test-plugin --write",
|
|
29
30
|
"test:lint": "npm run test:lint:js && npm run test:lint:ts",
|
|
30
31
|
"test:lint:ts": "eslint --max-warnings=0 ./lib --ext .ts --config .eslintc-ts.json",
|
|
31
32
|
"test:lint:ts:fix": "eslint --max-warnings=0 --fix ./lib --ext .ts --config .eslintc-ts.json",
|
|
@@ -41,7 +42,6 @@
|
|
|
41
42
|
},
|
|
42
43
|
"dependencies": {
|
|
43
44
|
"@elastic/elasticsearch": "https://github.com/elastic/elasticsearch-js/archive/refs/tags/v7.13.0.tar.gz",
|
|
44
|
-
"@types/js-yaml": "^4.0.5",
|
|
45
45
|
"aedes": "^0.46.3",
|
|
46
46
|
"bluebird": "^3.7.2",
|
|
47
47
|
"cli-color": "^2.0.3",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"denque": "^2.1.0",
|
|
51
51
|
"didyoumean": "^1.2.2",
|
|
52
52
|
"dumpme": "^1.0.3",
|
|
53
|
+
"eslint-plugin-kuzzle": "^0.0.6",
|
|
53
54
|
"eventemitter3": "^4.0.7",
|
|
54
55
|
"inquirer": "^9.1.1",
|
|
55
56
|
"ioredis": "^5.2.3",
|
|
@@ -60,7 +61,7 @@
|
|
|
60
61
|
"koncorde": "^4.0.3",
|
|
61
62
|
"kuzzle-plugin-auth-passport-local": "^6.3.6",
|
|
62
63
|
"kuzzle-plugin-logger": "^3.0.3",
|
|
63
|
-
"kuzzle-sdk": "^7.10.
|
|
64
|
+
"kuzzle-sdk": "^7.10.3",
|
|
64
65
|
"kuzzle-vault": "^2.0.4",
|
|
65
66
|
"lodash": "4.17.21",
|
|
66
67
|
"long": "^5.2.0",
|
|
@@ -70,13 +71,12 @@
|
|
|
70
71
|
"ndjson": "^2.0.0",
|
|
71
72
|
"node-segfault-handler": "^1.1.0",
|
|
72
73
|
"passport": "^0.6.0",
|
|
73
|
-
"prettier": "^2.7.1",
|
|
74
74
|
"protobufjs": "~7.1.0",
|
|
75
75
|
"rc": "1.2.8",
|
|
76
76
|
"semver": "^7.3.7",
|
|
77
77
|
"sorted-array": "^2.0.4",
|
|
78
|
-
"uWebSockets.js": "https://github.com/uNetworking/uWebSockets.js/archive/refs/tags/v20.0.0.tar.gz",
|
|
79
78
|
"uuid": "^9.0.0",
|
|
79
|
+
"uWebSockets.js": "https://github.com/uNetworking/uWebSockets.js/archive/refs/tags/v20.0.0.tar.gz",
|
|
80
80
|
"validator": "^13.7.0",
|
|
81
81
|
"winston": "^3.8.1",
|
|
82
82
|
"winston-elasticsearch": "0.17.1",
|
|
@@ -90,16 +90,13 @@
|
|
|
90
90
|
"url": "git://github.com/kuzzleio/kuzzle.git"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
|
+
"@types/js-yaml": "^4.0.5",
|
|
93
94
|
"@types/lodash": "^4.14.184",
|
|
94
|
-
"@typescript-eslint/eslint-plugin": "^5.36.2",
|
|
95
|
-
"@typescript-eslint/parser": "^5.36.2",
|
|
96
95
|
"async": "^3.2.4",
|
|
97
96
|
"chokidar": "^3.5.3",
|
|
98
97
|
"codecov": "^3.8.3",
|
|
99
98
|
"cucumber": "^6.0.5",
|
|
100
99
|
"ergol": "^1.0.2",
|
|
101
|
-
"eslint": "^8.23.0",
|
|
102
|
-
"eslint-plugin-kuzzle": "0.0.5",
|
|
103
100
|
"mocha": "^9.2.2",
|
|
104
101
|
"mock-require": "^3.0.3",
|
|
105
102
|
"mqtt": "^4.3.7",
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { JSONObject } from "../../index";
|
|
2
|
-
/**
|
|
3
|
-
* Kuzzle API request payload
|
|
4
|
-
*
|
|
5
|
-
* @see https://docs.kuzzle.io/core/2/api/payloads/request
|
|
6
|
-
*/
|
|
7
|
-
export declare type RequestPayload = {
|
|
8
|
-
/**
|
|
9
|
-
* API controller name
|
|
10
|
-
*/
|
|
11
|
-
controller: string;
|
|
12
|
-
/**
|
|
13
|
-
* API action name
|
|
14
|
-
*/
|
|
15
|
-
action: string;
|
|
16
|
-
/**
|
|
17
|
-
* Index name
|
|
18
|
-
*/
|
|
19
|
-
index?: string;
|
|
20
|
-
/**
|
|
21
|
-
* Collection name
|
|
22
|
-
*/
|
|
23
|
-
collection?: string;
|
|
24
|
-
/**
|
|
25
|
-
* Document unique identifier
|
|
26
|
-
*/
|
|
27
|
-
_id?: string;
|
|
28
|
-
/**
|
|
29
|
-
* Authentication token
|
|
30
|
-
*/
|
|
31
|
-
jwt?: string;
|
|
32
|
-
/**
|
|
33
|
-
* Volatile data
|
|
34
|
-
*/
|
|
35
|
-
volatile?: JSONObject;
|
|
36
|
-
/**
|
|
37
|
-
* Request body
|
|
38
|
-
*/
|
|
39
|
-
body?: JSONObject;
|
|
40
|
-
/**
|
|
41
|
-
* Request unique identifier
|
|
42
|
-
*/
|
|
43
|
-
requestId?: string;
|
|
44
|
-
[key: string]: any;
|
|
45
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Kuzzle, a backend software, self-hostable and ready to use
|
|
4
|
-
* to power modern apps
|
|
5
|
-
*
|
|
6
|
-
* Copyright 2015-2022 Kuzzle
|
|
7
|
-
* mailto: support AT kuzzle.io
|
|
8
|
-
* website: http://kuzzle.io
|
|
9
|
-
*
|
|
10
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11
|
-
* you may not use this file except in compliance with the License.
|
|
12
|
-
* You may obtain a copy of the License at
|
|
13
|
-
*
|
|
14
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
-
*
|
|
16
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
17
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
18
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
-
* See the License for the specific language governing permissions and
|
|
20
|
-
* limitations under the License.
|
|
21
|
-
*/
|
|
22
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
//# sourceMappingURL=RequestPayload.js.map
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { JSONObject } from "../../index";
|
|
2
|
-
export declare type ResponseErrorPayload = {
|
|
3
|
-
/**
|
|
4
|
-
* Error human readable identifier
|
|
5
|
-
*/
|
|
6
|
-
id: string;
|
|
7
|
-
/**
|
|
8
|
-
* Error identifier
|
|
9
|
-
*/
|
|
10
|
-
code: number;
|
|
11
|
-
/**
|
|
12
|
-
* Error message
|
|
13
|
-
*/
|
|
14
|
-
message: string;
|
|
15
|
-
/**
|
|
16
|
-
* HTTP status error code
|
|
17
|
-
*/
|
|
18
|
-
status: number;
|
|
19
|
-
/**
|
|
20
|
-
* Error stacktrace (only if global.NODE_ENV=development)
|
|
21
|
-
*/
|
|
22
|
-
stack?: string;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Kuzzle API response payload
|
|
26
|
-
*
|
|
27
|
-
* @see https://docs.kuzzle.io/core/2/api/payloads/response
|
|
28
|
-
*/
|
|
29
|
-
export declare type ResponsePayload = {
|
|
30
|
-
/**
|
|
31
|
-
* API controller name
|
|
32
|
-
*/
|
|
33
|
-
controller: string;
|
|
34
|
-
/**
|
|
35
|
-
* API action name
|
|
36
|
-
*/
|
|
37
|
-
action: string;
|
|
38
|
-
/**
|
|
39
|
-
* Index name
|
|
40
|
-
*/
|
|
41
|
-
index?: string;
|
|
42
|
-
/**
|
|
43
|
-
* Collection name
|
|
44
|
-
*/
|
|
45
|
-
collection?: string;
|
|
46
|
-
/**
|
|
47
|
-
* Document unique identifier
|
|
48
|
-
*/
|
|
49
|
-
_id?: string;
|
|
50
|
-
/**
|
|
51
|
-
* API error
|
|
52
|
-
*/
|
|
53
|
-
error?: ResponseErrorPayload;
|
|
54
|
-
/**
|
|
55
|
-
* Request unique identifier
|
|
56
|
-
*/
|
|
57
|
-
requestId: string;
|
|
58
|
-
/**
|
|
59
|
-
* API action result
|
|
60
|
-
*/
|
|
61
|
-
result: any;
|
|
62
|
-
/**
|
|
63
|
-
* HTTP status code
|
|
64
|
-
*/
|
|
65
|
-
status: number;
|
|
66
|
-
/**
|
|
67
|
-
* Volatile data
|
|
68
|
-
*/
|
|
69
|
-
volatile?: JSONObject;
|
|
70
|
-
/**
|
|
71
|
-
* Room unique identifier
|
|
72
|
-
*/
|
|
73
|
-
room?: string;
|
|
74
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Kuzzle, a backend software, self-hostable and ready to use
|
|
4
|
-
* to power modern apps
|
|
5
|
-
*
|
|
6
|
-
* Copyright 2015-2022 Kuzzle
|
|
7
|
-
* mailto: support AT kuzzle.io
|
|
8
|
-
* website: http://kuzzle.io
|
|
9
|
-
*
|
|
10
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11
|
-
* you may not use this file except in compliance with the License.
|
|
12
|
-
* You may obtain a copy of the License at
|
|
13
|
-
*
|
|
14
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
-
*
|
|
16
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
17
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
18
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
-
* See the License for the specific language governing permissions and
|
|
20
|
-
* limitations under the License.
|
|
21
|
-
*/
|
|
22
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
//# sourceMappingURL=ResponsePayload.js.map
|