-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplv8.ts
More file actions
29 lines (27 loc) · 670 Bytes
/
Copy pathplv8.ts
File metadata and controls
29 lines (27 loc) · 670 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import type { Database } from "./supabase";
declare global {
const createPolicy: <TableName extends keyof Database["public"]["Tables"]>(
param: (some: {
row: Database["public"]["Tables"][TableName]["Row"];
function: Record<keyof Database["public"]["Functions"], Function>;
auth: {
uid: () => string;
jwt: () => JWT;
};
plv8: {
execute<T>(sql: string, ...params: any[]): T;
};
}) => boolean
) => boolean;
}
export type JWT = {
aud: string;
exp: number;
sub: string;
email: string;
app_metadata: {
provider: string;
};
user_metadata: any;
role: string;
} & Record<string, any>;