auth-vir 5.1.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 +8 -8
- package/dist/auth-client/backend-auth.client.d.ts +7 -2
- package/dist/auth-client/backend-auth.client.js +29 -5
- package/dist/auth-client/frontend-auth.client.d.ts +6 -2
- package/dist/auth-client/frontend-auth.client.js +6 -4
- package/dist/auth.d.ts +22 -9
- package/dist/auth.js +15 -5
- package/dist/cookie.d.ts +28 -5
- package/dist/cookie.js +22 -7
- package/dist/csrf-token.d.ts +2 -2
- package/dist/csrf-token.js +5 -4
- 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 +43 -19
- package/src/auth-client/frontend-auth.client.ts +12 -7
- package/src/auth.ts +50 -24
- package/src/cookie.ts +55 -15
- package/src/csrf-token.ts +10 -5
- 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
|
@@ -16,63 +16,30 @@ import type * as Prisma from "./prismaNamespace.js"
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
const config: runtime.GetPrismaClientConfig = {
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"fromEnvVar": null,
|
|
23
|
-
"value": "prisma-client"
|
|
24
|
-
},
|
|
25
|
-
"output": {
|
|
26
|
-
"value": "/Users/electrovir/repos/electrovir/auth-vir/packages/auth-vir/src/generated",
|
|
27
|
-
"fromEnvVar": null
|
|
28
|
-
},
|
|
29
|
-
"config": {
|
|
30
|
-
"engineType": "client",
|
|
31
|
-
"moduleFormat": "esm"
|
|
32
|
-
},
|
|
33
|
-
"binaryTargets": [
|
|
34
|
-
{
|
|
35
|
-
"fromEnvVar": null,
|
|
36
|
-
"value": "darwin-arm64",
|
|
37
|
-
"native": true
|
|
38
|
-
}
|
|
39
|
-
],
|
|
40
|
-
"previewFeatures": [
|
|
41
|
-
"relationJoins",
|
|
42
|
-
"strictUndefinedChecks"
|
|
43
|
-
],
|
|
44
|
-
"sourceFilePath": "/Users/electrovir/repos/electrovir/auth-vir/packages/auth-vir/test-files/schema.prisma",
|
|
45
|
-
"isCustomOutput": true
|
|
46
|
-
},
|
|
47
|
-
"relativePath": "../../test-files",
|
|
48
|
-
"clientVersion": "6.19.2",
|
|
49
|
-
"engineVersion": "c2990dca591cba766e3b7ef5d9e8a84796e47ab7",
|
|
50
|
-
"datasourceNames": [
|
|
51
|
-
"db"
|
|
19
|
+
"previewFeatures": [
|
|
20
|
+
"relationJoins",
|
|
21
|
+
"strictUndefinedChecks"
|
|
52
22
|
],
|
|
23
|
+
"clientVersion": "7.9.0",
|
|
24
|
+
"engineVersion": "e922089b7d7502aff4249d5da3420f6fa55fc6ad",
|
|
53
25
|
"activeProvider": "postgresql",
|
|
54
|
-
"
|
|
55
|
-
"inlineDatasources": {
|
|
56
|
-
"db": {
|
|
57
|
-
"url": {
|
|
58
|
-
"fromEnvVar": "DATABASE_URL",
|
|
59
|
-
"value": null
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
"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",
|
|
64
|
-
"inlineSchemaHash": "23208c8e58615c00e5101cfaaa5341ce46c109a1169d3aea10dae8caa3594dcc",
|
|
65
|
-
"copyEngine": true,
|
|
26
|
+
"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",
|
|
66
27
|
"runtimeDataModel": {
|
|
67
28
|
"models": {},
|
|
68
29
|
"enums": {},
|
|
69
30
|
"types": {}
|
|
70
31
|
},
|
|
71
|
-
"
|
|
32
|
+
"parameterizationSchema": {
|
|
33
|
+
"strings": [],
|
|
34
|
+
"graph": ""
|
|
35
|
+
}
|
|
72
36
|
}
|
|
73
37
|
|
|
74
38
|
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\":{}}")
|
|
75
|
-
config.
|
|
39
|
+
config.parameterizationSchema = {
|
|
40
|
+
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\"]"),
|
|
41
|
+
graph: "KQkQBxoAACIAMBsAAAQAEBwAACIAMB0BAAAAAR5AACQAIR9AACQAISABACMAIQEAAAABACABAAAAAQAgBxoAACIAMBsAAAQAEBwAACIAMB0BACMAIR5AACQAIR9AACQAISABACMAIQADAAAABAAgAwAABQAwBAAAAQAgAwAAAAQAIAMAAAUAMAQAAAEAIAMAAAAEACADAAAFADAEAAABACAEHQEAAAABHkAAAAABH0AAAAABIAEAAAABAQgAAAkAIAQdAQAAAAEeQAAAAAEfQAAAAAEgAQAAAAEBCAAACwAwAQgAAAsAMAQdAQAoACEeQAApACEfQAApACEgAQAoACECAAAAAQAgCAAADgAgBB0BACgAIR5AACkAIR9AACkAISABACgAIQIAAAAEACAIAAAQACACAAAABAAgCAAAEAAgAwAAAAEAIA8AAAkAIBAAAA4AIAEAAAABACABAAAABAAgAxUAACUAIBYAACcAIBcAACYAIAcaAAAaADAbAAAXABAcAAAaADAdAQAbACEeQAAcACEfQAAcACEgAQAbACEDAAAABAAgAwAAFgAwFAAAFwAgAwAAAAQAIAMAAAUAMAQAAAEAIAcaAAAaADAbAAAXABAcAAAaADAdAQAbACEeQAAcACEfQAAcACEgAQAbACEOFQAAHgAgFgAAIQAgFwAAIQAgIQEAAAABIgEAAAAEIwEAAAAEJAEAAAABJQEAAAABJgEAAAABJwEAAAABKAEAIAAhKQEAAAABKgEAAAABKwEAAAABCxUAAB4AIBYAAB8AIBcAAB8AICFAAAAAASJAAAAABCNAAAAABCRAAAAAASVAAAAAASZAAAAAASdAAAAAAShAAB0AIQsVAAAeACAWAAAfACAXAAAfACAhQAAAAAEiQAAAAAQjQAAAAAQkQAAAAAElQAAAAAEmQAAAAAEnQAAAAAEoQAAdACEIIQIAAAABIgIAAAAEIwIAAAAEJAIAAAABJQIAAAABJgIAAAABJwIAAAABKAIAHgAhCCFAAAAAASJAAAAABCNAAAAABCRAAAAAASVAAAAAASZAAAAAASdAAAAAAShAAB8AIQ4VAAAeACAWAAAhACAXAAAhACAhAQAAAAEiAQAAAAQjAQAAAAQkAQAAAAElAQAAAAEmAQAAAAEnAQAAAAEoAQAgACEpAQAAAAEqAQAAAAErAQAAAAELIQEAAAABIgEAAAAEIwEAAAAEJAEAAAABJQEAAAABJgEAAAABJwEAAAABKAEAIQAhKQEAAAABKgEAAAABKwEAAAABBxoAACIAMBsAAAQAEBwAACIAMB0BACMAIR5AACQAIR9AACQAISABACMAIQshAQAAAAEiAQAAAAQjAQAAAAQkAQAAAAElAQAAAAEmAQAAAAEnAQAAAAEoAQAhACEpAQAAAAEqAQAAAAErAQAAAAEIIUAAAAABIkAAAAAEI0AAAAAEJEAAAAABJUAAAAABJkAAAAABJ0AAAAABKEAAHwAhAAAAASwBAAAAAQEsQAAAAAEAAAAAAxUABhYABxcACAAAAAMVAAYWAAcXAAgBAgECAwEFBgEGBwEHCAEJCgEKDAILDQMMDwENEQIOEgQREwESFAETFQIYGAUZGQk"
|
|
42
|
+
}
|
|
76
43
|
|
|
77
44
|
async function decodeBase64AsWasm(wasmBase64: string): Promise<WebAssembly.Module> {
|
|
78
45
|
const { Buffer } = await import('node:buffer')
|
|
@@ -81,14 +48,15 @@ async function decodeBase64AsWasm(wasmBase64: string): Promise<WebAssembly.Modul
|
|
|
81
48
|
}
|
|
82
49
|
|
|
83
50
|
config.compilerWasm = {
|
|
84
|
-
getRuntime: async () => await import("@prisma/client/runtime/
|
|
51
|
+
getRuntime: async () => await import("@prisma/client/runtime/query_compiler_fast_bg.postgresql.mjs"),
|
|
85
52
|
|
|
86
53
|
getQueryCompilerWasmModule: async () => {
|
|
87
|
-
const { wasm } = await import("@prisma/client/runtime/
|
|
54
|
+
const { wasm } = await import("@prisma/client/runtime/query_compiler_fast_bg.postgresql.wasm-base64.mjs")
|
|
88
55
|
return await decodeBase64AsWasm(wasm)
|
|
89
|
-
}
|
|
90
|
-
}
|
|
56
|
+
},
|
|
91
57
|
|
|
58
|
+
importName: "./query_compiler_fast_bg.js"
|
|
59
|
+
}
|
|
92
60
|
|
|
93
61
|
|
|
94
62
|
|
|
@@ -102,12 +70,14 @@ export interface PrismaClientConstructor {
|
|
|
102
70
|
* Type-safe database client for TypeScript
|
|
103
71
|
* @example
|
|
104
72
|
* ```
|
|
105
|
-
* const prisma = new PrismaClient(
|
|
73
|
+
* const prisma = new PrismaClient({
|
|
74
|
+
* adapter: new PrismaPg({ connectionString: process.env.DATABASE_URL })
|
|
75
|
+
* })
|
|
106
76
|
* // Fetch zero or more Users
|
|
107
77
|
* const users = await prisma.user.findMany()
|
|
108
78
|
* ```
|
|
109
79
|
*
|
|
110
|
-
* Read more in our [docs](https://
|
|
80
|
+
* Read more in our [docs](https://pris.ly/d/client).
|
|
111
81
|
*/
|
|
112
82
|
|
|
113
83
|
new <
|
|
@@ -115,7 +85,7 @@ export interface PrismaClientConstructor {
|
|
|
115
85
|
LogOpts extends LogOptions<Options> = LogOptions<Options>,
|
|
116
86
|
OmitOpts extends Prisma.PrismaClientOptions['omit'] = Options extends { omit: infer U } ? U : Prisma.PrismaClientOptions['omit'],
|
|
117
87
|
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
|
|
118
|
-
>(options
|
|
88
|
+
>(options: Prisma.PrismaClientConstructorArgs<Options>): PrismaClient<LogOpts, OmitOpts, ExtArgs>
|
|
119
89
|
}
|
|
120
90
|
|
|
121
91
|
/**
|
|
@@ -124,12 +94,14 @@ export interface PrismaClientConstructor {
|
|
|
124
94
|
* Type-safe database client for TypeScript
|
|
125
95
|
* @example
|
|
126
96
|
* ```
|
|
127
|
-
* const prisma = new PrismaClient(
|
|
97
|
+
* const prisma = new PrismaClient({
|
|
98
|
+
* adapter: new PrismaPg({ connectionString: process.env.DATABASE_URL })
|
|
99
|
+
* })
|
|
128
100
|
* // Fetch zero or more Users
|
|
129
101
|
* const users = await prisma.user.findMany()
|
|
130
102
|
* ```
|
|
131
103
|
*
|
|
132
|
-
* Read more in our [docs](https://
|
|
104
|
+
* Read more in our [docs](https://pris.ly/d/client).
|
|
133
105
|
*/
|
|
134
106
|
|
|
135
107
|
export interface PrismaClient<
|
|
@@ -158,7 +130,7 @@ export interface PrismaClient<
|
|
|
158
130
|
* const result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`
|
|
159
131
|
* ```
|
|
160
132
|
*
|
|
161
|
-
* Read more in our [docs](https://
|
|
133
|
+
* Read more in our [docs](https://pris.ly/d/raw-queries).
|
|
162
134
|
*/
|
|
163
135
|
$executeRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<number>;
|
|
164
136
|
|
|
@@ -170,7 +142,7 @@ export interface PrismaClient<
|
|
|
170
142
|
* const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com')
|
|
171
143
|
* ```
|
|
172
144
|
*
|
|
173
|
-
* Read more in our [docs](https://
|
|
145
|
+
* Read more in our [docs](https://pris.ly/d/raw-queries).
|
|
174
146
|
*/
|
|
175
147
|
$executeRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<number>;
|
|
176
148
|
|
|
@@ -181,7 +153,7 @@ export interface PrismaClient<
|
|
|
181
153
|
* const result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`
|
|
182
154
|
* ```
|
|
183
155
|
*
|
|
184
|
-
* Read more in our [docs](https://
|
|
156
|
+
* Read more in our [docs](https://pris.ly/d/raw-queries).
|
|
185
157
|
*/
|
|
186
158
|
$queryRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<T>;
|
|
187
159
|
|
|
@@ -193,7 +165,7 @@ export interface PrismaClient<
|
|
|
193
165
|
* const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com')
|
|
194
166
|
* ```
|
|
195
167
|
*
|
|
196
|
-
* Read more in our [docs](https://
|
|
168
|
+
* Read more in our [docs](https://pris.ly/d/raw-queries).
|
|
197
169
|
*/
|
|
198
170
|
$queryRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<T>;
|
|
199
171
|
|
|
@@ -209,13 +181,12 @@ export interface PrismaClient<
|
|
|
209
181
|
* ])
|
|
210
182
|
* ```
|
|
211
183
|
*
|
|
212
|
-
* Read more in our [docs](https://www.prisma.io/docs/
|
|
184
|
+
* Read more in our [docs](https://www.prisma.io/docs/orm/prisma-client/queries/transactions).
|
|
213
185
|
*/
|
|
214
|
-
$transaction<P extends Prisma.PrismaPromise<any>[]>(arg: [...P], options?: { isolationLevel?: Prisma.TransactionIsolationLevel }): runtime.Types.Utils.JsPromise<runtime.Types.Utils.UnwrapTuple<P>>
|
|
186
|
+
$transaction<P extends Prisma.PrismaPromise<any>[]>(arg: [...P], options?: { maxWait?: number, timeout?: number, isolationLevel?: Prisma.TransactionIsolationLevel }): runtime.Types.Utils.JsPromise<runtime.Types.Utils.UnwrapTuple<P>>
|
|
215
187
|
|
|
216
188
|
$transaction<R>(fn: (prisma: Omit<PrismaClient, runtime.ITXClientDenyList>) => runtime.Types.Utils.JsPromise<R>, options?: { maxWait?: number, timeout?: number, isolationLevel?: Prisma.TransactionIsolationLevel }): runtime.Types.Utils.JsPromise<R>
|
|
217
189
|
|
|
218
|
-
|
|
219
190
|
$extends: runtime.Types.Extensions.ExtendsHook<"extends", Prisma.TypeMapCb<OmitOpts>, ExtArgs, runtime.Types.Utils.Call<Prisma.TypeMapCb<OmitOpts>, {
|
|
220
191
|
extArgs: ExtArgs
|
|
221
192
|
}>>
|
|
@@ -231,7 +202,6 @@ export interface PrismaClient<
|
|
|
231
202
|
get user(): Prisma.UserDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
232
203
|
}
|
|
233
204
|
|
|
234
|
-
export function getPrismaClientClass(
|
|
235
|
-
config.dirname = dirname
|
|
205
|
+
export function getPrismaClientClass(): PrismaClientConstructor {
|
|
236
206
|
return runtime.getPrismaClient(config) as unknown as PrismaClientConstructor
|
|
237
207
|
}
|
|
@@ -70,14 +70,6 @@ export type Decimal = runtime.Decimal
|
|
|
70
70
|
|
|
71
71
|
export type DecimalJsLike = runtime.DecimalJsLike
|
|
72
72
|
|
|
73
|
-
/**
|
|
74
|
-
* Metrics
|
|
75
|
-
*/
|
|
76
|
-
export type Metrics = runtime.Metrics
|
|
77
|
-
export type Metric<T> = runtime.Metric<T>
|
|
78
|
-
export type MetricHistogram = runtime.MetricHistogram
|
|
79
|
-
export type MetricHistogramBucket = runtime.MetricHistogramBucket
|
|
80
|
-
|
|
81
73
|
/**
|
|
82
74
|
* Extensions
|
|
83
75
|
*/
|
|
@@ -94,12 +86,12 @@ export type PrismaVersion = {
|
|
|
94
86
|
}
|
|
95
87
|
|
|
96
88
|
/**
|
|
97
|
-
* Prisma Client JS version:
|
|
98
|
-
* Query Engine version:
|
|
89
|
+
* Prisma Client JS version: 7.9.0
|
|
90
|
+
* Query Engine version: e922089b7d7502aff4249d5da3420f6fa55fc6ad
|
|
99
91
|
*/
|
|
100
92
|
export const prismaVersion: PrismaVersion = {
|
|
101
|
-
client: "
|
|
102
|
-
engine: "
|
|
93
|
+
client: "7.9.0",
|
|
94
|
+
engine: "e922089b7d7502aff4249d5da3420f6fa55fc6ad"
|
|
103
95
|
}
|
|
104
96
|
|
|
105
97
|
/**
|
|
@@ -116,28 +108,30 @@ export type InputJsonValue = runtime.InputJsonValue
|
|
|
116
108
|
|
|
117
109
|
|
|
118
110
|
export const NullTypes = {
|
|
119
|
-
DbNull: runtime.
|
|
120
|
-
JsonNull: runtime.
|
|
121
|
-
AnyNull: runtime.
|
|
111
|
+
DbNull: runtime.NullTypes.DbNull as (new (secret: never) => typeof runtime.DbNull),
|
|
112
|
+
JsonNull: runtime.NullTypes.JsonNull as (new (secret: never) => typeof runtime.JsonNull),
|
|
113
|
+
AnyNull: runtime.NullTypes.AnyNull as (new (secret: never) => typeof runtime.AnyNull),
|
|
122
114
|
}
|
|
123
115
|
/**
|
|
124
116
|
* Helper for filtering JSON entries that have `null` on the database (empty on the db)
|
|
125
117
|
*
|
|
126
118
|
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
|
|
127
119
|
*/
|
|
128
|
-
export const DbNull = runtime.
|
|
120
|
+
export const DbNull = runtime.DbNull
|
|
121
|
+
|
|
129
122
|
/**
|
|
130
123
|
* Helper for filtering JSON entries that have JSON `null` values (not empty on the db)
|
|
131
124
|
*
|
|
132
125
|
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
|
|
133
126
|
*/
|
|
134
|
-
export const JsonNull = runtime.
|
|
127
|
+
export const JsonNull = runtime.JsonNull
|
|
128
|
+
|
|
135
129
|
/**
|
|
136
130
|
* Helper for filtering JSON entries that are `Prisma.DbNull` or `Prisma.JsonNull`
|
|
137
131
|
*
|
|
138
132
|
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
|
|
139
133
|
*/
|
|
140
|
-
export const AnyNull = runtime.
|
|
134
|
+
export const AnyNull = runtime.AnyNull
|
|
141
135
|
|
|
142
136
|
|
|
143
137
|
type SelectAndInclude = {
|
|
@@ -167,6 +161,19 @@ export type Subset<T, U> = {
|
|
|
167
161
|
[key in keyof T]: key extends keyof U ? T[key] : never;
|
|
168
162
|
};
|
|
169
163
|
|
|
164
|
+
/**
|
|
165
|
+
* Resolved type of the argument passed to the `PrismaClient` constructor.
|
|
166
|
+
*
|
|
167
|
+
* When called without a narrower options type (the common case), this resolves
|
|
168
|
+
* to `PrismaClientOptions` directly, which produces a clear TypeScript error
|
|
169
|
+
* message (`not assignable to parameter of type 'PrismaClientOptions'`) when
|
|
170
|
+
* the argument is missing or incomplete. When the user supplies a narrower
|
|
171
|
+
* options type (e.g. via a literal), it falls back to `Subset` to keep
|
|
172
|
+
* filtering out unknown properties.
|
|
173
|
+
*/
|
|
174
|
+
export type PrismaClientConstructorArgs<Options extends PrismaClientOptions> =
|
|
175
|
+
[PrismaClientOptions] extends [Options] ? PrismaClientOptions : Subset<Options, PrismaClientOptions>;
|
|
176
|
+
|
|
170
177
|
/**
|
|
171
178
|
* SelectSubset
|
|
172
179
|
* @desc From `T` pick properties that exist in `U`. Simple version of Intersection.
|
|
@@ -199,7 +206,7 @@ type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never };
|
|
|
199
206
|
export type XOR<T, U> =
|
|
200
207
|
T extends object ?
|
|
201
208
|
U extends object ?
|
|
202
|
-
(Without<T, U> & U) | (Without<U, T> & T)
|
|
209
|
+
((Without<T, U> & U) | (Without<U, T> & T)) & object
|
|
203
210
|
: U : T
|
|
204
211
|
|
|
205
212
|
|
|
@@ -617,26 +624,13 @@ export type BatchPayload = {
|
|
|
617
624
|
count: number
|
|
618
625
|
}
|
|
619
626
|
|
|
620
|
-
|
|
621
|
-
export type Datasource = {
|
|
622
|
-
url?: string
|
|
623
|
-
}
|
|
624
|
-
export type Datasources = {
|
|
625
|
-
db?: Datasource
|
|
626
|
-
}
|
|
627
|
-
|
|
628
627
|
export const defineExtension = runtime.Extensions.defineExtension as unknown as runtime.Types.Extensions.ExtendsHook<"define", TypeMapCb, runtime.Types.Extensions.DefaultArgs>
|
|
629
628
|
export type DefaultPrismaClient = PrismaClient
|
|
630
629
|
export type ErrorFormat = 'pretty' | 'colorless' | 'minimal'
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
datasources?: Datasources
|
|
636
|
-
/**
|
|
637
|
-
* Overwrites the datasource url from your schema.prisma file
|
|
638
|
-
*/
|
|
639
|
-
datasourceUrl?: string
|
|
630
|
+
/**
|
|
631
|
+
* Options common to all variants of `PrismaClientOptions`, regardless of whether you connect to your database through a driver adapter or through Prisma Accelerate.
|
|
632
|
+
*/
|
|
633
|
+
export interface PrismaClientBaseOptions {
|
|
640
634
|
/**
|
|
641
635
|
* @default "colorless"
|
|
642
636
|
*/
|
|
@@ -663,7 +657,7 @@ export interface PrismaClientOptions {
|
|
|
663
657
|
* { emit: 'stdout', level: 'error' }
|
|
664
658
|
*
|
|
665
659
|
* ```
|
|
666
|
-
* Read more in our [docs](https://
|
|
660
|
+
* Read more in our [docs](https://pris.ly/d/logging).
|
|
667
661
|
*/
|
|
668
662
|
log?: (LogLevel | LogDefinition)[]
|
|
669
663
|
/**
|
|
@@ -676,10 +670,6 @@ export interface PrismaClientOptions {
|
|
|
676
670
|
timeout?: number
|
|
677
671
|
isolationLevel?: TransactionIsolationLevel
|
|
678
672
|
}
|
|
679
|
-
/**
|
|
680
|
-
* Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale`
|
|
681
|
-
*/
|
|
682
|
-
adapter?: runtime.SqlDriverAdapterFactory | null
|
|
683
673
|
/**
|
|
684
674
|
* Global configuration for omitting model fields by default.
|
|
685
675
|
*
|
|
@@ -695,7 +685,88 @@ export interface PrismaClientOptions {
|
|
|
695
685
|
* ```
|
|
696
686
|
*/
|
|
697
687
|
omit?: GlobalOmitConfig
|
|
688
|
+
/**
|
|
689
|
+
* SQL commenter plugins that add metadata to SQL queries as comments.
|
|
690
|
+
* Comments follow the sqlcommenter format: https://google.github.io/sqlcommenter/
|
|
691
|
+
*
|
|
692
|
+
* @example
|
|
693
|
+
* ```
|
|
694
|
+
* const prisma = new PrismaClient({
|
|
695
|
+
* adapter,
|
|
696
|
+
* comments: [
|
|
697
|
+
* traceContext(),
|
|
698
|
+
* queryInsights(),
|
|
699
|
+
* ],
|
|
700
|
+
* })
|
|
701
|
+
* ```
|
|
702
|
+
*/
|
|
703
|
+
comments?: runtime.SqlCommenterPlugin[]
|
|
704
|
+
/**
|
|
705
|
+
* Optional maximum size for the query plan cache. If not provided, a default size will be used.
|
|
706
|
+
* A value of `0` can be used to disable the cache entirely. A higher cache size can improve
|
|
707
|
+
* performance for applications that execute a large number of unique queries, while a smaller
|
|
708
|
+
* cache size can reduce memory usage.
|
|
709
|
+
*
|
|
710
|
+
* @example
|
|
711
|
+
* ```
|
|
712
|
+
* const prisma = new PrismaClient({
|
|
713
|
+
* adapter,
|
|
714
|
+
* queryPlanCacheMaxSize: 100,
|
|
715
|
+
* })
|
|
716
|
+
* ```
|
|
717
|
+
*/
|
|
718
|
+
queryPlanCacheMaxSize?: number
|
|
698
719
|
}
|
|
720
|
+
|
|
721
|
+
/**
|
|
722
|
+
* `PrismaClient` options for connecting to your database through Prisma Accelerate instead of a driver adapter.
|
|
723
|
+
*
|
|
724
|
+
* Learn more: https://pris.ly/d/accelerate
|
|
725
|
+
*/
|
|
726
|
+
export interface PrismaClientOptionsWithAccelerateUrl extends PrismaClientBaseOptions {
|
|
727
|
+
/**
|
|
728
|
+
* 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.
|
|
729
|
+
*
|
|
730
|
+
* Learn more: https://pris.ly/d/accelerate
|
|
731
|
+
*/
|
|
732
|
+
accelerateUrl: string
|
|
733
|
+
adapter?: never
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
/**
|
|
737
|
+
* `PrismaClient` options for connecting to your database through a driver adapter. This is the common case in Prisma 7.
|
|
738
|
+
*
|
|
739
|
+
* Learn more: https://pris.ly/d/driver-adapters
|
|
740
|
+
*/
|
|
741
|
+
export interface PrismaClientOptionsWithAdapter extends PrismaClientBaseOptions {
|
|
742
|
+
/**
|
|
743
|
+
* 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.
|
|
744
|
+
*
|
|
745
|
+
* A driver adapter is **required** unless you connect to your database through Prisma Accelerate (in which case use `accelerateUrl` instead).
|
|
746
|
+
*
|
|
747
|
+
* Learn more: https://pris.ly/d/driver-adapters
|
|
748
|
+
*
|
|
749
|
+
* @example
|
|
750
|
+
* ```ts
|
|
751
|
+
* import { PrismaPg } from '@prisma/adapter-pg'
|
|
752
|
+
* import { PrismaClient } from './generated/prisma/client'
|
|
753
|
+
*
|
|
754
|
+
* const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL })
|
|
755
|
+
* const prisma = new PrismaClient({ adapter })
|
|
756
|
+
* ```
|
|
757
|
+
*/
|
|
758
|
+
adapter: runtime.SqlDriverAdapterFactory
|
|
759
|
+
accelerateUrl?: never
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
/**
|
|
763
|
+
* Options passed to the `PrismaClient` constructor.
|
|
764
|
+
*
|
|
765
|
+
* 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.
|
|
766
|
+
*
|
|
767
|
+
* Learn more about driver adapters: https://pris.ly/d/driver-adapters
|
|
768
|
+
*/
|
|
769
|
+
export type PrismaClientOptions = PrismaClientOptionsWithAccelerateUrl | PrismaClientOptionsWithAdapter
|
|
699
770
|
export type GlobalOmitConfig = {
|
|
700
771
|
user?: Prisma.UserOmit
|
|
701
772
|
}
|
|
@@ -24,28 +24,30 @@ export const Decimal = runtime.Decimal
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
export const NullTypes = {
|
|
27
|
-
DbNull: runtime.
|
|
28
|
-
JsonNull: runtime.
|
|
29
|
-
AnyNull: runtime.
|
|
27
|
+
DbNull: runtime.NullTypes.DbNull as (new (secret: never) => typeof runtime.DbNull),
|
|
28
|
+
JsonNull: runtime.NullTypes.JsonNull as (new (secret: never) => typeof runtime.JsonNull),
|
|
29
|
+
AnyNull: runtime.NullTypes.AnyNull as (new (secret: never) => typeof runtime.AnyNull),
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* Helper for filtering JSON entries that have `null` on the database (empty on the db)
|
|
33
33
|
*
|
|
34
34
|
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
|
|
35
35
|
*/
|
|
36
|
-
export const DbNull = runtime.
|
|
36
|
+
export const DbNull = runtime.DbNull
|
|
37
|
+
|
|
37
38
|
/**
|
|
38
39
|
* Helper for filtering JSON entries that have JSON `null` values (not empty on the db)
|
|
39
40
|
*
|
|
40
41
|
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
|
|
41
42
|
*/
|
|
42
|
-
export const JsonNull = runtime.
|
|
43
|
+
export const JsonNull = runtime.JsonNull
|
|
44
|
+
|
|
43
45
|
/**
|
|
44
46
|
* Helper for filtering JSON entries that are `Prisma.DbNull` or `Prisma.JsonNull`
|
|
45
47
|
*
|
|
46
48
|
* @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field
|
|
47
49
|
*/
|
|
48
|
-
export const AnyNull = runtime.
|
|
50
|
+
export const AnyNull = runtime.AnyNull
|
|
49
51
|
|
|
50
52
|
|
|
51
53
|
export const ModelName = {
|
|
@@ -156,7 +156,7 @@ export type UserGroupByOutputType = {
|
|
|
156
156
|
_max: UserMaxAggregateOutputType | null
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
type GetUserGroupByPayload<T extends UserGroupByArgs> = Prisma.PrismaPromise<
|
|
159
|
+
export type GetUserGroupByPayload<T extends UserGroupByArgs> = Prisma.PrismaPromise<
|
|
160
160
|
Array<
|
|
161
161
|
Prisma.PickEnumerable<UserGroupByOutputType, T['by']> &
|
|
162
162
|
{
|
|
@@ -941,6 +941,11 @@ export type UserFindManyArgs<ExtArgs extends runtime.Types.Extensions.InternalAr
|
|
|
941
941
|
* Skip the first `n` Users.
|
|
942
942
|
*/
|
|
943
943
|
skip?: number | runtime.Types.Skip
|
|
944
|
+
/**
|
|
945
|
+
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
|
|
946
|
+
*
|
|
947
|
+
* Filter by unique combinations of Users.
|
|
948
|
+
*/
|
|
944
949
|
distinct?: Prisma.UserScalarFieldEnum | Prisma.UserScalarFieldEnum[] | runtime.Types.Skip
|
|
945
950
|
relationLoadStrategy?: Prisma.RelationLoadStrategy | runtime.Types.Skip
|
|
946
951
|
}
|
package/src/jwt/jwt-keys.ts
CHANGED
|
@@ -31,7 +31,11 @@ export type JwtKeys = Readonly<{
|
|
|
31
31
|
signingKey: Readonly<CryptoKey>;
|
|
32
32
|
}>;
|
|
33
33
|
|
|
34
|
-
const signingKeyOptions: [
|
|
34
|
+
const signingKeyOptions: [
|
|
35
|
+
HmacKeyGenParams,
|
|
36
|
+
boolean,
|
|
37
|
+
ReadonlyArray<KeyUsage>,
|
|
38
|
+
] = [
|
|
35
39
|
{
|
|
36
40
|
name: 'HMAC',
|
|
37
41
|
hash: 'SHA-512',
|
|
@@ -91,21 +95,22 @@ export async function generateNewJwtKeys(): Promise<RawJwtKeys> {
|
|
|
91
95
|
export async function parseJwtKeys(rawKeys: Readonly<RawJwtKeys>): Promise<Readonly<JwtKeys>> {
|
|
92
96
|
if (!rawKeys.encryptionKey) {
|
|
93
97
|
throw new Error('JWT encryption key is empty');
|
|
94
|
-
} else if (
|
|
98
|
+
} else if (rawKeys.signingKey) {
|
|
99
|
+
return {
|
|
100
|
+
encryptionKey: base64url.decode(rawKeys.encryptionKey),
|
|
101
|
+
signingKey: await crypto.subtle.importKey(
|
|
102
|
+
'jwk',
|
|
103
|
+
{
|
|
104
|
+
k: rawKeys.signingKey,
|
|
105
|
+
alg: 'HS512',
|
|
106
|
+
ext: signingKeyOptions[1],
|
|
107
|
+
key_ops: [...signingKeyOptions[2]],
|
|
108
|
+
kty: 'oct',
|
|
109
|
+
},
|
|
110
|
+
...signingKeyOptions,
|
|
111
|
+
),
|
|
112
|
+
};
|
|
113
|
+
} else {
|
|
95
114
|
throw new Error('JWT signing key is empty');
|
|
96
115
|
}
|
|
97
|
-
return {
|
|
98
|
-
encryptionKey: base64url.decode(rawKeys.encryptionKey),
|
|
99
|
-
signingKey: await crypto.subtle.importKey(
|
|
100
|
-
'jwk',
|
|
101
|
-
{
|
|
102
|
-
k: rawKeys.signingKey,
|
|
103
|
-
alg: 'HS512',
|
|
104
|
-
ext: signingKeyOptions[1],
|
|
105
|
-
key_ops: [...signingKeyOptions[2]],
|
|
106
|
-
kty: 'oct',
|
|
107
|
-
},
|
|
108
|
-
...signingKeyOptions,
|
|
109
|
-
),
|
|
110
|
-
};
|
|
111
116
|
}
|