kuzzle 2.50.1-beta.1 → 2.50.1-beta.3

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/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export * from "./lib/kerror/errors";
7
7
  export * from "./lib/util/mutex";
8
8
  export * from "./lib/util/Inflector";
9
9
  export { NameGenerator } from "./lib/util/name-generator";
10
+ export * from "kuzzle-sdk";
10
11
  export * from "./lib/core/shared/KoncordeWrapper";
11
12
  export * from "./lib/core/shared/ObjectRepository";
12
13
  export * from "./lib/core/shared/store";
package/dist/index.js CHANGED
@@ -25,6 +25,7 @@ __exportStar(require("./lib/util/mutex"), exports);
25
25
  __exportStar(require("./lib/util/Inflector"), exports);
26
26
  var name_generator_1 = require("./lib/util/name-generator");
27
27
  Object.defineProperty(exports, "NameGenerator", { enumerable: true, get: function () { return name_generator_1.NameGenerator; } });
28
+ __exportStar(require("kuzzle-sdk"), exports);
28
29
  __exportStar(require("./lib/core/shared/KoncordeWrapper"), exports);
29
30
  __exportStar(require("./lib/core/shared/ObjectRepository"), exports);
30
31
  __exportStar(require("./lib/core/shared/store"), exports);
@@ -3,7 +3,7 @@ import { RequestInput } from "./requestInput";
3
3
  import { RequestResponse } from "./requestResponse";
4
4
  import { RequestContext } from "./requestContext";
5
5
  import { KuzzleError } from "../../kerror/errors";
6
- import { Deprecation, User } from "../../types";
6
+ import { Deprecation } from "../../types";
7
7
  /**
8
8
  * The `KuzzleRequest` class represents a request being processed by Kuzzle.
9
9
  *
@@ -376,7 +376,7 @@ export declare class KuzzleRequest {
376
376
  /**
377
377
  * Returns the current user
378
378
  */
379
- getUser(): User | null;
379
+ getUser(): import("../../model/security/user").User;
380
380
  /**
381
381
  * Returns the search body query according to the http method
382
382
  */
@@ -714,7 +714,7 @@ class KuzzleRequest {
714
714
  * Returns the current user kuid
715
715
  */
716
716
  getKuid() {
717
- if (this.context && this.context.user && this.context.user._id) {
717
+ if (this.context?.user?._id) {
718
718
  return this.context.user._id;
719
719
  }
720
720
  return null;
@@ -723,7 +723,7 @@ class KuzzleRequest {
723
723
  * Returns the current user
724
724
  */
725
725
  getUser() {
726
- if (this.context && this.context.user) {
726
+ if (this.context?.user) {
727
727
  return this.context.user;
728
728
  }
729
729
  return null;
@@ -1,5 +1,6 @@
1
1
  import { KuzzleRequest } from "../../api/request";
2
- import { User, RoomList } from "../../types";
2
+ import { RoomList } from "../../types";
3
+ import { User } from "../../model/security/user";
3
4
  /**
4
5
  * The HotelClerk is responsible of keeping the list of rooms and subscriptions
5
6
  * made to those rooms.
@@ -319,9 +319,10 @@ class HotelClerk {
319
319
  }, {});
320
320
  for (const [index, collections] of Object.entries(fullStateRooms)) {
321
321
  isAllowedRequest.input.resource.index = index;
322
- const toRemove = await bluebird_1.default.filter(Object.keys(collections), (collection) => {
322
+ const toRemove = await bluebird_1.default.filter(Object.keys(collections), async (collection) => {
323
323
  isAllowedRequest.input.resource.collection = collection;
324
- return !user.isActionAllowed(isAllowedRequest);
324
+ const result = await user.isActionAllowed(isAllowedRequest);
325
+ return !result;
325
326
  });
326
327
  for (const collection of toRemove) {
327
328
  delete fullStateRooms[index][collection];
@@ -15,7 +15,6 @@ export * from "./ProfileDefinition";
15
15
  export * from "./RoleDefinition";
16
16
  export * from "./Target";
17
17
  export * from "./Token";
18
- export * from "./User";
19
18
  export * from "./config/DumpConfiguration";
20
19
  export * from "./config/HttpConfiguration";
21
20
  export * from "./config/KuzzleConfiguration";
@@ -51,7 +51,6 @@ __exportStar(require("./ProfileDefinition"), exports);
51
51
  __exportStar(require("./RoleDefinition"), exports);
52
52
  __exportStar(require("./Target"), exports);
53
53
  __exportStar(require("./Token"), exports);
54
- __exportStar(require("./User"), exports);
55
54
  __exportStar(require("./config/DumpConfiguration"), exports);
56
55
  __exportStar(require("./config/HttpConfiguration"), exports);
57
56
  __exportStar(require("./config/KuzzleConfiguration"), exports);
package/dist/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.50.1-beta.1",
4
+ "version": "2.50.1-beta.3",
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
  "scripts": {
7
7
  "build": "rm -Rf ./dist && tsc && node ./bin/copy-protobuf.js",
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.50.1-beta.1",
4
+ "version": "2.50.1-beta.3",
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
  "scripts": {
7
7
  "build": "rm -Rf ./dist && tsc && node ./bin/copy-protobuf.js",
@@ -1,14 +0,0 @@
1
- import { JSONObject } from "kuzzle-sdk";
2
- /**
3
- * Kuzzle user.
4
- */
5
- export interface User extends JSONObject {
6
- /**
7
- * Unique ID
8
- */
9
- _id: string;
10
- /**
11
- * User profiles
12
- */
13
- profileIds: Array<string>;
14
- }
@@ -1,23 +0,0 @@
1
- "use strict";
2
- /*
3
- * Kuzzle, a backend software, self-hostable and ready to use
4
- * to power modern apps
5
- *
6
- * Copyright 2015-2022 Kuzzle
7
- * mailto: support AT kuzzle.io
8
- * website: http://kuzzle.io
9
- *
10
- * Licensed under the Apache License, Version 2.0 (the "License");
11
- * you may not use this file except in compliance with the License.
12
- * You may obtain a copy of the License at
13
- *
14
- * https://www.apache.org/licenses/LICENSE-2.0
15
- *
16
- * Unless required by applicable law or agreed to in writing, software
17
- * distributed under the License is distributed on an "AS IS" BASIS,
18
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- * See the License for the specific language governing permissions and
20
- * limitations under the License.
21
- */
22
- Object.defineProperty(exports, "__esModule", { value: true });
23
- //# sourceMappingURL=User.js.map