kuzzle 2.29.1-beta.1 → 2.29.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/kuzzle/kuzzle.d.ts +133 -0
- package/lib/kuzzle/kuzzle.js +2 -1
- package/lib/types/Global.d.ts +9 -7
- package/lib/types/Global.js +1 -1
- package/package.json +1 -1
package/lib/kuzzle/kuzzle.d.ts
CHANGED
|
@@ -1 +1,134 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import KuzzleEventEmitter from "./event/kuzzleEventEmitter";
|
|
3
|
+
import { InstallationConfig, ImportConfig, SupportConfig, StartOptions } from "./../types/Kuzzle";
|
|
4
|
+
import { KuzzleConfiguration } from "../types/config/KuzzleConfiguration";
|
|
1
5
|
export declare const BACKEND_IMPORT_KEY = "backend:init:import";
|
|
6
|
+
declare class Kuzzle extends KuzzleEventEmitter {
|
|
7
|
+
private config;
|
|
8
|
+
private _state;
|
|
9
|
+
private log;
|
|
10
|
+
private rootPath;
|
|
11
|
+
/**
|
|
12
|
+
* Internal index bootstrapper and accessor
|
|
13
|
+
*/
|
|
14
|
+
private internalIndex;
|
|
15
|
+
private pluginsManager;
|
|
16
|
+
private tokenManager;
|
|
17
|
+
private passport;
|
|
18
|
+
/**
|
|
19
|
+
* The funnel dispatches messages to API controllers
|
|
20
|
+
*/
|
|
21
|
+
private funnel;
|
|
22
|
+
/**
|
|
23
|
+
* The router listens to client requests and pass them to the funnel
|
|
24
|
+
*/
|
|
25
|
+
private router;
|
|
26
|
+
/**
|
|
27
|
+
* Statistics core component
|
|
28
|
+
*/
|
|
29
|
+
private statistics;
|
|
30
|
+
/**
|
|
31
|
+
* Network entry point
|
|
32
|
+
*/
|
|
33
|
+
private entryPoint;
|
|
34
|
+
/**
|
|
35
|
+
* Validation core component
|
|
36
|
+
*/
|
|
37
|
+
private validation;
|
|
38
|
+
/**
|
|
39
|
+
* Dump generator
|
|
40
|
+
*/
|
|
41
|
+
private dumpGenerator;
|
|
42
|
+
/**
|
|
43
|
+
* Vault component (will be initialized after bootstrap)
|
|
44
|
+
*/
|
|
45
|
+
private vault;
|
|
46
|
+
/**
|
|
47
|
+
* AsyncLocalStorage wrapper
|
|
48
|
+
*/
|
|
49
|
+
private asyncStore;
|
|
50
|
+
/**
|
|
51
|
+
* Kuzzle internal debugger
|
|
52
|
+
*/
|
|
53
|
+
private debugger;
|
|
54
|
+
/**
|
|
55
|
+
* Kuzzle version
|
|
56
|
+
*/
|
|
57
|
+
private version;
|
|
58
|
+
private openApiManager;
|
|
59
|
+
/**
|
|
60
|
+
* List of differents imports types and their associated method
|
|
61
|
+
*/
|
|
62
|
+
private importTypes;
|
|
63
|
+
private koncorde;
|
|
64
|
+
private secret;
|
|
65
|
+
/**
|
|
66
|
+
* Node unique ID amongst other cluster nodes
|
|
67
|
+
*/
|
|
68
|
+
id: string;
|
|
69
|
+
constructor(config: KuzzleConfiguration);
|
|
70
|
+
/**
|
|
71
|
+
* Initializes all the needed components of Kuzzle.
|
|
72
|
+
*
|
|
73
|
+
* @param {Application} - Application Plugin instance
|
|
74
|
+
* @param {Object} - Additional options (import, installations, plugins, secretsFile, support, vaultKey)
|
|
75
|
+
*
|
|
76
|
+
* @this {Kuzzle}
|
|
77
|
+
*/
|
|
78
|
+
start(application: any, options?: StartOptions): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Generates the node ID.
|
|
81
|
+
*
|
|
82
|
+
* This will init the cluster if it's enabled.
|
|
83
|
+
*/
|
|
84
|
+
private initKuzzleNode;
|
|
85
|
+
/**
|
|
86
|
+
* Gracefully exits after processing remaining requests
|
|
87
|
+
*
|
|
88
|
+
* @returns {Promise}
|
|
89
|
+
*/
|
|
90
|
+
shutdown(): Promise<void>;
|
|
91
|
+
/**
|
|
92
|
+
* Execute multiple handlers only once on any given environment
|
|
93
|
+
*
|
|
94
|
+
* @param {Array<{ id: string, handler: () => void, description?: string }>} installations - Array of unique methods to execute
|
|
95
|
+
*
|
|
96
|
+
* @returns {Promise<void>}
|
|
97
|
+
*/
|
|
98
|
+
install(installations: InstallationConfig[]): Promise<void>;
|
|
99
|
+
ask(...args: any[]): Promise<any>;
|
|
100
|
+
emit(...args: any[]): Promise<any>;
|
|
101
|
+
pipe(...args: any[]): Promise<any>;
|
|
102
|
+
private importUserMappings;
|
|
103
|
+
private importMappings;
|
|
104
|
+
private importFixtures;
|
|
105
|
+
private importPermissions;
|
|
106
|
+
/**
|
|
107
|
+
* Check if every import has been done, if one of them is not finished yet, wait for it
|
|
108
|
+
*/
|
|
109
|
+
private _waitForImportToFinish;
|
|
110
|
+
private isConfigsEmpty;
|
|
111
|
+
private persistHashedImport;
|
|
112
|
+
/**
|
|
113
|
+
* Load into the app several imports
|
|
114
|
+
*
|
|
115
|
+
* @param {Object} toImport - Contains `mappings`, `onExistingUsers`, `profiles`, `roles`, `userMappings`, `users`
|
|
116
|
+
* @param {Object} toSupport - Contains `fixtures`, `mappings`, `securities` (`profiles`, `roles`, `users`)
|
|
117
|
+
*
|
|
118
|
+
* @returns {Promise<void>}
|
|
119
|
+
*/
|
|
120
|
+
loadInitialState(toImport?: ImportConfig, toSupport?: SupportConfig): Promise<void>;
|
|
121
|
+
dump(suffix: any): any;
|
|
122
|
+
hash(input: any): string | Buffer;
|
|
123
|
+
get state(): kuzzleStateEnum;
|
|
124
|
+
set state(value: kuzzleStateEnum);
|
|
125
|
+
/**
|
|
126
|
+
* Register handlers and do a kuzzle dump for:
|
|
127
|
+
* - system signals
|
|
128
|
+
* - unhandled-rejection
|
|
129
|
+
* - uncaught-exception
|
|
130
|
+
*/
|
|
131
|
+
registerSignalHandlers(): void;
|
|
132
|
+
dumpAndExit(suffix: any): Promise<void>;
|
|
133
|
+
}
|
|
134
|
+
export { Kuzzle };
|
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.BACKEND_IMPORT_KEY = void 0;
|
|
49
|
+
exports.Kuzzle = exports.BACKEND_IMPORT_KEY = void 0;
|
|
50
50
|
const path_1 = __importDefault(require("path"));
|
|
51
51
|
const murmurhash_native_1 = require("murmurhash-native");
|
|
52
52
|
const json_stable_stringify_1 = __importDefault(require("json-stable-stringify"));
|
|
@@ -583,5 +583,6 @@ class Kuzzle extends kuzzleEventEmitter_1.default {
|
|
|
583
583
|
await this.shutdown();
|
|
584
584
|
}
|
|
585
585
|
}
|
|
586
|
+
exports.Kuzzle = Kuzzle;
|
|
586
587
|
module.exports = Kuzzle;
|
|
587
588
|
//# sourceMappingURL=kuzzle.js.map
|
package/lib/types/Global.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { Backend } from "../core/backend";
|
|
2
|
+
import { Kuzzle } from "../kuzzle";
|
|
3
|
+
/**
|
|
4
|
+
* This file contains global type declarations for Kuzzle.
|
|
5
|
+
* We need to use `var` so Typescript extends the globalThis type.
|
|
6
|
+
* See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#type-checking-for-globalthis
|
|
7
|
+
*/
|
|
2
8
|
declare global {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
app: Backend;
|
|
7
|
-
NODE_ENV: string;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
9
|
+
var app: Backend;
|
|
10
|
+
var kuzzle: Kuzzle;
|
|
11
|
+
var NODE_ENV: string;
|
|
10
12
|
}
|
|
11
13
|
export {};
|
package/lib/types/Global.js
CHANGED
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.1
|
|
4
|
+
"version": "2.29.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": {
|