kuzzle 2.29.0-beta.2 → 2.29.1-beta.1
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/lib/api/httpRoutes.js +0 -29
- package/lib/api/openapi/OpenApiManager.js +0 -32
- package/lib/api/openapi/openApiGenerator.js +1 -1
- package/lib/config/default.config.js +13 -0
- package/lib/core/backend/backendOpenApi.js +1 -13
- package/lib/kuzzle/kuzzle.js +60 -13
- package/lib/types/OpenApiDefinition.d.ts +1 -14
- package/lib/types/config/storageEngine/StorageEngineElasticsearchConfiguration.d.ts +20 -0
- package/package.json +1 -1
- package/lib/api/openapi/components/document/count.yaml +0 -47
- package/lib/api/openapi/components/document/create.yaml +0 -46
- package/lib/api/openapi/components/document/createOrReplace.yaml +0 -61
- package/lib/api/openapi/components/document/delete.yaml +0 -67
- package/lib/api/openapi/components/document/deleteByQuery.yaml +0 -90
- package/lib/api/openapi/components/document/exists.yaml +0 -35
- package/lib/api/openapi/components/document/get.yaml +0 -68
- package/lib/api/openapi/components/document/index.d.ts +0 -24
- package/lib/api/openapi/components/document/index.js +0 -65
- package/lib/api/openapi/components/document/mCreateOrReplace.yaml +0 -93
- package/lib/api/openapi/components/document/replace.yaml +0 -66
- package/lib/api/openapi/components/document/scroll.yaml +0 -49
- package/lib/api/openapi/components/document/update.yaml +0 -78
- package/lib/api/openapi/components/document/validate.yaml +0 -42
- package/lib/api/openapi/components/index.d.ts +0 -3
- package/lib/api/openapi/components/index.js +0 -23
- package/lib/api/openapi/components/payloads.yaml +0 -32
- package/lib/api/openapi/components/security/index.d.ts +0 -2
- package/lib/api/openapi/components/security/index.js +0 -10
- package/lib/api/openapi/components/security/upsertUser.yaml +0 -58
package/lib/api/httpRoutes.js
CHANGED
|
@@ -23,22 +23,6 @@
|
|
|
23
23
|
|
|
24
24
|
"use strict";
|
|
25
25
|
|
|
26
|
-
const {
|
|
27
|
-
OpenApiDocumentCount,
|
|
28
|
-
OpenApiDocumentDeleteByQuery,
|
|
29
|
-
OpenApiDocumentDelete,
|
|
30
|
-
OpenApiDocumentScroll,
|
|
31
|
-
OpenApiDocumentExists,
|
|
32
|
-
OpenApiDocumentUpdate,
|
|
33
|
-
OpenApiDocumentReplace,
|
|
34
|
-
OpenApiDocumentGet,
|
|
35
|
-
OpenApiDocumentCreate,
|
|
36
|
-
OpenApiDocumentCreateOrReplace,
|
|
37
|
-
OpenApiDocumentValidate,
|
|
38
|
-
OpenApiSecurityUpsertUser,
|
|
39
|
-
OpenApiDocumentmCreateOrReplace,
|
|
40
|
-
} = require("./openapi/components");
|
|
41
|
-
|
|
42
26
|
const routes = [
|
|
43
27
|
// GET (idempotent)
|
|
44
28
|
{ verb: "get", path: "/_me", controller: "auth", action: "getCurrentUser" },
|
|
@@ -242,7 +226,6 @@ const routes = [
|
|
|
242
226
|
path: "/:index/:collection/:_id",
|
|
243
227
|
controller: "document",
|
|
244
228
|
action: "get",
|
|
245
|
-
openapi: OpenApiDocumentGet,
|
|
246
229
|
},
|
|
247
230
|
{
|
|
248
231
|
verb: "get",
|
|
@@ -255,7 +238,6 @@ const routes = [
|
|
|
255
238
|
path: "/:index/:collection/:_id/_exists",
|
|
256
239
|
controller: "document",
|
|
257
240
|
action: "exists",
|
|
258
|
-
openapi: OpenApiDocumentExists,
|
|
259
241
|
},
|
|
260
242
|
{
|
|
261
243
|
verb: "post",
|
|
@@ -268,7 +250,6 @@ const routes = [
|
|
|
268
250
|
path: "/_scroll/:scrollId",
|
|
269
251
|
controller: "document",
|
|
270
252
|
action: "scroll",
|
|
271
|
-
openapi: OpenApiDocumentScroll,
|
|
272
253
|
},
|
|
273
254
|
|
|
274
255
|
{
|
|
@@ -770,14 +751,12 @@ const routes = [
|
|
|
770
751
|
path: "/:index/:collection/_count",
|
|
771
752
|
controller: "document",
|
|
772
753
|
action: "count",
|
|
773
|
-
openapi: OpenApiDocumentCount,
|
|
774
754
|
},
|
|
775
755
|
{
|
|
776
756
|
verb: "post",
|
|
777
757
|
path: "/:index/:collection/_create",
|
|
778
758
|
controller: "document",
|
|
779
759
|
action: "create",
|
|
780
|
-
openapi: OpenApiDocumentCreate,
|
|
781
760
|
},
|
|
782
761
|
{
|
|
783
762
|
verb: "post",
|
|
@@ -832,7 +811,6 @@ const routes = [
|
|
|
832
811
|
path: "/:index/:collection/_validate",
|
|
833
812
|
controller: "document",
|
|
834
813
|
action: "validate",
|
|
835
|
-
openapi: OpenApiDocumentValidate,
|
|
836
814
|
},
|
|
837
815
|
|
|
838
816
|
{
|
|
@@ -955,7 +933,6 @@ const routes = [
|
|
|
955
933
|
path: "/users/:_id/_upsert",
|
|
956
934
|
controller: "security",
|
|
957
935
|
action: "upsertUser",
|
|
958
|
-
openapi: OpenApiSecurityUpsertUser,
|
|
959
936
|
},
|
|
960
937
|
{
|
|
961
938
|
verb: "post",
|
|
@@ -1241,7 +1218,6 @@ const routes = [
|
|
|
1241
1218
|
path: "/:index/:collection/:_id",
|
|
1242
1219
|
controller: "document",
|
|
1243
1220
|
action: "delete",
|
|
1244
|
-
openapi: OpenApiDocumentDelete,
|
|
1245
1221
|
},
|
|
1246
1222
|
{
|
|
1247
1223
|
verb: "delete",
|
|
@@ -1254,7 +1230,6 @@ const routes = [
|
|
|
1254
1230
|
path: "/:index/:collection/_query",
|
|
1255
1231
|
controller: "document",
|
|
1256
1232
|
action: "deleteByQuery",
|
|
1257
|
-
openapi: OpenApiDocumentDeleteByQuery,
|
|
1258
1233
|
},
|
|
1259
1234
|
{
|
|
1260
1235
|
verb: "delete",
|
|
@@ -1421,21 +1396,18 @@ const routes = [
|
|
|
1421
1396
|
path: "/:index/:collection/:_id",
|
|
1422
1397
|
controller: "document",
|
|
1423
1398
|
action: "createOrReplace",
|
|
1424
|
-
openapi: OpenApiDocumentCreateOrReplace,
|
|
1425
1399
|
},
|
|
1426
1400
|
{
|
|
1427
1401
|
verb: "put",
|
|
1428
1402
|
path: "/:index/:collection/_mCreateOrReplace",
|
|
1429
1403
|
controller: "document",
|
|
1430
1404
|
action: "mCreateOrReplace",
|
|
1431
|
-
openapi: OpenApiDocumentmCreateOrReplace,
|
|
1432
1405
|
},
|
|
1433
1406
|
{
|
|
1434
1407
|
verb: "put",
|
|
1435
1408
|
path: "/:index/:collection/:_id/_replace",
|
|
1436
1409
|
controller: "document",
|
|
1437
1410
|
action: "replace",
|
|
1438
|
-
openapi: OpenApiDocumentReplace,
|
|
1439
1411
|
},
|
|
1440
1412
|
{
|
|
1441
1413
|
verb: "put",
|
|
@@ -1458,7 +1430,6 @@ const routes = [
|
|
|
1458
1430
|
path: "/:index/:collection/:_id/_update",
|
|
1459
1431
|
controller: "document",
|
|
1460
1432
|
action: "update",
|
|
1461
|
-
openapi: OpenApiDocumentUpdate,
|
|
1462
1433
|
deprecated: {
|
|
1463
1434
|
since: "2.11.0",
|
|
1464
1435
|
message: 'Use "document:update" route with PATCH instead of PUT',
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
*/
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
23
|
exports.OpenApiManager = void 0;
|
|
24
|
-
const components_1 = require("./components");
|
|
25
24
|
const package_json_1 = require("../../../package.json");
|
|
26
25
|
const openApiGenerator_1 = require("./openApiGenerator");
|
|
27
26
|
class OpenApiManager {
|
|
@@ -40,7 +39,6 @@ class OpenApiManager {
|
|
|
40
39
|
name: "Kuzzle team",
|
|
41
40
|
url: "https://kuzzle.io",
|
|
42
41
|
email: "support@kuzzle.io",
|
|
43
|
-
discord: "http://join.discord.kuzzle.io",
|
|
44
42
|
},
|
|
45
43
|
license: {
|
|
46
44
|
name: "Apache 2",
|
|
@@ -52,39 +50,9 @@ class OpenApiManager {
|
|
|
52
50
|
description: "Kuzzle API Documentation",
|
|
53
51
|
url: "https://docs.kuzzle.io/core/2/api/",
|
|
54
52
|
},
|
|
55
|
-
servers: [
|
|
56
|
-
{
|
|
57
|
-
url: "https://{baseUrl}:{port}",
|
|
58
|
-
description: "Kuzzle Base Url",
|
|
59
|
-
variables: {
|
|
60
|
-
baseUrl: { default: "localhost" },
|
|
61
|
-
port: { default: 7512 },
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
53
|
tags: [],
|
|
66
54
|
schemes: ["https", "http"],
|
|
67
55
|
paths: {},
|
|
68
|
-
components: {
|
|
69
|
-
...components_1.OpenApiPayloadsDefinitions,
|
|
70
|
-
document: {
|
|
71
|
-
...components_1.OpenApiDocumentCountComponent,
|
|
72
|
-
...components_1.OpenApiDocumentDeleteByQueryComponent,
|
|
73
|
-
...components_1.OpenApiDocumentDeleteComponent,
|
|
74
|
-
...components_1.OpenApiDocumentScrollComponent,
|
|
75
|
-
...components_1.OpenApiDocumentExistsComponent,
|
|
76
|
-
...components_1.OpenApiDocumentUpdateComponent,
|
|
77
|
-
...components_1.OpenApiDocumentReplaceComponent,
|
|
78
|
-
...components_1.OpenApiDocumentGetComponent,
|
|
79
|
-
...components_1.OpenApiDocumentCreateOrReplaceComponent,
|
|
80
|
-
...components_1.OpenApiDocumentCreateComponent,
|
|
81
|
-
...components_1.OpenApiDocumentValidateComponent,
|
|
82
|
-
},
|
|
83
|
-
security: {
|
|
84
|
-
...components_1.OpenApiSecurityUpsertUserComponent,
|
|
85
|
-
...components_1.OpenApiDocumentmCreateOrReplaceComponent,
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
56
|
};
|
|
89
57
|
this.applicationDefinition = applicationDefinition;
|
|
90
58
|
(0, openApiGenerator_1.generateOpenApi)(kuzzleRoutes, this.kuzzleDefinition);
|
|
@@ -416,6 +416,19 @@ const defaultConfig = {
|
|
|
416
416
|
},
|
|
417
417
|
},
|
|
418
418
|
},
|
|
419
|
+
imports: {
|
|
420
|
+
settings: {
|
|
421
|
+
// @deprecated : replace undefined by 1
|
|
422
|
+
number_of_shards: 1,
|
|
423
|
+
number_of_replicas: 1,
|
|
424
|
+
},
|
|
425
|
+
mappings: {
|
|
426
|
+
dynamic: "strict",
|
|
427
|
+
properties: {
|
|
428
|
+
hash: { type: "keyword" },
|
|
429
|
+
},
|
|
430
|
+
},
|
|
431
|
+
},
|
|
419
432
|
},
|
|
420
433
|
},
|
|
421
434
|
maxScrollDuration: "1m",
|
|
@@ -27,7 +27,7 @@ class BackendOpenApi extends index_1.ApplicationManager {
|
|
|
27
27
|
super(application);
|
|
28
28
|
/* eslint-disable sort-keys */
|
|
29
29
|
this.definition = {
|
|
30
|
-
openapi: "3.
|
|
30
|
+
openapi: "3.1.0",
|
|
31
31
|
info: {
|
|
32
32
|
title: `${application.name} API`,
|
|
33
33
|
description: `${application.name} HTTP API definition`,
|
|
@@ -35,7 +35,6 @@ class BackendOpenApi extends index_1.ApplicationManager {
|
|
|
35
35
|
name: "Kuzzle team",
|
|
36
36
|
url: "https://kuzzle.io",
|
|
37
37
|
email: "support@kuzzle.io",
|
|
38
|
-
discord: "http://join.discord.kuzzle.io",
|
|
39
38
|
},
|
|
40
39
|
license: {
|
|
41
40
|
name: "Apache 2",
|
|
@@ -47,20 +46,9 @@ class BackendOpenApi extends index_1.ApplicationManager {
|
|
|
47
46
|
description: "Kuzzle API Documentation",
|
|
48
47
|
url: "https://docs.kuzzle.io/core/2/api/",
|
|
49
48
|
},
|
|
50
|
-
servers: [
|
|
51
|
-
{
|
|
52
|
-
url: "https://{baseUrl}:{port}",
|
|
53
|
-
description: `${application.name} Base Url`,
|
|
54
|
-
variables: {
|
|
55
|
-
baseUrl: { default: "localhost" },
|
|
56
|
-
port: { default: 7512 },
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
],
|
|
60
49
|
tags: [],
|
|
61
50
|
schemes: ["https", "http"],
|
|
62
51
|
paths: {},
|
|
63
|
-
components: {},
|
|
64
52
|
};
|
|
65
53
|
/* eslint-enable sort-keys */
|
|
66
54
|
}
|
package/lib/kuzzle/kuzzle.js
CHANGED
|
@@ -382,6 +382,45 @@ class Kuzzle extends kuzzleEventEmitter_1.default {
|
|
|
382
382
|
await bluebird_1.default.delay(1000);
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
|
+
isConfigsEmpty(importConfig, supportConfig) {
|
|
386
|
+
if (lodash_1.default.isEmpty(importConfig.mappings) &&
|
|
387
|
+
lodash_1.default.isEmpty(importConfig.profiles) &&
|
|
388
|
+
lodash_1.default.isEmpty(importConfig.roles) &&
|
|
389
|
+
lodash_1.default.isEmpty(importConfig.userMappings) &&
|
|
390
|
+
lodash_1.default.isEmpty(importConfig.users) &&
|
|
391
|
+
lodash_1.default.isEmpty(supportConfig.fixtures) &&
|
|
392
|
+
lodash_1.default.isEmpty(supportConfig.mappings) &&
|
|
393
|
+
lodash_1.default.isEmpty(supportConfig.securities)) {
|
|
394
|
+
return true;
|
|
395
|
+
}
|
|
396
|
+
return false;
|
|
397
|
+
}
|
|
398
|
+
async persistHashedImport({ existingRedisHash, existingESHash, importPayloadHash, type, }) {
|
|
399
|
+
if (!existingRedisHash && !existingESHash) {
|
|
400
|
+
// If the import is not initialized in the redis cache and in the ES, we initialize it
|
|
401
|
+
this.log.info(`${type} import is not initialized, initializing...`);
|
|
402
|
+
await this.ask("core:storage:private:document:create", "kuzzle", "imports", {
|
|
403
|
+
hash: importPayloadHash,
|
|
404
|
+
}, { id: `${exports.BACKEND_IMPORT_KEY}:${type}` });
|
|
405
|
+
await this.ask("core:cache:internal:store", `${exports.BACKEND_IMPORT_KEY}:${type}`, importPayloadHash);
|
|
406
|
+
}
|
|
407
|
+
else if (existingRedisHash && !existingESHash) {
|
|
408
|
+
// If the import is initialized in the redis cache but not in the ES
|
|
409
|
+
// We initialize it in the ES
|
|
410
|
+
this.log.info(`${type} import is not initialized in %kuzzle.imports, initializing...`);
|
|
411
|
+
const redisCache = await this.ask("core:cache:internal:get", `${exports.BACKEND_IMPORT_KEY}:${type}`);
|
|
412
|
+
await this.ask("core:storage:private:document:create", "kuzzle", "imports", {
|
|
413
|
+
hash: redisCache,
|
|
414
|
+
}, { id: `${exports.BACKEND_IMPORT_KEY}:${type}` });
|
|
415
|
+
}
|
|
416
|
+
else if (!existingRedisHash && existingESHash) {
|
|
417
|
+
// If the import is initialized in the ES but not in the redis cache
|
|
418
|
+
// We initialize it in the redis cache
|
|
419
|
+
this.log.info(`${type} import is not initialized in the redis cache, initializing...`);
|
|
420
|
+
const esDocument = await this.ask("core:storage:private:document:get", "kuzzle", "imports", `${exports.BACKEND_IMPORT_KEY}:${type}`);
|
|
421
|
+
await this.ask("core:cache:internal:store", `${exports.BACKEND_IMPORT_KEY}:${type}`, esDocument._source.hash);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
385
424
|
/**
|
|
386
425
|
* Load into the app several imports
|
|
387
426
|
*
|
|
@@ -391,14 +430,7 @@ class Kuzzle extends kuzzleEventEmitter_1.default {
|
|
|
391
430
|
* @returns {Promise<void>}
|
|
392
431
|
*/
|
|
393
432
|
async loadInitialState(toImport = {}, toSupport = {}) {
|
|
394
|
-
if (
|
|
395
|
-
lodash_1.default.isEmpty(toImport.profiles) &&
|
|
396
|
-
lodash_1.default.isEmpty(toImport.roles) &&
|
|
397
|
-
lodash_1.default.isEmpty(toImport.userMappings) &&
|
|
398
|
-
lodash_1.default.isEmpty(toImport.users) &&
|
|
399
|
-
lodash_1.default.isEmpty(toSupport.fixtures) &&
|
|
400
|
-
lodash_1.default.isEmpty(toSupport.mappings) &&
|
|
401
|
-
lodash_1.default.isEmpty(toSupport.securities)) {
|
|
433
|
+
if (this.isConfigsEmpty(toImport, toSupport)) {
|
|
402
434
|
return;
|
|
403
435
|
}
|
|
404
436
|
const lockedMutex = [];
|
|
@@ -422,17 +454,32 @@ class Kuzzle extends kuzzleEventEmitter_1.default {
|
|
|
422
454
|
}
|
|
423
455
|
const importPayloadHash = (0, crypto_1.sha256)((0, json_stable_stringify_1.default)(importPayload));
|
|
424
456
|
const mutex = new mutex_1.Mutex(`backend:import:${type}`, { timeout: 0 });
|
|
425
|
-
const
|
|
426
|
-
const
|
|
457
|
+
const existingRedisHash = await this.ask("core:cache:internal:get", `${exports.BACKEND_IMPORT_KEY}:${type}`);
|
|
458
|
+
const existingESHash = await this.ask("core:storage:private:document:exist", "kuzzle", "imports", `${exports.BACKEND_IMPORT_KEY}:${type}`);
|
|
459
|
+
let initialized = false;
|
|
460
|
+
if (existingRedisHash) {
|
|
461
|
+
// Check if the import is already initialized inside the redis cache
|
|
462
|
+
initialized = existingRedisHash === importPayloadHash;
|
|
463
|
+
}
|
|
464
|
+
else if (existingESHash) {
|
|
465
|
+
// Check if the import is already initialized inside the ES
|
|
466
|
+
const esDocument = await this.ask("core:storage:private:document:get", "kuzzle", "imports", `${exports.BACKEND_IMPORT_KEY}:${type}`);
|
|
467
|
+
initialized = esDocument._source.hash === importPayloadHash;
|
|
468
|
+
}
|
|
427
469
|
const locked = await mutex.lock();
|
|
428
470
|
await importMethod({ toImport, toSupport }, {
|
|
429
471
|
firstCall: !initialized && locked,
|
|
430
|
-
initialized,
|
|
472
|
+
initialized: initialized,
|
|
431
473
|
locked,
|
|
432
474
|
});
|
|
433
|
-
if (
|
|
475
|
+
if (locked) {
|
|
434
476
|
lockedMutex.push(mutex);
|
|
435
|
-
await this.
|
|
477
|
+
await this.persistHashedImport({
|
|
478
|
+
existingESHash,
|
|
479
|
+
existingRedisHash,
|
|
480
|
+
importPayloadHash,
|
|
481
|
+
type,
|
|
482
|
+
});
|
|
436
483
|
}
|
|
437
484
|
}
|
|
438
485
|
await this._waitForImportToFinish();
|
|
@@ -9,7 +9,6 @@ export type OpenApiDefinition = {
|
|
|
9
9
|
name: string;
|
|
10
10
|
url: string;
|
|
11
11
|
email: string;
|
|
12
|
-
discord: string;
|
|
13
12
|
};
|
|
14
13
|
license: {
|
|
15
14
|
name: string;
|
|
@@ -21,23 +20,11 @@ export type OpenApiDefinition = {
|
|
|
21
20
|
description: string;
|
|
22
21
|
url: string;
|
|
23
22
|
};
|
|
24
|
-
servers: Array<{
|
|
25
|
-
url: string;
|
|
26
|
-
description: string;
|
|
27
|
-
variables: {
|
|
28
|
-
baseUrl: {
|
|
29
|
-
default: string;
|
|
30
|
-
};
|
|
31
|
-
port: {
|
|
32
|
-
default: number;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
}>;
|
|
36
23
|
tags: Array<{
|
|
37
24
|
description: string;
|
|
38
25
|
name: string;
|
|
39
26
|
}>;
|
|
40
27
|
schemes: string[];
|
|
41
28
|
paths: JSONObject;
|
|
42
|
-
components
|
|
29
|
+
components?: JSONObject;
|
|
43
30
|
};
|
|
@@ -316,6 +316,26 @@ export type StorageEngineElasticsearch = {
|
|
|
316
316
|
};
|
|
317
317
|
};
|
|
318
318
|
};
|
|
319
|
+
imports: {
|
|
320
|
+
settings: {
|
|
321
|
+
/**
|
|
322
|
+
* @default 1
|
|
323
|
+
*/
|
|
324
|
+
number_of_shards: number;
|
|
325
|
+
/**
|
|
326
|
+
* @default 1
|
|
327
|
+
*/
|
|
328
|
+
number_of_replicas: number;
|
|
329
|
+
};
|
|
330
|
+
mappings: {
|
|
331
|
+
dynamic: "strict";
|
|
332
|
+
properties: {
|
|
333
|
+
hash: {
|
|
334
|
+
type: "keyword";
|
|
335
|
+
};
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
};
|
|
319
339
|
};
|
|
320
340
|
};
|
|
321
341
|
maxScrollDuration: string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kuzzle",
|
|
3
3
|
"author": "The Kuzzle Team <support@kuzzle.io>",
|
|
4
|
-
"version": "2.29.
|
|
4
|
+
"version": "2.29.1-beta.1",
|
|
5
5
|
"description": "Kuzzle is an open-source solution that handles all the data management through a secured API, with a large choice of protocols.",
|
|
6
6
|
"bin": "bin/start-kuzzle-server",
|
|
7
7
|
"scripts": {
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
DocumentCount:
|
|
2
|
-
summary: "Counts documents in a collection."
|
|
3
|
-
tags:
|
|
4
|
-
- document
|
|
5
|
-
parameters:
|
|
6
|
-
- in: path
|
|
7
|
-
name: index
|
|
8
|
-
schema:
|
|
9
|
-
type: string
|
|
10
|
-
- in: path
|
|
11
|
-
name: collection
|
|
12
|
-
schema:
|
|
13
|
-
type: string
|
|
14
|
-
- in: body
|
|
15
|
-
name: "body"
|
|
16
|
-
description: "Counts documents in a collection."
|
|
17
|
-
required: true
|
|
18
|
-
schema:
|
|
19
|
-
$ref: "#/components/document/DocumentCountRequest"
|
|
20
|
-
responses:
|
|
21
|
-
200:
|
|
22
|
-
description: "Counts documents in a collection."
|
|
23
|
-
schema:
|
|
24
|
-
$ref: "#/components/document/DocumentCountResponse"
|
|
25
|
-
|
|
26
|
-
components:
|
|
27
|
-
schemas:
|
|
28
|
-
DocumentCountRequest:
|
|
29
|
-
allOf:
|
|
30
|
-
- type: "object"
|
|
31
|
-
properties:
|
|
32
|
-
query:
|
|
33
|
-
type: "object"
|
|
34
|
-
properties:
|
|
35
|
-
match_all:
|
|
36
|
-
type: "object"
|
|
37
|
-
|
|
38
|
-
DocumentCountResponse:
|
|
39
|
-
allOf:
|
|
40
|
-
- $ref: "#/components/ResponsePayload"
|
|
41
|
-
- type: "object"
|
|
42
|
-
properties:
|
|
43
|
-
result:
|
|
44
|
-
type: "object"
|
|
45
|
-
properties:
|
|
46
|
-
count:
|
|
47
|
-
type: "integer"
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
DocumentCreate:
|
|
2
|
-
summary: "Creates a new document in the persistent data storage."
|
|
3
|
-
tags:
|
|
4
|
-
- document
|
|
5
|
-
parameters:
|
|
6
|
-
- in: path
|
|
7
|
-
name: index
|
|
8
|
-
schema:
|
|
9
|
-
type: string
|
|
10
|
-
- in: path
|
|
11
|
-
name: collection
|
|
12
|
-
schema:
|
|
13
|
-
type: string
|
|
14
|
-
- name: body
|
|
15
|
-
in: "body"
|
|
16
|
-
description: "Creates a new document in the persistent data storage."
|
|
17
|
-
required: true
|
|
18
|
-
schema:
|
|
19
|
-
$ref: "#/components/document/DocumentCreateRequest"
|
|
20
|
-
responses:
|
|
21
|
-
200:
|
|
22
|
-
description: "Creates a new document in the persistent data storage."
|
|
23
|
-
schema:
|
|
24
|
-
$ref: "#/components/document/DocumentCreateResponse"
|
|
25
|
-
|
|
26
|
-
components:
|
|
27
|
-
schemas:
|
|
28
|
-
DocumentCreateRequest:
|
|
29
|
-
allOf:
|
|
30
|
-
- type: "object"
|
|
31
|
-
description: "document content"
|
|
32
|
-
DocumentCreateResponse:
|
|
33
|
-
allOf:
|
|
34
|
-
- $ref: "#/components/ResponsePayload"
|
|
35
|
-
- type: "object"
|
|
36
|
-
properties:
|
|
37
|
-
result:
|
|
38
|
-
type: "object"
|
|
39
|
-
properties:
|
|
40
|
-
_id:
|
|
41
|
-
type: "string"
|
|
42
|
-
description: "documentId"
|
|
43
|
-
_version:
|
|
44
|
-
type: "integer"
|
|
45
|
-
_sources:
|
|
46
|
-
type: "object"
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
DocumentCreateOrReplace:
|
|
2
|
-
summary: "Creates a new document in the persistent data storage, or replaces its content if it already exists."
|
|
3
|
-
tags:
|
|
4
|
-
- document
|
|
5
|
-
parameters:
|
|
6
|
-
- in: path
|
|
7
|
-
name: index
|
|
8
|
-
schema:
|
|
9
|
-
type: string
|
|
10
|
-
required: true
|
|
11
|
-
- in: path
|
|
12
|
-
name: collection
|
|
13
|
-
schema:
|
|
14
|
-
type: string
|
|
15
|
-
required: true
|
|
16
|
-
- in: path
|
|
17
|
-
name: _id
|
|
18
|
-
schema:
|
|
19
|
-
type: integer
|
|
20
|
-
required: true
|
|
21
|
-
- in: path
|
|
22
|
-
name: refresh
|
|
23
|
-
schema:
|
|
24
|
-
type: string
|
|
25
|
-
required: false
|
|
26
|
-
- name: body
|
|
27
|
-
in: "body"
|
|
28
|
-
description: "Creates a new document in the persistent data storage, or replaces its content if it already exists."
|
|
29
|
-
required: true
|
|
30
|
-
schema:
|
|
31
|
-
$ref: "#/components/document/DocumentCreateOrReplaceRequest"
|
|
32
|
-
responses:
|
|
33
|
-
200:
|
|
34
|
-
description: "Creates a new document in the persistent data storage, or replaces its content if it already exists."
|
|
35
|
-
schema:
|
|
36
|
-
$ref: "#/components/document/DocumentCreateOrReplaceResponse"
|
|
37
|
-
|
|
38
|
-
components:
|
|
39
|
-
schemas:
|
|
40
|
-
DocumentCreateOrReplaceRequest:
|
|
41
|
-
allOf:
|
|
42
|
-
- type: "object"
|
|
43
|
-
description: "document content"
|
|
44
|
-
DocumentCreateOrReplaceResponse:
|
|
45
|
-
allOf:
|
|
46
|
-
- $ref: "#/components/ResponsePayload"
|
|
47
|
-
- type: "object"
|
|
48
|
-
properties:
|
|
49
|
-
result:
|
|
50
|
-
type: "object"
|
|
51
|
-
properties:
|
|
52
|
-
_id:
|
|
53
|
-
type: "string"
|
|
54
|
-
description: "documentId"
|
|
55
|
-
_version:
|
|
56
|
-
type: "integer"
|
|
57
|
-
_sources:
|
|
58
|
-
type: "object"
|
|
59
|
-
description: "document content"
|
|
60
|
-
created:
|
|
61
|
-
type: "boolean"
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
DocumentDelete:
|
|
2
|
-
summary: "Deletes a document."
|
|
3
|
-
tags:
|
|
4
|
-
- document
|
|
5
|
-
parameters:
|
|
6
|
-
- in: path
|
|
7
|
-
name: index
|
|
8
|
-
schema:
|
|
9
|
-
type: string
|
|
10
|
-
required: true
|
|
11
|
-
- in: path
|
|
12
|
-
name: collection
|
|
13
|
-
schema:
|
|
14
|
-
type: string
|
|
15
|
-
required: true
|
|
16
|
-
- in: path
|
|
17
|
-
name: documentId
|
|
18
|
-
schema:
|
|
19
|
-
type: string
|
|
20
|
-
required: true
|
|
21
|
-
- in: path
|
|
22
|
-
name: refresh
|
|
23
|
-
schema:
|
|
24
|
-
type: string
|
|
25
|
-
description: " if set to wait_for, Kuzzle will not respond until the deletion has been indexed"
|
|
26
|
-
required: false
|
|
27
|
-
- in: path
|
|
28
|
-
name: source
|
|
29
|
-
schema:
|
|
30
|
-
type: boolean
|
|
31
|
-
description: "if set to true Kuzzle will return the deleted document body in the response."
|
|
32
|
-
required: false
|
|
33
|
-
- in: path
|
|
34
|
-
name: silent
|
|
35
|
-
schema:
|
|
36
|
-
type: boolean
|
|
37
|
-
description: "if set, then Kuzzle will not generate notifications. Available since 2.9.2"
|
|
38
|
-
required: false
|
|
39
|
-
responses:
|
|
40
|
-
200:
|
|
41
|
-
description: "Deletes a document."
|
|
42
|
-
schema:
|
|
43
|
-
$ref: "#/components/document/DocumentDeleteResponse"
|
|
44
|
-
|
|
45
|
-
components:
|
|
46
|
-
schemas:
|
|
47
|
-
DocumentDeleteRequest:
|
|
48
|
-
allOf:
|
|
49
|
-
- type: "object"
|
|
50
|
-
properties:
|
|
51
|
-
_id:
|
|
52
|
-
type: "string"
|
|
53
|
-
description: "documentId"
|
|
54
|
-
refresh:
|
|
55
|
-
type: "string"
|
|
56
|
-
description: " if set to wait_for, Kuzzle will not respond until the created/replaced document is indexed"
|
|
57
|
-
DocumentDeleteResponse:
|
|
58
|
-
allOf:
|
|
59
|
-
- $ref: "#/components/ResponsePayload"
|
|
60
|
-
- type: "object"
|
|
61
|
-
properties:
|
|
62
|
-
result:
|
|
63
|
-
type: "object"
|
|
64
|
-
properties:
|
|
65
|
-
_id:
|
|
66
|
-
type: "string"
|
|
67
|
-
description: "documentId"
|