auth-vir 5.2.0 → 5.2.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 +3 -3
- package/dist/auth-client/backend-auth.client.d.ts +1 -2
- package/dist/auth-client/frontend-auth.client.d.ts +1 -2
- package/dist/auth-client/frontend-auth.client.js +5 -3
- package/dist/cookie.d.ts +1 -2
- package/dist/csrf-token.d.ts +1 -1
- package/dist/csrf-token.js +1 -1
- package/dist/generated/client.d.ts +4 -2
- package/dist/generated/client.js +5 -3
- package/dist/generated/internal/class.d.ts +17 -11
- package/dist/generated/internal/class.js +19 -52
- package/dist/generated/internal/prismaNamespace.d.ts +105 -51
- package/dist/generated/internal/prismaNamespace.js +10 -10
- package/dist/generated/internal/prismaNamespaceBrowser.d.ts +6 -21
- package/dist/generated/internal/prismaNamespaceBrowser.js +6 -6
- package/dist/generated/models/User.d.ts +6 -2
- package/dist/jwt/jwt-keys.js +13 -11
- package/package.json +20 -21
- package/src/auth-client/backend-auth.client.ts +3 -1
- package/src/auth-client/frontend-auth.client.ts +6 -6
- package/src/cookie.ts +1 -1
- package/src/csrf-token.ts +6 -2
- package/src/generated/client.ts +6 -6
- package/src/generated/internal/class.ts +35 -65
- package/src/generated/internal/prismaNamespace.ts +112 -41
- package/src/generated/internal/prismaNamespaceBrowser.ts +8 -6
- package/src/generated/models/User.ts +6 -1
- package/src/jwt/jwt-keys.ts +21 -16
package/README.md
CHANGED
|
@@ -54,7 +54,7 @@ For the easiest usage, construct and use `BackendAuthClient` on your server and
|
|
|
54
54
|
Use this on your host / server / backend to authenticate client / frontend requests.
|
|
55
55
|
|
|
56
56
|
1. Expose the [`AuthHeaderName.CsrfToken`](https://electrovir.github.io/auth-vir/variables/AuthHeaderName.html) (or just `'csrf-token'`) header via CORS headers with either of the following options:
|
|
57
|
-
1. Set `customHeaders: [AuthHeaderName.CsrfToken]` in `
|
|
57
|
+
1. Set `customHeaders: [AuthHeaderName.CsrfToken]` in `implementApi` from [`@rest-vir/host`](https://www.npmjs.com/package/@rest-vir/host).
|
|
58
58
|
2. Set the header `Access-Control-Allow-Headers` to (at least) `AuthHeaderName.CsrfToken`.
|
|
59
59
|
2. Set the `Access-Control-Allow-Origin` header (it cannot be `*`) and properly implement CORS headers and responses.
|
|
60
60
|
3. Generate JWT signing and encryption keys with one of the following:
|
|
@@ -332,7 +332,7 @@ export async function sendAuthenticatedRequest(
|
|
|
332
332
|
});
|
|
333
333
|
|
|
334
334
|
if (response.status === HttpStatus.Unauthorized) {
|
|
335
|
-
throw new Error(
|
|
335
|
+
throw new Error('User no longer logged in.');
|
|
336
336
|
} else {
|
|
337
337
|
return response;
|
|
338
338
|
}
|
|
@@ -354,7 +354,7 @@ export async function logout(logoutUrl: string) {
|
|
|
354
354
|
All of these configurations must be set for the auth exports in this package to function properly:
|
|
355
355
|
|
|
356
356
|
- Expose the [`AuthHeaderName.CsrfToken`](https://electrovir.github.io/auth-vir/variables/AuthHeaderName.html) (or just `'csrf-token'`) header via CORS headers with either of the following options:
|
|
357
|
-
1. Set `customHeaders: [AuthHeaderName.CsrfToken]` in `
|
|
357
|
+
1. Set `customHeaders: [AuthHeaderName.CsrfToken]` in `implementApi` from [`@rest-vir/host`](https://www.npmjs.com/package/@rest-vir/host).
|
|
358
358
|
2. Set the header `Access-Control-Allow-Headers` to (at least) `AuthHeaderName.CsrfToken`.
|
|
359
359
|
- Set `credentials: include` in all fetch requests on the client that need to use or set the auth cookie.
|
|
360
360
|
- Server CORS should set `Access-Control-Allow-Origin` (it cannot be `*`).
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { type AnyObject, type JsonCompatibleObject, type MaybePromise, type PartialWithUndefined } from '@augment-vir/common';
|
|
1
|
+
import { type AnyObject, type EmptyObject, type JsonCompatibleObject, type MaybePromise, type PartialWithUndefined, type RequireExactlyOne, type RequireOneOrNone } from '@augment-vir/common';
|
|
2
2
|
import { type AnyDuration } from 'date-vir';
|
|
3
3
|
import { type IncomingHttpHeaders, type OutgoingHttpHeaders } from 'node:http';
|
|
4
|
-
import { type EmptyObject, type RequireExactlyOne, type RequireOneOrNone } from 'type-fest';
|
|
5
4
|
import { type UserIdResult } from '../auth.js';
|
|
6
5
|
import { type CookieParams } from '../cookie.js';
|
|
7
6
|
import { type CsrfHeaderNameOption } from '../csrf-token.js';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { type createBlockingInterval, type JsonCompatibleObject, type MaybePromise, type PartialWithUndefined, type SelectFrom } from '@augment-vir/common';
|
|
1
|
+
import { type createBlockingInterval, type EmptyObject, type JsonCompatibleObject, type MaybePromise, type PartialWithUndefined, type SelectFrom } from '@augment-vir/common';
|
|
2
2
|
import { type AnyDuration } from 'date-vir';
|
|
3
|
-
import { type EmptyObject } from 'type-fest';
|
|
4
3
|
import { type CsrfHeaderNameOption } from '../csrf-token.js';
|
|
5
4
|
/**
|
|
6
5
|
* Config for {@link FrontendAuthClient}.
|
|
@@ -53,11 +53,13 @@ export class FrontendAuthClient {
|
|
|
53
53
|
localStorage.removeItem(storageKey);
|
|
54
54
|
return true;
|
|
55
55
|
}
|
|
56
|
-
else if (
|
|
56
|
+
else if (await this.config.canAssumeUser?.()) {
|
|
57
|
+
localStorage.setItem(storageKey, JSON.stringify(assumedUserParams));
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
57
61
|
return false;
|
|
58
62
|
}
|
|
59
|
-
localStorage.setItem(storageKey, JSON.stringify(assumedUserParams));
|
|
60
|
-
return true;
|
|
61
63
|
}
|
|
62
64
|
/** Gets the assumed user params stored in local storage, if any. */
|
|
63
65
|
getAssumedUser() {
|
package/dist/cookie.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { type PartialWithUndefined, type SelectFrom } from '@augment-vir/common';
|
|
1
|
+
import { type PartialWithUndefined, type Primitive, type SelectFrom } from '@augment-vir/common';
|
|
2
2
|
import { type AnyDuration } from 'date-vir';
|
|
3
|
-
import { type Primitive } from 'type-fest';
|
|
4
3
|
import { type CreateJwtParams, type ParseJwtParams, type ParsedJwt } from './jwt/jwt.js';
|
|
5
4
|
import { type JwtUserData } from './jwt/user-jwt.js';
|
|
6
5
|
/**
|
package/dist/csrf-token.d.ts
CHANGED
package/dist/csrf-token.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { check } from '@augment-vir/assert';
|
|
2
|
-
import { escapeStringForRegExp, randomString, safeMatch } from '@augment-vir/common';
|
|
2
|
+
import { escapeStringForRegExp, randomString, safeMatch, } from '@augment-vir/common';
|
|
3
3
|
import { AuthCookie, resolveCookieName } from './cookie.js';
|
|
4
4
|
/**
|
|
5
5
|
* Generates a random, cryptographically secure CSRF token string.
|
|
@@ -9,12 +9,14 @@ export * from "./enums.js";
|
|
|
9
9
|
* Type-safe database client for TypeScript
|
|
10
10
|
* @example
|
|
11
11
|
* ```
|
|
12
|
-
* const prisma = new PrismaClient(
|
|
12
|
+
* const prisma = new PrismaClient({
|
|
13
|
+
* adapter: new PrismaPg({ connectionString: process.env.DATABASE_URL })
|
|
14
|
+
* })
|
|
13
15
|
* // Fetch zero or more Users
|
|
14
16
|
* const users = await prisma.user.findMany()
|
|
15
17
|
* ```
|
|
16
18
|
*
|
|
17
|
-
* Read more in our [docs](https://
|
|
19
|
+
* Read more in our [docs](https://pris.ly/d/client).
|
|
18
20
|
*/
|
|
19
21
|
export declare const PrismaClient: $Class.PrismaClientConstructor;
|
|
20
22
|
export type PrismaClient<LogOpts extends Prisma.LogLevel = never, OmitOpts extends Prisma.PrismaClientOptions["omit"] = Prisma.PrismaClientOptions["omit"], ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = $Class.PrismaClient<LogOpts, OmitOpts, ExtArgs>;
|
package/dist/generated/client.js
CHANGED
|
@@ -21,12 +21,14 @@ export * from "./enums.js";
|
|
|
21
21
|
* Type-safe database client for TypeScript
|
|
22
22
|
* @example
|
|
23
23
|
* ```
|
|
24
|
-
* const prisma = new PrismaClient(
|
|
24
|
+
* const prisma = new PrismaClient({
|
|
25
|
+
* adapter: new PrismaPg({ connectionString: process.env.DATABASE_URL })
|
|
26
|
+
* })
|
|
25
27
|
* // Fetch zero or more Users
|
|
26
28
|
* const users = await prisma.user.findMany()
|
|
27
29
|
* ```
|
|
28
30
|
*
|
|
29
|
-
* Read more in our [docs](https://
|
|
31
|
+
* Read more in our [docs](https://pris.ly/d/client).
|
|
30
32
|
*/
|
|
31
|
-
export const PrismaClient = $Class.getPrismaClientClass(
|
|
33
|
+
export const PrismaClient = $Class.getPrismaClientClass();
|
|
32
34
|
export { Prisma };
|
|
@@ -8,16 +8,18 @@ export interface PrismaClientConstructor {
|
|
|
8
8
|
* Type-safe database client for TypeScript
|
|
9
9
|
* @example
|
|
10
10
|
* ```
|
|
11
|
-
* const prisma = new PrismaClient(
|
|
11
|
+
* const prisma = new PrismaClient({
|
|
12
|
+
* adapter: new PrismaPg({ connectionString: process.env.DATABASE_URL })
|
|
13
|
+
* })
|
|
12
14
|
* // Fetch zero or more Users
|
|
13
15
|
* const users = await prisma.user.findMany()
|
|
14
16
|
* ```
|
|
15
17
|
*
|
|
16
|
-
* Read more in our [docs](https://
|
|
18
|
+
* Read more in our [docs](https://pris.ly/d/client).
|
|
17
19
|
*/
|
|
18
20
|
new <Options extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions, LogOpts extends LogOptions<Options> = LogOptions<Options>, OmitOpts extends Prisma.PrismaClientOptions['omit'] = Options extends {
|
|
19
21
|
omit: infer U;
|
|
20
|
-
} ? U : Prisma.PrismaClientOptions['omit'], ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs>(options
|
|
22
|
+
} ? U : Prisma.PrismaClientOptions['omit'], ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs>(options: Prisma.PrismaClientConstructorArgs<Options>): PrismaClient<LogOpts, OmitOpts, ExtArgs>;
|
|
21
23
|
}
|
|
22
24
|
/**
|
|
23
25
|
* ## Prisma Client
|
|
@@ -25,12 +27,14 @@ export interface PrismaClientConstructor {
|
|
|
25
27
|
* Type-safe database client for TypeScript
|
|
26
28
|
* @example
|
|
27
29
|
* ```
|
|
28
|
-
* const prisma = new PrismaClient(
|
|
30
|
+
* const prisma = new PrismaClient({
|
|
31
|
+
* adapter: new PrismaPg({ connectionString: process.env.DATABASE_URL })
|
|
32
|
+
* })
|
|
29
33
|
* // Fetch zero or more Users
|
|
30
34
|
* const users = await prisma.user.findMany()
|
|
31
35
|
* ```
|
|
32
36
|
*
|
|
33
|
-
* Read more in our [docs](https://
|
|
37
|
+
* Read more in our [docs](https://pris.ly/d/client).
|
|
34
38
|
*/
|
|
35
39
|
export interface PrismaClient<in LogOpts extends Prisma.LogLevel = never, in out OmitOpts extends Prisma.PrismaClientOptions['omit'] = Prisma.PrismaClientOptions['omit'], in out ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> {
|
|
36
40
|
[K: symbol]: {
|
|
@@ -52,7 +56,7 @@ export interface PrismaClient<in LogOpts extends Prisma.LogLevel = never, in out
|
|
|
52
56
|
* const result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`
|
|
53
57
|
* ```
|
|
54
58
|
*
|
|
55
|
-
* Read more in our [docs](https://
|
|
59
|
+
* Read more in our [docs](https://pris.ly/d/raw-queries).
|
|
56
60
|
*/
|
|
57
61
|
$executeRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<number>;
|
|
58
62
|
/**
|
|
@@ -63,7 +67,7 @@ export interface PrismaClient<in LogOpts extends Prisma.LogLevel = never, in out
|
|
|
63
67
|
* const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com')
|
|
64
68
|
* ```
|
|
65
69
|
*
|
|
66
|
-
* Read more in our [docs](https://
|
|
70
|
+
* Read more in our [docs](https://pris.ly/d/raw-queries).
|
|
67
71
|
*/
|
|
68
72
|
$executeRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<number>;
|
|
69
73
|
/**
|
|
@@ -73,7 +77,7 @@ export interface PrismaClient<in LogOpts extends Prisma.LogLevel = never, in out
|
|
|
73
77
|
* const result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`
|
|
74
78
|
* ```
|
|
75
79
|
*
|
|
76
|
-
* Read more in our [docs](https://
|
|
80
|
+
* Read more in our [docs](https://pris.ly/d/raw-queries).
|
|
77
81
|
*/
|
|
78
82
|
$queryRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<T>;
|
|
79
83
|
/**
|
|
@@ -84,7 +88,7 @@ export interface PrismaClient<in LogOpts extends Prisma.LogLevel = never, in out
|
|
|
84
88
|
* const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com')
|
|
85
89
|
* ```
|
|
86
90
|
*
|
|
87
|
-
* Read more in our [docs](https://
|
|
91
|
+
* Read more in our [docs](https://pris.ly/d/raw-queries).
|
|
88
92
|
*/
|
|
89
93
|
$queryRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<T>;
|
|
90
94
|
/**
|
|
@@ -98,9 +102,11 @@ export interface PrismaClient<in LogOpts extends Prisma.LogLevel = never, in out
|
|
|
98
102
|
* ])
|
|
99
103
|
* ```
|
|
100
104
|
*
|
|
101
|
-
* Read more in our [docs](https://www.prisma.io/docs/
|
|
105
|
+
* Read more in our [docs](https://www.prisma.io/docs/orm/prisma-client/queries/transactions).
|
|
102
106
|
*/
|
|
103
107
|
$transaction<P extends Prisma.PrismaPromise<any>[]>(arg: [...P], options?: {
|
|
108
|
+
maxWait?: number;
|
|
109
|
+
timeout?: number;
|
|
104
110
|
isolationLevel?: Prisma.TransactionIsolationLevel;
|
|
105
111
|
}): runtime.Types.Utils.JsPromise<runtime.Types.Utils.UnwrapTuple<P>>;
|
|
106
112
|
$transaction<R>(fn: (prisma: Omit<PrismaClient, runtime.ITXClientDenyList>) => runtime.Types.Utils.JsPromise<R>, options?: {
|
|
@@ -123,4 +129,4 @@ export interface PrismaClient<in LogOpts extends Prisma.LogLevel = never, in out
|
|
|
123
129
|
omit: OmitOpts;
|
|
124
130
|
}>;
|
|
125
131
|
}
|
|
126
|
-
export declare function getPrismaClientClass(
|
|
132
|
+
export declare function getPrismaClientClass(): PrismaClientConstructor;
|
|
@@ -11,75 +11,42 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from "@prisma/client/runtime/client";
|
|
13
13
|
const config = {
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"fromEnvVar": null,
|
|
18
|
-
"value": "prisma-client"
|
|
19
|
-
},
|
|
20
|
-
"output": {
|
|
21
|
-
"value": "/Users/electrovir/repos/electrovir/auth-vir/packages/auth-vir/src/generated",
|
|
22
|
-
"fromEnvVar": null
|
|
23
|
-
},
|
|
24
|
-
"config": {
|
|
25
|
-
"engineType": "client",
|
|
26
|
-
"moduleFormat": "esm"
|
|
27
|
-
},
|
|
28
|
-
"binaryTargets": [
|
|
29
|
-
{
|
|
30
|
-
"fromEnvVar": null,
|
|
31
|
-
"value": "darwin-arm64",
|
|
32
|
-
"native": true
|
|
33
|
-
}
|
|
34
|
-
],
|
|
35
|
-
"previewFeatures": [
|
|
36
|
-
"relationJoins",
|
|
37
|
-
"strictUndefinedChecks"
|
|
38
|
-
],
|
|
39
|
-
"sourceFilePath": "/Users/electrovir/repos/electrovir/auth-vir/packages/auth-vir/test-files/schema.prisma",
|
|
40
|
-
"isCustomOutput": true
|
|
41
|
-
},
|
|
42
|
-
"relativePath": "../../test-files",
|
|
43
|
-
"clientVersion": "6.19.2",
|
|
44
|
-
"engineVersion": "c2990dca591cba766e3b7ef5d9e8a84796e47ab7",
|
|
45
|
-
"datasourceNames": [
|
|
46
|
-
"db"
|
|
14
|
+
"previewFeatures": [
|
|
15
|
+
"relationJoins",
|
|
16
|
+
"strictUndefinedChecks"
|
|
47
17
|
],
|
|
18
|
+
"clientVersion": "7.9.0",
|
|
19
|
+
"engineVersion": "e922089b7d7502aff4249d5da3420f6fa55fc6ad",
|
|
48
20
|
"activeProvider": "postgresql",
|
|
49
|
-
"
|
|
50
|
-
"inlineDatasources": {
|
|
51
|
-
"db": {
|
|
52
|
-
"url": {
|
|
53
|
-
"fromEnvVar": "DATABASE_URL",
|
|
54
|
-
"value": null
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
"inlineSchema": "generator jsClient {\n provider = \"prisma-client\"\n previewFeatures = [\"strictUndefinedChecks\", \"relationJoins\"]\n output = \"../src/generated\"\n engineType = \"client\"\n moduleFormat = \"esm\"\n}\n\ngenerator shapes {\n provider = \"prisma-shapes\"\n output = \"../src/generated\"\n}\n\ngenerator stringDates {\n provider = \"prisma-string-dates\"\n output = \"../src/generated\"\n}\n\ngenerator brandedFields {\n provider = \"prisma-branded-fields\"\n output = \"../src/generated\"\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"DATABASE_URL\")\n}\n\nmodel User {\n id String @id @default(cuid(2))\n createdAt DateTime @default(now())\n updatedAt DateTime @default(now()) @updatedAt\n\n name String\n}\n",
|
|
59
|
-
"inlineSchemaHash": "23208c8e58615c00e5101cfaaa5341ce46c109a1169d3aea10dae8caa3594dcc",
|
|
60
|
-
"copyEngine": true,
|
|
21
|
+
"inlineSchema": "generator jsClient {\n provider = \"prisma-client\"\n previewFeatures = [\"strictUndefinedChecks\", \"relationJoins\"]\n output = \"../src/generated\"\n engineType = \"client\"\n moduleFormat = \"esm\"\n}\n\ngenerator shapes {\n provider = \"prisma-shapes\"\n output = \"../src/generated\"\n}\n\ngenerator stringDates {\n provider = \"prisma-string-dates\"\n output = \"../src/generated\"\n}\n\ngenerator brandedFields {\n provider = \"prisma-branded-fields\"\n output = \"../src/generated\"\n}\n\ndatasource db {\n provider = \"postgresql\"\n}\n\nmodel User {\n id String @id @default(cuid(2))\n createdAt DateTime @default(now())\n updatedAt DateTime @default(now()) @updatedAt\n\n name String\n}\n",
|
|
61
22
|
"runtimeDataModel": {
|
|
62
23
|
"models": {},
|
|
63
24
|
"enums": {},
|
|
64
25
|
"types": {}
|
|
65
26
|
},
|
|
66
|
-
"
|
|
27
|
+
"parameterizationSchema": {
|
|
28
|
+
"strings": [],
|
|
29
|
+
"graph": ""
|
|
30
|
+
}
|
|
67
31
|
};
|
|
68
32
|
config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"}],\"dbName\":null}},\"enums\":{},\"types\":{}}");
|
|
69
|
-
config.
|
|
33
|
+
config.parameterizationSchema = {
|
|
34
|
+
strings: JSON.parse("[\"where\",\"User.findUnique\",\"User.findUniqueOrThrow\",\"orderBy\",\"cursor\",\"User.findFirst\",\"User.findFirstOrThrow\",\"User.findMany\",\"data\",\"User.createOne\",\"User.createMany\",\"User.createManyAndReturn\",\"User.updateOne\",\"User.updateMany\",\"User.updateManyAndReturn\",\"create\",\"update\",\"User.upsertOne\",\"User.deleteOne\",\"User.deleteMany\",\"having\",\"_count\",\"_min\",\"_max\",\"User.groupBy\",\"User.aggregate\",\"AND\",\"OR\",\"NOT\",\"id\",\"createdAt\",\"updatedAt\",\"name\",\"equals\",\"in\",\"notIn\",\"lt\",\"lte\",\"gt\",\"gte\",\"not\",\"contains\",\"startsWith\",\"endsWith\",\"set\"]"),
|
|
35
|
+
graph: "KQkQBxoAACIAMBsAAAQAEBwAACIAMB0BAAAAAR5AACQAIR9AACQAISABACMAIQEAAAABACABAAAAAQAgBxoAACIAMBsAAAQAEBwAACIAMB0BACMAIR5AACQAIR9AACQAISABACMAIQADAAAABAAgAwAABQAwBAAAAQAgAwAAAAQAIAMAAAUAMAQAAAEAIAMAAAAEACADAAAFADAEAAABACAEHQEAAAABHkAAAAABH0AAAAABIAEAAAABAQgAAAkAIAQdAQAAAAEeQAAAAAEfQAAAAAEgAQAAAAEBCAAACwAwAQgAAAsAMAQdAQAoACEeQAApACEfQAApACEgAQAoACECAAAAAQAgCAAADgAgBB0BACgAIR5AACkAIR9AACkAISABACgAIQIAAAAEACAIAAAQACACAAAABAAgCAAAEAAgAwAAAAEAIA8AAAkAIBAAAA4AIAEAAAABACABAAAABAAgAxUAACUAIBYAACcAIBcAACYAIAcaAAAaADAbAAAXABAcAAAaADAdAQAbACEeQAAcACEfQAAcACEgAQAbACEDAAAABAAgAwAAFgAwFAAAFwAgAwAAAAQAIAMAAAUAMAQAAAEAIAcaAAAaADAbAAAXABAcAAAaADAdAQAbACEeQAAcACEfQAAcACEgAQAbACEOFQAAHgAgFgAAIQAgFwAAIQAgIQEAAAABIgEAAAAEIwEAAAAEJAEAAAABJQEAAAABJgEAAAABJwEAAAABKAEAIAAhKQEAAAABKgEAAAABKwEAAAABCxUAAB4AIBYAAB8AIBcAAB8AICFAAAAAASJAAAAABCNAAAAABCRAAAAAASVAAAAAASZAAAAAASdAAAAAAShAAB0AIQsVAAAeACAWAAAfACAXAAAfACAhQAAAAAEiQAAAAAQjQAAAAAQkQAAAAAElQAAAAAEmQAAAAAEnQAAAAAEoQAAdACEIIQIAAAABIgIAAAAEIwIAAAAEJAIAAAABJQIAAAABJgIAAAABJwIAAAABKAIAHgAhCCFAAAAAASJAAAAABCNAAAAABCRAAAAAASVAAAAAASZAAAAAASdAAAAAAShAAB8AIQ4VAAAeACAWAAAhACAXAAAhACAhAQAAAAEiAQAAAAQjAQAAAAQkAQAAAAElAQAAAAEmAQAAAAEnAQAAAAEoAQAgACEpAQAAAAEqAQAAAAErAQAAAAELIQEAAAABIgEAAAAEIwEAAAAEJAEAAAABJQEAAAABJgEAAAABJwEAAAABKAEAIQAhKQEAAAABKgEAAAABKwEAAAABBxoAACIAMBsAAAQAEBwAACIAMB0BACMAIR5AACQAIR9AACQAISABACMAIQshAQAAAAEiAQAAAAQjAQAAAAQkAQAAAAElAQAAAAEmAQAAAAEnAQAAAAEoAQAhACEpAQAAAAEqAQAAAAErAQAAAAEIIUAAAAABIkAAAAAEI0AAAAAEJEAAAAABJUAAAAABJkAAAAABJ0AAAAABKEAAHwAhAAAAASwBAAAAAQEsQAAAAAEAAAAAAxUABhYABxcACAAAAAMVAAYWAAcXAAgBAgECAwEFBgEGBwEHCAEJCgEKDAILDQMMDwENEQIOEgQREwESFAETFQIYGAUZGQk"
|
|
36
|
+
};
|
|
70
37
|
async function decodeBase64AsWasm(wasmBase64) {
|
|
71
38
|
const { Buffer } = await import('node:buffer');
|
|
72
39
|
const wasmArray = Buffer.from(wasmBase64, 'base64');
|
|
73
40
|
return new WebAssembly.Module(wasmArray);
|
|
74
41
|
}
|
|
75
42
|
config.compilerWasm = {
|
|
76
|
-
getRuntime: async () => await import("@prisma/client/runtime/
|
|
43
|
+
getRuntime: async () => await import("@prisma/client/runtime/query_compiler_fast_bg.postgresql.mjs"),
|
|
77
44
|
getQueryCompilerWasmModule: async () => {
|
|
78
|
-
const { wasm } = await import("@prisma/client/runtime/
|
|
45
|
+
const { wasm } = await import("@prisma/client/runtime/query_compiler_fast_bg.postgresql.wasm-base64.mjs");
|
|
79
46
|
return await decodeBase64AsWasm(wasm);
|
|
80
|
-
}
|
|
47
|
+
},
|
|
48
|
+
importName: "./query_compiler_fast_bg.js"
|
|
81
49
|
};
|
|
82
|
-
export function getPrismaClientClass(
|
|
83
|
-
config.dirname = dirname;
|
|
50
|
+
export function getPrismaClientClass() {
|
|
84
51
|
return runtime.getPrismaClient(config);
|
|
85
52
|
}
|
|
@@ -37,13 +37,6 @@ export declare const skip: runtime.Types.Skip;
|
|
|
37
37
|
export declare const Decimal: typeof runtime.Decimal;
|
|
38
38
|
export type Decimal = runtime.Decimal;
|
|
39
39
|
export type DecimalJsLike = runtime.DecimalJsLike;
|
|
40
|
-
/**
|
|
41
|
-
* Metrics
|
|
42
|
-
*/
|
|
43
|
-
export type Metrics = runtime.Metrics;
|
|
44
|
-
export type Metric<T> = runtime.Metric<T>;
|
|
45
|
-
export type MetricHistogram = runtime.MetricHistogram;
|
|
46
|
-
export type MetricHistogramBucket = runtime.MetricHistogramBucket;
|
|
47
40
|
/**
|
|
48
41
|
* Extensions
|
|
49
42
|
*/
|
|
@@ -58,8 +51,8 @@ export type PrismaVersion = {
|
|
|
58
51
|
engine: string;
|
|
59
52
|
};
|
|
60
53
|
/**
|
|
61
|
-
* Prisma Client JS version:
|
|
62
|
-
* Query Engine version:
|
|
54
|
+
* Prisma Client JS version: 7.9.0
|
|
55
|
+
* Query Engine version: e922089b7d7502aff4249d5da3420f6fa55fc6ad
|
|
63
56
|
*/
|
|
64
57
|
export declare const prismaVersion: PrismaVersion;
|
|
65
58
|
/**
|
|
@@ -73,43 +66,28 @@ export type InputJsonObject = runtime.InputJsonObject;
|
|
|
73
66
|
export type InputJsonArray = runtime.InputJsonArray;
|
|
74
67
|
export type InputJsonValue = runtime.InputJsonValue;
|
|
75
68
|
export declare const NullTypes: {
|
|
76
|
-
DbNull: (new (secret: never) => typeof runtime.
|
|
77
|
-
JsonNull: (new (secret: never) => typeof runtime.
|
|
78
|
-
AnyNull: (new (secret: never) => typeof runtime.
|
|
69
|
+
DbNull: (new (secret: never) => typeof runtime.DbNull);
|
|
70
|
+
JsonNull: (new (secret: never) => typeof runtime.JsonNull);
|
|
71
|
+
AnyNull: (new (secret: never) => typeof runtime.AnyNull);
|
|
79
72
|
};
|
|
80
73
|
/**
|
|
81
74
|
* Helper for filtering JSON entries that have `null` on the database (empty on the db)
|
|
82
75
|
*
|
|
83
76
|
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
|
|
84
77
|
*/
|
|
85
|
-
export declare const DbNull:
|
|
86
|
-
"__#private@#private": any;
|
|
87
|
-
_getNamespace(): string;
|
|
88
|
-
_getName(): string;
|
|
89
|
-
toString(): string;
|
|
90
|
-
};
|
|
78
|
+
export declare const DbNull: runtime.DbNullClass;
|
|
91
79
|
/**
|
|
92
80
|
* Helper for filtering JSON entries that have JSON `null` values (not empty on the db)
|
|
93
81
|
*
|
|
94
82
|
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
|
|
95
83
|
*/
|
|
96
|
-
export declare const JsonNull:
|
|
97
|
-
"__#private@#private": any;
|
|
98
|
-
_getNamespace(): string;
|
|
99
|
-
_getName(): string;
|
|
100
|
-
toString(): string;
|
|
101
|
-
};
|
|
84
|
+
export declare const JsonNull: runtime.JsonNullClass;
|
|
102
85
|
/**
|
|
103
86
|
* Helper for filtering JSON entries that are `Prisma.DbNull` or `Prisma.JsonNull`
|
|
104
87
|
*
|
|
105
88
|
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
|
|
106
89
|
*/
|
|
107
|
-
export declare const AnyNull:
|
|
108
|
-
"__#private@#private": any;
|
|
109
|
-
_getNamespace(): string;
|
|
110
|
-
_getName(): string;
|
|
111
|
-
toString(): string;
|
|
112
|
-
};
|
|
90
|
+
export declare const AnyNull: runtime.AnyNullClass;
|
|
113
91
|
type SelectAndInclude = {
|
|
114
92
|
select: any;
|
|
115
93
|
include: any;
|
|
@@ -132,6 +110,19 @@ export type Enumerable<T> = T | Array<T>;
|
|
|
132
110
|
export type Subset<T, U> = {
|
|
133
111
|
[key in keyof T]: key extends keyof U ? T[key] : never;
|
|
134
112
|
};
|
|
113
|
+
/**
|
|
114
|
+
* Resolved type of the argument passed to the `PrismaClient` constructor.
|
|
115
|
+
*
|
|
116
|
+
* When called without a narrower options type (the common case), this resolves
|
|
117
|
+
* to `PrismaClientOptions` directly, which produces a clear TypeScript error
|
|
118
|
+
* message (`not assignable to parameter of type 'PrismaClientOptions'`) when
|
|
119
|
+
* the argument is missing or incomplete. When the user supplies a narrower
|
|
120
|
+
* options type (e.g. via a literal), it falls back to `Subset` to keep
|
|
121
|
+
* filtering out unknown properties.
|
|
122
|
+
*/
|
|
123
|
+
export type PrismaClientConstructorArgs<Options extends PrismaClientOptions> = [
|
|
124
|
+
PrismaClientOptions
|
|
125
|
+
] extends [Options] ? PrismaClientOptions : Subset<Options, PrismaClientOptions>;
|
|
135
126
|
/**
|
|
136
127
|
* SelectSubset
|
|
137
128
|
* @desc From `T` pick properties that exist in `U`. Simple version of Intersection.
|
|
@@ -154,7 +145,7 @@ type Without<T, U> = {
|
|
|
154
145
|
* XOR is needed to have a real mutually exclusive union type
|
|
155
146
|
* https://stackoverflow.com/questions/42123407/does-typescript-support-mutually-exclusive-types
|
|
156
147
|
*/
|
|
157
|
-
export type XOR<T, U> = T extends object ? U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : U : T;
|
|
148
|
+
export type XOR<T, U> = T extends object ? U extends object ? ((Without<T, U> & U) | (Without<U, T> & T)) & object : U : T;
|
|
158
149
|
/**
|
|
159
150
|
* Is T a Record?
|
|
160
151
|
*/
|
|
@@ -438,24 +429,13 @@ export type ListIntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel,
|
|
|
438
429
|
export type BatchPayload = {
|
|
439
430
|
count: number;
|
|
440
431
|
};
|
|
441
|
-
export type Datasource = {
|
|
442
|
-
url?: string;
|
|
443
|
-
};
|
|
444
|
-
export type Datasources = {
|
|
445
|
-
db?: Datasource;
|
|
446
|
-
};
|
|
447
432
|
export declare const defineExtension: runtime.Types.Extensions.ExtendsHook<"define", TypeMapCb, runtime.Types.Extensions.DefaultArgs>;
|
|
448
433
|
export type DefaultPrismaClient = PrismaClient;
|
|
449
434
|
export type ErrorFormat = 'pretty' | 'colorless' | 'minimal';
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
datasources?: Datasources;
|
|
455
|
-
/**
|
|
456
|
-
* Overwrites the datasource url from your schema.prisma file
|
|
457
|
-
*/
|
|
458
|
-
datasourceUrl?: string;
|
|
435
|
+
/**
|
|
436
|
+
* Options common to all variants of `PrismaClientOptions`, regardless of whether you connect to your database through a driver adapter or through Prisma Accelerate.
|
|
437
|
+
*/
|
|
438
|
+
export interface PrismaClientBaseOptions {
|
|
459
439
|
/**
|
|
460
440
|
* @default "colorless"
|
|
461
441
|
*/
|
|
@@ -482,7 +462,7 @@ export interface PrismaClientOptions {
|
|
|
482
462
|
* { emit: 'stdout', level: 'error' }
|
|
483
463
|
*
|
|
484
464
|
* ```
|
|
485
|
-
* Read more in our [docs](https://
|
|
465
|
+
* Read more in our [docs](https://pris.ly/d/logging).
|
|
486
466
|
*/
|
|
487
467
|
log?: (LogLevel | LogDefinition)[];
|
|
488
468
|
/**
|
|
@@ -495,10 +475,6 @@ export interface PrismaClientOptions {
|
|
|
495
475
|
timeout?: number;
|
|
496
476
|
isolationLevel?: TransactionIsolationLevel;
|
|
497
477
|
};
|
|
498
|
-
/**
|
|
499
|
-
* Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale`
|
|
500
|
-
*/
|
|
501
|
-
adapter?: runtime.SqlDriverAdapterFactory | null;
|
|
502
478
|
/**
|
|
503
479
|
* Global configuration for omitting model fields by default.
|
|
504
480
|
*
|
|
@@ -514,7 +490,85 @@ export interface PrismaClientOptions {
|
|
|
514
490
|
* ```
|
|
515
491
|
*/
|
|
516
492
|
omit?: GlobalOmitConfig;
|
|
493
|
+
/**
|
|
494
|
+
* SQL commenter plugins that add metadata to SQL queries as comments.
|
|
495
|
+
* Comments follow the sqlcommenter format: https://google.github.io/sqlcommenter/
|
|
496
|
+
*
|
|
497
|
+
* @example
|
|
498
|
+
* ```
|
|
499
|
+
* const prisma = new PrismaClient({
|
|
500
|
+
* adapter,
|
|
501
|
+
* comments: [
|
|
502
|
+
* traceContext(),
|
|
503
|
+
* queryInsights(),
|
|
504
|
+
* ],
|
|
505
|
+
* })
|
|
506
|
+
* ```
|
|
507
|
+
*/
|
|
508
|
+
comments?: runtime.SqlCommenterPlugin[];
|
|
509
|
+
/**
|
|
510
|
+
* Optional maximum size for the query plan cache. If not provided, a default size will be used.
|
|
511
|
+
* A value of `0` can be used to disable the cache entirely. A higher cache size can improve
|
|
512
|
+
* performance for applications that execute a large number of unique queries, while a smaller
|
|
513
|
+
* cache size can reduce memory usage.
|
|
514
|
+
*
|
|
515
|
+
* @example
|
|
516
|
+
* ```
|
|
517
|
+
* const prisma = new PrismaClient({
|
|
518
|
+
* adapter,
|
|
519
|
+
* queryPlanCacheMaxSize: 100,
|
|
520
|
+
* })
|
|
521
|
+
* ```
|
|
522
|
+
*/
|
|
523
|
+
queryPlanCacheMaxSize?: number;
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* `PrismaClient` options for connecting to your database through Prisma Accelerate instead of a driver adapter.
|
|
527
|
+
*
|
|
528
|
+
* Learn more: https://pris.ly/d/accelerate
|
|
529
|
+
*/
|
|
530
|
+
export interface PrismaClientOptionsWithAccelerateUrl extends PrismaClientBaseOptions {
|
|
531
|
+
/**
|
|
532
|
+
* The Prisma Accelerate connection URL. Use this option to connect to your database through Prisma Accelerate instead of using a driver adapter to connect directly.
|
|
533
|
+
*
|
|
534
|
+
* Learn more: https://pris.ly/d/accelerate
|
|
535
|
+
*/
|
|
536
|
+
accelerateUrl: string;
|
|
537
|
+
adapter?: never;
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* `PrismaClient` options for connecting to your database through a driver adapter. This is the common case in Prisma 7.
|
|
541
|
+
*
|
|
542
|
+
* Learn more: https://pris.ly/d/driver-adapters
|
|
543
|
+
*/
|
|
544
|
+
export interface PrismaClientOptionsWithAdapter extends PrismaClientBaseOptions {
|
|
545
|
+
/**
|
|
546
|
+
* A driver adapter that PrismaClient uses to connect to your database, such as the ones provided by `@prisma/adapter-pg`, `@prisma/adapter-libsql`, `@prisma/adapter-planetscale`, etc.
|
|
547
|
+
*
|
|
548
|
+
* A driver adapter is **required** unless you connect to your database through Prisma Accelerate (in which case use `accelerateUrl` instead).
|
|
549
|
+
*
|
|
550
|
+
* Learn more: https://pris.ly/d/driver-adapters
|
|
551
|
+
*
|
|
552
|
+
* @example
|
|
553
|
+
* ```ts
|
|
554
|
+
* import { PrismaPg } from '@prisma/adapter-pg'
|
|
555
|
+
* import { PrismaClient } from './generated/prisma/client'
|
|
556
|
+
*
|
|
557
|
+
* const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL })
|
|
558
|
+
* const prisma = new PrismaClient({ adapter })
|
|
559
|
+
* ```
|
|
560
|
+
*/
|
|
561
|
+
adapter: runtime.SqlDriverAdapterFactory;
|
|
562
|
+
accelerateUrl?: never;
|
|
517
563
|
}
|
|
564
|
+
/**
|
|
565
|
+
* Options passed to the `PrismaClient` constructor.
|
|
566
|
+
*
|
|
567
|
+
* A driver adapter (or, alternatively, a Prisma Accelerate URL) is **required**. See {@link PrismaClientOptionsWithAdapter} and {@link PrismaClientOptionsWithAccelerateUrl} for the two variants. All other properties live in {@link PrismaClientBaseOptions} and are optional.
|
|
568
|
+
*
|
|
569
|
+
* Learn more about driver adapters: https://pris.ly/d/driver-adapters
|
|
570
|
+
*/
|
|
571
|
+
export type PrismaClientOptions = PrismaClientOptionsWithAccelerateUrl | PrismaClientOptionsWithAdapter;
|
|
518
572
|
export type GlobalOmitConfig = {
|
|
519
573
|
user?: Prisma.UserOmit;
|
|
520
574
|
};
|
|
@@ -39,36 +39,36 @@ export const skip = runtime.skip;
|
|
|
39
39
|
export const Decimal = runtime.Decimal;
|
|
40
40
|
export const getExtensionContext = runtime.Extensions.getExtensionContext;
|
|
41
41
|
/**
|
|
42
|
-
* Prisma Client JS version:
|
|
43
|
-
* Query Engine version:
|
|
42
|
+
* Prisma Client JS version: 7.9.0
|
|
43
|
+
* Query Engine version: e922089b7d7502aff4249d5da3420f6fa55fc6ad
|
|
44
44
|
*/
|
|
45
45
|
export const prismaVersion = {
|
|
46
|
-
client: "
|
|
47
|
-
engine: "
|
|
46
|
+
client: "7.9.0",
|
|
47
|
+
engine: "e922089b7d7502aff4249d5da3420f6fa55fc6ad"
|
|
48
48
|
};
|
|
49
49
|
export const NullTypes = {
|
|
50
|
-
DbNull: runtime.
|
|
51
|
-
JsonNull: runtime.
|
|
52
|
-
AnyNull: runtime.
|
|
50
|
+
DbNull: runtime.NullTypes.DbNull,
|
|
51
|
+
JsonNull: runtime.NullTypes.JsonNull,
|
|
52
|
+
AnyNull: runtime.NullTypes.AnyNull,
|
|
53
53
|
};
|
|
54
54
|
/**
|
|
55
55
|
* Helper for filtering JSON entries that have `null` on the database (empty on the db)
|
|
56
56
|
*
|
|
57
57
|
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
|
|
58
58
|
*/
|
|
59
|
-
export const DbNull = runtime.
|
|
59
|
+
export const DbNull = runtime.DbNull;
|
|
60
60
|
/**
|
|
61
61
|
* Helper for filtering JSON entries that have JSON `null` values (not empty on the db)
|
|
62
62
|
*
|
|
63
63
|
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
|
|
64
64
|
*/
|
|
65
|
-
export const JsonNull = runtime.
|
|
65
|
+
export const JsonNull = runtime.JsonNull;
|
|
66
66
|
/**
|
|
67
67
|
* Helper for filtering JSON entries that are `Prisma.DbNull` or `Prisma.JsonNull`
|
|
68
68
|
*
|
|
69
69
|
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
|
|
70
70
|
*/
|
|
71
|
-
export const AnyNull = runtime.
|
|
71
|
+
export const AnyNull = runtime.AnyNull;
|
|
72
72
|
export const ModelName = {
|
|
73
73
|
User: 'User'
|
|
74
74
|
};
|