kuzzle 2.17.7 → 2.17.8
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/bin/start-kuzzle-server +1 -1
- package/lib/api/controllers/adminController.js +1 -1
- package/lib/api/controllers/authController.js +1 -1
- package/lib/api/controllers/baseController.js +1 -1
- package/lib/api/controllers/bulkController.js +1 -1
- package/lib/api/controllers/clusterController.js +1 -1
- package/lib/api/controllers/collectionController.js +1 -1
- package/lib/api/controllers/documentController.js +7 -2
- package/lib/api/controllers/index.js +1 -1
- package/lib/api/controllers/indexController.js +1 -1
- package/lib/api/controllers/memoryStorageController.js +1 -1
- package/lib/api/controllers/realtimeController.js +1 -1
- package/lib/api/controllers/securityController.js +1 -1
- package/lib/api/controllers/serverController.js +1 -1
- package/lib/api/documentExtractor.js +1 -1
- package/lib/api/funnel.js +1 -1
- package/lib/api/httpRoutes.js +5 -4
- package/lib/api/openapi/OpenApiManager.js +2 -1
- package/lib/api/openapi/components/document/index.d.ts +2 -0
- package/lib/api/openapi/components/document/index.js +6 -1
- package/lib/api/openapi/components/document/mCreateOrReplace.yaml +93 -0
- package/lib/api/openapi/openApiGenerator.js +1 -1
- package/lib/api/rateLimiter.js +1 -1
- package/lib/api/request/kuzzleRequest.js +1 -1
- package/lib/api/request/requestContext.js +1 -1
- package/lib/api/request/requestInput.js +1 -1
- package/lib/api/request/requestResponse.js +1 -1
- package/lib/cluster/command.js +1 -1
- package/lib/cluster/idCardHandler.js +1 -1
- package/lib/cluster/index.js +1 -1
- package/lib/cluster/node.js +8 -8
- package/lib/cluster/publisher.js +1 -1
- package/lib/cluster/state.js +1 -1
- package/lib/cluster/subscriber.js +4 -1
- package/lib/config/documentEventAliases.js +1 -1
- package/lib/config/index.js +1 -1
- package/lib/core/auth/formatProcessing.js +1 -1
- package/lib/core/auth/passportResponse.js +1 -1
- package/lib/core/auth/passportWrapper.js +1 -1
- package/lib/core/auth/tokenManager.js +1 -1
- package/lib/core/backend/applicationManager.js +1 -1
- package/lib/core/backend/backend.js +1 -1
- package/lib/core/backend/backendCluster.js +1 -1
- package/lib/core/backend/backendConfig.js +1 -1
- package/lib/core/backend/backendController.js +1 -1
- package/lib/core/backend/backendErrors.js +1 -1
- package/lib/core/backend/backendHook.js +1 -1
- package/lib/core/backend/backendImport.js +1 -1
- package/lib/core/backend/backendOpenApi.js +1 -1
- package/lib/core/backend/backendPipe.js +1 -1
- package/lib/core/backend/backendPlugin.js +1 -1
- package/lib/core/backend/backendStorage.js +1 -1
- package/lib/core/backend/backendVault.js +1 -1
- package/lib/core/backend/internalLogger.js +1 -1
- package/lib/core/cache/cacheDbEnum.js +1 -1
- package/lib/core/cache/cacheEngine.js +1 -1
- package/lib/core/network/accessLogger.js +1 -1
- package/lib/core/network/clientConnection.js +1 -1
- package/lib/core/network/context.js +1 -1
- package/lib/core/network/entryPoint.js +6 -6
- package/lib/core/network/httpRouter/index.js +1 -1
- package/lib/core/network/httpRouter/routeHandler.js +1 -1
- package/lib/core/network/httpRouter/routePart.js +1 -1
- package/lib/core/network/protocolManifest.js +1 -1
- package/lib/core/network/protocols/httpMessage.js +1 -1
- package/lib/core/network/protocols/httpwsProtocol.js +5 -10
- package/lib/core/network/protocols/internalProtocol.js +1 -1
- package/lib/core/network/protocols/mqttProtocol.js +4 -3
- package/lib/core/network/protocols/protocol.js +1 -1
- package/lib/core/network/router.js +11 -2
- package/lib/core/plugin/plugin.js +1 -1
- package/lib/core/plugin/pluginContext.js +1 -1
- package/lib/core/plugin/pluginManifest.js +1 -1
- package/lib/core/plugin/pluginRepository.js +1 -1
- package/lib/core/plugin/pluginsManager.js +1 -1
- package/lib/core/plugin/privilegedContext.js +1 -1
- package/lib/core/realtime/actionEnum.js +1 -1
- package/lib/core/realtime/channel.js +1 -1
- package/lib/core/realtime/connectionRooms.js +1 -1
- package/lib/core/realtime/hotelClerk.js +66 -24
- package/lib/core/realtime/index.js +1 -1
- package/lib/core/realtime/notification/document.js +1 -1
- package/lib/core/realtime/notification/index.js +1 -1
- package/lib/core/realtime/notification/server.js +1 -1
- package/lib/core/realtime/notification/user.js +1 -1
- package/lib/core/realtime/notifier.js +1 -1
- package/lib/core/realtime/room.js +1 -1
- package/lib/core/realtime/subscription.js +1 -1
- package/lib/core/security/index.js +1 -1
- package/lib/core/security/profileRepository.js +1 -1
- package/lib/core/security/roleRepository.js +1 -1
- package/lib/core/security/securityLoader.js +1 -1
- package/lib/core/security/tokenRepository.js +1 -1
- package/lib/core/security/userRepository.js +1 -1
- package/lib/core/shared/KoncordeWrapper.js +1 -1
- package/lib/core/shared/abstractManifest.js +1 -1
- package/lib/core/shared/repository.js +1 -1
- package/lib/core/shared/sdk/embeddedSdk.js +4 -3
- package/lib/core/shared/sdk/funnelProtocol.d.ts +14 -0
- package/lib/core/shared/sdk/funnelProtocol.js +76 -81
- package/lib/core/shared/sdk/impersonatedSdk.js +1 -1
- package/lib/core/shared/store.js +1 -1
- package/lib/core/statistics/index.js +1 -1
- package/lib/core/statistics/statistics.js +1 -1
- package/lib/core/storage/clientAdapter.js +1 -1
- package/lib/core/storage/indexCache.js +1 -1
- package/lib/core/storage/storageEngine.js +1 -1
- package/lib/core/storage/storeScopeEnum.js +1 -1
- package/lib/core/validation/baseType.js +1 -1
- package/lib/core/validation/index.js +1 -1
- package/lib/core/validation/types/anything.js +1 -1
- package/lib/core/validation/types/boolean.js +1 -1
- package/lib/core/validation/types/date.js +1 -1
- package/lib/core/validation/types/email.js +1 -1
- package/lib/core/validation/types/enum.js +1 -1
- package/lib/core/validation/types/geoPoint.js +1 -1
- package/lib/core/validation/types/geoShape.js +1 -1
- package/lib/core/validation/types/integer.js +1 -1
- package/lib/core/validation/types/ipAddress.js +1 -1
- package/lib/core/validation/types/numeric.js +1 -1
- package/lib/core/validation/types/object.js +1 -1
- package/lib/core/validation/types/string.js +1 -1
- package/lib/core/validation/types/url.js +1 -1
- package/lib/core/validation/validation.js +1 -1
- package/lib/kerror/codes/index.js +1 -1
- package/lib/kerror/errors/badRequestError.js +1 -1
- package/lib/kerror/errors/externalServiceError.js +1 -1
- package/lib/kerror/errors/forbiddenError.js +1 -1
- package/lib/kerror/errors/gatewayTimeoutError.js +1 -1
- package/lib/kerror/errors/index.js +1 -1
- package/lib/kerror/errors/internalError.js +1 -1
- package/lib/kerror/errors/kuzzleError.js +1 -1
- package/lib/kerror/errors/multipleErrorsError.js +1 -1
- package/lib/kerror/errors/notFoundError.js +1 -1
- package/lib/kerror/errors/partialError.js +1 -1
- package/lib/kerror/errors/pluginImplementationError.js +1 -1
- package/lib/kerror/errors/preconditionError.js +1 -1
- package/lib/kerror/errors/serviceUnavailableError.js +1 -1
- package/lib/kerror/errors/sizeLimitError.js +1 -1
- package/lib/kerror/errors/tooManyRequestsError.js +1 -1
- package/lib/kerror/errors/unauthorizedError.js +1 -1
- package/lib/kerror/index.js +2 -4
- package/lib/kuzzle/dumpGenerator.js +1 -1
- package/lib/kuzzle/event/kuzzleEventEmitter.js +39 -1
- package/lib/kuzzle/event/pipeRunner.js +1 -1
- package/lib/kuzzle/event/waterfall.js +1 -1
- package/lib/kuzzle/index.js +1 -1
- package/lib/kuzzle/internalIndexHandler.js +1 -1
- package/lib/kuzzle/kuzzle.js +1 -1
- package/lib/kuzzle/kuzzleStateEnum.js +1 -1
- package/lib/kuzzle/log.js +1 -1
- package/lib/kuzzle/vault.js +1 -1
- package/lib/model/security/profile.js +1 -1
- package/lib/model/security/rights.js +1 -1
- package/lib/model/security/role.js +1 -1
- package/lib/model/security/token.js +1 -1
- package/lib/model/security/user.js +1 -1
- package/lib/model/storage/apiKey.js +1 -1
- package/lib/model/storage/baseModel.js +1 -1
- package/lib/service/cache/redis.js +1 -1
- package/lib/service/service.js +1 -1
- package/lib/service/storage/elasticsearch.js +5 -5
- package/lib/service/storage/esWrapper.js +1 -1
- package/lib/service/storage/queryTranslator.js +1 -1
- package/lib/types/Controller.js +1 -1
- package/lib/types/ControllerDefinition.js +1 -1
- package/lib/types/Deprecation.js +1 -1
- package/lib/types/EventHandler.js +1 -1
- package/lib/types/KuzzleDocument.d.ts +3 -0
- package/lib/types/Plugin.js +1 -1
- package/lib/types/PluginManifest.js +1 -1
- package/lib/types/RequestPayload.js +1 -1
- package/lib/types/ResponsePayload.js +1 -1
- package/lib/types/StrategyDefinition.js +1 -1
- package/lib/types/Token.js +1 -1
- package/lib/types/User.js +1 -1
- package/lib/types/index.js +1 -1
- package/lib/util/array.js +1 -1
- package/lib/util/assertType.js +1 -1
- package/lib/util/asyncStore.js +1 -1
- package/lib/util/debug.js +1 -1
- package/lib/util/deprecate.js +1 -1
- package/lib/util/didYouMean.js +1 -1
- package/lib/util/extractFields.js +1 -1
- package/lib/util/inflector.js +1 -1
- package/lib/util/koncordeCompat.js +1 -1
- package/lib/util/memoize.js +1 -1
- package/lib/util/mutex.js +1 -1
- package/lib/util/name-generator.js +1 -1
- package/lib/util/promback.js +1 -1
- package/lib/util/requestAssertions.js +1 -1
- package/lib/util/safeObject.js +1 -1
- package/lib/util/stackTrace.js +56 -17
- package/lib/util/wildcard.js +1 -1
- package/package-lock.json +1 -1
- package/package.json +4 -3
- package/lib/core/network/removeErrorStack.js +0 -56
package/lib/util/didYouMean.js
CHANGED
package/lib/util/inflector.js
CHANGED
package/lib/util/memoize.js
CHANGED
package/lib/util/mutex.js
CHANGED
package/lib/util/promback.js
CHANGED
package/lib/util/safeObject.js
CHANGED
package/lib/util/stackTrace.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Kuzzle, a backend software, self-hostable and ready to use
|
|
3
3
|
* to power modern apps
|
|
4
4
|
*
|
|
5
|
-
* Copyright 2015-
|
|
5
|
+
* Copyright 2015-2022 Kuzzle
|
|
6
6
|
* mailto: support AT kuzzle.io
|
|
7
7
|
* website: http://kuzzle.io
|
|
8
8
|
*
|
|
@@ -21,33 +21,72 @@
|
|
|
21
21
|
|
|
22
22
|
'use strict';
|
|
23
23
|
|
|
24
|
+
const util = require('util');
|
|
25
|
+
|
|
26
|
+
const MARKER = '>';
|
|
27
|
+
const PADDING = ' ';
|
|
28
|
+
|
|
24
29
|
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
* Hilight user code
|
|
31
|
+
*
|
|
32
|
+
* e.g.
|
|
33
|
+
* at BackendController._add (/home/kuzzle/lib/core/application/backend.ts:261:28)
|
|
34
|
+
* at BackendController.register (/home/kuzzle/lib/core/application/backend.ts:187:10)
|
|
35
|
+
* >>>> at registerFoo (/home/aschen/projets/app/test.ts:12:18)
|
|
36
|
+
* >>>> at init (/home/aschen/projets/app/test.ts:8:3)
|
|
37
|
+
* at Module._compile (internal/modules/cjs/loader.js:1133:30)
|
|
38
|
+
*/
|
|
34
39
|
function hilightUserCode (line) {
|
|
35
40
|
// ignore first line (error message) or already enhanced
|
|
36
|
-
if (! line.includes(' at ') || line.startsWith(
|
|
41
|
+
if (! line.includes(' at ') || line.startsWith(MARKER)) {
|
|
37
42
|
return line;
|
|
38
43
|
}
|
|
39
44
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
const isKuzzleCode = line.includes('kuzzle/lib/');
|
|
46
|
+
const isNodeCode = ! line.includes('at /')
|
|
47
|
+
&& ! line.includes('at async /')
|
|
48
|
+
&& line.charAt(line.indexOf('(') + 1) !== '/';
|
|
49
|
+
const isModuleCode = line.includes('node_modules');
|
|
50
|
+
if (isKuzzleCode || isNodeCode || isModuleCode) {
|
|
51
|
+
return PADDING + line;
|
|
45
52
|
}
|
|
46
53
|
|
|
47
54
|
// hilight user code
|
|
48
|
-
return
|
|
55
|
+
return MARKER + line;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* utility method: must be invoked by all protocols to remove stack traces
|
|
60
|
+
* from payloads before sending them
|
|
61
|
+
* @param {Error|Object} data - expected: plain error object or serialized
|
|
62
|
+
* request response
|
|
63
|
+
* @returns {*} return the data minus the stack trace
|
|
64
|
+
*/
|
|
65
|
+
function removeStacktrace (data) {
|
|
66
|
+
if (util.types.isNativeError(data)) {
|
|
67
|
+
if (global.NODE_ENV !== 'development') {
|
|
68
|
+
data.stack = undefined;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
data.stack = data.stack.split('\n').map(hilightUserCode).join('\n');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
else if (data && data.content && data.content.error) {
|
|
75
|
+
// @todo v3: stack should be removed only for "production" env
|
|
76
|
+
if (global.NODE_ENV !== 'development') {
|
|
77
|
+
data.content.error.stack = undefined;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
data.content.error.stack = data.content.error.stack
|
|
81
|
+
? data.content.error.stack.split('\n').map(hilightUserCode).join('\n')
|
|
82
|
+
: undefined;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return data;
|
|
49
87
|
}
|
|
50
88
|
|
|
51
89
|
module.exports = {
|
|
52
90
|
hilightUserCode,
|
|
91
|
+
removeStacktrace,
|
|
53
92
|
};
|
package/lib/util/wildcard.js
CHANGED
package/package-lock.json
CHANGED
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.17.
|
|
4
|
+
"version": "2.17.8",
|
|
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": {
|
|
7
7
|
"kuzzle": "bin/start-kuzzle-server"
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
"test:lint:js:fix": "eslint --max-warnings=0 --fix ./lib ./test ./features-legacy ./bin ./features ./doc/build-error-codes.js",
|
|
36
36
|
"doc-error-codes": "node -r ts-node/register doc/build-error-codes",
|
|
37
37
|
"docker:install": "docker-compose run kuzzle_node_1 npm install",
|
|
38
|
-
"docker:test:unit": "docker-compose run kuzzle_node_1 npm run test:unit"
|
|
38
|
+
"docker:test:unit": "docker-compose run kuzzle_node_1 npm run test:unit",
|
|
39
|
+
"docker:npm": "docker-compose run kuzzle_node_1 npm run --"
|
|
39
40
|
},
|
|
40
41
|
"directories": {
|
|
41
42
|
"lib": "lib"
|
|
@@ -62,7 +63,7 @@
|
|
|
62
63
|
"koncorde": "^4.0.2",
|
|
63
64
|
"kuzzle-plugin-auth-passport-local": "^6.3.6",
|
|
64
65
|
"kuzzle-plugin-logger": "^3.0.3",
|
|
65
|
-
"kuzzle-sdk": "7.9.1",
|
|
66
|
+
"kuzzle-sdk": "^7.9.1",
|
|
66
67
|
"kuzzle-vault": "^2.0.4",
|
|
67
68
|
"lodash": "4.17.21",
|
|
68
69
|
"long": "^5.2.0",
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Kuzzle, a backend software, self-hostable and ready to use
|
|
3
|
-
* to power modern apps
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2015-2020 Kuzzle
|
|
6
|
-
* mailto: support AT kuzzle.io
|
|
7
|
-
* website: http://kuzzle.io
|
|
8
|
-
*
|
|
9
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
-
* you may not use this file except in compliance with the License.
|
|
11
|
-
* You may obtain a copy of the License at
|
|
12
|
-
*
|
|
13
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
-
*
|
|
15
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
-
* See the License for the specific language governing permissions and
|
|
19
|
-
* limitations under the License.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
'use strict';
|
|
23
|
-
|
|
24
|
-
const util = require('util');
|
|
25
|
-
|
|
26
|
-
const { hilightUserCode } = require('../../util/stackTrace');
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* utility method: must be invoked by all protocols to remove stack traces
|
|
30
|
-
* from payloads before sending them
|
|
31
|
-
* @param {Error|Object} data - expected: plain error object or serialized
|
|
32
|
-
* request response
|
|
33
|
-
* @returns {*} return the data minus the stack trace
|
|
34
|
-
*/
|
|
35
|
-
module.exports = data => {
|
|
36
|
-
if (util.isError(data)) {
|
|
37
|
-
if (global.NODE_ENV !== 'development') {
|
|
38
|
-
data.stack = undefined;
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
data.stack = data.stack.split('\n').map(hilightUserCode).join('\n');
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
else if (data && data.content && data.content.error) {
|
|
45
|
-
if (global.NODE_ENV !== 'development') {
|
|
46
|
-
data.content.error.stack = undefined;
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
data.content.error.stack = data.content.error.stack
|
|
50
|
-
? data.content.error.stack.split('\n').map(hilightUserCode).join('\n')
|
|
51
|
-
: undefined;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return data;
|
|
56
|
-
};
|