kuzzle 2.56.0 → 2.57.0-beta.2
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/dist/bin/copy-binaries.js +71 -4
- package/dist/bin/start-kuzzle-server +191 -97
- package/dist/index.d.ts +31 -1
- package/dist/index.js +45 -2
- package/dist/lib/api/controllers/adminController.d.ts +4 -3
- package/dist/lib/api/controllers/adminController.js +1 -2
- package/dist/lib/api/controllers/authController.d.ts +37 -16
- package/dist/lib/api/controllers/authController.js +88 -39
- package/dist/lib/api/controllers/baseController.d.ts +10 -5
- package/dist/lib/api/controllers/baseController.js +36 -15
- package/dist/lib/api/controllers/bulkController.d.ts +11 -7
- package/dist/lib/api/controllers/bulkController.js +28 -5
- package/dist/lib/api/controllers/clusterController.d.ts +2 -2
- package/dist/lib/api/controllers/clusterController.js +3 -3
- package/dist/lib/api/controllers/collectionController.d.ts +57 -21
- package/dist/lib/api/controllers/collectionController.js +40 -11
- package/dist/lib/api/controllers/debugController.d.ts +1 -1
- package/dist/lib/api/controllers/documentController.d.ts +137 -28
- package/dist/lib/api/controllers/documentController.js +156 -125
- package/dist/lib/api/controllers/index.d.ts +27 -12
- package/dist/lib/api/controllers/index.js +28 -13
- package/dist/lib/api/controllers/indexController.d.ts +17 -10
- package/dist/lib/api/controllers/indexController.js +13 -11
- package/dist/lib/api/controllers/memoryStorageController.d.ts +2 -5
- package/dist/lib/api/controllers/memoryStorageController.js +199 -127
- package/dist/lib/api/controllers/realtimeController.d.ts +19 -9
- package/dist/lib/api/controllers/realtimeController.js +8 -4
- package/dist/lib/api/controllers/securityController.d.ts +42 -29
- package/dist/lib/api/controllers/securityController.js +35 -19
- package/dist/lib/api/controllers/serverController.d.ts +114 -19
- package/dist/lib/api/controllers/serverController.js +69 -29
- package/dist/lib/api/documentExtractor.d.ts +9 -7
- package/dist/lib/api/documentExtractor.js +105 -41
- package/dist/lib/api/funnel.d.ts +131 -29
- package/dist/lib/api/funnel.js +436 -225
- package/dist/lib/api/httpRoutes.d.ts +16 -11
- package/dist/lib/api/httpRoutes.js +272 -2
- package/dist/lib/api/openapi/OpenApiManager.d.ts +1 -1
- package/dist/lib/api/openapi/openApiGenerator.d.ts +1 -1
- package/dist/lib/api/rateLimiter.d.ts +15 -5
- package/dist/lib/api/rateLimiter.js +42 -14
- package/dist/lib/api/request/kuzzleRequest.d.ts +83 -12
- package/dist/lib/api/request/kuzzleRequest.js +88 -23
- package/dist/lib/api/request/requestContext.d.ts +20 -5
- package/dist/lib/api/request/requestContext.js +14 -4
- package/dist/lib/api/request/requestInput.d.ts +37 -6
- package/dist/lib/api/request/requestInput.js +22 -9
- package/dist/lib/api/request/requestResponse.d.ts +45 -9
- package/dist/lib/api/request/requestResponse.js +34 -3
- package/dist/lib/cluster/command.d.ts +131 -37
- package/dist/lib/cluster/command.js +243 -71
- package/dist/lib/cluster/idCardHandler.d.ts +18 -5
- package/dist/lib/cluster/idCardHandler.js +52 -19
- package/dist/lib/cluster/index.d.ts +8 -2
- package/dist/lib/cluster/index.js +6 -2
- package/dist/lib/cluster/node.d.ts +127 -49
- package/dist/lib/cluster/node.js +412 -179
- package/dist/lib/cluster/protobuf/command.proto +18 -0
- package/dist/lib/cluster/protobuf/commandMessages.d.ts +104 -0
- package/dist/lib/cluster/protobuf/commandMessages.js +30 -0
- package/dist/lib/cluster/protobuf/syncMessages.d.ts +184 -0
- package/dist/lib/cluster/protobuf/syncMessages.js +23 -0
- package/dist/lib/cluster/publisher.d.ts +118 -78
- package/dist/lib/cluster/publisher.js +174 -72
- package/dist/lib/cluster/state.d.ts +15 -9
- package/dist/lib/cluster/state.js +12 -8
- package/dist/lib/cluster/subscriber.d.ts +185 -131
- package/dist/lib/cluster/subscriber.js +357 -95
- package/dist/lib/cluster/workers/IDCardRenewer.d.ts +39 -8
- package/dist/lib/cluster/workers/IDCardRenewer.js +88 -23
- package/dist/lib/config/default.config.d.ts +2 -2
- package/dist/lib/config/default.config.js +10 -3
- package/dist/lib/config/documentEventAliases.d.ts +1 -1
- package/dist/lib/config/index.d.ts +2 -5
- package/dist/lib/config/index.js +30 -17
- package/dist/lib/core/auth/formatProcessing.d.ts +3 -3
- package/dist/lib/core/auth/passportResponse.d.ts +1 -1
- package/dist/lib/core/auth/passportWrapper.d.ts +1 -1
- package/dist/lib/core/auth/passportWrapper.js +14 -13
- package/dist/lib/core/auth/tokenManager.d.ts +24 -3
- package/dist/lib/core/auth/tokenManager.js +47 -19
- package/dist/lib/core/backend/applicationManager.d.ts +2 -2
- package/dist/lib/core/backend/backend.d.ts +16 -5
- package/dist/lib/core/backend/backend.js +14 -6
- package/dist/lib/core/backend/backendCluster.d.ts +1 -1
- package/dist/lib/core/backend/backendConfig.d.ts +17 -5
- package/dist/lib/core/backend/backendConfig.js +1 -0
- package/dist/lib/core/backend/backendController.d.ts +1 -1
- package/dist/lib/core/backend/backendController.js +8 -1
- package/dist/lib/core/backend/backendErrors.d.ts +15 -8
- package/dist/lib/core/backend/backendErrors.js +5 -0
- package/dist/lib/core/backend/backendHook.d.ts +1 -1
- package/dist/lib/core/backend/backendImport.d.ts +1 -1
- package/dist/lib/core/backend/backendOpenApi.d.ts +3 -2
- package/dist/lib/core/backend/backendPipe.d.ts +1 -1
- package/dist/lib/core/backend/backendPipe.js +9 -1
- package/dist/lib/core/backend/backendPlugin.d.ts +2 -2
- package/dist/lib/core/backend/backendSubscription.d.ts +2 -2
- package/dist/lib/core/backend/backendVault.d.ts +1 -1
- package/dist/lib/core/backend/backendVault.js +8 -1
- package/dist/lib/core/cache/cacheEngine.d.ts +7 -4
- package/dist/lib/core/cache/cacheEngine.js +25 -8
- package/dist/lib/core/debug/kuzzleDebugger.d.ts +2 -1
- package/dist/lib/core/debug/kuzzleDebugger.js +31 -17
- package/dist/lib/core/network/accessLogger.d.ts +33 -18
- package/dist/lib/core/network/accessLogger.js +135 -73
- package/dist/lib/core/network/clientConnection.d.ts +13 -11
- package/dist/lib/core/network/clientConnection.js +33 -9
- package/dist/lib/core/network/context.d.ts +17 -22
- package/dist/lib/core/network/context.js +43 -26
- package/dist/lib/core/network/entryPoint.d.ts +38 -16
- package/dist/lib/core/network/entryPoint.js +119 -48
- package/dist/lib/core/network/httpRouter/index.d.ts +20 -50
- package/dist/lib/core/network/httpRouter/index.js +61 -75
- package/dist/lib/core/network/httpRouter/routeHandler.d.ts +17 -32
- package/dist/lib/core/network/httpRouter/routeHandler.js +26 -36
- package/dist/lib/core/network/httpRouter/routePart.d.ts +9 -18
- package/dist/lib/core/network/httpRouter/routePart.js +61 -43
- package/dist/lib/core/network/httpRouter/routeTypes.d.ts +3 -0
- package/dist/lib/core/network/httpRouter/routeTypes.js +23 -0
- package/dist/lib/core/network/networkEntryPoint.d.ts +20 -0
- package/dist/lib/core/network/networkEntryPoint.js +23 -0
- package/dist/lib/core/network/protocolManifest.d.ts +5 -4
- package/dist/lib/core/network/protocolManifest.js +6 -3
- package/dist/lib/core/network/protocols/httpMessage.d.ts +25 -18
- package/dist/lib/core/network/protocols/httpMessage.js +14 -11
- package/dist/lib/core/network/protocols/httpwsProtocol.d.ts +84 -93
- package/dist/lib/core/network/protocols/httpwsProtocol.js +284 -129
- package/dist/lib/core/network/protocols/internalProtocol.d.ts +26 -15
- package/dist/lib/core/network/protocols/internalProtocol.js +17 -16
- package/dist/lib/core/network/protocols/mqttProtocol.d.ts +56 -32
- package/dist/lib/core/network/protocols/mqttProtocol.js +91 -44
- package/dist/lib/core/network/protocols/protocol.d.ts +85 -21
- package/dist/lib/core/network/protocols/protocol.js +83 -27
- package/dist/lib/core/network/router.d.ts +13 -22
- package/dist/lib/core/network/router.js +59 -46
- package/dist/lib/core/plugin/plugin.d.ts +57 -51
- package/dist/lib/core/plugin/plugin.js +218 -103
- package/dist/lib/core/plugin/pluginContext.d.ts +54 -11
- package/dist/lib/core/plugin/pluginContext.js +99 -58
- package/dist/lib/core/plugin/pluginManifest.d.ts +6 -2
- package/dist/lib/core/plugin/pluginManifest.js +18 -11
- package/dist/lib/core/plugin/pluginRepository.d.ts +35 -44
- package/dist/lib/core/plugin/pluginRepository.js +35 -50
- package/dist/lib/core/plugin/pluginsManager.d.ts +128 -46
- package/dist/lib/core/plugin/pluginsManager.js +468 -231
- package/dist/lib/core/plugin/privilegedContext.d.ts +4 -9
- package/dist/lib/core/plugin/privilegedContext.js +5 -10
- package/dist/lib/core/realtime/actionEnum.d.ts +12 -21
- package/dist/lib/core/realtime/actionEnum.js +6 -7
- package/dist/lib/core/realtime/channel.d.ts +11 -5
- package/dist/lib/core/realtime/channel.js +17 -2
- package/dist/lib/core/realtime/connectionRooms.d.ts +2 -2
- package/dist/lib/core/realtime/hotelClerk.d.ts +12 -6
- package/dist/lib/core/realtime/hotelClerk.js +29 -11
- package/dist/lib/core/realtime/index.d.ts +8 -3
- package/dist/lib/core/realtime/index.js +12 -5
- package/dist/lib/core/realtime/notification/document.d.ts +54 -25
- package/dist/lib/core/realtime/notification/document.js +10 -13
- package/dist/lib/core/realtime/notification/index.d.ts +9 -3
- package/dist/lib/core/realtime/notification/index.js +10 -4
- package/dist/lib/core/realtime/notification/server.d.ts +7 -10
- package/dist/lib/core/realtime/notification/server.js +4 -7
- package/dist/lib/core/realtime/notification/user.d.ts +45 -21
- package/dist/lib/core/realtime/notification/user.js +8 -9
- package/dist/lib/core/realtime/notifier.d.ts +52 -40
- package/dist/lib/core/realtime/notifier.js +60 -25
- package/dist/lib/core/realtime/room.d.ts +1 -1
- package/dist/lib/core/realtime/subscription.d.ts +11 -6
- package/dist/lib/core/realtime/subscription.js +5 -1
- package/dist/lib/core/security/index.d.ts +14 -6
- package/dist/lib/core/security/index.js +27 -13
- package/dist/lib/core/security/profileRepository.d.ts +24 -19
- package/dist/lib/core/security/profileRepository.js +23 -10
- package/dist/lib/core/security/roleRepository.d.ts +60 -23
- package/dist/lib/core/security/roleRepository.js +122 -53
- package/dist/lib/core/security/securityLoader.d.ts +33 -18
- package/dist/lib/core/security/securityLoader.js +43 -16
- package/dist/lib/core/security/tokenRepository.d.ts +21 -7
- package/dist/lib/core/security/tokenRepository.js +50 -23
- package/dist/lib/core/security/userRepository.d.ts +44 -21
- package/dist/lib/core/security/userRepository.js +59 -19
- package/dist/lib/core/shared/KoncordeWrapper.d.ts +1 -1
- package/dist/lib/core/shared/ObjectRepository.d.ts +80 -18
- package/dist/lib/core/shared/ObjectRepository.js +57 -29
- package/dist/lib/core/shared/abstractManifest.d.ts +21 -8
- package/dist/lib/core/shared/abstractManifest.js +57 -17
- package/dist/lib/core/shared/sdk/embeddedSdk.d.ts +3 -1
- package/dist/lib/core/shared/sdk/embeddedSdk.js +8 -7
- package/dist/lib/core/shared/sdk/funnelProtocol.d.ts +2 -1
- package/dist/lib/core/shared/sdk/funnelProtocol.js +12 -3
- package/dist/lib/core/shared/sdk/impersonatedSdk.d.ts +11 -5
- package/dist/lib/core/shared/sdk/impersonatedSdk.js +22 -9
- package/dist/lib/core/shared/store.d.ts +45 -29
- package/dist/lib/core/shared/store.js +48 -27
- package/dist/lib/core/statistics/statistics.d.ts +1 -1
- package/dist/lib/core/storage/clientAdapter.d.ts +39 -21
- package/dist/lib/core/storage/clientAdapter.js +88 -48
- package/dist/lib/core/storage/indexCache.d.ts +8 -0
- package/dist/lib/core/storage/indexCache.js +16 -7
- package/dist/lib/core/storage/storageEngine.d.ts +7 -6
- package/dist/lib/core/storage/storageEngine.js +11 -8
- package/dist/lib/core/validation/baseType.d.ts +22 -22
- package/dist/lib/core/validation/baseType.js +11 -26
- package/dist/lib/core/validation/specification.d.ts +148 -0
- package/dist/lib/core/validation/specification.js +34 -0
- package/dist/lib/core/validation/typeOptions.d.ts +62 -0
- package/dist/lib/core/validation/typeOptions.js +23 -0
- package/dist/lib/core/validation/types/anything.d.ts +3 -6
- package/dist/lib/core/validation/types/anything.js +7 -7
- package/dist/lib/core/validation/types/boolean.d.ts +5 -12
- package/dist/lib/core/validation/types/boolean.js +7 -12
- package/dist/lib/core/validation/types/date.d.ts +19 -11
- package/dist/lib/core/validation/types/date.js +212 -161
- package/dist/lib/core/validation/types/email.d.ts +7 -11
- package/dist/lib/core/validation/types/email.js +13 -17
- package/dist/lib/core/validation/types/enum.d.ts +7 -11
- package/dist/lib/core/validation/types/enum.js +39 -20
- package/dist/lib/core/validation/types/geoPoint.d.ts +5 -13
- package/dist/lib/core/validation/types/geoPoint.js +10 -15
- package/dist/lib/core/validation/types/geoShape.d.ts +22 -21
- package/dist/lib/core/validation/types/geoShape.js +113 -129
- package/dist/lib/core/validation/types/geoShapeUtils.d.ts +15 -0
- package/dist/lib/core/validation/types/geoShapeUtils.js +75 -0
- package/dist/lib/core/validation/types/integer.d.ts +7 -5
- package/dist/lib/core/validation/types/integer.js +7 -13
- package/dist/lib/core/validation/types/ipAddress.d.ts +7 -11
- package/dist/lib/core/validation/types/ipAddress.js +13 -17
- package/dist/lib/core/validation/types/numeric.d.ts +7 -11
- package/dist/lib/core/validation/types/numeric.js +22 -29
- package/dist/lib/core/validation/types/object.d.ts +8 -15
- package/dist/lib/core/validation/types/object.js +12 -21
- package/dist/lib/core/validation/types/string.d.ts +7 -11
- package/dist/lib/core/validation/types/string.js +22 -29
- package/dist/lib/core/validation/types/url.d.ts +7 -11
- package/dist/lib/core/validation/types/url.js +14 -18
- package/dist/lib/core/validation/validation.d.ts +119 -80
- package/dist/lib/core/validation/validation.js +470 -412
- package/dist/lib/core/validation/validationUtils.d.ts +31 -0
- package/dist/lib/core/validation/validationUtils.js +190 -0
- package/dist/lib/kerror/codes/4-plugin.json +0 -12
- package/dist/lib/kerror/codes/index.d.ts +12 -2
- package/dist/lib/kerror/codes/index.js +5 -4
- package/dist/lib/kerror/errors/badRequestError.d.ts +1 -1
- package/dist/lib/kerror/errors/badRequestError.js +1 -1
- package/dist/lib/kerror/errors/externalServiceError.d.ts +1 -1
- package/dist/lib/kerror/errors/externalServiceError.js +1 -1
- package/dist/lib/kerror/errors/forbiddenError.d.ts +1 -1
- package/dist/lib/kerror/errors/forbiddenError.js +1 -1
- package/dist/lib/kerror/errors/gatewayTimeoutError.d.ts +1 -1
- package/dist/lib/kerror/errors/gatewayTimeoutError.js +1 -1
- package/dist/lib/kerror/errors/internalError.d.ts +1 -1
- package/dist/lib/kerror/errors/internalError.js +1 -1
- package/dist/lib/kerror/errors/kuzzleError.d.ts +32 -3
- package/dist/lib/kerror/errors/kuzzleError.js +21 -7
- package/dist/lib/kerror/errors/multipleErrorsError.d.ts +2 -2
- package/dist/lib/kerror/errors/multipleErrorsError.js +2 -2
- package/dist/lib/kerror/errors/notFoundError.d.ts +1 -1
- package/dist/lib/kerror/errors/notFoundError.js +1 -1
- package/dist/lib/kerror/errors/partialError.d.ts +8 -2
- package/dist/lib/kerror/errors/partialError.js +22 -9
- package/dist/lib/kerror/errors/pluginImplementationError.d.ts +9 -1
- package/dist/lib/kerror/errors/pluginImplementationError.js +9 -3
- package/dist/lib/kerror/errors/preconditionError.d.ts +1 -1
- package/dist/lib/kerror/errors/preconditionError.js +1 -1
- package/dist/lib/kerror/errors/serviceUnavailableError.d.ts +1 -1
- package/dist/lib/kerror/errors/serviceUnavailableError.js +1 -1
- package/dist/lib/kerror/errors/sizeLimitError.d.ts +1 -1
- package/dist/lib/kerror/errors/sizeLimitError.js +1 -1
- package/dist/lib/kerror/errors/tooManyRequestsError.d.ts +1 -1
- package/dist/lib/kerror/errors/tooManyRequestsError.js +1 -1
- package/dist/lib/kerror/errors/unauthorizedError.d.ts +1 -1
- package/dist/lib/kerror/errors/unauthorizedError.js +1 -1
- package/dist/lib/kerror/index.d.ts +19 -13
- package/dist/lib/kerror/index.js +60 -19
- package/dist/lib/kuzzle/Logger.d.ts +2 -2
- package/dist/lib/kuzzle/dumpGenerator.d.ts +12 -8
- package/dist/lib/kuzzle/dumpGenerator.js +130 -62
- package/dist/lib/kuzzle/event/KuzzleEventEmitter.d.ts +18 -9
- package/dist/lib/kuzzle/event/KuzzleEventEmitter.js +45 -18
- package/dist/lib/kuzzle/event/pipeRunner.d.ts +37 -16
- package/dist/lib/kuzzle/event/pipeRunner.js +73 -26
- package/dist/lib/kuzzle/event/waterfall.d.ts +11 -1
- package/dist/lib/kuzzle/event/waterfall.js +38 -13
- package/dist/lib/kuzzle/internalIndexHandler.d.ts +11 -174
- package/dist/lib/kuzzle/internalIndexHandler.js +58 -29
- package/dist/lib/kuzzle/kuzzle.d.ts +25 -10
- package/dist/lib/kuzzle/kuzzle.js +74 -17
- package/dist/lib/kuzzle/kuzzleStateEnum.d.ts +16 -12
- package/dist/lib/kuzzle/kuzzleStateEnum.js +5 -7
- package/dist/lib/kuzzle/vault.d.ts +5 -1
- package/dist/lib/kuzzle/vault.js +29 -17
- package/dist/lib/model/security/profile.d.ts +34 -5
- package/dist/lib/model/security/profile.js +6 -5
- package/dist/lib/model/security/rights.d.ts +12 -4
- package/dist/lib/model/security/rights.js +7 -6
- package/dist/lib/model/security/role.d.ts +8 -4
- package/dist/lib/model/security/role.js +12 -6
- package/dist/lib/model/security/token.d.ts +8 -0
- package/dist/lib/model/security/user.d.ts +8 -2
- package/dist/lib/model/security/user.js +7 -4
- package/dist/lib/model/storage/apiKey.d.ts +55 -26
- package/dist/lib/model/storage/apiKey.js +97 -24
- package/dist/lib/model/storage/baseModel.d.ts +77 -66
- package/dist/lib/model/storage/baseModel.js +21 -34
- package/dist/lib/service/cache/redis.d.ts +53 -36
- package/dist/lib/service/cache/redis.js +148 -71
- package/dist/lib/service/service.d.ts +14 -19
- package/dist/lib/service/service.js +41 -22
- package/dist/lib/service/storage/7/elasticsearch.d.ts +136 -93
- package/dist/lib/service/storage/7/elasticsearch.js +218 -165
- package/dist/lib/service/storage/7/esWrapper.d.ts +30 -13
- package/dist/lib/service/storage/7/esWrapper.js +58 -37
- package/dist/lib/service/storage/8/elasticsearch.d.ts +153 -119
- package/dist/lib/service/storage/8/elasticsearch.js +286 -213
- package/dist/lib/service/storage/8/esWrapper.d.ts +30 -13
- package/dist/lib/service/storage/8/esWrapper.js +59 -38
- package/dist/lib/service/storage/commons/queryTranslator.d.ts +3 -3
- package/dist/lib/service/storage/commons/queryTranslator.js +71 -35
- package/dist/lib/types/ApiRoute.d.ts +12 -0
- package/dist/lib/types/ApiRoute.js +23 -0
- package/dist/lib/types/ClientConnection.d.ts +1 -1
- package/dist/lib/types/EventHandler.d.ts +10 -0
- package/dist/lib/types/Global.d.ts +8 -3
- package/dist/lib/types/HttpMessage.d.ts +2 -2
- package/dist/lib/types/HttpStream.d.ts +1 -1
- package/dist/lib/types/HttpStream.js +3 -1
- package/dist/lib/types/JSONObject.d.ts +9 -0
- package/dist/lib/types/JSONObject.js +23 -0
- package/dist/lib/types/Kuzzle.d.ts +5 -3
- package/dist/lib/types/KuzzleDocument.d.ts +1 -1
- package/dist/lib/types/KuzzleWebSocket.d.ts +24 -0
- package/dist/lib/types/KuzzleWebSocket.js +23 -0
- package/dist/lib/types/OpenApiDefinition.d.ts +1 -1
- package/dist/lib/types/Plugin.d.ts +33 -8
- package/dist/lib/types/PluginInstance.d.ts +67 -0
- package/dist/lib/types/PluginInstance.js +23 -0
- package/dist/lib/types/Policy.d.ts +1 -1
- package/dist/lib/types/Target.d.ts +8 -0
- package/dist/lib/types/Token.d.ts +14 -2
- package/dist/lib/types/config/HttpConfiguration.d.ts +5 -0
- package/dist/lib/types/config/KuzzleConfiguration.d.ts +102 -1
- package/dist/lib/types/config/PluginsConfiguration.d.ts +3 -2
- package/dist/lib/types/config/SecurityConfiguration.d.ts +6 -2
- package/dist/lib/types/config/ServerConfiguration.d.ts +2 -2
- package/dist/lib/types/config/ServicesConfiguration.d.ts +1 -1
- package/dist/lib/types/config/cache/BaseCacheRedisConfiguration.d.ts +131 -0
- package/dist/lib/types/config/cache/BaseCacheRedisConfiguration.js +3 -0
- package/dist/lib/types/config/internalCache/InternalCacheRedisConfiguration.d.ts +2 -106
- package/dist/lib/types/config/publicCache/PublicCacheRedisConfiguration.d.ts +2 -26
- package/dist/lib/types/config/storageEngine/StorageEngineElasticsearchConfiguration.d.ts +3 -0
- package/dist/lib/types/controllers/Controller.d.ts +12 -3
- package/dist/lib/types/controllers/ControllerDefinition.d.ts +2 -2
- package/dist/lib/types/controllers/{adminControlller.type.js → adminController.type.js} +1 -1
- package/dist/lib/types/controllers/authController.type.d.ts +2 -2
- package/dist/lib/types/core/auth/formatProcessing.type.d.ts +7 -1
- package/dist/lib/types/errors/ErrorDomains.d.ts +1 -1
- package/dist/lib/types/events/EventGenericDocument.d.ts +10 -9
- package/dist/lib/types/events/EventProtocol.d.ts +4 -4
- package/dist/lib/types/index.d.ts +7 -0
- package/dist/lib/types/index.js +7 -0
- package/dist/lib/types/shared/StoreCollectionsDefinition.d.ts +1 -1
- package/dist/lib/types/storage/7/Elasticsearch.d.ts +62 -13
- package/dist/lib/types/storage/8/Elasticsearch.d.ts +62 -13
- package/dist/lib/util/Inflector.d.ts +4 -1
- package/dist/lib/util/Inflector.js +0 -3
- package/dist/lib/util/assertType.d.ts +24 -27
- package/dist/lib/util/assertType.js +28 -39
- package/dist/lib/util/async.js +19 -6
- package/dist/lib/util/asyncStore.js +1 -1
- package/dist/lib/util/bufferedPassThrough.d.ts +9 -0
- package/dist/lib/util/bufferedPassThrough.js +27 -13
- package/dist/lib/util/bytes.d.ts +1 -1
- package/dist/lib/util/bytes.js +6 -2
- package/dist/lib/util/debug.d.ts +3 -1
- package/dist/lib/util/debug.js +42 -10
- package/dist/lib/util/deprecate.d.ts +9 -1
- package/dist/lib/util/deprecate.js +10 -6
- package/dist/lib/util/didYouMean.d.ts +2 -1
- package/dist/lib/util/didYouMean.js +8 -4
- package/dist/lib/util/distributedLock.d.ts +56 -0
- package/dist/lib/util/distributedLock.js +166 -0
- package/dist/lib/util/dump-collection.d.ts +1 -1
- package/dist/lib/util/dump-collection.js +4 -5
- package/dist/lib/util/extractFields.d.ts +15 -11
- package/dist/lib/util/extractFields.js +8 -9
- package/dist/lib/util/koncordeCompat.d.ts +2 -2
- package/dist/lib/util/koncordeCompat.js +33 -0
- package/dist/lib/util/memoize.d.ts +7 -6
- package/dist/lib/util/memoize.js +3 -3
- package/dist/lib/util/mutex.d.ts +22 -2
- package/dist/lib/util/mutex.js +39 -1
- package/dist/lib/util/name-generator.js +14 -2
- package/dist/lib/util/promback.d.ts +20 -11
- package/dist/lib/util/promback.js +14 -7
- package/dist/lib/util/requestAssertions.d.ts +30 -10
- package/dist/lib/util/requestAssertions.js +125 -121
- package/dist/lib/util/safeObject.d.ts +3 -3
- package/dist/lib/util/safeObject.js +7 -3
- package/dist/lib/util/stackTrace.d.ts +13 -5
- package/dist/lib/util/stackTrace.js +17 -12
- package/dist/lib/util/thrown.d.ts +13 -0
- package/dist/lib/util/thrown.js +46 -0
- package/dist/package.json +26 -19
- package/package.json +26 -19
- package/dist/lib/util/wildcard.d.ts +0 -1
- package/dist/lib/util/wildcard.js +0 -46
- /package/dist/lib/types/controllers/{adminControlller.type.d.ts → adminController.type.d.ts} +0 -0
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import _ from "lodash";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import type { estypes } from "sdk-es8";
|
|
3
|
+
import { Client } from "sdk-es8";
|
|
4
|
+
import type { AliasToTargets, CatAliasRecord, InfoResult, JSONObject, KImportError, KImportResult, KMExecuteResult, KRequestBody, KRequestParams, KStats, KUpdateResponse } from "../../../types/storage/8/Elasticsearch";
|
|
4
5
|
import { storeScopeEnum } from "../../../core/storage/storeScopeEnum";
|
|
6
|
+
import type { ValidatedTarget } from "../../../types/Target";
|
|
5
7
|
import { QueryTranslator } from "../commons/queryTranslator";
|
|
6
8
|
import ESWrapper from "./esWrapper";
|
|
7
9
|
/**
|
|
@@ -11,6 +13,10 @@ import ESWrapper from "./esWrapper";
|
|
|
11
13
|
* @constructor
|
|
12
14
|
*/
|
|
13
15
|
export declare class ES8 {
|
|
16
|
+
/**
|
|
17
|
+
* Built by `init()`, and read nowhere before it — the `null` the constructor
|
|
18
|
+
* used to write was never observed. See TD-62.
|
|
19
|
+
*/
|
|
14
20
|
_client: Client;
|
|
15
21
|
_scope: storeScopeEnum;
|
|
16
22
|
_indexPrefix: string;
|
|
@@ -39,7 +45,7 @@ export declare class ES8 {
|
|
|
39
45
|
* @param {Object} filters - Set of valid Koncorde filters
|
|
40
46
|
* @returns {Object} Equivalent Elasticsearch query
|
|
41
47
|
*/
|
|
42
|
-
translateKoncordeFilters(filters:
|
|
48
|
+
translateKoncordeFilters(filters: JSONObject): any;
|
|
43
49
|
/**
|
|
44
50
|
* Returns some basic information about this service
|
|
45
51
|
* @override
|
|
@@ -68,15 +74,15 @@ export declare class ES8 {
|
|
|
68
74
|
}): Promise<{
|
|
69
75
|
aggregations: any;
|
|
70
76
|
hits: {
|
|
71
|
-
_id:
|
|
72
|
-
_score:
|
|
73
|
-
_source:
|
|
77
|
+
_id: string | undefined;
|
|
78
|
+
_score: number | null | undefined;
|
|
79
|
+
_source: unknown;
|
|
74
80
|
collection: any;
|
|
75
|
-
highlight:
|
|
81
|
+
highlight: Record<string, string[]> | undefined;
|
|
76
82
|
index: any;
|
|
77
|
-
inner_hits:
|
|
83
|
+
inner_hits: JSONObject | undefined;
|
|
78
84
|
}[];
|
|
79
|
-
remaining: number;
|
|
85
|
+
remaining: number | undefined;
|
|
80
86
|
scrollId: any;
|
|
81
87
|
suggest: any;
|
|
82
88
|
total: any;
|
|
@@ -103,38 +109,44 @@ export declare class ES8 {
|
|
|
103
109
|
}): Promise<{
|
|
104
110
|
aggregations: any;
|
|
105
111
|
hits: {
|
|
106
|
-
_id:
|
|
107
|
-
_score:
|
|
108
|
-
_source:
|
|
112
|
+
_id: string | undefined;
|
|
113
|
+
_score: number | null | undefined;
|
|
114
|
+
_source: unknown;
|
|
109
115
|
collection: any;
|
|
110
|
-
highlight:
|
|
116
|
+
highlight: Record<string, string[]> | undefined;
|
|
111
117
|
index: any;
|
|
112
|
-
inner_hits:
|
|
118
|
+
inner_hits: JSONObject | undefined;
|
|
113
119
|
}[];
|
|
114
|
-
remaining: number;
|
|
120
|
+
remaining: number | undefined;
|
|
115
121
|
scrollId: any;
|
|
116
122
|
suggest: any;
|
|
117
123
|
total: any;
|
|
118
124
|
}>;
|
|
125
|
+
/**
|
|
126
|
+
* The comma-separated alias list a multi-target search is run against.
|
|
127
|
+
*
|
|
128
|
+
* @param targets - targets already through `assertTargetsAreValid`
|
|
129
|
+
*/
|
|
130
|
+
_targetsToIndexes(targets: ValidatedTarget[]): string;
|
|
119
131
|
/**
|
|
120
132
|
* Generate a map that associate an alias to a pair of index and collection
|
|
121
133
|
*
|
|
122
134
|
* @param {*} targets
|
|
123
135
|
* @returns
|
|
124
136
|
*/
|
|
125
|
-
_mapTargetsToAlias(targets:
|
|
137
|
+
_mapTargetsToAlias(targets: ValidatedTarget[]): AliasToTargets;
|
|
126
138
|
_formatSearchResult(body: any, remaining?: number, searchInfo?: any): Promise<{
|
|
127
139
|
aggregations: any;
|
|
128
140
|
hits: {
|
|
129
|
-
_id:
|
|
130
|
-
_score:
|
|
131
|
-
_source:
|
|
141
|
+
_id: string | undefined;
|
|
142
|
+
_score: number | null | undefined;
|
|
143
|
+
_source: unknown;
|
|
132
144
|
collection: any;
|
|
133
|
-
highlight:
|
|
145
|
+
highlight: Record<string, string[]> | undefined;
|
|
134
146
|
index: any;
|
|
135
|
-
inner_hits:
|
|
147
|
+
inner_hits: JSONObject | undefined;
|
|
136
148
|
}[];
|
|
137
|
-
remaining: number;
|
|
149
|
+
remaining: number | undefined;
|
|
138
150
|
scrollId: any;
|
|
139
151
|
suggest: any;
|
|
140
152
|
total: any;
|
|
@@ -148,7 +160,7 @@ export declare class ES8 {
|
|
|
148
160
|
*
|
|
149
161
|
* @returns {Promise.<{ _id, _version, _source }>}
|
|
150
162
|
*/
|
|
151
|
-
get(index:
|
|
163
|
+
get(index: string, collection: string, id: string): Promise<any>;
|
|
152
164
|
/**
|
|
153
165
|
* Returns the list of documents matching the ids given in the body param
|
|
154
166
|
* NB: Due to internal Kuzzle mechanism, can only be called on a single
|
|
@@ -161,13 +173,12 @@ export declare class ES8 {
|
|
|
161
173
|
* @returns {Promise.<{ items: Array<{ _id, _source, _version }>, errors }>}
|
|
162
174
|
*/
|
|
163
175
|
mGet(index: string, collection: string, ids: string[]): Promise<{
|
|
164
|
-
errors:
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
item?: undefined;
|
|
176
|
+
errors: string[];
|
|
177
|
+
items: {
|
|
178
|
+
_id: string;
|
|
179
|
+
_source: Record<string, unknown> | undefined;
|
|
180
|
+
_version: number | undefined;
|
|
181
|
+
}[];
|
|
171
182
|
}>;
|
|
172
183
|
/**
|
|
173
184
|
* Counts how many documents match the filter given in body
|
|
@@ -193,7 +204,7 @@ export declare class ES8 {
|
|
|
193
204
|
create(index: string, collection: string, content: JSONObject, { id, refresh, userId, injectKuzzleMeta, }?: {
|
|
194
205
|
id?: string;
|
|
195
206
|
refresh?: boolean | "wait_for";
|
|
196
|
-
userId?: string;
|
|
207
|
+
userId?: string | null;
|
|
197
208
|
injectKuzzleMeta?: boolean;
|
|
198
209
|
}): Promise<{
|
|
199
210
|
_id: string;
|
|
@@ -211,9 +222,9 @@ export declare class ES8 {
|
|
|
211
222
|
*
|
|
212
223
|
* @returns {Promise.<Object>} { _id, _version, _source, created }
|
|
213
224
|
*/
|
|
214
|
-
createOrReplace(index:
|
|
225
|
+
createOrReplace(index: string, collection: string, id: string, content: JSONObject, { refresh, userId, injectKuzzleMeta, }?: {
|
|
215
226
|
refresh?: boolean | "wait_for";
|
|
216
|
-
userId?: string;
|
|
227
|
+
userId?: string | null;
|
|
217
228
|
injectKuzzleMeta?: boolean;
|
|
218
229
|
}): Promise<{
|
|
219
230
|
_id: string;
|
|
@@ -234,7 +245,7 @@ export declare class ES8 {
|
|
|
234
245
|
*/
|
|
235
246
|
update(index: string, collection: string, id: string, content: JSONObject, { refresh, userId, retryOnConflict, injectKuzzleMeta, }?: {
|
|
236
247
|
refresh?: boolean | "wait_for";
|
|
237
|
-
userId?: string;
|
|
248
|
+
userId?: string | null;
|
|
238
249
|
retryOnConflict?: number;
|
|
239
250
|
injectKuzzleMeta?: boolean;
|
|
240
251
|
}): Promise<KUpdateResponse>;
|
|
@@ -253,7 +264,7 @@ export declare class ES8 {
|
|
|
253
264
|
upsert(index: string, collection: string, id: string, content: JSONObject, { defaultValues, refresh, userId, retryOnConflict, injectKuzzleMeta, }?: {
|
|
254
265
|
defaultValues?: JSONObject;
|
|
255
266
|
refresh?: boolean | "wait_for";
|
|
256
|
-
userId?: string;
|
|
267
|
+
userId?: string | null;
|
|
257
268
|
retryOnConflict?: number;
|
|
258
269
|
injectKuzzleMeta?: boolean;
|
|
259
270
|
}): Promise<{
|
|
@@ -275,11 +286,11 @@ export declare class ES8 {
|
|
|
275
286
|
*/
|
|
276
287
|
replace(index: string, collection: string, id: string, content: JSONObject, { refresh, userId, injectKuzzleMeta, }?: {
|
|
277
288
|
refresh?: boolean | "wait_for";
|
|
278
|
-
userId?: string;
|
|
289
|
+
userId?: string | null;
|
|
279
290
|
injectKuzzleMeta?: boolean;
|
|
280
291
|
}): Promise<{
|
|
281
292
|
_id: string;
|
|
282
|
-
_source: KRequestBody<JSONObject
|
|
293
|
+
_source: KRequestBody<JSONObject> | undefined;
|
|
283
294
|
_version: number;
|
|
284
295
|
}>;
|
|
285
296
|
/**
|
|
@@ -294,7 +305,7 @@ export declare class ES8 {
|
|
|
294
305
|
*/
|
|
295
306
|
delete(index: string, collection: string, id: string, { refresh, }?: {
|
|
296
307
|
refresh?: boolean | "wait_for";
|
|
297
|
-
}): Promise<
|
|
308
|
+
}): Promise<null>;
|
|
298
309
|
/**
|
|
299
310
|
* Deletes all documents matching the provided filters.
|
|
300
311
|
* If fetch=false, the max documents write limit is not applied.
|
|
@@ -316,13 +327,13 @@ export declare class ES8 {
|
|
|
316
327
|
size?: number;
|
|
317
328
|
fetch?: boolean;
|
|
318
329
|
}): Promise<{
|
|
319
|
-
deleted: number;
|
|
320
|
-
documents:
|
|
330
|
+
deleted: number | undefined;
|
|
331
|
+
documents: JSONObject[];
|
|
321
332
|
failures: {
|
|
322
333
|
id: string;
|
|
323
|
-
reason: string;
|
|
334
|
+
reason: string | undefined;
|
|
324
335
|
}[];
|
|
325
|
-
total: number;
|
|
336
|
+
total: number | undefined;
|
|
326
337
|
}>;
|
|
327
338
|
/**
|
|
328
339
|
* Delete fields of a document and replace it
|
|
@@ -337,7 +348,7 @@ export declare class ES8 {
|
|
|
337
348
|
*/
|
|
338
349
|
deleteFields(index: string, collection: string, id: string, fields: string, { refresh, userId, }?: {
|
|
339
350
|
refresh?: boolean | "wait_for";
|
|
340
|
-
userId?: string;
|
|
351
|
+
userId?: string | null;
|
|
341
352
|
}): Promise<{
|
|
342
353
|
_id: string;
|
|
343
354
|
_source: JSONObject;
|
|
@@ -357,10 +368,10 @@ export declare class ES8 {
|
|
|
357
368
|
updateByQuery(index: string, collection: string, query: JSONObject, changes: JSONObject, { refresh, size, userId, }?: {
|
|
358
369
|
refresh?: boolean | "wait_for";
|
|
359
370
|
size?: number;
|
|
360
|
-
userId?: string;
|
|
371
|
+
userId?: string | null;
|
|
361
372
|
}): Promise<{
|
|
362
|
-
errors:
|
|
363
|
-
successes:
|
|
373
|
+
errors: JSONObject[];
|
|
374
|
+
successes: JSONObject[];
|
|
364
375
|
}>;
|
|
365
376
|
/**
|
|
366
377
|
* Updates all documents matching the provided filters
|
|
@@ -376,7 +387,7 @@ export declare class ES8 {
|
|
|
376
387
|
bulkUpdateByQuery(index: string, collection: string, query: JSONObject, changes: JSONObject, { refresh, }?: {
|
|
377
388
|
refresh?: boolean;
|
|
378
389
|
}): Promise<{
|
|
379
|
-
updated: number;
|
|
390
|
+
updated: number | undefined;
|
|
380
391
|
}>;
|
|
381
392
|
/**
|
|
382
393
|
* Execute the callback with a batch of documents of specified size until all
|
|
@@ -406,7 +417,7 @@ export declare class ES8 {
|
|
|
406
417
|
*
|
|
407
418
|
* @returns {Promise}
|
|
408
419
|
*/
|
|
409
|
-
createIndex(index: string): Promise<
|
|
420
|
+
createIndex(index: string): Promise<null>;
|
|
410
421
|
/**
|
|
411
422
|
* Creates an empty collection.
|
|
412
423
|
* Mappings and settings will be applied if supplied.
|
|
@@ -420,7 +431,7 @@ export declare class ES8 {
|
|
|
420
431
|
createCollection(index: string, collection: string, { mappings, settings, }?: {
|
|
421
432
|
mappings?: estypes.MappingTypeMapping;
|
|
422
433
|
settings?: Record<string, any>;
|
|
423
|
-
}): Promise<
|
|
434
|
+
}): Promise<null>;
|
|
424
435
|
/**
|
|
425
436
|
* Retrieves settings definition for index/type
|
|
426
437
|
*
|
|
@@ -429,7 +440,7 @@ export declare class ES8 {
|
|
|
429
440
|
*
|
|
430
441
|
* @returns {Promise.<{ settings }>}
|
|
431
442
|
*/
|
|
432
|
-
getSettings(index: string, collection: string): Promise<estypes.IndicesIndexSettings>;
|
|
443
|
+
getSettings(index: string, collection: string): Promise<estypes.IndicesIndexSettings | undefined>;
|
|
433
444
|
/**
|
|
434
445
|
* Retrieves mapping definition for index/type
|
|
435
446
|
*
|
|
@@ -442,9 +453,9 @@ export declare class ES8 {
|
|
|
442
453
|
getMapping(index: string, collection: string, { includeKuzzleMeta, }?: {
|
|
443
454
|
includeKuzzleMeta?: boolean;
|
|
444
455
|
}): Promise<{
|
|
445
|
-
_meta: estypes.Metadata;
|
|
446
|
-
dynamic: estypes.MappingDynamicMapping;
|
|
447
|
-
properties: Record<string, estypes.MappingProperty
|
|
456
|
+
_meta: estypes.Metadata | undefined;
|
|
457
|
+
dynamic: estypes.MappingDynamicMapping | undefined;
|
|
458
|
+
properties: Record<string, estypes.MappingProperty> | undefined;
|
|
448
459
|
}>;
|
|
449
460
|
/**
|
|
450
461
|
* Updates a collection mappings and settings
|
|
@@ -459,14 +470,14 @@ export declare class ES8 {
|
|
|
459
470
|
mappings?: estypes.MappingTypeMapping;
|
|
460
471
|
reindexCollection?: boolean;
|
|
461
472
|
settings?: Record<string, any>;
|
|
462
|
-
}): Promise<
|
|
473
|
+
}): Promise<null>;
|
|
463
474
|
/**
|
|
464
475
|
* Given index settings we return a new version of index settings
|
|
465
476
|
* only with allowed settings that can be set (during update or create index).
|
|
466
477
|
* @param indexSettings the index settings
|
|
467
478
|
* @returns {{index: *}} a new index settings with only allowed settings.
|
|
468
479
|
*/
|
|
469
|
-
getAllowedIndexSettings(indexSettings:
|
|
480
|
+
getAllowedIndexSettings(indexSettings: JSONObject): {
|
|
470
481
|
index: _.Omit<any, "version" | "creation_date" | "provided_name" | "uuid">;
|
|
471
482
|
};
|
|
472
483
|
/**
|
|
@@ -487,9 +498,9 @@ export declare class ES8 {
|
|
|
487
498
|
* @returns {Promise.<{ dynamic, _meta, properties }>}
|
|
488
499
|
*/
|
|
489
500
|
updateMapping(index: string, collection: string, mappings?: estypes.MappingTypeMapping): Promise<{
|
|
490
|
-
dynamic
|
|
491
|
-
_meta
|
|
492
|
-
properties
|
|
501
|
+
dynamic?: string;
|
|
502
|
+
_meta?: JSONObject;
|
|
503
|
+
properties?: JSONObject;
|
|
493
504
|
}>;
|
|
494
505
|
/**
|
|
495
506
|
* Updates a collection settings (eg: analyzers)
|
|
@@ -500,7 +511,7 @@ export declare class ES8 {
|
|
|
500
511
|
*
|
|
501
512
|
* @returns {Promise}
|
|
502
513
|
*/
|
|
503
|
-
updateSettings(index:
|
|
514
|
+
updateSettings(index: string, collection: string, settings?: JSONObject): Promise<null>;
|
|
504
515
|
/**
|
|
505
516
|
* Empties the content of a collection. Keep the existing mapping and settings.
|
|
506
517
|
*
|
|
@@ -509,7 +520,7 @@ export declare class ES8 {
|
|
|
509
520
|
*
|
|
510
521
|
* @returns {Promise}
|
|
511
522
|
*/
|
|
512
|
-
truncateCollection(index: string, collection: string): Promise<
|
|
523
|
+
truncateCollection(index: string, collection: string): Promise<null>;
|
|
513
524
|
/**
|
|
514
525
|
* Runs several action and document
|
|
515
526
|
*
|
|
@@ -523,11 +534,16 @@ export declare class ES8 {
|
|
|
523
534
|
import(index: string, collection: string, documents: JSONObject[], { refresh, timeout, userId, }?: {
|
|
524
535
|
refresh?: boolean | "wait_for";
|
|
525
536
|
timeout?: string;
|
|
526
|
-
userId?: string;
|
|
527
|
-
}): Promise<
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
537
|
+
userId?: string | null;
|
|
538
|
+
}): Promise<KImportResult>;
|
|
539
|
+
/**
|
|
540
|
+
* The error entry `import` reports for one rejected bulk row.
|
|
541
|
+
*
|
|
542
|
+
* @param action - the bulk action Elasticsearch echoed back
|
|
543
|
+
* @param item - that action's answer
|
|
544
|
+
* @param payload - the action's payload, absent for a delete
|
|
545
|
+
*/
|
|
546
|
+
_importError(action: string, item: JSONObject, payload: JSONObject | undefined): KImportError;
|
|
531
547
|
/**
|
|
532
548
|
* Retrieves the complete list of existing collections in the current index
|
|
533
549
|
*
|
|
@@ -537,8 +553,8 @@ export declare class ES8 {
|
|
|
537
553
|
* @returns {Promise.<Array>} Collection names
|
|
538
554
|
*/
|
|
539
555
|
listCollections(index: string, { includeHidden }?: {
|
|
540
|
-
includeHidden?: boolean;
|
|
541
|
-
}): Promise<
|
|
556
|
+
includeHidden?: boolean | undefined;
|
|
557
|
+
}): Promise<string[]>;
|
|
542
558
|
/**
|
|
543
559
|
* Retrieves the complete list of indexes
|
|
544
560
|
*
|
|
@@ -550,13 +566,18 @@ export declare class ES8 {
|
|
|
550
566
|
*
|
|
551
567
|
* @returns {Object.<String, String[]>} Object<index, collections>
|
|
552
568
|
*/
|
|
553
|
-
getSchema(): Promise<
|
|
569
|
+
getSchema(): Promise<Record<string, string[]>>;
|
|
554
570
|
/**
|
|
555
571
|
* Retrieves the complete list of aliases
|
|
556
572
|
*
|
|
557
573
|
* @returns {Promise.<Object[]>} [ { alias, index, collection, indice } ]
|
|
558
574
|
*/
|
|
559
|
-
listAliases(): Promise<
|
|
575
|
+
listAliases(): Promise<{
|
|
576
|
+
alias: string;
|
|
577
|
+
collection: string;
|
|
578
|
+
index: string;
|
|
579
|
+
indice: string;
|
|
580
|
+
}[]>;
|
|
560
581
|
/**
|
|
561
582
|
* Deletes a collection
|
|
562
583
|
*
|
|
@@ -565,7 +586,7 @@ export declare class ES8 {
|
|
|
565
586
|
*
|
|
566
587
|
* @returns {Promise}
|
|
567
588
|
*/
|
|
568
|
-
deleteCollection(index: string, collection: string): Promise<
|
|
589
|
+
deleteCollection(index: string, collection: string): Promise<null>;
|
|
569
590
|
/**
|
|
570
591
|
* Deletes multiple indexes
|
|
571
592
|
*
|
|
@@ -573,7 +594,7 @@ export declare class ES8 {
|
|
|
573
594
|
*
|
|
574
595
|
* @returns {Promise.<String[]>}
|
|
575
596
|
*/
|
|
576
|
-
deleteIndexes(indexes?: string[]): Promise<
|
|
597
|
+
deleteIndexes(indexes?: string[]): Promise<unknown[]>;
|
|
577
598
|
/**
|
|
578
599
|
* Deletes an index
|
|
579
600
|
*
|
|
@@ -581,7 +602,7 @@ export declare class ES8 {
|
|
|
581
602
|
*
|
|
582
603
|
* @returns {Promise}
|
|
583
604
|
*/
|
|
584
|
-
deleteIndex(index: string): Promise<
|
|
605
|
+
deleteIndex(index: string): Promise<null>;
|
|
585
606
|
/**
|
|
586
607
|
* Forces a refresh on the collection.
|
|
587
608
|
*
|
|
@@ -616,13 +637,8 @@ export declare class ES8 {
|
|
|
616
637
|
* @returns {Promise.<{ items: Array<{ _id, _source, _version }>, errors }>}
|
|
617
638
|
*/
|
|
618
639
|
mExists(index: string, collection: string, ids: string[]): Promise<{
|
|
619
|
-
errors:
|
|
620
|
-
|
|
621
|
-
items?: undefined;
|
|
622
|
-
} | {
|
|
623
|
-
errors: any[];
|
|
624
|
-
items: any[];
|
|
625
|
-
item?: undefined;
|
|
640
|
+
errors: string[];
|
|
641
|
+
items: string[];
|
|
626
642
|
}>;
|
|
627
643
|
/**
|
|
628
644
|
* Returns true if the index exists
|
|
@@ -648,7 +664,7 @@ export declare class ES8 {
|
|
|
648
664
|
*
|
|
649
665
|
* @returns {Promise.<boolean>}
|
|
650
666
|
*/
|
|
651
|
-
_hasHiddenCollection(index:
|
|
667
|
+
_hasHiddenCollection(index: string): Promise<boolean>;
|
|
652
668
|
/**
|
|
653
669
|
* Creates multiple documents at once.
|
|
654
670
|
* If a content has no id, one is automatically generated and assigned to it.
|
|
@@ -664,8 +680,8 @@ export declare class ES8 {
|
|
|
664
680
|
mCreate(index: string, collection: string, documents: JSON[], { refresh, timeout, userId, }?: {
|
|
665
681
|
refresh?: boolean | "wait_for";
|
|
666
682
|
timeout?: string;
|
|
667
|
-
userId?: string;
|
|
668
|
-
}): Promise<
|
|
683
|
+
userId?: string | null;
|
|
684
|
+
}): Promise<KMExecuteResult>;
|
|
669
685
|
/**
|
|
670
686
|
* Creates or replaces multiple documents at once.
|
|
671
687
|
*
|
|
@@ -676,7 +692,7 @@ export declare class ES8 {
|
|
|
676
692
|
*
|
|
677
693
|
* @returns {Promise.<{ items, errors }>
|
|
678
694
|
*/
|
|
679
|
-
mCreateOrReplace(index: string, collection: string, documents: JSONObject[], { refresh, timeout, userId, injectKuzzleMeta, limits, source, }?: KRequestParams): Promise<
|
|
695
|
+
mCreateOrReplace(index: string, collection: string, documents: JSONObject[], { refresh, timeout, userId, injectKuzzleMeta, limits, source, }?: KRequestParams): Promise<KMExecuteResult>;
|
|
680
696
|
/**
|
|
681
697
|
* Updates multiple documents with one request
|
|
682
698
|
* Replacements are rejected if targeted documents do not exist
|
|
@@ -690,11 +706,11 @@ export declare class ES8 {
|
|
|
690
706
|
* @returns {Promise.<Object>} { items, errors }
|
|
691
707
|
*/
|
|
692
708
|
mUpdate(index: string, collection: string, documents: JSONObject[], { refresh, retryOnConflict, timeout, userId, }?: {
|
|
693
|
-
refresh?:
|
|
709
|
+
refresh?: boolean | "wait_for";
|
|
694
710
|
retryOnConflict?: number;
|
|
695
|
-
timeout?:
|
|
696
|
-
userId?:
|
|
697
|
-
}): Promise<
|
|
711
|
+
timeout?: string;
|
|
712
|
+
userId?: string | null;
|
|
713
|
+
}): Promise<KMExecuteResult>;
|
|
698
714
|
/**
|
|
699
715
|
* Creates or replaces multiple documents at once.
|
|
700
716
|
*
|
|
@@ -709,8 +725,8 @@ export declare class ES8 {
|
|
|
709
725
|
refresh?: boolean | "wait_for";
|
|
710
726
|
retryOnConflict?: number;
|
|
711
727
|
timeout?: string;
|
|
712
|
-
userId?: string;
|
|
713
|
-
}): Promise<
|
|
728
|
+
userId?: string | null;
|
|
729
|
+
}): Promise<KMExecuteResult>;
|
|
714
730
|
/**
|
|
715
731
|
* Replaces multiple documents at once.
|
|
716
732
|
* Replacements are rejected if targeted documents do not exist
|
|
@@ -726,8 +742,8 @@ export declare class ES8 {
|
|
|
726
742
|
mReplace(index: string, collection: string, documents: JSONObject[], { refresh, timeout, userId, }?: {
|
|
727
743
|
refresh?: boolean | "wait_for";
|
|
728
744
|
timeout?: string;
|
|
729
|
-
userId?: string;
|
|
730
|
-
}): Promise<
|
|
745
|
+
userId?: string | null;
|
|
746
|
+
}): Promise<KMExecuteResult>;
|
|
731
747
|
/**
|
|
732
748
|
* Deletes multiple documents with one request
|
|
733
749
|
*
|
|
@@ -742,8 +758,12 @@ export declare class ES8 {
|
|
|
742
758
|
refresh?: boolean | "wait_for";
|
|
743
759
|
timeout?: number;
|
|
744
760
|
}): Promise<{
|
|
745
|
-
documents:
|
|
746
|
-
errors:
|
|
761
|
+
documents: JSONObject[];
|
|
762
|
+
errors: {
|
|
763
|
+
_id: string;
|
|
764
|
+
reason: string;
|
|
765
|
+
status: number;
|
|
766
|
+
}[];
|
|
747
767
|
}>;
|
|
748
768
|
/**
|
|
749
769
|
* Executes an ES request prepared by mcreate, mupdate, mreplace, mdelete or mwriteDocuments
|
|
@@ -758,9 +778,16 @@ export declare class ES8 {
|
|
|
758
778
|
* @returns {Promise.<Object[]>} results
|
|
759
779
|
*/
|
|
760
780
|
_mExecute(esRequest: estypes.BulkRequest, documents: JSONObject[], partialErrors?: JSONObject[], { limits, source }?: {
|
|
761
|
-
limits?: boolean;
|
|
762
|
-
source?: boolean;
|
|
763
|
-
}): Promise<
|
|
781
|
+
limits?: boolean | undefined;
|
|
782
|
+
source?: boolean | undefined;
|
|
783
|
+
}): Promise<KMExecuteResult>;
|
|
784
|
+
/**
|
|
785
|
+
* The partial-error entry `_mExecute` reports for one rejected bulk row.
|
|
786
|
+
*
|
|
787
|
+
* A 404 answers no reason of its own, and reports the document by id and
|
|
788
|
+
* body rather than whole, which is what the m* callers read back.
|
|
789
|
+
*/
|
|
790
|
+
_mExecuteRejection(result: JSONObject, document: JSONObject): JSONObject;
|
|
764
791
|
/**
|
|
765
792
|
* Extracts, injects metadata and validates documents contained
|
|
766
793
|
* in a Request
|
|
@@ -774,13 +801,13 @@ export declare class ES8 {
|
|
|
774
801
|
* @returns {Object} { rejected, extractedDocuments, documentsToGet }
|
|
775
802
|
*/
|
|
776
803
|
_extractMDocuments(documents: JSONObject[], metadata: JSONObject, { prepareMGet, requireId, prepareMUpsert }?: {
|
|
777
|
-
prepareMGet?: boolean;
|
|
778
|
-
requireId?: boolean;
|
|
779
|
-
prepareMUpsert?: boolean;
|
|
804
|
+
prepareMGet?: boolean | undefined;
|
|
805
|
+
requireId?: boolean | undefined;
|
|
806
|
+
prepareMUpsert?: boolean | undefined;
|
|
780
807
|
}): {
|
|
781
|
-
documentsToGet:
|
|
782
|
-
extractedDocuments:
|
|
783
|
-
rejected:
|
|
808
|
+
documentsToGet: estypes.MgetOperation[];
|
|
809
|
+
extractedDocuments: JSONObject[];
|
|
810
|
+
rejected: JSONObject[];
|
|
784
811
|
};
|
|
785
812
|
private _hasExceededLimit;
|
|
786
813
|
private _processExtract;
|
|
@@ -790,7 +817,7 @@ export declare class ES8 {
|
|
|
790
817
|
* @param {Object} mapping
|
|
791
818
|
* @throws
|
|
792
819
|
*/
|
|
793
|
-
_checkMappings(mapping: JSONObject, path?:
|
|
820
|
+
_checkMappings(mapping: JSONObject, path?: string[], check?: boolean): void;
|
|
794
821
|
/**
|
|
795
822
|
* Given index + collection, returns the associated alias name.
|
|
796
823
|
* Prefer this function to `_getIndice` and `_getAvailableIndice` whenever it is possible.
|
|
@@ -800,11 +827,11 @@ export declare class ES8 {
|
|
|
800
827
|
*
|
|
801
828
|
* @returns {String} Alias name (eg: '@&nepali.liia')
|
|
802
829
|
*/
|
|
803
|
-
_getAlias(index:
|
|
830
|
+
_getAlias(index: string, collection?: string): string;
|
|
804
831
|
/**
|
|
805
832
|
* Given an alias name, returns the associated index name.
|
|
806
833
|
*/
|
|
807
|
-
_checkIfAliasExists(aliasName:
|
|
834
|
+
_checkIfAliasExists(aliasName: string): Promise<boolean>;
|
|
808
835
|
/**
|
|
809
836
|
* Given index + collection, returns the associated indice name.
|
|
810
837
|
* Use this function if ES does not accept aliases in the request. Otherwise use `_getAlias`.
|
|
@@ -842,7 +869,14 @@ export declare class ES8 {
|
|
|
842
869
|
* @returns {String} Alias name (eg: '@&nepali.liia')
|
|
843
870
|
* @throws If there is not exactly one alias associated that is prefixed with @
|
|
844
871
|
*/
|
|
845
|
-
_getAliasFromIndice(indice:
|
|
872
|
+
_getAliasFromIndice(indice: string): Promise<[string, ...string[]]>;
|
|
873
|
+
/**
|
|
874
|
+
* `cat.aliases` declares `alias` and `index` as optional. Defaulting them
|
|
875
|
+
* once here is what lets every caller index into an alias without repeating
|
|
876
|
+
* the check — and an empty alias fails the index-prefix test every caller
|
|
877
|
+
* applies, which is what a row without one used to throw on.
|
|
878
|
+
*/
|
|
879
|
+
_catAliases(name?: string): Promise<CatAliasRecord[]>;
|
|
846
880
|
/**
|
|
847
881
|
* Check for each indice whether it has an alias or not.
|
|
848
882
|
* When the latter is missing, create one based on the indice name.
|
|
@@ -857,7 +891,7 @@ export declare class ES8 {
|
|
|
857
891
|
* @param {String} index
|
|
858
892
|
* @param {String} collection
|
|
859
893
|
*/
|
|
860
|
-
_assertValidIndexAndCollection(index:
|
|
894
|
+
_assertValidIndexAndCollection(index: string, collection?: string | null): void;
|
|
861
895
|
/**
|
|
862
896
|
* Given an alias, extract the associated index.
|
|
863
897
|
*
|
|
@@ -865,7 +899,7 @@ export declare class ES8 {
|
|
|
865
899
|
*
|
|
866
900
|
* @returns {String} Index name
|
|
867
901
|
*/
|
|
868
|
-
_extractIndex(alias:
|
|
902
|
+
_extractIndex(alias: string): string;
|
|
869
903
|
/**
|
|
870
904
|
* Given an alias, extract the associated collection.
|
|
871
905
|
*
|
|
@@ -873,7 +907,7 @@ export declare class ES8 {
|
|
|
873
907
|
*
|
|
874
908
|
* @returns {String} Collection name
|
|
875
909
|
*/
|
|
876
|
-
_extractCollection(alias:
|
|
910
|
+
_extractCollection(alias: string): string;
|
|
877
911
|
/**
|
|
878
912
|
* Given aliases, extract indexes and collections.
|
|
879
913
|
*
|
|
@@ -883,15 +917,15 @@ export declare class ES8 {
|
|
|
883
917
|
* @returns {Object.<String, String[]>} Indexes as key and an array of their collections as value
|
|
884
918
|
*/
|
|
885
919
|
_extractSchema(aliases: string[], { includeHidden }?: {
|
|
886
|
-
includeHidden?: boolean;
|
|
887
|
-
}):
|
|
920
|
+
includeHidden?: boolean | undefined;
|
|
921
|
+
}): Record<string, string[]>;
|
|
888
922
|
/**
|
|
889
923
|
* Creates the hidden collection on the provided index if it does not already
|
|
890
924
|
* exists
|
|
891
925
|
*
|
|
892
926
|
* @param {String} index Index name
|
|
893
927
|
*/
|
|
894
|
-
_createHiddenCollection(index:
|
|
928
|
+
_createHiddenCollection(index: string): Promise<void>;
|
|
895
929
|
/**
|
|
896
930
|
* We need to always wait for a minimal number of shards to be available
|
|
897
931
|
* before answering to the client. This is to avoid Elasticsearch node
|
|
@@ -921,7 +955,7 @@ export declare class ES8 {
|
|
|
921
955
|
*
|
|
922
956
|
* @param {Object} searchBody - ES search body (with query, aggregations, sort, etc)
|
|
923
957
|
*/
|
|
924
|
-
_sanitizeSearchBody(searchBody
|
|
958
|
+
_sanitizeSearchBody(searchBody?: JSONObject): JSONObject;
|
|
925
959
|
/**
|
|
926
960
|
* Throw if a script is used in the query.
|
|
927
961
|
*
|
|
@@ -929,19 +963,19 @@ export declare class ES8 {
|
|
|
929
963
|
*
|
|
930
964
|
* @param {Object} object
|
|
931
965
|
*/
|
|
932
|
-
_scriptCheck(object:
|
|
966
|
+
_scriptCheck(object: JSONObject): void;
|
|
933
967
|
/**
|
|
934
968
|
* Checks if a collection name is valid
|
|
935
969
|
* @param {string} name
|
|
936
970
|
* @returns {Boolean}
|
|
937
971
|
*/
|
|
938
|
-
isCollectionNameValid(name:
|
|
972
|
+
isCollectionNameValid(name: string): boolean;
|
|
939
973
|
/**
|
|
940
974
|
* Checks if a collection name is valid
|
|
941
975
|
* @param {string} name
|
|
942
976
|
* @returns {Boolean}
|
|
943
977
|
*/
|
|
944
|
-
isIndexNameValid(name:
|
|
978
|
+
isIndexNameValid(name: string): boolean;
|
|
945
979
|
/**
|
|
946
980
|
* Clears an allocated scroll
|
|
947
981
|
* @param {[type]} id [description]
|
|
@@ -956,17 +990,17 @@ export declare class ES8 {
|
|
|
956
990
|
*
|
|
957
991
|
* @returns {Number} milliseconds
|
|
958
992
|
*/
|
|
959
|
-
_loadMsConfig(key:
|
|
993
|
+
_loadMsConfig(key: string): number;
|
|
960
994
|
/**
|
|
961
995
|
* Returns true if one of the mappings dynamic property changes value from
|
|
962
996
|
* false to true
|
|
963
997
|
*/
|
|
964
|
-
_dynamicChanges(previousMappings:
|
|
998
|
+
_dynamicChanges(previousMappings: JSONObject, newMappings: JSONObject): boolean;
|
|
965
999
|
waitForElasticsearch(): Promise<void>;
|
|
966
1000
|
/**
|
|
967
1001
|
* Checks if the dynamic properties are correct
|
|
968
1002
|
*/
|
|
969
|
-
_checkDynamicProperty(mappings:
|
|
1003
|
+
_checkDynamicProperty(mappings: JSONObject): void;
|
|
970
1004
|
_setLastActionToKuzzleMeta(esRequest: JSONObject, alias: string, kuzzleMeta: JSONObject): void;
|
|
971
1005
|
_setLastActionToKuzzleMetaUpdate(item: JSONObject, kuzzleMeta: JSONObject): void;
|
|
972
1006
|
_getHitsTotalValue(hits: estypes.SearchHitsMetadata): number;
|