kuzzle 2.27.3 → 2.28.0

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.
@@ -123,7 +123,7 @@ class ClusterIdCardHandler {
123
123
  });
124
124
  // Transfer informations to the worker
125
125
  this.refreshWorker.send({
126
- action: "start",
126
+ action: "start", // start the worker
127
127
  kuzzle: {
128
128
  config: global.kuzzle.config,
129
129
  id: global.kuzzle.id,
@@ -316,7 +316,7 @@ class ClusterNode {
316
316
  global.kuzzle.log.error(error.stack);
317
317
  }
318
318
 
319
- await this.publisher.sendNodeEvicted(this.nodeId, this.nodeId, reason);
319
+ this.publisher.sendNodeEvicted(this.nodeId, this.nodeId, reason);
320
320
 
321
321
  this.shutdownNode();
322
322
  }
@@ -332,6 +332,9 @@ class ClusterNode {
332
332
  const subscriber = this.remoteNodes.get(nodeId);
333
333
 
334
334
  if (!subscriber) {
335
+ global.kuzzle.log.warn(
336
+ `[CLUSTER] Node "${nodeId}" with no subscriber evicted. Reason: ${reason}`,
337
+ );
335
338
  return;
336
339
  }
337
340
 
@@ -351,7 +354,7 @@ class ClusterNode {
351
354
  subscriber.dispose();
352
355
 
353
356
  if (broadcast) {
354
- await this.publisher.sendNodeEvicted(this.nodeId, nodeId, reason);
357
+ this.publisher.sendNodeEvicted(this.nodeId, nodeId, reason);
355
358
  }
356
359
 
357
360
  if (this.countActiveNodes() < this.config.minimumNodes) {
@@ -477,9 +480,6 @@ class ClusterNode {
477
480
  this.shutdownNode();
478
481
  return;
479
482
  }
480
-
481
- // Rerun the cluster consistency check
482
- await this.enforceClusterConsistency();
483
483
  } catch (err) {
484
484
  global.kuzzle.log.error(
485
485
  "[CLUSTER] Unexpected exception caught during a cluster consistency check. Shutting down...",
@@ -165,13 +165,12 @@ class Backend {
165
165
  * Starts the Kuzzle application with the defined features
166
166
  */
167
167
  async start() {
168
- var _a;
169
168
  if (this.started) {
170
169
  throw runtimeError.get("already_started", "start");
171
170
  }
172
171
  this._kuzzle = new kuzzle_1.default(this.config.content);
173
172
  for (const plugin of this.config.content.plugins.common.include) {
174
- const { default: PluginClass } = await (_a = plugin, Promise.resolve().then(() => __importStar(require(_a))));
173
+ const { default: PluginClass } = await Promise.resolve(`${plugin}`).then(s => __importStar(require(s)));
175
174
  this.plugin.use(new PluginClass(), {
176
175
  deprecationWarning: false,
177
176
  name: plugin,
@@ -189,7 +188,7 @@ class Backend {
189
188
  installations: this._installationsWaitingList,
190
189
  plugins: this._plugins,
191
190
  secretsFile: this._secretsFile,
192
- support: this._support,
191
+ support: this._support, // NOSONAR
193
192
  vaultKey: this._vaultKey,
194
193
  };
195
194
  await this._kuzzle.start(application, options);
@@ -23,7 +23,7 @@
23
23
 
24
24
  const net = require("net");
25
25
 
26
- const aedes = require("aedes");
26
+ const Aedes = require("aedes");
27
27
 
28
28
  const ClientConnection = require("../clientConnection");
29
29
  const Protocol = require("./protocol");
@@ -39,7 +39,8 @@ class MqttProtocol extends Protocol {
39
39
  constructor() {
40
40
  super("mqtt");
41
41
 
42
- this.aedes = new aedes.Server();
42
+ // eslint-disable-next-line new-cap
43
+ this.aedes = new Aedes.Server();
43
44
  this.server = net.createServer(this.aedes.handle);
44
45
 
45
46
  this.connections = new Map();
@@ -68,8 +68,8 @@ class ProfileRepository extends repository_1.Repository {
68
68
  });
69
69
  this.module = securityModule;
70
70
  this.profiles = new Map();
71
- super.collection = "profiles";
72
- super.ObjectConstructor = profile_1.Profile;
71
+ this.collection = "profiles";
72
+ this.ObjectConstructor = profile_1.Profile;
73
73
  }
74
74
  init() {
75
75
  /**
@@ -304,7 +304,7 @@ class Kuzzle extends kuzzleEventEmitter_1.default {
304
304
  * we just want to load the mapping in our own index cache and not in the database.
305
305
  */
306
306
  indexCacheOnly: status.initialized || !status.locked,
307
- propagate: false,
307
+ propagate: false, // Each node needs to do the import themselves
308
308
  rawMappings: true,
309
309
  refresh: true,
310
310
  });
@@ -317,7 +317,7 @@ class Kuzzle extends kuzzleEventEmitter_1.default {
317
317
  * we just want to load the mapping in our own index cache and not in the database.
318
318
  */
319
319
  indexCacheOnly: status.initialized || !status.locked,
320
- propagate: false,
320
+ propagate: false, // Each node needs to do the import themselves
321
321
  refresh: true,
322
322
  });
323
323
  this.log.info("[✔] Mappings import successful");
@@ -25,7 +25,7 @@ export declare function flattenObject(target: JSONObject): JSONObject;
25
25
  * @param mapping
26
26
  * @returns
27
27
  */
28
- export declare function extractMappingFields(mapping: JSONObject): any;
28
+ export declare function extractMappingFields(mapping: JSONObject): {};
29
29
  /**
30
30
  * An iteration-order-safe version of lodash.values
31
31
  *
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.27.3",
4
+ "version": "2.28.0",
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": {
@@ -35,18 +35,18 @@
35
35
  "aedes": "0.46.3",
36
36
  "bluebird": "3.7.2",
37
37
  "cli-color": "2.0.3",
38
- "cookie": "0.5.0",
38
+ "cookie": "0.6.0",
39
39
  "debug": "4.3.4",
40
40
  "denque": "2.1.0",
41
41
  "didyoumean": "1.2.2",
42
42
  "dumpme": "1.0.3",
43
- "eventemitter3": "4.0.7",
43
+ "eventemitter3": "5.0.1",
44
44
  "inquirer": "9.2.12",
45
45
  "ioredis": "5.3.2",
46
46
  "js-yaml": "4.1.0",
47
- "json-stable-stringify": "1.0.2",
47
+ "json-stable-stringify": "1.1.0",
48
48
  "json2yaml": "1.1.0",
49
- "jsonwebtoken": "8.5.1",
49
+ "jsonwebtoken": "9.0.2",
50
50
  "koncorde": "4.3.0",
51
51
  "kuzzle-plugin-auth-passport-local": "6.4.0",
52
52
  "kuzzle-plugin-logger": "3.0.3",
@@ -59,8 +59,7 @@
59
59
  "murmurhash-native": "3.5.0",
60
60
  "ndjson": "2.0.0",
61
61
  "node-segfault-handler": "1.4.2",
62
- "npm": "^10.2.4",
63
- "passport": "0.6.0",
62
+ "passport": "0.7.0",
64
63
  "protobufjs": "7.2.5",
65
64
  "rc": "1.2.8",
66
65
  "semver": "7.5.4",
@@ -80,11 +79,11 @@
80
79
  "url": "git://github.com/kuzzleio/kuzzle.git"
81
80
  },
82
81
  "devDependencies": {
83
- "@jest/globals": "29.4.1",
84
- "@types/jest": "29.4.0",
85
- "@types/js-yaml": "4.0.5",
86
- "@types/lodash": "4.14.191",
87
- "async": "3.2.4",
82
+ "@jest/globals": "29.7.0",
83
+ "@types/jest": "29.5.10",
84
+ "@types/js-yaml": "4.0.9",
85
+ "@types/lodash": "4.14.202",
86
+ "async": "3.2.5",
88
87
  "chokidar": "3.5.3",
89
88
  "codecov": "3.8.3",
90
89
  "cucumber": "6.0.5",
@@ -93,7 +92,7 @@
93
92
  "jest": "29.7.0",
94
93
  "mocha": "10.2.0",
95
94
  "mock-require": "3.0.3",
96
- "mqtt": "4.3.7",
95
+ "mqtt": "5.3.0",
97
96
  "nyc": "15.1.0",
98
97
  "request": "2.88.2",
99
98
  "request-promise": "4.2.6",
@@ -104,8 +103,8 @@
104
103
  "strip-json-comments": "https://github.com/sindresorhus/strip-json-comments/archive/refs/tags/v3.1.1.tar.gz",
105
104
  "ts-jest": "29.1.1",
106
105
  "ts-node": "10.9.1",
107
- "typescript": "4.9.5",
108
- "yaml": "2.2.1"
106
+ "typescript": "5.3.2",
107
+ "yaml": "2.3.4"
109
108
  },
110
109
  "engines": {
111
110
  "node": ">= 12.13.0"