kuzzle 2.43.1 → 2.43.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/LICENSE.md +2 -2
- package/bin/start-kuzzle-server +2 -1
- package/lib/api/controllers/adminController.js +2 -6
- package/lib/core/backend/backend.d.ts +2 -2
- package/lib/core/backend/backend.js +13 -14
- package/lib/core/realtime/hotelClerk.js +1 -1
- package/lib/kuzzle/kuzzle.d.ts +0 -1
- package/lib/kuzzle/kuzzle.js +11 -12
- package/package.json +27 -26
package/LICENSE.md
CHANGED
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
|
|
177
177
|
END OF TERMS AND CONDITIONS
|
|
178
178
|
|
|
179
|
-
Copyright 2015-
|
|
179
|
+
Copyright 2015-2025 Kuzzle SAS
|
|
180
180
|
|
|
181
181
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
182
182
|
you may not use this file except in compliance with the License.
|
|
@@ -188,4 +188,4 @@
|
|
|
188
188
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
189
189
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
190
190
|
See the License for the specific language governing permissions and
|
|
191
|
-
limitations under the License.
|
|
191
|
+
limitations under the License.
|
package/bin/start-kuzzle-server
CHANGED
|
@@ -98,7 +98,8 @@ async function startKuzzle(options = {}) {
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
const options = yargs
|
|
101
|
+
const options = yargs()
|
|
102
|
+
.scriptName("kuzzle")
|
|
102
103
|
.usage("start-kuzzle-server [options]")
|
|
103
104
|
.describe("fixtures", "Import data from file")
|
|
104
105
|
.describe("mappings", "Apply mappings from file")
|
|
@@ -26,7 +26,6 @@ const Bluebird = require("bluebird");
|
|
|
26
26
|
const kerror = require("../../kerror");
|
|
27
27
|
const { NativeController } = require("./baseController");
|
|
28
28
|
const { Mutex } = require("../../util/mutex");
|
|
29
|
-
const { BACKEND_IMPORT_KEY } = require("../../kuzzle/kuzzle");
|
|
30
29
|
|
|
31
30
|
/**
|
|
32
31
|
* @class AdminController
|
|
@@ -107,7 +106,7 @@ class AdminController extends NativeController {
|
|
|
107
106
|
|
|
108
107
|
await this.ask(
|
|
109
108
|
"core:cache:internal:del",
|
|
110
|
-
|
|
109
|
+
`backend:init:import:permissions`,
|
|
111
110
|
);
|
|
112
111
|
} finally {
|
|
113
112
|
await mutex.unlock();
|
|
@@ -135,10 +134,7 @@ class AdminController extends NativeController {
|
|
|
135
134
|
const indexes = await this.ask("core:storage:public:index:list");
|
|
136
135
|
await this.ask("core:storage:public:index:mDelete", indexes);
|
|
137
136
|
|
|
138
|
-
await this.ask(
|
|
139
|
-
"core:cache:internal:del",
|
|
140
|
-
`${BACKEND_IMPORT_KEY}:mappings`,
|
|
141
|
-
);
|
|
137
|
+
await this.ask("core:cache:internal:del", `backend:init:import:mappings`);
|
|
142
138
|
|
|
143
139
|
return { acknowledge: true };
|
|
144
140
|
} finally {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EmbeddedSDK } from "../shared/sdk/embeddedSdk";
|
|
2
|
-
import {
|
|
3
|
-
import { BackendCluster, BackendConfig, BackendController, BackendHook, BackendImport, BackendPipe, BackendPlugin, BackendStorage, BackendVault, BackendOpenApi, InternalLogger, BackendErrors } from "./index";
|
|
2
|
+
import { EventDefinition, JSONObject } from "../../../index";
|
|
3
|
+
import { BackendCluster, BackendConfig, BackendController, BackendHook, BackendImport, BackendPipe, BackendPlugin, BackendStorage, BackendVault, BackendOpenApi, InternalLogger, BackendErrors, BackendSubscription } from "./index";
|
|
4
4
|
export declare class Backend {
|
|
5
5
|
private _kuzzle;
|
|
6
6
|
private _name;
|
|
@@ -51,8 +51,7 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
51
51
|
const kuzzle_1 = __importDefault(require("../../kuzzle"));
|
|
52
52
|
const embeddedSdk_1 = require("../shared/sdk/embeddedSdk");
|
|
53
53
|
const kerror = __importStar(require("../../kerror"));
|
|
54
|
-
const index_1 = require("
|
|
55
|
-
const index_2 = require("./index");
|
|
54
|
+
const index_1 = require("./index");
|
|
56
55
|
const assertionError = kerror.wrap("plugin", "assert");
|
|
57
56
|
const runtimeError = kerror.wrap("plugin", "runtime");
|
|
58
57
|
let _app = null;
|
|
@@ -139,18 +138,18 @@ class Backend {
|
|
|
139
138
|
// Silent if no version can be found
|
|
140
139
|
}
|
|
141
140
|
global.app = this;
|
|
142
|
-
this.pipe = new
|
|
143
|
-
this.hook = new
|
|
144
|
-
this.config = new
|
|
145
|
-
this.vault = new
|
|
146
|
-
this.controller = new
|
|
147
|
-
this.plugin = new
|
|
148
|
-
this.storage = new
|
|
149
|
-
this.import = new
|
|
150
|
-
this.log = new
|
|
151
|
-
this.cluster = new
|
|
152
|
-
this.openApi = new
|
|
153
|
-
this.errors = new
|
|
141
|
+
this.pipe = new index_1.BackendPipe(this);
|
|
142
|
+
this.hook = new index_1.BackendHook(this);
|
|
143
|
+
this.config = new index_1.BackendConfig(this);
|
|
144
|
+
this.vault = new index_1.BackendVault(this);
|
|
145
|
+
this.controller = new index_1.BackendController(this);
|
|
146
|
+
this.plugin = new index_1.BackendPlugin(this);
|
|
147
|
+
this.storage = new index_1.BackendStorage(this);
|
|
148
|
+
this.import = new index_1.BackendImport(this);
|
|
149
|
+
this.log = new index_1.InternalLogger(this);
|
|
150
|
+
this.cluster = new index_1.BackendCluster();
|
|
151
|
+
this.openApi = new index_1.BackendOpenApi(this);
|
|
152
|
+
this.errors = new index_1.BackendErrors(this);
|
|
154
153
|
this.subscription = new index_1.BackendSubscription(this);
|
|
155
154
|
this.kerror = kerror;
|
|
156
155
|
try {
|
|
@@ -339,7 +339,7 @@ class HotelClerk {
|
|
|
339
339
|
// No need to raise an error if the connection does not have room subscriptions
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
|
-
await bluebird_1.default.map(connectionRooms.roomIds, (roomId) => this.unsubscribe(connectionId, roomId, notify).catch(global.kuzzle.log.error));
|
|
342
|
+
await bluebird_1.default.map(connectionRooms.roomIds, (roomId) => this.unsubscribe(connectionId, roomId, notify).catch((error) => global.kuzzle.log.error(error)));
|
|
343
343
|
}
|
|
344
344
|
/**
|
|
345
345
|
* Clear all connections made to this node:
|
package/lib/kuzzle/kuzzle.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ import InternalIndexHandler from "./internalIndexHandler";
|
|
|
14
14
|
import kuzzleStateEnum from "./kuzzleStateEnum";
|
|
15
15
|
import { Logger } from "./Logger";
|
|
16
16
|
import vault from "./vault";
|
|
17
|
-
export declare const BACKEND_IMPORT_KEY = "backend:init:import";
|
|
18
17
|
declare class Kuzzle extends KuzzleEventEmitter {
|
|
19
18
|
config: KuzzleConfiguration;
|
|
20
19
|
private _state;
|
package/lib/kuzzle/kuzzle.js
CHANGED
|
@@ -46,7 +46,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
46
46
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
47
47
|
};
|
|
48
48
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
-
exports.Kuzzle =
|
|
49
|
+
exports.Kuzzle = void 0;
|
|
50
50
|
const path_1 = __importDefault(require("path"));
|
|
51
51
|
const bluebird_1 = __importDefault(require("bluebird"));
|
|
52
52
|
const json_stable_stringify_1 = __importDefault(require("json-stable-stringify"));
|
|
@@ -80,7 +80,6 @@ const internalIndexHandler_1 = __importDefault(require("./internalIndexHandler")
|
|
|
80
80
|
const kuzzleStateEnum_1 = __importDefault(require("./kuzzleStateEnum"));
|
|
81
81
|
const Logger_1 = require("./Logger");
|
|
82
82
|
const vault_1 = __importDefault(require("./vault"));
|
|
83
|
-
exports.BACKEND_IMPORT_KEY = "backend:init:import";
|
|
84
83
|
let _kuzzle = null;
|
|
85
84
|
Reflect.defineProperty(global, "kuzzle", {
|
|
86
85
|
configurable: true,
|
|
@@ -373,7 +372,7 @@ class Kuzzle extends KuzzleEventEmitter_1.default {
|
|
|
373
372
|
const importTypes = Object.keys(this.importTypes);
|
|
374
373
|
for (const importType of importTypes) {
|
|
375
374
|
// If the import is done, we pop it from the queue to check the next one
|
|
376
|
-
if (await this.ask("core:cache:internal:get",
|
|
375
|
+
if (await this.ask("core:cache:internal:get", `backend:init:import:${importType}`)) {
|
|
377
376
|
return;
|
|
378
377
|
}
|
|
379
378
|
await bluebird_1.default.delay(1000);
|
|
@@ -398,24 +397,24 @@ class Kuzzle extends KuzzleEventEmitter_1.default {
|
|
|
398
397
|
this.log.info(`${type} import is not initialized, initializing...`);
|
|
399
398
|
await this.ask("core:storage:private:document:create", "kuzzle", "imports", {
|
|
400
399
|
hash: importPayloadHash,
|
|
401
|
-
}, { id:
|
|
402
|
-
await this.ask("core:cache:internal:store",
|
|
400
|
+
}, { id: `backend:init:import:${type}` });
|
|
401
|
+
await this.ask("core:cache:internal:store", `backend:init:import:${type}`, importPayloadHash);
|
|
403
402
|
}
|
|
404
403
|
else if (existingRedisHash && !existingESHash) {
|
|
405
404
|
// If the import is initialized in the redis cache but not in the ES
|
|
406
405
|
// We initialize it in the ES
|
|
407
406
|
this.log.info(`${type} import is not initialized in %kuzzle.imports, initializing...`);
|
|
408
|
-
const redisCache = await this.ask("core:cache:internal:get",
|
|
407
|
+
const redisCache = await this.ask("core:cache:internal:get", `backend:init:import:${type}`);
|
|
409
408
|
await this.ask("core:storage:private:document:create", "kuzzle", "imports", {
|
|
410
409
|
hash: redisCache,
|
|
411
|
-
}, { id:
|
|
410
|
+
}, { id: `backend:init:import:${type}` });
|
|
412
411
|
}
|
|
413
412
|
else if (!existingRedisHash && existingESHash) {
|
|
414
413
|
// If the import is initialized in the ES but not in the redis cache
|
|
415
414
|
// We initialize it in the redis cache
|
|
416
415
|
this.log.info(`${type} import is not initialized in the redis cache, initializing...`);
|
|
417
|
-
const esDocument = await this.ask("core:storage:private:document:get", "kuzzle", "imports",
|
|
418
|
-
await this.ask("core:cache:internal:store",
|
|
416
|
+
const esDocument = await this.ask("core:storage:private:document:get", "kuzzle", "imports", `backend:init:import:${type}`);
|
|
417
|
+
await this.ask("core:cache:internal:store", `backend:init:import:${type}`, esDocument._source.hash);
|
|
419
418
|
}
|
|
420
419
|
}
|
|
421
420
|
/**
|
|
@@ -451,8 +450,8 @@ class Kuzzle extends KuzzleEventEmitter_1.default {
|
|
|
451
450
|
}
|
|
452
451
|
const importPayloadHash = (0, crypto_1.sha256)((0, json_stable_stringify_1.default)(importPayload));
|
|
453
452
|
const mutex = new mutex_1.Mutex(`backend:import:${type}`, { timeout: 0 });
|
|
454
|
-
const existingRedisHash = await this.ask("core:cache:internal:get",
|
|
455
|
-
const existingESHash = await this.ask("core:storage:private:document:exist", "kuzzle", "imports",
|
|
453
|
+
const existingRedisHash = await this.ask("core:cache:internal:get", `backend:init:import:${type}`);
|
|
454
|
+
const existingESHash = await this.ask("core:storage:private:document:exist", "kuzzle", "imports", `backend:init:import:${type}`);
|
|
456
455
|
let initialized = false;
|
|
457
456
|
if (existingRedisHash) {
|
|
458
457
|
// Check if the import is already initialized inside the redis cache
|
|
@@ -460,7 +459,7 @@ class Kuzzle extends KuzzleEventEmitter_1.default {
|
|
|
460
459
|
}
|
|
461
460
|
else if (existingESHash) {
|
|
462
461
|
// Check if the import is already initialized inside the ES
|
|
463
|
-
const esDocument = await this.ask("core:storage:private:document:get", "kuzzle", "imports",
|
|
462
|
+
const esDocument = await this.ask("core:storage:private:document:get", "kuzzle", "imports", `backend:init:import:${type}`);
|
|
464
463
|
initialized = esDocument._source.hash === importPayloadHash;
|
|
465
464
|
}
|
|
466
465
|
const locked = await mutex.lock();
|
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.43.
|
|
4
|
+
"version": "2.43.2",
|
|
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": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"build": "tsc",
|
|
10
10
|
"clean": "touch index.ts && npm run build | grep TSFILE | cut -d' ' -f 2 | xargs rm",
|
|
11
11
|
"cucumber": "cucumber.js --fail-fast",
|
|
12
|
-
"dev": "
|
|
12
|
+
"dev": "tsx docker/scripts/start-kuzzle-dev.ts",
|
|
13
13
|
"doc-error-codes": "node -r ts-node/register doc/build-error-codes",
|
|
14
14
|
"prepublishOnly": "npm run build",
|
|
15
15
|
"prettier": "prettier ./lib ./test ./features ./plugins/available/functional-test-plugin --write",
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
"bluebird": "3.7.2",
|
|
34
34
|
"cli-color": "2.0.4",
|
|
35
35
|
"cookie": "1.0.2",
|
|
36
|
-
"debug": "4.4.
|
|
36
|
+
"debug": "4.4.1",
|
|
37
37
|
"denque": "2.1.0",
|
|
38
38
|
"didyoumean": "1.2.2",
|
|
39
39
|
"dumpme": "2.0.0",
|
|
40
40
|
"eventemitter3": "5.0.1",
|
|
41
|
-
"inquirer": "12.
|
|
42
|
-
"ioredis": "5.6.
|
|
41
|
+
"inquirer": "12.6.3",
|
|
42
|
+
"ioredis": "5.6.1",
|
|
43
43
|
"js-yaml": "4.1.0",
|
|
44
|
-
"json-stable-stringify": "1.
|
|
44
|
+
"json-stable-stringify": "1.3.0",
|
|
45
45
|
"json2yaml": "1.1.0",
|
|
46
46
|
"jsonwebtoken": "9.0.2",
|
|
47
47
|
"koncorde": "4.6.0",
|
|
@@ -50,57 +50,56 @@
|
|
|
50
50
|
"kuzzle-sdk": ">=7.15.0",
|
|
51
51
|
"kuzzle-vault": "2.1.0",
|
|
52
52
|
"lodash": "4.17.21",
|
|
53
|
-
"long": "5.3.
|
|
53
|
+
"long": "5.3.2",
|
|
54
54
|
"moment": "2.30.1",
|
|
55
55
|
"ms": "2.1.3",
|
|
56
56
|
"murmurhash": "2.0.1",
|
|
57
57
|
"ndjson": "2.0.0",
|
|
58
58
|
"passport": "0.7.0",
|
|
59
|
-
"
|
|
59
|
+
"pino-caller": "4.0.0",
|
|
60
|
+
"pino-elasticsearch": "8.1.0",
|
|
61
|
+
"pino-loki": "2.6.0",
|
|
62
|
+
"pino-pretty": "13.0.0",
|
|
63
|
+
"pino-transport-ecs": "1.1.0",
|
|
64
|
+
"protobufjs": "7.5.3",
|
|
60
65
|
"rc": "1.2.8",
|
|
61
66
|
"sdk-es7": "npm:@elastic/elasticsearch@7.13.0",
|
|
62
67
|
"sdk-es8": "npm:@elastic/elasticsearch@8.17.1",
|
|
63
|
-
"semver": "7.7.
|
|
68
|
+
"semver": "7.7.2",
|
|
64
69
|
"sorted-array": "2.0.4",
|
|
65
70
|
"uuid": "11.1.0",
|
|
66
71
|
"uWebSockets.js": "https://github.com/uNetworking/uWebSockets.js/archive/refs/tags/v20.51.0.tar.gz",
|
|
67
|
-
"validator": "13.
|
|
72
|
+
"validator": "13.15.15",
|
|
68
73
|
"winston": "3.17.0",
|
|
69
74
|
"winston-elasticsearch": "0.19.0",
|
|
70
75
|
"winston-syslog": "2.7.1",
|
|
71
76
|
"winston-transport": "4.9.0",
|
|
72
|
-
"yargs": "
|
|
73
|
-
"zeromq": "6.
|
|
74
|
-
"pino-caller": "3.4.0",
|
|
75
|
-
"pino-elasticsearch": "8.1.0",
|
|
76
|
-
"pino-loki": "2.5.0",
|
|
77
|
-
"pino-pretty": "13.0.0",
|
|
78
|
-
"pino-transport-ecs": "1.1.0"
|
|
77
|
+
"yargs": "18.0.0",
|
|
78
|
+
"zeromq": "6.4.2"
|
|
79
79
|
},
|
|
80
80
|
"repository": {
|
|
81
81
|
"type": "git",
|
|
82
82
|
"url": "git://github.com/kuzzleio/kuzzle.git"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@commitlint/cli": "19.8.
|
|
86
|
-
"@commitlint/config-conventional": "19.8.
|
|
85
|
+
"@commitlint/cli": "19.8.1",
|
|
86
|
+
"@commitlint/config-conventional": "19.8.1",
|
|
87
87
|
"@jest/globals": "29.7.0",
|
|
88
88
|
"@types/bluebird": "3.5.42",
|
|
89
89
|
"@types/cookie": "1.0.0",
|
|
90
90
|
"@types/jest": "29.5.14",
|
|
91
91
|
"@types/js-yaml": "4.0.9",
|
|
92
|
-
"@types/lodash": "4.17.
|
|
92
|
+
"@types/lodash": "4.17.17",
|
|
93
93
|
"@types/mocha": "10.0.10",
|
|
94
94
|
"async": "3.2.6",
|
|
95
95
|
"chokidar": "4.0.3",
|
|
96
96
|
"cucumber": "6.0.7",
|
|
97
97
|
"cz-conventional-changelog": "3.3.0",
|
|
98
|
-
"ergol": "1.0.2",
|
|
99
98
|
"eslint-plugin-kuzzle": "0.0.13",
|
|
100
99
|
"jest": "29.7.0",
|
|
101
|
-
"mocha": "11.
|
|
100
|
+
"mocha": "11.5.0",
|
|
102
101
|
"mock-require": "3.0.3",
|
|
103
|
-
"mqtt": "5.
|
|
102
|
+
"mqtt": "5.13.1",
|
|
104
103
|
"nyc": "17.1.0",
|
|
105
104
|
"request": "2.88.2",
|
|
106
105
|
"request-promise": "4.2.6",
|
|
@@ -108,16 +107,18 @@
|
|
|
108
107
|
"semantic-release-config-kuzzle": "1.1.2",
|
|
109
108
|
"should": "13.2.3",
|
|
110
109
|
"should-sinon": "0.0.6",
|
|
111
|
-
"sinon": "
|
|
110
|
+
"sinon": "20.0.0",
|
|
112
111
|
"strip-json-comments": "https://github.com/sindresorhus/strip-json-comments/archive/refs/tags/v3.1.1.tar.gz",
|
|
113
|
-
"ts-jest": "29.
|
|
112
|
+
"ts-jest": "29.3.4",
|
|
114
113
|
"ts-node": "10.9.2",
|
|
114
|
+
"tsx": "^4.19.4",
|
|
115
115
|
"typescript": "5.3.2",
|
|
116
|
-
"yaml": "2.
|
|
116
|
+
"yaml": "2.8.0"
|
|
117
117
|
},
|
|
118
118
|
"engines": {
|
|
119
119
|
"node": ">=18.0.0 <23.0.0"
|
|
120
120
|
},
|
|
121
|
+
"packageManager": "npm@11.4.1",
|
|
121
122
|
"engineStrict": true,
|
|
122
123
|
"license": "Apache-2.0",
|
|
123
124
|
"files": [
|