@casl/prisma
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -1,2 +0,2 @@ | ||
import { PrismaClient, Prisma } from '@prisma/client'; | ||
import type { PrismaClient, Prisma } from '@prisma/client'; | ||
import { ForcedSubject, hkt } from '@casl/ability'; | ||
@@ -6,4 +6,5 @@ declare type ModelDelegates = { | ||
}; | ||
declare type Present<T> = Exclude<T, null | undefined>; | ||
export declare type WhereInput<TModelName extends Prisma.ModelName> = Present<Present<Parameters<ModelDelegates[TModelName]['findFirst']>[0]>['where']>; | ||
export declare type WhereInput<TModelName extends Prisma.ModelName> = Extract<Extract<Parameters<ModelDelegates[TModelName]['findFirst']>[0], { | ||
where?: any; | ||
}>['where'], Record<any, any>>; | ||
declare type ExtractModelName<T> = T extends { | ||
@@ -10,0 +11,0 @@ kind: Prisma.ModelName; |
import { Prisma } from '@prisma/client'; | ||
import { AbilityOptions, AbilityTuple, PureAbility, RawRuleFrom } from '@casl/ability'; | ||
import { PrismaQuery } from './prisma/PrismaQuery'; | ||
export declare class PrismaAbility<A extends AbilityTuple = [string, Prisma.ModelName], C extends PrismaQuery = PrismaQuery> extends PureAbility<A, C> { | ||
export declare class PrismaAbility<A extends AbilityTuple = [string, 'all' | Prisma.ModelName], C extends PrismaQuery = PrismaQuery> extends PureAbility<A, C> { | ||
constructor(rules?: RawRuleFrom<A, C>[], options?: AbilityOptions<A, C>); | ||
} |
{ | ||
"name": "@casl/prisma", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Allows to query accessible records using Prisma client based on CASL rules", | ||
@@ -16,3 +16,4 @@ "main": "dist/es6c/index.js", | ||
"type": "git", | ||
"url": "https://github.com/stalniy/casl.git" | ||
"url": "https://github.com/stalniy/casl.git", | ||
"directory": "packages/casl-prisma" | ||
}, | ||
@@ -50,2 +51,3 @@ "publishConfig": { | ||
"@prisma/client": "^3.2.1", | ||
"@types/jest": "^26.0.22", | ||
"prisma": "^3.2.1" | ||
@@ -52,0 +54,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
105
66227
5
14