kuzzle 2.35.3 → 2.36.0-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.
|
@@ -462,6 +462,11 @@ const defaultConfig = {
|
|
|
462
462
|
},
|
|
463
463
|
/** @type {DocumentSpecification} */
|
|
464
464
|
validation: {},
|
|
465
|
+
controllers: {
|
|
466
|
+
definition: {
|
|
467
|
+
allowAdditionalActionProperties: false,
|
|
468
|
+
},
|
|
469
|
+
},
|
|
465
470
|
};
|
|
466
471
|
exports.default = defaultConfig;
|
|
467
472
|
//# sourceMappingURL=default.config.js.map
|
|
@@ -333,19 +333,23 @@ class Plugin {
|
|
|
333
333
|
for (const [action, actionDefinition] of Object.entries(
|
|
334
334
|
definition.actions,
|
|
335
335
|
)) {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
actionProperties.
|
|
341
|
-
|
|
342
|
-
throw assertionError.get(
|
|
343
|
-
"invalid_controller_definition",
|
|
344
|
-
name,
|
|
345
|
-
`action "${action}" has invalid properties: ${actionProperties.join(
|
|
346
|
-
", ",
|
|
347
|
-
)}`,
|
|
336
|
+
if (
|
|
337
|
+
!global.app.config.content.controllers.definition
|
|
338
|
+
.allowAdditionalActionProperties
|
|
339
|
+
) {
|
|
340
|
+
const actionProperties = Object.keys(actionDefinition).filter(
|
|
341
|
+
(prop) => prop !== "handler" && prop !== "http",
|
|
348
342
|
);
|
|
343
|
+
|
|
344
|
+
if (actionProperties.length > 0) {
|
|
345
|
+
throw assertionError.get(
|
|
346
|
+
"invalid_controller_definition",
|
|
347
|
+
name,
|
|
348
|
+
`action "${action}" has invalid properties: ${actionProperties.join(
|
|
349
|
+
", ",
|
|
350
|
+
)}`,
|
|
351
|
+
);
|
|
352
|
+
}
|
|
349
353
|
}
|
|
350
354
|
|
|
351
355
|
if (typeof action !== "string") {
|
package/lib/kuzzle/kuzzle.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { Koncorde } from "koncorde";
|
|
3
2
|
import Funnel from "../api/funnel";
|
|
4
3
|
import PassportWrapper from "../core/auth/passportWrapper";
|
|
@@ -132,7 +131,7 @@ declare class Kuzzle extends KuzzleEventEmitter {
|
|
|
132
131
|
*/
|
|
133
132
|
loadInitialState(toImport?: ImportConfig, toSupport?: SupportConfig): Promise<void>;
|
|
134
133
|
dump(suffix: any): any;
|
|
135
|
-
hash(input: any):
|
|
134
|
+
hash(input: any): number;
|
|
136
135
|
get state(): typeof kuzzleStateEnum;
|
|
137
136
|
set state(value: typeof kuzzleStateEnum);
|
|
138
137
|
/**
|
package/lib/kuzzle/kuzzle.js
CHANGED
|
@@ -52,7 +52,7 @@ const bluebird_1 = __importDefault(require("bluebird"));
|
|
|
52
52
|
const json_stable_stringify_1 = __importDefault(require("json-stable-stringify"));
|
|
53
53
|
const koncorde_1 = require("koncorde");
|
|
54
54
|
const lodash_1 = __importDefault(require("lodash"));
|
|
55
|
-
const
|
|
55
|
+
const murmurhash_1 = __importDefault(require("murmurhash"));
|
|
56
56
|
const node_segfault_handler_1 = __importDefault(require("node-segfault-handler"));
|
|
57
57
|
const package_json_1 = require("../../package.json");
|
|
58
58
|
const funnel_1 = __importDefault(require("../api/funnel"));
|
|
@@ -501,7 +501,7 @@ class Kuzzle extends KuzzleEventEmitter_1.default {
|
|
|
501
501
|
default:
|
|
502
502
|
inString = (0, json_stable_stringify_1.default)(input);
|
|
503
503
|
}
|
|
504
|
-
return
|
|
504
|
+
return murmurhash_1.default.v3(Buffer.from(inString), this.config.internal.hash.seed);
|
|
505
505
|
}
|
|
506
506
|
get state() {
|
|
507
507
|
return this._state;
|
|
@@ -124,5 +124,15 @@ export interface IKuzzleConfiguration {
|
|
|
124
124
|
notifiableProtocols: string[];
|
|
125
125
|
};
|
|
126
126
|
validation: Record<string, unknown>;
|
|
127
|
+
controllers: {
|
|
128
|
+
definition: {
|
|
129
|
+
/**
|
|
130
|
+
* Allow additional properties in action definitions.
|
|
131
|
+
*
|
|
132
|
+
* @default false
|
|
133
|
+
*/
|
|
134
|
+
allowAdditionalActionProperties: boolean;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
127
137
|
}
|
|
128
138
|
export type KuzzleConfiguration = Partial<IKuzzleConfiguration>;
|
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.
|
|
4
|
+
"version": "2.36.0-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": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"long": "5.2.3",
|
|
53
53
|
"moment": "2.29.4",
|
|
54
54
|
"ms": "2.1.3",
|
|
55
|
-
"murmurhash
|
|
55
|
+
"murmurhash": "^2.0.1",
|
|
56
56
|
"ndjson": "2.0.0",
|
|
57
57
|
"node-segfault-handler": "1.4.2",
|
|
58
58
|
"passport": "0.7.0",
|