kuzzle 2.43.0 → 2.43.2-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/LICENSE.md CHANGED
@@ -176,7 +176,7 @@
176
176
 
177
177
  END OF TERMS AND CONDITIONS
178
178
 
179
- Copyright 2015-2018 Kuzzle
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.
@@ -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
- `${BACKEND_IMPORT_KEY}:permissions`,
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 { BackendSubscription, EventDefinition, JSONObject } from "../../../index";
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("../../../index");
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 index_2.BackendPipe(this);
143
- this.hook = new index_2.BackendHook(this);
144
- this.config = new index_2.BackendConfig(this);
145
- this.vault = new index_2.BackendVault(this);
146
- this.controller = new index_2.BackendController(this);
147
- this.plugin = new index_2.BackendPlugin(this);
148
- this.storage = new index_2.BackendStorage(this);
149
- this.import = new index_2.BackendImport(this);
150
- this.log = new index_2.InternalLogger(this);
151
- this.cluster = new index_2.BackendCluster();
152
- this.openApi = new index_2.BackendOpenApi(this);
153
- this.errors = new index_2.BackendErrors(this);
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:
@@ -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;
@@ -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 = exports.BACKEND_IMPORT_KEY = void 0;
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", `${exports.BACKEND_IMPORT_KEY}:${importType}`)) {
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: `${exports.BACKEND_IMPORT_KEY}:${type}` });
402
- await this.ask("core:cache:internal:store", `${exports.BACKEND_IMPORT_KEY}:${type}`, importPayloadHash);
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", `${exports.BACKEND_IMPORT_KEY}:${type}`);
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: `${exports.BACKEND_IMPORT_KEY}:${type}` });
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", `${exports.BACKEND_IMPORT_KEY}:${type}`);
418
- await this.ask("core:cache:internal:store", `${exports.BACKEND_IMPORT_KEY}:${type}`, esDocument._source.hash);
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", `${exports.BACKEND_IMPORT_KEY}:${type}`);
455
- const existingESHash = await this.ask("core:storage:private:document:exist", "kuzzle", "imports", `${exports.BACKEND_IMPORT_KEY}:${type}`);
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", `${exports.BACKEND_IMPORT_KEY}:${type}`);
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.0",
4
+ "version": "2.43.2-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": {
@@ -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": "ergol docker/scripts/start-kuzzle-dev.ts -c ./config/ergol.config.json",
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,91 +33,92 @@
33
33
  "bluebird": "3.7.2",
34
34
  "cli-color": "2.0.4",
35
35
  "cookie": "1.0.2",
36
- "debug": "4.4.0",
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.4.3",
42
- "ioredis": "5.6.0",
41
+ "inquirer": "12.6.3",
42
+ "ioredis": "5.6.1",
43
43
  "js-yaml": "4.1.0",
44
- "json-stable-stringify": "1.2.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",
48
- "kuzzle-logger": "^1.2.0",
48
+ "kuzzle-logger": "1.2.0",
49
49
  "kuzzle-plugin-auth-passport-local": "6.4.1",
50
- "kuzzle-sdk": "^7.15.0",
50
+ "kuzzle-sdk": ">=7.15.0",
51
51
  "kuzzle-vault": "2.1.0",
52
52
  "lodash": "4.17.21",
53
- "long": "5.3.1",
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
- "protobufjs": "7.4.0",
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.1",
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.12.0",
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": "17.7.2",
73
- "zeromq": "6.3.0"
77
+ "yargs": "18.0.0",
78
+ "zeromq": "6.4.2"
74
79
  },
75
80
  "repository": {
76
81
  "type": "git",
77
82
  "url": "git://github.com/kuzzleio/kuzzle.git"
78
83
  },
79
84
  "devDependencies": {
80
- "@commitlint/cli": "19.8.0",
81
- "@commitlint/config-conventional": "19.8.0",
85
+ "@commitlint/cli": "19.8.1",
86
+ "@commitlint/config-conventional": "19.8.1",
82
87
  "@jest/globals": "29.7.0",
83
88
  "@types/bluebird": "3.5.42",
84
89
  "@types/cookie": "1.0.0",
85
90
  "@types/jest": "29.5.14",
86
91
  "@types/js-yaml": "4.0.9",
87
- "@types/lodash": "4.17.16",
88
- "@types/mocha": "^10.0.10",
92
+ "@types/lodash": "4.17.17",
93
+ "@types/mocha": "10.0.10",
89
94
  "async": "3.2.6",
90
95
  "chokidar": "4.0.3",
91
96
  "cucumber": "6.0.7",
92
97
  "cz-conventional-changelog": "3.3.0",
93
- "ergol": "1.0.2",
94
98
  "eslint-plugin-kuzzle": "0.0.13",
95
99
  "jest": "29.7.0",
96
- "mocha": "11.1.0",
100
+ "mocha": "11.5.0",
97
101
  "mock-require": "3.0.3",
98
- "mqtt": "5.10.4",
102
+ "mqtt": "5.13.1",
99
103
  "nyc": "17.1.0",
100
- "pino-caller": "^3.4.0",
101
- "pino-elasticsearch": "^8.1.0",
102
- "pino-loki": "^2.5.0",
103
- "pino-pretty": "^13.0.0",
104
- "pino-transport-ecs": "^1.1.0",
105
104
  "request": "2.88.2",
106
105
  "request-promise": "4.2.6",
107
106
  "rewire": "5.0.0",
108
107
  "semantic-release-config-kuzzle": "1.1.2",
109
108
  "should": "13.2.3",
110
109
  "should-sinon": "0.0.6",
111
- "sinon": "19.0.2",
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.2.6",
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.7.0"
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": [