@casl/mongoose
Advanced tools
Comparing version 7.3.0 to 7.3.1
@@ -1,3 +0,2 @@ | ||
import { AnyMongoAbility, Generics, SubjectType } from '@casl/ability'; | ||
import { ToAbilityTypes } from '@casl/ability/dist/types/types'; | ||
import { AnyMongoAbility, Generics, SubjectType, Abilities, AbilityTuple, ExtractSubjectType } from '@casl/ability'; | ||
export declare const EMPTY_RESULT_QUERY: { | ||
@@ -17,5 +16,7 @@ $expr: { | ||
} | ||
type SubjectTypes<T extends Abilities> = T extends AbilityTuple ? ExtractSubjectType<T[1]> : never; | ||
/** | ||
* Returns accessible records Mongo query per record type (i.e., entity type) based on provided Ability and action. | ||
*/ | ||
export declare function accessibleBy<T extends AnyMongoAbility>(ability: T, action?: Parameters<T['rulesFor']>[0]): AccessibleRecords<ToAbilityTypes<Generics<T>['abilities']>[1]>; | ||
export declare function accessibleBy<T extends AnyMongoAbility>(ability: T, action?: Parameters<T['rulesFor']>[0]): AccessibleRecords<SubjectTypes<Generics<T>['abilities']>>; | ||
export {}; |
{ | ||
"name": "@casl/mongoose", | ||
"version": "7.3.0", | ||
"version": "7.3.1", | ||
"description": "Allows to query accessible records from MongoDB based on CASL rules", | ||
@@ -5,0 +5,0 @@ "main": "dist/es6c/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
48666
137
0