kuzzle 2.17.5 → 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 +5 -4
- 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 +12 -7
- 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 +5 -5
- 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 +10 -9
- 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 +101 -97
- package/package.json +13 -12
- package/lib/core/network/removeErrorStack.js +0 -56
package/bin/start-kuzzle-server
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
|
*
|
|
@@ -154,10 +154,11 @@ class AdminController extends NativeController {
|
|
|
154
154
|
|
|
155
155
|
loadFixtures (request) {
|
|
156
156
|
const fixtures = request.getBody();
|
|
157
|
+
const refresh = request.getRefresh('wait_for');
|
|
157
158
|
|
|
158
|
-
return
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
return global.kuzzle.ask('core:storage:public:document:import', fixtures, {
|
|
160
|
+
refresh
|
|
161
|
+
});
|
|
161
162
|
}
|
|
162
163
|
|
|
163
164
|
loadMappings (request) {
|
|
@@ -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
|
*
|
|
@@ -829,6 +829,7 @@ class DocumentController extends NativeController {
|
|
|
829
829
|
* @returns {Promise.<Object>} { successes, errors }
|
|
830
830
|
*/
|
|
831
831
|
async _mChanges (request, methodName, action) {
|
|
832
|
+
let source = true;
|
|
832
833
|
const userId = request.getKuid();
|
|
833
834
|
const strict = request.getBoolean('strict');
|
|
834
835
|
const silent = request.getBoolean('silent');
|
|
@@ -842,6 +843,10 @@ class DocumentController extends NativeController {
|
|
|
842
843
|
|
|
843
844
|
this.assertNotExceedMaxWrite(documents.length);
|
|
844
845
|
|
|
846
|
+
if (request.input.args.source !== undefined) {
|
|
847
|
+
source = request.input.args.source === 'false' ? false : request.getBoolean('source');
|
|
848
|
+
}
|
|
849
|
+
|
|
845
850
|
if (documents.length === 0) {
|
|
846
851
|
return {
|
|
847
852
|
errors: [],
|
|
@@ -865,7 +870,7 @@ class DocumentController extends NativeController {
|
|
|
865
870
|
index,
|
|
866
871
|
collection,
|
|
867
872
|
documents,
|
|
868
|
-
{ refresh, retryOnConflict, userId });
|
|
873
|
+
{ refresh, retryOnConflict, source, userId });
|
|
869
874
|
|
|
870
875
|
if (strict && response.errors.length) {
|
|
871
876
|
throw kerror.get('api', 'process', 'incomplete_multiple_request', methodName, response.errors);
|
package/lib/api/funnel.js
CHANGED
package/lib/api/httpRoutes.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
|
*
|
|
@@ -35,7 +35,8 @@ const {
|
|
|
35
35
|
OpenApiDocumentCreate,
|
|
36
36
|
OpenApiDocumentCreateOrReplace,
|
|
37
37
|
OpenApiDocumentValidate,
|
|
38
|
-
|
|
38
|
+
OpenApiDocumentmCreateOrReplace,
|
|
39
|
+
} = require('./openapi/components');
|
|
39
40
|
|
|
40
41
|
|
|
41
42
|
const routes = [
|
|
@@ -76,7 +77,7 @@ const routes = [
|
|
|
76
77
|
{ verb: 'get', path: '/:index/:collection/:_id', controller: 'document', action: 'get', openapi: OpenApiDocumentGet },
|
|
77
78
|
{ verb: 'get', path: '/:index/:collection/_mGet', controller: 'document', action: 'mGet' },
|
|
78
79
|
{ verb: 'get', path: '/:index/:collection/:_id/_exists', controller: 'document', action: 'exists', openapi: OpenApiDocumentExists },
|
|
79
|
-
{ verb: '
|
|
80
|
+
{ verb: 'post', path: '/:index/:collection/_mExists', controller: 'document', action: 'mExists' },
|
|
80
81
|
{ verb: 'get', path: '/_scroll/:scrollId', controller: 'document', action: 'scroll', openapi: OpenApiDocumentScroll },
|
|
81
82
|
|
|
82
83
|
{ verb: 'get', path: '/:index/_exists', controller: 'index', action: 'exists' },
|
|
@@ -355,7 +356,7 @@ const routes = [
|
|
|
355
356
|
{ verb: 'put', path: '/:index/:collection/_specifications', controller: 'collection', action: 'updateSpecifications' },
|
|
356
357
|
|
|
357
358
|
{ verb: 'put', path: '/:index/:collection/:_id', controller: 'document', action: 'createOrReplace', openapi: OpenApiDocumentCreateOrReplace },
|
|
358
|
-
{ verb: 'put', path: '/:index/:collection/_mCreateOrReplace', controller: 'document', action: 'mCreateOrReplace' },
|
|
359
|
+
{ verb: 'put', path: '/:index/:collection/_mCreateOrReplace', controller: 'document', action: 'mCreateOrReplace', openapi: OpenApiDocumentmCreateOrReplace },
|
|
359
360
|
{ verb: 'put', path: '/:index/:collection/:_id/_replace', controller: 'document', action: 'replace', openapi: OpenApiDocumentReplace },
|
|
360
361
|
{ verb: 'put', path: '/:index/:collection/_mReplace', controller: 'document', action: 'mReplace' },
|
|
361
362
|
{ verb: 'put', path: '/:index/:collection/_mUpdate', controller: 'document', action: 'mUpdate', deprecated: { since: '2.11.0', message: 'Use "document:mUpdate" route with PATCH instead of PUT' } }, // @deprecated
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Kuzzle, a backend software, self-hostable and ready to use
|
|
4
4
|
* to power modern apps
|
|
5
5
|
*
|
|
6
|
-
* Copyright 2015-
|
|
6
|
+
* Copyright 2015-2022 Kuzzle
|
|
7
7
|
* mailto: support AT kuzzle.io
|
|
8
8
|
* website: http://kuzzle.io
|
|
9
9
|
*
|
|
@@ -79,6 +79,7 @@ class OpenApiManager {
|
|
|
79
79
|
...components_1.OpenApiDocumentCreateOrReplaceComponent,
|
|
80
80
|
...components_1.OpenApiDocumentCreateComponent,
|
|
81
81
|
...components_1.OpenApiDocumentValidateComponent,
|
|
82
|
+
...components_1.OpenApiDocumentmCreateOrReplaceComponent,
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
85
|
};
|
|
@@ -20,3 +20,5 @@ export declare const OpenApiDocumentDeleteByQuery: any;
|
|
|
20
20
|
export declare const OpenApiDocumentDeleteByQueryComponent: any;
|
|
21
21
|
export declare const OpenApiDocumentValidate: any;
|
|
22
22
|
export declare const OpenApiDocumentValidateComponent: any;
|
|
23
|
+
export declare const OpenApiDocumentmCreateOrReplace: any;
|
|
24
|
+
export declare const OpenApiDocumentmCreateOrReplaceComponent: any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OpenApiDocumentValidateComponent = exports.OpenApiDocumentValidate = exports.OpenApiDocumentDeleteByQueryComponent = exports.OpenApiDocumentDeleteByQuery = exports.OpenApiDocumentDeleteComponent = exports.OpenApiDocumentDelete = exports.OpenApiDocumentScrollComponent = exports.OpenApiDocumentScroll = exports.OpenApiDocumentUpdateComponent = exports.OpenApiDocumentUpdate = exports.OpenApiDocumentExistsComponent = exports.OpenApiDocumentExists = exports.OpenApiDocumentReplaceComponent = exports.OpenApiDocumentReplace = exports.OpenApiDocumentGetComponent = exports.OpenApiDocumentGet = exports.OpenApiDocumentCreateOrReplaceComponent = exports.OpenApiDocumentCreateOrReplace = exports.OpenApiDocumentCreateComponent = exports.OpenApiDocumentCreate = exports.OpenApiDocumentCountComponent = exports.OpenApiDocumentCount = void 0;
|
|
3
|
+
exports.OpenApiDocumentmCreateOrReplaceComponent = exports.OpenApiDocumentmCreateOrReplace = exports.OpenApiDocumentValidateComponent = exports.OpenApiDocumentValidate = exports.OpenApiDocumentDeleteByQueryComponent = exports.OpenApiDocumentDeleteByQuery = exports.OpenApiDocumentDeleteComponent = exports.OpenApiDocumentDelete = exports.OpenApiDocumentScrollComponent = exports.OpenApiDocumentScroll = exports.OpenApiDocumentUpdateComponent = exports.OpenApiDocumentUpdate = exports.OpenApiDocumentExistsComponent = exports.OpenApiDocumentExists = exports.OpenApiDocumentReplaceComponent = exports.OpenApiDocumentReplace = exports.OpenApiDocumentGetComponent = exports.OpenApiDocumentGet = exports.OpenApiDocumentCreateOrReplaceComponent = exports.OpenApiDocumentCreateOrReplace = exports.OpenApiDocumentCreateComponent = exports.OpenApiDocumentCreate = exports.OpenApiDocumentCountComponent = exports.OpenApiDocumentCount = void 0;
|
|
4
4
|
const readYamlFile_1 = require("../../../../util/readYamlFile");
|
|
5
5
|
// reading the description of the Count action in the controller document.
|
|
6
6
|
// The yaml objects are then stored in the variables below
|
|
@@ -57,4 +57,9 @@ exports.OpenApiDocumentDeleteByQueryComponent = deleteByQueryObject.components.s
|
|
|
57
57
|
const validateObject = (0, readYamlFile_1.readYamlFile)(__dirname + '/validate.yaml');
|
|
58
58
|
exports.OpenApiDocumentValidate = validateObject.DocumentValidate;
|
|
59
59
|
exports.OpenApiDocumentValidateComponent = validateObject.components.schemas;
|
|
60
|
+
// reading the description of the mCreateOrReplace action in the controller document.
|
|
61
|
+
// The yaml objects are then stored in the variables below
|
|
62
|
+
const mCreateOrReplaceObject = (0, readYamlFile_1.readYamlFile)(__dirname + '/mCreateOrReplace.yaml');
|
|
63
|
+
exports.OpenApiDocumentmCreateOrReplace = mCreateOrReplaceObject.DocumentmCreateOrReplace;
|
|
64
|
+
exports.OpenApiDocumentmCreateOrReplaceComponent = mCreateOrReplaceObject.components.schemas;
|
|
60
65
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
DocumentmCreateOrReplace:
|
|
2
|
+
summary: "Creates or replaces multiple documents."
|
|
3
|
+
tags:
|
|
4
|
+
- document
|
|
5
|
+
parameters:
|
|
6
|
+
- in: path
|
|
7
|
+
name: index
|
|
8
|
+
schema:
|
|
9
|
+
type: string
|
|
10
|
+
required: true
|
|
11
|
+
- in: path
|
|
12
|
+
name: collection
|
|
13
|
+
schema:
|
|
14
|
+
type: string
|
|
15
|
+
required: true
|
|
16
|
+
- in: path
|
|
17
|
+
name: refresh
|
|
18
|
+
schema:
|
|
19
|
+
type: string
|
|
20
|
+
required: false
|
|
21
|
+
- in: path
|
|
22
|
+
name: silent
|
|
23
|
+
schema:
|
|
24
|
+
type: boolean
|
|
25
|
+
required: false
|
|
26
|
+
- in: path
|
|
27
|
+
name: _source
|
|
28
|
+
description: "if set to true, the response will include the document's source (default value true)"
|
|
29
|
+
schema:
|
|
30
|
+
type: boolean
|
|
31
|
+
required: false
|
|
32
|
+
- name: body
|
|
33
|
+
in: "body"
|
|
34
|
+
description: "Creates or replaces multiple documents."
|
|
35
|
+
required: true
|
|
36
|
+
schema:
|
|
37
|
+
$ref: "#/components/document/DocumentmCreateOrReplaceRequest"
|
|
38
|
+
responses:
|
|
39
|
+
200:
|
|
40
|
+
description: "Creates or replaces multiple documents."
|
|
41
|
+
schema:
|
|
42
|
+
$ref: "#/components/document/DocumentmCreateOrReplaceResponse"
|
|
43
|
+
|
|
44
|
+
components:
|
|
45
|
+
schemas:
|
|
46
|
+
DocumentmCreateOrReplaceRequest:
|
|
47
|
+
allOf:
|
|
48
|
+
- type: "object"
|
|
49
|
+
properties:
|
|
50
|
+
documents:
|
|
51
|
+
type: "array"
|
|
52
|
+
items:
|
|
53
|
+
type: "object"
|
|
54
|
+
properties:
|
|
55
|
+
_id:
|
|
56
|
+
type: "string"
|
|
57
|
+
body:
|
|
58
|
+
type: "object"
|
|
59
|
+
description: "document content"
|
|
60
|
+
DocumentmCreateOrReplaceResponse:
|
|
61
|
+
allOf:
|
|
62
|
+
- $ref: "#/components/ResponsePayload"
|
|
63
|
+
- type: "object"
|
|
64
|
+
properties:
|
|
65
|
+
result:
|
|
66
|
+
type: "object"
|
|
67
|
+
properties:
|
|
68
|
+
successes:
|
|
69
|
+
type: "array"
|
|
70
|
+
items:
|
|
71
|
+
type: "object"
|
|
72
|
+
properties:
|
|
73
|
+
_id:
|
|
74
|
+
type: "string"
|
|
75
|
+
_source:
|
|
76
|
+
type: "object"
|
|
77
|
+
description: "document content"
|
|
78
|
+
_version:
|
|
79
|
+
type: "integer"
|
|
80
|
+
created:
|
|
81
|
+
type: "boolean"
|
|
82
|
+
errors:
|
|
83
|
+
type: "array"
|
|
84
|
+
items:
|
|
85
|
+
type: "object"
|
|
86
|
+
properties:
|
|
87
|
+
document:
|
|
88
|
+
type: "object"
|
|
89
|
+
description: "document content"
|
|
90
|
+
status:
|
|
91
|
+
type: "integer"
|
|
92
|
+
reason:
|
|
93
|
+
type: "string"
|
package/lib/api/rateLimiter.js
CHANGED
package/lib/cluster/command.js
CHANGED
package/lib/cluster/index.js
CHANGED
package/lib/cluster/node.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
|
*
|
|
@@ -757,15 +757,15 @@ class ClusterNode {
|
|
|
757
757
|
'admin:afterRefreshIndexCache',
|
|
758
758
|
() => this.onIndexCacheRefreshed());
|
|
759
759
|
|
|
760
|
-
global.kuzzle.
|
|
760
|
+
global.kuzzle.onCall(
|
|
761
761
|
'core:realtime:room:create:after',
|
|
762
762
|
payload => this.onNewRealtimeRoom(payload));
|
|
763
763
|
|
|
764
|
-
global.kuzzle.
|
|
764
|
+
global.kuzzle.onCall(
|
|
765
765
|
'core:realtime:subscribe:after',
|
|
766
766
|
roomId => this.onNewSubscription(roomId));
|
|
767
767
|
|
|
768
|
-
global.kuzzle.
|
|
768
|
+
global.kuzzle.onCall(
|
|
769
769
|
'core:realtime:unsubscribe:after',
|
|
770
770
|
roomId => this.onUnsubscription(roomId));
|
|
771
771
|
|
|
@@ -922,15 +922,15 @@ class ClusterNode {
|
|
|
922
922
|
* @param {string} roomId
|
|
923
923
|
* @return {void}
|
|
924
924
|
*/
|
|
925
|
-
|
|
926
|
-
const messageId =
|
|
927
|
-
|
|
925
|
+
removeRealtimeRoom (roomId) {
|
|
926
|
+
const messageId = this.publisher.sendRemoveRealtimeRoom(roomId);
|
|
927
|
+
|
|
928
928
|
debug(
|
|
929
929
|
'[%s] Broadcasted the removal of room %s (message: %d)',
|
|
930
930
|
this.nodeId,
|
|
931
931
|
roomId,
|
|
932
932
|
messageId);
|
|
933
|
-
|
|
933
|
+
|
|
934
934
|
this.fullState.removeRealtimeRoom(roomId, this.nodeId);
|
|
935
935
|
}
|
|
936
936
|
|
package/lib/cluster/publisher.js
CHANGED
package/lib/cluster/state.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
|
*
|
|
@@ -216,6 +216,9 @@ class ClusterSubscriber {
|
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
try {
|
|
219
|
+
// If we are receiving messages from a node,
|
|
220
|
+
// it means the node is alive so it should counts as an heartbeat
|
|
221
|
+
this.handleHeartbeat();
|
|
219
222
|
await this.handlers[topic].call(this, message);
|
|
220
223
|
}
|
|
221
224
|
catch (e) {
|
package/lib/config/index.js
CHANGED