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,111 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* The cache service relies on Redis sample settings for Redis service (see also https://github.com/luin/ioredis)
|
|
4
|
-
*
|
|
5
|
-
* 1. using a single Redis database:
|
|
6
|
-
* * node:
|
|
7
|
-
* * host:
|
|
8
|
-
* The host on which Redis can be reached.
|
|
9
|
-
* Can take an IP address, an URI or a hostname
|
|
10
|
-
* * port:
|
|
11
|
-
* The port on which Redis is running its database:
|
|
12
|
-
* * (optional, deprecated) database:
|
|
13
|
-
* ID of the redis database (default: 0)
|
|
14
|
-
* NOTE: this option is deprecated and will be removed in Kuzzle v3.
|
|
15
|
-
* Use 'options.db' instead. If both options are set, then
|
|
16
|
-
* "options.db" will take precedence.
|
|
17
|
-
* * (optional) options:
|
|
18
|
-
* Redis specific options compatible with IORedis.
|
|
19
|
-
* See Redis client constructor available options:
|
|
20
|
-
* https://github.com/luin/ioredis/blob/master/API.md#new-redisport-host-options
|
|
21
|
-
*
|
|
22
|
-
* 2. using a master/slaves Redis instance with Redis sentinels
|
|
23
|
-
* (cf. http://redis.io/topics/sentinel):
|
|
24
|
-
* * node:
|
|
25
|
-
* * sentinels:
|
|
26
|
-
* array of sentinels instances:
|
|
27
|
-
* * host:
|
|
28
|
-
* Host name/address of the sentinel server
|
|
29
|
-
* Can be an IP address, an URI or a hostname
|
|
30
|
-
* * port:
|
|
31
|
-
* Network port opened by Redis on the sentinel server
|
|
32
|
-
* * name:
|
|
33
|
-
* Group of Redis instances composed of a master and one
|
|
34
|
-
* or more slaves
|
|
35
|
-
* * (optional, deprecated) database:
|
|
36
|
-
* ID of the redis database (default: 0)
|
|
37
|
-
* NOTE: this option is deprecated and will be removed in Kuzzle v3.
|
|
38
|
-
* Use 'options.db' instead. If both options are set, then
|
|
39
|
-
* "options.db" will take precedence.
|
|
40
|
-
* * (optional) options:
|
|
41
|
-
* Redis specific options compatible with IORedis.
|
|
42
|
-
* See Redis client constructor available options:
|
|
43
|
-
* https://github.com/luin/ioredis/blob/master/API.md#redis--eventemitter
|
|
44
|
-
*
|
|
45
|
-
* 3. using a redis cluster (cf. http://redis.io/topics/cluster-spec):
|
|
46
|
-
* * nodes: array of master nodes of the cluster
|
|
47
|
-
* * host:
|
|
48
|
-
* Host name/address of a redis cluster node
|
|
49
|
-
* Can be an IP address, an URI or a hostname
|
|
50
|
-
* * port:
|
|
51
|
-
* Network port opened by the redis cluster node
|
|
52
|
-
* * (optional, deprecated) database:
|
|
53
|
-
* ID of the redis database (default: 0)
|
|
54
|
-
* NOTE: this option is deprecated and will be removed in Kuzzle v3.
|
|
55
|
-
* Use 'options.db' instead. If both options are set, then
|
|
56
|
-
* "options.db" will take precedence.
|
|
57
|
-
* * (optional) options:
|
|
58
|
-
* Redis specific options compatible with IORedis.
|
|
59
|
-
* See Redis client constructor available options:
|
|
60
|
-
* https://github.com/luin/ioredis/blob/master/API.md#new-redisport-host-options
|
|
61
|
-
* * (optional) clusterOptions:
|
|
62
|
-
* Redis Cluster specific options compatible with IORedis.
|
|
63
|
-
* See Redis Cluster client constructor available options:
|
|
64
|
-
* https://github.com/luin/ioredis/blob/master/API.md#new-clusterstartupnodes-options
|
|
65
|
-
* * (optional) overrideDnsLookup:
|
|
66
|
-
* Only available when using a Redis Cluster config.
|
|
67
|
-
* Use with caution: if set to true, it makes Kuzzle skip DNS validation for TLS certificates
|
|
68
|
-
* This is the only way to connect to an AWS Elasticache Cluster with TLS encryption.
|
|
69
|
-
* See: https://github.com/luin/ioredis#special-note-aws-elasticache-clusters-with-tls
|
|
70
|
-
*/
|
|
71
|
-
/**
|
|
72
|
-
* @default 'redis'
|
|
73
|
-
*/
|
|
74
|
-
backend: "redis";
|
|
75
|
-
clusterOptions: {
|
|
76
|
-
/**
|
|
77
|
-
* @default true
|
|
78
|
-
*/
|
|
79
|
-
enableReadyCheck: boolean;
|
|
80
|
-
};
|
|
1
|
+
import type { BaseCacheRedisConfiguration } from "../cache/BaseCacheRedisConfiguration";
|
|
2
|
+
export type InternalCacheConfiguration = BaseCacheRedisConfiguration & {
|
|
81
3
|
/**
|
|
82
4
|
* @default 0
|
|
83
5
|
*/
|
|
84
6
|
database: number;
|
|
85
|
-
node: {
|
|
86
|
-
/**
|
|
87
|
-
* @default "localhost"
|
|
88
|
-
*/
|
|
89
|
-
host: string;
|
|
90
|
-
/**
|
|
91
|
-
* @default 6379
|
|
92
|
-
*/
|
|
93
|
-
port: number;
|
|
94
|
-
};
|
|
95
|
-
/**
|
|
96
|
-
* * (optional) options:
|
|
97
|
-
* Redis specific options compatible with IORedis.
|
|
98
|
-
* See Redis client constructor available options:
|
|
99
|
-
* https://github.com/luin/ioredis/blob/master/API.md#new-redisport-host-options
|
|
100
|
-
*
|
|
101
|
-
*/
|
|
102
|
-
options?: Record<string, unknown>;
|
|
103
|
-
/**
|
|
104
|
-
* Only available when using a Redis Cluster config.
|
|
105
|
-
* Use with caution: if set to true, it makes Kuzzle skip DNS validation for TLS certificates
|
|
106
|
-
* This is the only way to connect to an AWS Elasticache Cluster with TLS encryption.
|
|
107
|
-
* See: https://github.com/luin/ioredis#special-note-aws-elasticache-clusters-with-tls
|
|
108
|
-
* @default false
|
|
109
|
-
*/
|
|
110
|
-
overrideDnsLookup: boolean;
|
|
111
7
|
};
|
|
@@ -1,31 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @default 'redis'
|
|
4
|
-
*/
|
|
5
|
-
backend: "redis";
|
|
6
|
-
clusterOptions: {
|
|
7
|
-
/**
|
|
8
|
-
* @default true
|
|
9
|
-
*/
|
|
10
|
-
enableReadyCheck: boolean;
|
|
11
|
-
};
|
|
1
|
+
import type { BaseCacheRedisConfiguration } from "../cache/BaseCacheRedisConfiguration";
|
|
2
|
+
export type PublicCacheRedisConfiguration = BaseCacheRedisConfiguration & {
|
|
12
3
|
/**
|
|
13
4
|
* @default 5
|
|
14
5
|
*/
|
|
15
6
|
database: number;
|
|
16
|
-
node: {
|
|
17
|
-
/**
|
|
18
|
-
* @default 'localhost'
|
|
19
|
-
*/
|
|
20
|
-
host: string;
|
|
21
|
-
/**
|
|
22
|
-
* @default 6379
|
|
23
|
-
*/
|
|
24
|
-
port: number;
|
|
25
|
-
};
|
|
26
|
-
options?: Record<string, unknown>;
|
|
27
|
-
/**
|
|
28
|
-
* @default false
|
|
29
|
-
*/
|
|
30
|
-
overrideDnsLookup: boolean;
|
|
31
7
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Backend } from "../../core/backend";
|
|
2
|
-
import { ControllerDefinition } from "./ControllerDefinition";
|
|
3
|
-
import { EmbeddedSDK } from "../../core/shared/sdk/embeddedSdk";
|
|
1
|
+
import type { Backend } from "../../core/backend";
|
|
2
|
+
import type { ControllerDefinition } from "./ControllerDefinition";
|
|
3
|
+
import type { EmbeddedSDK } from "../../core/shared/sdk/embeddedSdk";
|
|
4
4
|
/**
|
|
5
5
|
* Base class to declare a controller class
|
|
6
6
|
*/
|
|
@@ -11,6 +11,11 @@ export declare abstract class Controller {
|
|
|
11
11
|
protected app: Backend;
|
|
12
12
|
/**
|
|
13
13
|
* Controller name
|
|
14
|
+
*
|
|
15
|
+
* May be left unset: `app.controller.use()` derives it from the class name
|
|
16
|
+
* when the author has not set one. Declared as always present (`!`)
|
|
17
|
+
* because it is from `use()` on, and because v2.56.0 declared it so — an
|
|
18
|
+
* optional field broke `this.name` read as a `string` under `strict`.
|
|
14
19
|
*/
|
|
15
20
|
name: string;
|
|
16
21
|
/**
|
|
@@ -26,6 +31,10 @@ export declare abstract class Controller {
|
|
|
26
31
|
* }
|
|
27
32
|
* }
|
|
28
33
|
*
|
|
34
|
+
* The documented pattern is to assign it in the subclass constructor, and
|
|
35
|
+
* `app.controller.use()` rejects a controller without one — see
|
|
36
|
+
* Plugin.checkControllerDefinition. Declared as always present (`!`) for
|
|
37
|
+
* that reason, as v2.56.0 declared it.
|
|
29
38
|
*/
|
|
30
39
|
definition: ControllerDefinition;
|
|
31
40
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { User } from "../../model/security/user";
|
|
2
|
-
import { Serialized } from "../core/auth/formatProcessing.type";
|
|
1
|
+
import type { User } from "../../model/security/user";
|
|
2
|
+
import type { Serialized } from "../core/auth/formatProcessing.type";
|
|
3
3
|
export type GetCurrentUserResponse = Serialized<User> & {
|
|
4
4
|
strategies: any;
|
|
5
5
|
};
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What `formatProcessing` can serialize: anything carrying an id. The id is
|
|
3
|
+
* nullable because the security models are — they carry `null` until they have
|
|
4
|
+
* been stored (ADR-0001, TD-62) — and `Serialized` echoes back whichever it
|
|
5
|
+
* has rather than widening it for everyone.
|
|
6
|
+
*/
|
|
1
7
|
export type Serializable = {
|
|
2
|
-
_id: string;
|
|
8
|
+
_id: string | null;
|
|
3
9
|
};
|
|
4
10
|
export type Serialized<T extends Serializable> = {
|
|
5
11
|
_id: T["_id"];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { KDocument,
|
|
2
|
-
import {
|
|
1
|
+
import type { KDocument, KDocumentContent } from "kuzzle-sdk";
|
|
2
|
+
import type { JSONObject } from "../JSONObject";
|
|
3
|
+
import type { KuzzleRequest, PipeEventHandler } from "../../../index";
|
|
3
4
|
/**
|
|
4
5
|
* Events with documents only having the `_id`
|
|
5
6
|
*/
|
|
@@ -15,15 +16,15 @@ export type EventGenericDocumentBeforeGet = EventGenericDocumentPartial<"beforeG
|
|
|
15
16
|
/**
|
|
16
17
|
* Events having entire documents
|
|
17
18
|
*/
|
|
18
|
-
type EventGenericDocument<name extends string,
|
|
19
|
+
type EventGenericDocument<name extends string, TContent> = {
|
|
19
20
|
name: `generic:document:${name}`;
|
|
20
|
-
args: [KDocument<KDocumentContent>[], KuzzleRequest];
|
|
21
|
+
args: [KDocument<TContent & KDocumentContent>[], KuzzleRequest];
|
|
21
22
|
};
|
|
22
|
-
export type EventGenericDocumentBeforeWrite<
|
|
23
|
-
export type EventGenericDocumentAfterWrite<
|
|
24
|
-
export type EventGenericDocumentBeforeUpdate<
|
|
25
|
-
export type EventGenericDocumentAfterUpdate<
|
|
26
|
-
export type EventGenericDocumentAfterGet<
|
|
23
|
+
export type EventGenericDocumentBeforeWrite<TContent = JSONObject> = EventGenericDocument<"beforeWrite", TContent>;
|
|
24
|
+
export type EventGenericDocumentAfterWrite<TContent = JSONObject> = EventGenericDocument<"afterWrite", TContent>;
|
|
25
|
+
export type EventGenericDocumentBeforeUpdate<TContent = JSONObject> = EventGenericDocument<"beforeUpdate", TContent>;
|
|
26
|
+
export type EventGenericDocumentAfterUpdate<TContent = JSONObject> = EventGenericDocument<"afterUpdate", TContent>;
|
|
27
|
+
export type EventGenericDocumentAfterGet<TContent = JSONObject> = EventGenericDocument<"afterGet", TContent>;
|
|
27
28
|
export type EventGenericDocumentInjectMetadata = {
|
|
28
29
|
name: `generic:document:injectMetadata`;
|
|
29
30
|
args: [
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
|
-
import { JSONObject } from "
|
|
4
|
-
import { PipeEventHandler } from "../../../index";
|
|
5
|
-
import { ClientConnection } from "../ClientConnection";
|
|
6
|
-
import { HttpMessage } from "../HttpMessage";
|
|
3
|
+
import type { JSONObject } from "../JSONObject";
|
|
4
|
+
import type { PipeEventHandler } from "../../../index";
|
|
5
|
+
import type { ClientConnection } from "../ClientConnection";
|
|
6
|
+
import type { HttpMessage } from "../HttpMessage";
|
|
7
7
|
export type EventHTTPBeforeParsingPayload = {
|
|
8
8
|
name: `protocol:http:beforeParsingPayload`;
|
|
9
9
|
args: [{
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
export * from "./controllers/Controller";
|
|
2
|
+
export * from "./ApiRoute";
|
|
2
3
|
export * from "./controllers/ControllerDefinition";
|
|
3
4
|
export * from "./controllers/ControllerRights";
|
|
5
|
+
export * from "./ClientConnection";
|
|
4
6
|
export * from "./Deprecation";
|
|
5
7
|
export * from "./EventHandler";
|
|
6
8
|
export * from "./Global";
|
|
9
|
+
export * from "./HttpMessage";
|
|
7
10
|
export * from "./HttpStream";
|
|
11
|
+
export * from "./JSONObject";
|
|
8
12
|
export * from "./KuzzleDocument";
|
|
9
13
|
export * from "./OpenApiDefinition";
|
|
10
14
|
export * from "./PasswordPolicy";
|
|
11
15
|
export * from "./Plugin";
|
|
16
|
+
export * from "./PluginManifest";
|
|
12
17
|
export * from "./Policy";
|
|
13
18
|
export * from "./PolicyRestrictions";
|
|
14
19
|
export * from "./ProfileDefinition";
|
|
15
20
|
export * from "./RoleDefinition";
|
|
21
|
+
export * from "./StrategyDefinition";
|
|
16
22
|
export * from "./Target";
|
|
17
23
|
export * from "./Token";
|
|
18
24
|
export * from "./config/DumpConfiguration";
|
|
@@ -23,6 +29,7 @@ export * from "./config/PluginsConfiguration";
|
|
|
23
29
|
export * from "./config/SecurityConfiguration";
|
|
24
30
|
export * from "./config/ServerConfiguration";
|
|
25
31
|
export * from "./config/ServicesConfiguration";
|
|
32
|
+
export * from "./config/cache/BaseCacheRedisConfiguration";
|
|
26
33
|
export * from "./config/internalCache/InternalCacheRedisConfiguration";
|
|
27
34
|
export * from "./config/publicCache/PublicCacheRedisConfiguration";
|
|
28
35
|
export * from "./config/storageEngine/StorageEngineElasticsearchConfiguration";
|
package/dist/lib/types/index.js
CHANGED
|
@@ -35,20 +35,26 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
35
35
|
};
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
37
|
__exportStar(require("./controllers/Controller"), exports);
|
|
38
|
+
__exportStar(require("./ApiRoute"), exports);
|
|
38
39
|
__exportStar(require("./controllers/ControllerDefinition"), exports);
|
|
39
40
|
__exportStar(require("./controllers/ControllerRights"), exports);
|
|
41
|
+
__exportStar(require("./ClientConnection"), exports);
|
|
40
42
|
__exportStar(require("./Deprecation"), exports);
|
|
41
43
|
__exportStar(require("./EventHandler"), exports);
|
|
42
44
|
__exportStar(require("./Global"), exports);
|
|
45
|
+
__exportStar(require("./HttpMessage"), exports);
|
|
43
46
|
__exportStar(require("./HttpStream"), exports);
|
|
47
|
+
__exportStar(require("./JSONObject"), exports);
|
|
44
48
|
__exportStar(require("./KuzzleDocument"), exports);
|
|
45
49
|
__exportStar(require("./OpenApiDefinition"), exports);
|
|
46
50
|
__exportStar(require("./PasswordPolicy"), exports);
|
|
47
51
|
__exportStar(require("./Plugin"), exports);
|
|
52
|
+
__exportStar(require("./PluginManifest"), exports);
|
|
48
53
|
__exportStar(require("./Policy"), exports);
|
|
49
54
|
__exportStar(require("./PolicyRestrictions"), exports);
|
|
50
55
|
__exportStar(require("./ProfileDefinition"), exports);
|
|
51
56
|
__exportStar(require("./RoleDefinition"), exports);
|
|
57
|
+
__exportStar(require("./StrategyDefinition"), exports);
|
|
52
58
|
__exportStar(require("./Target"), exports);
|
|
53
59
|
__exportStar(require("./Token"), exports);
|
|
54
60
|
__exportStar(require("./config/DumpConfiguration"), exports);
|
|
@@ -59,6 +65,7 @@ __exportStar(require("./config/PluginsConfiguration"), exports);
|
|
|
59
65
|
__exportStar(require("./config/SecurityConfiguration"), exports);
|
|
60
66
|
__exportStar(require("./config/ServerConfiguration"), exports);
|
|
61
67
|
__exportStar(require("./config/ServicesConfiguration"), exports);
|
|
68
|
+
__exportStar(require("./config/cache/BaseCacheRedisConfiguration"), exports);
|
|
62
69
|
__exportStar(require("./config/internalCache/InternalCacheRedisConfiguration"), exports);
|
|
63
70
|
__exportStar(require("./config/publicCache/PublicCacheRedisConfiguration"), exports);
|
|
64
71
|
__exportStar(require("./config/storageEngine/StorageEngineElasticsearchConfiguration"), exports);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ByteSize, ClusterNodesStats } from "sdk-es7/api/types";
|
|
1
|
+
import type { ByteSize, ClusterNodesStats } from "sdk-es7/api/types";
|
|
2
|
+
import type { JSONObject } from "../../JSONObject";
|
|
2
3
|
export type InfoResult = {
|
|
3
4
|
type: string;
|
|
4
5
|
version: string;
|
|
@@ -7,20 +8,31 @@ export type InfoResult = {
|
|
|
7
8
|
spaceUsed?: ByteSize;
|
|
8
9
|
nodes?: ClusterNodesStats;
|
|
9
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* Kuzzle's own metadata, stored alongside every document it writes.
|
|
13
|
+
*
|
|
14
|
+
* `author` and `updater` are kuids, and `getKuid` answers `null` for an
|
|
15
|
+
* anonymous write — so both are nullable, as is `updatedAt` on a document that
|
|
16
|
+
* has only ever been created.
|
|
17
|
+
*/
|
|
18
|
+
export type KuzzleInfo = {
|
|
19
|
+
author: string | null;
|
|
20
|
+
createdAt: number;
|
|
21
|
+
updatedAt: number | null;
|
|
22
|
+
updater: string | null;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* `_kuzzle_info` is `Partial` because a partial update writes only the two
|
|
26
|
+
* fields it owns (`updatedAt`, `updater`) and leaves the creation pair to the
|
|
27
|
+
* document already in the index.
|
|
28
|
+
*/
|
|
10
29
|
export type KRequestBody<T> = T & {
|
|
11
|
-
_kuzzle_info?:
|
|
12
|
-
author: string;
|
|
13
|
-
createdAt: number;
|
|
14
|
-
updatedAt: number | null;
|
|
15
|
-
updater: string | null;
|
|
16
|
-
};
|
|
30
|
+
_kuzzle_info?: Partial<KuzzleInfo>;
|
|
17
31
|
};
|
|
18
|
-
export
|
|
19
|
-
[key: string]: any;
|
|
20
|
-
}
|
|
32
|
+
export type { JSONObject } from "../../JSONObject";
|
|
21
33
|
export type KImportError = {
|
|
22
|
-
_id
|
|
23
|
-
status:
|
|
34
|
+
_id?: string | null;
|
|
35
|
+
status: number;
|
|
24
36
|
_source?: JSONObject;
|
|
25
37
|
error?: {
|
|
26
38
|
reason: string;
|
|
@@ -30,8 +42,45 @@ export type KImportError = {
|
|
|
30
42
|
export type KRequestParams = {
|
|
31
43
|
refresh?: boolean | "wait_for";
|
|
32
44
|
timeout?: string;
|
|
33
|
-
userId?: string;
|
|
45
|
+
userId?: string | null;
|
|
34
46
|
injectKuzzleMeta?: boolean;
|
|
35
47
|
limits?: boolean;
|
|
36
48
|
source?: boolean;
|
|
37
49
|
};
|
|
50
|
+
/**
|
|
51
|
+
* Maps an ES alias to the index/collection pair a multi-target search resolved
|
|
52
|
+
* it from — see `Elasticsearch._mapTargetsToAlias`.
|
|
53
|
+
*/
|
|
54
|
+
export type AliasToTargets = {
|
|
55
|
+
[alias: string]: {
|
|
56
|
+
collection: string;
|
|
57
|
+
index: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* The standardised answer `_mExecute` builds for every m* write: the documents
|
|
62
|
+
* Elasticsearch accepted, and the ones it (or Kuzzle) rejected.
|
|
63
|
+
*/
|
|
64
|
+
export type KMExecuteResult = {
|
|
65
|
+
errors: JSONObject[];
|
|
66
|
+
items: JSONObject[];
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* The answer `import` builds from a bulk response: one entry per action, keyed
|
|
70
|
+
* by the action name Elasticsearch echoed back.
|
|
71
|
+
*/
|
|
72
|
+
export type KImportResult = {
|
|
73
|
+
errors: Array<Record<string, KImportError>>;
|
|
74
|
+
items: Array<Record<string, {
|
|
75
|
+
_id?: string | null;
|
|
76
|
+
status?: number;
|
|
77
|
+
}>>;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* One row of a `cat.aliases` answer, once the two fields Elasticsearch always
|
|
81
|
+
* fills have been narrowed — see `Elasticsearch._catAliases`.
|
|
82
|
+
*/
|
|
83
|
+
export type CatAliasRecord = {
|
|
84
|
+
alias: string;
|
|
85
|
+
index: string;
|
|
86
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { estypes } from "sdk-es8";
|
|
1
|
+
import type { estypes } from "sdk-es8";
|
|
2
|
+
import type { JSONObject } from "../../JSONObject";
|
|
2
3
|
export type InfoResult = {
|
|
3
4
|
type: string;
|
|
4
5
|
version: string;
|
|
@@ -29,20 +30,31 @@ export type KStats = {
|
|
|
29
30
|
indexes: KStatsIndex[];
|
|
30
31
|
size: estypes.ByteSize;
|
|
31
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* Kuzzle's own metadata, stored alongside every document it writes.
|
|
35
|
+
*
|
|
36
|
+
* `author` and `updater` are kuids, and `getKuid` answers `null` for an
|
|
37
|
+
* anonymous write — so both are nullable, as is `updatedAt` on a document that
|
|
38
|
+
* has only ever been created.
|
|
39
|
+
*/
|
|
40
|
+
export type KuzzleInfo = {
|
|
41
|
+
author: string | null;
|
|
42
|
+
createdAt: number;
|
|
43
|
+
updatedAt: number | null;
|
|
44
|
+
updater: string | null;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* `_kuzzle_info` is `Partial` because a partial update writes only the two
|
|
48
|
+
* fields it owns (`updatedAt`, `updater`) and leaves the creation pair to the
|
|
49
|
+
* document already in the index.
|
|
50
|
+
*/
|
|
32
51
|
export type KRequestBody<T> = T & {
|
|
33
|
-
_kuzzle_info?:
|
|
34
|
-
author: string;
|
|
35
|
-
createdAt: number;
|
|
36
|
-
updatedAt: number | null;
|
|
37
|
-
updater: string | null;
|
|
38
|
-
};
|
|
52
|
+
_kuzzle_info?: Partial<KuzzleInfo>;
|
|
39
53
|
};
|
|
40
|
-
export
|
|
41
|
-
[key: string]: any;
|
|
42
|
-
}
|
|
54
|
+
export type { JSONObject } from "../../JSONObject";
|
|
43
55
|
export type KImportError = {
|
|
44
|
-
_id
|
|
45
|
-
status:
|
|
56
|
+
_id?: string | null;
|
|
57
|
+
status: number;
|
|
46
58
|
_source?: JSONObject;
|
|
47
59
|
error?: {
|
|
48
60
|
reason: string;
|
|
@@ -52,8 +64,45 @@ export type KImportError = {
|
|
|
52
64
|
export type KRequestParams = {
|
|
53
65
|
refresh?: boolean | "wait_for";
|
|
54
66
|
timeout?: string;
|
|
55
|
-
userId?: string;
|
|
67
|
+
userId?: string | null;
|
|
56
68
|
injectKuzzleMeta?: boolean;
|
|
57
69
|
limits?: boolean;
|
|
58
70
|
source?: boolean;
|
|
59
71
|
};
|
|
72
|
+
/**
|
|
73
|
+
* Maps an ES alias to the index/collection pair a multi-target search resolved
|
|
74
|
+
* it from — see `Elasticsearch._mapTargetsToAlias`.
|
|
75
|
+
*/
|
|
76
|
+
export type AliasToTargets = {
|
|
77
|
+
[alias: string]: {
|
|
78
|
+
collection: string;
|
|
79
|
+
index: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* One row of a `cat.aliases` answer, once the two fields Elasticsearch always
|
|
84
|
+
* fills have been narrowed — see `Elasticsearch._catAliases`.
|
|
85
|
+
*/
|
|
86
|
+
export type CatAliasRecord = {
|
|
87
|
+
alias: string;
|
|
88
|
+
index: string;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* The standardised answer `_mExecute` builds for every m* write: the documents
|
|
92
|
+
* Elasticsearch accepted, and the ones it (or Kuzzle) rejected.
|
|
93
|
+
*/
|
|
94
|
+
export type KMExecuteResult = {
|
|
95
|
+
errors: JSONObject[];
|
|
96
|
+
items: JSONObject[];
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* The answer `import` builds from a bulk response: one entry per action, keyed
|
|
100
|
+
* by the action name Elasticsearch echoed back.
|
|
101
|
+
*/
|
|
102
|
+
export type KImportResult = {
|
|
103
|
+
errors: Array<Record<string, KImportError>>;
|
|
104
|
+
items: Array<Record<string, {
|
|
105
|
+
_id?: string | null;
|
|
106
|
+
status?: number;
|
|
107
|
+
}>>;
|
|
108
|
+
};
|
|
@@ -20,8 +20,11 @@ export declare class Inflector {
|
|
|
20
20
|
static pascalCase(string: string): string;
|
|
21
21
|
/**
|
|
22
22
|
* Converts a string to camelCase
|
|
23
|
+
*
|
|
24
|
+
* Declared `unknown`, as v2.56.0's `any` accepted anything: lodash
|
|
25
|
+
* stringifies it.
|
|
23
26
|
*/
|
|
24
|
-
static camelCase(string:
|
|
27
|
+
static camelCase(string: unknown): string;
|
|
25
28
|
/**
|
|
26
29
|
* Converts a string to snake_case
|
|
27
30
|
* https://stackoverflow.com/a/52964182
|
|
@@ -1,51 +1,48 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Throws if the provided data is not an
|
|
3
|
-
*
|
|
4
|
-
* Returns a clone of the provided array if valid
|
|
2
|
+
* Throws if the provided data is not an object.
|
|
3
|
+
* Returns the unmodified data if validated
|
|
5
4
|
*
|
|
6
5
|
* @throws
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
9
|
-
* @return {array}
|
|
6
|
+
* @param attr - tested attribute name
|
|
7
|
+
* @param data
|
|
10
8
|
*/
|
|
11
|
-
export function
|
|
9
|
+
export declare function assertObject<T extends object>(attr: string, data: T | null | undefined): T | null;
|
|
10
|
+
export declare function assertObject(attr: string, data: unknown): Record<string, unknown> | null;
|
|
12
11
|
/**
|
|
13
12
|
* Throws if the provided data is not an object or an array.
|
|
14
13
|
* Returns the unmodified data if validated
|
|
15
14
|
*
|
|
16
15
|
* @throws
|
|
17
|
-
* @param
|
|
18
|
-
* @param
|
|
19
|
-
* @return {object|array}
|
|
16
|
+
* @param attr - tested attribute name
|
|
17
|
+
* @param data
|
|
20
18
|
*/
|
|
21
|
-
export function assertArrayOrObject(attr: string, data:
|
|
19
|
+
export declare function assertArrayOrObject(attr: string, data: unknown): object | null;
|
|
22
20
|
/**
|
|
23
|
-
* Throws if the provided data is not an
|
|
24
|
-
*
|
|
21
|
+
* Throws if the provided data is not an array containing exclusively
|
|
22
|
+
* values of the specified "type"
|
|
23
|
+
* Returns a clone of the provided array if valid
|
|
25
24
|
*
|
|
26
25
|
* @throws
|
|
27
|
-
* @param
|
|
28
|
-
* @param
|
|
29
|
-
* @return {number}
|
|
26
|
+
* @param attr - tested attribute name
|
|
27
|
+
* @param data
|
|
30
28
|
*/
|
|
31
|
-
export function
|
|
29
|
+
export declare function assertArray(attr: string, data: unknown, type: "string"): string[];
|
|
30
|
+
export declare function assertArray(attr: string, data: unknown, type: string): unknown[];
|
|
32
31
|
/**
|
|
33
|
-
* Throws if the provided data is not
|
|
32
|
+
* Throws if the provided data is not a string
|
|
34
33
|
* Returns the unmodified data if validated
|
|
35
34
|
*
|
|
36
35
|
* @throws
|
|
37
|
-
* @param
|
|
38
|
-
* @param
|
|
39
|
-
* @return {object}
|
|
36
|
+
* @param attr - tested attribute name
|
|
37
|
+
* @param data
|
|
40
38
|
*/
|
|
41
|
-
export function
|
|
39
|
+
export declare function assertString(attr: string, data: unknown): string | null;
|
|
42
40
|
/**
|
|
43
|
-
* Throws if the provided data is not
|
|
41
|
+
* Throws if the provided data is not an integer
|
|
44
42
|
* Returns the unmodified data if validated
|
|
45
43
|
*
|
|
46
44
|
* @throws
|
|
47
|
-
* @param
|
|
48
|
-
* @param
|
|
49
|
-
* @return {null|string}
|
|
45
|
+
* @param attr - tested attribute name
|
|
46
|
+
* @param data
|
|
50
47
|
*/
|
|
51
|
-
export function
|
|
48
|
+
export declare function assertInteger(attr: string, data: unknown): number;
|