kuzzle 2.59.0 → 2.60.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 +17 -7
- package/dist/bin/start-kuzzle-server +17 -7
- package/dist/index.d.ts +2 -1
- package/dist/index.js +6 -2
- package/dist/lib/api/controllers/adminController.d.ts +9 -3
- package/dist/lib/api/controllers/adminController.js +42 -26
- package/dist/lib/api/controllers/authController.d.ts +15 -5
- package/dist/lib/api/controllers/authController.js +35 -20
- package/dist/lib/api/controllers/baseController.js +17 -7
- package/dist/lib/api/controllers/bulkController.js +17 -7
- package/dist/lib/api/controllers/collectionController.js +17 -7
- package/dist/lib/api/controllers/debugController.js +17 -7
- package/dist/lib/api/controllers/documentController.js +17 -7
- package/dist/lib/api/controllers/indexController.d.ts +1 -1
- package/dist/lib/api/controllers/memoryStorageController.js +17 -7
- package/dist/lib/api/controllers/securityController.d.ts +30 -28
- package/dist/lib/api/controllers/securityController.js +18 -8
- package/dist/lib/api/controllers/serverController.d.ts +0 -1
- package/dist/lib/api/controllers/serverController.js +17 -7
- package/dist/lib/api/documentExtractor.js +17 -7
- package/dist/lib/api/funnel.js +19 -9
- package/dist/lib/api/httpRoutes.d.ts +2 -1
- package/dist/lib/api/openapi/OpenApiManager.d.ts +2 -1
- package/dist/lib/api/openapi/openApiGenerator.js +1 -2
- package/dist/lib/api/request/kuzzleRequest.d.ts +9 -2
- package/dist/lib/api/request/kuzzleRequest.js +21 -7
- package/dist/lib/api/request/requestContext.d.ts +7 -2
- package/dist/lib/api/request/requestContext.js +17 -7
- package/dist/lib/api/request/requestInput.d.ts +1 -1
- package/dist/lib/api/request/requestInput.js +17 -7
- package/dist/lib/api/request/requestResponse.d.ts +2 -2
- package/dist/lib/api/request/requestResponse.js +21 -10
- package/dist/lib/cluster/command.d.ts +0 -2
- package/dist/lib/cluster/command.js +17 -7
- package/dist/lib/cluster/idCardHandler.d.ts +3 -2
- package/dist/lib/cluster/idCardHandler.js +1 -1
- package/dist/lib/cluster/node.js +69 -64
- package/dist/lib/cluster/protobuf/command.proto +23 -22
- package/dist/lib/cluster/protobuf/sync.proto +91 -85
- package/dist/lib/cluster/publisher.js +17 -7
- package/dist/lib/cluster/state.js +17 -7
- package/dist/lib/cluster/subscriber.d.ts +0 -2
- package/dist/lib/cluster/subscriber.js +17 -7
- package/dist/lib/cluster/workers/IDCardRenewer.d.ts +0 -1
- package/dist/lib/config/index.js +20 -14
- package/dist/lib/core/auth/formatProcessing.d.ts +1 -1
- package/dist/lib/core/auth/formatProcessing.js +3 -3
- package/dist/lib/core/auth/passportResponse.d.ts +0 -1
- package/dist/lib/core/auth/passportWrapper.js +22 -8
- package/dist/lib/core/backend/backend.js +17 -7
- package/dist/lib/core/backend/backendConfig.d.ts +1 -1
- package/dist/lib/core/backend/backendConfig.js +17 -7
- package/dist/lib/core/backend/backendController.js +17 -7
- package/dist/lib/core/backend/backendErrors.js +17 -7
- package/dist/lib/core/backend/backendHook.js +17 -7
- package/dist/lib/core/backend/backendImport.js +17 -7
- package/dist/lib/core/backend/backendPipe.d.ts +4 -1
- package/dist/lib/core/backend/backendPipe.js +17 -7
- package/dist/lib/core/backend/backendPlugin.js +17 -7
- package/dist/lib/core/backend/backendStorage.js +8 -8
- package/dist/lib/core/backend/backendSubscription.js +17 -7
- package/dist/lib/core/backend/backendVault.js +17 -7
- package/dist/lib/core/backend/internalLogger.d.ts +7 -7
- package/dist/lib/core/debug/kuzzleDebugger.js +17 -7
- package/dist/lib/core/network/accessLogger.d.ts +0 -1
- package/dist/lib/core/network/accessLogger.js +17 -7
- package/dist/lib/core/network/clientConnection.js +17 -7
- package/dist/lib/core/network/context.d.ts +0 -1
- package/dist/lib/core/network/entryPoint.js +17 -7
- package/dist/lib/core/network/httpRouter/routePart.js +17 -7
- package/dist/lib/core/network/protocols/httpMessage.d.ts +0 -2
- package/dist/lib/core/network/protocols/httpwsProtocol.d.ts +0 -3
- package/dist/lib/core/network/protocols/httpwsProtocol.js +29 -12
- package/dist/lib/core/network/protocols/mqttProtocol.d.ts +1 -2
- package/dist/lib/core/network/protocols/mqttProtocol.js +31 -10
- package/dist/lib/core/network/router.js +17 -7
- package/dist/lib/core/plugin/plugin.js +17 -7
- package/dist/lib/core/plugin/pluginContext.d.ts +20 -9
- package/dist/lib/core/plugin/pluginContext.js +39 -24
- package/dist/lib/core/plugin/pluginsManager.js +17 -7
- package/dist/lib/core/realtime/channel.js +17 -7
- package/dist/lib/core/realtime/hotelClerk.d.ts +3 -2
- package/dist/lib/core/realtime/hotelClerk.js +17 -7
- package/dist/lib/core/realtime/notifier.js +17 -7
- package/dist/lib/core/security/profileRepository.js +17 -7
- package/dist/lib/core/security/roleRepository.js +17 -7
- package/dist/lib/core/security/securityLoader.js +17 -7
- package/dist/lib/core/security/tokenRepository.js +18 -8
- package/dist/lib/core/security/userRepository.js +17 -7
- package/dist/lib/core/shared/ObjectRepository.js +20 -7
- package/dist/lib/core/shared/abstractManifest.js +17 -7
- package/dist/lib/core/shared/sdk/embeddedSdk.js +20 -8
- package/dist/lib/core/shared/sdk/funnelProtocol.js +17 -7
- package/dist/lib/core/shared/store.d.ts +11 -1
- package/dist/lib/core/shared/store.js +26 -30
- package/dist/lib/core/statistics/statistics.d.ts +0 -1
- package/dist/lib/core/statistics/statistics.js +17 -7
- package/dist/lib/core/storage/clientAdapter.d.ts +4 -6
- package/dist/lib/core/storage/clientAdapter.js +24 -18
- package/dist/lib/core/storage/indexCache.js +17 -7
- package/dist/lib/core/validation/specification.js +1 -2
- package/dist/lib/core/validation/types/date.js +17 -7
- package/dist/lib/core/validation/types/enum.js +17 -7
- package/dist/lib/core/validation/types/geoShape.js +17 -7
- package/dist/lib/core/validation/types/geoShapeUtils.js +6 -7
- package/dist/lib/core/validation/validation.js +17 -7
- package/dist/lib/core/validation/validationUtils.js +24 -15
- package/dist/lib/kerror/codes/index.js +20 -10
- package/dist/lib/kerror/errors/kuzzleError.js +18 -8
- package/dist/lib/kerror/index.js +31 -18
- package/dist/lib/kuzzle/Logger.js +4 -3
- package/dist/lib/kuzzle/dumpGenerator.js +17 -7
- package/dist/lib/kuzzle/event/KuzzleEventEmitter.d.ts +3 -3
- package/dist/lib/kuzzle/event/KuzzleEventEmitter.js +17 -7
- package/dist/lib/kuzzle/event/pipeRunner.js +17 -7
- package/dist/lib/kuzzle/internalIndexHandler.js +37 -32
- package/dist/lib/kuzzle/kuzzle.d.ts +13 -8
- package/dist/lib/kuzzle/kuzzle.js +103 -128
- package/dist/lib/model/security/profile.js +17 -7
- package/dist/lib/model/security/role.js +17 -7
- package/dist/lib/model/security/user.js +17 -7
- package/dist/lib/model/storage/apiKey.d.ts +1 -1
- package/dist/lib/model/storage/apiKey.js +17 -7
- package/dist/lib/service/cache/redis.js +40 -9
- package/dist/lib/service/service.js +17 -7
- package/dist/lib/service/storage/7/elasticsearch.d.ts +36 -25
- package/dist/lib/service/storage/7/elasticsearch.js +73 -55
- package/dist/lib/service/storage/8/elasticsearch.d.ts +47 -36
- package/dist/lib/service/storage/8/elasticsearch.js +73 -55
- package/dist/lib/service/storage/Elasticsearch.d.ts +10 -4
- package/dist/lib/types/HttpStream.d.ts +0 -1
- package/dist/lib/types/Plugin.js +17 -7
- package/dist/lib/types/config/SecurityConfiguration.d.ts +0 -2
- package/dist/lib/types/config/storageEngine/StorageEngineElasticsearchConfiguration.d.ts +5 -0
- package/dist/lib/types/controllers/GetCurrentUserResponse.d.ts +5 -0
- package/dist/lib/types/controllers/GetCurrentUserResponse.js +3 -0
- package/dist/lib/types/controllers/ResetSecurityResult.d.ts +5 -0
- package/dist/lib/types/controllers/ResetSecurityResult.js +3 -0
- package/dist/lib/types/controllers/adminController.type.d.ts +7 -5
- package/dist/lib/types/controllers/authController.type.d.ts +7 -5
- package/dist/lib/types/core/auth/Serialized.d.ts +14 -0
- package/dist/lib/types/core/auth/Serialized.js +3 -0
- package/dist/lib/types/core/auth/formatProcessing.type.d.ts +5 -11
- package/dist/lib/types/events/EventProtocol.d.ts +0 -2
- package/dist/lib/types/index.d.ts +1 -0
- package/dist/lib/types/index.js +1 -0
- package/dist/lib/types/storage/8/Elasticsearch.d.ts +4 -3
- package/dist/lib/util/array.d.ts +1 -1
- package/dist/lib/util/array.js +7 -6
- package/dist/lib/util/assertType.js +5 -6
- package/dist/lib/util/async.js +1 -2
- package/dist/lib/util/asyncStore.d.ts +0 -1
- package/dist/lib/util/bufferedPassThrough.d.ts +0 -3
- package/dist/lib/util/crypto.js +1 -2
- package/dist/lib/util/debug.d.ts +0 -1
- package/dist/lib/util/debug.js +17 -7
- package/dist/lib/util/distributedLock.d.ts +27 -4
- package/dist/lib/util/distributedLock.js +69 -16
- package/dist/lib/util/dump-collection.d.ts +2 -2
- package/dist/lib/util/dump-collection.js +22 -13
- package/dist/lib/util/esRequest.js +1 -2
- package/dist/lib/util/extractFields.d.ts +16 -7
- package/dist/lib/util/extractFields.js +1 -10
- package/dist/lib/util/koncordeCompat.js +22 -13
- package/dist/lib/util/mutex.d.ts +4 -4
- package/dist/lib/util/mutex.js +21 -11
- package/dist/lib/util/name-generator.js +2 -2
- package/dist/lib/util/requestAssertions.js +27 -18
- package/dist/lib/util/safeObject.js +3 -4
- package/dist/lib/util/stackTrace.js +2 -3
- package/dist/lib/util/thrown.js +1 -2
- package/dist/lib/util/time.js +1 -2
- package/dist/package.json +22 -15
- package/package.json +22 -15
|
@@ -3,14 +3,16 @@ import { NativeController } from "./baseController";
|
|
|
3
3
|
import type { JSONObject } from "../../types/JSONObject";
|
|
4
4
|
import type { Profile } from "../../model/security/profile";
|
|
5
5
|
import type { User } from "../../model/security/user";
|
|
6
|
+
import type PluginsManager from "../../core/plugin/pluginsManager";
|
|
7
|
+
import type { KuzzleLogger } from "kuzzle-logger";
|
|
6
8
|
/**
|
|
7
9
|
* @class SecurityController
|
|
8
10
|
*/
|
|
9
11
|
declare class SecurityController extends NativeController {
|
|
10
12
|
protected readonly subdomain: string;
|
|
11
13
|
protected readonly securityCollections: string[];
|
|
12
|
-
protected getStrategyMethod:
|
|
13
|
-
protected readonly logger:
|
|
14
|
+
protected getStrategyMethod: PluginsManager["getStrategyMethod"];
|
|
15
|
+
protected readonly logger: KuzzleLogger;
|
|
14
16
|
protected anonymousId: string | null;
|
|
15
17
|
static userOrSdk(userId: string | null): string;
|
|
16
18
|
constructor();
|
|
@@ -96,7 +98,7 @@ declare class SecurityController extends NativeController {
|
|
|
96
98
|
* @param {Request} request
|
|
97
99
|
* @returns {Promise<Object>}
|
|
98
100
|
*/
|
|
99
|
-
getRole(request: KuzzleRequest): Promise<import("../../types/core/auth/
|
|
101
|
+
getRole(request: KuzzleRequest): Promise<import("../../types/core/auth/Serialized").Serialized<import("../../model/security/role").Role>>;
|
|
100
102
|
/**
|
|
101
103
|
* Get specific roles according to given ids
|
|
102
104
|
*
|
|
@@ -126,14 +128,14 @@ declare class SecurityController extends NativeController {
|
|
|
126
128
|
* @param {Request} request
|
|
127
129
|
* @returns {Promise<Object>}
|
|
128
130
|
*/
|
|
129
|
-
createOrReplaceRole(request: KuzzleRequest): Promise<import("../../types/core/auth/
|
|
131
|
+
createOrReplaceRole(request: KuzzleRequest): Promise<import("../../types/core/auth/Serialized").Serialized<import("../../model/security/role").Role>>;
|
|
130
132
|
/**
|
|
131
133
|
* Create a Role
|
|
132
134
|
*
|
|
133
135
|
* @param {Request} request
|
|
134
136
|
* @returns {Promise<Object>}
|
|
135
137
|
*/
|
|
136
|
-
createRole(request: KuzzleRequest): Promise<import("../../types/core/auth/
|
|
138
|
+
createRole(request: KuzzleRequest): Promise<import("../../types/core/auth/Serialized").Serialized<import("../../model/security/role").Role>>;
|
|
137
139
|
/**
|
|
138
140
|
* Remove a role according to the given id
|
|
139
141
|
*
|
|
@@ -149,7 +151,7 @@ declare class SecurityController extends NativeController {
|
|
|
149
151
|
* @param {Request} request
|
|
150
152
|
* @returns {Promise<Object>}
|
|
151
153
|
*/
|
|
152
|
-
getProfile(request: KuzzleRequest): Promise<import("../../types/core/auth/
|
|
154
|
+
getProfile(request: KuzzleRequest): Promise<import("../../types/core/auth/Serialized").Serialized<Profile>>;
|
|
153
155
|
/**
|
|
154
156
|
* Get specific profiles according to given ids
|
|
155
157
|
*
|
|
@@ -165,14 +167,14 @@ declare class SecurityController extends NativeController {
|
|
|
165
167
|
* @param {Request} request
|
|
166
168
|
* @returns {Promise<Object>}
|
|
167
169
|
*/
|
|
168
|
-
createOrReplaceProfile(request: KuzzleRequest): Promise<import("../../types/core/auth/
|
|
170
|
+
createOrReplaceProfile(request: KuzzleRequest): Promise<import("../../types/core/auth/Serialized").Serialized<Profile>>;
|
|
169
171
|
/**
|
|
170
172
|
* Create a Profile
|
|
171
173
|
*
|
|
172
174
|
* @param {Request} request
|
|
173
175
|
* @returns {Promise<Object>}
|
|
174
176
|
*/
|
|
175
|
-
createProfile(request: KuzzleRequest): Promise<import("../../types/core/auth/
|
|
177
|
+
createProfile(request: KuzzleRequest): Promise<import("../../types/core/auth/Serialized").Serialized<Profile>>;
|
|
176
178
|
/**
|
|
177
179
|
* Deletes a profile
|
|
178
180
|
*
|
|
@@ -195,7 +197,7 @@ declare class SecurityController extends NativeController {
|
|
|
195
197
|
* @param {Request} request
|
|
196
198
|
* @returns {Promise<Object>}
|
|
197
199
|
*/
|
|
198
|
-
getUser(request: KuzzleRequest): Promise<import("../../types/core/auth/
|
|
200
|
+
getUser(request: KuzzleRequest): Promise<import("../../types/core/auth/Serialized").Serialized<User>>;
|
|
199
201
|
/**
|
|
200
202
|
* Get specific users according to given ids
|
|
201
203
|
*
|
|
@@ -232,7 +234,7 @@ declare class SecurityController extends NativeController {
|
|
|
232
234
|
* @returns {Promise<Object>}
|
|
233
235
|
*/
|
|
234
236
|
getUserStrategies(request: KuzzleRequest): Promise<{
|
|
235
|
-
strategies:
|
|
237
|
+
strategies: (string | null)[];
|
|
236
238
|
total: number;
|
|
237
239
|
}>;
|
|
238
240
|
/**
|
|
@@ -252,7 +254,7 @@ declare class SecurityController extends NativeController {
|
|
|
252
254
|
* @param {Request} request
|
|
253
255
|
* @returns {Promise<Object>}
|
|
254
256
|
*/
|
|
255
|
-
searchUsersByCredentials(request: KuzzleRequest): Promise<
|
|
257
|
+
searchUsersByCredentials(request: KuzzleRequest): Promise<JSONObject>;
|
|
256
258
|
/**
|
|
257
259
|
* Deletes a user from Kuzzle
|
|
258
260
|
*
|
|
@@ -268,21 +270,21 @@ declare class SecurityController extends NativeController {
|
|
|
268
270
|
* @param {Request} request
|
|
269
271
|
* @returns {Promise<Object>}
|
|
270
272
|
*/
|
|
271
|
-
createUser(request: KuzzleRequest): Promise<import("../../types/core/auth/
|
|
273
|
+
createUser(request: KuzzleRequest): Promise<import("../../types/core/auth/Serialized").Serialized<User>>;
|
|
272
274
|
/**
|
|
273
275
|
* Creates a new User object in Kuzzle's database layer and applies restricted profileIds
|
|
274
276
|
*
|
|
275
277
|
* @param {Request} request
|
|
276
278
|
* @returns {Promise<Object>}
|
|
277
279
|
*/
|
|
278
|
-
createRestrictedUser(request: KuzzleRequest): Promise<import("../../types/core/auth/
|
|
280
|
+
createRestrictedUser(request: KuzzleRequest): Promise<import("../../types/core/auth/Serialized").Serialized<User>>;
|
|
279
281
|
/**
|
|
280
282
|
* Updates an existing User
|
|
281
283
|
*
|
|
282
284
|
* @param {Request} request
|
|
283
285
|
* @returns {Promise<Object>}
|
|
284
286
|
*/
|
|
285
|
-
updateUser(request: KuzzleRequest): Promise<import("../../types/core/auth/
|
|
287
|
+
updateUser(request: KuzzleRequest): Promise<import("../../types/core/auth/Serialized").Serialized<User>>;
|
|
286
288
|
/**
|
|
287
289
|
* Applies a partial update to an existing user.
|
|
288
290
|
* If the user doesn't already exist, a new user is created.
|
|
@@ -290,35 +292,35 @@ declare class SecurityController extends NativeController {
|
|
|
290
292
|
* @param {Request} request
|
|
291
293
|
* @returns {Promise}
|
|
292
294
|
*/
|
|
293
|
-
upsertUser(request: KuzzleRequest): Promise<import("../../types/core/auth/
|
|
295
|
+
upsertUser(request: KuzzleRequest): Promise<import("../../types/core/auth/Serialized").Serialized<User>>;
|
|
294
296
|
/**
|
|
295
297
|
* Replaces an existing User
|
|
296
298
|
*
|
|
297
299
|
* @param {Request} request
|
|
298
300
|
* @returns {Promise<Object>}
|
|
299
301
|
*/
|
|
300
|
-
replaceUser(request: KuzzleRequest): Promise<import("../../types/core/auth/
|
|
302
|
+
replaceUser(request: KuzzleRequest): Promise<import("../../types/core/auth/Serialized").Serialized<User>>;
|
|
301
303
|
/**
|
|
302
304
|
* Updates an existing profile
|
|
303
305
|
*
|
|
304
306
|
* @param {Request} request
|
|
305
307
|
* @returns {Promise<Object>}
|
|
306
308
|
*/
|
|
307
|
-
updateProfile(request: KuzzleRequest): Promise<import("../../types/core/auth/
|
|
309
|
+
updateProfile(request: KuzzleRequest): Promise<import("../../types/core/auth/Serialized").Serialized<Profile>>;
|
|
308
310
|
/**
|
|
309
311
|
* Updates an existing role
|
|
310
312
|
*
|
|
311
313
|
* @param {Request} request
|
|
312
314
|
* @returns {Promise<Object>}
|
|
313
315
|
*/
|
|
314
|
-
updateRole(request: KuzzleRequest): Promise<import("../../types/core/auth/
|
|
316
|
+
updateRole(request: KuzzleRequest): Promise<import("../../types/core/auth/Serialized").Serialized<import("../../model/security/role").Role>>;
|
|
315
317
|
/**
|
|
316
318
|
* Creates the first admin user if it does not already exist
|
|
317
319
|
*
|
|
318
320
|
* @param {Request} request
|
|
319
321
|
* @returns {Promise<Object>}
|
|
320
322
|
*/
|
|
321
|
-
createFirstAdmin(request: KuzzleRequest): Promise<import("../../types/core/auth/
|
|
323
|
+
createFirstAdmin(request: KuzzleRequest): Promise<import("../../types/core/auth/Serialized").Serialized<User>>;
|
|
322
324
|
/**
|
|
323
325
|
* Restricted rights are applied to the `anonymous` and `default` roles
|
|
324
326
|
* (by default, these roles don't have any restriction).
|
|
@@ -366,22 +368,22 @@ declare class SecurityController extends NativeController {
|
|
|
366
368
|
* @param {Request} request
|
|
367
369
|
* @returns {Promise<Object>}
|
|
368
370
|
*/
|
|
369
|
-
createCredentials(request: KuzzleRequest): Promise<
|
|
371
|
+
createCredentials(request: KuzzleRequest): Promise<JSONObject>;
|
|
370
372
|
/**
|
|
371
373
|
* @param {Request} request
|
|
372
374
|
* @returns {Promise<Object>}
|
|
373
375
|
*/
|
|
374
|
-
updateCredentials(request: KuzzleRequest): Promise<
|
|
376
|
+
updateCredentials(request: KuzzleRequest): Promise<JSONObject>;
|
|
375
377
|
/**
|
|
376
378
|
* @param {Request} request
|
|
377
379
|
* @returns {Promise.<Object>}
|
|
378
380
|
*/
|
|
379
|
-
hasCredentials(request: KuzzleRequest): Promise<
|
|
381
|
+
hasCredentials(request: KuzzleRequest): Promise<JSONObject>;
|
|
380
382
|
/**
|
|
381
383
|
* @param {Request} request
|
|
382
384
|
* @returns {Promise.<Object>}
|
|
383
385
|
*/
|
|
384
|
-
validateCredentials(request: KuzzleRequest): Promise<
|
|
386
|
+
validateCredentials(request: KuzzleRequest): Promise<JSONObject>;
|
|
385
387
|
/**
|
|
386
388
|
* @param {Request} request
|
|
387
389
|
* @returns {Promise<Object>}
|
|
@@ -393,12 +395,12 @@ declare class SecurityController extends NativeController {
|
|
|
393
395
|
* @param {Request} request
|
|
394
396
|
* @returns {Promise<Object>}
|
|
395
397
|
*/
|
|
396
|
-
getCredentials(request: KuzzleRequest): Promise<
|
|
398
|
+
getCredentials(request: KuzzleRequest): Promise<JSONObject>;
|
|
397
399
|
/**
|
|
398
400
|
* @param {Request} request
|
|
399
401
|
* @returns {Promise<Object>}
|
|
400
402
|
*/
|
|
401
|
-
getCredentialsById(request: KuzzleRequest): Promise<
|
|
403
|
+
getCredentialsById(request: KuzzleRequest): Promise<JSONObject>;
|
|
402
404
|
/**
|
|
403
405
|
* @param {Request} request
|
|
404
406
|
* @returns {Promise<Object>}
|
|
@@ -424,15 +426,15 @@ declare class SecurityController extends NativeController {
|
|
|
424
426
|
* @returns {Promise}
|
|
425
427
|
* @private
|
|
426
428
|
*/
|
|
427
|
-
_changeUser(request: KuzzleRequest, id: string, content:
|
|
429
|
+
_changeUser(request: KuzzleRequest, id: string, content: JSONObject, userId: string | null, profileIds: string[] | null): Promise<import("../../types/core/auth/Serialized").Serialized<User>>;
|
|
428
430
|
/**
|
|
429
431
|
* @param {Request} request
|
|
430
432
|
* @returns {Promise}
|
|
431
433
|
* @private
|
|
432
434
|
*/
|
|
433
|
-
_persistUser(request: KuzzleRequest, profileIds: string[], content:
|
|
435
|
+
_persistUser(request: KuzzleRequest, profileIds: string[], content: JSONObject, { humanReadableId }?: {
|
|
434
436
|
humanReadableId?: boolean;
|
|
435
|
-
}): Promise<import("../../types/core/auth/
|
|
437
|
+
}): Promise<import("../../types/core/auth/Serialized").Serialized<User>>;
|
|
436
438
|
/**
|
|
437
439
|
* Checks if a search result can exceeds the server configured limit
|
|
438
440
|
* @param {Request} request
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
@@ -1082,7 +1092,7 @@ class SecurityController extends baseController_1.NativeController {
|
|
|
1082
1092
|
throw kerror.get("security", "credentials", "unknown_strategy", strategy);
|
|
1083
1093
|
}
|
|
1084
1094
|
const exists = this.getStrategyMethod(strategy, "exists");
|
|
1085
|
-
alreadyExists = await exists(request, id, strategy);
|
|
1095
|
+
alreadyExists = Boolean(await exists(request, id, strategy));
|
|
1086
1096
|
if (alreadyExists) {
|
|
1087
1097
|
if (generated) {
|
|
1088
1098
|
break; // exit for loop, to regenerate an id
|
|
@@ -35,13 +35,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
35
35
|
}) : function(o, v) {
|
|
36
36
|
o["default"] = v;
|
|
37
37
|
});
|
|
38
|
-
var __importStar = (this && this.__importStar) || function (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
};
|
|
38
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
39
|
+
var ownKeys = function(o) {
|
|
40
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
41
|
+
var ar = [];
|
|
42
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
43
|
+
return ar;
|
|
44
|
+
};
|
|
45
|
+
return ownKeys(o);
|
|
46
|
+
};
|
|
47
|
+
return function (mod) {
|
|
48
|
+
if (mod && mod.__esModule) return mod;
|
|
49
|
+
var result = {};
|
|
50
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
51
|
+
__setModuleDefault(result, mod);
|
|
52
|
+
return result;
|
|
53
|
+
};
|
|
54
|
+
})();
|
|
45
55
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
46
56
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
47
57
|
};
|
|
@@ -35,13 +35,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
35
35
|
}) : function(o, v) {
|
|
36
36
|
o["default"] = v;
|
|
37
37
|
});
|
|
38
|
-
var __importStar = (this && this.__importStar) || function (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
};
|
|
38
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
39
|
+
var ownKeys = function(o) {
|
|
40
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
41
|
+
var ar = [];
|
|
42
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
43
|
+
return ar;
|
|
44
|
+
};
|
|
45
|
+
return ownKeys(o);
|
|
46
|
+
};
|
|
47
|
+
return function (mod) {
|
|
48
|
+
if (mod && mod.__esModule) return mod;
|
|
49
|
+
var result = {};
|
|
50
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
51
|
+
__setModuleDefault(result, mod);
|
|
52
|
+
return result;
|
|
53
|
+
};
|
|
54
|
+
})();
|
|
45
55
|
const kerror = __importStar(require("../kerror"));
|
|
46
56
|
const assertionError = kerror.wrap("api", "assert");
|
|
47
57
|
/**
|
package/dist/lib/api/funnel.js
CHANGED
|
@@ -35,19 +35,29 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
35
35
|
}) : function(o, v) {
|
|
36
36
|
o["default"] = v;
|
|
37
37
|
});
|
|
38
|
-
var __importStar = (this && this.__importStar) || function (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
};
|
|
38
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
39
|
+
var ownKeys = function(o) {
|
|
40
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
41
|
+
var ar = [];
|
|
42
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
43
|
+
return ar;
|
|
44
|
+
};
|
|
45
|
+
return ownKeys(o);
|
|
46
|
+
};
|
|
47
|
+
return function (mod) {
|
|
48
|
+
if (mod && mod.__esModule) return mod;
|
|
49
|
+
var result = {};
|
|
50
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
51
|
+
__setModuleDefault(result, mod);
|
|
52
|
+
return result;
|
|
53
|
+
};
|
|
54
|
+
})();
|
|
45
55
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
46
56
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
47
57
|
};
|
|
48
58
|
const bluebird_1 = __importDefault(require("bluebird"));
|
|
49
59
|
const denque_1 = __importDefault(require("denque"));
|
|
50
|
-
const
|
|
60
|
+
const cookie_1 = require("cookie");
|
|
51
61
|
const get_1 = __importDefault(require("lodash/get"));
|
|
52
62
|
const kuzzleStateEnum_1 = __importDefault(require("../kuzzle/kuzzleStateEnum"));
|
|
53
63
|
const errors_1 = require("../kerror/errors");
|
|
@@ -518,7 +528,7 @@ class Funnel {
|
|
|
518
528
|
}
|
|
519
529
|
let cookie;
|
|
520
530
|
try {
|
|
521
|
-
cookie =
|
|
531
|
+
cookie = (0, cookie_1.parseCookie)(request.input.headers.cookie);
|
|
522
532
|
}
|
|
523
533
|
catch {
|
|
524
534
|
throw kerror.get("security", "cookie", "invalid");
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { JSONObject } from "../types/JSONObject";
|
|
1
2
|
/**
|
|
2
3
|
* A native Kuzzle HTTP route, as exposed through `config.http.routes`.
|
|
3
4
|
*
|
|
@@ -16,7 +17,7 @@ interface KuzzleHttpRoute {
|
|
|
16
17
|
};
|
|
17
18
|
/** Alias of `path`, populated below. */
|
|
18
19
|
url?: string;
|
|
19
|
-
openapi?:
|
|
20
|
+
openapi?: JSONObject;
|
|
20
21
|
}
|
|
21
22
|
declare const routes: KuzzleHttpRoute[];
|
|
22
23
|
export = routes;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { JSONObject } from "../../types/JSONObject";
|
|
1
2
|
import type { OpenApiDefinition } from "../../types/OpenApiDefinition";
|
|
2
3
|
export declare class OpenApiManager {
|
|
3
4
|
kuzzleDefinition: OpenApiDefinition;
|
|
@@ -6,6 +7,6 @@ export declare class OpenApiManager {
|
|
|
6
7
|
* @param applicationDefinition Application OpenApi definition
|
|
7
8
|
* @param pluginsManager PluginsManager instance
|
|
8
9
|
*/
|
|
9
|
-
constructor(applicationDefinition: OpenApiDefinition, kuzzleRoutes:
|
|
10
|
+
constructor(applicationDefinition: OpenApiDefinition, kuzzleRoutes: JSONObject[], pluginsRoutes: JSONObject[]);
|
|
10
11
|
registerAskEvents(): void;
|
|
11
12
|
}
|
|
@@ -23,7 +23,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
23
23
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.generateOpenApi =
|
|
26
|
+
exports.generateOpenApi = generateOpenApi;
|
|
27
27
|
const lodash_1 = __importDefault(require("lodash"));
|
|
28
28
|
const Inflector_1 = require("../../util/Inflector");
|
|
29
29
|
const routeUrlMatch = /:([^/]*)/g;
|
|
@@ -129,5 +129,4 @@ function generateOpenApi(routes, definition) {
|
|
|
129
129
|
}
|
|
130
130
|
return definition;
|
|
131
131
|
}
|
|
132
|
-
exports.generateOpenApi = generateOpenApi;
|
|
133
132
|
//# sourceMappingURL=openApiGenerator.js.map
|
|
@@ -35,7 +35,14 @@ export declare class KuzzleRequest {
|
|
|
35
35
|
[_response]: RequestResponse | null;
|
|
36
36
|
[_deprecations]: Deprecation[] | undefined;
|
|
37
37
|
[_timestamp]: number;
|
|
38
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Both arguments are checked at runtime: `RequestInput` throws on anything
|
|
40
|
+
* but a plain object, and so does this constructor on non-object options.
|
|
41
|
+
* The public signature takes `unknown`, which every call that compiled with
|
|
42
|
+
* v2.56.0's `any` still satisfies; the implementation reads them as the
|
|
43
|
+
* objects those checks make them.
|
|
44
|
+
*/
|
|
45
|
+
constructor(data: unknown, options?: unknown);
|
|
39
46
|
/**
|
|
40
47
|
* Request internal ID
|
|
41
48
|
*/
|
|
@@ -99,7 +106,7 @@ export declare class KuzzleRequest {
|
|
|
99
106
|
* - `headers` (JSONObject): additional response protocol headers (default: null)
|
|
100
107
|
* - `raw` (boolean): instead of a Kuzzle response, forward the result directly (default: false)
|
|
101
108
|
*/
|
|
102
|
-
setResult(result:
|
|
109
|
+
setResult(result: unknown, options?: {
|
|
103
110
|
/**
|
|
104
111
|
* HTTP status code
|
|
105
112
|
*/
|
|
@@ -35,13 +35,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
35
35
|
}) : function(o, v) {
|
|
36
36
|
o["default"] = v;
|
|
37
37
|
});
|
|
38
|
-
var __importStar = (this && this.__importStar) || function (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
};
|
|
38
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
39
|
+
var ownKeys = function(o) {
|
|
40
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
41
|
+
var ar = [];
|
|
42
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
43
|
+
return ar;
|
|
44
|
+
};
|
|
45
|
+
return ownKeys(o);
|
|
46
|
+
};
|
|
47
|
+
return function (mod) {
|
|
48
|
+
if (mod && mod.__esModule) return mod;
|
|
49
|
+
var result = {};
|
|
50
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
51
|
+
__setModuleDefault(result, mod);
|
|
52
|
+
return result;
|
|
53
|
+
};
|
|
54
|
+
})();
|
|
45
55
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
46
56
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
47
57
|
};
|
|
@@ -192,6 +202,7 @@ class KuzzleRequest {
|
|
|
192
202
|
/**
|
|
193
203
|
* Request result
|
|
194
204
|
*/
|
|
205
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- kept for v2 compatibility, see docs/v3-breaking-changes.md
|
|
195
206
|
get result() {
|
|
196
207
|
return this[_result];
|
|
197
208
|
}
|
|
@@ -576,6 +587,7 @@ class KuzzleRequest {
|
|
|
576
587
|
* value provided
|
|
577
588
|
* @throws {api.assert.invalid_type} If the fetched parameter is not an array
|
|
578
589
|
*/
|
|
590
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- kept for v2 compatibility, see docs/v3-breaking-changes.md
|
|
579
591
|
getArray(name, def = undefined) {
|
|
580
592
|
return this._getArray(this.input.args, name, name, def, true);
|
|
581
593
|
}
|
|
@@ -628,6 +640,7 @@ class KuzzleRequest {
|
|
|
628
640
|
* behaviour, named after what it does. Kept because `KuzzleRequest` is part
|
|
629
641
|
* of the public plugin API.
|
|
630
642
|
*/
|
|
643
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- kept for v2 compatibility, see docs/v3-breaking-changes.md
|
|
631
644
|
getArrayLegacy(name, def = undefined) {
|
|
632
645
|
return this.getArrayOrCsv(name, def);
|
|
633
646
|
}
|
|
@@ -819,6 +832,7 @@ class KuzzleRequest {
|
|
|
819
832
|
throw error;
|
|
820
833
|
}
|
|
821
834
|
}
|
|
835
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- kept for v2 compatibility, see docs/v3-breaking-changes.md
|
|
822
836
|
getArrayFromBodyOrArgs(name, def) {
|
|
823
837
|
if (this.context.connection.protocol !== "http" ||
|
|
824
838
|
this.context.connection.misc.verb !== "GET") {
|
|
@@ -36,7 +36,7 @@ export declare class Connection {
|
|
|
36
36
|
[_c_protocol]: string | null;
|
|
37
37
|
[_c_ips]: string[];
|
|
38
38
|
[_c_misc]: ContextMisc;
|
|
39
|
-
constructor(connection:
|
|
39
|
+
constructor(connection: unknown);
|
|
40
40
|
/**
|
|
41
41
|
* Unique identifier of the user connection
|
|
42
42
|
*/
|
|
@@ -71,7 +71,12 @@ export declare class RequestContext {
|
|
|
71
71
|
[_token]: Token | null;
|
|
72
72
|
[_user]: User | null;
|
|
73
73
|
[_connection]: Connection;
|
|
74
|
-
|
|
74
|
+
/**
|
|
75
|
+
* The public signature takes `unknown`, which every call that compiled with
|
|
76
|
+
* v2.56.0's `any` still satisfies; the implementation reads the options as
|
|
77
|
+
* the object `KuzzleRequest`'s constructor has checked they are.
|
|
78
|
+
*/
|
|
79
|
+
constructor(options?: unknown);
|
|
75
80
|
/**
|
|
76
81
|
* Serializes the RequestContext object
|
|
77
82
|
*/
|
|
@@ -35,13 +35,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
35
35
|
}) : function(o, v) {
|
|
36
36
|
o["default"] = v;
|
|
37
37
|
});
|
|
38
|
-
var __importStar = (this && this.__importStar) || function (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
};
|
|
38
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
39
|
+
var ownKeys = function(o) {
|
|
40
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
41
|
+
var ar = [];
|
|
42
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
43
|
+
return ar;
|
|
44
|
+
};
|
|
45
|
+
return ownKeys(o);
|
|
46
|
+
};
|
|
47
|
+
return function (mod) {
|
|
48
|
+
if (mod && mod.__esModule) return mod;
|
|
49
|
+
var result = {};
|
|
50
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
51
|
+
__setModuleDefault(result, mod);
|
|
52
|
+
return result;
|
|
53
|
+
};
|
|
54
|
+
})();
|
|
45
55
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
56
|
exports.RequestContext = exports.Connection = void 0;
|
|
47
57
|
const assert = __importStar(require("../../util/assertType"));
|
|
@@ -180,7 +180,7 @@ export declare class RequestInput {
|
|
|
180
180
|
* it. The parameter type excluded the one value the implementation handles
|
|
181
181
|
* first — the same asymmetry `headers` documents just below.
|
|
182
182
|
*/
|
|
183
|
-
set body(obj: JSONObject |
|
|
183
|
+
set body(obj: JSONObject | unknown[] | null);
|
|
184
184
|
/**
|
|
185
185
|
* Request headers (Http only).
|
|
186
186
|
*
|
|
@@ -35,13 +35,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
35
35
|
}) : function(o, v) {
|
|
36
36
|
o["default"] = v;
|
|
37
37
|
});
|
|
38
|
-
var __importStar = (this && this.__importStar) || function (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
};
|
|
38
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
39
|
+
var ownKeys = function(o) {
|
|
40
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
41
|
+
var ar = [];
|
|
42
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
43
|
+
return ar;
|
|
44
|
+
};
|
|
45
|
+
return ownKeys(o);
|
|
46
|
+
};
|
|
47
|
+
return function (mod) {
|
|
48
|
+
if (mod && mod.__esModule) return mod;
|
|
49
|
+
var result = {};
|
|
50
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
51
|
+
__setModuleDefault(result, mod);
|
|
52
|
+
return result;
|
|
53
|
+
};
|
|
54
|
+
})();
|
|
45
55
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
56
|
exports.RequestInput = exports.RequestResource = void 0;
|
|
47
57
|
const internalError_1 = require("../../kerror/errors/internalError");
|
|
@@ -15,7 +15,7 @@ export declare class Headers {
|
|
|
15
15
|
*
|
|
16
16
|
* @param name Header name. Could be a string (case-insensitive) or a symbol
|
|
17
17
|
*/
|
|
18
|
-
getHeader(name:
|
|
18
|
+
getHeader(name: unknown): string | undefined;
|
|
19
19
|
removeHeader(name: string): boolean;
|
|
20
20
|
setHeader(name: string, value: string): boolean;
|
|
21
21
|
}
|
|
@@ -92,7 +92,7 @@ export declare class RequestResponse {
|
|
|
92
92
|
* Request result
|
|
93
93
|
*/
|
|
94
94
|
get result(): any;
|
|
95
|
-
set result(r:
|
|
95
|
+
set result(r: unknown);
|
|
96
96
|
/**
|
|
97
97
|
* Node identifier
|
|
98
98
|
*/
|