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
|
@@ -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
|
}
|