@prisma/security-rules 0.3.7 → 0.4.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.
- package/README.md +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/package.json +9 -9
package/README.md
CHANGED
@@ -106,7 +106,7 @@ Be sure to copy the public key from the deploy command's output in your terminal
|
|
106
106
|
import { AuthorizedClient } from "@prisma/security-rules";
|
107
107
|
|
108
108
|
// It is important not to forget the `type` annotation here.
|
109
|
-
import type rules from "
|
109
|
+
import type rules from "path/to/prisma/rules";
|
110
110
|
|
111
111
|
const authorizedClient = new AuthorizedClient<typeof rules>({
|
112
112
|
publicKey: "<public_key>",
|
package/dist/index.d.cts
CHANGED
@@ -2,9 +2,9 @@ import { Prisma } from '@prisma/client/extension';
|
|
2
2
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
3
3
|
|
4
4
|
declare type Narrowable = string | number | bigint | boolean | [];
|
5
|
-
declare type Exact<A, W> = (A extends unknown ? W extends A ? {
|
5
|
+
declare type Exact<A, W> = (A extends unknown ? (W extends A ? {
|
6
6
|
[K in keyof A]: Exact<A[K], W[K]>;
|
7
|
-
} : W : never) | (A extends Narrowable ? A : never);
|
7
|
+
} : W) : never) | (A extends Narrowable ? A : never);
|
8
8
|
type CoerceAnyToNever<T> = unknown extends T ? never : T;
|
9
9
|
type CoerceNeverToValue<T, V> = [T] extends [never] ? V : T;
|
10
10
|
type ModelKeys<T> = {
|
@@ -45,8 +45,8 @@ type OpRuleShapeWhere<O extends Operation, C, K extends keyof C> = Prisma.Args<C
|
|
45
45
|
type OpCtx<O extends Operation, C, K extends keyof C, Ctx extends StandardSchemaV1> = K extends unknown ? O extends unknown ? {
|
46
46
|
model: K;
|
47
47
|
operation: O;
|
48
|
-
args: CoerceAnyToNever<Prisma.Args<C[K], O
|
49
|
-
context: StandardSchemaV1.InferOutput<Ctx
|
48
|
+
args: readonly [CoerceAnyToNever<Prisma.Args<C[K], O>>];
|
49
|
+
context: StandardSchemaV1.InferOutput<Ctx> | undefined;
|
50
50
|
uuid?: string;
|
51
51
|
} : never : never;
|
52
52
|
type OpRuleShapeCallback<O extends Operation, C, K extends keyof C, Ctx extends StandardSchemaV1> = {
|
package/dist/index.d.ts
CHANGED
@@ -2,9 +2,9 @@ import { Prisma } from '@prisma/client/extension';
|
|
2
2
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
3
3
|
|
4
4
|
declare type Narrowable = string | number | bigint | boolean | [];
|
5
|
-
declare type Exact<A, W> = (A extends unknown ? W extends A ? {
|
5
|
+
declare type Exact<A, W> = (A extends unknown ? (W extends A ? {
|
6
6
|
[K in keyof A]: Exact<A[K], W[K]>;
|
7
|
-
} : W : never) | (A extends Narrowable ? A : never);
|
7
|
+
} : W) : never) | (A extends Narrowable ? A : never);
|
8
8
|
type CoerceAnyToNever<T> = unknown extends T ? never : T;
|
9
9
|
type CoerceNeverToValue<T, V> = [T] extends [never] ? V : T;
|
10
10
|
type ModelKeys<T> = {
|
@@ -45,8 +45,8 @@ type OpRuleShapeWhere<O extends Operation, C, K extends keyof C> = Prisma.Args<C
|
|
45
45
|
type OpCtx<O extends Operation, C, K extends keyof C, Ctx extends StandardSchemaV1> = K extends unknown ? O extends unknown ? {
|
46
46
|
model: K;
|
47
47
|
operation: O;
|
48
|
-
args: CoerceAnyToNever<Prisma.Args<C[K], O
|
49
|
-
context: StandardSchemaV1.InferOutput<Ctx
|
48
|
+
args: readonly [CoerceAnyToNever<Prisma.Args<C[K], O>>];
|
49
|
+
context: StandardSchemaV1.InferOutput<Ctx> | undefined;
|
50
50
|
uuid?: string;
|
51
51
|
} : never : never;
|
52
52
|
type OpRuleShapeCallback<O extends Operation, C, K extends keyof C, Ctx extends StandardSchemaV1> = {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@prisma/security-rules",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.4.1",
|
4
4
|
"sideEffects": false,
|
5
5
|
"description": "Prisma Postgres Security Rules",
|
6
6
|
"type": "module",
|
@@ -13,12 +13,6 @@
|
|
13
13
|
"require": "./dist/index.cjs"
|
14
14
|
}
|
15
15
|
},
|
16
|
-
"scripts": {
|
17
|
-
"build": "tsup",
|
18
|
-
"typecheck": "tsc --noEmit",
|
19
|
-
"lint": "eslint --fix .",
|
20
|
-
"test": ""
|
21
|
-
},
|
22
16
|
"keywords": [],
|
23
17
|
"dependencies": {
|
24
18
|
"@standard-schema/spec": "1.0.0",
|
@@ -58,5 +52,11 @@
|
|
58
52
|
"files": [
|
59
53
|
"assets",
|
60
54
|
"dist"
|
61
|
-
]
|
62
|
-
|
55
|
+
],
|
56
|
+
"scripts": {
|
57
|
+
"build": "tsup",
|
58
|
+
"typecheck": "tsc --noEmit",
|
59
|
+
"lint": "eslint --fix .",
|
60
|
+
"test": ""
|
61
|
+
}
|
62
|
+
}
|