@punks/backend-entity-manager 0.0.194 → 0.0.196

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.
@@ -0,0 +1,4 @@
1
+ import { IAuthenticationContext } from "../../../abstractions";
2
+ export declare class PermissionsChecker<TUserContext> {
3
+ hasPermission(context: IAuthenticationContext<TUserContext>, permissions: string[]): boolean;
4
+ }
@@ -9,6 +9,7 @@ import { QueryClauseBuilder } from "./queryClauseBuilder";
9
9
  import { BooleanFacetsType, FacetType, NumberFacetsType, StringFacetsType } from "./facets";
10
10
  import { QueryBuilderOperation } from "../../../templates/queryBuilder";
11
11
  import { ChildrenMap } from "./traverse";
12
+ import { PermissionsChecker } from "./permissionsChecker";
12
13
  export type FacetRelations = {
13
14
  columns: string[];
14
15
  };
@@ -16,6 +17,7 @@ export declare abstract class TypeOrmQueryBuilder<TEntity extends ObjectLiteral,
16
17
  private readonly services;
17
18
  private repository;
18
19
  protected clause: QueryClauseBuilder;
20
+ protected permissions: PermissionsChecker<TUserContext>;
19
21
  constructor(services: EntityServiceLocator<TEntity, unknown>);
20
22
  get(id: TEntityId, context?: IAuthenticationContext<TUserContext>): Promise<TEntity | undefined>;
21
23
  exists(filters: NonNullable<TEntitySearchParameters["filters"]>, context?: IAuthenticationContext<TUserContext> | undefined): Promise<boolean>;
package/dist/index.d.ts CHANGED
@@ -1436,6 +1436,10 @@ type ChildrenMap = Record<string, {
1436
1436
  count: number;
1437
1437
  }>;
1438
1438
 
1439
+ declare class PermissionsChecker<TUserContext> {
1440
+ hasPermission(context: IAuthenticationContext<TUserContext>, permissions: string[]): boolean;
1441
+ }
1442
+
1439
1443
  type FacetRelations = {
1440
1444
  columns: string[];
1441
1445
  };
@@ -1443,6 +1447,7 @@ declare abstract class TypeOrmQueryBuilder<TEntity extends ObjectLiteral, TEntit
1443
1447
  private readonly services;
1444
1448
  private repository;
1445
1449
  protected clause: QueryClauseBuilder;
1450
+ protected permissions: PermissionsChecker<TUserContext>;
1446
1451
  constructor(services: EntityServiceLocator<TEntity, unknown>);
1447
1452
  get(id: TEntityId, context?: IAuthenticationContext<TUserContext>): Promise<TEntity | undefined>;
1448
1453
  exists(filters: NonNullable<TEntitySearchParameters["filters"]>, context?: IAuthenticationContext<TUserContext> | undefined): Promise<boolean>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@punks/backend-entity-manager",
3
- "version": "0.0.194",
3
+ "version": "0.0.196",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",