kuzzle 2.32.0 → 2.33.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.
@@ -12,6 +12,7 @@ import AsyncStore from "../util/asyncStore";
12
12
  import { ImportConfig, InstallationConfig, StartOptions, SupportConfig } from "./../types/Kuzzle";
13
13
  import KuzzleEventEmitter from "./event/KuzzleEventEmitter";
14
14
  import InternalIndexHandler from "./internalIndexHandler";
15
+ import kuzzleStateEnum from "./kuzzleStateEnum";
15
16
  import Logger from "./log";
16
17
  import vault from "./vault";
17
18
  export declare const BACKEND_IMPORT_KEY = "backend:init:import";
@@ -46,7 +47,7 @@ declare class Kuzzle extends KuzzleEventEmitter {
46
47
  /**
47
48
  * Validation core component
48
49
  */
49
- validation: Validation;
50
+ validation: typeof Validation;
50
51
  /**
51
52
  * Dump generator
52
53
  */
@@ -54,7 +55,7 @@ declare class Kuzzle extends KuzzleEventEmitter {
54
55
  /**
55
56
  * Vault component (will be initialized after bootstrap)
56
57
  */
57
- vault: vault;
58
+ vault: typeof vault;
58
59
  /**
59
60
  * AsyncLocalStorage wrapper
60
61
  */
@@ -132,8 +133,8 @@ declare class Kuzzle extends KuzzleEventEmitter {
132
133
  loadInitialState(toImport?: ImportConfig, toSupport?: SupportConfig): Promise<void>;
133
134
  dump(suffix: any): any;
134
135
  hash(input: any): string | Buffer;
135
- get state(): kuzzleStateEnum;
136
- set state(value: kuzzleStateEnum);
136
+ get state(): typeof kuzzleStateEnum;
137
+ set state(value: typeof kuzzleStateEnum);
137
138
  /**
138
139
  * Register handlers and do a kuzzle dump for:
139
140
  * - system signals
@@ -1,10 +1,10 @@
1
1
  import _ from "lodash";
2
- import { RequestParams, Client } from "sdk-es7";
2
+ import { Client, RequestParams } from "sdk-es7";
3
3
  import { TypeMapping } from "sdk-es7/api/types";
4
4
  import { JSONObject, KRequestBody, KRequestParams } from "../../../types/storage/7/Elasticsearch";
5
- import ESWrapper from "./esWrapper";
6
- import { QueryTranslator } from "../commons/queryTranslator";
7
5
  import { storeScopeEnum } from "../../../core/storage/storeScopeEnum";
6
+ import { QueryTranslator } from "../commons/queryTranslator";
7
+ import ESWrapper from "./esWrapper";
8
8
  /**
9
9
  * @param {Kuzzle} kuzzle kuzzle instance
10
10
  * @param {Object} config Service configuration
@@ -459,8 +459,9 @@ export declare class ES7 {
459
459
  *
460
460
  * @returns {Promise}
461
461
  */
462
- updateCollection(index: string, collection: string, { mappings, settings, }?: {
462
+ updateCollection(index: string, collection: string, { mappings, reindexCollection, settings, }?: {
463
463
  mappings?: TypeMapping;
464
+ reindexCollection?: boolean;
464
465
  settings?: Record<string, any>;
465
466
  }): Promise<any>;
466
467
  /**
@@ -54,16 +54,16 @@ const bluebird_1 = __importDefault(require("bluebird"));
54
54
  const ms_1 = __importDefault(require("ms"));
55
55
  const semver_1 = __importDefault(require("semver"));
56
56
  const debug_1 = __importDefault(require("../../../util/debug"));
57
- const esWrapper_1 = __importDefault(require("./esWrapper"));
58
- const queryTranslator_1 = require("../commons/queryTranslator");
59
- const didYouMean_1 = __importDefault(require("../../../util/didYouMean"));
57
+ const storeScopeEnum_1 = require("../../../core/storage/storeScopeEnum");
60
58
  const kerror = __importStar(require("../../../kerror"));
61
- const requestAssertions_1 = require("../../../util/requestAssertions");
62
- const safeObject_1 = require("../../../util/safeObject");
59
+ const didYouMean_1 = __importDefault(require("../../../util/didYouMean"));
63
60
  const extractFields_1 = __importDefault(require("../../../util/extractFields"));
64
61
  const mutex_1 = require("../../../util/mutex");
65
62
  const name_generator_1 = require("../../../util/name-generator");
66
- const storeScopeEnum_1 = require("../../../core/storage/storeScopeEnum");
63
+ const requestAssertions_1 = require("../../../util/requestAssertions");
64
+ const safeObject_1 = require("../../../util/safeObject");
65
+ const queryTranslator_1 = require("../commons/queryTranslator");
66
+ const esWrapper_1 = __importDefault(require("./esWrapper"));
67
67
  (0, debug_1.default)("kuzzle:services:elasticsearch");
68
68
  const SCROLL_CACHE_PREFIX = "_docscroll_";
69
69
  const ROOT_MAPPING_PROPERTIES = [
@@ -1210,7 +1210,7 @@ class ES7 {
1210
1210
  *
1211
1211
  * @returns {Promise}
1212
1212
  */
1213
- async updateCollection(index, collection, { mappings = {}, settings = {}, } = {}) {
1213
+ async updateCollection(index, collection, { mappings = {}, reindexCollection = false, settings = {}, } = {}) {
1214
1214
  const esRequest = {
1215
1215
  index: await this._getIndice(index, collection),
1216
1216
  };
@@ -1234,7 +1234,8 @@ class ES7 {
1234
1234
  includeKuzzleMeta: true,
1235
1235
  });
1236
1236
  await this.updateMapping(index, collection, mappings);
1237
- if (this._dynamicChanges(previousMappings, mappings)) {
1237
+ if (reindexCollection ||
1238
+ this._dynamicChanges(previousMappings, mappings)) {
1238
1239
  await this.updateSearchIndex(index, collection);
1239
1240
  }
1240
1241
  }
@@ -1,9 +1,9 @@
1
1
  import _ from "lodash";
2
2
  import { Client, estypes } from "sdk-es8";
3
3
  import { InfoResult, JSONObject, KRequestBody, KRequestParams, KStats, KUpdateResponse } from "../../../types/storage/8/Elasticsearch";
4
- import ESWrapper from "./esWrapper";
5
- import { QueryTranslator } from "../commons/queryTranslator";
6
4
  import { storeScopeEnum } from "../../../core/storage/storeScopeEnum";
5
+ import { QueryTranslator } from "../commons/queryTranslator";
6
+ import ESWrapper from "./esWrapper";
7
7
  /**
8
8
  * @param {Kuzzle} kuzzle kuzzle instance
9
9
  * @param {Object} config Service configuration
@@ -454,8 +454,9 @@ export declare class ES8 {
454
454
  *
455
455
  * @returns {Promise}
456
456
  */
457
- updateCollection(index: string, collection: string, { mappings, settings, }?: {
457
+ updateCollection(index: string, collection: string, { mappings, reindexCollection, settings, }?: {
458
458
  mappings?: estypes.MappingTypeMapping;
459
+ reindexCollection?: boolean;
459
460
  settings?: Record<string, any>;
460
461
  }): Promise<any>;
461
462
  /**
@@ -50,20 +50,20 @@ exports.ES8 = void 0;
50
50
  const lodash_1 = __importDefault(require("lodash"));
51
51
  const sdk_es8_1 = require("sdk-es8");
52
52
  const assert_1 = __importDefault(require("assert"));
53
- const ms_1 = __importDefault(require("ms"));
54
53
  const bluebird_1 = __importDefault(require("bluebird"));
54
+ const ms_1 = __importDefault(require("ms"));
55
55
  const semver_1 = __importDefault(require("semver"));
56
+ const storeScopeEnum_1 = require("../../../core/storage/storeScopeEnum");
57
+ const kerror = __importStar(require("../../../kerror"));
56
58
  const debug_1 = __importDefault(require("../../../util/debug"));
57
- const esWrapper_1 = __importDefault(require("./esWrapper"));
58
- const queryTranslator_1 = require("../commons/queryTranslator");
59
59
  const didYouMean_1 = __importDefault(require("../../../util/didYouMean"));
60
- const kerror = __importStar(require("../../../kerror"));
61
- const requestAssertions_1 = require("../../../util/requestAssertions");
62
- const safeObject_1 = require("../../../util/safeObject");
63
- const storeScopeEnum_1 = require("../../../core/storage/storeScopeEnum");
64
60
  const extractFields_1 = __importDefault(require("../../../util/extractFields"));
65
61
  const mutex_1 = require("../../../util/mutex");
66
62
  const name_generator_1 = require("../../../util/name-generator");
63
+ const requestAssertions_1 = require("../../../util/requestAssertions");
64
+ const safeObject_1 = require("../../../util/safeObject");
65
+ const queryTranslator_1 = require("../commons/queryTranslator");
66
+ const esWrapper_1 = __importDefault(require("./esWrapper"));
67
67
  (0, debug_1.default)("kuzzle:services:elasticsearch");
68
68
  const SCROLL_CACHE_PREFIX = "_docscroll_";
69
69
  const ROOT_MAPPING_PROPERTIES = [
@@ -1211,7 +1211,7 @@ class ES8 {
1211
1211
  *
1212
1212
  * @returns {Promise}
1213
1213
  */
1214
- async updateCollection(index, collection, { mappings = {}, settings = {}, } = {}) {
1214
+ async updateCollection(index, collection, { mappings = {}, reindexCollection = false, settings = {}, } = {}) {
1215
1215
  const esRequest = {
1216
1216
  index: await this._getIndice(index, collection),
1217
1217
  };
@@ -1235,7 +1235,8 @@ class ES8 {
1235
1235
  includeKuzzleMeta: true,
1236
1236
  });
1237
1237
  await this.updateMapping(index, collection, mappings);
1238
- if (this._dynamicChanges(previousMappings, mappings)) {
1238
+ if (reindexCollection ||
1239
+ this._dynamicChanges(previousMappings, mappings)) {
1239
1240
  await this.updateSearchIndex(index, collection);
1240
1241
  }
1241
1242
  }
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.32.0",
4
+ "version": "2.33.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": {
@@ -46,7 +46,7 @@
46
46
  "koncorde": "4.3.0",
47
47
  "kuzzle-plugin-auth-passport-local": "6.4.1",
48
48
  "kuzzle-plugin-logger": "3.0.3",
49
- "kuzzle-sdk": "^7.11.3",
49
+ "kuzzle-sdk": "^7.13.0",
50
50
  "kuzzle-vault": "2.0.4",
51
51
  "lodash": "4.17.21",
52
52
  "long": "5.2.3",
@@ -58,7 +58,7 @@
58
58
  "passport": "0.7.0",
59
59
  "protobufjs": "7.2.5",
60
60
  "rc": "1.2.8",
61
- "sdk-es7": "https://github.com/elastic/elasticsearch-js/archive/refs/tags/v7.13.0.tar.gz",
61
+ "sdk-es7": "npm:@elastic/elasticsearch@7.13.0",
62
62
  "sdk-es8": "npm:@elastic/elasticsearch@8.12.1",
63
63
  "semver": "7.6.0",
64
64
  "sorted-array": "2.0.4",